\d*))?/.exec(e).groups,o=1e5;if(+i>o||a&&+a>o)throw Error(`Quantifier value unsupported in Oniguruma`);if(n=+i,r=a===void 0?+i:a===``?1/0:+a,n>r&&(t=`possessive`,[n,r]=[r,n]),e.endsWith(`?`)){if(t===`possessive`)throw Error(`Unsupported possessive interval quantifier chain with "?"`);t=`lazy`}else t||=`greedy`}else n=+(e[0]===`+`),r=e[0]===`?`?1:1/0,t=e[1]===`+`?`possessive`:e[1]===`?`?`lazy`:`greedy`;return nl(t,n,r,e)}function cl(e){let t=e[1].toLowerCase();return Xc({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function ll(e){let{p:t,neg:n,value:r}=/^\\(?[pP])\{(?\^?)(?[^}]+)/.exec(e).groups;return Xc(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function ul(e){let t={};return e.includes(`i`)&&(t.ignoreCase=!0),e.includes(`m`)&&(t.dotAll=!0),e.includes(`x`)&&(t.extended=!0),Object.keys(t).length?t:null}function dl(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function pl(e,t){let{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!==`0`&&i.length===1||i[0]!==`0`&&+i<=t))return[Wc(n)];let a=[],o=i.match(/^[0-7]+|\d/g);for(let e=0;e127)throw Error(G`Octal encoded byte above 177 unsupported "${n}"`)}else r=Mc(t);a.push(Gc(r,(e===0?`\\`:``)+t))}return a}function ml(e){let t=[],n=new RegExp(_l,`gy`),r;for(;r=n.exec(e);){let e=r[0];if(e[0]===`{`){let r=/^\{(?\d+),(?\d+)\}\??$/.exec(e);if(r){let{min:i,max:a}=r.groups;if(+i>+a&&e.endsWith(`?`)){n.lastIndex--,t.push(sl(e.slice(0,-1)));continue}}}t.push(sl(e))}return t}var hl,gl,_l,vl,yl,bl,xl,Sl=t((()=>{Ic(),hl=G`\[\^?`,gl=`c.? | C(?:-.?)?|${G`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${G`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${G`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${G`o\{[^\}]*\}?`}|${G`\d{1,3}`}`,_l=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,vl=new RegExp(G`
+ \\ (?:
+ ${gl}
+ | [gk]<[^>]*>?
+ | [gk]'[^']*'?
+ | .
+ )
+ | \( (?:
+ \? (?:
+ [:=!>({]
+ | <[=!]
+ | <[^>]*>
+ | '[^']*'
+ | ~\|?
+ | #(?:[^)\\]|\\.?)*
+ | [^:)]*[:)]
+ )?
+ | \*[^\)]*\)?
+ )?
+ | (?:${_l.source})+
+ | ${hl}
+ | .
+`.replace(/\s+/g,``),`gsu`),yl=new RegExp(G`
+ \\ (?:
+ ${gl}
+ | .
+ )
+ | \[:(?:\^?\p{Alpha}+|\^):\]
+ | ${hl}
+ | &&
+ | .
+`.replace(/\s+/g,``),`gsu`),bl=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),xl=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]])}));function Cl(e,t){if(!Array.isArray(e.body))throw Error(`Expected node with body array`);if(e.body.length!==1)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}function wl(e){return Tl.has(e.type)}var Tl,El=t((()=>{Tl=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`])}));function Dl(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=Lc(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case`Alternator`:return Ll();case`Assertion`:return Ol(n);case`Backreference`:return kl(n,a);case`Character`:return Vl(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return Al(n,a,t);case`CharacterClassOpen`:return jl(n,a,t);case`CharacterSet`:return Ml(n,a);case`Directive`:return Gl(n.kind,{flags:n.flags});case`GroupOpen`:return Nl(n,a,t);case`NamedCallout`:return Yl(n.kind,n.tag,n.arguments);case`Quantifier`:return Pl(n,a);case`Subroutine`:return Fl(n,a);default:throw Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=Ql(Kl(r.flags)),s=o.body[0];for(;a.nextIndexc.length)throw Error(`Subroutine uses a group number that's not defined`);e&&(c[e-1].isSubroutined=!0)}else if(u.has(e)){if(u.get(e).length>1)throw Error(G`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(G`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function Ol({kind:e}){return Rl(Pc({"^":`line_start`,$:`line_end`,"\\A":`string_start`,"\\b":`word_boundary`,"\\B":`word_boundary`,"\\G":`search_start`,"\\y":`text_segment_boundary`,"\\Y":`text_segment_boundary`,"\\z":`string_end`,"\\Z":`string_end_newline`}[e],`Unexpected assertion kind "${e}"`),{negate:e===G`\B`||e===G`\Y`})}function kl({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(n,r=!1)=>{let i=t.capturingGroups.length,a=!1;if(n>i){if(t.skipBackrefValidation)a=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`)}return t.hasNumberedRef=!0,zl(r?i+1-n:n,{orphan:a})};if(n){let n=/^(?-?)0*(?[1-9]\d*)$/.exec(r);if(n)return i(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(r))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw Error(`Group name not defined to the left "${e}"`);return zl(r)}return i(+r)}function Al(e,t,n){let{tokens:r,walk:i}=t,a=t.parent,o=a.body.at(-1),s=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!==`CharacterClass`&&o.type!==`CharacterClassRange`&&s&&s.type!==`CharacterClassOpen`&&s.type!==`CharacterClassClose`&&s.type!==`CharacterClassIntersector`){let e=i(a,{...n,isCheckingRangeEnd:!0});if(o.type===`Character`&&e.type===`Character`)return a.body.pop(),Ul(o,e);throw Error(`Invalid character class range`)}return Vl(Mc(`-`))}function jl({negate:e},t,n){let{tokens:r,walk:i}=t,a=[Hl()],o=r[t.nextIndex],s=lu(o);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)a.push(Hl()),t.nextIndex++;else{let e=a.at(-1);e.body.push(i(e,n))}s=lu(r[t.nextIndex],o)}let c=Hl({negate:e});return a.length===1?c.body=a[0].body:(c.kind=`intersection`,c.body=a.map(e=>e.body.length===1?e.body[0]:e)),t.nextIndex++,c}function Ml({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=cu(n);if(Fc.has(r)&&!o?.has(r))e=`posix`,n=r;else return eu(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?Xl(n,{negate:t}):Wl(e,{negate:t})}function Nl(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=tu(e),l=c.type===`AbsenceFunction`,u=au(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&Nc(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=uu(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(Ll()),t.nextIndex++;else{let e=c.body.at(-1),t=s(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(e.body.push(t),(u||n.isInLookbehind)&&!o){let e=`Lookbehind includes a pattern not allowed by Oniguruma`;if(d||n.isInNegLookbehind){if(iu(t)||t.type===`CapturingGroup`)throw Error(e)}else if(iu(t)||au(t)&&t.negate)throw Error(e)}}f=uu(r[t.nextIndex])}return t.nextIndex++,c}function Pl({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!wl(a))throw Error(`Quantifier requires a repeatable token`);let o=Zl(e,t,n,a);return i.body.pop(),o}function Fl({raw:e},t){let{capturingGroups:n,subroutines:r}=t,i=e.slice(3,-1),a=/^(?[-+]?)0*(?[1-9]\d*)$/.exec(i);if(a){let e=+a.groups.num,r=n.length;if(t.hasNumberedRef=!0,i={"":e,"+":r+e,"-":r+1-e}[a.groups.sign],i<1)throw Error(`Invalid subroutine number`)}else i===`0`&&(i=0);let o=$l(i);return r.push(o),o}function Il(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:nu(t?.body)}}function Ll(e){return{type:`Alternative`,body:ru(e?.body)}}function Rl(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function zl(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function Bl(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!ou(n.name))throw Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:`CapturingGroup`,number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:nu(t?.body)}}function Vl(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(n.useLastValid)e=1114111;else throw Error(e>1310719?`Invalid code point out of range "\\x{${t}}"`:`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:`Character`,value:e}}function Hl(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:ru(e?.body)}}function Ul(e,t){if(t.valuen)throw Error(`Invalid reversed quantifier range`);return{type:`Quantifier`,kind:e,min:t,max:n,body:r}}function Ql(e,t){return{type:`Regex`,body:nu(t?.body),flags:e}}function $l(e){return{type:`Subroutine`,ref:e}}function eu(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(cu(e));if(!r){if(n.normalizeUnknownPropertyNames)r=su(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(G`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function tu({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return Il(`repeater`);case`atomic`:return ql({atomic:!0});case`capturing`:return Bl(i,{name:n});case`group`:return ql({flags:e});case`lookahead`:case`lookbehind`:return Jl({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function nu(e){if(e===void 0)e=[Ll()];else if(!Array.isArray(e)||!e.length||!e.every(e=>e.type===`Alternative`))throw Error(`Invalid body; expected array of one or more Alternative nodes`);return e}function ru(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error(`Invalid body; expected array of nodes`);return e}function iu(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function au(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function ou(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function su(e){return e.trim().replace(/[- _]+/g,`_`).replace(/[A-Z][a-z]+(?=[A-Z])/g,`$&_`).replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function cu(e){return e.replace(/[- _]+/g,``).toLowerCase()}function lu(e,t){let n=t;return Pc(e,`Unclosed character class${n?.type===`Character`&&n.value===93&&n.raw===`]`?` (started with "]")`:``}`)}function uu(e){return Pc(e,`Unclosed group`)}var du=t((()=>{Sl(),Ic(),El()}));function fu(e,t,n=null){function r(e,t){for(let n=0;n{Ic()}));function gu(e,t){for(let n=0;n=t&&e[n]++}function _u(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var vu,yu=t((()=>{vu=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`}));function bu(e,t,n,r){let i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,`gsu`),a=[!1],o=0,s=``;for(let t of e.matchAll(i)){let{0:e,groups:{$skip:i}}=t;if(!i&&(!r||r===K.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?K.CHAR_CLASS:K.DEFAULT,negated:a[a.length-1]}):s+=n;continue}e[0]===`[`?(o++,a.push(e[1]===`^`)):e===`]`&&o&&(o--,a.pop()),s+=e}return s}function xu(e,t,n,r){bu(e,t,n,r)}function Su(e,t,n=0,r){if(!new RegExp(t,`su`).test(e))return null;let i=RegExp(`${t}|(?<$skip>\\\\?.)`,`gsu`);i.lastIndex=n;let a=0,o;for(;o=i.exec(e);){let{0:e,groups:{$skip:t}}=o;if(!t&&(!r||r===K.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function Cu(e,t,n){return!!Su(e,t,0,n)}function wu(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,a=1,o;for(;o=n.exec(e);){let[e]=o;if(e===`[`)i++;else if(i)e===`]`&&i--;else if(e===`(`)a++;else if(e===`)`&&(a--,!a)){r=o.index;break}}return e.slice(t,r)}var K,Tu=t((()=>{K=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`})}));function Eu(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let i=[0],a=[],o=0,s=0,c=NaN,l;do{l=!1;let t=0,u=0,d=!1,f;for(Ou.lastIndex=Number.isNaN(c)?0:c+7;f=Ou.exec(e);){let{0:p,index:m,groups:{capturingStart:h,noncapturingStart:g}}=f;if(p===`[`)t++;else if(t)p===`]`&&t--;else if(p===`(?>`&&!d)c=m,d=!0;else if(d&&g)u++;else if(h)d?u++:(o++,i.push(o+s));else if(p===`)`&&d){if(!u){s++;let t=o+s;if(e=`${e.slice(0,c)}(?:(?=(${e.slice(c+3,m)}))<$$${t}>)${e.slice(m+1)}`,l=!0,a.push(t),gu(n,t),r.size){let e=new Map;r.forEach((n,r)=>{e.set(r>=t?r+1:r,n.map(e=>e>=t?e+1:e))}),r=e}break}u--}}}while(l);return n.push(...a),e=bu(e,String.raw`\\(?[1-9]\d*)|<\$\$(?\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>i.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${i[n]}`}return`\\${n}`},K.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}function Du(e){if(!RegExp(`${ku}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(Au.lastIndex=0;o=Au.exec(e);){let{0:s,index:c,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s===`[`)a||(r=c),a++;else if(s===`]`)a?a--:r=null;else if(!a){if(u===`+`&&i&&!i.startsWith(`(`)){if(d)throw Error(`Invalid quantifier "${s}"`);let t=-1;if(/^\{\d+\}$/.test(l))e=_u(e,c+l.length,u,``);else{if(i===`)`||i===`]`){let t=i===`)`?n:r;if(t===null)throw Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,t)}(?>${e.slice(t,c)}${l})${e.slice(c+s.length)}`}else e=`${e.slice(0,c-i.length)}(?>${i}${l})${e.slice(c+s.length)}`;t+=4}Au.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null)}i=s}return{pattern:e}}var Ou,ku,Au,ju=t((()=>{yu(),Tu(),Ou=new RegExp(String.raw`(?${vu})|(?\((?:\?<[^>]+>)?)|\\?.`,`gsu`),ku=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Au=new RegExp(String.raw`
+\\(?: \d+
+ | c[A-Za-z]
+ | [gk]<[^>]+>
+ | [pPu]\{[^\}]+\}
+ | u[A-Fa-f\d]{4}
+ | x[A-Fa-f\d]{2}
+ )
+| \((?: \? (?: [:=!>]
+ | <(?:[=!]|[^>]+>)
+ | [A-Za-z\-]+:
+ | \(DEFINE\)
+ ))?
+| (?${ku})(?[?+]?)(?[?*+\{]?)
+| \\?.
+`.replace(/\s+/g,``),`gsu`)})),Mu=t((()=>{ju()}));function Nu(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(zu,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&Cu(e,q`\(\?\(DEFINE\)`,K.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=Cu(e,q`\\[1-9]`,K.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(Hu.lastIndex=0;f=Hu.exec(e);){let{0:t,groups:{captureName:p,rDepth:m,gRNameOrNum:h,gRDepth:g}}=f;if(t===`[`)u++;else if(u)t===`]`&&u--;else{if(m){if(Pu(m),l)throw Error(Uu);if(o)throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with global recursion`);let t=e.slice(0,f.index),s=e.slice(Hu.lastIndex);if(Cu(s,zu,K.DEFAULT))throw Error(Uu);let c=m-1;e=Fu(t,s,c,!1,n,a,d),i=Ru(i,t,c,a.length,0,d);break}if(h){Pu(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(Uu);break}if(!u)throw Error(q`Recursive \g cannot be used outside the referenced group "${r===`external`?h:q`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=wu(e,p);if(o&&Cu(m,q`${Bu}|\((?!\?)`,K.DEFAULT))throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with recursion of capturing groups`);let _=e.slice(p,f.index),v=m.slice(_.length+t.length),y=a.length,b=g-1,x=Fu(_,v,b,!0,n,a,d);i=Ru(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,Hu.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),Hu.lastIndex),s.set(p,Hu.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),Hu.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function Pu(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e)||(e=+e,e<2||e>100))throw Error(t)}function Fu(e,t,n,r,i,a,o){let s=new Set;r&&xu(e+t,Bu,({groups:{captureName:e}})=>{s.add(e)},K.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${Iu(`(?:${e}`,`forward`,...c)}(?:)${Iu(`${t})`,`backward`,...c)}${t}`}function Iu(e,t,n,r,i,a,o){let s=e=>t===`forward`?e+2:n-e+2-1,c=``;for(let t=0;t[^>]+)>`,({0:e,groups:{captureName:t,unnamed:s,backref:c}})=>{if(c&&r&&!r.has(c))return e;let l=`_$${n}`;if(s||t){let n=o+a.length+1;return a.push(n),Lu(i,n),s?e:`(?<${t}${l}>`}return q`\k<${c}${l}>`},K.DEFAULT)}return c}function Lu(e,t){for(let n=0;n=t&&e[n]++}function Ru(e,t,n,r,i,a){if(e.size&&r){let o=0;xu(t,Vu,()=>o++,K.DEFAULT);let s=a-o+i,c=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,l=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);c.set(l,u)}),c}return e}var q,zu,Bu,Vu,Hu,Uu,Wu=t((()=>{Tu(),q=String.raw,zu=q`\(\?R=(?[^\)]+)\)|${q`\\g<(?[^>&]+)&R=(?[^>]+)>`}`,Bu=q`\(\?<(?![=!])(?[^>]+)>`,Vu=q`${Bu}|(?\()(?!\?)`,Hu=new RegExp(q`${Bu}|${zu}|\(\?|\\?.`,`gsu`),Uu=`Cannot use multiple overlapping recursions`}));function Gu(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function Ku(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function qu(e,t){return Id[e]>=Id[t]}function Ju(e,t){if(e==null)throw Error(t??`Value expected`);return e}function Yu(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!Ld[e.target])throw Error(`Unexpected target "${e.target}"`);let t={accuracy:`default`,avoidSubclass:!1,flags:``,global:!1,hasIndices:!1,lazyCompileLength:1/0,target:`auto`,verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target===`auto`&&(t.target=Z.flagGroups?`ES2025`:Z.unicodeSets?`ES2024`:`ES2018`),t}function Xu(e){if(zd.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=Wd.get(n),a=Hd.get(n),o=Ud.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),a&&t.add(a),[...t]}function Zu(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Qu(e){let t=Y(e);return[t.toLowerCase(),t]}function $u(e,t){return Zu(e,t).map(e=>Qu(e))}function ed(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};td(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:qu(n.bestEffortTarget,`ES2024`),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};fu(e,qd,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};fu(e,Jd,a);let o={groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer};return fu(e,Yd,o),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}function td(e){fu(e,{"*"({node:e,parent:t}){e.parent=t}})}function nd(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function rd(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=ud(n.parent);for(let r of t){if(r===n)break;if(r===e||fd(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function id(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=id(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function ad(e){let t=$l(e);return t.isRecursive=!0,t}function od(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function sd(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function cd(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function ld({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function ud(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function dd(e){let t=e.find(e=>e.kind===`search_start`||hd(e,{negate:!1})||!pd(e));if(!t)return null;if(t.kind===`search_start`)return t;if(t.type===`LookaroundAssertion`)return t.body[0].body[0];if(t.type===`CapturingGroup`||t.type===`Group`){let e=[];for(let n of t.body){let t=dd(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function fd(e,t){let n=ud(e)??[];for(let e of n)if(e===t||fd(e,t))return!0;return!1}function pd({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function md(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function hd(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Cl(e.body[0],{type:`Assertion`,kind:`search_start`})}function gd(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function _d(e,t){let n=Dl(e,{...t,unicodePropertyMap:Vd}).body;return n.length>1||n[0].body.length>1?ql({body:n}):n[0].body[0]}function vd(e,t){return e.negate=t,e}function yd(e,t){return e.parent=t,e}function J(e,t){return td(e),e.parent=t,e}function bd(e,t){let n=Yu(t),r=qu(n.target,`ES2024`),i=qu(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];fu(e,Xd,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,Ju(Zd[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&Ku(f._captureTransfers,e.transferTo,[]).push(t)}),f}function xd(e){return nf.test(e)}function Sd(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=Y(e);if(!xd(t))continue;let o=Xu(t).filter(e=>{let t=e.codePointAt(0);return ti});if(o.length&&(a.push(...o),n))break}return a}function Cd(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(tf.has(e))return tf.get(e);if(e<32||e>126&&e<160||e>262143||t&&Od(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?ef:$d:Qd,a=Y(e);return(i.has(a)?`\\`:``)+a}function wd(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function Ed({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function Dd({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function Od(e){return e>47&&e<58}function kd({type:e,value:t}){return e===`Character`&&t===45}function Ad(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function jd(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)Ku(n,t,{}).transferTo=e;return n}function Md(e){let t=/(?\((?:\?<(?![=!])(?[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function Nd(e,t){let n=Pd(e,t);return n.options?new rf(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Pd(e,t){let n=Yu(t),r=ed(Dl(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Vd}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=bd(r,n),a=Nu(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=Eu(Du(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}var Y,X,Z,Fd,Id,Ld,Rd,zd,Bd,Vd,Hd,Ud,Wd,Gd,Kd,qd,Jd,Yd,Xd,Zd,Qd,$d,ef,tf,nf,rf,af=t((()=>{du(),hu(),Mu(),Wu(),Y=String.fromCodePoint,X=String.raw,Z={},Fd=globalThis.RegExp,Z.flagGroups=(()=>{try{new Fd(`(?i:)`)}catch{return!1}return!0})(),Z.unicodeSets=(()=>{try{new Fd(`[[]]`,`v`)}catch{return!1}return!0})(),Z.bugFlagVLiteralHyphenIsRange=Z.unicodeSets?(()=>{try{new Fd(X`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,Z.bugNestedClassIgnoresNegation=Z.unicodeSets&&new Fd(`[[^a]]`,`v`).test(`a`),Id={ES2025:2025,ES2024:2024,ES2018:2018},Ld={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`},Rd=`[ -\r ]`,zd=new Set([Y(304),Y(305)]),Bd=X`[\p{L}\p{M}\p{N}\p{Pc}]`,Vd=new Map(`C Other
+Cc Control cntrl
+Cf Format
+Cn Unassigned
+Co Private_Use
+Cs Surrogate
+L Letter
+LC Cased_Letter
+Ll Lowercase_Letter
+Lm Modifier_Letter
+Lo Other_Letter
+Lt Titlecase_Letter
+Lu Uppercase_Letter
+M Mark Combining_Mark
+Mc Spacing_Mark
+Me Enclosing_Mark
+Mn Nonspacing_Mark
+N Number
+Nd Decimal_Number digit
+Nl Letter_Number
+No Other_Number
+P Punctuation punct
+Pc Connector_Punctuation
+Pd Dash_Punctuation
+Pe Close_Punctuation
+Pf Final_Punctuation
+Pi Initial_Punctuation
+Po Other_Punctuation
+Ps Open_Punctuation
+S Symbol
+Sc Currency_Symbol
+Sk Modifier_Symbol
+Sm Math_Symbol
+So Other_Symbol
+Z Separator
+Zl Line_Separator
+Zp Paragraph_Separator
+Zs Space_Separator
+ASCII
+ASCII_Hex_Digit AHex
+Alphabetic Alpha
+Any
+Assigned
+Bidi_Control Bidi_C
+Bidi_Mirrored Bidi_M
+Case_Ignorable CI
+Cased
+Changes_When_Casefolded CWCF
+Changes_When_Casemapped CWCM
+Changes_When_Lowercased CWL
+Changes_When_NFKC_Casefolded CWKCF
+Changes_When_Titlecased CWT
+Changes_When_Uppercased CWU
+Dash
+Default_Ignorable_Code_Point DI
+Deprecated Dep
+Diacritic Dia
+Emoji
+Emoji_Component EComp
+Emoji_Modifier EMod
+Emoji_Modifier_Base EBase
+Emoji_Presentation EPres
+Extended_Pictographic ExtPict
+Extender Ext
+Grapheme_Base Gr_Base
+Grapheme_Extend Gr_Ext
+Hex_Digit Hex
+IDS_Binary_Operator IDSB
+IDS_Trinary_Operator IDST
+ID_Continue IDC
+ID_Start IDS
+Ideographic Ideo
+Join_Control Join_C
+Logical_Order_Exception LOE
+Lowercase Lower
+Math
+Noncharacter_Code_Point NChar
+Pattern_Syntax Pat_Syn
+Pattern_White_Space Pat_WS
+Quotation_Mark QMark
+Radical
+Regional_Indicator RI
+Sentence_Terminal STerm
+Soft_Dotted SD
+Terminal_Punctuation Term
+Unified_Ideograph UIdeo
+Uppercase Upper
+Variation_Selector VS
+White_Space space
+XID_Continue XIDC
+XID_Start XIDS`.split(/\s/).map(e=>[cu(e),e])),Hd=new Map([[`s`,Y(383)],[Y(383),`s`]]),Ud=new Map([[Y(223),Y(7838)],[Y(107),Y(8490)],[Y(229),Y(8491)],[Y(969),Y(8486)]]),Wd=new Map([Qu(453),Qu(456),Qu(459),Qu(498),...$u(8072,8079),...$u(8088,8095),...$u(8104,8111),Qu(8124),Qu(8140),Qu(8188)]),Gd=new Map([[`alnum`,X`[\p{Alpha}\p{Nd}]`],[`alpha`,X`\p{Alpha}`],[`ascii`,X`\p{ASCII}`],[`blank`,X`[\p{Zs}\t]`],[`cntrl`,X`\p{Cc}`],[`digit`,X`\p{Nd}`],[`graph`,X`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,X`\p{Lower}`],[`print`,X`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,X`[\p{P}\p{S}]`],[`space`,X`\p{space}`],[`upper`,X`\p{Upper}`],[`word`,X`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,X`\p{AHex}`]]),Kd=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]),qd={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=ql();e.body[0].body.push(Jl({negate:!0,body:r}),eu(`Any`));let i=ql();i.body[0].body.push(Zl(`greedy`,0,1/0,e)),n(J(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e\r\n|${i?X`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(yd(eu(`AHex`,{negate:l}),t));else if(c===`newline`)n(J(_d(l?`[^
+]`:`(?>\r
+?|[
+\v\f
\u2028\u2029])`),t));else if(c===`posix`){if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${Y(e.codePointAt(0)-1)}${Y(e.codePointAt(2)+1)}-\u{10FFFF}`),n(J(_d(`[${e}]`),t))}else n(J(vd(_d(Gd.get(u)),l),t))}else if(c===`property`)Vd.has(cu(u))||(e.key=`sc`);else if(c===`space`)n(yd(eu(`space`,{negate:l}),t));else if(c===`word`)n(J(vd(_d(Bd),l),t));else throw Error(`Unexpected character set kind "${c}"`)}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`){if(!c.enable&&!c.disable)r();else{let e=ql({flags:c});e.body[0].body=o(),i(J(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&Cl(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(X`Uses "\K" in a way that's unsupported`);let o=Jl({behind:!0});o.body[0].body=a(),i(J(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(J(Jl({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=ql();t.body[0].body.push(e.body),e.body=J(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=dd(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(X`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!gd(n)&&(n=sd(n,t),e.ref=n)}},Jd={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=yd(ad(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&Ku(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;te.type===`Group`&&!!e.flags)),t=e?Gu(r.globalFlags,e):r.globalFlags;nd(t,r.currentFlags)||(l=ql({flags:ld(t)}),l.body[0].body.push(c))}n(J(l,t),{traverse:!s})}},Yd={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>rd(t,e));i.length?i.length>1?n(J(ql({atomic:!0,body:i.reverse().map(e=>Ll({body:[zl(e.number)]}))}),t)):e.ref=i[0].number:n(J(Jl({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;ts.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=Y(e),r=Cd(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&xd(n)){let e=Xu(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);Z.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(kd)&&(o=[Vl(45),...o.filter(e=>!kd(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||Z.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=ql(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=Ll({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(Z.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=Cd(n,i),o=Cd(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&wd(Sd(e)).forEach(e=>{s.add(Array.isArray(e)?`${Cd(e[0],i)}-${Cd(e[1],i)}`:Cd(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:X`[^\n]`;if(e===`digit`)return t?X`\D`:X`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Kd.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?X`\P`:X`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?X`\W`:X`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?`i`:``)+(e.dotAll?`s`:``)+(e.sticky?`y`:``)},Group({atomic:e,body:t,flags:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=Gu(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${Td(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+Ed(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:X`\g<${t}&R=${r}>`}},Qd=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),$d=new Set([`-`,`\\`,`]`,`^`,`[`]),ef=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),tf=new Map([[9,X`\t`],[10,X`\n`],[11,X`\v`],[12,X`\f`],[13,X`\r`],[8232,X`\u2028`],[8233,X`\u2029`],[65279,X`\uFEFF`]]),nf=/^\p{Cased}$/u,rf=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=jd(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(Ad(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;eof(e,{target:t.target}),{createScanner(e){return new Ac(e,t)},createString(e){return{content:e}}}}var cf=t((()=>{jc(),af()})),lf=t((()=>{cf()})),uf=t((()=>{lf()})),df=n({default:()=>pf}),ff,pf,mf=t((()=>{ff=Object.freeze(JSON.parse('{"displayName":"Markdown","name":"markdown","patterns":[{"include":"#frontMatter"},{"include":"#block"}],"repository":{"ampersand":{"match":"&(?!([0-9A-Za-z]+|#[0-9]+|#x\\\\h+);)","name":"meta.other.valid-ampersand.markdown"},"block":{"patterns":[{"include":"#separator"},{"include":"#heading"},{"include":"#blockquote"},{"include":"#lists"},{"include":"#fenced_code_block"},{"include":"#raw_block"},{"include":"#link-def"},{"include":"#html"},{"include":"#table"},{"include":"#paragraph"}]},"blockquote":{"begin":"(^|\\\\G) {0,3}(>) ?","captures":{"2":{"name":"punctuation.definition.quote.begin.markdown"}},"name":"markup.quote.markdown","patterns":[{"include":"#block"}],"while":"(^|\\\\G)\\\\s*(>) ?"},"bold":{"begin":"(?(\\\\*\\\\*(?=\\\\w)|(?]*+>|(?`+)([^`]|(?!(?(?!`))`)*+\\\\k|\\\\\\\\[-\\\\]!#(-+.>\\\\[\\\\\\\\_`{}]?+|\\\\[((?[^]\\\\[\\\\\\\\]|\\\\\\\\.|\\\\[\\\\g*+])*+](( ?\\\\[[^]]*+])|(\\\\([\\\\t ]*+(.*?)>?[\\\\t ]*+((?[\\"\'])(.*?)\\\\k)?\\\\))))|(?!(?<=\\\\S)\\\\k).)++(?<=\\\\S)(?=__\\\\b|\\\\*\\\\*)\\\\k)","captures":{"1":{"name":"punctuation.definition.bold.markdown"}},"end":"(?<=\\\\S)(\\\\1)","name":"markup.bold.markdown","patterns":[{"applyEndPatternLast":1,"begin":"(?=<[^>]*?>)","end":"(?<=>)","patterns":[{"include":"text.html.derivative"}]},{"include":"#escape"},{"include":"#ampersand"},{"include":"#bracket"},{"include":"#raw"},{"include":"#bold"},{"include":"#italic"},{"include":"#image-inline"},{"include":"#link-inline"},{"include":"#link-inet"},{"include":"#link-email"},{"include":"#image-ref"},{"include":"#link-ref-literal"},{"include":"#link-ref"},{"include":"#link-ref-shortcut"},{"include":"#strikethrough"}]},"bracket":{"match":"<(?![!$/?A-Za-z])","name":"meta.other.valid-bracket.markdown"},"escape":{"match":"\\\\\\\\[-\\\\]!#(-+.>\\\\[\\\\\\\\_`{}]","name":"constant.character.escape.markdown"},"fenced_code_block":{"patterns":[{"include":"#fenced_code_block_css"},{"include":"#fenced_code_block_basic"},{"include":"#fenced_code_block_ini"},{"include":"#fenced_code_block_java"},{"include":"#fenced_code_block_lua"},{"include":"#fenced_code_block_makefile"},{"include":"#fenced_code_block_perl"},{"include":"#fenced_code_block_r"},{"include":"#fenced_code_block_ruby"},{"include":"#fenced_code_block_php"},{"include":"#fenced_code_block_sql"},{"include":"#fenced_code_block_vs_net"},{"include":"#fenced_code_block_xml"},{"include":"#fenced_code_block_xsl"},{"include":"#fenced_code_block_yaml"},{"include":"#fenced_code_block_dosbatch"},{"include":"#fenced_code_block_clojure"},{"include":"#fenced_code_block_coffee"},{"include":"#fenced_code_block_c"},{"include":"#fenced_code_block_cpp"},{"include":"#fenced_code_block_diff"},{"include":"#fenced_code_block_dockerfile"},{"include":"#fenced_code_block_git_commit"},{"include":"#fenced_code_block_git_rebase"},{"include":"#fenced_code_block_go"},{"include":"#fenced_code_block_groovy"},{"include":"#fenced_code_block_pug"},{"include":"#fenced_code_block_ignore"},{"include":"#fenced_code_block_js"},{"include":"#fenced_code_block_js_regexp"},{"include":"#fenced_code_block_json"},{"include":"#fenced_code_block_jsonc"},{"include":"#fenced_code_block_jsonl"},{"include":"#fenced_code_block_less"},{"include":"#fenced_code_block_objc"},{"include":"#fenced_code_block_swift"},{"include":"#fenced_code_block_scss"},{"include":"#fenced_code_block_perl6"},{"include":"#fenced_code_block_powershell"},{"include":"#fenced_code_block_python"},{"include":"#fenced_code_block_julia"},{"include":"#fenced_code_block_regexp_python"},{"include":"#fenced_code_block_rust"},{"include":"#fenced_code_block_scala"},{"include":"#fenced_code_block_shell"},{"include":"#fenced_code_block_ts"},{"include":"#fenced_code_block_tsx"},{"include":"#fenced_code_block_csharp"},{"include":"#fenced_code_block_fsharp"},{"include":"#fenced_code_block_dart"},{"include":"#fenced_code_block_handlebars"},{"include":"#fenced_code_block_markdown"},{"include":"#fenced_code_block_log"},{"include":"#fenced_code_block_erlang"},{"include":"#fenced_code_block_elixir"},{"include":"#fenced_code_block_latex"},{"include":"#fenced_code_block_bibtex"},{"include":"#fenced_code_block_twig"},{"include":"#fenced_code_block_yang"},{"include":"#fenced_code_block_abap"},{"include":"#fenced_code_block_restructuredtext"},{"include":"#fenced_code_block_unknown"}]},"fenced_code_block_abap":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(abap)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.abap","patterns":[{"include":"source.abap"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_basic":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(html?|shtml|xhtml|inc|tmpl|tpl)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.html","patterns":[{"include":"text.html.basic"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_bibtex":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(bibtex)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.bibtex","patterns":[{"include":"text.bibtex"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_c":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:([ch])((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.c","patterns":[{"include":"source.c"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_clojure":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(cl(?:js??|ojure))((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.clojure","patterns":[{"include":"source.clojure"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_coffee":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(coffee|Cakefile|coffee.erb)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.coffee","patterns":[{"include":"source.coffee"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_cpp":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(c(?:pp|\\\\+\\\\+|xx))((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.cpp source.cpp","patterns":[{"include":"source.cpp"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_csharp":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(c(?:s|sharp|#))((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.csharp","patterns":[{"include":"source.cs"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_css":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(css(?:|.erb))((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.css","patterns":[{"include":"source.css"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_dart":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(dart)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.dart","patterns":[{"include":"source.dart"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_diff":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(patch|diff|rej)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.diff","patterns":[{"include":"source.diff"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_dockerfile":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:([Dd]ockerfile)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.dockerfile","patterns":[{"include":"source.dockerfile"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_dosbatch":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(bat(?:|ch))((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.dosbatch","patterns":[{"include":"source.batchfile"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_elixir":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(elixir)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.elixir","patterns":[{"include":"source.elixir"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_erlang":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(erlang)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.erlang","patterns":[{"include":"source.erlang"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_fsharp":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(f(?:s|sharp|#))((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.fsharp","patterns":[{"include":"source.fsharp"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_git_commit":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:((?:COMMIT_EDIT|MERGE_)MSG)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.git_commit","patterns":[{"include":"text.git-commit"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_git_rebase":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(git-rebase-todo)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.git_rebase","patterns":[{"include":"text.git-rebase"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_go":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(go(?:|lang))((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.go","patterns":[{"include":"source.go"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_groovy":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(g(?:roovy|vy))((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.groovy","patterns":[{"include":"source.groovy"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_handlebars":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(h(?:andlebars|bs))((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.handlebars","patterns":[{"include":"text.html.handlebars"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_ignore":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:((?:git|)ignore)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.ignore","patterns":[{"include":"source.ignore"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_ini":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(ini|conf)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.ini","patterns":[{"include":"source.ini"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_java":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(java|bsh)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.java","patterns":[{"include":"source.java"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_js":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(jsx??|javascript|es6|mjs|cjs|dataviewjs|\\\\{\\\\.js.+?})((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.javascript","patterns":[{"include":"source.js"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_js_regexp":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(regexp)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.js_regexp","patterns":[{"include":"source.js.regexp"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_json":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(json5??|sublime-settings|sublime-menu|sublime-keymap|sublime-mousemap|sublime-theme|sublime-build|sublime-project|sublime-completions)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.json","patterns":[{"include":"source.json"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_jsonc":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(jsonc)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.jsonc","patterns":[{"include":"source.json.comments"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_jsonl":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(jsonl(?:|ines))((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.jsonl","patterns":[{"include":"source.json.lines"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_julia":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(julia|\\\\{\\\\.julia.+?})((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.julia","patterns":[{"include":"source.julia"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_latex":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:((?:la|)tex)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.latex","patterns":[{"include":"text.tex.latex"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_less":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(less)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.less","patterns":[{"include":"source.css.less"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_log":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(log)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.log","patterns":[{"include":"text.log"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_lua":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(lua)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.lua","patterns":[{"include":"source.lua"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_makefile":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:((?:[Mm]|GNUm|OCamlM)akefile)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.makefile","patterns":[{"include":"source.makefile"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_markdown":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(m(?:arkdown|d))((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.markdown","patterns":[{"include":"text.html.markdown"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_objc":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(objectivec|objective-c|mm|objc|obj-c|[hm])((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.objc","patterns":[{"include":"source.objc"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_perl":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(perl|pl|pm|pod|t|PL|psgi|vcl)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.perl","patterns":[{"include":"source.perl"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_perl6":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(perl6|p6|pl6|pm6|nqp)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.perl6","patterns":[{"include":"source.perl.6"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_php":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(php3??|php4|php5|phpt|phtml|aw|ctp)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.php","patterns":[{"include":"text.html.basic"},{"include":"source.php"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_powershell":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(p(?:owershell|s1|sm1|sd1|wsh))((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.powershell","patterns":[{"include":"source.powershell"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_pug":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(jade|pug)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.pug","patterns":[{"include":"text.pug"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_python":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(python|py3??|rpy|pyw|cpy|SConstruct|Sconstruct|sconstruct|SConscript|gypi??|\\\\{\\\\.python.+?})((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.python","patterns":[{"include":"source.python"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_r":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:([RSrs]|Rprofile|\\\\{\\\\.r.+?})((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.r","patterns":[{"include":"source.r"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_regexp_python":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(re)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.regexp_python","patterns":[{"include":"source.regexp.python"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_restructuredtext":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(r(?:estructuredtext|st))((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.restructuredtext","patterns":[{"include":"source.rst"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_ruby":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(ruby|rbx??|rjs|Rakefile|rake|cgi|fcgi|gemspec|irbrc|Capfile|ru|prawn|Cheffile|Gemfile|Guardfile|Hobofile|Vagrantfile|Appraisals|Rantfile|Berksfile|Berksfile.lock|Thorfile|Puppetfile)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.ruby","patterns":[{"include":"source.ruby"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_rust":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(rust|rs|\\\\{\\\\.rust.+?})((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.rust","patterns":[{"include":"source.rust"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_scala":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(s(?:cala|bt))((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.scala","patterns":[{"include":"source.scala"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_scss":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(scss)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.scss","patterns":[{"include":"source.css.scss"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_shell":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(shell|sh|bash|zsh|bashrc|bash_profile|bash_login|profile|bash_logout|.textmate_init|\\\\{\\\\.bash.+?})((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.shellscript","patterns":[{"include":"source.shell"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_sql":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(sql|ddl|dml)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.sql","patterns":[{"include":"source.sql"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_swift":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(swift)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.swift","patterns":[{"include":"source.swift"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_ts":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(t(?:ypescript|s))((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.typescript","patterns":[{"include":"source.ts"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_tsx":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(tsx)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.typescriptreact","patterns":[{"include":"source.tsx"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_twig":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(twig)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.twig","patterns":[{"include":"source.twig"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_unknown":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?=([^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown"},"fenced_code_block_vs_net":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(vb)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.vs_net","patterns":[{"include":"source.asp.vb.net"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_xml":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(xml|xsd|tld|jsp|pt|cpt|dtml|rss|opml)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.xml","patterns":[{"include":"text.xml"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_xsl":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(xslt??)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.xsl","patterns":[{"include":"text.xml.xsl"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_yaml":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(ya?ml)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.yaml","patterns":[{"include":"source.yaml"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"fenced_code_block_yang":{"begin":"(^|\\\\G)(\\\\s*)(`{3,}|~{3,})\\\\s*(?i:(yang)((\\\\s+|[,:?{])[^`]*)?$)","beginCaptures":{"3":{"name":"punctuation.definition.markdown"},"4":{"name":"fenced_code.block.language.markdown"},"5":{"name":"fenced_code.block.language.attributes.markdown"}},"end":"(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$","endCaptures":{"3":{"name":"punctuation.definition.markdown"}},"name":"markup.fenced_code.block.markdown","patterns":[{"begin":"(^|\\\\G)(\\\\s*)(.*)","contentName":"meta.embedded.block.yang","patterns":[{"include":"source.yang"}],"while":"(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)"}]},"frontMatter":{"applyEndPatternLast":1,"begin":"\\\\A(?=(-{3,}))","end":"^(?: {0,3}\\\\1-*[\\\\t ]*|[\\\\t ]*\\\\.{3})$","endCaptures":{"0":{"name":"punctuation.definition.end.frontmatter"}},"patterns":[{"begin":"\\\\A(-{3,})(.*)$","beginCaptures":{"1":{"name":"punctuation.definition.begin.frontmatter"},"2":{"name":"comment.frontmatter"}},"contentName":"meta.embedded.block.frontmatter","patterns":[{"include":"source.yaml"}],"while":"^(?!(?: {0,3}\\\\1-*[\\\\t ]*|[\\\\t ]*\\\\.{3})$)"}]},"heading":{"captures":{"1":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.heading.markdown"},"2":{"name":"entity.name.section.markdown","patterns":[{"include":"#inline"},{"include":"text.html.derivative"}]},"3":{"name":"punctuation.definition.heading.markdown"}},"match":"(#{6})\\\\s+(.*?)(?:\\\\s+(#+))?\\\\s*$","name":"heading.6.markdown"},{"captures":{"1":{"name":"punctuation.definition.heading.markdown"},"2":{"name":"entity.name.section.markdown","patterns":[{"include":"#inline"},{"include":"text.html.derivative"}]},"3":{"name":"punctuation.definition.heading.markdown"}},"match":"(#{5})\\\\s+(.*?)(?:\\\\s+(#+))?\\\\s*$","name":"heading.5.markdown"},{"captures":{"1":{"name":"punctuation.definition.heading.markdown"},"2":{"name":"entity.name.section.markdown","patterns":[{"include":"#inline"},{"include":"text.html.derivative"}]},"3":{"name":"punctuation.definition.heading.markdown"}},"match":"(#{4})\\\\s+(.*?)(?:\\\\s+(#+))?\\\\s*$","name":"heading.4.markdown"},{"captures":{"1":{"name":"punctuation.definition.heading.markdown"},"2":{"name":"entity.name.section.markdown","patterns":[{"include":"#inline"},{"include":"text.html.derivative"}]},"3":{"name":"punctuation.definition.heading.markdown"}},"match":"(#{3})\\\\s+(.*?)(?:\\\\s+(#+))?\\\\s*$","name":"heading.3.markdown"},{"captures":{"1":{"name":"punctuation.definition.heading.markdown"},"2":{"name":"entity.name.section.markdown","patterns":[{"include":"#inline"},{"include":"text.html.derivative"}]},"3":{"name":"punctuation.definition.heading.markdown"}},"match":"(#{2})\\\\s+(.*?)(?:\\\\s+(#+))?\\\\s*$","name":"heading.2.markdown"},{"captures":{"1":{"name":"punctuation.definition.heading.markdown"},"2":{"name":"entity.name.section.markdown","patterns":[{"include":"#inline"},{"include":"text.html.derivative"}]},"3":{"name":"punctuation.definition.heading.markdown"}},"match":"(#{1})\\\\s+(.*?)(?:\\\\s+(#+))?\\\\s*$","name":"heading.1.markdown"}]}},"match":"(?:^|\\\\G) {0,3}(#{1,6}\\\\s+(.*?)(\\\\s+#{1,6})?\\\\s*)$","name":"markup.heading.markdown"},"heading-setext":{"patterns":[{"match":"^(={3,})(?=[\\\\t ]*$\\\\n?)","name":"markup.heading.setext.1.markdown"},{"match":"^(-{3,})(?=[\\\\t ]*$\\\\n?)","name":"markup.heading.setext.2.markdown"}]},"html":{"patterns":[{"begin":"(^|\\\\G)\\\\s*()","name":"comment.block.html"},{"begin":"(?i)(^|\\\\G)\\\\s*(?=<(script|style|pre)(\\\\s|$|>)(?!.*?(script|style|pre)>))","end":"(?i)(.*)(()(script|style|pre)(>))","endCaptures":{"1":{"patterns":[{"include":"text.html.derivative"}]},"2":{"name":"meta.tag.structure.$4.end.html"},"3":{"name":"punctuation.definition.tag.begin.html"},"4":{"name":"entity.name.tag.html"},"5":{"name":"punctuation.definition.tag.end.html"}},"patterns":[{"begin":"(\\\\s*|$)","patterns":[{"include":"text.html.derivative"}],"while":"(?i)^(?!.*(script|style|pre)>)"}]},{"begin":"(?i)(^|\\\\G)\\\\s*(?=?[A-Za-z]+[^\\\\&/;gt\\\\s]*(\\\\s|$|/?>))","patterns":[{"include":"text.html.derivative"}],"while":"^(?!\\\\s*$)"},{"begin":"(^|\\\\G)\\\\s*(?=(<(?:[-0-9A-Za-z](/?>|\\\\s.*?>)|/[-0-9A-Za-z]>))\\\\s*$)","patterns":[{"include":"text.html.derivative"}],"while":"^(?!\\\\s*$)"}]},"image-inline":{"captures":{"1":{"name":"punctuation.definition.link.description.begin.markdown"},"2":{"name":"string.other.link.description.markdown"},"4":{"name":"punctuation.definition.link.description.end.markdown"},"5":{"name":"punctuation.definition.metadata.markdown"},"7":{"name":"punctuation.definition.link.markdown"},"8":{"name":"markup.underline.link.image.markdown"},"9":{"name":"punctuation.definition.link.markdown"},"10":{"name":"markup.underline.link.image.markdown"},"12":{"name":"string.other.link.description.title.markdown"},"13":{"name":"punctuation.definition.string.begin.markdown"},"14":{"name":"punctuation.definition.string.end.markdown"},"15":{"name":"string.other.link.description.title.markdown"},"16":{"name":"punctuation.definition.string.begin.markdown"},"17":{"name":"punctuation.definition.string.end.markdown"},"18":{"name":"string.other.link.description.title.markdown"},"19":{"name":"punctuation.definition.string.begin.markdown"},"20":{"name":"punctuation.definition.string.end.markdown"},"21":{"name":"punctuation.definition.metadata.markdown"}},"match":"(!\\\\[)((?[^]\\\\[\\\\\\\\]|\\\\\\\\.|\\\\[\\\\g*+])*+)(])(\\\\()[\\\\t ]*((<)((?:\\\\\\\\[<>]|[^\\\\n<>])*)(>)|((?(?>[^()\\\\s]+)|\\\\(\\\\g*\\\\))*))[\\\\t ]*(?:((\\\\().+?(\\\\)))|((\\").+?(\\"))|((\').+?(\')))?\\\\s*(\\\\))","name":"meta.image.inline.markdown"},"image-ref":{"captures":{"1":{"name":"punctuation.definition.link.description.begin.markdown"},"2":{"name":"string.other.link.description.markdown"},"4":{"name":"punctuation.definition.link.description.end.markdown"},"5":{"name":"punctuation.definition.constant.markdown"},"6":{"name":"constant.other.reference.link.markdown"},"7":{"name":"punctuation.definition.constant.markdown"}},"match":"(!\\\\[)((?[^]\\\\[\\\\\\\\]|\\\\\\\\.|\\\\[\\\\g*+])*+)(]) ?(\\\\[)(.*?)(])","name":"meta.image.reference.markdown"},"inline":{"patterns":[{"include":"#ampersand"},{"include":"#bracket"},{"include":"#bold"},{"include":"#italic"},{"include":"#raw"},{"include":"#strikethrough"},{"include":"#escape"},{"include":"#image-inline"},{"include":"#image-ref"},{"include":"#link-email"},{"include":"#link-inet"},{"include":"#link-inline"},{"include":"#link-ref"},{"include":"#link-ref-literal"},{"include":"#link-ref-shortcut"}]},"italic":{"begin":"(?(\\\\*(?=\\\\w)|(?]*+>|(?`+)([^`]|(?!(?(?!`))`)*+\\\\k|\\\\\\\\[-\\\\]!#(-+.>\\\\[\\\\\\\\_`{}]?+|\\\\[((?[^]\\\\[\\\\\\\\]|\\\\\\\\.|\\\\[\\\\g*+])*+](( ?\\\\[[^]]*+])|(\\\\([\\\\t ]*+(.*?)>?[\\\\t ]*+((?[\\"\'])(.*?)\\\\k)?\\\\))))|\\\\k\\\\k|(?!(?<=\\\\S)\\\\k).)++(?<=\\\\S)(?=_\\\\b|\\\\*)\\\\k)","captures":{"1":{"name":"punctuation.definition.italic.markdown"}},"end":"(?<=\\\\S)(\\\\1)((?!\\\\1)|(?=\\\\1\\\\1))","name":"markup.italic.markdown","patterns":[{"applyEndPatternLast":1,"begin":"(?=<[^>]*?>)","end":"(?<=>)","patterns":[{"include":"text.html.derivative"}]},{"include":"#escape"},{"include":"#ampersand"},{"include":"#bracket"},{"include":"#raw"},{"include":"#bold"},{"include":"#image-inline"},{"include":"#link-inline"},{"include":"#link-inet"},{"include":"#link-email"},{"include":"#image-ref"},{"include":"#link-ref-literal"},{"include":"#link-ref"},{"include":"#link-ref-shortcut"},{"include":"#strikethrough"}]},"link-def":{"captures":{"1":{"name":"punctuation.definition.constant.markdown"},"2":{"name":"constant.other.reference.link.markdown"},"3":{"name":"punctuation.definition.constant.markdown"},"4":{"name":"punctuation.separator.key-value.markdown"},"5":{"name":"punctuation.definition.link.markdown"},"6":{"name":"markup.underline.link.markdown"},"7":{"name":"punctuation.definition.link.markdown"},"8":{"name":"markup.underline.link.markdown"},"9":{"name":"string.other.link.description.title.markdown"},"10":{"name":"punctuation.definition.string.begin.markdown"},"11":{"name":"punctuation.definition.string.end.markdown"},"12":{"name":"string.other.link.description.title.markdown"},"13":{"name":"punctuation.definition.string.begin.markdown"},"14":{"name":"punctuation.definition.string.end.markdown"},"15":{"name":"string.other.link.description.title.markdown"},"16":{"name":"punctuation.definition.string.begin.markdown"},"17":{"name":"punctuation.definition.string.end.markdown"}},"match":"\\\\s*(\\\\[)([^]]+?)(])(:)[\\\\t ]*(?:(<)((?:\\\\\\\\[<>]|[^\\\\n<>])*)(>)|(\\\\S+?))[\\\\t ]*(?:((\\\\().+?(\\\\)))|((\\").+?(\\"))|((\').+?(\')))?\\\\s*$","name":"meta.link.reference.def.markdown"},"link-email":{"captures":{"1":{"name":"punctuation.definition.link.markdown"},"2":{"name":"markup.underline.link.markdown"},"4":{"name":"punctuation.definition.link.markdown"}},"match":"(<)((?:mailto:)?[!#-\'*+\\\\--9=?A-Z^-~]+@[-0-9A-Za-z]+(?:\\\\.[-0-9A-Za-z]+)*)(>)","name":"meta.link.email.lt-gt.markdown"},"link-inet":{"captures":{"1":{"name":"punctuation.definition.link.markdown"},"2":{"name":"markup.underline.link.markdown"},"3":{"name":"punctuation.definition.link.markdown"}},"match":"(<)((?:https?|ftp)://.*?)(>)","name":"meta.link.inet.markdown"},"link-inline":{"captures":{"1":{"name":"punctuation.definition.link.title.begin.markdown"},"2":{"name":"string.other.link.title.markdown","patterns":[{"include":"#raw"},{"include":"#bold"},{"include":"#italic"},{"include":"#strikethrough"},{"include":"#image-inline"}]},"4":{"name":"punctuation.definition.link.title.end.markdown"},"5":{"name":"punctuation.definition.metadata.markdown"},"7":{"name":"punctuation.definition.link.markdown"},"8":{"name":"markup.underline.link.markdown"},"9":{"name":"punctuation.definition.link.markdown"},"10":{"name":"markup.underline.link.markdown"},"12":{"name":"string.other.link.description.title.markdown"},"13":{"name":"punctuation.definition.string.begin.markdown"},"14":{"name":"punctuation.definition.string.end.markdown"},"15":{"name":"string.other.link.description.title.markdown"},"16":{"name":"punctuation.definition.string.begin.markdown"},"17":{"name":"punctuation.definition.string.end.markdown"},"18":{"name":"string.other.link.description.title.markdown"},"19":{"name":"punctuation.definition.string.begin.markdown"},"20":{"name":"punctuation.definition.string.end.markdown"},"21":{"name":"punctuation.definition.metadata.markdown"}},"match":"(\\\\[)((?[^]\\\\[\\\\\\\\]|\\\\\\\\.|\\\\[\\\\g*+])*+)(])(\\\\()[\\\\t ]*((<)((?:\\\\\\\\[<>]|[^\\\\n<>])*)(>)|((?(?>[^()\\\\s]+)|\\\\(\\\\g*\\\\))*))[\\\\t ]*(?:((\\\\()[^()]*(\\\\)))|((\\")[^\\"]*(\\"))|((\')[^\']*(\')))?\\\\s*(\\\\))","name":"meta.link.inline.markdown"},"link-ref":{"captures":{"1":{"name":"punctuation.definition.link.title.begin.markdown"},"2":{"name":"string.other.link.title.markdown","patterns":[{"include":"#raw"},{"include":"#bold"},{"include":"#italic"},{"include":"#strikethrough"},{"include":"#image-inline"}]},"4":{"name":"punctuation.definition.link.title.end.markdown"},"5":{"name":"punctuation.definition.constant.begin.markdown"},"6":{"name":"constant.other.reference.link.markdown"},"7":{"name":"punctuation.definition.constant.end.markdown"}},"match":"(?[^]\\\\[\\\\\\\\]|\\\\\\\\.|\\\\[\\\\g*+])*+)(])(\\\\[)([^]]*+)(])","name":"meta.link.reference.markdown"},"link-ref-literal":{"captures":{"1":{"name":"punctuation.definition.link.title.begin.markdown"},"2":{"name":"string.other.link.title.markdown"},"4":{"name":"punctuation.definition.link.title.end.markdown"},"5":{"name":"punctuation.definition.constant.begin.markdown"},"6":{"name":"punctuation.definition.constant.end.markdown"}},"match":"(?[^]\\\\[\\\\\\\\]|\\\\\\\\.|\\\\[\\\\g*+])*+)(]) ?(\\\\[)(])","name":"meta.link.reference.literal.markdown"},"link-ref-shortcut":{"captures":{"1":{"name":"punctuation.definition.link.title.begin.markdown"},"2":{"name":"string.other.link.title.markdown"},"3":{"name":"punctuation.definition.link.title.end.markdown"}},"match":"(?]\\\\s|[0-9]+\\\\.\\\\s)","name":"meta.paragraph.markdown","patterns":[{"include":"#inline"},{"include":"text.html.derivative"},{"include":"#heading-setext"}],"while":"(^|\\\\G)(?!\\\\s*$|#| {0,3}([-*>_] {2,}){3,}[\\\\t ]*$\\\\n?| {0,3}[*->]| {0,3}[0-9]+\\\\.)"},"lists":{"patterns":[{"begin":"(^|\\\\G)( {0,3})([-*+])([\\\\t ])","beginCaptures":{"3":{"name":"punctuation.definition.list.begin.markdown"}},"name":"markup.list.unnumbered.markdown","patterns":[{"include":"#block"},{"include":"#list_paragraph"}],"while":"((^|\\\\G)( {2,4}|\\\\t))|^([\\\\t ]*)$"},{"begin":"(^|\\\\G)( {0,3})([0-9]+[).])([\\\\t ])","beginCaptures":{"3":{"name":"punctuation.definition.list.begin.markdown"}},"name":"markup.list.numbered.markdown","patterns":[{"include":"#block"},{"include":"#list_paragraph"}],"while":"((^|\\\\G)( {2,4}|\\\\t))|^([\\\\t ]*)$"}]},"paragraph":{"begin":"(^|\\\\G) {0,3}(?=[^\\\\t\\\\n ])","name":"meta.paragraph.markdown","patterns":[{"include":"#inline"},{"include":"text.html.derivative"},{"include":"#heading-setext"}],"while":"(^|\\\\G)((?=\\\\s*[-=]{3,}\\\\s*$)| {4,}(?=[^\\\\t\\\\n ]))"},"raw":{"captures":{"1":{"name":"punctuation.definition.raw.markdown"},"3":{"name":"punctuation.definition.raw.markdown"}},"match":"(`+)((?:[^`]|(?!(?]*?>)","end":"(?<=>)","patterns":[{"include":"text.html.derivative"}]},{"include":"#escape"},{"include":"#ampersand"},{"include":"#bracket"},{"include":"#raw"},{"include":"#bold"},{"include":"#italic"},{"include":"#image-inline"},{"include":"#link-inline"},{"include":"#link-inet"},{"include":"#link-email"},{"include":"#image-ref"},{"include":"#link-ref-literal"},{"include":"#link-ref"},{"include":"#link-ref-shortcut"}]},"3":{"name":"punctuation.definition.strikethrough.markdown"}},"match":"(?_f,codeToHtml:()=>fc,createCssVariablesTheme:()=>mc,createHighlighter:()=>pc,createJavaScriptRegexEngine:()=>sf,createOnigurumaEngine:()=>gf,getTokenStyleObject:()=>Ws,stringifyTokenStyle:()=>Gs});function gf(){throw Error(`The Oniguruma highlighter is not bundled.`)}var _f,vf=t((()=>{Oc(),uf(),_f={markdown:()=>Promise.resolve().then(()=>(mf(),df))}}));vf();async function yf(e){if(ua())throw Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let t=aa.get(e);if(t!=null)return t;try{let t=oa.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(_f,e)&&(t=_f[e]),t==null)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let n=t().then(({default:t})=>{let n={name:e,data:t};return ia.has(e)||ia.set(e,n),n});return aa.set(e,n),await n}finally{aa.delete(e)}}function bf(e){return ia.get(e)??yf(e)}var xf=new Set;function Sf(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var Cf=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},wf=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},Tf=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function Ef(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new Cf(t);e.set(t,n)}function a(t,n){return!e.has(t)&&(e.set(t,n),!0)}function o(t){return e.has(t)}function s(i){let a=t.get(i);if(a!==void 0)return Promise.resolve(a);let o=n.get(i);if(o!==void 0)return o;let s=e.get(i);if(s===void 0)return Promise.reject(new wf(i));let c=r,l=s().then(e=>{let a=Sf(e);return c===r&&t.set(i,a),n.get(i)===l&&n.delete(i),a}).catch(e=>{throw n.get(i)===l&&n.delete(i),e});return n.set(i,l),l}function c(e){return Promise.all(e.map(e=>s(e)))}function l(e,n){t.set(e,n)}function u(e){for(let[t,n]of e)l(t,n)}function d(e){return t.get(e)}function f(e){let n=[];for(let r of e){let e=t.get(r);if(e===void 0)throw new Tf(r);n.push(e)}return n}function p(e){return t.has(e)}function m(e){for(let n of e)if(!t.has(n))return!1;return!0}function h(e){let n=t.get(e);return n===void 0?s(e):n}function g(){r++,t.clear(),n.clear()}return{clearResolvedThemes:g,getResolvedOrResolveTheme:h,getResolvedTheme:d,getResolvedThemes:f,hasRegisteredTheme:o,hasResolvedTheme:p,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:a,resolveTheme:s,resolveThemes:c,seedResolvedTheme:l,seedResolvedThemes:u}}var Df=Ef();function Of(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=Df.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,Df.getResolvedTheme(n)??Df.seedResolvedTheme(n,e);xf.has(n)||(xf.add(n),t.loadThemeSync(e))}}var kf=n({default:()=>Af}),Af,jf=t((()=>{Af=Object.freeze(JSON.parse(`{"colors":{"activityBar.activeBorder":"#fd8c73","activityBar.background":"#ffffff","activityBar.border":"#d0d7de","activityBar.foreground":"#1f2328","activityBar.inactiveForeground":"#656d76","activityBarBadge.background":"#0969da","activityBarBadge.foreground":"#ffffff","badge.background":"#0969da","badge.foreground":"#ffffff","breadcrumb.activeSelectionForeground":"#656d76","breadcrumb.focusForeground":"#1f2328","breadcrumb.foreground":"#656d76","breadcrumbPicker.background":"#ffffff","button.background":"#1f883d","button.foreground":"#ffffff","button.hoverBackground":"#1a7f37","button.secondaryBackground":"#ebecf0","button.secondaryForeground":"#24292f","button.secondaryHoverBackground":"#f3f4f6","checkbox.background":"#f6f8fa","checkbox.border":"#d0d7de","debugConsole.errorForeground":"#cf222e","debugConsole.infoForeground":"#57606a","debugConsole.sourceForeground":"#9a6700","debugConsole.warningForeground":"#7d4e00","debugConsoleInputIcon.foreground":"#6639ba","debugIcon.breakpointForeground":"#cf222e","debugTokenExpression.boolean":"#116329","debugTokenExpression.error":"#a40e26","debugTokenExpression.name":"#0550ae","debugTokenExpression.number":"#116329","debugTokenExpression.string":"#0a3069","debugTokenExpression.value":"#0a3069","debugToolBar.background":"#ffffff","descriptionForeground":"#656d76","diffEditor.insertedLineBackground":"#aceebb4d","diffEditor.insertedTextBackground":"#6fdd8b80","diffEditor.removedLineBackground":"#ffcecb4d","diffEditor.removedTextBackground":"#ff818266","dropdown.background":"#ffffff","dropdown.border":"#d0d7de","dropdown.foreground":"#1f2328","dropdown.listBackground":"#ffffff","editor.background":"#ffffff","editor.findMatchBackground":"#bf8700","editor.findMatchHighlightBackground":"#fae17d80","editor.focusedStackFrameHighlightBackground":"#4ac26b66","editor.foldBackground":"#6e77811a","editor.foreground":"#1f2328","editor.lineHighlightBackground":"#eaeef280","editor.linkedEditingBackground":"#0969da12","editor.selectionHighlightBackground":"#4ac26b40","editor.stackFrameHighlightBackground":"#d4a72c66","editor.wordHighlightBackground":"#eaeef280","editor.wordHighlightBorder":"#afb8c199","editor.wordHighlightStrongBackground":"#afb8c14d","editor.wordHighlightStrongBorder":"#afb8c199","editorBracketHighlight.foreground1":"#0969da","editorBracketHighlight.foreground2":"#1a7f37","editorBracketHighlight.foreground3":"#9a6700","editorBracketHighlight.foreground4":"#cf222e","editorBracketHighlight.foreground5":"#bf3989","editorBracketHighlight.foreground6":"#8250df","editorBracketHighlight.unexpectedBracket.foreground":"#656d76","editorBracketMatch.background":"#4ac26b40","editorBracketMatch.border":"#4ac26b99","editorCursor.foreground":"#0969da","editorGroup.border":"#d0d7de","editorGroupHeader.tabsBackground":"#f6f8fa","editorGroupHeader.tabsBorder":"#d0d7de","editorGutter.addedBackground":"#4ac26b66","editorGutter.deletedBackground":"#ff818266","editorGutter.modifiedBackground":"#d4a72c66","editorIndentGuide.activeBackground":"#1f23283d","editorIndentGuide.background":"#1f23281f","editorInlayHint.background":"#afb8c133","editorInlayHint.foreground":"#656d76","editorInlayHint.paramBackground":"#afb8c133","editorInlayHint.paramForeground":"#656d76","editorInlayHint.typeBackground":"#afb8c133","editorInlayHint.typeForeground":"#656d76","editorLineNumber.activeForeground":"#1f2328","editorLineNumber.foreground":"#8c959f","editorOverviewRuler.border":"#ffffff","editorWhitespace.foreground":"#afb8c1","editorWidget.background":"#ffffff","errorForeground":"#cf222e","focusBorder":"#0969da","foreground":"#1f2328","gitDecoration.addedResourceForeground":"#1a7f37","gitDecoration.conflictingResourceForeground":"#bc4c00","gitDecoration.deletedResourceForeground":"#cf222e","gitDecoration.ignoredResourceForeground":"#6e7781","gitDecoration.modifiedResourceForeground":"#9a6700","gitDecoration.submoduleResourceForeground":"#656d76","gitDecoration.untrackedResourceForeground":"#1a7f37","icon.foreground":"#656d76","input.background":"#ffffff","input.border":"#d0d7de","input.foreground":"#1f2328","input.placeholderForeground":"#6e7781","keybindingLabel.foreground":"#1f2328","list.activeSelectionBackground":"#afb8c133","list.activeSelectionForeground":"#1f2328","list.focusBackground":"#ddf4ff","list.focusForeground":"#1f2328","list.highlightForeground":"#0969da","list.hoverBackground":"#eaeef280","list.hoverForeground":"#1f2328","list.inactiveFocusBackground":"#ddf4ff","list.inactiveSelectionBackground":"#afb8c133","list.inactiveSelectionForeground":"#1f2328","minimapSlider.activeBackground":"#8c959f47","minimapSlider.background":"#8c959f33","minimapSlider.hoverBackground":"#8c959f3d","notificationCenterHeader.background":"#f6f8fa","notificationCenterHeader.foreground":"#656d76","notifications.background":"#ffffff","notifications.border":"#d0d7de","notifications.foreground":"#1f2328","notificationsErrorIcon.foreground":"#cf222e","notificationsInfoIcon.foreground":"#0969da","notificationsWarningIcon.foreground":"#9a6700","panel.background":"#f6f8fa","panel.border":"#d0d7de","panelInput.border":"#d0d7de","panelTitle.activeBorder":"#fd8c73","panelTitle.activeForeground":"#1f2328","panelTitle.inactiveForeground":"#656d76","pickerGroup.border":"#d0d7de","pickerGroup.foreground":"#656d76","progressBar.background":"#0969da","quickInput.background":"#ffffff","quickInput.foreground":"#1f2328","scrollbar.shadow":"#6e778133","scrollbarSlider.activeBackground":"#8c959f47","scrollbarSlider.background":"#8c959f33","scrollbarSlider.hoverBackground":"#8c959f3d","settings.headerForeground":"#1f2328","settings.modifiedItemIndicator":"#d4a72c66","sideBar.background":"#f6f8fa","sideBar.border":"#d0d7de","sideBar.foreground":"#1f2328","sideBarSectionHeader.background":"#f6f8fa","sideBarSectionHeader.border":"#d0d7de","sideBarSectionHeader.foreground":"#1f2328","sideBarTitle.foreground":"#1f2328","statusBar.background":"#ffffff","statusBar.border":"#d0d7de","statusBar.debuggingBackground":"#cf222e","statusBar.debuggingForeground":"#ffffff","statusBar.focusBorder":"#0969da80","statusBar.foreground":"#656d76","statusBar.noFolderBackground":"#ffffff","statusBarItem.activeBackground":"#1f23281f","statusBarItem.focusBorder":"#0969da","statusBarItem.hoverBackground":"#1f232814","statusBarItem.prominentBackground":"#afb8c133","statusBarItem.remoteBackground":"#eaeef2","statusBarItem.remoteForeground":"#1f2328","symbolIcon.arrayForeground":"#953800","symbolIcon.booleanForeground":"#0550ae","symbolIcon.classForeground":"#953800","symbolIcon.colorForeground":"#0a3069","symbolIcon.constantForeground":"#116329","symbolIcon.constructorForeground":"#3e1f79","symbolIcon.enumeratorForeground":"#953800","symbolIcon.enumeratorMemberForeground":"#0550ae","symbolIcon.eventForeground":"#57606a","symbolIcon.fieldForeground":"#953800","symbolIcon.fileForeground":"#7d4e00","symbolIcon.folderForeground":"#7d4e00","symbolIcon.functionForeground":"#6639ba","symbolIcon.interfaceForeground":"#953800","symbolIcon.keyForeground":"#0550ae","symbolIcon.keywordForeground":"#a40e26","symbolIcon.methodForeground":"#6639ba","symbolIcon.moduleForeground":"#a40e26","symbolIcon.namespaceForeground":"#a40e26","symbolIcon.nullForeground":"#0550ae","symbolIcon.numberForeground":"#116329","symbolIcon.objectForeground":"#953800","symbolIcon.operatorForeground":"#0a3069","symbolIcon.packageForeground":"#953800","symbolIcon.propertyForeground":"#953800","symbolIcon.referenceForeground":"#0550ae","symbolIcon.snippetForeground":"#0550ae","symbolIcon.stringForeground":"#0a3069","symbolIcon.structForeground":"#953800","symbolIcon.textForeground":"#0a3069","symbolIcon.typeParameterForeground":"#0a3069","symbolIcon.unitForeground":"#0550ae","symbolIcon.variableForeground":"#953800","tab.activeBackground":"#ffffff","tab.activeBorder":"#ffffff","tab.activeBorderTop":"#fd8c73","tab.activeForeground":"#1f2328","tab.border":"#d0d7de","tab.hoverBackground":"#ffffff","tab.inactiveBackground":"#f6f8fa","tab.inactiveForeground":"#656d76","tab.unfocusedActiveBorder":"#ffffff","tab.unfocusedActiveBorderTop":"#d0d7de","tab.unfocusedHoverBackground":"#eaeef280","terminal.ansiBlack":"#24292f","terminal.ansiBlue":"#0969da","terminal.ansiBrightBlack":"#57606a","terminal.ansiBrightBlue":"#218bff","terminal.ansiBrightCyan":"#3192aa","terminal.ansiBrightGreen":"#1a7f37","terminal.ansiBrightMagenta":"#a475f9","terminal.ansiBrightRed":"#a40e26","terminal.ansiBrightWhite":"#8c959f","terminal.ansiBrightYellow":"#633c01","terminal.ansiCyan":"#1b7c83","terminal.ansiGreen":"#116329","terminal.ansiMagenta":"#8250df","terminal.ansiRed":"#cf222e","terminal.ansiWhite":"#6e7781","terminal.ansiYellow":"#4d2d00","terminal.foreground":"#1f2328","textBlockQuote.background":"#f6f8fa","textBlockQuote.border":"#d0d7de","textCodeBlock.background":"#afb8c133","textLink.activeForeground":"#0969da","textLink.foreground":"#0969da","textPreformat.background":"#afb8c133","textPreformat.foreground":"#656d76","textSeparator.foreground":"#d8dee4","titleBar.activeBackground":"#ffffff","titleBar.activeForeground":"#656d76","titleBar.border":"#d0d7de","titleBar.inactiveBackground":"#f6f8fa","titleBar.inactiveForeground":"#656d76","tree.indentGuidesStroke":"#d8dee4","welcomePage.buttonBackground":"#f6f8fa","welcomePage.buttonHoverBackground":"#f3f4f6"},"displayName":"GitHub Light Default","name":"github-light-default","semanticHighlighting":true,"tokenColors":[{"scope":["comment","punctuation.definition.comment","string.comment"],"settings":{"foreground":"#6e7781"}},{"scope":["constant.other.placeholder","constant.character"],"settings":{"foreground":"#cf222e"}},{"scope":["constant","entity.name.constant","variable.other.constant","variable.other.enummember","variable.language","entity"],"settings":{"foreground":"#0550ae"}},{"scope":["entity.name","meta.export.default","meta.definition.variable"],"settings":{"foreground":"#953800"}},{"scope":["variable.parameter.function","meta.jsx.children","meta.block","meta.tag.attributes","entity.name.constant","meta.object.member","meta.embedded.expression"],"settings":{"foreground":"#1f2328"}},{"scope":"entity.name.function","settings":{"foreground":"#8250df"}},{"scope":["entity.name.tag","support.class.component"],"settings":{"foreground":"#116329"}},{"scope":"keyword","settings":{"foreground":"#cf222e"}},{"scope":["storage","storage.type"],"settings":{"foreground":"#cf222e"}},{"scope":["storage.modifier.package","storage.modifier.import","storage.type.java"],"settings":{"foreground":"#1f2328"}},{"scope":["string","string punctuation.section.embedded source"],"settings":{"foreground":"#0a3069"}},{"scope":"support","settings":{"foreground":"#0550ae"}},{"scope":"meta.property-name","settings":{"foreground":"#0550ae"}},{"scope":"variable","settings":{"foreground":"#953800"}},{"scope":"variable.other","settings":{"foreground":"#1f2328"}},{"scope":"invalid.broken","settings":{"fontStyle":"italic","foreground":"#82071e"}},{"scope":"invalid.deprecated","settings":{"fontStyle":"italic","foreground":"#82071e"}},{"scope":"invalid.illegal","settings":{"fontStyle":"italic","foreground":"#82071e"}},{"scope":"invalid.unimplemented","settings":{"fontStyle":"italic","foreground":"#82071e"}},{"scope":"carriage-return","settings":{"background":"#cf222e","content":"^M","fontStyle":"italic underline","foreground":"#f6f8fa"}},{"scope":"message.error","settings":{"foreground":"#82071e"}},{"scope":"string variable","settings":{"foreground":"#0550ae"}},{"scope":["source.regexp","string.regexp"],"settings":{"foreground":"#0a3069"}},{"scope":["string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition"],"settings":{"foreground":"#0a3069"}},{"scope":"string.regexp constant.character.escape","settings":{"fontStyle":"bold","foreground":"#116329"}},{"scope":"support.constant","settings":{"foreground":"#0550ae"}},{"scope":"support.variable","settings":{"foreground":"#0550ae"}},{"scope":"support.type.property-name.json","settings":{"foreground":"#116329"}},{"scope":"meta.module-reference","settings":{"foreground":"#0550ae"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#953800"}},{"scope":["markup.heading","markup.heading entity.name"],"settings":{"fontStyle":"bold","foreground":"#0550ae"}},{"scope":"markup.quote","settings":{"foreground":"#116329"}},{"scope":"markup.italic","settings":{"fontStyle":"italic","foreground":"#1f2328"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#1f2328"}},{"scope":["markup.underline"],"settings":{"fontStyle":"underline"}},{"scope":["markup.strikethrough"],"settings":{"fontStyle":"strikethrough"}},{"scope":"markup.inline.raw","settings":{"foreground":"#0550ae"}},{"scope":["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],"settings":{"background":"#ffebe9","foreground":"#82071e"}},{"scope":["punctuation.section.embedded"],"settings":{"foreground":"#cf222e"}},{"scope":["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],"settings":{"background":"#dafbe1","foreground":"#116329"}},{"scope":["markup.changed","punctuation.definition.changed"],"settings":{"background":"#ffd8b5","foreground":"#953800"}},{"scope":["markup.ignored","markup.untracked"],"settings":{"background":"#0550ae","foreground":"#eaeef2"}},{"scope":"meta.diff.range","settings":{"fontStyle":"bold","foreground":"#8250df"}},{"scope":"meta.diff.header","settings":{"foreground":"#0550ae"}},{"scope":"meta.separator","settings":{"fontStyle":"bold","foreground":"#0550ae"}},{"scope":"meta.output","settings":{"foreground":"#0550ae"}},{"scope":["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],"settings":{"foreground":"#57606a"}},{"scope":"brackethighlighter.unmatched","settings":{"foreground":"#82071e"}},{"scope":["constant.other.reference.link","string.other.link"],"settings":{"foreground":"#0a3069"}}],"type":"light"}`))})),Mf=n({default:()=>Nf}),Nf,Pf=t((()=>{Nf=Object.freeze(JSON.parse(`{"colors":{"activityBar.activeBorder":"#f78166","activityBar.background":"#0d1117","activityBar.border":"#30363d","activityBar.foreground":"#e6edf3","activityBar.inactiveForeground":"#7d8590","activityBarBadge.background":"#1f6feb","activityBarBadge.foreground":"#ffffff","badge.background":"#1f6feb","badge.foreground":"#ffffff","breadcrumb.activeSelectionForeground":"#7d8590","breadcrumb.focusForeground":"#e6edf3","breadcrumb.foreground":"#7d8590","breadcrumbPicker.background":"#161b22","button.background":"#238636","button.foreground":"#ffffff","button.hoverBackground":"#2ea043","button.secondaryBackground":"#282e33","button.secondaryForeground":"#c9d1d9","button.secondaryHoverBackground":"#30363d","checkbox.background":"#161b22","checkbox.border":"#30363d","debugConsole.errorForeground":"#ffa198","debugConsole.infoForeground":"#8b949e","debugConsole.sourceForeground":"#e3b341","debugConsole.warningForeground":"#d29922","debugConsoleInputIcon.foreground":"#bc8cff","debugIcon.breakpointForeground":"#f85149","debugTokenExpression.boolean":"#56d364","debugTokenExpression.error":"#ffa198","debugTokenExpression.name":"#79c0ff","debugTokenExpression.number":"#56d364","debugTokenExpression.string":"#a5d6ff","debugTokenExpression.value":"#a5d6ff","debugToolBar.background":"#161b22","descriptionForeground":"#7d8590","diffEditor.insertedLineBackground":"#23863626","diffEditor.insertedTextBackground":"#3fb9504d","diffEditor.removedLineBackground":"#da363326","diffEditor.removedTextBackground":"#ff7b724d","dropdown.background":"#161b22","dropdown.border":"#30363d","dropdown.foreground":"#e6edf3","dropdown.listBackground":"#161b22","editor.background":"#0d1117","editor.findMatchBackground":"#9e6a03","editor.findMatchHighlightBackground":"#f2cc6080","editor.focusedStackFrameHighlightBackground":"#2ea04366","editor.foldBackground":"#6e76811a","editor.foreground":"#e6edf3","editor.lineHighlightBackground":"#6e76811a","editor.linkedEditingBackground":"#2f81f712","editor.selectionHighlightBackground":"#3fb95040","editor.stackFrameHighlightBackground":"#bb800966","editor.wordHighlightBackground":"#6e768180","editor.wordHighlightBorder":"#6e768199","editor.wordHighlightStrongBackground":"#6e76814d","editor.wordHighlightStrongBorder":"#6e768199","editorBracketHighlight.foreground1":"#79c0ff","editorBracketHighlight.foreground2":"#56d364","editorBracketHighlight.foreground3":"#e3b341","editorBracketHighlight.foreground4":"#ffa198","editorBracketHighlight.foreground5":"#ff9bce","editorBracketHighlight.foreground6":"#d2a8ff","editorBracketHighlight.unexpectedBracket.foreground":"#7d8590","editorBracketMatch.background":"#3fb95040","editorBracketMatch.border":"#3fb95099","editorCursor.foreground":"#2f81f7","editorGroup.border":"#30363d","editorGroupHeader.tabsBackground":"#010409","editorGroupHeader.tabsBorder":"#30363d","editorGutter.addedBackground":"#2ea04366","editorGutter.deletedBackground":"#f8514966","editorGutter.modifiedBackground":"#bb800966","editorIndentGuide.activeBackground":"#e6edf33d","editorIndentGuide.background":"#e6edf31f","editorInlayHint.background":"#8b949e33","editorInlayHint.foreground":"#7d8590","editorInlayHint.paramBackground":"#8b949e33","editorInlayHint.paramForeground":"#7d8590","editorInlayHint.typeBackground":"#8b949e33","editorInlayHint.typeForeground":"#7d8590","editorLineNumber.activeForeground":"#e6edf3","editorLineNumber.foreground":"#6e7681","editorOverviewRuler.border":"#010409","editorWhitespace.foreground":"#484f58","editorWidget.background":"#161b22","errorForeground":"#f85149","focusBorder":"#1f6feb","foreground":"#e6edf3","gitDecoration.addedResourceForeground":"#3fb950","gitDecoration.conflictingResourceForeground":"#db6d28","gitDecoration.deletedResourceForeground":"#f85149","gitDecoration.ignoredResourceForeground":"#6e7681","gitDecoration.modifiedResourceForeground":"#d29922","gitDecoration.submoduleResourceForeground":"#7d8590","gitDecoration.untrackedResourceForeground":"#3fb950","icon.foreground":"#7d8590","input.background":"#0d1117","input.border":"#30363d","input.foreground":"#e6edf3","input.placeholderForeground":"#6e7681","keybindingLabel.foreground":"#e6edf3","list.activeSelectionBackground":"#6e768166","list.activeSelectionForeground":"#e6edf3","list.focusBackground":"#388bfd26","list.focusForeground":"#e6edf3","list.highlightForeground":"#2f81f7","list.hoverBackground":"#6e76811a","list.hoverForeground":"#e6edf3","list.inactiveFocusBackground":"#388bfd26","list.inactiveSelectionBackground":"#6e768166","list.inactiveSelectionForeground":"#e6edf3","minimapSlider.activeBackground":"#8b949e47","minimapSlider.background":"#8b949e33","minimapSlider.hoverBackground":"#8b949e3d","notificationCenterHeader.background":"#161b22","notificationCenterHeader.foreground":"#7d8590","notifications.background":"#161b22","notifications.border":"#30363d","notifications.foreground":"#e6edf3","notificationsErrorIcon.foreground":"#f85149","notificationsInfoIcon.foreground":"#2f81f7","notificationsWarningIcon.foreground":"#d29922","panel.background":"#010409","panel.border":"#30363d","panelInput.border":"#30363d","panelTitle.activeBorder":"#f78166","panelTitle.activeForeground":"#e6edf3","panelTitle.inactiveForeground":"#7d8590","peekViewEditor.background":"#6e76811a","peekViewEditor.matchHighlightBackground":"#bb800966","peekViewResult.background":"#0d1117","peekViewResult.matchHighlightBackground":"#bb800966","pickerGroup.border":"#30363d","pickerGroup.foreground":"#7d8590","progressBar.background":"#1f6feb","quickInput.background":"#161b22","quickInput.foreground":"#e6edf3","scrollbar.shadow":"#484f5833","scrollbarSlider.activeBackground":"#8b949e47","scrollbarSlider.background":"#8b949e33","scrollbarSlider.hoverBackground":"#8b949e3d","settings.headerForeground":"#e6edf3","settings.modifiedItemIndicator":"#bb800966","sideBar.background":"#010409","sideBar.border":"#30363d","sideBar.foreground":"#e6edf3","sideBarSectionHeader.background":"#010409","sideBarSectionHeader.border":"#30363d","sideBarSectionHeader.foreground":"#e6edf3","sideBarTitle.foreground":"#e6edf3","statusBar.background":"#0d1117","statusBar.border":"#30363d","statusBar.debuggingBackground":"#da3633","statusBar.debuggingForeground":"#ffffff","statusBar.focusBorder":"#1f6feb80","statusBar.foreground":"#7d8590","statusBar.noFolderBackground":"#0d1117","statusBarItem.activeBackground":"#e6edf31f","statusBarItem.focusBorder":"#1f6feb","statusBarItem.hoverBackground":"#e6edf314","statusBarItem.prominentBackground":"#6e768166","statusBarItem.remoteBackground":"#30363d","statusBarItem.remoteForeground":"#e6edf3","symbolIcon.arrayForeground":"#f0883e","symbolIcon.booleanForeground":"#58a6ff","symbolIcon.classForeground":"#f0883e","symbolIcon.colorForeground":"#79c0ff","symbolIcon.constantForeground":["#aff5b4","#7ee787","#56d364","#3fb950","#2ea043","#238636","#196c2e","#0f5323","#033a16","#04260f"],"symbolIcon.constructorForeground":"#d2a8ff","symbolIcon.enumeratorForeground":"#f0883e","symbolIcon.enumeratorMemberForeground":"#58a6ff","symbolIcon.eventForeground":"#6e7681","symbolIcon.fieldForeground":"#f0883e","symbolIcon.fileForeground":"#d29922","symbolIcon.folderForeground":"#d29922","symbolIcon.functionForeground":"#bc8cff","symbolIcon.interfaceForeground":"#f0883e","symbolIcon.keyForeground":"#58a6ff","symbolIcon.keywordForeground":"#ff7b72","symbolIcon.methodForeground":"#bc8cff","symbolIcon.moduleForeground":"#ff7b72","symbolIcon.namespaceForeground":"#ff7b72","symbolIcon.nullForeground":"#58a6ff","symbolIcon.numberForeground":"#3fb950","symbolIcon.objectForeground":"#f0883e","symbolIcon.operatorForeground":"#79c0ff","symbolIcon.packageForeground":"#f0883e","symbolIcon.propertyForeground":"#f0883e","symbolIcon.referenceForeground":"#58a6ff","symbolIcon.snippetForeground":"#58a6ff","symbolIcon.stringForeground":"#79c0ff","symbolIcon.structForeground":"#f0883e","symbolIcon.textForeground":"#79c0ff","symbolIcon.typeParameterForeground":"#79c0ff","symbolIcon.unitForeground":"#58a6ff","symbolIcon.variableForeground":"#f0883e","tab.activeBackground":"#0d1117","tab.activeBorder":"#0d1117","tab.activeBorderTop":"#f78166","tab.activeForeground":"#e6edf3","tab.border":"#30363d","tab.hoverBackground":"#0d1117","tab.inactiveBackground":"#010409","tab.inactiveForeground":"#7d8590","tab.unfocusedActiveBorder":"#0d1117","tab.unfocusedActiveBorderTop":"#30363d","tab.unfocusedHoverBackground":"#6e76811a","terminal.ansiBlack":"#484f58","terminal.ansiBlue":"#58a6ff","terminal.ansiBrightBlack":"#6e7681","terminal.ansiBrightBlue":"#79c0ff","terminal.ansiBrightCyan":"#56d4dd","terminal.ansiBrightGreen":"#56d364","terminal.ansiBrightMagenta":"#d2a8ff","terminal.ansiBrightRed":"#ffa198","terminal.ansiBrightWhite":"#ffffff","terminal.ansiBrightYellow":"#e3b341","terminal.ansiCyan":"#39c5cf","terminal.ansiGreen":"#3fb950","terminal.ansiMagenta":"#bc8cff","terminal.ansiRed":"#ff7b72","terminal.ansiWhite":"#b1bac4","terminal.ansiYellow":"#d29922","terminal.foreground":"#e6edf3","textBlockQuote.background":"#010409","textBlockQuote.border":"#30363d","textCodeBlock.background":"#6e768166","textLink.activeForeground":"#2f81f7","textLink.foreground":"#2f81f7","textPreformat.background":"#6e768166","textPreformat.foreground":"#7d8590","textSeparator.foreground":"#21262d","titleBar.activeBackground":"#0d1117","titleBar.activeForeground":"#7d8590","titleBar.border":"#30363d","titleBar.inactiveBackground":"#010409","titleBar.inactiveForeground":"#7d8590","tree.indentGuidesStroke":"#21262d","welcomePage.buttonBackground":"#21262d","welcomePage.buttonHoverBackground":"#30363d"},"displayName":"GitHub Dark Default","name":"github-dark-default","semanticHighlighting":true,"tokenColors":[{"scope":["comment","punctuation.definition.comment","string.comment"],"settings":{"foreground":"#8b949e"}},{"scope":["constant.other.placeholder","constant.character"],"settings":{"foreground":"#ff7b72"}},{"scope":["constant","entity.name.constant","variable.other.constant","variable.other.enummember","variable.language","entity"],"settings":{"foreground":"#79c0ff"}},{"scope":["entity.name","meta.export.default","meta.definition.variable"],"settings":{"foreground":"#ffa657"}},{"scope":["variable.parameter.function","meta.jsx.children","meta.block","meta.tag.attributes","entity.name.constant","meta.object.member","meta.embedded.expression"],"settings":{"foreground":"#e6edf3"}},{"scope":"entity.name.function","settings":{"foreground":"#d2a8ff"}},{"scope":["entity.name.tag","support.class.component"],"settings":{"foreground":"#7ee787"}},{"scope":"keyword","settings":{"foreground":"#ff7b72"}},{"scope":["storage","storage.type"],"settings":{"foreground":"#ff7b72"}},{"scope":["storage.modifier.package","storage.modifier.import","storage.type.java"],"settings":{"foreground":"#e6edf3"}},{"scope":["string","string punctuation.section.embedded source"],"settings":{"foreground":"#a5d6ff"}},{"scope":"support","settings":{"foreground":"#79c0ff"}},{"scope":"meta.property-name","settings":{"foreground":"#79c0ff"}},{"scope":"variable","settings":{"foreground":"#ffa657"}},{"scope":"variable.other","settings":{"foreground":"#e6edf3"}},{"scope":"invalid.broken","settings":{"fontStyle":"italic","foreground":"#ffa198"}},{"scope":"invalid.deprecated","settings":{"fontStyle":"italic","foreground":"#ffa198"}},{"scope":"invalid.illegal","settings":{"fontStyle":"italic","foreground":"#ffa198"}},{"scope":"invalid.unimplemented","settings":{"fontStyle":"italic","foreground":"#ffa198"}},{"scope":"carriage-return","settings":{"background":"#ff7b72","content":"^M","fontStyle":"italic underline","foreground":"#f0f6fc"}},{"scope":"message.error","settings":{"foreground":"#ffa198"}},{"scope":"string variable","settings":{"foreground":"#79c0ff"}},{"scope":["source.regexp","string.regexp"],"settings":{"foreground":"#a5d6ff"}},{"scope":["string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition"],"settings":{"foreground":"#a5d6ff"}},{"scope":"string.regexp constant.character.escape","settings":{"fontStyle":"bold","foreground":"#7ee787"}},{"scope":"support.constant","settings":{"foreground":"#79c0ff"}},{"scope":"support.variable","settings":{"foreground":"#79c0ff"}},{"scope":"support.type.property-name.json","settings":{"foreground":"#7ee787"}},{"scope":"meta.module-reference","settings":{"foreground":"#79c0ff"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#ffa657"}},{"scope":["markup.heading","markup.heading entity.name"],"settings":{"fontStyle":"bold","foreground":"#79c0ff"}},{"scope":"markup.quote","settings":{"foreground":"#7ee787"}},{"scope":"markup.italic","settings":{"fontStyle":"italic","foreground":"#e6edf3"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#e6edf3"}},{"scope":["markup.underline"],"settings":{"fontStyle":"underline"}},{"scope":["markup.strikethrough"],"settings":{"fontStyle":"strikethrough"}},{"scope":"markup.inline.raw","settings":{"foreground":"#79c0ff"}},{"scope":["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],"settings":{"background":"#490202","foreground":"#ffa198"}},{"scope":["punctuation.section.embedded"],"settings":{"foreground":"#ff7b72"}},{"scope":["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],"settings":{"background":"#04260f","foreground":"#7ee787"}},{"scope":["markup.changed","punctuation.definition.changed"],"settings":{"background":"#5a1e02","foreground":"#ffa657"}},{"scope":["markup.ignored","markup.untracked"],"settings":{"background":"#79c0ff","foreground":"#161b22"}},{"scope":"meta.diff.range","settings":{"fontStyle":"bold","foreground":"#d2a8ff"}},{"scope":"meta.diff.header","settings":{"foreground":"#79c0ff"}},{"scope":"meta.separator","settings":{"fontStyle":"bold","foreground":"#79c0ff"}},{"scope":"meta.output","settings":{"foreground":"#79c0ff"}},{"scope":["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],"settings":{"foreground":"#8b949e"}},{"scope":"brackethighlighter.unmatched","settings":{"foreground":"#ffa198"}},{"scope":["constant.other.reference.link","string.other.link"],"settings":{"foreground":"#a5d6ff"}}],"type":"dark"}`))}));Oc();function Ff(e){return{...e,load:async()=>as((await e.load()).default)}}var If=[Ff({name:`github-light-default`,colorScheme:`light`,collection:`github`,displayName:`GitHub Light Default`,load:()=>Promise.resolve().then(()=>(jf(),kf))}),Ff({name:`github-dark-default`,colorScheme:`dark`,collection:`github`,displayName:`GitHub Dark Default`,load:()=>Promise.resolve().then(()=>(Pf(),Mf))})],Lf={getTheme:e=>If.find(t=>t.name===e),getThemes:()=>If},Rf={getTheme:()=>void 0,getThemes:()=>[]};function zf(e){if(ua())throw Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(Df.hasRegisteredTheme(e))return;let t=Rf.getTheme(e);if(t!=null){Df.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function Bf(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function Vf(e){zf(e);let t=await Df.resolveTheme(e);return Bf(e,t),t}function Hf(e){return Df.getResolvedTheme(e)??Vf(e)}vf();var Uf;async function Wf({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){Uf??=pc({themes:[],langs:[`text`],engine:n===`shiki-wasm`?gf(Promise.resolve().then(()=>(vf(),hf))):sf()});let r=Kf(Uf)?await Uf:Uf;Uf=r;let i=[];for(let e of t){if(e===`text`||e===`ansi`)continue;let t=bf(e);`then`in t?i.push(t):la(t,r)}let a=[];for(let t of e){let e=Hf(t);`then`in e?a.push(e):Of(e,Uf)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{la(e,r)}),Promise.all(a).then(e=>{Of(e,r)})]),r}function Gf(){if(Uf!=null&&!(`then`in Uf))return Uf}function Kf(e=Uf){return e!=null&&`then`in e}for(let e of Lf.getThemes())Df.registerThemeIfAbsent(e.name,e.load);function qf(e=k){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Jf(e){for(let t of qf(e))if(!xf.has(t))return!1;return!0}function Yf(e){return Df.hasResolvedThemes(e)}function Xf(e,t){return me(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function Zf(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function Qf(e){return N({tagName:`div`,children:[N({tagName:`div`,children:e.annotations?.map(e=>N({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function $f(e){switch(e){case`file`:return`diffs-icon-file-code`;case`change`:return`diffs-icon-symbol-modified`;case`new`:return`diffs-icon-symbol-added`;case`deleted`:return`diffs-icon-symbol-deleted`;case`rename-pure`:case`rename-changed`:return`diffs-icon-symbol-moved`}}function ep({fileOrDiff:e,mode:t,stickyHeader:n}){let r=`type`in e?e:void 0,i={"data-diffs-header":t,"data-change-type":r?.type,"data-sticky":n?``:void 0};return N({tagName:`div`,children:[t===`custom`?N({tagName:`slot`,properties:{name:te}}):tp({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[np(r)]],properties:i})}function tp({name:e,prevName:t,iconType:n}){let r=[N({tagName:`slot`,properties:{name:ee}}),At({name:$f(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(N({tagName:`div`,children:[N({tagName:`bdi`,children:[kt(t)]})],properties:{"data-prev-name":``}})),r.push(At({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push(N({tagName:`div`,children:[N({tagName:`bdi`,children:[kt(e)]})],properties:{"data-title":``}})),r.push(N({tagName:`slot`,properties:{name:D}})),N({tagName:`div`,children:r,properties:{"data-header-content":``}})}function np(e){let t=[];if(e!=null){let n=0,r=0;for(let t of e.hunks)n+=t.additionLines,r+=t.deletionLines;(r>0||n===0)&&t.push(N({tagName:`span`,children:[kt(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push(N({tagName:`span`,children:[kt(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push(N({tagName:`slot`,properties:{name:O}})),N({tagName:`div`,children:t,properties:{"data-metadata":``}})}function rp(e){return N({tagName:`pre`,properties:ip(e)})}function ip({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"data-diff":o===`diff`?``:void 0,"data-file":o===`file`?``:void 0,"data-diff-type":o===`diff`?i?`split`:`single`:void 0,"data-overflow":r,"data-disable-line-numbers":n?``:void 0,"data-background":t?void 0:``,"data-indicators":e===`bars`||e===`classic`?e:void 0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}var ap=new Map,op={"1c":`1c`,abap:`abap`,as:`actionscript-3`,ada:`ada`,adb:`ada`,ads:`ada`,adoc:`asciidoc`,asciidoc:`asciidoc`,"component.html":`angular-html`,"component.ts":`angular-ts`,conf:`nginx`,htaccess:`apache`,cls:`tex`,trigger:`apex`,apl:`apl`,applescript:`applescript`,scpt:`applescript`,ara:`ara`,asm:`asm`,s:`riscv`,astro:`astro`,awk:`awk`,bal:`ballerina`,sh:`zsh`,bash:`zsh`,bat:`cmd`,cmd:`cmd`,be:`berry`,beancount:`beancount`,bib:`bibtex`,bicep:`bicep`,"blade.php":`blade`,bsl:`bsl`,c:`c`,h:`objective-cpp`,cs:`csharp`,cpp:`cpp`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,hh:`cpp`,cdc:`cdc`,cairo:`cairo`,clar:`clarity`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,soy:`soy`,cmake:`cmake`,"CMakeLists.txt":`cmake`,cob:`cobol`,cbl:`cobol`,cobol:`cobol`,CODEOWNERS:`codeowners`,ql:`ql`,coffee:`coffeescript`,lisp:`lisp`,cl:`lisp`,lsp:`lisp`,log:`log`,v:`verilog`,cql:`cql`,cr:`crystal`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cypher`,cyp:`cypher`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,patch:`diff`,Dockerfile:`dockerfile`,dockerfile:`dockerfile`,env:`dotenv`,dm:`dream-maker`,edge:`edge`,el:`emacs-lisp`,ex:`elixir`,exs:`elixir`,elm:`elm`,erb:`erb`,erl:`erlang`,hrl:`erlang`,f:`fortran-fixed-form`,for:`fortran-fixed-form`,fs:`fsharp`,fsi:`fsharp`,fsx:`fsharp`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`fortran-free-form`,f95:`fortran-free-form`,fnl:`fennel`,fish:`fish`,ftl:`ftl`,tres:`gdresource`,res:`gdresource`,gd:`gdscript`,gdshader:`gdshader`,gs:`genie`,feature:`gherkin`,COMMIT_EDITMSG:`git-commit`,"git-rebase-todo":`git-rebase`,gjs:`glimmer-js`,gleam:`gleam`,gts:`glimmer-ts`,glsl:`glsl`,vert:`glsl`,frag:`glsl`,shader:`shaderlab`,gp:`gnuplot`,plt:`gnuplot`,gnuplot:`gnuplot`,go:`go`,graphql:`graphql`,gql:`graphql`,groovy:`groovy`,gvy:`groovy`,hack:`hack`,haml:`haml`,hbs:`handlebars`,handlebars:`handlebars`,hs:`haskell`,lhs:`haskell`,hx:`haxe`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,fx:`hlsl`,html:`html`,htm:`html`,http:`http`,rest:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,cfg:`ini`,jade:`pug`,pug:`pug`,java:`java`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jinja:`jinja`,jinja2:`jinja`,j2:`jinja`,jison:`jison`,jl:`julia`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,libsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,kt:`kotlin`,kts:`kts`,kql:`kusto`,tex:`tex`,ltx:`tex`,lean:`lean4`,less:`less`,liquid:`liquid`,lit:`lit`,ll:`llvm`,logo:`logo`,lua:`lua`,luau:`luau`,Makefile:`makefile`,mk:`makefile`,makefile:`makefile`,md:`markdown`,markdown:`markdown`,marko:`marko`,m:`wolfram`,mat:`matlab`,mdc:`mdc`,mdx:`mdx`,wiki:`wikitext`,mediawiki:`wikitext`,mmd:`mermaid`,mermaid:`mermaid`,mips:`mipsasm`,mojo:`mojo`,"🔥":`mojo`,move:`move`,nar:`narrat`,nf:`nextflow`,nim:`nim`,nims:`nim`,nimble:`nim`,nix:`nix`,nu:`nushell`,mm:`objective-cpp`,ml:`ocaml`,mli:`ocaml`,mll:`ocaml`,mly:`ocaml`,pas:`pascal`,p:`pascal`,pl:`prolog`,pm:`perl`,t:`perl`,raku:`raku`,p6:`raku`,pl6:`raku`,php:`php`,phtml:`php`,pls:`plsql`,sql:`sql`,po:`po`,polar:`polar`,pcss:`postcss`,pot:`pot`,potx:`potx`,pq:`powerquery`,pqm:`powerquery`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,prisma:`prisma`,pro:`prolog`,P:`prolog`,properties:`properties`,proto:`protobuf`,pp:`puppet`,purs:`purescript`,py:`python`,pyw:`python`,pyi:`python`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,R:`r`,rkt:`racket`,rktl:`racket`,razor:`razor`,cshtml:`razor`,rb:`ruby`,rbw:`ruby`,reg:`reg`,regex:`regexp`,rel:`rel`,rs:`rust`,rst:`rst`,rake:`ruby`,gemspec:`ruby`,jbuilder:`ruby`,builder:`ruby`,rabl:`ruby`,arb:`ruby`,ru:`ruby`,podspec:`ruby`,Gemfile:`ruby`,Rakefile:`ruby`,Guardfile:`ruby`,Capfile:`ruby`,Berksfile:`ruby`,Brewfile:`ruby`,Vagrantfile:`ruby`,Thorfile:`ruby`,Appraisals:`ruby`,Dangerfile:`ruby`,sas:`sas`,sass:`sass`,scala:`scala`,sc:`scala`,scm:`scheme`,ss:`scheme`,sld:`scheme`,scss:`scss`,sdbl:`sdbl`,shadergraph:`shader`,st:`smalltalk`,sol:`solidity`,sparql:`sparql`,rq:`sparql`,spl:`splunk`,config:`ssh-config`,do:`stata`,ado:`stata`,dta:`stata`,styl:`stylus`,stylus:`stylus`,svelte:`svelte`,swift:`swift`,sv:`system-verilog`,svh:`system-verilog`,service:`systemd`,socket:`systemd`,device:`systemd`,timer:`systemd`,talon:`talonscript`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`typescript`,mts:`typescript`,cts:`typescript`,tsp:`typespec`,tsv:`tsv`,tsx:`tsx`,ttl:`turtle`,twig:`twig`,typ:`typst`,vv:`v`,vala:`vala`,vapi:`vala`,vb:`vb`,vbs:`vb`,bas:`vb`,vh:`verilog`,vhd:`vhdl`,vhdl:`vhdl`,vim:`vimscript`,vue:`vue`,"vine.ts":`vue-vine`,vy:`vyper`,wasm:`wasm`,wat:`wasm`,wy:`文言`,wgsl:`wgsl`,wit:`wit`,wl:`wolfram`,nb:`wolfram`,xml:`xml`,xsl:`xsl`,xslt:`xsl`,yaml:`yaml`,yml:`yml`,zs:`zenscript`,zig:`zig`,zsh:`zsh`,sty:`tex`};function Q(e){if(ap.has(e))return ap.get(e)??`text`;if(op[e]!=null)return op[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(ap.has(t[1]))return ap.get(t[1])??`text`;if(op[t[1]]!=null)return op[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return ap.has(n)?ap.get(n)??`text`:op[n]??`text`}function sp(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:[e??`text`],themes:qf(t),preferredHighlighter:n}}function cp(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function lp(e,t,n){let r=typeof n.lineInfo==`function`?n.lineInfo(t):n.lineInfo[t-1];if(r==null){let r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),Error(r)}return e.tagName=`div`,e.properties[`data-line`]=r.lineNumber,e.properties[`data-alt-line`]=r.altLineNumber,e.properties[`data-line-type`]=r.type,e.properties[`data-line-index`]=r.lineIndex,e.children.length===0&&e.children.push(kt(`
+`)),e}var up=Symbol(`no-token`),dp=Symbol(`multiple-tokens`);function fp(e){let t=pp(e);if(t!=null)return t;let n=up,r=[],i=[],a,o=()=>{if(i.length===0||a==null){i=[],a=void 0;return}if(i.length===1){let e=i[0];if(e?.type===`element`){hp(e,a);for(let t of e.children)mp(t)}else mp(e);r.push(e),i=[],a=void 0;return}for(let e of i)mp(e);r.push(N({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0},s=e=>{if(e!==up){if(e===dp){n=dp;return}if(n===up){n=e;return}n!==e&&(n=dp)}};for(let t of e.children){let e=t.type===`element`?fp(t):up;if(s(e),typeof e!=`number`){o(),r.push(t);continue}a!=null&&a!==e&&o(),a??=e,i.push(t)}return o(),e.children=r,n}function pp(e){let t=e.properties[`data-char`];if(typeof t==`number`)return t}function mp(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)mp(t)}}function hp(e,t){e.properties[`data-char`]=t}function gp(e={}){let{classPrefix:t=`__shiki_`,classSuffix:n=``,classReplacer:r=e=>e}=e,i=new Map;function a(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function o(e){let o=typeof e==`string`?e:a(e),s=t+_p(o)+n;return s=r(s),i.has(s)||i.set(s,typeof e==`string`?e:{...e}),s}return{name:`@shikijs/transformers:style-to-class`,pre(e){if(!e.properties.style)return;let t=o(e.properties.style);delete e.properties.style,this.addClassToHast(e,t)},tokens(e){for(let t of e)for(let e of t){if(!e.htmlStyle)continue;let t=o(e.htmlStyle);e.htmlStyle={},e.htmlAttrs||={},e.htmlAttrs.class?e.htmlAttrs.class+=` ${t}`:e.htmlAttrs.class=t}},getClassRegistry(){return i},getCSS(){let e=``;for(let[t,n]of i.entries())e+=`.${t}{${typeof n==`string`?n:a(n)}}`;return e},clearRegistry(){i.clear()}}}function _p(e,t=0){let n=3735928559^t,r=1103547991^t;for(let t=0,i;t>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36).slice(0,6)}function vp(e=!1,t=!1){let n={lineInfo:[]},r=[{line(e){return delete e.properties.class,e},pre(t){let r=jt(t),i=[];if(r!=null){let t=1;for(let a of r.children)a.type===`element`&&(e&&fp(a),i.push(lp(a,t,n)),t++);r.children=i}return t},...e?{tokens(e){for(let t of e){let e=0;for(let n of t){let t=n;t.__lineChar??=e,e+=n.content.length}}},preprocess(e,t){t.mergeWhitespaces=`never`},span(e,t,n,r,i){if(i?.offset!=null&&i.content!=null){let t=i.__lineChar;return t!=null&&(e.properties[`data-char`]=t),e}return e}}:null}];return t&&r.push(bp,yp),e&&r.push({line:e=>(e.type===`element`&&e.children.length===0&&e.children.push({type:`element`,tagName:`br`,properties:{},children:[]}),e)}),{state:n,transformers:r,toClass:yp}}var yp=gp({classPrefix:`hl-`}),bp={name:`token-style-normalizer`,tokens(e){for(let t of e)for(let e of t){if(e.htmlStyle!=null)continue;let t={};e.color!=null&&(t.color=e.color),e.bgColor!=null&&(t[`background-color`]=e.bgColor),e.fontStyle!=null&&e.fontStyle!==0&&(e.fontStyle&1&&(t[`font-style`]=`italic`),e.fontStyle&2&&(t[`font-weight`]=`bold`),e.fontStyle&4&&(t[`text-decoration`]=`underline`)),Object.keys(t).length>0&&(e.htmlStyle=t)}}};function $(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}var xp=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,Sp=/^0(?:\.0+)?%?$/;function Cp(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function wp(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;let n=t[1],r,i=1;return n.length===3?r=n.split(``).map(e=>e+e).join(``):n.length===6?r=n:(r=n.slice(0,6),i=parseInt(n.slice(6,8),16)/255),[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16),i]}function Tp(e){if(e==null)return null;let t=wp(e);if(t==null)return null;let n=t[0]/255,r=t[1]/255,i=t[2]/255,a=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4;return .2126*a(n)+.7152*a(r)+.0722*a(i)}function Ep(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||xp.test(t))return!0;let n=Cp(t);return n!=null&&Sp.test(n)}function Dp(e,t,n){if(t==null||n==null)return!1;let r=Tp(e),i=Tp(t),a=Tp(n);return r==null||i==null||a==null?!1:Math.abs(r-a){let i=t[r],a=t[r+1]??e.length;return e.slice(i,a)})}var Hp={forcePlainText:!1};function Up(e,t,{theme:n=k,tokenizeMaxLineLength:r,useTokenTransformer:i},{forcePlainText:a,startingLine:o,totalLines:s,lines:c}=Hp){a?(o??=0,s??=1/0):(o=0,s=1/0);let l=o>0||s<1/0,{state:u,transformers:d}=vp(i),f=a?`text`:e.lang??Q(e.name),p=typeof n==`string`?t.getTheme(n).type:void 0,m=Np({theme:n,highlighter:t});u.lineInfo=e=>({type:`context`,lineIndex:e-1+o,lineNumber:e+o});let h=typeof n==`string`?{lang:f,theme:n,transformers:d,defaultColor:!1,cssVariablePrefix:$(`token`),tokenizeMaxLineLength:r,tokenizeTimeLimit:0}:{lang:f,themes:n,transformers:d,defaultColor:!1,cssVariablePrefix:$(`token`),tokenizeMaxLineLength:r,tokenizeTimeLimit:0},g=Fp(t.codeToHast(l?Wp(c??Vp(e.contents),o,s):e.contents,h)),_=l?Array(o):g;return l&&_.push(...g),{code:_,themeStyles:m,baseThemeType:p}}function Wp(e,t,n){if(e.length===0)return``;let r=Math.min(t+n,e.length);return e.slice(t,r).join(``)}function Gp(e){let t=e[0];return t!=null&&t.length>0?t:void 0}function Kp(e){return e.startingLine===0&&e.totalLines>0}function qp(e,t){return e.endsWith(`\r
+`)?t+`\r
+`:e.endsWith(`\r`)?t+`\r`:e.endsWith(`
+`)?t+`
+`:t}function Jp(e,t){return N({tagName:`div`,children:e,properties:{"data-content":``,style:`grid-row: span ${t}`}})}function Yp(e){return(e.lang??Q(e.name))===`text`}ki();function Xp(e,t){return t.cacheKey==null?e.file===t&&e.sourceContents===t.contents:e.cacheKey===t.cacheKey}var Zp=-1,Qp=class{options;onRenderUpdate;workerManager;__id=`file-renderer:${++Zp}`;highlighter;renderCache;computedLang=`text`;lineAnnotations={};lineCache;pendingStructuralRows;textDocumentCache=new WeakMap;editSessionActive=!1;constructor(e={theme:k},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Jf(e.theme??k)?Gf():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setLineAnnotations(e){this.lineAnnotations={};for(let t of e){let e=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=e,e.push(t)}}cleanUp(){this.recycle(),this.workerManager=void 0,this.onRenderUpdate=void 0}beginEditSession(){this.editSessionActive=!0}endEditSession(){this.editSessionActive=!1}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}recycle(){this.clearRenderCache(),this.highlighter=void 0,this.workerManager?.cleanUpTasks(this),this.lineCache=void 0,this.endEditSession(),this.textDocumentCache=new WeakMap}syncEditedContentsToFile(){let{renderCache:e,lineCache:t}=this;e?.isDirty!==!0||t==null||!Xp(t,e.file)||(e.file.contents=t.lines.join(``))}hasUnkeyedFileContentsChanged(e){let{lineCache:t}=this;return e.cacheKey==null&&t!=null&&t.file===e&&t.sourceContents!==e.contents}invalidateChangedUnkeyedFile(e){this.hasUnkeyedFileContentsChanged(e)&&(this.workerManager?.cleanUpTasks(this),this.clearRenderCache(),this.lineCache=void 0,this.textDocumentCache=new WeakMap)}clearRenderCache(){this.syncEditedContentsToFile(),this.pendingStructuralRows=void 0;let e=this.renderCache;this.renderCache=void 0,e!=null&&e.isDirty===!0&&e.file.cacheKey!=null&&this.workerManager?.evictFileFromCache(e.file.cacheKey)}hydrate(e){let{options:t}=this.getRenderOptions(e),n=$p(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength()),r=this.workerManager?.getFileResultCache(e);r!=null&&!Xf(t,r.options)&&(r=void 0),this.renderCache??={file:e,options:t,highlighted:!n&&!Yp(e),result:n?void 0:r?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightFileAST(this,e):this.highlighter??(this.computedLang=e.lang??Q(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getFileRenderOptions().theme??this.options.theme??k}getEffectiveCodeOptions(){let e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getFileRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0){let e=this.workerManager.getFileRenderOptions();return this.editSessionActive&&e.useTokenTransformer!==!0?{...e,useTokenTransformer:!0}:e}let{tokenizeMaxLineLength:e=1e3}=this.options;return{theme:this.getLocalHighlightTheme(),useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:e}})(),{renderCache:n}=this;return n?.result==null||!Ot(e,n.file)||!Xf(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getOrCreateLineCache(e){this.invalidateChangedUnkeyedFile(e);let{lineCache:t}=this;return(t==null||!Xp(t,e))&&(t={cacheKey:e.cacheKey,file:e,sourceContents:e.contents,lines:Vp(e.contents)}),this.lineCache=t,t.lines}getLineCount(e){let t=this.getOrCreateLineCache(e);return this.textDocumentCache.get(e)?.lineCount??t.length}updateRenderCache(e,t,n=!1){if(this.pendingStructuralRows=void 0,this.renderCache==null)return;let{file:r,result:i}=this.renderCache;if(i==null)return;let a=n?new Map:void 0;this.pendingStructuralRows=a;let o=this.lineCache!=null&&Xp(this.lineCache,r)?this.lineCache:void 0;for(let[t,n]of e){if(a===void 0&&o!=null&&te[2]).join(``);o.lines[t]=qp(o.lines[t]??``,e)}let e={type:`element`,tagName:`div`,properties:{"data-line":t+1,"data-line-type":`context`,"data-line-index":t},children:n.map(([e,t,n])=>e===0&&t===``?n===``?{type:`element`,tagName:`br`,properties:{},children:[]}:{type:`text`,value:n}:{type:`element`,tagName:`span`,properties:{"data-char":e,style:`color:${t};`},children:[{type:`text`,value:n}]})};a===void 0?i.code[t]=e:a.set(t,e)}i.baseThemeType=t,this.renderCache.isDirty=!0}applyDocumentChange(e){let t=this.pendingStructuralRows;if(this.pendingStructuralRows=void 0,this.renderCache==null)return;let{file:n,result:r}=this.renderCache;if(r==null)return;let i=this.lineCache!=null&&Xp(this.lineCache,n)?this.lineCache.lines:Vp(n.contents),a=Vp(e.getText());if(i.length!==a.length){let n=Math.min(i.length,a.length),o=0;for(;o0,s=!o||Yp(e)||$p(a.length,this.getTokenizeMaxLength()),c=!Ot(e,this.renderCache.file),l=!Zf(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0)(s||this.renderCache.result==null||!this.renderCache.highlighted&&(c||l))&&(this.renderCache.file=e,this.renderCache.options=n,this.renderCache.highlighted=!1,(this.renderCache.result==null||c||l||r)&&(this.renderCache.result=this.workerManager.getPlainFileAST(e,t.startingLine,t.totalLines,a)),this.renderCache.renderRange=t),!s&&o&&(!this.renderCache.highlighted||r)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??Q(e.name);let t=this.highlighter!=null&&Jf(n.theme),i=this.highlighter!=null&&ca(this.computedLang),a=!s&&i;if(this.highlighter!=null&&t&&(r||s||!this.renderCache.highlighted&&a||this.renderCache.result==null)){let{result:t,options:n}=this.renderFileWithHighlighter(e,this.highlighter,s||!i);this.renderCache={file:e,options:n,highlighted:a,result:t,renderRange:void 0}}(!t||!s&&!i)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.applyHighlightResult(e,t,n,!s)})}return this.renderCache.result==null?void 0:this.processFileResult(this.renderCache.file,t,this.renderCache.result)}async asyncRender(e,t=se){let{result:n}=await this.asyncHighlight(e);return this.processFileResult(e,t,n)}async asyncHighlight(e){let t=$p(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??Q(e.name);let n=this.highlighter!=null&&Yf(qf(this.getLocalHighlightTheme())),r=t||this.highlighter!=null&&ca(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter,t)}renderFileWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e);return{result:Up(e,t,r,{forcePlainText:n}),options:r}}processFileResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let a=this.getLineCount(e),{disableFileHeader:o=!1}=this.options,s=[],c=Mt(),l=Math.min(t.startingLine+t.totalLines,a),u=0,d=Kp(t)?Gp(this.lineAnnotations):void 0;d!=null&&(c.children.push(P(`context`,`annotation`,1)),s.push(Qf({type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:d.map(e=>cp(e))})),u++);for(let r=t.startingLine;rcp(e))})),u++)}return c.properties.style=`grid-row: span ${u}`,{gutterAST:c.children??[],contentAST:s,preAST:this.createPreElement(a),headerAST:o?void 0:this.renderHeader(e),totalLines:a,rowCount:u,themeStyles:r,baseThemeType:i,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderHeader(e){let{headerRenderMode:t=`default`,stickyHeader:n=!1}=this.options;return ep({fileOrDiff:e,mode:t,stickyHeader:n})}renderFullHTML(e){return H(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push(N({tagName:`code`,children:this.renderCodeAST(e),properties:{"data-code":``}})),{...e.preAST,children:t}}renderCodeAST(e){let t=Mt();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,Jp(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return H(t?N({tagName:`code`,children:e,properties:{"data-code":``}}):e)}async initializeHighlighter(){return this.highlighter=await Wf(sp(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}onHighlightSuccess(e,t,n,r=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,r)}applyHighlightResult(e,t,n,r=!0){if(this.renderCache==null)return;let i=!Ot(e,this.renderCache.file)||!this.renderCache.highlighted||!Xf(n,this.renderCache.options);this.renderCache={file:e,options:n,highlighted:r,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;let n=this.workerManager?.getFileResultCache(e);if(!(n==null||!Xf(t,n.options)))return n}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&Ot(e,n.file)&&Xf(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}createPreElement(e){let{disableLineNumbers:t=!1,overflow:n=`scroll`}=this.options;return rp({type:`file`,diffIndicators:`none`,disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function $p(e,t){return e>t}var em=``;function tm(e,t){return e.lineNumber===t.lineNumber&&e.metadata===t.metadata}function nm(e,t){return e==null||t==null?e===t:im(e.customProperties,t.customProperties)&&e.type===t.type&&e.diffIndicators===t.diffIndicators&&e.disableBackground===t.disableBackground&&e.disableLineNumbers===t.disableLineNumbers&&e.overflow===t.overflow&&e.split===t.split&&e.totalLines===t.totalLines}var rm={};function im(e=rm,t=rm){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}function am(e){let t=document.createElement(`div`);return t.dataset.annotationSlot=``,t.slot=e,t.style.whiteSpace=`normal`,t}function om(){let e=document.createElement(`div`);return e.slot=`gutter-utility-slot`,e.style.position=`absolute`,e.style.top=`0`,e.style.bottom=`0`,e.style.textAlign=`center`,e.style.whiteSpace=`normal`,e.style.touchAction=`none`,e}function sm(){let e=document.createElement(`style`);return e.setAttribute(re,``),e}var cm=`@layer base {
+ :host {
+ --diffs-font-fallback: "SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono",
+ "Courier New", monospace;
+ --diffs-header-font-fallback: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
+ "Noto Sans", "Liberation Sans", Arial, sans-serif;
+ --diffs-mixer: light-dark(#000, #fff);
+ --diffs-gap-fallback: 8px;
+ --diffs-scrollbar-gutter-fallback: 6px;
+ --diffs-scrollbar-gutter: var(--diffs-scrollbar-gutter-override, var(--diffs-scrollbar-gutter-measured, var(--diffs-scrollbar-gutter-fallback)));
+ --diffs-added-light: #0dbe4e;
+ --diffs-added-dark: #5ecc71;
+ --diffs-modified-light: #009fff;
+ --diffs-modified-dark: #69b1ff;
+ --diffs-deleted-light: #ff2e3f;
+ --diffs-deleted-dark: #ff6762;
+ --diffs-warning-light: #d5a910;
+ --diffs-warning-dark: #ffd452;
+ color-scheme: light dark;
+ font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
+ font-size: var(--diffs-font-size, 13px);
+ line-height: var(--diffs-line-height, 20px);
+ font-feature-settings: var(--diffs-font-features);
+ --diffs-bg: light-dark(var(--diffs-light-bg, #fff), var(--diffs-dark-bg, #000));
+ --diffs-bg-buffer: var(--diffs-bg-buffer-override, light-dark(color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer))));
+ --diffs-bg-context: var(--diffs-bg-context-override, light-dark(color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer))));
+ --diffs-bg-context-gutter: var(--diffs-bg-context-gutter-override, light-dark(color-mix(in lab, var(--diffs-bg-context) 90%, var(--diffs-bg)), color-mix(in lab, var(--diffs-bg-context) 45%, var(--diffs-bg))));
+ --diffs-bg-separator: var(--diffs-bg-separator-override, light-dark(color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer))));
+ --diffs-fg: light-dark(var(--diffs-light, #000), var(--diffs-dark, #fff));
+ --diffs-fg-number: var(--diffs-fg-number-override, light-dark(color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)), color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg))));
+ --diffs-fg-conflict-marker: var(--diffs-fg-conflict-marker-override, var(--diffs-fg-number));
+ --diffs-deletion-base: var(--diffs-deletion-color-override, light-dark(var(--diffs-light-deletion-color, var(--diffs-deletion-color, var(--diffs-deleted-light))), var(--diffs-dark-deletion-color, var(--diffs-deletion-color, var(--diffs-deleted-dark)))));
+ --diffs-addition-base: var(--diffs-addition-color-override, light-dark(var(--diffs-light-addition-color, var(--diffs-addition-color, var(--diffs-added-light))), var(--diffs-dark-addition-color, var(--diffs-addition-color, var(--diffs-added-dark)))));
+ --diffs-modified-base: var(--diffs-modified-color-override, light-dark(var(--diffs-light-modified-color, var(--diffs-modified-color, var(--diffs-modified-light))), var(--diffs-dark-modified-color, var(--diffs-modified-color, var(--diffs-modified-dark)))));
+ --diffs-bg-deletion: var(--diffs-bg-deletion-override, light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base))));
+ --diffs-bg-deletion-emphasis: var(--diffs-bg-deletion-emphasis-override, light-dark(rgb(from var(--diffs-deletion-base) r g b / .15), rgb(from var(--diffs-deletion-base) r g b / .2)));
+ --diffs-bg-addition: var(--diffs-bg-addition-override, light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base))));
+ --diffs-bg-addition-emphasis: var(--diffs-bg-addition-emphasis-override, light-dark(rgb(from var(--diffs-addition-base) r g b / .15), rgb(from var(--diffs-addition-base) r g b / .2)));
+ --diffs-selection-base: var(--diffs-modified-base);
+ --diffs-selection-number-fg: light-dark(color-mix(in lab, var(--diffs-selection-base) 65%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-selection-base) 75%, var(--diffs-mixer)));
+ background-color: var(--diffs-bg);
+ color: var(--diffs-fg);
+ display: block;
+ }
+
+ pre, code, [data-error-wrapper] {
+ isolation: isolate;
+ font-family: var(--diffs-font-family, var(--diffs-font-fallback));
+ outline: none;
+ margin: 0;
+ padding: 0;
+ display: block;
+ }
+
+ pre, code {
+ background-color: var(--diffs-bg);
+ }
+
+ code {
+ contain: content;
+ }
+
+ input, button {
+ font-family: inherit;
+ font-size: inherit;
+ line-height: inherit;
+ }
+
+ *, :before, :after {
+ box-sizing: border-box;
+ }
+
+ [data-icon-sprite] {
+ display: none;
+ }
+
+ [data-diffs-header], [data-separator] {
+ font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
+ }
+
+ [data-diffs-header][data-sticky] {
+ z-index: 1;
+ background-color: var(--diffs-bg);
+ position: sticky;
+ top: 0;
+ }
+
+ [data-file-info] {
+ color: var(--fg);
+ background-color: color-mix(in lab, var(--bg) 98%, var(--fg));
+ border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg));
+ padding: 10px;
+ font-weight: 700;
+ }
+
+ [data-diff], [data-file] {
+ --diffs-grid-number-column-width: minmax(min-content, max-content);
+ --diffs-code-grid: var(--diffs-grid-number-column-width) 1fr;
+
+ &[data-dehydrated] {
+ --diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr);
+ }
+
+ &:hover [data-code]::-webkit-scrollbar-thumb {
+ background-color: var(--diffs-bg-context);
+ }
+ }
+
+ @supports (-webkit-touch-callout: none) {
+ :host {
+ --diffs-scrollbar-gutter-fallback: 0px;
+ }
+ }
+
+ [data-line] span {
+ color: light-dark(var(--diffs-token-light, var(--diffs-light)), var(--diffs-token-dark, var(--diffs-dark)));
+ background-color: light-dark(var(--diffs-token-light-bg, inherit), var(--diffs-token-dark-bg, inherit));
+ font-weight: light-dark(var(--diffs-token-light-font-weight, inherit), var(--diffs-token-dark-font-weight, inherit));
+ font-style: light-dark(var(--diffs-token-light-font-style, inherit), var(--diffs-token-dark-font-style, inherit));
+ text-decoration: light-dark(var(--diffs-token-light-text-decoration, inherit), var(--diffs-token-dark-text-decoration, inherit));
+ }
+
+ [data-line], [data-gutter-buffer], [data-column-number], [data-line-annotation], [data-no-newline], [data-merge-conflict], [data-merge-conflict-actions], [data-editor-overlay] {
+ --diffs-computed-decoration-bg: var(--diffs-bg);
+ --diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg);
+ --diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
+ --diffs-computed-editor-active-line-bg: var(--diffs-computed-selected-line-bg);
+ --diffs-computed-hovered-line-bg: var(--diffs-computed-editor-active-line-bg);
+ --diffs-hover-mix-target: var(--diffs-bg-hover-override, var(--diffs-mixer));
+ --diffs-line-bg: var(--diffs-computed-hovered-line-bg);
+ color: var(--diffs-fg);
+ background-color: var(--diffs-line-bg, var(--diffs-bg));
+ }
+
+ [data-line], [data-no-newline] {
+ &[data-decoration-bg] {
+ --mix-deco-light: 92%;
+ --mix-deco-dark: 85%;
+
+ &[data-decoration-bg-depth="2"] {
+ --mix-deco-light: 88%;
+ --mix-deco-dark: 80%;
+ }
+
+ &[data-decoration-bg-depth="3"] {
+ --mix-deco-light: 85%;
+ --mix-deco-dark: 78%;
+ }
+
+ --diffs-hover-mix-target: var(--diffs-decoration-bg);
+ --diffs-computed-decoration-bg: light-dark(color-mix(in lab,
+ var(--diffs-bg) var(--mix-deco-light),
+ var(--diffs-decoration-bg)), color-mix(in lab,
+ var(--diffs-bg) var(--mix-deco-dark),
+ var(--diffs-decoration-bg)));
+ }
+ }
+
+ [data-line-annotation], [data-gutter-buffer="annotation"] {
+ --diffs-annotation-bg: var(--diffs-bg-context);
+ --diffs-computed-decoration-bg: var(--diffs-annotation-bg);
+ --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
+ }
+
+ [data-merge-conflict-actions], [data-gutter-buffer="merge-conflict-action"], [data-gutter-buffer="merge-conflict-marker-base"], [data-gutter-buffer="merge-conflict-marker-separator"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"] {
+ --diffs-computed-decoration-bg: var(--diffs-bg-context);
+ --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
+ }
+
+ [data-gutter-buffer="merge-conflict-marker-start"], [data-merge-conflict="marker-start"] {
+ --diffs-computed-decoration-bg: light-dark(color-mix(in lab,
+ var(--diffs-bg) 78%,
+ var(--conflict-bg-current-header-override, var(--diffs-addition-base))), color-mix(in lab,
+ var(--diffs-bg) 68%,
+ var(--conflict-bg-current-header-override, var(--diffs-addition-base))));
+ --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
+ }
+
+ [data-gutter-buffer="merge-conflict-marker-end"], [data-merge-conflict="marker-end"] {
+ --diffs-computed-decoration-bg: light-dark(color-mix(in lab,
+ var(--diffs-bg) 78%,
+ var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))), color-mix(in lab,
+ var(--diffs-bg) 68%,
+ var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))));
+ --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
+ }
+
+ [data-has-merge-conflict] [data-line-annotation], [data-has-merge-conflict] [data-gutter-buffer="annotation"] {
+ --diffs-computed-decoration-bg: var(--diffs-bg);
+ --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
+ }
+
+ :where([data-background]) {
+ & [data-gutter-buffer], & [data-column-number] {
+ --mix-light: 91%;
+ --mix-dark: 85%;
+ }
+
+ & [data-line], & [data-no-newline] {
+ --mix-light: 88%;
+ --mix-dark: 80%;
+ }
+
+ & [data-gutter-buffer], & [data-column-number], & [data-line], & [data-no-newline] {
+ --diffs-diff-line-mix-target: var(--diffs-bg);
+
+ &[data-line-type="change-deletion"] {
+ --diffs-diff-line-mix-target: var(--diffs-bg-deletion-override, var(--diffs-deletion-base));
+ --diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
+
+ &:where([data-gutter-buffer], [data-column-number]) {
+ color: var(--diffs-fg-number-deletion-override, var(--diffs-deletion-base));
+ --diffs-diff-line-mix-target: var(--diffs-bg-deletion-number-override, var(--diffs-deletion-base));
+ }
+
+ --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
+ var(--diffs-computed-decoration-bg) var(--mix-light),
+ var(--diffs-diff-line-mix-target)), color-mix(in lab,
+ var(--diffs-computed-decoration-bg) var(--mix-dark),
+ var(--diffs-diff-line-mix-target)));
+ }
+
+ &[data-line-type="change-addition"] {
+ --diffs-diff-line-mix-target: var(--diffs-bg-addition-override, var(--diffs-addition-base));
+ --diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
+
+ &:where([data-gutter-buffer], [data-column-number]) {
+ color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
+ --diffs-diff-line-mix-target: var(--diffs-bg-addition-number-override, var(--diffs-addition-base));
+ }
+
+ --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
+ var(--diffs-computed-decoration-bg) var(--mix-light),
+ var(--diffs-diff-line-mix-target)), color-mix(in lab,
+ var(--diffs-computed-decoration-bg) var(--mix-dark),
+ var(--diffs-diff-line-mix-target)));
+ }
+
+ &[data-merge-conflict="current"] {
+ --diffs-diff-line-mix-target: var(--conflict-bg-current-override, var(--diffs-addition-base));
+ --diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
+
+ &:where([data-gutter-buffer], [data-column-number]) {
+ color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
+ --diffs-diff-line-mix-target: var(--conflict-bg-current-number-override, var(--diffs-addition-base));
+ }
+
+ --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
+ var(--diffs-computed-decoration-bg) var(--mix-light),
+ var(--diffs-diff-line-mix-target)), color-mix(in lab,
+ var(--diffs-computed-decoration-bg) var(--mix-dark),
+ var(--diffs-diff-line-mix-target)));
+ }
+
+ &[data-merge-conflict="incoming"] {
+ --diffs-diff-line-mix-target: var(--conflict-bg-incoming-override, var(--diffs-modified-base));
+ --diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
+
+ &:where([data-gutter-buffer], [data-column-number]) {
+ color: var(--diffs-modified-base);
+ --diffs-diff-line-mix-target: var(--conflict-bg-incoming-number-override, var(--diffs-modified-base));
+ }
+
+ --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
+ var(--diffs-computed-decoration-bg) var(--mix-light),
+ var(--diffs-diff-line-mix-target)), color-mix(in lab,
+ var(--diffs-computed-decoration-bg) var(--mix-dark),
+ var(--diffs-diff-line-mix-target)));
+ }
+ }
+ }
+
+ [data-gutter-buffer], [data-column-number], [data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline], [data-editor-overlay] {
+ --diffs-selection-mix-target: var(--diffs-bg-selection-override, var(--diffs-selection-base));
+ --diffs-selection-emphasis-mix-target: var(--diffs-selection-mix-target);
+
+ &:where([data-editor-overlay]), &:where([data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline])[data-selected-line] {
+ --mix-selection-light: 82%;
+ --mix-selection-dark: 75%;
+ --diffs-hover-mix-target: var(--diffs-selection-mix-target);
+ }
+
+ &:where([data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line])) {
+ --mix-selection-light: 75%;
+ --mix-selection-dark: 60%;
+ --diffs-selection-mix-target: var(--diffs-bg-selection-number-override, var(--diffs-selection-base));
+ --diffs-hover-mix-target: var(--diffs-selection-mix-target);
+ }
+
+ &:where([data-line][data-selected-line]):is([data-line-type="change-addition"], [data-line-type="change-deletion"]) {
+ --diffs-selection-emphasis-mix-target: light-dark(color-mix(in lab,
+ var(--diffs-diff-line-mix-target, var(--diffs-selection-mix-target))
+ var(--mix-selection-light),
+ var(--diffs-selection-mix-target)), var(--diffs-selection-mix-target));
+ }
+
+ &:where([data-editor-overlay]), &[data-selected-line] {
+ --diffs-computed-selected-line-bg: light-dark(color-mix(in lab,
+ var(--diffs-computed-diff-line-bg) var(--mix-selection-light),
+ var(--diffs-selection-mix-target)), color-mix(in lab,
+ var(--diffs-computed-diff-line-bg) var(--mix-selection-dark),
+ var(--diffs-selection-mix-target)));
+ }
+ }
+
+ [data-line][data-editor-active-line], [data-column-number][data-editor-active-line] {
+ --diffs-computed-editor-active-line-bg: color-mix(in lab,
+ var(--diffs-computed-selected-line-bg)
+ var(--diffs-editor-active-line-source-mix, 100%),
+ var(--diffs-selection-emphasis-mix-target));
+ }
+
+ @media (pointer: fine) {
+ [data-line][data-hovered], [data-gutter-buffer][data-hovered], [data-column-number][data-hovered], [data-line-annotation][data-hovered], [data-no-newline][data-hovered], [data-merge-conflict][data-hovered], [data-merge-conflict-actions][data-hovered], [data-editor-overlay][data-hovered] {
+ --diffs-computed-hovered-line-bg: light-dark(color-mix(in lab,
+ var(--diffs-computed-editor-active-line-bg) 97%,
+ var(--diffs-hover-mix-target)), color-mix(in lab,
+ var(--diffs-computed-editor-active-line-bg) 91%,
+ var(--diffs-hover-mix-target)));
+ }
+ }
+
+ [data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line]) {
+ color: var(--diffs-selection-number-fg);
+ }
+
+ [data-no-newline] {
+ user-select: none;
+
+ & span {
+ opacity: .6;
+ }
+ }
+
+ [data-diff-type="split"][data-overflow="scroll"] {
+ grid-template-columns: 1fr 1fr;
+ display: grid;
+
+ & [data-additions] {
+ border-left: 1px solid var(--diffs-bg);
+ }
+
+ & [data-deletions] {
+ border-right: 1px solid var(--diffs-bg);
+ }
+ }
+
+ [data-code] {
+ grid-auto-flow: dense;
+ grid-template-columns: var(--diffs-code-grid);
+ overflow: var(--diffs-overflow-override, scroll) clip;
+ overscroll-behavior-x: none;
+ tab-size: var(--diffs-tab-size, 2);
+ padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback));
+ padding-bottom: max(0px,
+ calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) -
+ var(--diffs-scrollbar-gutter)));
+ scrollbar-gutter: stable;
+ align-self: flex-start;
+ display: grid;
+ }
+
+ [data-diffs-scrollbar-measure] {
+ opacity: 0;
+ pointer-events: none;
+ scrollbar-gutter: auto;
+ grid-template-columns: none;
+ width: 100px;
+ height: 100px;
+ padding: 0;
+ position: absolute;
+ top: -200px;
+ left: -200px;
+ }
+
+ [data-container-size] {
+ container-type: inline-size;
+ }
+
+ [data-code]::-webkit-scrollbar {
+ width: 0;
+ height: var(--diffs-scrollbar-gutter);
+ }
+
+ [data-code]::-webkit-scrollbar-track {
+ background: none;
+ }
+
+ [data-code]::-webkit-scrollbar-thumb {
+ background-color: #0000;
+ background-clip: content-box;
+ border: 1px solid #0000;
+ border-radius: 3px;
+ }
+
+ [data-code]::-webkit-scrollbar-corner {
+ background-color: #0000;
+ }
+
+ @supports ((-moz-appearance: none)) {
+ [data-code] {
+ scrollbar-width: thin;
+ scrollbar-color: var(--diffs-bg-context) transparent;
+ padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback));
+ }
+ }
+
+ [data-diffs-header] ~ [data-diff], [data-diffs-header] ~ [data-file] {
+ & [data-code], &[data-overflow="wrap"], &[data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
+ padding-top: 0;
+ }
+ }
+
+ [data-gutter] {
+ grid-template-rows: subgrid;
+ grid-template-columns: subgrid;
+ z-index: 3;
+ background-color: var(--diffs-bg);
+ grid-column: 1;
+ display: grid;
+ position: relative;
+
+ & [data-gutter-buffer], & [data-column-number] {
+ border-right: var(--diffs-gap-style, 2px solid var(--diffs-bg));
+ }
+ }
+
+ [data-content] {
+ grid-template-rows: subgrid;
+ grid-template-columns: subgrid;
+ background-color: var(--diffs-bg);
+ grid-column: 2;
+ min-width: 0;
+ display: grid;
+ }
+
+ [data-diff-type="split"][data-overflow="wrap"], [data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
+ grid-auto-flow: dense;
+ grid-template-columns: repeat(2, var(--diffs-code-grid));
+ padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
+ display: grid;
+
+ & [data-code] {
+ display: contents;
+ }
+
+ & [data-deletions] {
+ & [data-gutter] {
+ grid-column: 1;
+ }
+
+ & [data-content] {
+ border-right: 1px solid var(--diffs-bg);
+ grid-column: 2;
+ }
+ }
+
+ & [data-additions] {
+ & [data-gutter] {
+ border-left: 1px solid var(--diffs-bg);
+ grid-column: 3;
+ }
+
+ & [data-content] {
+ grid-column: 4;
+ }
+ }
+ }
+
+ [data-dehydrated][data-diff-type="split"][data-overflow="scroll"] [data-content] {
+ overflow: clip;
+ }
+
+ [data-overflow="scroll"] [data-gutter] {
+ position: sticky;
+ left: 0;
+ }
+
+ [data-interactive-lines] [data-line] {
+ cursor: pointer;
+ }
+
+ [data-interactive-line-numbers] [data-column-number] {
+ cursor: pointer;
+ touch-action: none;
+ }
+
+ [data-content-buffer], [data-gutter-buffer] {
+ user-select: none;
+ min-height: 1lh;
+ position: relative;
+ }
+
+ [data-gutter-buffer] {
+ padding-left: 2ch;
+ padding-right: 1ch;
+
+ &:before {
+ content: "";
+ min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
+ display: block;
+ }
+ }
+
+ [data-gutter-buffer="annotation"] {
+ --diffs-annotation-bg: var(--diffs-bg-context-gutter);
+ min-height: 0;
+ }
+
+ [data-gutter-buffer="buffer"] {
+ --diffs-line-bg: var(--diffs-bg-context-gutter);
+ }
+
+ [data-content-buffer] {
+ background-position: 5px 0;
+ background-size: 8px 8px;
+ background-origin: border-box;
+ background-image: repeating-linear-gradient(-45deg,
+ transparent,
+ transparent calc(3px * 1.414),
+ var(--diffs-bg-buffer) calc(3px * 1.414),
+ var(--diffs-bg-buffer) calc(4px * 1.414));
+ grid-column: 1;
+ }
+
+ [data-separator] {
+ box-sizing: content-box;
+ background-color: var(--diffs-bg);
+ }
+
+ [data-separator="simple"] {
+ min-height: 4px;
+ }
+
+ [data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"], [data-separator="simple"] {
+ background-color: var(--diffs-bg-separator);
+ }
+
+ [data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"] {
+ height: 32px;
+ position: relative;
+ }
+
+ [data-separator-wrapper] {
+ user-select: none;
+ fill: currentColor;
+ background-color: var(--diffs-bg);
+ align-items: center;
+ height: 100%;
+ display: flex;
+ position: absolute;
+ inset-inline: 0;
+ }
+
+ [data-content] [data-separator-wrapper] {
+ display: none;
+ }
+
+ [data-separator="metadata"] [data-separator-wrapper] {
+ background-color: var(--diffs-bg-separator);
+ height: 100%;
+ color: var(--diffs-fg-number);
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ min-width: min-content;
+ padding-inline: 1ch;
+ inset-inline: 100% auto;
+ overflow: hidden;
+ }
+
+ [data-separator="line-info"] {
+ margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
+
+ & [data-separator-wrapper] {
+ min-width: 16px;
+ }
+ }
+
+ [data-separator="line-info-basic"], [data-separator="metadata"] {
+ margin-block: 0;
+ }
+
+ [data-separator="line-info"][data-separator-first] {
+ margin-top: 0;
+ }
+
+ [data-separator="line-info"][data-separator-last] {
+ margin-bottom: 0;
+ }
+
+ [data-expand-index] [data-separator-wrapper] {
+ grid-template-columns: 32px auto;
+ display: grid;
+ }
+
+ [data-expand-index] [data-separator-wrapper][data-separator-multi-button] {
+ grid-template-columns: 32px 32px auto;
+ }
+
+ [data-expand-button], [data-separator-content] {
+ background-color: var(--diffs-bg-separator);
+ flex: none;
+ align-items: center;
+ display: flex;
+ }
+
+ [data-expand-index] [data-separator-content]:hover {
+ cursor: pointer;
+ text-decoration: underline;
+ }
+
+ [data-expand-button] {
+ cursor: pointer;
+ min-width: 32px;
+ color: var(--diffs-fg-number);
+ border-right: 2px solid var(--diffs-bg);
+ flex-shrink: 0;
+ justify-content: center;
+ align-self: stretch;
+
+ &:hover {
+ color: var(--diffs-fg);
+ }
+
+ &[data-expand-all-button] {
+ display: none;
+ }
+ }
+
+ [data-expand-down] [data-icon] {
+ transform: scaleY(-1);
+ }
+
+ [data-separator-content] {
+ height: 100%;
+ color: var(--diffs-fg-number);
+ flex: auto;
+ justify-content: flex-start;
+ padding: 0 1ch;
+ overflow: hidden;
+ }
+
+ [data-separator="line-info"], [data-separator="line-info-basic"] {
+ & [data-separator-content] {
+ user-select: none;
+ height: 100%;
+ overflow: clip;
+ }
+ }
+
+ [data-unmodified-lines] {
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ flex: 0 auto;
+ min-width: 0;
+ display: block;
+ overflow: hidden;
+ }
+
+ @supports (width: 1cqi) {
+ [data-unified] {
+ & [data-separator="line-info"] [data-separator-wrapper] {
+ padding-inline: var(--diffs-gap-inline, var(--diffs-gap-fallback));
+ width: 100cqi;
+
+ & [data-separator-content] {
+ border-radius: 6px;
+ }
+ }
+
+ & [data-separator="line-info"][data-expand-index] [data-separator-wrapper] [data-separator-content] {
+ border-top-left-radius: unset;
+ border-bottom-left-radius: unset;
+ }
+ }
+
+ [data-gutter] {
+ & [data-separator="line-info"] [data-separator-wrapper] {
+ padding-left: var(--diffs-gap-inline, var(--diffs-gap-fallback));
+ }
+
+ & [data-separator="line-info"] [data-separator-content] {
+ border-top-left-radius: 6px;
+ border-bottom-left-radius: 6px;
+ }
+
+ & [data-separator="line-info"][data-expand-index] [data-separator-content] {
+ border-top-left-radius: unset;
+ border-bottom-left-radius: unset;
+ }
+ }
+
+ [data-additions] {
+ & [data-content] [data-separator="line-info"] {
+ background-color: var(--diffs-bg);
+
+ & [data-separator-wrapper] {
+ display: none;
+ }
+ }
+
+ & [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
+ background-color: var(--diffs-bg-separator);
+ border-top-right-radius: 6px;
+ border-bottom-right-radius: 6px;
+ height: 100%;
+ display: block;
+
+ & [data-separator-content], & [data-expand-button] {
+ display: none;
+ }
+ }
+ }
+
+ [data-overflow="scroll"] [data-additions] [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
+ width: calc(100cqi - var(--diffs-gap-inline, var(--diffs-gap-fallback)));
+ }
+
+ [data-overflow="wrap"] [data-additions] [data-content] [data-separator="line-info"] [data-separator-wrapper] {
+ background-color: var(--diffs-bg-separator);
+ height: 100%;
+ margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback));
+ border-top-right-radius: 6px;
+ border-bottom-right-radius: 6px;
+ display: block;
+
+ & [data-separator-content], & [data-expand-button] {
+ display: none;
+ }
+ }
+
+ [data-separator="line-info"] [data-separator-wrapper] {
+ & [data-expand-both], & [data-expand-down], & [data-expand-up] {
+ border-top-left-radius: 6px;
+ border-bottom-left-radius: 6px;
+ }
+ }
+
+ @media (pointer: fine) {
+ [data-separator="line-info"] [data-separator-wrapper] {
+ &[data-separator-multi-button] {
+ & [data-expand-up] {
+ border-top-left-radius: 6px;
+ border-bottom-left-radius: unset;
+ }
+
+ & [data-expand-down] {
+ border-bottom-left-radius: 6px;
+ border-top-left-radius: unset;
+ }
+ }
+ }
+ }
+ }
+
+ @media (pointer: coarse) {
+ [data-separator="line-info-basic"] [data-separator-wrapper][data-separator-multi-button] {
+ grid-template-columns: 34px 34px auto;
+
+ & [data-separator-content] {
+ grid-column: unset;
+ grid-row: unset;
+ }
+ }
+
+ @supports (width: 1cqi) {
+ [data-separator="line-info"] [data-separator-wrapper] {
+ & [data-expand-both], & [data-expand-down], & [data-expand-up] {
+ border-top-left-radius: 6px;
+ border-bottom-left-radius: 6px;
+ }
+
+ &[data-separator-multi-button] {
+ & [data-expand-up] {
+ border-top-left-radius: 6px;
+ border-bottom-left-radius: 6px;
+ }
+
+ & [data-expand-down] {
+ border-bottom-left-radius: unset;
+ border-top-left-radius: unset;
+ }
+ }
+ }
+ }
+ }
+
+ @media (pointer: fine) {
+ [data-separator-wrapper][data-separator-multi-button] {
+ grid-template-rows: 50% 50%;
+ display: grid;
+
+ & [data-separator-content] {
+ grid-area: 1 / 2 / -1;
+ min-width: min-content;
+ }
+
+ & [data-expand-button] {
+ grid-column: 1;
+ }
+ }
+
+ [data-separator="line-info"] [data-separator-wrapper], [data-separator="line-info"] [data-separator-wrapper][data-separator-multi-button] {
+ grid-template-columns: 34px auto;
+ }
+
+ [data-separator="line-info-basic"][data-expand-index] [data-separator-wrapper] {
+ grid-template-columns: 100% auto;
+ }
+
+ [data-separator="line-info"], [data-separator="line-info-basic"] {
+ & [data-separator-multi-button] {
+ & [data-expand-up] {
+ border-bottom: 1px solid var(--diffs-bg);
+ border-right: 2px solid var(--diffs-bg);
+ }
+
+ & [data-expand-down] {
+ border-top: 1px solid var(--diffs-bg);
+ border-right: 2px solid var(--diffs-bg);
+ }
+ }
+ }
+ }
+
+ [data-additions] [data-gutter] [data-separator-wrapper], [data-additions] [data-separator="line-info-basic"] [data-separator-wrapper], [data-content] [data-separator-wrapper] {
+ display: none;
+ }
+
+ [data-line-annotation] {
+ min-height: var(--diffs-annotation-min-height, 0);
+ z-index: 2;
+ }
+
+ [data-merge-conflict-actions] {
+ z-index: 2;
+ }
+
+ [data-separator="custom"] {
+ grid-template-columns: subgrid;
+ display: grid;
+ }
+
+ [data-line], [data-column-number], [data-no-newline] {
+ padding-inline: 1ch;
+ position: relative;
+ }
+
+ [data-indicators="classic"] [data-line] {
+ padding-inline-start: 2ch;
+ }
+
+ [data-indicators="classic"] {
+ & [data-line-type="change-addition"], & [data-line-type="change-deletion"] {
+ &[data-no-newline], &[data-line] {
+ &:before {
+ user-select: none;
+ width: 1ch;
+ height: 1lh;
+ display: inline-block;
+ position: absolute;
+ top: 0;
+ left: 0;
+ }
+ }
+ }
+
+ & [data-line-type="change-addition"] {
+ &[data-line], &[data-no-newline] {
+ &:before {
+ content: "+";
+ color: var(--diffs-addition-base);
+ }
+ }
+ }
+
+ & [data-line-type="change-deletion"] {
+ &[data-line], &[data-no-newline] {
+ &:before {
+ content: "-";
+ color: var(--diffs-deletion-base);
+ }
+ }
+ }
+ }
+
+ [data-indicators="bars"] {
+ & [data-line-type="change-deletion"], & [data-line-type="change-addition"] {
+ &[data-column-number] {
+ &:before {
+ content: "";
+ user-select: none;
+ contain: strict;
+ width: 4px;
+ height: 100%;
+ display: block;
+ position: absolute;
+ top: 0;
+ left: 0;
+ }
+ }
+ }
+
+ & [data-line-type="change-deletion"] {
+ &[data-column-number] {
+ &:before {
+ background-image: linear-gradient(0deg,
+ var(--diffs-bg-deletion) 50%,
+ var(--diffs-deletion-base) 50%);
+ background-repeat: repeat;
+ background-size: 2px 2px;
+ background-size: calc(1lh / round(1lh / 2px))
+ calc(1lh / round(1lh / 2px));
+ }
+ }
+ }
+
+ & [data-line-type="change-addition"] {
+ &[data-column-number] {
+ &:before {
+ background-color: var(--diffs-addition-base);
+ }
+ }
+ }
+ }
+
+ [data-overflow="wrap"] {
+ & [data-line] {
+ white-space: pre-wrap;
+ word-break: break-word;
+ }
+
+ & [data-annotation-content] {
+ word-break: break-word;
+ }
+ }
+
+ [data-overflow="scroll"] [data-line] {
+ white-space: pre;
+ min-height: 1lh;
+ }
+
+ [data-column-number] {
+ box-sizing: content-box;
+ text-align: right;
+ user-select: none;
+ color: var(--diffs-fg-number);
+ padding-left: 2ch;
+ }
+
+ [data-line-number-content] {
+ min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
+ z-index: 1;
+ display: inline-block;
+ position: relative;
+ }
+
+ [data-disable-line-numbers] {
+ & [data-gutter-buffer], & [data-column-number] {
+ min-width: 4px;
+ padding: 0;
+
+ &:before {
+ min-width: 0;
+ }
+ }
+
+ & [data-line-number-content] {
+ display: none;
+ }
+
+ & [data-gutter-utility-slot] {
+ right: unset;
+ justify-content: flex-start;
+ left: 0;
+ }
+
+ &[data-indicators="bars"] [data-gutter-utility-slot] {
+ left: 6px;
+ }
+ }
+
+ [data-file][data-disable-line-numbers] {
+ & [data-gutter-buffer], & [data-column-number] {
+ border-right: 0;
+ min-width: 0;
+ }
+ }
+
+ [data-diff-span] {
+ box-decoration-break: clone;
+ border-radius: 3px;
+ }
+
+ [data-line-type="change-addition"] [data-diff-span] {
+ background-color: var(--diffs-bg-addition-emphasis);
+ }
+
+ [data-line-type="change-deletion"] [data-diff-span] {
+ background-color: var(--diffs-bg-deletion-emphasis);
+ }
+
+ [data-merge-conflict="marker-start"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"], [data-merge-conflict="marker-end"] {
+ color: var(--diffs-fg);
+ padding-left: 1ch;
+ }
+
+ [data-merge-conflict="marker-start"], [data-merge-conflict="marker-end"] {
+ align-items: center;
+ display: flex;
+
+ &:after {
+ color: var(--diffs-fg-conflict-marker);
+ font-size: .75rem;
+ font-style: normal;
+ line-height: 1.25rem;
+ font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
+ padding-left: 1ch;
+ }
+ }
+
+ [data-merge-conflict="marker-start"]:after {
+ content: "(Current Change)";
+ }
+
+ [data-merge-conflict="marker-end"]:after {
+ content: "(Incoming Change)";
+ }
+
+ [data-merge-conflict-actions-content] {
+ min-height: 1.75rem;
+ font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
+ color: var(--diffs-fg);
+ align-items: center;
+ gap: .25rem;
+ padding-inline: .5rem;
+ font-size: .75rem;
+ line-height: 1.2;
+ display: flex;
+ }
+
+ [data-merge-conflict-action] {
+ appearance: none;
+ color: var(--diffs-fg-number);
+ font: inherit;
+ cursor: pointer;
+ background: none;
+ border: 0;
+ padding: 0;
+ font-style: normal;
+ }
+
+ [data-merge-conflict-action]:hover {
+ color: var(--diffs-fg);
+ }
+
+ [data-merge-conflict-action="current"]:hover {
+ color: var(--diffs-addition-base);
+ }
+
+ [data-merge-conflict-action="incoming"]:hover {
+ color: var(--diffs-modified-base);
+ }
+
+ [data-merge-conflict-action-separator] {
+ color: var(--diffs-fg-number);
+ opacity: .6;
+ user-select: none;
+ }
+
+ [data-diffs-header="default"] {
+ background-color: var(--diffs-bg);
+ justify-content: space-between;
+ align-items: center;
+ gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
+ min-height: calc(1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3));
+ z-index: 2;
+ flex-direction: row;
+ padding-inline: 16px;
+ display: flex;
+ position: relative;
+ top: 0;
+ }
+
+ [data-header-content] {
+ align-items: center;
+ gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
+ white-space: nowrap;
+ flex-direction: row;
+ min-width: 0;
+ display: flex;
+ }
+
+ [data-header-content] [data-prev-name], [data-header-content] [data-title] {
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ direction: rtl;
+ min-width: 0;
+ overflow: hidden;
+ }
+
+ [data-prev-name] {
+ opacity: .7;
+ }
+
+ [data-rename-icon] {
+ fill: currentColor;
+ flex-grow: 0;
+ flex-shrink: 0;
+ }
+
+ [data-diffs-header="default"] [data-metadata] {
+ white-space: nowrap;
+ align-items: center;
+ gap: 1ch;
+ display: flex;
+ }
+
+ [data-diffs-header="default"] [data-additions-count] {
+ font-family: var(--diffs-font-family, var(--diffs-font-fallback));
+ color: var(--diffs-addition-base);
+ }
+
+ [data-diffs-header="default"] [data-deletions-count] {
+ font-family: var(--diffs-font-family, var(--diffs-font-fallback));
+ color: var(--diffs-deletion-base);
+ }
+
+ [data-change-icon] {
+ fill: currentColor;
+ flex-shrink: 0;
+ }
+
+ [data-change-icon="change"], [data-change-icon="rename-pure"], [data-change-icon="rename-changed"] {
+ color: var(--diffs-modified-base);
+ }
+
+ [data-change-icon="new"] {
+ color: var(--diffs-addition-base);
+ }
+
+ [data-change-icon="deleted"] {
+ color: var(--diffs-deletion-base);
+ }
+
+ [data-change-icon="file"] {
+ opacity: .6;
+ }
+
+ [data-annotation-content] {
+ z-index: 2;
+ isolation: isolate;
+ white-space: normal;
+ align-self: flex-start;
+ min-width: 0;
+ display: flow-root;
+ position: relative;
+ }
+
+ [data-overflow="scroll"] [data-annotation-content], [data-overflow="scroll"] [data-merge-conflict-actions-content] {
+ width: var(--diffs-column-content-width, auto);
+ left: var(--diffs-column-number-width, 0);
+ position: sticky;
+ }
+
+ [data-annotation-slot] {
+ text-wrap-mode: wrap;
+ word-break: normal;
+ white-space-collapse: collapse;
+ }
+
+ [data-gutter-utility-slot] {
+ touch-action: none;
+ justify-content: flex-end;
+ display: flex;
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ right: 0;
+ }
+
+ [data-utility-button] {
+ appearance: none;
+ cursor: pointer;
+ width: 1lh;
+ height: 1lh;
+ font-size: var(--diffs-font-size, 13px);
+ line-height: var(--diffs-line-height, 20px);
+ background-color: var(--diffs-modified-base);
+ color: var(--diffs-bg);
+ fill: currentColor;
+ z-index: 4;
+ touch-action: none;
+ border: none;
+ border-radius: 4px;
+ justify-content: center;
+ align-items: center;
+ margin-right: calc(-1lh + 1ch);
+ padding: 0;
+ display: flex;
+ position: relative;
+
+ &:before {
+ content: "";
+ display: block;
+ position: absolute;
+ inset: 0 0 0 -4px;
+ }
+ }
+
+ [data-decoration-bar-stack] {
+ pointer-events: none;
+ isolation: isolate;
+ z-index: 1;
+ background-color: var(--diffs-decoration-bar-color, transparent);
+ box-sizing: content-box;
+ border-left: 2px solid var(--diffs-bg);
+ border-right: 2px solid var(--diffs-bg);
+ width: 6px;
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ right: -2px;
+
+ [data-decoration-bar-depth="1"] & {
+ background-color: color-mix(in lab,
+ var(--diffs-bg) 20%,
+ var(--diffs-decoration-bar-color, transparent));
+ }
+
+ [data-decoration-bar-depth="2"] & {
+ background-color: color-mix(in lab,
+ var(--diffs-bg) 45%,
+ var(--diffs-decoration-bar-color, transparent));
+ }
+
+ [data-decoration-bar-depth="3"] & {
+ background-color: color-mix(in lab,
+ var(--diffs-bg) 65%,
+ var(--diffs-decoration-bar-color, transparent));
+ }
+
+ [data-decoration-bar-start] & {
+ border-top-left-radius: 5px;
+ border-top-right-radius: 5px;
+ }
+
+ [data-decoration-bar-end] & {
+ z-index: 3;
+ border-bottom-right-radius: 5px;
+ border-bottom-left-radius: 5px;
+ }
+ }
+
+ [data-placeholder] {
+ contain: strict;
+ }
+
+ [data-error-wrapper] {
+ padding: var(--diffs-gap-block, var(--diffs-gap-fallback))
+ var(--diffs-gap-inline, var(--diffs-gap-fallback));
+ scrollbar-width: none;
+ max-height: 400px;
+ overflow: auto;
+
+ & [data-error-message] {
+ color: var(--diffs-deletion-base);
+ font-size: 18px;
+ font-weight: bold;
+ }
+
+ & [data-error-stack] {
+ color: var(--diffs-fg-number);
+ }
+ }
+}
+
+@layer theme, rendered, unsafe;
+`,lm;function um(e){if(lm!=null)return lm;let t=e.host;if(typeof HTMLElement<`u`&&t instanceof HTMLElement&&!t.isConnected)return;let n=document.createElement(`div`);n.setAttribute(`data-code`,``),n.setAttribute(ie,`true`);let r=document.createElement(`div`);return r.style.position=`relative`,r.style.width=`200%`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n),lm=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),lm}function dm(e){return`${A}: ${e==null?`var(--diffs-scrollbar-gutter-fallback)`:`${e}px`};`}var fm=`@layer base, theme, rendered, unsafe;`,pm=RegExp(`${_m(A)}\\s*:\\s*[^;]+;`);function mm(e){return`${fm}
+@layer unsafe {
+ ${e}
+}`}function hm(e,t=`system`,n){return`${fm}
+@layer rendered {
+ :host {${t===`system`?``:`
+ color-scheme: ${t};`}
+ ${dm(n)}
+ ${e}
+ }
+}`}function gm(e,t){let n=dm(t);return e.replace(pm,n)}function _m(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function vm({code:e,pre:t,columnType:n,rowSpan:r,containerSize:i=!1}={}){return e??(e=document.createElement(`code`),e.setAttribute(`data-code`,``),n!=null&&e.setAttribute(`data-${n}`,``),t?.appendChild(e)),r==null?e.style.removeProperty(`grid-row`):e.style.setProperty(`grid-row`,`span ${r}`),i?e.setAttribute(`data-container-size`,``):e.removeAttribute(`data-container-size`),e}function ym(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:`open`});n.innerHTML===``&&(n.innerHTML=t)}function bm(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:a,split:o,totalLines:s,customProperties:c}){if(c!=null)for(let t in c){let n=c[t];n!=null&&e.setAttribute(t,`${n}`)}switch(t===`diff`?(e.setAttribute(`data-diff`,``),e.removeAttribute(`data-file`)):(e.setAttribute(`data-file`,``),e.removeAttribute(`data-diff`)),n){case`bars`:case`classic`:e.setAttribute(`data-indicators`,n);break;case`none`:e.removeAttribute(`data-indicators`)}return i?e.setAttribute(`data-disable-line-numbers`,``):e.removeAttribute(`data-disable-line-numbers`),r?e.removeAttribute(`data-background`):e.setAttribute(`data-background`,``),t===`diff`?e.setAttribute(`data-diff-type`,o?`split`:`single`):e.removeAttribute(`data-diff-type`),e.setAttribute(`data-overflow`,a),e.style.setProperty(`--diffs-min-number-column-width-default`,`${`${s}`.length}ch`),e}function xm(e){if(typeof HTMLStyleElement<`u`&&e instanceof HTMLStyleElement)return!0;let t=e.tagName??e.nodeName;return typeof t==`string`&&t.toLowerCase()===`style`}function Sm(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function Cm(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,themeType:e?.themeType,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:Sm(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,unsafeCSS:e?.unsafeCSS,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function wm(e,t){let n=e?.offsetHeight??0;if(e==null||n===0){t();return}e.style.minHeight=`${n}px`;try{t(),e.offsetHeight}finally{e.style.minHeight=``}}function Tm({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===``){t?.remove();return}return t??=Em(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function Em(){let e=document.createElement(`style`);return e.setAttribute(ne,``),e}var Dm=void 0;function Om(){return Dm??=`safari`in window&&`pushNotification`in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}if(typeof HTMLElement<`u`&&customElements.get(`diffs-container`)==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;let t=this.attachShadow({mode:`open`});e??(e=new CSSStyleSheet,e.replaceSync(cm)),t.adoptedStyleSheets=[e]}connectedCallback(){um(this.shadowRoot??this.attachShadow({mode:`open`}))}}customElements.define(b,t)}ki();var km=[``],Am=-1,jm=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file:${++Am}`;type=`file`;fileContainer;spriteSVG;pre;code;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;errorWrapper;placeHolder;lastRenderedHeaderHTML;cachedHeaderHTML;appliedPreAttributes;lastRowCount;mounted=!1;headerElement;headerCustom;headerPrefix;headerFilenameSuffix;headerMetadata;fileRenderer;resizeManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;file;renderRange;enabled=!0;editor;constructor(e={theme:k},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.fileRenderer=new Qp(e,this.handleHighlightRender,this.workerManager),this.resizeManager=new Xi,this.interactionManager=new Ai(`file`,ji(e)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};rerender(){!this.enabled||this.file==null||this.render({file:this.file,forceRender:!0,renderRange:this.renderRange})}__getCurrentFile(){return this.file}onThemeChange(){this.fileRenderer.clearRenderCache(),this.rerender()}setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(ji(this.options))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType!==t&&(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!me(this.appliedThemeCSS.theme,this.options.theme??k)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}setSelectedLines(e,t){this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??`additions`})}getCodeScrollLeft(){return this.code?.scrollLeft??0}setCodeScrollLeft(e){this.code!=null&&(this.code.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.fileRenderer.getEffectiveCodeOptions()}}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{overflow:e=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:e===`wrap`,columnVariables:this.shouldApplyColumnVariables(e)?`apply`:`measure`}),this.managersDirty=!1}shouldApplyColumnVariables(e){return e===`scroll`&&this.lineAnnotations.length>0}cleanUp(e=!1){this.emitPostRender(!0),this.editor?.cleanUp(e),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.pre=void 0,this.code=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,e?this.fileRenderer.recycle():(this.fileRenderer.cleanUp(),this.workerManager=void 0,this.file=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){let{fileContainer:t,prerenderedHTML:n,preventEmit:r=!1,file:i,lineAnnotations:a}=e;if(!this.enabled)throw Error(`File.hydrate: attempting to call hydrate after cleaned up`);if(this.fileContainer!=null)throw Error(`File.hydrate: hydrate can only be called before the instance has rendered or hydrated`);this.hydrateElements(t,n),Mm(this.pre,i,this.options.collapsed)||Nm(this.headerElement,i,this.options.disableFileHeader)?this.render({...e,preventEmit:!0}):this.hydrationSetup({file:i,lineAnnotations:a}),r||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),ym(e,t);for(let t of Array.from(e.shadowRoot?.children??[])){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t,this.appliedPreAttributes=void 0;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}if(`diffsHeader`in t.dataset){this.headerElement=t,this.lastRenderedHeaderHTML=void 0;continue}}}this.pre!=null&&(this.syncCodeNodeFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({file:e,lineAnnotations:t}){this.lineAnnotations=t??this.lineAnnotations,this.file=e,this.fileRenderer.setOptions(Cm(this.options)),this.syncInteractionOptions(),this.pre!=null&&(this.fileRenderer.hydrate(e),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}getOrCreateLineCache(e=this.file){return e==null?km:this.fileRenderer.getOrCreateLineCache(e)}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.file,r=this.lineAnnotations,i=this.renderRange;e!=null&&t!=null&&n!=null&&this.fileRenderer.initializeHighlighter().then(a=>{!this.enabled||this.editor!==e||this.fileContainer!==t||this.file!==n||e.__syncRenderView(a,t,n,r,i)})}attachEditor(e){this.editor?.cleanUp(),this.editor=e,this.fileRenderer.beginEditSession();let t=this.file==null?void 0:e.__prepareFile?.(this.file);return t!==void 0&&t!==this.file?this.renderPreparedFile({file:t,forceRender:!0,preventEmit:!0,renderRange:this.renderRange}):this.fileRenderer.editorRenderReady()?this.syncRenderViewToEditor():this.rerender(),()=>{this.editor=void 0,this.fileRenderer.endEditSession()}}applyDocumentChange(e,t){this.fileRenderer.applyDocumentChange(e),t!=null&&t!==this.lineAnnotations&&this.file!=null&&(this.setLineAnnotations(t),this.fileRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations())}updateRenderCache(e,t,n){this.fileRenderer.updateRenderCache(e,t,n?.lineCountChangeInFlight)}render(e){if(!this.enabled)throw Error(`File.render: attempting to call render after cleaned up`);let t=this.editor?.__prepareFile?.(e.file)??e.file;return this.renderPreparedFile(t===e.file?e:{...e,file:t})}renderPreparedFile({file:e,fileContainer:t,forceRender:n=!1,preventEmit:r=!1,containerWrapper:i,deferManagers:a=!1,lineAnnotations:o,renderRange:s}){this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:c=!1,themeType:l=`system`}=this.options,u=c?void 0:s,d=this.renderRange,f=this.hasThemeChanged(),p=o!=null&&(o.length>0||this.lineAnnotations.length>0)&&o!==this.lineAnnotations,m=!Ot(this.file,e)||this.fileRenderer.hasUnkeyedFileContentsChanged(e);if(!c&&!n&&Zf(u,this.renderRange)&&!m&&!p&&!f)return this.applyCachedThemeState(l);this.renderRange=u,m&&(this.cachedHeaderHTML=void 0),this.file=e,this.fileRenderer.setOptions(Cm(this.options)),this.syncInteractionOptions(),o!=null&&this.setLineAnnotations(o),this.fileRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:h=!1,disableFileHeader:g=!1}=this.options;if(g&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),t=this.getOrCreateFileContainerNode(t,i),this.applyCachedThemeState(l),c){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let n=this.fileRenderer.renderFile(e,ce);n!=null&&this.applyThemeState(t,n.themeStyles,l,n.baseThemeType),n?.headerAST!=null&&this.applyHeaderToDOM(n.headerAST,t),this.injectUnsafeCSS()}catch(e){if(h)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,t)}return r||this.emitPostRender(),!0}try{let r=this.getOrCreatePreNode(t);if(!this.canPartiallyRender(n,p,m||f)||!this.applyPartialRender(d,u)){let n=this.fileRenderer.renderFile(e,u);if(n==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(t,n.themeStyles,l,n.baseThemeType),n.headerAST!=null&&this.applyHeaderToDOM(n.headerAST,t),this.applyFullRender(n,r)}this.applyBuffers(r,u),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,a||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(h)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,t)}return r||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;n?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}removeRenderedCode(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.code?.remove(),this.code=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}canPartiallyRender(e,t,n){return!(e||t||n)}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}async primeHighlightCache(e=this.file){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||Yp(e))return;let n=this.options.tokenizeMaxLength??1e5;this.fileRenderer.getOrCreateLineCache(e).length>n||await t.primeFileHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.code?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.code=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${cp(r)}`,a=this.annotationCache.get(i);if(a==null||!tm(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:am(cp(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=om();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=sm(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=mm(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??k,s=typeof o==`string`?o:{...o},c=um(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=Tm({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:hm(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e!=null&&this.themeCSSStyle!=null&&(this.themeCSSStyle.textContent=gm(this.themeCSSStyle.textContent??``,um(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&Om()}applyFullRender(e,t){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,e);let n=this.code=vm({code:this.code}),r=this.fileRenderer.renderCodeAST(e);this.editor?.__captureFocusForDOMReplacement();let i=()=>{if(n.childElementCount>=2)for(let e=0;e<2;e++){let t=n.children[e],i=r[e];t.innerHTML=H(i.children),t.style.cssText=i.properties.style}else n.innerHTML=H(r);t.contains(n)||t.replaceChildren(n)};this.shouldGuardRebuildScroll()?wm(t,i):i(),this.lastRowCount=e.rowCount}applyPartialRender(e,t){if(e==null||t==null)return!1;let{file:n,code:r}=this,i=r==null?void 0:this.getColumns(r);if(n==null||r==null||i==null)return!1;let a=e.startingLine,o=t.startingLine,s=e.totalLines===1/0?1/0:a+e.totalLines,c=t.totalLines===1/0?1/0:o+t.totalLines,l=Math.max(a,o),u=Math.min(s,c);if(u<=l)return!1;if(!this.trimDOMToOverlap(i.gutter,l,u)||!this.trimDOMToOverlap(i.content,l,u))throw Error(`File.applyPartialRender: failed to trim to overlap`);let{length:d}=i.content.children,f=(e,t)=>{if(!(t<=0))return this.fileRenderer.renderFile(n,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},p=ou?f(u,m):void 0;return h===void 0&&c>u?!1:(this.cleanupErrorWrapper(),p!=null&&(i.gutter.insertAdjacentHTML(`afterbegin`,this.fileRenderer.renderPartialHTML(p.gutterAST)),i.content.insertAdjacentHTML(`afterbegin`,this.fileRenderer.renderPartialHTML(p.contentAST)),d+=p.rowCount),h!=null&&(i.gutter.insertAdjacentHTML(`beforeend`,this.fileRenderer.renderPartialHTML(h.gutterAST)),i.content.insertAdjacentHTML(`beforeend`,this.fileRenderer.renderPartialHTML(h.contentAST)),d+=h.rowCount),this.lastRowCount!==d&&(i.gutter.style.setProperty(`grid-row`,`span ${d}`),i.content.style.setProperty(`grid-row`,`span ${d}`),this.lastRowCount=d),!0)}getColumns(e){let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}trimDOMToOverlap(e,t,n){let r=this.getDOMBoundaryIndices(e,[t,n]),i=r.get(t)??e.children.length,a=r.get(n)??e.children.length;if(i>a)return!1;for(let t=e.children.length-1;t>=a;--t)e.children[t]?.remove();for(let t=i-1;t>=0;--t)e.children[t]?.remove();return!0}getDOMBoundaryIndices(e,t){let n=[...new Set(t)].sort((e,t)=>e-t),r=new Map;if(n.length===0)return r;let i=0,a=n[i],{children:o}=e;a===0&&(r.set(0,0),i+=1,a=n[i]);for(let e=0;e=a;)r.set(a,e),i+=1,a=n[i];if(i>=n.length)break}}for(let e of n)r.has(e)||r.set(e,o.length);return r}getLineIndexFromDOMNode(e){let t=e.dataset.lineIndex;if(t==null)return;let n=Number(t);return Number.isNaN(n)?void 0:n}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyHeaderToDOM(e,t){let{file:n}=this;if(n==null)return;this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let r=this.cachedHeaderHTML??H(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged)return;let{renderHeaderPrefix:i,renderHeaderFilenameSuffix:a,renderCustomHeader:o,renderHeaderMetadata:s}=this.options;if(o!=null){let e=o(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,te,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0}else{let e=i?.(n)??void 0,r=a?.(n)??void 0,o=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,ee,e),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,D,r),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,O,o),this.headerCustom?.remove(),this.headerCustom=void 0}}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}getOrCreateFileContainerNode(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return n!=null&&i&&this.editor?.__captureFocusForDOMReplacement(),i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:xm(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):xm(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=em;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.code=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),e.shadowRoot?.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodeFromPre(e){this.code=void 0;for(let t of Array.from(e.children))if(t instanceof HTMLElement&&t.hasAttribute(`data-code`)){this.code=t;return}}applyPreNodeAttributes(e,{totalLines:t}){let{overflow:n=`scroll`,disableLineNumbers:r=!1}=this.options,i={type:`file`,split:!1,overflow:n,disableLineNumbers:r,diffIndicators:`none`,disableBackground:!0,totalLines:t};nm(i,this.appliedPreAttributes)||(bm(e,i),this.appliedPreAttributes=i)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function Mm(e,t,n=!1){return!n&&e==null&&t!=null}function Nm(e,t,n=!1){return e==null&&t!=null&&!n}function Pm(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}function Fm(e){return{...e,hunks:e.hunks.map(e=>({...e,hunkContent:e.hunkContent.map(e=>({...e}))})),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}function Im(e){return e===``?[]:e.split(S)}function Lm(e,t,n){let r=e===`clone`?Fm(t):t;if(!r.isPartial)throw Error(`hydratePartialDiff: fileDiff must be partial`);switch(r.type){case`change`:case`rename-changed`:return Rm(r,Bm(r,n),Vm(r,n));case`rename-pure`:{let e=Vm(r,n);Hm(r,n);let t=Im(e.contents);return r.isPartial=!1,r.deletionLines=t,r.additionLines=t,Wm(r,null,e),r}}throw Error(`hydratePartialDiff: ${r.type} diffs cannot be hydrated from loaded files`)}function Rm(e,t,n){let r=Im(t.contents),i=Im(n.contents),{hunks:a,splitLineCount:o,unifiedLineCount:s}=zm(e.hunks,i.length);return e.hunks=a,e.splitLineCount=o,e.unifiedLineCount=s,e.isPartial=!1,e.deletionLines=r,e.additionLines=i,Wm(e,t,n),e}function zm(e,t){let n=0,r=0,i=0,a=[];for(let t of e){let e=Math.max(t.additionStart-1,0),o=Math.max(t.deletionStart-1,0),s=e,c=o,l=0,u=0,d=0,f=0,p=[];for(let e of t.hunkContent){if(e.type===`context`){p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.lines,c+=e.lines,d+=e.lines,f+=e.lines;continue}p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.additions,c+=e.deletions,l+=e.additions,u+=e.deletions,d+=Math.max(e.additions,e.deletions),f+=e.additions+e.deletions}let m=Math.max(Ce(t.additionStart,t.additionCount)-i,0);a.push({...t,collapsedBefore:m,additionLineIndex:e,deletionLineIndex:o,additionLines:l,deletionLines:u,hunkContent:p,splitLineStart:n+m,unifiedLineStart:r+m,splitLineCount:d,unifiedLineCount:f}),n+=m+d,r+=m+f,i=M(t.additionStart,t.additionCount)}if(a.length>0){let e=a[a.length-1],i=M(e.additionStart,e.additionCount),o=Math.max(t-i,0);n+=o,r+=o}return{hunks:a,splitLineCount:n,unifiedLineCount:r}}function Bm(e,t){if(t.oldFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function Vm(e,t){if(t.newFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function Hm(e,t){if(t.oldFile!==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function Um(e,t,n){return e.cacheKey==null?Gm(t,n):`${e.cacheKey}:hydrated`}function Wm(e,t,n){let r=Um(e,t,n);if(r==null){delete e.cacheKey;return}e.cacheKey=r}function Gm(e,t){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?`${e.cacheKey}:${t.cacheKey}`:void 0:e?.cacheKey??t?.cacheKey}var Km=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&=(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,!1)}setup(e,t,n){if(t==null||n==null)for(let r of e.children??[])r instanceof HTMLElement&&(`deletions`in r.dataset?t=r:`additions`in r.dataset&&(n=r));if(n==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener(`scroll`,this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener(`scroll`,this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function qm(e,t){return me(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function Jm(e){return N({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function Ym(e){return N({tagName:`div`,children:[N({tagName:`span`,children:[kt(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function Xm(e){return N({tagName:`div`,children:[At({name:e===`both`?`diffs-icon-expand-all`:`diffs-icon-expand`,properties:{"data-icon":``}})],properties:{role:`button`,"data-expand-button":``,"data-expand-both":e===`both`?``:void 0,"data-expand-up":e===`up`?``:void 0,"data-expand-down":e===`down`?``:void 0}})}function Zm({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:a,isLastHunk:o}){let s=0,c=[];if(e===`metadata`&&t!=null&&c.push(N({tagName:`div`,children:[kt(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||(e.push(Xm(`up`)),s++),o||(e.push(Xm(`down`)),s++)):(e.push(Xm(!a&&!o?`both`:a?`down`:`up`)),s++)),e.push(N({tagName:`div`,children:[N({tagName:`span`,children:[kt(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),r&&n!=null&&e.push(N({tagName:`div`,children:[kt(`Expand all`)],properties:{role:`button`,"data-expand-button":``,"data-expand-all-button":``}})),c.push(N({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":s>1?``:void 0}}))}return e===`custom`&&i!=null&&c.push(N({tagName:`slot`,properties:{name:i}})),N({tagName:`div`,children:c,properties:{"data-separator":c.length===0?`simple`:e,"data-expand-index":n,"data-separator-first":a?``:void 0,"data-separator-last":o?``:void 0}})}function Qm(e,t){return`hunk-separator-${e}-${t}`}function $m(e){let t=e.at(-1);return t==null?0:Math.max(M(t.additionStart,t.additionCount),M(t.deletionStart,t.deletionCount))}function eh(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function th({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":``},alwaysWrap:!0}}function nh({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:i=!1}){let a=t[t.length-1];if(a==null||i||!n){t.push([+!r,e.value]);return}let o=a[0]===0;if(r===o||r&&e.value.length===1&&!o){a[1]+=e.value;return}t.push([+!r,e.value])}function rh(e){return[Ce(e.additionStart,e.additionCount)+1,M(e.additionStart,e.additionCount)+1]}function ih({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:i}){let a=Math.max(t,0);if(a===0||e)return{fromStart:0,fromEnd:0,rangeSize:a,collapsedLines:a,renderAll:!1};if(n===!0||a<=i)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(r),s=Math.min(Math.max(o?.fromStart??0,0),a),c=Math.min(Math.max(o?.fromEnd??0,0),a),l=s+c,u=l>=a;return{fromStart:u?a:s,fromEnd:u?0:c,rangeSize:a,collapsedLines:Math.max(a-l,0),renderAll:u}}function ah(e){let t=e.hunks[e.hunks.length-1];if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return!1;let n=e.additionLines.length-M(t.additionStart,t.additionCount),r=e.deletionLines.length-M(t.deletionStart,t.deletionCount);return n<=0&&r<=0?!1:n!==r}function oh({fileDiff:e,errorPrefix:t}){let n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;let r=e.additionLines.length-M(n.additionStart,n.additionCount),i=e.deletionLines.length-M(n.deletionStart,n.deletionCount);if(r<=0&&i<=0)return 0;if(r!==i)throw Error(`${t}: trailing context mismatch (additions=${r}, deletions=${i}) for ${e.name}`);return Math.min(r,i)}function sh({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=oh({fileDiff:e,errorPrefix:i});if(a<=0)return;if(n===!0||a<=r)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(e.hunks.length),s=Math.min(Math.max(o?.fromStart??0,0),a);return{fromStart:s,fromEnd:0,rangeSize:a,collapsedLines:a-s,renderAll:s>=a}}function ch({fileDiff:e,lineNumber:t,expandedHunks:n,collapsedContextThreshold:r}){if(n===!0||e.isPartial)return!0;for(let[i,a]of e.hunks.entries()){let[o,s]=rh(a);if(t=o-s.fromEnd}if(t=o+i.rangeSize}function lh({fileDiff:e,lineNumber:t,direction:n,expandedHunks:r,collapsedContextThreshold:i}){if(r===!0||e.isPartial)return t;let a=[],o=1;for(let[t,n]of e.hunks.entries()){let[s,c]=rh(n),l=ih({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:r,hunkIndex:t,collapsedContextThreshold:i}),u=s-l.rangeSize;l.renderAll?a.push([u,s]):(l.fromStart>0&&a.push([u,u+l.fromStart]),l.fromEnd>0&&a.push([s-l.fromEnd,s])),a.push([s,c]),o=c}let s=sh({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:i,errorPrefix:`getNearestRenderableAdditionLine`});if(s!=null){let e=o;o=e+s.rangeSize,s.renderAll?a.push([e,o]):s.fromStart>0&&a.push([e,e+s.fromStart])}if(t>=o)return t;if(n===`down`){for(let[e,n]of a)if(n>t)return Math.max(e,t);return}for(let e=a.length-1;e>=0;e--){let[n,r]=a[e];if(n<=t)return Math.min(r-1,t)}}function uh({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=dh({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:a}),c={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:s.splitCount,unifiedCount:s.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!c.isWindowedHighlight)return!1;let e=c.unifiedCount>=n+r,i=c.splitCount>=n+r;return t===`unified`?e:(t===`split`||e)&&i},shouldSkip(e,r){if(!c.isWindowedHighlight)return!1;let i=e>0&&c.unifiedCount+e<=n,a=r>0&&c.splitCount+r<=n;return t===`unified`?i:(t===`split`||i)&&a},incrementCounts(e,n){(t===`unified`||t===`both`)&&(c.unifiedCount+=e),(t===`split`||t===`both`)&&(c.splitCount+=n)},isInWindow(e,n){if(!c.isWindowedHighlight)return!0;let r=c.isInUnifiedWindow(e),i=c.isInSplitWindow(n);return t===`unified`?r:t===`split`?i:r||i},isInUnifiedWindow(e){return!c.isWindowedHighlight||c.unifiedCount>=n-e&&c.unifiedCount=n-e&&c.splitCount0?0:t===`unified`?e===r.unifiedLineStart+r.unifiedLineCount-1?m.collapsedLines:0:n===r.splitLineStart+r.splitLineCount-1?m.collapsedLines:0}let g=p.collapsedLines===0;function u(){return g?0:(g=!0,p.collapsedLines)}if(c.shouldSkip(h,h))c.incrementCounts(h,h),u();else{let e=r.unifiedLineStart-p.rangeSize,i=r.splitLineStart-p.rangeSize,a=d-p.rangeSize,l=f-p.rangeSize,m=o+1-p.rangeSize,h=s+1-p.rangeSize;if(mh(c,p.fromStart,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:0,collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:m+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:l+t,lineNumber:h+t,noEOFCR:!1}}))||(e=r.unifiedLineStart-p.fromEnd,i=r.splitLineStart-p.fromEnd,a=d-p.fromEnd,l=f-p.fromEnd,m=o+1-p.fromEnd,h=s+1-p.fromEnd,mh(c,p.fromEnd,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:u(),collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:m+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:l+t,lineNumber:h+t,noEOFCR:!1}}),()=>{u()})))break hunkIterator}let _=r.unifiedLineStart,v=r.splitLineStart,y=d,b=f,x=o+1,S=s+1,C=r.hunkContent.at(-1);for(let e of r.hunkContent){if(c.shouldBreak())break hunkIterator;let i=e===C;if(e.type===`context`){if(c.shouldSkip(e.lines,e.lines))c.incrementCounts(e.lines,e.lines),u();else if(mh(c,e.lines,t,t=>{let a=i&&t===e.lines-1,o=_+t,s=v+t;return c.emit({hunkIndex:n,hunk:r,collapsedBefore:u(),collapsedAfter:l(o,s),type:`context`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:a&&r.noEOFCRDeletions,unifiedLineIndex:o,splitLineIndex:s},additionLine:{unifiedLineIndex:o,splitLineIndex:s,lineIndex:b+t,lineNumber:S+t,noEOFCR:a&&r.noEOFCRAdditions}})},()=>{u()}))break hunkIterator;_+=e.lines,v+=e.lines,y+=e.lines,b+=e.lines,x+=e.lines,S+=e.lines}else{let a=Math.max(e.deletions,e.additions),o=e.deletions+e.additions;if(!c.shouldSkip(o,a)){let s=hh(c,e,t);(s[0]?.[0]??0)>0&&u();for(let[d,f]of s)for(let s=d;s{let r=t===a-1;return c.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:r?n:0,type:`context-expanded`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:!1,unifiedLineIndex:_+t,splitLineIndex:v+t},additionLine:{unifiedLineIndex:_+t,splitLineIndex:v+t,lineIndex:b+t,lineNumber:S+t,noEOFCR:!1}})},void 0,()=>c.shouldBreak()))break hunkIterator}}}function dh({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=fh({diff:e,expandedHunks:r,collapsedContextThreshold:i}),o=0,s=e.hunks.length-1,c=e.hunks.length;for(;o<=s;){let e=o+s>>1,r=a[e+1];if(r==null)throw Error(`iterateOverDiff: invalid hunk prefix index`);(t===`unified`?r.unifiedCount:r.splitCount)>n?(c=e,s=e-1):o=e+1}if(c>=e.hunks.length){let t=a[e.hunks.length];if(t==null)throw Error(`iterateOverDiff: invalid terminal hunk prefix index`);return{hunkIndex:e.hunks.length,splitCount:t.splitCount,unifiedCount:t.unifiedCount}}let l=a[c];if(l==null)throw Error(`iterateOverDiff: invalid selected hunk prefix index`);return{hunkIndex:c,splitCount:l.splitCount,unifiedCount:l.unifiedCount}}function fh({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let r=0,i=0,a=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let s=0;si&&r.push([i,a])}if(n!==`split`&&i(e.unifiedCount),n!==`unified`&&i(e.splitCount),r.length===0)return[0,0];let a=r[0][0],o=r[0][1];for(let e=1;e0&&(e.incrementCounts(o,o),i?.());let c=o;for(;c=s){e.incrementCounts(t-c,t-c);break}if(e.isInWindow(0,0)){if(r(c)===!0)return!0}else e.incrementCounts(1,1);c++}return!1}function hh(e,t,n){if(!e.isWindowedHighlight)return[[0,n===`unified`?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];let r=n!==`split`,i=n!==`unified`,a=n===`unified`?`unified`:`split`,o=[];function s(t,n){if(t+n<=e.viewportStart||t>=e.viewportEnd)return;let r=Math.max(0,e.viewportStart-t),i=Math.min(n,e.viewportEnd-t);return i>r?[r,i]:void 0}function c(e,n){return a===`split`?e:n===`additions`?[e[0]+t.deletions,e[1]+t.deletions]:e}function l(e,t){if(e==null)return;let[n,r]=c(e,t);r>n&&o.push([n,r])}if(r&&(l(s(e.unifiedCount,t.deletions),`deletions`),l(s(e.unifiedCount+t.deletions,t.additions),`additions`)),i&&(l(s(e.splitCount,t.deletions),`deletions`),l(s(e.splitCount,t.additions),`additions`)),o.length===0)return o;o.sort((e,t)=>e[0]-t[0]);let u=[o[0]];for(let[e,t]of o.slice(1)){let n=u[u.length-1];e<=n[1]?n[1]=Math.max(n[1],t):u.push([e,t])}return u}function gh({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:a,unifiedLineIndex:o,splitLineIndex:s,additionLineIndex:c,deletionLineIndex:l,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:p,unifiedCount:m,splitCount:h}){let g=a=f.deletions?o+a:void 0:a=f.deletions?c+(a-f.deletions):void 0:a=f.deletions?u+(a-f.deletions):void 0:a0||a<1/0,l=typeof n.theme==`string`?t.getTheme(n.theme).type:void 0,u=Np({theme:n.theme,highlighter:t}),d=r&&!c&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?`none`:n.lineDiffType,f={deletionLines:[],additionLines:[]},{maxLineDiffLength:p}=n,m=!r&&!e.isPartial,h=r?o:void 0,g=new Map;function _(e){let t=m?0:e,n=g.get(t)??bh();return g.set(t,n),n}function v(e,t,n,r){if(c){let e=n.at(-1);(e==null||e.targetIndex+e.count!==t)&&(e={targetIndex:t,originalOffset:r.length,count:0},n.push(e)),e.count++}r.push(e)}uh({diff:e,diffStyle:`both`,startingLine:i,totalLines:a,expandedHunks:!c||h,collapsedContextThreshold:s,callback:({hunkIndex:t,additionLine:n,deletionLine:r,type:i})=>{let a=_(t),o=n==null?r.splitLineIndex:n.splitLineIndex;i===`change`&&n!=null&&r!=null&&yh({additionLine:e.additionLines[n.lineIndex],deletionLine:e.deletionLines[r.lineIndex],deletionLineIndex:a.deletionContent.length,additionLineIndex:a.additionContent.length,deletionDecorations:a.deletionDecorations,additionDecorations:a.additionDecorations,lineDiffType:d,maxLineDiffLength:p}),r!=null&&(v(e.deletionLines[r.lineIndex],r.lineIndex,a.deletionSegments,a.deletionContent),a.deletionInfo.push({type:i===`change`?`change-deletion`:i,lineNumber:r.lineNumber,altLineNumber:i===`change`?void 0:n.lineNumber??void 0,lineIndex:`${r.unifiedLineIndex},${o}`})),n!=null&&(v(e.additionLines[n.lineIndex],n.lineIndex,a.additionSegments,a.additionContent),a.additionInfo.push({type:i===`change`?`change-addition`:i,lineNumber:n.lineNumber,altLineNumber:i===`change`?void 0:r.lineNumber??void 0,lineIndex:`${n.unifiedLineIndex},${o}`}))}});for(let i of g.values()){if(i.deletionContent.length===0&&i.additionContent.length===0)continue;let a={name:e.prevName??e.name,contents:i.deletionContent.value},o={name:e.name,contents:i.additionContent.value},{deletionLines:s,additionLines:c}=xh({deletionFile:a,deletionInfo:i.deletionInfo,deletionDecorations:i.deletionDecorations,additionFile:o,additionInfo:i.additionInfo,additionDecorations:i.additionDecorations,highlighter:t,options:n,languageOverride:r?`text`:e.lang});if(m){f.deletionLines=s,f.additionLines=c;continue}if(i.deletionSegments.length>0)for(let e of i.deletionSegments)for(let t=0;t0)for(let e of i.additionSegments)for(let t=0;ts||t.length>s))return;let c=o===`char`?Ye(e,t):ft(e,t),l=[],u=[],d=o===`word-alt`,f=c.at(-1);for(let e of c){let t=e===f;!e.added&&!e.removed?(nh({item:e,arr:l,enableJoin:d,isNeutral:!0,isLastItem:t}),nh({item:e,arr:u,enableJoin:d,isNeutral:!0,isLastItem:t})):e.removed?nh({item:e,arr:l,enableJoin:d,isLastItem:t}):nh({item:e,arr:u,enableJoin:d,isLastItem:t})}let p=0;for(let e of l)e[0]===1&&i.push(th({line:n,spanStart:p,spanLength:e[1].length})),p+=e[1].length;p=0;for(let e of u)e[0]===1&&a.push(th({line:r,spanStart:p,spanLength:e[1].length})),p+=e[1].length}function bh(){return{deletionContent:{push(e){this.value+=e,this.length++},value:``,length:0},additionContent:{push(e){this.value+=e,this.length++},value:``,length:0},deletionInfo:[],additionInfo:[],deletionDecorations:[],additionDecorations:[],deletionSegments:[],additionSegments:[]}}function xh({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:a,additionDecorations:o,languageOverride:s,options:{theme:c=k,...l}}){let u=s??Q(e.name),d=s??Q(t.name),{state:f,transformers:p}=vp(l.useTokenTransformer),m=typeof c==`string`?{...l,lang:`text`,theme:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:$(`token`),tokenizeTimeLimit:0}:{...l,lang:`text`,themes:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:$(`token`),tokenizeTimeLimit:0};return{deletionLines:e.contents===``?[]:(m.lang=u,f.lineInfo=n,m.decorations=a,Fp(i.codeToHast(ge(e.contents),m))),additionLines:t.contents===``?[]:(m.lang=d,m.decorations=o,f.lineInfo=r,Fp(i.codeToHast(ge(t.contents),m)))}}function Sh(e,t){let n=Et({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t);return{hunks:n.hunks,splitLineCount:n.splitLineCount,unifiedLineCount:n.unifiedLineCount,additionLines:n.additionLines,deletionLines:n.deletionLines,type:n.type}}function Ch(e,t){let n=Math.max(e,1),r=Array.from({length:n},(e,t)=>`${` `.repeat(t+1)}\n`).join(``);return r===t&&(r=Array.from({length:n},(e,t)=>`\u0000${` `.repeat(t)}\n`).join(``)),r}function wh(e){for(let t of e)if(t.trim().length>0)return!1;return!0}function Th(e,t){return t.length>0&&t.length1&&e.at(-1)===``}function Ah(e,t){if(!kh(t))return;let n=t.length-e.additionLines.length;if(n<=0)return;let r=e.additionLines.length,i=e.hunks.at(-1);if(i!=null&&M(i.additionStart,i.additionCount)===r){for(let a of i.hunkContent)if(a.type===`change`&&a.additions=r.additionLineIndex&&tRh(e,n,r)),e.additionLineIndex=n+t.additionLineIndex,e.additionStart+=t.additionLineIndex,e.additionCount=t.additionCount,e.additionLines=t.additionLines,t.deletionLineIndex>=0&&(e.deletionLineIndex=r+t.deletionLineIndex,e.deletionStart+=t.deletionLineIndex),e.deletionCount=t.deletionCount,e.deletionLines=t.deletionLines,e.noEOFCRAdditions=t.noEOFCRAdditions,e.noEOFCRDeletions=t.noEOFCRDeletions,zh(e)}function Rh(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function zh(e){let t=0,n=0;for(let r of e.hunkContent)r.type===`context`?(t+=r.lines,n+=r.lines):(t+=Math.max(r.additions,r.deletions),n+=r.additions+r.deletions);e.splitLineCount=t,e.unifiedLineCount=n}function Bh(e){let t=0,n=0,r=0;for(let i of e.hunks)i.collapsedBefore=Math.max(Ce(i.additionStart,i.additionCount)-r,0),i.splitLineStart=t+i.collapsedBefore,i.unifiedLineStart=n+i.collapsedBefore,zh(i),t+=i.collapsedBefore+i.splitLineCount,n+=i.collapsedBefore+i.unifiedLineCount,r=M(i.additionStart,i.additionCount);if(e.hunks.length>0){let r=e.hunks[e.hunks.length-1],i=Math.max(e.additionLines.length-M(r.additionStart,r.additionCount),0);t+=i,n+=i}e.splitLineCount=t,e.unifiedLineCount=n}var Vh=new WeakMap;function Hh(e){return e.length>1&&e[e.length-1]===``?e.slice(0,-1):e}function Uh(e,t){let n=Math.min(e.length,t.length),r=0;for(;rr&&a>r&&e[i-1]===t[a-1];)i--,a--;if(r!==i||r!==a)return{start:r,deletionEnd:i,additionEnd:a}}function Wh(e,t){let n=e.hunks,r=e.additionLines,i=Hh(r),a=i===r?e:{...e,additionLines:i},o=eg(n,$h(a,t),e.deletionLines.length),s=rg(a,o);if(e.additionLines=i,e.hunks=s,e.editSessionDirty=!0,pg(e),Ah(e,r),og(n,e.hunks))return{regions:o.map(e=>e.previousSpan)}}function Gh(e,t,n,r){let i=Array.from(new Set(t)).filter(t=>t>=0&&te-t);if(i.length===0)return;let{hunks:a}=e,o,s=0;for(let t of i){for(;s=e.additionLineIndex&&n0||l>0)&&n.set(t,{fromStart:c,fromEnd:l})}return n}function Xh(e,t,n){let r=[];if(e.isPartial)return r;for(let[i,a]of e.hunks.entries()){let o=ih({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:t,hunkIndex:i,collapsedContextThreshold:n});if(o.rangeSize<=n)continue;let s=ug(a),c=s-o.rangeSize;o.fromStart>0&&r.push([c,c+o.fromStart]),o.fromEnd>0&&r.push([s-o.fromEnd,s])}let i=sh({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`captureExpansionAnchors`});if(i!=null&&i.fromStart>0&&i.rangeSize>n){let t=e.hunks[e.hunks.length-1],n=ug(t)+t.deletionCount;r.push([n,n+i.fromStart])}return r}function Zh(e,t){let n=new Map;if(t.length===0)return n;let r=(e,r,i)=>{if(i<=r)return;let a=0,o=0;for(let[e,n]of t)n<=r||e>=i||(e<=r&&(a=Math.max(a,Math.min(n,i)-r)),n>=i&&(o=Math.max(o,i-Math.max(e,r))));(a>0||o>0)&&n.set(e,{fromStart:a,fromEnd:o})};for(let[t,n]of e.hunks.entries()){let e=ug(n);r(t,e-Math.max(n.collapsedBefore,0),e)}let i=e.hunks[e.hunks.length-1];return i!=null&&!e.isPartial&&e.deletionLines.length>0&&r(e.hunks.length,ug(i)+i.deletionCount,e.deletionLines.length),n}function Qh(e,t){return e.editSessionDirty===!0&&(e.editSessionDirty=void 0,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join(``)===``?Sh(e,t):Oh(e,t)),!0)}function $h(e,t){if(Uh(e.deletionLines,e.additionLines)==null)return[];let n=Et({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t),r=[],i=0,a=0;for(let e of n.hunks){let t=e.additionCount>0?e.additionLineIndex-i:e.deletionLineIndex-a;i+=t,a+=t;for(let t of e.hunkContent){if(t.type===`context`){i+=t.lines,a+=t.lines;continue}let e=Rh(t,0,0);e.additions===0&&(e.additionLineIndex=i),e.deletions===0&&(e.deletionLineIndex=a),r.push(e),i+=e.additions,a+=e.deletions}}return r}function eg(e,t,n){let r=e.map((e,t)=>{let n=ug(e);return{deletionStart:n,deletionEnd:n+e.deletionCount,blocks:[],previousSpan:{firstIndex:t,lastIndex:t}}}),i=[],a=0;for(let e of t){let t=e.deletionLineIndex,o=t+e.deletions;for(;a0&&tg(t,o,i[i.length-1])?i.pop():void 0;for(;ae.deletions){let e=i[i.length-1]?.deletionEnd??0,s=r[a]?.deletionStart??n;t>e?c--:o=n.deletionStart}function ng(e,t){return e==null?t:(e.deletionStart=Math.min(e.deletionStart,t.deletionStart),e.deletionEnd=Math.max(e.deletionEnd,t.deletionEnd),e.blocks.push(...t.blocks),t.previousSpan!=null&&(e.previousSpan??={...t.previousSpan},e.previousSpan.firstIndex=Math.min(e.previousSpan.firstIndex,t.previousSpan.firstIndex),e.previousSpan.lastIndex=Math.max(e.previousSpan.lastIndex,t.previousSpan.lastIndex)),e)}function rg(e,t){let n=[],r=0,i=0;for(let a of t){let t=a.deletionStart-r;if(t<0)throw Error(`buildRegionHunks: overlapping old-side regions`);r+=t,i+=t;let o=i,s=[];for(let e of a.blocks){let t=e.deletionLineIndex-r,n=e.additionLineIndex-i;if(t<0||t!==n)throw Error(`buildRegionHunks: canonical block context mismatch`);ag(s,t,i,r),r+=t,i+=n,s.push({...e}),r+=e.deletions,i+=e.additions}let c=a.deletionEnd-r;if(c<0)throw Error(`buildRegionHunks: block exceeds its old-side region`);ag(s,c,i,r),r+=c,i+=c,n.push(ig(e,{additionStart:o,additionEnd:i,deletionStart:a.deletionStart,deletionEnd:a.deletionEnd},s))}if(e.deletionLines.length-r!==e.additionLines.length-i)throw Error(`buildRegionHunks: trailing context mismatch`);return n}function ig(e,t,n){let r=t.additionEnd-t.additionStart,i=t.deletionEnd-t.deletionStart,a=0,o=0;for(let e of n)e.type===`change`&&(a+=e.additions,o+=e.deletions);let s={collapsedBefore:0,additionStart:dg(t.additionStart,r),additionCount:r,additionLines:a,additionLineIndex:fg(t.additionStart,r),deletionStart:dg(t.deletionStart,i),deletionCount:i,deletionLines:o,deletionLineIndex:fg(t.deletionStart,i),hunkContent:n,hunkSpecs:`@@ -${dg(t.deletionStart,i)},${i} +${dg(t.additionStart,r)},${r} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return zh(s),s}function ag(e,t,n,r){t>0&&e.push({type:`context`,lines:t,additionLineIndex:n,deletionLineIndex:r})}function og(e,t){if(e.length!==t.length)return!0;for(let n=0;n{this.applyRefreshedResult(t,n.getDiffResultCache(t))}).catch(e=>this.onHighlightError(e))):this.asyncHighlight(t).then(e=>this.applyRefreshedResult(t,e)).catch(e=>this.onHighlightError(e))}applyRefreshedResult(e,t){if(t==null||this.renderCache==null||this.renderCache.diff!==e||this.editSessionActive)return;let{options:n}=this.getRenderOptions(e);qm(n,t.options)&&(this.renderCache={diff:e,options:t.options,highlighted:!0,result:t.result,renderRange:void 0},this.onRenderUpdate?.())}get diffCache(){return this.renderCache?.diff??this.diff}clearRenderCache(){let e=this.renderCache;this.renderCache=void 0,e!=null&&e.isDirty===!0&&e.diff.cacheKey!=null&&this.workerManager?.evictDiffFromCache(e.diff.cacheKey)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let r={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t===`up`||t===`both`)&&(r.fromStart+=n),(t===`down`||t===`both`)&&(r.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,r)}getExpandedHunk(e){return this.expandedHunks.get(e)??oe}getExpandedHunksMap(){return this.expandedHunks}setExpandedHunksMap(e){this.expandedHunks=e}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(let t of e){let e=(()=>{switch(t.side){case`deletions`:return this.deletionAnnotations;case`additions`:return this.additionAnnotations}})(),n=e[t.lineNumber]??[];e[t.lineNumber]=n,n.push(t)}}updateRenderCache(e,t,n=!1){if(this.renderCache==null)return!1;let{result:r,diff:i}=this.renderCache;if(r==null)return!1;if(i.isPartial)throw Error(`Could not update render cache for partial diff`);let a=r.code.additionLines,o=[],s=new Map;for(let[t,n]of e){let e=a[t]?.properties??{},r=n.map(e=>e[2]).join(``),c=te===0&&t===``?n===``?{type:`element`,tagName:`br`,properties:{},children:[]}:{type:`text`,value:n}:{type:`element`,tagName:`span`,properties:{"data-char":e,style:`color:${t};`},children:[{type:`text`,value:n}]})}}let c=!1;if(o.length>0){if(this.editSessionActive&&!i.isPartial){if(!n){if(i.additionLines.length<=1&&i.additionLines.join(``)===``)Object.assign(i,Dh(i,this.options.parseDiffOptions)),this.markEditSessionPass(i),c=!0;else if(Th(i,i.additionLines))Object.assign(i,Eh(i,i.additionLines,this.options.parseDiffOptions)),this.markEditSessionPass(i),c=!0;else{let e=Gh(i,o,this.options.parseDiffOptions,s);this.applyExpansionRemap(e),c=e!=null}}}else Object.assign(i,jh(i,o,this.options.parseDiffOptions))}return r.baseThemeType=t,this.renderCache.isDirty=!0,c}applyExpansionRemap(e){e!=null&&(this.expandedHunks=Yh(this.expandedHunks,e))}applyDocumentChange(e){if(this.renderCache==null)return;let{diff:t,result:n}=this.renderCache;if(n==null)return;if(t.isPartial)throw Error(`Could not apply document change for partial diff`);let{additionLines:r}=t;t.additionLines=Og(e,r),n.code.additionLines=Eg(r,t.additionLines,n.code.additionLines,e),t.additionLines.length<=1&&t.additionLines.join(``)===``?(Object.assign(t,Dh(t,this.options.parseDiffOptions)),n.code.additionLines[0]=Dg(0,e.getLineText(0)),this.markEditSessionPass(t)):this.editSessionActive?this.applySessionDocumentChange(t):Object.assign(t,Oh(t,this.options.parseDiffOptions)),this.renderCache.isDirty=!0}applySessionDocumentChange(e){let{parseDiffOptions:t}=this.options,n=e.additionLines;if(Th(e,n)){Object.assign(e,Eh(e,n,t)),this.markEditSessionPass(e);return}this.applyExpansionRemap(Wh(e,t))}markEditSessionPass(e){this.editSessionActive&&(e.editSessionDirty=!0)}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e,contentProperties:{"data-line-type":e}}}getSplitLineDecoration({side:e,type:t}){let n=t===`change`?e===`deletions`?`change-deletion`:`change-addition`:t;return{gutterLineType:n,contentProperties:{"data-line-type":n}}}createAnnotationElement=e=>Qf(e);getOptionsWithDefaults(){let{diffIndicators:e=`bars`,diffStyle:t=`split`,disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:a=!1,collapsed:o=!1,expandUnchanged:s=!1,collapsedContextThreshold:c=1,expansionLineCount:l=100,hunkSeparators:u=`line-info`,lineDiffType:d=`word-alt`,maxLineDiffLength:f=1e3,overflow:p=`scroll`,stickyHeader:m=!1,theme:h=k,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=ae,useTokenTransformer:y=!1,useCSSClasses:b=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,disableVirtualizationBuffers:a,collapsed:o,expandUnchanged:s,collapsedContextThreshold:c,expansionLineCount:l,hunkSeparators:u,lineDiffType:d,maxLineDiffLength:f,overflow:p,stickyHeader:m,theme:this.workerManager?.getDiffRenderOptions().theme??h,headerRenderMode:g,tokenizeMaxLineLength:_,tokenizeMaxLength:v,useTokenTransformer:y,useCSSClasses:b}}async initializeHighlighter(){return this.highlighter=await Wf(sp(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=jg(e,this.getTokenizeMaxLength()),r=this.workerManager?.getDiffResultCache(e);r!=null&&!qm(t,r.options)&&(r=void 0),this.renderCache??={diff:e,highlighted:!n&&!mg(e),options:t,result:n?void 0:r?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter??(this.computedLang=e.lang??Q(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??k}getEffectiveCodeOptions(){let e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getDiffRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0){let e=this.workerManager.getDiffRenderOptions();return this.editSessionActive&&e.useTokenTransformer!==!0?{...e,useTokenTransformer:!0}:e}let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}=this.getOptionsWithDefaults();return{theme:e,useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result==null||!Pm(e,n.diff)||!qm(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=se){if(e==null)return;let{expandUnchanged:n,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),{options:i,forceHighlight:a}=this.getRenderOptions(e),o=this.getMatchingWorkerResultCache(e,i);o!=null&&!this.hasHighlightedRenderCache(e,i)&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...o},a=!1),this.renderCache??={diff:e,highlighted:!1,options:i,result:void 0,renderRange:void 0};let s=e.additionLines.length>0||e.deletionLines.length>0,c=!s||mg(e)||jg(e,this.getTokenizeMaxLength()),l=!Pm(e,this.renderCache.diff),u=!Zf(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){let o=this.renderCache.result==null&&this.renderCache.highlighted&&!c&&!l&&eh(t);o&&(this.renderCache.highlightPending=!0),!o&&(c||this.renderCache.result==null||!this.renderCache.highlighted&&(l||u))&&(this.renderCache.diff=e,this.renderCache.options=i,this.renderCache.highlighted=!1,(this.renderCache.result==null||l||u||a)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,eh(t)||n?!0:this.expandedHunks,r)),this.renderCache.renderRange=t),!c&&s&&(!this.renderCache.highlighted||a)&&this.workerManager.highlightDiffAST(this,e)}else{this.computedLang=e.lang??Q(e.name);let t=this.highlighter!=null&&Jf(i.theme),n=this.highlighter!=null&&ca(this.computedLang),r=!c&&n;if(this.highlighter!=null&&t&&(a||c||!this.renderCache.highlighted&&r||this.renderCache.result==null)){let{result:t,options:i}=this.renderDiffWithHighlighter(e,this.highlighter,c||!n);this.renderCache={diff:e,options:i,highlighted:r,result:t,renderRange:void 0}}(!t||!c&&!n)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.applyHighlightResult(e,t,n,!c)})}return this.renderCache.result==null?void 0:this.processDiffResult(this.renderCache.diff,t,this.renderCache.result)}async asyncRender(e,t=se){let{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){let{diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o}=this.getOptionsWithDefaults();return rp({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=jg(e,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??Q(e.name);let n=this.highlighter!=null&&Jf(this.getLocalHighlightTheme()),r=t||this.highlighter!=null&&ca(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:i}=this.getOptionsWithDefaults(),a=vh(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i});if(this.editSessionActive&&e.additionLines.length===1&&e.additionLines[0]===``&&a.code.additionLines[0]==null){let t;if(uh({diff:e,diffStyle:`both`,expandedHunks:n?!0:void 0,collapsedContextThreshold:i,callback:({additionLine:e})=>{if(e?.lineIndex===0)return t=e,!0}}),t==null)throw Error(`DiffHunksRenderer: missing empty addition line`);a.code.additionLines[0]=Dg(0,``,t.unifiedLineIndex,t.splitLineIndex)}return{result:a,options:r}}onHighlightSuccess(e,t,n,r=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,r)}applyHighlightResult(e,t,n,r=!0){if(this.renderCache==null)return;let i=this.renderCache.highlightPending===!0||!this.renderCache.highlighted||!qm(this.renderCache.options,n)||!Pm(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:r,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;let n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!qm(t,n.options)))return n}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&Pm(e,n.diff)&&qm(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let{diffStyle:a,disableFileHeader:o,expandUnchanged:s,expansionLineCount:c,collapsedContextThreshold:l,hunkSeparators:u}=this.getOptionsWithDefaults(),d=this.renderCache?.isDirty??!1;this.diff=e;let f=a===`unified`,p=Mg(e,this.options.loadDiffFiles!=null),m=!e.isPartial||p,h=[],g=[],_=[],v=[],{additionLines:y,deletionLines:b}=n,x={rowCount:0,hunkSeparators:u,additionsContentAST:h,deletionsContentAST:g,unifiedContentAST:_,unifiedGutterAST:Mt(),deletionsGutterAST:Mt(),additionsGutterAST:Mt(),expansionLineCount:c,hunkData:v,incrementRowCount(e=1){x.rowCount+=e},pushToGutter(e,t){switch(e){case`unified`:x.unifiedGutterAST.children.push(t);break;case`deletions`:x.deletionsGutterAST.children.push(t);break;case`additions`:x.additionsGutterAST.children.push(t)}}},S=oh({fileDiff:e,errorPrefix:`DiffHunksRenderer.processDiffResult`}),C={size:0,side:void 0,increment(){this.size+=1},flush(){if(a!==`unified`){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side===`additions`?(x.pushToGutter(`additions`,P(void 0,`buffer`,this.size)),h?.push(Jm(this.size))):(x.pushToGutter(`deletions`,P(void 0,`buffer`,this.size)),g?.push(Jm(this.size))),this.size=0,this.side=void 0}}},w=(e,t,n,r,i)=>{x.pushToGutter(e,Nt(t,n,r,i))};function T(e){C.flush(),a===`unified`?Cg(`unified`,e,x):(Cg(`deletions`,e,x),Cg(`additions`,e,x))}this.pushFileLevelAnnotations(e,a,t,x),uh({diff:e,diffStyle:a,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:s?!0:this.expandedHunks,collapsedContextThreshold:l,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,additionLine:o,deletionLine:s,type:c})=>{let l=s==null?o.splitLineIndex:s.splitLineIndex,f=o==null?s.unifiedLineIndex:o.unifiedLineIndex;a===`split`&&c!==`change`&&C.flush(),r>0&&T({hunkIndex:t,collapsedLines:r,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:t===0,isLastHunk:!1,isExpandable:m});let h=a===`unified`?f:l,g={type:c,hunkIndex:t,lineIndex:h,unifiedLineIndex:f,splitLineIndex:l,deletionLine:s,additionLine:o};if(a===`unified`){let n=this.getUnifiedInjectedRowsForLine?.(g);n?.before!=null&&bg(n.before,x);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex];if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let a=c===`change`?o==null?`change-deletion`:`change-addition`:c,u=this.getUnifiedLineDecoration({type:c,lineType:a,additionLineIndex:o?.lineIndex,deletionLineIndex:s?.lineIndex});w(`unified`,u.gutterLineType,o==null?s.lineNumber:o.lineNumber,`${f},${l}`,u.gutterProperties),i==null?r!=null&&(r=wg(r,u.contentProperties,d&&s!=null?{"data-line":s.lineNumber,"data-line-index":`${f},${l}`}:void 0)):i=wg(i,u.contentProperties,d&&o!=null?{"data-line":o.lineNumber,"data-line-index":`${f},${l}`}:void 0),Sg({diffStyle:`unified`,type:c,deletionLine:r,additionLine:i,unifiedSpan:this.getAnnotations(`unified`,s?.lineNumber,o?.lineNumber,t,h),createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&bg(n.after,x)}else{let n=this.getSplitInjectedRowsForLine?.(g);n?.before!=null&&xg(n.before,x,C);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex],a=this.getSplitLineDecoration({side:`deletions`,type:c,lineIndex:s?.lineIndex}),u=this.getSplitLineDecoration({side:`additions`,type:c,lineIndex:o?.lineIndex});if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let f=(()=>{if(c===`change`){if(i==null)return`additions`;if(r==null)return`deletions`}})();f==null?c===`change`&&C.flush():(C.side!=null&&C.side!==f&&C.flush(),C.side=f,C.increment());let p=this.getAnnotations(`split`,s?.lineNumber,o?.lineNumber,t,h);if(p!=null&&C.size>0&&C.flush(),s!=null){let e=wg(r,a.contentProperties,d?{"data-line":s.lineNumber,"data-line-index":`${s.unifiedLineIndex},${l}`}:void 0);w(`deletions`,a.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${l}`,a.gutterProperties),e!=null&&(r=e)}if(o!=null){let e=wg(i,u.contentProperties,d?{"data-line":o.lineNumber,"data-line-index":`${o.unifiedLineIndex},${l}`}:void 0);w(`additions`,u.gutterLineType,o.lineNumber,`${o.unifiedLineIndex},${l}`,u.gutterProperties),e!=null&&(i=e)}Sg({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...p,createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&xg(n.after,x,C)}let _=a===`split`&&n!=null&&l===n.splitLineStart+n.splitLineCount-1,v=t===e.hunks.length-1&&n!=null&&(a===`split`?l===n.splitLineStart+n.splitLineCount-1:f===n.unifiedLineStart+n.unifiedLineCount-1),E=_?n.noEOFCRDeletions:!1,ee=_?n.noEOFCRAdditions:!1,D=(s?.noEOFCR??!1)||E,O=(o?.noEOFCR??!1)||ee;if(O||D){if(a===`split`&&C.flush(),D){let e=c===`context`||c===`context-expanded`?c:`change-deletion`;a===`unified`?(x.unifiedContentAST.push(Ym(e)),x.pushToGutter(`unified`,P(e,`metadata`,1))):(x.deletionsContentAST.push(Ym(e)),x.pushToGutter(`deletions`,P(e,`metadata`,1)),O||(x.pushToGutter(`additions`,P(void 0,`buffer`,1)),x.additionsContentAST.push(Jm(1))))}if(O){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(x.unifiedContentAST.push(Ym(e)),x.pushToGutter(`unified`,P(e,`metadata`,1))):(x.additionsContentAST.push(Ym(e)),x.pushToGutter(`additions`,P(e,`metadata`,1)),D||(x.pushToGutter(`deletions`,P(void 0,`buffer`,1)),x.deletionsContentAST.push(Jm(1))))}x.incrementRowCount(1)}u!==`simple`&&u!==`metadata`&&(i>0||v&&p)&&T({hunkIndex:c===`context-expanded`?t:t+1,collapsedLines:v&&p?`unknown`:i,rangeSize:S,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:m}),x.incrementRowCount(1)}}),a===`split`&&C.flush();let E=Math.max($m(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),ee=t.bufferBefore>0||t.bufferAfter>0,D=!f&&e.type!==`deleted`,O=!f&&e.type!==`new`,te=x.rowCount>0||ee;h=D&&te?h:void 0,g=O&&te?g:void 0,_=f&&te?_:void 0;let k=this.createPreElement(g!=null&&h!=null,E);return{unifiedGutterAST:f&&te?x.unifiedGutterAST.children:void 0,unifiedContentAST:_,deletionsGutterAST:O&&te?x.deletionsGutterAST.children:void 0,deletionsContentAST:g,additionsGutterAST:D&&te?x.additionsGutterAST.children:void 0,additionsContentAST:h,hunkData:v,preNode:k,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(this.diff),totalLines:E,rowCount:x.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderCodeAST(e,t){let n=e===`unified`?t.unifiedGutterAST:e===`deletions`?t.deletionsGutterAST:t.additionsGutterAST,r=e===`unified`?t.unifiedContentAST:e===`deletions`?t.deletionsContentAST:t.additionsContentAST;if(n==null||r==null)return;let i=Mt(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,Jp(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push(N({tagName:`code`,children:r,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-unified":``}})),{...e.preNode,children:t};let i=this.renderCodeAST(`deletions`,e);i!=null&&t.push(N({tagName:`code`,children:i,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-deletions":``}}));let a=this.renderCodeAST(`additions`,e);return a!=null&&t.push(N({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return H(this.renderFullAST(e,t))}renderPartialHTML(e,t){return H(t==null?e:N({tagName:`code`,children:e,properties:{"data-code":``,"data-container-size":this.getOptionsWithDefaults().hunkSeparators===`line-info`?``:void 0,[`data-${t}`]:``}}))}pushFileLevelAnnotations(e,t,n,r){if(!Kp(n))return;let i=e.type===`new`?[]:_g(Gp(this.deletionAnnotations)),a=e.type===`deleted`?[]:_g(Gp(this.additionAnnotations));if(i.length===0&&a.length===0)return;let{createAnnotationElement:o}=this;if(t===`unified`){Sg({diffStyle:t,type:`context`,unifiedSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i.concat(a)},createAnnotationElement:o,context:r});return}Sg({diffStyle:t,type:`context`,deletionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i},additionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:a},createAnnotationElement:o,context:r})}getAnnotations(e,t,n,r,i){let a={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(t!=null)for(let e of this.deletionAnnotations[t]??[])a.annotations.push(cp(e));let o={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(n!=null)for(let t of this.additionAnnotations[n]??[])(e===`unified`?a:o).annotations.push(cp(t));if(e===`unified`)return a.annotations.length>0?a:void 0;if(o.annotations.length!==0||a.annotations.length!==0)return{deletionSpan:a,additionSpan:o}}renderHeader(e){let{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return ep({fileOrDiff:e,mode:t,stickyHeader:n})}};function _g(e){return e?.map(e=>cp(e))??[]}var vg=new Intl.PluralRules(`en-US`);function yg(e){return`${e} unmodified line${vg.select(e)===`one`?``:`s`}`}function bg(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function xg(e,t,n){for(let{deletion:r,addition:i}of e){if(r==null&&i==null)continue;let e=r!=null&&i!=null?void 0:r==null?`deletions`:`additions`;(e==null||n.side!==e)&&n.flush(),r!=null&&(t.deletionsContentAST.push(r.content),t.pushToGutter(`deletions`,r.gutter)),i!=null&&(t.additionsContentAST.push(i.content),t.pushToGutter(`additions`,i.gutter)),e!=null&&(n.side=e,n.increment()),t.incrementRowCount(1)}}function Sg({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:i,deletionSpan:a,additionSpan:o,createAnnotationElement:s,context:c}){let l=!1;if(e===`unified`){if(r==null?n!=null&&c.unifiedContentAST.push(n):c.unifiedContentAST.push(r),i!=null){let e=t===`change`?n==null?`change-addition`:`change-deletion`:t;c.unifiedContentAST.push(s(i)),c.pushToGutter(`unified`,P(e,`annotation`,1)),l=!0}}else if(e===`split`){if(n!=null&&c.deletionsContentAST.push(n),r!=null&&c.additionsContentAST.push(r),a!=null){let e=t===`change`?n==null?`context`:`change-deletion`:t;c.deletionsContentAST.push(s(a)),c.pushToGutter(`deletions`,P(e,`annotation`,1)),l=!0}if(o!=null){let e=t===`change`?r==null?`context`:`change-addition`:t;c.additionsContentAST.push(s(o)),c.pushToGutter(`additions`,P(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function Cg(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:a,isLastHunk:o,isExpandable:s},c){if(typeof n==`number`&&n<=0)return;let l=e===`unified`?c.unifiedContentAST:e===`deletions`?c.deletionsContentAST:c.additionsContentAST;if(c.hunkSeparators===`metadata`){i!=null&&(c.pushToGutter(e,Zm({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push(Zm({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,Zm({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push(Zm({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=Qm(e,t),d=r>c.expansionLineCount,f=s?t:void 0,p=typeof n==`number`?yg(n):`More unchanged context may be available`;c.pushToGutter(e,Zm({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push(Zm({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1),c.hunkData.push({slotName:u,hunkIndex:t,lines:typeof n==`number`?n:0,lineCountKnown:typeof n==`number`,type:e,expandable:s?{up:!a,down:!o,chunked:d}:void 0})}function wg(e,t,n){return e==null||e.type!==`element`||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function Tg(e){return e.length>0&&e[e.length-1]===``?e.length-1:e.length}function Eg(e,t,n,r){let i=Tg(e),a=Tg(t),o=Math.min(i,a),s=0;for(;st}function Mg(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function Ng(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function Pg(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}async function Fg(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{n!=null&&clearTimeout(n)}}function Ig({oldFile:e,newFile:t},n){if(e!==void 0||t!==void 0){if(e===void 0||t===void 0)throw Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return{oldFile:e,newFile:t}}}function Lg(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:Sm(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}ki();function Rg(e){return e.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)}var zg=-1,Bg=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++zg}`;type=`file-diff`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;pendingFiles;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:k},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new Xi,this.scrollSyncManager=new Km,this.interactionManager=new Ai(`diff`,ji(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return Lg(e)}createHunksRenderer(e){return new gg(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>{let n=this.fileDiffCache;if(n==null)return;let r=n.hunks.at(-1),i,a;hunkIterator:for(let o of n.hunks){let n=t===`deletions`?o.deletionStart:o.additionStart,s=t===`deletions`?o.deletionCount:o.additionCount,c=Ce(n,s)+1,l=o.splitLineStart,u=o.unifiedLineStart;if(e=c+s){if(o===r){let t=e-(c+s);i=u+o.unifiedLineCount+t,a=l+o.splitLineCount+t;break hunkIterator}continue}for(let n of o.hunkContent)if(n.type===`context`){if(ethis.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.lineStateRefreshPending?this.deferredSelectedLines=[e,t]:this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.lineStateRefreshPending?this.deferredEditorActiveLine=[e,t]:this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??`additions`})}flushDeferredLineState(){let{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,e!=null&&this.setEditorActiveLine(...e),t!=null&&this.interactionManager.setSelection(...t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e=`split`,overflow:t=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t===`wrap`,columnVariables:this.shouldApplyColumnVariables(t)?`apply`:`measure`}),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return typeof this.options.hunkSeparators==`function`||e===`scroll`&&(this.lineAnnotations.length>0||this.pre?.hasAttribute(`data-has-merge-conflict`)===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(e){this.codeUnified!=null&&(this.codeUnified.scrollLeft=e),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=e),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){fe(this.handleEditSessionRender),this.emitPostRender(!0),this.editor?.cleanUp(e),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.pendingFiles=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:n=!1,lineAnnotations:r,fileDiff:i,...a}){if(!this.enabled)throw Error(`FileDiff.hydrate: attempting to call hydrate after cleaned up`);if(this.fileContainer!=null)throw Error(`FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated`);let o=Ig(a,`FileDiff.hydrate`),s=o?.oldFile,c=o?.newFile;this.hydrateElements(e,t),Wg(this.pre,Hg({fileDiff:i,oldFile:s,newFile:c}),this.options.collapsed)||Gg(this.headerElement,Ug({fileDiff:i,oldFile:s,newFile:c}),this.options.disableFileHeader)?this.render({...a,fileContainer:e,lineAnnotations:r,fileDiff:i,preventEmit:!0}):this.hydrationSetup({fileDiff:i,lineAnnotations:r,...o}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),ym(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)!(e instanceof HTMLElement)||e.tagName.toLowerCase()!==`code`||(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&n!==void 0?Et(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.loadFilesIfNecessary(),this.rerender()};loadFilesIfNecessary(){let{fileDiff:e,options:{loadDiffFiles:t}}=this;e==null||t==null||!Rg(e)||this.pendingFiles?.fileDiff===e||(this.pendingFiles={fileDiff:e,promise:this.loadFilesForDiff(e,t)})}async loadFilesForDiff(e,t){try{let n=await t(e);if(!this.enabled||this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(e){if(this.options.disableErrorHandling===!0)throw e;console.error(e)}finally{this.pendingFiles?.fileDiff===e&&(this.pendingFiles=void 0)}}async handleFilesLoaded(e,t){this.fileDiff!==e||!e.isPartial||(Lm(`merge`,e,t),this.setHydratedState(t),await Fg(()=>this.primeHighlightCache(e)),!(!this.enabled||this.fileDiff!==e)&&this.rerender())}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:n=!1,preventEmit:r=!1,lineAnnotations:i,fileContainer:a,containerWrapper:o,renderRange:s,...c}){let l=Ig(c,`FileDiff.render`),u=l?.oldFile,d=l?.newFile;if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);e!=null&&e.cacheKey===void 0&&(e.cacheKey=e.prevName==null?e.name:e.prevName+`:`+e.name),this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:f=!1,themeType:p=`system`,expandUnchanged:m=!1}=this.options,h=f?void 0:s,g=this.hasThemeChanged(),_=l!=null,v=_&&(!Vg(u,this.deletionFile)||!Vg(d,this.additionFile)),y=e!=null&&e!==this.fileDiff,b=i!=null&&(i.length>0||this.lineAnnotations.length>0)&&i!==this.lineAnnotations;if(!f&&Zf(h,this.renderRange)&&!n&&!b&&!g&&(e!=null&&e===this.fileDiff||e==null&&!v))return this.applyCachedThemeState(p);let x;e==null&&_&&(v||this.fileDiff==null)&&(x=Et(l.oldFile,l.newFile,this.options.parseDiffOptions));let{renderRange:S}=this;if(this.renderRange=h,_?(this.deletionFile=u,this.additionFile=d):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e==null?x!=null&&(y=!0,this.fileDiff=x):this.fileDiff=e,y&&(this.cachedHeaderHTML=void 0),i!=null&&this.setLineAnnotations(i),this.fileDiff==null)return!1;this.fileDiff.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(Qh(this.fileDiff,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:C=!1,disableFileHeader:w=!1}=this.options;if(w&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),a=this.getOrCreateFileContainer(a,o),this.applyCachedThemeState(p),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,ce);e!=null&&this.applyThemeState(a,e.themeStyles,p,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,a),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(C)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(n,b,v||y||g)&&this.applyPartialRender({previousRenderRange:S,renderRange:h}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,h);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(a,t.themeStyles,p,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,a),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(C)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}get fileDiffCache(){return this.hunksRenderer.diffCache??this.fileDiff}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.fileDiffCache,r=this.lineAnnotations,i=this.computeEditorRenderRange(this.renderRange);e!=null&&t!=null&&n!=null&&!n.isPartial&&this.hunksRenderer.initializeHighlighter().then(a=>{!this.enabled||this.editor!==e||this.fileContainer!==t||this.fileDiffCache!==n||e.__syncRenderView(a,t,n,r,i)})}computeEditorRenderRange(e){let t=this.fileDiffCache;if(e==null||t==null||eh(e))return e;let{diffStyle:n=`split`,expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a,o;return uh({diff:t,diffStyle:n,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({additionLine:e})=>{e!=null&&(a??=e.lineNumber,o=e.lineNumber)}}),a==null||o==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:a-1,totalLines:o-a+1}}attachEditor(e){if(this.type!==`file-diff`)throw Error(`FileDiff.attachEditor: cannot attach an editor to a "${this.type}" diff`);return this.editor?.cleanUp(),this.editor=e,this.hunksRenderer.beginEditSession(),this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary(),this.hunksRenderer.editorRenderReady()?this.syncRenderViewToEditor():this.rerender(),e=>{this.editor=void 0,e!==!0&&this.finishEditSession()}}finishEditSession(){this.hunksRenderer.endEditSession(),this.completeEditSession()}completeEditSession(){let e=this.fileDiffCache;if(e==null||e.editSessionDirty!==!0)return!1;let{collapsedContextThreshold:t=1}=this.options,n=Xh(e,this.hunksRenderer.getExpandedHunksMap(),t);return Qh(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(Zh(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){this.hunksRenderer.applyDocumentChange(e);let n=this.hunksRenderer.diffCache;if(n!=null){let e=this.fileDiff?.cacheKey;e!=null&&n.cacheKey==null&&(n.cacheKey=e),this.fileDiff=n}t!==void 0&&t!==this.lineAnnotations&&(this.setLineAnnotations(t),this.hunksRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations()),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(e,t,n={}){let{shouldRefreshDiffsView:r,lineCountChangeInFlight:i}=n;if(this.hunksRenderer.updateRenderCache(e,t,i)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}r===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle===`split`?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}isLineRenderable(e){let t=this.fileDiffCache;if(t==null)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options;return ch({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}getNearestRenderableLine(e,t){let n=this.fileDiffCache;if(n==null)return e;let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;return lh({fileDiff:n,lineNumber:e,direction:t,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}revealLine(e){let t=this.fileDiffCache,{expandUnchanged:n=!1,collapsedContextThreshold:r=1,expansionLineCount:i=100}=this.options;if(t==null||t.isPartial||n)return!1;let a=this.hunksRenderer.getExpandedHunksMap();for(let[n,o]of t.hunks.entries()){let[s,c]=rh(o);if(e=s-c.fromEnd)return!1;let u=e-(l+c.fromStart)+1,d=s-c.fromEnd-e;return u<=d?this.expandHunk(n,`up`,u+i):this.expandHunk(n,`down`,d+i),!0}if(e=c+o.rangeSize?!1:(this.expandHunk(t.hunks.length,`up`,e-(c+o.fromStart)+1+i),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){de(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}async primeHighlightCache(e=this.fileDiff){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||mg(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||await t.primeDiffHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!Pg(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${cp(r)}`,a=this.annotationCache.get(i);if(a==null||!Ng(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:am(cp(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=om();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return n!=null&&i&&this.editor?.__captureFocusForDOMReplacement(),i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:xm(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):xm(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=em;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,r=this.cachedHeaderHTML??H(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:i,renderHeaderPrefix:a,renderHeaderFilenameSuffix:o,renderHeaderMetadata:s}=this.options;if(i!=null){let e=i(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,te,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let c=a?.(n)??void 0,l=o?.(n)??void 0,u=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,ee,c),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,D,l),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,O,u),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=sm(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=mm(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??k,s=typeof o==`string`?o:{...o},c=um(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=Tm({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:hm(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e!=null&&this.themeCSSStyle!=null&&(this.themeCSSStyle.textContent=gm(this.themeCSSStyle.textContent??``,um(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&Om()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?wm(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,n){let r=this.getColumnPair(e);if(r==null)return!1;let i=Kg(t[0]),a=Kg(t[1]);return i==null||a==null?!1:(r.gutter.innerHTML=H(i),r.content.innerHTML=H(a),n!==this.lastRowCount&&(r.gutter.style.setProperty(`grid-row`,`span ${n}`),r.content.style.setProperty(`grid-row`,`span ${n}`)),!0)}replaceCodeColumns(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);this.editor?.__captureFocusForDOMReplacement(),s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=vm({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeDeletions,c,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c)),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=vm({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeAdditions,l,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l)),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=vm({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeUnified,s,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s)),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:a,options:{diffStyle:o=`split`}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let s=this.getCodeColumns(o,r,a,i);if(s==null)return!1;let c=e.startingLine,l=t.startingLine,u=c+e.totalLines,d=l+t.totalLines,f=Math.max(c,l),p=Math.min(u,d);if(p<=f)return!1;let m=Math.max(0,f-c),h=Math.max(0,u-p),g=this.trimColumns({columns:s,trimStart:m,trimEnd:h,previousStart:c,overlapStart:f,overlapEnd:p,diffStyle:o});if(g<0)throw Error(`FileDiff.applyPartialRender: failed to trim to overlap`);if(this.lastRowCount{if(!(t<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(l,Math.max(f-l,0));if(y==null&&lp)return!1;let x=(e,t)=>{if(e!=null){if(o===`unified`&&!Array.isArray(s))this.insertPartialHTML(o,s,e,t);else if(o===`split`&&Array.isArray(s))this.insertPartialHTML(o,s,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);_+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,`afterbegin`),x(b,`beforeend`),this.lastRowCount!==_&&(this.applyRowSpan(o,s,_),this.lastRowCount=_),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}refreshSplitDiffView(){if(this.options.diffStyle!==`split`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`split`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(t))return;let n=(t,n)=>{if(n==null)return;let r=this.hunksRenderer.renderCodeAST(t,e),i=Kg(r?.[0]),a=Kg(r?.[1]);for(let[e,t]of[[n.gutter,i],[n.content,a]])if(t!=null&&e.childElementCount===t.length)for(let n=0;n{for(let[e,n]of[[t.gutter,r],[t.content,i]])n!=null&&(e.innerHTML=H(n));e.rowCount!==this.lastRowCount&&(this.applyRowSpan(`unified`,t,e.rowCount),this.lastRowCount=e.rowCount)};this.shouldGuardRebuildScroll()?wm(this.pre,a):a(),this.renderSeparators(e.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=Kg(t[0]),i=Kg(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}getColumnPair(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}getCodeColumns(e,t,n,r){if(e===`unified`)return this.getColumnPair(t);{let e=this.getColumnPair(n),t=this.getColumnPair(r);return e!=null||t!=null?[e,t]:void 0}}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l!==`unified`&&t!=null&&n!=null,totalLines:r,customProperties:i};nm(u,this.appliedPreAttributes)||(bm(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function Vg(e,t){return e==null||t==null?e==null&&t==null:Ot(e,t)}function Hg({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function Ug({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function Wg(e,t,n=!1){return!n&&e==null&&t}function Gg(e,t,n=!1){return e==null&&t&&!n}function Kg(e){if(e!=null&&e.type===`element`)return e.children??[]}var qg=`extension.markeditVersionBrowser`,Jg={wrapLines:!0,showLineNumbers:!0,lineDiff:`word-alt`,expandUnchanged:!1,expansionLineCount:20,diffIndicators:`classic`,hunkSeparators:`line-info`},Yg=[`word-alt`,`word`,`char`,`none`],Xg=[`classic`,`bars`,`none`],Zg=[`simple`,`metadata`,`line-info`,`line-info-basic`];function Qg(e){let t=e_(e_(e)[qg]);return{wrapLines:t_(t.wrapLines,Jg.wrapLines),showLineNumbers:t_(t.showLineNumbers,Jg.showLineNumbers),lineDiff:r_(t.lineDiff,Yg,Jg.lineDiff),expandUnchanged:t_(t.expandUnchanged,Jg.expandUnchanged),expansionLineCount:n_(t.expansionLineCount,Jg.expansionLineCount,1,100),diffIndicators:r_(t.diffIndicators,Xg,Jg.diffIndicators),hunkSeparators:r_(t.hunkSeparators,Zg,Jg.hunkSeparators)}}var $g=Qg(r.MarkEdit.userSettings);function e_(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:{}}function t_(e,t){return typeof e==`boolean`?e:t}function n_(e,t,n,r){return typeof e==`number`&&Number.isInteger(e)?Math.min(Math.max(e,n),r):t}function r_(e,t,n){return typeof e==`string`&&t.includes(e)?e:n}var i_=`markedit-version-browser.diff-style`,a_={dark:`github-dark-default`,light:`github-light-default`},o_=`[data-gutter] { -webkit-user-select: none; user-select: none; }`;function s_(){try{let e=localStorage.getItem(i_);if(e===`unified`||e===`split`)return e}catch{}return`unified`}function c_(e){try{localStorage.setItem(i_,e)}catch{}}function l_(e,t,n,r){let i={theme:a_,disableFileHeader:!0,disableLineNumbers:!$g.showLineNumbers,overflow:$g.wrapLines?`wrap`:`scroll`,unsafeCSS:o_};if(n===t){let t=new jm({...i});return t.render({file:{name:`document.md`,contents:n,lang:`markdown`},containerWrapper:e}),t}let a=new Bg({...i,diffStyle:r,diffIndicators:$g.diffIndicators,hunkSeparators:$g.hunkSeparators,lineDiffType:$g.lineDiff,expandUnchanged:$g.expandUnchanged,expansionLineCount:$g.expansionLineCount});return a.render({oldFile:{name:`document.md`,contents:t,lang:`markdown`},newFile:{name:`document.md`,contents:n,lang:`markdown`},containerWrapper:e}),a}var u_;async function d_(e,t){let n=await r.MarkEdit.getFileVersions(),i=n[0];if(i===void 0)return n;let a;try{a=await r.MarkEdit.getFileVersionContent(i.id)}catch{return n}return a===void 0?n:(t.set(i.id,a),a===e?n.slice(1):n)}function f_(){if(typeof r.MarkEdit.getFileVersions!=`function`){r.MarkEdit.showAlert({title:`Version Browser Unavailable`,message:`This version of MarkEdit does not support file version history.`,buttons:[`OK`,`Get Latest Version`]}).then(e=>{e>0&&open(`https://github.com/MarkEdit-app/MarkEdit/releases/latest`)});return}u_?.();let e=r.MarkEdit.editorView,t=r.MarkEdit.editorAPI.getText(),n=s_(),s=g(n);if(s===void 0)return;let{overlay:c,versionSelect:u,status:d,diffContainer:f,restoreButton:p,deleteButton:m,closeButton:h,layoutButtons:b}=s,x=y(),S=e.dom,C=()=>{let e=S.getBoundingClientRect();Object.assign(c.style,{top:`${e.top}px`,left:`${e.left}px`,width:`${e.width}px`,height:`${e.height}px`})};document.body.appendChild(c),C(),requestAnimationFrame(()=>c.classList.add(`is-visible`)),e.contentDOM.blur();let w=[],T,E,ee,D=!1,O=!1,te=!1,k=new Map,ne=i(),re=new ResizeObserver(C);re.observe(S);let ie=()=>r.MarkEdit.editorView===e,A=l(d,f,()=>O),ae=()=>{let e=T?.isLocal===!1,n=T!==void 0&&e&&k.has(T.id);a(s,{busy:D,hasVersions:w.length>0,selectedVersion:T,isDownloaded:n,hasDifferences:E===void 0?void 0:E!==t})},oe=(e,t)=>{e&&ne.invalidate(),D=e,c.setAttribute(`aria-busy`,String(e)),t!==void 0&&A.show(t,!0),ae()},se=()=>{T!==void 0&&E!==void 0&&(ee?.cleanUp(),f.replaceChildren(),ee=l_(f,t,E,n),A.hide(),f.hidden=!1)},ce=async e=>{T=e,E=void 0,u.value=e.id;let t=ne.begin(),n=k.has(e.id);c.setAttribute(`aria-busy`,`true`);let i=n?void 0:A.show(`Fetching contents...`,!0);if(i===void 0&&A.hide(),ae(),O||!ne.isCurrent(t))return;let a=k.get(e.id);if(!n){try{a=await r.MarkEdit.getFileVersionContent(e.id)}catch{!O&&ne.isCurrent(t)&&(c.setAttribute(`aria-busy`,`false`),A.show(`The version could not be loaded.`));return}a!==void 0&&k.set(e.id,a)}if(!(O||!ne.isCurrent(t))){if(!ie()){pe();return}if(c.setAttribute(`aria-busy`,`false`),a===void 0){A.show(`This version is no longer available.`);return}i!==void 0&&await A.settle(i),!(O||!ne.isCurrent(t))&&(E=a,ae(),se())}},le=()=>{if(u.setAttribute(`aria-busy`,`false`),w.length===0){u.replaceChildren(new Option(`No saved versions`)),u.disabled=!0,A.show(`No saved versions are available for this document.`);return}_(u,w),u.disabled=!1,ce(w[0])},ue=async()=>{if(w=[],T=void 0,E=void 0,oe(!0,`Loading versions...`),u.disabled=!0,u.replaceChildren(new Option),u.setAttribute(`aria-busy`,`true`),!O){try{w=await d_(t,k)}catch{O||(u.setAttribute(`aria-busy`,`false`),oe(!1),A.show(`Version history could not be loaded.`));return}if(O||!ie()){pe();return}oe(!1),le()}},de=async()=>{if(T===void 0||E===void 0||E===t||D)return;let e=T;if(!ie()||(oe(!0,`Restoring version...`),O))return;let n=!1;try{n=await r.MarkEdit.restoreFileVersion(e.id)}catch{n=!1}O||(n?pe():(oe(!1),A.show(`The version could not be restored.`)))},fe=async()=>{if(T===void 0||!T.isLocal||D)return;let e=T;if(await r.MarkEdit.showAlert({title:`Delete This Version?`,message:`This action cannot be undone.`,buttons:[`Delete`,`Cancel`]})!==0||!ie()||(oe(!0,`Deleting version...`),O))return;let t=!1;try{t=await r.MarkEdit.deleteLocalFileVersions([e.id])}catch{t=!1}O||(t?(k.delete(e.id),ee?.cleanUp(),ee=void 0,await ue()):(oe(!1),A.show(`The version could not be deleted.`)))},pe=()=>{if(O)return;O=!0,ne.invalidate(),A.dispose(),window.removeEventListener(`keydown`,me,!0),c.classList.remove(`is-visible`),c.style.pointerEvents=`none`;let t=()=>{te||(te=!0,ee?.cleanUp(),re.disconnect(),c.remove(),x.remove(),u_===pe&&(u_=void 0,ie()&&e.focus()))};c.addEventListener(`transitionend`,t,{once:!0});let n=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?0:180;window.setTimeout(t,n)};b.forEach(e=>{e.addEventListener(`click`,()=>{n=e.dataset.style===`split`?`split`:`unified`,c_(n),v(b,n),se()})}),p.addEventListener(`click`,()=>void de()),m.addEventListener(`click`,()=>void fe()),h.addEventListener(`click`,pe),u.addEventListener(`change`,()=>{let e=w.find(e=>e.id===u.value);e!==void 0&&ce(e)}),c.addEventListener(`pointerdown`,()=>c.classList.remove(`is-keyboard-navigation`));let me=e=>{if(e.key===`Tab`){c.classList.add(`is-keyboard-navigation`),o(c,e);return}if(e.key===`Escape`&&!D){e.preventDefault(),e.stopPropagation(),pe();return}if(e.key!==`ArrowUp`&&e.key!==`ArrowDown`||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||D||w.length===0)return;e.preventDefault(),e.stopPropagation();let t=e.key===`ArrowUp`?-1:1,n=w.findIndex(e=>e.id===T?.id),r=Math.min(Math.max(n+t,0),w.length-1);r!==n&&ce(w[r])};window.addEventListener(`keydown`,me,!0),u_=pe,c.focus(),ue()}r.MarkEdit.addMainMenuItem({title:`Browse Versions`,icon:`clock.arrow.circlepath`,action:f_});
\ No newline at end of file
diff --git a/main.ts b/main.ts
new file mode 100644
index 0000000..99c7bb3
--- /dev/null
+++ b/main.ts
@@ -0,0 +1,8 @@
+import { MarkEdit } from 'markedit-api';
+import { showVersionBrowser } from './src/browser';
+
+MarkEdit.addMainMenuItem({
+ title: 'Browse Versions',
+ icon: 'clock.arrow.circlepath',
+ action: showVersionBrowser,
+});
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..69a7e81
--- /dev/null
+++ b/package.json
@@ -0,0 +1,29 @@
+{
+ "name": "markedit-version-browser",
+ "version": "1.0.0",
+ "description": "Browse version history with nicely rendered diffs.",
+ "scripts": {
+ "build": "vite build",
+ "test": "vitest run",
+ "reload": "osascript -e 'quit app \"MarkEdit\"' -e 'delay 1' -e 'launch app \"MarkEdit\"'",
+ "uninstall": "rm ~/Library/Containers/app.cyan.markedit/Data/Documents/scripts/$(node -p \"require('./package.json').name\").js"
+ },
+ "license": "MIT",
+ "devDependencies": {
+ "@codemirror/commands": "^6.0.0",
+ "@codemirror/language": "^6.0.0",
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.0.0",
+ "@types/node": "^22.0.0",
+ "jsdom": "^30.0.1",
+ "markedit-api": "https://github.com/MarkEdit-app/MarkEdit-api#v0.33.0",
+ "markedit-vite": "https://github.com/MarkEdit-app/MarkEdit-vite#v0.6.0",
+ "typescript": "^7.0.0",
+ "vite": "^8.0.0",
+ "vitest": "^4.1.11",
+ "vite-plugin-singlefile": "^2.3.3"
+ },
+ "dependencies": {
+ "@pierre/diffs": "^1.3.6"
+ }
+}
diff --git a/src/browser.ts b/src/browser.ts
new file mode 100644
index 0000000..00587df
--- /dev/null
+++ b/src/browser.ts
@@ -0,0 +1,418 @@
+import type { FileVersion } from 'markedit-api';
+import { MarkEdit } from 'markedit-api';
+import { createRequestGate, keepFocusWithinBrowser, updateBrowserActions } from './interaction';
+import { createBrowserStatus } from './status';
+import { createBrowserElements, installBrowserStyle, populateVersionSelect, setLayoutButtonState } from './view';
+import { createDiff, getStoredDiffStyle, storeDiffStyle, type RenderedDiff } from './diff';
+
+let closeBrowserHandler: (() => void) | undefined;
+
+async function getBrowsableVersions(
+ currentContent: string,
+ contentCache: Map,
+): Promise {
+ const versions = await MarkEdit.getFileVersions();
+ const latestVersion = versions[0];
+ if (latestVersion === undefined) {
+ return versions;
+ }
+
+ let latestContent: string | undefined;
+ try {
+ latestContent = await MarkEdit.getFileVersionContent(latestVersion.id);
+ } catch {
+ return versions;
+ }
+
+ if (latestContent === undefined) {
+ return versions;
+ }
+
+ contentCache.set(latestVersion.id, latestContent);
+ return latestContent === currentContent ? versions.slice(1) : versions;
+}
+
+export function showVersionBrowser(): void {
+ if (typeof MarkEdit.getFileVersions !== 'function') {
+ void MarkEdit.showAlert({
+ title: 'Version Browser Unavailable',
+ message: 'This version of MarkEdit does not support file version history.',
+ buttons: ['OK', 'Get Latest Version'],
+ }).then((choice) => {
+ if (choice > 0) {
+ open('https://github.com/MarkEdit-app/MarkEdit/releases/latest');
+ }
+ });
+
+ return;
+ }
+
+ closeBrowserHandler?.();
+ const editorView = MarkEdit.editorView;
+ const currentContent = MarkEdit.editorAPI.getText();
+ let diffStyle = getStoredDiffStyle();
+ const elements = createBrowserElements(diffStyle);
+ if (elements === undefined) {
+ return;
+ }
+
+ const {
+ overlay,
+ versionSelect,
+ status,
+ diffContainer,
+ restoreButton,
+ deleteButton,
+ closeButton,
+ layoutButtons,
+ } = elements;
+
+ const style = installBrowserStyle();
+ const editorElement = editorView.dom;
+ const positionOverlay = () => {
+ const bounds = editorElement.getBoundingClientRect();
+ Object.assign(overlay.style, {
+ top: `${bounds.top}px`,
+ left: `${bounds.left}px`,
+ width: `${bounds.width}px`,
+ height: `${bounds.height}px`,
+ });
+ };
+
+ document.body.appendChild(overlay);
+ positionOverlay();
+ requestAnimationFrame(() => overlay.classList.add('is-visible'));
+ editorView.contentDOM.blur();
+
+ let versions: FileVersion[] = [];
+ let selectedVersion: FileVersion | undefined;
+ let selectedContent: string | undefined;
+ let diff: RenderedDiff | undefined;
+ let busy = false;
+ let closing = false;
+ let cleanedUp = false;
+
+ const contentCache = new Map();
+ const requestGate = createRequestGate();
+ const resizeObserver = new ResizeObserver(positionOverlay);
+ resizeObserver.observe(editorElement);
+
+ const isCurrentContext = () => MarkEdit.editorView === editorView;
+ const browserStatus = createBrowserStatus(status, diffContainer, () => closing);
+
+ const updateActions = () => {
+ const isNonlocal = selectedVersion?.isLocal === false;
+ const isDownloaded = selectedVersion !== undefined && isNonlocal && contentCache.has(selectedVersion.id);
+
+ updateBrowserActions(elements, {
+ busy,
+ hasVersions: versions.length > 0,
+ selectedVersion,
+ isDownloaded,
+ hasDifferences: selectedContent === undefined ? undefined : selectedContent !== currentContent,
+ });
+ };
+
+ const setBusy = (value: boolean, message?: string) => {
+ if (value) {
+ requestGate.invalidate();
+ }
+
+ busy = value;
+ overlay.setAttribute('aria-busy', String(value));
+ if (message !== undefined) {
+ browserStatus.show(message, true);
+ }
+
+ updateActions();
+ };
+
+ const renderDiff = () => {
+ if (selectedVersion === undefined || selectedContent === undefined) {
+ return;
+ }
+
+ diff?.cleanUp();
+ diffContainer.replaceChildren();
+ diff = createDiff(diffContainer, currentContent, selectedContent, diffStyle);
+ browserStatus.hide();
+ diffContainer.hidden = false;
+ };
+
+ const selectVersion = async(version: FileVersion) => {
+ selectedVersion = version;
+ selectedContent = undefined;
+ versionSelect.value = version.id;
+ const currentRequest = requestGate.begin();
+ const hasCachedContent = contentCache.has(version.id);
+ overlay.setAttribute('aria-busy', 'true');
+ const loadingStatusID = hasCachedContent ? undefined : browserStatus.show('Fetching contents...', true);
+ if (loadingStatusID === undefined) {
+ browserStatus.hide();
+ }
+
+ updateActions();
+ if (closing || !requestGate.isCurrent(currentRequest)) {
+ return;
+ }
+
+ let content = contentCache.get(version.id);
+ if (!hasCachedContent) {
+ try {
+ content = await MarkEdit.getFileVersionContent(version.id);
+ } catch {
+ if (!closing && requestGate.isCurrent(currentRequest)) {
+ overlay.setAttribute('aria-busy', 'false');
+ browserStatus.show('The version could not be loaded.');
+ }
+
+ return;
+ }
+
+ if (content !== undefined) {
+ contentCache.set(version.id, content);
+ }
+ }
+
+ if (closing || !requestGate.isCurrent(currentRequest)) {
+ return;
+ }
+
+ if (!isCurrentContext()) {
+ close();
+ return;
+ }
+
+ overlay.setAttribute('aria-busy', 'false');
+ if (content === undefined) {
+ browserStatus.show('This version is no longer available.');
+ return;
+ }
+
+ if (loadingStatusID !== undefined) {
+ await browserStatus.settle(loadingStatusID);
+ }
+
+ if (closing || !requestGate.isCurrent(currentRequest)) {
+ return;
+ }
+
+ selectedContent = content;
+ updateActions();
+ renderDiff();
+ };
+
+ const renderVersions = () => {
+ versionSelect.setAttribute('aria-busy', 'false');
+ if (versions.length === 0) {
+ versionSelect.replaceChildren(new Option('No saved versions'));
+ versionSelect.disabled = true;
+ browserStatus.show('No saved versions are available for this document.');
+ return;
+ }
+
+ populateVersionSelect(versionSelect, versions);
+ versionSelect.disabled = false;
+ void selectVersion(versions[0]);
+ };
+
+ const reloadVersions = async() => {
+ versions = [];
+ selectedVersion = undefined;
+ selectedContent = undefined;
+ setBusy(true, 'Loading versions...');
+ versionSelect.disabled = true;
+ versionSelect.replaceChildren(new Option());
+ versionSelect.setAttribute('aria-busy', 'true');
+
+ if (closing) {
+ return;
+ }
+
+ try {
+ versions = await getBrowsableVersions(currentContent, contentCache);
+ } catch {
+ if (!closing) {
+ versionSelect.setAttribute('aria-busy', 'false');
+ setBusy(false);
+ browserStatus.show('Version history could not be loaded.');
+ }
+
+ return;
+ }
+
+ if (closing || !isCurrentContext()) {
+ close();
+ return;
+ }
+
+ setBusy(false);
+ renderVersions();
+ };
+
+ const restoreVersion = async() => {
+ if (selectedVersion === undefined || selectedContent === undefined || selectedContent === currentContent || busy) {
+ return;
+ }
+
+ const versionToRestore = selectedVersion;
+ if (!isCurrentContext()) {
+ return;
+ }
+
+ setBusy(true, 'Restoring version...');
+ if (closing) {
+ return;
+ }
+
+ let restored = false;
+ try {
+ restored = await MarkEdit.restoreFileVersion(versionToRestore.id);
+ } catch {
+ restored = false;
+ }
+
+ if (closing) {
+ return;
+ }
+
+ if (restored) {
+ close();
+ } else {
+ setBusy(false);
+ browserStatus.show('The version could not be restored.');
+ }
+ };
+
+ const deleteVersion = async() => {
+ if (selectedVersion === undefined || !selectedVersion.isLocal || busy) {
+ return;
+ }
+
+ const versionToDelete = selectedVersion;
+ const choice = await MarkEdit.showAlert({
+ title: 'Delete This Version?',
+ message: 'This action cannot be undone.',
+ buttons: ['Delete', 'Cancel'],
+ });
+
+ if (choice !== 0 || !isCurrentContext()) {
+ return;
+ }
+
+ setBusy(true, 'Deleting version...');
+ if (closing) {
+ return;
+ }
+
+ let deleted = false;
+ try {
+ deleted = await MarkEdit.deleteLocalFileVersions([versionToDelete.id]);
+ } catch {
+ deleted = false;
+ }
+
+ if (closing) {
+ return;
+ }
+
+ if (deleted) {
+ contentCache.delete(versionToDelete.id);
+ diff?.cleanUp();
+ diff = undefined;
+ await reloadVersions();
+ } else {
+ setBusy(false);
+ browserStatus.show('The version could not be deleted.');
+ }
+ };
+
+ const close = () => {
+ if (closing) {
+ return;
+ }
+
+ closing = true;
+ requestGate.invalidate();
+ browserStatus.dispose();
+ window.removeEventListener('keydown', handleKeyDown, true);
+ overlay.classList.remove('is-visible');
+ overlay.style.pointerEvents = 'none';
+
+ const cleanUp = () => {
+ if (cleanedUp) {
+ return;
+ }
+
+ cleanedUp = true;
+ diff?.cleanUp();
+ resizeObserver.disconnect();
+ overlay.remove();
+ style.remove();
+
+ if (closeBrowserHandler === close) {
+ closeBrowserHandler = undefined;
+ if (isCurrentContext()) {
+ editorView.focus();
+ }
+ }
+ };
+
+ overlay.addEventListener('transitionend', cleanUp, { once: true });
+ const delay = window.matchMedia('(prefers-reduced-motion: reduce)').matches ? 0 : 180;
+ window.setTimeout(cleanUp, delay);
+ };
+
+ layoutButtons.forEach((button) => {
+ button.addEventListener('click', () => {
+ diffStyle = button.dataset.style === 'split' ? 'split' : 'unified';
+ storeDiffStyle(diffStyle);
+ setLayoutButtonState(layoutButtons, diffStyle);
+ renderDiff();
+ });
+ });
+
+ restoreButton.addEventListener('click', () => void restoreVersion());
+ deleteButton.addEventListener('click', () => void deleteVersion());
+ closeButton.addEventListener('click', close);
+ versionSelect.addEventListener('change', () => {
+ const version = versions.find((candidate) => candidate.id === versionSelect.value);
+ if (version !== undefined) {
+ void selectVersion(version);
+ }
+ });
+
+ overlay.addEventListener('pointerdown', () => overlay.classList.remove('is-keyboard-navigation'));
+ const handleKeyDown = (event: KeyboardEvent) => {
+ if (event.key === 'Tab') {
+ overlay.classList.add('is-keyboard-navigation');
+ keepFocusWithinBrowser(overlay, event);
+ return;
+ }
+
+ if (event.key === 'Escape' && !busy) {
+ event.preventDefault();
+ event.stopPropagation();
+ close();
+ return;
+ }
+
+ if ((event.key !== 'ArrowUp' && event.key !== 'ArrowDown') || event.metaKey || event.ctrlKey || event.altKey || event.shiftKey || busy || versions.length === 0) {
+ return;
+ }
+
+ event.preventDefault();
+ event.stopPropagation();
+ const offset = event.key === 'ArrowUp' ? -1 : 1;
+ const currentIndex = versions.findIndex((version) => version.id === selectedVersion?.id);
+ const nextIndex = Math.min(Math.max(currentIndex + offset, 0), versions.length - 1);
+ if (nextIndex !== currentIndex) {
+ void selectVersion(versions[nextIndex]);
+ }
+ };
+
+ window.addEventListener('keydown', handleKeyDown, true);
+ closeBrowserHandler = close;
+ overlay.focus();
+ void reloadVersions();
+}
diff --git a/src/diff.ts b/src/diff.ts
new file mode 100644
index 0000000..47e0d90
--- /dev/null
+++ b/src/diff.ts
@@ -0,0 +1,73 @@
+import { File, FileDiff } from '@pierre/diffs';
+import { settings } from './settings';
+import type { DiffStyle } from './settings';
+
+export type { DiffStyle } from './settings';
+export type RenderedDiff = File | FileDiff;
+
+const diffStyleStorageKey = 'markedit-version-browser.diff-style';
+const theme = { dark: 'github-dark-default', light: 'github-light-default' } as const;
+const unsafeCSS = '[data-gutter] { -webkit-user-select: none; user-select: none; }';
+
+export function getStoredDiffStyle(): DiffStyle {
+ try {
+ const value = localStorage.getItem(diffStyleStorageKey);
+ if (value === 'unified' || value === 'split') {
+ return value;
+ }
+ } catch {}
+
+ return 'unified';
+}
+
+export function storeDiffStyle(diffStyle: DiffStyle): void {
+ try {
+ localStorage.setItem(diffStyleStorageKey, diffStyle);
+ } catch {}
+}
+
+export function createDiff(
+ container: HTMLElement,
+ currentContent: string,
+ selectedContent: string,
+ diffStyle: DiffStyle,
+): RenderedDiff {
+ const sharedOptions = {
+ theme,
+ disableFileHeader: true,
+ disableLineNumbers: !settings.showLineNumbers,
+ overflow: settings.wrapLines ? 'wrap' as const : 'scroll' as const,
+ unsafeCSS,
+ };
+
+ if (selectedContent === currentContent) {
+ const file = new File({
+ ...sharedOptions,
+ });
+
+ file.render({
+ file: { name: 'document.md', contents: selectedContent, lang: 'markdown' },
+ containerWrapper: container,
+ });
+
+ return file;
+ }
+
+ const fileDiff = new FileDiff({
+ ...sharedOptions,
+ diffStyle,
+ diffIndicators: settings.diffIndicators,
+ hunkSeparators: settings.hunkSeparators,
+ lineDiffType: settings.lineDiff,
+ expandUnchanged: settings.expandUnchanged,
+ expansionLineCount: settings.expansionLineCount,
+ });
+
+ fileDiff.render({
+ oldFile: { name: 'document.md', contents: currentContent, lang: 'markdown' },
+ newFile: { name: 'document.md', contents: selectedContent, lang: 'markdown' },
+ containerWrapper: container,
+ });
+
+ return fileDiff;
+}
diff --git a/src/interaction.ts b/src/interaction.ts
new file mode 100644
index 0000000..dc08fc3
--- /dev/null
+++ b/src/interaction.ts
@@ -0,0 +1,107 @@
+import type { FileVersion } from 'markedit-api';
+import type { BrowserElements } from './view';
+
+export interface RequestGate {
+ begin(): number;
+ invalidate(): void;
+ isCurrent(request: number): boolean;
+}
+
+export interface BrowserActionState {
+ busy: boolean;
+ hasVersions: boolean;
+ selectedVersion?: FileVersion;
+ isDownloaded: boolean;
+ hasDifferences: boolean | undefined;
+}
+
+export function createRequestGate(): RequestGate {
+ let currentRequest = 0;
+
+ return {
+ begin() {
+ currentRequest += 1;
+ return currentRequest;
+ },
+
+ invalidate() {
+ currentRequest += 1;
+ },
+
+ isCurrent(request: number) {
+ return request === currentRequest;
+ },
+ };
+}
+
+export function updateBrowserActions(elements: BrowserElements, state: BrowserActionState): void {
+ const {
+ versionSelect,
+ nonlocalIndicator,
+ restoreWrapper,
+ deleteWrapper,
+ restoreDescription,
+ deleteDescription,
+ restoreButton,
+ deleteButton,
+ layoutButtons,
+ } = elements;
+
+ const disabled = state.busy || state.selectedVersion === undefined;
+ const isNonlocal = state.selectedVersion?.isLocal === false;
+ const restoreHasNoDifferences = !disabled && state.hasDifferences === false;
+
+ nonlocalIndicator.classList.toggle('is-visible', isNonlocal);
+ nonlocalIndicator.setAttribute('aria-hidden', String(!isNonlocal));
+ nonlocalIndicator.classList.toggle('is-downloaded', state.isDownloaded);
+ nonlocalIndicator.title = state.isDownloaded ? 'Downloaded from iCloud' : 'Stored in iCloud';
+ nonlocalIndicator.setAttribute('aria-label', nonlocalIndicator.title);
+
+ restoreButton.disabled = disabled || state.hasDifferences === undefined;
+ if (restoreHasNoDifferences) {
+ restoreButton.setAttribute('aria-disabled', 'true');
+ restoreButton.setAttribute('aria-describedby', restoreDescription.id);
+ } else {
+ restoreButton.removeAttribute('aria-disabled');
+ restoreButton.removeAttribute('aria-describedby');
+ }
+
+ restoreWrapper.title = restoreHasNoDifferences ? 'The selected version is identical to the current document.' : '';
+ deleteButton.disabled = disabled;
+ if (isNonlocal) {
+ deleteButton.setAttribute('aria-disabled', 'true');
+ deleteButton.setAttribute('aria-describedby', deleteDescription.id);
+ } else {
+ deleteButton.removeAttribute('aria-disabled');
+ deleteButton.removeAttribute('aria-describedby');
+ }
+
+ deleteWrapper.title = isNonlocal ? 'Versions stored in iCloud cannot be deleted.' : '';
+ layoutButtons.forEach((button) => button.disabled = disabled);
+ versionSelect.disabled = state.busy || !state.hasVersions;
+}
+
+export function keepFocusWithinBrowser(overlay: HTMLElement, event: KeyboardEvent): void {
+ const focusableElements = Array.from(overlay.querySelectorAll(
+ 'button:not(:disabled), select:not(:disabled), [href], [tabindex]:not([tabindex="-1"])',
+ ));
+
+ const firstElement = focusableElements[0];
+ const lastElement = focusableElements.at(-1);
+
+ if (firstElement === undefined || lastElement === undefined) {
+ event.preventDefault();
+ overlay.focus();
+ return;
+ }
+
+ const activeElement = document.activeElement;
+ const focusIsOutsideControls = activeElement === overlay || !overlay.contains(activeElement);
+ if (event.shiftKey && (activeElement === firstElement || focusIsOutsideControls)) {
+ event.preventDefault();
+ lastElement.focus();
+ } else if (!event.shiftKey && (activeElement === lastElement || focusIsOutsideControls)) {
+ event.preventDefault();
+ firstElement.focus();
+ }
+}
diff --git a/src/pierre-themes.ts b/src/pierre-themes.ts
new file mode 100644
index 0000000..6dc823d
--- /dev/null
+++ b/src/pierre-themes.ts
@@ -0,0 +1,46 @@
+import { normalizeTheme } from 'shiki/core';
+import type { ThemeRegistration } from 'shiki/core';
+
+type ThemeLoader = () => Promise<{ default: ThemeRegistration }>;
+
+interface ThemeOptions {
+ name: string;
+ colorScheme?: 'light' | 'dark';
+ collection?: string;
+ displayName?: string;
+ load: ThemeLoader;
+}
+
+export function createTheme(options: ThemeOptions) {
+ return {
+ ...options,
+ load: async() => normalizeTheme((await options.load()).default),
+ };
+}
+
+const descriptors = [
+ createTheme({
+ name: 'github-light-default',
+ colorScheme: 'light',
+ collection: 'github',
+ displayName: 'GitHub Light Default',
+ load: () => import('@shikijs/themes/github-light-default'),
+ }),
+ createTheme({
+ name: 'github-dark-default',
+ colorScheme: 'dark',
+ collection: 'github',
+ displayName: 'GitHub Dark Default',
+ load: () => import('@shikijs/themes/github-dark-default'),
+ }),
+];
+
+export const pierreThemes = {
+ getTheme: (name: string) => descriptors.find((theme) => theme.name === name),
+ getThemes: () => descriptors,
+};
+
+export const shikiThemes = {
+ getTheme: () => undefined,
+ getThemes: () => [],
+};
diff --git a/src/settings.ts b/src/settings.ts
new file mode 100644
index 0000000..3ca9506
--- /dev/null
+++ b/src/settings.ts
@@ -0,0 +1,74 @@
+import { MarkEdit } from 'markedit-api';
+
+export const settingsKey = 'extension.markeditVersionBrowser';
+
+export type DiffStyle = 'unified' | 'split';
+export type LineDiff = 'word-alt' | 'word' | 'char' | 'none';
+export type DiffIndicators = 'classic' | 'bars' | 'none';
+export type HunkSeparators = 'simple' | 'metadata' | 'line-info' | 'line-info-basic';
+
+export interface VersionBrowserSettings {
+ wrapLines: boolean;
+ showLineNumbers: boolean;
+ lineDiff: LineDiff;
+ expandUnchanged: boolean;
+ expansionLineCount: number;
+ diffIndicators: DiffIndicators;
+ hunkSeparators: HunkSeparators;
+}
+
+export const defaultSettings: VersionBrowserSettings = {
+ wrapLines: true,
+ showLineNumbers: true,
+ lineDiff: 'word-alt',
+ expandUnchanged: false,
+ expansionLineCount: 20,
+ diffIndicators: 'classic',
+ hunkSeparators: 'line-info',
+};
+
+const lineDiffs = ['word-alt', 'word', 'char', 'none'] as const;
+const diffIndicators = ['classic', 'bars', 'none'] as const;
+const hunkSeparators = ['simple', 'metadata', 'line-info', 'line-info-basic'] as const;
+
+export function parseSettings(userSettings: unknown): VersionBrowserSettings {
+ const rootValue = toObject(toObject(userSettings)[settingsKey]);
+
+ return {
+ wrapLines: toBoolean(rootValue.wrapLines, defaultSettings.wrapLines),
+ showLineNumbers: toBoolean(rootValue.showLineNumbers, defaultSettings.showLineNumbers),
+ lineDiff: toOption(rootValue.lineDiff, lineDiffs, defaultSettings.lineDiff),
+ expandUnchanged: toBoolean(rootValue.expandUnchanged, defaultSettings.expandUnchanged),
+ expansionLineCount: toInteger(rootValue.expansionLineCount, defaultSettings.expansionLineCount, 1, 100),
+ diffIndicators: toOption(rootValue.diffIndicators, diffIndicators, defaultSettings.diffIndicators),
+ hunkSeparators: toOption(rootValue.hunkSeparators, hunkSeparators, defaultSettings.hunkSeparators),
+ };
+}
+
+export const settings = parseSettings(MarkEdit.userSettings);
+
+function toObject(value: unknown): Record {
+ return typeof value === 'object' && value !== null && !Array.isArray(value)
+ ? value as Record
+ : {};
+}
+
+function toBoolean(value: unknown, defaultValue: boolean): boolean {
+ return typeof value === 'boolean' ? value : defaultValue;
+}
+
+function toInteger(value: unknown, defaultValue: number, minimum: number, maximum: number): number {
+ return typeof value === 'number' && Number.isInteger(value)
+ ? Math.min(Math.max(value, minimum), maximum)
+ : defaultValue;
+}
+
+function toOption(
+ value: unknown,
+ options: Options,
+ defaultValue: Options[number],
+): Options[number] {
+ return typeof value === 'string' && options.includes(value)
+ ? value
+ : defaultValue;
+}
diff --git a/src/shiki.ts b/src/shiki.ts
new file mode 100644
index 0000000..afa2a97
--- /dev/null
+++ b/src/shiki.ts
@@ -0,0 +1,17 @@
+export {
+ codeToHtml,
+ createCssVariablesTheme,
+ createHighlighterCore as createHighlighter,
+ getTokenStyleObject,
+ stringifyTokenStyle,
+} from 'shiki/core';
+
+export { createJavaScriptRegexEngine } from 'shiki/engine/javascript';
+
+export const bundledLanguages = {
+ markdown: () => import('@shikijs/langs/markdown'),
+};
+
+export function createOnigurumaEngine(): never {
+ throw new Error('The Oniguruma highlighter is not bundled.');
+}
diff --git a/src/status.ts b/src/status.ts
new file mode 100644
index 0000000..29e28ed
--- /dev/null
+++ b/src/status.ts
@@ -0,0 +1,86 @@
+export interface BrowserStatus {
+ show(message: string, loading?: boolean): number;
+ hide(): void;
+ settle(id: number): Promise;
+ dispose(): void;
+}
+
+const spinnerDelay = 300;
+const spinnerMinimumDuration = 200;
+
+export function createBrowserStatus(
+ status: HTMLElement,
+ diffContainer: HTMLElement,
+ isClosing: () => boolean,
+): BrowserStatus {
+ let statusID = 0;
+ let spinnerTimer: number | undefined;
+ let spinnerShownAt: number | undefined;
+
+ const dispose = () => {
+ statusID += 1;
+ window.clearTimeout(spinnerTimer);
+ spinnerTimer = undefined;
+ spinnerShownAt = undefined;
+ };
+
+ return {
+ show(message: string, loading = false) {
+ dispose();
+ const currentStatusID = statusID;
+
+ status.replaceChildren();
+ status.append(message);
+
+ if (loading) {
+ status.hidden = true;
+ spinnerTimer = window.setTimeout(() => {
+ spinnerTimer = undefined;
+
+ if (!isClosing() && currentStatusID === statusID) {
+ const spinner = document.createElement('span');
+ spinner.className = 'version-browser-spinner';
+ status.prepend(spinner);
+ status.hidden = false;
+ spinnerShownAt = performance.now();
+ }
+ }, spinnerDelay);
+ } else {
+ status.hidden = false;
+ }
+
+ diffContainer.hidden = true;
+ return currentStatusID;
+ },
+
+ hide() {
+ dispose();
+ status.hidden = true;
+ },
+
+ async settle(currentStatusID: number) {
+ if (currentStatusID !== statusID) {
+ return;
+ }
+
+ window.clearTimeout(spinnerTimer);
+ spinnerTimer = undefined;
+ const shownAt = spinnerShownAt;
+
+ if (shownAt === undefined) {
+ return;
+ }
+
+ const remaining = spinnerMinimumDuration - (performance.now() - shownAt);
+ if (remaining > 0) {
+ await new Promise((resolve) => window.setTimeout(resolve, remaining));
+ }
+
+ if (currentStatusID === statusID && spinnerShownAt === shownAt) {
+ spinnerShownAt = undefined;
+ }
+ },
+
+ dispose,
+ };
+}
diff --git a/src/view.ts b/src/view.ts
new file mode 100644
index 0000000..9ef69c1
--- /dev/null
+++ b/src/view.ts
@@ -0,0 +1,107 @@
+import type { FileVersion } from 'markedit-api';
+import type { DiffStyle } from './diff';
+import browserCSS from '../assets/browser.css?inline';
+import browserHTML from '../assets/browser.html?raw';
+import cloudSVG from '../assets/cloud.svg?raw';
+import downloadedSVG from '../assets/downloaded.svg?raw';
+
+export interface BrowserElements {
+ overlay: HTMLElement;
+ versionSelect: HTMLSelectElement;
+ status: HTMLElement;
+ diffContainer: HTMLElement;
+ nonlocalIndicator: HTMLElement;
+ restoreWrapper: HTMLElement;
+ deleteWrapper: HTMLElement;
+ restoreDescription: HTMLElement;
+ deleteDescription: HTMLElement;
+ restoreButton: HTMLButtonElement;
+ deleteButton: HTMLButtonElement;
+ closeButton: HTMLButtonElement;
+ layoutButtons: HTMLButtonElement[];
+}
+
+const versionDateFormatter = new Intl.DateTimeFormat(undefined, {
+ dateStyle: 'medium',
+ timeStyle: 'short',
+});
+
+// Unique identifier for each instance to ensure unique element IDs
+let browserInstanceID = 0;
+
+export function createBrowserElements(diffStyle: DiffStyle): BrowserElements | undefined {
+ const overlay = document.createElement('section');
+ overlay.className = 'markedit-version-browser';
+ overlay.tabIndex = -1;
+ overlay.setAttribute('aria-label', 'Version browser');
+ overlay.setAttribute('aria-modal', 'true');
+ overlay.setAttribute('role', 'dialog');
+ overlay.innerHTML = browserHTML;
+
+ const versionSelect = overlay.querySelector('.version-browser-select');
+ const status = overlay.querySelector('.version-browser-status');
+ const diffContainer = overlay.querySelector('.version-browser-diff');
+ const nonlocalIndicator = overlay.querySelector('.version-browser-nonlocal');
+ const restoreWrapper = overlay.querySelector('.version-browser-restore-wrapper');
+ const deleteWrapper = overlay.querySelector('.version-browser-delete-wrapper');
+ const restoreDescription = overlay.querySelector('.version-browser-restore-description');
+ const deleteDescription = overlay.querySelector('.version-browser-delete-description');
+ const restoreButton = overlay.querySelector('[data-action="restore"]');
+ const deleteButton = overlay.querySelector('[data-action="delete"]');
+ const closeButton = overlay.querySelector('[data-action="close"]');
+
+ if (versionSelect === null || status === null || diffContainer === null || nonlocalIndicator === null || restoreWrapper === null || deleteWrapper === null || restoreDescription === null || deleteDescription === null || restoreButton === null || deleteButton === null || closeButton === null) {
+ return undefined;
+ }
+
+ browserInstanceID += 1;
+ restoreDescription.id = `version-browser-restore-description-${browserInstanceID}`;
+ deleteDescription.id = `version-browser-delete-description-${browserInstanceID}`;
+
+ const layoutButtons = Array.from(overlay.querySelectorAll('[data-style]'));
+ setLayoutButtonState(layoutButtons, diffStyle);
+ nonlocalIndicator.innerHTML = `
+ ${cloudSVG}
+ ${downloadedSVG}
+ `;
+
+ return {
+ overlay,
+ versionSelect,
+ status,
+ diffContainer,
+ nonlocalIndicator,
+ restoreWrapper,
+ deleteWrapper,
+ restoreDescription,
+ deleteDescription,
+ restoreButton,
+ deleteButton,
+ closeButton,
+ layoutButtons,
+ };
+}
+
+export function populateVersionSelect(select: HTMLSelectElement, versions: FileVersion[]): void {
+ const options = versions.map((version) => new Option(
+ versionDateFormatter.format(new Date(version.modificationDate)),
+ version.id,
+ ));
+
+ select.replaceChildren(...options);
+}
+
+export function setLayoutButtonState(buttons: HTMLButtonElement[], diffStyle: DiffStyle): void {
+ buttons.forEach((button) => {
+ const selected = button.dataset.style === diffStyle;
+ button.classList.toggle('active', selected);
+ button.setAttribute('aria-pressed', String(selected));
+ });
+}
+
+export function installBrowserStyle(): HTMLStyleElement {
+ const style = document.createElement('style');
+ style.textContent = browserCSS;
+ document.head.appendChild(style);
+ return style;
+}
diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts
new file mode 100644
index 0000000..11f02fe
--- /dev/null
+++ b/src/vite-env.d.ts
@@ -0,0 +1 @@
+///
diff --git a/tests/browser.test.ts b/tests/browser.test.ts
new file mode 100644
index 0000000..f476643
--- /dev/null
+++ b/tests/browser.test.ts
@@ -0,0 +1,404 @@
+// @vitest-environment jsdom
+
+import type { FileVersion } from 'markedit-api';
+import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
+
+const markEdit = vi.hoisted(() => ({
+ getFileVersions: vi.fn(),
+ getFileVersionContent: vi.fn(),
+ restoreFileVersion: vi.fn(),
+ deleteLocalFileVersions: vi.fn(),
+ showAlert: vi.fn(),
+ editorAPI: { getText: vi.fn() },
+ editorView: undefined as unknown as {
+ dom: HTMLElement;
+ contentDOM: { blur(): void };
+ focus(): void;
+ },
+}));
+
+const diff = vi.hoisted(() => ({
+ create: vi.fn((_container: HTMLElement, _currentContent: string, _selectedContent: string, _diffStyle: string) => ({ cleanUp: vi.fn() })),
+ getStyle: vi.fn(() => 'unified'),
+ storeStyle: vi.fn(),
+}));
+
+vi.mock('markedit-api', () => ({ MarkEdit: markEdit }));
+vi.mock('../src/diff', () => ({
+ createDiff: diff.create,
+ getStoredDiffStyle: diff.getStyle,
+ storeDiffStyle: diff.storeStyle,
+}));
+
+import { showVersionBrowser } from '../src/browser';
+
+describe('version browser workflow', () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ document.body.replaceChildren();
+ document.head.querySelectorAll('style').forEach((style) => style.remove());
+
+ const editorElement = document.createElement('div');
+ markEdit.editorView = {
+ dom: editorElement,
+ contentDOM: { blur: vi.fn() },
+ focus: vi.fn(),
+ };
+
+ markEdit.editorAPI.getText.mockReturnValue('current');
+ markEdit.showAlert.mockResolvedValue(1);
+ markEdit.restoreFileVersion.mockResolvedValue(false);
+ markEdit.deleteLocalFileVersions.mockResolvedValue(false);
+
+ vi.stubGlobal('ResizeObserver', ResizeObserverStub);
+ vi.stubGlobal('requestAnimationFrame', (callback: FrameRequestCallback) => {
+ callback(0);
+ return 1;
+ });
+
+ Object.defineProperty(window, 'matchMedia', {
+ configurable: true,
+ value: vi.fn(() => ({ matches: true })),
+ });
+ });
+
+ afterEach(async() => {
+ const overlay = document.querySelector('.markedit-version-browser');
+ overlay?.querySelector('[data-action="close"]')?.click();
+ overlay?.dispatchEvent(new Event('transitionend'));
+ await Promise.resolve();
+ vi.unstubAllGlobals();
+ });
+
+ test('offers the latest release when file version history is unsupported', async() => {
+ const getFileVersions = markEdit.getFileVersions;
+ markEdit.getFileVersions = undefined as never;
+ markEdit.showAlert.mockResolvedValueOnce(1);
+ const open = vi.fn();
+ vi.stubGlobal('open', open);
+
+ showVersionBrowser();
+ markEdit.getFileVersions = getFileVersions;
+ await flushPromises();
+
+ expect(markEdit.showAlert).toHaveBeenCalledWith({
+ title: 'Version Browser Unavailable',
+ message: 'This version of MarkEdit does not support file version history.',
+ buttons: ['OK', 'Get Latest Version'],
+ });
+ expect(open).toHaveBeenCalledWith('https://github.com/MarkEdit-app/MarkEdit/releases/latest');
+ expect(markEdit.editorAPI.getText).not.toHaveBeenCalled();
+ expect(document.querySelector('.markedit-version-browser')).toBeNull();
+ });
+
+ test('reopened browsers use unique description IDs while overlays overlap', () => {
+ markEdit.getFileVersions.mockReturnValue(new Promise(() => {}));
+
+ showVersionBrowser();
+ showVersionBrowser();
+
+ const overlays = Array.from(document.querySelectorAll('.markedit-version-browser'));
+ const descriptionIDs = overlays.flatMap((overlay) => Array.from(
+ overlay.querySelectorAll('.version-browser-restore-description, .version-browser-delete-description'),
+ (description) => description.id,
+ ));
+
+ expect(overlays).toHaveLength(2);
+ expect(descriptionIDs).toHaveLength(4);
+ expect(new Set(descriptionIDs)).toHaveLength(4);
+ overlays[0].dispatchEvent(new Event('transitionend'));
+ });
+
+ test('a slower selection cannot replace a newer selection', async() => {
+ const firstVersion = createVersion('first');
+ const secondVersion = createVersion('second');
+ const secondContent = deferred();
+
+ markEdit.getFileVersions.mockResolvedValue([firstVersion, secondVersion]);
+ markEdit.getFileVersionContent.mockImplementation((id: string) => (
+ id === secondVersion.id ? secondContent.promise : Promise.resolve('first content')
+ ));
+
+ showVersionBrowser();
+ await waitForRenderedContent('first content');
+
+ selectVersion(secondVersion.id);
+ await vi.waitFor(() => expect(markEdit.getFileVersionContent).toHaveBeenCalledWith(secondVersion.id));
+ selectVersion(firstVersion.id);
+ await vi.waitFor(() => expect(diff.create).toHaveBeenCalledTimes(2));
+
+ secondContent.resolve('second content');
+ await flushPromises();
+
+ expect(diff.create).not.toHaveBeenCalledWith(
+ expect.anything(),
+ expect.anything(),
+ 'second content',
+ expect.anything(),
+ );
+
+ expect(diff.create.mock.calls.at(-1)?.[2]).toBe('first content');
+ });
+
+ test('an uncached local version hides the previous diff while loading', async() => {
+ const firstVersion = createVersion('first');
+ const secondVersion = createVersion('second');
+ const secondContent = deferred();
+
+ markEdit.getFileVersions.mockResolvedValue([firstVersion, secondVersion]);
+ markEdit.getFileVersionContent.mockImplementation((id: string) => (
+ id === secondVersion.id ? secondContent.promise : Promise.resolve('first content')
+ ));
+
+ showVersionBrowser();
+ await waitForRenderedContent('first content');
+ const diffContainer = document.querySelector('.version-browser-diff')!;
+ expect(diffContainer.hidden).toBe(false);
+
+ selectVersion(secondVersion.id);
+ await vi.waitFor(() => expect(markEdit.getFileVersionContent).toHaveBeenCalledWith(secondVersion.id));
+ expect(diffContainer.hidden).toBe(true);
+
+ secondContent.resolve('second content');
+ await waitForRenderedContent('second content');
+ expect(diffContainer.hidden).toBe(false);
+ });
+
+ test('a failed newest-version probe keeps the version list available', async() => {
+ const version = createVersion('first');
+
+ markEdit.getFileVersions.mockResolvedValue([version]);
+ markEdit.getFileVersionContent
+ .mockRejectedValueOnce(new Error('probe failed'))
+ .mockResolvedValueOnce('first content');
+
+ showVersionBrowser();
+ await waitForRenderedContent('first content');
+
+ expect(markEdit.getFileVersionContent).toHaveBeenCalledTimes(2);
+ expect(getVersionSelect().disabled).toBe(false);
+ });
+
+ test('successful version contents are reused within the browser session', async() => {
+ const firstVersion = createVersion('first');
+ const secondVersion = createVersion('second', false);
+
+ markEdit.getFileVersions.mockResolvedValue([firstVersion, secondVersion]);
+ markEdit.getFileVersionContent.mockImplementation((id: string) => Promise.resolve(`${id} content`));
+
+ showVersionBrowser();
+ await waitForRenderedContent('first content');
+ selectVersion(secondVersion.id);
+ await waitForRenderedContent('second content');
+ selectVersion(firstVersion.id);
+ await vi.waitFor(() => expect(diff.create.mock.calls.at(-1)?.[2]).toBe('first content'));
+ selectVersion(secondVersion.id);
+ await vi.waitFor(() => expect(diff.create.mock.calls.at(-1)?.[2]).toBe('second content'));
+
+ expect(markEdit.getFileVersionContent).toHaveBeenCalledTimes(2);
+ expect(markEdit.getFileVersionContent).toHaveBeenCalledWith(firstVersion.id);
+ expect(markEdit.getFileVersionContent).toHaveBeenCalledWith(secondVersion.id);
+ });
+
+ test('deleting during a fetch prevents stale content from rendering', async() => {
+ const firstVersion = createVersion('first');
+ const secondVersion = createVersion('second');
+ const secondContent = deferred();
+ const deletion = deferred();
+
+ markEdit.getFileVersions.mockResolvedValue([firstVersion, secondVersion]);
+ markEdit.getFileVersionContent.mockImplementation((id: string) => (
+ id === secondVersion.id ? secondContent.promise : Promise.resolve('first content')
+ ));
+
+ markEdit.showAlert.mockResolvedValue(0);
+ markEdit.deleteLocalFileVersions.mockReturnValue(deletion.promise);
+
+ showVersionBrowser();
+ await waitForRenderedContent('first content');
+ selectVersion(secondVersion.id);
+ getButton('delete').click();
+
+ await vi.waitFor(() => expect(markEdit.deleteLocalFileVersions).toHaveBeenCalledWith([secondVersion.id]));
+ secondContent.resolve('second content');
+ await flushPromises();
+
+ expect(getStatus().textContent).toBe('Deleting version...');
+ expect(diff.create).not.toHaveBeenCalledWith(
+ expect.anything(),
+ expect.anything(),
+ 'second content',
+ expect.anything(),
+ );
+
+ deletion.resolve(false);
+ await vi.waitFor(() => expect(getStatus().textContent).toBe('The version could not be deleted.'));
+ });
+
+ test('a failed reload leaves the empty selector disabled', async() => {
+ const version = createVersion('first');
+
+ markEdit.getFileVersions
+ .mockResolvedValueOnce([version])
+ .mockRejectedValueOnce(new Error('reload failed'));
+ markEdit.getFileVersionContent.mockResolvedValue('first content');
+ markEdit.showAlert.mockResolvedValue(0);
+ markEdit.deleteLocalFileVersions.mockResolvedValue(true);
+
+ showVersionBrowser();
+ await waitForRenderedContent('first content');
+ getButton('delete').click();
+
+ await vi.waitFor(() => expect(getStatus().textContent).toBe('Version history could not be loaded.'));
+ const select = getVersionSelect();
+
+ expect(select.disabled).toBe(true);
+ expect(select.options).toHaveLength(1);
+ expect(select.options[0].text).toBe('');
+ expect(getButton('restore').disabled).toBe(true);
+ });
+
+ test('restore starts immediately without confirmation', async() => {
+ const version = createVersion('first');
+
+ markEdit.getFileVersions.mockResolvedValue([version]);
+ markEdit.getFileVersionContent.mockResolvedValue('first content');
+
+ showVersionBrowser();
+ await waitForRenderedContent('first content');
+ getButton('restore').click();
+
+ await vi.waitFor(() => expect(markEdit.restoreFileVersion).toHaveBeenCalledWith(version.id));
+ expect(markEdit.showAlert).not.toHaveBeenCalled();
+ });
+
+ test('identical content explains why Restore is unavailable', async() => {
+ const differentVersion = createVersion('different');
+ const identicalVersion = createVersion('identical');
+
+ markEdit.getFileVersions.mockResolvedValue([differentVersion, identicalVersion]);
+ markEdit.getFileVersionContent.mockImplementation((id: string) => Promise.resolve(
+ id === identicalVersion.id ? 'current' : 'different content',
+ ));
+
+ showVersionBrowser();
+ await waitForRenderedContent('different content');
+ selectVersion(identicalVersion.id);
+ await waitForRenderedContent('current');
+
+ const restoreButton = getButton('restore');
+ expect(restoreButton.disabled).toBe(false);
+ expect(restoreButton.getAttribute('aria-disabled')).toBe('true');
+ expect(document.getElementById(restoreButton.getAttribute('aria-describedby') ?? '')?.textContent).toBe('The selected version is identical to the current document.');
+ expect(restoreButton.parentElement?.title).toBe('The selected version is identical to the current document.');
+
+ restoreButton.click();
+ expect(markEdit.restoreFileVersion).not.toHaveBeenCalled();
+ });
+
+ test('an iCloud version becomes downloaded after its content arrives', async() => {
+ const localVersion = createVersion('local');
+ const version = createVersion('icloud', false);
+ const content = deferred();
+
+ markEdit.getFileVersions.mockResolvedValue([localVersion, version]);
+ markEdit.getFileVersionContent.mockImplementation((id: string) => (
+ id === version.id ? content.promise : Promise.resolve('local content')
+ ));
+
+ showVersionBrowser();
+ await waitForRenderedContent('local content');
+ selectVersion(version.id);
+
+ const indicator = await vi.waitFor(() => {
+ const element = document.querySelector('.version-browser-nonlocal');
+ expect(element?.classList.contains('is-visible')).toBe(true);
+ return element!;
+ });
+ expect(indicator.title).toBe('Stored in iCloud');
+ expect(indicator.getAttribute('role')).toBe('img');
+ expect(getButton('delete').disabled).toBe(false);
+ expect(getButton('delete').getAttribute('aria-disabled')).toBe('true');
+ expect(document.getElementById(getButton('delete').getAttribute('aria-describedby') ?? '')?.textContent).toBe('Versions stored in iCloud cannot be deleted.');
+ getButton('delete').click();
+ expect(markEdit.showAlert).not.toHaveBeenCalled();
+
+ content.resolve('icloud content');
+ await vi.waitFor(() => expect(indicator.title).toBe('Downloaded from iCloud'));
+ expect(indicator.classList.contains('is-downloaded')).toBe(true);
+ expect(diff.create.mock.calls.at(-1)?.[2]).toBe('icloud content');
+ });
+
+ test('version picker focus styling follows keyboard input', async() => {
+ const version = createVersion('first');
+
+ markEdit.getFileVersions.mockResolvedValue([version]);
+ markEdit.getFileVersionContent.mockResolvedValue('first content');
+
+ showVersionBrowser();
+ await waitForRenderedContent('first content');
+
+ const overlay = document.querySelector('.markedit-version-browser')!;
+ const select = getVersionSelect();
+
+ window.dispatchEvent(new KeyboardEvent('keydown', { key: 'Tab' }));
+ expect(overlay.classList.contains('is-keyboard-navigation')).toBe(true);
+
+ select.dispatchEvent(new Event('pointerdown', { bubbles: true }));
+ expect(overlay.classList.contains('is-keyboard-navigation')).toBe(false);
+ });
+});
+
+class ResizeObserverStub {
+ observe(): void {}
+ disconnect(): void {}
+}
+
+function createVersion(id: string, isLocal = true): FileVersion {
+ return {
+ id,
+ modificationDate: new Date(0),
+ isLocal,
+ };
+}
+
+function getVersionSelect(): HTMLSelectElement {
+ return document.querySelector('.version-browser-select')!;
+}
+
+function selectVersion(id: string): void {
+ const select = getVersionSelect();
+ select.value = id;
+ select.dispatchEvent(new Event('change', { bubbles: true }));
+}
+
+function getButton(action: 'restore' | 'delete'): HTMLButtonElement {
+ return document.querySelector(`[data-action="${action}"]`)!;
+}
+
+function getStatus(): HTMLElement {
+ return document.querySelector('.version-browser-status')!;
+}
+
+async function waitForRenderedContent(content: string): Promise {
+ await vi.waitFor(() => expect(diff.create).toHaveBeenCalledWith(
+ expect.anything(),
+ 'current',
+ content,
+ 'unified',
+ ));
+}
+
+async function flushPromises(): Promise {
+ await Promise.resolve();
+ await Promise.resolve();
+}
+
+function deferred() {
+ let resolve!: (value: T) => void;
+ const promise = new Promise((resolvePromise) => {
+ resolve = resolvePromise;
+ });
+
+ return { promise, resolve };
+}
diff --git a/tests/diff.test.ts b/tests/diff.test.ts
new file mode 100644
index 0000000..427f888
--- /dev/null
+++ b/tests/diff.test.ts
@@ -0,0 +1,92 @@
+// @vitest-environment jsdom
+
+import { beforeEach, describe, expect, test, vi } from 'vitest';
+
+const pierre = vi.hoisted(() => ({
+ fileOptions: undefined as unknown,
+ fileDiffOptions: undefined as unknown,
+ fileRender: vi.fn(),
+ fileDiffRender: vi.fn(),
+}));
+
+const settings = vi.hoisted(() => ({
+ wrapLines: false,
+ showLineNumbers: false,
+ lineDiff: 'char' as const,
+ expandUnchanged: true,
+ expansionLineCount: 40,
+ diffIndicators: 'bars' as const,
+ hunkSeparators: 'metadata' as const,
+}));
+
+vi.mock('@pierre/diffs', () => ({
+ File: vi.fn(function FileMock(this: { render: typeof pierre.fileRender }, options: unknown) {
+ pierre.fileOptions = options;
+ this.render = pierre.fileRender;
+ }),
+ FileDiff: vi.fn(function FileDiffMock(this: { render: typeof pierre.fileDiffRender }, options: unknown) {
+ pierre.fileDiffOptions = options;
+ this.render = pierre.fileDiffRender;
+ }),
+}));
+
+vi.mock('../src/settings', () => ({ settings }));
+
+import { createDiff, getStoredDiffStyle } from '../src/diff';
+
+describe('diff rendering settings', () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ localStorage.clear();
+ pierre.fileOptions = undefined;
+ pierre.fileDiffOptions = undefined;
+ });
+
+ test('uses unified only when no toolbar choice is stored', () => {
+ expect(getStoredDiffStyle()).toBe('unified');
+
+ localStorage.setItem('markedit-version-browser.diff-style', 'split');
+ expect(getStoredDiffStyle()).toBe('split');
+ });
+
+ test('applies shared settings to identical content', () => {
+ const container = document.createElement('div');
+ createDiff(container, 'same', 'same', 'unified');
+
+ expect(pierre.fileOptions).toMatchObject({
+ theme: { dark: 'github-dark-default', light: 'github-light-default' },
+ disableFileHeader: true,
+ disableLineNumbers: true,
+ overflow: 'scroll',
+ });
+
+ expect(pierre.fileRender).toHaveBeenCalledWith({
+ file: { name: 'document.md', contents: 'same', lang: 'markdown' },
+ containerWrapper: container,
+ });
+ });
+
+ test('applies all settings to changed content', () => {
+ const container = document.createElement('div');
+ createDiff(container, 'old', 'new', 'unified');
+
+ expect(pierre.fileDiffOptions).toMatchObject({
+ theme: { dark: 'github-dark-default', light: 'github-light-default' },
+ diffStyle: 'unified',
+ diffIndicators: 'bars',
+ disableFileHeader: true,
+ disableLineNumbers: true,
+ overflow: 'scroll',
+ hunkSeparators: 'metadata',
+ lineDiffType: 'char',
+ expandUnchanged: true,
+ expansionLineCount: 40,
+ });
+
+ expect(pierre.fileDiffRender).toHaveBeenCalledWith({
+ oldFile: { name: 'document.md', contents: 'old', lang: 'markdown' },
+ newFile: { name: 'document.md', contents: 'new', lang: 'markdown' },
+ containerWrapper: container,
+ });
+ });
+});
diff --git a/tests/interaction.test.ts b/tests/interaction.test.ts
new file mode 100644
index 0000000..885b3e2
--- /dev/null
+++ b/tests/interaction.test.ts
@@ -0,0 +1,287 @@
+import assert from 'node:assert/strict';
+import type { FileVersion } from 'markedit-api';
+import { afterEach, test } from 'vitest';
+import { createRequestGate, keepFocusWithinBrowser, updateBrowserActions } from '../src/interaction.ts';
+import type { BrowserElements } from '../src/view.ts';
+
+const originalDocument = Object.getOwnPropertyDescriptor(globalThis, 'document');
+
+afterEach(() => {
+ if (originalDocument === undefined) {
+ Reflect.deleteProperty(globalThis, 'document');
+ } else {
+ Object.defineProperty(globalThis, 'document', originalDocument);
+ }
+});
+
+test('request gate rejects superseded and invalidated requests', () => {
+ const requests = createRequestGate();
+ const firstRequest = requests.begin();
+ const secondRequest = requests.begin();
+
+ assert.equal(requests.isCurrent(firstRequest), false);
+ assert.equal(requests.isCurrent(secondRequest), true);
+
+ requests.invalidate();
+ assert.equal(requests.isCurrent(secondRequest), false);
+});
+
+test('iCloud versions cannot be deleted and reflect download state', () => {
+ const context = createActionContext();
+ const version = createVersion(false);
+
+ updateBrowserActions(context.elements, {
+ busy: false,
+ hasVersions: true,
+ selectedVersion: version,
+ isDownloaded: false,
+ hasDifferences: true,
+ });
+
+ assert.equal(context.nonlocalIndicator.classList.contains('is-visible'), true);
+ assert.equal(context.nonlocalIndicator.getAttribute('aria-hidden'), 'false');
+ assert.equal(context.nonlocalIndicator.title, 'Stored in iCloud');
+ assert.equal(context.nonlocalIndicator.classList.contains('is-downloaded'), false);
+ assert.equal(context.deleteButton.disabled, false);
+ assert.equal(context.deleteButton.getAttribute('aria-disabled'), 'true');
+ assert.equal(context.deleteButton.getAttribute('aria-describedby'), context.deleteDescription.id);
+ assert.equal(context.deleteWrapper.title, 'Versions stored in iCloud cannot be deleted.');
+
+ updateBrowserActions(context.elements, {
+ busy: false,
+ hasVersions: true,
+ selectedVersion: version,
+ isDownloaded: true,
+ hasDifferences: true,
+ });
+
+ assert.equal(context.nonlocalIndicator.title, 'Downloaded from iCloud');
+ assert.equal(context.nonlocalIndicator.classList.contains('is-downloaded'), true);
+});
+
+test('local versions enable actions unless the browser is busy', () => {
+ const context = createActionContext();
+ const state = {
+ busy: false,
+ hasVersions: true,
+ selectedVersion: createVersion(true),
+ isDownloaded: false,
+ hasDifferences: true,
+ };
+
+ updateBrowserActions(context.elements, state);
+ assert.equal(context.nonlocalIndicator.classList.contains('is-visible'), false);
+ assert.equal(context.nonlocalIndicator.getAttribute('aria-hidden'), 'true');
+ assert.equal(context.restoreButton.disabled, false);
+ assert.equal(context.deleteButton.disabled, false);
+ assert.equal(context.deleteButton.getAttribute('aria-disabled'), null);
+ assert.equal(context.deleteButton.getAttribute('aria-describedby'), null);
+ assert.equal(context.versionSelect.disabled, false);
+ assert.equal(context.layoutButton.disabled, false);
+
+ updateBrowserActions(context.elements, { ...state, busy: true });
+ assert.equal(context.restoreButton.disabled, true);
+ assert.equal(context.deleteButton.disabled, true);
+ assert.equal(context.versionSelect.disabled, true);
+ assert.equal(context.layoutButton.disabled, true);
+});
+
+test('identical content keeps Restore focusable and explains why it is unavailable', () => {
+ const context = createActionContext();
+ const state = {
+ busy: false,
+ hasVersions: true,
+ selectedVersion: createVersion(true),
+ isDownloaded: false,
+ hasDifferences: false,
+ };
+
+ updateBrowserActions(context.elements, state);
+ assert.equal(context.restoreButton.disabled, false);
+ assert.equal(context.restoreButton.getAttribute('aria-disabled'), 'true');
+ assert.equal(context.restoreButton.getAttribute('aria-describedby'), context.restoreDescription.id);
+ assert.equal(context.restoreWrapper.title, 'The selected version is identical to the current document.');
+
+ updateBrowserActions(context.elements, { ...state, hasDifferences: true });
+ assert.equal(context.restoreButton.getAttribute('aria-disabled'), null);
+ assert.equal(context.restoreButton.getAttribute('aria-describedby'), null);
+ assert.equal(context.restoreWrapper.title, '');
+});
+
+test('focus wraps forward from the final control', () => {
+ const context = createFocusContext();
+ context.last.focus();
+
+ keepFocusWithinBrowser(context.overlay, context.createEvent(false));
+ assert.equal(context.activeElement(), context.first);
+ assert.equal(context.defaultPrevented(), true);
+});
+
+test('focus wraps backward from the first control', () => {
+ const context = createFocusContext();
+ context.first.focus();
+
+ keepFocusWithinBrowser(context.overlay, context.createEvent(true));
+ assert.equal(context.activeElement(), context.last);
+ assert.equal(context.defaultPrevented(), true);
+});
+
+test('focus enters the controls from the browser overlay', () => {
+ const context = createFocusContext();
+ context.overlay.focus();
+
+ keepFocusWithinBrowser(context.overlay, context.createEvent(false));
+ assert.equal(context.activeElement(), context.first);
+
+ context.overlay.focus();
+ keepFocusWithinBrowser(context.overlay, context.createEvent(true));
+ assert.equal(context.activeElement(), context.last);
+ assert.equal(context.defaultPrevented(), true);
+});
+
+test('focus stays within an empty browser', () => {
+ const context = createFocusContext([]);
+ keepFocusWithinBrowser(context.overlay, context.createEvent(false));
+ assert.equal(context.activeElement(), context.overlay);
+ assert.equal(context.defaultPrevented(), true);
+});
+
+function createFocusContext(elements?: HTMLElement[]) {
+ let activeElement: HTMLElement | null = null;
+ let prevented = false;
+ const documentStub = { get activeElement() { return activeElement; } };
+
+ Object.defineProperty(globalThis, 'document', {
+ configurable: true,
+ value: documentStub,
+ });
+
+ const createElement = () => ({
+ focus() {
+ activeElement = this as unknown as HTMLElement;
+ },
+ }) as unknown as HTMLElement;
+
+ const first = createElement();
+ const last = createElement();
+ const focusableElements = elements ?? [first, last];
+ const overlay = {
+ contains(element: HTMLElement) {
+ return element === overlay || focusableElements.includes(element);
+ },
+ focus() {
+ activeElement = this as unknown as HTMLElement;
+ },
+ querySelectorAll() {
+ return focusableElements;
+ },
+ } as unknown as HTMLElement;
+
+ return {
+ first,
+ last,
+ overlay,
+ activeElement: () => activeElement,
+ defaultPrevented: () => prevented,
+ createEvent: (shiftKey: boolean) => ({
+ shiftKey,
+ preventDefault() {
+ prevented = true;
+ },
+ }) as KeyboardEvent,
+ };
+}
+
+function createVersion(isLocal: boolean): FileVersion {
+ return {
+ id: isLocal ? 'local' : 'icloud',
+ modificationDate: new Date(0),
+ isLocal,
+ };
+}
+
+function createActionContext() {
+ const classes = new Set();
+ const attributes = new Map();
+ const nonlocalIndicator = {
+ title: '',
+ classList: {
+ toggle(name: string, enabled: boolean) {
+ if (enabled) {
+ classes.add(name);
+ } else {
+ classes.delete(name);
+ }
+ },
+ contains(name: string) {
+ return classes.has(name);
+ },
+ },
+ setAttribute(name: string, value: string) {
+ attributes.set(name, value);
+ },
+ getAttribute(name: string) {
+ return attributes.get(name) ?? null;
+ },
+ } as unknown as HTMLElement;
+
+ const versionSelect = { disabled: true } as HTMLSelectElement;
+ const restoreWrapper = { title: '' } as HTMLElement;
+ const deleteWrapper = { title: '' } as HTMLElement;
+ const restoreDescription = { id: 'restore-description' } as HTMLElement;
+ const deleteDescription = { id: 'delete-description' } as HTMLElement;
+ const restoreButtonAttributes = new Map();
+
+ const restoreButton = {
+ disabled: true,
+ setAttribute(name: string, value: string) {
+ restoreButtonAttributes.set(name, value);
+ },
+ removeAttribute(name: string) {
+ restoreButtonAttributes.delete(name);
+ },
+ getAttribute(name: string) {
+ return restoreButtonAttributes.get(name) ?? null;
+ },
+ } as HTMLButtonElement;
+
+ const deleteButtonAttributes = new Map();
+ const deleteButton = {
+ disabled: true,
+ setAttribute(name: string, value: string) {
+ deleteButtonAttributes.set(name, value);
+ },
+ removeAttribute(name: string) {
+ deleteButtonAttributes.delete(name);
+ },
+ getAttribute(name: string) {
+ return deleteButtonAttributes.get(name) ?? null;
+ },
+ } as HTMLButtonElement;
+
+ const layoutButton = { disabled: true } as HTMLButtonElement;
+ const elements = {
+ versionSelect,
+ nonlocalIndicator,
+ restoreWrapper,
+ deleteWrapper,
+ restoreDescription,
+ deleteDescription,
+ restoreButton,
+ deleteButton,
+ layoutButtons: [layoutButton],
+ } as BrowserElements;
+
+ return {
+ elements,
+ versionSelect,
+ nonlocalIndicator,
+ restoreWrapper,
+ deleteWrapper,
+ restoreDescription,
+ deleteDescription,
+ restoreButton,
+ deleteButton,
+ layoutButton,
+ };
+}
diff --git a/tests/settings.test.ts b/tests/settings.test.ts
new file mode 100644
index 0000000..36b87b8
--- /dev/null
+++ b/tests/settings.test.ts
@@ -0,0 +1,52 @@
+import { describe, expect, test, vi } from 'vitest';
+
+vi.mock('markedit-api', () => ({ MarkEdit: { userSettings: {} } }));
+
+import { defaultSettings, parseSettings, settingsKey } from '../src/settings';
+
+describe('version browser settings', () => {
+ test('uses defaults without the extension namespace', () => {
+ expect(parseSettings({})).toEqual(defaultSettings);
+ expect(parseSettings(null)).toEqual(defaultSettings);
+ });
+
+ test('parses all supported settings', () => {
+ expect(parseSettings({
+ [settingsKey]: {
+ wrapLines: false,
+ showLineNumbers: false,
+ lineDiff: 'char',
+ expandUnchanged: true,
+ expansionLineCount: 40,
+ diffIndicators: 'bars',
+ hunkSeparators: 'metadata',
+ },
+ })).toEqual({
+ wrapLines: false,
+ showLineNumbers: false,
+ lineDiff: 'char',
+ expandUnchanged: true,
+ expansionLineCount: 40,
+ diffIndicators: 'bars',
+ hunkSeparators: 'metadata',
+ });
+ });
+
+ test('defaults invalid fields and clamps the expansion count', () => {
+ const parsed = parseSettings({
+ [settingsKey]: {
+ wrapLines: 'yes',
+ showLineNumbers: null,
+ lineDiff: 'line',
+ expandUnchanged: 1,
+ expansionLineCount: 500,
+ diffIndicators: 'arrows',
+ hunkSeparators: 'custom',
+ },
+ });
+
+ expect(parsed).toEqual({ ...defaultSettings, expansionLineCount: 100 });
+ expect(parseSettings({ [settingsKey]: { expansionLineCount: 0 } }).expansionLineCount).toBe(1);
+ expect(parseSettings({ [settingsKey]: { expansionLineCount: 2.5 } }).expansionLineCount).toBe(20);
+ });
+});
diff --git a/tests/status.test.ts b/tests/status.test.ts
new file mode 100644
index 0000000..9026ead
--- /dev/null
+++ b/tests/status.test.ts
@@ -0,0 +1,140 @@
+import assert from 'node:assert/strict';
+import { test } from 'vitest';
+import { createBrowserStatus } from '../src/status.ts';
+
+test('loading status delay, cancellation, and minimum duration', async() => {
+ const clock = new FakeClock();
+ const originalWindow = Object.getOwnPropertyDescriptor(globalThis, 'window');
+ const originalDocument = Object.getOwnPropertyDescriptor(globalThis, 'document');
+ const originalPerformance = Object.getOwnPropertyDescriptor(globalThis, 'performance');
+
+ Object.defineProperties(globalThis, {
+ window: { configurable: true, value: clock.window },
+ document: {
+ configurable: true,
+ value: { createElement: () => ({ className: '' }) },
+ },
+ performance: {
+ configurable: true,
+ value: { now: () => clock.now },
+ },
+ });
+
+ try {
+ const statusElement = new StatusElement();
+ const diffContainer = { hidden: false } as HTMLElement;
+ const status = createBrowserStatus(
+ statusElement as unknown as HTMLElement,
+ diffContainer,
+ () => false,
+ );
+
+ const loadingID = status.show('Fetching contents...', true);
+ assert.equal(statusElement.hidden, true);
+ assert.equal(statusElement.text, 'Fetching contents...');
+ assert.equal(diffContainer.hidden, true);
+
+ clock.advance(299);
+ assert.equal(statusElement.hidden, true);
+ assert.equal(statusElement.spinnerCount, 0);
+
+ clock.advance(1);
+ assert.equal(statusElement.hidden, false);
+ assert.equal(statusElement.spinnerCount, 1);
+
+ let settled = false;
+ const settling = status.settle(loadingID).then(() => settled = true);
+
+ clock.advance(199);
+ await Promise.resolve();
+ assert.equal(settled, false);
+
+ clock.advance(1);
+ await settling;
+ assert.equal(settled, true);
+
+ status.show('Loading versions...', true);
+ status.hide();
+ clock.advance(300);
+ assert.equal(statusElement.hidden, true);
+ assert.equal(statusElement.spinnerCount, 1);
+
+ const staleID = status.show('Fetching contents...', true);
+ status.show('The version could not be loaded.');
+ await status.settle(staleID);
+ clock.advance(300);
+ assert.equal(statusElement.hidden, false);
+ assert.equal(statusElement.text, 'The version could not be loaded.');
+ assert.equal(statusElement.spinnerCount, 1);
+ } finally {
+ restoreProperty('window', originalWindow);
+ restoreProperty('document', originalDocument);
+ restoreProperty('performance', originalPerformance);
+ }
+});
+
+class StatusElement {
+ hidden = false;
+ text = '';
+ spinnerCount = 0;
+
+ replaceChildren(): void {
+ this.text = '';
+ }
+
+ append(message: string): void {
+ this.text += message;
+ }
+
+ prepend(): void {
+ this.spinnerCount += 1;
+ }
+}
+
+class FakeClock {
+ now = 0;
+ private nextTimerID = 1;
+ private timers = new Map void }>();
+
+ readonly window = {
+ setTimeout: (callback: () => void, delay = 0) => {
+ const timerID = this.nextTimerID++;
+ this.timers.set(timerID, { time: this.now + delay, callback });
+ return timerID;
+ },
+ clearTimeout: (timerID?: number) => {
+ if (timerID !== undefined) {
+ this.timers.delete(timerID);
+ }
+ },
+ };
+
+ advance(duration: number): void {
+ const targetTime = this.now + duration;
+
+ while (true) {
+ const nextTimer = [...this.timers.entries()]
+ .filter(([, timer]) => timer.time <= targetTime)
+ .sort((left, right) => left[1].time - right[1].time)[0];
+
+ if (nextTimer === undefined) {
+ break;
+ }
+
+ const [timerID, timer] = nextTimer;
+ this.timers.delete(timerID);
+ this.now = timer.time;
+ timer.callback();
+ }
+
+ this.now = targetTime;
+ }
+}
+
+function restoreProperty(name: 'window' | 'document' | 'performance', descriptor?: PropertyDescriptor): void {
+ if (descriptor === undefined) {
+ delete (globalThis as Record)[name];
+ } else {
+ Object.defineProperty(globalThis, name, descriptor);
+ }
+}
diff --git a/tests/themes.test.ts b/tests/themes.test.ts
new file mode 100644
index 0000000..dbb0965
--- /dev/null
+++ b/tests/themes.test.ts
@@ -0,0 +1,14 @@
+import { describe, expect, test, vi } from 'vitest';
+
+import { createTheme, pierreThemes } from '../src/pierre-themes';
+
+describe('Pierre theme shim', () => {
+ test('exports the custom theme factory required by Pierre', () => {
+ const load = vi.fn(async() => ({ default: {} as never }));
+ const descriptor = createTheme({ name: 'custom', load });
+
+ expect(descriptor.name).toBe('custom');
+ expect(descriptor.load).not.toBe(load);
+ expect(pierreThemes.getThemes()).not.toHaveLength(0);
+ });
+});
diff --git a/tsconfig.json b/tsconfig.json
new file mode 100644
index 0000000..732aeb7
--- /dev/null
+++ b/tsconfig.json
@@ -0,0 +1,15 @@
+{
+ "compilerOptions": {
+ "typeRoots": ["./node_modules/@types"],
+ "module": "esnext",
+ "target": "esnext",
+ "lib": ["es2019", "dom"],
+ "noImplicitAny": true,
+ "moduleResolution": "bundler",
+ "allowImportingTsExtensions": true,
+ "strictNullChecks": true,
+ "importHelpers": true,
+ "noEmit": true,
+ "skipLibCheck": true
+ }
+}
diff --git a/vite.config.mts b/vite.config.mts
new file mode 100644
index 0000000..c0e8ee5
--- /dev/null
+++ b/vite.config.mts
@@ -0,0 +1,20 @@
+import { fileURLToPath } from 'node:url';
+import { defineConfig, mergeConfig } from 'vite';
+import { defaultViteConfig } from 'markedit-vite';
+import { viteSingleFile } from 'vite-plugin-singlefile';
+
+export default defineConfig(mergeConfig(defaultViteConfig(), {
+ resolve: {
+ alias: [
+ {
+ find: /^shiki(?:\/wasm)?$/,
+ replacement: fileURLToPath(new URL('./src/shiki.ts', import.meta.url)),
+ },
+ {
+ find: /^@pierre\/theming\/themes$/,
+ replacement: fileURLToPath(new URL('./src/pierre-themes.ts', import.meta.url)),
+ },
+ ],
+ },
+ plugins: [viteSingleFile()],
+}));
diff --git a/vitest.config.mts b/vitest.config.mts
new file mode 100644
index 0000000..2928b54
--- /dev/null
+++ b/vitest.config.mts
@@ -0,0 +1,8 @@
+import { defineConfig } from 'vitest/config';
+
+export default defineConfig({
+ test: {
+ environment: 'node',
+ restoreMocks: true,
+ },
+});
\ No newline at end of file
diff --git a/yarn.lock b/yarn.lock
new file mode 100644
index 0000000..2d9137c
--- /dev/null
+++ b/yarn.lock
@@ -0,0 +1,1341 @@
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
+# yarn lockfile v1
+
+
+"@asamuzakjp/css-color@^6.0.5":
+ version "6.0.7"
+ resolved "https://registry.yarnpkg.com/@asamuzakjp/css-color/-/css-color-6.0.7.tgz#8f9f67452e6636930949abe047dd553b13276939"
+ integrity sha512-vC/bk1Lz7Tn/EfU9/apOTBk80/8dyGyWMowPoV1tJ52muDGsDqt2HPT2klrFUiY60MQmQv9q8yIht15JnBgDGw==
+ dependencies:
+ "@csstools/css-calc" "^3.3.0"
+ "@csstools/css-color-parser" "^4.1.10"
+ "@csstools/css-parser-algorithms" "^4.0.0"
+ "@csstools/css-tokenizer" "^4.0.0"
+ lru-cache "^11.5.2"
+
+"@asamuzakjp/dom-selector@^8.3.0":
+ version "8.3.2"
+ resolved "https://registry.yarnpkg.com/@asamuzakjp/dom-selector/-/dom-selector-8.3.2.tgz#1e84c1ea1e12a921c1aa94da4b1f657168f09596"
+ integrity sha512-93Z1N+BQNXysodoicpOIyNh2drHfz/CTf9nnT0FEx72GJcIiwgydD7tGAr78j41LsYn3hlRn+LdGPuBLn1Bl8Q==
+ dependencies:
+ bidi-js "^1.0.3"
+ css-tree "^3.2.1"
+ is-potential-custom-element-name "^1.0.1"
+ lru-cache "^11.5.2"
+
+"@bramus/specificity@^2.4.2":
+ version "2.4.2"
+ resolved "https://registry.yarnpkg.com/@bramus/specificity/-/specificity-2.4.2.tgz#aa8db8eb173fdee7324f82284833106adeecc648"
+ integrity sha512-ctxtJ/eA+t+6q2++vj5j7FYX3nRu311q1wfYH3xjlLOsczhlhxAg2FWNUXhpGvAw3BWo1xBcvOV6/YLc2r5FJw==
+ dependencies:
+ css-tree "^3.0.0"
+
+"@codemirror/commands@^6.0.0":
+ version "6.11.0"
+ resolved "https://registry.yarnpkg.com/@codemirror/commands/-/commands-6.11.0.tgz#2194d6fcad9ed787dcc42667db0e0543fab2e0ef"
+ integrity sha512-/K4Rl5BN0OtTiPWmJCdqODu38XnDMsDxKY5rgrPnCkutPTJf2wVbkoixLfealF5Kwse/s8P8M5jAiURiwSwnFA==
+ dependencies:
+ "@codemirror/language" "^6.0.0"
+ "@codemirror/state" "^6.7.0"
+ "@codemirror/view" "^6.27.0"
+ "@lezer/common" "^1.1.0"
+
+"@codemirror/language@^6.0.0":
+ version "6.12.4"
+ resolved "https://registry.yarnpkg.com/@codemirror/language/-/language-6.12.4.tgz#01e70fd5aa3a8a067ff1dfec75d5b6394cdfa058"
+ integrity sha512-1q4PaT+o6PbgpkJt4Q8Fv5XJxTy4FUZ4MWETtyiDw3J0Pyr9E2vqcKL+k9wcvjNTIsauxvE7OfmWj3FRPHQ76A==
+ dependencies:
+ "@codemirror/state" "^6.0.0"
+ "@codemirror/view" "^6.23.0"
+ "@lezer/common" "^1.5.0"
+ "@lezer/highlight" "^1.0.0"
+ "@lezer/lr" "^1.0.0"
+ style-mod "^4.0.0"
+
+"@codemirror/state@^6.0.0", "@codemirror/state@^6.7.0":
+ version "6.7.1"
+ resolved "https://registry.yarnpkg.com/@codemirror/state/-/state-6.7.1.tgz#9e88a17448c1dbc7b50acbeeec979ed7ccf1d6fc"
+ integrity sha512-9QzNDgE4EYDnAHfrTlR2lwiPciiOymLtwKK+8yHQzCc7GXhAP9xdEbEJFy2IWB1j9UGUl9BsgMmTo/ImA02T7A==
+ dependencies:
+ "@marijn/find-cluster-break" "^1.0.0"
+
+"@codemirror/view@^6.0.0", "@codemirror/view@^6.23.0", "@codemirror/view@^6.27.0":
+ version "6.43.9"
+ resolved "https://registry.yarnpkg.com/@codemirror/view/-/view-6.43.9.tgz#85c44ad1bc5fc930e5642e7313643dab7dc866a4"
+ integrity sha512-sTuUzTpPMFebRhg6dawChoKKgndIwfjmJgKVxBefPElcU2NwQ6AFroupk0SFqEerQyZOGRfDNnSN8Dw/lMAsXw==
+ dependencies:
+ "@codemirror/state" "^6.7.0"
+ crelt "^1.0.6"
+ style-mod "^4.1.0"
+ w3c-keyname "^2.2.4"
+
+"@csstools/color-helpers@^6.1.1":
+ version "6.1.1"
+ resolved "https://registry.yarnpkg.com/@csstools/color-helpers/-/color-helpers-6.1.1.tgz#1890f29a4347486b54048d24c6ab8fbef039ee61"
+ integrity sha512-gLNsunvwf3mCi5u5o46/Z/JcJMnhbHSaZ69rkgPzNM3J4s8hWwpPUQB6/tt0EDFyCiWzxANlx+2LJwpYj4zS1w==
+
+"@csstools/css-calc@^3.3.0":
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/@csstools/css-calc/-/css-calc-3.3.0.tgz#33cc4bdbab8edf1b6e3ab8c1eba849c41a324f1a"
+ integrity sha512-c5ihYsPkdG6JCkU2zTMm4+k6r7RXuGxtWYhu5DHMIiF1FHzrfmHL5so11AoFpUv/tu61xfcmT4AmKoFfMPoqdQ==
+
+"@csstools/css-color-parser@^4.1.10":
+ version "4.2.1"
+ resolved "https://registry.yarnpkg.com/@csstools/css-color-parser/-/css-color-parser-4.2.1.tgz#d2795d618e3d497f394277eede34f10d7adfad0e"
+ integrity sha512-YpAJZhaHplYQkG8ib+/Fx5Y0eF2lVWi3tIvMJA6i39TLyUNp2439cifzW8VMjhlqrBjHzK5hVGugRRm2zTKI/A==
+ dependencies:
+ "@csstools/color-helpers" "^6.1.1"
+ "@csstools/css-calc" "^3.3.0"
+
+"@csstools/css-parser-algorithms@^4.0.0":
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/@csstools/css-parser-algorithms/-/css-parser-algorithms-4.0.0.tgz#e1c65dc09378b42f26a111fca7f7075fc2c26164"
+ integrity sha512-+B87qS7fIG3L5h3qwJ/IFbjoVoOe/bpOdh9hAjXbvx0o8ImEmUsGXN0inFOnk2ChCFgqkkGFQ+TpM5rbhkKe4w==
+
+"@csstools/css-syntax-patches-for-csstree@^1.1.7":
+ version "1.1.9"
+ resolved "https://registry.yarnpkg.com/@csstools/css-syntax-patches-for-csstree/-/css-syntax-patches-for-csstree-1.1.9.tgz#8c144089e7ad7cadc0393a5051345c3e6a8043dc"
+ integrity sha512-iGGw4OsAYsS6pD29MdJ2bX/nJx65a04ZZiw6x+VwWlP2DdXf6f++Zmuv/OzALpdyfVhjbduIIF2cXM7HWBIe9A==
+
+"@csstools/css-tokenizer@^4.0.0":
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/@csstools/css-tokenizer/-/css-tokenizer-4.0.0.tgz#798a33950d11226a0ebb6acafa60f5594424967f"
+ integrity sha512-QxULHAm7cNu72w97JUNCBFODFaXpbDg+dP8b/oWFAZ2MTRppA3U00Y2L1HqaS4J6yBqxwa/Y3nMBaxVKbB/NsA==
+
+"@exodus/bytes@^1.11.0", "@exodus/bytes@^1.15.1", "@exodus/bytes@^1.6.0":
+ version "1.15.1"
+ resolved "https://registry.yarnpkg.com/@exodus/bytes/-/bytes-1.15.1.tgz#b13bc464ca162c17abf0837fb3a11aeab79e45d1"
+ integrity sha512-S6mL0yNB/Abt9Ei4tq8gDhcczc4S3+vQ4ra7vxnAf+YHC02srtqxKKZghx2Dq6p0e66THKwR6r8N6P95wEty7Q==
+
+"@jridgewell/sourcemap-codec@^1.5.5":
+ version "1.6.0"
+ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz#f4c663e862f06dc98ca4d453862c46902789a18d"
+ integrity sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==
+
+"@lezer/common@^1.0.0", "@lezer/common@^1.1.0", "@lezer/common@^1.3.0", "@lezer/common@^1.5.0":
+ version "1.5.2"
+ resolved "https://registry.yarnpkg.com/@lezer/common/-/common-1.5.2.tgz#d6840db13779e3f1b42e70c9a97c4086d12fae22"
+ integrity sha512-sxQE460fPZyU3sdc8lafxiPwJHBzZRy/udNFynGQky1SePYBdhkBl1kOagA9uT3pxR8K09bOrmTUqA9wb/PjSQ==
+
+"@lezer/highlight@^1.0.0":
+ version "1.2.3"
+ resolved "https://registry.yarnpkg.com/@lezer/highlight/-/highlight-1.2.3.tgz#a20f324b71148a2ea9ba6ff42e58bbfaec702857"
+ integrity sha512-qXdH7UqTvGfdVBINrgKhDsVTJTxactNNxLk7+UMwZhU13lMHaOBlJe9Vqp907ya56Y3+ed2tlqzys7jDkTmW0g==
+ dependencies:
+ "@lezer/common" "^1.3.0"
+
+"@lezer/lr@^1.0.0":
+ version "1.4.10"
+ resolved "https://registry.yarnpkg.com/@lezer/lr/-/lr-1.4.10.tgz#b3acc36e5ad049b74ddb7719594e7e74d9161ff5"
+ integrity sha512-rnCpTIBafOx4mRp43xOxDJbFipJm/c0cia/V5TiGlhmMa+wsSdoGmUN3w5Bqrks/09Q/D4tNAmWaT8p6NRi77A==
+ dependencies:
+ "@lezer/common" "^1.0.0"
+
+"@marijn/find-cluster-break@^1.0.0":
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/@marijn/find-cluster-break/-/find-cluster-break-1.0.4.tgz#42c2aea61cda307cdb1347444792452d7b5dbfb4"
+ integrity sha512-Wy0V7+SGUjnF9/TkiM1hKVDPj7jKXduPNboMVtHTA8dySMURWqfg/JZ9E2Sq8JgSJmkl7k7Qe9FLeMSrSraWmQ==
+
+"@oxc-project/types@=0.147.0":
+ version "0.147.0"
+ resolved "https://registry.yarnpkg.com/@oxc-project/types/-/types-0.147.0.tgz#512e43196053db4a99928e35b287549a3226268b"
+ integrity sha512-IJ3s6ltHLp45S0bh7phkX+gJO7A1Wuz2EaqpAhb8WjqDwbzMiWKHhyyT42tskaWjEYXtHtVCPpnBJVT9+dcRLg==
+
+"@pierre/diffs@^1.3.6":
+ version "1.3.6"
+ resolved "https://registry.yarnpkg.com/@pierre/diffs/-/diffs-1.3.6.tgz#725888b0e9fbf4129c32eeff692dab153949ec23"
+ integrity sha512-a3woaW2QHy78JDxPJK0OJzwZUN4xoQLLIS/pceO8X6+L8gA5D682mP7/w3YxxEVRPXOaoe/p/RJ5Oj/3nrEzew==
+ dependencies:
+ "@pierre/theme" "2.0.0"
+ "@pierre/theming" "1.0.1"
+ "@shikijs/transformers" "^3.0.0 || ^4.0.0"
+ diff "9.0.0"
+ hast-util-to-html "9.0.5"
+ lru_map "0.4.1"
+ shiki "^3.0.0 || ^4.0.0"
+
+"@pierre/theme@2.0.0":
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/@pierre/theme/-/theme-2.0.0.tgz#492924128fe652c0096622fe0d89558ba66ce5fa"
+ integrity sha512-yNDd9GYLQl1mEUJR8AneJ5e4ohLIHQd/wZLWr4fagt78vS2RwwZNW530vVgHqXFAyFVcFlRmGUD5ramXH46OXw==
+
+"@pierre/theming@1.0.1":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@pierre/theming/-/theming-1.0.1.tgz#79601332d7985b5f37ceebe20399a15ededa6809"
+ integrity sha512-WCI5Qd7iprDpISL9fBYOLe8RV53+b7mFNA3bPzl60/2CKCSrsKN8zEcep6Y3BAzvARlmca50zGjDodqPGiTUKA==
+
+"@rolldown/binding-android-arm-eabi@1.2.6":
+ version "1.2.6"
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.6.tgz#81bc32b79902fcd3875dffdf3be2ccba3ef8d794"
+ integrity sha512-b+jTcARdTiFLI6jB4a5XjTm0RWd6KcRfQj/I2356fxUZemiho9zQLxo0RtCuMDAyKcLo6cEltkgbQp6d1+sjjQ==
+
+"@rolldown/binding-android-arm64@1.2.6":
+ version "1.2.6"
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.6.tgz#9b20ae8d8a5bb979ea6aa8fa4b7e11f58c53f775"
+ integrity sha512-lkWU8ZJaRk9q3CIEY1Tc7vIFALp3Xw5NfGJo2hQg5oIqNgxWi1zI+IiDEK3r70BF5Dzol1tcXsnzsRc8NLhG+Q==
+
+"@rolldown/binding-darwin-arm64@1.2.6":
+ version "1.2.6"
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.6.tgz#1031ee06b51c9134ba5a6da3a7310388875f7dd8"
+ integrity sha512-dgR56NYnvAszm7Ob1B2/Vn0e8bUQYZH2UjVaMMtMVOCKFSfjhfLmuA/9+O+F+ajUdG6B/bSssrKW6JJYASa8jA==
+
+"@rolldown/binding-darwin-x64@1.2.6":
+ version "1.2.6"
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.6.tgz#11cf31040b779dba8e61d932ae3c0ee81ef94ae0"
+ integrity sha512-vpVxFvUCFioJqug7OTvqptkc4yb8UX0AwfDmJpaR/0sWz+BUmqSVAf7c8JkUgnN8YLspb4a/N6NhTyMAmdyQ7Q==
+
+"@rolldown/binding-freebsd-x64@1.2.6":
+ version "1.2.6"
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.6.tgz#72d805b459ba4a8bbfc112bca4a1c70740516ae9"
+ integrity sha512-h1wG6Y6K3JlRswxsI64qQJqBAy4vrLuHgRbc8CZMGSWTOFRY6ghMApM1NKzB2I0n5xV1fjkE18SuVl2QpLeNpA==
+
+"@rolldown/binding-linux-arm-gnueabihf@1.2.6":
+ version "1.2.6"
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.6.tgz#43b778dd021f50182a1efdb4149cd89cff86c942"
+ integrity sha512-tbCiqub0q2MVWJKgF5PoAlNWCtQydiOYSLIkd8sByqK/6MMYLJRcSXSYodqYtd0O+Fw7QaVmKKlS4oL94YRZ0w==
+
+"@rolldown/binding-linux-arm64-gnu@1.2.6":
+ version "1.2.6"
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.6.tgz#e9fa7a469999c1346d827b29154068d1c833c474"
+ integrity sha512-oxK9+baEBPhZG5HB4URY+uU04zJWeZlH6Tb9rB5DK4DF9XR1uXNLXt5Q5ZsugTKayNCNLhkcwz/ye74hRI98dg==
+
+"@rolldown/binding-linux-arm64-musl@1.2.6":
+ version "1.2.6"
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.6.tgz#5e68dd6eb85797745f494dfe8c490c2bce4218a6"
+ integrity sha512-muWCk27FVBEZtv0MsK8gnfSmgczA8KQ0uRVJbTABKhkRfQc38aUrcb7fhi3BNiyseFmgcRsoMfQsSNJ+DbZdSw==
+
+"@rolldown/binding-linux-ppc64-gnu@1.2.6":
+ version "1.2.6"
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.6.tgz#2a0efc15437a55dd2caf58f0318e129d11d98ee6"
+ integrity sha512-eWDoSfU7Co2qj3vgB3Dt4lj1mG6CoWbcJQkRMP3XJplyCMtuaq3LHvPFjS9QIPvMGWVadJC04Xiy0IdcVPtnwQ==
+
+"@rolldown/binding-linux-s390x-gnu@1.2.6":
+ version "1.2.6"
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.6.tgz#bc2b0b6325d8aae0f1a1c06fb10d665c82258541"
+ integrity sha512-2bWNjRSIayvupRKxXUY2tWG9fYdoUlTqWywHRvE8Eq3GvuQ+f2HeIkve697fIt+IQs/PV8yFsdWuhp1aJ1PdnA==
+
+"@rolldown/binding-linux-x64-gnu@1.2.6":
+ version "1.2.6"
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.6.tgz#e6e5022f6138fdc0d14cefacc67dc7bc5dff6430"
+ integrity sha512-KekI0gS0wLxe1UBSQSjenBVwou/JkcQPDzBPICGZjxUv9k3RteHDPBQaiOicZUFKRIH2wKEimGwVpnJsbPzu7w==
+
+"@rolldown/binding-linux-x64-musl@1.2.6":
+ version "1.2.6"
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.6.tgz#c8b462609809237bbf6265491b1e78d5c260ed46"
+ integrity sha512-TvtPnfVr+HtyGiDmPK4VWmlNm7QhNNAcK5Q9A7aOXsI8545yCyaoMaicXrFZ72JzeYjaUVk7yT243zT0jzjFKQ==
+
+"@rolldown/binding-openharmony-arm64@1.2.6":
+ version "1.2.6"
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.6.tgz#aa208791647b3b0bd23b372d5ee6bd5ed5988118"
+ integrity sha512-iOo0VEay2XFhaCcH0sps5XIimkSuOnNaZrf6+ZkoSOQBJPKNU48RkmJv0/lSpipexu5P+ouFgafe5IGr/DiQfg==
+
+"@rolldown/binding-win32-arm64-msvc@1.2.6":
+ version "1.2.6"
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.6.tgz#a2a5f1a84555d00afe0ac0ff387878bcf4ada52a"
+ integrity sha512-y5NTmmasMS455JlOCO4ZM9krIchv3Mvm1crL1iUPGOPgEzSkves9n0SdC5Sjz6+qWDFhd8/JpfWMH8NSWNHe+A==
+
+"@rolldown/binding-win32-x64-msvc@1.2.6":
+ version "1.2.6"
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.6.tgz#1162903e264ed10db4be8af40ba8cf13cd4a0b4a"
+ integrity sha512-np8iZSLfXlAD4kWhiyq/u0Yt8oZDtRQ8lGhQaCXo2rl37KNjeU0GjJuwr4P3oeZ++ROfofsKNBqR5LTO8aXyWQ==
+
+"@rolldown/pluginutils@^1.0.0":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz#e3fcee093fbb5ce765e1ad088ff4de2889f6f9be"
+ integrity sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==
+
+"@shikijs/core@4.4.3":
+ version "4.4.3"
+ resolved "https://registry.yarnpkg.com/@shikijs/core/-/core-4.4.3.tgz#00a942fa45ad0e4146ac6dbbac32b8b704b42e3f"
+ integrity sha512-QCR4q2ZO/ILJEuwiBMel4wdcTDb1JGwfjKTxPDF6x8ixOaluPrVqIn06C99AcRPhmYlBR56d/Fb+GN58GzExpg==
+ dependencies:
+ "@shikijs/primitive" "4.4.3"
+ "@shikijs/types" "4.4.3"
+ "@shikijs/vscode-textmate" "^10.0.2"
+ "@types/hast" "^3.0.5"
+ hast-util-to-html "^9.0.5"
+
+"@shikijs/engine-javascript@4.4.3":
+ version "4.4.3"
+ resolved "https://registry.yarnpkg.com/@shikijs/engine-javascript/-/engine-javascript-4.4.3.tgz#42dbdc18ec2f86003624674839a8f090cdd7cb62"
+ integrity sha512-FbOjFJp9VLdo1Wevs10BBtVxiTWwNLqZh5Gkhjgda/ioL15YOgeSl9n+6XMa3qRlPQzfhFNe641SrynFHYG0nQ==
+ dependencies:
+ "@shikijs/types" "4.4.3"
+ "@shikijs/vscode-textmate" "^10.0.2"
+ oniguruma-to-es "^4.3.6"
+
+"@shikijs/engine-oniguruma@4.4.3":
+ version "4.4.3"
+ resolved "https://registry.yarnpkg.com/@shikijs/engine-oniguruma/-/engine-oniguruma-4.4.3.tgz#a1754f9f42e0f35a55cda9a977599041a2ad5b07"
+ integrity sha512-EcOQkxdxGQrc1Row/cC2c96/v1dbZqGnEVu1qTuT/MJmp6+cXCvQussowVmCv5Tqr3KuY3c7IbM6HTW3LJ1k9w==
+ dependencies:
+ "@shikijs/types" "4.4.3"
+ "@shikijs/vscode-textmate" "^10.0.2"
+
+"@shikijs/langs@4.4.3":
+ version "4.4.3"
+ resolved "https://registry.yarnpkg.com/@shikijs/langs/-/langs-4.4.3.tgz#113282396f119dbba8d3b5e86668258fa8df6e7b"
+ integrity sha512-ePic0yfAJGOF83D5wBHK/00EjK65oahBYxFk5epgq33WRv7X9UuxLEV8PtR0szC0z8dl7INIpIodB99JRFlR+A==
+ dependencies:
+ "@shikijs/types" "4.4.3"
+
+"@shikijs/primitive@4.4.3":
+ version "4.4.3"
+ resolved "https://registry.yarnpkg.com/@shikijs/primitive/-/primitive-4.4.3.tgz#86490cea63b3e2c56b8d9163046e010258844d81"
+ integrity sha512-m0wBeLDQDeIxRdUmrCPdQqfuUamDwRL5isCfYbguKD6NiaKpVbsv+3J81DyIKgNW5h4WAIIr8T4EkgQrBBxvaQ==
+ dependencies:
+ "@shikijs/types" "4.4.3"
+ "@shikijs/vscode-textmate" "^10.0.2"
+ "@types/hast" "^3.0.5"
+
+"@shikijs/themes@4.4.3":
+ version "4.4.3"
+ resolved "https://registry.yarnpkg.com/@shikijs/themes/-/themes-4.4.3.tgz#8310a78261f4cf742663e07e2028df046a02bd72"
+ integrity sha512-w8UHjeUnIR965KMWJHUPXOc2mNJUnK3vpVLYLvw5IYU2mnTTJ89E24OrJDBNiJDQ0qzb0tc4l7mrIXx5cFeIyw==
+ dependencies:
+ "@shikijs/types" "4.4.3"
+
+"@shikijs/transformers@^3.0.0 || ^4.0.0":
+ version "4.4.3"
+ resolved "https://registry.yarnpkg.com/@shikijs/transformers/-/transformers-4.4.3.tgz#18869d95b0e2656fa7ae98350e09408c57585018"
+ integrity sha512-oJSARV6NaWd+rnNJbtnpAdj3Zg0ZVyzsnMgb3vi3HA+35y8lBWUCpOnWsmyiXZIikY+x1BDqrQUgmxfzWh7Jvw==
+ dependencies:
+ "@shikijs/core" "4.4.3"
+ "@shikijs/types" "4.4.3"
+
+"@shikijs/types@4.4.3":
+ version "4.4.3"
+ resolved "https://registry.yarnpkg.com/@shikijs/types/-/types-4.4.3.tgz#019aff19f0cbfb21642c59f6f8432ced74e27b45"
+ integrity sha512-UEJxmRR++MAGR6hugn0vgVS2W/6lWAts84FFSrnlH9sP0LNol7E5+NQ792pH8liWUhyMyjhTgSUH3k7iD7tc5g==
+ dependencies:
+ "@shikijs/vscode-textmate" "^10.0.2"
+ "@types/hast" "^3.0.5"
+
+"@shikijs/vscode-textmate@^10.0.2":
+ version "10.0.2"
+ resolved "https://registry.yarnpkg.com/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz#a90ab31d0cc1dfb54c66a69e515bf624fa7b2224"
+ integrity sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==
+
+"@standard-schema/spec@^1.1.0":
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/@standard-schema/spec/-/spec-1.1.0.tgz#a79b55dbaf8604812f52d140b2c9ab41bc150bb8"
+ integrity sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==
+
+"@types/chai@^5.2.2":
+ version "5.2.3"
+ resolved "https://registry.yarnpkg.com/@types/chai/-/chai-5.2.3.tgz#8e9cd9e1c3581fa6b341a5aed5588eb285be0b4a"
+ integrity sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==
+ dependencies:
+ "@types/deep-eql" "*"
+ assertion-error "^2.0.1"
+
+"@types/deep-eql@*":
+ version "4.0.2"
+ resolved "https://registry.yarnpkg.com/@types/deep-eql/-/deep-eql-4.0.2.tgz#334311971d3a07121e7eb91b684a605e7eea9cbd"
+ integrity sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==
+
+"@types/estree@^1.0.0":
+ version "1.0.9"
+ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.9.tgz#cf3f0e876d7bee15a93ab925b82bf570a3904a24"
+ integrity sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==
+
+"@types/hast@^3.0.0", "@types/hast@^3.0.5":
+ version "3.0.5"
+ resolved "https://registry.yarnpkg.com/@types/hast/-/hast-3.0.5.tgz#48020de4c0e63492f4ca9db42068c108f68b7f8f"
+ integrity sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g==
+ dependencies:
+ "@types/unist" "*"
+
+"@types/mdast@^4.0.0":
+ version "4.0.4"
+ resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-4.0.4.tgz#7ccf72edd2f1aa7dd3437e180c64373585804dd6"
+ integrity sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==
+ dependencies:
+ "@types/unist" "*"
+
+"@types/node@^22.0.0":
+ version "22.20.1"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-22.20.1.tgz#84e7cdf63cdaa20c134aa317ccc901aa21e16f0e"
+ integrity sha512-EANqOCF9QFyra+4pfxUcX9STKJpCLjMbObVzljIJomAWSnuSIEAvyzEU53GaajbXJEgdh0iEcPL+DGvpUd4k1Q==
+ dependencies:
+ undici-types "~6.21.0"
+
+"@types/unist@*", "@types/unist@^3.0.0":
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/@types/unist/-/unist-3.0.3.tgz#acaab0f919ce69cce629c2d4ed2eb4adc1b6c20c"
+ integrity sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==
+
+"@typescript/typescript-aix-ppc64@7.0.2":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz#cdc7ce81d60f1e09034960ddfb1fb880d7a776b6"
+ integrity sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==
+
+"@typescript/typescript-darwin-arm64@7.0.2":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@typescript/typescript-darwin-arm64/-/typescript-darwin-arm64-7.0.2.tgz#a55fdfcfa58df58d27db2237cde6a5c1e35a7235"
+ integrity sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==
+
+"@typescript/typescript-darwin-x64@7.0.2":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@typescript/typescript-darwin-x64/-/typescript-darwin-x64-7.0.2.tgz#38d1c9172800a91d707bec64d2a370a016634db4"
+ integrity sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==
+
+"@typescript/typescript-freebsd-arm64@7.0.2":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@typescript/typescript-freebsd-arm64/-/typescript-freebsd-arm64-7.0.2.tgz#f1ff8810030b35d2b5be0db6a2dc650460ea94fa"
+ integrity sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==
+
+"@typescript/typescript-freebsd-x64@7.0.2":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@typescript/typescript-freebsd-x64/-/typescript-freebsd-x64-7.0.2.tgz#3d86b03f353c5b1ba95162eb6ce35533bfc294bd"
+ integrity sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==
+
+"@typescript/typescript-linux-arm64@7.0.2":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@typescript/typescript-linux-arm64/-/typescript-linux-arm64-7.0.2.tgz#d9334d96d6dac6ff85da9c865588948de939e91f"
+ integrity sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==
+
+"@typescript/typescript-linux-arm@7.0.2":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@typescript/typescript-linux-arm/-/typescript-linux-arm-7.0.2.tgz#ad94b41e1aee2a4dcc6a298c7b67c43345fde32e"
+ integrity sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==
+
+"@typescript/typescript-linux-loong64@7.0.2":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@typescript/typescript-linux-loong64/-/typescript-linux-loong64-7.0.2.tgz#2965aee4fc873360139d893daafe6397a29138ad"
+ integrity sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==
+
+"@typescript/typescript-linux-mips64el@7.0.2":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@typescript/typescript-linux-mips64el/-/typescript-linux-mips64el-7.0.2.tgz#1a887a311bed3a833f80bfd4a9ed37c271936cf0"
+ integrity sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==
+
+"@typescript/typescript-linux-ppc64@7.0.2":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@typescript/typescript-linux-ppc64/-/typescript-linux-ppc64-7.0.2.tgz#8b63c9b2f445b393eb4e43ec21da225dade3577d"
+ integrity sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==
+
+"@typescript/typescript-linux-riscv64@7.0.2":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@typescript/typescript-linux-riscv64/-/typescript-linux-riscv64-7.0.2.tgz#b6e8a35c289b3ea97a92a41d461aaeed0d3b36e1"
+ integrity sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==
+
+"@typescript/typescript-linux-s390x@7.0.2":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@typescript/typescript-linux-s390x/-/typescript-linux-s390x-7.0.2.tgz#2ef96693be4861f6d17965427e5b009cbbed1a3e"
+ integrity sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==
+
+"@typescript/typescript-linux-x64@7.0.2":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz#73269cb0baba50aea0ca060445a6b88e583f1ce2"
+ integrity sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==
+
+"@typescript/typescript-netbsd-arm64@7.0.2":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@typescript/typescript-netbsd-arm64/-/typescript-netbsd-arm64-7.0.2.tgz#3a3649f97fafa210b4e6e3798c15e06605c8a901"
+ integrity sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==
+
+"@typescript/typescript-netbsd-x64@7.0.2":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@typescript/typescript-netbsd-x64/-/typescript-netbsd-x64-7.0.2.tgz#47ec59491a40c470d2807dc4d2b825528fd979ab"
+ integrity sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==
+
+"@typescript/typescript-openbsd-arm64@7.0.2":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@typescript/typescript-openbsd-arm64/-/typescript-openbsd-arm64-7.0.2.tgz#796be8da0bd989d8a3fb96f2801e38a8365b4baf"
+ integrity sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==
+
+"@typescript/typescript-openbsd-x64@7.0.2":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@typescript/typescript-openbsd-x64/-/typescript-openbsd-x64-7.0.2.tgz#d37fe2a729eb942c076c454ee7f1815faf7d560f"
+ integrity sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==
+
+"@typescript/typescript-sunos-x64@7.0.2":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@typescript/typescript-sunos-x64/-/typescript-sunos-x64-7.0.2.tgz#aba8d3464c3565a7044789baba96916bd4ab2c88"
+ integrity sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==
+
+"@typescript/typescript-win32-arm64@7.0.2":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@typescript/typescript-win32-arm64/-/typescript-win32-arm64-7.0.2.tgz#b9de50a17196383f62620b5f9d0a2f34ad3b60d7"
+ integrity sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==
+
+"@typescript/typescript-win32-x64@7.0.2":
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/@typescript/typescript-win32-x64/-/typescript-win32-x64-7.0.2.tgz#cf3b7b0d6ce5635daca4c8e01c189cdcde47ec3c"
+ integrity sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==
+
+"@ungap/structured-clone@^1.0.0":
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.4.0.tgz#5e2e1374c0a30b5a42e8b083523a225c6945f88a"
+ integrity sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ==
+
+"@vitest/expect@4.1.11":
+ version "4.1.11"
+ resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-4.1.11.tgz#5f580d1f9cdbba314dbf23b2d911f8eb23878f5f"
+ integrity sha512-VX2x5vNJXET47KAFzwERI+KRMtTTCSWTfSMKsW7JsUsXV4psq++e3DvZpuTDOpHcxytiDs6p2nhVb2tVDiiUYw==
+ dependencies:
+ "@standard-schema/spec" "^1.1.0"
+ "@types/chai" "^5.2.2"
+ "@vitest/spy" "4.1.11"
+ "@vitest/utils" "4.1.11"
+ chai "^6.2.2"
+ tinyrainbow "^3.1.0"
+
+"@vitest/mocker@4.1.11":
+ version "4.1.11"
+ resolved "https://registry.yarnpkg.com/@vitest/mocker/-/mocker-4.1.11.tgz#8e2906361bc5dfa271757a858ae80643118fcbb4"
+ integrity sha512-2XJVD55d1o5AZous5CCGKS74g/riOj9odEt2bQpCVZeblHyHdnMeFl4jl0XjU21stf4mbjUkew2eXQZt65g5CQ==
+ dependencies:
+ "@vitest/spy" "4.1.11"
+ estree-walker "^3.0.3"
+ magic-string "^0.30.21"
+
+"@vitest/pretty-format@4.1.11":
+ version "4.1.11"
+ resolved "https://registry.yarnpkg.com/@vitest/pretty-format/-/pretty-format-4.1.11.tgz#8b28eb8240771d6ea970e33beaeb41384b51868e"
+ integrity sha512-yiZzPbGTS9Sr/JpFl8zHrcIkAofNbFV6k21vIgQN/cY/oxZeXhJv5sc/MBJ5jFKWmWs+oJHw0UXLZjmf931+Vw==
+ dependencies:
+ tinyrainbow "^3.1.0"
+
+"@vitest/runner@4.1.11":
+ version "4.1.11"
+ resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-4.1.11.tgz#bfbad98c8d6c3f1fb4df12056ad569821ff77f21"
+ integrity sha512-LztvUgdwMNJMIkj3hQnnxiC2Xy1zNxq928W/xhjCLaNCzqTZOudjwbQf6v9IntZGPw132i2Lq2rgTRZHD3JHNw==
+ dependencies:
+ "@vitest/utils" "4.1.11"
+ pathe "^2.0.3"
+
+"@vitest/snapshot@4.1.11":
+ version "4.1.11"
+ resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-4.1.11.tgz#df461eb165924a3155986dde68e13360f53f3d4c"
+ integrity sha512-pN7ikn1ON7h8ee4gIAp4AzyK+zBtJPzVbqOgu5LCEh4VaJVbPQcgYQYJIMGQPXVeJJq1fnfazis7a5pFNPahog==
+ dependencies:
+ "@vitest/pretty-format" "4.1.11"
+ "@vitest/utils" "4.1.11"
+ magic-string "^0.30.21"
+ pathe "^2.0.3"
+
+"@vitest/spy@4.1.11":
+ version "4.1.11"
+ resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-4.1.11.tgz#0add45cae953afed9c88f98e2f6fc9164558c32a"
+ integrity sha512-apNa/prQy2qCeywhnixOHPRCgGNhvg7T4Dapfl1GahLp/R+uhBm5cPyFoNVyqsNd2h1nJxL6BqqdIjiABL60YA==
+
+"@vitest/utils@4.1.11":
+ version "4.1.11"
+ resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-4.1.11.tgz#9b27a4293b827942b223539bfab1bd9f7eada31b"
+ integrity sha512-zTCVGpyFsGWBhllOyKlTw/vnr6D9qxsfSDyfbyZmTyjHw5N/VuvzHpHoQjm2ZJzn4RJgx5w4r7V0er69CmLgPQ==
+ dependencies:
+ "@vitest/pretty-format" "4.1.11"
+ convert-source-map "^2.0.0"
+ tinyrainbow "^3.1.0"
+
+assertion-error@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-2.0.1.tgz#f641a196b335690b1070bf00b6e7593fec190bf7"
+ integrity sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==
+
+bidi-js@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/bidi-js/-/bidi-js-1.0.3.tgz#6f8bcf3c877c4d9220ddf49b9bb6930c88f877d2"
+ integrity sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==
+ dependencies:
+ require-from-string "^2.0.2"
+
+braces@^3.0.3:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789"
+ integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==
+ dependencies:
+ fill-range "^7.1.1"
+
+ccount@^2.0.0:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/ccount/-/ccount-2.0.1.tgz#17a3bf82302e0870d6da43a01311a8bc02a3ecf5"
+ integrity sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==
+
+chai@^6.2.2:
+ version "6.2.2"
+ resolved "https://registry.yarnpkg.com/chai/-/chai-6.2.2.tgz#ae41b52c9aca87734505362717f3255facda360e"
+ integrity sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==
+
+character-entities-html4@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-2.1.0.tgz#1f1adb940c971a4b22ba39ddca6b618dc6e56b2b"
+ integrity sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==
+
+character-entities-legacy@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz#76bc83a90738901d7bc223a9e93759fdd560125b"
+ integrity sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==
+
+comma-separated-tokens@^2.0.0:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz#4e89c9458acb61bc8fef19f4529973b2392839ee"
+ integrity sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==
+
+convert-source-map@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a"
+ integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==
+
+crelt@^1.0.6:
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/crelt/-/crelt-1.0.7.tgz#3b441b2ddfa73161d6a2770aa4cd677f895eaf28"
+ integrity sha512-aK6BbWfhf4U/wCcLHKPJl/xa6VkVstRaPywWtMKGwuOLc/wZTyQYuoxgvZnNsBvv7Kg3YTBQYYBCggcviQczuA==
+
+css-tree@^3.0.0, css-tree@^3.2.1:
+ version "3.2.1"
+ resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-3.2.1.tgz#86cac7011561272b30e6b1e042ba6ce047aa7518"
+ integrity sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==
+ dependencies:
+ mdn-data "2.27.1"
+ source-map-js "^1.2.1"
+
+data-urls@^7.0.0:
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-7.0.0.tgz#6dce8b63226a1ecfdd907ce18a8ccfb1eee506d3"
+ integrity sha512-23XHcCF+coGYevirZceTVD7NdJOqVn+49IHyxgszm+JIiHLoB2TkmPtsYkNWT1pvRSGkc35L6NHs0yHkN2SumA==
+ dependencies:
+ whatwg-mimetype "^5.0.0"
+ whatwg-url "^16.0.0"
+
+decimal.js@^10.6.0:
+ version "10.6.0"
+ resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.6.0.tgz#e649a43e3ab953a72192ff5983865e509f37ed9a"
+ integrity sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==
+
+dequal@^2.0.0:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be"
+ integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==
+
+detect-libc@^2.0.3:
+ version "2.1.2"
+ resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.1.2.tgz#689c5dcdc1900ef5583a4cb9f6d7b473742074ad"
+ integrity sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==
+
+devlop@^1.0.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/devlop/-/devlop-1.1.0.tgz#4db7c2ca4dc6e0e834c30be70c94bbc976dc7018"
+ integrity sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==
+ dependencies:
+ dequal "^2.0.0"
+
+diff@9.0.0:
+ version "9.0.0"
+ resolved "https://registry.yarnpkg.com/diff/-/diff-9.0.0.tgz#297c31cd7c280f13dfe335791ec2063bd4a73a6f"
+ integrity sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw==
+
+entities@^8.0.0:
+ version "8.0.0"
+ resolved "https://registry.yarnpkg.com/entities/-/entities-8.0.0.tgz#c1df5fe3602429747fa233d0dd26f142f0ce4743"
+ integrity sha512-zwfzJecQ/Uej6tusMqwAqU/6KL2XaB2VZ2Jg54Je6ahNBGNH6Ek6g3jjNCF0fG9EWQKGZNddNjU5F1ZQn/sBnA==
+
+es-module-lexer@^2.0.0:
+ version "2.3.2"
+ resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-2.3.2.tgz#311fa4f40168c1975c505477c51b23234d41ad55"
+ integrity sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==
+
+estree-walker@^3.0.3:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-3.0.3.tgz#67c3e549ec402a487b4fc193d1953a524752340d"
+ integrity sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==
+ dependencies:
+ "@types/estree" "^1.0.0"
+
+expect-type@^1.3.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/expect-type/-/expect-type-1.4.0.tgz#24edf7f0cc69a44d008567ba4594ab96f3c3a3d6"
+ integrity sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==
+
+fdir@^6.5.0:
+ version "6.5.0"
+ resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.5.0.tgz#ed2ab967a331ade62f18d077dae192684d50d350"
+ integrity sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==
+
+fill-range@^7.1.1:
+ version "7.1.1"
+ resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292"
+ integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==
+ dependencies:
+ to-regex-range "^5.0.1"
+
+fsevents@~2.3.3:
+ version "2.3.3"
+ resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
+ integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
+
+hast-util-to-html@9.0.5, hast-util-to-html@^9.0.5:
+ version "9.0.5"
+ resolved "https://registry.yarnpkg.com/hast-util-to-html/-/hast-util-to-html-9.0.5.tgz#ccc673a55bb8e85775b08ac28380f72d47167005"
+ integrity sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw==
+ dependencies:
+ "@types/hast" "^3.0.0"
+ "@types/unist" "^3.0.0"
+ ccount "^2.0.0"
+ comma-separated-tokens "^2.0.0"
+ hast-util-whitespace "^3.0.0"
+ html-void-elements "^3.0.0"
+ mdast-util-to-hast "^13.0.0"
+ property-information "^7.0.0"
+ space-separated-tokens "^2.0.0"
+ stringify-entities "^4.0.0"
+ zwitch "^2.0.4"
+
+hast-util-whitespace@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz#7778ed9d3c92dd9e8c5c8f648a49c21fc51cb621"
+ integrity sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==
+ dependencies:
+ "@types/hast" "^3.0.0"
+
+html-encoding-sniffer@^6.0.0:
+ version "6.0.0"
+ resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-6.0.0.tgz#f8d9390b3b348b50d4f61c16dd2ef5c05980a882"
+ integrity sha512-CV9TW3Y3f8/wT0BRFc1/KAVQ3TUHiXmaAb6VW9vtiMFf7SLoMd1PdAc4W3KFOFETBJUb90KatHqlsZMWV+R9Gg==
+ dependencies:
+ "@exodus/bytes" "^1.6.0"
+
+html-void-elements@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-3.0.0.tgz#fc9dbd84af9e747249034d4d62602def6517f1d7"
+ integrity sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==
+
+is-number@^7.0.0:
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
+ integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
+
+is-potential-custom-element-name@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5"
+ integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==
+
+jsdom@^30.0.1:
+ version "30.0.1"
+ resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-30.0.1.tgz#1b0751cbd0abce86762c48697583b5e91433f6e4"
+ integrity sha512-52v7mUVUfNQVYYqE1lcdaymWL0njO7lTLUog6ZvW2U5KsbiLk/GnZlVJ+qx0xfNJZ6Gn+KSpPNE52vurbxZwrA==
+ dependencies:
+ "@asamuzakjp/css-color" "^6.0.5"
+ "@asamuzakjp/dom-selector" "^8.3.0"
+ "@bramus/specificity" "^2.4.2"
+ "@csstools/css-syntax-patches-for-csstree" "^1.1.7"
+ "@exodus/bytes" "^1.15.1"
+ css-tree "^3.2.1"
+ data-urls "^7.0.0"
+ decimal.js "^10.6.0"
+ html-encoding-sniffer "^6.0.0"
+ is-potential-custom-element-name "^1.0.1"
+ lru-cache "^11.5.2"
+ parse5 "^8.0.1"
+ saxes "^6.0.0"
+ symbol-tree "^3.2.4"
+ tough-cookie "^6.0.2"
+ undici "^8.9.0"
+ w3c-xmlserializer "^5.0.0"
+ webidl-conversions "^8.0.1"
+ whatwg-mimetype "^5.0.0"
+ whatwg-url "^17.1.0"
+ xml-name-validator "^5.0.0"
+
+lightningcss-android-arm64@1.33.0:
+ version "1.33.0"
+ resolved "https://registry.yarnpkg.com/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz#9a6841f88ae50fc83502903892b41af41bc2b907"
+ integrity sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==
+
+lightningcss-darwin-arm64@1.33.0:
+ version "1.33.0"
+ resolved "https://registry.yarnpkg.com/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz#c0f2c31c0bfd19fa4dd3f18e957a1f1a152097d6"
+ integrity sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==
+
+lightningcss-darwin-x64@1.33.0:
+ version "1.33.0"
+ resolved "https://registry.yarnpkg.com/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz#cb0705965acb538c6683949ce6925fb3cdf7c361"
+ integrity sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==
+
+lightningcss-freebsd-x64@1.33.0:
+ version "1.33.0"
+ resolved "https://registry.yarnpkg.com/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz#763538828b26bab2680dadafcc84ee78b0eb502b"
+ integrity sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==
+
+lightningcss-linux-arm-gnueabihf@1.33.0:
+ version "1.33.0"
+ resolved "https://registry.yarnpkg.com/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz#6862e3176a331aedbdec1ed352b4d7d0dd0784de"
+ integrity sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==
+
+lightningcss-linux-arm64-gnu@1.33.0:
+ version "1.33.0"
+ resolved "https://registry.yarnpkg.com/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz#c6a3a2ed15141daf6bdc2628930f8e39bdf473aa"
+ integrity sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==
+
+lightningcss-linux-arm64-musl@1.33.0:
+ version "1.33.0"
+ resolved "https://registry.yarnpkg.com/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz#7fa1334971fc82845f9827df6ef8a0b20914bac6"
+ integrity sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==
+
+lightningcss-linux-x64-gnu@1.33.0:
+ version "1.33.0"
+ resolved "https://registry.yarnpkg.com/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz#8b927862ea8c2bbc6831a46509244b50d9936e55"
+ integrity sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==
+
+lightningcss-linux-x64-musl@1.33.0:
+ version "1.33.0"
+ resolved "https://registry.yarnpkg.com/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz#0c525bb077dfd94404c059cfe42dad797e96aeaf"
+ integrity sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==
+
+lightningcss-win32-arm64-msvc@1.33.0:
+ version "1.33.0"
+ resolved "https://registry.yarnpkg.com/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz#850ee1103dac989cfab50e3ac22d1a69e394e63d"
+ integrity sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==
+
+lightningcss-win32-x64-msvc@1.33.0:
+ version "1.33.0"
+ resolved "https://registry.yarnpkg.com/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz#e343ae152eed3609dc6e11949d1a3bf39a1c946f"
+ integrity sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==
+
+lightningcss@^1.33.0:
+ version "1.33.0"
+ resolved "https://registry.yarnpkg.com/lightningcss/-/lightningcss-1.33.0.tgz#c08867d71a79385c6e190214fd72fef3e5f95f0b"
+ integrity sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==
+ dependencies:
+ detect-libc "^2.0.3"
+ optionalDependencies:
+ lightningcss-android-arm64 "1.33.0"
+ lightningcss-darwin-arm64 "1.33.0"
+ lightningcss-darwin-x64 "1.33.0"
+ lightningcss-freebsd-x64 "1.33.0"
+ lightningcss-linux-arm-gnueabihf "1.33.0"
+ lightningcss-linux-arm64-gnu "1.33.0"
+ lightningcss-linux-arm64-musl "1.33.0"
+ lightningcss-linux-x64-gnu "1.33.0"
+ lightningcss-linux-x64-musl "1.33.0"
+ lightningcss-win32-arm64-msvc "1.33.0"
+ lightningcss-win32-x64-msvc "1.33.0"
+
+lru-cache@^11.5.2:
+ version "11.5.2"
+ resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-11.5.2.tgz#00e16665c90c620fba14a3c368732a976493f760"
+ integrity sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==
+
+lru_map@0.4.1:
+ version "0.4.1"
+ resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.4.1.tgz#f7b4046283c79fb7370c36f8fca6aee4324b0a98"
+ integrity sha512-I+lBvqMMFfqaV8CJCISjI3wbjmwVu/VyOoU7+qtu9d7ioW5klMgsTTiUOUp+DJvfTTzKXoPbyC6YfgkNcyPSOg==
+
+magic-string@^0.30.21:
+ version "0.30.21"
+ resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.21.tgz#56763ec09a0fa8091df27879fd94d19078c00d91"
+ integrity sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==
+ dependencies:
+ "@jridgewell/sourcemap-codec" "^1.5.5"
+
+"markedit-api@https://github.com/MarkEdit-app/MarkEdit-api#v0.33.0":
+ version "0.33.0"
+ resolved "https://github.com/MarkEdit-app/MarkEdit-api#627a06a52a243ee8c6a734a0fdffd19d324395c9"
+
+"markedit-vite@https://github.com/MarkEdit-app/MarkEdit-vite#v0.6.0":
+ version "0.6.0"
+ resolved "https://github.com/MarkEdit-app/MarkEdit-vite#c78db6f15691262076293522ba4283d260110fa2"
+
+mdast-util-to-hast@^13.0.0:
+ version "13.2.1"
+ resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz#d7ff84ca499a57e2c060ae67548ad950e689a053"
+ integrity sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==
+ dependencies:
+ "@types/hast" "^3.0.0"
+ "@types/mdast" "^4.0.0"
+ "@ungap/structured-clone" "^1.0.0"
+ devlop "^1.0.0"
+ micromark-util-sanitize-uri "^2.0.0"
+ trim-lines "^3.0.0"
+ unist-util-position "^5.0.0"
+ unist-util-visit "^5.0.0"
+ vfile "^6.0.0"
+
+mdn-data@2.27.1:
+ version "2.27.1"
+ resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.27.1.tgz#e37b9c50880b75366c4d40ac63d9bbcacdb61f0e"
+ integrity sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==
+
+micromark-util-character@^2.0.0:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/micromark-util-character/-/micromark-util-character-2.1.1.tgz#2f987831a40d4c510ac261e89852c4e9703ccda6"
+ integrity sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==
+ dependencies:
+ micromark-util-symbol "^2.0.0"
+ micromark-util-types "^2.0.0"
+
+micromark-util-encode@^2.0.0:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz#0d51d1c095551cfaac368326963cf55f15f540b8"
+ integrity sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==
+
+micromark-util-sanitize-uri@^2.0.0:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz#ab89789b818a58752b73d6b55238621b7faa8fd7"
+ integrity sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==
+ dependencies:
+ micromark-util-character "^2.0.0"
+ micromark-util-encode "^2.0.0"
+ micromark-util-symbol "^2.0.0"
+
+micromark-util-symbol@^2.0.0:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz#e5da494e8eb2b071a0d08fb34f6cefec6c0a19b8"
+ integrity sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==
+
+micromark-util-types@^2.0.0:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/micromark-util-types/-/micromark-util-types-2.0.2.tgz#f00225f5f5a0ebc3254f96c36b6605c4b393908e"
+ integrity sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==
+
+micromatch@^4.0.8:
+ version "4.0.8"
+ resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202"
+ integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==
+ dependencies:
+ braces "^3.0.3"
+ picomatch "^2.3.1"
+
+nanoid@^3.3.17:
+ version "3.3.18"
+ resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.18.tgz#f66a2de1199ffde0fcf21c8a5f13106b1c081913"
+ integrity sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==
+
+obug@^2.1.1:
+ version "2.1.4"
+ resolved "https://registry.yarnpkg.com/obug/-/obug-2.1.4.tgz#9090d8a548a522517915d2aa6aae907197ac6cf8"
+ integrity sha512-4a+OsYv9UktOJKE+l1A4OufDgdRF9PifWj+tJnHURo/P+WOxpG4GzUFL9qCalmWauao6ogiG+QvnCovwPoyAWA==
+
+oniguruma-parser@^0.12.2:
+ version "0.12.2"
+ resolved "https://registry.yarnpkg.com/oniguruma-parser/-/oniguruma-parser-0.12.2.tgz#e27ca446f7fcf0969662a3ab9b4f43176d62b139"
+ integrity sha512-6HVa5oIrgMC6aA6WF6XyyqbhRPJrKR02L20+2+zpDtO5QAzGHAUGw5TKQvwi5vctNnRHkJYmjAhRVQF2EKdTQw==
+
+oniguruma-to-es@^4.3.6:
+ version "4.3.6"
+ resolved "https://registry.yarnpkg.com/oniguruma-to-es/-/oniguruma-to-es-4.3.6.tgz#43e640280241b0d687a314e7a641d476407a1c4d"
+ integrity sha512-csuQ9x3Yr0cEIs/Zgx/OEt9iBw9vqIunAPQkx19R/fiMq2oGVTgcMqO/V3Ybqefr1TBvosI6jU539ksaBULJyA==
+ dependencies:
+ oniguruma-parser "^0.12.2"
+ regex "^6.1.0"
+ regex-recursion "^6.0.2"
+
+parse5@^8.0.1:
+ version "8.0.1"
+ resolved "https://registry.yarnpkg.com/parse5/-/parse5-8.0.1.tgz#f43bcd2cd683efe084075333e9ce0da7d06da31e"
+ integrity sha512-z1e/HMG90obSGeidlli3hj7cbocou0/wa5HacvI3ASx34PecNjNQeaHNo5WIZpWofN9kgkqV1q5YvXe3F0FoPw==
+ dependencies:
+ entities "^8.0.0"
+
+pathe@^2.0.3:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/pathe/-/pathe-2.0.3.tgz#3ecbec55421685b70a9da872b2cff3e1cbed1716"
+ integrity sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==
+
+picocolors@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b"
+ integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==
+
+picomatch@^2.3.1:
+ version "2.3.2"
+ resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.2.tgz#5a942915e26b372dc0f0e6753149a16e6b1c5601"
+ integrity sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==
+
+picomatch@^4.0.3, picomatch@^4.0.4, picomatch@^4.0.5:
+ version "4.0.7"
+ resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.7.tgz#6313360034ccb36b3dc61ecbdff78121f90fe21f"
+ integrity sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==
+
+postcss@^8.5.26:
+ version "8.5.26"
+ resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.26.tgz#6e75135780c7e10df3433bf2266c552d35c8c620"
+ integrity sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ==
+ dependencies:
+ nanoid "^3.3.17"
+ picocolors "^1.1.1"
+ source-map-js "^1.2.1"
+
+property-information@^7.0.0:
+ version "7.2.0"
+ resolved "https://registry.yarnpkg.com/property-information/-/property-information-7.2.0.tgz#0809b34264e995c0bfcd3227028a1e35210af80a"
+ integrity sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg==
+
+punycode@^2.3.1:
+ version "2.3.1"
+ resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5"
+ integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==
+
+regex-recursion@^6.0.2:
+ version "6.0.2"
+ resolved "https://registry.yarnpkg.com/regex-recursion/-/regex-recursion-6.0.2.tgz#a0b1977a74c87f073377b938dbedfab2ea582b33"
+ integrity sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg==
+ dependencies:
+ regex-utilities "^2.3.0"
+
+regex-utilities@^2.3.0:
+ version "2.3.0"
+ resolved "https://registry.yarnpkg.com/regex-utilities/-/regex-utilities-2.3.0.tgz#87163512a15dce2908cf079c8960d5158ff43280"
+ integrity sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==
+
+regex@^6.1.0:
+ version "6.1.0"
+ resolved "https://registry.yarnpkg.com/regex/-/regex-6.1.0.tgz#d7ce98f8ee32da7497c13f6601fca2bc4a6a7803"
+ integrity sha512-6VwtthbV4o/7+OaAF9I5L5V3llLEsoPyq9P1JVXkedTP33c7MfCG0/5NOPcSJn0TzXcG9YUrR0gQSWioew3LDg==
+ dependencies:
+ regex-utilities "^2.3.0"
+
+require-from-string@^2.0.2:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909"
+ integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==
+
+rolldown@~1.2.4:
+ version "1.2.6"
+ resolved "https://registry.yarnpkg.com/rolldown/-/rolldown-1.2.6.tgz#025f5c11975cc70129ea9c76c54f35dd35881786"
+ integrity sha512-vMM4q3aixf46GiF1Kok8jDPFsEpXgFWGjUHXNkNHNm+Y2adXAG2dbX91jkti3i0ZRsOlcmbuzAz1poObSHCmUA==
+ dependencies:
+ "@oxc-project/types" "=0.147.0"
+ "@rolldown/pluginutils" "^1.0.0"
+ optionalDependencies:
+ "@rolldown/binding-android-arm-eabi" "1.2.6"
+ "@rolldown/binding-android-arm64" "1.2.6"
+ "@rolldown/binding-darwin-arm64" "1.2.6"
+ "@rolldown/binding-darwin-x64" "1.2.6"
+ "@rolldown/binding-freebsd-x64" "1.2.6"
+ "@rolldown/binding-linux-arm-gnueabihf" "1.2.6"
+ "@rolldown/binding-linux-arm64-gnu" "1.2.6"
+ "@rolldown/binding-linux-arm64-musl" "1.2.6"
+ "@rolldown/binding-linux-ppc64-gnu" "1.2.6"
+ "@rolldown/binding-linux-s390x-gnu" "1.2.6"
+ "@rolldown/binding-linux-x64-gnu" "1.2.6"
+ "@rolldown/binding-linux-x64-musl" "1.2.6"
+ "@rolldown/binding-openharmony-arm64" "1.2.6"
+ "@rolldown/binding-win32-arm64-msvc" "1.2.6"
+ "@rolldown/binding-win32-x64-msvc" "1.2.6"
+
+saxes@^6.0.0:
+ version "6.0.0"
+ resolved "https://registry.yarnpkg.com/saxes/-/saxes-6.0.0.tgz#fe5b4a4768df4f14a201b1ba6a65c1f3d9988cc5"
+ integrity sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==
+ dependencies:
+ xmlchars "^2.2.0"
+
+"shiki@^3.0.0 || ^4.0.0":
+ version "4.4.3"
+ resolved "https://registry.yarnpkg.com/shiki/-/shiki-4.4.3.tgz#31fb41c5c82435779a0b5a9b92a3b0377b061e15"
+ integrity sha512-Mb/GvXPHBAXdgGIcnfU5L3ldpn1XcxrGkPHwqgRx17/I2XRfqlFKk2vGkHWINn1kdXvzJZeuO3is6I9KLPFm0g==
+ dependencies:
+ "@shikijs/core" "4.4.3"
+ "@shikijs/engine-javascript" "4.4.3"
+ "@shikijs/engine-oniguruma" "4.4.3"
+ "@shikijs/langs" "4.4.3"
+ "@shikijs/themes" "4.4.3"
+ "@shikijs/types" "4.4.3"
+ "@shikijs/vscode-textmate" "^10.0.2"
+ "@types/hast" "^3.0.5"
+
+siginfo@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/siginfo/-/siginfo-2.0.0.tgz#32e76c70b79724e3bb567cb9d543eb858ccfaf30"
+ integrity sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==
+
+source-map-js@^1.2.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46"
+ integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==
+
+space-separated-tokens@^2.0.0:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz#1ecd9d2350a3844572c3f4a312bceb018348859f"
+ integrity sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==
+
+stackback@0.0.2:
+ version "0.0.2"
+ resolved "https://registry.yarnpkg.com/stackback/-/stackback-0.0.2.tgz#1ac8a0d9483848d1695e418b6d031a3c3ce68e3b"
+ integrity sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==
+
+std-env@^4.0.0-rc.1:
+ version "4.2.0"
+ resolved "https://registry.yarnpkg.com/std-env/-/std-env-4.2.0.tgz#8ebe0ec60485668ab47227b312f4254cdf80c9d3"
+ integrity sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==
+
+stringify-entities@^4.0.0:
+ version "4.0.4"
+ resolved "https://registry.yarnpkg.com/stringify-entities/-/stringify-entities-4.0.4.tgz#b3b79ef5f277cc4ac73caeb0236c5ba939b3a4f3"
+ integrity sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==
+ dependencies:
+ character-entities-html4 "^2.0.0"
+ character-entities-legacy "^3.0.0"
+
+style-mod@^4.0.0, style-mod@^4.1.0:
+ version "4.1.3"
+ resolved "https://registry.yarnpkg.com/style-mod/-/style-mod-4.1.3.tgz#6e9012255bb799bdac37e288f7671b5d71bf9f73"
+ integrity sha512-i/n8VsZydrugj3Iuzll8+x/00GH2vnYsk1eomD8QiRrSAeW6ItbCQDtfXCeJHd0iwiNagqjQkvpvREEPtW3IoQ==
+
+symbol-tree@^3.2.4:
+ version "3.2.4"
+ resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2"
+ integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==
+
+tinybench@^2.9.0:
+ version "2.9.0"
+ resolved "https://registry.yarnpkg.com/tinybench/-/tinybench-2.9.0.tgz#103c9f8ba6d7237a47ab6dd1dcff77251863426b"
+ integrity sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==
+
+tinyexec@^1.0.2:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/tinyexec/-/tinyexec-1.3.0.tgz#aacc1dbb1d4e93e6ad8dd64944e09f9ad147a474"
+ integrity sha512-QKAl9m8gWWGHV8jZcPeym6j+XULi6tOf1mT83WYJ4Lk2ytW/uwAWkrP0uFsdoYMdueVJ0qs26wZ+23xeB4ibNQ==
+
+tinyglobby@^0.2.15, tinyglobby@^0.2.17:
+ version "0.2.17"
+ resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.17.tgz#562a9a6c9eb2b3b123d39719f9af5bb44fcd7631"
+ integrity sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==
+ dependencies:
+ fdir "^6.5.0"
+ picomatch "^4.0.4"
+
+tinyrainbow@^3.1.0:
+ version "3.1.1"
+ resolved "https://registry.yarnpkg.com/tinyrainbow/-/tinyrainbow-3.1.1.tgz#c0168387d3d8d70b6b3c2c0936de5fee738cea20"
+ integrity sha512-yau8yJdTt989Mm0Bd/236QnzEiPf2xLLTqUZRUJOo/3CB078LSwzei343DgtJVmfJKJE3TMINY1u42SQsP6mXw==
+
+tldts-core@^7.4.11:
+ version "7.4.11"
+ resolved "https://registry.yarnpkg.com/tldts-core/-/tldts-core-7.4.11.tgz#a02fba29af72cbf9e658cb3a335f857efc9475f7"
+ integrity sha512-CW3WN2rIIE/Of21mulhgnGOwoDyEFNygyIBOONSdyAuSATgMMUCpLeUlB+E8sAwA5xRV9hYPl+kyZ9citHCaKg==
+
+tldts@^7.0.5:
+ version "7.4.11"
+ resolved "https://registry.yarnpkg.com/tldts/-/tldts-7.4.11.tgz#51d5a3feeb473e592edf671491a24fb23789eed2"
+ integrity sha512-aBiNayCfTQxuIJBm06M+xR14cYaYlDlSXZbgsnKzKNxDKUVq7KFwTjwBSsb7m9Y5xO8WfPnBc63WaYFMTGlvqw==
+ dependencies:
+ tldts-core "^7.4.11"
+
+to-regex-range@^5.0.1:
+ version "5.0.1"
+ resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
+ integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==
+ dependencies:
+ is-number "^7.0.0"
+
+tough-cookie@^6.0.2:
+ version "6.0.2"
+ resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-6.0.2.tgz#7b1f22fcf2daf06c4ff9d53ec1845f44c6627062"
+ integrity sha512-exgYmnmL/sJpR3upZfXG5PoatXQii55xAiXGXzY+sROLZ/Y+SLcp9PgJNI9Vz37HpQ74WvDcLT8eqm+kV3FzrA==
+ dependencies:
+ tldts "^7.0.5"
+
+tr46@^6.0.0:
+ version "6.0.0"
+ resolved "https://registry.yarnpkg.com/tr46/-/tr46-6.0.0.tgz#f5a1ae546a0adb32a277a2278d0d17fa2f9093e6"
+ integrity sha512-bLVMLPtstlZ4iMQHpFHTR7GAGj2jxi8Dg0s2h2MafAE4uSWF98FC/3MomU51iQAMf8/qDUbKWf5GxuvvVcXEhw==
+ dependencies:
+ punycode "^2.3.1"
+
+trim-lines@^3.0.0:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/trim-lines/-/trim-lines-3.0.1.tgz#d802e332a07df861c48802c04321017b1bd87338"
+ integrity sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==
+
+typescript@^7.0.0:
+ version "7.0.2"
+ resolved "https://registry.yarnpkg.com/typescript/-/typescript-7.0.2.tgz#9ec773d7954a8c182c17cc5bbd575aa28bc51582"
+ integrity sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==
+ optionalDependencies:
+ "@typescript/typescript-aix-ppc64" "7.0.2"
+ "@typescript/typescript-darwin-arm64" "7.0.2"
+ "@typescript/typescript-darwin-x64" "7.0.2"
+ "@typescript/typescript-freebsd-arm64" "7.0.2"
+ "@typescript/typescript-freebsd-x64" "7.0.2"
+ "@typescript/typescript-linux-arm" "7.0.2"
+ "@typescript/typescript-linux-arm64" "7.0.2"
+ "@typescript/typescript-linux-loong64" "7.0.2"
+ "@typescript/typescript-linux-mips64el" "7.0.2"
+ "@typescript/typescript-linux-ppc64" "7.0.2"
+ "@typescript/typescript-linux-riscv64" "7.0.2"
+ "@typescript/typescript-linux-s390x" "7.0.2"
+ "@typescript/typescript-linux-x64" "7.0.2"
+ "@typescript/typescript-netbsd-arm64" "7.0.2"
+ "@typescript/typescript-netbsd-x64" "7.0.2"
+ "@typescript/typescript-openbsd-arm64" "7.0.2"
+ "@typescript/typescript-openbsd-x64" "7.0.2"
+ "@typescript/typescript-sunos-x64" "7.0.2"
+ "@typescript/typescript-win32-arm64" "7.0.2"
+ "@typescript/typescript-win32-x64" "7.0.2"
+
+undici-types@~6.21.0:
+ version "6.21.0"
+ resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.21.0.tgz#691d00af3909be93a7faa13be61b3a5b50ef12cb"
+ integrity sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==
+
+undici@^8.9.0:
+ version "8.10.0"
+ resolved "https://registry.yarnpkg.com/undici/-/undici-8.10.0.tgz#67ed7c4087f0f40fba7bef3a46f2be80572f2473"
+ integrity sha512-HvltHd7avK13QIw/oLe4qoOLyoVSoafqJ2jYOrtMRBkbYT31eiBQ8O0ehRKZiEZCMEyLFQNIADpgCWC5fALvYQ==
+
+unist-util-is@^6.0.0:
+ version "6.0.1"
+ resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-6.0.1.tgz#d0a3f86f2dd0db7acd7d8c2478080b5c67f9c6a9"
+ integrity sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==
+ dependencies:
+ "@types/unist" "^3.0.0"
+
+unist-util-position@^5.0.0:
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-5.0.0.tgz#678f20ab5ca1207a97d7ea8a388373c9cf896be4"
+ integrity sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==
+ dependencies:
+ "@types/unist" "^3.0.0"
+
+unist-util-stringify-position@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz#449c6e21a880e0855bf5aabadeb3a740314abac2"
+ integrity sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==
+ dependencies:
+ "@types/unist" "^3.0.0"
+
+unist-util-visit-parents@^6.0.0:
+ version "6.0.2"
+ resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz#777df7fb98652ce16b4b7cd999d0a1a40efa3a02"
+ integrity sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==
+ dependencies:
+ "@types/unist" "^3.0.0"
+ unist-util-is "^6.0.0"
+
+unist-util-visit@^5.0.0:
+ version "5.1.0"
+ resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-5.1.0.tgz#9a2a28b0aa76a15e0da70a08a5863a2f060e2468"
+ integrity sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==
+ dependencies:
+ "@types/unist" "^3.0.0"
+ unist-util-is "^6.0.0"
+ unist-util-visit-parents "^6.0.0"
+
+vfile-message@^4.0.0:
+ version "4.0.3"
+ resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-4.0.3.tgz#87b44dddd7b70f0641c2e3ed0864ba73e2ea8df4"
+ integrity sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==
+ dependencies:
+ "@types/unist" "^3.0.0"
+ unist-util-stringify-position "^4.0.0"
+
+vfile@^6.0.0:
+ version "6.0.3"
+ resolved "https://registry.yarnpkg.com/vfile/-/vfile-6.0.3.tgz#3652ab1c496531852bf55a6bac57af981ebc38ab"
+ integrity sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==
+ dependencies:
+ "@types/unist" "^3.0.0"
+ vfile-message "^4.0.0"
+
+vite-plugin-singlefile@^2.3.3:
+ version "2.3.3"
+ resolved "https://registry.yarnpkg.com/vite-plugin-singlefile/-/vite-plugin-singlefile-2.3.3.tgz#e859aea4c0c4b74fcbba6baf527e88f2ad09de69"
+ integrity sha512-XVnGH0QzbOa8fxRSsHdCarVN1BSBXNi7uLMQYlrGRN5apdHkk62XQWRJhVever0lnfuyBkwn+kvVChdm/OoOUg==
+ dependencies:
+ micromatch "^4.0.8"
+
+"vite@^6.0.0 || ^7.0.0 || ^8.0.0", vite@^8.0.0:
+ version "8.2.2"
+ resolved "https://registry.yarnpkg.com/vite/-/vite-8.2.2.tgz#399aefad3656145145be110d137a07ea5bb55014"
+ integrity sha512-cFKLV/PRgAUlIRm5WjMjJ86jrftzpqcgH+Us+DS8mI3CDNiH30Whrz8uHL3+MOLPAgqbMBAqWdAHAphOAM+z/Q==
+ dependencies:
+ lightningcss "^1.33.0"
+ picomatch "^4.0.5"
+ postcss "^8.5.26"
+ rolldown "~1.2.4"
+ tinyglobby "^0.2.17"
+ optionalDependencies:
+ fsevents "~2.3.3"
+
+vitest@^4.1.11:
+ version "4.1.11"
+ resolved "https://registry.yarnpkg.com/vitest/-/vitest-4.1.11.tgz#1653c1521ae917f960d9b21877797c47dfd8bf21"
+ integrity sha512-fhACrNXUidIbGSBr5FlbuBkO7VWC1ZyLl0DO4CU2DrQoAPxX84Ysxs+HeGQpii5lZWV1Q4gBZTTu49mF+A6Edw==
+ dependencies:
+ "@vitest/expect" "4.1.11"
+ "@vitest/mocker" "4.1.11"
+ "@vitest/pretty-format" "4.1.11"
+ "@vitest/runner" "4.1.11"
+ "@vitest/snapshot" "4.1.11"
+ "@vitest/spy" "4.1.11"
+ "@vitest/utils" "4.1.11"
+ es-module-lexer "^2.0.0"
+ expect-type "^1.3.0"
+ magic-string "^0.30.21"
+ obug "^2.1.1"
+ pathe "^2.0.3"
+ picomatch "^4.0.3"
+ std-env "^4.0.0-rc.1"
+ tinybench "^2.9.0"
+ tinyexec "^1.0.2"
+ tinyglobby "^0.2.15"
+ tinyrainbow "^3.1.0"
+ vite "^6.0.0 || ^7.0.0 || ^8.0.0"
+ why-is-node-running "^2.3.0"
+
+w3c-keyname@^2.2.4:
+ version "2.2.8"
+ resolved "https://registry.yarnpkg.com/w3c-keyname/-/w3c-keyname-2.2.8.tgz#7b17c8c6883d4e8b86ac8aba79d39e880f8869c5"
+ integrity sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==
+
+w3c-xmlserializer@^5.0.0:
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz#f925ba26855158594d907313cedd1476c5967f6c"
+ integrity sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==
+ dependencies:
+ xml-name-validator "^5.0.0"
+
+webidl-conversions@^8.0.1:
+ version "8.0.1"
+ resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-8.0.1.tgz#0657e571fe6f06fcb15ca50ed1fdbcb495cd1686"
+ integrity sha512-BMhLD/Sw+GbJC21C/UgyaZX41nPt8bUTg+jWyDeg7e7YN4xOM05YPSIXceACnXVtqyEw/LMClUQMtMZ+PGGpqQ==
+
+whatwg-mimetype@^5.0.0:
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-5.0.0.tgz#d8232895dbd527ceaee74efd4162008fb8a8cf48"
+ integrity sha512-sXcNcHOC51uPGF0P/D4NVtrkjSU2fNsm9iog4ZvZJsL3rjoDAzXZhkm2MWt1y+PUdggKAYVoMAIYcs78wJ51Cw==
+
+whatwg-url@^16.0.0:
+ version "16.0.1"
+ resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-16.0.1.tgz#047f7f4bd36ef76b7198c172d1b1cebc66f764dd"
+ integrity sha512-1to4zXBxmXHV3IiSSEInrreIlu02vUOvrhxJJH5vcxYTBDAx51cqZiKdyTxlecdKNSjj8EcxGBxNf6Vg+945gw==
+ dependencies:
+ "@exodus/bytes" "^1.11.0"
+ tr46 "^6.0.0"
+ webidl-conversions "^8.0.1"
+
+whatwg-url@^17.1.0:
+ version "17.1.0"
+ resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-17.1.0.tgz#693144cd2060d324e73b15a717d1f38ecfb3f02e"
+ integrity sha512-3GeworPmc2ZfEEHP7lEbUfBX/L75wdEsi0rLNhXcXxnoN5jyq0SL5gCy06SGW2cyTIZdTvWIDQNQoza++vKeaw==
+ dependencies:
+ "@exodus/bytes" "^1.15.1"
+ tr46 "^6.0.0"
+ webidl-conversions "^8.0.1"
+
+why-is-node-running@^2.3.0:
+ version "2.3.0"
+ resolved "https://registry.yarnpkg.com/why-is-node-running/-/why-is-node-running-2.3.0.tgz#a3f69a97107f494b3cdc3bdddd883a7d65cebf04"
+ integrity sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==
+ dependencies:
+ siginfo "^2.0.0"
+ stackback "0.0.2"
+
+xml-name-validator@^5.0.0:
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-5.0.0.tgz#82be9b957f7afdacf961e5980f1bf227c0bf7673"
+ integrity sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==
+
+xmlchars@^2.2.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb"
+ integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==
+
+zwitch@^2.0.4:
+ version "2.0.4"
+ resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-2.0.4.tgz#c827d4b0acb76fc3e685a4c6ec2902d51070e9d7"
+ integrity sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==