@truenine/memory-sync-cli 2026.10303.11117 → 2026.10314.10703
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -104
- package/dist/index.mjs +1 -104
- package/dist/plugin-runtime.mjs +51 -120
- package/dist/plugin.config-DExOPs9m.cjs +171 -0
- package/dist/plugin.config-DPFJ9Kz9.mjs +171 -0
- package/dist/plugin.config-DWS04rUy.mjs +73 -0
- package/dist/script-runtime-worker.mjs +91 -0
- package/dist/tnmsc.schema.json +198 -165
- package/package.json +12 -11
- package/dist/CommandRegistryFactory-B8X-Pzh9.cjs +0 -64
- package/dist/CommandRegistryFactory-HJmbfqhU.mjs +0 -64
- package/dist/commands-C1wD1cs-.mjs +0 -1
- package/dist/commands-Clj_c60T.cjs +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,104 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./
|
|
2
|
-
`+e.value:``)+`
|
|
3
|
-
`+n}}function le(e,t){return e.marker?ue(e.marker,t).repeat(3):ue(e.fence,t)}function ue(e,t){return typeof e==`string`?e:e[t]}function de(e){let t=this,n=e||`yaml`,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(j(n)),a.push(P(n)),o.push(se(n))}function fe(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const pe=(function(e){if(e==null)return ve;if(typeof e==`function`)return _e(e);if(typeof e==`object`)return Array.isArray(e)?me(e):he(e);if(typeof e==`string`)return ge(e);throw Error(`Expected function, string, or object as test`)});function me(e){let t=[],n=-1;for(;++n<e.length;)t[n]=pe(e[n]);return _e(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function he(e){let t=e;return _e(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function ge(e){return _e(t);function t(t){return t&&t.type===e}}function _e(e){return t;function t(t,n,r){return!!(ye(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function ve(){return!0}function ye(e){return typeof e==`object`&&!!e&&`type`in e}function be(e){return`\x1B[33m`+e+`\x1B[39m`}const xe=[];function Se(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=pe(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+be(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=xe,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Ce(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Ce(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?xe:[e]}function we(e,t,n){let r=pe((n||{}).ignore||[]),i=Te(t),a=-1;for(;++a<i.length;)Se(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Te(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Ee(e[0]),F(e[1])])}return t}function Ee(e){return typeof e==`string`?new RegExp(N(e),`g`):e}function F(e){return typeof e==`function`?e:function(){return e}}const De=`phrasing`,I=[`autolink`,`link`,`image`,`label`];function Oe(){return{transforms:[Fe],enter:{literalAutolink:L,literalAutolinkEmail:Ae,literalAutolinkHttp:Ae,literalAutolinkWww:Ae},exit:{literalAutolink:Pe,literalAutolinkEmail:Ne,literalAutolinkHttp:je,literalAutolinkWww:Me}}}function ke(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:De,notInConstruct:I},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:De,notInConstruct:I},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:De,notInConstruct:I}]}}function L(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Ae(e){this.config.enter.autolinkProtocol.call(this,e)}function je(e){this.config.exit.autolinkProtocol.call(this,e)}function Me(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Ne(e){this.config.exit.autolinkEmail.call(this,e)}function Pe(e){this.exit(e)}function Fe(e){we(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Ie],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Le]],{ignore:[`link`,`linkReference`]})}function Ie(e,t,n,r,i){let a=``;if(!R(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Re(n)))return!1;let o=ze(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Le(e,t,n,r){return!R(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Re(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function ze(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=fe(e,`(`),a=fe(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function R(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||C(n)||S(n))&&(!t||n!==47)}function Be(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}Ye.peek=Je;function z(){this.buffer()}function Ve(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function He(){this.buffer()}function Ue(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function We(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Be(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ge(e){this.exit(e)}function Ke(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Be(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qe(e){this.exit(e)}function Je(){return`[`}function Ye(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Xe(){return{enter:{gfmFootnoteCallString:z,gfmFootnoteCall:Ve,gfmFootnoteDefinitionLabelString:He,gfmFootnoteDefinition:Ue},exit:{gfmFootnoteCallString:We,gfmFootnoteCall:Ge,gfmFootnoteDefinitionLabelString:Ke,gfmFootnoteDefinition:qe}}}function Ze(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ye},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
4
|
-
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?$e:Qe))),s(),o}}function Qe(e,t,n){return t===0?e:$e(e,t,n)}function $e(e,t,n){return(n?``:` `)+e}const et=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];at.peek=ot;function tt(){return{canContainEols:[`delete`],enter:{strikethrough:rt},exit:{strikethrough:it}}}function nt(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:et}],handlers:{delete:at}}}function rt(e){this.enter({type:`delete`,children:[]},e)}function it(e){this.exit(e)}function at(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function ot(){return`~`}function st(e){return e.length}function ct(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||st,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=lt(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=ut(r[d]);else{let e=ut(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
5
|
-
`)}function lt(e){return e==null?``:String(e)}function ut(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const dt={}.hasOwnProperty;function ft(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&dt.call(t,e)){let n=String(t[e]);i=dt.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const pt={}.hasOwnProperty;function mt(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)mt(e,t.extensions[n]);for(r in t)if(pt.call(t,r))switch(r){case`extensions`:break;case`unsafe`:ht(e[r],t[r]);break;case`join`:ht(e[r],t[r]);break;case`handlers`:gt(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function ht(e,t){t&&e.push(...t)}function gt(e,t){t&&Object.assign(e,t)}function _t(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),vt);return i(),o}function vt(e,t,n){return`>`+(n?``:` `)+e}function B(e,t){return yt(e,t.inConstruct,!0)&&!yt(e,t.notInConstruct,!1)}function yt(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function bt(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
6
|
-
`&&B(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
7
|
-
`}function xt(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function St(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Ct(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function wt(e,t,n,r){let i=Ct(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(St(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Tt);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(xt(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
8
|
-
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
9
|
-
`),a&&(u+=s.move(a+`
|
|
10
|
-
`)),u+=s.move(c),l(),u}function Tt(e,t,n){return(n?``:` `)+e}function Et(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Dt(e,t,n,r){let i=Et(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
11
|
-
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Ot(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function kt(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function At(e){if(e===null||b(e)||C(e))return 1;if(S(e))return 2}function jt(e,t,n){let r=At(e),i=At(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Mt.peek=Nt;function Mt(e,t,n,r){let i=Ot(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=jt(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=kt(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=jt(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+kt(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Nt(e,t,n){return n.options.emphasis||`*`}function Pt(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Se(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}const Ft={};function It(e,t){let n=t||Ft;return Lt(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function Lt(e,t,n){if(zt(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Rt(e.children,t,n)}return Array.isArray(e)?Rt(e,t,n):``}function Rt(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Lt(e[i],t,n);return r.join(``)}function zt(e){return!!(e&&typeof e==`object`)}function Bt(e,t){let n=!1;return Pt(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&It(e)&&(t.options.setext||n))}function Vt(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Bt(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
12
|
-
`,after:`
|
|
13
|
-
`});return r(),t(),o+`
|
|
14
|
-
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
15
|
-
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
16
|
-
`,...a.current()});return/^[\t ]/.test(l)&&(l=kt(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}V.peek=Ht;function V(e){return e.value||``}function Ht(){return`<`}Ut.peek=Wt;function Ut(e,t,n,r){let i=Et(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function Wt(){return`!`}Gt.peek=Kt;function Gt(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Kt(){return`!`}qt.peek=Jt;function qt(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Jt(){return"`"}function Yt(e,t){let n=It(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Xt.peek=Zt;function Xt(e,t,n,r){let i=Et(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(Yt(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Zt(e,t,n){return Yt(e,n)?`<`:`[`}Qt.peek=$t;function Qt(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function $t(){return`[`}function en(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function tn(e){let t=en(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function nn(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function rn(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function an(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?nn(n):en(n),s=e.ordered?o===`.`?`)`:`.`:tn(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),rn(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function on(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function sn(e,t,n,r){let i=on(n),a=n.bulletCurrent||en(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function cn(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}const ln=pe([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function un(e,t,n,r){return(e.children.some(function(e){return ln(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function dn(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}fn.peek=pn;function fn(e,t,n,r){let i=dn(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=jt(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=kt(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=jt(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+kt(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function pn(e,t,n){return n.options.strong||`*`}function mn(e,t,n,r){return n.safe(e.value,r)}function hn(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function gn(e,t,n){let r=(rn(n)+(n.options.ruleSpaces?` `:``)).repeat(hn(n));return n.options.ruleSpaces?r.slice(0,-1):r}const _n={blockquote:_t,break:bt,code:wt,definition:Dt,emphasis:Mt,hardBreak:bt,heading:Vt,html:V,image:Ut,imageReference:Gt,inlineCode:qt,link:Xt,linkReference:Qt,list:an,listItem:sn,paragraph:cn,root:un,strong:fn,text:mn,thematicBreak:gn},vn=[yn];function yn(e,t,n,r){if(t.type===`code`&&St(t,r)&&(e.type===`list`||e.type===t.type&&St(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`)return e.type===`paragraph`&&(e.type===t.type||t.type===`definition`||t.type===`heading`&&Bt(t,r))?void 0:n.spread?1:0}const bn=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],xn=[{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`\r`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`
|
|
17
|
-
`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:bn},{character:`"`,inConstruct:`titleQuote`},{atBreak:!0,character:`#`},{character:`#`,inConstruct:`headingAtx`,after:`(?:[\r
|
|
18
|
-
]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:`phrasing`},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:bn},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
|
|
19
|
-
*])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:bn},{atBreak:!0,character:`+`,after:`(?:[ \r
|
|
20
|
-
])`},{atBreak:!0,character:`-`,after:`(?:[ \r
|
|
21
|
-
-])`},{atBreak:!0,before:`\\d+`,character:`.`,after:`(?:[ \r
|
|
22
|
-
]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:bn},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:bn},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:bn},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:bn},{atBreak:!0,character:`~`}],Sn={AElig:`Æ`,AMP:`&`,Aacute:`Á`,Abreve:`Ă`,Acirc:`Â`,Acy:`А`,Afr:`𝔄`,Agrave:`À`,Alpha:`Α`,Amacr:`Ā`,And:`⩓`,Aogon:`Ą`,Aopf:`𝔸`,ApplyFunction:``,Aring:`Å`,Ascr:`𝒜`,Assign:`≔`,Atilde:`Ã`,Auml:`Ä`,Backslash:`∖`,Barv:`⫧`,Barwed:`⌆`,Bcy:`Б`,Because:`∵`,Bernoullis:`ℬ`,Beta:`Β`,Bfr:`𝔅`,Bopf:`𝔹`,Breve:`˘`,Bscr:`ℬ`,Bumpeq:`≎`,CHcy:`Ч`,COPY:`©`,Cacute:`Ć`,Cap:`⋒`,CapitalDifferentialD:`ⅅ`,Cayleys:`ℭ`,Ccaron:`Č`,Ccedil:`Ç`,Ccirc:`Ĉ`,Cconint:`∰`,Cdot:`Ċ`,Cedilla:`¸`,CenterDot:`·`,Cfr:`ℭ`,Chi:`Χ`,CircleDot:`⊙`,CircleMinus:`⊖`,CirclePlus:`⊕`,CircleTimes:`⊗`,ClockwiseContourIntegral:`∲`,CloseCurlyDoubleQuote:`”`,CloseCurlyQuote:`’`,Colon:`∷`,Colone:`⩴`,Congruent:`≡`,Conint:`∯`,ContourIntegral:`∮`,Copf:`ℂ`,Coproduct:`∐`,CounterClockwiseContourIntegral:`∳`,Cross:`⨯`,Cscr:`𝒞`,Cup:`⋓`,CupCap:`≍`,DD:`ⅅ`,DDotrahd:`⤑`,DJcy:`Ђ`,DScy:`Ѕ`,DZcy:`Џ`,Dagger:`‡`,Darr:`↡`,Dashv:`⫤`,Dcaron:`Ď`,Dcy:`Д`,Del:`∇`,Delta:`Δ`,Dfr:`𝔇`,DiacriticalAcute:`´`,DiacriticalDot:`˙`,DiacriticalDoubleAcute:`˝`,DiacriticalGrave:"`",DiacriticalTilde:`˜`,Diamond:`⋄`,DifferentialD:`ⅆ`,Dopf:`𝔻`,Dot:`¨`,DotDot:`⃜`,DotEqual:`≐`,DoubleContourIntegral:`∯`,DoubleDot:`¨`,DoubleDownArrow:`⇓`,DoubleLeftArrow:`⇐`,DoubleLeftRightArrow:`⇔`,DoubleLeftTee:`⫤`,DoubleLongLeftArrow:`⟸`,DoubleLongLeftRightArrow:`⟺`,DoubleLongRightArrow:`⟹`,DoubleRightArrow:`⇒`,DoubleRightTee:`⊨`,DoubleUpArrow:`⇑`,DoubleUpDownArrow:`⇕`,DoubleVerticalBar:`∥`,DownArrow:`↓`,DownArrowBar:`⤓`,DownArrowUpArrow:`⇵`,DownBreve:`̑`,DownLeftRightVector:`⥐`,DownLeftTeeVector:`⥞`,DownLeftVector:`↽`,DownLeftVectorBar:`⥖`,DownRightTeeVector:`⥟`,DownRightVector:`⇁`,DownRightVectorBar:`⥗`,DownTee:`⊤`,DownTeeArrow:`↧`,Downarrow:`⇓`,Dscr:`𝒟`,Dstrok:`Đ`,ENG:`Ŋ`,ETH:`Ð`,Eacute:`É`,Ecaron:`Ě`,Ecirc:`Ê`,Ecy:`Э`,Edot:`Ė`,Efr:`𝔈`,Egrave:`È`,Element:`∈`,Emacr:`Ē`,EmptySmallSquare:`◻`,EmptyVerySmallSquare:`▫`,Eogon:`Ę`,Eopf:`𝔼`,Epsilon:`Ε`,Equal:`⩵`,EqualTilde:`≂`,Equilibrium:`⇌`,Escr:`ℰ`,Esim:`⩳`,Eta:`Η`,Euml:`Ë`,Exists:`∃`,ExponentialE:`ⅇ`,Fcy:`Ф`,Ffr:`𝔉`,FilledSmallSquare:`◼`,FilledVerySmallSquare:`▪`,Fopf:`𝔽`,ForAll:`∀`,Fouriertrf:`ℱ`,Fscr:`ℱ`,GJcy:`Ѓ`,GT:`>`,Gamma:`Γ`,Gammad:`Ϝ`,Gbreve:`Ğ`,Gcedil:`Ģ`,Gcirc:`Ĝ`,Gcy:`Г`,Gdot:`Ġ`,Gfr:`𝔊`,Gg:`⋙`,Gopf:`𝔾`,GreaterEqual:`≥`,GreaterEqualLess:`⋛`,GreaterFullEqual:`≧`,GreaterGreater:`⪢`,GreaterLess:`≷`,GreaterSlantEqual:`⩾`,GreaterTilde:`≳`,Gscr:`𝒢`,Gt:`≫`,HARDcy:`Ъ`,Hacek:`ˇ`,Hat:`^`,Hcirc:`Ĥ`,Hfr:`ℌ`,HilbertSpace:`ℋ`,Hopf:`ℍ`,HorizontalLine:`─`,Hscr:`ℋ`,Hstrok:`Ħ`,HumpDownHump:`≎`,HumpEqual:`≏`,IEcy:`Е`,IJlig:`IJ`,IOcy:`Ё`,Iacute:`Í`,Icirc:`Î`,Icy:`И`,Idot:`İ`,Ifr:`ℑ`,Igrave:`Ì`,Im:`ℑ`,Imacr:`Ī`,ImaginaryI:`ⅈ`,Implies:`⇒`,Int:`∬`,Integral:`∫`,Intersection:`⋂`,InvisibleComma:``,InvisibleTimes:``,Iogon:`Į`,Iopf:`𝕀`,Iota:`Ι`,Iscr:`ℐ`,Itilde:`Ĩ`,Iukcy:`І`,Iuml:`Ï`,Jcirc:`Ĵ`,Jcy:`Й`,Jfr:`𝔍`,Jopf:`𝕁`,Jscr:`𝒥`,Jsercy:`Ј`,Jukcy:`Є`,KHcy:`Х`,KJcy:`Ќ`,Kappa:`Κ`,Kcedil:`Ķ`,Kcy:`К`,Kfr:`𝔎`,Kopf:`𝕂`,Kscr:`𝒦`,LJcy:`Љ`,LT:`<`,Lacute:`Ĺ`,Lambda:`Λ`,Lang:`⟪`,Laplacetrf:`ℒ`,Larr:`↞`,Lcaron:`Ľ`,Lcedil:`Ļ`,Lcy:`Л`,LeftAngleBracket:`⟨`,LeftArrow:`←`,LeftArrowBar:`⇤`,LeftArrowRightArrow:`⇆`,LeftCeiling:`⌈`,LeftDoubleBracket:`⟦`,LeftDownTeeVector:`⥡`,LeftDownVector:`⇃`,LeftDownVectorBar:`⥙`,LeftFloor:`⌊`,LeftRightArrow:`↔`,LeftRightVector:`⥎`,LeftTee:`⊣`,LeftTeeArrow:`↤`,LeftTeeVector:`⥚`,LeftTriangle:`⊲`,LeftTriangleBar:`⧏`,LeftTriangleEqual:`⊴`,LeftUpDownVector:`⥑`,LeftUpTeeVector:`⥠`,LeftUpVector:`↿`,LeftUpVectorBar:`⥘`,LeftVector:`↼`,LeftVectorBar:`⥒`,Leftarrow:`⇐`,Leftrightarrow:`⇔`,LessEqualGreater:`⋚`,LessFullEqual:`≦`,LessGreater:`≶`,LessLess:`⪡`,LessSlantEqual:`⩽`,LessTilde:`≲`,Lfr:`𝔏`,Ll:`⋘`,Lleftarrow:`⇚`,Lmidot:`Ŀ`,LongLeftArrow:`⟵`,LongLeftRightArrow:`⟷`,LongRightArrow:`⟶`,Longleftarrow:`⟸`,Longleftrightarrow:`⟺`,Longrightarrow:`⟹`,Lopf:`𝕃`,LowerLeftArrow:`↙`,LowerRightArrow:`↘`,Lscr:`ℒ`,Lsh:`↰`,Lstrok:`Ł`,Lt:`≪`,Map:`⤅`,Mcy:`М`,MediumSpace:` `,Mellintrf:`ℳ`,Mfr:`𝔐`,MinusPlus:`∓`,Mopf:`𝕄`,Mscr:`ℳ`,Mu:`Μ`,NJcy:`Њ`,Nacute:`Ń`,Ncaron:`Ň`,Ncedil:`Ņ`,Ncy:`Н`,NegativeMediumSpace:``,NegativeThickSpace:``,NegativeThinSpace:``,NegativeVeryThinSpace:``,NestedGreaterGreater:`≫`,NestedLessLess:`≪`,NewLine:`
|
|
23
|
-
`,Nfr:`𝔑`,NoBreak:``,NonBreakingSpace:`\xA0`,Nopf:`ℕ`,Not:`⫬`,NotCongruent:`≢`,NotCupCap:`≭`,NotDoubleVerticalBar:`∦`,NotElement:`∉`,NotEqual:`≠`,NotEqualTilde:`≂̸`,NotExists:`∄`,NotGreater:`≯`,NotGreaterEqual:`≱`,NotGreaterFullEqual:`≧̸`,NotGreaterGreater:`≫̸`,NotGreaterLess:`≹`,NotGreaterSlantEqual:`⩾̸`,NotGreaterTilde:`≵`,NotHumpDownHump:`≎̸`,NotHumpEqual:`≏̸`,NotLeftTriangle:`⋪`,NotLeftTriangleBar:`⧏̸`,NotLeftTriangleEqual:`⋬`,NotLess:`≮`,NotLessEqual:`≰`,NotLessGreater:`≸`,NotLessLess:`≪̸`,NotLessSlantEqual:`⩽̸`,NotLessTilde:`≴`,NotNestedGreaterGreater:`⪢̸`,NotNestedLessLess:`⪡̸`,NotPrecedes:`⊀`,NotPrecedesEqual:`⪯̸`,NotPrecedesSlantEqual:`⋠`,NotReverseElement:`∌`,NotRightTriangle:`⋫`,NotRightTriangleBar:`⧐̸`,NotRightTriangleEqual:`⋭`,NotSquareSubset:`⊏̸`,NotSquareSubsetEqual:`⋢`,NotSquareSuperset:`⊐̸`,NotSquareSupersetEqual:`⋣`,NotSubset:`⊂⃒`,NotSubsetEqual:`⊈`,NotSucceeds:`⊁`,NotSucceedsEqual:`⪰̸`,NotSucceedsSlantEqual:`⋡`,NotSucceedsTilde:`≿̸`,NotSuperset:`⊃⃒`,NotSupersetEqual:`⊉`,NotTilde:`≁`,NotTildeEqual:`≄`,NotTildeFullEqual:`≇`,NotTildeTilde:`≉`,NotVerticalBar:`∤`,Nscr:`𝒩`,Ntilde:`Ñ`,Nu:`Ν`,OElig:`Œ`,Oacute:`Ó`,Ocirc:`Ô`,Ocy:`О`,Odblac:`Ő`,Ofr:`𝔒`,Ograve:`Ò`,Omacr:`Ō`,Omega:`Ω`,Omicron:`Ο`,Oopf:`𝕆`,OpenCurlyDoubleQuote:`“`,OpenCurlyQuote:`‘`,Or:`⩔`,Oscr:`𝒪`,Oslash:`Ø`,Otilde:`Õ`,Otimes:`⨷`,Ouml:`Ö`,OverBar:`‾`,OverBrace:`⏞`,OverBracket:`⎴`,OverParenthesis:`⏜`,PartialD:`∂`,Pcy:`П`,Pfr:`𝔓`,Phi:`Φ`,Pi:`Π`,PlusMinus:`±`,Poincareplane:`ℌ`,Popf:`ℙ`,Pr:`⪻`,Precedes:`≺`,PrecedesEqual:`⪯`,PrecedesSlantEqual:`≼`,PrecedesTilde:`≾`,Prime:`″`,Product:`∏`,Proportion:`∷`,Proportional:`∝`,Pscr:`𝒫`,Psi:`Ψ`,QUOT:`"`,Qfr:`𝔔`,Qopf:`ℚ`,Qscr:`𝒬`,RBarr:`⤐`,REG:`®`,Racute:`Ŕ`,Rang:`⟫`,Rarr:`↠`,Rarrtl:`⤖`,Rcaron:`Ř`,Rcedil:`Ŗ`,Rcy:`Р`,Re:`ℜ`,ReverseElement:`∋`,ReverseEquilibrium:`⇋`,ReverseUpEquilibrium:`⥯`,Rfr:`ℜ`,Rho:`Ρ`,RightAngleBracket:`⟩`,RightArrow:`→`,RightArrowBar:`⇥`,RightArrowLeftArrow:`⇄`,RightCeiling:`⌉`,RightDoubleBracket:`⟧`,RightDownTeeVector:`⥝`,RightDownVector:`⇂`,RightDownVectorBar:`⥕`,RightFloor:`⌋`,RightTee:`⊢`,RightTeeArrow:`↦`,RightTeeVector:`⥛`,RightTriangle:`⊳`,RightTriangleBar:`⧐`,RightTriangleEqual:`⊵`,RightUpDownVector:`⥏`,RightUpTeeVector:`⥜`,RightUpVector:`↾`,RightUpVectorBar:`⥔`,RightVector:`⇀`,RightVectorBar:`⥓`,Rightarrow:`⇒`,Ropf:`ℝ`,RoundImplies:`⥰`,Rrightarrow:`⇛`,Rscr:`ℛ`,Rsh:`↱`,RuleDelayed:`⧴`,SHCHcy:`Щ`,SHcy:`Ш`,SOFTcy:`Ь`,Sacute:`Ś`,Sc:`⪼`,Scaron:`Š`,Scedil:`Ş`,Scirc:`Ŝ`,Scy:`С`,Sfr:`𝔖`,ShortDownArrow:`↓`,ShortLeftArrow:`←`,ShortRightArrow:`→`,ShortUpArrow:`↑`,Sigma:`Σ`,SmallCircle:`∘`,Sopf:`𝕊`,Sqrt:`√`,Square:`□`,SquareIntersection:`⊓`,SquareSubset:`⊏`,SquareSubsetEqual:`⊑`,SquareSuperset:`⊐`,SquareSupersetEqual:`⊒`,SquareUnion:`⊔`,Sscr:`𝒮`,Star:`⋆`,Sub:`⋐`,Subset:`⋐`,SubsetEqual:`⊆`,Succeeds:`≻`,SucceedsEqual:`⪰`,SucceedsSlantEqual:`≽`,SucceedsTilde:`≿`,SuchThat:`∋`,Sum:`∑`,Sup:`⋑`,Superset:`⊃`,SupersetEqual:`⊇`,Supset:`⋑`,THORN:`Þ`,TRADE:`™`,TSHcy:`Ћ`,TScy:`Ц`,Tab:` `,Tau:`Τ`,Tcaron:`Ť`,Tcedil:`Ţ`,Tcy:`Т`,Tfr:`𝔗`,Therefore:`∴`,Theta:`Θ`,ThickSpace:` `,ThinSpace:` `,Tilde:`∼`,TildeEqual:`≃`,TildeFullEqual:`≅`,TildeTilde:`≈`,Topf:`𝕋`,TripleDot:`⃛`,Tscr:`𝒯`,Tstrok:`Ŧ`,Uacute:`Ú`,Uarr:`↟`,Uarrocir:`⥉`,Ubrcy:`Ў`,Ubreve:`Ŭ`,Ucirc:`Û`,Ucy:`У`,Udblac:`Ű`,Ufr:`𝔘`,Ugrave:`Ù`,Umacr:`Ū`,UnderBar:`_`,UnderBrace:`⏟`,UnderBracket:`⎵`,UnderParenthesis:`⏝`,Union:`⋃`,UnionPlus:`⊎`,Uogon:`Ų`,Uopf:`𝕌`,UpArrow:`↑`,UpArrowBar:`⤒`,UpArrowDownArrow:`⇅`,UpDownArrow:`↕`,UpEquilibrium:`⥮`,UpTee:`⊥`,UpTeeArrow:`↥`,Uparrow:`⇑`,Updownarrow:`⇕`,UpperLeftArrow:`↖`,UpperRightArrow:`↗`,Upsi:`ϒ`,Upsilon:`Υ`,Uring:`Ů`,Uscr:`𝒰`,Utilde:`Ũ`,Uuml:`Ü`,VDash:`⊫`,Vbar:`⫫`,Vcy:`В`,Vdash:`⊩`,Vdashl:`⫦`,Vee:`⋁`,Verbar:`‖`,Vert:`‖`,VerticalBar:`∣`,VerticalLine:`|`,VerticalSeparator:`❘`,VerticalTilde:`≀`,VeryThinSpace:` `,Vfr:`𝔙`,Vopf:`𝕍`,Vscr:`𝒱`,Vvdash:`⊪`,Wcirc:`Ŵ`,Wedge:`⋀`,Wfr:`𝔚`,Wopf:`𝕎`,Wscr:`𝒲`,Xfr:`𝔛`,Xi:`Ξ`,Xopf:`𝕏`,Xscr:`𝒳`,YAcy:`Я`,YIcy:`Ї`,YUcy:`Ю`,Yacute:`Ý`,Ycirc:`Ŷ`,Ycy:`Ы`,Yfr:`𝔜`,Yopf:`𝕐`,Yscr:`𝒴`,Yuml:`Ÿ`,ZHcy:`Ж`,Zacute:`Ź`,Zcaron:`Ž`,Zcy:`З`,Zdot:`Ż`,ZeroWidthSpace:``,Zeta:`Ζ`,Zfr:`ℨ`,Zopf:`ℤ`,Zscr:`𝒵`,aacute:`á`,abreve:`ă`,ac:`∾`,acE:`∾̳`,acd:`∿`,acirc:`â`,acute:`´`,acy:`а`,aelig:`æ`,af:``,afr:`𝔞`,agrave:`à`,alefsym:`ℵ`,aleph:`ℵ`,alpha:`α`,amacr:`ā`,amalg:`⨿`,amp:`&`,and:`∧`,andand:`⩕`,andd:`⩜`,andslope:`⩘`,andv:`⩚`,ang:`∠`,ange:`⦤`,angle:`∠`,angmsd:`∡`,angmsdaa:`⦨`,angmsdab:`⦩`,angmsdac:`⦪`,angmsdad:`⦫`,angmsdae:`⦬`,angmsdaf:`⦭`,angmsdag:`⦮`,angmsdah:`⦯`,angrt:`∟`,angrtvb:`⊾`,angrtvbd:`⦝`,angsph:`∢`,angst:`Å`,angzarr:`⍼`,aogon:`ą`,aopf:`𝕒`,ap:`≈`,apE:`⩰`,apacir:`⩯`,ape:`≊`,apid:`≋`,apos:`'`,approx:`≈`,approxeq:`≊`,aring:`å`,ascr:`𝒶`,ast:`*`,asymp:`≈`,asympeq:`≍`,atilde:`ã`,auml:`ä`,awconint:`∳`,awint:`⨑`,bNot:`⫭`,backcong:`≌`,backepsilon:`϶`,backprime:`‵`,backsim:`∽`,backsimeq:`⋍`,barvee:`⊽`,barwed:`⌅`,barwedge:`⌅`,bbrk:`⎵`,bbrktbrk:`⎶`,bcong:`≌`,bcy:`б`,bdquo:`„`,becaus:`∵`,because:`∵`,bemptyv:`⦰`,bepsi:`϶`,bernou:`ℬ`,beta:`β`,beth:`ℶ`,between:`≬`,bfr:`𝔟`,bigcap:`⋂`,bigcirc:`◯`,bigcup:`⋃`,bigodot:`⨀`,bigoplus:`⨁`,bigotimes:`⨂`,bigsqcup:`⨆`,bigstar:`★`,bigtriangledown:`▽`,bigtriangleup:`△`,biguplus:`⨄`,bigvee:`⋁`,bigwedge:`⋀`,bkarow:`⤍`,blacklozenge:`⧫`,blacksquare:`▪`,blacktriangle:`▴`,blacktriangledown:`▾`,blacktriangleleft:`◂`,blacktriangleright:`▸`,blank:`␣`,blk12:`▒`,blk14:`░`,blk34:`▓`,block:`█`,bne:`=⃥`,bnequiv:`≡⃥`,bnot:`⌐`,bopf:`𝕓`,bot:`⊥`,bottom:`⊥`,bowtie:`⋈`,boxDL:`╗`,boxDR:`╔`,boxDl:`╖`,boxDr:`╓`,boxH:`═`,boxHD:`╦`,boxHU:`╩`,boxHd:`╤`,boxHu:`╧`,boxUL:`╝`,boxUR:`╚`,boxUl:`╜`,boxUr:`╙`,boxV:`║`,boxVH:`╬`,boxVL:`╣`,boxVR:`╠`,boxVh:`╫`,boxVl:`╢`,boxVr:`╟`,boxbox:`⧉`,boxdL:`╕`,boxdR:`╒`,boxdl:`┐`,boxdr:`┌`,boxh:`─`,boxhD:`╥`,boxhU:`╨`,boxhd:`┬`,boxhu:`┴`,boxminus:`⊟`,boxplus:`⊞`,boxtimes:`⊠`,boxuL:`╛`,boxuR:`╘`,boxul:`┘`,boxur:`└`,boxv:`│`,boxvH:`╪`,boxvL:`╡`,boxvR:`╞`,boxvh:`┼`,boxvl:`┤`,boxvr:`├`,bprime:`‵`,breve:`˘`,brvbar:`¦`,bscr:`𝒷`,bsemi:`⁏`,bsim:`∽`,bsime:`⋍`,bsol:`\\`,bsolb:`⧅`,bsolhsub:`⟈`,bull:`•`,bullet:`•`,bump:`≎`,bumpE:`⪮`,bumpe:`≏`,bumpeq:`≏`,cacute:`ć`,cap:`∩`,capand:`⩄`,capbrcup:`⩉`,capcap:`⩋`,capcup:`⩇`,capdot:`⩀`,caps:`∩︀`,caret:`⁁`,caron:`ˇ`,ccaps:`⩍`,ccaron:`č`,ccedil:`ç`,ccirc:`ĉ`,ccups:`⩌`,ccupssm:`⩐`,cdot:`ċ`,cedil:`¸`,cemptyv:`⦲`,cent:`¢`,centerdot:`·`,cfr:`𝔠`,chcy:`ч`,check:`✓`,checkmark:`✓`,chi:`χ`,cir:`○`,cirE:`⧃`,circ:`ˆ`,circeq:`≗`,circlearrowleft:`↺`,circlearrowright:`↻`,circledR:`®`,circledS:`Ⓢ`,circledast:`⊛`,circledcirc:`⊚`,circleddash:`⊝`,cire:`≗`,cirfnint:`⨐`,cirmid:`⫯`,cirscir:`⧂`,clubs:`♣`,clubsuit:`♣`,colon:`:`,colone:`≔`,coloneq:`≔`,comma:`,`,commat:`@`,comp:`∁`,compfn:`∘`,complement:`∁`,complexes:`ℂ`,cong:`≅`,congdot:`⩭`,conint:`∮`,copf:`𝕔`,coprod:`∐`,copy:`©`,copysr:`℗`,crarr:`↵`,cross:`✗`,cscr:`𝒸`,csub:`⫏`,csube:`⫑`,csup:`⫐`,csupe:`⫒`,ctdot:`⋯`,cudarrl:`⤸`,cudarrr:`⤵`,cuepr:`⋞`,cuesc:`⋟`,cularr:`↶`,cularrp:`⤽`,cup:`∪`,cupbrcap:`⩈`,cupcap:`⩆`,cupcup:`⩊`,cupdot:`⊍`,cupor:`⩅`,cups:`∪︀`,curarr:`↷`,curarrm:`⤼`,curlyeqprec:`⋞`,curlyeqsucc:`⋟`,curlyvee:`⋎`,curlywedge:`⋏`,curren:`¤`,curvearrowleft:`↶`,curvearrowright:`↷`,cuvee:`⋎`,cuwed:`⋏`,cwconint:`∲`,cwint:`∱`,cylcty:`⌭`,dArr:`⇓`,dHar:`⥥`,dagger:`†`,daleth:`ℸ`,darr:`↓`,dash:`‐`,dashv:`⊣`,dbkarow:`⤏`,dblac:`˝`,dcaron:`ď`,dcy:`д`,dd:`ⅆ`,ddagger:`‡`,ddarr:`⇊`,ddotseq:`⩷`,deg:`°`,delta:`δ`,demptyv:`⦱`,dfisht:`⥿`,dfr:`𝔡`,dharl:`⇃`,dharr:`⇂`,diam:`⋄`,diamond:`⋄`,diamondsuit:`♦`,diams:`♦`,die:`¨`,digamma:`ϝ`,disin:`⋲`,div:`÷`,divide:`÷`,divideontimes:`⋇`,divonx:`⋇`,djcy:`ђ`,dlcorn:`⌞`,dlcrop:`⌍`,dollar:`$`,dopf:`𝕕`,dot:`˙`,doteq:`≐`,doteqdot:`≑`,dotminus:`∸`,dotplus:`∔`,dotsquare:`⊡`,doublebarwedge:`⌆`,downarrow:`↓`,downdownarrows:`⇊`,downharpoonleft:`⇃`,downharpoonright:`⇂`,drbkarow:`⤐`,drcorn:`⌟`,drcrop:`⌌`,dscr:`𝒹`,dscy:`ѕ`,dsol:`⧶`,dstrok:`đ`,dtdot:`⋱`,dtri:`▿`,dtrif:`▾`,duarr:`⇵`,duhar:`⥯`,dwangle:`⦦`,dzcy:`џ`,dzigrarr:`⟿`,eDDot:`⩷`,eDot:`≑`,eacute:`é`,easter:`⩮`,ecaron:`ě`,ecir:`≖`,ecirc:`ê`,ecolon:`≕`,ecy:`э`,edot:`ė`,ee:`ⅇ`,efDot:`≒`,efr:`𝔢`,eg:`⪚`,egrave:`è`,egs:`⪖`,egsdot:`⪘`,el:`⪙`,elinters:`⏧`,ell:`ℓ`,els:`⪕`,elsdot:`⪗`,emacr:`ē`,empty:`∅`,emptyset:`∅`,emptyv:`∅`,emsp13:` `,emsp14:` `,emsp:` `,eng:`ŋ`,ensp:` `,eogon:`ę`,eopf:`𝕖`,epar:`⋕`,eparsl:`⧣`,eplus:`⩱`,epsi:`ε`,epsilon:`ε`,epsiv:`ϵ`,eqcirc:`≖`,eqcolon:`≕`,eqsim:`≂`,eqslantgtr:`⪖`,eqslantless:`⪕`,equals:`=`,equest:`≟`,equiv:`≡`,equivDD:`⩸`,eqvparsl:`⧥`,erDot:`≓`,erarr:`⥱`,escr:`ℯ`,esdot:`≐`,esim:`≂`,eta:`η`,eth:`ð`,euml:`ë`,euro:`€`,excl:`!`,exist:`∃`,expectation:`ℰ`,exponentiale:`ⅇ`,fallingdotseq:`≒`,fcy:`ф`,female:`♀`,ffilig:`ffi`,fflig:`ff`,ffllig:`ffl`,ffr:`𝔣`,filig:`fi`,fjlig:`fj`,flat:`♭`,fllig:`fl`,fltns:`▱`,fnof:`ƒ`,fopf:`𝕗`,forall:`∀`,fork:`⋔`,forkv:`⫙`,fpartint:`⨍`,frac12:`½`,frac13:`⅓`,frac14:`¼`,frac15:`⅕`,frac16:`⅙`,frac18:`⅛`,frac23:`⅔`,frac25:`⅖`,frac34:`¾`,frac35:`⅗`,frac38:`⅜`,frac45:`⅘`,frac56:`⅚`,frac58:`⅝`,frac78:`⅞`,frasl:`⁄`,frown:`⌢`,fscr:`𝒻`,gE:`≧`,gEl:`⪌`,gacute:`ǵ`,gamma:`γ`,gammad:`ϝ`,gap:`⪆`,gbreve:`ğ`,gcirc:`ĝ`,gcy:`г`,gdot:`ġ`,ge:`≥`,gel:`⋛`,geq:`≥`,geqq:`≧`,geqslant:`⩾`,ges:`⩾`,gescc:`⪩`,gesdot:`⪀`,gesdoto:`⪂`,gesdotol:`⪄`,gesl:`⋛︀`,gesles:`⪔`,gfr:`𝔤`,gg:`≫`,ggg:`⋙`,gimel:`ℷ`,gjcy:`ѓ`,gl:`≷`,glE:`⪒`,gla:`⪥`,glj:`⪤`,gnE:`≩`,gnap:`⪊`,gnapprox:`⪊`,gne:`⪈`,gneq:`⪈`,gneqq:`≩`,gnsim:`⋧`,gopf:`𝕘`,grave:"`",gscr:`ℊ`,gsim:`≳`,gsime:`⪎`,gsiml:`⪐`,gt:`>`,gtcc:`⪧`,gtcir:`⩺`,gtdot:`⋗`,gtlPar:`⦕`,gtquest:`⩼`,gtrapprox:`⪆`,gtrarr:`⥸`,gtrdot:`⋗`,gtreqless:`⋛`,gtreqqless:`⪌`,gtrless:`≷`,gtrsim:`≳`,gvertneqq:`≩︀`,gvnE:`≩︀`,hArr:`⇔`,hairsp:` `,half:`½`,hamilt:`ℋ`,hardcy:`ъ`,harr:`↔`,harrcir:`⥈`,harrw:`↭`,hbar:`ℏ`,hcirc:`ĥ`,hearts:`♥`,heartsuit:`♥`,hellip:`…`,hercon:`⊹`,hfr:`𝔥`,hksearow:`⤥`,hkswarow:`⤦`,hoarr:`⇿`,homtht:`∻`,hookleftarrow:`↩`,hookrightarrow:`↪`,hopf:`𝕙`,horbar:`―`,hscr:`𝒽`,hslash:`ℏ`,hstrok:`ħ`,hybull:`⁃`,hyphen:`‐`,iacute:`í`,ic:``,icirc:`î`,icy:`и`,iecy:`е`,iexcl:`¡`,iff:`⇔`,ifr:`𝔦`,igrave:`ì`,ii:`ⅈ`,iiiint:`⨌`,iiint:`∭`,iinfin:`⧜`,iiota:`℩`,ijlig:`ij`,imacr:`ī`,image:`ℑ`,imagline:`ℐ`,imagpart:`ℑ`,imath:`ı`,imof:`⊷`,imped:`Ƶ`,in:`∈`,incare:`℅`,infin:`∞`,infintie:`⧝`,inodot:`ı`,int:`∫`,intcal:`⊺`,integers:`ℤ`,intercal:`⊺`,intlarhk:`⨗`,intprod:`⨼`,iocy:`ё`,iogon:`į`,iopf:`𝕚`,iota:`ι`,iprod:`⨼`,iquest:`¿`,iscr:`𝒾`,isin:`∈`,isinE:`⋹`,isindot:`⋵`,isins:`⋴`,isinsv:`⋳`,isinv:`∈`,it:``,itilde:`ĩ`,iukcy:`і`,iuml:`ï`,jcirc:`ĵ`,jcy:`й`,jfr:`𝔧`,jmath:`ȷ`,jopf:`𝕛`,jscr:`𝒿`,jsercy:`ј`,jukcy:`є`,kappa:`κ`,kappav:`ϰ`,kcedil:`ķ`,kcy:`к`,kfr:`𝔨`,kgreen:`ĸ`,khcy:`х`,kjcy:`ќ`,kopf:`𝕜`,kscr:`𝓀`,lAarr:`⇚`,lArr:`⇐`,lAtail:`⤛`,lBarr:`⤎`,lE:`≦`,lEg:`⪋`,lHar:`⥢`,lacute:`ĺ`,laemptyv:`⦴`,lagran:`ℒ`,lambda:`λ`,lang:`⟨`,langd:`⦑`,langle:`⟨`,lap:`⪅`,laquo:`«`,larr:`←`,larrb:`⇤`,larrbfs:`⤟`,larrfs:`⤝`,larrhk:`↩`,larrlp:`↫`,larrpl:`⤹`,larrsim:`⥳`,larrtl:`↢`,lat:`⪫`,latail:`⤙`,late:`⪭`,lates:`⪭︀`,lbarr:`⤌`,lbbrk:`❲`,lbrace:`{`,lbrack:`[`,lbrke:`⦋`,lbrksld:`⦏`,lbrkslu:`⦍`,lcaron:`ľ`,lcedil:`ļ`,lceil:`⌈`,lcub:`{`,lcy:`л`,ldca:`⤶`,ldquo:`“`,ldquor:`„`,ldrdhar:`⥧`,ldrushar:`⥋`,ldsh:`↲`,le:`≤`,leftarrow:`←`,leftarrowtail:`↢`,leftharpoondown:`↽`,leftharpoonup:`↼`,leftleftarrows:`⇇`,leftrightarrow:`↔`,leftrightarrows:`⇆`,leftrightharpoons:`⇋`,leftrightsquigarrow:`↭`,leftthreetimes:`⋋`,leg:`⋚`,leq:`≤`,leqq:`≦`,leqslant:`⩽`,les:`⩽`,lescc:`⪨`,lesdot:`⩿`,lesdoto:`⪁`,lesdotor:`⪃`,lesg:`⋚︀`,lesges:`⪓`,lessapprox:`⪅`,lessdot:`⋖`,lesseqgtr:`⋚`,lesseqqgtr:`⪋`,lessgtr:`≶`,lesssim:`≲`,lfisht:`⥼`,lfloor:`⌊`,lfr:`𝔩`,lg:`≶`,lgE:`⪑`,lhard:`↽`,lharu:`↼`,lharul:`⥪`,lhblk:`▄`,ljcy:`љ`,ll:`≪`,llarr:`⇇`,llcorner:`⌞`,llhard:`⥫`,lltri:`◺`,lmidot:`ŀ`,lmoust:`⎰`,lmoustache:`⎰`,lnE:`≨`,lnap:`⪉`,lnapprox:`⪉`,lne:`⪇`,lneq:`⪇`,lneqq:`≨`,lnsim:`⋦`,loang:`⟬`,loarr:`⇽`,lobrk:`⟦`,longleftarrow:`⟵`,longleftrightarrow:`⟷`,longmapsto:`⟼`,longrightarrow:`⟶`,looparrowleft:`↫`,looparrowright:`↬`,lopar:`⦅`,lopf:`𝕝`,loplus:`⨭`,lotimes:`⨴`,lowast:`∗`,lowbar:`_`,loz:`◊`,lozenge:`◊`,lozf:`⧫`,lpar:`(`,lparlt:`⦓`,lrarr:`⇆`,lrcorner:`⌟`,lrhar:`⇋`,lrhard:`⥭`,lrm:``,lrtri:`⊿`,lsaquo:`‹`,lscr:`𝓁`,lsh:`↰`,lsim:`≲`,lsime:`⪍`,lsimg:`⪏`,lsqb:`[`,lsquo:`‘`,lsquor:`‚`,lstrok:`ł`,lt:`<`,ltcc:`⪦`,ltcir:`⩹`,ltdot:`⋖`,lthree:`⋋`,ltimes:`⋉`,ltlarr:`⥶`,ltquest:`⩻`,ltrPar:`⦖`,ltri:`◃`,ltrie:`⊴`,ltrif:`◂`,lurdshar:`⥊`,luruhar:`⥦`,lvertneqq:`≨︀`,lvnE:`≨︀`,mDDot:`∺`,macr:`¯`,male:`♂`,malt:`✠`,maltese:`✠`,map:`↦`,mapsto:`↦`,mapstodown:`↧`,mapstoleft:`↤`,mapstoup:`↥`,marker:`▮`,mcomma:`⨩`,mcy:`м`,mdash:`—`,measuredangle:`∡`,mfr:`𝔪`,mho:`℧`,micro:`µ`,mid:`∣`,midast:`*`,midcir:`⫰`,middot:`·`,minus:`−`,minusb:`⊟`,minusd:`∸`,minusdu:`⨪`,mlcp:`⫛`,mldr:`…`,mnplus:`∓`,models:`⊧`,mopf:`𝕞`,mp:`∓`,mscr:`𝓂`,mstpos:`∾`,mu:`μ`,multimap:`⊸`,mumap:`⊸`,nGg:`⋙̸`,nGt:`≫⃒`,nGtv:`≫̸`,nLeftarrow:`⇍`,nLeftrightarrow:`⇎`,nLl:`⋘̸`,nLt:`≪⃒`,nLtv:`≪̸`,nRightarrow:`⇏`,nVDash:`⊯`,nVdash:`⊮`,nabla:`∇`,nacute:`ń`,nang:`∠⃒`,nap:`≉`,napE:`⩰̸`,napid:`≋̸`,napos:`ʼn`,napprox:`≉`,natur:`♮`,natural:`♮`,naturals:`ℕ`,nbsp:`\xA0`,nbump:`≎̸`,nbumpe:`≏̸`,ncap:`⩃`,ncaron:`ň`,ncedil:`ņ`,ncong:`≇`,ncongdot:`⩭̸`,ncup:`⩂`,ncy:`н`,ndash:`–`,ne:`≠`,neArr:`⇗`,nearhk:`⤤`,nearr:`↗`,nearrow:`↗`,nedot:`≐̸`,nequiv:`≢`,nesear:`⤨`,nesim:`≂̸`,nexist:`∄`,nexists:`∄`,nfr:`𝔫`,ngE:`≧̸`,nge:`≱`,ngeq:`≱`,ngeqq:`≧̸`,ngeqslant:`⩾̸`,nges:`⩾̸`,ngsim:`≵`,ngt:`≯`,ngtr:`≯`,nhArr:`⇎`,nharr:`↮`,nhpar:`⫲`,ni:`∋`,nis:`⋼`,nisd:`⋺`,niv:`∋`,njcy:`њ`,nlArr:`⇍`,nlE:`≦̸`,nlarr:`↚`,nldr:`‥`,nle:`≰`,nleftarrow:`↚`,nleftrightarrow:`↮`,nleq:`≰`,nleqq:`≦̸`,nleqslant:`⩽̸`,nles:`⩽̸`,nless:`≮`,nlsim:`≴`,nlt:`≮`,nltri:`⋪`,nltrie:`⋬`,nmid:`∤`,nopf:`𝕟`,not:`¬`,notin:`∉`,notinE:`⋹̸`,notindot:`⋵̸`,notinva:`∉`,notinvb:`⋷`,notinvc:`⋶`,notni:`∌`,notniva:`∌`,notnivb:`⋾`,notnivc:`⋽`,npar:`∦`,nparallel:`∦`,nparsl:`⫽⃥`,npart:`∂̸`,npolint:`⨔`,npr:`⊀`,nprcue:`⋠`,npre:`⪯̸`,nprec:`⊀`,npreceq:`⪯̸`,nrArr:`⇏`,nrarr:`↛`,nrarrc:`⤳̸`,nrarrw:`↝̸`,nrightarrow:`↛`,nrtri:`⋫`,nrtrie:`⋭`,nsc:`⊁`,nsccue:`⋡`,nsce:`⪰̸`,nscr:`𝓃`,nshortmid:`∤`,nshortparallel:`∦`,nsim:`≁`,nsime:`≄`,nsimeq:`≄`,nsmid:`∤`,nspar:`∦`,nsqsube:`⋢`,nsqsupe:`⋣`,nsub:`⊄`,nsubE:`⫅̸`,nsube:`⊈`,nsubset:`⊂⃒`,nsubseteq:`⊈`,nsubseteqq:`⫅̸`,nsucc:`⊁`,nsucceq:`⪰̸`,nsup:`⊅`,nsupE:`⫆̸`,nsupe:`⊉`,nsupset:`⊃⃒`,nsupseteq:`⊉`,nsupseteqq:`⫆̸`,ntgl:`≹`,ntilde:`ñ`,ntlg:`≸`,ntriangleleft:`⋪`,ntrianglelefteq:`⋬`,ntriangleright:`⋫`,ntrianglerighteq:`⋭`,nu:`ν`,num:`#`,numero:`№`,numsp:` `,nvDash:`⊭`,nvHarr:`⤄`,nvap:`≍⃒`,nvdash:`⊬`,nvge:`≥⃒`,nvgt:`>⃒`,nvinfin:`⧞`,nvlArr:`⤂`,nvle:`≤⃒`,nvlt:`<⃒`,nvltrie:`⊴⃒`,nvrArr:`⤃`,nvrtrie:`⊵⃒`,nvsim:`∼⃒`,nwArr:`⇖`,nwarhk:`⤣`,nwarr:`↖`,nwarrow:`↖`,nwnear:`⤧`,oS:`Ⓢ`,oacute:`ó`,oast:`⊛`,ocir:`⊚`,ocirc:`ô`,ocy:`о`,odash:`⊝`,odblac:`ő`,odiv:`⨸`,odot:`⊙`,odsold:`⦼`,oelig:`œ`,ofcir:`⦿`,ofr:`𝔬`,ogon:`˛`,ograve:`ò`,ogt:`⧁`,ohbar:`⦵`,ohm:`Ω`,oint:`∮`,olarr:`↺`,olcir:`⦾`,olcross:`⦻`,oline:`‾`,olt:`⧀`,omacr:`ō`,omega:`ω`,omicron:`ο`,omid:`⦶`,ominus:`⊖`,oopf:`𝕠`,opar:`⦷`,operp:`⦹`,oplus:`⊕`,or:`∨`,orarr:`↻`,ord:`⩝`,order:`ℴ`,orderof:`ℴ`,ordf:`ª`,ordm:`º`,origof:`⊶`,oror:`⩖`,orslope:`⩗`,orv:`⩛`,oscr:`ℴ`,oslash:`ø`,osol:`⊘`,otilde:`õ`,otimes:`⊗`,otimesas:`⨶`,ouml:`ö`,ovbar:`⌽`,par:`∥`,para:`¶`,parallel:`∥`,parsim:`⫳`,parsl:`⫽`,part:`∂`,pcy:`п`,percnt:`%`,period:`.`,permil:`‰`,perp:`⊥`,pertenk:`‱`,pfr:`𝔭`,phi:`φ`,phiv:`ϕ`,phmmat:`ℳ`,phone:`☎`,pi:`π`,pitchfork:`⋔`,piv:`ϖ`,planck:`ℏ`,planckh:`ℎ`,plankv:`ℏ`,plus:`+`,plusacir:`⨣`,plusb:`⊞`,pluscir:`⨢`,plusdo:`∔`,plusdu:`⨥`,pluse:`⩲`,plusmn:`±`,plussim:`⨦`,plustwo:`⨧`,pm:`±`,pointint:`⨕`,popf:`𝕡`,pound:`£`,pr:`≺`,prE:`⪳`,prap:`⪷`,prcue:`≼`,pre:`⪯`,prec:`≺`,precapprox:`⪷`,preccurlyeq:`≼`,preceq:`⪯`,precnapprox:`⪹`,precneqq:`⪵`,precnsim:`⋨`,precsim:`≾`,prime:`′`,primes:`ℙ`,prnE:`⪵`,prnap:`⪹`,prnsim:`⋨`,prod:`∏`,profalar:`⌮`,profline:`⌒`,profsurf:`⌓`,prop:`∝`,propto:`∝`,prsim:`≾`,prurel:`⊰`,pscr:`𝓅`,psi:`ψ`,puncsp:` `,qfr:`𝔮`,qint:`⨌`,qopf:`𝕢`,qprime:`⁗`,qscr:`𝓆`,quaternions:`ℍ`,quatint:`⨖`,quest:`?`,questeq:`≟`,quot:`"`,rAarr:`⇛`,rArr:`⇒`,rAtail:`⤜`,rBarr:`⤏`,rHar:`⥤`,race:`∽̱`,racute:`ŕ`,radic:`√`,raemptyv:`⦳`,rang:`⟩`,rangd:`⦒`,range:`⦥`,rangle:`⟩`,raquo:`»`,rarr:`→`,rarrap:`⥵`,rarrb:`⇥`,rarrbfs:`⤠`,rarrc:`⤳`,rarrfs:`⤞`,rarrhk:`↪`,rarrlp:`↬`,rarrpl:`⥅`,rarrsim:`⥴`,rarrtl:`↣`,rarrw:`↝`,ratail:`⤚`,ratio:`∶`,rationals:`ℚ`,rbarr:`⤍`,rbbrk:`❳`,rbrace:`}`,rbrack:`]`,rbrke:`⦌`,rbrksld:`⦎`,rbrkslu:`⦐`,rcaron:`ř`,rcedil:`ŗ`,rceil:`⌉`,rcub:`}`,rcy:`р`,rdca:`⤷`,rdldhar:`⥩`,rdquo:`”`,rdquor:`”`,rdsh:`↳`,real:`ℜ`,realine:`ℛ`,realpart:`ℜ`,reals:`ℝ`,rect:`▭`,reg:`®`,rfisht:`⥽`,rfloor:`⌋`,rfr:`𝔯`,rhard:`⇁`,rharu:`⇀`,rharul:`⥬`,rho:`ρ`,rhov:`ϱ`,rightarrow:`→`,rightarrowtail:`↣`,rightharpoondown:`⇁`,rightharpoonup:`⇀`,rightleftarrows:`⇄`,rightleftharpoons:`⇌`,rightrightarrows:`⇉`,rightsquigarrow:`↝`,rightthreetimes:`⋌`,ring:`˚`,risingdotseq:`≓`,rlarr:`⇄`,rlhar:`⇌`,rlm:``,rmoust:`⎱`,rmoustache:`⎱`,rnmid:`⫮`,roang:`⟭`,roarr:`⇾`,robrk:`⟧`,ropar:`⦆`,ropf:`𝕣`,roplus:`⨮`,rotimes:`⨵`,rpar:`)`,rpargt:`⦔`,rppolint:`⨒`,rrarr:`⇉`,rsaquo:`›`,rscr:`𝓇`,rsh:`↱`,rsqb:`]`,rsquo:`’`,rsquor:`’`,rthree:`⋌`,rtimes:`⋊`,rtri:`▹`,rtrie:`⊵`,rtrif:`▸`,rtriltri:`⧎`,ruluhar:`⥨`,rx:`℞`,sacute:`ś`,sbquo:`‚`,sc:`≻`,scE:`⪴`,scap:`⪸`,scaron:`š`,sccue:`≽`,sce:`⪰`,scedil:`ş`,scirc:`ŝ`,scnE:`⪶`,scnap:`⪺`,scnsim:`⋩`,scpolint:`⨓`,scsim:`≿`,scy:`с`,sdot:`⋅`,sdotb:`⊡`,sdote:`⩦`,seArr:`⇘`,searhk:`⤥`,searr:`↘`,searrow:`↘`,sect:`§`,semi:`;`,seswar:`⤩`,setminus:`∖`,setmn:`∖`,sext:`✶`,sfr:`𝔰`,sfrown:`⌢`,sharp:`♯`,shchcy:`щ`,shcy:`ш`,shortmid:`∣`,shortparallel:`∥`,shy:``,sigma:`σ`,sigmaf:`ς`,sigmav:`ς`,sim:`∼`,simdot:`⩪`,sime:`≃`,simeq:`≃`,simg:`⪞`,simgE:`⪠`,siml:`⪝`,simlE:`⪟`,simne:`≆`,simplus:`⨤`,simrarr:`⥲`,slarr:`←`,smallsetminus:`∖`,smashp:`⨳`,smeparsl:`⧤`,smid:`∣`,smile:`⌣`,smt:`⪪`,smte:`⪬`,smtes:`⪬︀`,softcy:`ь`,sol:`/`,solb:`⧄`,solbar:`⌿`,sopf:`𝕤`,spades:`♠`,spadesuit:`♠`,spar:`∥`,sqcap:`⊓`,sqcaps:`⊓︀`,sqcup:`⊔`,sqcups:`⊔︀`,sqsub:`⊏`,sqsube:`⊑`,sqsubset:`⊏`,sqsubseteq:`⊑`,sqsup:`⊐`,sqsupe:`⊒`,sqsupset:`⊐`,sqsupseteq:`⊒`,squ:`□`,square:`□`,squarf:`▪`,squf:`▪`,srarr:`→`,sscr:`𝓈`,ssetmn:`∖`,ssmile:`⌣`,sstarf:`⋆`,star:`☆`,starf:`★`,straightepsilon:`ϵ`,straightphi:`ϕ`,strns:`¯`,sub:`⊂`,subE:`⫅`,subdot:`⪽`,sube:`⊆`,subedot:`⫃`,submult:`⫁`,subnE:`⫋`,subne:`⊊`,subplus:`⪿`,subrarr:`⥹`,subset:`⊂`,subseteq:`⊆`,subseteqq:`⫅`,subsetneq:`⊊`,subsetneqq:`⫋`,subsim:`⫇`,subsub:`⫕`,subsup:`⫓`,succ:`≻`,succapprox:`⪸`,succcurlyeq:`≽`,succeq:`⪰`,succnapprox:`⪺`,succneqq:`⪶`,succnsim:`⋩`,succsim:`≿`,sum:`∑`,sung:`♪`,sup1:`¹`,sup2:`²`,sup3:`³`,sup:`⊃`,supE:`⫆`,supdot:`⪾`,supdsub:`⫘`,supe:`⊇`,supedot:`⫄`,suphsol:`⟉`,suphsub:`⫗`,suplarr:`⥻`,supmult:`⫂`,supnE:`⫌`,supne:`⊋`,supplus:`⫀`,supset:`⊃`,supseteq:`⊇`,supseteqq:`⫆`,supsetneq:`⊋`,supsetneqq:`⫌`,supsim:`⫈`,supsub:`⫔`,supsup:`⫖`,swArr:`⇙`,swarhk:`⤦`,swarr:`↙`,swarrow:`↙`,swnwar:`⤪`,szlig:`ß`,target:`⌖`,tau:`τ`,tbrk:`⎴`,tcaron:`ť`,tcedil:`ţ`,tcy:`т`,tdot:`⃛`,telrec:`⌕`,tfr:`𝔱`,there4:`∴`,therefore:`∴`,theta:`θ`,thetasym:`ϑ`,thetav:`ϑ`,thickapprox:`≈`,thicksim:`∼`,thinsp:` `,thkap:`≈`,thksim:`∼`,thorn:`þ`,tilde:`˜`,times:`×`,timesb:`⊠`,timesbar:`⨱`,timesd:`⨰`,tint:`∭`,toea:`⤨`,top:`⊤`,topbot:`⌶`,topcir:`⫱`,topf:`𝕥`,topfork:`⫚`,tosa:`⤩`,tprime:`‴`,trade:`™`,triangle:`▵`,triangledown:`▿`,triangleleft:`◃`,trianglelefteq:`⊴`,triangleq:`≜`,triangleright:`▹`,trianglerighteq:`⊵`,tridot:`◬`,trie:`≜`,triminus:`⨺`,triplus:`⨹`,trisb:`⧍`,tritime:`⨻`,trpezium:`⏢`,tscr:`𝓉`,tscy:`ц`,tshcy:`ћ`,tstrok:`ŧ`,twixt:`≬`,twoheadleftarrow:`↞`,twoheadrightarrow:`↠`,uArr:`⇑`,uHar:`⥣`,uacute:`ú`,uarr:`↑`,ubrcy:`ў`,ubreve:`ŭ`,ucirc:`û`,ucy:`у`,udarr:`⇅`,udblac:`ű`,udhar:`⥮`,ufisht:`⥾`,ufr:`𝔲`,ugrave:`ù`,uharl:`↿`,uharr:`↾`,uhblk:`▀`,ulcorn:`⌜`,ulcorner:`⌜`,ulcrop:`⌏`,ultri:`◸`,umacr:`ū`,uml:`¨`,uogon:`ų`,uopf:`𝕦`,uparrow:`↑`,updownarrow:`↕`,upharpoonleft:`↿`,upharpoonright:`↾`,uplus:`⊎`,upsi:`υ`,upsih:`ϒ`,upsilon:`υ`,upuparrows:`⇈`,urcorn:`⌝`,urcorner:`⌝`,urcrop:`⌎`,uring:`ů`,urtri:`◹`,uscr:`𝓊`,utdot:`⋰`,utilde:`ũ`,utri:`▵`,utrif:`▴`,uuarr:`⇈`,uuml:`ü`,uwangle:`⦧`,vArr:`⇕`,vBar:`⫨`,vBarv:`⫩`,vDash:`⊨`,vangrt:`⦜`,varepsilon:`ϵ`,varkappa:`ϰ`,varnothing:`∅`,varphi:`ϕ`,varpi:`ϖ`,varpropto:`∝`,varr:`↕`,varrho:`ϱ`,varsigma:`ς`,varsubsetneq:`⊊︀`,varsubsetneqq:`⫋︀`,varsupsetneq:`⊋︀`,varsupsetneqq:`⫌︀`,vartheta:`ϑ`,vartriangleleft:`⊲`,vartriangleright:`⊳`,vcy:`в`,vdash:`⊢`,vee:`∨`,veebar:`⊻`,veeeq:`≚`,vellip:`⋮`,verbar:`|`,vert:`|`,vfr:`𝔳`,vltri:`⊲`,vnsub:`⊂⃒`,vnsup:`⊃⃒`,vopf:`𝕧`,vprop:`∝`,vrtri:`⊳`,vscr:`𝓋`,vsubnE:`⫋︀`,vsubne:`⊊︀`,vsupnE:`⫌︀`,vsupne:`⊋︀`,vzigzag:`⦚`,wcirc:`ŵ`,wedbar:`⩟`,wedge:`∧`,wedgeq:`≙`,weierp:`℘`,wfr:`𝔴`,wopf:`𝕨`,wp:`℘`,wr:`≀`,wreath:`≀`,wscr:`𝓌`,xcap:`⋂`,xcirc:`◯`,xcup:`⋃`,xdtri:`▽`,xfr:`𝔵`,xhArr:`⟺`,xharr:`⟷`,xi:`ξ`,xlArr:`⟸`,xlarr:`⟵`,xmap:`⟼`,xnis:`⋻`,xodot:`⨀`,xopf:`𝕩`,xoplus:`⨁`,xotime:`⨂`,xrArr:`⟹`,xrarr:`⟶`,xscr:`𝓍`,xsqcup:`⨆`,xuplus:`⨄`,xutri:`△`,xvee:`⋁`,xwedge:`⋀`,yacute:`ý`,yacy:`я`,ycirc:`ŷ`,ycy:`ы`,yen:`¥`,yfr:`𝔶`,yicy:`ї`,yopf:`𝕪`,yscr:`𝓎`,yucy:`ю`,yuml:`ÿ`,zacute:`ź`,zcaron:`ž`,zcy:`з`,zdot:`ż`,zeetrf:`ℨ`,zeta:`ζ`,zfr:`𝔷`,zhcy:`ж`,zigrarr:`⇝`,zopf:`𝕫`,zscr:`𝓏`,zwj:``,zwnj:``},Cn={}.hasOwnProperty;function wn(e){return Cn.call(Sn,e)?Sn[e]:!1}function Tn(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}const En=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Dn(e){return e.replace(En,On)}function On(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Tn(n.slice(t?2:1),t?16:10)}return wn(n)||e}function kn(e){return e.label||!e.identifier?e.label||``:Dn(e.identifier)}function An(e){if(!e._compiled){let t=(e.atBreak?`[\\r\\n][\\t ]*`:``)+(e.before?`(?:`+e.before+`)`:``);e._compiled=RegExp((t?`(`+t+`)`:``)+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?`\\`:``)+e.character+(e.after?`(?:`+e.after+`)`:``),`g`)}return e._compiled}function jn(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before,c;r.push(-1);let l=t.createTracker(n);for(;++o<i.length;){let u=i[o],d;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),d=n?n(i[o+1],e,t,{before:``,after:``,...l.current()}).charAt(0):``}else d=n.after;a.length>0&&(s===`\r`||s===`
|
|
24
|
-
`)&&u.type===`html`&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/,` `),s=` `,l=t.createTracker(n),l.move(a.join(``)));let f=t.handle(u,e,t,{...l.current(),after:d,before:s});c&&c===f.slice(0,1)&&(f=kt(c.charCodeAt(0))+f.slice(1));let p=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,c=void 0,p&&(a.length>0&&p.before&&s===a[a.length-1].slice(-1)&&(a[a.length-1]=a[a.length-1].slice(0,-1)+kt(s.charCodeAt(0))),p.after&&(c=d)),l.move(f),a.push(f),s=f.slice(-1)}return r.pop(),a.join(``)}function Mn(e,t,n){let r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,o.push(a.move(t.handle(n,e,t,{before:`
|
|
25
|
-
`,after:`
|
|
26
|
-
`,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move(Nn(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function Nn(e,t,n,r){let i=r.join.length;for(;i--;){let a=r.join[i](e,t,n,r);if(a===!0||a===1)break;if(typeof a==`number`)return`
|
|
27
|
-
`.repeat(1+a);if(a===!1)return`
|
|
28
|
-
|
|
29
|
-
<!---->
|
|
30
|
-
|
|
31
|
-
`}return`
|
|
32
|
-
|
|
33
|
-
`}const Pn=/\r?\n|\r/g;function Fn(e,t){let n=[],r=0,i=0,a;for(;a=Pn.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}function In(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},s=-1;for(;++s<e.unsafe.length;){let t=e.unsafe[s];if(!B(e.stack,t))continue;let n=e.compilePattern(t),a;for(;a=n.exec(r);){let e=`before`in t||!!t.atBreak,n=`after`in t,r=a.index+(e?a[1].length:0);i.includes(r)?(o[r].before&&!e&&(o[r].before=!1),o[r].after&&!n&&(o[r].after=!1)):(i.push(r),o[r]={before:e,after:n})}}i.sort(Ln);let c=n.before?n.before.length:0,l=r.length-(n.after?n.after.length:0);for(s=-1;++s<i.length;){let e=i[s];e<c||e>=l||e+1<l&&i[s+1]===e+1&&o[e].after&&!o[e+1].before&&!o[e+1].after||i[s-1]===e-1&&o[e].before&&!o[e-1].before&&!o[e-1].after||(c!==e&&a.push(Rn(r.slice(c,e),`\\`)),c=e,/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`):(a.push(kt(r.charCodeAt(e))),c++))}return a.push(Rn(r.slice(c,l),n.after)),a.join(``)}function Ln(e,t){return e-t}function Rn(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],a=e+t,o=-1,s=0,c;for(;c=n.exec(a);)r.push(c.index);for(;++o<r.length;)s!==r[o]&&i.push(e.slice(s,r[o])),i.push(`\\`),s=r[o];return i.push(e.slice(s)),i.join(``)}function zn(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}function Bn(e,t){let n=t||{},r={associationId:kn,containerPhrasing:Wn,containerFlow:Gn,createTracker:zn,compilePattern:An,enter:a,handlers:{..._n},handle:void 0,indentLines:Fn,indexStack:[],join:[...vn],options:{},safe:Kn,stack:[],unsafe:[...xn]};mt(r,n),r.options.tightDefinitions&&r.join.push(Un),r.handle=ft(`type`,{invalid:Vn,unknown:Hn,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
|
|
34
|
-
`,after:`
|
|
35
|
-
`,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
|
|
36
|
-
`),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function Vn(e){throw Error("Cannot handle value `"+e+"`, expected node")}function Hn(e){let t=e;throw Error("Cannot handle unknown node `"+t.type+"`")}function Un(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function Wn(e,t){return jn(e,this,t)}function Gn(e,t){return Mn(e,this,t)}function Kn(e,t){return In(this,e,t)}function qn(){return{enter:{table:Jn,tableData:Qn,tableHeader:Qn,tableRow:Xn},exit:{codeText:$n,table:Yn,tableData:Zn,tableHeader:Zn,tableRow:Zn}}}function Jn(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Yn(e){this.exit(e),this.data.inTable=void 0}function Xn(e){this.enter({type:`tableRow`,children:[]},e)}function Zn(e){this.exit(e)}function Qn(e){this.enter({type:`tableCell`,children:[]},e)}function $n(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,er));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function er(e,t){return t===`|`?t:e}function tr(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
37
|
-
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
38
|
-
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return ct(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=_n.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function nr(){return{exit:{taskListCheckValueChecked:ir,taskListCheckValueUnchecked:ir,paragraph:ar}}}function rr(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:or}}}function ir(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function ar(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function or(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=_n.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function sr(){return[Oe(),Xe(),tt(),qn(),nr()]}function cr(e){return{extensions:[ke(),Ze(e),nt(),tr(e),rr()]}}function lr(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function ur(e,t){return e.length>0?(lr(e,e.length,0,t),e):t}const dr={}.hasOwnProperty;function fr(e){let t={},n=-1;for(;++n<e.length;)pr(t,e[n]);return t}function pr(e,t){let n;for(n in t){let r=(dr.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){dr.call(r,a)||(r[a]=[]);let e=i[a];mr(r[a],Array.isArray(e)?e:e?[e]:[])}}}function mr(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);lr(e,0,0,r)}const hr={tokenize:kr,partial:!0},gr={tokenize:Ar,partial:!0},_r={tokenize:jr,partial:!0},vr={tokenize:Mr,partial:!0},yr={tokenize:Nr,partial:!0},br={name:`wwwAutolink`,tokenize:Dr,previous:Pr},xr={name:`protocolAutolink`,tokenize:Or,previous:Fr},Sr={name:`emailAutolink`,tokenize:Er,previous:Ir},Cr={};function wr(){return{text:Cr}}let Tr=48;for(;Tr<123;)Cr[Tr]=Sr,Tr++,Tr===58?Tr=65:Tr===91&&(Tr=97);Cr[43]=Sr,Cr[45]=Sr,Cr[46]=Sr,Cr[95]=Sr,Cr[72]=[Sr,xr],Cr[104]=[Sr,xr],Cr[87]=[Sr,br],Cr[119]=[Sr,br];function Er(e,t,n){let r=this,i,a;return o;function o(t){return!Lr(t)||!Ir.call(r,r.previous)||Rr(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Lr(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(yr,u,l)(t):t===45||t===95||p(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&f(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Dr(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Pr.call(r,r.previous)||Rr(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(hr,e.attempt(gr,e.attempt(_r,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Or(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Fr.call(r,r.previous)&&!Rr(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(f(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||h(t)||b(t)||C(t)||S(t)?n(t):e.attempt(gr,e.attempt(_r,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function kr(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Ar(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(vr,c,s)(t):t===null||b(t)||C(t)||t!==45&&S(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function jr(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(vr,t,a)(o):o===null||b(o)||C(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Mr(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||b(o)||C(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||b(e)||C(e)?t(e):r(e)}function a(e){return f(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):f(t)?(e.consume(t),o):n(t)}}function Nr(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return p(e)?n(e):t(e)}}function Pr(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||b(e)}function Fr(e){return!f(e)}function Ir(e){return!(e===47||Lr(e))}function Lr(e){return e===43||e===45||e===46||e===95||p(e)}function Rr(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function zr(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Br={name:`attention`,resolveAll:Vr,tokenize:Hr};function Vr(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Ur(d,-c),Ur(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=ur(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=ur(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=ur(l,zr(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=ur(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=ur(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,lr(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Hr(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=At(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=At(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Ur(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Wr={name:`autolink`,tokenize:Gr};function Gr(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return f(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||p(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||p(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||h(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):m(t)?(e.consume(t),l):n(t)}function u(e){return p(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):g(n)}function g(t){if((t===45||p(t))&&r++<63){let n=t===45?g:d;return e.consume(t),n}return n(t)}}function H(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return x(r)?(e.enter(n),s(r)):t(r)}function s(r){return x(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const Kr={partial:!0,tokenize:qr};function qr(e,t,n){return r;function r(t){return x(t)?H(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||y(e)?t(e):n(e)}}const Jr={continuation:{tokenize:Xr},exit:Zr,name:`blockQuote`,tokenize:Yr};function Yr(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return x(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Xr(e,t,n){let r=this;return i;function i(t){return x(t)?H(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Jr,t,n)(r)}}function Zr(e){e.exit(`blockQuote`)}const Qr={name:`characterEscape`,tokenize:$r};function $r(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return v(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const ei={name:`characterReference`,tokenize:ti};function ti(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=p,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=_,u):(e.enter(`characterReferenceValue`),a=7,o=g,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===p&&!wn(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}const ni={partial:!0,tokenize:ai},ri={concrete:!0,name:`codeFenced`,tokenize:ii};function ii(e,t,n){let r=this,i={partial:!0,tokenize:C},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),x(t)?H(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||y(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(ni,h,S)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):x(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),H(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||y(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,S,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&x(t)?H(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||y(t)?e.check(ni,h,S)(t):(e.enter(`codeFlowValue`),b(t))}function b(t){return t===null||y(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),b)}function S(n){return e.exit(`codeFenced`),t(n)}function C(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),x(t)?H(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),x(t)?H(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||y(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function ai(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const oi={name:`codeIndented`,tokenize:ci},si={partial:!0,tokenize:li};function ci(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),H(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):y(t)?e.attempt(si,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||y(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function li(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):H(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):y(e)?i(e):n(e)}}const ui={name:`codeText`,previous:fi,resolve:di,tokenize:pi};function di(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function fi(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function pi(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||y(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var mi=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&hi(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),hi(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),hi(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);hi(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);hi(this.left,t.reverse())}}};function hi(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function gi(e){let t={},n=-1,r,i,a,o,s,c,l,u=new mi(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,_i(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return lr(e,0,1/0,u.slice(0)),!l}function _i(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}const vi={resolve:bi,tokenize:xi},yi={partial:!0,tokenize:Si};function bi(e){return gi(e),e}function xi(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):y(t)?e.check(yi,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Si(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),H(e,a,`linePrefix`)}function a(i){if(i===null||y(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Ci(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||h(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),g(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||y(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function g(i){return!u&&(i===null||i===41||b(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,g):i===41?(e.consume(i),u--,g):i===null||i===32||i===40||h(i)?n(i):(e.consume(i),i===92?_:g)}function _(t){return t===40||t===41||t===92?(e.consume(t),g):g(t)}}function wi(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):y(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||y(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!x(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Ti(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),H(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||y(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Ei(e,t){let n;return r;function r(i){return y(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):x(i)?H(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const Di={name:`definition`,tokenize:ki},Oi={partial:!0,tokenize:Ai};function ki(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return wi.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Be(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return b(t)?Ei(e,l)(t):l(t)}function l(t){return Ci(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Oi,d,d)(t)}function d(t){return x(t)?H(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||y(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Ai(e,t,n){return r;function r(t){return b(t)?Ei(e,i)(t):n(t)}function i(t){return Ti(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return x(t)?H(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||y(e)?t(e):n(e)}}const ji={name:`hardBreakEscape`,tokenize:Mi};function Mi(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return y(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const Ni={name:`headingAtx`,resolve:Pi,tokenize:Fi};function Pi(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},lr(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Fi(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||b(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||y(n)?(e.exit(`atxHeading`),t(n)):x(n)?H(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||b(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const Ii=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Li=[`pre`,`script`,`style`,`textarea`],Ri={concrete:!0,name:`htmlFlow`,resolveTo:Vi,tokenize:Hi},zi={partial:!0,tokenize:Wi},Bi={partial:!0,tokenize:Ui};function Vi(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Hi(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),m):s===47?(e.consume(s),a=!0,_):s===63?(e.consume(s),i=3,r.interrupt?t:oe):f(s)?(e.consume(s),o=String.fromCharCode(s),v):n(s)}function m(a){return a===45?(e.consume(a),i=2,h):a===91?(e.consume(a),i=5,s=0,g):f(a)?(e.consume(a),i=4,r.interrupt?t:oe):n(a)}function h(i){return i===45?(e.consume(i),r.interrupt?t:oe):n(i)}function g(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:j:g):n(i)}function _(t){return f(t)?(e.consume(t),o=String.fromCharCode(t),v):n(t)}function v(s){if(s===null||s===47||s===62||b(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Li.includes(l)?(i=1,r.interrupt?t(s):j(s)):Ii.includes(o.toLowerCase())?(i=6,c?(e.consume(s),S):r.interrupt?t(s):j(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?C(s):w(s))}return s===45||p(s)?(e.consume(s),o+=String.fromCharCode(s),v):n(s)}function S(i){return i===62?(e.consume(i),r.interrupt?t:j):n(i)}function C(t){return x(t)?(e.consume(t),C):ee(t)}function w(t){return t===47?(e.consume(t),ee):t===58||t===95||f(t)?(e.consume(t),T):x(t)?(e.consume(t),w):ee(t)}function T(t){return t===45||t===46||t===58||t===95||p(t)?(e.consume(t),T):E(t)}function E(t){return t===61?(e.consume(t),D):x(t)?(e.consume(t),E):w(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,O):x(t)?(e.consume(t),D):k(t)}function O(t){return t===c?(e.consume(t),c=null,A):t===null||y(t)?n(t):(e.consume(t),O)}function k(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||b(t)?E(t):(e.consume(t),k)}function A(e){return e===47||e===62||x(e)?w(e):n(e)}function ee(t){return t===62?(e.consume(t),te):n(t)}function te(t){return t===null||y(t)?j(t):x(t)?(e.consume(t),te):n(t)}function j(t){return t===45&&i===2?(e.consume(t),N):t===60&&i===1?(e.consume(t),P):t===62&&i===4?(e.consume(t),se):t===63&&i===3?(e.consume(t),oe):t===93&&i===5?(e.consume(t),ae):y(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(zi,ce,M)(t)):t===null||y(t)?(e.exit(`htmlFlowData`),M(t)):(e.consume(t),j)}function M(t){return e.check(Bi,ne,ce)(t)}function ne(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return t===null||y(t)?M(t):(e.enter(`htmlFlowData`),j(t))}function N(t){return t===45?(e.consume(t),oe):j(t)}function P(t){return t===47?(e.consume(t),o=``,ie):j(t)}function ie(t){if(t===62){let n=o.toLowerCase();return Li.includes(n)?(e.consume(t),se):j(t)}return f(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ie):j(t)}function ae(t){return t===93?(e.consume(t),oe):j(t)}function oe(t){return t===62?(e.consume(t),se):t===45&&i===2?(e.consume(t),oe):j(t)}function se(t){return t===null||y(t)?(e.exit(`htmlFlowData`),ce(t)):(e.consume(t),se)}function ce(n){return e.exit(`htmlFlow`),t(n)}}function Ui(e,t,n){let r=this;return i;function i(t){return y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Wi(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Kr,t,n)}}const Gi={name:`htmlText`,tokenize:Ki};function Ki(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),E):t===63?(e.consume(t),w):f(t)?(e.consume(t),k):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,g):f(t)?(e.consume(t),C):n(t)}function u(t){return t===45?(e.consume(t),h):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),m):y(t)?(o=d,P(t)):(e.consume(t),d)}function m(t){return t===45?(e.consume(t),h):d(t)}function h(e){return e===62?N(e):e===45?m(e):d(e)}function g(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?_:g):n(t)}function _(t){return t===null?n(t):t===93?(e.consume(t),v):y(t)?(o=_,P(t)):(e.consume(t),_)}function v(t){return t===93?(e.consume(t),S):_(t)}function S(t){return t===62?N(t):t===93?(e.consume(t),S):_(t)}function C(t){return t===null||t===62?N(t):y(t)?(o=C,P(t)):(e.consume(t),C)}function w(t){return t===null?n(t):t===63?(e.consume(t),T):y(t)?(o=w,P(t)):(e.consume(t),w)}function T(e){return e===62?N(e):w(e)}function E(t){return f(t)?(e.consume(t),D):n(t)}function D(t){return t===45||p(t)?(e.consume(t),D):O(t)}function O(t){return y(t)?(o=O,P(t)):x(t)?(e.consume(t),O):N(t)}function k(t){return t===45||p(t)?(e.consume(t),k):t===47||t===62||b(t)?A(t):n(t)}function A(t){return t===47?(e.consume(t),N):t===58||t===95||f(t)?(e.consume(t),ee):y(t)?(o=A,P(t)):x(t)?(e.consume(t),A):N(t)}function ee(t){return t===45||t===46||t===58||t===95||p(t)?(e.consume(t),ee):te(t)}function te(t){return t===61?(e.consume(t),j):y(t)?(o=te,P(t)):x(t)?(e.consume(t),te):A(t)}function j(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,M):y(t)?(o=j,P(t)):x(t)?(e.consume(t),j):(e.consume(t),ne)}function M(t){return t===i?(e.consume(t),i=void 0,re):t===null?n(t):y(t)?(o=M,P(t)):(e.consume(t),M)}function ne(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||b(t)?A(t):(e.consume(t),ne)}function re(e){return e===47||e===62||b(e)?A(e):n(e)}function N(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function P(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ie}function ie(t){return x(t)?H(e,ae,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ae(t)}function ae(t){return e.enter(`htmlTextData`),o(t)}}const qi={name:`labelEnd`,resolveAll:Zi,resolveTo:Qi,tokenize:$i},Ji={tokenize:ea},Yi={tokenize:ta},Xi={tokenize:na};function Zi(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&lr(e,0,e.length,n),e}function Qi(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=ur(s,e.slice(a+1,a+r+3)),s=ur(s,[[`enter`,u,t]]),s=ur(s,zr(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=ur(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=ur(s,e.slice(o+1)),s=ur(s,[[`exit`,c,t]]),lr(e,a,e.length,s),e}function $i(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Be(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Ji,u,o?u:d)(t):t===91?e.attempt(Yi,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Xi,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function ea(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return b(t)?Ei(e,a)(t):a(t)}function a(t){return t===41?u(t):Ci(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return b(t)?Ei(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Ti(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return b(t)?Ei(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function ta(e,t,n){let r=this;return i;function i(t){return wi.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Be(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function na(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}const ra={name:`labelStartImage`,resolveAll:qi.resolveAll,tokenize:ia};function ia(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const aa={name:`labelStartLink`,resolveAll:qi.resolveAll,tokenize:oa};function oa(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const sa={name:`lineEnding`,tokenize:ca};function ca(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),H(e,t,`linePrefix`)}}const la={name:`thematicBreak`,tokenize:ua};function ua(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||y(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),x(t)?H(e,s,`whitespace`)(t):s(t))}}const da={continuation:{tokenize:ha},exit:_a,name:`list`,tokenize:ma},fa={partial:!0,tokenize:va},pa={partial:!0,tokenize:ga};function ma(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:g(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(la,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return g(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Kr,r.interrupt?n:u,e.attempt(fa,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return x(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function ha(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Kr,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,H(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!x(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(pa,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,H(e,e.attempt(da,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function ga(e,t,n){let r=this;return H(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function _a(e){e.exit(this.containerState.type)}function va(e,t,n){let r=this;return H(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!x(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const ya={name:`setextUnderline`,resolveTo:ba,tokenize:xa};function ba(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function xa(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),x(t)?H(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||y(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}const Sa={tokenize:Aa,partial:!0};function Ca(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Da,continuation:{tokenize:Oa},exit:ka}},text:{91:{name:`gfmFootnoteCall`,tokenize:Ea},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:wa,resolveTo:Ta}}}}function wa(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Be(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Ta(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function Ea(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||b(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Be(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return b(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Da(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||b(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Be(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return b(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),H(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Oa(e,t,n){return e.check(Kr,t,e.attempt(Sa,t,n))}function ka(e){e.exit(`gfmFootnoteDefinition`)}function Aa(e,t,n){let r=this;return H(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function ja(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&lr(o,o.length,0,zr(s,e.slice(r+1,n),t)),lr(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),lr(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=At(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=At(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Ma=class{constructor(){this.map=[]}add(e,t,n){Na(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function Na(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Pa(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function Fa(){return{flow:{null:{name:`table`,tokenize:Ia,resolveAll:La}}}}function Ia(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?T:c;return a===T&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):y(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):x(t)?H(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||b(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,x(t)?H(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):w(t)}function h(t){return x(t)?H(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||y(t)?C(t):w(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):w(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),S):(e.exit(`tableDelimiterFiller`),S(t))}function S(t){return x(t)?H(e,C,`whitespace`)(t):C(t)}function C(n){return n===124?m(n):n===null||y(n)?!o||i!==a?w(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):w(n)}function w(e){return n(e)}function T(t){return e.enter(`tableRow`),E(t)}function E(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),E):n===null||y(n)?(e.exit(`tableRow`),t(n)):x(n)?H(e,E,`whitespace`)(n):(e.enter(`data`),D(n))}function D(t){return t===null||t===124||b(t)?(e.exit(`data`),E(t)):(e.consume(t),t===92?O:D)}function O(t){return t===92||t===124?(e.consume(t),D):D(t)}}function La(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Ma;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(za(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=Ra(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=Ra(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=Ra(f,t,o,i,n,d)):(o[0]=o[1],d=Ra(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&za(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Pa(t.events,n))}return e}function Ra(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Ba(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Ba(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=Ba(t.events,n[2]),a=Ba(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Ba(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function za(e,t,n,r,i){let a=[],o=Ba(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Ba(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}const Va={name:`tasklistCheck`,tokenize:Ua};function Ha(){return{text:{91:Va}}}function Ua(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return b(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return y(r)?t(r):x(r)?e.check({tokenize:Wa},t,n)(r):n(r)}}function Wa(e,t,n){return H(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Ga(e){return fr([wr(),Ca(),ja(e),Fa(),Ha()])}const Ka={};function qa(e){let t=this,n=e||Ka,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Ga(n)),a.push(sr()),o.push(cr(n))}function Ja(e){if(e)throw e}var Ya=e.lt(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Xa(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Za(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Qa(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Qa(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}function $a(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?to(e.position):`start`in e||`end`in e?to(e):`line`in e||`column`in e?eo(e):``}function eo(e){return no(e&&e.line)+`:`+no(e&&e.column)}function to(e){return eo(e&&e.start)+`-`+eo(e&&e.end)}function no(e){return e&&typeof e==`number`?e:1}var U=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=$a(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};U.prototype.file=``,U.prototype.name=``,U.prototype.reason=``,U.prototype.message=``,U.prototype.stack=``,U.prototype.column=void 0,U.prototype.line=void 0,U.prototype.ancestors=void 0,U.prototype.cause=void 0,U.prototype.fatal=void 0,U.prototype.place=void 0,U.prototype.ruleId=void 0,U.prototype.source=void 0;function ro(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}const io=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`];var ao=class{constructor(e){let n;n=e?ro(e)?{path:e}:typeof e==`string`||lo(e)?{value:e}:e:{},this.cwd=`cwd`in n?``:t.default.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<io.length;){let e=io[r];e in n&&n[e]!==void 0&&n[e]!==null&&(this[e]=e===`history`?[...n[e]]:n[e])}let i;for(i in n)io.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path==`string`?r.default.basename(this.path):void 0}set basename(e){so(e,`basename`),oo(e,`basename`),this.path=r.default.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?r.default.dirname(this.path):void 0}set dirname(e){co(this.basename,`dirname`),this.path=r.default.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?r.default.extname(this.path):void 0}set extname(e){if(oo(e,`extname`),co(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=r.default.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){ro(e)&&(e=(0,d.fileURLToPath)(e)),so(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?r.default.basename(this.path,this.extname):void 0}set stem(e){so(e,`stem`),oo(e,`stem`),this.path=r.default.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new U(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function oo(e,t){if(e&&e.includes(r.default.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+r.default.sep+"`")}function so(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function co(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function lo(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const uo=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r});var fo=e.dt(Ya(),1);const po={}.hasOwnProperty,mo=new class e extends uo{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Za()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,fo.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(_o(`data`,this.frozen),this.namespace[e]=t,this):po.call(this.namespace,e)&&this.namespace[e]||void 0:e?(_o(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=bo(e),n=this.parser||this.Parser;return ho(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),ho(`process`,this.parser||this.Parser),go(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=bo(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);So(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),ho(`processSync`,this.parser||this.Parser),go(`processSync`,this.compiler||this.Compiler),this.process(e,r),yo(`processSync`,`process`,t),n;function r(e,r){t=!0,Ja(e),n=r}}run(e,t,n){vo(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=bo(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),yo(`runSync`,`run`,n),r;function i(e,t){Ja(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=bo(t),r=this.compiler||this.Compiler;return go(`stringify`,r),vo(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(_o(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,fo.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Xa(o)&&Xa(r)&&(r=(0,fo.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function ho(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function go(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function _o(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function vo(e){if(!Xa(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function yo(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function bo(e){return xo(e)?e:new ao(e)}function xo(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function So(e){return typeof e==`string`||Co(e)}function Co(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}function wo(){return{enter:{mdxFlowExpression:Eo,mdxTextExpression:Do},exit:{mdxFlowExpression:Oo,mdxFlowExpressionChunk:ko,mdxTextExpression:Oo,mdxTextExpressionChunk:ko}}}function To(){return{handlers:{mdxFlowExpression:Ao,mdxTextExpression:Ao},unsafe:[{character:`{`,inConstruct:[`phrasing`]},{atBreak:!0,character:`{`}]}}function Eo(e){this.enter({type:`mdxFlowExpression`,value:``},e),this.buffer()}function Do(e){this.enter({type:`mdxTextExpression`,value:``},e),this.buffer()}function Oo(e){let t=this.resume(),n=e.estree,r=this.stack[this.stack.length-1];r.type===`mdxFlowExpression`||r.type,this.exit(e),r.value=t,n&&(r.data={estree:n})}function ko(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function Ao(e,t,n){let r=e.value||``;return`{`+n.indentLines(r,function(e,t,n){return(t===0||n?``:` `)+e})+`}`}const jo=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),Mo={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function No(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function Po(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function Fo(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function Io(e){return Fo(e)||No(e)}const Lo=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function Ro(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?Io:u===`decimal`?No:Po;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&jo.includes(y)&&(_=y,v=wn(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`?wn(y):!1;e&&(_=y,v=e)}let S=1+l-o,C=``;if(!(!x&&n.nonTerminated===!1))if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):Io(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(zo(e))h(7,S),C=`�`;else if(e in Mo)h(6,S),C=Mo[e];else{let t=``;Bo(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,Lo[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function zo(e){return e>=55296&&e<=57343||e>1114111}function Bo(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}const Vo=/["&'<>`]/g,Ho=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Uo=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Wo=/[|\\{}()[\]^$+*?.]/g,Go=new WeakMap;function Ko(e,t){if(e=e.replace(t.subset?qo(t.subset):Vo,r),t.subset||t.escapeOnly)return e;return e.replace(Ho,n).replace(Uo,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function qo(e){let t=Go.get(e);return t||(t=Jo(e),Go.set(e,t)),t}function Jo(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Wo,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}function Yo(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Xo(e,t){return Ko(e,Object.assign({format:Yo},t))}function Zo(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:d,mdxJsxFlowTagExpressionAttribute:f,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:d,mdxJsxTextTagExpressionAttribute:f,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:m,mdxJsxFlowTagAttributeNameLocal:h,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:_,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:y,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:m,mdxJsxTextTagAttributeNameLocal:h,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:_,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:y}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new U("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new U(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new U("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function d(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function p(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=Ro(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function v(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function y(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new U("Unexpected closing tag `"+S(t)+"`, expected corresponding closing tag for `"+S(r)+"` ("+$a(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,b),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function b(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new U("Expected a closing tag for `"+S(r)+"` ("+$a({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function x(e,t){let n=this.data.mdxJsxTag;throw new U("Expected the closing tag `"+S(n)+"` either after the end of `"+t.type+"` ("+$a(t.end)+") or another opening tag after the start of `"+t.type+"` ("+$a(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function Qo(e){let t=e||{},n=t.quote||`"`,r=t.quoteSmart||!1,i=t.tightSelfClosing||!1,a=t.printWidth||1/0,o=n===`"`?`'`:`"`;if(n!==`"`&&n!==`'`)throw Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return s.peek=ns,{handlers:{mdxJsxFlowElement:s,mdxJsxTextElement:s},unsafe:[{character:`<`,inConstruct:[`phrasing`]},{atBreak:!0,character:`<`}],fences:!0,resourceLink:!0};function s(e,t,s,c){let l=e.type===`mdxJsxFlowElement`,u=e.name?!e.children||e.children.length===0:!1,d=ts(es(s)),f=s.createTracker(c),p=s.createTracker(c),m=[],h=(l?d:``)+`<`+(e.name||``),g=s.enter(e.type);if(f.move(h),p.move(h),e.attributes&&e.attributes.length>0){if(!e.name)throw Error(`Cannot serialize fragment w/ attributes`);let t=-1;for(;++t<e.attributes.length;){let i=e.attributes[t],a;if(i.type===`mdxJsxExpressionAttribute`)a=`{`+(i.value||``)+`}`;else{if(!i.name)throw Error(`Cannot serialize attribute w/o name`);let e=i.value,t=i.name,s=``;if(e!=null)if(typeof e==`object`)s=`{`+(e.value||``)+`}`;else{let t=r&&fe(e,n)>fe(e,o)?o:n;s=t+Xo(e,{subset:[t]})+t}a=t+(s?`=`:``)+s}m.push(a)}}let _=!1,v=m.join(` `);l&&(/\r?\n|\r/.test(v)||f.current().now.column+v.length+(u?i?2:3:1)>a)&&(_=!0);let y=f,b=h;if(_){y=p;let e=-1;for(;++e<m.length;)m[e]=d+` `+m[e];b+=y.move(`
|
|
39
|
-
`+m.join(`
|
|
40
|
-
`)+`
|
|
41
|
-
`+d)}else v&&(b+=y.move(` `+v));return u&&(b+=y.move((i||_?``:` `)+`/`)),b+=y.move(`>`),e.children&&e.children.length>0&&(e.type===`mdxJsxTextElement`?b+=y.move(s.containerPhrasing(e,{...y.current(),before:`>`,after:`<`})):(y.shift(2),b+=y.move(`
|
|
42
|
-
`),b+=y.move($o(e,s,y.current())),b+=y.move(`
|
|
43
|
-
`))),u||(b+=y.move((l?d:``)+`</`+(e.name||``)+`>`)),g(),b}}function $o(e,t,n){let r=t.indexStack,i=e.children,a=t.createTracker(n),o=ts(es(t)),s=[],c=-1;for(r.push(-1);++c<i.length;){let n=i[c];r[r.length-1]=c;let l={before:`
|
|
44
|
-
`,after:`
|
|
45
|
-
`,...a.current()},u=t.handle(n,e,t,l),d=n.type===`mdxJsxFlowElement`?u:t.indentLines(u,function(e,t,n){return(n?``:o)+e});s.push(a.move(d)),n.type!==`list`&&(t.bulletLastUsed=void 0),c<i.length-1&&s.push(a.move(`
|
|
46
|
-
|
|
47
|
-
`))}return r.pop(),s.join(``)}function es(e){let t=0,n=e.stack.length;for(;--n>-1;){let r=e.stack[n];if(r===`blockquote`||r===`listItem`)break;r===`mdxJsxFlowElement`&&t++}return t}function ts(e){return` `.repeat(e)}function ns(){return`<`}function rs(){return{enter:{mdxjsEsm:as},exit:{mdxjsEsm:os,mdxjsEsmData:ss}}}function is(){return{handlers:{mdxjsEsm:cs}}}function as(e){this.enter({type:`mdxjsEsm`,value:``},e),this.buffer()}function os(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e);let r=e.estree;n.value=t,r&&(n.data={estree:r})}function ss(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function cs(e){return e.value||``}function ls(){return[wo(),Zo(),rs()]}function us(e){return{extensions:[To(),Qo(e),is()]}}var ds=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],fs=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],ps=`·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・`,ms=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,hs={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},gs=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,_s={5:gs,"5module":gs+` export import`,6:gs+` const class extends export import super`},vs=/^in(stanceof)?$/,ys=RegExp(`[`+ms+`]`),bs=RegExp(`[`+ms+ps+`]`);function xs(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function Ss(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&ys.test(String.fromCharCode(e)):t===!1?!1:xs(e,fs)}function Cs(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&bs.test(String.fromCharCode(e)):t===!1?!1:xs(e,fs)||xs(e,ds)}var W=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function ws(e,t){return new W(e,{beforeExpr:!0,binop:t})}var Ts={beforeExpr:!0},Es={startsExpr:!0},Ds={};function G(e,t){return t===void 0&&(t={}),t.keyword=e,Ds[e]=new W(e,t)}var K={num:new W(`num`,Es),regexp:new W(`regexp`,Es),string:new W(`string`,Es),name:new W(`name`,Es),privateId:new W(`privateId`,Es),eof:new W(`eof`),bracketL:new W(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new W(`]`),braceL:new W(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new W(`}`),parenL:new W(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new W(`)`),comma:new W(`,`,Ts),semi:new W(`;`,Ts),colon:new W(`:`,Ts),dot:new W(`.`),question:new W(`?`,Ts),questionDot:new W(`?.`),arrow:new W(`=>`,Ts),template:new W(`template`),invalidTemplate:new W(`invalidTemplate`),ellipsis:new W(`...`,Ts),backQuote:new W("`",Es),dollarBraceL:new W("${",{beforeExpr:!0,startsExpr:!0}),eq:new W(`=`,{beforeExpr:!0,isAssign:!0}),assign:new W(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new W(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new W(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:ws(`||`,1),logicalAND:ws(`&&`,2),bitwiseOR:ws(`|`,3),bitwiseXOR:ws(`^`,4),bitwiseAND:ws(`&`,5),equality:ws(`==/!=/===/!==`,6),relational:ws(`</>/<=/>=`,7),bitShift:ws(`<</>>/>>>`,8),plusMin:new W(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:ws(`%`,10),star:ws(`*`,10),slash:ws(`/`,10),starstar:new W(`**`,{beforeExpr:!0}),coalesce:ws(`??`,1),_break:G(`break`),_case:G(`case`,Ts),_catch:G(`catch`),_continue:G(`continue`),_debugger:G(`debugger`),_default:G(`default`,Ts),_do:G(`do`,{isLoop:!0,beforeExpr:!0}),_else:G(`else`,Ts),_finally:G(`finally`),_for:G(`for`,{isLoop:!0}),_function:G(`function`,Es),_if:G(`if`),_return:G(`return`,Ts),_switch:G(`switch`),_throw:G(`throw`,Ts),_try:G(`try`),_var:G(`var`),_const:G(`const`),_while:G(`while`,{isLoop:!0}),_with:G(`with`),_new:G(`new`,{beforeExpr:!0,startsExpr:!0}),_this:G(`this`,Es),_super:G(`super`,Es),_class:G(`class`,Es),_extends:G(`extends`,Ts),_export:G(`export`),_import:G(`import`,Es),_null:G(`null`,Es),_true:G(`true`,Es),_false:G(`false`,Es),_in:G(`in`,{beforeExpr:!0,binop:7}),_instanceof:G(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:G(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:G(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:G(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},Os=/\r\n?|\n|\u2028|\u2029/,ks=new RegExp(Os.source,`g`);function As(e){return e===10||e===13||e===8232||e===8233}function js(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(As(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var Ms=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Ns=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ps=Object.prototype,Fs=Ps.hasOwnProperty,Is=Ps.toString,Ls=Object.hasOwn||(function(e,t){return Fs.call(e,t)}),Rs=Array.isArray||(function(e){return Is.call(e)===`[object Array]`}),zs=Object.create(null);function Bs(e){return zs[e]||(zs[e]=RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`))}function Vs(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var Hs=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Us=function(e,t){this.line=e,this.column=t};Us.prototype.offset=function(e){return new Us(this.line,this.column+e)};var Ws=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function Gs(e,t){for(var n=1,r=0;;){var i=js(e,r,t);if(i<0)return new Us(n,t-r);++n,r=i}}var Ks={ecmaVersion:null,sourceType:`script`,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},qs=!1;function Js(e){var t={};for(var n in Ks)t[n]=e&&Ls(e,n)?e[n]:Ks[n];if(t.ecmaVersion===`latest`?t.ecmaVersion=1e8:t.ecmaVersion==null?(!qs&&typeof console==`object`&&console.warn&&(qs=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
48
|
-
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),Rs(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}if(Rs(t.onComment)&&(t.onComment=Ys(t,t.onComment)),t.sourceType===`commonjs`&&t.allowAwaitOutsideFunction)throw Error(`Cannot use allowAwaitOutsideFunction with sourceType: commonjs`);return t}function Ys(e,t){return function(n,r,i,a,o,s){var c={type:n?`Block`:`Line`,value:r,start:i,end:a};e.locations&&(c.loc=new Ws(this,o,s)),e.ranges&&(c.range=[i,a]),t.push(c)}}var Xs=1,Zs=2,Qs=4,$s=8,ec=16,tc=32,nc=64,rc=128,ic=256,ac=512,oc=1024,sc=Xs|Zs|ic;function cc(e,t){return Zs|(e?Qs:0)|(t?$s:0)}var lc=0,uc=1,dc=2,fc=3,pc=4,mc=5,hc=function(e,t,n){this.options=e=Js(e),this.sourceFile=e.sourceFile,this.keywords=Bs(_s[e.ecmaVersion>=6?6:e.sourceType===`module`?`5module`:5]);var r=``;e.allowReserved!==!0&&(r=hs[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType===`module`&&(r+=` await`)),this.reservedWords=Bs(r);var i=(r?r+` `:``)+hs.strict;this.reservedWordsStrict=Bs(i),this.reservedWordsStrictBind=Bs(i+` `+hs.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(`
|
|
49
|
-
`,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(Os).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=K.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType===`module`,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType===`commonjs`?Zs:Xs),this.regexpState=null,this.privateNameStack=[]},gc={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};hc.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},gc.inFunction.get=function(){return(this.currentVarScope().flags&Zs)>0},gc.inGenerator.get=function(){return(this.currentVarScope().flags&$s)>0},gc.inAsync.get=function(){return(this.currentVarScope().flags&Qs)>0},gc.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(ic|ac))return!1;if(t&Zs)return(t&Qs)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},gc.allowReturn.get=function(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&Xs)},gc.allowSuper.get=function(){return(this.currentThisScope().flags&nc)>0||this.options.allowSuperOutsideMethod},gc.allowDirectSuper.get=function(){return(this.currentThisScope().flags&rc)>0},gc.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},gc.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(ic|ac)||t&Zs&&!(t&ec))return!0}return!1},gc.allowUsing.get=function(){var e=this.currentScope().flags;return!(e&oc||!this.inModule&&e&Xs)},gc.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&ic)>0},hc.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},hc.parse=function(e,t){return new this(t,e).parse()},hc.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},hc.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(hc.prototype,gc);var _c=hc.prototype,vc=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;_c.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){Ns.lastIndex=e,e+=Ns.exec(this.input)[0].length;var t=vc.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){Ns.lastIndex=e+t[0].length;var n=Ns.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||Os.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`)}e+=t[0].length,Ns.lastIndex=e,e+=Ns.exec(this.input)[0].length,this.input[e]===`;`&&e++}},_c.eat=function(e){return this.type===e?(this.next(),!0):!1},_c.isContextual=function(e){return this.type===K.name&&this.value===e&&!this.containsEsc},_c.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},_c.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},_c.canInsertSemicolon=function(){return this.type===K.eof||this.type===K.braceR||Os.test(this.input.slice(this.lastTokEnd,this.start))},_c.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},_c.semicolon=function(){!this.eat(K.semi)&&!this.insertSemicolon()&&this.unexpected()},_c.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},_c.expect=function(e){this.eat(e)||this.unexpected()},_c.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};var yc=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};_c.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?`Assigning to rvalue`:`Parenthesized pattern`)}},_c.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},_c.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},_c.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var q=hc.prototype;q.parseTopLevel=function(e){var t=Object.create(null);for(e.body||=[];this.type!==K.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType===`commonjs`?`script`:this.options.sourceType,this.finishNode(e,`Program`)};var bc={kind:`loop`},xc={kind:`switch`};q.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;Ns.lastIndex=this.pos;var t=Ns.exec(this.input),n=this.pos+t[0].length,r=this.fullCharCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123)return!0;if(Ss(r)){var i=n;do n+=r<=65535?1:2;while(Cs(r=this.fullCharCodeAt(n)));if(r===92)return!0;var a=this.input.slice(i,n);if(!vs.test(a))return!0}return!1},q.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;Ns.lastIndex=this.pos;var e=Ns.exec(this.input),t=this.pos+e[0].length,n;return!Os.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!(Cs(n=this.fullCharCodeAt(t+8))||n===92))},q.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?`await`:`using`))return!1;Ns.lastIndex=this.pos;var n=Ns.exec(this.input),r=this.pos+n[0].length;if(Os.test(this.input.slice(this.pos,r)))return!1;if(e){var i=r+5,a;if(this.input.slice(r,i)!==`using`||i===this.input.length||Cs(a=this.fullCharCodeAt(i))||a===92)return!1;Ns.lastIndex=i;var o=Ns.exec(this.input);if(r=i+o[0].length,o&&Os.test(this.input.slice(i,r)))return!1}var s=this.fullCharCodeAt(r);if(!Ss(s)&&s!==92)return!1;var c=r;do r+=s<=65535?1:2;while(Cs(s=this.fullCharCodeAt(r)));if(s===92)return!0;var l=this.input.slice(c,r);return!(vs.test(l)||t&&l===`of`)},q.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},q.isUsing=function(e){return this.isUsingKeyword(!1,e)},q.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=K._var,a=`let`),r){case K._break:case K._continue:return this.parseBreakContinueStatement(i,r.keyword);case K._debugger:return this.parseDebuggerStatement(i);case K._do:return this.parseDoStatement(i);case K._for:return this.parseForStatement(i);case K._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case K._class:return e&&this.unexpected(),this.parseClass(i,!0);case K._if:return this.parseIfStatement(i);case K._return:return this.parseReturnStatement(i);case K._switch:return this.parseSwitchStatement(i);case K._throw:return this.parseThrowStatement(i);case K._try:return this.parseTryStatement(i);case K._const:case K._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case K._while:return this.parseWhileStatement(i);case K._with:return this.parseWithStatement(i);case K.braceL:return this.parseBlock(!0,i);case K.semi:return this.parseEmptyStatement(i);case K._export:case K._import:if(this.options.ecmaVersion>10&&r===K._import){Ns.lastIndex=this.pos;var o=Ns.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===K._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.isAwaitUsing(!1)?`await using`:this.isUsing(!1)?`using`:null;if(l)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),l===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.next(),this.parseVar(i,!1,l),this.semicolon(),this.finishNode(i,`VariableDeclaration`);var u=this.value,d=this.parseExpression();return r===K.name&&d.type===`Identifier`&&this.eat(K.colon)?this.parseLabeledStatement(i,u,d,e):this.parseExpressionStatement(i,d)}},q.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(K.semi)||this.insertSemicolon()?e.label=null:this.type===K.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},q.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},q.parseDoStatement=function(e){return this.next(),this.labels.push(bc),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(K._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(K.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},q.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(bc),this.enterScope(0),this.expect(K.parenL),this.type===K.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===K._var||this.type===K._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),this.parseForAfterInit(e,r,t)}var a=this.isContextual(`let`),o=!1,s=this.isUsing(!0)?`using`:this.isAwaitUsing(!0)?`await using`:null;if(s){var c=this.startNode();return this.next(),s===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.parseVar(c,!0,s),this.finishNode(c,`VariableDeclaration`),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,u=new yc,d=this.start,f=t>-1?this.parseExprSubscripts(u,`await`):this.parseExpression(!0,u);return this.type===K._in||(o=this.options.ecmaVersion>=6&&this.isContextual(`of`))?(t>-1?(this.type===K._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(f.start===d&&!l&&f.type===`Identifier`&&f.name===`async`?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),a&&o&&this.raise(f.start,`The left-hand side of a for-of loop may not start with 'let'.`),this.toAssignable(f,!1,u),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))},q.parseForAfterInit=function(e,t,n){return(this.type===K._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&t.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===K._in?n>-1&&this.unexpected(n):e.await=n>-1),this.parseForIn(e,t)):(n>-1&&this.unexpected(n),this.parseFor(e,t))},q.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,Cc|(n?0:wc),!1,t)},q.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(K._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},q.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,`'return' outside of function`),this.next(),this.eat(K.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},q.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(K.braceL),this.labels.push(xc),this.enterScope(oc);for(var t,n=!1;this.type!==K.braceR;)if(this.type===K._case||this.type===K._default){var r=this.type===K._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(K.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},q.parseThrowStatement=function(e){return this.next(),Os.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var Sc=[];q.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type===`Identifier`;return this.enterScope(t?tc:0),this.checkLValPattern(e,t?pc:dc),this.expect(K.parenR),e},q.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===K._catch){var t=this.startNode();this.next(),this.eat(K.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(K._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},q.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},q.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(bc),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},q.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},q.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},q.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===K._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},q.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},q.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(K.braceL),e&&this.enterScope(0);this.type!==K.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},q.parseFor=function(e,t){return e.init=t,this.expect(K.semi),e.test=this.type===K.semi?null:this.parseExpression(),this.expect(K.semi),e.update=this.type===K.parenR?null:this.parseExpression(),this.expect(K.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},q.parseForIn=function(e,t){var n=this.type===K._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(K.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},q.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(K.eq)?i.init=this.parseMaybeAssign(t):!r&&n===`const`&&!(this.type===K._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():!r&&(n===`using`||n===`await using`)&&this.options.ecmaVersion>=17&&this.type!==K._in&&!this.isContextual(`of`)?this.raise(this.lastTokEnd,`Missing initializer in `+n+` declaration`):!r&&i.id.type!==`Identifier`&&!(t&&(this.type===K._in||this.isContextual(`of`)))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):i.init=null,e.declarations.push(this.finishNode(i,`VariableDeclarator`)),!this.eat(K.comma))break}return e},q.parseVarId=function(e,t){e.id=t===`using`||t===`await using`?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t===`var`?uc:dc,!1)};var Cc=1,wc=2,Tc=4;q.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===K.star&&t&wc&&this.unexpected(),e.generator=this.eat(K.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&Cc&&(e.id=t&Tc&&this.type!==K.name?null:this.parseIdent(),e.id&&!(t&wc)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?uc:dc:fc));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(cc(e.async,e.generator)),t&Cc||(e.id=this.type===K.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&Cc?`FunctionDeclaration`:`FunctionExpression`)},q.parseFunctionParams=function(e){this.expect(K.parenL),e.params=this.parseBindingList(K.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},q.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(K.braceL);this.type!==K.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type===`MethodDefinition`&&o.kind===`constructor`?(a&&this.raiseRecoverable(o.start,`Duplicate constructor in the same class`),a=!0):o.key&&o.key.type===`PrivateIdentifier`&&Ec(r,o)&&this.raiseRecoverable(o.key.start,`Identifier '#`+o.key.name+`' has already been declared`))}return this.strict=n,this.next(),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},q.parseClassElement=function(e){if(this.eat(K.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r=``,i=!1,a=!1,o=`method`,s=!1;if(this.eatContextual(`static`)){if(t>=13&&this.eat(K.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===K.star?s=!0:r=`static`}if(n.static=s,!r&&t>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===K.star)&&!this.canInsertSemicolon()?a=!0:r=`async`),!r&&(t>=9||!a)&&this.eat(K.star)&&(i=!0),!r&&!a&&!i){var c=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?o=c:r=c)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,`Identifier`)):this.parseClassElementName(n),t<13||this.type===K.parenL||o!==`method`||i||a){var l=!n.static&&Dc(n,`constructor`),u=l&&e;l&&o!==`method`&&this.raise(n.key.start,`Constructor can't have get/set modifier`),n.kind=l?`constructor`:o,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n},q.isClassElementNameStart=function(){return this.type===K.name||this.type===K.privateId||this.type===K.num||this.type===K.string||this.type===K.bracketL||this.type.keyword},q.parseClassElementName=function(e){this.type===K.privateId?(this.value===`constructor`&&this.raise(this.start,`Classes can't have an element named '#constructor'`),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},q.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind===`constructor`?(t&&this.raise(i.start,`Constructor can't be a generator`),n&&this.raise(i.start,`Constructor can't be an async method`)):e.static&&Dc(e,`prototype`)&&this.raise(i.start,`Classes may not have a static property named prototype`);var a=e.value=this.parseMethod(t,n,r);return e.kind===`get`&&a.params.length!==0&&this.raiseRecoverable(a.start,`getter should have no params`),e.kind===`set`&&a.params.length!==1&&this.raiseRecoverable(a.start,`setter should have exactly one param`),e.kind===`set`&&a.params[0].type===`RestElement`&&this.raiseRecoverable(a.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)},q.parseClassField=function(e){return Dc(e,`constructor`)?this.raise(e.key.start,`Classes can't have a field named 'constructor'`):e.static&&Dc(e,`prototype`)&&this.raise(e.key.start,`Classes can't have a static field named 'prototype'`),this.eat(K.eq)?(this.enterScope(ac|nc),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,`PropertyDefinition`)},q.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(ic|nc);this.type!==K.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,`StaticBlock`)},q.parseClassId=function(e,t){this.type===K.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,dc,!1)):(t===!0&&this.unexpected(),e.id=null)},q.parseClassSuper=function(e){e.superClass=this.eat(K._extends)?this.parseExprSubscripts(null,!1):null},q.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},q.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var o=n[a];Ls(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,`Private field '#`+o.name+`' must be declared in an enclosing class`))}};function Ec(e,t){var n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function Dc(e,t){var n=e.computed,r=e.key;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}q.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==K.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`)},q.parseExport=function(e,t){if(this.next(),this.eat(K.star))return this.parseExportAllDeclaration(e,t);if(this.eat(K._default))return this.checkExport(t,`default`,this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,`ExportDefaultDeclaration`);if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==K.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var i=r[n];this.checkUnreserved(i.local),this.checkLocalExport(i.local),i.local.type===`Literal`&&this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},q.parseExportDeclaration=function(e){return this.parseStatement(null)},q.parseExportDefaultDeclaration=function(){var e;if(this.type===K._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,Cc|Tc,!1,e)}else if(this.type===K._class){var n=this.startNode();return this.parseClass(n,`nullableID`)}else{var r=this.parseMaybeAssign();return this.semicolon(),r}},q.checkExport=function(e,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),Ls(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},q.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`&&this.checkPatternExport(e,t.argument)},q.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},q.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},q.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual(`as`)?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,`ExportSpecifier`)},q.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(K.braceL);!this.eat(K.braceR);){if(n)n=!1;else if(this.expect(K.comma),this.afterTrailingComma(K.braceR))break;t.push(this.parseExportSpecifier(e))}return t},q.parseImport=function(e){return this.next(),this.type===K.string?(e.specifiers=Sc,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===K.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},q.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual(`as`)?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,dc),this.finishNode(e,`ImportSpecifier`)},q.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,dc),this.finishNode(e,`ImportDefaultSpecifier`)},q.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual(`as`),e.local=this.parseIdent(),this.checkLValSimple(e.local,dc),this.finishNode(e,`ImportNamespaceSpecifier`)},q.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===K.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(K.comma)))return e;if(this.type===K.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(K.braceL);!this.eat(K.braceR);){if(t)t=!1;else if(this.expect(K.comma),this.afterTrailingComma(K.braceR))break;e.push(this.parseImportSpecifier())}return e},q.parseWithClause=function(){var e=[];if(!this.eat(K._with))return e;this.expect(K.braceL);for(var t={},n=!0;!this.eat(K.braceR);){if(n)n=!1;else if(this.expect(K.comma),this.afterTrailingComma(K.braceR))break;var r=this.parseImportAttribute(),i=r.key.type===`Identifier`?r.key.name:r.key.value;Ls(t,i)&&this.raiseRecoverable(r.key.start,`Duplicate attribute key '`+i+`'`),t[i]=!0,e.push(r)}return e},q.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===K.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`),this.expect(K.colon),this.type!==K.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,`ImportAttribute`)},q.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===K.string){var e=this.parseLiteral(this.value);return Hs.test(e.value)&&this.raise(e.start,`An export name cannot include a lone surrogate.`),e}return this.parseIdent(!0)},q.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},q.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var Oc=hc.prototype;Oc.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},Oc.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},Oc.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},Oc.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==K.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},Oc.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case K.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(K.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case K.braceL:return this.parseObj(!0)}return this.parseIdent()},Oc.parseBindingList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);)if(a?a=!1:this.expect(K.comma),t&&this.type===K.comma)i.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===K.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),i.push(o),this.type===K.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else i.push(this.parseAssignableListItem(r));return i},Oc.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},Oc.parseBindingListItem=function(e){return e},Oc.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(K.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},Oc.checkLValSimple=function(e,t,n){t===void 0&&(t=lc);var r=t!==lc;switch(e.type){case`Identifier`:this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?`Binding `:`Assigning to `)+e.name+` in strict mode`),r&&(t===dc&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),n&&(Ls(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==mc&&this.declareName(e.name,t,e.start));break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:r&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ParenthesizedExpression`:return r&&this.raiseRecoverable(e.start,`Binding parenthesized expression`),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?`Binding`:`Assigning to`)+` rvalue`)}},Oc.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=lc),e.type){case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}},Oc.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=lc),e.type){case`Property`:this.checkLValInnerPattern(e.value,t,n);break;case`AssignmentPattern`:this.checkLValPattern(e.left,t,n);break;case`RestElement`:this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var kc=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},J={b_stat:new kc(`{`,!1),b_expr:new kc(`{`,!0),b_tmpl:new kc("${",!1),p_stat:new kc(`(`,!1),p_expr:new kc(`(`,!0),q_tmpl:new kc("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new kc(`function`,!1),f_expr:new kc(`function`,!0),f_expr_gen:new kc(`function`,!0,!1,null,!0),f_gen:new kc(`function`,!1,!1,null,!0)},Ac=hc.prototype;Ac.initialContext=function(){return[J.b_stat]},Ac.curContext=function(){return this.context[this.context.length-1]},Ac.braceIsBlock=function(e){var t=this.curContext();return t===J.f_expr||t===J.f_stat?!0:e===K.colon&&(t===J.b_stat||t===J.b_expr)?!t.isExpr:e===K._return||e===K.name&&this.exprAllowed?Os.test(this.input.slice(this.lastTokEnd,this.start)):e===K._else||e===K.semi||e===K.eof||e===K.parenR||e===K.arrow?!0:e===K.braceL?t===J.b_stat:e===K._var||e===K._const||e===K.name?!1:!this.exprAllowed},Ac.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},Ac.updateContext=function(e){var t,n=this.type;n.keyword&&e===K.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},Ac.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},K.parenR.updateContext=K.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===J.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr},K.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?J.b_stat:J.b_expr),this.exprAllowed=!0},K.dollarBraceL.updateContext=function(){this.context.push(J.b_tmpl),this.exprAllowed=!0},K.parenL.updateContext=function(e){var t=e===K._if||e===K._for||e===K._with||e===K._while;this.context.push(t?J.p_stat:J.p_expr),this.exprAllowed=!0},K.incDec.updateContext=function(){},K._function.updateContext=K._class.updateContext=function(e){e.beforeExpr&&e!==K._else&&!(e===K.semi&&this.curContext()!==J.p_stat)&&!(e===K._return&&Os.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===K.colon||e===K.braceL)&&this.curContext()===J.b_stat)?this.context.push(J.f_expr):this.context.push(J.f_stat),this.exprAllowed=!1},K.colon.updateContext=function(){this.curContext().token===`function`&&this.context.pop(),this.exprAllowed=!0},K.backQuote.updateContext=function(){this.curContext()===J.q_tmpl?this.context.pop():this.context.push(J.q_tmpl),this.exprAllowed=!1},K.star.updateContext=function(e){if(e===K._function){var t=this.context.length-1;this.context[t]===J.f_expr?this.context[t]=J.f_expr_gen:this.context[t]=J.f_gen}this.exprAllowed=!0},K.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==K.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var Y=hc.prototype;Y.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6){i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);return}i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}},Y.parseExpression=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeAssign(e,t);if(this.type===K.comma){var a=this.startNodeAt(n,r);for(a.expressions=[i];this.eat(K.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,`SequenceExpression`)}return i},Y.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1,o=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new yc,r=!0);var s=this.start,c=this.startLoc;(this.type===K.parenL||this.type===K.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,s,c)),this.type.isAssign){var u=this.startNodeAt(s,c);return u.operator=this.value,this.type===K.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===K.eq?this.checkLValPattern(l):this.checkLValSimple(l),u.left=l,this.next(),u.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(u,`AssignmentExpression`)}else r&&this.checkExpressionErrors(t,!0);return i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l},Y.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(K.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(K.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},Y.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},Y.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==K._in)&&a>r){var o=this.type===K.logicalOR||this.type===K.logicalAND,s=this.type===K.coalesce;s&&(a=K.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===K.coalesce||s&&(this.type===K.logicalOR||this.type===K.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},Y.buildBinary=function(e,t,n,r,i,a){r.type===`PrivateIdentifier`&&this.raise(r.start,`Private identifier can only be left side of binary expression`);var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},Y.parseMaybeUnary=function(e,t,n,r){var i=this.start,a=this.startLoc,o;if(this.isContextual(`await`)&&this.canAwait)o=this.parseAwait(r),t=!0;else if(this.type.prefix){var s=this.startNode(),c=this.type===K.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(s.argument):this.strict&&s.operator===`delete`&&jc(s.argument)?this.raiseRecoverable(s.start,`Deleting local variable in strict mode`):s.operator===`delete`&&Mc(s.argument)?this.raiseRecoverable(s.start,`Private fields can not be deleted`):t=!0,o=this.finishNode(s,c?`UpdateExpression`:`UnaryExpression`)}else if(!t&&this.type===K.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==K._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(i,a);l.operator=this.value,l.prefix=!1,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,`UpdateExpression`)}}if(!n&&this.eat(K.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,o,this.parseMaybeUnary(null,!1,!1,r),`**`,!1);else return o};function jc(e){return e.type===`Identifier`||e.type===`ParenthesizedExpression`&&jc(e.expression)}function Mc(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`||e.type===`ChainExpression`&&Mc(e.expression)||e.type===`ParenthesizedExpression`&&Mc(e.expression)}Y.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprAtom(e,t);if(i.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return i;var a=this.parseSubscripts(i,n,r,!1,t);return e&&a.type===`MemberExpression`&&(e.parenthesizedAssign>=a.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=a.start&&(e.parenthesizedBind=-1),e.trailingComma>=a.start&&(e.trailingComma=-1)),a},Y.parseSubscripts=function(e,t,n,r,i){for(var a=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var s=this.parseSubscript(e,t,n,r,a,o,i);if(s.optional&&(o=!0),s===e||s.type===`ArrowFunctionExpression`){if(o){var c=this.startNodeAt(t,n);c.expression=s,s=this.finishNode(c,`ChainExpression`)}return s}e=s}},Y.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(K.arrow)},Y.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)},Y.parseSubscript=function(e,t,n,r,i,a,o){var s=this.options.ecmaVersion>=11,c=s&&this.eat(K.questionDot);r&&c&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var l=this.eat(K.bracketL);if(l||c&&this.type!==K.parenL&&this.type!==K.backQuote||this.eat(K.dot)){var u=this.startNodeAt(t,n);u.object=e,l?(u.property=this.parseExpression(),this.expect(K.bracketR)):this.type===K.privateId&&e.type!==`Super`?u.property=this.parsePrivateIdent():u.property=this.parseIdent(this.options.allowReserved!==`never`),u.computed=!!l,s&&(u.optional=c),e=this.finishNode(u,`MemberExpression`)}else if(!r&&this.eat(K.parenL)){var d=new yc,f=this.yieldPos,p=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var h=this.parseExprList(K.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,n,h,o);this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var g=this.startNodeAt(t,n);g.callee=e,g.arguments=h,s&&(g.optional=c),e=this.finishNode(g,`CallExpression`)}else if(this.type===K.backQuote){(c||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var _=this.startNodeAt(t,n);_.tag=e,_.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(_,`TaggedTemplateExpression`)}return e},Y.parseExprAtom=function(e,t,n){this.type===K.slash&&this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case K._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),r=this.startNode(),this.next(),this.type===K.parenL&&!this.allowDirectSuper&&this.raise(r.start,`super() call outside constructor of a subclass`),this.type!==K.dot&&this.type!==K.bracketL&&this.type!==K.parenL&&this.unexpected(),this.finishNode(r,`Super`);case K._this:return r=this.startNode(),this.next(),this.finishNode(r,`ThisExpression`);case K.name:var a=this.start,o=this.startLoc,s=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&c.name===`async`&&!this.canInsertSemicolon()&&this.eat(K._function))return this.overrideContext(J.f_expr),this.parseFunction(this.startNodeAt(a,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(K.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[c],!1,t);if(this.options.ecmaVersion>=8&&c.name===`async`&&this.type===K.name&&!s&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return c=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(K.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[c],!0,t)}return c;case K.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case K.num:case K.string:return this.parseLiteral(this.value);case K._null:case K._true:case K._false:return r=this.startNode(),r.value=this.type===K._null?null:this.type===K._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,`Literal`);case K.parenL:var u=this.start,d=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(d)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),d;case K.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(K.bracketR,!0,!0,e),this.finishNode(r,`ArrayExpression`);case K.braceL:return this.overrideContext(J.b_expr),this.parseObj(!1,e);case K._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case K._class:return this.parseClass(this.startNode(),!1);case K._new:return this.parseNew();case K.backQuote:return this.parseTemplate();case K._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},Y.parseExprAtomDefault=function(){this.unexpected()},Y.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`),this.next(),this.type===K.parenL&&!e)return this.parseDynamicImport(t);if(this.type===K.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name=`import`,t.meta=this.finishNode(n,`Identifier`),this.parseImportMeta(t)}else this.unexpected()},Y.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(K.parenR)?e.options=null:(this.expect(K.comma),this.afterTrailingComma(K.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(K.parenR)||(this.expect(K.comma),this.afterTrailingComma(K.parenR)||this.unexpected())));else if(!this.eat(K.parenR)){var t=this.start;this.eat(K.comma)&&this.eat(K.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},Y.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},Y.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value==null?t.raw.slice(0,-1).replace(/_/g,``):t.value.toString()),this.next(),this.finishNode(t,`Literal`)},Y.parseParenExpression=function(){this.expect(K.parenL);var e=this.parseExpression();return this.expect(K.parenR),e},Y.shouldParseArrow=function(e){return!this.canInsertSemicolon()},Y.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,s=this.startLoc,c=[],l=!0,u=!1,d=new yc,f=this.yieldPos,p=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==K.parenR;)if(l?l=!1:this.expect(K.comma),a&&this.afterTrailingComma(K.parenR,!0)){u=!0;break}else if(this.type===K.ellipsis){m=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===K.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`);break}else c.push(this.parseMaybeAssign(!1,d,this.parseParenItem));var h=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(K.parenR),e&&this.shouldParseArrow(c)&&this.eat(K.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=p,this.parseParenArrowList(n,r,c,t);(!c.length||u)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,c.length>1?(i=this.startNodeAt(o,s),i.expressions=c,this.finishNodeAt(i,`SequenceExpression`,h,g)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var _=this.startNodeAt(n,r);return _.expression=i,this.finishNode(_,`ParenthesizedExpression`)}else return i},Y.parseParenItem=function(e){return e},Y.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var Nc=[];Y.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===K.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name=`new`,e.meta=this.finishNode(t,`Identifier`),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),this.eat(K.parenL)?e.arguments=this.parseExprList(K.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Nc,this.finishNode(e,`NewExpression`)},Y.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===K.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value.replace(/\r\n?/g,`
|
|
50
|
-
`),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
51
|
-
`),cooked:this.value},this.next(),n.tail=this.type===K.backQuote,this.finishNode(n,`TemplateElement`)},Y.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===K.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(K.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(K.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,`TemplateLiteral`)},Y.isAsyncProp=function(e){return!e.computed&&e.key.type===`Identifier`&&e.key.name===`async`&&(this.type===K.name||this.type===K.num||this.type===K.string||this.type===K.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===K.star)&&!Os.test(this.input.slice(this.lastTokEnd,this.start))},Y.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(K.braceR);){if(r)r=!1;else if(this.expect(K.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(K.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),n.properties.push(a)}return this.finishNode(n,e?`ObjectPattern`:`ObjectExpression`)},Y.parseProperty=function(e,t){var n=this.startNode(),r,i,a,o;if(this.options.ecmaVersion>=9&&this.eat(K.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===K.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.finishNode(n,`RestElement`)):(n.argument=this.parseMaybeAssign(!1,t),this.type===K.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,`SpreadElement`));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(K.star)));var s=this.containsEsc;return this.parsePropertyName(n),!e&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(K.star),this.parsePropertyName(n)):i=!1,this.parsePropertyValue(n,e,r,i,a,o,t,s),this.finishNode(n,`Property`)},Y.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n=e.kind===`get`?0:1;if(e.value.params.length!==n){var r=e.value.start;e.kind===`get`?this.raiseRecoverable(r,`getter should have no params`):this.raiseRecoverable(r,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)},Y.parsePropertyValue=function(e,t,n,r,i,a,o,s){(n||r)&&this.type===K.colon&&this.unexpected(),this.eat(K.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind=`init`):this.options.ecmaVersion>=6&&this.type===K.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(n,r),e.kind=`init`):!t&&!s&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.type!==K.comma&&this.type!==K.braceR&&this.type!==K.eq?((n||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type===`Identifier`?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=i),t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===K.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind=`init`,e.shorthand=!0):this.unexpected()},Y.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(K.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(K.bracketR),e.key;e.computed=!1}return e.key=this.type===K.num||this.type===K.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`)},Y.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Y.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(cc(t,r.generator)|nc|(n?rc:0)),this.expect(K.parenL),r.params=this.parseBindingList(K.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,`FunctionExpression`)},Y.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(cc(n,!1)|ec),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,`ArrowFunctionExpression`)},Y.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==K.braceL,a=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||s)&&(o=this.strictDirective(this.end),o&&s&&this.raiseRecoverable(e.start,`Illegal 'use strict' directive in function with non-simple parameter list`));var c=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!a&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,mc),e.body=this.parseBlock(!1,void 0,o&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()},Y.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].type!==`Identifier`)return!1;return!0},Y.checkParams=function(e,t){for(var n=Object.create(null),r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,uc,t?null:n)}},Y.parseExprList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(K.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===K.comma?o=null:this.type===K.ellipsis?(o=this.parseSpread(r),r&&this.type===K.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},Y.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;this.inGenerator&&r===`yield`&&this.raiseRecoverable(t,`Cannot use 'yield' as identifier inside a generator`),this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use 'await' as identifier inside an async function`),!(this.currentThisScope().flags&sc)&&r===`arguments`&&this.raiseRecoverable(t,`Cannot use 'arguments' in class field initializer`),this.inClassStaticBlock&&(r===`arguments`||r===`await`)&&this.raise(t,`Cannot use `+r+` in class static initialization block`),this.keywords.test(r)&&this.raise(t,`Unexpected keyword '`+r+`'`),!(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf(`\\`)!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(!this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use keyword 'await' outside an async function`),this.raiseRecoverable(t,`The keyword '`+r+`' is reserved`))},Y.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,`Identifier`),e||(this.checkUnreserved(t),t.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},Y.parseIdentNode=function(){var e=this.startNode();return this.type===K.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name===`class`||e.name===`function`)&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=K.name):this.unexpected(),e},Y.parsePrivateIdent=function(){var e=this.startNode();return this.type===K.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,`PrivateIdentifier`),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,`Private field '#`+e.name+`' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},Y.parseYield=function(e){this.yieldPos||=this.start;var t=this.startNode();return this.next(),this.type===K.semi||this.canInsertSemicolon()||this.type!==K.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(K.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,`YieldExpression`)},Y.parseAwait=function(e){this.awaitPos||=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,`AwaitExpression`)};var Pc=hc.prototype;Pc.raise=function(e,t){var n=Gs(this.input,e);t+=` (`+n.line+`:`+n.column+`)`,this.sourceFile&&(t+=` in `+this.sourceFile);var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},Pc.raiseRecoverable=Pc.raise,Pc.curPosition=function(){if(this.options.locations)return new Us(this.curLine,this.pos-this.lineStart)};var Fc=hc.prototype,Ic=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};Fc.enterScope=function(e){this.scopeStack.push(new Ic(e))},Fc.exitScope=function(){this.scopeStack.pop()},Fc.treatFunctionsAsVarInScope=function(e){return e.flags&Zs||!this.inModule&&e.flags&Xs},Fc.declareName=function(e,t,n){var r=!1;if(t===dc){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&Xs&&delete this.undefinedExports[e]}else if(t===pc)this.currentScope().lexical.push(e);else if(t===fc){var a=this.currentScope();r=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(s.flags&tc&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){r=!0;break}if(s.var.push(e),this.inModule&&s.flags&Xs&&delete this.undefinedExports[e],s.flags&sc)break}r&&this.raiseRecoverable(n,`Identifier '`+e+`' has already been declared`)},Fc.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},Fc.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},Fc.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(sc|ac|ic))return t}},Fc.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(sc|ac|ic)&&!(t.flags&ec))return t}};var Lc=function(e,t,n){this.type=``,this.start=t,this.end=0,e.options.locations&&(this.loc=new Ws(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},Rc=hc.prototype;Rc.startNode=function(){return new Lc(this,this.start,this.startLoc)},Rc.startNodeAt=function(e,t){return new Lc(this,e,t)};function zc(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}Rc.finishNode=function(e,t){return zc.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Rc.finishNodeAt=function(e,t,n,r){return zc.call(this,e,t,n,r)},Rc.copyNode=function(e){var t=new Lc(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var Bc=`Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz`,Vc=`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 Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation 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`,Hc=Vc+` Extended_Pictographic`,Uc=Hc,Wc=Uc+` EBase EComp EMod EPres ExtPict`,Gc=Wc,Kc=Gc,qc={9:Vc,10:Hc,11:Uc,12:Wc,13:Gc,14:Kc},Jc=`Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji`,Yc={9:``,10:``,11:``,12:``,13:``,14:Jc},Xc=`Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu`,Zc=`Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb`,Qc=Zc+` Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd`,$c=Qc+` Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho`,el=$c+` Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi`,tl=el+` Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith`,nl=tl+` `+Bc,rl={9:Zc,10:Qc,11:$c,12:el,13:tl,14:nl},il={};function al(e){var t=il[e]={binary:Bs(qc[e]+` `+Xc),binaryOfStrings:Bs(Yc[e]),nonBinary:{General_Category:Bs(Xc),Script:Bs(rl[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var ol=0,sl=[9,10,11,12,13,14];ol<sl.length;ol+=1){var cl=sl[ol];al(cl)}var X=hc.prototype,ll=function(e,t){this.parent=e,this.base=t||this};ll.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var n=e;n;n=n.parent)if(t.base===n.base&&t!==n)return!0;return!1},ll.prototype.sibling=function(){return new ll(this.parent,this.base)};var ul=function(e){this.parser=e,this.validFlags=`gim`+(e.options.ecmaVersion>=6?`uy`:``)+(e.options.ecmaVersion>=9?`s`:``)+(e.options.ecmaVersion>=13?`d`:``)+(e.options.ecmaVersion>=15?`v`:``),this.unicodeProperties=il[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source=``,this.flags=``,this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue=``,this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};ul.prototype.reset=function(e,t,n){var r=n.indexOf(`v`)!==-1,i=n.indexOf(`u`)!==-1;this.start=e|0,this.source=t+``,this.flags=n,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)},ul.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /`+this.source+`/: `+e)},ul.prototype.at=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!(t||this.switchU)||i<=55295||i>=57344||e+1>=r)return i;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},ul.prototype.nextIndex=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i=n.charCodeAt(e),a;return!(t||this.switchU)||i<=55295||i>=57344||e+1>=r||(a=n.charCodeAt(e+1))<56320||a>57343?e+1:e+2},ul.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},ul.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},ul.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},ul.prototype.eat=function(e,t){return t===void 0&&(t=!1),this.current(t)===e?(this.advance(t),!0):!1},ul.prototype.eatChars=function(e,t){t===void 0&&(t=!1);for(var n=this.pos,r=0,i=e;r<i.length;r+=1){var a=i[r],o=this.at(n,t);if(o===-1||o!==a)return!1;n=this.nextIndex(n,t)}return this.pos=n,!0},X.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=!1,i=!1,a=0;a<n.length;a++){var o=n.charAt(a);t.indexOf(o)===-1&&this.raise(e.start,`Invalid regular expression flag`),n.indexOf(o,a+1)>-1&&this.raise(e.start,`Duplicate regular expression flag`),o===`u`&&(r=!0),o===`v`&&(i=!0)}this.options.ecmaVersion>=15&&r&&i&&this.raise(e.start,`Invalid regular expression flag`)};function dl(e){for(var t in e)return!0;return!1}X.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&dl(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},X.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue=``,e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise(`Unmatched ')'`),(e.eat(93)||e.eat(125))&&e.raise(`Lone quantifier brackets`)),e.maxBackReference>e.numCapturingParens&&e.raise(`Invalid escape`);for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames[r]||e.raise(`Invalid named capture referenced`)}},X.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new ll(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise(`Nothing to repeat`),e.eat(123)&&e.raise(`Lone quantifier brackets`)},X.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},X.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise(`Invalid quantifier`),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},X.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise(`Unterminated group`),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},X.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},X.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},X.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<r&&!t&&e.raise(`numbers out of order in {} quantifier`),!0;e.switchU&&!t&&e.raise(`Incomplete quantifier`),e.pos=n}return!1},X.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},X.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},X.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),r=e.eat(45);if(n||r){for(var i=0;i<n.length;i++){var a=n.charAt(i);n.indexOf(a,i+1)>-1&&e.raise(`Duplicate regular expression modifiers`)}if(r){var o=this.regexp_eatModifiers(e);!n&&!o&&e.current()===58&&e.raise(`Invalid regular expression modifiers`);for(var s=0;s<o.length;s++){var c=o.charAt(s);(o.indexOf(c,s+1)>-1||n.indexOf(c)>-1)&&e.raise(`Duplicate regular expression modifiers`)}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise(`Unterminated group`)}}e.pos=t}return!1},X.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise(`Invalid group`),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise(`Unterminated group`)}return!1},X.regexp_eatModifiers=function(e){for(var t=``,n=0;(n=e.current())!==-1&&fl(n);)t+=Vs(n),e.advance();return t};function fl(e){return e===105||e===109||e===115}X.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},X.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise(`Nothing to repeat`),!1},X.regexp_eatSyntaxCharacter=function(e){var t=e.current();return pl(t)?(e.lastIntValue=t,e.advance(),!0):!1};function pl(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}X.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!pl(n);)e.advance();return e.pos!==t},X.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1},X.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise(`Invalid group`);var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n)if(t)for(var r=0,i=n;r<i.length;r+=1)i[r].separatedFrom(e.branchID)||e.raise(`Duplicate capture group name`);else e.raise(`Duplicate capture group name`);t?(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},X.regexp_eatGroupName=function(e){if(e.lastStringValue=``,e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise(`Invalid capture group name`)}return!1},X.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue=``,this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Vs(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Vs(e.lastIntValue);return!0}return!1},X.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),ml(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function ml(e){return Ss(e,!0)||e===36||e===95}X.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),hl(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function hl(e){return Cs(e,!0)||e===36||e===95||e===8204||e===8205}X.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise(`Invalid unicode escape`),e.raise(`Invalid escape`)),!1)},X.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},X.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise(`Invalid named reference`)}return!1},X.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},X.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},X.regexp_eatZero=function(e){return e.current()===48&&!Dl(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1},X.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1},X.regexp_eatControlLetter=function(e){var t=e.current();return gl(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function gl(e){return e>=65&&e<=90||e>=97&&e<=122}X.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&_l(e.lastIntValue))return!0;r&&e.raise(`Invalid unicode escape`),e.pos=n}return!1};function _l(e){return e>=0&&e<=1114111}X.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1},X.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var vl=0,yl=1,bl=2;X.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(xl(t))return e.lastIntValue=-1,e.advance(),yl;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&r===bl&&e.raise(`Invalid property name`),r;e.raise(`Invalid property name`)}return vl};function xl(e){return e===100||e===68||e===115||e===83||e===119||e===87}X.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),yl}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return vl},X.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){Ls(e.unicodeProperties.nonBinary,t)||e.raise(`Invalid property name`),e.unicodeProperties.nonBinary[t].test(n)||e.raise(`Invalid property value`)},X.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return yl;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return bl;e.raise(`Invalid property name`)},X.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue=``;Sl(t=e.current());)e.lastStringValue+=Vs(t),e.advance();return e.lastStringValue!==``};function Sl(e){return gl(e)||e===95}X.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue=``;Cl(t=e.current());)e.lastStringValue+=Vs(t),e.advance();return e.lastStringValue!==``};function Cl(e){return Sl(e)||Dl(e)}X.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},X.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise(`Unterminated character class`),t&&n===bl&&e.raise(`Negated character class may contain strings`),!0}return!1},X.regexp_classContents=function(e){return e.current()===93?yl:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),yl)},X.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise(`Invalid character class`),t!==-1&&n!==-1&&t>n&&e.raise(`Range out of order in character class`)}}},X.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||Al(n))&&e.raise(`Invalid class escape`),e.raise(`Invalid escape`)}e.pos=t}var r=e.current();return r===93?!1:(e.lastIntValue=r,e.advance(),!0)},X.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},X.regexp_classSetExpression=function(e){var t=yl,n;if(!this.regexp_eatClassSetRange(e))if(n=this.regexp_eatClassSetOperand(e)){n===bl&&(t=bl);for(var r=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))){n!==bl&&(t=yl);continue}e.raise(`Invalid character in character class`)}if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise(`Invalid character in character class`);if(r!==e.pos)return t}else e.raise(`Invalid character in character class`);for(;;)if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e),!n)return t;n===bl&&(t=bl)}},X.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return n!==-1&&r!==-1&&n>r&&e.raise(`Range out of order in character class`),!0}e.pos=t}return!1},X.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?yl:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},X.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return n&&r===bl&&e.raise(`Negated character class may contain strings`),r;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null},X.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise(`Invalid escape`);e.pos=t}return null},X.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===bl&&(t=bl);return t},X.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?yl:bl},X.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var n=e.current();return n<0||n===e.lookahead()&&wl(n)||Tl(n)?!1:(e.advance(),e.lastIntValue=n,!0)};function wl(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Tl(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}X.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return El(t)?(e.lastIntValue=t,e.advance(),!0):!1};function El(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}X.regexp_eatClassControlLetter=function(e){var t=e.current();return Dl(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},X.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise(`Invalid escape`),e.pos=t}return!1},X.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Dl(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function Dl(e){return e>=48&&e<=57}X.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Ol(n=e.current());)e.lastIntValue=16*e.lastIntValue+kl(n),e.advance();return e.pos!==t};function Ol(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function kl(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}X.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+n*8+e.lastIntValue:e.lastIntValue=t*8+n}else e.lastIntValue=t;return!0}return!1},X.regexp_eatOctalDigit=function(e){var t=e.current();return Al(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Al(e){return e>=48&&e<=55}X.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!Ol(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+kl(i),e.advance()}return!0};var jl=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new Ws(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},Z=hc.prototype;Z.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword `+this.type.keyword),this.options.onToken&&this.options.onToken(new jl(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Z.getToken=function(){return this.next(),new jl(this)},typeof Symbol<`u`&&(Z[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===K.eof,value:t}}}}),Z.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(K.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},Z.readToken=function(e){return Ss(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},Z.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var n=this.input.charCodeAt(e+1);return n<=56319||n>=57344?t:(t<<10)+n-56613888},Z.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},Z.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=js(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},Z.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!As(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},Z.skipSpace=function(){loop:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break loop}break;default:if(e>8&&e<14||e>=5760&&Ms.test(String.fromCharCode(e)))++this.pos;else break loop}}},Z.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},Z.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(K.ellipsis)):(++this.pos,this.finishToken(K.dot))},Z.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(K.assign,2):this.finishOp(K.slash,1)},Z.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?K.star:K.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=K.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(K.assign,n+1):this.finishOp(r,n)},Z.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(K.assign,3):this.finishOp(e===124?K.logicalOR:K.logicalAND,2):t===61?this.finishOp(K.assign,2):this.finishOp(e===124?K.bitwiseOR:K.bitwiseAND,1)},Z.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(K.assign,2):this.finishOp(K.bitwiseXOR,1)},Z.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Os.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(K.incDec,2):t===61?this.finishOp(K.assign,2):this.finishOp(K.plusMin,1)},Z.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(K.assign,n+1):this.finishOp(K.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(K.relational,n))},Z.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(K.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(K.arrow)):this.finishOp(e===61?K.eq:K.prefix,1)},Z.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(K.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(K.assign,3):this.finishOp(K.coalesce,2)}return this.finishOp(K.question,1)},Z.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),Ss(t,!0)||t===92))return this.finishToken(K.privateId,this.readWord1());this.raise(this.pos,`Unexpected character '`+Vs(t)+`'`)},Z.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(K.parenL);case 41:return++this.pos,this.finishToken(K.parenR);case 59:return++this.pos,this.finishToken(K.semi);case 44:return++this.pos,this.finishToken(K.comma);case 91:return++this.pos,this.finishToken(K.bracketL);case 93:return++this.pos,this.finishToken(K.bracketR);case 123:return++this.pos,this.finishToken(K.braceL);case 125:return++this.pos,this.finishToken(K.braceR);case 58:return++this.pos,this.finishToken(K.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(K.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(K.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,`Unexpected character '`+Vs(e)+`'`)},Z.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Z.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,`Unterminated regular expression`);var r=this.input.charAt(this.pos);if(Os.test(r)&&this.raise(n,`Unterminated regular expression`),e)e=!1;else{if(r===`[`)t=!0;else if(r===`]`&&t)t=!1;else if(r===`/`&&!t)break;e=r===`\\`}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||=new ul(this);s.reset(n,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var c=null;try{c=new RegExp(i,o)}catch{}return this.finishToken(K.regexp,{pattern:i,flags:o,value:c})},Z.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,s=0,c=0,l=t??1/0;c<l;++c,++this.pos){var u=this.input.charCodeAt(this.pos),d=void 0;if(r&&u===95){i&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed in legacy octal numeric literals`),s===95&&this.raiseRecoverable(this.pos,`Numeric separator must be exactly one underscore`),c===0&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed at the first of digits`),s=u;continue}if(d=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0,d>=e)break;s=u,o=o*e+d}return r&&s===95&&this.raiseRecoverable(this.pos-1,`Numeric separator is not allowed at the last of digits`),this.pos===a||t!=null&&this.pos-a!==t?null:o};function Ml(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,``))}function Nl(e){return typeof BigInt==`function`?BigInt(e.replace(/_/g,``)):null}Z.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n??this.raise(this.start+2,`Expected number in radix `+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=Nl(this.input.slice(t,this.pos)),++this.pos):Ss(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(K.num,n)},Z.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,`Invalid number`);var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,`Invalid number`);var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=Nl(this.input.slice(t,this.pos));return++this.pos,Ss(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(K.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!n&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,`Invalid number`)),Ss(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`);var a=Ml(this.input.slice(t,this.pos),n);return this.finishToken(K.num,a)},Z.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf(`}`,this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,`Code point out of bounds`)}else t=this.readHexChar(4);return t},Z.readString=function(e){for(var t=``,n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,`Unterminated string constant`),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(As(r)&&this.raise(this.start,`Unterminated string constant`),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(K.string,t)};var Pl={};Z.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Pl)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},Z.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Pl;this.raise(e,t)},Z.readTmplToken=function(){for(var e=``,t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated template`);var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===K.template||this.type===K.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(K.dollarBraceL)):(++this.pos,this.finishToken(K.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(K.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(As(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
|
|
52
|
-
`;break;default:e+=String.fromCharCode(n);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else ++this.pos}},Z.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case`\\`:++this.pos;break;case`$`:if(this.input[this.pos+1]!==`{`)break;case"`":return this.finishToken(K.invalidTemplate,this.input.slice(this.start,this.pos));case`\r`:this.input[this.pos+1]===`
|
|
53
|
-
`&&++this.pos;case`
|
|
54
|
-
`:case`\u2028`:case`\u2029`:++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,`Unterminated template`)},Z.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
|
|
55
|
-
`;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Vs(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return As(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(t)}},Z.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},Z.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(Cs(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?Ss:Cs)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=Vs(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},Z.readWord=function(){var e=this.readWord1(),t=K.name;return this.keywords.test(e)&&(t=Ds[e]),this.finishToken(t,e)},hc.acorn={Parser:hc,version:`8.16.0`,defaultOptions:Ks,Position:Us,SourceLocation:Ws,getLineInfo:Gs,Node:Lc,TokenType:W,tokTypes:K,keywordTypes:Ds,TokContext:kc,tokContexts:J,isIdentifierChar:Cs,isIdentifierStart:Ss,Token:jl,isNewLine:As,lineBreak:Os,lineBreakG:ks,nonASCIIwhitespace:Ms};var Fl=e.lt(((e,t)=>{t.exports={quot:`"`,amp:`&`,apos:`'`,lt:`<`,gt:`>`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,fnof:`ƒ`,circ:`ˆ`,tilde:`˜`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,bull:`•`,hellip:`…`,permil:`‰`,prime:`′`,Prime:`″`,lsaquo:`‹`,rsaquo:`›`,oline:`‾`,frasl:`⁄`,euro:`€`,image:`ℑ`,weierp:`℘`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`}})),Il=e.lt(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.acorn={}))})(e,(function(e){"use strict";var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],n=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],r=`·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・`,i=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,a={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},o=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,s={5:o,"5module":o+` export import`,6:o+` const class extends export import super`},c=/^in(stanceof)?$/,l=RegExp(`[`+i+`]`),u=RegExp(`[`+i+r+`]`);function d(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function f(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&l.test(String.fromCharCode(e)):t===!1?!1:d(e,n)}function p(e,r){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&u.test(String.fromCharCode(e)):r===!1?!1:d(e,n)||d(e,t)}var m=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function h(e,t){return new m(e,{beforeExpr:!0,binop:t})}var g={beforeExpr:!0},_={startsExpr:!0},v={};function y(e,t){return t===void 0&&(t={}),t.keyword=e,v[e]=new m(e,t)}var b={num:new m(`num`,_),regexp:new m(`regexp`,_),string:new m(`string`,_),name:new m(`name`,_),privateId:new m(`privateId`,_),eof:new m(`eof`),bracketL:new m(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new m(`]`),braceL:new m(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new m(`}`),parenL:new m(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new m(`)`),comma:new m(`,`,g),semi:new m(`;`,g),colon:new m(`:`,g),dot:new m(`.`),question:new m(`?`,g),questionDot:new m(`?.`),arrow:new m(`=>`,g),template:new m(`template`),invalidTemplate:new m(`invalidTemplate`),ellipsis:new m(`...`,g),backQuote:new m("`",_),dollarBraceL:new m("${",{beforeExpr:!0,startsExpr:!0}),eq:new m(`=`,{beforeExpr:!0,isAssign:!0}),assign:new m(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new m(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new m(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:h(`||`,1),logicalAND:h(`&&`,2),bitwiseOR:h(`|`,3),bitwiseXOR:h(`^`,4),bitwiseAND:h(`&`,5),equality:h(`==/!=/===/!==`,6),relational:h(`</>/<=/>=`,7),bitShift:h(`<</>>/>>>`,8),plusMin:new m(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:h(`%`,10),star:h(`*`,10),slash:h(`/`,10),starstar:new m(`**`,{beforeExpr:!0}),coalesce:h(`??`,1),_break:y(`break`),_case:y(`case`,g),_catch:y(`catch`),_continue:y(`continue`),_debugger:y(`debugger`),_default:y(`default`,g),_do:y(`do`,{isLoop:!0,beforeExpr:!0}),_else:y(`else`,g),_finally:y(`finally`),_for:y(`for`,{isLoop:!0}),_function:y(`function`,_),_if:y(`if`),_return:y(`return`,g),_switch:y(`switch`),_throw:y(`throw`,g),_try:y(`try`),_var:y(`var`),_const:y(`const`),_while:y(`while`,{isLoop:!0}),_with:y(`with`),_new:y(`new`,{beforeExpr:!0,startsExpr:!0}),_this:y(`this`,_),_super:y(`super`,_),_class:y(`class`,_),_extends:y(`extends`,g),_export:y(`export`),_import:y(`import`,_),_null:y(`null`,_),_true:y(`true`,_),_false:y(`false`,_),_in:y(`in`,{beforeExpr:!0,binop:7}),_instanceof:y(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:y(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:y(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:y(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},x=/\r\n?|\n|\u2028|\u2029/,S=new RegExp(x.source,`g`);function C(e){return e===10||e===13||e===8232||e===8233}function w(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(C(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var T=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,E=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,D=Object.prototype,O=D.hasOwnProperty,k=D.toString,A=Object.hasOwn||(function(e,t){return O.call(e,t)}),ee=Array.isArray||(function(e){return k.call(e)===`[object Array]`}),te=Object.create(null);function j(e){return te[e]||(te[e]=RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`))}function M(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var ne=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,re=function(e,t){this.line=e,this.column=t};re.prototype.offset=function(e){return new re(this.line,this.column+e)};var N=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function P(e,t){for(var n=1,r=0;;){var i=w(e,r,t);if(i<0)return new re(n,t-r);++n,r=i}}var ie={ecmaVersion:null,sourceType:`script`,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},ae=!1;function oe(e){var t={};for(var n in ie)t[n]=e&&A(e,n)?e[n]:ie[n];if(t.ecmaVersion===`latest`?t.ecmaVersion=1e8:t.ecmaVersion==null?(!ae&&typeof console==`object`&&console.warn&&(ae=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
56
|
-
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),ee(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}if(ee(t.onComment)&&(t.onComment=se(t,t.onComment)),t.sourceType===`commonjs`&&t.allowAwaitOutsideFunction)throw Error(`Cannot use allowAwaitOutsideFunction with sourceType: commonjs`);return t}function se(e,t){return function(n,r,i,a,o,s){var c={type:n?`Block`:`Line`,value:r,start:i,end:a};e.locations&&(c.loc=new N(this,o,s)),e.ranges&&(c.range=[i,a]),t.push(c)}}var ce=1,le=2,ue=4,de=8,fe=16,pe=32,me=64,he=128,ge=256,_e=512,ve=1024,ye=ce|le|ge;function be(e,t){return le|(e?ue:0)|(t?de:0)}var xe=0,Se=1,Ce=2,we=3,Te=4,Ee=5,F=function(e,t,n){this.options=e=oe(e),this.sourceFile=e.sourceFile,this.keywords=j(s[e.ecmaVersion>=6?6:e.sourceType===`module`?`5module`:5]);var r=``;e.allowReserved!==!0&&(r=a[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType===`module`&&(r+=` await`)),this.reservedWords=j(r);var i=(r?r+` `:``)+a.strict;this.reservedWordsStrict=j(i),this.reservedWordsStrictBind=j(i+` `+a.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(`
|
|
57
|
-
`,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(x).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=b.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType===`module`,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType===`commonjs`?le:ce),this.regexpState=null,this.privateNameStack=[]},De={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};F.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},De.inFunction.get=function(){return(this.currentVarScope().flags&le)>0},De.inGenerator.get=function(){return(this.currentVarScope().flags&de)>0},De.inAsync.get=function(){return(this.currentVarScope().flags&ue)>0},De.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(ge|_e))return!1;if(t&le)return(t&ue)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},De.allowReturn.get=function(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&ce)},De.allowSuper.get=function(){return(this.currentThisScope().flags&me)>0||this.options.allowSuperOutsideMethod},De.allowDirectSuper.get=function(){return(this.currentThisScope().flags&he)>0},De.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},De.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(ge|_e)||t&le&&!(t&fe))return!0}return!1},De.allowUsing.get=function(){var e=this.currentScope().flags;return!(e&ve||!this.inModule&&e&ce)},De.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&ge)>0},F.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},F.parse=function(e,t){return new this(t,e).parse()},F.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},F.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(F.prototype,De);var I=F.prototype,Oe=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;I.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){E.lastIndex=e,e+=E.exec(this.input)[0].length;var t=Oe.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){E.lastIndex=e+t[0].length;var n=E.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||x.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`)}e+=t[0].length,E.lastIndex=e,e+=E.exec(this.input)[0].length,this.input[e]===`;`&&e++}},I.eat=function(e){return this.type===e?(this.next(),!0):!1},I.isContextual=function(e){return this.type===b.name&&this.value===e&&!this.containsEsc},I.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},I.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},I.canInsertSemicolon=function(){return this.type===b.eof||this.type===b.braceR||x.test(this.input.slice(this.lastTokEnd,this.start))},I.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},I.semicolon=function(){!this.eat(b.semi)&&!this.insertSemicolon()&&this.unexpected()},I.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},I.expect=function(e){this.eat(e)||this.unexpected()},I.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};var ke=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};I.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?`Assigning to rvalue`:`Parenthesized pattern`)}},I.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},I.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},I.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var L=F.prototype;L.parseTopLevel=function(e){var t=Object.create(null);for(e.body||=[];this.type!==b.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType===`commonjs`?`script`:this.options.sourceType,this.finishNode(e,`Program`)};var Ae={kind:`loop`},je={kind:`switch`};L.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;E.lastIndex=this.pos;var t=E.exec(this.input),n=this.pos+t[0].length,r=this.fullCharCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123)return!0;if(f(r)){var i=n;do n+=r<=65535?1:2;while(p(r=this.fullCharCodeAt(n)));if(r===92)return!0;var a=this.input.slice(i,n);if(!c.test(a))return!0}return!1},L.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;E.lastIndex=this.pos;var e=E.exec(this.input),t=this.pos+e[0].length,n;return!x.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!(p(n=this.fullCharCodeAt(t+8))||n===92))},L.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?`await`:`using`))return!1;E.lastIndex=this.pos;var n=E.exec(this.input),r=this.pos+n[0].length;if(x.test(this.input.slice(this.pos,r)))return!1;if(e){var i=r+5,a;if(this.input.slice(r,i)!==`using`||i===this.input.length||p(a=this.fullCharCodeAt(i))||a===92)return!1;E.lastIndex=i;var o=E.exec(this.input);if(r=i+o[0].length,o&&x.test(this.input.slice(i,r)))return!1}var s=this.fullCharCodeAt(r);if(!f(s)&&s!==92)return!1;var l=r;do r+=s<=65535?1:2;while(p(s=this.fullCharCodeAt(r)));if(s===92)return!0;var u=this.input.slice(l,r);return!(c.test(u)||t&&u===`of`)},L.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},L.isUsing=function(e){return this.isUsingKeyword(!1,e)},L.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=b._var,a=`let`),r){case b._break:case b._continue:return this.parseBreakContinueStatement(i,r.keyword);case b._debugger:return this.parseDebuggerStatement(i);case b._do:return this.parseDoStatement(i);case b._for:return this.parseForStatement(i);case b._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case b._class:return e&&this.unexpected(),this.parseClass(i,!0);case b._if:return this.parseIfStatement(i);case b._return:return this.parseReturnStatement(i);case b._switch:return this.parseSwitchStatement(i);case b._throw:return this.parseThrowStatement(i);case b._try:return this.parseTryStatement(i);case b._const:case b._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case b._while:return this.parseWhileStatement(i);case b._with:return this.parseWithStatement(i);case b.braceL:return this.parseBlock(!0,i);case b.semi:return this.parseEmptyStatement(i);case b._export:case b._import:if(this.options.ecmaVersion>10&&r===b._import){E.lastIndex=this.pos;var o=E.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===b._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.isAwaitUsing(!1)?`await using`:this.isUsing(!1)?`using`:null;if(l)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),l===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.next(),this.parseVar(i,!1,l),this.semicolon(),this.finishNode(i,`VariableDeclaration`);var u=this.value,d=this.parseExpression();return r===b.name&&d.type===`Identifier`&&this.eat(b.colon)?this.parseLabeledStatement(i,u,d,e):this.parseExpressionStatement(i,d)}},L.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(b.semi)||this.insertSemicolon()?e.label=null:this.type===b.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},L.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},L.parseDoStatement=function(e){return this.next(),this.labels.push(Ae),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(b._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(b.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},L.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(Ae),this.enterScope(0),this.expect(b.parenL),this.type===b.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===b._var||this.type===b._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),this.parseForAfterInit(e,r,t)}var a=this.isContextual(`let`),o=!1,s=this.isUsing(!0)?`using`:this.isAwaitUsing(!0)?`await using`:null;if(s){var c=this.startNode();return this.next(),s===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.parseVar(c,!0,s),this.finishNode(c,`VariableDeclaration`),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,u=new ke,d=this.start,f=t>-1?this.parseExprSubscripts(u,`await`):this.parseExpression(!0,u);return this.type===b._in||(o=this.options.ecmaVersion>=6&&this.isContextual(`of`))?(t>-1?(this.type===b._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(f.start===d&&!l&&f.type===`Identifier`&&f.name===`async`?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),a&&o&&this.raise(f.start,`The left-hand side of a for-of loop may not start with 'let'.`),this.toAssignable(f,!1,u),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))},L.parseForAfterInit=function(e,t,n){return(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&t.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===b._in?n>-1&&this.unexpected(n):e.await=n>-1),this.parseForIn(e,t)):(n>-1&&this.unexpected(n),this.parseFor(e,t))},L.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,Ne|(n?0:Pe),!1,t)},L.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(b._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},L.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,`'return' outside of function`),this.next(),this.eat(b.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},L.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(b.braceL),this.labels.push(je),this.enterScope(ve);for(var t,n=!1;this.type!==b.braceR;)if(this.type===b._case||this.type===b._default){var r=this.type===b._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(b.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},L.parseThrowStatement=function(e){return this.next(),x.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var Me=[];L.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type===`Identifier`;return this.enterScope(t?pe:0),this.checkLValPattern(e,t?Te:Ce),this.expect(b.parenR),e},L.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===b._catch){var t=this.startNode();this.next(),this.eat(b.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(b._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},L.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},L.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Ae),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},L.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},L.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},L.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===b._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},L.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},L.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(b.braceL),e&&this.enterScope(0);this.type!==b.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},L.parseFor=function(e,t){return e.init=t,this.expect(b.semi),e.test=this.type===b.semi?null:this.parseExpression(),this.expect(b.semi),e.update=this.type===b.parenR?null:this.parseExpression(),this.expect(b.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},L.parseForIn=function(e,t){var n=this.type===b._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(b.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},L.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(b.eq)?i.init=this.parseMaybeAssign(t):!r&&n===`const`&&!(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():!r&&(n===`using`||n===`await using`)&&this.options.ecmaVersion>=17&&this.type!==b._in&&!this.isContextual(`of`)?this.raise(this.lastTokEnd,`Missing initializer in `+n+` declaration`):!r&&i.id.type!==`Identifier`&&!(t&&(this.type===b._in||this.isContextual(`of`)))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):i.init=null,e.declarations.push(this.finishNode(i,`VariableDeclarator`)),!this.eat(b.comma))break}return e},L.parseVarId=function(e,t){e.id=t===`using`||t===`await using`?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t===`var`?Se:Ce,!1)};var Ne=1,Pe=2,Fe=4;L.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===b.star&&t&Pe&&this.unexpected(),e.generator=this.eat(b.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&Ne&&(e.id=t&Fe&&this.type!==b.name?null:this.parseIdent(),e.id&&!(t&Pe)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Se:Ce:we));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(be(e.async,e.generator)),t&Ne||(e.id=this.type===b.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&Ne?`FunctionDeclaration`:`FunctionExpression`)},L.parseFunctionParams=function(e){this.expect(b.parenL),e.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},L.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(b.braceL);this.type!==b.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type===`MethodDefinition`&&o.kind===`constructor`?(a&&this.raiseRecoverable(o.start,`Duplicate constructor in the same class`),a=!0):o.key&&o.key.type===`PrivateIdentifier`&&Ie(r,o)&&this.raiseRecoverable(o.key.start,`Identifier '#`+o.key.name+`' has already been declared`))}return this.strict=n,this.next(),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},L.parseClassElement=function(e){if(this.eat(b.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r=``,i=!1,a=!1,o=`method`,s=!1;if(this.eatContextual(`static`)){if(t>=13&&this.eat(b.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===b.star?s=!0:r=`static`}if(n.static=s,!r&&t>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===b.star)&&!this.canInsertSemicolon()?a=!0:r=`async`),!r&&(t>=9||!a)&&this.eat(b.star)&&(i=!0),!r&&!a&&!i){var c=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?o=c:r=c)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,`Identifier`)):this.parseClassElementName(n),t<13||this.type===b.parenL||o!==`method`||i||a){var l=!n.static&&Le(n,`constructor`),u=l&&e;l&&o!==`method`&&this.raise(n.key.start,`Constructor can't have get/set modifier`),n.kind=l?`constructor`:o,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n},L.isClassElementNameStart=function(){return this.type===b.name||this.type===b.privateId||this.type===b.num||this.type===b.string||this.type===b.bracketL||this.type.keyword},L.parseClassElementName=function(e){this.type===b.privateId?(this.value===`constructor`&&this.raise(this.start,`Classes can't have an element named '#constructor'`),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},L.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind===`constructor`?(t&&this.raise(i.start,`Constructor can't be a generator`),n&&this.raise(i.start,`Constructor can't be an async method`)):e.static&&Le(e,`prototype`)&&this.raise(i.start,`Classes may not have a static property named prototype`);var a=e.value=this.parseMethod(t,n,r);return e.kind===`get`&&a.params.length!==0&&this.raiseRecoverable(a.start,`getter should have no params`),e.kind===`set`&&a.params.length!==1&&this.raiseRecoverable(a.start,`setter should have exactly one param`),e.kind===`set`&&a.params[0].type===`RestElement`&&this.raiseRecoverable(a.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)},L.parseClassField=function(e){return Le(e,`constructor`)?this.raise(e.key.start,`Classes can't have a field named 'constructor'`):e.static&&Le(e,`prototype`)&&this.raise(e.key.start,`Classes can't have a static field named 'prototype'`),this.eat(b.eq)?(this.enterScope(_e|me),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,`PropertyDefinition`)},L.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(ge|me);this.type!==b.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,`StaticBlock`)},L.parseClassId=function(e,t){this.type===b.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,Ce,!1)):(t===!0&&this.unexpected(),e.id=null)},L.parseClassSuper=function(e){e.superClass=this.eat(b._extends)?this.parseExprSubscripts(null,!1):null},L.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},L.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var o=n[a];A(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,`Private field '#`+o.name+`' must be declared in an enclosing class`))}};function Ie(e,t){var n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function Le(e,t){var n=e.computed,r=e.key;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}L.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`)},L.parseExport=function(e,t){if(this.next(),this.eat(b.star))return this.parseExportAllDeclaration(e,t);if(this.eat(b._default))return this.checkExport(t,`default`,this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,`ExportDefaultDeclaration`);if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var i=r[n];this.checkUnreserved(i.local),this.checkLocalExport(i.local),i.local.type===`Literal`&&this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},L.parseExportDeclaration=function(e){return this.parseStatement(null)},L.parseExportDefaultDeclaration=function(){var e;if(this.type===b._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,Ne|Fe,!1,e)}else if(this.type===b._class){var n=this.startNode();return this.parseClass(n,`nullableID`)}else{var r=this.parseMaybeAssign();return this.semicolon(),r}},L.checkExport=function(e,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),A(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},L.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`&&this.checkPatternExport(e,t.argument)},L.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},L.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},L.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual(`as`)?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,`ExportSpecifier`)},L.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(b.braceL);!this.eat(b.braceR);){if(n)n=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;t.push(this.parseExportSpecifier(e))}return t},L.parseImport=function(e){return this.next(),this.type===b.string?(e.specifiers=Me,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===b.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},L.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual(`as`)?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,Ce),this.finishNode(e,`ImportSpecifier`)},L.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,Ce),this.finishNode(e,`ImportDefaultSpecifier`)},L.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual(`as`),e.local=this.parseIdent(),this.checkLValSimple(e.local,Ce),this.finishNode(e,`ImportNamespaceSpecifier`)},L.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===b.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(b.comma)))return e;if(this.type===b.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(b.braceL);!this.eat(b.braceR);){if(t)t=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;e.push(this.parseImportSpecifier())}return e},L.parseWithClause=function(){var e=[];if(!this.eat(b._with))return e;this.expect(b.braceL);for(var t={},n=!0;!this.eat(b.braceR);){if(n)n=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;var r=this.parseImportAttribute(),i=r.key.type===`Identifier`?r.key.name:r.key.value;A(t,i)&&this.raiseRecoverable(r.key.start,`Duplicate attribute key '`+i+`'`),t[i]=!0,e.push(r)}return e},L.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===b.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`),this.expect(b.colon),this.type!==b.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,`ImportAttribute`)},L.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===b.string){var e=this.parseLiteral(this.value);return ne.test(e.value)&&this.raise(e.start,`An export name cannot include a lone surrogate.`),e}return this.parseIdent(!0)},L.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},L.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var Re=F.prototype;Re.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},Re.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},Re.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},Re.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==b.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},Re.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case b.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(b.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case b.braceL:return this.parseObj(!0)}return this.parseIdent()},Re.parseBindingList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);)if(a?a=!1:this.expect(b.comma),t&&this.type===b.comma)i.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===b.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),i.push(o),this.type===b.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else i.push(this.parseAssignableListItem(r));return i},Re.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},Re.parseBindingListItem=function(e){return e},Re.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(b.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},Re.checkLValSimple=function(e,t,n){t===void 0&&(t=xe);var r=t!==xe;switch(e.type){case`Identifier`:this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?`Binding `:`Assigning to `)+e.name+` in strict mode`),r&&(t===Ce&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),n&&(A(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==Ee&&this.declareName(e.name,t,e.start));break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:r&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ParenthesizedExpression`:return r&&this.raiseRecoverable(e.start,`Binding parenthesized expression`),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?`Binding`:`Assigning to`)+` rvalue`)}},Re.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=xe),e.type){case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}},Re.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=xe),e.type){case`Property`:this.checkLValInnerPattern(e.value,t,n);break;case`AssignmentPattern`:this.checkLValPattern(e.left,t,n);break;case`RestElement`:this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var ze=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},R={b_stat:new ze(`{`,!1),b_expr:new ze(`{`,!0),b_tmpl:new ze("${",!1),p_stat:new ze(`(`,!1),p_expr:new ze(`(`,!0),q_tmpl:new ze("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new ze(`function`,!1),f_expr:new ze(`function`,!0),f_expr_gen:new ze(`function`,!0,!1,null,!0),f_gen:new ze(`function`,!1,!1,null,!0)},Be=F.prototype;Be.initialContext=function(){return[R.b_stat]},Be.curContext=function(){return this.context[this.context.length-1]},Be.braceIsBlock=function(e){var t=this.curContext();return t===R.f_expr||t===R.f_stat?!0:e===b.colon&&(t===R.b_stat||t===R.b_expr)?!t.isExpr:e===b._return||e===b.name&&this.exprAllowed?x.test(this.input.slice(this.lastTokEnd,this.start)):e===b._else||e===b.semi||e===b.eof||e===b.parenR||e===b.arrow?!0:e===b.braceL?t===R.b_stat:e===b._var||e===b._const||e===b.name?!1:!this.exprAllowed},Be.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},Be.updateContext=function(e){var t,n=this.type;n.keyword&&e===b.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},Be.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},b.parenR.updateContext=b.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===R.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr},b.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?R.b_stat:R.b_expr),this.exprAllowed=!0},b.dollarBraceL.updateContext=function(){this.context.push(R.b_tmpl),this.exprAllowed=!0},b.parenL.updateContext=function(e){var t=e===b._if||e===b._for||e===b._with||e===b._while;this.context.push(t?R.p_stat:R.p_expr),this.exprAllowed=!0},b.incDec.updateContext=function(){},b._function.updateContext=b._class.updateContext=function(e){e.beforeExpr&&e!==b._else&&!(e===b.semi&&this.curContext()!==R.p_stat)&&!(e===b._return&&x.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===b.colon||e===b.braceL)&&this.curContext()===R.b_stat)?this.context.push(R.f_expr):this.context.push(R.f_stat),this.exprAllowed=!1},b.colon.updateContext=function(){this.curContext().token===`function`&&this.context.pop(),this.exprAllowed=!0},b.backQuote.updateContext=function(){this.curContext()===R.q_tmpl?this.context.pop():this.context.push(R.q_tmpl),this.exprAllowed=!1},b.star.updateContext=function(e){if(e===b._function){var t=this.context.length-1;this.context[t]===R.f_expr?this.context[t]=R.f_expr_gen:this.context[t]=R.f_gen}this.exprAllowed=!0},b.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==b.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var z=F.prototype;z.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6){i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);return}i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}},z.parseExpression=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeAssign(e,t);if(this.type===b.comma){var a=this.startNodeAt(n,r);for(a.expressions=[i];this.eat(b.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,`SequenceExpression`)}return i},z.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1,o=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new ke,r=!0);var s=this.start,c=this.startLoc;(this.type===b.parenL||this.type===b.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,s,c)),this.type.isAssign){var u=this.startNodeAt(s,c);return u.operator=this.value,this.type===b.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===b.eq?this.checkLValPattern(l):this.checkLValSimple(l),u.left=l,this.next(),u.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(u,`AssignmentExpression`)}else r&&this.checkExpressionErrors(t,!0);return i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l},z.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(b.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(b.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},z.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},z.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==b._in)&&a>r){var o=this.type===b.logicalOR||this.type===b.logicalAND,s=this.type===b.coalesce;s&&(a=b.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===b.coalesce||s&&(this.type===b.logicalOR||this.type===b.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},z.buildBinary=function(e,t,n,r,i,a){r.type===`PrivateIdentifier`&&this.raise(r.start,`Private identifier can only be left side of binary expression`);var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},z.parseMaybeUnary=function(e,t,n,r){var i=this.start,a=this.startLoc,o;if(this.isContextual(`await`)&&this.canAwait)o=this.parseAwait(r),t=!0;else if(this.type.prefix){var s=this.startNode(),c=this.type===b.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(s.argument):this.strict&&s.operator===`delete`&&Ve(s.argument)?this.raiseRecoverable(s.start,`Deleting local variable in strict mode`):s.operator===`delete`&&He(s.argument)?this.raiseRecoverable(s.start,`Private fields can not be deleted`):t=!0,o=this.finishNode(s,c?`UpdateExpression`:`UnaryExpression`)}else if(!t&&this.type===b.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==b._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(i,a);l.operator=this.value,l.prefix=!1,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,`UpdateExpression`)}}if(!n&&this.eat(b.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,o,this.parseMaybeUnary(null,!1,!1,r),`**`,!1);else return o};function Ve(e){return e.type===`Identifier`||e.type===`ParenthesizedExpression`&&Ve(e.expression)}function He(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`||e.type===`ChainExpression`&&He(e.expression)||e.type===`ParenthesizedExpression`&&He(e.expression)}z.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprAtom(e,t);if(i.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return i;var a=this.parseSubscripts(i,n,r,!1,t);return e&&a.type===`MemberExpression`&&(e.parenthesizedAssign>=a.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=a.start&&(e.parenthesizedBind=-1),e.trailingComma>=a.start&&(e.trailingComma=-1)),a},z.parseSubscripts=function(e,t,n,r,i){for(var a=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var s=this.parseSubscript(e,t,n,r,a,o,i);if(s.optional&&(o=!0),s===e||s.type===`ArrowFunctionExpression`){if(o){var c=this.startNodeAt(t,n);c.expression=s,s=this.finishNode(c,`ChainExpression`)}return s}e=s}},z.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(b.arrow)},z.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)},z.parseSubscript=function(e,t,n,r,i,a,o){var s=this.options.ecmaVersion>=11,c=s&&this.eat(b.questionDot);r&&c&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var l=this.eat(b.bracketL);if(l||c&&this.type!==b.parenL&&this.type!==b.backQuote||this.eat(b.dot)){var u=this.startNodeAt(t,n);u.object=e,l?(u.property=this.parseExpression(),this.expect(b.bracketR)):this.type===b.privateId&&e.type!==`Super`?u.property=this.parsePrivateIdent():u.property=this.parseIdent(this.options.allowReserved!==`never`),u.computed=!!l,s&&(u.optional=c),e=this.finishNode(u,`MemberExpression`)}else if(!r&&this.eat(b.parenL)){var d=new ke,f=this.yieldPos,p=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var h=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,n,h,o);this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var g=this.startNodeAt(t,n);g.callee=e,g.arguments=h,s&&(g.optional=c),e=this.finishNode(g,`CallExpression`)}else if(this.type===b.backQuote){(c||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var _=this.startNodeAt(t,n);_.tag=e,_.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(_,`TaggedTemplateExpression`)}return e},z.parseExprAtom=function(e,t,n){this.type===b.slash&&this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case b._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),r=this.startNode(),this.next(),this.type===b.parenL&&!this.allowDirectSuper&&this.raise(r.start,`super() call outside constructor of a subclass`),this.type!==b.dot&&this.type!==b.bracketL&&this.type!==b.parenL&&this.unexpected(),this.finishNode(r,`Super`);case b._this:return r=this.startNode(),this.next(),this.finishNode(r,`ThisExpression`);case b.name:var a=this.start,o=this.startLoc,s=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&c.name===`async`&&!this.canInsertSemicolon()&&this.eat(b._function))return this.overrideContext(R.f_expr),this.parseFunction(this.startNodeAt(a,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(b.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[c],!1,t);if(this.options.ecmaVersion>=8&&c.name===`async`&&this.type===b.name&&!s&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return c=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(b.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[c],!0,t)}return c;case b.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case b.num:case b.string:return this.parseLiteral(this.value);case b._null:case b._true:case b._false:return r=this.startNode(),r.value=this.type===b._null?null:this.type===b._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,`Literal`);case b.parenL:var u=this.start,d=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(d)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),d;case b.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(b.bracketR,!0,!0,e),this.finishNode(r,`ArrayExpression`);case b.braceL:return this.overrideContext(R.b_expr),this.parseObj(!1,e);case b._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case b._class:return this.parseClass(this.startNode(),!1);case b._new:return this.parseNew();case b.backQuote:return this.parseTemplate();case b._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},z.parseExprAtomDefault=function(){this.unexpected()},z.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`),this.next(),this.type===b.parenL&&!e)return this.parseDynamicImport(t);if(this.type===b.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name=`import`,t.meta=this.finishNode(n,`Identifier`),this.parseImportMeta(t)}else this.unexpected()},z.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(b.parenR)?e.options=null:(this.expect(b.comma),this.afterTrailingComma(b.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(b.parenR)||(this.expect(b.comma),this.afterTrailingComma(b.parenR)||this.unexpected())));else if(!this.eat(b.parenR)){var t=this.start;this.eat(b.comma)&&this.eat(b.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},z.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},z.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value==null?t.raw.slice(0,-1).replace(/_/g,``):t.value.toString()),this.next(),this.finishNode(t,`Literal`)},z.parseParenExpression=function(){this.expect(b.parenL);var e=this.parseExpression();return this.expect(b.parenR),e},z.shouldParseArrow=function(e){return!this.canInsertSemicolon()},z.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,s=this.startLoc,c=[],l=!0,u=!1,d=new ke,f=this.yieldPos,p=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==b.parenR;)if(l?l=!1:this.expect(b.comma),a&&this.afterTrailingComma(b.parenR,!0)){u=!0;break}else if(this.type===b.ellipsis){m=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===b.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`);break}else c.push(this.parseMaybeAssign(!1,d,this.parseParenItem));var h=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(b.parenR),e&&this.shouldParseArrow(c)&&this.eat(b.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=p,this.parseParenArrowList(n,r,c,t);(!c.length||u)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,c.length>1?(i=this.startNodeAt(o,s),i.expressions=c,this.finishNodeAt(i,`SequenceExpression`,h,g)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var _=this.startNodeAt(n,r);return _.expression=i,this.finishNode(_,`ParenthesizedExpression`)}else return i},z.parseParenItem=function(e){return e},z.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var Ue=[];z.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===b.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name=`new`,e.meta=this.finishNode(t,`Identifier`),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),this.eat(b.parenL)?e.arguments=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Ue,this.finishNode(e,`NewExpression`)},z.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===b.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value.replace(/\r\n?/g,`
|
|
58
|
-
`),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
59
|
-
`),cooked:this.value},this.next(),n.tail=this.type===b.backQuote,this.finishNode(n,`TemplateElement`)},z.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===b.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(b.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(b.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,`TemplateLiteral`)},z.isAsyncProp=function(e){return!e.computed&&e.key.type===`Identifier`&&e.key.name===`async`&&(this.type===b.name||this.type===b.num||this.type===b.string||this.type===b.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===b.star)&&!x.test(this.input.slice(this.lastTokEnd,this.start))},z.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(b.braceR);){if(r)r=!1;else if(this.expect(b.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(b.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),n.properties.push(a)}return this.finishNode(n,e?`ObjectPattern`:`ObjectExpression`)},z.parseProperty=function(e,t){var n=this.startNode(),r,i,a,o;if(this.options.ecmaVersion>=9&&this.eat(b.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===b.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.finishNode(n,`RestElement`)):(n.argument=this.parseMaybeAssign(!1,t),this.type===b.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,`SpreadElement`));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(b.star)));var s=this.containsEsc;return this.parsePropertyName(n),!e&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(b.star),this.parsePropertyName(n)):i=!1,this.parsePropertyValue(n,e,r,i,a,o,t,s),this.finishNode(n,`Property`)},z.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n=e.kind===`get`?0:1;if(e.value.params.length!==n){var r=e.value.start;e.kind===`get`?this.raiseRecoverable(r,`getter should have no params`):this.raiseRecoverable(r,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)},z.parsePropertyValue=function(e,t,n,r,i,a,o,s){(n||r)&&this.type===b.colon&&this.unexpected(),this.eat(b.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind=`init`):this.options.ecmaVersion>=6&&this.type===b.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(n,r),e.kind=`init`):!t&&!s&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.type!==b.comma&&this.type!==b.braceR&&this.type!==b.eq?((n||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type===`Identifier`?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=i),t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===b.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind=`init`,e.shorthand=!0):this.unexpected()},z.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(b.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(b.bracketR),e.key;e.computed=!1}return e.key=this.type===b.num||this.type===b.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`)},z.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},z.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(be(t,r.generator)|me|(n?he:0)),this.expect(b.parenL),r.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,`FunctionExpression`)},z.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(be(n,!1)|fe),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,`ArrowFunctionExpression`)},z.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==b.braceL,a=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||s)&&(o=this.strictDirective(this.end),o&&s&&this.raiseRecoverable(e.start,`Illegal 'use strict' directive in function with non-simple parameter list`));var c=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!a&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,Ee),e.body=this.parseBlock(!1,void 0,o&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()},z.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].type!==`Identifier`)return!1;return!0},z.checkParams=function(e,t){for(var n=Object.create(null),r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,Se,t?null:n)}},z.parseExprList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(b.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===b.comma?o=null:this.type===b.ellipsis?(o=this.parseSpread(r),r&&this.type===b.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},z.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;this.inGenerator&&r===`yield`&&this.raiseRecoverable(t,`Cannot use 'yield' as identifier inside a generator`),this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use 'await' as identifier inside an async function`),!(this.currentThisScope().flags&ye)&&r===`arguments`&&this.raiseRecoverable(t,`Cannot use 'arguments' in class field initializer`),this.inClassStaticBlock&&(r===`arguments`||r===`await`)&&this.raise(t,`Cannot use `+r+` in class static initialization block`),this.keywords.test(r)&&this.raise(t,`Unexpected keyword '`+r+`'`),!(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf(`\\`)!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(!this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use keyword 'await' outside an async function`),this.raiseRecoverable(t,`The keyword '`+r+`' is reserved`))},z.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,`Identifier`),e||(this.checkUnreserved(t),t.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},z.parseIdentNode=function(){var e=this.startNode();return this.type===b.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name===`class`||e.name===`function`)&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=b.name):this.unexpected(),e},z.parsePrivateIdent=function(){var e=this.startNode();return this.type===b.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,`PrivateIdentifier`),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,`Private field '#`+e.name+`' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},z.parseYield=function(e){this.yieldPos||=this.start;var t=this.startNode();return this.next(),this.type===b.semi||this.canInsertSemicolon()||this.type!==b.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(b.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,`YieldExpression`)},z.parseAwait=function(e){this.awaitPos||=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,`AwaitExpression`)};var We=F.prototype;We.raise=function(e,t){var n=P(this.input,e);t+=` (`+n.line+`:`+n.column+`)`,this.sourceFile&&(t+=` in `+this.sourceFile);var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},We.raiseRecoverable=We.raise,We.curPosition=function(){if(this.options.locations)return new re(this.curLine,this.pos-this.lineStart)};var Ge=F.prototype,Ke=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};Ge.enterScope=function(e){this.scopeStack.push(new Ke(e))},Ge.exitScope=function(){this.scopeStack.pop()},Ge.treatFunctionsAsVarInScope=function(e){return e.flags&le||!this.inModule&&e.flags&ce},Ge.declareName=function(e,t,n){var r=!1;if(t===Ce){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&ce&&delete this.undefinedExports[e]}else if(t===Te)this.currentScope().lexical.push(e);else if(t===we){var a=this.currentScope();r=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(s.flags&pe&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){r=!0;break}if(s.var.push(e),this.inModule&&s.flags&ce&&delete this.undefinedExports[e],s.flags&ye)break}r&&this.raiseRecoverable(n,`Identifier '`+e+`' has already been declared`)},Ge.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},Ge.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},Ge.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(ye|_e|ge))return t}},Ge.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(ye|_e|ge)&&!(t.flags&fe))return t}};var qe=function(e,t,n){this.type=``,this.start=t,this.end=0,e.options.locations&&(this.loc=new N(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},Je=F.prototype;Je.startNode=function(){return new qe(this,this.start,this.startLoc)},Je.startNodeAt=function(e,t){return new qe(this,e,t)};function Ye(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}Je.finishNode=function(e,t){return Ye.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Je.finishNodeAt=function(e,t,n,r){return Ye.call(this,e,t,n,r)},Je.copyNode=function(e){var t=new qe(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var Xe=`Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz`,Ze=`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 Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation 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`,Qe=Ze+` Extended_Pictographic`,$e=Qe,et=$e+` EBase EComp EMod EPres ExtPict`,tt=et,nt=tt,rt={9:Ze,10:Qe,11:$e,12:et,13:tt,14:nt},it=`Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji`,at={9:``,10:``,11:``,12:``,13:``,14:it},ot=`Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu`,st=`Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb`,ct=st+` Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd`,lt=ct+` Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho`,ut=lt+` Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi`,dt=ut+` Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith`,ft=dt+` `+Xe,pt={9:st,10:ct,11:lt,12:ut,13:dt,14:ft},mt={};function ht(e){var t=mt[e]={binary:j(rt[e]+` `+ot),binaryOfStrings:j(at[e]),nonBinary:{General_Category:j(ot),Script:j(pt[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var gt=0,_t=[9,10,11,12,13,14];gt<_t.length;gt+=1){var vt=_t[gt];ht(vt)}var B=F.prototype,yt=function(e,t){this.parent=e,this.base=t||this};yt.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var n=e;n;n=n.parent)if(t.base===n.base&&t!==n)return!0;return!1},yt.prototype.sibling=function(){return new yt(this.parent,this.base)};var bt=function(e){this.parser=e,this.validFlags=`gim`+(e.options.ecmaVersion>=6?`uy`:``)+(e.options.ecmaVersion>=9?`s`:``)+(e.options.ecmaVersion>=13?`d`:``)+(e.options.ecmaVersion>=15?`v`:``),this.unicodeProperties=mt[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source=``,this.flags=``,this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue=``,this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};bt.prototype.reset=function(e,t,n){var r=n.indexOf(`v`)!==-1,i=n.indexOf(`u`)!==-1;this.start=e|0,this.source=t+``,this.flags=n,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)},bt.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /`+this.source+`/: `+e)},bt.prototype.at=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!(t||this.switchU)||i<=55295||i>=57344||e+1>=r)return i;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},bt.prototype.nextIndex=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i=n.charCodeAt(e),a;return!(t||this.switchU)||i<=55295||i>=57344||e+1>=r||(a=n.charCodeAt(e+1))<56320||a>57343?e+1:e+2},bt.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},bt.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},bt.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},bt.prototype.eat=function(e,t){return t===void 0&&(t=!1),this.current(t)===e?(this.advance(t),!0):!1},bt.prototype.eatChars=function(e,t){t===void 0&&(t=!1);for(var n=this.pos,r=0,i=e;r<i.length;r+=1){var a=i[r],o=this.at(n,t);if(o===-1||o!==a)return!1;n=this.nextIndex(n,t)}return this.pos=n,!0},B.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=!1,i=!1,a=0;a<n.length;a++){var o=n.charAt(a);t.indexOf(o)===-1&&this.raise(e.start,`Invalid regular expression flag`),n.indexOf(o,a+1)>-1&&this.raise(e.start,`Duplicate regular expression flag`),o===`u`&&(r=!0),o===`v`&&(i=!0)}this.options.ecmaVersion>=15&&r&&i&&this.raise(e.start,`Invalid regular expression flag`)};function xt(e){for(var t in e)return!0;return!1}B.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&xt(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},B.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue=``,e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise(`Unmatched ')'`),(e.eat(93)||e.eat(125))&&e.raise(`Lone quantifier brackets`)),e.maxBackReference>e.numCapturingParens&&e.raise(`Invalid escape`);for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames[r]||e.raise(`Invalid named capture referenced`)}},B.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new yt(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise(`Nothing to repeat`),e.eat(123)&&e.raise(`Lone quantifier brackets`)},B.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},B.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise(`Invalid quantifier`),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},B.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise(`Unterminated group`),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},B.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},B.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},B.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<r&&!t&&e.raise(`numbers out of order in {} quantifier`),!0;e.switchU&&!t&&e.raise(`Incomplete quantifier`),e.pos=n}return!1},B.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},B.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},B.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),r=e.eat(45);if(n||r){for(var i=0;i<n.length;i++){var a=n.charAt(i);n.indexOf(a,i+1)>-1&&e.raise(`Duplicate regular expression modifiers`)}if(r){var o=this.regexp_eatModifiers(e);!n&&!o&&e.current()===58&&e.raise(`Invalid regular expression modifiers`);for(var s=0;s<o.length;s++){var c=o.charAt(s);(o.indexOf(c,s+1)>-1||n.indexOf(c)>-1)&&e.raise(`Duplicate regular expression modifiers`)}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise(`Unterminated group`)}}e.pos=t}return!1},B.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise(`Invalid group`),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise(`Unterminated group`)}return!1},B.regexp_eatModifiers=function(e){for(var t=``,n=0;(n=e.current())!==-1&&St(n);)t+=M(n),e.advance();return t};function St(e){return e===105||e===109||e===115}B.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},B.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise(`Nothing to repeat`),!1},B.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Ct(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Ct(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}B.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!Ct(n);)e.advance();return e.pos!==t},B.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1},B.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise(`Invalid group`);var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n)if(t)for(var r=0,i=n;r<i.length;r+=1)i[r].separatedFrom(e.branchID)||e.raise(`Duplicate capture group name`);else e.raise(`Duplicate capture group name`);t?(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},B.regexp_eatGroupName=function(e){if(e.lastStringValue=``,e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise(`Invalid capture group name`)}return!1},B.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue=``,this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=M(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=M(e.lastIntValue);return!0}return!1},B.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),wt(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function wt(e){return f(e,!0)||e===36||e===95}B.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),Tt(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Tt(e){return p(e,!0)||e===36||e===95||e===8204||e===8205}B.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise(`Invalid unicode escape`),e.raise(`Invalid escape`)),!1)},B.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},B.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise(`Invalid named reference`)}return!1},B.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},B.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},B.regexp_eatZero=function(e){return e.current()===48&&!Lt(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1},B.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1},B.regexp_eatControlLetter=function(e){var t=e.current();return Et(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function Et(e){return e>=65&&e<=90||e>=97&&e<=122}B.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Dt(e.lastIntValue))return!0;r&&e.raise(`Invalid unicode escape`),e.pos=n}return!1};function Dt(e){return e>=0&&e<=1114111}B.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1},B.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var Ot=0,kt=1,At=2;B.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(jt(t))return e.lastIntValue=-1,e.advance(),kt;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&r===At&&e.raise(`Invalid property name`),r;e.raise(`Invalid property name`)}return Ot};function jt(e){return e===100||e===68||e===115||e===83||e===119||e===87}B.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),kt}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return Ot},B.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){A(e.unicodeProperties.nonBinary,t)||e.raise(`Invalid property name`),e.unicodeProperties.nonBinary[t].test(n)||e.raise(`Invalid property value`)},B.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return kt;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return At;e.raise(`Invalid property name`)},B.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue=``;Mt(t=e.current());)e.lastStringValue+=M(t),e.advance();return e.lastStringValue!==``};function Mt(e){return Et(e)||e===95}B.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue=``;Nt(t=e.current());)e.lastStringValue+=M(t),e.advance();return e.lastStringValue!==``};function Nt(e){return Mt(e)||Lt(e)}B.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},B.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise(`Unterminated character class`),t&&n===At&&e.raise(`Negated character class may contain strings`),!0}return!1},B.regexp_classContents=function(e){return e.current()===93?kt:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),kt)},B.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise(`Invalid character class`),t!==-1&&n!==-1&&t>n&&e.raise(`Range out of order in character class`)}}},B.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||Bt(n))&&e.raise(`Invalid class escape`),e.raise(`Invalid escape`)}e.pos=t}var r=e.current();return r===93?!1:(e.lastIntValue=r,e.advance(),!0)},B.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},B.regexp_classSetExpression=function(e){var t=kt,n;if(!this.regexp_eatClassSetRange(e))if(n=this.regexp_eatClassSetOperand(e)){n===At&&(t=At);for(var r=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))){n!==At&&(t=kt);continue}e.raise(`Invalid character in character class`)}if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise(`Invalid character in character class`);if(r!==e.pos)return t}else e.raise(`Invalid character in character class`);for(;;)if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e),!n)return t;n===At&&(t=At)}},B.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return n!==-1&&r!==-1&&n>r&&e.raise(`Range out of order in character class`),!0}e.pos=t}return!1},B.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?kt:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},B.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return n&&r===At&&e.raise(`Negated character class may contain strings`),r;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null},B.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise(`Invalid escape`);e.pos=t}return null},B.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===At&&(t=At);return t},B.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?kt:At},B.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var n=e.current();return n<0||n===e.lookahead()&&Pt(n)||Ft(n)?!1:(e.advance(),e.lastIntValue=n,!0)};function Pt(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Ft(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}B.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return It(t)?(e.lastIntValue=t,e.advance(),!0):!1};function It(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}B.regexp_eatClassControlLetter=function(e){var t=e.current();return Lt(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},B.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise(`Invalid escape`),e.pos=t}return!1},B.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Lt(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function Lt(e){return e>=48&&e<=57}B.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Rt(n=e.current());)e.lastIntValue=16*e.lastIntValue+zt(n),e.advance();return e.pos!==t};function Rt(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function zt(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}B.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+n*8+e.lastIntValue:e.lastIntValue=t*8+n}else e.lastIntValue=t;return!0}return!1},B.regexp_eatOctalDigit=function(e){var t=e.current();return Bt(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Bt(e){return e>=48&&e<=55}B.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!Rt(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+zt(i),e.advance()}return!0};var Vt=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new N(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},V=F.prototype;V.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword `+this.type.keyword),this.options.onToken&&this.options.onToken(new Vt(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},V.getToken=function(){return this.next(),new Vt(this)},typeof Symbol<`u`&&(V[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===b.eof,value:t}}}}),V.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(b.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},V.readToken=function(e){return f(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},V.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var n=this.input.charCodeAt(e+1);return n<=56319||n>=57344?t:(t<<10)+n-56613888},V.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},V.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=w(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},V.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!C(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},V.skipSpace=function(){loop:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break loop}break;default:if(e>8&&e<14||e>=5760&&T.test(String.fromCharCode(e)))++this.pos;else break loop}}},V.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},V.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(b.ellipsis)):(++this.pos,this.finishToken(b.dot))},V.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(b.assign,2):this.finishOp(b.slash,1)},V.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?b.star:b.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=b.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(b.assign,n+1):this.finishOp(r,n)},V.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(b.assign,3):this.finishOp(e===124?b.logicalOR:b.logicalAND,2):t===61?this.finishOp(b.assign,2):this.finishOp(e===124?b.bitwiseOR:b.bitwiseAND,1)},V.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(b.assign,2):this.finishOp(b.bitwiseXOR,1)},V.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||x.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(b.incDec,2):t===61?this.finishOp(b.assign,2):this.finishOp(b.plusMin,1)},V.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(b.assign,n+1):this.finishOp(b.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(b.relational,n))},V.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(b.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(b.arrow)):this.finishOp(e===61?b.eq:b.prefix,1)},V.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(b.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(b.assign,3):this.finishOp(b.coalesce,2)}return this.finishOp(b.question,1)},V.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),f(t,!0)||t===92))return this.finishToken(b.privateId,this.readWord1());this.raise(this.pos,`Unexpected character '`+M(t)+`'`)},V.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(b.parenL);case 41:return++this.pos,this.finishToken(b.parenR);case 59:return++this.pos,this.finishToken(b.semi);case 44:return++this.pos,this.finishToken(b.comma);case 91:return++this.pos,this.finishToken(b.bracketL);case 93:return++this.pos,this.finishToken(b.bracketR);case 123:return++this.pos,this.finishToken(b.braceL);case 125:return++this.pos,this.finishToken(b.braceR);case 58:return++this.pos,this.finishToken(b.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(b.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(b.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,`Unexpected character '`+M(e)+`'`)},V.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},V.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,`Unterminated regular expression`);var r=this.input.charAt(this.pos);if(x.test(r)&&this.raise(n,`Unterminated regular expression`),e)e=!1;else{if(r===`[`)t=!0;else if(r===`]`&&t)t=!1;else if(r===`/`&&!t)break;e=r===`\\`}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||=new bt(this);s.reset(n,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var c=null;try{c=new RegExp(i,o)}catch{}return this.finishToken(b.regexp,{pattern:i,flags:o,value:c})},V.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,s=0,c=0,l=t??1/0;c<l;++c,++this.pos){var u=this.input.charCodeAt(this.pos),d=void 0;if(r&&u===95){i&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed in legacy octal numeric literals`),s===95&&this.raiseRecoverable(this.pos,`Numeric separator must be exactly one underscore`),c===0&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed at the first of digits`),s=u;continue}if(d=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0,d>=e)break;s=u,o=o*e+d}return r&&s===95&&this.raiseRecoverable(this.pos-1,`Numeric separator is not allowed at the last of digits`),this.pos===a||t!=null&&this.pos-a!==t?null:o};function Ht(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,``))}function Ut(e){return typeof BigInt==`function`?BigInt(e.replace(/_/g,``)):null}V.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n??this.raise(this.start+2,`Expected number in radix `+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=Ut(this.input.slice(t,this.pos)),++this.pos):f(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(b.num,n)},V.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,`Invalid number`);var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,`Invalid number`);var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=Ut(this.input.slice(t,this.pos));return++this.pos,f(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(b.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!n&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,`Invalid number`)),f(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`);var a=Ht(this.input.slice(t,this.pos),n);return this.finishToken(b.num,a)},V.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf(`}`,this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,`Code point out of bounds`)}else t=this.readHexChar(4);return t},V.readString=function(e){for(var t=``,n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,`Unterminated string constant`),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(C(r)&&this.raise(this.start,`Unterminated string constant`),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(b.string,t)};var Wt={};V.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Wt)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},V.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Wt;this.raise(e,t)},V.readTmplToken=function(){for(var e=``,t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated template`);var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===b.template||this.type===b.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(b.dollarBraceL)):(++this.pos,this.finishToken(b.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(b.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(C(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
|
|
60
|
-
`;break;default:e+=String.fromCharCode(n);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else ++this.pos}},V.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case`\\`:++this.pos;break;case`$`:if(this.input[this.pos+1]!==`{`)break;case"`":return this.finishToken(b.invalidTemplate,this.input.slice(this.start,this.pos));case`\r`:this.input[this.pos+1]===`
|
|
61
|
-
`&&++this.pos;case`
|
|
62
|
-
`:case`\u2028`:case`\u2029`:++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,`Unterminated template`)},V.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
|
|
63
|
-
`;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return M(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return C(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(t)}},V.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},V.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(p(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?f:p)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=M(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},V.readWord=function(){var e=this.readWord1(),t=b.name;return this.keywords.test(e)&&(t=v[e]),this.finishToken(t,e)};var Gt=`8.16.0`;F.acorn={Parser:F,version:Gt,defaultOptions:ie,Position:re,SourceLocation:N,getLineInfo:P,Node:qe,TokenType:m,tokTypes:b,keywordTypes:v,TokContext:ze,tokContexts:R,isIdentifierChar:p,isIdentifierStart:f,Token:Vt,isNewLine:C,lineBreak:x,lineBreakG:S,nonASCIIwhitespace:T};function Kt(e,t){return F.parse(e,t)}function qt(e,t,n){return F.parseExpressionAt(e,t,n)}function Jt(e,t){return F.tokenizer(e,t)}e.Node=qe,e.Parser=F,e.Position=re,e.SourceLocation=N,e.TokContext=ze,e.Token=Vt,e.TokenType=m,e.defaultOptions=ie,e.getLineInfo=P,e.isIdentifierChar=p,e.isIdentifierStart=f,e.isNewLine=C,e.keywordTypes=v,e.lineBreak=x,e.lineBreakG=S,e.nonASCIIwhitespace=T,e.parse=Kt,e.parseExpressionAt=qt,e.tokContexts=R,e.tokTypes=b,e.tokenizer=Jt,e.version=Gt}))})),Ll=e.lt(((e,t)=>{let n=Fl(),r=/^[\da-fA-F]+$/,i=/^\d+$/,a=new WeakMap;function o(e){e=e.Parser.acorn||e;let t=a.get(e);if(!t){let n=e.tokTypes,r=e.TokContext,i=e.TokenType,o=new r(`<tag`,!1),s=new r(`</tag`,!1),c=new r(`<tag>...</tag>`,!0,!0),l={tc_oTag:o,tc_cTag:s,tc_expr:c},u={jsxName:new i(`jsxName`),jsxText:new i(`jsxText`,{beforeExpr:!0}),jsxTagStart:new i(`jsxTagStart`,{startsExpr:!0}),jsxTagEnd:new i(`jsxTagEnd`)};u.jsxTagStart.updateContext=function(){this.context.push(c),this.context.push(o),this.exprAllowed=!1},u.jsxTagEnd.updateContext=function(e){let t=this.context.pop();t===o&&e===n.slash||t===s?(this.context.pop(),this.exprAllowed=this.curContext()===c):this.exprAllowed=!0},t={tokContexts:l,tokTypes:u},a.set(e,t)}return t}function s(e){if(!e)return e;if(e.type===`JSXIdentifier`)return e.name;if(e.type===`JSXNamespacedName`)return e.namespace.name+`:`+e.name.name;if(e.type===`JSXMemberExpression`)return s(e.object)+`.`+s(e.property)}t.exports=function(e){return e||={},function(t){return c({allowNamespaces:e.allowNamespaces!==!1,allowNamespacedObjects:!!e.allowNamespacedObjects},t)}},Object.defineProperty(t.exports,`tokTypes`,{get:function(){return o(Il()).tokTypes},configurable:!0,enumerable:!0});function c(e,t){let a=t.acorn||Il(),c=o(a),l=a.tokTypes,u=c.tokTypes,d=a.tokContexts,f=c.tokContexts.tc_oTag,p=c.tokContexts.tc_cTag,m=c.tokContexts.tc_expr,h=a.isNewLine,g=a.isIdentifierStart,_=a.isIdentifierChar;return class extends t{static get acornJsx(){return c}jsx_readToken(){let e=``,t=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated JSX contents`);let n=this.input.charCodeAt(this.pos);switch(n){case 60:case 123:return this.pos===this.start?n===60&&this.exprAllowed?(++this.pos,this.finishToken(u.jsxTagStart)):this.getTokenFromCode(n):(e+=this.input.slice(t,this.pos),this.finishToken(u.jsxText,e));case 38:e+=this.input.slice(t,this.pos),e+=this.jsx_readEntity(),t=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(n===62?`>`:`}`)+'` or `{"'+this.input[this.pos]+'"}`?');default:h(n)?(e+=this.input.slice(t,this.pos),e+=this.jsx_readNewLine(!0),t=this.pos):++this.pos}}}jsx_readNewLine(e){let t=this.input.charCodeAt(this.pos),n;return++this.pos,t===13&&this.input.charCodeAt(this.pos)===10?(++this.pos,n=e?`
|
|
64
|
-
`:`\r
|
|
65
|
-
`):n=String.fromCharCode(t),this.options.locations&&(++this.curLine,this.lineStart=this.pos),n}jsx_readString(e){let t=``,n=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);let r=this.input.charCodeAt(this.pos);if(r===e)break;r===38?(t+=this.input.slice(n,this.pos),t+=this.jsx_readEntity(),n=this.pos):h(r)?(t+=this.input.slice(n,this.pos),t+=this.jsx_readNewLine(!1),n=this.pos):++this.pos}return t+=this.input.slice(n,this.pos++),this.finishToken(l.string,t)}jsx_readEntity(){let e=``,t=0,a,o=this.input[this.pos];o!==`&`&&this.raise(this.pos,`Entity must start with an ampersand`);let s=++this.pos;for(;this.pos<this.input.length&&t++<10;){if(o=this.input[this.pos++],o===`;`){e[0]===`#`?e[1]===`x`?(e=e.substr(2),r.test(e)&&(a=String.fromCharCode(parseInt(e,16)))):(e=e.substr(1),i.test(e)&&(a=String.fromCharCode(parseInt(e,10)))):a=n[e];break}e+=o}return a||(this.pos=s,`&`)}jsx_readWord(){let e,t=this.pos;do e=this.input.charCodeAt(++this.pos);while(_(e)||e===45);return this.finishToken(u.jsxName,this.input.slice(t,this.pos))}jsx_parseIdentifier(){let e=this.startNode();return this.type===u.jsxName?e.name=this.value:this.type.keyword?e.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(e,`JSXIdentifier`)}jsx_parseNamespacedName(){let t=this.start,n=this.startLoc,r=this.jsx_parseIdentifier();if(!e.allowNamespaces||!this.eat(l.colon))return r;var i=this.startNodeAt(t,n);return i.namespace=r,i.name=this.jsx_parseIdentifier(),this.finishNode(i,`JSXNamespacedName`)}jsx_parseElementName(){if(this.type===u.jsxTagEnd)return``;let t=this.start,n=this.startLoc,r=this.jsx_parseNamespacedName();for(this.type===l.dot&&r.type===`JSXNamespacedName`&&!e.allowNamespacedObjects&&this.unexpected();this.eat(l.dot);){let e=this.startNodeAt(t,n);e.object=r,e.property=this.jsx_parseIdentifier(),r=this.finishNode(e,`JSXMemberExpression`)}return r}jsx_parseAttributeValue(){switch(this.type){case l.braceL:let e=this.jsx_parseExpressionContainer();return e.expression.type===`JSXEmptyExpression`&&this.raise(e.start,`JSX attributes must only be assigned a non-empty expression`),e;case u.jsxTagStart:case l.string:return this.parseExprAtom();default:this.raise(this.start,`JSX value should be either an expression or a quoted JSX text`)}}jsx_parseEmptyExpression(){let e=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(e,`JSXEmptyExpression`,this.start,this.startLoc)}jsx_parseExpressionContainer(){let e=this.startNode();return this.next(),e.expression=this.type===l.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(l.braceR),this.finishNode(e,`JSXExpressionContainer`)}jsx_parseAttribute(){let e=this.startNode();return this.eat(l.braceL)?(this.expect(l.ellipsis),e.argument=this.parseMaybeAssign(),this.expect(l.braceR),this.finishNode(e,`JSXSpreadAttribute`)):(e.name=this.jsx_parseNamespacedName(),e.value=this.eat(l.eq)?this.jsx_parseAttributeValue():null,this.finishNode(e,`JSXAttribute`))}jsx_parseOpeningElementAt(e,t){let n=this.startNodeAt(e,t);n.attributes=[];let r=this.jsx_parseElementName();for(r&&(n.name=r);this.type!==l.slash&&this.type!==u.jsxTagEnd;)n.attributes.push(this.jsx_parseAttribute());return n.selfClosing=this.eat(l.slash),this.expect(u.jsxTagEnd),this.finishNode(n,r?`JSXOpeningElement`:`JSXOpeningFragment`)}jsx_parseClosingElementAt(e,t){let n=this.startNodeAt(e,t),r=this.jsx_parseElementName();return r&&(n.name=r),this.expect(u.jsxTagEnd),this.finishNode(n,r?`JSXClosingElement`:`JSXClosingFragment`)}jsx_parseElementAt(e,t){let n=this.startNodeAt(e,t),r=[],i=this.jsx_parseOpeningElementAt(e,t),a=null;if(!i.selfClosing){contents:for(;;)switch(this.type){case u.jsxTagStart:if(e=this.start,t=this.startLoc,this.next(),this.eat(l.slash)){a=this.jsx_parseClosingElementAt(e,t);break contents}r.push(this.jsx_parseElementAt(e,t));break;case u.jsxText:r.push(this.parseExprAtom());break;case l.braceL:r.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}s(a.name)!==s(i.name)&&this.raise(a.start,`Expected corresponding JSX closing tag for <`+s(i.name)+`>`)}let o=i.name?`Element`:`Fragment`;return n[`opening`+o]=i,n[`closing`+o]=a,n.children=r,this.type===l.relational&&this.value===`<`&&this.raise(this.start,`Adjacent JSX elements must be wrapped in an enclosing tag`),this.finishNode(n,`JSX`+o)}jsx_parseText(){let e=this.parseLiteral(this.value);return e.type=`JSXText`,e}jsx_parseElement(){let e=this.start,t=this.startLoc;return this.next(),this.jsx_parseElementAt(e,t)}parseExprAtom(e){return this.type===u.jsxText?this.jsx_parseText():this.type===u.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(e)}readToken(e){let t=this.curContext();if(t===m)return this.jsx_readToken();if(t===f||t===p){if(g(e))return this.jsx_readWord();if(e==62)return++this.pos,this.finishToken(u.jsxTagEnd);if((e===34||e===39)&&t==f)return this.jsx_readString(e)}return e===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33?(++this.pos,this.finishToken(u.jsxTagStart)):super.readToken(e)}updateContext(e){if(this.type==l.braceL){var t=this.curContext();t==f?this.context.push(d.b_expr):t==m?this.context.push(d.b_tmpl):super.updateContext(e),this.exprAllowed=!0}else if(this.type===l.slash&&e===u.jsxTagStart)this.context.length-=2,this.context.push(p),this.exprAllowed=!1;else return super.updateContext(e)}}}}));function Rl(e){return`\x1B[33m`+e+`\x1B[39m`}const zl={}.hasOwnProperty,Bl=Symbol(`continue`),Vl=Symbol(`exit`),Hl=Symbol(`skip`);function Ul(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return Gl(e)&&(s.displayName=`node (`+Rl(e.type)+`)`),s;function s(){let s=n?Wl(n(e,t,a,o)):[];if(s[0]===Vl)return s;if(s[0]!==Hl){let t;for(t in e)if(zl.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(Gl(r)){let e=i(r,t,a,n)();if(e[0]===Vl)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(Gl(r)){let e=i(r,t,void 0,n)();if(e[0]===Vl)return e}}}return r?Wl(r(e,t,a,o)):s}}}function Wl(e){return Array.isArray(e)?e:typeof e==`number`?[Bl,e]:[e]}function Gl(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function Kl(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=Jl(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&ql(m);if(g&&!t.allowEmpty)throw new U(`Unexpected empty expression`,{place:v(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{u=t.expression&&!g?t.acorn.parseExpressionAt(h,0,f):t.acorn.parse(h,f)}catch(e){let t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,l=t.raisedAt>=n.length+m.length||t.message===`Unterminated comment`}if(u&&t.expression&&!g)if(ql(h.slice(u.end,h.length-r.length)))u={type:`Program`,start:0,end:n.length+m.length,body:[{type:`ExpressionStatement`,expression:u,start:0,end:n.length+m.length}],sourceType:`module`,comments:[]};else{let e=v(u.end),t=Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,u=void 0}if(u){if(u.comments=a,Ul(u,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),_(e)}),Array.isArray(s))s.push(...a);else if(typeof s==`function`)for(let e of a)s(e.type===`Block`,e.value,e.start,e.end,e.loc.start,e.loc.end);for(let e of o)e.end<=n.length||e.start-n.length>=m.length||(_(e),Array.isArray(c)?c.push(e):c(e))}return{estree:u,error:d,swallow:l};function _(e){let t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>m.length&&(r=m.length);let i=Yl(p.stops,r);return i||={line:t.start.line,column:t.start.column,offset:t.start.offset},i}}function ql(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,``))}function Jl(e,t){let n={value:``,stops:[]},r=-1;for(;++r<e.length;){let i=e[r];if(i[0]===`enter`){let e=i[1].type;if(e===`lineEnding`||t.includes(e)){let e=i[2].sliceStream(i[1]);for(;e.length>0&&e[0]===-1;)e.shift();let t=Xl(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}function Yl(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;let[r,i]=e[n-1],a=t-r;return{line:i.line,column:i.column+a,offset:i.offset+a}}function Xl(e){let t=-1,n=[],r;for(;++t<e.length;){let i=e[t],a;if(typeof i==`string`)a=i;else switch(i){case-5:a=`\r`;break;case-4:a=`
|
|
66
|
-
`;break;case-3:a=`\r
|
|
67
|
-
`;break;case-2:a=` `;break;case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function Zl(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=Ql(n.start,r[0]||t.start),a=Ql(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function Ql(e,t){if(e&&typeof e==`object`){let n=`line`in e?$l(e.line):void 0,r=`column`in e?$l(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:$l(t)}}}function $l(e){return typeof e==`number`&&e>-1?e:void 0}const eu=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,tu=`#unexpected-type-in-code-expected-an-object-spread-spread`;function nu(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,h;return g;function g(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),_}function _(u){if(u===null){if(h)throw h;let e=new U("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=eu+`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,e}if(y(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),b;if(u===125&&p===0){let p=a?ru.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return h=p.message,e.enter(i),e.consume(u),v}return e.enter(i),v(u)}function v(t){return t===125&&p===0||t===null||y(t)?(e.exit(i),_(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),v)}function b(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new U("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=eu+`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,e}return x(t)?H(e,_,`linePrefix`,3)(t):_(t)}}function ru(e,t,n,r,i,a,o){let s=Kl(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=Zl(e),n=new U("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=eu+tu,n}if(e.expression.properties[1]){let t=new U(`Unexpected extra content in spread: only a single spread is supported`,{place:Zl(e.expression.properties[1]).start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw t.url=eu+`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,t}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=Zl(e.expression.properties[0]),n=new U("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=eu+tu,n}}if(s.error){let e=new U(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=eu+`#could-not-parse-expression-with-acorn`,{type:`nok`,message:e}}return{type:`ok`,estree:c}}function iu(e){let t=e||{},n=t.addResult,r=t.acorn,i=t.spread,a=t.allowEmpty,o;if(a??=!0,r){if(!r.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");o=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions)}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:`mdxFlowExpression`,tokenize:s,concrete:!0}},text:{123:{name:`mdxTextExpression`,tokenize:c}}};function s(e,t,s){let c=this;return l;function l(e){return u(e)}function u(t){return nu.call(c,e,d,`mdxFlowExpression`,`mdxFlowExpressionMarker`,`mdxFlowExpressionChunk`,r,o,n,i,a)(t)}function d(t){return x(t)?H(e,f,`whitespace`)(t):f(t)}function f(n){let r=c.parser.constructs.flow[60],i=(Array.isArray(r)?r:r?[r]:[]).find(function(e){return e.name===`mdxJsxFlowTag`});return n===60&&i?e.attempt(i,f,s)(n):n===null||y(n)?t(n):s(n)}}function c(e,t){let s=this;return c;function c(c){return nu.call(s,e,t,`mdxTextExpression`,`mdxTextExpressionMarker`,`mdxTextExpressionChunk`,r,o,n,i,a,!0)(c)}}}const au=/[$_\p{ID_Start}]/u,ou=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,su=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,cu={};function lu(e){return e?au.test(String.fromCodePoint(e)):!1}function uu(e,t){let n=(t||cu).jsx?su:ou;return e?n.test(String.fromCodePoint(e)):!1}const du=`https://github.com/micromark/micromark-extension-mdx-jsx`;function fu(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,S,w,T,E,D,O,k,A,ee,te,j,M,ne){let re=this,N,P;return ie;function ie(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),ae}function ae(e){return b(e)?n(e):(N=oe,I(e))}function oe(t){if(t===47)return e.enter(l),e.consume(t),e.exit(l),N=se,I;if(t===62)return De(t);if(t!==null&&t>=0&&lu(t))return e.enter(d),e.enter(f),e.consume(t),ce;L(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function se(t){if(t===62)return De(t);if(t!==null&&t>=0&&lu(t))return e.enter(d),e.enter(f),e.consume(t),ce;L(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function ce(t){if(t!==null&&t>=0&&uu(t,{jsx:!0}))return e.consume(t),ce;if(t===46||t===47||t===58||t===62||t===123||b(t)||C(t))return e.exit(f),N=le,I(t);L(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function le(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),N=ue,I;if(t===58)return e.enter(h),e.consume(t),e.exit(h),N=pe,I;if(t===47||t===62||t===123||t!==null&&t>=0&&lu(t))return e.exit(d),ge(t);L(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ue(t){if(t!==null&&t>=0&&lu(t))return e.enter(m),e.consume(t),de;L(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function de(t){if(t!==null&&t>=0&&uu(t,{jsx:!0}))return e.consume(t),de;if(t===46||t===47||t===62||t===123||b(t)||C(t))return e.exit(m),N=fe,I(t);L(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function fe(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),N=ue,I;if(t===47||t===62||t===123||t!==null&&t>=0&&lu(t))return e.exit(d),ge(t);L(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function pe(t){if(t!==null&&t>=0&&lu(t))return e.enter(g),e.consume(t),me;L(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function me(t){if(t!==null&&t>=0&&uu(t,{jsx:!0}))return e.consume(t),me;if(t===47||t===62||t===123||b(t)||C(t))return e.exit(g),N=he,I(t);L(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function he(t){if(t===47||t===62||t===123||t!==null&&t>=0&&lu(t))return e.exit(d),ge(t);L(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ge(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),N=F,I;if(t===62)return De(t);if(t===123)return nu.call(re,e,_e,_,v,S,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&lu(t))return e.enter(w),e.enter(T),e.enter(E),e.consume(t),ve;L(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function _e(e){return N=ge,I(e)}function ve(t){if(t!==null&&t>=0&&uu(t,{jsx:!0}))return e.consume(t),ve;if(t===47||t===58||t===61||t===62||t===123||b(t)||C(t))return e.exit(E),N=ye,I(t);L(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function ye(t){if(t===58)return e.enter(D),e.consume(t),e.exit(D),N=be,I;if(t===61)return e.exit(T),e.enter(k),e.consume(t),e.exit(k),N=Ce,I;if(t===47||t===62||t===123||b(t)||C(t)||t!==null&&t>=0&&lu(t))return e.exit(T),e.exit(w),N=ge,I(t);L(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function be(t){if(t!==null&&t>=0&&lu(t))return e.enter(O),e.consume(t),xe;L(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function xe(t){if(t!==null&&t>=0&&uu(t,{jsx:!0}))return e.consume(t),xe;if(t===47||t===61||t===62||t===123||b(t)||C(t))return e.exit(O),e.exit(T),N=Se,I(t);L(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function Se(t){if(t===61)return e.enter(k),e.consume(t),e.exit(k),N=Ce,I;if(t===47||t===62||t===123||t!==null&&t>=0&&lu(t))return e.exit(w),ge(t);L(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Ce(t){if(t===34||t===39)return e.enter(A),e.enter(ee),e.consume(t),e.exit(ee),P=t,Te;if(t===123)return nu.call(re,e,we,j,M,ne,r,i,a,!1,!1,o)(t);L(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function we(t){return e.exit(w),N=ge,I(t)}function Te(t){return t===null&&L(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(P)+"`"),t===P?(e.enter(ee),e.consume(t),e.exit(ee),e.exit(A),e.exit(w),P=void 0,N=ge,I):y(t)?(N=Te,I(t)):(e.enter(te),Ee(t))}function Ee(t){return t===null||t===P||y(t)?(e.exit(te),Te(t)):(e.consume(t),Ee)}function F(e){if(e===62)return De(e);L(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function De(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function I(t){return y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ke):x(t)||C(t)?(e.enter(`esWhitespace`),Oe(t)):N(t)}function Oe(t){return y(t)?(e.exit(`esWhitespace`),I(t)):x(t)||C(t)?(e.consume(t),Oe):(e.exit(`esWhitespace`),N(t))}function ke(e){if(!o&&re.parser.lazy[re.now().line]){let e=new U("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",re.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=du+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return I(e)}function L(e,t,n){let r=new U(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+pu(e)+`)`)+` `+t+`, expected `+n,re.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=du+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function pu(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function mu(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return fu.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function hu(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return fu.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return x(e)?H(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||y(e)?r(e):i(e)}}}function gu(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:hu(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:mu(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}function _u(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}const vu={tokenize:Su,partial:!0},yu=`https://github.com/micromark/micromark-extension-mdxjs-esm`,bu=new Set([`ExportAllDeclaration`,`ExportDefaultDeclaration`,`ExportNamedDeclaration`,`ImportDeclaration`]);function xu(e){let t={tokenize:i,concrete:!0};if(!e||!e.acorn||!e.acorn.parse)throw Error("Expected an `acorn` instance passed in as `options.acorn`");let n=e.acorn,r=Object.assign({ecmaVersion:2024,sourceType:`module`},e.acornOptions,{locations:!0});return{flow:{101:t,105:t}};function i(t,i,a){let o=this,s=o.parser.definedModuleSpecifiers||(o.parser.definedModuleSpecifiers=[]),c=this.events.length+1,l=``;return o.interrupt?a:u;function u(e){return o.now().column>1?a(e):(t.enter(`mdxjsEsm`),t.enter(`mdxjsEsmData`),t.consume(e),l+=String.fromCharCode(e),d)}function d(e){return f(e)?(t.consume(e),l+=String.fromCharCode(e),d):(l===`import`||l===`export`)&&e===32?(t.consume(e),p):a(e)}function p(e){return e===null||y(e)?(t.exit(`mdxjsEsmData`),m(e)):(t.consume(e),p)}function m(e){return e===null?g(e):y(e)?t.check(vu,g,h)(e):(t.enter(`mdxjsEsmData`),p(e))}function h(e){return t.enter(`lineEnding`),t.consume(e),t.exit(`lineEnding`),m}function g(a){let l=Kl(o.events.slice(c),{acorn:n,acornOptions:r,tokenTypes:[`mdxjsEsmData`],prefix:s.length>0?`var `+s.join(`,`)+`
|
|
68
|
-
`:``});if(l.error){if(a!==null&&l.swallow)return h(a);let e=new U(`Could not parse import/exports with acorn`,{cause:l.error,place:{line:l.error.loc.line,column:l.error.loc.column+1,offset:l.error.pos},ruleId:`acorn`,source:`micromark-extension-mdxjs-esm`});throw e.url=yu+`#could-not-parse-importexports-with-acorn`,e}s.length>0&&l.estree.body.shift();let u=-1;for(;++u<l.estree.body.length;){let e=l.estree.body[u];if(!bu.has(e.type)){let t=new U("Unexpected `"+e.type+"` in code: only import/exports are supported",{place:Zl(e),ruleId:`non-esm`,source:`micromark-extension-mdxjs-esm`});throw t.url=yu+`#unexpected-type-in-code-only-importexports-are-supported`,t}if(e.type===`ImportDeclaration`&&!o.interrupt){let t=-1;for(;++t<e.specifiers.length;){let n=e.specifiers[t];s.push(n.local.name)}}}return Object.assign(t.exit(`mdxjsEsm`),e.addResult?{estree:l.estree}:void 0),i(a)}}}function Su(e,t,n){return r;function r(r){return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),e.attempt(Kr,t,n)}}var Cu=e.dt(Ll(),1);function wu(e){let t=Object.assign({acorn:hc.extend((0,Cu.default)()),acornOptions:{ecmaVersion:2024,sourceType:`module`},addResult:!0},e);return fr([xu(t),iu(t),gu(t),_u()])}const Tu={};function Eu(e){let t=this,n=e||Tu,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(wu(n)),a.push(ls()),o.push(us(n))}const Du={tokenize:Ou};function Ou(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),H(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return y(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}const ku={tokenize:ju},Au={tokenize:Mu};function ju(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return lr(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Au,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Au,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return y(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;lr(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Mu(e,t,n){return H(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}const Nu={tokenize:Pu};function Pu(e){let t=this,n=e.attempt(Kr,r,e.attempt(this.parser.constructs.flowInitial,i,H(e,e.attempt(this.parser.constructs.flow,i,e.attempt(vi,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}const Fu={resolveAll:zu()},Iu=Ru(`string`),Lu=Ru(`text`);function Ru(e){return{resolveAll:zu(e===`text`?Bu:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function zu(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Bu(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Vu=e.ut({attentionMarkers:()=>Yu,contentInitial:()=>Uu,disable:()=>Xu,document:()=>Hu,flow:()=>Gu,flowInitial:()=>Wu,insideSpan:()=>Ju,string:()=>Ku,text:()=>qu});const Hu={42:da,43:da,45:da,48:da,49:da,50:da,51:da,52:da,53:da,54:da,55:da,56:da,57:da,62:Jr},Uu={91:Di},Wu={[-2]:oi,[-1]:oi,32:oi},Gu={35:Ni,42:la,45:[ya,la],60:Ri,61:ya,95:la,96:ri,126:ri},Ku={38:ei,92:Qr},qu={[-5]:sa,[-4]:sa,[-3]:sa,33:ra,38:ei,42:Br,60:[Wr,Gi],91:aa,92:[ji,Qr],93:qi,95:Br,96:ui},Ju={null:[Br,Fu]},Yu={null:[42,95]},Xu={null:[]};function Zu(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:w(S),check:w(C),consume:v,enter:b,exit:x,interrupt:w(C,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=ur(o,e),g(),o[o.length-1]===null?(T(t,0),l.events=zr(a,l.events,l),l.events):[]}function f(e,t){return $u(p(e),t)}function p(e){return Qu(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,D()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){y(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,D()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function b(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function x(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function S(e,t){T(e,t.from)}function C(e,t){t.restore()}function w(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=E(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function T(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&lr(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function E(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,D()}}function D(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Qu(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function $u(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
69
|
-
`;break;case-3:o=`\r
|
|
70
|
-
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function ed(e){let t={constructs:fr([Vu,...(e||{}).extensions||[]]),content:n(Du),defined:[],document:n(ku),flow:n(Nu),lazy:{},string:n(Iu),text:n(Lu)};return t;function n(e){return n;function n(n){return Zu(t,e,n)}}}function td(e){for(;!gi(e););return e}const nd=/[\0\t\n\r]/g;function rd(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(nd.lastIndex=u,c=nd.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}const id={}.hasOwnProperty;function ad(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),od(n)(td(ed(n).document().write(rd()(e,t,!0))))}function od(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(be),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ge),blockQuote:a(de),characterEscape:T,characterReference:T,codeFenced:a(fe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(fe,o),codeText:a(pe,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(me),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(he),hardBreakEscape:a(_e),hardBreakTrailing:a(_e),htmlFlow:a(ve,o),htmlFlowData:T,htmlText:a(ve,o),htmlTextData:T,image:a(ye),label:o,link:a(be),listItem:a(Se),listItemValue:f,listOrdered:a(xe,d),listUnordered:a(xe),paragraph:a(Ce),reference:ie,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ge),strong:a(we),thematicBreak:a(Ee)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ue,autolinkProtocol:le,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:se,characterReference:ce,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ee),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(j),label:ne,labelText:M,lineEnding:D,link:c(te),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ae,resourceDestinationString:re,resourceTitleString:N,resource:P,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};cd(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];id.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||ud).call(a,void 0,e[0])}for(r.position={start:sd(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:sd(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:sd(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||ud).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+$a({start:e.start,end:e.end})+`): it’s not open`);n.position.end=sd(e.end)}function u(){return It(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Be(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Te(),n.position={start:sd(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=sd(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=sd(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function j(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Dn(t),n.identifier=Be(t).toLowerCase()}function ne(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function N(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function P(){this.data.inReference=void 0}function ie(){this.data.referenceType=`collapsed`}function ae(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Be(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function oe(e){this.data.characterReferenceType=e.type}function se(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Tn(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=wn(t);let i=this.stack[this.stack.length-1];i.value+=r}function ce(e){let t=this.stack.pop();t.position.end=sd(e.end)}function le(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ue(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function de(){return{type:`blockquote`,children:[]}}function fe(){return{type:`code`,lang:null,meta:null,value:``}}function pe(){return{type:`inlineCode`,value:``}}function me(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function he(){return{type:`emphasis`,children:[]}}function ge(){return{type:`heading`,depth:0,children:[]}}function _e(){return{type:`break`}}function ve(){return{type:`html`,value:``}}function ye(){return{type:`image`,title:null,url:``,alt:null}}function be(){return{type:`link`,title:null,url:``,children:[]}}function xe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Se(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Ce(){return{type:`paragraph`,children:[]}}function we(){return{type:`strong`,children:[]}}function Te(){return{type:`text`,value:``}}function Ee(){return{type:`thematicBreak`}}}function sd(e){return{line:e.line,column:e.column,offset:e.offset}}function cd(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?cd(e,r):ld(e,r)}}function ld(e,t){let n;for(n in t)if(id.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function ud(e,t){throw e?Error("Cannot close `"+e.type+"` ("+$a({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+$a({start:t.start,end:t.end})+`) is open`):Error("Cannot close document, a token (`"+t.type+"`, "+$a({start:t.start,end:t.end})+`) is still open`)}function dd(e){let t=this;t.parser=n;function n(n){return ad(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function fd(e){return mo().use(dd).use(qa).use(de,[`yaml`]).use(Eu).parse(e)}let pd=null;try{let e=(0,o.createRequire)(e(`url`).pathToFileURL(__filename).href),{platform:n,arch:r}=t.default,i={"win32-x64":[`napi-md-compiler.win32-x64-msvc`,`win32-x64-msvc`],"linux-x64":[`napi-md-compiler.linux-x64-gnu`,`linux-x64-gnu`],"linux-arm64":[`napi-md-compiler.linux-arm64-gnu`,`linux-arm64-gnu`],"darwin-arm64":[`napi-md-compiler.darwin-arm64`,`darwin-arm64`],"darwin-x64":[`napi-md-compiler.darwin-x64`,`darwin-x64`]}[`${n}-${r}`];if(i!=null){let[t,n]=i;try{pd=e(`../${t}.node`)}catch{try{pd=e(`@truenine/memory-sync-cli-${n}`).mdCompiler}catch{}}}}catch{}function md(e,t){if(pd!=null&&t==null)return pd.buildFrontMatter(JSON.stringify(e));let n=Object.fromEntries(Object.entries(e).filter(([e,t])=>t!=null));return Object.keys(n).length===0?`---
|
|
71
|
-
---`:`---\n${s.stringify(n,{singleQuote:t?.singleQuote??!1,lineWidth:t?.lineWidth??0}).trimEnd()}\n---`}function hd(e,t,n){return pd!=null&&n==null?e==null||Object.keys(e).length===0?t:pd.buildMarkdownWithFrontMatter(JSON.stringify(e),t):e==null||Object.keys(e).length===0?t:`${md(e,n)}\n${t}`}function gd(e){let t=new s.Scalar(e);return t.type=s.Scalar.QUOTE_DOUBLE,t}function _d(e){if(pd!=null){let t=pd.parseMarkdown(e),n=t.yamlFrontMatterJson==null?void 0:JSON.parse(t.yamlFrontMatterJson),r=fd(e),i=[];for(let e of r.children)e.type!==`yaml`&&i.push(e);return{...n!=null&&{yamlFrontMatter:n},...t.rawFrontMatter!=null&&{rawFrontMatter:t.rawFrontMatter},markdownAst:r,markdownContents:i,contentWithoutFrontMatter:t.contentWithoutFrontMatter}}let t=fd(e),n,r,i=[];for(let e of t.children)if(e.type===`yaml`){r=e.value;try{n=s.parse(e.value??``)}catch{}}else i.push(e);let a=e;return r!=null&&(a=e.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/,``)),{...n!=null&&{yamlFrontMatter:n},...r!=null&&{rawFrontMatter:r},markdownAst:t,markdownContents:i,contentWithoutFrontMatter:a}}function vd(e){return pd==null?e.replaceAll(/(!?\[)([^\]]*)(\]\()([^)]+)(\))/g,(e,t,n,r,i,a)=>{let o=n.replaceAll(/\.mdx$/g,`.md`).replaceAll(/\.mdx(?=#|\?|$)/g,`.md`);return/^(?:https?:)?\/\//.test(i)?`${t}${o}${r}${i}${a}`:`${t}${o}${r}${i.replace(/\.mdx$/,`.md`).replace(/\.mdx#/,`.md#`).replace(/\.mdx\?/,`.md?`)}${a}`}):pd.transformMdxReferencesToMd(e)}var yd=class extends e.ot{inputEffects=[];registeredScopes=[];constructor(t,n){super(t,e.nt.Input,n)}registerEffect(e,t,n=0){this.inputEffects.push({name:e,handler:t,priority:n}),this.inputEffects.sort((e,t)=>(e.priority??0)-(t.priority??0))}async executeEffects(e,t=!1){let n=[];if(this.inputEffects.length===0)return n;let{workspaceDir:r,aindexDir:a}=this.resolveBasePaths(e.userConfigOptions),o={logger:this.log,fs:e.fs,path:e.path,glob:e.glob,spawn:i.spawn,userConfigOptions:e.userConfigOptions,workspaceDir:r,aindexDir:a,dryRun:t};for(let e of this.inputEffects){if(t){this.log.trace({action:`dryRun`,type:`inputEffect`,name:e.name}),n.push({success:!0,description:`Would execute input effect: ${e.name}`});continue}try{let t=await e.handler(o);if(t.success)this.log.trace({action:`inputEffect`,name:e.name,status:`success`,description:t.description}),t.modifiedFiles!=null&&t.modifiedFiles.length>0&&this.log.debug({action:`inputEffect`,name:e.name,modifiedFiles:t.modifiedFiles}),t.deletedFiles!=null&&t.deletedFiles.length>0&&this.log.debug({action:`inputEffect`,name:e.name,deletedFiles:t.deletedFiles});else{let n=t.error instanceof Error?t.error.message:String(t.error);this.log.error({action:`inputEffect`,name:e.name,status:`failed`,error:n})}n.push(t)}catch(t){let r=t instanceof Error?t.message:String(t);this.log.error({action:`inputEffect`,name:e.name,status:`failed`,error:r}),n.push({success:!1,error:t,description:`Input effect failed: ${e.name}`})}}return n}hasEffects(){return this.inputEffects.length>0}getEffectCount(){return this.inputEffects.length}registerScope(e,t){this.registeredScopes.push({namespace:e,values:t}),this.log.debug({action:`registerScope`,namespace:e,keys:Object.keys(t)})}getRegisteredScopes(){return this.registeredScopes}clearRegisteredScopes(){this.registeredScopes.length=0,this.log.debug({action:`clearRegisteredScopes`})}resolveBasePaths(e){let t=e.workspaceDir,n=this.resolvePath(t,``),i=e.aindex?.dir??`aindex`;return{workspaceDir:n,aindexDir:r.join(n,i)}}resolvePath(t,n){let i=t;return i.startsWith(e.at.USER_HOME)&&(i=i.replace(e.at.USER_HOME,a.homedir())),i.includes(e.at.WORKSPACE)&&(i=i.replace(e.at.WORKSPACE,n)),r.normalize(i)}resolveAindexPath(e,t){return r.join(t,e)}readAndParseMarkdown(e,t){return _d(t.readFileSync(e,`utf8`))}},bd=class extends Error{constructor(e,t,n){super(e),this.expression=t,this.filePath=n,this.name=`ScopeError`}},xd=class extends bd{constructor(e,t,n){let r=n!=null&&n.length>0?`Undefined variable "${e}" in expression "${t}" (file: ${n})`:`Undefined variable "${e}" in expression "${t}"`;super(r,t,n),this.variableName=e,this.name=`UndefinedVariableError`}},Sd=class extends bd{constructor(e,t,n){let r=n!=null&&n.length>0?`Undefined namespace "${e}" in expression "${t}" (file: ${n})`:`Undefined namespace "${e}" in expression "${t}"`;super(r,t,n),this.namespace=e,this.name=`UndefinedNamespaceError`}},Cd=class extends Error{constructor(e,t){let n=t!=null&&t.length>0?`Missing required metadata fields: ${e.join(`, `)} (file: ${t})`:`Missing required metadata fields: ${e.join(`, `)}`;super(n),this.missingFields=e,this.filePath=t,this.name=`MetadataValidationError`}},wd=Object.defineProperty,Td=(e,t)=>{let n={};for(var r in e)wd(n,r,{get:e[r],enumerable:!0});return t||wd(n,Symbol.toStringTag,{value:`Module`}),n};const Ed=new Map;function Dd(e,t){Ed.set(e,t)}function Od(){return new Map(Ed)}function kd(e){return Ed.has(e)}function Ad(e,t,n){let r=e.trim();return r===``?``:/^[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*$/i.test(r)?jd(r,t,n?.filePath):Md(r,t,n?.filePath)}function jd(e,t,n){let r=e.split(`.`),i=r[0];if(i==null||!(i in t))throw new Sd(i??``,e,n);let a=t[i];for(let t=1;t<r.length;t++){let i=r[t];if(i==null)continue;if(a==null)throw new xd(i,e,n);if(typeof a!=`object`)throw TypeError(`Cannot read property "${i}" of ${typeof a} in expression "${e}"`);let o=a;if(!(i in o))throw new xd(i,e,n);a=o[i]}return Nd(a)}function Md(e,t,n){let r=Object.keys(t),i=r.map(e=>t[e]);try{return Nd(Function(...r,`return (${e})`)(...i))}catch(t){let r=t instanceof Error?t.message:String(t);if(r.includes(`is not defined`)){let t=/(\w+) is not defined/.exec(r);if(t?.[1]!=null)throw new Sd(t[1],e,n)}let i=n==null?``:` (file: ${n})`;throw Error(`Failed to evaluate expression: "${e}"${i}\nCause: ${r}`)}}function Nd(e){if(e==null)return``;if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`)return String(e);if(typeof e==`object`)try{return JSON.stringify(e)}catch{return String(e)}return String(e)}function Pd(e,t){return e===null?!1:t.components.has(e)||kd(e)}async function Fd(e){return async(t,n)=>(await e({type:`root`,children:t},n)).children}async function Id(e,t,n){let r=e.name;if(r==null||r===``)return[];let i=t.components.get(r);if(i==null)return[];if(t.processingStack.includes(r)){let e=[...t.processingStack,r].join(` → `);throw Error(`Circular dependency detected: ${e}`)}let a={scope:t.scope,components:t.components,processingStack:[...t.processingStack,r],...t.basePath==null?{}:{basePath:t.basePath}},o=await Fd(n);try{return await i(e,a,o)}catch(e){let n=e instanceof Error?e.message:String(e),i=t.processingStack.join(` → `);throw Error(`Failed to process component "${r}"${i===``?``:` (called from: ${i})`}:\n${n}`,{cause:e})}}function Ld(e,t){let n=e.name?.toLowerCase();if(n==null)return null;switch(n){case`pre`:return Bd(e,t);case`a`:return Vd(e,t);case`strong`:case`b`:return Hd(e,t);case`em`:case`i`:return Ud(e,t);case`img`:return Wd(e,t);case`blockquote`:return Gd(e,t);default:return null}}function Rd(e,t,n){let r=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return r==null?null:typeof r.value==`string`?r.value:r.value!=null&&typeof r.value==`object`&&r.value.type===`mdxJsxAttributeValueExpression`?Ad(r.value.value,n.scope):r.value===null?``:null}function zd(e,t){let n=``;for(let r of e.children)r.type===`text`?n+=r.value:r.type===`mdxTextExpression`?n+=Ad(r.value,t.scope):(r.type===`mdxJsxFlowElement`||r.type===`mdxJsxTextElement`)&&(n+=zd(r,t));return n}function Bd(e,t){let n=null;for(let t of e.children){if((t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)&&t.name?.toLowerCase()===`code`){n=t;break}if(t.type===`paragraph`&&`children`in t){let e=t.children;for(let t of e)if((t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)&&t.name?.toLowerCase()===`code`){n=t;break}if(n!=null)break}}if(n==null)return null;let r=Rd(n,`className`,t)??``,i=/language-(\w+)/.exec(r)?.[1],a=zd(n,t);return[{type:`code`,lang:i??null,value:a.trim()}]}function Vd(e,t){let n=Rd(e,`href`,t);if(n==null||n===``)return null;let r=zd(e,t);return[{type:`paragraph`,children:[{type:`link`,url:n,title:Rd(e,`title`,t)??null,children:[{type:`text`,value:r}]}]}]}function Hd(e,t){let n={type:`strong`,children:[{type:`text`,value:zd(e,t)}]};return e.type,[{type:`paragraph`,children:[n]}]}function Ud(e,t){let n={type:`emphasis`,children:[{type:`text`,value:zd(e,t)}]};return e.type,[{type:`paragraph`,children:[n]}]}function Wd(e,t){let n=Rd(e,`src`,t);if(n==null||n===``)return null;let r={type:`image`,url:n,alt:Rd(e,`alt`,t)??``,title:Rd(e,`title`,t)??null};return e.type,[{type:`paragraph`,children:[r]}]}function Gd(e,t){return[{type:`blockquote`,children:[{type:`paragraph`,children:[{type:`text`,value:zd(e,t)}]}]}]}function Kd(e){return e==null?!1:JSON.stringify(e).includes(`"JSX`)}async function qd(e,t,n){let r=e.data?.estree;if(r==null||r.body.length===0)return[];let i=r.body[0];return i?.type===`ExpressionStatement`?Jd(i.expression,t,n):[]}async function Jd(e,t,n){return e.type===`JSXElement`?ef(e,t,n):e.type===`JSXFragment`?tf(e,t,n):e.type===`LogicalExpression`?Yd(e,t,n):e.type===`ConditionalExpression`?Xd(e,t,n):e.type===`SequenceExpression`?Zd(e,t,n):e.type===`ArrayExpression`?Qd(e,t,n):uf(e,t)}async function Yd(e,t,n){let r=await $d(e.left,t,n);return e.operator===`&&`?cf(r)?Jd(e.right,t,n):[]:e.operator===`||`?cf(r)?sf(e.left)?Jd(e.left,t,n):lf(r):Jd(e.right,t,n):e.operator===`??`?r==null?Jd(e.right,t,n):sf(e.left)?Jd(e.left,t,n):lf(r):[]}async function Xd(e,t,n){return cf(await $d(e.test,t,n))?Jd(e.consequent,t,n):Jd(e.alternate,t,n)}async function Zd(e,t,n){let r=[];for(let i of e.expressions){let e=await Jd(i,t,n);r.push(...e)}return r}async function Qd(e,t,n){let r=[];for(let i of e.elements)if(i!=null)if(i.type===`SpreadElement`){let e=await Jd(i.argument,t,n);r.push(...e)}else{let e=await Jd(i,t,n);r.push(...e)}return r}async function $d(e,t,n){if(sf(e))return!0;if(e.type===`Literal`)return e.value;if(e.type===`Identifier`)return e.name===`undefined`?void 0:e.name===`NaN`?NaN:e.name===`Infinity`?1/0:t.scope[e.name];if(e.type===`UnaryExpression`){let r=await $d(e.argument,t,n);return e.operator===`!`?!cf(r):e.operator===`-`?-r:e.operator===`+`?+r:e.operator===`typeof`?typeof r:void 0}if(e.type===`BinaryExpression`){let r=await $d(e.left,t,n),i=await $d(e.right,t,n);return e.operator===`===`?r===i:e.operator===`!==`?r!==i:e.operator===`==`?r===i:e.operator===`!=`?r!==i:e.operator===`<`?r<i:e.operator===`<=`?r<=i:e.operator===`>`?r>i:e.operator===`>=`?r>=i:e.operator===`+`?r+i:e.operator===`-`?r-i:e.operator===`*`?r*i:e.operator===`/`?r/i:e.operator===`%`?r%i:void 0}if(e.type===`LogicalExpression`){let r=await $d(e.left,t,n);return e.operator===`&&`?cf(r)?$d(e.right,t,n):r:e.operator===`||`?cf(r)?r:$d(e.right,t,n):e.operator===`??`?r??$d(e.right,t,n):void 0}if(e.type===`MemberExpression`){let r=await $d(e.object,t,n);if(r==null)return;if(e.computed)return r[await $d(e.property,t,n)];let{name:i}=e.property;return r[i]}if(e.type===`ConditionalExpression`)return cf(await $d(e.test,t,n))?$d(e.consequent,t,n):$d(e.alternate,t,n);let r=Q(e);if(r!==``)try{let e=Ad(r,t.scope);return e===`true`?!0:e===`false`?!1:e===`null`?null:e===`undefined`||e===``?void 0:/^-?\d+(?:\.\d+)?$/.test(e)?Number(e):e}catch{return}}async function ef(e,t,n){let r=rf(e,t);if(r.name!=null&&Pd(r.name,t)){let{processAst:e}=await Promise.resolve().then(()=>df);return Id(r,t,e)}return Ld(r,t)??(r.children.length>0?n(r.children,t):[])}async function tf(e,t,n){let r=[];for(let i of e.children){let e=await nf(i,t,n);r.push(...e)}return r}async function nf(e,t,n){if(e.type===`JSXElement`)return ef(e,t,n);if(e.type===`JSXFragment`)return tf(e,t,n);if(e.type===`JSXText`){let t=e.value.trim();return t===``?[]:[{type:`paragraph`,children:[{type:`text`,value:t}]}]}return e.type===`JSXExpressionContainer`?e.expression.type===`JSXEmptyExpression`?[]:Jd(e.expression,t,n):e.type===`JSXSpreadChild`?Jd(e.expression,t,n):[]}function rf(e,t){let n=e.openingElement,r=null;n.name.type===`JSXIdentifier`?{name:r}=n.name:n.name.type===`JSXMemberExpression`?r=af(n.name):n.name.type===`JSXNamespacedName`&&(r=`${n.name.namespace.name}:${n.name.name.name}`);let i=[];for(let e of n.attributes)if(e.type===`JSXAttribute`){let t=e.name.type===`JSXIdentifier`?e.name.name:`${e.name.namespace.name}:${e.name.name.name}`,n=null;e.value==null?n=null:e.value.type===`Literal`?n=String(e.value.value):e.value.type===`JSXExpressionContainer`&&e.value.expression.type!==`JSXEmptyExpression`&&(n={type:`mdxJsxAttributeValueExpression`,value:Q(e.value.expression)}),i.push({type:`mdxJsxAttribute`,name:t,value:n})}else e.type===`JSXSpreadAttribute`&&i.push({type:`mdxJsxExpressionAttribute`,value:`...${Q(e.argument)}`});let a=[];for(let n of e.children){let e=of(n,t);e!=null&&a.push(...e)}return{type:`mdxJsxFlowElement`,name:r,attributes:i,children:a}}function af(e){return e.object.type===`JSXIdentifier`?`${e.object.name}.${e.property.name}`:`${af(e.object)}.${e.property.name}`}function of(e,t){if(e.type===`JSXText`){let{value:t}=e;return t.trim()===``?null:[{type:`paragraph`,children:[{type:`text`,value:t}]}]}if(e.type===`JSXElement`)return[rf(e,t)];if(e.type===`JSXFragment`){let n=[];for(let r of e.children){let e=of(r,t);e!=null&&n.push(...e)}return n}return e.type===`JSXExpressionContainer`?e.expression.type===`JSXEmptyExpression`?null:[{type:`paragraph`,children:[{type:`text`,value:Q(e.expression)}]}]:e.type===`JSXSpreadChild`?[{type:`paragraph`,children:[{type:`text`,value:`...${Q(e.expression)}`}]}]:null}function Q(e){if(e.type===`Identifier`)return e.name;if(e.type===`Literal`)return typeof e.value==`string`?JSON.stringify(e.value):String(e.value);if(e.type===`MemberExpression`){let t=Q(e.object);return e.computed?`${t}[${Q(e.property)}]`:`${t}.${e.property.name}`}if(e.type===`CallExpression`)return`${Q(e.callee)}(${e.arguments.map(e=>Q(e)).join(`, `)})`;if(e.type===`BinaryExpression`||e.type===`LogicalExpression`){let t=Q(e.left),n=Q(e.right);return`(${t} ${e.operator} ${n})`}if(e.type===`UnaryExpression`){let t=Q(e.argument);return`${e.operator}${t}`}if(e.type===`ConditionalExpression`)return`(${Q(e.test)} ? ${Q(e.consequent)} : ${Q(e.alternate)})`;if(e.type===`ArrayExpression`)return`[${e.elements.filter(e=>e!=null&&e.type!==`SpreadElement`).map(e=>Q(e)).join(`, `)}]`;if(e.type===`ObjectExpression`)return`{${e.properties.filter(e=>e.type===`Property`).map(e=>`${e.key.type===`Identifier`?e.key.name:Q(e.key)}: ${Q(e.value)}`).join(`, `)}}`;if(e.type===`TemplateLiteral`){let t="`";for(let n=0;n<e.quasis.length;n++)t+=e.quasis[n]?.value.raw??``,n<e.expressions.length&&(t+=`\${${Q(e.expressions[n])}}`);return t+="`",t}return e.type===`SpreadElement`?`...${Q(e.argument)}`:``}function sf(e){return e.type===`JSXElement`||e.type===`JSXFragment`}function cf(e){return!!e}function lf(e){if(e==null)return[];let t=typeof e==`string`?e:String(e);return t===``||t===`undefined`||t===`null`?[]:[{type:`paragraph`,children:[{type:`text`,value:t}]}]}function uf(e,t){let n=Q(e);if(n===``)return[];try{return lf(Ad(n,t.scope))}catch{return[]}}var df=Td({processAst:()=>pf});function ff(e){if(!(e.includes(`/`)&&/\.\w+$/.test(e)))return e;let t=e.lastIndexOf(`/`);return e.slice(t+1)}async function pf(e,t){return mf(e,t)}async function mf(e,t){let n=[];for(let r of e.children){let e=await hf(r,t);n.push(...e)}return{type:`root`,children:n}}async function hf(e,t){if(e.type===`mdxjsEsm`)return[];if(e.type===`mdxFlowExpression`){let n=e,r=n.data?.estree,i=n.value.trim();if(i.startsWith(`/*`)&&i.endsWith(`*/`))return[];if(Kd(r))return qd(n,t,async(e,t)=>(await pf({type:`root`,children:e},t)).children);let a=Ad(n.value,t.scope);return a===``?[]:[{type:`paragraph`,children:[{type:`text`,value:a}]}]}if(e.type===`mdxJsxFlowElement`)return gf(e,t);if(e.type===`link`){let n=e,r=(await _f(n.children,t)).map(e=>e.type===`text`?{...e,value:ff(e.value)}:e);return[{...n,children:r}]}if(!(`children`in e&&Array.isArray(e.children)))return[e];let n=await _f(e.children,t);return[{...e,children:n}]}async function gf(e,t){return e.name!=null&&Pd(e.name,t)?Id(e,t,pf):Ld(e,t)??[]}async function _f(e,t){let n=[];for(let r of e){if(r.type===`mdxFlowExpression`){let e=r,i=e.data?.estree,a=e.value.trim();if(a.startsWith(`/*`)&&a.endsWith(`*/`))continue;if(Kd(i)){let r=await qd(e,t,async(e,t)=>(await pf({type:`root`,children:e},t)).children);for(let e of r)n.push(e);continue}let o=Ad(e.value,t.scope);o!==``&&n.push({type:`paragraph`,children:[{type:`text`,value:o}]});continue}if(r.type===`mdxTextExpression`){let e=r,i=e.value.trim();if(i.startsWith(`/*`)&&i.endsWith(`*/`))continue;let a={type:`text`,value:Ad(e.value,t.scope)};n.push(a);continue}if(r.type===`mdxJsxTextElement`){let e=r;if(e.name!=null&&Pd(e.name,t)){let r=await Id(e,t,pf);for(let e of r)e.type===`paragraph`&&`children`in e?n.push(...e.children):n.push(e);continue}let i=Ld(e,t);if(i!=null)for(let e of i)e.type===`paragraph`&&`children`in e?n.push(...e.children):n.push(e);continue}if(`children`in r&&Array.isArray(r.children)){let e=await _f(r.children,t);if(r.type===`link`){let t=e.map(e=>e.type===`text`?{...e,value:ff(e.value)}:e);n.push({...r,children:t});continue}n.push({...r,children:e});continue}n.push(r)}return n}function vf(e){let t=this;t.compiler=n;function n(n){return Bn(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}function yf(e,t={}){let n={},{yamlFrontMatter:r,scope:i,filePath:a}=t;for(let t of e){let e=bf(t,i,a);Object.assign(n,e)}let o=Object.keys(n).length>0,s=r!=null&&Object.keys(r).length>0,c;return c=o&&s?`mixed`:o?`export`:`yaml`,{fields:{...r,...n},source:c}}function bf(e,t,n){let r={},i=e.value.trim(),a=/^export\s+default\s+/.exec(i);if(a!=null){let e=a[0].length,o=xf(i,e);if(o!=null)try{let e=Sf(o.trim(),t,n);typeof e==`object`&&e&&!Array.isArray(e)&&Object.assign(r,e)}catch(e){let t=e instanceof Error?e.message:String(e),r=n==null?``:` in file "${n}"`;throw Error(`Cannot statically evaluate export default${r}: ${t}`)}return r}let o=/export\s+const\s+(\w+)\s*=\s*/g,s=o.exec(i);for(;s!==null;){let e=s[1];if(e==null){s=o.exec(i);continue}let a=xf(i,s.index+s[0].length);if(a==null){s=o.exec(i);continue}try{let i=Sf(a.trim(),t,n);e===`metadata`&&typeof i==`object`&&i&&!Array.isArray(i)?Object.assign(r,i):r[e]=i}catch(t){let r=t instanceof Error?t.message:String(t),i=n==null?``:` in file "${n}"`;throw Error(`Cannot statically evaluate export "${e}"${i}: ${r}`)}s=o.exec(i)}return r}function xf(e,t){let n=0,r=null,i=!1,a=t;for(let o=t;o<e.length;o++){let t=e[o];if(i){i=!1;continue}if(t===`\\`){i=!0;continue}if(r!=null){t===r&&(r=null);continue}if(t===`"`||t===`'`||t==="`"){r=t;continue}if(t===`{`||t===`[`){n++;continue}if(t===`}`||t===`]`){n--;continue}if(n===0){if(t===`;`||t===`
|
|
72
|
-
`){a=o;break}if(t===`/`&&o+1<e.length&&e[o+1]===`/`){a=o;break}}o===e.length-1&&(a=e.length)}a<=t&&(a=e.length);let o=e.slice(t,a).trim();return o.endsWith(`;`)?o.slice(0,-1).trim():o}function Sf(e,t,n){let r=e.trim();if(r===``)throw Error(`Empty value cannot be evaluated`);if(r===`true`)return!0;if(r===`false`)return!1;if(r===`null`)return null;if(/^-?\d+(?:\.\d+)?$/.test(r))return Number(r);if(r.startsWith(`"`)&&r.endsWith(`"`))return Cf(r.slice(1,-1),`"`);if(r.startsWith(`'`)&&r.endsWith(`'`))return Cf(r.slice(1,-1),`'`);if(r.startsWith("`")&&r.endsWith("`")){let e=r.slice(1,-1);if(e.includes("${"))throw Error(`Template literal with expressions cannot be statically evaluated: ${r}`);return Cf(e,"`")}if(r.startsWith(`[`)&&r.endsWith(`]`))return Tf(r,t,n);if(r.startsWith(`{`)&&r.endsWith(`}`))return Ef(r,t,n);if(/^[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*$/i.test(r))return wf(r,t,n);let i=n==null?``:` in file "${n}"`;throw Error(`Expression "${r}" cannot be statically evaluated${i}`)}function Cf(e,t){return e.replaceAll(`\\n`,`
|
|
73
|
-
`).replaceAll(`\\r`,`\r`).replaceAll(`\\t`,` `).replaceAll(`\\"`,`"`).replaceAll(`\\'`,`'`).replaceAll(`\\\\`,`\\`)}function wf(e,t,n){if(t==null){let t=n==null?``:` in file "${n}"`;throw Error(`Variable reference "${e}" cannot be resolved without scope${t}`)}let r=e.split(`.`),i=r[0];if(i==null||!(i in t)){let r=n==null?``:` in file "${n}"`,a=Object.keys(t).join(`, `);throw Error(`Undefined namespace "${i}" in expression "${e}"${r}. Available: ${a}`)}let a=t[i];for(let t=1;t<r.length;t++){let i=r[t];if(i==null)continue;if(a==null){let t=n==null?``:` in file "${n}"`;throw Error(`Cannot read property "${i}" of null/undefined in "${e}"${t}`)}if(typeof a!=`object`){let t=n==null?``:` in file "${n}"`;throw Error(`Cannot read property "${i}" of ${typeof a} in "${e}"${t}`)}let o=a;if(!(i in o)){let t=n==null?``:` in file "${n}"`,r=Object.keys(o).join(`, `);throw Error(`Undefined property "${i}" in "${e}"${t}. Available: ${r}`)}a=o[i]}if(typeof a==`string`||typeof a==`number`||typeof a==`boolean`||a===null||Array.isArray(a)||typeof a==`object`)return a;let o=n==null?``:` in file "${n}"`;throw Error(`Variable "${e}" resolved to unsupported type: ${typeof a}${o}`)}function Tf(e,t,n){let r=e.slice(1,-1).trim();if(r===``)return[];if(t==null)try{let t=Df(e),n=JSON.parse(t);if(Array.isArray(n))return n}catch{}return Of(r).map(e=>Sf(e.trim(),t,n))}function Ef(e,t,n){let r=e.slice(1,-1).trim();if(r===``)return{};if(t==null)try{let t=Df(e),n=JSON.parse(t);if(typeof n==`object`&&n&&!Array.isArray(n))return n}catch{}let i={},a=kf(r);for(let e of a){let r=Af(e);if(r===-1)continue;let a=e.slice(0,r).trim(),o=e.slice(r+1).trim();(a.startsWith(`"`)&&a.endsWith(`"`)||a.startsWith(`'`)&&a.endsWith(`'`))&&(a=a.slice(1,-1)),i[a]=Sf(o,t,n)}return i}function Df(e){let t=``,n=null,r=!1;for(let i=0;i<e.length;i++){let a=e[i];if(r){t+=a,r=!1;continue}if(a===`\\`){t+=a,r=!0;continue}if(n!=null){a===n?(t+=`"`,n=null):a===`"`&&n===`'`?t+=`\\"`:t+=a;continue}if(a===`"`||a===`'`){t+=`"`,n=a;continue}if(a===`:`&&i>0){let e=t.length-1;for(;e>=0&&/\s/.test(t.charAt(e));)e--;let n=e+1;for(;e>=0&&/[\w$]/.test(t.charAt(e));)e--;if(e++,e>0&&t.charAt(e-1)!==`"`){let r=t.slice(e,n);r.length>0&&/^[\w$]+$/.test(r)&&(t=`${t.slice(0,e)}"${r}"`)}}t+=a}return t}function Of(e){let t=[],n=``,r=0,i=null,a=!1;for(let o of e){if(a){n+=o,a=!1;continue}if(o===`\\`){n+=o,a=!0;continue}if(i!=null){n+=o,o===i&&(i=null);continue}if(o===`"`||o===`'`||o==="`"){n+=o,i=o;continue}if(o===`[`||o===`{`){r++,n+=o;continue}if(o===`]`||o===`}`){r--,n+=o;continue}if(o===`,`&&r===0){n.trim()!==``&&t.push(n.trim()),n=``;continue}n+=o}return n.trim()!==``&&t.push(n.trim()),t}function kf(e){return Of(e)}function Af(e){let t=null,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(n){n=!1;continue}if(i===`\\`){n=!0;continue}if(t!=null){i===t&&(t=null);continue}if(i===`"`||i===`'`||i==="`"){t=i;continue}if(i===`:`)return r}return-1}function jf(e,t){let n=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===`when`);if(n?.type!==`mdxJsxAttribute`)return!0;if(typeof n.value==`string`)return n.value===`true`;if(n.value!=null&&typeof n.value==`object`&&n.value.type===`mdxJsxAttributeValueExpression`)try{let e=Ad(n.value.value,t.scope);return e===`true`||e===`1`}catch{return!1}return!1}async function Mf(e,t,n){return!jf(e,t)||e.children.length===0?[]:n(e.children,t)}async function Nf(e,t){if(!jf(e,t)||e.children.length===0)return[];let n=Pf(e.children,t);return n===``?[]:[{type:`text`,value:n}]}function Pf(e,t){let n=``;for(let r of e)if(r.type===`text`)n+=r.value;else if(r.type===`mdxTextExpression`)try{n+=Ad(r.value,t.scope)}catch{}else `children`in r&&Array.isArray(r.children)&&(n+=Pf(r.children,t));return n}function Ff(){Dd(`Md`,Mf),Dd(`Md.Line`,Nf)}Ff();function If(e,t){let n={};if(e!=null&&(n.os={...e.os},n.env={...e.env},n.profile={...e.profile},n.tool={...e.tool}),t!=null)for(let[e,r]of Object.entries(t)){let t=n[e];n[e]=typeof r==`object`&&r&&!Array.isArray(r)&&typeof t==`object`&&t&&!Array.isArray(t)?{...t,...r}:r}return n}async function Lf(e,t){let n=fd(e),r=If(t?.globalScope,t?.scope),i=Od(),a;if(t?.extractMetadata===!0){let e=n.children.find(e=>e.type===`yaml`),i;if(e!=null)try{i=s.parse(e.value)}catch{}a=yf(n.children.filter(e=>e.type===`mdxjsEsm`),{...i!=null&&{yamlFrontMatter:i},scope:r,...t?.basePath!=null&&{filePath:t.basePath}}),n.children=n.children.filter(e=>e.type!==`yaml`&&e.type!==`mdxjsEsm`)}let o=await pf(n,{scope:r,components:i,processingStack:[],...t?.basePath!=null&&{basePath:t.basePath}}),c=mo().use(de,[`yaml`]).use(qa).use(vf,{bullet:`-`,fence:"`",fences:!0,emphasis:`*`,strong:`*`,rule:`-`,handlers:{text(e){return e.value}}}).stringify(o).trim();return t?.extractMetadata===!0&&a!=null?{content:c,metadata:a}:c}var Rf=class{constructor(e,t,n,r){this.fs=e,this.path=t,this.logger=n,this.globalScope=r}async readDirectoryStructure(e,t,n){let r=[],i=[];if(!this.exists(e))return{prompts:r,errors:i};try{let a=this.fs.readdirSync(e,{withFileTypes:!0});for(let o of a){if(!o.isDirectory())continue;let{name:a}=o,s=this.path.join(e,a),c=this.path.join(t,a);try{let e=await this.readEntry(a,s,c,n,!0);e&&r.push(e)}catch(e){i.push({path:s,error:e,phase:`read`}),this.logger.error(`Failed to read entry: ${a}`,{error:e})}}}catch(t){i.push({path:e,error:t,phase:`scan`}),this.logger.error(`Failed to scan directory: ${e}`,{error:t})}return{prompts:r,errors:i}}async readFlatFiles(e,t,n){let r=[],i=[],a=this.exists(e),o=this.exists(t);if(this.logger.debug(`readFlatFiles: srcDir=${e}, exists=${a}`),this.logger.debug(`readFlatFiles: distDir=${t}, exists=${o}`),!a)return{prompts:r,errors:i};let s=n.localeExtensions.zh,c=async(a,o,l=``)=>{try{let u=this.fs.readdirSync(a,{withFileTypes:!0});for(let d of u){let u=l?this.path.join(l,d.name):d.name;if(d.isDirectory()){await c(this.path.join(a,d.name),this.path.join(o,d.name),u);continue}if(!d.isFile()||!d.name.endsWith(s))continue;let f=d.name.slice(0,-s.length),p=this.path.join(a,d.name),m=l?this.path.join(l,f):f;try{let i=await this.readFlatEntry(m,e,t,m,n);i&&r.push(i)}catch(e){i.push({path:p,error:e,phase:`read`}),this.logger.error(`Failed to read file: ${d.name}`,{error:e})}}}catch(e){i.push({path:a,error:e,phase:`scan`}),this.logger.error(`Failed to scan directory: ${a}`,{error:e})}};return await c(e,t),{prompts:r,errors:i}}async readSingleFile(e,t,n){let r=this.path.basename(e);return this.readFlatEntry(r,this.path.dirname(e),this.path.dirname(t),e,n,!0)}async readEntry(e,t,n,r,i=!0){let{localeExtensions:a,entryFileName:o,createPrompt:s,kind:c}=r,l=o??e,u=this.path.join(t,`${l}${a.zh}`),d=this.path.join(t,`${l}${a.en}`),f=this.path.join(n,`${l}.mdx`),p=await this.readDistContent(f,s,e),m=await this.readLocaleContent(u,`zh`,s,e),h=await this.readLocaleContent(d,`en`,s,e),g=p!=null,_=m!=null,v=h!=null;if(!g&&!_)return this.logger.warn(`Missing both dist and Chinese source for: ${e}`),null;let y=_?{zh:m,...v&&{en:h},default:m,defaultLocale:`zh`}:{zh:p,default:p,defaultLocale:`zh`},b;if(i){let e=g?n:t;b=this.scanChildren(e,l,a.zh)}return{name:e,type:c,src:y,...g&&{dist:p},metadata:{hasDist:g,hasMultipleLocales:v,isDirectoryStructure:i,...b&&b.length>0&&{children:b}},paths:{...(_||!g)&&{zh:u},...v&&{en:d},...g&&{dist:f}}}}async readFlatEntry(e,t,n,r,i,a=!1){let{localeExtensions:o,createPrompt:s,kind:c}=i,l=`${r}${o.zh}`,u=`${r}${o.en}`,d=this.path.join(n,`${e}.mdx`),f=a?l:this.path.join(t,l),p=a?u:this.path.join(t,u),m=await this.readDistContent(d,s,e),h=await this.readLocaleContent(f,`zh`,s,e),g=await this.readLocaleContent(p,`en`,s,e),_=m!=null,v=h!=null,y=g!=null;return!_&&!v?(this.logger.warn(`Missing both dist and Chinese source for: ${e}`),null):{name:e,type:c,src:v?{zh:h,...y&&{en:g},default:h,defaultLocale:`zh`}:{zh:m,default:m,defaultLocale:`zh`},..._&&{dist:m},metadata:{hasDist:_,hasMultipleLocales:y,isDirectoryStructure:!1},paths:{...(v||!_)&&{zh:f},...y&&{en:p},..._&&{dist:d}}}}async readLocaleContent(e,t,n,r){if(!this.exists(e))return null;try{let i=this.fs.readFileSync(e,`utf8`),a=this.fs.statSync(e),o=await Lf(i,{globalScope:this.globalScope,extractMetadata:!0,basePath:this.path.dirname(e)}),s=_d(i),c=await n(o.content,t,r),l={content:o.content,lastModified:a.mtime,filePath:e};return i.length>0&&Object.assign(l,{rawMdx:i}),s.yamlFrontMatter!=null&&Object.assign(l,{frontMatter:s.yamlFrontMatter}),c!=null&&Object.assign(l,{prompt:c}),l}catch(t){throw this.logger.error(`Failed to read locale content: ${e}`,{error:t}),t}}async readDistContent(e,t,n){if(!this.exists(e))return null;try{let r=this.fs.readFileSync(e,`utf8`),i=this.fs.statSync(e),a=await t(r,`zh`,n);return{content:r,lastModified:i.mtime,prompt:a,filePath:e}}catch(t){return this.logger.warn(`Failed to read dist content: ${e}`,{error:t}),null}}scanChildren(e,t,n){let r=[];if(!this.exists(e))return r;let i=`${t}${n}`;try{let t=(e,a)=>{let o=this.fs.readdirSync(e,{withFileTypes:!0});for(let s of o){let o=this.path.join(e,s.name),c=a?this.path.join(a,s.name):s.name;if(s.isDirectory())t(o,c);else if(s.name.endsWith(n)&&s.name!==i){let e=s.name.slice(0,-n.length),t=this.path.dirname(c),i=t===`.`?e:this.path.join(t,e);r.push(i)}}};t(e,``)}catch(t){this.logger.warn(`Failed to scan children: ${e}`,{error:t})}return r}exists(e){try{return this.fs.existsSync(e)}catch{return!1}}};function zf(e,t,n,r){return new Rf(e,t,n,r)}const Bf={default:{websearch:`web_search`,webfetch:`web_fetch`,readFile:`read_file`,writeFile:`write_file`,executeCommand:`execute_command`,todolistWrite:`todolist_write`,grep:`grep`,listDirectory:`list_directory`},claudeCode:{readFile:`Read`,writeFile:`Write`,executeCommand:`Execute`,todolistWrite:`TodoWrite`,listDirectory:`List`},kiro:{websearch:`remote_web_search`,webfetch:`webFetch`,readFile:`readFile`,writeFile:`fsWrite`,executeCommand:`executeBash`,todolistWrite:`todolistWrite`,grep:`grepSearch`,listDirectory:`listDir`}};let Vf=function(e){return e.Bash=`bash`,e.Zsh=`zsh`,e.Fish=`fish`,e.Sh=`sh`,e.PowerShell=`powershell`,e.Pwsh=`pwsh`,e.Cmd=`cmd`,e.Unknown=`unknown`,e}({}),Hf=function(e){return e.Win=`win`,e.Mac=`mac`,e.Linux=`linux`,e.Unknown=`unknown`,e}({});var Uf=class{userConfig;toolPreset;constructor(e={}){this.userConfig=e.userConfig,this.toolPreset=e.toolPreset??`default`}collect(){return{os:this.collectOsInfo(),env:this.collectEnvContext(),profile:this.collectProfile(),tool:this.collectToolReferences(),Md:this.createMdComponent()}}collectOsInfo(){let e=a.platform();return{platform:e,arch:a.arch(),hostname:a.hostname(),homedir:a.homedir(),tmpdir:a.tmpdir(),type:a.type(),release:a.release(),shellKind:this.detectShellKind(),kind:this.detectOsKind(e)}}detectOsKind(e){switch(e){case`win32`:return Hf.Win;case`darwin`:return Hf.Mac;case`linux`:case`freebsd`:case`openbsd`:case`sunos`:case`aix`:return Hf.Linux;default:return Hf.Unknown}}detectShellKind(){let e=(t.default.env.SHELL??t.default.env.ComSpec??``).toLowerCase();return e.includes(`bash`)?Vf.Bash:e.includes(`zsh`)?Vf.Zsh:e.includes(`fish`)?Vf.Fish:e.includes(`pwsh`)?Vf.Pwsh:e.includes(`powershell`)?Vf.PowerShell:e.includes(`cmd`)?Vf.Cmd:e.endsWith(`/sh`)?Vf.Sh:Vf.Unknown}collectEnvContext(){return{...t.default.env}}collectProfile(){return this.userConfig?.profile==null?{}:this.userConfig.profile}collectToolReferences(){let e={...Bf.default};return this.toolPreset===`claudeCode`?{...e,...Bf.claudeCode}:this.toolPreset===`kiro`?{...e,...Bf.kiro}:e}createMdComponent(){let e=(e=>e.when===!1?null:e.children);return e.Line=e=>e.when===!1?null:e.children,e}};let Wf=function(e){return e[e.SystemDefault=0]=`SystemDefault`,e[e.UserConfig=10]=`UserConfig`,e[e.PluginRegistered=20]=`PluginRegistered`,e[e.CompileTime=30]=`CompileTime`,e}({});var Gf=class{registrations=[];globalScope=null;setGlobalScope(e){this.globalScope=e}getGlobalScope(){return this.globalScope}register(e,t,n=Wf.PluginRegistered){this.registrations.push({namespace:e,values:t,priority:n})}getRegistrations(){return this.registrations}merge(e){let t={};this.globalScope!=null&&(t.os={...this.globalScope.os},t.env={...this.globalScope.env},t.profile={...this.globalScope.profile},t.tool={...this.globalScope.tool});let n=[...this.registrations].sort((e,t)=>e.priority-t.priority);for(let e of n)t[e.namespace]=this.deepMerge(t[e.namespace],e.values);if(e!=null)for(let[n,r]of Object.entries(e))t[n]=typeof r==`object`&&r&&!Array.isArray(r)?this.deepMerge(t[n],r):r;return t}deepMerge(e,t){if(e==null)return{...t};let n={...e};for(let[e,r]of Object.entries(t))n[e]=typeof r==`object`&&r&&!Array.isArray(r)&&typeof n[e]==`object`&&n[e]!==null&&!Array.isArray(n[e])?this.deepMerge(n[e],r):r;return n}resolve(e){let t=this.merge();return e.replaceAll(/\$\{([^}]+)\}/g,(e,n)=>{let r=n.split(`.`),i=t;for(let e of r)i=i?.[e];return i==null?`\${${n}}`:String(i)})}clear(){this.registrations.length=0,this.globalScope=null}},Kf=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.splitWhen=e.flatten=void 0;function t(e){return e.reduce((e,t)=>[].concat(e,t),[])}e.flatten=t;function n(e,t){let n=[[]],r=0;for(let i of e)t(i)?(r++,n[r]=[]):n[r].push(i);return n}e.splitWhen=n})),qf=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isEnoentCodeError=void 0;function t(e){return e.code===`ENOENT`}e.isEnoentCodeError=t})),Jf=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createDirentFromStats=void 0;var t=class{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}};function n(e,n){return new t(e,n)}e.createDirentFromStats=n})),Yf=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.convertPosixPathToPattern=e.convertWindowsPathToPattern=e.convertPathToPattern=e.escapePosixPath=e.escapeWindowsPath=e.escape=e.removeLeadingDotSegment=e.makeAbsolute=e.unixify=void 0;let t=require(`os`),n=require(`path`),r=t.platform()===`win32`,i=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,a=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,o=/^\\\\([.?])/,s=/\\(?![!()+@[\]{}])/g;function c(e){return e.replace(/\\/g,`/`)}e.unixify=c;function l(e,t){return n.resolve(e,t)}e.makeAbsolute=l;function u(e){if(e.charAt(0)===`.`){let t=e.charAt(1);if(t===`/`||t===`\\`)return e.slice(2)}return e}e.removeLeadingDotSegment=u,e.escape=r?d:f;function d(e){return e.replace(a,`\\$2`)}e.escapeWindowsPath=d;function f(e){return e.replace(i,`\\$2`)}e.escapePosixPath=f,e.convertPathToPattern=r?p:m;function p(e){return d(e).replace(o,`//$1`).replace(s,`/`)}e.convertWindowsPathToPattern=p;function m(e){return f(e)}e.convertPosixPathToPattern=m})),Xf=e.lt(((e,t)=>{
|
|
74
|
-
/*!
|
|
75
|
-
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
76
|
-
*
|
|
77
|
-
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
78
|
-
* Licensed under the MIT License.
|
|
79
|
-
*/
|
|
80
|
-
t.exports=function(e){if(typeof e!=`string`||e===``)return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1}})),Zf=e.lt(((e,t)=>{
|
|
81
|
-
/*!
|
|
82
|
-
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
83
|
-
*
|
|
84
|
-
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
85
|
-
* Released under the MIT License.
|
|
86
|
-
*/
|
|
87
|
-
var n=Xf(),r={"{":`}`,"(":`)`,"[":`]`},i=function(e){if(e[0]===`!`)return!0;for(var t=0,n=-2,i=-2,a=-2,o=-2,s=-2;t<e.length;){if(e[t]===`*`||e[t+1]===`?`&&/[\].+)]/.test(e[t])||i!==-1&&e[t]===`[`&&e[t+1]!==`]`&&(i<t&&(i=e.indexOf(`]`,t)),i>t&&(s===-1||s>i||(s=e.indexOf(`\\`,t),s===-1||s>i)))||a!==-1&&e[t]===`{`&&e[t+1]!==`}`&&(a=e.indexOf(`}`,t),a>t&&(s=e.indexOf(`\\`,t),s===-1||s>a))||o!==-1&&e[t]===`(`&&e[t+1]===`?`&&/[:!=]/.test(e[t+2])&&e[t+3]!==`)`&&(o=e.indexOf(`)`,t),o>t&&(s=e.indexOf(`\\`,t),s===-1||s>o))||n!==-1&&e[t]===`(`&&e[t+1]!==`|`&&(n<t&&(n=e.indexOf(`|`,t)),n!==-1&&e[n+1]!==`)`&&(o=e.indexOf(`)`,n),o>n&&(s=e.indexOf(`\\`,n),s===-1||s>o))))return!0;if(e[t]===`\\`){var c=e[t+1];t+=2;var l=r[c];if(l){var u=e.indexOf(l,t);u!==-1&&(t=u+1)}if(e[t]===`!`)return!0}else t++}return!1},a=function(e){if(e[0]===`!`)return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if(e[t]===`\\`){var n=e[t+1];t+=2;var i=r[n];if(i){var a=e.indexOf(i,t);a!==-1&&(t=a+1)}if(e[t]===`!`)return!0}else t++}return!1};t.exports=function(e,t){if(typeof e!=`string`||e===``)return!1;if(n(e))return!0;var r=i;return t&&t.strict===!1&&(r=a),r(e)}})),Qf=e.lt(((e,t)=>{var n=Zf(),r=require(`path`).posix.dirname,i=require(`os`).platform()===`win32`,a=`/`,o=/\\/g,s=/[\{\[].*[\}\]]$/,c=/(^|[^\\])([\{\[]|\([^\)]+$)/,l=/\\([\!\*\?\|\[\]\(\)\{\}])/g;t.exports=function(e,t){Object.assign({flipBackslashes:!0},t).flipBackslashes&&i&&e.indexOf(a)<0&&(e=e.replace(o,a)),s.test(e)&&(e+=a),e+=`a`;do e=r(e);while(n(e)||c.test(e));return e.replace(l,`$1`)}})),$f=e.lt((e=>{e.isInteger=e=>typeof e==`number`?Number.isInteger(e):typeof e==`string`&&e.trim()!==``?Number.isInteger(Number(e)):!1,e.find=(e,t)=>e.nodes.find(e=>e.type===t),e.exceedsLimit=(t,n,r=1,i)=>i===!1||!e.isInteger(t)||!e.isInteger(n)?!1:(Number(n)-Number(t))/Number(r)>=i,e.escapeNode=(e,t=0,n)=>{let r=e.nodes[t];r&&(n&&r.type===n||r.type===`open`||r.type===`close`)&&r.escaped!==!0&&(r.value=`\\`+r.value,r.escaped=!0)},e.encloseBrace=e=>e.type===`brace`?e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0):!1,e.isInvalidBrace=e=>e.type===`brace`?e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1:!1,e.isOpenOrClose=e=>e.type===`open`||e.type===`close`?!0:e.open===!0||e.close===!0,e.reduce=e=>e.reduce((e,t)=>(t.type===`text`&&e.push(t.value),t.type===`range`&&(t.type=`text`),e),[]),e.flatten=(...e)=>{let t=[],n=e=>{for(let r=0;r<e.length;r++){let i=e[r];if(Array.isArray(i)){n(i);continue}i!==void 0&&t.push(i)}return t};return n(e),t}})),ep=e.lt(((e,t)=>{let n=$f();t.exports=(e,t={})=>{let r=(e,i={})=>{let a=t.escapeInvalid&&n.isInvalidBrace(i),o=e.invalid===!0&&t.escapeInvalid===!0,s=``;if(e.value)return(a||o)&&n.isOpenOrClose(e)?`\\`+e.value:e.value;if(e.value)return e.value;if(e.nodes)for(let t of e.nodes)s+=r(t);return s};return r(e)}})),tp=e.lt(((e,t)=>{t.exports=function(e){return typeof e==`number`?e-e===0:typeof e==`string`&&e.trim()!==``?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}})),np=e.lt(((e,t)=>{let n=tp(),r=(e,t,a)=>{if(n(e)===!1)throw TypeError(`toRegexRange: expected the first argument to be a number`);if(t===void 0||e===t)return String(e);if(n(t)===!1)throw TypeError(`toRegexRange: expected the second argument to be a number.`);let o={relaxZeros:!0,...a};typeof o.strictZeros==`boolean`&&(o.relaxZeros=o.strictZeros===!1);let c=String(o.relaxZeros),l=String(o.shorthand),u=String(o.capture),d=String(o.wrap),f=e+`:`+t+`=`+c+l+u+d;if(r.cache.hasOwnProperty(f))return r.cache[f].result;let p=Math.min(e,t),m=Math.max(e,t);if(Math.abs(p-m)===1){let n=e+`|`+t;return o.capture?`(${n})`:o.wrap===!1?n:`(?:${n})`}let h=g(e)||g(t),_={min:e,max:t,a:p,b:m},v=[],y=[];return h&&(_.isPadded=h,_.maxLen=String(_.max).length),p<0&&(y=s(m<0?Math.abs(m):1,Math.abs(p),_,o),p=_.a=0),m>=0&&(v=s(p,m,_,o)),_.negatives=y,_.positives=v,_.result=i(y,v,o),o.capture===!0?_.result=`(${_.result})`:o.wrap!==!1&&v.length+y.length>1&&(_.result=`(?:${_.result})`),r.cache[f]=_,_.result};function i(e,t,n){let r=c(e,t,`-`,!1,n)||[],i=c(t,e,``,!1,n)||[],a=c(e,t,`-?`,!0,n)||[];return r.concat(a).concat(i).join(`|`)}function a(e,t){let n=1,r=1,i=f(e,n),a=new Set([t]);for(;e<=i&&i<=t;)a.add(i),n+=1,i=f(e,n);for(i=p(t+1,r)-1;e<i&&i<=t;)a.add(i),r+=1,i=p(t+1,r)-1;return a=[...a],a.sort(u),a}function o(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=l(e,t),i=r.length,a=``,o=0;for(let e=0;e<i;e++){let[t,i]=r[e];t===i?a+=t:t!==`0`||i!==`9`?a+=h(t,i,n):o++}return o&&(a+=n.shorthand===!0?`\\d`:`[0-9]`),{pattern:a,count:[o],digits:i}}function s(e,t,n,r){let i=a(e,t),s=[],c=e,l;for(let e=0;e<i.length;e++){let t=i[e],a=o(String(c),String(t),r),u=``;if(!n.isPadded&&l&&l.pattern===a.pattern){l.count.length>1&&l.count.pop(),l.count.push(a.count[0]),l.string=l.pattern+m(l.count),c=t+1;continue}n.isPadded&&(u=_(t,n,r)),a.string=u+a.pattern+m(a.count),s.push(a),c=t+1,l=a}return s}function c(e,t,n,r,i){let a=[];for(let i of e){let{string:e}=i;!r&&!d(t,`string`,e)&&a.push(n+e),r&&d(t,`string`,e)&&a.push(n+e)}return a}function l(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}function u(e,t){return e>t?1:t>e?-1:0}function d(e,t,n){return e.some(e=>e[t]===n)}function f(e,t){return Number(String(e).slice(0,-t)+`9`.repeat(t))}function p(e,t){return e-e%10**t}function m(e){let[t=0,n=``]=e;return n||t>1?`{${t+(n?`,`+n:``)}}`:``}function h(e,t,n){return`[${e}${t-e===1?``:`-`}${t}]`}function g(e){return/^-?(0+)\d/.test(e)}function _(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),i=n.relaxZeros!==!1;switch(r){case 0:return``;case 1:return i?`0?`:`0`;case 2:return i?`0{0,2}`:`00`;default:return i?`0{0,${r}}`:`0{${r}}`}}r.cache={},r.clearCache=()=>r.cache={},t.exports=r})),rp=e.lt(((e,t)=>{let n=require(`util`),r=np(),i=e=>typeof e==`object`&&!!e&&!Array.isArray(e),a=e=>t=>e===!0?Number(t):String(t),o=e=>typeof e==`number`||typeof e==`string`&&e!==``,s=e=>Number.isInteger(+e),c=e=>{let t=`${e}`,n=-1;if(t[0]===`-`&&(t=t.slice(1)),t===`0`)return!1;for(;t[++n]===`0`;);return n>0},l=(e,t,n)=>typeof e==`string`||typeof t==`string`?!0:n.stringify===!0,u=(e,t,n)=>{if(t>0){let n=e[0]===`-`?`-`:``;n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,`0`)}return n===!1?String(e):e},d=(e,t)=>{let n=e[0]===`-`?`-`:``;for(n&&(e=e.slice(1),t--);e.length<t;)e=`0`+e;return n?`-`+e:e},f=(e,t,n)=>{e.negatives.sort((e,t)=>e<t?-1:e>t?1:0),e.positives.sort((e,t)=>e<t?-1:e>t?1:0);let r=t.capture?``:`?:`,i=``,a=``,o;return e.positives.length&&(i=e.positives.map(e=>d(String(e),n)).join(`|`)),e.negatives.length&&(a=`-(${r}${e.negatives.map(e=>d(String(e),n)).join(`|`)})`),o=i&&a?`${i}|${a}`:i||a,t.wrap?`(${r}${o})`:o},p=(e,t,n,i)=>{if(n)return r(e,t,{wrap:!1,...i});let a=String.fromCharCode(e);return e===t?a:`[${a}-${String.fromCharCode(t)}]`},m=(e,t,n)=>{if(Array.isArray(e)){let t=n.wrap===!0,r=n.capture?``:`?:`;return t?`(${r}${e.join(`|`)})`:e.join(`|`)}return r(e,t,n)},h=(...e)=>RangeError(`Invalid range arguments: `+n.inspect(...e)),g=(e,t,n)=>{if(n.strictRanges===!0)throw h([e,t]);return[]},_=(e,t)=>{if(t.strictRanges===!0)throw TypeError(`Expected step "${e}" to be a number`);return[]},v=(e,t,n=1,r={})=>{let i=Number(e),o=Number(t);if(!Number.isInteger(i)||!Number.isInteger(o)){if(r.strictRanges===!0)throw h([e,t]);return[]}i===0&&(i=0),o===0&&(o=0);let s=i>o,g=String(e),_=String(t),v=String(n);n=Math.max(Math.abs(n),1);let y=c(g)||c(_)||c(v),b=y?Math.max(g.length,_.length,v.length):0,x=y===!1&&l(e,t,r)===!1,S=r.transform||a(x);if(r.toRegex&&n===1)return p(d(e,b),d(t,b),!0,r);let C={negatives:[],positives:[]},w=e=>C[e<0?`negatives`:`positives`].push(Math.abs(e)),T=[],E=0;for(;s?i>=o:i<=o;)r.toRegex===!0&&n>1?w(i):T.push(u(S(i,E),b,x)),i=s?i-n:i+n,E++;return r.toRegex===!0?n>1?f(C,r,b):m(T,null,{wrap:!1,...r}):T},y=(e,t,n=1,r={})=>{if(!s(e)&&e.length>1||!s(t)&&t.length>1)return g(e,t,r);let i=r.transform||(e=>String.fromCharCode(e)),a=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),c=a>o,l=Math.min(a,o),u=Math.max(a,o);if(r.toRegex&&n===1)return p(l,u,!1,r);let d=[],f=0;for(;c?a>=o:a<=o;)d.push(i(a,f)),a=c?a-n:a+n,f++;return r.toRegex===!0?m(d,null,{wrap:!1,options:r}):d},b=(e,t,n,r={})=>{if(t==null&&o(e))return[e];if(!o(e)||!o(t))return g(e,t,r);if(typeof n==`function`)return b(e,t,1,{transform:n});if(i(n))return b(e,t,0,n);let a={...r};return a.capture===!0&&(a.wrap=!0),n=n||a.step||1,s(n)?s(e)&&s(t)?v(e,t,n,a):y(e,t,Math.max(Math.abs(n),1),a):n!=null&&!i(n)?_(n,a):b(e,t,1,n)};t.exports=b})),ip=e.lt(((e,t)=>{let n=rp(),r=$f();t.exports=(e,t={})=>{let i=(e,a={})=>{let o=r.isInvalidBrace(a),s=e.invalid===!0&&t.escapeInvalid===!0,c=o===!0||s===!0,l=t.escapeInvalid===!0?`\\`:``,u=``;if(e.isOpen===!0)return l+e.value;if(e.isClose===!0)return console.log(`node.isClose`,l,e.value),l+e.value;if(e.type===`open`)return c?l+e.value:`(`;if(e.type===`close`)return c?l+e.value:`)`;if(e.type===`comma`)return e.prev.type===`comma`?``:c?e.value:`|`;if(e.value)return e.value;if(e.nodes&&e.ranges>0){let i=r.reduce(e.nodes),a=n(...i,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(a.length!==0)return i.length>1&&a.length>1?`(${a})`:a}if(e.nodes)for(let t of e.nodes)u+=i(t,e);return u};return i(e)}})),ap=e.lt(((e,t)=>{let n=rp(),r=ep(),i=$f(),a=(e=``,t=``,n=!1)=>{let r=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return n?i.flatten(t).map(e=>`{${e}}`):t;for(let i of e)if(Array.isArray(i))for(let e of i)r.push(a(e,t,n));else for(let e of t)n===!0&&typeof e==`string`&&(e=`{${e}}`),r.push(Array.isArray(e)?a(i,e,n):i+e);return i.flatten(r)};t.exports=(e,t={})=>{let o=t.rangeLimit===void 0?1e3:t.rangeLimit,s=(e,c={})=>{e.queue=[];let l=c,u=c.queue;for(;l.type!==`brace`&&l.type!==`root`&&l.parent;)l=l.parent,u=l.queue;if(e.invalid||e.dollar){u.push(a(u.pop(),r(e,t)));return}if(e.type===`brace`&&e.invalid!==!0&&e.nodes.length===2){u.push(a(u.pop(),[`{}`]));return}if(e.nodes&&e.ranges>0){let s=i.reduce(e.nodes);if(i.exceedsLimit(...s,t.step,o))throw RangeError(`expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.`);let c=n(...s,t);c.length===0&&(c=r(e,t)),u.push(a(u.pop(),c)),e.nodes=[];return}let d=i.encloseBrace(e),f=e.queue,p=e;for(;p.type!==`brace`&&p.type!==`root`&&p.parent;)p=p.parent,f=p.queue;for(let t=0;t<e.nodes.length;t++){let n=e.nodes[t];if(n.type===`comma`&&e.type===`brace`){t===1&&f.push(``),f.push(``);continue}if(n.type===`close`){u.push(a(u.pop(),f,d));continue}if(n.value&&n.type!==`open`){f.push(a(f.pop(),n.value));continue}n.nodes&&s(n,e)}return f};return i.flatten(s(e))}})),op=e.lt(((e,t)=>{t.exports={MAX_LENGTH:1e4,CHAR_0:`0`,CHAR_9:`9`,CHAR_UPPERCASE_A:`A`,CHAR_LOWERCASE_A:`a`,CHAR_UPPERCASE_Z:`Z`,CHAR_LOWERCASE_Z:`z`,CHAR_LEFT_PARENTHESES:`(`,CHAR_RIGHT_PARENTHESES:`)`,CHAR_ASTERISK:`*`,CHAR_AMPERSAND:`&`,CHAR_AT:`@`,CHAR_BACKSLASH:`\\`,CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:`\r`,CHAR_CIRCUMFLEX_ACCENT:`^`,CHAR_COLON:`:`,CHAR_COMMA:`,`,CHAR_DOLLAR:`$`,CHAR_DOT:`.`,CHAR_DOUBLE_QUOTE:`"`,CHAR_EQUAL:`=`,CHAR_EXCLAMATION_MARK:`!`,CHAR_FORM_FEED:`\f`,CHAR_FORWARD_SLASH:`/`,CHAR_HASH:`#`,CHAR_HYPHEN_MINUS:`-`,CHAR_LEFT_ANGLE_BRACKET:`<`,CHAR_LEFT_CURLY_BRACE:`{`,CHAR_LEFT_SQUARE_BRACKET:`[`,CHAR_LINE_FEED:`
|
|
88
|
-
`,CHAR_NO_BREAK_SPACE:`\xA0`,CHAR_PERCENT:`%`,CHAR_PLUS:`+`,CHAR_QUESTION_MARK:`?`,CHAR_RIGHT_ANGLE_BRACKET:`>`,CHAR_RIGHT_CURLY_BRACE:`}`,CHAR_RIGHT_SQUARE_BRACKET:`]`,CHAR_SEMICOLON:`;`,CHAR_SINGLE_QUOTE:`'`,CHAR_SPACE:` `,CHAR_TAB:` `,CHAR_UNDERSCORE:`_`,CHAR_VERTICAL_LINE:`|`,CHAR_ZERO_WIDTH_NOBREAK_SPACE:``}})),sp=e.lt(((e,t)=>{let n=ep(),{MAX_LENGTH:r,CHAR_BACKSLASH:i,CHAR_BACKTICK:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:c,CHAR_RIGHT_PARENTHESES:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_RIGHT_SQUARE_BRACKET:p,CHAR_DOUBLE_QUOTE:m,CHAR_SINGLE_QUOTE:h,CHAR_NO_BREAK_SPACE:g,CHAR_ZERO_WIDTH_NOBREAK_SPACE:_}=op();t.exports=(e,t={})=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);let v=t||{},y=typeof v.maxLength==`number`?Math.min(r,v.maxLength):r;if(e.length>y)throw SyntaxError(`Input length (${e.length}), exceeds max characters (${y})`);let b={type:`root`,input:e,nodes:[]},x=[b],S=b,C=b,w=0,T=e.length,E=0,D=0,O,k=()=>e[E++],A=e=>{if(e.type===`text`&&C.type===`dot`&&(C.type=`text`),C&&C.type===`text`&&e.type===`text`){C.value+=e.value;return}return S.nodes.push(e),e.parent=S,e.prev=C,C=e,e};for(A({type:`bos`});E<T;)if(S=x[x.length-1],O=k(),!(O===_||O===g)){if(O===i){A({type:`text`,value:(t.keepEscaping?O:``)+k()});continue}if(O===p){A({type:`text`,value:`\\`+O});continue}if(O===f){w++;let e;for(;E<T&&(e=k());){if(O+=e,e===f){w++;continue}if(e===i){O+=k();continue}if(e===p&&(w--,w===0))break}A({type:`text`,value:O});continue}if(O===c){S=A({type:`paren`,nodes:[]}),x.push(S),A({type:`text`,value:O});continue}if(O===l){if(S.type!==`paren`){A({type:`text`,value:O});continue}S=x.pop(),A({type:`text`,value:O}),S=x[x.length-1];continue}if(O===m||O===h||O===a){let e=O,n;for(t.keepQuotes!==!0&&(O=``);E<T&&(n=k());){if(n===i){O+=n+k();continue}if(n===e){t.keepQuotes===!0&&(O+=n);break}O+=n}A({type:`text`,value:O});continue}if(O===u){D++,S=A({type:`brace`,open:!0,close:!1,dollar:C.value&&C.value.slice(-1)===`$`||S.dollar===!0,depth:D,commas:0,ranges:0,nodes:[]}),x.push(S),A({type:`open`,value:O});continue}if(O===d){if(S.type!==`brace`){A({type:`text`,value:O});continue}S=x.pop(),S.close=!0,A({type:`close`,value:O}),D--,S=x[x.length-1];continue}if(O===o&&D>0){if(S.ranges>0){S.ranges=0;let e=S.nodes.shift();S.nodes=[e,{type:`text`,value:n(S)}]}A({type:`comma`,value:O}),S.commas++;continue}if(O===s&&D>0&&S.commas===0){let e=S.nodes;if(D===0||e.length===0){A({type:`text`,value:O});continue}if(C.type===`dot`){if(S.range=[],C.value+=O,C.type=`range`,S.nodes.length!==3&&S.nodes.length!==5){S.invalid=!0,S.ranges=0,C.type=`text`;continue}S.ranges++,S.args=[];continue}if(C.type===`range`){e.pop();let t=e[e.length-1];t.value+=C.value+O,C=t,S.ranges--;continue}A({type:`dot`,value:O});continue}A({type:`text`,value:O})}do if(S=x.pop(),S.type!==`root`){S.nodes.forEach(e=>{e.nodes||(e.type===`open`&&(e.isOpen=!0),e.type===`close`&&(e.isClose=!0),e.nodes||(e.type=`text`),e.invalid=!0)});let e=x[x.length-1],t=e.nodes.indexOf(S);e.nodes.splice(t,1,...S.nodes)}while(x.length>0);return A({type:`eos`}),b}})),cp=e.lt(((e,t)=>{let n=ep(),r=ip(),i=ap(),a=sp(),o=(e,t={})=>{let n=[];if(Array.isArray(e))for(let r of e){let e=o.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(o.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(n=[...new Set(n)]),n};o.parse=(e,t={})=>a(e,t),o.stringify=(e,t={})=>n(typeof e==`string`?o.parse(e,t):e,t),o.compile=(e,t={})=>(typeof e==`string`&&(e=o.parse(e,t)),r(e,t)),o.expand=(e,t={})=>{typeof e==`string`&&(e=o.parse(e,t));let n=i(e,t);return t.noempty===!0&&(n=n.filter(Boolean)),t.nodupes===!0&&(n=[...new Set(n)]),n},o.create=(e,t={})=>e===``||e.length<3?[e]:t.expand===!0?o.expand(e,t):o.compile(e,t),t.exports=o})),lp=e.lt(((e,t)=>{let n=require(`util`),r=cp(),i=require(`picomatch`),a=require(`picomatch/lib/utils`),o=e=>e===``||e===`./`,s=e=>{let t=e.indexOf(`{`);return t>-1&&e.indexOf(`}`,t)>-1},c=(e,t,n)=>{t=[].concat(t),e=[].concat(e);let r=new Set,a=new Set,o=new Set,s=0,c=e=>{o.add(e.output),n&&n.onResult&&n.onResult(e)};for(let o=0;o<t.length;o++){let l=i(String(t[o]),{...n,onResult:c},!0),u=l.state.negated||l.state.negatedExtglob;u&&s++;for(let t of e){let e=l(t,!0);(u?!e.isMatch:e.isMatch)&&(u?r.add(e.output):(r.delete(e.output),a.add(e.output)))}}let l=(s===t.length?[...o]:[...a]).filter(e=>!r.has(e));if(n&&l.length===0){if(n.failglob===!0)throw Error(`No matches found for "${t.join(`, `)}"`);if(n.nonull===!0||n.nullglob===!0)return n.unescape?t.map(e=>e.replace(/\\/g,``)):t}return l};c.match=c,c.matcher=(e,t)=>i(e,t),c.isMatch=(e,t,n)=>i(t,n)(e),c.any=c.isMatch,c.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,i=[],a=e=>{n.onResult&&n.onResult(e),i.push(e.output)},o=new Set(c(e,t,{...n,onResult:a}));for(let e of i)o.has(e)||r.add(e);return[...r]},c.contains=(e,t,r)=>{if(typeof e!=`string`)throw TypeError(`Expected a string: "${n.inspect(e)}"`);if(Array.isArray(t))return t.some(t=>c.contains(e,t,r));if(typeof t==`string`){if(o(e)||o(t))return!1;if(e.includes(t)||e.startsWith(`./`)&&e.slice(2).includes(t))return!0}return c.isMatch(e,t,{...r,contains:!0})},c.matchKeys=(e,t,n)=>{if(!a.isObject(e))throw TypeError(`Expected the first argument to be an object`);let r=c(Object.keys(e),t,n),i={};for(let t of r)i[t]=e[t];return i},c.some=(e,t,n)=>{let r=[].concat(e);for(let e of[].concat(t)){let t=i(String(e),n);if(r.some(e=>t(e)))return!0}return!1},c.every=(e,t,n)=>{let r=[].concat(e);for(let e of[].concat(t)){let t=i(String(e),n);if(!r.every(e=>t(e)))return!1}return!0},c.all=(e,t,r)=>{if(typeof e!=`string`)throw TypeError(`Expected a string: "${n.inspect(e)}"`);return[].concat(t).every(t=>i(t,r)(e))},c.capture=(e,t,n)=>{let r=a.isWindows(n),o=i.makeRe(String(e),{...n,capture:!0}).exec(r?a.toPosixSlashes(t):t);if(o)return o.slice(1).map(e=>e===void 0?``:e)},c.makeRe=(...e)=>i.makeRe(...e),c.scan=(...e)=>i.scan(...e),c.parse=(e,t)=>{let n=[];for(let a of[].concat(e||[]))for(let e of r(String(a),t))n.push(i.parse(e,t));return n},c.braces=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);return t&&t.nobrace===!0||!s(e)?[e]:r(e,t)},c.braceExpand=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);return c.braces(e,{...t,expand:!0})},c.hasBraces=s,t.exports=c})),up=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isAbsolute=e.partitionAbsoluteAndRelative=e.removeDuplicateSlashes=e.matchAny=e.convertPatternsToRe=e.makeRe=e.getPatternParts=e.expandBraceExpansion=e.expandPatternsWithBraceExpansion=e.isAffectDepthOfReadingPattern=e.endsWithSlashGlobStar=e.hasGlobStar=e.getBaseDirectory=e.isPatternRelatedToParentDirectory=e.getPatternsOutsideCurrentDirectory=e.getPatternsInsideCurrentDirectory=e.getPositivePatterns=e.getNegativePatterns=e.isPositivePattern=e.isNegativePattern=e.convertToNegativePattern=e.convertToPositivePattern=e.isDynamicPattern=e.isStaticPattern=void 0;let t=require(`path`),n=Qf(),r=lp(),i=/[*?]|^!/,a=/\[[^[]*]/,o=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,s=/[!*+?@]\([^(]*\)/,c=/,|\.\./,l=/(?!^)\/{2,}/g;function u(e,t={}){return!d(e,t)}e.isStaticPattern=u;function d(e,t={}){return e===``?!1:!!(t.caseSensitiveMatch===!1||e.includes(`\\`)||i.test(e)||a.test(e)||o.test(e)||t.extglob!==!1&&s.test(e)||t.braceExpansion!==!1&&f(e))}e.isDynamicPattern=d;function f(e){let t=e.indexOf(`{`);if(t===-1)return!1;let n=e.indexOf(`}`,t+1);if(n===-1)return!1;let r=e.slice(t,n);return c.test(r)}function p(e){return h(e)?e.slice(1):e}e.convertToPositivePattern=p;function m(e){return`!`+e}e.convertToNegativePattern=m;function h(e){return e.startsWith(`!`)&&e[1]!==`(`}e.isNegativePattern=h;function g(e){return!h(e)}e.isPositivePattern=g;function _(e){return e.filter(h)}e.getNegativePatterns=_;function v(e){return e.filter(g)}e.getPositivePatterns=v;function y(e){return e.filter(e=>!x(e))}e.getPatternsInsideCurrentDirectory=y;function b(e){return e.filter(x)}e.getPatternsOutsideCurrentDirectory=b;function x(e){return e.startsWith(`..`)||e.startsWith(`./..`)}e.isPatternRelatedToParentDirectory=x;function S(e){return n(e,{flipBackslashes:!1})}e.getBaseDirectory=S;function C(e){return e.includes(`**`)}e.hasGlobStar=C;function w(e){return e.endsWith(`/**`)}e.endsWithSlashGlobStar=w;function T(e){let n=t.basename(e);return w(e)||u(n)}e.isAffectDepthOfReadingPattern=T;function E(e){return e.reduce((e,t)=>e.concat(D(t)),[])}e.expandPatternsWithBraceExpansion=E;function D(e){let t=r.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((e,t)=>e.length-t.length),t.filter(e=>e!==``)}e.expandBraceExpansion=D;function O(e,t){let{parts:n}=r.scan(e,Object.assign(Object.assign({},t),{parts:!0}));return n.length===0&&(n=[e]),n[0].startsWith(`/`)&&(n[0]=n[0].slice(1),n.unshift(``)),n}e.getPatternParts=O;function k(e,t){return r.makeRe(e,t)}e.makeRe=k;function A(e,t){return e.map(e=>k(e,t))}e.convertPatternsToRe=A;function ee(e,t){return t.some(t=>t.test(e))}e.matchAny=ee;function te(e){return e.replace(l,`/`)}e.removeDuplicateSlashes=te;function j(e){let t=[],n=[];for(let r of e)M(r)?t.push(r):n.push(r);return[t,n]}e.partitionAbsoluteAndRelative=j;function M(e){return t.isAbsolute(e)}e.isAbsolute=M})),dp=e.lt(((e,t)=>{let n=require(`stream`).PassThrough,r=Array.prototype.slice;t.exports=i;function i(){let e=[],t=r.call(arguments),i=!1,o=t[t.length-1];o&&!Array.isArray(o)&&o.pipe==null?t.pop():o={};let s=o.end!==!1,c=o.pipeError===!0;o.objectMode??=!0,o.highWaterMark??=64*1024;let l=n(o);function u(){for(let t=0,n=arguments.length;t<n;t++)e.push(a(arguments[t],o));return d(),this}function d(){if(i)return;i=!0;let t=e.shift();if(!t){process.nextTick(f);return}Array.isArray(t)||(t=[t]);let n=t.length+1;function r(){--n>0||(i=!1,d())}function a(e){function t(){e.removeListener(`merge2UnpipeEnd`,t),e.removeListener(`end`,t),c&&e.removeListener(`error`,n),r()}function n(e){l.emit(`error`,e)}if(e._readableState.endEmitted)return r();e.on(`merge2UnpipeEnd`,t),e.on(`end`,t),c&&e.on(`error`,n),e.pipe(l,{end:!1}),e.resume()}for(let e=0;e<t.length;e++)a(t[e]);r()}function f(){i=!1,l.emit(`queueDrain`),s&&l.end()}return l.setMaxListeners(0),l.add=u,l.on(`unpipe`,function(e){e.emit(`merge2UnpipeEnd`)}),t.length&&u.apply(null,t),l}function a(e,t){if(Array.isArray(e))for(let n=0,r=e.length;n<r;n++)e[n]=a(e[n],t);else{if(!e._readableState&&e.pipe&&(e=e.pipe(n(t))),!e._readableState||!e.pause||!e.pipe)throw Error(`Only readable stream can be merged.`);e.pause()}return e}})),fp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.merge=void 0;let t=dp();function n(e){let n=t(e);return e.forEach(e=>{e.once(`error`,e=>n.emit(`error`,e))}),n.once(`close`,()=>r(e)),n.once(`end`,()=>r(e)),n}e.merge=n;function r(e){e.forEach(e=>e.emit(`close`))}})),pp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isEmpty=e.isString=void 0;function t(e){return typeof e==`string`}e.isString=t;function n(e){return e===``}e.isEmpty=n})),mp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.string=e.stream=e.pattern=e.path=e.fs=e.errno=e.array=void 0,e.array=Kf(),e.errno=qf(),e.fs=Jf(),e.path=Yf(),e.pattern=up(),e.stream=fp(),e.string=pp()})),hp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.convertPatternGroupToTask=e.convertPatternGroupsToTasks=e.groupPatternsByBaseDirectory=e.getNegativePatternsAsPositive=e.getPositivePatterns=e.convertPatternsToTasks=e.generate=void 0;let t=mp();function n(e,n){let s=r(e,n),c=r(n.ignore,n),l=a(s),u=o(s,c),d=l.filter(e=>t.pattern.isStaticPattern(e,n)),f=l.filter(e=>t.pattern.isDynamicPattern(e,n)),p=i(d,u,!1),m=i(f,u,!0);return p.concat(m)}e.generate=n;function r(e,n){let r=e;return n.braceExpansion&&(r=t.pattern.expandPatternsWithBraceExpansion(r)),n.baseNameMatch&&(r=r.map(e=>e.includes(`/`)?e:`**/${e}`)),r.map(e=>t.pattern.removeDuplicateSlashes(e))}function i(e,n,r){let i=[],a=t.pattern.getPatternsOutsideCurrentDirectory(e),o=t.pattern.getPatternsInsideCurrentDirectory(e),u=s(a),d=s(o);return i.push(...c(u,n,r)),`.`in d?i.push(l(`.`,o,n,r)):i.push(...c(d,n,r)),i}e.convertPatternsToTasks=i;function a(e){return t.pattern.getPositivePatterns(e)}e.getPositivePatterns=a;function o(e,n){return t.pattern.getNegativePatterns(e).concat(n).map(t.pattern.convertToPositivePattern)}e.getNegativePatternsAsPositive=o;function s(e){return e.reduce((e,n)=>{let r=t.pattern.getBaseDirectory(n);return r in e?e[r].push(n):e[r]=[n],e},{})}e.groupPatternsByBaseDirectory=s;function c(e,t,n){return Object.keys(e).map(r=>l(r,e[r],t,n))}e.convertPatternGroupsToTasks=c;function l(e,n,r,i){return{dynamic:i,positive:n,negative:r,base:e,patterns:[].concat(n,r.map(t.pattern.convertToNegativePattern))}}e.convertPatternGroupToTask=l})),gp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.read=void 0;function t(e,t,i){t.fs.lstat(e,(a,o)=>{if(a!==null){n(i,a);return}if(!o.isSymbolicLink()||!t.followSymbolicLink){r(i,o);return}t.fs.stat(e,(e,a)=>{if(e!==null){if(t.throwErrorOnBrokenSymbolicLink){n(i,e);return}r(i,o);return}t.markSymbolicLink&&(a.isSymbolicLink=()=>!0),r(i,a)})})}e.read=t;function n(e,t){e(t)}function r(e,t){e(null,t)}})),_p=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.read=void 0;function t(e,t){let n=t.fs.lstatSync(e);if(!n.isSymbolicLink()||!t.followSymbolicLink)return n;try{let n=t.fs.statSync(e);return t.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(e){if(!t.throwErrorOnBrokenSymbolicLink)return n;throw e}}e.read=t})),vp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;let t=require(`fs`);e.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync};function n(t){return t===void 0?e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},e.FILE_SYSTEM_ADAPTER),t)}e.createFileSystemAdapter=n})),yp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=vp();e.default=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=t.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,t){return e??t}}})),bp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.statSync=e.stat=e.Settings=void 0;let t=gp(),n=_p(),r=yp();e.Settings=r.default;function i(e,n,r){if(typeof n==`function`){t.read(e,o(),n);return}t.read(e,o(n),r)}e.stat=i;function a(e,t){let r=o(t);return n.read(e,r)}e.statSync=a;function o(e={}){return e instanceof r.default?e:new r.default(e)}})),xp=e.lt(((e,t)=>{
|
|
89
|
-
/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
90
|
-
let n;t.exports=typeof queueMicrotask==`function`?queueMicrotask.bind(typeof window<`u`?window:global):e=>(n||=Promise.resolve()).then(e).catch(e=>setTimeout(()=>{throw e},0))})),Sp=e.lt(((e,t)=>{
|
|
91
|
-
/*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
92
|
-
t.exports=r;let n=xp();function r(e,t){let r,i,a,o=!0;Array.isArray(e)?(r=[],i=e.length):(a=Object.keys(e),r={},i=a.length);function s(e){function i(){t&&t(e,r),t=null}o?n(i):i()}function c(e,t,n){r[e]=n,(--i===0||t)&&s(t)}i?a?a.forEach(function(t){e[t](function(e,n){c(t,e,n)})}):e.forEach(function(e,t){e(function(e,n){c(t,e,n)})}):s(null),o=!1}})),Cp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;let t=process.versions.node.split(`.`);if(t[0]===void 0||t[1]===void 0)throw Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);let n=Number.parseInt(t[0],10),r=Number.parseInt(t[1],10);e.IS_SUPPORT_READDIR_WITH_FILE_TYPES=n>10||n===10&&r>=10})),wp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createDirentFromStats=void 0;var t=class{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}};function n(e,n){return new t(e,n)}e.createDirentFromStats=n})),Tp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fs=void 0,e.fs=wp()})),Ep=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.joinPathSegments=void 0;function t(e,t,n){return e.endsWith(n)?e+t:e+n+t}e.joinPathSegments=t})),Dp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.readdir=e.readdirWithFileTypes=e.read=void 0;let t=bp(),n=Sp(),r=Cp(),i=Tp(),a=Ep();function o(e,t,n){if(!t.stats&&r.IS_SUPPORT_READDIR_WITH_FILE_TYPES){s(e,t,n);return}l(e,t,n)}e.read=o;function s(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(i,o)=>{if(i!==null){u(r,i);return}let s=o.map(n=>({dirent:n,name:n.name,path:a.joinPathSegments(e,n.name,t.pathSegmentSeparator)}));if(!t.followSymbolicLinks){d(r,s);return}n(s.map(e=>c(e,t)),(e,t)=>{if(e!==null){u(r,e);return}d(r,t)})})}e.readdirWithFileTypes=s;function c(e,t){return n=>{if(!e.dirent.isSymbolicLink()){n(null,e);return}t.fs.stat(e.path,(r,a)=>{if(r!==null){if(t.throwErrorOnBrokenSymbolicLink){n(r);return}n(null,e);return}e.dirent=i.fs.createDirentFromStats(e.name,a),n(null,e)})}}function l(e,r,o){r.fs.readdir(e,(s,c)=>{if(s!==null){u(o,s);return}n(c.map(n=>{let o=a.joinPathSegments(e,n,r.pathSegmentSeparator);return e=>{t.stat(o,r.fsStatSettings,(t,a)=>{if(t!==null){e(t);return}let s={name:n,path:o,dirent:i.fs.createDirentFromStats(n,a)};r.stats&&(s.stats=a),e(null,s)})}}),(e,t)=>{if(e!==null){u(o,e);return}d(o,t)})})}e.readdir=l;function u(e,t){e(t)}function d(e,t){e(null,t)}})),Op=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.readdir=e.readdirWithFileTypes=e.read=void 0;let t=bp(),n=Cp(),r=Tp(),i=Ep();function a(e,t){return!t.stats&&n.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(e,t):s(e,t)}e.read=a;function o(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(n=>{let a={dirent:n,name:n.name,path:i.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(a.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let e=t.fs.statSync(a.path);a.dirent=r.fs.createDirentFromStats(a.name,e)}catch(e){if(t.throwErrorOnBrokenSymbolicLink)throw e}return a})}e.readdirWithFileTypes=o;function s(e,n){return n.fs.readdirSync(e).map(a=>{let o=i.joinPathSegments(e,a,n.pathSegmentSeparator),s=t.statSync(o,n.fsStatSettings),c={name:a,path:o,dirent:r.fs.createDirentFromStats(a,s)};return n.stats&&(c.stats=s),c})}e.readdir=s})),kp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;let t=require(`fs`);e.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync};function n(t){return t===void 0?e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},e.FILE_SYSTEM_ADAPTER),t)}e.createFileSystemAdapter=n})),Ap=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=require(`path`),n=bp(),r=kp();e.default=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=r.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,t.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new n.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return e??t}}})),jp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Settings=e.scandirSync=e.scandir=void 0;let t=Dp(),n=Op(),r=Ap();e.Settings=r.default;function i(e,n,r){if(typeof n==`function`){t.read(e,o(),n);return}t.read(e,o(n),r)}e.scandir=i;function a(e,t){let r=o(t);return n.read(e,r)}e.scandirSync=a;function o(e={}){return e instanceof r.default?e:new r.default(e)}})),Mp=e.lt(((e,t)=>{function n(e){var t=new e,n=t;function r(){var r=t;return r.next?t=r.next:(t=new e,n=t),r.next=null,r}function i(e){n.next=e,n=e}return{get:r,release:i}}t.exports=n})),Np=e.lt(((e,t)=>{var n=Mp();function r(e,t,r){if(typeof e==`function`&&(r=t,t=e,e=null),!(r>=1))throw Error(`fastqueue concurrency must be equal to or greater than 1`);var o=n(a),s=null,c=null,l=0,u=null,d={push:v,drain:i,saturated:i,pause:p,paused:!1,get concurrency(){return r},set concurrency(e){if(!(e>=1))throw Error(`fastqueue concurrency must be equal to or greater than 1`);if(r=e,!d.paused)for(;s&&l<r;)l++,b()},running:f,resume:g,idle:_,length:m,getQueue:h,unshift:y,empty:i,kill:x,killAndDrain:S,error:w,abort:C};return d;function f(){return l}function p(){d.paused=!0}function m(){for(var e=s,t=0;e;)e=e.next,t++;return t}function h(){for(var e=s,t=[];e;)t.push(e.value),e=e.next;return t}function g(){if(d.paused){if(d.paused=!1,s===null){l++,b();return}for(;s&&l<r;)l++,b()}}function _(){return l===0&&d.length()===0}function v(n,a){var f=o.get();f.context=e,f.release=b,f.value=n,f.callback=a||i,f.errorHandler=u,l>=r||d.paused?c?(c.next=f,c=f):(s=f,c=f,d.saturated()):(l++,t.call(e,f.value,f.worked))}function y(n,a){var f=o.get();f.context=e,f.release=b,f.value=n,f.callback=a||i,f.errorHandler=u,l>=r||d.paused?s?(f.next=s,s=f):(s=f,c=f,d.saturated()):(l++,t.call(e,f.value,f.worked))}function b(n){n&&o.release(n);var i=s;i&&l<=r?d.paused?l--:(c===s&&(c=null),s=i.next,i.next=null,t.call(e,i.value,i.worked),c===null&&d.empty()):--l===0&&d.drain()}function x(){s=null,c=null,d.drain=i}function S(){s=null,c=null,d.drain(),d.drain=i}function C(){var e=s;for(s=null,c=null;e;){var t=e.next,n=e.callback,r=e.errorHandler,a=e.value,o=e.context;e.value=null,e.callback=i,e.errorHandler=null,r&&r(Error(`abort`),a),n.call(o,Error(`abort`)),e.release(e),e=t}d.drain=i}function w(e){u=e}}function i(){}function a(){this.value=null,this.callback=i,this.next=null,this.release=i,this.context=null,this.errorHandler=null;var e=this;this.worked=function(t,n){var r=e.callback,a=e.errorHandler,o=e.value;e.value=null,e.callback=i,e.errorHandler&&a(t,o),r.call(e.context,t,n),e.release(e)}}function o(e,t,n){typeof e==`function`&&(n=t,t=e,e=null);function a(e,n){t.call(this,e).then(function(e){n(null,e)},n)}var o=r(e,a,n),s=o.push,c=o.unshift;return o.push=l,o.unshift=u,o.drained=d,o;function l(e){var t=new Promise(function(t,n){s(e,function(e,r){if(e){n(e);return}t(r)})});return t.catch(i),t}function u(e){var t=new Promise(function(t,n){c(e,function(e,r){if(e){n(e);return}t(r)})});return t.catch(i),t}function d(){return new Promise(function(e){process.nextTick(function(){if(o.idle())e();else{var t=o.drain;o.drain=function(){typeof t==`function`&&t(),e(),o.drain=t}}})})}}t.exports=r,t.exports.promise=o})),Pp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.joinPathSegments=e.replacePathSegmentSeparator=e.isAppliedFilter=e.isFatalError=void 0;function t(e,t){return e.errorFilter===null?!0:!e.errorFilter(t)}e.isFatalError=t;function n(e,t){return e===null||e(t)}e.isAppliedFilter=n;function r(e,t){return e.split(/[/\\]/).join(t)}e.replacePathSegmentSeparator=r;function i(e,t,n){return e===``?t:e.endsWith(n)?e+t:e+n+t}e.joinPathSegments=i})),Fp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Pp();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._root=t.replacePathSegmentSeparator(e,n.pathSegmentSeparator)}}})),Ip=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=require(`events`),n=jp(),r=Np(),i=Pp(),a=Fp();e.default=class extends a.default{constructor(e,i){super(e,i),this._settings=i,this._scandir=n.scandir,this._emitter=new t.EventEmitter,this._queue=r(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit(`end`)}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw Error(`The reader is already destroyed`);this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on(`entry`,e)}onError(e){this._emitter.once(`error`,e)}onEnd(e){this._emitter.once(`end`,e)}_pushToQueue(e,t){let n={directory:e,base:t};this._queue.push(n,e=>{e!==null&&this._handleError(e)})}_worker(e,t){this._scandir(e.directory,this._settings.fsScandirSettings,(n,r)=>{if(n!==null){t(n,void 0);return}for(let t of r)this._handleEntry(t,e.base);t(null,void 0)})}_handleError(e){this._isDestroyed||!i.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit(`error`,e))}_handleEntry(e,t){if(this._isDestroyed||this._isFatalError)return;let n=e.path;t!==void 0&&(e.path=i.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),i.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&i.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,t===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit(`entry`,e)}}})),Lp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Ip();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(t=>{n(e,t)}),this._reader.onEntry(e=>{this._storage.push(e)}),this._reader.onEnd(()=>{r(e,this._storage)}),this._reader.read()}};function n(e,t){e(t)}function r(e,t){e(null,t)}})),Rp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=require(`stream`),n=Ip();e.default=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new n.default(this._root,this._settings),this._stream=new t.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit(`error`,e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}}})),zp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=jp(),n=Pp(),r=Fp();e.default=class extends r.default{constructor(){super(...arguments),this._scandir=t.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,t){this._queue.add({directory:e,base:t})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,t){try{let n=this._scandir(e,this._settings.fsScandirSettings);for(let e of n)this._handleEntry(e,t)}catch(e){this._handleError(e)}}_handleError(e){if(n.isFatalError(this._settings,e))throw e}_handleEntry(e,t){let r=e.path;t!==void 0&&(e.path=n.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),n.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&n.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(r,t===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}}})),Bp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=zp();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings)}read(){return this._reader.read()}}})),Vp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=require(`path`),n=jp();e.default=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,1/0),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,t.sep),this.fsScandirSettings=new n.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return e??t}}})),Hp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Settings=e.walkStream=e.walkSync=e.walk=void 0;let t=Lp(),n=Rp(),r=Bp(),i=Vp();e.Settings=i.default;function a(e,n,r){if(typeof n==`function`){new t.default(e,c()).read(n);return}new t.default(e,c(n)).read(r)}e.walk=a;function o(e,t){let n=c(t);return new r.default(e,n).read()}e.walkSync=o;function s(e,t){let r=c(t);return new n.default(e,r).read()}e.walkStream=s;function c(e={}){return e instanceof i.default?e:new i.default(e)}})),Up=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=require(`path`),n=bp(),r=mp();e.default=class{constructor(e){this._settings=e,this._fsStatSettings=new n.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return t.resolve(this._settings.cwd,e)}_makeEntry(e,t){let n={name:t,path:t,dirent:r.fs.createDirentFromStats(t,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!r.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}}})),Wp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=require(`stream`),n=bp(),r=Hp(),i=Up();e.default=class extends i.default{constructor(){super(...arguments),this._walkStream=r.walkStream,this._stat=n.stat}dynamic(e,t){return this._walkStream(e,t)}static(e,n){let r=e.map(this._getFullEntryPath,this),i=new t.PassThrough({objectMode:!0});i._write=(t,a,o)=>this._getEntry(r[t],e[t],n).then(e=>{e!==null&&n.entryFilter(e)&&i.push(e),t===r.length-1&&i.end(),o()}).catch(o);for(let e=0;e<r.length;e++)i.write(e);return i}_getEntry(e,t,n){return this._getStat(e).then(e=>this._makeEntry(e,t)).catch(e=>{if(n.errorFilter(e))return null;throw e})}_getStat(e){return new Promise((t,n)=>{this._stat(e,this._fsStatSettings,(e,r)=>e===null?t(r):n(e))})}}})),Gp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Hp(),n=Up(),r=Wp();e.default=class extends n.default{constructor(){super(...arguments),this._walkAsync=t.walk,this._readerStream=new r.default(this._settings)}dynamic(e,t){return new Promise((n,r)=>{this._walkAsync(e,t,(e,t)=>{e===null?n(t):r(e)})})}async static(e,t){let n=[],r=this._readerStream.static(e,t);return new Promise((e,t)=>{r.once(`error`,t),r.on(`data`,e=>n.push(e)),r.once(`end`,()=>e(n))})}}})),Kp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=mp();e.default=class{constructor(e,t,n){this._patterns=e,this._settings=t,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let e of this._patterns){let t=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(t);this._storage.push({complete:n.length<=1,pattern:e,segments:t,sections:n})}}_getPatternSegments(e){return t.pattern.getPatternParts(e,this._micromatchOptions).map(e=>t.pattern.isDynamicPattern(e,this._settings)?{dynamic:!0,pattern:e,patternRe:t.pattern.makeRe(e,this._micromatchOptions)}:{dynamic:!1,pattern:e})}_splitSegmentsIntoSections(e){return t.array.splitWhen(e,e=>e.dynamic&&t.pattern.hasGlobStar(e.pattern))}}})),qp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Kp();e.default=class extends t.default{match(e){let t=e.split(`/`),n=t.length,r=this._storage.filter(e=>!e.complete||e.segments.length>n);for(let e of r){let r=e.sections[0];if(!e.complete&&n>r.length||t.every((t,n)=>{let r=e.segments[n];return!!(r.dynamic&&r.patternRe.test(t)||!r.dynamic&&r.pattern===t)}))return!0}return!1}}})),Jp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=mp(),n=qp();e.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t}getFilter(e,t,n){let r=this._getMatcher(t),i=this._getNegativePatternsRe(n);return t=>this._filter(e,t,r,i)}_getMatcher(e){return new n.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let n=e.filter(t.pattern.isAffectDepthOfReadingPattern);return t.pattern.convertPatternsToRe(n,this._micromatchOptions)}_filter(e,n,r,i){if(this._isSkippedByDeep(e,n.path)||this._isSkippedSymbolicLink(n))return!1;let a=t.path.removeLeadingDotSegment(n.path);return this._isSkippedByPositivePatterns(a,r)?!1:this._isSkippedByNegativePatterns(a,i)}_isSkippedByDeep(e,t){return this._settings.deep===1/0?!1:this._getEntryLevel(e,t)>=this._settings.deep}_getEntryLevel(e,t){let n=t.split(`/`).length;return e===``?n:n-e.split(`/`).length}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,t){return!this._settings.baseNameMatch&&!t.match(e)}_isSkippedByNegativePatterns(e,n){return!t.pattern.matchAny(e,n)}}})),Yp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=mp();e.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t,this.index=new Map}getFilter(e,n){let[r,i]=t.pattern.partitionAbsoluteAndRelative(n),a={positive:{all:t.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:t.pattern.convertPatternsToRe(r,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:t.pattern.convertPatternsToRe(i,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return e=>this._filter(e,a)}_filter(e,n){let r=t.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(r)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e))return!1;let i=this._isMatchToPatternsSet(r,n,e.dirent.isDirectory());return this._settings.unique&&i&&this._createIndexRecord(r),i}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,t,n){return!(!this._isMatchToPatterns(e,t.positive.all,n)||this._isMatchToPatterns(e,t.negative.relative,n)||this._isMatchToAbsoluteNegative(e,t.negative.absolute,n))}_isMatchToAbsoluteNegative(e,n,r){if(n.length===0)return!1;let i=t.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(i,n,r)}_isMatchToPatterns(e,n,r){if(n.length===0)return!1;let i=t.pattern.matchAny(e,n);return!i&&r?t.pattern.matchAny(e+`/`,n):i}}})),Xp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=mp();e.default=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return t.errno.isEnoentCodeError(e)||this._settings.suppressErrors}}})),Zp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=mp();e.default=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let n=e.path;return this._settings.absolute&&(n=t.path.makeAbsolute(this._settings.cwd,n),n=t.path.unixify(n)),this._settings.markDirectories&&e.dirent.isDirectory()&&(n+=`/`),this._settings.objectMode?Object.assign(Object.assign({},e),{path:n}):n}}})),Qp=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=require(`path`),n=Jp(),r=Yp(),i=Xp(),a=Zp();e.default=class{constructor(e){this._settings=e,this.errorFilter=new i.default(this._settings),this.entryFilter=new r.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new n.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new a.default(this._settings)}_getRootDirectory(e){return t.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let t=e.base===`.`?``:e.base;return{basePath:t,pathSegmentSeparator:`/`,concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(t,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}}})),$p=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Gp(),n=Qp();e.default=class extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}async read(e){let t=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(t,e,n)).map(e=>n.transform(e))}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}})),em=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=require(`stream`),n=Wp(),r=Qp();e.default=class extends r.default{constructor(){super(...arguments),this._reader=new n.default(this._settings)}read(e){let n=this._getRootDirectory(e),r=this._getReaderOptions(e),i=this.api(n,e,r),a=new t.Readable({objectMode:!0,read:()=>{}});return i.once(`error`,e=>a.emit(`error`,e)).on(`data`,e=>a.emit(`data`,r.transform(e))).once(`end`,()=>a.emit(`end`)),a.once(`close`,()=>i.destroy()),a}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}})),tm=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=bp(),n=Hp(),r=Up();e.default=class extends r.default{constructor(){super(...arguments),this._walkSync=n.walkSync,this._statSync=t.statSync}dynamic(e,t){return this._walkSync(e,t)}static(e,t){let n=[];for(let r of e){let e=this._getFullEntryPath(r),i=this._getEntry(e,r,t);i===null||!t.entryFilter(i)||n.push(i)}return n}_getEntry(e,t,n){try{let n=this._getStat(e);return this._makeEntry(n,t)}catch(e){if(n.errorFilter(e))return null;throw e}}_getStat(e){return this._statSync(e,this._fsStatSettings)}}})),nm=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=tm(),n=Qp();e.default=class extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}read(e){let t=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(t,e,n).map(n.transform)}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}})),rm=e.lt((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;let t=require(`fs`),n=require(`os`),r=Math.max(n.cpus().length,1);e.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:t.lstat,lstatSync:t.lstatSync,stat:t.stat,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync},e.default=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,r),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,t){return e===void 0?t:e}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},e.DEFAULT_FILE_SYSTEM_ADAPTER),t)}}})),im=e.lt(((e,t)=>{let n=hp(),r=$p(),i=em(),a=nm(),o=rm(),s=mp();async function c(e,t){u(e);let n=l(e,r.default,t),i=await Promise.all(n);return s.array.flatten(i)}(function(e){e.glob=e,e.globSync=t,e.globStream=r,e.async=e;function t(e,t){u(e);let n=l(e,a.default,t);return s.array.flatten(n)}e.sync=t;function r(e,t){u(e);let n=l(e,i.default,t);return s.stream.merge(n)}e.stream=r;function c(e,t){u(e);let r=[].concat(e),i=new o.default(t);return n.generate(r,i)}e.generateTasks=c;function d(e,t){u(e);let n=new o.default(t);return s.pattern.isDynamicPattern(e,n)}e.isDynamicPattern=d;function f(e){return u(e),s.path.escape(e)}e.escapePath=f;function p(e){return u(e),s.path.convertPathToPattern(e)}e.convertPathToPattern=p,(function(e){function t(e){return u(e),s.path.escapePosixPath(e)}e.escapePath=t;function n(e){return u(e),s.path.convertPosixPathToPattern(e)}e.convertPathToPattern=n})(e.posix||={}),(function(e){function t(e){return u(e),s.path.escapeWindowsPath(e)}e.escapePath=t;function n(e){return u(e),s.path.convertWindowsPathToPattern(e)}e.convertPathToPattern=n})(e.win32||={})})(c||={});function l(e,t,r){let i=[].concat(e),a=new o.default(r),s=n.generate(i,a),c=new t(a);return s.map(c.read,c)}function u(e){if(![].concat(e).every(e=>s.string.isString(e)&&!s.string.isEmpty(e)))throw TypeError(`Patterns must be a string (non empty) or an array of strings`)}t.exports=c})),am=e.dt(im(),1);const om=new Set([`help`,`version`,`outdated`,`init`,`dry-run`,`clean`,`config`,`plugins`]),sm=new Map([[`--trace`,`trace`],[`--debug`,`debug`],[`--info`,`info`],[`--warn`,`warn`],[`--error`,`error`]]),cm=new Map([[`trace`,0],[`debug`,1],[`info`,2],[`warn`,3],[`error`,4]]);function lm(e){let t=[...e],n=t[0];n!=null&&um(n)&&t.shift();let r=t[0];return r!=null&&dm(r)&&t.shift(),t}function um(e){let t=[`node`,`nodejs`,`bun`,`deno`,`tsx`,`ts-node`,`npx`,`pnpx`,`yarn`,`pnpm`],n=e.toLowerCase().replaceAll(`\\`,`/`);return t.some(e=>RegExp(`(?:^|/)${e}(?:\\.exe|\\.cmd|\\.ps1)?$`,`i`).test(n)||n===e)}function dm(e){return/\.(?:m?[jt]s|cjs)$/.test(e)||/[/\\]/.test(e)&&!e.startsWith(`-`)?!0:/^(?:@[\w-]+\/)?[\w-]+$/.test(e)&&!e.startsWith(`-`)}function fm(e){let{logLevelFlags:t}=e;if(t.length===0)return;let n=t[0],r=cm.get(n)??4;for(let e of t){let t=cm.get(e)??4;t<r&&(r=t,n=e)}return n}function pm(e){let t={subcommand:void 0,helpFlag:!1,versionFlag:!1,dryRun:!1,jsonFlag:!1,showFlag:!1,logLevel:void 0,logLevelFlags:[],setOption:[],unknownCommand:void 0,positional:[],unknown:[]},n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(i!=null){if(i===`--`){t.positional.push(...e.slice(r+1).filter(e=>e!=null));break}if(i.startsWith(`--`)){let n=i.split(`=`),a=n[0]??``,o=sm.get(a);if(o!=null){t.logLevelFlags.push(o),t.logLevel=o;continue}switch(a){case`--help`:t.helpFlag=!0;break;case`--version`:t.versionFlag=!0;break;case`--dry-run`:t.dryRun=!0;break;case`--json`:t.jsonFlag=!0;break;case`--show`:t.showFlag=!0;break;case`--set`:if(n.length>1){let e=n.slice(1).join(`=`),r=e.indexOf(`=`);r>0&&t.setOption.push([e.slice(0,r),e.slice(r+1)])}else{let n=e[r+1];if(n!=null){let e=n.indexOf(`=`);e>0&&(t.setOption.push([n.slice(0,e),n.slice(e+1)]),r++)}}break;default:t.unknown.push(i)}continue}if(i.startsWith(`-`)&&i.length>1){let e=i.slice(1);for(let n of e)switch(n){case`h`:t.helpFlag=!0;break;case`v`:t.versionFlag=!0;break;case`n`:t.dryRun=!0;break;case`j`:t.jsonFlag=!0;break;default:t.unknown.push(`-${n}`)}continue}if(!n){n=!0,om.has(i)?t.subcommand=i:t.unknownCommand=i;continue}t.positional.push(i)}}return t}let mm;function hm(){return mm??=e.t(),mm}function gm(e){return hm().resolve(e)}const _m={workspace:{strategy:`mergeProjects`,getter:e=>e.workspace},vscodeConfigFiles:{strategy:`concat`,getter:e=>e.vscodeConfigFiles},jetbrainsConfigFiles:{strategy:`concat`,getter:e=>e.jetbrainsConfigFiles},editorConfigFiles:{strategy:`concat`,getter:e=>e.editorConfigFiles},commands:{strategy:`concat`,getter:e=>e.commands},subAgents:{strategy:`concat`,getter:e=>e.subAgents},skills:{strategy:`concat`,getter:e=>e.skills},rules:{strategy:`concat`,getter:e=>e.rules},aiAgentIgnoreConfigFiles:{strategy:`concat`,getter:e=>e.aiAgentIgnoreConfigFiles},readmePrompts:{strategy:`concat`,getter:e=>e.readmePrompts},globalMemory:{strategy:`override`,getter:e=>e.globalMemory},aindexDir:{strategy:`override`,getter:e=>e.aindexDir},globalGitIgnore:{strategy:`override`,getter:e=>e.globalGitIgnore},shadowGitExclude:{strategy:`override`,getter:e=>e.shadowGitExclude}};function vm(e,t){return t==null?e??[]:e==null?t:[...e,...t]}function ym(e,t){let n=new Map;for(let t of e.projects)n.set(t.name,t);for(let e of t.projects)n.set(e.name,e);return{directory:t.directory??e.directory,projects:[...n.values()]}}function bm(e,t){return t==null?e:e==null?t:ym(e,t)}function xm(e,t,n){switch(n){case`concat`:return vm(e,t);case`override`:return t??e;case`mergeProjects`:return bm(e,t);default:return t??e}}function Sm(e){let t={};for(let[n,r]of e)r!=null&&(t[n]=r);return t}function Cm(e,t){let n=new Map;for(let[r,i]of Object.entries(_m)){let a=xm(i.getter(e),i.getter(t),i.strategy);n.set(r,a)}return Sm(n)}function wm(e,t,n){if((e.dependsOn??[]).length===0)return{};let r=Tm(e,t),i={};for(let e of r){let r=t.get(e);r!=null&&(i=n(i,r))}return i}function Tm(e,t){let n=new Set,r=[];return(e=>{for(let i of e)n.has(i)||(n.add(i),t.get(i)!=null&&r.push(i))})(e.dependsOn??[]),r}function Em(t){let n=new Set(t.map(e=>e.name));for(let r of t){let t=r.dependsOn??[];for(let i of t)if(!n.has(i))throw new e.Z(r.name,i)}}function Dm(e,t){let n=new Set;for(let[e,r]of t)r>0&&n.add(e);let r=new Map;for(let t of e)if(n.has(t.name)){let e=(t.dependsOn??[]).filter(e=>n.has(e));r.set(t.name,e)}let i=new Set,a=[],o=e=>{if(a.includes(e))return a.push(e),!0;if(i.has(e))return!1;i.add(e),a.push(e);for(let t of r.get(e)??[])if(o(t))return!0;return a.pop(),!1};for(let e of n){if(o(e)){let e=a.indexOf(a.at(-1));return a.slice(e)}i.clear(),a.length=0}return[...n]}function Om(t){Em(t);let n=new Map;for(let e of t)n.set(e.name,e);let r=new Map;for(let e of t)r.set(e.name,0);let i=new Map;for(let e of t)i.set(e.name,[]);for(let e of t){let t=e.dependsOn??[];for(let n of t){r.set(e.name,(r.get(e.name)??0)+1);let t=i.get(n)??[];t.push(e.name),i.set(n,t)}}let a=[];for(let e of t)r.get(e.name)===0&&a.push(e.name);let o=[],s=new Map;for(let e=0;e<t.length;e++){let n=t[e];n!=null&&s.set(n.name,e)}for(;a.length>0;){let e=a.shift(),t=n.get(e);o.push(t);let c=(i.get(e)??[]).sort((e,t)=>(s.get(e)??-1)-(s.get(t)??-1));for(let e of c){let t=(r.get(e)??0)-1;r.set(e,t),t===0&&a.push(e)}}if(o.length===t.length)return o;throw new e.X(Dm(t,r))}var km=class{logger;args;outputPlugins=[];constructor(...t){this.args=pm(lm(t.filter(e=>e!=null)));let n=fm(this.args);n!=null&&e.ct(n),this.logger=e.st(`PluginPipeline`,n),this.logger.debug(`initialized`,{args:this.args})}registerOutputPlugins(e){return this.outputPlugins.push(...e),this}async run(t){e.l(this.logger);let{context:n,outputPlugins:r,userConfigOptions:i}=t;this.registerOutputPlugins([...r]);let a=this.resolveCommand();this.args.jsonFlag&&(e.ct(`silent`),new Set([`config-show`,`plugins`]).has(a.name)||(a=new(await(Promise.resolve().then(()=>require(`./commands-Clj_c60T.cjs`)))).JsonOutputCommand(a)));let o=this.createCommandContext(n,i);await a.execute(o)}resolveCommand(){return gm(this.args)}createCommandContext(e,t){return{logger:this.logger,outputPlugins:this.outputPlugins,collectedInputContext:e,userConfigOptions:t,createCleanContext:t=>this.createCleanContext(e,t),createWriteContext:t=>this.createWriteContext(e,t)}}createCleanContext(e,t){return{logger:this.logger,fs:n,path:r,glob:am.default,collectedInputContext:e,dryRun:t}}createWriteContext(e,t){return{logger:this.logger,fs:n,path:r,glob:am.default,collectedInputContext:e,dryRun:t,registeredPluginNames:this.outputPlugins.map(e=>e.name)}}async executePluginsInOrder(e,t,n=!1,r){if(e.length===0)return{};let i=Om(e),a=new Uf({userConfig:r}).collect(),o=new Gf;o.setGlobalScope(a),this.logger.debug(`global scope collected`,{osInfo:{platform:a.os.platform,arch:a.os.arch,shellKind:a.os.shellKind},hasProfile:Object.keys(a.profile).length>0,hasTool:Object.keys(a.tool).length>0});let s=new Map,c={};for(let e of i){let r=this.buildDependencyContext(e,s),i={...t,dependencyContext:r,globalScope:a,scopeRegistry:o},l=e;l.executeEffects!=null&&await l.executeEffects(i,n);let u=await e.collect(i);s.set(e.name,u),c=Cm(c,u);let d=e;if(d.getRegisteredScopes!=null){let t=d.getRegisteredScopes();for(let{namespace:n,values:r}of t)o.register(n,r,Wf.PluginRegistered),this.logger.debug(`plugin scope registered`,{plugin:e.name,namespace:n,keys:Object.keys(r)})}}return c}buildDependencyContext(e,t){return wm(e,t,Cm)}},Am=class extends e.ot{globalConfigDir;outputFileName;indexignore;registryWriterCache=new Map;writeEffects=[];cleanEffects=[];constructor(t,n){super(t,e.nt.Output,n?.dependsOn),this.globalConfigDir=n?.globalConfigDir??``,this.outputFileName=n?.outputFileName??``,this.indexignore=n?.indexignore}resolvePromptSourceProjectConfig(e){let{projects:t}=e.collectedInputContext.workspace;return t.find(e=>e.isPromptSourceProject===!0)?.projectConfig??t[0]?.projectConfig}registerWriteEffect(e,t){this.writeEffects.push({name:e,handler:t})}registerCleanEffect(e,t){this.cleanEffects.push({name:e,handler:t})}async executeWriteEffects(e){let t=[];for(let n of this.writeEffects){if(e.dryRun===!0){this.log.trace({action:`dryRun`,type:`effect`,name:n.name}),t.push({success:!0,description:`Would execute write effect: ${n.name}`});continue}try{let r=await n.handler(e);if(r.success)this.log.trace({action:`effect`,name:n.name,status:`success`});else{let e=r.error instanceof Error?r.error.message:String(r.error);this.log.error({action:`effect`,name:n.name,status:`failed`,error:e})}t.push(r)}catch(e){let r=e instanceof Error?e.message:String(e);this.log.error({action:`effect`,name:n.name,status:`failed`,error:r}),t.push({success:!1,error:e,description:`Write effect failed: ${n.name}`})}}return t}async executeCleanEffects(e){let t=[];for(let n of this.cleanEffects){if(e.dryRun===!0){this.log.trace({action:`dryRun`,type:`effect`,name:n.name}),t.push({success:!0,description:`Would execute clean effect: ${n.name}`});continue}try{let r=await n.handler(e);if(r.success)this.log.trace({action:`effect`,name:n.name,status:`success`});else{let e=r.error instanceof Error?r.error.message:String(r.error);this.log.error({action:`effect`,name:n.name,status:`failed`,error:e})}t.push(r)}catch(e){let r=e instanceof Error?e.message:String(e);this.log.error({action:`effect`,name:n.name,status:`failed`,error:r}),t.push({success:!1,error:e,description:`Clean effect failed: ${n.name}`})}}return t}isRelativePath(t){return t.pathKind===e.$.Relative}toRelativePath(t){return this.isRelativePath(t)?t:{pathKind:e.$.Relative,path:t.path,basePath:``,getDirectoryName:t.getDirectoryName,getAbsolutePath:()=>t.path}}resolveFullPath(n,i){let a;a=n.pathKind===e.$.Absolute?n.path:this.isRelativePath(n)?r.resolve(n.basePath,n.path):r.resolve(t.default.cwd(),n.path);let o=i??this.outputFileName;return o?r.join(a,o):a}createRelativePath(t,n,r){return e.R(t,n,r)}createFileRelativePath(t,n){return e.L(t,n)}getGlobalConfigDir(){return r.join(this.getHomeDir(),this.globalConfigDir)}getHomeDir(){return a.homedir()}joinPath(...e){return r.join(...e)}resolvePath(...e){return r.resolve(...e)}dirname(e){return r.dirname(e)}basename(e,t){return r.basename(e,t)}writeFileSync(t,n,r=`utf8`){e.G(t,n,r)}writeFileSyncBuffer(t,n){e.G(t,n)}ensureDirectory(t){e.B(t)}existsSync(e){return n.existsSync(e)}lstatSync(t){return e.U(t)}isSymlink(t){return e.H(t)}createSymlink(t,n,r=`dir`){e.z(t,n,r)}removeSymlink(t){e.W(t)}async writeDirectorySymlink(t,n,i,a){let o=r.dirname(i),s=e.R(r.basename(i),o,()=>r.basename(o));if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`symlink`,target:n,link:i,label:a}),{path:s,success:!0,skipped:!1};try{return this.createSymlink(n,i,`dir`),this.log.trace({action:`write`,type:`symlink`,target:n,link:i,label:a}),{path:s,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`symlink`,target:n,link:i,label:a,error:t}),{path:s,success:!1,error:e}}}readdirSync(e,t){return t?.withFileTypes===!0?n.readdirSync(e,{withFileTypes:!0}):n.readdirSync(e)}getIgnoreOutputPath(){if(this.indexignore!=null)return this.indexignore}registerProjectIgnoreOutputFiles(t){let n=this.getIgnoreOutputPath();if(n==null)return[];let i=[];for(let a of t){let t=a.dirFromWorkspacePath;if(t==null||a.isPromptSourceProject===!0)continue;let o=r.join(t.path,n);i.push({pathKind:e.$.Relative,path:o,basePath:t.basePath,getDirectoryName:()=>r.basename(t.path),getAbsolutePath:()=>r.join(t.basePath,o)})}return i}async writeProjectIgnoreFiles(t){let i=this.getIgnoreOutputPath();if(i==null)return[];let{workspace:a,aiAgentIgnoreConfigFiles:o}=t.collectedInputContext,s=[];if(o==null||o.length===0)return s;let c=o.find(e=>e.fileName===this.indexignore);if(c==null)return s;for(let o of a.projects){let a=o.dirFromWorkspacePath;if(a==null||o.isPromptSourceProject===!0)continue;let l=`project:${o.name??`unknown`}/${c.fileName}`,u=r.join(a.path,i),d=r.join(a.basePath,u),f={pathKind:e.$.Relative,path:u,basePath:a.basePath,getDirectoryName:()=>r.basename(a.path),getAbsolutePath:()=>d};if(t.dryRun===!0){this.log.trace({action:`dryRun`,type:`ignoreFile`,path:d,label:l}),s.push({path:f,success:!0,skipped:!1});continue}try{n.mkdirSync(r.dirname(d),{recursive:!0}),n.writeFileSync(d,c.content,`utf8`),this.log.trace({action:`write`,type:`ignoreFile`,path:d,label:l}),s.push({path:f,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`ignoreFile`,path:d,label:l,error:t}),s.push({path:f,success:!1,error:e})}}return s}async writeFile(t,n,i,a){let o=r.dirname(n),s=e.R(r.basename(n),o,()=>r.basename(o));if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`file`,path:n,label:a}),{path:s,success:!0,skipped:!1};try{return this.ensureDirectory(o),e.G(n,i),this.log.trace({action:`write`,type:`file`,path:n,label:a}),{path:s,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`file`,path:n,label:a,error:t}),{path:s,success:!1,error:e}}}async writePromptFile(t,n,r,i){let a=this.resolveFullPath(n),o=this.toRelativePath(n);if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`promptFile`,path:a,label:i}),{path:o,success:!0,skipped:!1};try{return e.G(a,r),this.log.trace({action:`write`,type:`promptFile`,path:a,label:i}),{path:o,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`promptFile`,path:a,label:i,error:t}),{path:o,success:!1,error:e}}}buildMarkdownContent(e,t){return hd(t,e)}buildMarkdownContentWithRaw(e,t,n){return t!=null&&Object.keys(t).length>0?hd(t,e):n!=null&&n.length>0?`---\n${n}\n---\n${e}`:e}extractGlobalMemoryContent(e){return e.collectedInputContext.globalMemory?.content}combineGlobalWithContent(e,t,n){let{separator:r=`
|
|
93
|
-
|
|
94
|
-
`,skipIfEmpty:i=!0,position:a=`before`}=n??{};if(i&&(e==null||e.trim().length===0))return t;let o=e??``;return a===`after`?`${t}${r}${o}`:`${o}${r}${t}`}transformCommandName(e,t){let{includeSeriesPrefix:n=!0,seriesSeparator:r=`-`}=t??{};return!n||e.commandPrefix==null?`${e.commandName}.md`:`${e.commandPrefix}${r}${e.commandName}.md`}getCommandSeriesOptions(e){let t=e.pluginOptions?.commandSeriesOptions,n=t?.pluginOverrides?.[this.name],r=n?.includeSeriesPrefix??t?.includeSeriesPrefix,i=n?.seriesSeparator;return r!=null&&i!=null?{includeSeriesPrefix:r,seriesSeparator:i}:r==null?i==null?{}:{seriesSeparator:i}:{includeSeriesPrefix:r}}getTransformOptionsFromContext(e,t){let n=this.getCommandSeriesOptions(e),r=n.includeSeriesPrefix??t?.includeSeriesPrefix,i=n.seriesSeparator??t?.seriesSeparator;return r!=null&&i!=null?{includeSeriesPrefix:r,seriesSeparator:i}:r==null?i==null?{}:{seriesSeparator:i}:{includeSeriesPrefix:r}}shouldSkipDueToPlugin(e,t){let n=e.registeredPluginNames;return n==null?!1:n.includes(t)}async onWriteComplete(e,t){let n=t.files.filter(e=>e.success).length,r=t.files.filter(e=>e.skipped).length,i=t.files.filter(e=>!e.success&&!e.skipped).length;this.log.trace({action:e.dryRun===!0?`dryRun`:`complete`,type:`writeSummary`,success:n,skipped:r,failed:i}),await this.executeWriteEffects(e)}async onCleanComplete(e){await this.executeCleanEffects(e)}getRegistryWriter(e){let t=e.name,n=this.registryWriterCache.get(t);if(n!=null)return n;let r=new e(this.log);return this.registryWriterCache.set(t,r),r}async registerInRegistry(e,t,n){return e.register(t,n.dryRun)}normalizeRuleScope(e){return e.scope??`project`}handleError(e,t){let n=e instanceof Error?e.message:String(e);return this.log.error({...t,error:n}),{success:!1,error:e}}async executeWriteOperation(e,t){let{ctx:n,type:r,fullPath:i,relativePath:a,label:o}=e;if(n.dryRun===!0)return this.log.trace({action:`dryRun`,type:r,path:i,label:o}),{path:a,success:!0,skipped:!1};try{let e=await t();return this.log.trace({action:`write`,type:r,path:i,label:o}),e}catch(e){return{...this.handleError(e,{action:`write`,type:r,path:i,label:o}),path:a}}}buildSkillFrontMatter(e,t){let n=e.yamlFrontMatter,r={name:n.name,description:n.description};return`displayName`in n&&n.displayName!=null&&(r.displayName=n.displayName),`keywords`in n&&n.keywords!=null&&n.keywords.length>0&&(r.keywords=n.keywords),`author`in n&&n.author!=null&&(r.author=n.author),`version`in n&&n.version!=null&&(r.version=n.version),(t?.includeTools??!0)&&`allowTools`in n&&n.allowTools!=null&&n.allowTools.length>0&&(r.allowTools=(t?.toolFormat??`array`)===`string`?n.allowTools.join(`,`):n.allowTools),t?.additionalFields!=null&&Object.assign(r,t.additionalFields),r}buildRuleContent(e,t){let n=e.globs.length>0?e.globs.join(t.globJoinPattern):``;return hd({alwaysApply:t.alwaysApply,globs:t.frontMatterFormatter?t.frontMatterFormatter(n):n,...t.additionalFrontMatter},e.content)}buildRuleFileName(e,t=`rule-`){return`${t}${e.series}-${e.ruleName}.mdc`}async writeFileWithHandling(e,t,n,i){let a=await this.executeWriteOperation({ctx:e,type:i.type,fullPath:t,relativePath:i.relativePath,label:i.label},async()=>(this.ensureDirectory(r.dirname(t)),this.writeFileSync(t,n),{path:i.relativePath,success:!0}));return`success`in a&&!a.success?a:{path:i.relativePath,success:!0}}};function jm(e,t){return e==null&&t==null?[]:[...new Set([...e??[],...t??[]])]}function Mm(e,t){return e==null||t.length===0?!0:typeof e==`string`?t.includes(e):e.some(e=>t.includes(e))}function Nm(e,t){if(e==null&&t==null)return{};let n={};for(let[t,r]of Object.entries(e??{}))n[t]=[...r];for(let[e,r]of Object.entries(t??{}))n[e]=Object.hasOwn(n,e)?[...new Set([...n[e],...r])]:[...r];return n}function Pm(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.matchesSeries==`function`&&typeof t.resolveEffectiveIncludeSeries==`function`&&typeof t.resolveSubSeries==`function`}function Fm(){let e={"win32-x64":`win32-x64-msvc`,"linux-x64":`linux-x64-gnu`,"linux-arm64":`linux-arm64-gnu`,"darwin-arm64":`darwin-arm64`,"darwin-x64":`darwin-x64`}[`${t.default.platform}-${t.default.arch}`];if(e==null)return;let n=`@truenine/memory-sync-cli-${e}`,r=`napi-memory-sync-cli.${e}.node`;try{let e=(0,o.createRequire)(require(`url`).pathToFileURL(__filename).href),t=[n,`${n}/${r}`,`./${r}`];for(let n of t)try{let t=e(n),r=[t,t?.default,t?.config];for(let e of r)if(Pm(e))return e}catch{}}catch{}}const{resolveEffectiveIncludeSeries:Im,matchesSeries:Lm,resolveSubSeries:Rm}=Fm()??{resolveEffectiveIncludeSeries:jm,matchesSeries:Mm,resolveSubSeries:Nm};function zm(e,t,n){let r=Im(t?.includeSeries,t?.[n]?.includeSeries);return e.filter(e=>Lm(e.seriName,r))}function Bm(e,t){return zm(e,t,`commands`)}function $(e,t){return zm(e,t,`skills`)}function Vm(e,t){return zm(e,t,`subAgents`)}function Hm(e,t){return zm(e,t,`rules`)}function Um(e){let t=r.join(e,`.git`);if(!n.existsSync(t))return null;let i=n.lstatSync(t);if(i.isDirectory())return r.join(t,`info`);if(i.isFile())try{let i=n.readFileSync(t,`utf8`).trim(),a=/^gitdir: (.+)$/.exec(i);if(a?.[1]!=null){let t=r.resolve(e,a[1]);return r.join(t,`info`)}}catch{}return null}function Wm(e,t=5){let i=[],a=new Set([`node_modules`,`.turbo`,`dist`,`build`,`out`,`.cache`]);function o(s,c){if(c>t)return;let l;try{let e=n.readdirSync(s,{withFileTypes:!0});if(!Array.isArray(e))return;l=e}catch{return}l.some(e=>e.name===`.git`)&&s!==e&&i.push(s);for(let e of l)e.isDirectory()&&(e.name===`.git`||a.has(e.name)||o(r.join(s,e.name),c+1))}return o(e,0),i}function Gm(e){let t=r.join(e,`modules`);if(!n.existsSync(t))return[];let i=[];function a(e){let t;try{let r=n.readdirSync(e,{withFileTypes:!0});if(!Array.isArray(r))return;t=r}catch{return}if(t.some(e=>e.name===`info`&&e.isDirectory())&&i.push(r.join(e,`info`)),t.find(e=>e.name===`modules`&&e.isDirectory())==null)return;let o;try{let t=n.readdirSync(r.join(e,`modules`),{withFileTypes:!0});if(!Array.isArray(t))return;o=t}catch{return}for(let t of o)t.isDirectory()&&a(r.join(e,`modules`,t.name))}let o;try{let e=n.readdirSync(t,{withFileTypes:!0});if(!Array.isArray(e))return i;o=e}catch{return i}for(let e of o)e.isDirectory()&&a(r.join(t,e.name));return i}function Km(e){let t=e.replaceAll(/\.\/+/g,``);return t=t.replaceAll(/\/+$/g,``),t}function qm(e,t){return t.startsWith(`**/`)?`${e}/${t}`:t.startsWith(`*`)?`${e}/**/${t}`:`${e}/${t}`}function Jm(e,t){for(let n of t){let t=n.replaceAll(/\/+$/g,``),r=[{prefix:t,pattern:`${t}/`},{prefix:t,pattern:`${t}\\`}];for(let{prefix:t,pattern:n}of r)if(e.startsWith(n))return{prefix:t,baseGlob:e.slice(n.length)};if(e===t)return{prefix:t,baseGlob:`**/*`}}return{prefix:null,baseGlob:e}}function Ym(e,t){let n=Rm(t?.subSeries,t?.rules?.subSeries);if(Object.keys(n).length===0)return e;let r={};for(let[e,t]of Object.entries(n)){let n=Km(e);r[n]=t}let i=Object.keys(r);return e.map(e=>{if(e.seriName==null)return e;let t=[];for(let[n,i]of Object.entries(r))(Array.isArray(e.seriName)?e.seriName.some(e=>i.includes(e)):i.includes(e.seriName))&&t.push(n);if(t.length===0)return e;let n=[];for(let r of e.globs){let{prefix:e,baseGlob:a}=Jm(r,i);e!=null&&n.push(r);for(let r of t){if(r===e)continue;let t=qm(r,a);n.includes(t)||n.push(t)}}return{...e,globs:n}})}var Xm=class extends Am{commandsSubDir;agentsSubDir;skillsSubDir;supportsCommands;supportsSubAgents;supportsSkills;toolPreset;constructor(e,t){super(e,t),this.commandsSubDir=t.commandsSubDir??`commands`,this.agentsSubDir=t.agentsSubDir??`agents`,this.skillsSubDir=t.skillsSubDir??`skills`,this.supportsCommands=t.supportsCommands??!0,this.supportsSubAgents=t.supportsSubAgents??!0,this.supportsSkills=t.supportsSkills??!0,t.toolPreset!==void 0&&(this.toolPreset=t.toolPreset)}async registerGlobalOutputDirs(e){return[]}async registerProjectOutputDirs(e){let t=[],{projects:n}=e.collectedInputContext.workspace,i=[];if(this.supportsCommands&&i.push(this.commandsSubDir),this.supportsSubAgents&&i.push(this.agentsSubDir),this.supportsSkills&&i.push(this.skillsSubDir),this.log.debug(`registerProjectOutputDirs`,{plugin:this.name,projectCount:n.length,supportsCommands:this.supportsCommands,supportsSubAgents:this.supportsSubAgents,supportsSkills:this.supportsSkills,subdirs:i,commandsCount:e.collectedInputContext.commands?.length??0,subAgentsCount:e.collectedInputContext.subAgents?.length??0,skillsCount:e.collectedInputContext.skills?.length??0}),i.length===0)return this.log.debug(`no subdirs to register`,{plugin:this.name}),[];for(let e of n){if(e.dirFromWorkspacePath==null){this.log.debug(`project has no dirFromWorkspacePath`,{plugin:this.name,projectName:e.name});continue}for(let n of i){let i=r.join(e.dirFromWorkspacePath.path,this.globalConfigDir,n);t.push(this.createRelativePath(i,e.dirFromWorkspacePath.basePath,()=>n)),this.log.debug(`registered output dir`,{plugin:this.name,project:e.name,subdir:n,dirPath:i})}}return this.log.debug(`registerProjectOutputDirs complete`,{plugin:this.name,dirCount:t.length}),t}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace;this.log.debug(`registerProjectOutputFiles start`,{plugin:this.name,projectCount:n.length,commandsAvailable:e.collectedInputContext.commands!=null,commandsCount:e.collectedInputContext.commands?.length??0,subAgentsAvailable:e.collectedInputContext.subAgents!=null,subAgentsCount:e.collectedInputContext.subAgents?.length??0,skillsAvailable:e.collectedInputContext.skills!=null,skillsCount:e.collectedInputContext.skills?.length??0});for(let i of n){if(this.log.debug(`processing project`,{plugin:this.name,projectName:i.name,hasRootMemory:i.rootMemoryPrompt!=null,childMemoryCount:i.childMemoryPrompts?.length??0,hasDirFromWorkspace:i.dirFromWorkspacePath!=null,projectConfig:i.projectConfig}),i.rootMemoryPrompt!=null&&i.dirFromWorkspacePath!=null&&t.push(this.createFileRelativePath(i.dirFromWorkspacePath,this.outputFileName)),i.childMemoryPrompts!=null)for(let e of i.childMemoryPrompts)e.dir!=null&&this.isRelativePath(e.dir)&&t.push(this.createFileRelativePath(e.dir,this.outputFileName));if(i.dirFromWorkspacePath==null){this.log.debug(`project has no dirFromWorkspacePath, skipping`,{plugin:this.name,projectName:i.name});continue}let{projectConfig:n}=i,a=r.join(i.dirFromWorkspacePath.path,this.globalConfigDir),o={includeSeriesPrefix:!0};if(this.supportsCommands&&e.collectedInputContext.commands!=null){let s=e.collectedInputContext.commands,c=Bm(s,n);this.log.debug(`filtering commands`,{plugin:this.name,projectName:i.name,totalCommands:s.length,filteredCommands:c.length,projectConfig:n});for(let e of c){let n=this.transformCommandName(e,o);t.push(this.createRelativePath(r.join(a,this.commandsSubDir,n),i.dirFromWorkspacePath.basePath,()=>this.commandsSubDir)),this.log.debug(`registered command file`,{plugin:this.name,project:i.name,fileName:n})}}else this.log.debug(`commands skipped`,{plugin:this.name,supportsCommands:this.supportsCommands,hasCommands:e.collectedInputContext.commands!=null});if(this.supportsSubAgents&&e.collectedInputContext.subAgents!=null){let o=e.collectedInputContext.subAgents,s=Vm(o,n);this.log.debug(`filtering subAgents`,{plugin:this.name,projectName:i.name,totalSubAgents:o.length,filteredSubAgents:s.length,projectConfig:n});for(let e of s){let n=e.dir.path.replace(/\.mdx$/,`.md`);t.push(this.createRelativePath(r.join(a,this.agentsSubDir,n),i.dirFromWorkspacePath.basePath,()=>this.agentsSubDir)),this.log.debug(`registered agent file`,{plugin:this.name,project:i.name,fileName:n})}}else this.log.debug(`subAgents skipped`,{plugin:this.name,supportsSubAgents:this.supportsSubAgents,hasSubAgents:e.collectedInputContext.subAgents!=null});if(this.supportsSkills&&e.collectedInputContext.skills!=null){let o=e.collectedInputContext.skills,s=$(o,n);this.log.debug(`filtering skills`,{plugin:this.name,projectName:i.name,totalSkills:o.length,filteredSkills:s.length});for(let e of s){let n=e.yamlFrontMatter?.name??e.dir.getDirectoryName(),o=r.join(a,this.skillsSubDir,n);if(t.push(this.createRelativePath(r.join(o,`SKILL.md`),i.dirFromWorkspacePath.basePath,()=>n)),e.childDocs!=null)for(let a of e.childDocs){let e=a.dir.path.replace(/\.mdx$/,`.md`),s=r.join(o,e);t.push(this.createRelativePath(s,i.dirFromWorkspacePath.basePath,()=>n))}if(e.resources!=null)for(let a of e.resources){let e=r.join(o,a.relativePath);t.push(this.createRelativePath(e,i.dirFromWorkspacePath.basePath,()=>n))}}}else this.log.debug(`skills skipped`,{plugin:this.name,supportsSkills:this.supportsSkills,hasSkills:e.collectedInputContext.skills!=null})}return this.log.debug(`registerProjectOutputFiles complete`,{plugin:this.name,fileCount:t.length}),t}async registerGlobalOutputFiles(e){let{globalMemory:t}=e.collectedInputContext;if(t==null)return[];let n=this.getGlobalConfigDir();return[this.createRelativePath(this.outputFileName,n,()=>this.globalConfigDir)]}async canWrite(e){let{workspace:t,globalMemory:n,commands:r,subAgents:i,skills:a}=e.collectedInputContext,o=t.projects.some(e=>e.rootMemoryPrompt!=null||(e.childMemoryPrompts?.length??0)>0),s=n!=null,c=this.supportsCommands&&(r?.length??0)>0&&t.projects.length>0,l=this.supportsSubAgents&&(i?.length??0)>0&&t.projects.length>0,u=this.supportsSkills&&(a?.length??0)>0&&t.projects.length>0;return this.log.debug(`canWrite check`,{plugin:this.name,hasProjectOutputs:o,hasGlobalMemory:s,hasProjectLevelCommands:c,hasProjectLevelSubAgents:l,hasProjectLevelSkills:u,projectCount:t.projects.length,commandsCount:r?.length??0,subAgentsCount:i?.length??0,skillsCount:a?.length??0,supportsCommands:this.supportsCommands,supportsSubAgents:this.supportsSubAgents,supportsSkills:this.supportsSkills}),o||s||c||l||u?!0:(this.log.trace({action:`skip`,reason:`noOutputs`}),!1)}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,n=[],i=[];this.log.debug(`writeProjectOutputs start`,{plugin:this.name,projectCount:t.length,commandsCount:e.collectedInputContext.commands?.length??0,subAgentsCount:e.collectedInputContext.subAgents?.length??0,skillsCount:e.collectedInputContext.skills?.length??0});for(let i of t){let t=i.name??`unknown`,a=i.dirFromWorkspacePath;if(this.log.debug(`writing project outputs`,{plugin:this.name,projectName:t,hasProjectDir:a!=null,projectConfig:i.projectConfig}),a==null){this.log.debug(`project has no dirFromWorkspacePath, skipping`,{plugin:this.name,projectName:t});continue}if(i.rootMemoryPrompt!=null){let r=await this.writePromptFile(e,a,i.rootMemoryPrompt.content,`project:${t}/root`);n.push(r)}if(i.childMemoryPrompts!=null)for(let r of i.childMemoryPrompts){let i=await this.writePromptFile(e,r.dir,r.content,`project:${t}/child:${r.workingChildDirectoryPath?.path??`unknown`}`);n.push(i)}let{projectConfig:o}=i,s=r.join(a.basePath,a.path,this.globalConfigDir);if(this.supportsCommands&&e.collectedInputContext.commands!=null){let r=e.collectedInputContext.commands,i=Bm(r,o);this.log.debug(`writing commands`,{plugin:this.name,projectName:t,totalCommands:r.length,filteredCommands:i.length,projectConfig:o});for(let r of i){let i=await this.writeCommand(e,s,r);n.push(...i),this.log.debug(`wrote command`,{plugin:this.name,projectName:t,commandName:r.commandName,success:i.every(e=>e.success)})}}else this.log.debug(`commands not written`,{plugin:this.name,supportsCommands:this.supportsCommands,hasCommands:e.collectedInputContext.commands!=null});if(this.supportsSubAgents&&e.collectedInputContext.subAgents!=null){let r=e.collectedInputContext.subAgents,i=Vm(r,o);this.log.debug(`writing subAgents`,{plugin:this.name,projectName:t,totalSubAgents:r.length,filteredSubAgents:i.length,projectConfig:o});for(let r of i){let i=await this.writeSubAgent(e,s,r);n.push(...i),this.log.debug(`wrote subAgent`,{plugin:this.name,projectName:t,agentPath:r.dir.path,success:i.every(e=>e.success)})}}else this.log.debug(`subAgents not written`,{plugin:this.name,supportsSubAgents:this.supportsSubAgents,hasSubAgents:e.collectedInputContext.subAgents!=null});if(this.supportsSkills&&e.collectedInputContext.skills!=null){let r=e.collectedInputContext.skills,i=$(r,o);this.log.debug(`writing skills`,{plugin:this.name,projectName:t,totalSkills:r.length,filteredSkills:i.length});for(let r of i){let i=await this.writeSkill(e,s,r);n.push(...i),this.log.debug(`wrote skill`,{plugin:this.name,projectName:t,skillName:r.yamlFrontMatter?.name,success:i.every(e=>e.success)})}}else this.log.debug(`skills not written`,{plugin:this.name,supportsSkills:this.supportsSkills,hasSkills:e.collectedInputContext.skills!=null})}return{files:n,dirs:i}}async writeGlobalOutputs(t){let{globalMemory:n}=t.collectedInputContext,i=[],a=[];if(n==null)return{files:i,dirs:a};let o=this.getGlobalConfigDir(),s=r.join(o,this.outputFileName),c=this.createRelativePath(this.outputFileName,o,()=>this.globalConfigDir);if(t.dryRun===!0)this.log.trace({action:`dryRun`,type:`globalMemory`,path:s}),i.push({path:c,success:!0,skipped:!1});else try{e.G(s,n.content),this.log.trace({action:`write`,type:`globalMemory`,path:s}),i.push({path:c,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`globalMemory`,path:s,error:t}),i.push({path:c,success:!1,error:e})}return{files:i,dirs:a}}async writeCommand(e,t,n){let i=this.getTransformOptionsFromContext(e),a=this.transformCommandName(n,i),o=r.join(t,this.commandsSubDir),s=r.join(o,a),c=n.content,l=n.yamlFrontMatter,u=!1;if(n.rawMdxContent!=null&&this.toolPreset!=null){this.log.debug(`recompiling command with tool preset`,{file:n.dir.getAbsolutePath(),toolPreset:this.toolPreset,hasRawContent:!0});try{let e=new Uf({toolPreset:this.toolPreset}).collect(),t=await Lf(n.rawMdxContent,{globalScope:e,extractMetadata:!0,basePath:n.dir.basePath});c=t.content,l=t.metadata.fields,u=!0}catch(e){this.log.warn(`failed to recompile command, using default`,{file:n.dir.getAbsolutePath(),error:e instanceof Error?e.message:String(e)})}}let d=u?this.buildMarkdownContent(c,l):this.buildMarkdownContentWithRaw(c,l,n.rawFrontMatter);return[await this.writeFile(e,s,d,`command`)]}async writeSubAgent(e,t,n){let i=n.dir.path.replace(/\.mdx$/,`.md`),a=r.join(t,this.agentsSubDir),o=r.join(a,i),s=this.buildMarkdownContentWithRaw(n.content,n.yamlFrontMatter,n.rawFrontMatter);return[await this.writeFile(e,o,s,`subAgent`)]}async writeSkill(e,t,n){let i=[],a=n.yamlFrontMatter?.name??n.dir.getDirectoryName(),o=r.join(t,this.skillsSubDir,a),s=r.join(o,`SKILL.md`),c=this.buildMarkdownContentWithRaw(n.content,n.yamlFrontMatter,n.rawFrontMatter),l=await this.writeFile(e,s,c,`skill`);if(i.push(l),n.childDocs!=null)for(let r of n.childDocs){let n=await this.writeSkillReferenceDocument(e,o,a,r,t);i.push(...n)}if(n.resources!=null)for(let r of n.resources){let n=await this.writeSkillResource(e,o,a,r,t);i.push(...n)}return i}async writeSkillReferenceDocument(e,t,n,i,a){let o=i.dir.path.replace(/\.mdx$/,`.md`),s=r.join(t,o);return[await this.writeFile(e,s,i.content,`skillRefDoc`)]}async writeSkillResource(e,t,n,i,a){let o=r.join(t,i.relativePath);return[await this.writeFile(e,o,i.content,`skillResource`)]}normalizeRuleScope(e){return e.scope??`project`}};const Zm={SKILL:`SKILL.md`,CURSOR_GLOBAL_RULE:`global.mdc`,CURSOR_PROJECT_RULE:`always.md`,MCP_CONFIG:`mcp.json`,CLAUDE_MEMORY:`CLAUDE.md`,WINDSURF_GLOBAL_RULE:`global_rules.md`},Qm={RULE:`rule-`,CHILD_RULE:`glob-`},$m={RULES:`rules`,COMMANDS:`commands`,SKILLS:`skills`,AGENTS:`agents`,CURSOR_SKILLS:`skills-cursor`},eh={CURSOR:`.cursor`,CLAUDE:`.claude`,WINDSURF:`.codeium/windsurf`,WINDSURF_RULES:`.windsurf`},th={CURSOR:`.cursorignore`,WINDSURF:`.codeiumignore`},nh={CURSOR:new Set([`create-rule`,`create-skill`,`create-subagent`,`migrate-to-skills`,`update-cursor-settings`])};var rh=class{fs;logger;constructor(e){this.fs=e.fs,this.logger=e.logger}collectMcpServers(e){let t=new Map;for(let n of e)if(n.mcpConfig!=null)for(let[e,r]of Object.entries(n.mcpConfig.mcpServers))t.set(e,r),this.logger.debug(`mcp server collected`,{skill:n.yamlFrontMatter.name,mcpName:e});return t}transformMcpServers(e,t){let n={};for(let[r,i]of e)n[r]=t(i);return n}readExistingConfig(e){try{if(this.fs.existsSync(e)){let t=this.fs.readFileSync(e,`utf8`);return JSON.parse(t)}}catch{this.logger.warn(`failed to read existing mcp config, starting fresh`,{path:e})}return{}}writeCursorMcpConfig(e,t,n){let r=this.readExistingConfig(e);r.mcpServers={...r.mcpServers??{},...t};let i=JSON.stringify(r,null,2);return this.writeConfigFile(e,i,Object.keys(t).length,n)}writeOpencodeMcpConfig(e,t,n,r){let i={...this.readExistingConfig(e),...r,mcp:t},a=JSON.stringify(i,null,2);return this.writeConfigFile(e,a,Object.keys(t).length,n)}writeSkillMcpConfig(e,t,n){return this.writeConfigFile(e,t,1,n)}ensureDirectory(e){this.fs.existsSync(e)||this.fs.mkdirSync(e,{recursive:!0})}writeConfigFile(e,t,n,i){if(i)return this.logger.trace({action:`dryRun`,type:`mcpConfig`,path:e,serverCount:n}),{success:!0,path:e,serverCount:n,skipped:!0};try{return this.ensureDirectory(r.dirname(e)),this.fs.writeFileSync(e,t),this.logger.trace({action:`write`,type:`mcpConfig`,path:e,serverCount:n}),{success:!0,path:e,serverCount:n}}catch(t){let n=t instanceof Error?t.message:String(t);return this.logger.error({action:`write`,type:`mcpConfig`,path:e,error:n}),{success:!1,path:e,serverCount:0,error:t}}}};function ih(e){let t={};if(e.command!=null)return t.command=e.command,e.args!=null&&(t.args=e.args),e.env!=null&&(t.env=e.env),t;let n=e,r=n.url??n.serverUrl;if(r==null)return t;t.url=r;let{headers:i}=n;return i!=null&&(t.headers=i),t}function ah(e){let t={};if(e.command!=null){t.type=`local`;let n=[e.command];e.args!=null&&n.push(...e.args),t.command=n,e.env!=null&&(t.environment=e.env)}else{t.type=`remote`;let n=e;n.url==null?n.serverUrl!=null&&(t.url=n.serverUrl):t.url=n.url}return t.enabled=e.disabled!==!0,t}const oh=`.agents/skills`,sh=`.skills`,ch=`SKILL.md`,lh=`mcp.json`;var uh=class extends Am{constructor(){super(`GenericSkillsOutputPlugin`,{outputFileName:ch}),this.registerCleanEffect(`legacy-global-skills-cleanup`,async e=>{let t=this.joinPath(this.getHomeDir(),sh);if(!this.existsSync(t))return{success:!0,description:`Legacy global skills dir does not exist, nothing to clean`};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`legacyCleanup`,path:t}),{success:!0,description:`Would clean legacy global skills dir: ${t}`};try{let e=this.readdirSync(t,{withFileTypes:!0}),r=0;for(let i of e)if(i.isDirectory()){let e=this.joinPath(t,i.name),a=this.joinPath(e,ch);this.existsSync(a)&&(n.rmSync(e,{recursive:!0}),r++)}return this.readdirSync(t).length===0&&n.rmdirSync(t),this.log.trace({action:`clean`,type:`legacySkills`,dir:t,cleanedCount:r}),{success:!0,description:`Cleaned ${r} legacy skills from ${t}`}}catch(e){let n=e instanceof Error?e.message:String(e);return this.log.error({action:`clean`,type:`legacySkills`,dir:t,error:n}),{success:!1,description:`Failed to clean legacy skills dir`,error:e}}})}async registerProjectOutputDirs(t){let n=[],{projects:r}=t.collectedInputContext.workspace,{skills:i}=t.collectedInputContext;if(i==null||i.length===0)return n;for(let t of r){if(t.dirFromWorkspacePath==null)continue;let r=this.joinPath(t.dirFromWorkspacePath.path,oh);n.push({pathKind:e.$.Relative,path:r,basePath:t.dirFromWorkspacePath.basePath,getDirectoryName:()=>oh,getAbsolutePath:()=>this.joinPath(t.dirFromWorkspacePath.basePath,r)});let i=this.joinPath(t.dirFromWorkspacePath.path,sh);n.push({pathKind:e.$.Relative,path:i,basePath:t.dirFromWorkspacePath.basePath,getDirectoryName:()=>sh,getAbsolutePath:()=>this.joinPath(t.dirFromWorkspacePath.basePath,i)})}return n}async registerProjectOutputFiles(t){let n=[],{projects:r}=t.collectedInputContext.workspace,{skills:i}=t.collectedInputContext;if(i==null||i.length===0)return n;for(let t of r){if(t.dirFromWorkspacePath==null)continue;let r=this.joinPath(t.dirFromWorkspacePath.basePath,t.dirFromWorkspacePath.path,oh);for(let a of i){let i=a.yamlFrontMatter.name,o=this.joinPath(r,i);if(n.push({pathKind:e.$.Relative,path:this.joinPath(oh,i,ch),basePath:this.joinPath(t.dirFromWorkspacePath.basePath,t.dirFromWorkspacePath.path),getDirectoryName:()=>i,getAbsolutePath:()=>this.joinPath(o,ch)}),a.mcpConfig!=null&&n.push({pathKind:e.$.Relative,path:this.joinPath(oh,i,lh),basePath:this.joinPath(t.dirFromWorkspacePath.basePath,t.dirFromWorkspacePath.path),getDirectoryName:()=>i,getAbsolutePath:()=>this.joinPath(o,lh)}),a.childDocs!=null)for(let r of a.childDocs){let a=r.relativePath.replace(/\.mdx$/,`.md`);n.push({pathKind:e.$.Relative,path:this.joinPath(oh,i,a),basePath:this.joinPath(t.dirFromWorkspacePath.basePath,t.dirFromWorkspacePath.path),getDirectoryName:()=>i,getAbsolutePath:()=>this.joinPath(o,a)})}if(a.resources!=null)for(let r of a.resources)n.push({pathKind:e.$.Relative,path:this.joinPath(oh,i,r.relativePath),basePath:this.joinPath(t.dirFromWorkspacePath.basePath,t.dirFromWorkspacePath.path),getDirectoryName:()=>i,getAbsolutePath:()=>this.joinPath(o,r.relativePath)})}}return n}async registerGlobalOutputDirs(){return[]}async registerGlobalOutputFiles(){return[]}async canWrite(e){let{skills:t}=e.collectedInputContext,{projects:n}=e.collectedInputContext.workspace;return t==null||t.length===0?(this.log.trace({action:`skip`,reason:`noSkills`}),!1):n.length===0?(this.log.trace({action:`skip`,reason:`noProjects`}),!1):!0}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,{skills:n}=e.collectedInputContext,r=[],i=[];if(n==null||n.length===0)return{files:r,dirs:i};for(let i of t){if(i.dirFromWorkspacePath==null)continue;let t=this.joinPath(i.dirFromWorkspacePath.basePath,i.dirFromWorkspacePath.path,oh);for(let i of n){let n=await this.writeSkill(e,i,t);r.push(...n)}}return{files:r,dirs:i}}async writeGlobalOutputs(){return{files:[],dirs:[]}}async writeSkill(t,n,r){let i=[],a=n.yamlFrontMatter.name,o=this.joinPath(r,a),s=this.joinPath(o,ch),c={pathKind:e.$.Relative,path:ch,basePath:o,getDirectoryName:()=>a,getAbsolutePath:()=>s},l=this.buildSkillFrontMatter(n),u=n.content,d=hd(l,u);if(t.dryRun===!0)this.log.trace({action:`dryRun`,type:`skill`,path:s}),i.push({path:c,success:!0,skipped:!1});else try{this.ensureDirectory(o),this.writeFileSync(s,d),this.log.trace({action:`write`,type:`skill`,path:s}),i.push({path:c,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skill`,path:s,error:t}),i.push({path:c,success:!1,error:e})}if(n.mcpConfig!=null){let e=await this.writeMcpConfig(t,n,o);i.push(e)}if(n.childDocs!=null)for(let e of n.childDocs){let n=await this.writeChildDoc(t,e,o,a);i.push(n)}if(n.resources!=null)for(let e of n.resources){let n=await this.writeResource(t,e,o,a);i.push(n)}return i}async writeMcpConfig(t,n,r){let i=n.yamlFrontMatter.name,a=this.joinPath(r,lh),o={pathKind:e.$.Relative,path:lh,basePath:r,getDirectoryName:()=>i,getAbsolutePath:()=>a},s=n.mcpConfig.rawContent;if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`mcpConfig`,path:a}),{path:o,success:!0,skipped:!1};try{return this.ensureDirectory(r),this.writeFileSync(a,s),this.log.trace({action:`write`,type:`mcpConfig`,path:a}),{path:o,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`mcpConfig`,path:a,error:t}),{path:o,success:!1,error:e}}}async writeChildDoc(t,n,r,i){let a=n.relativePath.replace(/\.mdx$/,`.md`),o=this.joinPath(r,a),s={pathKind:e.$.Relative,path:a,basePath:r,getDirectoryName:()=>i,getAbsolutePath:()=>o},c=n.content;if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`childDoc`,path:o}),{path:s,success:!0,skipped:!1};try{let e=this.dirname(o);return this.ensureDirectory(e),this.writeFileSync(o,c),this.log.trace({action:`write`,type:`childDoc`,path:o}),{path:s,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`childDoc`,path:o,error:t}),{path:s,success:!1,error:e}}}async writeResource(t,n,r,i){let a=this.joinPath(r,n.relativePath),o={pathKind:e.$.Relative,path:n.relativePath,basePath:r,getDirectoryName:()=>i,getAbsolutePath:()=>a};if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`resource`,path:a}),{path:o,success:!0,skipped:!1};try{let e=this.dirname(a);if(this.ensureDirectory(e),n.encoding===`base64`){let e=c.Buffer.from(n.content,`base64`);this.writeFileSyncBuffer(a,e)}else this.writeFileSync(a,n.content);return this.log.trace({action:`write`,type:`resource`,path:a}),{path:o,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`resource`,path:a,error:t}),{path:o,success:!1,error:e}}}};const dh=`AGENTS.md`;var fh=class extends Am{constructor(){super(`AgentsOutputPlugin`,{outputFileName:dh})}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace;for(let e of n)if(e.rootMemoryPrompt!=null&&e.dirFromWorkspacePath!=null&&t.push(this.createFileRelativePath(e.dirFromWorkspacePath,dh)),e.childMemoryPrompts!=null)for(let n of e.childMemoryPrompts)n.dir!=null&&this.isRelativePath(n.dir)&&t.push(this.createFileRelativePath(n.dir,dh));return t}async canWrite(e){let{workspace:t}=e.collectedInputContext;return t.projects.some(e=>e.rootMemoryPrompt!=null||(e.childMemoryPrompts?.length??0)>0)?!0:(this.log.trace({action:`skip`,reason:`noOutputs`}),!1)}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,n=[],r=[];for(let r of t){let t=r.name??`unknown`,i=r.dirFromWorkspacePath;if(i!=null){if(r.rootMemoryPrompt!=null){let a=await this.writePromptFile(e,i,r.rootMemoryPrompt.content,`project:${t}/root`);n.push(a)}if(r.childMemoryPrompts!=null)for(let i of r.childMemoryPrompts){let r=await this.writePromptFile(e,i.dir,i.content,`project:${t}/child:${i.workingChildDirectoryPath?.path??`unknown`}`);n.push(r)}}}return{files:n,dirs:r}}};const ph=`rules`;var mh=class extends Xm{constructor(){super(`ClaudeCodeCLIOutputPlugin`,{globalConfigDir:`.claude`,outputFileName:`CLAUDE.md`,toolPreset:`claudeCode`,supportsCommands:!0,supportsSubAgents:!0,supportsSkills:!0,commandsSubDir:`commands`,agentsSubDir:`agents`,skillsSubDir:`skills`})}buildRuleFileName(e,t=`rule-`){return`${t}${e.series}-${e.ruleName}.md`}buildRuleContent(e){return e.globs.length===0?e.content:hd({paths:e.globs.map(gd)},e.content)}async registerGlobalOutputDirs(e){return[]}async registerGlobalOutputFiles(e){return super.registerGlobalOutputFiles(e)}async registerProjectOutputDirs(e){let t=await super.registerProjectOutputDirs(e),{rules:n}=e.collectedInputContext;if(n==null||n.length===0)return t;for(let i of e.collectedInputContext.workspace.projects){if(i.dirFromWorkspacePath==null||Ym(Hm(n,i.projectConfig),i.projectConfig).length===0)continue;let e=r.join(i.dirFromWorkspacePath.path,this.globalConfigDir,ph);t.push(this.createRelativePath(e,i.dirFromWorkspacePath.basePath,()=>ph))}return t}async registerProjectOutputFiles(e){let t=await super.registerProjectOutputFiles(e),{rules:n}=e.collectedInputContext;if(n==null||n.length===0)return t;for(let i of e.collectedInputContext.workspace.projects){if(i.dirFromWorkspacePath==null)continue;let e=Ym(Hm(n,i.projectConfig),i.projectConfig);for(let n of e){let e=r.join(i.dirFromWorkspacePath.path,this.globalConfigDir,ph,this.buildRuleFileName(n));t.push(this.createRelativePath(e,i.dirFromWorkspacePath.basePath,()=>ph))}}return t}async canWrite(e){return(e.collectedInputContext.rules?.length??0)>0?!0:super.canWrite(e)}async writeGlobalOutputs(e){return super.writeGlobalOutputs(e)}async writeProjectOutputs(e){let t=await super.writeProjectOutputs(e),{rules:n}=e.collectedInputContext;if(n==null||n.length===0)return t;let i=[];for(let t of e.collectedInputContext.workspace.projects){if(t.dirFromWorkspacePath==null)continue;let a=Ym(Hm(n,t.projectConfig),t.projectConfig);if(a.length===0)continue;let o=r.join(t.dirFromWorkspacePath.basePath,t.dirFromWorkspacePath.path,this.globalConfigDir,ph);for(let t of a)i.push(await this.writeFile(e,r.join(o,this.buildRuleFileName(t)),this.buildRuleContent(t),`rule`))}return{files:[...t.files,...i],dirs:t.dirs}}};const hh=eh.CURSOR,gh=Zm.MCP_CONFIG,_h=$m.COMMANDS,vh=$m.RULES,yh=Zm.CURSOR_GLOBAL_RULE,bh=$m.CURSOR_SKILLS,xh=Zm.SKILL,Sh=Qm.RULE,Ch=nh.CURSOR;var wh=class extends Am{constructor(){super(`CursorOutputPlugin`,{globalConfigDir:hh,outputFileName:``,dependsOn:[e.it.AgentsOutput],indexignore:th.CURSOR}),this.registerCleanEffect(`mcp-config-cleanup`,async e=>{let t=this.getGlobalConfigDir(),i=r.join(t,gh),a={mcpServers:{}};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`mcpConfigCleanup`,path:i}),{success:!0,description:`Would reset mcp.json to empty shell`};try{return this.ensureDirectory(t),n.writeFileSync(i,JSON.stringify(a,null,2)),this.log.trace({action:`clean`,type:`mcpConfigCleanup`,path:i}),{success:!0,description:`Reset mcp.json to empty shell`}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`clean`,type:`mcpConfigCleanup`,path:i,error:t}),{success:!1,error:e,description:`Failed to reset mcp.json`}}})}async registerGlobalOutputDirs(t){let n=[],i=this.getGlobalConfigDir(),{commands:a,skills:o,rules:s}=t.collectedInputContext,c=this.resolvePromptSourceProjectConfig(t);if(a!=null&&a.length>0&&Bm(a,c).length>0){let t=this.getGlobalCommandsDir();n.push({pathKind:e.$.Relative,path:_h,basePath:i,getDirectoryName:()=>_h,getAbsolutePath:()=>t})}if(o!=null&&o.length>0){let t=$(o,c);for(let a of t){let t=a.yamlFrontMatter.name;if(this.isPreservedSkill(t))continue;let o=r.join(i,bh,t);n.push({pathKind:e.$.Relative,path:r.join(bh,t),basePath:i,getDirectoryName:()=>t,getAbsolutePath:()=>o})}}let l=s?.filter(e=>this.normalizeRuleScope(e)===`global`);if(l==null||l.length===0)return n;let u=r.join(i,vh);return n.push({pathKind:e.$.Relative,path:vh,basePath:i,getDirectoryName:()=>vh,getAbsolutePath:()=>u}),n}async registerGlobalOutputFiles(t){let n=[],i=this.getGlobalConfigDir(),{skills:a,commands:o}=t.collectedInputContext,s=this.resolvePromptSourceProjectConfig(t),c=a==null?[]:$(a,s);if(c.some(e=>e.mcpConfig!=null)){let t=r.join(i,gh);n.push({pathKind:e.$.Relative,path:gh,basePath:i,getDirectoryName:()=>hh,getAbsolutePath:()=>t})}if(o!=null&&o.length>0){let a=Bm(o,s),c=this.getGlobalCommandsDir(),l=this.getTransformOptionsFromContext(t,{includeSeriesPrefix:!0});for(let t of a){let a=this.transformCommandName(t,l),o=r.join(c,a);n.push({pathKind:e.$.Relative,path:r.join(_h,a),basePath:i,getDirectoryName:()=>_h,getAbsolutePath:()=>o})}}let l=t.collectedInputContext.rules?.filter(e=>this.normalizeRuleScope(e)===`global`);if(l!=null&&l.length>0){let t=r.join(i,vh);for(let a of l){let o=this.buildRuleFileName(a),s=r.join(t,o);n.push({pathKind:e.$.Relative,path:r.join(vh,o),basePath:i,getDirectoryName:()=>vh,getAbsolutePath:()=>s})}}if(c.length===0)return n;let u=this.getSkillsCursorDir();for(let t of c){let a=t.yamlFrontMatter.name;if(this.isPreservedSkill(a))continue;let o=r.join(u,a);if(n.push({pathKind:e.$.Relative,path:r.join(bh,a,xh),basePath:i,getDirectoryName:()=>a,getAbsolutePath:()=>r.join(o,xh)}),t.mcpConfig!=null&&n.push({pathKind:e.$.Relative,path:r.join(bh,a,gh),basePath:i,getDirectoryName:()=>a,getAbsolutePath:()=>r.join(o,gh)}),t.childDocs!=null)for(let s of t.childDocs){let t=s.relativePath.replace(/\.mdx$/,`.md`);n.push({pathKind:e.$.Relative,path:r.join(bh,a,t),basePath:i,getDirectoryName:()=>a,getAbsolutePath:()=>r.join(o,t)})}if(t.resources!=null)for(let s of t.resources)n.push({pathKind:e.$.Relative,path:r.join(bh,a,s.relativePath),basePath:i,getDirectoryName:()=>a,getAbsolutePath:()=>r.join(o,s.relativePath)})}return n}async registerProjectOutputDirs(e){let t=[],{workspace:n,globalMemory:r,rules:i}=e.collectedInputContext,a=i?.some(e=>this.normalizeRuleScope(e)===`project`)??!1;if(r==null&&!a)return t;for(let e of n.projects){let n=e.dirFromWorkspacePath;n!=null&&t.push(this.createProjectRulesDirRelativePath(n))}return t}async registerProjectOutputFiles(e){let t=[],{workspace:n,globalMemory:r,rules:i}=e.collectedInputContext;if(r==null&&i==null)return t;if(r!=null)for(let e of n.projects){let n=e.dirFromWorkspacePath;n!=null&&t.push(this.createProjectRuleFileRelativePath(n,yh))}if(i!=null&&i.length>0)for(let e of n.projects){let n=e.dirFromWorkspacePath;if(n==null)continue;let r=Ym(Hm(i.filter(e=>this.normalizeRuleScope(e)===`project`),e.projectConfig),e.projectConfig);for(let e of r)t.push(this.createProjectRuleFileRelativePath(n,this.buildRuleFileName(e)))}return t.push(...this.registerProjectIgnoreOutputFiles(n.projects)),t}async canWrite(e){let{workspace:t,skills:n,commands:r,globalMemory:i,rules:a,aiAgentIgnoreConfigFiles:o}=e.collectedInputContext,s=(n?.length??0)>0,c=(r?.length??0)>0,l=(a?.length??0)>0,u=i!=null&&t.projects.some(e=>e.dirFromWorkspacePath!=null),d=o?.some(e=>e.fileName===`.cursorignore`)??!1;return s||c||u||l||d?!0:(this.log.trace({action:`skip`,reason:`noOutputs`}),!1)}async writeGlobalOutputs(e){let{skills:t,commands:n,rules:i}=e.collectedInputContext,a=this.resolvePromptSourceProjectConfig(e),o=[],s=[];if(t!=null&&t.length>0){let n=$(t,a),r=await this.writeGlobalMcpConfig(e,n);r!=null&&o.push(r);let i=this.getSkillsCursorDir();for(let t of n){let n=t.yamlFrontMatter.name;this.isPreservedSkill(n)||o.push(...await this.writeGlobalSkill(e,i,t))}}if(n!=null&&n.length>0){let t=Bm(n,a),r=this.getGlobalCommandsDir();for(let n of t)o.push(await this.writeGlobalCommand(e,r,n))}let c=i?.filter(e=>this.normalizeRuleScope(e)===`global`);if(c==null||c.length===0)return{files:o,dirs:s};let l=r.join(this.getGlobalConfigDir(),vh);for(let t of c)o.push(await this.writeRuleMdcFile(e,l,t,this.getGlobalConfigDir()));return{files:o,dirs:s}}async writeProjectOutputs(e){let t=[],n=[],{workspace:i,globalMemory:a,rules:o}=e.collectedInputContext;if(a!=null){let n=this.buildGlobalRuleContent(a.content);for(let r of i.projects)r.dirFromWorkspacePath!=null&&t.push(await this.writeProjectGlobalRule(e,r,n))}if(o!=null&&o.length>0)for(let n of i.projects){let i=n.dirFromWorkspacePath;if(i==null)continue;let a=Ym(Hm(o.filter(e=>this.normalizeRuleScope(e)===`project`),n.projectConfig),n.projectConfig);if(a.length===0)continue;let s=r.join(i.basePath,i.path,hh,vh);for(let n of a)t.push(await this.writeRuleMdcFile(e,s,n,i.basePath))}return t.push(...await this.writeProjectIgnoreFiles(e)),{files:t,dirs:n}}createProjectRulesDirRelativePath(t){let n=r.join(t.path,hh,vh);return{pathKind:e.$.Relative,path:n,basePath:t.basePath,getDirectoryName:()=>vh,getAbsolutePath:()=>r.join(t.basePath,n)}}createProjectRuleFileRelativePath(t,n){let i=r.join(t.path,hh,vh,n);return{pathKind:e.$.Relative,path:i,basePath:t.basePath,getDirectoryName:()=>vh,getAbsolutePath:()=>r.join(t.basePath,i)}}buildGlobalRuleContent(e){return hd({description:`Global prompt (synced)`,alwaysApply:!0},e)}async writeProjectGlobalRule(e,t,n){let i=t.dirFromWorkspacePath,a=r.join(i.basePath,i.path,hh,vh),o=r.join(a,yh),s=this.createProjectRuleFileRelativePath(i,yh);return this.writeFileWithHandling(e,o,n,{type:`globalRule`,relativePath:s})}isPreservedSkill(e){return Ch.has(e)}getSkillsCursorDir(){return r.join(this.getGlobalConfigDir(),bh)}getGlobalCommandsDir(){return r.join(this.getGlobalConfigDir(),_h)}async writeGlobalCommand(t,n,i){let a=this.getTransformOptionsFromContext(t,{includeSeriesPrefix:!0}),o=this.transformCommandName(i,a),s=r.join(n,o),c=this.getGlobalConfigDir(),l={pathKind:e.$.Relative,path:r.join(_h,o),basePath:c,getDirectoryName:()=>_h,getAbsolutePath:()=>s},u=this.buildMarkdownContentWithRaw(i.content,i.yamlFrontMatter,i.rawFrontMatter);return this.writeFileWithHandling(t,s,u,{type:`globalFastCommand`,relativePath:l})}async writeGlobalMcpConfig(t,i){let a=new rh({fs:n,logger:this.log}),o=a.collectMcpServers(i);if(o.size===0)return null;let s=a.transformMcpServers(o,ih),c=this.getGlobalConfigDir(),l=r.join(c,gh),u=a.writeCursorMcpConfig(l,s,t.dryRun===!0);return{path:{pathKind:e.$.Relative,path:gh,basePath:c,getDirectoryName:()=>hh,getAbsolutePath:()=>l},success:u.success,...u.error!=null&&{error:u.error},...t.dryRun&&{skipped:!0}}}async writeGlobalSkill(t,n,i){let a=[],o=i.yamlFrontMatter.name,s=r.join(n,o),c=r.join(s,xh),l=this.getGlobalConfigDir(),u={pathKind:e.$.Relative,path:r.join(bh,o,xh),basePath:l,getDirectoryName:()=>o,getAbsolutePath:()=>c},d=hd(this.buildSkillFrontMatter(i),i.content);if(t.dryRun===!0)this.log.trace({action:`dryRun`,type:`skill`,path:c}),a.push({path:u,success:!0,skipped:!1});else try{this.ensureDirectory(s),this.writeFileSync(c,d),this.log.trace({action:`write`,type:`skill`,path:c}),a.push({path:u,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skill`,path:c,error:t}),a.push({path:u,success:!1,error:e})}if(i.mcpConfig!=null&&a.push(await this.writeSkillMcpConfig(t,i,s,l)),i.childDocs!=null)for(let e of i.childDocs)a.push(await this.writeSkillChildDoc(t,e,s,o,l));if(i.resources!=null)for(let e of i.resources)a.push(await this.writeSkillResource(t,e,s,o,l));return a}async writeSkillMcpConfig(t,i,a,o){let s=i.yamlFrontMatter.name,c=r.join(a,gh),l={pathKind:e.$.Relative,path:r.join(bh,s,gh),basePath:o,getDirectoryName:()=>s,getAbsolutePath:()=>c},u=new rh({fs:n,logger:this.log}).writeSkillMcpConfig(c,i.mcpConfig.rawContent,t.dryRun===!0);return{path:l,success:u.success,...u.error!=null&&{error:u.error},...t.dryRun&&{skipped:!0}}}async writeSkillChildDoc(t,n,i,a,o){let s=n.relativePath.replace(/\.mdx$/,`.md`),c=r.join(i,s),l={pathKind:e.$.Relative,path:r.join(bh,a,s),basePath:o,getDirectoryName:()=>a,getAbsolutePath:()=>c},u=n.content;if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`childDoc`,path:c}),{path:l,success:!0,skipped:!1};try{let e=r.dirname(c);return this.ensureDirectory(e),this.writeFileSync(c,u),this.log.trace({action:`write`,type:`childDoc`,path:c}),{path:l,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`childDoc`,path:c,error:t}),{path:l,success:!1,error:e}}}async writeSkillResource(t,n,i,a,o){let s=r.join(i,n.relativePath),l={pathKind:e.$.Relative,path:r.join(bh,a,n.relativePath),basePath:o,getDirectoryName:()=>a,getAbsolutePath:()=>s};if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`resource`,path:s}),{path:l,success:!0,skipped:!1};try{let e=r.dirname(s);if(this.ensureDirectory(e),n.encoding===`base64`){let e=c.Buffer.from(n.content,`base64`);this.writeFileSyncBuffer(s,e)}else this.writeFileSync(s,n.content);return this.log.trace({action:`write`,type:`resource`,path:s}),{path:l,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`resource`,path:s,error:t}),{path:l,success:!1,error:e}}}buildRuleMdcContent(e){return hd({alwaysApply:!1,globs:e.globs.length>0?e.globs.join(`, `):``},e.content).split(`
|
|
95
|
-
`).map(e=>{let t=/^(\s*globs:\s*)(['"])(.*)\2\s*$/.exec(e);if(t==null)return e;let n=t[1]??`globs: `,r=t[3]??``;return r.trim().length===0?e:`${n}${r}`}).join(`
|
|
96
|
-
`)}async writeRuleMdcFile(t,n,i,a){let o=this.buildRuleFileName(i,Sh),s=r.join(n,o),c={pathKind:e.$.Relative,path:r.join(hh,vh,o),basePath:a,getDirectoryName:()=>vh,getAbsolutePath:()=>s},l=this.buildRuleMdcContent(i);return this.writeFileWithHandling(t,s,l,{type:`ruleFile`,relativePath:c})}},Th=class extends Xm{constructor(){super(`DroidCLIOutputPlugin`,{globalConfigDir:`.factory`,outputFileName:`AGENTS.md`,supportsCommands:!0,supportsSubAgents:!0,supportsSkills:!0})}async writeSkill(e,t,n){let i=[],a=n.yamlFrontMatter?.name??n.dir.getDirectoryName(),o=r.join(t,this.skillsSubDir,a),s=r.join(o,`SKILL.md`),c=n.yamlFrontMatter==null?void 0:{name:n.yamlFrontMatter.name,description:n.yamlFrontMatter.description},l=this.buildMarkdownContent(n.content,c),u=await this.writeFile(e,s,l,`skill`);if(i.push(u),n.childDocs!=null)for(let r of n.childDocs){let n=await this.writeSkillReferenceDocument(e,o,a,r,t);i.push(...n)}if(n.resources!=null)for(let r of n.resources){let n=await this.writeSkillResource(e,o,a,r,t);i.push(...n)}return i}};const Eh=`.editorconfig`;var Dh=class extends Am{constructor(){super(`EditorConfigOutputPlugin`)}async registerProjectOutputFiles(t){let n=[],{projects:r}=t.collectedInputContext.workspace,{editorConfigFiles:i}=t.collectedInputContext;if(i==null||i.length===0)return n;for(let t of r){let r=t.dirFromWorkspacePath;if(r==null||t.isPromptSourceProject===!0)continue;let i=this.joinPath(r.path,Eh);n.push({pathKind:e.$.Relative,path:i,basePath:r.basePath,getDirectoryName:()=>r.getDirectoryName(),getAbsolutePath:()=>this.resolvePath(r.basePath,i)})}return n}async canWrite(e){let{editorConfigFiles:t}=e.collectedInputContext;return t!=null&&t.length>0?!0:(this.log.debug(`skipped`,{reason:`no EditorConfig files found`}),!1)}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,{editorConfigFiles:n}=e.collectedInputContext,r=[],i=[];if(n==null||n.length===0)return{files:r,dirs:i};for(let i of t){let t=i.dirFromWorkspacePath;if(t==null||i.isPromptSourceProject===!0)continue;let a=i.name??`unknown`;for(let i of n){let n=this.resolvePath(t.basePath,t.path,Eh),o=await this.writeFile(e,n,i.content,`project:${a}/.editorconfig`);r.push(o)}}return{files:r,dirs:i}}},Oh=class extends Xm{constructor(){super(`GeminiCLIOutputPlugin`,{globalConfigDir:`.gemini`,outputFileName:`GEMINI.md`,supportsCommands:!1,supportsSubAgents:!1,supportsSkills:!1})}},kh=class extends Am{constructor(){super(`GitExcludeOutputPlugin`)}async registerProjectOutputDirs(){return[]}async registerProjectOutputFiles(t){let i=[],{projects:a}=t.collectedInputContext.workspace;for(let t of a){if(t.dirFromWorkspacePath==null||t.isPromptSourceProject===!0)continue;let n=t.dirFromWorkspacePath,a=n.getAbsolutePath(),{basePath:o}=n,s=[a,...Wm(a)];for(let t of s){let n=Um(t);if(n==null)continue;let a=r.join(n,`exclude`),s=r.relative(o,a);i.push({pathKind:e.$.Relative,path:s,basePath:o,getDirectoryName:()=>r.basename(t),getAbsolutePath:()=>a})}}let o=t.collectedInputContext.workspace.directory.path,s=r.join(o,`.git`);if(n.existsSync(s)&&n.lstatSync(s).isDirectory())for(let t of Gm(s)){let n=r.join(t,`exclude`),a=r.relative(o,n);i.push({pathKind:e.$.Relative,path:a,basePath:o,getDirectoryName:()=>r.basename(r.dirname(t)),getAbsolutePath:()=>n})}return i}async registerGlobalOutputDirs(){return[]}async registerGlobalOutputFiles(){return[]}async canWrite(e){let{globalGitIgnore:t,shadowGitExclude:n}=e.collectedInputContext;if(!(t!=null&&t.length>0||n!=null&&n.length>0))return this.log.debug({action:`canWrite`,result:!1,reason:`No gitignore or exclude content found`}),!1;let{projects:r}=e.collectedInputContext.workspace,i=r.some(e=>{if(e.dirFromWorkspacePath==null)return!1;let t=e.dirFromWorkspacePath.getAbsolutePath();return Um(t)==null?Wm(t).some(e=>Um(e)!=null):!0}),a=e.collectedInputContext.workspace.directory.path,o=Um(a)!=null,s=i||o;return this.log.debug({action:`canWrite`,result:s,hasGitProjects:i,hasWorkspaceGit:o,reason:s?`Found git repositories to update`:`No git repositories found`}),s}async writeProjectOutputs(e){let t=[],{globalGitIgnore:i,shadowGitExclude:a}=e.collectedInputContext,o=this.buildManagedContent(i,a);if(o.length===0)return this.log.debug({action:`write`,message:`No gitignore or exclude content found, skipping`}),{files:[],dirs:[]};let{workspace:s}=e.collectedInputContext,{projects:c}=s,l=new Set;for(let n of c){if(n.dirFromWorkspacePath==null)continue;let i=n.dirFromWorkspacePath.getAbsolutePath(),a=[i,...Wm(i)];for(let s of a){let a=Um(s);if(a==null)continue;let c=r.join(a,`exclude`);if(l.has(c))continue;l.add(c);let u=s===i?`project:${n.name??`unknown`}`:`nested:${r.relative(i,s)}`;this.log.trace({action:`write`,path:c,label:u});let d=await this.writeGitExcludeFile(e,c,o,u);t.push(d)}}let u=s.directory.path,d=Um(u);if(d!=null){let n=r.join(d,`exclude`);if(!l.has(n)){this.log.trace({action:`write`,path:n,target:`workspace`});let r=await this.writeGitExcludeFile(e,n,o,`workspace`);t.push(r),l.add(n)}}let f=Wm(u);for(let n of f){let i=Um(n);if(i==null)continue;let a=r.join(i,`exclude`);if(l.has(a))continue;l.add(a);let s=`workspace-nested:${r.relative(u,n)}`;this.log.trace({action:`write`,path:a,label:s});let c=await this.writeGitExcludeFile(e,a,o,s);t.push(c)}let p=r.join(u,`.git`);if(n.existsSync(p)&&n.lstatSync(p).isDirectory())for(let n of Gm(p)){let i=r.join(n,`exclude`);if(l.has(i))continue;l.add(i);let a=`git-module:${r.relative(p,n)}`;this.log.trace({action:`write`,path:i,label:a});let s=await this.writeGitExcludeFile(e,i,o,a);t.push(s)}return{files:t,dirs:[]}}buildManagedContent(e,t){let n=[];if(e!=null&&e.trim().length>0){let t=this.sanitizeContent(e);t.length>0&&n.push(t)}if(t!=null&&t.trim().length>0){let e=this.sanitizeContent(t);e.length>0&&n.push(e)}return n.length===0?``:n.join(`
|
|
97
|
-
`)}sanitizeContent(e){return e.split(/\r?\n/).filter(e=>{let t=e.trim();return t.length===0?!0:!(t.startsWith(`#`)&&!t.startsWith(`\\#`))}).join(`
|
|
98
|
-
`).trim()}normalizeContent(e){let t=e.trim();return t.length===0?``:`${t}\n`}async writeGitExcludeFile(t,i,a,o){let s=t.collectedInputContext.workspace.directory.path,c={pathKind:e.$.Relative,path:r.relative(s,i),basePath:s,getDirectoryName:()=>r.basename(r.dirname(i)),getAbsolutePath:()=>i};if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`gitExclude`,path:i,label:o}),{path:c,success:!0,skipped:!1};try{let e=r.dirname(i);n.existsSync(e)||(n.mkdirSync(e,{recursive:!0}),this.log.debug({action:`mkdir`,path:e,message:`Created .git/info directory`}));let t=this.normalizeContent(a);return n.writeFileSync(i,t,`utf8`),this.log.trace({action:`write`,type:`gitExclude`,path:i,label:o}),{path:c,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`gitExclude`,path:i,label:o,error:t}),{path:c,success:!1,error:e}}}};const Ah=`AGENTS.md`,jh=`prompts`,Mh=`skills`,Nh=`SKILL.md`,Ph=`.aiassistant`,Fh=`rules`,Ih=`always.md`,Lh=`codex`,Rh=[`IntelliJIdea`,`WebStorm`,`RustRover`,`PyCharm`,`PyCharmCE`,`PhpStorm`,`GoLand`,`CLion`,`DataGrip`,`RubyMine`,`Rider`,`DataSpell`,`Aqua`];var zh=class extends Am{constructor(){super(`JetBrainsAIAssistantCodexOutputPlugin`,{outputFileName:Ah,dependsOn:[e.it.AgentsOutput],indexignore:`.aiignore`})}async registerProjectOutputDirs(e){let t=[],{projects:n}=e.collectedInputContext.workspace;for(let e of n)e.dirFromWorkspacePath!=null&&t.push(this.createProjectRulesDirRelativePath(e.dirFromWorkspacePath));return t}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace;for(let e of n){let n=e.dirFromWorkspacePath;if(n!=null&&(e.rootMemoryPrompt!=null&&t.push(this.createProjectRuleFileRelativePath(n,Ih)),e.childMemoryPrompts!=null))for(let r of e.childMemoryPrompts){let e=this.buildChildRuleFileName(r);t.push(this.createProjectRuleFileRelativePath(n,e))}}return t.push(...this.registerProjectIgnoreOutputFiles(n)),t}async registerGlobalOutputDirs(t){let n=[],i=this.resolveCodexDirs(),a=this.resolvePromptSourceProjectConfig(t);for(let o of i){let i=r.join(o,jh);n.push({pathKind:e.$.Relative,path:jh,basePath:o,getDirectoryName:()=>jh,getAbsolutePath:()=>i});let{skills:s}=t.collectedInputContext;if(s==null||s.length===0)continue;let c=$(s,a);for(let t of c){let i=t.yamlFrontMatter?.name??t.dir.getDirectoryName(),a=r.join(o,Mh,i);n.push({pathKind:e.$.Relative,path:r.join(Mh,i),basePath:o,getDirectoryName:()=>i,getAbsolutePath:()=>a})}}return n}async registerGlobalOutputFiles(){return this.resolveCodexDirs().map(t=>({pathKind:e.$.Relative,path:Ah,basePath:t,getDirectoryName:()=>Lh,getAbsolutePath:()=>r.join(t,Ah)}))}async canWrite(e){let{globalMemory:t,commands:n,skills:r,workspace:i,aiAgentIgnoreConfigFiles:a}=e.collectedInputContext,o=t!=null,s=(n?.length??0)>0,c=(r?.length??0)>0,l=i.projects.some(e=>e.rootMemoryPrompt!=null||(e.childMemoryPrompts?.length??0)>0),u=a?.some(e=>e.fileName===`.aiignore`)??!1;return o||s||c||l||u?!0:(this.log.trace({action:`skip`,reason:`noOutputs`}),!1)}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,n=[],r=[];for(let r of t)if(r.dirFromWorkspacePath!=null){if(r.rootMemoryPrompt!=null){let t=this.buildAlwaysRuleContent(r.rootMemoryPrompt.content),i=await this.writeProjectRuleFile(e,r,Ih,t,`projectRootRule`);n.push(i)}if(r.childMemoryPrompts!=null)for(let t of r.childMemoryPrompts){let i=this.buildChildRuleFileName(t),a=this.buildGlobRuleContent(t),o=await this.writeProjectRuleFile(e,r,i,a,`projectChildRule`);n.push(o)}}let i=await this.writeProjectIgnoreFiles(e);return n.push(...i),{files:n,dirs:r}}async writeGlobalOutputs(t){let{globalMemory:i,commands:a,skills:o}=t.collectedInputContext,s=this.resolvePromptSourceProjectConfig(t),c=[],l=[],u=this.resolveCodexDirs();if(u.length===0)return{files:c,dirs:l};let d=a==null?[]:Bm(a,s),f=o==null?[]:$(o,s);for(let a of u){if(i!=null){let o=r.join(a,Ah),s={pathKind:e.$.Relative,path:Ah,basePath:a,getDirectoryName:()=>Lh,getAbsolutePath:()=>o};if(t.dryRun===!0)this.log.trace({action:`dryRun`,type:`globalMemory`,path:o}),c.push({path:s,success:!0,skipped:!1});else try{this.ensureDirectory(a),n.writeFileSync(o,i.content,`utf8`),this.log.trace({action:`write`,type:`globalMemory`,path:o}),c.push({path:s,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`globalMemory`,path:o,error:t}),c.push({path:s,success:!1,error:e})}}if(d.length>0)for(let e of d){let n=await this.writeGlobalCommand(t,a,e);c.push(...n)}if(f.length!==0)for(let e of f){let n=await this.writeGlobalSkill(t,a,e);c.push(...n)}}return{files:c,dirs:l}}resolveCodexDirs(){let t=r.join(e.V(),`JetBrains`);if(!this.existsSync(t))return[];try{return this.readdirSync(t,{withFileTypes:!0}).filter(e=>e.isDirectory()?this.isSupportedIdeDir(e.name):!1).map(e=>r.join(t,e.name,`aia`,Lh))}catch(e){let n=e instanceof Error?e.message:String(e);return this.log.warn({action:`scan`,type:`jetbrains`,path:t,error:n}),[]}}createProjectRulesDirRelativePath(t){let n=r.join(t.path,Ph,Fh);return{pathKind:e.$.Relative,path:n,basePath:t.basePath,getDirectoryName:()=>Fh,getAbsolutePath:()=>r.join(t.basePath,n)}}createProjectRuleFileRelativePath(t,n){let i=r.join(t.path,Ph,Fh,n);return{pathKind:e.$.Relative,path:i,basePath:t.basePath,getDirectoryName:()=>Fh,getAbsolutePath:()=>r.join(t.basePath,i)}}buildChildRuleFileName(e){let t=(e.workingChildDirectoryPath?.path??e.dir.path).replaceAll(`\\`,`/`).replaceAll(/^\/+|\/+$/g,``).replaceAll(`/`,`-`);return`glob-${t.length>0?t:`root`}.md`}buildChildRulePattern(e){let t=(e.workingChildDirectoryPath?.path??e.dir.path).replaceAll(`\\`,`/`).replaceAll(/^\/+|\/+$/g,``);return t.length===0?`**/*`:`${t}/**`}buildAlwaysRuleContent(e){return hd({apply:`始终`},e)}buildGlobRuleContent(e){return hd({apply:`按文件模式`,模式:this.buildChildRulePattern(e)},e.content)}async writeProjectRuleFile(e,t,i,a,o){let s=t.dirFromWorkspacePath,c=r.join(s.basePath,s.path,Ph,Fh),l=r.join(c,i),u=this.createProjectRuleFileRelativePath(s,i);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:o,path:l}),{path:u,success:!0,skipped:!1};try{return this.ensureDirectory(c),n.writeFileSync(l,a,`utf8`),this.log.trace({action:`write`,type:o,path:l}),{path:u,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:o,path:l,error:t}),{path:u,success:!1,error:e}}}isSupportedIdeDir(e){return Rh.some(t=>e.startsWith(t))}async writeGlobalCommand(t,i,a){let o=[],s=this.getTransformOptionsFromContext(t),c=this.transformCommandName(a,s),l=r.join(i,jh),u=r.join(l,c),d={pathKind:e.$.Relative,path:r.join(jh,c),basePath:i,getDirectoryName:()=>jh,getAbsolutePath:()=>u},f=this.buildMarkdownContentWithRaw(a.content,a.yamlFrontMatter,a.rawFrontMatter);if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`globalFastCommand`,path:u}),[{path:d,success:!0,skipped:!1}];try{this.ensureDirectory(l),n.writeFileSync(u,f,`utf8`),this.log.trace({action:`write`,type:`globalFastCommand`,path:u}),o.push({path:d,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`globalFastCommand`,path:u,error:t}),o.push({path:d,success:!1,error:e})}return o}async writeGlobalSkill(t,i,a){let o=[],s=a.yamlFrontMatter?.name??a.dir.getDirectoryName(),c=r.join(i,Mh,s),l=r.join(c,Nh),u={pathKind:e.$.Relative,path:r.join(Mh,s,Nh),basePath:i,getDirectoryName:()=>s,getAbsolutePath:()=>l},d=this.buildCodexSkillContent(a);if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`globalSkill`,path:l}),[{path:u,success:!0,skipped:!1}];try{if(this.ensureDirectory(c),n.writeFileSync(l,d,`utf8`),this.log.trace({action:`write`,type:`globalSkill`,path:l}),o.push({path:u,success:!0}),a.childDocs!=null)for(let e of a.childDocs){let n=await this.writeSkillReferenceDocument(t,c,s,e,i);o.push(...n)}if(a.resources!=null)for(let e of a.resources){let n=await this.writeSkillResource(t,c,s,e,i);o.push(...n)}}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`globalSkill`,path:l,error:t}),o.push({path:u,success:!1,error:e})}return o}buildCodexSkillContent(e){let t=e.yamlFrontMatter,n=this.normalizeSkillName(t.name,64),r=this.normalizeToSingleLine(t.description,1024),i={};t.displayName!=null&&(i[`short-description`]=t.displayName),t.version!=null&&(i.version=t.version),t.author!=null&&(i.author=t.author),t.keywords!=null&&t.keywords.length>0&&(i.keywords=[...t.keywords]);let a={name:n,description:r};return Object.keys(i).length>0&&(a.metadata=i),t.allowTools!=null&&t.allowTools.length>0&&(a[`allowed-tools`]=t.allowTools.join(` `)),hd(a,e.content)}normalizeSkillName(e,t){let n=e.toLowerCase().replaceAll(/[^a-z0-9-]/g,`-`).replaceAll(/-+/g,`-`).replaceAll(/^-+|-+$/g,``);return n.length>t&&(n=n.slice(0,t).replace(/-+$/,``)),n}normalizeToSingleLine(e,t){let n=e.replaceAll(/[\r\n]+/g,` `).replaceAll(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t-3)}...`:n}async writeSkillReferenceDocument(t,i,a,o,s){let c=[],l=o.dir.path.replace(/\.mdx$/,`.md`),u=r.join(i,l),d={pathKind:e.$.Relative,path:r.join(Mh,a,l),basePath:s,getDirectoryName:()=>a,getAbsolutePath:()=>u};if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`skillRefDoc`,path:u}),[{path:d,success:!0,skipped:!1}];try{let e=r.dirname(u);this.ensureDirectory(e),n.writeFileSync(u,o.content,`utf8`),this.log.trace({action:`write`,type:`skillRefDoc`,path:u}),c.push({path:d,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skillRefDoc`,path:u,error:t}),c.push({path:d,success:!1,error:e})}return c}async writeSkillResource(t,i,a,o,s){let c=[],l=r.join(i,o.relativePath),u={pathKind:e.$.Relative,path:r.join(Mh,a,o.relativePath),basePath:s,getDirectoryName:()=>a,getAbsolutePath:()=>l};if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`skillResource`,path:l}),[{path:u,success:!0,skipped:!1}];try{let e=r.dirname(l);this.ensureDirectory(e),n.writeFileSync(l,o.content,`utf8`),this.log.trace({action:`write`,type:`skillResource`,path:l}),c.push({path:u,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skillResource`,path:l,error:t}),c.push({path:u,success:!1,error:e})}return c}};const Bh=`.idea`,Vh=[`.editorconfig`,`.idea/codeStyles/Project.xml`,`.idea/codeStyles/codeStyleConfig.xml`,`.idea/.gitignore`];var Hh=class extends Am{constructor(){super(`JetBrainsIDECodeStyleConfigOutputPlugin`)}async registerProjectOutputFiles(t){let n=[],{projects:r}=t.collectedInputContext.workspace,{jetbrainsConfigFiles:i,editorConfigFiles:a}=t.collectedInputContext;if(!(i!=null&&i.length>0||a!=null&&a.length>0))return n;for(let t of r){let r=t.dirFromWorkspacePath;if(r!=null&&t.isPromptSourceProject!==!0)for(let t of Vh){let i=this.joinPath(r.path,t);n.push({pathKind:e.$.Relative,path:i,basePath:r.basePath,getDirectoryName:()=>this.dirname(t),getAbsolutePath:()=>this.resolvePath(r.basePath,i)})}}return n}async canWrite(e){let{jetbrainsConfigFiles:t,editorConfigFiles:n}=e.collectedInputContext;return t!=null&&t.length>0||n!=null&&n.length>0?!0:(this.log.debug(`skipped`,{reason:`no JetBrains IDE config files found`}),!1)}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,{jetbrainsConfigFiles:n,editorConfigFiles:r}=e.collectedInputContext,i=[],a=[],o=[...n??[],...r??[]];for(let n of t){let t=n.dirFromWorkspacePath;if(t==null)continue;let r=n.name??`unknown`;for(let n of o){let a=await this.writeConfigFile(e,t,n,`project:${r}`);i.push(a)}}return{files:i,dirs:a}}async writeConfigFile(t,n,r,i){let a=this.getTargetRelativePath(r),o=this.resolvePath(n.basePath,n.path,a),s={pathKind:e.$.Relative,path:this.joinPath(n.path,a),basePath:n.basePath,getDirectoryName:()=>this.dirname(a),getAbsolutePath:()=>o};if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`config`,path:o,label:i}),{path:s,success:!0,skipped:!1};try{let e=this.dirname(o);return this.ensureDirectory(e),this.writeFileSync(o,r.content),this.log.trace({action:`write`,type:`config`,path:o,label:i}),{path:s,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`config`,path:o,label:i,error:t}),{path:s,success:!1,error:e}}}getTargetRelativePath(t){let n=t.dir.path;if(t.type===e.tt.EditorConfig)return`.editorconfig`;if(t.type!==e.tt.IntellijIDEA)return this.basename(n);let r=n.indexOf(Bh);return r===-1?this.joinPath(Bh,`codeStyles`,this.basename(n)):n.slice(Math.max(0,r))}};const Uh=`AGENTS.md`,Wh=`.codex`,Gh=`prompts`;var Kh=class extends Am{constructor(){super(`CodexCLIOutputPlugin`,{globalConfigDir:Wh,outputFileName:Uh,dependsOn:[e.it.AgentsOutput]})}async registerProjectOutputDirs(){return[]}async registerProjectOutputFiles(){return[]}async registerGlobalOutputDirs(e){let t=this.getGlobalConfigDir(),n=[this.createRelativePath(Gh,t,()=>Gh)],{skills:i}=e.collectedInputContext;if(i==null||i.length===0)return n;let a=$(i,this.resolvePromptSourceProjectConfig(e));for(let e of a){let i=e.yamlFrontMatter?.name??e.dir.getDirectoryName();n.push(this.createRelativePath(r.join(`skills`,i),t,()=>i))}return n}async registerGlobalOutputFiles(){let e=this.getGlobalConfigDir();return[this.createRelativePath(Uh,e,()=>Wh)]}async canWrite(e){let{globalMemory:t,commands:n}=e.collectedInputContext;return t!=null||(n?.length??0)>0?!0:(this.log.trace({action:`skip`,reason:`noOutputs`}),!1)}async writeProjectOutputs(){return{files:[],dirs:[]}}async writeGlobalOutputs(e){let{globalMemory:t,commands:n}=e.collectedInputContext,i=this.resolvePromptSourceProjectConfig(e),a=[],o=this.getGlobalConfigDir();if(t!=null){let n=r.join(o,Uh),i=await this.writeFile(e,n,t.content,`globalMemory`);a.push(i)}if(n==null||n.length===0)return{files:a,dirs:[]};let s=Bm(n,i);for(let t of s){let n=await this.writeGlobalCommand(e,o,t);a.push(n)}return{files:a,dirs:[]}}async writeGlobalCommand(e,t,n){let i=this.getTransformOptionsFromContext(e),a=this.transformCommandName(n,i),o=r.join(t,Gh,a),s=this.buildMarkdownContentWithRaw(n.content,n.yamlFrontMatter,n.rawFrontMatter);return this.writeFile(e,o,s,`globalFastCommand`)}};const qh=`.config/opencode`,Jh=`opencode.json`,Yh=`opencode-rules@latest`,Xh=`.opencode`,Zh=`rules`;var Qh=class extends Xm{constructor(){super(`OpencodeCLIOutputPlugin`,{globalConfigDir:qh,outputFileName:`AGENTS.md`,commandsSubDir:`commands`,agentsSubDir:`agents`,skillsSubDir:`skills`,supportsCommands:!0,supportsSubAgents:!0,supportsSkills:!0,dependsOn:[e.it.AgentsOutput]}),this.registerCleanEffect(`mcp-config-cleanup`,async e=>{let t=this.getGlobalConfigDir(),i=r.join(t,Jh);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`mcpConfigCleanup`,path:i}),{success:!0,description:`Would reset opencode.json mcp to empty`};try{if(n.existsSync(i)){let e=n.readFileSync(i,`utf8`),t=JSON.parse(e);t.mcp={};let r=t.plugin;if(Array.isArray(r)){let e=r.filter(e=>e!==Yh);e.length>0?t.plugin=e:delete t.plugin}n.writeFileSync(i,JSON.stringify(t,null,2))}return this.log.trace({action:`clean`,type:`mcpConfigCleanup`,path:i}),{success:!0,description:`Reset opencode.json mcp to empty`}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`clean`,type:`mcpConfigCleanup`,path:i,error:t}),{success:!1,error:e,description:`Failed to reset opencode.json mcp`}}})}async registerGlobalOutputFiles(t){let n=await super.registerGlobalOutputFiles(t),i=this.getGlobalConfigDir(),a=this.resolvePromptSourceProjectConfig(t);if((t.collectedInputContext.skills==null?[]:$(t.collectedInputContext.skills,a)).some(e=>e.mcpConfig!=null)){let t=r.join(i,Jh);n.push({pathKind:e.$.Relative,path:Jh,basePath:i,getDirectoryName:()=>qh,getAbsolutePath:()=>t})}let o=t.collectedInputContext.rules?.filter(e=>this.normalizeRuleScope(e)===`global`);if(o!=null&&o.length>0){let e=r.join(i,Zh);for(let t of o)n.push(this.createRelativePath(this.buildRuleFileName(t),e,()=>Zh))}return n.map(e=>{let t=e.path.replaceAll(`\\`,`/`),n=`/${this.skillsSubDir}/`,a=`${this.skillsSubDir}/`;if(!(t.includes(n)||t.startsWith(a)))return e;let o=t.split(`/`),s=o.indexOf(this.skillsSubDir);if(s<0||s+1>=o.length)return e;let c=o[s+1];if(c==null)return e;let l=this.validateAndNormalizeSkillName(c),u=[...o];u[s+1]=l;let d=u.join(`/`);return{...e,path:d,getDirectoryName:()=>l,getAbsolutePath:()=>r.join(i,d.replaceAll(`/`,r.sep))}})}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace;for(let i of n){if(i.rootMemoryPrompt!=null&&i.dirFromWorkspacePath!=null&&t.push(this.createFileRelativePath(i.dirFromWorkspacePath,this.outputFileName)),i.childMemoryPrompts!=null)for(let e of i.childMemoryPrompts)e.dir!=null&&this.isRelativePath(e.dir)&&t.push(this.createFileRelativePath(e.dir,this.outputFileName));if(i.dirFromWorkspacePath==null)continue;let{projectConfig:n}=i,a=r.join(i.dirFromWorkspacePath.path,Xh),o={includeSeriesPrefix:!0};if(this.supportsCommands&&e.collectedInputContext.commands!=null){let s=Bm(e.collectedInputContext.commands,n);for(let e of s){let n=this.transformCommandName(e,o);t.push(this.createRelativePath(r.join(a,this.commandsSubDir,n),i.dirFromWorkspacePath.basePath,()=>this.commandsSubDir))}}if(this.supportsSubAgents&&e.collectedInputContext.subAgents!=null){let o=Vm(e.collectedInputContext.subAgents,n);for(let e of o){let n=e.dir.path.replace(/\.mdx$/,`.md`);t.push(this.createRelativePath(r.join(a,this.agentsSubDir,n),i.dirFromWorkspacePath.basePath,()=>this.agentsSubDir))}}if(this.supportsSkills&&e.collectedInputContext.skills!=null){let o=$(e.collectedInputContext.skills,n);for(let e of o){let n=e.yamlFrontMatter?.name??e.dir.getDirectoryName(),o=r.join(a,this.skillsSubDir,n);if(t.push(this.createRelativePath(r.join(o,`SKILL.md`),i.dirFromWorkspacePath.basePath,()=>n)),e.childDocs!=null)for(let a of e.childDocs){let e=a.dir.path.replace(/\.mdx$/,`.md`);t.push(this.createRelativePath(r.join(o,e),i.dirFromWorkspacePath.basePath,()=>n))}if(e.resources!=null)for(let a of e.resources)t.push(this.createRelativePath(r.join(o,a.relativePath),i.dirFromWorkspacePath.basePath,()=>n))}}let{rules:s}=e.collectedInputContext;if(s!=null&&s.length>0){let e=Ym(Hm(s,i.projectConfig),i.projectConfig);for(let n of e){let e=r.join(i.dirFromWorkspacePath.path,Xh,Zh,this.buildRuleFileName(n));t.push(this.createRelativePath(e,i.dirFromWorkspacePath.basePath,()=>Zh))}}}return t.map(e=>{let t=e.path.replaceAll(`\\`,`/`),n=`/${this.skillsSubDir}/`,i=`${this.skillsSubDir}/`;if(!(t.includes(n)||t.startsWith(i)))return e;let a=t.split(`/`),o=a.indexOf(this.skillsSubDir);if(o<0||o+1>=a.length)return e;let s=a[o+1];if(s==null)return e;let c=this.validateAndNormalizeSkillName(s),l=[...a];l[o+1]=c;let u=l.join(`/`);return{...e,path:u,getDirectoryName:()=>c,getAbsolutePath:()=>r.join(e.basePath,u.replaceAll(`/`,r.sep))}})}async writeGlobalOutputs(e){let t=await super.writeGlobalOutputs(e),n=[...t.files],{skills:i}=e.collectedInputContext;if(i!=null){let t=$(i,this.resolvePromptSourceProjectConfig(e)),r=await this.writeGlobalMcpConfig(e,t);r!=null&&n.push(r)}let a=e.collectedInputContext.rules?.filter(e=>this.normalizeRuleScope(e)===`global`);if(a==null||a.length===0)return{files:n,dirs:t.dirs};let o=r.join(this.getGlobalConfigDir(),Zh);for(let t of a)n.push(await this.writeFile(e,r.join(o,this.buildRuleFileName(t)),this.buildRuleContent(t),`rule`));return{files:n,dirs:t.dirs}}async writeGlobalMcpConfig(t,i){let a=new rh({fs:n,logger:this.log}),o=a.collectMcpServers(i);if(o.size===0)return null;let s=a.transformMcpServers(o,ah),c=this.getGlobalConfigDir(),l=r.join(c,Jh),u={pathKind:e.$.Relative,path:Jh,basePath:c,getDirectoryName:()=>qh,getAbsolutePath:()=>l},d=a.readExistingConfig(l).plugin,f=Array.isArray(d)?d.map(e=>String(e)):[];f.includes(Yh)||f.push(Yh);let p=a.writeOpencodeMcpConfig(l,s,t.dryRun===!0,{$schema:`https://opencode.ai/config.json`,plugin:f});return p.success?p.skipped===!0?{path:u,success:!0,skipped:!0}:{path:u,success:!0}:p.error==null?{path:u,success:!1}:{path:u,success:!1,error:p.error}}async writeSubAgent(e,t,n){let i=n.dir.path.replace(/\.mdx$/,`.md`),a=r.join(t,this.agentsSubDir),o=r.join(a,i),s=this.buildOpencodeAgentFrontMatter(n),c=this.buildMarkdownContent(n.content,s);return[await this.writeFile(e,o,c,`subAgent`)]}buildOpencodeAgentFrontMatter(e){let t={},n=e.yamlFrontMatter;if(n?.description!=null&&(t.description=n.description),t.mode=n?.mode??`subagent`,n?.model!=null&&(t.model=n.model),n?.temperature!=null&&(t.temperature=n.temperature),n?.maxSteps!=null&&(t.maxSteps=n.maxSteps),n?.hidden!=null&&(t.hidden=n.hidden),n?.allowTools!=null&&Array.isArray(n.allowTools)){let e={};for(let t of n.allowTools)e[String(t)]=!0;t.tools=e}n?.permission!=null&&typeof n.permission==`object`&&(t.permission=n.permission);for(let[e,r]of Object.entries(n??{}))[`description`,`mode`,`model`,`temperature`,`maxSteps`,`hidden`,`allowTools`,`permission`,`namingCase`,`name`,`color`].includes(e)||(t[e]=r);return t}async writeCommand(e,t,n){let i=this.getTransformOptionsFromContext(e),a=this.transformCommandName(n,i),o=r.join(t,this.commandsSubDir),s=r.join(o,a),c=this.buildOpencodeCommandFrontMatter(n),l=this.buildMarkdownContent(n.content,c);return[await this.writeFile(e,s,l,`command`)]}buildOpencodeCommandFrontMatter(e){let t={},n=e.yamlFrontMatter;if(n?.description!=null&&(t.description=n.description),n?.agent!=null&&(t.agent=n.agent),n?.model!=null&&(t.model=n.model),n?.allowTools!=null&&Array.isArray(n.allowTools)){let e={};for(let t of n.allowTools)e[String(t)]=!0;t.tools=e}for(let[e,r]of Object.entries(n??{}))[`description`,`agent`,`model`,`allowTools`,`namingCase`,`argumentHint`].includes(e)||(t[e]=r);return t}async writeSkill(e,t,n){let i=[],a=this.validateAndNormalizeSkillName(n.yamlFrontMatter?.name??n.dir.getDirectoryName()),o=r.join(t,this.skillsSubDir,a),s=r.join(o,`SKILL.md`),c=this.buildOpencodeSkillFrontMatter(n,a),l=this.buildMarkdownContent(n.content,c),u=await this.writeFile(e,s,l,`skill`);if(i.push(u),n.childDocs!=null)for(let r of n.childDocs){let n=await this.writeSkillReferenceDocument(e,o,a,r,t);i.push(...n)}if(n.resources!=null)for(let r of n.resources){let n=await this.writeSkillResource(e,o,a,r,t);i.push(...n)}return i}buildOpencodeSkillFrontMatter(e,t){let n={},r=e.yamlFrontMatter;n.name=t,r?.description!=null&&(n.description=r.description),n.license=r?.license??`MIT`,n.compatibility=r?.compatibility??`opencode`;let i={};for(let e of[`author`,`version`,`keywords`,`category`,`repository`,`displayName`])r?.[e]!=null&&(i[e]=r[e]);let a=new Set([`name`,`description`,`license`,`compatibility`,`namingCase`,`allowTools`,`keywords`,`displayName`,`author`,`version`]);for(let[e,t]of Object.entries(r??{}))a.has(e)||(i[e]=t);return Object.keys(i).length>0&&(n.metadata=i),n}validateAndNormalizeSkillName(e){let t=e.toLowerCase();return t=t.replaceAll(/[^a-z0-9-]+/g,`-`),t=t.replaceAll(/-+/g,`-`),t=t.replaceAll(/^-|-$/g,``),t.length===0?t=`skill`:t.length>64&&(t=t.slice(0,64),t=t.replace(/-$/,``)),t}buildRuleFileName(e,t=`rule-`){return`${t}${e.series}-${e.ruleName}.md`}buildRuleContent(e){return e.globs.length===0?e.content:this.buildMarkdownContent(e.content,{globs:[...e.globs]})}async registerGlobalOutputDirs(e){let t=await super.registerGlobalOutputDirs(e),n=e.collectedInputContext.rules?.filter(e=>this.normalizeRuleScope(e)===`global`);return n!=null&&n.length>0&&t.push(this.createRelativePath(Zh,this.getGlobalConfigDir(),()=>Zh)),t}async registerProjectOutputDirs(e){let t=[],{projects:n}=e.collectedInputContext.workspace,i=[];this.supportsCommands&&i.push(this.commandsSubDir),this.supportsSubAgents&&i.push(this.agentsSubDir),this.supportsSkills&&i.push(this.skillsSubDir);for(let e of n)if(e.dirFromWorkspacePath!=null)for(let n of i){let i=r.join(e.dirFromWorkspacePath.path,Xh,n);t.push(this.createRelativePath(i,e.dirFromWorkspacePath.basePath,()=>n))}let{rules:a}=e.collectedInputContext;if(a!=null&&a.length>0)for(let n of e.collectedInputContext.workspace.projects){if(n.dirFromWorkspacePath==null||Ym(Hm(a.filter(e=>this.normalizeRuleScope(e)===`project`),n.projectConfig),n.projectConfig).length===0)continue;let e=r.join(n.dirFromWorkspacePath.path,Xh,Zh);t.push(this.createRelativePath(e,n.dirFromWorkspacePath.basePath,()=>Zh))}return t}async canWrite(e){return(e.collectedInputContext.rules?.length??0)>0?!0:super.canWrite(e)}async writeProjectOutputs(e){let t=[],n=[];for(let n of e.collectedInputContext.workspace.projects){if(n.dirFromWorkspacePath==null)continue;let i=n.dirFromWorkspacePath,{projectConfig:a}=n,o=r.join(i.basePath,i.path,Xh);if(n.rootMemoryPrompt!=null){let r=await this.writePromptFile(e,i,n.rootMemoryPrompt.content,`project:${n.name}/root`);t.push(r)}if(n.childMemoryPrompts!=null)for(let r of n.childMemoryPrompts){let i=await this.writePromptFile(e,r.dir,r.content,`project:${n.name}/child:${r.workingChildDirectoryPath?.path??`unknown`}`);t.push(i)}if(this.supportsCommands&&e.collectedInputContext.commands!=null){let n=Bm(e.collectedInputContext.commands,a);for(let r of n){let n=await this.writeCommand(e,o,r);t.push(...n)}}if(this.supportsSubAgents&&e.collectedInputContext.subAgents!=null){let n=Vm(e.collectedInputContext.subAgents,a);for(let r of n){let n=await this.writeSubAgent(e,o,r);t.push(...n)}}if(this.supportsSkills&&e.collectedInputContext.skills!=null){let n=$(e.collectedInputContext.skills,a);for(let r of n){let n=await this.writeSkill(e,o,r);t.push(...n)}}}let{rules:i}=e.collectedInputContext;if(i!=null&&i.length>0)for(let n of e.collectedInputContext.workspace.projects){if(n.dirFromWorkspacePath==null)continue;let a=Ym(Hm(i.filter(e=>this.normalizeRuleScope(e)===`project`),n.projectConfig),n.projectConfig);if(a.length===0)continue;let o=r.join(n.dirFromWorkspacePath.basePath,n.dirFromWorkspacePath.path,Xh,Zh);for(let n of a)t.push(await this.writeFile(e,r.join(o,this.buildRuleFileName(n)),this.buildRuleContent(n),`rule`))}return{files:t,dirs:n}}};const $h=`.qoder`,eg=`rules`,tg=`commands`,ng=`skills`,rg=`global.md`,ig=`always.md`,ag=`SKILL.md`,og=`mcp.json`,sg=`glob`,cg=`glob`;var lg=class extends Am{constructor(){super(`QoderIDEPluginOutputPlugin`,{globalConfigDir:$h,indexignore:`.qoderignore`})}async registerProjectOutputDirs(e){let{projects:t}=e.collectedInputContext.workspace;return t.filter(e=>e.dirFromWorkspacePath!=null).map(e=>this.createProjectRulesDirPath(e.dirFromWorkspacePath))}async registerProjectOutputFiles(e){let t=[],{workspace:n,rules:r}=e.collectedInputContext,{projects:i}=n,{globalMemory:a}=e.collectedInputContext;for(let e of i){let n=e.dirFromWorkspacePath;if(n!=null){if(a!=null&&t.push(this.createProjectRuleFilePath(n,rg)),e.rootMemoryPrompt!=null&&t.push(this.createProjectRuleFilePath(n,ig)),e.childMemoryPrompts!=null)for(let r of e.childMemoryPrompts)t.push(this.createProjectRuleFilePath(n,this.buildChildRuleFileName(r)));if(r!=null&&r.length>0){let i=Ym(Hm(r.filter(e=>this.normalizeRuleScope(e)===`project`),e.projectConfig),e.projectConfig);for(let e of i){let r=this.buildRuleFileName(e);t.push(this.createProjectRuleFilePath(n,r))}}}}return t.push(...this.registerProjectIgnoreOutputFiles(i)),t}async registerGlobalOutputDirs(e){let t=this.getGlobalConfigDir(),{commands:n,skills:i,rules:a}=e.collectedInputContext,o=this.resolvePromptSourceProjectConfig(e),s=[];if(n!=null&&n.length>0&&Bm(n,o).length>0&&s.push(this.createRelativePath(tg,t,()=>tg)),i!=null&&i.length>0){let e=$(i,o);for(let n of e){let e=n.yamlFrontMatter.name;s.push(this.createRelativePath(r.join(ng,e),t,()=>e))}}let c=a?.filter(e=>this.normalizeRuleScope(e)===`global`);return c!=null&&c.length>0&&s.push(this.createRelativePath(r.join(eg),t,()=>eg)),s}async registerGlobalOutputFiles(e){let t=this.getGlobalConfigDir(),{commands:n,skills:i,rules:a}=e.collectedInputContext,o=this.resolvePromptSourceProjectConfig(e),s=[],c=this.getTransformOptionsFromContext(e,{includeSeriesPrefix:!0});if(n!=null&&n.length>0){let e=Bm(n,o);for(let n of e){let e=this.transformCommandName(n,c);s.push(this.createRelativePath(r.join(tg,e),t,()=>tg))}}let l=a?.filter(e=>this.normalizeRuleScope(e)===`global`);if(l!=null&&l.length>0)for(let e of l){let n=this.buildRuleFileName(e);s.push(this.createRelativePath(r.join(eg,n),t,()=>eg))}let u=i==null?[]:$(i,o);if(u.length>0)for(let e of u){let n=e.yamlFrontMatter.name;if(s.push(this.createRelativePath(r.join(ng,n,ag),t,()=>n)),e.mcpConfig!=null&&s.push(this.createRelativePath(r.join(ng,n,og),t,()=>n)),e.childDocs!=null)for(let i of e.childDocs)s.push(this.createRelativePath(r.join(ng,n,i.relativePath.replace(/\.mdx$/,`.md`)),t,()=>n));if(e.resources!=null)for(let i of e.resources)s.push(this.createRelativePath(r.join(ng,n,i.relativePath),t,()=>n))}return s}async canWrite(e){let{workspace:t,globalMemory:n,commands:r,skills:i,rules:a,aiAgentIgnoreConfigFiles:o}=e.collectedInputContext,s=t.projects.some(e=>e.rootMemoryPrompt!=null||(e.childMemoryPrompts?.length??0)>0),c=(a?.length??0)>0,l=o?.some(e=>e.fileName===`.qoderignore`)??!1;return s||n!=null||(r?.length??0)>0||(i?.length??0)>0||c||l?!0:(this.log.trace({action:`skip`,reason:`noOutputs`}),!1)}async writeProjectOutputs(e){let{workspace:t,globalMemory:n,rules:r}=e.collectedInputContext,{projects:i}=t,a=[];for(let t of i){if(t.dirFromWorkspacePath==null)continue;let i=t.dirFromWorkspacePath;if(n!=null){let t=this.buildAlwaysRuleContent(n.content);a.push(await this.writeProjectRuleFile(e,i,rg,t,`globalRule`))}if(t.rootMemoryPrompt!=null){let n=this.buildAlwaysRuleContent(t.rootMemoryPrompt.content);a.push(await this.writeProjectRuleFile(e,i,ig,n,`projectRootRule`))}if(t.childMemoryPrompts!=null)for(let n of t.childMemoryPrompts){let t=this.buildChildRuleFileName(n),r=this.buildGlobRuleContent(n);a.push(await this.writeProjectRuleFile(e,i,t,r,`projectChildRule`))}if(r!=null&&r.length>0){let n=Ym(Hm(r.filter(e=>this.normalizeRuleScope(e)===`project`),t.projectConfig),t.projectConfig);for(let t of n){let n=this.buildRuleFileName(t),r=this.buildRuleContent(t);a.push(await this.writeProjectRuleFile(e,i,n,r,`projectRule`))}}}let o=await this.writeProjectIgnoreFiles(e);return a.push(...o),{files:a,dirs:[]}}async writeGlobalOutputs(e){let{commands:t,skills:n,rules:i}=e.collectedInputContext,a=this.resolvePromptSourceProjectConfig(e),o=[],s=this.getGlobalConfigDir(),c=r.join(s,tg),l=r.join(s,ng),u=r.join(s,eg);if(t!=null&&t.length>0){let n=Bm(t,a);for(let t of n)o.push(await this.writeGlobalCommand(e,c,t))}if(i!=null&&i.length>0){let t=i.filter(e=>this.normalizeRuleScope(e)===`global`);for(let n of t)o.push(await this.writeRuleFile(e,u,n))}if(n==null||n.length===0)return{files:o,dirs:[]};let d=$(n,a);for(let t of d)o.push(...await this.writeGlobalSkill(e,l,t));return{files:o,dirs:[]}}createProjectRulesDirPath(e){return this.createRelativePath(r.join(e.path,$h,eg),e.basePath,()=>eg)}createProjectRuleFilePath(e,t){return this.createRelativePath(r.join(e.path,$h,eg,t),e.basePath,()=>eg)}buildChildRuleFileName(e){let t=(e.workingChildDirectoryPath?.path??e.dir.path).replaceAll(`\\`,`/`).replaceAll(/^\/+|\/+$/g,``).replaceAll(`/`,`-`);return`glob-${t.length>0?t:`root`}.md`}buildAlwaysRuleContent(e){return hd({trigger:`always_on`,type:`user_command`},e)}buildGlobRuleContent(e){let t=(e.workingChildDirectoryPath?.path??e.dir.path).replaceAll(`\\`,`/`).replaceAll(/^\/+|\/+$/g,``),n=t.length===0?`**/*`:`${t}/**`;return hd({trigger:sg,[cg]:n,type:`user_command`},e.content)}async writeProjectRuleFile(e,t,n,i,a){let o=r.join(t.basePath,t.path,$h,eg),s=r.join(o,n);return this.writeFile(e,s,i,a)}async writeGlobalCommand(e,t,n){let i=this.getTransformOptionsFromContext(e,{includeSeriesPrefix:!0}),a=this.transformCommandName(n,i),o=r.join(t,a),s=hd(this.buildCommandFrontMatter(n),n.content);return this.writeFile(e,o,s,`globalFastCommand`)}async writeRuleFile(e,t,n){let i=this.buildRuleFileName(n),a=r.join(t,i),o=this.buildRuleContent(n);return this.writeFile(e,a,o,`rule`)}async writeGlobalSkill(e,t,n){let i=[],a=n.yamlFrontMatter.name,o=r.join(t,a),s=r.join(o,ag),l=hd(this.buildSkillFrontMatter(n),n.content);if(i.push(await this.writeFile(e,s,l,`skill`)),n.mcpConfig!=null){let t=r.join(o,og);i.push(await this.writeFile(e,t,n.mcpConfig.rawContent,`mcpConfig`))}if(n.childDocs!=null)for(let t of n.childDocs){let n=r.join(o,t.relativePath.replace(/\.mdx$/,`.md`));i.push(await this.writeFile(e,n,t.content,`childDoc`))}if(n.resources!=null)for(let t of n.resources){let n=r.join(o,t.relativePath);if(t.encoding===`base64`){let e=c.Buffer.from(t.content,`base64`),s=r.dirname(n);this.ensureDirectory(s),this.writeFileSyncBuffer(n,e),i.push({path:this.createRelativePath(t.relativePath,o,()=>a),success:!0})}else i.push(await this.writeFile(e,n,t.content,`resource`))}return i}buildSkillFrontMatter(e){let t=e.yamlFrontMatter;return{name:t.name,description:t.description,type:`user_command`,...t.displayName!=null&&{displayName:t.displayName},...t.keywords!=null&&t.keywords.length>0&&{keywords:t.keywords},...t.author!=null&&{author:t.author},...t.version!=null&&{version:t.version},...t.allowTools!=null&&t.allowTools.length>0&&{allowTools:t.allowTools}}}buildCommandFrontMatter(e){let t=e.yamlFrontMatter;return t==null?{description:`Fast command`,type:`user_command`}:{description:t.description,type:`user_command`,...t.argumentHint!=null&&{argumentHint:t.argumentHint},...t.allowTools!=null&&t.allowTools.length>0&&{allowTools:t.allowTools}}}buildRuleFileName(e,t=`rule-`){return`${t}${e.series}-${e.ruleName}.md`}buildRuleContent(e){return hd({trigger:sg,[cg]:e.globs.length>0?e.globs.join(`, `):`**/*`,type:`user_command`},e.content)}normalizeRuleScope(e){return e.scope??`global`}};function ug(t){return e.J[t??`Readme`].out}var dg=class extends Am{constructor(){super(`ReadmeMdConfigFileOutputPlugin`,{outputFileName:`README.md`})}async registerProjectOutputFiles(t){let n=[],{readmePrompts:i}=t.collectedInputContext;if(i==null||i.length===0)return n;for(let t of i){let{targetDir:i}=t,a=ug(t.fileKind),o=r.join(i.path,a);n.push({pathKind:e.$.Relative,path:o,basePath:i.basePath,getDirectoryName:()=>i.getDirectoryName(),getAbsolutePath:()=>r.join(i.basePath,o)})}return n}async canWrite(e){let{readmePrompts:t}=e.collectedInputContext;return t?.length===0?(this.log.debug(`skipped`,{reason:`no README prompts to write`}),!1):!0}async writeProjectOutputs(e){let t=[],n=[],{readmePrompts:r}=e.collectedInputContext;if(r==null||r.length===0)return{files:t,dirs:n};for(let n of r){let r=await this.writeReadmeFile(e,n);t.push(r)}return{files:t,dirs:n}}async writeReadmeFile(t,i){let{targetDir:a}=i,o=ug(i.fileKind),s=r.join(a.path,o),c=r.join(a.basePath,s),l=i.content,u={pathKind:e.$.Relative,path:s,basePath:a.basePath,getDirectoryName:()=>a.getDirectoryName(),getAbsolutePath:()=>c},d=i.isRoot?`project:${i.projectName}/${o}`:`project:${i.projectName}/${a.path}/${o}`;if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`readme`,path:c,label:d}),{path:u,success:!0,skipped:!1};try{let e=r.dirname(c);return n.existsSync(e)||n.mkdirSync(e,{recursive:!0}),n.writeFileSync(c,l,`utf8`),this.log.trace({action:`write`,type:`readme`,path:c,label:d}),{path:u,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`readme`,path:c,label:d,error:t}),{path:u,success:!1,error:e}}}};const fg=`GLOBAL.md`,pg=`.trae`,mg=`steering`,hg=`rules`,gg=`commands`,_g=`skills`,vg=`SKILL.md`;var yg=class extends Am{constructor(){super(`TraeIDEOutputPlugin`,{globalConfigDir:pg,outputFileName:fg,indexignore:`.traeignore`})}getIgnoreOutputPath(){if(this.indexignore!=null)return r.join(`.trae`,`.ignore`)}getGlobalSteeringDir(){return this.joinPath(this.getGlobalConfigDir(),mg)}async registerProjectOutputDirs(e){let{projects:t}=e.collectedInputContext.workspace,{commands:n,skills:r}=e.collectedInputContext,i=this.resolvePromptSourceProjectConfig(e),a=[];for(let e of t){let t=e.dirFromWorkspacePath;if(t!=null&&(a.push(this.createRelativePath(this.joinPath(t.path,pg,hg),t.basePath,()=>hg)),n!=null&&n.length>0&&Bm(n,i).length>0&&a.push(this.createRelativePath(this.joinPath(t.path,pg,gg),t.basePath,()=>gg)),r!=null&&r.length>0)){let e=$(r,i);for(let n of e){let e=n.yamlFrontMatter.name;a.push(this.createRelativePath(this.joinPath(t.path,pg,_g,e),t.basePath,()=>e))}}}return a}async registerProjectOutputFiles(e){let{projects:t}=e.collectedInputContext.workspace,{commands:n,skills:r}=e.collectedInputContext,i=this.resolvePromptSourceProjectConfig(e),a=[];for(let o of t){if(o.dirFromWorkspacePath==null)continue;let t=o.dirFromWorkspacePath;if(o.childMemoryPrompts!=null)for(let e of o.childMemoryPrompts)a.push(this.createRelativePath(this.joinPath(t.path,pg,hg,this.buildSteeringFileName(e)),t.basePath,()=>hg));if(n!=null&&n.length>0){let r=Bm(n,i),o=this.getTransformOptionsFromContext(e,{includeSeriesPrefix:!0});for(let e of r){let n=this.transformCommandName(e,o);a.push(this.createRelativePath(this.joinPath(t.path,pg,gg,n),t.basePath,()=>gg))}}if(r!=null&&r.length>0){let e=$(r,i);for(let n of e){let e=n.yamlFrontMatter.name;if(a.push(this.createRelativePath(this.joinPath(t.path,pg,_g,e,vg),t.basePath,()=>e)),n.childDocs!=null)for(let r of n.childDocs){let n=r.relativePath.replace(/\.mdx$/,`.md`);a.push(this.createRelativePath(this.joinPath(t.path,pg,_g,e,n),t.basePath,()=>e))}if(n.resources!=null)for(let r of n.resources)a.push(this.createRelativePath(this.joinPath(t.path,pg,_g,e,r.relativePath),t.basePath,()=>e))}}}return a.push(...this.registerProjectIgnoreOutputFiles(t)),a}async registerGlobalOutputDirs(){return[this.createRelativePath(mg,this.getGlobalConfigDir(),()=>mg)]}async registerGlobalOutputFiles(e){let{globalMemory:t}=e.collectedInputContext,n=[];return t!=null&&n.push(this.createRelativePath(fg,this.getGlobalSteeringDir(),()=>mg)),n}async canWrite(e){let{workspace:t,globalMemory:n,commands:r,skills:i,aiAgentIgnoreConfigFiles:a}=e.collectedInputContext,o=t.projects.some(e=>(e.childMemoryPrompts?.length??0)>0),s=(r?.length??0)>0,c=(i?.length??0)>0,l=a?.some(e=>e.fileName===`.traeignore`)??!1;return o||n!=null||s||c||l?!0:(this.log.trace({action:`skip`,reason:`noOutputs`}),!1)}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,{commands:n,skills:r}=e.collectedInputContext,i=this.resolvePromptSourceProjectConfig(e),a=[];for(let o of t){if(o.dirFromWorkspacePath==null)continue;let t=o.dirFromWorkspacePath;if(o.childMemoryPrompts!=null)for(let t of o.childMemoryPrompts)a.push(await this.writeSteeringFile(e,o,t));if(n!=null&&n.length>0){let r=Bm(n,i);for(let n of r)a.push(await this.writeProjectCommand(e,t,n))}if(r!=null&&r.length>0){let n=$(r,i);for(let r of n)a.push(...await this.writeProjectSkill(e,t,r))}}let o=await this.writeProjectIgnoreFiles(e);return a.push(...o),{files:a,dirs:[]}}async writeGlobalOutputs(e){let{globalMemory:t}=e.collectedInputContext,n=[],r=this.getGlobalSteeringDir();return t!=null&&n.push(await this.writeFile(e,this.joinPath(r,fg),t.content,`globalMemory`)),{files:n,dirs:[]}}async writeProjectCommand(t,n,i){let a=this.getTransformOptionsFromContext(t,{includeSeriesPrefix:!0}),o=this.transformCommandName(i,a),s=r.join(n.basePath,n.path,pg,gg),c=r.join(s,o),l={pathKind:e.$.Relative,path:r.join(n.path,pg,gg,o),basePath:n.basePath,getDirectoryName:()=>gg,getAbsolutePath:()=>c},u=this.buildMarkdownContentWithRaw(i.content,i.yamlFrontMatter,i.rawFrontMatter);return this.writeFileWithHandling(t,c,u,{type:`projectCommand`,relativePath:l})}async writeProjectSkill(t,n,i){let a=[],o=i.yamlFrontMatter.name,s=r.join(n.basePath,n.path,pg,_g,o),c=r.join(s,vg),l={pathKind:e.$.Relative,path:r.join(n.path,pg,_g,o,vg),basePath:n.basePath,getDirectoryName:()=>o,getAbsolutePath:()=>c},u=hd(this.buildSkillFrontMatter(i),i.content);if(t.dryRun===!0)this.log.trace({action:`dryRun`,type:`projectSkill`,path:c}),a.push({path:l,success:!0,skipped:!1});else try{this.ensureDirectory(s),this.writeFileSync(c,u),this.log.trace({action:`write`,type:`projectSkill`,path:c}),a.push({path:l,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`projectSkill`,path:c,error:t}),a.push({path:l,success:!1,error:e})}if(i.childDocs!=null)for(let e of i.childDocs)a.push(await this.writeSkillChildDoc(t,e,s,o,n));if(i.resources!=null)for(let e of i.resources)a.push(await this.writeSkillResource(t,e,s,o,n));return a}async writeSkillChildDoc(t,n,i,a,o){let s=n.relativePath.replace(/\.mdx$/,`.md`),c=r.join(i,s),l={pathKind:e.$.Relative,path:r.join(o.path,pg,_g,a,s),basePath:o.basePath,getDirectoryName:()=>a,getAbsolutePath:()=>c},u=n.content;if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`skillChildDoc`,path:c}),{path:l,success:!0,skipped:!1};try{let e=r.dirname(c);return this.ensureDirectory(e),this.writeFileSync(c,u),this.log.trace({action:`write`,type:`skillChildDoc`,path:c}),{path:l,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`skillChildDoc`,path:c,error:t}),{path:l,success:!1,error:e}}}async writeSkillResource(t,n,i,a,o){let s=r.join(i,n.relativePath),l={pathKind:e.$.Relative,path:r.join(o.path,pg,_g,a,n.relativePath),basePath:o.basePath,getDirectoryName:()=>a,getAbsolutePath:()=>s};if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`skillResource`,path:s}),{path:l,success:!0,skipped:!1};try{let e=r.dirname(s);if(this.ensureDirectory(e),n.encoding===`base64`){let e=c.Buffer.from(n.content,`base64`);this.writeFileSyncBuffer(s,e)}else this.writeFileSync(s,n.content);return this.log.trace({action:`write`,type:`skillResource`,path:s}),{path:l,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`skillResource`,path:s,error:t}),{path:l,success:!1,error:e}}}buildSkillFrontMatter(e){let t={description:e.yamlFrontMatter.description??``};return e.yamlFrontMatter.displayName!=null&&(t.name=e.yamlFrontMatter.displayName),t}buildSteeringFileName(e){return`trae-${(e.workingChildDirectoryPath?.path??e.dir.path).replaceAll(`\\`,`/`).replaceAll(/^\/+|\/+$/g,``).replaceAll(`/`,`-`)}.md`}async writeSteeringFile(e,t,n){let r=t.dirFromWorkspacePath,i=this.buildSteeringFileName(n),a=this.joinPath(r.basePath,r.path,pg,hg),o=this.joinPath(a,i),s=[`---`,`alwaysApply: false`,`globs: ${`${(n.workingChildDirectoryPath?.path??n.dir.path).replaceAll(`\\`,`/`)}/**`}`,`---`,``,n.content].join(`
|
|
99
|
-
`);return this.writeFile(e,o,s,`steeringFile`)}};const bg=`.vscode`,xg=[`.vscode/settings.json`,`.vscode/extensions.json`];var Sg=class extends Am{constructor(){super(`VisualStudioCodeIDEConfigOutputPlugin`)}async registerProjectOutputFiles(t){let n=[],{projects:r}=t.collectedInputContext.workspace,{vscodeConfigFiles:i}=t.collectedInputContext;if(!(i!=null&&i.length>0))return n;for(let t of r){let r=t.dirFromWorkspacePath;if(r!=null&&t.isPromptSourceProject!==!0)for(let t of xg){let i=this.joinPath(r.path,t);n.push({pathKind:e.$.Relative,path:i,basePath:r.basePath,getDirectoryName:()=>this.dirname(t),getAbsolutePath:()=>this.resolvePath(r.basePath,i)})}}return n}async canWrite(e){let{vscodeConfigFiles:t}=e.collectedInputContext;return t!=null&&t.length>0?!0:(this.log.debug(`skipped`,{reason:`no VS Code config files found`}),!1)}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,{vscodeConfigFiles:n}=e.collectedInputContext,r=[],i=[],a=n??[];for(let n of t){let t=n.dirFromWorkspacePath;if(t==null)continue;let i=n.name??`unknown`;for(let n of a){let a=await this.writeConfigFile(e,t,n,`project:${i}`);r.push(a)}}return{files:r,dirs:i}}async writeConfigFile(t,n,r,i){let a=this.getTargetRelativePath(r),o=this.resolvePath(n.basePath,n.path,a),s={pathKind:e.$.Relative,path:this.joinPath(n.path,a),basePath:n.basePath,getDirectoryName:()=>this.dirname(a),getAbsolutePath:()=>o};if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`config`,path:o,label:i}),{path:s,success:!0,skipped:!1};try{let e=this.dirname(o);return this.ensureDirectory(e),this.writeFileSync(o,r.content),this.log.trace({action:`write`,type:`config`,path:o,label:i}),{path:s,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`config`,path:o,label:i,error:t}),{path:s,success:!1,error:e}}}getTargetRelativePath(t){let n=t.dir.path;if(t.type!==e.tt.VSCode)return this.basename(n);let r=n.indexOf(bg);return r===-1?this.joinPath(bg,this.basename(n)):n.slice(Math.max(0,r))}};const Cg=`WARP.md`;var wg=class extends Am{constructor(){super(`WarpIDEOutputPlugin`,{outputFileName:Cg,indexignore:`.warpindexignore`})}isAgentsPluginRegisteredInCtx(t){return`registeredPluginNames`in t&&t.registeredPluginNames!=null?t.registeredPluginNames.includes(e.it.AgentsOutput):!1}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace,r=this.isAgentsPluginRegisteredInCtx(e);for(let e of n)if(e.dirFromWorkspacePath!=null){if(r)t.push(this.createFileRelativePath(e.dirFromWorkspacePath,Cg));else if(e.rootMemoryPrompt!=null&&t.push(this.createFileRelativePath(e.dirFromWorkspacePath,Cg)),e.childMemoryPrompts!=null)for(let n of e.childMemoryPrompts)n.dir!=null&&this.isRelativePath(n.dir)&&t.push(this.createFileRelativePath(n.dir,Cg))}return t.push(...this.registerProjectIgnoreOutputFiles(n)),t}async canWrite(t){let n=this.shouldSkipDueToPlugin(t,e.it.AgentsOutput),{workspace:r,globalMemory:i,aiAgentIgnoreConfigFiles:a}=t.collectedInputContext;if(n)return i==null?(this.log.debug(`skipped`,{reason:`AgentsOutputPlugin registered but no global memory`}),!1):!0;let o=r.projects.some(e=>e.rootMemoryPrompt!=null||(e.childMemoryPrompts?.length??0)>0),s=a?.some(e=>e.fileName===`.warpindexignore`)??!1;return o||s?!0:(this.log.debug(`skipped`,{reason:`no outputs to write`}),!1)}async writeProjectOutputs(t){let n=this.shouldSkipDueToPlugin(t,e.it.AgentsOutput),{workspace:r,globalMemory:i}=t.collectedInputContext,{projects:a}=r,o=[],s=[];if(n){if(i!=null)for(let e of a){let n=e.dirFromWorkspacePath;if(n==null)continue;let r=e.name??`unknown`,a=await this.writePromptFile(t,n,i.content,`project:${r}/global-warp`);o.push(a)}let e=await this.writeProjectIgnoreFiles(t);return o.push(...e),{files:o,dirs:s}}let c=this.extractGlobalMemoryContent(t);for(let e of a){let n=e.name??`unknown`,r=e.dirFromWorkspacePath;if(r!=null){if(e.rootMemoryPrompt!=null){let i=this.combineGlobalWithContent(c,e.rootMemoryPrompt.content),a=await this.writePromptFile(t,r,i,`project:${n}/root`);o.push(a)}if(e.childMemoryPrompts!=null)for(let r of e.childMemoryPrompts){let e=await this.writePromptFile(t,r.dir,r.content,`project:${n}/child:${r.workingChildDirectoryPath?.path??`unknown`}`);o.push(e)}}}let l=await this.writeProjectIgnoreFiles(t);return o.push(...l),{files:o,dirs:s}}};const Tg=`.codeium/windsurf`,Eg=`global_workflows`,Dg=`memories`,Og=`global_rules.md`,kg=`skills`,Ag=`SKILL.md`,jg=`.windsurf`,Mg=`rules`;var Ng=class extends Am{constructor(){super(`WindsurfOutputPlugin`,{globalConfigDir:Tg,outputFileName:``,dependsOn:[e.it.AgentsOutput],indexignore:`.codeiumignore`})}async registerGlobalOutputDirs(t){let n=[],{commands:i,skills:a,rules:o}=t.collectedInputContext,s=this.resolvePromptSourceProjectConfig(t);if(i!=null&&i.length>0&&Bm(i,s).length>0){let t=this.getGlobalWorkflowsDir();n.push({pathKind:e.$.Relative,path:Eg,basePath:this.getCodeiumWindsurfDir(),getDirectoryName:()=>Eg,getAbsolutePath:()=>t})}if(a!=null&&a.length>0){let t=$(a,s);for(let i of t){let t=i.yamlFrontMatter.name,a=r.join(this.getCodeiumWindsurfDir(),kg,t);n.push({pathKind:e.$.Relative,path:r.join(kg,t),basePath:this.getCodeiumWindsurfDir(),getDirectoryName:()=>t,getAbsolutePath:()=>a})}}let c=o?.filter(e=>this.normalizeRuleScope(e)===`global`);if(c==null||c.length===0)return n;let l=this.getCodeiumWindsurfDir(),u=r.join(l,Dg);return n.push({pathKind:e.$.Relative,path:Dg,basePath:l,getDirectoryName:()=>Dg,getAbsolutePath:()=>u}),n}async registerGlobalOutputFiles(t){let n=[],{skills:i,commands:a}=t.collectedInputContext,o=this.resolvePromptSourceProjectConfig(t);if(a!=null&&a.length>0){let i=Bm(a,o),s=this.getGlobalWorkflowsDir(),c=this.getTransformOptionsFromContext(t,{includeSeriesPrefix:!0});for(let t of i){let i=this.transformCommandName(t,c),a=r.join(s,i);n.push({pathKind:e.$.Relative,path:r.join(Eg,i),basePath:this.getCodeiumWindsurfDir(),getDirectoryName:()=>Eg,getAbsolutePath:()=>a})}}let s=t.collectedInputContext.rules?.filter(e=>this.normalizeRuleScope(e)===`global`);if(s!=null&&s.length>0){let t=this.getCodeiumWindsurfDir(),i=r.join(t,Dg);for(let a of s){let o=this.buildRuleFileName(a),s=r.join(i,o);n.push({pathKind:e.$.Relative,path:r.join(Dg,o),basePath:t,getDirectoryName:()=>Dg,getAbsolutePath:()=>s})}}let c=i==null?[]:$(i,o);if(c.length===0)return n;let l=this.getSkillsDir(),u=this.getCodeiumWindsurfDir();for(let t of c){let i=t.yamlFrontMatter.name,a=r.join(l,i);if(n.push({pathKind:e.$.Relative,path:r.join(kg,i,Ag),basePath:u,getDirectoryName:()=>i,getAbsolutePath:()=>r.join(a,Ag)}),t.childDocs!=null)for(let o of t.childDocs){let t=o.relativePath.replace(/\.mdx$/,`.md`);n.push({pathKind:e.$.Relative,path:r.join(kg,i,t),basePath:u,getDirectoryName:()=>i,getAbsolutePath:()=>r.join(a,t)})}if(t.resources!=null)for(let o of t.resources)n.push({pathKind:e.$.Relative,path:r.join(kg,i,o.relativePath),basePath:u,getDirectoryName:()=>i,getAbsolutePath:()=>r.join(a,o.relativePath)})}return n}async canWrite(e){let{skills:t,commands:n,globalMemory:r,rules:i,aiAgentIgnoreConfigFiles:a}=e.collectedInputContext,o=(t?.length??0)>0,s=(n?.length??0)>0,c=(i?.length??0)>0,l=r!=null,u=a?.some(e=>e.fileName===`.codeiumignore`)??!1;return o||s||l||c||u?!0:(this.log.trace({action:`skip`,reason:`noOutputs`}),!1)}async writeGlobalOutputs(e){let{skills:t,commands:n,globalMemory:r,rules:i}=e.collectedInputContext,a=this.resolvePromptSourceProjectConfig(e),o=[],s=[];if(r!=null&&o.push(await this.writeGlobalMemory(e,r.content)),t!=null&&t.length>0){let n=$(t,a),r=this.getSkillsDir();for(let t of n)o.push(...await this.writeGlobalSkill(e,r,t))}if(n!=null&&n.length>0){let t=Bm(n,a),r=this.getGlobalWorkflowsDir();for(let n of t)o.push(await this.writeGlobalWorkflow(e,r,n))}let c=i?.filter(e=>this.normalizeRuleScope(e)===`global`);if(c==null||c.length===0)return{files:o,dirs:s};let l=this.getGlobalMemoriesDir();for(let t of c)o.push(await this.writeRuleFile(e,l,t,this.getCodeiumWindsurfDir(),Dg));return{files:o,dirs:s}}async registerProjectOutputDirs(t){let n=[],{workspace:i,rules:a}=t.collectedInputContext;if(a==null||a.length===0)return n;for(let t of i.projects){let i=t.dirFromWorkspacePath;if(i==null||Ym(Hm(a.filter(e=>this.normalizeRuleScope(e)===`project`),t.projectConfig),t.projectConfig).length===0)continue;let o=r.join(i.path,jg,Mg);n.push({pathKind:e.$.Relative,path:o,basePath:i.basePath,getDirectoryName:()=>Mg,getAbsolutePath:()=>r.join(i.basePath,o)})}return n}async registerProjectOutputFiles(t){let n=[],{workspace:i,rules:a}=t.collectedInputContext;if(a!=null&&a.length>0)for(let t of i.projects){let i=t.dirFromWorkspacePath;if(i==null)continue;let o=Ym(Hm(a.filter(e=>this.normalizeRuleScope(e)===`project`),t.projectConfig),t.projectConfig);for(let t of o){let a=this.buildRuleFileName(t),o=r.join(i.path,jg,Mg,a);n.push({pathKind:e.$.Relative,path:o,basePath:i.basePath,getDirectoryName:()=>Mg,getAbsolutePath:()=>r.join(i.basePath,o)})}}return n.push(...this.registerProjectIgnoreOutputFiles(i.projects)),n}async writeProjectOutputs(e){let t=[],{workspace:n,rules:i}=e.collectedInputContext;if(i!=null&&i.length>0)for(let a of n.projects){let n=a.dirFromWorkspacePath;if(n==null)continue;let o=Ym(Hm(i.filter(e=>this.normalizeRuleScope(e)===`project`),a.projectConfig),a.projectConfig);if(o.length===0)continue;let s=r.join(n.basePath,n.path,jg,Mg);for(let i of o)t.push(await this.writeRuleFile(e,s,i,n.basePath,r.join(n.path,jg,Mg)))}return t.push(...await this.writeProjectIgnoreFiles(e)),{files:t,dirs:[]}}getSkillsDir(){return r.join(this.getCodeiumWindsurfDir(),kg)}getCodeiumWindsurfDir(){return r.join(this.getHomeDir(),Tg)}getGlobalMemoriesDir(){return r.join(this.getCodeiumWindsurfDir(),Dg)}getGlobalWorkflowsDir(){return r.join(this.getCodeiumWindsurfDir(),Eg)}async writeGlobalMemory(t,n){let i=this.getGlobalMemoriesDir(),a=r.join(i,Og),o=this.getCodeiumWindsurfDir(),s={pathKind:e.$.Relative,path:r.join(Dg,Og),basePath:o,getDirectoryName:()=>Dg,getAbsolutePath:()=>a};if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`globalMemory`,path:a}),{path:s,success:!0,skipped:!1};try{return this.ensureDirectory(i),this.writeFileSync(a,n),this.log.trace({action:`write`,type:`globalMemory`,path:a}),{path:s,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`globalMemory`,path:a,error:t}),{path:s,success:!1,error:e}}}async writeGlobalWorkflow(t,i,a){let o=this.getTransformOptionsFromContext(t,{includeSeriesPrefix:!0}),s=this.transformCommandName(a,o),c=r.join(i,s),l={pathKind:e.$.Relative,path:r.join(Eg,s),basePath:this.getCodeiumWindsurfDir(),getDirectoryName:()=>Eg,getAbsolutePath:()=>c},u=this.buildMarkdownContentWithRaw(a.content,a.yamlFrontMatter,a.rawFrontMatter);if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`globalWorkflow`,path:c}),{path:l,success:!0,skipped:!1};try{return this.ensureDirectory(i),n.writeFileSync(c,u),this.log.trace({action:`write`,type:`globalWorkflow`,path:c}),{path:l,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`globalWorkflow`,path:c,error:t}),{path:l,success:!1,error:e}}}async writeGlobalSkill(t,n,i){let a=[],o=i.yamlFrontMatter.name,s=r.join(n,o),c=r.join(s,Ag),l=this.getCodeiumWindsurfDir(),u={pathKind:e.$.Relative,path:r.join(kg,o,Ag),basePath:l,getDirectoryName:()=>o,getAbsolutePath:()=>c},d=hd(this.buildSkillFrontMatter(i),i.content);if(t.dryRun===!0)this.log.trace({action:`dryRun`,type:`skill`,path:c}),a.push({path:u,success:!0,skipped:!1});else try{this.ensureDirectory(s),this.writeFileSync(c,d),this.log.trace({action:`write`,type:`skill`,path:c}),a.push({path:u,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skill`,path:c,error:t}),a.push({path:u,success:!1,error:e})}if(i.childDocs!=null)for(let e of i.childDocs)a.push(await this.writeSkillChildDoc(t,e,s,o,l));if(i.resources!=null)for(let e of i.resources)a.push(await this.writeSkillResource(t,e,s,o,l));return a}async writeSkillChildDoc(t,n,i,a,o){let s=n.relativePath.replace(/\.mdx$/,`.md`),c=r.join(i,s),l={pathKind:e.$.Relative,path:r.join(kg,a,s),basePath:o,getDirectoryName:()=>a,getAbsolutePath:()=>c},u=n.content;if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`childDoc`,path:c}),{path:l,success:!0,skipped:!1};try{return this.ensureDirectory(r.dirname(c)),this.writeFileSync(c,u),this.log.trace({action:`write`,type:`childDoc`,path:c}),{path:l,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`childDoc`,path:c,error:t}),{path:l,success:!1,error:e}}}async writeSkillResource(t,n,i,a,o){let s=r.join(i,n.relativePath),l={pathKind:e.$.Relative,path:r.join(kg,a,n.relativePath),basePath:o,getDirectoryName:()=>a,getAbsolutePath:()=>s};if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`resource`,path:s}),{path:l,success:!0,skipped:!1};try{return this.ensureDirectory(r.dirname(s)),n.encoding===`base64`?this.writeFileSyncBuffer(s,c.Buffer.from(n.content,`base64`)):this.writeFileSync(s,n.content),this.log.trace({action:`write`,type:`resource`,path:s}),{path:l,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`resource`,path:s,error:t}),{path:l,success:!1,error:e}}}buildRuleFileName(e,t=`rule-`){return`${t}${e.series}-${e.ruleName}.md`}buildRuleContent(e,t){return hd({trigger:`glob`,globs:e.globs.length>0?e.globs.join(`, `):``},e.content).split(`
|
|
100
|
-
`).map(e=>{let t=/^(\s*globs:\s*)(['"])(.*)\2\s*$/.exec(e);if(t==null)return e;let n=t[1]??`globs: `,r=t[3]??``;return r.trim().length===0?e:`${n}${r}`}).join(`
|
|
101
|
-
`)}async writeRuleFile(t,n,i,a,o){let s=this.buildRuleFileName(i),c=r.join(n,s),l={pathKind:e.$.Relative,path:r.join(o,s),basePath:a,getDirectoryName:()=>Mg,getAbsolutePath:()=>c},u=this.buildRuleContent(i);if(t.dryRun===!0)return this.log.trace({action:`dryRun`,type:`ruleFile`,path:c}),{path:l,success:!0,skipped:!1};try{return this.ensureDirectory(n),this.writeFileSync(c,u),this.log.trace({action:`write`,type:`ruleFile`,path:c}),{path:l,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`ruleFile`,path:c,error:t}),{path:l,success:!1,error:e}}}};function Pg(e,t){let i=r.join(e,`.git`),a=n.existsSync(i);return a?t?.info(`version control detected`,{path:i}):t?.warn(`no version control detected, please use git to manage your aindex`,{path:e}),{hasGit:a,gitPath:i}}function Fg(e,t={}){let{logger:r}=t,i=[],a=[],o=[],s=[],c=new Set;return n.existsSync(e)?(o.push(e),r?.debug(`directory exists`,{path:e})):(n.mkdirSync(e,{recursive:!0}),i.push(e),c.add(e),r?.info(`created directory`,{path:e})),{success:!0,rootPath:e,createdDirs:i,createdFiles:a,existedDirs:o,existedFiles:s}}const Ig={version:`0.0.0`,workspaceDir:`~/project`,logLevel:`info`,aindex:{dir:`aindex`,skills:{src:`skills`,dist:`dist/skills`},commands:{src:`commands`,dist:`dist/commands`},subAgents:{src:`subagents`,dist:`dist/subagents`},rules:{src:`rules`,dist:`dist/rules`},globalPrompt:{src:`global.cn.mdx`,dist:`dist/global.mdx`},workspacePrompt:{src:`workspace.cn.mdx`,dist:`dist/workspace.mdx`},app:{src:`app`,dist:`dist/app`},ext:{src:`ext`,dist:`dist/ext`},arch:{src:`arch`,dist:`dist/arch`}},commandSeriesOptions:{},plugins:[]};function Lg(e){return{...e.version==null?{}:{version:e.version},...e.workspaceDir==null?{}:{workspaceDir:e.workspaceDir},...e.aindex==null?{}:{aindex:e.aindex},...e.commandSeriesOptions==null?{}:{commandSeriesOptions:e.commandSeriesOptions},...e.logLevel==null?{}:{logLevel:e.logLevel}}}function Rg(...e){return e.reduce((e,t)=>zg(e,t),{...Ig})}function zg(e,t){let n=t.plugins,r=t.commandSeriesOptions;return{...e,...t,aindex:Bg(e.aindex,t.aindex),plugins:[...e.plugins,...n??[]],commandSeriesOptions:Vg(e.commandSeriesOptions,r)}}function Bg(e,t){return t==null?e:{dir:t.dir??e.dir,skills:{...e.skills,...t.skills},commands:{...e.commands,...t.commands},subAgents:{...e.subAgents,...t.subAgents},rules:{...e.rules,...t.rules},globalPrompt:{...e.globalPrompt,...t.globalPrompt},workspacePrompt:{...e.workspacePrompt,...t.workspacePrompt},app:{...e.app,...t.app},ext:{...e.ext,...t.ext},arch:{...e.arch,...t.arch}}}function Vg(e,t){if(t==null)return e??{};if(e==null)return t;let n={};if(e.pluginOverrides!=null)for(let[t,r]of Object.entries(e.pluginOverrides))n[t]={...r};if(t.pluginOverrides!=null)for(let[e,r]of Object.entries(t.pluginOverrides))n[e]={...n[e],...r};let r=t.includeSeriesPrefix??e.includeSeriesPrefix,i=Object.keys(n).length>0;return r!=null&&i?{includeSeriesPrefix:r,pluginOverrides:n}:r==null?i?{pluginOverrides:n}:{}:{includeSeriesPrefix:r}}function Hg(e){return`pluginOptions`in e||`configLoaderOptions`in e||`loadUserConfig`in e}async function Ug(i={}){let a=e.k();if(!a.valid){let n=e.st(`defineConfig`);for(let e of a.errors)n.error(e);t.default.exit(1)}let o,s,c;Hg(i)?({pluginOptions:c={},cwd:s}={pluginOptions:i.pluginOptions,cwd:i.cwd},o=i.loadUserConfig??!0):(c=i,o=!0);let l={},u=!1,d=[],f;if(o)try{let t=e.D(s);u=t.found,d=t.sources,t.found&&(l=Lg(t.config),f=t.config)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to load user config: ${t}`)}if(!u)throw Error(`No user config found. Please create ~/.aindex/.tnmsc.json or a .tnmsc.json in your working directory.`);let p=Rg(l,c),{plugins:m=[],logLevel:h}=p,g=e.st(`defineConfig`,h);g.info(`user config loaded`,{sources:d});let _={logger:g,userConfigOptions:p,fs:n,path:r,glob:am.default},v=m.filter(t=>t.type===e.nt.Input),y=m.filter(t=>t.type===e.nt.Output),b=await new km().executePluginsInOrder(v,_,!1,f);if(b.workspace==null)throw Error(`Workspace not initialized by any plugin`);let x={workspace:b.workspace,...b.vscodeConfigFiles!=null&&{vscodeConfigFiles:b.vscodeConfigFiles},...b.jetbrainsConfigFiles!=null&&{jetbrainsConfigFiles:b.jetbrainsConfigFiles},...b.editorConfigFiles!=null&&{editorConfigFiles:b.editorConfigFiles},...b.commands!=null&&{commands:b.commands},...b.subAgents!=null&&{subAgents:b.subAgents},...b.skills!=null&&{skills:b.skills},...b.rules!=null&&{rules:b.rules},...b.globalMemory!=null&&{globalMemory:b.globalMemory},...b.aiAgentIgnoreConfigFiles!=null&&{aiAgentIgnoreConfigFiles:b.aiAgentIgnoreConfigFiles},...b.aindexDir!=null&&{aindexDir:b.aindexDir},...b.readmePrompts!=null&&{readmePrompts:b.readmePrompts},...b.globalGitIgnore!=null&&{globalGitIgnore:b.globalGitIgnore},...b.shadowGitExclude!=null&&{shadowGitExclude:b.shadowGitExclude}};return b.aindexDir!=null&&Pg(b.aindexDir,g),{context:x,outputPlugins:y,userConfigOptions:p}}var Wg=class extends yd{constructor(){super(`MarkdownWhitespaceCleanupEffectInputPlugin`),this.registerEffect(`markdown-whitespace-cleanup`,this.cleanupWhitespace.bind(this),30)}async cleanupWhitespace(e){let{fs:t,path:n,aindexDir:r,dryRun:i,logger:a}=e,o=[],s=[],c=[],l=[n.join(r,`src`),n.join(r,`app`),n.join(r,`dist`)];for(let n of l){if(!t.existsSync(n)){a.debug({action:`whitespace-cleanup`,message:`Directory does not exist, skipping`,dir:n});continue}this.processDirectory(e,n,o,s,c,i??!1)}let u=c.length>0;return u&&a.warn({action:`whitespace-cleanup`,errors:c.map(e=>({path:e.path,error:e.error.message}))}),{success:!u,description:i?`Would modify ${o.length} files, skip ${s.length} files`:`Modified ${o.length} files, skipped ${s.length} files`,modifiedFiles:o,skippedFiles:s,...u&&{error:Error(`${c.length} errors occurred during cleanup`)}}}processDirectory(e,t,n,r,i,a){let{fs:o,path:s,logger:c}=e,l;try{l=o.readdirSync(t,{withFileTypes:!0})}catch(e){i.push({path:t,error:e}),c.warn({action:`whitespace-cleanup`,message:`Failed to read directory`,path:t,error:e.message});return}for(let o of l){let c=s.join(t,o.name);o.isDirectory()?this.processDirectory(e,c,n,r,i,a):o.isFile()&&o.name.endsWith(`.md`)&&this.processMarkdownFile(e,c,n,r,i,a)}}processMarkdownFile(e,t,n,r,i,a){let{fs:o,logger:s}=e;try{let e=o.readFileSync(t,`utf8`),i=this.cleanMarkdownContent(e);if(e===i){r.push(t),s.debug({action:`whitespace-cleanup`,skipped:t,reason:`no changes needed`});return}a?(s.debug({action:`whitespace-cleanup`,dryRun:!0,wouldModify:t}),n.push(t)):(o.writeFileSync(t,i,`utf8`),n.push(t),s.debug({action:`whitespace-cleanup`,modified:t}))}catch(e){i.push({path:t,error:e}),s.warn({action:`whitespace-cleanup`,message:`Failed to process file`,path:t,error:e.message})}}cleanMarkdownContent(e){let t=this.detectLineEnding(e),n=e.split(/\r?\n/).map(e=>e.replace(/[ \t]+$/,``)),r=[],i=0;for(let e of n)e===``?(i++,i<=2&&r.push(e)):(i=0,r.push(e));return r.join(t)}detectLineEnding(e){return e.includes(`\r
|
|
102
|
-
`)?`\r
|
|
103
|
-
`:`
|
|
104
|
-
`}collect(e){return{}}},Gg=class extends yd{constructor(){super(`OrphanFileCleanupEffectInputPlugin`),this.registerEffect(`orphan-file-cleanup`,this.cleanupOrphanFiles.bind(this),20)}async cleanupOrphanFiles(e){let{fs:t,path:n,aindexDir:r,dryRun:i,logger:a,userConfigOptions:o}=e,s=n.join(r,`dist`),c=[],l=[],u=[];if(!t.existsSync(s))return a.debug({action:`orphan-cleanup`,message:`dist/ directory does not exist, skipping`,distDir:s}),{success:!0,description:`dist/ directory does not exist, nothing to clean`,deletedFiles:c,deletedDirs:l};let d=o.aindex,f={skills:d?.skills?.src??`skills`,commands:d?.commands?.src??`commands`,agents:d?.subAgents?.src??`subagents`,app:d?.app?.src??`app`};for(let r of[`skills`,`commands`,`agents`,`app`]){let a=n.join(s,r);t.existsSync(a)&&this.cleanupDirectory(e,a,r,f[r],c,l,u,i??!1)}let p=u.length>0;return p&&a.warn({action:`orphan-cleanup`,errors:u.map(e=>({path:e.path,error:e.error.message}))}),{success:!p,description:i?`Would delete ${c.length} files and ${l.length} directories`:`Deleted ${c.length} files and ${l.length} directories`,deletedFiles:c,deletedDirs:l,...p&&{error:Error(`${u.length} errors occurred during cleanup`)}}}cleanupDirectory(e,t,n,r,i,a,o,s){let{fs:c,path:l,aindexDir:u,logger:d}=e,f;try{f=c.readdirSync(t,{withFileTypes:!0})}catch(e){o.push({path:t,error:e}),d.warn({action:`orphan-cleanup`,message:`Failed to read directory`,path:t,error:e.message});return}for(let p of f){let f=l.join(t,p.name);if(p.isDirectory())this.cleanupDirectory(e,f,n,r,i,a,o,s),this.removeEmptyDirectory(e,f,a,o,s);else if(p.isFile()&&this.isOrphanFile(e,f,n,r,u))if(s)d.debug({action:`orphan-cleanup`,dryRun:!0,wouldDelete:f}),i.push(f);else try{c.unlinkSync(f),i.push(f),d.debug({action:`orphan-cleanup`,deleted:f})}catch(e){o.push({path:f,error:e}),d.warn({action:`orphan-cleanup`,message:`Failed to delete file`,path:f,error:e.message})}}}isOrphanFile(e,t,n,r,i){let{fs:a,path:o}=e,s=o.basename(t),c=s.endsWith(`.mdx`),l=o.join(i,`dist`,n),u=o.relative(l,t),d=o.dirname(u),f=s.replace(/\.mdx$/,``);if(c)return!this.getPossibleSourcePaths(o,i,n,r,f,d).some(e=>a.existsSync(e));let p=[];return p.push(o.join(i,r,u)),!p.some(e=>a.existsSync(e))}getPossibleSourcePaths(e,t,n,r,i,a){switch(n){case`skills`:{let n=(a===`.`?[i]:a.split(e.sep))[0]??i,o=a===`.`?``:a.slice(n.length+1);return o===``?[e.join(t,r,n,`SKILL.cn.mdx`),e.join(t,r,n,`skill.cn.mdx`)]:[e.join(t,r,n,o,`${i}.cn.mdx`)]}case`commands`:return a===`.`?[e.join(t,r,`${i}.cn.mdx`)]:[e.join(t,r,a,`${i}.cn.mdx`)];case`agents`:return a===`.`?[e.join(t,r,`${i}.cn.mdx`)]:[e.join(t,r,a,`${i}.cn.mdx`)];case`app`:return a===`.`?[e.join(t,r,`${i}.cn.mdx`)]:[e.join(t,r,a,`${i}.cn.mdx`)];default:return[]}}removeEmptyDirectory(e,t,n,r,i){let{fs:a,logger:o}=e;try{a.readdirSync(t).length===0&&(i?(o.debug({action:`orphan-cleanup`,dryRun:!0,wouldDeleteDir:t}),n.push(t)):(a.rmdirSync(t),n.push(t),o.debug({action:`orphan-cleanup`,deletedDir:t})))}catch(e){r.push({path:t,error:e}),o.warn({action:`orphan-cleanup`,message:`Failed to check/remove directory`,path:t,error:e.message})}}collect(e){return{}}},Kg=class extends yd{constructor(){super(`SkillNonSrcFileSyncEffectInputPlugin`),this.registerEffect(`skill-non-src-file-sync`,this.syncNonSrcFiles.bind(this),10)}async syncNonSrcFiles(e){let{fs:t,path:n,aindexDir:r,dryRun:i,logger:a}=e,o=n.join(r,`src`,`skills`),s=n.join(r,`dist`,`skills`),c=[],l=[],u=[],d=[];if(!t.existsSync(o))return a.debug({action:`skill-sync`,message:`src/skills/ directory does not exist, skipping`,srcSkillsDir:o}),{success:!0,description:`src/skills/ directory does not exist, nothing to sync`,copiedFiles:c,skippedFiles:l,createdDirs:u};this.syncDirectoryRecursive(e,o,s,``,c,l,u,d,i??!1);let f=d.length>0;return f&&a.warn({action:`skill-sync`,errors:d.map(e=>({path:e.path,error:e.error.message}))}),{success:!f,description:i?`Would copy ${c.length} files, skip ${l.length} files`:`Copied ${c.length} files, skipped ${l.length} files`,copiedFiles:c,skippedFiles:l,createdDirs:u,...f&&{error:Error(`${d.length} errors occurred during sync`)},modifiedFiles:c}}syncDirectoryRecursive(e,t,n,r,i,a,o,s,c){let{fs:l,path:u,logger:d}=e,f=r?u.join(t,r):t;if(!l.existsSync(f))return;let p;try{p=l.readdirSync(f,{withFileTypes:!0})}catch(e){s.push({path:f,error:e}),d.warn({action:`skill-sync`,message:`Failed to read directory`,path:f,error:e.message});return}for(let f of p){let p=r?u.join(r,f.name):f.name,m=u.join(t,p),h=u.join(n,p);if(f.isDirectory())this.syncDirectoryRecursive(e,t,n,p,i,a,o,s,c);else if(f.isFile()){if(f.name.endsWith(`.cn.mdx`))continue;let e=u.dirname(h);if(!l.existsSync(e))if(c)d.debug({action:`skill-sync`,dryRun:!0,wouldCreateDir:e}),o.push(e);else try{l.mkdirSync(e,{recursive:!0}),o.push(e),d.debug({action:`skill-sync`,createdDir:e})}catch(t){s.push({path:e,error:t}),d.warn({action:`skill-sync`,message:`Failed to create directory`,path:e,error:t.message});continue}if(l.existsSync(h))try{let e=l.readFileSync(m),t=l.readFileSync(h);if(this.computeHash(e)===this.computeHash(t)){a.push(h),d.debug({action:`skill-sync`,skipped:h,reason:`identical content`});continue}}catch(e){d.debug({action:`skill-sync`,message:`Could not compare files, will copy`,path:h,error:e.message})}if(c)d.debug({action:`skill-sync`,dryRun:!0,wouldCopy:{from:m,to:h}}),i.push(h);else try{l.copyFileSync(m,h),i.push(h),d.debug({action:`skill-sync`,copied:{from:m,to:h}})}catch(e){s.push({path:h,error:e}),d.warn({action:`skill-sync`,message:`Failed to copy file`,from:m,to:h,error:e.message})}}}}computeHash(e){return(0,l.createHash)(`sha256`).update(e).digest(`hex`)}collect(e){return{}}};const qg=/export\s+default\s*\{([\s\S]*?)\}/u,Jg=/description\s*:\s*['"`]([^'"`]+)['"`]/u,Yg=/name\s*:\s*['"`]([^'"`]+)['"`]/u,Xg=/displayName\s*:\s*['"`]([^'"`]+)['"`]/u,Zg=/keywords\s*:\s*\[([^\]]+)\]/u,Qg=/author\s*:\s*['"`]([^'"`]+)['"`]/u,$g=/version\s*:\s*['"`]([^'"`]+)['"`]/u;function e_(e){let t={},n=qg.exec(e);if(n?.[1]==null)return t;let r=n[1],i=Jg.exec(r);i?.[1]!=null&&(t.description=i[1]);let a=Yg.exec(r);a?.[1]!=null&&(t.name=a[1]);let o=Xg.exec(r);o?.[1]!=null&&(t.displayName=o[1]);let s=Zg.exec(r);s?.[1]!=null&&(t.keywords=s[1].split(`,`).map(e=>e.trim().replaceAll(/['"]/gu,``)).filter(e=>e.length>0));let c=Qg.exec(r);c?.[1]!=null&&(t.author=c[1]);let l=$g.exec(r);return l?.[1]!=null&&(t.version=l[1]),t}const t_={".ts":`text/typescript`,".tsx":`text/typescript`,".js":`text/javascript`,".jsx":`text/javascript`,".json":`application/json`,".py":`text/x-python`,".java":`text/x-java`,".kt":`text/x-kotlin`,".go":`text/x-go`,".rs":`text/x-rust`,".c":`text/x-c`,".cpp":`text/x-c++`,".cs":`text/x-csharp`,".rb":`text/x-ruby`,".php":`text/x-php`,".swift":`text/x-swift`,".scala":`text/x-scala`,".sql":`application/sql`,".xml":`application/xml`,".yaml":`text/yaml`,".yml":`text/yaml`,".toml":`text/toml`,".csv":`text/csv`,".graphql":`application/graphql`,".txt":`text/plain`,".pdf":`application/pdf`,".docx":`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,".xlsx":`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,".html":`text/html`,".css":`text/css`,".svg":`image/svg+xml`,".png":`image/png`,".jpg":`image/jpeg`,".jpeg":`image/jpeg`,".gif":`image/gif`,".webp":`image/webp`,".ico":`image/x-icon`,".bmp":`image/bmp`},n_=new Set(`.png,.jpg,.jpeg,.gif,.webp,.ico,.bmp,.tiff,.svg,.exe,.dll,.so,.dylib,.bin,.wasm,.class,.jar,.war,.pyd,.pyc,.pyo,.zip,.tar,.gz,.bz2,.7z,.rar,.ttf,.otf,.woff,.woff2,.eot,.db,.sqlite,.sqlite3,.pdf,.docx,.doc,.xlsx,.xls,.pptx,.ppt,.odt,.ods,.odp`.split(`,`)),r_={image:[`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.ico`,`.bmp`,`.tiff`,`.svg`],code:`.kt,.java,.py,.pyi,.pyx,.ts,.tsx,.js,.jsx,.mjs,.cjs,.go,.rs,.c,.cpp,.cc,.h,.hpp,.hxx,.cs,.fs,.fsx,.vb,.rb,.php,.swift,.scala,.groovy,.lua,.r,.jl,.ex,.exs,.erl,.clj,.cljs,.hs,.ml,.mli,.nim,.zig,.v,.dart,.vue,.svelte,.d.ts,.d.mts,.d.cts`.split(`,`),data:[`.sql`,`.json`,`.jsonc`,`.json5`,`.xml`,`.xsd`,`.xsl`,`.xslt`,`.yaml`,`.yml`,`.toml`,`.csv`,`.tsv`,`.graphql`,`.gql`,`.proto`],document:[`.txt`,`.text`,`.rtf`,`.log`,`.docx`,`.doc`,`.xlsx`,`.xls`,`.pptx`,`.ppt`,`.pdf`,`.odt`,`.ods`,`.odp`],config:[`.ini`,`.conf`,`.cfg`,`.config`,`.properties`,`.env`,`.envrc`,`.editorconfig`,`.gitignore`,`.gitattributes`,`.npmrc`,`.nvmrc`,`.npmignore`,`.eslintrc`,`.prettierrc`,`.stylelintrc`,`.babelrc`,`.browserslistrc`],script:[`.sh`,`.bash`,`.zsh`,`.fish`,`.ps1`,`.psm1`,`.psd1`,`.bat`,`.cmd`],binary:`.exe,.dll,.so,.dylib,.bin,.wasm,.class,.jar,.war,.pyd,.pyc,.pyo,.zip,.tar,.gz,.bz2,.7z,.rar,.ttf,.otf,.woff,.woff2,.eot,.db,.sqlite,.sqlite3`.split(`,`)};function i_(e){let t=e.toLowerCase();for(let[e,n]of Object.entries(r_))if(n.includes(t))return e;return`other`}function a_(e){return n_.has(e.toLowerCase())}function o_(e){return t_[e.toLowerCase()]}function s_(...e){return r.join(...e).replaceAll(`\\`,`/`)}var c_=class{ctx;constructor(e){this.ctx=e}processDirectory(e,t,n){let r=t?`${t}/${e.name}`:e.name;return this.scanSkillDirectory(n,r)}processFile(e,t,n){let r=t?`${t}/${e.name}`:e.name;if(t===``&&e.name===`skill.mdx`||t===``&&e.name===`mcp.json`)return{childDocs:[],resources:[]};if(e.name.endsWith(`.mdx`)){let t=this.processChildDoc(e.name,r,n);return{childDocs:t?[t]:[],resources:[]}}let i=this.processResourceFile(e.name,r,n);return{childDocs:[],resources:i?[i]:[]}}processChildDoc(t,n,i){try{let t=_d(this.ctx.fs.readFileSync(i,`utf8`)),a=vd(t.contentWithoutFrontMatter);return{type:e.rt.SkillChildDoc,content:a,length:a.length,filePathKind:e.$.Relative,markdownAst:t.markdownAst,markdownContents:t.markdownContents,...t.rawFrontMatter!=null&&{rawFrontMatter:t.rawFrontMatter},relativePath:n,dir:{pathKind:e.$.Relative,path:n,basePath:this.ctx.skillDir,getDirectoryName:()=>r.dirname(n),getAbsolutePath:()=>i}}}catch(e){return this.ctx.logger.warn(`failed to read child doc`,{path:n,error:e}),null}}processResourceFile(t,n,i){let a=r.extname(t);try{let{content:r,encoding:o,length:s}=this.readFileContent(i,a),c=o_(a);return{type:e.rt.SkillResource,extension:a,fileName:t,relativePath:n,content:r,encoding:o,category:i_(a),length:s,...c!=null&&{mimeType:c}}}catch(e){return this.ctx.logger.warn(`failed to read resource file`,{path:n,error:e}),null}}readFileContent(e,t){if(a_(t)){let t=this.ctx.fs.readFileSync(e);return{content:t.toString(`base64`),encoding:`base64`,length:t.length}}let n=this.ctx.fs.readFileSync(e,`utf8`);return{content:n,encoding:`text`,length:c.Buffer.from(n,`utf8`).length}}scanSkillDirectory(e,t=``){let n=[],r=[],i;try{i=this.ctx.fs.readdirSync(e,{withFileTypes:!0})}catch(t){return this.ctx.logger.warn(`failed to scan directory`,{path:e,error:t}),{childDocs:n,resources:r}}for(let a of i){let i=s_(e,a.name);if(a.isDirectory()){let e=this.processDirectory(a,t,i);n.push(...e.childDocs),r.push(...e.resources);continue}if(!a.isFile())continue;let o=this.processFile(a,t,i);n.push(...o.childDocs),r.push(...o.resources)}return{childDocs:n,resources:r}}};function l_(t,n,i){let a=r.join(t,`mcp.json`);if(n.existsSync(a)){if(!n.statSync(a).isFile()){i.warn(`mcp.json is not a file`,{skillDir:t});return}try{let r=n.readFileSync(a,`utf8`),o=JSON.parse(r);if(o.mcpServers==null||typeof o.mcpServers!=`object`){i.warn(`mcp.json missing mcpServers field`,{skillDir:t});return}return{type:e.rt.SkillMcpConfig,mcpServers:o.mcpServers,rawContent:r}}catch(e){i.warn(`failed to parse mcp.json`,{skillDir:t,error:e});return}}}async function u_(t,n,i,a,o,s,c,l=[],u=[],d){let{logger:f,globalScope:p,fs:m}=s,h=r.join(o,`skill.mdx`),g=t,_;if(m.existsSync(h))try{g=m.readFileSync(h,`utf8`),_=_d(g),t=vd((await Lf(g,{globalScope:p,extractMetadata:!0,basePath:o})).content)}catch(e){f.warn(`failed to recompile skill from dist`,{skill:i,error:e})}let v=e_(g),y=_?.yamlFrontMatter?.description??v.description;if(y==null||y.trim().length===0)throw f.error(`SKILL_VALIDATION_FAILED: description is required and cannot be empty`,{skill:i,skillDir:a,yamlDescription:_?.yamlFrontMatter?.description,exportDescription:v.description,hint:`Add a non-empty description field to the SKILL.md front matter or export default`}),Error(`Skill "${i}" validation failed: description is required and cannot be empty`);let b={...v,..._?.yamlFrontMatter??{},name:i,description:y};return{type:e.rt.Skill,content:t,length:t.length,filePathKind:e.$.Relative,yamlFrontMatter:b,markdownAst:_?.markdownAst,markdownContents:_?.markdownContents??[],dir:{pathKind:e.$.Relative,path:i,basePath:a,getDirectoryName:()=>i,getAbsolutePath:()=>r.join(a,i)},..._?.rawFrontMatter!=null&&{rawFrontMatter:_.rawFrontMatter},...c!=null&&{mcpConfig:c},...l!=null&&l.length>0&&{childDocs:l},...u!=null&&u.length>0&&{resources:u},...d!=null&&{seriName:d}}}async function d_(t,n,i,a,o){let{logger:s,globalScope:c,fs:l}=o,u;try{u=l.readFileSync(t,`utf8`)}catch(e){return s.error(`failed to read skill file`,{file:t,error:e}),null}let d;try{d=_d(u)}catch(e){return s.error(`failed to parse skill markdown`,{file:t,error:e}),null}let f;try{f=await Lf(u,{globalScope:c,extractMetadata:!0,basePath:a})}catch(e){return s.error(`failed to compile skill mdx`,{file:t,error:e}),null}let p={...d.yamlFrontMatter,...f.metadata.fields},m=p.description;if(m==null||m.trim().length===0)throw s.error(`SKILL_VALIDATION_FAILED: description is required and cannot be empty`,{skill:i,skillFilePath:t,yamlDescription:d.yamlFrontMatter?.description,exportDescription:f.metadata.fields.description,hint:`Add a non-empty description field to the SKILL.md front matter or export default`}),Error(`Skill "${i}" validation failed: description is required and cannot be empty`);let h=e.Y(p,t);for(let e of h.warnings)s.debug(e);if(!h.valid)throw new Cd(h.errors,t);let g=vd(f.content);s.debug(`skill metadata extracted`,{skill:i,source:f.metadata.source,hasYaml:d.yamlFrontMatter!=null,hasExport:Object.keys(f.metadata.fields).length>0});let{childDocs:_,resources:v}=new c_({fs:l,logger:s,skillDir:a}).scanSkillDirectory(a),y=l_(a,l,s),{seriName:b}=p;return{type:e.rt.Skill,content:g,length:g.length,filePathKind:e.$.Relative,yamlFrontMatter:p.name==null?{name:i,description:``}:p,...d.rawFrontMatter!=null&&{rawFrontMatter:d.rawFrontMatter},markdownAst:d.markdownAst,markdownContents:d.markdownContents,...y!=null&&{mcpConfig:y},..._.length>0&&{childDocs:_},...v.length>0&&{resources:v},...b!=null&&{seriName:b},dir:{pathKind:e.$.Relative,path:i,basePath:n,getDirectoryName:()=>i,getAbsolutePath:()=>r.join(n,i)}}}var f_=class extends yd{constructor(){super(`SkillInputPlugin`)}readMcpConfig(e,t,n){return l_(e,t,n)}scanSkillDirectory(e,t,n,r=``){return new c_({fs:t,logger:n,skillDir:e}).scanSkillDirectory(e,r)}async collect(t){let{userConfigOptions:n,logger:r,fs:i,path:a,globalScope:o}=t,{aindexDir:s}=this.resolveBasePaths(n),c=this.resolveAindexPath(n.aindex.skills.src,s),l=this.resolveAindexPath(n.aindex.skills.dist,s),u=[],{prompts:d,errors:f}=await zf(i,a,r,o).readDirectoryStructure(c,l,{kind:e.rt.Skill,entryFileName:`skill`,localeExtensions:{zh:`.cn.mdx`,en:`.mdx`},isDirectoryStructure:!0,createPrompt:async(e,n,o)=>{let s=a.join(l,o),{childDocs:c,resources:u}=new c_({fs:i,logger:r,skillDir:s}).scanSkillDirectory(s);return u_(e,n,o,l,s,t,l_(s,i,r),c,u)}});for(let e of f)r.warn(`Failed to read skill`,{path:e.path,phase:e.phase,error:e.error});for(let e of d){let t=e.dist?.prompt??e.src.default.prompt;t&&u.push(t)}if(i.existsSync(l)){let e=i.readdirSync(l,{withFileTypes:!0}),n=new Set(d.map(e=>e.name));for(let o of e){if(!o.isDirectory()||n.has(o.name))continue;let e=o.name,s=a.join(l,e,`skill.mdx`),c=a.join(l,e);if(i.existsSync(s))try{let n=await d_(s,l,e,c,t);n&&u.push(n)}catch(e){r.error(`failed to parse skill`,{file:s,error:e})}}}let p=new Map;for(let e of d)p.set(e.name,e);return{prompts:{skills:d,commands:[],subAgents:[],rules:[],readme:[]},promptIndex:p,skills:u}}},p_=class extends yd{constructor(){super(`AindexInputPlugin`)}loadProjectConfig(e,t,n,r,i,a){let o=i.join(t,n,e,`project.jsonc`);if(r.existsSync(o))try{let t=r.readFileSync(o,`utf8`),n=[],i=(0,u.parse)(t,n);if(n.length>0){a.warn(`failed to parse project.jsonc for ${e}`,{path:o,errors:n});return}return i}catch(t){a.warn(`failed to parse project.jsonc for ${e}`,{path:o,error:t});return}}collect(t){let{userConfigOptions:n,logger:r,fs:i,path:a}=t,{workspaceDir:o,aindexDir:s}=this.resolveBasePaths(n),c=this.resolveAindexPath(n.aindex.app.dist,s),l=a.basename(s),u=[];if(i.existsSync(c)&&i.statSync(c).isDirectory())try{let t=i.readdirSync(c,{withFileTypes:!0});for(let c of t)if(c.isDirectory()){let t=c.name===l,d=this.loadProjectConfig(c.name,s,n.aindex.app.src,i,a,r);u.push({name:c.name,...t&&{isPromptSourceProject:!0},...d!=null&&{projectConfig:d},dirFromWorkspacePath:{pathKind:e.$.Relative,path:c.name,basePath:o,getDirectoryName:()=>c.name,getAbsolutePath:()=>a.resolve(o,c.name)}})}}catch(e){r.error(`failed to scan aindex projects`,{path:c,error:e})}if(u.length===0&&i.existsSync(o)&&i.statSync(o).isDirectory()){r.debug(`no projects in dist/app/, falling back to workspace scan`,{workspaceDir:o});try{let t=i.readdirSync(o,{withFileTypes:!0});for(let c of t)if(c.isDirectory()&&!c.name.startsWith(`.`)){let t=c.name===l,d=this.loadProjectConfig(c.name,s,n.aindex.app.src,i,a,r);u.push({name:c.name,...t&&{isPromptSourceProject:!0},...d!=null&&{projectConfig:d},dirFromWorkspacePath:{pathKind:e.$.Relative,path:c.name,basePath:o,getDirectoryName:()=>c.name,getAbsolutePath:()=>a.resolve(o,c.name)}})}}catch(e){r.error(`failed to scan workspace directory`,{path:o,error:e})}}return{workspace:{directory:{pathKind:e.$.Absolute,path:o,getDirectoryName:()=>a.basename(o)},projects:u}}}},m_=class extends yd{constructor(){super(`CommandInputPlugin`)}getDistDir(e,t){return this.resolveAindexPath(e.aindex.commands.dist,t.aindexDir)}createCommandPrompt(t,n,r,i,a,o,s){let{path:c}=o,l=r.replaceAll(`\\`,`/`),u=l.indexOf(`/`),d=u===-1?void 0:l.slice(0,u),f=u===-1?l:l.slice(u+1),p=this.extractPrefixInfo(f,d),m=c.join(a,`${r}.mdx`),h=`${r}.mdx`;return{type:e.rt.Command,content:t,length:t.length,filePathKind:e.$.Relative,dir:{pathKind:e.$.Relative,path:h,basePath:a,getDirectoryName:()=>h.replace(/\.mdx$/,``),getAbsolutePath:()=>m},...p.commandPrefix!=null&&{commandPrefix:p.commandPrefix},commandName:p.commandName}}extractPrefixInfo(e,t){let n=e.replace(/\.mdx$/,``);if(t!=null)return{commandPrefix:t,commandName:n};let r=n.indexOf(`_`);return r===-1?{commandName:n}:{commandPrefix:n.slice(0,Math.max(0,r)),commandName:n.slice(Math.max(0,r+1))}}async collect(t){let{userConfigOptions:n,logger:r,path:i,fs:a,globalScope:o}=t,s=this.resolveBasePaths(n),c=this.resolveAindexPath(n.aindex.commands.src,s.aindexDir),l=this.getDistDir(n,s);r.debug(`CommandInputPlugin collecting`,{srcDir:c,distDir:l,aindexDir:s.aindexDir});let{prompts:u,errors:d}=await zf(a,i,r,o).readFlatFiles(c,l,{kind:e.rt.Command,localeExtensions:{zh:`.cn.mdx`,en:`.mdx`},isDirectoryStructure:!1,createPrompt:async(e,n,r)=>this.createCommandPrompt(e,n,r,c,l,t)});r.debug(`CommandInputPlugin read complete`,{commandCount:u.length,errorCount:d.length});for(let e of d)r.warn(`Failed to read command`,{path:e.path,phase:e.phase,error:e.error});let f=[];for(let e of u){let t=e.dist?.prompt??e.src.default.prompt;t&&f.push(t)}r.debug(`CommandInputPlugin legacy commands`,{count:f.length,commands:f.map(e=>e.commandName)});let p=new Map;for(let e of u)p.set(e.name,e);return{prompts:{skills:[],commands:u,subAgents:[],rules:[],readme:[]},promptIndex:p,commands:f}}};function h_(t,n,r,i,a){let o=a.join(r,n);if(!(i.existsSync(o)&&i.statSync(o).isFile()))return;let s=i.readFileSync(o,`utf8`);return{type:t,content:s,length:s.length,filePathKind:e.$.Absolute,dir:{pathKind:e.$.Absolute,path:o,getDirectoryName:()=>a.basename(o)}}}var g_=class extends yd{constructor(){super(`EditorConfigInputPlugin`)}collect(t){let{userConfigOptions:n,fs:r,path:i}=t,{aindexDir:a}=this.resolveBasePaths(n),o=[],s=h_(e.tt.EditorConfig,`.editorconfig`,a,r,i);return s!=null&&o.push(s),{editorConfigFiles:o}}},__=class extends yd{constructor(){super(`GitExcludeInputPlugin`)}collect(e){let{aindexDir:t}=this.resolveBasePaths(e.userConfigOptions),n=r.join(t,`public`,`exclude`);if(!e.fs.existsSync(n))return this.log.debug({action:`collect`,message:`File not found`,path:n}),{};let i=e.fs.readFileSync(n,`utf8`);return i.length===0?(this.log.debug({action:`collect`,message:`File is empty`,path:n}),{}):(this.log.debug({action:`collect`,message:`Loaded file content`,path:n,length:i.length}),{shadowGitExclude:i})}},v_=class extends yd{constructor(){super(`GitIgnoreInputPlugin`)}collect(e){let{aindexDir:t}=this.resolveBasePaths(e.userConfigOptions),n=r.join(t,`public`,`gitignore`);if(!e.fs.existsSync(n))return this.log.debug({action:`collect`,message:`File not found`,path:n}),{};let i=e.fs.readFileSync(n,`utf8`);return i.length===0?(this.log.debug({action:`collect`,message:`File is empty`,path:n}),{}):(this.log.debug({action:`collect`,message:`Loaded file content`,path:n,length:i.length}),{globalGitIgnore:i})}},y_=class extends yd{constructor(){super(`GlobalMemoryInputPlugin`)}async collect(n){let{userConfigOptions:r,fs:i,path:o,globalScope:s}=n,{aindexDir:c}=this.resolveBasePaths(r),l=this.resolveAindexPath(r.aindex.globalPrompt.dist,c);if(!i.existsSync(l))return this.log.warn({action:`collect`,reason:`fileNotFound`,path:l}),{};if(!i.statSync(l).isFile())return this.log.warn({action:`collect`,reason:`notAFile`,path:l}),{};let u=i.readFileSync(l,`utf8`),d=_d(u),f;if(s!=null)try{f=await Lf(u,{globalScope:s,basePath:o.dirname(l)})}catch(e){throw e instanceof bd&&(this.log.error(`MDX compilation failed: ${e.message}`),this.log.error(`Please check your configuration file (~/.aindex/.tnmsc.json) and ensure all required variables are defined.`),this.log.error(`For example, if using {profile.name}, add a "profile" section with "name" field to your config.`),t.default.exit(1)),e}else f=d.contentWithoutFrontMatter;return this.log.debug({action:`collect`,path:l,contentLength:f.length}),{globalMemory:{type:e.rt.GlobalMemory,content:f,length:f.length,filePathKind:e.$.Relative,...d.rawFrontMatter!=null&&{rawFrontMatter:d.rawFrontMatter},markdownAst:d.markdownAst,markdownContents:d.markdownContents,dir:{pathKind:e.$.Relative,path:o.basename(l),basePath:o.dirname(l),getDirectoryName:()=>o.basename(l),getAbsolutePath:()=>l},parentDirectoryPath:{type:e.et.UserHome,directory:{pathKind:e.$.Relative,path:``,basePath:a.homedir(),getDirectoryName:()=>o.basename(a.homedir()),getAbsolutePath:()=>a.homedir()}}}}}};function b_(t,n,r,i,a){let o=a.join(r,n);if(!(i.existsSync(o)&&i.statSync(o).isFile()))return;let s=i.readFileSync(o,`utf8`);return{type:t,content:s,length:s.length,filePathKind:e.$.Absolute,dir:{pathKind:e.$.Absolute,path:o,getDirectoryName:()=>a.basename(o)}}}var x_=class extends yd{constructor(){super(`JetBrainsConfigInputPlugin`)}collect(t){let{userConfigOptions:n,fs:r,path:i}=t,{aindexDir:a}=this.resolveBasePaths(n),o=[`.idea/codeStyles/Project.xml`,`.idea/codeStyles/codeStyleConfig.xml`,`.idea/.gitignore`],s=[];for(let t of o){let n=b_(e.tt.IntellijIDEA,t,a,r,i);n!=null&&s.push(n)}return{jetbrainsConfigFiles:s}}};const S_=`agt.mdx`,C_=[`node_modules`,`.git`];var w_=class extends yd{constructor(){super(`ProjectPromptInputPlugin`,[`AindexInputPlugin`])}async collect(e){let{dependencyContext:t,fs:n,userConfigOptions:r,path:i,globalScope:a}=e,{aindexDir:o}=this.resolveBasePaths(r),s=this.resolveAindexPath(r.aindex.app.dist,o),c=t.workspace;if(c==null)return this.log.warn(`No workspace found in dependency context, skipping project prompt enhancement`),{};let l=c.projects??[],u=await Promise.all(l.map(async t=>{let r=t.name;if(r==null)return t;let o=i.join(s,r);if(!n.existsSync(o)||!n.statSync(o).isDirectory())return t;let c=t.dirFromWorkspacePath?.getAbsolutePath(),l=await this.readRootMemoryPrompt(e,o,a),u=c==null?[]:await this.scanChildMemoryPrompts(e,o,c,a);return{...t,...l!=null&&{rootMemoryPrompt:l},...u.length>0&&{childMemoryPrompts:u}}}));return{workspace:{directory:c.directory,projects:u}}}async readRootMemoryPrompt(n,r,i){let{fs:a,path:o,logger:s}=n,c=o.join(r,S_);if(!(!a.existsSync(c)||!a.statSync(c).isFile()))try{let n=a.readFileSync(c,`utf8`),o=_d(n),l;try{l=await Lf(n,{globalScope:i,basePath:r})}catch(e){throw e instanceof bd&&(s.error(`MDX compilation failed in ${c}: ${e.message}`),s.error(`Please check your configuration file (~/.aindex/.tnmsc.json) and ensure all required variables are defined.`),t.default.exit(1)),e}return{type:e.rt.ProjectRootMemory,content:l,length:l.length,filePathKind:e.$.Relative,...o.yamlFrontMatter!=null&&{yamlFrontMatter:o.yamlFrontMatter},...o.rawFrontMatter!=null&&{rawFrontMatter:o.rawFrontMatter},markdownAst:o.markdownAst,markdownContents:o.markdownContents,dir:{pathKind:e.$.Root,path:``,getDirectoryName:()=>``}}}catch(e){s.error(`Failed to read root memory prompt at ${c}`,{error:e});return}}async scanChildMemoryPrompts(e,t,n,r){let{logger:i}=e,a=[];try{await this.scanDirectoryRecursive(e,t,t,n,a,r)}catch(e){i.error(`Failed to scan child memory prompts at ${t}`,{error:e})}return a}async scanDirectoryRecursive(e,t,n,r,i,a){let{fs:o,path:s}=e,c=o.readdirSync(n,{withFileTypes:!0});for(let l of c){if(!l.isDirectory()||C_.includes(l.name))continue;let c=s.join(n,l.name),u=s.join(c,S_);if(o.existsSync(u)&&o.statSync(u).isFile()){let n=await this.readChildMemoryPrompt(e,t,c,r,a);n!=null&&i.push(n)}await this.scanDirectoryRecursive(e,t,c,r,i,a)}}async readChildMemoryPrompt(n,r,i,a,o){let{fs:s,path:c,logger:l}=n,u=c.join(i,S_);try{let n=s.readFileSync(u,`utf8`),d=_d(n),f;try{f=await Lf(n,{globalScope:o,basePath:i})}catch(e){throw e instanceof bd&&(l.error(`MDX compilation failed in ${u}: ${e.message}`),l.error(`Please check your configuration file (~/.aindex/.tnmsc.json) and ensure all required variables are defined.`),t.default.exit(1)),e}let p=c.relative(r,i),m=c.join(a,p),h=c.basename(i);return{type:e.rt.ProjectChildrenMemory,content:f,length:f.length,filePathKind:e.$.Relative,...d.yamlFrontMatter!=null&&{yamlFrontMatter:d.yamlFrontMatter},...d.rawFrontMatter!=null&&{rawFrontMatter:d.rawFrontMatter},markdownAst:d.markdownAst,markdownContents:d.markdownContents,dir:{pathKind:e.$.Relative,path:p,basePath:a,getDirectoryName:()=>h,getAbsolutePath:()=>m},workingChildDirectoryPath:{pathKind:e.$.Relative,path:p,basePath:a,getDirectoryName:()=>h,getAbsolutePath:()=>m}}}catch(e){l.error(`Failed to read child memory prompt at ${u}`,{error:e});return}}};const T_=Object.entries(e.J);var E_=class extends yd{constructor(){super(`ReadmeMdInputPlugin`,[`AindexInputPlugin`])}async collect(e){let{userConfigOptions:t,logger:n,fs:r,path:i,globalScope:a}=e,{workspaceDir:o,aindexDir:s}=this.resolveBasePaths(t),c=this.resolveAindexPath(t.aindex.app.dist,s),l=[];if(!r.existsSync(c)||!r.statSync(c).isDirectory())return n.debug(`aindex projects directory does not exist`,{path:c}),{readmePrompts:l};try{let t=r.readdirSync(c,{withFileTypes:!0});for(let n of t){if(!n.isDirectory())continue;let t=n.name,r=i.join(c,t);await this.collectReadmeFiles(e,r,t,o,``,l,a)}}catch(e){n.error(`failed to scan aindex projects`,{path:c,error:e})}return{readmePrompts:l}}async collectReadmeFiles(n,r,i,a,o,s,c){let{fs:l,path:u,logger:d}=n,f=o===``;for(let[n,{src:p}]of T_){let m=u.join(r,p);if(!(!l.existsSync(m)||!l.statSync(m).isFile()))try{let p=l.readFileSync(m,`utf8`),h;if(c!=null)try{h=await Lf(p,{globalScope:c,basePath:r})}catch(e){throw e instanceof bd&&(d.error(`MDX compilation failed in ${m}: ${e.message}`),d.error(`Please check your configuration file (~/.aindex/.tnmsc.json) and ensure all required variables are defined.`),t.default.exit(1)),e}else h=p;let g=f?i:u.join(i,o),_={pathKind:e.$.Relative,path:g,basePath:a,getDirectoryName:()=>f?i:u.basename(o),getAbsolutePath:()=>u.resolve(a,g)},v={pathKind:e.$.Relative,path:u.dirname(m),basePath:a,getDirectoryName:()=>u.basename(u.dirname(m)),getAbsolutePath:()=>u.dirname(m)};s.push({type:e.rt.Readme,content:h,length:h.length,filePathKind:e.$.Relative,projectName:i,targetDir:_,isRoot:f,fileKind:n,markdownContents:[],dir:v})}catch(e){d.warn(`failed to read readme-family file`,{path:m,fileKind:n,error:e})}}try{let e=l.readdirSync(r,{withFileTypes:!0});for(let t of e)if(t.isDirectory()){let e=f?t.name:u.join(o,t.name),l=u.join(r,t.name);await this.collectReadmeFiles(n,l,i,a,e,s,c)}}catch(e){d.warn(`failed to scan directory`,{path:r,error:e})}}},D_=class extends yd{constructor(){super(`RuleInputPlugin`)}getDistDir(e,t){return this.resolveAindexPath(e.aindex.rules.dist,t.aindexDir)}getSrcDir(e,t){return this.resolveAindexPath(e.aindex.rules.src,t.aindexDir)}async collect(t){let{userConfigOptions:n,logger:r,path:i,fs:a,globalScope:o}=t,s=this.resolveBasePaths(n),c=this.getSrcDir(n,s),l=this.getDistDir(n,s),{prompts:u,errors:d}=await zf(a,i,r,o).readFlatFiles(c,l,{kind:e.rt.Rule,localeExtensions:{zh:`.cn.mdx`,en:`.mdx`},isDirectoryStructure:!1,createPrompt:async(t,n,r)=>{let o=i.join(l,`${r}.mdx`),s=[],c=`project`,u,d,f;try{let{yamlFrontMatter:e,rawFrontMatter:t}=_d(a.readFileSync(o,`utf8`));e&&(d=e,f=t,s=e.globs??[],c=e.scope??`project`,u=e.seriName)}catch{}let p={type:e.rt.Rule,content:t,length:t.length,filePathKind:e.$.Relative,dir:{pathKind:e.$.Relative,path:`${r}.mdx`,basePath:l,getDirectoryName:()=>r.split(`/`).pop()??r,getAbsolutePath:()=>i.join(l,`${r}.mdx`)},series:r.includes(`/`)?r.split(`/`)[0]??``:``,ruleName:r.split(`/`).pop()??r,globs:s,scope:c,markdownContents:[]};return d!=null&&Object.assign(p,{yamlFrontMatter:d}),f!=null&&Object.assign(p,{rawFrontMatter:f}),u!=null&&Object.assign(p,{seriName:u}),p}}),f=[],p=[...u];if(a.existsSync(l))try{let t=a.readdirSync(l,{withFileTypes:!0});for(let n of t){if(!n.isDirectory())continue;let t=n.name,s=i.join(l,t);if(!u.some(e=>e.name.startsWith(`${t}/`)))try{let n=a.readdirSync(s,{withFileTypes:!0});for(let c of n){if(!c.isFile()||!c.name.endsWith(`.mdx`))continue;let n=c.name.slice(0,-4),d=`${t}/${n}`,m=i.join(s,c.name);if(!u.some(e=>e.name===d))try{let r=a.readFileSync(m,`utf8`),i=_d(r),c=o==null?i.contentWithoutFrontMatter??r:await Lf(r,{globalScope:o,basePath:s}),{yamlFrontMatter:u}=i,h=u?.globs??[],g=u?.scope??`project`,_=u?.seriName,v={type:e.rt.Rule,content:c,length:c.length,filePathKind:e.$.Relative,dir:{pathKind:e.$.Relative,path:`${d}.mdx`,basePath:l,getDirectoryName:()=>n,getAbsolutePath:()=>m},series:t,ruleName:n,globs:h,scope:g,markdownContents:[]};u!=null&&Object.assign(v,{yamlFrontMatter:u}),i.rawFrontMatter!=null&&Object.assign(v,{rawFrontMatter:i.rawFrontMatter}),_!=null&&Object.assign(v,{seriName:_}),f.push(v);let y={name:d,type:e.rt.Rule,src:{zh:{content:c,lastModified:a.statSync(m).mtime,prompt:v,filePath:m},default:{content:c,lastModified:a.statSync(m).mtime,prompt:v,filePath:m},defaultLocale:`zh`},dist:{content:c,lastModified:a.statSync(m).mtime,prompt:v,filePath:m},metadata:{hasDist:!0,hasMultipleLocales:!1,isDirectoryStructure:!0},paths:{dist:m}};p.push(y)}catch(e){r.warn(`Failed to process rule from dist`,{path:m,error:e})}}}catch(e){r.warn(`Failed to scan series directory`,{path:s,error:e})}}}catch(e){r.warn(`Failed to scan dist directory`,{path:l,error:e})}for(let e of d)r.warn(`Failed to read rule from src`,{path:e.path,phase:e.phase,error:e.error});let m=new Map;for(let e of p)m.set(e.name,e);return{prompts:{skills:[],commands:[],subAgents:[],rules:p,readme:[]},promptIndex:m,rules:[...u.map(e=>e.src.default.prompt).filter(Boolean),...f]}}};const O_=[e.Q.QODER_IGNORE,e.Q.CURSOR_IGNORE,e.Q.WARP_INDEX_IGNORE,e.Q.AI_IGNORE,e.Q.CODEIUM_IGNORE,`.kiroignore`,`.traeignore`];var k_=class extends yd{constructor(){super(`AIAgentIgnoreInputPlugin`)}collect(e){let{aindexDir:t}=this.resolveBasePaths(e.userConfigOptions),n=[];for(let r of O_){let i=e.path.join(t,r);if(!e.fs.existsSync(i)){this.log.debug({action:`collect`,message:`Ignore file not found`,path:i});continue}let a=e.fs.readFileSync(i,`utf8`);if(a.length===0){this.log.debug({action:`collect`,message:`Ignore file is empty`,path:i});continue}n.push({fileName:r,content:a}),this.log.debug({action:`collect`,message:`Loaded ignore file`,path:i,fileName:r})}return n.length===0?{}:{aiAgentIgnoreConfigFiles:n}}},A_=class extends yd{constructor(){super(`SubAgentInputPlugin`)}getDistDir(e,t){return this.resolveAindexPath(e.aindex.subAgents.dist,t.aindexDir)}createSubAgentPrompt(t,n,r,i,a,o){let{path:s}=o,c=r.replaceAll(`\\`,`/`),l=c.indexOf(`/`),u=l===-1?void 0:c.slice(0,l),d=l===-1?c:c.slice(l+1),f=this.extractPrefixInfo(d,u),p=s.join(a,`${r}.mdx`),m=`${r}.mdx`;return{type:e.rt.SubAgent,content:t,length:t.length,filePathKind:e.$.Relative,dir:{pathKind:e.$.Relative,path:m,basePath:a,getDirectoryName:()=>m.replace(/\.mdx$/,``),getAbsolutePath:()=>p},...f.agentPrefix!=null&&{agentPrefix:f.agentPrefix},agentName:f.agentName}}extractPrefixInfo(e,t){let n=e.replace(/\.mdx$/,``);if(t!=null)return{agentPrefix:t,agentName:n};let r=n.indexOf(`_`);return r===-1?{agentName:n}:{agentPrefix:n.slice(0,Math.max(0,r)),agentName:n.slice(Math.max(0,r+1))}}async collect(t){let{userConfigOptions:n,logger:r,path:i,fs:a,globalScope:o}=t,s=this.resolveBasePaths(n),c=this.resolveAindexPath(n.aindex.subAgents.src,s.aindexDir),l=this.getDistDir(n,s);r.debug(`SubAgentInputPlugin collecting`,{srcDir:c,distDir:l,aindexDir:s.aindexDir});let{prompts:u,errors:d}=await zf(a,i,r,o).readFlatFiles(c,l,{kind:e.rt.SubAgent,localeExtensions:{zh:`.md`,en:`.mdx`},isDirectoryStructure:!1,createPrompt:async(e,n,r)=>this.createSubAgentPrompt(e,n,r,c,l,t)});r.debug(`SubAgentInputPlugin read complete`,{subAgentCount:u.length,errorCount:d.length});for(let e of d)r.warn(`Failed to read subAgent`,{path:e.path,phase:e.phase,error:e.error});let f=[];for(let e of u){let t=e.dist?.prompt??e.src.default.prompt;t&&f.push(t)}r.debug(`SubAgentInputPlugin legacy subAgents`,{count:f.length,agents:f.map(e=>e.agentName)});let p=new Map;for(let e of u)p.set(e.name,e);return{prompts:{skills:[],commands:[],subAgents:u,rules:[],readme:[]},promptIndex:p,subAgents:f}}};function j_(t,n,r,i,a){let o=a.join(r,n);if(!(i.existsSync(o)&&i.statSync(o).isFile()))return;let s=i.readFileSync(o,`utf8`);return{type:t,content:s,length:s.length,filePathKind:e.$.Absolute,dir:{pathKind:e.$.Absolute,path:o,getDirectoryName:()=>a.basename(o)}}}var M_=class extends yd{constructor(){super(`VSCodeConfigInputPlugin`)}collect(t){let{userConfigOptions:n,fs:r,path:i}=t,{aindexDir:a}=this.resolveBasePaths(n),o=[`.vscode/settings.json`,`.vscode/extensions.json`],s=[];for(let t of o){let n=j_(e.tt.VSCode,t,a,r,i);n!=null&&s.push(n)}return{vscodeConfigFiles:s}}},N_=class extends yd{constructor(){super(`WorkspaceInputPlugin`)}collect(t){let{userConfigOptions:n}=t,{workspaceDir:i,aindexDir:a}=this.resolveBasePaths(n);return{workspace:{directory:{pathKind:e.$.Absolute,path:i,getDirectoryName:()=>r.basename(i)},projects:[]},aindexDir:a}}};const P_=`GLOBAL.md`,F_=`user_rules`;var I_=class extends Am{constructor(){super(`TraeCNIDEOutputPlugin`,{globalConfigDir:`.trae-cn`,outputFileName:P_,dependsOn:[`TraeIDEOutputPlugin`]})}getGlobalUserRulesDir(){return this.joinPath(this.getGlobalConfigDir(),F_)}async registerProjectOutputDirs(){return[]}async registerProjectOutputFiles(){return[]}async registerGlobalOutputDirs(){return[this.createRelativePath(F_,this.getGlobalConfigDir(),()=>F_)]}async registerGlobalOutputFiles(e){let{globalMemory:t}=e.collectedInputContext,n=[];return t!=null&&n.push(this.createRelativePath(P_,this.getGlobalUserRulesDir(),()=>F_)),n}async canWrite(e){let{globalMemory:t}=e.collectedInputContext;return t==null?(this.log.trace({action:`skip`,reason:`noGlobalMemory`}),!1):!0}async writeProjectOutputs(){return{files:[],dirs:[]}}async writeGlobalOutputs(e){let{globalMemory:t}=e.collectedInputContext,n=[],r=this.getGlobalUserRulesDir();return t!=null&&n.push(await this.writeFile(e,this.joinPath(r,P_),t.content,`globalMemory`)),{files:n,dirs:[]}}},L_=Ug({plugins:[new fh,new mh,new Kh,new zh,new Th,new Oh,new uh,new Qh,new lg,new yg,new I_,new wg,new Ng,new wh,new kh,new Hh,new Dh,new Sg,new dg,new Kg,new Gg,new Wg,new N_,new p_,new M_,new x_,new g_,new f_,new m_,new A_,new D_,new y_,new w_,new E_,new v_,new __,new k_]});const R_={USER_HOME:`~`,WORKSPACE:`$WORKSPACE`},z_={};async function B_(){let e=await L_;await new km(...t.default.argv).run(e)}B_().catch(n=>{e.st(`main`,`error`).error(`unhandled error`,{error:n instanceof Error?n.message:String(n)}),t.default.exit(1)}),exports.ConfigLoader=e.x,exports.DEFAULT_CONFIG_FILE_NAME=e.S,exports.DEFAULT_GLOBAL_CONFIG_DIR=e.C,exports.DEFAULT_USER_CONFIG=z_,exports.PathPlaceholders=R_,exports.checkVersionControl=Pg,exports.default=L_,exports.defineConfig=Ug,exports.generateAindex=Fg,exports.getConfigLoader=e.w,exports.getDefaultUserConfig=e.T,exports.getGlobalConfigPath=e.E,exports.loadUserConfig=e.D,exports.mergeConfig=Rg,exports.validateAndEnsureGlobalConfig=e.O,exports.validateGlobalConfig=e.k;
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./plugin.config-DExOPs9m.cjs`);let t=require(`node:process`);t=e.y(t);async function n(){let n=new e.s(...t.default.argv),{default:r}=await Promise.resolve().then(()=>require(`./plugin.config-DExOPs9m.cjs`)).then(e=>e.n),i=await r;(await n.run(i)).success||t.default.exit(1)}function r(e){return e.some(e=>e===`--json`||e===`-j`||/^-[^-]*j/.test(e))}function i(e){t.default.stdout.write(`${JSON.stringify({success:!1,filesAffected:0,dirsAffected:0,message:e,pluginResults:[],errors:[e]})}\n`)}n().catch(n=>{let a=n instanceof Error?n.message:String(n);r(t.default.argv)&&(i(a),t.default.exit(1)),e.v(`main`,`error`).error(`unhandled error`,{error:a}),t.default.exit(1)}),exports.ConfigLoader=e.c,exports.DEFAULT_CONFIG_FILE_NAME=e.l,exports.DEFAULT_GLOBAL_CONFIG_DIR=e.u,exports.DEFAULT_USER_CONFIG=e.g,exports.PathPlaceholders=e._,exports.checkVersionControl=e.a,exports.default=e.t,exports.defineConfig=e.r,exports.ensureConfigLink=e.d,exports.generateAindex=e.o,exports.getConfigLoader=e.f,exports.getGlobalConfigPath=e.p,exports.loadUserConfig=e.m,exports.mergeConfig=e.i,exports.validateGlobalConfig=e.h;
|