diff --git a/builds/respec-aom.js b/builds/respec-aom.js index 92ceb93b2b..6a1d79321f 100644 --- a/builds/respec-aom.js +++ b/builds/respec-aom.js @@ -1,4 +1,4 @@ -window.respecVersion="33.0.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=new EventTarget;function r(e,t){if(n.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const r=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:r},window.parent.location.origin)}function o(e,t,r={once:!1}){n.addEventListener(e,(e=>t(e.detail)),r)}t("core/pubsubhub",{sub:o});const i=["githubToken","githubUser"];const s=document.documentElement;s&&!s.hasAttribute("lang")&&(s.lang="en",s.hasAttribute("dir")||(s.dir="ltr"));const a={},l=s.lang;var c=Object.freeze({__proto__:null,l10n:a,lang:l,name:"core/l10n",run:function(e){e.l10n=a[l]||a.en}});let u,d;const p=new WeakMap,f=new WeakMap,h=new WeakMap,m=new WeakMap,g=new WeakMap;let b={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return f.get(e);if("objectStoreNames"===t)return e.objectStoreNames||h.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return v(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function y(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(d||(d=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(x(this),t),v(p.get(this))}:function(...t){return v(e.apply(x(this),t))}:function(t,...n){const r=e.call(x(this),t,...n);return h.set(r,t.sort?t.sort():[t]),v(r)}}function w(e){return"function"==typeof e?y(e):(e instanceof IDBTransaction&&function(e){if(f.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)}));f.set(e,t)}(e),t=e,(u||(u=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,b):e);var t}function v(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(v(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",i)}));return t.then((t=>{t instanceof IDBCursor&&p.set(t,e)})).catch((()=>{})),g.set(t,e),t}(e);if(m.has(e))return m.get(e);const t=w(e);return t!==e&&(m.set(e,t),g.set(t,e)),t}const x=e=>g.get(e);const k=["get","getKey","getAll","getAllKeys","count"],$=["put","add","delete","clear"],_=new Map;function E(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(_.get(t))return _.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=$.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!k.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 _.set(t,i),i}b=(e=>({...e,get:(t,n,r)=>E(t,n)||e.get(t,n,r),has:(t,n)=>!!E(t,n)||e.has(t,n)}))(b);var S=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),v(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:i}={}){const s=indexedDB.open(e,t),a=v(s);return r&&s.addEventListener("upgradeneeded",(e=>{r(v(s.result),e.oldVersion,e.newVersion,v(s.transaction),e)})),n&&s.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{i&&e.addEventListener("close",(()=>i())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:x,wrap:v});const C=/^[!#$%&'*+-.^`|~\w]+$/,A=/[\u000A\u000D\u0009\u0020]/u,L=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function T(e,t,n){(t&&""!==t&&!e.has(t)&&L.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function R(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let N={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const O=/[&<>"']/,D=new RegExp(O.source,"g"),I=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,P=new RegExp(I.source,"g"),z={"&":"&","<":"<",">":">",'"':""","'":"'"},j=e=>z[e];function M(e,t){if(t){if(O.test(e))return e.replace(D,j)}else if(I.test(e))return e.replace(P,j);return e}const q=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function F(e){return e.replace(q,((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 B=/(^|[^\[])\^/g;function H(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(B,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const W=/[^\w:]/g,U=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function V(e,t,n){if(e){let e;try{e=decodeURIComponent(F(n)).replace(W,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!U.test(n)&&(n=function(e,t){Z[" "+e]||(G.test(e)?Z[" "+e]=e+"/":Z[" "+e]=J(e,"/",!0));const n=-1===(e=Z[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(Y,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(K,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const Z={},G=/^[^:]+:\/*[^/]*$/,Y=/^([^:]+:)[\s\S]*$/,K=/^([^:]+:\/*[^/]*)[\s\S]*$/;const Q={exec:function(){}};function X(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function te(e,t,n,r){const o=t.href,i=t.title?M(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:i,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:i,text:M(s)}}class ne{constructor(e){this.options=e||N}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}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:J(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().replace(this.rules.inline._escapes,"$1"):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=J(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,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,o,i,s,a,l,c,u,d,p,f,h=t[1].trim();const m=h.length>1,g={type:"list",raw:"",ordered:m,start:m?+h.slice(0,-1):"",loose:!1,items:[]};h=m?`\\d{1,9}\\${h.slice(-1)}`:`\\${h}`,this.options.pedantic&&(h=m?h:"[*+-]");const b=new RegExp(`^( {0,3}${h})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,t=b.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),c=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),u=e.split("\n",1)[0],this.options.pedantic?(i=2,p=c.trimLeft()):(i=t[2].search(/[^ ]/),i=i>4?1:i,p=c.slice(i),i+=t[1].length),a=!1,!c&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),f=!0),!f){const t=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),o=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),s=new RegExp(`^ {0,${Math.min(3,i-1)}}#`);for(;e&&(d=e.split("\n",1)[0],u=d,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!o.test(u))&&!s.test(u)&&!t.test(u)&&!r.test(e);){if(u.search(/[^ ]/)>=i||!u.trim())p+="\n"+u.slice(i);else{if(a)break;if(c.search(/[^ ]/)>=4)break;if(o.test(c))break;if(s.test(c))break;if(r.test(c))break;p+="\n"+u}a||u.trim()||(a=!0),n+=d+"\n",e=e.substring(d.length+1),c=u.slice(i)}}g.loose||(l?g.loose=!0:/\n *\n *$/.test(n)&&(l=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(o="[ ] "!==r[0],p=p.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!r,checked:o,loose:!1,text:p}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=p.trimRight(),g.raw=g.raw.trimRight();const y=g.items.length;for(s=0;s"space"===e.type)),t=e.length>0&&e.some((e=>/\n.*\n/.test(e.raw)));g.loose=t}if(g.loose)for(s=0;s$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:X(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,o,i,s=e.align.length;for(n=0;n({text:e})));for(s=e.header.length,r=0;r/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):M(t[0]):t[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=J(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,o=0;for(;o-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)),te(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}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){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return te(n,e,n[0],this.lexer)}}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)continue;if(i=o.length,r[3]||r[4]){s+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(s-=i,s>0)continue;i=Math.min(i,i+s+a);const t=e.slice(0,n+r.index+(r[0].length-o.length)+i);if(Math.min(n,i)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const l=t.slice(2,-2);return{type:"strong",raw:t,text:l,tokens:this.lexer.inlineTokens(l)}}}}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=M(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],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=M(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=M(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=M(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=M(n[0]),r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):M(n[0]):n[0]:M(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const 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}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,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 *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Q,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};re.def=H(re.def).replace("label",re._label).replace("title",re._title).getRegex(),re.bullet=/(?:[*+-]|\d{1,9}[.)])/,re.listItemStart=H(/^( *)(bull) */).replace("bull",re.bullet).getRegex(),re.list=H(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=H(re.html,"i").replace("comment",re._comment).replace("tag",re._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),re.paragraph=H(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").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=H(re.blockquote).replace("paragraph",re.paragraph).getRegex(),re.normal={...re},re.gfm={...re.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},re.gfm.table=H(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.gfm.paragraph=H(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",re.gfm.table).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.pedantic={...re.normal,html:H("^ *(?: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:Q,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:H(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:Q,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,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:Q,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}oe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",oe.punctuation=H(oe.punctuation).replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,oe.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,oe._comment=H(re._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),oe.emStrong.lDelim=H(oe.emStrong.lDelim).replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimAst=H(oe.emStrong.rDelimAst,"g").replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimUnd=H(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=H(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=H(oe.tag).replace("comment",oe._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=H(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=H(oe.reflink).replace("label",oe._label).replace("ref",re._label).getRegex(),oe.nolink=H(oe.nolink).replace("ref",re._label).getRegex(),oe.reflinkSearch=H(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal={...oe},oe.pedantic={...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:H(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:H(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()},oe.gfm={...oe.normal,escape:H(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]*?(?:(?=[\\t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);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 this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,o,i,s,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,i.index)+"["+ee("a",i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,i.index)+"["+ee("a",i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,i.index+i[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(s||(a=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,se))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,se))){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({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o,ie))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);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(n.raw.length),t.push(n);return t}}let le=class{constructor(e){this.options=e||N}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:M(e,!0))+"
\n":"
"+(n?e:M(e,!0))+"
\n"}blockquote(e){return`
\n${e}
\n`}html(e){return e}heading(e,t,n,r){if(this.options.headerIds){return`${e}\n`}return`${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=V(this.options.sanitize,this.options.baseUrl,e)))return n;let r='",r}image(e,t,n){if(null===(e=V(this.options.sanitize,this.options.baseUrl,e)))return n;let r=`${n}":">",r}text(e){return e}};class ce{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""}}class ue{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)}}class de{constructor(e){this.options=e||N,this.options.renderer=this.options.renderer||new le,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ce,this.slugger=new ue}static parse(e,t){return new de(t).parse(e)}static parseInline(e,t){return new de(t).parseInline(e)}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&&"paragraph"===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{"function"==typeof r&&(o=r,r=null);const i={...r},s=function(e,t,n){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+M(r.message+"",!0)+"
    ";return t?Promise.resolve(e):n?void n(null,e):e}if(t)return Promise.reject(r);if(!n)throw r;n(r)}}((r={...he.defaults,...i}).silent,r.async,o);if(null==n)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}(r),r.hooks&&(r.hooks.options=r),o){const i=r.highlight;let a;try{r.hooks&&(n=r.hooks.preprocess(n)),a=e(n,r)}catch(e){return s(e)}const l=function(e){let n;if(!e)try{r.walkTokens&&he.walkTokens(a,r.walkTokens),n=t(a,r),r.hooks&&(n=r.hooks.postprocess(n))}catch(t){e=t}return r.highlight=i,e?s(e):o(null,n)};if(!i||i.length<3)return l();if(delete r.highlight,!a.length)return l();let c=0;return he.walkTokens(a,(function(e){"code"===e.type&&(c++,setTimeout((()=>{i(e.text,e.lang,(function(t,n){if(t)return l(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),c--,0===c&&l()}))}),0))})),void(0===c&&l())}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then((t=>e(t,r))).then((e=>r.walkTokens?Promise.all(he.walkTokens(e,r.walkTokens)).then((()=>e)):e)).then((e=>t(e,r))).then((e=>r.hooks?r.hooks.postprocess(e):e)).catch(s);try{r.hooks&&(n=r.hooks.preprocess(n));const o=e(n,r);r.walkTokens&&he.walkTokens(o,r.walkTokens);let i=t(o,r);return r.hooks&&(i=r.hooks.postprocess(i)),i}catch(e){return s(e)}}}function he(e,t,n){return fe(ae.lex,de.parse)(e,t,n)}he.options=he.setOptions=function(e){var t;return he.defaults={...he.defaults,...e},t=he.defaults,N=t,he},he.getDefaults=R,he.defaults=N,he.use=function(...e){const t=he.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((e=>{const n={...e};if(n.async=he.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),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'");t[e.level]?t[e.level].unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=he.defaults.renderer||new le;for(const n in e.renderer){const r=t[n];t[n]=(...o)=>{let i=e.renderer[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.renderer=t}if(e.tokenizer){const t=he.defaults.tokenizer||new ne;for(const n in e.tokenizer){const r=t[n];t[n]=(...o)=>{let i=e.tokenizer[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.tokenizer=t}if(e.hooks){const t=he.defaults.hooks||new pe;for(const n in e.hooks){const r=t[n];pe.passThroughHooks.has(n)?t[n]=o=>{if(he.defaults.async)return Promise.resolve(e.hooks[n].call(t,o)).then((e=>r.call(t,e)));const i=e.hooks[n].call(t,o);return r.call(t,i)}:t[n]=(...o)=>{let i=e.hooks[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.hooks=t}if(e.walkTokens){const t=he.defaults.walkTokens;n.walkTokens=function(n){let r=[];return r.push(e.walkTokens.call(this,n)),t&&(r=r.concat(t.call(this,n))),r}}he.setOptions(n)}))},he.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(he,r)),r.type){case"table":for(const e of r.header)n=n.concat(he.walkTokens(e.tokens,t));for(const e of r.rows)for(const r of e)n=n.concat(he.walkTokens(r.tokens,t));break;case"list":n=n.concat(he.walkTokens(r.items,t));break;default:he.defaults.extensions&&he.defaults.extensions.childTokens&&he.defaults.extensions.childTokens[r.type]?he.defaults.extensions.childTokens[r.type].forEach((function(e){n=n.concat(he.walkTokens(r[e],t))})):r.tokens&&(n=n.concat(he.walkTokens(r.tokens,t)))}return n},he.parseInline=fe(ae.lexInline,de.parseInline),he.Parser=de,he.parser=de.parse,he.Renderer=le,he.TextRenderer=ce,he.Lexer=ae,he.lexer=ae.lex,he.Tokenizer=ne,he.Slugger=ue,he.Hooks=pe,he.parse=he,he.options,he.setOptions,he.use,he.walkTokens,he.parseInline;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var me,ge={};me={get exports(){return ge},set exports(e){ge=e}},function(e,t){me.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 be=ge,ye=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,H,W,U,V,Z,G=(q="appendChild",F="cloneNode",B="createTextNode",W=(H="importNode")in(M=e),(U=M.createDocumentFragment())[q](M[B]("g")),U[q](M[B]("")),(W?M[H](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

    ',V.content.childNodes[0].getAttribute(Z)==K)||(K="_dt: "+K.slice(1,-1)+";",Q=!0)}catch(u){}var X="\x3c!--"+K+"--\x3e",J=/^(?: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*)(['\"]?)"+X+"\\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=Q?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=new EventTarget;function r(e,t){if(n.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const r=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:r},window.parent.location.origin)}function o(e,t,r={once:!1}){n.addEventListener(e,(e=>t(e.detail)),r)}t("core/pubsubhub",{sub:o});const i=["githubToken","githubUser"];const s=document.documentElement;s&&!s.hasAttribute("lang")&&(s.lang="en",s.hasAttribute("dir")||(s.dir="ltr"));const a={},l=s.lang;var c=Object.freeze({__proto__:null,l10n:a,lang:l,name:"core/l10n",run:function(e){e.l10n=a[l]||a.en}});let u,d;const p=new WeakMap,f=new WeakMap,h=new WeakMap,m=new WeakMap,g=new WeakMap;let b={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return f.get(e);if("objectStoreNames"===t)return e.objectStoreNames||h.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return v(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function y(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(d||(d=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(x(this),t),v(p.get(this))}:function(...t){return v(e.apply(x(this),t))}:function(t,...n){const r=e.call(x(this),t,...n);return h.set(r,t.sort?t.sort():[t]),v(r)}}function w(e){return"function"==typeof e?y(e):(e instanceof IDBTransaction&&function(e){if(f.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)}));f.set(e,t)}(e),t=e,(u||(u=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,b):e);var t}function v(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(v(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",i)}));return t.then((t=>{t instanceof IDBCursor&&p.set(t,e)})).catch((()=>{})),g.set(t,e),t}(e);if(m.has(e))return m.get(e);const t=w(e);return t!==e&&(m.set(e,t),g.set(t,e)),t}const x=e=>g.get(e);const k=["get","getKey","getAll","getAllKeys","count"],$=["put","add","delete","clear"],_=new Map;function E(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(_.get(t))return _.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=$.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!k.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 _.set(t,i),i}b=(e=>({...e,get:(t,n,r)=>E(t,n)||e.get(t,n,r),has:(t,n)=>!!E(t,n)||e.has(t,n)}))(b);var S=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),v(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:i}={}){const s=indexedDB.open(e,t),a=v(s);return r&&s.addEventListener("upgradeneeded",(e=>{r(v(s.result),e.oldVersion,e.newVersion,v(s.transaction),e)})),n&&s.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{i&&e.addEventListener("close",(()=>i())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:x,wrap:v});const C=/^[!#$%&'*+-.^`|~\w]+$/,A=/[\u000A\u000D\u0009\u0020]/u,L=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function T(e,t,n){(t&&""!==t&&!e.has(t)&&L.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function R(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let N={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const O=/[&<>"']/,D=new RegExp(O.source,"g"),I=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,P=new RegExp(I.source,"g"),z={"&":"&","<":"<",">":">",'"':""","'":"'"},j=e=>z[e];function M(e,t){if(t){if(O.test(e))return e.replace(D,j)}else if(I.test(e))return e.replace(P,j);return e}const q=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function F(e){return e.replace(q,((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 B=/(^|[^\[])\^/g;function H(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(B,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const W=/[^\w:]/g,U=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function V(e,t,n){if(e){let e;try{e=decodeURIComponent(F(n)).replace(W,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!U.test(n)&&(n=function(e,t){Z[" "+e]||(G.test(e)?Z[" "+e]=e+"/":Z[" "+e]=J(e,"/",!0));const n=-1===(e=Z[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(Y,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(K,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const Z={},G=/^[^:]+:\/*[^/]*$/,Y=/^([^:]+:)[\s\S]*$/,K=/^([^:]+:\/*[^/]*)[\s\S]*$/;const Q={exec:function(){}};function X(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function te(e,t,n,r){const o=t.href,i=t.title?M(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:i,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:i,text:M(s)}}class ne{constructor(e){this.options=e||N}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}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:J(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().replace(this.rules.inline._escapes,"$1"):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=J(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,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,o,i,s,a,l,c,u,d,p,f,h=t[1].trim();const m=h.length>1,g={type:"list",raw:"",ordered:m,start:m?+h.slice(0,-1):"",loose:!1,items:[]};h=m?`\\d{1,9}\\${h.slice(-1)}`:`\\${h}`,this.options.pedantic&&(h=m?h:"[*+-]");const b=new RegExp(`^( {0,3}${h})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,t=b.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),c=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),u=e.split("\n",1)[0],this.options.pedantic?(i=2,p=c.trimLeft()):(i=t[2].search(/[^ ]/),i=i>4?1:i,p=c.slice(i),i+=t[1].length),a=!1,!c&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),f=!0),!f){const t=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),o=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),s=new RegExp(`^ {0,${Math.min(3,i-1)}}#`);for(;e&&(d=e.split("\n",1)[0],u=d,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!o.test(u))&&!s.test(u)&&!t.test(u)&&!r.test(e);){if(u.search(/[^ ]/)>=i||!u.trim())p+="\n"+u.slice(i);else{if(a)break;if(c.search(/[^ ]/)>=4)break;if(o.test(c))break;if(s.test(c))break;if(r.test(c))break;p+="\n"+u}a||u.trim()||(a=!0),n+=d+"\n",e=e.substring(d.length+1),c=u.slice(i)}}g.loose||(l?g.loose=!0:/\n *\n *$/.test(n)&&(l=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(o="[ ] "!==r[0],p=p.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!r,checked:o,loose:!1,text:p}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=p.trimRight(),g.raw=g.raw.trimRight();const y=g.items.length;for(s=0;s"space"===e.type)),t=e.length>0&&e.some((e=>/\n.*\n/.test(e.raw)));g.loose=t}if(g.loose)for(s=0;s$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:X(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,o,i,s=e.align.length;for(n=0;n({text:e})));for(s=e.header.length,r=0;r/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):M(t[0]):t[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=J(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,o=0;for(;o-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)),te(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}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){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return te(n,e,n[0],this.lexer)}}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)continue;if(i=o.length,r[3]||r[4]){s+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(s-=i,s>0)continue;i=Math.min(i,i+s+a);const t=e.slice(0,n+r.index+(r[0].length-o.length)+i);if(Math.min(n,i)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const l=t.slice(2,-2);return{type:"strong",raw:t,text:l,tokens:this.lexer.inlineTokens(l)}}}}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=M(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],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=M(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=M(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=M(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=M(n[0]),r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):M(n[0]):n[0]:M(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const 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}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,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 *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Q,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};re.def=H(re.def).replace("label",re._label).replace("title",re._title).getRegex(),re.bullet=/(?:[*+-]|\d{1,9}[.)])/,re.listItemStart=H(/^( *)(bull) */).replace("bull",re.bullet).getRegex(),re.list=H(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=H(re.html,"i").replace("comment",re._comment).replace("tag",re._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),re.paragraph=H(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").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=H(re.blockquote).replace("paragraph",re.paragraph).getRegex(),re.normal={...re},re.gfm={...re.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},re.gfm.table=H(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.gfm.paragraph=H(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",re.gfm.table).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.pedantic={...re.normal,html:H("^ *(?: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:Q,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:H(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:Q,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,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:Q,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}oe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",oe.punctuation=H(oe.punctuation).replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,oe.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,oe._comment=H(re._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),oe.emStrong.lDelim=H(oe.emStrong.lDelim).replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimAst=H(oe.emStrong.rDelimAst,"g").replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimUnd=H(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=H(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=H(oe.tag).replace("comment",oe._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=H(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=H(oe.reflink).replace("label",oe._label).replace("ref",re._label).getRegex(),oe.nolink=H(oe.nolink).replace("ref",re._label).getRegex(),oe.reflinkSearch=H(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal={...oe},oe.pedantic={...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:H(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:H(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()},oe.gfm={...oe.normal,escape:H(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]*?(?:(?=[\\t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);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 this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,o,i,s,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,i.index)+"["+ee("a",i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,i.index)+"["+ee("a",i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,i.index+i[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(s||(a=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,se))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,se))){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({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o,ie))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);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(n.raw.length),t.push(n);return t}}let le=class{constructor(e){this.options=e||N}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:M(e,!0))+"
    \n":"
    "+(n?e:M(e,!0))+"
    \n"}blockquote(e){return`
    \n${e}
    \n`}html(e){return e}heading(e,t,n,r){if(this.options.headerIds){return`${e}\n`}return`${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=V(this.options.sanitize,this.options.baseUrl,e)))return n;let r='
    ",r}image(e,t,n){if(null===(e=V(this.options.sanitize,this.options.baseUrl,e)))return n;let r=`${n}":">",r}text(e){return e}};class ce{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""}}class ue{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)}}class de{constructor(e){this.options=e||N,this.options.renderer=this.options.renderer||new le,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ce,this.slugger=new ue}static parse(e,t){return new de(t).parse(e)}static parseInline(e,t){return new de(t).parseInline(e)}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&&"paragraph"===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{"function"==typeof r&&(o=r,r=null);const i={...r},s=function(e,t,n){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+M(r.message+"",!0)+"
    ";return t?Promise.resolve(e):n?void n(null,e):e}if(t)return Promise.reject(r);if(!n)throw r;n(r)}}((r={...he.defaults,...i}).silent,r.async,o);if(null==n)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}(r),r.hooks&&(r.hooks.options=r),o){const i=r.highlight;let a;try{r.hooks&&(n=r.hooks.preprocess(n)),a=e(n,r)}catch(e){return s(e)}const l=function(e){let n;if(!e)try{r.walkTokens&&he.walkTokens(a,r.walkTokens),n=t(a,r),r.hooks&&(n=r.hooks.postprocess(n))}catch(t){e=t}return r.highlight=i,e?s(e):o(null,n)};if(!i||i.length<3)return l();if(delete r.highlight,!a.length)return l();let c=0;return he.walkTokens(a,(function(e){"code"===e.type&&(c++,setTimeout((()=>{i(e.text,e.lang,(function(t,n){if(t)return l(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),c--,0===c&&l()}))}),0))})),void(0===c&&l())}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then((t=>e(t,r))).then((e=>r.walkTokens?Promise.all(he.walkTokens(e,r.walkTokens)).then((()=>e)):e)).then((e=>t(e,r))).then((e=>r.hooks?r.hooks.postprocess(e):e)).catch(s);try{r.hooks&&(n=r.hooks.preprocess(n));const o=e(n,r);r.walkTokens&&he.walkTokens(o,r.walkTokens);let i=t(o,r);return r.hooks&&(i=r.hooks.postprocess(i)),i}catch(e){return s(e)}}}function he(e,t,n){return fe(ae.lex,de.parse)(e,t,n)}he.options=he.setOptions=function(e){var t;return he.defaults={...he.defaults,...e},t=he.defaults,N=t,he},he.getDefaults=R,he.defaults=N,he.use=function(...e){const t=he.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((e=>{const n={...e};if(n.async=he.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),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'");t[e.level]?t[e.level].unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=he.defaults.renderer||new le;for(const n in e.renderer){const r=t[n];t[n]=(...o)=>{let i=e.renderer[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.renderer=t}if(e.tokenizer){const t=he.defaults.tokenizer||new ne;for(const n in e.tokenizer){const r=t[n];t[n]=(...o)=>{let i=e.tokenizer[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.tokenizer=t}if(e.hooks){const t=he.defaults.hooks||new pe;for(const n in e.hooks){const r=t[n];pe.passThroughHooks.has(n)?t[n]=o=>{if(he.defaults.async)return Promise.resolve(e.hooks[n].call(t,o)).then((e=>r.call(t,e)));const i=e.hooks[n].call(t,o);return r.call(t,i)}:t[n]=(...o)=>{let i=e.hooks[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.hooks=t}if(e.walkTokens){const t=he.defaults.walkTokens;n.walkTokens=function(n){let r=[];return r.push(e.walkTokens.call(this,n)),t&&(r=r.concat(t.call(this,n))),r}}he.setOptions(n)}))},he.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(he,r)),r.type){case"table":for(const e of r.header)n=n.concat(he.walkTokens(e.tokens,t));for(const e of r.rows)for(const r of e)n=n.concat(he.walkTokens(r.tokens,t));break;case"list":n=n.concat(he.walkTokens(r.items,t));break;default:he.defaults.extensions&&he.defaults.extensions.childTokens&&he.defaults.extensions.childTokens[r.type]?he.defaults.extensions.childTokens[r.type].forEach((function(e){n=n.concat(he.walkTokens(r[e],t))})):r.tokens&&(n=n.concat(he.walkTokens(r.tokens,t)))}return n},he.parseInline=fe(ae.lexInline,de.parseInline),he.Parser=de,he.parser=de.parse,he.Renderer=le,he.TextRenderer=ce,he.Lexer=ae,he.lexer=ae.lex,he.Tokenizer=ne,he.Slugger=ue,he.Hooks=pe,he.parse=he,he.options,he.setOptions,he.use,he.walkTokens,he.parseInline;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var me,ge={};me={get exports(){return ge},set exports(e){ge=e}},function(e,t){me.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 be=ge,ye=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,H,W,U,V,Z,G=(q="appendChild",F="cloneNode",B="createTextNode",W=(H="importNode")in(M=e),(U=M.createDocumentFragment())[q](M[B]("g")),U[q](M[B]("")),(W?M[H](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

    ',V.content.childNodes[0].getAttribute(Z)==K)||(K="_dt: "+K.slice(1,-1)+";",Q=!0)}catch(u){}var X="\x3c!--"+K+"--\x3e",J=/^(?: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*)(['\"]?)"+X+"\\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=Q?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;ae.trim())).map((e=>e.search(/[^\s]/))),r=Math.min(...n);return t.map((e=>e.slice(r))).join("\n")}var Ee=Object.freeze({__proto__:null,name:"core/reindent",reindent:_e,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=_e(e.innerHTML)}});const Se=/-/g,Ce=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Ae="en"===l||l.startsWith("en-")?"en-AU":l,Le=new Intl.DateTimeFormat(Ae,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===Ae?"2-digit":"numeric"});function Te(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as),e.corsMode&&(n.crossOrigin=e.corsMode)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function Re(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function Ne(e,t="long"){const n=new Intl.ListFormat(l,{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 Oe=Ne("conjunction"),De=Ne("disjunction");function Ie(e,t){return Oe(e,t).join("")}function Pe(e){return e.trim().replace(/\s+/g," ")}function ze(e,t=l){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=function(e,t,n=l){return n=n.toLowerCase(),e[n]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function je(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){et(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}function Me(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 qe(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 Fe(e){const t=new Set,n="ltNodefault"in e.dataset?"":Pe(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>Pe(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(Pe(e))))}return[...t]}function Be(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 He(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 We(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function Ue(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 Ve(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 Ze 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 Ge(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{Be(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),Ye(t),t}function Ye(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...Ke(t)])e.remove()}function*Ke(e){for(;e.nextNode();)yield e.currentNode}class Qe 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 Xe 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||qe(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 Je(e,t,n={}){const o={...n,isWarning:!1};r("error",new Xe(e,t,o))}function et(e,t,n={}){const o={...n,isWarning:!0};r("warn",new Xe(e,t,o))}function tt(e){return e?`\`${e}\``:""}function nt(e,{quotes:t}={quotes:!1}){return De(e,t?e=>{return tt((t=e,String(t)?`"${t}"`:""));var t}:tt).join("")}function rt(e,...t){return _e(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 ot=new Map([["text/html","html"],["application/xml","xml"]]);function it(e,t=document){const n=ot.get(e);if(!n){const t=[...ot.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=st(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function st(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:o}=e;Ye(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),Re(o);const i=e.createDocumentFragment(),s=e.querySelector("meta[name='viewport']");s&&t.firstChild!==s&&i.appendChild(s);let a=e.querySelector("meta[charset], meta[content*='charset=']");a||(a=we``);i.appendChild(a);const l=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=we` `;i.appendChild(c),t.prepend(i),r("beforesave",o)}(n);let o="";if("xml"===e)o=(new XMLSerializer).serializeToString(n);else!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&&(o+=(new XMLSerializer).serializeToString(n.doctype)),o+=n.documentElement.outerHTML;return o}t("core/exporter",{rsDocToDataURL:it});class at{constructor(){this._respecDonePromise=new Promise((e=>{o("end-all",(()=>e()),{once:!0})})),this.errors=[],this.warnings=[],o("error",(e=>{console.error(e,e.toJSON()),this.errors.push(e)})),o("warn",(e=>{console.warn(e,e.toJSON()),this.warnings.push(e)}))}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return st("html",document)}}const lt="core/post-process";const ct="core/pre-process";const ut="core/base-runner";async function dt(e){!function(){const e=new at;Object.defineProperty(document,"respec",{value:e})}(),r("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),o("amend-user-config",n),o("end-all",(()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of i)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]})),o=Object.fromEntries(n);Object.assign(e,o),r("amend-user-config",o)}(respecConfig),performance.mark(`${ut}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||Je("Every item in `preProcess` must be a JS function.",ct),t})).map((async t=>{try{return await t(e,document)}catch(e){Je(`Function ${t.name} threw an error during \`preProcess\`.`,ct,{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={},r("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||Je("Every item in `postProcess` must be a JS function.",lt),t})).map((async t=>{try{return await t(e,document)}catch(e){Je(`Function ${t.name} threw an error during \`postProcess\`.`,lt,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),r("end-all"),Re(document),performance.mark(`${ut}-end`),performance.measure(ut,`${ut}-start`,`${ut}-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} @@ -357,7 +357,7 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} ${so} `,o.querySelector("link")),co(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const po="core/best-practices",fo={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},ho=ze(fo),mo=l in fo?l:"en";var go=Object.freeze({__proto__:null,name:po,run:function(){const e=document.querySelectorAll(".practicelab"),t=document.getElementById("bp-summary"),n=t?document.createElement("ul"):null;if([...e].forEach(((e,t)=>{const r=qe(e,"bp"),o=we`
    ${ho.best_practice}${t+1}`;if(n){const t=we`
  • ${o}: ${Ge(e)}
  • `;n.appendChild(t)}const i=e.closest("div");if(!i)return void e.classList.add("advisement");i.classList.add("advisement");const s=we`${o.cloneNode(!0)}: ${e}`;i.prepend(...s.childNodes)})),e.length)t&&(t.appendChild(we`

    Best Practices Summary

    `),t.appendChild(n));else if(t){et("Using best practices summary (#bp-summary) but no best practices found.",po),t.remove()}}});const bo="core/figures",yo=ze({en:{list_of_figures:"List of Figures",fig:"Figure "},ja:{fig:"図 ",list_of_figures:"図のリスト"},ko:{fig:"그림 ",list_of_figures:"그림 목록"},nl:{fig:"Figuur ",list_of_figures:"Lijst met figuren"},es:{fig:"Figura ",list_of_figures:"Lista de Figuras"},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var wo=Object.freeze({__proto__:null,name:bo,run:function(){document.querySelectorAll(":not(picture)>img:not([width]):not([height]):not([srcset])").forEach((e=>{0!==e.naturalHeight&&0!==e.naturalWidth&&(e.height=e.naturalHeight,e.width=e.naturalWidth)}));const e=function(){const e=[];return document.querySelectorAll("figure").forEach(((t,n)=>{const r=t.querySelector("figcaption");if(r)!function(e,t,n){const r=t.textContent;qe(e,"fig",r),We(t,we``),t.prepend(we``;if(n){const t=we`
  • ${o}: ${Ge(e)}
  • `;n.appendChild(t)}const i=e.closest("div");if(!i)return void e.classList.add("advisement");i.classList.add("advisement");const s=we`${o.cloneNode(!0)}: ${e}`;i.prepend(...s.childNodes)})),e.length)t&&(t.appendChild(we`

    Best Practices Summary

    `),t.appendChild(n));else if(t){et("Using best practices summary (#bp-summary) but no best practices found.",po),t.remove()}}});const bo="core/figures",yo=ze({en:{list_of_figures:"List of Figures",fig:"Figure "},ja:{fig:"図 ",list_of_figures:"図のリスト"},ko:{fig:"그림 ",list_of_figures:"그림 목록"},nl:{fig:"Figuur ",list_of_figures:"Lijst met figuren"},es:{fig:"Figura ",list_of_figures:"Lista de Figuras"},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var wo=Object.freeze({__proto__:null,name:bo,run:function(){document.querySelectorAll(":not(picture)>img:not([width]):not([height]):not([srcset])").forEach((e=>{e.src.startsWith("data:image/svg+xml;")||e.src.endsWith(".svg")||0!==e.naturalHeight&&0!==e.naturalWidth&&(e.height=e.naturalHeight,e.width=e.naturalWidth)}));const e=function(){const e=[];return document.querySelectorAll("figure").forEach(((t,n)=>{const r=t.querySelector("figcaption");if(r)!function(e,t,n){const r=t.textContent;qe(e,"fig",r),We(t,we``),t.prepend(we`
    ${yo.fig}${n+1}`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach((e=>{Be(e,"span").removeAttribute("href")})),we`
  • ${n.childNodes} diff --git a/builds/respec-aom.js.map b/builds/respec-aom.js.map index 19217a6b43..0d7cc17bcc 100644 --- a/builds/respec-aom.js.map +++ b/builds/respec-aom.js.map @@ -1 +1 @@ -{"version":3,"file":"respec-aom.js","sources":["../src/core/expose-modules.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/l10n.js","../node_modules/idb/build/wrap-idb-value.js","../node_modules/idb/build/index.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/reindent.js","../src/core/utils.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/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/aom.js","../src/core/location-hash.js","../src/core/defaults.js","../src/aom/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/aom/style.js","../src/core/sections.js","../src/core/data-include.js","../src/core/title.js","../src/core/templates/show-link.js","../src/core/templates/show-logo.js","../src/core/templates/show-people.js","../src/aom/templates/headers.js","../src/aom/headers.js","../src/aom/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/aom/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/data-cite.js","../src/core/link-to-dfn.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/ui/save-html.js","../src/ui/about-respec.js","../src/core/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.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/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/github.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.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/no-http-props.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\n */\nexport function expose(name, object) {\n if (!inAmd) {\n window.require.modules[name] = object;\n }\n}\n","// @ts-check\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\nimport { expose } from \"./expose-modules.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.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, options = { once: false }) {\n const listener = e => cb(e.detail);\n subscriptions.addEventListener(topic, listener, options);\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/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), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\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', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\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 * 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 v4.3.0 - a markdown parser\n * Copyright (c) 2011-2023, 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\nfunction getDefaults() {\n return {\n async: false,\n baseUrl: null,\n breaks: false,\n extensions: null,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n hooks: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: null,\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartypants: false,\n tokenizer: null,\n walkTokens: null,\n xhtml: false\n };\n}\n\nlet defaults = getDefaults();\n\nfunction changeDefaults(newDefaults) {\n defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape(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\n/**\n * @param {string} html\n */\nfunction unescape(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;\n\n/**\n * @param {string | RegExp} regex\n * @param {string} opt\n */\nfunction edit(regex, opt) {\n regex = typeof regex === 'string' ? regex : regex.source;\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;\n\n/**\n * @param {boolean} sanitize\n * @param {string} base\n * @param {string} href\n */\nfunction cleanUrl(sanitize, base, href) {\n if (sanitize) {\n let prot;\n try {\n prot = decodeURIComponent(unescape(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\n/**\n * @param {string} base\n * @param {string} href\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(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 = { exec: function noopTest() {} };\n\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n 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 // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) { cells.shift(); }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) { cells.pop(); }\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/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param {string} str\n * @param {string} c\n * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(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.slice(0, l - suffLen);\n}\n\nfunction findClosingBracket(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(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\n/**\n * @param {string} pattern\n * @param {number} count\n */\nfunction repeatString(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\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape(text)\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 */\nclass Tokenizer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\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().replace(this.rules.inline._escapes, '$1') : 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,\n tokens: this.lexer.inline(text)\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(/^ *>[ \\t]?/gm, '');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine,\n line, nextLine, rawLine, itemContents, endEarly;\n\n let bull = cap[1].trim();\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 bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n\n // Check if current bullet point can start a new List Item\n while (src) {\n endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n\n raw = cap[0];\n src = src.substring(raw.length);\n\n line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n nextLine = src.split('\\n', 1)[0];\n\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimLeft();\n } else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n\n blankLine = false;\n\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n\n // Check if following lines should be included in List Item\n while (src) {\n rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n } else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n\n itemContents += '\\n' + nextLine;\n }\n\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n } else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents\n });\n\n list.raw += raw;\n }\n\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimRight();\n list.items[list.items.length - 1].text = itemContents.trimRight();\n list.raw = list.raw.trimRight();\n\n const l = list.items.length;\n\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (i = 0; i < l; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n\n list.loose = hasMultipleLineBreaks;\n }\n }\n\n // Set all items to loose if list is loose\n if (list.loose) {\n for (i = 0; i < l; i++) {\n list.items[i].loose = true;\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 const token = {\n type: 'html',\n raw: cap[0],\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: cap[0]\n };\n if (this.options.sanitize) {\n const text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);\n token.type = 'paragraph';\n token.text = text;\n token.tokens = this.lexer.inline(text);\n }\n return token;\n }\n }\n\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\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]).map(c => { return { text: c }; }),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n rows: cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').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, j, k, row;\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.rows.length;\n for (i = 0; i < l; i++) {\n item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; });\n }\n\n // parse child tokens inside headers and cells\n\n // header child tokens\n l = item.header.length;\n for (j = 0; j < l; j++) {\n item.header[j].tokens = this.lexer.inline(item.header[j].text);\n }\n\n // cell child tokens\n l = item.rows.length;\n for (j = 0; j < l; j++) {\n row = item.rows[j];\n for (k = 0; k < row.length; k++) {\n row[k].tokens = this.lexer.inline(row[k].text);\n }\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 tokens: this.lexer.inline(cap[1])\n };\n }\n }\n\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\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 tokens: this.lexer.inline(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(cap[1])\n };\n }\n }\n\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n } else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n\n return {\n type: this.options.sanitize\n ? 'text'\n : 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n text: this.options.sanitize\n ? (this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape(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 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(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], this.lexer);\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) {\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], this.lexer);\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 const raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\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(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 tokens: this.lexer.inlineTokens(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(this.options.mangle ? mangle(cap[1]) : cap[1]);\n href = 'mailto:' + text;\n } else {\n text = escape(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(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(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n } else {\n href = cap[0];\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, smartypants) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0];\n } else {\n text = escape(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\n/**\n * Block-Level Grammar\n */\nconst block = {\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}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/,\n html: '^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n + '|\\\\n*|$)' // (4)\n + '|\\\\n*|$)' // (5)\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 + '|(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')',\n def: /^ {0,3}\\[(label)\\]: *(?:\\n *)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/,\n table: noopTest,\n lheading: /^((?:.|\\n(?!\\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|table| +\\n)[^\\n]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock._label = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nblock._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock.def = edit(block.def)\n .replace('label', block._label)\n .replace('title', block._title)\n .getRegex();\n\nblock.bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nblock.listItemStart = edit(/^( *)(bull) */)\n .replace('bull', block.bullet)\n .getRegex();\n\nblock.list = edit(block.list)\n .replace(/bull/g, block.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block.def.source + ')')\n .getRegex();\n\nblock._tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'\n + '|track|ul';\nblock._comment = /|$)/;\nblock.html = edit(block.html, 'i')\n .replace('comment', block._comment)\n .replace('tag', block._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('|table', '')\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', ')|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.blockquote = edit(block.blockquote)\n .replace('paragraph', block.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock.normal = { ...block };\n\n/**\n * GFM Block Grammar\n */\n\nblock.gfm = {\n ...block.normal,\n table: '^ *([^\\\\n ].*\\\\|.*)\\\\n' // Header\n + ' {0,3}(?:\\\\| *)?(:?-+:? *(?:\\\\| *:?-+:? *)*)(?:\\\\| *)?' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)' // Cells\n};\n\nblock.gfm.table = edit(block.gfm.table)\n .replace('hr', block.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', ')|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.gfm.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('table', block.gfm.table) // interrupt paragraphs with table\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', ')|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock.pedantic = {\n ...block.normal,\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+? *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', block._comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(block.normal._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n};\n\n/**\n * Inline-Level Grammar\n */\nconst inline = {\n escape: /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,\n autolink: /^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/,\n url: noopTest,\n tag: '^comment'\n + '|^' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. \n + '|^' // declaration, e.g. \n + '|^', // CDATA section\n link: /^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/,\n reflink: /^!?\\[(label)\\]\\[(ref)\\]/,\n nolink: /^!?\\[(ref)\\](?:\\[\\])?/,\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 orphan inside strong () Consume to delim (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]*?(?:(?=[\\\\?@\\\\[\\\\]`^{|}~';\ninline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();\n\n// sequences em should skip over [title](link), `code`, \ninline.blockSkip = /\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>/g;\n// lookbehind is not available on Safari as of version 16\n// inline.escapedEmSt = /(?<=(?:^|[^\\\\)(?:\\\\[^])*)\\\\[*_]/g;\ninline.escapedEmSt = /(?:^|[^\\\\])(?:\\\\\\\\)*\\\\[*_]/g;\n\ninline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();\n\ninline.emStrong.lDelim = edit(inline.emStrong.lDelim)\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;\ninline.autolink = edit(inline.autolink)\n .replace('scheme', inline._scheme)\n .replace('email', inline._email)\n .getRegex();\n\ninline._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline.tag = edit(inline.tag)\n .replace('comment', inline._comment)\n .replace('attribute', inline._attribute)\n .getRegex();\n\ninline._label = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline._href = /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/;\ninline._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline.link = edit(inline.link)\n .replace('label', inline._label)\n .replace('href', inline._href)\n .replace('title', inline._title)\n .getRegex();\n\ninline.reflink = edit(inline.reflink)\n .replace('label', inline._label)\n .replace('ref', block._label)\n .getRegex();\n\ninline.nolink = edit(inline.nolink)\n .replace('ref', block._label)\n .getRegex();\n\ninline.reflinkSearch = edit(inline.reflinkSearch, 'g')\n .replace('reflink', inline.reflink)\n .replace('nolink', inline.nolink)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline.normal = { ...inline };\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline.pedantic = {\n ...inline.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._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline._label)\n .getRegex()\n};\n\n/**\n * GFM Inline Grammar\n */\n\ninline.gfm = {\n ...inline.normal,\n escape: edit(inline.escape).replace('])', '~|])').getRegex(),\n _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,\n url: /^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\ 0.5) {\n ch = 'x' + ch.toString(16);\n }\n out += '&#' + ch + ';';\n }\n\n return out;\n}\n\n/**\n * Block Lexer\n */\nclass Lexer {\n constructor(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || defaults;\n this.options.tokenizer = this.options.tokenizer || new Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\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\n this.blockTokens(src, this.tokens);\n\n let next;\n while (next = this.inlineQueue.shift()) {\n this.inlineTokens(next.src, next.tokens);\n }\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n } else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n\n let token, 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({ lexer: 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.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n } else {\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' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 // 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 tokens.push(token);\n continue;\n }\n\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\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 (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else 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({ lexer: 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 (this.state.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 this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 this.state.top = true;\n return tokens;\n }\n\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\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 + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);\n 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({ lexer: 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)) {\n src = src.substring(token.raw.length);\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 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 (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 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 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 (!this.state.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({ lexer: 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, 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\n/**\n * Renderer\n */\nclass Renderer {\n constructor(options) {\n this.options = options || defaults;\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 '
    '\n        + (escaped ? code : escape(code, true))\n        + '
    \\n';\n }\n\n return '
    '\n      + (escaped ? code : escape(code, true))\n      + '
    \\n';\n }\n\n /**\n * @param {string} quote\n */\n blockquote(quote) {\n return `
    \\n${quote}
    \\n`;\n }\n\n html(html) {\n return html;\n }\n\n /**\n * @param {string} text\n * @param {string} level\n * @param {string} raw\n * @param {any} slugger\n */\n heading(text, level, raw, slugger) {\n if (this.options.headerIds) {\n const id = this.options.headerPrefix + slugger.slug(raw);\n return `${text}\\n`;\n }\n\n // ignore IDs\n return `${text}\\n`;\n }\n\n hr() {\n return this.options.xhtml ? '
    \\n' : '
    \\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 + '\\n';\n }\n\n /**\n * @param {string} text\n */\n listitem(text) {\n return `
  • ${text}
  • \\n`;\n }\n\n checkbox(checked) {\n return ' ';\n }\n\n /**\n * @param {string} text\n */\n paragraph(text) {\n return `

    ${text}

    \\n`;\n }\n\n /**\n * @param {string} header\n * @param {string} body\n */\n table(header, body) {\n if (body) body = `${body}`;\n\n return '\\n'\n + '\\n'\n + header\n + '\\n'\n + body\n + '
    \\n';\n }\n\n /**\n * @param {string} content\n */\n tablerow(content) {\n return `\\n${content}\\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 + `\\n`;\n }\n\n /**\n * span level renderer\n * @param {string} text\n */\n strong(text) {\n return `${text}`;\n }\n\n /**\n * @param {string} text\n */\n em(text) {\n return `${text}`;\n }\n\n /**\n * @param {string} text\n */\n codespan(text) {\n return `${text}`;\n }\n\n br() {\n return this.options.xhtml ? '
    ' : '
    ';\n }\n\n /**\n * @param {string} text\n */\n del(text) {\n return `${text}`;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\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 = '
    ';\n return out;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\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 = `\"${text}\"`;\n' : '>';\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 */\nclass 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 */\nclass Slugger {\n constructor() {\n this.seen = {};\n }\n\n /**\n * @param {string} value\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 * @param {string} originalSlug\n * @param {boolean} isDryRun\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\n * 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\n/**\n * Parsing & Compiling\n */\nclass Parser {\n constructor(options) {\n this.options = options || defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new TextRenderer();\n this.slugger = new Slugger();\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({ parser: 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.header[j].tokens),\n { header: true, align: token.align[j] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n body = '';\n l2 = token.rows.length;\n for (j = 0; j < l2; j++) {\n row = token.rows[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].tokens),\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 === 'paragraph') {\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({ parser: 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\nclass Hooks {\n constructor(options) {\n this.options = options || defaults;\n }\n\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess'\n ]);\n\n /**\n * Process markdown before marked\n */\n preprocess(markdown) {\n return markdown;\n }\n\n /**\n * Process HTML after marked is finished\n */\n postprocess(html) {\n return html;\n }\n}\n\nfunction onError(silent, async, callback) {\n return (e) => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n\n if (silent) {\n const msg = '

    An error occurred:

    '\n        + escape(e.message + '', true)\n        + '
    ';\n if (async) {\n return Promise.resolve(msg);\n }\n if (callback) {\n callback(null, msg);\n return;\n }\n return msg;\n }\n\n if (async) {\n return Promise.reject(e);\n }\n if (callback) {\n callback(e);\n return;\n }\n throw e;\n };\n}\n\nfunction parseMarkdown(lexer, parser) {\n return (src, opt, callback) => {\n if (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n const origOpt = { ...opt };\n opt = { ...marked.defaults, ...origOpt };\n const throwError = onError(opt.silent, opt.async, callback);\n\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n\n checkSanitizeDeprecation(opt);\n\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n tokens = lexer(src, opt);\n } catch (e) {\n return throwError(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(tokens, opt);\n if (opt.hooks) {\n out = opt.hooks.postprocess(out);\n }\n } catch (e) {\n err = e;\n }\n }\n\n opt.highlight = highlight;\n\n return err\n ? throwError(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 if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.walkTokens ? Promise.all(marked.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n const tokens = lexer(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n } catch (e) {\n return throwError(e);\n }\n };\n}\n\n/**\n * Marked\n */\nfunction marked(src, opt, callback) {\n return parseMarkdown(Lexer.lex, Parser.parse)(src, opt, callback);\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n marked.defaults = { ...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 extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };\n\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n\n // set async to true if it was set to true before\n opts.async = marked.defaults.async || opts.async || false;\n\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\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[ext.name];\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 opts.extensions = extensions;\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 Hooks extensions --== //\n if (pack.hooks) {\n const hooks = marked.defaults.hooks || new Hooks();\n for (const prop in pack.hooks) {\n const prevHook = hooks[prop];\n if (Hooks.passThroughHooks.has(prop)) {\n hooks[prop] = (arg) => {\n if (marked.defaults.async) {\n return Promise.resolve(pack.hooks[prop].call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n\n const ret = pack.hooks[prop].call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n } else {\n hooks[prop] = (...args) => {\n let ret = pack.hooks[prop].apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked.defaults.walkTokens;\n opts.walkTokens = function(token) {\n let values = [];\n values.push(pack.walkTokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n\n marked.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(marked, token));\n switch (token.type) {\n case 'table': {\n for (const cell of token.header) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n for (const row of token.rows) {\n for (const cell of row) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n values = values.concat(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 values = values.concat(marked.walkTokens(token[childTokens], callback));\n });\n } else if (token.tokens) {\n values = values.concat(marked.walkTokens(token.tokens, callback));\n }\n }\n }\n }\n return values;\n};\n\n/**\n * Parse Inline\n * @param {string} src\n */\nmarked.parseInline = parseMarkdown(Lexer.lexInline, Parser.parseInline);\n\n/**\n * Expose\n */\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\nmarked.Tokenizer = Tokenizer;\nmarked.Slugger = Slugger;\nmarked.Hooks = Hooks;\nmarked.parse = marked;\n\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = Parser.parse;\nconst lexer = Lexer.lex;\n\nexport { Hooks, Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\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 pluralizeExports = {};\nvar pluralize$1 = {\n get exports(){ return pluralizeExports; },\n set exports(v){ pluralizeExports = v; },\n};\n\n/* global define */\n\n(function (module, exports) {\n\t(function (root, pluralize) {\n\t /* istanbul ignore else */\n\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t // Node.\n\t module.exports = pluralize();\n\t } else {\n\t // Browser global.\n\t root.pluralize = pluralize();\n\t }\n\t})(commonjsGlobal, function () {\n\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t // while other rules can be optimized using an object for instant lookups.\n\t var pluralRules = [];\n\t var singularRules = [];\n\t var uncountables = {};\n\t var irregularPlurals = {};\n\t var irregularSingles = {};\n\n\t /**\n\t * Sanitize a pluralization rule to a usable regular expression.\n\t *\n\t * @param {(RegExp|string)} rule\n\t * @return {RegExp}\n\t */\n\t function sanitizeRule (rule) {\n\t if (typeof rule === 'string') {\n\t return new RegExp('^' + rule + '$', 'i');\n\t }\n\n\t return rule;\n\t }\n\n\t /**\n\t * Pass in a word token to produce a function that can replicate the case on\n\t * another word.\n\t *\n\t * @param {string} word\n\t * @param {string} token\n\t * @return {Function}\n\t */\n\t function restoreCase (word, token) {\n\t // Tokens are an exact match.\n\t if (word === token) return token;\n\n\t // Lower cased words. E.g. \"hello\".\n\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t // Upper cased words. E.g. \"WHISKY\".\n\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t // Title cased words. E.g. \"Title\".\n\t if (word[0] === word[0].toUpperCase()) {\n\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t }\n\n\t // Lower cased words. E.g. \"test\".\n\t return token.toLowerCase();\n\t }\n\n\t /**\n\t * Interpolate a regexp string.\n\t *\n\t * @param {string} str\n\t * @param {Array} args\n\t * @return {string}\n\t */\n\t function interpolate (str, args) {\n\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t return args[index] || '';\n\t });\n\t }\n\n\t /**\n\t * Replace a word using a rule.\n\t *\n\t * @param {string} word\n\t * @param {Array} rule\n\t * @return {string}\n\t */\n\t function replace (word, rule) {\n\t return word.replace(rule[0], function (match, index) {\n\t var result = interpolate(rule[1], arguments);\n\n\t if (match === '') {\n\t return restoreCase(word[index - 1], result);\n\t }\n\n\t return restoreCase(match, result);\n\t });\n\t }\n\n\t /**\n\t * Sanitize a word by passing in the word and sanitization rules.\n\t *\n\t * @param {string} token\n\t * @param {string} word\n\t * @param {Array} rules\n\t * @return {string}\n\t */\n\t function sanitizeWord (token, word, rules) {\n\t // Empty string or doesn't need fixing.\n\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t return word;\n\t }\n\n\t var len = rules.length;\n\n\t // Iterate over the sanitization rules and use the first one to match.\n\t while (len--) {\n\t var rule = rules[len];\n\n\t if (rule[0].test(word)) return replace(word, rule);\n\t }\n\n\t return word;\n\t }\n\n\t /**\n\t * Replace a word with the updated word.\n\t *\n\t * @param {Object} replaceMap\n\t * @param {Object} keepMap\n\t * @param {Array} rules\n\t * @return {Function}\n\t */\n\t function replaceWord (replaceMap, keepMap, rules) {\n\t return function (word) {\n\t // Get the correct token and case restoration functions.\n\t var token = word.toLowerCase();\n\n\t // Check against the keep object map.\n\t if (keepMap.hasOwnProperty(token)) {\n\t return restoreCase(word, token);\n\t }\n\n\t // Check against the replacement map for a direct word replacement.\n\t if (replaceMap.hasOwnProperty(token)) {\n\t return restoreCase(word, replaceMap[token]);\n\t }\n\n\t // Run all the rules against the word.\n\t return sanitizeWord(token, word, rules);\n\t };\n\t }\n\n\t /**\n\t * Check if a word is part of the map.\n\t */\n\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t return function (word) {\n\t var token = word.toLowerCase();\n\n\t if (keepMap.hasOwnProperty(token)) return true;\n\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t return sanitizeWord(token, token, rules) === token;\n\t };\n\t }\n\n\t /**\n\t * Pluralize or singularize a word based on the passed in count.\n\t *\n\t * @param {string} word The word to pluralize\n\t * @param {number} count How many of the word exist\n\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t * @return {string}\n\t */\n\t function pluralize (word, count, inclusive) {\n\t var pluralized = count === 1\n\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t return (inclusive ? count + ' ' : '') + pluralized;\n\t }\n\n\t /**\n\t * Pluralize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.plural = replaceWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Check if a word is plural.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isPlural = checkWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Singularize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.singular = replaceWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Check if a word is singular.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isSingular = checkWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Add a pluralization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addPluralRule = function (rule, replacement) {\n\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add a singularization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addSingularRule = function (rule, replacement) {\n\t singularRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add an uncountable word rule.\n\t *\n\t * @param {(string|RegExp)} word\n\t */\n\t pluralize.addUncountableRule = function (word) {\n\t if (typeof word === 'string') {\n\t uncountables[word.toLowerCase()] = true;\n\t return;\n\t }\n\n\t // Set singular and plural references for the word.\n\t pluralize.addPluralRule(word, '$0');\n\t pluralize.addSingularRule(word, '$0');\n\t };\n\n\t /**\n\t * Add an irregular word definition.\n\t *\n\t * @param {string} single\n\t * @param {string} plural\n\t */\n\t pluralize.addIrregularRule = function (single, plural) {\n\t plural = plural.toLowerCase();\n\t single = single.toLowerCase();\n\n\t irregularSingles[single] = plural;\n\t irregularPlurals[plural] = single;\n\t };\n\n\t /**\n\t * Irregular rules.\n\t */\n\t [\n\t // Pronouns.\n\t ['I', 'we'],\n\t ['me', 'us'],\n\t ['he', 'they'],\n\t ['she', 'they'],\n\t ['them', 'them'],\n\t ['myself', 'ourselves'],\n\t ['yourself', 'yourselves'],\n\t ['itself', 'themselves'],\n\t ['herself', 'themselves'],\n\t ['himself', 'themselves'],\n\t ['themself', 'themselves'],\n\t ['is', 'are'],\n\t ['was', 'were'],\n\t ['has', 'have'],\n\t ['this', 'these'],\n\t ['that', 'those'],\n\t // Words ending in with a consonant and `o`.\n\t ['echo', 'echoes'],\n\t ['dingo', 'dingoes'],\n\t ['volcano', 'volcanoes'],\n\t ['tornado', 'tornadoes'],\n\t ['torpedo', 'torpedoes'],\n\t // Ends with `us`.\n\t ['genus', 'genera'],\n\t ['viscus', 'viscera'],\n\t // Ends with `ma`.\n\t ['stigma', 'stigmata'],\n\t ['stoma', 'stomata'],\n\t ['dogma', 'dogmata'],\n\t ['lemma', 'lemmata'],\n\t ['schema', 'schemata'],\n\t ['anathema', 'anathemata'],\n\t // Other irregular rules.\n\t ['ox', 'oxen'],\n\t ['axe', 'axes'],\n\t ['die', 'dice'],\n\t ['yes', 'yeses'],\n\t ['foot', 'feet'],\n\t ['eave', 'eaves'],\n\t ['goose', 'geese'],\n\t ['tooth', 'teeth'],\n\t ['quiz', 'quizzes'],\n\t ['human', 'humans'],\n\t ['proof', 'proofs'],\n\t ['carve', 'carves'],\n\t ['valve', 'valves'],\n\t ['looey', 'looies'],\n\t ['thief', 'thieves'],\n\t ['groove', 'grooves'],\n\t ['pickaxe', 'pickaxes'],\n\t ['passerby', 'passersby']\n\t ].forEach(function (rule) {\n\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Pluralization rules.\n\t */\n\t [\n\t [/s?$/i, 's'],\n\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t [/([^aeiou]ese)$/i, '$1'],\n\t [/(ax|test)is$/i, '$1es'],\n\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t [/(e[mn]u)s?$/i, '$1s'],\n\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t [/(her|at|gr)o$/i, '$1oes'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t [/sis$/i, 'ses'],\n\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t [/(child)(?:ren)?$/i, '$1ren'],\n\t [/eaux$/i, '$0'],\n\t [/m[ae]n$/i, 'men'],\n\t ['thou', 'you']\n\t ].forEach(function (rule) {\n\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Singularization rules.\n\t */\n\t [\n\t [/s$/i, ''],\n\t [/(ss)$/i, '$1'],\n\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t [/ies$/i, 'y'],\n\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t [/(seraph|cherub)im$/i, '$1'],\n\t [/(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\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t [/(test)(?:is|es)$/i, '$1is'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t [/(matr|append)ices$/i, '$1ix'],\n\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t [/(child)ren$/i, '$1'],\n\t [/(eau)x?$/i, '$1'],\n\t [/men$/i, 'man']\n\t ].forEach(function (rule) {\n\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Uncountable rules.\n\t */\n\t [\n\t // Singular words with no plurals.\n\t 'adulthood',\n\t 'advice',\n\t 'agenda',\n\t 'aid',\n\t 'aircraft',\n\t 'alcohol',\n\t 'ammo',\n\t 'analytics',\n\t 'anime',\n\t 'athletics',\n\t 'audio',\n\t 'bison',\n\t 'blood',\n\t 'bream',\n\t 'buffalo',\n\t 'butter',\n\t 'carp',\n\t 'cash',\n\t 'chassis',\n\t 'chess',\n\t 'clothing',\n\t 'cod',\n\t 'commerce',\n\t 'cooperation',\n\t 'corps',\n\t 'debris',\n\t 'diabetes',\n\t 'digestion',\n\t 'elk',\n\t 'energy',\n\t 'equipment',\n\t 'excretion',\n\t 'expertise',\n\t 'firmware',\n\t 'flounder',\n\t 'fun',\n\t 'gallows',\n\t 'garbage',\n\t 'graffiti',\n\t 'hardware',\n\t 'headquarters',\n\t 'health',\n\t 'herpes',\n\t 'highjinks',\n\t 'homework',\n\t 'housework',\n\t 'information',\n\t 'jeans',\n\t 'justice',\n\t 'kudos',\n\t 'labour',\n\t 'literature',\n\t 'machinery',\n\t 'mackerel',\n\t 'mail',\n\t 'media',\n\t 'mews',\n\t 'moose',\n\t 'music',\n\t 'mud',\n\t 'manga',\n\t 'news',\n\t 'only',\n\t 'personnel',\n\t 'pike',\n\t 'plankton',\n\t 'pliers',\n\t 'police',\n\t 'pollution',\n\t 'premises',\n\t 'rain',\n\t 'research',\n\t 'rice',\n\t 'salmon',\n\t 'scissors',\n\t 'series',\n\t 'sewage',\n\t 'shambles',\n\t 'shrimp',\n\t 'software',\n\t 'species',\n\t 'staff',\n\t 'swine',\n\t 'tennis',\n\t 'traffic',\n\t 'transportation',\n\t 'trout',\n\t 'tuna',\n\t 'wealth',\n\t 'welfare',\n\t 'whiting',\n\t 'wildebeest',\n\t 'wildlife',\n\t 'you',\n\t /pok[eé]mon$/i,\n\t // Regexes.\n\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t /deer$/i, // \"deer\", \"reindeer\"\n\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t /measles$/i,\n\t /o[iu]s$/i, // \"carnivorous\"\n\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t /sheep$/i\n\t ].forEach(pluralize.addUncountableRule);\n\n\t return pluralize;\n\t});\n} (pluralize$1));\n\nvar pluralize = pluralizeExports;\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;ro;)--c;l=u+r-c;var m=Array(l),y=s[c];for(--n;y;){for(var b=y.newi,w=y.oldi;b>>0;n\"+e+\"\",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=''+e+\"\",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

    ',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+\">\"}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 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// 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\";\nimport { reindent } from \"./reindent.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\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\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 if (opts.corsMode) {\n linkElem.crossOrigin = opts.corsMode;\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(/>} T\n * @param {T} localizationStrings\n * @returns {T[keyof T]}\n */\nexport function getIntlData(localizationStrings, lang = docLang) {\n lang = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || 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/**\n * @template {Record>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\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 * 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} 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 * `` 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}\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 `` 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 `` 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
    ), 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 *

    Int3.member

    \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 Foo.Bar() 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 * @param {Element} element\n */\nexport function 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/**\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 `
    ` 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} */\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} */\nexport class InsensitiveStringSet extends Set {\n /**\n * @param {Array} [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} walker\n * @return {IterableIterator}\n */\nfunction* walkTree(walker) {\n while (walker.nextNode()) {\n yield /** @type {T} */ (walker.currentNode);\n }\n}\n\n/**\n * @template ValueType\n * @extends {Map}\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[0]} message\n * @param {Parameters[1]} plugin\n * @param {Parameters[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 const linkifiedStr = 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 return reindent(linkifiedStr);\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``;\n }\n insertions.appendChild(metaCharset);\n\n // Add meta generator\n const respecVersion = `ReSpec ${window.respecVersion || \"Developer Channel\"}`;\n const metaGenerator = html`\n \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 */\nimport { serialize } from \"../core/exporter.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/respec-global\";\n\nclass ReSpec {\n constructor() {\n /** @type {Promise} */\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","// @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\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\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 padding: 0.2em 0em;\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 will-change: opacity;\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 {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\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 font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.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-warning-list > li::before {\n content: \"⚠️\";\n}\n\n.respec-error-list > li::before {\n content: \"💥\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\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 top: 10%;\n background: #fff;\n border: 5px solid #666;\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\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-menu button.respec-option {\n background: white;\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 background-color: #eeeeee;\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\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\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\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 */\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;\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 `
    ${code}
    `;\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(\"
    \", `
    `);\n  }\n\n  image(href, title, text) {\n    if (!title) {\n      return super.image(href, title, text);\n    }\n    const html = String.raw;\n    return html`\n      
    \n \"${text}\"\n
    ${title}
    \n
    \n `;\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 `${textContent}`;\n }\n return super.heading(text, level, raw, slugger);\n }\n}\n\nconst config = {\n sanitize: false,\n gfm: true,\n headerIds: false,\n langPrefix: \"\",\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\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\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\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
    \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} */\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\n/**\n * @param {Iterable} 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    processMDSections(document.body);\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  // Frankenstein the whole thing back together\n  newBody.append(rsUI);\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 { markdownToHtml } from \"./markdown.js\";\nimport { reindent } from \"./reindent.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``;\nconst menu = html``;\nconst closeButton = html` ui.closeModal()}\n  title=\"Close\"\n>\n  ❌\n`;\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``;\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``;\n  button.addEventListener(\"click\", () => {\n    button.setAttribute(\"aria-expanded\", \"true\");\n    const ol = html`
      `;\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``;\n const menuItem = html`
    1. ${button}
    2. `;\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`
      `;\n const id = `${currentOwner.id}-modal`;\n const headingId = `${id}-heading`;\n modal = html`\n ${closeButton}\n

      ${title}

      \n
      ${content}
      \n `;\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\n ? `

      (plugin: \"${err.plugin}\")

      `\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `

      How to fix: ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `

      Occurred ${\n err.elements.length\n } times at:

      \n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n
      \\n${err.details}\\n
      \\n`\n : \"\";\n const msg = markdownToHtml(`**${err.message}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\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/aom/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/aom/style.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/aom/headers.js\"),\n import(\"../src/aom/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/aom/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/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.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/ui/save-html.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/data-type.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n import(\"../src/core/custom-elements/index.js\"),\n /* Linter 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/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/no-http-props.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 * 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 AOM specs\n */\nexport const name = \"aom/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst licenses = new Map([\n [\n \"aom\",\n {\n name: \"Alliance for Open Media License\",\n short: \"AOM\",\n url: \"http://aomedia.org/license/\",\n },\n ],\n]);\n\nconst aomDefaults = {\n // treat document as \"Common Markdown\" (with a little bit of HTML).\n // choice between Markdown and HTML depends on the complexity of the spec\n // example of Markdown spec: https://github.com/WICG/netinfo/blob/gh-pages/index.html\n // Helpful guide: https://respec.org/docs/#markdown\n format: \"markdown\",\n logos: [\n {\n src: \"https://aomedia.org/assets/images/aomedia-icon-only.png\",\n alt: \"AOM\",\n id: \"AOM\",\n height: 170,\n width: 170,\n url: \"https://aomedia.org/\",\n },\n ],\n license: \"aom\",\n};\n\nfunction computeProps(conf) {\n return {\n licenseInfo: licenses.get(conf.license),\n };\n}\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...aomDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...aomDefaults,\n ...conf,\n lint,\n });\n\n // computed properties\n Object.assign(conf, computeProps(conf));\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/* --- INLINES --- */\n:is(h1, h2, h3, h4, h5, h6, a) 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\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\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\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 aom/style\n// Inserts a link to the appropriate 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 = \"aom/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 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 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 = \"\";\n\n // Figure out which style file to use.\n switch (conf.specStatus.toUpperCase()) {\n case \"PD\":\n styleFile = \"W3C-UD\";\n break;\n default:\n styleFile = \"base.css\";\n break;\n }\n\n // Attach W3C fixup script after we are done.\n if (!conf.noToc) {\n sub(\n \"end-all\",\n () => {\n attachFixupScript(document, \"2016\");\n },\n { once: true }\n );\n }\n const finalStyleURL = `https://www.w3.org/StyleSheets/TR/2016/${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","/**\n * Module core/sections\n *\n * Adds
      s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\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) {\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(structure(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/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\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\nexport function run() {\n restructure(document.body);\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 { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.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 await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf} */\n const includables = root.querySelectorAll(\"[data-include]\");\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()).slice(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 if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\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 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 // We replace \":<br>\" with \":\", and \"<br>\" with \"-\", as appropriate.\n const tempElem = document.createElement(\"h1\");\n tempElem.innerHTML = h1Elem.innerHTML\n .replace(/:<br>/g, \": \")\n .replace(/<br>/g, \" - \");\n let documentTitle = norm(tempElem.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","// @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 W3CDate,\n getIntlData,\n isValidConfDate,\n showError,\n showWarning,\n} from \"../../core/utils.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};\nconst l10n = getIntlData(localizationStrings);\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 // 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 const { retiredDate } = person;\n if (person.retiredDate) {\n const time = html`<time datetime=\"${retiredDate}\"\n >${W3CDate.format(new Date(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 } 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 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 approved version:\",\n this_version: \"This version:\",\n issue_tracker: \"Issue Tracker:\",\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 => {\n return html`<div class=\"head\">\n ${conf.specStatus !== \"PD\" ? conf.logos.map(showLogo) : \"\"}\n ${document.querySelector(\"h1#title\")} ${getSpecSubTitleElem(conf)}\n <h2>\n ${conf.textStatus} -\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${conf.publishHumanDate}</time\n >\n </h2>\n <dl>\n <dt>${l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\">${conf.thisVersion}</a>\n </dd>\n <dt>${l10n.issue_tracker}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.issueTracker}\">${conf.issueTracker}</a>\n </dd>\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 ${renderCopyright(conf)}\n <hr />\n </div>`;\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 return html`<p class=\"copyright\">\n Copyright ${conf.publishYear},\n <a href=\"https://www.w3.org/\"\n ><abbr title=\"The Alliance for Open Media\">AOM</abbr></a\n ><br />\n Licensing information is available at http://aomedia.org/license/<br />\n The MATERIALS ARE PROVIDED “AS IS.” The Alliance for Open Media, its\n members,and its contributors expressly disclaim any warranties (express,\n implied, or otherwise), including implied warranties of merchantability,\n non-infringement, fitness for a particular purpose, or title, related to the\n materials. The entire risk as to implementing or otherwise using the\n materials is assumed by the implementer and user. IN NO EVENT WILL THE\n ALLIANCE FOR OPEN MEDIA, ITS MEMBERS, OR CONTRIBUTORS BE LIABLE TO ANY OTHER\n PARTY FOR LOST PROFITS OR ANY FORM OF INDIRECT, SPECIAL, INCIDENTAL, OR\n CONSEQUENTIAL DAMAGES OF ANY CHARACTER FROM ANY CAUSES OF ACTION OF ANY KIND\n WITH RESPECT TO THIS DELIVERABLE OR ITS GOVERNING AGREEMENT, WHETHER BASED\n ON BREACH OF CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, AND\n WHETHER OR NOT THE OTHER MEMBER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n DAMAGE.\n </p>`;\n}\n","// @ts-check\n// Module aom/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// - 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// - 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// - 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// - \"aom\"\nimport { ISODate, showError } from \"../core/utils.js\";\nimport headersTmpl from \"./templates/headers.js\";\nimport { pub } from \"../core/pubsubhub.js\";\n\nexport const name = \"aom/headers\";\n\nconst status2text = {\n PD: \"Pre-Draft\",\n WGD: \"AOM Work Group Draft\",\n WGA: \"AOM Working Group Approved Draft\",\n FD: \"AOM Final Deliverable\",\n};\n\nconst AOMDate = new Intl.DateTimeFormat([\"en-US\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: \"2-digit\",\n});\n\n/**\n * @param {*} conf\n * @param {string} prop\n * @param {string | number | Date} fallbackDate\n */\nfunction validateDateAndRecover(conf, prop, fallbackDate = new Date()) {\n const date = conf[prop] ? new Date(conf[prop]) : new Date(fallbackDate);\n // if date is valid\n if (Number.isFinite(date.valueOf())) {\n const formattedDate = ISODate.format(date);\n return new Date(formattedDate);\n }\n const msg =\n `[\\`${prop}\\`](https://github.com/w3c/respec/wiki/${prop}) ` +\n `is not a valid date: \"${conf[prop]}\". Expected format 'YYYY-MM-DD'.`;\n showError(msg, name);\n return new Date(ISODate.format(new Date()));\n}\n\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = \"Missing required configuration: `specStatus`\";\n showError(msg, name);\n }\n conf.title = document.title || \"No title\";\n if (!conf.subtitle) conf.subtitle = \"\";\n conf.publishDate = validateDateAndRecover(\n conf,\n \"publishDate\",\n document.lastModified\n );\n conf.thisVersion = `https://aomediacodec.github.io/${conf.shortName}/`;\n conf.issueTracker = `https://github.com/AOMediaCodec/${conf.shortName}/issues/`;\n conf.publishYear = conf.publishDate.getUTCFullYear();\n conf.publishHumanDate = AOMDate.format(conf.publishDate);\n const peopCheck = function (it) {\n if (!it.name) {\n const msg = \"All authors and editors must have a name.\";\n showError(msg, name);\n }\n };\n if (!conf.formerEditors) conf.formerEditors = [];\n if (conf.editors) {\n conf.editors.forEach(peopCheck);\n // Move any editors with retiredDate to formerEditors.\n for (let i = 0; i < conf.editors.length; i++) {\n const editor = conf.editors[i];\n if (\"retiredDate\" in editor) {\n conf.formerEditors.push(editor);\n conf.editors.splice(i--, 1);\n }\n }\n }\n if (!conf.editors || conf.editors.length === 0) {\n const msg = \"At least one editor is required\";\n showError(msg, name);\n }\n if (conf.formerEditors.length) {\n conf.formerEditors.forEach(peopCheck);\n }\n if (conf.authors) {\n conf.authors.forEach(peopCheck);\n }\n conf.multipleEditors = conf.editors && conf.editors.length > 1;\n conf.multipleFormerEditors = conf.formerEditors.length > 1;\n conf.multipleAuthors = conf.authors && conf.authors.length > 1;\n // (conf.alternateFormats || []).forEach(it => {\n // if (!it.uri || !it.label) {\n // 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.textStatus = status2text[conf.specStatus];\n conf.dashDate = ISODate.format(conf.publishDate);\n conf.publishISODate = conf.publishDate.toISOString();\n // configuration done - yay!\n\n // insert into document\n const header = headersTmpl(conf);\n document.body.prepend(header);\n document.body.classList.add(\"h-entry\");\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","// @ts-check\n// Module aom/abstract\n// Handle the abstract section properly.\nimport { getIntlData, showError } from \"../core/utils.js\";\nexport const name = \"aom/abstract\";\n\nconst localizationStrings = {\n en: {\n abstract: \"Abstract\",\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\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\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 {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\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, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\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-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 { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || 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>${text || identifier}</code></a\n >${!text || textArgs ? html`<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 /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = 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 // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\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<BiblioData?>} 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<BiblioData?>} 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 {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\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 {BiblioData} 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 let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\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 // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\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 // 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\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, 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 reference_not_found: \"Reference not found.\",\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 reference_not_found: \"Referencia no encontrada.\",\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 [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PER\", \"W3C Proposed Edited Recommendation\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\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 > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\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} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\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(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\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 /\\bMÜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NÖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDÜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKÖNNEN\\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\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-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}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></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 return html`<a\n data-link-type=\"dfn\"\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\", \"svg\"];\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 aom/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 = \"aom/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};\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 <h1>${l10n.conformance}</h1>\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 {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\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 [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup 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\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\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\n:is(aside,div).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\n:is(aside,div).example {\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}\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\";\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 const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\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 addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\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.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\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\";\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 {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 issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\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 });\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}${\n report.number ? ` ${report.number}` : \"\"\n }`;\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 `<h1>${l10n.issue_summary}</h1>`\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/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#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 allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\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`<h1>Best Practices Summary</h1>`);\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 getPreviousSections,\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`<h1>${l10n.list_of_figures}</h1>`,\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(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\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","// @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 if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\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 if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\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 { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\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 =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\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 return dfnsByType.get(linkType) || 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 (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\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\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 =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\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 getIntlData,\n parents,\n renameElement,\n showError,\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 (\"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, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) 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 const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, 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 ext: \"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 ext: \"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 ext: \"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\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"💾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\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/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","/*\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\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","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\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\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 \"table\": {\n processTable(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 // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\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 processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.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","/* 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-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\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","// @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 commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\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 // 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 if (!conf.excludeGithubLinks) {\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: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\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 * 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,#w3c-state)\");\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 \"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\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\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 \"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\") && conf[key]) || 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"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","subscriptions","EventTarget","pub","topic","detail","dispatchEvent","CustomEvent","parent","self","args","String","JSON","stringify","stack","postMessage","location","origin","sub","cb","options","once","addEventListener","e","removeList","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","wrapFunction","func","IDBDatabase","prototype","transaction","IDBCursor","advance","continue","continuePrimaryKey","includes","apply","unwrap","this","storeNames","tx","call","sort","transformCachableValue","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","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","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","params","paramName","paramValue","test","toLowerCase","getDefaults","baseUrl","breaks","extensions","gfm","headerIds","headerPrefix","highlight","hooks","langPrefix","mangle","pedantic","renderer","sanitize","sanitizer","silent","smartypants","tokenizer","walkTokens","xhtml","defaults","escapeTest","escapeReplace","RegExp","source","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape","encode","unescapeTest","unescape","_","n","charAt","fromCharCode","parseInt","substring","caret","edit","regex","opt","obj","val","getRegex","nonWordAndColonTest","originIndependentUrl","cleanUrl","base","href","prot","decodeURIComponent","indexOf","baseUrls","justDomain","rtrim","relativeBase","protocol","domain","resolveUrl","encodeURI","noopTest","exec","splitCells","tableRow","count","cells","match","offset","str","escaped","curr","split","i","trim","length","pop","splice","push","invert","l","suffLen","currChar","slice","repeatString","pattern","outputLink","cap","link","raw","lexer","title","text","state","inLink","token","type","tokens","inlineTokens","Tokenizer","constructor","space","src","rules","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","node","matchIndentInNode","indentInNode","join","indentCodeCompensation","inline","_escapes","heading","trimmed","depth","hr","blockquote","top","blockTokens","list","istask","ischecked","indent","blankLine","endsWithBlankLine","line","nextLine","rawLine","itemContents","endEarly","bull","isordered","ordered","start","loose","items","itemRegex","t","repeat","trimLeft","search","nextBulletRegex","Math","min","hrRegex","fencesBeginRegex","headingBeginRegex","task","checked","trimRight","spacers","filter","hasMultipleLineBreaks","pre","def","tag","table","item","header","align","rows","j","k","row","lheading","paragraph","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","level","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","lDelim","nextChar","punctuation","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","rDelimAst","rDelimUnd","lastIndex","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","_paragraph","_label","_title","bullet","listItemStart","_tag","_comment","normal","reflinkSearch","out","charCodeAt","random","toString","_punctuation","blockSkip","escapedEmSt","_scheme","_email","_attribute","_href","strong","middle","endAst","endUnd","em","_extended_email","Lexer","Object","create","inlineQueue","static","lex","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","startBlock","startIndex","Infinity","tempSrc","tempStart","forEach","getStartIndex","errMsg","console","keepPrevChar","keys","lastIndexOf","startInline","Renderer$1","infostring","quote","slugger","slug","body","listitem","checkbox","tablerow","content","tablecell","flags","image","TextRenderer","Slugger","seen","serialize","getNextSafeSlug","originalSlug","isDryRun","occurenceAccumulator","hasOwnProperty","dryrun","Parser","Renderer","textRenderer","parse","parseInline","l2","l3","cell","itemBody","ret","renderers","parser","unshift","Hooks","Set","preprocess","markdown","postprocess","parseMarkdown","origOpt","throwError","message","msg","onError","marked","warn","checkSanitizeDeprecation","err","pending","setTimeout","setOptions","newDefaults","use","childTokens","pack","opts","ext","prevRenderer","prevTokenizer","prevHook","passThroughHooks","arg","values","concat","lexInline","globalThis","global","module","pluralizeExports","exports","v","root","pluralize","commonjsGlobal","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","interpolate","arguments","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","defineProperty","r","a","delete","configurable","o","s","WeakSet","add","m","u","insertBefore","selected","selectedIndex","f","querySelectorAll","y","w","x","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","p","g","Array","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","_wire$","defineProperties","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","isArray","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","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","it","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","bind","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","input","subtype","TypeError","parserMode","inputArray","from","position","char","trimEnd","fromEntries","entries","parseMimeType","parameters","essence","mimeType","size","paramStr","key","_pluralize","reindent","lines","indents","leastIndent","getElementsByTagName","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","dateLang","docLang","startsWith","W3CDate","createResourceHint","URL","baseURI","linkElem","rel","hint","corsMode","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","norm","getIntlData","localizationStrings","data","getIntlDataForKey","runTransforms","flist","funcArgs","methods","meth","showWarning","htmlJoinComma","array","joined","addId","pfx","txt","noLC","id","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","ref","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","wrapper","parents","selector","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","super","getCanonicalKey","existingKey","find","makeSafeCopy","clone","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","comment","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","assign","elements","markAsOffending","toJSON","details","showError","pluginName","toMDCode","codedJoinOr","quotes","docLink","strings","endsWith","linkingText","mimeTypes","rsDocToDataURL","format","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$h","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","trimStart","firstTwo","lastTwo","indentation","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","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","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","ev","locationHash","l10n$p","style$1","dataInclude","reindent$1","headers","abstract","dataTransform","dataAbbr","inlines","conformance","examples","issuesNotes","bestPractices","figures","biblio$1","linkToDfn","dataCite","renderBiblio","contrib","sections","fixHeaders","structure","informative","idHeaders","saveHtml","aboutRespec","seo","listSorter","highlightVars$1","dataType","algorithms","anchorExpander","dfnPanel","checkCharset","checkPunctuation","localRefsExist","noHeadinglessSections","noUnusedVars","privsecSection","noHttpProps","ReSpec.run","hash","hasLink","isLegacyFrag","coreDefaults","lint","specStatus","highlightVars","addSectionLinks","licenses","short","aomDefaults","logos","alt","height","width","license","licenseInfo","computeProps","css$f","noReSpecCSS","resourceHints","createResourceHints","createBaseStyle","meta","delimiter","separator","toKeyValuePairs","createMetaViewport","styleFile","noToc","attachFixupScript","finalStyleURL","linkURL","urls","frag","reduce","nextLink","linkCSS","exportDoc","w3cStyle","DOMBuilder","current","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","include","includeId","response","fetch","default_title","zh","h1Elem","isConnected","tempElem","documentTitle","isPreview","prNumber","prUrl","github","repoURL","setDocumentTitle","showLink","class","showLinkData","showLogo","logo","until","date","es","ko","ja","showPeople","propName","people","validatePerson","person","docsUrl","seePersonHint","preamble","orcid","orcidUrl","orcidId","pathname","lastDigit","lastDigitInt","Number","acc","lastDigitShould","checkOrcidChecksum","retiredDate","rawDate","Date","extras","every","extra","validateExtras","mailto","companyURL","company","personToHTML","personName","editorId","w3cid","contents","hCard","companyElem","note","classVal","renderExtra","time","author","authors","editor","editors","former_editor","former_editors","latest_editors_draft","latest_published_version","this_version","issue_tracker","headersTmpl","specSubTitleElem","subtitle","getSpecSubTitleElem","textStatus","dashDate","publishHumanDate","thisVersion","issueTracker","multipleEditors","formerEditors","multipleFormerEditors","multipleAuthors","otherLinks","existingCopyright","publishYear","renderCopyright","status2text","PD","WGD","WGA","FD","AOMDate","publishDate","fallbackDate","isFinite","formattedDate","validateDateAndRecover","lastModified","shortName","getUTCFullYear","peopCheck","copyrightStart","publishISODate","toISOString","generatedSubtitle","longStatus","abs","abstractHeading","processDfnElement","abbr","fullForm","insertAdjacentHTML","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","identifier","renderParent","nullable","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","reverse","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","unique","now","range","IDBKeyRange","lowerBound","openCursor","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","aliasesAndRefs","alias","reference","promisesToAdd","flatMap","isInDB","put","close","stores","clearStorePromises","clear","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","ok","status","json","oneHourFromNow","addAll","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","nl","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","etAl","publisher","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","re","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","normativity","keywordInterpretation","processConformance","terms","contains","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","dfnFor","validateDefinition","idl","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","computeExport","export","addContractDefaults","dfnsWithNoType","exportableDfns","titles","pluralizeDfn","dfnTexts","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","css$d","makeTitle","num","report","number","div","inAside","exampleTitle","css$b","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","issueBase","atRiskBase","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","issuesURL","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","hasChildNodes","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","apiBase","issueNumbers","fullName","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","img","naturalHeight","naturalWidth","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","decorateTableOfFigures","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","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","duplicates","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkTargets","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","first","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","xref","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","toHTML","res","maxAge","Request","cache","cachedResponse","caches","clonedResponse","customHeaders","Headers","expiryDate","cacheResponse","Response","blob","fetchAndCache","showContributors","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","prefix","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","Boolean","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","save_snapshot","downloadLinks","epubURL","toDownloadLink","sep","concatDate","filename","saveDialog","supportsDownload","HTMLAnchorElement","about_respec","getEntriesByType","duration","round","perfEntryToTR","firstParagraph","metaElem","css$9","fetchBase","currentScript","workerPromise","workerScript","respecWorker$1","default","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$7","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","outputDoc","css$5","varMap","variables","currentSection","textNode","Text","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","definition","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","file_a_bug","participate","commit_history","props","to","connectedCallback","fetchCommits","commits","commit","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","isRecTrack","saysPrivOrSec","saysConsiderations","offendingMembers","getOwnPropertyNames"],"mappings":"sDACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAAON,OAAOC,QAAQG,QAAQE,EAAI,IAEpCE,QAAQC,IAAIL,GAASM,MAAKC,GAAWR,KAAYQ,IACrD,EACEV,EAAQG,QAAU,GAClBJ,OAAOC,QAAUA,CACnB,CAMO,SAASW,EAAOC,EAAMC,GACtBf,IACHC,OAAOC,QAAQG,QAAQS,GAAQC,EAEnC,CCtBO,MAIDC,EAAgB,IAAIC,YAOnB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ClE,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,QACV3F,SAAQ,SAAU2F,GAClB,OAAOR,EAAU6B,gBAAgBrB,EAAK,GAAIA,EAAK,GACpD,IAKG,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,WACA3F,QAAQmF,EAAU8B,oBAEb9B,CACV,IAGA,IAAIA,GAAYJ,GCjgBsBqC,GAAU,SAASC,GAAgB,IAAIlO,EAAE,CAAE,EAAC,IAAIA,EAAEjP,QAAQA,OAAod,CAA5c,MAAMd,GAAG+P,EAAEjP,QAAQ,SAASiP,EAAE/P,GAAG,IAAIiJ,EAAEjJ,EAAEke,eAAeC,EAAEne,E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D1b,QAAO0b,GACN,IAAIoB,IAAI2L,EAAK/M,GAAMttB,OAAOQ,SAASwK,MAAMA,KAAKujB,WAAW,aAG7D,GAAI4jC,EAAiBzlD,OAAQ,CAC3B,MAAMsL,EAAO+X,GAAQoiC,GAAkB7kC,GAAO6H,EAAO,GAAG,IAAI7H,SAC5DoD,GAAYnvB,GAAKyZ,IAAKzb,GAAM,CAAEuvB,KAAMvtB,GAAKutB,KAAO9W,GACjD,CACH","x_google_ignoreList":[4,5,6,7,9]} \ No newline at end of file +{"version":3,"file":"respec-aom.js","sources":["../src/core/expose-modules.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/l10n.js","../node_modules/idb/build/wrap-idb-value.js","../node_modules/idb/build/index.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/reindent.js","../src/core/utils.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/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/aom.js","../src/core/location-hash.js","../src/core/defaults.js","../src/aom/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/aom/style.js","../src/core/sections.js","../src/core/data-include.js","../src/core/title.js","../src/core/templates/show-link.js","../src/core/templates/show-logo.js","../src/core/templates/show-people.js","../src/aom/templates/headers.js","../src/aom/headers.js","../src/aom/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/aom/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/data-cite.js","../src/core/link-to-dfn.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/ui/save-html.js","../src/ui/about-respec.js","../src/core/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.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/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/github.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.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/no-http-props.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/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\nimport { expose } from \"./expose-modules.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.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, options = { once: false }) {\n const listener = e => cb(e.detail);\n subscriptions.addEventListener(topic, listener, options);\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/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), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\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', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\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 * 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 v4.3.0 - a markdown parser\n * Copyright (c) 2011-2023, 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\nfunction getDefaults() {\n return {\n async: false,\n baseUrl: null,\n breaks: false,\n extensions: null,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n hooks: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: null,\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartypants: false,\n tokenizer: null,\n walkTokens: null,\n xhtml: false\n };\n}\n\nlet defaults = getDefaults();\n\nfunction changeDefaults(newDefaults) {\n defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape(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\n/**\n * @param {string} html\n */\nfunction unescape(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;\n\n/**\n * @param {string | RegExp} regex\n * @param {string} opt\n */\nfunction edit(regex, opt) {\n regex = typeof regex === 'string' ? regex : regex.source;\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;\n\n/**\n * @param {boolean} sanitize\n * @param {string} base\n * @param {string} href\n */\nfunction cleanUrl(sanitize, base, href) {\n if (sanitize) {\n let prot;\n try {\n prot = decodeURIComponent(unescape(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\n/**\n * @param {string} base\n * @param {string} href\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(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 = { exec: function noopTest() {} };\n\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n 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 // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) { cells.shift(); }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) { cells.pop(); }\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/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param {string} str\n * @param {string} c\n * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(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.slice(0, l - suffLen);\n}\n\nfunction findClosingBracket(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(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\n/**\n * @param {string} pattern\n * @param {number} count\n */\nfunction repeatString(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\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape(text)\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 */\nclass Tokenizer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\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().replace(this.rules.inline._escapes, '$1') : 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,\n tokens: this.lexer.inline(text)\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(/^ *>[ \\t]?/gm, '');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine,\n line, nextLine, rawLine, itemContents, endEarly;\n\n let bull = cap[1].trim();\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 bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n\n // Check if current bullet point can start a new List Item\n while (src) {\n endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n\n raw = cap[0];\n src = src.substring(raw.length);\n\n line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n nextLine = src.split('\\n', 1)[0];\n\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimLeft();\n } else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n\n blankLine = false;\n\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n\n // Check if following lines should be included in List Item\n while (src) {\n rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n } else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n\n itemContents += '\\n' + nextLine;\n }\n\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n } else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents\n });\n\n list.raw += raw;\n }\n\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimRight();\n list.items[list.items.length - 1].text = itemContents.trimRight();\n list.raw = list.raw.trimRight();\n\n const l = list.items.length;\n\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (i = 0; i < l; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n\n list.loose = hasMultipleLineBreaks;\n }\n }\n\n // Set all items to loose if list is loose\n if (list.loose) {\n for (i = 0; i < l; i++) {\n list.items[i].loose = true;\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 const token = {\n type: 'html',\n raw: cap[0],\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: cap[0]\n };\n if (this.options.sanitize) {\n const text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);\n token.type = 'paragraph';\n token.text = text;\n token.tokens = this.lexer.inline(text);\n }\n return token;\n }\n }\n\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\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]).map(c => { return { text: c }; }),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n rows: cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').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, j, k, row;\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.rows.length;\n for (i = 0; i < l; i++) {\n item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; });\n }\n\n // parse child tokens inside headers and cells\n\n // header child tokens\n l = item.header.length;\n for (j = 0; j < l; j++) {\n item.header[j].tokens = this.lexer.inline(item.header[j].text);\n }\n\n // cell child tokens\n l = item.rows.length;\n for (j = 0; j < l; j++) {\n row = item.rows[j];\n for (k = 0; k < row.length; k++) {\n row[k].tokens = this.lexer.inline(row[k].text);\n }\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 tokens: this.lexer.inline(cap[1])\n };\n }\n }\n\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\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 tokens: this.lexer.inline(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(cap[1])\n };\n }\n }\n\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n } else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n } else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n\n return {\n type: this.options.sanitize\n ? 'text'\n : 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n text: this.options.sanitize\n ? (this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape(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], this.lexer);\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) {\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], this.lexer);\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 const raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\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(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 tokens: this.lexer.inlineTokens(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(this.options.mangle ? mangle(cap[1]) : cap[1]);\n href = 'mailto:' + text;\n } else {\n text = escape(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(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(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n } else {\n href = cap[0];\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, smartypants) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0];\n } else {\n text = escape(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\n/**\n * Block-Level Grammar\n */\nconst block = {\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}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/,\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][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/,\n table: noopTest,\n lheading: /^((?:.|\\n(?!\\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|table| +\\n)[^\\n]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock._label = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nblock._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock.def = edit(block.def)\n .replace('label', block._label)\n .replace('title', block._title)\n .getRegex();\n\nblock.bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nblock.listItemStart = edit(/^( *)(bull) */)\n .replace('bull', block.bullet)\n .getRegex();\n\nblock.list = edit(block.list)\n .replace(/bull/g, block.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block.def.source + ')')\n .getRegex();\n\nblock._tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'\n + '|track|ul';\nblock._comment = /<!--(?!-?>)[\\s\\S]*?(?:-->|$)/;\nblock.html = edit(block.html, 'i')\n .replace('comment', block._comment)\n .replace('tag', block._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('|table', '')\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._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.blockquote = edit(block.blockquote)\n .replace('paragraph', block.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock.normal = { ...block };\n\n/**\n * GFM Block Grammar\n */\n\nblock.gfm = {\n ...block.normal,\n table: '^ *([^\\\\n ].*\\\\|.*)\\\\n' // Header\n + ' {0,3}(?:\\\\| *)?(:?-+:? *(?:\\\\| *:?-+:? *)*)(?:\\\\| *)?' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)' // Cells\n};\n\nblock.gfm.table = edit(block.gfm.table)\n .replace('hr', block.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._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.gfm.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('table', block.gfm.table) // interrupt paragraphs with table\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._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock.pedantic = {\n ...block.normal,\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', block._comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(block.normal._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n};\n\n/**\n * Inline-Level Grammar\n */\nconst inline = {\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)\\]\\[(ref)\\]/,\n nolink: /^!?\\[(ref)\\](?:\\[\\])?/,\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 orphan inside strong () Consume to delim (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._punctuation = '!\"#$%&\\'()+\\\\-.,/:;<=>?@\\\\[\\\\]`^{|}~';\ninline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();\n\n// sequences em should skip over [title](link), `code`, <html>\ninline.blockSkip = /\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>/g;\n// lookbehind is not available on Safari as of version 16\n// inline.escapedEmSt = /(?<=(?:^|[^\\\\)(?:\\\\[^])*)\\\\[*_]/g;\ninline.escapedEmSt = /(?:^|[^\\\\])(?:\\\\\\\\)*\\\\[*_]/g;\n\ninline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();\n\ninline.emStrong.lDelim = edit(inline.emStrong.lDelim)\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;\ninline.autolink = edit(inline.autolink)\n .replace('scheme', inline._scheme)\n .replace('email', inline._email)\n .getRegex();\n\ninline._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline.tag = edit(inline.tag)\n .replace('comment', inline._comment)\n .replace('attribute', inline._attribute)\n .getRegex();\n\ninline._label = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline._href = /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/;\ninline._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline.link = edit(inline.link)\n .replace('label', inline._label)\n .replace('href', inline._href)\n .replace('title', inline._title)\n .getRegex();\n\ninline.reflink = edit(inline.reflink)\n .replace('label', inline._label)\n .replace('ref', block._label)\n .getRegex();\n\ninline.nolink = edit(inline.nolink)\n .replace('ref', block._label)\n .getRegex();\n\ninline.reflinkSearch = edit(inline.reflinkSearch, 'g')\n .replace('reflink', inline.reflink)\n .replace('nolink', inline.nolink)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline.normal = { ...inline };\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline.pedantic = {\n ...inline.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._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline._label)\n .getRegex()\n};\n\n/**\n * GFM Inline Grammar\n */\n\ninline.gfm = {\n ...inline.normal,\n escape: edit(inline.escape).replace('])', '~|])').getRegex(),\n _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,\n url: /^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\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.gfm.url = edit(inline.gfm.url, 'i')\n .replace('email', inline.gfm._extended_email)\n .getRegex();\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\ninline.breaks = {\n ...inline.gfm,\n br: edit(inline.br).replace('{2,}', '*').getRegex(),\n text: edit(inline.gfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n};\n\n/**\n * smartypants text replacement\n * @param {string} text\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 * @param {string} text\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 */\nclass Lexer {\n constructor(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || defaults;\n this.options.tokenizer = this.options.tokenizer || new Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\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\n this.blockTokens(src, this.tokens);\n\n let next;\n while (next = this.inlineQueue.shift()) {\n this.inlineTokens(next.src, next.tokens);\n }\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n } else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n\n let token, 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({ lexer: 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.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n } else {\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' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 // 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 tokens.push(token);\n continue;\n }\n\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\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 (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else 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({ lexer: 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 (this.state.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 this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 this.state.top = true;\n return tokens;\n }\n\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\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 + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);\n 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({ lexer: 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)) {\n src = src.substring(token.raw.length);\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 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 (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 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 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 (!this.state.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({ lexer: 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, 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\n/**\n * Renderer\n */\nclass Renderer {\n constructor(options) {\n this.options = options || defaults;\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(code, true))\n + '</code></pre>\\n';\n }\n\n return '<pre><code class=\"'\n + this.options.langPrefix\n + escape(lang)\n + '\">'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n /**\n * @param {string} quote\n */\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n\n html(html) {\n return html;\n }\n\n /**\n * @param {string} text\n * @param {string} level\n * @param {string} raw\n * @param {any} slugger\n */\n heading(text, level, raw, slugger) {\n if (this.options.headerIds) {\n const id = this.options.headerPrefix + slugger.slug(raw);\n return `<h${level} id=\"${id}\">${text}</h${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 /**\n * @param {string} text\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 /**\n * @param {string} text\n */\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n\n /**\n * @param {string} header\n * @param {string} body\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 /**\n * @param {string} content\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 /**\n * span level renderer\n * @param {string} text\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n\n /**\n * @param {string} text\n */\n em(text) {\n return `<em>${text}</em>`;\n }\n\n /**\n * @param {string} text\n */\n codespan(text) {\n return `<code>${text}</code>`;\n }\n\n br() {\n return this.options.xhtml ? '<br/>' : '<br>';\n }\n\n /**\n * @param {string} text\n */\n del(text) {\n return `<del>${text}</del>`;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\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=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\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 */\nclass 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 */\nclass Slugger {\n constructor() {\n this.seen = {};\n }\n\n /**\n * @param {string} value\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 * @param {string} originalSlug\n * @param {boolean} isDryRun\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\n * 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\n/**\n * Parsing & Compiling\n */\nclass Parser {\n constructor(options) {\n this.options = options || defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new TextRenderer();\n this.slugger = new Slugger();\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({ parser: 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.header[j].tokens),\n { header: true, align: token.align[j] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n body = '';\n l2 = token.rows.length;\n for (j = 0; j < l2; j++) {\n row = token.rows[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].tokens),\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 === 'paragraph') {\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({ parser: 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\nclass Hooks {\n constructor(options) {\n this.options = options || defaults;\n }\n\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess'\n ]);\n\n /**\n * Process markdown before marked\n */\n preprocess(markdown) {\n return markdown;\n }\n\n /**\n * Process HTML after marked is finished\n */\n postprocess(html) {\n return html;\n }\n}\n\nfunction onError(silent, async, callback) {\n return (e) => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n\n if (silent) {\n const msg = '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n if (async) {\n return Promise.resolve(msg);\n }\n if (callback) {\n callback(null, msg);\n return;\n }\n return msg;\n }\n\n if (async) {\n return Promise.reject(e);\n }\n if (callback) {\n callback(e);\n return;\n }\n throw e;\n };\n}\n\nfunction parseMarkdown(lexer, parser) {\n return (src, opt, callback) => {\n if (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n const origOpt = { ...opt };\n opt = { ...marked.defaults, ...origOpt };\n const throwError = onError(opt.silent, opt.async, callback);\n\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n\n checkSanitizeDeprecation(opt);\n\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n tokens = lexer(src, opt);\n } catch (e) {\n return throwError(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(tokens, opt);\n if (opt.hooks) {\n out = opt.hooks.postprocess(out);\n }\n } catch (e) {\n err = e;\n }\n }\n\n opt.highlight = highlight;\n\n return err\n ? throwError(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 if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.walkTokens ? Promise.all(marked.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n const tokens = lexer(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n } catch (e) {\n return throwError(e);\n }\n };\n}\n\n/**\n * Marked\n */\nfunction marked(src, opt, callback) {\n return parseMarkdown(Lexer.lex, Parser.parse)(src, opt, callback);\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n marked.defaults = { ...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 extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };\n\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n\n // set async to true if it was set to true before\n opts.async = marked.defaults.async || opts.async || false;\n\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\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[ext.name];\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 opts.extensions = extensions;\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 Hooks extensions --== //\n if (pack.hooks) {\n const hooks = marked.defaults.hooks || new Hooks();\n for (const prop in pack.hooks) {\n const prevHook = hooks[prop];\n if (Hooks.passThroughHooks.has(prop)) {\n hooks[prop] = (arg) => {\n if (marked.defaults.async) {\n return Promise.resolve(pack.hooks[prop].call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n\n const ret = pack.hooks[prop].call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n } else {\n hooks[prop] = (...args) => {\n let ret = pack.hooks[prop].apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked.defaults.walkTokens;\n opts.walkTokens = function(token) {\n let values = [];\n values.push(pack.walkTokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n\n marked.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(marked, token));\n switch (token.type) {\n case 'table': {\n for (const cell of token.header) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n for (const row of token.rows) {\n for (const cell of row) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n values = values.concat(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 values = values.concat(marked.walkTokens(token[childTokens], callback));\n });\n } else if (token.tokens) {\n values = values.concat(marked.walkTokens(token.tokens, callback));\n }\n }\n }\n }\n return values;\n};\n\n/**\n * Parse Inline\n * @param {string} src\n */\nmarked.parseInline = parseMarkdown(Lexer.lexInline, Parser.parseInline);\n\n/**\n * Expose\n */\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\nmarked.Tokenizer = Tokenizer;\nmarked.Slugger = Slugger;\nmarked.Hooks = Hooks;\nmarked.parse = marked;\n\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = Parser.parse;\nconst lexer = Lexer.lex;\n\nexport { Hooks, Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\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 pluralizeExports = {};\nvar pluralize$1 = {\n get exports(){ return pluralizeExports; },\n set exports(v){ pluralizeExports = v; },\n};\n\n/* global define */\n\n(function (module, exports) {\n\t(function (root, pluralize) {\n\t /* istanbul ignore else */\n\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t // Node.\n\t module.exports = pluralize();\n\t } else {\n\t // Browser global.\n\t root.pluralize = pluralize();\n\t }\n\t})(commonjsGlobal, function () {\n\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t // while other rules can be optimized using an object for instant lookups.\n\t var pluralRules = [];\n\t var singularRules = [];\n\t var uncountables = {};\n\t var irregularPlurals = {};\n\t var irregularSingles = {};\n\n\t /**\n\t * Sanitize a pluralization rule to a usable regular expression.\n\t *\n\t * @param {(RegExp|string)} rule\n\t * @return {RegExp}\n\t */\n\t function sanitizeRule (rule) {\n\t if (typeof rule === 'string') {\n\t return new RegExp('^' + rule + '$', 'i');\n\t }\n\n\t return rule;\n\t }\n\n\t /**\n\t * Pass in a word token to produce a function that can replicate the case on\n\t * another word.\n\t *\n\t * @param {string} word\n\t * @param {string} token\n\t * @return {Function}\n\t */\n\t function restoreCase (word, token) {\n\t // Tokens are an exact match.\n\t if (word === token) return token;\n\n\t // Lower cased words. E.g. \"hello\".\n\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t // Upper cased words. E.g. \"WHISKY\".\n\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t // Title cased words. E.g. \"Title\".\n\t if (word[0] === word[0].toUpperCase()) {\n\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t }\n\n\t // Lower cased words. E.g. \"test\".\n\t return token.toLowerCase();\n\t }\n\n\t /**\n\t * Interpolate a regexp string.\n\t *\n\t * @param {string} str\n\t * @param {Array} args\n\t * @return {string}\n\t */\n\t function interpolate (str, args) {\n\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t return args[index] || '';\n\t });\n\t }\n\n\t /**\n\t * Replace a word using a rule.\n\t *\n\t * @param {string} word\n\t * @param {Array} rule\n\t * @return {string}\n\t */\n\t function replace (word, rule) {\n\t return word.replace(rule[0], function (match, index) {\n\t var result = interpolate(rule[1], arguments);\n\n\t if (match === '') {\n\t return restoreCase(word[index - 1], result);\n\t }\n\n\t return restoreCase(match, result);\n\t });\n\t }\n\n\t /**\n\t * Sanitize a word by passing in the word and sanitization rules.\n\t *\n\t * @param {string} token\n\t * @param {string} word\n\t * @param {Array} rules\n\t * @return {string}\n\t */\n\t function sanitizeWord (token, word, rules) {\n\t // Empty string or doesn't need fixing.\n\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t return word;\n\t }\n\n\t var len = rules.length;\n\n\t // Iterate over the sanitization rules and use the first one to match.\n\t while (len--) {\n\t var rule = rules[len];\n\n\t if (rule[0].test(word)) return replace(word, rule);\n\t }\n\n\t return word;\n\t }\n\n\t /**\n\t * Replace a word with the updated word.\n\t *\n\t * @param {Object} replaceMap\n\t * @param {Object} keepMap\n\t * @param {Array} rules\n\t * @return {Function}\n\t */\n\t function replaceWord (replaceMap, keepMap, rules) {\n\t return function (word) {\n\t // Get the correct token and case restoration functions.\n\t var token = word.toLowerCase();\n\n\t // Check against the keep object map.\n\t if (keepMap.hasOwnProperty(token)) {\n\t return restoreCase(word, token);\n\t }\n\n\t // Check against the replacement map for a direct word replacement.\n\t if (replaceMap.hasOwnProperty(token)) {\n\t return restoreCase(word, replaceMap[token]);\n\t }\n\n\t // Run all the rules against the word.\n\t return sanitizeWord(token, word, rules);\n\t };\n\t }\n\n\t /**\n\t * Check if a word is part of the map.\n\t */\n\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t return function (word) {\n\t var token = word.toLowerCase();\n\n\t if (keepMap.hasOwnProperty(token)) return true;\n\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t return sanitizeWord(token, token, rules) === token;\n\t };\n\t }\n\n\t /**\n\t * Pluralize or singularize a word based on the passed in count.\n\t *\n\t * @param {string} word The word to pluralize\n\t * @param {number} count How many of the word exist\n\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t * @return {string}\n\t */\n\t function pluralize (word, count, inclusive) {\n\t var pluralized = count === 1\n\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t return (inclusive ? count + ' ' : '') + pluralized;\n\t }\n\n\t /**\n\t * Pluralize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.plural = replaceWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Check if a word is plural.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isPlural = checkWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Singularize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.singular = replaceWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Check if a word is singular.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isSingular = checkWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Add a pluralization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addPluralRule = function (rule, replacement) {\n\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add a singularization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addSingularRule = function (rule, replacement) {\n\t singularRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add an uncountable word rule.\n\t *\n\t * @param {(string|RegExp)} word\n\t */\n\t pluralize.addUncountableRule = function (word) {\n\t if (typeof word === 'string') {\n\t uncountables[word.toLowerCase()] = true;\n\t return;\n\t }\n\n\t // Set singular and plural references for the word.\n\t pluralize.addPluralRule(word, '$0');\n\t pluralize.addSingularRule(word, '$0');\n\t };\n\n\t /**\n\t * Add an irregular word definition.\n\t *\n\t * @param {string} single\n\t * @param {string} plural\n\t */\n\t pluralize.addIrregularRule = function (single, plural) {\n\t plural = plural.toLowerCase();\n\t single = single.toLowerCase();\n\n\t irregularSingles[single] = plural;\n\t irregularPlurals[plural] = single;\n\t };\n\n\t /**\n\t * Irregular rules.\n\t */\n\t [\n\t // Pronouns.\n\t ['I', 'we'],\n\t ['me', 'us'],\n\t ['he', 'they'],\n\t ['she', 'they'],\n\t ['them', 'them'],\n\t ['myself', 'ourselves'],\n\t ['yourself', 'yourselves'],\n\t ['itself', 'themselves'],\n\t ['herself', 'themselves'],\n\t ['himself', 'themselves'],\n\t ['themself', 'themselves'],\n\t ['is', 'are'],\n\t ['was', 'were'],\n\t ['has', 'have'],\n\t ['this', 'these'],\n\t ['that', 'those'],\n\t // Words ending in with a consonant and `o`.\n\t ['echo', 'echoes'],\n\t ['dingo', 'dingoes'],\n\t ['volcano', 'volcanoes'],\n\t ['tornado', 'tornadoes'],\n\t ['torpedo', 'torpedoes'],\n\t // Ends with `us`.\n\t ['genus', 'genera'],\n\t ['viscus', 'viscera'],\n\t // Ends with `ma`.\n\t ['stigma', 'stigmata'],\n\t ['stoma', 'stomata'],\n\t ['dogma', 'dogmata'],\n\t ['lemma', 'lemmata'],\n\t ['schema', 'schemata'],\n\t ['anathema', 'anathemata'],\n\t // Other irregular rules.\n\t ['ox', 'oxen'],\n\t ['axe', 'axes'],\n\t ['die', 'dice'],\n\t ['yes', 'yeses'],\n\t ['foot', 'feet'],\n\t ['eave', 'eaves'],\n\t ['goose', 'geese'],\n\t ['tooth', 'teeth'],\n\t ['quiz', 'quizzes'],\n\t ['human', 'humans'],\n\t ['proof', 'proofs'],\n\t ['carve', 'carves'],\n\t ['valve', 'valves'],\n\t ['looey', 'looies'],\n\t ['thief', 'thieves'],\n\t ['groove', 'grooves'],\n\t ['pickaxe', 'pickaxes'],\n\t ['passerby', 'passersby']\n\t ].forEach(function (rule) {\n\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Pluralization rules.\n\t */\n\t [\n\t [/s?$/i, 's'],\n\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t [/([^aeiou]ese)$/i, '$1'],\n\t [/(ax|test)is$/i, '$1es'],\n\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t [/(e[mn]u)s?$/i, '$1s'],\n\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t [/(her|at|gr)o$/i, '$1oes'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t [/sis$/i, 'ses'],\n\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t [/(child)(?:ren)?$/i, '$1ren'],\n\t [/eaux$/i, '$0'],\n\t [/m[ae]n$/i, 'men'],\n\t ['thou', 'you']\n\t ].forEach(function (rule) {\n\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Singularization rules.\n\t */\n\t [\n\t [/s$/i, ''],\n\t [/(ss)$/i, '$1'],\n\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t [/ies$/i, 'y'],\n\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t [/(seraph|cherub)im$/i, '$1'],\n\t [/(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\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t [/(test)(?:is|es)$/i, '$1is'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t [/(matr|append)ices$/i, '$1ix'],\n\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t [/(child)ren$/i, '$1'],\n\t [/(eau)x?$/i, '$1'],\n\t [/men$/i, 'man']\n\t ].forEach(function (rule) {\n\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Uncountable rules.\n\t */\n\t [\n\t // Singular words with no plurals.\n\t 'adulthood',\n\t 'advice',\n\t 'agenda',\n\t 'aid',\n\t 'aircraft',\n\t 'alcohol',\n\t 'ammo',\n\t 'analytics',\n\t 'anime',\n\t 'athletics',\n\t 'audio',\n\t 'bison',\n\t 'blood',\n\t 'bream',\n\t 'buffalo',\n\t 'butter',\n\t 'carp',\n\t 'cash',\n\t 'chassis',\n\t 'chess',\n\t 'clothing',\n\t 'cod',\n\t 'commerce',\n\t 'cooperation',\n\t 'corps',\n\t 'debris',\n\t 'diabetes',\n\t 'digestion',\n\t 'elk',\n\t 'energy',\n\t 'equipment',\n\t 'excretion',\n\t 'expertise',\n\t 'firmware',\n\t 'flounder',\n\t 'fun',\n\t 'gallows',\n\t 'garbage',\n\t 'graffiti',\n\t 'hardware',\n\t 'headquarters',\n\t 'health',\n\t 'herpes',\n\t 'highjinks',\n\t 'homework',\n\t 'housework',\n\t 'information',\n\t 'jeans',\n\t 'justice',\n\t 'kudos',\n\t 'labour',\n\t 'literature',\n\t 'machinery',\n\t 'mackerel',\n\t 'mail',\n\t 'media',\n\t 'mews',\n\t 'moose',\n\t 'music',\n\t 'mud',\n\t 'manga',\n\t 'news',\n\t 'only',\n\t 'personnel',\n\t 'pike',\n\t 'plankton',\n\t 'pliers',\n\t 'police',\n\t 'pollution',\n\t 'premises',\n\t 'rain',\n\t 'research',\n\t 'rice',\n\t 'salmon',\n\t 'scissors',\n\t 'series',\n\t 'sewage',\n\t 'shambles',\n\t 'shrimp',\n\t 'software',\n\t 'species',\n\t 'staff',\n\t 'swine',\n\t 'tennis',\n\t 'traffic',\n\t 'transportation',\n\t 'trout',\n\t 'tuna',\n\t 'wealth',\n\t 'welfare',\n\t 'whiting',\n\t 'wildebeest',\n\t 'wildlife',\n\t 'you',\n\t /pok[eé]mon$/i,\n\t // Regexes.\n\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t /deer$/i, // \"deer\", \"reindeer\"\n\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t /measles$/i,\n\t /o[iu]s$/i, // \"carnivorous\"\n\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t /sheep$/i\n\t ].forEach(pluralize.addUncountableRule);\n\n\t return pluralize;\n\t});\n} (pluralize$1));\n\nvar pluralize = pluralizeExports;\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/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _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\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\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// 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\";\nimport { reindent } from \"./reindent.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\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\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 if (opts.corsMode) {\n linkElem.crossOrigin = opts.corsMode;\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 * @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 = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || 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/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\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 * 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 * @param {Element} element\n */\nexport function 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/**\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 const linkifiedStr = 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 return reindent(linkifiedStr);\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 */\nimport { serialize } from \"../core/exporter.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","// @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\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\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 padding: 0.2em 0em;\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 will-change: opacity;\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 {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\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 font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.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-warning-list > li::before {\n content: \"⚠️\";\n}\n\n.respec-error-list > li::before {\n content: \"💥\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\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 top: 10%;\n background: #fff;\n border: 5px solid #666;\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\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-menu button.respec-option {\n background: white;\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 background-color: #eeeeee;\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\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\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\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 */\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;\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 image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\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\nconst config = {\n sanitize: false,\n gfm: true,\n headerIds: false,\n langPrefix: \"\",\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\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\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\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\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 processMDSections(document.body);\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 // Frankenstein the whole thing back together\n newBody.append(rsUI);\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 { markdownToHtml } from \"./markdown.js\";\nimport { reindent } from \"./reindent.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\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${err.message}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\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/aom/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/aom/style.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/aom/headers.js\"),\n import(\"../src/aom/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/aom/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/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.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/ui/save-html.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/data-type.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n import(\"../src/core/custom-elements/index.js\"),\n /* Linter 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/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/no-http-props.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 * 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 AOM specs\n */\nexport const name = \"aom/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\nconst licenses = new Map([\n [\n \"aom\",\n {\n name: \"Alliance for Open Media License\",\n short: \"AOM\",\n url: \"http://aomedia.org/license/\",\n },\n ],\n]);\n\nconst aomDefaults = {\n // treat document as \"Common Markdown\" (with a little bit of HTML).\n // choice between Markdown and HTML depends on the complexity of the spec\n // example of Markdown spec: https://github.com/WICG/netinfo/blob/gh-pages/index.html\n // Helpful guide: https://respec.org/docs/#markdown\n format: \"markdown\",\n logos: [\n {\n src: \"https://aomedia.org/assets/images/aomedia-icon-only.png\",\n alt: \"AOM\",\n id: \"AOM\",\n height: 170,\n width: 170,\n url: \"https://aomedia.org/\",\n },\n ],\n license: \"aom\",\n};\n\nfunction computeProps(conf) {\n return {\n licenseInfo: licenses.get(conf.license),\n };\n}\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...aomDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...aomDefaults,\n ...conf,\n lint,\n });\n\n // computed properties\n Object.assign(conf, computeProps(conf));\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/* --- INLINES --- */\n:is(h1, h2, h3, h4, h5, h6, a) 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\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\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\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 aom/style\n// Inserts a link to the appropriate 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 = \"aom/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 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 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 = \"\";\n\n // Figure out which style file to use.\n switch (conf.specStatus.toUpperCase()) {\n case \"PD\":\n styleFile = \"W3C-UD\";\n break;\n default:\n styleFile = \"base.css\";\n break;\n }\n\n // Attach W3C fixup script after we are done.\n if (!conf.noToc) {\n sub(\n \"end-all\",\n () => {\n attachFixupScript(document, \"2016\");\n },\n { once: true }\n );\n }\n const finalStyleURL = `https://www.w3.org/StyleSheets/TR/2016/${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","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\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) {\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(structure(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/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\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\nexport function run() {\n restructure(document.body);\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 { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.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 await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\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()).slice(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 if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\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 // We replace \":<br>\" with \":\", and \"<br>\" with \"-\", as appropriate.\n const tempElem = document.createElement(\"h1\");\n tempElem.innerHTML = h1Elem.innerHTML\n .replace(/:<br>/g, \": \")\n .replace(/<br>/g, \" - \");\n let documentTitle = norm(tempElem.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","// @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 W3CDate,\n getIntlData,\n isValidConfDate,\n showError,\n showWarning,\n} from \"../../core/utils.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};\nconst l10n = getIntlData(localizationStrings);\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 // 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 const { retiredDate } = person;\n if (person.retiredDate) {\n const time = html`<time datetime=\"${retiredDate}\"\n >${W3CDate.format(new Date(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 } 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 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 approved version:\",\n this_version: \"This version:\",\n issue_tracker: \"Issue Tracker:\",\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 => {\n return html`<div class=\"head\">\n ${conf.specStatus !== \"PD\" ? conf.logos.map(showLogo) : \"\"}\n ${document.querySelector(\"h1#title\")} ${getSpecSubTitleElem(conf)}\n <h2>\n ${conf.textStatus} -\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${conf.publishHumanDate}</time\n >\n </h2>\n <dl>\n <dt>${l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\">${conf.thisVersion}</a>\n </dd>\n <dt>${l10n.issue_tracker}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.issueTracker}\">${conf.issueTracker}</a>\n </dd>\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 ${renderCopyright(conf)}\n <hr />\n </div>`;\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 return html`<p class=\"copyright\">\n Copyright ${conf.publishYear},\n <a href=\"https://www.w3.org/\"\n ><abbr title=\"The Alliance for Open Media\">AOM</abbr></a\n ><br />\n Licensing information is available at http://aomedia.org/license/<br />\n The MATERIALS ARE PROVIDED “AS IS.” The Alliance for Open Media, its\n members,and its contributors expressly disclaim any warranties (express,\n implied, or otherwise), including implied warranties of merchantability,\n non-infringement, fitness for a particular purpose, or title, related to the\n materials. The entire risk as to implementing or otherwise using the\n materials is assumed by the implementer and user. IN NO EVENT WILL THE\n ALLIANCE FOR OPEN MEDIA, ITS MEMBERS, OR CONTRIBUTORS BE LIABLE TO ANY OTHER\n PARTY FOR LOST PROFITS OR ANY FORM OF INDIRECT, SPECIAL, INCIDENTAL, OR\n CONSEQUENTIAL DAMAGES OF ANY CHARACTER FROM ANY CAUSES OF ACTION OF ANY KIND\n WITH RESPECT TO THIS DELIVERABLE OR ITS GOVERNING AGREEMENT, WHETHER BASED\n ON BREACH OF CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, AND\n WHETHER OR NOT THE OTHER MEMBER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n DAMAGE.\n </p>`;\n}\n","// @ts-check\n// Module aom/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// - 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// - 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// - 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// - \"aom\"\nimport { ISODate, showError } from \"../core/utils.js\";\nimport headersTmpl from \"./templates/headers.js\";\nimport { pub } from \"../core/pubsubhub.js\";\n\nexport const name = \"aom/headers\";\n\nconst status2text = {\n PD: \"Pre-Draft\",\n WGD: \"AOM Work Group Draft\",\n WGA: \"AOM Working Group Approved Draft\",\n FD: \"AOM Final Deliverable\",\n};\n\nconst AOMDate = new Intl.DateTimeFormat([\"en-US\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: \"2-digit\",\n});\n\n/**\n * @param {*} conf\n * @param {string} prop\n * @param {string | number | Date} fallbackDate\n */\nfunction validateDateAndRecover(conf, prop, fallbackDate = new Date()) {\n const date = conf[prop] ? new Date(conf[prop]) : new Date(fallbackDate);\n // if date is valid\n if (Number.isFinite(date.valueOf())) {\n const formattedDate = ISODate.format(date);\n return new Date(formattedDate);\n }\n const msg =\n `[\\`${prop}\\`](https://github.com/w3c/respec/wiki/${prop}) ` +\n `is not a valid date: \"${conf[prop]}\". Expected format 'YYYY-MM-DD'.`;\n showError(msg, name);\n return new Date(ISODate.format(new Date()));\n}\n\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = \"Missing required configuration: `specStatus`\";\n showError(msg, name);\n }\n conf.title = document.title || \"No title\";\n if (!conf.subtitle) conf.subtitle = \"\";\n conf.publishDate = validateDateAndRecover(\n conf,\n \"publishDate\",\n document.lastModified\n );\n conf.thisVersion = `https://aomediacodec.github.io/${conf.shortName}/`;\n conf.issueTracker = `https://github.com/AOMediaCodec/${conf.shortName}/issues/`;\n conf.publishYear = conf.publishDate.getUTCFullYear();\n conf.publishHumanDate = AOMDate.format(conf.publishDate);\n const peopCheck = function (it) {\n if (!it.name) {\n const msg = \"All authors and editors must have a name.\";\n showError(msg, name);\n }\n };\n if (!conf.formerEditors) conf.formerEditors = [];\n if (conf.editors) {\n conf.editors.forEach(peopCheck);\n // Move any editors with retiredDate to formerEditors.\n for (let i = 0; i < conf.editors.length; i++) {\n const editor = conf.editors[i];\n if (\"retiredDate\" in editor) {\n conf.formerEditors.push(editor);\n conf.editors.splice(i--, 1);\n }\n }\n }\n if (!conf.editors || conf.editors.length === 0) {\n const msg = \"At least one editor is required\";\n showError(msg, name);\n }\n if (conf.formerEditors.length) {\n conf.formerEditors.forEach(peopCheck);\n }\n if (conf.authors) {\n conf.authors.forEach(peopCheck);\n }\n conf.multipleEditors = conf.editors && conf.editors.length > 1;\n conf.multipleFormerEditors = conf.formerEditors.length > 1;\n conf.multipleAuthors = conf.authors && conf.authors.length > 1;\n // (conf.alternateFormats || []).forEach(it => {\n // if (!it.uri || !it.label) {\n // 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.textStatus = status2text[conf.specStatus];\n conf.dashDate = ISODate.format(conf.publishDate);\n conf.publishISODate = conf.publishDate.toISOString();\n // configuration done - yay!\n\n // insert into document\n const header = headersTmpl(conf);\n document.body.prepend(header);\n document.body.classList.add(\"h-entry\");\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","// @ts-check\n// Module aom/abstract\n// Handle the abstract section properly.\nimport { getIntlData, showError } from \"../core/utils.js\";\nexport const name = \"aom/abstract\";\n\nconst localizationStrings = {\n en: {\n abstract: \"Abstract\",\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\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\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 {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\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, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\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-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 { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || 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>${text || identifier}</code></a\n >${!text || textArgs ? html`<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 /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = 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 // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\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<BiblioData?>} 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<BiblioData?>} 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 {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\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 {BiblioData} 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 let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\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 // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\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 // 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\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, 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 reference_not_found: \"Reference not found.\",\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 reference_not_found: \"Referencia no encontrada.\",\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 [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PER\", \"W3C Proposed Edited Recommendation\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\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 > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\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} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\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(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\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 /\\bMÜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NÖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDÜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKÖNNEN\\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\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-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}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></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 return html`<a\n data-link-type=\"dfn\"\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\", \"svg\"];\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 aom/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 = \"aom/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};\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 <h1>${l10n.conformance}</h1>\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 {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\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 [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup 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\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\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\n:is(aside,div).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\n:is(aside,div).example {\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}\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\";\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 const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\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 addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\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.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\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\";\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 {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 issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\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 });\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}${\n report.number ? ` ${report.number}` : \"\"\n }`;\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 `<h1>${l10n.issue_summary}</h1>`\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/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#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 allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\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`<h1>Best Practices Summary</h1>`);\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 getPreviousSections,\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`<h1>${l10n.list_of_figures}</h1>`,\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(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\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 // Don't add width and height to SVGs\n // https://github.com/w3c/respec/issues/3435\n if (img.src.startsWith(\"data:image/svg+xml;\")) return;\n if (img.src.endsWith(\".svg\")) return;\n\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n\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","// @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 if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\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 if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\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 { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\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 =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\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 return dfnsByType.get(linkType) || 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 (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\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\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 =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\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 getIntlData,\n parents,\n renameElement,\n showError,\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 (\"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, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) 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 const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, 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 ext: \"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 ext: \"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 ext: \"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\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"💾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\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/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","/*\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\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","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\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\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 \"table\": {\n processTable(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 // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\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 processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.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","/* 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-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\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","// @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 commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\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 // 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 if (!conf.excludeGithubLinks) {\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: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\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 * 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,#w3c-state)\");\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 \"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\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\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 \"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\") && conf[key]) || 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"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","subscriptions","EventTarget","pub","topic","detail","dispatchEvent","CustomEvent","parent","self","args","String","JSON","stringify","stack","postMessage","location","origin","sub","cb","options","once","addEventListener","e","removeList","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","wrapFunction","func","IDBDatabase","prototype","transaction","IDBCursor","advance","continue","continuePrimaryKey","includes","apply","unwrap","this","storeNames","tx","call","sort","transformCachableValue","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","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","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","params","paramName","paramValue","test","toLowerCase","getDefaults","baseUrl","breaks","extensions","gfm","headerIds","headerPrefix","highlight","hooks","langPrefix","mangle","pedantic","renderer","sanitize","sanitizer","silent","smartypants","tokenizer","walkTokens","xhtml","defaults","escapeTest","escapeReplace","RegExp","source","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape","encode","unescapeTest","unescape","_","n","charAt","fromCharCode","parseInt","substring","caret","edit","regex","opt","obj","val","getRegex","nonWordAndColonTest","originIndependentUrl","cleanUrl","base","href","prot","decodeURIComponent","indexOf","baseUrls","justDomain","rtrim","relativeBase","protocol","domain","resolveUrl","encodeURI","noopTest","exec","splitCells","tableRow","count","cells","match","offset","str","escaped","curr","split","i","trim","length","pop","splice","push","invert","l","suffLen","currChar","slice","repeatString","pattern","outputLink","cap","link","raw","lexer","title","text","state","inLink","token","type","tokens","inlineTokens","Tokenizer","constructor","space","src","rules","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","node","matchIndentInNode","indentInNode","join","indentCodeCompensation","inline","_escapes","heading","trimmed","depth","hr","blockquote","top","blockTokens","list","istask","ischecked","indent","blankLine","endsWithBlankLine","line","nextLine","rawLine","itemContents","endEarly","bull","isordered","ordered","start","loose","items","itemRegex","t","repeat","trimLeft","search","nextBulletRegex","Math","min","hrRegex","fencesBeginRegex","headingBeginRegex","task","checked","trimRight","spacers","filter","hasMultipleLineBreaks","pre","def","tag","table","item","header","align","rows","j","k","row","lheading","paragraph","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","level","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","lDelim","nextChar","punctuation","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","rDelimAst","rDelimUnd","lastIndex","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","_paragraph","_label","_title","bullet","listItemStart","_tag","_comment","normal","reflinkSearch","out","charCodeAt","random","toString","_punctuation","blockSkip","escapedEmSt","_scheme","_email","_attribute","_href","strong","middle","endAst","endUnd","em","_extended_email","Lexer","Object","create","inlineQueue","static","lex","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","startBlock","startIndex","Infinity","tempSrc","tempStart","forEach","getStartIndex","errMsg","console","keepPrevChar","keys","lastIndexOf","startInline","Renderer$1","infostring","quote","slugger","slug","body","listitem","checkbox","tablerow","content","tablecell","flags","image","TextRenderer","Slugger","seen","serialize","getNextSafeSlug","originalSlug","isDryRun","occurenceAccumulator","hasOwnProperty","dryrun","Parser","Renderer","textRenderer","parse","parseInline","l2","l3","cell","itemBody","ret","renderers","parser","unshift","Hooks","Set","preprocess","markdown","postprocess","parseMarkdown","origOpt","throwError","message","msg","onError","marked","warn","checkSanitizeDeprecation","err","pending","setTimeout","setOptions","newDefaults","use","childTokens","pack","opts","ext","prevRenderer","prevTokenizer","prevHook","passThroughHooks","arg","values","concat","lexInline","globalThis","global","module","pluralizeExports","exports","v","root","pluralize","commonjsGlobal","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","interpolate","arguments","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","defineProperty","r","a","delete","configurable","o","s","WeakSet","add","m","u","insertBefore","selected","selectedIndex","f","querySelectorAll","y","w","x","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","p","g","Array","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","_wire$","defineProperties","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","isArray","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","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","it","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","bind","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","input","subtype","TypeError","parserMode","inputArray","from","position","char","trimEnd","fromEntries","entries","parseMimeType","parameters","essence","mimeType","size","paramStr","key","_pluralize","reindent","lines","indents","leastIndent","getElementsByTagName","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","dateLang","docLang","startsWith","W3CDate","createResourceHint","URL","baseURI","linkElem","rel","hint","corsMode","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","norm","getIntlData","localizationStrings","data","getIntlDataForKey","runTransforms","flist","funcArgs","methods","meth","showWarning","htmlJoinComma","array","joined","addId","pfx","txt","noLC","id","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","ref","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","wrapper","parents","selector","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","super","getCanonicalKey","existingKey","find","makeSafeCopy","clone","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","comment","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","assign","elements","markAsOffending","toJSON","details","showError","pluginName","toMDCode","codedJoinOr","quotes","docLink","strings","endsWith","linkingText","mimeTypes","rsDocToDataURL","format","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$h","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","trimStart","firstTwo","lastTwo","indentation","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","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","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","ev","locationHash","l10n$p","style$1","dataInclude","reindent$1","headers","abstract","dataTransform","dataAbbr","inlines","conformance","examples","issuesNotes","bestPractices","figures","biblio$1","linkToDfn","dataCite","renderBiblio","contrib","sections","fixHeaders","structure","informative","idHeaders","saveHtml","aboutRespec","seo","listSorter","highlightVars$1","dataType","algorithms","anchorExpander","dfnPanel","checkCharset","checkPunctuation","localRefsExist","noHeadinglessSections","noUnusedVars","privsecSection","noHttpProps","ReSpec.run","hash","hasLink","isLegacyFrag","coreDefaults","lint","specStatus","highlightVars","addSectionLinks","licenses","short","aomDefaults","logos","alt","height","width","license","licenseInfo","computeProps","css$f","noReSpecCSS","resourceHints","createResourceHints","createBaseStyle","meta","delimiter","separator","toKeyValuePairs","createMetaViewport","styleFile","noToc","attachFixupScript","finalStyleURL","linkURL","urls","frag","reduce","nextLink","linkCSS","exportDoc","w3cStyle","DOMBuilder","current","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","include","includeId","response","fetch","default_title","zh","h1Elem","isConnected","tempElem","documentTitle","isPreview","prNumber","prUrl","github","repoURL","setDocumentTitle","showLink","class","showLinkData","showLogo","logo","until","date","es","ko","ja","showPeople","propName","people","validatePerson","person","docsUrl","seePersonHint","preamble","orcid","orcidUrl","orcidId","pathname","lastDigit","lastDigitInt","Number","acc","lastDigitShould","checkOrcidChecksum","retiredDate","rawDate","Date","extras","every","extra","validateExtras","mailto","companyURL","company","personToHTML","personName","editorId","w3cid","contents","hCard","companyElem","note","classVal","renderExtra","time","author","authors","editor","editors","former_editor","former_editors","latest_editors_draft","latest_published_version","this_version","issue_tracker","headersTmpl","specSubTitleElem","subtitle","getSpecSubTitleElem","textStatus","dashDate","publishHumanDate","thisVersion","issueTracker","multipleEditors","formerEditors","multipleFormerEditors","multipleAuthors","otherLinks","existingCopyright","publishYear","renderCopyright","status2text","PD","WGD","WGA","FD","AOMDate","publishDate","fallbackDate","isFinite","formattedDate","validateDateAndRecover","lastModified","shortName","getUTCFullYear","peopCheck","copyrightStart","publishISODate","toISOString","generatedSubtitle","longStatus","abs","abstractHeading","processDfnElement","abbr","fullForm","insertAdjacentHTML","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","identifier","renderParent","nullable","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","reverse","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","unique","now","range","IDBKeyRange","lowerBound","openCursor","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","aliasesAndRefs","alias","reference","promisesToAdd","flatMap","isInDB","put","close","stores","clearStorePromises","clear","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","ok","status","json","oneHourFromNow","addAll","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","nl","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","etAl","publisher","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","re","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","normativity","keywordInterpretation","processConformance","terms","contains","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","dfnFor","validateDefinition","idl","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","computeExport","export","addContractDefaults","dfnsWithNoType","exportableDfns","titles","pluralizeDfn","dfnTexts","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","css$d","makeTitle","num","report","number","div","inAside","exampleTitle","css$b","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","issueBase","atRiskBase","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","issuesURL","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","hasChildNodes","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","apiBase","issueNumbers","fullName","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","img","naturalHeight","naturalWidth","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","decorateTableOfFigures","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","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","duplicates","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkTargets","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","first","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","xref","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","toHTML","res","maxAge","Request","cache","cachedResponse","caches","clonedResponse","customHeaders","Headers","expiryDate","cacheResponse","Response","blob","fetchAndCache","showContributors","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","prefix","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","Boolean","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","save_snapshot","downloadLinks","epubURL","toDownloadLink","sep","concatDate","filename","saveDialog","supportsDownload","HTMLAnchorElement","about_respec","getEntriesByType","duration","round","perfEntryToTR","firstParagraph","metaElem","css$9","fetchBase","currentScript","workerPromise","workerScript","respecWorker$1","default","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$7","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","outputDoc","css$5","varMap","variables","currentSection","textNode","Text","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","definition","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","file_a_bug","participate","commit_history","props","to","connectedCallback","fetchCommits","commits","commit","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","isRecTrack","saysPrivOrSec","saysConsiderations","offendingMembers","getOwnPropertyNames"],"mappings":"sDACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAAON,OAAOC,QAAQG,QAAQE,EAAI,IAEpCE,QAAQC,IAAIL,GAASM,MAAKC,GAAWR,KAAYQ,IACrD,EACEV,EAAQG,QAAU,GAClBJ,OAAOC,QAAUA,CACnB,CAMO,SAASW,EAAOC,EAAMC,GACtBf,IACHC,OAAOC,QAAQG,QAAQS,GAAQC,EAEnC,CCtBO,MAIDC,EAAgB,IAAIC,YAOnB,SAASC,EAAIC,EAAOC,GAEzB,GADAJ,EAAcK,cAAc,IAAIC,YAAYH,EAAO,CAAEC,YACjDnB,OAAOsB,SAAWtB,OAAOuB,KAC3B,OAGF,MAAMC,EAAOC,OAAOC,KAAKC,UAAUR,GAAQS,OAAST,IACpDnB,OAAOsB,OAAOO,YAAY,CAAEX,QAAOM,QAAQxB,OAAOsB,OAAOQ,SAASC,OACpE,CAWO,SAASC,EAAId,EAAOe,EAAIC,E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B,CAAC,+BAAgC,QACjC,CAAC,sBAAuB,QACxB,CAAC,oBAAqB,UACtB,CAAC,eAAgB,MACjB,CAAC,YAAa,MACd,CAAC,QAAS,QACV3F,SAAQ,SAAU2F,GAClB,OAAOR,EAAU6B,gBAAgBrB,EAAK,GAAIA,EAAK,GACpD,IAKG,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,WACA3F,QAAQmF,EAAU8B,oBAEb9B,CACV,IAGA,IAAIA,GAAYJ,GCjgBsBqC,GAAU,SAASC,GAAgB,IAAIlO,EAAE,CAAE,EAAC,IAAIA,EAAEjP,QAAQA,OAAod,CAA5c,MAAMd,GAAG+P,EAAEjP,QAAQ,SAASiP,EAAE/P,GAAG,IAAIiJ,EAAEjJ,EAAEke,eAAeC,EAAEne,EAAEyY,eAAehN,EAAE2S,EAAEjc,UAAU,OAAOsJ,EAAE4S,OAAO,SAASre,GAAG,OAAO4C,KAAKb,IAAI/B,WAAWA,EAAE4C,KAAKoG,EAAE,EAAEyC,EAAErK,IAAI,SAASpB,GAAG,OAAO4C,KAAKb,IAAI/B,GAAGA,EAAE4C,KAAKoG,QAAG,CAAM,EAAEyC,EAAE1J,IAAI,SAAS/B,GAAG,OAAOme,EAAEpb,KAAK/C,EAAE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AAKyZ,IAAKzb,GAAM,CAAEuvB,KAAMvtB,GAAKutB,KAAO9W,GACjD,CACH","x_google_ignoreList":[4,5,6,7,9]} \ No newline at end of file diff --git a/builds/respec-dini.js b/builds/respec-dini.js index 41d6f10943..01a74cd7eb 100644 --- a/builds/respec-dini.js +++ b/builds/respec-dini.js @@ -1,4 +1,4 @@ -window.respecVersion="33.0.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=new EventTarget;function r(e,t){if(n.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const r=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:r},window.parent.location.origin)}function o(e,t,r={once:!1}){n.addEventListener(e,(e=>t(e.detail)),r)}t("core/pubsubhub",{sub:o});const i=["githubToken","githubUser"];const s=document.documentElement;s&&!s.hasAttribute("lang")&&(s.lang="en",s.hasAttribute("dir")||(s.dir="ltr"));const a={},l=s.lang;var c=Object.freeze({__proto__:null,l10n:a,lang:l,name:"core/l10n",run:function(e){e.l10n=a[l]||a.en}});let u,d;const p=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,g=new WeakMap;let b={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return h.get(e);if("objectStoreNames"===t)return e.objectStoreNames||f.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return v(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function y(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(d||(d=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(x(this),t),v(p.get(this))}:function(...t){return v(e.apply(x(this),t))}:function(t,...n){const r=e.call(x(this),t,...n);return f.set(r,t.sort?t.sort():[t]),v(r)}}function w(e){return"function"==typeof e?y(e):(e instanceof IDBTransaction&&function(e){if(h.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)}));h.set(e,t)}(e),t=e,(u||(u=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,b):e);var t}function v(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(v(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",i)}));return t.then((t=>{t instanceof IDBCursor&&p.set(t,e)})).catch((()=>{})),g.set(t,e),t}(e);if(m.has(e))return m.get(e);const t=w(e);return t!==e&&(m.set(e,t),g.set(t,e)),t}const x=e=>g.get(e);const k=["get","getKey","getAll","getAllKeys","count"],$=["put","add","delete","clear"],_=new Map;function E(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(_.get(t))return _.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=$.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!k.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 _.set(t,i),i}b=(e=>({...e,get:(t,n,r)=>E(t,n)||e.get(t,n,r),has:(t,n)=>!!E(t,n)||e.has(t,n)}))(b);var S=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),v(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:i}={}){const s=indexedDB.open(e,t),a=v(s);return r&&s.addEventListener("upgradeneeded",(e=>{r(v(s.result),e.oldVersion,e.newVersion,v(s.transaction),e)})),n&&s.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{i&&e.addEventListener("close",(()=>i())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:x,wrap:v});const C=/^[!#$%&'*+-.^`|~\w]+$/,A=/[\u000A\u000D\u0009\u0020]/u,L=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function T(e,t,n){(t&&""!==t&&!e.has(t)&&L.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function R(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let N={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const z=/[&<>"']/,D=new RegExp(z.source,"g"),P=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,j=new RegExp(P.source,"g"),O={"&":"&","<":"<",">":">",'"':""","'":"'"},I=e=>O[e];function q(e,t){if(t){if(z.test(e))return e.replace(D,I)}else if(P.test(e))return e.replace(j,I);return e}const M=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function F(e){return e.replace(M,((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 B=/(^|[^\[])\^/g;function H(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(B,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const W=/[^\w:]/g,U=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function V(e,t,n){if(e){let e;try{e=decodeURIComponent(F(n)).replace(W,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!U.test(n)&&(n=function(e,t){Z[" "+e]||(K.test(e)?Z[" "+e]=e+"/":Z[" "+e]=J(e,"/",!0));const n=-1===(e=Z[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(Y,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(X,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const Z={},K=/^[^:]+:\/*[^/]*$/,Y=/^([^:]+:)[\s\S]*$/,X=/^([^:]+:\/*[^/]*)[\s\S]*$/;const G={exec:function(){}};function Q(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function J(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o<r;){const i=e.charAt(r-o-1);if(i!==t||n){if(i===t||!n)break;o++}else o++}return e.slice(0,r-o)}function ee(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function te(e,t,n,r){const o=t.href,i=t.title?q(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:i,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:i,text:q(s)}}class ne{constructor(e){this.options=e||N}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}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:J(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().replace(this.rules.inline._escapes,"$1"):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=J(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,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,o,i,s,a,l,c,u,d,p,h,f=t[1].trim();const m=f.length>1,g={type:"list",raw:"",ordered:m,start:m?+f.slice(0,-1):"",loose:!1,items:[]};f=m?`\\d{1,9}\\${f.slice(-1)}`:`\\${f}`,this.options.pedantic&&(f=m?f:"[*+-]");const b=new RegExp(`^( {0,3}${f})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(h=!1,t=b.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),c=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),u=e.split("\n",1)[0],this.options.pedantic?(i=2,p=c.trimLeft()):(i=t[2].search(/[^ ]/),i=i>4?1:i,p=c.slice(i),i+=t[1].length),a=!1,!c&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),h=!0),!h){const t=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),o=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),s=new RegExp(`^ {0,${Math.min(3,i-1)}}#`);for(;e&&(d=e.split("\n",1)[0],u=d,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!o.test(u))&&!s.test(u)&&!t.test(u)&&!r.test(e);){if(u.search(/[^ ]/)>=i||!u.trim())p+="\n"+u.slice(i);else{if(a)break;if(c.search(/[^ ]/)>=4)break;if(o.test(c))break;if(s.test(c))break;if(r.test(c))break;p+="\n"+u}a||u.trim()||(a=!0),n+=d+"\n",e=e.substring(d.length+1),c=u.slice(i)}}g.loose||(l?g.loose=!0:/\n *\n *$/.test(n)&&(l=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(o="[ ] "!==r[0],p=p.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!r,checked:o,loose:!1,text:p}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=p.trimRight(),g.raw=g.raw.trimRight();const y=g.items.length;for(s=0;s<y;s++)if(this.lexer.state.top=!1,g.items[s].tokens=this.lexer.blockTokens(g.items[s].text,[]),!g.loose){const e=g.items[s].tokens.filter((e=>"space"===e.type)),t=e.length>0&&e.some((e=>/\n.*\n/.test(e.raw)));g.loose=t}if(g.loose)for(s=0;s<y;s++)g.items[s].loose=!0;return g}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};if(this.options.sanitize){const n=this.options.sanitizer?this.options.sanitizer(t[0]):q(t[0]);e.type="paragraph",e.text=n,e.tokens=this.lexer.inline(n)}return e}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:Q(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,o,i,s=e.align.length;for(n=0;n<s;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(s=e.rows.length,n=0;n<s;n++)e.rows[n]=Q(e.rows[n],e.header.length).map((e=>({text:e})));for(s=e.header.length,r=0;r<s;r++)e.header[r].tokens=this.lexer.inline(e.header[r].text);for(s=e.rows.length,r=0;r<s;r++)for(i=e.rows[r],o=0;o<i.length;o++)i[o].tokens=this.lexer.inline(i[o].text);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:q(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):q(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=J(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,o=0;for(;o<n;o++)if("\\"===e[o])o++;else if(e[o]===t[0])r++;else if(e[o]===t[1]&&(r--,r<0))return o;return-1}(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(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),te(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}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){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return te(n,e,n[0],this.lexer)}}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)continue;if(i=o.length,r[3]||r[4]){s+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(s-=i,s>0)continue;i=Math.min(i,i+s+a);const t=e.slice(0,n+r.index+(r[0].length-o.length)+i);if(Math.min(n,i)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const l=t.slice(2,-2);return{type:"strong",raw:t,text:l,tokens:this.lexer.inlineTokens(l)}}}}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=q(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],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=q(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=q(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=q(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=q(n[0]),r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):q(n[0]):n[0]:q(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const 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}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:G,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};re.def=H(re.def).replace("label",re._label).replace("title",re._title).getRegex(),re.bullet=/(?:[*+-]|\d{1,9}[.)])/,re.listItemStart=H(/^( *)(bull) */).replace("bull",re.bullet).getRegex(),re.list=H(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=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,re.html=H(re.html,"i").replace("comment",re._comment).replace("tag",re._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),re.paragraph=H(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.blockquote=H(re.blockquote).replace("paragraph",re.paragraph).getRegex(),re.normal={...re},re.gfm={...re.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},re.gfm.table=H(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","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.gfm.paragraph=H(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",re.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.pedantic={...re.normal,html:H("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\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:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:G,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:H(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:G,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,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:G,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function ie(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function se(e){let t,n,r="";const o=e.length;for(t=0;t<o;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}oe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",oe.punctuation=H(oe.punctuation).replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,oe.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,oe._comment=H(re._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),oe.emStrong.lDelim=H(oe.emStrong.lDelim).replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimAst=H(oe.emStrong.rDelimAst,"g").replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimUnd=H(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=H(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=H(oe.tag).replace("comment",oe._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=H(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=H(oe.reflink).replace("label",oe._label).replace("ref",re._label).getRegex(),oe.nolink=H(oe.nolink).replace("ref",re._label).getRegex(),oe.reflinkSearch=H(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal={...oe},oe.pedantic={...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:H(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:H(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()},oe.gfm={...oe.normal,escape:H(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]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},oe.gfm.url=H(oe.gfm.url,"i").replace("email",oe.gfm._extended_email).getRegex(),oe.breaks={...oe.gfm,br:H(oe.br).replace("{2,}","*").getRegex(),text:H(oe.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class ae{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||N,this.options.tokenizer=this.options.tokenizer||new ne,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:re.normal,inline:oe.normal};this.options.pedantic?(t.block=re.pedantic,t.inline=oe.pedantic):this.options.gfm&&(t.block=re.gfm,this.options.breaks?t.inline=oe.breaks:t.inline=oe.gfm),this.tokenizer.rules=t}static get rules(){return{block:re,inline:oe}}static lex(e,t){return new ae(t).lex(e)}static lexInline(e,t){return new ae(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,o,i;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);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 this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,o,i,s,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,i.index)+"["+ee("a",i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,i.index)+"["+ee("a",i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,i.index+i[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(s||(a=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,se))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,se))){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({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o,ie))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);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(n.raw.length),t.push(n);return t}}let le=class{constructor(e){this.options=e||N}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?'<pre><code class="'+this.options.langPrefix+q(r)+'">'+(n?e:q(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:q(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e){return e}heading(e,t,n,r){if(this.options.headerIds){return`<h${t} id="${this.options.headerPrefix+r.slug(n)}">${e}</h${t}>\n`}return`<h${t}>${e}</h${t}>\n`}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){if(null===(e=V(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){if(null===(e=V(this.options.sanitize,this.options.baseUrl,e)))return n;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${t}"`),r+=this.options.xhtml?"/>":">",r}text(e){return e}};class ce{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""}}class ue{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)}}class de{constructor(e){this.options=e||N,this.options.renderer=this.options.renderer||new le,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ce,this.slugger=new ue}static parse(e,t){return new de(t).parse(e)}static parseInline(e,t){return new de(t).parseInline(e)}parse(e,t=!0){let n,r,o,i,s,a,l,c,u,d,p,h,f,m,g,b,y,w,v,x="";const k=e.length;for(n=0;n<k;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({parser:this},d),!1!==v||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(d.type)))x+=v||"";else switch(d.type){case"space":continue;case"hr":x+=this.renderer.hr();continue;case"heading":x+=this.renderer.heading(this.parseInline(d.tokens),d.depth,F(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":x+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(c="",l="",i=d.header.length,r=0;r<i;r++)l+=this.renderer.tablecell(this.parseInline(d.header[r].tokens),{header:!0,align:d.align[r]});for(c+=this.renderer.tablerow(l),u="",i=d.rows.length,r=0;r<i;r++){for(a=d.rows[r],l="",s=a.length,o=0;o<s;o++)l+=this.renderer.tablecell(this.parseInline(a[o].tokens),{header:!1,align:d.align[o]});u+=this.renderer.tablerow(l)}x+=this.renderer.table(c,u);continue;case"blockquote":u=this.parse(d.tokens),x+=this.renderer.blockquote(u);continue;case"list":for(p=d.ordered,h=d.start,f=d.loose,i=d.items.length,u="",r=0;r<i;r++)g=d.items[r],b=g.checked,y=g.task,m="",g.task&&(w=this.renderer.checkbox(b),f?g.tokens.length>0&&"paragraph"===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,f),u+=this.renderer.listitem(m,y,b);x+=this.renderer.list(u,p,h);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<k&&"text"===e[n+1].type;)d=e[++n],u+="\n"+(d.tokens?this.parseInline(d.tokens):d.text);x+=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 x}parseInline(e,t){t=t||this.renderer;let n,r,o,i="";const s=e.length;for(n=0;n<s;n++)if(r=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(o=this.options.extensions.renderers[r.type].call({parser:this},r),!1!==o||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)))i+=o||"";else switch(r.type){case"escape":case"text":i+=t.text(r.text);break;case"html":i+=t.html(r.text);break;case"link":i+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":i+=t.image(r.href,r.title,r.text);break;case"strong":i+=t.strong(this.parseInline(r.tokens,t));break;case"em":i+=t.em(this.parseInline(r.tokens,t));break;case"codespan":i+=t.codespan(r.text);break;case"br":i+=t.br();break;case"del":i+=t.del(this.parseInline(r.tokens,t));break;default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return i}}class pe{constructor(e){this.options=e||N}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(e){return e}postprocess(e){return e}}function he(e,t){return(n,r,o)=>{"function"==typeof r&&(o=r,r=null);const i={...r},s=function(e,t,n){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+q(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):n?void n(null,e):e}if(t)return Promise.reject(r);if(!n)throw r;n(r)}}((r={...fe.defaults,...i}).silent,r.async,o);if(null==n)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}(r),r.hooks&&(r.hooks.options=r),o){const i=r.highlight;let a;try{r.hooks&&(n=r.hooks.preprocess(n)),a=e(n,r)}catch(e){return s(e)}const l=function(e){let n;if(!e)try{r.walkTokens&&fe.walkTokens(a,r.walkTokens),n=t(a,r),r.hooks&&(n=r.hooks.postprocess(n))}catch(t){e=t}return r.highlight=i,e?s(e):o(null,n)};if(!i||i.length<3)return l();if(delete r.highlight,!a.length)return l();let c=0;return fe.walkTokens(a,(function(e){"code"===e.type&&(c++,setTimeout((()=>{i(e.text,e.lang,(function(t,n){if(t)return l(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),c--,0===c&&l()}))}),0))})),void(0===c&&l())}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then((t=>e(t,r))).then((e=>r.walkTokens?Promise.all(fe.walkTokens(e,r.walkTokens)).then((()=>e)):e)).then((e=>t(e,r))).then((e=>r.hooks?r.hooks.postprocess(e):e)).catch(s);try{r.hooks&&(n=r.hooks.preprocess(n));const o=e(n,r);r.walkTokens&&fe.walkTokens(o,r.walkTokens);let i=t(o,r);return r.hooks&&(i=r.hooks.postprocess(i)),i}catch(e){return s(e)}}}function fe(e,t,n){return he(ae.lex,de.parse)(e,t,n)}fe.options=fe.setOptions=function(e){var t;return fe.defaults={...fe.defaults,...e},t=fe.defaults,N=t,fe},fe.getDefaults=R,fe.defaults=N,fe.use=function(...e){const t=fe.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((e=>{const n={...e};if(n.async=fe.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),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'");t[e.level]?t[e.level].unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=fe.defaults.renderer||new le;for(const n in e.renderer){const r=t[n];t[n]=(...o)=>{let i=e.renderer[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.renderer=t}if(e.tokenizer){const t=fe.defaults.tokenizer||new ne;for(const n in e.tokenizer){const r=t[n];t[n]=(...o)=>{let i=e.tokenizer[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.tokenizer=t}if(e.hooks){const t=fe.defaults.hooks||new pe;for(const n in e.hooks){const r=t[n];pe.passThroughHooks.has(n)?t[n]=o=>{if(fe.defaults.async)return Promise.resolve(e.hooks[n].call(t,o)).then((e=>r.call(t,e)));const i=e.hooks[n].call(t,o);return r.call(t,i)}:t[n]=(...o)=>{let i=e.hooks[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.hooks=t}if(e.walkTokens){const t=fe.defaults.walkTokens;n.walkTokens=function(n){let r=[];return r.push(e.walkTokens.call(this,n)),t&&(r=r.concat(t.call(this,n))),r}}fe.setOptions(n)}))},fe.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(fe,r)),r.type){case"table":for(const e of r.header)n=n.concat(fe.walkTokens(e.tokens,t));for(const e of r.rows)for(const r of e)n=n.concat(fe.walkTokens(r.tokens,t));break;case"list":n=n.concat(fe.walkTokens(r.items,t));break;default:fe.defaults.extensions&&fe.defaults.extensions.childTokens&&fe.defaults.extensions.childTokens[r.type]?fe.defaults.extensions.childTokens[r.type].forEach((function(e){n=n.concat(fe.walkTokens(r[e],t))})):r.tokens&&(n=n.concat(fe.walkTokens(r.tokens,t)))}return n},fe.parseInline=he(ae.lexInline,de.parseInline),fe.Parser=de,fe.parser=de.parse,fe.Renderer=le,fe.TextRenderer=ce,fe.Lexer=ae,fe.lexer=ae.lex,fe.Tokenizer=ne,fe.Slugger=ue,fe.Hooks=pe,fe.parse=fe,fe.options,fe.setOptions,fe.use,fe.walkTokens,fe.parseInline;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var me,ge={};me={get exports(){return ge},set exports(e){ge=e}},function(e,t){me.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 be=ge,ye=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<o;){var l,c=e(n[r],1);t.insertBefore(c,i),s&&a&&c.selected&&(a=!a,l=t.selectedIndex,t.selectedIndex=l<0?r:d.call(t.querySelectorAll("option"),c)),r++}}function i(e,t){return e==t}function s(e){return e}function a(e,t,n,r,o,i,s){var a=i-o;if(a<1)return-1;for(;a<=n-t;){for(var l=t,c=o;l<n&&c<i&&s(e[l],r[c]);)l++,c++;if(c===i)return t;t=l+1}return-1}function l(e,t,n,r,o){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:o}function c(e,t,n,r){for(;n<r;)h(e(t[n++],-1))}var u=r.WeakSet,d=[].indexOf,p=function(e,t,n){for(var r=1,o=t;r<o;){var i=(r+o)/2>>>0;n<e[i]?o=i:r=1+i}return r},h=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function f(e,t,n,r){for(var u=(r=r||{}).compare||i,d=r.node||s,h=null==r.before?null:d(r.before,0),f=t.length,m=f,g=0,b=n.length,y=0;g<m&&y<b&&u(t[g],n[y]);)g++,y++;for(;g<m&&y<b&&u(t[m-1],n[b-1]);)m--,b--;var w=g===m,v=y===b;if(w&&v)return n;if(w&&y<b)return o(d,e,n,y,b,l(d,t,g,f,h)),n;if(v&&g<m)return c(d,t,g,m),n;var x=m-g,k=b-y,$=-1;if(x<k){if(-1<($=a(n,y,b,t,g,m,u)))return o(d,e,n,y,$,d(t[g],0)),o(d,e,n,$+x,b,l(d,t,m,f,h)),n}else if(k<x&&-1<($=a(t,g,m,n,y,b,u)))return c(d,t,g,$),c(d,t,$+k,m),n;return x<2||k<2?(o(d,e,n,y,b,d(t[g],0)),c(d,t,g,m)):x==k&&function(e,t,n,r,o,i){for(;r<o&&i(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,u)?o(d,e,n,y,b,l(d,t,m,f,h)):function(e,t,n,r,i,s,a,l,u,d,h,f,m){!function(e,t,n,r,i,s,a,l,u){for(var d=[],p=e.length,h=a,f=0;f<p;)switch(e[f++]){case 0:i++,h++;break;case 1:d.push(r[i]),o(t,n,r,i++,i,h<l?t(s[h],0):u);break;case-1:h++}for(f=0;f<p;)switch(e[f++]){case 0:a++;break;case-1:-1<d.indexOf(s[a])?a++:c(t,s,a++,a)}}(function(e,t,n,r,o,i,s){var a,l,c,u,d,p,h=n+i,f=[];e:for(b=0;b<=h;b++){if(50<b)return null;for(p=b-1,u=b?f[b-1]:[0,0],d=f[b]=[],a=-b;a<=b;a+=2){for(l=(c=a===-b||a!==b&&u[p+a-1]<u[p+a+1]?u[p+a+1]:u[p+a-1]+1)-a;c<i&&l<n&&s(r[o+c],e[t+l]);)c++,l++;if(c===i&&l===n)break e;d[b+a]=c}}for(var m=Array(b/2+h/2),g=m.length-1,b=f.length-1;0<=b;b--){for(;0<c&&0<l&&s(r[o+c-1],e[t+l-1]);)m[g--]=0,c--,l--;if(!b)break;p=b-1,u=b?f[b-1]:[0,0],(a=c-l)==-b||a!==b&&u[p+a-1]<u[p+a+1]?(l--,m[g--]=1):(c--,m[g--]=-1)}return m}(n,r,s,a,l,d,f)||function(e,t,n,r,o,i,s,a){var l=0,c=r<a?r:a,u=Array(c++),d=Array(c);d[0]=-1;for(var h=1;h<c;h++)d[h]=s;for(var f=o.slice(i,s),m=t;m<n;m++){var g,b=f.indexOf(e[m]);-1<b&&-1<(l=p(d,c,g=b+i))&&(d[l]=g,u[l]={newi:m,oldi:g,prev:u[l-1]})}for(l=--c,--s;d[l]>s;)--l;c=a+r-l;var y=Array(c),w=u[l];for(--n;w;){for(var v=w.newi,x=w.oldi;v<n;)y[--c]=1,--n;for(;x<s;)y[--c]=-1,--s;y[--c]=0,--n,--s,w=w.prev}for(;t<=n;)y[--c]=1,--n;for(;i<=s;)y[--c]=-1,--s;return y}(n,r,i,s,a,l,u,d),e,t,n,r,a,l,h,m)}(d,e,n,y,b,k,t,g,m,x,f,u,h),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,y={};try{y.Map=Map}catch(u){y.Map=function(){var e=0,t=[],n=[];return{delete:function(o){var i=r(o);return i&&(t.splice(e,1),n.splice(e,1)),i},forEach:function(e,r){t.forEach((function(t,o){e.call(r,n[o],t,this)}),this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(o,i){return n[r(o)?e:t.push(o)-1]=i,this}};function r(n){return-1<(e=t.indexOf(n))}}}var w=y.Map;function v(){return this}function x(e,t){var n="_"+e+"$";return{get:function(){return this[n]||k(this,n,t.call(this,e))},set:function(e){k(this,n,e)}}}var k=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(v.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var $,_,E,S,C,A,L={},T={},R=[],N=T.hasOwnProperty,z=0,D={attributes:L,define:function(e,t){e.indexOf("-")<0?(e in T||(z=R.push(e)),T[e]=t):L[e]=t},invoke:function(e,t){for(var n=0;n<z;n++){var r=R[n];if(N.call(e,r))return T[r](e[r],t)}}},P=Array.isArray||(_=($={}.toString).call([]),function(e){return $.call(e)===_}),j=(E=e,S="fragment",A="content"in I(C="template")?function(e){var t=I(C);return t.innerHTML=e,t.content}:function(e){var t,n=I(S),r=I(C);return O(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=I(S),n=I("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",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,H,W,U,V,Z,K=(M="appendChild",F="cloneNode",B="createTextNode",W=(H="importNode")in(q=e),(U=q.createDocumentFragment())[M](q[B]("g")),U[M](q[B]("")),(W?q[H](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<i;s++)r[M](e(o[s],n));return r}:W?q[H]:function(e,t){return e[F](!!t)}),Y="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},X="-"+Math.random().toFixed(6)+"%",G=!1;try{V=e.createElement("template"),Z="tabindex","content"in V&&(V.innerHTML="<p "+Z+'="'+X+'"></p>',V.content.childNodes[0].getAttribute(Z)==X)||(X="_dt: "+X.slice(1,-1)+";",G=!0)}catch(u){}var Q="\x3c!--"+X+"--\x3e",J=/^(?: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*)(['\"]?)"+Q+"\\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+"></"+t+">"}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 he(t,n,r,o){for(var i=t.childNodes,s=i.length,a=0;a<s;){var l=i[a];switch(l.nodeType){case 1:var c=o.concat(a);!function(t,n,r,o){for(var i,s=t.attributes,a=[],l=[],c=pe(s,r),u=c.length,d=0;d<u;){var p=c[d++],h=p.value===X;if(h||1<(i=p.value.split(Q)).length){var f=p.name;if(a.indexOf(f)<0){a.push(f);var m=r.shift().replace(h?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+f+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=s[m]||s[m.toLowerCase()];if(h)n.push(fe(g,o,m,null));else{for(var b=i.length-2;b--;)r.shift();n.push(fe(g,o,m,i))}}l.push(p)}}for(var y=((d=0)<(u=l.length)&&G&&!("ownerSVGElement"in t));d<u;){var w=l[d++];y&&(w.value=""),t.removeAttribute(w.name)}var v=t.nodeName;if(/^script$/i.test(v)){var x=e.createElement(v);for(u=s.length,d=0;d<u;)x.setAttributeNode(s[d++].cloneNode(!0));x.textContent=t.textContent,t.parentNode.replaceChild(x,t)}}(l,n,r,c),he(l,n,r,c);break;case 8:var u=l.textContent;if(u===X)r.shift(),n.push(J.test(t.nodeName)?me(t,o):{type:"any",node:l,path:o.concat(a)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"👻":t.removeChild(l),a--,s--}break;case 3:J.test(t.nodeName)&&Y.call(l.textContent)===Q&&(r.shift(),n.push(me(t,o)))}a++}}function fe(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function me(e,t){return{type:"text",node:e,path:t}}var ge,be=(ge=new n,{get:function(e){return ge.get(e)},set:function(e,t){return ge.set(e,t),t}});function ye(e,t){var n=(e.convert||function(e){return e.join(Q).replace(ae,de).replace(se,ce)})(t),r=e.transform;r&&(n=r(n));var o=j(n,e.type);ve(o);var i=[];return he(o,i,t.slice(0),[]),{content:o,updates:function(n){for(var r=[],o=i.length,s=0,a=0;s<o;){var l=i[s++],c=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,l.path);switch(l.type){case"any":r.push({fn:e.any(c,[]),sparse:!1});break;case"attr":var u=l.sparse,d=e.attribute(c,l.name,l.node);null===u?r.push({fn:d,sparse:!1}):(a+=u.length-2,r.push({fn:d,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(c),sparse:!1}),c.textContent=""}}return o+=a,function(){var e=arguments.length;if(o!==e-1)throw new Error(e-1+" values instead of "+o+"\n"+t.join("${value}"));for(var i=1,s=1;i<e;){var a=r[i-s];if(a.sparse){var l=a.values,c=l[0],u=1,d=l.length;for(s+=d-2;u<d;)c+=arguments[i++]+l[u++];a.fn(c)}else a.fn(arguments[i++])}return n}}}}var we=[];function ve(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===Y.call(r.textContent).length&&e.removeChild(r)}}var xe,ke,$e=(xe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,ke=/([^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),Ee(n,!0)}(e,t):Ee(e.style,!1)});function _e(e,t,n){return t+"-"+n.toLowerCase()}function Ee(e,t){var n,r;return function(o){var i,s,a,l;switch(typeof o){case"object":if(o){if("object"===n){if(!t&&r!==o)for(s in r)s in o||(e[s]="")}else t?e.value="":e.cssText="";for(s in i=t?{}:e,o)a="number"!=typeof(l=o[s])||xe.test(s)?l:l+"px",!t&&/^--/.test(s)?i.setProperty(s,a):i[s]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace(ke,_e),":",e[t],";");return n.join("")}(r=i):r=o;break}default:r!=o&&(n="string",r=o,t?e.value=o||"":e.cssText=o||"")}}}var Se,Ce,Ae=(Se=[].slice,(Ce=Le.prototype).ELEMENT_NODE=1,Ce.nodeType=111,Ce.remove=function(e){var t,n=this.childNodes,r=this.firstChild,o=this.lastChild;return this._=null,e&&2===n.length?o.parentNode.removeChild(o):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(o),t.deleteContents()),r},Ce.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,o=0,i=r.length;o<i;o++)t.appendChild(r[o]);return t},Le);function Le(e){var t=this.childNodes=Se.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Te(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Fe:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Me:return Re(e.render(),t);default:return e}}function Ne(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(Te).then(t):Promise.resolve(D.invoke(e,t)).then(t)}function ze(e){return null!=e&&"then"in e}var De,Pe,je,Oe,Ie,qe="ownerSVGElement",Me=v.prototype.nodeType,Fe=Ae.prototype.nodeType,Be=(Pe=(De={Event:b,WeakSet:u}).Event,je=De.WeakSet,Oe=!0,Ie=null,function(e){return Oe&&(Oe=!Oe,Ie=new je,function(e){var t=new je,n=new je;try{new MutationObserver(s).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,o=[],i=function(e){o.push(e),clearTimeout(r),r=setTimeout((function(){s(o.splice(r=0,o.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){i({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){i({addedNodes:[e.target],removedNodes:[]})}),!0)}function s(e){for(var r,o=e.length,i=0;i<o;i++)a((r=e[i]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var o,i=new Pe(t),s=e.length,a=0;a<s;1===(o=e[a++]).nodeType&&function e(t,n,r,o,i){Ie.has(t)&&!o.has(t)&&(i.delete(t),o.add(t),t.dispatchEvent(n));for(var s=t.children||[],a=s.length,l=0;l<a;e(s[l++],n,r,o,i));}(o,i,t,n,r));}}(e.ownerDocument)),Ie.add(e),e}),He=/^(?:form|list)$/i,We=[].slice;function Ue(t){return this.type=t,function(t){var n=we,r=ve;return function(o){var i,s,a;return n!==o&&(i=t,s=n=o,a=be.get(s)||be.set(s,ye(i,s)),r=a.updates(K.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ve=!(Ue.prototype={attribute:function(e,t,n){var r,o=qe in e;if("style"===t)return $e(e,n,o);if("."===t.slice(0,1))return c=e,u=t.slice(1),o?function(e){try{c[u]=e}catch(t){c.setAttribute(u,e)}}:function(e){c[u]=e};if("?"===t.slice(0,1))return s=e,a=t.slice(1),function(e){l!==!!e&&((l=!!e)?s.setAttribute(a,""):s.removeAttribute(a))};if(/^on/.test(t)){var i=t.slice(2);return"connected"===i||"disconnected"===i?Be(e):t.toLowerCase()in e&&(i=i.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(i,r,!1),(r=t)&&e.addEventListener(i,t,!1))}}if("data"===t||!o&&t in e&&!He.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in D.attributes)return function(n){var o=D.attributes[t](e,n);r!==o&&(null==(r=o)?e.removeAttribute(t):e.setAttribute(t,o))};var s,a,l,c,u,d=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(d&&(d=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,d||(d=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:Re,before:e},o=qe in e?"svg":"html",i=!1;return function s(a){switch(typeof a){case"string":case"number":case"boolean":i?n!==a&&(n=a,t[0].textContent=a):(i=!0,n=a,t=f(e.parentNode,t,[(l=a,e.ownerDocument.createTextNode(l))],r));break;case"function":s(a(e));break;case"object":case"undefined":if(null==a){i=!1,t=f(e.parentNode,t,[],r);break}default:if(i=!1,P(n=a))if(0===a.length)t.length&&(t=f(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":s({html:a});break;case"object":if(P(a[0])&&(a=a.concat.apply([],a)),ze(a[0])){Promise.all(a).then(s);break}default:t=f(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=f(e.parentNode,t,11===a.nodeType?We.call(a.childNodes):[a],r):ze(a)?a.then(s):"placeholder"in a?Ne(a,s):"text"in a?s(String(a.text)):"any"in a?s(a.any):"html"in a?t=f(e.parentNode,t,We.call(j([].concat(a.html).join(""),o).childNodes),r):s("length"in a?We.call(a):D.invoke(a,s))}var l}},text:function(e){var t;return function n(r){var o;t!==r&&("object"==(o=typeof(t=r))&&r?ze(r)?r.then(n):"placeholder"in r?Ne(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?We.call(r).join(""):D.invoke(r,n)):"function"==o?n(r(e)):e.textContent=null==r?"":r)}}}),Ze=function(t){var r,o,i,s,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),l=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||l?(o={},i=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return o[t]||(o[t]=e)},Ze=l?i:(s=new n,function(e){return s.get(e)||(n=i(t=e),s.set(t,n),n);var t,n})):Ve=!0,Ke(t)};function Ke(e){return Ve?e:Ze(e)}function Ye(e){for(var t=arguments.length,n=[Ke(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Xe=new n,Ge=function(e){var t,n,r;return function(){var o=Ye.apply(null,arguments);return r!==o[0]?(r=o[0],n=new Ue(e),t=Je(n.apply(n,o))):n.apply(n,o),t}},Qe=function(e,t){var n=t.indexOf(":"),r=Xe.get(e),o=t;return-1<n&&(o=t.slice(n+1),t=t.slice(0,n)||"html"),r||Xe.set(e,r={}),r[o]||(r[o]=Ge(t))},Je=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Ae(t):e},et=new n;function tt(){var e=et.get(this),t=Ye.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ue(qe in this?"svg":"html");et.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var nt,rt,ot,it,st=D.define,at=Ue.prototype;function lt(e){return arguments.length<2?null==e?Ge("html"):"string"==typeof e?lt.wire(null,e):"raw"in e?Ge("html")(e):"nodeType"in e?lt.bind(e):Qe(e,"html"):("raw"in e?Ge("html"):lt.wire).apply(null,arguments)}return lt.Component=v,lt.bind=function(e){return tt.bind(e)},lt.define=st,lt.diff=f,(lt.hyper=lt).observe=Be,lt.tagger=at,lt.wire=function(e,t){return null==e?Ge(t||"html"):Qe(e,t||"html")},lt._={WeakMap:n,WeakSet:u},nt=Ge,rt=new n,ot=Object.create,it=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(v,{for:{configurable:!0,value:function(e,t){return function(e,t,r,o){var i,s,a,l=t.get(e)||it(e,t);switch(typeof o){case"object":case"function":var c=l.w||(l.w=new n);return c.get(o)||(i=c,s=o,a=new e(r),i.set(s,a),a);default:var u=l.p||(l.p=ot(null));return u[o]||(u[o]=new e(r))}}(this,rt.get(e)||(r=e,o=new w,rt.set(r,o),o),e,null==t?"default":t);var r,o}}}),Object.defineProperties(v.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:x("html",nt),svg:x("svg",nt),state:x("state",(function(){return this.defaultState})),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new b(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 o in r)n[o]=r[o];return!1!==t&&this.render(),this}}}),lt}(document); +window.respecVersion="33.0.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=new EventTarget;function r(e,t){if(n.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const r=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:r},window.parent.location.origin)}function o(e,t,r={once:!1}){n.addEventListener(e,(e=>t(e.detail)),r)}t("core/pubsubhub",{sub:o});const i=["githubToken","githubUser"];const s=document.documentElement;s&&!s.hasAttribute("lang")&&(s.lang="en",s.hasAttribute("dir")||(s.dir="ltr"));const a={},l=s.lang;var c=Object.freeze({__proto__:null,l10n:a,lang:l,name:"core/l10n",run:function(e){e.l10n=a[l]||a.en}});let u,d;const p=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,g=new WeakMap;let b={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return h.get(e);if("objectStoreNames"===t)return e.objectStoreNames||f.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return v(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function y(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(d||(d=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(x(this),t),v(p.get(this))}:function(...t){return v(e.apply(x(this),t))}:function(t,...n){const r=e.call(x(this),t,...n);return f.set(r,t.sort?t.sort():[t]),v(r)}}function w(e){return"function"==typeof e?y(e):(e instanceof IDBTransaction&&function(e){if(h.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)}));h.set(e,t)}(e),t=e,(u||(u=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,b):e);var t}function v(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(v(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",i)}));return t.then((t=>{t instanceof IDBCursor&&p.set(t,e)})).catch((()=>{})),g.set(t,e),t}(e);if(m.has(e))return m.get(e);const t=w(e);return t!==e&&(m.set(e,t),g.set(t,e)),t}const x=e=>g.get(e);const k=["get","getKey","getAll","getAllKeys","count"],$=["put","add","delete","clear"],_=new Map;function E(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(_.get(t))return _.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=$.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!k.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 _.set(t,i),i}b=(e=>({...e,get:(t,n,r)=>E(t,n)||e.get(t,n,r),has:(t,n)=>!!E(t,n)||e.has(t,n)}))(b);var S=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),v(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:i}={}){const s=indexedDB.open(e,t),a=v(s);return r&&s.addEventListener("upgradeneeded",(e=>{r(v(s.result),e.oldVersion,e.newVersion,v(s.transaction),e)})),n&&s.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{i&&e.addEventListener("close",(()=>i())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:x,wrap:v});const C=/^[!#$%&'*+-.^`|~\w]+$/,A=/[\u000A\u000D\u0009\u0020]/u,L=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function T(e,t,n){(t&&""!==t&&!e.has(t)&&L.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function R(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let N={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const z=/[&<>"']/,D=new RegExp(z.source,"g"),P=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,j=new RegExp(P.source,"g"),O={"&":"&","<":"<",">":">",'"':""","'":"'"},I=e=>O[e];function q(e,t){if(t){if(z.test(e))return e.replace(D,I)}else if(P.test(e))return e.replace(j,I);return e}const M=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function F(e){return e.replace(M,((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 B=/(^|[^\[])\^/g;function H(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(B,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const W=/[^\w:]/g,U=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function V(e,t,n){if(e){let e;try{e=decodeURIComponent(F(n)).replace(W,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!U.test(n)&&(n=function(e,t){Z[" "+e]||(K.test(e)?Z[" "+e]=e+"/":Z[" "+e]=J(e,"/",!0));const n=-1===(e=Z[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(Y,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(X,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const Z={},K=/^[^:]+:\/*[^/]*$/,Y=/^([^:]+:)[\s\S]*$/,X=/^([^:]+:\/*[^/]*)[\s\S]*$/;const G={exec:function(){}};function Q(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function J(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o<r;){const i=e.charAt(r-o-1);if(i!==t||n){if(i===t||!n)break;o++}else o++}return e.slice(0,r-o)}function ee(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function te(e,t,n,r){const o=t.href,i=t.title?q(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:i,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:i,text:q(s)}}class ne{constructor(e){this.options=e||N}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}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:J(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().replace(this.rules.inline._escapes,"$1"):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=J(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,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,o,i,s,a,l,c,u,d,p,h,f=t[1].trim();const m=f.length>1,g={type:"list",raw:"",ordered:m,start:m?+f.slice(0,-1):"",loose:!1,items:[]};f=m?`\\d{1,9}\\${f.slice(-1)}`:`\\${f}`,this.options.pedantic&&(f=m?f:"[*+-]");const b=new RegExp(`^( {0,3}${f})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(h=!1,t=b.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),c=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),u=e.split("\n",1)[0],this.options.pedantic?(i=2,p=c.trimLeft()):(i=t[2].search(/[^ ]/),i=i>4?1:i,p=c.slice(i),i+=t[1].length),a=!1,!c&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),h=!0),!h){const t=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),o=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),s=new RegExp(`^ {0,${Math.min(3,i-1)}}#`);for(;e&&(d=e.split("\n",1)[0],u=d,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!o.test(u))&&!s.test(u)&&!t.test(u)&&!r.test(e);){if(u.search(/[^ ]/)>=i||!u.trim())p+="\n"+u.slice(i);else{if(a)break;if(c.search(/[^ ]/)>=4)break;if(o.test(c))break;if(s.test(c))break;if(r.test(c))break;p+="\n"+u}a||u.trim()||(a=!0),n+=d+"\n",e=e.substring(d.length+1),c=u.slice(i)}}g.loose||(l?g.loose=!0:/\n *\n *$/.test(n)&&(l=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(o="[ ] "!==r[0],p=p.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!r,checked:o,loose:!1,text:p}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=p.trimRight(),g.raw=g.raw.trimRight();const y=g.items.length;for(s=0;s<y;s++)if(this.lexer.state.top=!1,g.items[s].tokens=this.lexer.blockTokens(g.items[s].text,[]),!g.loose){const e=g.items[s].tokens.filter((e=>"space"===e.type)),t=e.length>0&&e.some((e=>/\n.*\n/.test(e.raw)));g.loose=t}if(g.loose)for(s=0;s<y;s++)g.items[s].loose=!0;return g}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};if(this.options.sanitize){const n=this.options.sanitizer?this.options.sanitizer(t[0]):q(t[0]);e.type="paragraph",e.text=n,e.tokens=this.lexer.inline(n)}return e}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:Q(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,o,i,s=e.align.length;for(n=0;n<s;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(s=e.rows.length,n=0;n<s;n++)e.rows[n]=Q(e.rows[n],e.header.length).map((e=>({text:e})));for(s=e.header.length,r=0;r<s;r++)e.header[r].tokens=this.lexer.inline(e.header[r].text);for(s=e.rows.length,r=0;r<s;r++)for(i=e.rows[r],o=0;o<i.length;o++)i[o].tokens=this.lexer.inline(i[o].text);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:q(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):q(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=J(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,o=0;for(;o<n;o++)if("\\"===e[o])o++;else if(e[o]===t[0])r++;else if(e[o]===t[1]&&(r--,r<0))return o;return-1}(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(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),te(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}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){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return te(n,e,n[0],this.lexer)}}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)continue;if(i=o.length,r[3]||r[4]){s+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(s-=i,s>0)continue;i=Math.min(i,i+s+a);const t=e.slice(0,n+r.index+(r[0].length-o.length)+i);if(Math.min(n,i)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const l=t.slice(2,-2);return{type:"strong",raw:t,text:l,tokens:this.lexer.inlineTokens(l)}}}}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=q(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],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=q(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=q(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=q(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=q(n[0]),r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):q(n[0]):n[0]:q(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const 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}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:G,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};re.def=H(re.def).replace("label",re._label).replace("title",re._title).getRegex(),re.bullet=/(?:[*+-]|\d{1,9}[.)])/,re.listItemStart=H(/^( *)(bull) */).replace("bull",re.bullet).getRegex(),re.list=H(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=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,re.html=H(re.html,"i").replace("comment",re._comment).replace("tag",re._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),re.paragraph=H(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.blockquote=H(re.blockquote).replace("paragraph",re.paragraph).getRegex(),re.normal={...re},re.gfm={...re.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},re.gfm.table=H(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","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.gfm.paragraph=H(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",re.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.pedantic={...re.normal,html:H("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\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:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:G,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:H(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:G,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,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:G,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function ie(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function se(e){let t,n,r="";const o=e.length;for(t=0;t<o;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}oe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",oe.punctuation=H(oe.punctuation).replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,oe.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,oe._comment=H(re._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),oe.emStrong.lDelim=H(oe.emStrong.lDelim).replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimAst=H(oe.emStrong.rDelimAst,"g").replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimUnd=H(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=H(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=H(oe.tag).replace("comment",oe._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=H(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=H(oe.reflink).replace("label",oe._label).replace("ref",re._label).getRegex(),oe.nolink=H(oe.nolink).replace("ref",re._label).getRegex(),oe.reflinkSearch=H(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal={...oe},oe.pedantic={...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:H(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:H(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()},oe.gfm={...oe.normal,escape:H(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]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},oe.gfm.url=H(oe.gfm.url,"i").replace("email",oe.gfm._extended_email).getRegex(),oe.breaks={...oe.gfm,br:H(oe.br).replace("{2,}","*").getRegex(),text:H(oe.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class ae{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||N,this.options.tokenizer=this.options.tokenizer||new ne,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:re.normal,inline:oe.normal};this.options.pedantic?(t.block=re.pedantic,t.inline=oe.pedantic):this.options.gfm&&(t.block=re.gfm,this.options.breaks?t.inline=oe.breaks:t.inline=oe.gfm),this.tokenizer.rules=t}static get rules(){return{block:re,inline:oe}}static lex(e,t){return new ae(t).lex(e)}static lexInline(e,t){return new ae(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,o,i;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);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 this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,o,i,s,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,i.index)+"["+ee("a",i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,i.index)+"["+ee("a",i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,i.index+i[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(s||(a=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,se))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,se))){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({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o,ie))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);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(n.raw.length),t.push(n);return t}}let le=class{constructor(e){this.options=e||N}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?'<pre><code class="'+this.options.langPrefix+q(r)+'">'+(n?e:q(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:q(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e){return e}heading(e,t,n,r){if(this.options.headerIds){return`<h${t} id="${this.options.headerPrefix+r.slug(n)}">${e}</h${t}>\n`}return`<h${t}>${e}</h${t}>\n`}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){if(null===(e=V(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){if(null===(e=V(this.options.sanitize,this.options.baseUrl,e)))return n;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${t}"`),r+=this.options.xhtml?"/>":">",r}text(e){return e}};class ce{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""}}class ue{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)}}class de{constructor(e){this.options=e||N,this.options.renderer=this.options.renderer||new le,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ce,this.slugger=new ue}static parse(e,t){return new de(t).parse(e)}static parseInline(e,t){return new de(t).parseInline(e)}parse(e,t=!0){let n,r,o,i,s,a,l,c,u,d,p,h,f,m,g,b,y,w,v,x="";const k=e.length;for(n=0;n<k;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({parser:this},d),!1!==v||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(d.type)))x+=v||"";else switch(d.type){case"space":continue;case"hr":x+=this.renderer.hr();continue;case"heading":x+=this.renderer.heading(this.parseInline(d.tokens),d.depth,F(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":x+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(c="",l="",i=d.header.length,r=0;r<i;r++)l+=this.renderer.tablecell(this.parseInline(d.header[r].tokens),{header:!0,align:d.align[r]});for(c+=this.renderer.tablerow(l),u="",i=d.rows.length,r=0;r<i;r++){for(a=d.rows[r],l="",s=a.length,o=0;o<s;o++)l+=this.renderer.tablecell(this.parseInline(a[o].tokens),{header:!1,align:d.align[o]});u+=this.renderer.tablerow(l)}x+=this.renderer.table(c,u);continue;case"blockquote":u=this.parse(d.tokens),x+=this.renderer.blockquote(u);continue;case"list":for(p=d.ordered,h=d.start,f=d.loose,i=d.items.length,u="",r=0;r<i;r++)g=d.items[r],b=g.checked,y=g.task,m="",g.task&&(w=this.renderer.checkbox(b),f?g.tokens.length>0&&"paragraph"===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,f),u+=this.renderer.listitem(m,y,b);x+=this.renderer.list(u,p,h);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<k&&"text"===e[n+1].type;)d=e[++n],u+="\n"+(d.tokens?this.parseInline(d.tokens):d.text);x+=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 x}parseInline(e,t){t=t||this.renderer;let n,r,o,i="";const s=e.length;for(n=0;n<s;n++)if(r=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(o=this.options.extensions.renderers[r.type].call({parser:this},r),!1!==o||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)))i+=o||"";else switch(r.type){case"escape":case"text":i+=t.text(r.text);break;case"html":i+=t.html(r.text);break;case"link":i+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":i+=t.image(r.href,r.title,r.text);break;case"strong":i+=t.strong(this.parseInline(r.tokens,t));break;case"em":i+=t.em(this.parseInline(r.tokens,t));break;case"codespan":i+=t.codespan(r.text);break;case"br":i+=t.br();break;case"del":i+=t.del(this.parseInline(r.tokens,t));break;default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return i}}class pe{constructor(e){this.options=e||N}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(e){return e}postprocess(e){return e}}function he(e,t){return(n,r,o)=>{"function"==typeof r&&(o=r,r=null);const i={...r},s=function(e,t,n){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+q(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):n?void n(null,e):e}if(t)return Promise.reject(r);if(!n)throw r;n(r)}}((r={...fe.defaults,...i}).silent,r.async,o);if(null==n)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}(r),r.hooks&&(r.hooks.options=r),o){const i=r.highlight;let a;try{r.hooks&&(n=r.hooks.preprocess(n)),a=e(n,r)}catch(e){return s(e)}const l=function(e){let n;if(!e)try{r.walkTokens&&fe.walkTokens(a,r.walkTokens),n=t(a,r),r.hooks&&(n=r.hooks.postprocess(n))}catch(t){e=t}return r.highlight=i,e?s(e):o(null,n)};if(!i||i.length<3)return l();if(delete r.highlight,!a.length)return l();let c=0;return fe.walkTokens(a,(function(e){"code"===e.type&&(c++,setTimeout((()=>{i(e.text,e.lang,(function(t,n){if(t)return l(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),c--,0===c&&l()}))}),0))})),void(0===c&&l())}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then((t=>e(t,r))).then((e=>r.walkTokens?Promise.all(fe.walkTokens(e,r.walkTokens)).then((()=>e)):e)).then((e=>t(e,r))).then((e=>r.hooks?r.hooks.postprocess(e):e)).catch(s);try{r.hooks&&(n=r.hooks.preprocess(n));const o=e(n,r);r.walkTokens&&fe.walkTokens(o,r.walkTokens);let i=t(o,r);return r.hooks&&(i=r.hooks.postprocess(i)),i}catch(e){return s(e)}}}function fe(e,t,n){return he(ae.lex,de.parse)(e,t,n)}fe.options=fe.setOptions=function(e){var t;return fe.defaults={...fe.defaults,...e},t=fe.defaults,N=t,fe},fe.getDefaults=R,fe.defaults=N,fe.use=function(...e){const t=fe.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((e=>{const n={...e};if(n.async=fe.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),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'");t[e.level]?t[e.level].unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=fe.defaults.renderer||new le;for(const n in e.renderer){const r=t[n];t[n]=(...o)=>{let i=e.renderer[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.renderer=t}if(e.tokenizer){const t=fe.defaults.tokenizer||new ne;for(const n in e.tokenizer){const r=t[n];t[n]=(...o)=>{let i=e.tokenizer[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.tokenizer=t}if(e.hooks){const t=fe.defaults.hooks||new pe;for(const n in e.hooks){const r=t[n];pe.passThroughHooks.has(n)?t[n]=o=>{if(fe.defaults.async)return Promise.resolve(e.hooks[n].call(t,o)).then((e=>r.call(t,e)));const i=e.hooks[n].call(t,o);return r.call(t,i)}:t[n]=(...o)=>{let i=e.hooks[n].apply(t,o);return!1===i&&(i=r.apply(t,o)),i}}n.hooks=t}if(e.walkTokens){const t=fe.defaults.walkTokens;n.walkTokens=function(n){let r=[];return r.push(e.walkTokens.call(this,n)),t&&(r=r.concat(t.call(this,n))),r}}fe.setOptions(n)}))},fe.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(fe,r)),r.type){case"table":for(const e of r.header)n=n.concat(fe.walkTokens(e.tokens,t));for(const e of r.rows)for(const r of e)n=n.concat(fe.walkTokens(r.tokens,t));break;case"list":n=n.concat(fe.walkTokens(r.items,t));break;default:fe.defaults.extensions&&fe.defaults.extensions.childTokens&&fe.defaults.extensions.childTokens[r.type]?fe.defaults.extensions.childTokens[r.type].forEach((function(e){n=n.concat(fe.walkTokens(r[e],t))})):r.tokens&&(n=n.concat(fe.walkTokens(r.tokens,t)))}return n},fe.parseInline=he(ae.lexInline,de.parseInline),fe.Parser=de,fe.parser=de.parse,fe.Renderer=le,fe.TextRenderer=ce,fe.Lexer=ae,fe.lexer=ae.lex,fe.Tokenizer=ne,fe.Slugger=ue,fe.Hooks=pe,fe.parse=fe,fe.options,fe.setOptions,fe.use,fe.walkTokens,fe.parseInline;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var me,ge={};me={get exports(){return ge},set exports(e){ge=e}},function(e,t){me.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 be=ge,ye=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<o;){var l,c=e(n[r],1);t.insertBefore(c,i),s&&a&&c.selected&&(a=!a,l=t.selectedIndex,t.selectedIndex=l<0?r:d.call(t.querySelectorAll("option"),c)),r++}}function i(e,t){return e==t}function s(e){return e}function a(e,t,n,r,o,i,s){var a=i-o;if(a<1)return-1;for(;a<=n-t;){for(var l=t,c=o;l<n&&c<i&&s(e[l],r[c]);)l++,c++;if(c===i)return t;t=l+1}return-1}function l(e,t,n,r,o){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:o}function c(e,t,n,r){for(;n<r;)h(e(t[n++],-1))}var u=r.WeakSet,d=[].indexOf,p=function(e,t,n){for(var r=1,o=t;r<o;){var i=(r+o)/2>>>0;n<e[i]?o=i:r=1+i}return r},h=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function f(e,t,n,r){for(var u=(r=r||{}).compare||i,d=r.node||s,h=null==r.before?null:d(r.before,0),f=t.length,m=f,g=0,b=n.length,y=0;g<m&&y<b&&u(t[g],n[y]);)g++,y++;for(;g<m&&y<b&&u(t[m-1],n[b-1]);)m--,b--;var w=g===m,v=y===b;if(w&&v)return n;if(w&&y<b)return o(d,e,n,y,b,l(d,t,g,f,h)),n;if(v&&g<m)return c(d,t,g,m),n;var x=m-g,k=b-y,$=-1;if(x<k){if(-1<($=a(n,y,b,t,g,m,u)))return o(d,e,n,y,$,d(t[g],0)),o(d,e,n,$+x,b,l(d,t,m,f,h)),n}else if(k<x&&-1<($=a(t,g,m,n,y,b,u)))return c(d,t,g,$),c(d,t,$+k,m),n;return x<2||k<2?(o(d,e,n,y,b,d(t[g],0)),c(d,t,g,m)):x==k&&function(e,t,n,r,o,i){for(;r<o&&i(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,u)?o(d,e,n,y,b,l(d,t,m,f,h)):function(e,t,n,r,i,s,a,l,u,d,h,f,m){!function(e,t,n,r,i,s,a,l,u){for(var d=[],p=e.length,h=a,f=0;f<p;)switch(e[f++]){case 0:i++,h++;break;case 1:d.push(r[i]),o(t,n,r,i++,i,h<l?t(s[h],0):u);break;case-1:h++}for(f=0;f<p;)switch(e[f++]){case 0:a++;break;case-1:-1<d.indexOf(s[a])?a++:c(t,s,a++,a)}}(function(e,t,n,r,o,i,s){var a,l,c,u,d,p,h=n+i,f=[];e:for(b=0;b<=h;b++){if(50<b)return null;for(p=b-1,u=b?f[b-1]:[0,0],d=f[b]=[],a=-b;a<=b;a+=2){for(l=(c=a===-b||a!==b&&u[p+a-1]<u[p+a+1]?u[p+a+1]:u[p+a-1]+1)-a;c<i&&l<n&&s(r[o+c],e[t+l]);)c++,l++;if(c===i&&l===n)break e;d[b+a]=c}}for(var m=Array(b/2+h/2),g=m.length-1,b=f.length-1;0<=b;b--){for(;0<c&&0<l&&s(r[o+c-1],e[t+l-1]);)m[g--]=0,c--,l--;if(!b)break;p=b-1,u=b?f[b-1]:[0,0],(a=c-l)==-b||a!==b&&u[p+a-1]<u[p+a+1]?(l--,m[g--]=1):(c--,m[g--]=-1)}return m}(n,r,s,a,l,d,f)||function(e,t,n,r,o,i,s,a){var l=0,c=r<a?r:a,u=Array(c++),d=Array(c);d[0]=-1;for(var h=1;h<c;h++)d[h]=s;for(var f=o.slice(i,s),m=t;m<n;m++){var g,b=f.indexOf(e[m]);-1<b&&-1<(l=p(d,c,g=b+i))&&(d[l]=g,u[l]={newi:m,oldi:g,prev:u[l-1]})}for(l=--c,--s;d[l]>s;)--l;c=a+r-l;var y=Array(c),w=u[l];for(--n;w;){for(var v=w.newi,x=w.oldi;v<n;)y[--c]=1,--n;for(;x<s;)y[--c]=-1,--s;y[--c]=0,--n,--s,w=w.prev}for(;t<=n;)y[--c]=1,--n;for(;i<=s;)y[--c]=-1,--s;return y}(n,r,i,s,a,l,u,d),e,t,n,r,a,l,h,m)}(d,e,n,y,b,k,t,g,m,x,f,u,h),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,y={};try{y.Map=Map}catch(u){y.Map=function(){var e=0,t=[],n=[];return{delete:function(o){var i=r(o);return i&&(t.splice(e,1),n.splice(e,1)),i},forEach:function(e,r){t.forEach((function(t,o){e.call(r,n[o],t,this)}),this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(o,i){return n[r(o)?e:t.push(o)-1]=i,this}};function r(n){return-1<(e=t.indexOf(n))}}}var w=y.Map;function v(){return this}function x(e,t){var n="_"+e+"$";return{get:function(){return this[n]||k(this,n,t.call(this,e))},set:function(e){k(this,n,e)}}}var k=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(v.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var $,_,E,S,C,A,L={},T={},R=[],N=T.hasOwnProperty,z=0,D={attributes:L,define:function(e,t){e.indexOf("-")<0?(e in T||(z=R.push(e)),T[e]=t):L[e]=t},invoke:function(e,t){for(var n=0;n<z;n++){var r=R[n];if(N.call(e,r))return T[r](e[r],t)}}},P=Array.isArray||(_=($={}.toString).call([]),function(e){return $.call(e)===_}),j=(E=e,S="fragment",A="content"in I(C="template")?function(e){var t=I(C);return t.innerHTML=e,t.content}:function(e){var t,n=I(S),r=I(C);return O(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=I(S),n=I("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",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,H,W,U,V,Z,K=(M="appendChild",F="cloneNode",B="createTextNode",W=(H="importNode")in(q=e),(U=q.createDocumentFragment())[M](q[B]("g")),U[M](q[B]("")),(W?q[H](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<i;s++)r[M](e(o[s],n));return r}:W?q[H]:function(e,t){return e[F](!!t)}),Y="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},X="-"+Math.random().toFixed(6)+"%",G=!1;try{V=e.createElement("template"),Z="tabindex","content"in V&&(V.innerHTML="<p "+Z+'="'+X+'"></p>',V.content.childNodes[0].getAttribute(Z)==X)||(X="_dt: "+X.slice(1,-1)+";",G=!0)}catch(u){}var Q="\x3c!--"+X+"--\x3e",J=/^(?: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*)(['\"]?)"+Q+"\\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+"></"+t+">"}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 he(t,n,r,o){for(var i=t.childNodes,s=i.length,a=0;a<s;){var l=i[a];switch(l.nodeType){case 1:var c=o.concat(a);!function(t,n,r,o){for(var i,s=t.attributes,a=[],l=[],c=pe(s,r),u=c.length,d=0;d<u;){var p=c[d++],h=p.value===X;if(h||1<(i=p.value.split(Q)).length){var f=p.name;if(a.indexOf(f)<0){a.push(f);var m=r.shift().replace(h?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+f+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=s[m]||s[m.toLowerCase()];if(h)n.push(fe(g,o,m,null));else{for(var b=i.length-2;b--;)r.shift();n.push(fe(g,o,m,i))}}l.push(p)}}for(var y=((d=0)<(u=l.length)&&G&&!("ownerSVGElement"in t));d<u;){var w=l[d++];y&&(w.value=""),t.removeAttribute(w.name)}var v=t.nodeName;if(/^script$/i.test(v)){var x=e.createElement(v);for(u=s.length,d=0;d<u;)x.setAttributeNode(s[d++].cloneNode(!0));x.textContent=t.textContent,t.parentNode.replaceChild(x,t)}}(l,n,r,c),he(l,n,r,c);break;case 8:var u=l.textContent;if(u===X)r.shift(),n.push(J.test(t.nodeName)?me(t,o):{type:"any",node:l,path:o.concat(a)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"👻":t.removeChild(l),a--,s--}break;case 3:J.test(t.nodeName)&&Y.call(l.textContent)===Q&&(r.shift(),n.push(me(t,o)))}a++}}function fe(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function me(e,t){return{type:"text",node:e,path:t}}var ge,be=(ge=new n,{get:function(e){return ge.get(e)},set:function(e,t){return ge.set(e,t),t}});function ye(e,t){var n=(e.convert||function(e){return e.join(Q).replace(ae,de).replace(se,ce)})(t),r=e.transform;r&&(n=r(n));var o=j(n,e.type);ve(o);var i=[];return he(o,i,t.slice(0),[]),{content:o,updates:function(n){for(var r=[],o=i.length,s=0,a=0;s<o;){var l=i[s++],c=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,l.path);switch(l.type){case"any":r.push({fn:e.any(c,[]),sparse:!1});break;case"attr":var u=l.sparse,d=e.attribute(c,l.name,l.node);null===u?r.push({fn:d,sparse:!1}):(a+=u.length-2,r.push({fn:d,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(c),sparse:!1}),c.textContent=""}}return o+=a,function(){var e=arguments.length;if(o!==e-1)throw new Error(e-1+" values instead of "+o+"\n"+t.join("${value}"));for(var i=1,s=1;i<e;){var a=r[i-s];if(a.sparse){var l=a.values,c=l[0],u=1,d=l.length;for(s+=d-2;u<d;)c+=arguments[i++]+l[u++];a.fn(c)}else a.fn(arguments[i++])}return n}}}}var we=[];function ve(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===Y.call(r.textContent).length&&e.removeChild(r)}}var xe,ke,$e=(xe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,ke=/([^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),Ee(n,!0)}(e,t):Ee(e.style,!1)});function _e(e,t,n){return t+"-"+n.toLowerCase()}function Ee(e,t){var n,r;return function(o){var i,s,a,l;switch(typeof o){case"object":if(o){if("object"===n){if(!t&&r!==o)for(s in r)s in o||(e[s]="")}else t?e.value="":e.cssText="";for(s in i=t?{}:e,o)a="number"!=typeof(l=o[s])||xe.test(s)?l:l+"px",!t&&/^--/.test(s)?i.setProperty(s,a):i[s]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace(ke,_e),":",e[t],";");return n.join("")}(r=i):r=o;break}default:r!=o&&(n="string",r=o,t?e.value=o||"":e.cssText=o||"")}}}var Se,Ce,Ae=(Se=[].slice,(Ce=Le.prototype).ELEMENT_NODE=1,Ce.nodeType=111,Ce.remove=function(e){var t,n=this.childNodes,r=this.firstChild,o=this.lastChild;return this._=null,e&&2===n.length?o.parentNode.removeChild(o):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(o),t.deleteContents()),r},Ce.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,o=0,i=r.length;o<i;o++)t.appendChild(r[o]);return t},Le);function Le(e){var t=this.childNodes=Se.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Te(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Fe:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Me:return Re(e.render(),t);default:return e}}function Ne(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(Te).then(t):Promise.resolve(D.invoke(e,t)).then(t)}function ze(e){return null!=e&&"then"in e}var De,Pe,je,Oe,Ie,qe="ownerSVGElement",Me=v.prototype.nodeType,Fe=Ae.prototype.nodeType,Be=(Pe=(De={Event:b,WeakSet:u}).Event,je=De.WeakSet,Oe=!0,Ie=null,function(e){return Oe&&(Oe=!Oe,Ie=new je,function(e){var t=new je,n=new je;try{new MutationObserver(s).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,o=[],i=function(e){o.push(e),clearTimeout(r),r=setTimeout((function(){s(o.splice(r=0,o.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){i({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){i({addedNodes:[e.target],removedNodes:[]})}),!0)}function s(e){for(var r,o=e.length,i=0;i<o;i++)a((r=e[i]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var o,i=new Pe(t),s=e.length,a=0;a<s;1===(o=e[a++]).nodeType&&function e(t,n,r,o,i){Ie.has(t)&&!o.has(t)&&(i.delete(t),o.add(t),t.dispatchEvent(n));for(var s=t.children||[],a=s.length,l=0;l<a;e(s[l++],n,r,o,i));}(o,i,t,n,r));}}(e.ownerDocument)),Ie.add(e),e}),He=/^(?:form|list)$/i,We=[].slice;function Ue(t){return this.type=t,function(t){var n=we,r=ve;return function(o){var i,s,a;return n!==o&&(i=t,s=n=o,a=be.get(s)||be.set(s,ye(i,s)),r=a.updates(K.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ve=!(Ue.prototype={attribute:function(e,t,n){var r,o=qe in e;if("style"===t)return $e(e,n,o);if("."===t.slice(0,1))return c=e,u=t.slice(1),o?function(e){try{c[u]=e}catch(t){c.setAttribute(u,e)}}:function(e){c[u]=e};if("?"===t.slice(0,1))return s=e,a=t.slice(1),function(e){l!==!!e&&((l=!!e)?s.setAttribute(a,""):s.removeAttribute(a))};if(/^on/.test(t)){var i=t.slice(2);return"connected"===i||"disconnected"===i?Be(e):t.toLowerCase()in e&&(i=i.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(i,r,!1),(r=t)&&e.addEventListener(i,t,!1))}}if("data"===t||!o&&t in e&&!He.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in D.attributes)return function(n){var o=D.attributes[t](e,n);r!==o&&(null==(r=o)?e.removeAttribute(t):e.setAttribute(t,o))};var s,a,l,c,u,d=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(d&&(d=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,d||(d=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:Re,before:e},o=qe in e?"svg":"html",i=!1;return function s(a){switch(typeof a){case"string":case"number":case"boolean":i?n!==a&&(n=a,t[0].textContent=a):(i=!0,n=a,t=f(e.parentNode,t,[(l=a,e.ownerDocument.createTextNode(l))],r));break;case"function":s(a(e));break;case"object":case"undefined":if(null==a){i=!1,t=f(e.parentNode,t,[],r);break}default:if(i=!1,P(n=a))if(0===a.length)t.length&&(t=f(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":s({html:a});break;case"object":if(P(a[0])&&(a=a.concat.apply([],a)),ze(a[0])){Promise.all(a).then(s);break}default:t=f(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=f(e.parentNode,t,11===a.nodeType?We.call(a.childNodes):[a],r):ze(a)?a.then(s):"placeholder"in a?Ne(a,s):"text"in a?s(String(a.text)):"any"in a?s(a.any):"html"in a?t=f(e.parentNode,t,We.call(j([].concat(a.html).join(""),o).childNodes),r):s("length"in a?We.call(a):D.invoke(a,s))}var l}},text:function(e){var t;return function n(r){var o;t!==r&&("object"==(o=typeof(t=r))&&r?ze(r)?r.then(n):"placeholder"in r?Ne(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?We.call(r).join(""):D.invoke(r,n)):"function"==o?n(r(e)):e.textContent=null==r?"":r)}}}),Ze=function(t){var r,o,i,s,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),l=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||l?(o={},i=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return o[t]||(o[t]=e)},Ze=l?i:(s=new n,function(e){return s.get(e)||(n=i(t=e),s.set(t,n),n);var t,n})):Ve=!0,Ke(t)};function Ke(e){return Ve?e:Ze(e)}function Ye(e){for(var t=arguments.length,n=[Ke(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Xe=new n,Ge=function(e){var t,n,r;return function(){var o=Ye.apply(null,arguments);return r!==o[0]?(r=o[0],n=new Ue(e),t=Je(n.apply(n,o))):n.apply(n,o),t}},Qe=function(e,t){var n=t.indexOf(":"),r=Xe.get(e),o=t;return-1<n&&(o=t.slice(n+1),t=t.slice(0,n)||"html"),r||Xe.set(e,r={}),r[o]||(r[o]=Ge(t))},Je=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Ae(t):e},et=new n;function tt(){var e=et.get(this),t=Ye.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Ue(qe in this?"svg":"html");et.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var nt,rt,ot,it,st=D.define,at=Ue.prototype;function lt(e){return arguments.length<2?null==e?Ge("html"):"string"==typeof e?lt.wire(null,e):"raw"in e?Ge("html")(e):"nodeType"in e?lt.bind(e):Qe(e,"html"):("raw"in e?Ge("html"):lt.wire).apply(null,arguments)}return lt.Component=v,lt.bind=function(e){return tt.bind(e)},lt.define=st,lt.diff=f,(lt.hyper=lt).observe=Be,lt.tagger=at,lt.wire=function(e,t){return null==e?Ge(t||"html"):Qe(e,t||"html")},lt._={WeakMap:n,WeakSet:u},nt=Ge,rt=new n,ot=Object.create,it=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(v,{for:{configurable:!0,value:function(e,t){return function(e,t,r,o){var i,s,a,l=t.get(e)||it(e,t);switch(typeof o){case"object":case"function":var c=l.w||(l.w=new n);return c.get(o)||(i=c,s=o,a=new e(r),i.set(s,a),a);default:var u=l.p||(l.p=ot(null));return u[o]||(u[o]=new e(r))}}(this,rt.get(e)||(r=e,o=new w,rt.set(r,o),o),e,null==t?"default":t);var r,o}}}),Object.defineProperties(v.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:x("html",nt),svg:x("svg",nt),state:x("state",(function(){return this.defaultState})),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new b(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 o in r)n[o]=r[o];return!1!==t&&this.render(),this}}}),lt}(document); /*! (c) Andrea Giammarchi (ISC) */const we=ye,ve=S,xe=fe,ke=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(!(e=e.trim()))throw new TypeError("Invalid input.");let t="",n="",r="",o=null,i=new Map,s="type",a=Array.from(e);for(let e=0;e<a.length;e++){const l=a[e];switch(s){case"type":if("/"===l){s="subtype";continue}t+=l;break;case"subtype":if(";"===l){s="param-start";continue}n+=l;break;case"param-start":if(A.test(l)||";"===l)continue;r+=l,s="param-name";break;case"param-name":if("="===l||";"===l){if("="===l){s="param-value",o=null;continue}i.set(r.toLowerCase(),null),r="";continue}r+=l;break;case"param-value":if('"'==l){s="collect-quoted-string";continue}if(";"===l){o=o.trimEnd(),s="param-start",T(i,r,o),r="";continue}o="string"==typeof o?o+l:l;break;case"collect-quoted-string":if('"'===l){T(i,r,o),s="ignore-input-until-next-param",r="",o=null;continue}if("\\"===l)continue;o="string"==typeof o?o+l:l;break;case"ignore-input-until-next-param":if(";"!==l)continue;s="param-start";break;default:throw new Error(`State machine error - unknown parser mode: ${s} `)}}r&&T(i,r,o);if(""===t.trim()||!C.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!C.test(n))throw new TypeError("Invalid subtype");return{type:t,subtype:n,params:Object.fromEntries(i.entries())}}(e);this.type=t.trim().toLowerCase(),this.subtype=n.trimEnd().toLowerCase(),this.parameters=new Map(Object.entries(r))}get essence(){return`${this.type}/${this.subtype}`}toString(){return function(e){const{parameters:t,essence:n}=e;if(!t.size)return n;let r=";";for(const[e,n]of t.entries())r+=e,null!==n?C.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},$e=be;function _e(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 Ee=Object.freeze({__proto__:null,name:"core/reindent",reindent:_e,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=_e(e.innerHTML)}});const Se=/-/g,Ce=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Ae="en"===l||l.startsWith("en-")?"en-AU":l,Le=new Intl.DateTimeFormat(Ae,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===Ae?"2-digit":"numeric"});function Te(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as),e.corsMode&&(n.crossOrigin=e.corsMode)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function Re(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function Ne(e,t="long"){const n=new Intl.ListFormat(l,{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 ze=Ne("conjunction"),De=Ne("disjunction");function Pe(e,t){return ze(e,t).join("")}function je(e){return e.trim().replace(/\s+/g," ")}function Oe(e,t=l){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=function(e,t,n=l){return n=n.toLowerCase(),e[n]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function Ie(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){et(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}function qe(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 Me(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 Fe(e){const t=new Set,n="ltNodefault"in e.dataset?"":je(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>je(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(je(e))))}return[...t]}function Be(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 He(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 We(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function Ue(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 Ve(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 Ze 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 Ke(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{Be(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),Ye(t),t}function Ye(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...Xe(t)])e.remove()}function*Xe(e){for(;e.nextNode();)yield e.currentNode}class Ge 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 Qe 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||Me(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 Je(e,t,n={}){const o={...n,isWarning:!1};r("error",new Qe(e,t,o))}function et(e,t,n={}){const o={...n,isWarning:!0};r("warn",new Qe(e,t,o))}function tt(e){return e?`\`${e}\``:""}function nt(e,{quotes:t}={quotes:!1}){return De(e,t?e=>{return tt((t=e,String(t)?`"${t}"`:""));var t}:tt).join("")}function rt(e,...t){return _e(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 ot=new Map([["text/html","html"],["application/xml","xml"]]);function it(e,t=document){const n=ot.get(e);if(!n){const t=[...ot.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=st(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function st(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:o}=e;Ye(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),Re(o);const i=e.createDocumentFragment(),s=e.querySelector("meta[name='viewport']");s&&t.firstChild!==s&&i.appendChild(s);let a=e.querySelector("meta[charset], meta[content*='charset=']");a||(a=we`<meta charset="utf-8" />`);i.appendChild(a);const l=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=we` <meta name="generator" content="${l}" /> `;i.appendChild(c),t.prepend(i),r("beforesave",o)}(n);let o="";if("xml"===e)o=(new XMLSerializer).serializeToString(n);else!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&&(o+=(new XMLSerializer).serializeToString(n.doctype)),o+=n.documentElement.outerHTML;return o}t("core/exporter",{rsDocToDataURL:it});class at{constructor(){this._respecDonePromise=new Promise((e=>{o("end-all",(()=>e()),{once:!0})})),this.errors=[],this.warnings=[],o("error",(e=>{console.error(e,e.toJSON()),this.errors.push(e)})),o("warn",(e=>{console.warn(e,e.toJSON()),this.warnings.push(e)}))}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return st("html",document)}}const lt="core/post-process";const ct="core/pre-process";const ut="core/base-runner";async function dt(e){!function(){const e=new at;Object.defineProperty(document,"respec",{value:e})}(),r("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),o("amend-user-config",n),o("end-all",(()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of i)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]})),o=Object.fromEntries(n);Object.assign(e,o),r("amend-user-config",o)}(respecConfig),performance.mark(`${ut}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||Je("Every item in `preProcess` must be a JS function.",ct),t})).map((async t=>{try{return await t(e,document)}catch(e){Je(`Function ${t.name} threw an error during \`preProcess\`.`,ct,{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={},r("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||Je("Every item in `postProcess` must be a JS function.",lt),t})).map((async t=>{try{return await t(e,document)}catch(e){Je(`Function ${t.name} threw an error during \`postProcess\`.`,lt,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),r("end-all"),Re(document),performance.mark(`${ut}-end`),performance.measure(ut,`${ut}-start`,`${ut}-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} @@ -344,7 +344,7 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} ${lo} </style>`,o.querySelector("link")),po(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const fo="core/best-practices",mo={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},go=Oe(mo),bo=l in mo?l:"en";var yo=Object.freeze({__proto__:null,name:fo,run:function(){const e=document.querySelectorAll(".practicelab"),t=document.getElementById("bp-summary"),n=t?document.createElement("ul"):null;if([...e].forEach(((e,t)=>{const r=Me(e,"bp"),o=we`<a class="marker self-link" href="${`#${r}`}" ><bdi lang="${bo}">${go.best_practice}${t+1}</bdi></a - >`;if(n){const t=we`<li>${o}: ${Ke(e)}</li>`;n.appendChild(t)}const i=e.closest("div");if(!i)return void e.classList.add("advisement");i.classList.add("advisement");const s=we`${o.cloneNode(!0)}: ${e}`;i.prepend(...s.childNodes)})),e.length)t&&(t.appendChild(we`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){et("Using best practices summary (#bp-summary) but no best practices found.",fo),t.remove()}}});const wo="core/figures",vo=Oe({en:{list_of_figures:"List of Figures",fig:"Figure "},ja:{fig:"図 ",list_of_figures:"図のリスト"},ko:{fig:"그림 ",list_of_figures:"그림 목록"},nl:{fig:"Figuur ",list_of_figures:"Lijst met figuren"},es:{fig:"Figura ",list_of_figures:"Lista de Figuras"},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var xo=Object.freeze({__proto__:null,name:wo,run:function(){document.querySelectorAll(":not(picture)>img:not([width]):not([height]):not([srcset])").forEach((e=>{0!==e.naturalHeight&&0!==e.naturalWidth&&(e.height=e.naturalHeight,e.width=e.naturalWidth)}));const e=function(){const e=[];return document.querySelectorAll("figure").forEach(((t,n)=>{const r=t.querySelector("figcaption");if(r)!function(e,t,n){const r=t.textContent;Me(e,"fig",r),We(t,we`<span class="fig-title"></span>`),t.prepend(we`<a class="self-link" href="#${e.id}" + >`;if(n){const t=we`<li>${o}: ${Ke(e)}</li>`;n.appendChild(t)}const i=e.closest("div");if(!i)return void e.classList.add("advisement");i.classList.add("advisement");const s=we`${o.cloneNode(!0)}: ${e}`;i.prepend(...s.childNodes)})),e.length)t&&(t.appendChild(we`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){et("Using best practices summary (#bp-summary) but no best practices found.",fo),t.remove()}}});const wo="core/figures",vo=Oe({en:{list_of_figures:"List of Figures",fig:"Figure "},ja:{fig:"図 ",list_of_figures:"図のリスト"},ko:{fig:"그림 ",list_of_figures:"그림 목록"},nl:{fig:"Figuur ",list_of_figures:"Lijst met figuren"},es:{fig:"Figura ",list_of_figures:"Lista de Figuras"},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var xo=Object.freeze({__proto__:null,name:wo,run:function(){document.querySelectorAll(":not(picture)>img:not([width]):not([height]):not([srcset])").forEach((e=>{e.src.startsWith("data:image/svg+xml;")||e.src.endsWith(".svg")||0!==e.naturalHeight&&0!==e.naturalWidth&&(e.height=e.naturalHeight,e.width=e.naturalWidth)}));const e=function(){const e=[];return document.querySelectorAll("figure").forEach(((t,n)=>{const r=t.querySelector("figcaption");if(r)!function(e,t,n){const r=t.textContent;Me(e,"fig",r),We(t,we`<span class="fig-title"></span>`),t.prepend(we`<a class="self-link" href="#${e.id}" >${vo.fig}<bdi class="figno">${n+1}</bdi></a >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach((e=>{Be(e,"span").removeAttribute("href")})),we`<li class="tofline"> <a class="tocxref" href="${`#${e}`}">${n.childNodes}</a> diff --git a/builds/respec-dini.js.map b/builds/respec-dini.js.map index 2a5a60405a..6ac0274d1c 100644 --- a/builds/respec-dini.js.map +++ b/builds/respec-dini.js.map @@ -1 +1 @@ -{"version":3,"file":"respec-dini.js","sources":["../src/core/expose-modules.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/l10n.js","../node_modules/idb/build/wrap-idb-value.js","../node_modules/idb/build/index.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/reindent.js","../src/core/utils.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/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/dini.js","../src/core/location-hash.js","../src/core/defaults.js","../src/dini/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/dini/style.js","../src/core/sections.js","../src/core/data-include.js","../src/core/title.js","../src/core/templates/show-link.js","../src/core/templates/show-logo.js","../src/core/templates/show-people.js","../src/dini/templates/headers.js","../src/dini/headers.js","../src/dini/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/dini/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/data-cite.js","../src/core/link-to-dfn.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/ui/save-html.js","../src/ui/about-respec.js","../src/core/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.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/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/github.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.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/no-http-props.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/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\nimport { expose } from \"./expose-modules.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.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, options = { once: false }) {\n const listener = e => cb(e.detail);\n subscriptions.addEventListener(topic, listener, options);\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/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), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\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', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\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 * 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 v4.3.0 - a markdown parser\n * Copyright (c) 2011-2023, 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\nfunction getDefaults() {\n return {\n async: false,\n baseUrl: null,\n breaks: false,\n extensions: null,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n hooks: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: null,\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartypants: false,\n tokenizer: null,\n walkTokens: null,\n xhtml: false\n };\n}\n\nlet defaults = getDefaults();\n\nfunction changeDefaults(newDefaults) {\n defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape(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\n/**\n * @param {string} html\n */\nfunction unescape(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;\n\n/**\n * @param {string | RegExp} regex\n * @param {string} opt\n */\nfunction edit(regex, opt) {\n regex = typeof regex === 'string' ? regex : regex.source;\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;\n\n/**\n * @param {boolean} sanitize\n * @param {string} base\n * @param {string} href\n */\nfunction cleanUrl(sanitize, base, href) {\n if (sanitize) {\n let prot;\n try {\n prot = decodeURIComponent(unescape(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\n/**\n * @param {string} base\n * @param {string} href\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(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 = { exec: function noopTest() {} };\n\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n 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 // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) { cells.shift(); }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) { cells.pop(); }\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/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param {string} str\n * @param {string} c\n * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(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.slice(0, l - suffLen);\n}\n\nfunction findClosingBracket(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(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\n/**\n * @param {string} pattern\n * @param {number} count\n */\nfunction repeatString(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\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape(text)\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 */\nclass Tokenizer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\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().replace(this.rules.inline._escapes, '$1') : 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,\n tokens: this.lexer.inline(text)\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(/^ *>[ \\t]?/gm, '');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine,\n line, nextLine, rawLine, itemContents, endEarly;\n\n let bull = cap[1].trim();\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 bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n\n // Check if current bullet point can start a new List Item\n while (src) {\n endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n\n raw = cap[0];\n src = src.substring(raw.length);\n\n line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n nextLine = src.split('\\n', 1)[0];\n\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimLeft();\n } else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n\n blankLine = false;\n\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n\n // Check if following lines should be included in List Item\n while (src) {\n rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n } else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n\n itemContents += '\\n' + nextLine;\n }\n\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n } else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents\n });\n\n list.raw += raw;\n }\n\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimRight();\n list.items[list.items.length - 1].text = itemContents.trimRight();\n list.raw = list.raw.trimRight();\n\n const l = list.items.length;\n\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (i = 0; i < l; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n\n list.loose = hasMultipleLineBreaks;\n }\n }\n\n // Set all items to loose if list is loose\n if (list.loose) {\n for (i = 0; i < l; i++) {\n list.items[i].loose = true;\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 const token = {\n type: 'html',\n raw: cap[0],\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: cap[0]\n };\n if (this.options.sanitize) {\n const text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);\n token.type = 'paragraph';\n token.text = text;\n token.tokens = this.lexer.inline(text);\n }\n return token;\n }\n }\n\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\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]).map(c => { return { text: c }; }),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n rows: cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').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, j, k, row;\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.rows.length;\n for (i = 0; i < l; i++) {\n item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; });\n }\n\n // parse child tokens inside headers and cells\n\n // header child tokens\n l = item.header.length;\n for (j = 0; j < l; j++) {\n item.header[j].tokens = this.lexer.inline(item.header[j].text);\n }\n\n // cell child tokens\n l = item.rows.length;\n for (j = 0; j < l; j++) {\n row = item.rows[j];\n for (k = 0; k < row.length; k++) {\n row[k].tokens = this.lexer.inline(row[k].text);\n }\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 tokens: this.lexer.inline(cap[1])\n };\n }\n }\n\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\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 tokens: this.lexer.inline(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(cap[1])\n };\n }\n }\n\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n } else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n } else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n\n return {\n type: this.options.sanitize\n ? 'text'\n : 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n text: this.options.sanitize\n ? (this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape(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], this.lexer);\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) {\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], this.lexer);\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 const raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\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(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 tokens: this.lexer.inlineTokens(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(this.options.mangle ? mangle(cap[1]) : cap[1]);\n href = 'mailto:' + text;\n } else {\n text = escape(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(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(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n } else {\n href = cap[0];\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, smartypants) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0];\n } else {\n text = escape(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\n/**\n * Block-Level Grammar\n */\nconst block = {\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}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/,\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][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/,\n table: noopTest,\n lheading: /^((?:.|\\n(?!\\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|table| +\\n)[^\\n]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock._label = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nblock._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock.def = edit(block.def)\n .replace('label', block._label)\n .replace('title', block._title)\n .getRegex();\n\nblock.bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nblock.listItemStart = edit(/^( *)(bull) */)\n .replace('bull', block.bullet)\n .getRegex();\n\nblock.list = edit(block.list)\n .replace(/bull/g, block.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block.def.source + ')')\n .getRegex();\n\nblock._tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'\n + '|track|ul';\nblock._comment = /<!--(?!-?>)[\\s\\S]*?(?:-->|$)/;\nblock.html = edit(block.html, 'i')\n .replace('comment', block._comment)\n .replace('tag', block._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('|table', '')\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._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.blockquote = edit(block.blockquote)\n .replace('paragraph', block.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock.normal = { ...block };\n\n/**\n * GFM Block Grammar\n */\n\nblock.gfm = {\n ...block.normal,\n table: '^ *([^\\\\n ].*\\\\|.*)\\\\n' // Header\n + ' {0,3}(?:\\\\| *)?(:?-+:? *(?:\\\\| *:?-+:? *)*)(?:\\\\| *)?' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)' // Cells\n};\n\nblock.gfm.table = edit(block.gfm.table)\n .replace('hr', block.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._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.gfm.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('table', block.gfm.table) // interrupt paragraphs with table\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._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock.pedantic = {\n ...block.normal,\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', block._comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(block.normal._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n};\n\n/**\n * Inline-Level Grammar\n */\nconst inline = {\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)\\]\\[(ref)\\]/,\n nolink: /^!?\\[(ref)\\](?:\\[\\])?/,\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 orphan inside strong () Consume to delim (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._punctuation = '!\"#$%&\\'()+\\\\-.,/:;<=>?@\\\\[\\\\]`^{|}~';\ninline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();\n\n// sequences em should skip over [title](link), `code`, <html>\ninline.blockSkip = /\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>/g;\n// lookbehind is not available on Safari as of version 16\n// inline.escapedEmSt = /(?<=(?:^|[^\\\\)(?:\\\\[^])*)\\\\[*_]/g;\ninline.escapedEmSt = /(?:^|[^\\\\])(?:\\\\\\\\)*\\\\[*_]/g;\n\ninline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();\n\ninline.emStrong.lDelim = edit(inline.emStrong.lDelim)\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;\ninline.autolink = edit(inline.autolink)\n .replace('scheme', inline._scheme)\n .replace('email', inline._email)\n .getRegex();\n\ninline._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline.tag = edit(inline.tag)\n .replace('comment', inline._comment)\n .replace('attribute', inline._attribute)\n .getRegex();\n\ninline._label = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline._href = /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/;\ninline._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline.link = edit(inline.link)\n .replace('label', inline._label)\n .replace('href', inline._href)\n .replace('title', inline._title)\n .getRegex();\n\ninline.reflink = edit(inline.reflink)\n .replace('label', inline._label)\n .replace('ref', block._label)\n .getRegex();\n\ninline.nolink = edit(inline.nolink)\n .replace('ref', block._label)\n .getRegex();\n\ninline.reflinkSearch = edit(inline.reflinkSearch, 'g')\n .replace('reflink', inline.reflink)\n .replace('nolink', inline.nolink)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline.normal = { ...inline };\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline.pedantic = {\n ...inline.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._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline._label)\n .getRegex()\n};\n\n/**\n * GFM Inline Grammar\n */\n\ninline.gfm = {\n ...inline.normal,\n escape: edit(inline.escape).replace('])', '~|])').getRegex(),\n _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,\n url: /^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\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.gfm.url = edit(inline.gfm.url, 'i')\n .replace('email', inline.gfm._extended_email)\n .getRegex();\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\ninline.breaks = {\n ...inline.gfm,\n br: edit(inline.br).replace('{2,}', '*').getRegex(),\n text: edit(inline.gfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n};\n\n/**\n * smartypants text replacement\n * @param {string} text\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 * @param {string} text\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 */\nclass Lexer {\n constructor(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || defaults;\n this.options.tokenizer = this.options.tokenizer || new Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\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\n this.blockTokens(src, this.tokens);\n\n let next;\n while (next = this.inlineQueue.shift()) {\n this.inlineTokens(next.src, next.tokens);\n }\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n } else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n\n let token, 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({ lexer: 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.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n } else {\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' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 // 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 tokens.push(token);\n continue;\n }\n\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\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 (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else 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({ lexer: 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 (this.state.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 this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 this.state.top = true;\n return tokens;\n }\n\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\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 + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);\n 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({ lexer: 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)) {\n src = src.substring(token.raw.length);\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 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 (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 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 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 (!this.state.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({ lexer: 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, 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\n/**\n * Renderer\n */\nclass Renderer {\n constructor(options) {\n this.options = options || defaults;\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(code, true))\n + '</code></pre>\\n';\n }\n\n return '<pre><code class=\"'\n + this.options.langPrefix\n + escape(lang)\n + '\">'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n /**\n * @param {string} quote\n */\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n\n html(html) {\n return html;\n }\n\n /**\n * @param {string} text\n * @param {string} level\n * @param {string} raw\n * @param {any} slugger\n */\n heading(text, level, raw, slugger) {\n if (this.options.headerIds) {\n const id = this.options.headerPrefix + slugger.slug(raw);\n return `<h${level} id=\"${id}\">${text}</h${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 /**\n * @param {string} text\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 /**\n * @param {string} text\n */\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n\n /**\n * @param {string} header\n * @param {string} body\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 /**\n * @param {string} content\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 /**\n * span level renderer\n * @param {string} text\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n\n /**\n * @param {string} text\n */\n em(text) {\n return `<em>${text}</em>`;\n }\n\n /**\n * @param {string} text\n */\n codespan(text) {\n return `<code>${text}</code>`;\n }\n\n br() {\n return this.options.xhtml ? '<br/>' : '<br>';\n }\n\n /**\n * @param {string} text\n */\n del(text) {\n return `<del>${text}</del>`;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\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=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\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 */\nclass 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 */\nclass Slugger {\n constructor() {\n this.seen = {};\n }\n\n /**\n * @param {string} value\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 * @param {string} originalSlug\n * @param {boolean} isDryRun\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\n * 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\n/**\n * Parsing & Compiling\n */\nclass Parser {\n constructor(options) {\n this.options = options || defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new TextRenderer();\n this.slugger = new Slugger();\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({ parser: 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.header[j].tokens),\n { header: true, align: token.align[j] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n body = '';\n l2 = token.rows.length;\n for (j = 0; j < l2; j++) {\n row = token.rows[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].tokens),\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 === 'paragraph') {\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({ parser: 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\nclass Hooks {\n constructor(options) {\n this.options = options || defaults;\n }\n\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess'\n ]);\n\n /**\n * Process markdown before marked\n */\n preprocess(markdown) {\n return markdown;\n }\n\n /**\n * Process HTML after marked is finished\n */\n postprocess(html) {\n return html;\n }\n}\n\nfunction onError(silent, async, callback) {\n return (e) => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n\n if (silent) {\n const msg = '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n if (async) {\n return Promise.resolve(msg);\n }\n if (callback) {\n callback(null, msg);\n return;\n }\n return msg;\n }\n\n if (async) {\n return Promise.reject(e);\n }\n if (callback) {\n callback(e);\n return;\n }\n throw e;\n };\n}\n\nfunction parseMarkdown(lexer, parser) {\n return (src, opt, callback) => {\n if (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n const origOpt = { ...opt };\n opt = { ...marked.defaults, ...origOpt };\n const throwError = onError(opt.silent, opt.async, callback);\n\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n\n checkSanitizeDeprecation(opt);\n\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n tokens = lexer(src, opt);\n } catch (e) {\n return throwError(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(tokens, opt);\n if (opt.hooks) {\n out = opt.hooks.postprocess(out);\n }\n } catch (e) {\n err = e;\n }\n }\n\n opt.highlight = highlight;\n\n return err\n ? throwError(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 if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.walkTokens ? Promise.all(marked.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n const tokens = lexer(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n } catch (e) {\n return throwError(e);\n }\n };\n}\n\n/**\n * Marked\n */\nfunction marked(src, opt, callback) {\n return parseMarkdown(Lexer.lex, Parser.parse)(src, opt, callback);\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n marked.defaults = { ...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 extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };\n\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n\n // set async to true if it was set to true before\n opts.async = marked.defaults.async || opts.async || false;\n\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\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[ext.name];\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 opts.extensions = extensions;\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 Hooks extensions --== //\n if (pack.hooks) {\n const hooks = marked.defaults.hooks || new Hooks();\n for (const prop in pack.hooks) {\n const prevHook = hooks[prop];\n if (Hooks.passThroughHooks.has(prop)) {\n hooks[prop] = (arg) => {\n if (marked.defaults.async) {\n return Promise.resolve(pack.hooks[prop].call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n\n const ret = pack.hooks[prop].call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n } else {\n hooks[prop] = (...args) => {\n let ret = pack.hooks[prop].apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked.defaults.walkTokens;\n opts.walkTokens = function(token) {\n let values = [];\n values.push(pack.walkTokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n\n marked.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(marked, token));\n switch (token.type) {\n case 'table': {\n for (const cell of token.header) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n for (const row of token.rows) {\n for (const cell of row) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n values = values.concat(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 values = values.concat(marked.walkTokens(token[childTokens], callback));\n });\n } else if (token.tokens) {\n values = values.concat(marked.walkTokens(token.tokens, callback));\n }\n }\n }\n }\n return values;\n};\n\n/**\n * Parse Inline\n * @param {string} src\n */\nmarked.parseInline = parseMarkdown(Lexer.lexInline, Parser.parseInline);\n\n/**\n * Expose\n */\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\nmarked.Tokenizer = Tokenizer;\nmarked.Slugger = Slugger;\nmarked.Hooks = Hooks;\nmarked.parse = marked;\n\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = Parser.parse;\nconst lexer = Lexer.lex;\n\nexport { Hooks, Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\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 pluralizeExports = {};\nvar pluralize$1 = {\n get exports(){ return pluralizeExports; },\n set exports(v){ pluralizeExports = v; },\n};\n\n/* global define */\n\n(function (module, exports) {\n\t(function (root, pluralize) {\n\t /* istanbul ignore else */\n\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t // Node.\n\t module.exports = pluralize();\n\t } else {\n\t // Browser global.\n\t root.pluralize = pluralize();\n\t }\n\t})(commonjsGlobal, function () {\n\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t // while other rules can be optimized using an object for instant lookups.\n\t var pluralRules = [];\n\t var singularRules = [];\n\t var uncountables = {};\n\t var irregularPlurals = {};\n\t var irregularSingles = {};\n\n\t /**\n\t * Sanitize a pluralization rule to a usable regular expression.\n\t *\n\t * @param {(RegExp|string)} rule\n\t * @return {RegExp}\n\t */\n\t function sanitizeRule (rule) {\n\t if (typeof rule === 'string') {\n\t return new RegExp('^' + rule + '$', 'i');\n\t }\n\n\t return rule;\n\t }\n\n\t /**\n\t * Pass in a word token to produce a function that can replicate the case on\n\t * another word.\n\t *\n\t * @param {string} word\n\t * @param {string} token\n\t * @return {Function}\n\t */\n\t function restoreCase (word, token) {\n\t // Tokens are an exact match.\n\t if (word === token) return token;\n\n\t // Lower cased words. E.g. \"hello\".\n\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t // Upper cased words. E.g. \"WHISKY\".\n\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t // Title cased words. E.g. \"Title\".\n\t if (word[0] === word[0].toUpperCase()) {\n\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t }\n\n\t // Lower cased words. E.g. \"test\".\n\t return token.toLowerCase();\n\t }\n\n\t /**\n\t * Interpolate a regexp string.\n\t *\n\t * @param {string} str\n\t * @param {Array} args\n\t * @return {string}\n\t */\n\t function interpolate (str, args) {\n\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t return args[index] || '';\n\t });\n\t }\n\n\t /**\n\t * Replace a word using a rule.\n\t *\n\t * @param {string} word\n\t * @param {Array} rule\n\t * @return {string}\n\t */\n\t function replace (word, rule) {\n\t return word.replace(rule[0], function (match, index) {\n\t var result = interpolate(rule[1], arguments);\n\n\t if (match === '') {\n\t return restoreCase(word[index - 1], result);\n\t }\n\n\t return restoreCase(match, result);\n\t });\n\t }\n\n\t /**\n\t * Sanitize a word by passing in the word and sanitization rules.\n\t *\n\t * @param {string} token\n\t * @param {string} word\n\t * @param {Array} rules\n\t * @return {string}\n\t */\n\t function sanitizeWord (token, word, rules) {\n\t // Empty string or doesn't need fixing.\n\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t return word;\n\t }\n\n\t var len = rules.length;\n\n\t // Iterate over the sanitization rules and use the first one to match.\n\t while (len--) {\n\t var rule = rules[len];\n\n\t if (rule[0].test(word)) return replace(word, rule);\n\t }\n\n\t return word;\n\t }\n\n\t /**\n\t * Replace a word with the updated word.\n\t *\n\t * @param {Object} replaceMap\n\t * @param {Object} keepMap\n\t * @param {Array} rules\n\t * @return {Function}\n\t */\n\t function replaceWord (replaceMap, keepMap, rules) {\n\t return function (word) {\n\t // Get the correct token and case restoration functions.\n\t var token = word.toLowerCase();\n\n\t // Check against the keep object map.\n\t if (keepMap.hasOwnProperty(token)) {\n\t return restoreCase(word, token);\n\t }\n\n\t // Check against the replacement map for a direct word replacement.\n\t if (replaceMap.hasOwnProperty(token)) {\n\t return restoreCase(word, replaceMap[token]);\n\t }\n\n\t // Run all the rules against the word.\n\t return sanitizeWord(token, word, rules);\n\t };\n\t }\n\n\t /**\n\t * Check if a word is part of the map.\n\t */\n\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t return function (word) {\n\t var token = word.toLowerCase();\n\n\t if (keepMap.hasOwnProperty(token)) return true;\n\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t return sanitizeWord(token, token, rules) === token;\n\t };\n\t }\n\n\t /**\n\t * Pluralize or singularize a word based on the passed in count.\n\t *\n\t * @param {string} word The word to pluralize\n\t * @param {number} count How many of the word exist\n\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t * @return {string}\n\t */\n\t function pluralize (word, count, inclusive) {\n\t var pluralized = count === 1\n\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t return (inclusive ? count + ' ' : '') + pluralized;\n\t }\n\n\t /**\n\t * Pluralize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.plural = replaceWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Check if a word is plural.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isPlural = checkWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Singularize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.singular = replaceWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Check if a word is singular.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isSingular = checkWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Add a pluralization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addPluralRule = function (rule, replacement) {\n\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add a singularization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addSingularRule = function (rule, replacement) {\n\t singularRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add an uncountable word rule.\n\t *\n\t * @param {(string|RegExp)} word\n\t */\n\t pluralize.addUncountableRule = function (word) {\n\t if (typeof word === 'string') {\n\t uncountables[word.toLowerCase()] = true;\n\t return;\n\t }\n\n\t // Set singular and plural references for the word.\n\t pluralize.addPluralRule(word, '$0');\n\t pluralize.addSingularRule(word, '$0');\n\t };\n\n\t /**\n\t * Add an irregular word definition.\n\t *\n\t * @param {string} single\n\t * @param {string} plural\n\t */\n\t pluralize.addIrregularRule = function (single, plural) {\n\t plural = plural.toLowerCase();\n\t single = single.toLowerCase();\n\n\t irregularSingles[single] = plural;\n\t irregularPlurals[plural] = single;\n\t };\n\n\t /**\n\t * Irregular rules.\n\t */\n\t [\n\t // Pronouns.\n\t ['I', 'we'],\n\t ['me', 'us'],\n\t ['he', 'they'],\n\t ['she', 'they'],\n\t ['them', 'them'],\n\t ['myself', 'ourselves'],\n\t ['yourself', 'yourselves'],\n\t ['itself', 'themselves'],\n\t ['herself', 'themselves'],\n\t ['himself', 'themselves'],\n\t ['themself', 'themselves'],\n\t ['is', 'are'],\n\t ['was', 'were'],\n\t ['has', 'have'],\n\t ['this', 'these'],\n\t ['that', 'those'],\n\t // Words ending in with a consonant and `o`.\n\t ['echo', 'echoes'],\n\t ['dingo', 'dingoes'],\n\t ['volcano', 'volcanoes'],\n\t ['tornado', 'tornadoes'],\n\t ['torpedo', 'torpedoes'],\n\t // Ends with `us`.\n\t ['genus', 'genera'],\n\t ['viscus', 'viscera'],\n\t // Ends with `ma`.\n\t ['stigma', 'stigmata'],\n\t ['stoma', 'stomata'],\n\t ['dogma', 'dogmata'],\n\t ['lemma', 'lemmata'],\n\t ['schema', 'schemata'],\n\t ['anathema', 'anathemata'],\n\t // Other irregular rules.\n\t ['ox', 'oxen'],\n\t ['axe', 'axes'],\n\t ['die', 'dice'],\n\t ['yes', 'yeses'],\n\t ['foot', 'feet'],\n\t ['eave', 'eaves'],\n\t ['goose', 'geese'],\n\t ['tooth', 'teeth'],\n\t ['quiz', 'quizzes'],\n\t ['human', 'humans'],\n\t ['proof', 'proofs'],\n\t ['carve', 'carves'],\n\t ['valve', 'valves'],\n\t ['looey', 'looies'],\n\t ['thief', 'thieves'],\n\t ['groove', 'grooves'],\n\t ['pickaxe', 'pickaxes'],\n\t ['passerby', 'passersby']\n\t ].forEach(function (rule) {\n\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Pluralization rules.\n\t */\n\t [\n\t [/s?$/i, 's'],\n\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t [/([^aeiou]ese)$/i, '$1'],\n\t [/(ax|test)is$/i, '$1es'],\n\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t [/(e[mn]u)s?$/i, '$1s'],\n\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t [/(her|at|gr)o$/i, '$1oes'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t [/sis$/i, 'ses'],\n\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t [/(child)(?:ren)?$/i, '$1ren'],\n\t [/eaux$/i, '$0'],\n\t [/m[ae]n$/i, 'men'],\n\t ['thou', 'you']\n\t ].forEach(function (rule) {\n\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Singularization rules.\n\t */\n\t [\n\t [/s$/i, ''],\n\t [/(ss)$/i, '$1'],\n\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t [/ies$/i, 'y'],\n\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t [/(seraph|cherub)im$/i, '$1'],\n\t [/(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\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t [/(test)(?:is|es)$/i, '$1is'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t [/(matr|append)ices$/i, '$1ix'],\n\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t [/(child)ren$/i, '$1'],\n\t [/(eau)x?$/i, '$1'],\n\t [/men$/i, 'man']\n\t ].forEach(function (rule) {\n\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Uncountable rules.\n\t */\n\t [\n\t // Singular words with no plurals.\n\t 'adulthood',\n\t 'advice',\n\t 'agenda',\n\t 'aid',\n\t 'aircraft',\n\t 'alcohol',\n\t 'ammo',\n\t 'analytics',\n\t 'anime',\n\t 'athletics',\n\t 'audio',\n\t 'bison',\n\t 'blood',\n\t 'bream',\n\t 'buffalo',\n\t 'butter',\n\t 'carp',\n\t 'cash',\n\t 'chassis',\n\t 'chess',\n\t 'clothing',\n\t 'cod',\n\t 'commerce',\n\t 'cooperation',\n\t 'corps',\n\t 'debris',\n\t 'diabetes',\n\t 'digestion',\n\t 'elk',\n\t 'energy',\n\t 'equipment',\n\t 'excretion',\n\t 'expertise',\n\t 'firmware',\n\t 'flounder',\n\t 'fun',\n\t 'gallows',\n\t 'garbage',\n\t 'graffiti',\n\t 'hardware',\n\t 'headquarters',\n\t 'health',\n\t 'herpes',\n\t 'highjinks',\n\t 'homework',\n\t 'housework',\n\t 'information',\n\t 'jeans',\n\t 'justice',\n\t 'kudos',\n\t 'labour',\n\t 'literature',\n\t 'machinery',\n\t 'mackerel',\n\t 'mail',\n\t 'media',\n\t 'mews',\n\t 'moose',\n\t 'music',\n\t 'mud',\n\t 'manga',\n\t 'news',\n\t 'only',\n\t 'personnel',\n\t 'pike',\n\t 'plankton',\n\t 'pliers',\n\t 'police',\n\t 'pollution',\n\t 'premises',\n\t 'rain',\n\t 'research',\n\t 'rice',\n\t 'salmon',\n\t 'scissors',\n\t 'series',\n\t 'sewage',\n\t 'shambles',\n\t 'shrimp',\n\t 'software',\n\t 'species',\n\t 'staff',\n\t 'swine',\n\t 'tennis',\n\t 'traffic',\n\t 'transportation',\n\t 'trout',\n\t 'tuna',\n\t 'wealth',\n\t 'welfare',\n\t 'whiting',\n\t 'wildebeest',\n\t 'wildlife',\n\t 'you',\n\t /pok[eé]mon$/i,\n\t // Regexes.\n\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t /deer$/i, // \"deer\", \"reindeer\"\n\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t /measles$/i,\n\t /o[iu]s$/i, // \"carnivorous\"\n\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t /sheep$/i\n\t ].forEach(pluralize.addUncountableRule);\n\n\t return pluralize;\n\t});\n} (pluralize$1));\n\nvar pluralize = pluralizeExports;\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/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _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\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\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// 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\";\nimport { reindent } from \"./reindent.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\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\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 if (opts.corsMode) {\n linkElem.crossOrigin = opts.corsMode;\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 * @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 = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || 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/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\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 * 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 * @param {Element} element\n */\nexport function 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/**\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 const linkifiedStr = 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 return reindent(linkifiedStr);\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 */\nimport { serialize } from \"../core/exporter.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","// @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\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\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 padding: 0.2em 0em;\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 will-change: opacity;\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 {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\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 font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.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-warning-list > li::before {\n content: \"⚠️\";\n}\n\n.respec-error-list > li::before {\n content: \"💥\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\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 top: 10%;\n background: #fff;\n border: 5px solid #666;\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\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-menu button.respec-option {\n background: white;\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 background-color: #eeeeee;\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\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\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\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 */\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;\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 image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\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\nconst config = {\n sanitize: false,\n gfm: true,\n headerIds: false,\n langPrefix: \"\",\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\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\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\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\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 processMDSections(document.body);\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 // Frankenstein the whole thing back together\n newBody.append(rsUI);\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 { markdownToHtml } from \"./markdown.js\";\nimport { reindent } from \"./reindent.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\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${err.message}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\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/dini/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/dini/style.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/dini/headers.js\"),\n import(\"../src/dini/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/dini/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/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.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/ui/save-html.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/data-type.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n import(\"../src/core/custom-elements/index.js\"),\n /* Linter 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/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/no-http-props.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 * 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 DINI specs\n */\nexport const name = \"dini/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\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 \"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 \"cc-by-sa\",\n {\n name: \"Creative Commons Attribution-ShareAlike 4.0 International Public License\",\n short: \"CC-BY-SA\",\n url: \"https://creativecommons.org/licenses/by-sa/4.0/legalcode\",\n },\n ],\n]);\n\nconst diniDefaults = {\n format: \"markdown\",\n isED: false,\n isNoTrack: true,\n isPR: false,\n lint: {\n \"privsec-section\": true,\n \"wpt-tests-exist\": false,\n },\n logos: [],\n prependW3C: false,\n doJsonLd: false,\n license: \"cc-by\",\n shortName: \"X\",\n showPreviousVersion: false,\n};\n\nfunction computeProps(conf) {\n return {\n licenseInfo: licenses.get(conf.license),\n };\n}\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...diniDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...diniDefaults,\n ...conf,\n lint,\n });\n\n // computed properties\n Object.assign(conf, computeProps(conf));\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/* --- INLINES --- */\n:is(h1, h2, h3, h4, h5, h6, a) 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\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\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\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 dini/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 = \"dini/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 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 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 = \"\";\n\n // Figure out which style file to use.\n switch (conf.specStatus.toUpperCase()) {\n case \"UNOFFICIAL\":\n styleFile = \"W3C-UD\";\n break;\n case \"BASE\":\n styleFile = \"base.css\";\n break;\n }\n\n // Attach W3C fixup script after we are done.\n if (!conf.noToc) {\n sub(\n \"end-all\",\n () => {\n attachFixupScript(document, \"2016\");\n },\n { once: true }\n );\n }\n const finalStyleURL = `https://www.w3.org/StyleSheets/TR/2016/${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","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\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) {\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(structure(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/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\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\nexport function run() {\n restructure(document.body);\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 { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.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 await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\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()).slice(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 if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\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 // We replace \":<br>\" with \":\", and \"<br>\" with \"-\", as appropriate.\n const tempElem = document.createElement(\"h1\");\n tempElem.innerHTML = h1Elem.innerHTML\n .replace(/:<br>/g, \": \")\n .replace(/<br>/g, \" - \");\n let documentTitle = norm(tempElem.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","// @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 W3CDate,\n getIntlData,\n isValidConfDate,\n showError,\n showWarning,\n} from \"../../core/utils.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};\nconst l10n = getIntlData(localizationStrings);\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 // 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 const { retiredDate } = person;\n if (person.retiredDate) {\n const time = html`<time datetime=\"${retiredDate}\"\n >${W3CDate.format(new Date(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, 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 = \"dini/templates/headers\";\n\nconst ccLicense = \"https://creativecommons.org/licenses/by/4.0/legalcode\";\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 this_version: \"This version:\",\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 },\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 },\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 => {\n return html`<div class=\"head\">\n ${conf.logos.map(showLogo)} ${document.querySelector(\"h1#title\")}\n ${getSpecSubTitleElem(conf)}\n <h2>\n ${conf.textStatus}\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${conf.publishHumanDate}</time\n >\n </h2>\n <dl>\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 ${renderCopyright(conf)}\n <hr />\n </div>`;\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 = 'Please use `<p class=\"copyright\">` instead.';\n showWarning(msg, name, { hint });\n }\n return conf.overrideCopyright\n ? [conf.overrideCopyright]\n : html`<p class=\"copyright\">\n Dieses Dokument ist lizensiert unter\n ${linkLicense(\n \"Creative Commons Attribution 4.0 International Public License\",\n ccLicense,\n \"subfoot\"\n )}.\n </p>`;\n}\n","// @ts-check\n// Module dini/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// - 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// - 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// - 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-sa\"\n// - \"cc-by\"\n// - \"cc0\"\nimport { ISODate, showError } from \"../core/utils.js\";\nimport headersTmpl from \"./templates/headers.js\";\nimport { pub } from \"../core/pubsubhub.js\";\n\nexport const name = \"dini/headers\";\n\nconst DINIDate = new Intl.DateTimeFormat([\"de-DE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: \"2-digit\",\n});\n\nconst status2text = {\n unofficial: \"Entwurf vom\",\n base: \"Spezifikation vom\",\n};\n\n/**\n * @param {*} conf\n * @param {string} prop\n * @param {string | number | Date} fallbackDate\n */\nfunction validateDateAndRecover(conf, prop, fallbackDate = new Date()) {\n const date = conf[prop] ? new Date(conf[prop]) : new Date(fallbackDate);\n // if date is valid\n if (Number.isFinite(date.valueOf())) {\n const formattedDate = ISODate.format(date);\n return new Date(formattedDate);\n }\n const msg =\n `[\\`${prop}\\`](https://github.com/w3c/respec/wiki/${prop}) ` +\n `is not a valid date: \"${conf[prop]}\". Expected format 'YYYY-MM-DD'.`;\n showError(msg, name);\n return new Date(ISODate.format(new Date()));\n}\n\nexport function run(conf) {\n conf.isUnofficial = conf.specStatus === \"unofficial\";\n conf.isBasic = conf.specStatus === \"base\";\n if (!conf.specStatus) {\n const msg = \"Missing required configuration: `specStatus`\";\n showError(msg, name);\n }\n conf.title = document.title || \"Kein Titel\";\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 = DINIDate.format(conf.publishDate);\n const peopCheck = function (it) {\n if (!it.name) {\n const msg = \"All authors and editors must have a name.\";\n showError(msg, name);\n }\n if (it.orcid) {\n try {\n it.orcid = normalizeOrcid(it.orcid);\n } catch (e) {\n const msg = `\"${it.orcid}\" is not an ORCID. ${e.message}`;\n showError(msg, name);\n // A failed orcid link could link to something outside of orcid,\n // which would be misleading.\n delete it.orcid;\n }\n }\n };\n if (!conf.formerEditors) conf.formerEditors = [];\n if (conf.editors) {\n conf.editors.forEach(peopCheck);\n // Move any editors with retiredDate to formerEditors.\n for (let i = 0; i < conf.editors.length; i++) {\n const editor = conf.editors[i];\n if (\"retiredDate\" in editor) {\n conf.formerEditors.push(editor);\n conf.editors.splice(i--, 1);\n }\n }\n }\n if (!conf.editors || conf.editors.length === 0) {\n const msg = \"At least one editor is required\";\n showError(msg, name);\n }\n if (conf.formerEditors.length) {\n conf.formerEditors.forEach(peopCheck);\n }\n if (conf.authors) {\n conf.authors.forEach(peopCheck);\n }\n conf.multipleEditors = conf.editors && conf.editors.length > 1;\n conf.multipleFormerEditors = conf.formerEditors.length > 1;\n conf.multipleAuthors = conf.authors && conf.authors.length > 1;\n (conf.alternateFormats || []).forEach(it => {\n if (!it.uri || !it.label) {\n 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.textStatus = status2text[conf.specStatus];\n conf.dashDate = ISODate.format(conf.publishDate);\n conf.publishISODate = conf.publishDate.toISOString();\n // configuration done - yay!\n\n // insert into document\n const header = headersTmpl(conf);\n document.body.prepend(header);\n document.body.classList.add(\"h-entry\");\n\n // Requested by https://github.com/w3c/respec/issues/504\n // Makes a record of a few auto-generated things.\n pub(\"amend-user-config\", {\n publishISODate: conf.publishISODate,\n generatedSubtitle: `${conf.longStatus} ${conf.publishHumanDate}`,\n });\n}\n\n/**\n * @param {string} orcid Either an ORCID URL or just the 16-digit ID which comes after the /\n * @return {string} the full ORCID URL. Throws an error if the ID is invalid.\n */\nfunction normalizeOrcid(orcid) {\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n if (orcidUrl.origin !== \"https://orcid.org\") {\n throw new Error(\n `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`\n );\n }\n\n // trailing slash would mess up checksum\n const orcidId = orcidUrl.pathname.slice(1).replace(/\\/$/, \"\");\n if (!/^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$/.test(orcidId)) {\n throw new Error(\n `ORCIDs have the format \"1234-1234-1234-1234\", not \"${orcidId}\"`\n );\n }\n\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcidId[orcidId.length - 1];\n const remainder = orcidId\n .split(\"\")\n .slice(0, -1)\n .filter(c => /\\d/.test(c))\n .map(Number)\n .reduce((acc, c) => (acc + c) * 2, 0);\n const lastDigitInt = (12 - (remainder % 11)) % 11;\n const lastDigitShould = lastDigitInt === 10 ? \"X\" : String(lastDigitInt);\n if (lastDigit !== lastDigitShould) {\n throw new Error(`\"${orcidId}\" has an invalid checksum.`);\n }\n\n return orcidUrl.href;\n}\n","// @ts-check\n// Module dini/abstract\n// Handle the abstract section properly.\nimport { getIntlData, showError } from \"../core/utils.js\";\nexport const name = \"dini/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\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\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 {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\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, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\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-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 { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || 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>${text || identifier}</code></a\n >${!text || textArgs ? html`<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 /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = 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 // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\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<BiblioData?>} 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<BiblioData?>} 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 {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\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 {BiblioData} 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 let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\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 // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\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 // 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\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, 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 reference_not_found: \"Reference not found.\",\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 reference_not_found: \"Referencia no encontrada.\",\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 [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PER\", \"W3C Proposed Edited Recommendation\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\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 > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\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} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\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(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\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 /\\bMÜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NÖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDÜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKÖNNEN\\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\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-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}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></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 return html`<a\n data-link-type=\"dfn\"\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\", \"svg\"];\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 dini/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 = \"dini/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 <h1>${l10n.conformance}</h1>\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 {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\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 [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup 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\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\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\n:is(aside,div).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\n:is(aside,div).example {\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}\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\";\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 const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\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 addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\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.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\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\";\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 {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 issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\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 });\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}${\n report.number ? ` ${report.number}` : \"\"\n }`;\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 `<h1>${l10n.issue_summary}</h1>`\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/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#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 allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\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`<h1>Best Practices Summary</h1>`);\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 getPreviousSections,\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`<h1>${l10n.list_of_figures}</h1>`,\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(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\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","// @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 if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\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 if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\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 { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\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 =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\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 return dfnsByType.get(linkType) || 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 (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\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\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 =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\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 getIntlData,\n parents,\n renameElement,\n showError,\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 (\"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, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) 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 const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, 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 ext: \"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 ext: \"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 ext: \"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\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"💾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\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/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","/*\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\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","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\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\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 \"table\": {\n processTable(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 // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\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 processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.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","/* 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-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\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","// @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 commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\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 // 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 if (!conf.excludeGithubLinks) {\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: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\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 * 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,#w3c-state)\");\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 \"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\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\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 \"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\") && conf[key]) || 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"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","subscriptions","EventTarget","pub","topic","detail","dispatchEvent","CustomEvent","parent","self","args","String","JSON","stringify","stack","postMessage","location","origin","sub","cb","options","once","addEventListener","e","removeList","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","wrapFunction","func","IDBDatabase","prototype","transaction","IDBCursor","advance","continue","continuePrimaryKey","includes","apply","unwrap","this","storeNames","tx","call","sort","transformCachableValue","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","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","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","params","paramName","paramValue","test","toLowerCase","getDefaults","baseUrl","breaks","extensions","gfm","headerIds","headerPrefix","highlight","hooks","langPrefix","mangle","pedantic","renderer","sanitize","sanitizer","silent","smartypants","tokenizer","walkTokens","xhtml","defaults","escapeTest","escapeReplace","RegExp","source","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape","encode","unescapeTest","unescape","_","n","charAt","fromCharCode","parseInt","substring","caret","edit","regex","opt","obj","val","getRegex","nonWordAndColonTest","originIndependentUrl","cleanUrl","base","href","prot","decodeURIComponent","indexOf","baseUrls","justDomain","rtrim","relativeBase","protocol","domain","resolveUrl","encodeURI","noopTest","exec","splitCells","tableRow","count","cells","match","offset","str","escaped","curr","split","i","trim","length","pop","splice","push","invert","l","suffLen","currChar","slice","repeatString","pattern","outputLink","cap","link","raw","lexer","title","text","state","inLink","token","type","tokens","inlineTokens","Tokenizer","constructor","space","src","rules","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","node","matchIndentInNode","indentInNode","join","indentCodeCompensation","inline","_escapes","heading","trimmed","depth","hr","blockquote","top","blockTokens","list","istask","ischecked","indent","blankLine","endsWithBlankLine","line","nextLine","rawLine","itemContents","endEarly","bull","isordered","ordered","start","loose","items","itemRegex","t","repeat","trimLeft","search","nextBulletRegex","Math","min","hrRegex","fencesBeginRegex","headingBeginRegex","task","checked","trimRight","spacers","filter","hasMultipleLineBreaks","pre","def","tag","table","item","header","align","rows","j","k","row","lheading","paragraph","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","level","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","lDelim","nextChar","punctuation","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","rDelimAst","rDelimUnd","lastIndex","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","_paragraph","_label","_title","bullet","listItemStart","_tag","_comment","normal","reflinkSearch","out","charCodeAt","random","toString","_punctuation","blockSkip","escapedEmSt","_scheme","_email","_attribute","_href","strong","middle","endAst","endUnd","em","_extended_email","Lexer","Object","create","inlineQueue","static","lex","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","startBlock","startIndex","Infinity","tempSrc","tempStart","forEach","getStartIndex","errMsg","console","keepPrevChar","keys","lastIndexOf","startInline","Renderer$1","infostring","quote","slugger","slug","body","listitem","checkbox","tablerow","content","tablecell","flags","image","TextRenderer","Slugger","seen","serialize","getNextSafeSlug","originalSlug","isDryRun","occurenceAccumulator","hasOwnProperty","dryrun","Parser","Renderer","textRenderer","parse","parseInline","l2","l3","cell","itemBody","ret","renderers","parser","unshift","Hooks","Set","preprocess","markdown","postprocess","parseMarkdown","origOpt","throwError","message","msg","onError","marked","warn","checkSanitizeDeprecation","err","pending","setTimeout","setOptions","newDefaults","use","childTokens","pack","opts","ext","prevRenderer","prevTokenizer","prevHook","passThroughHooks","arg","values","concat","lexInline","globalThis","global","module","pluralizeExports","exports","v","root","pluralize","commonjsGlobal","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","interpolate","arguments","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","defineProperty","r","a","delete","configurable","o","s","WeakSet","add","m","u","insertBefore","selected","selectedIndex","f","querySelectorAll","y","w","x","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","p","g","Array","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","_wire$","defineProperties","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","isArray","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","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","it","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","bind","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","input","subtype","TypeError","parserMode","inputArray","from","position","char","trimEnd","fromEntries","entries","parseMimeType","parameters","essence","mimeType","size","paramStr","key","_pluralize","reindent","lines","indents","leastIndent","getElementsByTagName","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","dateLang","docLang","startsWith","W3CDate","createResourceHint","URL","baseURI","linkElem","rel","hint","corsMode","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","norm","getIntlData","localizationStrings","data","getIntlDataForKey","runTransforms","flist","funcArgs","methods","meth","showWarning","htmlJoinComma","array","joined","addId","pfx","txt","noLC","id","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","ref","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","wrapper","parents","selector","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","super","getCanonicalKey","existingKey","find","makeSafeCopy","clone","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","comment","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","assign","elements","markAsOffending","toJSON","details","showError","pluginName","toMDCode","codedJoinOr","quotes","docLink","strings","endsWith","linkingText","mimeTypes","rsDocToDataURL","format","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$h","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","trimStart","firstTwo","lastTwo","indentation","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","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","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","ev","locationHash","l10n$p","style$1","dataInclude","reindent$1","headers","abstract","dataTransform","dataAbbr","inlines","conformance","examples","issuesNotes","bestPractices","figures","biblio$1","linkToDfn","dataCite","renderBiblio","contrib","sections","fixHeaders","structure","informative","idHeaders","saveHtml","aboutRespec","seo","listSorter","highlightVars$1","dataType","algorithms","anchorExpander","dfnPanel","checkCharset","checkPunctuation","localRefsExist","noHeadinglessSections","noUnusedVars","privsecSection","noHttpProps","ReSpec.run","hash","hasLink","isLegacyFrag","coreDefaults","lint","specStatus","highlightVars","addSectionLinks","licenses","short","diniDefaults","isED","isNoTrack","isPR","logos","prependW3C","doJsonLd","license","shortName","showPreviousVersion","licenseInfo","computeProps","css$f","noReSpecCSS","resourceHints","createResourceHints","createBaseStyle","meta","delimiter","separator","toKeyValuePairs","width","createMetaViewport","styleFile","noToc","attachFixupScript","finalStyleURL","linkURL","urls","frag","reduce","nextLink","linkCSS","exportDoc","w3cStyle","DOMBuilder","current","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","include","includeId","response","fetch","default_title","zh","h1Elem","isConnected","tempElem","documentTitle","isPreview","prNumber","prUrl","github","repoURL","setDocumentTitle","showLink","class","showLinkData","showLogo","logo","alt","height","until","date","es","ko","ja","showPeople","propName","people","validatePerson","person","docsUrl","seePersonHint","preamble","orcid","orcidUrl","orcidId","pathname","lastDigit","lastDigitInt","Number","acc","lastDigitShould","checkOrcidChecksum","retiredDate","rawDate","Date","extras","every","extra","validateExtras","mailto","companyURL","company","personToHTML","personName","editorId","w3cid","contents","hCard","companyElem","note","classVal","renderExtra","time","ccLicense","author","authors","editor","editors","former_editor","former_editors","latest_editors_draft","latest_published_version","this_version","nl","headersTmpl","specSubTitleElem","subtitle","getSpecSubTitleElem","textStatus","dashDate","publishHumanDate","multipleEditors","formerEditors","multipleFormerEditors","multipleAuthors","otherLinks","existingCopyright","overrideCopyright","cssClass","renderCopyright","DINIDate","status2text","unofficial","isUnofficial","isBasic","publishDate","fallbackDate","isFinite","formattedDate","validateDateAndRecover","lastModified","publishYear","getUTCFullYear","peopCheck","normalizeOrcid","alternateFormats","uri","copyrightStart","publishISODate","toISOString","generatedSubtitle","longStatus","abs","abstractHeading","processDfnElement","abbr","fullForm","insertAdjacentHTML","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","identifier","renderParent","nullable","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","reverse","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","unique","now","range","IDBKeyRange","lowerBound","openCursor","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","aliasesAndRefs","alias","reference","promisesToAdd","flatMap","isInDB","put","close","stores","clearStorePromises","clear","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","ok","status","json","oneHourFromNow","addAll","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","etAl","publisher","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","re","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","normativity","keywordInterpretation","processConformance","terms","contains","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","dfnFor","validateDefinition","idl","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","computeExport","export","addContractDefaults","dfnsWithNoType","exportableDfns","titles","pluralizeDfn","dfnTexts","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","css$d","makeTitle","num","report","number","div","inAside","exampleTitle","css$b","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","issueBase","atRiskBase","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","issuesURL","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","hasChildNodes","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","apiBase","issueNumbers","fullName","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","img","naturalHeight","naturalWidth","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","decorateTableOfFigures","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","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","duplicates","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkTargets","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","first","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","xref","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","toHTML","res","maxAge","Request","cache","cachedResponse","caches","clonedResponse","customHeaders","Headers","expiryDate","cacheResponse","Response","blob","fetchAndCache","showContributors","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","prefix","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","Boolean","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","save_snapshot","downloadLinks","epubURL","toDownloadLink","sep","concatDate","filename","saveDialog","supportsDownload","HTMLAnchorElement","about_respec","getEntriesByType","duration","round","perfEntryToTR","firstParagraph","metaElem","css$9","fetchBase","currentScript","workerPromise","workerScript","respecWorker$1","default","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$7","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","outputDoc","css$5","varMap","variables","currentSection","textNode","Text","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","definition","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","file_a_bug","participate","commit_history","props","to","connectedCallback","fetchCommits","commits","commit","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","isRecTrack","saysPrivOrSec","saysConsiderations","offendingMembers","getOwnPropertyNames"],"mappings":"sDACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAAON,OAAOC,QAAQG,QAAQE,EAAI,IAEpCE,QAAQC,IAAIL,GAASM,MAAKC,GAAWR,KAAYQ,IACrD,EACEV,EAAQG,QAAU,GAClBJ,OAAOC,QAAUA,CACnB,CAMO,SAASW,EAAOC,EAAMC,GACtBf,IACHC,OAAOC,QAAQG,QAAQS,GAAQC,EAEnC,CCtBO,MAIDC,EAAgB,IAAIC,YAOnB,SAASC,EAAIC,EAAOC,GAEzB,GADAJ,EAAcK,cAAc,IAAIC,YAAYH,EAAO,CAAEC,YACjDnB,OAAOsB,SAAWtB,OAAOuB,KAC3B,OAGF,MAAMC,EAAOC,OAAOC,KAAKC,UAAUR,GAAQS,OAAST,IACpDnB,OAAOsB,OAAOO,YAAY,CAAEX,QAAOM,QAAQxB,OAAOsB,OAAOQ,SAASC,OACpE,CAWO,SAASC,EAAId,EAAOe,EAA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OAC5B,CAAC,+BAAgC,QACjC,CAAC,sBAAuB,QACxB,CAAC,oBAAqB,UACtB,CAAC,eAAgB,MACjB,CAAC,YAAa,MACd,CAAC,QAAS,QACV3F,SAAQ,SAAU2F,GAClB,OAAOR,EAAU6B,gBAAgBrB,EAAK,GAAIA,EAAK,GACpD,IAKG,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,WACA3F,QAAQmF,EAAU8B,oBAEb9B,CACV,IAGA,IAAIA,GAAYJ,GCjgBsBqC,GAAU,SAASC,GAAgB,IAAIlO,EAAE,CAAE,EAAC,IAAIA,EAAEjP,QAAQA,OAAod,CAA5c,MAAMd,GAAG+P,EAAEjP,QAAQ,SAASiP,EAAE/P,GAAG,IAAIiJ,EAAEjJ,EAAEke,eAAeC,EAAEne,EAAEyY,eAAehN,EAAE2S,EAAEjc,UAAU,OAAOsJ,EAAE4S,OAAO,SAASre,GAAG,OAAO4C,KAAKb,IAAI/B,WAAWA,EAAE4C,KAAKoG,EAAE,EAAEyC,EAAErK,IAAI,SAASpB,GAAG,OAAO4C,KAAKb,IAAI/B,GAAGA,EAAE4C,KAAKoG,QAAG,CAAM,EAAEyC,EAAE1J,IAAI,SAAS/B,GAAG,OAAOme,EAAEpb,KAAK/C,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B,KAAO9W,GACjD,CACH","x_google_ignoreList":[4,5,6,7,9]} \ No newline at end of file +{"version":3,"file":"respec-dini.js","sources":["../src/core/expose-modules.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/l10n.js","../node_modules/idb/build/wrap-idb-value.js","../node_modules/idb/build/index.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/reindent.js","../src/core/utils.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/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/dini.js","../src/core/location-hash.js","../src/core/defaults.js","../src/dini/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/dini/style.js","../src/core/sections.js","../src/core/data-include.js","../src/core/title.js","../src/core/templates/show-link.js","../src/core/templates/show-logo.js","../src/core/templates/show-people.js","../src/dini/templates/headers.js","../src/dini/headers.js","../src/dini/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/dini/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/data-cite.js","../src/core/link-to-dfn.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/ui/save-html.js","../src/ui/about-respec.js","../src/core/seo.js","../src/styles/highlight.css.js","../src/core/text-loader.js","../src/core/worker.js","../src/core/highlight.js","../src/core/list-sorter.js","../src/styles/var.css.js","../src/core/highlight-vars.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/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/github.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.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/no-http-props.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/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\nimport { expose } from \"./expose-modules.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.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, options = { once: false }) {\n const listener = e => cb(e.detail);\n subscriptions.addEventListener(topic, listener, options);\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/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), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\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', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\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 * 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 v4.3.0 - a markdown parser\n * Copyright (c) 2011-2023, 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\nfunction getDefaults() {\n return {\n async: false,\n baseUrl: null,\n breaks: false,\n extensions: null,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n hooks: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: null,\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartypants: false,\n tokenizer: null,\n walkTokens: null,\n xhtml: false\n };\n}\n\nlet defaults = getDefaults();\n\nfunction changeDefaults(newDefaults) {\n defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape(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\n/**\n * @param {string} html\n */\nfunction unescape(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;\n\n/**\n * @param {string | RegExp} regex\n * @param {string} opt\n */\nfunction edit(regex, opt) {\n regex = typeof regex === 'string' ? regex : regex.source;\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;\n\n/**\n * @param {boolean} sanitize\n * @param {string} base\n * @param {string} href\n */\nfunction cleanUrl(sanitize, base, href) {\n if (sanitize) {\n let prot;\n try {\n prot = decodeURIComponent(unescape(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\n/**\n * @param {string} base\n * @param {string} href\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(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 = { exec: function noopTest() {} };\n\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n 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 // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) { cells.shift(); }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) { cells.pop(); }\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/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param {string} str\n * @param {string} c\n * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(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.slice(0, l - suffLen);\n}\n\nfunction findClosingBracket(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(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\n/**\n * @param {string} pattern\n * @param {number} count\n */\nfunction repeatString(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\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape(text)\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 */\nclass Tokenizer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\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().replace(this.rules.inline._escapes, '$1') : 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,\n tokens: this.lexer.inline(text)\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(/^ *>[ \\t]?/gm, '');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine,\n line, nextLine, rawLine, itemContents, endEarly;\n\n let bull = cap[1].trim();\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 bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n\n // Check if current bullet point can start a new List Item\n while (src) {\n endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n\n raw = cap[0];\n src = src.substring(raw.length);\n\n line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n nextLine = src.split('\\n', 1)[0];\n\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimLeft();\n } else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n\n blankLine = false;\n\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n\n // Check if following lines should be included in List Item\n while (src) {\n rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n } else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n\n itemContents += '\\n' + nextLine;\n }\n\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n } else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents\n });\n\n list.raw += raw;\n }\n\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimRight();\n list.items[list.items.length - 1].text = itemContents.trimRight();\n list.raw = list.raw.trimRight();\n\n const l = list.items.length;\n\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (i = 0; i < l; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n\n list.loose = hasMultipleLineBreaks;\n }\n }\n\n // Set all items to loose if list is loose\n if (list.loose) {\n for (i = 0; i < l; i++) {\n list.items[i].loose = true;\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 const token = {\n type: 'html',\n raw: cap[0],\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: cap[0]\n };\n if (this.options.sanitize) {\n const text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);\n token.type = 'paragraph';\n token.text = text;\n token.tokens = this.lexer.inline(text);\n }\n return token;\n }\n }\n\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\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]).map(c => { return { text: c }; }),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n rows: cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').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, j, k, row;\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.rows.length;\n for (i = 0; i < l; i++) {\n item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; });\n }\n\n // parse child tokens inside headers and cells\n\n // header child tokens\n l = item.header.length;\n for (j = 0; j < l; j++) {\n item.header[j].tokens = this.lexer.inline(item.header[j].text);\n }\n\n // cell child tokens\n l = item.rows.length;\n for (j = 0; j < l; j++) {\n row = item.rows[j];\n for (k = 0; k < row.length; k++) {\n row[k].tokens = this.lexer.inline(row[k].text);\n }\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 tokens: this.lexer.inline(cap[1])\n };\n }\n }\n\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\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 tokens: this.lexer.inline(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(cap[1])\n };\n }\n }\n\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n } else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n } else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n\n return {\n type: this.options.sanitize\n ? 'text'\n : 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n text: this.options.sanitize\n ? (this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape(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], this.lexer);\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) {\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], this.lexer);\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 const raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\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(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 tokens: this.lexer.inlineTokens(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(this.options.mangle ? mangle(cap[1]) : cap[1]);\n href = 'mailto:' + text;\n } else {\n text = escape(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(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(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n } else {\n href = cap[0];\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, smartypants) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0];\n } else {\n text = escape(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\n/**\n * Block-Level Grammar\n */\nconst block = {\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}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/,\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][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/,\n table: noopTest,\n lheading: /^((?:.|\\n(?!\\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|table| +\\n)[^\\n]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock._label = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nblock._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock.def = edit(block.def)\n .replace('label', block._label)\n .replace('title', block._title)\n .getRegex();\n\nblock.bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nblock.listItemStart = edit(/^( *)(bull) */)\n .replace('bull', block.bullet)\n .getRegex();\n\nblock.list = edit(block.list)\n .replace(/bull/g, block.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block.def.source + ')')\n .getRegex();\n\nblock._tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'\n + '|track|ul';\nblock._comment = /<!--(?!-?>)[\\s\\S]*?(?:-->|$)/;\nblock.html = edit(block.html, 'i')\n .replace('comment', block._comment)\n .replace('tag', block._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('|table', '')\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._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.blockquote = edit(block.blockquote)\n .replace('paragraph', block.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock.normal = { ...block };\n\n/**\n * GFM Block Grammar\n */\n\nblock.gfm = {\n ...block.normal,\n table: '^ *([^\\\\n ].*\\\\|.*)\\\\n' // Header\n + ' {0,3}(?:\\\\| *)?(:?-+:? *(?:\\\\| *:?-+:? *)*)(?:\\\\| *)?' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)' // Cells\n};\n\nblock.gfm.table = edit(block.gfm.table)\n .replace('hr', block.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._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.gfm.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('table', block.gfm.table) // interrupt paragraphs with table\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._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock.pedantic = {\n ...block.normal,\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', block._comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(block.normal._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n};\n\n/**\n * Inline-Level Grammar\n */\nconst inline = {\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)\\]\\[(ref)\\]/,\n nolink: /^!?\\[(ref)\\](?:\\[\\])?/,\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 orphan inside strong () Consume to delim (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._punctuation = '!\"#$%&\\'()+\\\\-.,/:;<=>?@\\\\[\\\\]`^{|}~';\ninline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();\n\n// sequences em should skip over [title](link), `code`, <html>\ninline.blockSkip = /\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>/g;\n// lookbehind is not available on Safari as of version 16\n// inline.escapedEmSt = /(?<=(?:^|[^\\\\)(?:\\\\[^])*)\\\\[*_]/g;\ninline.escapedEmSt = /(?:^|[^\\\\])(?:\\\\\\\\)*\\\\[*_]/g;\n\ninline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();\n\ninline.emStrong.lDelim = edit(inline.emStrong.lDelim)\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;\ninline.autolink = edit(inline.autolink)\n .replace('scheme', inline._scheme)\n .replace('email', inline._email)\n .getRegex();\n\ninline._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline.tag = edit(inline.tag)\n .replace('comment', inline._comment)\n .replace('attribute', inline._attribute)\n .getRegex();\n\ninline._label = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline._href = /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/;\ninline._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline.link = edit(inline.link)\n .replace('label', inline._label)\n .replace('href', inline._href)\n .replace('title', inline._title)\n .getRegex();\n\ninline.reflink = edit(inline.reflink)\n .replace('label', inline._label)\n .replace('ref', block._label)\n .getRegex();\n\ninline.nolink = edit(inline.nolink)\n .replace('ref', block._label)\n .getRegex();\n\ninline.reflinkSearch = edit(inline.reflinkSearch, 'g')\n .replace('reflink', inline.reflink)\n .replace('nolink', inline.nolink)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline.normal = { ...inline };\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline.pedantic = {\n ...inline.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._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline._label)\n .getRegex()\n};\n\n/**\n * GFM Inline Grammar\n */\n\ninline.gfm = {\n ...inline.normal,\n escape: edit(inline.escape).replace('])', '~|])').getRegex(),\n _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,\n url: /^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\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.gfm.url = edit(inline.gfm.url, 'i')\n .replace('email', inline.gfm._extended_email)\n .getRegex();\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\ninline.breaks = {\n ...inline.gfm,\n br: edit(inline.br).replace('{2,}', '*').getRegex(),\n text: edit(inline.gfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n};\n\n/**\n * smartypants text replacement\n * @param {string} text\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 * @param {string} text\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 */\nclass Lexer {\n constructor(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || defaults;\n this.options.tokenizer = this.options.tokenizer || new Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\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\n this.blockTokens(src, this.tokens);\n\n let next;\n while (next = this.inlineQueue.shift()) {\n this.inlineTokens(next.src, next.tokens);\n }\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n } else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n\n let token, 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({ lexer: 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.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n } else {\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' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 // 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 tokens.push(token);\n continue;\n }\n\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\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 (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else 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({ lexer: 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 (this.state.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 this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 this.state.top = true;\n return tokens;\n }\n\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\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 + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);\n 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({ lexer: 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)) {\n src = src.substring(token.raw.length);\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 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 (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 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 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 (!this.state.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({ lexer: 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, 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\n/**\n * Renderer\n */\nclass Renderer {\n constructor(options) {\n this.options = options || defaults;\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(code, true))\n + '</code></pre>\\n';\n }\n\n return '<pre><code class=\"'\n + this.options.langPrefix\n + escape(lang)\n + '\">'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n /**\n * @param {string} quote\n */\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n\n html(html) {\n return html;\n }\n\n /**\n * @param {string} text\n * @param {string} level\n * @param {string} raw\n * @param {any} slugger\n */\n heading(text, level, raw, slugger) {\n if (this.options.headerIds) {\n const id = this.options.headerPrefix + slugger.slug(raw);\n return `<h${level} id=\"${id}\">${text}</h${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 /**\n * @param {string} text\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 /**\n * @param {string} text\n */\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n\n /**\n * @param {string} header\n * @param {string} body\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 /**\n * @param {string} content\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 /**\n * span level renderer\n * @param {string} text\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n\n /**\n * @param {string} text\n */\n em(text) {\n return `<em>${text}</em>`;\n }\n\n /**\n * @param {string} text\n */\n codespan(text) {\n return `<code>${text}</code>`;\n }\n\n br() {\n return this.options.xhtml ? '<br/>' : '<br>';\n }\n\n /**\n * @param {string} text\n */\n del(text) {\n return `<del>${text}</del>`;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\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=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\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 */\nclass 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 */\nclass Slugger {\n constructor() {\n this.seen = {};\n }\n\n /**\n * @param {string} value\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 * @param {string} originalSlug\n * @param {boolean} isDryRun\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\n * 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\n/**\n * Parsing & Compiling\n */\nclass Parser {\n constructor(options) {\n this.options = options || defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new TextRenderer();\n this.slugger = new Slugger();\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({ parser: 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.header[j].tokens),\n { header: true, align: token.align[j] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n body = '';\n l2 = token.rows.length;\n for (j = 0; j < l2; j++) {\n row = token.rows[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].tokens),\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 === 'paragraph') {\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({ parser: 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\nclass Hooks {\n constructor(options) {\n this.options = options || defaults;\n }\n\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess'\n ]);\n\n /**\n * Process markdown before marked\n */\n preprocess(markdown) {\n return markdown;\n }\n\n /**\n * Process HTML after marked is finished\n */\n postprocess(html) {\n return html;\n }\n}\n\nfunction onError(silent, async, callback) {\n return (e) => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n\n if (silent) {\n const msg = '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n if (async) {\n return Promise.resolve(msg);\n }\n if (callback) {\n callback(null, msg);\n return;\n }\n return msg;\n }\n\n if (async) {\n return Promise.reject(e);\n }\n if (callback) {\n callback(e);\n return;\n }\n throw e;\n };\n}\n\nfunction parseMarkdown(lexer, parser) {\n return (src, opt, callback) => {\n if (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n const origOpt = { ...opt };\n opt = { ...marked.defaults, ...origOpt };\n const throwError = onError(opt.silent, opt.async, callback);\n\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n\n checkSanitizeDeprecation(opt);\n\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n tokens = lexer(src, opt);\n } catch (e) {\n return throwError(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(tokens, opt);\n if (opt.hooks) {\n out = opt.hooks.postprocess(out);\n }\n } catch (e) {\n err = e;\n }\n }\n\n opt.highlight = highlight;\n\n return err\n ? throwError(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 if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.walkTokens ? Promise.all(marked.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n const tokens = lexer(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n } catch (e) {\n return throwError(e);\n }\n };\n}\n\n/**\n * Marked\n */\nfunction marked(src, opt, callback) {\n return parseMarkdown(Lexer.lex, Parser.parse)(src, opt, callback);\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n marked.defaults = { ...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 extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };\n\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n\n // set async to true if it was set to true before\n opts.async = marked.defaults.async || opts.async || false;\n\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\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[ext.name];\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 opts.extensions = extensions;\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 Hooks extensions --== //\n if (pack.hooks) {\n const hooks = marked.defaults.hooks || new Hooks();\n for (const prop in pack.hooks) {\n const prevHook = hooks[prop];\n if (Hooks.passThroughHooks.has(prop)) {\n hooks[prop] = (arg) => {\n if (marked.defaults.async) {\n return Promise.resolve(pack.hooks[prop].call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n\n const ret = pack.hooks[prop].call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n } else {\n hooks[prop] = (...args) => {\n let ret = pack.hooks[prop].apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked.defaults.walkTokens;\n opts.walkTokens = function(token) {\n let values = [];\n values.push(pack.walkTokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n\n marked.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(marked, token));\n switch (token.type) {\n case 'table': {\n for (const cell of token.header) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n for (const row of token.rows) {\n for (const cell of row) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n values = values.concat(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 values = values.concat(marked.walkTokens(token[childTokens], callback));\n });\n } else if (token.tokens) {\n values = values.concat(marked.walkTokens(token.tokens, callback));\n }\n }\n }\n }\n return values;\n};\n\n/**\n * Parse Inline\n * @param {string} src\n */\nmarked.parseInline = parseMarkdown(Lexer.lexInline, Parser.parseInline);\n\n/**\n * Expose\n */\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\nmarked.Tokenizer = Tokenizer;\nmarked.Slugger = Slugger;\nmarked.Hooks = Hooks;\nmarked.parse = marked;\n\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = Parser.parse;\nconst lexer = Lexer.lex;\n\nexport { Hooks, Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\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 pluralizeExports = {};\nvar pluralize$1 = {\n get exports(){ return pluralizeExports; },\n set exports(v){ pluralizeExports = v; },\n};\n\n/* global define */\n\n(function (module, exports) {\n\t(function (root, pluralize) {\n\t /* istanbul ignore else */\n\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t // Node.\n\t module.exports = pluralize();\n\t } else {\n\t // Browser global.\n\t root.pluralize = pluralize();\n\t }\n\t})(commonjsGlobal, function () {\n\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t // while other rules can be optimized using an object for instant lookups.\n\t var pluralRules = [];\n\t var singularRules = [];\n\t var uncountables = {};\n\t var irregularPlurals = {};\n\t var irregularSingles = {};\n\n\t /**\n\t * Sanitize a pluralization rule to a usable regular expression.\n\t *\n\t * @param {(RegExp|string)} rule\n\t * @return {RegExp}\n\t */\n\t function sanitizeRule (rule) {\n\t if (typeof rule === 'string') {\n\t return new RegExp('^' + rule + '$', 'i');\n\t }\n\n\t return rule;\n\t }\n\n\t /**\n\t * Pass in a word token to produce a function that can replicate the case on\n\t * another word.\n\t *\n\t * @param {string} word\n\t * @param {string} token\n\t * @return {Function}\n\t */\n\t function restoreCase (word, token) {\n\t // Tokens are an exact match.\n\t if (word === token) return token;\n\n\t // Lower cased words. E.g. \"hello\".\n\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t // Upper cased words. E.g. \"WHISKY\".\n\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t // Title cased words. E.g. \"Title\".\n\t if (word[0] === word[0].toUpperCase()) {\n\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t }\n\n\t // Lower cased words. E.g. \"test\".\n\t return token.toLowerCase();\n\t }\n\n\t /**\n\t * Interpolate a regexp string.\n\t *\n\t * @param {string} str\n\t * @param {Array} args\n\t * @return {string}\n\t */\n\t function interpolate (str, args) {\n\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t return args[index] || '';\n\t });\n\t }\n\n\t /**\n\t * Replace a word using a rule.\n\t *\n\t * @param {string} word\n\t * @param {Array} rule\n\t * @return {string}\n\t */\n\t function replace (word, rule) {\n\t return word.replace(rule[0], function (match, index) {\n\t var result = interpolate(rule[1], arguments);\n\n\t if (match === '') {\n\t return restoreCase(word[index - 1], result);\n\t }\n\n\t return restoreCase(match, result);\n\t });\n\t }\n\n\t /**\n\t * Sanitize a word by passing in the word and sanitization rules.\n\t *\n\t * @param {string} token\n\t * @param {string} word\n\t * @param {Array} rules\n\t * @return {string}\n\t */\n\t function sanitizeWord (token, word, rules) {\n\t // Empty string or doesn't need fixing.\n\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t return word;\n\t }\n\n\t var len = rules.length;\n\n\t // Iterate over the sanitization rules and use the first one to match.\n\t while (len--) {\n\t var rule = rules[len];\n\n\t if (rule[0].test(word)) return replace(word, rule);\n\t }\n\n\t return word;\n\t }\n\n\t /**\n\t * Replace a word with the updated word.\n\t *\n\t * @param {Object} replaceMap\n\t * @param {Object} keepMap\n\t * @param {Array} rules\n\t * @return {Function}\n\t */\n\t function replaceWord (replaceMap, keepMap, rules) {\n\t return function (word) {\n\t // Get the correct token and case restoration functions.\n\t var token = word.toLowerCase();\n\n\t // Check against the keep object map.\n\t if (keepMap.hasOwnProperty(token)) {\n\t return restoreCase(word, token);\n\t }\n\n\t // Check against the replacement map for a direct word replacement.\n\t if (replaceMap.hasOwnProperty(token)) {\n\t return restoreCase(word, replaceMap[token]);\n\t }\n\n\t // Run all the rules against the word.\n\t return sanitizeWord(token, word, rules);\n\t };\n\t }\n\n\t /**\n\t * Check if a word is part of the map.\n\t */\n\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t return function (word) {\n\t var token = word.toLowerCase();\n\n\t if (keepMap.hasOwnProperty(token)) return true;\n\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t return sanitizeWord(token, token, rules) === token;\n\t };\n\t }\n\n\t /**\n\t * Pluralize or singularize a word based on the passed in count.\n\t *\n\t * @param {string} word The word to pluralize\n\t * @param {number} count How many of the word exist\n\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t * @return {string}\n\t */\n\t function pluralize (word, count, inclusive) {\n\t var pluralized = count === 1\n\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t return (inclusive ? count + ' ' : '') + pluralized;\n\t }\n\n\t /**\n\t * Pluralize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.plural = replaceWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Check if a word is plural.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isPlural = checkWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Singularize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.singular = replaceWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Check if a word is singular.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isSingular = checkWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Add a pluralization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addPluralRule = function (rule, replacement) {\n\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add a singularization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addSingularRule = function (rule, replacement) {\n\t singularRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add an uncountable word rule.\n\t *\n\t * @param {(string|RegExp)} word\n\t */\n\t pluralize.addUncountableRule = function (word) {\n\t if (typeof word === 'string') {\n\t uncountables[word.toLowerCase()] = true;\n\t return;\n\t }\n\n\t // Set singular and plural references for the word.\n\t pluralize.addPluralRule(word, '$0');\n\t pluralize.addSingularRule(word, '$0');\n\t };\n\n\t /**\n\t * Add an irregular word definition.\n\t *\n\t * @param {string} single\n\t * @param {string} plural\n\t */\n\t pluralize.addIrregularRule = function (single, plural) {\n\t plural = plural.toLowerCase();\n\t single = single.toLowerCase();\n\n\t irregularSingles[single] = plural;\n\t irregularPlurals[plural] = single;\n\t };\n\n\t /**\n\t * Irregular rules.\n\t */\n\t [\n\t // Pronouns.\n\t ['I', 'we'],\n\t ['me', 'us'],\n\t ['he', 'they'],\n\t ['she', 'they'],\n\t ['them', 'them'],\n\t ['myself', 'ourselves'],\n\t ['yourself', 'yourselves'],\n\t ['itself', 'themselves'],\n\t ['herself', 'themselves'],\n\t ['himself', 'themselves'],\n\t ['themself', 'themselves'],\n\t ['is', 'are'],\n\t ['was', 'were'],\n\t ['has', 'have'],\n\t ['this', 'these'],\n\t ['that', 'those'],\n\t // Words ending in with a consonant and `o`.\n\t ['echo', 'echoes'],\n\t ['dingo', 'dingoes'],\n\t ['volcano', 'volcanoes'],\n\t ['tornado', 'tornadoes'],\n\t ['torpedo', 'torpedoes'],\n\t // Ends with `us`.\n\t ['genus', 'genera'],\n\t ['viscus', 'viscera'],\n\t // Ends with `ma`.\n\t ['stigma', 'stigmata'],\n\t ['stoma', 'stomata'],\n\t ['dogma', 'dogmata'],\n\t ['lemma', 'lemmata'],\n\t ['schema', 'schemata'],\n\t ['anathema', 'anathemata'],\n\t // Other irregular rules.\n\t ['ox', 'oxen'],\n\t ['axe', 'axes'],\n\t ['die', 'dice'],\n\t ['yes', 'yeses'],\n\t ['foot', 'feet'],\n\t ['eave', 'eaves'],\n\t ['goose', 'geese'],\n\t ['tooth', 'teeth'],\n\t ['quiz', 'quizzes'],\n\t ['human', 'humans'],\n\t ['proof', 'proofs'],\n\t ['carve', 'carves'],\n\t ['valve', 'valves'],\n\t ['looey', 'looies'],\n\t ['thief', 'thieves'],\n\t ['groove', 'grooves'],\n\t ['pickaxe', 'pickaxes'],\n\t ['passerby', 'passersby']\n\t ].forEach(function (rule) {\n\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Pluralization rules.\n\t */\n\t [\n\t [/s?$/i, 's'],\n\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t [/([^aeiou]ese)$/i, '$1'],\n\t [/(ax|test)is$/i, '$1es'],\n\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t [/(e[mn]u)s?$/i, '$1s'],\n\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t [/(her|at|gr)o$/i, '$1oes'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t [/sis$/i, 'ses'],\n\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t [/(child)(?:ren)?$/i, '$1ren'],\n\t [/eaux$/i, '$0'],\n\t [/m[ae]n$/i, 'men'],\n\t ['thou', 'you']\n\t ].forEach(function (rule) {\n\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Singularization rules.\n\t */\n\t [\n\t [/s$/i, ''],\n\t [/(ss)$/i, '$1'],\n\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t [/ies$/i, 'y'],\n\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t [/(seraph|cherub)im$/i, '$1'],\n\t [/(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\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t [/(test)(?:is|es)$/i, '$1is'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t [/(matr|append)ices$/i, '$1ix'],\n\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t [/(child)ren$/i, '$1'],\n\t [/(eau)x?$/i, '$1'],\n\t [/men$/i, 'man']\n\t ].forEach(function (rule) {\n\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Uncountable rules.\n\t */\n\t [\n\t // Singular words with no plurals.\n\t 'adulthood',\n\t 'advice',\n\t 'agenda',\n\t 'aid',\n\t 'aircraft',\n\t 'alcohol',\n\t 'ammo',\n\t 'analytics',\n\t 'anime',\n\t 'athletics',\n\t 'audio',\n\t 'bison',\n\t 'blood',\n\t 'bream',\n\t 'buffalo',\n\t 'butter',\n\t 'carp',\n\t 'cash',\n\t 'chassis',\n\t 'chess',\n\t 'clothing',\n\t 'cod',\n\t 'commerce',\n\t 'cooperation',\n\t 'corps',\n\t 'debris',\n\t 'diabetes',\n\t 'digestion',\n\t 'elk',\n\t 'energy',\n\t 'equipment',\n\t 'excretion',\n\t 'expertise',\n\t 'firmware',\n\t 'flounder',\n\t 'fun',\n\t 'gallows',\n\t 'garbage',\n\t 'graffiti',\n\t 'hardware',\n\t 'headquarters',\n\t 'health',\n\t 'herpes',\n\t 'highjinks',\n\t 'homework',\n\t 'housework',\n\t 'information',\n\t 'jeans',\n\t 'justice',\n\t 'kudos',\n\t 'labour',\n\t 'literature',\n\t 'machinery',\n\t 'mackerel',\n\t 'mail',\n\t 'media',\n\t 'mews',\n\t 'moose',\n\t 'music',\n\t 'mud',\n\t 'manga',\n\t 'news',\n\t 'only',\n\t 'personnel',\n\t 'pike',\n\t 'plankton',\n\t 'pliers',\n\t 'police',\n\t 'pollution',\n\t 'premises',\n\t 'rain',\n\t 'research',\n\t 'rice',\n\t 'salmon',\n\t 'scissors',\n\t 'series',\n\t 'sewage',\n\t 'shambles',\n\t 'shrimp',\n\t 'software',\n\t 'species',\n\t 'staff',\n\t 'swine',\n\t 'tennis',\n\t 'traffic',\n\t 'transportation',\n\t 'trout',\n\t 'tuna',\n\t 'wealth',\n\t 'welfare',\n\t 'whiting',\n\t 'wildebeest',\n\t 'wildlife',\n\t 'you',\n\t /pok[eé]mon$/i,\n\t // Regexes.\n\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t /deer$/i, // \"deer\", \"reindeer\"\n\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t /measles$/i,\n\t /o[iu]s$/i, // \"carnivorous\"\n\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t /sheep$/i\n\t ].forEach(pluralize.addUncountableRule);\n\n\t return pluralize;\n\t});\n} (pluralize$1));\n\nvar pluralize = pluralizeExports;\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/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _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\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\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// 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\";\nimport { reindent } from \"./reindent.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\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\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 if (opts.corsMode) {\n linkElem.crossOrigin = opts.corsMode;\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 * @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 = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || 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/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\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 * 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 * @param {Element} element\n */\nexport function 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/**\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 const linkifiedStr = 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 return reindent(linkifiedStr);\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 */\nimport { serialize } from \"../core/exporter.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","// @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\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\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 padding: 0.2em 0em;\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 will-change: opacity;\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 {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\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 font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.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-warning-list > li::before {\n content: \"⚠️\";\n}\n\n.respec-error-list > li::before {\n content: \"💥\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\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 top: 10%;\n background: #fff;\n border: 5px solid #666;\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\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-menu button.respec-option {\n background: white;\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 background-color: #eeeeee;\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\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\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\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 */\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;\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 image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\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\nconst config = {\n sanitize: false,\n gfm: true,\n headerIds: false,\n langPrefix: \"\",\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\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\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\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\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 processMDSections(document.body);\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 // Frankenstein the whole thing back together\n newBody.append(rsUI);\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 { markdownToHtml } from \"./markdown.js\";\nimport { reindent } from \"./reindent.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\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${err.message}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\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/dini/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/dini/style.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/dini/headers.js\"),\n import(\"../src/dini/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/dini/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/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.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/ui/save-html.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/core/highlight.js\"),\n import(\"../src/core/list-sorter.js\"),\n import(\"../src/core/highlight-vars.js\"),\n import(\"../src/core/data-type.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n import(\"../src/core/custom-elements/index.js\"),\n /* Linter 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/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/no-http-props.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 * 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 DINI specs\n */\nexport const name = \"dini/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\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 \"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 \"cc-by-sa\",\n {\n name: \"Creative Commons Attribution-ShareAlike 4.0 International Public License\",\n short: \"CC-BY-SA\",\n url: \"https://creativecommons.org/licenses/by-sa/4.0/legalcode\",\n },\n ],\n]);\n\nconst diniDefaults = {\n format: \"markdown\",\n isED: false,\n isNoTrack: true,\n isPR: false,\n lint: {\n \"privsec-section\": true,\n \"wpt-tests-exist\": false,\n },\n logos: [],\n prependW3C: false,\n doJsonLd: false,\n license: \"cc-by\",\n shortName: \"X\",\n showPreviousVersion: false,\n};\n\nfunction computeProps(conf) {\n return {\n licenseInfo: licenses.get(conf.license),\n };\n}\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...diniDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...diniDefaults,\n ...conf,\n lint,\n });\n\n // computed properties\n Object.assign(conf, computeProps(conf));\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/* --- INLINES --- */\n:is(h1, h2, h3, h4, h5, h6, a) 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\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\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\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 dini/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 = \"dini/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 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 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 = \"\";\n\n // Figure out which style file to use.\n switch (conf.specStatus.toUpperCase()) {\n case \"UNOFFICIAL\":\n styleFile = \"W3C-UD\";\n break;\n case \"BASE\":\n styleFile = \"base.css\";\n break;\n }\n\n // Attach W3C fixup script after we are done.\n if (!conf.noToc) {\n sub(\n \"end-all\",\n () => {\n attachFixupScript(document, \"2016\");\n },\n { once: true }\n );\n }\n const finalStyleURL = `https://www.w3.org/StyleSheets/TR/2016/${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","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\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) {\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(structure(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/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\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\nexport function run() {\n restructure(document.body);\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 { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.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 await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\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()).slice(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 if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\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 // We replace \":<br>\" with \":\", and \"<br>\" with \"-\", as appropriate.\n const tempElem = document.createElement(\"h1\");\n tempElem.innerHTML = h1Elem.innerHTML\n .replace(/:<br>/g, \": \")\n .replace(/<br>/g, \" - \");\n let documentTitle = norm(tempElem.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","// @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 W3CDate,\n getIntlData,\n isValidConfDate,\n showError,\n showWarning,\n} from \"../../core/utils.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};\nconst l10n = getIntlData(localizationStrings);\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 // 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 const { retiredDate } = person;\n if (person.retiredDate) {\n const time = html`<time datetime=\"${retiredDate}\"\n >${W3CDate.format(new Date(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, 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 = \"dini/templates/headers\";\n\nconst ccLicense = \"https://creativecommons.org/licenses/by/4.0/legalcode\";\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 this_version: \"This version:\",\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 },\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 },\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 => {\n return html`<div class=\"head\">\n ${conf.logos.map(showLogo)} ${document.querySelector(\"h1#title\")}\n ${getSpecSubTitleElem(conf)}\n <h2>\n ${conf.textStatus}\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${conf.publishHumanDate}</time\n >\n </h2>\n <dl>\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 ${renderCopyright(conf)}\n <hr />\n </div>`;\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 = 'Please use `<p class=\"copyright\">` instead.';\n showWarning(msg, name, { hint });\n }\n return conf.overrideCopyright\n ? [conf.overrideCopyright]\n : html`<p class=\"copyright\">\n Dieses Dokument ist lizensiert unter\n ${linkLicense(\n \"Creative Commons Attribution 4.0 International Public License\",\n ccLicense,\n \"subfoot\"\n )}.\n </p>`;\n}\n","// @ts-check\n// Module dini/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// - 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// - 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// - 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-sa\"\n// - \"cc-by\"\n// - \"cc0\"\nimport { ISODate, showError } from \"../core/utils.js\";\nimport headersTmpl from \"./templates/headers.js\";\nimport { pub } from \"../core/pubsubhub.js\";\n\nexport const name = \"dini/headers\";\n\nconst DINIDate = new Intl.DateTimeFormat([\"de-DE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: \"2-digit\",\n});\n\nconst status2text = {\n unofficial: \"Entwurf vom\",\n base: \"Spezifikation vom\",\n};\n\n/**\n * @param {*} conf\n * @param {string} prop\n * @param {string | number | Date} fallbackDate\n */\nfunction validateDateAndRecover(conf, prop, fallbackDate = new Date()) {\n const date = conf[prop] ? new Date(conf[prop]) : new Date(fallbackDate);\n // if date is valid\n if (Number.isFinite(date.valueOf())) {\n const formattedDate = ISODate.format(date);\n return new Date(formattedDate);\n }\n const msg =\n `[\\`${prop}\\`](https://github.com/w3c/respec/wiki/${prop}) ` +\n `is not a valid date: \"${conf[prop]}\". Expected format 'YYYY-MM-DD'.`;\n showError(msg, name);\n return new Date(ISODate.format(new Date()));\n}\n\nexport function run(conf) {\n conf.isUnofficial = conf.specStatus === \"unofficial\";\n conf.isBasic = conf.specStatus === \"base\";\n if (!conf.specStatus) {\n const msg = \"Missing required configuration: `specStatus`\";\n showError(msg, name);\n }\n conf.title = document.title || \"Kein Titel\";\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 = DINIDate.format(conf.publishDate);\n const peopCheck = function (it) {\n if (!it.name) {\n const msg = \"All authors and editors must have a name.\";\n showError(msg, name);\n }\n if (it.orcid) {\n try {\n it.orcid = normalizeOrcid(it.orcid);\n } catch (e) {\n const msg = `\"${it.orcid}\" is not an ORCID. ${e.message}`;\n showError(msg, name);\n // A failed orcid link could link to something outside of orcid,\n // which would be misleading.\n delete it.orcid;\n }\n }\n };\n if (!conf.formerEditors) conf.formerEditors = [];\n if (conf.editors) {\n conf.editors.forEach(peopCheck);\n // Move any editors with retiredDate to formerEditors.\n for (let i = 0; i < conf.editors.length; i++) {\n const editor = conf.editors[i];\n if (\"retiredDate\" in editor) {\n conf.formerEditors.push(editor);\n conf.editors.splice(i--, 1);\n }\n }\n }\n if (!conf.editors || conf.editors.length === 0) {\n const msg = \"At least one editor is required\";\n showError(msg, name);\n }\n if (conf.formerEditors.length) {\n conf.formerEditors.forEach(peopCheck);\n }\n if (conf.authors) {\n conf.authors.forEach(peopCheck);\n }\n conf.multipleEditors = conf.editors && conf.editors.length > 1;\n conf.multipleFormerEditors = conf.formerEditors.length > 1;\n conf.multipleAuthors = conf.authors && conf.authors.length > 1;\n (conf.alternateFormats || []).forEach(it => {\n if (!it.uri || !it.label) {\n 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.textStatus = status2text[conf.specStatus];\n conf.dashDate = ISODate.format(conf.publishDate);\n conf.publishISODate = conf.publishDate.toISOString();\n // configuration done - yay!\n\n // insert into document\n const header = headersTmpl(conf);\n document.body.prepend(header);\n document.body.classList.add(\"h-entry\");\n\n // Requested by https://github.com/w3c/respec/issues/504\n // Makes a record of a few auto-generated things.\n pub(\"amend-user-config\", {\n publishISODate: conf.publishISODate,\n generatedSubtitle: `${conf.longStatus} ${conf.publishHumanDate}`,\n });\n}\n\n/**\n * @param {string} orcid Either an ORCID URL or just the 16-digit ID which comes after the /\n * @return {string} the full ORCID URL. Throws an error if the ID is invalid.\n */\nfunction normalizeOrcid(orcid) {\n const orcidUrl = new URL(orcid, \"https://orcid.org/\");\n if (orcidUrl.origin !== \"https://orcid.org\") {\n throw new Error(\n `The origin should be \"https://orcid.org\", not \"${orcidUrl.origin}\".`\n );\n }\n\n // trailing slash would mess up checksum\n const orcidId = orcidUrl.pathname.slice(1).replace(/\\/$/, \"\");\n if (!/^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$/.test(orcidId)) {\n throw new Error(\n `ORCIDs have the format \"1234-1234-1234-1234\", not \"${orcidId}\"`\n );\n }\n\n // calculate checksum as per https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier\n const lastDigit = orcidId[orcidId.length - 1];\n const remainder = orcidId\n .split(\"\")\n .slice(0, -1)\n .filter(c => /\\d/.test(c))\n .map(Number)\n .reduce((acc, c) => (acc + c) * 2, 0);\n const lastDigitInt = (12 - (remainder % 11)) % 11;\n const lastDigitShould = lastDigitInt === 10 ? \"X\" : String(lastDigitInt);\n if (lastDigit !== lastDigitShould) {\n throw new Error(`\"${orcidId}\" has an invalid checksum.`);\n }\n\n return orcidUrl.href;\n}\n","// @ts-check\n// Module dini/abstract\n// Handle the abstract section properly.\nimport { getIntlData, showError } from \"../core/utils.js\";\nexport const name = \"dini/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\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\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 {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\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, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\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-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 { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || 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>${text || identifier}</code></a\n >${!text || textArgs ? html`<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 /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = 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 // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\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<BiblioData?>} 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<BiblioData?>} 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 {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\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 {BiblioData} 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 let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\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 // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\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 // 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\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, 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 reference_not_found: \"Reference not found.\",\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 reference_not_found: \"Referencia no encontrada.\",\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 [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PER\", \"W3C Proposed Edited Recommendation\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\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 > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\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} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\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(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\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 /\\bMÜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NÖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDÜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKÖNNEN\\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\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-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}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></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 return html`<a\n data-link-type=\"dfn\"\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\", \"svg\"];\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 dini/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 = \"dini/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 <h1>${l10n.conformance}</h1>\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 {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\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 [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup 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\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\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\n:is(aside,div).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\n:is(aside,div).example {\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}\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\";\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 const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\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 addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\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.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\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\";\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 {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 issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\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 });\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}${\n report.number ? ` ${report.number}` : \"\"\n }`;\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 `<h1>${l10n.issue_summary}</h1>`\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/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#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 allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\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`<h1>Best Practices Summary</h1>`);\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 getPreviousSections,\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`<h1>${l10n.list_of_figures}</h1>`,\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(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\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 // Don't add width and height to SVGs\n // https://github.com/w3c/respec/issues/3435\n if (img.src.startsWith(\"data:image/svg+xml;\")) return;\n if (img.src.endsWith(\".svg\")) return;\n\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n\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","// @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 if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\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 if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\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 { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\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 =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\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 return dfnsByType.get(linkType) || 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 (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\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\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 =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\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 getIntlData,\n parents,\n renameElement,\n showError,\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 (\"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, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) 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 const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, 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 ext: \"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 ext: \"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 ext: \"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\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"💾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\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/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","/*\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\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","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\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\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 \"table\": {\n processTable(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 // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\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 processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.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","/* 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-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\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","// @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 commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\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 // 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 if (!conf.excludeGithubLinks) {\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: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\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 * 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,#w3c-state)\");\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 \"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\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\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 \"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\") && conf[key]) || 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"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","subscriptions","EventTarget","pub","topic","detail","dispatchEvent","CustomEvent","parent","self","args","String","JSON","stringify","stack","postMessage","location","origin","sub","cb","options","once","addEventListener","e","removeList","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","wrapFunction","func","IDBDatabase","prototype","transaction","IDBCursor","advance","continue","continuePrimaryKey","includes","apply","unwrap","this","storeNames","tx","call","sort","transformCachableValue","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","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","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","params","paramName","paramValue","test","toLowerCase","getDefaults","baseUrl","breaks","extensions","gfm","headerIds","headerPrefix","highlight","hooks","langPrefix","mangle","pedantic","renderer","sanitize","sanitizer","silent","smartypants","tokenizer","walkTokens","xhtml","defaults","escapeTest","escapeReplace","RegExp","source","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape","encode","unescapeTest","unescape","_","n","charAt","fromCharCode","parseInt","substring","caret","edit","regex","opt","obj","val","getRegex","nonWordAndColonTest","originIndependentUrl","cleanUrl","base","href","prot","decodeURIComponent","indexOf","baseUrls","justDomain","rtrim","relativeBase","protocol","domain","resolveUrl","encodeURI","noopTest","exec","splitCells","tableRow","count","cells","match","offset","str","escaped","curr","split","i","trim","length","pop","splice","push","invert","l","suffLen","currChar","slice","repeatString","pattern","outputLink","cap","link","raw","lexer","title","text","state","inLink","token","type","tokens","inlineTokens","Tokenizer","constructor","space","src","rules","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","node","matchIndentInNode","indentInNode","join","indentCodeCompensation","inline","_escapes","heading","trimmed","depth","hr","blockquote","top","blockTokens","list","istask","ischecked","indent","blankLine","endsWithBlankLine","line","nextLine","rawLine","itemContents","endEarly","bull","isordered","ordered","start","loose","items","itemRegex","t","repeat","trimLeft","search","nextBulletRegex","Math","min","hrRegex","fencesBeginRegex","headingBeginRegex","task","checked","trimRight","spacers","filter","hasMultipleLineBreaks","pre","def","tag","table","item","header","align","rows","j","k","row","lheading","paragraph","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","level","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","lDelim","nextChar","punctuation","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","rDelimAst","rDelimUnd","lastIndex","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","_paragraph","_label","_title","bullet","listItemStart","_tag","_comment","normal","reflinkSearch","out","charCodeAt","random","toString","_punctuation","blockSkip","escapedEmSt","_scheme","_email","_attribute","_href","strong","middle","endAst","endUnd","em","_extended_email","Lexer","Object","create","inlineQueue","static","lex","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","startBlock","startIndex","Infinity","tempSrc","tempStart","forEach","getStartIndex","errMsg","console","keepPrevChar","keys","lastIndexOf","startInline","Renderer$1","infostring","quote","slugger","slug","body","listitem","checkbox","tablerow","content","tablecell","flags","image","TextRenderer","Slugger","seen","serialize","getNextSafeSlug","originalSlug","isDryRun","occurenceAccumulator","hasOwnProperty","dryrun","Parser","Renderer","textRenderer","parse","parseInline","l2","l3","cell","itemBody","ret","renderers","parser","unshift","Hooks","Set","preprocess","markdown","postprocess","parseMarkdown","origOpt","throwError","message","msg","onError","marked","warn","checkSanitizeDeprecation","err","pending","setTimeout","setOptions","newDefaults","use","childTokens","pack","opts","ext","prevRenderer","prevTokenizer","prevHook","passThroughHooks","arg","values","concat","lexInline","globalThis","global","module","pluralizeExports","exports","v","root","pluralize","commonjsGlobal","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","interpolate","arguments","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","defineProperty","r","a","delete","configurable","o","s","WeakSet","add","m","u","insertBefore","selected","selectedIndex","f","querySelectorAll","y","w","x","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","p","g","Array","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","_wire$","defineProperties","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","isArray","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","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","it","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","bind","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","input","subtype","TypeError","parserMode","inputArray","from","position","char","trimEnd","fromEntries","entries","parseMimeType","parameters","essence","mimeType","size","paramStr","key","_pluralize","reindent","lines","indents","leastIndent","getElementsByTagName","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","dateLang","docLang","startsWith","W3CDate","createResourceHint","URL","baseURI","linkElem","rel","hint","corsMode","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","norm","getIntlData","localizationStrings","data","getIntlDataForKey","runTransforms","flist","funcArgs","methods","meth","showWarning","htmlJoinComma","array","joined","addId","pfx","txt","noLC","id","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","ref","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","wrapper","parents","selector","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","super","getCanonicalKey","existingKey","find","makeSafeCopy","clone","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","comment","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","assign","elements","markAsOffending","toJSON","details","showError","pluginName","toMDCode","codedJoinOr","quotes","docLink","strings","endsWith","linkingText","mimeTypes","rsDocToDataURL","format","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$h","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","trimStart","firstTwo","lastTwo","indentation","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","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","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","ev","locationHash","l10n$p","style$1","dataInclude","reindent$1","headers","abstract","dataTransform","dataAbbr","inlines","conformance","examples","issuesNotes","bestPractices","figures","biblio$1","linkToDfn","dataCite","renderBiblio","contrib","sections","fixHeaders","structure","informative","idHeaders","saveHtml","aboutRespec","seo","listSorter","highlightVars$1","dataType","algorithms","anchorExpander","dfnPanel","checkCharset","checkPunctuation","localRefsExist","noHeadinglessSections","noUnusedVars","privsecSection","noHttpProps","ReSpec.run","hash","hasLink","isLegacyFrag","coreDefaults","lint","specStatus","highlightVars","addSectionLinks","licenses","short","diniDefaults","isED","isNoTrack","isPR","logos","prependW3C","doJsonLd","license","shortName","showPreviousVersion","licenseInfo","computeProps","css$f","noReSpecCSS","resourceHints","createResourceHints","createBaseStyle","meta","delimiter","separator","toKeyValuePairs","width","createMetaViewport","styleFile","noToc","attachFixupScript","finalStyleURL","linkURL","urls","frag","reduce","nextLink","linkCSS","exportDoc","w3cStyle","DOMBuilder","current","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","include","includeId","response","fetch","default_title","zh","h1Elem","isConnected","tempElem","documentTitle","isPreview","prNumber","prUrl","github","repoURL","setDocumentTitle","showLink","class","showLinkData","showLogo","logo","alt","height","until","date","es","ko","ja","showPeople","propName","people","validatePerson","person","docsUrl","seePersonHint","preamble","orcid","orcidUrl","orcidId","pathname","lastDigit","lastDigitInt","Number","acc","lastDigitShould","checkOrcidChecksum","retiredDate","rawDate","Date","extras","every","extra","validateExtras","mailto","companyURL","company","personToHTML","personName","editorId","w3cid","contents","hCard","companyElem","note","classVal","renderExtra","time","ccLicense","author","authors","editor","editors","former_editor","former_editors","latest_editors_draft","latest_published_version","this_version","nl","headersTmpl","specSubTitleElem","subtitle","getSpecSubTitleElem","textStatus","dashDate","publishHumanDate","multipleEditors","formerEditors","multipleFormerEditors","multipleAuthors","otherLinks","existingCopyright","overrideCopyright","cssClass","renderCopyright","DINIDate","status2text","unofficial","isUnofficial","isBasic","publishDate","fallbackDate","isFinite","formattedDate","validateDateAndRecover","lastModified","publishYear","getUTCFullYear","peopCheck","normalizeOrcid","alternateFormats","uri","copyrightStart","publishISODate","toISOString","generatedSubtitle","longStatus","abs","abstractHeading","processDfnElement","abbr","fullForm","insertAdjacentHTML","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","identifier","renderParent","nullable","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","reverse","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","unique","now","range","IDBKeyRange","lowerBound","openCursor","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","aliasesAndRefs","alias","reference","promisesToAdd","flatMap","isInDB","put","close","stores","clearStorePromises","clear","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","ok","status","json","oneHourFromNow","addAll","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","etAl","publisher","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","re","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","normativity","keywordInterpretation","processConformance","terms","contains","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","dfnFor","validateDefinition","idl","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","computeExport","export","addContractDefaults","dfnsWithNoType","exportableDfns","titles","pluralizeDfn","dfnTexts","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","css$d","makeTitle","num","report","number","div","inAside","exampleTitle","css$b","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","issueBase","atRiskBase","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","issuesURL","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","hasChildNodes","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","apiBase","issueNumbers","fullName","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","img","naturalHeight","naturalWidth","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","decorateTableOfFigures","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","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","duplicates","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkTargets","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","first","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","xref","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","toHTML","res","maxAge","Request","cache","cachedResponse","caches","clonedResponse","customHeaders","Headers","expiryDate","cacheResponse","Response","blob","fetchAndCache","showContributors","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","prefix","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","Boolean","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","save_snapshot","downloadLinks","epubURL","toDownloadLink","sep","concatDate","filename","saveDialog","supportsDownload","HTMLAnchorElement","about_respec","getEntriesByType","duration","round","perfEntryToTR","firstParagraph","metaElem","css$9","fetchBase","currentScript","workerPromise","workerScript","respecWorker$1","default","loadWorkerScript","workerURL","createObjectURL","Blob","Worker","createWorker","worker","nextMsgId","namespace","counter","gen","idGenerator","msgIdGenerator","highlightElement","languages","action","timeoutId","listener","sendHighlightRequest","innerText","noHighlightCSS","highlightables","promisesToHighlight","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$7","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","outputDoc","css$5","varMap","variables","currentSection","textNode","Text","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","definition","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","file_a_bug","participate","commit_history","props","to","connectedCallback","fetchCommits","commits","commit","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","isRecTrack","saysPrivOrSec","saysConsiderations","offendingMembers","getOwnPropertyNames"],"mappings":"sDACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAAON,OAAOC,QAAQG,QAAQE,EAAI,IAEpCE,QAAQC,IAAIL,GAASM,MAAKC,GAAWR,KAAYQ,IACrD,EACEV,EAAQG,QAAU,GAClBJ,OAAOC,QAAUA,CACnB,CAMO,SAASW,EAAOC,EAAMC,GACtBf,IACHC,OAAOC,QAAQG,QAAQS,GAAQC,EAEnC,CCtBO,MAIDC,EAAgB,IAAIC,YAOnB,SAASC,EAAIC,EAAOC,GAEzB,GADAJ,EAAcK,cAAc,IAAIC,YAAYH,EAAO,CAAEC,YACjDnB,OAAOsB,SAAWtB,OAAOuB,KAC3B,OAGF,MAAMC,EAAOC,OAAOC,KAAKC,UAAUR,GAAQS,OAAST,IACpDnB,OAAOsB,OAAOO,YAAY,CAAEX,QAAOM,QAAQxB,OAAOsB,OAAOQ,SAASC,OACpE,CAWO,SAASC,EAAId,EAAOe,EAAIC,EAAU,CAAEC,MAAM,IAE/CpB,EAAcqB,iBAAiBlB,GADdmB,GAAKJ,EAAGI,EAAElB,SACqBe,EAClD,CAEAtB,EAnCoB,iBAmCP,CAAEoB,QCpCf,MAAMM,EAAa,CAAC,cAAe,cCG5B,MAEDC,EAAOC,SAASC,gBAClBF,IAASA,EAAKG,aAAa,UAC7BH,EA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,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,WACA3F,QAAQmF,EAAU8B,oBAEb9B,CACV,IAGA,IAAIA,GAAYJ,GCjgBsBqC,GAAU,SAASC,GAAgB,IAAIlO,EAAE,CAAE,EAAC,IAAIA,EAAEjP,QAAQA,OAAod,CAA5c,MAAMd,GAAG+P,EAAEjP,QAAQ,SAASiP,EAAE/P,GAAG,IAAIiJ,EAAEjJ,EAAEke,eAAeC,EAAEne,EAAEyY,eAAehN,EAAE2S,EAAEjc,UAAU,OAAOsJ,EAAE4S,OAAO,SAASre,GAAG,OAAO4C,KAAKb,IAAI/B,WAAWA,EAAE4C,KAAKoG,EAAE,EAAEyC,EAAErK,IAAI,SAASpB,GAAG,OAAO4C,KAAKb,IAAI/B,GAAGA,EAAE4C,KAAKoG,QAAG,CAAM,EAAEyC,EAAE1J,IAAI,SAAS/B,GAAG,OAAOme,EAAEpb,KAAK/C,EAAE4C,KAAKoG,EAAE,EAAEyC,EAAE5J,IAAI,SAAS7B,EAAE+P,GAAG,OAAO9G,EAAEjJ,EAAE4C,KAAKoG,EAAE,CAACsV,cAAa,EAAGxc,MAAMiO,IAAInN,IAAI,EAAEwb,EAAE,SAASA,EAAEpe,GAAGiJ,EAAErG,KAAK,IAAI,CAACd,MAAM,kBAA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C1BxuB,GAAI,CACFuZ,IAAK,yEACL8T,KACE,mMAgBC,SAAauL,GAVpB,IAAiChL,EAW1BgL,EAAKkH,OAxBK,oBA4BXlH,EAAKm4B,aAfsBnjC,EAeiBnuB,UAdzC6f,MAAM2L,KAAK2C,EAAIrP,iBAAiB,uBAAuBpb,MAC5D,EAAG6gB,YAAa9X,MACd,MAAM8kD,EAAgB,uBAAuB9qD,KAAKgG,GAC5C+kD,EAAqB,qBAAqB/qD,KAAKgG,GACrD,OAAQ8kD,GAAiBC,GAAuBD,CAAa,MAW/D/hC,GAAYnvB,GAAKyZ,IAAKzb,GAAM,CAAEuvB,KAAMvtB,GAAKutB,MAE7C,ICnCA,MACavvB,GAAO,kCAYdgC,GAAO0uB,GAVe,CAC1BxuB,GAAI,CACFuZ,IAAKma,EAAO,oCAAoC,oBAChDrG,KAAM,0DAERiX,GAAI,CACF/qB,IAAKma,EAAO,GAAG,kCACfrG,KAAM,0EAKH,SAAauL,GAClB,IAAKA,EAAKkH,OAhBK,iBAiBb,OAKF,IAAKvhC,OAAOQ,SAASwK,KAAKujB,WAAW,QACnC,OAGF,MAAMokC,EAAmBj8C,OAAOk8C,oBAAoBv4B,GAEjDzoB,QAAO0b,GAAQA,EAAI+H,SAAS,QAAUgF,EAAK/M,IAAiB,WAARA,IAEpD1b,QAAO0b,GACN,IAAIoB,IAAI2L,EAAK/M,GAAMttB,OAAOQ,SAASwK,MAAMA,KAAKujB,WAAW,aAG7D,GAAIokC,EAAiBjmD,OAAQ,CAC3B,MAAMsL,EAAO+X,GAAQ4iC,GAAkBrlC,GAAO6H,EAAO,GAAG,IAAI7H,SAC5DoD,GAAYnvB,GAAKyZ,IAAKzb,GAAM,CAAEuvB,KAAMvtB,GAAKutB,KAAO9W,GACjD,CACH","x_google_ignoreList":[4,5,6,7,9]} \ No newline at end of file diff --git a/builds/respec-geonovum.js b/builds/respec-geonovum.js index fdca6bb99f..1b46a07080 100644 --- a/builds/respec-geonovum.js +++ b/builds/respec-geonovum.js @@ -1,4 +1,4 @@ -window.respecVersion="33.0.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=new EventTarget;function r(e,t){if(n.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const r=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:r},window.parent.location.origin)}function o(e,t,r={once:!1}){n.addEventListener(e,(e=>t(e.detail)),r)}t("core/pubsubhub",{sub:o});const s=["githubToken","githubUser"];const i=document.documentElement;i&&!i.hasAttribute("lang")&&(i.lang="en",i.hasAttribute("dir")||(i.dir="ltr"));const a={},l=i.lang;var c=Object.freeze({__proto__:null,l10n:a,lang:l,name:"core/l10n",run:function(e){e.l10n=a[l]||a.en}});let u,d;const p=new WeakMap,f=new WeakMap,h=new WeakMap,m=new WeakMap,g=new WeakMap;let b={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return f.get(e);if("objectStoreNames"===t)return e.objectStoreNames||h.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return v(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function w(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(d||(d=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(x(this),t),v(p.get(this))}:function(...t){return v(e.apply(x(this),t))}:function(t,...n){const r=e.call(x(this),t,...n);return h.set(r,t.sort?t.sort():[t]),v(r)}}function y(e){return"function"==typeof e?w(e):(e instanceof IDBTransaction&&function(e){if(f.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)}));f.set(e,t)}(e),t=e,(u||(u=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,b):e);var t}function v(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(v(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",s)}));return t.then((t=>{t instanceof IDBCursor&&p.set(t,e)})).catch((()=>{})),g.set(t,e),t}(e);if(m.has(e))return m.get(e);const t=y(e);return t!==e&&(m.set(e,t),g.set(t,e)),t}const x=e=>g.get(e);const k=["get","getKey","getAll","getAllKeys","count"],$=["put","add","delete","clear"],_=new Map;function S(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(_.get(t))return _.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=$.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!k.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 _.set(t,s),s}b=(e=>({...e,get:(t,n,r)=>S(t,n)||e.get(t,n,r),has:(t,n)=>!!S(t,n)||e.has(t,n)}))(b);var E=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),v(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:s}={}){const i=indexedDB.open(e,t),a=v(i);return r&&i.addEventListener("upgradeneeded",(e=>{r(v(i.result),e.oldVersion,e.newVersion,v(i.transaction),e)})),n&&i.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{s&&e.addEventListener("close",(()=>s())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:x,wrap:v});const C=/^[!#$%&'*+-.^`|~\w]+$/,L=/[\u000A\u000D\u0009\u0020]/u,A=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function T(e,t,n){(t&&""!==t&&!e.has(t)&&A.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function R(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let N={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const z=/[&<>"']/,j=new RegExp(z.source,"g"),P=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,I=new RegExp(P.source,"g"),O={"&":"&","<":"<",">":">",'"':""","'":"'"},D=e=>O[e];function q(e,t){if(t){if(z.test(e))return e.replace(j,D)}else if(P.test(e))return e.replace(I,D);return e}const M=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function B(e){return e.replace(M,((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 F=/(^|[^\[])\^/g;function W(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(F,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const U=/[^\w:]/g,H=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function G(e,t,n){if(e){let e;try{e=decodeURIComponent(B(n)).replace(U,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!H.test(n)&&(n=function(e,t){V[" "+e]||(Z.test(e)?V[" "+e]=e+"/":V[" "+e]=Y(e,"/",!0));const n=-1===(e=V[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(K,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(Q,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const V={},Z=/^[^:]+:\/*[^/]*$/,K=/^([^:]+:)[\s\S]*$/,Q=/^([^:]+:\/*[^/]*)[\s\S]*$/;const J={exec:function(){}};function X(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function Y(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o<r;){const s=e.charAt(r-o-1);if(s!==t||n){if(s===t||!n)break;o++}else o++}return e.slice(0,r-o)}function ee(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function te(e,t,n,r){const o=t.href,s=t.title?q(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:s,text:i,tokens:r.inlineTokens(i)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:s,text:q(i)}}class ne{constructor(e){this.options=e||N}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}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().replace(this.rules.inline._escapes,"$1"):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,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,o,s,i,a,l,c,u,d,p,f,h=t[1].trim();const m=h.length>1,g={type:"list",raw:"",ordered:m,start:m?+h.slice(0,-1):"",loose:!1,items:[]};h=m?`\\d{1,9}\\${h.slice(-1)}`:`\\${h}`,this.options.pedantic&&(h=m?h:"[*+-]");const b=new RegExp(`^( {0,3}${h})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,t=b.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),c=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),u=e.split("\n",1)[0],this.options.pedantic?(s=2,p=c.trimLeft()):(s=t[2].search(/[^ ]/),s=s>4?1:s,p=c.slice(s),s+=t[1].length),a=!1,!c&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),f=!0),!f){const t=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),o=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),i=new RegExp(`^ {0,${Math.min(3,s-1)}}#`);for(;e&&(d=e.split("\n",1)[0],u=d,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!o.test(u))&&!i.test(u)&&!t.test(u)&&!r.test(e);){if(u.search(/[^ ]/)>=s||!u.trim())p+="\n"+u.slice(s);else{if(a)break;if(c.search(/[^ ]/)>=4)break;if(o.test(c))break;if(i.test(c))break;if(r.test(c))break;p+="\n"+u}a||u.trim()||(a=!0),n+=d+"\n",e=e.substring(d.length+1),c=u.slice(s)}}g.loose||(l?g.loose=!0:/\n *\n *$/.test(n)&&(l=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(o="[ ] "!==r[0],p=p.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!r,checked:o,loose:!1,text:p}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=p.trimRight(),g.raw=g.raw.trimRight();const w=g.items.length;for(i=0;i<w;i++)if(this.lexer.state.top=!1,g.items[i].tokens=this.lexer.blockTokens(g.items[i].text,[]),!g.loose){const e=g.items[i].tokens.filter((e=>"space"===e.type)),t=e.length>0&&e.some((e=>/\n.*\n/.test(e.raw)));g.loose=t}if(g.loose)for(i=0;i<w;i++)g.items[i].loose=!0;return g}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};if(this.options.sanitize){const n=this.options.sanitizer?this.options.sanitizer(t[0]):q(t[0]);e.type="paragraph",e.text=n,e.tokens=this.lexer.inline(n)}return e}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:X(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,o,s,i=e.align.length;for(n=0;n<i;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(i=e.rows.length,n=0;n<i;n++)e.rows[n]=X(e.rows[n],e.header.length).map((e=>({text:e})));for(i=e.header.length,r=0;r<i;r++)e.header[r].tokens=this.lexer.inline(e.header[r].text);for(i=e.rows.length,r=0;r<i;r++)for(s=e.rows[r],o=0;o<s.length;o++)s[o].tokens=this.lexer.inline(s[o].text);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:q(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):q(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=Y(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,o=0;for(;o<n;o++)if("\\"===e[o])o++;else if(e[o]===t[0])r++;else if(e[o]===t[1]&&(r--,r<0))return o;return-1}(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(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),te(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}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){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return te(n,e,n[0],this.lexer)}}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)continue;if(s=o.length,r[3]||r[4]){i+=s;continue}if((r[5]||r[6])&&n%3&&!((n+s)%3)){a+=s;continue}if(i-=s,i>0)continue;s=Math.min(s,s+i+a);const t=e.slice(0,n+r.index+(r[0].length-o.length)+s);if(Math.min(n,s)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const l=t.slice(2,-2);return{type:"strong",raw:t,text:l,tokens:this.lexer.inlineTokens(l)}}}}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=q(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],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=q(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=q(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=q(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=q(n[0]),r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):q(n[0]):n[0]:q(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const 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}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:J,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};re.def=W(re.def).replace("label",re._label).replace("title",re._title).getRegex(),re.bullet=/(?:[*+-]|\d{1,9}[.)])/,re.listItemStart=W(/^( *)(bull) */).replace("bull",re.bullet).getRegex(),re.list=W(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=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,re.html=W(re.html,"i").replace("comment",re._comment).replace("tag",re._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),re.paragraph=W(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.blockquote=W(re.blockquote).replace("paragraph",re.paragraph).getRegex(),re.normal={...re},re.gfm={...re.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},re.gfm.table=W(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","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.gfm.paragraph=W(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",re.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.pedantic={...re.normal,html:W("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\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:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:J,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:W(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:J,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,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:J,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function se(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function ie(e){let t,n,r="";const o=e.length;for(t=0;t<o;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}oe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",oe.punctuation=W(oe.punctuation).replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,oe.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,oe._comment=W(re._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),oe.emStrong.lDelim=W(oe.emStrong.lDelim).replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimAst=W(oe.emStrong.rDelimAst,"g").replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimUnd=W(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=W(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=W(oe.tag).replace("comment",oe._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=W(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=W(oe.reflink).replace("label",oe._label).replace("ref",re._label).getRegex(),oe.nolink=W(oe.nolink).replace("ref",re._label).getRegex(),oe.reflinkSearch=W(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal={...oe},oe.pedantic={...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:W(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:W(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()},oe.gfm={...oe.normal,escape:W(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]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},oe.gfm.url=W(oe.gfm.url,"i").replace("email",oe.gfm._extended_email).getRegex(),oe.breaks={...oe.gfm,br:W(oe.br).replace("{2,}","*").getRegex(),text:W(oe.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class ae{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||N,this.options.tokenizer=this.options.tokenizer||new ne,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:re.normal,inline:oe.normal};this.options.pedantic?(t.block=re.pedantic,t.inline=oe.pedantic):this.options.gfm&&(t.block=re.gfm,this.options.breaks?t.inline=oe.breaks:t.inline=oe.gfm),this.tokenizer.rules=t}static get rules(){return{block:re,inline:oe}}static lex(e,t){return new ae(t).lex(e)}static lexInline(e,t){return new ae(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,o,s;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],s&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),s=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);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 this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,o,s,i,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,s.index)+"["+ee("a",s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,s.index)+"["+ee("a",s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,s.index+s[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(i||(a=""),i=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,ie))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,ie))){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({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o,se))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),i=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);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(n.raw.length),t.push(n);return t}}let le=class{constructor(e){this.options=e||N}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?'<pre><code class="'+this.options.langPrefix+q(r)+'">'+(n?e:q(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:q(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e){return e}heading(e,t,n,r){if(this.options.headerIds){return`<h${t} id="${this.options.headerPrefix+r.slug(n)}">${e}</h${t}>\n`}return`<h${t}>${e}</h${t}>\n`}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){if(null===(e=G(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){if(null===(e=G(this.options.sanitize,this.options.baseUrl,e)))return n;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${t}"`),r+=this.options.xhtml?"/>":">",r}text(e){return e}};class ce{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""}}class ue{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)}}class de{constructor(e){this.options=e||N,this.options.renderer=this.options.renderer||new le,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ce,this.slugger=new ue}static parse(e,t){return new de(t).parse(e)}static parseInline(e,t){return new de(t).parseInline(e)}parse(e,t=!0){let n,r,o,s,i,a,l,c,u,d,p,f,h,m,g,b,w,y,v,x="";const k=e.length;for(n=0;n<k;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({parser:this},d),!1!==v||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(d.type)))x+=v||"";else switch(d.type){case"space":continue;case"hr":x+=this.renderer.hr();continue;case"heading":x+=this.renderer.heading(this.parseInline(d.tokens),d.depth,B(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":x+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(c="",l="",s=d.header.length,r=0;r<s;r++)l+=this.renderer.tablecell(this.parseInline(d.header[r].tokens),{header:!0,align:d.align[r]});for(c+=this.renderer.tablerow(l),u="",s=d.rows.length,r=0;r<s;r++){for(a=d.rows[r],l="",i=a.length,o=0;o<i;o++)l+=this.renderer.tablecell(this.parseInline(a[o].tokens),{header:!1,align:d.align[o]});u+=this.renderer.tablerow(l)}x+=this.renderer.table(c,u);continue;case"blockquote":u=this.parse(d.tokens),x+=this.renderer.blockquote(u);continue;case"list":for(p=d.ordered,f=d.start,h=d.loose,s=d.items.length,u="",r=0;r<s;r++)g=d.items[r],b=g.checked,w=g.task,m="",g.task&&(y=this.renderer.checkbox(b),h?g.tokens.length>0&&"paragraph"===g.tokens[0].type?(g.tokens[0].text=y+" "+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=y+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:y}):m+=y),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,w,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<k&&"text"===e[n+1].type;)d=e[++n],u+="\n"+(d.tokens?this.parseInline(d.tokens):d.text);x+=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 x}parseInline(e,t){t=t||this.renderer;let n,r,o,s="";const i=e.length;for(n=0;n<i;n++)if(r=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(o=this.options.extensions.renderers[r.type].call({parser:this},r),!1!==o||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)))s+=o||"";else switch(r.type){case"escape":case"text":s+=t.text(r.text);break;case"html":s+=t.html(r.text);break;case"link":s+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":s+=t.image(r.href,r.title,r.text);break;case"strong":s+=t.strong(this.parseInline(r.tokens,t));break;case"em":s+=t.em(this.parseInline(r.tokens,t));break;case"codespan":s+=t.codespan(r.text);break;case"br":s+=t.br();break;case"del":s+=t.del(this.parseInline(r.tokens,t));break;default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return s}}class pe{constructor(e){this.options=e||N}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(e){return e}postprocess(e){return e}}function fe(e,t){return(n,r,o)=>{"function"==typeof r&&(o=r,r=null);const s={...r},i=function(e,t,n){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+q(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):n?void n(null,e):e}if(t)return Promise.reject(r);if(!n)throw r;n(r)}}((r={...he.defaults,...s}).silent,r.async,o);if(null==n)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}(r),r.hooks&&(r.hooks.options=r),o){const s=r.highlight;let a;try{r.hooks&&(n=r.hooks.preprocess(n)),a=e(n,r)}catch(e){return i(e)}const l=function(e){let n;if(!e)try{r.walkTokens&&he.walkTokens(a,r.walkTokens),n=t(a,r),r.hooks&&(n=r.hooks.postprocess(n))}catch(t){e=t}return r.highlight=s,e?i(e):o(null,n)};if(!s||s.length<3)return l();if(delete r.highlight,!a.length)return l();let c=0;return he.walkTokens(a,(function(e){"code"===e.type&&(c++,setTimeout((()=>{s(e.text,e.lang,(function(t,n){if(t)return l(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),c--,0===c&&l()}))}),0))})),void(0===c&&l())}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then((t=>e(t,r))).then((e=>r.walkTokens?Promise.all(he.walkTokens(e,r.walkTokens)).then((()=>e)):e)).then((e=>t(e,r))).then((e=>r.hooks?r.hooks.postprocess(e):e)).catch(i);try{r.hooks&&(n=r.hooks.preprocess(n));const o=e(n,r);r.walkTokens&&he.walkTokens(o,r.walkTokens);let s=t(o,r);return r.hooks&&(s=r.hooks.postprocess(s)),s}catch(e){return i(e)}}}function he(e,t,n){return fe(ae.lex,de.parse)(e,t,n)}he.options=he.setOptions=function(e){var t;return he.defaults={...he.defaults,...e},t=he.defaults,N=t,he},he.getDefaults=R,he.defaults=N,he.use=function(...e){const t=he.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((e=>{const n={...e};if(n.async=he.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),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'");t[e.level]?t[e.level].unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=he.defaults.renderer||new le;for(const n in e.renderer){const r=t[n];t[n]=(...o)=>{let s=e.renderer[n].apply(t,o);return!1===s&&(s=r.apply(t,o)),s}}n.renderer=t}if(e.tokenizer){const t=he.defaults.tokenizer||new ne;for(const n in e.tokenizer){const r=t[n];t[n]=(...o)=>{let s=e.tokenizer[n].apply(t,o);return!1===s&&(s=r.apply(t,o)),s}}n.tokenizer=t}if(e.hooks){const t=he.defaults.hooks||new pe;for(const n in e.hooks){const r=t[n];pe.passThroughHooks.has(n)?t[n]=o=>{if(he.defaults.async)return Promise.resolve(e.hooks[n].call(t,o)).then((e=>r.call(t,e)));const s=e.hooks[n].call(t,o);return r.call(t,s)}:t[n]=(...o)=>{let s=e.hooks[n].apply(t,o);return!1===s&&(s=r.apply(t,o)),s}}n.hooks=t}if(e.walkTokens){const t=he.defaults.walkTokens;n.walkTokens=function(n){let r=[];return r.push(e.walkTokens.call(this,n)),t&&(r=r.concat(t.call(this,n))),r}}he.setOptions(n)}))},he.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(he,r)),r.type){case"table":for(const e of r.header)n=n.concat(he.walkTokens(e.tokens,t));for(const e of r.rows)for(const r of e)n=n.concat(he.walkTokens(r.tokens,t));break;case"list":n=n.concat(he.walkTokens(r.items,t));break;default:he.defaults.extensions&&he.defaults.extensions.childTokens&&he.defaults.extensions.childTokens[r.type]?he.defaults.extensions.childTokens[r.type].forEach((function(e){n=n.concat(he.walkTokens(r[e],t))})):r.tokens&&(n=n.concat(he.walkTokens(r.tokens,t)))}return n},he.parseInline=fe(ae.lexInline,de.parseInline),he.Parser=de,he.parser=de.parse,he.Renderer=le,he.TextRenderer=ce,he.Lexer=ae,he.lexer=ae.lex,he.Tokenizer=ne,he.Slugger=ue,he.Hooks=pe,he.parse=he,he.options,he.setOptions,he.use,he.walkTokens,he.parseInline;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var me,ge={};me={get exports(){return ge},set exports(e){ge=e}},function(e,t){me.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 be=ge,we=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<o;){var l,c=e(n[r],1);t.insertBefore(c,s),i&&a&&c.selected&&(a=!a,l=t.selectedIndex,t.selectedIndex=l<0?r:d.call(t.querySelectorAll("option"),c)),r++}}function s(e,t){return e==t}function i(e){return e}function a(e,t,n,r,o,s,i){var a=s-o;if(a<1)return-1;for(;a<=n-t;){for(var l=t,c=o;l<n&&c<s&&i(e[l],r[c]);)l++,c++;if(c===s)return t;t=l+1}return-1}function l(e,t,n,r,o){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:o}function c(e,t,n,r){for(;n<r;)f(e(t[n++],-1))}var u=r.WeakSet,d=[].indexOf,p=function(e,t,n){for(var r=1,o=t;r<o;){var s=(r+o)/2>>>0;n<e[s]?o=s:r=1+s}return r},f=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function h(e,t,n,r){for(var u=(r=r||{}).compare||s,d=r.node||i,f=null==r.before?null:d(r.before,0),h=t.length,m=h,g=0,b=n.length,w=0;g<m&&w<b&&u(t[g],n[w]);)g++,w++;for(;g<m&&w<b&&u(t[m-1],n[b-1]);)m--,b--;var y=g===m,v=w===b;if(y&&v)return n;if(y&&w<b)return o(d,e,n,w,b,l(d,t,g,h,f)),n;if(v&&g<m)return c(d,t,g,m),n;var x=m-g,k=b-w,$=-1;if(x<k){if(-1<($=a(n,w,b,t,g,m,u)))return o(d,e,n,w,$,d(t[g],0)),o(d,e,n,$+x,b,l(d,t,m,h,f)),n}else if(k<x&&-1<($=a(t,g,m,n,w,b,u)))return c(d,t,g,$),c(d,t,$+k,m),n;return x<2||k<2?(o(d,e,n,w,b,d(t[g],0)),c(d,t,g,m)):x==k&&function(e,t,n,r,o,s){for(;r<o&&s(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,u)?o(d,e,n,w,b,l(d,t,m,h,f)):function(e,t,n,r,s,i,a,l,u,d,f,h,m){!function(e,t,n,r,s,i,a,l,u){for(var d=[],p=e.length,f=a,h=0;h<p;)switch(e[h++]){case 0:s++,f++;break;case 1:d.push(r[s]),o(t,n,r,s++,s,f<l?t(i[f],0):u);break;case-1:f++}for(h=0;h<p;)switch(e[h++]){case 0:a++;break;case-1:-1<d.indexOf(i[a])?a++:c(t,i,a++,a)}}(function(e,t,n,r,o,s,i){var a,l,c,u,d,p,f=n+s,h=[];e:for(b=0;b<=f;b++){if(50<b)return null;for(p=b-1,u=b?h[b-1]:[0,0],d=h[b]=[],a=-b;a<=b;a+=2){for(l=(c=a===-b||a!==b&&u[p+a-1]<u[p+a+1]?u[p+a+1]:u[p+a-1]+1)-a;c<s&&l<n&&i(r[o+c],e[t+l]);)c++,l++;if(c===s&&l===n)break e;d[b+a]=c}}for(var m=Array(b/2+f/2),g=m.length-1,b=h.length-1;0<=b;b--){for(;0<c&&0<l&&i(r[o+c-1],e[t+l-1]);)m[g--]=0,c--,l--;if(!b)break;p=b-1,u=b?h[b-1]:[0,0],(a=c-l)==-b||a!==b&&u[p+a-1]<u[p+a+1]?(l--,m[g--]=1):(c--,m[g--]=-1)}return m}(n,r,i,a,l,d,h)||function(e,t,n,r,o,s,i,a){var l=0,c=r<a?r:a,u=Array(c++),d=Array(c);d[0]=-1;for(var f=1;f<c;f++)d[f]=i;for(var h=o.slice(s,i),m=t;m<n;m++){var g,b=h.indexOf(e[m]);-1<b&&-1<(l=p(d,c,g=b+s))&&(d[l]=g,u[l]={newi:m,oldi:g,prev:u[l-1]})}for(l=--c,--i;d[l]>i;)--l;c=a+r-l;var w=Array(c),y=u[l];for(--n;y;){for(var v=y.newi,x=y.oldi;v<n;)w[--c]=1,--n;for(;x<i;)w[--c]=-1,--i;w[--c]=0,--n,--i,y=y.prev}for(;t<=n;)w[--c]=1,--n;for(;s<=i;)w[--c]=-1,--i;return w}(n,r,s,i,a,l,u,d),e,t,n,r,a,l,f,m)}(d,e,n,w,b,k,t,g,m,x,h,u,f),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,w={};try{w.Map=Map}catch(u){w.Map=function(){var e=0,t=[],n=[];return{delete:function(o){var s=r(o);return s&&(t.splice(e,1),n.splice(e,1)),s},forEach:function(e,r){t.forEach((function(t,o){e.call(r,n[o],t,this)}),this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(o,s){return n[r(o)?e:t.push(o)-1]=s,this}};function r(n){return-1<(e=t.indexOf(n))}}}var y=w.Map;function v(){return this}function x(e,t){var n="_"+e+"$";return{get:function(){return this[n]||k(this,n,t.call(this,e))},set:function(e){k(this,n,e)}}}var k=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(v.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var $,_,S,E,C,L,A={},T={},R=[],N=T.hasOwnProperty,z=0,j={attributes:A,define:function(e,t){e.indexOf("-")<0?(e in T||(z=R.push(e)),T[e]=t):A[e]=t},invoke:function(e,t){for(var n=0;n<z;n++){var r=R[n];if(N.call(e,r))return T[r](e[r],t)}}},P=Array.isArray||(_=($={}.toString).call([]),function(e){return $.call(e)===_}),I=(S=e,E="fragment",L="content"in D(C="template")?function(e){var t=D(C);return t.innerHTML=e,t.content}:function(e){var t,n=D(E),r=D(C);return O(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=D(E),n=D("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",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<s;i++)r[M](e(o[i],n));return r}:U?q[W]:function(e,t){return e[B](!!t)}),K="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},Q="-"+Math.random().toFixed(6)+"%",J=!1;try{G=e.createElement("template"),V="tabindex","content"in G&&(G.innerHTML="<p "+V+'="'+Q+'"></p>',G.content.childNodes[0].getAttribute(V)==Q)||(Q="_dt: "+Q.slice(1,-1)+";",J=!0)}catch(u){}var X="\x3c!--"+Q+"--\x3e",Y=/^(?: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*)(['\"]?)"+X+"\\2","gi");function ce(e,t,n,r){return"<"+t+n.replace(le,ue)+r}function ue(e,t,n){return t+(n||'"')+Q+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+"></"+t+">"}var pe=J?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<i;){var l=s[a];switch(l.nodeType){case 1:var c=o.concat(a);!function(t,n,r,o){for(var s,i=t.attributes,a=[],l=[],c=pe(i,r),u=c.length,d=0;d<u;){var p=c[d++],f=p.value===Q;if(f||1<(s=p.value.split(X)).length){var h=p.name;if(a.indexOf(h)<0){a.push(h);var m=r.shift().replace(f?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+h+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=i[m]||i[m.toLowerCase()];if(f)n.push(he(g,o,m,null));else{for(var b=s.length-2;b--;)r.shift();n.push(he(g,o,m,s))}}l.push(p)}}for(var w=((d=0)<(u=l.length)&&J&&!("ownerSVGElement"in t));d<u;){var y=l[d++];w&&(y.value=""),t.removeAttribute(y.name)}var v=t.nodeName;if(/^script$/i.test(v)){var x=e.createElement(v);for(u=i.length,d=0;d<u;)x.setAttributeNode(i[d++].cloneNode(!0));x.textContent=t.textContent,t.parentNode.replaceChild(x,t)}}(l,n,r,c),fe(l,n,r,c);break;case 8:var u=l.textContent;if(u===Q)r.shift(),n.push(Y.test(t.nodeName)?me(t,o):{type:"any",node:l,path:o.concat(a)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"👻":t.removeChild(l),a--,i--}break;case 3:Y.test(t.nodeName)&&K.call(l.textContent)===X&&(r.shift(),n.push(me(t,o)))}a++}}function he(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function me(e,t){return{type:"text",node:e,path:t}}var ge,be=(ge=new n,{get:function(e){return ge.get(e)},set:function(e,t){return ge.set(e,t),t}});function we(e,t){var n=(e.convert||function(e){return e.join(X).replace(ae,de).replace(ie,ce)})(t),r=e.transform;r&&(n=r(n));var o=I(n,e.type);ve(o);var s=[];return fe(o,s,t.slice(0),[]),{content:o,updates:function(n){for(var r=[],o=s.length,i=0,a=0;i<o;){var l=s[i++],c=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,l.path);switch(l.type){case"any":r.push({fn:e.any(c,[]),sparse:!1});break;case"attr":var u=l.sparse,d=e.attribute(c,l.name,l.node);null===u?r.push({fn:d,sparse:!1}):(a+=u.length-2,r.push({fn:d,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(c),sparse:!1}),c.textContent=""}}return o+=a,function(){var e=arguments.length;if(o!==e-1)throw new Error(e-1+" values instead of "+o+"\n"+t.join("${value}"));for(var s=1,i=1;s<e;){var a=r[s-i];if(a.sparse){var l=a.values,c=l[0],u=1,d=l.length;for(i+=d-2;u<d;)c+=arguments[s++]+l[u++];a.fn(c)}else a.fn(arguments[s++])}return n}}}}var ye=[];function ve(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===K.call(r.textContent).length&&e.removeChild(r)}}var xe,ke,$e=(xe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,ke=/([^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),Se(n,!0)}(e,t):Se(e.style,!1)});function _e(e,t,n){return t+"-"+n.toLowerCase()}function Se(e,t){var n,r;return function(o){var s,i,a,l;switch(typeof o){case"object":if(o){if("object"===n){if(!t&&r!==o)for(i in r)i in o||(e[i]="")}else t?e.value="":e.cssText="";for(i in s=t?{}:e,o)a="number"!=typeof(l=o[i])||xe.test(i)?l:l+"px",!t&&/^--/.test(i)?s.setProperty(i,a):s[i]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace(ke,_e),":",e[t],";");return n.join("")}(r=s):r=o;break}default:r!=o&&(n="string",r=o,t?e.value=o||"":e.cssText=o||"")}}}var Ee,Ce,Le=(Ee=[].slice,(Ce=Ae.prototype).ELEMENT_NODE=1,Ce.nodeType=111,Ce.remove=function(e){var t,n=this.childNodes,r=this.firstChild,o=this.lastChild;return this._=null,e&&2===n.length?o.parentNode.removeChild(o):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(o),t.deleteContents()),r},Ce.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,o=0,s=r.length;o<s;o++)t.appendChild(r[o]);return t},Ae);function Ae(e){var t=this.childNodes=Ee.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Te(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Be:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Me:return Re(e.render(),t);default:return e}}function Ne(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(Te).then(t):Promise.resolve(j.invoke(e,t)).then(t)}function ze(e){return null!=e&&"then"in e}var je,Pe,Ie,Oe,De,qe="ownerSVGElement",Me=v.prototype.nodeType,Be=Le.prototype.nodeType,Fe=(Pe=(je={Event:b,WeakSet:u}).Event,Ie=je.WeakSet,Oe=!0,De=null,function(e){return Oe&&(Oe=!Oe,De=new Ie,function(e){var t=new Ie,n=new Ie;try{new MutationObserver(i).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,o=[],s=function(e){o.push(e),clearTimeout(r),r=setTimeout((function(){i(o.splice(r=0,o.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){s({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){s({addedNodes:[e.target],removedNodes:[]})}),!0)}function i(e){for(var r,o=e.length,s=0;s<o;s++)a((r=e[s]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var o,s=new Pe(t),i=e.length,a=0;a<i;1===(o=e[a++]).nodeType&&function e(t,n,r,o,s){De.has(t)&&!o.has(t)&&(s.delete(t),o.add(t),t.dispatchEvent(n));for(var i=t.children||[],a=i.length,l=0;l<a;e(i[l++],n,r,o,s));}(o,s,t,n,r));}}(e.ownerDocument)),De.add(e),e}),We=/^(?:form|list)$/i,Ue=[].slice;function He(t){return this.type=t,function(t){var n=ye,r=ve;return function(o){var s,i,a;return n!==o&&(s=t,i=n=o,a=be.get(i)||be.set(i,we(s,i)),r=a.updates(Z.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ge=!(He.prototype={attribute:function(e,t,n){var r,o=qe in e;if("style"===t)return $e(e,n,o);if("."===t.slice(0,1))return c=e,u=t.slice(1),o?function(e){try{c[u]=e}catch(t){c.setAttribute(u,e)}}:function(e){c[u]=e};if("?"===t.slice(0,1))return i=e,a=t.slice(1),function(e){l!==!!e&&((l=!!e)?i.setAttribute(a,""):i.removeAttribute(a))};if(/^on/.test(t)){var s=t.slice(2);return"connected"===s||"disconnected"===s?Fe(e):t.toLowerCase()in e&&(s=s.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(s,r,!1),(r=t)&&e.addEventListener(s,t,!1))}}if("data"===t||!o&&t in e&&!We.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in j.attributes)return function(n){var o=j.attributes[t](e,n);r!==o&&(null==(r=o)?e.removeAttribute(t):e.setAttribute(t,o))};var i,a,l,c,u,d=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(d&&(d=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,d||(d=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:Re,before:e},o=qe in e?"svg":"html",s=!1;return function i(a){switch(typeof a){case"string":case"number":case"boolean":s?n!==a&&(n=a,t[0].textContent=a):(s=!0,n=a,t=h(e.parentNode,t,[(l=a,e.ownerDocument.createTextNode(l))],r));break;case"function":i(a(e));break;case"object":case"undefined":if(null==a){s=!1,t=h(e.parentNode,t,[],r);break}default:if(s=!1,P(n=a))if(0===a.length)t.length&&(t=h(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":i({html:a});break;case"object":if(P(a[0])&&(a=a.concat.apply([],a)),ze(a[0])){Promise.all(a).then(i);break}default:t=h(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=h(e.parentNode,t,11===a.nodeType?Ue.call(a.childNodes):[a],r):ze(a)?a.then(i):"placeholder"in a?Ne(a,i):"text"in a?i(String(a.text)):"any"in a?i(a.any):"html"in a?t=h(e.parentNode,t,Ue.call(I([].concat(a.html).join(""),o).childNodes),r):i("length"in a?Ue.call(a):j.invoke(a,i))}var l}},text:function(e){var t;return function n(r){var o;t!==r&&("object"==(o=typeof(t=r))&&r?ze(r)?r.then(n):"placeholder"in r?Ne(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?Ue.call(r).join(""):j.invoke(r,n)):"function"==o?n(r(e)):e.textContent=null==r?"":r)}}}),Ve=function(t){var r,o,s,i,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),l=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||l?(o={},s=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return o[t]||(o[t]=e)},Ve=l?s:(i=new n,function(e){return i.get(e)||(n=s(t=e),i.set(t,n),n);var t,n})):Ge=!0,Ze(t)};function Ze(e){return Ge?e:Ve(e)}function Ke(e){for(var t=arguments.length,n=[Ze(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Qe=new n,Je=function(e){var t,n,r;return function(){var o=Ke.apply(null,arguments);return r!==o[0]?(r=o[0],n=new He(e),t=Ye(n.apply(n,o))):n.apply(n,o),t}},Xe=function(e,t){var n=t.indexOf(":"),r=Qe.get(e),o=t;return-1<n&&(o=t.slice(n+1),t=t.slice(0,n)||"html"),r||Qe.set(e,r={}),r[o]||(r[o]=Je(t))},Ye=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Le(t):e},et=new n;function tt(){var e=et.get(this),t=Ke.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new He(qe in this?"svg":"html");et.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var nt,rt,ot,st,it=j.define,at=He.prototype;function lt(e){return arguments.length<2?null==e?Je("html"):"string"==typeof e?lt.wire(null,e):"raw"in e?Je("html")(e):"nodeType"in e?lt.bind(e):Xe(e,"html"):("raw"in e?Je("html"):lt.wire).apply(null,arguments)}return lt.Component=v,lt.bind=function(e){return tt.bind(e)},lt.define=it,lt.diff=h,(lt.hyper=lt).observe=Fe,lt.tagger=at,lt.wire=function(e,t){return null==e?Je(t||"html"):Xe(e,t||"html")},lt._={WeakMap:n,WeakSet:u},nt=Je,rt=new n,ot=Object.create,st=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(v,{for:{configurable:!0,value:function(e,t){return function(e,t,r,o){var s,i,a,l=t.get(e)||st(e,t);switch(typeof o){case"object":case"function":var c=l.w||(l.w=new n);return c.get(o)||(s=c,i=o,a=new e(r),s.set(i,a),a);default:var u=l.p||(l.p=ot(null));return u[o]||(u[o]=new e(r))}}(this,rt.get(e)||(r=e,o=new y,rt.set(r,o),o),e,null==t?"default":t);var r,o}}}),Object.defineProperties(v.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:x("html",nt),svg:x("svg",nt),state:x("state",(function(){return this.defaultState})),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new b(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 o in r)n[o]=r[o];return!1!==t&&this.render(),this}}}),lt}(document); +window.respecVersion="33.0.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=new EventTarget;function r(e,t){if(n.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const r=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:r},window.parent.location.origin)}function o(e,t,r={once:!1}){n.addEventListener(e,(e=>t(e.detail)),r)}t("core/pubsubhub",{sub:o});const s=["githubToken","githubUser"];const i=document.documentElement;i&&!i.hasAttribute("lang")&&(i.lang="en",i.hasAttribute("dir")||(i.dir="ltr"));const a={},l=i.lang;var c=Object.freeze({__proto__:null,l10n:a,lang:l,name:"core/l10n",run:function(e){e.l10n=a[l]||a.en}});let u,d;const p=new WeakMap,f=new WeakMap,h=new WeakMap,m=new WeakMap,g=new WeakMap;let b={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return f.get(e);if("objectStoreNames"===t)return e.objectStoreNames||h.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return v(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function w(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(d||(d=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(x(this),t),v(p.get(this))}:function(...t){return v(e.apply(x(this),t))}:function(t,...n){const r=e.call(x(this),t,...n);return h.set(r,t.sort?t.sort():[t]),v(r)}}function y(e){return"function"==typeof e?w(e):(e instanceof IDBTransaction&&function(e){if(f.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)}));f.set(e,t)}(e),t=e,(u||(u=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,b):e);var t}function v(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(v(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",s)}));return t.then((t=>{t instanceof IDBCursor&&p.set(t,e)})).catch((()=>{})),g.set(t,e),t}(e);if(m.has(e))return m.get(e);const t=y(e);return t!==e&&(m.set(e,t),g.set(t,e)),t}const x=e=>g.get(e);const k=["get","getKey","getAll","getAllKeys","count"],$=["put","add","delete","clear"],_=new Map;function S(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(_.get(t))return _.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=$.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!k.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 _.set(t,s),s}b=(e=>({...e,get:(t,n,r)=>S(t,n)||e.get(t,n,r),has:(t,n)=>!!S(t,n)||e.has(t,n)}))(b);var E=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),v(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:s}={}){const i=indexedDB.open(e,t),a=v(i);return r&&i.addEventListener("upgradeneeded",(e=>{r(v(i.result),e.oldVersion,e.newVersion,v(i.transaction),e)})),n&&i.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{s&&e.addEventListener("close",(()=>s())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:x,wrap:v});const C=/^[!#$%&'*+-.^`|~\w]+$/,L=/[\u000A\u000D\u0009\u0020]/u,A=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function T(e,t,n){(t&&""!==t&&!e.has(t)&&A.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function R(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let N={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const z=/[&<>"']/,j=new RegExp(z.source,"g"),P=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,I=new RegExp(P.source,"g"),O={"&":"&","<":"<",">":">",'"':""","'":"'"},D=e=>O[e];function q(e,t){if(t){if(z.test(e))return e.replace(j,D)}else if(P.test(e))return e.replace(I,D);return e}const M=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function B(e){return e.replace(M,((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 F=/(^|[^\[])\^/g;function W(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(F,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const U=/[^\w:]/g,H=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function G(e,t,n){if(e){let e;try{e=decodeURIComponent(B(n)).replace(U,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!H.test(n)&&(n=function(e,t){V[" "+e]||(Z.test(e)?V[" "+e]=e+"/":V[" "+e]=Y(e,"/",!0));const n=-1===(e=V[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(K,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(Q,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const V={},Z=/^[^:]+:\/*[^/]*$/,K=/^([^:]+:)[\s\S]*$/,Q=/^([^:]+:\/*[^/]*)[\s\S]*$/;const J={exec:function(){}};function X(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function Y(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o<r;){const s=e.charAt(r-o-1);if(s!==t||n){if(s===t||!n)break;o++}else o++}return e.slice(0,r-o)}function ee(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function te(e,t,n,r){const o=t.href,s=t.title?q(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:s,text:i,tokens:r.inlineTokens(i)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:s,text:q(i)}}class ne{constructor(e){this.options=e||N}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}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().replace(this.rules.inline._escapes,"$1"):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,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,o,s,i,a,l,c,u,d,p,f,h=t[1].trim();const m=h.length>1,g={type:"list",raw:"",ordered:m,start:m?+h.slice(0,-1):"",loose:!1,items:[]};h=m?`\\d{1,9}\\${h.slice(-1)}`:`\\${h}`,this.options.pedantic&&(h=m?h:"[*+-]");const b=new RegExp(`^( {0,3}${h})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,t=b.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),c=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),u=e.split("\n",1)[0],this.options.pedantic?(s=2,p=c.trimLeft()):(s=t[2].search(/[^ ]/),s=s>4?1:s,p=c.slice(s),s+=t[1].length),a=!1,!c&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),f=!0),!f){const t=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),o=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),i=new RegExp(`^ {0,${Math.min(3,s-1)}}#`);for(;e&&(d=e.split("\n",1)[0],u=d,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!o.test(u))&&!i.test(u)&&!t.test(u)&&!r.test(e);){if(u.search(/[^ ]/)>=s||!u.trim())p+="\n"+u.slice(s);else{if(a)break;if(c.search(/[^ ]/)>=4)break;if(o.test(c))break;if(i.test(c))break;if(r.test(c))break;p+="\n"+u}a||u.trim()||(a=!0),n+=d+"\n",e=e.substring(d.length+1),c=u.slice(s)}}g.loose||(l?g.loose=!0:/\n *\n *$/.test(n)&&(l=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(o="[ ] "!==r[0],p=p.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!r,checked:o,loose:!1,text:p}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=p.trimRight(),g.raw=g.raw.trimRight();const w=g.items.length;for(i=0;i<w;i++)if(this.lexer.state.top=!1,g.items[i].tokens=this.lexer.blockTokens(g.items[i].text,[]),!g.loose){const e=g.items[i].tokens.filter((e=>"space"===e.type)),t=e.length>0&&e.some((e=>/\n.*\n/.test(e.raw)));g.loose=t}if(g.loose)for(i=0;i<w;i++)g.items[i].loose=!0;return g}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};if(this.options.sanitize){const n=this.options.sanitizer?this.options.sanitizer(t[0]):q(t[0]);e.type="paragraph",e.text=n,e.tokens=this.lexer.inline(n)}return e}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:X(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,o,s,i=e.align.length;for(n=0;n<i;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(i=e.rows.length,n=0;n<i;n++)e.rows[n]=X(e.rows[n],e.header.length).map((e=>({text:e})));for(i=e.header.length,r=0;r<i;r++)e.header[r].tokens=this.lexer.inline(e.header[r].text);for(i=e.rows.length,r=0;r<i;r++)for(s=e.rows[r],o=0;o<s.length;o++)s[o].tokens=this.lexer.inline(s[o].text);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:q(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):q(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=Y(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,o=0;for(;o<n;o++)if("\\"===e[o])o++;else if(e[o]===t[0])r++;else if(e[o]===t[1]&&(r--,r<0))return o;return-1}(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(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),te(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}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){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return te(n,e,n[0],this.lexer)}}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)continue;if(s=o.length,r[3]||r[4]){i+=s;continue}if((r[5]||r[6])&&n%3&&!((n+s)%3)){a+=s;continue}if(i-=s,i>0)continue;s=Math.min(s,s+i+a);const t=e.slice(0,n+r.index+(r[0].length-o.length)+s);if(Math.min(n,s)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const l=t.slice(2,-2);return{type:"strong",raw:t,text:l,tokens:this.lexer.inlineTokens(l)}}}}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=q(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],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=q(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=q(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=q(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=q(n[0]),r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):q(n[0]):n[0]:q(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const 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}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:J,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};re.def=W(re.def).replace("label",re._label).replace("title",re._title).getRegex(),re.bullet=/(?:[*+-]|\d{1,9}[.)])/,re.listItemStart=W(/^( *)(bull) */).replace("bull",re.bullet).getRegex(),re.list=W(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=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,re.html=W(re.html,"i").replace("comment",re._comment).replace("tag",re._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),re.paragraph=W(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.blockquote=W(re.blockquote).replace("paragraph",re.paragraph).getRegex(),re.normal={...re},re.gfm={...re.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},re.gfm.table=W(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","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.gfm.paragraph=W(re._paragraph).replace("hr",re.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",re.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",re._tag).getRegex(),re.pedantic={...re.normal,html:W("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\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:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:J,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:W(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:J,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,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:J,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function se(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function ie(e){let t,n,r="";const o=e.length;for(t=0;t<o;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}oe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",oe.punctuation=W(oe.punctuation).replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,oe.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,oe._comment=W(re._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),oe.emStrong.lDelim=W(oe.emStrong.lDelim).replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimAst=W(oe.emStrong.rDelimAst,"g").replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimUnd=W(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=W(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=W(oe.tag).replace("comment",oe._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=W(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=W(oe.reflink).replace("label",oe._label).replace("ref",re._label).getRegex(),oe.nolink=W(oe.nolink).replace("ref",re._label).getRegex(),oe.reflinkSearch=W(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal={...oe},oe.pedantic={...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:W(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:W(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()},oe.gfm={...oe.normal,escape:W(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]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},oe.gfm.url=W(oe.gfm.url,"i").replace("email",oe.gfm._extended_email).getRegex(),oe.breaks={...oe.gfm,br:W(oe.br).replace("{2,}","*").getRegex(),text:W(oe.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class ae{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||N,this.options.tokenizer=this.options.tokenizer||new ne,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:re.normal,inline:oe.normal};this.options.pedantic?(t.block=re.pedantic,t.inline=oe.pedantic):this.options.gfm&&(t.block=re.gfm,this.options.breaks?t.inline=oe.breaks:t.inline=oe.gfm),this.tokenizer.rules=t}static get rules(){return{block:re,inline:oe}}static lex(e,t){return new ae(t).lex(e)}static lexInline(e,t){return new ae(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,o,s;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],s&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),s=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);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 this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,o,s,i,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,s.index)+"["+ee("a",s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,s.index)+"["+ee("a",s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,s.index+s[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(i||(a=""),i=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,ie))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,ie))){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({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o,se))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),i=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);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(n.raw.length),t.push(n);return t}}let le=class{constructor(e){this.options=e||N}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?'<pre><code class="'+this.options.langPrefix+q(r)+'">'+(n?e:q(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:q(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e){return e}heading(e,t,n,r){if(this.options.headerIds){return`<h${t} id="${this.options.headerPrefix+r.slug(n)}">${e}</h${t}>\n`}return`<h${t}>${e}</h${t}>\n`}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){if(null===(e=G(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){if(null===(e=G(this.options.sanitize,this.options.baseUrl,e)))return n;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${t}"`),r+=this.options.xhtml?"/>":">",r}text(e){return e}};class ce{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""}}class ue{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)}}class de{constructor(e){this.options=e||N,this.options.renderer=this.options.renderer||new le,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ce,this.slugger=new ue}static parse(e,t){return new de(t).parse(e)}static parseInline(e,t){return new de(t).parseInline(e)}parse(e,t=!0){let n,r,o,s,i,a,l,c,u,d,p,f,h,m,g,b,w,y,v,x="";const k=e.length;for(n=0;n<k;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({parser:this},d),!1!==v||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(d.type)))x+=v||"";else switch(d.type){case"space":continue;case"hr":x+=this.renderer.hr();continue;case"heading":x+=this.renderer.heading(this.parseInline(d.tokens),d.depth,B(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":x+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(c="",l="",s=d.header.length,r=0;r<s;r++)l+=this.renderer.tablecell(this.parseInline(d.header[r].tokens),{header:!0,align:d.align[r]});for(c+=this.renderer.tablerow(l),u="",s=d.rows.length,r=0;r<s;r++){for(a=d.rows[r],l="",i=a.length,o=0;o<i;o++)l+=this.renderer.tablecell(this.parseInline(a[o].tokens),{header:!1,align:d.align[o]});u+=this.renderer.tablerow(l)}x+=this.renderer.table(c,u);continue;case"blockquote":u=this.parse(d.tokens),x+=this.renderer.blockquote(u);continue;case"list":for(p=d.ordered,f=d.start,h=d.loose,s=d.items.length,u="",r=0;r<s;r++)g=d.items[r],b=g.checked,w=g.task,m="",g.task&&(y=this.renderer.checkbox(b),h?g.tokens.length>0&&"paragraph"===g.tokens[0].type?(g.tokens[0].text=y+" "+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=y+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:y}):m+=y),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,w,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<k&&"text"===e[n+1].type;)d=e[++n],u+="\n"+(d.tokens?this.parseInline(d.tokens):d.text);x+=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 x}parseInline(e,t){t=t||this.renderer;let n,r,o,s="";const i=e.length;for(n=0;n<i;n++)if(r=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(o=this.options.extensions.renderers[r.type].call({parser:this},r),!1!==o||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)))s+=o||"";else switch(r.type){case"escape":case"text":s+=t.text(r.text);break;case"html":s+=t.html(r.text);break;case"link":s+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":s+=t.image(r.href,r.title,r.text);break;case"strong":s+=t.strong(this.parseInline(r.tokens,t));break;case"em":s+=t.em(this.parseInline(r.tokens,t));break;case"codespan":s+=t.codespan(r.text);break;case"br":s+=t.br();break;case"del":s+=t.del(this.parseInline(r.tokens,t));break;default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return s}}class pe{constructor(e){this.options=e||N}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(e){return e}postprocess(e){return e}}function fe(e,t){return(n,r,o)=>{"function"==typeof r&&(o=r,r=null);const s={...r},i=function(e,t,n){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+q(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):n?void n(null,e):e}if(t)return Promise.reject(r);if(!n)throw r;n(r)}}((r={...he.defaults,...s}).silent,r.async,o);if(null==n)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}(r),r.hooks&&(r.hooks.options=r),o){const s=r.highlight;let a;try{r.hooks&&(n=r.hooks.preprocess(n)),a=e(n,r)}catch(e){return i(e)}const l=function(e){let n;if(!e)try{r.walkTokens&&he.walkTokens(a,r.walkTokens),n=t(a,r),r.hooks&&(n=r.hooks.postprocess(n))}catch(t){e=t}return r.highlight=s,e?i(e):o(null,n)};if(!s||s.length<3)return l();if(delete r.highlight,!a.length)return l();let c=0;return he.walkTokens(a,(function(e){"code"===e.type&&(c++,setTimeout((()=>{s(e.text,e.lang,(function(t,n){if(t)return l(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),c--,0===c&&l()}))}),0))})),void(0===c&&l())}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then((t=>e(t,r))).then((e=>r.walkTokens?Promise.all(he.walkTokens(e,r.walkTokens)).then((()=>e)):e)).then((e=>t(e,r))).then((e=>r.hooks?r.hooks.postprocess(e):e)).catch(i);try{r.hooks&&(n=r.hooks.preprocess(n));const o=e(n,r);r.walkTokens&&he.walkTokens(o,r.walkTokens);let s=t(o,r);return r.hooks&&(s=r.hooks.postprocess(s)),s}catch(e){return i(e)}}}function he(e,t,n){return fe(ae.lex,de.parse)(e,t,n)}he.options=he.setOptions=function(e){var t;return he.defaults={...he.defaults,...e},t=he.defaults,N=t,he},he.getDefaults=R,he.defaults=N,he.use=function(...e){const t=he.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((e=>{const n={...e};if(n.async=he.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),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'");t[e.level]?t[e.level].unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=he.defaults.renderer||new le;for(const n in e.renderer){const r=t[n];t[n]=(...o)=>{let s=e.renderer[n].apply(t,o);return!1===s&&(s=r.apply(t,o)),s}}n.renderer=t}if(e.tokenizer){const t=he.defaults.tokenizer||new ne;for(const n in e.tokenizer){const r=t[n];t[n]=(...o)=>{let s=e.tokenizer[n].apply(t,o);return!1===s&&(s=r.apply(t,o)),s}}n.tokenizer=t}if(e.hooks){const t=he.defaults.hooks||new pe;for(const n in e.hooks){const r=t[n];pe.passThroughHooks.has(n)?t[n]=o=>{if(he.defaults.async)return Promise.resolve(e.hooks[n].call(t,o)).then((e=>r.call(t,e)));const s=e.hooks[n].call(t,o);return r.call(t,s)}:t[n]=(...o)=>{let s=e.hooks[n].apply(t,o);return!1===s&&(s=r.apply(t,o)),s}}n.hooks=t}if(e.walkTokens){const t=he.defaults.walkTokens;n.walkTokens=function(n){let r=[];return r.push(e.walkTokens.call(this,n)),t&&(r=r.concat(t.call(this,n))),r}}he.setOptions(n)}))},he.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(he,r)),r.type){case"table":for(const e of r.header)n=n.concat(he.walkTokens(e.tokens,t));for(const e of r.rows)for(const r of e)n=n.concat(he.walkTokens(r.tokens,t));break;case"list":n=n.concat(he.walkTokens(r.items,t));break;default:he.defaults.extensions&&he.defaults.extensions.childTokens&&he.defaults.extensions.childTokens[r.type]?he.defaults.extensions.childTokens[r.type].forEach((function(e){n=n.concat(he.walkTokens(r[e],t))})):r.tokens&&(n=n.concat(he.walkTokens(r.tokens,t)))}return n},he.parseInline=fe(ae.lexInline,de.parseInline),he.Parser=de,he.parser=de.parse,he.Renderer=le,he.TextRenderer=ce,he.Lexer=ae,he.lexer=ae.lex,he.Tokenizer=ne,he.Slugger=ue,he.Hooks=pe,he.parse=he,he.options,he.setOptions,he.use,he.walkTokens,he.parseInline;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var me,ge={};me={get exports(){return ge},set exports(e){ge=e}},function(e,t){me.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 be=ge,we=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<o;){var l,c=e(n[r],1);t.insertBefore(c,s),i&&a&&c.selected&&(a=!a,l=t.selectedIndex,t.selectedIndex=l<0?r:d.call(t.querySelectorAll("option"),c)),r++}}function s(e,t){return e==t}function i(e){return e}function a(e,t,n,r,o,s,i){var a=s-o;if(a<1)return-1;for(;a<=n-t;){for(var l=t,c=o;l<n&&c<s&&i(e[l],r[c]);)l++,c++;if(c===s)return t;t=l+1}return-1}function l(e,t,n,r,o){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:o}function c(e,t,n,r){for(;n<r;)f(e(t[n++],-1))}var u=r.WeakSet,d=[].indexOf,p=function(e,t,n){for(var r=1,o=t;r<o;){var s=(r+o)/2>>>0;n<e[s]?o=s:r=1+s}return r},f=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function h(e,t,n,r){for(var u=(r=r||{}).compare||s,d=r.node||i,f=null==r.before?null:d(r.before,0),h=t.length,m=h,g=0,b=n.length,w=0;g<m&&w<b&&u(t[g],n[w]);)g++,w++;for(;g<m&&w<b&&u(t[m-1],n[b-1]);)m--,b--;var y=g===m,v=w===b;if(y&&v)return n;if(y&&w<b)return o(d,e,n,w,b,l(d,t,g,h,f)),n;if(v&&g<m)return c(d,t,g,m),n;var x=m-g,k=b-w,$=-1;if(x<k){if(-1<($=a(n,w,b,t,g,m,u)))return o(d,e,n,w,$,d(t[g],0)),o(d,e,n,$+x,b,l(d,t,m,h,f)),n}else if(k<x&&-1<($=a(t,g,m,n,w,b,u)))return c(d,t,g,$),c(d,t,$+k,m),n;return x<2||k<2?(o(d,e,n,w,b,d(t[g],0)),c(d,t,g,m)):x==k&&function(e,t,n,r,o,s){for(;r<o&&s(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,u)?o(d,e,n,w,b,l(d,t,m,h,f)):function(e,t,n,r,s,i,a,l,u,d,f,h,m){!function(e,t,n,r,s,i,a,l,u){for(var d=[],p=e.length,f=a,h=0;h<p;)switch(e[h++]){case 0:s++,f++;break;case 1:d.push(r[s]),o(t,n,r,s++,s,f<l?t(i[f],0):u);break;case-1:f++}for(h=0;h<p;)switch(e[h++]){case 0:a++;break;case-1:-1<d.indexOf(i[a])?a++:c(t,i,a++,a)}}(function(e,t,n,r,o,s,i){var a,l,c,u,d,p,f=n+s,h=[];e:for(b=0;b<=f;b++){if(50<b)return null;for(p=b-1,u=b?h[b-1]:[0,0],d=h[b]=[],a=-b;a<=b;a+=2){for(l=(c=a===-b||a!==b&&u[p+a-1]<u[p+a+1]?u[p+a+1]:u[p+a-1]+1)-a;c<s&&l<n&&i(r[o+c],e[t+l]);)c++,l++;if(c===s&&l===n)break e;d[b+a]=c}}for(var m=Array(b/2+f/2),g=m.length-1,b=h.length-1;0<=b;b--){for(;0<c&&0<l&&i(r[o+c-1],e[t+l-1]);)m[g--]=0,c--,l--;if(!b)break;p=b-1,u=b?h[b-1]:[0,0],(a=c-l)==-b||a!==b&&u[p+a-1]<u[p+a+1]?(l--,m[g--]=1):(c--,m[g--]=-1)}return m}(n,r,i,a,l,d,h)||function(e,t,n,r,o,s,i,a){var l=0,c=r<a?r:a,u=Array(c++),d=Array(c);d[0]=-1;for(var f=1;f<c;f++)d[f]=i;for(var h=o.slice(s,i),m=t;m<n;m++){var g,b=h.indexOf(e[m]);-1<b&&-1<(l=p(d,c,g=b+s))&&(d[l]=g,u[l]={newi:m,oldi:g,prev:u[l-1]})}for(l=--c,--i;d[l]>i;)--l;c=a+r-l;var w=Array(c),y=u[l];for(--n;y;){for(var v=y.newi,x=y.oldi;v<n;)w[--c]=1,--n;for(;x<i;)w[--c]=-1,--i;w[--c]=0,--n,--i,y=y.prev}for(;t<=n;)w[--c]=1,--n;for(;s<=i;)w[--c]=-1,--i;return w}(n,r,s,i,a,l,u,d),e,t,n,r,a,l,f,m)}(d,e,n,w,b,k,t,g,m,x,h,u,f),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,w={};try{w.Map=Map}catch(u){w.Map=function(){var e=0,t=[],n=[];return{delete:function(o){var s=r(o);return s&&(t.splice(e,1),n.splice(e,1)),s},forEach:function(e,r){t.forEach((function(t,o){e.call(r,n[o],t,this)}),this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(o,s){return n[r(o)?e:t.push(o)-1]=s,this}};function r(n){return-1<(e=t.indexOf(n))}}}var y=w.Map;function v(){return this}function x(e,t){var n="_"+e+"$";return{get:function(){return this[n]||k(this,n,t.call(this,e))},set:function(e){k(this,n,e)}}}var k=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(v.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var $,_,S,E,C,L,A={},T={},R=[],N=T.hasOwnProperty,z=0,j={attributes:A,define:function(e,t){e.indexOf("-")<0?(e in T||(z=R.push(e)),T[e]=t):A[e]=t},invoke:function(e,t){for(var n=0;n<z;n++){var r=R[n];if(N.call(e,r))return T[r](e[r],t)}}},P=Array.isArray||(_=($={}.toString).call([]),function(e){return $.call(e)===_}),I=(S=e,E="fragment",L="content"in D(C="template")?function(e){var t=D(C);return t.innerHTML=e,t.content}:function(e){var t,n=D(E),r=D(C);return O(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=D(E),n=D("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",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<s;i++)r[M](e(o[i],n));return r}:U?q[W]:function(e,t){return e[B](!!t)}),K="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},Q="-"+Math.random().toFixed(6)+"%",J=!1;try{G=e.createElement("template"),V="tabindex","content"in G&&(G.innerHTML="<p "+V+'="'+Q+'"></p>',G.content.childNodes[0].getAttribute(V)==Q)||(Q="_dt: "+Q.slice(1,-1)+";",J=!0)}catch(u){}var X="\x3c!--"+Q+"--\x3e",Y=/^(?: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*)(['\"]?)"+X+"\\2","gi");function ce(e,t,n,r){return"<"+t+n.replace(le,ue)+r}function ue(e,t,n){return t+(n||'"')+Q+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+"></"+t+">"}var pe=J?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<i;){var l=s[a];switch(l.nodeType){case 1:var c=o.concat(a);!function(t,n,r,o){for(var s,i=t.attributes,a=[],l=[],c=pe(i,r),u=c.length,d=0;d<u;){var p=c[d++],f=p.value===Q;if(f||1<(s=p.value.split(X)).length){var h=p.name;if(a.indexOf(h)<0){a.push(h);var m=r.shift().replace(f?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+h+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=i[m]||i[m.toLowerCase()];if(f)n.push(he(g,o,m,null));else{for(var b=s.length-2;b--;)r.shift();n.push(he(g,o,m,s))}}l.push(p)}}for(var w=((d=0)<(u=l.length)&&J&&!("ownerSVGElement"in t));d<u;){var y=l[d++];w&&(y.value=""),t.removeAttribute(y.name)}var v=t.nodeName;if(/^script$/i.test(v)){var x=e.createElement(v);for(u=i.length,d=0;d<u;)x.setAttributeNode(i[d++].cloneNode(!0));x.textContent=t.textContent,t.parentNode.replaceChild(x,t)}}(l,n,r,c),fe(l,n,r,c);break;case 8:var u=l.textContent;if(u===Q)r.shift(),n.push(Y.test(t.nodeName)?me(t,o):{type:"any",node:l,path:o.concat(a)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"👻":t.removeChild(l),a--,i--}break;case 3:Y.test(t.nodeName)&&K.call(l.textContent)===X&&(r.shift(),n.push(me(t,o)))}a++}}function he(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function me(e,t){return{type:"text",node:e,path:t}}var ge,be=(ge=new n,{get:function(e){return ge.get(e)},set:function(e,t){return ge.set(e,t),t}});function we(e,t){var n=(e.convert||function(e){return e.join(X).replace(ae,de).replace(ie,ce)})(t),r=e.transform;r&&(n=r(n));var o=I(n,e.type);ve(o);var s=[];return fe(o,s,t.slice(0),[]),{content:o,updates:function(n){for(var r=[],o=s.length,i=0,a=0;i<o;){var l=s[i++],c=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,l.path);switch(l.type){case"any":r.push({fn:e.any(c,[]),sparse:!1});break;case"attr":var u=l.sparse,d=e.attribute(c,l.name,l.node);null===u?r.push({fn:d,sparse:!1}):(a+=u.length-2,r.push({fn:d,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(c),sparse:!1}),c.textContent=""}}return o+=a,function(){var e=arguments.length;if(o!==e-1)throw new Error(e-1+" values instead of "+o+"\n"+t.join("${value}"));for(var s=1,i=1;s<e;){var a=r[s-i];if(a.sparse){var l=a.values,c=l[0],u=1,d=l.length;for(i+=d-2;u<d;)c+=arguments[s++]+l[u++];a.fn(c)}else a.fn(arguments[s++])}return n}}}}var ye=[];function ve(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===K.call(r.textContent).length&&e.removeChild(r)}}var xe,ke,$e=(xe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,ke=/([^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),Se(n,!0)}(e,t):Se(e.style,!1)});function _e(e,t,n){return t+"-"+n.toLowerCase()}function Se(e,t){var n,r;return function(o){var s,i,a,l;switch(typeof o){case"object":if(o){if("object"===n){if(!t&&r!==o)for(i in r)i in o||(e[i]="")}else t?e.value="":e.cssText="";for(i in s=t?{}:e,o)a="number"!=typeof(l=o[i])||xe.test(i)?l:l+"px",!t&&/^--/.test(i)?s.setProperty(i,a):s[i]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace(ke,_e),":",e[t],";");return n.join("")}(r=s):r=o;break}default:r!=o&&(n="string",r=o,t?e.value=o||"":e.cssText=o||"")}}}var Ee,Ce,Le=(Ee=[].slice,(Ce=Ae.prototype).ELEMENT_NODE=1,Ce.nodeType=111,Ce.remove=function(e){var t,n=this.childNodes,r=this.firstChild,o=this.lastChild;return this._=null,e&&2===n.length?o.parentNode.removeChild(o):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(o),t.deleteContents()),r},Ce.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,o=0,s=r.length;o<s;o++)t.appendChild(r[o]);return t},Ae);function Ae(e){var t=this.childNodes=Ee.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Te(e){return{html:e}}function Re(e,t){switch(e.nodeType){case Be:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Me:return Re(e.render(),t);default:return e}}function Ne(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(Te).then(t):Promise.resolve(j.invoke(e,t)).then(t)}function ze(e){return null!=e&&"then"in e}var je,Pe,Ie,Oe,De,qe="ownerSVGElement",Me=v.prototype.nodeType,Be=Le.prototype.nodeType,Fe=(Pe=(je={Event:b,WeakSet:u}).Event,Ie=je.WeakSet,Oe=!0,De=null,function(e){return Oe&&(Oe=!Oe,De=new Ie,function(e){var t=new Ie,n=new Ie;try{new MutationObserver(i).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,o=[],s=function(e){o.push(e),clearTimeout(r),r=setTimeout((function(){i(o.splice(r=0,o.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){s({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){s({addedNodes:[e.target],removedNodes:[]})}),!0)}function i(e){for(var r,o=e.length,s=0;s<o;s++)a((r=e[s]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var o,s=new Pe(t),i=e.length,a=0;a<i;1===(o=e[a++]).nodeType&&function e(t,n,r,o,s){De.has(t)&&!o.has(t)&&(s.delete(t),o.add(t),t.dispatchEvent(n));for(var i=t.children||[],a=i.length,l=0;l<a;e(i[l++],n,r,o,s));}(o,s,t,n,r));}}(e.ownerDocument)),De.add(e),e}),We=/^(?:form|list)$/i,Ue=[].slice;function He(t){return this.type=t,function(t){var n=ye,r=ve;return function(o){var s,i,a;return n!==o&&(s=t,i=n=o,a=be.get(i)||be.set(i,we(s,i)),r=a.updates(Z.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ge=!(He.prototype={attribute:function(e,t,n){var r,o=qe in e;if("style"===t)return $e(e,n,o);if("."===t.slice(0,1))return c=e,u=t.slice(1),o?function(e){try{c[u]=e}catch(t){c.setAttribute(u,e)}}:function(e){c[u]=e};if("?"===t.slice(0,1))return i=e,a=t.slice(1),function(e){l!==!!e&&((l=!!e)?i.setAttribute(a,""):i.removeAttribute(a))};if(/^on/.test(t)){var s=t.slice(2);return"connected"===s||"disconnected"===s?Fe(e):t.toLowerCase()in e&&(s=s.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(s,r,!1),(r=t)&&e.addEventListener(s,t,!1))}}if("data"===t||!o&&t in e&&!We.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in j.attributes)return function(n){var o=j.attributes[t](e,n);r!==o&&(null==(r=o)?e.removeAttribute(t):e.setAttribute(t,o))};var i,a,l,c,u,d=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(d&&(d=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,d||(d=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:Re,before:e},o=qe in e?"svg":"html",s=!1;return function i(a){switch(typeof a){case"string":case"number":case"boolean":s?n!==a&&(n=a,t[0].textContent=a):(s=!0,n=a,t=h(e.parentNode,t,[(l=a,e.ownerDocument.createTextNode(l))],r));break;case"function":i(a(e));break;case"object":case"undefined":if(null==a){s=!1,t=h(e.parentNode,t,[],r);break}default:if(s=!1,P(n=a))if(0===a.length)t.length&&(t=h(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":i({html:a});break;case"object":if(P(a[0])&&(a=a.concat.apply([],a)),ze(a[0])){Promise.all(a).then(i);break}default:t=h(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=h(e.parentNode,t,11===a.nodeType?Ue.call(a.childNodes):[a],r):ze(a)?a.then(i):"placeholder"in a?Ne(a,i):"text"in a?i(String(a.text)):"any"in a?i(a.any):"html"in a?t=h(e.parentNode,t,Ue.call(I([].concat(a.html).join(""),o).childNodes),r):i("length"in a?Ue.call(a):j.invoke(a,i))}var l}},text:function(e){var t;return function n(r){var o;t!==r&&("object"==(o=typeof(t=r))&&r?ze(r)?r.then(n):"placeholder"in r?Ne(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?Ue.call(r).join(""):j.invoke(r,n)):"function"==o?n(r(e)):e.textContent=null==r?"":r)}}}),Ve=function(t){var r,o,s,i,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),l=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||l?(o={},s=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return o[t]||(o[t]=e)},Ve=l?s:(i=new n,function(e){return i.get(e)||(n=s(t=e),i.set(t,n),n);var t,n})):Ge=!0,Ze(t)};function Ze(e){return Ge?e:Ve(e)}function Ke(e){for(var t=arguments.length,n=[Ze(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Qe=new n,Je=function(e){var t,n,r;return function(){var o=Ke.apply(null,arguments);return r!==o[0]?(r=o[0],n=new He(e),t=Ye(n.apply(n,o))):n.apply(n,o),t}},Xe=function(e,t){var n=t.indexOf(":"),r=Qe.get(e),o=t;return-1<n&&(o=t.slice(n+1),t=t.slice(0,n)||"html"),r||Qe.set(e,r={}),r[o]||(r[o]=Je(t))},Ye=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Le(t):e},et=new n;function tt(){var e=et.get(this),t=Ke.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new He(qe in this?"svg":"html");et.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var nt,rt,ot,st,it=j.define,at=He.prototype;function lt(e){return arguments.length<2?null==e?Je("html"):"string"==typeof e?lt.wire(null,e):"raw"in e?Je("html")(e):"nodeType"in e?lt.bind(e):Xe(e,"html"):("raw"in e?Je("html"):lt.wire).apply(null,arguments)}return lt.Component=v,lt.bind=function(e){return tt.bind(e)},lt.define=it,lt.diff=h,(lt.hyper=lt).observe=Fe,lt.tagger=at,lt.wire=function(e,t){return null==e?Je(t||"html"):Xe(e,t||"html")},lt._={WeakMap:n,WeakSet:u},nt=Je,rt=new n,ot=Object.create,st=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(v,{for:{configurable:!0,value:function(e,t){return function(e,t,r,o){var s,i,a,l=t.get(e)||st(e,t);switch(typeof o){case"object":case"function":var c=l.w||(l.w=new n);return c.get(o)||(s=c,i=o,a=new e(r),s.set(i,a),a);default:var u=l.p||(l.p=ot(null));return u[o]||(u[o]=new e(r))}}(this,rt.get(e)||(r=e,o=new y,rt.set(r,o),o),e,null==t?"default":t);var r,o}}}),Object.defineProperties(v.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:x("html",nt),svg:x("svg",nt),state:x("state",(function(){return this.defaultState})),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new b(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 o in r)n[o]=r[o];return!1!==t&&this.render(),this}}}),lt}(document); /*! (c) Andrea Giammarchi (ISC) */const ye=we,ve=E,xe=he,ke=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(!(e=e.trim()))throw new TypeError("Invalid input.");let t="",n="",r="",o=null,s=new Map,i="type",a=Array.from(e);for(let e=0;e<a.length;e++){const l=a[e];switch(i){case"type":if("/"===l){i="subtype";continue}t+=l;break;case"subtype":if(";"===l){i="param-start";continue}n+=l;break;case"param-start":if(L.test(l)||";"===l)continue;r+=l,i="param-name";break;case"param-name":if("="===l||";"===l){if("="===l){i="param-value",o=null;continue}s.set(r.toLowerCase(),null),r="";continue}r+=l;break;case"param-value":if('"'==l){i="collect-quoted-string";continue}if(";"===l){o=o.trimEnd(),i="param-start",T(s,r,o),r="";continue}o="string"==typeof o?o+l:l;break;case"collect-quoted-string":if('"'===l){T(s,r,o),i="ignore-input-until-next-param",r="",o=null;continue}if("\\"===l)continue;o="string"==typeof o?o+l:l;break;case"ignore-input-until-next-param":if(";"!==l)continue;i="param-start";break;default:throw new Error(`State machine error - unknown parser mode: ${i} `)}}r&&T(s,r,o);if(""===t.trim()||!C.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!C.test(n))throw new TypeError("Invalid subtype");return{type:t,subtype:n,params:Object.fromEntries(s.entries())}}(e);this.type=t.trim().toLowerCase(),this.subtype=n.trimEnd().toLowerCase(),this.parameters=new Map(Object.entries(r))}get essence(){return`${this.type}/${this.subtype}`}toString(){return function(e){const{parameters:t,essence:n}=e;if(!t.size)return n;let r=";";for(const[e,n]of t.entries())r+=e,null!==n?C.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},$e=be;function _e(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 Se=Object.freeze({__proto__:null,name:"core/reindent",reindent:_e,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=_e(e.innerHTML)}});const Ee=/-/g,Ce=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"});"en"===l||l.startsWith("en-");function Le(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as),e.corsMode&&(n.crossOrigin=e.corsMode)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function Ae(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function Te(e,t="long"){const n=new Intl.ListFormat(l,{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 Re=Te("conjunction"),Ne=Te("disjunction");function ze(e,t){return Re(e,t).join("")}function je(e){return e.trim().replace(/\s+/g," ")}function Pe(e,t=l){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=function(e,t,n=l){return n=n.toLowerCase(),e[n]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function Ie(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){Xe(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}function Oe(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>ye`${e}, `));return ye`${r}${n[n.length-1]}`}function De(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 qe(e){const t=new Set,n="ltNodefault"in e.dataset?"":je(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>je(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(je(e))))}return[...t]}function Me(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 Be(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 Fe(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function We(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 Ue(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 He 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 Ge(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{Me(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),Ve(t),t}function Ve(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...Ze(t)])e.remove()}function*Ze(e){for(;e.nextNode();)yield e.currentNode}class Ke 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 Qe 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||De(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 Je(e,t,n={}){const o={...n,isWarning:!1};r("error",new Qe(e,t,o))}function Xe(e,t,n={}){const o={...n,isWarning:!0};r("warn",new Qe(e,t,o))}function Ye(e){return e?`\`${e}\``:""}function et(e,{quotes:t}={quotes:!1}){return Ne(e,t?e=>Ye(tt(e)):Ye).join("")}function tt(e){return String(e)?`"${e}"`:""}function nt(e,...t){return _e(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 rt=new Map([["text/html","html"],["application/xml","xml"]]);function ot(e,t=document){const n=rt.get(e);if(!n){const t=[...rt.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=st(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function st(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:o}=e;Ve(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),Ae(o);const s=e.createDocumentFragment(),i=e.querySelector("meta[name='viewport']");i&&t.firstChild!==i&&s.appendChild(i);let a=e.querySelector("meta[charset], meta[content*='charset=']");a||(a=ye`<meta charset="utf-8" />`);s.appendChild(a);const l=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=ye` <meta name="generator" content="${l}" /> `;s.appendChild(c),t.prepend(s),r("beforesave",o)}(n);let o="";if("xml"===e)o=(new XMLSerializer).serializeToString(n);else!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&&(o+=(new XMLSerializer).serializeToString(n.doctype)),o+=n.documentElement.outerHTML;return o}t("core/exporter",{rsDocToDataURL:ot});class it{constructor(){this._respecDonePromise=new Promise((e=>{o("end-all",(()=>e()),{once:!0})})),this.errors=[],this.warnings=[],o("error",(e=>{console.error(e,e.toJSON()),this.errors.push(e)})),o("warn",(e=>{console.warn(e,e.toJSON()),this.warnings.push(e)}))}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return st("html",document)}}const at="core/post-process";const lt="core/pre-process";const ct="core/base-runner";async function ut(e){!function(){const e=new it;Object.defineProperty(document,"respec",{value:e})}(),r("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),o("amend-user-config",n),o("end-all",(()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of s)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]})),o=Object.fromEntries(n);Object.assign(e,o),r("amend-user-config",o)}(respecConfig),performance.mark(`${ct}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||Je("Every item in `preProcess` must be a JS function.",lt),t})).map((async t=>{try{return await t(e,document)}catch(e){Je(`Function ${t.name} threw an error during \`preProcess\`.`,lt,{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={},r("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||Je("Every item in `postProcess` must be a JS function.",at),t})).map((async t=>{try{return await t(e,document)}catch(e){Je(`Function ${t.name} threw an error during \`postProcess\`.`,at,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),r("end-all"),Ae(document),performance.mark(`${ct}-end`),performance.measure(ct,`${ct}-start`,`${ct}-end`)}var dt=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} @@ -264,7 +264,7 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} ${Fr} </style>`,o.querySelector("link")),Hr(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const Vr="core/best-practices",Zr={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},Kr=Pe(Zr),Qr=l in Zr?l:"en";var Jr=Object.freeze({__proto__:null,name:Vr,run:function(){const e=document.querySelectorAll(".practicelab"),t=document.getElementById("bp-summary"),n=t?document.createElement("ul"):null;if([...e].forEach(((e,t)=>{const r=De(e,"bp"),o=ye`<a class="marker self-link" href="${`#${r}`}" ><bdi lang="${Qr}">${Kr.best_practice}${t+1}</bdi></a - >`;if(n){const t=ye`<li>${o}: ${Ge(e)}</li>`;n.appendChild(t)}const s=e.closest("div");if(!s)return void e.classList.add("advisement");s.classList.add("advisement");const i=ye`${o.cloneNode(!0)}: ${e}`;s.prepend(...i.childNodes)})),e.length)t&&(t.appendChild(ye`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){Xe("Using best practices summary (#bp-summary) but no best practices found.",Vr),t.remove()}}});const Xr="core/figures",Yr=Pe({en:{list_of_figures:"List of Figures",fig:"Figure "},ja:{fig:"図 ",list_of_figures:"図のリスト"},ko:{fig:"그림 ",list_of_figures:"그림 목록"},nl:{fig:"Figuur ",list_of_figures:"Lijst met figuren"},es:{fig:"Figura ",list_of_figures:"Lista de Figuras"},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var eo=Object.freeze({__proto__:null,name:Xr,run:function(){document.querySelectorAll(":not(picture)>img:not([width]):not([height]):not([srcset])").forEach((e=>{0!==e.naturalHeight&&0!==e.naturalWidth&&(e.height=e.naturalHeight,e.width=e.naturalWidth)}));const e=function(){const e=[];return document.querySelectorAll("figure").forEach(((t,n)=>{const r=t.querySelector("figcaption");if(r)!function(e,t,n){const r=t.textContent;De(e,"fig",r),Fe(t,ye`<span class="fig-title"></span>`),t.prepend(ye`<a class="self-link" href="#${e.id}" + >`;if(n){const t=ye`<li>${o}: ${Ge(e)}</li>`;n.appendChild(t)}const s=e.closest("div");if(!s)return void e.classList.add("advisement");s.classList.add("advisement");const i=ye`${o.cloneNode(!0)}: ${e}`;s.prepend(...i.childNodes)})),e.length)t&&(t.appendChild(ye`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){Xe("Using best practices summary (#bp-summary) but no best practices found.",Vr),t.remove()}}});const Xr="core/figures",Yr=Pe({en:{list_of_figures:"List of Figures",fig:"Figure "},ja:{fig:"図 ",list_of_figures:"図のリスト"},ko:{fig:"그림 ",list_of_figures:"그림 목록"},nl:{fig:"Figuur ",list_of_figures:"Lijst met figuren"},es:{fig:"Figura ",list_of_figures:"Lista de Figuras"},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var eo=Object.freeze({__proto__:null,name:Xr,run:function(){document.querySelectorAll(":not(picture)>img:not([width]):not([height]):not([srcset])").forEach((e=>{e.src.startsWith("data:image/svg+xml;")||e.src.endsWith(".svg")||0!==e.naturalHeight&&0!==e.naturalWidth&&(e.height=e.naturalHeight,e.width=e.naturalWidth)}));const e=function(){const e=[];return document.querySelectorAll("figure").forEach(((t,n)=>{const r=t.querySelector("figcaption");if(r)!function(e,t,n){const r=t.textContent;De(e,"fig",r),Fe(t,ye`<span class="fig-title"></span>`),t.prepend(ye`<a class="self-link" href="#${e.id}" >${Yr.fig}<bdi class="figno">${n+1}</bdi></a >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach((e=>{Me(e,"span").removeAttribute("href")})),ye`<li class="tofline"> <a class="tocxref" href="${`#${e}`}">${n.childNodes}</a> diff --git a/builds/respec-geonovum.js.map b/builds/respec-geonovum.js.map index 56d44a1feb..93cec8b65e 100644 --- a/builds/respec-geonovum.js.map +++ b/builds/respec-geonovum.js.map @@ -1 +1 @@ -{"version":3,"file":"respec-geonovum.js","sources":["../src/core/expose-modules.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/l10n.js","../node_modules/idb/build/wrap-idb-value.js","../node_modules/idb/build/index.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/reindent.js","../src/core/utils.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/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/geonovum.js","../src/core/location-hash.js","../src/core/defaults.js","../src/geonovum/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/geonovum/style.js","../src/geonovum/l10n.js","../src/core/github.js","../src/core/sections.js","../src/core/data-include.js","../src/core/data-transform.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/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/data-cite.js","../src/core/link-to-dfn.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/geonovum/conformance.js","../src/ui/save-html.js","../src/ui/search-specref.js","../src/ui/about-respec.js","../src/core/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/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.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/no-http-props.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/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\nimport { expose } from \"./expose-modules.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.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, options = { once: false }) {\n const listener = e => cb(e.detail);\n subscriptions.addEventListener(topic, listener, options);\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/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), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\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', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\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 * 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 v4.3.0 - a markdown parser\n * Copyright (c) 2011-2023, 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\nfunction getDefaults() {\n return {\n async: false,\n baseUrl: null,\n breaks: false,\n extensions: null,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n hooks: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: null,\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartypants: false,\n tokenizer: null,\n walkTokens: null,\n xhtml: false\n };\n}\n\nlet defaults = getDefaults();\n\nfunction changeDefaults(newDefaults) {\n defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape(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\n/**\n * @param {string} html\n */\nfunction unescape(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;\n\n/**\n * @param {string | RegExp} regex\n * @param {string} opt\n */\nfunction edit(regex, opt) {\n regex = typeof regex === 'string' ? regex : regex.source;\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;\n\n/**\n * @param {boolean} sanitize\n * @param {string} base\n * @param {string} href\n */\nfunction cleanUrl(sanitize, base, href) {\n if (sanitize) {\n let prot;\n try {\n prot = decodeURIComponent(unescape(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\n/**\n * @param {string} base\n * @param {string} href\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(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 = { exec: function noopTest() {} };\n\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n 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 // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) { cells.shift(); }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) { cells.pop(); }\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/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param {string} str\n * @param {string} c\n * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(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.slice(0, l - suffLen);\n}\n\nfunction findClosingBracket(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(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\n/**\n * @param {string} pattern\n * @param {number} count\n */\nfunction repeatString(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\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape(text)\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 */\nclass Tokenizer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\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().replace(this.rules.inline._escapes, '$1') : 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,\n tokens: this.lexer.inline(text)\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(/^ *>[ \\t]?/gm, '');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine,\n line, nextLine, rawLine, itemContents, endEarly;\n\n let bull = cap[1].trim();\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 bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n\n // Check if current bullet point can start a new List Item\n while (src) {\n endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n\n raw = cap[0];\n src = src.substring(raw.length);\n\n line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n nextLine = src.split('\\n', 1)[0];\n\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimLeft();\n } else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n\n blankLine = false;\n\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n\n // Check if following lines should be included in List Item\n while (src) {\n rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n } else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n\n itemContents += '\\n' + nextLine;\n }\n\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n } else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents\n });\n\n list.raw += raw;\n }\n\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimRight();\n list.items[list.items.length - 1].text = itemContents.trimRight();\n list.raw = list.raw.trimRight();\n\n const l = list.items.length;\n\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (i = 0; i < l; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n\n list.loose = hasMultipleLineBreaks;\n }\n }\n\n // Set all items to loose if list is loose\n if (list.loose) {\n for (i = 0; i < l; i++) {\n list.items[i].loose = true;\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 const token = {\n type: 'html',\n raw: cap[0],\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: cap[0]\n };\n if (this.options.sanitize) {\n const text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);\n token.type = 'paragraph';\n token.text = text;\n token.tokens = this.lexer.inline(text);\n }\n return token;\n }\n }\n\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\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]).map(c => { return { text: c }; }),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n rows: cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').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, j, k, row;\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.rows.length;\n for (i = 0; i < l; i++) {\n item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; });\n }\n\n // parse child tokens inside headers and cells\n\n // header child tokens\n l = item.header.length;\n for (j = 0; j < l; j++) {\n item.header[j].tokens = this.lexer.inline(item.header[j].text);\n }\n\n // cell child tokens\n l = item.rows.length;\n for (j = 0; j < l; j++) {\n row = item.rows[j];\n for (k = 0; k < row.length; k++) {\n row[k].tokens = this.lexer.inline(row[k].text);\n }\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 tokens: this.lexer.inline(cap[1])\n };\n }\n }\n\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\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 tokens: this.lexer.inline(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(cap[1])\n };\n }\n }\n\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n } else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n } else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n\n return {\n type: this.options.sanitize\n ? 'text'\n : 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n text: this.options.sanitize\n ? (this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape(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], this.lexer);\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) {\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], this.lexer);\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 const raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\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(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 tokens: this.lexer.inlineTokens(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(this.options.mangle ? mangle(cap[1]) : cap[1]);\n href = 'mailto:' + text;\n } else {\n text = escape(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(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(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n } else {\n href = cap[0];\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, smartypants) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0];\n } else {\n text = escape(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\n/**\n * Block-Level Grammar\n */\nconst block = {\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}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/,\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][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/,\n table: noopTest,\n lheading: /^((?:.|\\n(?!\\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|table| +\\n)[^\\n]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock._label = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nblock._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock.def = edit(block.def)\n .replace('label', block._label)\n .replace('title', block._title)\n .getRegex();\n\nblock.bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nblock.listItemStart = edit(/^( *)(bull) */)\n .replace('bull', block.bullet)\n .getRegex();\n\nblock.list = edit(block.list)\n .replace(/bull/g, block.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block.def.source + ')')\n .getRegex();\n\nblock._tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'\n + '|track|ul';\nblock._comment = /<!--(?!-?>)[\\s\\S]*?(?:-->|$)/;\nblock.html = edit(block.html, 'i')\n .replace('comment', block._comment)\n .replace('tag', block._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('|table', '')\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._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.blockquote = edit(block.blockquote)\n .replace('paragraph', block.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock.normal = { ...block };\n\n/**\n * GFM Block Grammar\n */\n\nblock.gfm = {\n ...block.normal,\n table: '^ *([^\\\\n ].*\\\\|.*)\\\\n' // Header\n + ' {0,3}(?:\\\\| *)?(:?-+:? *(?:\\\\| *:?-+:? *)*)(?:\\\\| *)?' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)' // Cells\n};\n\nblock.gfm.table = edit(block.gfm.table)\n .replace('hr', block.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._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.gfm.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('table', block.gfm.table) // interrupt paragraphs with table\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._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock.pedantic = {\n ...block.normal,\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', block._comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(block.normal._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n};\n\n/**\n * Inline-Level Grammar\n */\nconst inline = {\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)\\]\\[(ref)\\]/,\n nolink: /^!?\\[(ref)\\](?:\\[\\])?/,\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 orphan inside strong () Consume to delim (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._punctuation = '!\"#$%&\\'()+\\\\-.,/:;<=>?@\\\\[\\\\]`^{|}~';\ninline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();\n\n// sequences em should skip over [title](link), `code`, <html>\ninline.blockSkip = /\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>/g;\n// lookbehind is not available on Safari as of version 16\n// inline.escapedEmSt = /(?<=(?:^|[^\\\\)(?:\\\\[^])*)\\\\[*_]/g;\ninline.escapedEmSt = /(?:^|[^\\\\])(?:\\\\\\\\)*\\\\[*_]/g;\n\ninline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();\n\ninline.emStrong.lDelim = edit(inline.emStrong.lDelim)\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;\ninline.autolink = edit(inline.autolink)\n .replace('scheme', inline._scheme)\n .replace('email', inline._email)\n .getRegex();\n\ninline._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline.tag = edit(inline.tag)\n .replace('comment', inline._comment)\n .replace('attribute', inline._attribute)\n .getRegex();\n\ninline._label = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline._href = /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/;\ninline._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline.link = edit(inline.link)\n .replace('label', inline._label)\n .replace('href', inline._href)\n .replace('title', inline._title)\n .getRegex();\n\ninline.reflink = edit(inline.reflink)\n .replace('label', inline._label)\n .replace('ref', block._label)\n .getRegex();\n\ninline.nolink = edit(inline.nolink)\n .replace('ref', block._label)\n .getRegex();\n\ninline.reflinkSearch = edit(inline.reflinkSearch, 'g')\n .replace('reflink', inline.reflink)\n .replace('nolink', inline.nolink)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline.normal = { ...inline };\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline.pedantic = {\n ...inline.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._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline._label)\n .getRegex()\n};\n\n/**\n * GFM Inline Grammar\n */\n\ninline.gfm = {\n ...inline.normal,\n escape: edit(inline.escape).replace('])', '~|])').getRegex(),\n _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,\n url: /^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\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.gfm.url = edit(inline.gfm.url, 'i')\n .replace('email', inline.gfm._extended_email)\n .getRegex();\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\ninline.breaks = {\n ...inline.gfm,\n br: edit(inline.br).replace('{2,}', '*').getRegex(),\n text: edit(inline.gfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n};\n\n/**\n * smartypants text replacement\n * @param {string} text\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 * @param {string} text\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 */\nclass Lexer {\n constructor(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || defaults;\n this.options.tokenizer = this.options.tokenizer || new Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\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\n this.blockTokens(src, this.tokens);\n\n let next;\n while (next = this.inlineQueue.shift()) {\n this.inlineTokens(next.src, next.tokens);\n }\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n } else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n\n let token, 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({ lexer: 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.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n } else {\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' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 // 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 tokens.push(token);\n continue;\n }\n\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\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 (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else 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({ lexer: 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 (this.state.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 this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 this.state.top = true;\n return tokens;\n }\n\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\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 + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);\n 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({ lexer: 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)) {\n src = src.substring(token.raw.length);\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 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 (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 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 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 (!this.state.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({ lexer: 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, 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\n/**\n * Renderer\n */\nclass Renderer {\n constructor(options) {\n this.options = options || defaults;\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(code, true))\n + '</code></pre>\\n';\n }\n\n return '<pre><code class=\"'\n + this.options.langPrefix\n + escape(lang)\n + '\">'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n /**\n * @param {string} quote\n */\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n\n html(html) {\n return html;\n }\n\n /**\n * @param {string} text\n * @param {string} level\n * @param {string} raw\n * @param {any} slugger\n */\n heading(text, level, raw, slugger) {\n if (this.options.headerIds) {\n const id = this.options.headerPrefix + slugger.slug(raw);\n return `<h${level} id=\"${id}\">${text}</h${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 /**\n * @param {string} text\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 /**\n * @param {string} text\n */\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n\n /**\n * @param {string} header\n * @param {string} body\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 /**\n * @param {string} content\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 /**\n * span level renderer\n * @param {string} text\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n\n /**\n * @param {string} text\n */\n em(text) {\n return `<em>${text}</em>`;\n }\n\n /**\n * @param {string} text\n */\n codespan(text) {\n return `<code>${text}</code>`;\n }\n\n br() {\n return this.options.xhtml ? '<br/>' : '<br>';\n }\n\n /**\n * @param {string} text\n */\n del(text) {\n return `<del>${text}</del>`;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\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=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\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 */\nclass 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 */\nclass Slugger {\n constructor() {\n this.seen = {};\n }\n\n /**\n * @param {string} value\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 * @param {string} originalSlug\n * @param {boolean} isDryRun\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\n * 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\n/**\n * Parsing & Compiling\n */\nclass Parser {\n constructor(options) {\n this.options = options || defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new TextRenderer();\n this.slugger = new Slugger();\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({ parser: 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.header[j].tokens),\n { header: true, align: token.align[j] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n body = '';\n l2 = token.rows.length;\n for (j = 0; j < l2; j++) {\n row = token.rows[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].tokens),\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 === 'paragraph') {\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({ parser: 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\nclass Hooks {\n constructor(options) {\n this.options = options || defaults;\n }\n\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess'\n ]);\n\n /**\n * Process markdown before marked\n */\n preprocess(markdown) {\n return markdown;\n }\n\n /**\n * Process HTML after marked is finished\n */\n postprocess(html) {\n return html;\n }\n}\n\nfunction onError(silent, async, callback) {\n return (e) => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n\n if (silent) {\n const msg = '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n if (async) {\n return Promise.resolve(msg);\n }\n if (callback) {\n callback(null, msg);\n return;\n }\n return msg;\n }\n\n if (async) {\n return Promise.reject(e);\n }\n if (callback) {\n callback(e);\n return;\n }\n throw e;\n };\n}\n\nfunction parseMarkdown(lexer, parser) {\n return (src, opt, callback) => {\n if (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n const origOpt = { ...opt };\n opt = { ...marked.defaults, ...origOpt };\n const throwError = onError(opt.silent, opt.async, callback);\n\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n\n checkSanitizeDeprecation(opt);\n\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n tokens = lexer(src, opt);\n } catch (e) {\n return throwError(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(tokens, opt);\n if (opt.hooks) {\n out = opt.hooks.postprocess(out);\n }\n } catch (e) {\n err = e;\n }\n }\n\n opt.highlight = highlight;\n\n return err\n ? throwError(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 if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.walkTokens ? Promise.all(marked.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n const tokens = lexer(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n } catch (e) {\n return throwError(e);\n }\n };\n}\n\n/**\n * Marked\n */\nfunction marked(src, opt, callback) {\n return parseMarkdown(Lexer.lex, Parser.parse)(src, opt, callback);\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n marked.defaults = { ...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 extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };\n\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n\n // set async to true if it was set to true before\n opts.async = marked.defaults.async || opts.async || false;\n\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\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[ext.name];\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 opts.extensions = extensions;\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 Hooks extensions --== //\n if (pack.hooks) {\n const hooks = marked.defaults.hooks || new Hooks();\n for (const prop in pack.hooks) {\n const prevHook = hooks[prop];\n if (Hooks.passThroughHooks.has(prop)) {\n hooks[prop] = (arg) => {\n if (marked.defaults.async) {\n return Promise.resolve(pack.hooks[prop].call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n\n const ret = pack.hooks[prop].call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n } else {\n hooks[prop] = (...args) => {\n let ret = pack.hooks[prop].apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked.defaults.walkTokens;\n opts.walkTokens = function(token) {\n let values = [];\n values.push(pack.walkTokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n\n marked.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(marked, token));\n switch (token.type) {\n case 'table': {\n for (const cell of token.header) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n for (const row of token.rows) {\n for (const cell of row) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n values = values.concat(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 values = values.concat(marked.walkTokens(token[childTokens], callback));\n });\n } else if (token.tokens) {\n values = values.concat(marked.walkTokens(token.tokens, callback));\n }\n }\n }\n }\n return values;\n};\n\n/**\n * Parse Inline\n * @param {string} src\n */\nmarked.parseInline = parseMarkdown(Lexer.lexInline, Parser.parseInline);\n\n/**\n * Expose\n */\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\nmarked.Tokenizer = Tokenizer;\nmarked.Slugger = Slugger;\nmarked.Hooks = Hooks;\nmarked.parse = marked;\n\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = Parser.parse;\nconst lexer = Lexer.lex;\n\nexport { Hooks, Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\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 pluralizeExports = {};\nvar pluralize$1 = {\n get exports(){ return pluralizeExports; },\n set exports(v){ pluralizeExports = v; },\n};\n\n/* global define */\n\n(function (module, exports) {\n\t(function (root, pluralize) {\n\t /* istanbul ignore else */\n\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t // Node.\n\t module.exports = pluralize();\n\t } else {\n\t // Browser global.\n\t root.pluralize = pluralize();\n\t }\n\t})(commonjsGlobal, function () {\n\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t // while other rules can be optimized using an object for instant lookups.\n\t var pluralRules = [];\n\t var singularRules = [];\n\t var uncountables = {};\n\t var irregularPlurals = {};\n\t var irregularSingles = {};\n\n\t /**\n\t * Sanitize a pluralization rule to a usable regular expression.\n\t *\n\t * @param {(RegExp|string)} rule\n\t * @return {RegExp}\n\t */\n\t function sanitizeRule (rule) {\n\t if (typeof rule === 'string') {\n\t return new RegExp('^' + rule + '$', 'i');\n\t }\n\n\t return rule;\n\t }\n\n\t /**\n\t * Pass in a word token to produce a function that can replicate the case on\n\t * another word.\n\t *\n\t * @param {string} word\n\t * @param {string} token\n\t * @return {Function}\n\t */\n\t function restoreCase (word, token) {\n\t // Tokens are an exact match.\n\t if (word === token) return token;\n\n\t // Lower cased words. E.g. \"hello\".\n\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t // Upper cased words. E.g. \"WHISKY\".\n\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t // Title cased words. E.g. \"Title\".\n\t if (word[0] === word[0].toUpperCase()) {\n\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t }\n\n\t // Lower cased words. E.g. \"test\".\n\t return token.toLowerCase();\n\t }\n\n\t /**\n\t * Interpolate a regexp string.\n\t *\n\t * @param {string} str\n\t * @param {Array} args\n\t * @return {string}\n\t */\n\t function interpolate (str, args) {\n\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t return args[index] || '';\n\t });\n\t }\n\n\t /**\n\t * Replace a word using a rule.\n\t *\n\t * @param {string} word\n\t * @param {Array} rule\n\t * @return {string}\n\t */\n\t function replace (word, rule) {\n\t return word.replace(rule[0], function (match, index) {\n\t var result = interpolate(rule[1], arguments);\n\n\t if (match === '') {\n\t return restoreCase(word[index - 1], result);\n\t }\n\n\t return restoreCase(match, result);\n\t });\n\t }\n\n\t /**\n\t * Sanitize a word by passing in the word and sanitization rules.\n\t *\n\t * @param {string} token\n\t * @param {string} word\n\t * @param {Array} rules\n\t * @return {string}\n\t */\n\t function sanitizeWord (token, word, rules) {\n\t // Empty string or doesn't need fixing.\n\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t return word;\n\t }\n\n\t var len = rules.length;\n\n\t // Iterate over the sanitization rules and use the first one to match.\n\t while (len--) {\n\t var rule = rules[len];\n\n\t if (rule[0].test(word)) return replace(word, rule);\n\t }\n\n\t return word;\n\t }\n\n\t /**\n\t * Replace a word with the updated word.\n\t *\n\t * @param {Object} replaceMap\n\t * @param {Object} keepMap\n\t * @param {Array} rules\n\t * @return {Function}\n\t */\n\t function replaceWord (replaceMap, keepMap, rules) {\n\t return function (word) {\n\t // Get the correct token and case restoration functions.\n\t var token = word.toLowerCase();\n\n\t // Check against the keep object map.\n\t if (keepMap.hasOwnProperty(token)) {\n\t return restoreCase(word, token);\n\t }\n\n\t // Check against the replacement map for a direct word replacement.\n\t if (replaceMap.hasOwnProperty(token)) {\n\t return restoreCase(word, replaceMap[token]);\n\t }\n\n\t // Run all the rules against the word.\n\t return sanitizeWord(token, word, rules);\n\t };\n\t }\n\n\t /**\n\t * Check if a word is part of the map.\n\t */\n\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t return function (word) {\n\t var token = word.toLowerCase();\n\n\t if (keepMap.hasOwnProperty(token)) return true;\n\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t return sanitizeWord(token, token, rules) === token;\n\t };\n\t }\n\n\t /**\n\t * Pluralize or singularize a word based on the passed in count.\n\t *\n\t * @param {string} word The word to pluralize\n\t * @param {number} count How many of the word exist\n\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t * @return {string}\n\t */\n\t function pluralize (word, count, inclusive) {\n\t var pluralized = count === 1\n\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t return (inclusive ? count + ' ' : '') + pluralized;\n\t }\n\n\t /**\n\t * Pluralize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.plural = replaceWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Check if a word is plural.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isPlural = checkWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Singularize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.singular = replaceWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Check if a word is singular.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isSingular = checkWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Add a pluralization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addPluralRule = function (rule, replacement) {\n\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add a singularization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addSingularRule = function (rule, replacement) {\n\t singularRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add an uncountable word rule.\n\t *\n\t * @param {(string|RegExp)} word\n\t */\n\t pluralize.addUncountableRule = function (word) {\n\t if (typeof word === 'string') {\n\t uncountables[word.toLowerCase()] = true;\n\t return;\n\t }\n\n\t // Set singular and plural references for the word.\n\t pluralize.addPluralRule(word, '$0');\n\t pluralize.addSingularRule(word, '$0');\n\t };\n\n\t /**\n\t * Add an irregular word definition.\n\t *\n\t * @param {string} single\n\t * @param {string} plural\n\t */\n\t pluralize.addIrregularRule = function (single, plural) {\n\t plural = plural.toLowerCase();\n\t single = single.toLowerCase();\n\n\t irregularSingles[single] = plural;\n\t irregularPlurals[plural] = single;\n\t };\n\n\t /**\n\t * Irregular rules.\n\t */\n\t [\n\t // Pronouns.\n\t ['I', 'we'],\n\t ['me', 'us'],\n\t ['he', 'they'],\n\t ['she', 'they'],\n\t ['them', 'them'],\n\t ['myself', 'ourselves'],\n\t ['yourself', 'yourselves'],\n\t ['itself', 'themselves'],\n\t ['herself', 'themselves'],\n\t ['himself', 'themselves'],\n\t ['themself', 'themselves'],\n\t ['is', 'are'],\n\t ['was', 'were'],\n\t ['has', 'have'],\n\t ['this', 'these'],\n\t ['that', 'those'],\n\t // Words ending in with a consonant and `o`.\n\t ['echo', 'echoes'],\n\t ['dingo', 'dingoes'],\n\t ['volcano', 'volcanoes'],\n\t ['tornado', 'tornadoes'],\n\t ['torpedo', 'torpedoes'],\n\t // Ends with `us`.\n\t ['genus', 'genera'],\n\t ['viscus', 'viscera'],\n\t // Ends with `ma`.\n\t ['stigma', 'stigmata'],\n\t ['stoma', 'stomata'],\n\t ['dogma', 'dogmata'],\n\t ['lemma', 'lemmata'],\n\t ['schema', 'schemata'],\n\t ['anathema', 'anathemata'],\n\t // Other irregular rules.\n\t ['ox', 'oxen'],\n\t ['axe', 'axes'],\n\t ['die', 'dice'],\n\t ['yes', 'yeses'],\n\t ['foot', 'feet'],\n\t ['eave', 'eaves'],\n\t ['goose', 'geese'],\n\t ['tooth', 'teeth'],\n\t ['quiz', 'quizzes'],\n\t ['human', 'humans'],\n\t ['proof', 'proofs'],\n\t ['carve', 'carves'],\n\t ['valve', 'valves'],\n\t ['looey', 'looies'],\n\t ['thief', 'thieves'],\n\t ['groove', 'grooves'],\n\t ['pickaxe', 'pickaxes'],\n\t ['passerby', 'passersby']\n\t ].forEach(function (rule) {\n\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Pluralization rules.\n\t */\n\t [\n\t [/s?$/i, 's'],\n\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t [/([^aeiou]ese)$/i, '$1'],\n\t [/(ax|test)is$/i, '$1es'],\n\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t [/(e[mn]u)s?$/i, '$1s'],\n\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t [/(her|at|gr)o$/i, '$1oes'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t [/sis$/i, 'ses'],\n\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t [/(child)(?:ren)?$/i, '$1ren'],\n\t [/eaux$/i, '$0'],\n\t [/m[ae]n$/i, 'men'],\n\t ['thou', 'you']\n\t ].forEach(function (rule) {\n\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Singularization rules.\n\t */\n\t [\n\t [/s$/i, ''],\n\t [/(ss)$/i, '$1'],\n\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t [/ies$/i, 'y'],\n\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t [/(seraph|cherub)im$/i, '$1'],\n\t [/(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\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t [/(test)(?:is|es)$/i, '$1is'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t [/(matr|append)ices$/i, '$1ix'],\n\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t [/(child)ren$/i, '$1'],\n\t [/(eau)x?$/i, '$1'],\n\t [/men$/i, 'man']\n\t ].forEach(function (rule) {\n\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Uncountable rules.\n\t */\n\t [\n\t // Singular words with no plurals.\n\t 'adulthood',\n\t 'advice',\n\t 'agenda',\n\t 'aid',\n\t 'aircraft',\n\t 'alcohol',\n\t 'ammo',\n\t 'analytics',\n\t 'anime',\n\t 'athletics',\n\t 'audio',\n\t 'bison',\n\t 'blood',\n\t 'bream',\n\t 'buffalo',\n\t 'butter',\n\t 'carp',\n\t 'cash',\n\t 'chassis',\n\t 'chess',\n\t 'clothing',\n\t 'cod',\n\t 'commerce',\n\t 'cooperation',\n\t 'corps',\n\t 'debris',\n\t 'diabetes',\n\t 'digestion',\n\t 'elk',\n\t 'energy',\n\t 'equipment',\n\t 'excretion',\n\t 'expertise',\n\t 'firmware',\n\t 'flounder',\n\t 'fun',\n\t 'gallows',\n\t 'garbage',\n\t 'graffiti',\n\t 'hardware',\n\t 'headquarters',\n\t 'health',\n\t 'herpes',\n\t 'highjinks',\n\t 'homework',\n\t 'housework',\n\t 'information',\n\t 'jeans',\n\t 'justice',\n\t 'kudos',\n\t 'labour',\n\t 'literature',\n\t 'machinery',\n\t 'mackerel',\n\t 'mail',\n\t 'media',\n\t 'mews',\n\t 'moose',\n\t 'music',\n\t 'mud',\n\t 'manga',\n\t 'news',\n\t 'only',\n\t 'personnel',\n\t 'pike',\n\t 'plankton',\n\t 'pliers',\n\t 'police',\n\t 'pollution',\n\t 'premises',\n\t 'rain',\n\t 'research',\n\t 'rice',\n\t 'salmon',\n\t 'scissors',\n\t 'series',\n\t 'sewage',\n\t 'shambles',\n\t 'shrimp',\n\t 'software',\n\t 'species',\n\t 'staff',\n\t 'swine',\n\t 'tennis',\n\t 'traffic',\n\t 'transportation',\n\t 'trout',\n\t 'tuna',\n\t 'wealth',\n\t 'welfare',\n\t 'whiting',\n\t 'wildebeest',\n\t 'wildlife',\n\t 'you',\n\t /pok[eé]mon$/i,\n\t // Regexes.\n\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t /deer$/i, // \"deer\", \"reindeer\"\n\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t /measles$/i,\n\t /o[iu]s$/i, // \"carnivorous\"\n\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t /sheep$/i\n\t ].forEach(pluralize.addUncountableRule);\n\n\t return pluralize;\n\t});\n} (pluralize$1));\n\nvar pluralize = pluralizeExports;\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/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _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\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\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// 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\";\nimport { reindent } from \"./reindent.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\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\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 if (opts.corsMode) {\n linkElem.crossOrigin = opts.corsMode;\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 * @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 = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || 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/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\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 * 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 * @param {Element} element\n */\nexport function 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/**\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 const linkifiedStr = 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 return reindent(linkifiedStr);\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 */\nimport { serialize } from \"../core/exporter.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","// @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\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\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 padding: 0.2em 0em;\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 will-change: opacity;\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 {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\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 font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.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-warning-list > li::before {\n content: \"⚠️\";\n}\n\n.respec-error-list > li::before {\n content: \"💥\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\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 top: 10%;\n background: #fff;\n border: 5px solid #666;\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\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-menu button.respec-option {\n background: white;\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 background-color: #eeeeee;\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\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\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\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 */\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;\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 image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\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\nconst config = {\n sanitize: false,\n gfm: true,\n headerIds: false,\n langPrefix: \"\",\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\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\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\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\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 processMDSections(document.body);\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 // Frankenstein the whole thing back together\n newBody.append(rsUI);\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 { markdownToHtml } from \"./markdown.js\";\nimport { reindent } from \"./reindent.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\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${err.message}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\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/geonovum/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/geonovum/style.js\"),\n import(\"../src/geonovum/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/data-transform.js\"),\n import(\"../src/core/inlines.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/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.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/geonovum/conformance.js\"),\n import(\"../src/ui/save-html.js\"),\n import(\"../src/ui/search-specref.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/core/highlight.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/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n /* Linter 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/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/no-http-props.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 * 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 Geonovum documents\n */\nexport const name = \"geonovum/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\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 \"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 \"cc-by-nd\",\n {\n name: \"Creative Commons Attribution-NoDerivatives 4.0 International Public License\",\n short: \"CC-BY-ND\",\n url: \"https://creativecommons.org/licenses/by-nd/4.0/legalcode.nl\",\n },\n ],\n]);\n\nconst geonovumDefaults = {\n lint: {\n \"privsec-section\": true,\n },\n doJsonLd: true,\n license: \"cc-by\",\n specStatus: \"GN-BASIS\",\n logos: [\n {\n src: \"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.svg\",\n alt: \"Geonovum\",\n id: \"Geonovum\",\n height: 67,\n width: 132,\n url: \"https://www.geonovum.nl/\",\n },\n ],\n};\n\nfunction computeProps(conf) {\n return {\n isCCBY: conf.license === \"cc-by\",\n licenseInfo: licenses.get(conf.license),\n isBasic: conf.specStatus === \"GN-BASIS\",\n isRegular: conf.specStatus === \"GN-BASIS\",\n };\n}\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...geonovumDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...geonovumDefaults,\n ...conf,\n lint,\n });\n // computed properties\n Object.assign(conf, computeProps(conf));\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/* --- INLINES --- */\n:is(h1, h2, h3, h4, h5, h6, a) 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\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\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\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 geonovum/style\n// Inserts a link to the appropriate Geonovum 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 = \"geonovum/style\";\nfunction attachFixupScript(doc, version) {\n const script = doc.createElement(\"script\");\n script.addEventListener(\n \"load\",\n () => {\n if (window.location.hash) {\n window.location.href = window.location.hash;\n }\n },\n { once: true }\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 createStyle(css_name) {\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = `https://tools.geostandaarden.nl/respec/style/${css_name}.css`;\n return link;\n}\n\nfunction createResourceHints() {\n /** @type ResourceHintOption[] */\n const opts = [\n {\n hint: \"preconnect\", // for W3C fixup.js\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: \"preconnect\", // for Geonovum styles and scripts.\n href: \"https://tools.geostandaarden.nl/\",\n },\n {\n hint: \"preload\", // all Geonovum specs import base.css.\n href: \"https://tools.geostandaarden.nl/respec/style/base.css\",\n as: \"style\",\n },\n {\n hint: \"preload\", // all Geonovum specs show the logo.\n href: \"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.svg\",\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\n// Collect elements for insertion (document fragment)\nconst elements = createResourceHints();\n\n// add favicon for Geonovum\nconst favicon = document.createElement(\"link\");\nfavicon.rel = \"shortcut icon\";\nfavicon.type = \"image/x-icon\";\nfavicon.href =\n \"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.ico\";\ndocument.head.prepend(favicon);\n\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\n// export function run(conf, doc, cb) {\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = \"`respecConfig.specStatus` missing. Defaulting to 'GN-BASIS'.\";\n conf.specStatus = \"GN-BASIS\";\n showWarning(msg, name);\n }\n\n if (document.body.querySelector(\"figure.scalable\")) {\n // Apply leaflet style if class scalable is present\n document.head.appendChild(createStyle(\"leaflet\"));\n document.head.appendChild(createStyle(\"font-awesome\"));\n }\n\n let styleFile = \"\";\n\n // Figure out which style file to use.\n switch (conf.specStatus.toUpperCase()) {\n case \"GN-WV\":\n styleFile += \"GN-WV.css\";\n break;\n case \"GN-CV\":\n styleFile += \"GN-CV.css\";\n break;\n case \"GN-VV\":\n styleFile += \"GN-VV.css\";\n break;\n case \"GN-DEF\":\n styleFile += \"GN-DEF.css\";\n break;\n case \"GN-BASIS\":\n styleFile += \"GN-BASIS.css\";\n break;\n default:\n styleFile = \"base.css\";\n }\n\n if (!conf.noToc) {\n sub(\n \"end-all\",\n () => {\n attachFixupScript(document, \"2016\");\n },\n { once: true }\n );\n }\n const finalStyleURL = `https://tools.geostandaarden.nl/respec/style/${styleFile}`;\n linkCSS(document, finalStyleURL);\n}\n","// @ts-check\n// Module geonovum/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 = \"geonovum/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 Geonovum publications and the latest\n revision of this document can be found via\n <a href=\"https://www.geonovum.nl/geo-standaarden/alle-standaarden\"\n >https://www.geonovum.nl/geo-standaarden/alle-standaarden</a\n >(in Dutch).`,\n },\n nl: {\n status_at_publication: html`Deze paragraaf beschrijft de status van dit\n document ten tijde van publicatie. Het is mogelijk dat er actuelere\n versies van dit document bestaan. Een lijst van Geonovum publicaties en de\n laatste gepubliceerde versie van dit document zijn te vinden op\n <a href=\"https://www.geonovum.nl/geo-standaarden/alle-standaarden\"\n >https://www.geonovum.nl/geo-standaarden/alle-standaarden</a\n >.`,\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 commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\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 // 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 if (!conf.excludeGithubLinks) {\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: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n}\n","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\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) {\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(structure(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/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\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\nexport function run() {\n restructure(document.body);\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 { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.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 await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\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()).slice(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 if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\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","// @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// 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\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\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 {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\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, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\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-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 { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || 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>${text || identifier}</code></a\n >${!text || textArgs ? html`<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 /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = 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 // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\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<BiblioData?>} 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<BiblioData?>} 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 {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\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 {BiblioData} 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 let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\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 // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\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 // 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\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, 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 reference_not_found: \"Reference not found.\",\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 reference_not_found: \"Referencia no encontrada.\",\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 [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PER\", \"W3C Proposed Edited Recommendation\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\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 > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\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} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\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(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\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 /\\bMÜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NÖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDÜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKÖNNEN\\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\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-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}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></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 return html`<a\n data-link-type=\"dfn\"\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\", \"svg\"];\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","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 {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\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 [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup 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\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\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\n:is(aside,div).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\n:is(aside,div).example {\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}\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\";\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 const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\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 addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\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.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\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\";\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 {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 issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\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 });\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}${\n report.number ? ` ${report.number}` : \"\"\n }`;\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 `<h1>${l10n.issue_summary}</h1>`\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/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#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 allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\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`<h1>Best Practices Summary</h1>`);\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 getPreviousSections,\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`<h1>${l10n.list_of_figures}</h1>`,\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(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\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","// @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 if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\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 if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\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 { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\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 =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\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 return dfnsByType.get(linkType) || 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 (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\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\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 =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\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 getIntlData,\n parents,\n renameElement,\n showError,\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 (\"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, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) 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 const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","// @ts-check\n// Module geonovum/conformance\n// Handle the conformance section properly.\n// based on W3C conformance, but because Geonovum has different requirements, have a separate module\nimport { html } from \"../core/import-maps.js\";\nexport const name = \"geonovum/conformance\";\n\n/**\n * @param {Element} conformance\n */\nfunction processConformance(conformance) {\n const content = html`\n <h2>Conformiteit</h2>\n <p>\n Naast onderdelen die als niet normatief gemarkeerd zijn, zijn ook alle\n diagrammen, voorbeelden, en noten in dit document niet normatief. Verder\n is alles in dit document normatief.\n </p>\n <p>Informatief en normatief.</p>\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run() {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance) {\n processConformance(conformance);\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, 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 ext: \"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 ext: \"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 ext: \"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\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"💾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\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/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","/*\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","/* 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\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\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 \"table\": {\n processTable(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 // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\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 processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.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","/* 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-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\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","// @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,#w3c-state)\");\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 \"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\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\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 \"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\") && conf[key]) || 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"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","subscriptions","EventTarget","pub","topic","detail","dispatchEvent","CustomEvent","parent","self","args","String","JSON","stringify","stack","postMessage","location","origin","sub","cb","options","once","addEventListener","e","removeList","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","wrapFunction","func","IDBDatabase","prototype","transaction","IDBCursor","advance","continue","continuePrimaryKey","includes","apply","unwrap","this","storeNames","tx","call","sort","transformCachableValue","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","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","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","params","paramName","paramValue","test","toLowerCase","getDefaults","baseUrl","breaks","extensions","gfm","headerIds","headerPrefix","highlight","hooks","langPrefix","mangle","pedantic","renderer","sanitize","sanitizer","silent","smartypants","tokenizer","walkTokens","xhtml","defaults","escapeTest","escapeReplace","RegExp","source","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape","encode","unescapeTest","unescape","_","n","charAt","fromCharCode","parseInt","substring","caret","edit","regex","opt","obj","val","getRegex","nonWordAndColonTest","originIndependentUrl","cleanUrl","base","href","prot","decodeURIComponent","indexOf","baseUrls","justDomain","rtrim","relativeBase","protocol","domain","resolveUrl","encodeURI","noopTest","exec","splitCells","tableRow","count","cells","match","offset","str","escaped","curr","split","i","trim","length","pop","splice","push","invert","l","suffLen","currChar","slice","repeatString","pattern","outputLink","cap","link","raw","lexer","title","text","state","inLink","token","type","tokens","inlineTokens","Tokenizer","constructor","space","src","rules","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","node","matchIndentInNode","indentInNode","join","indentCodeCompensation","inline","_escapes","heading","trimmed","depth","hr","blockquote","top","blockTokens","list","istask","ischecked","indent","blankLine","endsWithBlankLine","line","nextLine","rawLine","itemContents","endEarly","bull","isordered","ordered","start","loose","items","itemRegex","t","repeat","trimLeft","search","nextBulletRegex","Math","min","hrRegex","fencesBeginRegex","headingBeginRegex","task","checked","trimRight","spacers","filter","hasMultipleLineBreaks","pre","def","tag","table","item","header","align","rows","j","k","row","lheading","paragraph","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","level","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","lDelim","nextChar","punctuation","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","rDelimAst","rDelimUnd","lastIndex","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","_paragraph","_label","_title","bullet","listItemStart","_tag","_comment","normal","reflinkSearch","out","charCodeAt","random","toString","_punctuation","blockSkip","escapedEmSt","_scheme","_email","_attribute","_href","strong","middle","endAst","endUnd","em","_extended_email","Lexer","Object","create","inlineQueue","static","lex","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","startBlock","startIndex","Infinity","tempSrc","tempStart","forEach","getStartIndex","errMsg","console","keepPrevChar","keys","lastIndexOf","startInline","Renderer$1","infostring","quote","slugger","slug","body","listitem","checkbox","tablerow","content","tablecell","flags","image","TextRenderer","Slugger","seen","serialize","getNextSafeSlug","originalSlug","isDryRun","occurenceAccumulator","hasOwnProperty","dryrun","Parser","Renderer","textRenderer","parse","parseInline","l2","l3","cell","itemBody","ret","renderers","parser","unshift","Hooks","Set","preprocess","markdown","postprocess","parseMarkdown","origOpt","throwError","message","msg","onError","marked","warn","checkSanitizeDeprecation","err","pending","setTimeout","setOptions","newDefaults","use","childTokens","pack","opts","ext","prevRenderer","prevTokenizer","prevHook","passThroughHooks","arg","values","concat","lexInline","globalThis","global","module","pluralizeExports","exports","v","root","pluralize","commonjsGlobal","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","interpolate","arguments","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","defineProperty","r","a","delete","configurable","o","s","WeakSet","add","m","u","insertBefore","selected","selectedIndex","f","querySelectorAll","y","w","x","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","p","g","Array","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","_wire$","defineProperties","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","isArray","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","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","it","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","bind","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","input","subtype","TypeError","parserMode","inputArray","from","position","char","trimEnd","fromEntries","entries","parseMimeType","parameters","essence","mimeType","size","paramStr","key","_pluralize","reindent","lines","indents","leastIndent","getElementsByTagName","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","docLang","startsWith","createResourceHint","URL","baseURI","linkElem","rel","hint","corsMode","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","norm","getIntlData","localizationStrings","data","getIntlDataForKey","runTransforms","flist","funcArgs","methods","meth","showWarning","htmlJoinComma","array","joined","addId","pfx","txt","noLC","id","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","ref","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","wrapper","parents","selector","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","super","getCanonicalKey","existingKey","find","makeSafeCopy","clone","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","comment","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","assign","elements","markAsOffending","toJSON","details","showError","pluginName","toMDCode","codedJoinOr","quotes","addQuotes","docLink","strings","endsWith","linkingText","mimeTypes","rsDocToDataURL","format","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$f","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","trimStart","firstTwo","lastTwo","indentation","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","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","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","ev","locationHash","l10n$o","style$1","l10n$m","github$1","dataInclude","reindent$1","dataTransform","inlines","examples","issuesNotes","bestPractices","figures","biblio$1","linkToDfn","dataCite","renderBiblio","contrib","sections","fixHeaders","structure","informative","idHeaders","conformance","saveHtml","searchSpecref","aboutRespec","seo","dataTests","listSorter","highlightVars$1","algorithms","anchorExpander","dfnPanel","checkCharset","checkPunctuation","localRefsExist","noHeadinglessSections","noUnusedVars","privsecSection","noHttpProps","ReSpec.run","hash","hasLink","isLegacyFrag","coreDefaults","lint","specStatus","highlightVars","addSectionLinks","licenses","short","geonovumDefaults","doJsonLd","license","logos","alt","height","width","isCCBY","licenseInfo","isBasic","isRegular","computeProps","css$d","noReSpecCSS","createStyle","css_name","resourceHints","createResourceHints","favicon","meta","delimiter","separator","toKeyValuePairs","createMetaViewport","styleFile","noToc","attachFixupScript","urls","frag","reduce","nextLink","linkCSS","additions","status_at_publication","nl","resolveGithubPromise","rejectGithubPromise","github","file_a_bug","participate","commit_history","ko","zh","ja","es","ghURL","tempURL","repoURL","org","repo","pathname","branch","issueBase","commitHistoryURL","newProps","edDraftURI","githubToken","githubUser","atRiskBase","otherLinks","pullBase","shortName","githubAPI","hostname","excludeGithubLinks","otherLink","normalizedGHObj","apiBase","fullName","issuesURL","pullsURL","newIssuesURL","normalizedConfig","DOMBuilder","current","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","include","includeId","response","fetch","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","identifier","renderParent","nullable","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","reverse","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","unique","now","Date","range","IDBKeyRange","lowerBound","openCursor","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","aliasesAndRefs","alias","reference","promisesToAdd","flatMap","isInDB","put","close","stores","clearStorePromises","clear","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","ok","status","json","oneHourFromNow","headers","addAll","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","authors","etAl","publisher","date","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","re","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","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","contains","dfnFor","validateDefinition","idl","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","computeExport","export","addContractDefaults","dfnsWithNoType","exportableDfns","titles","pluralizeDfn","dfnTexts","getPluralizer","terms","plurals","userDefinedPlurals","uniquePlurals","css$b","makeTitle","num","report","number","div","inAside","exampleTitle","css$9","editors_note","feature_at_risk","issue","issue_summary","no_issues_in_spec","note","handleIssues","ins","ghIssues","getIssueNumber","Number","issueNumber","createIssueNumberGetter","issueList","inno","displayType","isFeatureAtRisk","isIssue","isEdNote","getIssueType","isInline","dataNum","titleParent","ghIssue","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","hasChildNodes","insertAdjacentHTML","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","issueNumbers","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","img","naturalHeight","naturalWidth","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","every","decorateTableOfFigures","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","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","duplicates","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","first","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","xref","editors","editor","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","toHTML","res","maxAge","Request","cache","cachedResponse","caches","clonedResponse","customHeaders","Headers","expiryDate","toISOString","cacheResponse","Response","blob","fetchAndCache","showContributors","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","prefix","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","Boolean","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","processConformance","save_snapshot","downloadLinks","epubURL","toDownloadLink","sep","concatDate","publishDate","filename","saveDialog","supportsDownload","HTMLAnchorElement","search_specref","specrefSearchUI","about_respec","getEntriesByType","duration","round","perfEntryToTR","firstParagraph","metaElem","css$7","fetchBase","currentScript","workerPromise","workerScript","respecWorker$1","default","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","testSuiteURI","handleDuplicates","testURLs","codedJoinAnd","uniqueList","testables","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$5","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","outputDoc","textNode","Text","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","definition","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","isRecTrack","saysPrivOrSec","saysConsiderations","offendingMembers","getOwnPropertyNames"],"mappings":"sDACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAAON,OAAOC,QAAQG,QAAQE,EAAI,IAEpCE,QAAQC,IAAIL,GAASM,MAAKC,GAAWR,KAAYQ,IACrD,EACEV,EAAQG,QAAU,GAClBJ,OAAOC,QAAUA,CACnB,CAMO,SAASW,EAAOC,EAAMC,GACtBf,IACHC,OAAOC,QAAQG,QAAQS,GAAQC,EAEnC,CCtBO,MAIDC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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,QACV3F,SAAQ,SAAU2F,GAClB,OAAOR,EAAU6B,gBAAgBrB,EAAK,GAAIA,EAAK,GACpD,IAKG,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,WACA3F,QAAQmF,EAAU8B,oBAEb9B,CACV,IAGA,IAAIA,GAAYJ,GCjgBsBqC,GAAU,SAASC,GAAgB,IAAIlO,EAAE,CAAE,EAAC,IAAIA,EAAEjP,QAAQA,OAAod,CAA5c,MAAMd,GAAG+P,EAAEjP,QAAQ,SAASiP,EAAE/P,GAAG,IAAIiJ,EAAEjJ,E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,EAAG6gB,YAAa9X,MACd,MAAM+/C,EAAgB,uBAAuB/lD,KAAKgG,GAC5CggD,EAAqB,qBAAqBhmD,KAAKgG,GACrD,OAAQ+/C,GAAiBC,GAAuBD,CAAa,MAW/Dl9B,GAAYjvB,GAAKyZ,IAAKzb,GAAM,CAAEqvB,KAAMrtB,GAAKqtB,MAE7C,ICnCA,MACarvB,GAAO,kCAYdgC,GAAOwuB,GAVe,CAC1BtuB,GAAI,CACFuZ,IAAKka,EAAO,oCAAoC,oBAChDtG,KAAM,0DAER0V,GAAI,CACFtpB,IAAKka,EAAO,GAAG,kCACftG,KAAM,0EAKH,SAAawL,GAClB,IAAKA,EAAKkH,OAhBK,iBAiBb,OAKF,IAAKthC,OAAOQ,SAASwK,KAAKsjB,WAAW,QACnC,OAGF,MAAMs/B,EAAmBl3C,OAAOm3C,oBAAoBzzB,GAEjDxoB,QAAO0b,GAAQA,EAAI8H,SAAS,QAAUgF,EAAK9M,IAAiB,WAARA,IAEpD1b,QAAO0b,GACN,IAAIkB,IAAI4L,EAAK9M,GAAMttB,OAAOQ,SAASwK,MAAMA,KAAKsjB,WAAW,aAG7D,GAAIs/B,EAAiBlhD,OAAQ,CAC3B,MAAMsL,EAAO6X,GAAQ+9B,GAAkBtgC,GAAO4H,EAAO,GAAG,IAAI5H,SAC5DkD,GAAYjvB,GAAKyZ,IAAKzb,GAAM,CAAEqvB,KAAMrtB,GAAKqtB,KAAO5W,GACjD,CACH","x_google_ignoreList":[4,5,6,7,9]} \ No newline at end of file +{"version":3,"file":"respec-geonovum.js","sources":["../src/core/expose-modules.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/l10n.js","../node_modules/idb/build/wrap-idb-value.js","../node_modules/idb/build/index.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/reindent.js","../src/core/utils.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/markdown.js","../src/core/ui.js","../src/respec.js","../profiles/geonovum.js","../src/core/location-hash.js","../src/core/defaults.js","../src/geonovum/defaults.js","../src/styles/respec.css.js","../src/core/style.js","../src/geonovum/style.js","../src/geonovum/l10n.js","../src/core/github.js","../src/core/sections.js","../src/core/data-include.js","../src/core/data-transform.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/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/data-cite.js","../src/core/link-to-dfn.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/structure.js","../src/core/informative.js","../src/core/id-headers.js","../src/geonovum/conformance.js","../src/ui/save-html.js","../src/ui/search-specref.js","../src/ui/about-respec.js","../src/core/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/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/linter-rules/check-charset.js","../src/core/linter-rules/check-punctuation.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/no-http-props.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/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\nimport { expose } from \"./expose-modules.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.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, options = { once: false }) {\n const listener = e => cb(e.detail);\n subscriptions.addEventListener(topic, listener, options);\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/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), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\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', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\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 * 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 v4.3.0 - a markdown parser\n * Copyright (c) 2011-2023, 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\nfunction getDefaults() {\n return {\n async: false,\n baseUrl: null,\n breaks: false,\n extensions: null,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n hooks: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: null,\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartypants: false,\n tokenizer: null,\n walkTokens: null,\n xhtml: false\n };\n}\n\nlet defaults = getDefaults();\n\nfunction changeDefaults(newDefaults) {\n defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape(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\n/**\n * @param {string} html\n */\nfunction unescape(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;\n\n/**\n * @param {string | RegExp} regex\n * @param {string} opt\n */\nfunction edit(regex, opt) {\n regex = typeof regex === 'string' ? regex : regex.source;\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;\n\n/**\n * @param {boolean} sanitize\n * @param {string} base\n * @param {string} href\n */\nfunction cleanUrl(sanitize, base, href) {\n if (sanitize) {\n let prot;\n try {\n prot = decodeURIComponent(unescape(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\n/**\n * @param {string} base\n * @param {string} href\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(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 = { exec: function noopTest() {} };\n\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n 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 // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) { cells.shift(); }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) { cells.pop(); }\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/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param {string} str\n * @param {string} c\n * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(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.slice(0, l - suffLen);\n}\n\nfunction findClosingBracket(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(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\n/**\n * @param {string} pattern\n * @param {number} count\n */\nfunction repeatString(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\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape(text)\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 */\nclass Tokenizer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\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().replace(this.rules.inline._escapes, '$1') : 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,\n tokens: this.lexer.inline(text)\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(/^ *>[ \\t]?/gm, '');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine,\n line, nextLine, rawLine, itemContents, endEarly;\n\n let bull = cap[1].trim();\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 bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n\n // Check if current bullet point can start a new List Item\n while (src) {\n endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n\n raw = cap[0];\n src = src.substring(raw.length);\n\n line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n nextLine = src.split('\\n', 1)[0];\n\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimLeft();\n } else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n\n blankLine = false;\n\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n\n // Check if following lines should be included in List Item\n while (src) {\n rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n } else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n\n itemContents += '\\n' + nextLine;\n }\n\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n } else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents\n });\n\n list.raw += raw;\n }\n\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimRight();\n list.items[list.items.length - 1].text = itemContents.trimRight();\n list.raw = list.raw.trimRight();\n\n const l = list.items.length;\n\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (i = 0; i < l; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n\n list.loose = hasMultipleLineBreaks;\n }\n }\n\n // Set all items to loose if list is loose\n if (list.loose) {\n for (i = 0; i < l; i++) {\n list.items[i].loose = true;\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 const token = {\n type: 'html',\n raw: cap[0],\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: cap[0]\n };\n if (this.options.sanitize) {\n const text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);\n token.type = 'paragraph';\n token.text = text;\n token.tokens = this.lexer.inline(text);\n }\n return token;\n }\n }\n\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\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]).map(c => { return { text: c }; }),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n rows: cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').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, j, k, row;\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.rows.length;\n for (i = 0; i < l; i++) {\n item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; });\n }\n\n // parse child tokens inside headers and cells\n\n // header child tokens\n l = item.header.length;\n for (j = 0; j < l; j++) {\n item.header[j].tokens = this.lexer.inline(item.header[j].text);\n }\n\n // cell child tokens\n l = item.rows.length;\n for (j = 0; j < l; j++) {\n row = item.rows[j];\n for (k = 0; k < row.length; k++) {\n row[k].tokens = this.lexer.inline(row[k].text);\n }\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 tokens: this.lexer.inline(cap[1])\n };\n }\n }\n\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\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 tokens: this.lexer.inline(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(cap[1])\n };\n }\n }\n\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n } else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n } else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n\n return {\n type: this.options.sanitize\n ? 'text'\n : 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n text: this.options.sanitize\n ? (this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape(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], this.lexer);\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) {\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], this.lexer);\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 const raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\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(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 tokens: this.lexer.inlineTokens(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(this.options.mangle ? mangle(cap[1]) : cap[1]);\n href = 'mailto:' + text;\n } else {\n text = escape(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(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(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n } else {\n href = cap[0];\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, smartypants) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0];\n } else {\n text = escape(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\n/**\n * Block-Level Grammar\n */\nconst block = {\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}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/,\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][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/,\n table: noopTest,\n lheading: /^((?:.|\\n(?!\\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|table| +\\n)[^\\n]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock._label = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nblock._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock.def = edit(block.def)\n .replace('label', block._label)\n .replace('title', block._title)\n .getRegex();\n\nblock.bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nblock.listItemStart = edit(/^( *)(bull) */)\n .replace('bull', block.bullet)\n .getRegex();\n\nblock.list = edit(block.list)\n .replace(/bull/g, block.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block.def.source + ')')\n .getRegex();\n\nblock._tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'\n + '|track|ul';\nblock._comment = /<!--(?!-?>)[\\s\\S]*?(?:-->|$)/;\nblock.html = edit(block.html, 'i')\n .replace('comment', block._comment)\n .replace('tag', block._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('|table', '')\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._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.blockquote = edit(block.blockquote)\n .replace('paragraph', block.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock.normal = { ...block };\n\n/**\n * GFM Block Grammar\n */\n\nblock.gfm = {\n ...block.normal,\n table: '^ *([^\\\\n ].*\\\\|.*)\\\\n' // Header\n + ' {0,3}(?:\\\\| *)?(:?-+:? *(?:\\\\| *:?-+:? *)*)(?:\\\\| *)?' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)' // Cells\n};\n\nblock.gfm.table = edit(block.gfm.table)\n .replace('hr', block.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._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.gfm.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('table', block.gfm.table) // interrupt paragraphs with table\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._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock.pedantic = {\n ...block.normal,\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', block._comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(block.normal._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n};\n\n/**\n * Inline-Level Grammar\n */\nconst inline = {\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)\\]\\[(ref)\\]/,\n nolink: /^!?\\[(ref)\\](?:\\[\\])?/,\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 orphan inside strong () Consume to delim (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._punctuation = '!\"#$%&\\'()+\\\\-.,/:;<=>?@\\\\[\\\\]`^{|}~';\ninline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();\n\n// sequences em should skip over [title](link), `code`, <html>\ninline.blockSkip = /\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>/g;\n// lookbehind is not available on Safari as of version 16\n// inline.escapedEmSt = /(?<=(?:^|[^\\\\)(?:\\\\[^])*)\\\\[*_]/g;\ninline.escapedEmSt = /(?:^|[^\\\\])(?:\\\\\\\\)*\\\\[*_]/g;\n\ninline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();\n\ninline.emStrong.lDelim = edit(inline.emStrong.lDelim)\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;\ninline.autolink = edit(inline.autolink)\n .replace('scheme', inline._scheme)\n .replace('email', inline._email)\n .getRegex();\n\ninline._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline.tag = edit(inline.tag)\n .replace('comment', inline._comment)\n .replace('attribute', inline._attribute)\n .getRegex();\n\ninline._label = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline._href = /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/;\ninline._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline.link = edit(inline.link)\n .replace('label', inline._label)\n .replace('href', inline._href)\n .replace('title', inline._title)\n .getRegex();\n\ninline.reflink = edit(inline.reflink)\n .replace('label', inline._label)\n .replace('ref', block._label)\n .getRegex();\n\ninline.nolink = edit(inline.nolink)\n .replace('ref', block._label)\n .getRegex();\n\ninline.reflinkSearch = edit(inline.reflinkSearch, 'g')\n .replace('reflink', inline.reflink)\n .replace('nolink', inline.nolink)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline.normal = { ...inline };\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline.pedantic = {\n ...inline.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._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline._label)\n .getRegex()\n};\n\n/**\n * GFM Inline Grammar\n */\n\ninline.gfm = {\n ...inline.normal,\n escape: edit(inline.escape).replace('])', '~|])').getRegex(),\n _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,\n url: /^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\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.gfm.url = edit(inline.gfm.url, 'i')\n .replace('email', inline.gfm._extended_email)\n .getRegex();\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\ninline.breaks = {\n ...inline.gfm,\n br: edit(inline.br).replace('{2,}', '*').getRegex(),\n text: edit(inline.gfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n};\n\n/**\n * smartypants text replacement\n * @param {string} text\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 * @param {string} text\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 */\nclass Lexer {\n constructor(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || defaults;\n this.options.tokenizer = this.options.tokenizer || new Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\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\n this.blockTokens(src, this.tokens);\n\n let next;\n while (next = this.inlineQueue.shift()) {\n this.inlineTokens(next.src, next.tokens);\n }\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n } else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n\n let token, 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({ lexer: 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.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n } else {\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' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 // 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 tokens.push(token);\n continue;\n }\n\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\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 (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else 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({ lexer: 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 (this.state.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 this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 this.state.top = true;\n return tokens;\n }\n\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\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 + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);\n 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({ lexer: 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)) {\n src = src.substring(token.raw.length);\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 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 (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 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 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 (!this.state.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({ lexer: 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, 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\n/**\n * Renderer\n */\nclass Renderer {\n constructor(options) {\n this.options = options || defaults;\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(code, true))\n + '</code></pre>\\n';\n }\n\n return '<pre><code class=\"'\n + this.options.langPrefix\n + escape(lang)\n + '\">'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n /**\n * @param {string} quote\n */\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n\n html(html) {\n return html;\n }\n\n /**\n * @param {string} text\n * @param {string} level\n * @param {string} raw\n * @param {any} slugger\n */\n heading(text, level, raw, slugger) {\n if (this.options.headerIds) {\n const id = this.options.headerPrefix + slugger.slug(raw);\n return `<h${level} id=\"${id}\">${text}</h${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 /**\n * @param {string} text\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 /**\n * @param {string} text\n */\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n\n /**\n * @param {string} header\n * @param {string} body\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 /**\n * @param {string} content\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 /**\n * span level renderer\n * @param {string} text\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n\n /**\n * @param {string} text\n */\n em(text) {\n return `<em>${text}</em>`;\n }\n\n /**\n * @param {string} text\n */\n codespan(text) {\n return `<code>${text}</code>`;\n }\n\n br() {\n return this.options.xhtml ? '<br/>' : '<br>';\n }\n\n /**\n * @param {string} text\n */\n del(text) {\n return `<del>${text}</del>`;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\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=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\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 */\nclass 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 */\nclass Slugger {\n constructor() {\n this.seen = {};\n }\n\n /**\n * @param {string} value\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 * @param {string} originalSlug\n * @param {boolean} isDryRun\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\n * 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\n/**\n * Parsing & Compiling\n */\nclass Parser {\n constructor(options) {\n this.options = options || defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new TextRenderer();\n this.slugger = new Slugger();\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({ parser: 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.header[j].tokens),\n { header: true, align: token.align[j] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n body = '';\n l2 = token.rows.length;\n for (j = 0; j < l2; j++) {\n row = token.rows[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].tokens),\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 === 'paragraph') {\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({ parser: 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\nclass Hooks {\n constructor(options) {\n this.options = options || defaults;\n }\n\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess'\n ]);\n\n /**\n * Process markdown before marked\n */\n preprocess(markdown) {\n return markdown;\n }\n\n /**\n * Process HTML after marked is finished\n */\n postprocess(html) {\n return html;\n }\n}\n\nfunction onError(silent, async, callback) {\n return (e) => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n\n if (silent) {\n const msg = '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n if (async) {\n return Promise.resolve(msg);\n }\n if (callback) {\n callback(null, msg);\n return;\n }\n return msg;\n }\n\n if (async) {\n return Promise.reject(e);\n }\n if (callback) {\n callback(e);\n return;\n }\n throw e;\n };\n}\n\nfunction parseMarkdown(lexer, parser) {\n return (src, opt, callback) => {\n if (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n const origOpt = { ...opt };\n opt = { ...marked.defaults, ...origOpt };\n const throwError = onError(opt.silent, opt.async, callback);\n\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n\n checkSanitizeDeprecation(opt);\n\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n tokens = lexer(src, opt);\n } catch (e) {\n return throwError(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(tokens, opt);\n if (opt.hooks) {\n out = opt.hooks.postprocess(out);\n }\n } catch (e) {\n err = e;\n }\n }\n\n opt.highlight = highlight;\n\n return err\n ? throwError(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 if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.walkTokens ? Promise.all(marked.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n const tokens = lexer(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n } catch (e) {\n return throwError(e);\n }\n };\n}\n\n/**\n * Marked\n */\nfunction marked(src, opt, callback) {\n return parseMarkdown(Lexer.lex, Parser.parse)(src, opt, callback);\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n marked.defaults = { ...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 extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };\n\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n\n // set async to true if it was set to true before\n opts.async = marked.defaults.async || opts.async || false;\n\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\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[ext.name];\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 opts.extensions = extensions;\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 Hooks extensions --== //\n if (pack.hooks) {\n const hooks = marked.defaults.hooks || new Hooks();\n for (const prop in pack.hooks) {\n const prevHook = hooks[prop];\n if (Hooks.passThroughHooks.has(prop)) {\n hooks[prop] = (arg) => {\n if (marked.defaults.async) {\n return Promise.resolve(pack.hooks[prop].call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n\n const ret = pack.hooks[prop].call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n } else {\n hooks[prop] = (...args) => {\n let ret = pack.hooks[prop].apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked.defaults.walkTokens;\n opts.walkTokens = function(token) {\n let values = [];\n values.push(pack.walkTokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n\n marked.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(marked, token));\n switch (token.type) {\n case 'table': {\n for (const cell of token.header) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n for (const row of token.rows) {\n for (const cell of row) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n values = values.concat(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 values = values.concat(marked.walkTokens(token[childTokens], callback));\n });\n } else if (token.tokens) {\n values = values.concat(marked.walkTokens(token.tokens, callback));\n }\n }\n }\n }\n return values;\n};\n\n/**\n * Parse Inline\n * @param {string} src\n */\nmarked.parseInline = parseMarkdown(Lexer.lexInline, Parser.parseInline);\n\n/**\n * Expose\n */\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\nmarked.Tokenizer = Tokenizer;\nmarked.Slugger = Slugger;\nmarked.Hooks = Hooks;\nmarked.parse = marked;\n\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = Parser.parse;\nconst lexer = Lexer.lex;\n\nexport { Hooks, Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\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 pluralizeExports = {};\nvar pluralize$1 = {\n get exports(){ return pluralizeExports; },\n set exports(v){ pluralizeExports = v; },\n};\n\n/* global define */\n\n(function (module, exports) {\n\t(function (root, pluralize) {\n\t /* istanbul ignore else */\n\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t // Node.\n\t module.exports = pluralize();\n\t } else {\n\t // Browser global.\n\t root.pluralize = pluralize();\n\t }\n\t})(commonjsGlobal, function () {\n\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t // while other rules can be optimized using an object for instant lookups.\n\t var pluralRules = [];\n\t var singularRules = [];\n\t var uncountables = {};\n\t var irregularPlurals = {};\n\t var irregularSingles = {};\n\n\t /**\n\t * Sanitize a pluralization rule to a usable regular expression.\n\t *\n\t * @param {(RegExp|string)} rule\n\t * @return {RegExp}\n\t */\n\t function sanitizeRule (rule) {\n\t if (typeof rule === 'string') {\n\t return new RegExp('^' + rule + '$', 'i');\n\t }\n\n\t return rule;\n\t }\n\n\t /**\n\t * Pass in a word token to produce a function that can replicate the case on\n\t * another word.\n\t *\n\t * @param {string} word\n\t * @param {string} token\n\t * @return {Function}\n\t */\n\t function restoreCase (word, token) {\n\t // Tokens are an exact match.\n\t if (word === token) return token;\n\n\t // Lower cased words. E.g. \"hello\".\n\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t // Upper cased words. E.g. \"WHISKY\".\n\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t // Title cased words. E.g. \"Title\".\n\t if (word[0] === word[0].toUpperCase()) {\n\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t }\n\n\t // Lower cased words. E.g. \"test\".\n\t return token.toLowerCase();\n\t }\n\n\t /**\n\t * Interpolate a regexp string.\n\t *\n\t * @param {string} str\n\t * @param {Array} args\n\t * @return {string}\n\t */\n\t function interpolate (str, args) {\n\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t return args[index] || '';\n\t });\n\t }\n\n\t /**\n\t * Replace a word using a rule.\n\t *\n\t * @param {string} word\n\t * @param {Array} rule\n\t * @return {string}\n\t */\n\t function replace (word, rule) {\n\t return word.replace(rule[0], function (match, index) {\n\t var result = interpolate(rule[1], arguments);\n\n\t if (match === '') {\n\t return restoreCase(word[index - 1], result);\n\t }\n\n\t return restoreCase(match, result);\n\t });\n\t }\n\n\t /**\n\t * Sanitize a word by passing in the word and sanitization rules.\n\t *\n\t * @param {string} token\n\t * @param {string} word\n\t * @param {Array} rules\n\t * @return {string}\n\t */\n\t function sanitizeWord (token, word, rules) {\n\t // Empty string or doesn't need fixing.\n\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t return word;\n\t }\n\n\t var len = rules.length;\n\n\t // Iterate over the sanitization rules and use the first one to match.\n\t while (len--) {\n\t var rule = rules[len];\n\n\t if (rule[0].test(word)) return replace(word, rule);\n\t }\n\n\t return word;\n\t }\n\n\t /**\n\t * Replace a word with the updated word.\n\t *\n\t * @param {Object} replaceMap\n\t * @param {Object} keepMap\n\t * @param {Array} rules\n\t * @return {Function}\n\t */\n\t function replaceWord (replaceMap, keepMap, rules) {\n\t return function (word) {\n\t // Get the correct token and case restoration functions.\n\t var token = word.toLowerCase();\n\n\t // Check against the keep object map.\n\t if (keepMap.hasOwnProperty(token)) {\n\t return restoreCase(word, token);\n\t }\n\n\t // Check against the replacement map for a direct word replacement.\n\t if (replaceMap.hasOwnProperty(token)) {\n\t return restoreCase(word, replaceMap[token]);\n\t }\n\n\t // Run all the rules against the word.\n\t return sanitizeWord(token, word, rules);\n\t };\n\t }\n\n\t /**\n\t * Check if a word is part of the map.\n\t */\n\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t return function (word) {\n\t var token = word.toLowerCase();\n\n\t if (keepMap.hasOwnProperty(token)) return true;\n\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t return sanitizeWord(token, token, rules) === token;\n\t };\n\t }\n\n\t /**\n\t * Pluralize or singularize a word based on the passed in count.\n\t *\n\t * @param {string} word The word to pluralize\n\t * @param {number} count How many of the word exist\n\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t * @return {string}\n\t */\n\t function pluralize (word, count, inclusive) {\n\t var pluralized = count === 1\n\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t return (inclusive ? count + ' ' : '') + pluralized;\n\t }\n\n\t /**\n\t * Pluralize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.plural = replaceWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Check if a word is plural.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isPlural = checkWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Singularize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.singular = replaceWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Check if a word is singular.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isSingular = checkWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Add a pluralization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addPluralRule = function (rule, replacement) {\n\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add a singularization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addSingularRule = function (rule, replacement) {\n\t singularRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add an uncountable word rule.\n\t *\n\t * @param {(string|RegExp)} word\n\t */\n\t pluralize.addUncountableRule = function (word) {\n\t if (typeof word === 'string') {\n\t uncountables[word.toLowerCase()] = true;\n\t return;\n\t }\n\n\t // Set singular and plural references for the word.\n\t pluralize.addPluralRule(word, '$0');\n\t pluralize.addSingularRule(word, '$0');\n\t };\n\n\t /**\n\t * Add an irregular word definition.\n\t *\n\t * @param {string} single\n\t * @param {string} plural\n\t */\n\t pluralize.addIrregularRule = function (single, plural) {\n\t plural = plural.toLowerCase();\n\t single = single.toLowerCase();\n\n\t irregularSingles[single] = plural;\n\t irregularPlurals[plural] = single;\n\t };\n\n\t /**\n\t * Irregular rules.\n\t */\n\t [\n\t // Pronouns.\n\t ['I', 'we'],\n\t ['me', 'us'],\n\t ['he', 'they'],\n\t ['she', 'they'],\n\t ['them', 'them'],\n\t ['myself', 'ourselves'],\n\t ['yourself', 'yourselves'],\n\t ['itself', 'themselves'],\n\t ['herself', 'themselves'],\n\t ['himself', 'themselves'],\n\t ['themself', 'themselves'],\n\t ['is', 'are'],\n\t ['was', 'were'],\n\t ['has', 'have'],\n\t ['this', 'these'],\n\t ['that', 'those'],\n\t // Words ending in with a consonant and `o`.\n\t ['echo', 'echoes'],\n\t ['dingo', 'dingoes'],\n\t ['volcano', 'volcanoes'],\n\t ['tornado', 'tornadoes'],\n\t ['torpedo', 'torpedoes'],\n\t // Ends with `us`.\n\t ['genus', 'genera'],\n\t ['viscus', 'viscera'],\n\t // Ends with `ma`.\n\t ['stigma', 'stigmata'],\n\t ['stoma', 'stomata'],\n\t ['dogma', 'dogmata'],\n\t ['lemma', 'lemmata'],\n\t ['schema', 'schemata'],\n\t ['anathema', 'anathemata'],\n\t // Other irregular rules.\n\t ['ox', 'oxen'],\n\t ['axe', 'axes'],\n\t ['die', 'dice'],\n\t ['yes', 'yeses'],\n\t ['foot', 'feet'],\n\t ['eave', 'eaves'],\n\t ['goose', 'geese'],\n\t ['tooth', 'teeth'],\n\t ['quiz', 'quizzes'],\n\t ['human', 'humans'],\n\t ['proof', 'proofs'],\n\t ['carve', 'carves'],\n\t ['valve', 'valves'],\n\t ['looey', 'looies'],\n\t ['thief', 'thieves'],\n\t ['groove', 'grooves'],\n\t ['pickaxe', 'pickaxes'],\n\t ['passerby', 'passersby']\n\t ].forEach(function (rule) {\n\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Pluralization rules.\n\t */\n\t [\n\t [/s?$/i, 's'],\n\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t [/([^aeiou]ese)$/i, '$1'],\n\t [/(ax|test)is$/i, '$1es'],\n\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t [/(e[mn]u)s?$/i, '$1s'],\n\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t [/(her|at|gr)o$/i, '$1oes'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t [/sis$/i, 'ses'],\n\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t [/(child)(?:ren)?$/i, '$1ren'],\n\t [/eaux$/i, '$0'],\n\t [/m[ae]n$/i, 'men'],\n\t ['thou', 'you']\n\t ].forEach(function (rule) {\n\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Singularization rules.\n\t */\n\t [\n\t [/s$/i, ''],\n\t [/(ss)$/i, '$1'],\n\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t [/ies$/i, 'y'],\n\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t [/(seraph|cherub)im$/i, '$1'],\n\t [/(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\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t [/(test)(?:is|es)$/i, '$1is'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t [/(matr|append)ices$/i, '$1ix'],\n\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t [/(child)ren$/i, '$1'],\n\t [/(eau)x?$/i, '$1'],\n\t [/men$/i, 'man']\n\t ].forEach(function (rule) {\n\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Uncountable rules.\n\t */\n\t [\n\t // Singular words with no plurals.\n\t 'adulthood',\n\t 'advice',\n\t 'agenda',\n\t 'aid',\n\t 'aircraft',\n\t 'alcohol',\n\t 'ammo',\n\t 'analytics',\n\t 'anime',\n\t 'athletics',\n\t 'audio',\n\t 'bison',\n\t 'blood',\n\t 'bream',\n\t 'buffalo',\n\t 'butter',\n\t 'carp',\n\t 'cash',\n\t 'chassis',\n\t 'chess',\n\t 'clothing',\n\t 'cod',\n\t 'commerce',\n\t 'cooperation',\n\t 'corps',\n\t 'debris',\n\t 'diabetes',\n\t 'digestion',\n\t 'elk',\n\t 'energy',\n\t 'equipment',\n\t 'excretion',\n\t 'expertise',\n\t 'firmware',\n\t 'flounder',\n\t 'fun',\n\t 'gallows',\n\t 'garbage',\n\t 'graffiti',\n\t 'hardware',\n\t 'headquarters',\n\t 'health',\n\t 'herpes',\n\t 'highjinks',\n\t 'homework',\n\t 'housework',\n\t 'information',\n\t 'jeans',\n\t 'justice',\n\t 'kudos',\n\t 'labour',\n\t 'literature',\n\t 'machinery',\n\t 'mackerel',\n\t 'mail',\n\t 'media',\n\t 'mews',\n\t 'moose',\n\t 'music',\n\t 'mud',\n\t 'manga',\n\t 'news',\n\t 'only',\n\t 'personnel',\n\t 'pike',\n\t 'plankton',\n\t 'pliers',\n\t 'police',\n\t 'pollution',\n\t 'premises',\n\t 'rain',\n\t 'research',\n\t 'rice',\n\t 'salmon',\n\t 'scissors',\n\t 'series',\n\t 'sewage',\n\t 'shambles',\n\t 'shrimp',\n\t 'software',\n\t 'species',\n\t 'staff',\n\t 'swine',\n\t 'tennis',\n\t 'traffic',\n\t 'transportation',\n\t 'trout',\n\t 'tuna',\n\t 'wealth',\n\t 'welfare',\n\t 'whiting',\n\t 'wildebeest',\n\t 'wildlife',\n\t 'you',\n\t /pok[eé]mon$/i,\n\t // Regexes.\n\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t /deer$/i, // \"deer\", \"reindeer\"\n\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t /measles$/i,\n\t /o[iu]s$/i, // \"carnivorous\"\n\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t /sheep$/i\n\t ].forEach(pluralize.addUncountableRule);\n\n\t return pluralize;\n\t});\n} (pluralize$1));\n\nvar pluralize = pluralizeExports;\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/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _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\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\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// 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\";\nimport { reindent } from \"./reindent.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\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\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 if (opts.corsMode) {\n linkElem.crossOrigin = opts.corsMode;\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 * @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 = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || 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/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\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 * 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 * @param {Element} element\n */\nexport function 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/**\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 const linkifiedStr = 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 return reindent(linkifiedStr);\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 */\nimport { serialize } from \"../core/exporter.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","// @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\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\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 padding: 0.2em 0em;\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 will-change: opacity;\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 {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\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 font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.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-warning-list > li::before {\n content: \"⚠️\";\n}\n\n.respec-error-list > li::before {\n content: \"💥\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\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 top: 10%;\n background: #fff;\n border: 5px solid #666;\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\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-menu button.respec-option {\n background: white;\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 background-color: #eeeeee;\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\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\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\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 */\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;\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 image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\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\nconst config = {\n sanitize: false,\n gfm: true,\n headerIds: false,\n langPrefix: \"\",\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\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\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\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\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 processMDSections(document.body);\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 // Frankenstein the whole thing back together\n newBody.append(rsUI);\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 { markdownToHtml } from \"./markdown.js\";\nimport { reindent } from \"./reindent.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\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${err.message}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\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/geonovum/defaults.js\"),\n import(\"../src/core/style.js\"),\n import(\"../src/geonovum/style.js\"),\n import(\"../src/geonovum/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/data-transform.js\"),\n import(\"../src/core/inlines.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/biblio.js\"),\n import(\"../src/core/link-to-dfn.js\"),\n import(\"../src/core/data-cite.js\"),\n import(\"../src/core/render-biblio.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.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/geonovum/conformance.js\"),\n import(\"../src/ui/save-html.js\"),\n import(\"../src/ui/search-specref.js\"),\n import(\"../src/ui/about-respec.js\"),\n import(\"../src/core/seo.js\"),\n import(\"../src/core/highlight.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/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n /* Linter 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/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/no-http-props.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 * 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 Geonovum documents\n */\nexport const name = \"geonovum/defaults\";\nimport { coreDefaults } from \"../core/defaults.js\";\n\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 \"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 \"cc-by-nd\",\n {\n name: \"Creative Commons Attribution-NoDerivatives 4.0 International Public License\",\n short: \"CC-BY-ND\",\n url: \"https://creativecommons.org/licenses/by-nd/4.0/legalcode.nl\",\n },\n ],\n]);\n\nconst geonovumDefaults = {\n lint: {\n \"privsec-section\": true,\n },\n doJsonLd: true,\n license: \"cc-by\",\n specStatus: \"GN-BASIS\",\n logos: [\n {\n src: \"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.svg\",\n alt: \"Geonovum\",\n id: \"Geonovum\",\n height: 67,\n width: 132,\n url: \"https://www.geonovum.nl/\",\n },\n ],\n};\n\nfunction computeProps(conf) {\n return {\n isCCBY: conf.license === \"cc-by\",\n licenseInfo: licenses.get(conf.license),\n isBasic: conf.specStatus === \"GN-BASIS\",\n isRegular: conf.specStatus === \"GN-BASIS\",\n };\n}\n\nexport function run(conf) {\n // assign the defaults\n const lint =\n conf.lint === false\n ? false\n : {\n ...coreDefaults.lint,\n ...geonovumDefaults.lint,\n ...conf.lint,\n };\n Object.assign(conf, {\n ...coreDefaults,\n ...geonovumDefaults,\n ...conf,\n lint,\n });\n // computed properties\n Object.assign(conf, computeProps(conf));\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/* --- INLINES --- */\n:is(h1, h2, h3, h4, h5, h6, a) 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\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\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\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 geonovum/style\n// Inserts a link to the appropriate Geonovum 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 = \"geonovum/style\";\nfunction attachFixupScript(doc, version) {\n const script = doc.createElement(\"script\");\n script.addEventListener(\n \"load\",\n () => {\n if (window.location.hash) {\n window.location.href = window.location.hash;\n }\n },\n { once: true }\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 createStyle(css_name) {\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = `https://tools.geostandaarden.nl/respec/style/${css_name}.css`;\n return link;\n}\n\nfunction createResourceHints() {\n /** @type ResourceHintOption[] */\n const opts = [\n {\n hint: \"preconnect\", // for W3C fixup.js\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: \"preconnect\", // for Geonovum styles and scripts.\n href: \"https://tools.geostandaarden.nl/\",\n },\n {\n hint: \"preload\", // all Geonovum specs import base.css.\n href: \"https://tools.geostandaarden.nl/respec/style/base.css\",\n as: \"style\",\n },\n {\n hint: \"preload\", // all Geonovum specs show the logo.\n href: \"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.svg\",\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\n// Collect elements for insertion (document fragment)\nconst elements = createResourceHints();\n\n// add favicon for Geonovum\nconst favicon = document.createElement(\"link\");\nfavicon.rel = \"shortcut icon\";\nfavicon.type = \"image/x-icon\";\nfavicon.href =\n \"https://tools.geostandaarden.nl/respec/style/logos/Geonovum.ico\";\ndocument.head.prepend(favicon);\n\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\n// export function run(conf, doc, cb) {\nexport function run(conf) {\n if (!conf.specStatus) {\n const msg = \"`respecConfig.specStatus` missing. Defaulting to 'GN-BASIS'.\";\n conf.specStatus = \"GN-BASIS\";\n showWarning(msg, name);\n }\n\n if (document.body.querySelector(\"figure.scalable\")) {\n // Apply leaflet style if class scalable is present\n document.head.appendChild(createStyle(\"leaflet\"));\n document.head.appendChild(createStyle(\"font-awesome\"));\n }\n\n let styleFile = \"\";\n\n // Figure out which style file to use.\n switch (conf.specStatus.toUpperCase()) {\n case \"GN-WV\":\n styleFile += \"GN-WV.css\";\n break;\n case \"GN-CV\":\n styleFile += \"GN-CV.css\";\n break;\n case \"GN-VV\":\n styleFile += \"GN-VV.css\";\n break;\n case \"GN-DEF\":\n styleFile += \"GN-DEF.css\";\n break;\n case \"GN-BASIS\":\n styleFile += \"GN-BASIS.css\";\n break;\n default:\n styleFile = \"base.css\";\n }\n\n if (!conf.noToc) {\n sub(\n \"end-all\",\n () => {\n attachFixupScript(document, \"2016\");\n },\n { once: true }\n );\n }\n const finalStyleURL = `https://tools.geostandaarden.nl/respec/style/${styleFile}`;\n linkCSS(document, finalStyleURL);\n}\n","// @ts-check\n// Module geonovum/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 = \"geonovum/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 Geonovum publications and the latest\n revision of this document can be found via\n <a href=\"https://www.geonovum.nl/geo-standaarden/alle-standaarden\"\n >https://www.geonovum.nl/geo-standaarden/alle-standaarden</a\n >(in Dutch).`,\n },\n nl: {\n status_at_publication: html`Deze paragraaf beschrijft de status van dit\n document ten tijde van publicatie. Het is mogelijk dat er actuelere\n versies van dit document bestaan. Een lijst van Geonovum publicaties en de\n laatste gepubliceerde versie van dit document zijn te vinden op\n <a href=\"https://www.geonovum.nl/geo-standaarden/alle-standaarden\"\n >https://www.geonovum.nl/geo-standaarden/alle-standaarden</a\n >.`,\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 commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\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 // 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 if (!conf.excludeGithubLinks) {\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: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n}\n","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\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) {\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(structure(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/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\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\nexport function run() {\n restructure(document.body);\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 { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.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 await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\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()).slice(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 if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\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","// @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// 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\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\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 {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\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, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\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-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 { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || 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>${text || identifier}</code></a\n >${!text || textArgs ? html`<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 /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = 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 // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\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<BiblioData?>} 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<BiblioData?>} 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 {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\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 {BiblioData} 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 let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\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 // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\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 // 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\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, 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 reference_not_found: \"Reference not found.\",\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 reference_not_found: \"Referencia no encontrada.\",\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 [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PER\", \"W3C Proposed Edited Recommendation\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\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 > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\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} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\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(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\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 /\\bMÜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NÖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDÜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKÖNNEN\\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\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-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}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></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 return html`<a\n data-link-type=\"dfn\"\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\", \"svg\"];\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","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 {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\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 [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup 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\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\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\n:is(aside,div).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\n:is(aside,div).example {\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}\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\";\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 const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\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 addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\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.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\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\";\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 {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 issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\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 });\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}${\n report.number ? ` ${report.number}` : \"\"\n }`;\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 `<h1>${l10n.issue_summary}</h1>`\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/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#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 allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\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`<h1>Best Practices Summary</h1>`);\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 getPreviousSections,\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`<h1>${l10n.list_of_figures}</h1>`,\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(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\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 // Don't add width and height to SVGs\n // https://github.com/w3c/respec/issues/3435\n if (img.src.startsWith(\"data:image/svg+xml;\")) return;\n if (img.src.endsWith(\".svg\")) return;\n\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n\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","// @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 if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\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 if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\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 { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\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 =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\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 return dfnsByType.get(linkType) || 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 (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\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\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 =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\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 getIntlData,\n parents,\n renameElement,\n showError,\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 (\"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, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) 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 const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\n }\n}\n","// @ts-check\n// Module geonovum/conformance\n// Handle the conformance section properly.\n// based on W3C conformance, but because Geonovum has different requirements, have a separate module\nimport { html } from \"../core/import-maps.js\";\nexport const name = \"geonovum/conformance\";\n\n/**\n * @param {Element} conformance\n */\nfunction processConformance(conformance) {\n const content = html`\n <h2>Conformiteit</h2>\n <p>\n Naast onderdelen die als niet normatief gemarkeerd zijn, zijn ook alle\n diagrammen, voorbeelden, en noten in dit document niet normatief. Verder\n is alles in dit document normatief.\n </p>\n <p>Informatief en normatief.</p>\n `;\n conformance.prepend(...content.childNodes);\n}\n\nexport function run() {\n const conformance = document.querySelector(\"section#conformance\");\n if (conformance) {\n processConformance(conformance);\n }\n}\n","// @ts-check\n// Module ui/save-html\n// Saves content to HTML when asked to\nimport { concatDate, 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 ext: \"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 ext: \"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 ext: \"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\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"💾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\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/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","/*\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","/* 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\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\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 \"table\": {\n processTable(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 // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\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 processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.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","/* 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-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\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","// @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,#w3c-state)\");\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 \"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\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\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 \"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\") && conf[key]) || 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"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","subscriptions","EventTarget","pub","topic","detail","dispatchEvent","CustomEvent","parent","self","args","String","JSON","stringify","stack","postMessage","location","origin","sub","cb","options","once","addEventListener","e","removeList","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","wrapFunction","func","IDBDatabase","prototype","transaction","IDBCursor","advance","continue","continuePrimaryKey","includes","apply","unwrap","this","storeNames","tx","call","sort","transformCachableValue","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","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","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","newVersion","db","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","params","paramName","paramValue","test","toLowerCase","getDefaults","baseUrl","breaks","extensions","gfm","headerIds","headerPrefix","highlight","hooks","langPrefix","mangle","pedantic","renderer","sanitize","sanitizer","silent","smartypants","tokenizer","walkTokens","xhtml","defaults","escapeTest","escapeReplace","RegExp","source","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape","encode","unescapeTest","unescape","_","n","charAt","fromCharCode","parseInt","substring","caret","edit","regex","opt","obj","val","getRegex","nonWordAndColonTest","originIndependentUrl","cleanUrl","base","href","prot","decodeURIComponent","indexOf","baseUrls","justDomain","rtrim","relativeBase","protocol","domain","resolveUrl","encodeURI","noopTest","exec","splitCells","tableRow","count","cells","match","offset","str","escaped","curr","split","i","trim","length","pop","splice","push","invert","l","suffLen","currChar","slice","repeatString","pattern","outputLink","cap","link","raw","lexer","title","text","state","inLink","token","type","tokens","inlineTokens","Tokenizer","constructor","space","src","rules","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","node","matchIndentInNode","indentInNode","join","indentCodeCompensation","inline","_escapes","heading","trimmed","depth","hr","blockquote","top","blockTokens","list","istask","ischecked","indent","blankLine","endsWithBlankLine","line","nextLine","rawLine","itemContents","endEarly","bull","isordered","ordered","start","loose","items","itemRegex","t","repeat","trimLeft","search","nextBulletRegex","Math","min","hrRegex","fencesBeginRegex","headingBeginRegex","task","checked","trimRight","spacers","filter","hasMultipleLineBreaks","pre","def","tag","table","item","header","align","rows","j","k","row","lheading","paragraph","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","level","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","lDelim","nextChar","punctuation","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","rDelimAst","rDelimUnd","lastIndex","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","_paragraph","_label","_title","bullet","listItemStart","_tag","_comment","normal","reflinkSearch","out","charCodeAt","random","toString","_punctuation","blockSkip","escapedEmSt","_scheme","_email","_attribute","_href","strong","middle","endAst","endUnd","em","_extended_email","Lexer","Object","create","inlineQueue","static","lex","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","startBlock","startIndex","Infinity","tempSrc","tempStart","forEach","getStartIndex","errMsg","console","keepPrevChar","keys","lastIndexOf","startInline","Renderer$1","infostring","quote","slugger","slug","body","listitem","checkbox","tablerow","content","tablecell","flags","image","TextRenderer","Slugger","seen","serialize","getNextSafeSlug","originalSlug","isDryRun","occurenceAccumulator","hasOwnProperty","dryrun","Parser","Renderer","textRenderer","parse","parseInline","l2","l3","cell","itemBody","ret","renderers","parser","unshift","Hooks","Set","preprocess","markdown","postprocess","parseMarkdown","origOpt","throwError","message","msg","onError","marked","warn","checkSanitizeDeprecation","err","pending","setTimeout","setOptions","newDefaults","use","childTokens","pack","opts","ext","prevRenderer","prevTokenizer","prevHook","passThroughHooks","arg","values","concat","lexInline","globalThis","global","module","pluralizeExports","exports","v","root","pluralize","commonjsGlobal","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","interpolate","arguments","sanitizeWord","len","replaceWord","replaceMap","keepMap","checkWord","bool","inclusive","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","hyperHTML","N","defineProperty","r","a","delete","configurable","o","s","WeakSet","add","m","u","insertBefore","selected","selectedIndex","f","querySelectorAll","y","w","x","nextSibling","E","remove","parentNode","removeChild","compare","before","h","d","p","g","Array","newi","oldi","prev","C","createEvent","initCustomEvent","bubbles","cancelable","_wire$","defineProperties","ELEMENT_NODE","nodeType","A","S","O","T","M","L","P","D","W","attributes","define","invoke","$","isArray","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","children","Ue","Xe","Ye","Ae","et","removeAttributeNode","createTextNode","tt","defaultView","navigator","userAgent","propertyIsEnumerable","isFrozen","nt","rt","it","at","ut","ot","ct","lt","template","tagger","st","ft","ht","dt","vt","pt","gt","wire","bind","Component","diff","hyper","for","handleEvent","currentTarget","svg","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","input","subtype","TypeError","parserMode","inputArray","from","position","char","trimEnd","fromEntries","entries","parseMimeType","parameters","essence","mimeType","size","paramStr","key","_pluralize","reindent","lines","indents","leastIndent","getElementsByTagName","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","docLang","startsWith","createResourceHint","URL","baseURI","linkElem","rel","hint","corsMode","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","norm","getIntlData","localizationStrings","data","getIntlDataForKey","runTransforms","flist","funcArgs","methods","meth","showWarning","htmlJoinComma","array","joined","addId","pfx","txt","noLC","id","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","ref","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","wrapper","parents","selector","parentElement","getElementIndentation","previousSibling","Node","TEXT_NODE","InsensitiveStringSet","super","getCanonicalKey","existingKey","find","makeSafeCopy","clone","dfn","removeCommentNodes","walker","createTreeWalker","NodeFilter","SHOW_COMMENT","comment","walkTree","nextNode","CaseInsensitiveMap","RespecError","plugin","isWarning","assign","elements","markAsOffending","toJSON","details","showError","pluginName","toMDCode","codedJoinOr","quotes","addQuotes","docLink","strings","endsWith","linkingText","mimeTypes","rsDocToDataURL","format","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$f","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","trimStart","firstTwo","lastTwo","indentation","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","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","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","ev","locationHash","l10n$o","style$1","l10n$m","github$1","dataInclude","reindent$1","dataTransform","inlines","examples","issuesNotes","bestPractices","figures","biblio$1","linkToDfn","dataCite","renderBiblio","contrib","sections","fixHeaders","structure","informative","idHeaders","conformance","saveHtml","searchSpecref","aboutRespec","seo","dataTests","listSorter","highlightVars$1","algorithms","anchorExpander","dfnPanel","checkCharset","checkPunctuation","localRefsExist","noHeadinglessSections","noUnusedVars","privsecSection","noHttpProps","ReSpec.run","hash","hasLink","isLegacyFrag","coreDefaults","lint","specStatus","highlightVars","addSectionLinks","licenses","short","geonovumDefaults","doJsonLd","license","logos","alt","height","width","isCCBY","licenseInfo","isBasic","isRegular","computeProps","css$d","noReSpecCSS","createStyle","css_name","resourceHints","createResourceHints","favicon","meta","delimiter","separator","toKeyValuePairs","createMetaViewport","styleFile","noToc","attachFixupScript","urls","frag","reduce","nextLink","linkCSS","additions","status_at_publication","nl","resolveGithubPromise","rejectGithubPromise","github","file_a_bug","participate","commit_history","ko","zh","ja","es","ghURL","tempURL","repoURL","org","repo","pathname","branch","issueBase","commitHistoryURL","newProps","edDraftURI","githubToken","githubUser","atRiskBase","otherLinks","pullBase","shortName","githubAPI","hostname","excludeGithubLinks","otherLink","normalizedGHObj","apiBase","fullName","issuesURL","pullsURL","newIssuesURL","normalizedConfig","DOMBuilder","current","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","include","includeId","response","fetch","idlPrimitiveRegex","exceptionRegex","methodRegex","slotRegex","attributeRegex","baseRegex","enumRegex","methodSplitRegex","slotSplitRegex","isProbablySlotRegex","renderBase","identifier","renderParent","nullable","renderInternalSlot","slotType","linkFor","isMethod","argsHtml","htmlArgMapper","textArgs","parts","isVariadic","renderAttribute","renderMethod","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","reverse","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","unique","now","Date","range","IDBKeyRange","lowerBound","openCursor","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","aliasesAndRefs","alias","reference","promisesToAdd","flatMap","isInDB","put","close","stores","clearStorePromises","clear","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","ok","status","json","oneHourFromNow","headers","addAll","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","warnBadRefs","circular","renderInlineCitation","linkText","refId","stringifyReference","authors","etAl","publisher","date","informs","norms","refSection","rfc2119Usage","joinRegex","regexes","re","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","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","contains","dfnFor","validateDefinition","idl","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","computeExport","export","addContractDefaults","dfnsWithNoType","exportableDfns","titles","pluralizeDfn","dfnTexts","getPluralizer","terms","plurals","userDefinedPlurals","uniquePlurals","css$b","makeTitle","num","report","number","div","inAside","exampleTitle","css$9","editors_note","feature_at_risk","issue","issue_summary","no_issues_in_spec","note","handleIssues","ins","ghIssues","getIssueNumber","Number","issueNumber","createIssueNumberGetter","issueList","inno","displayType","isFeatureAtRisk","isIssue","isEdNote","getIssueType","isInline","dataNum","titleParent","ghIssue","linkToIssueTracker","l10nIssue","issueNumberText","createIssueSummaryEntry","labels","labelsGroup","color","bgColor","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","hasChildNodes","insertAdjacentHTML","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","issueNumbers","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","img","naturalHeight","naturalWidth","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","previous","previousElementSibling","iteratePreviousElements","getPreviousSections","every","decorateTableOfFigures","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","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","duplicates","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkForElem","getLinkTargets","dfnsByType","processAnchor","noLocalMatch","first","isCode","term","isIDL","needsCode","shouldWrapByCode","wrapAsCode","showLinkingError","mapTitleToDfns","badLinks","localAnchors","updateReferences","xref","editors","editor","apiURL","contributors","getContributors","sortedContributors","nameA","login","nameB","user","toHTML","res","maxAge","Request","cache","cachedResponse","caches","clonedResponse","customHeaders","Headers","expiryDate","toISOString","cacheResponse","Response","blob","fetchAndCache","showContributors","getParents","lowerHeaderTags","toc","scanSections","maxTocLevel","prefix","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","Boolean","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","processConformance","save_snapshot","downloadLinks","epubURL","toDownloadLink","sep","concatDate","publishDate","filename","saveDialog","supportsDownload","HTMLAnchorElement","search_specref","specrefSearchUI","about_respec","getEntriesByType","duration","round","perfEntryToTR","firstParagraph","metaElem","css$7","fetchBase","currentScript","workerPromise","workerScript","respecWorker$1","default","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","testSuiteURI","handleDuplicates","testURLs","codedJoinAnd","uniqueList","testables","makeSorter","direction","order","sortListItems","sortDefinitionTerms","dl","nextType","nextName","sortables","sortedElems","selectNodeContents","css$5","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","outputDoc","textNode","Text","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","definition","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","metas","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","isRecTrack","saysPrivOrSec","saysConsiderations","offendingMembers","getOwnPropertyNames"],"mappings":"sDACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAAON,OAAOC,QAAQG,QAAQE,EAAI,IAEpCE,QAAQC,IAAIL,GAASM,MAAKC,GAAWR,KAAYQ,IACrD,EACEV,EAAQG,QAAU,GAClBJ,OAAOC,QAAUA,CACnB,CAMO,SAASW,EAAOC,EAAMC,GACtBf,IACHC,OAAOC,QAAQG,QAAQS,GAAQC,EAEnC,CCtBO,MAIDC,EAAgB,IAAIC,YAOnB,SAASC,EAAIC,EAAOC,GAEzB,GADAJ,EAAcK,cAAc,IAAIC,YAAYH,EAAO,CAAEC,YACjDnB,OAAOsB,SAAWtB,OAAOuB,KAC3B,OAGF,MAAMC,EAAOC,OAAOC,KAAKC,UAAUR,GAAQS,OAAST,IACpDnB,OAAOsB,OAAOO,YAAY,CAAEX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C,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,QACV3F,SAAQ,SAAU2F,GAClB,OAAOR,EAAU6B,gBAAgBrB,EAAK,GAAIA,EAAK,GACpD,IAKG,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,WACA3F,QAAQmF,EAAU8B,oBAEb9B,CACV,IAGA,IAAIA,GAAYJ,GCjgBsBqC,GAAU,SAASC,GAAgB,IAAIlO,EAAE,CAAE,EAAC,IAAIA,EAAEjP,QAAQA,OAAod,CAA5c,MAAMd,GAAG+P,EAAEjP,QAAQ,SAASiP,EAAE/P,GAAG,IAAIiJ,EAAEjJ,EAAEke,eAAeC,EAAEne,EAAEyY,eAAehN,EAAE2S,EAAEjc,UAAU,OAAOsJ,EAAE4S,OAAO,SAASre,GAAG,OAAO4C,KAAKb,IAAI/B,WAAWA,EAAE4C,KAAKoG,EAAE,EAAEyC,EAAErK,IAAI,SAASpB,GAAG,OAAO4C,KAAKb,IAAI/B,GAAGA,EAAE4C,KAAKoG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AKyZ,IAAKzb,GAAM,CAAEqvB,KAAMrtB,GAAKqtB,MAE7C,ICnCA,MACarvB,GAAO,kCAYdgC,GAAOwuB,GAVe,CAC1BtuB,GAAI,CACFuZ,IAAKka,EAAO,oCAAoC,oBAChDtG,KAAM,0DAER0V,GAAI,CACFtpB,IAAKka,EAAO,GAAG,kCACftG,KAAM,0EAKH,SAAawL,GAClB,IAAKA,EAAKkH,OAhBK,iBAiBb,OAKF,IAAKthC,OAAOQ,SAASwK,KAAKsjB,WAAW,QACnC,OAGF,MAAMs/B,EAAmBl3C,OAAOm3C,oBAAoBzzB,GAEjDxoB,QAAO0b,GAAQA,EAAI8H,SAAS,QAAUgF,EAAK9M,IAAiB,WAARA,IAEpD1b,QAAO0b,GACN,IAAIkB,IAAI4L,EAAK9M,GAAMttB,OAAOQ,SAASwK,MAAMA,KAAKsjB,WAAW,aAG7D,GAAIs/B,EAAiBlhD,OAAQ,CAC3B,MAAMsL,EAAO6X,GAAQ+9B,GAAkBtgC,GAAO4H,EAAO,GAAG,IAAI5H,SAC5DkD,GAAYjvB,GAAKyZ,IAAKzb,GAAM,CAAEqvB,KAAMrtB,GAAKqtB,KAAO5W,GACjD,CACH","x_google_ignoreList":[4,5,6,7,9]} \ No newline at end of file diff --git a/builds/respec-w3c.js b/builds/respec-w3c.js index c591c35f64..05c53f2017 100644 --- a/builds/respec-w3c.js +++ b/builds/respec-w3c.js @@ -1,7 +1,7 @@ -window.respecVersion="33.0.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=new EventTarget;function r(e,t){if(n.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const r=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:r},window.parent.location.origin)}function s(e,t,r={once:!1}){n.addEventListener(e,(e=>t(e.detail)),r)}t("core/pubsubhub",{sub:s});const i=["githubToken","githubUser"];const o=document.documentElement;o&&!o.hasAttribute("lang")&&(o.lang="en",o.hasAttribute("dir")||(o.dir="ltr"));const a={},c=o.lang;var l=Object.freeze({__proto__:null,l10n:a,lang:c,name:"core/l10n",run:function(e){e.l10n=a[c]||a.en}});let u,d;const p=new WeakMap,f=new WeakMap,h=new WeakMap,m=new WeakMap,g=new WeakMap;let b={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return f.get(e);if("objectStoreNames"===t)return e.objectStoreNames||h.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return v(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function y(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(d||(d=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply($(this),t),v(p.get(this))}:function(...t){return v(e.apply($(this),t))}:function(t,...n){const r=e.call($(this),t,...n);return h.set(r,t.sort?t.sort():[t]),v(r)}}function w(e){return"function"==typeof e?y(e):(e instanceof IDBTransaction&&function(e){if(f.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)}));f.set(e,t)}(e),t=e,(u||(u=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,b):e);var t}function v(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(v(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",s),e.addEventListener("error",i)}));return t.then((t=>{t instanceof IDBCursor&&p.set(t,e)})).catch((()=>{})),g.set(t,e),t}(e);if(m.has(e))return m.get(e);const t=w(e);return t!==e&&(m.set(e,t),g.set(t,e)),t}const $=e=>g.get(e);const k=["get","getKey","getAll","getAllKeys","count"],x=["put","add","delete","clear"],_=new Map;function C(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(_.get(t))return _.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=x.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!s&&!k.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 _.set(t,i),i}b=(e=>({...e,get:(t,n,r)=>C(t,n)||e.get(t,n,r),has:(t,n)=>!!C(t,n)||e.has(t,n)}))(b);var S=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),v(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:s,terminated:i}={}){const o=indexedDB.open(e,t),a=v(o);return r&&o.addEventListener("upgradeneeded",(e=>{r(v(o.result),e.oldVersion,e.newVersion,v(o.transaction),e)})),n&&o.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{i&&e.addEventListener("close",(()=>i())),s&&e.addEventListener("versionchange",(e=>s(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:$,wrap:v});function R(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(e,t,n,r){return R(e,t,n,r,"Syntax")}function A(e,t,n,r,s={}){return s.ruleName=n,R(t.source,e.index,t,r,"Validation",s)}class T{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 L(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=L(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=L(n,t);if(e)return n.union?e:{reference:n,dictionary:e.dictionary}}}function P(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?P(r,t)&&(n=!0):n=!0}return t.cache.dictionaryIncludesRequiredField.set(e,n),n}class I extends Array{constructor({source:e,tokens:t}){super(),Object.defineProperties(this,{source:{value:e},tokens:{value:t},parent:{value:null,writable:!0}})}}class D extends T{static parser(e,t){return()=>{const n=e.consumeKind(t);if(n)return new D({source:e.source,tokens:{value:n}})}}get value(){return J(this.tokens.value.value)}write(e){return e.ts.wrap([e.token(this.tokens.value),e.token(this.tokens.separator)])}}class N extends D{static parse(e){const t=e.consumeKind("eof");if(t)return new N({source:e.source,tokens:{value:t}})}get type(){return"eof"}}function O(e,t){return X(e,{parser:D.parser(e,t),listName:t+" list"})}const j=["identifier","decimal","integer","string"],z=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map((e=>[e,`Legacy${e}`])),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function M(e){for(const t of j){const n=O(e,t);if(n.length)return n}e.error("Expected identifiers, strings, decimals, or integers but none found")}class q extends T{static parse(e){const t={assign:e.consume("=")},n=le(new q({source:e.source,tokens:t}));if(n.list=[],t.assign){if(t.asterisk=e.consume("*"),t.asterisk)return n.this;t.secondaryName=e.consumeKind(...j)}return t.open=e.consume("("),t.open?(n.list=n.rhsIsList?M(e):ne(e),t.close=e.consume(")")||e.error("Unexpected token in extended attribute argument list")):t.assign&&!t.secondaryName&&e.error("No right hand side to extended attribute assignment"),n.this}get rhsIsList(){return this.tokens.assign&&!this.tokens.asterisk&&!this.tokens.secondaryName}get rhsType(){return this.rhsIsList?this.list[0].tokens.value.type+"-list":this.tokens.asterisk?"*":this.tokens.secondaryName?this.tokens.secondaryName.type:null}write(e){const{rhsType:t}=this;return e.ts.wrap([e.token(this.tokens.assign),e.token(this.tokens.asterisk),e.reference_token(this.tokens.secondaryName,this.parent),e.token(this.tokens.open),...this.list.map((n=>"identifier-list"===t?e.identifier(n,this.parent):n.write(e))),e.token(this.tokens.close)])}}class U extends T{static parse(e){const t=e.consumeKind("identifier");if(t)return new U({source:e.source,tokens:{name:t},params:q.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:this.params.tokens.secondaryName?J(t.secondaryName.value):null}}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/whatwg/webidl/pull/609) for more information.";yield A(this.tokens.name,this,"no-nointerfaceobject",e,{level:"warning"})}else if(z.has(t)){const e=`\`[${t}]\` extended attribute is a legacy feature that is now renamed to \`[${z.get(t)}]\`. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more information.`;yield A(this.tokens.name,this,"renamed-legacy",e,{level:"warning",autofix:(n=this,()=>{const{name:e}=n;n.tokens.name.value=z.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 W extends I{static parse(e){const t={};t.open=e.consume("[");const n=new W({source:e.source,tokens:t});return t.open?(n.push(...X(e,{parser:U.parse,listName:"extended attribute"})),t.close=e.consume("]")||e.error("Expected a closing token for the extended attribute list"),n.length||(e.unconsume(t.close.index),e.error("An extended attribute list must not be empty")),e.probe("[")&&e.error("Illegal double extended attribute lists, consider merging them"),n):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 F(e,t){const n=e.consume("?");n&&(t.tokens.nullable=n),e.probe("?")&&e.error("Can't nullable more than once")}function B(e,t){let n=function(e,t){const n=e.consume("FrozenArray","ObservableArray","Promise","sequence","record");if(!n)return;const r=le(new H({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=se(e,t)||e.error("Missing Promise subtype");r.subtype.push(n);break}case"sequence":case"FrozenArray":case"ObservableArray":{const s=re(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(...pe)||e.error(`Record key must be one of: ${pe.join(", ")}`),s=new H({source:e.source,tokens:{base:n}});s.tokens.separator=e.consume(",")||e.error("Missing comma after record key type"),s.type=t;const i=re(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)||te(e);if(!n){const t=e.consumeKind("identifier")||e.consume(...pe,...de);if(!t)return;n=new H({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,F(e,n),n.nullable&&"any"===n.idlType&&e.error("Type `any` cannot be made nullable"),n}class H extends T{static parse(e,t){return B(e,t)||function(e,t){const n={};if(n.open=e.consume("("),!n.open)return;const r=le(new H({source:e.source,tokens:n}));for(r.type=t||null;;){const t=re(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"),F(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 W({source:e,tokens:{}})}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 J([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/whatwg/webidl/issues/60) for more information.";yield A(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}=L(r,e)||{};if(t){const e=(this.union?t:this).tokens.base,n="Nullable union cannot include a dictionary type.";yield A(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 G extends T{static parse(e){const t=e.consume("=");if(!t)return null;const n=Q(e)||e.consumeKind("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 G({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 ee(this.expression[0]).type}get value(){return ee(this.expression[0]).value}get negative(){return ee(this.expression[0]).negative}write(e){return e.ts.wrap([e.token(this.tokens.assign),...this.expression.map((t=>e.token(t)))])}}class V extends T{static parse(e){const t=e.position,n={},r=le(new V({source:e.source,tokens:n}));return r.extAttrs=W.parse(e),n.optional=e.consume("optional"),r.idlType=re(e,"argument-type"),r.idlType?(n.optional||(n.variadic=e.consume("...")),n.name=e.consumeKind("identifier")||e.consume(...fe),n.name?(r.default=n.optional?G.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 J(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e),yield*this.idlType.validate(e);const t=L(this.idlType,e,{useNullableInner:!0});if(t)if(this.idlType.nullable){const e="Dictionary arguments cannot be nullable.";yield A(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 A(this.tokens.name,this,"dict-arg-default",e,{autofix:Y(this)})}}else if(this.parent&&!P(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 A(this.tokens.name,this,"dict-arg-optional",e,{autofix:(n=this,()=>{const e=ce(n.idlType);n.tokens.optional={...e,type:"optional",value:"optional"},e.trivia=" ",Y(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 Y(e){return()=>{e.default=G.parse(new be(" = {}"))}}class K extends T{static parse(e,{special:t,regular:n}={}){const r={special:t},s=le(new K({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=se(e)||e.error("Missing return type"),r.name=e.consumeKind("identifier")||e.consume("includes"),r.open=e.consume("(")||e.error("Invalid operation"),s.arguments=ne(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?J(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 A(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 Z extends T{static parse(e,{special:t,noInherit:n=!1,readonly:r=!1}={}){const s=e.position,i={special:t},o=le(new Z({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=re(e,"attribute-type")||e.error("Attribute lacks a type"),i.name=e.consumeKind("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 J(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 A(this.tokens.name,this,"attr-invalid-type",e);break}default:{const{reference:t}=L(this.idlType,e)||{};if(t){const e=(this.idlType.union?t:this.idlType).tokens.base,n="Attributes cannot accept dictionary types.";yield A(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 J(e){return e.startsWith("_")?e.slice(1):e}function X(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 Q(e){return e.consumeKind("decimal","integer")||e.consume("true","false","Infinity","-Infinity","NaN")}function ee({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 te(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 H({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 H({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 H({source:t,tokens:{base:r}}):void 0}function ne(e){return X(e,{parser:V.parse,listName:"arguments list"})}function re(e,t){const n=W.parse(e),r=H.parse(e,t);return r&&(le(r).extAttrs=n),r}function se(e,t){const n=H.parse(e,t||"return-type");if(n)return n;const r=e.consume("void");if(r){const t=new H({source:e.source,tokens:{base:r}});return t.type="return-type",t}}function ie(e){const t=e.consume("stringifier");if(!t)return;return Z.parse(e,{special:t})||K.parse(e,{special:t})||e.error("Unterminated stringifier")}function oe(e){const t=e.split("\n");if(t.length){const e=t[t.length-1].match(/^\s+/);if(e)return e[0]}return""}function ae(e){return()=>{if(e.extAttrs.length){const t=new be("Exposed=Window,"),n=U.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{le(e).extAttrs=W.parse(new be("[Exposed=Window]"));const t=e.tokens.base.trivia;e.extAttrs.tokens.open.trivia=t,e.tokens.base.trivia=`\n${oe(t)}`}}}function ce(e){if(e.extAttrs.length)return e.extAttrs.tokens.open;if("operation"===e.type&&!e.special)return ce(e.idlType);return Object.values(e.tokens).sort(((e,t)=>e.index-t.index))[0]}function le(e,t){if(t||(t=e),!e)return e;return new Proxy(e,{get(e,t){const n=e[t];return Array.isArray(n)&&"source"!==t?le(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}})}const ue={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},de=["ArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","BigInt64Array","BigUint64Array","Float32Array","Float64Array","any","object","symbol"],pe=["ByteString","DOMString","USVString"],fe=["async","attribute","callback","const","constructor","deleter","dictionary","enum","getter","includes","inherit","interface","iterable","maplike","namespace","partial","required","setlike","setter","static","stringifier","typedef","unrestricted"],he=["-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(fe,pe,de),me=["(",")",",","...",":",";","<","=",">","?","*","[","]","{","}"],ge=["_constructor","toString","_toString"];class be{constructor(e){this.source=function(e){const t=[];let n=0,r="",s=1,i=0;for(;n<e.length;){const a=e.charAt(n);let c=-1;if(/[\t\n\r ]/.test(a)?c=o("whitespace",{noFlushTrivia:!0}):"/"===a&&(c=o("comment",{noFlushTrivia:!0})),-1!==c){const e=t.pop().value;s+=(e.match(/\n/g)||[]).length,r+=e,i-=1}else if(/[-0-9.A-Z_a-z]/.test(a)){if(c=o("decimal"),-1===c&&(c=o("integer")),-1===c){c=o("identifier");const e=t.length-1,n=t[e];if(-1!==c){if(ge.includes(n.value)){const r=`${J(n.value)} is a reserved identifier and must not be used.`;throw new ye(E(t,e,null,r))}he.includes(n.value)&&(n.type="inline")}}}else'"'===a&&(c=o("string"));for(const o of me)if(e.startsWith(o,n)){t.push({type:"inline",value:o,trivia:r,line:s,index:i}),r="",n+=o.length,c=n;break}if(-1===c&&(c=o("other")),-1===c)throw new Error("Token stream not progressing");n=c,i+=1}return t.push({type:"eof",value:"",trivia:r,line:s,index:i}),t;function o(o,{noFlushTrivia:a}={}){const c=ue[o];c.lastIndex=n;const l=c.exec(e);return l?(t.push({type:o,value:l[0],trivia:r,line:s,index:i}),a||(r=""),c.lastIndex):-1}}(e),this.position=0}error(e){throw new ye(E(this.source,this.position,this.current,e))}probeKind(e){return this.source.length>this.position&&this.source[this.position].type===e}probe(e){return this.probeKind("inline")&&this.source[this.position].value===e}consumeKind(...e){for(const t of e){if(!this.probeKind(t))continue;const e=this.source[this.position];return this.position++,e}}consume(...e){if(!this.probeKind("inline"))return;const t=this.source[this.position];for(const n of e)if(t.value===n)return this.position++,t}consumeIdentifier(e){if(this.probeKind("identifier")&&this.source[this.position].value===e)return this.consumeKind("identifier")}unconsume(e){this.position=e}}class ye 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 we extends D{static parse(e){const t=e.consumeKind("string");if(t)return new we({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 ve extends T{static parse(e){const t={};if(t.base=e.consume("enum"),!t.base)return;t.name=e.consumeKind("identifier")||e.error("No name for enum");const n=le(new ve({source:e.source,tokens:t}));return e.current=n.this,t.open=e.consume("{")||e.error("Bodyless enum"),n.values=X(e,{parser:we.parse,allowDangler:!0,listName:"enumeration"}),e.probeKind("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 J(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 $e extends T{static parse(e){const t=e.consumeKind("identifier");if(!t)return;const n={target:t};if(n.includes=e.consume("includes"),n.includes)return n.mixin=e.consumeKind("identifier")||e.error("Incomplete includes statement"),n.termination=e.consume(";")||e.error("No terminating ; for includes statement"),new $e({source:e.source,tokens:n});e.unconsume(t.index)}get type(){return"includes"}get target(){return J(this.tokens.target.value)}get includes(){return J(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 ke extends T{static parse(e){const t={},n=le(new ke({source:e.source,tokens:t}));if(t.base=e.consume("typedef"),t.base)return n.idlType=re(e,"typedef-type")||e.error("Typedef lacks a type"),t.name=e.consumeKind("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 J(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 xe extends T{static parse(e,t){const n={base:t},r=le(new xe({source:e.source,tokens:n}));return n.name=e.consumeKind("identifier")||e.error("Callback lacks a name"),e.current=r.this,n.assign=e.consume("=")||e.error("Callback lacks an assignment"),r.idlType=se(e)||e.error("Callback lacks a return type"),n.open=e.consume("(")||e.error("Callback lacks parentheses for arguments"),r.arguments=ne(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 J(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 _e extends T{static parse(e,t,{inheritable:n,allowedMembers:r}){const{tokens:s,type:i}=t;for(s.name=e.consumeKind("identifier")||e.error(`Missing name in ${i}`),e.current=t,t=le(t),n&&Object.assign(s,function(e){const t=e.consume(":");return t?{colon:t,inheritance:e.consumeKind("identifier")||e.error("Inheritance lacks a type")}:{}}(e)),s.open=e.consume("{")||e.error(`Bodyless ${i}`),t.members=[];;){if(s.close=e.consume("}"),s.close)return s.termination=e.consume(";")||e.error(`Missing semicolon after ${i}`),t.this;const n=W.parse(e);let o;for(const[t,...n]of r)if(o=le(t(e,...n)),o)break;o||e.error("Unknown member"),o.extAttrs=n,t.members.push(o.this)}}get partial(){return!!this.tokens.partial}get name(){return J(this.tokens.name.value)}get inheritance(){return this.tokens.inheritance?J(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 Ce extends T{static parse(e){const t={};if(t.base=e.consume("const"),!t.base)return;let n=te(e);if(!n){const t=e.consumeKind("identifier")||e.error("Const lacks a type");n=new H({source:e.source,tokens:{base:t}})}e.probe("?")&&e.error("Unexpected nullable constant type"),n.type="const-type",t.name=e.consumeKind("identifier")||e.error("Const lacks a name"),t.assign=e.consume("=")||e.error("Const lacks value assignment"),t.value=Q(e)||e.error("Const lacks a value"),t.termination=e.consume(";")||e.error("Unterminated const, expected `;`");const r=new Ce({source:e.source,tokens:t});return le(r).idlType=n,r}get type(){return"const"}get name(){return J(this.tokens.name.value)}get value(){return ee(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 Se extends T{static parse(e){const t=e.position,n=le(new Se({source:e.source,tokens:{}})),{tokens:r}=n;if(r.readonly=e.consume("readonly"),r.readonly||(r.async=e.consume("async")),r.base=r.readonly?e.consume("maplike","setlike"):r.async?e.consume("iterable"):e.consume("iterable","maplike","setlike"),!r.base)return void e.unconsume(t);const{type:s}=n,i="maplike"===s,o=i||"iterable"===s,a=n.async&&"iterable"===s;r.open=e.consume("<")||e.error(`Missing less-than sign \`<\` in ${s} declaration`);const c=re(e)||e.error(`Missing a type argument in ${s} declaration`);return n.idlType=[c],n.arguments=[],o&&(c.tokens.separator=e.consume(","),c.tokens.separator?n.idlType.push(re(e)):i&&e.error(`Missing second type argument in ${s} declaration`)),r.close=e.consume(">")||e.error(`Missing greater-than sign \`>\` in ${s} declaration`),e.probe("(")&&(a?(r.argsOpen=e.consume("("),n.arguments.push(...ne(e)),r.argsClose=e.consume(")")||e.error("Unterminated async iterable argument list")):e.error("Arguments are only allowed for `async iterable`")),r.termination=e.consume(";")||e.error(`Missing semicolon after ${s} declaration`),n.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 Re extends T{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=ne(e);n.close=e.consume(")")||e.error("Unterminated constructor"),n.termination=e.consume(";")||e.error("No semicolon after constructor");const s=new Re({source:e.source,tokens:n});return le(s).arguments=r,s}get type(){return"constructor"}*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 Ee(e){const t=e.consume("static");if(!t)return;return Z.parse(e,{special:t})||K.parse(e,{special:t})||e.error("No body in static member")}class Ae extends _e{static parse(e,t,{partial:n=null}={}){const r={partial:n,base:t};return _e.parse(e,new Ae({source:e.source,tokens:r}),{inheritable:!n,allowedMembers:[[Ce.parse],[Re.parse],[Ee],[ie],[Se.parse],[Z.parse],[K.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 A(this.tokens.name,this,"require-exposed",e,{autofix:ae(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 A(e.tokens.name,this,"constructor-member",t,{autofix:Te(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 A(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 A(e.tokens.base,this,"no-constructible-global",t)}}yield*super.validate(e),this.partial||(yield*function*(e,t){const n=function(e){const t=o(e);return{statics:new Set(t.filter((e=>"static"===e.special)).map((e=>e.name))),nonstatics:new Set(t.filter((e=>"static"!==e.special)).map((e=>e.name)))}}(t),r=e.partials.get(t.name)||[],s=e.mixinMap.get(t.name)||[];for(const e of[...r,...s]){const r=o(e),s=r.filter((e=>"static"===e.special)),a=r.filter((e=>"static"!==e.special));yield*i(s,n.statics,e,t),yield*i(a,n.nonstatics,e,t),s.forEach((e=>n.statics.add(e.name))),a.forEach((e=>n.nonstatics.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 ${"static"===s.special?"static ":""}operation "${e}" has already been defined for the base interface "${r.name}" either in itself or in a mixin`;yield A(s.tokens.name,n,"no-cross-overload",t)}}}function o(e){return e.members.filter((({type:e})=>"operation"===e))}}(e,this))}}function Te(e,t){return e=le(e),()=>{const n=oe(e.extAttrs.tokens.open.trivia),r=e.members.length?oe(ce(e.members[0]).trivia):function(e){const t=oe(e),n=t.includes("\t")?"\t":" ";return t+n}(n),s=Re.parse(new be(`\n${r}constructor();`));s.extAttrs=new W({source:e.source,tokens:{}}),le(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 Le extends _e{static parse(e,t,{partial:n}={}){const r={partial:n,base:t};if(r.mixin=e.consume("mixin"),r.mixin)return _e.parse(e,new Le({source:e.source,tokens:r}),{allowedMembers:[[Ce.parse],[ie],[Z.parse,{noInherit:!0}],[K.parse,{regular:!0}]]})}get type(){return"interface mixin"}}class Pe extends T{static parse(e){const t={},n=le(new Pe({source:e.source,tokens:t}));return n.extAttrs=W.parse(e),t.required=e.consume("required"),n.idlType=re(e,"dictionary-type")||e.error("Dictionary member lacks a type"),t.name=e.consumeKind("identifier")||e.error("Dictionary member lacks a name"),n.default=G.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 J(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 Ie extends _e{static parse(e,{partial:t}={}){const n={partial:t};if(n.base=e.consume("dictionary"),n.base)return _e.parse(e,new Ie({source:e.source,tokens:n}),{inheritable:!t,allowedMembers:[[Pe.parse]]})}get type(){return"dictionary"}}class De extends _e{static parse(e,{partial:t}={}){const n={partial:t};if(n.base=e.consume("namespace"),n.base)return _e.parse(e,new De({source:e.source,tokens:n}),{allowedMembers:[[Z.parse,{noInherit:!0,readonly:!0}],[Ce.parse],[K.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 A(this.tokens.name,this,"require-exposed",e,{autofix:ae(this)})}yield*super.validate(e)}}class Ne extends _e{static parse(e,t,{partial:n=null}={}){const r={callback:t};if(r.base=e.consume("interface"),r.base)return _e.parse(e,new Ne({source:e.source,tokens:r}),{inheritable:!n,allowedMembers:[[Ce.parse],[K.parse,{regular:!0}]]})}get type(){return"callback interface"}}function Oe(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 Le.parse(e,n,t)||Ae.parse(e,n,t)||r("Interface has no proper body")}function o(){if(t.productions)for(const n of t.productions){const t=n(e);if(t)return t}return function(){const t=s("callback");if(t)return e.probe("interface")?Ne.parse(e,t):xe.parse(e,t)}()||i()||function(){const t=s("partial");if(t)return Ie.parse(e,{partial:t})||i({partial:t})||De.parse(e,{partial:t})||r("Partial doesn't apply to anything")}()||Ie.parse(e)||ve.parse(e)||ke.parse(e)||$e.parse(e)||De.parse(e)}const a=function(){if(!n.length)return[];const s=[];for(;;){const t=W.parse(e),n=o();if(!n){t.length&&r("Stray extended attributes");break}le(n).extAttrs=t,s.push(n)}const i=N.parse(e);return t.concrete&&s.push(i),s}();return e.position<n.length&&r("Unrecognised tokens"),a}function je(e){return e}const ze={wrap:e=>e.join(""),trivia:je,name:je,reference:je,type:je,generic:je,nameless:je,inheritance:je,definition:je,extendedAttribute:je,extendedAttributeReference:je};class Me{constructor(e){this.ts=Object.assign({},ze,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=je,...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 qe(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*Ue(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:qe(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 A(n.tokens.name,n,"no-duplicate",r)}}(t)}var We=Object.freeze({__proto__:null,WebIDLParseError:ye,parse:function(e,t={}){const n=new be(e);return void 0!==t.sourceName&&(n.source.name=t.sourceName),Oe(n,t)},validate:function(e){return[...Ue((t=e,t.flat?t.flat():[].concat(...t)))];var t},write:function(e,{templates:t=ze}={}){t=Object.assign({},ze,t);const n=new Me(t);return t.wrap(e.map((e=>e.write(n))))}});const Fe=/^[!#$%&'*+-.^`|~\w]+$/,Be=/[\u000A\u000D\u0009\u0020]/u,He=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function Ge(e,t,n){(t&&""!==t&&!e.has(t)&&He.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function Ve(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Ye={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const Ke=/[&<>"']/,Ze=new RegExp(Ke.source,"g"),Je=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Xe=new RegExp(Je.source,"g"),Qe={"&":"&","<":"<",">":">",'"':""","'":"'"},et=e=>Qe[e];function tt(e,t){if(t){if(Ke.test(e))return e.replace(Ze,et)}else if(Je.test(e))return e.replace(Xe,et);return e}const nt=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function rt(e){return e.replace(nt,((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 st=/(^|[^\[])\^/g;function it(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(st,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const ot=/[^\w:]/g,at=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ct(e,t,n){if(e){let e;try{e=decodeURIComponent(rt(n)).replace(ot,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!at.test(n)&&(n=function(e,t){lt[" "+e]||(ut.test(e)?lt[" "+e]=e+"/":lt[" "+e]=mt(e,"/",!0));const n=-1===(e=lt[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(dt,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(pt,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const lt={},ut=/^[^:]+:\/*[^/]*$/,dt=/^([^:]+:)[\s\S]*$/,pt=/^([^:]+:\/*[^/]*)[\s\S]*$/;const ft={exec:function(){}};function ht(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function mt(e,t,n){const r=e.length;if(0===r)return"";let s=0;for(;s<r;){const i=e.charAt(r-s-1);if(i!==t||n){if(i===t||!n)break;s++}else s++}return e.slice(0,r-s)}function gt(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function bt(e,t,n,r){const s=t.href,i=t.title?tt(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:s,title:i,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:s,title:i,text:tt(o)}}class yt{constructor(e){this.options=e||Ye}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}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:mt(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().replace(this.rules.inline._escapes,"$1"):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=mt(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,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,s,i,o,a,c,l,u,d,p,f,h=t[1].trim();const m=h.length>1,g={type:"list",raw:"",ordered:m,start:m?+h.slice(0,-1):"",loose:!1,items:[]};h=m?`\\d{1,9}\\${h.slice(-1)}`:`\\${h}`,this.options.pedantic&&(h=m?h:"[*+-]");const b=new RegExp(`^( {0,3}${h})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,t=b.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),l=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),u=e.split("\n",1)[0],this.options.pedantic?(i=2,p=l.trimLeft()):(i=t[2].search(/[^ ]/),i=i>4?1:i,p=l.slice(i),i+=t[1].length),a=!1,!l&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),f=!0),!f){const t=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),s=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),o=new RegExp(`^ {0,${Math.min(3,i-1)}}#`);for(;e&&(d=e.split("\n",1)[0],u=d,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!s.test(u))&&!o.test(u)&&!t.test(u)&&!r.test(e);){if(u.search(/[^ ]/)>=i||!u.trim())p+="\n"+u.slice(i);else{if(a)break;if(l.search(/[^ ]/)>=4)break;if(s.test(l))break;if(o.test(l))break;if(r.test(l))break;p+="\n"+u}a||u.trim()||(a=!0),n+=d+"\n",e=e.substring(d.length+1),l=u.slice(i)}}g.loose||(c?g.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(s="[ ] "!==r[0],p=p.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!r,checked:s,loose:!1,text:p}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=p.trimRight(),g.raw=g.raw.trimRight();const y=g.items.length;for(o=0;o<y;o++)if(this.lexer.state.top=!1,g.items[o].tokens=this.lexer.blockTokens(g.items[o].text,[]),!g.loose){const e=g.items[o].tokens.filter((e=>"space"===e.type)),t=e.length>0&&e.some((e=>/\n.*\n/.test(e.raw)));g.loose=t}if(g.loose)for(o=0;o<y;o++)g.items[o].loose=!0;return g}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};if(this.options.sanitize){const n=this.options.sanitizer?this.options.sanitizer(t[0]):tt(t[0]);e.type="paragraph",e.text=n,e.tokens=this.lexer.inline(n)}return e}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:ht(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,s,i,o=e.align.length;for(n=0;n<o;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(o=e.rows.length,n=0;n<o;n++)e.rows[n]=ht(e.rows[n],e.header.length).map((e=>({text:e})));for(o=e.header.length,r=0;r<o;r++)e.header[r].tokens=this.lexer.inline(e.header[r].text);for(o=e.rows.length,r=0;r<o;r++)for(i=e.rows[r],s=0;s<i.length;s++)i[s].tokens=this.lexer.inline(i[s].text);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:tt(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):tt(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=mt(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,s=0;for(;s<n;s++)if("\\"===e[s])s++;else if(e[s]===t[0])r++;else if(e[s]===t[1]&&(r--,r<0))return s;return-1}(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(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),bt(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}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){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return bt(n,e,n[0],this.lexer)}}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)continue;if(i=s.length,r[3]||r[4]){o+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+a);const t=e.slice(0,n+r.index+(r[0].length-s.length)+i);if(Math.min(n,i)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const c=t.slice(2,-2);return{type:"strong",raw:t,text:c,tokens:this.lexer.inlineTokens(c)}}}}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=tt(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],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=tt(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=tt(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=tt(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=tt(n[0]),r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):tt(n[0]):n[0]:tt(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const wt={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}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:ft,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};wt.def=it(wt.def).replace("label",wt._label).replace("title",wt._title).getRegex(),wt.bullet=/(?:[*+-]|\d{1,9}[.)])/,wt.listItemStart=it(/^( *)(bull) */).replace("bull",wt.bullet).getRegex(),wt.list=it(wt.list).replace(/bull/g,wt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+wt.def.source+")").getRegex(),wt._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",wt._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,wt.html=it(wt.html,"i").replace("comment",wt._comment).replace("tag",wt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),wt.paragraph=it(wt._paragraph).replace("hr",wt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",wt._tag).getRegex(),wt.blockquote=it(wt.blockquote).replace("paragraph",wt.paragraph).getRegex(),wt.normal={...wt},wt.gfm={...wt.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},wt.gfm.table=it(wt.gfm.table).replace("hr",wt.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","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",wt._tag).getRegex(),wt.gfm.paragraph=it(wt._paragraph).replace("hr",wt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",wt.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",wt._tag).getRegex(),wt.pedantic={...wt.normal,html:it("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",wt._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:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ft,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:it(wt.normal._paragraph).replace("hr",wt.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",wt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const vt={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ft,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,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:ft,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function $t(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function kt(e){let t,n,r="";const s=e.length;for(t=0;t<s;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}vt._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",vt.punctuation=it(vt.punctuation).replace(/punctuation/g,vt._punctuation).getRegex(),vt.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,vt.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,vt._comment=it(wt._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),vt.emStrong.lDelim=it(vt.emStrong.lDelim).replace(/punct/g,vt._punctuation).getRegex(),vt.emStrong.rDelimAst=it(vt.emStrong.rDelimAst,"g").replace(/punct/g,vt._punctuation).getRegex(),vt.emStrong.rDelimUnd=it(vt.emStrong.rDelimUnd,"g").replace(/punct/g,vt._punctuation).getRegex(),vt._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,vt._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,vt._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])?)+(?![-_])/,vt.autolink=it(vt.autolink).replace("scheme",vt._scheme).replace("email",vt._email).getRegex(),vt._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,vt.tag=it(vt.tag).replace("comment",vt._comment).replace("attribute",vt._attribute).getRegex(),vt._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,vt._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,vt._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,vt.link=it(vt.link).replace("label",vt._label).replace("href",vt._href).replace("title",vt._title).getRegex(),vt.reflink=it(vt.reflink).replace("label",vt._label).replace("ref",wt._label).getRegex(),vt.nolink=it(vt.nolink).replace("ref",wt._label).getRegex(),vt.reflinkSearch=it(vt.reflinkSearch,"g").replace("reflink",vt.reflink).replace("nolink",vt.nolink).getRegex(),vt.normal={...vt},vt.pedantic={...vt.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:it(/^!?\[(label)\]\((.*?)\)/).replace("label",vt._label).getRegex(),reflink:it(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",vt._label).getRegex()},vt.gfm={...vt.normal,escape:it(vt.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]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},vt.gfm.url=it(vt.gfm.url,"i").replace("email",vt.gfm._extended_email).getRegex(),vt.breaks={...vt.gfm,br:it(vt.br).replace("{2,}","*").getRegex(),text:it(vt.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class xt{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ye,this.options.tokenizer=this.options.tokenizer||new yt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:wt.normal,inline:vt.normal};this.options.pedantic?(t.block=wt.pedantic,t.inline=vt.pedantic):this.options.gfm&&(t.block=wt.gfm,this.options.breaks?t.inline=vt.breaks:t.inline=vt.gfm),this.tokenizer.rules=t}static get rules(){return{block:wt,inline:vt}}static lex(e,t){return new xt(t).lex(e)}static lexInline(e,t){return new xt(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,s,i;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(s=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=s.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);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 this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,s,i,o,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,i.index)+"["+gt("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,i.index)+"["+gt("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.escapedEmSt.exec(c));)c=c.slice(0,i.index+i[0].length-2)+"++"+c.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(o||(a=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,kt))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,kt))){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({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(s,$t))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),o=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);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(n.raw.length),t.push(n);return t}}let _t=class{constructor(e){this.options=e||Ye}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?'<pre><code class="'+this.options.langPrefix+tt(r)+'">'+(n?e:tt(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:tt(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e){return e}heading(e,t,n,r){if(this.options.headerIds){return`<h${t} id="${this.options.headerPrefix+r.slug(n)}">${e}</h${t}>\n`}return`<h${t}>${e}</h${t}>\n`}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){if(null===(e=ct(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){if(null===(e=ct(this.options.sanitize,this.options.baseUrl,e)))return n;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${t}"`),r+=this.options.xhtml?"/>":">",r}text(e){return e}};class Ct{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""}}class St{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)}}class Rt{constructor(e){this.options=e||Ye,this.options.renderer=this.options.renderer||new _t,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ct,this.slugger=new St}static parse(e,t){return new Rt(t).parse(e)}static parseInline(e,t){return new Rt(t).parseInline(e)}parse(e,t=!0){let n,r,s,i,o,a,c,l,u,d,p,f,h,m,g,b,y,w,v,$="";const k=e.length;for(n=0;n<k;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({parser:this},d),!1!==v||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(d.type)))$+=v||"";else switch(d.type){case"space":continue;case"hr":$+=this.renderer.hr();continue;case"heading":$+=this.renderer.heading(this.parseInline(d.tokens),d.depth,rt(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":$+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(l="",c="",i=d.header.length,r=0;r<i;r++)c+=this.renderer.tablecell(this.parseInline(d.header[r].tokens),{header:!0,align:d.align[r]});for(l+=this.renderer.tablerow(c),u="",i=d.rows.length,r=0;r<i;r++){for(a=d.rows[r],c="",o=a.length,s=0;s<o;s++)c+=this.renderer.tablecell(this.parseInline(a[s].tokens),{header:!1,align:d.align[s]});u+=this.renderer.tablerow(c)}$+=this.renderer.table(l,u);continue;case"blockquote":u=this.parse(d.tokens),$+=this.renderer.blockquote(u);continue;case"list":for(p=d.ordered,f=d.start,h=d.loose,i=d.items.length,u="",r=0;r<i;r++)g=d.items[r],b=g.checked,y=g.task,m="",g.task&&(w=this.renderer.checkbox(b),h?g.tokens.length>0&&"paragraph"===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);$+=this.renderer.list(u,p,f);continue;case"html":$+=this.renderer.html(d.text);continue;case"paragraph":$+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1<k&&"text"===e[n+1].type;)d=e[++n],u+="\n"+(d.tokens?this.parseInline(d.tokens):d.text);$+=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 $}parseInline(e,t){t=t||this.renderer;let n,r,s,i="";const o=e.length;for(n=0;n<o;n++)if(r=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(s=this.options.extensions.renderers[r.type].call({parser:this},r),!1!==s||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)))i+=s||"";else switch(r.type){case"escape":case"text":i+=t.text(r.text);break;case"html":i+=t.html(r.text);break;case"link":i+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":i+=t.image(r.href,r.title,r.text);break;case"strong":i+=t.strong(this.parseInline(r.tokens,t));break;case"em":i+=t.em(this.parseInline(r.tokens,t));break;case"codespan":i+=t.codespan(r.text);break;case"br":i+=t.br();break;case"del":i+=t.del(this.parseInline(r.tokens,t));break;default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return i}}class Et{constructor(e){this.options=e||Ye}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(e){return e}postprocess(e){return e}}function At(e,t){return(n,r,s)=>{"function"==typeof r&&(s=r,r=null);const i={...r},o=function(e,t,n){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+tt(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):n?void n(null,e):e}if(t)return Promise.reject(r);if(!n)throw r;n(r)}}((r={...Tt.defaults,...i}).silent,r.async,s);if(null==n)return o(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}(r),r.hooks&&(r.hooks.options=r),s){const i=r.highlight;let a;try{r.hooks&&(n=r.hooks.preprocess(n)),a=e(n,r)}catch(e){return o(e)}const c=function(e){let n;if(!e)try{r.walkTokens&&Tt.walkTokens(a,r.walkTokens),n=t(a,r),r.hooks&&(n=r.hooks.postprocess(n))}catch(t){e=t}return r.highlight=i,e?o(e):s(null,n)};if(!i||i.length<3)return c();if(delete r.highlight,!a.length)return c();let l=0;return Tt.walkTokens(a,(function(e){"code"===e.type&&(l++,setTimeout((()=>{i(e.text,e.lang,(function(t,n){if(t)return c(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),l--,0===l&&c()}))}),0))})),void(0===l&&c())}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then((t=>e(t,r))).then((e=>r.walkTokens?Promise.all(Tt.walkTokens(e,r.walkTokens)).then((()=>e)):e)).then((e=>t(e,r))).then((e=>r.hooks?r.hooks.postprocess(e):e)).catch(o);try{r.hooks&&(n=r.hooks.preprocess(n));const s=e(n,r);r.walkTokens&&Tt.walkTokens(s,r.walkTokens);let i=t(s,r);return r.hooks&&(i=r.hooks.postprocess(i)),i}catch(e){return o(e)}}}function Tt(e,t,n){return At(xt.lex,Rt.parse)(e,t,n)}Tt.options=Tt.setOptions=function(e){var t;return Tt.defaults={...Tt.defaults,...e},t=Tt.defaults,Ye=t,Tt},Tt.getDefaults=Ve,Tt.defaults=Ye,Tt.use=function(...e){const t=Tt.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((e=>{const n={...e};if(n.async=Tt.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),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'");t[e.level]?t[e.level].unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=Tt.defaults.renderer||new _t;for(const n in e.renderer){const r=t[n];t[n]=(...s)=>{let i=e.renderer[n].apply(t,s);return!1===i&&(i=r.apply(t,s)),i}}n.renderer=t}if(e.tokenizer){const t=Tt.defaults.tokenizer||new yt;for(const n in e.tokenizer){const r=t[n];t[n]=(...s)=>{let i=e.tokenizer[n].apply(t,s);return!1===i&&(i=r.apply(t,s)),i}}n.tokenizer=t}if(e.hooks){const t=Tt.defaults.hooks||new Et;for(const n in e.hooks){const r=t[n];Et.passThroughHooks.has(n)?t[n]=s=>{if(Tt.defaults.async)return Promise.resolve(e.hooks[n].call(t,s)).then((e=>r.call(t,e)));const i=e.hooks[n].call(t,s);return r.call(t,i)}:t[n]=(...s)=>{let i=e.hooks[n].apply(t,s);return!1===i&&(i=r.apply(t,s)),i}}n.hooks=t}if(e.walkTokens){const t=Tt.defaults.walkTokens;n.walkTokens=function(n){let r=[];return r.push(e.walkTokens.call(this,n)),t&&(r=r.concat(t.call(this,n))),r}}Tt.setOptions(n)}))},Tt.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(Tt,r)),r.type){case"table":for(const e of r.header)n=n.concat(Tt.walkTokens(e.tokens,t));for(const e of r.rows)for(const r of e)n=n.concat(Tt.walkTokens(r.tokens,t));break;case"list":n=n.concat(Tt.walkTokens(r.items,t));break;default:Tt.defaults.extensions&&Tt.defaults.extensions.childTokens&&Tt.defaults.extensions.childTokens[r.type]?Tt.defaults.extensions.childTokens[r.type].forEach((function(e){n=n.concat(Tt.walkTokens(r[e],t))})):r.tokens&&(n=n.concat(Tt.walkTokens(r.tokens,t)))}return n},Tt.parseInline=At(xt.lexInline,Rt.parseInline),Tt.Parser=Rt,Tt.parser=Rt.parse,Tt.Renderer=_t,Tt.TextRenderer=Ct,Tt.Lexer=xt,Tt.lexer=xt.lex,Tt.Tokenizer=yt,Tt.Slugger=St,Tt.Hooks=Et,Tt.parse=Tt,Tt.options,Tt.setOptions,Tt.use,Tt.walkTokens,Tt.parseInline;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Lt,Pt={};Lt={get exports(){return Pt},set exports(e){Pt=e}},function(e,t){Lt.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 It=Pt,Dt=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<s;){var c,l=e(n[r],1);t.insertBefore(l,i),o&&a&&l.selected&&(a=!a,c=t.selectedIndex,t.selectedIndex=c<0?r:d.call(t.querySelectorAll("option"),l)),r++}}function i(e,t){return e==t}function o(e){return e}function a(e,t,n,r,s,i,o){var a=i-s;if(a<1)return-1;for(;a<=n-t;){for(var c=t,l=s;c<n&&l<i&&o(e[c],r[l]);)c++,l++;if(l===i)return t;t=c+1}return-1}function c(e,t,n,r,s){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:s}function l(e,t,n,r){for(;n<r;)f(e(t[n++],-1))}var u=r.WeakSet,d=[].indexOf,p=function(e,t,n){for(var r=1,s=t;r<s;){var i=(r+s)/2>>>0;n<e[i]?s=i:r=1+i}return r},f=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function h(e,t,n,r){for(var u=(r=r||{}).compare||i,d=r.node||o,f=null==r.before?null:d(r.before,0),h=t.length,m=h,g=0,b=n.length,y=0;g<m&&y<b&&u(t[g],n[y]);)g++,y++;for(;g<m&&y<b&&u(t[m-1],n[b-1]);)m--,b--;var w=g===m,v=y===b;if(w&&v)return n;if(w&&y<b)return s(d,e,n,y,b,c(d,t,g,h,f)),n;if(v&&g<m)return l(d,t,g,m),n;var $=m-g,k=b-y,x=-1;if($<k){if(-1<(x=a(n,y,b,t,g,m,u)))return s(d,e,n,y,x,d(t[g],0)),s(d,e,n,x+$,b,c(d,t,m,h,f)),n}else if(k<$&&-1<(x=a(t,g,m,n,y,b,u)))return l(d,t,g,x),l(d,t,x+k,m),n;return $<2||k<2?(s(d,e,n,y,b,d(t[g],0)),l(d,t,g,m)):$==k&&function(e,t,n,r,s,i){for(;r<s&&i(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,u)?s(d,e,n,y,b,c(d,t,m,h,f)):function(e,t,n,r,i,o,a,c,u,d,f,h,m){!function(e,t,n,r,i,o,a,c,u){for(var d=[],p=e.length,f=a,h=0;h<p;)switch(e[h++]){case 0:i++,f++;break;case 1:d.push(r[i]),s(t,n,r,i++,i,f<c?t(o[f],0):u);break;case-1:f++}for(h=0;h<p;)switch(e[h++]){case 0:a++;break;case-1:-1<d.indexOf(o[a])?a++:l(t,o,a++,a)}}(function(e,t,n,r,s,i,o){var a,c,l,u,d,p,f=n+i,h=[];e:for(b=0;b<=f;b++){if(50<b)return null;for(p=b-1,u=b?h[b-1]:[0,0],d=h[b]=[],a=-b;a<=b;a+=2){for(c=(l=a===-b||a!==b&&u[p+a-1]<u[p+a+1]?u[p+a+1]:u[p+a-1]+1)-a;l<i&&c<n&&o(r[s+l],e[t+c]);)l++,c++;if(l===i&&c===n)break e;d[b+a]=l}}for(var m=Array(b/2+f/2),g=m.length-1,b=h.length-1;0<=b;b--){for(;0<l&&0<c&&o(r[s+l-1],e[t+c-1]);)m[g--]=0,l--,c--;if(!b)break;p=b-1,u=b?h[b-1]:[0,0],(a=l-c)==-b||a!==b&&u[p+a-1]<u[p+a+1]?(c--,m[g--]=1):(l--,m[g--]=-1)}return m}(n,r,o,a,c,d,h)||function(e,t,n,r,s,i,o,a){var c=0,l=r<a?r:a,u=Array(l++),d=Array(l);d[0]=-1;for(var f=1;f<l;f++)d[f]=o;for(var h=s.slice(i,o),m=t;m<n;m++){var g,b=h.indexOf(e[m]);-1<b&&-1<(c=p(d,l,g=b+i))&&(d[c]=g,u[c]={newi:m,oldi:g,prev:u[c-1]})}for(c=--l,--o;d[c]>o;)--c;l=a+r-c;var y=Array(l),w=u[c];for(--n;w;){for(var v=w.newi,$=w.oldi;v<n;)y[--l]=1,--n;for(;$<o;)y[--l]=-1,--o;y[--l]=0,--n,--o,w=w.prev}for(;t<=n;)y[--l]=1,--n;for(;i<=o;)y[--l]=-1,--o;return y}(n,r,i,o,a,c,u,d),e,t,n,r,a,c,f,m)}(d,e,n,y,b,k,t,g,m,$,h,u,f),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,y={};try{y.Map=Map}catch(u){y.Map=function(){var e=0,t=[],n=[];return{delete:function(s){var i=r(s);return i&&(t.splice(e,1),n.splice(e,1)),i},forEach:function(e,r){t.forEach((function(t,s){e.call(r,n[s],t,this)}),this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(s,i){return n[r(s)?e:t.push(s)-1]=i,this}};function r(n){return-1<(e=t.indexOf(n))}}}var w=y.Map;function v(){return this}function $(e,t){var n="_"+e+"$";return{get:function(){return this[n]||k(this,n,t.call(this,e))},set:function(e){k(this,n,e)}}}var k=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(v.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var x,_,C,S,R,E,A={},T={},L=[],P=T.hasOwnProperty,I=0,D={attributes:A,define:function(e,t){e.indexOf("-")<0?(e in T||(I=L.push(e)),T[e]=t):A[e]=t},invoke:function(e,t){for(var n=0;n<I;n++){var r=L[n];if(P.call(e,r))return T[r](e[r],t)}}},N=Array.isArray||(_=(x={}.toString).call([]),function(e){return x.call(e)===_}),O=(C=e,S="fragment",E="content"in z(R="template")?function(e){var t=z(R);return t.innerHTML=e,t.content}:function(e){var t,n=z(S),r=z(R);return j(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=z(S),n=z("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",j(t,n.firstChild.childNodes),t}:E)(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 M,q,U,W,F,B,H,G,V,Y=(q="appendChild",U="cloneNode",W="createTextNode",B=(F="importNode")in(M=e),(H=M.createDocumentFragment())[q](M[W]("g")),H[q](M[W]("")),(B?M[F](H,!0):H[U](!0)).childNodes.length<2?function e(t,n){for(var r=t[U](),s=t.childNodes||[],i=s.length,o=0;n&&o<i;o++)r[q](e(s[o],n));return r}:B?M[F]:function(e,t){return e[U](!!t)}),K="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},Z="-"+Math.random().toFixed(6)+"%",J=!1;try{G=e.createElement("template"),V="tabindex","content"in G&&(G.innerHTML="<p "+V+'="'+Z+'"></p>',G.content.childNodes[0].getAttribute(V)==Z)||(Z="_dt: "+Z.slice(1,-1)+";",J=!0)}catch(u){}var X="\x3c!--"+Z+"--\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||'"')+Z+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+"></"+t+">"}var pe=J?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<o;){var c=i[a];switch(c.nodeType){case 1:var l=s.concat(a);!function(t,n,r,s){for(var i,o=t.attributes,a=[],c=[],l=pe(o,r),u=l.length,d=0;d<u;){var p=l[d++],f=p.value===Z;if(f||1<(i=p.value.split(X)).length){var h=p.name;if(a.indexOf(h)<0){a.push(h);var m=r.shift().replace(f?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+h+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=o[m]||o[m.toLowerCase()];if(f)n.push(he(g,s,m,null));else{for(var b=i.length-2;b--;)r.shift();n.push(he(g,s,m,i))}}c.push(p)}}for(var y=((d=0)<(u=c.length)&&J&&!("ownerSVGElement"in t));d<u;){var w=c[d++];y&&(w.value=""),t.removeAttribute(w.name)}var v=t.nodeName;if(/^script$/i.test(v)){var $=e.createElement(v);for(u=o.length,d=0;d<u;)$.setAttributeNode(o[d++].cloneNode(!0));$.textContent=t.textContent,t.parentNode.replaceChild($,t)}}(c,n,r,l),fe(c,n,r,l);break;case 8:var u=c.textContent;if(u===Z)r.shift(),n.push(Q.test(t.nodeName)?me(t,s):{type:"any",node:c,path:s.concat(a)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"👻":t.removeChild(c),a--,o--}break;case 3:Q.test(t.nodeName)&&K.call(c.textContent)===X&&(r.shift(),n.push(me(t,s)))}a++}}function he(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function me(e,t){return{type:"text",node:e,path:t}}var ge,be=(ge=new n,{get:function(e){return ge.get(e)},set:function(e,t){return ge.set(e,t),t}});function ye(e,t){var n=(e.convert||function(e){return e.join(X).replace(ae,de).replace(oe,le)})(t),r=e.transform;r&&(n=r(n));var s=O(n,e.type);ve(s);var i=[];return fe(s,i,t.slice(0),[]),{content:s,updates:function(n){for(var r=[],s=i.length,o=0,a=0;o<s;){var c=i[o++],l=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,c.path);switch(c.type){case"any":r.push({fn:e.any(l,[]),sparse:!1});break;case"attr":var u=c.sparse,d=e.attribute(l,c.name,c.node);null===u?r.push({fn:d,sparse:!1}):(a+=u.length-2,r.push({fn:d,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(l),sparse:!1}),l.textContent=""}}return s+=a,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+" values instead of "+s+"\n"+t.join("${value}"));for(var i=1,o=1;i<e;){var a=r[i-o];if(a.sparse){var c=a.values,l=c[0],u=1,d=c.length;for(o+=d-2;u<d;)l+=arguments[i++]+c[u++];a.fn(l)}else a.fn(arguments[i++])}return n}}}}var we=[];function ve(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===K.call(r.textContent).length&&e.removeChild(r)}}var $e,ke,xe=($e=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,ke=/([^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),Ce(n,!0)}(e,t):Ce(e.style,!1)});function _e(e,t,n){return t+"-"+n.toLowerCase()}function Ce(e,t){var n,r;return function(s){var i,o,a,c;switch(typeof s){case"object":if(s){if("object"===n){if(!t&&r!==s)for(o in r)o in s||(e[o]="")}else t?e.value="":e.cssText="";for(o in i=t?{}:e,s)a="number"!=typeof(c=s[o])||$e.test(o)?c:c+"px",!t&&/^--/.test(o)?i.setProperty(o,a):i[o]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace(ke,_e),":",e[t],";");return n.join("")}(r=i):r=s;break}default:r!=s&&(n="string",r=s,t?e.value=s||"":e.cssText=s||"")}}}var Se,Re,Ee=(Se=[].slice,(Re=Ae.prototype).ELEMENT_NODE=1,Re.nodeType=111,Re.remove=function(e){var t,n=this.childNodes,r=this.firstChild,s=this.lastChild;return this._=null,e&&2===n.length?s.parentNode.removeChild(s):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(s),t.deleteContents()),r},Re.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,s=0,i=r.length;s<i;s++)t.appendChild(r[s]);return t},Ae);function Ae(e){var t=this.childNodes=Se.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Te(e){return{html:e}}function Le(e,t){switch(e.nodeType){case Ue:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case qe:return Le(e.render(),t);default:return e}}function Pe(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(Te).then(t):Promise.resolve(D.invoke(e,t)).then(t)}function Ie(e){return null!=e&&"then"in e}var De,Ne,Oe,je,ze,Me="ownerSVGElement",qe=v.prototype.nodeType,Ue=Ee.prototype.nodeType,We=(Ne=(De={Event:b,WeakSet:u}).Event,Oe=De.WeakSet,je=!0,ze=null,function(e){return je&&(je=!je,ze=new Oe,function(e){var t=new Oe,n=new Oe;try{new MutationObserver(o).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,s=[],i=function(e){s.push(e),clearTimeout(r),r=setTimeout((function(){o(s.splice(r=0,s.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){i({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){i({addedNodes:[e.target],removedNodes:[]})}),!0)}function o(e){for(var r,s=e.length,i=0;i<s;i++)a((r=e[i]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var s,i=new Ne(t),o=e.length,a=0;a<o;1===(s=e[a++]).nodeType&&function e(t,n,r,s,i){ze.has(t)&&!s.has(t)&&(i.delete(t),s.add(t),t.dispatchEvent(n));for(var o=t.children||[],a=o.length,c=0;c<a;e(o[c++],n,r,s,i));}(s,i,t,n,r));}}(e.ownerDocument)),ze.add(e),e}),Fe=/^(?:form|list)$/i,Be=[].slice;function He(t){return this.type=t,function(t){var n=we,r=ve;return function(s){var i,o,a;return n!==s&&(i=t,o=n=s,a=be.get(o)||be.set(o,ye(i,o)),r=a.updates(Y.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ge=!(He.prototype={attribute:function(e,t,n){var r,s=Me in e;if("style"===t)return xe(e,n,s);if("."===t.slice(0,1))return l=e,u=t.slice(1),s?function(e){try{l[u]=e}catch(t){l.setAttribute(u,e)}}:function(e){l[u]=e};if("?"===t.slice(0,1))return o=e,a=t.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(a,""):o.removeAttribute(a))};if(/^on/.test(t)){var i=t.slice(2);return"connected"===i||"disconnected"===i?We(e):t.toLowerCase()in e&&(i=i.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(i,r,!1),(r=t)&&e.addEventListener(i,t,!1))}}if("data"===t||!s&&t in e&&!Fe.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in D.attributes)return function(n){var s=D.attributes[t](e,n);r!==s&&(null==(r=s)?e.removeAttribute(t):e.setAttribute(t,s))};var o,a,c,l,u,d=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(d&&(d=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,d||(d=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:Le,before:e},s=Me in e?"svg":"html",i=!1;return function o(a){switch(typeof a){case"string":case"number":case"boolean":i?n!==a&&(n=a,t[0].textContent=a):(i=!0,n=a,t=h(e.parentNode,t,[(c=a,e.ownerDocument.createTextNode(c))],r));break;case"function":o(a(e));break;case"object":case"undefined":if(null==a){i=!1,t=h(e.parentNode,t,[],r);break}default:if(i=!1,N(n=a))if(0===a.length)t.length&&(t=h(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":o({html:a});break;case"object":if(N(a[0])&&(a=a.concat.apply([],a)),Ie(a[0])){Promise.all(a).then(o);break}default:t=h(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=h(e.parentNode,t,11===a.nodeType?Be.call(a.childNodes):[a],r):Ie(a)?a.then(o):"placeholder"in a?Pe(a,o):"text"in a?o(String(a.text)):"any"in a?o(a.any):"html"in a?t=h(e.parentNode,t,Be.call(O([].concat(a.html).join(""),s).childNodes),r):o("length"in a?Be.call(a):D.invoke(a,o))}var c}},text:function(e){var t;return function n(r){var s;t!==r&&("object"==(s=typeof(t=r))&&r?Ie(r)?r.then(n):"placeholder"in r?Pe(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?Be.call(r).join(""):D.invoke(r,n)):"function"==s?n(r(e)):e.textContent=null==r?"":r)}}}),Ve=function(t){var r,s,i,o,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),c=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||c?(s={},i=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return s[t]||(s[t]=e)},Ve=c?i:(o=new n,function(e){return o.get(e)||(n=i(t=e),o.set(t,n),n);var t,n})):Ge=!0,Ye(t)};function Ye(e){return Ge?e:Ve(e)}function Ke(e){for(var t=arguments.length,n=[Ye(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Ze=new n,Je=function(e){var t,n,r;return function(){var s=Ke.apply(null,arguments);return r!==s[0]?(r=s[0],n=new He(e),t=Qe(n.apply(n,s))):n.apply(n,s),t}},Xe=function(e,t){var n=t.indexOf(":"),r=Ze.get(e),s=t;return-1<n&&(s=t.slice(n+1),t=t.slice(0,n)||"html"),r||Ze.set(e,r={}),r[s]||(r[s]=Je(t))},Qe=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Ee(t):e},et=new n;function tt(){var e=et.get(this),t=Ke.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new He(Me in this?"svg":"html");et.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var nt,rt,st,it,ot=D.define,at=He.prototype;function ct(e){return arguments.length<2?null==e?Je("html"):"string"==typeof e?ct.wire(null,e):"raw"in e?Je("html")(e):"nodeType"in e?ct.bind(e):Xe(e,"html"):("raw"in e?Je("html"):ct.wire).apply(null,arguments)}return ct.Component=v,ct.bind=function(e){return tt.bind(e)},ct.define=ot,ct.diff=h,(ct.hyper=ct).observe=We,ct.tagger=at,ct.wire=function(e,t){return null==e?Je(t||"html"):Xe(e,t||"html")},ct._={WeakMap:n,WeakSet:u},nt=Je,rt=new n,st=Object.create,it=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(v,{for:{configurable:!0,value:function(e,t){return function(e,t,r,s){var i,o,a,c=t.get(e)||it(e,t);switch(typeof s){case"object":case"function":var l=c.w||(c.w=new n);return l.get(s)||(i=l,o=s,a=new e(r),i.set(o,a),a);default:var u=c.p||(c.p=st(null));return u[s]||(u[s]=new e(r))}}(this,rt.get(e)||(r=e,s=new w,rt.set(r,s),s),e,null==t?"default":t);var r,s}}}),Object.defineProperties(v.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:$("html",nt),svg:$("svg",nt),state:$("state",(function(){return this.defaultState})),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new b(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 s in r)n[s]=r[s];return!1!==t&&this.render(),this}}}),ct}(document); -/*! (c) Andrea Giammarchi (ISC) */const Nt=Dt,Ot=S,jt=Tt,zt=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(!(e=e.trim()))throw new TypeError("Invalid input.");let t="",n="",r="",s=null,i=new Map,o="type",a=Array.from(e);for(let e=0;e<a.length;e++){const c=a[e];switch(o){case"type":if("/"===c){o="subtype";continue}t+=c;break;case"subtype":if(";"===c){o="param-start";continue}n+=c;break;case"param-start":if(Be.test(c)||";"===c)continue;r+=c,o="param-name";break;case"param-name":if("="===c||";"===c){if("="===c){o="param-value",s=null;continue}i.set(r.toLowerCase(),null),r="";continue}r+=c;break;case"param-value":if('"'==c){o="collect-quoted-string";continue}if(";"===c){s=s.trimEnd(),o="param-start",Ge(i,r,s),r="";continue}s="string"==typeof s?s+c:c;break;case"collect-quoted-string":if('"'===c){Ge(i,r,s),o="ignore-input-until-next-param",r="",s=null;continue}if("\\"===c)continue;s="string"==typeof s?s+c:c;break;case"ignore-input-until-next-param":if(";"!==c)continue;o="param-start";break;default:throw new Error(`State machine error - unknown parser mode: ${o} `)}}r&&Ge(i,r,s);if(""===t.trim()||!Fe.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!Fe.test(n))throw new TypeError("Invalid subtype");return{type:t,subtype:n,params:Object.fromEntries(i.entries())}}(e);this.type=t.trim().toLowerCase(),this.subtype=n.trimEnd().toLowerCase(),this.parameters=new Map(Object.entries(r))}get essence(){return`${this.type}/${this.subtype}`}toString(){return function(e){const{parameters:t,essence:n}=e;if(!t.size)return n;let r=";";for(const[e,n]of t.entries())r+=e,null!==n?Fe.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},Mt=It,qt=We;function Ut(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 Wt=Object.freeze({__proto__:null,name:"core/reindent",reindent:Ut,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=Ut(e.innerHTML)}});const Ft=/-/g;const Bt=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Ht="en"===c||c.startsWith("en-")?"en-AU":c,Gt=new Intl.DateTimeFormat(Ht,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===Ht?"2-digit":"numeric"}),Vt=".informative, .note, .issue, .example, .ednote, .practice, .introductory";function Yt(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as),e.corsMode&&(n.crossOrigin=e.corsMode)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function Kt(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function Zt(e,t="long"){const n=new Intl.ListFormat(c,{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 Jt=Zt("conjunction"),Xt=Zt("disjunction");function Qt(e,t){return Jt(e,t).join("")}function en(e,t){return Xt(e,t).join("")}function tn(e){return e.replace(/&/g,"&").replace(/>/g,">").replace(/"/g,""").replace(/</g,"<")}function nn(e){return e.trim().replace(/\s+/g," ")}function rn(e,t=c){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=sn(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function sn(e,t,n=c){return e[n=n.toLowerCase()]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}function on(e,t=""){return Bt.format(e).replace(Ft,t)}function an(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){Rn(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}async function cn(e,t=864e5){const n=new Request(e),r=new URL(n.url);let s,i;if("caches"in window)try{if(s=await caches.open(r.origin),i=await s.match(n),i&&new Date(i.headers.get("Expires"))>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 ln(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>Nt`${e}, `));return Nt`${r}${n[n.length-1]}`}function un(e,t){return[].concat(Jt(e,t)).map((e=>"string"==typeof e?Nt`${e}`:e))}function dn(e,t=""){const n=function(e){let t=0;for(const n of e)t=Math.imul(31,t)+n.charCodeAt(0)|0;return String(t)}(nn(e.textContent));return pn(e,t,n)}function pn(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 fn(e){const t=new Set,n="ltNodefault"in e.dataset?"":nn(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>nn(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(nn(e))))}return[...t]}function hn(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 mn(e,t){const n=t.closest(Vt);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 gn(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function bn(e){const t=[];for(const n of function*(e){let t=e;for(;t.previousElementSibling;)t=t.previousElementSibling,yield t}(e))"section"===n.localName&&t.push(n);return t}function yn(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 wn(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 vn 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 $n(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{hn(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),kn(t),t}function kn(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...xn(t)])e.remove()}function*xn(e){for(;e.nextNode();)yield e.currentNode}class _n 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 Cn 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||pn(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 Sn(e,t,n={}){const s={...n,isWarning:!1};r("error",new Cn(e,t,s))}function Rn(e,t,n={}){const s={...n,isWarning:!0};r("warn",new Cn(e,t,s))}function En(e){return e?`\`${e}\``:""}function An(e,{quotes:t}={quotes:!1}){return en(e,t?e=>En(Ln(e)):En)}function Tn(e,{quotes:t}={quotes:!1}){return Qt(e,t?e=>En(Ln(e)):En)}function Ln(e){return String(e)?`"${e}"`:""}function Pn(e,...t){return Ut(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 In=new Map([["text/html","html"],["application/xml","xml"]]);function Dn(e,t=document){const n=In.get(e);if(!n){const t=[...In.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=Nn(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function Nn(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:s}=e;kn(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),Kt(s);const i=e.createDocumentFragment(),o=e.querySelector("meta[name='viewport']");o&&t.firstChild!==o&&i.appendChild(o);let a=e.querySelector("meta[charset], meta[content*='charset=']");a||(a=Nt`<meta charset="utf-8" />`);i.appendChild(a);const c=`ReSpec ${window.respecVersion||"Developer Channel"}`,l=Nt` +window.respecVersion="33.0.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=new EventTarget;function r(e,t){if(n.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const r=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:r},window.parent.location.origin)}function s(e,t,r={once:!1}){n.addEventListener(e,(e=>t(e.detail)),r)}t("core/pubsubhub",{sub:s});const i=["githubToken","githubUser"];const o=document.documentElement;o&&!o.hasAttribute("lang")&&(o.lang="en",o.hasAttribute("dir")||(o.dir="ltr"));const a={},c=o.lang;var l=Object.freeze({__proto__:null,l10n:a,lang:c,name:"core/l10n",run:function(e){e.l10n=a[c]||a.en}});let u,d;const p=new WeakMap,f=new WeakMap,h=new WeakMap,m=new WeakMap,g=new WeakMap;let b={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return f.get(e);if("objectStoreNames"===t)return e.objectStoreNames||h.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return v(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function y(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(d||(d=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply($(this),t),v(p.get(this))}:function(...t){return v(e.apply($(this),t))}:function(t,...n){const r=e.call($(this),t,...n);return h.set(r,t.sort?t.sort():[t]),v(r)}}function w(e){return"function"==typeof e?y(e):(e instanceof IDBTransaction&&function(e){if(f.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)}));f.set(e,t)}(e),t=e,(u||(u=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,b):e);var t}function v(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(v(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",s),e.addEventListener("error",i)}));return t.then((t=>{t instanceof IDBCursor&&p.set(t,e)})).catch((()=>{})),g.set(t,e),t}(e);if(m.has(e))return m.get(e);const t=w(e);return t!==e&&(m.set(e,t),g.set(t,e)),t}const $=e=>g.get(e);const k=["get","getKey","getAll","getAllKeys","count"],x=["put","add","delete","clear"],_=new Map;function C(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(_.get(t))return _.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=x.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!s&&!k.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 _.set(t,i),i}b=(e=>({...e,get:(t,n,r)=>C(t,n)||e.get(t,n,r),has:(t,n)=>!!C(t,n)||e.has(t,n)}))(b);var S=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",(e=>t(e.oldVersion,e))),v(n).then((()=>{}))},openDB:function(e,t,{blocked:n,upgrade:r,blocking:s,terminated:i}={}){const o=indexedDB.open(e,t),a=v(o);return r&&o.addEventListener("upgradeneeded",(e=>{r(v(o.result),e.oldVersion,e.newVersion,v(o.transaction),e)})),n&&o.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{i&&e.addEventListener("close",(()=>i())),s&&e.addEventListener("versionchange",(e=>s(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a},unwrap:$,wrap:v});function R(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(e,t,n,r){return R(e,t,n,r,"Syntax")}function A(e,t,n,r,s={}){return s.ruleName=n,R(t.source,e.index,t,r,"Validation",s)}class T{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 L(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=L(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=L(n,t);if(e)return n.union?e:{reference:n,dictionary:e.dictionary}}}function P(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?P(r,t)&&(n=!0):n=!0}return t.cache.dictionaryIncludesRequiredField.set(e,n),n}class I extends Array{constructor({source:e,tokens:t}){super(),Object.defineProperties(this,{source:{value:e},tokens:{value:t},parent:{value:null,writable:!0}})}}class D extends T{static parser(e,t){return()=>{const n=e.consumeKind(t);if(n)return new D({source:e.source,tokens:{value:n}})}}get value(){return J(this.tokens.value.value)}write(e){return e.ts.wrap([e.token(this.tokens.value),e.token(this.tokens.separator)])}}class N extends D{static parse(e){const t=e.consumeKind("eof");if(t)return new N({source:e.source,tokens:{value:t}})}get type(){return"eof"}}function O(e,t){return X(e,{parser:D.parser(e,t),listName:t+" list"})}const j=["identifier","decimal","integer","string"],M=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map((e=>[e,`Legacy${e}`])),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function z(e){for(const t of j){const n=O(e,t);if(n.length)return n}e.error("Expected identifiers, strings, decimals, or integers but none found")}class U extends T{static parse(e){const t={assign:e.consume("=")},n=le(new U({source:e.source,tokens:t}));if(n.list=[],t.assign){if(t.asterisk=e.consume("*"),t.asterisk)return n.this;t.secondaryName=e.consumeKind(...j)}return t.open=e.consume("("),t.open?(n.list=n.rhsIsList?z(e):ne(e),t.close=e.consume(")")||e.error("Unexpected token in extended attribute argument list")):t.assign&&!t.secondaryName&&e.error("No right hand side to extended attribute assignment"),n.this}get rhsIsList(){return this.tokens.assign&&!this.tokens.asterisk&&!this.tokens.secondaryName}get rhsType(){return this.rhsIsList?this.list[0].tokens.value.type+"-list":this.tokens.asterisk?"*":this.tokens.secondaryName?this.tokens.secondaryName.type:null}write(e){const{rhsType:t}=this;return e.ts.wrap([e.token(this.tokens.assign),e.token(this.tokens.asterisk),e.reference_token(this.tokens.secondaryName,this.parent),e.token(this.tokens.open),...this.list.map((n=>"identifier-list"===t?e.identifier(n,this.parent):n.write(e))),e.token(this.tokens.close)])}}class q extends T{static parse(e){const t=e.consumeKind("identifier");if(t)return new q({source:e.source,tokens:{name:t},params:U.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:this.params.tokens.secondaryName?J(t.secondaryName.value):null}}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/whatwg/webidl/pull/609) for more information.";yield A(this.tokens.name,this,"no-nointerfaceobject",e,{level:"warning"})}else if(M.has(t)){const e=`\`[${t}]\` extended attribute is a legacy feature that is now renamed to \`[${M.get(t)}]\`. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more information.`;yield A(this.tokens.name,this,"renamed-legacy",e,{level:"warning",autofix:(n=this,()=>{const{name:e}=n;n.tokens.name.value=M.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 W extends I{static parse(e){const t={};t.open=e.consume("[");const n=new W({source:e.source,tokens:t});return t.open?(n.push(...X(e,{parser:q.parse,listName:"extended attribute"})),t.close=e.consume("]")||e.error("Expected a closing token for the extended attribute list"),n.length||(e.unconsume(t.close.index),e.error("An extended attribute list must not be empty")),e.probe("[")&&e.error("Illegal double extended attribute lists, consider merging them"),n):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 F(e,t){const n=e.consume("?");n&&(t.tokens.nullable=n),e.probe("?")&&e.error("Can't nullable more than once")}function B(e,t){let n=function(e,t){const n=e.consume("FrozenArray","ObservableArray","Promise","sequence","record");if(!n)return;const r=le(new H({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=se(e,t)||e.error("Missing Promise subtype");r.subtype.push(n);break}case"sequence":case"FrozenArray":case"ObservableArray":{const s=re(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(...pe)||e.error(`Record key must be one of: ${pe.join(", ")}`),s=new H({source:e.source,tokens:{base:n}});s.tokens.separator=e.consume(",")||e.error("Missing comma after record key type"),s.type=t;const i=re(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)||te(e);if(!n){const t=e.consumeKind("identifier")||e.consume(...pe,...de);if(!t)return;n=new H({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,F(e,n),n.nullable&&"any"===n.idlType&&e.error("Type `any` cannot be made nullable"),n}class H extends T{static parse(e,t){return B(e,t)||function(e,t){const n={};if(n.open=e.consume("("),!n.open)return;const r=le(new H({source:e.source,tokens:n}));for(r.type=t||null;;){const t=re(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"),F(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 W({source:e,tokens:{}})}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 J([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/whatwg/webidl/issues/60) for more information.";yield A(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}=L(r,e)||{};if(t){const e=(this.union?t:this).tokens.base,n="Nullable union cannot include a dictionary type.";yield A(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 G extends T{static parse(e){const t=e.consume("=");if(!t)return null;const n=Q(e)||e.consumeKind("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 G({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 ee(this.expression[0]).type}get value(){return ee(this.expression[0]).value}get negative(){return ee(this.expression[0]).negative}write(e){return e.ts.wrap([e.token(this.tokens.assign),...this.expression.map((t=>e.token(t)))])}}class V extends T{static parse(e){const t=e.position,n={},r=le(new V({source:e.source,tokens:n}));return r.extAttrs=W.parse(e),n.optional=e.consume("optional"),r.idlType=re(e,"argument-type"),r.idlType?(n.optional||(n.variadic=e.consume("...")),n.name=e.consumeKind("identifier")||e.consume(...fe),n.name?(r.default=n.optional?G.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 J(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e),yield*this.idlType.validate(e);const t=L(this.idlType,e,{useNullableInner:!0});if(t)if(this.idlType.nullable){const e="Dictionary arguments cannot be nullable.";yield A(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 A(this.tokens.name,this,"dict-arg-default",e,{autofix:Y(this)})}}else if(this.parent&&!P(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 A(this.tokens.name,this,"dict-arg-optional",e,{autofix:(n=this,()=>{const e=ce(n.idlType);n.tokens.optional={...e,type:"optional",value:"optional"},e.trivia=" ",Y(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 Y(e){return()=>{e.default=G.parse(new be(" = {}"))}}class K extends T{static parse(e,{special:t,regular:n}={}){const r={special:t},s=le(new K({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=se(e)||e.error("Missing return type"),r.name=e.consumeKind("identifier")||e.consume("includes"),r.open=e.consume("(")||e.error("Invalid operation"),s.arguments=ne(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?J(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 A(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 Z extends T{static parse(e,{special:t,noInherit:n=!1,readonly:r=!1}={}){const s=e.position,i={special:t},o=le(new Z({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=re(e,"attribute-type")||e.error("Attribute lacks a type"),i.name=e.consumeKind("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 J(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 A(this.tokens.name,this,"attr-invalid-type",e);break}default:{const{reference:t}=L(this.idlType,e)||{};if(t){const e=(this.idlType.union?t:this.idlType).tokens.base,n="Attributes cannot accept dictionary types.";yield A(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 J(e){return e.startsWith("_")?e.slice(1):e}function X(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 Q(e){return e.consumeKind("decimal","integer")||e.consume("true","false","Infinity","-Infinity","NaN")}function ee({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 te(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 H({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 H({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 H({source:t,tokens:{base:r}}):void 0}function ne(e){return X(e,{parser:V.parse,listName:"arguments list"})}function re(e,t){const n=W.parse(e),r=H.parse(e,t);return r&&(le(r).extAttrs=n),r}function se(e,t){const n=H.parse(e,t||"return-type");if(n)return n;const r=e.consume("void");if(r){const t=new H({source:e.source,tokens:{base:r}});return t.type="return-type",t}}function ie(e){const t=e.consume("stringifier");if(!t)return;return Z.parse(e,{special:t})||K.parse(e,{special:t})||e.error("Unterminated stringifier")}function oe(e){const t=e.split("\n");if(t.length){const e=t[t.length-1].match(/^\s+/);if(e)return e[0]}return""}function ae(e){return()=>{if(e.extAttrs.length){const t=new be("Exposed=Window,"),n=q.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{le(e).extAttrs=W.parse(new be("[Exposed=Window]"));const t=e.tokens.base.trivia;e.extAttrs.tokens.open.trivia=t,e.tokens.base.trivia=`\n${oe(t)}`}}}function ce(e){if(e.extAttrs.length)return e.extAttrs.tokens.open;if("operation"===e.type&&!e.special)return ce(e.idlType);return Object.values(e.tokens).sort(((e,t)=>e.index-t.index))[0]}function le(e,t){if(t||(t=e),!e)return e;return new Proxy(e,{get(e,t){const n=e[t];return Array.isArray(n)&&"source"!==t?le(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}})}const ue={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},de=["ArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","BigInt64Array","BigUint64Array","Float32Array","Float64Array","any","object","symbol"],pe=["ByteString","DOMString","USVString"],fe=["async","attribute","callback","const","constructor","deleter","dictionary","enum","getter","includes","inherit","interface","iterable","maplike","namespace","partial","required","setlike","setter","static","stringifier","typedef","unrestricted"],he=["-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(fe,pe,de),me=["(",")",",","...",":",";","<","=",">","?","*","[","]","{","}"],ge=["_constructor","toString","_toString"];class be{constructor(e){this.source=function(e){const t=[];let n=0,r="",s=1,i=0;for(;n<e.length;){const a=e.charAt(n);let c=-1;if(/[\t\n\r ]/.test(a)?c=o("whitespace",{noFlushTrivia:!0}):"/"===a&&(c=o("comment",{noFlushTrivia:!0})),-1!==c){const e=t.pop().value;s+=(e.match(/\n/g)||[]).length,r+=e,i-=1}else if(/[-0-9.A-Z_a-z]/.test(a)){if(c=o("decimal"),-1===c&&(c=o("integer")),-1===c){c=o("identifier");const e=t.length-1,n=t[e];if(-1!==c){if(ge.includes(n.value)){const r=`${J(n.value)} is a reserved identifier and must not be used.`;throw new ye(E(t,e,null,r))}he.includes(n.value)&&(n.type="inline")}}}else'"'===a&&(c=o("string"));for(const o of me)if(e.startsWith(o,n)){t.push({type:"inline",value:o,trivia:r,line:s,index:i}),r="",n+=o.length,c=n;break}if(-1===c&&(c=o("other")),-1===c)throw new Error("Token stream not progressing");n=c,i+=1}return t.push({type:"eof",value:"",trivia:r,line:s,index:i}),t;function o(o,{noFlushTrivia:a}={}){const c=ue[o];c.lastIndex=n;const l=c.exec(e);return l?(t.push({type:o,value:l[0],trivia:r,line:s,index:i}),a||(r=""),c.lastIndex):-1}}(e),this.position=0}error(e){throw new ye(E(this.source,this.position,this.current,e))}probeKind(e){return this.source.length>this.position&&this.source[this.position].type===e}probe(e){return this.probeKind("inline")&&this.source[this.position].value===e}consumeKind(...e){for(const t of e){if(!this.probeKind(t))continue;const e=this.source[this.position];return this.position++,e}}consume(...e){if(!this.probeKind("inline"))return;const t=this.source[this.position];for(const n of e)if(t.value===n)return this.position++,t}consumeIdentifier(e){if(this.probeKind("identifier")&&this.source[this.position].value===e)return this.consumeKind("identifier")}unconsume(e){this.position=e}}class ye 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 we extends D{static parse(e){const t=e.consumeKind("string");if(t)return new we({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 ve extends T{static parse(e){const t={};if(t.base=e.consume("enum"),!t.base)return;t.name=e.consumeKind("identifier")||e.error("No name for enum");const n=le(new ve({source:e.source,tokens:t}));return e.current=n.this,t.open=e.consume("{")||e.error("Bodyless enum"),n.values=X(e,{parser:we.parse,allowDangler:!0,listName:"enumeration"}),e.probeKind("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 J(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 $e extends T{static parse(e){const t=e.consumeKind("identifier");if(!t)return;const n={target:t};if(n.includes=e.consume("includes"),n.includes)return n.mixin=e.consumeKind("identifier")||e.error("Incomplete includes statement"),n.termination=e.consume(";")||e.error("No terminating ; for includes statement"),new $e({source:e.source,tokens:n});e.unconsume(t.index)}get type(){return"includes"}get target(){return J(this.tokens.target.value)}get includes(){return J(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 ke extends T{static parse(e){const t={},n=le(new ke({source:e.source,tokens:t}));if(t.base=e.consume("typedef"),t.base)return n.idlType=re(e,"typedef-type")||e.error("Typedef lacks a type"),t.name=e.consumeKind("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 J(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 xe extends T{static parse(e,t){const n={base:t},r=le(new xe({source:e.source,tokens:n}));return n.name=e.consumeKind("identifier")||e.error("Callback lacks a name"),e.current=r.this,n.assign=e.consume("=")||e.error("Callback lacks an assignment"),r.idlType=se(e)||e.error("Callback lacks a return type"),n.open=e.consume("(")||e.error("Callback lacks parentheses for arguments"),r.arguments=ne(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 J(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 _e extends T{static parse(e,t,{inheritable:n,allowedMembers:r}){const{tokens:s,type:i}=t;for(s.name=e.consumeKind("identifier")||e.error(`Missing name in ${i}`),e.current=t,t=le(t),n&&Object.assign(s,function(e){const t=e.consume(":");return t?{colon:t,inheritance:e.consumeKind("identifier")||e.error("Inheritance lacks a type")}:{}}(e)),s.open=e.consume("{")||e.error(`Bodyless ${i}`),t.members=[];;){if(s.close=e.consume("}"),s.close)return s.termination=e.consume(";")||e.error(`Missing semicolon after ${i}`),t.this;const n=W.parse(e);let o;for(const[t,...n]of r)if(o=le(t(e,...n)),o)break;o||e.error("Unknown member"),o.extAttrs=n,t.members.push(o.this)}}get partial(){return!!this.tokens.partial}get name(){return J(this.tokens.name.value)}get inheritance(){return this.tokens.inheritance?J(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 Ce extends T{static parse(e){const t={};if(t.base=e.consume("const"),!t.base)return;let n=te(e);if(!n){const t=e.consumeKind("identifier")||e.error("Const lacks a type");n=new H({source:e.source,tokens:{base:t}})}e.probe("?")&&e.error("Unexpected nullable constant type"),n.type="const-type",t.name=e.consumeKind("identifier")||e.error("Const lacks a name"),t.assign=e.consume("=")||e.error("Const lacks value assignment"),t.value=Q(e)||e.error("Const lacks a value"),t.termination=e.consume(";")||e.error("Unterminated const, expected `;`");const r=new Ce({source:e.source,tokens:t});return le(r).idlType=n,r}get type(){return"const"}get name(){return J(this.tokens.name.value)}get value(){return ee(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 Se extends T{static parse(e){const t=e.position,n=le(new Se({source:e.source,tokens:{}})),{tokens:r}=n;if(r.readonly=e.consume("readonly"),r.readonly||(r.async=e.consume("async")),r.base=r.readonly?e.consume("maplike","setlike"):r.async?e.consume("iterable"):e.consume("iterable","maplike","setlike"),!r.base)return void e.unconsume(t);const{type:s}=n,i="maplike"===s,o=i||"iterable"===s,a=n.async&&"iterable"===s;r.open=e.consume("<")||e.error(`Missing less-than sign \`<\` in ${s} declaration`);const c=re(e)||e.error(`Missing a type argument in ${s} declaration`);return n.idlType=[c],n.arguments=[],o&&(c.tokens.separator=e.consume(","),c.tokens.separator?n.idlType.push(re(e)):i&&e.error(`Missing second type argument in ${s} declaration`)),r.close=e.consume(">")||e.error(`Missing greater-than sign \`>\` in ${s} declaration`),e.probe("(")&&(a?(r.argsOpen=e.consume("("),n.arguments.push(...ne(e)),r.argsClose=e.consume(")")||e.error("Unterminated async iterable argument list")):e.error("Arguments are only allowed for `async iterable`")),r.termination=e.consume(";")||e.error(`Missing semicolon after ${s} declaration`),n.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 Re extends T{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=ne(e);n.close=e.consume(")")||e.error("Unterminated constructor"),n.termination=e.consume(";")||e.error("No semicolon after constructor");const s=new Re({source:e.source,tokens:n});return le(s).arguments=r,s}get type(){return"constructor"}*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 Ee(e){const t=e.consume("static");if(!t)return;return Z.parse(e,{special:t})||K.parse(e,{special:t})||e.error("No body in static member")}class Ae extends _e{static parse(e,t,{partial:n=null}={}){const r={partial:n,base:t};return _e.parse(e,new Ae({source:e.source,tokens:r}),{inheritable:!n,allowedMembers:[[Ce.parse],[Re.parse],[Ee],[ie],[Se.parse],[Z.parse],[K.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 A(this.tokens.name,this,"require-exposed",e,{autofix:ae(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 A(e.tokens.name,this,"constructor-member",t,{autofix:Te(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 A(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 A(e.tokens.base,this,"no-constructible-global",t)}}yield*super.validate(e),this.partial||(yield*function*(e,t){const n=function(e){const t=o(e);return{statics:new Set(t.filter((e=>"static"===e.special)).map((e=>e.name))),nonstatics:new Set(t.filter((e=>"static"!==e.special)).map((e=>e.name)))}}(t),r=e.partials.get(t.name)||[],s=e.mixinMap.get(t.name)||[];for(const e of[...r,...s]){const r=o(e),s=r.filter((e=>"static"===e.special)),a=r.filter((e=>"static"!==e.special));yield*i(s,n.statics,e,t),yield*i(a,n.nonstatics,e,t),s.forEach((e=>n.statics.add(e.name))),a.forEach((e=>n.nonstatics.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 ${"static"===s.special?"static ":""}operation "${e}" has already been defined for the base interface "${r.name}" either in itself or in a mixin`;yield A(s.tokens.name,n,"no-cross-overload",t)}}}function o(e){return e.members.filter((({type:e})=>"operation"===e))}}(e,this))}}function Te(e,t){return e=le(e),()=>{const n=oe(e.extAttrs.tokens.open.trivia),r=e.members.length?oe(ce(e.members[0]).trivia):function(e){const t=oe(e),n=t.includes("\t")?"\t":" ";return t+n}(n),s=Re.parse(new be(`\n${r}constructor();`));s.extAttrs=new W({source:e.source,tokens:{}}),le(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 Le extends _e{static parse(e,t,{partial:n}={}){const r={partial:n,base:t};if(r.mixin=e.consume("mixin"),r.mixin)return _e.parse(e,new Le({source:e.source,tokens:r}),{allowedMembers:[[Ce.parse],[ie],[Z.parse,{noInherit:!0}],[K.parse,{regular:!0}]]})}get type(){return"interface mixin"}}class Pe extends T{static parse(e){const t={},n=le(new Pe({source:e.source,tokens:t}));return n.extAttrs=W.parse(e),t.required=e.consume("required"),n.idlType=re(e,"dictionary-type")||e.error("Dictionary member lacks a type"),t.name=e.consumeKind("identifier")||e.error("Dictionary member lacks a name"),n.default=G.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 J(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 Ie extends _e{static parse(e,{partial:t}={}){const n={partial:t};if(n.base=e.consume("dictionary"),n.base)return _e.parse(e,new Ie({source:e.source,tokens:n}),{inheritable:!t,allowedMembers:[[Pe.parse]]})}get type(){return"dictionary"}}class De extends _e{static parse(e,{partial:t}={}){const n={partial:t};if(n.base=e.consume("namespace"),n.base)return _e.parse(e,new De({source:e.source,tokens:n}),{allowedMembers:[[Z.parse,{noInherit:!0,readonly:!0}],[Ce.parse],[K.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 A(this.tokens.name,this,"require-exposed",e,{autofix:ae(this)})}yield*super.validate(e)}}class Ne extends _e{static parse(e,t,{partial:n=null}={}){const r={callback:t};if(r.base=e.consume("interface"),r.base)return _e.parse(e,new Ne({source:e.source,tokens:r}),{inheritable:!n,allowedMembers:[[Ce.parse],[K.parse,{regular:!0}]]})}get type(){return"callback interface"}}function Oe(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 Le.parse(e,n,t)||Ae.parse(e,n,t)||r("Interface has no proper body")}function o(){if(t.productions)for(const n of t.productions){const t=n(e);if(t)return t}return function(){const t=s("callback");if(t)return e.probe("interface")?Ne.parse(e,t):xe.parse(e,t)}()||i()||function(){const t=s("partial");if(t)return Ie.parse(e,{partial:t})||i({partial:t})||De.parse(e,{partial:t})||r("Partial doesn't apply to anything")}()||Ie.parse(e)||ve.parse(e)||ke.parse(e)||$e.parse(e)||De.parse(e)}const a=function(){if(!n.length)return[];const s=[];for(;;){const t=W.parse(e),n=o();if(!n){t.length&&r("Stray extended attributes");break}le(n).extAttrs=t,s.push(n)}const i=N.parse(e);return t.concrete&&s.push(i),s}();return e.position<n.length&&r("Unrecognised tokens"),a}function je(e){return e}const Me={wrap:e=>e.join(""),trivia:je,name:je,reference:je,type:je,generic:je,nameless:je,inheritance:je,definition:je,extendedAttribute:je,extendedAttributeReference:je};class ze{constructor(e){this.ts=Object.assign({},Me,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=je,...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 Ue(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*qe(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:Ue(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 A(n.tokens.name,n,"no-duplicate",r)}}(t)}var We=Object.freeze({__proto__:null,WebIDLParseError:ye,parse:function(e,t={}){const n=new be(e);return void 0!==t.sourceName&&(n.source.name=t.sourceName),Oe(n,t)},validate:function(e){return[...qe((t=e,t.flat?t.flat():[].concat(...t)))];var t},write:function(e,{templates:t=Me}={}){t=Object.assign({},Me,t);const n=new ze(t);return t.wrap(e.map((e=>e.write(n))))}});const Fe=/^[!#$%&'*+-.^`|~\w]+$/,Be=/[\u000A\u000D\u0009\u0020]/u,He=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function Ge(e,t,n){(t&&""!==t&&!e.has(t)&&He.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function Ve(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Ye={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const Ke=/[&<>"']/,Ze=new RegExp(Ke.source,"g"),Je=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Xe=new RegExp(Je.source,"g"),Qe={"&":"&","<":"<",">":">",'"':""","'":"'"},et=e=>Qe[e];function tt(e,t){if(t){if(Ke.test(e))return e.replace(Ze,et)}else if(Je.test(e))return e.replace(Xe,et);return e}const nt=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function rt(e){return e.replace(nt,((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 st=/(^|[^\[])\^/g;function it(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(st,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const ot=/[^\w:]/g,at=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ct(e,t,n){if(e){let e;try{e=decodeURIComponent(rt(n)).replace(ot,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!at.test(n)&&(n=function(e,t){lt[" "+e]||(ut.test(e)?lt[" "+e]=e+"/":lt[" "+e]=mt(e,"/",!0));const n=-1===(e=lt[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(dt,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(pt,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const lt={},ut=/^[^:]+:\/*[^/]*$/,dt=/^([^:]+:)[\s\S]*$/,pt=/^([^:]+:\/*[^/]*)[\s\S]*$/;const ft={exec:function(){}};function ht(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function mt(e,t,n){const r=e.length;if(0===r)return"";let s=0;for(;s<r;){const i=e.charAt(r-s-1);if(i!==t||n){if(i===t||!n)break;s++}else s++}return e.slice(0,r-s)}function gt(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function bt(e,t,n,r){const s=t.href,i=t.title?tt(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:s,title:i,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:s,title:i,text:tt(o)}}class yt{constructor(e){this.options=e||Ye}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}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:mt(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().replace(this.rules.inline._escapes,"$1"):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=mt(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,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,s,i,o,a,c,l,u,d,p,f,h=t[1].trim();const m=h.length>1,g={type:"list",raw:"",ordered:m,start:m?+h.slice(0,-1):"",loose:!1,items:[]};h=m?`\\d{1,9}\\${h.slice(-1)}`:`\\${h}`,this.options.pedantic&&(h=m?h:"[*+-]");const b=new RegExp(`^( {0,3}${h})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,t=b.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),l=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),u=e.split("\n",1)[0],this.options.pedantic?(i=2,p=l.trimLeft()):(i=t[2].search(/[^ ]/),i=i>4?1:i,p=l.slice(i),i+=t[1].length),a=!1,!l&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),f=!0),!f){const t=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),s=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),o=new RegExp(`^ {0,${Math.min(3,i-1)}}#`);for(;e&&(d=e.split("\n",1)[0],u=d,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!s.test(u))&&!o.test(u)&&!t.test(u)&&!r.test(e);){if(u.search(/[^ ]/)>=i||!u.trim())p+="\n"+u.slice(i);else{if(a)break;if(l.search(/[^ ]/)>=4)break;if(s.test(l))break;if(o.test(l))break;if(r.test(l))break;p+="\n"+u}a||u.trim()||(a=!0),n+=d+"\n",e=e.substring(d.length+1),l=u.slice(i)}}g.loose||(c?g.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(s="[ ] "!==r[0],p=p.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!r,checked:s,loose:!1,text:p}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=p.trimRight(),g.raw=g.raw.trimRight();const y=g.items.length;for(o=0;o<y;o++)if(this.lexer.state.top=!1,g.items[o].tokens=this.lexer.blockTokens(g.items[o].text,[]),!g.loose){const e=g.items[o].tokens.filter((e=>"space"===e.type)),t=e.length>0&&e.some((e=>/\n.*\n/.test(e.raw)));g.loose=t}if(g.loose)for(o=0;o<y;o++)g.items[o].loose=!0;return g}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};if(this.options.sanitize){const n=this.options.sanitizer?this.options.sanitizer(t[0]):tt(t[0]);e.type="paragraph",e.text=n,e.tokens=this.lexer.inline(n)}return e}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:ht(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,s,i,o=e.align.length;for(n=0;n<o;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(o=e.rows.length,n=0;n<o;n++)e.rows[n]=ht(e.rows[n],e.header.length).map((e=>({text:e})));for(o=e.header.length,r=0;r<o;r++)e.header[r].tokens=this.lexer.inline(e.header[r].text);for(o=e.rows.length,r=0;r<o;r++)for(i=e.rows[r],s=0;s<i.length;s++)i[s].tokens=this.lexer.inline(i[s].text);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:tt(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):tt(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=mt(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,s=0;for(;s<n;s++)if("\\"===e[s])s++;else if(e[s]===t[0])r++;else if(e[s]===t[1]&&(r--,r<0))return s;return-1}(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(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),bt(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}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){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return bt(n,e,n[0],this.lexer)}}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)continue;if(i=s.length,r[3]||r[4]){o+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+a);const t=e.slice(0,n+r.index+(r[0].length-s.length)+i);if(Math.min(n,i)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const c=t.slice(2,-2);return{type:"strong",raw:t,text:c,tokens:this.lexer.inlineTokens(c)}}}}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=tt(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],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=tt(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=tt(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=tt(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=tt(n[0]),r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):tt(n[0]):n[0]:tt(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const wt={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}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:ft,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};wt.def=it(wt.def).replace("label",wt._label).replace("title",wt._title).getRegex(),wt.bullet=/(?:[*+-]|\d{1,9}[.)])/,wt.listItemStart=it(/^( *)(bull) */).replace("bull",wt.bullet).getRegex(),wt.list=it(wt.list).replace(/bull/g,wt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+wt.def.source+")").getRegex(),wt._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",wt._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,wt.html=it(wt.html,"i").replace("comment",wt._comment).replace("tag",wt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),wt.paragraph=it(wt._paragraph).replace("hr",wt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",wt._tag).getRegex(),wt.blockquote=it(wt.blockquote).replace("paragraph",wt.paragraph).getRegex(),wt.normal={...wt},wt.gfm={...wt.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},wt.gfm.table=it(wt.gfm.table).replace("hr",wt.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","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",wt._tag).getRegex(),wt.gfm.paragraph=it(wt._paragraph).replace("hr",wt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",wt.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",wt._tag).getRegex(),wt.pedantic={...wt.normal,html:it("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",wt._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:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ft,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:it(wt.normal._paragraph).replace("hr",wt.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",wt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const vt={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ft,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,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:ft,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function $t(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function kt(e){let t,n,r="";const s=e.length;for(t=0;t<s;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}vt._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",vt.punctuation=it(vt.punctuation).replace(/punctuation/g,vt._punctuation).getRegex(),vt.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,vt.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,vt._comment=it(wt._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),vt.emStrong.lDelim=it(vt.emStrong.lDelim).replace(/punct/g,vt._punctuation).getRegex(),vt.emStrong.rDelimAst=it(vt.emStrong.rDelimAst,"g").replace(/punct/g,vt._punctuation).getRegex(),vt.emStrong.rDelimUnd=it(vt.emStrong.rDelimUnd,"g").replace(/punct/g,vt._punctuation).getRegex(),vt._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,vt._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,vt._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])?)+(?![-_])/,vt.autolink=it(vt.autolink).replace("scheme",vt._scheme).replace("email",vt._email).getRegex(),vt._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,vt.tag=it(vt.tag).replace("comment",vt._comment).replace("attribute",vt._attribute).getRegex(),vt._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,vt._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,vt._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,vt.link=it(vt.link).replace("label",vt._label).replace("href",vt._href).replace("title",vt._title).getRegex(),vt.reflink=it(vt.reflink).replace("label",vt._label).replace("ref",wt._label).getRegex(),vt.nolink=it(vt.nolink).replace("ref",wt._label).getRegex(),vt.reflinkSearch=it(vt.reflinkSearch,"g").replace("reflink",vt.reflink).replace("nolink",vt.nolink).getRegex(),vt.normal={...vt},vt.pedantic={...vt.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:it(/^!?\[(label)\]\((.*?)\)/).replace("label",vt._label).getRegex(),reflink:it(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",vt._label).getRegex()},vt.gfm={...vt.normal,escape:it(vt.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]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},vt.gfm.url=it(vt.gfm.url,"i").replace("email",vt.gfm._extended_email).getRegex(),vt.breaks={...vt.gfm,br:it(vt.br).replace("{2,}","*").getRegex(),text:it(vt.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class xt{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ye,this.options.tokenizer=this.options.tokenizer||new yt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:wt.normal,inline:vt.normal};this.options.pedantic?(t.block=wt.pedantic,t.inline=vt.pedantic):this.options.gfm&&(t.block=wt.gfm,this.options.breaks?t.inline=vt.breaks:t.inline=vt.gfm),this.tokenizer.rules=t}static get rules(){return{block:wt,inline:vt}}static lex(e,t){return new xt(t).lex(e)}static lexInline(e,t){return new xt(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,s,i;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(s=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=s.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);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 this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,s,i,o,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,i.index)+"["+gt("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,i.index)+"["+gt("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.escapedEmSt.exec(c));)c=c.slice(0,i.index+i[0].length-2)+"++"+c.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(o||(a=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,kt))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,kt))){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({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(s,$t))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),o=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);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(n.raw.length),t.push(n);return t}}let _t=class{constructor(e){this.options=e||Ye}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?'<pre><code class="'+this.options.langPrefix+tt(r)+'">'+(n?e:tt(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:tt(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e){return e}heading(e,t,n,r){if(this.options.headerIds){return`<h${t} id="${this.options.headerPrefix+r.slug(n)}">${e}</h${t}>\n`}return`<h${t}>${e}</h${t}>\n`}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){if(null===(e=ct(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){if(null===(e=ct(this.options.sanitize,this.options.baseUrl,e)))return n;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${t}"`),r+=this.options.xhtml?"/>":">",r}text(e){return e}};class Ct{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""}}class St{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)}}class Rt{constructor(e){this.options=e||Ye,this.options.renderer=this.options.renderer||new _t,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ct,this.slugger=new St}static parse(e,t){return new Rt(t).parse(e)}static parseInline(e,t){return new Rt(t).parseInline(e)}parse(e,t=!0){let n,r,s,i,o,a,c,l,u,d,p,f,h,m,g,b,y,w,v,$="";const k=e.length;for(n=0;n<k;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({parser:this},d),!1!==v||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(d.type)))$+=v||"";else switch(d.type){case"space":continue;case"hr":$+=this.renderer.hr();continue;case"heading":$+=this.renderer.heading(this.parseInline(d.tokens),d.depth,rt(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":$+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(l="",c="",i=d.header.length,r=0;r<i;r++)c+=this.renderer.tablecell(this.parseInline(d.header[r].tokens),{header:!0,align:d.align[r]});for(l+=this.renderer.tablerow(c),u="",i=d.rows.length,r=0;r<i;r++){for(a=d.rows[r],c="",o=a.length,s=0;s<o;s++)c+=this.renderer.tablecell(this.parseInline(a[s].tokens),{header:!1,align:d.align[s]});u+=this.renderer.tablerow(c)}$+=this.renderer.table(l,u);continue;case"blockquote":u=this.parse(d.tokens),$+=this.renderer.blockquote(u);continue;case"list":for(p=d.ordered,f=d.start,h=d.loose,i=d.items.length,u="",r=0;r<i;r++)g=d.items[r],b=g.checked,y=g.task,m="",g.task&&(w=this.renderer.checkbox(b),h?g.tokens.length>0&&"paragraph"===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);$+=this.renderer.list(u,p,f);continue;case"html":$+=this.renderer.html(d.text);continue;case"paragraph":$+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1<k&&"text"===e[n+1].type;)d=e[++n],u+="\n"+(d.tokens?this.parseInline(d.tokens):d.text);$+=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 $}parseInline(e,t){t=t||this.renderer;let n,r,s,i="";const o=e.length;for(n=0;n<o;n++)if(r=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(s=this.options.extensions.renderers[r.type].call({parser:this},r),!1!==s||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)))i+=s||"";else switch(r.type){case"escape":case"text":i+=t.text(r.text);break;case"html":i+=t.html(r.text);break;case"link":i+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":i+=t.image(r.href,r.title,r.text);break;case"strong":i+=t.strong(this.parseInline(r.tokens,t));break;case"em":i+=t.em(this.parseInline(r.tokens,t));break;case"codespan":i+=t.codespan(r.text);break;case"br":i+=t.br();break;case"del":i+=t.del(this.parseInline(r.tokens,t));break;default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return i}}class Et{constructor(e){this.options=e||Ye}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(e){return e}postprocess(e){return e}}function At(e,t){return(n,r,s)=>{"function"==typeof r&&(s=r,r=null);const i={...r},o=function(e,t,n){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+tt(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):n?void n(null,e):e}if(t)return Promise.reject(r);if(!n)throw r;n(r)}}((r={...Tt.defaults,...i}).silent,r.async,s);if(null==n)return o(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}(r),r.hooks&&(r.hooks.options=r),s){const i=r.highlight;let a;try{r.hooks&&(n=r.hooks.preprocess(n)),a=e(n,r)}catch(e){return o(e)}const c=function(e){let n;if(!e)try{r.walkTokens&&Tt.walkTokens(a,r.walkTokens),n=t(a,r),r.hooks&&(n=r.hooks.postprocess(n))}catch(t){e=t}return r.highlight=i,e?o(e):s(null,n)};if(!i||i.length<3)return c();if(delete r.highlight,!a.length)return c();let l=0;return Tt.walkTokens(a,(function(e){"code"===e.type&&(l++,setTimeout((()=>{i(e.text,e.lang,(function(t,n){if(t)return c(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),l--,0===l&&c()}))}),0))})),void(0===l&&c())}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then((t=>e(t,r))).then((e=>r.walkTokens?Promise.all(Tt.walkTokens(e,r.walkTokens)).then((()=>e)):e)).then((e=>t(e,r))).then((e=>r.hooks?r.hooks.postprocess(e):e)).catch(o);try{r.hooks&&(n=r.hooks.preprocess(n));const s=e(n,r);r.walkTokens&&Tt.walkTokens(s,r.walkTokens);let i=t(s,r);return r.hooks&&(i=r.hooks.postprocess(i)),i}catch(e){return o(e)}}}function Tt(e,t,n){return At(xt.lex,Rt.parse)(e,t,n)}Tt.options=Tt.setOptions=function(e){var t;return Tt.defaults={...Tt.defaults,...e},t=Tt.defaults,Ye=t,Tt},Tt.getDefaults=Ve,Tt.defaults=Ye,Tt.use=function(...e){const t=Tt.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((e=>{const n={...e};if(n.async=Tt.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),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'");t[e.level]?t[e.level].unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=Tt.defaults.renderer||new _t;for(const n in e.renderer){const r=t[n];t[n]=(...s)=>{let i=e.renderer[n].apply(t,s);return!1===i&&(i=r.apply(t,s)),i}}n.renderer=t}if(e.tokenizer){const t=Tt.defaults.tokenizer||new yt;for(const n in e.tokenizer){const r=t[n];t[n]=(...s)=>{let i=e.tokenizer[n].apply(t,s);return!1===i&&(i=r.apply(t,s)),i}}n.tokenizer=t}if(e.hooks){const t=Tt.defaults.hooks||new Et;for(const n in e.hooks){const r=t[n];Et.passThroughHooks.has(n)?t[n]=s=>{if(Tt.defaults.async)return Promise.resolve(e.hooks[n].call(t,s)).then((e=>r.call(t,e)));const i=e.hooks[n].call(t,s);return r.call(t,i)}:t[n]=(...s)=>{let i=e.hooks[n].apply(t,s);return!1===i&&(i=r.apply(t,s)),i}}n.hooks=t}if(e.walkTokens){const t=Tt.defaults.walkTokens;n.walkTokens=function(n){let r=[];return r.push(e.walkTokens.call(this,n)),t&&(r=r.concat(t.call(this,n))),r}}Tt.setOptions(n)}))},Tt.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(Tt,r)),r.type){case"table":for(const e of r.header)n=n.concat(Tt.walkTokens(e.tokens,t));for(const e of r.rows)for(const r of e)n=n.concat(Tt.walkTokens(r.tokens,t));break;case"list":n=n.concat(Tt.walkTokens(r.items,t));break;default:Tt.defaults.extensions&&Tt.defaults.extensions.childTokens&&Tt.defaults.extensions.childTokens[r.type]?Tt.defaults.extensions.childTokens[r.type].forEach((function(e){n=n.concat(Tt.walkTokens(r[e],t))})):r.tokens&&(n=n.concat(Tt.walkTokens(r.tokens,t)))}return n},Tt.parseInline=At(xt.lexInline,Rt.parseInline),Tt.Parser=Rt,Tt.parser=Rt.parse,Tt.Renderer=_t,Tt.TextRenderer=Ct,Tt.Lexer=xt,Tt.lexer=xt.lex,Tt.Tokenizer=yt,Tt.Slugger=St,Tt.Hooks=Et,Tt.parse=Tt,Tt.options,Tt.setOptions,Tt.use,Tt.walkTokens,Tt.parseInline;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Lt,Pt={};Lt={get exports(){return Pt},set exports(e){Pt=e}},function(e,t){Lt.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 It=Pt,Dt=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<s;){var c,l=e(n[r],1);t.insertBefore(l,i),o&&a&&l.selected&&(a=!a,c=t.selectedIndex,t.selectedIndex=c<0?r:d.call(t.querySelectorAll("option"),l)),r++}}function i(e,t){return e==t}function o(e){return e}function a(e,t,n,r,s,i,o){var a=i-s;if(a<1)return-1;for(;a<=n-t;){for(var c=t,l=s;c<n&&l<i&&o(e[c],r[l]);)c++,l++;if(l===i)return t;t=c+1}return-1}function c(e,t,n,r,s){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:s}function l(e,t,n,r){for(;n<r;)f(e(t[n++],-1))}var u=r.WeakSet,d=[].indexOf,p=function(e,t,n){for(var r=1,s=t;r<s;){var i=(r+s)/2>>>0;n<e[i]?s=i:r=1+i}return r},f=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function h(e,t,n,r){for(var u=(r=r||{}).compare||i,d=r.node||o,f=null==r.before?null:d(r.before,0),h=t.length,m=h,g=0,b=n.length,y=0;g<m&&y<b&&u(t[g],n[y]);)g++,y++;for(;g<m&&y<b&&u(t[m-1],n[b-1]);)m--,b--;var w=g===m,v=y===b;if(w&&v)return n;if(w&&y<b)return s(d,e,n,y,b,c(d,t,g,h,f)),n;if(v&&g<m)return l(d,t,g,m),n;var $=m-g,k=b-y,x=-1;if($<k){if(-1<(x=a(n,y,b,t,g,m,u)))return s(d,e,n,y,x,d(t[g],0)),s(d,e,n,x+$,b,c(d,t,m,h,f)),n}else if(k<$&&-1<(x=a(t,g,m,n,y,b,u)))return l(d,t,g,x),l(d,t,x+k,m),n;return $<2||k<2?(s(d,e,n,y,b,d(t[g],0)),l(d,t,g,m)):$==k&&function(e,t,n,r,s,i){for(;r<s&&i(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,u)?s(d,e,n,y,b,c(d,t,m,h,f)):function(e,t,n,r,i,o,a,c,u,d,f,h,m){!function(e,t,n,r,i,o,a,c,u){for(var d=[],p=e.length,f=a,h=0;h<p;)switch(e[h++]){case 0:i++,f++;break;case 1:d.push(r[i]),s(t,n,r,i++,i,f<c?t(o[f],0):u);break;case-1:f++}for(h=0;h<p;)switch(e[h++]){case 0:a++;break;case-1:-1<d.indexOf(o[a])?a++:l(t,o,a++,a)}}(function(e,t,n,r,s,i,o){var a,c,l,u,d,p,f=n+i,h=[];e:for(b=0;b<=f;b++){if(50<b)return null;for(p=b-1,u=b?h[b-1]:[0,0],d=h[b]=[],a=-b;a<=b;a+=2){for(c=(l=a===-b||a!==b&&u[p+a-1]<u[p+a+1]?u[p+a+1]:u[p+a-1]+1)-a;l<i&&c<n&&o(r[s+l],e[t+c]);)l++,c++;if(l===i&&c===n)break e;d[b+a]=l}}for(var m=Array(b/2+f/2),g=m.length-1,b=h.length-1;0<=b;b--){for(;0<l&&0<c&&o(r[s+l-1],e[t+c-1]);)m[g--]=0,l--,c--;if(!b)break;p=b-1,u=b?h[b-1]:[0,0],(a=l-c)==-b||a!==b&&u[p+a-1]<u[p+a+1]?(c--,m[g--]=1):(l--,m[g--]=-1)}return m}(n,r,o,a,c,d,h)||function(e,t,n,r,s,i,o,a){var c=0,l=r<a?r:a,u=Array(l++),d=Array(l);d[0]=-1;for(var f=1;f<l;f++)d[f]=o;for(var h=s.slice(i,o),m=t;m<n;m++){var g,b=h.indexOf(e[m]);-1<b&&-1<(c=p(d,l,g=b+i))&&(d[c]=g,u[c]={newi:m,oldi:g,prev:u[c-1]})}for(c=--l,--o;d[c]>o;)--c;l=a+r-c;var y=Array(l),w=u[c];for(--n;w;){for(var v=w.newi,$=w.oldi;v<n;)y[--l]=1,--n;for(;$<o;)y[--l]=-1,--o;y[--l]=0,--n,--o,w=w.prev}for(;t<=n;)y[--l]=1,--n;for(;i<=o;)y[--l]=-1,--o;return y}(n,r,i,o,a,c,u,d),e,t,n,r,a,c,f,m)}(d,e,n,y,b,k,t,g,m,$,h,u,f),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,y={};try{y.Map=Map}catch(u){y.Map=function(){var e=0,t=[],n=[];return{delete:function(s){var i=r(s);return i&&(t.splice(e,1),n.splice(e,1)),i},forEach:function(e,r){t.forEach((function(t,s){e.call(r,n[s],t,this)}),this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(s,i){return n[r(s)?e:t.push(s)-1]=i,this}};function r(n){return-1<(e=t.indexOf(n))}}}var w=y.Map;function v(){return this}function $(e,t){var n="_"+e+"$";return{get:function(){return this[n]||k(this,n,t.call(this,e))},set:function(e){k(this,n,e)}}}var k=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(v.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var x,_,C,S,R,E,A={},T={},L=[],P=T.hasOwnProperty,I=0,D={attributes:A,define:function(e,t){e.indexOf("-")<0?(e in T||(I=L.push(e)),T[e]=t):A[e]=t},invoke:function(e,t){for(var n=0;n<I;n++){var r=L[n];if(P.call(e,r))return T[r](e[r],t)}}},N=Array.isArray||(_=(x={}.toString).call([]),function(e){return x.call(e)===_}),O=(C=e,S="fragment",E="content"in M(R="template")?function(e){var t=M(R);return t.innerHTML=e,t.content}:function(e){var t,n=M(S),r=M(R);return j(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=M(S),n=M("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",j(t,n.firstChild.childNodes),t}:E)(e)});function j(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function M(e){return e===S?C.createDocumentFragment():C.createElementNS("http://www.w3.org/1999/xhtml",e)}var z,U,q,W,F,B,H,G,V,Y=(U="appendChild",q="cloneNode",W="createTextNode",B=(F="importNode")in(z=e),(H=z.createDocumentFragment())[U](z[W]("g")),H[U](z[W]("")),(B?z[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<i;o++)r[U](e(s[o],n));return r}:B?z[F]:function(e,t){return e[q](!!t)}),K="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},Z="-"+Math.random().toFixed(6)+"%",J=!1;try{G=e.createElement("template"),V="tabindex","content"in G&&(G.innerHTML="<p "+V+'="'+Z+'"></p>',G.content.childNodes[0].getAttribute(V)==Z)||(Z="_dt: "+Z.slice(1,-1)+";",J=!0)}catch(u){}var X="\x3c!--"+Z+"--\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||'"')+Z+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+"></"+t+">"}var pe=J?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<o;){var c=i[a];switch(c.nodeType){case 1:var l=s.concat(a);!function(t,n,r,s){for(var i,o=t.attributes,a=[],c=[],l=pe(o,r),u=l.length,d=0;d<u;){var p=l[d++],f=p.value===Z;if(f||1<(i=p.value.split(X)).length){var h=p.name;if(a.indexOf(h)<0){a.push(h);var m=r.shift().replace(f?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+h+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=o[m]||o[m.toLowerCase()];if(f)n.push(he(g,s,m,null));else{for(var b=i.length-2;b--;)r.shift();n.push(he(g,s,m,i))}}c.push(p)}}for(var y=((d=0)<(u=c.length)&&J&&!("ownerSVGElement"in t));d<u;){var w=c[d++];y&&(w.value=""),t.removeAttribute(w.name)}var v=t.nodeName;if(/^script$/i.test(v)){var $=e.createElement(v);for(u=o.length,d=0;d<u;)$.setAttributeNode(o[d++].cloneNode(!0));$.textContent=t.textContent,t.parentNode.replaceChild($,t)}}(c,n,r,l),fe(c,n,r,l);break;case 8:var u=c.textContent;if(u===Z)r.shift(),n.push(Q.test(t.nodeName)?me(t,s):{type:"any",node:c,path:s.concat(a)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"👻":t.removeChild(c),a--,o--}break;case 3:Q.test(t.nodeName)&&K.call(c.textContent)===X&&(r.shift(),n.push(me(t,s)))}a++}}function he(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function me(e,t){return{type:"text",node:e,path:t}}var ge,be=(ge=new n,{get:function(e){return ge.get(e)},set:function(e,t){return ge.set(e,t),t}});function ye(e,t){var n=(e.convert||function(e){return e.join(X).replace(ae,de).replace(oe,le)})(t),r=e.transform;r&&(n=r(n));var s=O(n,e.type);ve(s);var i=[];return fe(s,i,t.slice(0),[]),{content:s,updates:function(n){for(var r=[],s=i.length,o=0,a=0;o<s;){var c=i[o++],l=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,c.path);switch(c.type){case"any":r.push({fn:e.any(l,[]),sparse:!1});break;case"attr":var u=c.sparse,d=e.attribute(l,c.name,c.node);null===u?r.push({fn:d,sparse:!1}):(a+=u.length-2,r.push({fn:d,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(l),sparse:!1}),l.textContent=""}}return s+=a,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+" values instead of "+s+"\n"+t.join("${value}"));for(var i=1,o=1;i<e;){var a=r[i-o];if(a.sparse){var c=a.values,l=c[0],u=1,d=c.length;for(o+=d-2;u<d;)l+=arguments[i++]+c[u++];a.fn(l)}else a.fn(arguments[i++])}return n}}}}var we=[];function ve(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===K.call(r.textContent).length&&e.removeChild(r)}}var $e,ke,xe=($e=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,ke=/([^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),Ce(n,!0)}(e,t):Ce(e.style,!1)});function _e(e,t,n){return t+"-"+n.toLowerCase()}function Ce(e,t){var n,r;return function(s){var i,o,a,c;switch(typeof s){case"object":if(s){if("object"===n){if(!t&&r!==s)for(o in r)o in s||(e[o]="")}else t?e.value="":e.cssText="";for(o in i=t?{}:e,s)a="number"!=typeof(c=s[o])||$e.test(o)?c:c+"px",!t&&/^--/.test(o)?i.setProperty(o,a):i[o]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace(ke,_e),":",e[t],";");return n.join("")}(r=i):r=s;break}default:r!=s&&(n="string",r=s,t?e.value=s||"":e.cssText=s||"")}}}var Se,Re,Ee=(Se=[].slice,(Re=Ae.prototype).ELEMENT_NODE=1,Re.nodeType=111,Re.remove=function(e){var t,n=this.childNodes,r=this.firstChild,s=this.lastChild;return this._=null,e&&2===n.length?s.parentNode.removeChild(s):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(s),t.deleteContents()),r},Re.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,s=0,i=r.length;s<i;s++)t.appendChild(r[s]);return t},Ae);function Ae(e){var t=this.childNodes=Se.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Te(e){return{html:e}}function Le(e,t){switch(e.nodeType){case qe:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Ue:return Le(e.render(),t);default:return e}}function Pe(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(Te).then(t):Promise.resolve(D.invoke(e,t)).then(t)}function Ie(e){return null!=e&&"then"in e}var De,Ne,Oe,je,Me,ze="ownerSVGElement",Ue=v.prototype.nodeType,qe=Ee.prototype.nodeType,We=(Ne=(De={Event:b,WeakSet:u}).Event,Oe=De.WeakSet,je=!0,Me=null,function(e){return je&&(je=!je,Me=new Oe,function(e){var t=new Oe,n=new Oe;try{new MutationObserver(o).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,s=[],i=function(e){s.push(e),clearTimeout(r),r=setTimeout((function(){o(s.splice(r=0,s.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){i({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){i({addedNodes:[e.target],removedNodes:[]})}),!0)}function o(e){for(var r,s=e.length,i=0;i<s;i++)a((r=e[i]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var s,i=new Ne(t),o=e.length,a=0;a<o;1===(s=e[a++]).nodeType&&function e(t,n,r,s,i){Me.has(t)&&!s.has(t)&&(i.delete(t),s.add(t),t.dispatchEvent(n));for(var o=t.children||[],a=o.length,c=0;c<a;e(o[c++],n,r,s,i));}(s,i,t,n,r));}}(e.ownerDocument)),Me.add(e),e}),Fe=/^(?:form|list)$/i,Be=[].slice;function He(t){return this.type=t,function(t){var n=we,r=ve;return function(s){var i,o,a;return n!==s&&(i=t,o=n=s,a=be.get(o)||be.set(o,ye(i,o)),r=a.updates(Y.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ge=!(He.prototype={attribute:function(e,t,n){var r,s=ze in e;if("style"===t)return xe(e,n,s);if("."===t.slice(0,1))return l=e,u=t.slice(1),s?function(e){try{l[u]=e}catch(t){l.setAttribute(u,e)}}:function(e){l[u]=e};if("?"===t.slice(0,1))return o=e,a=t.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(a,""):o.removeAttribute(a))};if(/^on/.test(t)){var i=t.slice(2);return"connected"===i||"disconnected"===i?We(e):t.toLowerCase()in e&&(i=i.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(i,r,!1),(r=t)&&e.addEventListener(i,t,!1))}}if("data"===t||!s&&t in e&&!Fe.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in D.attributes)return function(n){var s=D.attributes[t](e,n);r!==s&&(null==(r=s)?e.removeAttribute(t):e.setAttribute(t,s))};var o,a,c,l,u,d=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(d&&(d=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,d||(d=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:Le,before:e},s=ze in e?"svg":"html",i=!1;return function o(a){switch(typeof a){case"string":case"number":case"boolean":i?n!==a&&(n=a,t[0].textContent=a):(i=!0,n=a,t=h(e.parentNode,t,[(c=a,e.ownerDocument.createTextNode(c))],r));break;case"function":o(a(e));break;case"object":case"undefined":if(null==a){i=!1,t=h(e.parentNode,t,[],r);break}default:if(i=!1,N(n=a))if(0===a.length)t.length&&(t=h(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":o({html:a});break;case"object":if(N(a[0])&&(a=a.concat.apply([],a)),Ie(a[0])){Promise.all(a).then(o);break}default:t=h(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=h(e.parentNode,t,11===a.nodeType?Be.call(a.childNodes):[a],r):Ie(a)?a.then(o):"placeholder"in a?Pe(a,o):"text"in a?o(String(a.text)):"any"in a?o(a.any):"html"in a?t=h(e.parentNode,t,Be.call(O([].concat(a.html).join(""),s).childNodes),r):o("length"in a?Be.call(a):D.invoke(a,o))}var c}},text:function(e){var t;return function n(r){var s;t!==r&&("object"==(s=typeof(t=r))&&r?Ie(r)?r.then(n):"placeholder"in r?Pe(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?Be.call(r).join(""):D.invoke(r,n)):"function"==s?n(r(e)):e.textContent=null==r?"":r)}}}),Ve=function(t){var r,s,i,o,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),c=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||c?(s={},i=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return s[t]||(s[t]=e)},Ve=c?i:(o=new n,function(e){return o.get(e)||(n=i(t=e),o.set(t,n),n);var t,n})):Ge=!0,Ye(t)};function Ye(e){return Ge?e:Ve(e)}function Ke(e){for(var t=arguments.length,n=[Ye(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Ze=new n,Je=function(e){var t,n,r;return function(){var s=Ke.apply(null,arguments);return r!==s[0]?(r=s[0],n=new He(e),t=Qe(n.apply(n,s))):n.apply(n,s),t}},Xe=function(e,t){var n=t.indexOf(":"),r=Ze.get(e),s=t;return-1<n&&(s=t.slice(n+1),t=t.slice(0,n)||"html"),r||Ze.set(e,r={}),r[s]||(r[s]=Je(t))},Qe=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Ee(t):e},et=new n;function tt(){var e=et.get(this),t=Ke.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new He(ze in this?"svg":"html");et.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var nt,rt,st,it,ot=D.define,at=He.prototype;function ct(e){return arguments.length<2?null==e?Je("html"):"string"==typeof e?ct.wire(null,e):"raw"in e?Je("html")(e):"nodeType"in e?ct.bind(e):Xe(e,"html"):("raw"in e?Je("html"):ct.wire).apply(null,arguments)}return ct.Component=v,ct.bind=function(e){return tt.bind(e)},ct.define=ot,ct.diff=h,(ct.hyper=ct).observe=We,ct.tagger=at,ct.wire=function(e,t){return null==e?Je(t||"html"):Xe(e,t||"html")},ct._={WeakMap:n,WeakSet:u},nt=Je,rt=new n,st=Object.create,it=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(v,{for:{configurable:!0,value:function(e,t){return function(e,t,r,s){var i,o,a,c=t.get(e)||it(e,t);switch(typeof s){case"object":case"function":var l=c.w||(c.w=new n);return l.get(s)||(i=l,o=s,a=new e(r),i.set(o,a),a);default:var u=c.p||(c.p=st(null));return u[s]||(u[s]=new e(r))}}(this,rt.get(e)||(r=e,s=new w,rt.set(r,s),s),e,null==t?"default":t);var r,s}}}),Object.defineProperties(v.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:$("html",nt),svg:$("svg",nt),state:$("state",(function(){return this.defaultState})),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new b(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 s in r)n[s]=r[s];return!1!==t&&this.render(),this}}}),ct}(document); +/*! (c) Andrea Giammarchi (ISC) */const Nt=Dt,Ot=S,jt=Tt,Mt=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(!(e=e.trim()))throw new TypeError("Invalid input.");let t="",n="",r="",s=null,i=new Map,o="type",a=Array.from(e);for(let e=0;e<a.length;e++){const c=a[e];switch(o){case"type":if("/"===c){o="subtype";continue}t+=c;break;case"subtype":if(";"===c){o="param-start";continue}n+=c;break;case"param-start":if(Be.test(c)||";"===c)continue;r+=c,o="param-name";break;case"param-name":if("="===c||";"===c){if("="===c){o="param-value",s=null;continue}i.set(r.toLowerCase(),null),r="";continue}r+=c;break;case"param-value":if('"'==c){o="collect-quoted-string";continue}if(";"===c){s=s.trimEnd(),o="param-start",Ge(i,r,s),r="";continue}s="string"==typeof s?s+c:c;break;case"collect-quoted-string":if('"'===c){Ge(i,r,s),o="ignore-input-until-next-param",r="",s=null;continue}if("\\"===c)continue;s="string"==typeof s?s+c:c;break;case"ignore-input-until-next-param":if(";"!==c)continue;o="param-start";break;default:throw new Error(`State machine error - unknown parser mode: ${o} `)}}r&&Ge(i,r,s);if(""===t.trim()||!Fe.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!Fe.test(n))throw new TypeError("Invalid subtype");return{type:t,subtype:n,params:Object.fromEntries(i.entries())}}(e);this.type=t.trim().toLowerCase(),this.subtype=n.trimEnd().toLowerCase(),this.parameters=new Map(Object.entries(r))}get essence(){return`${this.type}/${this.subtype}`}toString(){return function(e){const{parameters:t,essence:n}=e;if(!t.size)return n;let r=";";for(const[e,n]of t.entries())r+=e,null!==n?Fe.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},zt=It,Ut=We;function qt(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 Wt=Object.freeze({__proto__:null,name:"core/reindent",reindent:qt,run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=qt(e.innerHTML)}});const Ft=/-/g;const Bt=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Ht="en"===c||c.startsWith("en-")?"en-AU":c,Gt=new Intl.DateTimeFormat(Ht,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===Ht?"2-digit":"numeric"}),Vt=".informative, .note, .issue, .example, .ednote, .practice, .introductory";function Yt(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as),e.corsMode&&(n.crossOrigin=e.corsMode)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function Kt(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach((e=>{e.remove()}))}function Zt(e,t="long"){const n=new Intl.ListFormat(c,{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 Jt=Zt("conjunction"),Xt=Zt("disjunction");function Qt(e,t){return Jt(e,t).join("")}function en(e,t){return Xt(e,t).join("")}function tn(e){return e.replace(/&/g,"&").replace(/>/g,">").replace(/"/g,""").replace(/</g,"<")}function nn(e){return e.trim().replace(/\s+/g," ")}function rn(e,t=c){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=sn(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function sn(e,t,n=c){return e[n=n.toLowerCase()]?.[t]||e[n.match(/^(\w{2,3})-.+$/)?.[1]]?.[t]}function on(e,t=""){return Bt.format(e).replace(Ft,t)}function an(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){Rn(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace."}),console.error(e)}}}return e}async function cn(e,t=864e5){const n=new Request(e),r=new URL(n.url);let s,i;if("caches"in window)try{if(s=await caches.open(r.origin),i=await s.match(n),i&&new Date(i.headers.get("Expires"))>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 ln(e,t=(e=>e)){const n=e.map(t),r=n.slice(0,-1).map((e=>Nt`${e}, `));return Nt`${r}${n[n.length-1]}`}function un(e,t){return[].concat(Jt(e,t)).map((e=>"string"==typeof e?Nt`${e}`:e))}function dn(e,t=""){const n=function(e){let t=0;for(const n of e)t=Math.imul(31,t)+n.charCodeAt(0)|0;return String(t)}(nn(e.textContent));return pn(e,t,n)}function pn(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 fn(e){const t=new Set,n="ltNodefault"in e.dataset?"":nn(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map((e=>nn(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(nn(e))))}return[...t]}function hn(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 mn(e,t){const n=t.closest(Vt);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 gn(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function bn(e){const t=[];for(const n of function*(e){let t=e;for(;t.previousElementSibling;)t=t.previousElementSibling,yield t}(e))"section"===n.localName&&t.push(n);return t}function yn(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 wn(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 vn 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 $n(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),t.querySelectorAll("dfn").forEach((e=>{hn(e,"span",{copyAttributes:!1})})),t.hasAttribute("id")&&t.removeAttribute("id"),kn(t),t}function kn(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...xn(t)])e.remove()}function*xn(e){for(;e.nextNode();)yield e.currentNode}class _n 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 Cn 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||pn(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 Sn(e,t,n={}){const s={...n,isWarning:!1};r("error",new Cn(e,t,s))}function Rn(e,t,n={}){const s={...n,isWarning:!0};r("warn",new Cn(e,t,s))}function En(e){return e?`\`${e}\``:""}function An(e,{quotes:t}={quotes:!1}){return en(e,t?e=>En(Ln(e)):En)}function Tn(e,{quotes:t}={quotes:!1}){return Qt(e,t?e=>En(Ln(e)):En)}function Ln(e){return String(e)?`"${e}"`:""}function Pn(e,...t){return qt(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 In=new Map([["text/html","html"],["application/xml","xml"]]);function Dn(e,t=document){const n=In.get(e);if(!n){const t=[...In.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=Nn(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function Nn(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:s}=e;kn(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach((e=>e.remove())),n.classList.remove("toc-sidebar"),Kt(s);const i=e.createDocumentFragment(),o=e.querySelector("meta[name='viewport']");o&&t.firstChild!==o&&i.appendChild(o);let a=e.querySelector("meta[charset], meta[content*='charset=']");a||(a=Nt`<meta charset="utf-8" />`);i.appendChild(a);const c=`ReSpec ${window.respecVersion||"Developer Channel"}`,l=Nt` <meta name="generator" content="${c}" /> - `;i.appendChild(l),t.prepend(i),r("beforesave",s)}(n);let s="";if("xml"===e)s=(new XMLSerializer).serializeToString(n);else!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&&(s+=(new XMLSerializer).serializeToString(n.doctype)),s+=n.documentElement.outerHTML;return s}t("core/exporter",{rsDocToDataURL:Dn});class On{constructor(){this._respecDonePromise=new Promise((e=>{s("end-all",(()=>e()),{once:!0})})),this.errors=[],this.warnings=[],s("error",(e=>{console.error(e,e.toJSON()),this.errors.push(e)})),s("warn",(e=>{console.warn(e,e.toJSON()),this.warnings.push(e)}))}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return Nn("html",document)}}const jn="core/post-process";const zn="core/pre-process";const Mn="core/base-runner";async function qn(e){!function(){const e=new On;Object.defineProperty(document,"respec",{value:e})}(),r("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),s("amend-user-config",n),s("end-all",(()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of i)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]})),s=Object.fromEntries(n);Object.assign(e,s),r("amend-user-config",s)}(respecConfig),performance.mark(`${Mn}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||Sn("Every item in `preProcess` must be a JS function.",zn),t})).map((async t=>{try{return await t(e,document)}catch(e){Sn(`Function ${t.name} threw an error during \`preProcess\`.`,zn,{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={},r("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||Sn("Every item in `postProcess` must be a JS function.",jn),t})).map((async t=>{try{return await t(e,document)}catch(e){Sn(`Function ${t.name} threw an error during \`postProcess\`.`,jn,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),r("end-all"),Kt(document),performance.mark(`${Mn}-end`),performance.measure(Mn,`${Mn}-start`,`${Mn}-end`)}var Un=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} + `;i.appendChild(l),t.prepend(i),r("beforesave",s)}(n);let s="";if("xml"===e)s=(new XMLSerializer).serializeToString(n);else!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&&(s+=(new XMLSerializer).serializeToString(n.doctype)),s+=n.documentElement.outerHTML;return s}t("core/exporter",{rsDocToDataURL:Dn});class On{constructor(){this._respecDonePromise=new Promise((e=>{s("end-all",(()=>e()),{once:!0})})),this.errors=[],this.warnings=[],s("error",(e=>{console.error(e,e.toJSON()),this.errors.push(e)})),s("warn",(e=>{console.warn(e,e.toJSON()),this.warnings.push(e)}))}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}async toHTML(){return Nn("html",document)}}const jn="core/post-process";const Mn="core/pre-process";const zn="core/base-runner";async function Un(e){!function(){const e=new On;Object.defineProperty(document,"respec",{value:e})}(),r("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),s("amend-user-config",n),s("end-all",(()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of i)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]})),s=Object.fromEntries(n);Object.assign(e,s),r("amend-user-config",s)}(respecConfig),performance.mark(`${zn}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter((e=>{const t="function"==typeof e;return t||Sn("Every item in `preProcess` must be a JS function.",Mn),t})).map((async t=>{try{return await t(e,document)}catch(e){Sn(`Function ${t.name} threw an error during \`preProcess\`.`,Mn,{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={},r("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||Sn("Every item in `postProcess` must be a JS function.",jn),t})).map((async t=>{try{return await t(e,document)}catch(e){Sn(`Function ${t.name} threw an error during \`postProcess\`.`,jn,{hint:"See developer console."}),console.error(e)}}));await Promise.all(t)}"function"==typeof e.afterEnd&&await e.afterEnd(e,document)}(respecConfig),r("end-all"),Kt(document),performance.mark(`${zn}-end`),performance.measure(zn,`${zn}-start`,`${zn}-end`)}var qn=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} #respec-pill,.respec-info-button{height:2.4em;background:#fff;color:#787878;border:1px solid #ccc;box-shadow:1px 1px 8px 0 rgba(100,100,100,.5);padding:.2em 0} .respec-info-button{border:none;opacity:.75;border-radius:2em;margin-right:1em;min-width:3.5em;will-change:opacity} @@ -70,7 +70,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} <img src="${e}" alt="${n}" /> <figcaption>${t}</figcaption> </figure> - `}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`<h${t} id="${r}">${n}</h${t}>`}return super.heading(e,t,n,r)}}const Hn={sanitize:!1,gfm:!0,headerIds:!1,langPrefix:"",renderer:new Bn};function Gn(e,t={inline:!1}){const n=Ut(e).replace(Wn,">").replace(Fn,"&");return t.inline?jt.parseInline(n,Hn):jt.parse(n,Hn)}function Vn(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=Gn(e.innerHTML)}const Yn=(Kn="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(Kn);return t.forEach(Vn),Array.from(t)});var Kn;var Zn=Object.freeze({__proto__:null,markdownToHtml:Gn,name:"core/markdown",run:function(e){const t=!!document.querySelector("[data-format=markdown]:not(body)"),n="markdown"===e.format;if(!n&&!t)return;if(!n)return void Yn(document.body);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=wn(e);e.append(`\n\n${t}`)}}}(s,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),Vn(s),function(e){Array.from(e).forEach((e=>{e.replaceWith(e.textContent)}))}(s.querySelectorAll(".nolinks a[href]")),s.append(r),document.body.replaceWith(s)}});function Jn(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=Un,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const Xn=Nt`<div id="respec-ui" class="removeOnSave" hidden></div>`,Qn=Nt`<ul + `}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`<h${t} id="${r}">${n}</h${t}>`}return super.heading(e,t,n,r)}}const Hn={sanitize:!1,gfm:!0,headerIds:!1,langPrefix:"",renderer:new Bn};function Gn(e,t={inline:!1}){const n=qt(e).replace(Wn,">").replace(Fn,"&");return t.inline?jt.parseInline(n,Hn):jt.parse(n,Hn)}function Vn(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=Gn(e.innerHTML)}const Yn=(Kn="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(Kn);return t.forEach(Vn),Array.from(t)});var Kn;var Zn=Object.freeze({__proto__:null,markdownToHtml:Gn,name:"core/markdown",run:function(e){const t=!!document.querySelector("[data-format=markdown]:not(body)"),n="markdown"===e.format;if(!n&&!t)return;if(!n)return void Yn(document.body);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=wn(e);e.append(`\n\n${t}`)}}}(s,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),Vn(s),function(e){Array.from(e).forEach((e=>{e.replaceWith(e.textContent)}))}(s.querySelectorAll(".nolinks a[href]")),s.append(r),document.body.replaceWith(s)}});function Jn(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=qn,e.classList.add("removeOnSave"),document.head.appendChild(e)}();const Xn=Nt`<div id="respec-ui" class="removeOnSave" hidden></div>`,Qn=Nt`<ul id="respec-menu" role="menu" aria-labelledby="respec-pill" @@ -84,7 +84,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} </button>`;let tr,nr;window.addEventListener("load",(()=>cr(Qn)));const rr=[],sr=[],ir={};s("start-all",(()=>document.body.prepend(Xn)),{once:!0}),s("end-all",(()=>document.body.prepend(Xn)),{once:!0});const or=Nt`<button id="respec-pill" disabled>ReSpec</button>`;function ar(){Qn.classList.toggle("respec-hidden"),Qn.classList.toggle("respec-visible"),Qn.hidden=!Qn.hidden}function cr(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()))}))}Xn.appendChild(or),or.addEventListener("click",(e=>{e.stopPropagation(),or.setAttribute("aria-expanded",String(Qn.hidden)),ar(),Qn.querySelector("li:first-child button").focus()})),document.documentElement.addEventListener("click",(()=>{Qn.hidden||ar()})),Xn.appendChild(Qn),Qn.addEventListener("keydown",(e=>{"Escape"!==e.key||Qn.hidden||(or.setAttribute("aria-expanded",String(Qn.hidden)),ar(),or.focus())}));const lr=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function ur(e,t,n,r){t.push(e),ir.hasOwnProperty(n)||(ir[n]=function(e,t,n){const r=Nt`<button id="${`respec-pill-${e}`}" class="respec-info-button" - ></button>`;r.addEventListener("click",(()=>{r.setAttribute("aria-expanded","true");const s=Nt`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(pr(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),s.appendChild(n)}dr.freshModal(n,s,r)}));const s=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return Jn(r,s),r}(n,t,r),Xn.appendChild(ir[n]));const s=ir[n];s.textContent=t.length;const i=1===t.length?Mt.singular(r):r;Jn(s,new Map([["label",`${t.length} ${i}`]]))}Jn(or,lr);const dr={show(){try{Xn.hidden=!1}catch(e){console.error(e)}},hide(){Xn.hidden=!0},enable(){or.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const s=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,i=Nt`<button id="${s}" class="respec-option"> + ></button>`;r.addEventListener("click",(()=>{r.setAttribute("aria-expanded","true");const s=Nt`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(pr(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),s.appendChild(n)}dr.freshModal(n,s,r)}));const s=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return Jn(r,s),r}(n,t,r),Xn.appendChild(ir[n]));const s=ir[n];s.textContent=t.length;const i=1===t.length?zt.singular(r):r;Jn(s,new Map([["label",`${t.length} ${i}`]]))}Jn(or,lr);const dr={show(){try{Xn.hidden=!1}catch(e){console.error(e)}},hide(){Xn.hidden=!0},enable(){or.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const s=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,i=Nt`<button id="${s}" class="respec-option"> <span class="respec-cmd-icon" aria-hidden="true">${r}</span> ${e}… </button>`,o=Nt`<li role="menuitem">${i}</li>`;return o.addEventListener("click",t),Qn.appendChild(o),i},error(e){ur(e,rr,"error","ReSpec Errors")},warning(e){ur(e,sr,"warning","ReSpec Warnings")},closeModal(e){nr&&(nr.classList.remove("respec-show-overlay"),nr.classList.add("respec-hide-overlay"),nr.addEventListener("transitionend",(()=>{nr.remove(),nr=null}))),e&&e.setAttribute("aria-expanded","false"),tr&&(tr.remove(),tr=null,or.focus())},freshModal(e,t,n){tr&&tr.remove(),nr&&nr.remove(),nr=Nt`<div id="respec-overlay" class="removeOnSave"></div>`;const r=`${n.id}-modal`,s=`${r}-heading`;tr=Nt`<div id="${r}" @@ -95,7 +95,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} ${er} <h3 id="${s}">${e}</h3> <div class="inside">${t}</div> - </div>`;const i=new Map([["labelledby",s]]);Jn(tr,i),document.body.append(nr,tr),nr.addEventListener("click",(()=>this.closeModal(n))),nr.classList.toggle("respec-show-overlay"),tr.hidden=!1,cr(tr)}};function pr(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`\n${Gn(`<p class="respec-hint"><strong>How to fix:</strong> ${Ut(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`<p class="respec-occurrences">Occurred <strong>${e.elements.length}</strong> times at:</p>\n ${Gn(e.elements.map(fr).join("\n"))}`:"",s=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";return`${Gn(`**${e.message}**`,{inline:!0})}${n}${r}${s}${t}`}function fr(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function hr(e){try{dr.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await qn(e)}finally{dr.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&dr.closeModal()})),window.respecUI=dr,s("error",(e=>dr.error(e))),s("warn",(e=>dr.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const mr=[Promise.resolve().then((function(){return gr})),Promise.resolve().then((function(){return l})),Promise.resolve().then((function(){return wr})),Promise.resolve().then((function(){return us})),Promise.resolve().then((function(){return fs})),Promise.resolve().then((function(){return gs})),Promise.resolve().then((function(){return ks})),Promise.resolve().then((function(){return Ts})),Promise.resolve().then((function(){return Zn})),Promise.resolve().then((function(){return Wt})),Promise.resolve().then((function(){return Is})),Promise.resolve().then((function(){return Os})),Promise.resolve().then((function(){return ss})),Promise.resolve().then((function(){return Ms})),Promise.resolve().then((function(){return qs})),Promise.resolve().then((function(){return Fs})),Promise.resolve().then((function(){return Xi})),Promise.resolve().then((function(){return to})),Promise.resolve().then((function(){return fo})),Promise.resolve().then((function(){return ho})),Promise.resolve().then((function(){return yo})),Promise.resolve().then((function(){return xo})),Promise.resolve().then((function(){return Eo})),Promise.resolve().then((function(){return Lo})),Promise.resolve().then((function(){return Io})),Promise.resolve().then((function(){return ta})),Promise.resolve().then((function(){return wi})),Promise.resolve().then((function(){return $a})),Promise.resolve().then((function(){return Oa})),Promise.resolve().then((function(){return da})),Promise.resolve().then((function(){return Ti})),Promise.resolve().then((function(){return Ka})),Promise.resolve().then((function(){return Ja})),Promise.resolve().then((function(){return Ss})),Promise.resolve().then((function(){return Xa})),Promise.resolve().then((function(){return Qa})),Promise.resolve().then((function(){return ac})),Promise.resolve().then((function(){return lc})),Promise.resolve().then((function(){return dc})),Promise.resolve().then((function(){return bc})),Promise.resolve().then((function(){return Cc})),Promise.resolve().then((function(){return Ac})),Promise.resolve().then((function(){return Ic})),Promise.resolve().then((function(){return jc})),Promise.resolve().then((function(){return Fc})),Promise.resolve().then((function(){return Bc})),Promise.resolve().then((function(){return Zc})),Promise.resolve().then((function(){return rl})),Promise.resolve().then((function(){return Wo})),Promise.resolve().then((function(){return ul})),Promise.resolve().then((function(){return ml})),Promise.resolve().then((function(){return $l})),Promise.resolve().then((function(){return xl})),Promise.resolve().then((function(){return Cl})),Promise.resolve().then((function(){return Il})),Promise.resolve().then((function(){return Ol})),Promise.resolve().then((function(){return Ul})),Promise.resolve().then((function(){return Wl})),Promise.resolve().then((function(){return Bl})),Promise.resolve().then((function(){return Vl})),Promise.resolve().then((function(){return Jl})),Promise.resolve().then((function(){return eu})),Promise.resolve().then((function(){return su})),Promise.resolve().then((function(){return au})),Promise.resolve().then((function(){return pu})),Promise.resolve().then((function(){return mu})),Promise.resolve().then((function(){return yu})),Promise.resolve().then((function(){return _u})),Promise.resolve().then((function(){return Ru})),Promise.resolve().then((function(){return Tu})),Promise.resolve().then((function(){return Du})),Promise.resolve().then((function(){return zu}))];Promise.all(mr).then((e=>hr(e))).catch((e=>console.error(e)));var gr=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 br="w3c/group";async function yr(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,patentURI:r,patentPolicy:i,type:o,wgURI:a}=e;return{wg:n,wgId:t,wgURI:a,wgPatentURI:r,wgPatentPolicy:i,groupType:o}}const i=await s.text();let o,a=`Failed to fetch group details (HTTP: ${s.status}).`;409===s.status?[a,o]=i.split("\n",2):404===s.status&&(o=Pn`See the list of [supported group names](https://respec.org/w3c/groups/) to use with the ${"[group]"} configuration option.`),Sn(a,br,{hint:o})}var wr=Object.freeze({__proto__:null,name:br,run:async function(e){if(!e.group)return;const{group:t}=e,n=Array.isArray(t)?await async function(e){const t=await Promise.all(e.map(yr)),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}(t):await yr(t);Object.assign(e,n)}});function vr(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return Rn(t,"core/templates/show-link"),void console.warn(t,e)}return Nt` + </div>`;const i=new Map([["labelledby",s]]);Jn(tr,i),document.body.append(nr,tr),nr.addEventListener("click",(()=>this.closeModal(n))),nr.classList.toggle("respec-show-overlay"),tr.hidden=!1,cr(tr)}};function pr(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`\n${Gn(`<p class="respec-hint"><strong>How to fix:</strong> ${qt(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`<p class="respec-occurrences">Occurred <strong>${e.elements.length}</strong> times at:</p>\n ${Gn(e.elements.map(fr).join("\n"))}`:"",s=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";return`${Gn(`**${e.message}**`,{inline:!0})}${n}${r}${s}${t}`}function fr(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function hr(e){try{dr.show(),await async function(){"loading"===document.readyState&&await new Promise((e=>document.addEventListener("DOMContentLoaded",e)))}(),await Un(e)}finally{dr.enable()}}document.addEventListener("keydown",(e=>{"Escape"===e.key&&dr.closeModal()})),window.respecUI=dr,s("error",(e=>dr.error(e))),s("warn",(e=>dr.warning(e))),window.addEventListener("error",(e=>{console.error(e.error,e.message,e)}));const mr=[Promise.resolve().then((function(){return gr})),Promise.resolve().then((function(){return l})),Promise.resolve().then((function(){return wr})),Promise.resolve().then((function(){return us})),Promise.resolve().then((function(){return fs})),Promise.resolve().then((function(){return gs})),Promise.resolve().then((function(){return ks})),Promise.resolve().then((function(){return Ts})),Promise.resolve().then((function(){return Zn})),Promise.resolve().then((function(){return Wt})),Promise.resolve().then((function(){return Is})),Promise.resolve().then((function(){return Os})),Promise.resolve().then((function(){return ss})),Promise.resolve().then((function(){return zs})),Promise.resolve().then((function(){return Us})),Promise.resolve().then((function(){return Fs})),Promise.resolve().then((function(){return Xi})),Promise.resolve().then((function(){return to})),Promise.resolve().then((function(){return fo})),Promise.resolve().then((function(){return ho})),Promise.resolve().then((function(){return yo})),Promise.resolve().then((function(){return xo})),Promise.resolve().then((function(){return Eo})),Promise.resolve().then((function(){return Lo})),Promise.resolve().then((function(){return Io})),Promise.resolve().then((function(){return ta})),Promise.resolve().then((function(){return wi})),Promise.resolve().then((function(){return $a})),Promise.resolve().then((function(){return Oa})),Promise.resolve().then((function(){return da})),Promise.resolve().then((function(){return Ti})),Promise.resolve().then((function(){return Ka})),Promise.resolve().then((function(){return Ja})),Promise.resolve().then((function(){return Ss})),Promise.resolve().then((function(){return Xa})),Promise.resolve().then((function(){return Qa})),Promise.resolve().then((function(){return ac})),Promise.resolve().then((function(){return lc})),Promise.resolve().then((function(){return dc})),Promise.resolve().then((function(){return bc})),Promise.resolve().then((function(){return Cc})),Promise.resolve().then((function(){return Ac})),Promise.resolve().then((function(){return Ic})),Promise.resolve().then((function(){return jc})),Promise.resolve().then((function(){return Fc})),Promise.resolve().then((function(){return Bc})),Promise.resolve().then((function(){return Zc})),Promise.resolve().then((function(){return rl})),Promise.resolve().then((function(){return Wo})),Promise.resolve().then((function(){return ul})),Promise.resolve().then((function(){return ml})),Promise.resolve().then((function(){return $l})),Promise.resolve().then((function(){return xl})),Promise.resolve().then((function(){return Cl})),Promise.resolve().then((function(){return Il})),Promise.resolve().then((function(){return Ol})),Promise.resolve().then((function(){return ql})),Promise.resolve().then((function(){return Wl})),Promise.resolve().then((function(){return Bl})),Promise.resolve().then((function(){return Vl})),Promise.resolve().then((function(){return Jl})),Promise.resolve().then((function(){return eu})),Promise.resolve().then((function(){return su})),Promise.resolve().then((function(){return au})),Promise.resolve().then((function(){return pu})),Promise.resolve().then((function(){return mu})),Promise.resolve().then((function(){return yu})),Promise.resolve().then((function(){return _u})),Promise.resolve().then((function(){return Ru})),Promise.resolve().then((function(){return Tu})),Promise.resolve().then((function(){return Du})),Promise.resolve().then((function(){return Mu}))];Promise.all(mr).then((e=>hr(e))).catch((e=>console.error(e)));var gr=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 br="w3c/group";async function yr(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,patentURI:r,patentPolicy:i,type:o,wgURI:a}=e;return{wg:n,wgId:t,wgURI:a,wgPatentURI:r,wgPatentPolicy:i,groupType:o}}const i=await s.text();let o,a=`Failed to fetch group details (HTTP: ${s.status}).`;409===s.status?[a,o]=i.split("\n",2):404===s.status&&(o=Pn`See the list of [supported group names](https://respec.org/w3c/groups/) to use with the ${"[group]"} configuration option.`),Sn(a,br,{hint:o})}var wr=Object.freeze({__proto__:null,name:br,run:async function(e){if(!e.group)return;const{group:t}=e,n=Array.isArray(t)?await async function(e){const t=await Promise.all(e.map(yr)),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}(t):await yr(t);Object.assign(e,n)}});function vr(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return Rn(t,"core/templates/show-link"),void console.warn(t,e)}return Nt` <dt class="${e.class?e.class:null}">${e.key}</dt> ${e.data?e.data.map($r):$r(e)} `}function $r(e){return Nt`<dd class="${e.class?e.class:null}"> @@ -628,7 +628,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} <a href="${r}">${r}</a> for the Editor's draft. `:""} </p> - </details>`}var zr=(e,t)=>Nt` + </details>`}var Mr=(e,t)=>Nt` <h2>${Ir.sotd}</h2> ${e.isPreview?jr(e):""} <p> @@ -682,17 +682,17 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em} </p>`}(e,t):""} ${e.sotdAfterWGinfo?t.additionalContent:""} ${t.additionalSections} - `;const Mr="w3c/headers";function qr(e){return new URL(e,"https://www.w3.org/").href}const Ur={LS:"WD",LD:"WD",FPWD:"WD"},Wr={DNOTE:"Group Draft Note",NOTE:"Group Note",STMT:"Statement","Member-SUBM":"Member Submission",MO:"Member-Only Document",ED:"Editor's Draft",LS:"Living Standard",LD:"Living Document",FPWD:"First Public Working Draft",WD:"Working Draft",CR:"Candidate Recommendation",CRD:"Candidate Recommendation",PR:"Proposed Recommendation",PER:"Proposed Edited Recommendation",REC:"Recommendation",DISC:"Discontinued Draft",RSCND:"Rescinded Recommendation",DRY:"Draft Registry",CRYD:"Candidate Registry",CRY:"Candidate Registry",RY:"Registry",unofficial:"Unofficial Draft",UD:"Unofficial Draft",base:"",finding:"TAG Finding","draft-finding":"Draft TAG Finding","editor-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"},Fr={...Wr,CR:"Candidate Recommendation Snapshot",CRD:"Candidate Recommendation Draft",CRY:"Candidate Registry Snapshot",CRYD:"Candidate Registry Draft"},Br={DNOTE:"Note",NOTE:"Note",STMT:"Note","WG-NOTE":"Note","IG-NOTE":"Note",FPWD:"Recommendation",WD:"Recommendation",CR:"Recommendation",CRD:"Recommendation",PR:"Recommendation",REC:"Recommendation",DISC:"Recommendation",RSCND:"Recommendation",DRY:"Registry",CRYD:"Registry",CRY:"Registry",RY:"Registry"},Hr=["DNOTE","NOTE","STMT"],Gr=["CR","CRD","DISC","FPWD","PER","PR","REC","RSCND","WD"],Vr=["DRY","CRY","CRYD","RY"],Yr=["draft-finding","finding","editor-draft-finding"],Kr=["CG-DRAFT","CG-FINAL"],Zr=["BG-DRAFT","BG-FINAL"],Jr=[...Kr,...Zr],Xr=[...Hr,...Gr,...Vr],Qr=["base",...Kr,...Zr,"editor-draft-finding","draft-finding","finding","MO","unofficial"],es=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:"permissive document license",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"}],["document",{name:"W3C Document License",short:"document use",url:"https://www.w3.org/Consortium/Legal/copyright-documents"}],["dual",{name:"W3C Dual License",short:"dual license",url:"https://www.w3.org/Consortium/Legal/2013/copyright-documents-dual.html"}],[void 0,{name:"unlicensed",url:null,short:"UNLICENSED"}]]),ts=["PP2017","PP2020"];function ns(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=Bt.format(r);return new Date(e)}return Sn(Pn`${t} is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,Mr),new Date(Bt.format(new Date))}function rs(e,{isTagFinding:t=!1}){const n=e.cloneNode(!0),r=document.createDocumentFragment();for(;n.hasChildNodes()&&(n.nodeType!==Node.ELEMENT_NODE||"section"!==n.firstChild.localName);)r.appendChild(n.firstChild);if(t&&!r.hasChildNodes()){Rn(Pn`ReSpec does not support automated SotD generation for TAG findings.`,Mr,{hint:"Please add the prerequisite content in the 'sotd' section."})}return{additionalContent:r,additionalSections:n.childNodes}}var ss=Object.freeze({__proto__:null,W3CNotes:Hr,bgStatus:Zr,cgStatus:Kr,cgbgStatus:Jr,licenses:es,name:Mr,noTrackStatus:Qr,recTrackStatus:Gr,registryTrackStatus:Vr,run:async function(e){if(e.isBasic="base"===e.specStatus,e.isCGBG=Jr.includes(e.specStatus),e.isCGFinal=e.isCGBG&&e.specStatus.endsWith("G-FINAL"),e.isCR="CR"===e.specStatus||"CRD"===e.specStatus,e.isCRDraft="CRD"===e.specStatus,e.isCRY="CRY"===e.specStatus||"CRYD"===e.specStatus,e.isEd="ED"===e.specStatus,e.isMemberSubmission="Member-SUBM"===e.specStatus,e.isMO="MO"===e.specStatus,e.isNote=Hr.includes(e.specStatus),e.isNoTrack=Qr.includes(e.specStatus),e.isPER="PER"===e.specStatus,e.isPR="PR"===e.specStatus,e.isRecTrack=Gr.includes(e.specStatus),e.isRec=e.isRecTrack&&"REC"===e.specStatus,e.isRegistry=Vr.includes(e.specStatus),e.isRegular=!e.isCGBG&&!e.isBasic,e.isTagEditorFinding="editor-draft-finding"===e.specStatus,e.isTagFinding=Yr.includes(e.specStatus),e.isUnofficial="unofficial"===e.specStatus,e.licenseInfo=function(e){let t;if("string"==typeof e.license){const n=e.license.toLowerCase();if(es.has(n))t=n;else{const t=`The license "\`${e.license}\`" is not supported.`,n=Pn`Please set - ${"[license]"} to one of: ${An([...es.keys()].filter((e=>e)),{quotes:!0})}. If in doubt, remove \`license\` and let ReSpec pick one for you.`;Sn(t,Mr,{hint:n})}}if(e.isUnofficial&&!t&&(t="cc-by"),!e.isUnofficial&&["cc-by","cc0"].includes(t)){const t=Pn`Please set ${"[license]"} to \`"w3c-software-doc"\` instead.`;Sn(Pn`License "\`${e.license}\`" is not allowed for W3C Specifications.`,Mr,{hint:t})}return es.get(t)}(e),e.prependW3C=!e.isBasic&&!e.isUnofficial,e.longStatus=Fr[e.specStatus],e.textStatus=Wr[e.specStatus],e.showPreviousVersion=!1,e.isRegular&&!e.shortName){const e=Pn`Please set ${"[shortName]"} to a short name for the specification.`;Sn(Pn`The ${"[shortName]"} configuration option is required for this kind of document.`,Mr,{hint:e})}if(e.publishDate=ns(e,"publishDate",document.lastModified),e.publishYear=e.publishDate.getUTCFullYear(),e.modificationDate&&(e.modificationDate=ns(e,"modificationDate",document.lastModified)),e.isRecTrack&&!e.github&&!e.wgPublicList){const e=Pn`Use the ${"[github]"} configuration option to add a link to a repository. Alternatively use ${"[wgPublicList]"} to link to a mailing list.`;Sn("W3C Process requires a either a link to a public repository or mailing list.",Mr,{hint:e})}if(e.isEd&&!e.edDraftURI){const e=Pn`Please set ${"[edDraftURI]"} to the URL of the Editor's Draft. Alternatively, use the set ${"[github]"} option, which automatically sets it for you.`;Rn(Pn`Editor's Drafts should set ${"[edDraftURI]"} configuration option.`,Mr,{hint:e})}const t=function(e){const{specStatus:t,group:n}=e;if(Xr.includes(t)||"wg"===e.groupType)return"/TR";switch(t){case"CG-FINAL":case"BG-FINAL":return`/community/reports/${n}`;case"finding":case"draft-finding":return"/2001/tag/doc";case"Member-SUBM":return"/Submission"}return""}(e);if(t&&!e.thisVersion){const n=Ur[e.specStatus]||e.specStatus,{shortName:r,publishDate:s}=e,i=`${n}-${r}-${on(s)}`,o=[...Xr,"Member-SUBM"].includes(e.specStatus)?`${s.getUTCFullYear()}/`:"";e.thisVersion=qr(`${t}/${o}${i}/`)}e.isEd&&(e.thisVersion=e.edDraftURI),e.isCGBG&&function(e){const t=Wr[e.specStatus],n=e.latestVersion?new URL(qr(e.latestVersion)):null;if(!e.wg){return void Sn(Pn`The ${"[group]"} configuration option is required for this kind of document (${t}).`,Mr)}if(e.isCGFinal){if(!1===("https://www.w3.org"===n?.origin||"https://w3.org/"===n?.origin)){Sn(Pn`For ${t}, the ${"[latestVersion]"} URL must point to somewhere at https://www.w3.org/.`,Mr,{hint:"Ask a W3C Team Member for a W3C URL where the report can be published."})}}}(e),null!==e.latestVersion&&(e.latestVersion=e.latestVersion?qr(e.latestVersion):qr(`${t}/${e.shortName}/`)),e.latestVersion&&function(e){const t=new URL(e.latestVersion);if(("https://www.w3.org"===t.origin||"https://w3.org/"===t.origin)&&t.pathname.startsWith("/TR/")&&!1===["ED",...Xr].includes(e.specStatus)){const t=Pn`Ask a W3C Team Member for a W3C URL where the report can be published and change ${"[latestVersion]"} to something else.`;Sn(Pn`Documents with a status of \`"${e.specStatus}"\` can't be published on the W3C's /TR/ (Technical Report) space.`,Mr,{hint:t})}}(e);const n=`${t}/${e.shortName}`;if(e.previousPublishDate){if(!e.previousMaturity&&!e.isTagFinding){Sn(Pn`${"[`previousPublishDate`]"} is set, but missing ${"[`previousMaturity`]"}.`,Mr)}e.previousPublishDate=ns(e,"previousPublishDate");const r=Ur[e.previousMaturity]??e.previousMaturity;if(e.isTagFinding&&e.latestVersion){const t=Bt.format(e.publishDate);e.thisVersion=qr(`${n}-${t}`);const r=Bt.format(e.previousPublishDate);e.prevVersion=qr(`${n}-${r}}`)}else if(e.isCGBG||e.isBasic)e.prevVersion=e.prevVersion||"";else{const n=e.previousPublishDate.getUTCFullYear(),{shortName:s}=e,i=on(e.previousPublishDate);e.prevVersion=qr(`${t}/${n}/${r}-${s}-${i}/`)}}e.prevRecShortname&&!e.prevRecURI&&(e.prevRecURI=qr(`${t}/${e.prevRecShortname}`));for(let t=0;t<e.editors.length;t++){const n=e.editors[t];"retiredDate"in n&&(e.formerEditors.push(n),e.editors.splice(t--,1))}if(0===e.editors.length){const e=Pn`Add one or more editors using the ${"[editors]"} configuration option.`;Sn("At least one editor is required.",Mr,{hint:e})}else e.editors.length&&e.isRecTrack&&e.editors.forEach(((e,t)=>{if(e.w3cid)return;const n=Pn`See ${"[w3cid]"} for instructions for how to retrieve it and add it.`;Sn(Pn`Editor ${e.name?`"${e.name}"`:`number ${t+1}`} is missing their ${"[w3cid]"}.`,Mr,{hint:n})}));if(e.alternateFormats?.some((({uri:e,label:t})=>!e||!t))){Sn(Pn`Every ${"[`alternateFormats`]"} entry must have a \`uri\` and a \`label\`.`,Mr)}if(e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.isRec&&!e.errata&&!e.revisionTypes?.length){const e=Pn`Add an ${"[errata]"} URL to your ${"[respecConfig]"}.`;Sn("Recommendations must have an errata link.",Mr,{hint:e})}e.dashDate=Bt.format(e.publishDate),e.publishISODate=e.publishDate.toISOString(),e.shortISODate=Bt.format(e.publishDate),function(e){if(!e.wgPatentPolicy)return;const t=new Set([].concat(e.wgPatentPolicy));if(t.size&&![...t].every((e=>ts.includes(e)))){const e=Pn`Invalid ${"[wgPatentPolicy]"} value(s): ${Tn([...t].filter((e=>!ts.includes(e))))}.`,n=`Please use one of: ${An(ts)}.`;Sn(e,Mr,{hint:n})}if(1!==t.size){const e="When collaborating across multiple groups, they must use the same patent policy.",n=Pn`For ${"[wgPatentPolicy]"}, please check the patent policies of each group. The patent policies were: ${[...t].join(", ")}.`;Sn(e,Mr,{hint:n})}e.wgPatentPolicy=[...t][0]}(e),await async function(e){if(!e.shortName||null===e.historyURI||!e.latestVersion)return;const t=e.isEd||Xr.includes(e.specStatus);if(e.historyURI&&!t){const t=Pn`Please remove ${"[historyURI]"}.`;return Sn(Pn`The ${"[historyURI]"} can't be used with non /TR/ documents.`,Mr,{hint:t}),void(e.historyURI=null)}const n=new URL(e.historyURI??e.shortName,"https://www.w3.org/standards/history/");if(e.historyURI&&t||["FPWD","DNOTE","NOTE","DRY"].includes(e.specStatus))return void(e.historyURI=n.href);try{const t=await fetch(n,{method:"HEAD"});t.ok&&(e.historyURI=t.url)}catch{}}(e),e.isTagEditorFinding&&(delete e.thisVersion,delete e.latestVersion),e.isTagFinding&&(e.showPreviousVersion=!!e.previousPublishDate);const s={get multipleAlternates(){return e.alternateFormats&&e.alternateFormats.length>1},get alternatesHTML(){return e.alternateFormats&&un(e.alternateFormats.map((({label:e})=>e)),((t,n)=>{const r=e.alternateFormats[n];return Nt`<a + `;const zr="w3c/headers";function Ur(e){return new URL(e,"https://www.w3.org/").href}const qr={LS:"WD",LD:"WD",FPWD:"WD","Member-SUBM":"SUBM"},Wr={DNOTE:"Group Draft Note",NOTE:"Group Note",STMT:"Statement","Member-SUBM":"Member Submission",MO:"Member-Only Document",ED:"Editor's Draft",LS:"Living Standard",LD:"Living Document",FPWD:"First Public Working Draft",WD:"Working Draft",CR:"Candidate Recommendation",CRD:"Candidate Recommendation",PR:"Proposed Recommendation",PER:"Proposed Edited Recommendation",REC:"Recommendation",DISC:"Discontinued Draft",RSCND:"Rescinded Recommendation",DRY:"Draft Registry",CRYD:"Candidate Registry",CRY:"Candidate Registry",RY:"Registry",unofficial:"Unofficial Draft",UD:"Unofficial Draft",base:"",finding:"TAG Finding","draft-finding":"Draft TAG Finding","editor-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"},Fr={...Wr,CR:"Candidate Recommendation Snapshot",CRD:"Candidate Recommendation Draft",CRY:"Candidate Registry Snapshot",CRYD:"Candidate Registry Draft"},Br={DNOTE:"Note",NOTE:"Note",STMT:"Note","WG-NOTE":"Note","IG-NOTE":"Note",FPWD:"Recommendation",WD:"Recommendation",CR:"Recommendation",CRD:"Recommendation",PR:"Recommendation",REC:"Recommendation",DISC:"Recommendation",RSCND:"Recommendation",DRY:"Registry",CRYD:"Registry",CRY:"Registry",RY:"Registry"},Hr=["DNOTE","NOTE","STMT"],Gr=["CR","CRD","DISC","FPWD","PER","PR","REC","RSCND","WD"],Vr=["DRY","CRY","CRYD","RY"],Yr=["draft-finding","finding","editor-draft-finding"],Kr=["CG-DRAFT","CG-FINAL"],Zr=["BG-DRAFT","BG-FINAL"],Jr=[...Kr,...Zr],Xr=[...Hr,...Gr,...Vr],Qr=["base",...Kr,...Zr,"editor-draft-finding","draft-finding","finding","MO","unofficial"],es=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:"permissive document license",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"}],["document",{name:"W3C Document License",short:"document use",url:"https://www.w3.org/Consortium/Legal/copyright-documents"}],["dual",{name:"W3C Dual License",short:"dual license",url:"https://www.w3.org/Consortium/Legal/2013/copyright-documents-dual.html"}],[void 0,{name:"unlicensed",url:null,short:"UNLICENSED"}]]),ts=["PP2017","PP2020"];function ns(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=Bt.format(r);return new Date(e)}return Sn(Pn`${t} is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,zr),new Date(Bt.format(new Date))}function rs(e,{isTagFinding:t=!1}){const n=e.cloneNode(!0),r=document.createDocumentFragment();for(;n.hasChildNodes()&&(n.nodeType!==Node.ELEMENT_NODE||"section"!==n.firstChild.localName);)r.appendChild(n.firstChild);if(t&&!r.hasChildNodes()){Rn(Pn`ReSpec does not support automated SotD generation for TAG findings.`,zr,{hint:"Please add the prerequisite content in the 'sotd' section."})}return{additionalContent:r,additionalSections:n.childNodes}}var ss=Object.freeze({__proto__:null,W3CNotes:Hr,bgStatus:Zr,cgStatus:Kr,cgbgStatus:Jr,licenses:es,name:zr,noTrackStatus:Qr,recTrackStatus:Gr,registryTrackStatus:Vr,run:async function(e){if(e.isBasic="base"===e.specStatus,e.isCGBG=Jr.includes(e.specStatus),e.isCGFinal=e.isCGBG&&e.specStatus.endsWith("G-FINAL"),e.isCR="CR"===e.specStatus||"CRD"===e.specStatus,e.isCRDraft="CRD"===e.specStatus,e.isCRY="CRY"===e.specStatus||"CRYD"===e.specStatus,e.isEd="ED"===e.specStatus,e.isMemberSubmission="Member-SUBM"===e.specStatus,e.isMO="MO"===e.specStatus,e.isNote=Hr.includes(e.specStatus),e.isNoTrack=Qr.includes(e.specStatus),e.isPER="PER"===e.specStatus,e.isPR="PR"===e.specStatus,e.isRecTrack=Gr.includes(e.specStatus),e.isRec=e.isRecTrack&&"REC"===e.specStatus,e.isRegistry=Vr.includes(e.specStatus),e.isRegular=!e.isCGBG&&!e.isBasic,e.isTagEditorFinding="editor-draft-finding"===e.specStatus,e.isTagFinding=Yr.includes(e.specStatus),e.isUnofficial="unofficial"===e.specStatus,e.licenseInfo=function(e){let t;if("string"==typeof e.license){const n=e.license.toLowerCase();if(es.has(n))t=n;else{const t=`The license "\`${e.license}\`" is not supported.`,n=Pn`Please set + ${"[license]"} to one of: ${An([...es.keys()].filter((e=>e)),{quotes:!0})}. If in doubt, remove \`license\` and let ReSpec pick one for you.`;Sn(t,zr,{hint:n})}}if(e.isUnofficial&&!t&&(t="cc-by"),!e.isUnofficial&&["cc-by","cc0"].includes(t)){const t=Pn`Please set ${"[license]"} to \`"w3c-software-doc"\` instead.`;Sn(Pn`License "\`${e.license}\`" is not allowed for W3C Specifications.`,zr,{hint:t})}return es.get(t)}(e),e.prependW3C=!e.isBasic&&!e.isUnofficial,e.longStatus=Fr[e.specStatus],e.textStatus=Wr[e.specStatus],e.showPreviousVersion=!1,e.isRegular&&!e.shortName){const e=Pn`Please set ${"[shortName]"} to a short name for the specification.`;Sn(Pn`The ${"[shortName]"} configuration option is required for this kind of document.`,zr,{hint:e})}if(e.publishDate=ns(e,"publishDate",document.lastModified),e.publishYear=e.publishDate.getUTCFullYear(),e.modificationDate&&(e.modificationDate=ns(e,"modificationDate",document.lastModified)),e.isRecTrack&&!e.github&&!e.wgPublicList){const e=Pn`Use the ${"[github]"} configuration option to add a link to a repository. Alternatively use ${"[wgPublicList]"} to link to a mailing list.`;Sn("W3C Process requires a either a link to a public repository or mailing list.",zr,{hint:e})}if(e.isEd&&!e.edDraftURI){const e=Pn`Please set ${"[edDraftURI]"} to the URL of the Editor's Draft. Alternatively, use the set ${"[github]"} option, which automatically sets it for you.`;Rn(Pn`Editor's Drafts should set ${"[edDraftURI]"} configuration option.`,zr,{hint:e})}const t=function(e){const{specStatus:t,group:n}=e;if(Xr.includes(t)||"wg"===e.groupType)return"/TR";switch(t){case"CG-FINAL":case"BG-FINAL":return`/community/reports/${n}`;case"finding":case"draft-finding":return"/2001/tag/doc";case"Member-SUBM":return"/Submission"}return""}(e);if(t&&!e.thisVersion){const n=qr[e.specStatus]||e.specStatus,{shortName:r,publishDate:s}=e,i=`${n}-${r}-${on(s)}`,o=[...Xr,"Member-SUBM"].includes(e.specStatus)?`${s.getUTCFullYear()}/`:"";e.thisVersion=Ur(`${t}/${o}${i}/`)}e.isEd&&(e.thisVersion=e.edDraftURI),e.isCGBG&&function(e){const t=Wr[e.specStatus],n=e.latestVersion?new URL(Ur(e.latestVersion)):null;if(!e.wg){return void Sn(Pn`The ${"[group]"} configuration option is required for this kind of document (${t}).`,zr)}if(e.isCGFinal){if(!1===("https://www.w3.org"===n?.origin||"https://w3.org/"===n?.origin)){Sn(Pn`For ${t}, the ${"[latestVersion]"} URL must point to somewhere at https://www.w3.org/.`,zr,{hint:"Ask a W3C Team Member for a W3C URL where the report can be published."})}}}(e),null!==e.latestVersion&&(e.latestVersion=e.latestVersion?Ur(e.latestVersion):Ur(`${t}/${e.shortName}/`)),e.latestVersion&&function(e){const t=new URL(e.latestVersion);if(("https://www.w3.org"===t.origin||"https://w3.org/"===t.origin)&&t.pathname.startsWith("/TR/")&&!1===["ED",...Xr].includes(e.specStatus)){const t=Pn`Ask a W3C Team Member for a W3C URL where the report can be published and change ${"[latestVersion]"} to something else.`;Sn(Pn`Documents with a status of \`"${e.specStatus}"\` can't be published on the W3C's /TR/ (Technical Report) space.`,zr,{hint:t})}}(e);const n=`${t}/${e.shortName}`;if(e.previousPublishDate){if(!e.previousMaturity&&!e.isTagFinding){Sn(Pn`${"[`previousPublishDate`]"} is set, but missing ${"[`previousMaturity`]"}.`,zr)}e.previousPublishDate=ns(e,"previousPublishDate");const r=qr[e.previousMaturity]??e.previousMaturity;if(e.isTagFinding&&e.latestVersion){const t=Bt.format(e.publishDate);e.thisVersion=Ur(`${n}-${t}`);const r=Bt.format(e.previousPublishDate);e.prevVersion=Ur(`${n}-${r}}`)}else if(e.isCGBG||e.isBasic)e.prevVersion=e.prevVersion||"";else{const n=e.previousPublishDate.getUTCFullYear(),{shortName:s}=e,i=on(e.previousPublishDate);e.prevVersion=Ur(`${t}/${n}/${r}-${s}-${i}/`)}}e.prevRecShortname&&!e.prevRecURI&&(e.prevRecURI=Ur(`${t}/${e.prevRecShortname}`));for(let t=0;t<e.editors.length;t++){const n=e.editors[t];"retiredDate"in n&&(e.formerEditors.push(n),e.editors.splice(t--,1))}if(0===e.editors.length){const e=Pn`Add one or more editors using the ${"[editors]"} configuration option.`;Sn("At least one editor is required.",zr,{hint:e})}else e.editors.length&&e.isRecTrack&&e.editors.forEach(((e,t)=>{if(e.w3cid)return;const n=Pn`See ${"[w3cid]"} for instructions for how to retrieve it and add it.`;Sn(Pn`Editor ${e.name?`"${e.name}"`:`number ${t+1}`} is missing their ${"[w3cid]"}.`,zr,{hint:n})}));if(e.alternateFormats?.some((({uri:e,label:t})=>!e||!t))){Sn(Pn`Every ${"[`alternateFormats`]"} entry must have a \`uri\` and a \`label\`.`,zr)}if(e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.isRec&&!e.errata&&!e.revisionTypes?.length){const e=Pn`Add an ${"[errata]"} URL to your ${"[respecConfig]"}.`;Sn("Recommendations must have an errata link.",zr,{hint:e})}e.dashDate=Bt.format(e.publishDate),e.publishISODate=e.publishDate.toISOString(),e.shortISODate=Bt.format(e.publishDate),function(e){if(!e.wgPatentPolicy)return;const t=new Set([].concat(e.wgPatentPolicy));if(t.size&&![...t].every((e=>ts.includes(e)))){const e=Pn`Invalid ${"[wgPatentPolicy]"} value(s): ${Tn([...t].filter((e=>!ts.includes(e))))}.`,n=`Please use one of: ${An(ts)}.`;Sn(e,zr,{hint:n})}if(1!==t.size){const e="When collaborating across multiple groups, they must use the same patent policy.",n=Pn`For ${"[wgPatentPolicy]"}, please check the patent policies of each group. The patent policies were: ${[...t].join(", ")}.`;Sn(e,zr,{hint:n})}e.wgPatentPolicy=[...t][0]}(e),await async function(e){if(!e.shortName||null===e.historyURI||!e.latestVersion)return;const t=e.isEd||Xr.includes(e.specStatus);if(e.historyURI&&!t){const t=Pn`Please remove ${"[historyURI]"}.`;return Sn(Pn`The ${"[historyURI]"} can't be used with non /TR/ documents.`,zr,{hint:t}),void(e.historyURI=null)}const n=new URL(e.historyURI??e.shortName,"https://www.w3.org/standards/history/");if(e.historyURI&&t||["FPWD","DNOTE","NOTE","DRY"].includes(e.specStatus))return void(e.historyURI=n.href);try{const t=await fetch(n,{method:"HEAD"});t.ok&&(e.historyURI=t.url)}catch{}}(e),e.isTagEditorFinding&&(delete e.thisVersion,delete e.latestVersion),e.isTagFinding&&(e.showPreviousVersion=!!e.previousPublishDate);const s={get multipleAlternates(){return e.alternateFormats&&e.alternateFormats.length>1},get alternatesHTML(){return e.alternateFormats&&un(e.alternateFormats.map((({label:e})=>e)),((t,n)=>{const r=e.alternateFormats[n];return Nt`<a rel="alternate" href="${r.uri}" hreflang="${r?.lang??null}" type="${r?.type??null}" >${r.label}</a - >`}))}},i=(e.isCGBG?Pr:Tr)(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){Sn("A Status of This Document must include at least on custom paragraph.",Mr,{elements:[o],hint:"Add a `<p>` 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=Pn`Use the ${"[group]"} option with an array instead.`;Sn(Pn`If one of ${"[wg]"}, ${"[wgURI]"}, or ${"[wgPatentURI]"} is an array, they all have to be.`,Mr,{hint:e})}if(Array.isArray(e.wg)?(e.multipleWGs=e.wg.length>1,e.wgHTML=un(e.wg,((t,n)=>Nt`the <a href="${e.wgURI[n]}">${t}</a>`)),e.wgPatentHTML=un(e.wg,((t,n)=>Nt`a + >`}))}},i=(e.isCGBG?Pr:Tr)(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){Sn("A Status of This Document must include at least on custom paragraph.",zr,{elements:[o],hint:"Add a `<p>` 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=Pn`Use the ${"[group]"} option with an array instead.`;Sn(Pn`If one of ${"[wg]"}, ${"[wgURI]"}, or ${"[wgPatentURI]"} is an array, they all have to be.`,zr,{hint:e})}if(Array.isArray(e.wg)?(e.multipleWGs=e.wg.length>1,e.wgHTML=un(e.wg,((t,n)=>Nt`the <a href="${e.wgURI[n]}">${t}</a>`)),e.wgPatentHTML=un(e.wg,((t,n)=>Nt`a <a href="${e.wgPatentURI[n]}" rel="disclosure" >public list of any patent disclosures (${t})</a - >`))):(e.multipleWGs=!1,e.wg&&(e.wgHTML=Nt`the <a href="${e.wgURI}">${e.wg}</a>`)),e.isPR&&!e.crEnd){Sn(Pn`${"[specStatus]"} is "PR" but no ${"[crEnd]"} is specified in the ${"[respecConfig]"} (needed to indicate end of previous CR).`,Mr)}if(e.isCR&&!e.crEnd){Sn(Pn`${"[specStatus]"} is "CR", but no ${"[crEnd]"} is specified in the ${"[respecConfig]"}.`,Mr)}if(e.crEnd=ns(e,"crEnd"),e.isPr&&!e.prEnd){Sn(Pn`${"[specStatus]"} is "PR" but no ${"[prEnd]"} is specified in the ${"[respecConfig]"}.`,Mr)}if(e.prEnd=ns(e,"prEnd"),e.isPER&&!e.perEnd){Sn(Pn`${"[specStatus]"} is "PER", but no ${"[perEnd]"} is specified.`,Mr)}if(e.perEnd=ns(e,"perEnd"),e.hasOwnProperty("updateableRec")){const t=Pn`Add an ${"[`updateable-rec`|#updateable-rec-class]"} CSS class to the Status of This Document section instead.`;Rn("Configuration option `updateableRec` is deprecated.",Mr,{hint:t}),e.updateableRec&&o.classList.add("updateable-rec")}e.updateableRec=o.classList.contains("updateable-rec");const c=["addition","correction","proposed-addition","proposed-correction"];if(e.isRec&&e.revisionTypes?.length>0){if(e.revisionTypes.some((e=>!c.includes(e)))){const t=Pn`${"[specStatus]"} is "REC" with unknown ${"[revisionTypes]"}: '${An(e.revisionTypes.filter((e=>!c.includes(e))))}'.`,n=Pn`The valid values for ${"[revisionTypes]"} are: ${An(c)}.`;Sn(t,Mr,{hint:n})}if((e.revisionTypes.includes("proposed-addition")||e.revisionTypes.includes("addition"))&&!e.updateableRec){Sn(Pn`${"[specStatus]"} is "REC" with proposed additions but the Recommendation is not marked as allowing new features.`,Mr)}}if("REC"===e.specStatus&&e.updateableRec&&e.revisionTypes&&e.revisionTypes.length>0&&["proposed-addition","proposed-correction"].some((t=>e.revisionTypes.includes(t)))&&!e.revisedRecEnd){Sn(Pn`${"[specStatus]"} is "REC" with proposed corrections or additions but no ${"[revisedRecEnd]"} is specified in the ${"[respecConfig]"}.`,Mr)}if(e.revisedRecEnd=ns(e,"revisedRecEnd"),e.noRecTrack&&Gr.includes(e.specStatus)){const t=Pn`Document configured as ${"[noRecTrack]"}, but its status ("${e.specStatus}") puts it on the W3C Rec Track.`,n=An(Gr,{quotes:!0});Sn(t,Mr,{hint:`Status **can't** be any of: ${n}.`})}if(o.classList.contains("override")||Nt.bind(o)`${function(e,t){const n={...rs(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?zr:Or)(e,n)}(e,o)}`,!e.implementationReportURI&&e.isCR){const e=Pn`CR documents must have an ${"[implementationReportURI]"} that describes the [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).`;Sn(Pn`Missing ${"[implementationReportURI]"} configuration option in ${"[respecConfig]"}.`,Mr,{hint:e})}if(!e.implementationReportURI&&e.isPR){Rn(Pn`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).`,Mr)}r("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:nn(document.getElementById("w3c-state")?.textContent??"")})},status2text:Wr,status2track:Br,tagStatus:Yr,trStatus:Xr});const is={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},os="w3c/defaults",as={src:"https://www.w3.org/StyleSheets/TR/2021/logos/W3C",alt:"W3C",height:48,width:72,url:"https://www.w3.org/"},cs={alt:"W3C Member Submission",href:"https://www.w3.org/Submission/",src:"https://www.w3.org/Icons/member_subm-v.svg",width:"211",height:"48"},ls={lint:{"privsec-section":!1,"required-sections":!0,"wpt-tests-exist":!1,"informative-dfn":"warn","no-unused-dfns":"warn",a11y:!1},doJsonLd:!1,logos:[],xref:!0,wgId:"",otherLinks:[],excludeGithubLinks:!0,subtitle:"",prevVersion:"",formerEditors:[],editors:[],authors:[]};var us=Object.freeze({__proto__:null,name:os,run:function(e){const t=!1!==e.lint&&{...is.lint,...ls.lint,...e.lint};Object.assign(e,{...is,...ls,...e,lint:t}),"unofficial"===e.specStatus||e.hasOwnProperty("license")||(e.license="w3c-software-doc"),function(e){const{specStatus:t,groupType:n,group:r}=e;if(!t){const t=Pn`Select an appropriate status from ${"[specStatus]"} based on your W3C group. If in doubt, use \`"unofficial"\`.`;return Sn(Pn`The ${"[specStatus]"} configuration option is required.`,os,{hint:t}),void(e.specStatus="base")}if(void 0===Wr[t]){const n=Pn`The ${"[specStatus]"} "\`${t}\`" is not supported at for this type of document.`,r=Pn`set ${"[specStatus]"} to one of: ${An(Object.keys(Wr),{quotes:!0})}.`;return Sn(n,os,{hint:r}),void(e.specStatus="base")}switch(n){case"cg":if(![...Kr,"unofficial","UD"].includes(t)){const n=Pn`W3C Community Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=An(Kr,{quotes:!0});Sn(n,os,{hint:`Please use one of: ${r}. Automatically falling back to \`"CG-DRAFT"\`.`}),e.specStatus="CG-DRAFT"}break;case"bg":if(![...Zr,"unofficial","UD"].includes(t)){const n=Pn`W3C Business Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=An(Zr,{quotes:!0});Sn(n,os,{hint:`Please use one of: ${r}. Automatically falling back to \`"BG-DRAFT"\`.`}),e.specStatus="BG-DRAFT"}break;case"wg":if(![...Xr,"unofficial","UD","ED"].includes(t)){const e=Pn`Pleas see ${"[specStatus]"} for appropriate status for W3C Working Group documents.`;Sn(Pn`W3C Working Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,os,{hint:e})}break;case"other":if("tag"===r&&!["ED",...Xr,...Yr].includes(t)){const n=Pn`The W3C Technical Architecture Group's documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=An(["ED",...Xr,...Yr],{quotes:!0});Sn(n,os,{hint:`Please use one of: ${r}. Automatically falling back to \`"unofficial"\`.`}),e.specStatus="unofficial"}break;default:if(!e.wgId&&!["unofficial","base","UD","Member-SUBM"].includes(e.specStatus)){const t="Document is not associated with a [W3C group](https://respec.org/w3c/groups/). Defaulting to 'base' status.",n=Pn`Use the ${"[group]"} configuration option to associated this document with a W3C group.`;e.specStatus="base",Sn(t,os,{hint:n})}}}(e),function(e){const{specStatus:t,wg:n}=e,r=[...Gr,...Vr,...Hr,...Yr,"ED"].includes(t),s=n&&n.length&&r,i=["Member-SUBM"].includes(t);(s||i)&&(e.logos.unshift(as),"Member-SUBM"===t&&e.logos.push(cs))}(e)}});var ds=String.raw`@keyframes pop{ + >`))):(e.multipleWGs=!1,e.wg&&(e.wgHTML=Nt`the <a href="${e.wgURI}">${e.wg}</a>`)),e.isPR&&!e.crEnd){Sn(Pn`${"[specStatus]"} is "PR" but no ${"[crEnd]"} is specified in the ${"[respecConfig]"} (needed to indicate end of previous CR).`,zr)}if(e.isCR&&!e.crEnd){Sn(Pn`${"[specStatus]"} is "CR", but no ${"[crEnd]"} is specified in the ${"[respecConfig]"}.`,zr)}if(e.crEnd=ns(e,"crEnd"),e.isPr&&!e.prEnd){Sn(Pn`${"[specStatus]"} is "PR" but no ${"[prEnd]"} is specified in the ${"[respecConfig]"}.`,zr)}if(e.prEnd=ns(e,"prEnd"),e.isPER&&!e.perEnd){Sn(Pn`${"[specStatus]"} is "PER", but no ${"[perEnd]"} is specified.`,zr)}if(e.perEnd=ns(e,"perEnd"),e.hasOwnProperty("updateableRec")){const t=Pn`Add an ${"[`updateable-rec`|#updateable-rec-class]"} CSS class to the Status of This Document section instead.`;Rn("Configuration option `updateableRec` is deprecated.",zr,{hint:t}),e.updateableRec&&o.classList.add("updateable-rec")}e.updateableRec=o.classList.contains("updateable-rec");const c=["addition","correction","proposed-addition","proposed-correction"];if(e.isRec&&e.revisionTypes?.length>0){if(e.revisionTypes.some((e=>!c.includes(e)))){const t=Pn`${"[specStatus]"} is "REC" with unknown ${"[revisionTypes]"}: '${An(e.revisionTypes.filter((e=>!c.includes(e))))}'.`,n=Pn`The valid values for ${"[revisionTypes]"} are: ${An(c)}.`;Sn(t,zr,{hint:n})}if((e.revisionTypes.includes("proposed-addition")||e.revisionTypes.includes("addition"))&&!e.updateableRec){Sn(Pn`${"[specStatus]"} is "REC" with proposed additions but the Recommendation is not marked as allowing new features.`,zr)}}if("REC"===e.specStatus&&e.updateableRec&&e.revisionTypes&&e.revisionTypes.length>0&&["proposed-addition","proposed-correction"].some((t=>e.revisionTypes.includes(t)))&&!e.revisedRecEnd){Sn(Pn`${"[specStatus]"} is "REC" with proposed corrections or additions but no ${"[revisedRecEnd]"} is specified in the ${"[respecConfig]"}.`,zr)}if(e.revisedRecEnd=ns(e,"revisedRecEnd"),e.noRecTrack&&Gr.includes(e.specStatus)){const t=Pn`Document configured as ${"[noRecTrack]"}, but its status ("${e.specStatus}") puts it on the W3C Rec Track.`,n=An(Gr,{quotes:!0});Sn(t,zr,{hint:`Status **can't** be any of: ${n}.`})}if(o.classList.contains("override")||Nt.bind(o)`${function(e,t){const n={...rs(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?Mr:Or)(e,n)}(e,o)}`,!e.implementationReportURI&&e.isCR){const e=Pn`CR documents must have an ${"[implementationReportURI]"} that describes the [implementation experience](https://www.w3.org/2019/Process-20190301/#implementation-experience).`;Sn(Pn`Missing ${"[implementationReportURI]"} configuration option in ${"[respecConfig]"}.`,zr,{hint:e})}if(!e.implementationReportURI&&e.isPR){Rn(Pn`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).`,zr)}r("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:nn(document.getElementById("w3c-state")?.textContent??"")})},status2text:Wr,status2track:Br,tagStatus:Yr,trStatus:Xr});const is={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},os="w3c/defaults",as={src:"https://www.w3.org/StyleSheets/TR/2021/logos/W3C",alt:"W3C",height:48,width:72,url:"https://www.w3.org/"},cs={alt:"W3C Member Submission",href:"https://www.w3.org/Submission/",src:"https://www.w3.org/Icons/member_subm-v.svg",width:"211",height:"48"},ls={lint:{"privsec-section":!1,"required-sections":!0,"wpt-tests-exist":!1,"informative-dfn":"warn","no-unused-dfns":"warn",a11y:!1},doJsonLd:!1,logos:[],xref:!0,wgId:"",otherLinks:[],excludeGithubLinks:!0,subtitle:"",prevVersion:"",formerEditors:[],editors:[],authors:[]};var us=Object.freeze({__proto__:null,name:os,run:function(e){const t=!1!==e.lint&&{...is.lint,...ls.lint,...e.lint};Object.assign(e,{...is,...ls,...e,lint:t}),"unofficial"===e.specStatus||e.hasOwnProperty("license")||(e.license="w3c-software-doc"),function(e){const{specStatus:t,groupType:n,group:r}=e;if(!t){const t=Pn`Select an appropriate status from ${"[specStatus]"} based on your W3C group. If in doubt, use \`"unofficial"\`.`;return Sn(Pn`The ${"[specStatus]"} configuration option is required.`,os,{hint:t}),void(e.specStatus="base")}if(void 0===Wr[t]){const n=Pn`The ${"[specStatus]"} "\`${t}\`" is not supported at for this type of document.`,r=Pn`set ${"[specStatus]"} to one of: ${An(Object.keys(Wr),{quotes:!0})}.`;return Sn(n,os,{hint:r}),void(e.specStatus="base")}switch(n){case"cg":if(![...Kr,"unofficial","UD"].includes(t)){const n=Pn`W3C Community Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=An(Kr,{quotes:!0});Sn(n,os,{hint:`Please use one of: ${r}. Automatically falling back to \`"CG-DRAFT"\`.`}),e.specStatus="CG-DRAFT"}break;case"bg":if(![...Zr,"unofficial","UD"].includes(t)){const n=Pn`W3C Business Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=An(Zr,{quotes:!0});Sn(n,os,{hint:`Please use one of: ${r}. Automatically falling back to \`"BG-DRAFT"\`.`}),e.specStatus="BG-DRAFT"}break;case"wg":if(![...Xr,"unofficial","UD","ED"].includes(t)){const e=Pn`Pleas see ${"[specStatus]"} for appropriate status for W3C Working Group documents.`;Sn(Pn`W3C Working Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,os,{hint:e})}break;case"other":if("tag"===r&&!["ED",...Xr,...Yr].includes(t)){const n=Pn`The W3C Technical Architecture Group's documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=An(["ED",...Xr,...Yr],{quotes:!0});Sn(n,os,{hint:`Please use one of: ${r}. Automatically falling back to \`"unofficial"\`.`}),e.specStatus="unofficial"}break;default:if(!e.wgId&&!["unofficial","base","UD","Member-SUBM"].includes(e.specStatus)){const t="Document is not associated with a [W3C group](https://respec.org/w3c/groups/). Defaulting to 'base' status.",n=Pn`Use the ${"[group]"} configuration option to associated this document with a W3C group.`;e.specStatus="base",Sn(t,os,{hint:n})}}}(e),function(e){const{specStatus:t,wg:n}=e,r=[...Gr,...Vr,...Hr,...Yr,"ED"].includes(t),s=n&&n.length&&r,i=["Member-SUBM"].includes(t);(s||i)&&(e.logos.unshift(as),"Member-SUBM"===t&&e.logos.push(cs))}(e)}});var ds=String.raw`@keyframes pop{ 0%{transform:scale(1,1)} 25%{transform:scale(1.25,1.25);opacity:.75} 100%{transform:scale(1,1)} @@ -754,9 +754,9 @@ dd{margin-left:0} />`),document.head.querySelector("meta[name=viewport]")||ms.prepend(Nt`<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" - />`),document.head.prepend(ms);var gs=Object.freeze({__proto__:null,name:"w3c/style",run:function(e){const t=e.specStatus?.toUpperCase()??"";let n="";const r=[...Gr,...Vr,...Hr,"ED","MEMBER-SUBM"].includes(t)&&e.wgId;switch(t){case"WD":case"FPWD":n=r?"W3C-WD":"base.css";break;case"CG-DRAFT":case"CG-FINAL":case"BG-DRAFT":case"BG-FINAL":n=t.toLowerCase();break;case"UD":case"UNOFFICIAL":n="W3C-UD";break;case"FINDING":case"DRAFT-FINDING":case"EDITOR-DRAFT-FINDING":case"BASE":n="base.css";break;default:n=r?`W3C-${e.specStatus}`:"base.css"}e.noToc||s("end-all",hs,{once:!0});const i=new URL(`/StyleSheets/TR/2021/${n}`,"https://www.w3.org/");var o;!function(e,t){const n=[].concat(t).map((t=>{const n=e.createElement("link");return n.rel="stylesheet",n.href=t,n})).reduce(((e,t)=>(e.appendChild(t),e)),e.createDocumentFragment());e.head.appendChild(n)}(document,i.href),s("beforesave",(o=i,e=>{const t=e.querySelector(`head link[href="${o}"]`);e.querySelector("head").append(t)}))}});const bs="core/github";let ys,ws;const vs=new Promise(((e,t)=>{ys=e,ws=e=>{Sn(e,bs),t(new Error(e))}})),$s=rn({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 ks=Object.freeze({__proto__:null,github:vs,name:bs,run:async function(e){if(!e.hasOwnProperty("github")||!e.github)return void ys(null);if("object"==typeof e.github&&!e.github.hasOwnProperty("repoURL")){const e=Pn`Config option ${"[github]"} is missing property \`repoURL\`.`;return void ws(e)}let t,n=e.github.repoURL||e.github;n.endsWith("/")||(n+="/");try{t=new URL(n,"https://github.com")}catch{const e=Pn`${"[github]"} configuration option is not a valid URL? (${n}).`;return void ws(e)}if("https://github.com"!==t.origin){const e=Pn`${"[github]"} configuration option must be HTTPS and pointing to GitHub. (${t.href}).`;return void ws(e)}const[r,s]=t.pathname.split("/").filter((e=>e));if(!r||!s){const e=Pn`${"[github]"} URL needs a path. For example, "w3c/my-spec".`;return void ws(e)}const i=e.github.branch||"gh-pages",o=new URL("./issues/",t).href,a=new URL(`./commits/${e.github.branch??""}`,t.href),c={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};let l="https://respec.org/github";if(e.githubAPI)if(new URL(e.githubAPI).hostname===window.parent.location.hostname)l=e.githubAPI;else{Rn("The `githubAPI` configuration option is private and should not be added manually.",bs)}if(!e.excludeGithubLinks){const n={key:$s.participate,data:[{value:`GitHub ${r}/${s}`,href:t},{value:$s.file_a_bug,href:c.issueBase},{value:$s.commit_history,href:a.href},{value:"Pull requests",href:c.pullBase}]};e.otherLinks||(e.otherLinks=[]),e.otherLinks.unshift(n)}const u={branch:i,repoURL:t.href,apiBase:l,fullName:`${r}/${s}`,issuesURL:o,pullsURL:c.pullBase,newIssuesURL:new URL("./new/choose",o).href,commitHistoryURL:a.href};ys(u);const d={...c,...e,github:u,githubAPI:l};Object.assign(e,d)}});class xs{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){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(_s(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function _s(e){const t=new xs(e.ownerDocument);for(;e.firstChild;){const n=e.firstChild;switch(n.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":t.addHeader(n);break;case"section":t.addSection(n);break;default:t.addElement(n)}}return t.root}function Cs(e){const t=_s(e);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}var Ss=Object.freeze({__proto__:null,name:"core/sections",restructure:Cs,run:function(){Cs(document.body)}});const Rs="core/data-include";function Es(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),s=an(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=Gn(s)),"text"===r?e.textContent=s:e.innerHTML=s,"markdown"===r&&Cs(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)}async function As(e,t){const n=e.querySelectorAll("[data-include]"),r=Array.from(n).map((async e=>{const n=e.dataset.include;if(!n)return;const r=`include-${String(Math.random()).slice(2)}`;e.dataset.includeId=r;try{const s=await fetch(n);Es(await s.text(),r,n),t<3&&await As(e,t+1)}catch(t){const r=`\`data-include\` failed: \`${n}\` (${t.message}).`;console.error(r,e,t),Sn(r,Rs,{elements:[e]})}}));await Promise.all(r)}var Ts=Object.freeze({__proto__:null,name:Rs,run:async function(){await As(document,1)}});const Ls="core/title",Ps=rn({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"无标题"}});var Is=Object.freeze({__proto__:null,name:Ls,run:function(e){const t=document.querySelector("h1#title")||Nt`<h1 id="title"></h1>`;if(t.isConnected&&""===t.textContent.trim()){Sn('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">`.',Ls,{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||`${Ps.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=nn(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:s}=Nt` + />`),document.head.prepend(ms);var gs=Object.freeze({__proto__:null,name:"w3c/style",run:function(e){const t=e.specStatus?.toUpperCase()??"";let n="";const r=[...Gr,...Vr,...Hr,"ED","MEMBER-SUBM"].includes(t)&&e.wgId;switch(t){case"WD":case"FPWD":n=r?"W3C-WD":"base.css";break;case"CG-DRAFT":case"CG-FINAL":case"BG-DRAFT":case"BG-FINAL":n=t.toLowerCase();break;case"UD":case"UNOFFICIAL":n="W3C-UD";break;case"FINDING":case"DRAFT-FINDING":case"EDITOR-DRAFT-FINDING":case"BASE":n="base.css";break;case"MEMBER-SUBM":n="W3C-Member-SUBM";break;default:n=r?`W3C-${e.specStatus}`:"base.css"}e.noToc||s("end-all",hs,{once:!0});const i=new URL(`/StyleSheets/TR/2021/${n}`,"https://www.w3.org/");var o;!function(e,t){const n=[].concat(t).map((t=>{const n=e.createElement("link");return n.rel="stylesheet",n.href=t,n})).reduce(((e,t)=>(e.appendChild(t),e)),e.createDocumentFragment());e.head.appendChild(n)}(document,i.href),s("beforesave",(o=i,e=>{const t=e.querySelector(`head link[href="${o}"]`);e.querySelector("head").append(t)}))}});const bs="core/github";let ys,ws;const vs=new Promise(((e,t)=>{ys=e,ws=e=>{Sn(e,bs),t(new Error(e))}})),$s=rn({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 ks=Object.freeze({__proto__:null,github:vs,name:bs,run:async function(e){if(!e.hasOwnProperty("github")||!e.github)return void ys(null);if("object"==typeof e.github&&!e.github.hasOwnProperty("repoURL")){const e=Pn`Config option ${"[github]"} is missing property \`repoURL\`.`;return void ws(e)}let t,n=e.github.repoURL||e.github;n.endsWith("/")||(n+="/");try{t=new URL(n,"https://github.com")}catch{const e=Pn`${"[github]"} configuration option is not a valid URL? (${n}).`;return void ws(e)}if("https://github.com"!==t.origin){const e=Pn`${"[github]"} configuration option must be HTTPS and pointing to GitHub. (${t.href}).`;return void ws(e)}const[r,s]=t.pathname.split("/").filter((e=>e));if(!r||!s){const e=Pn`${"[github]"} URL needs a path. For example, "w3c/my-spec".`;return void ws(e)}const i=e.github.branch||"gh-pages",o=new URL("./issues/",t).href,a=new URL(`./commits/${e.github.branch??""}`,t.href),c={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};let l="https://respec.org/github";if(e.githubAPI)if(new URL(e.githubAPI).hostname===window.parent.location.hostname)l=e.githubAPI;else{Rn("The `githubAPI` configuration option is private and should not be added manually.",bs)}if(!e.excludeGithubLinks){const n={key:$s.participate,data:[{value:`GitHub ${r}/${s}`,href:t},{value:$s.file_a_bug,href:c.issueBase},{value:$s.commit_history,href:a.href},{value:"Pull requests",href:c.pullBase}]};e.otherLinks||(e.otherLinks=[]),e.otherLinks.unshift(n)}const u={branch:i,repoURL:t.href,apiBase:l,fullName:`${r}/${s}`,issuesURL:o,pullsURL:c.pullBase,newIssuesURL:new URL("./new/choose",o).href,commitHistoryURL:a.href};ys(u);const d={...c,...e,github:u,githubAPI:l};Object.assign(e,d)}});class xs{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){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(_s(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function _s(e){const t=new xs(e.ownerDocument);for(;e.firstChild;){const n=e.firstChild;switch(n.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":t.addHeader(n);break;case"section":t.addSection(n);break;default:t.addElement(n)}}return t.root}function Cs(e){const t=_s(e);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}var Ss=Object.freeze({__proto__:null,name:"core/sections",restructure:Cs,run:function(){Cs(document.body)}});const Rs="core/data-include";function Es(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`),s=an(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=Gn(s)),"text"===r?e.textContent=s:e.innerHTML=s,"markdown"===r&&Cs(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)}async function As(e,t){const n=e.querySelectorAll("[data-include]"),r=Array.from(n).map((async e=>{const n=e.dataset.include;if(!n)return;const r=`include-${String(Math.random()).slice(2)}`;e.dataset.includeId=r;try{const s=await fetch(n);Es(await s.text(),r,n),t<3&&await As(e,t+1)}catch(t){const r=`\`data-include\` failed: \`${n}\` (${t.message}).`;console.error(r,e,t),Sn(r,Rs,{elements:[e]})}}));await Promise.all(r)}var Ts=Object.freeze({__proto__:null,name:Rs,run:async function(){await As(document,1)}});const Ls="core/title",Ps=rn({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"无标题"}});var Is=Object.freeze({__proto__:null,name:Ls,run:function(e){const t=document.querySelector("h1#title")||Nt`<h1 id="title"></h1>`;if(t.isConnected&&""===t.textContent.trim()){Sn('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">`.',Ls,{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||`${Ps.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=nn(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:s}=Nt` Preview of PR <a href="${n}">#${e.prNumber}</a>: - `;t.prepend(...s),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});const Ds="w3c/level",Ns=rn({en:{level:"Level"}});var Os=Object.freeze({__proto__:null,name:Ds,run:function(e){if(!e.hasOwnProperty("level"))return;const t=document.querySelector("h1#title"),n=parseInt(e.level);if(!Number.isInteger(n)||n<0){Sn(`The \`level\` configuration option must be a number greater or equal to 0. It is currently set to \`${n}\``,Ds,{title:"Invalid level config.",elements:[t]})}else t.append(` ${Ns.level} ${n}`),document.title=`${document.title} ${Ns.level} ${n}`,e.shortName=`${e.shortName}-${n}`,e.level=n}});const js="w3c/abstract",zs=rn({en:{abstract:"Abstract"},ko:{abstract:"요약"},zh:{abstract:"摘要"},ja:{abstract:"要約"},nl:{abstract:"Samenvatting"},es:{abstract:"Resumen"},de:{abstract:"Zusammenfassung"}});var Ms=Object.freeze({__proto__:null,name:js,run:async function(){const e=function(){const e=document.querySelector("#abstract");if(e)switch(e.localName){case"section":return e;case"div":return hn(e,"section");default:return Sn("The abstract should be a `<section>` element.",js,{elements:[e]}),e}const t=zs.abstract.toLowerCase();for(const e of document.querySelectorAll("h2, h3, h4, h5, h6")){if(nn(e.textContent).toLowerCase()===t)return e.closest("section")}return null}();if(e)e.classList.add("introductory"),e.id="abstract",e.querySelector("h2")||e.prepend(Nt`<h2>${zs.abstract}</h2>`);else{Sn('Document must have one `<section id="abstract">`.',js)}}});var qs=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=an(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const Us="core/dfn-abbr";function Ws(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 Fs=Object.freeze({__proto__:null,name:Us,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)Ws(t);else{Sn(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,Us,{elements:[t],title:"Error: unsupported."})}}}});const Bs=/^[a-z]+(\s+[a-z]+)+\??$/,Hs=/\B"([^"]*)"\B/,Gs=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,Vs=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,Ys=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,Ks=/^(?:\w+)\??$/,Zs=/^(\w+)\["([\w- ]*)"\]$/,Js=/\.?(\w+\(.*\)$)/,Xs=/\/(.+)/,Qs=/\[\[.+\]\]/;function ei(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return Nt`<a + `;t.prepend(...s),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});const Ds="w3c/level",Ns=rn({en:{level:"Level"}});var Os=Object.freeze({__proto__:null,name:Ds,run:function(e){if(!e.hasOwnProperty("level"))return;const t=document.querySelector("h1#title"),n=parseInt(e.level);if(!Number.isInteger(n)||n<0){Sn(`The \`level\` configuration option must be a number greater or equal to 0. It is currently set to \`${n}\``,Ds,{title:"Invalid level config.",elements:[t]})}else t.append(` ${Ns.level} ${n}`),document.title=`${document.title} ${Ns.level} ${n}`,e.shortName=`${e.shortName}-${n}`,e.level=n}});const js="w3c/abstract",Ms=rn({en:{abstract:"Abstract"},ko:{abstract:"요약"},zh:{abstract:"摘要"},ja:{abstract:"要約"},nl:{abstract:"Samenvatting"},es:{abstract:"Resumen"},de:{abstract:"Zusammenfassung"}});var zs=Object.freeze({__proto__:null,name:js,run:async function(){const e=function(){const e=document.querySelector("#abstract");if(e)switch(e.localName){case"section":return e;case"div":return hn(e,"section");default:return Sn("The abstract should be a `<section>` element.",js,{elements:[e]}),e}const t=Ms.abstract.toLowerCase();for(const e of document.querySelectorAll("h2, h3, h4, h5, h6")){if(nn(e.textContent).toLowerCase()===t)return e.closest("section")}return null}();if(e)e.classList.add("introductory"),e.id="abstract",e.querySelector("h2")||e.prepend(Nt`<h2>${Ms.abstract}</h2>`);else{Sn('Document must have one `<section id="abstract">`.',js)}}});var Us=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach((e=>{e.innerHTML=an(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")}))}});const qs="core/dfn-abbr";function Ws(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 Fs=Object.freeze({__proto__:null,name:qs,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)Ws(t);else{Sn(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,qs,{elements:[t],title:"Error: unsupported."})}}}});const Bs=/^[a-z]+(\s+[a-z]+)+\??$/,Hs=/\B"([^"]*)"\B/,Gs=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,Vs=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,Ys=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,Ks=/^(?:\w+)\??$/,Zs=/^(\w+)\["([\w- ]*)"\]$/,Js=/\.?(\w+\(.*\)$)/,Xs=/\/(.+)/,Qs=/\[\[.+\]\]/;function ei(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return Nt`<a data-xref-type="_IDL_" data-link-type="idl" data-lt="${t}" @@ -811,7 +811,7 @@ dd{margin-left:0} >${$i.reference_not_found}</em >`} </dd> - `}function Ai(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;return t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t+=". "),e.publisher&&(t=`${t} ${xi(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${ki.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var Ti=Object.freeze({__proto__:null,name:vi,renderInlineCitation:Ri,run:function(e){const t=Array.from(e.informativeReferences),n=Array.from(e.normativeReferences);if(!t.length&&!n.length)return;const r=document.querySelector("section#references")||Nt`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(Nt`<h1>${$i.references}</h1>`),r.classList.add("appendix"),n.length){const e=Ci(n,$i.norm_references);r.appendChild(e)}if(t.length){const e=Ci(t,$i.info_references);r.appendChild(e)}document.body.appendChild(r)}});const Li="core/inlines",Pi={},Ii=e=>new RegExp(e.map((e=>e.source)).join("|")),Di=rn({en:{rfc2119Keywords:()=>Ii([/\bMUST(?:\s+NOT)?\b/,/\bSHOULD(?:\s+NOT)?\b/,/\bSHALL(?:\s+NOT)?\b/,/\bMAY?\b/,/\b(?:NOT\s+)?REQUIRED\b/,/\b(?:NOT\s+)?RECOMMENDED\b/,/\bOPTIONAL\b/])},de:{rfc2119Keywords:()=>Ii([/\bMUSS\b/,/\bMÜSSEN\b/,/\bERFORDERLICH\b/,/\b(?:NICHT\s+)?NÖTIG\b/,/\bDARF(?:\s+NICHT)?\b/,/\bDÜRFEN(?:\s+NICHT)?\b/,/\bVERBOTEN\b/,/\bSOLL(?:\s+NICHT)?\b/,/\bSOLLEN(?:\s+NICHT)?\b/,/\b(?:NICHT\s+)?EMPFOHLEN\b/,/\bKANN\b/,/\bKÖNNEN\b/,/\bOPTIONAL\b/])}}),Ni=/(?:`[^`]+`)(?!`)/,Oi=/(?:{{[^}]+\?*}})/,ji=/\B\|\w[\w\s]*(?:\s*:[\w\s&;<>]+\??)?\|\B/,zi=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,Mi=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,qi=/(?:\[=[^=]+=\])/,Ui=/(?:\[\^[^^]+\^\])/;function Wi(e){const t=e.slice(2,-2).trim(),[n,r,s]=t.split("/",3).map((e=>e&&e.trim())).filter((e=>!!e)),[i,o,a]=t.startsWith("/")?["element-attr",null,n]:s?["attr-value",`${n}/${r}`,s]:r?["element-attr",n,r]:["element",null,n];return Nt`<code + `}function Ai(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;return t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors&&e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t+=". "),e.publisher&&(t=`${t} ${xi(e.publisher)} `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${ki.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var Ti=Object.freeze({__proto__:null,name:vi,renderInlineCitation:Ri,run:function(e){const t=Array.from(e.informativeReferences),n=Array.from(e.normativeReferences);if(!t.length&&!n.length)return;const r=document.querySelector("section#references")||Nt`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(Nt`<h1>${$i.references}</h1>`),r.classList.add("appendix"),n.length){const e=Ci(n,$i.norm_references);r.appendChild(e)}if(t.length){const e=Ci(t,$i.info_references);r.appendChild(e)}document.body.appendChild(r)}});const Li="core/inlines",Pi={},Ii=e=>new RegExp(e.map((e=>e.source)).join("|")),Di=rn({en:{rfc2119Keywords:()=>Ii([/\bMUST(?:\s+NOT)?\b/,/\bSHOULD(?:\s+NOT)?\b/,/\bSHALL(?:\s+NOT)?\b/,/\bMAY?\b/,/\b(?:NOT\s+)?REQUIRED\b/,/\b(?:NOT\s+)?RECOMMENDED\b/,/\bOPTIONAL\b/])},de:{rfc2119Keywords:()=>Ii([/\bMUSS\b/,/\bMÜSSEN\b/,/\bERFORDERLICH\b/,/\b(?:NICHT\s+)?NÖTIG\b/,/\bDARF(?:\s+NICHT)?\b/,/\bDÜRFEN(?:\s+NICHT)?\b/,/\bVERBOTEN\b/,/\bSOLL(?:\s+NICHT)?\b/,/\bSOLLEN(?:\s+NICHT)?\b/,/\b(?:NICHT\s+)?EMPFOHLEN\b/,/\bKANN\b/,/\bKÖNNEN\b/,/\bOPTIONAL\b/])}}),Ni=/(?:`[^`]+`)(?!`)/,Oi=/(?:{{[^}]+\?*}})/,ji=/\B\|\w[\w\s]*(?:\s*:[\w\s&;<>]+\??)?\|\B/,Mi=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,zi=/(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/,Ui=/(?:\[=[^=]+=\])/,qi=/(?:\[\^[^^]+\^\])/;function Wi(e){const t=e.slice(2,-2).trim(),[n,r,s]=t.split("/",3).map((e=>e&&e.trim())).filter((e=>!!e)),[i,o,a]=t.startsWith("/")?["element-attr",null,n]:s?["attr-value",`${n}/${r}`,s]:r?["element-attr",n,r]:["element",null,n];return Nt`<code ><a data-xref-type="${i}" data-xref-for="${o}" @@ -825,7 +825,7 @@ dd{margin-left:0} data-xref-for="${a}" data-lt="${s}" >${o}</a - >`}function Zi(e){const t=e.slice(1,-1);return Nt`<code>${t}</code>`}function Ji(e){return Ni.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?Zi(e):Ji(e))):document.createTextNode(e)}var Xi=Object.freeze({__proto__:null,name:Li,rfc2119Usage:Pi,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new vn,e.informativeReferences=new vn,e.respecRFC2119||(e.respecRFC2119=Pi);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=nn(e),s=nn(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","svg"],{wsNodes:!1}),i=Di.rfc2119Keywords(),o=new RegExp(`(${Ii([i,Oi,ji,zi,Mi,qi,Ni,Ui,...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(Hi(o,n));break;case o.startsWith("[[["):s.append(Bi(o));break;case o.startsWith("[["):s.append(...Gi(o,n,e));break;case o.startsWith("|"):s.append(Yi(o));break;case o.startsWith("[="):s.append(Ki(o));break;case o.startsWith("`"):s.append(Zi(o));break;case o.startsWith("[^"):s.append(Wi(o));break;case t.has(o):s.append(Vi(o,n,t));break;case i.test(o):s.append(Fi(o))}else s.append(o);n.replaceWith(s)}}});const Qi="w3c/conformance",eo=rn({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)=>Nt`<p> + >`}function Zi(e){const t=e.slice(1,-1);return Nt`<code>${t}</code>`}function Ji(e){return Ni.test(e)?e.split(/(`[^`]+`)(?!`)/).map((e=>e.startsWith("`")?Zi(e):Ji(e))):document.createTextNode(e)}var Xi=Object.freeze({__proto__:null,name:Li,rfc2119Usage:Pi,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new vn,e.informativeReferences=new vn,e.respecRFC2119||(e.respecRFC2119=Pi);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=nn(e),s=nn(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","svg"],{wsNodes:!1}),i=Di.rfc2119Keywords(),o=new RegExp(`(${Ii([i,Oi,ji,Mi,zi,Ui,Ni,qi,...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(Hi(o,n));break;case o.startsWith("[[["):s.append(Bi(o));break;case o.startsWith("[["):s.append(...Gi(o,n,e));break;case o.startsWith("|"):s.append(Yi(o));break;case o.startsWith("[="):s.append(Ki(o));break;case o.startsWith("`"):s.append(Zi(o));break;case o.startsWith("[^"):s.append(Wi(o));break;case t.has(o):s.append(Vi(o,n,t));break;case i.test(o):s.append(Fi(o))}else s.append(o);n.replaceWith(s)}}});const Qi="w3c/conformance",eo=rn({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)=>Nt`<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> @@ -846,7 +846,7 @@ dd{margin-left:0} <h1>${eo.conformance}</h1> <p>${eo.normativity}</p> ${n.length?eo.keywordInterpretation(r,s):null} - `;e.prepend(...i.childNodes)}(t,e),!t&&Object.keys(Pi).length){Rn("Document uses RFC2119 keywords but lacks a conformance section.",Qi,{hint:'Please add a `<section id="conformance">`.'})}}});function no(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(s){Sn(`Invalid ${t} name "${e}": ${s.message}`,r,{hint:`Check that the ${t} name is allowed per the XML's Name production for ${t}.`,elements:[n]})}return!1}function ro(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return Sn(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const so=new _n;function io(e,t){for(const n of t)so.has(n)||so.set(n,new Set),so.get(n).add(e)}const oo="core/dfn",ao=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:ro}],["element",{requiresFor:!1,validator:no}],["element-attr",{requiresFor:!1,validator:no}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:ro}],["event",{requiresFor:!1,validator:ro}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new zt(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(s){return Sn(`Invalid ${t} "${e}": ${s.message}.`,r,{hint:"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`).",elements:[n]}),!1}return!0}}],["scheme",{requiresFor:!1,validator:ro}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?ro(e.slice(1,-1),t,n,r):(Sn(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),co=[...ao.keys()];function lo(e,t){let n="";switch(!0){case co.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>ao.has(e))),function(e,t,n){const r=ao.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=Pn`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:s}=r,i=Pn`Use a ${"[data-dfn-for]"} attribute to associate this with ${s}.`;Sn(e,oo,{hint:i,elements:[n]})}r.validator&&r.validator(e,t,n,oo)}(t,n,e);break;case Vs.test(t):n=function(e,t){t.dataset.hasOwnProperty("idl")||(t.dataset.idl="");const n=t.closest("[data-dfn-for]");t!==n&&n?.dataset.dfnFor&&(t.dataset.dfnFor=n.dataset.dfnFor);if(!t.dataset.dfnFor){const n=Pn`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;Sn(`Internal slot "${e}" must be associated with a WebIDL interface.`,oo,{hint:n,elements:[t]})}t.matches(".export, [data-export]")||(t.dataset.noexport="");const r=e.endsWith(")")?"method":"attribute";if(!t.dataset.dfnType)return r;const s=["attribute","method"],{dfnType:i}=t.dataset;if(!s.includes(i)||r!==i){const n=Pn`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,i=`The only allowed types are: ${An(s,{quotes:!0})}. The slot "${e}" seems to be a "${En(r)}"?`;return Sn(n,oo,{hint:i,elements:[t]}),"dfn"}return i}(t,e)}if(!n&&!e.matches("[data-dfn-type]")){n=e.closest("[data-dfn-type]")?.dataset.dfnType}n&&!e.dataset.dfnType&&(e.dataset.dfnType=n)}function uo(e){switch(!0){case e.matches(".export.no-export"):Sn(Pn`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,oo,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){Sn(Pn`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,oo,{elements:[e],hint:"Please chose only one."}),delete e.dataset.export}e.dataset.noexport="";break;case e.matches(":is(.export):not([data-noexport], .no-export)"):e.dataset.export=""}}function po(){const e=document.querySelectorAll("dfn:is([data-dfn-type=''],:not([data-dfn-type]))");for(const t of e)t.dataset.dfnType="dfn";const t=document.querySelectorAll("dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])");for(const e of t)e.dataset.export=""}var fo=Object.freeze({__proto__:null,name:oo,run:function(){for(const e of document.querySelectorAll("dfn")){const t=fn(e);if(io(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;lo(e,n),uo(e),1===t.length&&n===nn(e.textContent)||(e.dataset.lt=t.join("|"))}s("plugins-done",po)}});var ho=Object.freeze({__proto__:null,name:"core/pluralize",run:function(e){if(!e.pluralize)return;const t=function(){const e=new Set;document.querySelectorAll("a:not([href])").forEach((t=>{const n=nn(t.textContent).toLowerCase();e.add(n),t.dataset.lt&&e.add(t.dataset.lt)}));const t=new Set;return document.querySelectorAll("dfn:not([data-lt-noDefault])").forEach((e=>{const n=nn(e.textContent).toLowerCase();t.add(n),e.dataset.lt&&e.dataset.lt.split("|").forEach((e=>t.add(e))),e.dataset.localLt&&e.dataset.localLt.split("|").forEach((e=>t.add(e)))})),function(n){const r=nn(n).toLowerCase(),s=Mt.isSingular(r)?Mt.plural(r):Mt.singular(r);return e.has(s)&&!t.has(s)?s:""}}();document.querySelectorAll("dfn:not([data-lt-no-plural]):not([data-lt-noDefault])").forEach((e=>{const n=[e.textContent];e.dataset.lt&&n.push(...e.dataset.lt.split("|")),e.dataset.localLt&&n.push(...e.dataset.localLt.split("|"));const r=new Set(n.map(t).filter((e=>e)));if(r.size){const t=e.dataset.plurals?e.dataset.plurals.split("|"):[],n=[...new Set([...t,...r])];e.dataset.plurals=n.join("|"),io(e,n)}}))}});var mo=String.raw`span.example-title{text-transform:none} + `;e.prepend(...i.childNodes)}(t,e),!t&&Object.keys(Pi).length){Rn("Document uses RFC2119 keywords but lacks a conformance section.",Qi,{hint:'Please add a `<section id="conformance">`.'})}}});function no(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(s){Sn(`Invalid ${t} name "${e}": ${s.message}`,r,{hint:`Check that the ${t} name is allowed per the XML's Name production for ${t}.`,elements:[n]})}return!1}function ro(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return Sn(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const so=new _n;function io(e,t){for(const n of t)so.has(n)||so.set(n,new Set),so.get(n).add(e)}const oo="core/dfn",ao=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:ro}],["element",{requiresFor:!1,validator:no}],["element-attr",{requiresFor:!1,validator:no}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:ro}],["event",{requiresFor:!1,validator:ro}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new Mt(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(s){return Sn(`Invalid ${t} "${e}": ${s.message}.`,r,{hint:"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`).",elements:[n]}),!1}return!0}}],["scheme",{requiresFor:!1,validator:ro}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?ro(e.slice(1,-1),t,n,r):(Sn(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),co=[...ao.keys()];function lo(e,t){let n="";switch(!0){case co.some((t=>e.classList.contains(t))):n=[...e.classList].find((e=>ao.has(e))),function(e,t,n){const r=ao.get(t);if(r.requiresFor&&!n.dataset.dfnFor){const e=Pn`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:s}=r,i=Pn`Use a ${"[data-dfn-for]"} attribute to associate this with ${s}.`;Sn(e,oo,{hint:i,elements:[n]})}r.validator&&r.validator(e,t,n,oo)}(t,n,e);break;case Vs.test(t):n=function(e,t){t.dataset.hasOwnProperty("idl")||(t.dataset.idl="");const n=t.closest("[data-dfn-for]");t!==n&&n?.dataset.dfnFor&&(t.dataset.dfnFor=n.dataset.dfnFor);if(!t.dataset.dfnFor){const n=Pn`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;Sn(`Internal slot "${e}" must be associated with a WebIDL interface.`,oo,{hint:n,elements:[t]})}t.matches(".export, [data-export]")||(t.dataset.noexport="");const r=e.endsWith(")")?"method":"attribute";if(!t.dataset.dfnType)return r;const s=["attribute","method"],{dfnType:i}=t.dataset;if(!s.includes(i)||r!==i){const n=Pn`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,i=`The only allowed types are: ${An(s,{quotes:!0})}. The slot "${e}" seems to be a "${En(r)}"?`;return Sn(n,oo,{hint:i,elements:[t]}),"dfn"}return i}(t,e)}if(!n&&!e.matches("[data-dfn-type]")){n=e.closest("[data-dfn-type]")?.dataset.dfnType}n&&!e.dataset.dfnType&&(e.dataset.dfnType=n)}function uo(e){switch(!0){case e.matches(".export.no-export"):Sn(Pn`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,oo,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){Sn(Pn`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,oo,{elements:[e],hint:"Please chose only one."}),delete e.dataset.export}e.dataset.noexport="";break;case e.matches(":is(.export):not([data-noexport], .no-export)"):e.dataset.export=""}}function po(){const e=document.querySelectorAll("dfn:is([data-dfn-type=''],:not([data-dfn-type]))");for(const t of e)t.dataset.dfnType="dfn";const t=document.querySelectorAll("dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])");for(const e of t)e.dataset.export=""}var fo=Object.freeze({__proto__:null,name:oo,run:function(){for(const e of document.querySelectorAll("dfn")){const t=fn(e);if(io(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;lo(e,n),uo(e),1===t.length&&n===nn(e.textContent)||(e.dataset.lt=t.join("|"))}s("plugins-done",po)}});var ho=Object.freeze({__proto__:null,name:"core/pluralize",run:function(e){if(!e.pluralize)return;const t=function(){const e=new Set;document.querySelectorAll("a:not([href])").forEach((t=>{const n=nn(t.textContent).toLowerCase();e.add(n),t.dataset.lt&&e.add(t.dataset.lt)}));const t=new Set;return document.querySelectorAll("dfn:not([data-lt-noDefault])").forEach((e=>{const n=nn(e.textContent).toLowerCase();t.add(n),e.dataset.lt&&e.dataset.lt.split("|").forEach((e=>t.add(e))),e.dataset.localLt&&e.dataset.localLt.split("|").forEach((e=>t.add(e)))})),function(n){const r=nn(n).toLowerCase(),s=zt.isSingular(r)?zt.plural(r):zt.singular(r);return e.has(s)&&!t.has(s)?s:""}}();document.querySelectorAll("dfn:not([data-lt-no-plural]):not([data-lt-noDefault])").forEach((e=>{const n=[e.textContent];e.dataset.lt&&n.push(...e.dataset.lt.split("|")),e.dataset.localLt&&n.push(...e.dataset.localLt.split("|"));const r=new Set(n.map(t).filter((e=>e)));if(r.size){const t=e.dataset.plurals?e.dataset.plurals.split("|"):[],n=[...new Set([...t,...r])];e.dataset.plurals=n.join("|"),io(e,n)}}))}});var mo=String.raw`span.example-title{text-transform:none} :is(aside,div).example,div.illegal-example{padding:.5em;margin:1em 0;position:relative;clear:both} div.illegal-example{color:red} div.illegal-example p{color:#000} @@ -879,7 +879,7 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} ${wo} </style>`,s.querySelector("link")),ko(n,r,e),document.querySelectorAll(".ednote").forEach((e=>{e.classList.remove("ednote"),e.classList.add("note")}))}});const _o="core/best-practices",Co={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},So=rn(Co),Ro=c in Co?c:"en";var Eo=Object.freeze({__proto__:null,name:_o,run:function(){const e=document.querySelectorAll(".practicelab"),t=document.getElementById("bp-summary"),n=t?document.createElement("ul"):null;if([...e].forEach(((e,t)=>{const r=pn(e,"bp"),s=Nt`<a class="marker self-link" href="${`#${r}`}" ><bdi lang="${Ro}">${So.best_practice}${t+1}</bdi></a - >`;if(n){const t=Nt`<li>${s}: ${$n(e)}</li>`;n.appendChild(t)}const i=e.closest("div");if(!i)return void e.classList.add("advisement");i.classList.add("advisement");const o=Nt`${s.cloneNode(!0)}: ${e}`;i.prepend(...o.childNodes)})),e.length)t&&(t.appendChild(Nt`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){Rn("Using best practices summary (#bp-summary) but no best practices found.",_o),t.remove()}}});const Ao="core/figures",To=rn({en:{list_of_figures:"List of Figures",fig:"Figure "},ja:{fig:"図 ",list_of_figures:"図のリスト"},ko:{fig:"그림 ",list_of_figures:"그림 목록"},nl:{fig:"Figuur ",list_of_figures:"Lijst met figuren"},es:{fig:"Figura ",list_of_figures:"Lista de Figuras"},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var Lo=Object.freeze({__proto__:null,name:Ao,run:function(){document.querySelectorAll(":not(picture)>img:not([width]):not([height]):not([srcset])").forEach((e=>{0!==e.naturalHeight&&0!==e.naturalWidth&&(e.height=e.naturalHeight,e.width=e.naturalWidth)}));const e=function(){const e=[];return document.querySelectorAll("figure").forEach(((t,n)=>{const r=t.querySelector("figcaption");if(r)!function(e,t,n){const r=t.textContent;pn(e,"fig",r),gn(t,Nt`<span class="fig-title"></span>`),t.prepend(Nt`<a class="self-link" href="#${e.id}" + >`;if(n){const t=Nt`<li>${s}: ${$n(e)}</li>`;n.appendChild(t)}const i=e.closest("div");if(!i)return void e.classList.add("advisement");i.classList.add("advisement");const o=Nt`${s.cloneNode(!0)}: ${e}`;i.prepend(...o.childNodes)})),e.length)t&&(t.appendChild(Nt`<h1>Best Practices Summary</h1>`),t.appendChild(n));else if(t){Rn("Using best practices summary (#bp-summary) but no best practices found.",_o),t.remove()}}});const Ao="core/figures",To=rn({en:{list_of_figures:"List of Figures",fig:"Figure "},ja:{fig:"図 ",list_of_figures:"図のリスト"},ko:{fig:"그림 ",list_of_figures:"그림 목록"},nl:{fig:"Figuur ",list_of_figures:"Lijst met figuren"},es:{fig:"Figura ",list_of_figures:"Lista de Figuras"},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var Lo=Object.freeze({__proto__:null,name:Ao,run:function(){document.querySelectorAll(":not(picture)>img:not([width]):not([height]):not([srcset])").forEach((e=>{e.src.startsWith("data:image/svg+xml;")||e.src.endsWith(".svg")||0!==e.naturalHeight&&0!==e.naturalWidth&&(e.height=e.naturalHeight,e.width=e.naturalWidth)}));const e=function(){const e=[];return document.querySelectorAll("figure").forEach(((t,n)=>{const r=t.querySelector("figcaption");if(r)!function(e,t,n){const r=t.textContent;pn(e,"fig",r),gn(t,Nt`<span class="fig-title"></span>`),t.prepend(Nt`<a class="self-link" href="#${e.id}" >${To.fig}<bdi class="figno">${n+1}</bdi></a >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach((e=>{hn(e,"span").removeAttribute("href")})),Nt`<li class="tofline"> <a class="tocxref" href="${`#${e}`}">${n.childNodes}</a> @@ -893,7 +893,7 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle} > </li>`}(t.id,r))})),e}(),t=document.querySelector("section#list-of-tables");e.length&&t&&(!function(e){if(e.matches(".appendix, .introductory")||e.closest("section"))return;const t=bn(e);t.every((e=>e.classList.contains("introductory")))?e.classList.add("introductory"):t.some((e=>e.classList.contains("appendix")))&&e.classList.add("appendix")}(t),t.append(Nt`<h1>${Po.list_of_tables}</h1>`,Nt`<ul class="list-of-tables"> ${e} - </ul>`))}});const Do=new Set(["callback interface","callback","dictionary","enum","interface mixin","interface","typedef"]);function No(e,t,{parent:n=""}={}){switch(e.type){case"constructor":case"operation":return function(e,t,n){if(n.includes("!overload"))return Oo(e,t,n);return Oo(e,t,`${n}()`,n)}(e,n,t);default:return Oo(e,n,t)}}function Oo(e,t,...n){const{type:r}=e;for(const e of n){let n="enum-value"===r&&""===e?"the-empty-string":e,s=zo(n,t,e,r);if(0===s.length&&""!==t){n=`${t}.${n}`;const e=so.get(n);e&&1===e.size&&(s=[...e],io(s[0],[n]))}else n=e;if(s.length>1){Sn(`WebIDL identifier \`${e}\` ${t?`for \`${t}\``:""} is defined multiple times`,e,{title:"Duplicate definition.",elements:s})}if(s.length)return s[0]}}function jo(e,t,n,r){if(!e.id){const t=n.toLowerCase(),s=t?`${t}-`:"";let i=r.toLowerCase().replace(/[()]/g,"").replace(/\s/g,"-");""===i&&(i="the-empty-string",e.setAttribute("aria-label","the empty string")),e.id=`dom-${s}${i}`}switch(e.dataset.idl=t.type,e.dataset.title=e.textContent,e.dataset.dfnFor=n,t.type){case"operation":case"attribute":case"field":e.dataset.type=Mo(t)}switch(e.querySelector("code")||e.closest("code")||!e.children||gn(e,e.ownerDocument.createElement("code")),t.type){case"attribute":case"constructor":case"operation":!function(e,t){const{local:n,exportable:r}=t,s=e.dataset.lt?new Set(e.dataset.lt.split("|")):new Set;for(const e of r)s.add(e);n.filter((e=>s.has(e))).forEach((e=>s.delete(e))),e.dataset.lt=[...s].join("|"),e.dataset.localLt=n.join("|"),io(e,[...n,...r])}(e,function(e,t,n){const{type:r}=e,s=`${t}.${n}`;switch(r){case"constructor":case"operation":{const t=`${n}()`,r=`${s}()`,i=function(e,t){const n=[];if(0===t.length)return n;const r=[],s=[];for(const{name:e,optional:n,variadic:i}of t)n||i?s.push(e):r.push(e);const i=r.join(", "),o=`${e}(${i})`;n.push(o);const a=s.map(((t,n)=>{const i=[...r,...s.slice(0,n+1)].join(", ");return`${e}(${i})`}));return n.push(...a),n}(n,e.arguments);return{local:[s,r,n],exportable:[t,...i]}}case"attribute":return{local:[s],exportable:[n]}}}(t,n,r))}return e}function zo(e,t,n,r){const s=so.get(e);if(!s||0===s.size)return[];const i=[...s],o=i.filter((e=>{if("dfn"===e.dataset.dfnType)return!1;const n=e.closest("[data-dfn-for]");return n&&n.dataset.dfnFor===t}));if(0===o.length&&""===t&&1===i.length)return i[0].textContent===n?i:[];if(Do.has(r)&&i.length){const e=i.find((e=>e.textContent.trim()===n));if(e)return[e]}return o}function Mo(e={}){const{idlType:t,generic:n,union:r}=e;return void 0===t?"":"string"==typeof t?t:n||(r?t.map(Mo).join("|"):Mo(t))}const qo=function(){const e=document.createElement("button");return e.innerHTML='<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>',e.title="Copy IDL to clipboard",e.classList.add("respec-button-copy-paste","removeOnSave"),e}();function Uo(e){const t=e.closest("pre.idl").cloneNode(!0);t.querySelector(".idlHeader").remove();const{textContent:n}=t,r=qo.cloneNode(!0);r.addEventListener("click",(()=>{navigator.clipboard.writeText(n)})),e.append(r)}var Wo=Object.freeze({__proto__:null,addCopyIDLButton:Uo,name:"core/webidl-clipboard"});var Fo=String.raw`pre.idl{padding:1em;position:relative} + </ul>`))}});const Do=new Set(["callback interface","callback","dictionary","enum","interface mixin","interface","typedef"]);function No(e,t,{parent:n=""}={}){switch(e.type){case"constructor":case"operation":return function(e,t,n){if(n.includes("!overload"))return Oo(e,t,n);return Oo(e,t,`${n}()`,n)}(e,n,t);default:return Oo(e,n,t)}}function Oo(e,t,...n){const{type:r}=e;for(const e of n){let n="enum-value"===r&&""===e?"the-empty-string":e,s=Mo(n,t,e,r);if(0===s.length&&""!==t){n=`${t}.${n}`;const e=so.get(n);e&&1===e.size&&(s=[...e],io(s[0],[n]))}else n=e;if(s.length>1){Sn(`WebIDL identifier \`${e}\` ${t?`for \`${t}\``:""} is defined multiple times`,e,{title:"Duplicate definition.",elements:s})}if(s.length)return s[0]}}function jo(e,t,n,r){if(!e.id){const t=n.toLowerCase(),s=t?`${t}-`:"";let i=r.toLowerCase().replace(/[()]/g,"").replace(/\s/g,"-");""===i&&(i="the-empty-string",e.setAttribute("aria-label","the empty string")),e.id=`dom-${s}${i}`}switch(e.dataset.idl=t.type,e.dataset.title=e.textContent,e.dataset.dfnFor=n,t.type){case"operation":case"attribute":case"field":e.dataset.type=zo(t)}switch(e.querySelector("code")||e.closest("code")||!e.children||gn(e,e.ownerDocument.createElement("code")),t.type){case"attribute":case"constructor":case"operation":!function(e,t){const{local:n,exportable:r}=t,s=e.dataset.lt?new Set(e.dataset.lt.split("|")):new Set;for(const e of r)s.add(e);n.filter((e=>s.has(e))).forEach((e=>s.delete(e))),e.dataset.lt=[...s].join("|"),e.dataset.localLt=n.join("|"),io(e,[...n,...r])}(e,function(e,t,n){const{type:r}=e,s=`${t}.${n}`;switch(r){case"constructor":case"operation":{const t=`${n}()`,r=`${s}()`,i=function(e,t){const n=[];if(0===t.length)return n;const r=[],s=[];for(const{name:e,optional:n,variadic:i}of t)n||i?s.push(e):r.push(e);const i=r.join(", "),o=`${e}(${i})`;n.push(o);const a=s.map(((t,n)=>{const i=[...r,...s.slice(0,n+1)].join(", ");return`${e}(${i})`}));return n.push(...a),n}(n,e.arguments);return{local:[s,r,n],exportable:[t,...i]}}case"attribute":return{local:[s],exportable:[n]}}}(t,n,r))}return e}function Mo(e,t,n,r){const s=so.get(e);if(!s||0===s.size)return[];const i=[...s],o=i.filter((e=>{if("dfn"===e.dataset.dfnType)return!1;const n=e.closest("[data-dfn-for]");return n&&n.dataset.dfnFor===t}));if(0===o.length&&""===t&&1===i.length)return i[0].textContent===n?i:[];if(Do.has(r)&&i.length){const e=i.find((e=>e.textContent.trim()===n));if(e)return[e]}return o}function zo(e={}){const{idlType:t,generic:n,union:r}=e;return void 0===t?"":"string"==typeof t?t:n||(r?t.map(zo).join("|"):zo(t))}const Uo=function(){const e=document.createElement("button");return e.innerHTML='<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>',e.title="Copy IDL to clipboard",e.classList.add("respec-button-copy-paste","removeOnSave"),e}();function qo(e){const t=e.closest("pre.idl").cloneNode(!0);t.querySelector(".idlHeader").remove();const{textContent:n}=t,r=Uo.cloneNode(!0);r.addEventListener("click",(()=>{navigator.clipboard.writeText(n)})),e.append(r)}var Wo=Object.freeze({__proto__:null,addCopyIDLButton:qo,name:"core/webidl-clipboard"});var Fo=String.raw`pre.idl{padding:1em;position:relative} pre.idl>code{color:#000} @media print{ pre.idl{white-space:pre-wrap} @@ -946,9 +946,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=Pn`See ${"using `data-dfn-for`|#data-dfn-for"} in ReSpec's documentation.`;Rn(`Missing \`<dfn>\` for${r?` \`${r}\`'s`:""} \`${"operation"===t.type?`${s}()`:s}\` ${t.type}.`,Ho,{elements:[c],hint:e})}return c}const Zo=new WeakMap;function Jo(e,t=""){if(Zo.has(e))return Zo.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"";Vo[e.name]||(Vo[e.name]=0);return Vo[e.name]+=1,`-partial-${Vo[e.name]}`}(e);break;case"constructor":case"operation":{const s=function(e,t){const n=`${t}.${e}`,r=`${n}()`;let s;Go[r]||(Go[r]=0);Go[n]?s=`!overload-${Go[n]}`:Go[n]=0;return Go[r]+=1,Go[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 Zo.set(e,n),n}const Xo=["interface","interface mixin","dictionary","namespace","enum","typedef","callback"];function Qo(e,t){let n;try{n=qt.parse(e.textContent,{sourceName:String(t)})}catch(t){return Sn(`Failed to parse WebIDL: ${t.bareMessage}.`,Ho,{title:t.bareMessage,details:`<pre>${t.context}</pre>`,elements:[e]}),[]}e.classList.add("def","idl");const r=qt.write(n,{templates:Yo});Nt.bind(e)`${r}`,gn(e,document.createElement("code")),e.querySelectorAll("[data-idl]").forEach((e=>{if(e.dataset.dfnFor)return;const t=e.dataset.title,n=e.dataset.dfnType,r=e.parentElement.closest("[data-idl][data-title]");r&&!Xo.includes(n)&&(e.dataset.dfnFor=r.dataset.title),"dfn"===e.localName&&io(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){dn(e,"webidl");const t=Nt`<span class="idlHeader" + >`;if(s&&"typedef"!==t.type&&!(t.partial&&!i)){const e=Pn`See ${"using `data-dfn-for`|#data-dfn-for"} in ReSpec's documentation.`;Rn(`Missing \`<dfn>\` for${r?` \`${r}\`'s`:""} \`${"operation"===t.type?`${s}()`:s}\` ${t.type}.`,Ho,{elements:[c],hint:e})}return c}const Zo=new WeakMap;function Jo(e,t=""){if(Zo.has(e))return Zo.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"";Vo[e.name]||(Vo[e.name]=0);return Vo[e.name]+=1,`-partial-${Vo[e.name]}`}(e);break;case"constructor":case"operation":{const s=function(e,t){const n=`${t}.${e}`,r=`${n}()`;let s;Go[r]||(Go[r]=0);Go[n]?s=`!overload-${Go[n]}`:Go[n]=0;return Go[r]+=1,Go[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 Zo.set(e,n),n}const Xo=["interface","interface mixin","dictionary","namespace","enum","typedef","callback"];function Qo(e,t){let n;try{n=Ut.parse(e.textContent,{sourceName:String(t)})}catch(t){return Sn(`Failed to parse WebIDL: ${t.bareMessage}.`,Ho,{title:t.bareMessage,details:`<pre>${t.context}</pre>`,elements:[e]}),[]}e.classList.add("def","idl");const r=Ut.write(n,{templates:Yo});Nt.bind(e)`${r}`,gn(e,document.createElement("code")),e.querySelectorAll("[data-idl]").forEach((e=>{if(e.dataset.dfnFor)return;const t=e.dataset.title,n=e.dataset.dfnType,r=e.parentElement.closest("[data-idl][data-title]");r&&!Xo.includes(n)&&(e.dataset.dfnFor=r.dataset.title),"dfn"===e.localName&&io(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){dn(e,"webidl");const t=Nt`<span class="idlHeader" ><a class="self-link" href="${`#${e.id}`}">WebIDL</a></span - >`;e.prepend(t),Uo(t)}var ta=Object.freeze({__proto__:null,addIDLHeader:ea,name:Bo,run:async function(){const e=document.querySelectorAll("pre.idl, pre.webidl");if(!e.length)return;const t=document.createElement("style");t.textContent=Fo,document.querySelector("head link, head > *:last-child").before(t);const n=[...e].map(Qo),r=qt.validate(n);for(const t of r){let r=`<pre>${tn(t.context)}</pre>`;if(t.autofix){t.autofix();r+=`Try fixing as:\n <pre>${tn(qt.write(n[t.sourceName]))}</pre>`}Sn(`WebIDL validation error: ${t.bareMessage}`,Ho,{details:r,elements:[e[t.sourceName]],title:t.bareMessage})}document.normalize()}});const na="core/data-cite",ra="__SPEC__";async function sa(e){const{key:t,frag:n,path:r,href:s}=e;let i="",o="";if(t===ra)i=document.location.href;else{const e=await yi(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 ia(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?gn(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){Sn("Exporting an linked external definition is not allowed.",na,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function oa(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const aa=oa("#"),ca=oa("/");function la(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?la(r):{key:ra,isNormative:!1};return t.cite=i?s:`?${s}`,t.citeFrag=n.replace("#",""),la(e)}const o=r?`#${r}`:aa(n),a=s||ca(n).split("#")[0],{type:c}=mn(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 ua(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 da=Object.freeze({__proto__:null,THIS_SPEC:ra,name:na,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(la).map((async e=>({entry:e,result:await yi(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await bi(n);r&&Object.assign(pi,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=la(t),r=await sa(n);if(r)ia(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),Rn(n,na,{elements:[t]})}}s("beforesave",ua)},toCiteDetails:la});const pa="core/link-to-dfn",fa=[],ha={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:"在文档中有重复的定义。"}},ma=rn(ha);function ga(e){const t=new Map,n=[];for(const r of so.get(e)){const{dfnType:s="dfn"}=r.dataset,i=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const o of i){if(t.has(o)&&t.get(o).has(s)){const e=t.get(o).get(s),i="dfn"===e.localName,a="dfn"===r.localName,c=s===(e.dataset.dfnType||"dfn"),l=!o&&!e.dataset.dfnFor||e.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(o);if(i&&a&&c&&l){n.push(r);continue}}t.has(o)||t.set(o,new Map),t.get(o).set(s,r),("idl"in r.dataset||"dfn"!==s)&&t.get(o).set("idl",r),pn(r,"dfn",e)}}return{result:t,duplicates:n}}function ba(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"",r=fn(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}),[]);return r}(e),r=n.find((e=>t.has(e.title)&&t.get(e.title).has(e.for)));if(!r)return;const s=t.get(r.title).get(r.for),{linkType:i}=e.dataset;if(i)return s.get(i)||s.get("dfn");{const e=r.for?"idl":"dfn";return s.get(e)||s.get("idl")}}function ya(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)&&i&&!i.split(",").map((e=>e.trim())).includes(s))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=wa(e)&&wa(t,n);r&&!s||gn(e,document.createElement("code"))}(e,t),!r}function wa(e,t=""){if("a"===e.localName){if(!e.querySelector("code"))return!0}else{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 va(e){e.forEach((e=>{Rn(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,pa,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var $a=Object.freeze({__proto__:null,name:pa,possibleExternalLinks:fa,run:async function(e){const t=function(){const e=new _n;for(const t of so.keys()){const{result:n,duplicates:r}=ga(t);e.set(t,n),r.length>0&&Sn(ma.duplicateMsg(t),pa,{title:ma.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){if(!e.dataset?.linkType&&e.dataset?.xrefType){fa.push(e);continue}const r=ba(e,t);if(r){ya(e,r,t)||fa.push(e)}else""===e.dataset.cite?n.push(e):fa.push(e)}va(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}=la(t);r!==ra&&(s||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||va(fa)}});const ka="xrefs",xa=3e5;async function _a(){return await Ot.openDB("xref",2,{upgrade(e){[...e.objectStoreNames].forEach((t=>e.deleteObjectStore(t)));e.createObjectStore(ka,{keyPath:"query.id"}).createIndex("byTerm","query.term",{unique:!1})}})}async function Ca(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<xa)return!1;const r=new URL("meta/version",Ea).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 _a().then((e=>e.clear(ka)))}catch(e){console.error(e)}}(),t;const n=new Set(e.map((e=>e.id)));try{const e=await _a();let r=await e.transaction(ka).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 Sa="core/xref",Ra={"web-platform":["HTML","INFRA","URL","WEBIDL","DOM","FETCH"]},Ea="https://respec.org/xref/",Aa=[];if(!document.querySelector("link[rel='preconnect'][href='https://respec.org']")){const e=Yt({hint:"preconnect",href:"https://respec.org"});document.head.appendChild(e)}function Ta(e){const t="xrefType"in e.dataset;let n=La(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 nn(e.dataset.xrefFor);if(t){const t=e.closest("[data-xref-for]");if(t)return nn(t.dataset.xrefFor)}return null}(e,t);return{id:"",term:n,types:s,...r.length&&{specs:r},..."string"==typeof i&&{for:i}}}function La(e){const{lt:t}=e.dataset;let n=t?t.split("|",1)[0]:e.textContent;return n=nn(n),"the-empty-string"===n?"":n}function Pa(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(Vt);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)}Aa.push({term:r,spec:t,element:e})}(e,p,l,s,r)}function Ia(e){const t=JSON.stringify(e,Object.keys(e).sort()),n=(new TextEncoder).encode(t);return crypto.subtle.digest("SHA-1",n).then(Da)}function Da(e){return[...new Uint8Array(e)].map((e=>e.toString(16).padStart(2,"0"))).join("")}function Na(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 Oa=Object.freeze({__proto__:null,API_URL:Ea,getTermFromElement:La,informativeRefsInNormative:Aa,name:Sa,run:async function(e){if(!e.xref)return;const t=function(e){const t={url:Ea,specs:null},n=Object.assign({},t);switch(Array.isArray(e)?"array":typeof e){case"boolean":break;case"string":e.toLowerCase()in Ra?Object.assign(n,{specs:Ra[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 Ra){const r=(e.specs??[]).concat(Ra[t]);Object.assign(n,{specs:r})}else r(e.profile)}break;default:Sn(`Invalid value for \`xref\` configuration option. Received: "${e}".`,Sa)}return n;function r(e){Sn(`Invalid profile "${e}" in \`respecConfig.xref\`. Please use one of the supported profiles: ${en(Object.keys(Ra),(e=>`"${e}"`))}.`,Sa)}}(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=fa.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=Ta(e);t.id=await Ia(t),r.push(t)}const i=await async function(e,t){const n=new Set,r=e.filter((e=>!n.has(e.id)&&(n.add(e.id)&&!0))),s=await Ca(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 _a()).transaction(ka,"readwrite");for(const r of e){const e=t.get(r.id);n.objectStore(ka).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)Pa(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(Ea);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)=>Pn`[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=La(s[0]),o=n(i,e),a=Qt(t,(e=>`**[${e}]**`)),c=r(o,i);Sn(`Couldn't find "**${i}**"${e.for?`, for **"${e.for}"**, `:""} in this document or other cited documents: ${a}.`,Sa,{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=Qt(e,(e=>`**[${e}]**`)),a=La(s[0]),c=n(a,t,e),l=t.for?`, for **"${t.for}"**, `:"",u=Pn`To fix, use the ${"[data-cite]"} attribute to pick the one you mean from the appropriate specification. ${r(c,a)}.`;Sn(`The term "**${a}**"${l} is ambiguous because it's defined in ${o}.`,Sa,{title:"Definition is ambiguous.",elements:s,hint:u})}}(s)}(n,r,i,e),s("beforesave",Na)}});var ja=String.raw`ul.index{columns:30ch;column-gap:1.5em} + >`;e.prepend(t),qo(t)}var ta=Object.freeze({__proto__:null,addIDLHeader:ea,name:Bo,run:async function(){const e=document.querySelectorAll("pre.idl, pre.webidl");if(!e.length)return;const t=document.createElement("style");t.textContent=Fo,document.querySelector("head link, head > *:last-child").before(t);const n=[...e].map(Qo),r=Ut.validate(n);for(const t of r){let r=`<pre>${tn(t.context)}</pre>`;if(t.autofix){t.autofix();r+=`Try fixing as:\n <pre>${tn(Ut.write(n[t.sourceName]))}</pre>`}Sn(`WebIDL validation error: ${t.bareMessage}`,Ho,{details:r,elements:[e[t.sourceName]],title:t.bareMessage})}document.normalize()}});const na="core/data-cite",ra="__SPEC__";async function sa(e){const{key:t,frag:n,path:r,href:s}=e;let i="",o="";if(t===ra)i=document.location.href;else{const e=await yi(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 ia(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?gn(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){Sn("Exporting an linked external definition is not allowed.",na,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function oa(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const aa=oa("#"),ca=oa("/");function la(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?la(r):{key:ra,isNormative:!1};return t.cite=i?s:`?${s}`,t.citeFrag=n.replace("#",""),la(e)}const o=r?`#${r}`:aa(n),a=s||ca(n).split("#")[0],{type:c}=mn(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 ua(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 da=Object.freeze({__proto__:null,THIS_SPEC:ra,name:na,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(la).map((async e=>({entry:e,result:await yi(e.key)}))),n=(await Promise.all(t)).filter((({result:e})=>null===e)).map((({entry:{key:e}})=>e)),r=await bi(n);r&&Object.assign(pi,r)}([...e]);for(const t of e){const e=t.dataset.cite,n=la(t),r=await sa(n);if(r)ia(t,r,n);else{const n=`Couldn't find a match for "${e}"`;t.dataset.matchedText&&(t.textContent=t.dataset.matchedText),Rn(n,na,{elements:[t]})}}s("beforesave",ua)},toCiteDetails:la});const pa="core/link-to-dfn",fa=[],ha={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:"在文档中有重复的定义。"}},ma=rn(ha);function ga(e){const t=new Map,n=[];for(const r of so.get(e)){const{dfnType:s="dfn"}=r.dataset,i=r.dataset.dfnFor?.split(",").map((e=>e.trim()))??[""];for(const o of i){if(t.has(o)&&t.get(o).has(s)){const e=t.get(o).get(s),i="dfn"===e.localName,a="dfn"===r.localName,c=s===(e.dataset.dfnType||"dfn"),l=!o&&!e.dataset.dfnFor||e.dataset.dfnFor?.split(",").map((e=>e.trim())).includes(o);if(i&&a&&c&&l){n.push(r);continue}}t.has(o)||t.set(o,new Map),t.get(o).set(s,r),("idl"in r.dataset||"dfn"!==s)&&t.get(o).set("idl",r),pn(r,"dfn",e)}}return{result:t,duplicates:n}}function ba(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor:"",r=fn(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}),[]);return r}(e),r=n.find((e=>t.has(e.title)&&t.get(e.title).has(e.for)));if(!r)return;const s=t.get(r.title).get(r.for),{linkType:i}=e.dataset;if(i)return s.get(i)||s.get("dfn");{const e=r.for?"idl":"dfn";return s.get(e)||s.get("idl")}}function ya(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)&&i&&!i.split(",").map((e=>e.trim())).includes(s))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=wa(e)&&wa(t,n);r&&!s||gn(e,document.createElement("code"))}(e,t),!r}function wa(e,t=""){if("a"===e.localName){if(!e.querySelector("code"))return!0}else{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 va(e){e.forEach((e=>{Rn(`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,pa,{title:"Linking error: not matching `<dfn>`",elements:[e]})}))}var $a=Object.freeze({__proto__:null,name:pa,possibleExternalLinks:fa,run:async function(e){const t=function(){const e=new _n;for(const t of so.keys()){const{result:n,duplicates:r}=ga(t);e.set(t,n),r.length>0&&Sn(ma.duplicateMsg(t),pa,{title:ma.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){if(!e.dataset?.linkType&&e.dataset?.xrefType){fa.push(e);continue}const r=ba(e,t);if(r){ya(e,r,t)||fa.push(e)}else""===e.dataset.cite?n.push(e):fa.push(e)}va(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}=la(t);r!==ra&&(s||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||va(fa)}});const ka="xrefs",xa=3e5;async function _a(){return await Ot.openDB("xref",2,{upgrade(e){[...e.objectStoreNames].forEach((t=>e.deleteObjectStore(t)));e.createObjectStore(ka,{keyPath:"query.id"}).createIndex("byTerm","query.term",{unique:!1})}})}async function Ca(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<xa)return!1;const r=new URL("meta/version",Ea).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 _a().then((e=>e.clear(ka)))}catch(e){console.error(e)}}(),t;const n=new Set(e.map((e=>e.id)));try{const e=await _a();let r=await e.transaction(ka).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 Sa="core/xref",Ra={"web-platform":["HTML","INFRA","URL","WEBIDL","DOM","FETCH"]},Ea="https://respec.org/xref/",Aa=[];if(!document.querySelector("link[rel='preconnect'][href='https://respec.org']")){const e=Yt({hint:"preconnect",href:"https://respec.org"});document.head.appendChild(e)}function Ta(e){const t="xrefType"in e.dataset;let n=La(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 nn(e.dataset.xrefFor);if(t){const t=e.closest("[data-xref-for]");if(t)return nn(t.dataset.xrefFor)}return null}(e,t);return{id:"",term:n,types:s,...r.length&&{specs:r},..."string"==typeof i&&{for:i}}}function La(e){const{lt:t}=e.dataset;let n=t?t.split("|",1)[0]:e.textContent;return n=nn(n),"the-empty-string"===n?"":n}function Pa(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(Vt);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)}Aa.push({term:r,spec:t,element:e})}(e,p,l,s,r)}function Ia(e){const t=JSON.stringify(e,Object.keys(e).sort()),n=(new TextEncoder).encode(t);return crypto.subtle.digest("SHA-1",n).then(Da)}function Da(e){return[...new Uint8Array(e)].map((e=>e.toString(16).padStart(2,"0"))).join("")}function Na(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 Oa=Object.freeze({__proto__:null,API_URL:Ea,getTermFromElement:La,informativeRefsInNormative:Aa,name:Sa,run:async function(e){if(!e.xref)return;const t=function(e){const t={url:Ea,specs:null},n=Object.assign({},t);switch(Array.isArray(e)?"array":typeof e){case"boolean":break;case"string":e.toLowerCase()in Ra?Object.assign(n,{specs:Ra[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 Ra){const r=(e.specs??[]).concat(Ra[t]);Object.assign(n,{specs:r})}else r(e.profile)}break;default:Sn(`Invalid value for \`xref\` configuration option. Received: "${e}".`,Sa)}return n;function r(e){Sn(`Invalid profile "${e}" in \`respecConfig.xref\`. Please use one of the supported profiles: ${en(Object.keys(Ra),(e=>`"${e}"`))}.`,Sa)}}(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=fa.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=Ta(e);t.id=await Ia(t),r.push(t)}const i=await async function(e,t){const n=new Set,r=e.filter((e=>!n.has(e.id)&&(n.add(e.id)&&!0))),s=await Ca(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 _a()).transaction(ka,"readwrite");for(const r of e){const e=t.get(r.id);n.objectStore(ka).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)Pa(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(Ea);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)=>Pn`[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=La(s[0]),o=n(i,e),a=Qt(t,(e=>`**[${e}]**`)),c=r(o,i);Sn(`Couldn't find "**${i}**"${e.for?`, for **"${e.for}"**, `:""} in this document or other cited documents: ${a}.`,Sa,{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=Qt(e,(e=>`**[${e}]**`)),a=La(s[0]),c=n(a,t,e),l=t.for?`, for **"${t.for}"**, `:"",u=Pn`To fix, use the ${"[data-cite]"} attribute to pick the one you mean from the appropriate specification. ${r(c,a)}.`;Sn(`The term "**${a}**"${l} is ambiguous because it's defined in ${o}.`,Sa,{title:"Definition is ambiguous.",elements:s,hint:u})}}(s)}(n,r,i,e),s("beforesave",Na)}});var ja=String.raw`ul.index{columns:30ch;column-gap:1.5em} ul.index li{list-style:inherit} ul.index li span{color:inherit;cursor:pointer;white-space:normal} #index-defined-here ul.index li{font-size:.9rem} @@ -956,22 +956,22 @@ ul.index code{color:inherit} #index-defined-here .print-only{display:none} @media print{ #index-defined-here .print-only{display:initial} -}`;const za=rn({en:{heading:"Index",headingExternal:"Terms defined by reference",headlingLocal:"Terms defined by this specification",dfnOf:"definition of"}}),Ma=new Set(["attribute","callback","dict-member","dictionary","element-attr","element","enum-value","enum","exception","extended-attribute","interface","method","typedef"]);function qa(e){const t=e.dataset,n=t.dfnType||t.idl||t.linkType||"";switch(n){case"":case"dfn":return"";default:return n}}function Ua(e){const t=e.closest("[data-dfn-for]:not([data-dfn-for=''])");return t?t.dataset.dfnFor:""}function Wa(e,t,n=""){if(n.startsWith("[[")){return`internal slot for <code>${Ua(e)}</code>`}switch(t){case"dict-member":case"method":case"attribute":case"enum-value":return`${"dict-member"===t?"member":t.replace("-"," ")} for <code>${Ua(e)}</code>`;case"interface":case"dictionary":case"enum":return t;case"constructor":return`for <code>${Ua(e)}</code>`;default:return""}}function Fa(){document.querySelectorAll("#index-defined-here li[data-id]").forEach((e=>e.append((e=>{const t=`§${document.getElementById(e).closest("section").querySelector(".secno").textContent.trim()}`;return Nt`<span class="print-only">${t}</span>`})(e.dataset.id))))}function Ba(){const e=new Set,t=new Map,n=document.querySelectorAll("a[data-cite]");for(const r of n){if(!r.dataset.cite)continue;const n=r.href;if(e.has(n))continue;const{type:s,linkFor:i}=r.dataset,o=La(r);if(!o)continue;const a=la(r).key.toUpperCase();(t.get(a)||t.set(a,[]).get(a)).push({term:o,type:s,linkFor:i,elem:r}),e.add(n)}return t}function Ha(e){const{elem:t}=e,n=function(e){const{term:t,type:n,linkFor:r}=e;let s=t;Ma.has(n)&&("extended-attribute"===n&&(s=`[${s}]`),s=`<code>${s}</code>`);const i=Va.has(t)?"type":Ga.get(n);i&&(s+=` ${i}`);if(r){let e=r;/\s/.test(r)||(e=`<code>${e}</code>`),"element-attr"===n&&(e+=" element"),s+=` (for ${e})`}return s}(e);return Nt`<li> +}`;const Ma=rn({en:{heading:"Index",headingExternal:"Terms defined by reference",headlingLocal:"Terms defined by this specification",dfnOf:"definition of"}}),za=new Set(["attribute","callback","dict-member","dictionary","element-attr","element","enum-value","enum","exception","extended-attribute","interface","method","typedef"]);function Ua(e){const t=e.dataset,n=t.dfnType||t.idl||t.linkType||"";switch(n){case"":case"dfn":return"";default:return n}}function qa(e){const t=e.closest("[data-dfn-for]:not([data-dfn-for=''])");return t?t.dataset.dfnFor:""}function Wa(e,t,n=""){if(n.startsWith("[[")){return`internal slot for <code>${qa(e)}</code>`}switch(t){case"dict-member":case"method":case"attribute":case"enum-value":return`${"dict-member"===t?"member":t.replace("-"," ")} for <code>${qa(e)}</code>`;case"interface":case"dictionary":case"enum":return t;case"constructor":return`for <code>${qa(e)}</code>`;default:return""}}function Fa(){document.querySelectorAll("#index-defined-here li[data-id]").forEach((e=>e.append((e=>{const t=`§${document.getElementById(e).closest("section").querySelector(".secno").textContent.trim()}`;return Nt`<span class="print-only">${t}</span>`})(e.dataset.id))))}function Ba(){const e=new Set,t=new Map,n=document.querySelectorAll("a[data-cite]");for(const r of n){if(!r.dataset.cite)continue;const n=r.href;if(e.has(n))continue;const{type:s,linkFor:i}=r.dataset,o=La(r);if(!o)continue;const a=la(r).key.toUpperCase();(t.get(a)||t.set(a,[]).get(a)).push({term:o,type:s,linkFor:i,elem:r}),e.add(n)}return t}function Ha(e){const{elem:t}=e,n=function(e){const{term:t,type:n,linkFor:r}=e;let s=t;za.has(n)&&("extended-attribute"===n&&(s=`[${s}]`),s=`<code>${s}</code>`);const i=Va.has(t)?"type":Ga.get(n);i&&(s+=` ${i}`);if(r){let e=r;/\s/.test(r)||(e=`<code>${e}</code>`),"element-attr"===n&&(e+=" element"),s+=` (for ${e})`}return s}(e);return Nt`<li> <span class="index-term" data-href="${t.href}">${{html:n}}</span> - </li>`}const Ga=new Map([["attribute","attribute"],["element-attr","attribute"],["element","element"],["enum","enum"],["exception","exception"],["extended-attribute","extended attribute"],["interface","interface"]]),Va=new Set(["boolean","byte","octet","short","unsigned short","long","unsigned long","long long","unsigned long long","float","unrestricted float","double","unrestricted double","undefined","any","object","symbol"]);function Ya(e){e.querySelectorAll("#index-defined-elsewhere li[data-spec]").forEach((e=>e.removeAttribute("data-spec"))),e.querySelectorAll("#index-defined-here li[data-id]").forEach((e=>e.removeAttribute("data-id")))}var Ka=Object.freeze({__proto__:null,name:"core/dfn-index",run:function(){const e=document.querySelector("section#index");if(!e)return void s("toc",(()=>{}),{once:!0});const t=document.createElement("style");t.textContent=ja,document.head.appendChild(t),e.classList.add("appendix"),e.querySelector("h2, h1")||e.prepend(Nt`<h1>${za.heading}</h1>`);const n=Nt`<section id="index-defined-here"> - <h3>${za.headlingLocal}</h3> + </li>`}const Ga=new Map([["attribute","attribute"],["element-attr","attribute"],["element","element"],["enum","enum"],["exception","exception"],["extended-attribute","extended attribute"],["interface","interface"]]),Va=new Set(["boolean","byte","octet","short","unsigned short","long","unsigned long","long long","unsigned long long","float","unrestricted float","double","unrestricted double","undefined","any","object","symbol"]);function Ya(e){e.querySelectorAll("#index-defined-elsewhere li[data-spec]").forEach((e=>e.removeAttribute("data-spec"))),e.querySelectorAll("#index-defined-here li[data-id]").forEach((e=>e.removeAttribute("data-id")))}var Ka=Object.freeze({__proto__:null,name:"core/dfn-index",run:function(){const e=document.querySelector("section#index");if(!e)return void s("toc",(()=>{}),{once:!0});const t=document.createElement("style");t.textContent=ja,document.head.appendChild(t),e.classList.add("appendix"),e.querySelector("h2, h1")||e.prepend(Nt`<h1>${Ma.heading}</h1>`);const n=Nt`<section id="index-defined-here"> + <h3>${Ma.headlingLocal}</h3> ${function(){const e=function(){const e=new Map,t=document.querySelectorAll("dfn:not([data-cite])");for(const n of t){if(!n.id)continue;const t=nn(n.textContent);(e.get(t)||e.set(t,[]).get(t)).push(n)}return[...e].sort((([e],[t])=>e.slice(e.search(/\w/)).localeCompare(t.slice(t.search(/\w/)))))}();return Nt`<ul class="index"> ${e.map((([e,t])=>function(e,t){const n=(e,t,n)=>{const r=`#${e.id}`;return Nt`<li data-id=${e.id}> <a class="index-term" href="${r}">${{html:t}}</a> ${n?{html:n}:""} - </li>`};if(1===t.length){const r=t[0],s=qa(r),i=function(e,t,n){let r=n;"enum-value"===t&&(r=`"${r}"`);(Ma.has(t)||e.dataset.idl||e.closest("code"))&&(r=`<code>${r}</code>`);return r}(r,s,e),o=Wa(r,s,e);return n(r,i,o)}return Nt`<li> + </li>`};if(1===t.length){const r=t[0],s=Ua(r),i=function(e,t,n){let r=n;"enum-value"===t&&(r=`"${r}"`);(za.has(t)||e.dataset.idl||e.closest("code"))&&(r=`<code>${r}</code>`);return r}(r,s,e),o=Wa(r,s,e);return n(r,i,o)}return Nt`<li> ${e} <ul> - ${t.map((t=>{const r=Wa(t,qa(t),e)||za.dfnOf;return n(t,r)}))} + ${t.map((t=>{const r=Wa(t,Ua(t),e)||Ma.dfnOf;return n(t,r)}))} </ul> </li>`}(e,t)))} </ul>`}()} </section>`;e.append(n);const r=Nt`<section id="index-defined-elsewhere"> - <h3>${za.headingExternal}</h3> + <h3>${Ma.headingExternal}</h3> ${function(){const e=[...Ba().entries()].sort((([e],[t])=>e.localeCompare(t)));return Nt`<ul class="index"> ${e.map((([e,t])=>Nt`<li data-spec="${e}"> ${Ri(e)} defines the following: @@ -1077,7 +1077,7 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666)} `;dr.freshModal(Lc.search_specref,e,Pc)}),"Ctrl+Shift+Alt+space","🔎");var Ic=Object.freeze({__proto__:null});const Dc="https://respec.org/xref/",Nc=rn({en:{title:"Search definitions"},ja:{title:"定義検索"},de:{title:"Definitionen durchsuchen"},zh:{title:"搜索定义"}}),Oc=dr.addCommand(Nc.title,(function(){const e=Nt` <iframe class="respec-iframe" src="${Dc}" onload="${e=>e.target.classList.add("ready")}"></iframe> <a href="${Dc}" target="_blank">Open Search UI in a new tab</a> - `;dr.freshModal(Nc.title,e,Oc)}),"Ctrl+Shift+Alt+x","📚");var jc=Object.freeze({__proto__:null});const zc=rn({en:{about_respec:"About"},zh:{about_respec:"关于"},nl:{about_respec:"Over"},ja:{about_respec:"これについて"},de:{about_respec:"Über"}});window.respecVersion=window.respecVersion||"Developer Edition";const Mc=document.createElement("div"),qc=Nt.bind(Mc),Uc=dr.addCommand(`${zc.about_respec} ${window.respecVersion}`,(function(){const e=[];"getEntriesByType"in performance&&performance.getEntriesByType("measure").sort(((e,t)=>t.duration-e.duration)).map((({name:e,duration:t})=>({name:e,duration:t>1e3?`${Math.round(t/1e3)} second(s)`:`${t.toFixed(2)} milliseconds`}))).map(Wc).forEach((t=>{e.push(t)}));qc` + `;dr.freshModal(Nc.title,e,Oc)}),"Ctrl+Shift+Alt+x","📚");var jc=Object.freeze({__proto__:null});const Mc=rn({en:{about_respec:"About"},zh:{about_respec:"关于"},nl:{about_respec:"Over"},ja:{about_respec:"これについて"},de:{about_respec:"Über"}});window.respecVersion=window.respecVersion||"Developer Edition";const zc=document.createElement("div"),Uc=Nt.bind(zc),qc=dr.addCommand(`${Mc.about_respec} ${window.respecVersion}`,(function(){const e=[];"getEntriesByType"in performance&&performance.getEntriesByType("measure").sort(((e,t)=>t.duration-e.duration)).map((({name:e,duration:t})=>({name:e,duration:t>1e3?`${Math.round(t/1e3)} second(s)`:`${t.toFixed(2)} milliseconds`}))).map(Wc).forEach((t=>{e.push(t)}));Uc` <p> ReSpec is a document production toolchain, with a notable focus on W3C specifications. </p> @@ -1101,7 +1101,7 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666)} </thead> <tbody>${e}</tbody> </table> -`,dr.freshModal(`${zc.about_respec} - ${window.respecVersion}`,Mc,Uc)}),"Ctrl+Shift+Alt+A","ℹ️");function Wc({name:e,duration:t}){return Nt` +`,dr.freshModal(`${Mc.about_respec} - ${window.respecVersion}`,zc,qc)}),"Ctrl+Shift+Alt+A","ℹ️");function Wc({name:e,duration:t}){return Nt` <tr> <td><a href="${`https://github.com/w3c/respec/blob/develop/src/${e}.js`}">${e}</a></td> <td>${t}</td> @@ -1117,7 +1117,7 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666)} .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 Xc(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 Qc=Yt({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(Qc);const el=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return Mu}))).default}catch{return Xc("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();t("core/worker",el.then((e=>({worker:e}))));const tl=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function nl(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:tl(),languages:t},r=await el;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(nl);document.head.appendChild(Nt`<style> +.hljs-link{text-decoration:underline}`;async function Xc(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 Qc=Yt({hint:"preload",href:"https://www.w3.org/Tools/respec/respec-highlight",as:"script"});document.head.appendChild(Qc);const el=async function(){const e=await async function(){try{return(await Promise.resolve().then((function(){return zu}))).default}catch{return Xc("worker/respec-worker.js")}}(),t=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Worker(t)}();t("core/worker",el.then((e=>({worker:e}))));const tl=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function nl(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:tl(),languages:t},r=await el;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(nl);document.head.appendChild(Nt`<style> ${Jc} </style>`),await Promise.all(n)}});const sl=rn({en:{missing_test_suite_uri:Pn`Found tests in your spec, but missing ${"[testSuiteURI]"} in your ReSpec config.`,tests:"tests",test:"test"},ja:{missing_test_suite_uri:Pn`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${"[testSuiteURI]"} が見つかりません.`,tests:"テスト",test:"テスト"},de:{missing_test_suite_uri:Pn`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${"[testSuiteURI]"} angegeben.`,tests:"Tests",test:"Test"},zh:{missing_test_suite_uri:Pn`本规范中包含测试,但在 ReSpec 配置中缺少 ${"[testSuiteURI]"}。`,tests:"测试",test:"测试"}}),il="core/data-tests";function ol(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 Nt` <li> @@ -1202,11 +1202,11 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var xl=Obje </div> `;return o}var Ol=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){document.head.insertBefore(Nt`<style> ${Dl} - </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(Nl(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 qu}))).default}catch{return Xc("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const jl="rs-changelog",zl=class extends HTMLElement{constructor(){super(),this.props={from:this.getAttribute("from"),to:this.getAttribute("to")||"HEAD",filter:"function"==typeof window[this.getAttribute("filter")]?window[this.getAttribute("filter")]:()=>!0}}connectedCallback(){const{from:e,to:t,filter:n}=this.props;Nt.bind(this)` + </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(Nl(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 Uu}))).default}catch{return Xc("./src/core/dfn-panel.runtime.js")}}(),document.body.append(n)}});const jl="rs-changelog",Ml=class extends HTMLElement{constructor(){super(),this.props={from:this.getAttribute("from"),to:this.getAttribute("to")||"HEAD",filter:"function"==typeof window[this.getAttribute("filter")]?window[this.getAttribute("filter")]:()=>!0}}connectedCallback(){const{from:e,to:t,filter:n}=this.props;Nt.bind(this)` <ul> - ${{any:Ml(e,t,n).then((e=>async function(e){const{repoURL:t}=await vs;return e.map((e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),s=`${t}commit/${e.hash}`,i=r&&Nt` (<a href="${r?`${t}pull/${r}`:null}">#${r}</a>)`;return Nt`<li><a href="${s}">${n.trim()}</a>${i}</li>`}))}(e))).catch((e=>Sn(e.message,jl,{elements:[this]}))).finally((()=>{this.dispatchEvent(new CustomEvent("done"))})),placeholder:"Loading list of commits..."}} + ${{any:zl(e,t,n).then((e=>async function(e){const{repoURL:t}=await vs;return e.map((e=>{const[n,r=null]=e.message.split(/\(#(\d+)\)/,2),s=`${t}commit/${e.hash}`,i=r&&Nt` (<a href="${r?`${t}pull/${r}`:null}">#${r}</a>)`;return Nt`<li><a href="${s}">${n.trim()}</a>${i}</li>`}))}(e))).catch((e=>Sn(e.message,jl,{elements:[this]}))).finally((()=>{this.dispatchEvent(new CustomEvent("done"))})),placeholder:"Loading list of commits..."}} </ul> - `}};async function Ml(e,t,n){let r;try{const s=await vs;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 ql=[Object.freeze({__proto__:null,element:zl,name:jl})];var Ul=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){ql.forEach((e=>{customElements.define(e.name,e.element)}));const e=ql.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 Wl=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(Nt`<meta + `}};async function zl(e,t,n){let r;try{const s=await vs;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 Ul=[Object.freeze({__proto__:null,element:Ml,name:jl})];var ql=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){Ul.forEach((e=>{customElements.define(e.name,e.element)}));const e=Ul.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 Wl=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(Nt`<meta name="monetization" content="${r}" class="${s}" @@ -1228,5 +1228,5 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var xl=Obje * Add a \`class="lint-ignore"\` attribute to the link. * Use a local normative proxy for the definition à la \`<dfn data-cite="spec">term</dfn>\` - To silence this warning entirely, set \`lint: { "${Nu}": false }\` in your \`respecConfig\`.`}}});var zu=Object.freeze({__proto__:null,name:Ou,run:function(e){if(!e.lint?.[Nu])return;const t="error"===e.lint[Nu]?Sn:Rn;Aa.forEach((({term:e,spec:n,element:r})=>{r.classList.contains("lint-ignore")||t(ju.msg(e,n),Ou,{title:"Normative reference to non-normative term.",elements:[r],hint:ju.hint})}))}}),Mu=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'}),qu=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})()'})}(); + To silence this warning entirely, set \`lint: { "${Nu}": false }\` in your \`respecConfig\`.`}}});var Mu=Object.freeze({__proto__:null,name:Ou,run:function(e){if(!e.lint?.[Nu])return;const t="error"===e.lint[Nu]?Sn:Rn;Aa.forEach((({term:e,spec:n,element:r})=>{r.classList.contains("lint-ignore")||t(ju.msg(e,n),Ou,{title:"Normative reference to non-normative term.",elements:[r],hint:ju.hint})}))}}),zu=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'}),Uu=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 fb7346a2a3..1cefc0eff2 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/pubsubhub.js","../src/core/include-config.js","../src/core/l10n.js","../node_modules/idb/build/wrap-idb-value.js","../node_modules/idb/build/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/reindent.js","../src/core/utils.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/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/core/github.js","../src/core/sections.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/tables.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/styles/dfn-index.css.js","../src/core/dfn-index.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/webidl-index.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/datatype.css.js","../src/core/data-type.js","../src/styles/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/core/web-monetization.js","../src/core/before-save.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-captionless-tables.js","../src/core/linter-rules/no-unused-dfns.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/w3c/linter-rules/required-sections.js","../src/core/linter-rules/wpt-tests-exist.js","../src/core/linter-rules/no-http-props.js","../src/core/linter-rules/a11y.js","../src/core/linter-rules/informative-dfn.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/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\nimport { expose } from \"./expose-modules.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.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, options = { once: false }) {\n const listener = e => cb(e.detail);\n subscriptions.addEventListener(topic, listener, options);\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/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), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\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', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\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 * @property {string} [ruleName]\n *\n * @typedef {ReturnType<typeof error>} WebIDLErrorData\n *\n * @param {string} message error message\n * @param {*} position\n * @param {*} current\n * @param {*} 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 /**\n * @param {import(\"./tokeniser.js\").Token[]} inputs\n * @param {object} [options]\n * @param {boolean} [options.precedes]\n * @returns\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","export 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","/**\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","export 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","import { Base } from \"./base.js\";\nimport { unescape } from \"./helpers.js\";\n\nexport class WrappedToken extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} type\n */\n static parser(tokeniser, type) {\n return () => {\n const value = tokeniser.consumeKind(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 /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.wrap([\n w.token(this.tokens.value),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\nexport class Eof extends WrappedToken {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const value = tokeniser.consumeKind(\"eof\");\n if (value) {\n return new Eof({ source: tokeniser.source, tokens: { value } });\n }\n }\n\n get type() {\n return \"eof\";\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.js\").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 .../** @type {[string, string][]} */ (\n shouldBeLegacyPrefixed.map((name) => [name, `Legacy${name}`])\n ),\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.js\").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\nexport class ExtendedAttributeParameters extends Base {\n /**\n * @param {import(\"../tokeniser.js\").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 ret.list = [];\n if (tokens.assign) {\n tokens.asterisk = tokeniser.consume(\"*\");\n if (tokens.asterisk) {\n return ret.this;\n }\n tokens.secondaryName = tokeniser.consumeKind(...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 (tokens.assign && !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 (\n this.tokens.assign && !this.tokens.asterisk && !this.tokens.secondaryName\n );\n }\n\n get rhsType() {\n if (this.rhsIsList) {\n return this.list[0].tokens.value.type + \"-list\";\n }\n if (this.tokens.asterisk) {\n return \"*\";\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 const { rhsType } = this;\n return w.ts.wrap([\n w.token(this.tokens.assign),\n w.token(this.tokens.asterisk),\n w.reference_token(this.tokens.secondaryName, this.parent),\n w.token(this.tokens.open),\n ...this.list.map((p) => {\n return rhsType === \"identifier-list\"\n ? w.identifier(p, this.parent)\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.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const name = tokeniser.consumeKind(\"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 : this.params.tokens.secondaryName\n ? unescape(tokens.secondaryName.value)\n : null;\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/whatwg/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/whatwg/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.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const tokens = {};\n tokens.open = tokeniser.consume(\"[\");\n const ret = new ExtendedAttributes({ source: tokeniser.source, tokens });\n if (!tokens.open) return ret;\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(\n \"Expected a closing token for the extended attribute list\"\n );\n if (!ret.length) {\n tokeniser.unconsume(tokens.close.index);\n tokeniser.error(\"An extended attribute list must not be empty\");\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.js\").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.js\").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.js\").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.consumeKind(\"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.js\").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.js\").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({ source, tokens: {} });\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/whatwg/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 {\n unescaped: /** @type {string} (because it's not union) */ (\n this.idlType\n ),\n context: this,\n }\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.js\").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.consumeKind(\"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","import { 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.js\").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.consumeKind(\"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 ...firstToken,\n type: \"optional\",\n value: \"optional\",\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.consumeKind(\"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","import { 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.consumeKind(\"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.js\").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.js\").Tokeniser} tokeniser\n */\nexport function const_value(tokeniser) {\n return (\n tokeniser.consumeKind(\"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.js\").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() || decimal_type();\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.js\").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.js\").Tokeniser} tokeniser\n * @param {string=} typeName (TODO: See Type.type for more details)\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.js\").Tokeniser} tokeniser\n * @param {string=} typeName (TODO: See Type.type for more details)\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.js\").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 {import(\"./interface.js\").Interface} def\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 {Record<string | symbol, any>} 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 const proxy = new Proxy(data, {\n get(target, p) {\n const value = target[p];\n if (Array.isArray(value) && p !== \"source\") {\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 // @ts-ignore https://github.com/microsoft/TypeScript/issues/47357\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 return proxy;\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 \"BigInt64Array\",\n \"BigUint64Array\",\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];\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 line,\n index,\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 probeKind(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.probeKind(\"inline\") && this.source[this.position].value === value\n );\n }\n\n /**\n * @param {...string} candidates\n */\n consumeKind(...candidates) {\n for (const type of candidates) {\n if (!this.probeKind(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.probeKind(\"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 {string} value\n */\n consumeIdentifier(value) {\n if (!this.probeKind(\"identifier\")) {\n return;\n }\n if (this.source[this.position].value !== value) {\n return;\n }\n return this.consumeKind(\"identifier\");\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\nexport class EnumValue extends WrappedToken {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const value = tokeniser.consumeKind(\"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.js\").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.consumeKind(\"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.probeKind(\"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","import { Base } from \"./base.js\";\nimport { unescape } from \"./helpers.js\";\n\nexport class Includes extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const target = tokeniser.consumeKind(\"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.consumeKind(\"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.js\").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.consumeKind(\"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.consumeKind(\"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.consumeKind(\"identifier\") ||\n tokeniser.error(\"Inheritance lacks a type\");\n return { colon, inheritance };\n}\n\nexport class Container extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {*} instance TODO: This should be {T extends Container}, but see https://github.com/microsoft/TypeScript/issues/4628\n * @param {*} args\n */\n static parse(tokeniser, instance, { inheritable, allowedMembers }) {\n const { tokens, type } = instance;\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(`Missing name in ${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.consumeKind(\"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.consumeKind(\"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 ret = autoParenter(\n new IterableLike({ source: tokeniser.source, tokens: {} })\n );\n const { tokens } = ret;\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.js\").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 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.js\").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.js\").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 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 source: interfaceDef.source,\n tokens: {},\n });\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","import { validationError } from \"../error.js\";\n\n/**\n * @param {import(\"../validator.js\").Definitions} defs\n * @param {import(\"../productions/container.js\").Container} i\n */\nexport function* checkInterfaceMemberDuplication(defs, i) {\n const opNames = groupOperationNames(i);\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 const statics = additions.filter((a) => a.special === \"static\");\n const nonstatics = additions.filter((a) => a.special !== \"static\");\n yield* checkAdditions(statics, opNames.statics, ext, i);\n yield* checkAdditions(nonstatics, opNames.nonstatics, ext, i);\n statics.forEach((op) => opNames.statics.add(op.name));\n nonstatics.forEach((op) => opNames.nonstatics.add(op.name));\n }\n\n /**\n * @param {import(\"../productions/operation.js\").Operation[]} additions\n * @param {Set<string>} existings\n * @param {import(\"../productions/container.js\").Container} ext\n * @param {import(\"../productions/container.js\").Container} base\n */\n function* checkAdditions(additions, existings, ext, base) {\n for (const addition of additions) {\n const { name } = addition;\n if (name && existings.has(name)) {\n const isStatic = addition.special === \"static\" ? \"static \" : \"\";\n const message = `The ${isStatic}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 /**\n * @param {import(\"../productions/container.js\").Container} i\n * @returns {import(\"../productions/operation.js\").Operation[]}\n */\n function getOperations(i) {\n return i.members.filter(({ type }) => type === \"operation\");\n }\n\n /**\n * @param {import(\"../productions/container.js\").Container} i\n */\n function groupOperationNames(i) {\n const ops = getOperations(i);\n return {\n statics: new Set(\n ops.filter((op) => op.special === \"static\").map((op) => op.name)\n ),\n nonstatics: new Set(\n ops.filter((op) => op.special !== \"static\").map((op) => op.name)\n ),\n };\n }\n}\n","import { Container } from \"./container.js\";\nimport { Constant } from \"./constant.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Operation } from \"./operation.js\";\nimport { stringifier } from \"./helpers.js\";\n\nexport class Mixin extends Container {\n /**\n * @typedef {import(\"../tokeniser.js\").Token} Token\n *\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {Token} base\n * @param {object} [options]\n * @param {Token} [options.partial]\n */\n static parse(tokeniser, base, { partial } = {}) {\n const tokens = { partial, base };\n tokens.mixin = tokeniser.consume(\"mixin\");\n if (!tokens.mixin) {\n return;\n }\n return Container.parse(\n tokeniser,\n new Mixin({ source: tokeniser.source, tokens }),\n {\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.js\").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.consumeKind(\"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","import { Container } from \"./container.js\";\nimport { Field } from \"./field.js\";\n\nexport class Dictionary extends Container {\n /**\n * @param {import(\"../tokeniser.js\").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 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.js\").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 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","import { 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.js\").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 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\";\nimport { Eof } from \"./productions/token.js\";\n\n/**\n * @param {Tokeniser} tokeniser\n * @param {object} options\n * @param {boolean} [options.concrete]\n * @param {Function[]} [options.productions]\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 if (options.productions) {\n for (const production of options.productions) {\n const result = production(tokeniser);\n if (result) {\n return result;\n }\n }\n }\n\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 = Eof.parse(tokeniser);\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 * @param {Function[]} [options.productions]\n * @return {import(\"./productions/base.js\").Base[]}\n */\nexport function parse(str, options = {}) {\n const tokeniser = new Tokeniser(str);\n if (typeof options.sourceName !== \"undefined\") {\n // @ts-ignore (See Tokeniser.source in supplement.d.ts)\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 /**\n * @param {string} raw\n * @param {object} options\n * @param {string} [options.unescaped]\n * @param {import(\"./productions/base.js\").Base} [options.context]\n * @returns\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 /**\n * @param {import(\"./tokeniser.js\").Token} t\n * @param {Function} wrapper\n * @param {...any} args\n * @returns\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 return ts.wrap(ast.map((it) => it.write(w)));\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 {import(\"./productions/base.js\").Base[]} ast\n * @return {import(\"./error.js\").WebIDLErrorData[]} validation errors\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 v4.3.0 - a markdown parser\n * Copyright (c) 2011-2023, 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\nfunction getDefaults() {\n return {\n async: false,\n baseUrl: null,\n breaks: false,\n extensions: null,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n hooks: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: null,\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartypants: false,\n tokenizer: null,\n walkTokens: null,\n xhtml: false\n };\n}\n\nlet defaults = getDefaults();\n\nfunction changeDefaults(newDefaults) {\n defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape(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\n/**\n * @param {string} html\n */\nfunction unescape(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;\n\n/**\n * @param {string | RegExp} regex\n * @param {string} opt\n */\nfunction edit(regex, opt) {\n regex = typeof regex === 'string' ? regex : regex.source;\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;\n\n/**\n * @param {boolean} sanitize\n * @param {string} base\n * @param {string} href\n */\nfunction cleanUrl(sanitize, base, href) {\n if (sanitize) {\n let prot;\n try {\n prot = decodeURIComponent(unescape(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\n/**\n * @param {string} base\n * @param {string} href\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(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 = { exec: function noopTest() {} };\n\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n 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 // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) { cells.shift(); }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) { cells.pop(); }\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/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param {string} str\n * @param {string} c\n * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(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.slice(0, l - suffLen);\n}\n\nfunction findClosingBracket(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(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\n/**\n * @param {string} pattern\n * @param {number} count\n */\nfunction repeatString(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\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape(text)\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 */\nclass Tokenizer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\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().replace(this.rules.inline._escapes, '$1') : 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,\n tokens: this.lexer.inline(text)\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(/^ *>[ \\t]?/gm, '');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine,\n line, nextLine, rawLine, itemContents, endEarly;\n\n let bull = cap[1].trim();\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 bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n\n // Check if current bullet point can start a new List Item\n while (src) {\n endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n\n raw = cap[0];\n src = src.substring(raw.length);\n\n line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n nextLine = src.split('\\n', 1)[0];\n\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimLeft();\n } else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n\n blankLine = false;\n\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n\n // Check if following lines should be included in List Item\n while (src) {\n rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n } else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n\n itemContents += '\\n' + nextLine;\n }\n\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n } else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents\n });\n\n list.raw += raw;\n }\n\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimRight();\n list.items[list.items.length - 1].text = itemContents.trimRight();\n list.raw = list.raw.trimRight();\n\n const l = list.items.length;\n\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (i = 0; i < l; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n\n list.loose = hasMultipleLineBreaks;\n }\n }\n\n // Set all items to loose if list is loose\n if (list.loose) {\n for (i = 0; i < l; i++) {\n list.items[i].loose = true;\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 const token = {\n type: 'html',\n raw: cap[0],\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: cap[0]\n };\n if (this.options.sanitize) {\n const text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);\n token.type = 'paragraph';\n token.text = text;\n token.tokens = this.lexer.inline(text);\n }\n return token;\n }\n }\n\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\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]).map(c => { return { text: c }; }),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n rows: cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').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, j, k, row;\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.rows.length;\n for (i = 0; i < l; i++) {\n item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; });\n }\n\n // parse child tokens inside headers and cells\n\n // header child tokens\n l = item.header.length;\n for (j = 0; j < l; j++) {\n item.header[j].tokens = this.lexer.inline(item.header[j].text);\n }\n\n // cell child tokens\n l = item.rows.length;\n for (j = 0; j < l; j++) {\n row = item.rows[j];\n for (k = 0; k < row.length; k++) {\n row[k].tokens = this.lexer.inline(row[k].text);\n }\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 tokens: this.lexer.inline(cap[1])\n };\n }\n }\n\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\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 tokens: this.lexer.inline(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(cap[1])\n };\n }\n }\n\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n } else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n } else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n\n return {\n type: this.options.sanitize\n ? 'text'\n : 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n text: this.options.sanitize\n ? (this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape(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], this.lexer);\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) {\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], this.lexer);\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 const raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\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(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 tokens: this.lexer.inlineTokens(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(this.options.mangle ? mangle(cap[1]) : cap[1]);\n href = 'mailto:' + text;\n } else {\n text = escape(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(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(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n } else {\n href = cap[0];\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, smartypants) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0];\n } else {\n text = escape(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\n/**\n * Block-Level Grammar\n */\nconst block = {\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}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/,\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][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/,\n table: noopTest,\n lheading: /^((?:.|\\n(?!\\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|table| +\\n)[^\\n]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock._label = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nblock._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock.def = edit(block.def)\n .replace('label', block._label)\n .replace('title', block._title)\n .getRegex();\n\nblock.bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nblock.listItemStart = edit(/^( *)(bull) */)\n .replace('bull', block.bullet)\n .getRegex();\n\nblock.list = edit(block.list)\n .replace(/bull/g, block.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block.def.source + ')')\n .getRegex();\n\nblock._tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'\n + '|track|ul';\nblock._comment = /<!--(?!-?>)[\\s\\S]*?(?:-->|$)/;\nblock.html = edit(block.html, 'i')\n .replace('comment', block._comment)\n .replace('tag', block._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('|table', '')\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._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.blockquote = edit(block.blockquote)\n .replace('paragraph', block.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock.normal = { ...block };\n\n/**\n * GFM Block Grammar\n */\n\nblock.gfm = {\n ...block.normal,\n table: '^ *([^\\\\n ].*\\\\|.*)\\\\n' // Header\n + ' {0,3}(?:\\\\| *)?(:?-+:? *(?:\\\\| *:?-+:? *)*)(?:\\\\| *)?' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)' // Cells\n};\n\nblock.gfm.table = edit(block.gfm.table)\n .replace('hr', block.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._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.gfm.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('table', block.gfm.table) // interrupt paragraphs with table\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._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock.pedantic = {\n ...block.normal,\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', block._comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(block.normal._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n};\n\n/**\n * Inline-Level Grammar\n */\nconst inline = {\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)\\]\\[(ref)\\]/,\n nolink: /^!?\\[(ref)\\](?:\\[\\])?/,\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 orphan inside strong () Consume to delim (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._punctuation = '!\"#$%&\\'()+\\\\-.,/:;<=>?@\\\\[\\\\]`^{|}~';\ninline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();\n\n// sequences em should skip over [title](link), `code`, <html>\ninline.blockSkip = /\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>/g;\n// lookbehind is not available on Safari as of version 16\n// inline.escapedEmSt = /(?<=(?:^|[^\\\\)(?:\\\\[^])*)\\\\[*_]/g;\ninline.escapedEmSt = /(?:^|[^\\\\])(?:\\\\\\\\)*\\\\[*_]/g;\n\ninline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();\n\ninline.emStrong.lDelim = edit(inline.emStrong.lDelim)\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;\ninline.autolink = edit(inline.autolink)\n .replace('scheme', inline._scheme)\n .replace('email', inline._email)\n .getRegex();\n\ninline._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline.tag = edit(inline.tag)\n .replace('comment', inline._comment)\n .replace('attribute', inline._attribute)\n .getRegex();\n\ninline._label = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline._href = /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/;\ninline._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline.link = edit(inline.link)\n .replace('label', inline._label)\n .replace('href', inline._href)\n .replace('title', inline._title)\n .getRegex();\n\ninline.reflink = edit(inline.reflink)\n .replace('label', inline._label)\n .replace('ref', block._label)\n .getRegex();\n\ninline.nolink = edit(inline.nolink)\n .replace('ref', block._label)\n .getRegex();\n\ninline.reflinkSearch = edit(inline.reflinkSearch, 'g')\n .replace('reflink', inline.reflink)\n .replace('nolink', inline.nolink)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline.normal = { ...inline };\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline.pedantic = {\n ...inline.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._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline._label)\n .getRegex()\n};\n\n/**\n * GFM Inline Grammar\n */\n\ninline.gfm = {\n ...inline.normal,\n escape: edit(inline.escape).replace('])', '~|])').getRegex(),\n _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,\n url: /^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\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.gfm.url = edit(inline.gfm.url, 'i')\n .replace('email', inline.gfm._extended_email)\n .getRegex();\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\ninline.breaks = {\n ...inline.gfm,\n br: edit(inline.br).replace('{2,}', '*').getRegex(),\n text: edit(inline.gfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n};\n\n/**\n * smartypants text replacement\n * @param {string} text\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 * @param {string} text\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 */\nclass Lexer {\n constructor(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || defaults;\n this.options.tokenizer = this.options.tokenizer || new Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\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\n this.blockTokens(src, this.tokens);\n\n let next;\n while (next = this.inlineQueue.shift()) {\n this.inlineTokens(next.src, next.tokens);\n }\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n } else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n\n let token, 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({ lexer: 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.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n } else {\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' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 // 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 tokens.push(token);\n continue;\n }\n\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\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 (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else 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({ lexer: 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 (this.state.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 this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 this.state.top = true;\n return tokens;\n }\n\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\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 + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);\n 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({ lexer: 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)) {\n src = src.substring(token.raw.length);\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 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 (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 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 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 (!this.state.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({ lexer: 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, 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\n/**\n * Renderer\n */\nclass Renderer {\n constructor(options) {\n this.options = options || defaults;\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(code, true))\n + '</code></pre>\\n';\n }\n\n return '<pre><code class=\"'\n + this.options.langPrefix\n + escape(lang)\n + '\">'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n /**\n * @param {string} quote\n */\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n\n html(html) {\n return html;\n }\n\n /**\n * @param {string} text\n * @param {string} level\n * @param {string} raw\n * @param {any} slugger\n */\n heading(text, level, raw, slugger) {\n if (this.options.headerIds) {\n const id = this.options.headerPrefix + slugger.slug(raw);\n return `<h${level} id=\"${id}\">${text}</h${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 /**\n * @param {string} text\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 /**\n * @param {string} text\n */\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n\n /**\n * @param {string} header\n * @param {string} body\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 /**\n * @param {string} content\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 /**\n * span level renderer\n * @param {string} text\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n\n /**\n * @param {string} text\n */\n em(text) {\n return `<em>${text}</em>`;\n }\n\n /**\n * @param {string} text\n */\n codespan(text) {\n return `<code>${text}</code>`;\n }\n\n br() {\n return this.options.xhtml ? '<br/>' : '<br>';\n }\n\n /**\n * @param {string} text\n */\n del(text) {\n return `<del>${text}</del>`;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\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=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\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 */\nclass 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 */\nclass Slugger {\n constructor() {\n this.seen = {};\n }\n\n /**\n * @param {string} value\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 * @param {string} originalSlug\n * @param {boolean} isDryRun\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\n * 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\n/**\n * Parsing & Compiling\n */\nclass Parser {\n constructor(options) {\n this.options = options || defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new TextRenderer();\n this.slugger = new Slugger();\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({ parser: 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.header[j].tokens),\n { header: true, align: token.align[j] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n body = '';\n l2 = token.rows.length;\n for (j = 0; j < l2; j++) {\n row = token.rows[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].tokens),\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 === 'paragraph') {\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({ parser: 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\nclass Hooks {\n constructor(options) {\n this.options = options || defaults;\n }\n\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess'\n ]);\n\n /**\n * Process markdown before marked\n */\n preprocess(markdown) {\n return markdown;\n }\n\n /**\n * Process HTML after marked is finished\n */\n postprocess(html) {\n return html;\n }\n}\n\nfunction onError(silent, async, callback) {\n return (e) => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n\n if (silent) {\n const msg = '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n if (async) {\n return Promise.resolve(msg);\n }\n if (callback) {\n callback(null, msg);\n return;\n }\n return msg;\n }\n\n if (async) {\n return Promise.reject(e);\n }\n if (callback) {\n callback(e);\n return;\n }\n throw e;\n };\n}\n\nfunction parseMarkdown(lexer, parser) {\n return (src, opt, callback) => {\n if (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n const origOpt = { ...opt };\n opt = { ...marked.defaults, ...origOpt };\n const throwError = onError(opt.silent, opt.async, callback);\n\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n\n checkSanitizeDeprecation(opt);\n\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n tokens = lexer(src, opt);\n } catch (e) {\n return throwError(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(tokens, opt);\n if (opt.hooks) {\n out = opt.hooks.postprocess(out);\n }\n } catch (e) {\n err = e;\n }\n }\n\n opt.highlight = highlight;\n\n return err\n ? throwError(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 if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.walkTokens ? Promise.all(marked.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n const tokens = lexer(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n } catch (e) {\n return throwError(e);\n }\n };\n}\n\n/**\n * Marked\n */\nfunction marked(src, opt, callback) {\n return parseMarkdown(Lexer.lex, Parser.parse)(src, opt, callback);\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n marked.defaults = { ...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 extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };\n\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n\n // set async to true if it was set to true before\n opts.async = marked.defaults.async || opts.async || false;\n\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\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[ext.name];\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 opts.extensions = extensions;\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 Hooks extensions --== //\n if (pack.hooks) {\n const hooks = marked.defaults.hooks || new Hooks();\n for (const prop in pack.hooks) {\n const prevHook = hooks[prop];\n if (Hooks.passThroughHooks.has(prop)) {\n hooks[prop] = (arg) => {\n if (marked.defaults.async) {\n return Promise.resolve(pack.hooks[prop].call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n\n const ret = pack.hooks[prop].call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n } else {\n hooks[prop] = (...args) => {\n let ret = pack.hooks[prop].apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked.defaults.walkTokens;\n opts.walkTokens = function(token) {\n let values = [];\n values.push(pack.walkTokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n\n marked.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(marked, token));\n switch (token.type) {\n case 'table': {\n for (const cell of token.header) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n for (const row of token.rows) {\n for (const cell of row) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n values = values.concat(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 values = values.concat(marked.walkTokens(token[childTokens], callback));\n });\n } else if (token.tokens) {\n values = values.concat(marked.walkTokens(token.tokens, callback));\n }\n }\n }\n }\n return values;\n};\n\n/**\n * Parse Inline\n * @param {string} src\n */\nmarked.parseInline = parseMarkdown(Lexer.lexInline, Parser.parseInline);\n\n/**\n * Expose\n */\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\nmarked.Tokenizer = Tokenizer;\nmarked.Slugger = Slugger;\nmarked.Hooks = Hooks;\nmarked.parse = marked;\n\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = Parser.parse;\nconst lexer = Lexer.lex;\n\nexport { Hooks, Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\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 pluralizeExports = {};\nvar pluralize$1 = {\n get exports(){ return pluralizeExports; },\n set exports(v){ pluralizeExports = v; },\n};\n\n/* global define */\n\n(function (module, exports) {\n\t(function (root, pluralize) {\n\t /* istanbul ignore else */\n\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t // Node.\n\t module.exports = pluralize();\n\t } else {\n\t // Browser global.\n\t root.pluralize = pluralize();\n\t }\n\t})(commonjsGlobal, function () {\n\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t // while other rules can be optimized using an object for instant lookups.\n\t var pluralRules = [];\n\t var singularRules = [];\n\t var uncountables = {};\n\t var irregularPlurals = {};\n\t var irregularSingles = {};\n\n\t /**\n\t * Sanitize a pluralization rule to a usable regular expression.\n\t *\n\t * @param {(RegExp|string)} rule\n\t * @return {RegExp}\n\t */\n\t function sanitizeRule (rule) {\n\t if (typeof rule === 'string') {\n\t return new RegExp('^' + rule + '$', 'i');\n\t }\n\n\t return rule;\n\t }\n\n\t /**\n\t * Pass in a word token to produce a function that can replicate the case on\n\t * another word.\n\t *\n\t * @param {string} word\n\t * @param {string} token\n\t * @return {Function}\n\t */\n\t function restoreCase (word, token) {\n\t // Tokens are an exact match.\n\t if (word === token) return token;\n\n\t // Lower cased words. E.g. \"hello\".\n\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t // Upper cased words. E.g. \"WHISKY\".\n\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t // Title cased words. E.g. \"Title\".\n\t if (word[0] === word[0].toUpperCase()) {\n\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t }\n\n\t // Lower cased words. E.g. \"test\".\n\t return token.toLowerCase();\n\t }\n\n\t /**\n\t * Interpolate a regexp string.\n\t *\n\t * @param {string} str\n\t * @param {Array} args\n\t * @return {string}\n\t */\n\t function interpolate (str, args) {\n\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t return args[index] || '';\n\t });\n\t }\n\n\t /**\n\t * Replace a word using a rule.\n\t *\n\t * @param {string} word\n\t * @param {Array} rule\n\t * @return {string}\n\t */\n\t function replace (word, rule) {\n\t return word.replace(rule[0], function (match, index) {\n\t var result = interpolate(rule[1], arguments);\n\n\t if (match === '') {\n\t return restoreCase(word[index - 1], result);\n\t }\n\n\t return restoreCase(match, result);\n\t });\n\t }\n\n\t /**\n\t * Sanitize a word by passing in the word and sanitization rules.\n\t *\n\t * @param {string} token\n\t * @param {string} word\n\t * @param {Array} rules\n\t * @return {string}\n\t */\n\t function sanitizeWord (token, word, rules) {\n\t // Empty string or doesn't need fixing.\n\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t return word;\n\t }\n\n\t var len = rules.length;\n\n\t // Iterate over the sanitization rules and use the first one to match.\n\t while (len--) {\n\t var rule = rules[len];\n\n\t if (rule[0].test(word)) return replace(word, rule);\n\t }\n\n\t return word;\n\t }\n\n\t /**\n\t * Replace a word with the updated word.\n\t *\n\t * @param {Object} replaceMap\n\t * @param {Object} keepMap\n\t * @param {Array} rules\n\t * @return {Function}\n\t */\n\t function replaceWord (replaceMap, keepMap, rules) {\n\t return function (word) {\n\t // Get the correct token and case restoration functions.\n\t var token = word.toLowerCase();\n\n\t // Check against the keep object map.\n\t if (keepMap.hasOwnProperty(token)) {\n\t return restoreCase(word, token);\n\t }\n\n\t // Check against the replacement map for a direct word replacement.\n\t if (replaceMap.hasOwnProperty(token)) {\n\t return restoreCase(word, replaceMap[token]);\n\t }\n\n\t // Run all the rules against the word.\n\t return sanitizeWord(token, word, rules);\n\t };\n\t }\n\n\t /**\n\t * Check if a word is part of the map.\n\t */\n\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t return function (word) {\n\t var token = word.toLowerCase();\n\n\t if (keepMap.hasOwnProperty(token)) return true;\n\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t return sanitizeWord(token, token, rules) === token;\n\t };\n\t }\n\n\t /**\n\t * Pluralize or singularize a word based on the passed in count.\n\t *\n\t * @param {string} word The word to pluralize\n\t * @param {number} count How many of the word exist\n\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t * @return {string}\n\t */\n\t function pluralize (word, count, inclusive) {\n\t var pluralized = count === 1\n\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t return (inclusive ? count + ' ' : '') + pluralized;\n\t }\n\n\t /**\n\t * Pluralize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.plural = replaceWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Check if a word is plural.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isPlural = checkWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Singularize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.singular = replaceWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Check if a word is singular.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isSingular = checkWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Add a pluralization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addPluralRule = function (rule, replacement) {\n\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add a singularization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addSingularRule = function (rule, replacement) {\n\t singularRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add an uncountable word rule.\n\t *\n\t * @param {(string|RegExp)} word\n\t */\n\t pluralize.addUncountableRule = function (word) {\n\t if (typeof word === 'string') {\n\t uncountables[word.toLowerCase()] = true;\n\t return;\n\t }\n\n\t // Set singular and plural references for the word.\n\t pluralize.addPluralRule(word, '$0');\n\t pluralize.addSingularRule(word, '$0');\n\t };\n\n\t /**\n\t * Add an irregular word definition.\n\t *\n\t * @param {string} single\n\t * @param {string} plural\n\t */\n\t pluralize.addIrregularRule = function (single, plural) {\n\t plural = plural.toLowerCase();\n\t single = single.toLowerCase();\n\n\t irregularSingles[single] = plural;\n\t irregularPlurals[plural] = single;\n\t };\n\n\t /**\n\t * Irregular rules.\n\t */\n\t [\n\t // Pronouns.\n\t ['I', 'we'],\n\t ['me', 'us'],\n\t ['he', 'they'],\n\t ['she', 'they'],\n\t ['them', 'them'],\n\t ['myself', 'ourselves'],\n\t ['yourself', 'yourselves'],\n\t ['itself', 'themselves'],\n\t ['herself', 'themselves'],\n\t ['himself', 'themselves'],\n\t ['themself', 'themselves'],\n\t ['is', 'are'],\n\t ['was', 'were'],\n\t ['has', 'have'],\n\t ['this', 'these'],\n\t ['that', 'those'],\n\t // Words ending in with a consonant and `o`.\n\t ['echo', 'echoes'],\n\t ['dingo', 'dingoes'],\n\t ['volcano', 'volcanoes'],\n\t ['tornado', 'tornadoes'],\n\t ['torpedo', 'torpedoes'],\n\t // Ends with `us`.\n\t ['genus', 'genera'],\n\t ['viscus', 'viscera'],\n\t // Ends with `ma`.\n\t ['stigma', 'stigmata'],\n\t ['stoma', 'stomata'],\n\t ['dogma', 'dogmata'],\n\t ['lemma', 'lemmata'],\n\t ['schema', 'schemata'],\n\t ['anathema', 'anathemata'],\n\t // Other irregular rules.\n\t ['ox', 'oxen'],\n\t ['axe', 'axes'],\n\t ['die', 'dice'],\n\t ['yes', 'yeses'],\n\t ['foot', 'feet'],\n\t ['eave', 'eaves'],\n\t ['goose', 'geese'],\n\t ['tooth', 'teeth'],\n\t ['quiz', 'quizzes'],\n\t ['human', 'humans'],\n\t ['proof', 'proofs'],\n\t ['carve', 'carves'],\n\t ['valve', 'valves'],\n\t ['looey', 'looies'],\n\t ['thief', 'thieves'],\n\t ['groove', 'grooves'],\n\t ['pickaxe', 'pickaxes'],\n\t ['passerby', 'passersby']\n\t ].forEach(function (rule) {\n\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Pluralization rules.\n\t */\n\t [\n\t [/s?$/i, 's'],\n\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t [/([^aeiou]ese)$/i, '$1'],\n\t [/(ax|test)is$/i, '$1es'],\n\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t [/(e[mn]u)s?$/i, '$1s'],\n\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t [/(her|at|gr)o$/i, '$1oes'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t [/sis$/i, 'ses'],\n\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t [/(child)(?:ren)?$/i, '$1ren'],\n\t [/eaux$/i, '$0'],\n\t [/m[ae]n$/i, 'men'],\n\t ['thou', 'you']\n\t ].forEach(function (rule) {\n\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Singularization rules.\n\t */\n\t [\n\t [/s$/i, ''],\n\t [/(ss)$/i, '$1'],\n\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t [/ies$/i, 'y'],\n\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t [/(seraph|cherub)im$/i, '$1'],\n\t [/(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\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t [/(test)(?:is|es)$/i, '$1is'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t [/(matr|append)ices$/i, '$1ix'],\n\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t [/(child)ren$/i, '$1'],\n\t [/(eau)x?$/i, '$1'],\n\t [/men$/i, 'man']\n\t ].forEach(function (rule) {\n\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Uncountable rules.\n\t */\n\t [\n\t // Singular words with no plurals.\n\t 'adulthood',\n\t 'advice',\n\t 'agenda',\n\t 'aid',\n\t 'aircraft',\n\t 'alcohol',\n\t 'ammo',\n\t 'analytics',\n\t 'anime',\n\t 'athletics',\n\t 'audio',\n\t 'bison',\n\t 'blood',\n\t 'bream',\n\t 'buffalo',\n\t 'butter',\n\t 'carp',\n\t 'cash',\n\t 'chassis',\n\t 'chess',\n\t 'clothing',\n\t 'cod',\n\t 'commerce',\n\t 'cooperation',\n\t 'corps',\n\t 'debris',\n\t 'diabetes',\n\t 'digestion',\n\t 'elk',\n\t 'energy',\n\t 'equipment',\n\t 'excretion',\n\t 'expertise',\n\t 'firmware',\n\t 'flounder',\n\t 'fun',\n\t 'gallows',\n\t 'garbage',\n\t 'graffiti',\n\t 'hardware',\n\t 'headquarters',\n\t 'health',\n\t 'herpes',\n\t 'highjinks',\n\t 'homework',\n\t 'housework',\n\t 'information',\n\t 'jeans',\n\t 'justice',\n\t 'kudos',\n\t 'labour',\n\t 'literature',\n\t 'machinery',\n\t 'mackerel',\n\t 'mail',\n\t 'media',\n\t 'mews',\n\t 'moose',\n\t 'music',\n\t 'mud',\n\t 'manga',\n\t 'news',\n\t 'only',\n\t 'personnel',\n\t 'pike',\n\t 'plankton',\n\t 'pliers',\n\t 'police',\n\t 'pollution',\n\t 'premises',\n\t 'rain',\n\t 'research',\n\t 'rice',\n\t 'salmon',\n\t 'scissors',\n\t 'series',\n\t 'sewage',\n\t 'shambles',\n\t 'shrimp',\n\t 'software',\n\t 'species',\n\t 'staff',\n\t 'swine',\n\t 'tennis',\n\t 'traffic',\n\t 'transportation',\n\t 'trout',\n\t 'tuna',\n\t 'wealth',\n\t 'welfare',\n\t 'whiting',\n\t 'wildebeest',\n\t 'wildlife',\n\t 'you',\n\t /pok[eé]mon$/i,\n\t // Regexes.\n\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t /deer$/i, // \"deer\", \"reindeer\"\n\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t /measles$/i,\n\t /o[iu]s$/i, // \"carnivorous\"\n\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t /sheep$/i\n\t ].forEach(pluralize.addUncountableRule);\n\n\t return pluralize;\n\t});\n} (pluralize$1));\n\nvar pluralize = pluralizeExports;\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/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _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\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\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// 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\";\nimport { reindent } from \"./reindent.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\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\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 if (opts.corsMode) {\n linkElem.crossOrigin = opts.corsMode;\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 * @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 = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || 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/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\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 * 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 * @param {Element} element\n */\nexport function 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/**\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 const linkifiedStr = 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 return reindent(linkifiedStr);\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 */\nimport { serialize } from \"../core/exporter.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","// @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\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\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 padding: 0.2em 0em;\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 will-change: opacity;\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 {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\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 font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.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-warning-list > li::before {\n content: \"⚠️\";\n}\n\n.respec-error-list > li::before {\n content: \"💥\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\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 top: 10%;\n background: #fff;\n border: 5px solid #666;\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\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-menu button.respec-option {\n background: white;\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 background-color: #eeeeee;\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\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\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\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 */\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;\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 image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\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\nconst config = {\n sanitize: false,\n gfm: true,\n headerIds: false,\n langPrefix: \"\",\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\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\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\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\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 processMDSections(document.body);\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 // Frankenstein the whole thing back together\n newBody.append(rsUI);\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 { markdownToHtml } from \"./markdown.js\";\nimport { reindent } from \"./reindent.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\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${err.message}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\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/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/tables.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/render-biblio.js\"),\n import(\"../src/core/dfn-index.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.js\"),\n import(\"../src/core/fix-headers.js\"),\n import(\"../src/core/webidl-index.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/data-type.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n import(\"../src/core/custom-elements/index.js\"),\n import(\"../src/core/web-monetization.js\"),\n import(\"../src/core/before-save.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-captionless-tables.js\"),\n import(\"../src/core/linter-rules/no-unused-dfns.js\"),\n import(\"../src/core/linter-rules/no-headingless-sections.js\"),\n import(\"../src/core/linter-rules/no-unused-vars.js\"),\n import(\"../src/w3c/linter-rules/required-sections.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 import(\"../src/core/linter-rules/informative-dfn.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 { docLink, fetchAndCache, showError } from \"../core/utils.js\";\n\nexport const name = \"w3c/group\";\n\nconst W3C_GROUPS_API = \"https://respec.org/w3c/groups/\";\nexport async function run(conf) {\n if (!conf.group) {\n return;\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 patentURI: wgPatentURI,\n patentPolicy: wgPatentPolicy,\n type: groupType,\n wgURI,\n } = json;\n return { wg, wgId, wgURI, wgPatentURI, wgPatentPolicy, groupType };\n }\n\n const text = await res.text();\n let message = `Failed to fetch group details (HTTP: ${res.status}).`;\n let hint;\n if (res.status === 409) {\n [message, hint] = text.split(\"\\n\", 2);\n } else if (res.status === 404) {\n hint = docLink`See the list of [supported group names](https://respec.org/w3c/groups/) to use with the ${\"[group]\"} configuration option.`;\n }\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 W3CDate,\n getIntlData,\n isValidConfDate,\n showError,\n showWarning,\n} from \"../../core/utils.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};\nconst l10n = getIntlData(localizationStrings);\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 // 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 const { retiredDate } = person;\n if (person.retiredDate) {\n const time = html`<time datetime=\"${retiredDate}\"\n >${W3CDate.format(new Date(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 { ISODate, W3CDate, getIntlData } 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\";\nimport { sub } from \"../../core/pubsubhub.js\";\n\nconst localizationStrings = {\n en: {\n archives: \"archives\",\n author: \"Author:\",\n authors: \"Authors:\",\n commit_history: \"Commit history\",\n edited_in_place: \"edited in place\",\n editor: \"Editor:\",\n editors: \"Editors:\",\n feedback: \"Feedback:\",\n former_editor: \"Former editor:\",\n former_editors: \"Former editors:\",\n history: \"History:\",\n implementation_report: \"Implementation report:\",\n latest_editors_draft: \"Latest editor's draft:\",\n latest_published_version: \"Latest published version:\",\n latest_recommendation: \"Latest Recommendation:\",\n message_topic: \"… message topic …\",\n more_details_about_this_doc: \"More details about this document\",\n multiple_alternates(plural) {\n return `This document is also available in ${\n plural ? \"these non-normative formats\" : \"this non-normative format\"\n }:`;\n },\n prev_editor_draft: \"Previous editor's draft:\",\n prev_recommendation: \"Previous Recommendation:\",\n prev_version: \"Previous version:\",\n publication_history: \"Publication history\",\n test_suite: \"Test suite:\",\n this_version: \"This version:\",\n with_subject_line: \"with subject line\",\n your_topic_here: \"YOUR TOPIC HERE\",\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 commit_history: \"Git提交历史\",\n editor: \"编辑:\",\n editors: \"编辑:\",\n feedback: \"反馈:\",\n former_editor: \"原编辑:\",\n former_editors: \"原编辑:\",\n history: \"历史:\",\n implementation_report: \"实现报告:\",\n latest_editors_draft: \"最新编辑草稿:\",\n latest_published_version: \"最新发布版本:\",\n latest_recommendation: \"最新发布的正式推荐标准:\",\n message_topic: \"… 邮件主题 …\",\n prev_editor_draft: \"上一版编辑草稿:\",\n prev_recommendation: \"上一版正式推荐标准:\",\n prev_version: \"上一版:\",\n test_suite: \"测试套件:\",\n this_version: \"本版本:\",\n },\n ja: {\n archives: \"アーカイブ\",\n author: \"著者:\",\n authors: \"著者:\",\n commit_history: \"更新履歴\",\n edited_in_place: \"改版なく更新\",\n editor: \"編者:\",\n editors: \"編者:\",\n feedback: \"フィードバック:\",\n former_editor: \"以前の版の編者:\",\n former_editors: \"以前の版の編者:\",\n history: \"履歴:\",\n implementation_report: \"実装レポート:\",\n latest_editors_draft: \"最新の編集用草案:\",\n latest_published_version: \"最新バージョン:\",\n latest_recommendation: \"最新の勧告版:\",\n message_topic: \"… メール件名 …\",\n more_details_about_this_doc: \"この文書についてのより詳細\",\n prev_editor_draft: \"前回の編集用草案:\",\n prev_recommendation: \"前回の勧告版:\",\n prev_version: \"前回のバージョン:\",\n publication_history: \"公表履歴\",\n test_suite: \"テストスイート:\",\n this_version: \"このバージョン:\",\n with_subject_line: \"次の件名で\",\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 archives: \"archivos\",\n author: \"Autor:\",\n authors: \"Autores:\",\n commit_history: \"Historial de cambios\",\n edited_in_place: \"editado en lugar\",\n editor: \"Editor:\",\n editors: \"Editores:\",\n feedback: \"Comentarios:\",\n former_editor: \"Antiguo editor:\",\n former_editors: \"Antiguos editores:\",\n history: \"Historia:\",\n implementation_report: \"Informe de implementación:\",\n latest_editors_draft: \"Última versión del editor:\",\n latest_published_version: \"Última versión publicada:\",\n latest_recommendation: \"Recomendación más reciente:\",\n message_topic: \"… detalles de mensaje …\",\n more_details_about_this_doc: \"Más detalles sobre este documento:\",\n publication_history: \"Historial de publicación\",\n prev_editor_draft: \"Última versión del editor:\",\n prev_recommendation: \"Última Recomendación:\",\n prev_version: \"Última versión:\",\n test_suite: \"Suite de pruebas:\",\n this_version: \"Esta versión:\",\n with_subject_line: \"con línea de asunto\",\n your_topic_here: \"TU SUJETO AQUÍ\",\n },\n de: {\n archives: \"Archiv\",\n author: \"Autor/in:\",\n authors: \"Autor/innen:\",\n commit_history: \"Commit-Historie\",\n edited_in_place: \"zuletzt geändert am\",\n editor: \"Redaktion:\",\n editors: \"Redaktion:\",\n feedback: \"Feedback:\",\n former_editor: \"Frühere Mitwirkende:\",\n former_editors: \"Frühere Mitwirkende:\",\n history: \"Verlauf:\",\n implementation_report: \"Umsetzungsbericht:\",\n latest_editors_draft: \"Letzter Entwurf:\",\n latest_published_version: \"Letzte publizierte Fassung:\",\n latest_recommendation: \"Aktuellste Empfehlung:\",\n more_details_about_this_doc: \"Mehr Informationen über dieses Dokument\",\n multiple_alternates(plural) {\n return `Dieses Dokument ist ebenfalls in ${\n plural\n ? \"diesen nicht-normativen Formaten verfügbar\"\n : \"diesem nicht-normativen Format verfügbar\"\n }:`;\n },\n prev_editor_draft: \"Vorheriger Entwurf:\",\n prev_recommendation: \"Vorherige Empfehlung:\",\n prev_version: \"Vorherige Version:\",\n publication_history: \"Veröffentlichungsverlauf\",\n test_suite: \"Testumgebung:\",\n this_version: \"Diese Fassung:\",\n },\n};\nexport const l10n = getIntlData(localizationStrings);\n\nexport function 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 /**\n * After export, we let fixup.js handle the <details>.\n */\n sub(\"beforesave\", doc => {\n const details = doc.querySelector(\".head details\");\n details.open = true;\n });\n return html`<div class=\"head\">\n ${conf.logos.length\n ? html`<p class=\"logos\">${conf.logos.map(showLogo)}</p>`\n : \"\"}\n ${document.querySelector(\"h1#title\")} ${getSpecSubTitleElem(conf)}\n <p id=\"w3c-state\">${renderSpecTitle(conf)}</p>\n <details open=\"${localStorage.getItem(\"tr-metadata\") || \"true\"}\">\n <summary>${l10n.more_details_about_this_doc}</summary>\n <dl>\n ${conf.thisVersion\n ? html`<dt>${l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\"\n >${conf.thisVersion}</a\n >\n </dd>`\n : \"\"}\n ${\"latestVersion\" in conf // latestVersion can be falsy\n ? html`<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 ${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.historyURI || conf.github\n ? html`<dt>${l10n.history}</dt>\n ${conf.historyURI\n ? html`<dd>\n <a href=\"${conf.historyURI}\">${conf.historyURI}</a>\n </dd>`\n : \"\"}\n ${conf.github\n ? html`<dd>\n <a href=\"${conf.github.commitHistoryURL}\"\n >${l10n.commit_history}</a\n >\n </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.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 ${conf.editors.length\n ? html`\n <dt>${conf.editors.length > 1 ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n `\n : \"\"}\n ${conf.formerEditors.length\n ? html`\n <dt>\n ${conf.formerEditors.length > 1\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors.length\n ? html`\n <dt>${conf.authors.length > 1 ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.github || conf.wgPublicList\n ? html`<dt>${l10n.feedback}</dt>\n ${renderFeedback(conf)}`\n : \"\"}\n ${conf.errata\n ? html`<dt>Errata:</dt>\n <dd><a href=\"${conf.errata}\">Errata exists</a>.</dd>`\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n </details>\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 ${l10n.multiple_alternates(options.multipleAlternates)}\n ${options.alternatesHTML}\n </p>`\n : \"\"}\n ${renderCopyright(conf)}\n <hr title=\"Separator for header\" />\n </div>`;\n};\n\nexport function renderFeedback(conf) {\n const definitions = [];\n // Github feedback...\n if (conf.github) {\n const { repoURL, issuesURL, newIssuesURL, pullsURL, fullName } =\n conf.github;\n definitions.push(\n html`<dd>\n <a href=\"${repoURL}\">GitHub ${fullName}</a>\n (<a href=\"${pullsURL}\">pull requests</a>,\n <a href=\"${newIssuesURL}\">new issue</a>,\n <a href=\"${issuesURL}\">open issues</a>)\n </dd>`\n );\n }\n\n // The <a href=\"mailto:list?subject\"> link for the public list\n if (conf.wgPublicList) {\n const mailToURL = new URL(`mailto:${conf.wgPublicList}@w3.org`);\n const subject =\n conf.subjectPrefix ?? `[${conf.shortName}] ${l10n.your_topic_here}`;\n const mailingListLink = html`<a\n href=\"${mailToURL.href}?subject=${encodeURIComponent(subject)}\"\n >${mailToURL.pathname}</a\n >`;\n\n // The subject line...\n const subjectLine =\n conf.subjectPrefix ||\n html`[${conf.shortName}] <em>${l10n.message_topic}</em>`;\n const emailSubject = html`${l10n.with_subject_line}${\" \"}\n <kbd>${subjectLine}</kbd>`;\n\n // Archives link\n const archiveURL = new URL(\n conf.wgPublicList,\n \"https://lists.w3.org/Archives/Public/\"\n );\n const archiveLink = html`(<a href=\"${archiveURL}\" rel=\"discussion\"\n >${l10n.archives}</a\n >)`;\n\n definitions.push(\n html`<dd>${mailingListLink} ${emailSubject} ${archiveLink}</dd>`\n );\n }\n return definitions;\n}\n\nfunction renderSpecTitle(conf) {\n const specType = conf.isCR || conf.isCRY ? conf.longStatus : conf.textStatus;\n const preamble = conf.prependW3C\n ? html`<a href=\"https://www.w3.org/standards/types#${conf.specStatus}\"\n >W3C ${specType}</a\n >`\n : html`${specType}`;\n return html`${preamble}${\" \"}\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${W3CDate.format(conf.publishDate)}</time\n >${conf.modificationDate\n ? html`, ${l10n.edited_in_place}${\" \"}\n <time\n class=\"dt-modified\"\n datetime=\"${ISODate.format(conf.modificationDate)}\"\n >${W3CDate.format(conf.modificationDate)}</time\n >`\n : \"\"}`;\n}\n\n/**\n * @param { LicenseInfo } licenseInfo license information\n */\nfunction linkLicense(licenseInfo) {\n const { url, short, name } = licenseInfo;\n if (name === \"unlicensed\") {\n return html`. <span class=\"issue\">THIS DOCUMENT IS UNLICENSED</span>.`;\n }\n return html` and\n <a rel=\"license\" href=\"${url}\" title=\"${name}\">${short}</a> rules apply.`;\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.isUnofficial && conf.licenseInfo) {\n return html`<p class=\"copyright\">\n Copyright ©\n ${conf.copyrightStart ? `${conf.copyrightStart}-` : \"\"}${conf.publishYear}\n the document editors/authors.\n ${conf.licenseInfo.name !== \"unlicensed\"\n ? html`Text is available under the\n <a rel=\"license\" href=\"${conf.licenseInfo.url}\"\n >${conf.licenseInfo.name}</a\n >; additional terms may apply.`\n : \"\"}\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/\">World Wide Web Consortium</a>.\n <abbr title=\"World Wide Web Consortium\">W3C</abbr><sup>®</sup>\n <a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer\"\n >liability</a\n >,\n <a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks\"\n >trademark</a\n >${linkLicense(conf.licenseInfo)}\n </p>`;\n}\n","// @ts-check\nimport { getSpecSubTitleElem, l10n, renderFeedback } from \"./headers.js\";\nimport { W3CDate } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.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.length\n ? html`<p class=\"logos\">${conf.logos.map(showLogo)}</p>`\n : \"\"}\n ${specTitleElem} ${getSpecSubTitleElem(conf)}\n <p id=\"w3c-state\">\n <a href=\"https://www.w3.org/standards/types#reports\"\n >${conf.longStatus}</a\n >\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${W3CDate.format(conf.publishDate)}</time\n >\n </p>\n <dl>\n ${conf.thisVersion\n ? html`<dt>${l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\"\n >${conf.thisVersion}</a\n >\n </dd>`\n : \"\"}\n ${\"latestVersion\" in conf // latestVersion can be falsy\n ? html`<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 ${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 ${conf.editors.length\n ? html`\n <dt>${conf.editors.length > 1 ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n `\n : \"\"}\n ${conf.formerEditors.length\n ? html`\n <dt>\n ${conf.formerEditors.length > 1\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors.length\n ? html`\n <dt>${conf.authors.length > 1 ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.github || conf.wgPublicList\n ? html`<dt>${l10n.feedback}</dt>\n ${renderFeedback(conf)}`\n : \"\"}\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 { W3CDate, getIntlData } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport { status2track } from \"../headers.js\";\nconst localizationStrings = {\n en: {\n sotd: \"Status of This Document\",\n status_at_publication: html`This section describes the status of this\n document at the time of its publication. A list of current W3C\n publications and the latest revision of this technical report can be found\n in the <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> at\n https://www.w3.org/TR/.`,\n },\n ko: {\n sotd: \"현재 문서의 상태\",\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 sotd: \"关于本文档\",\n // eslint-disable-next-line prettier/prettier\n status_at_publication: html`本章节描述了本文档的发布状态。W3C的文档列表和最新版本可通过<a href=\"https://www.w3.org/TR/\">W3C技术报告</a>索引访问。`,\n },\n ja: {\n sotd: \"この文書の位置付け\",\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 nl: {\n sotd: \"Status van dit document\",\n },\n es: {\n sotd: \"Estado de este Document\",\n status_at_publication: html`Esta sección describe el estado del presente\n documento al momento de su publicación. Una lista de las publicaciones\n actuales del W3C y la última revisión del presente informe técnico puede\n hallarse en 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 sotd: \"Status dieses Dokuments\",\n status_at_publication: html`Dieser Abschnitt beschreibt den Status des\n Dokuments zum Zeitpunkt der Publikation. Eine Liste der aktuellen\n Publikatinen des W3C und die aktuellste Fassung dieser Spezifikation kann\n im <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> unter\n https://www.w3.org/TR/ abgerufen werden.`,\n },\n};\n\nexport const l10n = getIntlData(localizationStrings);\n\nconst processLink = \"https://www.w3.org/2021/Process-20211102/\";\n\nfunction prefix(word) {\n return /^[aeiou]/i.test(word) ? `an ${word}` : `a ${word}`;\n}\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>${l10n.status_at_publication}</em></p>\n ${conf.isMemberSubmission\n ? noteForSubmission(conf, opts)\n : html`\n ${!conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${!conf.overrideStatus\n ? html` ${linkToWorkingGroup(conf)} `\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 id=\"w3c_process_revision\" href=\"${processLink}\"\n >2 November 2021 W3C Process Document</a\n >.\n </p>\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 = null;\n let reviewPolicy = null;\n let endorsement = html`Publication as ${prefix(conf.textStatus)} does not\n imply endorsement by W3C and its Members.`;\n let updatePolicy = html`<p>\n This is a draft document and may be updated, replaced or obsoleted by other\n documents at any time. It is inappropriate to cite this document as other\n than work in progress.\n ${conf.updateableRec\n ? html`Future updates to this specification may incorporate\n <a href=\"${processLink}#allow-new-features\">new features</a>.`\n : \"\"}\n </p>`;\n if (conf.specStatus === \"DISC\") {\n updatePolicy = html`<p>\n Publication as a Discontinued Draft implies that this document is no\n longer intended to advance or to be maintained. It is inappropriate to\n cite this document as other than abandoned work.\n </p>`;\n }\n const lsUpdatePolicy = html`<p>\n This document is maintained and updated at any time. Some parts of this\n document are work in progress.\n </p>`;\n switch (conf.specStatus) {\n case \"STMT\":\n endorsement = html`<p>\n A W3C Statement is a specification that, after extensive\n consensus-building, has received the endorsement of the\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> and its Members.\n </p>`;\n break;\n case \"RY\":\n endorsement = html`<p>W3C recommends the wide usage of this registry.</p>\n <p>\n A W3C Registry is a specification that, after extensive\n consensus-building, has received the endorsement of the\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> and its Members.\n </p>`;\n break;\n case \"CRD\":\n statusExplanation = html`A Candidate Recommendation Draft integrates\n changes from the previous Candidate Recommendation that the Working Group\n intends to include in a subsequent Candidate Recommendation Snapshot.`;\n if (conf.pubMode === \"LS\") {\n updatePolicy = lsUpdatePolicy;\n }\n break;\n case \"CRYD\":\n statusExplanation = html`A Candidate Registry Draft integrates changes\n from the previous Candidate Registry Snapshot that the Working Group\n intends to include in a subsequent Candidate Registry Snapshot.`;\n if (conf.pubMode === \"LS\") {\n updatePolicy = lsUpdatePolicy;\n }\n break;\n case \"CRY\":\n statusExplanation = html`A Candidate Registry Snapshot has received\n <a href=\"${processLink}#dfn-wide-review\">wide review</a>.`;\n reviewPolicy = html`<p>\n The W3C Membership and other interested parties are invited to review\n the document and send comments through ${conf.humanPREnd}. Advisory\n Committee Representatives should consult 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 </p>`;\n break;\n case \"CR\":\n statusExplanation = html`A Candidate Recommendation Snapshot has received\n <a href=\"${processLink}#dfn-wide-review\">wide review</a>, is intended to\n gather\n <a href=\"${conf.implementationReportURI}\">implementation experience</a>,\n and has commitments from Working Group members to\n <a href=\"https://www.w3.org/Consortium/Patent-Policy/#sec-Requirements\"\n >royalty-free licensing</a\n >\n for implementations.`;\n updatePolicy = html`${conf.updateableRec\n ? html`Future updates to this specification may incorporate\n <a href=\"${processLink}#allow-new-features\">new features</a>.`\n : \"\"}`;\n if (conf.pubMode === \"LS\") {\n reviewPolicy = html`<p>\n Comments are welcome at any time but most especially before\n ${W3CDate.format(conf.crEnd)}.\n </p>`;\n } else {\n reviewPolicy = html`<p>\n This Candidate Recommendation is not expected to advance to Proposed\n Recommendation any earlier than ${W3CDate.format(conf.crEnd)}.\n </p>`;\n }\n break;\n case \"PR\":\n reviewPolicy = html`<p>\n The W3C Membership and other interested parties are invited to review\n the document and send comments through ${W3CDate.format(conf.prEnd)}.\n Advisory Committee Representatives should consult 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\n ${W3CDate.format(conf.crEnd)}.\n </p>`;\n break;\n case \"DNOTE\":\n case \"NOTE\":\n endorsement = html`${conf.textStatus}s are not endorsed by\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> nor its Members.`;\n break;\n }\n return html`<p>${endorsement} ${statusExplanation}</p>\n ${updatePolicy} ${reviewPolicy}`;\n}\n\nfunction renderIsRec(conf) {\n const { updateableRec, revisionTypes = [], revisedRecEnd } = conf;\n let reviewTarget = \"\";\n if (revisionTypes.includes(\"proposed-addition\")) {\n reviewTarget = \"additions\";\n } else if (revisionTypes.includes(\"proposed-correction\")) {\n reviewTarget = \"corrections\";\n }\n return html`\n <p>\n W3C recommends the wide deployment of this specification as a standard for\n the Web.\n </p>\n\n <p>\n A W3C Recommendation is a specification that, after extensive\n consensus-building, is endorsed by\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> and its Members, and\n has commitments from Working Group members to\n <a href=\"https://www.w3.org/Consortium/Patent-Policy/#sec-Requirements\"\n >royalty-free licensing</a\n >\n for implementations.\n ${updateableRec\n ? html`Future updates to this Recommendation may incorporate\n <a href=\"${processLink}#allow-new-features\">new features</a>.`\n : \"\"}\n </p>\n ${revisionTypes.includes(\"addition\")\n ? html`<p class=\"addition\">\n Candidate additions are marked in the document.\n </p>`\n : \"\"}\n ${revisionTypes.includes(\"correction\")\n ? html`<p class=\"correction\">\n Candidate corrections are marked in the document.\n </p>`\n : \"\"}\n ${revisionTypes.includes(\"proposed-addition\")\n ? html`<p class=\"addition proposed\">\n Proposed additions are marked in the document.\n </p>`\n : \"\"}\n ${revisionTypes.includes(\"proposed-correction\")\n ? html`<p class=\"correction proposed\">\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 ${W3CDate.format(revisedRecEnd)}. Advisory Committee Representatives\n should consult their\n <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >.\n </p>`\n : \"\"}\n `;\n}\n\nfunction renderDeliverer(conf) {\n const {\n isNote,\n isRegistry,\n wgId,\n multipleWGs,\n wgPatentHTML,\n wgPatentURI,\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 = !(isNote || isRegistry)\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 : html`\n The\n <a href=\"${patentPolicyURL}\"\n >${wgPatentPolicy === \"PP2017\" ? \"1 August 2017 \" : \"\"}W3C Patent\n Policy</a\n >\n does not carry any licensing requirements or commitments on this\n document.\n `;\n return html`<p data-deliverer=\"${isNote || isRegistry ? wgId : null}\">\n ${producers}\n ${!(isNote || isRegistry)\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 </p>`;\n}\n\nfunction noteForSubmission(conf, opts) {\n return html`\n ${opts.additionalContent}\n ${conf.isMemberSubmission ? noteForMemberSubmission(conf) : \"\"}\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\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 changes = null;\n if (conf.isRec && conf.revisionTypes && conf.revisionTypes.length) {\n const pa = conf.revisionTypes.includes(\"proposed-addition\");\n const pc = conf.revisionTypes.includes(\"proposed-correction\");\n const ca = conf.revisionTypes.includes(\"addition\");\n const cc = conf.revisionTypes.includes(\"correction\");\n if ((pa && pc) || (ca && cc)) {\n changes = html`It includes\n ${pa\n ? html`<a href=\"${processLink}#proposed-amendments\">\n proposed amendments</a\n >`\n : html`<a href=\"${processLink}#candidate-amendments\">\n candidate amendments</a\n >`},\n introducing substantive changes and new features since the previous\n Recommendation.`;\n } else if (pa || ca) {\n changes = html`It includes\n ${pa\n ? html`<a href=\"${processLink}#proposed-addition\">\n proposed additions</a\n >`\n : html`<a href=\"${processLink}#candidate-addition\">\n candidate additions</a\n >`},\n introducing new features since the previous Recommendation.`;\n } else if (pc || cc) {\n changes = html`It includes\n ${pc\n ? html`<a href=\"${processLink}#proposed-correction\">\n proposed corrections</a\n >`\n : html`<a href=\"${processLink}#candidate-correction\">\n candidate corrections</a\n >`}.`;\n }\n }\n const track = status2track[conf.specStatus]\n ? html` using the\n <a href=\"${processLink}#recs-and-notes\"\n >${status2track[conf.specStatus]} track</a\n >`\n : \"\";\n return html`<p>\n This document was published by ${conf.wgHTML} as\n ${prefix(conf.longStatus)}${track}. ${changes}\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// - 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// - 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// - \"document\", which is the old, but still available, document license.\n// - \"dual\", dual license.\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 norm,\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\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};\n\nexport const status2text = {\n DNOTE: \"Group Draft Note\",\n NOTE: \"Group Note\",\n STMT: \"Statement\",\n \"Member-SUBM\": \"Member 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 CR: \"Candidate Recommendation\",\n CRD: \"Candidate Recommendation\",\n PR: \"Proposed Recommendation\",\n PER: \"Proposed Edited Recommendation\",\n REC: \"Recommendation\",\n DISC: \"Discontinued Draft\",\n RSCND: \"Rescinded Recommendation\",\n DRY: \"Draft Registry\",\n CRYD: \"Candidate Registry\",\n CRY: \"Candidate Registry\",\n RY: \"Registry\",\n unofficial: \"Unofficial Draft\",\n UD: \"Unofficial Draft\",\n base: \"\",\n finding: \"TAG Finding\",\n \"draft-finding\": \"Draft TAG Finding\",\n \"editor-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 CRY: \"Candidate Registry Snapshot\",\n CRYD: \"Candidate Registry Draft\",\n};\nexport const status2track = {\n DNOTE: \"Note\",\n NOTE: \"Note\",\n STMT: \"Note\",\n \"WG-NOTE\": \"Note\",\n \"IG-NOTE\": \"Note\",\n FPWD: \"Recommendation\",\n WD: \"Recommendation\",\n CR: \"Recommendation\",\n CRD: \"Recommendation\",\n PR: \"Recommendation\",\n REC: \"Recommendation\",\n DISC: \"Recommendation\",\n RSCND: \"Recommendation\",\n DRY: \"Registry\",\n CRYD: \"Registry\",\n CRY: \"Registry\",\n RY: \"Registry\",\n};\nexport const W3CNotes = [\"DNOTE\", \"NOTE\", \"STMT\"];\nexport const recTrackStatus = [\n \"CR\",\n \"CRD\",\n \"DISC\",\n \"FPWD\",\n \"PER\",\n \"PR\",\n \"REC\",\n \"RSCND\",\n \"WD\",\n];\nexport const registryTrackStatus = [\"DRY\", \"CRY\", \"CRYD\", \"RY\"];\nexport const tagStatus = [\"draft-finding\", \"finding\", \"editor-draft-finding\"];\nexport const cgStatus = [\"CG-DRAFT\", \"CG-FINAL\"];\nexport const bgStatus = [\"BG-DRAFT\", \"BG-FINAL\"];\nexport const cgbgStatus = [...cgStatus, ...bgStatus];\nexport const trStatus = [\n ...W3CNotes,\n ...recTrackStatus,\n ...registryTrackStatus,\n];\nexport const noTrackStatus = [\n \"base\",\n ...cgStatus,\n ...bgStatus,\n \"editor-draft-finding\",\n \"draft-finding\",\n \"finding\",\n \"MO\",\n \"unofficial\",\n];\n/** @type {Map<string, LicenseInfo>} */\nexport const 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: \"permissive document license\",\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 \"document\",\n {\n name: \"W3C Document License\",\n short: \"document use\",\n url: \"https://www.w3.org/Consortium/Legal/copyright-documents\",\n },\n ],\n [\n \"dual\",\n {\n name: \"W3C Dual License\",\n short: \"dual license\",\n url: \"https://www.w3.org/Consortium/Legal/2013/copyright-documents-dual.html\",\n },\n ],\n [\n undefined,\n {\n name: \"unlicensed\",\n url: null,\n short: \"UNLICENSED\",\n },\n ],\n]);\n\nconst patentPolicies = [\"PP2017\", \"PP2020\"];\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\nfunction deriveLicenseInfo(conf) {\n let license = undefined;\n if (typeof conf.license === \"string\") {\n const lCaseLicense = conf.license.toLowerCase();\n if (!licenses.has(lCaseLicense)) {\n const msg = `The license \"\\`${conf.license}\\`\" is not supported.`;\n const choices = codedJoinOr(\n [...licenses.keys()].filter(k => k),\n {\n quotes: true,\n }\n );\n const hint = docLink`Please set\n ${\"[license]\"} to one of: ${choices}. If in doubt, remove \\`license\\` and let ReSpec pick one for you.`;\n showError(msg, name, { hint });\n } else {\n license = lCaseLicense;\n }\n }\n\n if (conf.isUnofficial && !license) {\n license = \"cc-by\";\n }\n\n // W3C docs can't be CC-BY or CC0\n if (!conf.isUnofficial && [\"cc-by\", \"cc0\"].includes(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 const licenseInfo = licenses.get(license);\n return licenseInfo;\n}\n\nexport async function run(conf) {\n conf.isBasic = conf.specStatus === \"base\";\n conf.isCGBG = cgbgStatus.includes(conf.specStatus);\n conf.isCGFinal = conf.isCGBG && conf.specStatus.endsWith(\"G-FINAL\");\n conf.isCR = conf.specStatus === \"CR\" || conf.specStatus === \"CRD\";\n conf.isCRDraft = conf.specStatus === \"CRD\";\n conf.isCRY = conf.specStatus === \"CRY\" || conf.specStatus === \"CRYD\";\n conf.isEd = conf.specStatus === \"ED\";\n conf.isMemberSubmission = conf.specStatus === \"Member-SUBM\";\n conf.isMO = conf.specStatus === \"MO\";\n conf.isNote = W3CNotes.includes(conf.specStatus);\n conf.isNoTrack = noTrackStatus.includes(conf.specStatus);\n conf.isPER = conf.specStatus === \"PER\";\n conf.isPR = conf.specStatus === \"PR\";\n conf.isRecTrack = recTrackStatus.includes(conf.specStatus);\n conf.isRec = conf.isRecTrack && conf.specStatus === \"REC\";\n conf.isRegistry = registryTrackStatus.includes(conf.specStatus);\n conf.isRegular = !conf.isCGBG && !conf.isBasic;\n conf.isTagEditorFinding = conf.specStatus === \"editor-draft-finding\";\n conf.isTagFinding = tagStatus.includes(conf.specStatus);\n conf.isUnofficial = conf.specStatus === \"unofficial\";\n conf.licenseInfo = deriveLicenseInfo(conf);\n conf.prependW3C = !conf.isBasic && !conf.isUnofficial;\n conf.longStatus = status2long[conf.specStatus];\n conf.textStatus = status2text[conf.specStatus];\n conf.showPreviousVersion = false;\n\n if (conf.isRegular && !conf.shortName) {\n const msg = docLink`The ${\"[shortName]\"} configuration option is required for this kind of document.`;\n const hint = docLink`Please set ${\"[shortName]\"} to a short name for the specification.`;\n showError(msg, name, { hint });\n }\n\n conf.publishDate = validateDateAndRecover(\n conf,\n \"publishDate\",\n document.lastModified\n );\n conf.publishYear = conf.publishDate.getUTCFullYear();\n if (conf.modificationDate) {\n conf.modificationDate = validateDateAndRecover(\n conf,\n \"modificationDate\",\n document.lastModified\n );\n }\n\n if (conf.isRecTrack && !conf.github && !conf.wgPublicList) {\n const msg =\n \"W3C Process requires a either a link to a public repository or mailing list.\";\n const hint = docLink`Use the ${\"[github]\"} configuration option to add a link to a repository. Alternatively use ${\"[wgPublicList]\"} to link to a mailing list.`;\n showError(msg, name, {\n hint,\n });\n }\n\n if (conf.isEd && !conf.edDraftURI) {\n const msg = docLink`Editor's Drafts should set ${\"[edDraftURI]\"} configuration option.`;\n const hint = docLink`Please set ${\"[edDraftURI]\"} to the URL of the Editor's Draft. Alternatively, use the set ${\"[github]\"} option, which automatically sets it for you.`;\n showWarning(msg, name, { hint });\n }\n\n const pubSpace = derivePubSpace(conf);\n if (pubSpace && !conf.thisVersion) {\n const maturity = status2maturity[conf.specStatus] || conf.specStatus;\n const { shortName, publishDate } = conf;\n const date = concatDate(publishDate);\n const docVersion = `${maturity}-${shortName}-${date}`;\n const year = [...trStatus, \"Member-SUBM\"].includes(conf.specStatus)\n ? `${publishDate.getUTCFullYear()}/`\n : \"\";\n conf.thisVersion = w3Url(`${pubSpace}/${year}${docVersion}/`);\n }\n\n if (conf.isEd) conf.thisVersion = conf.edDraftURI;\n if (conf.isCGBG) validateCGBG(conf);\n if (conf.latestVersion !== null) {\n conf.latestVersion = conf.latestVersion\n ? w3Url(conf.latestVersion)\n : w3Url(`${pubSpace}/${conf.shortName}/`);\n }\n\n if (conf.latestVersion) validateIfAllowedOnTR(conf);\n\n const latestPath = `${pubSpace}/${conf.shortName}`;\n if (conf.previousPublishDate) {\n if (!conf.previousMaturity && !conf.isTagFinding) {\n const msg = docLink`${\"[`previousPublishDate`]\"} is set, but missing ${\"[`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 }\n if (conf.prevRecShortname && !conf.prevRecURI)\n conf.prevRecURI = w3Url(`${pubSpace}/${conf.prevRecShortname}`);\n\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.length === 0) {\n const msg = \"At least one editor is required.\";\n const hint = docLink`Add one or more editors using the ${\"[editors]\"} configuration option.`;\n showError(msg, name, { hint });\n } else if (conf.editors.length && conf.isRecTrack) {\n // check that every editor has w3cid\n conf.editors.forEach((editor, i) => {\n if (editor.w3cid) return;\n const msg = docLink`Editor ${\n editor.name ? `\"${editor.name}\"` : `number ${i + 1}`\n } is missing their ${\"[w3cid]\"}.`;\n const hint = docLink`See ${\"[w3cid]\"} for instructions for how to retrieve it and add it.`;\n showError(msg, name, { hint });\n });\n }\n\n if (conf.alternateFormats?.some(({ uri, label }) => !uri || !label)) {\n const msg = docLink`Every ${\"[`alternateFormats`]\"} entry must have a \\`uri\\` and a \\`label\\`.`;\n showError(msg, name);\n }\n if (conf.copyrightStart == conf.publishYear) conf.copyrightStart = \"\";\n if (conf.isRec && !conf.errata && !conf.revisionTypes?.length) {\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.dashDate = ISODate.format(conf.publishDate);\n conf.publishISODate = conf.publishDate.toISOString();\n conf.shortISODate = ISODate.format(conf.publishDate);\n validatePatentPolicies(conf);\n await deriveHistoryURI(conf);\n if (conf.isTagEditorFinding) {\n delete conf.thisVersion;\n delete conf.latestVersion;\n }\n if (conf.isTagFinding) {\n conf.showPreviousVersion = conf.previousPublishDate ? true : false;\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 (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.isPR && !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.isCR && !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\n if (conf.isPr && !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\n if (conf.isPER && !conf.perEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"PER\", but no ${\"[perEnd]\"} is specified.`;\n showError(msg, name);\n }\n conf.perEnd = validateDateAndRecover(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 = [\n \"addition\",\n \"correction\",\n \"proposed-addition\",\n \"proposed-correction\",\n ];\n if (conf.isRec && 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 (\n (conf.revisionTypes.includes(\"proposed-addition\") ||\n conf.revisionTypes.includes(\"addition\")) &&\n !conf.updateableRec\n ) {\n const msg = docLink`${\"[specStatus]\"} is \"REC\" with proposed additions but the Recommendation is not marked as 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 [\"proposed-addition\", \"proposed-correction\"].some(type =>\n conf.revisionTypes.includes(type)\n ) &&\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\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 (!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: norm(\n document.getElementById(\"w3c-state\")?.textContent ?? \"\"\n ),\n });\n}\n\nfunction validateIfAllowedOnTR(conf) {\n const latestVersionURL = new URL(conf.latestVersion);\n const isW3C =\n latestVersionURL.origin === \"https://www.w3.org\" ||\n latestVersionURL.origin === \"https://w3.org/\";\n if (\n isW3C &&\n latestVersionURL.pathname.startsWith(\"/TR/\") &&\n [\"ED\", ...trStatus].includes(conf.specStatus) === false\n ) {\n const msg = docLink`Documents with a status of \\`\"${conf.specStatus}\"\\` can't be published on the W3C's /TR/ (Technical Report) space.`;\n const hint = docLink`Ask a W3C Team Member for a W3C URL where the report can be published and change ${\"[latestVersion]\"} to something else.`;\n showError(msg, name, { hint });\n return;\n }\n}\n\nfunction derivePubSpace(conf) {\n const { specStatus, group } = conf;\n if (trStatus.includes(specStatus) || conf.groupType === \"wg\") {\n return `/TR`;\n }\n\n switch (specStatus) {\n case \"CG-FINAL\":\n case \"BG-FINAL\":\n return `/community/reports/${group}`;\n case \"finding\":\n case \"draft-finding\":\n return \"/2001/tag/doc\";\n case \"Member-SUBM\":\n return `/Submission`;\n }\n\n return \"\";\n}\n\nfunction validateCGBG(conf) {\n const reportType = status2text[conf.specStatus];\n const latestVersionURL = conf.latestVersion\n ? new URL(w3Url(conf.latestVersion))\n : null;\n\n if (!conf.wg) {\n const msg = docLink`The ${\"[group]\"} configuration option is required for this kind of document (${reportType}).`;\n showError(msg, name);\n return;\n }\n\n // Deal with final reports\n if (conf.isCGFinal) {\n // Final report require a w3.org URL.\n const isW3C =\n latestVersionURL?.origin === \"https://www.w3.org\" ||\n latestVersionURL?.origin === \"https://w3.org/\";\n if (isW3C === false) {\n const msg = docLink`For ${reportType}, the ${\"[latestVersion]\"} URL must point to somewhere at https://www.w3.org/.`;\n const hint = `Ask a W3C Team Member for a W3C URL where the report can be published.`;\n showError(msg, name, { hint });\n return;\n }\n }\n}\n\nasync function deriveHistoryURI(conf) {\n if (!conf.shortName || conf.historyURI === null || !conf.latestVersion) {\n return; // Nothing to do\n }\n\n const canShowHistory = conf.isEd || trStatus.includes(conf.specStatus);\n\n if (conf.historyURI && !canShowHistory) {\n const msg = docLink`The ${\"[historyURI]\"} can't be used with non /TR/ documents.`;\n const hint = docLink`Please remove ${\"[historyURI]\"}.`;\n showError(msg, name, { hint });\n conf.historyURI = null;\n return;\n }\n\n const historyURL = new URL(\n conf.historyURI ?? conf.shortName,\n \"https://www.w3.org/standards/history/\"\n );\n\n // If it's on the Rec Track or it's TR worthy, then allow history override.\n // Also make a an exception for FPWD, DNOTE, NOTE and DRY.\n if (\n (conf.historyURI && canShowHistory) ||\n [\"FPWD\", \"DNOTE\", \"NOTE\", \"DRY\"].includes(conf.specStatus)\n ) {\n conf.historyURI = historyURL.href;\n return;\n }\n\n // Let's get the history from the W3C.\n // Do a fetch HEAD request to see if the history exists...\n // We don't discriminate... if it's on the W3C website with a history,\n // we show it.\n try {\n const response = await fetch(historyURL, { method: \"HEAD\" });\n if (response.ok) {\n conf.historyURI = response.url;\n }\n } catch {\n // Ignore fetch errors\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 sotdClone.nodeType === Node.ELEMENT_NODE &&\n // @ts-ignore\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","// @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 recTrackStatus,\n registryTrackStatus,\n status2text,\n tagStatus,\n trStatus,\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/2021/logos/W3C\",\n alt: \"W3C\",\n height: 48,\n width: 72,\n url: \"https://www.w3.org/\",\n};\n\nconst 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 height: \"48\",\n};\n\nconst w3cDefaults = {\n lint: {\n \"privsec-section\": false,\n \"required-sections\": true,\n \"wpt-tests-exist\": false,\n \"informative-dfn\": \"warn\",\n \"no-unused-dfns\": \"warn\",\n a11y: false,\n },\n doJsonLd: false,\n logos: [],\n xref: true,\n wgId: \"\",\n otherLinks: [],\n excludeGithubLinks: true,\n subtitle: \"\",\n prevVersion: \"\",\n formerEditors: [],\n editors: [],\n authors: [],\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 validateStatusForGroup(conf);\n processLogos(conf);\n}\n\nfunction processLogos(conf) {\n // Primarily include the W3C logo and license for W3C Recommendation track\n // that have an actual working group.\n const { specStatus, wg } = conf;\n const isWgStatus = [\n ...recTrackStatus,\n ...registryTrackStatus,\n ...W3CNotes,\n ...tagStatus,\n \"ED\",\n ].includes(specStatus);\n const inWorkingGroup = wg && wg.length && isWgStatus;\n // Member submissions don't need to be in a Working Group.\n const doesNotNeedWG = [\"Member-SUBM\"].includes(specStatus);\n const canShowW3CLogo = inWorkingGroup || doesNotNeedWG;\n if (canShowW3CLogo) {\n conf.logos.unshift(w3cLogo);\n if (specStatus === \"Member-SUBM\") {\n conf.logos.push(memSubmissionLogo);\n }\n }\n}\n\nfunction validateStatusForGroup(conf) {\n const { specStatus, groupType, group } = conf;\n\n if (!specStatus) {\n const msg = docLink`The ${\"[specStatus]\"} configuration option is required.`;\n const hint = docLink`Select an appropriate status from ${\"[specStatus]\"} based on your W3C group. If in doubt, use \\`\"unofficial\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"base\";\n return;\n }\n\n if (status2text[specStatus] === undefined) {\n const msg = docLink`The ${\"[specStatus]\"} \"\\`${specStatus}\\`\" is not supported at for this type of document.`;\n const choices = codedJoinOr(Object.keys(status2text), { quotes: true });\n const hint = docLink`set ${\"[specStatus]\"} to one of: ${choices}.`;\n showError(msg, name, { hint });\n conf.specStatus = \"base\";\n return;\n }\n\n switch (groupType) {\n case \"cg\": {\n if (![...cgStatus, \"unofficial\", \"UD\"].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\", \"UD\"].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 (![...trStatus, \"unofficial\", \"UD\", \"ED\"].includes(specStatus)) {\n const msg = docLink`W3C Working Group documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const hint = docLink`Pleas see ${\"[specStatus]\"} for appropriate status for W3C Working Group documents.`;\n showError(msg, name, { hint });\n }\n break;\n }\n case \"other\":\n if (\n group === \"tag\" &&\n ![\"ED\", ...trStatus, ...tagStatus].includes(specStatus)\n ) {\n const msg = docLink`The W3C Technical Architecture Group's documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const supportedStatus = codedJoinOr([\"ED\", ...trStatus, ...tagStatus], {\n quotes: true,\n });\n const hint = `Please use one of: ${supportedStatus}. Automatically falling back to \\`\"unofficial\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"unofficial\";\n }\n break;\n default:\n if (\n !conf.wgId &&\n ![\"unofficial\", \"base\", \"UD\", \"Member-SUBM\"].includes(conf.specStatus)\n ) {\n const msg =\n \"Document is not associated with a [W3C group](https://respec.org/w3c/groups/). Defaulting to 'base' status.\";\n const hint = docLink`Use the ${\"[group]\"} configuration option to associated this document with a W3C group.`;\n conf.specStatus = \"base\";\n showError(msg, name, { hint });\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/* --- INLINES --- */\n:is(h1, h2, h3, h4, h5, h6, a) 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\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\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\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 { W3CNotes, recTrackStatus, registryTrackStatus } from \"./headers.js\";\nimport { createResourceHint, linkCSS } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { sub } from \"../core/pubsubhub.js\";\nexport const name = \"w3c/style\";\n\nfunction attachFixupScript() {\n const script = html`<script src=\"https://www.w3.org/scripts/TR/2021/fixup.js\">`;\n if (location.hash) {\n script.addEventListener(\n \"load\",\n () => {\n window.location.href = location.hash;\n },\n { once: true }\n );\n }\n document.body.appendChild(script);\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/2021/fixup.js\",\n as: \"script\",\n },\n {\n hint: \"preload\", // all specs include on base.css.\n href: \"https://www.w3.org/StyleSheets/TR/2021/base.css\",\n as: \"style\",\n },\n {\n hint: \"preload\", // all specs show the logo.\n href: \"https://www.w3.org/StyleSheets/TR/2021/logos/W3C\",\n as: \"image\",\n corsMode: \"anonymous\",\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(html`<link\n rel=\"stylesheet\"\n href=\"https://www.w3.org/StyleSheets/TR/2021/base.css\"\n class=\"removeOnSave\"\n/>`);\nif (!document.head.querySelector(\"meta[name=viewport]\")) {\n // Make meta viewport the first element in the head.\n elements.prepend(\n html`<meta\n name=\"viewport\"\n content=\"width=device-width, initial-scale=1, shrink-to-fit=no\"\n />`\n );\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 const canonicalStatus = conf.specStatus?.toUpperCase() ?? \"\";\n let styleFile = \"\";\n const canUseW3CStyle =\n [\n ...recTrackStatus,\n ...registryTrackStatus,\n ...W3CNotes,\n \"ED\",\n \"MEMBER-SUBM\",\n ].includes(canonicalStatus) && conf.wgId;\n\n // Figure out which style file to use.\n switch (canonicalStatus) {\n case \"WD\":\n case \"FPWD\":\n styleFile = canUseW3CStyle ? \"W3C-WD\" : \"base.css\";\n break;\n case \"CG-DRAFT\":\n case \"CG-FINAL\":\n case \"BG-DRAFT\":\n case \"BG-FINAL\":\n styleFile = canonicalStatus.toLowerCase();\n break;\n case \"UD\":\n case \"UNOFFICIAL\":\n styleFile = \"W3C-UD\";\n break;\n case \"FINDING\":\n case \"DRAFT-FINDING\":\n case \"EDITOR-DRAFT-FINDING\":\n case \"BASE\":\n styleFile = \"base.css\";\n break;\n default:\n styleFile = canUseW3CStyle ? `W3C-${conf.specStatus}` : \"base.css\";\n }\n\n // Attach W3C fixup script after we are done.\n if (!conf.noToc) {\n sub(\"end-all\", attachFixupScript, { once: true });\n }\n const finalStyleURL = new URL(\n `/StyleSheets/TR/2021/${styleFile}`,\n \"https://www.w3.org/\"\n );\n linkCSS(document, finalStyleURL.href);\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/**\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 commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\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 // 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 if (!conf.excludeGithubLinks) {\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: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n}\n","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\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) {\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(structure(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/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\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\nexport function run() {\n restructure(document.body);\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 { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.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 await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\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()).slice(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 if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\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 // We replace \":<br>\" with \":\", and \"<br>\" with \"-\", as appropriate.\n const tempElem = document.createElement(\"h1\");\n tempElem.innerHTML = h1Elem.innerHTML\n .replace(/:<br>/g, \": \")\n .replace(/<br>/g, \" - \");\n let documentTitle = norm(tempElem.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, norm, renameElement, showError } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.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 abstract = findAbstract();\n if (!abstract) {\n const msg = 'Document must have one `<section id=\"abstract\">`.';\n showError(msg, name);\n return;\n }\n abstract.classList.add(\"introductory\");\n abstract.id = \"abstract\";\n if (!abstract.querySelector(\"h2\")) {\n abstract.prepend(html`<h2>${l10n.abstract}</h2>`);\n }\n}\n\nfunction findAbstract() {\n /** @type {HTMLElement} */\n const abstract = document.querySelector(\"#abstract\");\n if (abstract) {\n switch (abstract.localName) {\n case \"section\":\n return abstract;\n case \"div\":\n // Legacy documents may use a div\n return renameElement(abstract, \"section\");\n default:\n showError(\"The abstract should be a `<section>` element.\", name, {\n elements: [abstract],\n });\n return abstract;\n }\n }\n\n // Let's try find it by checking the headings.\n // This can happen if the document was generated\n // using markdown.\n const searchString = l10n.abstract.toLowerCase();\n for (const header of document.querySelectorAll(\"h2, h3, h4, h5, h6\")) {\n const contents = norm(header.textContent).toLowerCase();\n if (contents === searchString) {\n return header.closest(\"section\");\n }\n }\n return null;\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\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\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 {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\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, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\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-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 { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || 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>${text || identifier}</code></a\n >${!text || textArgs ? html`<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 /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = 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 // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\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<BiblioData?>} 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<BiblioData?>} 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 {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\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 {BiblioData} 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 let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\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 // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\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 // 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\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, 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 reference_not_found: \"Reference not found.\",\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 reference_not_found: \"Referencia no encontrada.\",\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 [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PER\", \"W3C Proposed Edited Recommendation\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\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 > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\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} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\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(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\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 /\\bMÜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NÖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDÜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKÖNNEN\\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\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-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}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></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 return html`<a\n data-link-type=\"dfn\"\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\", \"svg\"];\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 <h1>${l10n.conformance}</h1>\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 {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\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 [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup 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\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\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\n:is(aside,div).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\n:is(aside,div).example {\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}\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\";\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 const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\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 addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\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.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\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\";\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 {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 issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\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 });\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}${\n report.number ? ` ${report.number}` : \"\"\n }`;\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 `<h1>${l10n.issue_summary}</h1>`\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/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#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 allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\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`<h1>Best Practices Summary</h1>`);\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 getPreviousSections,\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`<h1>${l10n.list_of_figures}</h1>`,\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(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\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","// @ts-check\n// Module core/tables\n// Handles tables in the document.\n// Generates a List of Tables wherever there is a #list-of-tables element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/tables\";\n\nconst localizationStrings = {\n en: {\n list_of_tables: \"List of Tables\",\n table: \"Table \",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n const listOfTables = collectTables();\n const listOfTablesElement = document.querySelector(\"section#list-of-tables\");\n if (listOfTables.length && listOfTablesElement) {\n decorateListOfTables(listOfTablesElement);\n listOfTablesElement.append(\n html`<h1>${l10n.list_of_tables}</h1>`,\n html`<ul class=\"list-of-tables\">\n ${listOfTables}\n </ul>`\n );\n }\n}\n\n/**\n * process all tables\n */\nfunction collectTables() {\n /** @type {HTMLLIElement[]} */\n const listOfTables = [];\n /** @type {NodeListOf<HTMLTableElement>} */\n const tables = document.querySelectorAll(\"table.numbered\");\n [...tables]\n // there is a separate linter rule to catch numbered tables without captions\n .filter(table => !!table.querySelector(\"caption\"))\n .forEach((table, i) => {\n const caption = table.querySelector(\"caption\");\n decorateTable(table, caption, i);\n listOfTables.push(getListOfTablesListItem(table.id, caption));\n });\n return listOfTables;\n}\n\n/**\n * @param {HTMLTableElement} table\n * @param {HTMLTableCaptionElement} caption\n * @param {number} i\n */\nfunction decorateTable(table, caption, i) {\n const title = caption.textContent;\n addId(table, \"table\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"table-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${table.id}\"\n >${l10n.table}<bdi class=\"tableno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} tableId\n * @param {HTMLTableCaptionElement} caption\n * @return {HTMLLIElement}\n */\nfunction getListOfTablesListItem(tableId, caption) {\n const listOfTablesCaption = caption.cloneNode(true);\n for (const anchor of listOfTablesCaption.querySelectorAll(\"a\")) {\n renameElement(anchor, \"span\", { copyAttributes: false });\n }\n return html`<li>\n <a class=\"tocxref\" href=\"${`#${tableId}`}\"\n >${listOfTablesCaption.childNodes}</a\n >\n </li>`;\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} listOfTablesElement\n */\nfunction decorateListOfTables(listOfTablesElement) {\n if (\n listOfTablesElement.matches(\".appendix, .introductory\") ||\n listOfTablesElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(listOfTablesElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n listOfTablesElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n listOfTablesElement.classList.add(\"appendix\");\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:is(:focus:hover,.selected:focus) {\n border-color: #51a7e8;\n}\n\n.respec-button-copy-paste:is(:hover,:active,.zeroclipboard-is-hover,.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:is(:active,.selected,.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:is(:disabled,:disabled:hover,.disabled,.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\") {\n return wrapped;\n }\n let type = \"_IDL_\";\n let cite = null;\n let lt;\n switch (unescaped) {\n case \"object\":\n type = \"interface\";\n cite = \"WEBIDL\";\n break;\n }\n return html`<a\n data-link-type=\"${type === \"_IDL_\" ? \"idl\" : type}\"\n data-xref-type=\"${type}\"\n data-cite=\"${cite}\"\n 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// IDL types that never need a data-dfn-for\nconst topLevelIdlTypes = [\n \"interface\",\n \"interface mixin\",\n \"dictionary\",\n \"namespace\",\n \"enum\",\n \"typedef\",\n \"callback\",\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 idlType = elem.dataset.dfnType;\n\n const parent = elem.parentElement.closest(\"[data-idl][data-title]\");\n if (parent && !topLevelIdlTypes.includes(idlType)) {\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 if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\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 if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\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 { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\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 =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\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 return dfnsByType.get(linkType) || 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 (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\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} 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\n/** @type {{ term: string; spec: string; element: HTMLElement }[]} */\nexport const informativeRefsInNormative = [];\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 // This is used by the informative-dfn linter\n informativeRefsInNormative.push({ term, spec: cite, element: 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`[See search matches for \"${originalTerm}\"](${howToCiteURL}) or ${\"[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","/*\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 // See below...\n sub(\"toc\", () => {}, { once: true });\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, h1\")) {\n index.prepend(html`<h1>${l10n.heading}</h1>`);\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 =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\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/**\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","// @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 getIntlData,\n parents,\n renameElement,\n showError,\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 (\"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, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) 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 const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\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\n.caniuse-stats {\n display: flex;\n column-gap: 2em;\n}\n\n.caniuse-group {\n display: flex;\n flex: 1;\n flex-direction: column;\n justify-content: flex-end;\n flex-basis: auto;\n}\n\n.caniuse-browsers {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n flex-wrap: wrap;\n margin-top: .2em;\n column-gap: .4em;\n border-bottom: 1px solid #ccc;\n row-gap: .4em;\n padding-bottom: .4cm;\n}\n\n.caniuse-type {\n align-self: center;\n border-top: none;\n text-transform: capitalize;\n font-size: .8em;\n margin-top: -.8em;\n font-weight: bold;\n}\n\n.caniuse-type span {\n background-color: white;\n padding: 0 0.4em;\n}\n\n/* a browser version */\n.caniuse-cell {\n align-items: center;\n border-radius: 1cm;\n color: #fff;\n display: flex;\n font-size: 90%;\n min-width: 1.5cm;\n padding: .3rem;\n justify-content: space-evenly;\n --supported: #2a8436dd;\n --no-support: #c44230dd;\n --no-support-alt: #b43b2bdd;\n --partial: #807301dd;\n --partial-alt: #746c00dd;\n --unknown: #757575;\n\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\nimg.caniuse-browser {\n filter: drop-shadow(0px 0px .1cm #666666);\n}\n\n.caniuse-cell span.browser-version {\n margin-left: 0.4em;\n text-shadow: 0 0 0.1em #fff;\n font-weight: 100;\n font-size: .9em;\n}\n\n.caniuse-stats a[href] {\n white-space: nowrap;\n align-self: flex-end;\n}\n\n/* supports */\n.caniuse-cell.y {\n background: var(--supported);\n}\n\n/* no support, disabled by default */\n.caniuse-cell:is(.n,.d) {\n --caniuse-angle: 45deg;\n --caniuse-bg: var(--no-support);\n --caniuse-bg-alt: var(--no-support-alt);\n}\n\n.caniuse-cell.u {\n background: var(--unknown);\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:is(.a,.x,.p) {\n --caniuse-angle: 90deg;\n --caniuse-bg: var(--partial);\n --caniuse-bg-alt: var(--partial-alt);\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:is(.a,.d,.p,.x,.u)::before {\n content: \"⚠️\";\n padding: 0.5em;\n }\n}\n`;\n","// @ts-check\n/**\n * Module: \"core/caniuse\"\n * Adds a caniuse support table for a \"feature\" #1238\n * Usage options: https://github.com/w3c/respec/wiki/caniuse\n */\nimport { 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\nexport const BROWSERS = new Map([\n [\"and_chr\", { name: \"Android Chrome\", path: \"chrome\", type: \"mobile\" }],\n [\"and_ff\", { name: \"Android Firefox\", path: \"firefox\", type: \"mobile\" }],\n [\"and_uc\", { name: \"Android UC\", path: \"uc\", type: \"mobile\" }],\n [\"chrome\", { name: \"Chrome\", type: \"desktop\" }],\n [\"edge\", { name: \"Edge\", type: \"desktop\" }],\n [\"firefox\", { name: \"Firefox\", type: \"desktop\" }],\n [\"ios_saf\", { name: \"iOS Safari\", path: \"safari-ios\", type: \"mobile\" }],\n [\"op_mob\", { name: \"Opera Mobile\", path: \"opera\", type: \"mobile\" }],\n [\"opera\", { name: \"Opera\", type: \"desktop\" }],\n [\"safari\", { name: \"Safari\", type: \"desktop\" }],\n [\n \"samsung\",\n { name: \"Samsung Internet\", path: \"samsung-internet\", type: \"mobile\" },\n ],\n]);\n\nconst statToText = new Map([\n [\"a\", \"almost supported (aka Partial support)\"],\n [\"d\", \"disabled by default\"],\n [\"n\", \"no support, or disabled by default\"],\n [\"p\", \"no support, but has Polyfill\"],\n [\"u\", \"unknown support\"],\n [\"x\", \"requires prefix to work\"],\n [\"y\", \"supported by default\"],\n]);\n\nexport function prepare(conf) {\n if (!conf.caniuse) {\n return; // nothing to do.\n }\n normalizeCaniuseConf(conf);\n validateBrowsers(conf);\n const options = conf.caniuse;\n if (!options.feature) {\n return; // no feature to show\n }\n\n document.head.appendChild(html`<style\n id=\"caniuse-stylesheet\"\n class=\"${options.removeOnSave ? \"removeOnSave\" : \"\"}\"\n >\n ${css}\n </style>`);\n}\n/**\n * @param {string} browser\n * @returns\n */\nfunction getLogoSrc(browser) {\n const path = BROWSERS.get(browser).path ?? browser;\n return `https://cdn.w3.org/assets/logos/browser-logos/${path}/${path}.svg`;\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 const headDlElem = document.querySelector(\".head dl\");\n const contentPromise = fetchStats(conf.caniuse)\n .then(json => processJson(json, options))\n .catch(err => handleError(err, options, featureURL));\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 pub(\"amend-user-config\", { caniuse: options.feature });\n if (options.removeOnSave) {\n // Will remove the browser support cells.\n headDlElem\n .querySelectorAll(\".caniuse-browser\")\n .forEach(elem => elem.classList.add(\"removeOnSave\"));\n sub(\"beforesave\", outputDoc => {\n html.bind(outputDoc.querySelector(\".caniuse-stats\"))`\n <a href=\"${featureURL}\">caniuse.com</a>`;\n });\n }\n}\n\nfunction handleError(err, options, featureURL) {\n const msg = `Failed to retrieve feature \"${options.feature}\".`;\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/**\n * returns normalized `conf.caniuse` configuration\n * @param {Object} conf configuration settings\n */\nfunction normalizeCaniuseConf(conf) {\n const defaultBrowsers = new Set(BROWSERS.keys());\n defaultBrowsers.delete(\"op_mob\");\n defaultBrowsers.delete(\"opera\");\n const DEFAULTS = { removeOnSave: true, browsers: [...defaultBrowsers] };\n if (typeof conf.caniuse === \"string\") {\n conf.caniuse = { feature: conf.caniuse, ...DEFAULTS };\n return;\n }\n conf.caniuse = { ...DEFAULTS, ...conf.caniuse };\n}\n\nfunction validateBrowsers({ caniuse }) {\n const { browsers } = caniuse;\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\nasync function processJson(json, { feature }) {\n /** @type {Array} */\n const results = json.result;\n const groups = new Map([\n [\"desktop\", []],\n [\"mobile\", []],\n ]);\n const toBrowserCell = browserCellRenderer(feature);\n results.reduce(toBrowserCell, groups);\n const out = [...groups]\n .filter(([, arr]) => arr.length)\n .map(\n ([key, arr]) =>\n html`<div class=\"caniuse-group\">\n <div class=\"caniuse-browsers\">${arr}</div>\n <div class=\"caniuse-type\"><span>${key}</div>\n </div>`\n );\n out.push(\n html`<a class=\"caniuse-cell\" href=\"https://caniuse.com/${feature}\"\n >More info</a\n >`\n );\n return out;\n}\n\nfunction browserCellRenderer(feature) {\n return (groups, { browser: browserId, version, caniuse }) => {\n const { name, type } = BROWSERS.get(browserId);\n const versionLong = version ? ` version ${version}` : \"\";\n const browserName = `${name}${versionLong}`;\n const supportLevel = statToText.get(caniuse);\n const ariaLabel = `${feature} is ${supportLevel} since ${browserName} on ${type}.`;\n const cssClass = `caniuse-cell ${caniuse}`;\n const title = capitalize(`${supportLevel} since ${browserName}.`);\n const textVersion = version ? version : \"—\";\n const src = getLogoSrc(browserId);\n const result = html`\n <div class=\"${cssClass}\" title=\"${title}\" aria-label=\"${ariaLabel}\">\n <img\n class=\"caniuse-browser\"\n width=\"20\"\n height=\"20\"\n src=\"${src}\"\n alt=\"${name} logo\"\n /><span class=\"browser-version\">${textVersion}</span>\n </div>\n `;\n groups.get(type).push(result);\n return groups;\n };\n}\n\n/**\n * @typedef {Record<string, [string, string[]][]>} ApiResponse\n * @throws {Error} on failure\n */\nasync function fetchStats(options) {\n const { feature, browsers, apiURL } = options;\n const url = new URL(apiURL || `./${feature}`, API_URL);\n browsers.forEach(browser => url.searchParams.append(\"browsers\", browser));\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 return response.json();\n}\n\nfunction capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\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: 3rem;\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://cdn.w3.org/assets/logos/browser-logos/chrome/chrome.svg);\n}\n\n.mdn .edge::before,\n.mdn .edge_mobile::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/edge/edge.svg);\n}\n\n.mdn .firefox::before,\n.mdn .firefox_android::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/firefox/firefox.svg);\n}\n\n.mdn .opera::before,\n.mdn .opera_android::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/opera/opera.svg);\n}\n\n.mdn .safari::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/safari/safari.svg);\n}\n\n.mdn .safari_ios::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/safari-ios/safari-ios.svg);\n}\n\n.mdn .samsunginternet_android::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/samsung-internet/samsung-internet.svg);\n}\n\n.mdn .webview_android::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/android-webview/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 // 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 { concatDate, 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 ext: \"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 ext: \"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 ext: \"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\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"💾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\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 { getIntlData } from \"../core/utils.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 l10n = getIntlData(localizationStrings);\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 { W3CNotes, recTrackStatus, registryTrackStatus } from \"./headers.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { resolveRef } from \"../core/biblio.js\";\nimport { showWarning } from \"../core/utils.js\";\nexport const name = \"w3c/seo\";\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};\n\nexport const requiresCanonicalLink = new Set([\n ...W3CNotes,\n ...recTrackStatus,\n ...registryTrackStatus,\n \"BG-FINAL\",\n \"CG-FINAL\",\n \"CRY\",\n \"DRY\",\n \"draft-finding\",\n \"finding\",\n]);\n\nexport async function run(conf) {\n // Don't include a canonical URL for documents that haven't been published.\n if (\n (!conf.canonicalURI && !requiresCanonicalLink.has(conf.specStatus)) ||\n !conf.shortName\n ) {\n return;\n }\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 (conf.latestVersion) {\n conf.canonicalURI = conf.latestVersion;\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.latestVersion && !conf.canonicalURI) {\n conf.canonicalURI = conf.latestVersion;\n }\n }\n if (conf.canonicalURI) {\n const linkElem = html`<link rel=\"canonical\" href=\"${conf.canonicalURI}\" />`;\n document.head.appendChild(linkElem);\n }\n\n if (conf.doJsonLd) {\n await addJSONLDInfo(conf, document);\n }\n}\n\nasync function addJSONLDInfo(conf, doc) {\n const rdfStatus = status2rdf[conf.specStatus];\n // Content for JSON\n const type = [\"TechArticle\"];\n if (rdfStatus) type.push(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","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\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\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 \"table\": {\n processTable(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 // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\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 processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.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","/* 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-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\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","// @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","import { docLink, showError } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/before-save\";\n\nexport function run(conf) {\n if (!conf.beforeSave) return;\n\n if (\n !Array.isArray(conf.beforeSave) ||\n conf.beforeSave.some(\n el => typeof el !== \"function\" || el.constructor.name === \"AsyncFunction\"\n )\n ) {\n const msg = docLink`${\"[beforeSave]\"} configuration option must be an array of synchronous JS functions.`;\n showError(msg, name);\n return;\n }\n\n sub(\n \"beforesave\",\n documentElement => {\n performTransformations(conf.beforeSave, documentElement.ownerDocument);\n },\n { once: true }\n );\n}\n/**\n * @param {Array<Function>} transforms\n * @param {Document}\n */\nfunction performTransformations(transforms, doc) {\n let pos = 0;\n for (const fn of transforms) {\n try {\n fn(doc);\n } catch (err) {\n const nameOrPosition = `\\`${fn.name}\\`` || `at position ${pos}`;\n const msg = docLink`Function ${nameOrPosition}\\` threw an error during processing of ${\"[beforeSave]\"}.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n } finally {\n pos++;\n }\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,#w3c-state)\");\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-captionless-tables\".\n *\n * Checks that there are no tables in the document which don't start\n * with a caption element.\n *\n * As some tables may not contain tabular data, this only applies to\n * tables marked with class=\"numbered\".\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-captionless-tables\";\nexport const name = \"core/linter-rules/no-captionless-tables\";\n\nconst localizationStrings = {\n en: {\n msg: \"All tables marked with class='numbered' must start with a caption element.\",\n hint: \"Add a `caption` to the offending table.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const tables = document.querySelectorAll(\"table.numbered\");\n const offendingElements = [...tables].filter(\n table => !(table.firstElementChild instanceof HTMLTableCaptionElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-dfns\".\n *\n * Complains if an internal/un-exported definitions is not linked to.\n */\nimport {\n docLink,\n getIntlData,\n norm,\n showError,\n showWarning,\n} from \"../utils.js\";\n\nconst ruleName = \"no-unused-dfns\";\nexport const name = \"core/linter-rules/no-unused-dfns\";\n\nconst localizationStrings = {\n en: {\n msg(text) {\n return `Found definition for \"${text}\", but nothing links to it. This is usually a spec bug!`;\n },\n get hint() {\n return docLink`\n You can do one of the following...\n\n * Add a \\`class=\"lint-ignore\"\\` attribute the definition.\n * Either remove the definition or change \\`<dfn>\\` to another type of HTML element.\n * If you meant to ${\"[export|#data-export]\"} the definition, add \\`class=\"export\"\\` to the definition.\n\n To silence this warning entirely, set \\`lint: { \"no-unused-dfns\": false }\\` in your \\`respecConfig\\`.`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) return;\n const logger = conf.lint[ruleName] === \"error\" ? showError : showWarning;\n /** @type NodeListOf<HTMLElement> */\n const definitions = document.querySelectorAll(\n \"dfn:not(.lint-ignore, [data-export], [data-cite])\"\n );\n\n const elements = [...definitions].filter(isDfnUnused);\n\n // These are usually bad spec bugs, so best shown individually.\n elements.forEach(element => {\n const elements = [element];\n const text = norm(element.textContent);\n logger(l10n.msg(text), name, { elements, hint: l10n.hint });\n });\n}\n\nfunction isDfnUnused(dfn) {\n // Not in the index\n // and not the \"self-link\" box\n return !document.querySelector(\n `a[href=\"#${dfn.id}\"]:not(.index-term, .self-link)`\n );\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\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\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 * The W3C Process requires separate Privacy Considerations and Security\n * Considerations sections. This linter checks for the presence of these\n * sections, and reports an error if they are not present.\n */\n\nimport {\n InsensitiveStringSet,\n docLink,\n getIntlData,\n getIntlDataForKey,\n norm,\n showError,\n showWarning,\n} from \"../../core/utils.js\";\nimport { W3CNotes, recTrackStatus } from \"../headers.js\";\n\nconst ruleName = \"required-sections\";\nexport const name = \"w3c/linter-rules/required-sections\";\n\nconst localizationStrings = {\n en: {\n msg(sectionTitle) {\n return `W3C Recommendation track documents require a separate \"${sectionTitle}\" section.`;\n },\n hint(sectionTitle) {\n return docLink`Add a \\`<section>\\` with a \"${sectionTitle}\" header. See the [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).\n If the document is not intended for the W3C Recommendation track, set ${\"[noRecTrack]\"} to \\`true\\`\n or turn off the ${`[${ruleName}]`} linter rule.`;\n },\n privacy_considerations: \"Privacy Considerations\",\n security_considerations: \"Security Considerations\",\n },\n es: {\n msg(sectionTitle) {\n return `Documentos que van a ser \"W3C Recommendation\" requieren una sección \"${sectionTitle}\" separada.`;\n },\n hint(sectionTitle) {\n return docLink`Agrega una \\`<section>\\` con título \"${sectionTitle}\". Ver los [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).\n Si el documento no está destinado a ser un W3C Recommendation, puedes poner ${\"[noRecTrack]\"} a \\`true\\`\n o apaga la regla de linter ${`[${ruleName}]`}.`;\n },\n privacy_considerations: \"Consideraciones de privacidad\",\n security_considerations: \"Consideraciones de Seguridad\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport const requiresSomeSectionStatus = new Set([...recTrackStatus]);\nrequiresSomeSectionStatus.delete(\"DISC\"); // \"Discontinued Draft\"\n// W3C notes do not require privacy or security considerations sections.\nW3CNotes.forEach(note => requiresSomeSectionStatus.delete(note));\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can't check for headers unless we also have a translation\n if (!getIntlDataForKey(localizationStrings, \"privacy_considerations\")) {\n // We can't check for headers unless we also have a translation\n const msg = `Cannot check for required sections as translations are not available.`;\n const hint = `File an issue to add translations or use a supported language.`;\n showWarning(msg, name, { hint });\n return;\n }\n\n if (conf.noRecTrack || !requiresSomeSectionStatus.has(conf.specStatus)) {\n return;\n }\n\n const logger = conf.lint[ruleName] === \"error\" ? showError : showWarning;\n\n const missingRequiredSections = new InsensitiveStringSet([\n l10n.privacy_considerations,\n l10n.security_considerations,\n ]);\n\n /** @type {NodeListOf<HTMLElement>} */\n const headers = document.querySelectorAll(\"h2, h3, h4, h5, h6\");\n for (const header of headers) {\n const clone = header.cloneNode(true);\n // section number and self-link anchor\n clone.querySelectorAll(\"bdi\")?.forEach(elem => elem.remove());\n const text = norm(clone.textContent);\n if (missingRequiredSections.has(text)) {\n missingRequiredSections.delete(text);\n // Check if we find them all...\n if (missingRequiredSections.size === 0) {\n return; // All present, early return!\n }\n }\n }\n\n // Show the ones we didn't find individually\n for (const title of missingRequiredSections) {\n logger(l10n.msg(title), name, {\n hint: l10n.hint(title),\n });\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\") && conf[key]) || 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@4/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","// @ts-check\n/**\n * Linter rule \"informative-dfn\".\n *\n * Complains if an informative definition is referenced from a normative section.\n */\nimport { docLink, getIntlData, showError, showWarning } from \"../utils.js\";\n\nimport { informativeRefsInNormative } from \"../xref.js\";\n\nconst ruleName = \"informative-dfn\";\nexport const name = \"core/linter-rules/informative-dfn\";\n\nconst localizationStrings = {\n en: {\n msg(term, cite) {\n return `Normative reference to \"${term}\" found but term is defined \"informatively\" in \"${cite}\".`;\n },\n get hint() {\n return docLink`\n You can do one of the following...\n\n * Get the source definition to be made normative\n * Add a \\`class=\"lint-ignore\"\\` attribute to the link.\n * Use a local normative proxy for the definition à la \\`<dfn data-cite=\"spec\">term</dfn>\\`\n\n To silence this warning entirely, set \\`lint: { \"${ruleName}\": false }\\` in your \\`respecConfig\\`.`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) return;\n const logger = conf.lint[ruleName] === \"error\" ? showError : showWarning;\n\n informativeRefsInNormative.forEach(({ term, spec, element }) => {\n if (element.classList.contains(\"lint-ignore\")) return;\n logger(l10n.msg(term, spec), name, {\n title: \"Normative reference to non-normative term.\",\n elements: [element],\n hint: l10n.hint,\n });\n });\n}\n"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","subscriptions","EventTarget","pub","topic","detail","dispatchEvent","CustomEvent","parent","self","args","String","JSON","stringify","stack","postMessage","location","origin","sub","cb","options","once","addEventListener","e","removeList","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","wrapFunction","func","IDBDatabase","prototype","transaction","IDBCursor","advance","continue","continuePrimaryKey","includes","apply","unwrap","this","storeNames","tx","call","sort","transformCachableValue","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","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","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","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","unshift","n","base","appendIfExist","contextAsText","bareMessage","sourceName","input","tokens","syntaxError","validationError","token","Base","constructor","Object","defineProperties","writable","toJSON","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","static","tokeniser","consumeKind","unescape","write","w","ts","separator","Eof","tokenName","list","parser","listName","extAttrValueSyntax","renamedLegacies","extAttrListItems","syntax","toks","ExtendedAttributeParameters","assign","consume","ret","autoParenter","asterisk","secondaryName","rhsIsList","argument_list","close","rhsType","reference_token","p","identifier","SimpleExtendedAttribute","params","parse","defineProperty","rhs","arguments","validate","extAttr","arg","extendedAttribute","extendedAttributeReference","ExtendedAttributes","push","unconsume","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","autofixOptionalDictionaryDefaultValue","indexOf","a","isLastRequiredArgument","getFirstToken","name_token","data","Tokeniser","Operation","special","regular","termination","argument","body","definition","nameless","Attribute","noInherit","readonly","startsWith","allowDangler","first","items","item","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","probeKind","candidates","consumeIdentifier","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","autofixConstructor","factoryFunctions","named","constructors","i","opNames","ops","getOperations","statics","Set","op","nonstatics","groupOperationNames","partials","mixins","mixinMap","ext","additions","checkAdditions","forEach","add","existings","addition","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","productions","production","res","eof","concrete","definitions","noop","templates","Writer","raw","wrapper","bind","id","getMixinMap","include","validateIterable","ast","duplicates","groupDefinitions","dup","checkDuplicatedNames","flat","it","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","paramName","paramValue","toLowerCase","getDefaults","baseUrl","breaks","extensions","gfm","headerIds","headerPrefix","highlight","hooks","langPrefix","mangle","pedantic","renderer","sanitize","sanitizer","silent","smartypants","tokenizer","walkTokens","xhtml","defaults","escapeTest","escapeReplace","RegExp","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape","encode","unescapeTest","_","fromCharCode","parseInt","substring","caret","edit","regex","opt","val","getRegex","nonWordAndColonTest","originIndependentUrl","cleanUrl","href","prot","decodeURIComponent","baseUrls","justDomain","rtrim","relativeBase","protocol","domain","resolveUrl","encodeURI","noopTest","splitCells","tableRow","cells","offset","escaped","curr","invert","l","suffLen","currChar","repeatString","pattern","outputLink","cap","link","lexer","title","state","inLink","inlineTokens","Tokenizer","space","src","rules","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","matchIndentInNode","indentInNode","indentCodeCompensation","inline","_escapes","heading","trimmed","depth","hr","blockquote","top","blockTokens","istask","ischecked","indent","blankLine","endsWithBlankLine","nextLine","rawLine","itemContents","endEarly","bull","isordered","ordered","start","loose","itemRegex","trimLeft","search","nextBulletRegex","min","hrRegex","fencesBeginRegex","headingBeginRegex","task","checked","trimRight","spacers","hasMultipleLineBreaks","pre","tag","table","header","align","rows","j","k","row","lheading","paragraph","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","lDelim","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","rDelimAst","rDelimUnd","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","_paragraph","_label","_title","bullet","listItemStart","_tag","_comment","normal","reflinkSearch","out","charCodeAt","random","toString","_punctuation","blockSkip","escapedEmSt","_scheme","_email","_attribute","_href","strong","middle","endAst","endUnd","em","_extended_email","Lexer","create","inlineQueue","lex","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","startBlock","startIndex","Infinity","tempSrc","tempStart","getStartIndex","errMsg","console","keepPrevChar","keys","lastIndexOf","startInline","Renderer$1","infostring","quote","slugger","slug","listitem","checkbox","tablerow","content","tablecell","flags","image","TextRenderer","Slugger","seen","serialize","getNextSafeSlug","originalSlug","isDryRun","occurenceAccumulator","hasOwnProperty","dryrun","Parser","Renderer","textRenderer","parseInline","l2","l3","cell","itemBody","renderers","Hooks","preprocess","markdown","postprocess","parseMarkdown","origOpt","throwError","msg","onError","marked","warn","checkSanitizeDeprecation","err","pending","setTimeout","setOptions","newDefaults","use","childTokens","pack","prevRenderer","prevTokenizer","prevHook","passThroughHooks","lexInline","globalThis","global","module","pluralizeExports","exports","root","pluralize","commonjsGlobal","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","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","_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","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","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","TypeError","parserMode","inputArray","from","char","trimEnd","fromEntries","parseMimeType","parameters","essence","mimeType","size","paramStr","_pluralize","webidl2","_webidl2","reindent","indents","leastIndent","getElementsByTagName","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","dateLang","docLang","W3CDate","nonNormativeSelector","createResourceHint","URL","baseURI","linkElem","rel","hint","corsMode","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","joinOr","xmlEscape","norm","getIntlData","localizationStrings","getIntlDataForKey","concatDate","date","sep","format","runTransforms","flist","funcArgs","methods","meth","showWarning","fetchAndCache","maxAge","Request","cachedResponse","caches","Date","headers","response","fetch","ok","clonedResponse","clone","customHeaders","Headers","expiryDate","now","toISOString","cacheResponse","Response","blob","put","htmlJoinComma","joined","htmlJoinAnd","addHashId","hash","imul","hashString","addId","pfx","txt","noLC","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","getPreviousSections","sections","previous","previousElementSibling","iteratePreviousElements","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","markAsOffending","details","showError","pluginName","toMDCode","codedJoinOr","quotes","addQuotes","codedJoinAnd","docLink","strings","endsWith","linkingText","mimeTypes","rsDocToDataURL","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$p","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","trimStart","firstTwo","lastTwo","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","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","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","ev","locationHash","l10n$D","group","style$1","github$1","dataInclude","reindent$1","abstract","dataTransform","dataAbbr","inlines","conformance","examples","issuesNotes","bestPractices","figures","tables","webidl","biblio$1","linkToDfn","xref","dataCite","renderBiblio","dfnIndex","contrib","fixHeaders","webidlIndex","structure","informative","idHeaders","caniuse","mdnAnnotation","saveHtml","searchSpecref","searchXref","aboutRespec","seo$1","seo","webidlClipboard","dataTests","listSorter","highlightVars$1","dataType","algorithms","anchorExpander","dfnPanel","webMonetization","beforeSave","checkCharset","checkPunctuation","checkInternalSlots","localRefsExist","noCaptionlessTables","noUnusedDfns","noHeadinglessSections","noUnusedVars","requiredSections","wptTestsExist","noHttpProps","a11y","informativeDfn","ReSpec.run","hasLink","isLegacyFrag","getGroupDetails","shortname","wgId","wg","patentURI","wgPatentURI","patentPolicy","wgPatentPolicy","groupType","wgURI","status","groupDetails","groups","getMultipleGroupDetails","showLink","class","showLinkData","showLogo","logo","alt","height","width","until","es","ko","ja","zh","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","archives","author","authors","commit_history","edited_in_place","editor","editors","feedback","former_editor","former_editors","history","implementation_report","latest_editors_draft","latest_published_version","latest_recommendation","message_topic","more_details_about_this_doc","multiple_alternates","prev_editor_draft","prev_recommendation","prev_version","publication_history","test_suite","this_version","with_subject_line","your_topic_here","nl","getSpecSubTitleElem","specSubTitleElem","subtitle","headersTmpl","logos","specType","isCR","isCRY","longStatus","textStatus","prependW3C","specStatus","dashDate","publishDate","modificationDate","renderSpecTitle","localStorage","getItem","thisVersion","latestVersion","edDraftURI","historyURI","github","commitHistoryURL","testSuiteURI","implementationReportURI","prevED","showPreviousVersion","prevVersion","prevRecURI","isRec","formerEditors","wgPublicList","renderFeedback","errata","otherLinks","shortName","alternateFormats","multipleAlternates","alternatesHTML","existingCopyright","isUnofficial","licenseInfo","copyrightStart","publishYear","additionalCopyrightHolders","short","linkLicense","renderOfficialCopyright","renderCopyright","repoURL","issuesURL","newIssuesURL","pullsURL","fullName","mailToURL","subject","subjectPrefix","mailingListLink","subjectLine","emailSubject","archiveURL","archiveLink","cgbgHeadersTmpl","specTitleElem","specTitleElemClone","isCGFinal","sotd","status_at_publication","processLink","sotdTmpl","isPreview","renderPreview","additionalContent","renderIsUnofficial","isTagFinding","isNoTrack","isMO","renderIsNoTrack","isMemberSubmission","teamComment","getUTCFullYear","submissionCommentNumber","patentPolicyURL","noteForMemberSubmission","noteForSubmission","sotdAfterWGinfo","overrideStatus","changes","revisionTypes","pa","pc","ca","cc","track","status2track","wgHTML","linkToWorkingGroup","updateableRec","revisedRecEnd","reviewTarget","renderIsRec","statusExplanation","reviewPolicy","endorsement","updatePolicy","lsUpdatePolicy","pubMode","humanPREnd","humanCREnd","crEnd","prEnd","renderNotRec","isNote","isRegistry","multipleWGs","wgPatentHTML","producers","renderDeliverer","additionalSections","prUrl","prNumber","cgbgSotdTmpl","mailToWGPublicListWithSubject","mailToWGPublicListSubscription","renderPublicList","issueBase","linkToCommunity","w3Url","status2maturity","LS","LD","FPWD","status2text","DNOTE","NOTE","STMT","MO","ED","WD","CR","CRD","PR","PER","REC","DISC","RSCND","DRY","CRYD","CRY","RY","unofficial","UD","finding","status2long","W3CNotes","recTrackStatus","registryTrackStatus","tagStatus","cgStatus","bgStatus","cgbgStatus","trStatus","noTrackStatus","licenses","patentPolicies","validateDateAndRecover","fallbackDate","isFinite","formattedDate","collectSotdContent","sotdClone","hasChildNodes","isBasic","isCGBG","isCRDraft","isEd","isPER","isPR","isRecTrack","isRegular","isTagEditorFinding","license","lCaseLicense","deriveLicenseInfo","lastModified","pubSpace","derivePubSpace","maturity","docVersion","reportType","latestVersionURL","validateCGBG","validateIfAllowedOnTR","latestPath","previousPublishDate","previousMaturity","prevMaturity","pubDate","prevPubDate","prevRecShortname","uri","publishISODate","shortISODate","policies","policy","validatePatentPolicies","canShowHistory","historyURL","deriveHistoryURI","wgPotentialArray","idx","isPr","perEnd","contains","noRecTrack","notAllowed","mailToWGPublicList","populateSoTD","generatedSubtitle","coreDefaults","lint","highlightVars","addSectionLinks","w3cLogo","memSubmissionLogo","w3cDefaults","doJsonLd","excludeGithubLinks","supportedStatus","validateStatusForGroup","isWgStatus","inWorkingGroup","doesNotNeedWG","processLogos","css$n","noReSpecCSS","attachFixupScript","resourceHints","createResourceHints","canonicalStatus","styleFile","canUseW3CStyle","noToc","finalStyleURL","linkURL","urls","frag","nextLink","linkCSS","exportDoc","w3cStyle","resolveGithubPromise","rejectGithubPromise","file_a_bug","participate","ghURL","tempURL","org","repo","branch","newProps","githubToken","githubUser","atRiskBase","pullBase","githubAPI","hostname","otherLink","normalizedGHObj","apiBase","normalizedConfig","DOMBuilder","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","includeId","default_title","h1Elem","isConnected","tempElem","documentTitle","setDocumentTitle","isInteger","searchString","findAbstract","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","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","range","IDBKeyRange","lowerBound","openCursor","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","aliasesAndRefs","alias","promisesToAdd","flatMap","isInDB","stores","clearStorePromises","clear","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","oneHourFromNow","addAll","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","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","normativity","keywordInterpretation","terms","processConformance","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","dfnFor","validateDefinition","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","computeExport","export","addContractDefaults","dfnsWithNoType","exportableDfns","titles","pluralizeDfn","dfnTexts","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","css$l","makeTitle","num","report","number","div","inAside","exampleTitle","css$j","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","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","issueNumbers","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","img","naturalHeight","naturalWidth","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","decorateTableOfFigures","list_of_tables","listOfTables","decorateTable","tableId","listOfTablesCaption","getListOfTablesListItem","collectTables","listOfTablesElement","decorateListOfTables","topLevelEntities","findDfn","defn","findNormalDfn","findOperationDfn","resolvedName","dfns","getDfns","alternativeDfns","decorateDfn","dfnElem","idlAst","lCaseParent","last","getDataType","local","exportable","addAlternativeNames","asQualifiedName","asMethodName","asFullyQualifiedName","asMethodWithArgs","operationName","argsAst","operationNames","isOptional","requiredArgs","requiredOperation","optionalOps","generateMethodNamesWithArgs","getAlternativeNames","originalName","foundDfns","dfnForArray","closestDfnFor","idlStruct","copyButton","createButton","addCopyIDLButton","idlHeader","idlText","clipboard","writeText","css$h","idlPartials","Text","keyword","wrapped","idlLink","defineIdlName","getIdlDefinitionClassName","parentName","idlId","getNameAndId","getDfnType","isDefaultJSON","unlinkedAnchor","nameResolverMap","getDefnName","getIdlId","resolvePartial","overload","qualifiedName","fullyQualifiedName","resolveOverload","resolveNameAndId","topLevelIdlTypes","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","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkTargets","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","setItem","API_URL","lastUpdated","shouldBustCache","clearXrefData","requiredKeySet","query","cursor","profiles","informativeRefsInNormative","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","fetchFromNetwork","cacheXrefData","getData","ambiguous","notFound","collector","getPrefilledFormURL","howToFix","howToCiteURL","originalTerm","formUrl","specsString","forParent","showErrors","addDataCiteToTerms","css$f","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","idlIndexSec","idlIndex","lowerHeaderTags","toc","scanSections","maxTocLevel","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","css$d","BROWSERS","statToText","defaultBrowsers","DEFAULTS","removeOnSave","browsers","feature","normalizeCaniuseConf","invalidBrowsers","browser","validateBrowsers","featureURL","headDlElem","contentPromise","statusText","fetchStats","toBrowserCell","browserId","browserName","supportLevel","cssClass","textVersion","getLogoSrc","browserCellRenderer","processJson","handleError","definitionPair","outputDoc","css$b","BASE_JSON_PATH","MDN_BROWSERS","chrome","chrome_android","edge","edge_mobile","firefox","firefox_android","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","yesNoUnknown","displayStatus","createRowFromBrowserData","versionData","version_removed","versionAdded","version_added","buildBrowserSupportTable","mdnKey","mdn","getMdnKey","mdnSpecJson","mdnConf","baseJsonPath","getMdnData","findElements","mdnSpecArray","save_snapshot","downloadLinks","epubURL","saveDialog","filename","toDownloadLink","supportsDownload","HTMLAnchorElement","search_specref","specrefSearchUI","xrefSearchUI","about_respec","getEntriesByType","duration","round","perfEntryToTR","firstParagraph","metaElem","status2rdf","LC","requiresCanonicalLink","addPerson","ed","worksFor","addRef","jsonld","creator","publishedDate","isbn","canonicalURI","rdfStatus","w3p","foaf","datePublished","inLanguage","isBasedOn","copyrightHolder","discussionUrl","alternativeHeadline","addl","description","contributor","citationIds","citationContents","citation","addJSONLDInfo","css$9","fetchBase","currentScript","workerPromise","workerScript","respecWorker$1","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","css$7","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","css$5","varMap","variables","currentSection","textNode","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","props","to","connectedCallback","fetchCommits","commits","commit","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","monetization","paymentPointer","rawConfig","canonicalizeConfig","transforms","pos","performTransformations","metas","meta","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLTableCaptionElement","isDfnUnused","logger","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","sectionTitle","privacy_considerations","security_considerations","requiresSomeSectionStatus","missingRequiredSections","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":"sDACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAAON,OAAOC,Q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AAQ,SAAU6V,GAClB,OAAOR,EAAU4B,gBAAgBpB,EAAK,GAAIA,EAAK,GACpD,IAKG,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,WACA7V,QAAQqV,EAAU6B,oBAEb7B,CACV,IAGA,IAAIA,GAAYH,GCjgBsBmC,GAAU,SAASC,GAAgB,IAAIvoB,EAAE,CAAE,EAAC,IAAIA,EAAExG,QAAQA,OAAod,CAA5c,MAAMd,GAAGsH,EAAExG,QAAQ,SAASwG,EAAEtH,GAAG,IAAI2I,EAAE3I,EAAE+N,eAAe+hB,EAAE9vB,EAAEkrB,eAAe1T,EAAElG,EAAEnP,UAAU,OAAOqV,EAAEuY,OAAO,SAAS/vB,GAAG,OAAO4C,KAAKb,IAAI/B,WAAWA,EAAE4C,KAAKub,EAAE,EAAE3G,EAAEpW,IAAI,SAASpB,GAAG,OAAO4C,KAAKb,IAAI/B,GAAGA,EAAE4C,KAAKub,QAAG,CAAM,EAAE3G,EAAEzV,IAAI,SAAS/B,GAAG,OAAO8vB,EAAE/sB,KAAK/C,EAAE4C,KAAKub,EAAE,EAAE3G,EAAE3V,IAAI,SAAS7B,EAAEsH,GAAG,OAAOqB,EAAE3I,EAAE4C,KAAKub,EAAE,CAAC6R,cAA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+{"version":3,"file":"respec-w3c.js","sources":["../src/core/expose-modules.js","../src/core/pubsubhub.js","../src/core/include-config.js","../src/core/l10n.js","../node_modules/idb/build/wrap-idb-value.js","../node_modules/idb/build/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/reindent.js","../src/core/utils.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/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/core/github.js","../src/core/sections.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/tables.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/styles/dfn-index.css.js","../src/core/dfn-index.js","../src/core/contrib.js","../src/core/fix-headers.js","../src/core/webidl-index.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/datatype.css.js","../src/core/data-type.js","../src/styles/algorithms.css.js","../src/core/algorithms.js","../src/core/anchor-expander.js","../src/styles/dfn-panel.css.js","../src/core/dfn-panel.js","../src/core/custom-elements/rs-changelog.js","../src/core/custom-elements/index.js","../src/core/web-monetization.js","../src/core/before-save.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-captionless-tables.js","../src/core/linter-rules/no-unused-dfns.js","../src/core/linter-rules/no-headingless-sections.js","../src/core/linter-rules/no-unused-vars.js","../src/w3c/linter-rules/required-sections.js","../src/core/linter-rules/wpt-tests-exist.js","../src/core/linter-rules/no-http-props.js","../src/core/linter-rules/a11y.js","../src/core/linter-rules/informative-dfn.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/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\nimport { expose } from \"./expose-modules.js\";\n\nconst subscriptions = new EventTarget();\n\n/**\n *\n * @param {EventTopic} topic\n * @param {any} detail\n */\nexport function pub(topic, detail) {\n subscriptions.dispatchEvent(new CustomEvent(topic, { detail }));\n if (window.parent === window.self) {\n return;\n }\n // If this is an iframe, postMessage parent (used in testing).\n const args = String(JSON.stringify(detail?.stack || detail));\n window.parent.postMessage({ topic, args }, window.parent.location.origin);\n}\n\n/**\n * Subscribes to a message type.\n * @param {EventTopic} topic The topic to subscribe to\n * @param {Function} cb Callback function\n * @param {Object} [options]\n * @param {Boolean} [options.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, options = { once: false }) {\n const listener = e => cb(e.detail);\n subscriptions.addEventListener(topic, listener, options);\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/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), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\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', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\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 * @property {string} [ruleName]\n *\n * @typedef {ReturnType<typeof error>} WebIDLErrorData\n *\n * @param {string} message error message\n * @param {*} position\n * @param {*} current\n * @param {*} 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 /**\n * @param {import(\"./tokeniser.js\").Token[]} inputs\n * @param {object} [options]\n * @param {boolean} [options.precedes]\n * @returns\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","export 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","/**\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","export 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","import { Base } from \"./base.js\";\nimport { unescape } from \"./helpers.js\";\n\nexport class WrappedToken extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {string} type\n */\n static parser(tokeniser, type) {\n return () => {\n const value = tokeniser.consumeKind(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 /** @param {import(\"../writer.js\").Writer} w */\n write(w) {\n return w.ts.wrap([\n w.token(this.tokens.value),\n w.token(this.tokens.separator),\n ]);\n }\n}\n\nexport class Eof extends WrappedToken {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const value = tokeniser.consumeKind(\"eof\");\n if (value) {\n return new Eof({ source: tokeniser.source, tokens: { value } });\n }\n }\n\n get type() {\n return \"eof\";\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.js\").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 .../** @type {[string, string][]} */ (\n shouldBeLegacyPrefixed.map((name) => [name, `Legacy${name}`])\n ),\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.js\").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\nexport class ExtendedAttributeParameters extends Base {\n /**\n * @param {import(\"../tokeniser.js\").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 ret.list = [];\n if (tokens.assign) {\n tokens.asterisk = tokeniser.consume(\"*\");\n if (tokens.asterisk) {\n return ret.this;\n }\n tokens.secondaryName = tokeniser.consumeKind(...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 (tokens.assign && !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 (\n this.tokens.assign && !this.tokens.asterisk && !this.tokens.secondaryName\n );\n }\n\n get rhsType() {\n if (this.rhsIsList) {\n return this.list[0].tokens.value.type + \"-list\";\n }\n if (this.tokens.asterisk) {\n return \"*\";\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 const { rhsType } = this;\n return w.ts.wrap([\n w.token(this.tokens.assign),\n w.token(this.tokens.asterisk),\n w.reference_token(this.tokens.secondaryName, this.parent),\n w.token(this.tokens.open),\n ...this.list.map((p) => {\n return rhsType === \"identifier-list\"\n ? w.identifier(p, this.parent)\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.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const name = tokeniser.consumeKind(\"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 : this.params.tokens.secondaryName\n ? unescape(tokens.secondaryName.value)\n : null;\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/whatwg/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/whatwg/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.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const tokens = {};\n tokens.open = tokeniser.consume(\"[\");\n const ret = new ExtendedAttributes({ source: tokeniser.source, tokens });\n if (!tokens.open) return ret;\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(\n \"Expected a closing token for the extended attribute list\"\n );\n if (!ret.length) {\n tokeniser.unconsume(tokens.close.index);\n tokeniser.error(\"An extended attribute list must not be empty\");\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.js\").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.js\").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.js\").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.consumeKind(\"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.js\").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.js\").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({ source, tokens: {} });\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/whatwg/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 {\n unescaped: /** @type {string} (because it's not union) */ (\n this.idlType\n ),\n context: this,\n }\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.js\").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.consumeKind(\"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","import { 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.js\").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.consumeKind(\"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 ...firstToken,\n type: \"optional\",\n value: \"optional\",\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.consumeKind(\"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","import { 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.consumeKind(\"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.js\").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.js\").Tokeniser} tokeniser\n */\nexport function const_value(tokeniser) {\n return (\n tokeniser.consumeKind(\"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.js\").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() || decimal_type();\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.js\").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.js\").Tokeniser} tokeniser\n * @param {string=} typeName (TODO: See Type.type for more details)\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.js\").Tokeniser} tokeniser\n * @param {string=} typeName (TODO: See Type.type for more details)\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.js\").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 {import(\"./interface.js\").Interface} def\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 {Record<string | symbol, any>} 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 const proxy = new Proxy(data, {\n get(target, p) {\n const value = target[p];\n if (Array.isArray(value) && p !== \"source\") {\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 // @ts-ignore https://github.com/microsoft/TypeScript/issues/47357\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 return proxy;\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 \"BigInt64Array\",\n \"BigUint64Array\",\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];\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 line,\n index,\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 probeKind(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.probeKind(\"inline\") && this.source[this.position].value === value\n );\n }\n\n /**\n * @param {...string} candidates\n */\n consumeKind(...candidates) {\n for (const type of candidates) {\n if (!this.probeKind(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.probeKind(\"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 {string} value\n */\n consumeIdentifier(value) {\n if (!this.probeKind(\"identifier\")) {\n return;\n }\n if (this.source[this.position].value !== value) {\n return;\n }\n return this.consumeKind(\"identifier\");\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\nexport class EnumValue extends WrappedToken {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const value = tokeniser.consumeKind(\"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.js\").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.consumeKind(\"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.probeKind(\"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","import { Base } from \"./base.js\";\nimport { unescape } from \"./helpers.js\";\n\nexport class Includes extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n */\n static parse(tokeniser) {\n const target = tokeniser.consumeKind(\"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.consumeKind(\"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.js\").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.consumeKind(\"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.consumeKind(\"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.consumeKind(\"identifier\") ||\n tokeniser.error(\"Inheritance lacks a type\");\n return { colon, inheritance };\n}\n\nexport class Container extends Base {\n /**\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {*} instance TODO: This should be {T extends Container}, but see https://github.com/microsoft/TypeScript/issues/4628\n * @param {*} args\n */\n static parse(tokeniser, instance, { inheritable, allowedMembers }) {\n const { tokens, type } = instance;\n tokens.name =\n tokeniser.consumeKind(\"identifier\") ||\n tokeniser.error(`Missing name in ${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.consumeKind(\"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.consumeKind(\"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 ret = autoParenter(\n new IterableLike({ source: tokeniser.source, tokens: {} })\n );\n const { tokens } = ret;\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.js\").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 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.js\").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.js\").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 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 source: interfaceDef.source,\n tokens: {},\n });\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","import { validationError } from \"../error.js\";\n\n/**\n * @param {import(\"../validator.js\").Definitions} defs\n * @param {import(\"../productions/container.js\").Container} i\n */\nexport function* checkInterfaceMemberDuplication(defs, i) {\n const opNames = groupOperationNames(i);\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 const statics = additions.filter((a) => a.special === \"static\");\n const nonstatics = additions.filter((a) => a.special !== \"static\");\n yield* checkAdditions(statics, opNames.statics, ext, i);\n yield* checkAdditions(nonstatics, opNames.nonstatics, ext, i);\n statics.forEach((op) => opNames.statics.add(op.name));\n nonstatics.forEach((op) => opNames.nonstatics.add(op.name));\n }\n\n /**\n * @param {import(\"../productions/operation.js\").Operation[]} additions\n * @param {Set<string>} existings\n * @param {import(\"../productions/container.js\").Container} ext\n * @param {import(\"../productions/container.js\").Container} base\n */\n function* checkAdditions(additions, existings, ext, base) {\n for (const addition of additions) {\n const { name } = addition;\n if (name && existings.has(name)) {\n const isStatic = addition.special === \"static\" ? \"static \" : \"\";\n const message = `The ${isStatic}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 /**\n * @param {import(\"../productions/container.js\").Container} i\n * @returns {import(\"../productions/operation.js\").Operation[]}\n */\n function getOperations(i) {\n return i.members.filter(({ type }) => type === \"operation\");\n }\n\n /**\n * @param {import(\"../productions/container.js\").Container} i\n */\n function groupOperationNames(i) {\n const ops = getOperations(i);\n return {\n statics: new Set(\n ops.filter((op) => op.special === \"static\").map((op) => op.name)\n ),\n nonstatics: new Set(\n ops.filter((op) => op.special !== \"static\").map((op) => op.name)\n ),\n };\n }\n}\n","import { Container } from \"./container.js\";\nimport { Constant } from \"./constant.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { Operation } from \"./operation.js\";\nimport { stringifier } from \"./helpers.js\";\n\nexport class Mixin extends Container {\n /**\n * @typedef {import(\"../tokeniser.js\").Token} Token\n *\n * @param {import(\"../tokeniser.js\").Tokeniser} tokeniser\n * @param {Token} base\n * @param {object} [options]\n * @param {Token} [options.partial]\n */\n static parse(tokeniser, base, { partial } = {}) {\n const tokens = { partial, base };\n tokens.mixin = tokeniser.consume(\"mixin\");\n if (!tokens.mixin) {\n return;\n }\n return Container.parse(\n tokeniser,\n new Mixin({ source: tokeniser.source, tokens }),\n {\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.js\").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.consumeKind(\"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","import { Container } from \"./container.js\";\nimport { Field } from \"./field.js\";\n\nexport class Dictionary extends Container {\n /**\n * @param {import(\"../tokeniser.js\").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 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.js\").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 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","import { 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.js\").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 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\";\nimport { Eof } from \"./productions/token.js\";\n\n/**\n * @param {Tokeniser} tokeniser\n * @param {object} options\n * @param {boolean} [options.concrete]\n * @param {Function[]} [options.productions]\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 if (options.productions) {\n for (const production of options.productions) {\n const result = production(tokeniser);\n if (result) {\n return result;\n }\n }\n }\n\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 = Eof.parse(tokeniser);\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 * @param {Function[]} [options.productions]\n * @return {import(\"./productions/base.js\").Base[]}\n */\nexport function parse(str, options = {}) {\n const tokeniser = new Tokeniser(str);\n if (typeof options.sourceName !== \"undefined\") {\n // @ts-ignore (See Tokeniser.source in supplement.d.ts)\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 /**\n * @param {string} raw\n * @param {object} options\n * @param {string} [options.unescaped]\n * @param {import(\"./productions/base.js\").Base} [options.context]\n * @returns\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 /**\n * @param {import(\"./tokeniser.js\").Token} t\n * @param {Function} wrapper\n * @param {...any} args\n * @returns\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 return ts.wrap(ast.map((it) => it.write(w)));\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 {import(\"./productions/base.js\").Base[]} ast\n * @return {import(\"./error.js\").WebIDLErrorData[]} validation errors\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 v4.3.0 - a markdown parser\n * Copyright (c) 2011-2023, 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\nfunction getDefaults() {\n return {\n async: false,\n baseUrl: null,\n breaks: false,\n extensions: null,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n hooks: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: null,\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartypants: false,\n tokenizer: null,\n walkTokens: null,\n xhtml: false\n };\n}\n\nlet defaults = getDefaults();\n\nfunction changeDefaults(newDefaults) {\n defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape(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\n/**\n * @param {string} html\n */\nfunction unescape(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;\n\n/**\n * @param {string | RegExp} regex\n * @param {string} opt\n */\nfunction edit(regex, opt) {\n regex = typeof regex === 'string' ? regex : regex.source;\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;\n\n/**\n * @param {boolean} sanitize\n * @param {string} base\n * @param {string} href\n */\nfunction cleanUrl(sanitize, base, href) {\n if (sanitize) {\n let prot;\n try {\n prot = decodeURIComponent(unescape(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\n/**\n * @param {string} base\n * @param {string} href\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(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 = { exec: function noopTest() {} };\n\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n 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 // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) { cells.shift(); }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) { cells.pop(); }\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/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param {string} str\n * @param {string} c\n * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(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.slice(0, l - suffLen);\n}\n\nfunction findClosingBracket(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(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\n/**\n * @param {string} pattern\n * @param {number} count\n */\nfunction repeatString(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\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape(text)\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 */\nclass Tokenizer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\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().replace(this.rules.inline._escapes, '$1') : 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,\n tokens: this.lexer.inline(text)\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(/^ *>[ \\t]?/gm, '');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine,\n line, nextLine, rawLine, itemContents, endEarly;\n\n let bull = cap[1].trim();\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 bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n\n // Check if current bullet point can start a new List Item\n while (src) {\n endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n\n raw = cap[0];\n src = src.substring(raw.length);\n\n line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n nextLine = src.split('\\n', 1)[0];\n\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimLeft();\n } else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n\n blankLine = false;\n\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n\n // Check if following lines should be included in List Item\n while (src) {\n rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n } else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n\n itemContents += '\\n' + nextLine;\n }\n\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n } else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents\n });\n\n list.raw += raw;\n }\n\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimRight();\n list.items[list.items.length - 1].text = itemContents.trimRight();\n list.raw = list.raw.trimRight();\n\n const l = list.items.length;\n\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (i = 0; i < l; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n\n list.loose = hasMultipleLineBreaks;\n }\n }\n\n // Set all items to loose if list is loose\n if (list.loose) {\n for (i = 0; i < l; i++) {\n list.items[i].loose = true;\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 const token = {\n type: 'html',\n raw: cap[0],\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: cap[0]\n };\n if (this.options.sanitize) {\n const text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);\n token.type = 'paragraph';\n token.text = text;\n token.tokens = this.lexer.inline(text);\n }\n return token;\n }\n }\n\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\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]).map(c => { return { text: c }; }),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n rows: cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').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, j, k, row;\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.rows.length;\n for (i = 0; i < l; i++) {\n item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; });\n }\n\n // parse child tokens inside headers and cells\n\n // header child tokens\n l = item.header.length;\n for (j = 0; j < l; j++) {\n item.header[j].tokens = this.lexer.inline(item.header[j].text);\n }\n\n // cell child tokens\n l = item.rows.length;\n for (j = 0; j < l; j++) {\n row = item.rows[j];\n for (k = 0; k < row.length; k++) {\n row[k].tokens = this.lexer.inline(row[k].text);\n }\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 tokens: this.lexer.inline(cap[1])\n };\n }\n }\n\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\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 tokens: this.lexer.inline(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(cap[1])\n };\n }\n }\n\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {\n this.lexer.state.inLink = true;\n } else if (this.lexer.state.inLink && /^<\\/a>/i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n } else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n\n return {\n type: this.options.sanitize\n ? 'text'\n : 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n text: this.options.sanitize\n ? (this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape(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], this.lexer);\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) {\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], this.lexer);\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 const raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\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(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 tokens: this.lexer.inlineTokens(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(this.options.mangle ? mangle(cap[1]) : cap[1]);\n href = 'mailto:' + text;\n } else {\n text = escape(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(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(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n } else {\n href = cap[0];\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, smartypants) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0];\n } else {\n text = escape(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\n/**\n * Block-Level Grammar\n */\nconst block = {\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}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/,\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][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/,\n table: noopTest,\n lheading: /^((?:.|\\n(?!\\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|table| +\\n)[^\\n]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock._label = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nblock._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock.def = edit(block.def)\n .replace('label', block._label)\n .replace('title', block._title)\n .getRegex();\n\nblock.bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nblock.listItemStart = edit(/^( *)(bull) */)\n .replace('bull', block.bullet)\n .getRegex();\n\nblock.list = edit(block.list)\n .replace(/bull/g, block.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block.def.source + ')')\n .getRegex();\n\nblock._tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'\n + '|track|ul';\nblock._comment = /<!--(?!-?>)[\\s\\S]*?(?:-->|$)/;\nblock.html = edit(block.html, 'i')\n .replace('comment', block._comment)\n .replace('tag', block._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('|table', '')\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._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.blockquote = edit(block.blockquote)\n .replace('paragraph', block.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock.normal = { ...block };\n\n/**\n * GFM Block Grammar\n */\n\nblock.gfm = {\n ...block.normal,\n table: '^ *([^\\\\n ].*\\\\|.*)\\\\n' // Header\n + ' {0,3}(?:\\\\| *)?(:?-+:? *(?:\\\\| *:?-+:? *)*)(?:\\\\| *)?' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)' // Cells\n};\n\nblock.gfm.table = edit(block.gfm.table)\n .replace('hr', block.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._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.gfm.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('table', block.gfm.table) // interrupt paragraphs with table\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._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock.pedantic = {\n ...block.normal,\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', block._comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(block.normal._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n};\n\n/**\n * Inline-Level Grammar\n */\nconst inline = {\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)\\]\\[(ref)\\]/,\n nolink: /^!?\\[(ref)\\](?:\\[\\])?/,\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 orphan inside strong () Consume to delim (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._punctuation = '!\"#$%&\\'()+\\\\-.,/:;<=>?@\\\\[\\\\]`^{|}~';\ninline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();\n\n// sequences em should skip over [title](link), `code`, <html>\ninline.blockSkip = /\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>/g;\n// lookbehind is not available on Safari as of version 16\n// inline.escapedEmSt = /(?<=(?:^|[^\\\\)(?:\\\\[^])*)\\\\[*_]/g;\ninline.escapedEmSt = /(?:^|[^\\\\])(?:\\\\\\\\)*\\\\[*_]/g;\n\ninline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();\n\ninline.emStrong.lDelim = edit(inline.emStrong.lDelim)\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;\ninline.autolink = edit(inline.autolink)\n .replace('scheme', inline._scheme)\n .replace('email', inline._email)\n .getRegex();\n\ninline._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline.tag = edit(inline.tag)\n .replace('comment', inline._comment)\n .replace('attribute', inline._attribute)\n .getRegex();\n\ninline._label = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline._href = /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/;\ninline._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline.link = edit(inline.link)\n .replace('label', inline._label)\n .replace('href', inline._href)\n .replace('title', inline._title)\n .getRegex();\n\ninline.reflink = edit(inline.reflink)\n .replace('label', inline._label)\n .replace('ref', block._label)\n .getRegex();\n\ninline.nolink = edit(inline.nolink)\n .replace('ref', block._label)\n .getRegex();\n\ninline.reflinkSearch = edit(inline.reflinkSearch, 'g')\n .replace('reflink', inline.reflink)\n .replace('nolink', inline.nolink)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline.normal = { ...inline };\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline.pedantic = {\n ...inline.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._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline._label)\n .getRegex()\n};\n\n/**\n * GFM Inline Grammar\n */\n\ninline.gfm = {\n ...inline.normal,\n escape: edit(inline.escape).replace('])', '~|])').getRegex(),\n _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,\n url: /^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\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.gfm.url = edit(inline.gfm.url, 'i')\n .replace('email', inline.gfm._extended_email)\n .getRegex();\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\ninline.breaks = {\n ...inline.gfm,\n br: edit(inline.br).replace('{2,}', '*').getRegex(),\n text: edit(inline.gfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex()\n};\n\n/**\n * smartypants text replacement\n * @param {string} text\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 * @param {string} text\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 */\nclass Lexer {\n constructor(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || defaults;\n this.options.tokenizer = this.options.tokenizer || new Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\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\n this.blockTokens(src, this.tokens);\n\n let next;\n while (next = this.inlineQueue.shift()) {\n this.inlineTokens(next.src, next.tokens);\n }\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n } else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n\n let token, 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({ lexer: 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.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n } else {\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' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 // 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 tokens.push(token);\n continue;\n }\n\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\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 (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else 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({ lexer: 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 (this.state.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 this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.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 this.state.top = true;\n return tokens;\n }\n\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\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 + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);\n 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({ lexer: 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)) {\n src = src.substring(token.raw.length);\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 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 (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 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 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 (!this.state.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({ lexer: 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, 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\n/**\n * Renderer\n */\nclass Renderer {\n constructor(options) {\n this.options = options || defaults;\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(code, true))\n + '</code></pre>\\n';\n }\n\n return '<pre><code class=\"'\n + this.options.langPrefix\n + escape(lang)\n + '\">'\n + (escaped ? code : escape(code, true))\n + '</code></pre>\\n';\n }\n\n /**\n * @param {string} quote\n */\n blockquote(quote) {\n return `<blockquote>\\n${quote}</blockquote>\\n`;\n }\n\n html(html) {\n return html;\n }\n\n /**\n * @param {string} text\n * @param {string} level\n * @param {string} raw\n * @param {any} slugger\n */\n heading(text, level, raw, slugger) {\n if (this.options.headerIds) {\n const id = this.options.headerPrefix + slugger.slug(raw);\n return `<h${level} id=\"${id}\">${text}</h${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 /**\n * @param {string} text\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 /**\n * @param {string} text\n */\n paragraph(text) {\n return `<p>${text}</p>\\n`;\n }\n\n /**\n * @param {string} header\n * @param {string} body\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 /**\n * @param {string} content\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 /**\n * span level renderer\n * @param {string} text\n */\n strong(text) {\n return `<strong>${text}</strong>`;\n }\n\n /**\n * @param {string} text\n */\n em(text) {\n return `<em>${text}</em>`;\n }\n\n /**\n * @param {string} text\n */\n codespan(text) {\n return `<code>${text}</code>`;\n }\n\n br() {\n return this.options.xhtml ? '<br/>' : '<br>';\n }\n\n /**\n * @param {string} text\n */\n del(text) {\n return `<del>${text}</del>`;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\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=\"' + href + '\"';\n if (title) {\n out += ' title=\"' + title + '\"';\n }\n out += '>' + text + '</a>';\n return out;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\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 */\nclass 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 */\nclass Slugger {\n constructor() {\n this.seen = {};\n }\n\n /**\n * @param {string} value\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 * @param {string} originalSlug\n * @param {boolean} isDryRun\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\n * 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\n/**\n * Parsing & Compiling\n */\nclass Parser {\n constructor(options) {\n this.options = options || defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new TextRenderer();\n this.slugger = new Slugger();\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({ parser: 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.header[j].tokens),\n { header: true, align: token.align[j] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n body = '';\n l2 = token.rows.length;\n for (j = 0; j < l2; j++) {\n row = token.rows[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].tokens),\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 === 'paragraph') {\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({ parser: 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\nclass Hooks {\n constructor(options) {\n this.options = options || defaults;\n }\n\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess'\n ]);\n\n /**\n * Process markdown before marked\n */\n preprocess(markdown) {\n return markdown;\n }\n\n /**\n * Process HTML after marked is finished\n */\n postprocess(html) {\n return html;\n }\n}\n\nfunction onError(silent, async, callback) {\n return (e) => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n\n if (silent) {\n const msg = '<p>An error occurred:</p><pre>'\n + escape(e.message + '', true)\n + '</pre>';\n if (async) {\n return Promise.resolve(msg);\n }\n if (callback) {\n callback(null, msg);\n return;\n }\n return msg;\n }\n\n if (async) {\n return Promise.reject(e);\n }\n if (callback) {\n callback(e);\n return;\n }\n throw e;\n };\n}\n\nfunction parseMarkdown(lexer, parser) {\n return (src, opt, callback) => {\n if (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n const origOpt = { ...opt };\n opt = { ...marked.defaults, ...origOpt };\n const throwError = onError(opt.silent, opt.async, callback);\n\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n\n checkSanitizeDeprecation(opt);\n\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n tokens = lexer(src, opt);\n } catch (e) {\n return throwError(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(tokens, opt);\n if (opt.hooks) {\n out = opt.hooks.postprocess(out);\n }\n } catch (e) {\n err = e;\n }\n }\n\n opt.highlight = highlight;\n\n return err\n ? throwError(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 if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.walkTokens ? Promise.all(marked.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n const tokens = lexer(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n } catch (e) {\n return throwError(e);\n }\n };\n}\n\n/**\n * Marked\n */\nfunction marked(src, opt, callback) {\n return parseMarkdown(Lexer.lex, Parser.parse)(src, opt, callback);\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n marked.defaults = { ...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 extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };\n\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n\n // set async to true if it was set to true before\n opts.async = marked.defaults.async || opts.async || false;\n\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\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[ext.name];\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 opts.extensions = extensions;\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 Hooks extensions --== //\n if (pack.hooks) {\n const hooks = marked.defaults.hooks || new Hooks();\n for (const prop in pack.hooks) {\n const prevHook = hooks[prop];\n if (Hooks.passThroughHooks.has(prop)) {\n hooks[prop] = (arg) => {\n if (marked.defaults.async) {\n return Promise.resolve(pack.hooks[prop].call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n\n const ret = pack.hooks[prop].call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n } else {\n hooks[prop] = (...args) => {\n let ret = pack.hooks[prop].apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked.defaults.walkTokens;\n opts.walkTokens = function(token) {\n let values = [];\n values.push(pack.walkTokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n\n marked.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(marked, token));\n switch (token.type) {\n case 'table': {\n for (const cell of token.header) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n for (const row of token.rows) {\n for (const cell of row) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n values = values.concat(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 values = values.concat(marked.walkTokens(token[childTokens], callback));\n });\n } else if (token.tokens) {\n values = values.concat(marked.walkTokens(token.tokens, callback));\n }\n }\n }\n }\n return values;\n};\n\n/**\n * Parse Inline\n * @param {string} src\n */\nmarked.parseInline = parseMarkdown(Lexer.lexInline, Parser.parseInline);\n\n/**\n * Expose\n */\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\nmarked.Tokenizer = Tokenizer;\nmarked.Slugger = Slugger;\nmarked.Hooks = Hooks;\nmarked.parse = marked;\n\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = Parser.parse;\nconst lexer = Lexer.lex;\n\nexport { Hooks, Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\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 pluralizeExports = {};\nvar pluralize$1 = {\n get exports(){ return pluralizeExports; },\n set exports(v){ pluralizeExports = v; },\n};\n\n/* global define */\n\n(function (module, exports) {\n\t(function (root, pluralize) {\n\t /* istanbul ignore else */\n\t if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {\n\t // Node.\n\t module.exports = pluralize();\n\t } else {\n\t // Browser global.\n\t root.pluralize = pluralize();\n\t }\n\t})(commonjsGlobal, function () {\n\t // Rule storage - pluralize and singularize need to be run sequentially,\n\t // while other rules can be optimized using an object for instant lookups.\n\t var pluralRules = [];\n\t var singularRules = [];\n\t var uncountables = {};\n\t var irregularPlurals = {};\n\t var irregularSingles = {};\n\n\t /**\n\t * Sanitize a pluralization rule to a usable regular expression.\n\t *\n\t * @param {(RegExp|string)} rule\n\t * @return {RegExp}\n\t */\n\t function sanitizeRule (rule) {\n\t if (typeof rule === 'string') {\n\t return new RegExp('^' + rule + '$', 'i');\n\t }\n\n\t return rule;\n\t }\n\n\t /**\n\t * Pass in a word token to produce a function that can replicate the case on\n\t * another word.\n\t *\n\t * @param {string} word\n\t * @param {string} token\n\t * @return {Function}\n\t */\n\t function restoreCase (word, token) {\n\t // Tokens are an exact match.\n\t if (word === token) return token;\n\n\t // Lower cased words. E.g. \"hello\".\n\t if (word === word.toLowerCase()) return token.toLowerCase();\n\n\t // Upper cased words. E.g. \"WHISKY\".\n\t if (word === word.toUpperCase()) return token.toUpperCase();\n\n\t // Title cased words. E.g. \"Title\".\n\t if (word[0] === word[0].toUpperCase()) {\n\t return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n\t }\n\n\t // Lower cased words. E.g. \"test\".\n\t return token.toLowerCase();\n\t }\n\n\t /**\n\t * Interpolate a regexp string.\n\t *\n\t * @param {string} str\n\t * @param {Array} args\n\t * @return {string}\n\t */\n\t function interpolate (str, args) {\n\t return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n\t return args[index] || '';\n\t });\n\t }\n\n\t /**\n\t * Replace a word using a rule.\n\t *\n\t * @param {string} word\n\t * @param {Array} rule\n\t * @return {string}\n\t */\n\t function replace (word, rule) {\n\t return word.replace(rule[0], function (match, index) {\n\t var result = interpolate(rule[1], arguments);\n\n\t if (match === '') {\n\t return restoreCase(word[index - 1], result);\n\t }\n\n\t return restoreCase(match, result);\n\t });\n\t }\n\n\t /**\n\t * Sanitize a word by passing in the word and sanitization rules.\n\t *\n\t * @param {string} token\n\t * @param {string} word\n\t * @param {Array} rules\n\t * @return {string}\n\t */\n\t function sanitizeWord (token, word, rules) {\n\t // Empty string or doesn't need fixing.\n\t if (!token.length || uncountables.hasOwnProperty(token)) {\n\t return word;\n\t }\n\n\t var len = rules.length;\n\n\t // Iterate over the sanitization rules and use the first one to match.\n\t while (len--) {\n\t var rule = rules[len];\n\n\t if (rule[0].test(word)) return replace(word, rule);\n\t }\n\n\t return word;\n\t }\n\n\t /**\n\t * Replace a word with the updated word.\n\t *\n\t * @param {Object} replaceMap\n\t * @param {Object} keepMap\n\t * @param {Array} rules\n\t * @return {Function}\n\t */\n\t function replaceWord (replaceMap, keepMap, rules) {\n\t return function (word) {\n\t // Get the correct token and case restoration functions.\n\t var token = word.toLowerCase();\n\n\t // Check against the keep object map.\n\t if (keepMap.hasOwnProperty(token)) {\n\t return restoreCase(word, token);\n\t }\n\n\t // Check against the replacement map for a direct word replacement.\n\t if (replaceMap.hasOwnProperty(token)) {\n\t return restoreCase(word, replaceMap[token]);\n\t }\n\n\t // Run all the rules against the word.\n\t return sanitizeWord(token, word, rules);\n\t };\n\t }\n\n\t /**\n\t * Check if a word is part of the map.\n\t */\n\t function checkWord (replaceMap, keepMap, rules, bool) {\n\t return function (word) {\n\t var token = word.toLowerCase();\n\n\t if (keepMap.hasOwnProperty(token)) return true;\n\t if (replaceMap.hasOwnProperty(token)) return false;\n\n\t return sanitizeWord(token, token, rules) === token;\n\t };\n\t }\n\n\t /**\n\t * Pluralize or singularize a word based on the passed in count.\n\t *\n\t * @param {string} word The word to pluralize\n\t * @param {number} count How many of the word exist\n\t * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n\t * @return {string}\n\t */\n\t function pluralize (word, count, inclusive) {\n\t var pluralized = count === 1\n\t ? pluralize.singular(word) : pluralize.plural(word);\n\n\t return (inclusive ? count + ' ' : '') + pluralized;\n\t }\n\n\t /**\n\t * Pluralize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.plural = replaceWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Check if a word is plural.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isPlural = checkWord(\n\t irregularSingles, irregularPlurals, pluralRules\n\t );\n\n\t /**\n\t * Singularize a word.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.singular = replaceWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Check if a word is singular.\n\t *\n\t * @type {Function}\n\t */\n\t pluralize.isSingular = checkWord(\n\t irregularPlurals, irregularSingles, singularRules\n\t );\n\n\t /**\n\t * Add a pluralization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addPluralRule = function (rule, replacement) {\n\t pluralRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add a singularization rule to the collection.\n\t *\n\t * @param {(string|RegExp)} rule\n\t * @param {string} replacement\n\t */\n\t pluralize.addSingularRule = function (rule, replacement) {\n\t singularRules.push([sanitizeRule(rule), replacement]);\n\t };\n\n\t /**\n\t * Add an uncountable word rule.\n\t *\n\t * @param {(string|RegExp)} word\n\t */\n\t pluralize.addUncountableRule = function (word) {\n\t if (typeof word === 'string') {\n\t uncountables[word.toLowerCase()] = true;\n\t return;\n\t }\n\n\t // Set singular and plural references for the word.\n\t pluralize.addPluralRule(word, '$0');\n\t pluralize.addSingularRule(word, '$0');\n\t };\n\n\t /**\n\t * Add an irregular word definition.\n\t *\n\t * @param {string} single\n\t * @param {string} plural\n\t */\n\t pluralize.addIrregularRule = function (single, plural) {\n\t plural = plural.toLowerCase();\n\t single = single.toLowerCase();\n\n\t irregularSingles[single] = plural;\n\t irregularPlurals[plural] = single;\n\t };\n\n\t /**\n\t * Irregular rules.\n\t */\n\t [\n\t // Pronouns.\n\t ['I', 'we'],\n\t ['me', 'us'],\n\t ['he', 'they'],\n\t ['she', 'they'],\n\t ['them', 'them'],\n\t ['myself', 'ourselves'],\n\t ['yourself', 'yourselves'],\n\t ['itself', 'themselves'],\n\t ['herself', 'themselves'],\n\t ['himself', 'themselves'],\n\t ['themself', 'themselves'],\n\t ['is', 'are'],\n\t ['was', 'were'],\n\t ['has', 'have'],\n\t ['this', 'these'],\n\t ['that', 'those'],\n\t // Words ending in with a consonant and `o`.\n\t ['echo', 'echoes'],\n\t ['dingo', 'dingoes'],\n\t ['volcano', 'volcanoes'],\n\t ['tornado', 'tornadoes'],\n\t ['torpedo', 'torpedoes'],\n\t // Ends with `us`.\n\t ['genus', 'genera'],\n\t ['viscus', 'viscera'],\n\t // Ends with `ma`.\n\t ['stigma', 'stigmata'],\n\t ['stoma', 'stomata'],\n\t ['dogma', 'dogmata'],\n\t ['lemma', 'lemmata'],\n\t ['schema', 'schemata'],\n\t ['anathema', 'anathemata'],\n\t // Other irregular rules.\n\t ['ox', 'oxen'],\n\t ['axe', 'axes'],\n\t ['die', 'dice'],\n\t ['yes', 'yeses'],\n\t ['foot', 'feet'],\n\t ['eave', 'eaves'],\n\t ['goose', 'geese'],\n\t ['tooth', 'teeth'],\n\t ['quiz', 'quizzes'],\n\t ['human', 'humans'],\n\t ['proof', 'proofs'],\n\t ['carve', 'carves'],\n\t ['valve', 'valves'],\n\t ['looey', 'looies'],\n\t ['thief', 'thieves'],\n\t ['groove', 'grooves'],\n\t ['pickaxe', 'pickaxes'],\n\t ['passerby', 'passersby']\n\t ].forEach(function (rule) {\n\t return pluralize.addIrregularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Pluralization rules.\n\t */\n\t [\n\t [/s?$/i, 's'],\n\t [/[^\\u0000-\\u007F]$/i, '$0'],\n\t [/([^aeiou]ese)$/i, '$1'],\n\t [/(ax|test)is$/i, '$1es'],\n\t [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n\t [/(e[mn]u)s?$/i, '$1s'],\n\t [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n\t [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n\t [/(seraph|cherub)(?:im)?$/i, '$1im'],\n\t [/(her|at|gr)o$/i, '$1oes'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n\t [/sis$/i, 'ses'],\n\t [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n\t [/([^aeiouy]|qu)y$/i, '$1ies'],\n\t [/([^ch][ieo][ln])ey$/i, '$1ies'],\n\t [/(x|ch|ss|sh|zz)$/i, '$1es'],\n\t [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n\t [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n\t [/(pe)(?:rson|ople)$/i, '$1ople'],\n\t [/(child)(?:ren)?$/i, '$1ren'],\n\t [/eaux$/i, '$0'],\n\t [/m[ae]n$/i, 'men'],\n\t ['thou', 'you']\n\t ].forEach(function (rule) {\n\t return pluralize.addPluralRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Singularization rules.\n\t */\n\t [\n\t [/s$/i, ''],\n\t [/(ss)$/i, '$1'],\n\t [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n\t [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n\t [/ies$/i, 'y'],\n\t [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n\t [/\\b(mon|smil)ies$/i, '$1ey'],\n\t [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n\t [/(seraph|cherub)im$/i, '$1'],\n\t [/(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\t [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n\t [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n\t [/(test)(?:is|es)$/i, '$1is'],\n\t [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n\t [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n\t [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n\t [/(alumn|alg|vertebr)ae$/i, '$1a'],\n\t [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n\t [/(matr|append)ices$/i, '$1ix'],\n\t [/(pe)(rson|ople)$/i, '$1rson'],\n\t [/(child)ren$/i, '$1'],\n\t [/(eau)x?$/i, '$1'],\n\t [/men$/i, 'man']\n\t ].forEach(function (rule) {\n\t return pluralize.addSingularRule(rule[0], rule[1]);\n\t });\n\n\t /**\n\t * Uncountable rules.\n\t */\n\t [\n\t // Singular words with no plurals.\n\t 'adulthood',\n\t 'advice',\n\t 'agenda',\n\t 'aid',\n\t 'aircraft',\n\t 'alcohol',\n\t 'ammo',\n\t 'analytics',\n\t 'anime',\n\t 'athletics',\n\t 'audio',\n\t 'bison',\n\t 'blood',\n\t 'bream',\n\t 'buffalo',\n\t 'butter',\n\t 'carp',\n\t 'cash',\n\t 'chassis',\n\t 'chess',\n\t 'clothing',\n\t 'cod',\n\t 'commerce',\n\t 'cooperation',\n\t 'corps',\n\t 'debris',\n\t 'diabetes',\n\t 'digestion',\n\t 'elk',\n\t 'energy',\n\t 'equipment',\n\t 'excretion',\n\t 'expertise',\n\t 'firmware',\n\t 'flounder',\n\t 'fun',\n\t 'gallows',\n\t 'garbage',\n\t 'graffiti',\n\t 'hardware',\n\t 'headquarters',\n\t 'health',\n\t 'herpes',\n\t 'highjinks',\n\t 'homework',\n\t 'housework',\n\t 'information',\n\t 'jeans',\n\t 'justice',\n\t 'kudos',\n\t 'labour',\n\t 'literature',\n\t 'machinery',\n\t 'mackerel',\n\t 'mail',\n\t 'media',\n\t 'mews',\n\t 'moose',\n\t 'music',\n\t 'mud',\n\t 'manga',\n\t 'news',\n\t 'only',\n\t 'personnel',\n\t 'pike',\n\t 'plankton',\n\t 'pliers',\n\t 'police',\n\t 'pollution',\n\t 'premises',\n\t 'rain',\n\t 'research',\n\t 'rice',\n\t 'salmon',\n\t 'scissors',\n\t 'series',\n\t 'sewage',\n\t 'shambles',\n\t 'shrimp',\n\t 'software',\n\t 'species',\n\t 'staff',\n\t 'swine',\n\t 'tennis',\n\t 'traffic',\n\t 'transportation',\n\t 'trout',\n\t 'tuna',\n\t 'wealth',\n\t 'welfare',\n\t 'whiting',\n\t 'wildebeest',\n\t 'wildlife',\n\t 'you',\n\t /pok[eé]mon$/i,\n\t // Regexes.\n\t /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n\t /deer$/i, // \"deer\", \"reindeer\"\n\t /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n\t /measles$/i,\n\t /o[iu]s$/i, // \"carnivorous\"\n\t /pox$/i, // \"chickpox\", \"smallpox\"\n\t /sheep$/i\n\t ].forEach(pluralize.addUncountableRule);\n\n\t return pluralize;\n\t});\n} (pluralize$1));\n\nvar pluralize = pluralizeExports;\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/index.js\";\nimport * as _webidl2 from \"../../node_modules/webidl2/index.js\";\nimport { MIMEType as _MIMEType } from \"../../node_modules/sniffy-mimetype/index.js\";\nimport { marked as _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\nexport const html = hyperHTML;\nexport const idb = _idb;\nexport const marked = _marked;\nexport const MIMEType = _MIMEType;\nexport const pluralize = _pluralize;\nexport const webidl2 = _webidl2;\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// 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\";\nimport { reindent } from \"./reindent.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\n// https://stackoverflow.com/a/58633686\nexport const ISODate = new Intl.DateTimeFormat([\"sv-SE\"], {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n});\n\n// We use an \"Australian Date\" because it omits the \",\"\n// after the day of the month, which is required by the W3C.\nconst dateLang =\n docLang === \"en\" || docLang.startsWith(\"en-\") ? \"en-AU\" : docLang;\nexport const W3CDate = new Intl.DateTimeFormat(dateLang, {\n timeZone: \"UTC\",\n year: \"numeric\",\n month: \"long\",\n day: dateLang === \"en-AU\" ? \"2-digit\" : \"numeric\",\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 if (opts.corsMode) {\n linkElem.crossOrigin = opts.corsMode;\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 * @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 = lang.toLowerCase();\n // Proxy return type is a known bug:\n // https://github.com/Microsoft/TypeScript/issues/20846\n // @ts-expect-error\n return new Proxy(localizationStrings, {\n /** @param {string} key */\n get(data, key) {\n const result = getIntlDataForKey(data, key, lang) || 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/**\n * @template {Record<string, Record<string, string|Function>>} T\n * @param {T} localizationStrings\n * @param {string} key\n */\nexport function getIntlDataForKey(localizationStrings, key, lang = docLang) {\n lang = lang.toLowerCase();\n return (\n localizationStrings[lang]?.[key] ||\n localizationStrings[lang.match(/^(\\w{2,3})-.+$/)?.[1]]?.[key]\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 * 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 * @param {Element} element\n */\nexport function 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/**\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 const linkifiedStr = 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 return reindent(linkifiedStr);\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 */\nimport { serialize } from \"../core/exporter.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","// @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\n#respec-pill,\n.respec-info-button {\n height: 2.4em;\n background: #fff;\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 padding: 0.2em 0em;\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 will-change: opacity;\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 {\n width: 4.8em;\n}\n\n#respec-pill:not(:disabled) {\n animation: respec-fadein 0.6s ease-in-out;\n}\n\n@keyframes respec-fadein {\n from {\n margin-top: -1.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n box-shadow: none;\n height: 4.8em;\n }\n to {\n margin-top: 0;\n border: 1px solid #ccc;\n border-radius: 0;\n box-shadow: 1px 1px 8px 0 rgba(100, 100, 100, 0.5);\n height: 2.4em;\n }\n}\n\n#respec-pill:disabled {\n margin-top: -1.2em;\n position: relative;\n border: none;\n box-shadow: none;\n border-radius: 50%;\n width: 4.8em;\n height: 4.8em;\n padding: 0;\n}\n\n#respec-pill:disabled::after {\n position: absolute;\n content: '';\n inset: -0.2em;\n border-radius: 50%;\n border: 0.2em solid rgba(100, 100, 100, 0.5);\n border-left: 0.2em solid transparent;\n animation: respec-spin 0.5s infinite linear;\n}\n\n@media (prefers-reduced-motion) {\n #respec-pill:not(:disabled) {\n animation: none;\n }\n\n #respec-pill:disabled::after {\n animation: none;\n border-left: 0.2em solid rgba(100, 100, 100, 0.5);\n }\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 font-family: sans-serif;\n font-size: 0.85em;\n}\n\n.respec-warning-list {\n background-color: rgb(255, 251, 230);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li {\n list-style-type: none;\n margin: 0;\n padding: .5em 0;\n padding-left: 2em;\n padding-right: .5em;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li + li {\n margin-top: 0.5rem;\n}\n\n:is(.respec-warning-list,.respec-error-list) > li:before {\n position: absolute;\n left: .4em;\n}\n\n:is(.respec-warning-list,.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-warning-list > li::before {\n content: \"⚠️\";\n}\n\n.respec-error-list > li::before {\n content: \"💥\";\n}\n\n.respec-error-list > li {\n color: rgb(92, 59, 0);\n border-bottom: thin solid rgb(255, 215, 215);\n}\n\n:is(.respec-warning-list,.respec-error-list) > li li {\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 top: 10%;\n background: #fff;\n border: 5px solid #666;\n min-width: 20%;\n padding: 0;\n max-height: 80%;\n overflow-y: auto;\n margin: 0 -0.5cm;\n left: 20%;\n max-width: 75%;\n min-width: 60%;\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-menu button.respec-option {\n background: white;\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 background-color: #eeeeee;\n}\n\n.respec-cmd-icon {\n padding-right: 0.5em;\n}\n\n#respec-ui button.respec-option:first-child {\n margin-top: 0;\n}\n#respec-ui button.respec-option:last-child {\n border: none;\n border-radius: inherit;\n margin-bottom: 0;\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\np:is(.respec-hint,.respec-occurrences) {\n display: block;\n margin-top: 0.5em;\n}\n\n.respec-plugin {\n text-align: right;\n color: rgb(120, 120, 120, .5);\n font-size: 0.6em;\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 */\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;\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 image(href, title, text) {\n if (!title) {\n return super.image(href, title, text);\n }\n const html = String.raw;\n return html`\n <figure>\n <img src=\"${href}\" alt=\"${text}\" />\n <figcaption>${title}</figcaption>\n </figure>\n `;\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\nconst config = {\n sanitize: false,\n gfm: true,\n headerIds: false,\n langPrefix: \"\",\n renderer: new Renderer(),\n};\n\n/**\n * @param {string} text\n * @param {object} options\n * @param {boolean} options.inline\n */\nexport function markdownToHtml(text, options = { inline: false }) {\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\n const result = options.inline\n ? marked.parseInline(potentialMarkdown, config)\n : marked.parse(potentialMarkdown, config);\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\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 processMDSections(document.body);\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 // Frankenstein the whole thing back together\n newBody.append(rsUI);\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 { markdownToHtml } from \"./markdown.js\";\nimport { reindent } from \"./reindent.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\n ? `<p class=\"respec-plugin\">(plugin: \"${err.plugin}\")</p>`\n : \"\";\n\n const hint = err.hint\n ? `\\n${markdownToHtml(\n `<p class=\"respec-hint\"><strong>How to fix:</strong> ${reindent(\n err.hint\n )}`,\n {\n inline: !err.hint.includes(\"\\n\"),\n }\n )}\\n`\n : \"\";\n const elements = Array.isArray(err.elements)\n ? `<p class=\"respec-occurrences\">Occurred <strong>${\n err.elements.length\n }</strong> times at:</p>\n ${markdownToHtml(err.elements.map(generateMarkdownLink).join(\"\\n\"))}`\n : \"\";\n const details = err.details\n ? `\\n\\n<details>\\n${err.details}\\n</details>\\n`\n : \"\";\n const msg = markdownToHtml(`**${err.message}**`, { inline: true });\n const result = `${msg}${hint}${elements}${details}${plugin}`;\n return result;\n}\n\n/**\n * @param {Element} element\n */\nfunction generateMarkdownLink(element) {\n return `* [\\`<${element.localName}>\\`](#${element.id}) element`;\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/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/tables.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/render-biblio.js\"),\n import(\"../src/core/dfn-index.js\"),\n import(\"../src/core/contrib.js\"),\n import(\"../src/core/sections.js\"),\n import(\"../src/core/fix-headers.js\"),\n import(\"../src/core/webidl-index.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/data-type.js\"),\n import(\"../src/core/algorithms.js\"),\n import(\"../src/core/anchor-expander.js\"),\n import(\"../src/core/dfn-panel.js\"),\n import(\"../src/core/custom-elements/index.js\"),\n import(\"../src/core/web-monetization.js\"),\n import(\"../src/core/before-save.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-captionless-tables.js\"),\n import(\"../src/core/linter-rules/no-unused-dfns.js\"),\n import(\"../src/core/linter-rules/no-headingless-sections.js\"),\n import(\"../src/core/linter-rules/no-unused-vars.js\"),\n import(\"../src/w3c/linter-rules/required-sections.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 import(\"../src/core/linter-rules/informative-dfn.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 { docLink, fetchAndCache, showError } from \"../core/utils.js\";\n\nexport const name = \"w3c/group\";\n\nconst W3C_GROUPS_API = \"https://respec.org/w3c/groups/\";\nexport async function run(conf) {\n if (!conf.group) {\n return;\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 patentURI: wgPatentURI,\n patentPolicy: wgPatentPolicy,\n type: groupType,\n wgURI,\n } = json;\n return { wg, wgId, wgURI, wgPatentURI, wgPatentPolicy, groupType };\n }\n\n const text = await res.text();\n let message = `Failed to fetch group details (HTTP: ${res.status}).`;\n let hint;\n if (res.status === 409) {\n [message, hint] = text.split(\"\\n\", 2);\n } else if (res.status === 404) {\n hint = docLink`See the list of [supported group names](https://respec.org/w3c/groups/) to use with the ${\"[group]\"} configuration option.`;\n }\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 W3CDate,\n getIntlData,\n isValidConfDate,\n showError,\n showWarning,\n} from \"../../core/utils.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};\nconst l10n = getIntlData(localizationStrings);\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 // 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 const { retiredDate } = person;\n if (person.retiredDate) {\n const time = html`<time datetime=\"${retiredDate}\"\n >${W3CDate.format(new Date(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 { ISODate, W3CDate, getIntlData } 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\";\nimport { sub } from \"../../core/pubsubhub.js\";\n\nconst localizationStrings = {\n en: {\n archives: \"archives\",\n author: \"Author:\",\n authors: \"Authors:\",\n commit_history: \"Commit history\",\n edited_in_place: \"edited in place\",\n editor: \"Editor:\",\n editors: \"Editors:\",\n feedback: \"Feedback:\",\n former_editor: \"Former editor:\",\n former_editors: \"Former editors:\",\n history: \"History:\",\n implementation_report: \"Implementation report:\",\n latest_editors_draft: \"Latest editor's draft:\",\n latest_published_version: \"Latest published version:\",\n latest_recommendation: \"Latest Recommendation:\",\n message_topic: \"… message topic …\",\n more_details_about_this_doc: \"More details about this document\",\n multiple_alternates(plural) {\n return `This document is also available in ${\n plural ? \"these non-normative formats\" : \"this non-normative format\"\n }:`;\n },\n prev_editor_draft: \"Previous editor's draft:\",\n prev_recommendation: \"Previous Recommendation:\",\n prev_version: \"Previous version:\",\n publication_history: \"Publication history\",\n test_suite: \"Test suite:\",\n this_version: \"This version:\",\n with_subject_line: \"with subject line\",\n your_topic_here: \"YOUR TOPIC HERE\",\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 commit_history: \"Git提交历史\",\n editor: \"编辑:\",\n editors: \"编辑:\",\n feedback: \"反馈:\",\n former_editor: \"原编辑:\",\n former_editors: \"原编辑:\",\n history: \"历史:\",\n implementation_report: \"实现报告:\",\n latest_editors_draft: \"最新编辑草稿:\",\n latest_published_version: \"最新发布版本:\",\n latest_recommendation: \"最新发布的正式推荐标准:\",\n message_topic: \"… 邮件主题 …\",\n prev_editor_draft: \"上一版编辑草稿:\",\n prev_recommendation: \"上一版正式推荐标准:\",\n prev_version: \"上一版:\",\n test_suite: \"测试套件:\",\n this_version: \"本版本:\",\n },\n ja: {\n archives: \"アーカイブ\",\n author: \"著者:\",\n authors: \"著者:\",\n commit_history: \"更新履歴\",\n edited_in_place: \"改版なく更新\",\n editor: \"編者:\",\n editors: \"編者:\",\n feedback: \"フィードバック:\",\n former_editor: \"以前の版の編者:\",\n former_editors: \"以前の版の編者:\",\n history: \"履歴:\",\n implementation_report: \"実装レポート:\",\n latest_editors_draft: \"最新の編集用草案:\",\n latest_published_version: \"最新バージョン:\",\n latest_recommendation: \"最新の勧告版:\",\n message_topic: \"… メール件名 …\",\n more_details_about_this_doc: \"この文書についてのより詳細\",\n prev_editor_draft: \"前回の編集用草案:\",\n prev_recommendation: \"前回の勧告版:\",\n prev_version: \"前回のバージョン:\",\n publication_history: \"公表履歴\",\n test_suite: \"テストスイート:\",\n this_version: \"このバージョン:\",\n with_subject_line: \"次の件名で\",\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 archives: \"archivos\",\n author: \"Autor:\",\n authors: \"Autores:\",\n commit_history: \"Historial de cambios\",\n edited_in_place: \"editado en lugar\",\n editor: \"Editor:\",\n editors: \"Editores:\",\n feedback: \"Comentarios:\",\n former_editor: \"Antiguo editor:\",\n former_editors: \"Antiguos editores:\",\n history: \"Historia:\",\n implementation_report: \"Informe de implementación:\",\n latest_editors_draft: \"Última versión del editor:\",\n latest_published_version: \"Última versión publicada:\",\n latest_recommendation: \"Recomendación más reciente:\",\n message_topic: \"… detalles de mensaje …\",\n more_details_about_this_doc: \"Más detalles sobre este documento:\",\n publication_history: \"Historial de publicación\",\n prev_editor_draft: \"Última versión del editor:\",\n prev_recommendation: \"Última Recomendación:\",\n prev_version: \"Última versión:\",\n test_suite: \"Suite de pruebas:\",\n this_version: \"Esta versión:\",\n with_subject_line: \"con línea de asunto\",\n your_topic_here: \"TU SUJETO AQUÍ\",\n },\n de: {\n archives: \"Archiv\",\n author: \"Autor/in:\",\n authors: \"Autor/innen:\",\n commit_history: \"Commit-Historie\",\n edited_in_place: \"zuletzt geändert am\",\n editor: \"Redaktion:\",\n editors: \"Redaktion:\",\n feedback: \"Feedback:\",\n former_editor: \"Frühere Mitwirkende:\",\n former_editors: \"Frühere Mitwirkende:\",\n history: \"Verlauf:\",\n implementation_report: \"Umsetzungsbericht:\",\n latest_editors_draft: \"Letzter Entwurf:\",\n latest_published_version: \"Letzte publizierte Fassung:\",\n latest_recommendation: \"Aktuellste Empfehlung:\",\n more_details_about_this_doc: \"Mehr Informationen über dieses Dokument\",\n multiple_alternates(plural) {\n return `Dieses Dokument ist ebenfalls in ${\n plural\n ? \"diesen nicht-normativen Formaten verfügbar\"\n : \"diesem nicht-normativen Format verfügbar\"\n }:`;\n },\n prev_editor_draft: \"Vorheriger Entwurf:\",\n prev_recommendation: \"Vorherige Empfehlung:\",\n prev_version: \"Vorherige Version:\",\n publication_history: \"Veröffentlichungsverlauf\",\n test_suite: \"Testumgebung:\",\n this_version: \"Diese Fassung:\",\n },\n};\nexport const l10n = getIntlData(localizationStrings);\n\nexport function 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 /**\n * After export, we let fixup.js handle the <details>.\n */\n sub(\"beforesave\", doc => {\n const details = doc.querySelector(\".head details\");\n details.open = true;\n });\n return html`<div class=\"head\">\n ${conf.logos.length\n ? html`<p class=\"logos\">${conf.logos.map(showLogo)}</p>`\n : \"\"}\n ${document.querySelector(\"h1#title\")} ${getSpecSubTitleElem(conf)}\n <p id=\"w3c-state\">${renderSpecTitle(conf)}</p>\n <details open=\"${localStorage.getItem(\"tr-metadata\") || \"true\"}\">\n <summary>${l10n.more_details_about_this_doc}</summary>\n <dl>\n ${conf.thisVersion\n ? html`<dt>${l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\"\n >${conf.thisVersion}</a\n >\n </dd>`\n : \"\"}\n ${\"latestVersion\" in conf // latestVersion can be falsy\n ? html`<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 ${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.historyURI || conf.github\n ? html`<dt>${l10n.history}</dt>\n ${conf.historyURI\n ? html`<dd>\n <a href=\"${conf.historyURI}\">${conf.historyURI}</a>\n </dd>`\n : \"\"}\n ${conf.github\n ? html`<dd>\n <a href=\"${conf.github.commitHistoryURL}\"\n >${l10n.commit_history}</a\n >\n </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.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 ${conf.editors.length\n ? html`\n <dt>${conf.editors.length > 1 ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n `\n : \"\"}\n ${conf.formerEditors.length\n ? html`\n <dt>\n ${conf.formerEditors.length > 1\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors.length\n ? html`\n <dt>${conf.authors.length > 1 ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.github || conf.wgPublicList\n ? html`<dt>${l10n.feedback}</dt>\n ${renderFeedback(conf)}`\n : \"\"}\n ${conf.errata\n ? html`<dt>Errata:</dt>\n <dd><a href=\"${conf.errata}\">Errata exists</a>.</dd>`\n : \"\"}\n ${conf.otherLinks ? conf.otherLinks.map(showLink) : \"\"}\n </dl>\n </details>\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 ${l10n.multiple_alternates(options.multipleAlternates)}\n ${options.alternatesHTML}\n </p>`\n : \"\"}\n ${renderCopyright(conf)}\n <hr title=\"Separator for header\" />\n </div>`;\n};\n\nexport function renderFeedback(conf) {\n const definitions = [];\n // Github feedback...\n if (conf.github) {\n const { repoURL, issuesURL, newIssuesURL, pullsURL, fullName } =\n conf.github;\n definitions.push(\n html`<dd>\n <a href=\"${repoURL}\">GitHub ${fullName}</a>\n (<a href=\"${pullsURL}\">pull requests</a>,\n <a href=\"${newIssuesURL}\">new issue</a>,\n <a href=\"${issuesURL}\">open issues</a>)\n </dd>`\n );\n }\n\n // The <a href=\"mailto:list?subject\"> link for the public list\n if (conf.wgPublicList) {\n const mailToURL = new URL(`mailto:${conf.wgPublicList}@w3.org`);\n const subject =\n conf.subjectPrefix ?? `[${conf.shortName}] ${l10n.your_topic_here}`;\n const mailingListLink = html`<a\n href=\"${mailToURL.href}?subject=${encodeURIComponent(subject)}\"\n >${mailToURL.pathname}</a\n >`;\n\n // The subject line...\n const subjectLine =\n conf.subjectPrefix ||\n html`[${conf.shortName}] <em>${l10n.message_topic}</em>`;\n const emailSubject = html`${l10n.with_subject_line}${\" \"}\n <kbd>${subjectLine}</kbd>`;\n\n // Archives link\n const archiveURL = new URL(\n conf.wgPublicList,\n \"https://lists.w3.org/Archives/Public/\"\n );\n const archiveLink = html`(<a href=\"${archiveURL}\" rel=\"discussion\"\n >${l10n.archives}</a\n >)`;\n\n definitions.push(\n html`<dd>${mailingListLink} ${emailSubject} ${archiveLink}</dd>`\n );\n }\n return definitions;\n}\n\nfunction renderSpecTitle(conf) {\n const specType = conf.isCR || conf.isCRY ? conf.longStatus : conf.textStatus;\n const preamble = conf.prependW3C\n ? html`<a href=\"https://www.w3.org/standards/types#${conf.specStatus}\"\n >W3C ${specType}</a\n >`\n : html`${specType}`;\n return html`${preamble}${\" \"}\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${W3CDate.format(conf.publishDate)}</time\n >${conf.modificationDate\n ? html`, ${l10n.edited_in_place}${\" \"}\n <time\n class=\"dt-modified\"\n datetime=\"${ISODate.format(conf.modificationDate)}\"\n >${W3CDate.format(conf.modificationDate)}</time\n >`\n : \"\"}`;\n}\n\n/**\n * @param { LicenseInfo } licenseInfo license information\n */\nfunction linkLicense(licenseInfo) {\n const { url, short, name } = licenseInfo;\n if (name === \"unlicensed\") {\n return html`. <span class=\"issue\">THIS DOCUMENT IS UNLICENSED</span>.`;\n }\n return html` and\n <a rel=\"license\" href=\"${url}\" title=\"${name}\">${short}</a> rules apply.`;\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.isUnofficial && conf.licenseInfo) {\n return html`<p class=\"copyright\">\n Copyright ©\n ${conf.copyrightStart ? `${conf.copyrightStart}-` : \"\"}${conf.publishYear}\n the document editors/authors.\n ${conf.licenseInfo.name !== \"unlicensed\"\n ? html`Text is available under the\n <a rel=\"license\" href=\"${conf.licenseInfo.url}\"\n >${conf.licenseInfo.name}</a\n >; additional terms may apply.`\n : \"\"}\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/\">World Wide Web Consortium</a>.\n <abbr title=\"World Wide Web Consortium\">W3C</abbr><sup>®</sup>\n <a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer\"\n >liability</a\n >,\n <a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks\"\n >trademark</a\n >${linkLicense(conf.licenseInfo)}\n </p>`;\n}\n","// @ts-check\nimport { getSpecSubTitleElem, l10n, renderFeedback } from \"./headers.js\";\nimport { W3CDate } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.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.length\n ? html`<p class=\"logos\">${conf.logos.map(showLogo)}</p>`\n : \"\"}\n ${specTitleElem} ${getSpecSubTitleElem(conf)}\n <p id=\"w3c-state\">\n <a href=\"https://www.w3.org/standards/types#reports\"\n >${conf.longStatus}</a\n >\n <time class=\"dt-published\" datetime=\"${conf.dashDate}\"\n >${W3CDate.format(conf.publishDate)}</time\n >\n </p>\n <dl>\n ${conf.thisVersion\n ? html`<dt>${l10n.this_version}</dt>\n <dd>\n <a class=\"u-url\" href=\"${conf.thisVersion}\"\n >${conf.thisVersion}</a\n >\n </dd>`\n : \"\"}\n ${\"latestVersion\" in conf // latestVersion can be falsy\n ? html`<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 ${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 ${conf.editors.length\n ? html`\n <dt>${conf.editors.length > 1 ? l10n.editors : l10n.editor}</dt>\n ${showPeople(conf, \"editors\")}\n `\n : \"\"}\n ${conf.formerEditors.length\n ? html`\n <dt>\n ${conf.formerEditors.length > 1\n ? l10n.former_editors\n : l10n.former_editor}\n </dt>\n ${showPeople(conf, \"formerEditors\")}\n `\n : \"\"}\n ${conf.authors.length\n ? html`\n <dt>${conf.authors.length > 1 ? l10n.authors : l10n.author}</dt>\n ${showPeople(conf, \"authors\")}\n `\n : \"\"}\n ${conf.github || conf.wgPublicList\n ? html`<dt>${l10n.feedback}</dt>\n ${renderFeedback(conf)}`\n : \"\"}\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 { W3CDate, getIntlData } from \"../../core/utils.js\";\nimport { html } from \"../../core/import-maps.js\";\nimport { status2track } from \"../headers.js\";\nconst localizationStrings = {\n en: {\n sotd: \"Status of This Document\",\n status_at_publication: html`This section describes the status of this\n document at the time of its publication. A list of current W3C\n publications and the latest revision of this technical report can be found\n in the <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> at\n https://www.w3.org/TR/.`,\n },\n ko: {\n sotd: \"현재 문서의 상태\",\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 sotd: \"关于本文档\",\n // eslint-disable-next-line prettier/prettier\n status_at_publication: html`本章节描述了本文档的发布状态。W3C的文档列表和最新版本可通过<a href=\"https://www.w3.org/TR/\">W3C技术报告</a>索引访问。`,\n },\n ja: {\n sotd: \"この文書の位置付け\",\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 nl: {\n sotd: \"Status van dit document\",\n },\n es: {\n sotd: \"Estado de este Document\",\n status_at_publication: html`Esta sección describe el estado del presente\n documento al momento de su publicación. Una lista de las publicaciones\n actuales del W3C y la última revisión del presente informe técnico puede\n hallarse en 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 sotd: \"Status dieses Dokuments\",\n status_at_publication: html`Dieser Abschnitt beschreibt den Status des\n Dokuments zum Zeitpunkt der Publikation. Eine Liste der aktuellen\n Publikatinen des W3C und die aktuellste Fassung dieser Spezifikation kann\n im <a href=\"https://www.w3.org/TR/\">W3C technical reports index</a> unter\n https://www.w3.org/TR/ abgerufen werden.`,\n },\n};\n\nexport const l10n = getIntlData(localizationStrings);\n\nconst processLink = \"https://www.w3.org/2021/Process-20211102/\";\n\nfunction prefix(word) {\n return /^[aeiou]/i.test(word) ? `an ${word}` : `a ${word}`;\n}\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>${l10n.status_at_publication}</em></p>\n ${conf.isMemberSubmission\n ? noteForSubmission(conf, opts)\n : html`\n ${!conf.sotdAfterWGinfo ? opts.additionalContent : \"\"}\n ${!conf.overrideStatus\n ? html` ${linkToWorkingGroup(conf)} `\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 id=\"w3c_process_revision\" href=\"${processLink}\"\n >2 November 2021 W3C Process Document</a\n >.\n </p>\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 = null;\n let reviewPolicy = null;\n let endorsement = html`Publication as ${prefix(conf.textStatus)} does not\n imply endorsement by W3C and its Members.`;\n let updatePolicy = html`<p>\n This is a draft document and may be updated, replaced or obsoleted by other\n documents at any time. It is inappropriate to cite this document as other\n than work in progress.\n ${conf.updateableRec\n ? html`Future updates to this specification may incorporate\n <a href=\"${processLink}#allow-new-features\">new features</a>.`\n : \"\"}\n </p>`;\n if (conf.specStatus === \"DISC\") {\n updatePolicy = html`<p>\n Publication as a Discontinued Draft implies that this document is no\n longer intended to advance or to be maintained. It is inappropriate to\n cite this document as other than abandoned work.\n </p>`;\n }\n const lsUpdatePolicy = html`<p>\n This document is maintained and updated at any time. Some parts of this\n document are work in progress.\n </p>`;\n switch (conf.specStatus) {\n case \"STMT\":\n endorsement = html`<p>\n A W3C Statement is a specification that, after extensive\n consensus-building, has received the endorsement of the\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> and its Members.\n </p>`;\n break;\n case \"RY\":\n endorsement = html`<p>W3C recommends the wide usage of this registry.</p>\n <p>\n A W3C Registry is a specification that, after extensive\n consensus-building, has received the endorsement of the\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> and its Members.\n </p>`;\n break;\n case \"CRD\":\n statusExplanation = html`A Candidate Recommendation Draft integrates\n changes from the previous Candidate Recommendation that the Working Group\n intends to include in a subsequent Candidate Recommendation Snapshot.`;\n if (conf.pubMode === \"LS\") {\n updatePolicy = lsUpdatePolicy;\n }\n break;\n case \"CRYD\":\n statusExplanation = html`A Candidate Registry Draft integrates changes\n from the previous Candidate Registry Snapshot that the Working Group\n intends to include in a subsequent Candidate Registry Snapshot.`;\n if (conf.pubMode === \"LS\") {\n updatePolicy = lsUpdatePolicy;\n }\n break;\n case \"CRY\":\n statusExplanation = html`A Candidate Registry Snapshot has received\n <a href=\"${processLink}#dfn-wide-review\">wide review</a>.`;\n reviewPolicy = html`<p>\n The W3C Membership and other interested parties are invited to review\n the document and send comments through ${conf.humanPREnd}. Advisory\n Committee Representatives should consult 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 </p>`;\n break;\n case \"CR\":\n statusExplanation = html`A Candidate Recommendation Snapshot has received\n <a href=\"${processLink}#dfn-wide-review\">wide review</a>, is intended to\n gather\n <a href=\"${conf.implementationReportURI}\">implementation experience</a>,\n and has commitments from Working Group members to\n <a href=\"https://www.w3.org/Consortium/Patent-Policy/#sec-Requirements\"\n >royalty-free licensing</a\n >\n for implementations.`;\n updatePolicy = html`${conf.updateableRec\n ? html`Future updates to this specification may incorporate\n <a href=\"${processLink}#allow-new-features\">new features</a>.`\n : \"\"}`;\n if (conf.pubMode === \"LS\") {\n reviewPolicy = html`<p>\n Comments are welcome at any time but most especially before\n ${W3CDate.format(conf.crEnd)}.\n </p>`;\n } else {\n reviewPolicy = html`<p>\n This Candidate Recommendation is not expected to advance to Proposed\n Recommendation any earlier than ${W3CDate.format(conf.crEnd)}.\n </p>`;\n }\n break;\n case \"PR\":\n reviewPolicy = html`<p>\n The W3C Membership and other interested parties are invited to review\n the document and send comments through ${W3CDate.format(conf.prEnd)}.\n Advisory Committee Representatives should consult 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\n ${W3CDate.format(conf.crEnd)}.\n </p>`;\n break;\n case \"DNOTE\":\n case \"NOTE\":\n endorsement = html`${conf.textStatus}s are not endorsed by\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> nor its Members.`;\n break;\n }\n return html`<p>${endorsement} ${statusExplanation}</p>\n ${updatePolicy} ${reviewPolicy}`;\n}\n\nfunction renderIsRec(conf) {\n const { updateableRec, revisionTypes = [], revisedRecEnd } = conf;\n let reviewTarget = \"\";\n if (revisionTypes.includes(\"proposed-addition\")) {\n reviewTarget = \"additions\";\n } else if (revisionTypes.includes(\"proposed-correction\")) {\n reviewTarget = \"corrections\";\n }\n return html`\n <p>\n W3C recommends the wide deployment of this specification as a standard for\n the Web.\n </p>\n\n <p>\n A W3C Recommendation is a specification that, after extensive\n consensus-building, is endorsed by\n <abbr title=\"World Wide Web Consortium\">W3C</abbr> and its Members, and\n has commitments from Working Group members to\n <a href=\"https://www.w3.org/Consortium/Patent-Policy/#sec-Requirements\"\n >royalty-free licensing</a\n >\n for implementations.\n ${updateableRec\n ? html`Future updates to this Recommendation may incorporate\n <a href=\"${processLink}#allow-new-features\">new features</a>.`\n : \"\"}\n </p>\n ${revisionTypes.includes(\"addition\")\n ? html`<p class=\"addition\">\n Candidate additions are marked in the document.\n </p>`\n : \"\"}\n ${revisionTypes.includes(\"correction\")\n ? html`<p class=\"correction\">\n Candidate corrections are marked in the document.\n </p>`\n : \"\"}\n ${revisionTypes.includes(\"proposed-addition\")\n ? html`<p class=\"addition proposed\">\n Proposed additions are marked in the document.\n </p>`\n : \"\"}\n ${revisionTypes.includes(\"proposed-correction\")\n ? html`<p class=\"correction proposed\">\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 ${W3CDate.format(revisedRecEnd)}. Advisory Committee Representatives\n should consult their\n <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\"\n >WBS questionnaires</a\n >.\n </p>`\n : \"\"}\n `;\n}\n\nfunction renderDeliverer(conf) {\n const {\n isNote,\n isRegistry,\n wgId,\n multipleWGs,\n wgPatentHTML,\n wgPatentURI,\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 = !(isNote || isRegistry)\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 : html`\n The\n <a href=\"${patentPolicyURL}\"\n >${wgPatentPolicy === \"PP2017\" ? \"1 August 2017 \" : \"\"}W3C Patent\n Policy</a\n >\n does not carry any licensing requirements or commitments on this\n document.\n `;\n return html`<p data-deliverer=\"${isNote || isRegistry ? wgId : null}\">\n ${producers}\n ${!(isNote || isRegistry)\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 </p>`;\n}\n\nfunction noteForSubmission(conf, opts) {\n return html`\n ${opts.additionalContent}\n ${conf.isMemberSubmission ? noteForMemberSubmission(conf) : \"\"}\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\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 changes = null;\n if (conf.isRec && conf.revisionTypes && conf.revisionTypes.length) {\n const pa = conf.revisionTypes.includes(\"proposed-addition\");\n const pc = conf.revisionTypes.includes(\"proposed-correction\");\n const ca = conf.revisionTypes.includes(\"addition\");\n const cc = conf.revisionTypes.includes(\"correction\");\n if ((pa && pc) || (ca && cc)) {\n changes = html`It includes\n ${pa\n ? html`<a href=\"${processLink}#proposed-amendments\">\n proposed amendments</a\n >`\n : html`<a href=\"${processLink}#candidate-amendments\">\n candidate amendments</a\n >`},\n introducing substantive changes and new features since the previous\n Recommendation.`;\n } else if (pa || ca) {\n changes = html`It includes\n ${pa\n ? html`<a href=\"${processLink}#proposed-addition\">\n proposed additions</a\n >`\n : html`<a href=\"${processLink}#candidate-addition\">\n candidate additions</a\n >`},\n introducing new features since the previous Recommendation.`;\n } else if (pc || cc) {\n changes = html`It includes\n ${pc\n ? html`<a href=\"${processLink}#proposed-correction\">\n proposed corrections</a\n >`\n : html`<a href=\"${processLink}#candidate-correction\">\n candidate corrections</a\n >`}.`;\n }\n }\n const track = status2track[conf.specStatus]\n ? html` using the\n <a href=\"${processLink}#recs-and-notes\"\n >${status2track[conf.specStatus]} track</a\n >`\n : \"\";\n return html`<p>\n This document was published by ${conf.wgHTML} as\n ${prefix(conf.longStatus)}${track}. ${changes}\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// - 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// - 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// - \"document\", which is the old, but still available, document license.\n// - \"dual\", dual license.\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 norm,\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\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 \"Member-SUBM\": \"SUBM\",\n};\n\nexport const status2text = {\n DNOTE: \"Group Draft Note\",\n NOTE: \"Group Note\",\n STMT: \"Statement\",\n \"Member-SUBM\": \"Member 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 CR: \"Candidate Recommendation\",\n CRD: \"Candidate Recommendation\",\n PR: \"Proposed Recommendation\",\n PER: \"Proposed Edited Recommendation\",\n REC: \"Recommendation\",\n DISC: \"Discontinued Draft\",\n RSCND: \"Rescinded Recommendation\",\n DRY: \"Draft Registry\",\n CRYD: \"Candidate Registry\",\n CRY: \"Candidate Registry\",\n RY: \"Registry\",\n unofficial: \"Unofficial Draft\",\n UD: \"Unofficial Draft\",\n base: \"\",\n finding: \"TAG Finding\",\n \"draft-finding\": \"Draft TAG Finding\",\n \"editor-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 CRY: \"Candidate Registry Snapshot\",\n CRYD: \"Candidate Registry Draft\",\n};\nexport const status2track = {\n DNOTE: \"Note\",\n NOTE: \"Note\",\n STMT: \"Note\",\n \"WG-NOTE\": \"Note\",\n \"IG-NOTE\": \"Note\",\n FPWD: \"Recommendation\",\n WD: \"Recommendation\",\n CR: \"Recommendation\",\n CRD: \"Recommendation\",\n PR: \"Recommendation\",\n REC: \"Recommendation\",\n DISC: \"Recommendation\",\n RSCND: \"Recommendation\",\n DRY: \"Registry\",\n CRYD: \"Registry\",\n CRY: \"Registry\",\n RY: \"Registry\",\n};\nexport const W3CNotes = [\"DNOTE\", \"NOTE\", \"STMT\"];\nexport const recTrackStatus = [\n \"CR\",\n \"CRD\",\n \"DISC\",\n \"FPWD\",\n \"PER\",\n \"PR\",\n \"REC\",\n \"RSCND\",\n \"WD\",\n];\nexport const registryTrackStatus = [\"DRY\", \"CRY\", \"CRYD\", \"RY\"];\nexport const tagStatus = [\"draft-finding\", \"finding\", \"editor-draft-finding\"];\nexport const cgStatus = [\"CG-DRAFT\", \"CG-FINAL\"];\nexport const bgStatus = [\"BG-DRAFT\", \"BG-FINAL\"];\nexport const cgbgStatus = [...cgStatus, ...bgStatus];\nexport const trStatus = [\n ...W3CNotes,\n ...recTrackStatus,\n ...registryTrackStatus,\n];\nexport const noTrackStatus = [\n \"base\",\n ...cgStatus,\n ...bgStatus,\n \"editor-draft-finding\",\n \"draft-finding\",\n \"finding\",\n \"MO\",\n \"unofficial\",\n];\n/** @type {Map<string, LicenseInfo>} */\nexport const 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: \"permissive document license\",\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 \"document\",\n {\n name: \"W3C Document License\",\n short: \"document use\",\n url: \"https://www.w3.org/Consortium/Legal/copyright-documents\",\n },\n ],\n [\n \"dual\",\n {\n name: \"W3C Dual License\",\n short: \"dual license\",\n url: \"https://www.w3.org/Consortium/Legal/2013/copyright-documents-dual.html\",\n },\n ],\n [\n undefined,\n {\n name: \"unlicensed\",\n url: null,\n short: \"UNLICENSED\",\n },\n ],\n]);\n\nconst patentPolicies = [\"PP2017\", \"PP2020\"];\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\nfunction deriveLicenseInfo(conf) {\n let license = undefined;\n if (typeof conf.license === \"string\") {\n const lCaseLicense = conf.license.toLowerCase();\n if (!licenses.has(lCaseLicense)) {\n const msg = `The license \"\\`${conf.license}\\`\" is not supported.`;\n const choices = codedJoinOr(\n [...licenses.keys()].filter(k => k),\n {\n quotes: true,\n }\n );\n const hint = docLink`Please set\n ${\"[license]\"} to one of: ${choices}. If in doubt, remove \\`license\\` and let ReSpec pick one for you.`;\n showError(msg, name, { hint });\n } else {\n license = lCaseLicense;\n }\n }\n\n if (conf.isUnofficial && !license) {\n license = \"cc-by\";\n }\n\n // W3C docs can't be CC-BY or CC0\n if (!conf.isUnofficial && [\"cc-by\", \"cc0\"].includes(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 const licenseInfo = licenses.get(license);\n return licenseInfo;\n}\n\nexport async function run(conf) {\n conf.isBasic = conf.specStatus === \"base\";\n conf.isCGBG = cgbgStatus.includes(conf.specStatus);\n conf.isCGFinal = conf.isCGBG && conf.specStatus.endsWith(\"G-FINAL\");\n conf.isCR = conf.specStatus === \"CR\" || conf.specStatus === \"CRD\";\n conf.isCRDraft = conf.specStatus === \"CRD\";\n conf.isCRY = conf.specStatus === \"CRY\" || conf.specStatus === \"CRYD\";\n conf.isEd = conf.specStatus === \"ED\";\n conf.isMemberSubmission = conf.specStatus === \"Member-SUBM\";\n conf.isMO = conf.specStatus === \"MO\";\n conf.isNote = W3CNotes.includes(conf.specStatus);\n conf.isNoTrack = noTrackStatus.includes(conf.specStatus);\n conf.isPER = conf.specStatus === \"PER\";\n conf.isPR = conf.specStatus === \"PR\";\n conf.isRecTrack = recTrackStatus.includes(conf.specStatus);\n conf.isRec = conf.isRecTrack && conf.specStatus === \"REC\";\n conf.isRegistry = registryTrackStatus.includes(conf.specStatus);\n conf.isRegular = !conf.isCGBG && !conf.isBasic;\n conf.isTagEditorFinding = conf.specStatus === \"editor-draft-finding\";\n conf.isTagFinding = tagStatus.includes(conf.specStatus);\n conf.isUnofficial = conf.specStatus === \"unofficial\";\n conf.licenseInfo = deriveLicenseInfo(conf);\n conf.prependW3C = !conf.isBasic && !conf.isUnofficial;\n conf.longStatus = status2long[conf.specStatus];\n conf.textStatus = status2text[conf.specStatus];\n conf.showPreviousVersion = false;\n\n if (conf.isRegular && !conf.shortName) {\n const msg = docLink`The ${\"[shortName]\"} configuration option is required for this kind of document.`;\n const hint = docLink`Please set ${\"[shortName]\"} to a short name for the specification.`;\n showError(msg, name, { hint });\n }\n\n conf.publishDate = validateDateAndRecover(\n conf,\n \"publishDate\",\n document.lastModified\n );\n conf.publishYear = conf.publishDate.getUTCFullYear();\n if (conf.modificationDate) {\n conf.modificationDate = validateDateAndRecover(\n conf,\n \"modificationDate\",\n document.lastModified\n );\n }\n\n if (conf.isRecTrack && !conf.github && !conf.wgPublicList) {\n const msg =\n \"W3C Process requires a either a link to a public repository or mailing list.\";\n const hint = docLink`Use the ${\"[github]\"} configuration option to add a link to a repository. Alternatively use ${\"[wgPublicList]\"} to link to a mailing list.`;\n showError(msg, name, {\n hint,\n });\n }\n\n if (conf.isEd && !conf.edDraftURI) {\n const msg = docLink`Editor's Drafts should set ${\"[edDraftURI]\"} configuration option.`;\n const hint = docLink`Please set ${\"[edDraftURI]\"} to the URL of the Editor's Draft. Alternatively, use the set ${\"[github]\"} option, which automatically sets it for you.`;\n showWarning(msg, name, { hint });\n }\n\n const pubSpace = derivePubSpace(conf);\n if (pubSpace && !conf.thisVersion) {\n const maturity = status2maturity[conf.specStatus] || conf.specStatus;\n const { shortName, publishDate } = conf;\n const date = concatDate(publishDate);\n const docVersion = `${maturity}-${shortName}-${date}`;\n const year = [...trStatus, \"Member-SUBM\"].includes(conf.specStatus)\n ? `${publishDate.getUTCFullYear()}/`\n : \"\";\n conf.thisVersion = w3Url(`${pubSpace}/${year}${docVersion}/`);\n }\n\n if (conf.isEd) conf.thisVersion = conf.edDraftURI;\n if (conf.isCGBG) validateCGBG(conf);\n if (conf.latestVersion !== null) {\n conf.latestVersion = conf.latestVersion\n ? w3Url(conf.latestVersion)\n : w3Url(`${pubSpace}/${conf.shortName}/`);\n }\n\n if (conf.latestVersion) validateIfAllowedOnTR(conf);\n\n const latestPath = `${pubSpace}/${conf.shortName}`;\n if (conf.previousPublishDate) {\n if (!conf.previousMaturity && !conf.isTagFinding) {\n const msg = docLink`${\"[`previousPublishDate`]\"} is set, but missing ${\"[`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 }\n if (conf.prevRecShortname && !conf.prevRecURI)\n conf.prevRecURI = w3Url(`${pubSpace}/${conf.prevRecShortname}`);\n\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.length === 0) {\n const msg = \"At least one editor is required.\";\n const hint = docLink`Add one or more editors using the ${\"[editors]\"} configuration option.`;\n showError(msg, name, { hint });\n } else if (conf.editors.length && conf.isRecTrack) {\n // check that every editor has w3cid\n conf.editors.forEach((editor, i) => {\n if (editor.w3cid) return;\n const msg = docLink`Editor ${\n editor.name ? `\"${editor.name}\"` : `number ${i + 1}`\n } is missing their ${\"[w3cid]\"}.`;\n const hint = docLink`See ${\"[w3cid]\"} for instructions for how to retrieve it and add it.`;\n showError(msg, name, { hint });\n });\n }\n\n if (conf.alternateFormats?.some(({ uri, label }) => !uri || !label)) {\n const msg = docLink`Every ${\"[`alternateFormats`]\"} entry must have a \\`uri\\` and a \\`label\\`.`;\n showError(msg, name);\n }\n if (conf.copyrightStart == conf.publishYear) conf.copyrightStart = \"\";\n if (conf.isRec && !conf.errata && !conf.revisionTypes?.length) {\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.dashDate = ISODate.format(conf.publishDate);\n conf.publishISODate = conf.publishDate.toISOString();\n conf.shortISODate = ISODate.format(conf.publishDate);\n validatePatentPolicies(conf);\n await deriveHistoryURI(conf);\n if (conf.isTagEditorFinding) {\n delete conf.thisVersion;\n delete conf.latestVersion;\n }\n if (conf.isTagFinding) {\n conf.showPreviousVersion = conf.previousPublishDate ? true : false;\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 (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.isPR && !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.isCR && !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\n if (conf.isPr && !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\n if (conf.isPER && !conf.perEnd) {\n const msg = docLink`${\"[specStatus]\"} is \"PER\", but no ${\"[perEnd]\"} is specified.`;\n showError(msg, name);\n }\n conf.perEnd = validateDateAndRecover(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 = [\n \"addition\",\n \"correction\",\n \"proposed-addition\",\n \"proposed-correction\",\n ];\n if (conf.isRec && 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 (\n (conf.revisionTypes.includes(\"proposed-addition\") ||\n conf.revisionTypes.includes(\"addition\")) &&\n !conf.updateableRec\n ) {\n const msg = docLink`${\"[specStatus]\"} is \"REC\" with proposed additions but the Recommendation is not marked as 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 [\"proposed-addition\", \"proposed-correction\"].some(type =>\n conf.revisionTypes.includes(type)\n ) &&\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\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 (!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: norm(\n document.getElementById(\"w3c-state\")?.textContent ?? \"\"\n ),\n });\n}\n\nfunction validateIfAllowedOnTR(conf) {\n const latestVersionURL = new URL(conf.latestVersion);\n const isW3C =\n latestVersionURL.origin === \"https://www.w3.org\" ||\n latestVersionURL.origin === \"https://w3.org/\";\n if (\n isW3C &&\n latestVersionURL.pathname.startsWith(\"/TR/\") &&\n [\"ED\", ...trStatus].includes(conf.specStatus) === false\n ) {\n const msg = docLink`Documents with a status of \\`\"${conf.specStatus}\"\\` can't be published on the W3C's /TR/ (Technical Report) space.`;\n const hint = docLink`Ask a W3C Team Member for a W3C URL where the report can be published and change ${\"[latestVersion]\"} to something else.`;\n showError(msg, name, { hint });\n return;\n }\n}\n\nfunction derivePubSpace(conf) {\n const { specStatus, group } = conf;\n if (trStatus.includes(specStatus) || conf.groupType === \"wg\") {\n return `/TR`;\n }\n\n switch (specStatus) {\n case \"CG-FINAL\":\n case \"BG-FINAL\":\n return `/community/reports/${group}`;\n case \"finding\":\n case \"draft-finding\":\n return \"/2001/tag/doc\";\n case \"Member-SUBM\":\n return `/Submission`;\n }\n\n return \"\";\n}\n\nfunction validateCGBG(conf) {\n const reportType = status2text[conf.specStatus];\n const latestVersionURL = conf.latestVersion\n ? new URL(w3Url(conf.latestVersion))\n : null;\n\n if (!conf.wg) {\n const msg = docLink`The ${\"[group]\"} configuration option is required for this kind of document (${reportType}).`;\n showError(msg, name);\n return;\n }\n\n // Deal with final reports\n if (conf.isCGFinal) {\n // Final report require a w3.org URL.\n const isW3C =\n latestVersionURL?.origin === \"https://www.w3.org\" ||\n latestVersionURL?.origin === \"https://w3.org/\";\n if (isW3C === false) {\n const msg = docLink`For ${reportType}, the ${\"[latestVersion]\"} URL must point to somewhere at https://www.w3.org/.`;\n const hint = `Ask a W3C Team Member for a W3C URL where the report can be published.`;\n showError(msg, name, { hint });\n return;\n }\n }\n}\n\nasync function deriveHistoryURI(conf) {\n if (!conf.shortName || conf.historyURI === null || !conf.latestVersion) {\n return; // Nothing to do\n }\n\n const canShowHistory = conf.isEd || trStatus.includes(conf.specStatus);\n\n if (conf.historyURI && !canShowHistory) {\n const msg = docLink`The ${\"[historyURI]\"} can't be used with non /TR/ documents.`;\n const hint = docLink`Please remove ${\"[historyURI]\"}.`;\n showError(msg, name, { hint });\n conf.historyURI = null;\n return;\n }\n\n const historyURL = new URL(\n conf.historyURI ?? conf.shortName,\n \"https://www.w3.org/standards/history/\"\n );\n\n // If it's on the Rec Track or it's TR worthy, then allow history override.\n // Also make a an exception for FPWD, DNOTE, NOTE and DRY.\n if (\n (conf.historyURI && canShowHistory) ||\n [\"FPWD\", \"DNOTE\", \"NOTE\", \"DRY\"].includes(conf.specStatus)\n ) {\n conf.historyURI = historyURL.href;\n return;\n }\n\n // Let's get the history from the W3C.\n // Do a fetch HEAD request to see if the history exists...\n // We don't discriminate... if it's on the W3C website with a history,\n // we show it.\n try {\n const response = await fetch(historyURL, { method: \"HEAD\" });\n if (response.ok) {\n conf.historyURI = response.url;\n }\n } catch {\n // Ignore fetch errors\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 sotdClone.nodeType === Node.ELEMENT_NODE &&\n // @ts-ignore\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","// @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 recTrackStatus,\n registryTrackStatus,\n status2text,\n tagStatus,\n trStatus,\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/2021/logos/W3C\",\n alt: \"W3C\",\n height: 48,\n width: 72,\n url: \"https://www.w3.org/\",\n};\n\nconst 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 height: \"48\",\n};\n\nconst w3cDefaults = {\n lint: {\n \"privsec-section\": false,\n \"required-sections\": true,\n \"wpt-tests-exist\": false,\n \"informative-dfn\": \"warn\",\n \"no-unused-dfns\": \"warn\",\n a11y: false,\n },\n doJsonLd: false,\n logos: [],\n xref: true,\n wgId: \"\",\n otherLinks: [],\n excludeGithubLinks: true,\n subtitle: \"\",\n prevVersion: \"\",\n formerEditors: [],\n editors: [],\n authors: [],\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 validateStatusForGroup(conf);\n processLogos(conf);\n}\n\nfunction processLogos(conf) {\n // Primarily include the W3C logo and license for W3C Recommendation track\n // that have an actual working group.\n const { specStatus, wg } = conf;\n const isWgStatus = [\n ...recTrackStatus,\n ...registryTrackStatus,\n ...W3CNotes,\n ...tagStatus,\n \"ED\",\n ].includes(specStatus);\n const inWorkingGroup = wg && wg.length && isWgStatus;\n // Member submissions don't need to be in a Working Group.\n const doesNotNeedWG = [\"Member-SUBM\"].includes(specStatus);\n const canShowW3CLogo = inWorkingGroup || doesNotNeedWG;\n if (canShowW3CLogo) {\n conf.logos.unshift(w3cLogo);\n if (specStatus === \"Member-SUBM\") {\n conf.logos.push(memSubmissionLogo);\n }\n }\n}\n\nfunction validateStatusForGroup(conf) {\n const { specStatus, groupType, group } = conf;\n\n if (!specStatus) {\n const msg = docLink`The ${\"[specStatus]\"} configuration option is required.`;\n const hint = docLink`Select an appropriate status from ${\"[specStatus]\"} based on your W3C group. If in doubt, use \\`\"unofficial\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"base\";\n return;\n }\n\n if (status2text[specStatus] === undefined) {\n const msg = docLink`The ${\"[specStatus]\"} \"\\`${specStatus}\\`\" is not supported at for this type of document.`;\n const choices = codedJoinOr(Object.keys(status2text), { quotes: true });\n const hint = docLink`set ${\"[specStatus]\"} to one of: ${choices}.`;\n showError(msg, name, { hint });\n conf.specStatus = \"base\";\n return;\n }\n\n switch (groupType) {\n case \"cg\": {\n if (![...cgStatus, \"unofficial\", \"UD\"].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\", \"UD\"].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 (![...trStatus, \"unofficial\", \"UD\", \"ED\"].includes(specStatus)) {\n const msg = docLink`W3C Working Group documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const hint = docLink`Pleas see ${\"[specStatus]\"} for appropriate status for W3C Working Group documents.`;\n showError(msg, name, { hint });\n }\n break;\n }\n case \"other\":\n if (\n group === \"tag\" &&\n ![\"ED\", ...trStatus, ...tagStatus].includes(specStatus)\n ) {\n const msg = docLink`The W3C Technical Architecture Group's documents can't use \\`\"${specStatus}\"\\` for the ${\"[specStatus]\"} configuration option.`;\n const supportedStatus = codedJoinOr([\"ED\", ...trStatus, ...tagStatus], {\n quotes: true,\n });\n const hint = `Please use one of: ${supportedStatus}. Automatically falling back to \\`\"unofficial\"\\`.`;\n showError(msg, name, { hint });\n conf.specStatus = \"unofficial\";\n }\n break;\n default:\n if (\n !conf.wgId &&\n ![\"unofficial\", \"base\", \"UD\", \"Member-SUBM\"].includes(conf.specStatus)\n ) {\n const msg =\n \"Document is not associated with a [W3C group](https://respec.org/w3c/groups/). Defaulting to 'base' status.\";\n const hint = docLink`Use the ${\"[group]\"} configuration option to associated this document with a W3C group.`;\n conf.specStatus = \"base\";\n showError(msg, name, { hint });\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/* --- INLINES --- */\n:is(h1, h2, h3, h4, h5, h6, a) 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\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\n.self-link:hover {\n opacity: 1;\n text-decoration: none;\n background-color: transparent;\n}\n\naside.example .marker > a.self-link {\n color: inherit;\n}\n\n.header-wrapper {\n display: flex;\n align-items: baseline;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc > h2, #abstract > h2, #sotd > h2, .head > h2) {\n position: relative;\n left: -.5em;\n}\n\n:is(h2, h3, h4, h5, h6):not(#toc h2) + a.self-link {\n color: inherit;\n order: -1;\n position: relative;\n left: -1.1em;\n font-size: 1rem;\n opacity: 0.5;\n}\n\n:is(h2, h3, h4, h5, h6) + a.self-link::before {\n content: \"§\";\n text-decoration: none;\n color: var(--heading-text);\n}\n\n:is(h2, h3) + a.self-link {\n top: -0.2em;\n}\n\n:is(h4, h5, h6) + a.self-link::before {\n color: black;\n}\n\n@media (max-width: 767px) {\n dd {\n margin-left: 0;\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 { W3CNotes, recTrackStatus, registryTrackStatus } from \"./headers.js\";\nimport { createResourceHint, linkCSS } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { sub } from \"../core/pubsubhub.js\";\nexport const name = \"w3c/style\";\n\nfunction attachFixupScript() {\n const script = html`<script src=\"https://www.w3.org/scripts/TR/2021/fixup.js\">`;\n if (location.hash) {\n script.addEventListener(\n \"load\",\n () => {\n window.location.href = location.hash;\n },\n { once: true }\n );\n }\n document.body.appendChild(script);\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/2021/fixup.js\",\n as: \"script\",\n },\n {\n hint: \"preload\", // all specs include on base.css.\n href: \"https://www.w3.org/StyleSheets/TR/2021/base.css\",\n as: \"style\",\n },\n {\n hint: \"preload\", // all specs show the logo.\n href: \"https://www.w3.org/StyleSheets/TR/2021/logos/W3C\",\n as: \"image\",\n corsMode: \"anonymous\",\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(html`<link\n rel=\"stylesheet\"\n href=\"https://www.w3.org/StyleSheets/TR/2021/base.css\"\n class=\"removeOnSave\"\n/>`);\nif (!document.head.querySelector(\"meta[name=viewport]\")) {\n // Make meta viewport the first element in the head.\n elements.prepend(\n html`<meta\n name=\"viewport\"\n content=\"width=device-width, initial-scale=1, shrink-to-fit=no\"\n />`\n );\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 const canonicalStatus = conf.specStatus?.toUpperCase() ?? \"\";\n let styleFile = \"\";\n const canUseW3CStyle =\n [\n ...recTrackStatus,\n ...registryTrackStatus,\n ...W3CNotes,\n \"ED\",\n \"MEMBER-SUBM\",\n ].includes(canonicalStatus) && conf.wgId;\n\n // Figure out which style file to use.\n switch (canonicalStatus) {\n case \"WD\":\n case \"FPWD\":\n styleFile = canUseW3CStyle ? \"W3C-WD\" : \"base.css\";\n break;\n case \"CG-DRAFT\":\n case \"CG-FINAL\":\n case \"BG-DRAFT\":\n case \"BG-FINAL\":\n styleFile = canonicalStatus.toLowerCase();\n break;\n case \"UD\":\n case \"UNOFFICIAL\":\n styleFile = \"W3C-UD\";\n break;\n case \"FINDING\":\n case \"DRAFT-FINDING\":\n case \"EDITOR-DRAFT-FINDING\":\n case \"BASE\":\n styleFile = \"base.css\";\n break;\n case \"MEMBER-SUBM\":\n styleFile = \"W3C-Member-SUBM\";\n break;\n default:\n styleFile = canUseW3CStyle ? `W3C-${conf.specStatus}` : \"base.css\";\n }\n\n // Attach W3C fixup script after we are done.\n if (!conf.noToc) {\n sub(\"end-all\", attachFixupScript, { once: true });\n }\n const finalStyleURL = new URL(\n `/StyleSheets/TR/2021/${styleFile}`,\n \"https://www.w3.org/\"\n );\n linkCSS(document, finalStyleURL.href);\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/**\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 commitHistoryURL = new URL(\n `./commits/${conf.github.branch ?? \"\"}`,\n ghURL.href\n );\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 // 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 if (!conf.excludeGithubLinks) {\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: commitHistoryURL.href,\n },\n {\n value: \"Pull requests\",\n href: newProps.pullBase,\n },\n ],\n };\n if (!conf.otherLinks) {\n conf.otherLinks = [];\n }\n conf.otherLinks.unshift(otherLink);\n }\n const normalizedGHObj = {\n branch,\n repoURL: ghURL.href,\n apiBase: githubAPI,\n fullName: `${org}/${repo}`,\n issuesURL: issueBase,\n pullsURL: newProps.pullBase,\n newIssuesURL: new URL(\"./new/choose\", issueBase).href,\n commitHistoryURL: commitHistoryURL.href,\n };\n resolveGithubPromise(normalizedGHObj);\n\n const normalizedConfig = {\n ...newProps,\n ...conf,\n github: normalizedGHObj,\n githubAPI,\n };\n Object.assign(conf, normalizedConfig);\n}\n","/**\n * Module core/sections\n *\n * Adds <section>s to the document, based on the heading structure.\n */\nexport const name = \"core/sections\";\n\nclass DOMBuilder {\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) {\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(structure(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/**\n *\n * @param {Node} fragment\n * @returns\n */\nfunction structure(fragment) {\n const builder = new DOMBuilder(fragment.ownerDocument);\n while (fragment.firstChild) {\n const node = fragment.firstChild;\n switch (node.localName) {\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n case \"h5\":\n case \"h6\":\n builder.addHeader(node);\n break;\n case \"section\":\n builder.addSection(node);\n break;\n default:\n builder.addElement(node);\n }\n }\n return builder.root;\n}\n\n/**\n * Restructure a container element adding sections if needed.\n * @param {Element} elem\n */\nexport function restructure(elem) {\n const structuredInternals = structure(elem);\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\nexport function run() {\n restructure(document.body);\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 { runTransforms, showError } from \"./utils.js\";\nimport { markdownToHtml } from \"./markdown.js\";\nimport { restructure } from \"./sections.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 await runIncludes(document, 1);\n}\n\n/**\n * @param {HTMLElement | Document} root\n * @param {number} currentDepth\n */\nasync function runIncludes(root, currentDepth) {\n /** @type {NodeListOf<HTMLElement>} */\n const includables = root.querySelectorAll(\"[data-include]\");\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()).slice(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 if (currentDepth < 3) {\n // For performance reasons, only allow limited nesting.\n await runIncludes(el, currentDepth + 1);\n }\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 // We replace \":<br>\" with \":\", and \"<br>\" with \"-\", as appropriate.\n const tempElem = document.createElement(\"h1\");\n tempElem.innerHTML = h1Elem.innerHTML\n .replace(/:<br>/g, \": \")\n .replace(/<br>/g, \" - \");\n let documentTitle = norm(tempElem.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, norm, renameElement, showError } from \"../core/utils.js\";\nimport { html } from \"../core/import-maps.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 abstract = findAbstract();\n if (!abstract) {\n const msg = 'Document must have one `<section id=\"abstract\">`.';\n showError(msg, name);\n return;\n }\n abstract.classList.add(\"introductory\");\n abstract.id = \"abstract\";\n if (!abstract.querySelector(\"h2\")) {\n abstract.prepend(html`<h2>${l10n.abstract}</h2>`);\n }\n}\n\nfunction findAbstract() {\n /** @type {HTMLElement} */\n const abstract = document.querySelector(\"#abstract\");\n if (abstract) {\n switch (abstract.localName) {\n case \"section\":\n return abstract;\n case \"div\":\n // Legacy documents may use a div\n return renameElement(abstract, \"section\");\n default:\n showError(\"The abstract should be a `<section>` element.\", name, {\n elements: [abstract],\n });\n return abstract;\n }\n }\n\n // Let's try find it by checking the headings.\n // This can happen if the document was generated\n // using markdown.\n const searchString = l10n.abstract.toLowerCase();\n for (const header of document.querySelectorAll(\"h2, h3, h4, h5, h6\")) {\n const contents = norm(header.textContent).toLowerCase();\n if (contents === searchString) {\n return header.closest(\"section\");\n }\n }\n return null;\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\" }}\n\n/**\n * Matches following patterns:\n * - `identifier(arg1, moreArgs)`\n * - `identifier()`\n * - `identifier(arg1, moreArgs)|text`\n * - `identifier(arg1, moreArgs)|text()`\n * - `identifier(arg1, moreArgs)|text(argA, moreArgs)`\n *\n * Groups: identifier, args, [text, [textArgs]]\n */\nconst methodRegex = /^(\\w+)\\(([^\\\\)]*)\\)(?:\\|(\\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 {string | undefined} renderText\n * @property {string[] | undefined} renderArgs\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, altText, altArgs] =\n value.match(methodRegex);\n const args = allArgs.split(/,\\s*/).filter(arg => arg);\n const renderText = altText?.trim();\n const renderArgs = altArgs?.split(/,\\s*/).filter(arg => arg);\n results.push({\n type: \"method\",\n identifier,\n args,\n renderParent,\n renderText,\n renderArgs,\n });\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-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 { renderText: text, renderArgs: textArgs } = details;\n const { identifier: linkFor } = parent || {};\n const argsText = htmlJoinComma(textArgs || 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>${text || identifier}</code></a\n >${!text || textArgs ? html`<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 /** @type {import(\"idb\").IDBPDatabase<BiblioDb>} */\n const db = 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 // Clean the database of expired biblio entries.\n const now = Date.now();\n for (const storeName of [...ALLOWED_TYPES]) {\n const store = db.transaction(storeName, \"readwrite\").store;\n const range = IDBKeyRange.lowerBound(now);\n let result = await store.openCursor(range);\n while (result?.value) {\n /** @type {BiblioData} */\n const entry = result.value;\n if (entry.expires === undefined || entry.expires < now) {\n await store.delete(entry.id);\n }\n result = await result.continue();\n }\n }\n\n return db;\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<BiblioData?>} 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<BiblioData?>} 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 {BibliographyMap} data An object that contains references and aliases.\n * @param {number} expires The date/time when the data expires.\n */\n async addAll(data, expires) {\n if (!data) {\n return;\n }\n const aliasesAndRefs = { alias: [], reference: [] };\n for (const id of Object.keys(data)) {\n /** @type {BiblioData} */\n const obj = { id, ...data[id], expires };\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 {BiblioData} 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 let isInDB = await this.has(type, details.id);\n // update or add, depending of already having it in db\n // or if it's expired\n if (isInDB) {\n const entry = await this.get(type, details.id);\n if (entry?.expires < Date.now()) {\n const { store } = db.transaction(type, \"readwrite\");\n await store.delete(details.id);\n isInDB = false;\n }\n }\n const { store } = db.transaction(type, \"readwrite\");\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 // SpecRef updates every hour, so we should follow suit\n // https://github.com/tobie/specref#hourly-auto-updating\n const oneHourFromNow = Date.now() + 1000 * 60 * 60 * 1;\n try {\n const expires = response.headers.has(\"Expires\")\n ? Math.min(Date.parse(response.headers.get(\"Expires\")), oneHourFromNow)\n : oneHourFromNow;\n await biblioDB.addAll(data, expires);\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 // 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\n const idbRefs = neededRefs.length\n ? await getReferencesFromIdb(neededRefs)\n : [];\n const split = { hasData: [], noData: [] };\n idbRefs.forEach(ref => {\n (ref.data ? split.hasData : split.noData).push(ref);\n });\n split.hasData.forEach(ref => {\n biblio[ref.id] = ref.data;\n });\n const externalRefs = split.noData.map(item => item.id);\n if (externalRefs.length) {\n // Going to the network for refs we don't have\n const data = await updateFromNetwork(externalRefs, { forceUpdate: true });\n Object.assign(biblio, data);\n }\n Object.assign(biblio, 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 reference_not_found: \"Reference not found.\",\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 reference_not_found: \"Referencia no encontrada.\",\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 [\"LCWD\", \"W3C Last Call Working Draft\"],\n [\"NOTE\", \"W3C Working Group Note\"],\n [\"PER\", \"W3C Proposed Edited Recommendation\"],\n [\"PR\", \"W3C Proposed Recommendation\"],\n [\"REC\", \"W3C Recommendation\"],\n [\"WD\", \"W3C Working Draft\"],\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 > :is(h2, h1)\")) {\n // We use a h1 here because this could be structured from markdown\n // which would otherwise end up in the wrong document order\n // when the document is restructured.\n refSection.prepend(html`<h1>${l10n.references}</h1>`);\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} reference\n */\nfunction showRef(reference) {\n const { ref, refcontent } = reference;\n const refId = `bib-${ref.toLowerCase()}`;\n const result = html`\n <dt id=\"${refId}\">[${ref}]</dt>\n <dd>\n ${refcontent\n ? { html: stringifyReference(refcontent) }\n : html`<em class=\"respec-offending-element\"\n >${l10n.reference_not_found}</em\n >`}\n </dd>\n `;\n return result;\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(refs) {\n for (const { ref } of refs) {\n /** @type {NodeListOf<HTMLElement>} */\n const links = document.querySelectorAll(\n `a.bibref[href=\"#bib-${ref.toLowerCase()}\"]`\n );\n const elements = [...links].filter(\n ({ textContent: t }) => t.toLowerCase() === ref.toLowerCase()\n );\n const msg = `Reference \"[${ref}]\" not found.`;\n const hint = `Search for [\"${ref}\"](https://www.specref.org?q=${ref}) on Specref to see if it exists or if it's misspelled.`;\n showError(msg, name, { hint, elements });\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 /\\bMÜSSEN\\b/,\n /\\bERFORDERLICH\\b/,\n /\\b(?:NICHT\\s+)?NÖTIG\\b/,\n /\\bDARF(?:\\s+NICHT)?\\b/,\n /\\bDÜRFEN(?:\\s+NICHT)?\\b/,\n /\\bVERBOTEN\\b/,\n /\\bSOLL(?:\\s+NICHT)?\\b/,\n /\\bSOLLEN(?:\\s+NICHT)?\\b/,\n /\\b(?:NICHT\\s+)?EMPFOHLEN\\b/,\n /\\bKANN\\b/,\n /\\bKÖNNEN\\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\n data-xref-type=\"${xrefType}\"\n data-xref-for=\"${xrefFor}\"\n data-link-type=\"${xrefType}\"\n data-link-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}\" data-matched-text=\"${matched}\"></a>`;\n }\n return html`<a href=\"${ref}\" data-matched-text=\"${matched}\"></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 return html`<a\n data-link-type=\"dfn\"\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\", \"svg\"];\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 <h1>${l10n.conformance}</h1>\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 {\"element-attr\" | \"element\"} type\n * @type {DefinitionValidator} */\nexport function validateDOMName(text, type, elem, pluginName) {\n try {\n switch (type) {\n case \"element-attr\":\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 [\n \"attr-value\",\n {\n requiresFor: true,\n associateWith: \"a markup attribute\",\n validator: validateCommonName,\n },\n ],\n [\"element\", { requiresFor: false, validator: validateDOMName }],\n [\n \"element-attr\",\n {\n requiresFor: false,\n validator: validateDOMName,\n },\n ],\n [\n \"element-state\",\n {\n requiresFor: true,\n associateWith: \"a markup 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\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\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\n:is(aside,div).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\n:is(aside,div).example {\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}\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\";\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 const id = addId(example, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${id}`;\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 addId(div, \"example\", title || String(number));\n const selfLink = div.querySelector(\"a.self-link\");\n selfLink.href = `#${div.id}`;\n example.replaceWith(div);\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.issue.closed span.issue-number::after {\n content: \" (Closed)\";\n font-size: smaller;\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\";\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 {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 issueList.append(createIssueSummaryEntry(l10n.issue, report, div.id));\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 });\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}${\n report.number ? ` ${report.number}` : \"\"\n }`;\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 `<h1>${l10n.issue_summary}</h1>`\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/**\n * Based on https://stackoverflow.com/a/3943023\n * See https://www.w3.org/WAI/WCAG21/Techniques/general/G18.html#tests\n * @param {string} bg background color as a hex value without '#'\n */\nfunction textColorFromBgColor(bg) {\n const [r, g, b] = [bg.slice(0, 2), bg.slice(2, 4), bg.slice(4, 6)];\n const [R, G, B] = [r, g, b]\n .map(c => parseInt(c, 16) / 255)\n .map(c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));\n const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return L > 0.179 ? \"#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 allEls = document.querySelectorAll(query);\n\n const issuesAndNotes = Array.from(allEls).filter(itm => {\n // Removes any elements that are not HTML Elements (e.g., SVG nodes)\n return itm instanceof HTMLElement;\n });\n\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`<h1>Best Practices Summary</h1>`);\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 getPreviousSections,\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`<h1>${l10n.list_of_figures}</h1>`,\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(\n html`<a class=\"self-link\" href=\"#${figure.id}\"\n >${l10n.fig}<bdi class=\"figno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\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 // Don't add width and height to SVGs\n // https://github.com/w3c/respec/issues/3435\n if (img.src.startsWith(\"data:image/svg+xml;\")) return;\n if (img.src.endsWith(\".svg\")) return;\n\n if (img.naturalHeight === 0 || img.naturalWidth === 0) return;\n\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","// @ts-check\n// Module core/tables\n// Handles tables in the document.\n// Generates a List of Tables wherever there is a #list-of-tables element.\n\nimport {\n addId,\n getIntlData,\n getPreviousSections,\n renameElement,\n wrapInner,\n} from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/tables\";\n\nconst localizationStrings = {\n en: {\n list_of_tables: \"List of Tables\",\n table: \"Table \",\n },\n};\n\nconst l10n = getIntlData(localizationStrings);\n\nexport function run() {\n const listOfTables = collectTables();\n const listOfTablesElement = document.querySelector(\"section#list-of-tables\");\n if (listOfTables.length && listOfTablesElement) {\n decorateListOfTables(listOfTablesElement);\n listOfTablesElement.append(\n html`<h1>${l10n.list_of_tables}</h1>`,\n html`<ul class=\"list-of-tables\">\n ${listOfTables}\n </ul>`\n );\n }\n}\n\n/**\n * process all tables\n */\nfunction collectTables() {\n /** @type {HTMLLIElement[]} */\n const listOfTables = [];\n /** @type {NodeListOf<HTMLTableElement>} */\n const tables = document.querySelectorAll(\"table.numbered\");\n [...tables]\n // there is a separate linter rule to catch numbered tables without captions\n .filter(table => !!table.querySelector(\"caption\"))\n .forEach((table, i) => {\n const caption = table.querySelector(\"caption\");\n decorateTable(table, caption, i);\n listOfTables.push(getListOfTablesListItem(table.id, caption));\n });\n return listOfTables;\n}\n\n/**\n * @param {HTMLTableElement} table\n * @param {HTMLTableCaptionElement} caption\n * @param {number} i\n */\nfunction decorateTable(table, caption, i) {\n const title = caption.textContent;\n addId(table, \"table\", title);\n // set proper caption title\n wrapInner(caption, html`<span class=\"table-title\"></span>`);\n caption.prepend(\n html`<a class=\"self-link\" href=\"#${table.id}\"\n >${l10n.table}<bdi class=\"tableno\">${i + 1}</bdi></a\n >`,\n \" \"\n );\n}\n\n/**\n * @param {string} tableId\n * @param {HTMLTableCaptionElement} caption\n * @return {HTMLLIElement}\n */\nfunction getListOfTablesListItem(tableId, caption) {\n const listOfTablesCaption = caption.cloneNode(true);\n for (const anchor of listOfTablesCaption.querySelectorAll(\"a\")) {\n renameElement(anchor, \"span\", { copyAttributes: false });\n }\n return html`<li>\n <a class=\"tocxref\" href=\"${`#${tableId}`}\"\n >${listOfTablesCaption.childNodes}</a\n >\n </li>`;\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} listOfTablesElement\n */\nfunction decorateListOfTables(listOfTablesElement) {\n if (\n listOfTablesElement.matches(\".appendix, .introductory\") ||\n listOfTablesElement.closest(\"section\")\n ) {\n return;\n }\n\n const previousSections = getPreviousSections(listOfTablesElement);\n if (previousSections.every(sec => sec.classList.contains(\"introductory\"))) {\n listOfTablesElement.classList.add(\"introductory\");\n } else if (previousSections.some(sec => sec.classList.contains(\"appendix\"))) {\n listOfTablesElement.classList.add(\"appendix\");\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:is(:focus:hover,.selected:focus) {\n border-color: #51a7e8;\n}\n\n.respec-button-copy-paste:is(:hover,:active,.zeroclipboard-is-hover,.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:is(:active,.selected,.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:is(:disabled,:disabled:hover,.disabled,.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\") {\n return wrapped;\n }\n let type = \"_IDL_\";\n let cite = null;\n let lt;\n switch (unescaped) {\n case \"object\":\n type = \"interface\";\n cite = \"WEBIDL\";\n break;\n }\n return html`<a\n data-link-type=\"${type === \"_IDL_\" ? \"idl\" : type}\"\n data-xref-type=\"${type}\"\n data-cite=\"${cite}\"\n 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// IDL types that never need a data-dfn-for\nconst topLevelIdlTypes = [\n \"interface\",\n \"interface mixin\",\n \"dictionary\",\n \"namespace\",\n \"enum\",\n \"typedef\",\n \"callback\",\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 idlType = elem.dataset.dfnType;\n\n const parent = elem.parentElement.closest(\"[data-idl][data-title]\");\n if (parent && !topLevelIdlTypes.includes(idlType)) {\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 if (elem.dataset.matchedText) {\n elem.textContent = elem.dataset.matchedText;\n }\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 if (!anchor.dataset?.linkType && anchor.dataset?.xrefType) {\n possibleExternalLinks.push(anchor);\n continue;\n }\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 { dfnType = \"dfn\" } = dfn.dataset;\n const dfnFors = dfn.dataset.dfnFor?.split(\",\").map(s => s.trim()) ?? [\"\"];\n for (const dfnFor of dfnFors) {\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 =\n (!dfnFor && !oldDfn.dataset.dfnFor) ||\n oldDfn.dataset.dfnFor\n ?.split(\",\")\n .map(s => s.trim())\n .includes(dfnFor);\n if (oldIsDfn && newIsDfn && isSameDfnType && isSameDfnFor) {\n duplicates.push(dfn);\n continue;\n }\n }\n if (!result.has(dfnFor)) {\n result.set(dfnFor, new Map());\n }\n result.get(dfnFor).set(dfnType, dfn);\n // We register non-dfn terms under the generic \"idl\" type as well\n // for backwards-compatibility\n if (\"idl\" in dfn.dataset || dfnType !== \"dfn\") {\n result.get(dfnFor).set(\"idl\", dfn);\n }\n addId(dfn, \"dfn\", title);\n }\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 return dfnsByType.get(linkType) || 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 (\n linkFor &&\n !titleToDfns.get(linkFor) &&\n dfnFor &&\n !dfnFor\n .split(\",\")\n .map(s => s.trim())\n .includes(linkFor)\n ) {\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} 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\n/** @type {{ term: string; spec: string; element: HTMLElement }[]} */\nexport const informativeRefsInNormative = [];\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 // This is used by the informative-dfn linter\n informativeRefsInNormative.push({ term, spec: cite, element: 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`[See search matches for \"${originalTerm}\"](${howToCiteURL}) or ${\"[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","/*\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 // See below...\n sub(\"toc\", () => {}, { once: true });\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, h1\")) {\n index.prepend(html`<h1>${l10n.heading}</h1>`);\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 =>\n !editors.includes(user.name || user.login) &&\n !user.login.includes(\"[bot]\")\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/**\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","// @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 getIntlData,\n parents,\n renameElement,\n showError,\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 (\"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, getIntlData, norm } from \"./utils.js\";\nimport { html } from \"./import-maps.js\";\n\nconst localizationStrings = {\n en: {\n /**\n *\n * @param {\"Appendix\" | \"Section\"} sectionType\n */\n permalinkLabel(sectionType, sectionNumber) {\n let label = `Permalink for${\n !sectionNumber ? \" this\" : \"\"\n } ${sectionType}`;\n if (sectionNumber) {\n label += ` ${norm(sectionNumber.textContent)}`;\n }\n return label;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n /** @type {NodeListOf<HTMLElement>} */\n const headings = document.querySelectorAll(\n `section:not(.head,#abstract,#sotd) 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 const label = l10n.permalinkLabel(\n h.closest(\".appendix\") ? \"Appendix\" : \"Section\",\n h.querySelector(\":scope > bdi.secno\")\n );\n const wrapper = html`<div class=\"header-wrapper\"></div>`;\n h.replaceWith(wrapper);\n const selfLink = html`<a\n href=\"#${id}\"\n class=\"self-link\"\n aria-label=\"${label}\"\n ></a>`;\n wrapper.append(h, selfLink);\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\n.caniuse-stats {\n display: flex;\n column-gap: 2em;\n}\n\n.caniuse-group {\n display: flex;\n flex: 1;\n flex-direction: column;\n justify-content: flex-end;\n flex-basis: auto;\n}\n\n.caniuse-browsers {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n flex-wrap: wrap;\n margin-top: .2em;\n column-gap: .4em;\n border-bottom: 1px solid #ccc;\n row-gap: .4em;\n padding-bottom: .4cm;\n}\n\n.caniuse-type {\n align-self: center;\n border-top: none;\n text-transform: capitalize;\n font-size: .8em;\n margin-top: -.8em;\n font-weight: bold;\n}\n\n.caniuse-type span {\n background-color: white;\n padding: 0 0.4em;\n}\n\n/* a browser version */\n.caniuse-cell {\n align-items: center;\n border-radius: 1cm;\n color: #fff;\n display: flex;\n font-size: 90%;\n min-width: 1.5cm;\n padding: .3rem;\n justify-content: space-evenly;\n --supported: #2a8436dd;\n --no-support: #c44230dd;\n --no-support-alt: #b43b2bdd;\n --partial: #807301dd;\n --partial-alt: #746c00dd;\n --unknown: #757575;\n\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\nimg.caniuse-browser {\n filter: drop-shadow(0px 0px .1cm #666666);\n}\n\n.caniuse-cell span.browser-version {\n margin-left: 0.4em;\n text-shadow: 0 0 0.1em #fff;\n font-weight: 100;\n font-size: .9em;\n}\n\n.caniuse-stats a[href] {\n white-space: nowrap;\n align-self: flex-end;\n}\n\n/* supports */\n.caniuse-cell.y {\n background: var(--supported);\n}\n\n/* no support, disabled by default */\n.caniuse-cell:is(.n,.d) {\n --caniuse-angle: 45deg;\n --caniuse-bg: var(--no-support);\n --caniuse-bg-alt: var(--no-support-alt);\n}\n\n.caniuse-cell.u {\n background: var(--unknown);\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:is(.a,.x,.p) {\n --caniuse-angle: 90deg;\n --caniuse-bg: var(--partial);\n --caniuse-bg-alt: var(--partial-alt);\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:is(.a,.d,.p,.x,.u)::before {\n content: \"⚠️\";\n padding: 0.5em;\n }\n}\n`;\n","// @ts-check\n/**\n * Module: \"core/caniuse\"\n * Adds a caniuse support table for a \"feature\" #1238\n * Usage options: https://github.com/w3c/respec/wiki/caniuse\n */\nimport { 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\nexport const BROWSERS = new Map([\n [\"and_chr\", { name: \"Android Chrome\", path: \"chrome\", type: \"mobile\" }],\n [\"and_ff\", { name: \"Android Firefox\", path: \"firefox\", type: \"mobile\" }],\n [\"and_uc\", { name: \"Android UC\", path: \"uc\", type: \"mobile\" }],\n [\"chrome\", { name: \"Chrome\", type: \"desktop\" }],\n [\"edge\", { name: \"Edge\", type: \"desktop\" }],\n [\"firefox\", { name: \"Firefox\", type: \"desktop\" }],\n [\"ios_saf\", { name: \"iOS Safari\", path: \"safari-ios\", type: \"mobile\" }],\n [\"op_mob\", { name: \"Opera Mobile\", path: \"opera\", type: \"mobile\" }],\n [\"opera\", { name: \"Opera\", type: \"desktop\" }],\n [\"safari\", { name: \"Safari\", type: \"desktop\" }],\n [\n \"samsung\",\n { name: \"Samsung Internet\", path: \"samsung-internet\", type: \"mobile\" },\n ],\n]);\n\nconst statToText = new Map([\n [\"a\", \"almost supported (aka Partial support)\"],\n [\"d\", \"disabled by default\"],\n [\"n\", \"no support, or disabled by default\"],\n [\"p\", \"no support, but has Polyfill\"],\n [\"u\", \"unknown support\"],\n [\"x\", \"requires prefix to work\"],\n [\"y\", \"supported by default\"],\n]);\n\nexport function prepare(conf) {\n if (!conf.caniuse) {\n return; // nothing to do.\n }\n normalizeCaniuseConf(conf);\n validateBrowsers(conf);\n const options = conf.caniuse;\n if (!options.feature) {\n return; // no feature to show\n }\n\n document.head.appendChild(html`<style\n id=\"caniuse-stylesheet\"\n class=\"${options.removeOnSave ? \"removeOnSave\" : \"\"}\"\n >\n ${css}\n </style>`);\n}\n/**\n * @param {string} browser\n * @returns\n */\nfunction getLogoSrc(browser) {\n const path = BROWSERS.get(browser).path ?? browser;\n return `https://cdn.w3.org/assets/logos/browser-logos/${path}/${path}.svg`;\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 const headDlElem = document.querySelector(\".head dl\");\n const contentPromise = fetchStats(conf.caniuse)\n .then(json => processJson(json, options))\n .catch(err => handleError(err, options, featureURL));\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 pub(\"amend-user-config\", { caniuse: options.feature });\n if (options.removeOnSave) {\n // Will remove the browser support cells.\n headDlElem\n .querySelectorAll(\".caniuse-browser\")\n .forEach(elem => elem.classList.add(\"removeOnSave\"));\n sub(\"beforesave\", outputDoc => {\n html.bind(outputDoc.querySelector(\".caniuse-stats\"))`\n <a href=\"${featureURL}\">caniuse.com</a>`;\n });\n }\n}\n\nfunction handleError(err, options, featureURL) {\n const msg = `Failed to retrieve feature \"${options.feature}\".`;\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/**\n * returns normalized `conf.caniuse` configuration\n * @param {Object} conf configuration settings\n */\nfunction normalizeCaniuseConf(conf) {\n const defaultBrowsers = new Set(BROWSERS.keys());\n defaultBrowsers.delete(\"op_mob\");\n defaultBrowsers.delete(\"opera\");\n const DEFAULTS = { removeOnSave: true, browsers: [...defaultBrowsers] };\n if (typeof conf.caniuse === \"string\") {\n conf.caniuse = { feature: conf.caniuse, ...DEFAULTS };\n return;\n }\n conf.caniuse = { ...DEFAULTS, ...conf.caniuse };\n}\n\nfunction validateBrowsers({ caniuse }) {\n const { browsers } = caniuse;\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\nasync function processJson(json, { feature }) {\n /** @type {Array} */\n const results = json.result;\n const groups = new Map([\n [\"desktop\", []],\n [\"mobile\", []],\n ]);\n const toBrowserCell = browserCellRenderer(feature);\n results.reduce(toBrowserCell, groups);\n const out = [...groups]\n .filter(([, arr]) => arr.length)\n .map(\n ([key, arr]) =>\n html`<div class=\"caniuse-group\">\n <div class=\"caniuse-browsers\">${arr}</div>\n <div class=\"caniuse-type\"><span>${key}</div>\n </div>`\n );\n out.push(\n html`<a class=\"caniuse-cell\" href=\"https://caniuse.com/${feature}\"\n >More info</a\n >`\n );\n return out;\n}\n\nfunction browserCellRenderer(feature) {\n return (groups, { browser: browserId, version, caniuse }) => {\n const { name, type } = BROWSERS.get(browserId);\n const versionLong = version ? ` version ${version}` : \"\";\n const browserName = `${name}${versionLong}`;\n const supportLevel = statToText.get(caniuse);\n const ariaLabel = `${feature} is ${supportLevel} since ${browserName} on ${type}.`;\n const cssClass = `caniuse-cell ${caniuse}`;\n const title = capitalize(`${supportLevel} since ${browserName}.`);\n const textVersion = version ? version : \"—\";\n const src = getLogoSrc(browserId);\n const result = html`\n <div class=\"${cssClass}\" title=\"${title}\" aria-label=\"${ariaLabel}\">\n <img\n class=\"caniuse-browser\"\n width=\"20\"\n height=\"20\"\n src=\"${src}\"\n alt=\"${name} logo\"\n /><span class=\"browser-version\">${textVersion}</span>\n </div>\n `;\n groups.get(type).push(result);\n return groups;\n };\n}\n\n/**\n * @typedef {Record<string, [string, string[]][]>} ApiResponse\n * @throws {Error} on failure\n */\nasync function fetchStats(options) {\n const { feature, browsers, apiURL } = options;\n const url = new URL(apiURL || `./${feature}`, API_URL);\n browsers.forEach(browser => url.searchParams.append(\"browsers\", browser));\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 return response.json();\n}\n\nfunction capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\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: 3rem;\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://cdn.w3.org/assets/logos/browser-logos/chrome/chrome.svg);\n}\n\n.mdn .edge::before,\n.mdn .edge_mobile::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/edge/edge.svg);\n}\n\n.mdn .firefox::before,\n.mdn .firefox_android::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/firefox/firefox.svg);\n}\n\n.mdn .opera::before,\n.mdn .opera_android::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/opera/opera.svg);\n}\n\n.mdn .safari::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/safari/safari.svg);\n}\n\n.mdn .safari_ios::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/safari-ios/safari-ios.svg);\n}\n\n.mdn .samsunginternet_android::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/samsung-internet/samsung-internet.svg);\n}\n\n.mdn .webview_android::before {\n background-image: url(https://cdn.w3.org/assets/logos/browser-logos/android-webview/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 // 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 { concatDate, 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 ext: \"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 ext: \"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 ext: \"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\n/**\n * @param {typeof downloadLinks[0]} details\n */\nfunction toDownloadLink(details, conf) {\n const { id, href, ext, title, type } = details;\n const date = concatDate(conf.publishDate || new Date());\n const filename = [conf.specStatus, conf.shortName || \"spec\", date].join(\"-\");\n return html`<a\n href=\"${href}\"\n id=\"${id}\"\n download=\"${filename}.${ext}\"\n type=\"${type}\"\n class=\"respec-save-button\"\n onclick=${() => ui.closeModal()}\n >${title}</a\n >`;\n}\n\nexport function run(conf) {\n const saveDialog = {\n async show(button) {\n await document.respec.ready;\n const div = html`<div class=\"respec-save-buttons\">\n ${downloadLinks.map(details => toDownloadLink(details, conf))}\n </div>`;\n ui.freshModal(l10n.save_snapshot, div, button);\n },\n };\n\n const supportsDownload = \"download\" in HTMLAnchorElement.prototype;\n let button;\n if (supportsDownload) {\n button = ui.addCommand(l10n.save_snapshot, show, \"Ctrl+Shift+Alt+S\", \"💾\");\n }\n\n function show() {\n if (!supportsDownload) return;\n saveDialog.show(button);\n }\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 { getIntlData } from \"../core/utils.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 l10n = getIntlData(localizationStrings);\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 { W3CNotes, recTrackStatus, registryTrackStatus } from \"./headers.js\";\nimport { html } from \"../core/import-maps.js\";\nimport { resolveRef } from \"../core/biblio.js\";\nimport { showWarning } from \"../core/utils.js\";\nexport const name = \"w3c/seo\";\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};\n\nexport const requiresCanonicalLink = new Set([\n ...W3CNotes,\n ...recTrackStatus,\n ...registryTrackStatus,\n \"BG-FINAL\",\n \"CG-FINAL\",\n \"CRY\",\n \"DRY\",\n \"draft-finding\",\n \"finding\",\n]);\n\nexport async function run(conf) {\n // Don't include a canonical URL for documents that haven't been published.\n if (\n (!conf.canonicalURI && !requiresCanonicalLink.has(conf.specStatus)) ||\n !conf.shortName\n ) {\n return;\n }\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 (conf.latestVersion) {\n conf.canonicalURI = conf.latestVersion;\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.latestVersion && !conf.canonicalURI) {\n conf.canonicalURI = conf.latestVersion;\n }\n }\n if (conf.canonicalURI) {\n const linkElem = html`<link rel=\"canonical\" href=\"${conf.canonicalURI}\" />`;\n document.head.appendChild(linkElem);\n }\n\n if (conf.doJsonLd) {\n await addJSONLDInfo(conf, document);\n }\n}\n\nasync function addJSONLDInfo(conf, doc) {\n const rdfStatus = status2rdf[conf.specStatus];\n // Content for JSON\n const type = [\"TechArticle\"];\n if (rdfStatus) type.push(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","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\";\nimport { html } from \"./import-maps.js\";\n\nexport const name = \"core/algorithms\";\n\nexport function run() {\n const elements = Array.from(\n /** @type {NodeListOf<HTMLLIElement>} */ (\n document.querySelectorAll(\"ol.algorithm li\")\n )\n ).filter(li => li.textContent.trim().startsWith(\"Assert: \"));\n if (!elements.length) {\n return;\n }\n\n for (const li of elements) {\n li.classList.add(\"assert\");\n\n // Link \"Assert\" to https://infra.spec.whatwg.org/#assert\n const textNode = li.firstChild;\n if (\n textNode instanceof Text &&\n textNode.textContent.startsWith(\"Assert: \")\n ) {\n textNode.textContent = textNode.textContent.replace(\"Assert: \", \"\");\n li.prepend(\n html`<a href=\"https://infra.spec.whatwg.org/#assert\">Assert</a>`,\n \": \"\n );\n }\n }\n\n const style = document.createElement(\"style\");\n style.textContent = css;\n document.head.appendChild(style);\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 \"table\": {\n processTable(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 // get figure label and remove the fig-number class\n const children = [\n ...makeSafeCopy(figcaption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n node.classList?.remove(\"figno\");\n return node;\n });\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 processTable(matchingTable, id, a) {\n if (!matchingTable.classList.contains(\"numbered\")) {\n return;\n }\n const caption = matchingTable.querySelector(\"caption\");\n if (!caption) {\n a.textContent = a.getAttribute(\"href\");\n const msg = `Found matching table \"${id}\", but table is lacking a \\`<caption>\\`.`;\n const title = \"Missing caption in referenced table.\";\n showError(msg, name, { title, elements: [a] });\n return;\n }\n\n // get table label and remove the fig-number class\n const children = [\n ...makeSafeCopy(caption.querySelector(\".self-link\")).childNodes,\n ].map(node => {\n // @ts-ignore\n // @ts-ignore\n node.classList?.remove(\"tableno\");\n return node;\n });\n a.append(...children);\n a.classList.add(\"table-ref\");\n const tableTitle = caption.querySelector(\".table-title\");\n if (!a.hasAttribute(\"title\") && tableTitle) {\n a.title = norm(tableTitle.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","/* 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-family: \"Helvetica Neue\", sans-serif;\n font-size: small;\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","// @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","import { docLink, showError } from \"./utils.js\";\nimport { sub } from \"./pubsubhub.js\";\n\nexport const name = \"core/before-save\";\n\nexport function run(conf) {\n if (!conf.beforeSave) return;\n\n if (\n !Array.isArray(conf.beforeSave) ||\n conf.beforeSave.some(\n el => typeof el !== \"function\" || el.constructor.name === \"AsyncFunction\"\n )\n ) {\n const msg = docLink`${\"[beforeSave]\"} configuration option must be an array of synchronous JS functions.`;\n showError(msg, name);\n return;\n }\n\n sub(\n \"beforesave\",\n documentElement => {\n performTransformations(conf.beforeSave, documentElement.ownerDocument);\n },\n { once: true }\n );\n}\n/**\n * @param {Array<Function>} transforms\n * @param {Document}\n */\nfunction performTransformations(transforms, doc) {\n let pos = 0;\n for (const fn of transforms) {\n try {\n fn(doc);\n } catch (err) {\n const nameOrPosition = `\\`${fn.name}\\`` || `at position ${pos}`;\n const msg = docLink`Function ${nameOrPosition}\\` threw an error during processing of ${\"[beforeSave]\"}.`;\n const hint = \"See developer console.\";\n showError(msg, name, { hint });\n console.error(err);\n } finally {\n pos++;\n }\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,#w3c-state)\");\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-captionless-tables\".\n *\n * Checks that there are no tables in the document which don't start\n * with a caption element.\n *\n * As some tables may not contain tabular data, this only applies to\n * tables marked with class=\"numbered\".\n */\nimport { getIntlData, showWarning } from \"../utils.js\";\n\nconst ruleName = \"no-captionless-tables\";\nexport const name = \"core/linter-rules/no-captionless-tables\";\n\nconst localizationStrings = {\n en: {\n msg: \"All tables marked with class='numbered' must start with a caption element.\",\n hint: \"Add a `caption` to the offending table.\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const tables = document.querySelectorAll(\"table.numbered\");\n const offendingElements = [...tables].filter(\n table => !(table.firstElementChild instanceof HTMLTableCaptionElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\n });\n}\n","// @ts-check\n/**\n * Linter rule \"no-unused-dfns\".\n *\n * Complains if an internal/un-exported definitions is not linked to.\n */\nimport {\n docLink,\n getIntlData,\n norm,\n showError,\n showWarning,\n} from \"../utils.js\";\n\nconst ruleName = \"no-unused-dfns\";\nexport const name = \"core/linter-rules/no-unused-dfns\";\n\nconst localizationStrings = {\n en: {\n msg(text) {\n return `Found definition for \"${text}\", but nothing links to it. This is usually a spec bug!`;\n },\n get hint() {\n return docLink`\n You can do one of the following...\n\n * Add a \\`class=\"lint-ignore\"\\` attribute the definition.\n * Either remove the definition or change \\`<dfn>\\` to another type of HTML element.\n * If you meant to ${\"[export|#data-export]\"} the definition, add \\`class=\"export\"\\` to the definition.\n\n To silence this warning entirely, set \\`lint: { \"no-unused-dfns\": false }\\` in your \\`respecConfig\\`.`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) return;\n const logger = conf.lint[ruleName] === \"error\" ? showError : showWarning;\n /** @type NodeListOf<HTMLElement> */\n const definitions = document.querySelectorAll(\n \"dfn:not(.lint-ignore, [data-export], [data-cite])\"\n );\n\n const elements = [...definitions].filter(isDfnUnused);\n\n // These are usually bad spec bugs, so best shown individually.\n elements.forEach(element => {\n const elements = [element];\n const text = norm(element.textContent);\n logger(l10n.msg(text), name, { elements, hint: l10n.hint });\n });\n}\n\nfunction isDfnUnused(dfn) {\n // Not in the index\n // and not the \"self-link\" box\n return !document.querySelector(\n `a[href=\"#${dfn.id}\"]:not(.index-term, .self-link)`\n );\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\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n /** @type {NodeListOf<HTMLElement>} */\n const sections = document.querySelectorAll(\n \"section:not(.head,#abstract,#sotd)\"\n );\n const offendingElements = [...sections].filter(\n ({ firstElementChild: e }) =>\n !e ||\n // no header wrapper and the first child is not a heading\n !(e.matches(\".header-wrapper\") || e instanceof HTMLHeadingElement)\n );\n\n if (!offendingElements.length) return;\n\n showWarning(l10n.msg, name, {\n hint: l10n.hint,\n elements: offendingElements,\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 * The W3C Process requires separate Privacy Considerations and Security\n * Considerations sections. This linter checks for the presence of these\n * sections, and reports an error if they are not present.\n */\n\nimport {\n InsensitiveStringSet,\n docLink,\n getIntlData,\n getIntlDataForKey,\n norm,\n showError,\n showWarning,\n} from \"../../core/utils.js\";\nimport { W3CNotes, recTrackStatus } from \"../headers.js\";\n\nconst ruleName = \"required-sections\";\nexport const name = \"w3c/linter-rules/required-sections\";\n\nconst localizationStrings = {\n en: {\n msg(sectionTitle) {\n return `W3C Recommendation track documents require a separate \"${sectionTitle}\" section.`;\n },\n hint(sectionTitle) {\n return docLink`Add a \\`<section>\\` with a \"${sectionTitle}\" header. See the [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).\n If the document is not intended for the W3C Recommendation track, set ${\"[noRecTrack]\"} to \\`true\\`\n or turn off the ${`[${ruleName}]`} linter rule.`;\n },\n privacy_considerations: \"Privacy Considerations\",\n security_considerations: \"Security Considerations\",\n },\n es: {\n msg(sectionTitle) {\n return `Documentos que van a ser \"W3C Recommendation\" requieren una sección \"${sectionTitle}\" separada.`;\n },\n hint(sectionTitle) {\n return docLink`Agrega una \\`<section>\\` con título \"${sectionTitle}\". Ver los [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).\n Si el documento no está destinado a ser un W3C Recommendation, puedes poner ${\"[noRecTrack]\"} a \\`true\\`\n o apaga la regla de linter ${`[${ruleName}]`}.`;\n },\n privacy_considerations: \"Consideraciones de privacidad\",\n security_considerations: \"Consideraciones de Seguridad\",\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport const requiresSomeSectionStatus = new Set([...recTrackStatus]);\nrequiresSomeSectionStatus.delete(\"DISC\"); // \"Discontinued Draft\"\n// W3C notes do not require privacy or security considerations sections.\nW3CNotes.forEach(note => requiresSomeSectionStatus.delete(note));\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) {\n return;\n }\n\n // We can't check for headers unless we also have a translation\n if (!getIntlDataForKey(localizationStrings, \"privacy_considerations\")) {\n // We can't check for headers unless we also have a translation\n const msg = `Cannot check for required sections as translations are not available.`;\n const hint = `File an issue to add translations or use a supported language.`;\n showWarning(msg, name, { hint });\n return;\n }\n\n if (conf.noRecTrack || !requiresSomeSectionStatus.has(conf.specStatus)) {\n return;\n }\n\n const logger = conf.lint[ruleName] === \"error\" ? showError : showWarning;\n\n const missingRequiredSections = new InsensitiveStringSet([\n l10n.privacy_considerations,\n l10n.security_considerations,\n ]);\n\n /** @type {NodeListOf<HTMLElement>} */\n const headers = document.querySelectorAll(\"h2, h3, h4, h5, h6\");\n for (const header of headers) {\n const clone = header.cloneNode(true);\n // section number and self-link anchor\n clone.querySelectorAll(\"bdi\")?.forEach(elem => elem.remove());\n const text = norm(clone.textContent);\n if (missingRequiredSections.has(text)) {\n missingRequiredSections.delete(text);\n // Check if we find them all...\n if (missingRequiredSections.size === 0) {\n return; // All present, early return!\n }\n }\n }\n\n // Show the ones we didn't find individually\n for (const title of missingRequiredSections) {\n logger(l10n.msg(title), name, {\n hint: l10n.hint(title),\n });\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\") && conf[key]) || 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@4/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","// @ts-check\n/**\n * Linter rule \"informative-dfn\".\n *\n * Complains if an informative definition is referenced from a normative section.\n */\nimport { docLink, getIntlData, showError, showWarning } from \"../utils.js\";\n\nimport { informativeRefsInNormative } from \"../xref.js\";\n\nconst ruleName = \"informative-dfn\";\nexport const name = \"core/linter-rules/informative-dfn\";\n\nconst localizationStrings = {\n en: {\n msg(term, cite) {\n return `Normative reference to \"${term}\" found but term is defined \"informatively\" in \"${cite}\".`;\n },\n get hint() {\n return docLink`\n You can do one of the following...\n\n * Get the source definition to be made normative\n * Add a \\`class=\"lint-ignore\"\\` attribute to the link.\n * Use a local normative proxy for the definition à la \\`<dfn data-cite=\"spec\">term</dfn>\\`\n\n To silence this warning entirely, set \\`lint: { \"${ruleName}\": false }\\` in your \\`respecConfig\\`.`;\n },\n },\n};\nconst l10n = getIntlData(localizationStrings);\n\nexport function run(conf) {\n if (!conf.lint?.[ruleName]) return;\n const logger = conf.lint[ruleName] === \"error\" ? showError : showWarning;\n\n informativeRefsInNormative.forEach(({ term, spec, element }) => {\n if (element.classList.contains(\"lint-ignore\")) return;\n logger(l10n.msg(term, spec), name, {\n title: \"Normative reference to non-normative term.\",\n elements: [element],\n hint: l10n.hint,\n });\n });\n}\n"],"names":["inAmd","window","require","deps","callback","modules","map","dep","Error","Promise","all","then","results","expose","name","object","subscriptions","EventTarget","pub","topic","detail","dispatchEvent","CustomEvent","parent","self","args","String","JSON","stringify","stack","postMessage","location","origin","sub","cb","options","once","addEventListener","e","removeList","html","document","documentElement","hasAttribute","lang","dir","l10n","config","en","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","get","target","prop","receiver","IDBTransaction","objectStoreNames","undefined","objectStore","wrap","set","value","has","wrapFunction","func","IDBDatabase","prototype","transaction","IDBCursor","advance","continue","continuePrimaryKey","includes","apply","unwrap","this","storeNames","tx","call","sort","transformCachableValue","done","resolve","reject","unlisten","removeEventListener","complete","error","DOMException","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","event","oldVersion","version","upgrade","blocking","terminated","open","openPromise","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","unshift","n","base","appendIfExist","contextAsText","bareMessage","sourceName","input","tokens","syntaxError","validationError","token","Base","constructor","Object","defineProperties","writable","toJSON","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","static","tokeniser","consumeKind","unescape","write","w","ts","separator","Eof","tokenName","list","parser","listName","extAttrValueSyntax","renamedLegacies","extAttrListItems","syntax","toks","ExtendedAttributeParameters","assign","consume","ret","autoParenter","asterisk","secondaryName","rhsIsList","argument_list","close","rhsType","reference_token","p","identifier","SimpleExtendedAttribute","params","parse","defineProperty","rhs","arguments","validate","extAttr","arg","extendedAttribute","extendedAttributeReference","ExtendedAttributes","push","unconsume","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","autofixOptionalDictionaryDefaultValue","indexOf","a","isLastRequiredArgument","getFirstToken","name_token","data","Tokeniser","Operation","special","regular","termination","argument","body","definition","nameless","Attribute","noInherit","readonly","startsWith","allowDangler","first","items","item","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","probeKind","candidates","consumeIdentifier","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","autofixConstructor","factoryFunctions","named","constructors","i","opNames","ops","getOperations","statics","Set","op","nonstatics","groupOperationNames","partials","mixins","mixinMap","ext","additions","checkAdditions","forEach","add","existings","addition","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","productions","production","res","eof","concrete","definitions","noop","templates","Writer","raw","wrapper","bind","id","getMixinMap","include","validateIterable","ast","duplicates","groupDefinitions","dup","checkDuplicatedNames","flat","it","HTTPTokenCodePoints","HTTPWhiteSpace","HTTPQuotedString","storeParam","paramName","paramValue","toLowerCase","getDefaults","baseUrl","breaks","extensions","gfm","headerIds","headerPrefix","highlight","hooks","langPrefix","mangle","pedantic","renderer","sanitize","sanitizer","silent","smartypants","tokenizer","walkTokens","xhtml","defaults","escapeTest","escapeReplace","RegExp","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape","encode","unescapeTest","_","fromCharCode","parseInt","substring","caret","edit","regex","opt","val","getRegex","nonWordAndColonTest","originIndependentUrl","cleanUrl","href","prot","decodeURIComponent","baseUrls","justDomain","rtrim","relativeBase","protocol","domain","resolveUrl","encodeURI","noopTest","splitCells","tableRow","cells","offset","escaped","curr","invert","l","suffLen","currChar","repeatString","pattern","outputLink","cap","link","lexer","title","state","inLink","inlineTokens","Tokenizer","space","src","rules","block","newline","code","codeBlockStyle","fences","matchIndentToCode","indentToCode","matchIndentInNode","indentInNode","indentCodeCompensation","inline","_escapes","heading","trimmed","depth","hr","blockquote","top","blockTokens","istask","ischecked","indent","blankLine","endsWithBlankLine","nextLine","rawLine","itemContents","endEarly","bull","isordered","ordered","start","loose","itemRegex","trimLeft","search","nextBulletRegex","min","hrRegex","fencesBeginRegex","headingBeginRegex","task","checked","trimRight","spacers","hasMultipleLineBreaks","pre","tag","table","header","align","rows","j","k","row","lheading","paragraph","inRawBlock","trimmedUrl","rtrimSlash","lastParenIndex","b","findClosingBracket","linkLen","reflink","links","nolink","emStrong","maskedSrc","prevChar","lDelim","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","rDelimAst","rDelimUnd","codespan","hasNonSpaceChars","hasSpaceCharsOnBothEnds","br","del","autolink","url","prevCapZero","_backpedal","inlineText","_paragraph","_label","_title","bullet","listItemStart","_tag","_comment","normal","reflinkSearch","out","charCodeAt","random","toString","_punctuation","blockSkip","escapedEmSt","_scheme","_email","_attribute","_href","strong","middle","endAst","endUnd","em","_extended_email","Lexer","create","inlineQueue","lex","next","lastToken","cutSrc","lastParagraphClipped","leading","tabs","extTokenizer","startBlock","startIndex","Infinity","tempSrc","tempStart","getStartIndex","errMsg","console","keepPrevChar","keys","lastIndexOf","startInline","Renderer$1","infostring","quote","slugger","slug","listitem","checkbox","tablerow","content","tablecell","flags","image","TextRenderer","Slugger","seen","serialize","getNextSafeSlug","originalSlug","isDryRun","occurenceAccumulator","hasOwnProperty","dryrun","Parser","Renderer","textRenderer","parseInline","l2","l3","cell","itemBody","renderers","Hooks","preprocess","markdown","postprocess","parseMarkdown","origOpt","throwError","msg","onError","marked","warn","checkSanitizeDeprecation","err","pending","setTimeout","setOptions","newDefaults","use","childTokens","pack","prevRenderer","prevTokenizer","prevHook","passThroughHooks","lexInline","globalThis","global","module","pluralizeExports","exports","root","pluralize","commonjsGlobal","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","toUpperCase","substr","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","_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","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","defaultState","dispatch","component","setState","idb","_idb","_marked","MIMEType","TypeError","parserMode","inputArray","from","char","trimEnd","fromEntries","parseMimeType","parameters","essence","mimeType","size","paramStr","_pluralize","webidl2","_webidl2","reindent","indents","leastIndent","getElementsByTagName","dashes","ISODate","Intl","DateTimeFormat","timeZone","year","month","day","dateLang","docLang","W3CDate","nonNormativeSelector","createResourceHint","URL","baseURI","linkElem","rel","hint","corsMode","crossOrigin","as","dontRemove","classList","removeReSpec","doc","elem","joinFactory","formatter","ListFormat","mapper","elemCount","formatToParts","conjunction","disjunction","joinAnd","joinOr","xmlEscape","norm","getIntlData","localizationStrings","getIntlDataForKey","concatDate","date","sep","format","runTransforms","flist","funcArgs","methods","meth","showWarning","fetchAndCache","maxAge","Request","cachedResponse","caches","Date","headers","response","fetch","ok","clonedResponse","clone","customHeaders","Headers","expiryDate","now","toISOString","cacheResponse","Response","blob","put","htmlJoinComma","joined","htmlJoinAnd","addHashId","hash","imul","hashString","addId","pfx","txt","noLC","normalize","getElementById","nextId","getDfnTitles","titleSet","normText","dataset","child","localLt","renameElement","newName","copyAttributes","localName","newElement","append","replaceWith","refTypeFromContext","element","closestInformative","closest","isInformative","querySelector","illegal","wrapInner","outer","getPreviousSections","sections","previous","previousElementSibling","iteratePreviousElements","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","markAsOffending","details","showError","pluginName","toMDCode","codedJoinOr","quotes","addQuotes","codedJoinAnd","docLink","strings","endsWith","linkingText","mimeTypes","rsDocToDataURL","validTypes","encodeURIComponent","cloneDoc","head","insertions","metaViewport","metaCharset","respecVersion","metaGenerator","prepend","cleanup","XMLSerializer","serializeToString","el","outerHTML","prettify","doctype","ReSpec","_respecDonePromise","errors","warnings","rsError","ready","runAll","plugs","respec","initReSpecGlobal","respecConfig","userConfig","amendConfig","newValues","script","includeConfig","URLSearchParams","overrideEntries","codedKey","codedValue","decodedValue","overrideProps","overrideConfig","performance","mark","preProcess","promises","isFunction","runnables","isRunnableModule","plug","run","Plugin","prepare","executePreparePass","timerId","measure","executeRunPass","postProcess","afterEnd","css$p","gtEntity","ampEntity","infoString","isEscaped","language","metaData","parseInfoString","example","illegalExample","className","firstSpace","metaDataStr","headingWithIdRegex","markdownToHtml","potentialMarkdown","convertElement","processMDSections","conf","hasMDSections","isMDFormat","rsUI","newBody","trimStart","firstTwo","lastTwo","workaroundBlockLevelMarkdown","substituteWithTextNodes","ariaDecorate","ariaMap","styleElement","css","insertStyle","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","fragment","createContextualFragment","rsErrorToHTML","li","firstElementChild","lastElementChild","freshModal","createWarnButton","label","show","hide","enable","addCommand","handler","_keyShort","icon","menuItem","warning","owner","currentOwner","headingId","generateMarkdownLink","plugins","readyState","domReady","ev","locationHash","l10n$D","group","style$1","github$1","dataInclude","reindent$1","abstract","dataTransform","dataAbbr","inlines","conformance","examples","issuesNotes","bestPractices","figures","tables","webidl","biblio$1","linkToDfn","xref","dataCite","renderBiblio","dfnIndex","contrib","fixHeaders","webidlIndex","structure","informative","idHeaders","caniuse","mdnAnnotation","saveHtml","searchSpecref","searchXref","aboutRespec","seo$1","seo","webidlClipboard","dataTests","listSorter","highlightVars$1","dataType","algorithms","anchorExpander","dfnPanel","webMonetization","beforeSave","checkCharset","checkPunctuation","checkInternalSlots","localRefsExist","noCaptionlessTables","noUnusedDfns","noHeadinglessSections","noUnusedVars","requiredSections","wptTestsExist","noHttpProps","a11y","informativeDfn","ReSpec.run","hasLink","isLegacyFrag","getGroupDetails","shortname","wgId","wg","patentURI","wgPatentURI","patentPolicy","wgPatentPolicy","groupType","wgURI","status","groupDetails","groups","getMultipleGroupDetails","showLink","class","showLinkData","showLogo","logo","alt","height","width","until","es","ko","ja","zh","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","archives","author","authors","commit_history","edited_in_place","editor","editors","feedback","former_editor","former_editors","history","implementation_report","latest_editors_draft","latest_published_version","latest_recommendation","message_topic","more_details_about_this_doc","multiple_alternates","prev_editor_draft","prev_recommendation","prev_version","publication_history","test_suite","this_version","with_subject_line","your_topic_here","nl","getSpecSubTitleElem","specSubTitleElem","subtitle","headersTmpl","logos","specType","isCR","isCRY","longStatus","textStatus","prependW3C","specStatus","dashDate","publishDate","modificationDate","renderSpecTitle","localStorage","getItem","thisVersion","latestVersion","edDraftURI","historyURI","github","commitHistoryURL","testSuiteURI","implementationReportURI","prevED","showPreviousVersion","prevVersion","prevRecURI","isRec","formerEditors","wgPublicList","renderFeedback","errata","otherLinks","shortName","alternateFormats","multipleAlternates","alternatesHTML","existingCopyright","isUnofficial","licenseInfo","copyrightStart","publishYear","additionalCopyrightHolders","short","linkLicense","renderOfficialCopyright","renderCopyright","repoURL","issuesURL","newIssuesURL","pullsURL","fullName","mailToURL","subject","subjectPrefix","mailingListLink","subjectLine","emailSubject","archiveURL","archiveLink","cgbgHeadersTmpl","specTitleElem","specTitleElemClone","isCGFinal","sotd","status_at_publication","processLink","sotdTmpl","isPreview","renderPreview","additionalContent","renderIsUnofficial","isTagFinding","isNoTrack","isMO","renderIsNoTrack","isMemberSubmission","teamComment","getUTCFullYear","submissionCommentNumber","patentPolicyURL","noteForMemberSubmission","noteForSubmission","sotdAfterWGinfo","overrideStatus","changes","revisionTypes","pa","pc","ca","cc","track","status2track","wgHTML","linkToWorkingGroup","updateableRec","revisedRecEnd","reviewTarget","renderIsRec","statusExplanation","reviewPolicy","endorsement","updatePolicy","lsUpdatePolicy","pubMode","humanPREnd","humanCREnd","crEnd","prEnd","renderNotRec","isNote","isRegistry","multipleWGs","wgPatentHTML","producers","renderDeliverer","additionalSections","prUrl","prNumber","cgbgSotdTmpl","mailToWGPublicListWithSubject","mailToWGPublicListSubscription","renderPublicList","issueBase","linkToCommunity","w3Url","status2maturity","LS","LD","FPWD","status2text","DNOTE","NOTE","STMT","MO","ED","WD","CR","CRD","PR","PER","REC","DISC","RSCND","DRY","CRYD","CRY","RY","unofficial","UD","finding","status2long","W3CNotes","recTrackStatus","registryTrackStatus","tagStatus","cgStatus","bgStatus","cgbgStatus","trStatus","noTrackStatus","licenses","patentPolicies","validateDateAndRecover","fallbackDate","isFinite","formattedDate","collectSotdContent","sotdClone","hasChildNodes","isBasic","isCGBG","isCRDraft","isEd","isPER","isPR","isRecTrack","isRegular","isTagEditorFinding","license","lCaseLicense","deriveLicenseInfo","lastModified","pubSpace","derivePubSpace","maturity","docVersion","reportType","latestVersionURL","validateCGBG","validateIfAllowedOnTR","latestPath","previousPublishDate","previousMaturity","prevMaturity","pubDate","prevPubDate","prevRecShortname","uri","publishISODate","shortISODate","policies","policy","validatePatentPolicies","canShowHistory","historyURL","deriveHistoryURI","wgPotentialArray","idx","isPr","perEnd","contains","noRecTrack","notAllowed","mailToWGPublicList","populateSoTD","generatedSubtitle","coreDefaults","lint","highlightVars","addSectionLinks","w3cLogo","memSubmissionLogo","w3cDefaults","doJsonLd","excludeGithubLinks","supportedStatus","validateStatusForGroup","isWgStatus","inWorkingGroup","doesNotNeedWG","processLogos","css$n","noReSpecCSS","attachFixupScript","resourceHints","createResourceHints","canonicalStatus","styleFile","canUseW3CStyle","noToc","finalStyleURL","linkURL","urls","frag","nextLink","linkCSS","exportDoc","w3cStyle","resolveGithubPromise","rejectGithubPromise","file_a_bug","participate","ghURL","tempURL","org","repo","branch","newProps","githubToken","githubUser","atRiskBase","pullBase","githubAPI","hostname","otherLink","normalizedGHObj","apiBase","normalizedConfig","DOMBuilder","findPosition","tagName","findParent","findHeader","addHeader","section","addSection","addElement","builder","restructure","structuredInternals","processResponse","rawData","oninclude","includeReplace","includeFormat","fill","fillWithText","attr","removeIncludeAttributes","runIncludes","currentDepth","includables","promisesToInclude","includeId","default_title","h1Elem","isConnected","tempElem","documentTitle","setDocumentTitle","isInteger","searchString","findAbstract","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","renderText","renderArgs","argsText","searchText","renderEnum","enumValue","forContext","renderException","renderIdlPrimitiveType","idlStringToHtml","isSlot","splitter","forPart","childString","SyntaxError","allArgs","altText","altArgs","parseInlineIDL","output","ALLOWED_TYPES","readyPromise","openDB","deleteObjectStore","createObjectStore","keyPath","createIndex","range","IDBKeyRange","lowerBound","openCursor","entry","expires","openIdb","biblioDB","isAlias","resolveAlias","only","aliasOf","aliasesAndRefs","alias","promisesToAdd","flatMap","isInDB","stores","clearStorePromises","clear","biblio","bibrefsURL","doneResolver","updateFromNetwork","refs","forceUpdate","refsToFetch","onLine","oneHourFromNow","addAll","resolveRef","normalizeReferences","normalizedNormativeRefs","normativeReferences","informativeReferences","redundantKey","getRefKeys","localBiblio","localAliases","allRefs","neededRefs","idbRefs","promisesToFind","getReferencesFromIdb","hasData","noData","externalRefs","finish","info_references","norm_references","references","reference_not_found","REF_STATUSES","endWithDot","endStr","createReferencesSection","goodRefs","badRefs","refcontent","groupRefs","toRefContent","uniqueRefs","getUniqueRefs","refsToShow","toLocaleLowerCase","localeCompare","sec","showRef","aliases","getAliases","refUrl","selectors","elems","linkType","decorateInlineReference","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","normativity","keywordInterpretation","terms","processConformance","validateDOMName","createAttribute","validateCommonName","definitionMap","registerDefinition","names","knownTypesMap","requiresFor","associateWith","validator","knownTypes","computeType","dfnFor","validateDefinition","noexport","derivedType","dfnType","allowedSlotTypes","processAsInternalSlot","computeExport","export","addContractDefaults","dfnsWithNoType","exportableDfns","titles","pluralizeDfn","dfnTexts","getPluralizer","plurals","userDefinedPlurals","uniquePlurals","css$l","makeTitle","num","report","number","div","inAside","exampleTitle","css$j","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","searchParams","bg","textColorFromBgColor","ariaLabel","createLabel","createLabelsGroup","bodyHTML","issueSummaryElement","makeIssueSectionSummary","allEls","issuesAndNotes","itm","HTMLElement","issueNumbers","issues","fetchAndStoreGithubIssues","headElem","ednote","best_practice","defaultLang","bps","bpSummary","summaryItems","bp","localizedBpName","container","list_of_figures","fig","img","naturalHeight","naturalWidth","tof","caption","figure","decorateFigure","figureId","tofCaption","anchor","getTableOfFiguresListItem","collectFigures","tofElement","previousSections","decorateTableOfFigures","list_of_tables","listOfTables","decorateTable","tableId","listOfTablesCaption","getListOfTablesListItem","collectTables","listOfTablesElement","decorateListOfTables","topLevelEntities","findDfn","defn","findNormalDfn","findOperationDfn","resolvedName","dfns","getDfns","alternativeDfns","decorateDfn","dfnElem","idlAst","lCaseParent","last","getDataType","local","exportable","addAlternativeNames","asQualifiedName","asMethodName","asFullyQualifiedName","asMethodWithArgs","operationName","argsAst","operationNames","isOptional","requiredArgs","requiredOperation","optionalOps","generateMethodNamesWithArgs","getAlternativeNames","originalName","foundDfns","dfnForArray","closestDfnFor","idlStruct","copyButton","createButton","addCopyIDLButton","idlHeader","idlText","clipboard","writeText","css$h","idlPartials","Text","keyword","wrapped","idlLink","defineIdlName","getIdlDefinitionClassName","parentName","idlId","getNameAndId","getDfnType","isDefaultJSON","unlinkedAnchor","nameResolverMap","getDefnName","getIdlId","resolvePartial","overload","qualifiedName","fullyQualifiedName","resolveOverload","resolveNameAndId","topLevelIdlTypes","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","matchedText","possibleExternalLinks","duplicateMsg","duplicateTitle","collectDfns","dfnFors","oldDfn","oldIsDfn","newIsDfn","isSameDfnType","isSameDfnFor","findMatchingDfn","titleToDfns","linkTargets","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","setItem","API_URL","lastUpdated","shouldBustCache","clearXrefData","requiredKeySet","query","cursor","profiles","informativeRefsInNormative","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","fetchFromNetwork","cacheXrefData","getData","ambiguous","notFound","collector","getPrefilledFormURL","howToFix","howToCiteURL","originalTerm","formUrl","specsString","forParent","showErrors","addDataCiteToTerms","css$f","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","idlIndexSec","idlIndex","lowerHeaderTags","toc","scanSections","maxTocLevel","appendixMode","lastNonAppendix","isAppendix","secno","isIntro","appendixNumber","createComment","createTocListItem","subsections","floor","getSectionTree","sectionElements","span","renameSectionHeaders","noTOC","maxToc","isNaN","sectionToSkipFromToC","skipFromToC","nav","h2","after","createTableOfContents","permalinkLabel","sectionType","sectionNumber","headings","selfLink","css$d","BROWSERS","statToText","defaultBrowsers","DEFAULTS","removeOnSave","browsers","feature","normalizeCaniuseConf","invalidBrowsers","browser","validateBrowsers","featureURL","headDlElem","contentPromise","statusText","fetchStats","toBrowserCell","browserId","browserName","supportLevel","cssClass","textVersion","getLogoSrc","browserCellRenderer","processJson","handleError","definitionPair","outputDoc","css$b","BASE_JSON_PATH","MDN_BROWSERS","chrome","chrome_android","edge","edge_mobile","firefox","firefox_android","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","yesNoUnknown","displayStatus","createRowFromBrowserData","versionData","version_removed","versionAdded","version_added","buildBrowserSupportTable","mdnKey","mdn","getMdnKey","mdnSpecJson","mdnConf","baseJsonPath","getMdnData","findElements","mdnSpecArray","save_snapshot","downloadLinks","epubURL","saveDialog","filename","toDownloadLink","supportsDownload","HTMLAnchorElement","search_specref","specrefSearchUI","xrefSearchUI","about_respec","getEntriesByType","duration","round","perfEntryToTR","firstParagraph","metaElem","status2rdf","LC","requiresCanonicalLink","addPerson","ed","worksFor","addRef","jsonld","creator","publishedDate","isbn","canonicalURI","rdfStatus","w3p","foaf","datePublished","inLanguage","isBasedOn","copyrightHolder","discussionUrl","alternativeHeadline","addl","description","contributor","citationIds","citationContents","citation","addJSONLDInfo","css$9","fetchBase","currentScript","workerPromise","workerScript","respecWorker$1","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","css$7","highlightListener","varElem","hightligtedElems","highlightColor","getHighlightColor","varsToHighlight","colorStatus","HL_COLORS","removeHighlight","addHighlight","resetListener","hlColor","activeClass","css$5","varMap","variables","currentSection","textNode","processBox","matchingElement","copy","processFigure","figcaption","figTitle","processTable","matchingTable","tableTitle","processSection","processHeading","localize","hadSelfLink","attrName","matchingClosest","newClosest","anchors","css$1","createPanel","panelId","panel","dfnExportedMarker","parentIdlBlock","idlMarker","titleToIDs","linkID","getReferenceTitle","toLinkProps","ids","listItemToHTML","referencesToHTML","panels","tabIndex","dfnPanel_runtime$1","loadScript","props","to","connectedCallback","fetchCommits","commits","commit","commitURL","pr","finally","gh","CUSTOM_ELEMENTS","customElements","readyPromises","monetization","paymentPointer","rawConfig","canonicalizeConfig","transforms","pos","performTransformations","metas","meta","punctuationMarks","punctuatingRegExp","offendingElements","isBrokenHyperlink","getElementsByName","HTMLTableCaptionElement","isDfnUnused","logger","HTMLHeadingElement","sectionContainsAlgorithm","varElems","varUsage","vars","sectionTitle","privacy_considerations","security_considerations","requiresSomeSectionStatus","missingRequiredSections","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":"sDACA,MAAMA,IAAUC,OAAOC,QACvB,IAAKF,EAAO,CAMV,MAAME,EAAU,SAAUC,EAAMC,GAC9B,MAAMC,EAAUF,EAAKG,KAAIC,IACvB,KAAMA,KAAON,OAAOC,QAAQG,SAC1B,MAAM,IAAIG,MAAM,gCAAgCD,KAElD,OAAON,OAAOC,QAAQG,QAAQE,EAAI,IAEpCE,QAAQC,IAAIL,GAASM,MAAKC,GAAWR,KAAYQ,IACrD,EACEV,EAAQG,QAAU,GAClBJ,OAAOC,QAAUA,CACnB,CAMO,SAASW,EAAOC,EAAMC,GACtBf,IACHC,OAAOC,QAAQG,QAAQS,GAAQC,EAEnC,CCtBO,MAIDC,EAAgB,IAAIC,YAOnB,SAASC,EAAIC,EAAOC,GAEzB,GADAJ,EAAcK,cAAc,IAAI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9E,EAAiBpkF,IAAIskF,IACrBF,EAAiB3jF,IAAI6jF,EAAgB,IAAItkF,IAAIskF,IACtCl3E,KAAKq1B,EACf,CAED,MAAM5oB,GAAEA,EAAE0qE,KAAEA,EAAIpL,YAAEA,EAAWqL,QAAEA,GAAYL,EACrC3kE,EAAQ,QAAQ3F,MAAO0qE,KAC7B,IAAK,MAAOD,EAAgBx/C,KAAas/C,EAAkB,CACzD,MAAMK,EAAQlB,GAAsBe,GAEpC/kD,GAAY/f,EAAOpiB,GAAM,CAAE4nC,QADX,OAAOm0C,SAAmBsL,oBAAwBD,MAC9B1/C,YACrC,CACF,CACH,ICtCA,MAAMt/B,GAAW,kBACJpI,GAAO,oCAmBdgC,GAAOu/B,GAjBe,CAC1Br/B,GAAI,CACF0rB,IAAG,CAAC28C,EAAM7R,IACD,2BAA2B6R,oDAAuD7R,MAEvFx4B,WACF,OAAOkI,EAAO;;;;;;;2DAOuChgC,0CACtD,sDAKE,SAAailC,GAClB,IAAKA,EAAK4b,OAAO7gD,IAAW,OAC5B,MAAM08E,EAAiC,UAAxBz3C,EAAK4b,KAAK7gD,IAAwBy/B,GAAY1F,GAE7D8pC,GAA2BlyD,SAAQ,EAAGwwD,OAAM9R,OAAMpzB,cAC5CA,EAAQ9E,UAAUmoB,SAAS,gBAC/Bo8B,EAAO9iF,GAAK4rB,IAAI28C,EAAM9R,GAAOz4D,GAAM,CACjCoiB,MAAO,6CACPslB,SAAU,CAACrC,GACXnF,KAAMl+B,GAAKk+B,MACX,GAEN","x_google_ignoreList":[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,40]} \ No newline at end of file diff --git a/package.json b/package.json index 37dd9b45df..21a401be0c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "respec", - "version": "33.0.0", + "version": "33.0.1", "license": "W3C", "description": "A technical specification pre-processor.", "engines": {