respec 37.7.3 → 37.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- window.respecVersion="37.7.3",function(){"use strict";var e="undefined"!=typeof document?document.currentScript:null;const t=document.documentElement;t?.hasAttribute("lang")||(t.lang="en",t.hasAttribute("dir")||(t.dir="ltr"));const n={},r=t?.lang??"en";var o=Object.freeze({__proto__:null,l10n:n,lang:r,name:"core/l10n",run:function(e){e.l10n=n[r]||n.en}});const i=(e,t)=>t.some(t=>e instanceof t);let s,a;const l=new WeakMap,c=new WeakMap,u=new WeakMap;let d={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return l.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return m(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function p(e){d=e(d)}function h(e){return(a||(a=["advance","continue","continuePrimaryKey"].map(e=>IDBCursor.prototype[e]))).includes(e)?function(...t){return e.apply(g(this),t),m(this.request)}:function(...t){return m(e.apply(g(this),t))}}function f(e){return"function"==typeof e?h(e):(e instanceof IDBTransaction&&function(e){if(l.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",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)});l.set(e,t)}(e),i(e,s||(s=[IDBIndex,IDBObjectStore,IDBCursor,IDBDatabase,IDBTransaction]))?new Proxy(e,d):e)}function m(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(m(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",i)});return u.set(t,e),t}(e);if(c.has(e))return c.get(e);const t=f(e);return Object.is(t,e)||(c.set(e,t),u.set(t,e)),t}const g=e=>u.get(e);const b=["get","getKey","getAll","getAllKeys","count"],y=["put","add","delete","clear"],w={};function v(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(w[t])return w[t];const n=t.replace(/FromIndex$/,""),r=t!==n,o=y.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!b.includes(n))return;return w[t]=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]}}p(e=>({...e,get:(t,n,r)=>v(t,n)||e.get(t,n,r),has:(t,n)=>!!v(t,n)||e.has(t,n)}));const k=["advance","continue","continuePrimaryKey"],x={},$=new WeakMap,E=new WeakMap,S={get(e,t){if(!k.includes(t))return e[t];let n=x[t];return n||(n=x[t]=function(...e){$.set(this,E.get(this)[t](...e))}),n}};async function*_(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,S);for(E.set(n,t),u.set(n,g(t));t;)yield n,t=await($.get(n)||t.continue()),$.delete(n)}function C(e,t){return t===Symbol.asyncIterator&&i(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&i(e,[IDBIndex,IDBObjectStore])}p(e=>({...e,get:(t,n,r)=>C(t,n)?_:e.get(t,n,r),has:(t,n)=>C(t,n)||e.has(t,n)}));var A,L=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",e=>t(e.oldVersion,e)),m(n).then(()=>{})},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:i}={}){const s=indexedDB.open(e,t),a=m(s);return r&&s.addEventListener("upgradeneeded",e=>{r(m(s.result),e.oldVersion,e.newVersion,m(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:g,wrap:m});!function(e){e.ILLEGAL="ILLEGAL",e.EOF="EOF",e.NL="\n",e.SPACE=" ",e.UNDERSCORE="_",e.DOLLAR="$",e.ATSIGN="@",e.CARET="^",e.HASH="#",e.TILDE="~",e.AMPERSAND="&",e.IDENT="IDENT",e.COMMENT="COMMENT",e.STRING="STRING",e.NUMBER="NUMBER",e.FLOAT="FLOAT",e.CTLOP="CTLOP",e.BYTES="BYTES",e.HEX="HEX",e.BASE64="BASE64",e.ASSIGN="=",e.ARROWMAP="=>",e.TCHOICE="/",e.GCHOICE="//",e.TCHOICEALT="/=",e.GCHOICEALT="//=",e.PLUS="+",e.MINUS="-",e.QUEST="?",e.ASTERISK="*",e.INCLRANGE="..",e.EXCLRANGE="...",e.COMMA=",",e.DOT=".",e.COLON=":",e.SEMICOLON=";",e.LPAREN="(",e.RPAREN=")",e.LBRACE="{",e.RBRACE="}",e.LBRACK="[",e.RBRACK="]",e.LT="<",e.GT=">",e.QUOT='"'}(A||(A={}));const R=Object.entries(A).reduce((e,[t,n])=>(e[n]=t,e),{});new class{type;literal;comments;whitespace;constructor(e,t,n=[],r=""){this.type=e,this.literal=t,this.comments=n,this.whitespace=r}serialize(){let e="";for(const t of this.comments)e+=t.serialize();switch(e+=this.whitespace,this.type){case A.IDENT:case A.COMMENT:case A.NUMBER:case A.FLOAT:e+=this.literal;break;case A.STRING:e+='"'+this.literal+'"';break;case A.CTLOP:e+="."+this.literal;break;case A.BYTES:e+="'"+this.literal+"'";break;case A.HEX:e+="h'"+this.literal+"'";break;case A.BASE64:e+="b64'"+this.literal+"'";break;case A.EOF:break;default:e+=this.type.valueOf()}return e}startWithSpaces(){return""!==this.whitespace||this.comments.length>0}toString(e=0){const t=[`${" ".repeat(e)}${this.constructor.name}: ${R[this.type]} (${this.type})`];""!==this.whitespace&&t.push(" ".repeat(e+1)+`whitespaces: ${this.whitespace.length}`),""!==this.literal&&t.push(" ".repeat(e+1)+`literal: ${this.literal}`);for(const n of this.comments)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return{type:this.type,literal:this.literal,comments:this.comments?.map(e=>e.toJSON()),whitespace:this.whitespace}}}(A.ILLEGAL,"");const T=/^[!#$%&'*+-.^`|~\w]+$/,P=/[\u000A\u000D\u0009\u0020]/u,O=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function N(e,t,n){(t&&""!==t&&!e.has(t)&&O.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function I(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var j={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function D(e){j=e}var z={exec:()=>null};function M(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),o=t[r];return o||(o=e(r),t[r]=o),o}}function q(e,t=""){let n="string"==typeof e?e:e.source,r={replace:(e,t)=>{let o="string"==typeof t?t:t.source;return o=o.replace(F.caret,"$1"),n=n.replace(e,o),r},getRegex:()=>new RegExp(n,t)};return r}var H=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),B="^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)",F={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,listInterruptsParagraph:/^ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,textIndentedContinuation:/^(?:\n(?: {4}| {0,3}\t)[ \t]*[^ \t\n][^\n]*)+/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)(\t[ \t]*)/gm,blockquoteFenceOpen:/^ {0,3}(`{3,}(?=[^`]*$)|~{3,})/,blockquoteFenceClose:/^ {0,3}(`{3,}|~{3,})[ \t]*$/,blockquoteListItemStart:/^ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|$)/,nestedBlockMarker:/^ {0,3}(?:(?:[*+-]|\d{1,9}[.)])(?: |$)|> ?)/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\][ \t]+\S/,listReplaceTask:/^\[[ xX]\][ \t]+/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableHeader:new RegExp(B+"(?:\\n|$)"),tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:M(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`)),hrRegex:M(e=>new RegExp(`^ {0,${e}}((?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\\*[ \t]*){3,})(?:\\n+|$)`)),fencesBeginRegex:M(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:M(e=>new RegExp(`^ {0,${e}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:M(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:M(e=>new RegExp(`^ {0,${e}}(?:</?(?:${G})(?:[ \\t]+|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:M(e=>new RegExp(`^ {0,${e}}>`)),nestedContainerMarkers:/^(?: {0,3}(?:(?:[*+-]|\d{1,9}[.)])[ \t]+|>[ \t]?))+/},U=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,W=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,G="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|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",V=q(" {0,3}(?:</?(?:tag)(?:[ \\t]+|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",G).getRegex(),Z=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/,K=q(Z).replace(/bull/g,W).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/\|table/g,"").replace(/html/g,V).getRegex(),Y=q(Z).replace(/bull/g,W).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).replace(/html/g,V).getRegex(),X=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Q=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/,J=q(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<(?:\\.|[^\n<>\\])*>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Q).replace("title",/(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex(),ee=q(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,W).getRegex(),te=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ne=q("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*?[ \\t]*/?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",te).replace("tag",G).replace("attribute",/[ \t]+[a-zA-Z:_][\w.:-]*(?:[ \t]*=[ \t]*"[^"\n]*"|[ \t]*=[ \t]*'[^'\n]*'|[ \t]*=[ \t]*[^\s"'=<>`]+)?/).getRegex(),re=e=>q(X).replace("hr",U).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",e).replace("html",V).getRegex(),oe=re(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),ie=re(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),se=/ {0,3}> ?(?:(?!blank)(paragraph)|[^\n]*)(?:\n|$)/,ae={blockquote:q(/^(first)(?:next)*/).replace("first",q(se).replace("blank",/[ \t]*(?:\n|$)| {4}/).getRegex()).replace("next",q(se).replace("blank",/[ \t]*(?:\n|$)/).getRegex()).replace(/paragraph/g,ie).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:J,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*)[ \t]*(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:U,html:ne,lheading:K,list:ee,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:oe,table:z,text:/^[^\n]+/},le=q(B+"(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",U).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",V).getRegex(),ce={...ae,lheading:Y,table:le,paragraph:q(X).replace("hr",U).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",F.tableHeader).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html",V).getRegex()},ue={...ae,html:q("^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))").replace("comment",te).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:z,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:q(X).replace("hr",U).replace("heading"," *#{1,6} *[^\n]").replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").replace("lheading",K).getRegex()},de=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,pe=/[\p{P}\p{S}]/u,he=/[\s\p{P}\p{S}]/u,fe=/[^\s\p{P}\p{S}]/u,me=q(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,he).getRegex(),ge=/(?!~)[\p{P}\p{S}]/u,be=q(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",H?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ye=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,we=q(ye,"u").replace(/punct/g,pe).getRegex(),ve=q(ye,"u").replace(/punct/g,ge).getRegex(),ke=q(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,"u").replace(/openQuote/g,/[\p{Pi}\p{Ps}"']/u).replace(/punct/g,pe).getRegex(),xe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",$e=q(xe,"gu").replace(/notPunctSpace/g,fe).replace(/punctSpace/g,he).replace(/punct/g,pe).getRegex(),Ee=q(xe,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,ge).getRegex(),Se=q("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,fe).replace(/punctSpace/g,he).replace(/punct/g,pe).getRegex(),_e=q("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,fe).replace(/punctSpace/g,he).replace(/punct/g,pe).getRegex(),Ce=q("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,fe).replace(/punctSpace/g,he).replace(/punct/g,pe).getRegex(),Ae=q(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,pe).getRegex(),Le=q("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,fe).replace(/punctSpace/g,he).replace(/punct/g,pe).getRegex(),Re=q(/\\(punct)/,"gu").replace(/punct/g,pe).getRegex(),Te=q(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,pe).getRegex(),Pe=q(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("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])?)+(?![-_])/).getRegex(),Oe=q(te).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ne=q("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Oe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ie=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,je=q(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",Ie).getRegex(),De=/\\[^ \t\n\x00-\x1f]|\\(?=[ \t\n])|[^ \t\n\x00-\x1f\\()]/,ze=q(/\((?:char)*\)/).replace("char",De).getRegex(),Me=q(/\((?:char|p1)*\)/).replace("char",De).replace("p1",ze).getRegex(),qe=q(/\((?:char|p2)*\)/).replace("char",De).replace("p2",Me).getRegex(),He=q(/(?!<)(?:char|p3)+/).replace("char",De).replace("p3",qe).getRegex(),Be=q(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",je).replace("href",q(/<(?:\\.|[^\n<>\\])*>|bareHref|(?=\))/).replace("bareHref",He).getRegex()).replace("title",/"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex(),Fe=q(/^!?\[(label)\]\[(ref)\]/).replace("label",je).replace("ref",Q).getRegex(),Ue=q(/^!?\[(ref)\](?:\[\])?/).replace("ref",Q).getRegex(),We=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Ge=q(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",Ie).getRegex(),Ve=q("reflink|nolink(?!\\()","g").replace("reflink",q(/^!?\[(label)\]\[(ref)\]/).replace("label",Ge).replace("ref",We).getRegex()).replace("nolink",q(/^!?\[(ref)\](?:\[\])?/).replace("ref",We).getRegex()).getRegex(),Ze=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ke=q(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),Ye={_backpedal:z,anyPunctuation:Re,anyPunctuationOutsideCode:Te,autolink:Pe,blockSkip:be,br:de,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:z,delLDelim:z,delRDelim:z,emStrongLDelim:we,emStrongRDelimAst:$e,emStrongRDelimUnd:_e,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Be,nolink:Ue,punctuation:me,reflink:Fe,reflinkSearch:Ve,tag:Ne,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:z},Xe={...Ye,emStrongLDelim:ke,emStrongRDelimAst:Se,emStrongRDelimUnd:Ce,link:q(/^!?\[(label)\]\((.*?)\)/).replace("label",je).getRegex(),reflink:q(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",je).getRegex()},Qe={...Ye,emStrongRDelimAst:Ee,emStrongLDelim:ve,delLDelim:Ae,delRDelim:Le,url:q(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",Ke).replace("protocol",Ze).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:q(/^(?:[A-Za-z0-9.+-]+(?=@)|[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",Ze).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace("wwwStart",H?"(?<![^\\s*_~(])www\\.":"www\\.").getRegex()},Je={...Qe,br:q(de).replace("{2,}","*").getRegex(),text:q(Qe.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},et={normal:ae,gfm:ce,pedantic:ue},tt={normal:Ye,gfm:Qe,breaks:Je,pedantic:Xe},nt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},rt=e=>nt[e];function ot(e,t){if(t){if(F.escapeTest.test(e))return e.replace(F.escapeReplace,rt)}else if(F.escapeTestNoEncode.test(e))return e.replace(F.escapeReplaceNoEncode,rt);return e}function it(e){try{e=encodeURI(e).replace(F.percentDecode,"%")}catch{return null}return e}function st(e,t){let n=e.replace(F.findPipe,(e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"}).split(F.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(F.slashPipe,"|");return n}function at(e,t,n){let r=e.length;if(0===r)return"";let o=0;for(;o<r;){if(e.charAt(r-o-1)!==t)break;o++}return e.slice(0,r-o)}function lt(e){let t=e.split("\n"),n=t.length-1;for(;n>=0&&F.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join("\n")}function ct(e){return e.trim().replace(F.multipleSpaceGlobal," ").toLowerCase().toUpperCase().toLowerCase()}function ut(e,t){if(-1===e.indexOf(t[0])&&-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}var dt=new WeakMap;function pt(e){let t={"*":-1,_:-1},n=-1,r=e.length;for(let o=0;o<r;o++){let i=e[o];if("*"!==i&&"_"!==i&&"~"!==i)continue;let s=0===o?"\n":e[o-1],a=o+1;for(;a<r&&e[a]===i;)a++;" "!==s&&"\t"!==s&&"\n"!==s&&"\r"!==s&&"\f"!==s&&("~"===i?n=o:t[i]=o),o=a-1}return{maskedSrc:e,lastPossibleEmStrongCloserIndex:t,lastPossibleDelCloserIndex:n}}function ht(e,t,n){let r=dt.get(e)?.at(-1);return r&&r.maskedSrc===t?r.lastPossibleEmStrongCloserIndex[n]:pt(t).lastPossibleEmStrongCloserIndex[n]}function ft(e,t){let n=dt.get(e)?.at(-1);return n&&n.maskedSrc===t?n.lastPossibleDelCloserIndex:pt(t).lastPossibleDelCloserIndex}function mt(e,t=0){let n=t,r="";for(let t of e)if("\t"===t){let e=4-n%4;r+=" ".repeat(e),n+=e}else r+=t,n++;return r}function gt(e){let t,n=!1;return e.map(e=>{if(n)return e;let{depth:r,expanded:o,keptIndent:i,content:s}=function(e,t){let n=0,r=0,o=0,i=0,s="";for(;o<t;){let t=n,a=r;for(;" "===e[t]||"\t"===e[t];)a+=bt(e[t],a),t++;if(">"!==e[t]||a-i>3)break;s+=" ".repeat(a-r)+">",o++,n=t+1,r=a+1,i=" "===e[n]||"\t"===e[n]?r+1:r}if(0===o)return{depth:o,expanded:e,keptIndent:e,content:e};let a="",l="";for(;(" "===e[n]||"\t"===e[n])&&r<i+4;){let t=bt(e[n],r);a+=" ".repeat(t),l+=r<i&&t>1?" ".repeat(t):e[n],r+=t,n++}let c=e.slice(n);return{depth:o,expanded:s+a+c,keptIndent:s+l+c,content:" ".repeat(Math.max(0,r-i))+c}}(e,t?.depth??1/0);if(t?.depth!==r&&(t=void 0),t){let e=F.blockquoteFenceClose.exec(s)?.[1];return!e||e[0]!==t.marker[0]||e.length<t.marker.length?i:(t=void 0,o)}if(n=F.blockquoteListItemStart.test(s),n)return e;let a=F.blockquoteFenceOpen.exec(s)?.[1];return a&&(t={marker:a,depth:r}),o}).join("\n")}function bt(e,t){return"\t"===e?4-t%4:1}function yt(e,t,n,r,o){let i=t.href,s=t.title||null,a=function(e,t){let n="";for(let r=0;r<e.length;r++){if("`"===e[r]){let o=t.inline.code.exec(e.slice(r));if(o){n+=o[0],r+=o[0].length-1;continue}}"\\"!==e[r]||"["!==e[r+1]&&"]"!==e[r+1]?n+=e[r]:(n+=e[r+1],r++)}return n}(e[1],o),l="!"===e[0].charAt(0),c=r.state.inLink,u=r.state.linkEmitted,d=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let p=r.inlineTokens(a),h=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=c,!l){if(h)return void(r.state.inRawBlock=d);r.state.linkEmitted=!0}return{type:l?"image":"link",raw:n,href:i,title:s,text:a,tokens:p}}function wt(e,t,n,r){if(!t.includes("<"))return!1;for(let o=0;o<t.length;o++){if("\\"===t[o]){o++;continue}if("`"===t[o]){let e=r.inline.code.exec(t.slice(o));if(e){o+=e[0].length-1;continue}}if("<"!==t[o])continue;let i=e.slice(n+o),s=r.inline.tag.exec(i)||r.inline.autolink.exec(i);if(s){if(s[0].length>t.length-o)return!0;o+=s[0].length-1}}return!1}var vt=class{options;rules;lexer;constructor(e){this.options=e||j}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:lt(t[0]),n=e.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e,codeBlockStyle:"indented",text:n}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(null===r)return t;let o=r[1];return t.split("\n").map(e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[r]=t;return e.slice(Math.min(r.length,o.length))}).join("\n")}(e,t[3]||"",this.rules);return void 0!==t[3]&&(""===n||n.endsWith("\n"))&&(n+="\n"),{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=at(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:"heading",raw:at(t[0],"\n"),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:at(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=at(t[0],"\n").split("\n"),n="",r="",o=[];for(;e.length>0;){let t,i=!1,s=[];for(t=0;t<e.length;t++)if(this.rules.other.blockquoteStart.test(e[t]))s.push(e[t]),i=!0;else{if(i)break;s.push(e[t])}e=e.slice(t);let a=s.join("\n"),l=(this.lexer.state.top&&!this.lexer.state.inBlockquote&&a.includes("\t")?gt(s):a).replace(this.rules.other.blockquoteMarkerWhitespace,(e,t,n)=>n.startsWith(" ")?t+" "+n.slice(1):t+mt(n,t.length)).replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${a}`:a,r=r?`${r}\n${l}`:l;let c=this.lexer.state.top,u=this.lexer.state.inBlockquote;if(this.lexer.state.top=!0,this.lexer.state.inBlockquote=!0,this.lexer.blockTokens(l,o,!0),this.lexer.state.top=c,this.lexer.state.inBlockquote=u,0===e.length)break;let d=o.at(-1);if("code"===d?.type||"heading"===d?.type||"hr"===d?.type||"html"===d?.type||"table"===d?.type)break;if("blockquote"===d?.type){let t=d,i=e.join("\n"),s=t.raw+"\n"+i.replace(this.rules.other.blockquoteSetextReplace2,"");this.lexer.state.inBlockquote=!0;let a=this.blockquote(s);this.lexer.state.inBlockquote=u,o[o.length-1]=a;let l=s.substring(a.raw.length).replace(/^\n/,""),c=l?l.split("\n").length:0,p=c?e.slice(0,-c):e;if(p.length>0&&(n=`${n}\n${p.join("\n")}`),r=r.substring(0,r.length-t.text.length)+a.text,e=e.slice(p.length),e.length>0&&this.rules.other.blockquoteStart.test(e[0]))continue;break}if("list"===d?.type){let t=d,i=t.raw+"\n"+e.join("\n"),s=this.list(i);o[o.length-1]=s;let a=s.raw.length>t.raw.length?i.slice(t.raw.length+1,s.raw.length).split("\n").length:0;if(a>0){let t=e.slice(0,a).join("\n");n=`${n}\n${t}`,r=`${r}\n${t}`}if(e=e.slice(a),e.length>0&&!this.rules.other.blockquoteStart.test(e[0]))break;continue}}return{type:"blockquote",raw:n,tokens:o,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){if(!this.options.pedantic&&"text"===this.lexer.state.lastToken?.type&&!this.rules.other.listInterruptsParagraph.test(e))return;let n=e,r=()=>n.length-e.length,o=t[1].trim(),i=o.length>1,s={type:"list",raw:"",ordered:i,start:i?+o.slice(0,-1):"",loose:!1,items:[]};o=i?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`,this.options.pedantic&&(o=i?o:"[*+-]");let a=this.rules.other.listItemRegex(o),l=!1;for(;e;){let o=!1,i="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;let c=r();e=e.substring(t[0].length);let u=t[2].split("\n",1)[0],d=t[1].length,p=this.options.pedantic?mt(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>mt(e,d)),h=e.split("\n",1)[0],f=!p.trim(),m=0;if(this.options.pedantic?(m=2,i=p.trimStart()):f?m=d+1:(m=p.search(this.rules.other.nonSpaceChar),m=m>4?1:m,i=p.slice(m),m+=d),f&&this.rules.other.blankLine.test(h)&&(e=e.substring(h.length+1),o=!0),!o){let t=this.rules.other.nextBulletRegex(m),n=this.rules.other.hrRegex(m),r=this.rules.other.fencesBeginRegex(m),o=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(m):this.rules.other.headingBeginRegex(m),s=this.rules.other.htmlBeginRegex(m),a=this.rules.other.blockquoteBeginRegex(m),l=!1;for(;e;){let c,u=e.split("\n",1)[0];if(h=u,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),c=h):c=h.replace(this.rules.other.leadingSpaceTab,e=>mt(e)),r.test(h)||o.test(h)||s.test(h)||a.test(h)||t.test(h)||n.test(h))break;if(c.search(this.rules.other.nonSpaceChar)>=m||!h.trim())i+="\n"+c.slice(m),l=!1;else{if(f)break;let e=p;if(!this.options.pedantic&&!i.includes("\n")&&!p.includes("\t")){let t;for(;!n.test(e)&&(t=this.rules.other.nestedBlockMarker.exec(e));)e=e.slice(t[0].length);if(!e.trim())break}if(e.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||r.test(e)||o.test(e)||s.test(e)||n.test(e))break;if(!this.options.pedantic&&!l){let e=p.replace(this.rules.other.nestedContainerMarkers,"");if(this.rules.block.fences.test(e)||this.rules.block.heading.test(e)||this.rules.block.hr.test(e))break}i+="\n"+(!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(h)&&this.rules.block.lheading.test(`${p}\n${h}`)?` ${c.replace(/^ {0,3}/,"")}`:h),l=!0}f=!h.trim(),e=e.substring(u.length+1),p=c.slice(m)}}let g=n.slice(c,r());s.loose||(l?s.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(l=!0)),s.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(i),loose:!1,text:i,tokens:[]})}let c=s.items.at(-1);if(!c)return;c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd(),s.raw=n.slice(0,r()).trimEnd();let u=[];for(let e of s.items)if(this.lexer.state.top=!1,u.push(this.lexer.inlineQueue.length),e.tokens=this.lexer.blockTokens(e.text,[]),!s.loose){let t=e.tokens.filter(e=>"space"===e.type),n=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw));s.loose=n}for(let e=0;e<s.items.length;e++){let t=s.items[e],n=t.tokens[0];if(!t.task||"text"!==n?.type&&"paragraph"!==n?.type)t.task&&(t.task=!1);else{t.text=t.text.replace(this.rules.other.listReplaceTask,""),n.raw=n.raw.replace(this.rules.other.listReplaceTask,""),n.text=n.text.replace(this.rules.other.listReplaceTask,"");let r=this.lexer.inlineQueue;for(let t=u[e];t<r.length;t++)if(r[t].tokens===n.tokens){r[t].src=r[t].src.replace(this.rules.other.listReplaceTask,"");break}let o=this.rules.other.listTaskCheckbox.exec(t.raw);if(o){let e={type:"checkbox",raw:o[0]+" ",checked:"[ ]"!==o[0]};t.checked=e.checked,s.loose?t.tokens[0]&&["paragraph","text"].includes(t.tokens[0].type)&&"tokens"in t.tokens[0]&&t.tokens[0].tokens?(t.tokens[0].raw=e.raw+t.tokens[0].raw,t.tokens[0].text=e.raw+t.tokens[0].text,t.tokens[0].tokens.unshift(e)):t.tokens.unshift({type:"paragraph",raw:e.raw,text:e.raw,tokens:[e]}):t.tokens.unshift(e)}}}if(s.loose)for(let e of s.items){e.loose=!0;for(let t of e.tokens)"text"===t.type&&(t.type="paragraph")}return s}}html(e){let t=this.rules.block.html.exec(e);if(t){if("paragraph"===this.lexer.state.lastToken?.type&&!this.rules.other.htmlBeginRegex(4).test(e))return;let n=lt(t[0]);return{type:"html",block:!0,raw:n,pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:n}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&-1!==ut(t[2],"()"))return;let e=ct(t[1]),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:at(t[0],"\n"),href:n,title:r}}}table(e){let t,n;if(this.options.gfm&&!this.options.pedantic){let r=this.rules.other.tableHeader.exec(e);if(!r||!this.rules.other.tableDelimiter.test(r[2])||(t=st(r[1]),n=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),t.length!==n.length))return}let r=this.rules.block.table.exec(e);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;t??=st(r[1]),n??=r[2].replace(this.rules.other.tableAlignChars,"").split("|");let o=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],i={type:"table",raw:at(r[0],"\n"),header:[],align:[],rows:[]};if(t.length===n.length){for(let e of n)this.rules.other.tableAlignRight.test(e)?i.align.push("right"):this.rules.other.tableAlignCenter.test(e)?i.align.push("center"):this.rules.other.tableAlignLeft.test(e)?i.align.push("left"):i.align.push(null);for(let e=0;e<t.length;e++)i.header.push({text:t[e],tokens:this.lexer.inline(t[e]),header:!0,align:i.align[e]});for(let e of o)i.rows.push(st(e,i.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:i.align[t]})));return i}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:"heading",raw:at(t[0],"\n"),depth:"="===t[2].charAt(0)?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let 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){let t=this.rules.block.text.exec(e);if(t){let n=t[0],r=t[0],o=this.rules.other.textIndentedContinuation.exec(e.slice(n.length));return o&&(n+=o[0],r+=o[0].replace(this.rules.other.codeRemoveIndent,"")),{type:"text",raw:n,text:r,tokens:this.lexer.inline(r)}}}escape(e){if(92!==e.charCodeAt(0))return;let t=this.rules.inline.escape.exec(e);return t?{type:"escape",raw:t[0],text:t[1]}:void 0}tag(e){if(60!==e.charCodeAt(0))return;let t=this.rules.inline.tag.exec(e);return t?(!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}):void 0}link(e){if(!1===this.lexer.state.linkParenPossible)return;let t=e.charCodeAt(0);if(91!==t&&33!==t)return;let n=this.rules.inline.link.exec(e);if(n){let t="!"===n[0].charAt(0)?2:1;if(!this.options.pedantic&&wt(e,n[1],t,this.rules))return;let r=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=at(r.slice(0,-1),"\\");if((r.length-e.length)%2==0)return}else{let e=ut(n[2],"()");if(-2===e)return;if(e>-1){let t=(0===n[0].indexOf("!")?5:4)+n[1].length+e;n[2]=n[2].substring(0,e),n[0]=n[0].substring(0,t).trim(),n[3]=""}}let o=at(n[0].slice(0,-1),"\\");if((n[0].length-o.length)%2==0)return;let i=n[2],s="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],s=e[3])}else s=n[3]?n[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),yt(n,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(e,t){let n,r=e.charCodeAt(0);if((91===r||33===r)&&((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e)))){let r="!"===n[0].charAt(0)?2:1;if(!this.options.pedantic&&wt(e,n[1],r,this.rules))return;let o=t[ct(n[2]||n[1])];if(!o){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return yt(n,o,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let o=r[0][0],i=n===o,s=t.length-e.length,a=s;for(;!this.options.pedantic&&a>0&&t[a-1]===o;)a--;let l=[...t.slice(Math.max(0,a-2),a)].at(-1)??"",c="*"===l||"_"===l||!!this.rules.inline.punctuation.exec(l);a<s&&(n=l);let u=a<s?c:"*"===n||"_"===n||!!this.rules.inline.punctuation.exec(n);if(r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))return;let d=r[1]||r[3]||"";if(!d||!n||u){let n,u,p=[...r[0]].length-1,h=p,f=0,m=s-a+p,g=!(this.options.pedantic||!l.trim()||!d&&("*"!==o||c));if("*"!==o&&"_"!==o)return;let b="*"===o?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd,y=ht(this,t,o),w=t.length-e.length+p;if(y<w)return;t=t.slice(-1*e.length+p);let v=y-w;for(b.lastIndex=0;null!==(r=b.exec(t))&&!(r.index>v);){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(u=[...n].length,r[3]||r[4]){h+=u;continue}if((r[5]||r[6]||g)&&m%3&&!((m+u)%3)){if(i&&(r[5]||r[6]))break;f+=u;continue}if(h-=u,h>0)continue;u=Math.min(u,u+h+f);let t=[...r[0]][0].length,o=e.slice(0,p+r.index+t+u);if(Math.min(p,u)%2){let e=o.slice(1,-1);return{type:"em",raw:o,text:e,tokens:this.lexer.inlineTokens(e)}}let s=o.slice(2,-2);return{type:"strong",raw:o,text:s,tokens:this.lexer.inlineTokens(s)}}}}codespan(e){if(96!==e.charCodeAt(0))return;let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=e.charCodeAt(0);if(32!==t&&92!==t&&10!==t)return;let n=this.rules.inline.br.exec(e);return n?{type:"br",raw:n[0]}:void 0}del(e,t,n=""){if(126!==e.charCodeAt(0))return;let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n,o,i=[...r[0]].length-1,s=i,a=this.rules.inline.delRDelim,l=ft(this,t),c=t.length-e.length+i;if(l<c)return;t=t.slice(-1*e.length+i);let u=l-c;for(a.lastIndex=0;null!==(r=a.exec(t))&&!(r.index>u);){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n||(o=[...n].length,o!==i))continue;if(r[3]||r[4]){s+=o;continue}if(s-=o,s>0)continue;o=Math.min(o,o+s);let t=[...r[0]][0].length,a=e.slice(0,i+r.index+t+o),l=a.slice(i,-i);return{type:"del",raw:a,text:l,tokens:this.lexer.inlineTokens(l)}}}}autolink(e){if(60!==e.charCodeAt(0))return;let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:e?t[0]:(n=t[0],F.numericCharacterReference.test(n)?n.replace(F.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(void 0===t&&void 0===n)return"&amp;";let r=void 0===t?Number.parseInt(n,16):Number.parseInt(t,10);return 0===r||r>1114111||r>=55296&&r<=57343?"�":38===r?"&amp;":String.fromCodePoint(r)}):n),escaped:e}}var n}},kt=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||j,this.options.tokenizer=this.options.tokenizer||new vt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0,inBlockquote:!1};let t={other:F,block:et.normal,inline:tt.normal};this.options.pedantic?(t.block=et.pedantic,t.inline=tt.pedantic):this.options.gfm&&(t.block=et.gfm,this.options.breaks?t.inline=tt.breaks:t.inline=tt.gfm),this.tokenizer.rules=t}static get rules(){return{block:et,inline:tt}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(F.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.state.inRawBlock=!1,this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this;let r=this.state.lastToken;this.options.pedantic&&(e=e.replace(F.tabCharGlobal," ").replace(F.spaceLine,""));let o,i=1/0,s=this.options.gfm&&!this.options.pedantic&&this.tokenizer.paragraph===vt.prototype.paragraph;for(;e;){if(!(e.length<i)){this.infiniteLoopError(e.charCodeAt(0));break}let r;if(i=e.length,this.state.lastToken=t.at(-1),this.options.extensions?.block?.some(n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.raw,this.inlineQueue.at(-1).src=n.text):(this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}),t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let a=e;if(this.options.extensions?.startBlock){let t,n=1/0,r=e.slice(1);this.options.extensions.startBlock.forEach(e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(a=e.substring(0,n+1))}if(this.state.top&&(r=this.tokenizer.paragraph(a))){let i=t.at(-1);(n||i===o&&s)&&"paragraph"===i?.type?(i.raw+=(i.raw.endsWith("\n")?"":"\n")+r.raw,i.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text,o=i):(t.push(r),o=r),n=a.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,this.state.lastToken=r,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes("["))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&"!"!==e.charAt(n.index-1))return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf("[");if("!"!==e.charAt(0)&&Object.hasOwn(this.tokens.links,ct(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=e.includes(")");try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e.includes("*")||e.includes("_")||e.includes("~"),r=n||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==vt.prototype.emStrong||this.tokenizer.del!==vt.prototype.del?this.#t(e):e;if(!n)return this.#n(e,r,t);!function(e,t){let n=pt(t),r=dt.get(e);r?r.push(n):dt.set(e,[n])}(this.tokenizer,r);try{return this.#n(e,r,t)}finally{!function(e){let t=dt.get(e);t&&(t.pop(),0===t.length&&dt.delete(e))}(this.tokenizer)}}#n(e,t,n){let r=!1,o="",i=1/0;for(;e;){if(!(e.length<i)){this.infiniteLoopError(e.charCodeAt(0));break}let s;if(i=e.length,r||(o=""),r=!1,this.options.extensions?.inline?.some(t=>!!(s=t.call({lexer:this},e,n))&&(e=e.substring(s.raw.length),n.push(s),!0)))continue;if(s=this.tokenizer.escape(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.tag(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.link(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(s.raw.length);let t=n.at(-1);"text"===s.type&&"text"===t?.type?(t.raw+=s.raw,t.text+=s.text):n.push(s);continue}let a=e[0];if("*"===a||"_"===a){let i=t.length-e.length;if(ht(this.tokenizer,t,a)<=i){let t=1;for(;t<e.length&&e.charCodeAt(t)===a.charCodeAt(0);)t++;let i=e.substring(0,t),s=n.at(-1);"text"!==s?.type||s.escaped?n.push({type:"text",raw:i,text:i,escaped:!1}):(s.raw+=i,s.text+=i),e=e.substring(t),o=a,r=!0;continue}}else if("~"===a){let i=t.length-e.length;if(ft(this.tokenizer,t)<=i){let t=1;for(;t<e.length&&126===e.charCodeAt(t);)t++;let i=e.substring(0,t),s=n.at(-1);"text"!==s?.type||s.escaped?n.push({type:"text",raw:i,text:i,escaped:!1}):(s.raw+=i,s.text+=i),e=e.substring(t),o=a,r=!0;continue}}if(s=this.tokenizer.emStrong(e,t,o)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.codespan(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.br(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.del(e,t,o)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.autolink(e)){e=e.substring(s.raw.length),n.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(e))){e=e.substring(s.raw.length),n.push(s);continue}let l=e;if(this.options.extensions?.startInline){let t,n=1/0,r=e.slice(1);this.options.extensions.startInline.forEach(e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(l=e.substring(0,n+1))}if(s=this.tokenizer.inlineText(l)){e=e.substring(s.raw.length),"_"!==s.raw.slice(-1)&&(o=s.raw.slice(-1)),r=!0;let t=n.at(-1);"text"===t?.type?(t.raw+=s.raw,t.text+=s.text):n.push(s);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}#r(e){let t,{blockSkip:n,tag:r,autolink:o}=this.tokenizer.rules.inline,i="",s=0;for(n.lastIndex=0;t=n.exec(e);){let a=t.index+(t[2]?t[2].length:0),l=t.index+t[0].length;if("<"===e.charAt(a)){let t=e.slice(a),i=r.exec(t)||o.exec(t);if(!i){n.lastIndex=a+1;continue}l=a+i[0].length,n.lastIndex=l}i+=e.slice(s,a)+"["+"a".repeat(l-a-2)+"]",s=l}return i+e.slice(s)}#t(e){let t=e;if(this.tokens.links&&e.includes("[")){let e=this.tokenizer.rules.inline.reflinkSearch,n=t=>{let r=t.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,ct(t.slice(r+1,-1))))return t;if(r>1&&"!"!==t.charAt(0)){let o=t.slice(1,r-1);if(this.linkInText(o))return"["+o.replace(e,n)+"]["+"a".repeat(t.length-r-2)+"]"}return"["+"a".repeat(t.length-2)+"]"};t=t.replace(e,n)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?"+".repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,"+")+t:e),t=this.#r(t),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(!this.options.silent)throw new Error(t);console.error(t)}};function xt(e){return e.map(e=>"codespan"===e.type||"escape"===e.type?{...e,text:ot(e.text,!0)}:"tokens"in e&&e.tokens?{...e,tokens:xt(e.tokens)}:e)}var $t=class{options;parser;constructor(e){this.options=e||j}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(F.notSpaceStart)?.[0],o=e?e.replace(F.endingNewline,"")+"\n":"";return r?'<pre><code class="language-'+ot(r)+'">'+(n?o:ot(o,!0))+"</code></pre>\n":"<pre><code>"+(n?o:ot(o,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){let t=e.ordered,n=e.start,r="";for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let o=t?"ol":"ul";return"<"+o+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+o+">\n"}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r="";for(let t=0;t<e.rows.length;t++){let o=e.rows[t];n="";for(let e=0;e<o.length;e++)n+=this.tablecell(o[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${ot(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:o}){let i=o?ot(n,!0):this.parser.parseInline(r),s=it(e);if(null===s)return i;let a='<a href="'+(e=ot(s,o))+'"';return t&&(a+=' title="'+ot(t)+'"'),a+=">"+i+"</a>",a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(xt(r),this.parser.textRenderer));let o=it(e);if(null===o)return ot(n);let i=`<img src="${ot(e=o)}" alt="${ot(n)}"`;return t&&(i+=` title="${ot(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:ot(e.text)}},Et=class{parser;strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return"\n"}checkbox({raw:e}){return e}},St=class e{options;renderer;textRenderer;constructor(e){this.options=e||j,this.options.renderer=this.options.renderer||new $t,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Et,this.textRenderer.parser=this}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t="";for(let n=0;n<e.length;n++){let r=e[n],o=this.options.extensions?.renderers;if(o&&Object.hasOwn(o,r.type)&&o[r.type]){let e=r,n=o[e.type].call({parser:this},e);if(!1!==n||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(e.type)){t+=!1===n?"":n??"";continue}}let i=r;switch(i.type){case"space":t+=this.renderer.space(i);break;case"hr":t+=this.renderer.hr(i);break;case"heading":t+=this.renderer.heading(i);break;case"code":t+=this.renderer.code(i);break;case"table":t+=this.renderer.table(i);break;case"blockquote":t+=this.renderer.blockquote(i);break;case"list":t+=this.renderer.list(i);break;case"checkbox":t+=this.renderer.checkbox(i);break;case"html":t+=this.renderer.html(i);break;case"def":t+=this.renderer.def(i);break;case"paragraph":t+=this.renderer.paragraph(i);break;case"text":t+=this.renderer.text(i);break;default:{let e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let o=e[r],i=this.options.extensions?.renderers;if(i&&Object.hasOwn(i,o.type)&&i[o.type]){let e=i[o.type].call({parser:this},o);if(!1!==e||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(o.type)){n+=!1===e?"":e??"";continue}}let s=o;switch(s.type){case"escape":case"text":n+=t.text(s);break;case"html":n+=t.html(s);break;case"link":n+=t.link(s);break;case"image":n+=t.image(s);break;case"checkbox":n+=t.checkbox(s);break;case"strong":n+=t.strong(s);break;case"em":n+=t.em(s);break;case"codespan":n+=t.codespan(s);break;case"br":n+=t.br(s);break;case"del":n+=t.del(s);break;default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}},_t=class{options;block;constructor(e){this.options=e||j}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?kt.lex:kt.lexInline}provideParser(e=this.block){return e?St.parse:St.parseInline}};function Ct(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var At=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=St;Renderer=$t;TextRenderer=Et;Lexer=kt;Tokenizer=vt;Hooks=_t;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(Ct(n,t.call(this,r)),r.type){case"table":{let e=r;for(let r of e.header)Ct(n,this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)Ct(n,this.walkTokens(e.tokens,t));break}case"list":{let e=r;Ct(n,this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{if(e[r]){let o=e[r].flat(1/0);Ct(n,this.walkTokens(o,t))}}):e.tokens&&Ct(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){let 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("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");let n=t[e.level];n?n.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]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new $t(this.defaults);for(let n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let r=n,o=e.renderer[r],i=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),!1===n?"":n??""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new vt(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let r=n,o=e.tokenizer[r],i=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new _t;for(let n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let r=n,o=e.hooks[r],i=t[r];_t.passThroughHooks.has(n)?t[r]=e=>{if(t.options.async&&_t.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await o.call(t,e);return i.call(t,n)})();let r=o.call(t,e);return i.call(t,r)}:t[r]=(...e)=>{if(t.options.async)return(async()=>{let n=await o.apply(t,e);return!1===n&&(n=await i.apply(t,e)),n})();let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return Ct(n,r.call(this,e)),t&&Ct(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return kt.lex(e,t??this.defaults)}parser(e,t){return St.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},o={...this.defaults,...r},i=this.onError(!!o.silent,!!o.async);if(!0===this.defaults.async&&!1===r.async)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=e),o.async)return(async()=>{let n=o.hooks?await o.hooks.preprocess(t):t,r=await(o.hooks?await o.hooks.provideLexer(e):e?kt.lex:kt.lexInline)(n,o),i=o.hooks?await o.hooks.processAllTokens(r):r;o.walkTokens&&await Promise.all(this.walkTokens(i,o.walkTokens));let s=await(o.hooks?await o.hooks.provideParser(e):e?St.parse:St.parseInline)(i,o);return o.hooks?await o.hooks.postprocess(s):s})().catch(i);try{o.hooks&&(t=o.hooks.preprocess(t));let n=(o.hooks?o.hooks.provideLexer(e):e?kt.lex:kt.lexInline)(t,o);o.hooks&&(n=o.hooks.processAllTokens(n)),o.walkTokens&&this.walkTokens(n,o.walkTokens);let r=(o.hooks?o.hooks.provideParser(e):e?St.parse:St.parseInline)(n,o);return o.hooks&&(r=o.hooks.postprocess(r)),r}catch(e){return i(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="<p>An error occurred:</p><pre>"+ot(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Lt(e,t){return At.parse(e,t)}function Rt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}Lt.options=Lt.setOptions=function(e){return At.setOptions(e),Lt.defaults=At.defaults,D(Lt.defaults),Lt},Lt.getDefaults=I,Lt.defaults=j,Lt.use=function(...e){return At.use(...e),Lt.defaults=At.defaults,D(Lt.defaults),Lt},Lt.walkTokens=function(e,t){return At.walkTokens(e,t)},Lt.parseInline=At.parseInline,Lt.Parser=St,Lt.parser=St.parse,Lt.Renderer=$t,Lt.TextRenderer=Et,Lt.Lexer=kt,Lt.lexer=kt.lex,Lt.Tokenizer=vt,Lt.Hooks=_t,Lt.parse=Lt,Lt.options,Lt.setOptions,Lt.walkTokens,Lt.parseInline,St.parse,kt.lex;var Tt,Pt={exports:{}};var Ot,Nt=(Tt||(Tt=1,Ot=Pt,function(e,t){Ot.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(t[0],function(n,r){var o,i,a=(o=t[1],i=arguments,o.replace(/\$(\d{1,2})/g,function(e,t){return i[t]||""}));return s(""===n?e[r-1]:n,a)})}function l(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var o=r.length;o--;){var i=r[o];if(i[0].test(t))return a(t,i)}return t}function c(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?s(r,o):e.hasOwnProperty(o)?s(r,e[o]):l(o,r,n)}}function u(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&l(o,o,n)===o}}function d(e,t,n){return(n?t+" ":"")+(1===t?d.singular(e):d.plural(e))}return d.plural=c(o,r,e),d.isPlural=u(o,r,e),d.singular=c(r,o,t),d.isSingular=u(r,o,t),d.addPluralRule=function(t,n){e.push([i(t),n])},d.addSingularRule=function(e,n){t.push([i(e),n])},d.addUncountableRule=function(e){"string"!=typeof e?(d.addPluralRule(e,"$0"),d.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},d.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 d.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 d.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 d.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(d.addUncountableRule),d})),Pt.exports),It=Rt(Nt),jt=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 k=m-g,x=b-y,$=-1;if(k<x){if(-1<($=a(n,y,b,t,g,m,u)))return o(d,e,n,y,$,d(t[g],0)),o(d,e,n,$+k,b,l(d,t,m,f,h)),n}else if(x<k&&-1<($=a(t,g,m,n,y,b,u)))return c(d,t,g,$),c(d,t,$+x,m),n;return k<2||x<2?(o(d,e,n,y,b,d(t[g],0)),c(d,t,g,m)):k==x&&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,k=w.oldi;v<n;)y[--c]=1,--n;for(;k<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,x,t,g,m,k,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 k(e,t){var n="_"+e+"$";return{get:function(){return this[n]||x(this,n,t.call(this,e))},set:function(e){x(this,n,e)}}}var x=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={},R={},T=[],P=R.hasOwnProperty,O=0,N={attributes:L,define:function(e,t){e.indexOf("-")<0?(e in R||(O=T.push(e)),R[e]=t):L[e]=t},invoke:function(e,t){for(var n=0;n<O;n++){var r=T[n];if(P.call(e,r))return R[r](e[r],t)}}},I=Array.isArray||(E=($={}.toString).call([]),function(e){return $.call(e)===E}),j=(S=e,_="fragment",A="content"in z(C="template")?function(e){var t=z(C);return t.innerHTML=e,t.content}:function(e){var t,n=z(_),r=z(C);return D(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(_),n=z("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",D(t,n.firstChild.childNodes),t}:A)(e)});function D(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function z(e){return e===_?S.createDocumentFragment():S.createElementNS("http://www.w3.org/1999/xhtml",e)}var M,q,H,B,F,U,W,G,V,Z=(q="appendChild",H="cloneNode",B="createTextNode",U=(F="importNode")in(M=e),(W=M.createDocumentFragment())[q](M[B]("g")),W[q](M[B]("")),(U?M[F](W,!0):W[H](!0)).childNodes.length<2?function e(t,n){for(var r=t[H](),o=t.childNodes||[],i=o.length,s=0;n&&s<i;s++)r[q](e(o[s],n));return r}:U?M[F]:function(e,t){return e[H](!!t)}),K="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},Y="-"+Math.random().toFixed(6)+"%",X=!1;try{G=e.createElement("template"),V="tabindex","content"in G&&(G.innerHTML="<p "+V+'="'+Y+'"></p>',G.content.childNodes[0].getAttribute(V)==Y)||(Y="_dt: "+Y.slice(1,-1)+";",X=!0)}catch(u){}var Q="\x3c!--"+Y+"--\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||'"')+Y+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+"></"+t+">"}var pe=X?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort(function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1})}:function(e,t){return t.slice.call(e,0)};function 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===Y;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)&&X&&!("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 k=e.createElement(v);for(u=s.length,d=0;d<u;)k.setAttributeNode(s[d++].cloneNode(!0));k.textContent=t.textContent,t.parentNode.replaceChild(k,t)}}(l,n,r,c),he(l,n,r,c);break;case 8:var u=l.textContent;if(u===Y)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)&&K.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===K.call(r.textContent).length&&e.removeChild(r)}}var ke,xe,$e=(ke=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,xe=/([^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 Ee(e,t,n){return t+"-"+n.toLowerCase()}function Se(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])||ke.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(xe,Ee),":",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 _e,Ce,Ae=(_e=[].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=_e.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Re(e){return{html:e}}function Te(e,t){switch(e.nodeType){case He:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case qe:return Te(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(Re).then(t):Promise.resolve(N.invoke(e,t)).then(t)}function Oe(e){return null!=e&&"then"in e}var Ne,Ie,je,De,ze,Me="ownerSVGElement",qe=v.prototype.nodeType,He=Ae.prototype.nodeType,Be=(Ie=(Ne={Event:b,WeakSet:u}).Event,je=Ne.WeakSet,De=!0,ze=null,function(e){return De&&(De=!De,ze=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 Ie(t),s=e.length,a=0;a<s;1===(o=e[a++]).nodeType&&function e(t,n,r,o,i){ze.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)),ze.add(e),e}),Fe=/^(?:form|list)$/i,Ue=[].slice;function We(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(Z.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ge=!(We.prototype={attribute:function(e,t,n){var r,o=Me 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&&!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 N.attributes)return function(n){var o=N.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:Te,before:e},o=Me 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,I(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(I(a[0])&&(a=a.concat.apply([],a)),Oe(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?Ue.call(a.childNodes):[a],r):Oe(a)?a.then(s):"placeholder"in a?Pe(a,s):"text"in a?s(String(a.text)):"any"in a?s(a.any):"html"in a?t=f(e.parentNode,t,Ue.call(j([].concat(a.html).join(""),o).childNodes),r):s("length"in a?Ue.call(a):N.invoke(a,s))}var l}},text:function(e){var t;return function n(r){var o;t!==r&&("object"==(o=typeof(t=r))&&r?Oe(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?Ue.call(r).join(""):N.invoke(r,n)):"function"==o?n(r(e)):e.textContent=null==r?"":r)}}}),Ve=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)},Ve=l?i:(s=new n,function(e){return s.get(e)||(n=i(t=e),s.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 Ye=new n,Xe=function(e){var t,n,r;return function(){var o=Ke.apply(null,arguments);return r!==o[0]?(r=o[0],n=new We(e),t=Je(n.apply(n,o))):n.apply(n,o),t}},Qe=function(e,t){var n=t.indexOf(":"),r=Ye.get(e),o=t;return-1<n&&(o=t.slice(n+1),t=t.slice(0,n)||"html"),r||Ye.set(e,r={}),r[o]||(r[o]=Xe(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=Ke.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new We(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,ot,it,st=N.define,at=We.prototype;function lt(e){return arguments.length<2?null==e?Xe("html"):"string"==typeof e?lt.wire(null,e):"raw"in e?Xe("html")(e):"nodeType"in e?lt.bind(e):Qe(e,"html"):("raw"in e?Xe("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?Xe(t||"html"):Qe(e,t||"html")},lt._={WeakMap:n,WeakSet:u},nt=Xe,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:k("html",nt),svg:k("svg",nt),state:k("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);const{Component:Dt,bind:zt,define:Mt,diff:qt,hyper:Ht,wire:Bt}=jt,Ft=jt,Ut=L,Wt=Lt,Gt=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(e=e.trim(),!e)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(P.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",N(i,r,o),r="";continue}o="string"==typeof o?o+l:l;break;case"collect-quoted-string":if('"'===l){N(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&&N(i,r,o);if(""===t.trim()||!T.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!T.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?T.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},Vt=It,Zt=/['\u2019]s$/,Kt=/-/g,Yt=RegExp.escape??(e=>e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")),Xt=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Qt="en"===r||r.startsWith("en-")?"en-AU":r,Jt=new Intl.DateTimeFormat(Qt,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===Qt?"2-digit":"numeric"});function en(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 tn(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach(e=>{e.remove()})}function nn(e,t="long"){const n=new Intl.ListFormat(r,{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 rn=nn("conjunction"),on=nn("disjunction");function sn(e,t){return rn(e,t).join("")}function an(e){return e.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}function ln(e){return e.trim().replace(/\s+/g," ")}function cn(e,t=r){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const o=function(e,t,n=r){n=n.toLowerCase();const o=n.match(/^(\w{2,3})-.+$/)?.[1]??"";return e[n]?.[t]||e[o]?.[t]}(e,n,t)||e.en[n];if(!o)throw new Error(`No l10n data for key: "${n}"`);return o}})}function un(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){_n(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace.",cause:e})}}}return e}function dn(e,t=e=>e){const n=e.map(t),r=n.slice(0,-1).map(e=>Ft`${e}, `);return Ft`${r}${n[n.length-1]}`}function pn(e,t=!1){return(t?e:e.toLowerCase()).trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,"")}function hn(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let o=pn(n,r);if(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 fn(e){const t=new Set,n="ltNodefault"in e.dataset?"":ln(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map(e=>ln(e)).forEach(e=>t.add(e)):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r&&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(ln(e)))}return[...t]}function mn(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 gn(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 bn(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function yn(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 wn 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)??e)}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find(t=>t.toLowerCase()===e.toLowerCase())}}function vn(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach(e=>e.removeAttribute("id")),t.querySelectorAll("dfn").forEach(e=>{mn(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 En extends Error{constructor(e,t,n){super(e,{...n.cause&&{cause:n.cause}});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||hn(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,...this.cause instanceof Error&&{cause:{name:this.cause.name,message:this.cause.message,stack:this.cause.stack}}}}}function Sn(e,t,n={}){const r={...n,isWarning:!1};On("error",new En(e,t,r))}function _n(e,t,n={}){const r={...n,isWarning:!0};On("warn",new En(e,t,r))}function Cn(e){return{amendConfiguration:e=>On("amend-user-config",e),showError:(t,n)=>Sn(t,e,n),showWarning:(t,n)=>_n(t,e,n)}}function An(e){return e?`\`${e}\``:""}function Ln(e,{quotes:t}={quotes:!1}){return on(e,t?e=>{return An((t=e,String(t)?`"${t}"`:""));var t}:An).join("")}function Rn(e,...t){return Tn(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(""))}function Tn(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")}const Pn=new EventTarget;function On(e,t){if(Pn.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const n=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:n},window.parent.location.origin)}function Nn(e,t,n={once:!1}){Pn.addEventListener(e,async n=>{try{await t(n.detail)}catch(t){const n=t;Sn(`Error in handler for topic "${e}": ${n.message}`,`sub:${e}`,{cause:n})}},n)}const In=["githubToken","githubUser"];const jn=new Map([["text/html","html"],["application/xml","xml"]]);function Dn(e,t=document){const n=jn.get(e);if(!n){const t=[...jn.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=zn(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function zn(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;kn(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach(e=>e.remove()),n.classList.remove("toc-sidebar","toc-inline"),tn(r);const o=e.createDocumentFragment(),i=e.querySelector("meta[name='viewport']");i&&t.firstChild!==i&&o.appendChild(i);const s=e.querySelector("meta[charset], meta[content*='charset=']")||Ft`<meta charset="utf-8" />`;o.appendChild(s);const a=`ReSpec ${window.respecVersion||"Developer Channel"}`,l=Ft`
2
- <meta name="generator" content="${a}" />
3
- `;o.appendChild(l),t.prepend(o),On("beforesave",r)}(n);let r="";if("xml"===e)r=(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&&(r+=(new XMLSerializer).serializeToString(n.doctype)),r+=n.documentElement.outerHTML;return r}async function Mn(t){const n=await fetch(new URL(`../../${t}`,e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-aom.js",document.baseURI).href));return await n.text()}const qn=(e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-aom.js",document.baseURI).href).endsWith("/src/core/worker.js")?new URL("../../builds/respec-highlight.js",e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-aom.js",document.baseURI).href).href:new URL("respec-highlight.js",e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-aom.js",document.baseURI).href).href,Hn=en({hint:"preload",href:qn,as:"script"});async function Bn(){try{return(await Promise.resolve().then(function(){return Ar})).default}catch{return Mn("worker/respec-worker.js")}}async function Fn(){try{const e=await fetch(qn);if(e.ok)return await e.text()}catch{}return null}document.head.appendChild(Hn);const Un=async function(){const[e,t]=await Promise.all([Bn(),Fn()]),n=new Blob([null!==t?`${t}\n`:'self.RESPEC_HIGHLIGHT_URL = "https://www.w3.org/Tools/respec/respec-highlight";\n',e],{type:"application/javascript"});return new Worker(URL.createObjectURL(n))}();class Wn{constructor(){this._respecDonePromise=new Promise(e=>{Nn("end-all",()=>e(),{once:!0})}),this.errors=[],this.warnings=[],Nn("error",e=>{console.error(e,e.toJSON()),this.errors.push(e)}),Nn("warn",e=>{console.warn(e,e.toJSON()),this.warnings.push(e)})}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}get worker(){return Un}async toHTML(){return zn("html",document)}}const Gn="core/post-process";function Vn(e,t){return new Promise((n,r)=>{const o=setTimeout(()=>{r(new Error(`${t} timed out.`))},15e3);Promise.resolve(e).then(n,r).finally(()=>{clearTimeout(o)})})}const Zn="core/pre-process";const Kn="core/base-runner";async function Yn(e){!function(){const e=new Wn;Object.defineProperty(document,"respec",{value:e})}(),On("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),Nn("amend-user-config",n),Nn("end-all",()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of In)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)})}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).filter(([e,t])=>!!e&&!!t).map(([e,t])=>{const n=decodeURIComponent(e),r=decodeURIComponent(t.replace(/%3D/g,"="));let o;try{o=JSON.parse(r)}catch{o=r}return[n,o]}),r=Object.fromEntries(n);Object.assign(e,r),On("amend-user-config",r)}(respecConfig),performance.mark(`${Kn}-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});for(const[n,r]of t.entries()){const t=`${Zn}/${r.name||`[${n}]`}`,o=Cn(t);try{await new Promise((n,i)=>{const s=setTimeout(()=>{i(new Error(`preProcess function "${t}" timed out.`))},15e3);Promise.resolve().then(()=>r(e,document,o)).then(n,i).finally(()=>{clearTimeout(s)})})}catch(e){Sn(`Function ${t} threw an error during \`preProcess\`.`,Zn,{hint:"See developer console.",cause:e})}}}}(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)),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(void 0)):n.run&&(await n.run(t),r(void 0))}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),On("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.",Gn),t});for(const[n,r]of t.entries()){const t=`${Gn}/${r.name||`[${n}]`}`,o=Cn(t);try{await Vn(r(e,document,o),`postProcess function "${t}"`)}catch(e){Sn(`Function ${t} threw an error during \`postProcess\`.`,Gn,{hint:"See developer console.",cause:e})}}}if("function"==typeof e.afterEnd)try{await Vn(e.afterEnd(e,document),"config.afterEnd")}catch(e){Sn("Function afterEnd threw an error.",Gn,{hint:"See developer console.",cause:e})}}(respecConfig),On("end-all",void 0),tn(document),performance.mark(`${Kn}-end`),performance.measure(Kn,`${Kn}-start`,`${Kn}-end`)}var Xn=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}
1
+ window.respecVersion="37.8.0",function(){"use strict";var e="undefined"!=typeof document?document.currentScript:null;const t=document.documentElement;t?.hasAttribute("lang")||(t.lang="en",t.hasAttribute("dir")||(t.dir="ltr"));const n={},r=t?.lang??"en";var o=Object.freeze({__proto__:null,l10n:n,lang:r,name:"core/l10n",run:function(e){e.l10n=n[r]||n.en}});const i=(e,t)=>t.some(t=>e instanceof t);let a,s;const l=new WeakMap,c=new WeakMap,u=new WeakMap;let d={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return l.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return m(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function p(e){d=e(d)}function h(e){return(s||(s=["advance","continue","continuePrimaryKey"].map(e=>IDBCursor.prototype[e]))).includes(e)?function(...t){return e.apply(g(this),t),m(this.request)}:function(...t){return m(e.apply(g(this),t))}}function f(e){return"function"==typeof e?h(e):(e instanceof IDBTransaction&&function(e){if(l.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",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)});l.set(e,t)}(e),i(e,a||(a=[IDBIndex,IDBObjectStore,IDBCursor,IDBDatabase,IDBTransaction]))?new Proxy(e,d):e)}function m(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(m(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",i)});return u.set(t,e),t}(e);if(c.has(e))return c.get(e);const t=f(e);return Object.is(t,e)||(c.set(e,t),u.set(t,e)),t}const g=e=>u.get(e);const b=["get","getKey","getAll","getAllKeys","count"],y=["put","add","delete","clear"],w={};function v(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(w[t])return w[t];const n=t.replace(/FromIndex$/,""),r=t!==n,o=y.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!b.includes(n))return;return w[t]=async function(e,...t){const i=this.transaction(e,o?"readwrite":"readonly");let a=i.store;return r&&(a=a.index(t.shift())),(await Promise.all([a[n](...t),o&&i.done]))[0]}}p(e=>({...e,get:(t,n,r)=>v(t,n)||e.get(t,n,r),has:(t,n)=>!!v(t,n)||e.has(t,n)}));const k=["advance","continue","continuePrimaryKey"],x={},$=new WeakMap,E=new WeakMap,S={get(e,t){if(!k.includes(t))return e[t];let n=x[t];return n||(n=x[t]=function(...e){$.set(this,E.get(this)[t](...e))}),n}};async function*_(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,S);for(E.set(n,t),u.set(n,g(t));t;)yield n,t=await($.get(n)||t.continue()),$.delete(n)}function C(e,t){return t===Symbol.asyncIterator&&i(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&i(e,[IDBIndex,IDBObjectStore])}p(e=>({...e,get:(t,n,r)=>C(t,n)?_:e.get(t,n,r),has:(t,n)=>C(t,n)||e.has(t,n)}));var A,L=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",e=>t(e.oldVersion,e)),m(n).then(()=>{})},openDB:function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:i}={}){const a=indexedDB.open(e,t),s=m(a);return r&&a.addEventListener("upgradeneeded",e=>{r(m(a.result),e.oldVersion,e.newVersion,m(a.transaction),e)}),n&&a.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),s.then(e=>{i&&e.addEventListener("close",()=>i()),o&&e.addEventListener("versionchange",e=>o(e.oldVersion,e.newVersion,e))}).catch(()=>{}),s},unwrap:g,wrap:m});!function(e){e.ILLEGAL="ILLEGAL",e.EOF="EOF",e.NL="\n",e.SPACE=" ",e.UNDERSCORE="_",e.DOLLAR="$",e.ATSIGN="@",e.CARET="^",e.HASH="#",e.TILDE="~",e.AMPERSAND="&",e.IDENT="IDENT",e.COMMENT="COMMENT",e.STRING="STRING",e.NUMBER="NUMBER",e.FLOAT="FLOAT",e.CTLOP="CTLOP",e.BYTES="BYTES",e.HEX="HEX",e.BASE64="BASE64",e.ASSIGN="=",e.ARROWMAP="=>",e.TCHOICE="/",e.GCHOICE="//",e.TCHOICEALT="/=",e.GCHOICEALT="//=",e.PLUS="+",e.MINUS="-",e.QUEST="?",e.ASTERISK="*",e.INCLRANGE="..",e.EXCLRANGE="...",e.COMMA=",",e.DOT=".",e.COLON=":",e.SEMICOLON=";",e.LPAREN="(",e.RPAREN=")",e.LBRACE="{",e.RBRACE="}",e.LBRACK="[",e.RBRACK="]",e.LT="<",e.GT=">",e.QUOT='"'}(A||(A={}));const R=Object.entries(A).reduce((e,[t,n])=>(e[n]=t,e),{});new class{type;literal;comments;whitespace;constructor(e,t,n=[],r=""){this.type=e,this.literal=t,this.comments=n,this.whitespace=r}serialize(){let e="";for(const t of this.comments)e+=t.serialize();switch(e+=this.whitespace,this.type){case A.IDENT:case A.COMMENT:case A.NUMBER:case A.FLOAT:e+=this.literal;break;case A.STRING:e+='"'+this.literal+'"';break;case A.CTLOP:e+="."+this.literal;break;case A.BYTES:e+="'"+this.literal+"'";break;case A.HEX:e+="h'"+this.literal+"'";break;case A.BASE64:e+="b64'"+this.literal+"'";break;case A.EOF:break;default:e+=this.type.valueOf()}return e}startWithSpaces(){return""!==this.whitespace||this.comments.length>0}toString(e=0){const t=[`${" ".repeat(e)}${this.constructor.name}: ${R[this.type]} (${this.type})`];""!==this.whitespace&&t.push(" ".repeat(e+1)+`whitespaces: ${this.whitespace.length}`),""!==this.literal&&t.push(" ".repeat(e+1)+`literal: ${this.literal}`);for(const n of this.comments)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return{type:this.type,literal:this.literal,comments:this.comments?.map(e=>e.toJSON()),whitespace:this.whitespace}}}(A.ILLEGAL,"");const T=/^[!#$%&'*+-.^`|~\w]+$/,P=/[\u000A\u000D\u0009\u0020]/u,O=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function N(e,t,n){(t&&""!==t&&!e.has(t)&&O.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function I(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var j={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function D(e){j=e}var z={exec:()=>null};function M(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),o=t[r];return o||(o=e(r),t[r]=o),o}}function q(e,t=""){let n="string"==typeof e?e:e.source,r={replace:(e,t)=>{let o="string"==typeof t?t:t.source;return o=o.replace(F.caret,"$1"),n=n.replace(e,o),r},getRegex:()=>new RegExp(n,t)};return r}var H=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),B="^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)",F={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,listInterruptsParagraph:/^ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,textIndentedContinuation:/^(?:\n(?: {4}| {0,3}\t)[ \t]*[^ \t\n][^\n]*)+/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)(\t[ \t]*)/gm,blockquoteFenceOpen:/^ {0,3}(`{3,}(?=[^`]*$)|~{3,})/,blockquoteFenceClose:/^ {0,3}(`{3,}|~{3,})[ \t]*$/,blockquoteListItemStart:/^ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|$)/,nestedBlockMarker:/^ {0,3}(?:(?:[*+-]|\d{1,9}[.)])(?: |$)|> ?)/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\][ \t]+\S/,listReplaceTask:/^\[[ xX]\][ \t]+/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableHeader:new RegExp(B+"(?:\\n|$)"),tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:M(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`)),hrRegex:M(e=>new RegExp(`^ {0,${e}}((?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\\*[ \t]*){3,})(?:\\n+|$)`)),fencesBeginRegex:M(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:M(e=>new RegExp(`^ {0,${e}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:M(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:M(e=>new RegExp(`^ {0,${e}}(?:</?(?:${G})(?:[ \\t]+|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:M(e=>new RegExp(`^ {0,${e}}>`)),nestedContainerMarkers:/^(?: {0,3}(?:(?:[*+-]|\d{1,9}[.)])[ \t]+|>[ \t]?))+/},U=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,W=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,G="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|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",V=q(" {0,3}(?:</?(?:tag)(?:[ \\t]+|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",G).getRegex(),Z=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/,K=q(Z).replace(/bull/g,W).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/\|table/g,"").replace(/html/g,V).getRegex(),Y=q(Z).replace(/bull/g,W).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).replace(/html/g,V).getRegex(),X=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Q=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/,J=q(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<(?:\\.|[^\n<>\\])*>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Q).replace("title",/(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex(),ee=q(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,W).getRegex(),te=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ne=q("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*?[ \\t]*/?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",te).replace("tag",G).replace("attribute",/[ \t]+[a-zA-Z:_][\w.:-]*(?:[ \t]*=[ \t]*"[^"\n]*"|[ \t]*=[ \t]*'[^'\n]*'|[ \t]*=[ \t]*[^\s"'=<>`]+)?/).getRegex(),re=e=>q(X).replace("hr",U).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",e).replace("html",V).getRegex(),oe=re(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),ie=re(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),ae=/ {0,3}> ?(?:(?!blank)(paragraph)|[^\n]*)(?:\n|$)/,se={blockquote:q(/^(first)(?:next)*/).replace("first",q(ae).replace("blank",/[ \t]*(?:\n|$)| {4}/).getRegex()).replace("next",q(ae).replace("blank",/[ \t]*(?:\n|$)/).getRegex()).replace(/paragraph/g,ie).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:J,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*)[ \t]*(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:U,html:ne,lheading:K,list:ee,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:oe,table:z,text:/^[^\n]+/},le=q(B+"(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",U).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",V).getRegex(),ce={...se,lheading:Y,table:le,paragraph:q(X).replace("hr",U).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",F.tableHeader).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html",V).getRegex()},ue={...se,html:q("^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))").replace("comment",te).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:z,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:q(X).replace("hr",U).replace("heading"," *#{1,6} *[^\n]").replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").replace("lheading",K).getRegex()},de=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,pe=/[\p{P}\p{S}]/u,he=/[\s\p{P}\p{S}]/u,fe=/[^\s\p{P}\p{S}]/u,me=q(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,he).getRegex(),ge=/(?!~)[\p{P}\p{S}]/u,be=q(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",H?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ye=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,we=q(ye,"u").replace(/punct/g,pe).getRegex(),ve=q(ye,"u").replace(/punct/g,ge).getRegex(),ke=q(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,"u").replace(/openQuote/g,/[\p{Pi}\p{Ps}"']/u).replace(/punct/g,pe).getRegex(),xe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",$e=q(xe,"gu").replace(/notPunctSpace/g,fe).replace(/punctSpace/g,he).replace(/punct/g,pe).getRegex(),Ee=q(xe,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,ge).getRegex(),Se=q("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,fe).replace(/punctSpace/g,he).replace(/punct/g,pe).getRegex(),_e=q("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,fe).replace(/punctSpace/g,he).replace(/punct/g,pe).getRegex(),Ce=q("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,fe).replace(/punctSpace/g,he).replace(/punct/g,pe).getRegex(),Ae=q(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,pe).getRegex(),Le=q("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,fe).replace(/punctSpace/g,he).replace(/punct/g,pe).getRegex(),Re=q(/\\(punct)/,"gu").replace(/punct/g,pe).getRegex(),Te=q(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,pe).getRegex(),Pe=q(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("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])?)+(?![-_])/).getRegex(),Oe=q(te).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ne=q("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Oe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ie=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,je=q(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",Ie).getRegex(),De=/\\[^ \t\n\x00-\x1f]|\\(?=[ \t\n])|[^ \t\n\x00-\x1f\\()]/,ze=q(/\((?:char)*\)/).replace("char",De).getRegex(),Me=q(/\((?:char|p1)*\)/).replace("char",De).replace("p1",ze).getRegex(),qe=q(/\((?:char|p2)*\)/).replace("char",De).replace("p2",Me).getRegex(),He=q(/(?!<)(?:char|p3)+/).replace("char",De).replace("p3",qe).getRegex(),Be=q(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",je).replace("href",q(/<(?:\\.|[^\n<>\\])*>|bareHref|(?=\))/).replace("bareHref",He).getRegex()).replace("title",/"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex(),Fe=q(/^!?\[(label)\]\[(ref)\]/).replace("label",je).replace("ref",Q).getRegex(),Ue=q(/^!?\[(ref)\](?:\[\])?/).replace("ref",Q).getRegex(),We=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Ge=q(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",Ie).getRegex(),Ve=q("reflink|nolink(?!\\()","g").replace("reflink",q(/^!?\[(label)\]\[(ref)\]/).replace("label",Ge).replace("ref",We).getRegex()).replace("nolink",q(/^!?\[(ref)\](?:\[\])?/).replace("ref",We).getRegex()).getRegex(),Ze=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ke=q(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),Ye={_backpedal:z,anyPunctuation:Re,anyPunctuationOutsideCode:Te,autolink:Pe,blockSkip:be,br:de,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:z,delLDelim:z,delRDelim:z,emStrongLDelim:we,emStrongRDelimAst:$e,emStrongRDelimUnd:_e,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Be,nolink:Ue,punctuation:me,reflink:Fe,reflinkSearch:Ve,tag:Ne,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:z},Xe={...Ye,emStrongLDelim:ke,emStrongRDelimAst:Se,emStrongRDelimUnd:Ce,link:q(/^!?\[(label)\]\((.*?)\)/).replace("label",je).getRegex(),reflink:q(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",je).getRegex()},Qe={...Ye,emStrongRDelimAst:Ee,emStrongLDelim:ve,delLDelim:Ae,delRDelim:Le,url:q(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",Ke).replace("protocol",Ze).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:q(/^(?:[A-Za-z0-9.+-]+(?=@)|[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",Ze).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace("wwwStart",H?"(?<![^\\s*_~(])www\\.":"www\\.").getRegex()},Je={...Qe,br:q(de).replace("{2,}","*").getRegex(),text:q(Qe.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},et={normal:se,gfm:ce,pedantic:ue},tt={normal:Ye,gfm:Qe,breaks:Je,pedantic:Xe},nt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},rt=e=>nt[e];function ot(e,t){if(t){if(F.escapeTest.test(e))return e.replace(F.escapeReplace,rt)}else if(F.escapeTestNoEncode.test(e))return e.replace(F.escapeReplaceNoEncode,rt);return e}function it(e){try{e=encodeURI(e).replace(F.percentDecode,"%")}catch{return null}return e}function at(e,t){let n=e.replace(F.findPipe,(e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"}).split(F.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(F.slashPipe,"|");return n}function st(e,t,n){let r=e.length;if(0===r)return"";let o=0;for(;o<r;){if(e.charAt(r-o-1)!==t)break;o++}return e.slice(0,r-o)}function lt(e){let t=e.split("\n"),n=t.length-1;for(;n>=0&&F.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join("\n")}function ct(e){return e.trim().replace(F.multipleSpaceGlobal," ").toLowerCase().toUpperCase().toLowerCase()}function ut(e,t){if(-1===e.indexOf(t[0])&&-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}var dt=new WeakMap;function pt(e){let t={"*":-1,_:-1},n=-1,r=e.length;for(let o=0;o<r;o++){let i=e[o];if("*"!==i&&"_"!==i&&"~"!==i)continue;let a=0===o?"\n":e[o-1],s=o+1;for(;s<r&&e[s]===i;)s++;" "!==a&&"\t"!==a&&"\n"!==a&&"\r"!==a&&"\f"!==a&&("~"===i?n=o:t[i]=o),o=s-1}return{maskedSrc:e,lastPossibleEmStrongCloserIndex:t,lastPossibleDelCloserIndex:n}}function ht(e,t,n){let r=dt.get(e)?.at(-1);return r&&r.maskedSrc===t?r.lastPossibleEmStrongCloserIndex[n]:pt(t).lastPossibleEmStrongCloserIndex[n]}function ft(e,t){let n=dt.get(e)?.at(-1);return n&&n.maskedSrc===t?n.lastPossibleDelCloserIndex:pt(t).lastPossibleDelCloserIndex}function mt(e,t=0){let n=t,r="";for(let t of e)if("\t"===t){let e=4-n%4;r+=" ".repeat(e),n+=e}else r+=t,n++;return r}function gt(e){let t,n=!1;return e.map(e=>{if(n)return e;let{depth:r,expanded:o,keptIndent:i,content:a}=function(e,t){let n=0,r=0,o=0,i=0,a="";for(;o<t;){let t=n,s=r;for(;" "===e[t]||"\t"===e[t];)s+=bt(e[t],s),t++;if(">"!==e[t]||s-i>3)break;a+=" ".repeat(s-r)+">",o++,n=t+1,r=s+1,i=" "===e[n]||"\t"===e[n]?r+1:r}if(0===o)return{depth:o,expanded:e,keptIndent:e,content:e};let s="",l="";for(;(" "===e[n]||"\t"===e[n])&&r<i+4;){let t=bt(e[n],r);s+=" ".repeat(t),l+=r<i&&t>1?" ".repeat(t):e[n],r+=t,n++}let c=e.slice(n);return{depth:o,expanded:a+s+c,keptIndent:a+l+c,content:" ".repeat(Math.max(0,r-i))+c}}(e,t?.depth??1/0);if(t?.depth!==r&&(t=void 0),t){let e=F.blockquoteFenceClose.exec(a)?.[1];return!e||e[0]!==t.marker[0]||e.length<t.marker.length?i:(t=void 0,o)}if(n=F.blockquoteListItemStart.test(a),n)return e;let s=F.blockquoteFenceOpen.exec(a)?.[1];return s&&(t={marker:s,depth:r}),o}).join("\n")}function bt(e,t){return"\t"===e?4-t%4:1}function yt(e,t,n,r,o){let i=t.href,a=t.title||null,s=function(e,t){let n="";for(let r=0;r<e.length;r++){if("`"===e[r]){let o=t.inline.code.exec(e.slice(r));if(o){n+=o[0],r+=o[0].length-1;continue}}"\\"!==e[r]||"["!==e[r+1]&&"]"!==e[r+1]?n+=e[r]:(n+=e[r+1],r++)}return n}(e[1],o),l="!"===e[0].charAt(0),c=r.state.inLink,u=r.state.linkEmitted,d=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let p=r.inlineTokens(s),h=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=c,!l){if(h)return void(r.state.inRawBlock=d);r.state.linkEmitted=!0}return{type:l?"image":"link",raw:n,href:i,title:a,text:s,tokens:p}}function wt(e,t,n,r){if(!t.includes("<"))return!1;for(let o=0;o<t.length;o++){if("\\"===t[o]){o++;continue}if("`"===t[o]){let e=r.inline.code.exec(t.slice(o));if(e){o+=e[0].length-1;continue}}if("<"!==t[o])continue;let i=e.slice(n+o),a=r.inline.tag.exec(i)||r.inline.autolink.exec(i);if(a){if(a[0].length>t.length-o)return!0;o+=a[0].length-1}}return!1}var vt=class{options;rules;lexer;constructor(e){this.options=e||j}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:lt(t[0]),n=e.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e,codeBlockStyle:"indented",text:n}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(null===r)return t;let o=r[1];return t.split("\n").map(e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[r]=t;return e.slice(Math.min(r.length,o.length))}).join("\n")}(e,t[3]||"",this.rules);return void 0!==t[3]&&(""===n||n.endsWith("\n"))&&(n+="\n"),{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=st(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:"heading",raw:st(t[0],"\n"),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:st(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=st(t[0],"\n").split("\n"),n="",r="",o=[];for(;e.length>0;){let t,i=!1,a=[];for(t=0;t<e.length;t++)if(this.rules.other.blockquoteStart.test(e[t]))a.push(e[t]),i=!0;else{if(i)break;a.push(e[t])}e=e.slice(t);let s=a.join("\n"),l=(this.lexer.state.top&&!this.lexer.state.inBlockquote&&s.includes("\t")?gt(a):s).replace(this.rules.other.blockquoteMarkerWhitespace,(e,t,n)=>n.startsWith(" ")?t+" "+n.slice(1):t+mt(n,t.length)).replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${s}`:s,r=r?`${r}\n${l}`:l;let c=this.lexer.state.top,u=this.lexer.state.inBlockquote;if(this.lexer.state.top=!0,this.lexer.state.inBlockquote=!0,this.lexer.blockTokens(l,o,!0),this.lexer.state.top=c,this.lexer.state.inBlockquote=u,0===e.length)break;let d=o.at(-1);if("code"===d?.type||"heading"===d?.type||"hr"===d?.type||"html"===d?.type||"table"===d?.type)break;if("blockquote"===d?.type){let t=d,i=e.join("\n"),a=t.raw+"\n"+i.replace(this.rules.other.blockquoteSetextReplace2,"");this.lexer.state.inBlockquote=!0;let s=this.blockquote(a);this.lexer.state.inBlockquote=u,o[o.length-1]=s;let l=a.substring(s.raw.length).replace(/^\n/,""),c=l?l.split("\n").length:0,p=c?e.slice(0,-c):e;if(p.length>0&&(n=`${n}\n${p.join("\n")}`),r=r.substring(0,r.length-t.text.length)+s.text,e=e.slice(p.length),e.length>0&&this.rules.other.blockquoteStart.test(e[0]))continue;break}if("list"===d?.type){let t=d,i=t.raw+"\n"+e.join("\n"),a=this.list(i);o[o.length-1]=a;let s=a.raw.length>t.raw.length?i.slice(t.raw.length+1,a.raw.length).split("\n").length:0;if(s>0){let t=e.slice(0,s).join("\n");n=`${n}\n${t}`,r=`${r}\n${t}`}if(e=e.slice(s),e.length>0&&!this.rules.other.blockquoteStart.test(e[0]))break;continue}}return{type:"blockquote",raw:n,tokens:o,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){if(!this.options.pedantic&&"text"===this.lexer.state.lastToken?.type&&!this.rules.other.listInterruptsParagraph.test(e))return;let n=e,r=()=>n.length-e.length,o=t[1].trim(),i=o.length>1,a={type:"list",raw:"",ordered:i,start:i?+o.slice(0,-1):"",loose:!1,items:[]};o=i?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`,this.options.pedantic&&(o=i?o:"[*+-]");let s=this.rules.other.listItemRegex(o),l=!1;for(;e;){let o=!1,i="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;let c=r();e=e.substring(t[0].length);let u=t[2].split("\n",1)[0],d=t[1].length,p=this.options.pedantic?mt(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>mt(e,d)),h=e.split("\n",1)[0],f=!p.trim(),m=0;if(this.options.pedantic?(m=2,i=p.trimStart()):f?m=d+1:(m=p.search(this.rules.other.nonSpaceChar),m=m>4?1:m,i=p.slice(m),m+=d),f&&this.rules.other.blankLine.test(h)&&(e=e.substring(h.length+1),o=!0),!o){let t=this.rules.other.nextBulletRegex(m),n=this.rules.other.hrRegex(m),r=this.rules.other.fencesBeginRegex(m),o=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(m):this.rules.other.headingBeginRegex(m),a=this.rules.other.htmlBeginRegex(m),s=this.rules.other.blockquoteBeginRegex(m),l=!1;for(;e;){let c,u=e.split("\n",1)[0];if(h=u,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),c=h):c=h.replace(this.rules.other.leadingSpaceTab,e=>mt(e)),r.test(h)||o.test(h)||a.test(h)||s.test(h)||t.test(h)||n.test(h))break;if(c.search(this.rules.other.nonSpaceChar)>=m||!h.trim())i+="\n"+c.slice(m),l=!1;else{if(f)break;let e=p;if(!this.options.pedantic&&!i.includes("\n")&&!p.includes("\t")){let t;for(;!n.test(e)&&(t=this.rules.other.nestedBlockMarker.exec(e));)e=e.slice(t[0].length);if(!e.trim())break}if(e.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||r.test(e)||o.test(e)||a.test(e)||n.test(e))break;if(!this.options.pedantic&&!l){let e=p.replace(this.rules.other.nestedContainerMarkers,"");if(this.rules.block.fences.test(e)||this.rules.block.heading.test(e)||this.rules.block.hr.test(e))break}i+="\n"+(!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(h)&&this.rules.block.lheading.test(`${p}\n${h}`)?` ${c.replace(/^ {0,3}/,"")}`:h),l=!0}f=!h.trim(),e=e.substring(u.length+1),p=c.slice(m)}}let g=n.slice(c,r());a.loose||(l?a.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(l=!0)),a.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(i),loose:!1,text:i,tokens:[]})}let c=a.items.at(-1);if(!c)return;c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd(),a.raw=n.slice(0,r()).trimEnd();let u=[];for(let e of a.items)if(this.lexer.state.top=!1,u.push(this.lexer.inlineQueue.length),e.tokens=this.lexer.blockTokens(e.text,[]),!a.loose){let t=e.tokens.filter(e=>"space"===e.type),n=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw));a.loose=n}for(let e=0;e<a.items.length;e++){let t=a.items[e],n=t.tokens[0];if(!t.task||"text"!==n?.type&&"paragraph"!==n?.type)t.task&&(t.task=!1);else{t.text=t.text.replace(this.rules.other.listReplaceTask,""),n.raw=n.raw.replace(this.rules.other.listReplaceTask,""),n.text=n.text.replace(this.rules.other.listReplaceTask,"");let r=this.lexer.inlineQueue;for(let t=u[e];t<r.length;t++)if(r[t].tokens===n.tokens){r[t].src=r[t].src.replace(this.rules.other.listReplaceTask,"");break}let o=this.rules.other.listTaskCheckbox.exec(t.raw);if(o){let e={type:"checkbox",raw:o[0]+" ",checked:"[ ]"!==o[0]};t.checked=e.checked,a.loose?t.tokens[0]&&["paragraph","text"].includes(t.tokens[0].type)&&"tokens"in t.tokens[0]&&t.tokens[0].tokens?(t.tokens[0].raw=e.raw+t.tokens[0].raw,t.tokens[0].text=e.raw+t.tokens[0].text,t.tokens[0].tokens.unshift(e)):t.tokens.unshift({type:"paragraph",raw:e.raw,text:e.raw,tokens:[e]}):t.tokens.unshift(e)}}}if(a.loose)for(let e of a.items){e.loose=!0;for(let t of e.tokens)"text"===t.type&&(t.type="paragraph")}return a}}html(e){let t=this.rules.block.html.exec(e);if(t){if("paragraph"===this.lexer.state.lastToken?.type&&!this.rules.other.htmlBeginRegex(4).test(e))return;let n=lt(t[0]);return{type:"html",block:!0,raw:n,pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:n}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&-1!==ut(t[2],"()"))return;let e=ct(t[1]),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:st(t[0],"\n"),href:n,title:r}}}table(e){let t,n;if(this.options.gfm&&!this.options.pedantic){let r=this.rules.other.tableHeader.exec(e);if(!r||!this.rules.other.tableDelimiter.test(r[2])||(t=at(r[1]),n=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),t.length!==n.length))return}let r=this.rules.block.table.exec(e);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;t??=at(r[1]),n??=r[2].replace(this.rules.other.tableAlignChars,"").split("|");let o=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],i={type:"table",raw:st(r[0],"\n"),header:[],align:[],rows:[]};if(t.length===n.length){for(let e of n)this.rules.other.tableAlignRight.test(e)?i.align.push("right"):this.rules.other.tableAlignCenter.test(e)?i.align.push("center"):this.rules.other.tableAlignLeft.test(e)?i.align.push("left"):i.align.push(null);for(let e=0;e<t.length;e++)i.header.push({text:t[e],tokens:this.lexer.inline(t[e]),header:!0,align:i.align[e]});for(let e of o)i.rows.push(at(e,i.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:i.align[t]})));return i}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:"heading",raw:st(t[0],"\n"),depth:"="===t[2].charAt(0)?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let 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){let t=this.rules.block.text.exec(e);if(t){let n=t[0],r=t[0],o=this.rules.other.textIndentedContinuation.exec(e.slice(n.length));return o&&(n+=o[0],r+=o[0].replace(this.rules.other.codeRemoveIndent,"")),{type:"text",raw:n,text:r,tokens:this.lexer.inline(r)}}}escape(e){if(92!==e.charCodeAt(0))return;let t=this.rules.inline.escape.exec(e);return t?{type:"escape",raw:t[0],text:t[1]}:void 0}tag(e){if(60!==e.charCodeAt(0))return;let t=this.rules.inline.tag.exec(e);return t?(!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}):void 0}link(e){if(!1===this.lexer.state.linkParenPossible)return;let t=e.charCodeAt(0);if(91!==t&&33!==t)return;let n=this.rules.inline.link.exec(e);if(n){let t="!"===n[0].charAt(0)?2:1;if(!this.options.pedantic&&wt(e,n[1],t,this.rules))return;let r=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=st(r.slice(0,-1),"\\");if((r.length-e.length)%2==0)return}else{let e=ut(n[2],"()");if(-2===e)return;if(e>-1){let t=(0===n[0].indexOf("!")?5:4)+n[1].length+e;n[2]=n[2].substring(0,e),n[0]=n[0].substring(0,t).trim(),n[3]=""}}let o=st(n[0].slice(0,-1),"\\");if((n[0].length-o.length)%2==0)return;let i=n[2],a="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=n[3]?n[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),yt(n,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(e,t){let n,r=e.charCodeAt(0);if((91===r||33===r)&&((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e)))){let r="!"===n[0].charAt(0)?2:1;if(!this.options.pedantic&&wt(e,n[1],r,this.rules))return;let o=t[ct(n[2]||n[1])];if(!o){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return yt(n,o,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let o=r[0][0],i=n===o,a=t.length-e.length,s=a;for(;!this.options.pedantic&&s>0&&t[s-1]===o;)s--;let l=[...t.slice(Math.max(0,s-2),s)].at(-1)??"",c="*"===l||"_"===l||!!this.rules.inline.punctuation.exec(l);s<a&&(n=l);let u=s<a?c:"*"===n||"_"===n||!!this.rules.inline.punctuation.exec(n);if(r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))return;let d=r[1]||r[3]||"";if(!d||!n||u){let n,u,p=[...r[0]].length-1,h=p,f=0,m=a-s+p,g=!(this.options.pedantic||!l.trim()||!d&&("*"!==o||c));if("*"!==o&&"_"!==o)return;let b="*"===o?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd,y=ht(this,t,o),w=t.length-e.length+p;if(y<w)return;t=t.slice(-1*e.length+p);let v=y-w;for(b.lastIndex=0;null!==(r=b.exec(t))&&!(r.index>v);){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(u=[...n].length,r[3]||r[4]){h+=u;continue}if((r[5]||r[6]||g)&&m%3&&!((m+u)%3)){if(i&&(r[5]||r[6]))break;f+=u;continue}if(h-=u,h>0)continue;u=Math.min(u,u+h+f);let t=[...r[0]][0].length,o=e.slice(0,p+r.index+t+u);if(Math.min(p,u)%2){let e=o.slice(1,-1);return{type:"em",raw:o,text:e,tokens:this.lexer.inlineTokens(e)}}let a=o.slice(2,-2);return{type:"strong",raw:o,text:a,tokens:this.lexer.inlineTokens(a)}}}}codespan(e){if(96!==e.charCodeAt(0))return;let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=e.charCodeAt(0);if(32!==t&&92!==t&&10!==t)return;let n=this.rules.inline.br.exec(e);return n?{type:"br",raw:n[0]}:void 0}del(e,t,n=""){if(126!==e.charCodeAt(0))return;let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n,o,i=[...r[0]].length-1,a=i,s=this.rules.inline.delRDelim,l=ft(this,t),c=t.length-e.length+i;if(l<c)return;t=t.slice(-1*e.length+i);let u=l-c;for(s.lastIndex=0;null!==(r=s.exec(t))&&!(r.index>u);){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n||(o=[...n].length,o!==i))continue;if(r[3]||r[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let t=[...r[0]][0].length,s=e.slice(0,i+r.index+t+o),l=s.slice(i,-i);return{type:"del",raw:s,text:l,tokens:this.lexer.inlineTokens(l)}}}}autolink(e){if(60!==e.charCodeAt(0))return;let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:e?t[0]:(n=t[0],F.numericCharacterReference.test(n)?n.replace(F.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(void 0===t&&void 0===n)return"&amp;";let r=void 0===t?Number.parseInt(n,16):Number.parseInt(t,10);return 0===r||r>1114111||r>=55296&&r<=57343?"�":38===r?"&amp;":String.fromCodePoint(r)}):n),escaped:e}}var n}},kt=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||j,this.options.tokenizer=this.options.tokenizer||new vt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0,inBlockquote:!1};let t={other:F,block:et.normal,inline:tt.normal};this.options.pedantic?(t.block=et.pedantic,t.inline=tt.pedantic):this.options.gfm&&(t.block=et.gfm,this.options.breaks?t.inline=tt.breaks:t.inline=tt.gfm),this.tokenizer.rules=t}static get rules(){return{block:et,inline:tt}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(F.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.state.inRawBlock=!1,this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this;let r=this.state.lastToken;this.options.pedantic&&(e=e.replace(F.tabCharGlobal," ").replace(F.spaceLine,""));let o,i=1/0,a=this.options.gfm&&!this.options.pedantic&&this.tokenizer.paragraph===vt.prototype.paragraph;for(;e;){if(!(e.length<i)){this.infiniteLoopError(e.charCodeAt(0));break}let r;if(i=e.length,this.state.lastToken=t.at(-1),this.options.extensions?.block?.some(n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.raw,this.inlineQueue.at(-1).src=n.text):(this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}),t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let s=e;if(this.options.extensions?.startBlock){let t,n=1/0,r=e.slice(1);this.options.extensions.startBlock.forEach(e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(s=e.substring(0,n+1))}if(this.state.top&&(r=this.tokenizer.paragraph(s))){let i=t.at(-1);(n||i===o&&a)&&"paragraph"===i?.type?(i.raw+=(i.raw.endsWith("\n")?"":"\n")+r.raw,i.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text,o=i):(t.push(r),o=r),n=s.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,this.state.lastToken=r,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes("["))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&"!"!==e.charAt(n.index-1))return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf("[");if("!"!==e.charAt(0)&&Object.hasOwn(this.tokens.links,ct(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=e.includes(")");try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e.includes("*")||e.includes("_")||e.includes("~"),r=n||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==vt.prototype.emStrong||this.tokenizer.del!==vt.prototype.del?this.#t(e):e;if(!n)return this.#n(e,r,t);!function(e,t){let n=pt(t),r=dt.get(e);r?r.push(n):dt.set(e,[n])}(this.tokenizer,r);try{return this.#n(e,r,t)}finally{!function(e){let t=dt.get(e);t&&(t.pop(),0===t.length&&dt.delete(e))}(this.tokenizer)}}#n(e,t,n){let r=!1,o="",i=1/0;for(;e;){if(!(e.length<i)){this.infiniteLoopError(e.charCodeAt(0));break}let a;if(i=e.length,r||(o=""),r=!1,this.options.extensions?.inline?.some(t=>!!(a=t.call({lexer:this},e,n))&&(e=e.substring(a.raw.length),n.push(a),!0)))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let t=n.at(-1);"text"===a.type&&"text"===t?.type?(t.raw+=a.raw,t.text+=a.text):n.push(a);continue}let s=e[0];if("*"===s||"_"===s){let i=t.length-e.length;if(ht(this.tokenizer,t,s)<=i){let t=1;for(;t<e.length&&e.charCodeAt(t)===s.charCodeAt(0);)t++;let i=e.substring(0,t),a=n.at(-1);"text"!==a?.type||a.escaped?n.push({type:"text",raw:i,text:i,escaped:!1}):(a.raw+=i,a.text+=i),e=e.substring(t),o=s,r=!0;continue}}else if("~"===s){let i=t.length-e.length;if(ft(this.tokenizer,t)<=i){let t=1;for(;t<e.length&&126===e.charCodeAt(t);)t++;let i=e.substring(0,t),a=n.at(-1);"text"!==a?.type||a.escaped?n.push({type:"text",raw:i,text:i,escaped:!1}):(a.raw+=i,a.text+=i),e=e.substring(t),o=s,r=!0;continue}}if(a=this.tokenizer.emStrong(e,t,o)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(e,t,o)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),n.push(a);continue}let l=e;if(this.options.extensions?.startInline){let t,n=1/0,r=e.slice(1);this.options.extensions.startInline.forEach(e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(l=e.substring(0,n+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),"_"!==a.raw.slice(-1)&&(o=a.raw.slice(-1)),r=!0;let t=n.at(-1);"text"===t?.type?(t.raw+=a.raw,t.text+=a.text):n.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}#r(e){let t,{blockSkip:n,tag:r,autolink:o}=this.tokenizer.rules.inline,i="",a=0;for(n.lastIndex=0;t=n.exec(e);){let s=t.index+(t[2]?t[2].length:0),l=t.index+t[0].length;if("<"===e.charAt(s)){let t=e.slice(s),i=r.exec(t)||o.exec(t);if(!i){n.lastIndex=s+1;continue}l=s+i[0].length,n.lastIndex=l}i+=e.slice(a,s)+"["+"a".repeat(l-s-2)+"]",a=l}return i+e.slice(a)}#t(e){let t=e;if(this.tokens.links&&e.includes("[")){let e=this.tokenizer.rules.inline.reflinkSearch,n=t=>{let r=t.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,ct(t.slice(r+1,-1))))return t;if(r>1&&"!"!==t.charAt(0)){let o=t.slice(1,r-1);if(this.linkInText(o))return"["+o.replace(e,n)+"]["+"a".repeat(t.length-r-2)+"]"}return"["+"a".repeat(t.length-2)+"]"};t=t.replace(e,n)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?"+".repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,"+")+t:e),t=this.#r(t),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(!this.options.silent)throw new Error(t);console.error(t)}};function xt(e){return e.map(e=>"codespan"===e.type||"escape"===e.type?{...e,text:ot(e.text,!0)}:"tokens"in e&&e.tokens?{...e,tokens:xt(e.tokens)}:e)}var $t=class{options;parser;constructor(e){this.options=e||j}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(F.notSpaceStart)?.[0],o=e?e.replace(F.endingNewline,"")+"\n":"";return r?'<pre><code class="language-'+ot(r)+'">'+(n?o:ot(o,!0))+"</code></pre>\n":"<pre><code>"+(n?o:ot(o,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){let t=e.ordered,n=e.start,r="";for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let o=t?"ol":"ul";return"<"+o+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+o+">\n"}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r="";for(let t=0;t<e.rows.length;t++){let o=e.rows[t];n="";for(let e=0;e<o.length;e++)n+=this.tablecell(o[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${ot(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:o}){let i=o?ot(n,!0):this.parser.parseInline(r),a=it(e);if(null===a)return i;let s='<a href="'+(e=ot(a,o))+'"';return t&&(s+=' title="'+ot(t)+'"'),s+=">"+i+"</a>",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(xt(r),this.parser.textRenderer));let o=it(e);if(null===o)return ot(n);let i=`<img src="${ot(e=o)}" alt="${ot(n)}"`;return t&&(i+=` title="${ot(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:ot(e.text)}},Et=class{parser;strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return"\n"}checkbox({raw:e}){return e}},St=class e{options;renderer;textRenderer;constructor(e){this.options=e||j,this.options.renderer=this.options.renderer||new $t,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Et,this.textRenderer.parser=this}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t="";for(let n=0;n<e.length;n++){let r=e[n],o=this.options.extensions?.renderers;if(o&&Object.hasOwn(o,r.type)&&o[r.type]){let e=r,n=o[e.type].call({parser:this},e);if(!1!==n||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(e.type)){t+=!1===n?"":n??"";continue}}let i=r;switch(i.type){case"space":t+=this.renderer.space(i);break;case"hr":t+=this.renderer.hr(i);break;case"heading":t+=this.renderer.heading(i);break;case"code":t+=this.renderer.code(i);break;case"table":t+=this.renderer.table(i);break;case"blockquote":t+=this.renderer.blockquote(i);break;case"list":t+=this.renderer.list(i);break;case"checkbox":t+=this.renderer.checkbox(i);break;case"html":t+=this.renderer.html(i);break;case"def":t+=this.renderer.def(i);break;case"paragraph":t+=this.renderer.paragraph(i);break;case"text":t+=this.renderer.text(i);break;default:{let e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let o=e[r],i=this.options.extensions?.renderers;if(i&&Object.hasOwn(i,o.type)&&i[o.type]){let e=i[o.type].call({parser:this},o);if(!1!==e||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(o.type)){n+=!1===e?"":e??"";continue}}let a=o;switch(a.type){case"escape":case"text":n+=t.text(a);break;case"html":n+=t.html(a);break;case"link":n+=t.link(a);break;case"image":n+=t.image(a);break;case"checkbox":n+=t.checkbox(a);break;case"strong":n+=t.strong(a);break;case"em":n+=t.em(a);break;case"codespan":n+=t.codespan(a);break;case"br":n+=t.br(a);break;case"del":n+=t.del(a);break;default:{let e='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}},_t=class{options;block;constructor(e){this.options=e||j}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?kt.lex:kt.lexInline}provideParser(e=this.block){return e?St.parse:St.parseInline}};function Ct(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var At=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=St;Renderer=$t;TextRenderer=Et;Lexer=kt;Tokenizer=vt;Hooks=_t;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(Ct(n,t.call(this,r)),r.type){case"table":{let e=r;for(let r of e.header)Ct(n,this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)Ct(n,this.walkTokens(e.tokens,t));break}case"list":{let e=r;Ct(n,this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{if(e[r]){let o=e[r].flat(1/0);Ct(n,this.walkTokens(o,t))}}):e.tokens&&Ct(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){let 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("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");let n=t[e.level];n?n.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]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new $t(this.defaults);for(let n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let r=n,o=e.renderer[r],i=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),!1===n?"":n??""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new vt(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let r=n,o=e.tokenizer[r],i=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new _t;for(let n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let r=n,o=e.hooks[r],i=t[r];_t.passThroughHooks.has(n)?t[r]=e=>{if(t.options.async&&_t.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await o.call(t,e);return i.call(t,n)})();let r=o.call(t,e);return i.call(t,r)}:t[r]=(...e)=>{if(t.options.async)return(async()=>{let n=await o.apply(t,e);return!1===n&&(n=await i.apply(t,e)),n})();let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return Ct(n,r.call(this,e)),t&&Ct(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return kt.lex(e,t??this.defaults)}parser(e,t){return St.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},o={...this.defaults,...r},i=this.onError(!!o.silent,!!o.async);if(!0===this.defaults.async&&!1===r.async)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=e),o.async)return(async()=>{let n=o.hooks?await o.hooks.preprocess(t):t,r=await(o.hooks?await o.hooks.provideLexer(e):e?kt.lex:kt.lexInline)(n,o),i=o.hooks?await o.hooks.processAllTokens(r):r;o.walkTokens&&await Promise.all(this.walkTokens(i,o.walkTokens));let a=await(o.hooks?await o.hooks.provideParser(e):e?St.parse:St.parseInline)(i,o);return o.hooks?await o.hooks.postprocess(a):a})().catch(i);try{o.hooks&&(t=o.hooks.preprocess(t));let n=(o.hooks?o.hooks.provideLexer(e):e?kt.lex:kt.lexInline)(t,o);o.hooks&&(n=o.hooks.processAllTokens(n)),o.walkTokens&&this.walkTokens(n,o.walkTokens);let r=(o.hooks?o.hooks.provideParser(e):e?St.parse:St.parseInline)(n,o);return o.hooks&&(r=o.hooks.postprocess(r)),r}catch(e){return i(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="<p>An error occurred:</p><pre>"+ot(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Lt(e,t){return At.parse(e,t)}function Rt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}Lt.options=Lt.setOptions=function(e){return At.setOptions(e),Lt.defaults=At.defaults,D(Lt.defaults),Lt},Lt.getDefaults=I,Lt.defaults=j,Lt.use=function(...e){return At.use(...e),Lt.defaults=At.defaults,D(Lt.defaults),Lt},Lt.walkTokens=function(e,t){return At.walkTokens(e,t)},Lt.parseInline=At.parseInline,Lt.Parser=St,Lt.parser=St.parse,Lt.Renderer=$t,Lt.TextRenderer=Et,Lt.Lexer=kt,Lt.lexer=kt.lex,Lt.Tokenizer=vt,Lt.Hooks=_t,Lt.parse=Lt,Lt.options,Lt.setOptions,Lt.walkTokens,Lt.parseInline,St.parse,kt.lex;var Tt,Pt={exports:{}};var Ot,Nt=(Tt||(Tt=1,Ot=Pt,function(e,t){Ot.exports=t()}(0,function(){var e=[],t=[],n={},r={},o={};function i(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function a(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function s(e,t){return e.replace(t[0],function(n,r){var o,i,s=(o=t[1],i=arguments,o.replace(/\$(\d{1,2})/g,function(e,t){return i[t]||""}));return a(""===n?e[r-1]:n,s)})}function l(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var o=r.length;o--;){var i=r[o];if(i[0].test(t))return s(t,i)}return t}function c(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?a(r,o):e.hasOwnProperty(o)?a(r,e[o]):l(o,r,n)}}function u(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&l(o,o,n)===o}}function d(e,t,n){return(n?t+" ":"")+(1===t?d.singular(e):d.plural(e))}return d.plural=c(o,r,e),d.isPlural=u(o,r,e),d.singular=c(r,o,t),d.isSingular=u(r,o,t),d.addPluralRule=function(t,n){e.push([i(t),n])},d.addSingularRule=function(e,n){t.push([i(e),n])},d.addUncountableRule=function(e){"string"!=typeof e?(d.addPluralRule(e,"$0"),d.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},d.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 d.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 d.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 d.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(d.addUncountableRule),d})),Pt.exports),It=Rt(Nt),jt=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(a,this)}function a(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 a=("selectedIndex"in t),s=a;r<o;){var l,c=e(n[r],1);t.insertBefore(c,i),a&&s&&c.selected&&(s=!s,l=t.selectedIndex,t.selectedIndex=l<0?r:d.call(t.querySelectorAll("option"),c)),r++}}function i(e,t){return e==t}function a(e){return e}function s(e,t,n,r,o,i,a){var s=i-o;if(s<1)return-1;for(;s<=n-t;){for(var l=t,c=o;l<n&&c<i&&a(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||a,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 k=m-g,x=b-y,$=-1;if(k<x){if(-1<($=s(n,y,b,t,g,m,u)))return o(d,e,n,y,$,d(t[g],0)),o(d,e,n,$+k,b,l(d,t,m,f,h)),n}else if(x<k&&-1<($=s(t,g,m,n,y,b,u)))return c(d,t,g,$),c(d,t,$+x,m),n;return k<2||x<2?(o(d,e,n,y,b,d(t[g],0)),c(d,t,g,m)):k==x&&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,a,s,l,u,d,h,f,m){!function(e,t,n,r,i,a,s,l,u){for(var d=[],p=e.length,h=s,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(a[h],0):u);break;case-1:h++}for(f=0;f<p;)switch(e[f++]){case 0:s++;break;case-1:-1<d.indexOf(a[s])?s++:c(t,a,s++,s)}}(function(e,t,n,r,o,i,a){var s,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]=[],s=-b;s<=b;s+=2){for(l=(c=s===-b||s!==b&&u[p+s-1]<u[p+s+1]?u[p+s+1]:u[p+s-1]+1)-s;c<i&&l<n&&a(r[o+c],e[t+l]);)c++,l++;if(c===i&&l===n)break e;d[b+s]=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&&a(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],(s=c-l)===-b||s!==b&&u[p+s-1]<u[p+s+1]?(l--,m[g--]=1):(c--,m[g--]=-1)}return m}(n,r,a,s,l,d,f)||function(e,t,n,r,o,i,a,s){var l=0,c=r<s?r:s,u=Array(c++),d=Array(c);d[0]=-1;for(var h=1;h<c;h++)d[h]=a;for(var f=o.slice(i,a),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,--a;d[l]>a;)--l;c=s+r-l;var y=Array(c),w=u[l];for(--n;w;){for(var v=w.newi,k=w.oldi;v<n;)y[--c]=1,--n;for(;k<a;)y[--c]=-1,--a;y[--c]=0,--n,--a,w=w.prev}for(;t<=n;)y[--c]=1,--n;for(;i<=a;)y[--c]=-1,--a;return y}(n,r,i,a,s,l,u,d),e,t,n,r,s,l,h,m)}(d,e,n,y,b,x,t,g,m,k,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 k(e,t){var n="_"+e+"$";return{get:function(){return this[n]||x(this,n,t.call(this,e))},set:function(e){x(this,n,e)}}}var x=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={},R={},T=[],P=R.hasOwnProperty,O=0,N={attributes:L,define:function(e,t){e.indexOf("-")<0?(e in R||(O=T.push(e)),R[e]=t):L[e]=t},invoke:function(e,t){for(var n=0;n<O;n++){var r=T[n];if(P.call(e,r))return R[r](e[r],t)}}},I=Array.isArray||(E=($={}.toString).call([]),function(e){return $.call(e)===E}),j=(S=e,_="fragment",A="content"in z(C="template")?function(e){var t=z(C);return t.innerHTML=e,t.content}:function(e){var t,n=z(_),r=z(C);return D(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(_),n=z("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",D(t,n.firstChild.childNodes),t}:A)(e)});function D(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function z(e){return e===_?S.createDocumentFragment():S.createElementNS("http://www.w3.org/1999/xhtml",e)}var M,q,H,B,F,U,W,G,V,Z=(q="appendChild",H="cloneNode",B="createTextNode",U=(F="importNode")in(M=e),(W=M.createDocumentFragment())[q](M[B]("g")),W[q](M[B]("")),(U?M[F](W,!0):W[H](!0)).childNodes.length<2?function e(t,n){for(var r=t[H](),o=t.childNodes||[],i=o.length,a=0;n&&a<i;a++)r[q](e(o[a],n));return r}:U?M[F]:function(e,t){return e[H](!!t)}),K="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},Y="-"+Math.random().toFixed(6)+"%",X=!1;try{G=e.createElement("template"),V="tabindex","content"in G&&(G.innerHTML="<p "+V+'="'+Y+'"></p>',G.content.childNodes[0].getAttribute(V)==Y)||(Y="_dt: "+Y.slice(1,-1)+";",X=!0)}catch(u){}var Q="\x3c!--"+Y+"--\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("\\/","")+"))?)",ae=new RegExp(oe+re+ie+"+)(["+te+"]*/?>)","g"),se=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||'"')+Y+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+"></"+t+">"}var pe=X?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort(function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1})}:function(e,t){return t.slice.call(e,0)};function he(t,n,r,o){for(var i=t.childNodes,a=i.length,s=0;s<a;){var l=i[s];switch(l.nodeType){case 1:var c=o.concat(s);!function(t,n,r,o){for(var i,a=t.attributes,s=[],l=[],c=pe(a,r),u=c.length,d=0;d<u;){var p=c[d++],h=p.value===Y;if(h||1<(i=p.value.split(Q)).length){var f=p.name;if(s.indexOf(f)<0){s.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=a[m]||a[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)&&X&&!("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 k=e.createElement(v);for(u=a.length,d=0;d<u;)k.setAttributeNode(a[d++].cloneNode(!0));k.textContent=t.textContent,t.parentNode.replaceChild(k,t)}}(l,n,r,c),he(l,n,r,c);break;case 8:var u=l.textContent;if(u===Y)r.shift(),n.push(J.test(t.nodeName)?me(t,o):{type:"any",node:l,path:o.concat(s)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"👻":t.removeChild(l),s--,a--}break;case 3:J.test(t.nodeName)&&K.call(l.textContent)===Q&&(r.shift(),n.push(me(t,o)))}s++}}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(se,de).replace(ae,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,a=0,s=0;a<o;){var l=i[a++],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}):(s+=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+=s,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,a=1;i<e;){var s=r[i-a];if(s.sparse){var l=s.values,c=l[0],u=1,d=l.length;for(a+=d-2;u<d;)c+=arguments[i++]+l[u++];s.fn(c)}else s.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 ke,xe,$e=(ke=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,xe=/([^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 Ee(e,t,n){return t+"-"+n.toLowerCase()}function Se(e,t){var n,r;return function(o){var i,a,s,l;switch(typeof o){case"object":if(o){if("object"===n){if(!t&&r!==o)for(a in r)a in o||(e[a]="")}else t?e.value="":e.cssText="";for(a in i=t?{}:e,o)s="number"!=typeof(l=o[a])||ke.test(a)?l:l+"px",!t&&/^--/.test(a)?i.setProperty(a,s):i[a]=s;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace(xe,Ee),":",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 _e,Ce,Ae=(_e=[].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=_e.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Re(e){return{html:e}}function Te(e,t){switch(e.nodeType){case He:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case qe:return Te(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(Re).then(t):Promise.resolve(N.invoke(e,t)).then(t)}function Oe(e){return null!=e&&"then"in e}var Ne,Ie,je,De,ze,Me="ownerSVGElement",qe=v.prototype.nodeType,He=Ae.prototype.nodeType,Be=(Ie=(Ne={Event:b,WeakSet:u}).Event,je=Ne.WeakSet,De=!0,ze=null,function(e){return De&&(De=!De,ze=new je,function(e){var t=new je,n=new je;try{new MutationObserver(a).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,o=[],i=function(e){o.push(e),clearTimeout(r),r=setTimeout(function(){a(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 a(e){for(var r,o=e.length,i=0;i<o;i++)s((r=e[i]).removedNodes,"disconnected",n,t),s(r.addedNodes,"connected",t,n)}function s(e,t,n,r){for(var o,i=new Ie(t),a=e.length,s=0;s<a;1===(o=e[s++]).nodeType&&function e(t,n,r,o,i){ze.has(t)&&!o.has(t)&&(i.delete(t),o.add(t),t.dispatchEvent(n));for(var a=t.children||[],s=a.length,l=0;l<s;e(a[l++],n,r,o,i));}(o,i,t,n,r));}}(e.ownerDocument)),ze.add(e),e}),Fe=/^(?:form|list)$/i,Ue=[].slice;function We(t){return this.type=t,function(t){var n=we,r=ve;return function(o){var i,a,s;return n!==o&&(i=t,a=n=o,s=be.get(a)||be.set(a,ye(i,a)),r=s.updates(Z.call(e,s.content,!0))),r.apply(null,arguments)}}(this)}var Ge=!(We.prototype={attribute:function(e,t,n){var r,o=Me 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 a=e,s=t.slice(1),function(e){l!==!!e&&((l=!!e)?a.setAttribute(s,""):a.removeAttribute(s))};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&&!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 N.attributes)return function(n){var o=N.attributes[t](e,n);r!==o&&(null==(r=o)?e.removeAttribute(t):e.setAttribute(t,o))};var a,s,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:Te,before:e},o=Me in e?"svg":"html",i=!1;return function a(s){switch(typeof s){case"string":case"number":case"boolean":i?n!==s&&(n=s,t[0].textContent=s):(i=!0,n=s,t=f(e.parentNode,t,[(l=s,e.ownerDocument.createTextNode(l))],r));break;case"function":a(s(e));break;case"object":case"undefined":if(null==s){i=!1,t=f(e.parentNode,t,[],r);break}default:if(i=!1,I(n=s))if(0===s.length)t.length&&(t=f(e.parentNode,t,[],r));else switch(typeof s[0]){case"string":case"number":case"boolean":a({html:s});break;case"object":if(I(s[0])&&(s=s.concat.apply([],s)),Oe(s[0])){Promise.all(s).then(a);break}default:t=f(e.parentNode,t,s,r)}else"ELEMENT_NODE"in s?t=f(e.parentNode,t,11===s.nodeType?Ue.call(s.childNodes):[s],r):Oe(s)?s.then(a):"placeholder"in s?Pe(s,a):"text"in s?a(String(s.text)):"any"in s?a(s.any):"html"in s?t=f(e.parentNode,t,Ue.call(j([].concat(s.html).join(""),o).childNodes),r):a("length"in s?Ue.call(s):N.invoke(s,a))}var l}},text:function(e){var t;return function n(r){var o;t!==r&&("object"==(o=typeof(t=r))&&r?Oe(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?Ue.call(r).join(""):N.invoke(r,n)):"function"==o?n(r(e)):e.textContent=null==r?"":r)}}}),Ve=function(t){var r,o,i,a,s=(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 s||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)},Ve=l?i:(a=new n,function(e){return a.get(e)||(n=i(t=e),a.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 Ye=new n,Xe=function(e){var t,n,r;return function(){var o=Ke.apply(null,arguments);return r!==o[0]?(r=o[0],n=new We(e),t=Je(n.apply(n,o))):n.apply(n,o),t}},Qe=function(e,t){var n=t.indexOf(":"),r=Ye.get(e),o=t;return-1<n&&(o=t.slice(n+1),t=t.slice(0,n)||"html"),r||Ye.set(e,r={}),r[o]||(r[o]=Xe(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=Ke.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new We(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,ot,it,at=N.define,st=We.prototype;function lt(e){return arguments.length<2?null==e?Xe("html"):"string"==typeof e?lt.wire(null,e):"raw"in e?Xe("html")(e):"nodeType"in e?lt.bind(e):Qe(e,"html"):("raw"in e?Xe("html"):lt.wire).apply(null,arguments)}return lt.Component=v,lt.bind=function(e){return tt.bind(e)},lt.define=at,lt.diff=f,(lt.hyper=lt).observe=Be,lt.tagger=st,lt.wire=function(e,t){return null==e?Xe(t||"html"):Qe(e,t||"html")},lt._={WeakMap:n,WeakSet:u},nt=Xe,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,a,s,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,a=o,s=new e(r),i.set(a,s),s);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:k("html",nt),svg:k("svg",nt),state:k("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);const{Component:Dt,bind:zt,define:Mt,diff:qt,hyper:Ht,wire:Bt}=jt,Ft=jt,Ut=L,Wt=Lt,Gt=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(e=e.trim(),!e)throw new TypeError("Invalid input.");let t="",n="",r="",o=null,i=new Map,a="type",s=Array.from(e);for(let e=0;e<s.length;e++){const l=s[e];switch(a){case"type":if("/"===l){a="subtype";continue}t+=l;break;case"subtype":if(";"===l){a="param-start";continue}n+=l;break;case"param-start":if(P.test(l)||";"===l)continue;r+=l,a="param-name";break;case"param-name":if("="===l||";"===l){if("="===l){a="param-value",o=null;continue}i.set(r.toLowerCase(),null),r="";continue}r+=l;break;case"param-value":if('"'==l){a="collect-quoted-string";continue}if(";"===l){o=o.trimEnd(),a="param-start",N(i,r,o),r="";continue}o="string"==typeof o?o+l:l;break;case"collect-quoted-string":if('"'===l){N(i,r,o),a="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;a="param-start";break;default:throw new Error(`State machine error - unknown parser mode: ${a} `)}}r&&N(i,r,o);if(""===t.trim()||!T.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!T.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?T.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},Vt=It,Zt=/['\u2019]s$/,Kt=/-/g,Yt=RegExp.escape??(e=>e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")),Xt=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Qt="en"===r||r.startsWith("en-")?"en-AU":r,Jt=new Intl.DateTimeFormat(Qt,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===Qt?"2-digit":"numeric"});function en(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 tn(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach(e=>{e.remove()})}function nn(e,t="long"){const n=new Intl.ListFormat(r,{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 rn=nn("conjunction"),on=nn("disjunction");function an(e,t){return rn(e,t).join("")}function sn(e){return e.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}function ln(e){return e.trim().replace(/\s+/g," ")}function cn(e,t=r){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const o=function(e,t,n=r){n=n.toLowerCase();const o=n.match(/^(\w{2,3})-.+$/)?.[1]??"";return e[n]?.[t]||e[o]?.[t]}(e,n,t)||e.en[n];if(!o)throw new Error(`No l10n data for key: "${n}"`);return o}})}function un(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){_n(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace.",cause:e})}}}return e}function dn(e,t=e=>e){const n=e.map(t),r=n.slice(0,-1).map(e=>Ft`${e}, `);return Ft`${r}${n[n.length-1]}`}function pn(e,t=!1){return(t?e:e.toLowerCase()).trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,"")}function hn(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let o=pn(n,r);if(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 fn(e){const t=new Set,n="ltNodefault"in e.dataset?"":ln(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map(e=>ln(e)).forEach(e=>t.add(e)):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r&&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(ln(e)))}return[...t]}function mn(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 gn(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 bn(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function yn(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 wn 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)??e)}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find(t=>t.toLowerCase()===e.toLowerCase())}}function vn(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach(e=>e.removeAttribute("id")),t.querySelectorAll("dfn").forEach(e=>{mn(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 En extends Error{constructor(e,t,n){super(e,{...n.cause&&{cause:n.cause}});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||hn(e,"respec-offender")}(t,e,n.title))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:o,elements:i,title:a,details:s}=this;return{message:e,name:t,plugin:r,hint:o,elements:i,title:a,details:s,stack:n,...this.cause instanceof Error&&{cause:{name:this.cause.name,message:this.cause.message,stack:this.cause.stack}}}}}function Sn(e,t,n={}){const r={...n,isWarning:!1};On("error",new En(e,t,r))}function _n(e,t,n={}){const r={...n,isWarning:!0};On("warn",new En(e,t,r))}function Cn(e){return{amendConfiguration:e=>On("amend-user-config",e),showError:(t,n)=>Sn(t,e,n),showWarning:(t,n)=>_n(t,e,n)}}function An(e){return e?`\`${e}\``:""}function Ln(e,{quotes:t}={quotes:!1}){return on(e,t?e=>{return An((t=e,String(t)?`"${t}"`:""));var t}:An).join("")}function Rn(e,...t){return Tn(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(""))}function Tn(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")}const Pn=new EventTarget;function On(e,t){if(Pn.dispatchEvent(new CustomEvent(e,{detail:t})),window.parent===window.self)return;const n=String(JSON.stringify(t?.stack||t));window.parent.postMessage({topic:e,args:n},window.parent.location.origin)}function Nn(e,t,n={once:!1}){Pn.addEventListener(e,async n=>{try{await t(n.detail)}catch(t){const n=t;Sn(`Error in handler for topic "${e}": ${n.message}`,`sub:${e}`,{cause:n})}},n)}const In=["githubToken","githubUser"];const jn=new Map([["text/html","html"],["application/xml","xml"]]);function Dn(e,t=document){const n=jn.get(e);if(!n){const t=[...jn.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=zn(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function zn(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;kn(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach(e=>e.remove()),n.classList.remove("toc-sidebar","toc-inline"),tn(r);const o=e.createDocumentFragment(),i=e.querySelector("meta[name='viewport']");i&&t.firstChild!==i&&o.appendChild(i);const a=e.querySelector("meta[charset], meta[content*='charset=']")||Ft`<meta charset="utf-8" />`;o.appendChild(a);const s=`ReSpec ${window.respecVersion||"Developer Channel"}`,l=Ft`
2
+ <meta name="generator" content="${s}" />
3
+ `;o.appendChild(l),t.prepend(o),On("beforesave",r)}(n);let r="";if("xml"===e)r=(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&&(r+=(new XMLSerializer).serializeToString(n.doctype)),r+=n.documentElement.outerHTML;return r}async function Mn(t){const n=await fetch(new URL(`../../${t}`,e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-aom.js",document.baseURI).href));return await n.text()}const qn=(e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-aom.js",document.baseURI).href).endsWith("/src/core/worker.js")?new URL("../../builds/respec-highlight.js",e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-aom.js",document.baseURI).href).href:new URL("respec-highlight.js",e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-aom.js",document.baseURI).href).href,Hn=en({hint:"preload",href:qn,as:"script"});async function Bn(){try{return(await Promise.resolve().then(function(){return Rr})).default}catch{return Mn("worker/respec-worker.js")}}async function Fn(){try{const e=await fetch(qn);if(e.ok)return await e.text()}catch{}return null}document.head.appendChild(Hn);const Un=async function(){const[e,t]=await Promise.all([Bn(),Fn()]),n=new Blob([null!==t?`${t}\n`:'self.RESPEC_HIGHLIGHT_URL = "https://www.w3.org/Tools/respec/respec-highlight";\n',e],{type:"application/javascript"});return new Worker(URL.createObjectURL(n))}();class Wn{constructor(){this._respecDonePromise=new Promise(e=>{Nn("end-all",()=>e(),{once:!0})}),this.errors=[],this.warnings=[],Nn("error",e=>{console.error(e,e.toJSON()),this.errors.push(e)}),Nn("warn",e=>{console.warn(e,e.toJSON()),this.warnings.push(e)})}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}get worker(){return Un}async toHTML(){return zn("html",document)}}const Gn="core/post-process";function Vn(e,t){return new Promise((n,r)=>{const o=setTimeout(()=>{r(new Error(`${t} timed out.`))},15e3);Promise.resolve(e).then(n,r).finally(()=>{clearTimeout(o)})})}const Zn="core/pre-process";const Kn="core/base-runner";async function Yn(e){!function(){const e=new Wn;Object.defineProperty(document,"respec",{value:e})}(),On("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),Nn("amend-user-config",n),Nn("end-all",()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of In)e in t&&delete t[e];e.innerHTML=JSON.stringify(t,null,2),document.head.appendChild(e)})}(respecConfig),function(e){const t=new URLSearchParams(document.location.search),n=Array.from(t).filter(([e,t])=>!!e&&!!t).map(([e,t])=>{const n=decodeURIComponent(e),r=decodeURIComponent(t.replace(/%3D/g,"="));let o;try{o=JSON.parse(r)}catch{o=r}return[n,o]}),r=Object.fromEntries(n);Object.assign(e,r),On("amend-user-config",r)}(respecConfig),performance.mark(`${Kn}-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});for(const[n,r]of t.entries()){const t=`${Zn}/${r.name||`[${n}]`}`,o=Cn(t);try{await new Promise((n,i)=>{const a=setTimeout(()=>{i(new Error(`preProcess function "${t}" timed out.`))},15e3);Promise.resolve().then(()=>r(e,document,o)).then(n,i).finally(()=>{clearTimeout(a)})})}catch(e){Sn(`Function ${t} threw an error during \`preProcess\`.`,Zn,{hint:"See developer console.",cause:e})}}}}(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)),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(void 0)):n.run&&(await n.run(t),r(void 0))}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),On("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.",Gn),t});for(const[n,r]of t.entries()){const t=`${Gn}/${r.name||`[${n}]`}`,o=Cn(t);try{await Vn(r(e,document,o),`postProcess function "${t}"`)}catch(e){Sn(`Function ${t} threw an error during \`postProcess\`.`,Gn,{hint:"See developer console.",cause:e})}}}if("function"==typeof e.afterEnd)try{await Vn(e.afterEnd(e,document),"config.afterEnd")}catch(e){Sn("Function afterEnd threw an error.",Gn,{hint:"See developer console.",cause:e})}}(respecConfig),On("end-all",void 0),tn(document),performance.mark(`${Kn}-end`),performance.measure(Kn,`${Kn}-start`,`${Kn}-end`)}var Xn=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}
4
4
  #respec-ui{position:fixed;display:flex;flex-direction:row-reverse;top:20px;right:20px;width:202px;text-align:right;z-index:9000}
5
5
  #respec-pill,.respec-info-button{height:2.4em;background:#fff;background:var(--bg,#fff);color:#787878;color:var(--tocnav-normal-text,#787878);border:1px solid #ccc;box-shadow:1px 1px 8px 0 rgba(100,100,100,.5);box-shadow:1px 1px 8px 0 var(--tocsidebar-shadow,rgba(100,100,100,.5));padding:.2em 0}
6
6
  .respec-info-button{border:none;opacity:.75;border-radius:2em;margin-right:1em;min-width:3.5em;will-change:opacity}
@@ -63,37 +63,37 @@ to{margin-top:0;border:1px solid #ccc;border-radius:0;box-shadow:1px 1px 8px 0 r
63
63
  .respec-iframe:not(.ready){background:url(https://respec.org/xref/loader.gif) no-repeat center}
64
64
  .respec-iframe+a[href]{font-size:.9rem;float:right;margin:0 .5em .5em;border-bottom-width:1px}
65
65
  p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
66
- .respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;const Qn=new Set;function Jn(e,{id:t,className:n,before:r}={}){const o=document.createElement("style");return t&&(o.id=t),void 0!==n&&(o.className=n),o.textContent=e,document.head.insertBefore(o,r??null),Qn.add(o),o}const er=/&gt;/gm,tr=/&amp;/gm;class nr extends Wt.Renderer{code(e){const{text:t,lang:n=""}=e,{language:r,...o}=nr.parseInfoString(n);if(/(^webidl$)/i.test(r))return`<pre class="idl">${t}</pre>`;const i=super.code({...e,lang:r}).replace('class="language-','class="'),{example:s,illegalExample:a}=o;if(!s&&!a)return i;const l=s||a,c=`${r} ${s?"example":"illegal-example"}`;return i.replace("<pre>",`<pre title="${l}" class="${c}">`)}image(e){const{href:t,title:n,text:r}=e;if(!n)return super.image(e);return String.raw`
66
+ .respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;const Qn=new Set;function Jn(e,{id:t,className:n,before:r}={}){const o=document.createElement("style");return t&&(o.id=t),void 0!==n&&(o.className=n),o.textContent=e,document.head.insertBefore(o,r??null),Qn.add(o),o}let er,tr=!1;Nn("start-all",e=>er=e,{once:!0});const nr=/&gt;/gm,rr=/&amp;/gm;class or extends Wt.Renderer{code(e){const{text:t,lang:n=""}=e,{language:r,...o}=or.parseInfoString(n);if(/(^webidl$)/i.test(r))return`<pre class="idl">${t}</pre>`;if(er?.diagrams&&/^mermaid$/i.test(r)){const e=e=>sn(tr?e:e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")),n=o.title?`<figcaption>${e(o.title)}</figcaption>`:"";return`<figure><pre class="mermaid">${e(t)}</pre>${n}</figure>`}const i=super.code({...e,lang:r}).replace('class="language-','class="'),{example:a,illegalExample:s}=o;if(!a&&!s)return i;const l=a||s,c=`${r} ${a?"example":"illegal-example"}`;return i.replace("<pre>",`<pre title="${l}" class="${c}">`)}image(e){const{href:t,title:n,text:r}=e;if(!n)return super.image(e);return String.raw`
67
67
  <figure>
68
68
  <img src="${t}" alt="${r}" />
69
69
  <figcaption>${n}</figcaption>
70
70
  </figure>
71
- `}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 o;if(r)try{o=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...o}}heading(e){const t=this.parser.parseInline(e.tokens),n=e.depth,r=t.match(/(.+)\s+{#([\w-]+)}$/);if(r){const[,e,t]=r;return`<h${n} id="${t}">${e}</h${n}>`}return super.heading(e)}}const rr={gfm:!0,renderer:new nr};function or(e,t={inline:!1}){const n=function(e){if(!e)return e;const t=e.trimEnd().split("\n"),n=t.findIndex(e=>e.trim());if(-1===n)return"";const r=t.slice(n),o=r[0].search(/[^\s]/);if(o<1)return r.join("\n");const i=" ".repeat(o);return r.map(e=>e.startsWith(i)?e.slice(o):e).join("\n")}(e),r=n.replace(er,">").replace(tr,"&");return t.inline?Wt.parseInline(r,rr):Wt.parse(r,rr)}function ir(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=or(e.innerHTML)}const sr=(ar="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(ar);return t.forEach(ir),Array.from(t)});var ar;var lr=Object.freeze({__proto__:null,markdownToHtml:or,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 sr(document.body);const r=document.getElementById("respec-ui");r?.remove();const o=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"),o=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),o.trim()){const t=yn(e);e.append(`\n\n${t}`)}}}(o,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),ir(o),function(e){Array.from(e).forEach(e=>{e.replaceWith(e.textContent)})}(o.querySelectorAll(".nolinks a[href]")),r&&o.append(r),document.body.replaceWith(o)}});function cr(e,t){e&&Array.from(t).forEach(([t,n])=>{e.setAttribute(`aria-${t}`,n)})}Jn(Xn,{id:"respec-ui-styles",className:"removeOnSave"});const ur=Ft`<div id="respec-ui" class="removeOnSave" hidden></div>`,dr=Ft`<ul
71
+ `}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 o;if(r)try{o=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...o}}heading(e){const t=this.parser.parseInline(e.tokens),n=e.depth,r=t.match(/(.+)\s+{#([\w-]+)}$/);if(r){const[,e,t]=r;return`<h${n} id="${t}">${e}</h${n}>`}return super.heading(e)}}const ir={gfm:!0,renderer:new or};function ar(e,t={inline:!1}){const n=function(e){if(!e)return e;const t=e.trimEnd().split("\n"),n=t.findIndex(e=>e.trim());if(-1===n)return"";const r=t.slice(n),o=r[0].search(/[^\s]/);if(o<1)return r.join("\n");const i=" ".repeat(o);return r.map(e=>e.startsWith(i)?e.slice(o):e).join("\n")}(e),r=t.raw?n:n.replace(nr,">").replace(rr,"&");tr=!!t.raw;try{return t.inline?Wt.parseInline(r,ir):Wt.parse(r,ir)}finally{tr=!1}}function sr(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");const t=[];for(const n of e.querySelectorAll("pre.mermaid"))n.setAttribute("data-diagram-text",String(t.length)),t.push(n.textContent??""),n.textContent="";e.innerHTML=ar(e.innerHTML);for(const n of e.querySelectorAll("pre[data-diagram-text]")){const e=Number(n.getAttribute("data-diagram-text"));n.removeAttribute("data-diagram-text"),n.textContent=t[e]}}const lr=(cr="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(cr);return t.forEach(sr),Array.from(t)});var cr;var ur=Object.freeze({__proto__:null,markdownToHtml:ar,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 lr(document.body);const r=document.getElementById("respec-ui");r?.remove();const o=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"),o=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),o.trim()){const t=yn(e);e.append(`\n\n${t}`)}}}(o,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),sr(o),function(e){Array.from(e).forEach(e=>{e.replaceWith(e.textContent)})}(o.querySelectorAll(".nolinks a[href]")),r&&o.append(r),document.body.replaceWith(o)}});function dr(e,t){e&&Array.from(t).forEach(([t,n])=>{e.setAttribute(`aria-${t}`,n)})}Jn(Xn,{id:"respec-ui-styles",className:"removeOnSave"});const pr=Ft`<div id="respec-ui" class="removeOnSave" hidden></div>`,hr=Ft`<ul
72
72
  id="respec-menu"
73
73
  role="menu"
74
74
  aria-labelledby="respec-pill"
75
75
  hidden
76
- ></ul>`,pr=Ft`<button
76
+ ></ul>`,fr=Ft`<button
77
77
  class="close-button"
78
- onclick=${()=>$r.closeModal()}
78
+ onclick=${()=>Sr.closeModal()}
79
79
  aria-label="Close"
80
80
  >
81
81
  ❌
82
- </button>`;let hr,fr;window.addEventListener("load",()=>vr(dr));const mr=[],gr=[],br={};Nn("start-all",()=>document.body.prepend(ur),{once:!0}),Nn("end-all",()=>document.body.prepend(ur),{once:!0});const yr=Ft`<button id="respec-pill" disabled>ReSpec</button>`;function wr(){dr.classList.toggle("respec-hidden"),dr.classList.toggle("respec-visible"),dr.hidden=!dr.hidden}function vr(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=>{const t=e;"Tab"===t.key&&(t.shiftKey?document.activeElement===n&&(r.focus(),t.preventDefault()):document.activeElement===r&&(n.focus(),t.preventDefault()))})}ur.appendChild(yr),yr.addEventListener("click",e=>{e.stopPropagation(),yr.setAttribute("aria-expanded",String(dr.hidden)),wr(),dr.querySelector("li:first-child button").focus()}),document.documentElement.addEventListener("click",()=>{dr.hidden||wr()}),ur.appendChild(dr),dr.addEventListener("keydown",e=>{"Escape"!==e.key||dr.hidden||(yr.setAttribute("aria-expanded",String(dr.hidden)),wr(),yr.focus())});const kr=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function xr(e,t,n,r){t.push(e),br.hasOwnProperty(n)||(br[n]=function(e,t,n){const r=`respec-pill-${e}`,o=Ft`<button
82
+ </button>`;let mr,gr;window.addEventListener("load",()=>xr(hr));const br=[],yr=[],wr={};Nn("start-all",()=>document.body.prepend(pr),{once:!0}),Nn("end-all",()=>document.body.prepend(pr),{once:!0});const vr=Ft`<button id="respec-pill" disabled>ReSpec</button>`;function kr(){hr.classList.toggle("respec-hidden"),hr.classList.toggle("respec-visible"),hr.hidden=!hr.hidden}function xr(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=>{const t=e;"Tab"===t.key&&(t.shiftKey?document.activeElement===n&&(r.focus(),t.preventDefault()):document.activeElement===r&&(n.focus(),t.preventDefault()))})}pr.appendChild(vr),vr.addEventListener("click",e=>{e.stopPropagation(),vr.setAttribute("aria-expanded",String(hr.hidden)),kr(),hr.querySelector("li:first-child button").focus()}),document.documentElement.addEventListener("click",()=>{hr.hidden||kr()}),pr.appendChild(hr),hr.addEventListener("keydown",e=>{"Escape"!==e.key||hr.hidden||(vr.setAttribute("aria-expanded",String(hr.hidden)),kr(),vr.focus())});const $r=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function Er(e,t,n,r){t.push(e),wr.hasOwnProperty(n)||(wr[n]=function(e,t,n){const r=`respec-pill-${e}`,o=Ft`<button
83
83
  id="${r}"
84
84
  class="respec-info-button"
85
- ></button>`;o.addEventListener("click",()=>{o.setAttribute("aria-expanded","true");const r=Ft`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(Er(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),r.appendChild(n)}$r.freshModal(n,r,o)});const i=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return cr(o,i),o}(n,t,r),ur.appendChild(br[n]));const o=br[n];o.textContent=String(t.length);const i=1===t.length?Vt.singular(r):r;cr(o,new Map([["label",`${t.length} ${i}`]]))}cr(yr,kr);const $r={show(){try{ur.hidden=!1}catch(e){console.error(e)}},hide(){ur.hidden=!0},enable(){yr.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const o=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,i=Ft`<button id="${o}" class="respec-option">
85
+ ></button>`;o.addEventListener("click",()=>{o.setAttribute("aria-expanded","true");const r=Ft`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(_r(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),r.appendChild(n)}Sr.freshModal(n,r,o)});const i=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return dr(o,i),o}(n,t,r),pr.appendChild(wr[n]));const o=wr[n];o.textContent=String(t.length);const i=1===t.length?Vt.singular(r):r;dr(o,new Map([["label",`${t.length} ${i}`]]))}dr(vr,$r);const Sr={show(){try{pr.hidden=!1}catch(e){console.error(e)}},hide(){pr.hidden=!0},enable(){vr.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const o=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,i=Ft`<button id="${o}" class="respec-option">
86
86
  <span class="respec-cmd-icon" aria-hidden="true">${r}</span> ${e}…
87
- </button>`,s=Ft`<li role="menuitem">${i}</li>`;return s.addEventListener("click",t),dr.appendChild(s),i},error(e){xr(e,mr,"error","ReSpec Errors")},warning(e){xr(e,gr,"warning","ReSpec Warnings")},closeModal(e){if(fr){const e=fr;e.classList.remove("respec-show-overlay"),e.classList.add("respec-hide-overlay"),e.addEventListener("transitionend",()=>{e.remove(),fr=null})}e&&e.setAttribute("aria-expanded","false"),hr&&(hr.remove(),hr=null,yr.focus())},freshModal(e,t,n){hr&&hr.remove(),fr&&fr.remove(),fr=Ft`<div id="respec-overlay" class="removeOnSave"></div>`;const r=`${n.id}-modal`,o=`${r}-heading`;hr=Ft`<div
87
+ </button>`,a=Ft`<li role="menuitem">${i}</li>`;return a.addEventListener("click",t),hr.appendChild(a),i},error(e){Er(e,br,"error","ReSpec Errors")},warning(e){Er(e,yr,"warning","ReSpec Warnings")},closeModal(e){if(gr){const e=gr;e.classList.remove("respec-show-overlay"),e.classList.add("respec-hide-overlay"),e.addEventListener("transitionend",()=>{e.remove(),gr=null})}e&&e.setAttribute("aria-expanded","false"),mr&&(mr.remove(),mr=null,vr.focus())},freshModal(e,t,n){mr&&mr.remove(),gr&&gr.remove(),gr=Ft`<div id="respec-overlay" class="removeOnSave"></div>`;const r=`${n.id}-modal`,o=`${r}-heading`;mr=Ft`<div
88
88
  id="${r}"
89
89
  class="respec-modal removeOnSave"
90
90
  role="dialog"
91
91
  aria-labelledby="${o}"
92
92
  >
93
- ${pr}
93
+ ${fr}
94
94
  <h3 id="${o}">${e}</h3>
95
95
  <div class="inside">${t}</div>
96
- </div>`;const i=new Map([["labelledby",o]]);cr(hr,i),document.body.append(fr,hr),fr.addEventListener("click",()=>this.closeModal(n)),fr.classList.toggle("respec-show-overlay"),hr.hidden=!1,vr(hr)}};function Er(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`\n${or(`<p class="respec-hint"><strong>How to fix:</strong> ${Tn(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 ${or(e.elements.map(Sr).join("\n"))}`:"",o=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";return`${or(`**${an(e.message)}**`,{inline:!0})}${n}${r}${o}${t}`}function Sr(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function _r(e){try{$r.show(),await async function(){"loading"===document.readyState&&await new Promise(e=>document.addEventListener("DOMContentLoaded",e))}(),await Yn(e)}finally{$r.enable()}}document.addEventListener("keydown",e=>{"Escape"===e.key&&$r.closeModal()}),window.respecUI=$r,Nn("error",e=>$r.error(e)),Nn("warn",e=>$r.warning(e)),window.addEventListener("error",e=>{console.error(e.error,e.message,e)});const Cr=[Promise.resolve().then(function(){return Lr}),Promise.resolve().then(function(){return o}),Promise.resolve().then(function(){return Or}),Promise.resolve().then(function(){return Dr}),Promise.resolve().then(function(){return qr}),Promise.resolve().then(function(){return Zr}),Promise.resolve().then(function(){return lr}),Promise.resolve().then(function(){return Kr}),Promise.resolve().then(function(){return Qr}),Promise.resolve().then(function(){return ho}),Promise.resolve().then(function(){return go}),Promise.resolve().then(function(){return bo}),Promise.resolve().then(function(){return vo}),Promise.resolve().then(function(){return xo}),Promise.resolve().then(function(){return Ni}),Promise.resolve().then(function(){return zi}),Promise.resolve().then(function(){return Zi}),Promise.resolve().then(function(){return Ki}),Promise.resolve().then(function(){return Ji}),Promise.resolve().then(function(){return os}),Promise.resolve().then(function(){return cs}),Promise.resolve().then(function(){return ps}),Promise.resolve().then(function(){return Qo}),Promise.resolve().then(function(){return Ps}),Promise.resolve().then(function(){return xs}),Promise.resolve().then(function(){return Hs}),Promise.resolve().then(function(){return li}),Promise.resolve().then(function(){return Fs}),Promise.resolve().then(function(){return Ur}),Promise.resolve().then(function(){return Us}),Promise.resolve().then(function(){return Qs}),Promise.resolve().then(function(){return ea}),Promise.resolve().then(function(){return na}),Promise.resolve().then(function(){return aa}),Promise.resolve().then(function(){return ha}),Promise.resolve().then(function(){return fa}),Promise.resolve().then(function(){return wa}),Promise.resolve().then(function(){return Ea}),Promise.resolve().then(function(){return _a}),Promise.resolve().then(function(){return Aa}),Promise.resolve().then(function(){return ja}),Promise.resolve().then(function(){return Ua}),Promise.resolve().then(function(){return Ya}),Promise.resolve().then(function(){return Xa}),Promise.resolve().then(function(){return el}),Promise.resolve().then(function(){return il}),Promise.resolve().then(function(){return ul}),Promise.resolve().then(function(){return fl}),Promise.resolve().then(function(){return bl}),Promise.resolve().then(function(){return vl}),Promise.resolve().then(function(){return $l}),Promise.resolve().then(function(){return _l})];Promise.all(Cr).then(e=>_r(e)).catch(e=>console.error(e));var Ar=Object.freeze({__proto__:null,default:'// ReSpec Worker\n"use strict";\n// hljs is either inlined by core/worker.js (preferred) or loaded below via\n// importScripts as a fallback when the inline fetch was not possible.\nif (typeof self.hljs === "undefined" && self.RESPEC_HIGHLIGHT_URL) {\n try {\n importScripts(self.RESPEC_HIGHLIGHT_URL);\n } catch (err) {\n console.error("Network error loading highlighter", err);\n }\n}\n\nself.addEventListener("message", ({ data }) => {\n switch (data.action) {\n case "highlight-load-lang": {\n const { langURL, langScript, propName, lang } = data;\n console.warn(\n `[ReSpec] The "highlight-load-lang" worker action is deprecated ` +\n `and will be removed in a future version. ` +\n `To migrate, fetch your language script in the main thread and ` +\n `send the text as "langScript" instead of "langURL". ` +\n `The "langURL" path may fail in Firefox. ` +\n `See https://github.com/speced/respec/issues/5228`\n );\n try {\n if (langScript) {\n const blob = new Blob([langScript], {\n type: "application/javascript",\n });\n const objectURL = URL.createObjectURL(blob);\n try {\n importScripts(objectURL);\n } finally {\n URL.revokeObjectURL(objectURL);\n }\n } else if (langURL) {\n const { protocol, hostname } = new URL(langURL);\n const isSecure =\n protocol === "https:" ||\n (protocol === "http:" &&\n (hostname === "localhost" ||\n hostname === "127.0.0.1" ||\n hostname === "[::1]"));\n if (!isSecure) {\n throw new Error(\n `langURL must be https: or http: on localhost, got "${langURL}"`\n );\n }\n importScripts(langURL);\n } else {\n throw new Error(\n `No langScript or langURL provided for language "${lang}"`\n );\n }\n if (typeof self[propName] === "function") {\n self.hljs.registerLanguage(lang, self[propName]);\n } else {\n throw new Error(\n `Language definer "${propName}" is not a function on self`\n );\n }\n } catch (err) {\n console.error("Failed to load or register language", lang, err);\n }\n delete data.langScript;\n delete data.langURL;\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 Object.assign(data, { value: code, language: "" });\n }\n break;\n }\n }\n self.postMessage(data);\n});\n'});var Lr=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){window.location.hash&&document.respec.ready.then(()=>{let e=decodeURIComponent(window.location.hash).slice(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)}window.location.hash=`#${e}`})}});const Rr={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,"no-dfn-in-abstract":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0};const Tr=new Map([["aom",{name:"Alliance for Open Media License",short:"AOM",url:"http://aomedia.org/license/"}]]),Pr={format:"markdown",logos:[{src:"https://aomedia.org/assets/images/aomedia-icon-only.png",alt:"AOM",id:"AOM",height:170,width:170,url:"https://aomedia.org/"}],license:"aom"};var Or=Object.freeze({__proto__:null,name:"aom/defaults",run:function(e){const t=!1!==e.lint&&{...Rr.lint,...Pr.lint,...e.lint};Object.assign(e,{...Rr,...Pr,...e,lint:t}),function(e){if(!e.hasOwnProperty("noToc"))return;e.noTOC??=e.noToc,_n("The `noToc` configuration option is deprecated.","core/defaults",{hint:Rn`Please use ${"[noTOC]"} instead.`})}(e),Object.assign(e,function(e){return{licenseInfo:Tr.get(e.license)}}(e))}});const Nr=String.raw,Ir=String.raw`color-mix(in srgb, #eaf3ff 15%, transparent)`;const jr=Jn(Nr`@keyframes pop{
96
+ </div>`;const i=new Map([["labelledby",o]]);dr(mr,i),document.body.append(gr,mr),gr.addEventListener("click",()=>this.closeModal(n)),gr.classList.toggle("respec-show-overlay"),mr.hidden=!1,xr(mr)}};function _r(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`\n${ar(`<p class="respec-hint"><strong>How to fix:</strong> ${Tn(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 ${ar(e.elements.map(Cr).join("\n"))}`:"",o=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";return`${ar(`**${sn(e.message)}**`,{inline:!0})}${n}${r}${o}${t}`}function Cr(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function Ar(e){try{Sr.show(),await async function(){"loading"===document.readyState&&await new Promise(e=>document.addEventListener("DOMContentLoaded",e))}(),await Yn(e)}finally{Sr.enable()}}document.addEventListener("keydown",e=>{"Escape"===e.key&&Sr.closeModal()}),window.respecUI=Sr,Nn("error",e=>Sr.error(e)),Nn("warn",e=>Sr.warning(e)),window.addEventListener("error",e=>{console.error(e.error,e.message,e)});const Lr=[Promise.resolve().then(function(){return Tr}),Promise.resolve().then(function(){return o}),Promise.resolve().then(function(){return Ir}),Promise.resolve().then(function(){return Mr}),Promise.resolve().then(function(){return Br}),Promise.resolve().then(function(){return Yr}),Promise.resolve().then(function(){return ur}),Promise.resolve().then(function(){return Xr}),Promise.resolve().then(function(){return eo}),Promise.resolve().then(function(){return mo}),Promise.resolve().then(function(){return yo}),Promise.resolve().then(function(){return wo}),Promise.resolve().then(function(){return xo}),Promise.resolve().then(function(){return Eo}),Promise.resolve().then(function(){return ji}),Promise.resolve().then(function(){return qi}),Promise.resolve().then(function(){return Yi}),Promise.resolve().then(function(){return Xi}),Promise.resolve().then(function(){return ta}),Promise.resolve().then(function(){return aa}),Promise.resolve().then(function(){return da}),Promise.resolve().then(function(){return fa}),Promise.resolve().then(function(){return ei}),Promise.resolve().then(function(){return Na}),Promise.resolve().then(function(){return Ea}),Promise.resolve().then(function(){return Fa}),Promise.resolve().then(function(){return ui}),Promise.resolve().then(function(){return Wa}),Promise.resolve().then(function(){return Gr}),Promise.resolve().then(function(){return Ga}),Promise.resolve().then(function(){return es}),Promise.resolve().then(function(){return ns}),Promise.resolve().then(function(){return os}),Promise.resolve().then(function(){return cs}),Promise.resolve().then(function(){return ms}),Promise.resolve().then(function(){return gs}),Promise.resolve().then(function(){return ks}),Promise.resolve().then(function(){return _s}),Promise.resolve().then(function(){return As}),Promise.resolve().then(function(){return Rs}),Promise.resolve().then(function(){return zs}),Promise.resolve().then(function(){return Gs}),Promise.resolve().then(function(){return Qs}),Promise.resolve().then(function(){return Js}),Promise.resolve().then(function(){return nl}),Promise.resolve().then(function(){return sl}),Promise.resolve().then(function(){return pl}),Promise.resolve().then(function(){return gl}),Promise.resolve().then(function(){return wl}),Promise.resolve().then(function(){return xl}),Promise.resolve().then(function(){return Sl}),Promise.resolve().then(function(){return Al})];Promise.all(Lr).then(e=>Ar(e)).catch(e=>console.error(e));var Rr=Object.freeze({__proto__:null,default:'// ReSpec Worker\n"use strict";\n// hljs is either inlined by core/worker.js (preferred) or loaded below via\n// importScripts as a fallback when the inline fetch was not possible.\nif (typeof self.hljs === "undefined" && self.RESPEC_HIGHLIGHT_URL) {\n try {\n importScripts(self.RESPEC_HIGHLIGHT_URL);\n } catch (err) {\n console.error("Network error loading highlighter", err);\n }\n}\n\nself.addEventListener("message", ({ data }) => {\n switch (data.action) {\n case "highlight-load-lang": {\n const { langURL, langScript, propName, lang } = data;\n console.warn(\n `[ReSpec] The "highlight-load-lang" worker action is deprecated ` +\n `and will be removed in a future version. ` +\n `To migrate, fetch your language script in the main thread and ` +\n `send the text as "langScript" instead of "langURL". ` +\n `The "langURL" path may fail in Firefox. ` +\n `See https://github.com/speced/respec/issues/5228`\n );\n try {\n if (langScript) {\n const blob = new Blob([langScript], {\n type: "application/javascript",\n });\n const objectURL = URL.createObjectURL(blob);\n try {\n importScripts(objectURL);\n } finally {\n URL.revokeObjectURL(objectURL);\n }\n } else if (langURL) {\n const { protocol, hostname } = new URL(langURL);\n const isSecure =\n protocol === "https:" ||\n (protocol === "http:" &&\n (hostname === "localhost" ||\n hostname === "127.0.0.1" ||\n hostname === "[::1]"));\n if (!isSecure) {\n throw new Error(\n `langURL must be https: or http: on localhost, got "${langURL}"`\n );\n }\n importScripts(langURL);\n } else {\n throw new Error(\n `No langScript or langURL provided for language "${lang}"`\n );\n }\n if (typeof self[propName] === "function") {\n self.hljs.registerLanguage(lang, self[propName]);\n } else {\n throw new Error(\n `Language definer "${propName}" is not a function on self`\n );\n }\n } catch (err) {\n console.error("Failed to load or register language", lang, err);\n }\n delete data.langScript;\n delete data.langURL;\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 Object.assign(data, { value: code, language: "" });\n }\n break;\n }\n }\n self.postMessage(data);\n});\n'});var Tr=Object.freeze({__proto__:null,name:"core/location-hash",run:function(){window.location.hash&&document.respec.ready.then(()=>{let e=decodeURIComponent(window.location.hash).slice(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)}window.location.hash=`#${e}`})}});const Pr={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,"no-dfn-in-abstract":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0};const Or=new Map([["aom",{name:"Alliance for Open Media License",short:"AOM",url:"http://aomedia.org/license/"}]]),Nr={format:"markdown",logos:[{src:"https://aomedia.org/assets/images/aomedia-icon-only.png",alt:"AOM",id:"AOM",height:170,width:170,url:"https://aomedia.org/"}],license:"aom"};var Ir=Object.freeze({__proto__:null,name:"aom/defaults",run:function(e){const t=!1!==e.lint&&{...Pr.lint,...Nr.lint,...e.lint};Object.assign(e,{...Pr,...Nr,...e,lint:t}),function(e){if(!e.hasOwnProperty("noToc"))return;e.noTOC??=e.noToc,_n("The `noToc` configuration option is deprecated.","core/defaults",{hint:Rn`Please use ${"[noTOC]"} instead.`})}(e),Object.assign(e,function(e){return{licenseInfo:Or.get(e.license)}}(e))}});const jr=String.raw,Dr=String.raw`color-mix(in srgb, #eaf3ff 15%, transparent)`;const zr=Jn(jr`@keyframes pop{
97
97
  0%{transform:scale(1,1)}
98
98
  25%{transform:scale(1.25,1.25);opacity:.75}
99
99
  100%{transform:scale(1,1)}
@@ -109,9 +109,9 @@ a.bibref{text-decoration:none}
109
109
  }
110
110
  #references :target{background:#eaf3ff;animation:pop .4s ease-in-out 0s 1}
111
111
  @media (prefers-color-scheme:dark){
112
- #references :target{background:${Ir}}
112
+ #references :target{background:${Dr}}
113
113
  }
114
- body:has(input[name=color-scheme][value=dark]:checked) #references :target{background:${Ir}}
114
+ body:has(input[name=color-scheme][value=dark]:checked) #references :target{background:${Dr}}
115
115
  cite .bibref{font-style:italic}
116
116
  a[href].orcid{padding-left:4px;padding-right:4px}
117
117
  a[href].orcid>svg{margin-bottom:-2px}
@@ -140,14 +140,14 @@ dd{margin-left:0}
140
140
  .removeOnSave{display:none}
141
141
  }
142
142
  body:has(input[name=color-scheme][value=light]:checked),head:not(:has(meta[name=color-scheme][content~=dark]))+body{color-scheme:light}
143
- body:has(input[name=color-scheme][value=dark]:checked){color-scheme:dark}`,{id:"respec-mainstyle"});var Dr=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&jr.remove()}});const zr="aom/style";const Mr=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2016/fixup.js",as:"script"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2016/base.css",as:"style"}],t=document.createDocumentFragment();for(const n of e.map(en))t.appendChild(n);return t}();Mr.appendChild(function(){const e=document.createElement("link");return e.rel="stylesheet",e.href="https://www.w3.org/StyleSheets/TR/2016/base.css",e.classList.add("removeOnSave"),e}()),document.head.querySelector("meta[name=viewport]")||Mr.prepend(function(){const e=document.createElement("meta");return e.name="viewport",e.content=function(e,t=", ",n="="){return Array.from(Object.entries(e)).map(([e,t])=>`${e}${n}${JSON.stringify(t)}`).join(t)}({width:"device-width","initial-scale":"1","shrink-to-fit":"no"}).replace(/"/g,""),e}()),document.head.prepend(Mr);var qr=Object.freeze({__proto__:null,name:zr,run:function(e){if(!e.specStatus){const t="`respecConfig.specStatus` missing. Defaulting to 'base'.";e.specStatus="base",_n(t,zr)}let t;if("PD"===e.specStatus.toUpperCase())t="W3C-UD";else t="base.css";e.noTOC||Nn("end-all",()=>{!function(e,t){const n=e.createElement("script");location.hash&&n.addEventListener("load",()=>{window.location.href=location.hash},{once:!0}),n.src=`https://www.w3.org/scripts/TR/${t}/fixup.js`,e.body.appendChild(n)}(document,"2016")},{once:!0});const n=`https://www.w3.org/StyleSheets/TR/2016/${t}`;var r;!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,n),Nn("beforesave",(r=n,e=>{const t=e.querySelector(`head link[href="${r}"]`);t&&e.querySelector("head")?.append(t)}))}});class Hr{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}static sectionClasses=new Set(["appendix","informative","notoc"]);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,this.processHeader(e,t)}processHeader(e,t){Hr.sectionClasses.intersection(new Set(e.classList)).forEach(e=>{t.classList.add(e)})}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(Br(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function Br(e){const t=new Hr(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 Fr(e){const t=Br(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 Ur=Object.freeze({__proto__:null,name:"core/sections",restructure:Fr,run:function(){Fr(document.body)}});const Wr="core/data-include";function Gr(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`);if(!r)return;const o=un(e,r.dataset.oninclude,n),i="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let o=t;"markdown"===r&&(o=or(o)),"text"===r?e.textContent=o:e.innerHTML=o,"markdown"===r&&Fr(e),n&&e.replaceWith(...e.childNodes)}(r,o,{replace:i}),i||function(e){["data-include","data-include-format","data-include-replace","data-include-id","data-oninclude"].forEach(t=>e.removeAttribute(t))}(r)}async function Vr(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 o=await fetch(n);if(!o.ok)throw new Error(`Fetching \`${n}\` failed with status code ${o.status} (${o.statusText}).`);Gr(await o.text(),r,n),t<3&&await Vr(e,t+1)}catch(t){const r=t;Sn(`\`data-include\` failed: \`${n}\` (${r.message}). Please check that the URL is correct and reachable.`,Wr,{elements:[e],cause:r})}});await Promise.all(r)}var Zr=Object.freeze({__proto__:null,name:Wr,run:async function(){await Vr(document,1)}});var Kr=Object.freeze({__proto__:null,name:"core/reindent",run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=Tn(e.innerHTML)}});const Yr="core/title",Xr=cn({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"无标题"},cs:{default_title:"Bez názvu"},fr:{default_title:"Sans titre"}});var Qr=Object.freeze({__proto__:null,name:Yr,run:function(e){const t=document.querySelector("h1#title")||Ft`<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">`.',Yr,{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||`${Xr.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=ln(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:o}=Ft`
143
+ body:has(input[name=color-scheme][value=dark]:checked){color-scheme:dark}`,{id:"respec-mainstyle"});var Mr=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&zr.remove()}});const qr="aom/style";const Hr=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2016/fixup.js",as:"script"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2016/base.css",as:"style"}],t=document.createDocumentFragment();for(const n of e.map(en))t.appendChild(n);return t}();Hr.appendChild(function(){const e=document.createElement("link");return e.rel="stylesheet",e.href="https://www.w3.org/StyleSheets/TR/2016/base.css",e.classList.add("removeOnSave"),e}()),document.head.querySelector("meta[name=viewport]")||Hr.prepend(function(){const e=document.createElement("meta");return e.name="viewport",e.content=function(e,t=", ",n="="){return Array.from(Object.entries(e)).map(([e,t])=>`${e}${n}${JSON.stringify(t)}`).join(t)}({width:"device-width","initial-scale":"1","shrink-to-fit":"no"}).replace(/"/g,""),e}()),document.head.prepend(Hr);var Br=Object.freeze({__proto__:null,name:qr,run:function(e){if(!e.specStatus){const t="`respecConfig.specStatus` missing. Defaulting to 'base'.";e.specStatus="base",_n(t,qr)}let t;if("PD"===e.specStatus.toUpperCase())t="W3C-UD";else t="base.css";e.noTOC||Nn("end-all",()=>{!function(e,t){const n=e.createElement("script");location.hash&&n.addEventListener("load",()=>{window.location.href=location.hash},{once:!0}),n.src=`https://www.w3.org/scripts/TR/${t}/fixup.js`,e.body.appendChild(n)}(document,"2016")},{once:!0});const n=`https://www.w3.org/StyleSheets/TR/2016/${t}`;var r;!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,n),Nn("beforesave",(r=n,e=>{const t=e.querySelector(`head link[href="${r}"]`);t&&e.querySelector("head")?.append(t)}))}});class Fr{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}static sectionClasses=new Set(["appendix","informative","notoc"]);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,this.processHeader(e,t)}processHeader(e,t){Fr.sectionClasses.intersection(new Set(e.classList)).forEach(e=>{t.classList.add(e)})}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(Ur(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function Ur(e){const t=new Fr(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 Wr(e){const t=Ur(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 Gr=Object.freeze({__proto__:null,name:"core/sections",restructure:Wr,run:function(){Wr(document.body)}});const Vr="core/data-include";function Zr(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`);if(!r)return;const o=un(e,r.dataset.oninclude,n),i="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let o=t;"markdown"===r&&(o=ar(o,{inline:!1,raw:!0})),"text"===r?e.textContent=o:e.innerHTML=o,"markdown"===r&&Wr(e),n&&e.replaceWith(...e.childNodes)}(r,o,{replace:i}),i||function(e){["data-include","data-include-format","data-include-replace","data-include-id","data-oninclude"].forEach(t=>e.removeAttribute(t))}(r)}async function Kr(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 o=await fetch(n);if(!o.ok)throw new Error(`Fetching \`${n}\` failed with status code ${o.status} (${o.statusText}).`);Zr(await o.text(),r,n),t<3&&await Kr(e,t+1)}catch(t){const r=t;Sn(`\`data-include\` failed: \`${n}\` (${r.message}). Please check that the URL is correct and reachable.`,Vr,{elements:[e],cause:r})}});await Promise.all(r)}var Yr=Object.freeze({__proto__:null,name:Vr,run:async function(){await Kr(document,1)}});var Xr=Object.freeze({__proto__:null,name:"core/reindent",run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=Tn(e.innerHTML)}});const Qr="core/title",Jr=cn({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"无标题"},cs:{default_title:"Bez názvu"},fr:{default_title:"Sans titre"}});var eo=Object.freeze({__proto__:null,name:Qr,run:function(e){const t=document.querySelector("h1#title")||Ft`<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">`.',Qr,{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||`${Jr.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=ln(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:o}=Ft`
144
144
  Preview of PR <a href="${n}">#${e.prNumber}</a>:
145
- `;t.prepend(...o),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});function Jr(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return _n(t,"core/templates/show-link"),void console.warn(t,e)}return Ft`
145
+ `;t.prepend(...o),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});function to(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return _n(t,"core/templates/show-link"),void console.warn(t,e)}return Ft`
146
146
  <dt class="${e.class?e.class:null}">${e.key}</dt>
147
- ${e.data?e.data.map(eo):eo(e)}
148
- `}function eo(e){return Ft`<dd class="${e.class?e.class:null}">
147
+ ${e.data?e.data.map(no):no(e)}
148
+ `}function no(e){return Ft`<dd class="${e.class?e.class:null}">
149
149
  ${e.href?Ft`<a href="${e.href}">${e.value||e.href}</a>`:e.value}
150
- </dd>`}const to="core/templates/show-logo";function no(e,t){const n=Ft`<a href="${e.url||null}" class="logo"
150
+ </dd>`}const ro="core/templates/show-logo";function oo(e,t){const n=Ft`<a href="${e.url||null}" class="logo"
151
151
  ><img
152
152
  alt="${e.alt||null}"
153
153
  crossorigin
@@ -156,7 +156,7 @@ body:has(input[name=color-scheme][value=dark]:checked){color-scheme:dark}`,{id:"
156
156
  src="${e.src||null}"
157
157
  width="${e.width||null}"
158
158
  />
159
- </a>`;if(!e.alt){const r=Rn`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;Sn(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,to,{hint:r,elements:[n]})}if(!e.src){const e=Rn`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;Sn(`Logo at index ${t} is missing "\`src\`" property.`,to,{hint:e,elements:[n]})}return n}const ro="core/templates/show-people",oo=cn({en:{until:e=>Ft` Until ${e} `},es:{until:e=>Ft` Hasta ${e} `},ko:{until:e=>Ft` ${e} 이전 `},ja:{until:e=>Ft` ${e} 以前 `},de:{until:e=>Ft` bis ${e} `},zh:{until:e=>Ft` 直到 ${e} `}});function io(e,t){const n=e[t];if(!Array.isArray(n)||!n.length)return;const r=(o=t,function(e,t){const n="https://respec.org/docs/",r=`See [person](${n}#person) configuration for available options.`,i=`Error processing the [person object](${n}#person) at index ${t} of the "[\`${o}\`](${n}#${o})" configuration option.`;if(!e.name)return Sn(`${i} Missing required property \`"name"\`.`,ro,{hint:r}),!1;if(e.orcid){const{orcid:n}=e,r=new URL(n,"https://orcid.org/");if("https://orcid.org"!==r.origin){const n=`${i} ORCID "${e.orcid}" at index ${t} is invalid.`,o=`The origin should be "https://orcid.org", not "${r.origin}".`;return Sn(n,ro,{hint:o}),!1}const o=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(o))return Sn(`${i} ORCID "${o}" has wrong format.`,ro,{hint:'ORCIDs have the format "1234-1234-1234-1234."'}),!1;if(!function(e){const t=e[e.length-1],n=e.split("").slice(0,-1).filter(e=>/\d/.test(e)).map(Number).reduce((e,t)=>2*(e+t),0),r=(12-n%11)%11,o=10===r?"X":String(r);return t===o}(n))return Sn(`${i} ORCID "${n}" failed checksum check.`,ro,{hint:"Please check that the ORCID is valid."}),!1;e.orcid=r.href}return e.retiredDate&&(s=e.retiredDate,"Invalid Date"===(/\d{4}-\d{2}-\d{2}/.test(s)?new Date(s):"Invalid Date").toString())?(Sn(`${i} The property "\`retiredDate\`" is not a valid date.`,ro,{hint:`The expected format is YYYY-MM-DD. ${r}`}),!1):!(e.hasOwnProperty("extras")&&!function(e,t,n){return Array.isArray(e)?e.every((e,r)=>{switch(!0){case"object"!=typeof e:return Sn(`${n}. Member "extra" at index ${r} is not an object.`,ro,{hint:t}),!1;case!e.hasOwnProperty("name"):return Sn(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,ro,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return Sn(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,ro,{hint:t}),!1}return!0}):(Sn(`${n}. A person's "extras" member must be an array.`,ro,{hint:t}),!1)}(e.extras??[],r,i))&&(e.url&&e.mailto&&_n(`${i} Has both "url" and "mailto" property.`,ro,{hint:`Please choose either "url" or "mailto" ("url" is preferred). ${r}`}),e.companyURL&&!e.company&&_n(`${i} Has a "\`companyURL\`" property but no "\`company\`" property.`,ro,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var s});var o;return n.filter(r).map(so)}function so(e){const t=[e.name],n=[e.company],r=e.w3cid||null,o=[];if(e.mailto&&(e.url=`mailto:${e.mailto}`),e.url){const n="mailto:"===new URL(e.url,document.location.href).protocol?"ed_mailto u-email email p-name":"u-url url p-name fn";o.push(Ft`<a class="${n}" href="${e.url}">${t}</a>`)}else o.push(Ft`<span class="p-name fn">${t}</span>`);if(e.orcid&&o.push(Ft`<a class="p-name orcid" href="${e.orcid}">${Ft`<svg
159
+ </a>`;if(!e.alt){const r=Rn`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;Sn(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,ro,{hint:r,elements:[n]})}if(!e.src){const e=Rn`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;Sn(`Logo at index ${t} is missing "\`src\`" property.`,ro,{hint:e,elements:[n]})}return n}const io="core/templates/show-people",ao=cn({en:{until:e=>Ft` Until ${e} `},es:{until:e=>Ft` Hasta ${e} `},ko:{until:e=>Ft` ${e} 이전 `},ja:{until:e=>Ft` ${e} 以前 `},de:{until:e=>Ft` bis ${e} `},zh:{until:e=>Ft` 直到 ${e} `}});function so(e,t){const n=e[t];if(!Array.isArray(n)||!n.length)return;const r=(o=t,function(e,t){const n="https://respec.org/docs/",r=`See [person](${n}#person) configuration for available options.`,i=`Error processing the [person object](${n}#person) at index ${t} of the "[\`${o}\`](${n}#${o})" configuration option.`;if(!e.name)return Sn(`${i} Missing required property \`"name"\`.`,io,{hint:r}),!1;if(e.orcid){const{orcid:n}=e,r=new URL(n,"https://orcid.org/");if("https://orcid.org"!==r.origin){const n=`${i} ORCID "${e.orcid}" at index ${t} is invalid.`,o=`The origin should be "https://orcid.org", not "${r.origin}".`;return Sn(n,io,{hint:o}),!1}const o=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(o))return Sn(`${i} ORCID "${o}" has wrong format.`,io,{hint:'ORCIDs have the format "1234-1234-1234-1234."'}),!1;if(!function(e){const t=e[e.length-1],n=e.split("").slice(0,-1).filter(e=>/\d/.test(e)).map(Number).reduce((e,t)=>2*(e+t),0),r=(12-n%11)%11,o=10===r?"X":String(r);return t===o}(n))return Sn(`${i} ORCID "${n}" failed checksum check.`,io,{hint:"Please check that the ORCID is valid."}),!1;e.orcid=r.href}return e.retiredDate&&(a=e.retiredDate,"Invalid Date"===(/\d{4}-\d{2}-\d{2}/.test(a)?new Date(a):"Invalid Date").toString())?(Sn(`${i} The property "\`retiredDate\`" is not a valid date.`,io,{hint:`The expected format is YYYY-MM-DD. ${r}`}),!1):!(e.hasOwnProperty("extras")&&!function(e,t,n){return Array.isArray(e)?e.every((e,r)=>{switch(!0){case"object"!=typeof e:return Sn(`${n}. Member "extra" at index ${r} is not an object.`,io,{hint:t}),!1;case!e.hasOwnProperty("name"):return Sn(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,io,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return Sn(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,io,{hint:t}),!1}return!0}):(Sn(`${n}. A person's "extras" member must be an array.`,io,{hint:t}),!1)}(e.extras??[],r,i))&&(e.url&&e.mailto&&_n(`${i} Has both "url" and "mailto" property.`,io,{hint:`Please choose either "url" or "mailto" ("url" is preferred). ${r}`}),e.companyURL&&!e.company&&_n(`${i} Has a "\`companyURL\`" property but no "\`company\`" property.`,io,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var a});var o;return n.filter(r).map(lo)}function lo(e){const t=[e.name],n=[e.company],r=e.w3cid||null,o=[];if(e.mailto&&(e.url=`mailto:${e.mailto}`),e.url){const n="mailto:"===new URL(e.url,document.location.href).protocol?"ed_mailto u-email email p-name":"u-url url p-name fn";o.push(Ft`<a class="${n}" href="${e.url}">${t}</a>`)}else o.push(Ft`<span class="p-name fn">${t}</span>`);if(e.orcid&&o.push(Ft`<a class="p-name orcid" href="${e.orcid}">${Ft`<svg
160
160
  width="16"
161
161
  height="16"
162
162
  xmlns="http://www.w3.org/2000/svg"
@@ -177,13 +177,13 @@ body:has(input[name=color-scheme][value=dark]:checked){color-scheme:dark}`,{id:"
177
177
  />
178
178
  </svg>`}</a>`),e.company){const t="p-org org h-org",r=e.companyURL?Ft`<a class="${t}" href="${e.companyURL}">${n}</a>`:Ft`<span class="${t}">${n}</span>`;o.push(Ft` (${r})`)}e.note&&o.push(document.createTextNode(` (${e.note})`)),e.extras&&o.push(...e.extras.map(e=>Ft`, ${function(e){const t=e.class||null,{name:n,href:r}=e;return r?Ft`<a href="${r}" class="${t}">${n}</a>`:Ft`<span class="${t}">${n}</span>`}(e)}`));const{retiredDate:i}=e;if(e.retiredDate){const e=Ft`<time datetime="${i}"
179
179
  >${Jt.format(new Date(i??""))}</time
180
- >`;o.push(Ft` - ${oo.until(e)} `)}return Ft`<dd
180
+ >`;o.push(Ft` - ${ao.until(e)} `)}return Ft`<dd
181
181
  class="editor p-author h-card vcard"
182
182
  data-editor-id="${r}"
183
183
  >
184
184
  ${o}
185
- </dd>`}const ao=cn({en:{author:"Author:",authors:"Authors:",editor:"Editor:",editors:"Editors:",former_editor:"Former editor:",former_editors:"Former editors:",latest_editors_draft:"Latest editor's draft:",latest_published_version:"Latest approved version:",this_version:"This version:",issue_tracker:"Issue Tracker:"}});var lo=e=>Ft`<div class="head">
186
- ${"PD"!==e.specStatus?(e.logos??[]).map(no):""}
185
+ </dd>`}const co=cn({en:{author:"Author:",authors:"Authors:",editor:"Editor:",editors:"Editors:",former_editor:"Former editor:",former_editors:"Former editors:",latest_editors_draft:"Latest editor's draft:",latest_published_version:"Latest approved version:",this_version:"This version:",issue_tracker:"Issue Tracker:"}});var uo=e=>Ft`<div class="head">
186
+ ${"PD"!==e.specStatus?(e.logos??[]).map(oo):""}
187
187
  ${document.querySelector("h1#title")} ${function(e){let t=document.querySelector("h2#subtitle");return t&&t.parentElement?(t.remove(),e.subtitle=t.textContent.trim()):e.subtitle&&(t=document.createElement("h2"),t.textContent=e.subtitle,t.id="subtitle"),t&&t.classList.add("subtitle"),t}(e)}
188
188
  <h2>
189
189
  ${e.textStatus} -
@@ -192,27 +192,27 @@ body:has(input[name=color-scheme][value=dark]:checked){color-scheme:dark}`,{id:"
192
192
  >
193
193
  </h2>
194
194
  <dl>
195
- <dt>${ao.this_version}</dt>
195
+ <dt>${co.this_version}</dt>
196
196
  <dd>
197
197
  <a class="u-url" href="${e.thisVersion}">${e.thisVersion}</a>
198
198
  </dd>
199
- <dt>${ao.issue_tracker}</dt>
199
+ <dt>${co.issue_tracker}</dt>
200
200
  <dd>
201
201
  <a class="u-url" href="${e.issueTracker}">${e.issueTracker}</a>
202
202
  </dd>
203
- <dt>${e.multipleEditors?ao.editors:ao.editor}</dt>
204
- ${io(e,"editors")}
203
+ <dt>${e.multipleEditors?co.editors:co.editor}</dt>
204
+ ${so(e,"editors")}
205
205
  ${Array.isArray(e.formerEditors)&&e.formerEditors.length>0?Ft`
206
206
  <dt>
207
- ${e.multipleFormerEditors?ao.former_editors:ao.former_editor}
207
+ ${e.multipleFormerEditors?co.former_editors:co.former_editor}
208
208
  </dt>
209
- ${io(e,"formerEditors")}
209
+ ${so(e,"formerEditors")}
210
210
  `:""}
211
211
  ${e.authors?Ft`
212
- <dt>${e.multipleAuthors?ao.authors:ao.author}</dt>
213
- ${io(e,"authors")}
212
+ <dt>${e.multipleAuthors?co.authors:co.author}</dt>
213
+ ${so(e,"authors")}
214
214
  `:""}
215
- ${e.otherLinks?e.otherLinks.map(Jr):""}
215
+ ${e.otherLinks?e.otherLinks.map(to):""}
216
216
  </dl>
217
217
  ${function(e){const t=document.querySelector(".copyright");if(t)return t.remove(),t;return Ft`<p class="copyright">
218
218
  Copyright ${e.publishYear},
@@ -235,74 +235,74 @@ body:has(input[name=color-scheme][value=dark]:checked){color-scheme:dark}`,{id:"
235
235
  DAMAGE.
236
236
  </p>`}(e)}
237
237
  <hr />
238
- </div>`;const co="aom/headers",uo={PD:"Pre-Draft",WGD:"AOM Work Group Draft",WGA:"AOM Working Group Approved Draft",FD:"AOM Final Deliverable"},po=new Intl.DateTimeFormat(["en-US"],{timeZone:"UTC",year:"numeric",month:"long",day:"2-digit"});var ho=Object.freeze({__proto__:null,name:co,run:function(e){if(!e.specStatus){Sn("Missing required configuration: `specStatus`",co)}e.title=document.title||"No title",e.subtitle||(e.subtitle=""),e.publishDate=function(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=Xt.format(r);return new Date(e)}return Sn(`[\`${t}\`](https://github.com/speced/respec/wiki/${t}) is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,co),new Date(Xt.format(new Date))}(e,"publishDate",document.lastModified),e.thisVersion=`https://aomediacodec.github.io/${e.shortName}/`,e.issueTracker=`https://github.com/AOMediaCodec/${e.shortName}/issues/`,e.publishYear=e.publishDate.getUTCFullYear(),e.publishHumanDate=po.format(e.publishDate);const t=function(e){if(!e.name){Sn("All authors and editors must have a name.",co)}};if(e.formerEditors||(e.formerEditors=[]),e.editors){e.editors.forEach(t);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(!e.editors||0===e.editors.length){Sn("At least one editor is required",co)}e.formerEditors.length&&e.formerEditors.forEach(t),e.authors&&e.authors.forEach(t),e.multipleEditors=e.editors&&e.editors.length>1,e.multipleFormerEditors=e.formerEditors.length>1,e.multipleAuthors=e.authors&&e.authors.length>1,e.copyrightStart&&e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.textStatus=uo[e.specStatus],e.dashDate=Xt.format(e.publishDate),e.publishISODate=e.publishDate.toISOString();const n=lo(e);document.body.prepend(n),document.body.classList.add("h-entry"),On("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:`${e.longStatus} ${e.publishHumanDate}`})}});const fo="aom/abstract",mo=cn({en:{abstract:"Abstract"}});var go=Object.freeze({__proto__:null,name:fo,run:async function(){const e=document.getElementById("abstract");if(!e){return void Sn('Document must have one element with `id="abstract"',fo)}e.classList.add("introductory");let t=document.querySelector("#abstract>h2");t||(t=document.createElement("h2"),t.textContent=mo.abstract,e.prepend(t))}});var bo=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach(e=>{e.innerHTML=un(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")})}});const yo="core/dfn-abbr";function wo(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(),o=document.createElement("abbr");o.title=r,o.textContent=t,e.after(" (",o,")");const i=e.dataset.lt||"";e.dataset.lt=i.split("|").filter(e=>e.trim()).concat(t).join("|")}var vo=Object.freeze({__proto__:null,name:yo,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)wo(t);else{Sn(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,yo,{elements:[t],title:"Error: unsupported."})}}}});var ko=String.raw`:root{--assertion-border:#aaa;--assertion-bg:#eee;--assertion-text:black}
238
+ </div>`;const po="aom/headers",ho={PD:"Pre-Draft",WGD:"AOM Work Group Draft",WGA:"AOM Working Group Approved Draft",FD:"AOM Final Deliverable"},fo=new Intl.DateTimeFormat(["en-US"],{timeZone:"UTC",year:"numeric",month:"long",day:"2-digit"});var mo=Object.freeze({__proto__:null,name:po,run:function(e){if(!e.specStatus){Sn("Missing required configuration: `specStatus`",po)}e.title=document.title||"No title",e.subtitle||(e.subtitle=""),e.publishDate=function(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=Xt.format(r);return new Date(e)}return Sn(`[\`${t}\`](https://github.com/speced/respec/wiki/${t}) is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,po),new Date(Xt.format(new Date))}(e,"publishDate",document.lastModified),e.thisVersion=`https://aomediacodec.github.io/${e.shortName}/`,e.issueTracker=`https://github.com/AOMediaCodec/${e.shortName}/issues/`,e.publishYear=e.publishDate.getUTCFullYear(),e.publishHumanDate=fo.format(e.publishDate);const t=function(e){if(!e.name){Sn("All authors and editors must have a name.",po)}};if(e.formerEditors||(e.formerEditors=[]),e.editors){e.editors.forEach(t);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(!e.editors||0===e.editors.length){Sn("At least one editor is required",po)}e.formerEditors.length&&e.formerEditors.forEach(t),e.authors&&e.authors.forEach(t),e.multipleEditors=e.editors&&e.editors.length>1,e.multipleFormerEditors=e.formerEditors.length>1,e.multipleAuthors=e.authors&&e.authors.length>1,e.copyrightStart&&e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.textStatus=ho[e.specStatus],e.dashDate=Xt.format(e.publishDate),e.publishISODate=e.publishDate.toISOString();const n=uo(e);document.body.prepend(n),document.body.classList.add("h-entry"),On("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:`${e.longStatus} ${e.publishHumanDate}`})}});const go="aom/abstract",bo=cn({en:{abstract:"Abstract"}});var yo=Object.freeze({__proto__:null,name:go,run:async function(){const e=document.getElementById("abstract");if(!e){return void Sn('Document must have one element with `id="abstract"',go)}e.classList.add("introductory");let t=document.querySelector("#abstract>h2");t||(t=document.createElement("h2"),t.textContent=bo.abstract,e.prepend(t))}});var wo=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach(e=>{e.innerHTML=un(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")})}});const vo="core/dfn-abbr";function ko(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(),o=document.createElement("abbr");o.title=r,o.textContent=t,e.after(" (",o,")");const i=e.dataset.lt||"";e.dataset.lt=i.split("|").filter(e=>e.trim()).concat(t).join("|")}var xo=Object.freeze({__proto__:null,name:vo,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)ko(t);else{Sn(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,vo,{elements:[t],title:"Error: unsupported."})}}}});var $o=String.raw`:root{--assertion-border:#aaa;--assertion-bg:#eee;--assertion-text:black}
239
239
  .assert{border-left:.5em solid #aaa;padding:.3em;border-color:#aaa;border-color:var(--assertion-border);background:#eee;background:var(--assertion-bg);color:#000;color:var(--assertion-text)}
240
240
  @media (prefers-color-scheme:dark){
241
241
  :root{--assertion-border:#444;--assertion-bg:var(--borderedblock-bg);--assertion-text:var(--text)}
242
- }`;var xo=Object.freeze({__proto__:null,name:"core/algorithms",run:function(){const e=Array.from(document.querySelectorAll("ol.algorithm li")).filter(e=>e.textContent.trim().startsWith("Assert: "));if(e.length){for(const t of e){t.classList.add("assert");const e=t.firstChild;e instanceof Text&&e.textContent.startsWith("Assert: ")&&(e.textContent=e.textContent.replace("Assert: ",""),t.prepend(Ft`<a data-cite="INFRA#assert">Assert</a>`,": "))}Jn(ko)}}});const $o=/^[a-z]+(\s+[a-z]+)+\??$/,Eo=/\B"([^"]*)"\B/,So=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,_o=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,Co=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,Ao=/^(?:\w+)\??$/,Lo=/^(\w+)\["([\w- ]*)"\]$/,Ro=/\.?(\w+\(.*\)$)/,To=/\/(.+)/,Po=/\[\[.+\]\]/;function Oo(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return Ft`<a
242
+ }`;var Eo=Object.freeze({__proto__:null,name:"core/algorithms",run:function(){const e=Array.from(document.querySelectorAll("ol.algorithm li")).filter(e=>e.textContent.trim().startsWith("Assert: "));if(e.length){for(const t of e){t.classList.add("assert");const e=t.firstChild;e instanceof Text&&e.textContent.startsWith("Assert: ")&&(e.textContent=e.textContent.replace("Assert: ",""),t.prepend(Ft`<a data-cite="INFRA#assert">Assert</a>`,": "))}Jn($o)}}});const So=/^[a-z]+(\s+[a-z]+)+\??$/,_o=/\B"([^"]*)"\B/,Co=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,Ao=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,Lo=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,Ro=/^(?:\w+)\??$/,To=/^(\w+)\["([\w- ]*)"\]$/,Po=/\.?(\w+\(.*\)$)/,Oo=/\/(.+)/,No=/\[\[.+\]\]/;function Io(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return Ft`<a
243
243
  data-xref-type="_IDL_"
244
244
  data-link-type="idl"
245
245
  data-lt="${t}"
246
246
  ><code>${t+(r?"?":"")}</code></a
247
- >`}function No(e){const{identifier:t,parent:n,slotType:r,renderParent:o,args:i}=e,{identifier:s}=n||{},a="method"===r,l=i??[],c=a?Ft`(${dn(l,Io)})`:null,u=a?`(${l.join(", ")})`:"";return Ft`${n&&o?".":""}<a
247
+ >`}function jo(e){const{identifier:t,parent:n,slotType:r,renderParent:o,args:i}=e,{identifier:a}=n||{},s="method"===r,l=i??[],c=s?Ft`(${dn(l,Do)})`:null,u=s?`(${l.join(", ")})`:"";return Ft`${n&&o?".":""}<a
248
248
  data-xref-type="${r}"
249
249
  data-link-type="${r}"
250
- data-link-for="${s}"
251
- data-xref-for="${s}"
250
+ data-link-for="${a}"
251
+ data-xref-for="${a}"
252
252
  data-lt="${`[[${t}]]${u}`}"
253
253
  ><code>[[${t}]]${c}</code></a
254
- >`}function Io(e,t,n){if(t<n.length-1)return Ft`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),o=r.length>1,i=o?r[2]:r[0];return Ft`${o?"...":null}<var>${i}</var>`}function jo(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:o}=t||{};return Ft`${r?".":""}<a
254
+ >`}function Do(e,t,n){if(t<n.length-1)return Ft`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),o=r.length>1,i=o?r[2]:r[0];return Ft`${o?"...":null}<var>${i}</var>`}function zo(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:o}=t||{};return Ft`${r?".":""}<a
255
255
  data-link-type="idl"
256
256
  data-xref-type="attribute|dict-member|const"
257
257
  data-link-for="${o}"
258
258
  data-xref-for="${o}"
259
259
  ><code>${n}</code></a
260
- >`}function Do(e){const{args:t,identifier:n,type:r,parent:o,renderParent:i}=e,{renderText:s,renderArgs:a}=e,{identifier:l}=o||{},c=dn(a||t,Io),u=`${n}(${t.join(", ")})`;return Ft`${o&&i?".":""}<a
260
+ >`}function Mo(e){const{args:t,identifier:n,type:r,parent:o,renderParent:i}=e,{renderText:a,renderArgs:s}=e,{identifier:l}=o||{},c=dn(s||t,Do),u=`${n}(${t.join(", ")})`;return Ft`${o&&i?".":""}<a
261
261
  data-link-type="idl"
262
262
  data-xref-type="${r}"
263
263
  data-link-for="${l}"
264
264
  data-xref-for="${l}"
265
265
  data-lt="${u}"
266
- ><code>${s||n}</code></a
267
- >${!s||a?Ft`<code>(${c})</code>`:""}`}function zo(e){const{identifier:t,enumValue:n,parent:r}=e,o=r?r.identifier:t;return Ft`"<a
266
+ ><code>${a||n}</code></a
267
+ >${!a||s?Ft`<code>(${c})</code>`:""}`}function qo(e){const{identifier:t,enumValue:n,parent:r}=e,o=r?r.identifier:t;return Ft`"<a
268
268
  data-link-type="idl"
269
269
  data-xref-type="enum-value"
270
270
  data-link-for="${o}"
271
271
  data-xref-for="${o}"
272
272
  data-lt="${n?null:"the-empty-string"}"
273
273
  ><code>${n}</code></a
274
- >"`}function Mo(e){const{identifier:t}=e;return Ft`"<a
274
+ >"`}function Ho(e){const{identifier:t}=e;return Ft`"<a
275
275
  data-link-type="idl"
276
276
  data-cite="webidl"
277
277
  data-xref-type="exception"
278
278
  ><code>${t}</code></a
279
- >"`}function qo(e){const{identifier:t,nullable:n}=e;return Ft`<a
279
+ >"`}function Bo(e){const{identifier:t,nullable:n}=e;return Ft`<a
280
280
  data-link-type="idl"
281
281
  data-cite="webidl"
282
282
  data-xref-type="interface"
283
283
  data-lt="${t}"
284
284
  ><code>${t+(n?"?":"")}</code></a
285
- >`}function Ho(e){let t;try{t=function(e){const t=Po.test(e),n=t?To:Ro,[r,o]=e.split(n);if(t&&r&&!o)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const i=r.split(/[./]/).concat(o).filter(e=>e&&e.trim()).map(e=>e.trim()),s=!e.includes("/"),a=[];for(;i.length;){const t=i.pop()??"";if(So.test(t)){const[,e,n,r,o]=t.match(So),i=(n??"").split(/,\s*/).filter(e=>e),l=r?.trim(),c=o?.split(/,\s*/).filter(e=>e);a.push({type:"method",identifier:e??"",args:i,renderParent:s,renderText:l,renderArgs:c});continue}if(Lo.test(t)){const[,e,n]=t.match(Lo);a.push({type:"enum",identifier:e??"",enumValue:n??"",renderParent:s});continue}if(Eo.test(t)){const[,e]=t.match(Eo);s?a.push({type:"exception",identifier:e??""}):a.push({type:"enum",enumValue:e??"",renderParent:s});continue}if(_o.test(t)){const[,e,n]=t.match(_o),r=n?"method":"attribute",o=n?.slice(1,-1).split(/,\s*/).filter(e=>e)??[];a.push({type:"internal-slot",slotType:r,identifier:e??"",args:o,renderParent:s});continue}if(Co.test(t)&&i.length){const[,e]=t.match(Co);a.push({type:"attribute",identifier:e??"",renderParent:s});continue}if($o.test(t)){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"idl-primitive",identifier:n,renderParent:s,nullable:e});continue}if(Ao.test(t)&&0===i.length){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"base",identifier:n,renderParent:s,nullable:e});continue}throw new SyntaxError(`IDL micro-syntax parsing error in \`{{ ${e} }}\``)}return a.forEach((e,t,n)=>{e.parent=n[t+1]||null}),a.reverse()}(e)}catch(t){const n=Ft`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return Sn(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=Ft(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Oo(e);t&&r.push(t);break}case"attribute":r.push(jo(e));break;case"internal-slot":r.push(No(e));break;case"method":r.push(Do(e));break;case"enum":r.push(zo(e));break;case"exception":r.push(Mo(e));break;case"idl-primitive":r.push(qo(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const Bo=new Set(["alias","reference"]),Fo=async function(){const e=await Ut.openDB("respec-biblio2",12,{upgrade(e){Array.from(e.objectStoreNames).map(t=>e.deleteObjectStore(t));e.createObjectStore("alias",{keyPath:"id"}).createIndex("aliasOf","aliasOf",{unique:!1}),e.createObjectStore("reference",{keyPath:"id"})}}),t=Date.now();for(const n of[...Bo]){const r=e.transaction(n,"readwrite"),o=IDBKeyRange.lowerBound(t),i=async()=>{let e=await r.store.openCursor(o);for(;e?.value;){const n=e.value;(void 0===n.expires||n.expires<t)&&await r.store.delete(n.id),e=await e.continue()}};await Promise.all([i(),r.done])}return e}();const Uo={get ready(){return Fo},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)??e),await this.get("reference",e)},async has(e,t){if(!Bo.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t);return!!await n.openCursor(r)},async isAlias(e){return await this.has("alias",e)},async resolveAlias(e){if(!e)throw new TypeError("id is required");const t=(await this.ready).transaction("alias","readonly").store,n=IDBKeyRange.only(e),r=await t.openCursor(n);return r?r.value.aliasOf:null},async get(e,t){if(!Bo.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t),o=await n.openCursor(r);return o?o.value:null},async addAll(e,t){if(!e)return;const n={alias:[],reference:[]};for(const r of Object.keys(e)){const o={id:r,...e[r],expires:t};o.aliasOf?n.alias.push(o):n.reference.push(o)}const r=[...Bo].flatMap(e=>n[e].map(t=>this.add(e,t)));await Promise.all(r)},async add(e,t){if(!Bo.has(e))throw new TypeError(`Invalid type: ${e}`);if("object"!=typeof t)throw new TypeError("details should be an object");if("alias"===e&&!t.hasOwnProperty("aliasOf"))throw new TypeError("Invalid alias object.");const n=await this.ready;let r=await this.has(e,t.id);if(r){const o=await this.get(e,t.id);if(o&&void 0!==o.expires&&o.expires<Date.now()){const o=n.transaction(e,"readwrite");await Promise.all([o.store.delete(t.id),o.done]),r=!1}}const o=n.transaction(e,"readwrite"),[i]=await Promise.all([r?o.store.put(t):o.store.add(t),o.done]);return i},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...Bo],n=e.transaction(t,"readwrite"),r=t.map(e=>n.objectStore(e).clear());await Promise.all([...r,n.done])}},Wo={},Go=[new URL("https://api.specref.org/bibrefs?refs="),new URL("https://respec.org/bibrefs?refs=")],Vo=en({hint:"dns-prefetch",href:Go[0].origin});let Zo;document.head.appendChild(Vo);const Ko=new Promise(e=>{Zo=e});async function Yo(e){const t=[...new Set(e)].filter(e=>e.trim());if(!t.length||!1===navigator.onLine)return null;const n=await async function(e){for(const t of Go){let n;try{n=await fetch(t.href+e,{signal:AbortSignal.timeout(2e3)})}catch(e){console.warn(`Could not reach ${t.origin} for references.`,e);continue}if(200===n.status)try{return{data:await n.json(),expires:n.headers.get("Expires")}}catch(e){console.warn(`${t.origin} sent references that are not JSON.`,e)}else console.warn(`${t.origin} answered ${n.status} for references.`)}return null}(t.join(","));if(!n)return null;const{data:r,expires:o}=n,i=Date.now()+36e5;try{const e=Date.parse(o||""),t=Number.isNaN(e)?i:Math.min(e,i);await Uo.addAll(r,t)}catch(e){console.error(e)}return r}async function Xo(e){const t=await Ko;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await Xo(n.aliasOf):n}var Qo=Object.freeze({__proto__:null,Plugin:class{constructor(e){this.conf=e}normalizeReferences(){const e=new Set([...this.conf.normativeReferences].map(e=>e.toLowerCase()));Array.from(this.conf.informativeReferences).filter(t=>e.has(t.toLowerCase())).forEach(e=>this.conf.informativeReferences.delete(e))}getRefKeys(){return{informativeReferences:Array.from(this.conf.informativeReferences),normativeReferences:Array.from(this.conf.normativeReferences)}}async run(){this.conf.localBiblio||(this.conf.localBiblio={}),this.conf.biblio=Wo;const e=Object.keys(this.conf.localBiblio).filter(e=>this.conf.localBiblio?.[e]?.hasOwnProperty("aliasOf")).map(e=>this.conf.localBiblio?.[e]?.aliasOf).filter(e=>e&&!this.conf.localBiblio?.hasOwnProperty(e));this.normalizeReferences();const t=this.getRefKeys(),n=Array.from(new Set(t.normativeReferences.concat(t.informativeReferences).filter(e=>!this.conf.localBiblio?.hasOwnProperty(e)).concat(e.filter(Boolean)).sort())),r=n.length?await async function(e){const t=[];try{await Uo.ready;const n=e.map(async e=>({id:e,data:await Uo.find(e)}));t.push(...await Promise.all(n))}catch(n){t.push(...e.map(e=>({id:e,data:null}))),console.warn(n)}return t}(n):[],o={hasData:[],noData:[]};r.forEach(e=>{(e.data?o.hasData:o.noData).push(e)}),o.hasData.forEach(e=>{e.data&&(Wo[e.id]=e.data)});const i=o.noData.map(e=>e.id);if(i.length){const e=await Yo(i);Object.assign(Wo,e)}Object.assign(Wo,this.conf.localBiblio),(()=>{Zo(this.conf.biblio)})()}},biblio:Wo,name:"core/biblio",resolveRef:Xo,updateFromNetwork:Yo});const Jo="core/render-biblio";function ei(e){return`bib-${pn(e)}`}const ti=cn({en:{info_references:"Informative references",norm_references:"Normative references",references:"References",reference_not_found:"Reference not found."},ko:{references:"참조"},nl:{info_references:"Informatieve referenties",norm_references:"Normatieve referenties",references:"Referenties"},es:{info_references:"Referencias informativas",norm_references:"Referencias normativas",references:"Referencias",reference_not_found:"Referencia no encontrada."},fr:{info_references:"Références informatives",norm_references:"Références normatives",references:"Références",reference_not_found:"Référence non trouvée."},ja:{info_references:"参照用参考文献",norm_references:"規範的参考文献",references:"参考文献"},de:{info_references:"Weiterführende Informationen",norm_references:"Normen und Spezifikationen",references:"Referenzen"},zh:{info_references:"非规范性引用",norm_references:"规范性引用",references:"参考文献"},cs:{info_references:"Informativní odkazy",norm_references:"Normativní odkazy",references:"Odkazy",reference_not_found:"Odkaz nebyl nalezen."}}),ni=new Map([["CR","W3C Candidate Recommendation"],["ED","W3C Editor's Draft"],["LCWD","W3C Last Call Working Draft"],["NOTE","W3C Working Group Note"],["PR","W3C Proposed Recommendation"],["REC","W3C Recommendation"],["WD","W3C Working Draft"]]);function ri(e,t){const{goodRefs:n,badRefs:r}=function(e){const t=[],n=[];for(const r of e)r.refcontent?t.push(r):n.push(r);return{goodRefs:t,badRefs:n}}(e.map(oi)),o=function(e){const t=new Map;for(const n of e)t.has(n.refcontent?.id??"")||t.set(n.refcontent?.id??"",n);return[...t.values()]}(n),i=o.concat(r).sort((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase())),s=Ft`<section>
285
+ >`}function Fo(e){let t;try{t=function(e){const t=No.test(e),n=t?Oo:Po,[r,o]=e.split(n);if(t&&r&&!o)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const i=r.split(/[./]/).concat(o).filter(e=>e&&e.trim()).map(e=>e.trim()),a=!e.includes("/"),s=[];for(;i.length;){const t=i.pop()??"";if(Co.test(t)){const[,e,n,r,o]=t.match(Co),i=(n??"").split(/,\s*/).filter(e=>e),l=r?.trim(),c=o?.split(/,\s*/).filter(e=>e);s.push({type:"method",identifier:e??"",args:i,renderParent:a,renderText:l,renderArgs:c});continue}if(To.test(t)){const[,e,n]=t.match(To);s.push({type:"enum",identifier:e??"",enumValue:n??"",renderParent:a});continue}if(_o.test(t)){const[,e]=t.match(_o);a?s.push({type:"exception",identifier:e??""}):s.push({type:"enum",enumValue:e??"",renderParent:a});continue}if(Ao.test(t)){const[,e,n]=t.match(Ao),r=n?"method":"attribute",o=n?.slice(1,-1).split(/,\s*/).filter(e=>e)??[];s.push({type:"internal-slot",slotType:r,identifier:e??"",args:o,renderParent:a});continue}if(Lo.test(t)&&i.length){const[,e]=t.match(Lo);s.push({type:"attribute",identifier:e??"",renderParent:a});continue}if(So.test(t)){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;s.push({type:"idl-primitive",identifier:n,renderParent:a,nullable:e});continue}if(Ro.test(t)&&0===i.length){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;s.push({type:"base",identifier:n,renderParent:a,nullable:e});continue}throw new SyntaxError(`IDL micro-syntax parsing error in \`{{ ${e} }}\``)}return s.forEach((e,t,n)=>{e.parent=n[t+1]||null}),s.reverse()}(e)}catch(t){const n=Ft`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return Sn(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=Ft(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Io(e);t&&r.push(t);break}case"attribute":r.push(zo(e));break;case"internal-slot":r.push(jo(e));break;case"method":r.push(Mo(e));break;case"enum":r.push(qo(e));break;case"exception":r.push(Ho(e));break;case"idl-primitive":r.push(Bo(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const Uo=new Set(["alias","reference"]),Wo=async function(){const e=await Ut.openDB("respec-biblio2",12,{upgrade(e){Array.from(e.objectStoreNames).map(t=>e.deleteObjectStore(t));e.createObjectStore("alias",{keyPath:"id"}).createIndex("aliasOf","aliasOf",{unique:!1}),e.createObjectStore("reference",{keyPath:"id"})}}),t=Date.now();for(const n of[...Uo]){const r=e.transaction(n,"readwrite"),o=IDBKeyRange.lowerBound(t),i=async()=>{let e=await r.store.openCursor(o);for(;e?.value;){const n=e.value;(void 0===n.expires||n.expires<t)&&await r.store.delete(n.id),e=await e.continue()}};await Promise.all([i(),r.done])}return e}();const Go={get ready(){return Wo},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)??e),await this.get("reference",e)},async has(e,t){if(!Uo.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t);return!!await n.openCursor(r)},async isAlias(e){return await this.has("alias",e)},async resolveAlias(e){if(!e)throw new TypeError("id is required");const t=(await this.ready).transaction("alias","readonly").store,n=IDBKeyRange.only(e),r=await t.openCursor(n);return r?r.value.aliasOf:null},async get(e,t){if(!Uo.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t),o=await n.openCursor(r);return o?o.value:null},async addAll(e,t){if(!e)return;const n={alias:[],reference:[]};for(const r of Object.keys(e)){const o={id:r,...e[r],expires:t};o.aliasOf?n.alias.push(o):n.reference.push(o)}const r=[...Uo].flatMap(e=>n[e].map(t=>this.add(e,t)));await Promise.all(r)},async add(e,t){if(!Uo.has(e))throw new TypeError(`Invalid type: ${e}`);if("object"!=typeof t)throw new TypeError("details should be an object");if("alias"===e&&!t.hasOwnProperty("aliasOf"))throw new TypeError("Invalid alias object.");const n=await this.ready;let r=await this.has(e,t.id);if(r){const o=await this.get(e,t.id);if(o&&void 0!==o.expires&&o.expires<Date.now()){const o=n.transaction(e,"readwrite");await Promise.all([o.store.delete(t.id),o.done]),r=!1}}const o=n.transaction(e,"readwrite"),[i]=await Promise.all([r?o.store.put(t):o.store.add(t),o.done]);return i},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...Uo],n=e.transaction(t,"readwrite"),r=t.map(e=>n.objectStore(e).clear());await Promise.all([...r,n.done])}},Vo={},Zo=[new URL("https://api.specref.org/bibrefs?refs="),new URL("https://respec.org/bibrefs?refs=")],Ko=en({hint:"dns-prefetch",href:Zo[0].origin});let Yo;document.head.appendChild(Ko);const Xo=new Promise(e=>{Yo=e});async function Qo(e){const t=[...new Set(e)].filter(e=>e.trim());if(!t.length||!1===navigator.onLine)return null;const n=await async function(e){for(const t of Zo){let n;try{n=await fetch(t.href+e,{signal:AbortSignal.timeout(2e3)})}catch(e){console.warn(`Could not reach ${t.origin} for references.`,e);continue}if(200===n.status)try{return{data:await n.json(),expires:n.headers.get("Expires")}}catch(e){console.warn(`${t.origin} sent references that are not JSON.`,e)}else console.warn(`${t.origin} answered ${n.status} for references.`)}return null}(t.join(","));if(!n)return null;const{data:r,expires:o}=n,i=Date.now()+36e5;try{const e=Date.parse(o||""),t=Number.isNaN(e)?i:Math.min(e,i);await Go.addAll(r,t)}catch(e){console.error(e)}return r}async function Jo(e){const t=await Xo;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await Jo(n.aliasOf):n}var ei=Object.freeze({__proto__:null,Plugin:class{constructor(e){this.conf=e}normalizeReferences(){const e=new Set([...this.conf.normativeReferences].map(e=>e.toLowerCase()));Array.from(this.conf.informativeReferences).filter(t=>e.has(t.toLowerCase())).forEach(e=>this.conf.informativeReferences.delete(e))}getRefKeys(){return{informativeReferences:Array.from(this.conf.informativeReferences),normativeReferences:Array.from(this.conf.normativeReferences)}}async run(){this.conf.localBiblio||(this.conf.localBiblio={}),this.conf.biblio=Vo;const e=Object.keys(this.conf.localBiblio).filter(e=>this.conf.localBiblio?.[e]?.hasOwnProperty("aliasOf")).map(e=>this.conf.localBiblio?.[e]?.aliasOf).filter(e=>e&&!this.conf.localBiblio?.hasOwnProperty(e));this.normalizeReferences();const t=this.getRefKeys(),n=Array.from(new Set(t.normativeReferences.concat(t.informativeReferences).filter(e=>!this.conf.localBiblio?.hasOwnProperty(e)).concat(e.filter(Boolean)).sort())),r=n.length?await async function(e){const t=[];try{await Go.ready;const n=e.map(async e=>({id:e,data:await Go.find(e)}));t.push(...await Promise.all(n))}catch(n){t.push(...e.map(e=>({id:e,data:null}))),console.warn(n)}return t}(n):[],o={hasData:[],noData:[]};r.forEach(e=>{(e.data?o.hasData:o.noData).push(e)}),o.hasData.forEach(e=>{e.data&&(Vo[e.id]=e.data)});const i=o.noData.map(e=>e.id);if(i.length){const e=await Qo(i);Object.assign(Vo,e)}Object.assign(Vo,this.conf.localBiblio),(()=>{Yo(this.conf.biblio)})()}},biblio:Vo,name:"core/biblio",resolveRef:Jo,updateFromNetwork:Qo});const ti="core/render-biblio";function ni(e){return`bib-${pn(e)}`}const ri=cn({en:{info_references:"Informative references",norm_references:"Normative references",references:"References",reference_not_found:"Reference not found."},ko:{references:"참조"},nl:{info_references:"Informatieve referenties",norm_references:"Normatieve referenties",references:"Referenties"},es:{info_references:"Referencias informativas",norm_references:"Referencias normativas",references:"Referencias",reference_not_found:"Referencia no encontrada."},fr:{info_references:"Références informatives",norm_references:"Références normatives",references:"Références",reference_not_found:"Référence non trouvée."},ja:{info_references:"参照用参考文献",norm_references:"規範的参考文献",references:"参考文献"},de:{info_references:"Weiterführende Informationen",norm_references:"Normen und Spezifikationen",references:"Referenzen"},zh:{info_references:"非规范性引用",norm_references:"规范性引用",references:"参考文献"},cs:{info_references:"Informativní odkazy",norm_references:"Normativní odkazy",references:"Odkazy",reference_not_found:"Odkaz nebyl nalezen."}}),oi=new Map([["CR","W3C Candidate Recommendation"],["ED","W3C Editor's Draft"],["LCWD","W3C Last Call Working Draft"],["NOTE","W3C Working Group Note"],["PR","W3C Proposed Recommendation"],["REC","W3C Recommendation"],["WD","W3C Working Draft"]]);function ii(e,t){const{goodRefs:n,badRefs:r}=function(e){const t=[],n=[];for(const r of e)r.refcontent?t.push(r):n.push(r);return{goodRefs:t,badRefs:n}}(e.map(ai)),o=function(e){const t=new Map;for(const n of e)t.has(n.refcontent?.id??"")||t.set(n.refcontent?.id??"",n);return[...t.values()]}(n),i=o.concat(r).sort((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase())),a=Ft`<section>
286
286
  <h3>${t}</h3>
287
- <dl class="bibliography">${i.map(si)}</dl>
288
- </section>`;hn(s,"",t);const a=function(e){const t=new Map;for(const n of e){const e=n.refcontent?.id??"",r=t.has(e)?t.get(e):t.set(e,[]).get(e);r?.push(n.ref)}return t}(n);return function(e,t){e.map(({ref:e,refcontent:n})=>{const r=`#${ei(e)}`,o=(t.get(n.id??"")??[]).map(e=>`a.bibref[href="#${ei(e)}"]`).join(",");return{refUrl:r,elems:document.querySelectorAll(o),refcontent:n}}).forEach(({refUrl:e,elems:t,refcontent:n})=>{t.forEach(t=>{t.setAttribute("href",e),t.setAttribute("title",n.title),t.dataset.linkType="biblio"})})}(o,a),function(e){for(const{ref:t}of e){const e=[...document.querySelectorAll(`a.bibref[href="#${ei(t)}"]`)].filter(({textContent:e})=>e.toLowerCase()===t.toLowerCase());Sn(`Reference "[${t}]" not found.`,Jo,{hint:`Search for ["${t}"](https://www.specref.org?q=${t}) on Specref to see if it exists or if it's misspelled.`,elements:e})}}(r),s}function oi(e){let t=Wo[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;Sn(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,Jo)}else n=t.aliasOf,t=Wo[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function ii(e,t){const n=e.replace(/^(!|\?)/,""),r=`#${ei(n)}`,o=Ft`<cite
287
+ <dl class="bibliography">${i.map(li)}</dl>
288
+ </section>`;hn(a,"",t);const s=function(e){const t=new Map;for(const n of e){const e=n.refcontent?.id??"",r=t.has(e)?t.get(e):t.set(e,[]).get(e);r?.push(n.ref)}return t}(n);return function(e,t){e.map(({ref:e,refcontent:n})=>{const r=`#${ni(e)}`,o=(t.get(n.id??"")??[]).map(e=>`a.bibref[href="#${ni(e)}"]`).join(",");return{refUrl:r,elems:document.querySelectorAll(o),refcontent:n}}).forEach(({refUrl:e,elems:t,refcontent:n})=>{t.forEach(t=>{t.setAttribute("href",e),t.setAttribute("title",n.title),t.dataset.linkType="biblio"})})}(o,s),function(e){for(const{ref:t}of e){const e=[...document.querySelectorAll(`a.bibref[href="#${ni(t)}"]`)].filter(({textContent:e})=>e.toLowerCase()===t.toLowerCase());Sn(`Reference "[${t}]" not found.`,ti,{hint:`Search for ["${t}"](https://www.specref.org?q=${t}) on Specref to see if it exists or if it's misspelled.`,elements:e})}}(r),a}function ai(e){let t=Vo[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;Sn(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,ti)}else n=t.aliasOf,t=Vo[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function si(e,t){const n=e.replace(/^(!|\?)/,""),r=`#${ni(n)}`,o=Ft`<cite
289
289
  ><a class="bibref" href="${r}" data-link-type="biblio">${t||n}</a></cite
290
- >`;return t?o:Ft`[${o}]`}function si(e){const{ref:t,refcontent:n}=e,r=ei(t);return Ft`
290
+ >`;return t?o:Ft`[${o}]`}function li(e){const{ref:t,refcontent:n}=e,r=ni(t);return Ft`
291
291
  <dt id="${r}">[${t}]</dt>
292
292
  <dd>
293
- ${n?{html:ai(n)}:Ft`<em class="respec-offending-element"
294
- >${ti.reference_not_found}</em
293
+ ${n?{html:ci(n)}:Ft`<em class="respec-offending-element"
294
+ >${ri.reference_not_found}</em
295
295
  >`}
296
296
  </dd>
297
- `}function ai(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;if(t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors){if(!Array.isArray(e.authors)){const t=`The "authors" field in reference "${e.id||e.title}" must be an array.`,n=`Use \`authors: [${JSON.stringify(e.authors)}]\` instead of \`authors: ${JSON.stringify(e.authors)}\`.`;Sn(t,Jo,{hint:n}),e.authors=[e.authors]}e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t.endsWith(".")||(t+=". "))}if(e.publisher){const n=e.pages?",":".",r=e.publisher.trim();t=`${t} ${r.endsWith(".")?r.slice(0,-1):r}${n} `}return e.pages&&(t+=`pp. ${an(e.pages)}. `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${ni.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var li=Object.freeze({__proto__:null,name:Jo,renderInlineCitation:ii,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")||Ft`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(Ft`<h1>${ti.references}</h1>`),r.classList.add("appendix"),n.length){const e=ri(n,ti.norm_references);r.appendChild(e)}if(t.length){const e=ri(t,ti.info_references);r.appendChild(e)}document.body.appendChild(r)}});const ci="core/inlines",ui={},di=e=>new RegExp(e.map(e=>e.source).join("|")),pi=cn({en:{rfc2119Keywords:()=>di([/\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:()=>di([/\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/])}}),hi=/(?:`[^`]+`)(?!`)/,fi=/(?:{{[^}]+\?*}})/,mi=/\B\|\w[\w\s]*(?:\s*:[\w\s&;"?<>]+\??)?\|\B/,gi=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,bi=/(?:\[\[\[[^\]]+\]\]\])/,yi=/(?:\[=[^=]+=\])/,wi=/(?:\[\^[^^]+\^\])/,vi=/(?:\{\^[^}^]+\^\})/;function ki(e){const t=e.slice(2,-2).trim(),[n,r,o]=t.split("/",3).map(e=>e&&e.trim()).filter(e=>!!e),[i,s,a]=t.startsWith("/")?["element-attr",null,n]:o?["attr-value",`${n}/${r}`,o]:r?["element-attr",n,r]:["element",null,n];return Ft`<code
297
+ `}function ci(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;if(t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors){if(!Array.isArray(e.authors)){const t=`The "authors" field in reference "${e.id||e.title}" must be an array.`,n=`Use \`authors: [${JSON.stringify(e.authors)}]\` instead of \`authors: ${JSON.stringify(e.authors)}\`.`;Sn(t,ti,{hint:n}),e.authors=[e.authors]}e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t.endsWith(".")||(t+=". "))}if(e.publisher){const n=e.pages?",":".",r=e.publisher.trim();t=`${t} ${r.endsWith(".")?r.slice(0,-1):r}${n} `}return e.pages&&(t+=`pp. ${sn(e.pages)}. `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${oi.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var ui=Object.freeze({__proto__:null,name:ti,renderInlineCitation:si,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")||Ft`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(Ft`<h1>${ri.references}</h1>`),r.classList.add("appendix"),n.length){const e=ii(n,ri.norm_references);r.appendChild(e)}if(t.length){const e=ii(t,ri.info_references);r.appendChild(e)}document.body.appendChild(r)}});const di="core/inlines",pi={},hi=e=>new RegExp(e.map(e=>e.source).join("|")),fi=cn({en:{rfc2119Keywords:()=>hi([/\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:()=>hi([/\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/])}}),mi=/(?:`[^`]+`)(?!`)/,gi=/(?:{{[^}]+\?*}})/,bi=/\B\|\w[\w\s]*(?:\s*:[\w\s&;"?<>]+\??)?\|\B/,yi=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,wi=/(?:\[\[\[[^\]]+\]\]\])/,vi=/(?:\[=[^=]+=\])/,ki=/(?:\[\^[^^]+\^\])/,xi=/(?:\{\^[^}^]+\^\})/;function $i(e){const t=e.slice(2,-2).trim(),[n,r,o]=t.split("/",3).map(e=>e&&e.trim()).filter(e=>!!e),[i,a,s]=t.startsWith("/")?["element-attr",null,n]:o?["attr-value",`${n}/${r}`,o]:r?["element-attr",n,r]:["element",null,n];return Ft`<code
298
298
  ><a
299
299
  data-xref-type="${i}"
300
- data-xref-for="${s}"
300
+ data-xref-for="${a}"
301
301
  data-link-type="${i}"
302
- data-link-for="${s}"
303
- >${a}</a
302
+ data-link-for="${a}"
303
+ >${s}</a
304
304
  ></code
305
- >`}function xi(e){const t=(e.slice(2,-2).trim().match(/"([^"]*)"|([^/]+)/g)||[]).map(e=>e.trim());if(1===t.length){const e=t[0];return Ft`<code
305
+ >`}function Ei(e){const t=(e.slice(2,-2).trim().match(/"([^"]*)"|([^/]+)/g)||[]).map(e=>e.trim());if(1===t.length){const e=t[0];return Ft`<code
306
306
  ><a data-link-type="cddl-type" data-xref-type="cddl-type"
307
307
  >${e}</a
308
308
  ></code
@@ -314,10 +314,10 @@ body:has(input[name=color-scheme][value=dark]:checked){color-scheme:dark}`,{id:"
314
314
  data-link-for="${n}"
315
315
  >${r}</a
316
316
  ></code
317
- >`}function $i(e){const t=ln(e),n=Ft`<em class="rfc2119">${t}</em>`;return ui[t]=!0,n}const Ei=/^(?:!|\\|\?)?(?:#[\w-.]+|[\w-.]+(?:#[\w-.]+)?)(?:\|[^\]]+)?$/;function Si(e){const t=e.slice(3,-3).trim();if(!Ei.test(t)){return _n(`Bad syntax: \`${e}\` is not a valid inline expansion.`,ci,{hint:"See https://github.com/speced/respec/wiki/inlines for valid syntax."}),e}const n=t.indexOf("|"),r=-1!==n?t.slice(n+1).trim():null,o=-1!==n?t.slice(0,n).trim():t,i=o.replace(/^[!?\\]/,"");if(o.startsWith("\\"))return`[[[${i}]]]`;if(i.startsWith("#"))return r?Ft`<a href="${i}" data-matched-text="${e}"
318
- >${Pi(r)}</a
319
- >`:Ft`<a href="${i}" data-matched-text="${e}"></a>`;if(i.includes("#")){const[t,n]=i.split("#"),s=o.slice(0,o.length-i.length)+t;return Ft`<a
320
- data-cite="${s}"
317
+ >`}function Si(e){const t=ln(e),n=Ft`<em class="rfc2119">${t}</em>`;return pi[t]=!0,n}const _i=/^(?:!|\\|\?)?(?:#[\w-.]+|[\w-.]+(?:#[\w-.]+)?)(?:\|[^\]]+)?$/;function Ci(e){const t=e.slice(3,-3).trim();if(!_i.test(t)){return _n(`Bad syntax: \`${e}\` is not a valid inline expansion.`,di,{hint:"See https://github.com/speced/respec/wiki/inlines for valid syntax."}),e}const n=t.indexOf("|"),r=-1!==n?t.slice(n+1).trim():null,o=-1!==n?t.slice(0,n).trim():t,i=o.replace(/^[!?\\]/,"");if(o.startsWith("\\"))return`[[[${i}]]]`;if(i.startsWith("#"))return r?Ft`<a href="${i}" data-matched-text="${e}"
318
+ >${Ni(r)}</a
319
+ >`:Ft`<a href="${i}" data-matched-text="${e}"></a>`;if(i.includes("#")){const[t,n]=i.split("#"),a=o.slice(0,o.length-i.length)+t;return Ft`<a
320
+ data-cite="${a}"
321
321
  data-cite-frag="${n}"
322
322
  data-matched-text="${e}"
323
323
  data-lt="${r||null}"
@@ -325,33 +325,33 @@ body:has(input[name=color-scheme][value=dark]:checked){color-scheme:dark}`,{id:"
325
325
  data-cite="${o}"
326
326
  data-matched-text="${e}"
327
327
  data-lt="${r||null}"
328
- ></a>`}function _i(e,t){const n=ln(e.slice(2,-2));if(n.startsWith("\\"))return e.replace(/^(\{\{\s*)\\/,"$1");const r=Ho(n);return!!t.parentElement?.closest("dfn,a")?Ti(`\`${r.textContent}\``):r}function Ci(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[o,i]=r.split("|").map(ln),s=o.replace(/^(!|\?)/,"");if(n.shortName&&s.toLowerCase()===n.shortName.toLowerCase()){const e=n.title||s;return[Ft`<cite title="${n.shortName}">${e}</cite>`]}const{type:a,illegal:l}=gn(o,t.parentElement),c=ii(o,i);if(l&&!n.normativeReferences.has(s)){const e=c.childNodes[1]||c;_n("Normative references in informative sections are not allowed. ",ci,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==a||l?n.normativeReferences.add(s):n.informativeReferences.add(s),c.childNodes[1]?c.childNodes:[c]}function Ai(e,t,n){return"ABBR"===t.parentElement?.tagName?e:Ft`<abbr title="${n.get(e)}">${e}</abbr>`}function Li(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map(e=>e.trim());return Ft`<var data-type="${r}">${n}</var>`}function Ri(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(ln).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const o=n.substring(0,r),i=n.substring(r+1,n.length);return[t(o),t(i)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[o,i]=r.includes("|")?r.split("|",2).map(e=>e.trim()):[null,r],s=Pi(i),a=n?ln(n):null;return Ft`<a
328
+ ></a>`}function Ai(e,t){const n=ln(e.slice(2,-2));if(n.startsWith("\\"))return e.replace(/^(\{\{\s*)\\/,"$1");const r=Fo(n);return!!t.parentElement?.closest("dfn,a")?Oi(`\`${r.textContent}\``):r}function Li(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[o,i]=r.split("|").map(ln),a=o.replace(/^(!|\?)/,"");if(n.shortName&&a.toLowerCase()===n.shortName.toLowerCase()){const e=n.title||a;return[Ft`<cite title="${n.shortName}">${e}</cite>`]}const{type:s,illegal:l}=gn(o,t.parentElement),c=si(o,i);if(l&&!n.normativeReferences.has(a)){const e=c.childNodes[1]||c;_n("Normative references in informative sections are not allowed. ",di,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==s||l?n.normativeReferences.add(a):n.informativeReferences.add(a),c.childNodes[1]?c.childNodes:[c]}function Ri(e,t,n){return"ABBR"===t.parentElement?.tagName?e:Ft`<abbr title="${n.get(e)}">${e}</abbr>`}function Ti(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map(e=>e.trim());return Ft`<var data-type="${r}">${n}</var>`}function Pi(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(ln).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const o=n.substring(0,r),i=n.substring(r+1,n.length);return[t(o),t(i)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[o,i]=r.includes("|")?r.split("|",2).map(e=>e.trim()):[null,r],a=Ni(i),s=n?ln(n):null;return Ft`<a
329
329
  data-link-type="dfn|abstract-op"
330
- data-link-for="${a}"
331
- data-xref-for="${a}"
330
+ data-link-for="${s}"
331
+ data-xref-for="${s}"
332
332
  data-lt="${o}"
333
- >${s}</a
334
- >`}function Ti(e){const t=e.slice(1,-1);return Ft`<code>${t}</code>`}function Pi(e){return hi.test(e)?e.split(/(`[^`]+`)(?!`)/).map(e=>e.startsWith("`")?Ti(e):Pi(e)):document.createTextNode(e)}function Oi(e,t){e.textContent="";const n=Pi(t);e.append(...Array.isArray(n)?n:[n])}var Ni=Object.freeze({__proto__:null,name:ci,rfc2119Usage:ui,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new wn,e.informativeReferences=new wn,e.respecRFC2119||(e.respecRFC2119=ui);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=ln(e),o=ln(r);t.set(n,o)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].map(e=>Yt(e)).join("\\b)|(?:\\b")}\\b)`):null,o=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),o=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,{acceptNode:e=>n.wsNodes||e.data.trim()?r&&e.parentElement?.closest(r)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),i=[];let s;for(;s=o.nextNode();)i.push(s);return i}(document.body,["#respec-ui",".head","pre","svg","script","style"],{wsNodes:!1}),i=pi.rfc2119Keywords(),s=new RegExp(`(${di([i,fi,vi,mi,gi,bi,yi,hi,wi,...r?[r]:[]]).source})`);for(const n of o){const r=n.data.split(s);if(1===r.length)continue;const o=document.createDocumentFragment();let a=!0;for(const s of r)if(a=!a,a)switch(!0){case s.startsWith("{{"):o.append(_i(s,n));break;case s.startsWith("{^"):o.append(xi(s));break;case s.startsWith("[[["):o.append(Si(s));break;case s.startsWith("[["):o.append(...Ci(s,n,e));break;case s.startsWith("|"):o.append(Li(s));break;case s.startsWith("[="):o.append(Ri(s));break;case s.startsWith("`"):o.append(Ti(s));break;case s.startsWith("[^"):o.append(ki(s));break;case t.has(s):o.append(Ai(s,n,t));break;case i.test(s):o.append($i(s))}else o.append(s);n.replaceWith(o)}},setInlineContent:Oi});const Ii="aom/conformance",ji=cn({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)=>Ft`<p>
333
+ >${a}</a
334
+ >`}function Oi(e){const t=e.slice(1,-1);return Ft`<code>${t}</code>`}function Ni(e){return mi.test(e)?e.split(/(`[^`]+`)(?!`)/).map(e=>e.startsWith("`")?Oi(e):Ni(e)):document.createTextNode(e)}function Ii(e,t){e.textContent="";const n=Ni(t);e.append(...Array.isArray(n)?n:[n])}var ji=Object.freeze({__proto__:null,name:di,rfc2119Usage:pi,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new wn,e.informativeReferences=new wn,e.respecRFC2119||(e.respecRFC2119=pi);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=ln(e),o=ln(r);t.set(n,o)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].map(e=>Yt(e)).join("\\b)|(?:\\b")}\\b)`):null,o=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),o=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,{acceptNode:e=>n.wsNodes||e.data.trim()?r&&e.parentElement?.closest(r)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),i=[];let a;for(;a=o.nextNode();)i.push(a);return i}(document.body,["#respec-ui",".head","pre","svg","script","style"],{wsNodes:!1}),i=fi.rfc2119Keywords(),a=new RegExp(`(${hi([i,gi,xi,bi,yi,wi,vi,mi,ki,...r?[r]:[]]).source})`);for(const n of o){const r=n.data.split(a);if(1===r.length)continue;const o=document.createDocumentFragment();let s=!0;for(const a of r)if(s=!s,s)switch(!0){case a.startsWith("{{"):o.append(Ai(a,n));break;case a.startsWith("{^"):o.append(Ei(a));break;case a.startsWith("[[["):o.append(Ci(a));break;case a.startsWith("[["):o.append(...Li(a,n,e));break;case a.startsWith("|"):o.append(Ti(a));break;case a.startsWith("[="):o.append(Pi(a));break;case a.startsWith("`"):o.append(Oi(a));break;case a.startsWith("[^"):o.append($i(a));break;case t.has(a):o.append(Ri(a,n,t));break;case i.test(a):o.append(Si(a))}else o.append(a);n.replaceWith(o)}},setInlineContent:Ii});const Di="aom/conformance",zi=cn({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)=>Ft`<p>
335
335
  The key word${t?"s":""} ${e} in this document
336
336
  ${t?"are":"is"} to be interpreted as described in
337
337
  <a href="https://www.rfc-editor.org/info/bcp14">BCP 14</a>
338
- ${ii("RFC2119")} ${ii("RFC8174")}
338
+ ${si("RFC2119")} ${si("RFC8174")}
339
339
  when, and only when, ${t?"they appear":"it appears"} in all
340
340
  capitals, as shown here.
341
- </p>`}});function Di(e,t){const n=[...Object.keys(ui)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=(o=n.sort(),[].concat(rn(o,e=>Ft`<em class="rfc2119">${e}</em>`)).map(e=>"string"==typeof e?Ft`${e}`:e));var o;const i=n.length>1,s=Ft`
342
- <h1>${ji.conformance}</h1>
343
- <p>${ji.normativity}</p>
344
- ${n.length?ji.keywordInterpretation(r,i):null}
345
- `;e.prepend(...s.childNodes)}var zi=Object.freeze({__proto__:null,name:Ii,run:function(e){const t=document.querySelector("section#conformance");if(t&&!t.classList.contains("override")&&Di(t,e),!t&&Object.keys(ui).length){_n("Document uses RFC2119 keywords but lacks a conformance section.",Ii,{hint:'Please add a `<section id="conformance">`.'})}}});function Mi(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(o){Sn(`Invalid ${t} name "${e}": ${o.message}`,r,{hint:`Check that the ${t} name is allowed per the XML's Name production for ${t}.`,elements:[n]})}return!1}function qi(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 Hi=new $n;function Bi(e,t){for(const n of t)Hi.has(n)||Hi.set(n,new Set),Hi.get(n)?.add(e)}const Fi="core/dfn",Ui=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:qi}],["element",{requiresFor:!1,validator:Mi}],["element-attr",{requiresFor:!1,validator:Mi}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:qi}],["event",{requiresFor:!1,validator:qi}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new Gt(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(o){return Sn(`Invalid ${t} "${e}": ${o.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:qi}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?qi(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)}}]]),Wi=[...Ui.keys()];function Gi(e,t){let n="";switch(!0){case Wi.some(t=>e.classList.contains(t)):n=[...e.classList].find(e=>Ui.has(e))??"",function(e,t,n){const r=Ui.get(t);if(r?.requiresFor&&!n.dataset.dfnFor){const e=Rn`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:o}=r,i=Rn`Use a ${"[data-dfn-for]"} attribute to associate this with ${o??""}.`;Sn(e,Fi,{hint:i,elements:[n]})}r?.validator&&r.validator(e,t,n,Fi)}(t,n,e);break;case _o.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=Rn`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.`,Fi,{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 o=["attribute","method"],{dfnType:i}=t.dataset;if(!o.includes(i)||r!==i){const n=Rn`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,i=`The only allowed types are: ${Ln(o,{quotes:!0})}. The slot "${e}" seems to be a "${An(r)}"?`;return Sn(n,Fi,{hint:i,elements:[t]}),"dfn"}return i}(t,e)}if(!n&&!e.matches("[data-dfn-type]")){const t=e.closest("[data-dfn-type]");n=t?.dataset.dfnType??""}n&&!e.dataset.dfnType&&(e.dataset.dfnType=n)}function Vi(e){switch(!0){case e.matches(".export.no-export"):Sn(Rn`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,Fi,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){Sn(Rn`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,Fi,{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="";break;case function(e){return!e.matches(".export, [data-export]")&&e.closest("section.informative, section.normative")?.classList.contains("informative")}(e):e.dataset.noexport=""}}var Zi=Object.freeze({__proto__:null,name:Fi,run:function(){for(const e of document.querySelectorAll("dfn")){if(e.closest("del"))continue;const t=fn(e);if(Bi(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;Gi(e,n),Vi(e);const r=(e.dataset.localLt||"").split("|").map(ln),o=t.filter(e=>!r.includes(e));(o.length>1||n!==ln(e.textContent))&&(e.dataset.lt=o.join("|"))}}});var Ki=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=ln(t.textContent).toLowerCase();e.add(n),t.dataset.lt&&e.add(t.dataset.lt)});const t=new Set,n=document.querySelectorAll("dfn:not([data-lt-noDefault])");return n.forEach(e=>{const n=ln(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=ln(n).toLowerCase(),o=Vt.isSingular(r)?Vt.plural(r):Vt.singular(r);return e.has(o)&&!t.has(o)?o:""}}();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("|"),Bi(e,n)}})}});var Yi=String.raw`span.example-title{text-transform:none}
341
+ </p>`}});function Mi(e,t){const n=[...Object.keys(pi)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=(o=n.sort(),[].concat(rn(o,e=>Ft`<em class="rfc2119">${e}</em>`)).map(e=>"string"==typeof e?Ft`${e}`:e));var o;const i=n.length>1,a=Ft`
342
+ <h1>${zi.conformance}</h1>
343
+ <p>${zi.normativity}</p>
344
+ ${n.length?zi.keywordInterpretation(r,i):null}
345
+ `;e.prepend(...a.childNodes)}var qi=Object.freeze({__proto__:null,name:Di,run:function(e){const t=document.querySelector("section#conformance");if(t&&!t.classList.contains("override")&&Mi(t,e),!t&&Object.keys(pi).length){_n("Document uses RFC2119 keywords but lacks a conformance section.",Di,{hint:'Please add a `<section id="conformance">`.'})}}});function Hi(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(o){Sn(`Invalid ${t} name "${e}": ${o.message}`,r,{hint:`Check that the ${t} name is allowed per the XML's Name production for ${t}.`,elements:[n]})}return!1}function Bi(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 Fi=new $n;function Ui(e,t){for(const n of t)Fi.has(n)||Fi.set(n,new Set),Fi.get(n)?.add(e)}const Wi="core/dfn",Gi=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:Bi}],["element",{requiresFor:!1,validator:Hi}],["element-attr",{requiresFor:!1,validator:Hi}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:Bi}],["event",{requiresFor:!1,validator:Bi}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new Gt(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(o){return Sn(`Invalid ${t} "${e}": ${o.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:Bi}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?Bi(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)}}]]),Vi=[...Gi.keys()];function Zi(e,t){let n="";switch(!0){case Vi.some(t=>e.classList.contains(t)):n=[...e.classList].find(e=>Gi.has(e))??"",function(e,t,n){const r=Gi.get(t);if(r?.requiresFor&&!n.dataset.dfnFor){const e=Rn`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:o}=r,i=Rn`Use a ${"[data-dfn-for]"} attribute to associate this with ${o??""}.`;Sn(e,Wi,{hint:i,elements:[n]})}r?.validator&&r.validator(e,t,n,Wi)}(t,n,e);break;case Ao.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=Rn`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.`,Wi,{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 o=["attribute","method"],{dfnType:i}=t.dataset;if(!o.includes(i)||r!==i){const n=Rn`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,i=`The only allowed types are: ${Ln(o,{quotes:!0})}. The slot "${e}" seems to be a "${An(r)}"?`;return Sn(n,Wi,{hint:i,elements:[t]}),"dfn"}return i}(t,e)}if(!n&&!e.matches("[data-dfn-type]")){const t=e.closest("[data-dfn-type]");n=t?.dataset.dfnType??""}n&&!e.dataset.dfnType&&(e.dataset.dfnType=n)}function Ki(e){switch(!0){case e.matches(".export.no-export"):Sn(Rn`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,Wi,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){Sn(Rn`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,Wi,{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="";break;case function(e){return!e.matches(".export, [data-export]")&&e.closest("section.informative, section.normative")?.classList.contains("informative")}(e):e.dataset.noexport=""}}var Yi=Object.freeze({__proto__:null,name:Wi,run:function(){for(const e of document.querySelectorAll("dfn")){if(e.closest("del"))continue;const t=fn(e);if(Ui(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;Zi(e,n),Ki(e);const r=(e.dataset.localLt||"").split("|").map(ln),o=t.filter(e=>!r.includes(e));(o.length>1||n!==ln(e.textContent))&&(e.dataset.lt=o.join("|"))}}});var Xi=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=ln(t.textContent).toLowerCase();e.add(n),t.dataset.lt&&e.add(t.dataset.lt)});const t=new Set,n=document.querySelectorAll("dfn:not([data-lt-noDefault])");return n.forEach(e=>{const n=ln(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=ln(n).toLowerCase(),o=Vt.isSingular(r)?Vt.plural(r):Vt.singular(r);return e.has(o)&&!t.has(o)?o:""}}();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("|"),Ui(e,n)}})}});var Qi=String.raw`span.example-title{text-transform:none}
346
346
  :is(aside,div).example,div.illegal-example{padding:.5em;margin:1em 0;position:relative;clear:both}
347
347
  div.illegal-example{color:red}
348
348
  div.illegal-example p{color:#000}
349
- aside.example div.example{border-left-width:.1em;border-color:#999;background:#fff}`;const Xi=cn({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},fr:{example:"Exemple"},ko:{example:"예시"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"},cs:{example:"Příklad"}});function Qi(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",o=n.title?Ft`<span class="example-title">: ${n.title}</span>`:"";return Ft`<div class="marker">
350
- <a class="self-link">${Xi.example}<bdi>${r}</bdi></a
349
+ aside.example div.example{border-left-width:.1em;border-color:#999;background:#fff}`;const Ji=cn({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},fr:{example:"Exemple"},ko:{example:"예시"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"},cs:{example:"Příklad"}});function ea(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",o=n.title?Ft`<span class="example-title">: ${n.title}</span>`:"";return Ft`<div class="marker">
350
+ <a class="self-link">${Ji.example}<bdi>${r}</bdi></a
351
351
  >${o}
352
- </div>`}var Ji=Object.freeze({__proto__:null,name:"core/examples",run:function(){const e=document.querySelectorAll("pre.example, pre.illegal-example, aside.example");if(!e.length)return;Jn(Yi,{before:document.querySelector("link")});let t=0;e.forEach(e=>{e.classList.contains("illegal-example");const n={},{title:r}=e;if("aside"===e.localName){++t;const o=Qi(e,t,n);e.prepend(o);const i=hn(e,"example",r||String(t));o.querySelector("a.self-link").href=`#${i}`}else{const o=!!e.closest("aside");o||++t,n.content=e.innerHTML,e.classList.remove("example","illegal-example");const i=e.id?e.id:null;i&&e.removeAttribute("id");const s=Qi(e,o?0:t,n),a=Ft`<div class="example" id="${i}">
353
- ${s} ${e.cloneNode(!0)}
354
- </div>`;hn(a,"example",r||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}})}});var es=String.raw`.issue-label{text-transform:initial}
352
+ </div>`}var ta=Object.freeze({__proto__:null,name:"core/examples",run:function(){const e=document.querySelectorAll("pre.example, pre.illegal-example, aside.example");if(!e.length)return;Jn(Qi,{before:document.querySelector("link")});let t=0;e.forEach(e=>{e.classList.contains("illegal-example");const n={},{title:r}=e;if("aside"===e.localName){++t;const o=ea(e,t,n);e.prepend(o);const i=hn(e,"example",r||String(t));o.querySelector("a.self-link").href=`#${i}`}else{const o=!!e.closest("aside");o||++t,n.content=e.innerHTML,e.classList.remove("example","illegal-example");const i=e.id?e.id:null;i&&e.removeAttribute("id");const a=ea(e,o?0:t,n),s=Ft`<div class="example" id="${i}">
353
+ ${a} ${e.cloneNode(!0)}
354
+ </div>`;hn(s,"example",r||String(t));s.querySelector("a.self-link").href=`#${s.id}`,e.replaceWith(s)}})}});var na=String.raw`.issue-label{text-transform:initial}
355
355
  .warning>p:first-child{margin-top:0}
356
356
  .warning{padding:.5em;border-left-width:.5em;border-left-style:solid}
357
357
  span.warning{padding:.1em .5em .15em}
@@ -361,37 +361,37 @@ span.warning{padding:.1em .5em .15em}
361
361
  .warning-title:before{content:"⚠";font-size:1.3em;float:left;padding-right:.3em;margin-top:-.3em}
362
362
  li.task-list-item{list-style:none}
363
363
  input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle}
364
- .issue a.respec-gh-label{padding:5px;margin:0 2px 0 2px;font-size:10px;text-transform:none;text-decoration:none;font-weight:700;border-radius:4px;position:relative;bottom:2px;border:none;display:inline-block}`;const ts="core/issues-notes",ns=cn({en:{editors_note:"Editor's note",feature_at_risk:"(Feature at Risk) Issue",issue:"Issue",issue_summary:"Issue summary",no_issues_in_spec:"There are no issues listed in this specification.",note:"Note",warning:"Warning"},ja:{note:"注",editors_note:"編者注",feature_at_risk:"(変更の可能性のある機能) Issue",issue:"Issue",issue_summary:"Issue の要約",no_issues_in_spec:"この仕様には未解決の issues は含まれていません.",warning:"警告"},nl:{editors_note:"Redactionele noot",issue_summary:"Lijst met issues",no_issues_in_spec:"Er zijn geen problemen vermeld in deze specificatie.",note:"Noot",warning:"Waarschuwing"},es:{editors_note:"Nota de editor",issue:"Cuestión",issue_summary:"Resumen de la cuestión",note:"Nota",no_issues_in_spec:"No hay problemas enumerados en esta especificación.",warning:"Aviso"},de:{editors_note:"Redaktioneller Hinweis",issue:"Frage",issue_summary:"Offene Fragen",no_issues_in_spec:"Diese Spezifikation enthält keine offenen Fragen.",note:"Hinweis",warning:"Warnung"},zh:{editors_note:"编者注",feature_at_risk:"(有可能变动的特性)Issue",issue:"Issue",issue_summary:"Issue 总结",no_issues_in_spec:"本规范中未列出任何 issue。",note:"注",warning:"警告"},cs:{editors_note:"Poznámka editora",feature_at_risk:"(Funkce v ohrožení) Problém",issue:"Problém",issue_summary:"Souhrn problémů",no_issues_in_spec:"V této specifikaci nejsou uvedeny žádné problémy.",note:"Poznámka",warning:"Varování"},fr:{editors_note:"Note de l'éditeur",issue:"Problème",issue_summary:"Résumé des problèmes",no_issues_in_spec:"Il n'y a aucun problème répertorié dans cette spécification.",note:"Note",warning:"Avertissement"}});function rs(e,t,n){const r=function(){if(document.querySelector(".issue[data-number]"))return e=>{if(e.dataset.number)return Number(e.dataset.number)};let e=0;return t=>{if(t.classList.contains("issue")&&"span"!==t.localName)return++e}}(),o=document.createElement("ul");e.forEach(e=>{const{type:i,displayType:s,isFeatureAtRisk:a}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),o=e.classList.contains("atrisk"),i=t?"issue":n?"warning":r?"ednote":"note",s=t?o?ns.feature_at_risk:ns.issue:n?ns.warning:r?ns.editors_note:ns.note;return{type:i,displayType:s,isFeatureAtRisk:o}}(e),l="issue"===i,c="span"===e.localName,{number:u}=e.dataset,d={title:e.title,number:r(e)};if(!c){const r=Ft`<div class="${a?`${i} atrisk`:i}" role="${"note"===i?"note":null}"></div>`,c=document.createElement("span"),p=Ft`<div class="${`${i}-title marker`}">${c}</div>`;hn(p,"h",i);let h,f=s;if(e.id?(r.id=e.id,e.removeAttribute("id")):hn(r,"issue-container",d.number?`number-${d.number}`:""),l){if(void 0!==d.number&&(f+=` ${d.number}`),e.dataset.hasOwnProperty("number")){const e=function(e,t,{isFeatureAtRisk:n=!1}={}){if(!n&&t.issueBase)return Ft`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return Ft`<a href="${t.atRiskBase+e}" />`}(u??"",n,{isFeatureAtRisk:a});if(e&&(c.before(e),e.append(c)),c.classList.add("issue-number"),h=t.get(u??""),!h){_n(`Failed to fetch issue number ${u}.`,ts)}h&&!d.title&&(d.title=h.title)}o.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,o=t.title?Ft`<span style="text-transform: none">: ${t.title}</span>`:"";return Ft`<li><a href="${`#${n}`}">${r}</a>${o}</li>`}(ns.issue,d,r.id))}if(c.textContent=f,d.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},o=h?h.labels:[];h&&"CLOSED"===h.state&&r.classList.add("closed"),p.append(function(e,t,n){const r=e.map(e=>function(e,t){const{color:n,name:r}=e,o=/^[0-9a-f]{6}$/i.test(n)?n:"f6f8fa",i=new URL("./issues/",t);i.searchParams.set("q",`is:issue is:open label:"${r}"`);const s=function(e){const[t,n,r]=[e.slice(0,2),e.slice(2,4),e.slice(4,6)],[o,i,s]=[t,n,r].map(e=>parseInt(e,16)/255).map(e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4),a=.2126*o+.7152*i+.0722*s;return a>.179?"#000":"#fff"}(o),a=`background-color: #${o}; color: ${s}`,l=`GitHub label: ${r}`;return Ft` <a
364
+ .issue a.respec-gh-label{padding:5px;margin:0 2px 0 2px;font-size:10px;text-transform:none;text-decoration:none;font-weight:700;border-radius:4px;position:relative;bottom:2px;border:none;display:inline-block}`;const ra="core/issues-notes",oa=cn({en:{editors_note:"Editor's note",feature_at_risk:"(Feature at Risk) Issue",issue:"Issue",issue_summary:"Issue summary",no_issues_in_spec:"There are no issues listed in this specification.",note:"Note",warning:"Warning"},ja:{note:"注",editors_note:"編者注",feature_at_risk:"(変更の可能性のある機能) Issue",issue:"Issue",issue_summary:"Issue の要約",no_issues_in_spec:"この仕様には未解決の issues は含まれていません.",warning:"警告"},nl:{editors_note:"Redactionele noot",issue_summary:"Lijst met issues",no_issues_in_spec:"Er zijn geen problemen vermeld in deze specificatie.",note:"Noot",warning:"Waarschuwing"},es:{editors_note:"Nota de editor",issue:"Cuestión",issue_summary:"Resumen de la cuestión",note:"Nota",no_issues_in_spec:"No hay problemas enumerados en esta especificación.",warning:"Aviso"},de:{editors_note:"Redaktioneller Hinweis",issue:"Frage",issue_summary:"Offene Fragen",no_issues_in_spec:"Diese Spezifikation enthält keine offenen Fragen.",note:"Hinweis",warning:"Warnung"},zh:{editors_note:"编者注",feature_at_risk:"(有可能变动的特性)Issue",issue:"Issue",issue_summary:"Issue 总结",no_issues_in_spec:"本规范中未列出任何 issue。",note:"注",warning:"警告"},cs:{editors_note:"Poznámka editora",feature_at_risk:"(Funkce v ohrožení) Problém",issue:"Problém",issue_summary:"Souhrn problémů",no_issues_in_spec:"V této specifikaci nejsou uvedeny žádné problémy.",note:"Poznámka",warning:"Varování"},fr:{editors_note:"Note de l'éditeur",issue:"Problème",issue_summary:"Résumé des problèmes",no_issues_in_spec:"Il n'y a aucun problème répertorié dans cette spécification.",note:"Note",warning:"Avertissement"}});function ia(e,t,n){const r=function(){if(document.querySelector(".issue[data-number]"))return e=>{if(e.dataset.number)return Number(e.dataset.number)};let e=0;return t=>{if(t.classList.contains("issue")&&"span"!==t.localName)return++e}}(),o=document.createElement("ul");e.forEach(e=>{const{type:i,displayType:a,isFeatureAtRisk:s}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),o=e.classList.contains("atrisk"),i=t?"issue":n?"warning":r?"ednote":"note",a=t?o?oa.feature_at_risk:oa.issue:n?oa.warning:r?oa.editors_note:oa.note;return{type:i,displayType:a,isFeatureAtRisk:o}}(e),l="issue"===i,c="span"===e.localName,{number:u}=e.dataset,d={title:e.title,number:r(e)};if(!c){const r=Ft`<div class="${s?`${i} atrisk`:i}" role="${"note"===i?"note":null}"></div>`,c=document.createElement("span"),p=Ft`<div class="${`${i}-title marker`}">${c}</div>`;hn(p,"h",i);let h,f=a;if(e.id?(r.id=e.id,e.removeAttribute("id")):hn(r,"issue-container",d.number?`number-${d.number}`:""),l){if(void 0!==d.number&&(f+=` ${d.number}`),e.dataset.hasOwnProperty("number")){const e=function(e,t,{isFeatureAtRisk:n=!1}={}){if(!n&&t.issueBase)return Ft`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return Ft`<a href="${t.atRiskBase+e}" />`}(u??"",n,{isFeatureAtRisk:s});if(e&&(c.before(e),e.append(c)),c.classList.add("issue-number"),h=t.get(u??""),!h){_n(`Failed to fetch issue number ${u}.`,ra)}h&&!d.title&&(d.title=h.title)}o.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,o=t.title?Ft`<span style="text-transform: none">: ${t.title}</span>`:"";return Ft`<li><a href="${`#${n}`}">${r}</a>${o}</li>`}(oa.issue,d,r.id))}if(c.textContent=f,d.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},o=h?h.labels:[];h&&"CLOSED"===h.state&&r.classList.add("closed"),p.append(function(e,t,n){const r=e.map(e=>function(e,t){const{color:n,name:r}=e,o=/^[0-9a-f]{6}$/i.test(n)?n:"f6f8fa",i=new URL("./issues/",t);i.searchParams.set("q",`is:issue is:open label:"${r}"`);const a=function(e){const[t,n,r]=[e.slice(0,2),e.slice(2,4),e.slice(4,6)],[o,i,a]=[t,n,r].map(e=>parseInt(e,16)/255).map(e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4),s=.2126*o+.7152*i+.0722*a;return s>.179?"#000":"#fff"}(o),s=`background-color: #${o}; color: ${a}`,l=`GitHub label: ${r}`;return Ft` <a
365
365
  class="respec-gh-label"
366
- style="${a}"
366
+ style="${s}"
367
367
  href="${i.href}"
368
368
  aria-label="${l}"
369
369
  >${r}</a
370
- >`}(e,n));r.length&&r.unshift(document.createTextNode(" "));return Ft`<span class="issue-label">: ${t}${r}</span>`}(o,d.title,t))}let m=e;e.replaceWith(r),m.classList.remove(i),m.removeAttribute("data-number"),h&&!m.innerHTML.trim()&&(m=document.createRange().createContextualFragment(h.bodyHTML)),r.append(p,m)}}),function(e){const t=document.getElementById("issue-summary");if(!t)return;const n=t.querySelector("h2, h3, h4, h5, h6");e.hasChildNodes()?t.append(e):t.append(Ft`<p>${ns.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.prepend(Ft`<h1>${ns.issue_summary}</h1>`)}(o)}var os=Object.freeze({__proto__:null,name:ts,run:async function(e){const t=document.querySelectorAll(".issue, .note, .warning, .ednote"),n=Array.from(t).filter(e=>e instanceof HTMLElement);if(!n.length)return;const r=await async function(e){if(!e||!e.apiBase)return new Map;const t=[...document.querySelectorAll(".issue[data-number]")].map(e=>Number.parseInt(e.dataset.number??"",10)).filter(e=>e);if(!t.length)return new Map;const n=new URL("issues",`${e.apiBase}/${e.fullName}/`);n.searchParams.set("issues",t.join(","));const r=await fetch(n.href);if(!r.ok)return Sn(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,ts),new Map;const o=await r.json();return new Map(Object.entries(o))}(e.github??null);Jn(es,{before:document.head.querySelector("link")}),rs(n,r,e),document.querySelectorAll(".ednote").forEach(e=>{e.classList.remove("ednote"),e.classList.add("note")})}});const is="core/best-practices",ss={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},as=cn(ss),ls=r in ss?r:"en";var cs=Object.freeze({__proto__:null,name:is,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=hn(e,"bp"),o=Ft`<a class="marker self-link" href="${`#${r}`}"
371
- ><bdi lang="${ls}">${as.best_practice}${t+1}</bdi></a
372
- >`;if(n){const t=Ft`<li>${o}: ${vn(e)}</li>`;n.appendChild(t)}const i=e.closest("div");if(!i)return void e.classList.add("advisement");i.classList.add("advisement");const s=Ft`${o.cloneNode(!0)}: ${e}`;i.prepend(...s.childNodes)}),e.length)t&&(t.appendChild(Ft`<h1>Best Practices Summary</h1>`),n&&t.appendChild(n));else if(t){_n("Using best practices summary (#bp-summary) but no best practices found.",is),t.remove()}}});const us="core/figures",ds=cn({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"},fr:{list_of_figures:"Liste des figures",fig:"Figure "},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var ps=Object.freeze({__proto__:null,name:us,run:function(){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;hn(e,"fig",r),bn(t,Ft`<span class="fig-title"></span>`),t.prepend(Ft`<a class="self-link" href="#${e.id}"
373
- >${ds.fig}<bdi class="figno">${n+1}</bdi></a
370
+ >`}(e,n));r.length&&r.unshift(document.createTextNode(" "));return Ft`<span class="issue-label">: ${t}${r}</span>`}(o,d.title,t))}let m=e;e.replaceWith(r),m.classList.remove(i),m.removeAttribute("data-number"),h&&!m.innerHTML.trim()&&(m=document.createRange().createContextualFragment(h.bodyHTML)),r.append(p,m)}}),function(e){const t=document.getElementById("issue-summary");if(!t)return;const n=t.querySelector("h2, h3, h4, h5, h6");e.hasChildNodes()?t.append(e):t.append(Ft`<p>${oa.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.prepend(Ft`<h1>${oa.issue_summary}</h1>`)}(o)}var aa=Object.freeze({__proto__:null,name:ra,run:async function(e){const t=document.querySelectorAll(".issue, .note, .warning, .ednote"),n=Array.from(t).filter(e=>e instanceof HTMLElement);if(!n.length)return;const r=await async function(e){if(!e||!e.apiBase)return new Map;const t=[...document.querySelectorAll(".issue[data-number]")].map(e=>Number.parseInt(e.dataset.number??"",10)).filter(e=>e);if(!t.length)return new Map;const n=new URL("issues",`${e.apiBase}/${e.fullName}/`);n.searchParams.set("issues",t.join(","));const r=await fetch(n.href);if(!r.ok)return Sn(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,ra),new Map;const o=await r.json();return new Map(Object.entries(o))}(e.github??null);Jn(na,{before:document.head.querySelector("link")}),ia(n,r,e),document.querySelectorAll(".ednote").forEach(e=>{e.classList.remove("ednote"),e.classList.add("note")})}});const sa="core/best-practices",la={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},ca=cn(la),ua=r in la?r:"en";var da=Object.freeze({__proto__:null,name:sa,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=hn(e,"bp"),o=Ft`<a class="marker self-link" href="${`#${r}`}"
371
+ ><bdi lang="${ua}">${ca.best_practice}${t+1}</bdi></a
372
+ >`;if(n){const t=Ft`<li>${o}: ${vn(e)}</li>`;n.appendChild(t)}const i=e.closest("div");if(!i)return void e.classList.add("advisement");i.classList.add("advisement");const a=Ft`${o.cloneNode(!0)}: ${e}`;i.prepend(...a.childNodes)}),e.length)t&&(t.appendChild(Ft`<h1>Best Practices Summary</h1>`),n&&t.appendChild(n));else if(t){_n("Using best practices summary (#bp-summary) but no best practices found.",sa),t.remove()}}});const pa="core/figures",ha=cn({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"},fr:{list_of_figures:"Liste des figures",fig:"Figure "},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var fa=Object.freeze({__proto__:null,name:pa,run:function(){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;hn(e,"fig",r),bn(t,Ft`<span class="fig-title"></span>`),t.prepend(Ft`<a class="self-link" href="#${e.id}"
373
+ >${ha.fig}<bdi class="figno">${n+1}</bdi></a
374
374
  >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach(e=>{mn(e,"span").removeAttribute("href")}),Ft`<li class="tofline">
375
375
  <a class="tocxref" href="${`#${e}`}">${n.childNodes}</a>
376
- </li>`}(t.id,r));else{_n("Found a `<figure>` without a `<figcaption>`.",us,{elements:[t]})}}),e}(),t=document.getElementById("tof");e.length&&t&&(!function(e){if(e.classList.contains("appendix")||e.classList.contains("introductory")||e.closest("section"))return;const t=function(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}(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(Ft`<h1>${ds.list_of_figures}</h1>`,Ft`<ul class="tof">
376
+ </li>`}(t.id,r));else{_n("Found a `<figure>` without a `<figcaption>`.",pa,{elements:[t]})}}),e}(),t=document.getElementById("tof");e.length&&t&&(!function(e){if(e.classList.contains("appendix")||e.classList.contains("introductory")||e.closest("section"))return;const t=function(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}(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(Ft`<h1>${ha.list_of_figures}</h1>`,Ft`<ul class="tof">
377
377
  ${e}
378
- </ul>`))}});const hs="core/data-cite",fs="__SPEC__";async function ms(e){const{key:t,frag:n,path:r,href:o}=e;let i,s="";if(t===fs)i=document.location.href;else{const e=await Xo(t);if(!e)return null;i=e.href??"",s=e.title}if(o)i=o;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:s}}function gs(e,t,n){const{href:r,title:o}=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=o),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,t.dataset.cite=n.key,t.dataset.citePath=n.path,t.dataset.citeFrag=n.frag,e.textContent?bn(e,t):(t.textContent=o,e.append(t)),i){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){Sn("Exporting a linked external definition is not allowed.",hs,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function bs(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const ys=bs("#"),ws=bs("/");function vs(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:o,citeHref:i}=t;if((n??"").startsWith("#")&&!r){const r=e.parentElement?.closest('[data-cite]:not([data-cite^="#"])')??null,{key:o,isNormative:i}=r?vs(r):{key:fs,isNormative:!1};return t.cite=i?o:`?${o}`,t.citeFrag=(n??"").replace("#",""),vs(e)}const s=r?`#${r}`:ys(n??""),a=o||ws(n??"").split("#")[0],{type:l}=gn(n??"",e),c="normative"===l,u=/^[?|!]/.test(n??"");return{key:(n??"").split(/[/|#]/)[0].substring(Number(u)),isNormative:c,frag:s,path:a,href:i}}function ks(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 xs=Object.freeze({__proto__:null,THIS_SPEC:fs,name:hs,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(vs).map(async e=>({entry:e,result:await Xo(e.key)})),n=(await Promise.all(t)).filter(({result:e})=>null===e).map(({entry:{key:e}})=>e),r=await Yo(n);r&&Object.assign(Wo,r)}([...e]);const t=new Map,n=new Map;for(const r of e){t.set(r,r.dataset.cite);const e=vs(r);n.set(r,e)}for(const r of e){const e=t.get(r),o=n.get(r),i=await ms(o);if(i)r.dataset.citeFrag&&r.dataset.matchedText||!r.dataset.lt||"the-empty-string"===r.dataset.lt||""!==r.textContent||(Oi(r,r.dataset.lt),delete r.dataset.lt),gs(r,i,o);else{const t=`Couldn't find a match for "${e}"`;r.dataset.matchedText&&(r.textContent=r.dataset.matchedText),_n(t,hs,{elements:[r]})}}Nn("beforesave",ks)},toCiteDetails:vs});const $s="core/link-to-dfn",Es=[],Ss={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:"在文档中有重复的定义。"},cs:{duplicateMsg:e=>`Duplicitní definice '${e}'`,duplicateTitle:"Toto je v dokumentu definováno vícekrát."}},_s=cn(Ss);function Cs(e){const t=new Map,n=[];for(const r of Hi.get(e)??[]){const{dfnType:o="dfn"}=r.dataset,i=r.dataset.dfnFor?.split(",").map(e=>e.trim())??[""];for(const s of i){if(t.has(s)&&t.get(s)?.has(o)){const e=t.get(s)?.get(o),i="dfn"===e?.localName,a="dfn"===r.localName,l=o===(e?.dataset.dfnType||"dfn"),c=!s&&!e?.dataset.dfnFor||e?.dataset.dfnFor?.split(",").map(e=>e.trim()).includes(s);if(i&&a&&l&&c){n.push(r);continue}}t.has(s)||t.set(s,new Map),t.get(s)?.set(o,r),("idl"in r.dataset||"dfn"!==o)&&t.get(s)?.set("idl",r),hn(r,"dfn",e)}}return{result:t,duplicates:n}}function As(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 o=r.split(".");2===o.length&&e.push({for:o[0],title:o[1]}),e.push({for:n,title:r}),t||e.push({for:r,title:r}),""!==n&&e.push({for:"",title:r});const i=r.replace(Zt,"");return i!==r&&""!==i&&(e.push({for:n,title:i}),t||e.push({for:i,title:i}),""!==n&&e.push({for:"",title:i})),e},[]);return r}(e),r=n.find(e=>t.has(e.title)&&t.get(e.title)?.has(e.for));if(!r)return;const o=t.get(r.title)?.get(r.for),{linkType:i}=e.dataset;if(i){for(const e of i.split("|"))if(o?.get(e))return o.get(e);return o?.get("dfn")}{const e=r.for?"idl":"dfn";return o?.get(e)||o?.get("idl")}}function Ls(e,t,n){let r=!1;const{linkFor:o}=e.dataset,{dfnFor:i}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(o&&!n.get(o)&&i&&!i.split(",").map(e=>e.trim()).includes(o))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"),o=Rs(e)&&Rs(t,n);r&&!o||bn(e,document.createElement("code"))}(e,t),!r}function Rs(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 Ts(e){e.forEach(e=>{const t=`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,n=e.closest("[data-link-for]"),r=`Add a matching \`<dfn>\` element, ${Rn`use ${"[data-cite]"} to link to an external definition, or enable ${"[xref]"} for automatic cross-spec linking.`}${n?` This link is inside a \`data-link-for="${n.dataset.linkFor}"\` section — \`[=term=]\` links are scoped to that context. To link to a global concept instead, either add \`data-link-for=""\` on this \`<a>\` or move it outside the scoped section.`:""}`;_n(t,$s,{title:"Linking error: no matching `<dfn>`",hint:r,elements:[e]})})}var Ps=Object.freeze({__proto__:null,name:$s,possibleExternalLinks:Es,run:async function(e){const t=function(){const e=new $n;for(const t of Hi.keys()){const{result:n,duplicates:r}=Cs(t);e.set(t,n),r.length>0&&Sn(_s.duplicateMsg(t),$s,{title:_s.duplicateTitle,elements:r})}return e}(),n=[],r=document.querySelectorAll("a[data-cite='']:not([data-no-link-to-dfn]), a:not([href]):not([data-cite]):not([data-no-link-to-dfn]):not(.logo):not(.externalDFN)");for(const e of r){if(!e.dataset?.linkType&&e.dataset?.xrefType){Es.push(e);continue}const r=As(e,t);if(r){Ls(e,r,t)||Es.push(e)}else""===e.dataset.cite?n.push(e):Es.push(e)}Ts(n),function(e){const{shortName:t=""}=e,n=t?new RegExp(String.raw`^([?!])?${Yt(t)}\b([^-])`,"i"):null,r=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");for(const t of r){n&&(t.dataset.cite=(t.dataset.cite??"").replace(n,`$1${fs}$2`));const{key:r,isNormative:o}=vs(t);r!==fs&&(o||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||Ts(Es)}});const Os="headings",Ns=864e5;async function Is(){return await Ut.openDB("respec-headings",1,{upgrade(e){[...e.objectStoreNames].forEach(t=>e.deleteObjectStore(t)),e.createObjectStore(Os)}})}async function js(e){const t=new Map;if(function(){const e=parseInt(localStorage.getItem("HEADINGS:LAST_CACHED")??"",10);return!isNaN(e)&&Date.now()-e>Ns}())return await async function(){try{const e=await Is();await e.clear(Os),localStorage.removeItem("HEADINGS:LAST_CACHED")}catch(e){console.error(e)}}(),t;try{const n=(await Is()).transaction(Os);for(const r of e){const e=`${r.spec}#${r.id}`,o=await n.store.get(e);o&&t.set(e,o.result)}}catch(e){console.error(e)}return t}const Ds="core/xref-headings",zs="https://respec.org/xref/search/headings";async function Ms(e,t=zs){if(!e.length)return new Map;const n=await js(e),r=e.filter(e=>!n.has(`${e.spec}#${e.id}`));if(!r.length)return n;try{const e=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({queries:r})});if(!e.ok){const t=`Failed to fetch heading texts (HTTP ${e.status}).`;return _n(t,Ds,{hint:"Cross-spec section links will fall back to spec titles."}),n}const{result:o=[]}=await e.json(),i=new Map(o.filter(e=>!e.error).map(e=>[`${e.spec}#${e.id}`,{title:e.title,number:e.number||null}]));return await async function(e,t){try{const n=(await Is()).transaction(Os,"readwrite");for(const r of e){const e=`${r.spec}#${r.id}`,o=t.get(e);o&&n.objectStore(Os).put({query:r,result:o},e)}await n.done,localStorage.setItem("HEADINGS:LAST_CACHED",Date.now().toString())}catch(e){console.error(e)}}(r,i),new Map([...n,...i])}catch{return _n("Failed to fetch heading texts from respec.org.",Ds,{hint:"Cross-spec section links will fall back to spec titles."}),n}}function qs(e,{title:t,number:n}){e.classList.add("sec-ref"),e.textContent="",e.append("§ "),n?e.append(Ft`<bdi class="secno">${n} </bdi>`,t):e.append(t)}var Hs=Object.freeze({__proto__:null,HEADINGS_API_URL:zs,fetchHeadingTexts:Ms,name:Ds,run:async function(e){const t=document.querySelectorAll("a[data-cite-frag][data-matched-text]");if(!t.length)return;const n=function(e){const t="object"!=typeof e.xref||null===e.xref||Array.isArray(e.xref)?{}:e.xref;return"string"==typeof t.headingApiUrl?t.headingApiUrl:zs}(e),r=new Map,o=[];if(t.forEach(e=>{if(e.dataset.lt)Oi(e,e.dataset.lt),delete e.dataset.lt;else{const t=(e.dataset.cite??"").replace(/^[!?]/,""),n=e.dataset.citeFrag??"",i=`${t}#${n}`;o.push({elem:e,key:i}),r.has(i)||r.set(i,{spec:t,id:n})}}),!o.length)return;const i=await Ms([...r.values()],n);o.forEach(({elem:e,key:t})=>{const n=i.get(t);n?.title&&qs(e,n)})},setHeadingContent:qs});const Bs="core/contrib";var Fs=Object.freeze({__proto__:null,name:Bs,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void Sn(Rn`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,Bs)}const t=(e.editors??[]).map(e=>e.name),n=`${e.github.apiBase}/${e.github.fullName}/`;await async function(e,t){const n=document.getElementById("gh-contributors");if(!n)return;n.textContent="Fetching list of contributors...";const r=await o();null!==r?function(e,t){const n=e.sort((e,t)=>{const n=e.name||e.login,r=t.name||t.login;return n.toLowerCase().localeCompare(r.toLowerCase())});if("UL"===t.tagName)return void Ft(t)`${n.map(({name:e,login:t})=>`<li><a href="https://github.com/${t}">${e||t}</a></li>`)}`;const r=n.map(e=>e.name||e.login);t.textContent=sn(r)}(r,n):n.textContent="Failed to fetch contributors.";async function o(){const{href:n}=new URL("contributors",t);try{const t=await async function(e,t=864e5){const n=new Request(e),r=new URL(n.url);let o,i;if("caches"in window)try{if(o=await caches.open(r.origin),i=await o.match(n),i&&new Date(i.headers.get("Expires")??"")>new Date)return i}catch(e){console.error("Failed to use Cache API.",e)}const s=await fetch(n);if(!s.ok&&i)return console.warn(`Returning a stale cached response for ${r}`),i;if(o&&s.ok){const e=s.clone(),r=new Headers(s.headers),i=new Date(Date.now()+t);r.set("Expires",i.toISOString());const a=new Response(await e.blob(),{headers:r});await o.put(n,a).catch(console.error)}return s}(n);if(!t.ok)throw new Error(`Request to ${n} failed with status code ${t.status}`);return(await t.json()).filter(t=>!e.includes(t.name||t.login)&&!t.login.includes("[bot]"))}catch(e){return Sn("Error loading contributors from GitHub.",Bs,{cause:e}),null}}}(t,n)}});var Us=Object.freeze({__proto__:null,name:"core/fix-headers",run:function(){[...document.querySelectorAll("section:not(.introductory)")].map(e=>e.querySelector("h1, h2, h3, h4, h5, h6")).filter(e=>null!==e).forEach(e=>{const t=Math.min(function(e,t){const n=[];for(;e&&e!=e.ownerDocument.body;)e.matches(t)&&n.push(e),e=e.parentElement;return n}(e,"section").length+1,6);mn(e,`h${t}`)})}});const Ws=["h2","h3","h4","h5","h6"],Gs="core/structure",Vs=cn({en:{toc:"Table of Contents",back_to_top:"Back to Top"},zh:{toc:"内容大纲",back_to_top:"返回顶部"},ko:{toc:"목차",back_to_top:"맨 위로"},ja:{toc:"目次",back_to_top:"先頭に戻る"},nl:{toc:"Inhoudsopgave",back_to_top:"Terug naar boven"},es:{toc:"Tabla de Contenidos",back_to_top:"Volver arriba"},fr:{toc:"Table des matières",back_to_top:"Retourner en haut"},de:{toc:"Inhaltsverzeichnis",back_to_top:"Zurück nach oben"},cs:{toc:"Obsah",back_to_top:"Zpět na začátek"}});function Zs(e,t,{prefix:n=""}={}){let r=!1,o=0,i=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const s=Ft`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(o=i,r=!0);let e=a.isIntro?"":r?Ks(i-o+1):n+i;const l=e.split(".").length;if(1===l&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(i+=1,a.header.prepend(Ft`<bdi class="secno">${e} </bdi>`)),l<=t){const n=a.header.id||a.element.id,r=Xs(a.header,n),o=Zs(a.subsections,t,{prefix:e});o&&r.append(o),s.append(r)}}return s}function Ks(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function Ys(e){const t=e.querySelectorAll(":scope > section"),n=[];for(const e of t){const t=e.classList.contains("notoc");if(!e.children.length||t)continue;const r=e.children[0];if(!Ws.includes(r.localName))continue;const o=r.textContent;hn(e,void 0,o),n.push({element:e,header:r,title:o,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:Ys(e)})}return n}function Xs(e,t){const n=Ft`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach(e=>{const t=mn(e,"span");t.className="formerLink",t.removeAttribute("href")}),r.querySelectorAll("dfn").forEach(e=>{mn(e,"span").removeAttribute("id")}),Ft`<li class="tocline">${n}</li>`}var Qs=Object.freeze({__proto__:null,name:Gs,run:function(e){if("maxTocLevel"in e==!1&&(e.maxTocLevel=1/0),function(){const e=[...document.querySelectorAll("section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child")].filter(e=>!e.closest("section.introductory"));if(!e.length)return;e.forEach(e=>{const t=Math.min(function(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}(e,"section").length+1,6),n=`h${t}`;e.localName!==n&&mn(e,n)})}(),!e.noTOC){!function(){const e=document.querySelectorAll("section[data-max-toc]");for(const t of e){const e=parseInt(t.dataset.maxToc??"",10);if(e<0||e>6||Number.isNaN(e)){Sn("`data-max-toc` must have a value between 0-6 (inclusive).",Gs,{elements:[t]});continue}if(0===e){t.classList.add("notoc");continue}const n=t.querySelectorAll(`:scope > ${Array.from({length:e},()=>"section").join(" > ")}`);for(const e of n)e.classList.add("notoc")}}();const t=Zs(Ys(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=Ft`<nav id="toc"></nav>`,n=Ft`<h2 class="introductory">${Vs.toc}</h2>`;hn(n),t.append(n,e);const r=document.getElementById("toc")||document.getElementById("sotd")||document.getElementById("abstract");r&&("toc"===r.id?r.replaceWith(t):r.after(t));const o=Ft`<p role="navigation" id="back-to-top">
379
- <a href="#title"><abbr title="${Vs.back_to_top}">&uarr;</abbr></a>
380
- </p>`;document.body.append(o)}(t)}On("toc",void 0)}});const Js=cn({en:{informative:"This section is non-normative."},nl:{informative:"Dit onderdeel is niet-normatief."},ko:{informative:"이 부분은 비규범적입니다."},ja:{informative:"この節は仕様には含まれません."},de:{informative:"Dieser Abschnitt ist nicht normativ."},zh:{informative:"本章节不包含规范性内容。"},cs:{informative:"Tato sekce není normativní."},fr:{informative:"Cette section est non normative."}});var ea=Object.freeze({__proto__:null,name:"core/informative",run:function(){Array.from(document.querySelectorAll("section.informative")).map(e=>e.querySelector("h2, h3, h4, h5, h6")).filter(e=>null!==e).forEach(e=>{e.after(Ft`<p><em>${Js.informative}</em></p>`)})}});const ta=cn({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${ln(t.textContent)}`),n}}});var na=Object.freeze({__proto__:null,name:"core/id-headers",run:function(e){const t=document.querySelectorAll("section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6");for(const n of t){let t=n.id;if(t||(hn(n),t=n.parentElement?.id||n.id),!e.addSectionLinks)continue;const r=ta.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),o=Ft`<div class="header-wrapper"></div>`;n.replaceWith(o);const i=Ft`<a
378
+ </ul>`))}});const ma="core/data-cite",ga="__SPEC__";async function ba(e){const{key:t,frag:n,path:r,href:o}=e;let i,a="";if(t===ga)i=document.location.href;else{const e=await Jo(t);if(!e)return null;i=e.href??"",a=e.title}if(o)i=o;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:a}}function ya(e,t,n){const{href:r,title:o}=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=o),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,t.dataset.cite=n.key,t.dataset.citePath=n.path,t.dataset.citeFrag=n.frag,e.textContent?bn(e,t):(t.textContent=o,e.append(t)),i){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){Sn("Exporting a linked external definition is not allowed.",ma,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function wa(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const va=wa("#"),ka=wa("/");function xa(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:o,citeHref:i}=t;if((n??"").startsWith("#")&&!r){const r=e.parentElement?.closest('[data-cite]:not([data-cite^="#"])')??null,{key:o,isNormative:i}=r?xa(r):{key:ga,isNormative:!1};return t.cite=i?o:`?${o}`,t.citeFrag=(n??"").replace("#",""),xa(e)}const a=r?`#${r}`:va(n??""),s=o||ka(n??"").split("#")[0],{type:l}=gn(n??"",e),c="normative"===l,u=/^[?|!]/.test(n??"");return{key:(n??"").split(/[/|#]/)[0].substring(Number(u)),isNormative:c,frag:a,path:s,href:i}}function $a(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 Ea=Object.freeze({__proto__:null,THIS_SPEC:ga,name:ma,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(xa).map(async e=>({entry:e,result:await Jo(e.key)})),n=(await Promise.all(t)).filter(({result:e})=>null===e).map(({entry:{key:e}})=>e),r=await Qo(n);r&&Object.assign(Vo,r)}([...e]);const t=new Map,n=new Map;for(const r of e){t.set(r,r.dataset.cite);const e=xa(r);n.set(r,e)}for(const r of e){const e=t.get(r),o=n.get(r),i=await ba(o);if(i)r.dataset.citeFrag&&r.dataset.matchedText||!r.dataset.lt||"the-empty-string"===r.dataset.lt||""!==r.textContent||(Ii(r,r.dataset.lt),delete r.dataset.lt),ya(r,i,o);else{const t=`Couldn't find a match for "${e}"`;r.dataset.matchedText&&(r.textContent=r.dataset.matchedText),_n(t,ma,{elements:[r]})}}Nn("beforesave",$a)},toCiteDetails:xa});const Sa="core/link-to-dfn",_a=[],Ca={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:"在文档中有重复的定义。"},cs:{duplicateMsg:e=>`Duplicitní definice '${e}'`,duplicateTitle:"Toto je v dokumentu definováno vícekrát."}},Aa=cn(Ca);function La(e){const t=new Map,n=[];for(const r of Fi.get(e)??[]){const{dfnType:o="dfn"}=r.dataset,i=r.dataset.dfnFor?.split(",").map(e=>e.trim())??[""];for(const a of i){if(t.has(a)&&t.get(a)?.has(o)){const e=t.get(a)?.get(o),i="dfn"===e?.localName,s="dfn"===r.localName,l=o===(e?.dataset.dfnType||"dfn"),c=!a&&!e?.dataset.dfnFor||e?.dataset.dfnFor?.split(",").map(e=>e.trim()).includes(a);if(i&&s&&l&&c){n.push(r);continue}}t.has(a)||t.set(a,new Map),t.get(a)?.set(o,r),("idl"in r.dataset||"dfn"!==o)&&t.get(a)?.set("idl",r),hn(r,"dfn",e)}}return{result:t,duplicates:n}}function Ra(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 o=r.split(".");2===o.length&&e.push({for:o[0],title:o[1]}),e.push({for:n,title:r}),t||e.push({for:r,title:r}),""!==n&&e.push({for:"",title:r});const i=r.replace(Zt,"");return i!==r&&""!==i&&(e.push({for:n,title:i}),t||e.push({for:i,title:i}),""!==n&&e.push({for:"",title:i})),e},[]);return r}(e),r=n.find(e=>t.has(e.title)&&t.get(e.title)?.has(e.for));if(!r)return;const o=t.get(r.title)?.get(r.for),{linkType:i}=e.dataset;if(i){for(const e of i.split("|"))if(o?.get(e))return o.get(e);return o?.get("dfn")}{const e=r.for?"idl":"dfn";return o?.get(e)||o?.get("idl")}}function Ta(e,t,n){let r=!1;const{linkFor:o}=e.dataset,{dfnFor:i}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(o&&!n.get(o)&&i&&!i.split(",").map(e=>e.trim()).includes(o))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"),o=Pa(e)&&Pa(t,n);r&&!o||bn(e,document.createElement("code"))}(e,t),!r}function Pa(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 Oa(e){e.forEach(e=>{const t=`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,n=e.closest("[data-link-for]"),r=`Add a matching \`<dfn>\` element, ${Rn`use ${"[data-cite]"} to link to an external definition, or enable ${"[xref]"} for automatic cross-spec linking.`}${n?` This link is inside a \`data-link-for="${n.dataset.linkFor}"\` section — \`[=term=]\` links are scoped to that context. To link to a global concept instead, either add \`data-link-for=""\` on this \`<a>\` or move it outside the scoped section.`:""}`;_n(t,Sa,{title:"Linking error: no matching `<dfn>`",hint:r,elements:[e]})})}var Na=Object.freeze({__proto__:null,name:Sa,possibleExternalLinks:_a,run:async function(e){const t=function(){const e=new $n;for(const t of Fi.keys()){const{result:n,duplicates:r}=La(t);e.set(t,n),r.length>0&&Sn(Aa.duplicateMsg(t),Sa,{title:Aa.duplicateTitle,elements:r})}return e}(),n=[],r=document.querySelectorAll("a[data-cite='']:not([data-no-link-to-dfn]), a:not([href]):not([data-cite]):not([data-no-link-to-dfn]):not(.logo):not(.externalDFN)");for(const e of r){if(!e.dataset?.linkType&&e.dataset?.xrefType){_a.push(e);continue}const r=Ra(e,t);if(r){Ta(e,r,t)||_a.push(e)}else""===e.dataset.cite?n.push(e):_a.push(e)}Oa(n),function(e){const{shortName:t=""}=e,n=t?new RegExp(String.raw`^([?!])?${Yt(t)}\b([^-])`,"i"):null,r=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");for(const t of r){n&&(t.dataset.cite=(t.dataset.cite??"").replace(n,`$1${ga}$2`));const{key:r,isNormative:o}=xa(t);r!==ga&&(o||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||Oa(_a)}});const Ia="headings",ja=864e5;async function Da(){return await Ut.openDB("respec-headings",1,{upgrade(e){[...e.objectStoreNames].forEach(t=>e.deleteObjectStore(t)),e.createObjectStore(Ia)}})}async function za(e){const t=new Map;if(function(){const e=parseInt(localStorage.getItem("HEADINGS:LAST_CACHED")??"",10);return!isNaN(e)&&Date.now()-e>ja}())return await async function(){try{const e=await Da();await e.clear(Ia),localStorage.removeItem("HEADINGS:LAST_CACHED")}catch(e){console.error(e)}}(),t;try{const n=(await Da()).transaction(Ia);for(const r of e){const e=`${r.spec}#${r.id}`,o=await n.store.get(e);o&&t.set(e,o.result)}}catch(e){console.error(e)}return t}const Ma="core/xref-headings",qa="https://respec.org/xref/search/headings";async function Ha(e,t=qa){if(!e.length)return new Map;const n=await za(e),r=e.filter(e=>!n.has(`${e.spec}#${e.id}`));if(!r.length)return n;try{const e=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({queries:r})});if(!e.ok){const t=`Failed to fetch heading texts (HTTP ${e.status}).`;return _n(t,Ma,{hint:"Cross-spec section links will fall back to spec titles."}),n}const{result:o=[]}=await e.json(),i=new Map(o.filter(e=>!e.error).map(e=>[`${e.spec}#${e.id}`,{title:e.title,number:e.number||null}]));return await async function(e,t){try{const n=(await Da()).transaction(Ia,"readwrite");for(const r of e){const e=`${r.spec}#${r.id}`,o=t.get(e);o&&n.objectStore(Ia).put({query:r,result:o},e)}await n.done,localStorage.setItem("HEADINGS:LAST_CACHED",Date.now().toString())}catch(e){console.error(e)}}(r,i),new Map([...n,...i])}catch{return _n("Failed to fetch heading texts from respec.org.",Ma,{hint:"Cross-spec section links will fall back to spec titles."}),n}}function Ba(e,{title:t,number:n}){e.classList.add("sec-ref"),e.textContent="",e.append("§ "),n?e.append(Ft`<bdi class="secno">${n} </bdi>`,t):e.append(t)}var Fa=Object.freeze({__proto__:null,HEADINGS_API_URL:qa,fetchHeadingTexts:Ha,name:Ma,run:async function(e){const t=document.querySelectorAll("a[data-cite-frag][data-matched-text]");if(!t.length)return;const n=function(e){const t="object"!=typeof e.xref||null===e.xref||Array.isArray(e.xref)?{}:e.xref;return"string"==typeof t.headingApiUrl?t.headingApiUrl:qa}(e),r=new Map,o=[];if(t.forEach(e=>{if(e.dataset.lt)Ii(e,e.dataset.lt),delete e.dataset.lt;else{const t=(e.dataset.cite??"").replace(/^[!?]/,""),n=e.dataset.citeFrag??"",i=`${t}#${n}`;o.push({elem:e,key:i}),r.has(i)||r.set(i,{spec:t,id:n})}}),!o.length)return;const i=await Ha([...r.values()],n);o.forEach(({elem:e,key:t})=>{const n=i.get(t);n?.title&&Ba(e,n)})},setHeadingContent:Ba});const Ua="core/contrib";var Wa=Object.freeze({__proto__:null,name:Ua,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void Sn(Rn`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,Ua)}const t=(e.editors??[]).map(e=>e.name),n=`${e.github.apiBase}/${e.github.fullName}/`;await async function(e,t){const n=document.getElementById("gh-contributors");if(!n)return;n.textContent="Fetching list of contributors...";const r=await o();null!==r?function(e,t){const n=e.sort((e,t)=>{const n=e.name||e.login,r=t.name||t.login;return n.toLowerCase().localeCompare(r.toLowerCase())});if("UL"===t.tagName)return void Ft(t)`${n.map(({name:e,login:t})=>`<li><a href="https://github.com/${t}">${e||t}</a></li>`)}`;const r=n.map(e=>e.name||e.login);t.textContent=an(r)}(r,n):n.textContent="Failed to fetch contributors.";async function o(){const{href:n}=new URL("contributors",t);try{const t=await async function(e,t=864e5){const n=new Request(e),r=new URL(n.url);let o,i;if("caches"in window)try{if(o=await caches.open(r.origin),i=await o.match(n),i&&new Date(i.headers.get("Expires")??"")>new Date)return i}catch(e){console.error("Failed to use Cache API.",e)}const a=await fetch(n);if(!a.ok&&i)return console.warn(`Returning a stale cached response for ${r}`),i;if(o&&a.ok){const e=a.clone(),r=new Headers(a.headers),i=new Date(Date.now()+t);r.set("Expires",i.toISOString());const s=new Response(await e.blob(),{headers:r});await o.put(n,s).catch(console.error)}return a}(n);if(!t.ok)throw new Error(`Request to ${n} failed with status code ${t.status}`);return(await t.json()).filter(t=>!e.includes(t.name||t.login)&&!t.login.includes("[bot]"))}catch(e){return Sn("Error loading contributors from GitHub.",Ua,{cause:e}),null}}}(t,n)}});var Ga=Object.freeze({__proto__:null,name:"core/fix-headers",run:function(){[...document.querySelectorAll("section:not(.introductory)")].map(e=>e.querySelector("h1, h2, h3, h4, h5, h6")).filter(e=>null!==e).forEach(e=>{const t=Math.min(function(e,t){const n=[];for(;e&&e!=e.ownerDocument.body;)e.matches(t)&&n.push(e),e=e.parentElement;return n}(e,"section").length+1,6);mn(e,`h${t}`)})}});const Va=["h2","h3","h4","h5","h6"],Za="core/structure",Ka=cn({en:{toc:"Table of Contents",back_to_top:"Back to Top"},zh:{toc:"内容大纲",back_to_top:"返回顶部"},ko:{toc:"목차",back_to_top:"맨 위로"},ja:{toc:"目次",back_to_top:"先頭に戻る"},nl:{toc:"Inhoudsopgave",back_to_top:"Terug naar boven"},es:{toc:"Tabla de Contenidos",back_to_top:"Volver arriba"},fr:{toc:"Table des matières",back_to_top:"Retourner en haut"},de:{toc:"Inhaltsverzeichnis",back_to_top:"Zurück nach oben"},cs:{toc:"Obsah",back_to_top:"Zpět na začátek"}});function Ya(e,t,{prefix:n=""}={}){let r=!1,o=0,i=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const a=Ft`<ol class="toc"></ol>`;for(const s of e){!s.isAppendix||n||r||(o=i,r=!0);let e=s.isIntro?"":r?Xa(i-o+1):n+i;const l=e.split(".").length;if(1===l&&(e+=".",s.header.before(document.createComment("OddPage"))),s.isIntro||(i+=1,s.header.prepend(Ft`<bdi class="secno">${e} </bdi>`)),l<=t){const n=s.header.id||s.element.id,r=Ja(s.header,n),o=Ya(s.subsections,t,{prefix:e});o&&r.append(o),a.append(r)}}return a}function Xa(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function Qa(e){const t=e.querySelectorAll(":scope > section"),n=[];for(const e of t){const t=e.classList.contains("notoc");if(!e.children.length||t)continue;const r=e.children[0];if(!Va.includes(r.localName))continue;const o=r.textContent;hn(e,void 0,o),n.push({element:e,header:r,title:o,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:Qa(e)})}return n}function Ja(e,t){const n=Ft`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach(e=>{const t=mn(e,"span");t.className="formerLink",t.removeAttribute("href")}),r.querySelectorAll("dfn").forEach(e=>{mn(e,"span").removeAttribute("id")}),Ft`<li class="tocline">${n}</li>`}var es=Object.freeze({__proto__:null,name:Za,run:function(e){if("maxTocLevel"in e==!1&&(e.maxTocLevel=1/0),function(){const e=[...document.querySelectorAll("section:not(.introductory) :is(h1,h2,h3,h4,h5,h6):first-child")].filter(e=>!e.closest("section.introductory"));if(!e.length)return;e.forEach(e=>{const t=Math.min(function(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}(e,"section").length+1,6),n=`h${t}`;e.localName!==n&&mn(e,n)})}(),!e.noTOC){!function(){const e=document.querySelectorAll("section[data-max-toc]");for(const t of e){const e=parseInt(t.dataset.maxToc??"",10);if(e<0||e>6||Number.isNaN(e)){Sn("`data-max-toc` must have a value between 0-6 (inclusive).",Za,{elements:[t]});continue}if(0===e){t.classList.add("notoc");continue}const n=t.querySelectorAll(`:scope > ${Array.from({length:e},()=>"section").join(" > ")}`);for(const e of n)e.classList.add("notoc")}}();const t=Ya(Qa(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=Ft`<nav id="toc"></nav>`,n=Ft`<h2 class="introductory">${Ka.toc}</h2>`;hn(n),t.append(n,e);const r=document.getElementById("toc")||document.getElementById("sotd")||document.getElementById("abstract");r&&("toc"===r.id?r.replaceWith(t):r.after(t));const o=Ft`<p role="navigation" id="back-to-top">
379
+ <a href="#title"><abbr title="${Ka.back_to_top}">&uarr;</abbr></a>
380
+ </p>`;document.body.append(o)}(t)}On("toc",void 0)}});const ts=cn({en:{informative:"This section is non-normative."},nl:{informative:"Dit onderdeel is niet-normatief."},ko:{informative:"이 부분은 비규범적입니다."},ja:{informative:"この節は仕様には含まれません."},de:{informative:"Dieser Abschnitt ist nicht normativ."},zh:{informative:"本章节不包含规范性内容。"},cs:{informative:"Tato sekce není normativní."},fr:{informative:"Cette section est non normative."}});var ns=Object.freeze({__proto__:null,name:"core/informative",run:function(){Array.from(document.querySelectorAll("section.informative")).map(e=>e.querySelector("h2, h3, h4, h5, h6")).filter(e=>null!==e).forEach(e=>{e.after(Ft`<p><em>${ts.informative}</em></p>`)})}});const rs=cn({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${ln(t.textContent)}`),n}}});var os=Object.freeze({__proto__:null,name:"core/id-headers",run:function(e){const t=document.querySelectorAll("section:not(.head,#abstract,#sotd) h2, h3, h4, h5, h6");for(const n of t){let t=n.id;if(t||(hn(n),t=n.parentElement?.id||n.id),!e.addSectionLinks)continue;const r=rs.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),o=Ft`<div class="header-wrapper"></div>`;n.replaceWith(o);const i=Ft`<a
381
381
  href="#${t}"
382
382
  class="self-link"
383
383
  aria-label="${r}"
384
- ></a>`;o.append(n,i)}}});const ra="ui/save-html",oa=cn({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),ia=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return Dn(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return Dn(this.type)}},{id:"respec-save-as-epub",ext:"epub",title:"EPUB 3",type:"application/epub+zip",get href(){const e=new URL("https://labs.w3.org/r2epub/");return e.searchParams.append("respec","true"),e.searchParams.append("url",document.location.href),e.href}}];function sa(e,t){const{id:n,href:r,ext:o,title:i,type:s}=e,a=function(e,t=""){return Xt.format(e).replace(Kt,t)}(t.publishDate||new Date),l=[t.specStatus,t.shortName||"spec",a].join("-");return Ft`<a
384
+ ></a>`;o.append(n,i)}}});const is="ui/save-html",as=cn({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),ss=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return Dn(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return Dn(this.type)}},{id:"respec-save-as-epub",ext:"epub",title:"EPUB 3",type:"application/epub+zip",get href(){const e=new URL("https://labs.w3.org/r2epub/");return e.searchParams.append("respec","true"),e.searchParams.append("url",document.location.href),e.href}}];function ls(e,t){const{id:n,href:r,ext:o,title:i,type:a}=e,s=function(e,t=""){return Xt.format(e).replace(Kt,t)}(t.publishDate||new Date),l=[t.specStatus,t.shortName||"spec",s].join("-");return Ft`<a
385
385
  href="${r}"
386
386
  id="${n}"
387
387
  download="${l}.${o}"
388
- type="${s}"
388
+ type="${a}"
389
389
  class="respec-save-button"
390
- onclick=${()=>$r.closeModal()}
390
+ onclick=${()=>Sr.closeModal()}
391
391
  >${i}</a
392
- >`}var aa=Object.freeze({__proto__:null,exportDocument:function(e,t){return _n("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",ra,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),Dn(t)},name:ra,run:function(e){const t={async show(t){await document.respec.ready;const n=Ft`<div class="respec-save-buttons">
393
- ${ia.map(t=>sa(t,e))}
394
- </div>`;$r.freshModal(oa.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=$r.addCommand(oa.save_snapshot,function(){if(!n)return;t.show(r)},"Ctrl+Shift+Alt+S","💾"))}});const la=cn({en:{about_respec:"About"},zh:{about_respec:"关于"},nl:{about_respec:"Over"},ja:{about_respec:"これについて"},de:{about_respec:"Über"},cs:{about_respec:"O aplikaci"}});window.respecVersion=window.respecVersion||"Developer Edition";const ca=document.createElement("div"),ua=Ft.bind(ca),da=$r.addCommand(`${la.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(pa).forEach(t=>{e.push(t)});ua`
392
+ >`}var cs=Object.freeze({__proto__:null,exportDocument:function(e,t){return _n("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",is,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),Dn(t)},name:is,run:function(e){const t={async show(t){await document.respec.ready;const n=Ft`<div class="respec-save-buttons">
393
+ ${ss.map(t=>ls(t,e))}
394
+ </div>`;Sr.freshModal(as.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=Sr.addCommand(as.save_snapshot,function(){if(!n)return;t.show(r)},"Ctrl+Shift+Alt+S","💾"))}});const us=cn({en:{about_respec:"About"},zh:{about_respec:"关于"},nl:{about_respec:"Over"},ja:{about_respec:"これについて"},de:{about_respec:"Über"},cs:{about_respec:"O aplikaci"}});window.respecVersion=window.respecVersion||"Developer Edition";const ds=document.createElement("div"),ps=Ft.bind(ds),hs=Sr.addCommand(`${us.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(fs).forEach(t=>{e.push(t)});ps`
395
395
  <p>
396
396
  ReSpec is a document production toolchain, with a notable focus on W3C specifications.
397
397
  </p>
@@ -415,19 +415,19 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle}
415
415
  </thead>
416
416
  <tbody>${e}</tbody>
417
417
  </table>
418
- `,$r.freshModal(`${la.about_respec} - ${window.respecVersion}`,ca,da)},"Ctrl+Shift+Alt+A","ℹ️");function pa({name:e,duration:t}){return Ft`
418
+ `,Sr.freshModal(`${us.about_respec} - ${window.respecVersion}`,ds,hs)},"Ctrl+Shift+Alt+A","ℹ️");function fs({name:e,duration:t}){return Ft`
419
419
  <tr>
420
420
  <td><a href="${`https://github.com/speced/respec/blob/develop/src/${e}.js`}">${e}</a></td>
421
421
  <td>${t}</td>
422
422
  </tr>
423
- `}var ha=Object.freeze({__proto__:null});var fa=Object.freeze({__proto__:null,name:"core/seo",run:function(e){if(e.gitRevision){const t=Ft`<meta
423
+ `}var ms=Object.freeze({__proto__:null});var gs=Object.freeze({__proto__:null,name:"core/seo",run:function(e){if(e.gitRevision){const t=Ft`<meta
424
424
  name="revision"
425
425
  content="${e.gitRevision}"
426
- />`;document.head.appendChild(t)}const t=document.querySelector("#abstract p:first-of-type");if(!t)return;const n=t.textContent.replace(/\s+/," ").trim(),r=document.createElement("meta");r.name="description",r.content=n,document.head.appendChild(r)}});const ma="\n --base: #282c34;\n --mono-1: #abb2bf;\n --mono-2: #818896;\n --mono-3: #5c6370;\n --hue-1: #56b6c2;\n --hue-2: #61aeee;\n --hue-3: #c678dd;\n --hue-4: #98c379;\n --hue-5: #e06c75;\n --hue-5-2: #be5046;\n --hue-6: #d19a66;\n --hue-6-2: #e6c07b;\n";var ga=String.raw`.hljs,body:has(input[name=color-scheme][value=light]:checked) .hljs,head:not(:has(meta[name=color-scheme][content~=dark]))+body .hljs{--base:#fafafa;--mono-1:#383a42;--mono-2:#686b77;--mono-3:#717277;--hue-1:#0b76c5;--hue-2:#336ae3;--hue-3:#a626a4;--hue-4:#42803c;--hue-5:#ca4706;--hue-5-2:#c91243;--hue-6:#986801;--hue-6-2:#9a6a01}
426
+ />`;document.head.appendChild(t)}const t=document.querySelector("#abstract p:first-of-type");if(!t)return;const n=t.textContent.replace(/\s+/," ").trim(),r=document.createElement("meta");r.name="description",r.content=n,document.head.appendChild(r)}});const bs="\n --base: #282c34;\n --mono-1: #abb2bf;\n --mono-2: #818896;\n --mono-3: #5c6370;\n --hue-1: #56b6c2;\n --hue-2: #61aeee;\n --hue-3: #c678dd;\n --hue-4: #98c379;\n --hue-5: #e06c75;\n --hue-5-2: #be5046;\n --hue-6: #d19a66;\n --hue-6-2: #e6c07b;\n";var ys=String.raw`.hljs,body:has(input[name=color-scheme][value=light]:checked) .hljs,head:not(:has(meta[name=color-scheme][content~=dark]))+body .hljs{--base:#fafafa;--mono-1:#383a42;--mono-2:#686b77;--mono-3:#717277;--hue-1:#0b76c5;--hue-2:#336ae3;--hue-3:#a626a4;--hue-4:#42803c;--hue-5:#ca4706;--hue-5-2:#c91243;--hue-6:#986801;--hue-6-2:#9a6a01}
427
427
  @media (prefers-color-scheme:dark){
428
- .hljs{${ma}}
428
+ .hljs{${bs}}
429
429
  }
430
- body:has(input[name=color-scheme][value=dark]:checked) .hljs{${ma}}
430
+ body:has(input[name=color-scheme][value=dark]:checked) .hljs{${bs}}
431
431
  .hljs{display:block;overflow-x:auto;padding:.5em;color:#383a42;color:var(--mono-1,#383a42);background:#fafafa;background:var(--base,#fafafa)}
432
432
  .hljs-comment,.hljs-quote{color:#717277;color:var(--mono-3,#717277);font-style:italic}
433
433
  .hljs-doctag,.hljs-formula,.hljs-keyword{color:#a626a4;color:var(--hue-3,#a626a4)}
@@ -439,7 +439,7 @@ body:has(input[name=color-scheme][value=dark]:checked) .hljs{${ma}}
439
439
  .hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#336ae3;color:var(--hue-2,#336ae3)}
440
440
  .hljs-emphasis{font-style:italic}
441
441
  .hljs-strong{font-weight:700}
442
- .hljs-link{text-decoration:underline}`;const ba=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function ya(e){const t=e;t.setAttribute("aria-busy","true");const n=(r=t.classList,Array.from(r).filter(e=>"highlight"!==e&&"nolinks"!==e).map(e=>e.toLowerCase()));var r;let o;try{o=await async function(e,t){const n={action:"highlight",code:e,id:ba(),languages:t},r=await Un;return r.postMessage(n),new Promise((e,t)=>{const o=setTimeout(()=>{t(new Error("Timed out waiting for highlight."))},4e3);r.addEventListener("message",function t(i){const{data:{id:s,language:a,value:l}}=i;s===n.id&&(r.removeEventListener("message",t),clearTimeout(o),e({language:a,value:l}))})})}(t.textContent,n)}catch(e){return void console.error(e)}const{language:i,value:s}=o;switch(t.localName){case"pre":t.classList.remove(i),t.innerHTML=`<code class="hljs${i?` ${i}`:""}">${s}</code>`,t.classList.length||t.removeAttribute("class");break;case"code":t.innerHTML=s,t.classList.add("hljs"),i&&t.classList.add(i)}t.setAttribute("aria-busy","false")}var wa=Object.freeze({__proto__:null,name:"core/highlight",run:async function(e){if(e.noHighlightCSS)return;const t=[...document.querySelectorAll("\n pre:not(.idl):not(.cddl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.cddl):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(ya);Jn(ga),await Promise.all(n)}});const va="core/list-sorter";function ka(e){const t="ascending"===e?1:-1;return(e,n)=>{const r=e.textContent??"",o=n.textContent??"";return t*r.trim().localeCompare(o.trim())}}function xa(e,t){return[...e.querySelectorAll(":scope > li")].sort(ka(t)).reduce((e,t)=>(e.appendChild(t),e),document.createDocumentFragment())}function $a(e,t){return[...e.querySelectorAll(":scope > dt")].sort(ka(t)).reduce((e,t)=>{const{nodeType:n,nodeName:r}=t,o=document.createDocumentFragment();let{nextSibling:i}=t;for(;i&&i.nextSibling;){o.appendChild(i.cloneNode(!0));const{nodeType:e,nodeName:t}=i.nextSibling;if(e===n&&t===r)break;i=i.nextSibling}return o.prepend(t.cloneNode(!0)),e.appendChild(o),e},document.createDocumentFragment())}var Ea=Object.freeze({__proto__:null,name:va,run:function(){const e=document.querySelectorAll("[data-sort]");for(const t of e){let e;const n=t.dataset.sort||"ascending";switch(t.localName){case"dl":e=$a(t,n);break;case"ol":case"ul":e=xa(t,n);break;default:_n(`ReSpec can't sort ${t.localName} elements.`,va,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:$a,sortListItems:xa});var Sa=String.raw`var:hover{text-decoration:underline;cursor:pointer}
442
+ .hljs-link{text-decoration:underline}`;const ws=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function vs(e){const t=e;t.setAttribute("aria-busy","true");const n=(r=t.classList,Array.from(r).filter(e=>"highlight"!==e&&"nolinks"!==e).map(e=>e.toLowerCase()));var r;let o;try{o=await async function(e,t){const n={action:"highlight",code:e,id:ws(),languages:t},r=await Un;return r.postMessage(n),new Promise((e,t)=>{const o=setTimeout(()=>{t(new Error("Timed out waiting for highlight."))},4e3);r.addEventListener("message",function t(i){const{data:{id:a,language:s,value:l}}=i;a===n.id&&(r.removeEventListener("message",t),clearTimeout(o),e({language:s,value:l}))})})}(t.textContent,n)}catch(e){return void console.error(e)}const{language:i,value:a}=o;switch(t.localName){case"pre":t.classList.remove(i),t.innerHTML=`<code class="hljs${i?` ${i}`:""}">${a}</code>`,t.classList.length||t.removeAttribute("class");break;case"code":t.innerHTML=a,t.classList.add("hljs"),i&&t.classList.add(i)}t.setAttribute("aria-busy","false")}var ks=Object.freeze({__proto__:null,name:"core/highlight",run:async function(e){if(e.noHighlightCSS)return;const t=e.diagrams?".idl, .cddl, .mermaid, .nohighlight":".idl, .cddl, .nohighlight",n=[...document.querySelectorAll(`\n pre:not(${t}) > code:not(.nohighlight),\n pre:not(${t}),\n code.highlight\n `)].filter(e=>"pre"!==e.localName||!e.querySelector("code"));if(!n.length)return;const r=n.filter(e=>e.textContent.trim()).map(vs);Jn(ys),await Promise.all(r)}});const xs="core/list-sorter";function $s(e){const t="ascending"===e?1:-1;return(e,n)=>{const r=e.textContent??"",o=n.textContent??"";return t*r.trim().localeCompare(o.trim())}}function Es(e,t){return[...e.querySelectorAll(":scope > li")].sort($s(t)).reduce((e,t)=>(e.appendChild(t),e),document.createDocumentFragment())}function Ss(e,t){return[...e.querySelectorAll(":scope > dt")].sort($s(t)).reduce((e,t)=>{const{nodeType:n,nodeName:r}=t,o=document.createDocumentFragment();let{nextSibling:i}=t;for(;i&&i.nextSibling;){o.appendChild(i.cloneNode(!0));const{nodeType:e,nodeName:t}=i.nextSibling;if(e===n&&t===r)break;i=i.nextSibling}return o.prepend(t.cloneNode(!0)),e.appendChild(o),e},document.createDocumentFragment())}var _s=Object.freeze({__proto__:null,name:xs,run:function(){const e=document.querySelectorAll("[data-sort]");for(const t of e){let e;const n=t.dataset.sort||"ascending";switch(t.localName){case"dl":e=Ss(t,n);break;case"ol":case"ul":e=Es(t,n);break;default:_n(`ReSpec can't sort ${t.localName} elements.`,xs,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:Ss,sortListItems:Es});var Cs=String.raw`var:hover{text-decoration:underline;cursor:pointer}
443
443
  var.respec-hl{color:var(--color,#000);background-color:var(--bg-color);box-shadow:0 0 0 2px var(--bg-color)}
444
444
  @media (prefers-color-scheme:dark){
445
445
  var.respec-hl{filter:saturate(.9) brightness(.9)}
@@ -453,11 +453,11 @@ var.respec-hl-c6{--bg-color:#82ddff}
453
453
  var.respec-hl-c7{--bg-color:#ffbcf2}
454
454
  @media print{
455
455
  var.respec-hl{background:0 0;color:#000;box-shadow:unset}
456
- }`;var _a=Object.freeze({__proto__:null,name:"core/highlight-vars",run:async function(e){if(!e.highlightVars)return;Jn(Sa);const t=document.createElement("script");t.id="respec-highlight-vars",t.textContent=await async function(){try{return(await Promise.resolve().then(function(){return Cl})).default}catch{return Mn("./src/core/highlight-vars.runtime.js")}}(),document.body.append(t),Nn("beforesave",e=>{e.querySelectorAll("var.respec-hl").forEach(e=>{const t=[...e.classList.values()].filter(e=>e.startsWith("respec-hl"));e.classList.remove(...t),e.classList.length||e.removeAttribute("class")})})}});var Ca=String.raw`var[data-type]{position:relative}
456
+ }`;var As=Object.freeze({__proto__:null,name:"core/highlight-vars",run:async function(e){if(!e.highlightVars)return;Jn(Cs);const t=document.createElement("script");t.id="respec-highlight-vars",t.textContent=await async function(){try{return(await Promise.resolve().then(function(){return Ll})).default}catch{return Mn("./src/core/highlight-vars.runtime.js")}}(),document.body.append(t),Nn("beforesave",e=>{e.querySelectorAll("var.respec-hl").forEach(e=>{const t=[...e.classList.values()].filter(e=>e.startsWith("respec-hl"));e.classList.remove(...t),e.classList.length||e.removeAttribute("class")})})}});var Ls=String.raw`var[data-type]{position:relative}
457
457
  var[data-type]::after,var[data-type]::before{position:absolute;left:50%;top:-6px;opacity:0;transition:opacity .4s;pointer-events:none}
458
458
  var[data-type]::before{content:"";transform:translateX(-50%);border-width:4px 6px 0 6px;border-style:solid;border-color:transparent;border-top-color:#222}
459
459
  var[data-type]::after{content:attr(data-type);transform:translateX(-50%) translateY(-100%);background:#222;text-align:center;font-family:"Dank Mono","Fira Code",monospace;font-style:normal;padding:6px;border-radius:3px;color:#daca88;text-indent:0;font-weight:400}
460
- var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Aa=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;Jn(Ca);let t=null;const n=new Map,r=document.querySelectorAll("section var");for(const e of r){const r=e.closest("section");if(t!==r&&(t=r,n.clear()),e.dataset.type){n.set(e.textContent.trim(),e.dataset.type);continue}const o=n.get(e.textContent.trim());o&&(e.dataset.type=o)}}});const La="core/anchor-expander";function Ra(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void Sn(`Found matching element "${t}", but it has no title or marker.`,La,{title:"Missing title.",elements:[n]})}const o=vn(r);n.append(...o.childNodes),n.classList.add("box-ref")}function Ta(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void Sn(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,La,{title:"Missing figcaption in referenced figure.",elements:[n]})}const o=[...vn(r.querySelector(".self-link")).childNodes].map(e=>(e.classList?.remove("figno"),e));n.append(...o),n.classList.add("fig-ref");const i=r.querySelector(".fig-title");!n.hasAttribute("title")&&i&&(n.title=ln(i.textContent))}function Pa(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void Sn(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,La,{title:"Missing caption in referenced table.",elements:[n]})}const o=[...vn(r.querySelector(".self-link")).childNodes].map(e=>(e.classList?.remove("tableno"),e));n.append(...o),n.classList.add("table-ref");const i=r.querySelector(".table-title");!n.hasAttribute("title")&&i&&(n.title=ln(i.textContent))}function Oa(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(!r){n.textContent=n.getAttribute("href");return void Sn("Found matching section, but the section was lacking a heading element.",La,{title:`No matching id in document: "${t}".`,elements:[n]})}Na(r,n),Ia(r,n)}function Na(e,t){const n=e.querySelector(".self-link"),r=[...vn(e).childNodes].filter(e=>!e.classList||!e.classList.contains("self-link"));t.append(...r),n&&t.prepend("§ "),t.classList.add("sec-ref"),t.lastChild&&t.lastChild.nodeType===Node.TEXT_NODE&&(t.lastChild.textContent=(t.lastChild.textContent??"").trimEnd()),t.querySelectorAll("a").forEach(e=>{const t=mn(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)})}function Ia(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const o=t.closest(`[${n}]`);o&&o.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n)??"")}}var ja=Object.freeze({__proto__:null,name:La,run:function(){const e=[...document.querySelectorAll("a[href^='#']:not(.self-link):not([href$='the-empty-string'])")].filter(e=>""===e.textContent.trim());for(const t of e){const e=(t.getAttribute("href")??"").slice(1),n=document.getElementById(e);if(!n){t.textContent=t.getAttribute("href");Sn(`Couldn't expand inline reference. The id "${e}" is not in the document.`,La,{title:`No matching id in document: ${e}.`,elements:[t]});continue}switch(n.localName){case"h6":case"h5":case"h4":case"h3":case"h2":Na(n,t);break;case"section":Oa(n,e,t);break;case"figure":Ta(n,e,t);break;case"table":Pa(n,e,t);break;case"aside":case"div":Ra(n,e,t);break;case"dfn":{const e=vn(n);t.append(...e.childNodes),t.classList.add("dfn-ref");break}default:t.textContent=t.getAttribute("href");Sn("ReSpec doesn't support expanding this kind of reference.",La,{title:`Can't expand "#${e}".`,elements:[t]})}Ia(n,t),t.normalize()}}});cn({en:{copy:"Copy to clipboard",copied:"Copied!",failed:"Could not copy!"},cs:{copy:"Kopírovat do schránky",copied:"Zkopírováno!",failed:"Nelze kopírovat!"},de:{copy:"In die Zwischenablage kopieren",copied:"Kopiert!",failed:"Kopieren fehlgeschlagen!"},es:{copy:"Copiar al portapapeles",copied:"¡Copiado!",failed:"¡No se pudo copiar!"},fr:{copy:"Copier dans le presse-papiers",copied:"Copié !",failed:"Impossible de copier !"},ja:{copy:"クリップボードにコピー",copied:"コピーしました",failed:"コピーできませんでした"},ko:{copy:"클립보드에 복사",copied:"복사됨",failed:"복사 실패"},nl:{copy:"Kopiëren naar klembord",copied:"Gekopieerd!",failed:"Kopiëren mislukt!"},zh:{copy:"复制到剪贴板",copied:"已复制",failed:"无法复制"}});const Da='<svg aria-hidden="true" height="16" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z"/></svg>';var za=String.raw`dfn{cursor:pointer}
460
+ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Rs=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;Jn(Ls);let t=null;const n=new Map,r=document.querySelectorAll("section var");for(const e of r){const r=e.closest("section");if(t!==r&&(t=r,n.clear()),e.dataset.type){n.set(e.textContent.trim(),e.dataset.type);continue}const o=n.get(e.textContent.trim());o&&(e.dataset.type=o)}}});const Ts="core/anchor-expander";function Ps(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void Sn(`Found matching element "${t}", but it has no title or marker.`,Ts,{title:"Missing title.",elements:[n]})}const o=vn(r);n.append(...o.childNodes),n.classList.add("box-ref")}function Os(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void Sn(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,Ts,{title:"Missing figcaption in referenced figure.",elements:[n]})}const o=[...vn(r.querySelector(".self-link")).childNodes].map(e=>(e.classList?.remove("figno"),e));n.append(...o),n.classList.add("fig-ref");const i=r.querySelector(".fig-title");!n.hasAttribute("title")&&i&&(n.title=ln(i.textContent))}function Ns(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void Sn(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,Ts,{title:"Missing caption in referenced table.",elements:[n]})}const o=[...vn(r.querySelector(".self-link")).childNodes].map(e=>(e.classList?.remove("tableno"),e));n.append(...o),n.classList.add("table-ref");const i=r.querySelector(".table-title");!n.hasAttribute("title")&&i&&(n.title=ln(i.textContent))}function Is(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(!r){n.textContent=n.getAttribute("href");return void Sn("Found matching section, but the section was lacking a heading element.",Ts,{title:`No matching id in document: "${t}".`,elements:[n]})}js(r,n),Ds(r,n)}function js(e,t){const n=e.querySelector(".self-link"),r=[...vn(e).childNodes].filter(e=>!e.classList||!e.classList.contains("self-link"));t.append(...r),n&&t.prepend("§ "),t.classList.add("sec-ref"),t.lastChild&&t.lastChild.nodeType===Node.TEXT_NODE&&(t.lastChild.textContent=(t.lastChild.textContent??"").trimEnd()),t.querySelectorAll("a").forEach(e=>{const t=mn(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)})}function Ds(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const o=t.closest(`[${n}]`);o&&o.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n)??"")}}var zs=Object.freeze({__proto__:null,name:Ts,run:function(){const e=[...document.querySelectorAll("a[href^='#']:not(.self-link):not([href$='the-empty-string'])")].filter(e=>""===e.textContent.trim());for(const t of e){const e=(t.getAttribute("href")??"").slice(1),n=document.getElementById(e);if(!n){t.textContent=t.getAttribute("href");Sn(`Couldn't expand inline reference. The id "${e}" is not in the document.`,Ts,{title:`No matching id in document: ${e}.`,elements:[t]});continue}switch(n.localName){case"h6":case"h5":case"h4":case"h3":case"h2":js(n,t);break;case"section":Is(n,e,t);break;case"figure":Os(n,e,t);break;case"table":Ns(n,e,t);break;case"aside":case"div":Ps(n,e,t);break;case"dfn":{const e=vn(n);t.append(...e.childNodes),t.classList.add("dfn-ref");break}default:t.textContent=t.getAttribute("href");Sn("ReSpec doesn't support expanding this kind of reference.",Ts,{title:`Can't expand "#${e}".`,elements:[t]})}Ds(n,t),t.normalize()}}});cn({en:{copy:"Copy to clipboard",copied:"Copied!",failed:"Could not copy!"},cs:{copy:"Kopírovat do schránky",copied:"Zkopírováno!",failed:"Nelze kopírovat!"},de:{copy:"In die Zwischenablage kopieren",copied:"Kopiert!",failed:"Kopieren fehlgeschlagen!"},es:{copy:"Copiar al portapapeles",copied:"¡Copiado!",failed:"¡No se pudo copiar!"},fr:{copy:"Copier dans le presse-papiers",copied:"Copié !",failed:"Impossible de copier !"},ja:{copy:"クリップボードにコピー",copied:"コピーしました",failed:"コピーできませんでした"},ko:{copy:"클립보드에 복사",copied:"복사됨",failed:"복사 실패"},nl:{copy:"Kopiëren naar klembord",copied:"Gekopieerd!",failed:"Kopiëren mislukt!"},zh:{copy:"复制到剪贴板",copied:"已复制",failed:"无法复制"}});const Ms='<svg aria-hidden="true" height="16" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z"/></svg>';var qs=String.raw`dfn{cursor:pointer}
461
461
  .dfn-panel{position:absolute;z-index:35;min-width:300px;max-width:500px;padding:.5em .75em;margin-top:.6em;font-family:"Helvetica Neue",sans-serif;font-size:small;background:#fff;background:var(--indextable-hover-bg,#fff);color:#000;color:var(--text,#000);box-shadow:0 1em 3em -.4em rgba(0,0,0,.3),0 0 1px 1px rgba(0,0,0,.05);box-shadow:0 1em 3em -.4em var(--tocsidebar-shadow,rgba(0,0,0,.3)),0 0 1px 1px var(--tocsidebar-shadow,rgba(0,0,0,.05));border-radius:2px}
462
462
  .dfn-panel:not(.docked)>.caret{position:absolute;top:-9px}
463
463
  .dfn-panel:not(.docked)>.caret::after,.dfn-panel:not(.docked)>.caret::before{content:"";position:absolute;border:10px solid transparent;border-top:0;border-bottom:10px solid #fff;border-bottom-color:var(--indextable-hover-bg,#fff);top:0}
@@ -483,7 +483,7 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Aa=Obje
483
483
  .dfn-panel .dfn-panel-copy-btn:focus svg,.dfn-panel .dfn-panel-lt li:hover .dfn-panel-copy-btn svg{opacity:1}
484
484
  .dfn-panel .dfn-panel-copy-btn:hover svg{background:color-mix(in srgb,currentColor 15%,transparent)}
485
485
  .dfn-panel .dfn-panel-copy-btn:active svg{background:color-mix(in srgb,currentColor 30%,transparent);box-shadow:inset 0 1px 2px color-mix(in srgb,currentColor 50%,transparent)}
486
- .respec-visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}`;const Ma="respec-dfn-panel-copy-icon";function qa(e){const{id:t}=e,n=e.dataset.href||`#${t}`,r=document.querySelectorAll(`a[href="${n}"]:not(.index-term)`),o=`dfn-panel-for-${e.id}`,i=e.getAttribute("aria-label")||ln(e.textContent),s=Ft`
486
+ .respec-visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}`;const Hs="respec-dfn-panel-copy-icon";function Bs(e){const{id:t}=e,n=e.dataset.href||`#${t}`,r=document.querySelectorAll(`a[href="${n}"]:not(.index-term)`),o=`dfn-panel-for-${e.id}`,i=e.getAttribute("aria-label")||ln(e.textContent),a=Ft`
487
487
  <div
488
488
  class="dfn-panel"
489
489
  id="${o}"
@@ -525,23 +525,23 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Aa=Obje
525
525
  >${" "}`)}
526
526
  </li>`;return Ft`<ul class="dfn-panel-refs">
527
527
  ${[...n].map(o)}
528
- </ul>`}(t,r)} ${function(e){if(!e.matches("dfn[data-export]"))return null;const t=function(e){if(/!overload-/.test(e.dataset.lt??""))return[];const t=e.dataset.dfnType||"dfn",n=e.dataset.dfnFor?.split(",").map(e=>e.trim()).filter(Boolean)??[],r=n.length?n:[null],o=ln(e.textContent);return fn(e).sort((e,t)=>Number(t===o)-Number(e===o)).flatMap(e=>r.map(n=>function(e,t,n){const r=n?`${n}/`:"";if(Fa.has(t))return`[=${r}${e.replaceAll("/","\\/")}=]`;if(Ba.has(t))return e.includes("/")&&!e.startsWith('"')?"":`{^${r}${e}^}`;if(e.includes("/"))return"";if(Ha.has(t)){if(n&&e.startsWith(`${n}.`))return"";return`{{${r}${"enum-value"===t&&'""'!==e?`"${e}"`:e}}}`}switch(t){case"element":return n?"":`[^${e}^]`;case"element-attr":return`[^${r||"/"}${e}^]`;case"attr-value":return n?`[^${r}${e}^]`:"";default:return""}}(e,t,n))).filter(Boolean)}(e);if(!t.length)return null;const n=`dfn-panel-lt-heading-${e.id}`;return Ft`<p><b id="${n}">Possible linking syntaxes:</b></p>
528
+ </ul>`}(t,r)} ${function(e){if(!e.matches("dfn[data-export]"))return null;const t=function(e){if(/!overload-/.test(e.dataset.lt??""))return[];const t=e.dataset.dfnType||"dfn",n=e.dataset.dfnFor?.split(",").map(e=>e.trim()).filter(Boolean)??[],r=n.length?n:[null],o=ln(e.textContent);return fn(e).sort((e,t)=>Number(t===o)-Number(e===o)).flatMap(e=>r.map(n=>function(e,t,n){const r=n?`${n}/`:"";if(Ws.has(t))return`[=${r}${e.replaceAll("/","\\/")}=]`;if(Us.has(t))return e.includes("/")&&!e.startsWith('"')?"":`{^${r}${e}^}`;if(e.includes("/"))return"";if(Fs.has(t)){if(n&&e.startsWith(`${n}.`))return"";return`{{${r}${"enum-value"===t&&'""'!==e?`"${e}"`:e}}}`}switch(t){case"element":return n?"":`[^${e}^]`;case"element-attr":return`[^${r||"/"}${e}^]`;case"attr-value":return n?`[^${r}${e}^]`:"";default:return""}}(e,t,n))).filter(Boolean)}(e);if(!t.length)return null;const n=`dfn-panel-lt-heading-${e.id}`;return Ft`<p><b id="${n}">Possible linking syntaxes:</b></p>
529
529
  <ul class="dfn-panel-lt" aria-labelledby="${n}">
530
530
  ${t.map(e=>Ft`<li>${function(e){return Ft`<button type="button" class="dfn-panel-copy-btn">
531
531
  <span class="respec-visually-hidden">Copy </span><code>${e}</code>
532
532
  <svg aria-hidden="true" viewBox="0 0 14 16">
533
- <use href="#${Ma}"></use>
533
+ <use href="#${Hs}"></use>
534
534
  </svg>
535
535
  </button>`}(e)}</li>`)}
536
536
  </ul>`}(e)}
537
537
  </div>
538
- `;return s}const Ha=new Set(["attribute","callback","const","constructor","dict-member","dictionary","enum-value","enum","exception","extended-attribute","interface","method","namespace","typedef"]),Ba=new Set(["cddl-type","cddl-key","cddl-value"]),Fa=new Set(["dfn","abstract-op"]);var Ua=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){Jn(za,{before: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(qa(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");t.querySelector(".dfn-panel-copy-btn")&&t.append(function(){const e=document.createElement("template");e.innerHTML=Da;const t=e.content.firstElementChild;return Ft`<svg class="respec-visually-hidden" aria-hidden="true">
539
- <symbol id="${Ma}" viewBox="${t.getAttribute("viewBox")}">
538
+ `;return a}const Fs=new Set(["attribute","callback","const","constructor","dict-member","dictionary","enum-value","enum","exception","extended-attribute","interface","method","namespace","typedef"]),Us=new Set(["cddl-type","cddl-key","cddl-value"]),Ws=new Set(["dfn","abstract-op"]);var Gs=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){Jn(qs,{before: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(Bs(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");t.querySelector(".dfn-panel-copy-btn")&&t.append(function(){const e=document.createElement("template");e.innerHTML=Ms;const t=e.content.firstElementChild;return Ft`<svg class="respec-visually-hidden" aria-hidden="true">
539
+ <symbol id="${Hs}" viewBox="${t.getAttribute("viewBox")}">
540
540
  ${[...t.childNodes]}
541
541
  </symbol>
542
- </svg>`}());const n=document.body.querySelector("script");n?n.before(t):document.body.append(t);const r=document.createElement("script");r.id="respec-dfn-panel",r.textContent=await async function(){try{return(await Promise.resolve().then(function(){return Al})).default}catch{return Mn("./src/core/dfn-panel.runtime.js")}}(),document.body.append(r)}});const Wa=new Promise((e,t)=>{});cn({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:"}});const Ga="rs-changelog",Va=class extends HTMLElement{constructor(){super();const e=this.getAttribute("filter"),t=e&&"function"==typeof window[e]?window[e]:()=>!0;this.props={from:this.getAttribute("from"),to:this.getAttribute("to")||"HEAD",repo:this.getAttribute("repo"),path:this.getAttribute("path"),filter:t}}connectedCallback(){const{from:e,to:t,filter:n,repo:r,path:o}=this.props;Ft.bind(this)`
542
+ </svg>`}());const n=document.body.querySelector("script");n?n.before(t):document.body.append(t);const r=document.createElement("script");r.id="respec-dfn-panel",r.textContent=await async function(){try{return(await Promise.resolve().then(function(){return Rl})).default}catch{return Mn("./src/core/dfn-panel.runtime.js")}}(),document.body.append(r)}});const Vs=new Promise((e,t)=>{});cn({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:"}});const Zs="rs-changelog",Ks=class extends HTMLElement{constructor(){super();const e=this.getAttribute("filter"),t=e&&"function"==typeof window[e]?window[e]:()=>!0;this.props={from:this.getAttribute("from"),to:this.getAttribute("to")||"HEAD",repo:this.getAttribute("repo"),path:this.getAttribute("path"),filter:t}}connectedCallback(){const{from:e,to:t,filter:n,repo:r,path:o}=this.props;Ft.bind(this)`
543
543
  <ul>
544
- ${{any:Za(e,t,n,r,o).then(e=>async function(e,t){const n=await Wa,r=t?`https://github.com/${t}/`:n?.repoURL;return e.map(e=>{const[t,n=null]=e.message.split(/\(#(\d+)\)/,2),o=`${r}commit/${e.hash}`,i=n&&Ft` (<a href="${n?`${r}pull/${n}`:null}">#${n}</a>)`;return Ft`<li><a href="${o}">${t.trim()}</a>${i}</li>`})}(e,r)).catch(e=>Sn(e.message,Ga,{elements:[this],cause:e})).finally(()=>{this.dispatchEvent(new CustomEvent("done"))}),placeholder:"Loading list of commits..."}}
544
+ ${{any:Ys(e,t,n,r,o).then(e=>async function(e,t){const n=await Vs,r=t?`https://github.com/${t}/`:n?.repoURL;return e.map(e=>{const[t,n=null]=e.message.split(/\(#(\d+)\)/,2),o=`${r}commit/${e.hash}`,i=n&&Ft` (<a href="${n?`${r}pull/${n}`:null}">#${n}</a>)`;return Ft`<li><a href="${o}">${t.trim()}</a>${i}</li>`})}(e,r)).catch(e=>Sn(e.message,Zs,{elements:[this],cause:e})).finally(()=>{this.dispatchEvent(new CustomEvent("done"))}),placeholder:"Loading list of commits..."}}
545
545
  </ul>
546
- `}};async function Za(e,t,n,r,o){let i;try{const s=await Wa;if(!s)throw new Error("`respecConfig.github` is not set");const a=r||s.fullName,l=new URL("commits",`${s.apiBase}/${a}/`);e&&l.searchParams.set("from",e),l.searchParams.set("to",t),o&&l.searchParams.set("path",o);const c=await fetch(l.href);if(!c.ok)throw new Error(`Request to ${l} failed with status code ${c.status}`);if(i=await c.json(),!i.length)throw new Error(`No commits between ${e}..${t}.`);i=i.filter(n)}catch(e){const t=`Error loading commits from GitHub. ${e.message}`;throw new Error(t,{cause:e})}return i}const Ka=[Object.freeze({__proto__:null,element:Va,name:Ga})];var Ya=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){Ka.forEach(e=>{customElements.define(e.name,e.element)});const e=Ka.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 Xa=Object.freeze({__proto__:null,name:"core/dfn-contract",run:function(){!function(){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=""}(),function(){const e=document.querySelectorAll("dl.definitions dt:has(dfn[data-dfn-type])");for(const t of e){const e=t.querySelector("dfn[data-dfn-type]").id,n=t.nextElementSibling;n&&!n.dataset.defines&&e&&(n.dataset.defines=`#${e}`)}const t=document.querySelectorAll(".definition:has(dfn[data-dfn-type])");for(const e of t){const t=e.querySelector("dfn[data-dfn-type]");t.id&&!e.dataset.defines&&(e.dataset.defines=`#${t.id}`)}}()}});const Qa="core/linter-rules/check-charset",Ja=cn({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"文档只能包含一个 charset 属性为 utf-8 的 `<meta>` 标签",hint:'将此行添加到文档的 `<head>` 部分—— `<meta charset="utf-8">` 或将 charset 设置为 utf-8(如果尚未设置)。'},cs:{msg:"Dokument smí obsahovat pouze jeden tag `<meta>` s charset nastaveným na 'utf-8'",hint:'Přidejte tento řádek do sekce `<head>` vašeho dokumentu - `<meta charset="utf-8">` nebo nastavte charset na "utf-8", pokud ještě není nastaven.'}});var el=Object.freeze({__proto__:null,name:Qa,run:function(e){if(!e.lint?.["check-charset"])return;const t=document.querySelectorAll("meta[charset]"),n=[];for(const e of t)n.push((e.getAttribute("charset")??"").trim().toLowerCase());n.includes("utf-8")&&1===t.length||_n(Ja.msg,Qa,{hint:Ja.hint,elements:[...t]})}});const tl="no-dfn-in-abstract",nl=`core/linter-rules/${tl}`,rl=cn({en:{msg:e=>`Definition \`${e}\` is in an unnumbered section (e.g. abstract or SotD).`,get hint(){return Rn`Definitions in unnumbered sections (abstract, SotD) are semantically out of place and appear in the terms index without a section number. Move this definition to a numbered section such as "Terminology". See ${"[export|#data-export]"}.`}}}),ol=["section#abstract","section#sotd","section.introductory"].join(", ");var il=Object.freeze({__proto__:null,name:nl,run:function(e){if(!e.lint?.[tl])return;const t=[...document.querySelectorAll("dfn")].filter(e=>e.closest(ol));t.forEach(e=>{const t=ln(e.textContent);_n(rl.msg(t),nl,{hint:rl.hint,elements:[e]})})}});const sl="core/linter-rules/check-punctuation",al=[".",":","!","?"],ll=al.map(e=>`"${e}"`).join(", "),cl=cn({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${ll}.`},cs:{msg:"Elementy `p` by měly končit interpunkčním znaménkem.",hint:`Ujistěte se, že elementy \`p\` končí jedním z těchto znaků: ${ll}.`}});var ul=Object.freeze({__proto__:null,name:sl,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${al.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter(e=>!t.test(e.textContent.trim()));n.length&&_n(cl.msg,sl,{hint:cl.hint,elements:n})}});const dl="core/linter-rules/local-refs-exist",pl=cn({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."},cs:{msg:"V dokumentu byla nalezena nefunkční lokální reference.",hint:"Opravte prosím uvedené odkazy."}});function hl(e){const t=e.getAttribute("href")?.substring(1);if(!t)return;const n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var fl=Object.freeze({__proto__:null,name:dl,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(hl);t.length&&_n(pl.msg,dl,{hint:pl.hint,elements:t})}});const ml="core/linter-rules/no-headingless-sections",gl=cn({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `<div>`."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`."},zh:{msg:"所有章节(section)都必须以 `h2-6` 元素开头。",hint:"将 `h2-6` 添加到有问题的章节或使用 `<div>`。"},cs:{msg:"Všechny sekce musí začínat elementem `h2-6`.",hint:"Přidejte do problematické sekce `h2-6` nebo použijte `<div>`."}});var bl=Object.freeze({__proto__:null,name:ml,run:function(e){if(!e.lint?.["no-headingless-sections"])return;const t=[...document.querySelectorAll("section:not(.head,.introductory,#abstract,#sotd)")].filter(({firstElementChild:e})=>!e||!(e.matches(".header-wrapper")||e instanceof HTMLHeadingElement));t.length&&_n(gl.msg,ml,{hint:gl.hint,elements:t})}});const yl="core/linter-rules/no-unused-vars",wl=cn({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."},cs:{msg:"Proměnná byla definována, ale nikdy nebyla použita.",hint:"Přidejte atribut `data-ignore-unused` k elementu `<var>`."}});var vl=Object.freeze({__proto__:null,name:yl,run:function(e){if(!e.lint?.["no-unused-vars"])return;const t=[],n=e=>!!e.querySelector(":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm");for(const e of document.querySelectorAll("section")){if(!n(e))continue;const r=e.querySelectorAll(":scope > :not(section) var");if(!r.length)continue;const o=new Map;for(const e of r){const t=ln(e.textContent),n=o.get(t)||o.set(t,[]).get(t);n?.push(e)}for(const e of o.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&_n(wl.msg,yl,{hint:wl.hint,elements:t})}});const kl="core/linter-rules/privsec-section",xl=cn({en:{msg:"Document must have a 'Privacy and/or Security' Considerations section.",hint:"Add a privacy and/or security considerations section. See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/)."},cs:{msg:"Dokument musí obsahovat sekci 'Zásady ochrany soukromí a/nebo bezpečnosti'.",hint:"Přidejte sekci o zásadách ochrany soukromí a/nebo bezpečnosti. Viz [Dotazník pro sebehodnocení](https://w3ctag.github.io/security-questionnaire/)."}});var $l=Object.freeze({__proto__:null,name:kl,run:function(e){var t;e.lint?.["privsec-section"]&&e.isRecTrack&&(t=document,!Array.from(t.querySelectorAll("h2, h3, h4, h5, h6")).some(({textContent:e})=>{const t=/(privacy|security)/im.test(e),n=/(considerations)/im.test(e);return t&&n||t}))&&_n(xl.msg,kl,{hint:xl.hint})}});const El="core/linter-rules/no-http-props",Sl=cn({en:{msg:Rn`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:Rn`${"[respecConfig]"} 中不允许使用不安全的URL.`,hint:"请将以下属性更改为 https://:"},cs:{msg:Rn`V ${"[respecConfig]"} nejsou povoleny nezabezpečené URL adresy.`,hint:"Změňte prosím následující vlastnosti na 'https://': "}});var _l=Object.freeze({__proto__:null,name:El,run:function(e){if(!e.lint?.["no-http-props"])return;if(!parent.location.href.startsWith("http"))return;const t=Object.getOwnPropertyNames(e).filter(t=>t.endsWith("URI")&&e[t]||"prevED"===t).filter(t=>new URL(e[t],parent.location.href).href.startsWith("http://"));if(t.length){const e=sn(t,e=>Rn`${`[${e}]`}`);_n(Sl.msg,El,{hint:Sl.hint+e})}}}),Cl=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\n\nif (document.respec) {\n document.respec.ready.then(setupVarHighlighter);\n} else {\n setupVarHighlighter();\n}\n\nfunction setupVarHighlighter() {\n document\n .querySelectorAll("var")\n .forEach(varElem => varElem.addEventListener("click", highlightListener));\n}\n\n/**\n * @param {MouseEvent} ev\n */\nfunction highlightListener(ev) {\n ev.stopPropagation();\n const varElem = /** @type {HTMLElement} */ (ev.target);\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\n/**\n * @param {HTMLElement} target\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\n/**\n * @param {HTMLElement} varElem\n */\nfunction highlightVars(varElem) {\n const textContent = norm(varElem.textContent);\n const parent = /** @type {HTMLElement} */ (\n varElem.closest(".algorithm, section")\n );\n if (!parent) return [];\n const highlightColor = getHighlightColor(varElem);\n\n const varsToHighlight = [...parent.querySelectorAll("var")].filter(\n el =>\n norm(el.textContent) === textContent &&\n el.closest(".algorithm, 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\n/**\n * @param {HTMLElement} el\n * @param {string} highlightColor\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\n/**\n * @param {HTMLElement} elem\n * @param {string} highlightColor\n */\nfunction addHighlight(elem, highlightColor) {\n elem.classList.add("respec-hl", highlightColor);\n}\n\n/**\n * Same as `norm` from src/core/utils, but our build process doesn\'t allow\n * imports in runtime scripts, so duplicated here.\n * @param {string} str\n */\nfunction norm(str) {\n return str.trim().replace(/\\s+/g, " ");\n}\n})()'}),Al=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 setupCopyButtons();\n}\n\nfunction panelListener() {\n /** @type {HTMLElement | null} */\n let panel = null;\n /**\n * @param {KeyboardEvent|MouseEvent} event\n */\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 (\n type === "keydown" &&\n /** @type {KeyboardEvent} */ (event).key !== "Enter"\n )\n return;\n\n const action = deriveAction(event);\n\n switch (action) {\n case "show": {\n hidePanel(panel);\n /** @type {HTMLElement | null} */\n const dfn = target.closest("dfn, .index-term");\n if (!dfn?.id) break;\n panel = document.getElementById(`dfn-panel-for-${dfn.id}`);\n if (!panel) break;\n const coords = deriveCoordinates(\n /** @type {MouseEvent|KeyboardEvent} */ (event)\n );\n displayPanel(dfn, panel, coords);\n break;\n }\n case "dock": {\n if (panel) {\n panel.style.left = "";\n panel.style.top = "";\n panel.classList.add("docked");\n }\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 // Copy buttons keep the panel open regardless of docked state.\n if (target.closest(".dfn-panel-copy-btn")) {\n return "none";\n }\n if (hitALink) {\n return target.classList.contains("self-link") ? "hide" : "dock";\n }\n\n const panel = /** @type {HTMLElement} */ (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 | null} */\n const caret = panel.querySelector(".caret");\n if (caret) 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<HTMLElement> */\n const focusableElements = panel.querySelectorAll(\n "a[href], button:not([disabled])"\n );\n // No need to trap focus\n if (!focusableElements.length) return;\n\n // Move focus to first anchor element\n const first = focusableElements.item(0);\n first.focus();\n\n const trapListener = createTrapListener(focusableElements, 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<HTMLElement>} focusableElements\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(focusableElements, panel, dfn) {\n const lastIndex = focusableElements.length - 1;\n /**\n * @param {KeyboardEvent} event\n */\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 let index = [...focusableElements].indexOf(\n /** @type {HTMLElement} */ (document.activeElement)\n );\n index += event.shiftKey ? -1 : +1;\n if (index < 0) {\n index = lastIndex;\n } else if (index > lastIndex) {\n index = 0;\n }\n focusableElements.item(index).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n if (\n event.target instanceof HTMLElement &&\n event.target.closest("a[href]")\n ) {\n hidePanel(panel);\n }\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 | null} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n\nfunction setupCopyButtons() {\n document.body.addEventListener("click", event => {\n // The icon is an SVG, which is an Element but not an HTMLElement.\n const target = event.target;\n const btn =\n target instanceof Element && target.closest(".dfn-panel-copy-btn");\n if (!btn) return;\n const text = btn.querySelector("code")?.textContent;\n if (!text) return;\n navigator.clipboard?.writeText(text).then(\n () => btn.ariaNotify?.("Copied"),\n () => {}\n );\n });\n}\n})()'})}();
546
+ `}};async function Ys(e,t,n,r,o){let i;try{const a=await Vs;if(!a)throw new Error("`respecConfig.github` is not set");const s=r||a.fullName,l=new URL("commits",`${a.apiBase}/${s}/`);e&&l.searchParams.set("from",e),l.searchParams.set("to",t),o&&l.searchParams.set("path",o);const c=await fetch(l.href);if(!c.ok)throw new Error(`Request to ${l} failed with status code ${c.status}`);if(i=await c.json(),!i.length)throw new Error(`No commits between ${e}..${t}.`);i=i.filter(n)}catch(e){const t=`Error loading commits from GitHub. ${e.message}`;throw new Error(t,{cause:e})}return i}const Xs=[Object.freeze({__proto__:null,element:Ks,name:Zs})];var Qs=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){Xs.forEach(e=>{customElements.define(e.name,e.element)});const e=Xs.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 Js=Object.freeze({__proto__:null,name:"core/dfn-contract",run:function(){!function(){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=""}(),function(){const e=document.querySelectorAll("dl.definitions dt:has(dfn[data-dfn-type])");for(const t of e){const e=t.querySelector("dfn[data-dfn-type]").id,n=t.nextElementSibling;n&&!n.dataset.defines&&e&&(n.dataset.defines=`#${e}`)}const t=document.querySelectorAll(".definition:has(dfn[data-dfn-type])");for(const e of t){const t=e.querySelector("dfn[data-dfn-type]");t.id&&!e.dataset.defines&&(e.dataset.defines=`#${t.id}`)}}()}});const el="core/linter-rules/check-charset",tl=cn({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"文档只能包含一个 charset 属性为 utf-8 的 `<meta>` 标签",hint:'将此行添加到文档的 `<head>` 部分—— `<meta charset="utf-8">` 或将 charset 设置为 utf-8(如果尚未设置)。'},cs:{msg:"Dokument smí obsahovat pouze jeden tag `<meta>` s charset nastaveným na 'utf-8'",hint:'Přidejte tento řádek do sekce `<head>` vašeho dokumentu - `<meta charset="utf-8">` nebo nastavte charset na "utf-8", pokud ještě není nastaven.'}});var nl=Object.freeze({__proto__:null,name:el,run:function(e){if(!e.lint?.["check-charset"])return;const t=document.querySelectorAll("meta[charset]"),n=[];for(const e of t)n.push((e.getAttribute("charset")??"").trim().toLowerCase());n.includes("utf-8")&&1===t.length||_n(tl.msg,el,{hint:tl.hint,elements:[...t]})}});const rl="no-dfn-in-abstract",ol=`core/linter-rules/${rl}`,il=cn({en:{msg:e=>`Definition \`${e}\` is in an unnumbered section (e.g. abstract or SotD).`,get hint(){return Rn`Definitions in unnumbered sections (abstract, SotD) are semantically out of place and appear in the terms index without a section number. Move this definition to a numbered section such as "Terminology". See ${"[export|#data-export]"}.`}}}),al=["section#abstract","section#sotd","section.introductory"].join(", ");var sl=Object.freeze({__proto__:null,name:ol,run:function(e){if(!e.lint?.[rl])return;const t=[...document.querySelectorAll("dfn")].filter(e=>e.closest(al));t.forEach(e=>{const t=ln(e.textContent);_n(il.msg(t),ol,{hint:il.hint,elements:[e]})})}});const ll="core/linter-rules/check-punctuation",cl=[".",":","!","?"],ul=cl.map(e=>`"${e}"`).join(", "),dl=cn({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${ul}.`},cs:{msg:"Elementy `p` by měly končit interpunkčním znaménkem.",hint:`Ujistěte se, že elementy \`p\` končí jedním z těchto znaků: ${ul}.`}});var pl=Object.freeze({__proto__:null,name:ll,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${cl.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter(e=>!t.test(e.textContent.trim()));n.length&&_n(dl.msg,ll,{hint:dl.hint,elements:n})}});const hl="core/linter-rules/local-refs-exist",fl=cn({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."},cs:{msg:"V dokumentu byla nalezena nefunkční lokální reference.",hint:"Opravte prosím uvedené odkazy."}});function ml(e){const t=e.getAttribute("href")?.substring(1);if(!t)return;const n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var gl=Object.freeze({__proto__:null,name:hl,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(ml);t.length&&_n(fl.msg,hl,{hint:fl.hint,elements:t})}});const bl="core/linter-rules/no-headingless-sections",yl=cn({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `<div>`."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`."},zh:{msg:"所有章节(section)都必须以 `h2-6` 元素开头。",hint:"将 `h2-6` 添加到有问题的章节或使用 `<div>`。"},cs:{msg:"Všechny sekce musí začínat elementem `h2-6`.",hint:"Přidejte do problematické sekce `h2-6` nebo použijte `<div>`."}});var wl=Object.freeze({__proto__:null,name:bl,run:function(e){if(!e.lint?.["no-headingless-sections"])return;const t=[...document.querySelectorAll("section:not(.head,.introductory,#abstract,#sotd)")].filter(({firstElementChild:e})=>!e||!(e.matches(".header-wrapper")||e instanceof HTMLHeadingElement));t.length&&_n(yl.msg,bl,{hint:yl.hint,elements:t})}});const vl="core/linter-rules/no-unused-vars",kl=cn({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."},cs:{msg:"Proměnná byla definována, ale nikdy nebyla použita.",hint:"Přidejte atribut `data-ignore-unused` k elementu `<var>`."}});var xl=Object.freeze({__proto__:null,name:vl,run:function(e){if(!e.lint?.["no-unused-vars"])return;const t=[],n=e=>!!e.querySelector(":scope > :not(section) ~ .algorithm, :scope > :not(section) .algorithm");for(const e of document.querySelectorAll("section")){if(!n(e))continue;const r=e.querySelectorAll(":scope > :not(section) var");if(!r.length)continue;const o=new Map;for(const e of r){const t=ln(e.textContent),n=o.get(t)||o.set(t,[]).get(t);n?.push(e)}for(const e of o.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&_n(kl.msg,vl,{hint:kl.hint,elements:t})}});const $l="core/linter-rules/privsec-section",El=cn({en:{msg:"Document must have a 'Privacy and/or Security' Considerations section.",hint:"Add a privacy and/or security considerations section. See the [Self-Review Questionnaire](https://w3ctag.github.io/security-questionnaire/)."},cs:{msg:"Dokument musí obsahovat sekci 'Zásady ochrany soukromí a/nebo bezpečnosti'.",hint:"Přidejte sekci o zásadách ochrany soukromí a/nebo bezpečnosti. Viz [Dotazník pro sebehodnocení](https://w3ctag.github.io/security-questionnaire/)."}});var Sl=Object.freeze({__proto__:null,name:$l,run:function(e){var t;e.lint?.["privsec-section"]&&e.isRecTrack&&(t=document,!Array.from(t.querySelectorAll("h2, h3, h4, h5, h6")).some(({textContent:e})=>{const t=/(privacy|security)/im.test(e),n=/(considerations)/im.test(e);return t&&n||t}))&&_n(El.msg,$l,{hint:El.hint})}});const _l="core/linter-rules/no-http-props",Cl=cn({en:{msg:Rn`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:Rn`${"[respecConfig]"} 中不允许使用不安全的URL.`,hint:"请将以下属性更改为 https://:"},cs:{msg:Rn`V ${"[respecConfig]"} nejsou povoleny nezabezpečené URL adresy.`,hint:"Změňte prosím následující vlastnosti na 'https://': "}});var Al=Object.freeze({__proto__:null,name:_l,run:function(e){if(!e.lint?.["no-http-props"])return;if(!parent.location.href.startsWith("http"))return;const t=Object.getOwnPropertyNames(e).filter(t=>t.endsWith("URI")&&e[t]||"prevED"===t).filter(t=>new URL(e[t],parent.location.href).href.startsWith("http://"));if(t.length){const e=an(t,e=>Rn`${`[${e}]`}`);_n(Cl.msg,_l,{hint:Cl.hint+e})}}}),Ll=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\n\nif (document.respec) {\n document.respec.ready.then(setupVarHighlighter);\n} else {\n setupVarHighlighter();\n}\n\nfunction setupVarHighlighter() {\n document\n .querySelectorAll("var")\n .forEach(varElem => varElem.addEventListener("click", highlightListener));\n}\n\n/**\n * @param {MouseEvent} ev\n */\nfunction highlightListener(ev) {\n ev.stopPropagation();\n const varElem = /** @type {HTMLElement} */ (ev.target);\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\n/**\n * @param {HTMLElement} target\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\n/**\n * @param {HTMLElement} varElem\n */\nfunction highlightVars(varElem) {\n const textContent = norm(varElem.textContent);\n const parent = /** @type {HTMLElement} */ (\n varElem.closest(".algorithm, section")\n );\n if (!parent) return [];\n const highlightColor = getHighlightColor(varElem);\n\n const varsToHighlight = [...parent.querySelectorAll("var")].filter(\n el =>\n norm(el.textContent) === textContent &&\n el.closest(".algorithm, 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\n/**\n * @param {HTMLElement} el\n * @param {string} highlightColor\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\n/**\n * @param {HTMLElement} elem\n * @param {string} highlightColor\n */\nfunction addHighlight(elem, highlightColor) {\n elem.classList.add("respec-hl", highlightColor);\n}\n\n/**\n * Same as `norm` from src/core/utils, but our build process doesn\'t allow\n * imports in runtime scripts, so duplicated here.\n * @param {string} str\n */\nfunction norm(str) {\n return str.trim().replace(/\\s+/g, " ");\n}\n})()'}),Rl=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 setupCopyButtons();\n}\n\nfunction panelListener() {\n /** @type {HTMLElement | null} */\n let panel = null;\n /**\n * @param {KeyboardEvent|MouseEvent} event\n */\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 (\n type === "keydown" &&\n /** @type {KeyboardEvent} */ (event).key !== "Enter"\n )\n return;\n\n const action = deriveAction(event);\n\n switch (action) {\n case "show": {\n hidePanel(panel);\n /** @type {HTMLElement | null} */\n const dfn = target.closest("dfn, .index-term");\n if (!dfn?.id) break;\n panel = document.getElementById(`dfn-panel-for-${dfn.id}`);\n if (!panel) break;\n const coords = deriveCoordinates(\n /** @type {MouseEvent|KeyboardEvent} */ (event)\n );\n displayPanel(dfn, panel, coords);\n break;\n }\n case "dock": {\n if (panel) {\n panel.style.left = "";\n panel.style.top = "";\n panel.classList.add("docked");\n }\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 // Copy buttons keep the panel open regardless of docked state.\n if (target.closest(".dfn-panel-copy-btn")) {\n return "none";\n }\n if (hitALink) {\n return target.classList.contains("self-link") ? "hide" : "dock";\n }\n\n const panel = /** @type {HTMLElement} */ (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 | null} */\n const caret = panel.querySelector(".caret");\n if (caret) 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<HTMLElement> */\n const focusableElements = panel.querySelectorAll(\n "a[href], button:not([disabled])"\n );\n // No need to trap focus\n if (!focusableElements.length) return;\n\n // Move focus to first anchor element\n const first = focusableElements.item(0);\n first.focus();\n\n const trapListener = createTrapListener(focusableElements, 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<HTMLElement>} focusableElements\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(focusableElements, panel, dfn) {\n const lastIndex = focusableElements.length - 1;\n /**\n * @param {KeyboardEvent} event\n */\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 let index = [...focusableElements].indexOf(\n /** @type {HTMLElement} */ (document.activeElement)\n );\n index += event.shiftKey ? -1 : +1;\n if (index < 0) {\n index = lastIndex;\n } else if (index > lastIndex) {\n index = 0;\n }\n focusableElements.item(index).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n if (\n event.target instanceof HTMLElement &&\n event.target.closest("a[href]")\n ) {\n hidePanel(panel);\n }\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 | null} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n\nfunction setupCopyButtons() {\n document.body.addEventListener("click", event => {\n // The icon is an SVG, which is an Element but not an HTMLElement.\n const target = event.target;\n const btn =\n target instanceof Element && target.closest(".dfn-panel-copy-btn");\n if (!btn) return;\n const text = btn.querySelector("code")?.textContent;\n if (!text) return;\n navigator.clipboard?.writeText(text).then(\n () => btn.ariaNotify?.("Copied"),\n () => {}\n );\n });\n}\n})()'})}();
547
547
  //# sourceMappingURL=respec-aom.js.map