mdat 1.0.0 → 1.0.2

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/bin/cli.js CHANGED
@@ -1,18 +1,14 @@
1
1
  #!/usr/bin/env node
2
- var $C=Object.create;var ec=Object.defineProperty;var qC=Object.getOwnPropertyDescriptor;var VC=Object.getOwnPropertyNames;var GC=Object.getPrototypeOf,WC=Object.prototype.hasOwnProperty;var Tr=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var tc=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),HC=(t,e)=>{for(var r in e)ec(t,r,{get:e[r],enumerable:!0})},KC=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of VC(e))!WC.call(t,i)&&i!==r&&ec(t,i,{get:()=>e[i],enumerable:!(n=qC(e,i))||n.enumerable});return t};var jd=(t,e,r)=>(r=t!=null?$C(GC(t)):{},KC(e||!t||!t.__esModule?ec(r,"default",{value:t,enumerable:!0}):r,t));var rm=tc((Vj,hk)=>{hk.exports={addendum:"addenda",aircraft:"aircraft",alga:"algae",alumna:"alumnae",alumnus:"alumni",alveolus:"alveoli",amoeba:"amoebae",analysis:"analyses",antenna:"antennae",antithesis:"antitheses",apex:"apices",appendix:"appendices",automaton:"automata",axis:"axes",bacillus:"bacilli",bacterium:"bacteria",baculum:"bacula",barracks:"barracks",basis:"bases",beau:"beaux",bison:"bison",buffalo:"buffalo",bureau:"bureaus",cactus:"cacti",calf:"calves",carcinoma:"carcinomata",carp:"carp",census:"censuses",chassis:"chassis",cherub:"cherubim",child:"children",ch\u00E2teau:"ch\xE2teaus",cloaca:"cloacae",cod:"cod",codex:"codices",concerto:"concerti",consortium:"consortia",corpus:"corpora",crisis:"crises",criterion:"criteria",curriculum:"curricula",cystoma:"cystomata",datum:"data",deer:"deer",diagnosis:"diagnoses",die:"dice",dwarf:"dwarfs",echo:"echoes",elf:"elves",elk:"elk",ellipsis:"ellipses",embargo:"embargoes",emphasis:"emphases",erratum:"errata","faux pas":"faux pas",fez:"fezes",firmware:"firmware",fish:"fish",focus:"foci",foot:"feet",formula:"formulae",fungus:"fungi",gallows:"gallows",genus:"genera",glomerulus:"glomeruli",goose:"geese",graffito:"graffiti",grouse:"grouse",half:"halves",hamulus:"hamuli",hero:"heroes",hippopotamus:"hippopotami",hoof:"hooves",hovercraft:"hovercraft",hypothesis:"hypotheses",iliac:"ilia",incubus:"incubi",index:"indices",interstitium:"interstitia",kakapo:"kakapo",knife:"knives",larva:"larvae",leaf:"leaves",libretto:"libretti",life:"lives",loaf:"loaves",loculus:"loculi",locus:"loci",louse:"lice",man:"men",matrix:"matrices",means:"means",measles:"measles",media:"media",medium:"media",memorandum:"memoranda",millennium:"millennia",minutia:"minutiae",moose:"moose",mouse:"mice",nebula:"nebulae",nemesis:"nemeses",neurosis:"neuroses",news:"news",nucleolus:"nucleoli",nucleus:"nuclei",oasis:"oases",occiput:"occipita",offspring:"offspring",omphalos:"omphaloi",opus:"opera",ovum:"ova",ox:"oxen",paralysis:"paralyses",parenthesis:"parentheses",person:"people",phenomenon:"phenomena",phylum:"phyla",pike:"pike",polyhedron:"polyhedra",potato:"potatoes",primus:"primi",prognosis:"prognoses",quiz:"quizzes",radius:"radii",referendum:"referenda",salmon:"salmon",scarf:"scarves",scrotum:"scrota",self:"selves",seminoma:"seminomata",series:"series",sheep:"sheep",shelf:"shelves",shrimp:"shrimp",simulacrum:"simulacra",soliloquy:"soliloquies",spacecraft:"spacecraft",species:"species",spectrum:"spectra",squid:"squid",stimulus:"stimuli",stratum:"strata",swine:"swine",syconium:"syconia",syllabus:"syllabi",symposium:"symposia",synopsis:"synopses",synthesis:"syntheses",tableau:"tableaus",testis:"testes",that:"those",thesis:"theses",thief:"thieves",this:"these",thrombus:"thrombi",tomato:"tomatoes",tooth:"teeth",torus:"tori",trout:"trout",tuna:"tuna",umbilicus:"umbilici",uterus:"uteri",vertebra:"vertebrae",vertex:"vertices",veto:"vetoes",vita:"vitae",vortex:"vortices",watercraft:"watercraft",wharf:"wharves",wife:"wives",wolf:"wolves",woman:"women"}});var im=tc((Gj,nm)=>{"use strict";var mk=rm();nm.exports=new Map(Object.entries(mk))});var Vg=tc((P3,qg)=>{"use strict";var uu=Object.prototype.hasOwnProperty,$g=Object.prototype.toString,Lg=Object.defineProperty,Mg=Object.getOwnPropertyDescriptor,Bg=function(e){return typeof Array.isArray=="function"?Array.isArray(e):$g.call(e)==="[object Array]"},jg=function(e){if(!e||$g.call(e)!=="[object Object]")return!1;var r=uu.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&uu.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||uu.call(e,i)},Ug=function(e,r){Lg&&r.name==="__proto__"?Lg(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},zg=function(e,r){if(r==="__proto__")if(uu.call(e,r)){if(Mg)return Mg(e,r).value}else return;return e[r]};qg.exports=function t(){var e,r,n,i,o,s,a=arguments[0],u=1,l=arguments.length,c=!1;for(typeof a=="boolean"&&(c=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});u<l;++u)if(e=arguments[u],e!=null)for(r in e)n=zg(a,r),i=zg(e,r),a!==i&&(c&&i&&(jg(i)||(o=Bg(i)))?(o?(o=!1,s=n&&Bg(n)?n:[]):s=n&&jg(n)?n:{},Ug(a,{name:r,newValue:t(c,s,i)})):typeof i<"u"&&Ug(a,{name:r,newValue:i}));return a}});var Ud=(t=0)=>e=>`\x1B[${e+t}m`,zd=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,$d=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,We={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},bM=Object.keys(We.modifier),YC=Object.keys(We.color),ZC=Object.keys(We.bgColor),EM=[...YC,...ZC];function XC(){let t=new Map;for(let[e,r]of Object.entries(We)){for(let[n,i]of Object.entries(r))We[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=We[n],t.set(i[0],i[1]);Object.defineProperty(We,e,{value:r,enumerable:!1})}return Object.defineProperty(We,"codes",{value:t,enumerable:!1}),We.color.close="\x1B[39m",We.bgColor.close="\x1B[49m",We.color.ansi=Ud(),We.color.ansi256=zd(),We.color.ansi16m=$d(),We.bgColor.ansi=Ud(10),We.bgColor.ansi256=zd(10),We.bgColor.ansi16m=$d(10),Object.defineProperties(We,{rgbToAnsi256:{value(e,r,n){return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(o=>o+o).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>We.rgbToAnsi256(...We.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let o=Math.max(r,n,i)*2;if(o===0)return 30;let s=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>We.ansi256ToAnsi(We.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>We.ansi256ToAnsi(We.hexToAnsi256(e)),enumerable:!1}}),We}var JC=XC(),yr=JC;import rc from"node:process";import QC from"node:os";import qd from"node:tty";function or(t,e=globalThis.Deno?globalThis.Deno.args:rc.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}var{env:et}=rc,pa;or("no-color")||or("no-colors")||or("color=false")||or("color=never")?pa=0:(or("color")||or("colors")||or("color=true")||or("color=always"))&&(pa=1);function ew(){if("FORCE_COLOR"in et)return et.FORCE_COLOR==="true"?1:et.FORCE_COLOR==="false"?0:et.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(et.FORCE_COLOR,10),3)}function tw(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function rw(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let n=ew();n!==void 0&&(pa=n);let i=r?pa:n;if(i===0)return 0;if(r){if(or("color=16m")||or("color=full")||or("color=truecolor"))return 3;if(or("color=256"))return 2}if("TF_BUILD"in et&&"AGENT_NAME"in et)return 1;if(t&&!e&&i===void 0)return 0;let o=i||0;if(et.TERM==="dumb")return o;if(rc.platform==="win32"){let s=QC.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in et)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in et)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in et)||et.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in et)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(et.TEAMCITY_VERSION)?1:0;if(et.COLORTERM==="truecolor"||et.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in et){let s=Number.parseInt((et.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(et.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(et.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(et.TERM)||"COLORTERM"in et?1:o}function Vd(t,e={}){let r=rw(t,{streamIsTTY:t&&t.isTTY,...e});return tw(r)}var nw={stdout:Vd({isTTY:qd.isatty(1)}),stderr:Vd({isTTY:qd.isatty(2)})},Gd=nw;function Wd(t,e,r){let n=t.indexOf(e);if(n===-1)return t;let i=e.length,o=0,s="";do s+=t.slice(o,n)+e+r,o=n+i,n=t.indexOf(e,o);while(n!==-1);return s+=t.slice(o),s}function Hd(t,e,r,n){let i=0,o="";do{let s=t[n-1]==="\r";o+=t.slice(i,s?n-1:n)+e+(s?`\r
3
- `:`
4
- `)+r,i=n+1,n=t.indexOf(`
5
- `,i)}while(n!==-1);return o+=t.slice(i),o}var{stdout:Kd,stderr:Yd}=Gd,nc=Symbol("GENERATOR"),Wi=Symbol("STYLER"),ss=Symbol("IS_EMPTY"),Zd=["ansi","ansi","ansi256","ansi16m"],Hi=Object.create(null),iw=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=Kd?Kd.level:0;t.level=e.level===void 0?r:e.level};var ow=t=>{let e=(...r)=>r.join(" ");return iw(e,t),Object.setPrototypeOf(e,as.prototype),e};function as(t){return ow(t)}Object.setPrototypeOf(as.prototype,Function.prototype);for(let[t,e]of Object.entries(yr))Hi[t]={get(){let r=da(this,oc(e.open,e.close,this[Wi]),this[ss]);return Object.defineProperty(this,t,{value:r}),r}};Hi.visible={get(){let t=da(this,this[Wi],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var ic=(t,e,r,...n)=>t==="rgb"?e==="ansi16m"?yr[r].ansi16m(...n):e==="ansi256"?yr[r].ansi256(yr.rgbToAnsi256(...n)):yr[r].ansi(yr.rgbToAnsi(...n)):t==="hex"?ic("rgb",e,r,...yr.hexToRgb(...n)):yr[r][t](...n),sw=["rgb","hex","ansi256"];for(let t of sw){Hi[t]={get(){let{level:r}=this;return function(...n){let i=oc(ic(t,Zd[r],"color",...n),yr.color.close,this[Wi]);return da(this,i,this[ss])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);Hi[e]={get(){let{level:r}=this;return function(...n){let i=oc(ic(t,Zd[r],"bgColor",...n),yr.bgColor.close,this[Wi]);return da(this,i,this[ss])}}}}var aw=Object.defineProperties(()=>{},{...Hi,level:{enumerable:!0,get(){return this[nc].level},set(t){this[nc].level=t}}}),oc=(t,e,r)=>{let n,i;return r===void 0?(n=t,i=e):(n=r.openAll+t,i=e+r.closeAll),{open:t,close:e,openAll:n,closeAll:i,parent:r}},da=(t,e,r)=>{let n=(...i)=>uw(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,aw),n[nc]=t,n[Wi]=e,n[ss]=r,n},uw=(t,e)=>{if(t.level<=0||!e)return t[ss]?"":e;let r=t[Wi];if(r===void 0)return e;let{openAll:n,closeAll:i}=r;if(e.includes("\x1B"))for(;r!==void 0;)e=Wd(e,r.close,r.open),r=r.parent;let o=e.indexOf(`
6
- `);return o!==-1&&(e=Hd(e,i,n,o)),n+e+i};Object.defineProperties(as.prototype,Hi);var lw=as(),OM=as({level:Yd?Yd.level:0});var St=lw;var Xd=t=>Number.isFinite(t)?t:0;function cw(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(Xd(t*1e3)%1e3),nanoseconds:Math.trunc(Xd(t*1e6)%1e3)}}function fw(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function sc(t){switch(typeof t){case"number":{if(Number.isFinite(t))return cw(t);break}case"bigint":return fw(t)}throw new TypeError("Expected a finite number or bigint")}var pw=t=>t===0||t===0n,dw=(t,e)=>e===1||e===1n?t:`${t}s`,hw=1e-7,mw=24n*60n*60n*1000n;function Kr(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],o=(c,f)=>{let p=Math.floor(c*10**f+hw);return(Math.round(p)/10**f).toFixed(f)},s=(c,f,p,d)=>{if(!((i.length===0||!e.colonNotation)&&pw(c)&&!(e.colonNotation&&p==="m"))){if(d??=String(c),e.colonNotation){let m=d.includes(".")?d.split(".")[0].length:d.length,y=i.length>0?2:1;d="0".repeat(Math.max(0,y-m))+d}else d+=e.verbose?" "+dw(f,c):p;i.push(d)}},a=sc(t),u=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(u)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(u,"day","d"):(s(u/365n,"year","y"),s(u%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3){let c=Number(a.seconds),f=Number(a.milliseconds),p=Number(a.microseconds),d=Number(a.nanoseconds);if(s(c,"second","s"),e.formatSubMilliseconds)s(f,"millisecond","ms"),s(p,"microsecond","\xB5s"),s(d,"nanosecond","ns");else{let m=f+p/1e3+d/1e6,y=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=m>=1?Math.round(m):Math.ceil(m),b=y?m.toFixed(y):g;s(Number.parseFloat(b),"millisecond","ms",b)}}else{let c=(r?Number(t%mw):t)/1e3%60,f=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,p=o(c,f),d=e.keepDecimalsOnWholeSeconds?p:p.replace(/\.0+$/,"");s(Number.parseFloat(d),"second","s",d)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(l)}import{getMdatReports as xM,log as gt,reporterMdat as ts}from"remark-mdat";import Jd from"node:fs";import Qd from"node:path";import{VFile as gw}from"vfile";function ac(t,e,r){let n=uc(t);if(!r&&typeof e=="function"&&(r=e,e=void 0),!r)return new Promise(o);o(i,r);function i(s){r(void 0,s)}function o(s,a){let u;try{u=Qd.resolve(n.cwd,n.path)}catch(c){return a(c)}Jd.readFile(u,e,l);function l(c,f){c?a(c):(n.value=f,s(n))}}}function uc(t){return typeof t=="string"||t instanceof URL?t={path:t}:yw(t)&&(t={path:new TextDecoder().decode(t)}),xw(t)?t:new gw(t)}function pn(t,e,r){let n=uc(t);if(!r&&typeof e=="function"&&(r=e,e=void 0),!r)return new Promise(o);o(i,r);function i(s){r(void 0,s)}function o(s,a){let u;try{u=Qd.resolve(n.cwd,n.path)}catch(c){return a(c)}Jd.writeFile(u,n.value||"",e||void 0,l);function l(c){c?a(c):s(n)}}}function xw(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function yw(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}import{notStrictEqual as qw,strictEqual as Vw}from"assert";var bw={right:kw,center:Tw},Ew=0,ha=1,Aw=2,ma=3,lc=class{constructor(e){var r;this.width=e.width,this.wrap=(r=e.wrap)!==null&&r!==void 0?r:!0,this.rows=[]}span(...e){let r=this.div(...e);r.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let r=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(r),r}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let r=e.split(`
7
- `).map(i=>i.split(" ")),n=0;return r.forEach(i=>{i.length>1&&Zt.stringWidth(i[0])>n&&(n=Math.min(Math.floor(this.width*.5),Zt.stringWidth(i[0])))}),r.forEach(i=>{this.div(...i.map((o,s)=>({text:o.trim(),padding:this.measurePadding(o),width:s===0&&i.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let r=Zt.stripAnsi(e);return[0,r.match(/\s*$/)[0].length,0,r.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(r=>{this.rowToString(r,e)}),e.filter(r=>!r.hidden).map(r=>r.text).join(`
8
- `)}rowToString(e,r){return this.rasterize(e).forEach((n,i)=>{let o="";n.forEach((s,a)=>{let{width:u}=e[a],l=this.negatePadding(e[a]),c=s;if(l>Zt.stringWidth(s)&&(c+=" ".repeat(l-Zt.stringWidth(s))),e[a].align&&e[a].align!=="left"&&this.wrap){let p=bw[e[a].align];c=p(c,l),Zt.stringWidth(c)<l&&(c+=" ".repeat((u||0)-Zt.stringWidth(c)-1))}let f=e[a].padding||[0,0,0,0];f[ma]&&(o+=" ".repeat(f[ma])),o+=eh(e[a],c,"| "),o+=c,o+=eh(e[a],c," |"),f[ha]&&(o+=" ".repeat(f[ha])),i===0&&r.length>0&&(o=this.renderInline(o,r[r.length-1]))}),r.push({text:o.replace(/ +$/,""),span:e.span})}),r}renderInline(e,r){let n=e.match(/^ */),i=n?n[0].length:0,o=r.text,s=Zt.stringWidth(o.trimRight());return r.span?this.wrap?i<s?e:(r.hidden=!0,o.trimRight()+" ".repeat(i-s)+e.trimLeft()):(r.hidden=!0,o+e):e}rasterize(e){let r=[],n=this.columnWidths(e),i;return e.forEach((o,s)=>{o.width=n[s],this.wrap?i=Zt.wrap(o.text,this.negatePadding(o),{hard:!0}).split(`
2
+ var _w=Object.create;var Xl=Object.defineProperty;var Sw=Object.getOwnPropertyDescriptor;var vw=Object.getOwnPropertyNames;var Iw=Object.getPrototypeOf,Ow=Object.prototype.hasOwnProperty;var Er=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var sa=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Dw=(t,e)=>{for(var r in e)Xl(t,r,{get:e[r],enumerable:!0})},Rw=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of vw(e))!Ow.call(t,i)&&i!==r&&Xl(t,i,{get:()=>e[i],enumerable:!(n=Sw(e,i))||n.enumerable});return t};var ts=(t,e,r)=>(r=t!=null?_w(Iw(t)):{},Rw(e||!t||!t.__esModule?Xl(r,"default",{value:t,enumerable:!0}):r,t));var la=sa((HL,Jl)=>{"use strict";var ua=process||{},Rd=ua.argv||[],aa=ua.env||{},Fw=!(aa.NO_COLOR||Rd.includes("--no-color"))&&(!!aa.FORCE_COLOR||Rd.includes("--color")||ua.platform==="win32"||(ua.stdout||{}).isTTY&&aa.TERM!=="dumb"||!!aa.CI),Nw=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+Pw(i,e,r,o)+e:t+i+e},Pw=(t,e,r,n)=>{let i="",o=0;do i+=t.substring(o,n)+r,o=n+e.length,n=t.indexOf(e,o);while(~n);return i+t.substring(o)},Fd=(t=Fw)=>{let e=t?Nw:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};Jl.exports=Fd();Jl.exports.createColors=Fd});var jh=sa((sj,UC)=>{UC.exports={addendum:"addenda",aircraft:"aircraft",alga:"algae",alumna:"alumnae",alumnus:"alumni",alveolus:"alveoli",amoeba:"amoebae",analysis:"analyses",antenna:"antennae",antithesis:"antitheses",apex:"apices",appendix:"appendices",automaton:"automata",axis:"axes",bacillus:"bacilli",bacterium:"bacteria",baculum:"bacula",barracks:"barracks",basis:"bases",beau:"beaux",bison:"bison",buffalo:"buffalo",bureau:"bureaus",cactus:"cacti",calf:"calves",carcinoma:"carcinomata",carp:"carp",census:"censuses",chassis:"chassis",cherub:"cherubim",child:"children",ch\u00E2teau:"ch\xE2teaus",cloaca:"cloacae",cod:"cod",codex:"codices",concerto:"concerti",consortium:"consortia",corpus:"corpora",crisis:"crises",criterion:"criteria",curriculum:"curricula",cystoma:"cystomata",datum:"data",deer:"deer",diagnosis:"diagnoses",die:"dice",dwarf:"dwarfs",echo:"echoes",elf:"elves",elk:"elk",ellipsis:"ellipses",embargo:"embargoes",emphasis:"emphases",erratum:"errata","faux pas":"faux pas",fez:"fezes",firmware:"firmware",fish:"fish",focus:"foci",foot:"feet",formula:"formulae",fungus:"fungi",gallows:"gallows",genus:"genera",glomerulus:"glomeruli",goose:"geese",graffito:"graffiti",grouse:"grouse",half:"halves",hamulus:"hamuli",hero:"heroes",hippopotamus:"hippopotami",hoof:"hooves",hovercraft:"hovercraft",hypothesis:"hypotheses",iliac:"ilia",incubus:"incubi",index:"indices",interstitium:"interstitia",kakapo:"kakapo",knife:"knives",larva:"larvae",leaf:"leaves",libretto:"libretti",life:"lives",loaf:"loaves",loculus:"loculi",locus:"loci",louse:"lice",man:"men",matrix:"matrices",means:"means",measles:"measles",media:"media",medium:"media",memorandum:"memoranda",millennium:"millennia",minutia:"minutiae",moose:"moose",mouse:"mice",nebula:"nebulae",nemesis:"nemeses",neurosis:"neuroses",news:"news",nucleolus:"nucleoli",nucleus:"nuclei",oasis:"oases",occiput:"occipita",offspring:"offspring",omphalos:"omphaloi",opus:"opera",ovum:"ova",ox:"oxen",paralysis:"paralyses",parenthesis:"parentheses",person:"people",phenomenon:"phenomena",phylum:"phyla",pike:"pike",polyhedron:"polyhedra",potato:"potatoes",primus:"primi",prognosis:"prognoses",quiz:"quizzes",radius:"radii",referendum:"referenda",salmon:"salmon",scarf:"scarves",scrotum:"scrota",self:"selves",seminoma:"seminomata",series:"series",sheep:"sheep",shelf:"shelves",shrimp:"shrimp",simulacrum:"simulacra",soliloquy:"soliloquies",spacecraft:"spacecraft",species:"species",spectrum:"spectra",squid:"squid",stimulus:"stimuli",stratum:"strata",swine:"swine",syconium:"syconia",syllabus:"syllabi",symposium:"symposia",synopsis:"synopses",synthesis:"syntheses",tableau:"tableaus",testis:"testes",that:"those",thesis:"theses",thief:"thieves",this:"these",thrombus:"thrombi",tomato:"tomatoes",tooth:"teeth",torus:"tori",trout:"trout",tuna:"tuna",umbilicus:"umbilici",uterus:"uteri",vertebra:"vertebrae",vertex:"vertices",veto:"vetoes",vita:"vitae",vortex:"vortices",watercraft:"watercraft",wharf:"wharves",wife:"wives",wolf:"wolves",woman:"women"}});var zh=sa((aj,Uh)=>{"use strict";var zC=jh();Uh.exports=new Map(Object.entries(zC))});var Sg=sa((Z9,_g)=>{"use strict";var ou=Object.prototype.hasOwnProperty,Tg=Object.prototype.toString,bg=Object.defineProperty,Eg=Object.getOwnPropertyDescriptor,Ag=function(e){return typeof Array.isArray=="function"?Array.isArray(e):Tg.call(e)==="[object Array]"},wg=function(e){if(!e||Tg.call(e)!=="[object Object]")return!1;var r=ou.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&ou.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||ou.call(e,i)},Cg=function(e,r){bg&&r.name==="__proto__"?bg(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},kg=function(e,r){if(r==="__proto__")if(ou.call(e,r)){if(Eg)return Eg(e,r).value}else return;return e[r]};_g.exports=function t(){var e,r,n,i,o,s,a=arguments[0],u=1,l=arguments.length,c=!1;for(typeof a=="boolean"&&(c=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});u<l;++u)if(e=arguments[u],e!=null)for(r in e)n=kg(a,r),i=kg(e,r),a!==i&&(c&&i&&(wg(i)||(o=Ag(i)))?(o?(o=!1,s=n&&Ag(n)?n:[]):s=n&&wg(n)?n:{},Cg(a,{name:r,newValue:t(c,s,i)})):typeof i<"u"&&Cg(a,{name:r,newValue:i}));return a}});var Jo=ts(la(),1);var Nd=t=>Number.isFinite(t)?t:0;function Lw(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(Nd(t*1e3)%1e3),nanoseconds:Math.trunc(Nd(t*1e6)%1e3)}}function Mw(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function Ql(t){switch(typeof t){case"number":{if(Number.isFinite(t))return Lw(t);break}case"bigint":return Mw(t)}throw new TypeError("Expected a finite number or bigint")}var Bw=t=>t===0||t===0n,jw=(t,e)=>e===1||e===1n?t:`${t}s`,Uw=1e-7,zw=24n*60n*60n*1000n;function Vr(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],o=(c,f)=>{let p=Math.floor(c*10**f+Uw);return(Math.round(p)/10**f).toFixed(f)},s=(c,f,p,d)=>{if(!((i.length===0||!e.colonNotation)&&Bw(c)&&!(e.colonNotation&&p==="m"))){if(d??=String(c),e.colonNotation){let m=d.includes(".")?d.split(".")[0].length:d.length,y=i.length>0?2:1;d="0".repeat(Math.max(0,y-m))+d}else d+=e.verbose?" "+jw(f,c):p;i.push(d)}},a=Ql(t),u=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(u)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(u,"day","d"):(s(u/365n,"year","y"),s(u%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3){let c=Number(a.seconds),f=Number(a.milliseconds),p=Number(a.microseconds),d=Number(a.nanoseconds);if(s(c,"second","s"),e.formatSubMilliseconds)s(f,"millisecond","ms"),s(p,"microsecond","\xB5s"),s(d,"nanosecond","ns");else{let m=f+p/1e3+d/1e6,y=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=m>=1?Math.round(m):Math.ceil(m),b=y?m.toFixed(y):g;s(Number.parseFloat(b),"millisecond","ms",b)}}else{let c=(r?Number(t%zw):t)/1e3%60,f=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,p=o(c,f),d=e.keepDecimalsOnWholeSeconds?p:p.replace(/\.0+$/,"");s(Number.parseFloat(d),"second","s",d)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(l)}import{getMdatReports as GL,log as ht,reporterMdat as Yo}from"remark-mdat";import Pd from"node:fs";import Ld from"node:path";import{VFile as $w}from"vfile";function ec(t,e,r){let n=tc(t);if(!r&&typeof e=="function"&&(r=e,e=void 0),!r)return new Promise(o);o(i,r);function i(s){r(void 0,s)}function o(s,a){let u;try{u=Ld.resolve(n.cwd,n.path)}catch(c){return a(c)}Pd.readFile(u,e,l);function l(c,f){c?a(c):(n.value=f,s(n))}}}function tc(t){return typeof t=="string"||t instanceof URL?t={path:t}:Vw(t)&&(t={path:new TextDecoder().decode(t)}),qw(t)?t:new $w(t)}function un(t,e,r){let n=tc(t);if(!r&&typeof e=="function"&&(r=e,e=void 0),!r)return new Promise(o);o(i,r);function i(s){r(void 0,s)}function o(s,a){let u;try{u=Ld.resolve(n.cwd,n.path)}catch(c){return a(c)}Pd.writeFile(u,n.value||"",e||void 0,l);function l(c){c?a(c):s(n)}}}function qw(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function Vw(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}import{notStrictEqual as mC,strictEqual as gC}from"assert";var Gw={right:Zw,center:Xw},Ww=0,ca=1,Hw=2,fa=3,rc=class{constructor(e){var r;this.width=e.width,this.wrap=(r=e.wrap)!==null&&r!==void 0?r:!0,this.rows=[]}span(...e){let r=this.div(...e);r.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let r=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(r),r}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let r=e.split(`
3
+ `).map(i=>i.split(" ")),n=0;return r.forEach(i=>{i.length>1&&Ht.stringWidth(i[0])>n&&(n=Math.min(Math.floor(this.width*.5),Ht.stringWidth(i[0])))}),r.forEach(i=>{this.div(...i.map((o,s)=>({text:o.trim(),padding:this.measurePadding(o),width:s===0&&i.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let r=Ht.stripAnsi(e);return[0,r.match(/\s*$/)[0].length,0,r.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(r=>{this.rowToString(r,e)}),e.filter(r=>!r.hidden).map(r=>r.text).join(`
4
+ `)}rowToString(e,r){return this.rasterize(e).forEach((n,i)=>{let o="";n.forEach((s,a)=>{let{width:u}=e[a],l=this.negatePadding(e[a]),c=s;if(l>Ht.stringWidth(s)&&(c+=" ".repeat(l-Ht.stringWidth(s))),e[a].align&&e[a].align!=="left"&&this.wrap){let p=Gw[e[a].align];c=p(c,l),Ht.stringWidth(c)<l&&(c+=" ".repeat((u||0)-Ht.stringWidth(c)-1))}let f=e[a].padding||[0,0,0,0];f[fa]&&(o+=" ".repeat(f[fa])),o+=Md(e[a],c,"| "),o+=c,o+=Md(e[a],c," |"),f[ca]&&(o+=" ".repeat(f[ca])),i===0&&r.length>0&&(o=this.renderInline(o,r[r.length-1]))}),r.push({text:o.replace(/ +$/,""),span:e.span})}),r}renderInline(e,r){let n=e.match(/^ */),i=n?n[0].length:0,o=r.text,s=Ht.stringWidth(o.trimRight());return r.span?this.wrap?i<s?e:(r.hidden=!0,o.trimRight()+" ".repeat(i-s)+e.trimLeft()):(r.hidden=!0,o+e):e}rasterize(e){let r=[],n=this.columnWidths(e),i;return e.forEach((o,s)=>{o.width=n[s],this.wrap?i=Ht.wrap(o.text,this.negatePadding(o),{hard:!0}).split(`
9
5
  `):i=o.text.split(`
10
- `),o.border&&(i.unshift("."+"-".repeat(this.negatePadding(o)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(o)+2)+"'")),o.padding&&(i.unshift(...new Array(o.padding[Ew]||0).fill("")),i.push(...new Array(o.padding[Aw]||0).fill(""))),i.forEach((a,u)=>{r[u]||r.push([]);let l=r[u];for(let c=0;c<s;c++)l[c]===void 0&&l.push("");l.push(a)})}),r}negatePadding(e){let r=e.width||0;return e.padding&&(r-=(e.padding[ma]||0)+(e.padding[ha]||0)),e.border&&(r-=4),r}columnWidths(e){if(!this.wrap)return e.map(s=>s.width||Zt.stringWidth(s.text));let r=e.length,n=this.width,i=e.map(s=>{if(s.width)return r--,n-=s.width,s.width}),o=r?Math.floor(n/r):0;return i.map((s,a)=>s===void 0?Math.max(o,Cw(e[a])):s)}};function eh(t,e,r){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?r:" ":""}function Cw(t){let e=t.padding||[],r=1+(e[ma]||0)+(e[ha]||0);return t.border?r+4:r}function ww(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function kw(t,e){t=t.trim();let r=Zt.stringWidth(t);return r<e?" ".repeat(e-r)+t:t}function Tw(t,e){t=t.trim();let r=Zt.stringWidth(t);return r>=e?t:" ".repeat(e-r>>1)+t}var Zt;function th(t,e){return Zt=e,new lc({width:t?.width||ww(),wrap:t?.wrap})}var rh=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function cc(t){return t.replace(rh,"")}function nh(t,e){let[r,n]=t.match(rh)||["",""];t=cc(t);let i="";for(let o=0;o<t.length;o++)o!==0&&o%e===0&&(i+=`
11
- `),i+=t.charAt(o);return r&&n&&(i=`${r}${i}${n}`),i}function fc(t){return th(t,{stringWidth:e=>[...e].length,stripAnsi:cc,wrap:nh})}import{dirname as ih,resolve as oh}from"path";import{readdirSync as _w,statSync as Sw}from"fs";function sh(t,e){let r=oh(".",t),n;for(Sw(r).isDirectory()||(r=ih(r));;){if(n=e(r,_w(r)),n)return oh(r,n);if(r=ih(n=r),n===r)break}}import{inspect as Gw}from"util";import{readFileSync as Ww}from"fs";import{fileURLToPath as Hw}from"url";import{format as Ow}from"util";import{normalize as Dw,resolve as Rw}from"path";function Wn(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),t.indexOf("-")===-1&&t.indexOf("_")===-1)return t;{let r="",n=!1,i=t.match(/^-+/);for(let o=i?i[0].length:0;o<t.length;o++){let s=t.charAt(o);n&&(n=!1,s=s.toUpperCase()),o!==0&&(s==="-"||s==="_")?n=!0:s!=="-"&&s!=="_"&&(r+=s)}return r}}function ga(t,e){let r=t.toLowerCase();e=e||"-";let n="";for(let i=0;i<t.length;i++){let o=r.charAt(i),s=t.charAt(i);o!==s&&i>0?n+=`${e}${r.charAt(i)}`:n+=s}return n}function xa(t){return t==null?!1:typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^0[^.]/.test(t)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function ah(t){if(Array.isArray(t))return t.map(s=>typeof s!="string"?s+"":s);t=t.trim();let e=0,r=null,n=null,i=null,o=[];for(let s=0;s<t.length;s++){if(r=n,n=t.charAt(s),n===" "&&!i){r!==" "&&e++;continue}n===i?i=null:(n==="'"||n==='"')&&!i&&(i=n),o[e]||(o[e]=""),o[e]+=n}return o}var sr;(function(t){t.BOOLEAN="boolean",t.STRING="string",t.NUMBER="number",t.ARRAY="array"})(sr||(sr={}));var Yr,ya=class{constructor(e){Yr=e}parse(e,r){let n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},r),i=ah(e),o=typeof e=="string",s=vw(Object.assign(Object.create(null),n.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),u=Object.assign(Object.create(null),n.default),l=n.configObjects||[],c=n.envPrefix,f=a["populate--"],p=f?"--":"_",d=Object.create(null),m=Object.create(null),y=n.__||Yr.format,g={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},b=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,w=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(A){let k=typeof A=="object"?A.key:A,M=Object.keys(A).map(function(I){return{boolean:"bools",string:"strings",number:"numbers"}[I]}).filter(Boolean).pop();M&&(g[M][k]=!0),g.arrays[k]=!0,g.keys.push(k)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(A){g.bools[A]=!0,g.keys.push(A)}),[].concat(n.string||[]).filter(Boolean).forEach(function(A){g.strings[A]=!0,g.keys.push(A)}),[].concat(n.number||[]).filter(Boolean).forEach(function(A){g.numbers[A]=!0,g.keys.push(A)}),[].concat(n.count||[]).filter(Boolean).forEach(function(A){g.counts[A]=!0,g.keys.push(A)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(A){g.normalize[A]=!0,g.keys.push(A)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([A,k])=>{typeof k=="number"&&(g.nargs[A]=k,g.keys.push(A))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([A,k])=>{typeof k=="function"&&(g.coercions[A]=k,g.keys.push(A))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(A){g.configs[A]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([A,k])=>{(typeof k=="boolean"||typeof k=="function")&&(g.configs[A]=k)})),E(n.key,s,n.default,g.arrays),Object.keys(u).forEach(function(A){(g.aliases[A]||[]).forEach(function(k){u[k]=u[A]})});let C=null;qt();let D=[],R=Object.assign(Object.create(null),{_:[]}),S={};for(let A=0;A<i.length;A++){let k=i[A],M=k.replace(/^-{3,}/,"---"),I,T,K,$,te,ft;if(k!=="--"&&/^-/.test(k)&&oe(k))de(k);else if(M.match(/^---+(=|$)/)){de(k);continue}else if(k.match(/^--.+=/)||!a["short-option-groups"]&&k.match(/^-.+=/))$=k.match(/^--?([^=]+)=([\s\S]*)$/),$!==null&&Array.isArray($)&&$.length>=3&&(W($[1],g.arrays)?A=be(A,$[1],i,$[2]):W($[1],g.nargs)!==!1?A=ye(A,$[1],i,$[2]):_($[1],$[2],!0));else if(k.match(w)&&a["boolean-negation"])$=k.match(w),$!==null&&Array.isArray($)&&$.length>=2&&(T=$[1],_(T,W(T,g.arrays)?[!1]:!1));else if(k.match(/^--.+/)||!a["short-option-groups"]&&k.match(/^-[^-]+/))$=k.match(/^--?(.+)/),$!==null&&Array.isArray($)&&$.length>=2&&(T=$[1],W(T,g.arrays)?A=be(A,T,i):W(T,g.nargs)!==!1?A=ye(A,T,i):(te=i[A+1],te!==void 0&&(!te.match(/^-/)||te.match(b))&&!W(T,g.bools)&&!W(T,g.counts)||/^(true|false)$/.test(te)?(_(T,te),A++):_(T,me(T))));else if(k.match(/^-.\..+=/))$=k.match(/^-([^=]+)=([\s\S]*)$/),$!==null&&Array.isArray($)&&$.length>=3&&_($[1],$[2]);else if(k.match(/^-.\..+/)&&!k.match(b))te=i[A+1],$=k.match(/^-(.\..+)/),$!==null&&Array.isArray($)&&$.length>=2&&(T=$[1],te!==void 0&&!te.match(/^-/)&&!W(T,g.bools)&&!W(T,g.counts)?(_(T,te),A++):_(T,me(T)));else if(k.match(/^-[^-]+/)&&!k.match(b)){K=k.slice(1,-1).split(""),I=!1;for(let Tt=0;Tt<K.length;Tt++){if(te=k.slice(Tt+2),K[Tt+1]&&K[Tt+1]==="="){ft=k.slice(Tt+3),T=K[Tt],W(T,g.arrays)?A=be(A,T,i,ft):W(T,g.nargs)!==!1?A=ye(A,T,i,ft):_(T,ft),I=!0;break}if(te==="-"){_(K[Tt],te);continue}if(/[A-Za-z]/.test(K[Tt])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(te)&&W(te,g.bools)===!1){_(K[Tt],te),I=!0;break}if(K[Tt+1]&&K[Tt+1].match(/\W/)){_(K[Tt],te),I=!0;break}else _(K[Tt],me(K[Tt]))}T=k.slice(-1)[0],!I&&T!=="-"&&(W(T,g.arrays)?A=be(A,T,i):W(T,g.nargs)!==!1?A=ye(A,T,i):(te=i[A+1],te!==void 0&&(!/^(-|--)[^-]/.test(te)||te.match(b))&&!W(T,g.bools)&&!W(T,g.counts)||/^(true|false)$/.test(te)?(_(T,te),A++):_(T,me(T))))}else if(k.match(/^-[0-9]$/)&&k.match(b)&&W(k.slice(1),g.bools))T=k.slice(1),_(T,me(T));else if(k==="--"){D=i.slice(A+1);break}else if(a["halt-at-non-option"]){D=i.slice(A);break}else de(k)}ee(R,!0),ee(R,!1),P(R),ae(),x(R,g.aliases,u,!0),_e(R),a["set-placeholder-key"]&&it(R),Object.keys(g.counts).forEach(function(A){Ue(R,A.split("."))||_(A,0)}),f&&D.length&&(R[p]=[]),D.forEach(function(A){R[p].push(A)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(R).filter(A=>A!=="--"&&A.includes("-")).forEach(A=>{delete R[A]}),a["strip-aliased"]&&[].concat(...Object.keys(s).map(A=>s[A])).forEach(A=>{a["camel-case-expansion"]&&A.includes("-")&&delete R[A.split(".").map(k=>Wn(k)).join(".")],delete R[A]});function de(A){let k=v("_",A);(typeof k=="string"||typeof k=="number")&&R._.push(k)}function ye(A,k,M,I){let T,K=W(k,g.nargs);if(K=typeof K!="number"||isNaN(K)?1:K,K===0)return ze(I)||(C=Error(y("Argument unexpected for: %s",k))),_(k,me(k)),A;let $=ze(I)?0:1;if(a["nargs-eats-options"])M.length-(A+1)+$<K&&(C=Error(y("Not enough arguments following: %s",k))),$=K;else{for(T=A+1;T<M.length&&(!M[T].match(/^-[^0-9]/)||M[T].match(b)||oe(M[T]));T++)$++;$<K&&(C=Error(y("Not enough arguments following: %s",k)))}let te=Math.min($,K);for(!ze(I)&&te>0&&(_(k,I),te--),T=A+1;T<te+A+1;T++)_(k,M[T]);return A+te}function be(A,k,M,I){let T=[],K=I||M[A+1],$=W(k,g.nargs);if(W(k,g.bools)&&!/^(true|false)$/.test(K))T.push(!0);else if(ze(K)||ze(I)&&/^-/.test(K)&&!b.test(K)&&!oe(K)){if(u[k]!==void 0){let te=u[k];T=Array.isArray(te)?te:[te]}}else{ze(I)||T.push(F(k,I,!0));for(let te=A+1;te<M.length&&!(!a["greedy-arrays"]&&T.length>0||$&&typeof $=="number"&&T.length>=$||(K=M[te],/^-/.test(K)&&!b.test(K)&&!oe(K)));te++)A=te,T.push(F(k,K,o))}return typeof $=="number"&&($&&T.length<$||isNaN($)&&T.length===0)&&(C=Error(y("Not enough arguments following: %s",k))),_(k,T),A}function _(A,k,M=o){if(/-/.test(A)&&a["camel-case-expansion"]){let K=A.split(".").map(function($){return Wn($)}).join(".");L(A,K)}let I=F(A,k,M),T=A.split(".");Qe(R,T,I),g.aliases[A]&&g.aliases[A].forEach(function(K){let $=K.split(".");Qe(R,$,I)}),T.length>1&&a["dot-notation"]&&(g.aliases[T[0]]||[]).forEach(function(K){let $=K.split("."),te=[].concat(T);te.shift(),$=$.concat(te),(g.aliases[A]||[]).includes($.join("."))||Qe(R,$,I)}),W(A,g.normalize)&&!W(A,g.arrays)&&[A].concat(g.aliases[A]||[]).forEach(function($){Object.defineProperty(S,$,{enumerable:!0,get(){return k},set(te){k=typeof te=="string"?Yr.normalize(te):te}})})}function L(A,k){g.aliases[A]&&g.aliases[A].length||(g.aliases[A]=[k],d[k]=!0),g.aliases[k]&&g.aliases[k].length||L(k,A)}function F(A,k,M){M&&(k=Iw(k)),(W(A,g.bools)||W(A,g.counts))&&typeof k=="string"&&(k=k==="true");let I=Array.isArray(k)?k.map(function(T){return v(A,T)}):v(A,k);return W(A,g.counts)&&(ze(I)||typeof I=="boolean")&&(I=pc()),W(A,g.normalize)&&W(A,g.arrays)&&(Array.isArray(k)?I=k.map(T=>Yr.normalize(T)):I=Yr.normalize(k)),I}function v(A,k){return!a["parse-positional-numbers"]&&A==="_"||!W(A,g.strings)&&!W(A,g.bools)&&!Array.isArray(k)&&(xa(k)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${k}`)))||!ze(k)&&W(A,g.numbers))&&(k=Number(k)),k}function P(A){let k=Object.create(null);x(k,g.aliases,u),Object.keys(g.configs).forEach(function(M){let I=A[M]||k[M];if(I)try{let T=null,K=Yr.resolve(Yr.cwd(),I),$=g.configs[M];if(typeof $=="function"){try{T=$(K)}catch(te){T=te}if(T instanceof Error){C=T;return}}else T=Yr.require(K);j(T)}catch(T){T.name==="PermissionDenied"?C=T:A[M]&&(C=Error(y("Invalid JSON config file: %s",I)))}})}function j(A,k){Object.keys(A).forEach(function(M){let I=A[M],T=k?k+"."+M:M;typeof I=="object"&&I!==null&&!Array.isArray(I)&&a["dot-notation"]?j(I,T):(!Ue(R,T.split("."))||W(T,g.arrays)&&a["combine-arrays"])&&_(T,I)})}function ae(){typeof l<"u"&&l.forEach(function(A){j(A)})}function ee(A,k){if(typeof c>"u")return;let M=typeof c=="string"?c:"",I=Yr.env();Object.keys(I).forEach(function(T){if(M===""||T.lastIndexOf(M,0)===0){let K=T.split("__").map(function($,te){return te===0&&($=$.substring(M.length)),Wn($)});(k&&g.configs[K.join(".")]||!k)&&!Ue(A,K)&&_(K.join("."),I[T])}})}function _e(A){let k,M=new Set;Object.keys(A).forEach(function(I){if(!M.has(I)&&(k=W(I,g.coercions),typeof k=="function"))try{let T=v(I,k(A[I]));[].concat(g.aliases[I]||[],I).forEach(K=>{M.add(K),A[K]=T})}catch(T){C=T}})}function it(A){return g.keys.forEach(k=>{~k.indexOf(".")||typeof A[k]>"u"&&(A[k]=void 0)}),A}function x(A,k,M,I=!1){Object.keys(M).forEach(function(T){Ue(A,T.split("."))||(Qe(A,T.split("."),M[T]),I&&(m[T]=!0),(k[T]||[]).forEach(function(K){Ue(A,K.split("."))||Qe(A,K.split("."),M[T])}))})}function Ue(A,k){let M=A;a["dot-notation"]||(k=[k.join(".")]),k.slice(0,-1).forEach(function(T){M=M[T]||{}});let I=k[k.length-1];return typeof M!="object"?!1:I in M}function Qe(A,k,M){let I=A;a["dot-notation"]||(k=[k.join(".")]),k.slice(0,-1).forEach(function(ft){ft=uh(ft),typeof I=="object"&&I[ft]===void 0&&(I[ft]={}),typeof I[ft]!="object"||Array.isArray(I[ft])?(Array.isArray(I[ft])?I[ft].push({}):I[ft]=[I[ft],{}],I=I[ft][I[ft].length-1]):I=I[ft]});let T=uh(k[k.length-1]),K=W(k.join("."),g.arrays),$=Array.isArray(M),te=a["duplicate-arguments-array"];!te&&W(T,g.nargs)&&(te=!0,(!ze(I[T])&&g.nargs[T]===1||Array.isArray(I[T])&&I[T].length===g.nargs[T])&&(I[T]=void 0)),M===pc()?I[T]=pc(I[T]):Array.isArray(I[T])?te&&K&&$?I[T]=a["flatten-duplicate-arrays"]?I[T].concat(M):(Array.isArray(I[T][0])?I[T]:[I[T]]).concat([M]):!te&&!!K==!!$?I[T]=M:I[T]=I[T].concat([M]):I[T]===void 0&&K?I[T]=$?M:[M]:te&&!(I[T]===void 0||W(T,g.counts)||W(T,g.bools))?I[T]=[I[T],M]:I[T]=M}function E(...A){A.forEach(function(k){Object.keys(k||{}).forEach(function(M){g.aliases[M]||(g.aliases[M]=[].concat(s[M]||[]),g.aliases[M].concat(M).forEach(function(I){if(/-/.test(I)&&a["camel-case-expansion"]){let T=Wn(I);T!==M&&g.aliases[M].indexOf(T)===-1&&(g.aliases[M].push(T),d[T]=!0)}}),g.aliases[M].concat(M).forEach(function(I){if(I.length>1&&/[A-Z]/.test(I)&&a["camel-case-expansion"]){let T=ga(I,"-");T!==M&&g.aliases[M].indexOf(T)===-1&&(g.aliases[M].push(T),d[T]=!0)}}),g.aliases[M].forEach(function(I){g.aliases[I]=[M].concat(g.aliases[M].filter(function(T){return I!==T}))}))})})}function W(A,k){let M=[].concat(g.aliases[A]||[],A),I=Object.keys(k),T=M.find(K=>I.includes(K));return T?k[T]:!1}function Ye(A){let k=Object.keys(g);return[].concat(k.map(I=>g[I])).some(function(I){return Array.isArray(I)?I.includes(A):I[A]})}function ne(A,...k){return[].concat(...k).some(function(I){let T=A.match(I);return T&&Ye(T[1])})}function he(A){if(A.match(b)||!A.match(/^-[^-]+/))return!1;let k=!0,M,I=A.slice(1).split("");for(let T=0;T<I.length;T++){if(M=A.slice(T+2),!Ye(I[T])){k=!1;break}if(I[T+1]&&I[T+1]==="="||M==="-"||/[A-Za-z]/.test(I[T])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(M)||I[T+1]&&I[T+1].match(/\W/))break}return k}function oe(A){return a["unknown-options-as-args"]&&ce(A)}function ce(A){return A=A.replace(/^-{3,}/,"--"),A.match(b)||he(A)?!1:!ne(A,/^-+([^=]+?)=[\s\S]*$/,w,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function me(A){return!W(A,g.bools)&&!W(A,g.counts)&&`${A}`in u?u[A]:we(Fe(A))}function we(A){return{[sr.BOOLEAN]:!0,[sr.STRING]:"",[sr.NUMBER]:void 0,[sr.ARRAY]:[]}[A]}function Fe(A){let k=sr.BOOLEAN;return W(A,g.strings)?k=sr.STRING:W(A,g.numbers)?k=sr.NUMBER:W(A,g.bools)?k=sr.BOOLEAN:W(A,g.arrays)&&(k=sr.ARRAY),k}function ze(A){return A===void 0}function qt(){Object.keys(g.counts).find(A=>W(A,g.arrays)?(C=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",A)),!0):W(A,g.nargs)?(C=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",A)),!0):!1)}return{aliases:Object.assign({},g.aliases),argv:Object.assign(S,R),configuration:a,defaulted:Object.assign({},m),error:C,newAliases:Object.assign({},d)}}};function vw(t){let e=[],r=Object.create(null),n=!0;for(Object.keys(t).forEach(function(i){e.push([].concat(t[i],i))});n;){n=!1;for(let i=0;i<e.length;i++)for(let o=i+1;o<e.length;o++)if(e[i].filter(function(a){return e[o].indexOf(a)!==-1}).length){e[i]=e[i].concat(e[o]),e.splice(o,1),n=!0;break}}return e.forEach(function(i){i=i.filter(function(s,a,u){return u.indexOf(s)===a});let o=i.pop();o!==void 0&&typeof o=="string"&&(r[o]=i)}),r}function pc(t){return t!==void 0?t+1:1}function uh(t){return t==="__proto__"?"___proto___":t}function Iw(t){return typeof t=="string"&&(t[0]==="'"||t[0]==='"')&&t[t.length-1]===t[0]?t.substring(1,t.length-1):t}import{readFileSync as Fw}from"fs";var dc,hc,mc,lh=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,ch=(hc=(dc=process==null?void 0:process.versions)===null||dc===void 0?void 0:dc.node)!==null&&hc!==void 0?hc:(mc=process==null?void 0:process.version)===null||mc===void 0?void 0:mc.slice(1);if(ch&&Number(ch.match(/^([^.]+)/)[1])<lh)throw Error(`yargs parser supports a minimum Node.js version of ${lh}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Nw=process?process.env:{},fh=new ya({cwd:process.cwd,env:()=>Nw,format:Ow,normalize:Dw,resolve:Rw,require:t=>{if(typeof Tr<"u")return Tr(t);if(t.match(/\.json$/))return JSON.parse(Fw(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),us=function(e,r){return fh.parse(e.slice(),r).argv};us.detailed=function(t,e){return fh.parse(t.slice(),e)};us.camelCase=Wn;us.decamelize=ga;us.looksLikeNumber=xa;var gc=us;import{basename as Kw,dirname as Yw,extname as Zw,relative as Xw,resolve as xh}from"path";function ph(){return Pw()?0:1}function Pw(){return Lw()&&!process.defaultApp}function Lw(){return!!process.versions.electron}function xc(t){return t.slice(ph()+1)}function dh(){return process.argv[ph()]}var $e=class t extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}};import{readFileSync as Mw,statSync as Bw,writeFile as jw}from"fs";import{format as Uw}from"util";import{resolve as zw}from"path";var hh={fs:{readFileSync:Mw,writeFile:jw},format:Uw,resolve:zw,exists:t=>{try{return Bw(t).isFile()}catch{return!1}}};var br,yc=class{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let r=e.shift(),n=function(){};return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]=r,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),br.format.apply(br.format,[this.cache[this.locale][r]||r].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),r=e.shift(),n=e.shift(),i=e.shift(),o=function(){};typeof e[e.length-1]=="function"&&(o=e.pop()),this.cache[this.locale]||this._readLocaleFile();let s=i===1?r:n;this.cache[this.locale][r]&&(s=this.cache[this.locale][r][i===1?"one":"other"]),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]={one:r,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:o})):o();let a=[s];return~s.indexOf("%d")&&a.push(i),br.format.apply(br.format,a.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this.cache[this.locale][r]=e[r])}_taggedLiteral(e,...r){let n="";return e.forEach(function(i,o){let s=r[o+1];n+=i,typeof s<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(r,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,r=this.writeQueue[0],n=r.directory,i=r.locale,o=r.cb,s=this._resolveLocaleFile(n,i),a=JSON.stringify(this.cache[i],null,2);br.fs.writeFile(s,a,"utf-8",function(u){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),o(u)})}_readLocaleFile(){let e={},r=this._resolveLocaleFile(this.directory,this.locale);try{br.fs.readFileSync&&(e=JSON.parse(br.fs.readFileSync(r,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+r),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,r){let n=br.resolve(e,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let i=br.resolve(e,"./",r.split("_")[0]+".json");this._fileExistsSync(i)&&(n=i)}return n}_fileExistsSync(e){return br.exists(e)}};function mh(t,e){br=e;let r=new yc(t);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}var $w=t=>mh(t,hh),gh=$w;var Jw="require is not supported by ESM",yh="loading a directory of commands is not supported yet for ESM",ls;try{ls=Hw(import.meta.url)}catch{ls=process.cwd()}var Qw=ls.substring(0,ls.lastIndexOf("node_modules")),bc={assert:{notStrictEqual:qw,strictEqual:Vw},cliui:fc,findUp:sh,getEnv:t=>process.env[t],inspect:Gw,getCallerFile:()=>{throw new $e(yh)},getProcessArgvBin:dh,mainFilename:Qw||process.cwd(),Parser:gc,path:{basename:Kw,dirname:Yw,extname:Zw,relative:Xw,resolve:xh},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:Ww,require:()=>{throw new $e(Jw)},requireDirectory:()=>{throw new $e(yh)},stringWidth:t=>[...t].length,y18n:gh({directory:xh(ls,"../../../locales"),updateFiles:!1})};function Nt(t,e,r,n){r.assert.notStrictEqual(t,e,n)}function Ec(t,e){e.assert.strictEqual(typeof t,"string")}function Ki(t){return Object.keys(t)}function qe(t){return!!t&&!!t.then&&typeof t.then=="function"}function dn(t){let r=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,i=r.shift();if(!i)throw new Error(`No command found in: ${t}`);let o={cmd:i.replace(n,""),demanded:[],optional:[]};return r.forEach((s,a)=>{let u=!1;s=s.replace(/\s/g,""),/\.+[\]>]/.test(s)&&a===r.length-1&&(u=!0),/^\[/.test(s)?o.optional.push({cmd:s.replace(n,"").split("|"),variadic:u}):o.demanded.push({cmd:s.replace(n,"").split("|"),variadic:u})}),o}var ek=["first","second","third","fourth","fifth","sixth"];function H(t,e,r){function n(){return typeof t=="object"?[{demanded:[],optional:[]},t,e]:[dn(`cmd ${t}`),e,r]}try{let i=0,[o,s,a]=n(),u=[].slice.call(s);for(;u.length&&u[u.length-1]===void 0;)u.pop();let l=a||u.length;if(l<o.demanded.length)throw new $e(`Not enough arguments provided. Expected ${o.demanded.length} but received ${u.length}.`);let c=o.demanded.length+o.optional.length;if(l>c)throw new $e(`Too many arguments provided. Expected max ${c} but received ${l}.`);o.demanded.forEach(f=>{let p=u.shift(),d=bh(p);f.cmd.filter(y=>y===d||y==="*").length===0&&Eh(d,f.cmd,i),i+=1}),o.optional.forEach(f=>{if(u.length===0)return;let p=u.shift(),d=bh(p);f.cmd.filter(y=>y===d||y==="*").length===0&&Eh(d,f.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function bh(t){return Array.isArray(t)?"array":t===null?"null":typeof t}function Eh(t,e,r){throw new $e(`Invalid ${ek[r]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}var ba=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,r,n=!0,i=!1){if(H("<array|function> [boolean] [boolean] [boolean]",[e,r,n],arguments.length),Array.isArray(e)){for(let o=0;o<e.length;o++){if(typeof e[o]!="function")throw Error("middleware must be a function");let s=e[o];s.applyBeforeValidation=r,s.global=n}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e=="function"){let o=e;o.applyBeforeValidation=r,o.global=n,o.mutates=i,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,r){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let o=[...n[r]||[],r];return i.option?!o.includes(i.option):!0}),e.option=r,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function Ah(t){return t?t.map(e=>(e.applyBeforeValidation=!1,e)):[]}function Hn(t,e,r,n){return r.reduce((i,o)=>{if(o.applyBeforeValidation!==n)return i;if(o.mutates){if(o.applied)return i;o.applied=!0}if(qe(i))return i.then(s=>Promise.all([s,o(s,e)])).then(([s,a])=>Object.assign(s,a));{let s=o(i,e);return qe(s)?s.then(a=>Object.assign(i,a)):Object.assign(i,s)}},t)}function Kn(t,e,r=n=>{throw n}){try{let n=tk(t)?t():t;return qe(n)?n.then(i=>e(i)):e(n)}catch(n){return r(n)}}function tk(t){return typeof t=="function"}function Ac(t){if(typeof Tr>"u")return null;for(let e=0,r=Object.keys(Tr.cache),n;e<r.length;e++)if(n=Tr.cache[r[e]],n.exports===t)return n;return null}var Yi=/(^\*)|(^\$0)/,Cc=class{constructor(e,r,n,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=e,this.globalMiddleware=n,this.validation=r}addDirectory(e,r,n,i){i=i||{},typeof i.recurse!="boolean"&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);let o=typeof i.visit=="function"?i.visit:s=>s;i.visit=(s,a,u)=>{let l=o(s,a,u);if(l){if(this.requireCache.has(a))return l;this.requireCache.add(a),this.addHandler(l)}return l},this.shim.requireDirectory({require:r,filename:n},e,i)}addHandler(e,r,n,i,o,s){let a=[],u=Ah(o);if(i=i||(()=>{}),Array.isArray(e))if(rk(e))[e,...a]=e;else for(let l of e)this.addHandler(l);else if(ik(e)){let l=Array.isArray(e.command)||typeof e.command=="string"?e.command:this.moduleName(e);e.aliases&&(l=[].concat(l).concat(e.aliases)),this.addHandler(l,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(Ch(n)){this.addHandler([e].concat(a),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let l=dn(e);a=a.map(p=>dn(p).cmd);let c=!1,f=[l.cmd].concat(a).filter(p=>Yi.test(p)?(c=!0,!1):!0);f.length===0&&c&&f.push("$0"),c&&(l.cmd=f[0],a=f.slice(1),e=e.replace(Yi,l.cmd)),a.forEach(p=>{this.aliasMap[p]=l.cmd}),r!==!1&&this.usage.command(e,r,c,a,s),this.handlers[l.cmd]={original:e,description:r,handler:i,builder:n||{},middlewares:u,deprecated:s,demanded:l.demanded,optional:l.optional},c&&(this.defaultCommand=this.handlers[l.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,r,n,i,o,s){let a=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,u=r.getInternalMethods().getContext(),l=u.commands.slice(),c=!e;e&&(u.commands.push(e),u.fullCommands.push(a.original));let f=this.applyBuilderUpdateUsageAndParse(c,a,r,n.aliases,l,i,o,s);return qe(f)?f.then(p=>this.applyMiddlewareAndGetResult(c,a,p.innerArgv,u,o,p.aliases,r)):this.applyMiddlewareAndGetResult(c,a,f.innerArgv,u,o,f.aliases,r)}applyBuilderUpdateUsageAndParse(e,r,n,i,o,s,a,u){let l=r.builder,c=n;if(Ea(l)){n.getInternalMethods().getUsageInstance().freeze();let f=l(n.getInternalMethods().reset(i),u);if(qe(f))return f.then(p=>(c=kh(p)?p:n,this.parseAndUpdateUsage(e,r,c,o,s,a)))}else nk(l)&&(n.getInternalMethods().getUsageInstance().freeze(),c=n.getInternalMethods().reset(i),Object.keys(r.builder).forEach(f=>{c.option(f,l[f])}));return this.parseAndUpdateUsage(e,r,c,o,s,a)}parseAndUpdateUsage(e,r,n,i,o,s){e&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,r),r.description);let a=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,o,s);return qe(a)?a.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:a}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,r){let n=Yi.test(r.original)?r.original.replace(Yi,"").trim():r.original,i=e.filter(o=>!Yi.test(o));return i.push(n),`$0 ${i.join(" ")}`}handleValidationAndGetResult(e,r,n,i,o,s,a,u){if(!s.getInternalMethods().getHasOutput()){let l=s.getInternalMethods().runValidation(o,u,s.parsed.error,e);n=Kn(n,c=>(l(c),c))}if(r.handler&&!s.getInternalMethods().getHasOutput()){s.getInternalMethods().setHasOutput();let l=!!s.getOptions().configuration["populate--"];s.getInternalMethods().postProcess(n,l,!1,!1),n=Hn(n,s,a,!1),n=Kn(n,c=>{let f=r.handler(c);return qe(f)?f.then(()=>c):c}),e||s.getInternalMethods().getUsageInstance().cacheHelpMessage(),qe(n)&&!s.getInternalMethods().hasParseCallback()&&n.catch(c=>{try{s.getInternalMethods().getUsageInstance().fail(null,c)}catch{}})}return e||(i.commands.pop(),i.fullCommands.pop()),n}applyMiddlewareAndGetResult(e,r,n,i,o,s,a){let u={};if(o)return n;a.getInternalMethods().getHasOutput()||(u=this.populatePositionals(r,n,i,a));let l=this.globalMiddleware.getMiddleware().slice(0).concat(r.middlewares),c=Hn(n,a,l,!0);return qe(c)?c.then(f=>this.handleValidationAndGetResult(e,r,f,i,s,a,l,u)):this.handleValidationAndGetResult(e,r,c,i,s,a,l,u)}populatePositionals(e,r,n,i){r._=r._.slice(n.commands.length);let o=e.demanded.slice(0),s=e.optional.slice(0),a={};for(this.validation.positionalCount(o.length,r._.length);o.length;){let u=o.shift();this.populatePositional(u,r,a)}for(;s.length;){let u=s.shift();this.populatePositional(u,r,a)}return r._=n.commands.concat(r._.map(u=>""+u)),this.postProcessPositionals(r,a,this.cmdToParseOptions(e.original),i),a}populatePositional(e,r,n){let i=e.cmd[0];e.variadic?n[i]=r._.splice(0).map(String):r._.length&&(n[i]=[String(r._.shift())])}cmdToParseOptions(e){let r={array:[],default:{},alias:{},demand:{}},n=dn(e);return n.demanded.forEach(i=>{let[o,...s]=i.cmd;i.variadic&&(r.array.push(o),r.default[o]=[]),r.alias[o]=s,r.demand[o]=!0}),n.optional.forEach(i=>{let[o,...s]=i.cmd;i.variadic&&(r.array.push(o),r.default[o]=[]),r.alias[o]=s}),r}postProcessPositionals(e,r,n,i){let o=Object.assign({},i.getOptions());o.default=Object.assign(n.default,o.default);for(let l of Object.keys(n.alias))o.alias[l]=(o.alias[l]||[]).concat(n.alias[l]);o.array=o.array.concat(n.array),o.config={};let s=[];if(Object.keys(r).forEach(l=>{r[l].map(c=>{o.configuration["unknown-options-as-args"]&&(o.key[l]=!0),s.push(`--${l}`),s.push(c)})}),!s.length)return;let a=Object.assign({},o.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(s,Object.assign({},o,{configuration:a}));if(u.error)i.getInternalMethods().getUsageInstance().fail(u.error.message,u.error);else{let l=Object.keys(r);Object.keys(r).forEach(c=>{l.push(...u.aliases[c])}),Object.keys(u.argv).forEach(c=>{l.includes(c)&&(r[c]||(r[c]=u.argv[c]),!this.isInConfigs(i,c)&&!this.isDefaulted(i,c)&&Object.prototype.hasOwnProperty.call(e,c)&&Object.prototype.hasOwnProperty.call(u.argv,c)&&(Array.isArray(e[c])||Array.isArray(u.argv[c]))?e[c]=[].concat(e[c],u.argv[c]):e[c]=u.argv[c])})}}isDefaulted(e,r){let{default:n}=e.getOptions();return Object.prototype.hasOwnProperty.call(n,r)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(r))}isInConfigs(e,r){let{configObjects:n}=e.getOptions();return n.some(i=>Object.prototype.hasOwnProperty.call(i,r))||n.some(i=>Object.prototype.hasOwnProperty.call(i,this.shim.Parser.camelCase(r)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let n=Yi.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let r=this.defaultCommand.builder;if(Ea(r))return r(e,!0);Ch(r)||Object.keys(r).forEach(n=>{e.option(n,r[n])})}moduleName(e){let r=Ac(e);if(!r)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);return this.commandFromFilename(r.filename)}commandFromFilename(e){return this.shim.path.basename(e,this.shim.path.extname(e))}extractDesc({describe:e,description:r,desc:n}){for(let i of[e,r,n]){if(typeof i=="string"||i===!1)return i;Nt(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();Nt(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function wh(t,e,r,n){return new Cc(t,e,r,n)}function Ch(t){return typeof t=="object"&&!!t.builder&&typeof t.handler=="function"}function rk(t){return t.every(e=>typeof e=="string")}function Ea(t){return typeof t=="function"}function nk(t){return typeof t=="object"}function ik(t){return typeof t=="object"&&!Array.isArray(t)}function hn(t={},e=()=>!0){let r={};return Ki(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}function mn(t){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let r=e;r._handle&&r.isTTY&&typeof r._handle.setBlocking=="function"&&r._handle.setBlocking(t)})}function ok(t){return typeof t=="boolean"}function _h(t,e){let r=e.y18n.__,n={},i=[];n.failFn=function(F){i.push(F)};let o=null,s=null,a=!0;n.showHelpOnFail=function(F=!0,v){let[P,j]=typeof F=="string"?[!0,F]:[F,v];return t.getInternalMethods().isGlobalContext()&&(s=j),o=j,a=P,n};let u=!1;n.fail=function(F,v){let P=t.getInternalMethods().getLoggerInstance();if(i.length)for(let j=i.length-1;j>=0;--j){let ae=i[j];if(ok(ae)){if(v)throw v;if(F)throw Error(F)}else ae(F,v,n)}else{if(t.getExitProcess()&&mn(!0),!u){u=!0,a&&(t.showHelp("error"),P.error()),(F||v)&&P.error(F||v);let j=o||s;j&&((F||v)&&P.error(""),P.error(j))}if(v=v||new $e(F),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,v);throw v}};let l=[],c=!1;n.usage=(L,F)=>L===null?(c=!0,l=[],n):(c=!1,l.push([L,F||""]),n),n.getUsage=()=>l,n.getUsageDisabled=()=>c,n.getPositionalGroupName=()=>r("Positionals:");let f=[];n.example=(L,F)=>{f.push([L,F||""])};let p=[];n.command=function(F,v,P,j,ae=!1){P&&(p=p.map(ee=>(ee[2]=!1,ee))),p.push([F,v||"",P,j,ae])},n.getCommands=()=>p;let d={};n.describe=function(F,v){Array.isArray(F)?F.forEach(P=>{n.describe(P,v)}):typeof F=="object"?Object.keys(F).forEach(P=>{n.describe(P,F[P])}):d[F]=v},n.getDescriptions=()=>d;let m=[];n.epilog=L=>{m.push(L)};let y=!1,g;n.wrap=L=>{y=!0,g=L},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(y||(g=ye(),y=!0),g);let b="__yargsString__:";n.deferY18nLookup=L=>b+L,n.help=function(){if(D)return D;C();let F=t.customScriptName?t.$0:e.path.basename(t.$0),v=t.getDemandedOptions(),P=t.getDemandedCommands(),j=t.getDeprecatedOptions(),ae=t.getGroups(),ee=t.getOptions(),_e=[];_e=_e.concat(Object.keys(d)),_e=_e.concat(Object.keys(v)),_e=_e.concat(Object.keys(P)),_e=_e.concat(Object.keys(ee.default)),_e=_e.filter(S),_e=Object.keys(_e.reduce((ne,he)=>(he!=="_"&&(ne[he]=!0),ne),{}));let it=n.getWrap(),x=e.cliui({width:it,wrap:!!it});if(!c){if(l.length)l.forEach(ne=>{x.div({text:`${ne[0].replace(/\$0/g,F)}`}),ne[1]&&x.div({text:`${ne[1]}`,padding:[1,0,0,0]})}),x.div();else if(p.length){let ne=null;P._?ne=`${F} <${r("command")}>
6
+ `),o.border&&(i.unshift("."+"-".repeat(this.negatePadding(o)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(o)+2)+"'")),o.padding&&(i.unshift(...new Array(o.padding[Ww]||0).fill("")),i.push(...new Array(o.padding[Hw]||0).fill(""))),i.forEach((a,u)=>{r[u]||r.push([]);let l=r[u];for(let c=0;c<s;c++)l[c]===void 0&&l.push("");l.push(a)})}),r}negatePadding(e){let r=e.width||0;return e.padding&&(r-=(e.padding[fa]||0)+(e.padding[ca]||0)),e.border&&(r-=4),r}columnWidths(e){if(!this.wrap)return e.map(s=>s.width||Ht.stringWidth(s.text));let r=e.length,n=this.width,i=e.map(s=>{if(s.width)return r--,n-=s.width,s.width}),o=r?Math.floor(n/r):0;return i.map((s,a)=>s===void 0?Math.max(o,Kw(e[a])):s)}};function Md(t,e,r){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?r:" ":""}function Kw(t){let e=t.padding||[],r=1+(e[fa]||0)+(e[ca]||0);return t.border?r+4:r}function Yw(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Zw(t,e){t=t.trim();let r=Ht.stringWidth(t);return r<e?" ".repeat(e-r)+t:t}function Xw(t,e){t=t.trim();let r=Ht.stringWidth(t);return r>=e?t:" ".repeat(e-r>>1)+t}var Ht;function Bd(t,e){return Ht=e,new rc({width:t?.width||Yw(),wrap:t?.wrap})}var jd=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function nc(t){return t.replace(jd,"")}function Ud(t,e){let[r,n]=t.match(jd)||["",""];t=nc(t);let i="";for(let o=0;o<t.length;o++)o!==0&&o%e===0&&(i+=`
7
+ `),i+=t.charAt(o);return r&&n&&(i=`${r}${i}${n}`),i}function ic(t){return Bd(t,{stringWidth:e=>[...e].length,stripAnsi:nc,wrap:Ud})}import{dirname as zd,resolve as $d}from"path";import{readdirSync as Jw,statSync as Qw}from"fs";function qd(t,e){let r=$d(".",t),n;for(Qw(r).isDirectory()||(r=zd(r));;){if(n=e(r,Jw(r)),n)return $d(r,n);if(r=zd(n=r),n===r)break}}import{inspect as xC}from"util";import{readFileSync as yC}from"fs";import{fileURLToPath as bC}from"url";import{format as rC}from"util";import{normalize as nC,resolve as iC}from"path";function $n(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),t.indexOf("-")===-1&&t.indexOf("_")===-1)return t;{let r="",n=!1,i=t.match(/^-+/);for(let o=i?i[0].length:0;o<t.length;o++){let s=t.charAt(o);n&&(n=!1,s=s.toUpperCase()),o!==0&&(s==="-"||s==="_")?n=!0:s!=="-"&&s!=="_"&&(r+=s)}return r}}function pa(t,e){let r=t.toLowerCase();e=e||"-";let n="";for(let i=0;i<t.length;i++){let o=r.charAt(i),s=t.charAt(i);o!==s&&i>0?n+=`${e}${r.charAt(i)}`:n+=s}return n}function da(t){return t==null?!1:typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^0[^.]/.test(t)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function Vd(t){if(Array.isArray(t))return t.map(s=>typeof s!="string"?s+"":s);t=t.trim();let e=0,r=null,n=null,i=null,o=[];for(let s=0;s<t.length;s++){if(r=n,n=t.charAt(s),n===" "&&!i){r!==" "&&e++;continue}n===i?i=null:(n==="'"||n==='"')&&!i&&(i=n),o[e]||(o[e]=""),o[e]+=n}return o}var rr;(function(t){t.BOOLEAN="boolean",t.STRING="string",t.NUMBER="number",t.ARRAY="array"})(rr||(rr={}));var Gr,ha=class{constructor(e){Gr=e}parse(e,r){let n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},r),i=Vd(e),o=typeof e=="string",s=eC(Object.assign(Object.create(null),n.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),u=Object.assign(Object.create(null),n.default),l=n.configObjects||[],c=n.envPrefix,f=a["populate--"],p=f?"--":"_",d=Object.create(null),m=Object.create(null),y=n.__||Gr.format,g={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},b=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,C=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(A){let k=typeof A=="object"?A.key:A,M=Object.keys(A).map(function(I){return{boolean:"bools",string:"strings",number:"numbers"}[I]}).filter(Boolean).pop();M&&(g[M][k]=!0),g.arrays[k]=!0,g.keys.push(k)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(A){g.bools[A]=!0,g.keys.push(A)}),[].concat(n.string||[]).filter(Boolean).forEach(function(A){g.strings[A]=!0,g.keys.push(A)}),[].concat(n.number||[]).filter(Boolean).forEach(function(A){g.numbers[A]=!0,g.keys.push(A)}),[].concat(n.count||[]).filter(Boolean).forEach(function(A){g.counts[A]=!0,g.keys.push(A)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(A){g.normalize[A]=!0,g.keys.push(A)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([A,k])=>{typeof k=="number"&&(g.nargs[A]=k,g.keys.push(A))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([A,k])=>{typeof k=="function"&&(g.coercions[A]=k,g.keys.push(A))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(A){g.configs[A]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([A,k])=>{(typeof k=="boolean"||typeof k=="function")&&(g.configs[A]=k)})),E(n.key,s,n.default,g.arrays),Object.keys(u).forEach(function(A){(g.aliases[A]||[]).forEach(function(k){u[k]=u[A]})});let w=null;Ut();let D=[],R=Object.assign(Object.create(null),{_:[]}),S={};for(let A=0;A<i.length;A++){let k=i[A],M=k.replace(/^-{3,}/,"---"),I,T,K,$,te,lt;if(k!=="--"&&/^-/.test(k)&&oe(k))de(k);else if(M.match(/^---+(=|$)/)){de(k);continue}else if(k.match(/^--.+=/)||!a["short-option-groups"]&&k.match(/^-.+=/))$=k.match(/^--?([^=]+)=([\s\S]*)$/),$!==null&&Array.isArray($)&&$.length>=3&&(W($[1],g.arrays)?A=be(A,$[1],i,$[2]):W($[1],g.nargs)!==!1?A=ye(A,$[1],i,$[2]):_($[1],$[2],!0));else if(k.match(C)&&a["boolean-negation"])$=k.match(C),$!==null&&Array.isArray($)&&$.length>=2&&(T=$[1],_(T,W(T,g.arrays)?[!1]:!1));else if(k.match(/^--.+/)||!a["short-option-groups"]&&k.match(/^-[^-]+/))$=k.match(/^--?(.+)/),$!==null&&Array.isArray($)&&$.length>=2&&(T=$[1],W(T,g.arrays)?A=be(A,T,i):W(T,g.nargs)!==!1?A=ye(A,T,i):(te=i[A+1],te!==void 0&&(!te.match(/^-/)||te.match(b))&&!W(T,g.bools)&&!W(T,g.counts)||/^(true|false)$/.test(te)?(_(T,te),A++):_(T,me(T))));else if(k.match(/^-.\..+=/))$=k.match(/^-([^=]+)=([\s\S]*)$/),$!==null&&Array.isArray($)&&$.length>=3&&_($[1],$[2]);else if(k.match(/^-.\..+/)&&!k.match(b))te=i[A+1],$=k.match(/^-(.\..+)/),$!==null&&Array.isArray($)&&$.length>=2&&(T=$[1],te!==void 0&&!te.match(/^-/)&&!W(T,g.bools)&&!W(T,g.counts)?(_(T,te),A++):_(T,me(T)));else if(k.match(/^-[^-]+/)&&!k.match(b)){K=k.slice(1,-1).split(""),I=!1;for(let Ct=0;Ct<K.length;Ct++){if(te=k.slice(Ct+2),K[Ct+1]&&K[Ct+1]==="="){lt=k.slice(Ct+3),T=K[Ct],W(T,g.arrays)?A=be(A,T,i,lt):W(T,g.nargs)!==!1?A=ye(A,T,i,lt):_(T,lt),I=!0;break}if(te==="-"){_(K[Ct],te);continue}if(/[A-Za-z]/.test(K[Ct])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(te)&&W(te,g.bools)===!1){_(K[Ct],te),I=!0;break}if(K[Ct+1]&&K[Ct+1].match(/\W/)){_(K[Ct],te),I=!0;break}else _(K[Ct],me(K[Ct]))}T=k.slice(-1)[0],!I&&T!=="-"&&(W(T,g.arrays)?A=be(A,T,i):W(T,g.nargs)!==!1?A=ye(A,T,i):(te=i[A+1],te!==void 0&&(!/^(-|--)[^-]/.test(te)||te.match(b))&&!W(T,g.bools)&&!W(T,g.counts)||/^(true|false)$/.test(te)?(_(T,te),A++):_(T,me(T))))}else if(k.match(/^-[0-9]$/)&&k.match(b)&&W(k.slice(1),g.bools))T=k.slice(1),_(T,me(T));else if(k==="--"){D=i.slice(A+1);break}else if(a["halt-at-non-option"]){D=i.slice(A);break}else de(k)}ee(R,!0),ee(R,!1),P(R),ae(),x(R,g.aliases,u,!0),_e(R),a["set-placeholder-key"]&&rt(R),Object.keys(g.counts).forEach(function(A){Ue(R,A.split("."))||_(A,0)}),f&&D.length&&(R[p]=[]),D.forEach(function(A){R[p].push(A)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(R).filter(A=>A!=="--"&&A.includes("-")).forEach(A=>{delete R[A]}),a["strip-aliased"]&&[].concat(...Object.keys(s).map(A=>s[A])).forEach(A=>{a["camel-case-expansion"]&&A.includes("-")&&delete R[A.split(".").map(k=>$n(k)).join(".")],delete R[A]});function de(A){let k=v("_",A);(typeof k=="string"||typeof k=="number")&&R._.push(k)}function ye(A,k,M,I){let T,K=W(k,g.nargs);if(K=typeof K!="number"||isNaN(K)?1:K,K===0)return ze(I)||(w=Error(y("Argument unexpected for: %s",k))),_(k,me(k)),A;let $=ze(I)?0:1;if(a["nargs-eats-options"])M.length-(A+1)+$<K&&(w=Error(y("Not enough arguments following: %s",k))),$=K;else{for(T=A+1;T<M.length&&(!M[T].match(/^-[^0-9]/)||M[T].match(b)||oe(M[T]));T++)$++;$<K&&(w=Error(y("Not enough arguments following: %s",k)))}let te=Math.min($,K);for(!ze(I)&&te>0&&(_(k,I),te--),T=A+1;T<te+A+1;T++)_(k,M[T]);return A+te}function be(A,k,M,I){let T=[],K=I||M[A+1],$=W(k,g.nargs);if(W(k,g.bools)&&!/^(true|false)$/.test(K))T.push(!0);else if(ze(K)||ze(I)&&/^-/.test(K)&&!b.test(K)&&!oe(K)){if(u[k]!==void 0){let te=u[k];T=Array.isArray(te)?te:[te]}}else{ze(I)||T.push(F(k,I,!0));for(let te=A+1;te<M.length&&!(!a["greedy-arrays"]&&T.length>0||$&&typeof $=="number"&&T.length>=$||(K=M[te],/^-/.test(K)&&!b.test(K)&&!oe(K)));te++)A=te,T.push(F(k,K,o))}return typeof $=="number"&&($&&T.length<$||isNaN($)&&T.length===0)&&(w=Error(y("Not enough arguments following: %s",k))),_(k,T),A}function _(A,k,M=o){if(/-/.test(A)&&a["camel-case-expansion"]){let K=A.split(".").map(function($){return $n($)}).join(".");L(A,K)}let I=F(A,k,M),T=A.split(".");Je(R,T,I),g.aliases[A]&&g.aliases[A].forEach(function(K){let $=K.split(".");Je(R,$,I)}),T.length>1&&a["dot-notation"]&&(g.aliases[T[0]]||[]).forEach(function(K){let $=K.split("."),te=[].concat(T);te.shift(),$=$.concat(te),(g.aliases[A]||[]).includes($.join("."))||Je(R,$,I)}),W(A,g.normalize)&&!W(A,g.arrays)&&[A].concat(g.aliases[A]||[]).forEach(function($){Object.defineProperty(S,$,{enumerable:!0,get(){return k},set(te){k=typeof te=="string"?Gr.normalize(te):te}})})}function L(A,k){g.aliases[A]&&g.aliases[A].length||(g.aliases[A]=[k],d[k]=!0),g.aliases[k]&&g.aliases[k].length||L(k,A)}function F(A,k,M){M&&(k=tC(k)),(W(A,g.bools)||W(A,g.counts))&&typeof k=="string"&&(k=k==="true");let I=Array.isArray(k)?k.map(function(T){return v(A,T)}):v(A,k);return W(A,g.counts)&&(ze(I)||typeof I=="boolean")&&(I=oc()),W(A,g.normalize)&&W(A,g.arrays)&&(Array.isArray(k)?I=k.map(T=>Gr.normalize(T)):I=Gr.normalize(k)),I}function v(A,k){return!a["parse-positional-numbers"]&&A==="_"||!W(A,g.strings)&&!W(A,g.bools)&&!Array.isArray(k)&&(da(k)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${k}`)))||!ze(k)&&W(A,g.numbers))&&(k=Number(k)),k}function P(A){let k=Object.create(null);x(k,g.aliases,u),Object.keys(g.configs).forEach(function(M){let I=A[M]||k[M];if(I)try{let T=null,K=Gr.resolve(Gr.cwd(),I),$=g.configs[M];if(typeof $=="function"){try{T=$(K)}catch(te){T=te}if(T instanceof Error){w=T;return}}else T=Gr.require(K);j(T)}catch(T){T.name==="PermissionDenied"?w=T:A[M]&&(w=Error(y("Invalid JSON config file: %s",I)))}})}function j(A,k){Object.keys(A).forEach(function(M){let I=A[M],T=k?k+"."+M:M;typeof I=="object"&&I!==null&&!Array.isArray(I)&&a["dot-notation"]?j(I,T):(!Ue(R,T.split("."))||W(T,g.arrays)&&a["combine-arrays"])&&_(T,I)})}function ae(){typeof l<"u"&&l.forEach(function(A){j(A)})}function ee(A,k){if(typeof c>"u")return;let M=typeof c=="string"?c:"",I=Gr.env();Object.keys(I).forEach(function(T){if(M===""||T.lastIndexOf(M,0)===0){let K=T.split("__").map(function($,te){return te===0&&($=$.substring(M.length)),$n($)});(k&&g.configs[K.join(".")]||!k)&&!Ue(A,K)&&_(K.join("."),I[T])}})}function _e(A){let k,M=new Set;Object.keys(A).forEach(function(I){if(!M.has(I)&&(k=W(I,g.coercions),typeof k=="function"))try{let T=v(I,k(A[I]));[].concat(g.aliases[I]||[],I).forEach(K=>{M.add(K),A[K]=T})}catch(T){w=T}})}function rt(A){return g.keys.forEach(k=>{~k.indexOf(".")||typeof A[k]>"u"&&(A[k]=void 0)}),A}function x(A,k,M,I=!1){Object.keys(M).forEach(function(T){Ue(A,T.split("."))||(Je(A,T.split("."),M[T]),I&&(m[T]=!0),(k[T]||[]).forEach(function(K){Ue(A,K.split("."))||Je(A,K.split("."),M[T])}))})}function Ue(A,k){let M=A;a["dot-notation"]||(k=[k.join(".")]),k.slice(0,-1).forEach(function(T){M=M[T]||{}});let I=k[k.length-1];return typeof M!="object"?!1:I in M}function Je(A,k,M){let I=A;a["dot-notation"]||(k=[k.join(".")]),k.slice(0,-1).forEach(function(lt){lt=Gd(lt),typeof I=="object"&&I[lt]===void 0&&(I[lt]={}),typeof I[lt]!="object"||Array.isArray(I[lt])?(Array.isArray(I[lt])?I[lt].push({}):I[lt]=[I[lt],{}],I=I[lt][I[lt].length-1]):I=I[lt]});let T=Gd(k[k.length-1]),K=W(k.join("."),g.arrays),$=Array.isArray(M),te=a["duplicate-arguments-array"];!te&&W(T,g.nargs)&&(te=!0,(!ze(I[T])&&g.nargs[T]===1||Array.isArray(I[T])&&I[T].length===g.nargs[T])&&(I[T]=void 0)),M===oc()?I[T]=oc(I[T]):Array.isArray(I[T])?te&&K&&$?I[T]=a["flatten-duplicate-arrays"]?I[T].concat(M):(Array.isArray(I[T][0])?I[T]:[I[T]]).concat([M]):!te&&!!K==!!$?I[T]=M:I[T]=I[T].concat([M]):I[T]===void 0&&K?I[T]=$?M:[M]:te&&!(I[T]===void 0||W(T,g.counts)||W(T,g.bools))?I[T]=[I[T],M]:I[T]=M}function E(...A){A.forEach(function(k){Object.keys(k||{}).forEach(function(M){g.aliases[M]||(g.aliases[M]=[].concat(s[M]||[]),g.aliases[M].concat(M).forEach(function(I){if(/-/.test(I)&&a["camel-case-expansion"]){let T=$n(I);T!==M&&g.aliases[M].indexOf(T)===-1&&(g.aliases[M].push(T),d[T]=!0)}}),g.aliases[M].concat(M).forEach(function(I){if(I.length>1&&/[A-Z]/.test(I)&&a["camel-case-expansion"]){let T=pa(I,"-");T!==M&&g.aliases[M].indexOf(T)===-1&&(g.aliases[M].push(T),d[T]=!0)}}),g.aliases[M].forEach(function(I){g.aliases[I]=[M].concat(g.aliases[M].filter(function(T){return I!==T}))}))})})}function W(A,k){let M=[].concat(g.aliases[A]||[],A),I=Object.keys(k),T=M.find(K=>I.includes(K));return T?k[T]:!1}function Ke(A){let k=Object.keys(g);return[].concat(k.map(I=>g[I])).some(function(I){return Array.isArray(I)?I.includes(A):I[A]})}function ne(A,...k){return[].concat(...k).some(function(I){let T=A.match(I);return T&&Ke(T[1])})}function he(A){if(A.match(b)||!A.match(/^-[^-]+/))return!1;let k=!0,M,I=A.slice(1).split("");for(let T=0;T<I.length;T++){if(M=A.slice(T+2),!Ke(I[T])){k=!1;break}if(I[T+1]&&I[T+1]==="="||M==="-"||/[A-Za-z]/.test(I[T])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(M)||I[T+1]&&I[T+1].match(/\W/))break}return k}function oe(A){return a["unknown-options-as-args"]&&ce(A)}function ce(A){return A=A.replace(/^-{3,}/,"--"),A.match(b)||he(A)?!1:!ne(A,/^-+([^=]+?)=[\s\S]*$/,C,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function me(A){return!W(A,g.bools)&&!W(A,g.counts)&&`${A}`in u?u[A]:Ce(Fe(A))}function Ce(A){return{[rr.BOOLEAN]:!0,[rr.STRING]:"",[rr.NUMBER]:void 0,[rr.ARRAY]:[]}[A]}function Fe(A){let k=rr.BOOLEAN;return W(A,g.strings)?k=rr.STRING:W(A,g.numbers)?k=rr.NUMBER:W(A,g.bools)?k=rr.BOOLEAN:W(A,g.arrays)&&(k=rr.ARRAY),k}function ze(A){return A===void 0}function Ut(){Object.keys(g.counts).find(A=>W(A,g.arrays)?(w=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",A)),!0):W(A,g.nargs)?(w=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",A)),!0):!1)}return{aliases:Object.assign({},g.aliases),argv:Object.assign(S,R),configuration:a,defaulted:Object.assign({},m),error:w,newAliases:Object.assign({},d)}}};function eC(t){let e=[],r=Object.create(null),n=!0;for(Object.keys(t).forEach(function(i){e.push([].concat(t[i],i))});n;){n=!1;for(let i=0;i<e.length;i++)for(let o=i+1;o<e.length;o++)if(e[i].filter(function(a){return e[o].indexOf(a)!==-1}).length){e[i]=e[i].concat(e[o]),e.splice(o,1),n=!0;break}}return e.forEach(function(i){i=i.filter(function(s,a,u){return u.indexOf(s)===a});let o=i.pop();o!==void 0&&typeof o=="string"&&(r[o]=i)}),r}function oc(t){return t!==void 0?t+1:1}function Gd(t){return t==="__proto__"?"___proto___":t}function tC(t){return typeof t=="string"&&(t[0]==="'"||t[0]==='"')&&t[t.length-1]===t[0]?t.substring(1,t.length-1):t}import{readFileSync as oC}from"fs";var sc,ac,uc,Wd=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,Hd=(ac=(sc=process==null?void 0:process.versions)===null||sc===void 0?void 0:sc.node)!==null&&ac!==void 0?ac:(uc=process==null?void 0:process.version)===null||uc===void 0?void 0:uc.slice(1);if(Hd&&Number(Hd.match(/^([^.]+)/)[1])<Wd)throw Error(`yargs parser supports a minimum Node.js version of ${Wd}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var sC=process?process.env:{},Kd=new ha({cwd:process.cwd,env:()=>sC,format:rC,normalize:nC,resolve:iC,require:t=>{if(typeof Er<"u")return Er(t);if(t.match(/\.json$/))return JSON.parse(oC(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),rs=function(e,r){return Kd.parse(e.slice(),r).argv};rs.detailed=function(t,e){return Kd.parse(t.slice(),e)};rs.camelCase=$n;rs.decamelize=pa;rs.looksLikeNumber=da;var lc=rs;import{basename as EC,dirname as AC,extname as wC,relative as CC,resolve as eh}from"path";function Yd(){return aC()?0:1}function aC(){return uC()&&!process.defaultApp}function uC(){return!!process.versions.electron}function cc(t){return t.slice(Yd()+1)}function Zd(){return process.argv[Yd()]}var $e=class t extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}};import{readFileSync as lC,statSync as cC,writeFile as fC}from"fs";import{format as pC}from"util";import{resolve as dC}from"path";var Xd={fs:{readFileSync:lC,writeFile:fC},format:pC,resolve:dC,exists:t=>{try{return cC(t).isFile()}catch{return!1}}};var hr,fc=class{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let r=e.shift(),n=function(){};return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]=r,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),hr.format.apply(hr.format,[this.cache[this.locale][r]||r].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),r=e.shift(),n=e.shift(),i=e.shift(),o=function(){};typeof e[e.length-1]=="function"&&(o=e.pop()),this.cache[this.locale]||this._readLocaleFile();let s=i===1?r:n;this.cache[this.locale][r]&&(s=this.cache[this.locale][r][i===1?"one":"other"]),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]={one:r,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:o})):o();let a=[s];return~s.indexOf("%d")&&a.push(i),hr.format.apply(hr.format,a.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this.cache[this.locale][r]=e[r])}_taggedLiteral(e,...r){let n="";return e.forEach(function(i,o){let s=r[o+1];n+=i,typeof s<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(r,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,r=this.writeQueue[0],n=r.directory,i=r.locale,o=r.cb,s=this._resolveLocaleFile(n,i),a=JSON.stringify(this.cache[i],null,2);hr.fs.writeFile(s,a,"utf-8",function(u){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),o(u)})}_readLocaleFile(){let e={},r=this._resolveLocaleFile(this.directory,this.locale);try{hr.fs.readFileSync&&(e=JSON.parse(hr.fs.readFileSync(r,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+r),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,r){let n=hr.resolve(e,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let i=hr.resolve(e,"./",r.split("_")[0]+".json");this._fileExistsSync(i)&&(n=i)}return n}_fileExistsSync(e){return hr.exists(e)}};function Jd(t,e){hr=e;let r=new fc(t);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}var hC=t=>Jd(t,Xd),Qd=hC;var kC="require is not supported by ESM",th="loading a directory of commands is not supported yet for ESM",ns;try{ns=bC(import.meta.url)}catch{ns=process.cwd()}var TC=ns.substring(0,ns.lastIndexOf("node_modules")),pc={assert:{notStrictEqual:mC,strictEqual:gC},cliui:ic,findUp:qd,getEnv:t=>process.env[t],inspect:xC,getCallerFile:()=>{throw new $e(th)},getProcessArgvBin:Zd,mainFilename:TC||process.cwd(),Parser:lc,path:{basename:EC,dirname:AC,extname:wC,relative:CC,resolve:eh},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:yC,require:()=>{throw new $e(kC)},requireDirectory:()=>{throw new $e(th)},stringWidth:t=>[...t].length,y18n:Qd({directory:eh(ns,"../../../locales"),updateFiles:!1})};function Dt(t,e,r,n){r.assert.notStrictEqual(t,e,n)}function dc(t,e){e.assert.strictEqual(typeof t,"string")}function $i(t){return Object.keys(t)}function qe(t){return!!t&&!!t.then&&typeof t.then=="function"}function ln(t){let r=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,i=r.shift();if(!i)throw new Error(`No command found in: ${t}`);let o={cmd:i.replace(n,""),demanded:[],optional:[]};return r.forEach((s,a)=>{let u=!1;s=s.replace(/\s/g,""),/\.+[\]>]/.test(s)&&a===r.length-1&&(u=!0),/^\[/.test(s)?o.optional.push({cmd:s.replace(n,"").split("|"),variadic:u}):o.demanded.push({cmd:s.replace(n,"").split("|"),variadic:u})}),o}var _C=["first","second","third","fourth","fifth","sixth"];function H(t,e,r){function n(){return typeof t=="object"?[{demanded:[],optional:[]},t,e]:[ln(`cmd ${t}`),e,r]}try{let i=0,[o,s,a]=n(),u=[].slice.call(s);for(;u.length&&u[u.length-1]===void 0;)u.pop();let l=a||u.length;if(l<o.demanded.length)throw new $e(`Not enough arguments provided. Expected ${o.demanded.length} but received ${u.length}.`);let c=o.demanded.length+o.optional.length;if(l>c)throw new $e(`Too many arguments provided. Expected max ${c} but received ${l}.`);o.demanded.forEach(f=>{let p=u.shift(),d=rh(p);f.cmd.filter(y=>y===d||y==="*").length===0&&nh(d,f.cmd,i),i+=1}),o.optional.forEach(f=>{if(u.length===0)return;let p=u.shift(),d=rh(p);f.cmd.filter(y=>y===d||y==="*").length===0&&nh(d,f.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function rh(t){return Array.isArray(t)?"array":t===null?"null":typeof t}function nh(t,e,r){throw new $e(`Invalid ${_C[r]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}var ma=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,r,n=!0,i=!1){if(H("<array|function> [boolean] [boolean] [boolean]",[e,r,n],arguments.length),Array.isArray(e)){for(let o=0;o<e.length;o++){if(typeof e[o]!="function")throw Error("middleware must be a function");let s=e[o];s.applyBeforeValidation=r,s.global=n}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e=="function"){let o=e;o.applyBeforeValidation=r,o.global=n,o.mutates=i,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,r){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let o=[...n[r]||[],r];return i.option?!o.includes(i.option):!0}),e.option=r,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function ih(t){return t?t.map(e=>(e.applyBeforeValidation=!1,e)):[]}function qn(t,e,r,n){return r.reduce((i,o)=>{if(o.applyBeforeValidation!==n)return i;if(o.mutates){if(o.applied)return i;o.applied=!0}if(qe(i))return i.then(s=>Promise.all([s,o(s,e)])).then(([s,a])=>Object.assign(s,a));{let s=o(i,e);return qe(s)?s.then(a=>Object.assign(i,a)):Object.assign(i,s)}},t)}function Vn(t,e,r=n=>{throw n}){try{let n=SC(t)?t():t;return qe(n)?n.then(i=>e(i)):e(n)}catch(n){return r(n)}}function SC(t){return typeof t=="function"}function hc(t){if(typeof Er>"u")return null;for(let e=0,r=Object.keys(Er.cache),n;e<r.length;e++)if(n=Er.cache[r[e]],n.exports===t)return n;return null}var qi=/(^\*)|(^\$0)/,mc=class{constructor(e,r,n,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=e,this.globalMiddleware=n,this.validation=r}addDirectory(e,r,n,i){i=i||{},typeof i.recurse!="boolean"&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);let o=typeof i.visit=="function"?i.visit:s=>s;i.visit=(s,a,u)=>{let l=o(s,a,u);if(l){if(this.requireCache.has(a))return l;this.requireCache.add(a),this.addHandler(l)}return l},this.shim.requireDirectory({require:r,filename:n},e,i)}addHandler(e,r,n,i,o,s){let a=[],u=ih(o);if(i=i||(()=>{}),Array.isArray(e))if(vC(e))[e,...a]=e;else for(let l of e)this.addHandler(l);else if(OC(e)){let l=Array.isArray(e.command)||typeof e.command=="string"?e.command:this.moduleName(e);e.aliases&&(l=[].concat(l).concat(e.aliases)),this.addHandler(l,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(oh(n)){this.addHandler([e].concat(a),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let l=ln(e);a=a.map(p=>ln(p).cmd);let c=!1,f=[l.cmd].concat(a).filter(p=>qi.test(p)?(c=!0,!1):!0);f.length===0&&c&&f.push("$0"),c&&(l.cmd=f[0],a=f.slice(1),e=e.replace(qi,l.cmd)),a.forEach(p=>{this.aliasMap[p]=l.cmd}),r!==!1&&this.usage.command(e,r,c,a,s),this.handlers[l.cmd]={original:e,description:r,handler:i,builder:n||{},middlewares:u,deprecated:s,demanded:l.demanded,optional:l.optional},c&&(this.defaultCommand=this.handlers[l.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,r,n,i,o,s){let a=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,u=r.getInternalMethods().getContext(),l=u.commands.slice(),c=!e;e&&(u.commands.push(e),u.fullCommands.push(a.original));let f=this.applyBuilderUpdateUsageAndParse(c,a,r,n.aliases,l,i,o,s);return qe(f)?f.then(p=>this.applyMiddlewareAndGetResult(c,a,p.innerArgv,u,o,p.aliases,r)):this.applyMiddlewareAndGetResult(c,a,f.innerArgv,u,o,f.aliases,r)}applyBuilderUpdateUsageAndParse(e,r,n,i,o,s,a,u){let l=r.builder,c=n;if(ga(l)){n.getInternalMethods().getUsageInstance().freeze();let f=l(n.getInternalMethods().reset(i),u);if(qe(f))return f.then(p=>(c=ah(p)?p:n,this.parseAndUpdateUsage(e,r,c,o,s,a)))}else IC(l)&&(n.getInternalMethods().getUsageInstance().freeze(),c=n.getInternalMethods().reset(i),Object.keys(r.builder).forEach(f=>{c.option(f,l[f])}));return this.parseAndUpdateUsage(e,r,c,o,s,a)}parseAndUpdateUsage(e,r,n,i,o,s){e&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,r),r.description);let a=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,o,s);return qe(a)?a.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:a}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,r){let n=qi.test(r.original)?r.original.replace(qi,"").trim():r.original,i=e.filter(o=>!qi.test(o));return i.push(n),`$0 ${i.join(" ")}`}handleValidationAndGetResult(e,r,n,i,o,s,a,u){if(!s.getInternalMethods().getHasOutput()){let l=s.getInternalMethods().runValidation(o,u,s.parsed.error,e);n=Vn(n,c=>(l(c),c))}if(r.handler&&!s.getInternalMethods().getHasOutput()){s.getInternalMethods().setHasOutput();let l=!!s.getOptions().configuration["populate--"];s.getInternalMethods().postProcess(n,l,!1,!1),n=qn(n,s,a,!1),n=Vn(n,c=>{let f=r.handler(c);return qe(f)?f.then(()=>c):c}),e||s.getInternalMethods().getUsageInstance().cacheHelpMessage(),qe(n)&&!s.getInternalMethods().hasParseCallback()&&n.catch(c=>{try{s.getInternalMethods().getUsageInstance().fail(null,c)}catch{}})}return e||(i.commands.pop(),i.fullCommands.pop()),n}applyMiddlewareAndGetResult(e,r,n,i,o,s,a){let u={};if(o)return n;a.getInternalMethods().getHasOutput()||(u=this.populatePositionals(r,n,i,a));let l=this.globalMiddleware.getMiddleware().slice(0).concat(r.middlewares),c=qn(n,a,l,!0);return qe(c)?c.then(f=>this.handleValidationAndGetResult(e,r,f,i,s,a,l,u)):this.handleValidationAndGetResult(e,r,c,i,s,a,l,u)}populatePositionals(e,r,n,i){r._=r._.slice(n.commands.length);let o=e.demanded.slice(0),s=e.optional.slice(0),a={};for(this.validation.positionalCount(o.length,r._.length);o.length;){let u=o.shift();this.populatePositional(u,r,a)}for(;s.length;){let u=s.shift();this.populatePositional(u,r,a)}return r._=n.commands.concat(r._.map(u=>""+u)),this.postProcessPositionals(r,a,this.cmdToParseOptions(e.original),i),a}populatePositional(e,r,n){let i=e.cmd[0];e.variadic?n[i]=r._.splice(0).map(String):r._.length&&(n[i]=[String(r._.shift())])}cmdToParseOptions(e){let r={array:[],default:{},alias:{},demand:{}},n=ln(e);return n.demanded.forEach(i=>{let[o,...s]=i.cmd;i.variadic&&(r.array.push(o),r.default[o]=[]),r.alias[o]=s,r.demand[o]=!0}),n.optional.forEach(i=>{let[o,...s]=i.cmd;i.variadic&&(r.array.push(o),r.default[o]=[]),r.alias[o]=s}),r}postProcessPositionals(e,r,n,i){let o=Object.assign({},i.getOptions());o.default=Object.assign(n.default,o.default);for(let l of Object.keys(n.alias))o.alias[l]=(o.alias[l]||[]).concat(n.alias[l]);o.array=o.array.concat(n.array),o.config={};let s=[];if(Object.keys(r).forEach(l=>{r[l].map(c=>{o.configuration["unknown-options-as-args"]&&(o.key[l]=!0),s.push(`--${l}`),s.push(c)})}),!s.length)return;let a=Object.assign({},o.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(s,Object.assign({},o,{configuration:a}));if(u.error)i.getInternalMethods().getUsageInstance().fail(u.error.message,u.error);else{let l=Object.keys(r);Object.keys(r).forEach(c=>{l.push(...u.aliases[c])}),Object.keys(u.argv).forEach(c=>{l.includes(c)&&(r[c]||(r[c]=u.argv[c]),!this.isInConfigs(i,c)&&!this.isDefaulted(i,c)&&Object.prototype.hasOwnProperty.call(e,c)&&Object.prototype.hasOwnProperty.call(u.argv,c)&&(Array.isArray(e[c])||Array.isArray(u.argv[c]))?e[c]=[].concat(e[c],u.argv[c]):e[c]=u.argv[c])})}}isDefaulted(e,r){let{default:n}=e.getOptions();return Object.prototype.hasOwnProperty.call(n,r)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(r))}isInConfigs(e,r){let{configObjects:n}=e.getOptions();return n.some(i=>Object.prototype.hasOwnProperty.call(i,r))||n.some(i=>Object.prototype.hasOwnProperty.call(i,this.shim.Parser.camelCase(r)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let n=qi.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let r=this.defaultCommand.builder;if(ga(r))return r(e,!0);oh(r)||Object.keys(r).forEach(n=>{e.option(n,r[n])})}moduleName(e){let r=hc(e);if(!r)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);return this.commandFromFilename(r.filename)}commandFromFilename(e){return this.shim.path.basename(e,this.shim.path.extname(e))}extractDesc({describe:e,description:r,desc:n}){for(let i of[e,r,n]){if(typeof i=="string"||i===!1)return i;Dt(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();Dt(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function sh(t,e,r,n){return new mc(t,e,r,n)}function oh(t){return typeof t=="object"&&!!t.builder&&typeof t.handler=="function"}function vC(t){return t.every(e=>typeof e=="string")}function ga(t){return typeof t=="function"}function IC(t){return typeof t=="object"}function OC(t){return typeof t=="object"&&!Array.isArray(t)}function cn(t={},e=()=>!0){let r={};return $i(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}function fn(t){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let r=e;r._handle&&r.isTTY&&typeof r._handle.setBlocking=="function"&&r._handle.setBlocking(t)})}function DC(t){return typeof t=="boolean"}function lh(t,e){let r=e.y18n.__,n={},i=[];n.failFn=function(F){i.push(F)};let o=null,s=null,a=!0;n.showHelpOnFail=function(F=!0,v){let[P,j]=typeof F=="string"?[!0,F]:[F,v];return t.getInternalMethods().isGlobalContext()&&(s=j),o=j,a=P,n};let u=!1;n.fail=function(F,v){let P=t.getInternalMethods().getLoggerInstance();if(i.length)for(let j=i.length-1;j>=0;--j){let ae=i[j];if(DC(ae)){if(v)throw v;if(F)throw Error(F)}else ae(F,v,n)}else{if(t.getExitProcess()&&fn(!0),!u){u=!0,a&&(t.showHelp("error"),P.error()),(F||v)&&P.error(F||v);let j=o||s;j&&((F||v)&&P.error(""),P.error(j))}if(v=v||new $e(F),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,v);throw v}};let l=[],c=!1;n.usage=(L,F)=>L===null?(c=!0,l=[],n):(c=!1,l.push([L,F||""]),n),n.getUsage=()=>l,n.getUsageDisabled=()=>c,n.getPositionalGroupName=()=>r("Positionals:");let f=[];n.example=(L,F)=>{f.push([L,F||""])};let p=[];n.command=function(F,v,P,j,ae=!1){P&&(p=p.map(ee=>(ee[2]=!1,ee))),p.push([F,v||"",P,j,ae])},n.getCommands=()=>p;let d={};n.describe=function(F,v){Array.isArray(F)?F.forEach(P=>{n.describe(P,v)}):typeof F=="object"?Object.keys(F).forEach(P=>{n.describe(P,F[P])}):d[F]=v},n.getDescriptions=()=>d;let m=[];n.epilog=L=>{m.push(L)};let y=!1,g;n.wrap=L=>{y=!0,g=L},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(y||(g=ye(),y=!0),g);let b="__yargsString__:";n.deferY18nLookup=L=>b+L,n.help=function(){if(D)return D;w();let F=t.customScriptName?t.$0:e.path.basename(t.$0),v=t.getDemandedOptions(),P=t.getDemandedCommands(),j=t.getDeprecatedOptions(),ae=t.getGroups(),ee=t.getOptions(),_e=[];_e=_e.concat(Object.keys(d)),_e=_e.concat(Object.keys(v)),_e=_e.concat(Object.keys(P)),_e=_e.concat(Object.keys(ee.default)),_e=_e.filter(S),_e=Object.keys(_e.reduce((ne,he)=>(he!=="_"&&(ne[he]=!0),ne),{}));let rt=n.getWrap(),x=e.cliui({width:rt,wrap:!!rt});if(!c){if(l.length)l.forEach(ne=>{x.div({text:`${ne[0].replace(/\$0/g,F)}`}),ne[1]&&x.div({text:`${ne[1]}`,padding:[1,0,0,0]})}),x.div();else if(p.length){let ne=null;P._?ne=`${F} <${r("command")}>
12
8
  `:ne=`${F} [${r("command")}]
13
- `,x.div(`${ne}`)}}if(p.length>1||p.length===1&&!p[0][2]){x.div(r("Commands:"));let ne=t.getInternalMethods().getContext(),he=ne.commands.length?`${ne.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(p=p.sort((ce,me)=>ce[0].localeCompare(me[0])));let oe=F?`${F} `:"";p.forEach(ce=>{let me=`${oe}${he}${ce[0].replace(/^\$0 ?/,"")}`;x.span({text:me,padding:[0,2,0,2],width:w(p,it,`${F}${he}`)+4},{text:ce[1]});let we=[];ce[2]&&we.push(`[${r("default")}]`),ce[3]&&ce[3].length&&we.push(`[${r("aliases:")} ${ce[3].join(", ")}]`),ce[4]&&(typeof ce[4]=="string"?we.push(`[${r("deprecated: %s",ce[4])}]`):we.push(`[${r("deprecated")}]`)),we.length?x.div({text:we.join(" "),padding:[0,0,0,2],align:"right"}):x.div()}),x.div()}let Ue=(Object.keys(ee.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);_e=_e.filter(ne=>!t.parsed.newAliases[ne]&&Ue.every(he=>(ee.alias[he]||[]).indexOf(ne)===-1));let Qe=r("Options:");ae[Qe]||(ae[Qe]=[]),R(_e,ee.alias,ae,Qe);let E=ne=>/^--/.test(Aa(ne)),W=Object.keys(ae).filter(ne=>ae[ne].length>0).map(ne=>{let he=ae[ne].filter(S).map(oe=>{if(Ue.includes(oe))return oe;for(let ce=0,me;(me=Ue[ce])!==void 0;ce++)if((ee.alias[me]||[]).includes(oe))return me;return oe});return{groupName:ne,normalizedKeys:he}}).filter(({normalizedKeys:ne})=>ne.length>0).map(({groupName:ne,normalizedKeys:he})=>{let oe=he.reduce((ce,me)=>(ce[me]=[me].concat(ee.alias[me]||[]).map(we=>ne===n.getPositionalGroupName()?we:(/^[0-9]$/.test(we)?ee.boolean.includes(me)?"-":"--":we.length>1?"--":"-")+we).sort((we,Fe)=>E(we)===E(Fe)?0:E(we)?1:-1).join(", "),ce),{});return{groupName:ne,normalizedKeys:he,switches:oe}});if(W.filter(({groupName:ne})=>ne!==n.getPositionalGroupName()).some(({normalizedKeys:ne,switches:he})=>!ne.every(oe=>E(he[oe])))&&W.filter(({groupName:ne})=>ne!==n.getPositionalGroupName()).forEach(({normalizedKeys:ne,switches:he})=>{ne.forEach(oe=>{E(he[oe])&&(he[oe]=sk(he[oe],4))})}),W.forEach(({groupName:ne,normalizedKeys:he,switches:oe})=>{x.div(ne),he.forEach(ce=>{let me=oe[ce],we=d[ce]||"",Fe=null;we.includes(b)&&(we=r(we.substring(b.length))),ee.boolean.includes(ce)&&(Fe=`[${r("boolean")}]`),ee.count.includes(ce)&&(Fe=`[${r("count")}]`),ee.string.includes(ce)&&(Fe=`[${r("string")}]`),ee.normalize.includes(ce)&&(Fe=`[${r("string")}]`),ee.array.includes(ce)&&(Fe=`[${r("array")}]`),ee.number.includes(ce)&&(Fe=`[${r("number")}]`);let ze=k=>typeof k=="string"?`[${r("deprecated: %s",k)}]`:`[${r("deprecated")}]`,qt=[ce in j?ze(j[ce]):null,Fe,ce in v?`[${r("required")}]`:null,ee.choices&&ee.choices[ce]?`[${r("choices:")} ${n.stringifiedValues(ee.choices[ce])}]`:null,de(ee.default[ce],ee.defaultDescription[ce])].filter(Boolean).join(" ");x.span({text:Aa(me),padding:[0,2,0,2+Th(me)],width:w(oe,it)+4},we);let A=t.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;qt&&!A?x.div({text:qt,padding:[0,0,0,2],align:"right"}):x.div()}),x.div()}),f.length&&(x.div(r("Examples:")),f.forEach(ne=>{ne[0]=ne[0].replace(/\$0/g,F)}),f.forEach(ne=>{ne[1]===""?x.div({text:ne[0],padding:[0,2,0,2]}):x.div({text:ne[0],padding:[0,2,0,2],width:w(f,it)+4},{text:ne[1]})}),x.div()),m.length>0){let ne=m.map(he=>he.replace(/\$0/g,F)).join(`
9
+ `,x.div(`${ne}`)}}if(p.length>1||p.length===1&&!p[0][2]){x.div(r("Commands:"));let ne=t.getInternalMethods().getContext(),he=ne.commands.length?`${ne.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(p=p.sort((ce,me)=>ce[0].localeCompare(me[0])));let oe=F?`${F} `:"";p.forEach(ce=>{let me=`${oe}${he}${ce[0].replace(/^\$0 ?/,"")}`;x.span({text:me,padding:[0,2,0,2],width:C(p,rt,`${F}${he}`)+4},{text:ce[1]});let Ce=[];ce[2]&&Ce.push(`[${r("default")}]`),ce[3]&&ce[3].length&&Ce.push(`[${r("aliases:")} ${ce[3].join(", ")}]`),ce[4]&&(typeof ce[4]=="string"?Ce.push(`[${r("deprecated: %s",ce[4])}]`):Ce.push(`[${r("deprecated")}]`)),Ce.length?x.div({text:Ce.join(" "),padding:[0,0,0,2],align:"right"}):x.div()}),x.div()}let Ue=(Object.keys(ee.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);_e=_e.filter(ne=>!t.parsed.newAliases[ne]&&Ue.every(he=>(ee.alias[he]||[]).indexOf(ne)===-1));let Je=r("Options:");ae[Je]||(ae[Je]=[]),R(_e,ee.alias,ae,Je);let E=ne=>/^--/.test(xa(ne)),W=Object.keys(ae).filter(ne=>ae[ne].length>0).map(ne=>{let he=ae[ne].filter(S).map(oe=>{if(Ue.includes(oe))return oe;for(let ce=0,me;(me=Ue[ce])!==void 0;ce++)if((ee.alias[me]||[]).includes(oe))return me;return oe});return{groupName:ne,normalizedKeys:he}}).filter(({normalizedKeys:ne})=>ne.length>0).map(({groupName:ne,normalizedKeys:he})=>{let oe=he.reduce((ce,me)=>(ce[me]=[me].concat(ee.alias[me]||[]).map(Ce=>ne===n.getPositionalGroupName()?Ce:(/^[0-9]$/.test(Ce)?ee.boolean.includes(me)?"-":"--":Ce.length>1?"--":"-")+Ce).sort((Ce,Fe)=>E(Ce)===E(Fe)?0:E(Ce)?1:-1).join(", "),ce),{});return{groupName:ne,normalizedKeys:he,switches:oe}});if(W.filter(({groupName:ne})=>ne!==n.getPositionalGroupName()).some(({normalizedKeys:ne,switches:he})=>!ne.every(oe=>E(he[oe])))&&W.filter(({groupName:ne})=>ne!==n.getPositionalGroupName()).forEach(({normalizedKeys:ne,switches:he})=>{ne.forEach(oe=>{E(he[oe])&&(he[oe]=RC(he[oe],4))})}),W.forEach(({groupName:ne,normalizedKeys:he,switches:oe})=>{x.div(ne),he.forEach(ce=>{let me=oe[ce],Ce=d[ce]||"",Fe=null;Ce.includes(b)&&(Ce=r(Ce.substring(b.length))),ee.boolean.includes(ce)&&(Fe=`[${r("boolean")}]`),ee.count.includes(ce)&&(Fe=`[${r("count")}]`),ee.string.includes(ce)&&(Fe=`[${r("string")}]`),ee.normalize.includes(ce)&&(Fe=`[${r("string")}]`),ee.array.includes(ce)&&(Fe=`[${r("array")}]`),ee.number.includes(ce)&&(Fe=`[${r("number")}]`);let ze=k=>typeof k=="string"?`[${r("deprecated: %s",k)}]`:`[${r("deprecated")}]`,Ut=[ce in j?ze(j[ce]):null,Fe,ce in v?`[${r("required")}]`:null,ee.choices&&ee.choices[ce]?`[${r("choices:")} ${n.stringifiedValues(ee.choices[ce])}]`:null,de(ee.default[ce],ee.defaultDescription[ce])].filter(Boolean).join(" ");x.span({text:xa(me),padding:[0,2,0,2+uh(me)],width:C(oe,rt)+4},Ce);let A=t.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;Ut&&!A?x.div({text:Ut,padding:[0,0,0,2],align:"right"}):x.div()}),x.div()}),f.length&&(x.div(r("Examples:")),f.forEach(ne=>{ne[0]=ne[0].replace(/\$0/g,F)}),f.forEach(ne=>{ne[1]===""?x.div({text:ne[0],padding:[0,2,0,2]}):x.div({text:ne[0],padding:[0,2,0,2],width:C(f,rt)+4},{text:ne[1]})}),x.div()),m.length>0){let ne=m.map(he=>he.replace(/\$0/g,F)).join(`
14
10
  `);x.div(`${ne}
15
- `)}return x.toString().replace(/\s*$/,"")};function w(L,F,v){let P=0;return Array.isArray(L)||(L=Object.values(L).map(j=>[j])),L.forEach(j=>{P=Math.max(e.stringWidth(v?`${v} ${Aa(j[0])}`:Aa(j[0]))+Th(j[0]),P)}),F&&(P=Math.min(P,parseInt((F*.5).toString(),10))),P}function C(){let L=t.getDemandedOptions(),F=t.getOptions();(Object.keys(F.alias)||[]).forEach(v=>{F.alias[v].forEach(P=>{d[P]&&n.describe(v,d[P]),P in L&&t.demandOption(v,L[P]),F.boolean.includes(P)&&t.boolean(v),F.count.includes(P)&&t.count(v),F.string.includes(P)&&t.string(v),F.normalize.includes(P)&&t.normalize(v),F.array.includes(P)&&t.array(v),F.number.includes(P)&&t.number(v)})})}let D;n.cacheHelpMessage=function(){D=this.help()},n.clearCachedHelpMessage=function(){D=void 0},n.hasCachedHelpMessage=function(){return!!D};function R(L,F,v,P){let j=[],ae=null;return Object.keys(v).forEach(ee=>{j=j.concat(v[ee])}),L.forEach(ee=>{ae=[ee].concat(F[ee]),ae.some(_e=>j.indexOf(_e)!==-1)||v[P].push(ee)}),j}function S(L){return t.getOptions().hiddenOptions.indexOf(L)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}n.showHelp=L=>{let F=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:F[L])(n.help())},n.functionDescription=L=>["(",L.name?e.Parser.decamelize(L.name,"-"):r("generated-value"),")"].join(""),n.stringifiedValues=function(F,v){let P="",j=v||", ",ae=[].concat(F);return!F||!ae.length||ae.forEach(ee=>{P.length&&(P+=j),P+=JSON.stringify(ee)}),P};function de(L,F){let v=`[${r("default:")} `;if(L===void 0&&!F)return null;if(F)v+=F;else switch(typeof L){case"string":v+=`"${L}"`;break;case"object":v+=JSON.stringify(L);break;default:v+=L}return`${v}]`}function ye(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}let be=null;n.version=L=>{be=L},n.showVersion=L=>{let F=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:F[L])(be)},n.reset=function(F){return o=null,u=!1,l=[],c=!1,m=[],f=[],p=[],d=hn(d,v=>!F[v]),n};let _=[];return n.freeze=function(){_.push({failMessage:o,failureOutput:u,usages:l,usageDisabled:c,epilogs:m,examples:f,commands:p,descriptions:d})},n.unfreeze=function(F=!1){let v=_.pop();v&&(F?(d={...v.descriptions,...d},p=[...v.commands,...p],l=[...v.usages,...l],f=[...v.examples,...f],m=[...v.epilogs,...m]):{failMessage:o,failureOutput:u,usages:l,usageDisabled:c,epilogs:m,examples:f,commands:p,descriptions:d}=v)},n}function wc(t){return typeof t=="object"}function sk(t,e){return wc(t)?{text:t.text,indentation:t.indentation+e}:{text:t,indentation:e}}function Th(t){return wc(t)?t.indentation:0}function Aa(t){return wc(t)?t.text:t}var Sh=`###-begin-{{app_name}}-completions-###
11
+ `)}return x.toString().replace(/\s*$/,"")};function C(L,F,v){let P=0;return Array.isArray(L)||(L=Object.values(L).map(j=>[j])),L.forEach(j=>{P=Math.max(e.stringWidth(v?`${v} ${xa(j[0])}`:xa(j[0]))+uh(j[0]),P)}),F&&(P=Math.min(P,parseInt((F*.5).toString(),10))),P}function w(){let L=t.getDemandedOptions(),F=t.getOptions();(Object.keys(F.alias)||[]).forEach(v=>{F.alias[v].forEach(P=>{d[P]&&n.describe(v,d[P]),P in L&&t.demandOption(v,L[P]),F.boolean.includes(P)&&t.boolean(v),F.count.includes(P)&&t.count(v),F.string.includes(P)&&t.string(v),F.normalize.includes(P)&&t.normalize(v),F.array.includes(P)&&t.array(v),F.number.includes(P)&&t.number(v)})})}let D;n.cacheHelpMessage=function(){D=this.help()},n.clearCachedHelpMessage=function(){D=void 0},n.hasCachedHelpMessage=function(){return!!D};function R(L,F,v,P){let j=[],ae=null;return Object.keys(v).forEach(ee=>{j=j.concat(v[ee])}),L.forEach(ee=>{ae=[ee].concat(F[ee]),ae.some(_e=>j.indexOf(_e)!==-1)||v[P].push(ee)}),j}function S(L){return t.getOptions().hiddenOptions.indexOf(L)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}n.showHelp=L=>{let F=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:F[L])(n.help())},n.functionDescription=L=>["(",L.name?e.Parser.decamelize(L.name,"-"):r("generated-value"),")"].join(""),n.stringifiedValues=function(F,v){let P="",j=v||", ",ae=[].concat(F);return!F||!ae.length||ae.forEach(ee=>{P.length&&(P+=j),P+=JSON.stringify(ee)}),P};function de(L,F){let v=`[${r("default:")} `;if(L===void 0&&!F)return null;if(F)v+=F;else switch(typeof L){case"string":v+=`"${L}"`;break;case"object":v+=JSON.stringify(L);break;default:v+=L}return`${v}]`}function ye(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}let be=null;n.version=L=>{be=L},n.showVersion=L=>{let F=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:F[L])(be)},n.reset=function(F){return o=null,u=!1,l=[],c=!1,m=[],f=[],p=[],d=cn(d,v=>!F[v]),n};let _=[];return n.freeze=function(){_.push({failMessage:o,failureOutput:u,usages:l,usageDisabled:c,epilogs:m,examples:f,commands:p,descriptions:d})},n.unfreeze=function(F=!1){let v=_.pop();v&&(F?(d={...v.descriptions,...d},p=[...v.commands,...p],l=[...v.usages,...l],f=[...v.examples,...f],m=[...v.epilogs,...m]):{failMessage:o,failureOutput:u,usages:l,usageDisabled:c,epilogs:m,examples:f,commands:p,descriptions:d}=v)},n}function gc(t){return typeof t=="object"}function RC(t,e){return gc(t)?{text:t.text,indentation:t.indentation+e}:{text:t,indentation:e}}function uh(t){return gc(t)?t.indentation:0}function xa(t){return gc(t)?t.text:t}var ch=`###-begin-{{app_name}}-completions-###
16
12
  #
17
13
  # yargs command completion script
18
14
  #
@@ -40,7 +36,7 @@ _{{app_name}}_yargs_completions()
40
36
  }
41
37
  complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
42
38
  ###-end-{{app_name}}-completions-###
43
- `,vh=`#compdef {{app_name}}
39
+ `,fh=`#compdef {{app_name}}
44
40
  ###-begin-{{app_name}}-completions-###
45
41
  #
46
42
  # yargs command completion script
@@ -59,122 +55,122 @@ _{{app_name}}_yargs_completions()
59
55
  }
60
56
  compdef _{{app_name}}_yargs_completions {{app_name}}
61
57
  ###-end-{{app_name}}-completions-###
62
- `;var kc=class{constructor(e,r,n,i){var o,s,a;this.yargs=e,this.usage=r,this.command=n,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(a=((o=this.shim.getEnv("SHELL"))===null||o===void 0?void 0:o.includes("zsh"))||((s=this.shim.getEnv("ZSH_NAME"))===null||s===void 0?void 0:s.includes("zsh")))!==null&&a!==void 0?a:!1}defaultCompletion(e,r,n,i){let o=this.command.getCommandHandlers();for(let a=0,u=e.length;a<u;++a)if(o[e[a]]&&o[e[a]].builder){let l=o[e[a]].builder;if(Ea(l)){this.indexAfterLastReset=a+1;let c=this.yargs.getInternalMethods().reset();return l(c,!0),c.argv}}let s=[];this.commandCompletions(s,e,n),this.optionCompletions(s,e,r,n),this.choicesFromOptionsCompletions(s,e,r,n),this.choicesFromPositionalsCompletions(s,e,r,n),i(null,s)}commandCompletions(e,r,n){let i=this.yargs.getInternalMethods().getContext().commands;!n.match(/^-/)&&i[i.length-1]!==n&&!this.previousArgHasChoices(r)&&this.usage.getCommands().forEach(o=>{let s=dn(o[0]).cmd;if(r.indexOf(s)===-1)if(!this.zshShell)e.push(s);else{let a=o[1]||"";e.push(s.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(e,r,n,i){if((i.match(/^-/)||i===""&&e.length===0)&&!this.previousArgHasChoices(r)){let o=this.yargs.getOptions(),s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(o.key).forEach(a=>{let u=!!o.configuration["boolean-negation"]&&o.boolean.includes(a);!s.includes(a)&&!o.hiddenOptions.includes(a)&&!this.argsContainKey(r,a,u)&&this.completeOptionKey(a,e,i,u&&!!o.default[a])})}}choicesFromOptionsCompletions(e,r,n,i){if(this.previousArgHasChoices(r)){let o=this.getPreviousArgChoices(r);o&&o.length>0&&e.push(...o.map(s=>s.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(e,r,n,i){if(i===""&&e.length>0&&this.previousArgHasChoices(r))return;let o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],s=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),a=o[n._.length-s-1];if(!a)return;let u=this.yargs.getOptions().choices[a]||[];for(let l of u)l.startsWith(i)&&e.push(l.replace(/:/g,"\\:"))}getPreviousArgChoices(e){if(e.length<1)return;let r=e[e.length-1],n="";if(!r.startsWith("-")&&e.length>1&&(n=r,r=e[e.length-2]),!r.startsWith("-"))return;let i=r.replace(/^-+/,""),o=this.yargs.getOptions(),s=[i,...this.yargs.getAliases()[i]||[]],a;for(let u of s)if(Object.prototype.hasOwnProperty.call(o.key,u)&&Array.isArray(o.choices[u])){a=o.choices[u];break}if(a)return a.filter(u=>!n||u.startsWith(n))}previousArgHasChoices(e){let r=this.getPreviousArgChoices(e);return r!==void 0&&r.length>0}argsContainKey(e,r,n){let i=o=>e.indexOf((/^[^0-9]$/.test(o)?"-":"--")+o)!==-1;if(i(r)||n&&i(`no-${r}`))return!0;if(this.aliases){for(let o of this.aliases[r])if(i(o))return!0}return!1}completeOptionKey(e,r,n,i){var o,s,a,u;let l=e;if(this.zshShell){let d=this.usage.getDescriptions(),m=(s=(o=this===null||this===void 0?void 0:this.aliases)===null||o===void 0?void 0:o[e])===null||s===void 0?void 0:s.find(b=>{let w=d[b];return typeof w=="string"&&w.length>0}),y=m?d[m]:void 0,g=(u=(a=d[e])!==null&&a!==void 0?a:y)!==null&&u!==void 0?u:"";l=`${e.replace(/:/g,"\\:")}:${g.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let c=d=>/^--/.test(d),f=d=>/^[^0-9]$/.test(d),p=!c(n)&&f(e)?"-":"--";r.push(p+l),i&&r.push(p+"no-"+l)}customCompletion(e,r,n,i){if(Nt(this.customCompletionFunction,null,this.shim),uk(this.customCompletionFunction)){let o=this.customCompletionFunction(n,r);return qe(o)?o.then(s=>{this.shim.process.nextTick(()=>{i(null,s)})}).catch(s=>{this.shim.process.nextTick(()=>{i(s,void 0)})}):i(null,o)}else return lk(this.customCompletionFunction)?this.customCompletionFunction(n,r,(o=i)=>this.defaultCompletion(e,r,n,o),o=>{i(null,o)}):this.customCompletionFunction(n,r,o=>{i(null,o)})}getCompletion(e,r){let n=e.length?e[e.length-1]:"",i=this.yargs.parse(e,!0),o=this.customCompletionFunction?s=>this.customCompletion(e,s,n,r):s=>this.defaultCompletion(e,s,n,r);return qe(i)?i.then(o):o(i)}generateCompletionScript(e,r){let n=this.zshShell?vh:Sh,i=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,i),n=n.replace(/{{completion_command}}/g,r),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function Ih(t,e,r,n){return new kc(t,e,r,n)}function uk(t){return t.length<3}function lk(t){return t.length>3}function Oh(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;let r=[],n;for(n=0;n<=e.length;n++)r[n]=[n];let i;for(i=0;i<=t.length;i++)r[0][i]=i;for(n=1;n<=e.length;n++)for(i=1;i<=t.length;i++)e.charAt(n-1)===t.charAt(i-1)?r[n][i]=r[n-1][i-1]:n>1&&i>1&&e.charAt(n-2)===t.charAt(i-1)&&e.charAt(n-1)===t.charAt(i-2)?r[n][i]=r[n-2][i-2]+1:r[n][i]=Math.min(r[n-1][i-1]+1,Math.min(r[n][i-1]+1,r[n-1][i]+1));return r[e.length][t.length]}var Dh=["$0","--","_"];function Rh(t,e,r){let n=r.y18n.__,i=r.y18n.__n,o={};o.nonOptionCount=function(f){let p=t.getDemandedCommands(),m=f._.length+(f["--"]?f["--"].length:0)-t.getInternalMethods().getContext().commands.length;p._&&(m<p._.min||m>p._.max)&&(m<p._.min?p._.minMsg!==void 0?e.fail(p._.minMsg?p._.minMsg.replace(/\$0/g,m.toString()).replace(/\$1/,p._.min.toString()):null):e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",m,m.toString(),p._.min.toString())):m>p._.max&&(p._.maxMsg!==void 0?e.fail(p._.maxMsg?p._.maxMsg.replace(/\$0/g,m.toString()).replace(/\$1/,p._.max.toString()):null):e.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",m,m.toString(),p._.max.toString()))))},o.positionalCount=function(f,p){p<f&&e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",p,p+"",f+""))},o.requiredArguments=function(f,p){let d=null;for(let m of Object.keys(p))(!Object.prototype.hasOwnProperty.call(f,m)||typeof f[m]>"u")&&(d=d||{},d[m]=p[m]);if(d){let m=[];for(let g of Object.keys(d)){let b=d[g];b&&m.indexOf(b)<0&&m.push(b)}let y=m.length?`
58
+ `;var xc=class{constructor(e,r,n,i){var o,s,a;this.yargs=e,this.usage=r,this.command=n,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(a=((o=this.shim.getEnv("SHELL"))===null||o===void 0?void 0:o.includes("zsh"))||((s=this.shim.getEnv("ZSH_NAME"))===null||s===void 0?void 0:s.includes("zsh")))!==null&&a!==void 0?a:!1}defaultCompletion(e,r,n,i){let o=this.command.getCommandHandlers();for(let a=0,u=e.length;a<u;++a)if(o[e[a]]&&o[e[a]].builder){let l=o[e[a]].builder;if(ga(l)){this.indexAfterLastReset=a+1;let c=this.yargs.getInternalMethods().reset();return l(c,!0),c.argv}}let s=[];this.commandCompletions(s,e,n),this.optionCompletions(s,e,r,n),this.choicesFromOptionsCompletions(s,e,r,n),this.choicesFromPositionalsCompletions(s,e,r,n),i(null,s)}commandCompletions(e,r,n){let i=this.yargs.getInternalMethods().getContext().commands;!n.match(/^-/)&&i[i.length-1]!==n&&!this.previousArgHasChoices(r)&&this.usage.getCommands().forEach(o=>{let s=ln(o[0]).cmd;if(r.indexOf(s)===-1)if(!this.zshShell)e.push(s);else{let a=o[1]||"";e.push(s.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(e,r,n,i){if((i.match(/^-/)||i===""&&e.length===0)&&!this.previousArgHasChoices(r)){let o=this.yargs.getOptions(),s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(o.key).forEach(a=>{let u=!!o.configuration["boolean-negation"]&&o.boolean.includes(a);!s.includes(a)&&!o.hiddenOptions.includes(a)&&!this.argsContainKey(r,a,u)&&this.completeOptionKey(a,e,i,u&&!!o.default[a])})}}choicesFromOptionsCompletions(e,r,n,i){if(this.previousArgHasChoices(r)){let o=this.getPreviousArgChoices(r);o&&o.length>0&&e.push(...o.map(s=>s.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(e,r,n,i){if(i===""&&e.length>0&&this.previousArgHasChoices(r))return;let o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],s=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),a=o[n._.length-s-1];if(!a)return;let u=this.yargs.getOptions().choices[a]||[];for(let l of u)l.startsWith(i)&&e.push(l.replace(/:/g,"\\:"))}getPreviousArgChoices(e){if(e.length<1)return;let r=e[e.length-1],n="";if(!r.startsWith("-")&&e.length>1&&(n=r,r=e[e.length-2]),!r.startsWith("-"))return;let i=r.replace(/^-+/,""),o=this.yargs.getOptions(),s=[i,...this.yargs.getAliases()[i]||[]],a;for(let u of s)if(Object.prototype.hasOwnProperty.call(o.key,u)&&Array.isArray(o.choices[u])){a=o.choices[u];break}if(a)return a.filter(u=>!n||u.startsWith(n))}previousArgHasChoices(e){let r=this.getPreviousArgChoices(e);return r!==void 0&&r.length>0}argsContainKey(e,r,n){let i=o=>e.indexOf((/^[^0-9]$/.test(o)?"-":"--")+o)!==-1;if(i(r)||n&&i(`no-${r}`))return!0;if(this.aliases){for(let o of this.aliases[r])if(i(o))return!0}return!1}completeOptionKey(e,r,n,i){var o,s,a,u;let l=e;if(this.zshShell){let d=this.usage.getDescriptions(),m=(s=(o=this===null||this===void 0?void 0:this.aliases)===null||o===void 0?void 0:o[e])===null||s===void 0?void 0:s.find(b=>{let C=d[b];return typeof C=="string"&&C.length>0}),y=m?d[m]:void 0,g=(u=(a=d[e])!==null&&a!==void 0?a:y)!==null&&u!==void 0?u:"";l=`${e.replace(/:/g,"\\:")}:${g.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let c=d=>/^--/.test(d),f=d=>/^[^0-9]$/.test(d),p=!c(n)&&f(e)?"-":"--";r.push(p+l),i&&r.push(p+"no-"+l)}customCompletion(e,r,n,i){if(Dt(this.customCompletionFunction,null,this.shim),NC(this.customCompletionFunction)){let o=this.customCompletionFunction(n,r);return qe(o)?o.then(s=>{this.shim.process.nextTick(()=>{i(null,s)})}).catch(s=>{this.shim.process.nextTick(()=>{i(s,void 0)})}):i(null,o)}else return PC(this.customCompletionFunction)?this.customCompletionFunction(n,r,(o=i)=>this.defaultCompletion(e,r,n,o),o=>{i(null,o)}):this.customCompletionFunction(n,r,o=>{i(null,o)})}getCompletion(e,r){let n=e.length?e[e.length-1]:"",i=this.yargs.parse(e,!0),o=this.customCompletionFunction?s=>this.customCompletion(e,s,n,r):s=>this.defaultCompletion(e,s,n,r);return qe(i)?i.then(o):o(i)}generateCompletionScript(e,r){let n=this.zshShell?fh:ch,i=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,i),n=n.replace(/{{completion_command}}/g,r),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function ph(t,e,r,n){return new xc(t,e,r,n)}function NC(t){return t.length<3}function PC(t){return t.length>3}function dh(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;let r=[],n;for(n=0;n<=e.length;n++)r[n]=[n];let i;for(i=0;i<=t.length;i++)r[0][i]=i;for(n=1;n<=e.length;n++)for(i=1;i<=t.length;i++)e.charAt(n-1)===t.charAt(i-1)?r[n][i]=r[n-1][i-1]:n>1&&i>1&&e.charAt(n-2)===t.charAt(i-1)&&e.charAt(n-1)===t.charAt(i-2)?r[n][i]=r[n-2][i-2]+1:r[n][i]=Math.min(r[n-1][i-1]+1,Math.min(r[n][i-1]+1,r[n-1][i]+1));return r[e.length][t.length]}var hh=["$0","--","_"];function mh(t,e,r){let n=r.y18n.__,i=r.y18n.__n,o={};o.nonOptionCount=function(f){let p=t.getDemandedCommands(),m=f._.length+(f["--"]?f["--"].length:0)-t.getInternalMethods().getContext().commands.length;p._&&(m<p._.min||m>p._.max)&&(m<p._.min?p._.minMsg!==void 0?e.fail(p._.minMsg?p._.minMsg.replace(/\$0/g,m.toString()).replace(/\$1/,p._.min.toString()):null):e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",m,m.toString(),p._.min.toString())):m>p._.max&&(p._.maxMsg!==void 0?e.fail(p._.maxMsg?p._.maxMsg.replace(/\$0/g,m.toString()).replace(/\$1/,p._.max.toString()):null):e.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",m,m.toString(),p._.max.toString()))))},o.positionalCount=function(f,p){p<f&&e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",p,p+"",f+""))},o.requiredArguments=function(f,p){let d=null;for(let m of Object.keys(p))(!Object.prototype.hasOwnProperty.call(f,m)||typeof f[m]>"u")&&(d=d||{},d[m]=p[m]);if(d){let m=[];for(let g of Object.keys(d)){let b=d[g];b&&m.indexOf(b)<0&&m.push(b)}let y=m.length?`
63
59
  ${m.join(`
64
- `)}`:"";e.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(d).length,Object.keys(d).join(", ")+y))}},o.unknownArguments=function(f,p,d,m,y=!0){var g;let b=t.getInternalMethods().getCommandInstance().getCommands(),w=[],C=t.getInternalMethods().getContext();if(Object.keys(f).forEach(D=>{!Dh.includes(D)&&!Object.prototype.hasOwnProperty.call(d,D)&&!Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),D)&&!o.isValidAndSomeAliasIsNotNew(D,p)&&w.push(D)}),y&&(C.commands.length>0||b.length>0||m)&&f._.slice(C.commands.length).forEach(D=>{b.includes(""+D)||w.push(""+D)}),y){let R=((g=t.getDemandedCommands()._)===null||g===void 0?void 0:g.max)||0,S=C.commands.length+R;S<f._.length&&f._.slice(S).forEach(de=>{de=String(de),!C.commands.includes(de)&&!w.includes(de)&&w.push(de)})}w.length&&e.fail(i("Unknown argument: %s","Unknown arguments: %s",w.length,w.map(D=>D.trim()?D:`"${D}"`).join(", ")))},o.unknownCommands=function(f){let p=t.getInternalMethods().getCommandInstance().getCommands(),d=[],m=t.getInternalMethods().getContext();return(m.commands.length>0||p.length>0)&&f._.slice(m.commands.length).forEach(y=>{p.includes(""+y)||d.push(""+y)}),d.length>0?(e.fail(i("Unknown command: %s","Unknown commands: %s",d.length,d.join(", "))),!0):!1},o.isValidAndSomeAliasIsNotNew=function(f,p){if(!Object.prototype.hasOwnProperty.call(p,f))return!1;let d=t.parsed.newAliases;return[f,...p[f]].some(m=>!Object.prototype.hasOwnProperty.call(d,m)||!d[f])},o.limitedChoices=function(f){let p=t.getOptions(),d={};if(!Object.keys(p.choices).length)return;Object.keys(f).forEach(g=>{Dh.indexOf(g)===-1&&Object.prototype.hasOwnProperty.call(p.choices,g)&&[].concat(f[g]).forEach(b=>{p.choices[g].indexOf(b)===-1&&b!==void 0&&(d[g]=(d[g]||[]).concat(b))})});let m=Object.keys(d);if(!m.length)return;let y=n("Invalid values:");m.forEach(g=>{y+=`
65
- ${n("Argument: %s, Given: %s, Choices: %s",g,e.stringifiedValues(d[g]),e.stringifiedValues(p.choices[g]))}`}),e.fail(y)};let s={};o.implies=function(f,p){H("<string|object> [array|number|string]",[f,p],arguments.length),typeof f=="object"?Object.keys(f).forEach(d=>{o.implies(d,f[d])}):(t.global(f),s[f]||(s[f]=[]),Array.isArray(p)?p.forEach(d=>o.implies(f,d)):(Nt(p,void 0,r),s[f].push(p)))},o.getImplied=function(){return s};function a(c,f){let p=Number(f);return f=isNaN(p)?f:p,typeof f=="number"?f=c._.length>=f:f.match(/^--no-.+/)?(f=f.match(/^--no-(.+)/)[1],f=!Object.prototype.hasOwnProperty.call(c,f)):f=Object.prototype.hasOwnProperty.call(c,f),f}o.implications=function(f){let p=[];if(Object.keys(s).forEach(d=>{let m=d;(s[d]||[]).forEach(y=>{let g=m,b=y;g=a(f,g),y=a(f,y),g&&!y&&p.push(` ${m} -> ${b}`)})}),p.length){let d=`${n("Implications failed:")}
66
- `;p.forEach(m=>{d+=m}),e.fail(d)}};let u={};o.conflicts=function(f,p){H("<string|object> [array|string]",[f,p],arguments.length),typeof f=="object"?Object.keys(f).forEach(d=>{o.conflicts(d,f[d])}):(t.global(f),u[f]||(u[f]=[]),Array.isArray(p)?p.forEach(d=>o.conflicts(f,d)):u[f].push(p))},o.getConflicting=()=>u,o.conflicting=function(f){Object.keys(f).forEach(p=>{u[p]&&u[p].forEach(d=>{d&&f[p]!==void 0&&f[d]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",p,d))})}),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(u).forEach(p=>{u[p].forEach(d=>{d&&f[r.Parser.camelCase(p)]!==void 0&&f[r.Parser.camelCase(d)]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",p,d))})})},o.recommendCommands=function(f,p){p=p.sort((g,b)=>b.length-g.length);let m=null,y=1/0;for(let g=0,b;(b=p[g])!==void 0;g++){let w=Oh(f,b);w<=3&&w<y&&(y=w,m=b)}m&&e.fail(n("Did you mean %s?",m))},o.reset=function(f){return s=hn(s,p=>!f[p]),u=hn(u,p=>!f[p]),o};let l=[];return o.freeze=function(){l.push({implied:s,conflicting:u})},o.unfreeze=function(){let f=l.pop();Nt(f,void 0,r),{implied:s,conflicting:u}=f},o}var Tc=[],cs;function fs(t,e,r,n){cs=n;let i={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if(typeof t.extends!="string")return i;let o=/\.json|\..*rc$/.test(t.extends),s=null;if(o)s=fk(e,t.extends);else try{s=Tr.resolve(t.extends)}catch{return t}ck(s),Tc.push(s),i=o?JSON.parse(cs.readFileSync(s,"utf8")):Tr(t.extends),delete t.extends,i=fs(i,cs.path.dirname(s),r,cs)}return Tc=[],r?Fh(i,t):Object.assign({},i,t)}function ck(t){if(Tc.indexOf(t)>-1)throw new $e(`Circular extended configurations: '${t}'.`)}function fk(t,e){return cs.path.resolve(t,e)}function Fh(t,e){let r={};function n(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(r,t);for(let i of Object.keys(e))n(e[i])&&n(r[i])?r[i]=Fh(t[i],e[i]):r[i]=e[i];return r}var Y=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},h=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ot,Yn,ps,ar,Xt,Ca,gn,Zn,wa,ur,ka,lr,_r,Jt,cr,Ta,Zi,Ct,re,_a,Sa,Qt,Xn,Xi,Jn,xn,va,fe,Qn,ei,ti,ge,Ia,Sr,tt;function Qh(t){return(e=[],r=t.process.cwd(),n)=>{let i=new Lc(e,r,n,t);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var Nh=Symbol("copyDoubleDash"),Ph=Symbol("copyDoubleDash"),_c=Symbol("deleteFromParserHintObject"),Lh=Symbol("emitWarning"),Mh=Symbol("freeze"),Bh=Symbol("getDollarZero"),ri=Symbol("getParserConfiguration"),jh=Symbol("getUsageConfiguration"),Sc=Symbol("guessLocale"),Uh=Symbol("guessVersion"),zh=Symbol("parsePositionalNumbers"),vc=Symbol("pkgUp"),yn=Symbol("populateParserHintArray"),Ji=Symbol("populateParserHintSingleValueDictionary"),Ic=Symbol("populateParserHintArrayDictionary"),Oc=Symbol("populateParserHintDictionary"),Dc=Symbol("sanitizeKey"),Rc=Symbol("setKey"),Fc=Symbol("unfreeze"),$h=Symbol("validateAsync"),qh=Symbol("getCommandInstance"),Vh=Symbol("getContext"),Gh=Symbol("getHasOutput"),Wh=Symbol("getLoggerInstance"),Hh=Symbol("getParseContext"),Kh=Symbol("getUsageInstance"),Yh=Symbol("getValidationInstance"),Oa=Symbol("hasParseCallback"),Zh=Symbol("isGlobalContext"),ni=Symbol("postProcess"),Xh=Symbol("rebase"),Nc=Symbol("reset"),ds=Symbol("runYargsParserAndExecuteCommands"),Pc=Symbol("runValidation"),Jh=Symbol("setHasOutput"),ii=Symbol("kTrackManuallySetKeys"),Lc=class{constructor(e=[],r,n,i){this.customScriptName=!1,this.parsed=!1,ot.set(this,void 0),Yn.set(this,void 0),ps.set(this,{commands:[],fullCommands:[]}),ar.set(this,null),Xt.set(this,null),Ca.set(this,"show-hidden"),gn.set(this,null),Zn.set(this,!0),wa.set(this,{}),ur.set(this,!0),ka.set(this,[]),lr.set(this,void 0),_r.set(this,{}),Jt.set(this,!1),cr.set(this,null),Ta.set(this,!0),Zi.set(this,void 0),Ct.set(this,""),re.set(this,void 0),_a.set(this,void 0),Sa.set(this,{}),Qt.set(this,null),Xn.set(this,null),Xi.set(this,{}),Jn.set(this,{}),xn.set(this,void 0),va.set(this,!1),fe.set(this,void 0),Qn.set(this,!1),ei.set(this,!1),ti.set(this,!1),ge.set(this,void 0),Ia.set(this,{}),Sr.set(this,null),tt.set(this,void 0),Y(this,fe,i,"f"),Y(this,xn,e,"f"),Y(this,Yn,r,"f"),Y(this,_a,n,"f"),Y(this,lr,new ba(this),"f"),this.$0=this[Bh](),this[Nc](),Y(this,ot,h(this,ot,"f"),"f"),Y(this,ge,h(this,ge,"f"),"f"),Y(this,tt,h(this,tt,"f"),"f"),Y(this,re,h(this,re,"f"),"f"),h(this,re,"f").showHiddenOpt=h(this,Ca,"f"),Y(this,Zi,this[Ph](),"f")}addHelpOpt(e,r){let n="help";return H("[string|boolean] [string]",[e,r],arguments.length),h(this,cr,"f")&&(this[_c](h(this,cr,"f")),Y(this,cr,null,"f")),e===!1&&r===void 0?this:(Y(this,cr,typeof e=="string"?e:n,"f"),this.boolean(h(this,cr,"f")),this.describe(h(this,cr,"f"),r||h(this,ge,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(H("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;let n=typeof e=="string"?e:h(this,Ca,"f");return this.boolean(n),this.describe(n,r||h(this,ge,"f").deferY18nLookup("Show hidden options")),h(this,re,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return H("<object|string|array> [string|array]",[e,r],arguments.length),this[Ic](this.alias.bind(this),"alias",e,r),this}array(e){return H("<array|string>",[e],arguments.length),this[yn]("array",e),this[ii](e),this}boolean(e){return H("<array|string>",[e],arguments.length),this[yn]("boolean",e),this[ii](e),this}check(e,r){return H("<function> [boolean]",[e,r],arguments.length),this.middleware((n,i)=>Kn(()=>e(n,i.getOptions()),o=>(o?(typeof o=="string"||o instanceof Error)&&h(this,ge,"f").fail(o.toString(),o):h(this,ge,"f").fail(h(this,fe,"f").y18n.__("Argument check failed: %s",e.toString())),n),o=>(h(this,ge,"f").fail(o.message?o.message:o.toString(),o),n)),!1,r),this}choices(e,r){return H("<object|string|array> [string|array]",[e,r],arguments.length),this[Ic](this.choices.bind(this),"choices",e,r),this}coerce(e,r){if(H("<object|string|array> [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new $e("coerce callback must be provided");for(let n of e)this.coerce(n,r);return this}else if(typeof e=="object"){for(let n of Object.keys(e))this.coerce(n,e[n]);return this}if(!r)throw new $e("coerce callback must be provided");return h(this,re,"f").key[e]=!0,h(this,lr,"f").addCoerceMiddleware((n,i)=>{let o;return Object.prototype.hasOwnProperty.call(n,e)?Kn(()=>(o=i.getAliases(),r(n[e])),a=>{n[e]=a;let u=i.getInternalMethods().getParserConfiguration()["strip-aliased"];if(o[e]&&u!==!0)for(let l of o[e])n[l]=a;return n},a=>{throw new $e(a.message)}):n},e),this}conflicts(e,r){return H("<string|object> [string|array]",[e,r],arguments.length),h(this,tt,"f").conflicts(e,r),this}config(e="config",r,n){return H("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=fs(e,h(this,Yn,"f"),this[ri]()["deep-merge-config"]||!1,h(this,fe,"f")),h(this,re,"f").configObjects=(h(this,re,"f").configObjects||[]).concat(e),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(e,r||h(this,ge,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(i=>{h(this,re,"f").config[i]=n||!0}),this)}completion(e,r,n){return H("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),Y(this,Xt,e||h(this,Xt,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(h(this,Xt,"f"),r),n&&h(this,ar,"f").registerFunction(n),this}command(e,r,n,i,o,s){return H("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,i,o,s],arguments.length),h(this,ot,"f").addHandler(e,r,n,i,o,s),this}commands(e,r,n,i,o,s){return this.command(e,r,n,i,o,s)}commandDir(e,r){H("<string> [object]",[e,r],arguments.length);let n=h(this,_a,"f")||h(this,fe,"f").require;return h(this,ot,"f").addDirectory(e,n,h(this,fe,"f").getCallerFile(),r),this}count(e){return H("<array|string>",[e],arguments.length),this[yn]("count",e),this[ii](e),this}default(e,r,n){return H("<object|string|array> [*] [string]",[e,r,n],arguments.length),n&&(Ec(e,h(this,fe,"f")),h(this,re,"f").defaultDescription[e]=n),typeof r=="function"&&(Ec(e,h(this,fe,"f")),h(this,re,"f").defaultDescription[e]||(h(this,re,"f").defaultDescription[e]=h(this,ge,"f").functionDescription(r)),r=r.call()),this[Ji](this.default.bind(this),"default",e,r),this}defaults(e,r,n){return this.default(e,r,n)}demandCommand(e=1,r,n,i){return H("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,r,n,i],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),h(this,re,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:i},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(i=>{Nt(n,!0,h(this,fe,"f")),this.demandOption(i,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(Nt(n,!0,h(this,fe,"f")),this.demandCommand(e,r,n,n)):Array.isArray(e)?e.forEach(i=>{Nt(n,!0,h(this,fe,"f")),this.demandOption(i,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,r){return H("<object|string|array> [string]",[e,r],arguments.length),this[Ji](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return H("<string> [string|boolean]",[e,r],arguments.length),h(this,re,"f").deprecatedOptions[e]=r,this}describe(e,r){return H("<object|string|array> [string]",[e,r],arguments.length),this[Rc](e,!0),h(this,ge,"f").describe(e,r),this}detectLocale(e){return H("<boolean>",[e],arguments.length),Y(this,Zn,e,"f"),this}env(e){return H("[string|boolean]",[e],arguments.length),e===!1?delete h(this,re,"f").envPrefix:h(this,re,"f").envPrefix=e||"",this}epilogue(e){return H("<string>",[e],arguments.length),h(this,ge,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return H("<string|array> [string]",[e,r],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):h(this,ge,"f").example(e,r),this}exit(e,r){Y(this,Jt,!0,"f"),Y(this,gn,r,"f"),h(this,ur,"f")&&h(this,fe,"f").process.exit(e)}exitProcess(e=!0){return H("[boolean]",[e],arguments.length),Y(this,ur,e,"f"),this}fail(e){if(H("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new $e("Invalid first argument. Expected function or boolean 'false'");return h(this,ge,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){return H("<array> [function]",[e,r],arguments.length),r?h(this,ar,"f").getCompletion(e,r):new Promise((n,i)=>{h(this,ar,"f").getCompletion(e,(o,s)=>{o?i(o):n(s)})})}getDemandedOptions(){return H([],0),h(this,re,"f").demandedOptions}getDemandedCommands(){return H([],0),h(this,re,"f").demandedCommands}getDeprecatedOptions(){return H([],0),h(this,re,"f").deprecatedOptions}getDetectLocale(){return h(this,Zn,"f")}getExitProcess(){return h(this,ur,"f")}getGroups(){return Object.assign({},h(this,_r,"f"),h(this,Jn,"f"))}getHelp(){if(Y(this,Jt,!0,"f"),!h(this,ge,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[ds](h(this,xn,"f"),void 0,void 0,0,!0);if(qe(r))return r.then(()=>h(this,ge,"f").help())}let e=h(this,ot,"f").runDefaultBuilderOn(this);if(qe(e))return e.then(()=>h(this,ge,"f").help())}return Promise.resolve(h(this,ge,"f").help())}getOptions(){return h(this,re,"f")}getStrict(){return h(this,Qn,"f")}getStrictCommands(){return h(this,ei,"f")}getStrictOptions(){return h(this,ti,"f")}global(e,r){return H("<string|array> [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?h(this,re,"f").local=h(this,re,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{h(this,re,"f").local.includes(n)||h(this,re,"f").local.push(n)}),this}group(e,r){H("<string|array> <string>",[e,r],arguments.length);let n=h(this,Jn,"f")[r]||h(this,_r,"f")[r];h(this,Jn,"f")[r]&&delete h(this,Jn,"f")[r];let i={};return h(this,_r,"f")[r]=(n||[]).concat(e).filter(o=>i[o]?!1:i[o]=!0),this}hide(e){return H("<string>",[e],arguments.length),h(this,re,"f").hiddenOptions.push(e),this}implies(e,r){return H("<string|object> [number|string|array]",[e,r],arguments.length),h(this,tt,"f").implies(e,r),this}locale(e){return H("[string]",[e],arguments.length),e===void 0?(this[Sc](),h(this,fe,"f").y18n.getLocale()):(Y(this,Zn,!1,"f"),h(this,fe,"f").y18n.setLocale(e),this)}middleware(e,r,n){return h(this,lr,"f").addMiddleware(e,!!r,n)}nargs(e,r){return H("<string|object|array> [number]",[e,r],arguments.length),this[Ji](this.nargs.bind(this),"narg",e,r),this}normalize(e){return H("<array|string>",[e],arguments.length),this[yn]("normalize",e),this}number(e){return H("<array|string>",[e],arguments.length),this[yn]("number",e),this[ii](e),this}option(e,r){if(H("<string|object> [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[ii](e),h(this,Sr,"f")&&(e==="version"||r?.alias==="version")&&this[Lh](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
67
- `),void 0,"versionWarning"),h(this,re,"f").key[e]=!0,r.alias&&this.alias(e,r.alias);let n=r.deprecate||r.deprecated;n&&this.deprecateOption(e,n);let i=r.demand||r.required||r.require;i&&this.demand(e,i),r.demandOption&&this.demandOption(e,typeof r.demandOption=="string"?r.demandOption:void 0),r.conflicts&&this.conflicts(e,r.conflicts),"default"in r&&this.default(e,r.default),r.implies!==void 0&&this.implies(e,r.implies),r.nargs!==void 0&&this.nargs(e,r.nargs),r.config&&this.config(e,r.configParser),r.normalize&&this.normalize(e),r.choices&&this.choices(e,r.choices),r.coerce&&this.coerce(e,r.coerce),r.group&&this.group(e,r.group),(r.boolean||r.type==="boolean")&&(this.boolean(e),r.alias&&this.boolean(r.alias)),(r.array||r.type==="array")&&(this.array(e),r.alias&&this.array(r.alias)),(r.number||r.type==="number")&&(this.number(e),r.alias&&this.number(r.alias)),(r.string||r.type==="string")&&(this.string(e),r.alias&&this.string(r.alias)),(r.count||r.type==="count")&&this.count(e),typeof r.global=="boolean"&&this.global(e,r.global),r.defaultDescription&&(h(this,re,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);let o=r.describe||r.description||r.desc,s=h(this,ge,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(s,e)||typeof o=="string")&&this.describe(e,o),r.hidden&&this.hide(e),r.requiresArg&&this.requiresArg(e)}return this}options(e,r){return this.option(e,r)}parse(e,r,n){H("[string|array] [function|boolean|object] [function]",[e,r,n],arguments.length),this[Mh](),typeof e>"u"&&(e=h(this,xn,"f")),typeof r=="object"&&(Y(this,Xn,r,"f"),r=n),typeof r=="function"&&(Y(this,Qt,r,"f"),r=!1),r||Y(this,xn,e,"f"),h(this,Qt,"f")&&Y(this,ur,!1,"f");let i=this[ds](e,!!r),o=this.parsed;return h(this,ar,"f").setParsed(this.parsed),qe(i)?i.then(s=>(h(this,Qt,"f")&&h(this,Qt,"f").call(this,h(this,gn,"f"),s,h(this,Ct,"f")),s)).catch(s=>{throw h(this,Qt,"f")&&h(this,Qt,"f")(s,this.parsed.argv,h(this,Ct,"f")),s}).finally(()=>{this[Fc](),this.parsed=o}):(h(this,Qt,"f")&&h(this,Qt,"f").call(this,h(this,gn,"f"),i,h(this,Ct,"f")),this[Fc](),this.parsed=o,i)}parseAsync(e,r,n){let i=this.parse(e,r,n);return qe(i)?i:Promise.resolve(i)}parseSync(e,r,n){let i=this.parse(e,r,n);if(qe(i))throw new $e(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(e){return H("<object>",[e],arguments.length),Y(this,Sa,e,"f"),this}pkgConf(e,r){H("<string> [string]",[e,r],arguments.length);let n=null,i=this[vc](r||h(this,Yn,"f"));return i[e]&&typeof i[e]=="object"&&(n=fs(i[e],r||h(this,Yn,"f"),this[ri]()["deep-merge-config"]||!1,h(this,fe,"f")),h(this,re,"f").configObjects=(h(this,re,"f").configObjects||[]).concat(n)),this}positional(e,r){H("<string> <object>",[e,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=hn(r,(s,a)=>s==="type"&&!["string","number","boolean"].includes(a)?!1:n.includes(s));let i=h(this,ps,"f").fullCommands[h(this,ps,"f").fullCommands.length-1],o=i?h(this,ot,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return Ki(o).forEach(s=>{let a=o[s];Array.isArray(a)?a.indexOf(e)!==-1&&(r[s]=!0):a[e]&&!(s in r)&&(r[s]=a[e])}),this.group(e,h(this,ge,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return H("[boolean]",[e],arguments.length),Y(this,va,e,"f"),this}required(e,r,n){return this.demand(e,r,n)}require(e,r,n){return this.demand(e,r,n)}requiresArg(e){return H("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&h(this,re,"f").narg[e]?this:(this[Ji](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return H("[string] [string]",[e,r],arguments.length),e=e||this.$0,h(this,Zi,"f").log(h(this,ar,"f").generateCompletionScript(e,r||h(this,Xt,"f")||"completion")),this}showHelp(e){if(H("[string|function]",[e],arguments.length),Y(this,Jt,!0,"f"),!h(this,ge,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[ds](h(this,xn,"f"),void 0,void 0,0,!0);if(qe(n))return n.then(()=>{h(this,ge,"f").showHelp(e)}),this}let r=h(this,ot,"f").runDefaultBuilderOn(this);if(qe(r))return r.then(()=>{h(this,ge,"f").showHelp(e)}),this}return h(this,ge,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return H("[boolean|string] [string]",[e,r],arguments.length),h(this,ge,"f").showHelpOnFail(e,r),this}showVersion(e){return H("[string|function]",[e],arguments.length),h(this,ge,"f").showVersion(e),this}skipValidation(e){return H("<array|string>",[e],arguments.length),this[yn]("skipValidation",e),this}strict(e){return H("[boolean]",[e],arguments.length),Y(this,Qn,e!==!1,"f"),this}strictCommands(e){return H("[boolean]",[e],arguments.length),Y(this,ei,e!==!1,"f"),this}strictOptions(e){return H("[boolean]",[e],arguments.length),Y(this,ti,e!==!1,"f"),this}string(e){return H("<array|string>",[e],arguments.length),this[yn]("string",e),this[ii](e),this}terminalWidth(){return H([],0),h(this,fe,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return H("<object>",[e],arguments.length),Y(this,Zn,!1,"f"),h(this,fe,"f").y18n.updateLocale(e),this}usage(e,r,n,i){if(H("<string|null|undefined> [string|boolean] [function|object] [function]",[e,r,n,i],arguments.length),r!==void 0){if(Nt(e,null,h(this,fe,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,r,n,i);throw new $e(".usage() description must start with $0 if being used as alias for .command()")}else return h(this,ge,"f").usage(e),this}usageConfiguration(e){return H("<object>",[e],arguments.length),Y(this,Ia,e,"f"),this}version(e,r,n){let i="version";if(H("[boolean|string] [string] [string]",[e,r,n],arguments.length),h(this,Sr,"f")&&(this[_c](h(this,Sr,"f")),h(this,ge,"f").version(void 0),Y(this,Sr,null,"f")),arguments.length===0)n=this[Uh](),e=i;else if(arguments.length===1){if(e===!1)return this;n=e,e=i}else arguments.length===2&&(n=r,r=void 0);return Y(this,Sr,typeof e=="string"?e:i,"f"),r=r||h(this,ge,"f").deferY18nLookup("Show version number"),h(this,ge,"f").version(n||void 0),this.boolean(h(this,Sr,"f")),this.describe(h(this,Sr,"f"),r),this}wrap(e){return H("<number|null|undefined>",[e],arguments.length),h(this,ge,"f").wrap(e),this}[(ot=new WeakMap,Yn=new WeakMap,ps=new WeakMap,ar=new WeakMap,Xt=new WeakMap,Ca=new WeakMap,gn=new WeakMap,Zn=new WeakMap,wa=new WeakMap,ur=new WeakMap,ka=new WeakMap,lr=new WeakMap,_r=new WeakMap,Jt=new WeakMap,cr=new WeakMap,Ta=new WeakMap,Zi=new WeakMap,Ct=new WeakMap,re=new WeakMap,_a=new WeakMap,Sa=new WeakMap,Qt=new WeakMap,Xn=new WeakMap,Xi=new WeakMap,Jn=new WeakMap,xn=new WeakMap,va=new WeakMap,fe=new WeakMap,Qn=new WeakMap,ei=new WeakMap,ti=new WeakMap,ge=new WeakMap,Ia=new WeakMap,Sr=new WeakMap,tt=new WeakMap,Nh)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[Ph](){return{log:(...e)=>{this[Oa]()||console.log(...e),Y(this,Jt,!0,"f"),h(this,Ct,"f").length&&Y(this,Ct,h(this,Ct,"f")+`
68
- `,"f"),Y(this,Ct,h(this,Ct,"f")+e.join(" "),"f")},error:(...e)=>{this[Oa]()||console.error(...e),Y(this,Jt,!0,"f"),h(this,Ct,"f").length&&Y(this,Ct,h(this,Ct,"f")+`
69
- `,"f"),Y(this,Ct,h(this,Ct,"f")+e.join(" "),"f")}}}[_c](e){Ki(h(this,re,"f")).forEach(r=>{if((i=>i==="configObjects")(r))return;let n=h(this,re,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete h(this,ge,"f").getDescriptions()[e]}[Lh](e,r,n){h(this,wa,"f")[n]||(h(this,fe,"f").process.emitWarning(e,r),h(this,wa,"f")[n]=!0)}[Mh](){h(this,ka,"f").push({options:h(this,re,"f"),configObjects:h(this,re,"f").configObjects.slice(0),exitProcess:h(this,ur,"f"),groups:h(this,_r,"f"),strict:h(this,Qn,"f"),strictCommands:h(this,ei,"f"),strictOptions:h(this,ti,"f"),completionCommand:h(this,Xt,"f"),output:h(this,Ct,"f"),exitError:h(this,gn,"f"),hasOutput:h(this,Jt,"f"),parsed:this.parsed,parseFn:h(this,Qt,"f"),parseContext:h(this,Xn,"f")}),h(this,ge,"f").freeze(),h(this,tt,"f").freeze(),h(this,ot,"f").freeze(),h(this,lr,"f").freeze()}[Bh](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(h(this,fe,"f").process.argv()[0])?r=h(this,fe,"f").process.argv().slice(1,2):r=h(this,fe,"f").process.argv().slice(0,1),e=r.map(n=>{let i=this[Xh](h(this,Yn,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),h(this,fe,"f").getEnv("_")&&h(this,fe,"f").getProcessArgvBin()===h(this,fe,"f").getEnv("_")&&(e=h(this,fe,"f").getEnv("_").replace(`${h(this,fe,"f").path.dirname(h(this,fe,"f").process.execPath())}/`,"")),e}[ri](){return h(this,Sa,"f")}[jh](){return h(this,Ia,"f")}[Sc](){if(!h(this,Zn,"f"))return;let e=h(this,fe,"f").getEnv("LC_ALL")||h(this,fe,"f").getEnv("LC_MESSAGES")||h(this,fe,"f").getEnv("LANG")||h(this,fe,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[Uh](){return this[vc]().version||"unknown"}[zh](e){let r=e["--"]?e["--"]:e._;for(let n=0,i;(i=r[n])!==void 0;n++)h(this,fe,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(r[n]=Number(i));return e}[vc](e){let r=e||"*";if(h(this,Xi,"f")[r])return h(this,Xi,"f")[r];let n={};try{let i=e||h(this,fe,"f").mainFilename;!e&&h(this,fe,"f").path.extname(i)&&(i=h(this,fe,"f").path.dirname(i));let o=h(this,fe,"f").findUp(i,(s,a)=>{if(a.includes("package.json"))return"package.json"});Nt(o,void 0,h(this,fe,"f")),n=JSON.parse(h(this,fe,"f").readFileSync(o,"utf8"))}catch{}return h(this,Xi,"f")[r]=n||{},h(this,Xi,"f")[r]}[yn](e,r){r=[].concat(r),r.forEach(n=>{n=this[Dc](n),h(this,re,"f")[e].push(n)})}[Ji](e,r,n,i){this[Oc](e,r,n,i,(o,s,a)=>{h(this,re,"f")[o][s]=a})}[Ic](e,r,n,i){this[Oc](e,r,n,i,(o,s,a)=>{h(this,re,"f")[o][s]=(h(this,re,"f")[o][s]||[]).concat(a)})}[Oc](e,r,n,i,o){if(Array.isArray(n))n.forEach(s=>{e(s,i)});else if((s=>typeof s=="object")(n))for(let s of Ki(n))e(s,n[s]);else o(r,this[Dc](n),i)}[Dc](e){return e==="__proto__"?"___proto___":e}[Rc](e,r){return this[Ji](this[Rc].bind(this),"key",e,r),this}[Fc](){var e,r,n,i,o,s,a,u,l,c,f,p;let d=h(this,ka,"f").pop();Nt(d,void 0,h(this,fe,"f"));let m;e=this,r=this,n=this,i=this,o=this,s=this,a=this,u=this,l=this,c=this,f=this,p=this,{options:{set value(y){Y(e,re,y,"f")}}.value,configObjects:m,exitProcess:{set value(y){Y(r,ur,y,"f")}}.value,groups:{set value(y){Y(n,_r,y,"f")}}.value,output:{set value(y){Y(i,Ct,y,"f")}}.value,exitError:{set value(y){Y(o,gn,y,"f")}}.value,hasOutput:{set value(y){Y(s,Jt,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){Y(a,Qn,y,"f")}}.value,strictCommands:{set value(y){Y(u,ei,y,"f")}}.value,strictOptions:{set value(y){Y(l,ti,y,"f")}}.value,completionCommand:{set value(y){Y(c,Xt,y,"f")}}.value,parseFn:{set value(y){Y(f,Qt,y,"f")}}.value,parseContext:{set value(y){Y(p,Xn,y,"f")}}.value}=d,h(this,re,"f").configObjects=m,h(this,ge,"f").unfreeze(),h(this,tt,"f").unfreeze(),h(this,ot,"f").unfreeze(),h(this,lr,"f").unfreeze()}[$h](e,r){return Kn(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[qh].bind(this),getContext:this[Vh].bind(this),getHasOutput:this[Gh].bind(this),getLoggerInstance:this[Wh].bind(this),getParseContext:this[Hh].bind(this),getParserConfiguration:this[ri].bind(this),getUsageConfiguration:this[jh].bind(this),getUsageInstance:this[Kh].bind(this),getValidationInstance:this[Yh].bind(this),hasParseCallback:this[Oa].bind(this),isGlobalContext:this[Zh].bind(this),postProcess:this[ni].bind(this),reset:this[Nc].bind(this),runValidation:this[Pc].bind(this),runYargsParserAndExecuteCommands:this[ds].bind(this),setHasOutput:this[Jh].bind(this)}}[qh](){return h(this,ot,"f")}[Vh](){return h(this,ps,"f")}[Gh](){return h(this,Jt,"f")}[Wh](){return h(this,Zi,"f")}[Hh](){return h(this,Xn,"f")||{}}[Kh](){return h(this,ge,"f")}[Yh](){return h(this,tt,"f")}[Oa](){return!!h(this,Qt,"f")}[Zh](){return h(this,Ta,"f")}[ni](e,r,n,i){return n||qe(e)||(r||(e=this[Nh](e)),(this[ri]()["parse-positional-numbers"]||this[ri]()["parse-positional-numbers"]===void 0)&&(e=this[zh](e)),i&&(e=Hn(e,this,h(this,lr,"f").getMiddleware(),!1))),e}[Nc](e={}){Y(this,re,h(this,re,"f")||{},"f");let r={};r.local=h(this,re,"f").local||[],r.configObjects=h(this,re,"f").configObjects||[];let n={};r.local.forEach(s=>{n[s]=!0,(e[s]||[]).forEach(a=>{n[a]=!0})}),Object.assign(h(this,Jn,"f"),Object.keys(h(this,_r,"f")).reduce((s,a)=>{let u=h(this,_r,"f")[a].filter(l=>!(l in n));return u.length>0&&(s[a]=u),s},{})),Y(this,_r,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(s=>{r[s]=(h(this,re,"f")[s]||[]).filter(a=>!n[a])}),o.forEach(s=>{r[s]=hn(h(this,re,"f")[s],a=>!n[a])}),r.envPrefix=h(this,re,"f").envPrefix,Y(this,re,r,"f"),Y(this,ge,h(this,ge,"f")?h(this,ge,"f").reset(n):_h(this,h(this,fe,"f")),"f"),Y(this,tt,h(this,tt,"f")?h(this,tt,"f").reset(n):Rh(this,h(this,ge,"f"),h(this,fe,"f")),"f"),Y(this,ot,h(this,ot,"f")?h(this,ot,"f").reset():wh(h(this,ge,"f"),h(this,tt,"f"),h(this,lr,"f"),h(this,fe,"f")),"f"),h(this,ar,"f")||Y(this,ar,Ih(this,h(this,ge,"f"),h(this,ot,"f"),h(this,fe,"f")),"f"),h(this,lr,"f").reset(),Y(this,Xt,null,"f"),Y(this,Ct,"","f"),Y(this,gn,null,"f"),Y(this,Jt,!1,"f"),this.parsed=!1,this}[Xh](e,r){return h(this,fe,"f").path.relative(e,r)}[ds](e,r,n,i=0,o=!1){let s=!!n||o;e=e||h(this,xn,"f"),h(this,re,"f").__=h(this,fe,"f").y18n.__,h(this,re,"f").configuration=this[ri]();let a=!!h(this,re,"f").configuration["populate--"],u=Object.assign({},h(this,re,"f").configuration,{"populate--":!0}),l=h(this,fe,"f").Parser.detailed(e,Object.assign({},h(this,re,"f"),{configuration:{"parse-positional-numbers":!1,...u}})),c=Object.assign(l.argv,h(this,Xn,"f")),f,p=l.aliases,d=!1,m=!1;Object.keys(c).forEach(y=>{y===h(this,cr,"f")&&c[y]?d=!0:y===h(this,Sr,"f")&&c[y]&&(m=!0)}),c.$0=this.$0,this.parsed=l,i===0&&h(this,ge,"f").clearCachedHelpMessage();try{if(this[Sc](),r)return this[ni](c,a,!!n,!1);h(this,cr,"f")&&[h(this,cr,"f")].concat(p[h(this,cr,"f")]||[]).filter(C=>C.length>1).includes(""+c._[c._.length-1])&&(c._.pop(),d=!0),Y(this,Ta,!1,"f");let y=h(this,ot,"f").getCommands(),g=h(this,ar,"f").completionKey in c,b=d||g||o;if(c._.length){if(y.length){let w;for(let C=i||0,D;c._[C]!==void 0;C++)if(D=String(c._[C]),y.includes(D)&&D!==h(this,Xt,"f")){let R=h(this,ot,"f").runCommand(D,this,l,C+1,o,d||m||o);return this[ni](R,a,!!n,!1)}else if(!w&&D!==h(this,Xt,"f")){w=D;break}!h(this,ot,"f").hasDefaultCommand()&&h(this,va,"f")&&w&&!b&&h(this,tt,"f").recommendCommands(w,y)}h(this,Xt,"f")&&c._.includes(h(this,Xt,"f"))&&!g&&(h(this,ur,"f")&&mn(!0),this.showCompletionScript(),this.exit(0))}if(h(this,ot,"f").hasDefaultCommand()&&!b){let w=h(this,ot,"f").runCommand(null,this,l,0,o,d||m||o);return this[ni](w,a,!!n,!1)}if(g){h(this,ur,"f")&&mn(!0),e=[].concat(e);let w=e.slice(e.indexOf(`--${h(this,ar,"f").completionKey}`)+1);return h(this,ar,"f").getCompletion(w,(C,D)=>{if(C)throw new $e(C.message);(D||[]).forEach(R=>{h(this,Zi,"f").log(R)}),this.exit(0)}),this[ni](c,!a,!!n,!1)}if(h(this,Jt,"f")||(d?(h(this,ur,"f")&&mn(!0),s=!0,this.showHelp("log"),this.exit(0)):m&&(h(this,ur,"f")&&mn(!0),s=!0,h(this,ge,"f").showVersion("log"),this.exit(0))),!s&&h(this,re,"f").skipValidation.length>0&&(s=Object.keys(c).some(w=>h(this,re,"f").skipValidation.indexOf(w)>=0&&c[w]===!0)),!s){if(l.error)throw new $e(l.error.message);if(!g){let w=this[Pc](p,{},l.error);n||(f=Hn(c,this,h(this,lr,"f").getMiddleware(),!0)),f=this[$h](w,f??c),qe(f)&&!n&&(f=f.then(()=>Hn(c,this,h(this,lr,"f").getMiddleware(),!1)))}}}catch(y){if(y instanceof $e)h(this,ge,"f").fail(y.message,y);else throw y}return this[ni](f??c,a,!!n,!0)}[Pc](e,r,n,i){let o={...this.getDemandedOptions()};return s=>{if(n)throw new $e(n.message);h(this,tt,"f").nonOptionCount(s),h(this,tt,"f").requiredArguments(s,o);let a=!1;h(this,ei,"f")&&(a=h(this,tt,"f").unknownCommands(s)),h(this,Qn,"f")&&!a?h(this,tt,"f").unknownArguments(s,e,r,!!i):h(this,ti,"f")&&h(this,tt,"f").unknownArguments(s,e,{},!1,!1),h(this,tt,"f").limitedChoices(s),h(this,tt,"f").implications(s),h(this,tt,"f").conflicting(s)}}[Jh](){Y(this,Jt,!0,"f")}[ii](e){if(typeof e=="string")h(this,re,"f").key[e]=!0;else for(let r of e)h(this,re,"f").key[r]=!0}};function kh(t){return!!t&&typeof t.getInternalMethods=="function"}var pk=Qh(bc),em=pk;var tm="1.0.0";import{cosmiconfig as _m}from"cosmiconfig";import{TypeScriptLoader as Sm}from"cosmiconfig-typescript-loader";import MT from"node:fs/promises";import Om from"node:path";var Mc=jd(im(),1);function Bc(t,e,r){if(typeof e=="number"&&(r=e),Mc.default.has(t.toLowerCase())){e=Mc.default.get(t.toLowerCase());let n=t.charAt(0);n===n.toUpperCase()&&(e=n+e.slice(1)),t===t.toUpperCase()&&(e=e.toUpperCase())}else typeof e!="string"&&(e=(t.replace(/(?:s|x|z|ch|sh)$/i,"$&e").replace(/([^aeiou])y$/i,"$1ie")+"s").replace(/i?e?s$/i,n=>t.slice(-1)===t.slice(-1).toLowerCase()?n.toLowerCase():n.toUpperCase()));return Math.abs(r)===1?t:e}import{readPackage as BT}from"read-pkg";import{deepMergeDefined as Yc,log as dr,optionsSchema as jT,rulesSchema as UT}from"remark-mdat";var Oe;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},t.getValidEnumValues=i=>{let o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(let a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(let s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=n,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Oe||(Oe={}));var Uc;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Uc||(Uc={}));var V=Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xr=t=>{switch(typeof t){case"undefined":return V.undefined;case"string":return V.string;case"number":return isNaN(t)?V.nan:V.number;case"boolean":return V.boolean;case"function":return V.function;case"bigint":return V.bigint;case"symbol":return V.symbol;case"object":return Array.isArray(t)?V.array:t===null?V.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?V.promise:typeof Map<"u"&&t instanceof Map?V.map:typeof Set<"u"&&t instanceof Set?V.set:typeof Date<"u"&&t instanceof Date?V.date:V.object;default:return V.unknown}},N=Oe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),gk=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),er=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(o){return o.message},n={_errors:[]},i=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,u=0;for(;u<s.path.length;){let l=s.path[u];u===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(r(s))):a[l]=a[l]||{_errors:[]},a=a[l],u++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};er.create=t=>new er(t);var to=(t,e)=>{let r;switch(t.code){case N.invalid_type:t.received===V.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case N.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Oe.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:r=`Unrecognized key(s) in object: ${Oe.joinValues(t.keys,", ")}`;break;case N.invalid_union:r="Invalid input";break;case N.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Oe.joinValues(t.options)}`;break;case N.invalid_enum_value:r=`Invalid enum value. Expected ${Oe.joinValues(t.options)}, received '${t.received}'`;break;case N.invalid_arguments:r="Invalid function arguments";break;case N.invalid_return_type:r="Invalid function return type";break;case N.invalid_date:r="Invalid date";break;case N.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Oe.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case N.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case N.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case N.custom:r="Invalid input";break;case N.invalid_intersection_types:r="Intersection results could not be merged";break;case N.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case N.not_finite:r="Number must be finite";break;default:r=e.defaultError,Oe.assertNever(t)}return{message:r}},um=to;function xk(t){um=t}function Da(){return um}var Ra=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,o=[...r,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="",u=n.filter(l=>!!l).slice().reverse();for(let l of u)a=l(s,{data:e,defaultError:a}).message;return{...i,path:o,message:a}},yk=[];function U(t,e){let r=Da(),n=Ra({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===to?void 0:to].filter(i=>!!i)});t.common.issues.push(n)}var vt=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return pe;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let o=await i.key,s=await i.value;n.push({key:o,value:s})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return pe;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[o.value]=s.value)}return{status:e.value,value:n}}},pe=Object.freeze({status:"aborted"}),eo=t=>({status:"dirty",value:t}),Pt=t=>({status:"valid",value:t}),zc=t=>t.status==="aborted",$c=t=>t.status==="dirty",oi=t=>t.status==="valid",gs=t=>typeof Promise<"u"&&t instanceof Promise;function Fa(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function lm(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var Q;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Q||(Q={}));var hs,ms,pr=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},om=(t,e)=>{if(oi(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new er(t.common.issues);return this._error=r,this._error}}};function Ae(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{var u,l;let{message:c}=t;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:(u=c??n)!==null&&u!==void 0?u:a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:(l=c??r)!==null&&l!==void 0?l:a.defaultError}},description:i}}var Ce=class{get description(){return this._def.description}_getType(e){return Xr(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Xr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new vt,ctx:{common:e.parent.common,data:e.data,parsedType:Xr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(gs(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let i={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xr(e)},o=this._parseSync({data:e,path:i.path,parent:i});return om(i,o)}"~validate"(e){var r,n;let i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xr(e)};if(!this["~standard"].async)try{let o=this._parseSync({data:e,path:[],parent:i});return oi(o)?{value:o.value}:{issues:i.common.issues}}catch(o){!((n=(r=o?.message)===null||r===void 0?void 0:r.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:i}).then(o=>oi(o)?{value:o.value}:{issues:i.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xr(e)},i=this._parse({data:e,path:n.path,parent:n}),o=await(gs(i)?i:Promise.resolve(i));return om(n,o)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,o)=>{let s=e(i),a=()=>o.addIssue({code:N.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new tr({schema:this,typeName:le.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return fr.create(this,this._def)}nullable(){return Ir.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qr.create(this)}promise(){return An.create(this,this._def)}or(e){return pi.create([this,e],this._def)}and(e){return di.create(this,e,this._def)}transform(e){return new tr({...Ae(this._def),schema:this,typeName:le.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new yi({...Ae(this._def),innerType:this,defaultValue:r,typeName:le.ZodDefault})}brand(){return new xs({typeName:le.ZodBranded,type:this,...Ae(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new bi({...Ae(this._def),innerType:this,catchValue:r,typeName:le.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return ys.create(this,e)}readonly(){return Ei.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},bk=/^c[^\s-]{8,}$/i,Ek=/^[0-9a-z]+$/,Ak=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ck=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,wk=/^[a-z0-9_-]{21}$/i,kk=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Tk=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_k=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Sk="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",jc,vk=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ik=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Ok=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Dk=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Rk=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Fk=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,cm="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Nk=new RegExp(`^${cm}$`);function fm(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Pk(t){return new RegExp(`^${fm(t)}$`)}function pm(t){let e=`${cm}T${fm(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Lk(t,e){return!!((e==="v4"||!e)&&vk.test(t)||(e==="v6"||!e)&&Ok.test(t))}function Mk(t,e){if(!kk.test(t))return!1;try{let[r]=t.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||!i.typ||!i.alg||e&&i.alg!==e)}catch{return!1}}function Bk(t,e){return!!((e==="v4"||!e)&&Ik.test(t)||(e==="v6"||!e)&&Dk.test(t))}var bn=class t extends Ce{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==V.string){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_type,expected:V.string,received:o.parsedType}),pe}let n=new vt,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?U(i,{code:N.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&U(i,{code:N.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")_k.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"email",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")jc||(jc=new RegExp(Sk,"u")),jc.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"emoji",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Ck.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"uuid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")wk.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"nanoid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")bk.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")Ek.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid2",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")Ak.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ulid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),U(i,{validation:"url",code:N.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"regex",code:N.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?pm(o).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?Nk.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?Pk(o).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Tk.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"duration",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?Lk(e.data,o.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ip",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?Mk(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"jwt",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?Bk(e.data,o.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cidr",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?Rk.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?Fk.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64url",code:N.invalid_string,message:o.message}),n.dirty()):Oe.assertNever(o);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:N.invalid_string,...Q.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Q.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Q.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Q.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Q.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Q.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Q.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Q.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Q.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Q.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Q.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Q.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Q.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Q.errToObj(e)})}datetime(e){var r,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(n=e?.local)!==null&&n!==void 0?n:!1,...Q.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Q.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Q.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Q.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...Q.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Q.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Q.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Q.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Q.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Q.errToObj(r)})}nonempty(e){return this.min(1,Q.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};bn.create=t=>{var e;return new bn({checks:[],typeName:le.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Ae(t)})};function jk(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,o=parseInt(t.toFixed(i).replace(".","")),s=parseInt(e.toFixed(i).replace(".",""));return o%s/Math.pow(10,i)}var si=class t extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==V.number){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_type,expected:V.number,received:o.parsedType}),pe}let n,i=new vt;for(let o of this._def.checks)o.kind==="int"?Oe.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:N.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?jk(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:N.not_finite,message:o.message}),i.dirty()):Oe.assertNever(o);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Q.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Q.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Q.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Q.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Q.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Q.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Q.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Q.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Q.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Q.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Q.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Oe.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};si.create=t=>new si({checks:[],typeName:le.ZodNumber,coerce:t?.coerce||!1,...Ae(t)});var ai=class t extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==V.bigint)return this._getInvalidInput(e);let n,i=new vt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Oe.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return U(r,{code:N.invalid_type,expected:V.bigint,received:r.parsedType}),pe}gte(e,r){return this.setLimit("min",e,!0,Q.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Q.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Q.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Q.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Q.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Q.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Q.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};ai.create=t=>{var e;return new ai({checks:[],typeName:le.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Ae(t)})};var ui=class extends Ce{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==V.boolean){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.boolean,received:n.parsedType}),pe}return Pt(e.data)}};ui.create=t=>new ui({typeName:le.ZodBoolean,coerce:t?.coerce||!1,...Ae(t)});var li=class t extends Ce{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==V.date){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_type,expected:V.date,received:o.parsedType}),pe}if(isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_date}),pe}let n=new vt,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Oe.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Q.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Q.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};li.create=t=>new li({checks:[],coerce:t?.coerce||!1,typeName:le.ZodDate,...Ae(t)});var ro=class extends Ce{_parse(e){if(this._getType(e)!==V.symbol){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.symbol,received:n.parsedType}),pe}return Pt(e.data)}};ro.create=t=>new ro({typeName:le.ZodSymbol,...Ae(t)});var ci=class extends Ce{_parse(e){if(this._getType(e)!==V.undefined){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.undefined,received:n.parsedType}),pe}return Pt(e.data)}};ci.create=t=>new ci({typeName:le.ZodUndefined,...Ae(t)});var fi=class extends Ce{_parse(e){if(this._getType(e)!==V.null){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.null,received:n.parsedType}),pe}return Pt(e.data)}};fi.create=t=>new fi({typeName:le.ZodNull,...Ae(t)});var En=class extends Ce{constructor(){super(...arguments),this._any=!0}_parse(e){return Pt(e.data)}};En.create=t=>new En({typeName:le.ZodAny,...Ae(t)});var Jr=class extends Ce{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Pt(e.data)}};Jr.create=t=>new Jr({typeName:le.ZodUnknown,...Ae(t)});var Er=class extends Ce{_parse(e){let r=this._getOrReturnCtx(e);return U(r,{code:N.invalid_type,expected:V.never,received:r.parsedType}),pe}};Er.create=t=>new Er({typeName:le.ZodNever,...Ae(t)});var no=class extends Ce{_parse(e){if(this._getType(e)!==V.undefined){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.void,received:n.parsedType}),pe}return Pt(e.data)}};no.create=t=>new no({typeName:le.ZodVoid,...Ae(t)});var Qr=class t extends Ce{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==V.array)return U(r,{code:N.invalid_type,expected:V.array,received:r.parsedType}),pe;if(i.exactLength!==null){let s=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(s||a)&&(U(r,{code:s?N.too_big:N.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(U(r,{code:N.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(U(r,{code:N.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>i.type._parseAsync(new pr(r,s,r.path,a)))).then(s=>vt.mergeArray(n,s));let o=[...r.data].map((s,a)=>i.type._parseSync(new pr(r,s,r.path,a)));return vt.mergeArray(n,o)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:Q.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:Q.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:Q.toString(r)}})}nonempty(e){return this.min(1,e)}};Qr.create=(t,e)=>new Qr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:le.ZodArray,...Ae(e)});function Qi(t){if(t instanceof Vt){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=fr.create(Qi(n))}return new Vt({...t._def,shape:()=>e})}else return t instanceof Qr?new Qr({...t._def,type:Qi(t.element)}):t instanceof fr?fr.create(Qi(t.unwrap())):t instanceof Ir?Ir.create(Qi(t.unwrap())):t instanceof vr?vr.create(t.items.map(e=>Qi(e))):t}var Vt=class t extends Ce{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Oe.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==V.object){let l=this._getOrReturnCtx(e);return U(l,{code:N.invalid_type,expected:V.object,received:l.parsedType}),pe}let{status:n,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Er&&this._def.unknownKeys==="strip"))for(let l in i.data)s.includes(l)||a.push(l);let u=[];for(let l of s){let c=o[l],f=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new pr(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Er){let l=this._def.unknownKeys;if(l==="passthrough")for(let c of a)u.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict")a.length>0&&(U(i,{code:N.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let c of a){let f=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new pr(i,f,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let c of u){let f=await c.key,p=await c.value;l.push({key:f,value:p,alwaysSet:c.alwaysSet})}return l}).then(l=>vt.mergeObjectSync(n,l)):vt.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return Q.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,o,s,a;let u=(s=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,r,n).message)!==null&&s!==void 0?s:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=Q.errToObj(e).message)!==null&&a!==void 0?a:u}:{message:u}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:le.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return Oe.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return Oe.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}deepPartial(){return Qi(this)}partial(e){let r={};return Oe.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return Oe.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof fr;)o=o._def.innerType;r[n]=o}}),new t({...this._def,shape:()=>r})}keyof(){return dm(Oe.objectKeys(this.shape))}};Vt.create=(t,e)=>new Vt({shape:()=>t,unknownKeys:"strip",catchall:Er.create(),typeName:le.ZodObject,...Ae(e)});Vt.strictCreate=(t,e)=>new Vt({shape:()=>t,unknownKeys:"strict",catchall:Er.create(),typeName:le.ZodObject,...Ae(e)});Vt.lazycreate=(t,e)=>new Vt({shape:t,unknownKeys:"strip",catchall:Er.create(),typeName:le.ZodObject,...Ae(e)});var pi=class extends Ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new er(a.ctx.common.issues));return U(r,{code:N.invalid_union,unionErrors:s}),pe}if(r.common.async)return Promise.all(n.map(async o=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let u of n){let l={...r,common:{...r.common,issues:[]},parent:null},c=u._parseSync({data:r.data,path:r.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(u=>new er(u));return U(r,{code:N.invalid_union,unionErrors:a}),pe}}get options(){return this._def.options}};pi.create=(t,e)=>new pi({options:t,typeName:le.ZodUnion,...Ae(e)});var Zr=t=>t instanceof hi?Zr(t.schema):t instanceof tr?Zr(t.innerType()):t instanceof mi?[t.value]:t instanceof gi?t.options:t instanceof xi?Oe.objectValues(t.enum):t instanceof yi?Zr(t._def.innerType):t instanceof ci?[void 0]:t instanceof fi?[null]:t instanceof fr?[void 0,...Zr(t.unwrap())]:t instanceof Ir?[null,...Zr(t.unwrap())]:t instanceof xs||t instanceof Ei?Zr(t.unwrap()):t instanceof bi?Zr(t._def.innerType):[],Na=class t extends Ce{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==V.object)return U(r,{code:N.invalid_type,expected:V.object,received:r.parsedType}),pe;let n=this.discriminator,i=r.data[n],o=this.optionsMap.get(i);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(U(r,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let o of r){let s=Zr(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new t({typeName:le.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Ae(n)})}};function qc(t,e){let r=Xr(t),n=Xr(e);if(t===e)return{valid:!0,data:t};if(r===V.object&&n===V.object){let i=Oe.objectKeys(e),o=Oe.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(let a of o){let u=qc(t[a],e[a]);if(!u.valid)return{valid:!1};s[a]=u.data}return{valid:!0,data:s}}else if(r===V.array&&n===V.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<t.length;o++){let s=t[o],a=e[o],u=qc(s,a);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===V.date&&n===V.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var di=class extends Ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(o,s)=>{if(zc(o)||zc(s))return pe;let a=qc(o.value,s.value);return a.valid?(($c(o)||$c(s))&&r.dirty(),{status:r.value,value:a.data}):(U(n,{code:N.invalid_intersection_types}),pe)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};di.create=(t,e,r)=>new di({left:t,right:e,typeName:le.ZodIntersection,...Ae(r)});var vr=class t extends Ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.array)return U(n,{code:N.invalid_type,expected:V.array,received:n.parsedType}),pe;if(n.data.length<this._def.items.length)return U(n,{code:N.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pe;!this._def.rest&&n.data.length>this._def.items.length&&(U(n,{code:N.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((s,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new pr(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>vt.mergeArray(r,s)):vt.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};vr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new vr({items:t,typeName:le.ZodTuple,rest:null,...Ae(e)})};var Pa=class t extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.object)return U(n,{code:N.invalid_type,expected:V.object,received:n.parsedType}),pe;let i=[],o=this._def.keyType,s=this._def.valueType;for(let a in n.data)i.push({key:o._parse(new pr(n,a,n.path,a)),value:s._parse(new pr(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?vt.mergeObjectAsync(r,i):vt.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof Ce?new t({keyType:e,valueType:r,typeName:le.ZodRecord,...Ae(n)}):new t({keyType:bn.create(),valueType:e,typeName:le.ZodRecord,...Ae(r)})}},io=class extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.map)return U(n,{code:N.invalid_type,expected:V.map,received:n.parsedType}),pe;let i=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([a,u],l)=>({key:i._parse(new pr(n,a,n.path,[l,"key"])),value:o._parse(new pr(n,u,n.path,[l,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of s){let l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return pe;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),a.set(l.value,c.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let u of s){let l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return pe;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),a.set(l.value,c.value)}return{status:r.value,value:a}}}};io.create=(t,e,r)=>new io({valueType:e,keyType:t,typeName:le.ZodMap,...Ae(r)});var oo=class t extends Ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.set)return U(n,{code:N.invalid_type,expected:V.set,received:n.parsedType}),pe;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(U(n,{code:N.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(U(n,{code:N.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let o=this._def.valueType;function s(u){let l=new Set;for(let c of u){if(c.status==="aborted")return pe;c.status==="dirty"&&r.dirty(),l.add(c.value)}return{status:r.value,value:l}}let a=[...n.data.values()].map((u,l)=>o._parse(new pr(n,u,n.path,l)));return n.common.async?Promise.all(a).then(u=>s(u)):s(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:Q.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:Q.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};oo.create=(t,e)=>new oo({valueType:t,minSize:null,maxSize:null,typeName:le.ZodSet,...Ae(e)});var La=class t extends Ce{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==V.function)return U(r,{code:N.invalid_type,expected:V.function,received:r.parsedType}),pe;function n(a,u){return Ra({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Da(),to].filter(l=>!!l),issueData:{code:N.invalid_arguments,argumentsError:u}})}function i(a,u){return Ra({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Da(),to].filter(l=>!!l),issueData:{code:N.invalid_return_type,returnTypeError:u}})}let o={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof An){let a=this;return Pt(async function(...u){let l=new er([]),c=await a._def.args.parseAsync(u,o).catch(d=>{throw l.addIssue(n(u,d)),l}),f=await Reflect.apply(s,this,c);return await a._def.returns._def.type.parseAsync(f,o).catch(d=>{throw l.addIssue(i(f,d)),l})})}else{let a=this;return Pt(function(...u){let l=a._def.args.safeParse(u,o);if(!l.success)throw new er([n(u,l.error)]);let c=Reflect.apply(s,this,l.data),f=a._def.returns.safeParse(c,o);if(!f.success)throw new er([i(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:vr.create(e).rest(Jr.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||vr.create([]).rest(Jr.create()),returns:r||Jr.create(),typeName:le.ZodFunction,...Ae(n)})}},hi=class extends Ce{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};hi.create=(t,e)=>new hi({getter:t,typeName:le.ZodLazy,...Ae(e)});var mi=class extends Ce{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return U(r,{received:r.data,code:N.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:e.data}}get value(){return this._def.value}};mi.create=(t,e)=>new mi({value:t,typeName:le.ZodLiteral,...Ae(e)});function dm(t,e){return new gi({values:t,typeName:le.ZodEnum,...Ae(e)})}var gi=class t extends Ce{constructor(){super(...arguments),hs.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return U(r,{expected:Oe.joinValues(n),received:r.parsedType,code:N.invalid_type}),pe}if(Fa(this,hs,"f")||lm(this,hs,new Set(this._def.values),"f"),!Fa(this,hs,"f").has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return U(r,{received:r.data,code:N.invalid_enum_value,options:n}),pe}return Pt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};hs=new WeakMap;gi.create=dm;var xi=class extends Ce{constructor(){super(...arguments),ms.set(this,void 0)}_parse(e){let r=Oe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==V.string&&n.parsedType!==V.number){let i=Oe.objectValues(r);return U(n,{expected:Oe.joinValues(i),received:n.parsedType,code:N.invalid_type}),pe}if(Fa(this,ms,"f")||lm(this,ms,new Set(Oe.getValidEnumValues(this._def.values)),"f"),!Fa(this,ms,"f").has(e.data)){let i=Oe.objectValues(r);return U(n,{received:n.data,code:N.invalid_enum_value,options:i}),pe}return Pt(e.data)}get enum(){return this._def.values}};ms=new WeakMap;xi.create=(t,e)=>new xi({values:t,typeName:le.ZodNativeEnum,...Ae(e)});var An=class extends Ce{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==V.promise&&r.common.async===!1)return U(r,{code:N.invalid_type,expected:V.promise,received:r.parsedType}),pe;let n=r.parsedType===V.promise?r.data:Promise.resolve(r.data);return Pt(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};An.create=(t,e)=>new An({type:t,typeName:le.ZodPromise,...Ae(e)});var tr=class extends Ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===le.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{U(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return pe;let u=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return u.status==="aborted"?pe:u.status==="dirty"||r.value==="dirty"?eo(u.value):u});{if(r.value==="aborted")return pe;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?pe:a.status==="dirty"||r.value==="dirty"?eo(a.value):a}}if(i.type==="refinement"){let s=a=>{let u=i.refinement(a,o);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?pe:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?pe:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!oi(s))return s;let a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>oi(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:r.value,value:a})):s);Oe.assertNever(i)}};tr.create=(t,e,r)=>new tr({schema:t,typeName:le.ZodEffects,effect:e,...Ae(r)});tr.createWithPreprocess=(t,e,r)=>new tr({schema:e,effect:{type:"preprocess",transform:t},typeName:le.ZodEffects,...Ae(r)});var fr=class extends Ce{_parse(e){return this._getType(e)===V.undefined?Pt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};fr.create=(t,e)=>new fr({innerType:t,typeName:le.ZodOptional,...Ae(e)});var Ir=class extends Ce{_parse(e){return this._getType(e)===V.null?Pt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ir.create=(t,e)=>new Ir({innerType:t,typeName:le.ZodNullable,...Ae(e)});var yi=class extends Ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===V.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};yi.create=(t,e)=>new yi({innerType:t,typeName:le.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ae(e)});var bi=class extends Ce{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return gs(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new er(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new er(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};bi.create=(t,e)=>new bi({innerType:t,typeName:le.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ae(e)});var so=class extends Ce{_parse(e){if(this._getType(e)!==V.nan){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.nan,received:n.parsedType}),pe}return{status:"valid",value:e.data}}};so.create=t=>new so({typeName:le.ZodNaN,...Ae(t)});var Uk=Symbol("zod_brand"),xs=class extends Ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},ys=class t extends Ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?pe:o.status==="dirty"?(r.dirty(),eo(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?pe:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:le.ZodPipeline})}},Ei=class extends Ce{_parse(e){let r=this._def.innerType._parse(e),n=i=>(oi(i)&&(i.value=Object.freeze(i.value)),i);return gs(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};Ei.create=(t,e)=>new Ei({innerType:t,typeName:le.ZodReadonly,...Ae(e)});function sm(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function hm(t,e={},r){return t?En.create().superRefine((n,i)=>{var o,s;let a=t(n);if(a instanceof Promise)return a.then(u=>{var l,c;if(!u){let f=sm(e,n),p=(c=(l=f.fatal)!==null&&l!==void 0?l:r)!==null&&c!==void 0?c:!0;i.addIssue({code:"custom",...f,fatal:p})}});if(!a){let u=sm(e,n),l=(s=(o=u.fatal)!==null&&o!==void 0?o:r)!==null&&s!==void 0?s:!0;i.addIssue({code:"custom",...u,fatal:l})}}):En.create()}var zk={object:Vt.lazycreate},le;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(le||(le={}));var $k=(t,e={message:`Input not instance of ${t.name}`})=>hm(r=>r instanceof t,e),mm=bn.create,gm=si.create,qk=so.create,Vk=ai.create,xm=ui.create,Gk=li.create,Wk=ro.create,Hk=ci.create,Kk=fi.create,Yk=En.create,Zk=Jr.create,Xk=Er.create,Jk=no.create,Qk=Qr.create,eT=Vt.create,tT=Vt.strictCreate,rT=pi.create,nT=Na.create,iT=di.create,oT=vr.create,sT=Pa.create,aT=io.create,uT=oo.create,lT=La.create,cT=hi.create,fT=mi.create,pT=gi.create,dT=xi.create,hT=An.create,am=tr.create,mT=fr.create,gT=Ir.create,xT=tr.createWithPreprocess,yT=ys.create,bT=()=>mm().optional(),ET=()=>gm().optional(),AT=()=>xm().optional(),CT={string:t=>bn.create({...t,coerce:!0}),number:t=>si.create({...t,coerce:!0}),boolean:t=>ui.create({...t,coerce:!0}),bigint:t=>ai.create({...t,coerce:!0}),date:t=>li.create({...t,coerce:!0})},wT=pe,X=Object.freeze({__proto__:null,defaultErrorMap:to,setErrorMap:xk,getErrorMap:Da,makeIssue:Ra,EMPTY_PATH:yk,addIssueToContext:U,ParseStatus:vt,INVALID:pe,DIRTY:eo,OK:Pt,isAborted:zc,isDirty:$c,isValid:oi,isAsync:gs,get util(){return Oe},get objectUtil(){return Uc},ZodParsedType:V,getParsedType:Xr,ZodType:Ce,datetimeRegex:pm,ZodString:bn,ZodNumber:si,ZodBigInt:ai,ZodBoolean:ui,ZodDate:li,ZodSymbol:ro,ZodUndefined:ci,ZodNull:fi,ZodAny:En,ZodUnknown:Jr,ZodNever:Er,ZodVoid:no,ZodArray:Qr,ZodObject:Vt,ZodUnion:pi,ZodDiscriminatedUnion:Na,ZodIntersection:di,ZodTuple:vr,ZodRecord:Pa,ZodMap:io,ZodSet:oo,ZodFunction:La,ZodLazy:hi,ZodLiteral:mi,ZodEnum:gi,ZodNativeEnum:xi,ZodPromise:An,ZodEffects:tr,ZodTransformer:tr,ZodOptional:fr,ZodNullable:Ir,ZodDefault:yi,ZodCatch:bi,ZodNaN:so,BRAND:Uk,ZodBranded:xs,ZodPipeline:ys,ZodReadonly:Ei,custom:hm,Schema:Ce,ZodSchema:Ce,late:zk,get ZodFirstPartyTypeKind(){return le},coerce:CT,any:Yk,array:Qk,bigint:Vk,boolean:xm,date:Gk,discriminatedUnion:nT,effect:am,enum:pT,function:lT,instanceof:$k,intersection:iT,lazy:cT,literal:fT,map:aT,nan:qk,nativeEnum:dT,never:Xk,null:Kk,nullable:gT,number:gm,object:eT,oboolean:AT,onumber:ET,optional:mT,ostring:bT,pipeline:yT,preprocess:xT,promise:hT,record:sT,set:uT,strictObject:tT,string:mm,symbol:Wk,transformer:am,tuple:oT,undefined:Hk,union:rT,unknown:Zk,void:Jk,NEVER:wT,ZodIssueCode:N,quotelessJson:gk,ZodError:er});import{defaultLoaders as kT}from"cosmiconfig";function Vc(t,e){let r=kT[".json"],n=r(t,e);return ym(n)}function ym(t,e="",r={}){for(let[n,i]of Object.entries(t)){let o=e?`${e}.${n}`:n;typeof i=="object"&&i!==null&&!Array.isArray(i)?ym(i,o,r):i===null?r[o]="null":r[o]=i.toString()}return r}import FT from"node:fs";import en from"node:path";import IT from"node:process";import TT from"node:process";import _T from"node:fs/promises";import{fileURLToPath as ST}from"node:url";import ao from"node:path";var bm=t=>t instanceof URL?ST(t):t;async function Ma(t,{cwd:e=TT.cwd(),type:r="file",stopAt:n}={}){let i=ao.resolve(bm(e)??""),{root:o}=ao.parse(i);n=ao.resolve(i,bm(n??o));let s=ao.isAbsolute(t);for(;i;){let a=s?t:ao.join(i,t);try{let u=await _T.stat(a);if(r==="file"&&u.isFile()||r==="directory"&&u.isDirectory())return a}catch{}if(i===n||i===o)break;i=ao.dirname(i)}}async function Em({cwd:t=IT.cwd()}={}){return Ma("package.json",{cwd:t})}import OT from"node:fs";import DT from"node:fs/promises";async function Gc(t,e,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return(await DT[t](r))[e]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}function Wc(t,e,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return OT[t](r)[e]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}var uo=Gc.bind(void 0,"stat","isFile"),s2=Gc.bind(void 0,"stat","isDirectory"),a2=Gc.bind(void 0,"lstat","isSymbolicLink"),Hc=Wc.bind(void 0,"statSync","isFile"),u2=Wc.bind(void 0,"statSync","isDirectory"),l2=Wc.bind(void 0,"lstatSync","isSymbolicLink");import{log as Cm}from"remark-mdat";import{Configuration as NT}from"unified-engine";import RT from"node:os";var Am=RT.homedir();function Kc(t){if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return Am?t.replace(/^~(?=$|\/|\\)/,Am):t}function PT(t,e){let r=e===0?1:Math.floor(Math.log10(Math.abs(e))+1);return t.toString().padStart(r,"0")}function km(t,e,r,n){let i=[];for(let[o,s]of t.entries()){let a=r&&t.length>1?`-${PT(o+1,t.length+1)}`:"",u=LT(s,e,r,n,a);i.push(u)}return i}function LT(t,e,r,n,i=""){let o=wm(t),s=e?wm(e):void 0;if(!Hc(o))throw new Error(`Input file not found: "${o}"`);if(s){if(Hc(s))throw new Error(`Output path must be a directory, received a file path: "${s}"`);FT.mkdirSync(s,{recursive:!0})}let a=r?en.basename(r,en.extname(r)):en.basename(o,en.extname(o)),u=`.${n??(r&&en.extname(r)!==""?en.extname(r):en.extname(t)===""?"":en.extname(t))}`,l=`${a}${i}${u}`,c=s??en.dirname(o);return{input:o,name:l,output:c}}function wm(t){return Kc(t)}async function Ba(){return Em()}function ja(t){return t==null?[]:Array.isArray(t)?t:[t]}async function Tm(){let t=new NT({cwd:process.cwd(),detectConfig:!0,packageField:"remarkConfig",rcName:".remarkrc"}),e=await new Promise(r=>{t.load("",(n,i)=>{if(n){console.error(n),r();return}r(i)})});if(e){let{filePath:r}=e;return r===void 0?Cm.info('No ambient Remark configuration file found"'):Cm.info(`Found and loaded ambient Remark configuration from "${r}"`),e}throw new Error("Failed to load ambient remark configuration")}var vm=jT.merge(X.object({assetsPath:X.string().optional(),packageFile:X.string().optional()})).describe("Config Extension");async function Ai(t){let{additionalConfig:e,additionalRules:r,searchFrom:n}=t??{},i={addMetaComment:!1,assetsPath:"./assets",closingPrefix:"/",keywordPrefix:"",metaCommentIdentifier:"+",packageFile:await Ba(),rules:{mdat:"Powered by the Markdown Autophagic Template system: [mdat](https://github.com/kitschpatrol/mdat)."}},o=_m("mdat",{loaders:{".ts":Sm()}}),s=await o.search(n);if(s){let{config:a,filepath:u}=s,l=a;if(dr.info(`Using config from "${u}"`),u.endsWith("package.json")&&typeof a=="string"){dr.info(`Detected shared config string: "${a}"`);let{default:f}=await import(a);l=f}let c=Im(l,vm);c&&(i=Yc(i,c))}if(e!==void 0){let a=Array.isArray(e)?e:[e];for(let u of a){let l;if(typeof u=="string"){let f=await o.load(u);if(f==null)continue;let{config:p,filepath:d}=f;dr.info(`Loaded additional config from "${d}"`),l=p}else l=u;if(l===void 0)continue;dr.info("Merging configuration object");let c=Im(l,vm);c!==void 0&&(i=Yc(i,c))}}if(r!==void 0){let a=Array.isArray(r)?r:[r],u=_m("mdat",{loaders:{".json":Vc,".ts":Sm()}});for(let l of a){let c;if(typeof l=="string"){let p;if(Om.basename(l).endsWith("package.json")){let y=await MT.readFile(l,"utf8");p={config:Vc(l,y),filepath:l}}else p=await u.load(l);if(p==null)continue;let{config:d,filepath:m}=p;dr.info(`Loaded additional config from "${m}"`),c=d}else c=l;if(c===void 0)continue;dr.info("Merging rules into configuration object");let f=zT(c,UT);f!==void 0&&(i=Yc(i,f))}}if(i.rules){let a=Object.keys(i.rules).sort().map(u=>`"${St.bold.green(u)}"`);dr.info(`Loaded ${St.bold(a.length)} mdat comment expansion ${Bc("rule",a.length)}:`);for(let u of a)dr.info(` ${u}`)}else dr.error("No rules loaded from additional configurations or rules, using default.");return Ua=i,i}function zT(t,e){if(e.safeParse(t).success)return{rules:t};dr.error(`Rules object has the wrong shape. Ignoring and using default configuration:
70
- ${JSON.stringify(t,void 0,2)}`)}function Im(t,e){if(e.safeParse(t).success)return t;dr.error(`Config object has the wrong shape. Ignoring and using default configuration:
71
- ${JSON.stringify(t,void 0,2)}`)}var Ua;async function Or(){return Ua===void 0&&(dr.warn("getConfig(): config was undefined"),Ua??=await Ai()),Ua}var Zc;async function rr(){let{packageFile:t}=await Or();if(t===void 0)throw new Error("No packageFile found or set in config");if(Zc??=await BT({cwd:Om.dirname(t)}),Zc===void 0)throw new Error("No package.json found");return Zc}var $T={};function tn(t,e){let r=e||$T,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,i=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Rm(t,n,i)}function Rm(t,e,r){if(qT(t)){if("value"in t)return t.type==="html"&&!r?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return Dm(t.children,e,r)}return Array.isArray(t)?Dm(t,e,r):""}function Dm(t,e,r){let n=[],i=-1;for(;++i<t.length;)n[i]=Rm(t[i],e,r);return n.join("")}function qT(t){return!!(t&&typeof t=="object")}var Xc={AElig:"\xC6",AMP:"&",Aacute:"\xC1",Abreve:"\u0102",Acirc:"\xC2",Acy:"\u0410",Afr:"\u{1D504}",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\u{1D538}",ApplyFunction:"\u2061",Aring:"\xC5",Ascr:"\u{1D49C}",Assign:"\u2254",Atilde:"\xC3",Auml:"\xC4",Backslash:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",Bcy:"\u0411",Because:"\u2235",Bernoullis:"\u212C",Beta:"\u0392",Bfr:"\u{1D505}",Bopf:"\u{1D539}",Breve:"\u02D8",Bscr:"\u212C",Bumpeq:"\u224E",CHcy:"\u0427",COPY:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",Cayleys:"\u212D",Ccaron:"\u010C",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",CenterDot:"\xB7",Cfr:"\u212D",Chi:"\u03A7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",Colon:"\u2237",Colone:"\u2A74",Congruent:"\u2261",Conint:"\u222F",ContourIntegral:"\u222E",Copf:"\u2102",Coproduct:"\u2210",CounterClockwiseContourIntegral:"\u2233",Cross:"\u2A2F",Cscr:"\u{1D49E}",Cup:"\u22D3",CupCap:"\u224D",DD:"\u2145",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",Delta:"\u0394",Dfr:"\u{1D507}",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",Diamond:"\u22C4",DifferentialD:"\u2146",Dopf:"\u{1D53B}",Dot:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",Downarrow:"\u21D3",Dscr:"\u{1D49F}",Dstrok:"\u0110",ENG:"\u014A",ETH:"\xD0",Eacute:"\xC9",Ecaron:"\u011A",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\u{1D508}",Egrave:"\xC8",Element:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\u{1D53C}",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",Equilibrium:"\u21CC",Escr:"\u2130",Esim:"\u2A73",Eta:"\u0397",Euml:"\xCB",Exists:"\u2203",ExponentialE:"\u2147",Fcy:"\u0424",Ffr:"\u{1D509}",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",Fopf:"\u{1D53D}",ForAll:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\u{1D50A}",Gg:"\u22D9",Gopf:"\u{1D53E}",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",Gt:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",HilbertSpace:"\u210B",Hopf:"\u210D",HorizontalLine:"\u2500",Hscr:"\u210B",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrave:"\xCC",Im:"\u2111",Imacr:"\u012A",ImaginaryI:"\u2148",Implies:"\u21D2",Int:"\u222C",Integral:"\u222B",Intersection:"\u22C2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012E",Iopf:"\u{1D540}",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\u{1D50D}",Jopf:"\u{1D541}",Jscr:"\u{1D4A5}",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\u{1D50E}",Kopf:"\u{1D542}",Kscr:"\u{1D4A6}",LJcy:"\u0409",LT:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Larr:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",LeftRightArrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",Leftarrow:"\u21D0",Leftrightarrow:"\u21D4",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",Lfr:"\u{1D50F}",Ll:"\u22D8",Lleftarrow:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",LongLeftRightArrow:"\u27F7",LongRightArrow:"\u27F6",Longleftarrow:"\u27F8",Longleftrightarrow:"\u27FA",Longrightarrow:"\u27F9",Lopf:"\u{1D543}",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",MinusPlus:"\u2213",Mopf:"\u{1D544}",Mscr:"\u2133",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
72
- `,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',Qfr:"\u{1D514}",Qopf:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\u{1D4B5}",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acute:"\xB4",acy:"\u0430",aelig:"\xE6",af:"\u2061",afr:"\u{1D51E}",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedil:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\u{1D554}",coprod:"\u2210",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",ic:"\u2063",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\u{1D55F}",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\u{1D561}",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\u{1D4C7}",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",tilde:"\u02DC",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uml:"\xA8",uogon:"\u0173",uopf:"\u{1D566}",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"};var VT={}.hasOwnProperty;function lo(t){return VT.call(Xc,t)?Xc[t]:!1}function st(t,e,r,n){let i=t.length,o=0,s;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,r=r>0?r:0,n.length<1e4)s=Array.from(n),s.unshift(e,r),t.splice(...s);else for(r&&t.splice(e,r);o<n.length;)s=n.slice(o,o+1e4),s.unshift(e,0),t.splice(...s),o+=1e4,e+=1e4}function Lt(t,e){return t.length>0?(st(t,t.length,0,e),t):e}var Fm={}.hasOwnProperty;function za(t){let e={},r=-1;for(;++r<t.length;)GT(e,t[r]);return e}function GT(t,e){let r;for(r in e){let i=(Fm.call(t,r)?t[r]:void 0)||(t[r]={}),o=e[r],s;if(o)for(s in o){Fm.call(i,s)||(i[s]=[]);let a=o[s];WT(i[s],Array.isArray(a)?a:a?[a]:[])}}}function WT(t,e){let r=-1,n=[];for(;++r<e.length;)(e[r].add==="after"?t:n).push(e[r]);st(t,0,0,n)}function $a(t,e){let r=Number.parseInt(t,e);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"\uFFFD":String.fromCodePoint(r)}function It(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var xt=Cn(/[A-Za-z]/),yt=Cn(/[\dA-Za-z]/),Nm=Cn(/[#-'*+\--9=?A-Z^-~]/);function Ci(t){return t!==null&&(t<32||t===127)}var bs=Cn(/\d/),Pm=Cn(/[\dA-Fa-f]/),Lm=Cn(/[!-/:-@[-`{-~]/);function z(t){return t!==null&&t<-2}function ke(t){return t!==null&&(t<0||t===32)}function se(t){return t===-2||t===-1||t===32}var wi=Cn(new RegExp("\\p{P}|\\p{S}","u")),Dr=Cn(/\s/);function Cn(t){return e;function e(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function ie(t,e,r,n){let i=n?n-1:Number.POSITIVE_INFINITY,o=0;return s;function s(u){return se(u)?(t.enter(r),a(u)):e(u)}function a(u){return se(u)&&o++<i?(t.consume(u),a):(t.exit(r),e(u))}}var Mm={tokenize:HT};function HT(t){let e=t.attempt(this.parser.constructs.contentInitial,n,i),r;return e;function n(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),ie(t,e,"linePrefix")}function i(a){return t.enter("paragraph"),o(a)}function o(a){let u=t.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=u),r=u,s(a)}function s(a){if(a===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(a);return}return z(a)?(t.consume(a),t.exit("chunkText"),o):(t.consume(a),s)}}var jm={tokenize:KT},Bm={tokenize:YT};function KT(t){let e=this,r=[],n=0,i,o,s;return a;function a(C){if(n<r.length){let D=r[n];return e.containerState=D[1],t.attempt(D[0].continuation,u,l)(C)}return l(C)}function u(C){if(n++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&w();let D=e.events.length,R=D,S;for(;R--;)if(e.events[R][0]==="exit"&&e.events[R][1].type==="chunkFlow"){S=e.events[R][1].end;break}b(n);let de=D;for(;de<e.events.length;)e.events[de][1].end={...S},de++;return st(e.events,R+1,0,e.events.slice(D)),e.events.length=de,l(C)}return a(C)}function l(C){if(n===r.length){if(!i)return p(C);if(i.currentConstruct&&i.currentConstruct.concrete)return m(C);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Bm,c,f)(C)}function c(C){return i&&w(),b(n),p(C)}function f(C){return e.parser.lazy[e.now().line]=n!==r.length,s=e.now().offset,m(C)}function p(C){return e.containerState={},t.attempt(Bm,d,m)(C)}function d(C){return n++,r.push([e.currentConstruct,e.containerState]),p(C)}function m(C){if(C===null){i&&w(),b(0),t.consume(C);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),y(C)}function y(C){if(C===null){g(t.exit("chunkFlow"),!0),b(0),t.consume(C);return}return z(C)?(t.consume(C),g(t.exit("chunkFlow")),n=0,e.interrupt=void 0,a):(t.consume(C),y)}function g(C,D){let R=e.sliceStream(C);if(D&&R.push(null),C.previous=o,o&&(o.next=C),o=C,i.defineSkip(C.start),i.write(R),e.parser.lazy[C.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<s&&(!i.events[S][1].end||i.events[S][1].end.offset>s))return;let de=e.events.length,ye=de,be,_;for(;ye--;)if(e.events[ye][0]==="exit"&&e.events[ye][1].type==="chunkFlow"){if(be){_=e.events[ye][1].end;break}be=!0}for(b(n),S=de;S<e.events.length;)e.events[S][1].end={..._},S++;st(e.events,ye+1,0,e.events.slice(de)),e.events.length=S}}function b(C){let D=r.length;for(;D-- >C;){let R=r[D];e.containerState=R[1],R[0].exit.call(e,t)}r.length=C}function w(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function YT(t,e,r){return ie(t,t.attempt(this.parser.constructs.document,e,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function rn(t){if(t===null||ke(t)||Dr(t))return 1;if(wi(t))return 2}function wn(t,e,r){let n=[],i=-1;for(;++i<t.length;){let o=t[i].resolveAll;o&&!n.includes(o)&&(e=o(e,r),n.push(o))}return e}var Es={name:"attention",resolveAll:ZT,tokenize:XT};function ZT(t,e){let r=-1,n,i,o,s,a,u,l,c;for(;++r<t.length;)if(t[r][0]==="enter"&&t[r][1].type==="attentionSequence"&&t[r][1]._close){for(n=r;n--;)if(t[n][0]==="exit"&&t[n][1].type==="attentionSequence"&&t[n][1]._open&&e.sliceSerialize(t[n][1]).charCodeAt(0)===e.sliceSerialize(t[r][1]).charCodeAt(0)){if((t[n][1]._close||t[r][1]._open)&&(t[r][1].end.offset-t[r][1].start.offset)%3&&!((t[n][1].end.offset-t[n][1].start.offset+t[r][1].end.offset-t[r][1].start.offset)%3))continue;u=t[n][1].end.offset-t[n][1].start.offset>1&&t[r][1].end.offset-t[r][1].start.offset>1?2:1;let f={...t[n][1].end},p={...t[r][1].start};Um(f,-u),Um(p,u),s={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...t[n][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...t[r][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...t[n][1].end},end:{...t[r][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},t[n][1].end={...s.start},t[r][1].start={...a.end},l=[],t[n][1].end.offset-t[n][1].start.offset&&(l=Lt(l,[["enter",t[n][1],e],["exit",t[n][1],e]])),l=Lt(l,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",o,e]]),l=Lt(l,wn(e.parser.constructs.insideSpan.null,t.slice(n+1,r),e)),l=Lt(l,[["exit",o,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[r][1].end.offset-t[r][1].start.offset?(c=2,l=Lt(l,[["enter",t[r][1],e],["exit",t[r][1],e]])):c=0,st(t,n-1,r-n+3,l),r=n+l.length-c-2;break}}for(r=-1;++r<t.length;)t[r][1].type==="attentionSequence"&&(t[r][1].type="data");return t}function XT(t,e){let r=this.parser.constructs.attentionMarkers.null,n=this.previous,i=rn(n),o;return s;function s(u){return o=u,t.enter("attentionSequence"),a(u)}function a(u){if(u===o)return t.consume(u),a;let l=t.exit("attentionSequence"),c=rn(u),f=!c||c===2&&i||r.includes(u),p=!i||i===2&&c||r.includes(n);return l._open=!!(o===42?f:f&&(i||!p)),l._close=!!(o===42?p:p&&(c||!f)),e(u)}}function Um(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}var Jc={name:"autolink",tokenize:JT};function JT(t,e,r){let n=0;return i;function i(d){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),o}function o(d){return xt(d)?(t.consume(d),s):d===64?r(d):l(d)}function s(d){return d===43||d===45||d===46||yt(d)?(n=1,a(d)):l(d)}function a(d){return d===58?(t.consume(d),n=0,u):(d===43||d===45||d===46||yt(d))&&n++<32?(t.consume(d),a):(n=0,l(d))}function u(d){return d===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.exit("autolink"),e):d===null||d===32||d===60||Ci(d)?r(d):(t.consume(d),u)}function l(d){return d===64?(t.consume(d),c):Nm(d)?(t.consume(d),l):r(d)}function c(d){return yt(d)?f(d):r(d)}function f(d){return d===46?(t.consume(d),n=0,c):d===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.exit("autolink"),e):p(d)}function p(d){if((d===45||yt(d))&&n++<63){let m=d===45?p:f;return t.consume(d),m}return r(d)}}var Rr={partial:!0,tokenize:QT};function QT(t,e,r){return n;function n(o){return se(o)?ie(t,i,"linePrefix")(o):i(o)}function i(o){return o===null||z(o)?e(o):r(o)}}var qa={continuation:{tokenize:t_},exit:r_,name:"blockQuote",tokenize:e_};function e_(t,e,r){let n=this;return i;function i(s){if(s===62){let a=n.containerState;return a.open||(t.enter("blockQuote",{_container:!0}),a.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(s),t.exit("blockQuoteMarker"),o}return r(s)}function o(s){return se(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}function t_(t,e,r){let n=this;return i;function i(s){return se(s)?ie(t,o,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return t.attempt(qa,e,r)(s)}}function r_(t){t.exit("blockQuote")}var Va={name:"characterEscape",tokenize:n_};function n_(t,e,r){return n;function n(o){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(o),t.exit("escapeMarker"),i}function i(o){return Lm(o)?(t.enter("characterEscapeValue"),t.consume(o),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):r(o)}}var Ga={name:"characterReference",tokenize:i_};function i_(t,e,r){let n=this,i=0,o,s;return a;function a(f){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),u}function u(f){return f===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(f),t.exit("characterReferenceMarkerNumeric"),l):(t.enter("characterReferenceValue"),o=31,s=yt,c(f))}function l(f){return f===88||f===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(f),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),o=6,s=Pm,c):(t.enter("characterReferenceValue"),o=7,s=bs,c(f))}function c(f){if(f===59&&i){let p=t.exit("characterReferenceValue");return s===yt&&!lo(n.sliceSerialize(p))?r(f):(t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return s(f)&&i++<o?(t.consume(f),c):r(f)}}var zm={partial:!0,tokenize:s_},Wa={concrete:!0,name:"codeFenced",tokenize:o_};function o_(t,e,r){let n=this,i={partial:!0,tokenize:R},o=0,s=0,a;return u;function u(S){return l(S)}function l(S){let de=n.events[n.events.length-1];return o=de&&de[1].type==="linePrefix"?de[2].sliceSerialize(de[1],!0).length:0,a=S,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),c(S)}function c(S){return S===a?(s++,t.consume(S),c):s<3?r(S):(t.exit("codeFencedFenceSequence"),se(S)?ie(t,f,"whitespace")(S):f(S))}function f(S){return S===null||z(S)?(t.exit("codeFencedFence"),n.interrupt?e(S):t.check(zm,y,D)(S)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),p(S))}function p(S){return S===null||z(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),f(S)):se(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),ie(t,d,"whitespace")(S)):S===96&&S===a?r(S):(t.consume(S),p)}function d(S){return S===null||z(S)?f(S):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||z(S)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),f(S)):S===96&&S===a?r(S):(t.consume(S),m)}function y(S){return t.attempt(i,D,g)(S)}function g(S){return t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),b}function b(S){return o>0&&se(S)?ie(t,w,"linePrefix",o+1)(S):w(S)}function w(S){return S===null||z(S)?t.check(zm,y,D)(S):(t.enter("codeFlowValue"),C(S))}function C(S){return S===null||z(S)?(t.exit("codeFlowValue"),w(S)):(t.consume(S),C)}function D(S){return t.exit("codeFenced"),e(S)}function R(S,de,ye){let be=0;return _;function _(j){return S.enter("lineEnding"),S.consume(j),S.exit("lineEnding"),L}function L(j){return S.enter("codeFencedFence"),se(j)?ie(S,F,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):F(j)}function F(j){return j===a?(S.enter("codeFencedFenceSequence"),v(j)):ye(j)}function v(j){return j===a?(be++,S.consume(j),v):be>=s?(S.exit("codeFencedFenceSequence"),se(j)?ie(S,P,"whitespace")(j):P(j)):ye(j)}function P(j){return j===null||z(j)?(S.exit("codeFencedFence"),de(j)):ye(j)}}}function s_(t,e,r){let n=this;return i;function i(s){return s===null?r(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o)}function o(s){return n.parser.lazy[n.now().line]?r(s):e(s)}}var As={name:"codeIndented",tokenize:u_},a_={partial:!0,tokenize:l_};function u_(t,e,r){let n=this;return i;function i(l){return t.enter("codeIndented"),ie(t,o,"linePrefix",5)(l)}function o(l){let c=n.events[n.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(l):r(l)}function s(l){return l===null?u(l):z(l)?t.attempt(a_,s,u)(l):(t.enter("codeFlowValue"),a(l))}function a(l){return l===null||z(l)?(t.exit("codeFlowValue"),s(l)):(t.consume(l),a)}function u(l){return t.exit("codeIndented"),e(l)}}function l_(t,e,r){let n=this;return i;function i(s){return n.parser.lazy[n.now().line]?r(s):z(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):ie(t,o,"linePrefix",5)(s)}function o(s){let a=n.events[n.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):z(s)?i(s):r(s)}}var Qc={name:"codeText",previous:f_,resolve:c_,tokenize:p_};function c_(t){let e=t.length-4,r=3,n,i;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(n=r;++n<e;)if(t[n][1].type==="codeTextData"){t[r][1].type="codeTextPadding",t[e][1].type="codeTextPadding",r+=2,e-=2;break}}for(n=r-1,e++;++n<=e;)i===void 0?n!==e&&t[n][1].type!=="lineEnding"&&(i=n):(n===e||t[n][1].type==="lineEnding")&&(t[i][1].type="codeTextData",n!==i+2&&(t[i][1].end=t[n-1][1].end,t.splice(i+2,n-i-2),e-=n-i-2,n=i+2),i=void 0);return t}function f_(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function p_(t,e,r){let n=this,i=0,o,s;return a;function a(p){return t.enter("codeText"),t.enter("codeTextSequence"),u(p)}function u(p){return p===96?(t.consume(p),i++,u):(t.exit("codeTextSequence"),l(p))}function l(p){return p===null?r(p):p===32?(t.enter("space"),t.consume(p),t.exit("space"),l):p===96?(s=t.enter("codeTextSequence"),o=0,f(p)):z(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),l):(t.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||z(p)?(t.exit("codeTextData"),l(p)):(t.consume(p),c)}function f(p){return p===96?(t.consume(p),o++,f):o===i?(t.exit("codeTextSequence"),t.exit("codeText"),e(p)):(s.type="codeTextData",c(p))}}var Ha=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new 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,r){let n=r??Number.POSITIVE_INFINITY;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,r,n){let i=r||0;this.setCursor(Math.trunc(e));let o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&Cs(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Cs(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Cs(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 r=this.left.splice(e,Number.POSITIVE_INFINITY);Cs(this.right,r.reverse())}else{let r=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Cs(this.left,r.reverse())}}};function Cs(t,e){let r=0;if(e.length<1e4)t.push(...e);else for(;r<e.length;)t.push(...e.slice(r,r+1e4)),r+=1e4}function Ka(t){let e={},r=-1,n,i,o,s,a,u,l,c=new Ha(t);for(;++r<c.length;){for(;r in e;)r=e[r];if(n=c.get(r),r&&n[1].type==="chunkFlow"&&c.get(r-1)[1].type==="listItemPrefix"&&(u=n[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(n[0]==="enter")n[1].contentType&&(Object.assign(e,d_(c,r)),r=e[r],l=!0);else if(n[1]._container){for(o=r,i=void 0;o--;)if(s=c.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(n[1].end={...c.get(i)[1].start},a=c.slice(i,r),a.unshift(n),c.splice(i,r-i+1,a))}}return st(t,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function d_(t,e){let r=t.get(e)[1],n=t.get(e)[2],i=e-1,o=[],s=r._tokenizer;s||(s=n.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let a=s.events,u=[],l={},c,f,p=-1,d=r,m=0,y=0,g=[y];for(;d;){for(;t.get(++i)[1]!==d;);o.push(i),d._tokenizer||(c=n.sliceStream(d),d.next||c.push(null),f&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=d,d=d.next}for(d=r;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(y=p+1,g.push(y),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):g.pop(),p=g.length;p--;){let b=a.slice(g[p],g[p+1]),w=o.pop();u.push([w,w+b.length-1]),t.splice(w,2,b)}for(u.reverse(),p=-1;++p<u.length;)l[m+u[p][0]]=m+u[p][1],m+=u[p][1]-u[p][0]-1;return l}var ef={resolve:m_,tokenize:g_},h_={partial:!0,tokenize:x_};function m_(t){return Ka(t),t}function g_(t,e){let r;return n;function n(a){return t.enter("content"),r=t.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):z(a)?t.check(h_,s,o)(a):(t.consume(a),i)}function o(a){return t.exit("chunkContent"),t.exit("content"),e(a)}function s(a){return t.consume(a),t.exit("chunkContent"),r.next=t.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,i}}function x_(t,e,r){let n=this;return i;function i(s){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),ie(t,o,"linePrefix")}function o(s){if(s===null||z(s))return r(s);let a=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):t.interrupt(n.parser.constructs.flow,r,e)(s)}}function Ya(t,e,r,n,i,o,s,a,u){let l=u||Number.POSITIVE_INFINITY,c=0;return f;function f(b){return b===60?(t.enter(n),t.enter(i),t.enter(o),t.consume(b),t.exit(o),p):b===null||b===32||b===41||Ci(b)?r(b):(t.enter(n),t.enter(s),t.enter(a),t.enter("chunkString",{contentType:"string"}),y(b))}function p(b){return b===62?(t.enter(o),t.consume(b),t.exit(o),t.exit(i),t.exit(n),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),d(b))}function d(b){return b===62?(t.exit("chunkString"),t.exit(a),p(b)):b===null||b===60||z(b)?r(b):(t.consume(b),b===92?m:d)}function m(b){return b===60||b===62||b===92?(t.consume(b),d):d(b)}function y(b){return!c&&(b===null||b===41||ke(b))?(t.exit("chunkString"),t.exit(a),t.exit(s),t.exit(n),e(b)):c<l&&b===40?(t.consume(b),c++,y):b===41?(t.consume(b),c--,y):b===null||b===32||b===40||Ci(b)?r(b):(t.consume(b),b===92?g:y)}function g(b){return b===40||b===41||b===92?(t.consume(b),y):y(b)}}function Za(t,e,r,n,i,o){let s=this,a=0,u;return l;function l(d){return t.enter(n),t.enter(i),t.consume(d),t.exit(i),t.enter(o),c}function c(d){return a>999||d===null||d===91||d===93&&!u||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?r(d):d===93?(t.exit(o),t.enter(i),t.consume(d),t.exit(i),t.exit(n),e):z(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||z(d)||a++>999?(t.exit("chunkString"),c(d)):(t.consume(d),u||(u=!se(d)),d===92?p:f)}function p(d){return d===91||d===92||d===93?(t.consume(d),a++,f):f(d)}}function Xa(t,e,r,n,i,o){let s;return a;function a(p){return p===34||p===39||p===40?(t.enter(n),t.enter(i),t.consume(p),t.exit(i),s=p===40?41:p,u):r(p)}function u(p){return p===s?(t.enter(i),t.consume(p),t.exit(i),t.exit(n),e):(t.enter(o),l(p))}function l(p){return p===s?(t.exit(o),u(s)):p===null?r(p):z(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),ie(t,l,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===s||p===null||z(p)?(t.exit("chunkString"),l(p)):(t.consume(p),p===92?f:c)}function f(p){return p===s||p===92?(t.consume(p),c):c(p)}}function ki(t,e){let r;return n;function n(i){return z(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),r=!0,n):se(i)?ie(t,n,r?"linePrefix":"lineSuffix")(i):e(i)}}var tf={name:"definition",tokenize:b_},y_={partial:!0,tokenize:E_};function b_(t,e,r){let n=this,i;return o;function o(d){return t.enter("definition"),s(d)}function s(d){return Za.call(n,t,a,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return i=It(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),d===58?(t.enter("definitionMarker"),t.consume(d),t.exit("definitionMarker"),u):r(d)}function u(d){return ke(d)?ki(t,l)(d):l(d)}function l(d){return Ya(t,c,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return t.attempt(y_,f,f)(d)}function f(d){return se(d)?ie(t,p,"whitespace")(d):p(d)}function p(d){return d===null||z(d)?(t.exit("definition"),n.parser.defined.push(i),e(d)):r(d)}}function E_(t,e,r){return n;function n(a){return ke(a)?ki(t,i)(a):r(a)}function i(a){return Xa(t,o,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return se(a)?ie(t,s,"whitespace")(a):s(a)}function s(a){return a===null||z(a)?e(a):r(a)}}var rf={name:"hardBreakEscape",tokenize:A_};function A_(t,e,r){return n;function n(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return z(o)?(t.exit("hardBreakEscape"),e(o)):r(o)}}var nf={name:"headingAtx",resolve:C_,tokenize:w_};function C_(t,e){let r=t.length-2,n=3,i,o;return t[n][1].type==="whitespace"&&(n+=2),r-2>n&&t[r][1].type==="whitespace"&&(r-=2),t[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&t[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(i={type:"atxHeadingText",start:t[n][1].start,end:t[r][1].end},o={type:"chunkText",start:t[n][1].start,end:t[r][1].end,contentType:"text"},st(t,n,r-n+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function w_(t,e,r){let n=0;return i;function i(c){return t.enter("atxHeading"),o(c)}function o(c){return t.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&n++<6?(t.consume(c),s):c===null||ke(c)?(t.exit("atxHeadingSequence"),a(c)):r(c)}function a(c){return c===35?(t.enter("atxHeadingSequence"),u(c)):c===null||z(c)?(t.exit("atxHeading"),e(c)):se(c)?ie(t,a,"whitespace")(c):(t.enter("atxHeadingText"),l(c))}function u(c){return c===35?(t.consume(c),u):(t.exit("atxHeadingSequence"),a(c))}function l(c){return c===null||c===35||ke(c)?(t.exit("atxHeadingText"),a(c)):(t.consume(c),l)}}var $m=["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"],of=["pre","script","style","textarea"];var sf={concrete:!0,name:"htmlFlow",resolveTo:__,tokenize:S_},k_={partial:!0,tokenize:I_},T_={partial:!0,tokenize:v_};function __(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function S_(t,e,r){let n=this,i,o,s,a,u;return l;function l(E){return c(E)}function c(E){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(E),f}function f(E){return E===33?(t.consume(E),p):E===47?(t.consume(E),o=!0,y):E===63?(t.consume(E),i=3,n.interrupt?e:x):xt(E)?(t.consume(E),s=String.fromCharCode(E),g):r(E)}function p(E){return E===45?(t.consume(E),i=2,d):E===91?(t.consume(E),i=5,a=0,m):xt(E)?(t.consume(E),i=4,n.interrupt?e:x):r(E)}function d(E){return E===45?(t.consume(E),n.interrupt?e:x):r(E)}function m(E){let W="CDATA[";return E===W.charCodeAt(a++)?(t.consume(E),a===W.length?n.interrupt?e:F:m):r(E)}function y(E){return xt(E)?(t.consume(E),s=String.fromCharCode(E),g):r(E)}function g(E){if(E===null||E===47||E===62||ke(E)){let W=E===47,Ye=s.toLowerCase();return!W&&!o&&of.includes(Ye)?(i=1,n.interrupt?e(E):F(E)):$m.includes(s.toLowerCase())?(i=6,W?(t.consume(E),b):n.interrupt?e(E):F(E)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(E):o?w(E):C(E))}return E===45||yt(E)?(t.consume(E),s+=String.fromCharCode(E),g):r(E)}function b(E){return E===62?(t.consume(E),n.interrupt?e:F):r(E)}function w(E){return se(E)?(t.consume(E),w):_(E)}function C(E){return E===47?(t.consume(E),_):E===58||E===95||xt(E)?(t.consume(E),D):se(E)?(t.consume(E),C):_(E)}function D(E){return E===45||E===46||E===58||E===95||yt(E)?(t.consume(E),D):R(E)}function R(E){return E===61?(t.consume(E),S):se(E)?(t.consume(E),R):C(E)}function S(E){return E===null||E===60||E===61||E===62||E===96?r(E):E===34||E===39?(t.consume(E),u=E,de):se(E)?(t.consume(E),S):ye(E)}function de(E){return E===u?(t.consume(E),u=null,be):E===null||z(E)?r(E):(t.consume(E),de)}function ye(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||ke(E)?R(E):(t.consume(E),ye)}function be(E){return E===47||E===62||se(E)?C(E):r(E)}function _(E){return E===62?(t.consume(E),L):r(E)}function L(E){return E===null||z(E)?F(E):se(E)?(t.consume(E),L):r(E)}function F(E){return E===45&&i===2?(t.consume(E),ae):E===60&&i===1?(t.consume(E),ee):E===62&&i===4?(t.consume(E),Ue):E===63&&i===3?(t.consume(E),x):E===93&&i===5?(t.consume(E),it):z(E)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(k_,Qe,v)(E)):E===null||z(E)?(t.exit("htmlFlowData"),v(E)):(t.consume(E),F)}function v(E){return t.check(T_,P,Qe)(E)}function P(E){return t.enter("lineEnding"),t.consume(E),t.exit("lineEnding"),j}function j(E){return E===null||z(E)?v(E):(t.enter("htmlFlowData"),F(E))}function ae(E){return E===45?(t.consume(E),x):F(E)}function ee(E){return E===47?(t.consume(E),s="",_e):F(E)}function _e(E){if(E===62){let W=s.toLowerCase();return of.includes(W)?(t.consume(E),Ue):F(E)}return xt(E)&&s.length<8?(t.consume(E),s+=String.fromCharCode(E),_e):F(E)}function it(E){return E===93?(t.consume(E),x):F(E)}function x(E){return E===62?(t.consume(E),Ue):E===45&&i===2?(t.consume(E),x):F(E)}function Ue(E){return E===null||z(E)?(t.exit("htmlFlowData"),Qe(E)):(t.consume(E),Ue)}function Qe(E){return t.exit("htmlFlow"),e(E)}}function v_(t,e,r){let n=this;return i;function i(s){return z(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o):r(s)}function o(s){return n.parser.lazy[n.now().line]?r(s):e(s)}}function I_(t,e,r){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Rr,e,r)}}var af={name:"htmlText",tokenize:O_};function O_(t,e,r){let n=this,i,o,s;return a;function a(x){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(x),u}function u(x){return x===33?(t.consume(x),l):x===47?(t.consume(x),R):x===63?(t.consume(x),C):xt(x)?(t.consume(x),ye):r(x)}function l(x){return x===45?(t.consume(x),c):x===91?(t.consume(x),o=0,m):xt(x)?(t.consume(x),w):r(x)}function c(x){return x===45?(t.consume(x),d):r(x)}function f(x){return x===null?r(x):x===45?(t.consume(x),p):z(x)?(s=f,ee(x)):(t.consume(x),f)}function p(x){return x===45?(t.consume(x),d):f(x)}function d(x){return x===62?ae(x):x===45?p(x):f(x)}function m(x){let Ue="CDATA[";return x===Ue.charCodeAt(o++)?(t.consume(x),o===Ue.length?y:m):r(x)}function y(x){return x===null?r(x):x===93?(t.consume(x),g):z(x)?(s=y,ee(x)):(t.consume(x),y)}function g(x){return x===93?(t.consume(x),b):y(x)}function b(x){return x===62?ae(x):x===93?(t.consume(x),b):y(x)}function w(x){return x===null||x===62?ae(x):z(x)?(s=w,ee(x)):(t.consume(x),w)}function C(x){return x===null?r(x):x===63?(t.consume(x),D):z(x)?(s=C,ee(x)):(t.consume(x),C)}function D(x){return x===62?ae(x):C(x)}function R(x){return xt(x)?(t.consume(x),S):r(x)}function S(x){return x===45||yt(x)?(t.consume(x),S):de(x)}function de(x){return z(x)?(s=de,ee(x)):se(x)?(t.consume(x),de):ae(x)}function ye(x){return x===45||yt(x)?(t.consume(x),ye):x===47||x===62||ke(x)?be(x):r(x)}function be(x){return x===47?(t.consume(x),ae):x===58||x===95||xt(x)?(t.consume(x),_):z(x)?(s=be,ee(x)):se(x)?(t.consume(x),be):ae(x)}function _(x){return x===45||x===46||x===58||x===95||yt(x)?(t.consume(x),_):L(x)}function L(x){return x===61?(t.consume(x),F):z(x)?(s=L,ee(x)):se(x)?(t.consume(x),L):be(x)}function F(x){return x===null||x===60||x===61||x===62||x===96?r(x):x===34||x===39?(t.consume(x),i=x,v):z(x)?(s=F,ee(x)):se(x)?(t.consume(x),F):(t.consume(x),P)}function v(x){return x===i?(t.consume(x),i=void 0,j):x===null?r(x):z(x)?(s=v,ee(x)):(t.consume(x),v)}function P(x){return x===null||x===34||x===39||x===60||x===61||x===96?r(x):x===47||x===62||ke(x)?be(x):(t.consume(x),P)}function j(x){return x===47||x===62||ke(x)?be(x):r(x)}function ae(x){return x===62?(t.consume(x),t.exit("htmlTextData"),t.exit("htmlText"),e):r(x)}function ee(x){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),_e}function _e(x){return se(x)?ie(t,it,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):it(x)}function it(x){return t.enter("htmlTextData"),s(x)}}var Ti={name:"labelEnd",resolveAll:N_,resolveTo:P_,tokenize:L_},D_={tokenize:M_},R_={tokenize:B_},F_={tokenize:j_};function N_(t){let e=-1,r=[];for(;++e<t.length;){let n=t[e][1];if(r.push(t[e]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){let i=n.type==="labelImage"?4:2;n.type="data",e+=i}}return t.length!==r.length&&st(t,0,t.length,r),t}function P_(t,e){let r=t.length,n=0,i,o,s,a;for(;r--;)if(i=t[r][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[r][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(t[r][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=r,i.type!=="labelLink")){n=2;break}}else i.type==="labelEnd"&&(s=r);let u={type:t[o][1].type==="labelLink"?"link":"image",start:{...t[o][1].start},end:{...t[t.length-1][1].end}},l={type:"label",start:{...t[o][1].start},end:{...t[s][1].end}},c={type:"labelText",start:{...t[o+n+2][1].end},end:{...t[s-2][1].start}};return a=[["enter",u,e],["enter",l,e]],a=Lt(a,t.slice(o+1,o+n+3)),a=Lt(a,[["enter",c,e]]),a=Lt(a,wn(e.parser.constructs.insideSpan.null,t.slice(o+n+4,s-3),e)),a=Lt(a,[["exit",c,e],t[s-2],t[s-1],["exit",l,e]]),a=Lt(a,t.slice(s+1)),a=Lt(a,[["exit",u,e]]),st(t,o,t.length,a),t}function L_(t,e,r){let n=this,i=n.events.length,o,s;for(;i--;)if((n.events[i][1].type==="labelImage"||n.events[i][1].type==="labelLink")&&!n.events[i][1]._balanced){o=n.events[i][1];break}return a;function a(p){return o?o._inactive?f(p):(s=n.parser.defined.includes(It(n.sliceSerialize({start:o.end,end:n.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),t.exit("labelEnd"),u):r(p)}function u(p){return p===40?t.attempt(D_,c,s?c:f)(p):p===91?t.attempt(R_,c,s?l:f)(p):s?c(p):f(p)}function l(p){return t.attempt(F_,c,f)(p)}function c(p){return e(p)}function f(p){return o._balanced=!0,r(p)}}function M_(t,e,r){return n;function n(f){return t.enter("resource"),t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),i}function i(f){return ke(f)?ki(t,o)(f):o(f)}function o(f){return f===41?c(f):Ya(t,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return ke(f)?ki(t,u)(f):c(f)}function a(f){return r(f)}function u(f){return f===34||f===39||f===40?Xa(t,l,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function l(f){return ke(f)?ki(t,c)(f):c(f)}function c(f){return f===41?(t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),t.exit("resource"),e):r(f)}}function B_(t,e,r){let n=this;return i;function i(a){return Za.call(n,t,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return n.parser.defined.includes(It(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?e(a):r(a)}function s(a){return r(a)}}function j_(t,e,r){return n;function n(o){return t.enter("reference"),t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),i}function i(o){return o===93?(t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),t.exit("reference"),e):r(o)}}var uf={name:"labelStartImage",resolveAll:Ti.resolveAll,tokenize:U_};function U_(t,e,r){let n=this;return i;function i(a){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(a),t.exit("labelImageMarker"),o}function o(a){return a===91?(t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelImage"),s):r(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(a):e(a)}}var lf={name:"labelStartLink",resolveAll:Ti.resolveAll,tokenize:z_};function z_(t,e,r){let n=this;return i;function i(s){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(s):e(s)}}var ws={name:"lineEnding",tokenize:$_};function $_(t,e){return r;function r(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),ie(t,e,"linePrefix")}}var _i={name:"thematicBreak",tokenize:q_};function q_(t,e,r){let n=0,i;return o;function o(l){return t.enter("thematicBreak"),s(l)}function s(l){return i=l,a(l)}function a(l){return l===i?(t.enter("thematicBreakSequence"),u(l)):n>=3&&(l===null||z(l))?(t.exit("thematicBreak"),e(l)):r(l)}function u(l){return l===i?(t.consume(l),n++,u):(t.exit("thematicBreakSequence"),se(l)?ie(t,a,"whitespace")(l):a(l))}}var Ot={continuation:{tokenize:H_},exit:Y_,name:"list",tokenize:W_},V_={partial:!0,tokenize:Z_},G_={partial:!0,tokenize:K_};function W_(t,e,r){let n=this,i=n.events[n.events.length-1],o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(d){let m=n.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!n.containerState.marker||d===n.containerState.marker:bs(d)){if(n.containerState.type||(n.containerState.type=m,t.enter(m,{_container:!0})),m==="listUnordered")return t.enter("listItemPrefix"),d===42||d===45?t.check(_i,r,l)(d):l(d);if(!n.interrupt||d===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(d)}return r(d)}function u(d){return bs(d)&&++s<10?(t.consume(d),u):(!n.interrupt||s<2)&&(n.containerState.marker?d===n.containerState.marker:d===41||d===46)?(t.exit("listItemValue"),l(d)):r(d)}function l(d){return t.enter("listItemMarker"),t.consume(d),t.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||d,t.check(Rr,n.interrupt?r:c,t.attempt(V_,p,f))}function c(d){return n.containerState.initialBlankLine=!0,o++,p(d)}function f(d){return se(d)?(t.enter("listItemPrefixWhitespace"),t.consume(d),t.exit("listItemPrefixWhitespace"),p):r(d)}function p(d){return n.containerState.size=o+n.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(d)}}function H_(t,e,r){let n=this;return n.containerState._closeFlow=void 0,t.check(Rr,i,o);function i(a){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,ie(t,e,"listItemIndent",n.containerState.size+1)(a)}function o(a){return n.containerState.furtherBlankLines||!se(a)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,s(a)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,t.attempt(G_,e,s)(a))}function s(a){return n.containerState._closeFlow=!0,n.interrupt=void 0,ie(t,t.attempt(Ot,e,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function K_(t,e,r){let n=this;return ie(t,i,"listItemIndent",n.containerState.size+1);function i(o){let s=n.events[n.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===n.containerState.size?e(o):r(o)}}function Y_(t){t.exit(this.containerState.type)}function Z_(t,e,r){let n=this;return ie(t,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){let s=n.events[n.events.length-1];return!se(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):r(o)}}var Ja={name:"setextUnderline",resolveTo:X_,tokenize:J_};function X_(t,e){let r=t.length,n,i,o;for(;r--;)if(t[r][0]==="enter"){if(t[r][1].type==="content"){n=r;break}t[r][1].type==="paragraph"&&(i=r)}else t[r][1].type==="content"&&t.splice(r,1),!o&&t[r][1].type==="definition"&&(o=r);let s={type:"setextHeading",start:{...t[n][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",s,e]),t.splice(o+1,0,["exit",t[n][1],e]),t[n][1].end={...t[o][1].end}):t[n][1]=s,t.push(["exit",s,e]),t}function J_(t,e,r){let n=this,i;return o;function o(l){let c=n.events.length,f;for(;c--;)if(n.events[c][1].type!=="lineEnding"&&n.events[c][1].type!=="linePrefix"&&n.events[c][1].type!=="content"){f=n.events[c][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||f)?(t.enter("setextHeadingLine"),i=l,s(l)):r(l)}function s(l){return t.enter("setextHeadingLineSequence"),a(l)}function a(l){return l===i?(t.consume(l),a):(t.exit("setextHeadingLineSequence"),se(l)?ie(t,u,"lineSuffix")(l):u(l))}function u(l){return l===null||z(l)?(t.exit("setextHeadingLine"),e(l)):r(l)}}var qm={tokenize:Q_};function Q_(t){let e=this,r=t.attempt(Rr,n,t.attempt(this.parser.constructs.flowInitial,i,ie(t,t.attempt(this.parser.constructs.flow,i,t.attempt(ef,i)),"linePrefix")));return r;function n(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,r}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,r}}var Vm={resolveAll:Km()},Gm=Hm("string"),Wm=Hm("text");function Hm(t){return{resolveAll:Km(t==="text"?eS:void 0),tokenize:e};function e(r){let n=this,i=this.parser.constructs[t],o=r.attempt(i,s,a);return s;function s(c){return l(c)?o(c):a(c)}function a(c){if(c===null){r.consume(c);return}return r.enter("data"),r.consume(c),u}function u(c){return l(c)?(r.exit("data"),o(c)):(r.consume(c),u)}function l(c){if(c===null)return!0;let f=i[c],p=-1;if(f)for(;++p<f.length;){let d=f[p];if(!d.previous||d.previous.call(n,n.previous))return!0}return!1}}}function Km(t){return e;function e(r,n){let i=-1,o;for(;++i<=r.length;)o===void 0?r[i]&&r[i][1].type==="data"&&(o=i,i++):(!r[i]||r[i][1].type!=="data")&&(i!==o+2&&(r[o][1].end=r[i-1][1].end,r.splice(o+2,i-o-2),i=o+2),o=void 0);return t?t(r,n):r}}function eS(t,e){let r=0;for(;++r<=t.length;)if((r===t.length||t[r][1].type==="lineEnding")&&t[r-1][1].type==="data"){let n=t[r-1][1],i=e.sliceStream(n),o=i.length,s=-1,a=0,u;for(;o--;){let l=i[o];if(typeof l=="string"){for(s=l.length;l.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(l===-2)u=!0,a++;else if(l!==-1){o++;break}}if(e._contentTypeTextTrailing&&r===t.length&&(a=0),a){let l={type:r===t.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:n.start._bufferIndex+s,_index:n.start._index+o,line:n.end.line,column:n.end.column-a,offset:n.end.offset-a},end:{...n.end}};n.end={...l.start},n.start.offset===n.end.offset?Object.assign(n,l):(t.splice(r,0,["enter",l,e],["exit",l,e]),r+=2)}r++}return t}var cf={};HC(cf,{attentionMarkers:()=>uS,contentInitial:()=>rS,disable:()=>lS,document:()=>tS,flow:()=>iS,flowInitial:()=>nS,insideSpan:()=>aS,string:()=>oS,text:()=>sS});var tS={42:Ot,43:Ot,45:Ot,48:Ot,49:Ot,50:Ot,51:Ot,52:Ot,53:Ot,54:Ot,55:Ot,56:Ot,57:Ot,62:qa},rS={91:tf},nS={[-2]:As,[-1]:As,32:As},iS={35:nf,42:_i,45:[Ja,_i],60:sf,61:Ja,95:_i,96:Wa,126:Wa},oS={38:Ga,92:Va},sS={[-5]:ws,[-4]:ws,[-3]:ws,33:uf,38:Ga,42:Es,60:[Jc,af],91:lf,92:[rf,Va],93:Ti,95:Es,96:Qc},aS={null:[Es,Vm]},uS={null:[42,95]},lS={null:[]};function Ym(t,e,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},i={},o=[],s=[],a=[],u=!0,l={attempt:be(de),check:be(ye),consume:D,enter:R,exit:S,interrupt:be(ye,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:g,parser:t,previous:null,sliceSerialize:m,sliceStream:y,write:d},f=e.tokenize.call(c,l),p;return e.resolveAll&&o.push(e),c;function d(v){return s=Lt(s,v),w(),s[s.length-1]!==null?[]:(_(e,0),c.events=wn(o,c.events,c),c.events)}function m(v,P){return fS(y(v),P)}function y(v){return cS(s,v)}function g(){let{_bufferIndex:v,_index:P,line:j,column:ae,offset:ee}=n;return{_bufferIndex:v,_index:P,line:j,column:ae,offset:ee}}function b(v){i[v.line]=v.column,F()}function w(){let v;for(;n._index<s.length;){let P=s[n._index];if(typeof P=="string")for(v=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===v&&n._bufferIndex<P.length;)C(P.charCodeAt(n._bufferIndex));else C(P)}}function C(v){u=void 0,p=v,f=f(v)}function D(v){z(v)?(n.line++,n.column=1,n.offset+=v===-3?2:1,F()):v!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===s[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=v,u=!0}function R(v,P){let j=P||{};return j.type=v,j.start=g(),c.events.push(["enter",j,c]),a.push(j),j}function S(v){let P=a.pop();return P.end=g(),c.events.push(["exit",P,c]),P}function de(v,P){_(v,P.from)}function ye(v,P){P.restore()}function be(v,P){return j;function j(ae,ee,_e){let it,x,Ue,Qe;return Array.isArray(ae)?W(ae):"tokenize"in ae?W([ae]):E(ae);function E(oe){return ce;function ce(me){let we=me!==null&&oe[me],Fe=me!==null&&oe.null,ze=[...Array.isArray(we)?we:we?[we]:[],...Array.isArray(Fe)?Fe:Fe?[Fe]:[]];return W(ze)(me)}}function W(oe){return it=oe,x=0,oe.length===0?_e:Ye(oe[x])}function Ye(oe){return ce;function ce(me){return Qe=L(),Ue=oe,oe.partial||(c.currentConstruct=oe),oe.name&&c.parser.constructs.disable.null.includes(oe.name)?he(me):oe.tokenize.call(P?Object.assign(Object.create(c),P):c,l,ne,he)(me)}}function ne(oe){return u=!0,v(Ue,Qe),ee}function he(oe){return u=!0,Qe.restore(),++x<it.length?Ye(it[x]):_e}}}function _(v,P){v.resolveAll&&!o.includes(v)&&o.push(v),v.resolve&&st(c.events,P,c.events.length-P,v.resolve(c.events.slice(P),c)),v.resolveTo&&(c.events=v.resolveTo(c.events,c))}function L(){let v=g(),P=c.previous,j=c.currentConstruct,ae=c.events.length,ee=Array.from(a);return{from:ae,restore:_e};function _e(){n=v,c.previous=P,c.currentConstruct=j,c.events.length=ae,a=ee,F()}}function F(){n.line in i&&n.column<2&&(n.column=i[n.line],n.offset+=i[n.line]-1)}}function cS(t,e){let r=e.start._index,n=e.start._bufferIndex,i=e.end._index,o=e.end._bufferIndex,s;if(r===i)s=[t[r].slice(n,o)];else{if(s=t.slice(r,i),n>-1){let a=s[0];typeof a=="string"?s[0]=a.slice(n):s.shift()}o>0&&s.push(t[i].slice(0,o))}return s}function fS(t,e){let r=-1,n=[],i;for(;++r<t.length;){let o=t[r],s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
60
+ `)}`:"";e.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(d).length,Object.keys(d).join(", ")+y))}},o.unknownArguments=function(f,p,d,m,y=!0){var g;let b=t.getInternalMethods().getCommandInstance().getCommands(),C=[],w=t.getInternalMethods().getContext();if(Object.keys(f).forEach(D=>{!hh.includes(D)&&!Object.prototype.hasOwnProperty.call(d,D)&&!Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),D)&&!o.isValidAndSomeAliasIsNotNew(D,p)&&C.push(D)}),y&&(w.commands.length>0||b.length>0||m)&&f._.slice(w.commands.length).forEach(D=>{b.includes(""+D)||C.push(""+D)}),y){let R=((g=t.getDemandedCommands()._)===null||g===void 0?void 0:g.max)||0,S=w.commands.length+R;S<f._.length&&f._.slice(S).forEach(de=>{de=String(de),!w.commands.includes(de)&&!C.includes(de)&&C.push(de)})}C.length&&e.fail(i("Unknown argument: %s","Unknown arguments: %s",C.length,C.map(D=>D.trim()?D:`"${D}"`).join(", ")))},o.unknownCommands=function(f){let p=t.getInternalMethods().getCommandInstance().getCommands(),d=[],m=t.getInternalMethods().getContext();return(m.commands.length>0||p.length>0)&&f._.slice(m.commands.length).forEach(y=>{p.includes(""+y)||d.push(""+y)}),d.length>0?(e.fail(i("Unknown command: %s","Unknown commands: %s",d.length,d.join(", "))),!0):!1},o.isValidAndSomeAliasIsNotNew=function(f,p){if(!Object.prototype.hasOwnProperty.call(p,f))return!1;let d=t.parsed.newAliases;return[f,...p[f]].some(m=>!Object.prototype.hasOwnProperty.call(d,m)||!d[f])},o.limitedChoices=function(f){let p=t.getOptions(),d={};if(!Object.keys(p.choices).length)return;Object.keys(f).forEach(g=>{hh.indexOf(g)===-1&&Object.prototype.hasOwnProperty.call(p.choices,g)&&[].concat(f[g]).forEach(b=>{p.choices[g].indexOf(b)===-1&&b!==void 0&&(d[g]=(d[g]||[]).concat(b))})});let m=Object.keys(d);if(!m.length)return;let y=n("Invalid values:");m.forEach(g=>{y+=`
61
+ ${n("Argument: %s, Given: %s, Choices: %s",g,e.stringifiedValues(d[g]),e.stringifiedValues(p.choices[g]))}`}),e.fail(y)};let s={};o.implies=function(f,p){H("<string|object> [array|number|string]",[f,p],arguments.length),typeof f=="object"?Object.keys(f).forEach(d=>{o.implies(d,f[d])}):(t.global(f),s[f]||(s[f]=[]),Array.isArray(p)?p.forEach(d=>o.implies(f,d)):(Dt(p,void 0,r),s[f].push(p)))},o.getImplied=function(){return s};function a(c,f){let p=Number(f);return f=isNaN(p)?f:p,typeof f=="number"?f=c._.length>=f:f.match(/^--no-.+/)?(f=f.match(/^--no-(.+)/)[1],f=!Object.prototype.hasOwnProperty.call(c,f)):f=Object.prototype.hasOwnProperty.call(c,f),f}o.implications=function(f){let p=[];if(Object.keys(s).forEach(d=>{let m=d;(s[d]||[]).forEach(y=>{let g=m,b=y;g=a(f,g),y=a(f,y),g&&!y&&p.push(` ${m} -> ${b}`)})}),p.length){let d=`${n("Implications failed:")}
62
+ `;p.forEach(m=>{d+=m}),e.fail(d)}};let u={};o.conflicts=function(f,p){H("<string|object> [array|string]",[f,p],arguments.length),typeof f=="object"?Object.keys(f).forEach(d=>{o.conflicts(d,f[d])}):(t.global(f),u[f]||(u[f]=[]),Array.isArray(p)?p.forEach(d=>o.conflicts(f,d)):u[f].push(p))},o.getConflicting=()=>u,o.conflicting=function(f){Object.keys(f).forEach(p=>{u[p]&&u[p].forEach(d=>{d&&f[p]!==void 0&&f[d]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",p,d))})}),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(u).forEach(p=>{u[p].forEach(d=>{d&&f[r.Parser.camelCase(p)]!==void 0&&f[r.Parser.camelCase(d)]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",p,d))})})},o.recommendCommands=function(f,p){p=p.sort((g,b)=>b.length-g.length);let m=null,y=1/0;for(let g=0,b;(b=p[g])!==void 0;g++){let C=dh(f,b);C<=3&&C<y&&(y=C,m=b)}m&&e.fail(n("Did you mean %s?",m))},o.reset=function(f){return s=cn(s,p=>!f[p]),u=cn(u,p=>!f[p]),o};let l=[];return o.freeze=function(){l.push({implied:s,conflicting:u})},o.unfreeze=function(){let f=l.pop();Dt(f,void 0,r),{implied:s,conflicting:u}=f},o}var yc=[],is;function os(t,e,r,n){is=n;let i={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if(typeof t.extends!="string")return i;let o=/\.json|\..*rc$/.test(t.extends),s=null;if(o)s=MC(e,t.extends);else try{s=Er.resolve(t.extends)}catch{return t}LC(s),yc.push(s),i=o?JSON.parse(is.readFileSync(s,"utf8")):Er(t.extends),delete t.extends,i=os(i,is.path.dirname(s),r,is)}return yc=[],r?gh(i,t):Object.assign({},i,t)}function LC(t){if(yc.indexOf(t)>-1)throw new $e(`Circular extended configurations: '${t}'.`)}function MC(t,e){return is.path.resolve(t,e)}function gh(t,e){let r={};function n(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(r,t);for(let i of Object.keys(e))n(e[i])&&n(r[i])?r[i]=gh(t[i],e[i]):r[i]=e[i];return r}var Y=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},h=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},nt,Gn,ss,nr,Kt,ya,pn,Wn,ba,ir,Ea,or,Ar,Yt,sr,Aa,Vi,Et,re,wa,Ca,Zt,Hn,Gi,Kn,dn,ka,fe,Yn,Zn,Xn,ge,Ta,wr,Qe;function Lh(t){return(e=[],r=t.process.cwd(),n)=>{let i=new Ic(e,r,n,t);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var xh=Symbol("copyDoubleDash"),yh=Symbol("copyDoubleDash"),bc=Symbol("deleteFromParserHintObject"),bh=Symbol("emitWarning"),Eh=Symbol("freeze"),Ah=Symbol("getDollarZero"),Jn=Symbol("getParserConfiguration"),wh=Symbol("getUsageConfiguration"),Ec=Symbol("guessLocale"),Ch=Symbol("guessVersion"),kh=Symbol("parsePositionalNumbers"),Ac=Symbol("pkgUp"),hn=Symbol("populateParserHintArray"),Wi=Symbol("populateParserHintSingleValueDictionary"),wc=Symbol("populateParserHintArrayDictionary"),Cc=Symbol("populateParserHintDictionary"),kc=Symbol("sanitizeKey"),Tc=Symbol("setKey"),_c=Symbol("unfreeze"),Th=Symbol("validateAsync"),_h=Symbol("getCommandInstance"),Sh=Symbol("getContext"),vh=Symbol("getHasOutput"),Ih=Symbol("getLoggerInstance"),Oh=Symbol("getParseContext"),Dh=Symbol("getUsageInstance"),Rh=Symbol("getValidationInstance"),_a=Symbol("hasParseCallback"),Fh=Symbol("isGlobalContext"),Qn=Symbol("postProcess"),Nh=Symbol("rebase"),Sc=Symbol("reset"),as=Symbol("runYargsParserAndExecuteCommands"),vc=Symbol("runValidation"),Ph=Symbol("setHasOutput"),ei=Symbol("kTrackManuallySetKeys"),Ic=class{constructor(e=[],r,n,i){this.customScriptName=!1,this.parsed=!1,nt.set(this,void 0),Gn.set(this,void 0),ss.set(this,{commands:[],fullCommands:[]}),nr.set(this,null),Kt.set(this,null),ya.set(this,"show-hidden"),pn.set(this,null),Wn.set(this,!0),ba.set(this,{}),ir.set(this,!0),Ea.set(this,[]),or.set(this,void 0),Ar.set(this,{}),Yt.set(this,!1),sr.set(this,null),Aa.set(this,!0),Vi.set(this,void 0),Et.set(this,""),re.set(this,void 0),wa.set(this,void 0),Ca.set(this,{}),Zt.set(this,null),Hn.set(this,null),Gi.set(this,{}),Kn.set(this,{}),dn.set(this,void 0),ka.set(this,!1),fe.set(this,void 0),Yn.set(this,!1),Zn.set(this,!1),Xn.set(this,!1),ge.set(this,void 0),Ta.set(this,{}),wr.set(this,null),Qe.set(this,void 0),Y(this,fe,i,"f"),Y(this,dn,e,"f"),Y(this,Gn,r,"f"),Y(this,wa,n,"f"),Y(this,or,new ma(this),"f"),this.$0=this[Ah](),this[Sc](),Y(this,nt,h(this,nt,"f"),"f"),Y(this,ge,h(this,ge,"f"),"f"),Y(this,Qe,h(this,Qe,"f"),"f"),Y(this,re,h(this,re,"f"),"f"),h(this,re,"f").showHiddenOpt=h(this,ya,"f"),Y(this,Vi,this[yh](),"f")}addHelpOpt(e,r){let n="help";return H("[string|boolean] [string]",[e,r],arguments.length),h(this,sr,"f")&&(this[bc](h(this,sr,"f")),Y(this,sr,null,"f")),e===!1&&r===void 0?this:(Y(this,sr,typeof e=="string"?e:n,"f"),this.boolean(h(this,sr,"f")),this.describe(h(this,sr,"f"),r||h(this,ge,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(H("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;let n=typeof e=="string"?e:h(this,ya,"f");return this.boolean(n),this.describe(n,r||h(this,ge,"f").deferY18nLookup("Show hidden options")),h(this,re,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return H("<object|string|array> [string|array]",[e,r],arguments.length),this[wc](this.alias.bind(this),"alias",e,r),this}array(e){return H("<array|string>",[e],arguments.length),this[hn]("array",e),this[ei](e),this}boolean(e){return H("<array|string>",[e],arguments.length),this[hn]("boolean",e),this[ei](e),this}check(e,r){return H("<function> [boolean]",[e,r],arguments.length),this.middleware((n,i)=>Vn(()=>e(n,i.getOptions()),o=>(o?(typeof o=="string"||o instanceof Error)&&h(this,ge,"f").fail(o.toString(),o):h(this,ge,"f").fail(h(this,fe,"f").y18n.__("Argument check failed: %s",e.toString())),n),o=>(h(this,ge,"f").fail(o.message?o.message:o.toString(),o),n)),!1,r),this}choices(e,r){return H("<object|string|array> [string|array]",[e,r],arguments.length),this[wc](this.choices.bind(this),"choices",e,r),this}coerce(e,r){if(H("<object|string|array> [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new $e("coerce callback must be provided");for(let n of e)this.coerce(n,r);return this}else if(typeof e=="object"){for(let n of Object.keys(e))this.coerce(n,e[n]);return this}if(!r)throw new $e("coerce callback must be provided");return h(this,re,"f").key[e]=!0,h(this,or,"f").addCoerceMiddleware((n,i)=>{let o;return Object.prototype.hasOwnProperty.call(n,e)?Vn(()=>(o=i.getAliases(),r(n[e])),a=>{n[e]=a;let u=i.getInternalMethods().getParserConfiguration()["strip-aliased"];if(o[e]&&u!==!0)for(let l of o[e])n[l]=a;return n},a=>{throw new $e(a.message)}):n},e),this}conflicts(e,r){return H("<string|object> [string|array]",[e,r],arguments.length),h(this,Qe,"f").conflicts(e,r),this}config(e="config",r,n){return H("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=os(e,h(this,Gn,"f"),this[Jn]()["deep-merge-config"]||!1,h(this,fe,"f")),h(this,re,"f").configObjects=(h(this,re,"f").configObjects||[]).concat(e),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(e,r||h(this,ge,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(i=>{h(this,re,"f").config[i]=n||!0}),this)}completion(e,r,n){return H("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),Y(this,Kt,e||h(this,Kt,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(h(this,Kt,"f"),r),n&&h(this,nr,"f").registerFunction(n),this}command(e,r,n,i,o,s){return H("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,i,o,s],arguments.length),h(this,nt,"f").addHandler(e,r,n,i,o,s),this}commands(e,r,n,i,o,s){return this.command(e,r,n,i,o,s)}commandDir(e,r){H("<string> [object]",[e,r],arguments.length);let n=h(this,wa,"f")||h(this,fe,"f").require;return h(this,nt,"f").addDirectory(e,n,h(this,fe,"f").getCallerFile(),r),this}count(e){return H("<array|string>",[e],arguments.length),this[hn]("count",e),this[ei](e),this}default(e,r,n){return H("<object|string|array> [*] [string]",[e,r,n],arguments.length),n&&(dc(e,h(this,fe,"f")),h(this,re,"f").defaultDescription[e]=n),typeof r=="function"&&(dc(e,h(this,fe,"f")),h(this,re,"f").defaultDescription[e]||(h(this,re,"f").defaultDescription[e]=h(this,ge,"f").functionDescription(r)),r=r.call()),this[Wi](this.default.bind(this),"default",e,r),this}defaults(e,r,n){return this.default(e,r,n)}demandCommand(e=1,r,n,i){return H("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,r,n,i],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),h(this,re,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:i},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(i=>{Dt(n,!0,h(this,fe,"f")),this.demandOption(i,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(Dt(n,!0,h(this,fe,"f")),this.demandCommand(e,r,n,n)):Array.isArray(e)?e.forEach(i=>{Dt(n,!0,h(this,fe,"f")),this.demandOption(i,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,r){return H("<object|string|array> [string]",[e,r],arguments.length),this[Wi](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return H("<string> [string|boolean]",[e,r],arguments.length),h(this,re,"f").deprecatedOptions[e]=r,this}describe(e,r){return H("<object|string|array> [string]",[e,r],arguments.length),this[Tc](e,!0),h(this,ge,"f").describe(e,r),this}detectLocale(e){return H("<boolean>",[e],arguments.length),Y(this,Wn,e,"f"),this}env(e){return H("[string|boolean]",[e],arguments.length),e===!1?delete h(this,re,"f").envPrefix:h(this,re,"f").envPrefix=e||"",this}epilogue(e){return H("<string>",[e],arguments.length),h(this,ge,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return H("<string|array> [string]",[e,r],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):h(this,ge,"f").example(e,r),this}exit(e,r){Y(this,Yt,!0,"f"),Y(this,pn,r,"f"),h(this,ir,"f")&&h(this,fe,"f").process.exit(e)}exitProcess(e=!0){return H("[boolean]",[e],arguments.length),Y(this,ir,e,"f"),this}fail(e){if(H("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new $e("Invalid first argument. Expected function or boolean 'false'");return h(this,ge,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){return H("<array> [function]",[e,r],arguments.length),r?h(this,nr,"f").getCompletion(e,r):new Promise((n,i)=>{h(this,nr,"f").getCompletion(e,(o,s)=>{o?i(o):n(s)})})}getDemandedOptions(){return H([],0),h(this,re,"f").demandedOptions}getDemandedCommands(){return H([],0),h(this,re,"f").demandedCommands}getDeprecatedOptions(){return H([],0),h(this,re,"f").deprecatedOptions}getDetectLocale(){return h(this,Wn,"f")}getExitProcess(){return h(this,ir,"f")}getGroups(){return Object.assign({},h(this,Ar,"f"),h(this,Kn,"f"))}getHelp(){if(Y(this,Yt,!0,"f"),!h(this,ge,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[as](h(this,dn,"f"),void 0,void 0,0,!0);if(qe(r))return r.then(()=>h(this,ge,"f").help())}let e=h(this,nt,"f").runDefaultBuilderOn(this);if(qe(e))return e.then(()=>h(this,ge,"f").help())}return Promise.resolve(h(this,ge,"f").help())}getOptions(){return h(this,re,"f")}getStrict(){return h(this,Yn,"f")}getStrictCommands(){return h(this,Zn,"f")}getStrictOptions(){return h(this,Xn,"f")}global(e,r){return H("<string|array> [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?h(this,re,"f").local=h(this,re,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{h(this,re,"f").local.includes(n)||h(this,re,"f").local.push(n)}),this}group(e,r){H("<string|array> <string>",[e,r],arguments.length);let n=h(this,Kn,"f")[r]||h(this,Ar,"f")[r];h(this,Kn,"f")[r]&&delete h(this,Kn,"f")[r];let i={};return h(this,Ar,"f")[r]=(n||[]).concat(e).filter(o=>i[o]?!1:i[o]=!0),this}hide(e){return H("<string>",[e],arguments.length),h(this,re,"f").hiddenOptions.push(e),this}implies(e,r){return H("<string|object> [number|string|array]",[e,r],arguments.length),h(this,Qe,"f").implies(e,r),this}locale(e){return H("[string]",[e],arguments.length),e===void 0?(this[Ec](),h(this,fe,"f").y18n.getLocale()):(Y(this,Wn,!1,"f"),h(this,fe,"f").y18n.setLocale(e),this)}middleware(e,r,n){return h(this,or,"f").addMiddleware(e,!!r,n)}nargs(e,r){return H("<string|object|array> [number]",[e,r],arguments.length),this[Wi](this.nargs.bind(this),"narg",e,r),this}normalize(e){return H("<array|string>",[e],arguments.length),this[hn]("normalize",e),this}number(e){return H("<array|string>",[e],arguments.length),this[hn]("number",e),this[ei](e),this}option(e,r){if(H("<string|object> [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[ei](e),h(this,wr,"f")&&(e==="version"||r?.alias==="version")&&this[bh](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
63
+ `),void 0,"versionWarning"),h(this,re,"f").key[e]=!0,r.alias&&this.alias(e,r.alias);let n=r.deprecate||r.deprecated;n&&this.deprecateOption(e,n);let i=r.demand||r.required||r.require;i&&this.demand(e,i),r.demandOption&&this.demandOption(e,typeof r.demandOption=="string"?r.demandOption:void 0),r.conflicts&&this.conflicts(e,r.conflicts),"default"in r&&this.default(e,r.default),r.implies!==void 0&&this.implies(e,r.implies),r.nargs!==void 0&&this.nargs(e,r.nargs),r.config&&this.config(e,r.configParser),r.normalize&&this.normalize(e),r.choices&&this.choices(e,r.choices),r.coerce&&this.coerce(e,r.coerce),r.group&&this.group(e,r.group),(r.boolean||r.type==="boolean")&&(this.boolean(e),r.alias&&this.boolean(r.alias)),(r.array||r.type==="array")&&(this.array(e),r.alias&&this.array(r.alias)),(r.number||r.type==="number")&&(this.number(e),r.alias&&this.number(r.alias)),(r.string||r.type==="string")&&(this.string(e),r.alias&&this.string(r.alias)),(r.count||r.type==="count")&&this.count(e),typeof r.global=="boolean"&&this.global(e,r.global),r.defaultDescription&&(h(this,re,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);let o=r.describe||r.description||r.desc,s=h(this,ge,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(s,e)||typeof o=="string")&&this.describe(e,o),r.hidden&&this.hide(e),r.requiresArg&&this.requiresArg(e)}return this}options(e,r){return this.option(e,r)}parse(e,r,n){H("[string|array] [function|boolean|object] [function]",[e,r,n],arguments.length),this[Eh](),typeof e>"u"&&(e=h(this,dn,"f")),typeof r=="object"&&(Y(this,Hn,r,"f"),r=n),typeof r=="function"&&(Y(this,Zt,r,"f"),r=!1),r||Y(this,dn,e,"f"),h(this,Zt,"f")&&Y(this,ir,!1,"f");let i=this[as](e,!!r),o=this.parsed;return h(this,nr,"f").setParsed(this.parsed),qe(i)?i.then(s=>(h(this,Zt,"f")&&h(this,Zt,"f").call(this,h(this,pn,"f"),s,h(this,Et,"f")),s)).catch(s=>{throw h(this,Zt,"f")&&h(this,Zt,"f")(s,this.parsed.argv,h(this,Et,"f")),s}).finally(()=>{this[_c](),this.parsed=o}):(h(this,Zt,"f")&&h(this,Zt,"f").call(this,h(this,pn,"f"),i,h(this,Et,"f")),this[_c](),this.parsed=o,i)}parseAsync(e,r,n){let i=this.parse(e,r,n);return qe(i)?i:Promise.resolve(i)}parseSync(e,r,n){let i=this.parse(e,r,n);if(qe(i))throw new $e(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(e){return H("<object>",[e],arguments.length),Y(this,Ca,e,"f"),this}pkgConf(e,r){H("<string> [string]",[e,r],arguments.length);let n=null,i=this[Ac](r||h(this,Gn,"f"));return i[e]&&typeof i[e]=="object"&&(n=os(i[e],r||h(this,Gn,"f"),this[Jn]()["deep-merge-config"]||!1,h(this,fe,"f")),h(this,re,"f").configObjects=(h(this,re,"f").configObjects||[]).concat(n)),this}positional(e,r){H("<string> <object>",[e,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=cn(r,(s,a)=>s==="type"&&!["string","number","boolean"].includes(a)?!1:n.includes(s));let i=h(this,ss,"f").fullCommands[h(this,ss,"f").fullCommands.length-1],o=i?h(this,nt,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return $i(o).forEach(s=>{let a=o[s];Array.isArray(a)?a.indexOf(e)!==-1&&(r[s]=!0):a[e]&&!(s in r)&&(r[s]=a[e])}),this.group(e,h(this,ge,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return H("[boolean]",[e],arguments.length),Y(this,ka,e,"f"),this}required(e,r,n){return this.demand(e,r,n)}require(e,r,n){return this.demand(e,r,n)}requiresArg(e){return H("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&h(this,re,"f").narg[e]?this:(this[Wi](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return H("[string] [string]",[e,r],arguments.length),e=e||this.$0,h(this,Vi,"f").log(h(this,nr,"f").generateCompletionScript(e,r||h(this,Kt,"f")||"completion")),this}showHelp(e){if(H("[string|function]",[e],arguments.length),Y(this,Yt,!0,"f"),!h(this,ge,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[as](h(this,dn,"f"),void 0,void 0,0,!0);if(qe(n))return n.then(()=>{h(this,ge,"f").showHelp(e)}),this}let r=h(this,nt,"f").runDefaultBuilderOn(this);if(qe(r))return r.then(()=>{h(this,ge,"f").showHelp(e)}),this}return h(this,ge,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return H("[boolean|string] [string]",[e,r],arguments.length),h(this,ge,"f").showHelpOnFail(e,r),this}showVersion(e){return H("[string|function]",[e],arguments.length),h(this,ge,"f").showVersion(e),this}skipValidation(e){return H("<array|string>",[e],arguments.length),this[hn]("skipValidation",e),this}strict(e){return H("[boolean]",[e],arguments.length),Y(this,Yn,e!==!1,"f"),this}strictCommands(e){return H("[boolean]",[e],arguments.length),Y(this,Zn,e!==!1,"f"),this}strictOptions(e){return H("[boolean]",[e],arguments.length),Y(this,Xn,e!==!1,"f"),this}string(e){return H("<array|string>",[e],arguments.length),this[hn]("string",e),this[ei](e),this}terminalWidth(){return H([],0),h(this,fe,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return H("<object>",[e],arguments.length),Y(this,Wn,!1,"f"),h(this,fe,"f").y18n.updateLocale(e),this}usage(e,r,n,i){if(H("<string|null|undefined> [string|boolean] [function|object] [function]",[e,r,n,i],arguments.length),r!==void 0){if(Dt(e,null,h(this,fe,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,r,n,i);throw new $e(".usage() description must start with $0 if being used as alias for .command()")}else return h(this,ge,"f").usage(e),this}usageConfiguration(e){return H("<object>",[e],arguments.length),Y(this,Ta,e,"f"),this}version(e,r,n){let i="version";if(H("[boolean|string] [string] [string]",[e,r,n],arguments.length),h(this,wr,"f")&&(this[bc](h(this,wr,"f")),h(this,ge,"f").version(void 0),Y(this,wr,null,"f")),arguments.length===0)n=this[Ch](),e=i;else if(arguments.length===1){if(e===!1)return this;n=e,e=i}else arguments.length===2&&(n=r,r=void 0);return Y(this,wr,typeof e=="string"?e:i,"f"),r=r||h(this,ge,"f").deferY18nLookup("Show version number"),h(this,ge,"f").version(n||void 0),this.boolean(h(this,wr,"f")),this.describe(h(this,wr,"f"),r),this}wrap(e){return H("<number|null|undefined>",[e],arguments.length),h(this,ge,"f").wrap(e),this}[(nt=new WeakMap,Gn=new WeakMap,ss=new WeakMap,nr=new WeakMap,Kt=new WeakMap,ya=new WeakMap,pn=new WeakMap,Wn=new WeakMap,ba=new WeakMap,ir=new WeakMap,Ea=new WeakMap,or=new WeakMap,Ar=new WeakMap,Yt=new WeakMap,sr=new WeakMap,Aa=new WeakMap,Vi=new WeakMap,Et=new WeakMap,re=new WeakMap,wa=new WeakMap,Ca=new WeakMap,Zt=new WeakMap,Hn=new WeakMap,Gi=new WeakMap,Kn=new WeakMap,dn=new WeakMap,ka=new WeakMap,fe=new WeakMap,Yn=new WeakMap,Zn=new WeakMap,Xn=new WeakMap,ge=new WeakMap,Ta=new WeakMap,wr=new WeakMap,Qe=new WeakMap,xh)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[yh](){return{log:(...e)=>{this[_a]()||console.log(...e),Y(this,Yt,!0,"f"),h(this,Et,"f").length&&Y(this,Et,h(this,Et,"f")+`
64
+ `,"f"),Y(this,Et,h(this,Et,"f")+e.join(" "),"f")},error:(...e)=>{this[_a]()||console.error(...e),Y(this,Yt,!0,"f"),h(this,Et,"f").length&&Y(this,Et,h(this,Et,"f")+`
65
+ `,"f"),Y(this,Et,h(this,Et,"f")+e.join(" "),"f")}}}[bc](e){$i(h(this,re,"f")).forEach(r=>{if((i=>i==="configObjects")(r))return;let n=h(this,re,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete h(this,ge,"f").getDescriptions()[e]}[bh](e,r,n){h(this,ba,"f")[n]||(h(this,fe,"f").process.emitWarning(e,r),h(this,ba,"f")[n]=!0)}[Eh](){h(this,Ea,"f").push({options:h(this,re,"f"),configObjects:h(this,re,"f").configObjects.slice(0),exitProcess:h(this,ir,"f"),groups:h(this,Ar,"f"),strict:h(this,Yn,"f"),strictCommands:h(this,Zn,"f"),strictOptions:h(this,Xn,"f"),completionCommand:h(this,Kt,"f"),output:h(this,Et,"f"),exitError:h(this,pn,"f"),hasOutput:h(this,Yt,"f"),parsed:this.parsed,parseFn:h(this,Zt,"f"),parseContext:h(this,Hn,"f")}),h(this,ge,"f").freeze(),h(this,Qe,"f").freeze(),h(this,nt,"f").freeze(),h(this,or,"f").freeze()}[Ah](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(h(this,fe,"f").process.argv()[0])?r=h(this,fe,"f").process.argv().slice(1,2):r=h(this,fe,"f").process.argv().slice(0,1),e=r.map(n=>{let i=this[Nh](h(this,Gn,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),h(this,fe,"f").getEnv("_")&&h(this,fe,"f").getProcessArgvBin()===h(this,fe,"f").getEnv("_")&&(e=h(this,fe,"f").getEnv("_").replace(`${h(this,fe,"f").path.dirname(h(this,fe,"f").process.execPath())}/`,"")),e}[Jn](){return h(this,Ca,"f")}[wh](){return h(this,Ta,"f")}[Ec](){if(!h(this,Wn,"f"))return;let e=h(this,fe,"f").getEnv("LC_ALL")||h(this,fe,"f").getEnv("LC_MESSAGES")||h(this,fe,"f").getEnv("LANG")||h(this,fe,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[Ch](){return this[Ac]().version||"unknown"}[kh](e){let r=e["--"]?e["--"]:e._;for(let n=0,i;(i=r[n])!==void 0;n++)h(this,fe,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(r[n]=Number(i));return e}[Ac](e){let r=e||"*";if(h(this,Gi,"f")[r])return h(this,Gi,"f")[r];let n={};try{let i=e||h(this,fe,"f").mainFilename;!e&&h(this,fe,"f").path.extname(i)&&(i=h(this,fe,"f").path.dirname(i));let o=h(this,fe,"f").findUp(i,(s,a)=>{if(a.includes("package.json"))return"package.json"});Dt(o,void 0,h(this,fe,"f")),n=JSON.parse(h(this,fe,"f").readFileSync(o,"utf8"))}catch{}return h(this,Gi,"f")[r]=n||{},h(this,Gi,"f")[r]}[hn](e,r){r=[].concat(r),r.forEach(n=>{n=this[kc](n),h(this,re,"f")[e].push(n)})}[Wi](e,r,n,i){this[Cc](e,r,n,i,(o,s,a)=>{h(this,re,"f")[o][s]=a})}[wc](e,r,n,i){this[Cc](e,r,n,i,(o,s,a)=>{h(this,re,"f")[o][s]=(h(this,re,"f")[o][s]||[]).concat(a)})}[Cc](e,r,n,i,o){if(Array.isArray(n))n.forEach(s=>{e(s,i)});else if((s=>typeof s=="object")(n))for(let s of $i(n))e(s,n[s]);else o(r,this[kc](n),i)}[kc](e){return e==="__proto__"?"___proto___":e}[Tc](e,r){return this[Wi](this[Tc].bind(this),"key",e,r),this}[_c](){var e,r,n,i,o,s,a,u,l,c,f,p;let d=h(this,Ea,"f").pop();Dt(d,void 0,h(this,fe,"f"));let m;e=this,r=this,n=this,i=this,o=this,s=this,a=this,u=this,l=this,c=this,f=this,p=this,{options:{set value(y){Y(e,re,y,"f")}}.value,configObjects:m,exitProcess:{set value(y){Y(r,ir,y,"f")}}.value,groups:{set value(y){Y(n,Ar,y,"f")}}.value,output:{set value(y){Y(i,Et,y,"f")}}.value,exitError:{set value(y){Y(o,pn,y,"f")}}.value,hasOutput:{set value(y){Y(s,Yt,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){Y(a,Yn,y,"f")}}.value,strictCommands:{set value(y){Y(u,Zn,y,"f")}}.value,strictOptions:{set value(y){Y(l,Xn,y,"f")}}.value,completionCommand:{set value(y){Y(c,Kt,y,"f")}}.value,parseFn:{set value(y){Y(f,Zt,y,"f")}}.value,parseContext:{set value(y){Y(p,Hn,y,"f")}}.value}=d,h(this,re,"f").configObjects=m,h(this,ge,"f").unfreeze(),h(this,Qe,"f").unfreeze(),h(this,nt,"f").unfreeze(),h(this,or,"f").unfreeze()}[Th](e,r){return Vn(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[_h].bind(this),getContext:this[Sh].bind(this),getHasOutput:this[vh].bind(this),getLoggerInstance:this[Ih].bind(this),getParseContext:this[Oh].bind(this),getParserConfiguration:this[Jn].bind(this),getUsageConfiguration:this[wh].bind(this),getUsageInstance:this[Dh].bind(this),getValidationInstance:this[Rh].bind(this),hasParseCallback:this[_a].bind(this),isGlobalContext:this[Fh].bind(this),postProcess:this[Qn].bind(this),reset:this[Sc].bind(this),runValidation:this[vc].bind(this),runYargsParserAndExecuteCommands:this[as].bind(this),setHasOutput:this[Ph].bind(this)}}[_h](){return h(this,nt,"f")}[Sh](){return h(this,ss,"f")}[vh](){return h(this,Yt,"f")}[Ih](){return h(this,Vi,"f")}[Oh](){return h(this,Hn,"f")||{}}[Dh](){return h(this,ge,"f")}[Rh](){return h(this,Qe,"f")}[_a](){return!!h(this,Zt,"f")}[Fh](){return h(this,Aa,"f")}[Qn](e,r,n,i){return n||qe(e)||(r||(e=this[xh](e)),(this[Jn]()["parse-positional-numbers"]||this[Jn]()["parse-positional-numbers"]===void 0)&&(e=this[kh](e)),i&&(e=qn(e,this,h(this,or,"f").getMiddleware(),!1))),e}[Sc](e={}){Y(this,re,h(this,re,"f")||{},"f");let r={};r.local=h(this,re,"f").local||[],r.configObjects=h(this,re,"f").configObjects||[];let n={};r.local.forEach(s=>{n[s]=!0,(e[s]||[]).forEach(a=>{n[a]=!0})}),Object.assign(h(this,Kn,"f"),Object.keys(h(this,Ar,"f")).reduce((s,a)=>{let u=h(this,Ar,"f")[a].filter(l=>!(l in n));return u.length>0&&(s[a]=u),s},{})),Y(this,Ar,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(s=>{r[s]=(h(this,re,"f")[s]||[]).filter(a=>!n[a])}),o.forEach(s=>{r[s]=cn(h(this,re,"f")[s],a=>!n[a])}),r.envPrefix=h(this,re,"f").envPrefix,Y(this,re,r,"f"),Y(this,ge,h(this,ge,"f")?h(this,ge,"f").reset(n):lh(this,h(this,fe,"f")),"f"),Y(this,Qe,h(this,Qe,"f")?h(this,Qe,"f").reset(n):mh(this,h(this,ge,"f"),h(this,fe,"f")),"f"),Y(this,nt,h(this,nt,"f")?h(this,nt,"f").reset():sh(h(this,ge,"f"),h(this,Qe,"f"),h(this,or,"f"),h(this,fe,"f")),"f"),h(this,nr,"f")||Y(this,nr,ph(this,h(this,ge,"f"),h(this,nt,"f"),h(this,fe,"f")),"f"),h(this,or,"f").reset(),Y(this,Kt,null,"f"),Y(this,Et,"","f"),Y(this,pn,null,"f"),Y(this,Yt,!1,"f"),this.parsed=!1,this}[Nh](e,r){return h(this,fe,"f").path.relative(e,r)}[as](e,r,n,i=0,o=!1){let s=!!n||o;e=e||h(this,dn,"f"),h(this,re,"f").__=h(this,fe,"f").y18n.__,h(this,re,"f").configuration=this[Jn]();let a=!!h(this,re,"f").configuration["populate--"],u=Object.assign({},h(this,re,"f").configuration,{"populate--":!0}),l=h(this,fe,"f").Parser.detailed(e,Object.assign({},h(this,re,"f"),{configuration:{"parse-positional-numbers":!1,...u}})),c=Object.assign(l.argv,h(this,Hn,"f")),f,p=l.aliases,d=!1,m=!1;Object.keys(c).forEach(y=>{y===h(this,sr,"f")&&c[y]?d=!0:y===h(this,wr,"f")&&c[y]&&(m=!0)}),c.$0=this.$0,this.parsed=l,i===0&&h(this,ge,"f").clearCachedHelpMessage();try{if(this[Ec](),r)return this[Qn](c,a,!!n,!1);h(this,sr,"f")&&[h(this,sr,"f")].concat(p[h(this,sr,"f")]||[]).filter(w=>w.length>1).includes(""+c._[c._.length-1])&&(c._.pop(),d=!0),Y(this,Aa,!1,"f");let y=h(this,nt,"f").getCommands(),g=h(this,nr,"f").completionKey in c,b=d||g||o;if(c._.length){if(y.length){let C;for(let w=i||0,D;c._[w]!==void 0;w++)if(D=String(c._[w]),y.includes(D)&&D!==h(this,Kt,"f")){let R=h(this,nt,"f").runCommand(D,this,l,w+1,o,d||m||o);return this[Qn](R,a,!!n,!1)}else if(!C&&D!==h(this,Kt,"f")){C=D;break}!h(this,nt,"f").hasDefaultCommand()&&h(this,ka,"f")&&C&&!b&&h(this,Qe,"f").recommendCommands(C,y)}h(this,Kt,"f")&&c._.includes(h(this,Kt,"f"))&&!g&&(h(this,ir,"f")&&fn(!0),this.showCompletionScript(),this.exit(0))}if(h(this,nt,"f").hasDefaultCommand()&&!b){let C=h(this,nt,"f").runCommand(null,this,l,0,o,d||m||o);return this[Qn](C,a,!!n,!1)}if(g){h(this,ir,"f")&&fn(!0),e=[].concat(e);let C=e.slice(e.indexOf(`--${h(this,nr,"f").completionKey}`)+1);return h(this,nr,"f").getCompletion(C,(w,D)=>{if(w)throw new $e(w.message);(D||[]).forEach(R=>{h(this,Vi,"f").log(R)}),this.exit(0)}),this[Qn](c,!a,!!n,!1)}if(h(this,Yt,"f")||(d?(h(this,ir,"f")&&fn(!0),s=!0,this.showHelp("log"),this.exit(0)):m&&(h(this,ir,"f")&&fn(!0),s=!0,h(this,ge,"f").showVersion("log"),this.exit(0))),!s&&h(this,re,"f").skipValidation.length>0&&(s=Object.keys(c).some(C=>h(this,re,"f").skipValidation.indexOf(C)>=0&&c[C]===!0)),!s){if(l.error)throw new $e(l.error.message);if(!g){let C=this[vc](p,{},l.error);n||(f=qn(c,this,h(this,or,"f").getMiddleware(),!0)),f=this[Th](C,f??c),qe(f)&&!n&&(f=f.then(()=>qn(c,this,h(this,or,"f").getMiddleware(),!1)))}}}catch(y){if(y instanceof $e)h(this,ge,"f").fail(y.message,y);else throw y}return this[Qn](f??c,a,!!n,!0)}[vc](e,r,n,i){let o={...this.getDemandedOptions()};return s=>{if(n)throw new $e(n.message);h(this,Qe,"f").nonOptionCount(s),h(this,Qe,"f").requiredArguments(s,o);let a=!1;h(this,Zn,"f")&&(a=h(this,Qe,"f").unknownCommands(s)),h(this,Yn,"f")&&!a?h(this,Qe,"f").unknownArguments(s,e,r,!!i):h(this,Xn,"f")&&h(this,Qe,"f").unknownArguments(s,e,{},!1,!1),h(this,Qe,"f").limitedChoices(s),h(this,Qe,"f").implications(s),h(this,Qe,"f").conflicting(s)}}[Ph](){Y(this,Yt,!0,"f")}[ei](e){if(typeof e=="string")h(this,re,"f").key[e]=!0;else for(let r of e)h(this,re,"f").key[r]=!0}};function ah(t){return!!t&&typeof t.getInternalMethods=="function"}var BC=Lh(pc),Mh=BC;var Bh="1.0.2";var La=ts(la(),1);import{cosmiconfig as lm}from"cosmiconfig";import{TypeScriptLoader as cm}from"cosmiconfig-typescript-loader";import lT from"node:fs/promises";import dm from"node:path";var Oc=ts(zh(),1);function Dc(t,e,r){if(typeof e=="number"&&(r=e),Oc.default.has(t.toLowerCase())){e=Oc.default.get(t.toLowerCase());let n=t.charAt(0);n===n.toUpperCase()&&(e=n+e.slice(1)),t===t.toUpperCase()&&(e=e.toUpperCase())}else typeof e!="string"&&(e=(t.replace(/(?:s|x|z|ch|sh)$/i,"$&e").replace(/([^aeiou])y$/i,"$1ie")+"s").replace(/i?e?s$/i,n=>t.slice(-1)===t.slice(-1).toLowerCase()?n.toLowerCase():n.toUpperCase()));return Math.abs(r)===1?t:e}import{readPackage as cT}from"read-pkg";import{deepMergeDefined as $c,log as lr,optionsSchema as fT,rulesSchema as pT}from"remark-mdat";var Oe;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},t.getValidEnumValues=i=>{let o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(let a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(let s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=n,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Oe||(Oe={}));var Fc;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Fc||(Fc={}));var V=Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Hr=t=>{switch(typeof t){case"undefined":return V.undefined;case"string":return V.string;case"number":return isNaN(t)?V.nan:V.number;case"boolean":return V.boolean;case"function":return V.function;case"bigint":return V.bigint;case"symbol":return V.symbol;case"object":return Array.isArray(t)?V.array:t===null?V.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?V.promise:typeof Map<"u"&&t instanceof Map?V.map:typeof Set<"u"&&t instanceof Set?V.set:typeof Date<"u"&&t instanceof Date?V.date:V.object;default:return V.unknown}},N=Oe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),$C=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Xt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(o){return o.message},n={_errors:[]},i=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,u=0;for(;u<s.path.length;){let l=s.path[u];u===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(r(s))):a[l]=a[l]||{_errors:[]},a=a[l],u++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Xt.create=t=>new Xt(t);var Yi=(t,e)=>{let r;switch(t.code){case N.invalid_type:t.received===V.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case N.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Oe.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:r=`Unrecognized key(s) in object: ${Oe.joinValues(t.keys,", ")}`;break;case N.invalid_union:r="Invalid input";break;case N.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Oe.joinValues(t.options)}`;break;case N.invalid_enum_value:r=`Invalid enum value. Expected ${Oe.joinValues(t.options)}, received '${t.received}'`;break;case N.invalid_arguments:r="Invalid function arguments";break;case N.invalid_return_type:r="Invalid function return type";break;case N.invalid_date:r="Invalid date";break;case N.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Oe.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case N.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case N.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case N.custom:r="Invalid input";break;case N.invalid_intersection_types:r="Intersection results could not be merged";break;case N.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case N.not_finite:r="Number must be finite";break;default:r=e.defaultError,Oe.assertNever(t)}return{message:r}},Gh=Yi;function qC(t){Gh=t}function Sa(){return Gh}var va=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,o=[...r,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="",u=n.filter(l=>!!l).slice().reverse();for(let l of u)a=l(s,{data:e,defaultError:a}).message;return{...i,path:o,message:a}},VC=[];function U(t,e){let r=Sa(),n=va({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Yi?void 0:Yi].filter(i=>!!i)});t.common.issues.push(n)}var Tt=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return pe;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let o=await i.key,s=await i.value;n.push({key:o,value:s})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return pe;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[o.value]=s.value)}return{status:e.value,value:n}}},pe=Object.freeze({status:"aborted"}),Ki=t=>({status:"dirty",value:t}),Rt=t=>({status:"valid",value:t}),Nc=t=>t.status==="aborted",Pc=t=>t.status==="dirty",ti=t=>t.status==="valid",cs=t=>typeof Promise<"u"&&t instanceof Promise;function Ia(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function Wh(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var Q;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Q||(Q={}));var us,ls,ur=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},$h=(t,e)=>{if(ti(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Xt(t.common.issues);return this._error=r,this._error}}};function Ae(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{var u,l;let{message:c}=t;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:(u=c??n)!==null&&u!==void 0?u:a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:(l=c??r)!==null&&l!==void 0?l:a.defaultError}},description:i}}var we=class{get description(){return this._def.description}_getType(e){return Hr(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Hr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Tt,ctx:{common:e.parent.common,data:e.data,parsedType:Hr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(cs(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let i={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Hr(e)},o=this._parseSync({data:e,path:i.path,parent:i});return $h(i,o)}"~validate"(e){var r,n;let i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Hr(e)};if(!this["~standard"].async)try{let o=this._parseSync({data:e,path:[],parent:i});return ti(o)?{value:o.value}:{issues:i.common.issues}}catch(o){!((n=(r=o?.message)===null||r===void 0?void 0:r.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:i}).then(o=>ti(o)?{value:o.value}:{issues:i.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Hr(e)},i=this._parse({data:e,path:n.path,parent:n}),o=await(cs(i)?i:Promise.resolve(i));return $h(n,o)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,o)=>{let s=e(i),a=()=>o.addIssue({code:N.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new Jt({schema:this,typeName:le.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ar.create(this,this._def)}nullable(){return kr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Yr.create(this)}promise(){return xn.create(this,this._def)}or(e){return ui.create([this,e],this._def)}and(e){return li.create(this,e,this._def)}transform(e){return new Jt({...Ae(this._def),schema:this,typeName:le.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new hi({...Ae(this._def),innerType:this,defaultValue:r,typeName:le.ZodDefault})}brand(){return new fs({typeName:le.ZodBranded,type:this,...Ae(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new mi({...Ae(this._def),innerType:this,catchValue:r,typeName:le.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return ps.create(this,e)}readonly(){return gi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},GC=/^c[^\s-]{8,}$/i,WC=/^[0-9a-z]+$/,HC=/^[0-9A-HJKMNP-TV-Z]{26}$/i,KC=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,YC=/^[a-z0-9_-]{21}$/i,ZC=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,XC=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,JC=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,QC="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Rc,ek=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,tk=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,rk=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,nk=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ik=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ok=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Hh="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",sk=new RegExp(`^${Hh}$`);function Kh(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function ak(t){return new RegExp(`^${Kh(t)}$`)}function Yh(t){let e=`${Hh}T${Kh(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function uk(t,e){return!!((e==="v4"||!e)&&ek.test(t)||(e==="v6"||!e)&&rk.test(t))}function lk(t,e){if(!ZC.test(t))return!1;try{let[r]=t.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||!i.typ||!i.alg||e&&i.alg!==e)}catch{return!1}}function ck(t,e){return!!((e==="v4"||!e)&&tk.test(t)||(e==="v6"||!e)&&nk.test(t))}var mn=class t extends we{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==V.string){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_type,expected:V.string,received:o.parsedType}),pe}let n=new Tt,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?U(i,{code:N.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&U(i,{code:N.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")JC.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"email",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Rc||(Rc=new RegExp(QC,"u")),Rc.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"emoji",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")KC.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"uuid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")YC.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"nanoid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")GC.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")WC.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid2",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")HC.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ulid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),U(i,{validation:"url",code:N.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"regex",code:N.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Yh(o).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?sk.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?ak(o).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?XC.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"duration",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?uk(e.data,o.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ip",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?lk(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"jwt",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?ck(e.data,o.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cidr",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?ik.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?ok.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64url",code:N.invalid_string,message:o.message}),n.dirty()):Oe.assertNever(o);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:N.invalid_string,...Q.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Q.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Q.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Q.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Q.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Q.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Q.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Q.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Q.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Q.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Q.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Q.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Q.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Q.errToObj(e)})}datetime(e){var r,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(n=e?.local)!==null&&n!==void 0?n:!1,...Q.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Q.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Q.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Q.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...Q.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Q.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Q.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Q.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Q.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Q.errToObj(r)})}nonempty(e){return this.min(1,Q.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};mn.create=t=>{var e;return new mn({checks:[],typeName:le.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Ae(t)})};function fk(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,o=parseInt(t.toFixed(i).replace(".","")),s=parseInt(e.toFixed(i).replace(".",""));return o%s/Math.pow(10,i)}var ri=class t extends we{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==V.number){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_type,expected:V.number,received:o.parsedType}),pe}let n,i=new Tt;for(let o of this._def.checks)o.kind==="int"?Oe.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:N.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?fk(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:N.not_finite,message:o.message}),i.dirty()):Oe.assertNever(o);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Q.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Q.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Q.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Q.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Q.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Q.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Q.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Q.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Q.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Q.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Q.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Oe.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};ri.create=t=>new ri({checks:[],typeName:le.ZodNumber,coerce:t?.coerce||!1,...Ae(t)});var ni=class t extends we{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==V.bigint)return this._getInvalidInput(e);let n,i=new Tt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Oe.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return U(r,{code:N.invalid_type,expected:V.bigint,received:r.parsedType}),pe}gte(e,r){return this.setLimit("min",e,!0,Q.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Q.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Q.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Q.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Q.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Q.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Q.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};ni.create=t=>{var e;return new ni({checks:[],typeName:le.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Ae(t)})};var ii=class extends we{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==V.boolean){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.boolean,received:n.parsedType}),pe}return Rt(e.data)}};ii.create=t=>new ii({typeName:le.ZodBoolean,coerce:t?.coerce||!1,...Ae(t)});var oi=class t extends we{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==V.date){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_type,expected:V.date,received:o.parsedType}),pe}if(isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_date}),pe}let n=new Tt,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Oe.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Q.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Q.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};oi.create=t=>new oi({checks:[],coerce:t?.coerce||!1,typeName:le.ZodDate,...Ae(t)});var Zi=class extends we{_parse(e){if(this._getType(e)!==V.symbol){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.symbol,received:n.parsedType}),pe}return Rt(e.data)}};Zi.create=t=>new Zi({typeName:le.ZodSymbol,...Ae(t)});var si=class extends we{_parse(e){if(this._getType(e)!==V.undefined){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.undefined,received:n.parsedType}),pe}return Rt(e.data)}};si.create=t=>new si({typeName:le.ZodUndefined,...Ae(t)});var ai=class extends we{_parse(e){if(this._getType(e)!==V.null){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.null,received:n.parsedType}),pe}return Rt(e.data)}};ai.create=t=>new ai({typeName:le.ZodNull,...Ae(t)});var gn=class extends we{constructor(){super(...arguments),this._any=!0}_parse(e){return Rt(e.data)}};gn.create=t=>new gn({typeName:le.ZodAny,...Ae(t)});var Kr=class extends we{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Rt(e.data)}};Kr.create=t=>new Kr({typeName:le.ZodUnknown,...Ae(t)});var mr=class extends we{_parse(e){let r=this._getOrReturnCtx(e);return U(r,{code:N.invalid_type,expected:V.never,received:r.parsedType}),pe}};mr.create=t=>new mr({typeName:le.ZodNever,...Ae(t)});var Xi=class extends we{_parse(e){if(this._getType(e)!==V.undefined){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.void,received:n.parsedType}),pe}return Rt(e.data)}};Xi.create=t=>new Xi({typeName:le.ZodVoid,...Ae(t)});var Yr=class t extends we{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==V.array)return U(r,{code:N.invalid_type,expected:V.array,received:r.parsedType}),pe;if(i.exactLength!==null){let s=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(s||a)&&(U(r,{code:s?N.too_big:N.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(U(r,{code:N.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(U(r,{code:N.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>i.type._parseAsync(new ur(r,s,r.path,a)))).then(s=>Tt.mergeArray(n,s));let o=[...r.data].map((s,a)=>i.type._parseSync(new ur(r,s,r.path,a)));return Tt.mergeArray(n,o)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:Q.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:Q.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:Q.toString(r)}})}nonempty(e){return this.min(1,e)}};Yr.create=(t,e)=>new Yr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:le.ZodArray,...Ae(e)});function Hi(t){if(t instanceof zt){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=ar.create(Hi(n))}return new zt({...t._def,shape:()=>e})}else return t instanceof Yr?new Yr({...t._def,type:Hi(t.element)}):t instanceof ar?ar.create(Hi(t.unwrap())):t instanceof kr?kr.create(Hi(t.unwrap())):t instanceof Cr?Cr.create(t.items.map(e=>Hi(e))):t}var zt=class t extends we{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Oe.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==V.object){let l=this._getOrReturnCtx(e);return U(l,{code:N.invalid_type,expected:V.object,received:l.parsedType}),pe}let{status:n,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof mr&&this._def.unknownKeys==="strip"))for(let l in i.data)s.includes(l)||a.push(l);let u=[];for(let l of s){let c=o[l],f=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new ur(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof mr){let l=this._def.unknownKeys;if(l==="passthrough")for(let c of a)u.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict")a.length>0&&(U(i,{code:N.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let c of a){let f=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new ur(i,f,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let c of u){let f=await c.key,p=await c.value;l.push({key:f,value:p,alwaysSet:c.alwaysSet})}return l}).then(l=>Tt.mergeObjectSync(n,l)):Tt.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return Q.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,o,s,a;let u=(s=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,r,n).message)!==null&&s!==void 0?s:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=Q.errToObj(e).message)!==null&&a!==void 0?a:u}:{message:u}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:le.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return Oe.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return Oe.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}deepPartial(){return Hi(this)}partial(e){let r={};return Oe.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return Oe.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof ar;)o=o._def.innerType;r[n]=o}}),new t({...this._def,shape:()=>r})}keyof(){return Zh(Oe.objectKeys(this.shape))}};zt.create=(t,e)=>new zt({shape:()=>t,unknownKeys:"strip",catchall:mr.create(),typeName:le.ZodObject,...Ae(e)});zt.strictCreate=(t,e)=>new zt({shape:()=>t,unknownKeys:"strict",catchall:mr.create(),typeName:le.ZodObject,...Ae(e)});zt.lazycreate=(t,e)=>new zt({shape:t,unknownKeys:"strip",catchall:mr.create(),typeName:le.ZodObject,...Ae(e)});var ui=class extends we{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new Xt(a.ctx.common.issues));return U(r,{code:N.invalid_union,unionErrors:s}),pe}if(r.common.async)return Promise.all(n.map(async o=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let u of n){let l={...r,common:{...r.common,issues:[]},parent:null},c=u._parseSync({data:r.data,path:r.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(u=>new Xt(u));return U(r,{code:N.invalid_union,unionErrors:a}),pe}}get options(){return this._def.options}};ui.create=(t,e)=>new ui({options:t,typeName:le.ZodUnion,...Ae(e)});var Wr=t=>t instanceof ci?Wr(t.schema):t instanceof Jt?Wr(t.innerType()):t instanceof fi?[t.value]:t instanceof pi?t.options:t instanceof di?Oe.objectValues(t.enum):t instanceof hi?Wr(t._def.innerType):t instanceof si?[void 0]:t instanceof ai?[null]:t instanceof ar?[void 0,...Wr(t.unwrap())]:t instanceof kr?[null,...Wr(t.unwrap())]:t instanceof fs||t instanceof gi?Wr(t.unwrap()):t instanceof mi?Wr(t._def.innerType):[],Oa=class t extends we{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==V.object)return U(r,{code:N.invalid_type,expected:V.object,received:r.parsedType}),pe;let n=this.discriminator,i=r.data[n],o=this.optionsMap.get(i);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(U(r,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let o of r){let s=Wr(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new t({typeName:le.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Ae(n)})}};function Lc(t,e){let r=Hr(t),n=Hr(e);if(t===e)return{valid:!0,data:t};if(r===V.object&&n===V.object){let i=Oe.objectKeys(e),o=Oe.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(let a of o){let u=Lc(t[a],e[a]);if(!u.valid)return{valid:!1};s[a]=u.data}return{valid:!0,data:s}}else if(r===V.array&&n===V.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<t.length;o++){let s=t[o],a=e[o],u=Lc(s,a);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===V.date&&n===V.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var li=class extends we{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(o,s)=>{if(Nc(o)||Nc(s))return pe;let a=Lc(o.value,s.value);return a.valid?((Pc(o)||Pc(s))&&r.dirty(),{status:r.value,value:a.data}):(U(n,{code:N.invalid_intersection_types}),pe)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};li.create=(t,e,r)=>new li({left:t,right:e,typeName:le.ZodIntersection,...Ae(r)});var Cr=class t extends we{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.array)return U(n,{code:N.invalid_type,expected:V.array,received:n.parsedType}),pe;if(n.data.length<this._def.items.length)return U(n,{code:N.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pe;!this._def.rest&&n.data.length>this._def.items.length&&(U(n,{code:N.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((s,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new ur(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>Tt.mergeArray(r,s)):Tt.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Cr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Cr({items:t,typeName:le.ZodTuple,rest:null,...Ae(e)})};var Da=class t extends we{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.object)return U(n,{code:N.invalid_type,expected:V.object,received:n.parsedType}),pe;let i=[],o=this._def.keyType,s=this._def.valueType;for(let a in n.data)i.push({key:o._parse(new ur(n,a,n.path,a)),value:s._parse(new ur(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Tt.mergeObjectAsync(r,i):Tt.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof we?new t({keyType:e,valueType:r,typeName:le.ZodRecord,...Ae(n)}):new t({keyType:mn.create(),valueType:e,typeName:le.ZodRecord,...Ae(r)})}},Ji=class extends we{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.map)return U(n,{code:N.invalid_type,expected:V.map,received:n.parsedType}),pe;let i=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([a,u],l)=>({key:i._parse(new ur(n,a,n.path,[l,"key"])),value:o._parse(new ur(n,u,n.path,[l,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of s){let l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return pe;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),a.set(l.value,c.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let u of s){let l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return pe;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),a.set(l.value,c.value)}return{status:r.value,value:a}}}};Ji.create=(t,e,r)=>new Ji({valueType:e,keyType:t,typeName:le.ZodMap,...Ae(r)});var Qi=class t extends we{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.set)return U(n,{code:N.invalid_type,expected:V.set,received:n.parsedType}),pe;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(U(n,{code:N.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(U(n,{code:N.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let o=this._def.valueType;function s(u){let l=new Set;for(let c of u){if(c.status==="aborted")return pe;c.status==="dirty"&&r.dirty(),l.add(c.value)}return{status:r.value,value:l}}let a=[...n.data.values()].map((u,l)=>o._parse(new ur(n,u,n.path,l)));return n.common.async?Promise.all(a).then(u=>s(u)):s(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:Q.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:Q.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Qi.create=(t,e)=>new Qi({valueType:t,minSize:null,maxSize:null,typeName:le.ZodSet,...Ae(e)});var Ra=class t extends we{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==V.function)return U(r,{code:N.invalid_type,expected:V.function,received:r.parsedType}),pe;function n(a,u){return va({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Sa(),Yi].filter(l=>!!l),issueData:{code:N.invalid_arguments,argumentsError:u}})}function i(a,u){return va({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Sa(),Yi].filter(l=>!!l),issueData:{code:N.invalid_return_type,returnTypeError:u}})}let o={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof xn){let a=this;return Rt(async function(...u){let l=new Xt([]),c=await a._def.args.parseAsync(u,o).catch(d=>{throw l.addIssue(n(u,d)),l}),f=await Reflect.apply(s,this,c);return await a._def.returns._def.type.parseAsync(f,o).catch(d=>{throw l.addIssue(i(f,d)),l})})}else{let a=this;return Rt(function(...u){let l=a._def.args.safeParse(u,o);if(!l.success)throw new Xt([n(u,l.error)]);let c=Reflect.apply(s,this,l.data),f=a._def.returns.safeParse(c,o);if(!f.success)throw new Xt([i(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Cr.create(e).rest(Kr.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||Cr.create([]).rest(Kr.create()),returns:r||Kr.create(),typeName:le.ZodFunction,...Ae(n)})}},ci=class extends we{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};ci.create=(t,e)=>new ci({getter:t,typeName:le.ZodLazy,...Ae(e)});var fi=class extends we{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return U(r,{received:r.data,code:N.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:e.data}}get value(){return this._def.value}};fi.create=(t,e)=>new fi({value:t,typeName:le.ZodLiteral,...Ae(e)});function Zh(t,e){return new pi({values:t,typeName:le.ZodEnum,...Ae(e)})}var pi=class t extends we{constructor(){super(...arguments),us.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return U(r,{expected:Oe.joinValues(n),received:r.parsedType,code:N.invalid_type}),pe}if(Ia(this,us,"f")||Wh(this,us,new Set(this._def.values),"f"),!Ia(this,us,"f").has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return U(r,{received:r.data,code:N.invalid_enum_value,options:n}),pe}return Rt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};us=new WeakMap;pi.create=Zh;var di=class extends we{constructor(){super(...arguments),ls.set(this,void 0)}_parse(e){let r=Oe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==V.string&&n.parsedType!==V.number){let i=Oe.objectValues(r);return U(n,{expected:Oe.joinValues(i),received:n.parsedType,code:N.invalid_type}),pe}if(Ia(this,ls,"f")||Wh(this,ls,new Set(Oe.getValidEnumValues(this._def.values)),"f"),!Ia(this,ls,"f").has(e.data)){let i=Oe.objectValues(r);return U(n,{received:n.data,code:N.invalid_enum_value,options:i}),pe}return Rt(e.data)}get enum(){return this._def.values}};ls=new WeakMap;di.create=(t,e)=>new di({values:t,typeName:le.ZodNativeEnum,...Ae(e)});var xn=class extends we{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==V.promise&&r.common.async===!1)return U(r,{code:N.invalid_type,expected:V.promise,received:r.parsedType}),pe;let n=r.parsedType===V.promise?r.data:Promise.resolve(r.data);return Rt(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};xn.create=(t,e)=>new xn({type:t,typeName:le.ZodPromise,...Ae(e)});var Jt=class extends we{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===le.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{U(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return pe;let u=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return u.status==="aborted"?pe:u.status==="dirty"||r.value==="dirty"?Ki(u.value):u});{if(r.value==="aborted")return pe;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?pe:a.status==="dirty"||r.value==="dirty"?Ki(a.value):a}}if(i.type==="refinement"){let s=a=>{let u=i.refinement(a,o);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?pe:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?pe:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ti(s))return s;let a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>ti(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:r.value,value:a})):s);Oe.assertNever(i)}};Jt.create=(t,e,r)=>new Jt({schema:t,typeName:le.ZodEffects,effect:e,...Ae(r)});Jt.createWithPreprocess=(t,e,r)=>new Jt({schema:e,effect:{type:"preprocess",transform:t},typeName:le.ZodEffects,...Ae(r)});var ar=class extends we{_parse(e){return this._getType(e)===V.undefined?Rt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ar.create=(t,e)=>new ar({innerType:t,typeName:le.ZodOptional,...Ae(e)});var kr=class extends we{_parse(e){return this._getType(e)===V.null?Rt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};kr.create=(t,e)=>new kr({innerType:t,typeName:le.ZodNullable,...Ae(e)});var hi=class extends we{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===V.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};hi.create=(t,e)=>new hi({innerType:t,typeName:le.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ae(e)});var mi=class extends we{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return cs(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Xt(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Xt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};mi.create=(t,e)=>new mi({innerType:t,typeName:le.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ae(e)});var eo=class extends we{_parse(e){if(this._getType(e)!==V.nan){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.nan,received:n.parsedType}),pe}return{status:"valid",value:e.data}}};eo.create=t=>new eo({typeName:le.ZodNaN,...Ae(t)});var pk=Symbol("zod_brand"),fs=class extends we{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},ps=class t extends we{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?pe:o.status==="dirty"?(r.dirty(),Ki(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?pe:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:le.ZodPipeline})}},gi=class extends we{_parse(e){let r=this._def.innerType._parse(e),n=i=>(ti(i)&&(i.value=Object.freeze(i.value)),i);return cs(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};gi.create=(t,e)=>new gi({innerType:t,typeName:le.ZodReadonly,...Ae(e)});function qh(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Xh(t,e={},r){return t?gn.create().superRefine((n,i)=>{var o,s;let a=t(n);if(a instanceof Promise)return a.then(u=>{var l,c;if(!u){let f=qh(e,n),p=(c=(l=f.fatal)!==null&&l!==void 0?l:r)!==null&&c!==void 0?c:!0;i.addIssue({code:"custom",...f,fatal:p})}});if(!a){let u=qh(e,n),l=(s=(o=u.fatal)!==null&&o!==void 0?o:r)!==null&&s!==void 0?s:!0;i.addIssue({code:"custom",...u,fatal:l})}}):gn.create()}var dk={object:zt.lazycreate},le;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(le||(le={}));var hk=(t,e={message:`Input not instance of ${t.name}`})=>Xh(r=>r instanceof t,e),Jh=mn.create,Qh=ri.create,mk=eo.create,gk=ni.create,em=ii.create,xk=oi.create,yk=Zi.create,bk=si.create,Ek=ai.create,Ak=gn.create,wk=Kr.create,Ck=mr.create,kk=Xi.create,Tk=Yr.create,_k=zt.create,Sk=zt.strictCreate,vk=ui.create,Ik=Oa.create,Ok=li.create,Dk=Cr.create,Rk=Da.create,Fk=Ji.create,Nk=Qi.create,Pk=Ra.create,Lk=ci.create,Mk=fi.create,Bk=pi.create,jk=di.create,Uk=xn.create,Vh=Jt.create,zk=ar.create,$k=kr.create,qk=Jt.createWithPreprocess,Vk=ps.create,Gk=()=>Jh().optional(),Wk=()=>Qh().optional(),Hk=()=>em().optional(),Kk={string:t=>mn.create({...t,coerce:!0}),number:t=>ri.create({...t,coerce:!0}),boolean:t=>ii.create({...t,coerce:!0}),bigint:t=>ni.create({...t,coerce:!0}),date:t=>oi.create({...t,coerce:!0})},Yk=pe,X=Object.freeze({__proto__:null,defaultErrorMap:Yi,setErrorMap:qC,getErrorMap:Sa,makeIssue:va,EMPTY_PATH:VC,addIssueToContext:U,ParseStatus:Tt,INVALID:pe,DIRTY:Ki,OK:Rt,isAborted:Nc,isDirty:Pc,isValid:ti,isAsync:cs,get util(){return Oe},get objectUtil(){return Fc},ZodParsedType:V,getParsedType:Hr,ZodType:we,datetimeRegex:Yh,ZodString:mn,ZodNumber:ri,ZodBigInt:ni,ZodBoolean:ii,ZodDate:oi,ZodSymbol:Zi,ZodUndefined:si,ZodNull:ai,ZodAny:gn,ZodUnknown:Kr,ZodNever:mr,ZodVoid:Xi,ZodArray:Yr,ZodObject:zt,ZodUnion:ui,ZodDiscriminatedUnion:Oa,ZodIntersection:li,ZodTuple:Cr,ZodRecord:Da,ZodMap:Ji,ZodSet:Qi,ZodFunction:Ra,ZodLazy:ci,ZodLiteral:fi,ZodEnum:pi,ZodNativeEnum:di,ZodPromise:xn,ZodEffects:Jt,ZodTransformer:Jt,ZodOptional:ar,ZodNullable:kr,ZodDefault:hi,ZodCatch:mi,ZodNaN:eo,BRAND:pk,ZodBranded:fs,ZodPipeline:ps,ZodReadonly:gi,custom:Xh,Schema:we,ZodSchema:we,late:dk,get ZodFirstPartyTypeKind(){return le},coerce:Kk,any:Ak,array:Tk,bigint:gk,boolean:em,date:xk,discriminatedUnion:Ik,effect:Vh,enum:Bk,function:Pk,instanceof:hk,intersection:Ok,lazy:Lk,literal:Mk,map:Fk,nan:mk,nativeEnum:jk,never:Ck,null:Ek,nullable:$k,number:Qh,object:_k,oboolean:Hk,onumber:Wk,optional:zk,ostring:Gk,pipeline:Vk,preprocess:qk,promise:Uk,record:Rk,set:Nk,strictObject:Sk,string:Jh,symbol:yk,transformer:Vh,tuple:Dk,undefined:bk,union:vk,unknown:wk,void:kk,NEVER:Yk,ZodIssueCode:N,quotelessJson:$C,ZodError:Xt});import{defaultLoaders as Zk}from"cosmiconfig";function Mc(t,e){let r=Zk[".json"],n=r(t,e);return tm(n)}function tm(t,e="",r={}){for(let[n,i]of Object.entries(t)){let o=e?`${e}.${n}`:n;typeof i=="object"&&i!==null&&!Array.isArray(i)?tm(i,o,r):i===null?r[o]="null":r[o]=i.toString()}return r}import oT from"node:fs";import Zr from"node:path";import tT from"node:process";import Xk from"node:process";import Jk from"node:fs/promises";import{fileURLToPath as Qk}from"node:url";import to from"node:path";var rm=t=>t instanceof URL?Qk(t):t;async function Fa(t,{cwd:e=Xk.cwd(),type:r="file",stopAt:n}={}){let i=to.resolve(rm(e)??""),{root:o}=to.parse(i);n=to.resolve(i,rm(n??o));let s=to.isAbsolute(t);for(;i;){let a=s?t:to.join(i,t);try{let u=await Jk.stat(a);if(r==="file"&&u.isFile()||r==="directory"&&u.isDirectory())return a}catch{}if(i===n||i===o)break;i=to.dirname(i)}}async function nm({cwd:t=tT.cwd()}={}){return Fa("package.json",{cwd:t})}import rT from"node:fs";import nT from"node:fs/promises";async function Bc(t,e,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return(await nT[t](r))[e]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}function jc(t,e,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return rT[t](r)[e]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}var ro=Bc.bind(void 0,"stat","isFile"),wj=Bc.bind(void 0,"stat","isDirectory"),Cj=Bc.bind(void 0,"lstat","isSymbolicLink"),Uc=jc.bind(void 0,"statSync","isFile"),kj=jc.bind(void 0,"statSync","isDirectory"),Tj=jc.bind(void 0,"lstatSync","isSymbolicLink");import{log as om}from"remark-mdat";import{Configuration as sT}from"unified-engine";import iT from"node:os";var im=iT.homedir();function zc(t){if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return im?t.replace(/^~(?=$|\/|\\)/,im):t}function aT(t,e){let r=e===0?1:Math.floor(Math.log10(Math.abs(e))+1);return t.toString().padStart(r,"0")}function am(t,e,r,n){let i=[];for(let[o,s]of t.entries()){let a=r&&t.length>1?`-${aT(o+1,t.length+1)}`:"",u=uT(s,e,r,n,a);i.push(u)}return i}function uT(t,e,r,n,i=""){let o=sm(t),s=e?sm(e):void 0;if(!Uc(o))throw new Error(`Input file not found: "${o}"`);if(s){if(Uc(s))throw new Error(`Output path must be a directory, received a file path: "${s}"`);oT.mkdirSync(s,{recursive:!0})}let a=r?Zr.basename(r,Zr.extname(r)):Zr.basename(o,Zr.extname(o)),u=`.${n??(r&&Zr.extname(r)!==""?Zr.extname(r):Zr.extname(t)===""?"":Zr.extname(t))}`,l=`${a}${i}${u}`,c=s??Zr.dirname(o);return{input:o,name:l,output:c}}function sm(t){return zc(t)}async function Na(){return nm()}function Pa(t){return t==null?[]:Array.isArray(t)?t:[t]}async function um(){let t=new sT({cwd:process.cwd(),detectConfig:!0,packageField:"remarkConfig",rcName:".remarkrc"}),e=await new Promise(r=>{t.load("",(n,i)=>{if(n){console.error(n),r();return}r(i)})});if(e){let{filePath:r}=e;return r===void 0?om.info('No ambient Remark configuration file found"'):om.info(`Found and loaded ambient Remark configuration from "${r}"`),e}throw new Error("Failed to load ambient remark configuration")}var fm=fT.merge(X.object({assetsPath:X.string().optional(),packageFile:X.string().optional()})).describe("Config Extension");async function xi(t){let{additionalConfig:e,additionalRules:r,searchFrom:n}=t??{},i={addMetaComment:!1,assetsPath:"./assets",closingPrefix:"/",keywordPrefix:"",metaCommentIdentifier:"+",packageFile:await Na(),rules:{mdat:"Powered by the Markdown Autophagic Template system: [mdat](https://github.com/kitschpatrol/mdat)."}},o=lm("mdat",{loaders:{".ts":cm()}}),s=await o.search(n);if(s){let{config:a,filepath:u}=s,l=a;if(lr.info(`Using config from "${u}"`),u.endsWith("package.json")&&typeof a=="string"){lr.info(`Detected shared config string: "${a}"`);let{default:f}=await import(a);l=f}let c=pm(l,fm);c&&(i=$c(i,c))}if(e!==void 0){let a=Array.isArray(e)?e:[e];for(let u of a){let l;if(typeof u=="string"){let f=await o.load(u);if(f==null)continue;let{config:p,filepath:d}=f;lr.info(`Loaded additional config from "${d}"`),l=p}else l=u;if(l===void 0)continue;lr.info("Merging configuration object");let c=pm(l,fm);c!==void 0&&(i=$c(i,c))}}if(r!==void 0){let a=Array.isArray(r)?r:[r],u=lm("mdat",{loaders:{".json":Mc,".ts":cm()}});for(let l of a){let c;if(typeof l=="string"){let p;if(dm.basename(l).endsWith("package.json")){let y=await lT.readFile(l,"utf8");p={config:Mc(l,y),filepath:l}}else p=await u.load(l);if(p==null)continue;let{config:d,filepath:m}=p;lr.info(`Loaded additional config from "${m}"`),c=d}else c=l;if(c===void 0)continue;lr.info("Merging rules into configuration object");let f=dT(c,pT);f!==void 0&&(i=$c(i,f))}}if(i.rules){let a=Object.keys(i.rules).sort().map(u=>`"${La.default.green(La.default.bold(u))}"`);lr.info(`Loaded ${La.default.bold(a.length)} mdat comment expansion ${Dc("rule",a.length)}:`);for(let u of a)lr.info(` ${u}`)}else lr.error("No rules loaded from additional configurations or rules, using default.");return Ma=i,i}function dT(t,e){if(e.safeParse(t).success)return{rules:t};lr.error(`Rules object has the wrong shape. Ignoring and using default configuration:
66
+ ${JSON.stringify(t,void 0,2)}`)}function pm(t,e){if(e.safeParse(t).success)return t;lr.error(`Config object has the wrong shape. Ignoring and using default configuration:
67
+ ${JSON.stringify(t,void 0,2)}`)}var Ma;async function Tr(){return Ma===void 0&&(lr.warn("getConfig(): config was undefined"),Ma??=await xi()),Ma}var qc;async function Qt(){let{packageFile:t}=await Tr();if(t===void 0)throw new Error("No packageFile found or set in config");if(qc??=await cT({cwd:dm.dirname(t)}),qc===void 0)throw new Error("No package.json found");return qc}var hT={};function Xr(t,e){let r=e||hT,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,i=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return mm(t,n,i)}function mm(t,e,r){if(mT(t)){if("value"in t)return t.type==="html"&&!r?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return hm(t.children,e,r)}return Array.isArray(t)?hm(t,e,r):""}function hm(t,e,r){let n=[],i=-1;for(;++i<t.length;)n[i]=mm(t[i],e,r);return n.join("")}function mT(t){return!!(t&&typeof t=="object")}var Vc={AElig:"\xC6",AMP:"&",Aacute:"\xC1",Abreve:"\u0102",Acirc:"\xC2",Acy:"\u0410",Afr:"\u{1D504}",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\u{1D538}",ApplyFunction:"\u2061",Aring:"\xC5",Ascr:"\u{1D49C}",Assign:"\u2254",Atilde:"\xC3",Auml:"\xC4",Backslash:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",Bcy:"\u0411",Because:"\u2235",Bernoullis:"\u212C",Beta:"\u0392",Bfr:"\u{1D505}",Bopf:"\u{1D539}",Breve:"\u02D8",Bscr:"\u212C",Bumpeq:"\u224E",CHcy:"\u0427",COPY:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",Cayleys:"\u212D",Ccaron:"\u010C",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",CenterDot:"\xB7",Cfr:"\u212D",Chi:"\u03A7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",Colon:"\u2237",Colone:"\u2A74",Congruent:"\u2261",Conint:"\u222F",ContourIntegral:"\u222E",Copf:"\u2102",Coproduct:"\u2210",CounterClockwiseContourIntegral:"\u2233",Cross:"\u2A2F",Cscr:"\u{1D49E}",Cup:"\u22D3",CupCap:"\u224D",DD:"\u2145",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",Delta:"\u0394",Dfr:"\u{1D507}",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",Diamond:"\u22C4",DifferentialD:"\u2146",Dopf:"\u{1D53B}",Dot:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",Downarrow:"\u21D3",Dscr:"\u{1D49F}",Dstrok:"\u0110",ENG:"\u014A",ETH:"\xD0",Eacute:"\xC9",Ecaron:"\u011A",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\u{1D508}",Egrave:"\xC8",Element:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\u{1D53C}",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",Equilibrium:"\u21CC",Escr:"\u2130",Esim:"\u2A73",Eta:"\u0397",Euml:"\xCB",Exists:"\u2203",ExponentialE:"\u2147",Fcy:"\u0424",Ffr:"\u{1D509}",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",Fopf:"\u{1D53D}",ForAll:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\u{1D50A}",Gg:"\u22D9",Gopf:"\u{1D53E}",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",Gt:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",HilbertSpace:"\u210B",Hopf:"\u210D",HorizontalLine:"\u2500",Hscr:"\u210B",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrave:"\xCC",Im:"\u2111",Imacr:"\u012A",ImaginaryI:"\u2148",Implies:"\u21D2",Int:"\u222C",Integral:"\u222B",Intersection:"\u22C2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012E",Iopf:"\u{1D540}",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\u{1D50D}",Jopf:"\u{1D541}",Jscr:"\u{1D4A5}",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\u{1D50E}",Kopf:"\u{1D542}",Kscr:"\u{1D4A6}",LJcy:"\u0409",LT:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Larr:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",LeftRightArrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",Leftarrow:"\u21D0",Leftrightarrow:"\u21D4",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",Lfr:"\u{1D50F}",Ll:"\u22D8",Lleftarrow:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",LongLeftRightArrow:"\u27F7",LongRightArrow:"\u27F6",Longleftarrow:"\u27F8",Longleftrightarrow:"\u27FA",Longrightarrow:"\u27F9",Lopf:"\u{1D543}",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",MinusPlus:"\u2213",Mopf:"\u{1D544}",Mscr:"\u2133",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
68
+ `,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',Qfr:"\u{1D514}",Qopf:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\u{1D4B5}",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acute:"\xB4",acy:"\u0430",aelig:"\xE6",af:"\u2061",afr:"\u{1D51E}",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedil:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\u{1D554}",coprod:"\u2210",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",ic:"\u2063",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\u{1D55F}",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\u{1D561}",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\u{1D4C7}",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",tilde:"\u02DC",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uml:"\xA8",uogon:"\u0173",uopf:"\u{1D566}",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"};var gT={}.hasOwnProperty;function no(t){return gT.call(Vc,t)?Vc[t]:!1}function it(t,e,r,n){let i=t.length,o=0,s;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,r=r>0?r:0,n.length<1e4)s=Array.from(n),s.unshift(e,r),t.splice(...s);else for(r&&t.splice(e,r);o<n.length;)s=n.slice(o,o+1e4),s.unshift(e,0),t.splice(...s),o+=1e4,e+=1e4}function Ft(t,e){return t.length>0?(it(t,t.length,0,e),t):e}var gm={}.hasOwnProperty;function Ba(t){let e={},r=-1;for(;++r<t.length;)xT(e,t[r]);return e}function xT(t,e){let r;for(r in e){let i=(gm.call(t,r)?t[r]:void 0)||(t[r]={}),o=e[r],s;if(o)for(s in o){gm.call(i,s)||(i[s]=[]);let a=o[s];yT(i[s],Array.isArray(a)?a:a?[a]:[])}}}function yT(t,e){let r=-1,n=[];for(;++r<e.length;)(e[r].add==="after"?t:n).push(e[r]);it(t,0,0,n)}function ja(t,e){let r=Number.parseInt(t,e);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"\uFFFD":String.fromCodePoint(r)}function _t(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var mt=yn(/[A-Za-z]/),gt=yn(/[\dA-Za-z]/),xm=yn(/[#-'*+\--9=?A-Z^-~]/);function yi(t){return t!==null&&(t<32||t===127)}var ds=yn(/\d/),ym=yn(/[\dA-Fa-f]/),bm=yn(/[!-/:-@[-`{-~]/);function z(t){return t!==null&&t<-2}function ke(t){return t!==null&&(t<0||t===32)}function se(t){return t===-2||t===-1||t===32}var bi=yn(new RegExp("\\p{P}|\\p{S}","u")),_r=yn(/\s/);function yn(t){return e;function e(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function ie(t,e,r,n){let i=n?n-1:Number.POSITIVE_INFINITY,o=0;return s;function s(u){return se(u)?(t.enter(r),a(u)):e(u)}function a(u){return se(u)&&o++<i?(t.consume(u),a):(t.exit(r),e(u))}}var Em={tokenize:bT};function bT(t){let e=t.attempt(this.parser.constructs.contentInitial,n,i),r;return e;function n(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),ie(t,e,"linePrefix")}function i(a){return t.enter("paragraph"),o(a)}function o(a){let u=t.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=u),r=u,s(a)}function s(a){if(a===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(a);return}return z(a)?(t.consume(a),t.exit("chunkText"),o):(t.consume(a),s)}}var wm={tokenize:ET},Am={tokenize:AT};function ET(t){let e=this,r=[],n=0,i,o,s;return a;function a(w){if(n<r.length){let D=r[n];return e.containerState=D[1],t.attempt(D[0].continuation,u,l)(w)}return l(w)}function u(w){if(n++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&C();let D=e.events.length,R=D,S;for(;R--;)if(e.events[R][0]==="exit"&&e.events[R][1].type==="chunkFlow"){S=e.events[R][1].end;break}b(n);let de=D;for(;de<e.events.length;)e.events[de][1].end={...S},de++;return it(e.events,R+1,0,e.events.slice(D)),e.events.length=de,l(w)}return a(w)}function l(w){if(n===r.length){if(!i)return p(w);if(i.currentConstruct&&i.currentConstruct.concrete)return m(w);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Am,c,f)(w)}function c(w){return i&&C(),b(n),p(w)}function f(w){return e.parser.lazy[e.now().line]=n!==r.length,s=e.now().offset,m(w)}function p(w){return e.containerState={},t.attempt(Am,d,m)(w)}function d(w){return n++,r.push([e.currentConstruct,e.containerState]),p(w)}function m(w){if(w===null){i&&C(),b(0),t.consume(w);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),y(w)}function y(w){if(w===null){g(t.exit("chunkFlow"),!0),b(0),t.consume(w);return}return z(w)?(t.consume(w),g(t.exit("chunkFlow")),n=0,e.interrupt=void 0,a):(t.consume(w),y)}function g(w,D){let R=e.sliceStream(w);if(D&&R.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(R),e.parser.lazy[w.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<s&&(!i.events[S][1].end||i.events[S][1].end.offset>s))return;let de=e.events.length,ye=de,be,_;for(;ye--;)if(e.events[ye][0]==="exit"&&e.events[ye][1].type==="chunkFlow"){if(be){_=e.events[ye][1].end;break}be=!0}for(b(n),S=de;S<e.events.length;)e.events[S][1].end={..._},S++;it(e.events,ye+1,0,e.events.slice(de)),e.events.length=S}}function b(w){let D=r.length;for(;D-- >w;){let R=r[D];e.containerState=R[1],R[0].exit.call(e,t)}r.length=w}function C(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function AT(t,e,r){return ie(t,t.attempt(this.parser.constructs.document,e,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Jr(t){if(t===null||ke(t)||_r(t))return 1;if(bi(t))return 2}function bn(t,e,r){let n=[],i=-1;for(;++i<t.length;){let o=t[i].resolveAll;o&&!n.includes(o)&&(e=o(e,r),n.push(o))}return e}var hs={name:"attention",resolveAll:wT,tokenize:CT};function wT(t,e){let r=-1,n,i,o,s,a,u,l,c;for(;++r<t.length;)if(t[r][0]==="enter"&&t[r][1].type==="attentionSequence"&&t[r][1]._close){for(n=r;n--;)if(t[n][0]==="exit"&&t[n][1].type==="attentionSequence"&&t[n][1]._open&&e.sliceSerialize(t[n][1]).charCodeAt(0)===e.sliceSerialize(t[r][1]).charCodeAt(0)){if((t[n][1]._close||t[r][1]._open)&&(t[r][1].end.offset-t[r][1].start.offset)%3&&!((t[n][1].end.offset-t[n][1].start.offset+t[r][1].end.offset-t[r][1].start.offset)%3))continue;u=t[n][1].end.offset-t[n][1].start.offset>1&&t[r][1].end.offset-t[r][1].start.offset>1?2:1;let f={...t[n][1].end},p={...t[r][1].start};Cm(f,-u),Cm(p,u),s={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...t[n][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...t[r][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...t[n][1].end},end:{...t[r][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},t[n][1].end={...s.start},t[r][1].start={...a.end},l=[],t[n][1].end.offset-t[n][1].start.offset&&(l=Ft(l,[["enter",t[n][1],e],["exit",t[n][1],e]])),l=Ft(l,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",o,e]]),l=Ft(l,bn(e.parser.constructs.insideSpan.null,t.slice(n+1,r),e)),l=Ft(l,[["exit",o,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[r][1].end.offset-t[r][1].start.offset?(c=2,l=Ft(l,[["enter",t[r][1],e],["exit",t[r][1],e]])):c=0,it(t,n-1,r-n+3,l),r=n+l.length-c-2;break}}for(r=-1;++r<t.length;)t[r][1].type==="attentionSequence"&&(t[r][1].type="data");return t}function CT(t,e){let r=this.parser.constructs.attentionMarkers.null,n=this.previous,i=Jr(n),o;return s;function s(u){return o=u,t.enter("attentionSequence"),a(u)}function a(u){if(u===o)return t.consume(u),a;let l=t.exit("attentionSequence"),c=Jr(u),f=!c||c===2&&i||r.includes(u),p=!i||i===2&&c||r.includes(n);return l._open=!!(o===42?f:f&&(i||!p)),l._close=!!(o===42?p:p&&(c||!f)),e(u)}}function Cm(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}var Gc={name:"autolink",tokenize:kT};function kT(t,e,r){let n=0;return i;function i(d){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),o}function o(d){return mt(d)?(t.consume(d),s):d===64?r(d):l(d)}function s(d){return d===43||d===45||d===46||gt(d)?(n=1,a(d)):l(d)}function a(d){return d===58?(t.consume(d),n=0,u):(d===43||d===45||d===46||gt(d))&&n++<32?(t.consume(d),a):(n=0,l(d))}function u(d){return d===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.exit("autolink"),e):d===null||d===32||d===60||yi(d)?r(d):(t.consume(d),u)}function l(d){return d===64?(t.consume(d),c):xm(d)?(t.consume(d),l):r(d)}function c(d){return gt(d)?f(d):r(d)}function f(d){return d===46?(t.consume(d),n=0,c):d===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.exit("autolink"),e):p(d)}function p(d){if((d===45||gt(d))&&n++<63){let m=d===45?p:f;return t.consume(d),m}return r(d)}}var Sr={partial:!0,tokenize:TT};function TT(t,e,r){return n;function n(o){return se(o)?ie(t,i,"linePrefix")(o):i(o)}function i(o){return o===null||z(o)?e(o):r(o)}}var Ua={continuation:{tokenize:ST},exit:vT,name:"blockQuote",tokenize:_T};function _T(t,e,r){let n=this;return i;function i(s){if(s===62){let a=n.containerState;return a.open||(t.enter("blockQuote",{_container:!0}),a.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(s),t.exit("blockQuoteMarker"),o}return r(s)}function o(s){return se(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}function ST(t,e,r){let n=this;return i;function i(s){return se(s)?ie(t,o,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return t.attempt(Ua,e,r)(s)}}function vT(t){t.exit("blockQuote")}var za={name:"characterEscape",tokenize:IT};function IT(t,e,r){return n;function n(o){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(o),t.exit("escapeMarker"),i}function i(o){return bm(o)?(t.enter("characterEscapeValue"),t.consume(o),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):r(o)}}var $a={name:"characterReference",tokenize:OT};function OT(t,e,r){let n=this,i=0,o,s;return a;function a(f){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),u}function u(f){return f===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(f),t.exit("characterReferenceMarkerNumeric"),l):(t.enter("characterReferenceValue"),o=31,s=gt,c(f))}function l(f){return f===88||f===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(f),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),o=6,s=ym,c):(t.enter("characterReferenceValue"),o=7,s=ds,c(f))}function c(f){if(f===59&&i){let p=t.exit("characterReferenceValue");return s===gt&&!no(n.sliceSerialize(p))?r(f):(t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return s(f)&&i++<o?(t.consume(f),c):r(f)}}var km={partial:!0,tokenize:RT},qa={concrete:!0,name:"codeFenced",tokenize:DT};function DT(t,e,r){let n=this,i={partial:!0,tokenize:R},o=0,s=0,a;return u;function u(S){return l(S)}function l(S){let de=n.events[n.events.length-1];return o=de&&de[1].type==="linePrefix"?de[2].sliceSerialize(de[1],!0).length:0,a=S,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),c(S)}function c(S){return S===a?(s++,t.consume(S),c):s<3?r(S):(t.exit("codeFencedFenceSequence"),se(S)?ie(t,f,"whitespace")(S):f(S))}function f(S){return S===null||z(S)?(t.exit("codeFencedFence"),n.interrupt?e(S):t.check(km,y,D)(S)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),p(S))}function p(S){return S===null||z(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),f(S)):se(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),ie(t,d,"whitespace")(S)):S===96&&S===a?r(S):(t.consume(S),p)}function d(S){return S===null||z(S)?f(S):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||z(S)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),f(S)):S===96&&S===a?r(S):(t.consume(S),m)}function y(S){return t.attempt(i,D,g)(S)}function g(S){return t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),b}function b(S){return o>0&&se(S)?ie(t,C,"linePrefix",o+1)(S):C(S)}function C(S){return S===null||z(S)?t.check(km,y,D)(S):(t.enter("codeFlowValue"),w(S))}function w(S){return S===null||z(S)?(t.exit("codeFlowValue"),C(S)):(t.consume(S),w)}function D(S){return t.exit("codeFenced"),e(S)}function R(S,de,ye){let be=0;return _;function _(j){return S.enter("lineEnding"),S.consume(j),S.exit("lineEnding"),L}function L(j){return S.enter("codeFencedFence"),se(j)?ie(S,F,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):F(j)}function F(j){return j===a?(S.enter("codeFencedFenceSequence"),v(j)):ye(j)}function v(j){return j===a?(be++,S.consume(j),v):be>=s?(S.exit("codeFencedFenceSequence"),se(j)?ie(S,P,"whitespace")(j):P(j)):ye(j)}function P(j){return j===null||z(j)?(S.exit("codeFencedFence"),de(j)):ye(j)}}}function RT(t,e,r){let n=this;return i;function i(s){return s===null?r(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o)}function o(s){return n.parser.lazy[n.now().line]?r(s):e(s)}}var ms={name:"codeIndented",tokenize:NT},FT={partial:!0,tokenize:PT};function NT(t,e,r){let n=this;return i;function i(l){return t.enter("codeIndented"),ie(t,o,"linePrefix",5)(l)}function o(l){let c=n.events[n.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(l):r(l)}function s(l){return l===null?u(l):z(l)?t.attempt(FT,s,u)(l):(t.enter("codeFlowValue"),a(l))}function a(l){return l===null||z(l)?(t.exit("codeFlowValue"),s(l)):(t.consume(l),a)}function u(l){return t.exit("codeIndented"),e(l)}}function PT(t,e,r){let n=this;return i;function i(s){return n.parser.lazy[n.now().line]?r(s):z(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):ie(t,o,"linePrefix",5)(s)}function o(s){let a=n.events[n.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):z(s)?i(s):r(s)}}var Wc={name:"codeText",previous:MT,resolve:LT,tokenize:BT};function LT(t){let e=t.length-4,r=3,n,i;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(n=r;++n<e;)if(t[n][1].type==="codeTextData"){t[r][1].type="codeTextPadding",t[e][1].type="codeTextPadding",r+=2,e-=2;break}}for(n=r-1,e++;++n<=e;)i===void 0?n!==e&&t[n][1].type!=="lineEnding"&&(i=n):(n===e||t[n][1].type==="lineEnding")&&(t[i][1].type="codeTextData",n!==i+2&&(t[i][1].end=t[n-1][1].end,t.splice(i+2,n-i-2),e-=n-i-2,n=i+2),i=void 0);return t}function MT(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function BT(t,e,r){let n=this,i=0,o,s;return a;function a(p){return t.enter("codeText"),t.enter("codeTextSequence"),u(p)}function u(p){return p===96?(t.consume(p),i++,u):(t.exit("codeTextSequence"),l(p))}function l(p){return p===null?r(p):p===32?(t.enter("space"),t.consume(p),t.exit("space"),l):p===96?(s=t.enter("codeTextSequence"),o=0,f(p)):z(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),l):(t.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||z(p)?(t.exit("codeTextData"),l(p)):(t.consume(p),c)}function f(p){return p===96?(t.consume(p),o++,f):o===i?(t.exit("codeTextSequence"),t.exit("codeText"),e(p)):(s.type="codeTextData",c(p))}}var Va=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new 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,r){let n=r??Number.POSITIVE_INFINITY;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,r,n){let i=r||0;this.setCursor(Math.trunc(e));let o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&gs(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),gs(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),gs(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 r=this.left.splice(e,Number.POSITIVE_INFINITY);gs(this.right,r.reverse())}else{let r=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);gs(this.left,r.reverse())}}};function gs(t,e){let r=0;if(e.length<1e4)t.push(...e);else for(;r<e.length;)t.push(...e.slice(r,r+1e4)),r+=1e4}function Ga(t){let e={},r=-1,n,i,o,s,a,u,l,c=new Va(t);for(;++r<c.length;){for(;r in e;)r=e[r];if(n=c.get(r),r&&n[1].type==="chunkFlow"&&c.get(r-1)[1].type==="listItemPrefix"&&(u=n[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(n[0]==="enter")n[1].contentType&&(Object.assign(e,jT(c,r)),r=e[r],l=!0);else if(n[1]._container){for(o=r,i=void 0;o--;)if(s=c.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(n[1].end={...c.get(i)[1].start},a=c.slice(i,r),a.unshift(n),c.splice(i,r-i+1,a))}}return it(t,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function jT(t,e){let r=t.get(e)[1],n=t.get(e)[2],i=e-1,o=[],s=r._tokenizer;s||(s=n.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let a=s.events,u=[],l={},c,f,p=-1,d=r,m=0,y=0,g=[y];for(;d;){for(;t.get(++i)[1]!==d;);o.push(i),d._tokenizer||(c=n.sliceStream(d),d.next||c.push(null),f&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=d,d=d.next}for(d=r;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(y=p+1,g.push(y),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):g.pop(),p=g.length;p--;){let b=a.slice(g[p],g[p+1]),C=o.pop();u.push([C,C+b.length-1]),t.splice(C,2,b)}for(u.reverse(),p=-1;++p<u.length;)l[m+u[p][0]]=m+u[p][1],m+=u[p][1]-u[p][0]-1;return l}var Hc={resolve:zT,tokenize:$T},UT={partial:!0,tokenize:qT};function zT(t){return Ga(t),t}function $T(t,e){let r;return n;function n(a){return t.enter("content"),r=t.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):z(a)?t.check(UT,s,o)(a):(t.consume(a),i)}function o(a){return t.exit("chunkContent"),t.exit("content"),e(a)}function s(a){return t.consume(a),t.exit("chunkContent"),r.next=t.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,i}}function qT(t,e,r){let n=this;return i;function i(s){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),ie(t,o,"linePrefix")}function o(s){if(s===null||z(s))return r(s);let a=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):t.interrupt(n.parser.constructs.flow,r,e)(s)}}function Wa(t,e,r,n,i,o,s,a,u){let l=u||Number.POSITIVE_INFINITY,c=0;return f;function f(b){return b===60?(t.enter(n),t.enter(i),t.enter(o),t.consume(b),t.exit(o),p):b===null||b===32||b===41||yi(b)?r(b):(t.enter(n),t.enter(s),t.enter(a),t.enter("chunkString",{contentType:"string"}),y(b))}function p(b){return b===62?(t.enter(o),t.consume(b),t.exit(o),t.exit(i),t.exit(n),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),d(b))}function d(b){return b===62?(t.exit("chunkString"),t.exit(a),p(b)):b===null||b===60||z(b)?r(b):(t.consume(b),b===92?m:d)}function m(b){return b===60||b===62||b===92?(t.consume(b),d):d(b)}function y(b){return!c&&(b===null||b===41||ke(b))?(t.exit("chunkString"),t.exit(a),t.exit(s),t.exit(n),e(b)):c<l&&b===40?(t.consume(b),c++,y):b===41?(t.consume(b),c--,y):b===null||b===32||b===40||yi(b)?r(b):(t.consume(b),b===92?g:y)}function g(b){return b===40||b===41||b===92?(t.consume(b),y):y(b)}}function Ha(t,e,r,n,i,o){let s=this,a=0,u;return l;function l(d){return t.enter(n),t.enter(i),t.consume(d),t.exit(i),t.enter(o),c}function c(d){return a>999||d===null||d===91||d===93&&!u||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?r(d):d===93?(t.exit(o),t.enter(i),t.consume(d),t.exit(i),t.exit(n),e):z(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||z(d)||a++>999?(t.exit("chunkString"),c(d)):(t.consume(d),u||(u=!se(d)),d===92?p:f)}function p(d){return d===91||d===92||d===93?(t.consume(d),a++,f):f(d)}}function Ka(t,e,r,n,i,o){let s;return a;function a(p){return p===34||p===39||p===40?(t.enter(n),t.enter(i),t.consume(p),t.exit(i),s=p===40?41:p,u):r(p)}function u(p){return p===s?(t.enter(i),t.consume(p),t.exit(i),t.exit(n),e):(t.enter(o),l(p))}function l(p){return p===s?(t.exit(o),u(s)):p===null?r(p):z(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),ie(t,l,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===s||p===null||z(p)?(t.exit("chunkString"),l(p)):(t.consume(p),p===92?f:c)}function f(p){return p===s||p===92?(t.consume(p),c):c(p)}}function Ei(t,e){let r;return n;function n(i){return z(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),r=!0,n):se(i)?ie(t,n,r?"linePrefix":"lineSuffix")(i):e(i)}}var Kc={name:"definition",tokenize:GT},VT={partial:!0,tokenize:WT};function GT(t,e,r){let n=this,i;return o;function o(d){return t.enter("definition"),s(d)}function s(d){return Ha.call(n,t,a,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return i=_t(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),d===58?(t.enter("definitionMarker"),t.consume(d),t.exit("definitionMarker"),u):r(d)}function u(d){return ke(d)?Ei(t,l)(d):l(d)}function l(d){return Wa(t,c,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return t.attempt(VT,f,f)(d)}function f(d){return se(d)?ie(t,p,"whitespace")(d):p(d)}function p(d){return d===null||z(d)?(t.exit("definition"),n.parser.defined.push(i),e(d)):r(d)}}function WT(t,e,r){return n;function n(a){return ke(a)?Ei(t,i)(a):r(a)}function i(a){return Ka(t,o,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return se(a)?ie(t,s,"whitespace")(a):s(a)}function s(a){return a===null||z(a)?e(a):r(a)}}var Yc={name:"hardBreakEscape",tokenize:HT};function HT(t,e,r){return n;function n(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return z(o)?(t.exit("hardBreakEscape"),e(o)):r(o)}}var Zc={name:"headingAtx",resolve:KT,tokenize:YT};function KT(t,e){let r=t.length-2,n=3,i,o;return t[n][1].type==="whitespace"&&(n+=2),r-2>n&&t[r][1].type==="whitespace"&&(r-=2),t[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&t[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(i={type:"atxHeadingText",start:t[n][1].start,end:t[r][1].end},o={type:"chunkText",start:t[n][1].start,end:t[r][1].end,contentType:"text"},it(t,n,r-n+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function YT(t,e,r){let n=0;return i;function i(c){return t.enter("atxHeading"),o(c)}function o(c){return t.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&n++<6?(t.consume(c),s):c===null||ke(c)?(t.exit("atxHeadingSequence"),a(c)):r(c)}function a(c){return c===35?(t.enter("atxHeadingSequence"),u(c)):c===null||z(c)?(t.exit("atxHeading"),e(c)):se(c)?ie(t,a,"whitespace")(c):(t.enter("atxHeadingText"),l(c))}function u(c){return c===35?(t.consume(c),u):(t.exit("atxHeadingSequence"),a(c))}function l(c){return c===null||c===35||ke(c)?(t.exit("atxHeadingText"),a(c)):(t.consume(c),l)}}var Tm=["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"],Xc=["pre","script","style","textarea"];var Jc={concrete:!0,name:"htmlFlow",resolveTo:JT,tokenize:QT},ZT={partial:!0,tokenize:t_},XT={partial:!0,tokenize:e_};function JT(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function QT(t,e,r){let n=this,i,o,s,a,u;return l;function l(E){return c(E)}function c(E){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(E),f}function f(E){return E===33?(t.consume(E),p):E===47?(t.consume(E),o=!0,y):E===63?(t.consume(E),i=3,n.interrupt?e:x):mt(E)?(t.consume(E),s=String.fromCharCode(E),g):r(E)}function p(E){return E===45?(t.consume(E),i=2,d):E===91?(t.consume(E),i=5,a=0,m):mt(E)?(t.consume(E),i=4,n.interrupt?e:x):r(E)}function d(E){return E===45?(t.consume(E),n.interrupt?e:x):r(E)}function m(E){let W="CDATA[";return E===W.charCodeAt(a++)?(t.consume(E),a===W.length?n.interrupt?e:F:m):r(E)}function y(E){return mt(E)?(t.consume(E),s=String.fromCharCode(E),g):r(E)}function g(E){if(E===null||E===47||E===62||ke(E)){let W=E===47,Ke=s.toLowerCase();return!W&&!o&&Xc.includes(Ke)?(i=1,n.interrupt?e(E):F(E)):Tm.includes(s.toLowerCase())?(i=6,W?(t.consume(E),b):n.interrupt?e(E):F(E)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(E):o?C(E):w(E))}return E===45||gt(E)?(t.consume(E),s+=String.fromCharCode(E),g):r(E)}function b(E){return E===62?(t.consume(E),n.interrupt?e:F):r(E)}function C(E){return se(E)?(t.consume(E),C):_(E)}function w(E){return E===47?(t.consume(E),_):E===58||E===95||mt(E)?(t.consume(E),D):se(E)?(t.consume(E),w):_(E)}function D(E){return E===45||E===46||E===58||E===95||gt(E)?(t.consume(E),D):R(E)}function R(E){return E===61?(t.consume(E),S):se(E)?(t.consume(E),R):w(E)}function S(E){return E===null||E===60||E===61||E===62||E===96?r(E):E===34||E===39?(t.consume(E),u=E,de):se(E)?(t.consume(E),S):ye(E)}function de(E){return E===u?(t.consume(E),u=null,be):E===null||z(E)?r(E):(t.consume(E),de)}function ye(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||ke(E)?R(E):(t.consume(E),ye)}function be(E){return E===47||E===62||se(E)?w(E):r(E)}function _(E){return E===62?(t.consume(E),L):r(E)}function L(E){return E===null||z(E)?F(E):se(E)?(t.consume(E),L):r(E)}function F(E){return E===45&&i===2?(t.consume(E),ae):E===60&&i===1?(t.consume(E),ee):E===62&&i===4?(t.consume(E),Ue):E===63&&i===3?(t.consume(E),x):E===93&&i===5?(t.consume(E),rt):z(E)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(ZT,Je,v)(E)):E===null||z(E)?(t.exit("htmlFlowData"),v(E)):(t.consume(E),F)}function v(E){return t.check(XT,P,Je)(E)}function P(E){return t.enter("lineEnding"),t.consume(E),t.exit("lineEnding"),j}function j(E){return E===null||z(E)?v(E):(t.enter("htmlFlowData"),F(E))}function ae(E){return E===45?(t.consume(E),x):F(E)}function ee(E){return E===47?(t.consume(E),s="",_e):F(E)}function _e(E){if(E===62){let W=s.toLowerCase();return Xc.includes(W)?(t.consume(E),Ue):F(E)}return mt(E)&&s.length<8?(t.consume(E),s+=String.fromCharCode(E),_e):F(E)}function rt(E){return E===93?(t.consume(E),x):F(E)}function x(E){return E===62?(t.consume(E),Ue):E===45&&i===2?(t.consume(E),x):F(E)}function Ue(E){return E===null||z(E)?(t.exit("htmlFlowData"),Je(E)):(t.consume(E),Ue)}function Je(E){return t.exit("htmlFlow"),e(E)}}function e_(t,e,r){let n=this;return i;function i(s){return z(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o):r(s)}function o(s){return n.parser.lazy[n.now().line]?r(s):e(s)}}function t_(t,e,r){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Sr,e,r)}}var Qc={name:"htmlText",tokenize:r_};function r_(t,e,r){let n=this,i,o,s;return a;function a(x){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(x),u}function u(x){return x===33?(t.consume(x),l):x===47?(t.consume(x),R):x===63?(t.consume(x),w):mt(x)?(t.consume(x),ye):r(x)}function l(x){return x===45?(t.consume(x),c):x===91?(t.consume(x),o=0,m):mt(x)?(t.consume(x),C):r(x)}function c(x){return x===45?(t.consume(x),d):r(x)}function f(x){return x===null?r(x):x===45?(t.consume(x),p):z(x)?(s=f,ee(x)):(t.consume(x),f)}function p(x){return x===45?(t.consume(x),d):f(x)}function d(x){return x===62?ae(x):x===45?p(x):f(x)}function m(x){let Ue="CDATA[";return x===Ue.charCodeAt(o++)?(t.consume(x),o===Ue.length?y:m):r(x)}function y(x){return x===null?r(x):x===93?(t.consume(x),g):z(x)?(s=y,ee(x)):(t.consume(x),y)}function g(x){return x===93?(t.consume(x),b):y(x)}function b(x){return x===62?ae(x):x===93?(t.consume(x),b):y(x)}function C(x){return x===null||x===62?ae(x):z(x)?(s=C,ee(x)):(t.consume(x),C)}function w(x){return x===null?r(x):x===63?(t.consume(x),D):z(x)?(s=w,ee(x)):(t.consume(x),w)}function D(x){return x===62?ae(x):w(x)}function R(x){return mt(x)?(t.consume(x),S):r(x)}function S(x){return x===45||gt(x)?(t.consume(x),S):de(x)}function de(x){return z(x)?(s=de,ee(x)):se(x)?(t.consume(x),de):ae(x)}function ye(x){return x===45||gt(x)?(t.consume(x),ye):x===47||x===62||ke(x)?be(x):r(x)}function be(x){return x===47?(t.consume(x),ae):x===58||x===95||mt(x)?(t.consume(x),_):z(x)?(s=be,ee(x)):se(x)?(t.consume(x),be):ae(x)}function _(x){return x===45||x===46||x===58||x===95||gt(x)?(t.consume(x),_):L(x)}function L(x){return x===61?(t.consume(x),F):z(x)?(s=L,ee(x)):se(x)?(t.consume(x),L):be(x)}function F(x){return x===null||x===60||x===61||x===62||x===96?r(x):x===34||x===39?(t.consume(x),i=x,v):z(x)?(s=F,ee(x)):se(x)?(t.consume(x),F):(t.consume(x),P)}function v(x){return x===i?(t.consume(x),i=void 0,j):x===null?r(x):z(x)?(s=v,ee(x)):(t.consume(x),v)}function P(x){return x===null||x===34||x===39||x===60||x===61||x===96?r(x):x===47||x===62||ke(x)?be(x):(t.consume(x),P)}function j(x){return x===47||x===62||ke(x)?be(x):r(x)}function ae(x){return x===62?(t.consume(x),t.exit("htmlTextData"),t.exit("htmlText"),e):r(x)}function ee(x){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),_e}function _e(x){return se(x)?ie(t,rt,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):rt(x)}function rt(x){return t.enter("htmlTextData"),s(x)}}var Ai={name:"labelEnd",resolveAll:s_,resolveTo:a_,tokenize:u_},n_={tokenize:l_},i_={tokenize:c_},o_={tokenize:f_};function s_(t){let e=-1,r=[];for(;++e<t.length;){let n=t[e][1];if(r.push(t[e]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){let i=n.type==="labelImage"?4:2;n.type="data",e+=i}}return t.length!==r.length&&it(t,0,t.length,r),t}function a_(t,e){let r=t.length,n=0,i,o,s,a;for(;r--;)if(i=t[r][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[r][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(t[r][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=r,i.type!=="labelLink")){n=2;break}}else i.type==="labelEnd"&&(s=r);let u={type:t[o][1].type==="labelLink"?"link":"image",start:{...t[o][1].start},end:{...t[t.length-1][1].end}},l={type:"label",start:{...t[o][1].start},end:{...t[s][1].end}},c={type:"labelText",start:{...t[o+n+2][1].end},end:{...t[s-2][1].start}};return a=[["enter",u,e],["enter",l,e]],a=Ft(a,t.slice(o+1,o+n+3)),a=Ft(a,[["enter",c,e]]),a=Ft(a,bn(e.parser.constructs.insideSpan.null,t.slice(o+n+4,s-3),e)),a=Ft(a,[["exit",c,e],t[s-2],t[s-1],["exit",l,e]]),a=Ft(a,t.slice(s+1)),a=Ft(a,[["exit",u,e]]),it(t,o,t.length,a),t}function u_(t,e,r){let n=this,i=n.events.length,o,s;for(;i--;)if((n.events[i][1].type==="labelImage"||n.events[i][1].type==="labelLink")&&!n.events[i][1]._balanced){o=n.events[i][1];break}return a;function a(p){return o?o._inactive?f(p):(s=n.parser.defined.includes(_t(n.sliceSerialize({start:o.end,end:n.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),t.exit("labelEnd"),u):r(p)}function u(p){return p===40?t.attempt(n_,c,s?c:f)(p):p===91?t.attempt(i_,c,s?l:f)(p):s?c(p):f(p)}function l(p){return t.attempt(o_,c,f)(p)}function c(p){return e(p)}function f(p){return o._balanced=!0,r(p)}}function l_(t,e,r){return n;function n(f){return t.enter("resource"),t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),i}function i(f){return ke(f)?Ei(t,o)(f):o(f)}function o(f){return f===41?c(f):Wa(t,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return ke(f)?Ei(t,u)(f):c(f)}function a(f){return r(f)}function u(f){return f===34||f===39||f===40?Ka(t,l,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function l(f){return ke(f)?Ei(t,c)(f):c(f)}function c(f){return f===41?(t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),t.exit("resource"),e):r(f)}}function c_(t,e,r){let n=this;return i;function i(a){return Ha.call(n,t,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return n.parser.defined.includes(_t(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?e(a):r(a)}function s(a){return r(a)}}function f_(t,e,r){return n;function n(o){return t.enter("reference"),t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),i}function i(o){return o===93?(t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),t.exit("reference"),e):r(o)}}var ef={name:"labelStartImage",resolveAll:Ai.resolveAll,tokenize:p_};function p_(t,e,r){let n=this;return i;function i(a){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(a),t.exit("labelImageMarker"),o}function o(a){return a===91?(t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelImage"),s):r(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(a):e(a)}}var tf={name:"labelStartLink",resolveAll:Ai.resolveAll,tokenize:d_};function d_(t,e,r){let n=this;return i;function i(s){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(s):e(s)}}var xs={name:"lineEnding",tokenize:h_};function h_(t,e){return r;function r(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),ie(t,e,"linePrefix")}}var wi={name:"thematicBreak",tokenize:m_};function m_(t,e,r){let n=0,i;return o;function o(l){return t.enter("thematicBreak"),s(l)}function s(l){return i=l,a(l)}function a(l){return l===i?(t.enter("thematicBreakSequence"),u(l)):n>=3&&(l===null||z(l))?(t.exit("thematicBreak"),e(l)):r(l)}function u(l){return l===i?(t.consume(l),n++,u):(t.exit("thematicBreakSequence"),se(l)?ie(t,a,"whitespace")(l):a(l))}}var St={continuation:{tokenize:b_},exit:A_,name:"list",tokenize:y_},g_={partial:!0,tokenize:w_},x_={partial:!0,tokenize:E_};function y_(t,e,r){let n=this,i=n.events[n.events.length-1],o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(d){let m=n.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!n.containerState.marker||d===n.containerState.marker:ds(d)){if(n.containerState.type||(n.containerState.type=m,t.enter(m,{_container:!0})),m==="listUnordered")return t.enter("listItemPrefix"),d===42||d===45?t.check(wi,r,l)(d):l(d);if(!n.interrupt||d===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(d)}return r(d)}function u(d){return ds(d)&&++s<10?(t.consume(d),u):(!n.interrupt||s<2)&&(n.containerState.marker?d===n.containerState.marker:d===41||d===46)?(t.exit("listItemValue"),l(d)):r(d)}function l(d){return t.enter("listItemMarker"),t.consume(d),t.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||d,t.check(Sr,n.interrupt?r:c,t.attempt(g_,p,f))}function c(d){return n.containerState.initialBlankLine=!0,o++,p(d)}function f(d){return se(d)?(t.enter("listItemPrefixWhitespace"),t.consume(d),t.exit("listItemPrefixWhitespace"),p):r(d)}function p(d){return n.containerState.size=o+n.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(d)}}function b_(t,e,r){let n=this;return n.containerState._closeFlow=void 0,t.check(Sr,i,o);function i(a){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,ie(t,e,"listItemIndent",n.containerState.size+1)(a)}function o(a){return n.containerState.furtherBlankLines||!se(a)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,s(a)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,t.attempt(x_,e,s)(a))}function s(a){return n.containerState._closeFlow=!0,n.interrupt=void 0,ie(t,t.attempt(St,e,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function E_(t,e,r){let n=this;return ie(t,i,"listItemIndent",n.containerState.size+1);function i(o){let s=n.events[n.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===n.containerState.size?e(o):r(o)}}function A_(t){t.exit(this.containerState.type)}function w_(t,e,r){let n=this;return ie(t,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){let s=n.events[n.events.length-1];return!se(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):r(o)}}var Ya={name:"setextUnderline",resolveTo:C_,tokenize:k_};function C_(t,e){let r=t.length,n,i,o;for(;r--;)if(t[r][0]==="enter"){if(t[r][1].type==="content"){n=r;break}t[r][1].type==="paragraph"&&(i=r)}else t[r][1].type==="content"&&t.splice(r,1),!o&&t[r][1].type==="definition"&&(o=r);let s={type:"setextHeading",start:{...t[n][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",s,e]),t.splice(o+1,0,["exit",t[n][1],e]),t[n][1].end={...t[o][1].end}):t[n][1]=s,t.push(["exit",s,e]),t}function k_(t,e,r){let n=this,i;return o;function o(l){let c=n.events.length,f;for(;c--;)if(n.events[c][1].type!=="lineEnding"&&n.events[c][1].type!=="linePrefix"&&n.events[c][1].type!=="content"){f=n.events[c][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||f)?(t.enter("setextHeadingLine"),i=l,s(l)):r(l)}function s(l){return t.enter("setextHeadingLineSequence"),a(l)}function a(l){return l===i?(t.consume(l),a):(t.exit("setextHeadingLineSequence"),se(l)?ie(t,u,"lineSuffix")(l):u(l))}function u(l){return l===null||z(l)?(t.exit("setextHeadingLine"),e(l)):r(l)}}var _m={tokenize:T_};function T_(t){let e=this,r=t.attempt(Sr,n,t.attempt(this.parser.constructs.flowInitial,i,ie(t,t.attempt(this.parser.constructs.flow,i,t.attempt(Hc,i)),"linePrefix")));return r;function n(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,r}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,r}}var Sm={resolveAll:Dm()},vm=Om("string"),Im=Om("text");function Om(t){return{resolveAll:Dm(t==="text"?__:void 0),tokenize:e};function e(r){let n=this,i=this.parser.constructs[t],o=r.attempt(i,s,a);return s;function s(c){return l(c)?o(c):a(c)}function a(c){if(c===null){r.consume(c);return}return r.enter("data"),r.consume(c),u}function u(c){return l(c)?(r.exit("data"),o(c)):(r.consume(c),u)}function l(c){if(c===null)return!0;let f=i[c],p=-1;if(f)for(;++p<f.length;){let d=f[p];if(!d.previous||d.previous.call(n,n.previous))return!0}return!1}}}function Dm(t){return e;function e(r,n){let i=-1,o;for(;++i<=r.length;)o===void 0?r[i]&&r[i][1].type==="data"&&(o=i,i++):(!r[i]||r[i][1].type!=="data")&&(i!==o+2&&(r[o][1].end=r[i-1][1].end,r.splice(o+2,i-o-2),i=o+2),o=void 0);return t?t(r,n):r}}function __(t,e){let r=0;for(;++r<=t.length;)if((r===t.length||t[r][1].type==="lineEnding")&&t[r-1][1].type==="data"){let n=t[r-1][1],i=e.sliceStream(n),o=i.length,s=-1,a=0,u;for(;o--;){let l=i[o];if(typeof l=="string"){for(s=l.length;l.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(l===-2)u=!0,a++;else if(l!==-1){o++;break}}if(e._contentTypeTextTrailing&&r===t.length&&(a=0),a){let l={type:r===t.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:n.start._bufferIndex+s,_index:n.start._index+o,line:n.end.line,column:n.end.column-a,offset:n.end.offset-a},end:{...n.end}};n.end={...l.start},n.start.offset===n.end.offset?Object.assign(n,l):(t.splice(r,0,["enter",l,e],["exit",l,e]),r+=2)}r++}return t}var rf={};Dw(rf,{attentionMarkers:()=>N_,contentInitial:()=>v_,disable:()=>P_,document:()=>S_,flow:()=>O_,flowInitial:()=>I_,insideSpan:()=>F_,string:()=>D_,text:()=>R_});var S_={42:St,43:St,45:St,48:St,49:St,50:St,51:St,52:St,53:St,54:St,55:St,56:St,57:St,62:Ua},v_={91:Kc},I_={[-2]:ms,[-1]:ms,32:ms},O_={35:Zc,42:wi,45:[Ya,wi],60:Jc,61:Ya,95:wi,96:qa,126:qa},D_={38:$a,92:za},R_={[-5]:xs,[-4]:xs,[-3]:xs,33:ef,38:$a,42:hs,60:[Gc,Qc],91:tf,92:[Yc,za],93:Ai,95:hs,96:Wc},F_={null:[hs,Sm]},N_={null:[42,95]},P_={null:[]};function Rm(t,e,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},i={},o=[],s=[],a=[],u=!0,l={attempt:be(de),check:be(ye),consume:D,enter:R,exit:S,interrupt:be(ye,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:g,parser:t,previous:null,sliceSerialize:m,sliceStream:y,write:d},f=e.tokenize.call(c,l),p;return e.resolveAll&&o.push(e),c;function d(v){return s=Ft(s,v),C(),s[s.length-1]!==null?[]:(_(e,0),c.events=bn(o,c.events,c),c.events)}function m(v,P){return M_(y(v),P)}function y(v){return L_(s,v)}function g(){let{_bufferIndex:v,_index:P,line:j,column:ae,offset:ee}=n;return{_bufferIndex:v,_index:P,line:j,column:ae,offset:ee}}function b(v){i[v.line]=v.column,F()}function C(){let v;for(;n._index<s.length;){let P=s[n._index];if(typeof P=="string")for(v=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===v&&n._bufferIndex<P.length;)w(P.charCodeAt(n._bufferIndex));else w(P)}}function w(v){u=void 0,p=v,f=f(v)}function D(v){z(v)?(n.line++,n.column=1,n.offset+=v===-3?2:1,F()):v!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===s[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=v,u=!0}function R(v,P){let j=P||{};return j.type=v,j.start=g(),c.events.push(["enter",j,c]),a.push(j),j}function S(v){let P=a.pop();return P.end=g(),c.events.push(["exit",P,c]),P}function de(v,P){_(v,P.from)}function ye(v,P){P.restore()}function be(v,P){return j;function j(ae,ee,_e){let rt,x,Ue,Je;return Array.isArray(ae)?W(ae):"tokenize"in ae?W([ae]):E(ae);function E(oe){return ce;function ce(me){let Ce=me!==null&&oe[me],Fe=me!==null&&oe.null,ze=[...Array.isArray(Ce)?Ce:Ce?[Ce]:[],...Array.isArray(Fe)?Fe:Fe?[Fe]:[]];return W(ze)(me)}}function W(oe){return rt=oe,x=0,oe.length===0?_e:Ke(oe[x])}function Ke(oe){return ce;function ce(me){return Je=L(),Ue=oe,oe.partial||(c.currentConstruct=oe),oe.name&&c.parser.constructs.disable.null.includes(oe.name)?he(me):oe.tokenize.call(P?Object.assign(Object.create(c),P):c,l,ne,he)(me)}}function ne(oe){return u=!0,v(Ue,Je),ee}function he(oe){return u=!0,Je.restore(),++x<rt.length?Ke(rt[x]):_e}}}function _(v,P){v.resolveAll&&!o.includes(v)&&o.push(v),v.resolve&&it(c.events,P,c.events.length-P,v.resolve(c.events.slice(P),c)),v.resolveTo&&(c.events=v.resolveTo(c.events,c))}function L(){let v=g(),P=c.previous,j=c.currentConstruct,ae=c.events.length,ee=Array.from(a);return{from:ae,restore:_e};function _e(){n=v,c.previous=P,c.currentConstruct=j,c.events.length=ae,a=ee,F()}}function F(){n.line in i&&n.column<2&&(n.column=i[n.line],n.offset+=i[n.line]-1)}}function L_(t,e){let r=e.start._index,n=e.start._bufferIndex,i=e.end._index,o=e.end._bufferIndex,s;if(r===i)s=[t[r].slice(n,o)];else{if(s=t.slice(r,i),n>-1){let a=s[0];typeof a=="string"?s[0]=a.slice(n):s.shift()}o>0&&s.push(t[i].slice(0,o))}return s}function M_(t,e){let r=-1,n=[],i;for(;++r<t.length;){let o=t[r],s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
73
69
  `;break}case-3:{s=`\r
74
- `;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,n.push(s)}return n.join("")}function ff(t){let n={constructs:za([cf,...(t||{}).extensions||[]]),content:i(Mm),defined:[],document:i(jm),flow:i(qm),lazy:{},string:i(Gm),text:i(Wm)};return n;function i(o){return s;function s(a){return Ym(n,o,a)}}}function pf(t){for(;!Ka(t););return t}var Zm=/[\0\t\n\r]/g;function df(){let t=1,e="",r=!0,n;return i;function i(o,s,a){let u=[],l,c,f,p,d;for(o=e+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),f=0,e="",r&&(o.charCodeAt(0)===65279&&f++,r=void 0);f<o.length;){if(Zm.lastIndex=f,l=Zm.exec(o),p=l&&l.index!==void 0?l.index:o.length,d=o.charCodeAt(p),!l){e=o.slice(f);break}if(d===10&&f===p&&n)u.push(-3),n=void 0;else switch(n&&(u.push(-5),n=void 0),f<p&&(u.push(o.slice(f,p)),t+=p-f),d){case 0:{u.push(65533),t++;break}case 9:{for(c=Math.ceil(t/4)*4,u.push(-2);t++<c;)u.push(-1);break}case 10:{u.push(-4),t=1;break}default:n=!0,t=1}f=p+1}return a&&(n&&u.push(-5),e&&u.push(e),u.push(null)),u}}var pS=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Qa(t){return t.replace(pS,dS)}function dS(t,e,r){if(e)return e;if(r.charCodeAt(0)===35){let i=r.charCodeAt(1),o=i===120||i===88;return $a(r.slice(o?2:1),o?16:10)}return lo(r)||t}function co(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Xm(t.position):"start"in t||"end"in t?Xm(t):"line"in t||"column"in t?hf(t):""}function hf(t){return Jm(t&&t.line)+":"+Jm(t&&t.column)}function Xm(t){return hf(t&&t.start)+"-"+hf(t&&t.end)}function Jm(t){return t&&typeof t=="number"?t:1}var eg={}.hasOwnProperty;function mf(t,e,r){return typeof e!="string"&&(r=e,e=void 0),hS(r)(pf(ff(r).document().write(df()(t,e,!0))))}function hS(t){let e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(T),autolinkProtocol:be,autolinkEmail:be,atxHeading:o(A),blockQuote:o(me),characterEscape:be,characterReference:be,codeFenced:o(we),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(we,s),codeText:o(Fe,s),codeTextData:be,data:be,codeFlowValue:be,definition:o(ze),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(qt),hardBreakEscape:o(k),hardBreakTrailing:o(k),htmlFlow:o(M,s),htmlFlowData:be,htmlText:o(M,s),htmlTextData:be,image:o(I),label:s,link:o(T),listItem:o($),listItemValue:p,listOrdered:o(K,f),listUnordered:o(K),paragraph:o(te),reference:E,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(A),strong:o(ft),thematicBreak:o(zC)},exit:{atxHeading:u(),atxHeadingSequence:R,autolink:u(),autolinkEmail:ce,autolinkProtocol:oe,blockQuote:u(),characterEscapeValue:_,characterReferenceMarkerHexadecimal:Ye,characterReferenceMarkerNumeric:Ye,characterReferenceValue:ne,characterReference:he,codeFenced:u(g),codeFencedFence:y,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:_,codeIndented:u(b),codeText:u(j),codeTextData:_,data:_,definition:u(),definitionDestinationString:D,definitionLabelString:w,definitionTitleString:C,emphasis:u(),hardBreakEscape:u(F),hardBreakTrailing:u(F),htmlFlow:u(v),htmlFlowData:_,htmlText:u(P),htmlTextData:_,image:u(ee),label:it,labelText:_e,lineEnding:L,link:u(ae),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:W,resourceDestinationString:x,resourceTitleString:Ue,resource:Qe,setextHeading:u(ye),setextHeadingLineSequence:de,setextHeadingText:S,strong:u(),thematicBreak:u()}};tg(e,(t||{}).mdastExtensions||[]);let r={};return n;function n(O){let B={type:"root",children:[]},Ee={stack:[B],tokenStack:[],config:e,enter:a,exit:l,buffer:s,resume:c,data:r},ve=[],Ne=-1;for(;++Ne<O.length;)if(O[Ne][1].type==="listOrdered"||O[Ne][1].type==="listUnordered")if(O[Ne][0]==="enter")ve.push(Ne);else{let xr=ve.pop();Ne=i(O,xr,Ne)}for(Ne=-1;++Ne<O.length;){let xr=e[O[Ne][0]];eg.call(xr,O[Ne][1].type)&&xr[O[Ne][1].type].call(Object.assign({sliceSerialize:O[Ne][2].sliceSerialize},Ee),O[Ne][1])}if(Ee.tokenStack.length>0){let xr=Ee.tokenStack[Ee.tokenStack.length-1];(xr[1]||Qm).call(Ee,void 0,xr[0])}for(B.position={start:kn(O.length>0?O[0][1].start:{line:1,column:1,offset:0}),end:kn(O.length>0?O[O.length-2][1].end:{line:1,column:1,offset:0})},Ne=-1;++Ne<e.transforms.length;)B=e.transforms[Ne](B)||B;return B}function i(O,B,Ee){let ve=B-1,Ne=-1,xr=!1,Gn,Wr,is,os;for(;++ve<=Ee;){let Yt=O[ve];switch(Yt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Yt[0]==="enter"?Ne++:Ne--,os=void 0;break}case"lineEndingBlank":{Yt[0]==="enter"&&(Gn&&!os&&!Ne&&!is&&(is=ve),os=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:os=void 0}if(!Ne&&Yt[0]==="enter"&&Yt[1].type==="listItemPrefix"||Ne===-1&&Yt[0]==="exit"&&(Yt[1].type==="listUnordered"||Yt[1].type==="listOrdered")){if(Gn){let Gi=ve;for(Wr=void 0;Gi--;){let Hr=O[Gi];if(Hr[1].type==="lineEnding"||Hr[1].type==="lineEndingBlank"){if(Hr[0]==="exit")continue;Wr&&(O[Wr][1].type="lineEndingBlank",xr=!0),Hr[1].type="lineEnding",Wr=Gi}else if(!(Hr[1].type==="linePrefix"||Hr[1].type==="blockQuotePrefix"||Hr[1].type==="blockQuotePrefixWhitespace"||Hr[1].type==="blockQuoteMarker"||Hr[1].type==="listItemIndent"))break}is&&(!Wr||is<Wr)&&(Gn._spread=!0),Gn.end=Object.assign({},Wr?O[Wr][1].start:Yt[1].end),O.splice(Wr||ve,0,["exit",Gn,Yt[2]]),ve++,Ee++}if(Yt[1].type==="listItemPrefix"){let Gi={type:"listItem",_spread:!1,start:Object.assign({},Yt[1].start),end:void 0};Gn=Gi,O.splice(ve,0,["enter",Gi,Yt[2]]),ve++,Ee++,is=void 0,os=!0}}}return O[B][1]._spread=xr,Ee}function o(O,B){return Ee;function Ee(ve){a.call(this,O(ve),ve),B&&B.call(this,ve)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(O,B,Ee){this.stack[this.stack.length-1].children.push(O),this.stack.push(O),this.tokenStack.push([B,Ee||void 0]),O.position={start:kn(B.start),end:void 0}}function u(O){return B;function B(Ee){O&&O.call(this,Ee),l.call(this,Ee)}}function l(O,B){let Ee=this.stack.pop(),ve=this.tokenStack.pop();if(ve)ve[0].type!==O.type&&(B?B.call(this,O,ve[0]):(ve[1]||Qm).call(this,O,ve[0]));else throw new Error("Cannot close `"+O.type+"` ("+co({start:O.start,end:O.end})+"): it\u2019s not open");Ee.position.end=kn(O.end)}function c(){return tn(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(O){if(this.data.expectingFirstListItemValue){let B=this.stack[this.stack.length-2];B.start=Number.parseInt(this.sliceSerialize(O),10),this.data.expectingFirstListItemValue=void 0}}function d(){let O=this.resume(),B=this.stack[this.stack.length-1];B.lang=O}function m(){let O=this.resume(),B=this.stack[this.stack.length-1];B.meta=O}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O.replace(/(\r?\n|\r)$/g,"")}function w(O){let B=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=B,Ee.identifier=It(this.sliceSerialize(O)).toLowerCase()}function C(){let O=this.resume(),B=this.stack[this.stack.length-1];B.title=O}function D(){let O=this.resume(),B=this.stack[this.stack.length-1];B.url=O}function R(O){let B=this.stack[this.stack.length-1];if(!B.depth){let Ee=this.sliceSerialize(O).length;B.depth=Ee}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function de(O){let B=this.stack[this.stack.length-1];B.depth=this.sliceSerialize(O).codePointAt(0)===61?1:2}function ye(){this.data.setextHeadingSlurpLineEnding=void 0}function be(O){let Ee=this.stack[this.stack.length-1].children,ve=Ee[Ee.length-1];(!ve||ve.type!=="text")&&(ve=Tt(),ve.position={start:kn(O.start),end:void 0},Ee.push(ve)),this.stack.push(ve)}function _(O){let B=this.stack.pop();B.value+=this.sliceSerialize(O),B.position.end=kn(O.end)}function L(O){let B=this.stack[this.stack.length-1];if(this.data.atHardBreak){let Ee=B.children[B.children.length-1];Ee.position.end=kn(O.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(B.type)&&(be.call(this,O),_.call(this,O))}function F(){this.data.atHardBreak=!0}function v(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function P(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function j(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function ae(){let O=this.stack[this.stack.length-1];if(this.data.inReference){let B=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=B,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function ee(){let O=this.stack[this.stack.length-1];if(this.data.inReference){let B=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=B,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function _e(O){let B=this.sliceSerialize(O),Ee=this.stack[this.stack.length-2];Ee.label=Qa(B),Ee.identifier=It(B).toLowerCase()}function it(){let O=this.stack[this.stack.length-1],B=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){let ve=O.children;Ee.children=ve}else Ee.alt=B}function x(){let O=this.resume(),B=this.stack[this.stack.length-1];B.url=O}function Ue(){let O=this.resume(),B=this.stack[this.stack.length-1];B.title=O}function Qe(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function W(O){let B=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=B,Ee.identifier=It(this.sliceSerialize(O)).toLowerCase(),this.data.referenceType="full"}function Ye(O){this.data.characterReferenceType=O.type}function ne(O){let B=this.sliceSerialize(O),Ee=this.data.characterReferenceType,ve;Ee?(ve=$a(B,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ve=lo(B);let Ne=this.stack[this.stack.length-1];Ne.value+=ve}function he(O){let B=this.stack.pop();B.position.end=kn(O.end)}function oe(O){_.call(this,O);let B=this.stack[this.stack.length-1];B.url=this.sliceSerialize(O)}function ce(O){_.call(this,O);let B=this.stack[this.stack.length-1];B.url="mailto:"+this.sliceSerialize(O)}function me(){return{type:"blockquote",children:[]}}function we(){return{type:"code",lang:null,meta:null,value:""}}function Fe(){return{type:"inlineCode",value:""}}function ze(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function qt(){return{type:"emphasis",children:[]}}function A(){return{type:"heading",depth:0,children:[]}}function k(){return{type:"break"}}function M(){return{type:"html",value:""}}function I(){return{type:"image",title:null,url:"",alt:null}}function T(){return{type:"link",title:null,url:"",children:[]}}function K(O){return{type:"list",ordered:O.type==="listOrdered",start:null,spread:O._spread,children:[]}}function $(O){return{type:"listItem",spread:O._spread,checked:null,children:[]}}function te(){return{type:"paragraph",children:[]}}function ft(){return{type:"strong",children:[]}}function Tt(){return{type:"text",value:""}}function zC(){return{type:"thematicBreak"}}}function kn(t){return{line:t.line,column:t.column,offset:t.offset}}function tg(t,e){let r=-1;for(;++r<e.length;){let n=e[r];Array.isArray(n)?tg(t,n):mS(t,n)}}function mS(t,e){let r;for(r in e)if(eg.call(e,r))switch(r){case"canContainEols":{let n=e[r];n&&t[r].push(...n);break}case"transforms":{let n=e[r];n&&t[r].push(...n);break}case"enter":case"exit":{let n=e[r];n&&Object.assign(t[r],n);break}}}function Qm(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+co({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+co({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+co({start:e.start,end:e.end})+") is still open")}function eu(t){let e=this;e.parser=r;function r(n){return mf(n,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}var rg={}.hasOwnProperty;function ng(t,e){let r=e||{};function n(i,...o){let s=n.invalid,a=n.handlers;if(i&&rg.call(i,t)){let u=String(i[t]);s=rg.call(a,u)?a[u]:n.unknown}if(s)return s.call(this,i,...o)}return n.handlers=r.handlers||{},n.invalid=r.invalid,n.unknown=r.unknown,n}var gS={}.hasOwnProperty;function gf(t,e){let r=-1,n;if(e.extensions)for(;++r<e.extensions.length;)gf(t,e.extensions[r]);for(n in e)if(gS.call(e,n))switch(n){case"extensions":break;case"unsafe":{ig(t[n],e[n]);break}case"join":{ig(t[n],e[n]);break}case"handlers":{xS(t[n],e[n]);break}default:t.options[n]=e[n]}return t}function ig(t,e){e&&t.push(...e)}function xS(t,e){e&&Object.assign(t,e)}function og(t,e,r,n){let i=r.enter("blockquote"),o=r.createTracker(n);o.move("> "),o.shift(2);let s=r.indentLines(r.containerFlow(t,o.current()),yS);return i(),s}function yS(t,e,r){return">"+(r?"":" ")+t}function tu(t,e){return sg(t,e.inConstruct,!0)&&!sg(t,e.notInConstruct,!1)}function sg(t,e,r){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return r;let n=-1;for(;++n<e.length;)if(t.includes(e[n]))return!0;return!1}function xf(t,e,r,n){let i=-1;for(;++i<r.unsafe.length;)if(r.unsafe[i].character===`
75
- `&&tu(r.stack,r.unsafe[i]))return/[ \t]/.test(n.before)?"":" ";return`\\
76
- `}function ag(t,e){let r=String(t),n=r.indexOf(e),i=n,o=0,s=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===i?++o>s&&(s=o):o=1,i=n+e.length,n=r.indexOf(e,i);return s}function ks(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function ug(t){let e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function lg(t,e,r,n){let i=ug(r),o=t.value||"",s=i==="`"?"GraveAccent":"Tilde";if(ks(t,r)){let f=r.enter("codeIndented"),p=r.indentLines(o,bS);return f(),p}let a=r.createTracker(n),u=i.repeat(Math.max(ag(o,i)+1,3)),l=r.enter("codeFenced"),c=a.move(u);if(t.lang){let f=r.enter(`codeFencedLang${s}`);c+=a.move(r.safe(t.lang,{before:c,after:" ",encode:["`"],...a.current()})),f()}if(t.lang&&t.meta){let f=r.enter(`codeFencedMeta${s}`);c+=a.move(" "),c+=a.move(r.safe(t.meta,{before:c,after:`
70
+ `;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,n.push(s)}return n.join("")}function nf(t){let n={constructs:Ba([rf,...(t||{}).extensions||[]]),content:i(Em),defined:[],document:i(wm),flow:i(_m),lazy:{},string:i(vm),text:i(Im)};return n;function i(o){return s;function s(a){return Rm(n,o,a)}}}function of(t){for(;!Ga(t););return t}var Fm=/[\0\t\n\r]/g;function sf(){let t=1,e="",r=!0,n;return i;function i(o,s,a){let u=[],l,c,f,p,d;for(o=e+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),f=0,e="",r&&(o.charCodeAt(0)===65279&&f++,r=void 0);f<o.length;){if(Fm.lastIndex=f,l=Fm.exec(o),p=l&&l.index!==void 0?l.index:o.length,d=o.charCodeAt(p),!l){e=o.slice(f);break}if(d===10&&f===p&&n)u.push(-3),n=void 0;else switch(n&&(u.push(-5),n=void 0),f<p&&(u.push(o.slice(f,p)),t+=p-f),d){case 0:{u.push(65533),t++;break}case 9:{for(c=Math.ceil(t/4)*4,u.push(-2);t++<c;)u.push(-1);break}case 10:{u.push(-4),t=1;break}default:n=!0,t=1}f=p+1}return a&&(n&&u.push(-5),e&&u.push(e),u.push(null)),u}}var B_=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Za(t){return t.replace(B_,j_)}function j_(t,e,r){if(e)return e;if(r.charCodeAt(0)===35){let i=r.charCodeAt(1),o=i===120||i===88;return ja(r.slice(o?2:1),o?16:10)}return no(r)||t}function io(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Nm(t.position):"start"in t||"end"in t?Nm(t):"line"in t||"column"in t?af(t):""}function af(t){return Pm(t&&t.line)+":"+Pm(t&&t.column)}function Nm(t){return af(t&&t.start)+"-"+af(t&&t.end)}function Pm(t){return t&&typeof t=="number"?t:1}var Mm={}.hasOwnProperty;function uf(t,e,r){return typeof e!="string"&&(r=e,e=void 0),U_(r)(of(nf(r).document().write(sf()(t,e,!0))))}function U_(t){let e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(T),autolinkProtocol:be,autolinkEmail:be,atxHeading:o(A),blockQuote:o(me),characterEscape:be,characterReference:be,codeFenced:o(Ce),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(Ce,s),codeText:o(Fe,s),codeTextData:be,data:be,codeFlowValue:be,definition:o(ze),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Ut),hardBreakEscape:o(k),hardBreakTrailing:o(k),htmlFlow:o(M,s),htmlFlowData:be,htmlText:o(M,s),htmlTextData:be,image:o(I),label:s,link:o(T),listItem:o($),listItemValue:p,listOrdered:o(K,f),listUnordered:o(K),paragraph:o(te),reference:E,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(A),strong:o(lt),thematicBreak:o(Tw)},exit:{atxHeading:u(),atxHeadingSequence:R,autolink:u(),autolinkEmail:ce,autolinkProtocol:oe,blockQuote:u(),characterEscapeValue:_,characterReferenceMarkerHexadecimal:Ke,characterReferenceMarkerNumeric:Ke,characterReferenceValue:ne,characterReference:he,codeFenced:u(g),codeFencedFence:y,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:_,codeIndented:u(b),codeText:u(j),codeTextData:_,data:_,definition:u(),definitionDestinationString:D,definitionLabelString:C,definitionTitleString:w,emphasis:u(),hardBreakEscape:u(F),hardBreakTrailing:u(F),htmlFlow:u(v),htmlFlowData:_,htmlText:u(P),htmlTextData:_,image:u(ee),label:rt,labelText:_e,lineEnding:L,link:u(ae),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:W,resourceDestinationString:x,resourceTitleString:Ue,resource:Je,setextHeading:u(ye),setextHeadingLineSequence:de,setextHeadingText:S,strong:u(),thematicBreak:u()}};Bm(e,(t||{}).mdastExtensions||[]);let r={};return n;function n(O){let B={type:"root",children:[]},Ee={stack:[B],tokenStack:[],config:e,enter:a,exit:l,buffer:s,resume:c,data:r},ve=[],Ne=-1;for(;++Ne<O.length;)if(O[Ne][1].type==="listOrdered"||O[Ne][1].type==="listUnordered")if(O[Ne][0]==="enter")ve.push(Ne);else{let dr=ve.pop();Ne=i(O,dr,Ne)}for(Ne=-1;++Ne<O.length;){let dr=e[O[Ne][0]];Mm.call(dr,O[Ne][1].type)&&dr[O[Ne][1].type].call(Object.assign({sliceSerialize:O[Ne][2].sliceSerialize},Ee),O[Ne][1])}if(Ee.tokenStack.length>0){let dr=Ee.tokenStack[Ee.tokenStack.length-1];(dr[1]||Lm).call(Ee,void 0,dr[0])}for(B.position={start:En(O.length>0?O[0][1].start:{line:1,column:1,offset:0}),end:En(O.length>0?O[O.length-2][1].end:{line:1,column:1,offset:0})},Ne=-1;++Ne<e.transforms.length;)B=e.transforms[Ne](B)||B;return B}function i(O,B,Ee){let ve=B-1,Ne=-1,dr=!1,zn,$r,Qo,es;for(;++ve<=Ee;){let Wt=O[ve];switch(Wt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Wt[0]==="enter"?Ne++:Ne--,es=void 0;break}case"lineEndingBlank":{Wt[0]==="enter"&&(zn&&!es&&!Ne&&!Qo&&(Qo=ve),es=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:es=void 0}if(!Ne&&Wt[0]==="enter"&&Wt[1].type==="listItemPrefix"||Ne===-1&&Wt[0]==="exit"&&(Wt[1].type==="listUnordered"||Wt[1].type==="listOrdered")){if(zn){let zi=ve;for($r=void 0;zi--;){let qr=O[zi];if(qr[1].type==="lineEnding"||qr[1].type==="lineEndingBlank"){if(qr[0]==="exit")continue;$r&&(O[$r][1].type="lineEndingBlank",dr=!0),qr[1].type="lineEnding",$r=zi}else if(!(qr[1].type==="linePrefix"||qr[1].type==="blockQuotePrefix"||qr[1].type==="blockQuotePrefixWhitespace"||qr[1].type==="blockQuoteMarker"||qr[1].type==="listItemIndent"))break}Qo&&(!$r||Qo<$r)&&(zn._spread=!0),zn.end=Object.assign({},$r?O[$r][1].start:Wt[1].end),O.splice($r||ve,0,["exit",zn,Wt[2]]),ve++,Ee++}if(Wt[1].type==="listItemPrefix"){let zi={type:"listItem",_spread:!1,start:Object.assign({},Wt[1].start),end:void 0};zn=zi,O.splice(ve,0,["enter",zi,Wt[2]]),ve++,Ee++,Qo=void 0,es=!0}}}return O[B][1]._spread=dr,Ee}function o(O,B){return Ee;function Ee(ve){a.call(this,O(ve),ve),B&&B.call(this,ve)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(O,B,Ee){this.stack[this.stack.length-1].children.push(O),this.stack.push(O),this.tokenStack.push([B,Ee||void 0]),O.position={start:En(B.start),end:void 0}}function u(O){return B;function B(Ee){O&&O.call(this,Ee),l.call(this,Ee)}}function l(O,B){let Ee=this.stack.pop(),ve=this.tokenStack.pop();if(ve)ve[0].type!==O.type&&(B?B.call(this,O,ve[0]):(ve[1]||Lm).call(this,O,ve[0]));else throw new Error("Cannot close `"+O.type+"` ("+io({start:O.start,end:O.end})+"): it\u2019s not open");Ee.position.end=En(O.end)}function c(){return Xr(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(O){if(this.data.expectingFirstListItemValue){let B=this.stack[this.stack.length-2];B.start=Number.parseInt(this.sliceSerialize(O),10),this.data.expectingFirstListItemValue=void 0}}function d(){let O=this.resume(),B=this.stack[this.stack.length-1];B.lang=O}function m(){let O=this.resume(),B=this.stack[this.stack.length-1];B.meta=O}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O.replace(/(\r?\n|\r)$/g,"")}function C(O){let B=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=B,Ee.identifier=_t(this.sliceSerialize(O)).toLowerCase()}function w(){let O=this.resume(),B=this.stack[this.stack.length-1];B.title=O}function D(){let O=this.resume(),B=this.stack[this.stack.length-1];B.url=O}function R(O){let B=this.stack[this.stack.length-1];if(!B.depth){let Ee=this.sliceSerialize(O).length;B.depth=Ee}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function de(O){let B=this.stack[this.stack.length-1];B.depth=this.sliceSerialize(O).codePointAt(0)===61?1:2}function ye(){this.data.setextHeadingSlurpLineEnding=void 0}function be(O){let Ee=this.stack[this.stack.length-1].children,ve=Ee[Ee.length-1];(!ve||ve.type!=="text")&&(ve=Ct(),ve.position={start:En(O.start),end:void 0},Ee.push(ve)),this.stack.push(ve)}function _(O){let B=this.stack.pop();B.value+=this.sliceSerialize(O),B.position.end=En(O.end)}function L(O){let B=this.stack[this.stack.length-1];if(this.data.atHardBreak){let Ee=B.children[B.children.length-1];Ee.position.end=En(O.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(B.type)&&(be.call(this,O),_.call(this,O))}function F(){this.data.atHardBreak=!0}function v(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function P(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function j(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function ae(){let O=this.stack[this.stack.length-1];if(this.data.inReference){let B=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=B,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function ee(){let O=this.stack[this.stack.length-1];if(this.data.inReference){let B=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=B,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function _e(O){let B=this.sliceSerialize(O),Ee=this.stack[this.stack.length-2];Ee.label=Za(B),Ee.identifier=_t(B).toLowerCase()}function rt(){let O=this.stack[this.stack.length-1],B=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){let ve=O.children;Ee.children=ve}else Ee.alt=B}function x(){let O=this.resume(),B=this.stack[this.stack.length-1];B.url=O}function Ue(){let O=this.resume(),B=this.stack[this.stack.length-1];B.title=O}function Je(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function W(O){let B=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=B,Ee.identifier=_t(this.sliceSerialize(O)).toLowerCase(),this.data.referenceType="full"}function Ke(O){this.data.characterReferenceType=O.type}function ne(O){let B=this.sliceSerialize(O),Ee=this.data.characterReferenceType,ve;Ee?(ve=ja(B,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ve=no(B);let Ne=this.stack[this.stack.length-1];Ne.value+=ve}function he(O){let B=this.stack.pop();B.position.end=En(O.end)}function oe(O){_.call(this,O);let B=this.stack[this.stack.length-1];B.url=this.sliceSerialize(O)}function ce(O){_.call(this,O);let B=this.stack[this.stack.length-1];B.url="mailto:"+this.sliceSerialize(O)}function me(){return{type:"blockquote",children:[]}}function Ce(){return{type:"code",lang:null,meta:null,value:""}}function Fe(){return{type:"inlineCode",value:""}}function ze(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ut(){return{type:"emphasis",children:[]}}function A(){return{type:"heading",depth:0,children:[]}}function k(){return{type:"break"}}function M(){return{type:"html",value:""}}function I(){return{type:"image",title:null,url:"",alt:null}}function T(){return{type:"link",title:null,url:"",children:[]}}function K(O){return{type:"list",ordered:O.type==="listOrdered",start:null,spread:O._spread,children:[]}}function $(O){return{type:"listItem",spread:O._spread,checked:null,children:[]}}function te(){return{type:"paragraph",children:[]}}function lt(){return{type:"strong",children:[]}}function Ct(){return{type:"text",value:""}}function Tw(){return{type:"thematicBreak"}}}function En(t){return{line:t.line,column:t.column,offset:t.offset}}function Bm(t,e){let r=-1;for(;++r<e.length;){let n=e[r];Array.isArray(n)?Bm(t,n):z_(t,n)}}function z_(t,e){let r;for(r in e)if(Mm.call(e,r))switch(r){case"canContainEols":{let n=e[r];n&&t[r].push(...n);break}case"transforms":{let n=e[r];n&&t[r].push(...n);break}case"enter":case"exit":{let n=e[r];n&&Object.assign(t[r],n);break}}}function Lm(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+io({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+io({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+io({start:e.start,end:e.end})+") is still open")}function Xa(t){let e=this;e.parser=r;function r(n){return uf(n,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}var jm={}.hasOwnProperty;function Um(t,e){let r=e||{};function n(i,...o){let s=n.invalid,a=n.handlers;if(i&&jm.call(i,t)){let u=String(i[t]);s=jm.call(a,u)?a[u]:n.unknown}if(s)return s.call(this,i,...o)}return n.handlers=r.handlers||{},n.invalid=r.invalid,n.unknown=r.unknown,n}var $_={}.hasOwnProperty;function lf(t,e){let r=-1,n;if(e.extensions)for(;++r<e.extensions.length;)lf(t,e.extensions[r]);for(n in e)if($_.call(e,n))switch(n){case"extensions":break;case"unsafe":{zm(t[n],e[n]);break}case"join":{zm(t[n],e[n]);break}case"handlers":{q_(t[n],e[n]);break}default:t.options[n]=e[n]}return t}function zm(t,e){e&&t.push(...e)}function q_(t,e){e&&Object.assign(t,e)}function $m(t,e,r,n){let i=r.enter("blockquote"),o=r.createTracker(n);o.move("> "),o.shift(2);let s=r.indentLines(r.containerFlow(t,o.current()),V_);return i(),s}function V_(t,e,r){return">"+(r?"":" ")+t}function Ja(t,e){return qm(t,e.inConstruct,!0)&&!qm(t,e.notInConstruct,!1)}function qm(t,e,r){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return r;let n=-1;for(;++n<e.length;)if(t.includes(e[n]))return!0;return!1}function cf(t,e,r,n){let i=-1;for(;++i<r.unsafe.length;)if(r.unsafe[i].character===`
71
+ `&&Ja(r.stack,r.unsafe[i]))return/[ \t]/.test(n.before)?"":" ";return`\\
72
+ `}function Vm(t,e){let r=String(t),n=r.indexOf(e),i=n,o=0,s=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===i?++o>s&&(s=o):o=1,i=n+e.length,n=r.indexOf(e,i);return s}function ys(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function Gm(t){let e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function Wm(t,e,r,n){let i=Gm(r),o=t.value||"",s=i==="`"?"GraveAccent":"Tilde";if(ys(t,r)){let f=r.enter("codeIndented"),p=r.indentLines(o,G_);return f(),p}let a=r.createTracker(n),u=i.repeat(Math.max(Vm(o,i)+1,3)),l=r.enter("codeFenced"),c=a.move(u);if(t.lang){let f=r.enter(`codeFencedLang${s}`);c+=a.move(r.safe(t.lang,{before:c,after:" ",encode:["`"],...a.current()})),f()}if(t.lang&&t.meta){let f=r.enter(`codeFencedMeta${s}`);c+=a.move(" "),c+=a.move(r.safe(t.meta,{before:c,after:`
77
73
  `,encode:["`"],...a.current()})),f()}return c+=a.move(`
78
74
  `),o&&(c+=a.move(o+`
79
- `)),c+=a.move(u),l(),c}function bS(t,e,r){return(r?"":" ")+t}function fo(t){let e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function cg(t,e,r,n){let i=fo(r),o=i==='"'?"Quote":"Apostrophe",s=r.enter("definition"),a=r.enter("label"),u=r.createTracker(n),l=u.move("[");return l+=u.move(r.safe(r.associationId(t),{before:l,after:"]",...u.current()})),l+=u.move("]: "),a(),!t.url||/[\0- \u007F]/.test(t.url)?(a=r.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(r.safe(t.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(a=r.enter("destinationRaw"),l+=u.move(r.safe(t.url,{before:l,after:t.title?" ":`
80
- `,...u.current()}))),a(),t.title&&(a=r.enter(`title${o}`),l+=u.move(" "+i),l+=u.move(r.safe(t.title,{before:l,after:i,...u.current()})),l+=u.move(i),a()),s(),l}function fg(t){let e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function nr(t){return"&#x"+t.toString(16).toUpperCase()+";"}function po(t,e,r){let n=rn(t),i=rn(e);return n===void 0?i===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===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}}yf.peek=ES;function yf(t,e,r,n){let i=fg(r),o=r.enter("emphasis"),s=r.createTracker(n),a=s.move(i),u=s.move(r.containerPhrasing(t,{after:i,before:a,...s.current()})),l=u.charCodeAt(0),c=po(n.before.charCodeAt(n.before.length-1),l,i);c.inside&&(u=nr(l)+u.slice(1));let f=u.charCodeAt(u.length-1),p=po(n.after.charCodeAt(0),f,i);p.inside&&(u=u.slice(0,-1)+nr(f));let d=s.move(i);return o(),r.attentionEncodeSurroundingInfo={after:p.outside,before:c.outside},a+u+d}function ES(t,e,r){return r.options.emphasis||"*"}var Fr=function(t){if(t==null)return kS;if(typeof t=="function")return ru(t);if(typeof t=="object")return Array.isArray(t)?AS(t):CS(t);if(typeof t=="string")return wS(t);throw new Error("Expected function, string, or object as test")};function AS(t){let e=[],r=-1;for(;++r<t.length;)e[r]=Fr(t[r]);return ru(n);function n(...i){let o=-1;for(;++o<e.length;)if(e[o].apply(this,i))return!0;return!1}}function CS(t){let e=t;return ru(r);function r(n){let i=n,o;for(o in t)if(i[o]!==e[o])return!1;return!0}}function wS(t){return ru(e);function e(r){return r&&r.type===t}}function ru(t){return e;function e(r,n,i){return!!(TS(r)&&t.call(this,r,typeof n=="number"?n:void 0,i||void 0))}}function kS(){return!0}function TS(t){return t!==null&&typeof t=="object"&&"type"in t}function pg(t){return"\x1B[33m"+t+"\x1B[39m"}var dg=[],nu=!0,Si=!1,iu="skip";function Ts(t,e,r,n){let i;typeof e=="function"&&typeof r!="function"?(n=r,r=e):i=e;let o=Fr(i),s=n?-1:1;a(t,void 0,[])();function a(u,l,c){let f=u&&typeof u=="object"?u:{};if(typeof f.type=="string"){let d=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(p,"name",{value:"node ("+pg(u.type+(d?"<"+d+">":""))+")"})}return p;function p(){let d=dg,m,y,g;if((!e||o(u,l,c[c.length-1]||void 0))&&(d=_S(r(u,c)),d[0]===Si))return d;if("children"in u&&u.children){let b=u;if(b.children&&d[0]!==iu)for(y=(n?b.children.length:-1)+s,g=c.concat(b);y>-1&&y<b.children.length;){let w=b.children[y];if(m=a(w,y,g)(),m[0]===Si)return m;y=typeof m[1]=="number"?m[1]:y+s}}return d}}}function _S(t){return Array.isArray(t)?t:typeof t=="number"?[nu,t]:t==null?dg:[t]}function _s(t,e,r,n){let i,o,s;typeof e=="function"&&typeof r!="function"?(o=void 0,s=e,i=r):(o=e,s=r,i=n),Ts(t,o,a,i);function a(u,l){let c=l[l.length-1],f=c?c.children.indexOf(u):void 0;return s(u,f,c)}}function ou(t,e){let r=!1;return _s(t,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return r=!0,Si}),!!((!t.depth||t.depth<3)&&tn(t)&&(e.options.setext||r))}function hg(t,e,r,n){let i=Math.max(Math.min(6,t.depth||1),1),o=r.createTracker(n);if(ou(t,r)){let c=r.enter("headingSetext"),f=r.enter("phrasing"),p=r.containerPhrasing(t,{...o.current(),before:`
75
+ `)),c+=a.move(u),l(),c}function G_(t,e,r){return(r?"":" ")+t}function oo(t){let e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function Hm(t,e,r,n){let i=oo(r),o=i==='"'?"Quote":"Apostrophe",s=r.enter("definition"),a=r.enter("label"),u=r.createTracker(n),l=u.move("[");return l+=u.move(r.safe(r.associationId(t),{before:l,after:"]",...u.current()})),l+=u.move("]: "),a(),!t.url||/[\0- \u007F]/.test(t.url)?(a=r.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(r.safe(t.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(a=r.enter("destinationRaw"),l+=u.move(r.safe(t.url,{before:l,after:t.title?" ":`
76
+ `,...u.current()}))),a(),t.title&&(a=r.enter(`title${o}`),l+=u.move(" "+i),l+=u.move(r.safe(t.title,{before:l,after:i,...u.current()})),l+=u.move(i),a()),s(),l}function Km(t){let e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function er(t){return"&#x"+t.toString(16).toUpperCase()+";"}function so(t,e,r){let n=Jr(t),i=Jr(e);return n===void 0?i===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===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}}ff.peek=W_;function ff(t,e,r,n){let i=Km(r),o=r.enter("emphasis"),s=r.createTracker(n),a=s.move(i),u=s.move(r.containerPhrasing(t,{after:i,before:a,...s.current()})),l=u.charCodeAt(0),c=so(n.before.charCodeAt(n.before.length-1),l,i);c.inside&&(u=er(l)+u.slice(1));let f=u.charCodeAt(u.length-1),p=so(n.after.charCodeAt(0),f,i);p.inside&&(u=u.slice(0,-1)+er(f));let d=s.move(i);return o(),r.attentionEncodeSurroundingInfo={after:p.outside,before:c.outside},a+u+d}function W_(t,e,r){return r.options.emphasis||"*"}var vr=function(t){if(t==null)return Z_;if(typeof t=="function")return Qa(t);if(typeof t=="object")return Array.isArray(t)?H_(t):K_(t);if(typeof t=="string")return Y_(t);throw new Error("Expected function, string, or object as test")};function H_(t){let e=[],r=-1;for(;++r<t.length;)e[r]=vr(t[r]);return Qa(n);function n(...i){let o=-1;for(;++o<e.length;)if(e[o].apply(this,i))return!0;return!1}}function K_(t){let e=t;return Qa(r);function r(n){let i=n,o;for(o in t)if(i[o]!==e[o])return!1;return!0}}function Y_(t){return Qa(e);function e(r){return r&&r.type===t}}function Qa(t){return e;function e(r,n,i){return!!(X_(r)&&t.call(this,r,typeof n=="number"?n:void 0,i||void 0))}}function Z_(){return!0}function X_(t){return t!==null&&typeof t=="object"&&"type"in t}function Ym(t){return"\x1B[33m"+t+"\x1B[39m"}var Zm=[],eu=!0,Ci=!1,tu="skip";function bs(t,e,r,n){let i;typeof e=="function"&&typeof r!="function"?(n=r,r=e):i=e;let o=vr(i),s=n?-1:1;a(t,void 0,[])();function a(u,l,c){let f=u&&typeof u=="object"?u:{};if(typeof f.type=="string"){let d=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(p,"name",{value:"node ("+Ym(u.type+(d?"<"+d+">":""))+")"})}return p;function p(){let d=Zm,m,y,g;if((!e||o(u,l,c[c.length-1]||void 0))&&(d=J_(r(u,c)),d[0]===Ci))return d;if("children"in u&&u.children){let b=u;if(b.children&&d[0]!==tu)for(y=(n?b.children.length:-1)+s,g=c.concat(b);y>-1&&y<b.children.length;){let C=b.children[y];if(m=a(C,y,g)(),m[0]===Ci)return m;y=typeof m[1]=="number"?m[1]:y+s}}return d}}}function J_(t){return Array.isArray(t)?t:typeof t=="number"?[eu,t]:t==null?Zm:[t]}function Es(t,e,r,n){let i,o,s;typeof e=="function"&&typeof r!="function"?(o=void 0,s=e,i=r):(o=e,s=r,i=n),bs(t,o,a,i);function a(u,l){let c=l[l.length-1],f=c?c.children.indexOf(u):void 0;return s(u,f,c)}}function ru(t,e){let r=!1;return Es(t,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return r=!0,Ci}),!!((!t.depth||t.depth<3)&&Xr(t)&&(e.options.setext||r))}function Xm(t,e,r,n){let i=Math.max(Math.min(6,t.depth||1),1),o=r.createTracker(n);if(ru(t,r)){let c=r.enter("headingSetext"),f=r.enter("phrasing"),p=r.containerPhrasing(t,{...o.current(),before:`
81
77
  `,after:`
82
78
  `});return f(),c(),p+`
83
79
  `+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
84
80
  `))+1))}let s="#".repeat(i),a=r.enter("headingAtx"),u=r.enter("phrasing");o.move(s+" ");let l=r.containerPhrasing(t,{before:"# ",after:`
85
- `,...o.current()});return/^[\t ]/.test(l)&&(l=nr(l.charCodeAt(0))+l.slice(1)),l=l?s+" "+l:s,r.options.closeAtx&&(l+=" "+s),u(),a(),l}bf.peek=SS;function bf(t){return t.value||""}function SS(){return"<"}Ef.peek=vS;function Ef(t,e,r,n){let i=fo(r),o=i==='"'?"Quote":"Apostrophe",s=r.enter("image"),a=r.enter("label"),u=r.createTracker(n),l=u.move("![");return l+=u.move(r.safe(t.alt,{before:l,after:"]",...u.current()})),l+=u.move("]("),a(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(a=r.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(r.safe(t.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(a=r.enter("destinationRaw"),l+=u.move(r.safe(t.url,{before:l,after:t.title?" ":")",...u.current()}))),a(),t.title&&(a=r.enter(`title${o}`),l+=u.move(" "+i),l+=u.move(r.safe(t.title,{before:l,after:i,...u.current()})),l+=u.move(i),a()),l+=u.move(")"),s(),l}function vS(){return"!"}Af.peek=IS;function Af(t,e,r,n){let i=t.referenceType,o=r.enter("imageReference"),s=r.enter("label"),a=r.createTracker(n),u=a.move("!["),l=r.safe(t.alt,{before:u,after:"]",...a.current()});u+=a.move(l+"]["),s();let c=r.stack;r.stack=[],s=r.enter("reference");let f=r.safe(r.associationId(t),{before:u,after:"]",...a.current()});return s(),r.stack=c,o(),i==="full"||!l||l!==f?u+=a.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function IS(){return"!"}Cf.peek=OS;function Cf(t,e,r){let n=t.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(n);)i+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++o<r.unsafe.length;){let s=r.unsafe[o],a=r.compilePattern(s),u;if(s.atBreak)for(;u=a.exec(n);){let l=u.index;n.charCodeAt(l)===10&&n.charCodeAt(l-1)===13&&l--,n=n.slice(0,l)+" "+n.slice(u.index+1)}}return i+n+i}function OS(){return"`"}function wf(t,e){let r=tn(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(r===t.url||"mailto:"+r===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}kf.peek=DS;function kf(t,e,r,n){let i=fo(r),o=i==='"'?"Quote":"Apostrophe",s=r.createTracker(n),a,u;if(wf(t,r)){let c=r.stack;r.stack=[],a=r.enter("autolink");let f=s.move("<");return f+=s.move(r.containerPhrasing(t,{before:f,after:">",...s.current()})),f+=s.move(">"),a(),r.stack=c,f}a=r.enter("link"),u=r.enter("label");let l=s.move("[");return l+=s.move(r.containerPhrasing(t,{before:l,after:"](",...s.current()})),l+=s.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=r.enter("destinationLiteral"),l+=s.move("<"),l+=s.move(r.safe(t.url,{before:l,after:">",...s.current()})),l+=s.move(">")):(u=r.enter("destinationRaw"),l+=s.move(r.safe(t.url,{before:l,after:t.title?" ":")",...s.current()}))),u(),t.title&&(u=r.enter(`title${o}`),l+=s.move(" "+i),l+=s.move(r.safe(t.title,{before:l,after:i,...s.current()})),l+=s.move(i),u()),l+=s.move(")"),a(),l}function DS(t,e,r){return wf(t,r)?"<":"["}Tf.peek=RS;function Tf(t,e,r,n){let i=t.referenceType,o=r.enter("linkReference"),s=r.enter("label"),a=r.createTracker(n),u=a.move("["),l=r.containerPhrasing(t,{before:u,after:"]",...a.current()});u+=a.move(l+"]["),s();let c=r.stack;r.stack=[],s=r.enter("reference");let f=r.safe(r.associationId(t),{before:u,after:"]",...a.current()});return s(),r.stack=c,o(),i==="full"||!l||l!==f?u+=a.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function RS(){return"["}function ho(t){let e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function mg(t){let e=ho(t),r=t.options.bulletOther;if(!r)return e==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+r+"`) to be different");return r}function gg(t){let e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function su(t){let e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function xg(t,e,r,n){let i=r.enter("list"),o=r.bulletCurrent,s=t.ordered?gg(r):ho(r),a=t.ordered?s==="."?")":".":mg(r),u=e&&r.bulletLastUsed?s===r.bulletLastUsed:!1;if(!t.ordered){let c=t.children?t.children[0]:void 0;if((s==="*"||s==="-")&&c&&(!c.children||!c.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(u=!0),su(r)===s&&c){let f=-1;for(;++f<t.children.length;){let p=t.children[f];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=a),r.bulletCurrent=s;let l=r.containerFlow(t,n);return r.bulletLastUsed=s,r.bulletCurrent=o,i(),l}function yg(t){let e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function bg(t,e,r,n){let i=yg(r),o=r.bulletCurrent||ho(r);e&&e.type==="list"&&e.ordered&&(o=(typeof e.start=="number"&&e.start>-1?e.start:1)+(r.options.incrementListMarker===!1?0:e.children.indexOf(t))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(s=Math.ceil(s/4)*4);let a=r.createTracker(n);a.move(o+" ".repeat(s-o.length)),a.shift(s);let u=r.enter("listItem"),l=r.indentLines(r.containerFlow(t,a.current()),c);return u(),l;function c(f,p,d){return p?(d?"":" ".repeat(s))+f:(d?o:o+" ".repeat(s-o.length))+f}}function Eg(t,e,r,n){let i=r.enter("paragraph"),o=r.enter("phrasing"),s=r.containerPhrasing(t,n);return o(),i(),s}var _f=Fr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Ag(t,e,r,n){return(t.children.some(function(s){return _f(s)})?r.containerPhrasing:r.containerFlow).call(r,t,n)}function Cg(t){let e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}Sf.peek=FS;function Sf(t,e,r,n){let i=Cg(r),o=r.enter("strong"),s=r.createTracker(n),a=s.move(i+i),u=s.move(r.containerPhrasing(t,{after:i,before:a,...s.current()})),l=u.charCodeAt(0),c=po(n.before.charCodeAt(n.before.length-1),l,i);c.inside&&(u=nr(l)+u.slice(1));let f=u.charCodeAt(u.length-1),p=po(n.after.charCodeAt(0),f,i);p.inside&&(u=u.slice(0,-1)+nr(f));let d=s.move(i+i);return o(),r.attentionEncodeSurroundingInfo={after:p.outside,before:c.outside},a+u+d}function FS(t,e,r){return r.options.strong||"*"}function wg(t,e,r,n){return r.safe(t.value,n)}function kg(t){let e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function Tg(t,e,r){let n=(su(r)+(r.options.ruleSpaces?" ":"")).repeat(kg(r));return r.options.ruleSpaces?n.slice(0,-1):n}var vi={blockquote:og,break:xf,code:lg,definition:cg,emphasis:yf,hardBreak:xf,heading:hg,html:bf,image:Ef,imageReference:Af,inlineCode:Cf,link:kf,linkReference:Tf,list:xg,listItem:bg,paragraph:Eg,root:Ag,strong:Sf,text:wg,thematicBreak:Tg};var _g=[NS];function NS(t,e,r,n){if(e.type==="code"&&ks(e,n)&&(t.type==="list"||t.type===e.type&&ks(t,n)))return!1;if("spread"in r&&typeof r.spread=="boolean")return t.type==="paragraph"&&(t.type===e.type||e.type==="definition"||e.type==="heading"&&ou(e,n))?void 0:r.spread?1:0}var Ii=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],Sg=[{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:`
86
- `,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:Ii},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
87
- ]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:Ii},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
88
- *])`},{character:"*",inConstruct:"phrasing",notInConstruct:Ii},{atBreak:!0,character:"+",after:`(?:[ \r
81
+ `,...o.current()});return/^[\t ]/.test(l)&&(l=er(l.charCodeAt(0))+l.slice(1)),l=l?s+" "+l:s,r.options.closeAtx&&(l+=" "+s),u(),a(),l}pf.peek=Q_;function pf(t){return t.value||""}function Q_(){return"<"}df.peek=eS;function df(t,e,r,n){let i=oo(r),o=i==='"'?"Quote":"Apostrophe",s=r.enter("image"),a=r.enter("label"),u=r.createTracker(n),l=u.move("![");return l+=u.move(r.safe(t.alt,{before:l,after:"]",...u.current()})),l+=u.move("]("),a(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(a=r.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(r.safe(t.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(a=r.enter("destinationRaw"),l+=u.move(r.safe(t.url,{before:l,after:t.title?" ":")",...u.current()}))),a(),t.title&&(a=r.enter(`title${o}`),l+=u.move(" "+i),l+=u.move(r.safe(t.title,{before:l,after:i,...u.current()})),l+=u.move(i),a()),l+=u.move(")"),s(),l}function eS(){return"!"}hf.peek=tS;function hf(t,e,r,n){let i=t.referenceType,o=r.enter("imageReference"),s=r.enter("label"),a=r.createTracker(n),u=a.move("!["),l=r.safe(t.alt,{before:u,after:"]",...a.current()});u+=a.move(l+"]["),s();let c=r.stack;r.stack=[],s=r.enter("reference");let f=r.safe(r.associationId(t),{before:u,after:"]",...a.current()});return s(),r.stack=c,o(),i==="full"||!l||l!==f?u+=a.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function tS(){return"!"}mf.peek=rS;function mf(t,e,r){let n=t.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(n);)i+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++o<r.unsafe.length;){let s=r.unsafe[o],a=r.compilePattern(s),u;if(s.atBreak)for(;u=a.exec(n);){let l=u.index;n.charCodeAt(l)===10&&n.charCodeAt(l-1)===13&&l--,n=n.slice(0,l)+" "+n.slice(u.index+1)}}return i+n+i}function rS(){return"`"}function gf(t,e){let r=Xr(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(r===t.url||"mailto:"+r===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}xf.peek=nS;function xf(t,e,r,n){let i=oo(r),o=i==='"'?"Quote":"Apostrophe",s=r.createTracker(n),a,u;if(gf(t,r)){let c=r.stack;r.stack=[],a=r.enter("autolink");let f=s.move("<");return f+=s.move(r.containerPhrasing(t,{before:f,after:">",...s.current()})),f+=s.move(">"),a(),r.stack=c,f}a=r.enter("link"),u=r.enter("label");let l=s.move("[");return l+=s.move(r.containerPhrasing(t,{before:l,after:"](",...s.current()})),l+=s.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=r.enter("destinationLiteral"),l+=s.move("<"),l+=s.move(r.safe(t.url,{before:l,after:">",...s.current()})),l+=s.move(">")):(u=r.enter("destinationRaw"),l+=s.move(r.safe(t.url,{before:l,after:t.title?" ":")",...s.current()}))),u(),t.title&&(u=r.enter(`title${o}`),l+=s.move(" "+i),l+=s.move(r.safe(t.title,{before:l,after:i,...s.current()})),l+=s.move(i),u()),l+=s.move(")"),a(),l}function nS(t,e,r){return gf(t,r)?"<":"["}yf.peek=iS;function yf(t,e,r,n){let i=t.referenceType,o=r.enter("linkReference"),s=r.enter("label"),a=r.createTracker(n),u=a.move("["),l=r.containerPhrasing(t,{before:u,after:"]",...a.current()});u+=a.move(l+"]["),s();let c=r.stack;r.stack=[],s=r.enter("reference");let f=r.safe(r.associationId(t),{before:u,after:"]",...a.current()});return s(),r.stack=c,o(),i==="full"||!l||l!==f?u+=a.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function iS(){return"["}function ao(t){let e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function Jm(t){let e=ao(t),r=t.options.bulletOther;if(!r)return e==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+r+"`) to be different");return r}function Qm(t){let e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function nu(t){let e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function eg(t,e,r,n){let i=r.enter("list"),o=r.bulletCurrent,s=t.ordered?Qm(r):ao(r),a=t.ordered?s==="."?")":".":Jm(r),u=e&&r.bulletLastUsed?s===r.bulletLastUsed:!1;if(!t.ordered){let c=t.children?t.children[0]:void 0;if((s==="*"||s==="-")&&c&&(!c.children||!c.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(u=!0),nu(r)===s&&c){let f=-1;for(;++f<t.children.length;){let p=t.children[f];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=a),r.bulletCurrent=s;let l=r.containerFlow(t,n);return r.bulletLastUsed=s,r.bulletCurrent=o,i(),l}function tg(t){let e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function rg(t,e,r,n){let i=tg(r),o=r.bulletCurrent||ao(r);e&&e.type==="list"&&e.ordered&&(o=(typeof e.start=="number"&&e.start>-1?e.start:1)+(r.options.incrementListMarker===!1?0:e.children.indexOf(t))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(s=Math.ceil(s/4)*4);let a=r.createTracker(n);a.move(o+" ".repeat(s-o.length)),a.shift(s);let u=r.enter("listItem"),l=r.indentLines(r.containerFlow(t,a.current()),c);return u(),l;function c(f,p,d){return p?(d?"":" ".repeat(s))+f:(d?o:o+" ".repeat(s-o.length))+f}}function ng(t,e,r,n){let i=r.enter("paragraph"),o=r.enter("phrasing"),s=r.containerPhrasing(t,n);return o(),i(),s}var bf=vr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ig(t,e,r,n){return(t.children.some(function(s){return bf(s)})?r.containerPhrasing:r.containerFlow).call(r,t,n)}function og(t){let e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}Ef.peek=oS;function Ef(t,e,r,n){let i=og(r),o=r.enter("strong"),s=r.createTracker(n),a=s.move(i+i),u=s.move(r.containerPhrasing(t,{after:i,before:a,...s.current()})),l=u.charCodeAt(0),c=so(n.before.charCodeAt(n.before.length-1),l,i);c.inside&&(u=er(l)+u.slice(1));let f=u.charCodeAt(u.length-1),p=so(n.after.charCodeAt(0),f,i);p.inside&&(u=u.slice(0,-1)+er(f));let d=s.move(i+i);return o(),r.attentionEncodeSurroundingInfo={after:p.outside,before:c.outside},a+u+d}function oS(t,e,r){return r.options.strong||"*"}function sg(t,e,r,n){return r.safe(t.value,n)}function ag(t){let e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function ug(t,e,r){let n=(nu(r)+(r.options.ruleSpaces?" ":"")).repeat(ag(r));return r.options.ruleSpaces?n.slice(0,-1):n}var ki={blockquote:$m,break:cf,code:Wm,definition:Hm,emphasis:ff,hardBreak:cf,heading:Xm,html:pf,image:df,imageReference:hf,inlineCode:mf,link:xf,linkReference:yf,list:eg,listItem:rg,paragraph:ng,root:ig,strong:Ef,text:sg,thematicBreak:ug};var lg=[sS];function sS(t,e,r,n){if(e.type==="code"&&ys(e,n)&&(t.type==="list"||t.type===e.type&&ys(t,n)))return!1;if("spread"in r&&typeof r.spread=="boolean")return t.type==="paragraph"&&(t.type===e.type||e.type==="definition"||e.type==="heading"&&ru(e,n))?void 0:r.spread?1:0}var Ti=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],cg=[{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:`
82
+ `,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:Ti},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
83
+ ]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:Ti},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
84
+ *])`},{character:"*",inConstruct:"phrasing",notInConstruct:Ti},{atBreak:!0,character:"+",after:`(?:[ \r
89
85
  ])`},{atBreak:!0,character:"-",after:`(?:[ \r
90
86
  -])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r
91
- ]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:Ii},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:Ii},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:Ii},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:Ii},{atBreak:!0,character:"~"}];function vg(t){return t.label||!t.identifier?t.label||"":Qa(t.identifier)}function Ig(t){if(!t._compiled){let e=(t.atBreak?"[\\r\\n][\\t ]*":"")+(t.before?"(?:"+t.before+")":"");t._compiled=new RegExp((e?"("+e+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(t.character)?"\\":"")+t.character+(t.after?"(?:"+t.after+")":""),"g")}return t._compiled}function Og(t,e,r){let n=e.indexStack,i=t.children||[],o=[],s=-1,a=r.before,u;n.push(-1);let l=e.createTracker(r);for(;++s<i.length;){let c=i[s],f;if(n[n.length-1]=s,s+1<i.length){let m=e.handle.handlers[i[s+1].type];m&&m.peek&&(m=m.peek),f=m?m(i[s+1],t,e,{before:"",after:"",...l.current()}).charAt(0):""}else f=r.after;o.length>0&&(a==="\r"||a===`
92
- `)&&c.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),a=" ",l=e.createTracker(r),l.move(o.join("")));let p=e.handle(c,t,e,{...l.current(),after:f,before:a});u&&u===p.slice(0,1)&&(p=nr(u.charCodeAt(0))+p.slice(1));let d=e.attentionEncodeSurroundingInfo;e.attentionEncodeSurroundingInfo=void 0,u=void 0,d&&(o.length>0&&d.before&&a===o[o.length-1].slice(-1)&&(o[o.length-1]=o[o.length-1].slice(0,-1)+nr(a.charCodeAt(0))),d.after&&(u=f)),l.move(p),o.push(p),a=p.slice(-1)}return n.pop(),o.join("")}function Dg(t,e,r){let n=e.indexStack,i=t.children||[],o=e.createTracker(r),s=[],a=-1;for(n.push(-1);++a<i.length;){let u=i[a];n[n.length-1]=a,s.push(o.move(e.handle(u,t,e,{before:`
87
+ ]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:Ti},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:Ti},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:Ti},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:Ti},{atBreak:!0,character:"~"}];function fg(t){return t.label||!t.identifier?t.label||"":Za(t.identifier)}function pg(t){if(!t._compiled){let e=(t.atBreak?"[\\r\\n][\\t ]*":"")+(t.before?"(?:"+t.before+")":"");t._compiled=new RegExp((e?"("+e+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(t.character)?"\\":"")+t.character+(t.after?"(?:"+t.after+")":""),"g")}return t._compiled}function dg(t,e,r){let n=e.indexStack,i=t.children||[],o=[],s=-1,a=r.before,u;n.push(-1);let l=e.createTracker(r);for(;++s<i.length;){let c=i[s],f;if(n[n.length-1]=s,s+1<i.length){let m=e.handle.handlers[i[s+1].type];m&&m.peek&&(m=m.peek),f=m?m(i[s+1],t,e,{before:"",after:"",...l.current()}).charAt(0):""}else f=r.after;o.length>0&&(a==="\r"||a===`
88
+ `)&&c.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),a=" ",l=e.createTracker(r),l.move(o.join("")));let p=e.handle(c,t,e,{...l.current(),after:f,before:a});u&&u===p.slice(0,1)&&(p=er(u.charCodeAt(0))+p.slice(1));let d=e.attentionEncodeSurroundingInfo;e.attentionEncodeSurroundingInfo=void 0,u=void 0,d&&(o.length>0&&d.before&&a===o[o.length-1].slice(-1)&&(o[o.length-1]=o[o.length-1].slice(0,-1)+er(a.charCodeAt(0))),d.after&&(u=f)),l.move(p),o.push(p),a=p.slice(-1)}return n.pop(),o.join("")}function hg(t,e,r){let n=e.indexStack,i=t.children||[],o=e.createTracker(r),s=[],a=-1;for(n.push(-1);++a<i.length;){let u=i[a];n[n.length-1]=a,s.push(o.move(e.handle(u,t,e,{before:`
93
89
  `,after:`
94
- `,...o.current()}))),u.type!=="list"&&(e.bulletLastUsed=void 0),a<i.length-1&&s.push(o.move(PS(u,i[a+1],t,e)))}return n.pop(),s.join("")}function PS(t,e,r,n){let i=n.join.length;for(;i--;){let o=n.join[i](t,e,r,n);if(o===!0||o===1)break;if(typeof o=="number")return`
90
+ `,...o.current()}))),u.type!=="list"&&(e.bulletLastUsed=void 0),a<i.length-1&&s.push(o.move(aS(u,i[a+1],t,e)))}return n.pop(),s.join("")}function aS(t,e,r,n){let i=n.join.length;for(;i--;){let o=n.join[i](t,e,r,n);if(o===!0||o===1)break;if(typeof o=="number")return`
95
91
  `.repeat(1+o);if(o===!1)return`
96
92
 
97
93
  <!---->
98
94
 
99
95
  `}return`
100
96
 
101
- `}var LS=/\r?\n|\r/g;function Rg(t,e){let r=[],n=0,i=0,o;for(;o=LS.exec(t);)s(t.slice(n,o.index)),r.push(o[0]),n=o.index+o[0].length,i++;return s(t.slice(n)),r.join("");function s(a){r.push(e(a,i,!a))}}function Ng(t,e,r){let n=(r.before||"")+(e||"")+(r.after||""),i=[],o=[],s={},a=-1;for(;++a<t.unsafe.length;){let c=t.unsafe[a];if(!tu(t.stack,c))continue;let f=t.compilePattern(c),p;for(;p=f.exec(n);){let d="before"in c||!!c.atBreak,m="after"in c,y=p.index+(d?p[1].length:0);i.includes(y)?(s[y].before&&!d&&(s[y].before=!1),s[y].after&&!m&&(s[y].after=!1)):(i.push(y),s[y]={before:d,after:m})}}i.sort(MS);let u=r.before?r.before.length:0,l=n.length-(r.after?r.after.length:0);for(a=-1;++a<i.length;){let c=i[a];c<u||c>=l||c+1<l&&i[a+1]===c+1&&s[c].after&&!s[c+1].before&&!s[c+1].after||i[a-1]===c-1&&s[c].before&&!s[c-1].before&&!s[c-1].after||(u!==c&&o.push(Fg(n.slice(u,c),"\\")),u=c,/[!-/:-@[-`{-~]/.test(n.charAt(c))&&(!r.encode||!r.encode.includes(n.charAt(c)))?o.push("\\"):(o.push(nr(n.charCodeAt(c))),u++))}return o.push(Fg(n.slice(u,l),r.after)),o.join("")}function MS(t,e){return t-e}function Fg(t,e){let r=/\\(?=[!-/:-@[-`{-~])/g,n=[],i=[],o=t+e,s=-1,a=0,u;for(;u=r.exec(o);)n.push(u.index);for(;++s<n.length;)a!==n[s]&&i.push(t.slice(a,n[s])),i.push("\\"),a=n[s];return i.push(t.slice(a)),i.join("")}function Pg(t){let e=t||{},r=e.now||{},n=e.lineShift||0,i=r.line||1,o=r.column||1;return{move:u,current:s,shift:a};function s(){return{now:{line:i,column:o},lineShift:n}}function a(l){n+=l}function u(l){let c=l||"",f=c.split(/\r?\n|\r/g),p=f[f.length-1];return i+=f.length-1,o=f.length===1?o+p.length:1+p.length+n,c}}function vf(t,e){let r=e||{},n={associationId:vg,containerPhrasing:zS,containerFlow:$S,createTracker:Pg,compilePattern:Ig,enter:o,handlers:{...vi},handle:void 0,indentLines:Rg,indexStack:[],join:[..._g],options:{},safe:qS,stack:[],unsafe:[...Sg]};gf(n,r),n.options.tightDefinitions&&n.join.push(US),n.handle=ng("type",{invalid:BS,unknown:jS,handlers:n.handlers});let i=n.handle(t,void 0,n,{before:`
97
+ `}var uS=/\r?\n|\r/g;function mg(t,e){let r=[],n=0,i=0,o;for(;o=uS.exec(t);)s(t.slice(n,o.index)),r.push(o[0]),n=o.index+o[0].length,i++;return s(t.slice(n)),r.join("");function s(a){r.push(e(a,i,!a))}}function xg(t,e,r){let n=(r.before||"")+(e||"")+(r.after||""),i=[],o=[],s={},a=-1;for(;++a<t.unsafe.length;){let c=t.unsafe[a];if(!Ja(t.stack,c))continue;let f=t.compilePattern(c),p;for(;p=f.exec(n);){let d="before"in c||!!c.atBreak,m="after"in c,y=p.index+(d?p[1].length:0);i.includes(y)?(s[y].before&&!d&&(s[y].before=!1),s[y].after&&!m&&(s[y].after=!1)):(i.push(y),s[y]={before:d,after:m})}}i.sort(lS);let u=r.before?r.before.length:0,l=n.length-(r.after?r.after.length:0);for(a=-1;++a<i.length;){let c=i[a];c<u||c>=l||c+1<l&&i[a+1]===c+1&&s[c].after&&!s[c+1].before&&!s[c+1].after||i[a-1]===c-1&&s[c].before&&!s[c-1].before&&!s[c-1].after||(u!==c&&o.push(gg(n.slice(u,c),"\\")),u=c,/[!-/:-@[-`{-~]/.test(n.charAt(c))&&(!r.encode||!r.encode.includes(n.charAt(c)))?o.push("\\"):(o.push(er(n.charCodeAt(c))),u++))}return o.push(gg(n.slice(u,l),r.after)),o.join("")}function lS(t,e){return t-e}function gg(t,e){let r=/\\(?=[!-/:-@[-`{-~])/g,n=[],i=[],o=t+e,s=-1,a=0,u;for(;u=r.exec(o);)n.push(u.index);for(;++s<n.length;)a!==n[s]&&i.push(t.slice(a,n[s])),i.push("\\"),a=n[s];return i.push(t.slice(a)),i.join("")}function yg(t){let e=t||{},r=e.now||{},n=e.lineShift||0,i=r.line||1,o=r.column||1;return{move:u,current:s,shift:a};function s(){return{now:{line:i,column:o},lineShift:n}}function a(l){n+=l}function u(l){let c=l||"",f=c.split(/\r?\n|\r/g),p=f[f.length-1];return i+=f.length-1,o=f.length===1?o+p.length:1+p.length+n,c}}function Af(t,e){let r=e||{},n={associationId:fg,containerPhrasing:dS,containerFlow:hS,createTracker:yg,compilePattern:pg,enter:o,handlers:{...ki},handle:void 0,indentLines:mg,indexStack:[],join:[...lg],options:{},safe:mS,stack:[],unsafe:[...cg]};lf(n,r),n.options.tightDefinitions&&n.join.push(pS),n.handle=Um("type",{invalid:cS,unknown:fS,handlers:n.handlers});let i=n.handle(t,void 0,n,{before:`
102
98
  `,after:`
103
99
  `,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
104
- `),i;function o(s){return n.stack.push(s),a;function a(){n.stack.pop()}}}function BS(t){throw new Error("Cannot handle value `"+t+"`, expected node")}function jS(t){let e=t;throw new Error("Cannot handle unknown node `"+e.type+"`")}function US(t,e){if(t.type==="definition"&&t.type===e.type)return 0}function zS(t,e){return Og(t,this,e)}function $S(t,e){return Dg(t,this,e)}function qS(t,e){return Ng(this,t,e)}function au(t){let e=this;e.compiler=r;function r(n){return vf(n,{...e.data("settings"),...t,extensions:e.data("toMarkdownExtensions")||[]})}}function If(t){if(t)throw t}var cu=jd(Vg(),1);function Ss(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Of(){let t=[],e={run:r,use:n};return e;function r(...i){let o=-1,s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(u,...l){let c=t[++o],f=-1;if(u){s(u);return}for(;++f<i.length;)(l[f]===null||l[f]===void 0)&&(l[f]=i[f]);i=l,c?Gg(c,a)(...l):s(null,...l)}}function n(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function Gg(t,e){let r;return n;function n(...s){let a=t.length>s.length,u;a&&s.push(i);try{u=t.apply(this,s)}catch(l){let c=l;if(a&&r)throw c;return i(c)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(s,...a){r||(r=!0,e(s,...a))}function o(s){i(null,s)}}import{VFile as VS}from"vfile";var Wg=function(t){let n=this.constructor.prototype,i=n[t],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,n),o};var GS={}.hasOwnProperty,Nf=class t extends Wg{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=Of()}copy(){let e=new t,r=-1;for(;++r<this.attachers.length;){let n=this.attachers[r];e.use(...n)}return e.data((0,cu.default)(!0,{},this.namespace)),e}data(e,r){return typeof e=="string"?arguments.length===2?(Ff("data",this.frozen),this.namespace[e]=r,this):GS.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Ff("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[r,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let i=r.call(e,...n);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();let r=lu(e),n=this.parser||this.Parser;return Df("parse",n),n(String(r),r)}process(e,r){let n=this;return this.freeze(),Df("process",this.parser||this.Parser),Rf("process",this.compiler||this.Compiler),r?i(void 0,r):new Promise(i);function i(o,s){let a=lu(e),u=n.parse(a);n.run(u,a,function(c,f,p){if(c||!f||!p)return l(c);let d=f,m=n.stringify(d,p);HS(m)?p.value=m:p.result=m,l(c,p)});function l(c,f){c||!f?s(c):o?o(f):r(void 0,f)}}}processSync(e){let r=!1,n;return this.freeze(),Df("processSync",this.parser||this.Parser),Rf("processSync",this.compiler||this.Compiler),this.process(e,i),Kg("processSync","process",r),n;function i(o,s){r=!0,If(o),n=s}}run(e,r,n){Hg(e),this.freeze();let i=this.transformers;return!n&&typeof r=="function"&&(n=r,r=void 0),n?o(void 0,n):new Promise(o);function o(s,a){let u=lu(r);i.run(e,u,l);function l(c,f,p){let d=f||e;c?a(c):s?s(d):n(void 0,d,p)}}}runSync(e,r){let n=!1,i;return this.run(e,r,o),Kg("runSync","run",n),i;function o(s,a){If(s),i=a,n=!0}}stringify(e,r){this.freeze();let n=lu(r),i=this.compiler||this.Compiler;return Rf("stringify",i),Hg(e),i(e,n)}use(e,...r){let n=this.attachers,i=this.namespace;if(Ff("use",this.frozen),e!=null)if(typeof e=="function")u(e,r);else if(typeof e=="object")Array.isArray(e)?a(e):s(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function o(l){if(typeof l=="function")u(l,[]);else if(typeof l=="object")if(Array.isArray(l)){let[c,...f]=l;u(c,f)}else s(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function s(l){if(!("plugins"in l)&&!("settings"in l))throw new 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");a(l.plugins),l.settings&&(i.settings=(0,cu.default)(!0,i.settings,l.settings))}function a(l){let c=-1;if(l!=null)if(Array.isArray(l))for(;++c<l.length;){let f=l[c];o(f)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function u(l,c){let f=-1,p=-1;for(;++f<n.length;)if(n[f][0]===l){p=f;break}if(p===-1)n.push([l,...c]);else if(c.length>0){let[d,...m]=c,y=n[p][1];Ss(y)&&Ss(d)&&(d=(0,cu.default)(!0,y,d)),n[p]=[l,d,...m]}}}},Pf=new Nf().freeze();function Df(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Rf(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Ff(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Hg(t){if(!Ss(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Kg(t,e,r){if(!r)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function lu(t){return WS(t)?t:new VS(t)}function WS(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function HS(t){return typeof t=="string"||KS(t)}function KS(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}var mo=Pf().use(eu).use(au).freeze();function Lf(t,e){let r=String(t);if(typeof e!="string")throw new TypeError("Expected character");let n=0,i=r.indexOf(e);for(;i!==-1;)n++,i=r.indexOf(e,i+e.length);return n}function Mf(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Bf(t,e,r){let i=Fr((r||{}).ignore||[]),o=YS(e),s=-1;for(;++s<o.length;)Ts(t,"text",a);function a(l,c){let f=-1,p;for(;++f<c.length;){let d=c[f],m=p?p.children:void 0;if(i(d,m?m.indexOf(d):void 0,p))return;p=d}if(p)return u(l,c)}function u(l,c){let f=c[c.length-1],p=o[s][0],d=o[s][1],m=0,g=f.children.indexOf(l),b=!1,w=[];p.lastIndex=0;let C=p.exec(l.value);for(;C;){let D=C.index,R={index:C.index,input:C.input,stack:[...c,l]},S=d(...C,R);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?p.lastIndex=D+1:(m!==D&&w.push({type:"text",value:l.value.slice(m,D)}),Array.isArray(S)?w.push(...S):S&&w.push(S),m=D+C[0].length,b=!0),!p.global)break;C=p.exec(l.value)}return b?(m<l.value.length&&w.push({type:"text",value:l.value.slice(m)}),f.children.splice(g,1,...w)):w=[l],g+w.length}}function YS(t){let e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");let r=!t[0]||Array.isArray(t[0])?t:[t],n=-1;for(;++n<r.length;){let i=r[n];e.push([ZS(i[0]),XS(i[1])])}return e}function ZS(t){return typeof t=="string"?new RegExp(Mf(t),"g"):t}function XS(t){return typeof t=="function"?t:function(){return t}}var jf="phrasing",Uf=["autolink","link","image","label"];function $f(){return{transforms:[n0],enter:{literalAutolink:JS,literalAutolinkEmail:zf,literalAutolinkHttp:zf,literalAutolinkWww:zf},exit:{literalAutolink:r0,literalAutolinkEmail:t0,literalAutolinkHttp:QS,literalAutolinkWww:e0}}}function qf(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:jf,notInConstruct:Uf},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:jf,notInConstruct:Uf},{character:":",before:"[ps]",after:"\\/",inConstruct:jf,notInConstruct:Uf}]}}function JS(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function zf(t){this.config.enter.autolinkProtocol.call(this,t)}function QS(t){this.config.exit.autolinkProtocol.call(this,t)}function e0(t){this.config.exit.data.call(this,t);let e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function t0(t){this.config.exit.autolinkEmail.call(this,t)}function r0(t){this.exit(t)}function n0(t){Bf(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,i0],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),o0]],{ignore:["link","linkReference"]})}function i0(t,e,r,n,i){let o="";if(!Yg(i)||(/^w/i.test(e)&&(r=e+r,e="",o="http://"),!s0(r)))return!1;let s=a0(r+n);if(!s[0])return!1;let a={type:"link",title:null,url:o+e+s[0],children:[{type:"text",value:e+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function o0(t,e,r,n){return!Yg(n,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+r,children:[{type:"text",value:e+"@"+r}]}}function s0(t){let e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function a0(t){let e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let r=e[0],n=r.indexOf(")"),i=Lf(t,"("),o=Lf(t,")");for(;n!==-1&&i>o;)t+=r.slice(0,n+1),r=r.slice(n+1),n=r.indexOf(")"),o++;return[t,r]}function Yg(t,e){let r=t.input.charCodeAt(t.index-1);return(t.index===0||Dr(r)||wi(r))&&(!e||r!==47)}Zg.peek=g0;function u0(){this.buffer()}function l0(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function c0(){this.buffer()}function f0(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function p0(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=It(this.sliceSerialize(t)).toLowerCase(),r.label=e}function d0(t){this.exit(t)}function h0(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=It(this.sliceSerialize(t)).toLowerCase(),r.label=e}function m0(t){this.exit(t)}function g0(){return"["}function Zg(t,e,r,n){let i=r.createTracker(n),o=i.move("[^"),s=r.enter("footnoteReference"),a=r.enter("reference");return o+=i.move(r.safe(r.associationId(t),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function Vf(){return{enter:{gfmFootnoteCallString:u0,gfmFootnoteCall:l0,gfmFootnoteDefinitionLabelString:c0,gfmFootnoteDefinition:f0},exit:{gfmFootnoteCallString:p0,gfmFootnoteCall:d0,gfmFootnoteDefinitionLabelString:h0,gfmFootnoteDefinition:m0}}}function Gf(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:r,footnoteReference:Zg},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(n,i,o,s){let a=o.createTracker(s),u=a.move("[^"),l=o.enter("footnoteDefinition"),c=o.enter("label");return u+=a.move(o.safe(o.associationId(n),{before:u,after:"]"})),c(),u+=a.move("]:"),n.children&&n.children.length>0&&(a.shift(4),u+=a.move((e?`
105
- `:" ")+o.indentLines(o.containerFlow(n,a.current()),e?Xg:x0))),l(),u}}function x0(t,e,r){return e===0?t:Xg(t,e,r)}function Xg(t,e,r){return(r?"":" ")+t}var y0=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Jg.peek=A0;function Wf(){return{canContainEols:["delete"],enter:{strikethrough:b0},exit:{strikethrough:E0}}}function Hf(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:y0}],handlers:{delete:Jg}}}function b0(t){this.enter({type:"delete",children:[]},t)}function E0(t){this.exit(t)}function Jg(t,e,r,n){let i=r.createTracker(n),o=r.enter("strikethrough"),s=i.move("~~");return s+=r.containerPhrasing(t,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function A0(){return"~"}function C0(t){return t.length}function ex(t,e){let r=e||{},n=(r.align||[]).concat(),i=r.stringLength||C0,o=[],s=[],a=[],u=[],l=0,c=-1;for(;++c<t.length;){let y=[],g=[],b=-1;for(t[c].length>l&&(l=t[c].length);++b<t[c].length;){let w=w0(t[c][b]);if(r.alignDelimiters!==!1){let C=i(w);g[b]=C,(u[b]===void 0||C>u[b])&&(u[b]=C)}y.push(w)}s[c]=y,a[c]=g}let f=-1;if(typeof n=="object"&&"length"in n)for(;++f<l;)o[f]=Qg(n[f]);else{let y=Qg(n);for(;++f<l;)o[f]=y}f=-1;let p=[],d=[];for(;++f<l;){let y=o[f],g="",b="";y===99?(g=":",b=":"):y===108?g=":":y===114&&(b=":");let w=r.alignDelimiters===!1?1:Math.max(1,u[f]-g.length-b.length),C=g+"-".repeat(w)+b;r.alignDelimiters!==!1&&(w=g.length+w+b.length,w>u[f]&&(u[f]=w),d[f]=w),p[f]=C}s.splice(1,0,p),a.splice(1,0,d),c=-1;let m=[];for(;++c<s.length;){let y=s[c],g=a[c];f=-1;let b=[];for(;++f<l;){let w=y[f]||"",C="",D="";if(r.alignDelimiters!==!1){let R=u[f]-(g[f]||0),S=o[f];S===114?C=" ".repeat(R):S===99?R%2?(C=" ".repeat(R/2+.5),D=" ".repeat(R/2-.5)):(C=" ".repeat(R/2),D=C):D=" ".repeat(R)}r.delimiterStart!==!1&&!f&&b.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&w==="")&&(r.delimiterStart!==!1||f)&&b.push(" "),r.alignDelimiters!==!1&&b.push(C),b.push(w),r.alignDelimiters!==!1&&b.push(D),r.padding!==!1&&b.push(" "),(r.delimiterEnd!==!1||f!==l-1)&&b.push("|")}m.push(r.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return m.join(`
106
- `)}function w0(t){return t==null?"":String(t)}function Qg(t){let e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function Yf(){return{enter:{table:k0,tableData:tx,tableHeader:tx,tableRow:_0},exit:{codeText:S0,table:T0,tableData:Kf,tableHeader:Kf,tableRow:Kf}}}function k0(t){let e=t._align;this.enter({type:"table",align:e.map(function(r){return r==="none"?null:r}),children:[]},t),this.data.inTable=!0}function T0(t){this.exit(t),this.data.inTable=void 0}function _0(t){this.enter({type:"tableRow",children:[]},t)}function Kf(t){this.exit(t)}function tx(t){this.enter({type:"tableCell",children:[]},t)}function S0(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,v0));let r=this.stack[this.stack.length-1];r.type,r.value=e,this.exit(t)}function v0(t,e){return e==="|"?e:t}function Zf(t){let e=t||{},r=e.tableCellPadding,n=e.tablePipeAlign,i=e.stringLength,o=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
107
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:s,tableCell:u,tableRow:a}};function s(d,m,y,g){return l(c(d,y,g),d.align)}function a(d,m,y,g){let b=f(d,y,g),w=l([b]);return w.slice(0,w.indexOf(`
108
- `))}function u(d,m,y,g){let b=y.enter("tableCell"),w=y.enter("phrasing"),C=y.containerPhrasing(d,{...g,before:o,after:o});return w(),b(),C}function l(d,m){return ex(d,{align:m,alignDelimiters:n,padding:r,stringLength:i})}function c(d,m,y){let g=d.children,b=-1,w=[],C=m.enter("table");for(;++b<g.length;)w[b]=f(g[b],m,y);return C(),w}function f(d,m,y){let g=d.children,b=-1,w=[],C=m.enter("tableRow");for(;++b<g.length;)w[b]=u(g[b],d,m,y);return C(),w}function p(d,m,y){let g=vi.inlineCode(d,m,y);return y.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function Xf(){return{exit:{taskListCheckValueChecked:rx,taskListCheckValueUnchecked:rx,paragraph:I0}}}function Jf(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:O0}}}function rx(t){let e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function I0(t){let e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){let r=this.stack[this.stack.length-1];r.type;let n=r.children[0];if(n&&n.type==="text"){let i=e.children,o=-1,s;for(;++o<i.length;){let a=i[o];if(a.type==="paragraph"){s=a;break}}s===r&&(n.value=n.value.slice(1),n.value.length===0?r.children.shift():r.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,r.position.start=Object.assign({},n.position.start)))}}this.exit(t)}function O0(t,e,r,n){let i=t.children[0],o=typeof t.checked=="boolean"&&i&&i.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",a=r.createTracker(n);o&&a.move(s);let u=vi.listItem(t,e,r,{...n,...a.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),u;function l(c){return c+s}}function Qf(){return[$f(),Vf(),Wf(),Yf(),Xf()]}function ep(t){return{extensions:[qf(),Gf(t),Hf(),Zf(t),Jf()]}}var D0={tokenize:L0,partial:!0},nx={tokenize:M0,partial:!0},ix={tokenize:B0,partial:!0},ox={tokenize:j0,partial:!0},R0={tokenize:U0,partial:!0},sx={name:"wwwAutolink",tokenize:N0,previous:ux},ax={name:"protocolAutolink",tokenize:P0,previous:lx},nn={name:"emailAutolink",tokenize:F0,previous:cx},Nr={};function rp(){return{text:Nr}}var Oi=48;for(;Oi<123;)Nr[Oi]=nn,Oi++,Oi===58?Oi=65:Oi===91&&(Oi=97);Nr[43]=nn;Nr[45]=nn;Nr[46]=nn;Nr[95]=nn;Nr[72]=[nn,ax];Nr[104]=[nn,ax];Nr[87]=[nn,sx];Nr[119]=[nn,sx];function F0(t,e,r){let n=this,i,o;return s;function s(f){return!tp(f)||!cx.call(n,n.previous)||np(n.events)?r(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),a(f))}function a(f){return tp(f)?(t.consume(f),a):f===64?(t.consume(f),u):r(f)}function u(f){return f===46?t.check(R0,c,l)(f):f===45||f===95||yt(f)?(o=!0,t.consume(f),u):c(f)}function l(f){return t.consume(f),i=!0,u}function c(f){return o&&i&&xt(n.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):r(f)}}function N0(t,e,r){let n=this;return i;function i(s){return s!==87&&s!==119||!ux.call(n,n.previous)||np(n.events)?r(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(D0,t.attempt(nx,t.attempt(ix,o),r),r)(s))}function o(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function P0(t,e,r){let n=this,i="",o=!1;return s;function s(f){return(f===72||f===104)&&lx.call(n,n.previous)&&!np(n.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),t.consume(f),a):r(f)}function a(f){if(xt(f)&&i.length<5)return i+=String.fromCodePoint(f),t.consume(f),a;if(f===58){let p=i.toLowerCase();if(p==="http"||p==="https")return t.consume(f),u}return r(f)}function u(f){return f===47?(t.consume(f),o?l:(o=!0,u)):r(f)}function l(f){return f===null||Ci(f)||ke(f)||Dr(f)||wi(f)?r(f):t.attempt(nx,t.attempt(ix,c),r)(f)}function c(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function L0(t,e,r){let n=0;return i;function i(s){return(s===87||s===119)&&n<3?(n++,t.consume(s),i):s===46&&n===3?(t.consume(s),o):r(s)}function o(s){return s===null?r(s):e(s)}}function M0(t,e,r){let n,i,o;return s;function s(l){return l===46||l===95?t.check(ox,u,a)(l):l===null||ke(l)||Dr(l)||l!==45&&wi(l)?u(l):(o=!0,t.consume(l),s)}function a(l){return l===95?n=!0:(i=n,n=void 0),t.consume(l),s}function u(l){return i||n||!o?r(l):e(l)}}function B0(t,e){let r=0,n=0;return i;function i(s){return s===40?(r++,t.consume(s),i):s===41&&n<r?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check(ox,e,o)(s):s===null||ke(s)||Dr(s)?e(s):(t.consume(s),i)}function o(s){return s===41&&n++,t.consume(s),i}}function j0(t,e,r){return n;function n(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(t.consume(a),n):a===38?(t.consume(a),o):a===93?(t.consume(a),i):a===60||a===null||ke(a)||Dr(a)?e(a):r(a)}function i(a){return a===null||a===40||a===91||ke(a)||Dr(a)?e(a):n(a)}function o(a){return xt(a)?s(a):r(a)}function s(a){return a===59?(t.consume(a),n):xt(a)?(t.consume(a),s):r(a)}}function U0(t,e,r){return n;function n(o){return t.consume(o),i}function i(o){return yt(o)?r(o):e(o)}}function ux(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||ke(t)}function lx(t){return!xt(t)}function cx(t){return!(t===47||tp(t))}function tp(t){return t===43||t===45||t===46||t===95||yt(t)}function np(t){let e=t.length,r=!1;for(;e--;){let n=t[e][1];if((n.type==="labelLink"||n.type==="labelImage")&&!n._balanced){r=!0;break}if(n._gfmAutolinkLiteralWalkedInto){r=!1;break}}return t.length>0&&!r&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}var z0={tokenize:K0,partial:!0};function ip(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:G0,continuation:{tokenize:W0},exit:H0}},text:{91:{name:"gfmFootnoteCall",tokenize:V0},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:$0,resolveTo:q0}}}}function $0(t,e,r){let n=this,i=n.events.length,o=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),s;for(;i--;){let u=n.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!s||!s._balanced)return r(u);let l=It(n.sliceSerialize({start:s.end,end:n.now()}));return l.codePointAt(0)!==94||!o.includes(l.slice(1))?r(u):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),e(u))}}function q0(t,e){let r=t.length,n;for(;r--;)if(t[r][1].type==="labelImage"&&t[r][0]==="enter"){n=t[r][1];break}t[r+1][1].type="data",t[r+3][1].type="gfmFootnoteCallLabelMarker";let i={type:"gfmFootnoteCall",start:Object.assign({},t[r+3][1].start),end:Object.assign({},t[t.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},t[r+3][1].end),end:Object.assign({},t[r+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;let s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},u=[t[r+1],t[r+2],["enter",i,e],t[r+3],t[r+4],["enter",o,e],["exit",o,e],["enter",s,e],["enter",a,e],["exit",a,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",i,e]];return t.splice(r,t.length-r+1,...u),t}function V0(t,e,r){let n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o=0,s;return a;function a(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),u}function u(f){return f!==94?r(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(f){if(o>999||f===93&&!s||f===null||f===91||ke(f))return r(f);if(f===93){t.exit("chunkString");let p=t.exit("gfmFootnoteCallString");return i.includes(It(n.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):r(f)}return ke(f)||(s=!0),o++,t.consume(f),f===92?c:l}function c(f){return f===91||f===92||f===93?(t.consume(f),o++,l):l(f)}}function G0(t,e,r){let n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o,s=0,a;return u;function u(m){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(m){return m===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",c):r(m)}function c(m){if(s>999||m===93&&!a||m===null||m===91||ke(m))return r(m);if(m===93){t.exit("chunkString");let y=t.exit("gfmFootnoteDefinitionLabelString");return o=It(n.sliceSerialize(y)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return ke(m)||(a=!0),s++,t.consume(m),m===92?f:c}function f(m){return m===91||m===92||m===93?(t.consume(m),s++,c):c(m)}function p(m){return m===58?(t.enter("definitionMarker"),t.consume(m),t.exit("definitionMarker"),i.includes(o)||i.push(o),ie(t,d,"gfmFootnoteDefinitionWhitespace")):r(m)}function d(m){return e(m)}}function W0(t,e,r){return t.check(Rr,e,t.attempt(z0,e,r))}function H0(t){t.exit("gfmFootnoteDefinition")}function K0(t,e,r){let n=this;return ie(t,i,"gfmFootnoteDefinitionIndent",5);function i(o){let s=n.events[n.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(o):r(o)}}function op(t){let r=(t||{}).singleTilde,n={name:"strikethrough",tokenize:o,resolveAll:i};return r==null&&(r=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function i(s,a){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let l=u;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[u][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[u][1].end)},f={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[u][1].start)},p=[["enter",c,a],["enter",s[l][1],a],["exit",s[l][1],a],["enter",f,a]],d=a.parser.constructs.insideSpan.null;d&&st(p,p.length,0,wn(d,s.slice(l+1,u),a)),st(p,p.length,0,[["exit",f,a],["enter",s[u][1],a],["exit",s[u][1],a],["exit",c,a]]),st(s,l-1,u-l+3,p),u=l+p.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function o(s,a,u){let l=this.previous,c=this.events,f=0;return p;function p(m){return l===126&&c[c.length-1][1].type!=="characterEscape"?u(m):(s.enter("strikethroughSequenceTemporary"),d(m))}function d(m){let y=rn(l);if(m===126)return f>1?u(m):(s.consume(m),f++,d);if(f<2&&!r)return u(m);let g=s.exit("strikethroughSequenceTemporary"),b=rn(m);return g._open=!b||b===2&&!!y,g._close=!y||y===2&&!!b,a(m)}}}var fu=class{constructor(){this.map=[]}add(e,r,n){Y0(this,e,r,n)}consume(e){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let r=this.map.length,n=[];for(;r>0;)r-=1,n.push(e.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),e.length=this.map[r][0];n.push(e.slice()),e.length=0;let i=n.pop();for(;i;){for(let o of i)e.push(o);i=n.pop()}this.map.length=0}};function Y0(t,e,r,n){let i=0;if(!(r===0&&n.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=r,t.map[i][2].push(...n);return}i+=1}t.map.push([e,r,n])}}function fx(t,e){let r=!1,n=[];for(;e<t.length;){let i=t[e];if(r){if(i[0]==="enter")i[1].type==="tableContent"&&n.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){let o=n.length-1;n[o]=n[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(r=!0);e+=1}return n}function sp(){return{flow:{null:{name:"table",tokenize:Z0,resolveAll:X0}}}}function Z0(t,e,r){let n=this,i=0,o=0,s;return a;function a(_){let L=n.events.length-1;for(;L>-1;){let P=n.events[L][1].type;if(P==="lineEnding"||P==="linePrefix")L--;else break}let F=L>-1?n.events[L][1].type:null,v=F==="tableHead"||F==="tableRow"?S:u;return v===S&&n.parser.lazy[n.now().line]?r(_):v(_)}function u(_){return t.enter("tableHead"),t.enter("tableRow"),l(_)}function l(_){return _===124||(s=!0,o+=1),c(_)}function c(_){return _===null?r(_):z(_)?o>1?(o=0,n.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),d):r(_):se(_)?ie(t,c,"whitespace")(_):(o+=1,s&&(s=!1,i+=1),_===124?(t.enter("tableCellDivider"),t.consume(_),t.exit("tableCellDivider"),s=!0,c):(t.enter("data"),f(_)))}function f(_){return _===null||_===124||ke(_)?(t.exit("data"),c(_)):(t.consume(_),_===92?p:f)}function p(_){return _===92||_===124?(t.consume(_),f):f(_)}function d(_){return n.interrupt=!1,n.parser.lazy[n.now().line]?r(_):(t.enter("tableDelimiterRow"),s=!1,se(_)?ie(t,m,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):m(_))}function m(_){return _===45||_===58?g(_):_===124?(s=!0,t.enter("tableCellDivider"),t.consume(_),t.exit("tableCellDivider"),y):R(_)}function y(_){return se(_)?ie(t,g,"whitespace")(_):g(_)}function g(_){return _===58?(o+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(_),t.exit("tableDelimiterMarker"),b):_===45?(o+=1,b(_)):_===null||z(_)?D(_):R(_)}function b(_){return _===45?(t.enter("tableDelimiterFiller"),w(_)):R(_)}function w(_){return _===45?(t.consume(_),w):_===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(_),t.exit("tableDelimiterMarker"),C):(t.exit("tableDelimiterFiller"),C(_))}function C(_){return se(_)?ie(t,D,"whitespace")(_):D(_)}function D(_){return _===124?m(_):_===null||z(_)?!s||i!==o?R(_):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(_)):R(_)}function R(_){return r(_)}function S(_){return t.enter("tableRow"),de(_)}function de(_){return _===124?(t.enter("tableCellDivider"),t.consume(_),t.exit("tableCellDivider"),de):_===null||z(_)?(t.exit("tableRow"),e(_)):se(_)?ie(t,de,"whitespace")(_):(t.enter("data"),ye(_))}function ye(_){return _===null||_===124||ke(_)?(t.exit("data"),de(_)):(t.consume(_),_===92?be:ye)}function be(_){return _===92||_===124?(t.consume(_),ye):ye(_)}}function X0(t,e){let r=-1,n=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,u=0,l,c,f,p=new fu;for(;++r<t.length;){let d=t[r],m=d[1];d[0]==="enter"?m.type==="tableHead"?(a=!1,u!==0&&(px(p,e,u,l,c),c=void 0,u=0),l={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(r,0,[["enter",l,e]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(n=!0,f=void 0,o=[0,0,0,0],s=[0,r+1,0,0],a&&(a=!1,c={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(r,0,[["enter",c,e]])),i=m.type==="tableDelimiterRow"?2:c?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(n=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],f=pu(p,e,o,i,void 0,f),o=[0,0,0,0]),s[2]=r)):m.type==="tableCellDivider"&&(n?n=!1:(o[1]!==0&&(s[0]=s[1],f=pu(p,e,o,i,void 0,f)),o=s,s=[o[1],r,0,0])):m.type==="tableHead"?(a=!0,u=r):m.type==="tableRow"||m.type==="tableDelimiterRow"?(u=r,o[1]!==0?(s[0]=s[1],f=pu(p,e,o,i,r,f)):s[1]!==0&&(f=pu(p,e,s,i,r,f)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(s[3]=r)}for(u!==0&&px(p,e,u,l,c),p.consume(e.events),r=-1;++r<e.events.length;){let d=e.events[r];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=fx(e.events,r))}return t}function pu(t,e,r,n,i,o){let s=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",a="tableContent";r[0]!==0&&(o.end=Object.assign({},go(e.events,r[0])),t.add(r[0],0,[["exit",o,e]]));let u=go(e.events,r[1]);if(o={type:s,start:Object.assign({},u),end:Object.assign({},u)},t.add(r[1],0,[["enter",o,e]]),r[2]!==0){let l=go(e.events,r[2]),c=go(e.events,r[3]),f={type:a,start:Object.assign({},l),end:Object.assign({},c)};if(t.add(r[2],0,[["enter",f,e]]),n!==2){let p=e.events[r[2]],d=e.events[r[3]];if(p[1].end=Object.assign({},d[1].end),p[1].type="chunkText",p[1].contentType="text",r[3]>r[2]+1){let m=r[2]+1,y=r[3]-r[2]-1;t.add(m,y,[])}}t.add(r[3]+1,0,[["exit",f,e]])}return i!==void 0&&(o.end=Object.assign({},go(e.events,i)),t.add(i,0,[["exit",o,e]]),o=void 0),o}function px(t,e,r,n,i){let o=[],s=go(e.events,r);i&&(i.end=Object.assign({},s),o.push(["exit",i,e])),n.end=Object.assign({},s),o.push(["exit",n,e]),t.add(r+1,0,o)}function go(t,e){let r=t[e],n=r[0]==="enter"?"start":"end";return r[1][n]}var J0={name:"tasklistCheck",tokenize:Q0};function ap(){return{text:{91:J0}}}function Q0(t,e,r){let n=this;return i;function i(u){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?r(u):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),o)}function o(u){return ke(u)?(t.enter("taskListCheckValueUnchecked"),t.consume(u),t.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(t.enter("taskListCheckValueChecked"),t.consume(u),t.exit("taskListCheckValueChecked"),s):r(u)}function s(u){return u===93?(t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),a):r(u)}function a(u){return z(u)?e(u):se(u)?t.check({tokenize:ev},e,r)(u):r(u)}}function ev(t,e,r){return ie(t,n,"whitespace");function n(i){return i===null?r(i):e(i)}}function dx(t){return za([rp(),ip(),op(t),sp(),ap()])}var tv={};function Tn(t){let e=this,r=t||tv,n=e.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(dx(r)),o.push(Qf()),s.push(ep(r))}import{mdatCheck as rv,mdatClean as hx,mdatExpand as nv,mdatSplit as mx}from"remark-mdat";import{VFile as B5}from"vfile";async function _n(t,e,r,n,i,o,s){let a=await e({additionalConfig:o,additionalRules:s});o=a;let u=await Tm(),l=ja(t),c=km(l,i,n,"md"),f=[],p=r(a,u);for(let{input:d,name:m,output:y}of c){let g=await ac(d),b=await p.process(g);b.dirname=y,b.basename=m,f.push(b)}return f}function du(t,e){return mo().use({settings:{bullet:"-",emphasis:"_"}}).use(Tn).use(e).use(()=>async function(n,i){mx(n,i),hx(n,i,t),await nv(n,i,t)})}function hu(t,e){return mo().use({settings:{bullet:"-",emphasis:"_"}}).use(Tn).use(e).use(()=>function(n,i){mx(n,i),hx(n,i,t)})}function mu(t,e){return mo().use({settings:{bullet:"-",emphasis:"_"}}).use(Tn).use(e).use(()=>async function(n,i){await rv(n,i,{...t,paranoid:!1})})}async function gx(t,e,r,n,i){return _n(t,Ai,du,e,r,n,i)}async function xx(t,e,r,n,i){return _n(t,Ai,mu,e,r,n,i)}async function yx(t,e,r,n,i){return _n(t,Ai,hu,e,r,n,i)}var gu={badges:{async content(t){let e=X.object({custom:X.record(X.object({image:X.string(),link:X.string()})).optional(),npm:X.array(X.string()).optional()}).optional().parse(t),r=await rr(),{name:n}=r,i=[];if(!r.private&&r.publishConfig?.access==="public"&&i.push(`[![NPM Package ${n}](https://img.shields.io/npm/v/${n}.svg)](https://npmjs.com/package/${n})`),e?.npm!==void 0)for(let s of e.npm)i.push(`[![NPM Package ${s}](https://img.shields.io/npm/v/${s}.svg)](https://npmjs.com/package/${s})`);let{license:o}=r;if(o!==void 0&&i.push(`[![License: ${o}](https://img.shields.io/badge/License-${o}-yellow.svg)](https://opensource.org/licenses/${o})`),e?.custom!==void 0)for(let[s,{image:a,link:u}]of Object.entries(e.custom))i.push(`[![${s}](${a})](${u})`);return i.join(`
109
- `)},order:3}};import{globby as ov}from"globby";import xu from"node:path";import{readPackage as sv}from"read-pkg";var yu={banner:{async content(t){let e=X.object({alt:X.string().optional(),src:X.string().optional()}).optional().parse(t),{assetsPath:r,packageFile:n}=await Or();if(n===void 0)throw new Error("No package.json found");let i=e?.src??await bx(r)??await bx();if(i===void 0)throw new Error("Banner image not found at any typical location, consider adding something at ./assets/banner.webp");if(!Ex(i)&&!await uo(i))throw new Error(`Banner image not found at "${i}"`);let o=e?.alt??`${(await sv({cwd:xu.dirname(n)})).name} banner`;if(o===void 0||o==="undefined banner")throw new Error("Banner image alt text not available");return`![${o}](${i})`},order:2}};async function bx(t){let{packageFile:e}=await Or();if(e===void 0)throw new Error("No package.json found");let r=xu.dirname(e),n=t===void 0?[".","assets","media","readme-assets","readme-media","readme","images",".github/assets"]:[t],i=["banner","cover","demo","header","hero","image","logo","overview","readme","screenshot","screenshots","splash"],o=["png","gif","jpg","jpeg","svg","webp"],s=await ov(n.map(a=>xu.join(r,a)),{deep:1,expandDirectories:{extensions:o,files:i}});if(s.length>0)return xu.relative(process.cwd(),s[0])}function Ex(t,e=!0){if(typeof t!="string")throw new TypeError("Expected a string");if(t=t.trim(),t.includes(" "))return!1;try{return new URL(t),!0}catch{return e?Ex(`https://${t}`,!1):!1}}import{getSoleRule as gL}from"remark-mdat";import{execaCommand as tL}from"execa";import{log as jA}from"remark-mdat";function Ax(t,e=Number.MAX_SAFE_INTEGER){let r=[],n=av(t,e);return r.push(uv(n)),r.push(lv(t,n)),n.hasMultipleSubcommands&&n.canRecurse&&r.push(cv(n.fullCommandName)),n.defaultCommand?.commandName!==void 0&&r.push(fv(n)),r.push(pv(t,n)),t.positionals&&!n.commandsOnly&&r.push(up(["Positional Argument","Description","Type","Default"],t.positionals.map(i=>[i.arguments?[i.arguments.map(o=>`\`${o}\``)].join(" "):"",`${i.description??""}${i.required===void 0?"":i.required?" _(Required.)_":" _(Optional.)_"}`,i.type?`\`${i.type}\``:"",i.defaultValue?i.defaultValue.includes(" ")?i.defaultValue:`\`${i.defaultValue}\``:""]))),t.commands&&r.push(up(["Command","Argument","Description"],t.commands.map(i=>[`\`${i.commandName??(i.default?"[default]":"")}\``,i.arguments?i.arguments.map(o=>`\`${o}\``).join(" "):"",`${i.description??""}${i.default?" _(Default command.)_":""}`]))),t.options&&!n.commandsOnly&&r.push(up(["Option","Argument","Description","Type","Default"],t.options.map(i=>[i.flags!==void 0||i.aliases!==void 0?[...i.flags??[],...i.aliases??[]].map(o=>`\`${o}\``).join("<br>"):"",i.arguments?i.arguments.map(o=>`\`${o}\``).join(" "):"",i.description??"",i.choices?i.choices.map(o=>`\`${o}\``).join(" "):i.type?`\`${i.type}\``:"",i.defaultValue?i.defaultValue.includes(" ")&&i.choices===void 0?i.defaultValue:`\`${i.defaultValue}\``:""]))),n.canRecurse&&n.hasMultipleSubcommands&&r.push("_See the sections below for more information on each subcommand._"),r.join(`
100
+ `),i;function o(s){return n.stack.push(s),a;function a(){n.stack.pop()}}}function cS(t){throw new Error("Cannot handle value `"+t+"`, expected node")}function fS(t){let e=t;throw new Error("Cannot handle unknown node `"+e.type+"`")}function pS(t,e){if(t.type==="definition"&&t.type===e.type)return 0}function dS(t,e){return dg(t,this,e)}function hS(t,e){return hg(t,this,e)}function mS(t,e){return xg(this,t,e)}function iu(t){let e=this;e.compiler=r;function r(n){return Af(n,{...e.data("settings"),...t,extensions:e.data("toMarkdownExtensions")||[]})}}function wf(t){if(t)throw t}var au=ts(Sg(),1);function As(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Cf(){let t=[],e={run:r,use:n};return e;function r(...i){let o=-1,s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(u,...l){let c=t[++o],f=-1;if(u){s(u);return}for(;++f<i.length;)(l[f]===null||l[f]===void 0)&&(l[f]=i[f]);i=l,c?vg(c,a)(...l):s(null,...l)}}function n(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function vg(t,e){let r;return n;function n(...s){let a=t.length>s.length,u;a&&s.push(i);try{u=t.apply(this,s)}catch(l){let c=l;if(a&&r)throw c;return i(c)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(s,...a){r||(r=!0,e(s,...a))}function o(s){i(null,s)}}import{VFile as gS}from"vfile";var Ig=function(t){let n=this.constructor.prototype,i=n[t],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,n),o};var xS={}.hasOwnProperty,Sf=class t extends Ig{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=Cf()}copy(){let e=new t,r=-1;for(;++r<this.attachers.length;){let n=this.attachers[r];e.use(...n)}return e.data((0,au.default)(!0,{},this.namespace)),e}data(e,r){return typeof e=="string"?arguments.length===2?(_f("data",this.frozen),this.namespace[e]=r,this):xS.call(this.namespace,e)&&this.namespace[e]||void 0:e?(_f("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[r,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let i=r.call(e,...n);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();let r=su(e),n=this.parser||this.Parser;return kf("parse",n),n(String(r),r)}process(e,r){let n=this;return this.freeze(),kf("process",this.parser||this.Parser),Tf("process",this.compiler||this.Compiler),r?i(void 0,r):new Promise(i);function i(o,s){let a=su(e),u=n.parse(a);n.run(u,a,function(c,f,p){if(c||!f||!p)return l(c);let d=f,m=n.stringify(d,p);bS(m)?p.value=m:p.result=m,l(c,p)});function l(c,f){c||!f?s(c):o?o(f):r(void 0,f)}}}processSync(e){let r=!1,n;return this.freeze(),kf("processSync",this.parser||this.Parser),Tf("processSync",this.compiler||this.Compiler),this.process(e,i),Dg("processSync","process",r),n;function i(o,s){r=!0,wf(o),n=s}}run(e,r,n){Og(e),this.freeze();let i=this.transformers;return!n&&typeof r=="function"&&(n=r,r=void 0),n?o(void 0,n):new Promise(o);function o(s,a){let u=su(r);i.run(e,u,l);function l(c,f,p){let d=f||e;c?a(c):s?s(d):n(void 0,d,p)}}}runSync(e,r){let n=!1,i;return this.run(e,r,o),Dg("runSync","run",n),i;function o(s,a){wf(s),i=a,n=!0}}stringify(e,r){this.freeze();let n=su(r),i=this.compiler||this.Compiler;return Tf("stringify",i),Og(e),i(e,n)}use(e,...r){let n=this.attachers,i=this.namespace;if(_f("use",this.frozen),e!=null)if(typeof e=="function")u(e,r);else if(typeof e=="object")Array.isArray(e)?a(e):s(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function o(l){if(typeof l=="function")u(l,[]);else if(typeof l=="object")if(Array.isArray(l)){let[c,...f]=l;u(c,f)}else s(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function s(l){if(!("plugins"in l)&&!("settings"in l))throw new 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");a(l.plugins),l.settings&&(i.settings=(0,au.default)(!0,i.settings,l.settings))}function a(l){let c=-1;if(l!=null)if(Array.isArray(l))for(;++c<l.length;){let f=l[c];o(f)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function u(l,c){let f=-1,p=-1;for(;++f<n.length;)if(n[f][0]===l){p=f;break}if(p===-1)n.push([l,...c]);else if(c.length>0){let[d,...m]=c,y=n[p][1];As(y)&&As(d)&&(d=(0,au.default)(!0,y,d)),n[p]=[l,d,...m]}}}},vf=new Sf().freeze();function kf(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Tf(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function _f(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Og(t){if(!As(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Dg(t,e,r){if(!r)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function su(t){return yS(t)?t:new gS(t)}function yS(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function bS(t){return typeof t=="string"||ES(t)}function ES(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}var uo=vf().use(Xa).use(iu).freeze();function If(t,e){let r=String(t);if(typeof e!="string")throw new TypeError("Expected character");let n=0,i=r.indexOf(e);for(;i!==-1;)n++,i=r.indexOf(e,i+e.length);return n}function Of(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Df(t,e,r){let i=vr((r||{}).ignore||[]),o=AS(e),s=-1;for(;++s<o.length;)bs(t,"text",a);function a(l,c){let f=-1,p;for(;++f<c.length;){let d=c[f],m=p?p.children:void 0;if(i(d,m?m.indexOf(d):void 0,p))return;p=d}if(p)return u(l,c)}function u(l,c){let f=c[c.length-1],p=o[s][0],d=o[s][1],m=0,g=f.children.indexOf(l),b=!1,C=[];p.lastIndex=0;let w=p.exec(l.value);for(;w;){let D=w.index,R={index:w.index,input:w.input,stack:[...c,l]},S=d(...w,R);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?p.lastIndex=D+1:(m!==D&&C.push({type:"text",value:l.value.slice(m,D)}),Array.isArray(S)?C.push(...S):S&&C.push(S),m=D+w[0].length,b=!0),!p.global)break;w=p.exec(l.value)}return b?(m<l.value.length&&C.push({type:"text",value:l.value.slice(m)}),f.children.splice(g,1,...C)):C=[l],g+C.length}}function AS(t){let e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");let r=!t[0]||Array.isArray(t[0])?t:[t],n=-1;for(;++n<r.length;){let i=r[n];e.push([wS(i[0]),CS(i[1])])}return e}function wS(t){return typeof t=="string"?new RegExp(Of(t),"g"):t}function CS(t){return typeof t=="function"?t:function(){return t}}var Rf="phrasing",Ff=["autolink","link","image","label"];function Pf(){return{transforms:[IS],enter:{literalAutolink:kS,literalAutolinkEmail:Nf,literalAutolinkHttp:Nf,literalAutolinkWww:Nf},exit:{literalAutolink:vS,literalAutolinkEmail:SS,literalAutolinkHttp:TS,literalAutolinkWww:_S}}}function Lf(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Rf,notInConstruct:Ff},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Rf,notInConstruct:Ff},{character:":",before:"[ps]",after:"\\/",inConstruct:Rf,notInConstruct:Ff}]}}function kS(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Nf(t){this.config.enter.autolinkProtocol.call(this,t)}function TS(t){this.config.exit.autolinkProtocol.call(this,t)}function _S(t){this.config.exit.data.call(this,t);let e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function SS(t){this.config.exit.autolinkEmail.call(this,t)}function vS(t){this.exit(t)}function IS(t){Df(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,OS],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),DS]],{ignore:["link","linkReference"]})}function OS(t,e,r,n,i){let o="";if(!Rg(i)||(/^w/i.test(e)&&(r=e+r,e="",o="http://"),!RS(r)))return!1;let s=FS(r+n);if(!s[0])return!1;let a={type:"link",title:null,url:o+e+s[0],children:[{type:"text",value:e+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function DS(t,e,r,n){return!Rg(n,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+r,children:[{type:"text",value:e+"@"+r}]}}function RS(t){let e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function FS(t){let e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let r=e[0],n=r.indexOf(")"),i=If(t,"("),o=If(t,")");for(;n!==-1&&i>o;)t+=r.slice(0,n+1),r=r.slice(n+1),n=r.indexOf(")"),o++;return[t,r]}function Rg(t,e){let r=t.input.charCodeAt(t.index-1);return(t.index===0||_r(r)||bi(r))&&(!e||r!==47)}Fg.peek=$S;function NS(){this.buffer()}function PS(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function LS(){this.buffer()}function MS(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function BS(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=_t(this.sliceSerialize(t)).toLowerCase(),r.label=e}function jS(t){this.exit(t)}function US(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=_t(this.sliceSerialize(t)).toLowerCase(),r.label=e}function zS(t){this.exit(t)}function $S(){return"["}function Fg(t,e,r,n){let i=r.createTracker(n),o=i.move("[^"),s=r.enter("footnoteReference"),a=r.enter("reference");return o+=i.move(r.safe(r.associationId(t),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function Mf(){return{enter:{gfmFootnoteCallString:NS,gfmFootnoteCall:PS,gfmFootnoteDefinitionLabelString:LS,gfmFootnoteDefinition:MS},exit:{gfmFootnoteCallString:BS,gfmFootnoteCall:jS,gfmFootnoteDefinitionLabelString:US,gfmFootnoteDefinition:zS}}}function Bf(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:r,footnoteReference:Fg},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(n,i,o,s){let a=o.createTracker(s),u=a.move("[^"),l=o.enter("footnoteDefinition"),c=o.enter("label");return u+=a.move(o.safe(o.associationId(n),{before:u,after:"]"})),c(),u+=a.move("]:"),n.children&&n.children.length>0&&(a.shift(4),u+=a.move((e?`
101
+ `:" ")+o.indentLines(o.containerFlow(n,a.current()),e?Ng:qS))),l(),u}}function qS(t,e,r){return e===0?t:Ng(t,e,r)}function Ng(t,e,r){return(r?"":" ")+t}var VS=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Pg.peek=HS;function jf(){return{canContainEols:["delete"],enter:{strikethrough:GS},exit:{strikethrough:WS}}}function Uf(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:VS}],handlers:{delete:Pg}}}function GS(t){this.enter({type:"delete",children:[]},t)}function WS(t){this.exit(t)}function Pg(t,e,r,n){let i=r.createTracker(n),o=r.enter("strikethrough"),s=i.move("~~");return s+=r.containerPhrasing(t,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function HS(){return"~"}function KS(t){return t.length}function Mg(t,e){let r=e||{},n=(r.align||[]).concat(),i=r.stringLength||KS,o=[],s=[],a=[],u=[],l=0,c=-1;for(;++c<t.length;){let y=[],g=[],b=-1;for(t[c].length>l&&(l=t[c].length);++b<t[c].length;){let C=YS(t[c][b]);if(r.alignDelimiters!==!1){let w=i(C);g[b]=w,(u[b]===void 0||w>u[b])&&(u[b]=w)}y.push(C)}s[c]=y,a[c]=g}let f=-1;if(typeof n=="object"&&"length"in n)for(;++f<l;)o[f]=Lg(n[f]);else{let y=Lg(n);for(;++f<l;)o[f]=y}f=-1;let p=[],d=[];for(;++f<l;){let y=o[f],g="",b="";y===99?(g=":",b=":"):y===108?g=":":y===114&&(b=":");let C=r.alignDelimiters===!1?1:Math.max(1,u[f]-g.length-b.length),w=g+"-".repeat(C)+b;r.alignDelimiters!==!1&&(C=g.length+C+b.length,C>u[f]&&(u[f]=C),d[f]=C),p[f]=w}s.splice(1,0,p),a.splice(1,0,d),c=-1;let m=[];for(;++c<s.length;){let y=s[c],g=a[c];f=-1;let b=[];for(;++f<l;){let C=y[f]||"",w="",D="";if(r.alignDelimiters!==!1){let R=u[f]-(g[f]||0),S=o[f];S===114?w=" ".repeat(R):S===99?R%2?(w=" ".repeat(R/2+.5),D=" ".repeat(R/2-.5)):(w=" ".repeat(R/2),D=w):D=" ".repeat(R)}r.delimiterStart!==!1&&!f&&b.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&C==="")&&(r.delimiterStart!==!1||f)&&b.push(" "),r.alignDelimiters!==!1&&b.push(w),b.push(C),r.alignDelimiters!==!1&&b.push(D),r.padding!==!1&&b.push(" "),(r.delimiterEnd!==!1||f!==l-1)&&b.push("|")}m.push(r.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return m.join(`
102
+ `)}function YS(t){return t==null?"":String(t)}function Lg(t){let e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function $f(){return{enter:{table:ZS,tableData:Bg,tableHeader:Bg,tableRow:JS},exit:{codeText:QS,table:XS,tableData:zf,tableHeader:zf,tableRow:zf}}}function ZS(t){let e=t._align;this.enter({type:"table",align:e.map(function(r){return r==="none"?null:r}),children:[]},t),this.data.inTable=!0}function XS(t){this.exit(t),this.data.inTable=void 0}function JS(t){this.enter({type:"tableRow",children:[]},t)}function zf(t){this.exit(t)}function Bg(t){this.enter({type:"tableCell",children:[]},t)}function QS(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,ev));let r=this.stack[this.stack.length-1];r.type,r.value=e,this.exit(t)}function ev(t,e){return e==="|"?e:t}function qf(t){let e=t||{},r=e.tableCellPadding,n=e.tablePipeAlign,i=e.stringLength,o=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
103
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:s,tableCell:u,tableRow:a}};function s(d,m,y,g){return l(c(d,y,g),d.align)}function a(d,m,y,g){let b=f(d,y,g),C=l([b]);return C.slice(0,C.indexOf(`
104
+ `))}function u(d,m,y,g){let b=y.enter("tableCell"),C=y.enter("phrasing"),w=y.containerPhrasing(d,{...g,before:o,after:o});return C(),b(),w}function l(d,m){return Mg(d,{align:m,alignDelimiters:n,padding:r,stringLength:i})}function c(d,m,y){let g=d.children,b=-1,C=[],w=m.enter("table");for(;++b<g.length;)C[b]=f(g[b],m,y);return w(),C}function f(d,m,y){let g=d.children,b=-1,C=[],w=m.enter("tableRow");for(;++b<g.length;)C[b]=u(g[b],d,m,y);return w(),C}function p(d,m,y){let g=ki.inlineCode(d,m,y);return y.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function Vf(){return{exit:{taskListCheckValueChecked:jg,taskListCheckValueUnchecked:jg,paragraph:tv}}}function Gf(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:rv}}}function jg(t){let e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function tv(t){let e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){let r=this.stack[this.stack.length-1];r.type;let n=r.children[0];if(n&&n.type==="text"){let i=e.children,o=-1,s;for(;++o<i.length;){let a=i[o];if(a.type==="paragraph"){s=a;break}}s===r&&(n.value=n.value.slice(1),n.value.length===0?r.children.shift():r.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,r.position.start=Object.assign({},n.position.start)))}}this.exit(t)}function rv(t,e,r,n){let i=t.children[0],o=typeof t.checked=="boolean"&&i&&i.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",a=r.createTracker(n);o&&a.move(s);let u=ki.listItem(t,e,r,{...n,...a.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),u;function l(c){return c+s}}function Wf(){return[Pf(),Mf(),jf(),$f(),Vf()]}function Hf(t){return{extensions:[Lf(),Bf(t),Uf(),qf(t),Gf()]}}var nv={tokenize:uv,partial:!0},Ug={tokenize:lv,partial:!0},zg={tokenize:cv,partial:!0},$g={tokenize:fv,partial:!0},iv={tokenize:pv,partial:!0},qg={name:"wwwAutolink",tokenize:sv,previous:Gg},Vg={name:"protocolAutolink",tokenize:av,previous:Wg},Qr={name:"emailAutolink",tokenize:ov,previous:Hg},Ir={};function Yf(){return{text:Ir}}var _i=48;for(;_i<123;)Ir[_i]=Qr,_i++,_i===58?_i=65:_i===91&&(_i=97);Ir[43]=Qr;Ir[45]=Qr;Ir[46]=Qr;Ir[95]=Qr;Ir[72]=[Qr,Vg];Ir[104]=[Qr,Vg];Ir[87]=[Qr,qg];Ir[119]=[Qr,qg];function ov(t,e,r){let n=this,i,o;return s;function s(f){return!Kf(f)||!Hg.call(n,n.previous)||Zf(n.events)?r(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),a(f))}function a(f){return Kf(f)?(t.consume(f),a):f===64?(t.consume(f),u):r(f)}function u(f){return f===46?t.check(iv,c,l)(f):f===45||f===95||gt(f)?(o=!0,t.consume(f),u):c(f)}function l(f){return t.consume(f),i=!0,u}function c(f){return o&&i&&mt(n.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):r(f)}}function sv(t,e,r){let n=this;return i;function i(s){return s!==87&&s!==119||!Gg.call(n,n.previous)||Zf(n.events)?r(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(nv,t.attempt(Ug,t.attempt(zg,o),r),r)(s))}function o(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function av(t,e,r){let n=this,i="",o=!1;return s;function s(f){return(f===72||f===104)&&Wg.call(n,n.previous)&&!Zf(n.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),t.consume(f),a):r(f)}function a(f){if(mt(f)&&i.length<5)return i+=String.fromCodePoint(f),t.consume(f),a;if(f===58){let p=i.toLowerCase();if(p==="http"||p==="https")return t.consume(f),u}return r(f)}function u(f){return f===47?(t.consume(f),o?l:(o=!0,u)):r(f)}function l(f){return f===null||yi(f)||ke(f)||_r(f)||bi(f)?r(f):t.attempt(Ug,t.attempt(zg,c),r)(f)}function c(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function uv(t,e,r){let n=0;return i;function i(s){return(s===87||s===119)&&n<3?(n++,t.consume(s),i):s===46&&n===3?(t.consume(s),o):r(s)}function o(s){return s===null?r(s):e(s)}}function lv(t,e,r){let n,i,o;return s;function s(l){return l===46||l===95?t.check($g,u,a)(l):l===null||ke(l)||_r(l)||l!==45&&bi(l)?u(l):(o=!0,t.consume(l),s)}function a(l){return l===95?n=!0:(i=n,n=void 0),t.consume(l),s}function u(l){return i||n||!o?r(l):e(l)}}function cv(t,e){let r=0,n=0;return i;function i(s){return s===40?(r++,t.consume(s),i):s===41&&n<r?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check($g,e,o)(s):s===null||ke(s)||_r(s)?e(s):(t.consume(s),i)}function o(s){return s===41&&n++,t.consume(s),i}}function fv(t,e,r){return n;function n(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(t.consume(a),n):a===38?(t.consume(a),o):a===93?(t.consume(a),i):a===60||a===null||ke(a)||_r(a)?e(a):r(a)}function i(a){return a===null||a===40||a===91||ke(a)||_r(a)?e(a):n(a)}function o(a){return mt(a)?s(a):r(a)}function s(a){return a===59?(t.consume(a),n):mt(a)?(t.consume(a),s):r(a)}}function pv(t,e,r){return n;function n(o){return t.consume(o),i}function i(o){return gt(o)?r(o):e(o)}}function Gg(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||ke(t)}function Wg(t){return!mt(t)}function Hg(t){return!(t===47||Kf(t))}function Kf(t){return t===43||t===45||t===46||t===95||gt(t)}function Zf(t){let e=t.length,r=!1;for(;e--;){let n=t[e][1];if((n.type==="labelLink"||n.type==="labelImage")&&!n._balanced){r=!0;break}if(n._gfmAutolinkLiteralWalkedInto){r=!1;break}}return t.length>0&&!r&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}var dv={tokenize:Ev,partial:!0};function Xf(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:xv,continuation:{tokenize:yv},exit:bv}},text:{91:{name:"gfmFootnoteCall",tokenize:gv},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:hv,resolveTo:mv}}}}function hv(t,e,r){let n=this,i=n.events.length,o=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),s;for(;i--;){let u=n.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!s||!s._balanced)return r(u);let l=_t(n.sliceSerialize({start:s.end,end:n.now()}));return l.codePointAt(0)!==94||!o.includes(l.slice(1))?r(u):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),e(u))}}function mv(t,e){let r=t.length,n;for(;r--;)if(t[r][1].type==="labelImage"&&t[r][0]==="enter"){n=t[r][1];break}t[r+1][1].type="data",t[r+3][1].type="gfmFootnoteCallLabelMarker";let i={type:"gfmFootnoteCall",start:Object.assign({},t[r+3][1].start),end:Object.assign({},t[t.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},t[r+3][1].end),end:Object.assign({},t[r+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;let s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},u=[t[r+1],t[r+2],["enter",i,e],t[r+3],t[r+4],["enter",o,e],["exit",o,e],["enter",s,e],["enter",a,e],["exit",a,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",i,e]];return t.splice(r,t.length-r+1,...u),t}function gv(t,e,r){let n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o=0,s;return a;function a(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),u}function u(f){return f!==94?r(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(f){if(o>999||f===93&&!s||f===null||f===91||ke(f))return r(f);if(f===93){t.exit("chunkString");let p=t.exit("gfmFootnoteCallString");return i.includes(_t(n.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):r(f)}return ke(f)||(s=!0),o++,t.consume(f),f===92?c:l}function c(f){return f===91||f===92||f===93?(t.consume(f),o++,l):l(f)}}function xv(t,e,r){let n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o,s=0,a;return u;function u(m){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(m){return m===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",c):r(m)}function c(m){if(s>999||m===93&&!a||m===null||m===91||ke(m))return r(m);if(m===93){t.exit("chunkString");let y=t.exit("gfmFootnoteDefinitionLabelString");return o=_t(n.sliceSerialize(y)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return ke(m)||(a=!0),s++,t.consume(m),m===92?f:c}function f(m){return m===91||m===92||m===93?(t.consume(m),s++,c):c(m)}function p(m){return m===58?(t.enter("definitionMarker"),t.consume(m),t.exit("definitionMarker"),i.includes(o)||i.push(o),ie(t,d,"gfmFootnoteDefinitionWhitespace")):r(m)}function d(m){return e(m)}}function yv(t,e,r){return t.check(Sr,e,t.attempt(dv,e,r))}function bv(t){t.exit("gfmFootnoteDefinition")}function Ev(t,e,r){let n=this;return ie(t,i,"gfmFootnoteDefinitionIndent",5);function i(o){let s=n.events[n.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(o):r(o)}}function Jf(t){let r=(t||{}).singleTilde,n={name:"strikethrough",tokenize:o,resolveAll:i};return r==null&&(r=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function i(s,a){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let l=u;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[u][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[u][1].end)},f={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[u][1].start)},p=[["enter",c,a],["enter",s[l][1],a],["exit",s[l][1],a],["enter",f,a]],d=a.parser.constructs.insideSpan.null;d&&it(p,p.length,0,bn(d,s.slice(l+1,u),a)),it(p,p.length,0,[["exit",f,a],["enter",s[u][1],a],["exit",s[u][1],a],["exit",c,a]]),it(s,l-1,u-l+3,p),u=l+p.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function o(s,a,u){let l=this.previous,c=this.events,f=0;return p;function p(m){return l===126&&c[c.length-1][1].type!=="characterEscape"?u(m):(s.enter("strikethroughSequenceTemporary"),d(m))}function d(m){let y=Jr(l);if(m===126)return f>1?u(m):(s.consume(m),f++,d);if(f<2&&!r)return u(m);let g=s.exit("strikethroughSequenceTemporary"),b=Jr(m);return g._open=!b||b===2&&!!y,g._close=!y||y===2&&!!b,a(m)}}}var uu=class{constructor(){this.map=[]}add(e,r,n){Av(this,e,r,n)}consume(e){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let r=this.map.length,n=[];for(;r>0;)r-=1,n.push(e.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),e.length=this.map[r][0];n.push(e.slice()),e.length=0;let i=n.pop();for(;i;){for(let o of i)e.push(o);i=n.pop()}this.map.length=0}};function Av(t,e,r,n){let i=0;if(!(r===0&&n.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=r,t.map[i][2].push(...n);return}i+=1}t.map.push([e,r,n])}}function Kg(t,e){let r=!1,n=[];for(;e<t.length;){let i=t[e];if(r){if(i[0]==="enter")i[1].type==="tableContent"&&n.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){let o=n.length-1;n[o]=n[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(r=!0);e+=1}return n}function Qf(){return{flow:{null:{name:"table",tokenize:wv,resolveAll:Cv}}}}function wv(t,e,r){let n=this,i=0,o=0,s;return a;function a(_){let L=n.events.length-1;for(;L>-1;){let P=n.events[L][1].type;if(P==="lineEnding"||P==="linePrefix")L--;else break}let F=L>-1?n.events[L][1].type:null,v=F==="tableHead"||F==="tableRow"?S:u;return v===S&&n.parser.lazy[n.now().line]?r(_):v(_)}function u(_){return t.enter("tableHead"),t.enter("tableRow"),l(_)}function l(_){return _===124||(s=!0,o+=1),c(_)}function c(_){return _===null?r(_):z(_)?o>1?(o=0,n.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),d):r(_):se(_)?ie(t,c,"whitespace")(_):(o+=1,s&&(s=!1,i+=1),_===124?(t.enter("tableCellDivider"),t.consume(_),t.exit("tableCellDivider"),s=!0,c):(t.enter("data"),f(_)))}function f(_){return _===null||_===124||ke(_)?(t.exit("data"),c(_)):(t.consume(_),_===92?p:f)}function p(_){return _===92||_===124?(t.consume(_),f):f(_)}function d(_){return n.interrupt=!1,n.parser.lazy[n.now().line]?r(_):(t.enter("tableDelimiterRow"),s=!1,se(_)?ie(t,m,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):m(_))}function m(_){return _===45||_===58?g(_):_===124?(s=!0,t.enter("tableCellDivider"),t.consume(_),t.exit("tableCellDivider"),y):R(_)}function y(_){return se(_)?ie(t,g,"whitespace")(_):g(_)}function g(_){return _===58?(o+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(_),t.exit("tableDelimiterMarker"),b):_===45?(o+=1,b(_)):_===null||z(_)?D(_):R(_)}function b(_){return _===45?(t.enter("tableDelimiterFiller"),C(_)):R(_)}function C(_){return _===45?(t.consume(_),C):_===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(_),t.exit("tableDelimiterMarker"),w):(t.exit("tableDelimiterFiller"),w(_))}function w(_){return se(_)?ie(t,D,"whitespace")(_):D(_)}function D(_){return _===124?m(_):_===null||z(_)?!s||i!==o?R(_):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(_)):R(_)}function R(_){return r(_)}function S(_){return t.enter("tableRow"),de(_)}function de(_){return _===124?(t.enter("tableCellDivider"),t.consume(_),t.exit("tableCellDivider"),de):_===null||z(_)?(t.exit("tableRow"),e(_)):se(_)?ie(t,de,"whitespace")(_):(t.enter("data"),ye(_))}function ye(_){return _===null||_===124||ke(_)?(t.exit("data"),de(_)):(t.consume(_),_===92?be:ye)}function be(_){return _===92||_===124?(t.consume(_),ye):ye(_)}}function Cv(t,e){let r=-1,n=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,u=0,l,c,f,p=new uu;for(;++r<t.length;){let d=t[r],m=d[1];d[0]==="enter"?m.type==="tableHead"?(a=!1,u!==0&&(Yg(p,e,u,l,c),c=void 0,u=0),l={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(r,0,[["enter",l,e]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(n=!0,f=void 0,o=[0,0,0,0],s=[0,r+1,0,0],a&&(a=!1,c={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(r,0,[["enter",c,e]])),i=m.type==="tableDelimiterRow"?2:c?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(n=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],f=lu(p,e,o,i,void 0,f),o=[0,0,0,0]),s[2]=r)):m.type==="tableCellDivider"&&(n?n=!1:(o[1]!==0&&(s[0]=s[1],f=lu(p,e,o,i,void 0,f)),o=s,s=[o[1],r,0,0])):m.type==="tableHead"?(a=!0,u=r):m.type==="tableRow"||m.type==="tableDelimiterRow"?(u=r,o[1]!==0?(s[0]=s[1],f=lu(p,e,o,i,r,f)):s[1]!==0&&(f=lu(p,e,s,i,r,f)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(s[3]=r)}for(u!==0&&Yg(p,e,u,l,c),p.consume(e.events),r=-1;++r<e.events.length;){let d=e.events[r];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=Kg(e.events,r))}return t}function lu(t,e,r,n,i,o){let s=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",a="tableContent";r[0]!==0&&(o.end=Object.assign({},lo(e.events,r[0])),t.add(r[0],0,[["exit",o,e]]));let u=lo(e.events,r[1]);if(o={type:s,start:Object.assign({},u),end:Object.assign({},u)},t.add(r[1],0,[["enter",o,e]]),r[2]!==0){let l=lo(e.events,r[2]),c=lo(e.events,r[3]),f={type:a,start:Object.assign({},l),end:Object.assign({},c)};if(t.add(r[2],0,[["enter",f,e]]),n!==2){let p=e.events[r[2]],d=e.events[r[3]];if(p[1].end=Object.assign({},d[1].end),p[1].type="chunkText",p[1].contentType="text",r[3]>r[2]+1){let m=r[2]+1,y=r[3]-r[2]-1;t.add(m,y,[])}}t.add(r[3]+1,0,[["exit",f,e]])}return i!==void 0&&(o.end=Object.assign({},lo(e.events,i)),t.add(i,0,[["exit",o,e]]),o=void 0),o}function Yg(t,e,r,n,i){let o=[],s=lo(e.events,r);i&&(i.end=Object.assign({},s),o.push(["exit",i,e])),n.end=Object.assign({},s),o.push(["exit",n,e]),t.add(r+1,0,o)}function lo(t,e){let r=t[e],n=r[0]==="enter"?"start":"end";return r[1][n]}var kv={name:"tasklistCheck",tokenize:Tv};function ep(){return{text:{91:kv}}}function Tv(t,e,r){let n=this;return i;function i(u){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?r(u):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),o)}function o(u){return ke(u)?(t.enter("taskListCheckValueUnchecked"),t.consume(u),t.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(t.enter("taskListCheckValueChecked"),t.consume(u),t.exit("taskListCheckValueChecked"),s):r(u)}function s(u){return u===93?(t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),a):r(u)}function a(u){return z(u)?e(u):se(u)?t.check({tokenize:_v},e,r)(u):r(u)}}function _v(t,e,r){return ie(t,n,"whitespace");function n(i){return i===null?r(i):e(i)}}function Zg(t){return Ba([Yf(),Xf(),Jf(t),Qf(),ep()])}var Sv={};function An(t){let e=this,r=t||Sv,n=e.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(Zg(r)),o.push(Wf()),s.push(Hf(r))}import{mdatCheck as vv,mdatClean as Xg,mdatExpand as Iv,mdatSplit as Jg}from"remark-mdat";import{VFile as Qq}from"vfile";async function wn(t,e,r,n,i,o,s){let a=await e({additionalConfig:o,additionalRules:s});o=a;let u=await um(),l=Pa(t),c=am(l,i,n,"md"),f=[],p=r(a,u);for(let{input:d,name:m,output:y}of c){let g=await ec(d),b=await p.process(g);b.dirname=y,b.basename=m,f.push(b)}return f}function cu(t,e){return uo().use({settings:{bullet:"-",emphasis:"_"}}).use(An).use(e).use(()=>async function(n,i){Jg(n,i),Xg(n,i,t),await Iv(n,i,t)})}function fu(t,e){return uo().use({settings:{bullet:"-",emphasis:"_"}}).use(An).use(e).use(()=>function(n,i){Jg(n,i),Xg(n,i,t)})}function pu(t,e){return uo().use({settings:{bullet:"-",emphasis:"_"}}).use(An).use(e).use(()=>async function(n,i){await vv(n,i,{...t,paranoid:!1})})}async function Qg(t,e,r,n,i){return wn(t,xi,cu,e,r,n,i)}async function ex(t,e,r,n,i){return wn(t,xi,pu,e,r,n,i)}async function tx(t,e,r,n,i){return wn(t,xi,fu,e,r,n,i)}var du={badges:{async content(t){let e=X.object({custom:X.record(X.object({image:X.string(),link:X.string()})).optional(),npm:X.array(X.string()).optional()}).optional().parse(t),r=await Qt(),{name:n}=r,i=[];if(!r.private&&r.publishConfig?.access==="public"&&i.push(`[![NPM Package ${n}](https://img.shields.io/npm/v/${n}.svg)](https://npmjs.com/package/${n})`),e?.npm!==void 0)for(let s of e.npm)i.push(`[![NPM Package ${s}](https://img.shields.io/npm/v/${s}.svg)](https://npmjs.com/package/${s})`);let{license:o}=r;if(o!==void 0&&i.push(`[![License: ${o}](https://img.shields.io/badge/License-${o}-yellow.svg)](https://opensource.org/licenses/${o})`),e?.custom!==void 0)for(let[s,{image:a,link:u}]of Object.entries(e.custom))i.push(`[![${s}](${a})](${u})`);return i.join(`
105
+ `)},order:3}};import{globby as Dv}from"globby";import hu from"node:path";import{readPackage as Rv}from"read-pkg";var mu={banner:{async content(t){let e=X.object({alt:X.string().optional(),src:X.string().optional()}).optional().parse(t),{assetsPath:r,packageFile:n}=await Tr();if(n===void 0)throw new Error("No package.json found");let i=e?.src??await rx(r)??await rx();if(i===void 0)throw new Error("Banner image not found at any typical location, consider adding something at ./assets/banner.webp");if(!nx(i)&&!await ro(i))throw new Error(`Banner image not found at "${i}"`);let o=e?.alt??`${(await Rv({cwd:hu.dirname(n)})).name} banner`;if(o===void 0||o==="undefined banner")throw new Error("Banner image alt text not available");return`![${o}](${i})`},order:2}};async function rx(t){let{packageFile:e}=await Tr();if(e===void 0)throw new Error("No package.json found");let r=hu.dirname(e),n=t===void 0?[".","assets","media","readme-assets","readme-media","readme","images",".github/assets"]:[t],i=["banner","cover","demo","header","hero","image","logo","overview","readme","screenshot","screenshots","splash"],o=["png","gif","jpg","jpeg","svg","webp"],s=await Dv(n.map(a=>hu.join(r,a)),{deep:1,expandDirectories:{extensions:o,files:i}});if(s.length>0)return hu.relative(process.cwd(),s[0])}function nx(t,e=!0){if(typeof t!="string")throw new TypeError("Expected a string");if(t=t.trim(),t.includes(" "))return!1;try{return new URL(t),!0}catch{return e?nx(`https://${t}`,!1):!1}}import{getSoleRule as $P}from"remark-mdat";import{execaCommand as SP}from"execa";import{log as wA}from"remark-mdat";function ix(t,e=Number.MAX_SAFE_INTEGER){let r=[],n=Fv(t,e);return r.push(Nv(n)),r.push(Pv(t,n)),n.hasMultipleSubcommands&&n.canRecurse&&r.push(Lv(n.fullCommandName)),n.defaultCommand?.commandName!==void 0&&r.push(Mv(n)),r.push(Bv(t,n)),t.positionals&&!n.commandsOnly&&r.push(tp(["Positional Argument","Description","Type","Default"],t.positionals.map(i=>[i.arguments?[i.arguments.map(o=>`\`${o}\``)].join(" "):"",`${i.description??""}${i.required===void 0?"":i.required?" _(Required.)_":" _(Optional.)_"}`,i.type?`\`${i.type}\``:"",i.defaultValue?i.defaultValue.includes(" ")?i.defaultValue:`\`${i.defaultValue}\``:""]))),t.commands&&r.push(tp(["Command","Argument","Description"],t.commands.map(i=>[`\`${i.commandName??(i.default?"[default]":"")}\``,i.arguments?i.arguments.map(o=>`\`${o}\``).join(" "):"",`${i.description??""}${i.default?" _(Default command.)_":""}`]))),t.options&&!n.commandsOnly&&r.push(tp(["Option","Argument","Description","Type","Default"],t.options.map(i=>[i.flags!==void 0||i.aliases!==void 0?[...i.flags??[],...i.aliases??[]].map(o=>`\`${o}\``).join("<br>"):"",i.arguments?i.arguments.map(o=>`\`${o}\``).join(" "):"",i.description??"",i.choices?i.choices.map(o=>`\`${o}\``).join(" "):i.type?`\`${i.type}\``:"",i.defaultValue?i.defaultValue.includes(" ")&&i.choices===void 0?i.defaultValue:`\`${i.defaultValue}\``:""]))),n.canRecurse&&n.hasMultipleSubcommands&&r.push("_See the sections below for more information on each subcommand._"),r.join(`
110
106
 
111
- `)}function av(t,e){let r=t.subcommandName===void 0,n=t.commands?t.commands.length>1:!1,i=e>1,o=t.commands?.find(l=>l.default),s=t.commands?.find(l=>l.commandName===void 0),a=`${t.commandName}${t.subcommandName?` ${t.subcommandName}`:""}`,u=i&&n&&o?.commandName!==void 0;return{canRecurse:i,commandsOnly:u,defaultCommand:o,fullCommandName:a,hasMultipleSubcommands:n,isTopLevel:r,topLevelCommand:s}}function uv(t){return`#### ${t.isTopLevel?"Command":"Subcommand"}: \`${t.fullCommandName}\``}function lv(t,e){return e.isTopLevel&&e.topLevelCommand?.description?(t.commands=t.commands?.filter(r=>r!==e.topLevelCommand),e.topLevelCommand.description):t.description??""}function cv(t){return`This section lists top-level commands for \`${t}\`.`}function fv(t){return`If no command is provided, \`${t.defaultCommand?.parentCommandName} ${t.defaultCommand?.commandName}\` is run by default.`}function pv(t,e){let r=e.topLevelCommand?.arguments?` ${e.topLevelCommand.arguments.join(" ")}`:t.arguments?` ${t.arguments.join(" ")}`:"";return`Usage:
107
+ `)}function Fv(t,e){let r=t.subcommandName===void 0,n=t.commands?t.commands.length>1:!1,i=e>1,o=t.commands?.find(l=>l.default),s=t.commands?.find(l=>l.commandName===void 0),a=`${t.commandName}${t.subcommandName?` ${t.subcommandName}`:""}`,u=i&&n&&o?.commandName!==void 0;return{canRecurse:i,commandsOnly:u,defaultCommand:o,fullCommandName:a,hasMultipleSubcommands:n,isTopLevel:r,topLevelCommand:s}}function Nv(t){return`#### ${t.isTopLevel?"Command":"Subcommand"}: \`${t.fullCommandName}\``}function Pv(t,e){return e.isTopLevel&&e.topLevelCommand?.description?(t.commands=t.commands?.filter(r=>r!==e.topLevelCommand),e.topLevelCommand.description):t.description??""}function Lv(t){return`This section lists top-level commands for \`${t}\`.`}function Mv(t){return`If no command is provided, \`${t.defaultCommand?.parentCommandName} ${t.defaultCommand?.commandName}\` is run by default.`}function Bv(t,e){let r=e.topLevelCommand?.arguments?` ${e.topLevelCommand.arguments.join(" ")}`:t.arguments?` ${t.arguments.join(" ")}`:"";return`Usage:
112
108
 
113
109
  \`\`\`txt
114
110
  ${e.fullCommandName}${r}
115
- \`\`\``}function up(t,e){let r=dv(e);t=t.filter((i,o)=>!r.includes(o)),e=e.map(i=>i.filter((o,s)=>!r.includes(s)));let n="";n+=`| ${t.join(" | ")} |
111
+ \`\`\``}function tp(t,e){let r=jv(e);t=t.filter((i,o)=>!r.includes(o)),e=e.map(i=>i.filter((o,s)=>!r.includes(s)));let n="";n+=`| ${t.join(" | ")} |
116
112
  `,n+=`| ${t.map(()=>"---").join(" | ")} |
117
113
  `;for(let i of e)n+=`| ${i.join(" | ")} |
118
- `;return n}function dv(t){let e=[],r=t[0]?.length||0;for(let n=0;n<r;n++){let i=!0;for(let o of t)if(o[n]!==""){i=!1;break}i&&e.push(n)}return e}import{log as bd}from"remark-mdat";var hv=typeof global=="object"&&global&&global.Object===Object&&global,bu=hv;var mv=typeof self=="object"&&self&&self.Object===Object&&self,gv=bu||mv||Function("return this")(),pt=gv;var xv=pt.Symbol,wt=xv;var Cx=Object.prototype,yv=Cx.hasOwnProperty,bv=Cx.toString,vs=wt?wt.toStringTag:void 0;function Ev(t){var e=yv.call(t,vs),r=t[vs];try{t[vs]=void 0;var n=!0}catch{}var i=bv.call(t);return n&&(e?t[vs]=r:delete t[vs]),i}var wx=Ev;var Av=Object.prototype,Cv=Av.toString;function wv(t){return Cv.call(t)}var kx=wv;var kv="[object Null]",Tv="[object Undefined]",Tx=wt?wt.toStringTag:void 0;function _v(t){return t==null?t===void 0?Tv:kv:Tx&&Tx in Object(t)?wx(t):kx(t)}var Mt=_v;function Sv(t){return t!=null&&typeof t=="object"}var at=Sv;var vv="[object Symbol]";function Iv(t){return typeof t=="symbol"||at(t)&&Mt(t)==vv}var Sn=Iv;function Ov(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var Pr=Ov;var Dv=Array.isArray,J=Dv;var Rv=1/0,_x=wt?wt.prototype:void 0,Sx=_x?_x.toString:void 0;function vx(t){if(typeof t=="string")return t;if(J(t))return Pr(t,vx)+"";if(Sn(t))return Sx?Sx.call(t):"";var e=t+"";return e=="0"&&1/t==-Rv?"-0":e}var Ix=vx;var Fv=/\s/;function Nv(t){for(var e=t.length;e--&&Fv.test(t.charAt(e)););return e}var Ox=Nv;var Pv=/^\s+/;function Lv(t){return t&&t.slice(0,Ox(t)+1).replace(Pv,"")}var Dx=Lv;function Mv(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ze=Mv;var Rx=NaN,Bv=/^[-+]0x[0-9a-f]+$/i,jv=/^0b[01]+$/i,Uv=/^0o[0-7]+$/i,zv=parseInt;function $v(t){if(typeof t=="number")return t;if(Sn(t))return Rx;if(Ze(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ze(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Dx(t);var r=jv.test(t);return r||Uv.test(t)?zv(t.slice(2),r?2:8):Bv.test(t)?Rx:+t}var Fx=$v;var Nx=1/0,qv=17976931348623157e292;function Vv(t){if(!t)return t===0?t:0;if(t=Fx(t),t===Nx||t===-Nx){var e=t<0?-1:1;return e*qv}return t===t?t:0}var Px=Vv;function Gv(t){var e=Px(t),r=e%1;return e===e?r?e-r:e:0}var Lr=Gv;function Wv(t){return t}var hr=Wv;var Hv="[object AsyncFunction]",Kv="[object Function]",Yv="[object GeneratorFunction]",Zv="[object Proxy]";function Xv(t){if(!Ze(t))return!1;var e=Mt(t);return e==Kv||e==Yv||e==Hv||e==Zv}var Bt=Xv;var Jv=pt["__core-js_shared__"],Eu=Jv;var Lx=function(){var t=/[^.]+$/.exec(Eu&&Eu.keys&&Eu.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Qv(t){return!!Lx&&Lx in t}var Mx=Qv;var eI=Function.prototype,tI=eI.toString;function rI(t){if(t!=null){try{return tI.call(t)}catch{}try{return t+""}catch{}}return""}var on=rI;var nI=/[\\^$.*+?()[\]{}|]/g,iI=/^\[object .+?Constructor\]$/,oI=Function.prototype,sI=Object.prototype,aI=oI.toString,uI=sI.hasOwnProperty,lI=RegExp("^"+aI.call(uI).replace(nI,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function cI(t){if(!Ze(t)||Mx(t))return!1;var e=Bt(t)?lI:iI;return e.test(on(t))}var Bx=cI;function fI(t,e){return t?.[e]}var jx=fI;function pI(t,e){var r=jx(t,e);return Bx(r)?r:void 0}var Gt=pI;var dI=Gt(pt,"WeakMap"),Au=dI;var Ux=Object.create,hI=function(){function t(){}return function(e){if(!Ze(e))return{};if(Ux)return Ux(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),zx=hI;function mI(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var $x=mI;function gI(){}var Xe=gI;function xI(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var qx=xI;var yI=800,bI=16,EI=Date.now;function AI(t){var e=0,r=0;return function(){var n=EI(),i=bI-(n-r);if(r=n,i>0){if(++e>=yI)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Vx=AI;function CI(t){return function(){return t}}var Gx=CI;var wI=function(){try{var t=Gt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),xo=wI;var kI=xo?function(t,e){return xo(t,"toString",{configurable:!0,enumerable:!1,value:Gx(e),writable:!0})}:hr,Wx=kI;var TI=Vx(Wx),Hx=TI;function _I(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var Cu=_I;function SI(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}var wu=SI;function vI(t){return t!==t}var Kx=vI;function II(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}var Yx=II;function OI(t,e,r){return e===e?Yx(t,e,r):wu(t,Kx,r)}var yo=OI;function DI(t,e){var r=t==null?0:t.length;return!!r&&yo(t,e,0)>-1}var ku=DI;var RI=9007199254740991,FI=/^(?:0|[1-9]\d*)$/;function NI(t,e){var r=typeof t;return e=e??RI,!!e&&(r=="number"||r!="symbol"&&FI.test(t))&&t>-1&&t%1==0&&t<e}var vn=NI;function PI(t,e,r){e=="__proto__"&&xo?xo(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var bo=PI;function LI(t,e){return t===e||t!==t&&e!==e}var Mr=LI;var MI=Object.prototype,BI=MI.hasOwnProperty;function jI(t,e,r){var n=t[e];(!(BI.call(t,e)&&Mr(n,r))||r===void 0&&!(e in t))&&bo(t,e,r)}var In=jI;function UI(t,e,r,n){var i=!r;r||(r={});for(var o=-1,s=e.length;++o<s;){var a=e[o],u=n?n(r[a],t[a],a,r,t):void 0;u===void 0&&(u=t[a]),i?bo(r,a,u):In(r,a,u)}return r}var Br=UI;var Zx=Math.max;function zI(t,e,r){return e=Zx(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=Zx(n.length-e,0),s=Array(o);++i<o;)s[i]=n[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=n[i];return a[e]=r(s),$x(t,this,a)}}var Xx=zI;function $I(t,e){return Hx(Xx(t,e,hr),t+"")}var Eo=$I;var qI=9007199254740991;function VI(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=qI}var Ao=VI;function GI(t){return t!=null&&Ao(t.length)&&!Bt(t)}var dt=GI;function WI(t,e,r){if(!Ze(r))return!1;var n=typeof e;return(n=="number"?dt(r)&&vn(e,r.length):n=="string"&&e in r)?Mr(r[e],t):!1}var On=WI;function HI(t){return Eo(function(e,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,s&&On(r[0],r[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++n<i;){var a=r[n];a&&t(e,a,n,o)}return e})}var Jx=HI;var KI=Object.prototype;function YI(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||KI;return t===r}var jr=YI;function ZI(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Qx=ZI;var XI="[object Arguments]";function JI(t){return at(t)&&Mt(t)==XI}var lp=JI;var ey=Object.prototype,QI=ey.hasOwnProperty,eO=ey.propertyIsEnumerable,tO=lp(function(){return arguments}())?lp:function(t){return at(t)&&QI.call(t,"callee")&&!eO.call(t,"callee")},Dn=tO;function rO(){return!1}var ty=rO;var iy=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ry=iy&&typeof module=="object"&&module&&!module.nodeType&&module,nO=ry&&ry.exports===iy,ny=nO?pt.Buffer:void 0,iO=ny?ny.isBuffer:void 0,oO=iO||ty,sn=oO;var sO="[object Arguments]",aO="[object Array]",uO="[object Boolean]",lO="[object Date]",cO="[object Error]",fO="[object Function]",pO="[object Map]",dO="[object Number]",hO="[object Object]",mO="[object RegExp]",gO="[object Set]",xO="[object String]",yO="[object WeakMap]",bO="[object ArrayBuffer]",EO="[object DataView]",AO="[object Float32Array]",CO="[object Float64Array]",wO="[object Int8Array]",kO="[object Int16Array]",TO="[object Int32Array]",_O="[object Uint8Array]",SO="[object Uint8ClampedArray]",vO="[object Uint16Array]",IO="[object Uint32Array]",Ve={};Ve[AO]=Ve[CO]=Ve[wO]=Ve[kO]=Ve[TO]=Ve[_O]=Ve[SO]=Ve[vO]=Ve[IO]=!0;Ve[sO]=Ve[aO]=Ve[bO]=Ve[uO]=Ve[EO]=Ve[lO]=Ve[cO]=Ve[fO]=Ve[pO]=Ve[dO]=Ve[hO]=Ve[mO]=Ve[gO]=Ve[xO]=Ve[yO]=!1;function OO(t){return at(t)&&Ao(t.length)&&!!Ve[Mt(t)]}var oy=OO;function DO(t){return function(e){return t(e)}}var Ur=DO;var sy=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Is=sy&&typeof module=="object"&&module&&!module.nodeType&&module,RO=Is&&Is.exports===sy,cp=RO&&bu.process,FO=function(){try{var t=Is&&Is.require&&Is.require("util").types;return t||cp&&cp.binding&&cp.binding("util")}catch{}}(),mr=FO;var ay=mr&&mr.isTypedArray,NO=ay?Ur(ay):oy,Co=NO;var PO=Object.prototype,LO=PO.hasOwnProperty;function MO(t,e){var r=J(t),n=!r&&Dn(t),i=!r&&!n&&sn(t),o=!r&&!n&&!i&&Co(t),s=r||n||i||o,a=s?Qx(t.length,String):[],u=a.length;for(var l in t)(e||LO.call(t,l))&&!(s&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||vn(l,u)))&&a.push(l);return a}var Tu=MO;function BO(t,e){return function(r){return t(e(r))}}var _u=BO;var jO=_u(Object.keys,Object),uy=jO;var UO=Object.prototype,zO=UO.hasOwnProperty;function $O(t){if(!jr(t))return uy(t);var e=[];for(var r in Object(t))zO.call(t,r)&&r!="constructor"&&e.push(r);return e}var Su=$O;function qO(t){return dt(t)?Tu(t):Su(t)}var Pe=qO;var VO=Object.prototype,GO=VO.hasOwnProperty,WO=Jx(function(t,e){if(jr(e)||dt(e)){Br(e,Pe(e),t);return}for(var r in e)GO.call(e,r)&&In(t,r,e[r])}),_t=WO;function HO(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var ly=HO;var KO=Object.prototype,YO=KO.hasOwnProperty;function ZO(t){if(!Ze(t))return ly(t);var e=jr(t),r=[];for(var n in t)n=="constructor"&&(e||!YO.call(t,n))||r.push(n);return r}var cy=ZO;function XO(t){return dt(t)?Tu(t,!0):cy(t)}var Rn=XO;var JO=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,QO=/^\w*$/;function eD(t,e){if(J(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Sn(t)?!0:QO.test(t)||!JO.test(t)||e!=null&&t in Object(e)}var wo=eD;var tD=Gt(Object,"create"),an=tD;function rD(){this.__data__=an?an(null):{},this.size=0}var fy=rD;function nD(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var py=nD;var iD="__lodash_hash_undefined__",oD=Object.prototype,sD=oD.hasOwnProperty;function aD(t){var e=this.__data__;if(an){var r=e[t];return r===iD?void 0:r}return sD.call(e,t)?e[t]:void 0}var dy=aD;var uD=Object.prototype,lD=uD.hasOwnProperty;function cD(t){var e=this.__data__;return an?e[t]!==void 0:lD.call(e,t)}var hy=cD;var fD="__lodash_hash_undefined__";function pD(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=an&&e===void 0?fD:e,this}var my=pD;function ko(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ko.prototype.clear=fy;ko.prototype.delete=py;ko.prototype.get=dy;ko.prototype.has=hy;ko.prototype.set=my;var fp=ko;function dD(){this.__data__=[],this.size=0}var gy=dD;function hD(t,e){for(var r=t.length;r--;)if(Mr(t[r][0],e))return r;return-1}var Fn=hD;var mD=Array.prototype,gD=mD.splice;function xD(t){var e=this.__data__,r=Fn(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():gD.call(e,r,1),--this.size,!0}var xy=xD;function yD(t){var e=this.__data__,r=Fn(e,t);return r<0?void 0:e[r][1]}var yy=yD;function bD(t){return Fn(this.__data__,t)>-1}var by=bD;function ED(t,e){var r=this.__data__,n=Fn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var Ey=ED;function To(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}To.prototype.clear=gy;To.prototype.delete=xy;To.prototype.get=yy;To.prototype.has=by;To.prototype.set=Ey;var Nn=To;var AD=Gt(pt,"Map"),Pn=AD;function CD(){this.size=0,this.__data__={hash:new fp,map:new(Pn||Nn),string:new fp}}var Ay=CD;function wD(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Cy=wD;function kD(t,e){var r=t.__data__;return Cy(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Ln=kD;function TD(t){var e=Ln(this,t).delete(t);return this.size-=e?1:0,e}var wy=TD;function _D(t){return Ln(this,t).get(t)}var ky=_D;function SD(t){return Ln(this,t).has(t)}var Ty=SD;function vD(t,e){var r=Ln(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var _y=vD;function _o(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}_o.prototype.clear=Ay;_o.prototype.delete=wy;_o.prototype.get=ky;_o.prototype.has=Ty;_o.prototype.set=_y;var Di=_o;var ID="Expected a function";function pp(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(ID);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(pp.Cache||Di),r}pp.Cache=Di;var Sy=pp;var OD=500;function DD(t){var e=Sy(t,function(n){return r.size===OD&&r.clear(),n}),r=e.cache;return e}var vy=DD;var RD=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,FD=/\\(\\)?/g,ND=vy(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(RD,function(r,n,i,o){e.push(i?o.replace(FD,"$1"):n||r)}),e}),Iy=ND;function PD(t){return t==null?"":Ix(t)}var Oy=PD;function LD(t,e){return J(t)?t:wo(t,e)?[t]:Iy(Oy(t))}var Mn=LD;var MD=1/0;function BD(t){if(typeof t=="string"||Sn(t))return t;var e=t+"";return e=="0"&&1/t==-MD?"-0":e}var zr=BD;function jD(t,e){e=Mn(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[zr(e[r++])];return r&&r==n?t:void 0}var So=jD;function UD(t,e,r){var n=t==null?void 0:So(t,e);return n===void 0?r:n}var Dy=UD;function zD(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var vo=zD;var Ry=wt?wt.isConcatSpreadable:void 0;function $D(t){return J(t)||Dn(t)||!!(Ry&&t&&t[Ry])}var Fy=$D;function Ny(t,e,r,n,i){var o=-1,s=t.length;for(r||(r=Fy),i||(i=[]);++o<s;){var a=t[o];e>0&&r(a)?e>1?Ny(a,e-1,r,n,i):vo(i,a):n||(i[i.length]=a)}return i}var Io=Ny;function qD(t){var e=t==null?0:t.length;return e?Io(t,1):[]}var bt=qD;var VD=_u(Object.getPrototypeOf,Object),vu=VD;function GD(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}var Iu=GD;function WD(t,e,r,n){var i=-1,o=t==null?0:t.length;for(n&&o&&(r=t[++i]);++i<o;)r=e(r,t[i],i,t);return r}var Py=WD;function HD(){this.__data__=new Nn,this.size=0}var Ly=HD;function KD(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var My=KD;function YD(t){return this.__data__.get(t)}var By=YD;function ZD(t){return this.__data__.has(t)}var jy=ZD;var XD=200;function JD(t,e){var r=this.__data__;if(r instanceof Nn){var n=r.__data__;if(!Pn||n.length<XD-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Di(n)}return r.set(t,e),this.size=r.size,this}var Uy=JD;function Oo(t){var e=this.__data__=new Nn(t);this.size=e.size}Oo.prototype.clear=Ly;Oo.prototype.delete=My;Oo.prototype.get=By;Oo.prototype.has=jy;Oo.prototype.set=Uy;var Bn=Oo;function QD(t,e){return t&&Br(e,Pe(e),t)}var zy=QD;function eR(t,e){return t&&Br(e,Rn(e),t)}var $y=eR;var Wy=typeof exports=="object"&&exports&&!exports.nodeType&&exports,qy=Wy&&typeof module=="object"&&module&&!module.nodeType&&module,tR=qy&&qy.exports===Wy,Vy=tR?pt.Buffer:void 0,Gy=Vy?Vy.allocUnsafe:void 0;function rR(t,e){if(e)return t.slice();var r=t.length,n=Gy?Gy(r):new t.constructor(r);return t.copy(n),n}var Hy=rR;function nR(t,e){for(var r=-1,n=t==null?0:t.length,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}var Do=nR;function iR(){return[]}var Ou=iR;var oR=Object.prototype,sR=oR.propertyIsEnumerable,Ky=Object.getOwnPropertySymbols,aR=Ky?function(t){return t==null?[]:(t=Object(t),Do(Ky(t),function(e){return sR.call(t,e)}))}:Ou,Ro=aR;function uR(t,e){return Br(t,Ro(t),e)}var Yy=uR;var lR=Object.getOwnPropertySymbols,cR=lR?function(t){for(var e=[];t;)vo(e,Ro(t)),t=vu(t);return e}:Ou,Du=cR;function fR(t,e){return Br(t,Du(t),e)}var Zy=fR;function pR(t,e,r){var n=e(t);return J(t)?n:vo(n,r(t))}var Ru=pR;function dR(t){return Ru(t,Pe,Ro)}var Os=dR;function hR(t){return Ru(t,Rn,Du)}var Fu=hR;var mR=Gt(pt,"DataView"),Nu=mR;var gR=Gt(pt,"Promise"),Pu=gR;var xR=Gt(pt,"Set"),jn=xR;var Xy="[object Map]",yR="[object Object]",Jy="[object Promise]",Qy="[object Set]",eb="[object WeakMap]",tb="[object DataView]",bR=on(Nu),ER=on(Pn),AR=on(Pu),CR=on(jn),wR=on(Au),Ri=Mt;(Nu&&Ri(new Nu(new ArrayBuffer(1)))!=tb||Pn&&Ri(new Pn)!=Xy||Pu&&Ri(Pu.resolve())!=Jy||jn&&Ri(new jn)!=Qy||Au&&Ri(new Au)!=eb)&&(Ri=function(t){var e=Mt(t),r=e==yR?t.constructor:void 0,n=r?on(r):"";if(n)switch(n){case bR:return tb;case ER:return Xy;case AR:return Jy;case CR:return Qy;case wR:return eb}return e});var Ar=Ri;var kR=Object.prototype,TR=kR.hasOwnProperty;function _R(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&TR.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var rb=_R;var SR=pt.Uint8Array,Fo=SR;function vR(t){var e=new t.constructor(t.byteLength);return new Fo(e).set(new Fo(t)),e}var No=vR;function IR(t,e){var r=e?No(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var nb=IR;var OR=/\w*$/;function DR(t){var e=new t.constructor(t.source,OR.exec(t));return e.lastIndex=t.lastIndex,e}var ib=DR;var ob=wt?wt.prototype:void 0,sb=ob?ob.valueOf:void 0;function RR(t){return sb?Object(sb.call(t)):{}}var ab=RR;function FR(t,e){var r=e?No(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var ub=FR;var NR="[object Boolean]",PR="[object Date]",LR="[object Map]",MR="[object Number]",BR="[object RegExp]",jR="[object Set]",UR="[object String]",zR="[object Symbol]",$R="[object ArrayBuffer]",qR="[object DataView]",VR="[object Float32Array]",GR="[object Float64Array]",WR="[object Int8Array]",HR="[object Int16Array]",KR="[object Int32Array]",YR="[object Uint8Array]",ZR="[object Uint8ClampedArray]",XR="[object Uint16Array]",JR="[object Uint32Array]";function QR(t,e,r){var n=t.constructor;switch(e){case $R:return No(t);case NR:case PR:return new n(+t);case qR:return nb(t,r);case VR:case GR:case WR:case HR:case KR:case YR:case ZR:case XR:case JR:return ub(t,r);case LR:return new n;case MR:case UR:return new n(t);case BR:return ib(t);case jR:return new n;case zR:return ab(t)}}var lb=QR;function e1(t){return typeof t.constructor=="function"&&!jr(t)?zx(vu(t)):{}}var cb=e1;var t1="[object Map]";function r1(t){return at(t)&&Ar(t)==t1}var fb=r1;var pb=mr&&mr.isMap,n1=pb?Ur(pb):fb,db=n1;var i1="[object Set]";function o1(t){return at(t)&&Ar(t)==i1}var hb=o1;var mb=mr&&mr.isSet,s1=mb?Ur(mb):hb,gb=s1;var a1=1,u1=2,l1=4,xb="[object Arguments]",c1="[object Array]",f1="[object Boolean]",p1="[object Date]",d1="[object Error]",yb="[object Function]",h1="[object GeneratorFunction]",m1="[object Map]",g1="[object Number]",bb="[object Object]",x1="[object RegExp]",y1="[object Set]",b1="[object String]",E1="[object Symbol]",A1="[object WeakMap]",C1="[object ArrayBuffer]",w1="[object DataView]",k1="[object Float32Array]",T1="[object Float64Array]",_1="[object Int8Array]",S1="[object Int16Array]",v1="[object Int32Array]",I1="[object Uint8Array]",O1="[object Uint8ClampedArray]",D1="[object Uint16Array]",R1="[object Uint32Array]",Le={};Le[xb]=Le[c1]=Le[C1]=Le[w1]=Le[f1]=Le[p1]=Le[k1]=Le[T1]=Le[_1]=Le[S1]=Le[v1]=Le[m1]=Le[g1]=Le[bb]=Le[x1]=Le[y1]=Le[b1]=Le[E1]=Le[I1]=Le[O1]=Le[D1]=Le[R1]=!0;Le[d1]=Le[yb]=Le[A1]=!1;function Lu(t,e,r,n,i,o){var s,a=e&a1,u=e&u1,l=e&l1;if(r&&(s=i?r(t,n,i,o):r(t)),s!==void 0)return s;if(!Ze(t))return t;var c=J(t);if(c){if(s=rb(t),!a)return qx(t,s)}else{var f=Ar(t),p=f==yb||f==h1;if(sn(t))return Hy(t,a);if(f==bb||f==xb||p&&!i){if(s=u||p?{}:cb(t),!a)return u?Zy(t,$y(s,t)):Yy(t,zy(s,t))}else{if(!Le[f])return i?t:{};s=lb(t,f,a)}}o||(o=new Bn);var d=o.get(t);if(d)return d;o.set(t,s),gb(t)?t.forEach(function(g){s.add(Lu(g,e,r,g,t,o))}):db(t)&&t.forEach(function(g,b){s.set(b,Lu(g,e,r,b,t,o))});var m=l?u?Fu:Os:u?Rn:Pe,y=c?void 0:m(t);return Cu(y||t,function(g,b){y&&(b=g,g=t[b]),In(s,b,Lu(g,e,r,b,t,o))}),s}var Eb=Lu;var F1=4;function N1(t){return Eb(t,F1)}var Me=N1;function P1(t){for(var e=-1,r=t==null?0:t.length,n=0,i=[];++e<r;){var o=t[e];o&&(i[n++]=o)}return i}var $r=P1;var L1="__lodash_hash_undefined__";function M1(t){return this.__data__.set(t,L1),this}var Ab=M1;function B1(t){return this.__data__.has(t)}var Cb=B1;function Mu(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Di;++e<r;)this.add(t[e])}Mu.prototype.add=Mu.prototype.push=Ab;Mu.prototype.has=Cb;var Po=Mu;function j1(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var Bu=j1;function U1(t,e){return t.has(e)}var Lo=U1;var z1=1,$1=2;function q1(t,e,r,n,i,o){var s=r&z1,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var l=o.get(t),c=o.get(e);if(l&&c)return l==e&&c==t;var f=-1,p=!0,d=r&$1?new Po:void 0;for(o.set(t,e),o.set(e,t);++f<a;){var m=t[f],y=e[f];if(n)var g=s?n(y,m,f,e,t,o):n(m,y,f,t,e,o);if(g!==void 0){if(g)continue;p=!1;break}if(d){if(!Bu(e,function(b,w){if(!Lo(d,w)&&(m===b||i(m,b,r,n,o)))return d.push(w)})){p=!1;break}}else if(!(m===y||i(m,y,r,n,o))){p=!1;break}}return o.delete(t),o.delete(e),p}var ju=q1;function V1(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}var wb=V1;function G1(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Mo=G1;var W1=1,H1=2,K1="[object Boolean]",Y1="[object Date]",Z1="[object Error]",X1="[object Map]",J1="[object Number]",Q1="[object RegExp]",eF="[object Set]",tF="[object String]",rF="[object Symbol]",nF="[object ArrayBuffer]",iF="[object DataView]",kb=wt?wt.prototype:void 0,dp=kb?kb.valueOf:void 0;function oF(t,e,r,n,i,o,s){switch(r){case iF:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case nF:return!(t.byteLength!=e.byteLength||!o(new Fo(t),new Fo(e)));case K1:case Y1:case J1:return Mr(+t,+e);case Z1:return t.name==e.name&&t.message==e.message;case Q1:case tF:return t==e+"";case X1:var a=wb;case eF:var u=n&W1;if(a||(a=Mo),t.size!=e.size&&!u)return!1;var l=s.get(t);if(l)return l==e;n|=H1,s.set(t,e);var c=ju(a(t),a(e),n,i,o,s);return s.delete(t),c;case rF:if(dp)return dp.call(t)==dp.call(e)}return!1}var Tb=oF;var sF=1,aF=Object.prototype,uF=aF.hasOwnProperty;function lF(t,e,r,n,i,o){var s=r&sF,a=Os(t),u=a.length,l=Os(e),c=l.length;if(u!=c&&!s)return!1;for(var f=u;f--;){var p=a[f];if(!(s?p in e:uF.call(e,p)))return!1}var d=o.get(t),m=o.get(e);if(d&&m)return d==e&&m==t;var y=!0;o.set(t,e),o.set(e,t);for(var g=s;++f<u;){p=a[f];var b=t[p],w=e[p];if(n)var C=s?n(w,b,p,e,t,o):n(b,w,p,t,e,o);if(!(C===void 0?b===w||i(b,w,r,n,o):C)){y=!1;break}g||(g=p=="constructor")}if(y&&!g){var D=t.constructor,R=e.constructor;D!=R&&"constructor"in t&&"constructor"in e&&!(typeof D=="function"&&D instanceof D&&typeof R=="function"&&R instanceof R)&&(y=!1)}return o.delete(t),o.delete(e),y}var _b=lF;var cF=1,Sb="[object Arguments]",vb="[object Array]",Uu="[object Object]",fF=Object.prototype,Ib=fF.hasOwnProperty;function pF(t,e,r,n,i,o){var s=J(t),a=J(e),u=s?vb:Ar(t),l=a?vb:Ar(e);u=u==Sb?Uu:u,l=l==Sb?Uu:l;var c=u==Uu,f=l==Uu,p=u==l;if(p&&sn(t)){if(!sn(e))return!1;s=!0,c=!1}if(p&&!c)return o||(o=new Bn),s||Co(t)?ju(t,e,r,n,i,o):Tb(t,e,u,r,n,i,o);if(!(r&cF)){var d=c&&Ib.call(t,"__wrapped__"),m=f&&Ib.call(e,"__wrapped__");if(d||m){var y=d?t.value():t,g=m?e.value():e;return o||(o=new Bn),i(y,g,r,n,o)}}return p?(o||(o=new Bn),_b(t,e,r,n,i,o)):!1}var Ob=pF;function Db(t,e,r,n,i){return t===e?!0:t==null||e==null||!at(t)&&!at(e)?t!==t&&e!==e:Ob(t,e,r,n,Db,i)}var zu=Db;var dF=1,hF=2;function mF(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=r[i];var u=a[0],l=t[u],c=a[1];if(s&&a[2]){if(l===void 0&&!(u in t))return!1}else{var f=new Bn;if(n)var p=n(l,c,u,t,e,f);if(!(p===void 0?zu(c,l,dF|hF,n,f):p))return!1}}return!0}var Rb=mF;function gF(t){return t===t&&!Ze(t)}var $u=gF;function xF(t){for(var e=Pe(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,$u(i)]}return e}var Fb=xF;function yF(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var qu=yF;function bF(t){var e=Fb(t);return e.length==1&&e[0][2]?qu(e[0][0],e[0][1]):function(r){return r===t||Rb(r,t,e)}}var Nb=bF;function EF(t,e){return t!=null&&e in Object(t)}var Pb=EF;function AF(t,e,r){e=Mn(e,t);for(var n=-1,i=e.length,o=!1;++n<i;){var s=zr(e[n]);if(!(o=t!=null&&r(t,s)))break;t=t[s]}return o||++n!=i?o:(i=t==null?0:t.length,!!i&&Ao(i)&&vn(s,i)&&(J(t)||Dn(t)))}var Vu=AF;function CF(t,e){return t!=null&&Vu(t,e,Pb)}var Lb=CF;var wF=1,kF=2;function TF(t,e){return wo(t)&&$u(e)?qu(zr(t),e):function(r){var n=Dy(r,t);return n===void 0&&n===e?Lb(r,t):zu(e,n,wF|kF)}}var Mb=TF;function _F(t){return function(e){return e?.[t]}}var Bb=_F;function SF(t){return function(e){return So(e,t)}}var jb=SF;function vF(t){return wo(t)?Bb(zr(t)):jb(t)}var Ub=vF;function IF(t){return typeof t=="function"?t:t==null?hr:typeof t=="object"?J(t)?Mb(t[0],t[1]):Nb(t):Ub(t)}var ht=IF;function OF(t,e,r,n){for(var i=-1,o=t==null?0:t.length;++i<o;){var s=t[i];e(n,s,r(s),t)}return n}var zb=OF;function DF(t){return function(e,r,n){for(var i=-1,o=Object(e),s=n(e),a=s.length;a--;){var u=s[t?a:++i];if(r(o[u],u,o)===!1)break}return e}}var $b=DF;var RF=$b(),qb=RF;function FF(t,e){return t&&qb(t,e,Pe)}var Vb=FF;function NF(t,e){return function(r,n){if(r==null)return r;if(!dt(r))return t(r,n);for(var i=r.length,o=e?i:-1,s=Object(r);(e?o--:++o<i)&&n(s[o],o,s)!==!1;);return r}}var Gb=NF;var PF=Gb(Vb),Wt=PF;function LF(t,e,r,n){return Wt(t,function(i,o,s){e(n,i,r(i),s)}),n}var Wb=LF;function MF(t,e){return function(r,n){var i=J(r)?zb:Wb,o=e?e():{};return i(r,t,ht(n,2),o)}}var Hb=MF;var Kb=Object.prototype,BF=Kb.hasOwnProperty,jF=Eo(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&On(e[0],e[1],i)&&(n=1);++r<n;)for(var o=e[r],s=Rn(o),a=-1,u=s.length;++a<u;){var l=s[a],c=t[l];(c===void 0||Mr(c,Kb[l])&&!BF.call(t,l))&&(t[l]=o[l])}return t}),Bo=jF;function UF(t){return at(t)&&dt(t)}var hp=UF;function zF(t,e,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}var Gu=zF;var $F=200;function qF(t,e,r,n){var i=-1,o=ku,s=!0,a=t.length,u=[],l=e.length;if(!a)return u;r&&(e=Pr(e,Ur(r))),n?(o=Gu,s=!1):e.length>=$F&&(o=Lo,s=!1,e=new Po(e));e:for(;++i<a;){var c=t[i],f=r==null?c:r(c);if(c=n||c!==0?c:0,s&&f===f){for(var p=l;p--;)if(e[p]===f)continue e;u.push(c)}else o(e,f,n)||u.push(c)}return u}var Yb=qF;var VF=Eo(function(t,e){return hp(t)?Yb(t,Io(e,1,hp,!0)):[]}),Un=VF;function GF(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var qr=GF;function WF(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:Lr(e),Iu(t,e<0?0:e,n)):[]}var ut=WF;function HF(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:Lr(e),e=n-e,Iu(t,0,e<0?0:e)):[]}var un=HF;function KF(t){return typeof t=="function"?t:hr}var Zb=KF;function YF(t,e){var r=J(t)?Cu:Wt;return r(t,Zb(e))}var G=YF;function ZF(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}var Xb=ZF;function XF(t,e){var r=!0;return Wt(t,function(n,i,o){return r=!!e(n,i,o),r}),r}var Jb=XF;function JF(t,e,r){var n=J(t)?Xb:Jb;return r&&On(t,e,r)&&(e=void 0),n(t,ht(e,3))}var Dt=JF;function QF(t,e){var r=[];return Wt(t,function(n,i,o){e(n,i,o)&&r.push(n)}),r}var Wu=QF;function eN(t,e){var r=J(t)?Do:Wu;return r(t,ht(e,3))}var Rt=eN;function tN(t){return function(e,r,n){var i=Object(e);if(!dt(e)){var o=ht(r,3);e=Pe(e),r=function(a){return o(i[a],a,i)}}var s=t(e,r,n);return s>-1?i[o?e[s]:s]:void 0}}var Qb=tN;var rN=Math.max;function nN(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Lr(r);return i<0&&(i=rN(n+i,0)),wu(t,ht(e,3),i)}var eE=nN;var iN=Qb(eE),Vr=iN;function oN(t){return t&&t.length?t[0]:void 0}var kt=oN;function sN(t,e){var r=-1,n=dt(t)?Array(t.length):[];return Wt(t,function(i,o,s){n[++r]=e(i,o,s)}),n}var tE=sN;function aN(t,e){var r=J(t)?Pr:tE;return r(t,ht(e,3))}var q=aN;function uN(t,e){return Io(q(t,e),1)}var jt=uN;var lN=Object.prototype,cN=lN.hasOwnProperty,fN=Hb(function(t,e,r){cN.call(t,r)?t[r].push(e):bo(t,r,[e])}),mp=fN;var pN=Object.prototype,dN=pN.hasOwnProperty;function hN(t,e){return t!=null&&dN.call(t,e)}var rE=hN;function mN(t,e){return t!=null&&Vu(t,e,rE)}var Z=mN;var gN="[object String]";function xN(t){return typeof t=="string"||!J(t)&&at(t)&&Mt(t)==gN}var Et=xN;function yN(t,e){return Pr(e,function(r){return t[r]})}var nE=yN;function bN(t){return t==null?[]:nE(t,Pe(t))}var Re=bN;var EN=Math.max;function AN(t,e,r,n){t=dt(t)?t:Re(t),r=r&&!n?Lr(r):0;var i=t.length;return r<0&&(r=EN(i+r,0)),Et(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&yo(t,e,r)>-1}var He=AN;var CN=Math.max;function wN(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Lr(r);return i<0&&(i=CN(n+i,0)),yo(t,e,i)}var Hu=wN;var kN="[object Map]",TN="[object Set]",_N=Object.prototype,SN=_N.hasOwnProperty;function vN(t){if(t==null)return!0;if(dt(t)&&(J(t)||typeof t=="string"||typeof t.splice=="function"||sn(t)||Co(t)||Dn(t)))return!t.length;var e=Ar(t);if(e==kN||e==TN)return!t.size;if(jr(t))return!Su(t).length;for(var r in t)if(SN.call(t,r))return!1;return!0}var Te=vN;var IN="[object RegExp]";function ON(t){return at(t)&&Mt(t)==IN}var iE=ON;var oE=mr&&mr.isRegExp,DN=oE?Ur(oE):iE,gr=DN;function RN(t){return t===void 0}var Ft=RN;var FN="Expected a function";function NN(t){if(typeof t!="function")throw new TypeError(FN);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}var sE=NN;function PN(t,e,r,n){if(!Ze(t))return t;e=Mn(e,t);for(var i=-1,o=e.length,s=o-1,a=t;a!=null&&++i<o;){var u=zr(e[i]),l=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(i!=s){var c=a[u];l=n?n(c,u,a):void 0,l===void 0&&(l=Ze(c)?c:vn(e[i+1])?[]:{})}In(a,u,l),a=a[u]}return t}var aE=PN;function LN(t,e,r){for(var n=-1,i=e.length,o={};++n<i;){var s=e[n],a=So(t,s);r(a,s)&&aE(o,Mn(s,t),a)}return o}var uE=LN;function MN(t,e){if(t==null)return{};var r=Pr(Fu(t),function(n){return[n]});return e=ht(e),uE(t,r,function(n,i){return e(n,i[0])})}var Ht=MN;function BN(t,e,r,n,i){return i(t,function(o,s,a){r=n?(n=!1,o):e(r,o,s,a)}),r}var lE=BN;function jN(t,e,r){var n=J(t)?Py:lE,i=arguments.length<3;return n(t,ht(e,4),r,i,Wt)}var mt=jN;function UN(t,e){var r=J(t)?Do:Wu;return r(t,sE(ht(e,3)))}var zn=UN;function zN(t,e){var r;return Wt(t,function(n,i,o){return r=e(n,i,o),!r}),!!r}var cE=zN;function $N(t,e,r){var n=J(t)?Bu:cE;return r&&On(t,e,r)&&(e=void 0),n(t,ht(e,3))}var Ds=$N;var qN=1/0,VN=jn&&1/Mo(new jn([,-0]))[1]==qN?function(t){return new jn(t)}:Xe,fE=VN;var GN=200;function WN(t,e,r){var n=-1,i=ku,o=t.length,s=!0,a=[],u=a;if(r)s=!1,i=Gu;else if(o>=GN){var l=e?null:fE(t);if(l)return Mo(l);s=!1,i=Lo,u=new Po}else u=e?[]:a;e:for(;++n<o;){var c=t[n],f=e?e(c):c;if(c=r||c!==0?c:0,s&&f===f){for(var p=u.length;p--;)if(u[p]===f)continue e;e&&u.push(f),a.push(c)}else i(u,f,r)||(u!==a&&u.push(f),a.push(c))}return a}var pE=WN;function HN(t){return t&&t.length?pE(t):[]}var jo=HN;function Uo(t){console&&console.error&&console.error(`Error: ${t}`)}function Rs(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function Fs(t){let e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function Ns(t){function e(){}e.prototype=t;let r=new e;function n(){return typeof r.bar}return n(),n(),t;(0,eval)(t)}function KN(t){return YN(t)?t.LABEL:t.name}function YN(t){return Et(t.LABEL)&&t.LABEL!==""}var ir=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),G(this.definition,r=>{r.accept(e)})}},Be=class extends ir{constructor(e){super([]),this.idx=1,_t(this,Ht(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},Ut=class extends ir{constructor(e){super(e.definition),this.orgText="",_t(this,Ht(e,r=>r!==void 0))}},je=class extends ir{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,_t(this,Ht(e,r=>r!==void 0))}},Ge=class extends ir{constructor(e){super(e.definition),this.idx=1,_t(this,Ht(e,r=>r!==void 0))}},lt=class extends ir{constructor(e){super(e.definition),this.idx=1,_t(this,Ht(e,r=>r!==void 0))}},ct=class extends ir{constructor(e){super(e.definition),this.idx=1,_t(this,Ht(e,r=>r!==void 0))}},De=class extends ir{constructor(e){super(e.definition),this.idx=1,_t(this,Ht(e,r=>r!==void 0))}},rt=class extends ir{constructor(e){super(e.definition),this.idx=1,_t(this,Ht(e,r=>r!==void 0))}},nt=class extends ir{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,_t(this,Ht(e,r=>r!==void 0))}},Ie=class{constructor(e){this.idx=1,_t(this,Ht(e,r=>r!==void 0))}accept(e){e.visit(this)}};function Ku(t){return q(t,zo)}function zo(t){function e(r){return q(r,zo)}if(t instanceof Be){let r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return Et(t.label)&&(r.label=t.label),r}else{if(t instanceof je)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Ge)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof lt)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof ct)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:zo(new Ie({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof rt)return{type:"RepetitionWithSeparator",idx:t.idx,separator:zo(new Ie({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof De)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof nt)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Ie){let r={type:"Terminal",name:t.terminalType.name,label:KN(t.terminalType),idx:t.idx};Et(t.label)&&(r.terminalLabel=t.label);let n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=gr(n)?n.source:n),r}else{if(t instanceof Ut)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}var zt=class{visit(e){let r=e;switch(r.constructor){case Be:return this.visitNonTerminal(r);case je:return this.visitAlternative(r);case Ge:return this.visitOption(r);case lt:return this.visitRepetitionMandatory(r);case ct:return this.visitRepetitionMandatoryWithSeparator(r);case rt:return this.visitRepetitionWithSeparator(r);case De:return this.visitRepetition(r);case nt:return this.visitAlternation(r);case Ie:return this.visitTerminal(r);case Ut:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function gp(t){return t instanceof je||t instanceof Ge||t instanceof De||t instanceof lt||t instanceof ct||t instanceof rt||t instanceof Ie||t instanceof Ut}function Fi(t,e=[]){return t instanceof Ge||t instanceof De||t instanceof rt?!0:t instanceof nt?Ds(t.definition,n=>Fi(n,e)):t instanceof Be&&He(e,t)?!1:t instanceof ir?(t instanceof Be&&e.push(t),Dt(t.definition,n=>Fi(n,e))):!1}function xp(t){return t instanceof nt}function Kt(t){if(t instanceof Be)return"SUBRULE";if(t instanceof Ge)return"OPTION";if(t instanceof nt)return"OR";if(t instanceof lt)return"AT_LEAST_ONE";if(t instanceof ct)return"AT_LEAST_ONE_SEP";if(t instanceof rt)return"MANY_SEP";if(t instanceof De)return"MANY";if(t instanceof Ie)return"CONSUME";throw Error("non exhaustive match")}var ln=class{walk(e,r=[]){G(e.definition,(n,i)=>{let o=ut(e.definition,i+1);if(n instanceof Be)this.walkProdRef(n,o,r);else if(n instanceof Ie)this.walkTerminal(n,o,r);else if(n instanceof je)this.walkFlat(n,o,r);else if(n instanceof Ge)this.walkOption(n,o,r);else if(n instanceof lt)this.walkAtLeastOne(n,o,r);else if(n instanceof ct)this.walkAtLeastOneSep(n,o,r);else if(n instanceof rt)this.walkManySep(n,o,r);else if(n instanceof De)this.walkMany(n,o,r);else if(n instanceof nt)this.walkOr(n,o,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){let i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){let i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){let i=[new Ge({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){let i=dE(e,r,n);this.walk(e,i)}walkMany(e,r,n){let i=[new Ge({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){let i=dE(e,r,n);this.walk(e,i)}walkOr(e,r,n){let i=r.concat(n);G(e.definition,o=>{let s=new je({definition:[o]});this.walk(s,i)})}};function dE(t,e,r){return[new Ge({definition:[new Ie({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function Ni(t){if(t instanceof Be)return Ni(t.referencedRule);if(t instanceof Ie)return JN(t);if(gp(t))return ZN(t);if(xp(t))return XN(t);throw Error("non exhaustive match")}function ZN(t){let e=[],r=t.definition,n=0,i=r.length>n,o,s=!0;for(;i&&s;)o=r[n],s=Fi(o),e=e.concat(Ni(o)),n=n+1,i=r.length>n;return jo(e)}function XN(t){let e=q(t.definition,r=>Ni(r));return jo(bt(e))}function JN(t){return[t.terminalType]}var Yu="_~IN~_";var yp=class extends ln{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){let i=QN(e.referencedRule,e.idx)+this.topProd.name,o=r.concat(n),s=new je({definition:o}),a=Ni(s);this.follows[i]=a}};function hE(t){let e={};return G(t,r=>{let n=new yp(r).startWalking();_t(e,n)}),e}function QN(t,e){return t.name+e+Yu}function ue(t){return t.charCodeAt(0)}function Zu(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function $o(t,e){if(t[e]===!0)throw"duplicate flag "+e;let r=t[e];t[e]=!0}function Pi(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function Ps(){throw Error("Internal Error - Should never get here!")}function bp(t){return t.type==="Character"}var Ls=[];for(let t=ue("0");t<=ue("9");t++)Ls.push(t);var Ms=[ue("_")].concat(Ls);for(let t=ue("a");t<=ue("z");t++)Ms.push(t);for(let t=ue("A");t<=ue("Z");t++)Ms.push(t);var Ep=[ue(" "),ue("\f"),ue(`
119
- `),ue("\r"),ue(" "),ue("\v"),ue(" "),ue("\xA0"),ue("\u1680"),ue("\u2000"),ue("\u2001"),ue("\u2002"),ue("\u2003"),ue("\u2004"),ue("\u2005"),ue("\u2006"),ue("\u2007"),ue("\u2008"),ue("\u2009"),ue("\u200A"),ue("\u2028"),ue("\u2029"),ue("\u202F"),ue("\u205F"),ue("\u3000"),ue("\uFEFF")];var eP=/[0-9a-fA-F]/,Xu=/[0-9]/,tP=/[1-9]/,Bs=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");let r=this.disjunction();this.consumeChar("/");let n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":$o(n,"global");break;case"i":$o(n,"ignoreCase");break;case"m":$o(n,"multiLine");break;case"u":$o(n,"unicode");break;case"y":$o(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){let e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){let e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break}Pi(r);let n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return Ps()}quantifier(e=!1){let r,n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":let i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let o;this.isDigit()?(o=this.integerIncludingZero(),r={atLeast:i,atMost:o}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;Pi(r);break}if(!(e===!0&&r===void 0)&&Pi(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e,r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Pi(e)?(e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):Ps()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ue(`
120
- `),ue("\r"),ue("\u2028"),ue("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=Ls;break;case"D":e=Ls,r=!0;break;case"s":e=Ep;break;case"S":e=Ep,r=!0;break;case"w":e=Ms;break;case"W":e=Ms,r=!0;break}return Pi(e)?{type:"Set",value:e,complement:r}:Ps()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=ue("\f");break;case"n":e=ue(`
121
- `);break;case"r":e=ue("\r");break;case"t":e=ue(" ");break;case"v":e=ue("\v");break}return Pi(e)?{type:"Character",value:e}:Ps()}controlLetterEscapeAtom(){this.consumeChar("c");let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:ue("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){let e=this.popChar();return{type:"Character",value:ue(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
122
- `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let e=this.popChar();return{type:"Character",value:ue(e)}}}characterClass(){let e=[],r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){let n=this.classAtom(),i=n.type==="Character";if(bp(n)&&this.isRangeDash()){this.consumeChar("-");let o=this.classAtom(),s=o.type==="Character";if(bp(o)){if(o.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:o.value})}else Zu(n.value,e),e.push(ue("-")),Zu(o.value,e)}else Zu(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
123
- `:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:ue("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}let r=this.disjunction();this.consumeChar(")");let n={type:"Group",capturing:e,value:r};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(tP.test(e)===!1)throw Error("Expecting a positive integer");for(;Xu.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Xu.test(e)===!1)throw Error("Expecting an integer");for(;Xu.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`
124
- `:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:ue(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return Xu.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
114
+ `;return n}function jv(t){let e=[],r=t[0]?.length||0;for(let n=0;n<r;n++){let i=!0;for(let o of t)if(o[n]!==""){i=!1;break}i&&e.push(n)}return e}import{log as pd}from"remark-mdat";var Uv=typeof global=="object"&&global&&global.Object===Object&&global,gu=Uv;var zv=typeof self=="object"&&self&&self.Object===Object&&self,$v=gu||zv||Function("return this")(),ct=$v;var qv=ct.Symbol,At=qv;var ox=Object.prototype,Vv=ox.hasOwnProperty,Gv=ox.toString,ws=At?At.toStringTag:void 0;function Wv(t){var e=Vv.call(t,ws),r=t[ws];try{t[ws]=void 0;var n=!0}catch{}var i=Gv.call(t);return n&&(e?t[ws]=r:delete t[ws]),i}var sx=Wv;var Hv=Object.prototype,Kv=Hv.toString;function Yv(t){return Kv.call(t)}var ax=Yv;var Zv="[object Null]",Xv="[object Undefined]",ux=At?At.toStringTag:void 0;function Jv(t){return t==null?t===void 0?Xv:Zv:ux&&ux in Object(t)?sx(t):ax(t)}var Nt=Jv;function Qv(t){return t!=null&&typeof t=="object"}var ot=Qv;var e0="[object Symbol]";function t0(t){return typeof t=="symbol"||ot(t)&&Nt(t)==e0}var Cn=t0;function r0(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var Or=r0;var n0=Array.isArray,J=n0;var i0=1/0,lx=At?At.prototype:void 0,cx=lx?lx.toString:void 0;function fx(t){if(typeof t=="string")return t;if(J(t))return Or(t,fx)+"";if(Cn(t))return cx?cx.call(t):"";var e=t+"";return e=="0"&&1/t==-i0?"-0":e}var px=fx;var o0=/\s/;function s0(t){for(var e=t.length;e--&&o0.test(t.charAt(e)););return e}var dx=s0;var a0=/^\s+/;function u0(t){return t&&t.slice(0,dx(t)+1).replace(a0,"")}var hx=u0;function l0(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ye=l0;var mx=NaN,c0=/^[-+]0x[0-9a-f]+$/i,f0=/^0b[01]+$/i,p0=/^0o[0-7]+$/i,d0=parseInt;function h0(t){if(typeof t=="number")return t;if(Cn(t))return mx;if(Ye(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ye(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=hx(t);var r=f0.test(t);return r||p0.test(t)?d0(t.slice(2),r?2:8):c0.test(t)?mx:+t}var gx=h0;var xx=1/0,m0=17976931348623157e292;function g0(t){if(!t)return t===0?t:0;if(t=gx(t),t===xx||t===-xx){var e=t<0?-1:1;return e*m0}return t===t?t:0}var yx=g0;function x0(t){var e=yx(t),r=e%1;return e===e?r?e-r:e:0}var Dr=x0;function y0(t){return t}var cr=y0;var b0="[object AsyncFunction]",E0="[object Function]",A0="[object GeneratorFunction]",w0="[object Proxy]";function C0(t){if(!Ye(t))return!1;var e=Nt(t);return e==E0||e==A0||e==b0||e==w0}var Pt=C0;var k0=ct["__core-js_shared__"],xu=k0;var bx=function(){var t=/[^.]+$/.exec(xu&&xu.keys&&xu.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function T0(t){return!!bx&&bx in t}var Ex=T0;var _0=Function.prototype,S0=_0.toString;function v0(t){if(t!=null){try{return S0.call(t)}catch{}try{return t+""}catch{}}return""}var en=v0;var I0=/[\\^$.*+?()[\]{}|]/g,O0=/^\[object .+?Constructor\]$/,D0=Function.prototype,R0=Object.prototype,F0=D0.toString,N0=R0.hasOwnProperty,P0=RegExp("^"+F0.call(N0).replace(I0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function L0(t){if(!Ye(t)||Ex(t))return!1;var e=Pt(t)?P0:O0;return e.test(en(t))}var Ax=L0;function M0(t,e){return t?.[e]}var wx=M0;function B0(t,e){var r=wx(t,e);return Ax(r)?r:void 0}var $t=B0;var j0=$t(ct,"WeakMap"),yu=j0;var Cx=Object.create,U0=function(){function t(){}return function(e){if(!Ye(e))return{};if(Cx)return Cx(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),kx=U0;function z0(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var Tx=z0;function $0(){}var Ze=$0;function q0(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var _x=q0;var V0=800,G0=16,W0=Date.now;function H0(t){var e=0,r=0;return function(){var n=W0(),i=G0-(n-r);if(r=n,i>0){if(++e>=V0)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Sx=H0;function K0(t){return function(){return t}}var vx=K0;var Y0=function(){try{var t=$t(Object,"defineProperty");return t({},"",{}),t}catch{}}(),co=Y0;var Z0=co?function(t,e){return co(t,"toString",{configurable:!0,enumerable:!1,value:vx(e),writable:!0})}:cr,Ix=Z0;var X0=Sx(Ix),Ox=X0;function J0(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var bu=J0;function Q0(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}var Eu=Q0;function eI(t){return t!==t}var Dx=eI;function tI(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}var Rx=tI;function rI(t,e,r){return e===e?Rx(t,e,r):Eu(t,Dx,r)}var fo=rI;function nI(t,e){var r=t==null?0:t.length;return!!r&&fo(t,e,0)>-1}var Au=nI;var iI=9007199254740991,oI=/^(?:0|[1-9]\d*)$/;function sI(t,e){var r=typeof t;return e=e??iI,!!e&&(r=="number"||r!="symbol"&&oI.test(t))&&t>-1&&t%1==0&&t<e}var kn=sI;function aI(t,e,r){e=="__proto__"&&co?co(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var po=aI;function uI(t,e){return t===e||t!==t&&e!==e}var Rr=uI;var lI=Object.prototype,cI=lI.hasOwnProperty;function fI(t,e,r){var n=t[e];(!(cI.call(t,e)&&Rr(n,r))||r===void 0&&!(e in t))&&po(t,e,r)}var Tn=fI;function pI(t,e,r,n){var i=!r;r||(r={});for(var o=-1,s=e.length;++o<s;){var a=e[o],u=n?n(r[a],t[a],a,r,t):void 0;u===void 0&&(u=t[a]),i?po(r,a,u):Tn(r,a,u)}return r}var Fr=pI;var Fx=Math.max;function dI(t,e,r){return e=Fx(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=Fx(n.length-e,0),s=Array(o);++i<o;)s[i]=n[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=n[i];return a[e]=r(s),Tx(t,this,a)}}var Nx=dI;function hI(t,e){return Ox(Nx(t,e,cr),t+"")}var ho=hI;var mI=9007199254740991;function gI(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=mI}var mo=gI;function xI(t){return t!=null&&mo(t.length)&&!Pt(t)}var ft=xI;function yI(t,e,r){if(!Ye(r))return!1;var n=typeof e;return(n=="number"?ft(r)&&kn(e,r.length):n=="string"&&e in r)?Rr(r[e],t):!1}var _n=yI;function bI(t){return ho(function(e,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,s&&_n(r[0],r[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++n<i;){var a=r[n];a&&t(e,a,n,o)}return e})}var Px=bI;var EI=Object.prototype;function AI(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||EI;return t===r}var Nr=AI;function wI(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Lx=wI;var CI="[object Arguments]";function kI(t){return ot(t)&&Nt(t)==CI}var rp=kI;var Mx=Object.prototype,TI=Mx.hasOwnProperty,_I=Mx.propertyIsEnumerable,SI=rp(function(){return arguments}())?rp:function(t){return ot(t)&&TI.call(t,"callee")&&!_I.call(t,"callee")},Sn=SI;function vI(){return!1}var Bx=vI;var zx=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jx=zx&&typeof module=="object"&&module&&!module.nodeType&&module,II=jx&&jx.exports===zx,Ux=II?ct.Buffer:void 0,OI=Ux?Ux.isBuffer:void 0,DI=OI||Bx,tn=DI;var RI="[object Arguments]",FI="[object Array]",NI="[object Boolean]",PI="[object Date]",LI="[object Error]",MI="[object Function]",BI="[object Map]",jI="[object Number]",UI="[object Object]",zI="[object RegExp]",$I="[object Set]",qI="[object String]",VI="[object WeakMap]",GI="[object ArrayBuffer]",WI="[object DataView]",HI="[object Float32Array]",KI="[object Float64Array]",YI="[object Int8Array]",ZI="[object Int16Array]",XI="[object Int32Array]",JI="[object Uint8Array]",QI="[object Uint8ClampedArray]",eO="[object Uint16Array]",tO="[object Uint32Array]",Ve={};Ve[HI]=Ve[KI]=Ve[YI]=Ve[ZI]=Ve[XI]=Ve[JI]=Ve[QI]=Ve[eO]=Ve[tO]=!0;Ve[RI]=Ve[FI]=Ve[GI]=Ve[NI]=Ve[WI]=Ve[PI]=Ve[LI]=Ve[MI]=Ve[BI]=Ve[jI]=Ve[UI]=Ve[zI]=Ve[$I]=Ve[qI]=Ve[VI]=!1;function rO(t){return ot(t)&&mo(t.length)&&!!Ve[Nt(t)]}var $x=rO;function nO(t){return function(e){return t(e)}}var Pr=nO;var qx=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Cs=qx&&typeof module=="object"&&module&&!module.nodeType&&module,iO=Cs&&Cs.exports===qx,np=iO&&gu.process,oO=function(){try{var t=Cs&&Cs.require&&Cs.require("util").types;return t||np&&np.binding&&np.binding("util")}catch{}}(),fr=oO;var Vx=fr&&fr.isTypedArray,sO=Vx?Pr(Vx):$x,go=sO;var aO=Object.prototype,uO=aO.hasOwnProperty;function lO(t,e){var r=J(t),n=!r&&Sn(t),i=!r&&!n&&tn(t),o=!r&&!n&&!i&&go(t),s=r||n||i||o,a=s?Lx(t.length,String):[],u=a.length;for(var l in t)(e||uO.call(t,l))&&!(s&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||kn(l,u)))&&a.push(l);return a}var wu=lO;function cO(t,e){return function(r){return t(e(r))}}var Cu=cO;var fO=Cu(Object.keys,Object),Gx=fO;var pO=Object.prototype,dO=pO.hasOwnProperty;function hO(t){if(!Nr(t))return Gx(t);var e=[];for(var r in Object(t))dO.call(t,r)&&r!="constructor"&&e.push(r);return e}var ku=hO;function mO(t){return ft(t)?wu(t):ku(t)}var Pe=mO;var gO=Object.prototype,xO=gO.hasOwnProperty,yO=Px(function(t,e){if(Nr(e)||ft(e)){Fr(e,Pe(e),t);return}for(var r in e)xO.call(e,r)&&Tn(t,r,e[r])}),kt=yO;function bO(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Wx=bO;var EO=Object.prototype,AO=EO.hasOwnProperty;function wO(t){if(!Ye(t))return Wx(t);var e=Nr(t),r=[];for(var n in t)n=="constructor"&&(e||!AO.call(t,n))||r.push(n);return r}var Hx=wO;function CO(t){return ft(t)?wu(t,!0):Hx(t)}var vn=CO;var kO=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,TO=/^\w*$/;function _O(t,e){if(J(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Cn(t)?!0:TO.test(t)||!kO.test(t)||e!=null&&t in Object(e)}var xo=_O;var SO=$t(Object,"create"),rn=SO;function vO(){this.__data__=rn?rn(null):{},this.size=0}var Kx=vO;function IO(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Yx=IO;var OO="__lodash_hash_undefined__",DO=Object.prototype,RO=DO.hasOwnProperty;function FO(t){var e=this.__data__;if(rn){var r=e[t];return r===OO?void 0:r}return RO.call(e,t)?e[t]:void 0}var Zx=FO;var NO=Object.prototype,PO=NO.hasOwnProperty;function LO(t){var e=this.__data__;return rn?e[t]!==void 0:PO.call(e,t)}var Xx=LO;var MO="__lodash_hash_undefined__";function BO(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=rn&&e===void 0?MO:e,this}var Jx=BO;function yo(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}yo.prototype.clear=Kx;yo.prototype.delete=Yx;yo.prototype.get=Zx;yo.prototype.has=Xx;yo.prototype.set=Jx;var ip=yo;function jO(){this.__data__=[],this.size=0}var Qx=jO;function UO(t,e){for(var r=t.length;r--;)if(Rr(t[r][0],e))return r;return-1}var In=UO;var zO=Array.prototype,$O=zO.splice;function qO(t){var e=this.__data__,r=In(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():$O.call(e,r,1),--this.size,!0}var ey=qO;function VO(t){var e=this.__data__,r=In(e,t);return r<0?void 0:e[r][1]}var ty=VO;function GO(t){return In(this.__data__,t)>-1}var ry=GO;function WO(t,e){var r=this.__data__,n=In(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var ny=WO;function bo(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}bo.prototype.clear=Qx;bo.prototype.delete=ey;bo.prototype.get=ty;bo.prototype.has=ry;bo.prototype.set=ny;var On=bo;var HO=$t(ct,"Map"),Dn=HO;function KO(){this.size=0,this.__data__={hash:new ip,map:new(Dn||On),string:new ip}}var iy=KO;function YO(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var oy=YO;function ZO(t,e){var r=t.__data__;return oy(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Rn=ZO;function XO(t){var e=Rn(this,t).delete(t);return this.size-=e?1:0,e}var sy=XO;function JO(t){return Rn(this,t).get(t)}var ay=JO;function QO(t){return Rn(this,t).has(t)}var uy=QO;function e1(t,e){var r=Rn(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var ly=e1;function Eo(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Eo.prototype.clear=iy;Eo.prototype.delete=sy;Eo.prototype.get=ay;Eo.prototype.has=uy;Eo.prototype.set=ly;var Si=Eo;var t1="Expected a function";function op(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(t1);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(op.Cache||Si),r}op.Cache=Si;var cy=op;var r1=500;function n1(t){var e=cy(t,function(n){return r.size===r1&&r.clear(),n}),r=e.cache;return e}var fy=n1;var i1=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o1=/\\(\\)?/g,s1=fy(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(i1,function(r,n,i,o){e.push(i?o.replace(o1,"$1"):n||r)}),e}),py=s1;function a1(t){return t==null?"":px(t)}var dy=a1;function u1(t,e){return J(t)?t:xo(t,e)?[t]:py(dy(t))}var Fn=u1;var l1=1/0;function c1(t){if(typeof t=="string"||Cn(t))return t;var e=t+"";return e=="0"&&1/t==-l1?"-0":e}var Lr=c1;function f1(t,e){e=Fn(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Lr(e[r++])];return r&&r==n?t:void 0}var Ao=f1;function p1(t,e,r){var n=t==null?void 0:Ao(t,e);return n===void 0?r:n}var hy=p1;function d1(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var wo=d1;var my=At?At.isConcatSpreadable:void 0;function h1(t){return J(t)||Sn(t)||!!(my&&t&&t[my])}var gy=h1;function xy(t,e,r,n,i){var o=-1,s=t.length;for(r||(r=gy),i||(i=[]);++o<s;){var a=t[o];e>0&&r(a)?e>1?xy(a,e-1,r,n,i):wo(i,a):n||(i[i.length]=a)}return i}var Co=xy;function m1(t){var e=t==null?0:t.length;return e?Co(t,1):[]}var xt=m1;var g1=Cu(Object.getPrototypeOf,Object),Tu=g1;function x1(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}var _u=x1;function y1(t,e,r,n){var i=-1,o=t==null?0:t.length;for(n&&o&&(r=t[++i]);++i<o;)r=e(r,t[i],i,t);return r}var yy=y1;function b1(){this.__data__=new On,this.size=0}var by=b1;function E1(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var Ey=E1;function A1(t){return this.__data__.get(t)}var Ay=A1;function w1(t){return this.__data__.has(t)}var wy=w1;var C1=200;function k1(t,e){var r=this.__data__;if(r instanceof On){var n=r.__data__;if(!Dn||n.length<C1-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Si(n)}return r.set(t,e),this.size=r.size,this}var Cy=k1;function ko(t){var e=this.__data__=new On(t);this.size=e.size}ko.prototype.clear=by;ko.prototype.delete=Ey;ko.prototype.get=Ay;ko.prototype.has=wy;ko.prototype.set=Cy;var Nn=ko;function T1(t,e){return t&&Fr(e,Pe(e),t)}var ky=T1;function _1(t,e){return t&&Fr(e,vn(e),t)}var Ty=_1;var Iy=typeof exports=="object"&&exports&&!exports.nodeType&&exports,_y=Iy&&typeof module=="object"&&module&&!module.nodeType&&module,S1=_y&&_y.exports===Iy,Sy=S1?ct.Buffer:void 0,vy=Sy?Sy.allocUnsafe:void 0;function v1(t,e){if(e)return t.slice();var r=t.length,n=vy?vy(r):new t.constructor(r);return t.copy(n),n}var Oy=v1;function I1(t,e){for(var r=-1,n=t==null?0:t.length,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}var To=I1;function O1(){return[]}var Su=O1;var D1=Object.prototype,R1=D1.propertyIsEnumerable,Dy=Object.getOwnPropertySymbols,F1=Dy?function(t){return t==null?[]:(t=Object(t),To(Dy(t),function(e){return R1.call(t,e)}))}:Su,_o=F1;function N1(t,e){return Fr(t,_o(t),e)}var Ry=N1;var P1=Object.getOwnPropertySymbols,L1=P1?function(t){for(var e=[];t;)wo(e,_o(t)),t=Tu(t);return e}:Su,vu=L1;function M1(t,e){return Fr(t,vu(t),e)}var Fy=M1;function B1(t,e,r){var n=e(t);return J(t)?n:wo(n,r(t))}var Iu=B1;function j1(t){return Iu(t,Pe,_o)}var ks=j1;function U1(t){return Iu(t,vn,vu)}var Ou=U1;var z1=$t(ct,"DataView"),Du=z1;var $1=$t(ct,"Promise"),Ru=$1;var q1=$t(ct,"Set"),Pn=q1;var Ny="[object Map]",V1="[object Object]",Py="[object Promise]",Ly="[object Set]",My="[object WeakMap]",By="[object DataView]",G1=en(Du),W1=en(Dn),H1=en(Ru),K1=en(Pn),Y1=en(yu),vi=Nt;(Du&&vi(new Du(new ArrayBuffer(1)))!=By||Dn&&vi(new Dn)!=Ny||Ru&&vi(Ru.resolve())!=Py||Pn&&vi(new Pn)!=Ly||yu&&vi(new yu)!=My)&&(vi=function(t){var e=Nt(t),r=e==V1?t.constructor:void 0,n=r?en(r):"";if(n)switch(n){case G1:return By;case W1:return Ny;case H1:return Py;case K1:return Ly;case Y1:return My}return e});var gr=vi;var Z1=Object.prototype,X1=Z1.hasOwnProperty;function J1(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&X1.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var jy=J1;var Q1=ct.Uint8Array,So=Q1;function eD(t){var e=new t.constructor(t.byteLength);return new So(e).set(new So(t)),e}var vo=eD;function tD(t,e){var r=e?vo(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Uy=tD;var rD=/\w*$/;function nD(t){var e=new t.constructor(t.source,rD.exec(t));return e.lastIndex=t.lastIndex,e}var zy=nD;var $y=At?At.prototype:void 0,qy=$y?$y.valueOf:void 0;function iD(t){return qy?Object(qy.call(t)):{}}var Vy=iD;function oD(t,e){var r=e?vo(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Gy=oD;var sD="[object Boolean]",aD="[object Date]",uD="[object Map]",lD="[object Number]",cD="[object RegExp]",fD="[object Set]",pD="[object String]",dD="[object Symbol]",hD="[object ArrayBuffer]",mD="[object DataView]",gD="[object Float32Array]",xD="[object Float64Array]",yD="[object Int8Array]",bD="[object Int16Array]",ED="[object Int32Array]",AD="[object Uint8Array]",wD="[object Uint8ClampedArray]",CD="[object Uint16Array]",kD="[object Uint32Array]";function TD(t,e,r){var n=t.constructor;switch(e){case hD:return vo(t);case sD:case aD:return new n(+t);case mD:return Uy(t,r);case gD:case xD:case yD:case bD:case ED:case AD:case wD:case CD:case kD:return Gy(t,r);case uD:return new n;case lD:case pD:return new n(t);case cD:return zy(t);case fD:return new n;case dD:return Vy(t)}}var Wy=TD;function _D(t){return typeof t.constructor=="function"&&!Nr(t)?kx(Tu(t)):{}}var Hy=_D;var SD="[object Map]";function vD(t){return ot(t)&&gr(t)==SD}var Ky=vD;var Yy=fr&&fr.isMap,ID=Yy?Pr(Yy):Ky,Zy=ID;var OD="[object Set]";function DD(t){return ot(t)&&gr(t)==OD}var Xy=DD;var Jy=fr&&fr.isSet,RD=Jy?Pr(Jy):Xy,Qy=RD;var FD=1,ND=2,PD=4,eb="[object Arguments]",LD="[object Array]",MD="[object Boolean]",BD="[object Date]",jD="[object Error]",tb="[object Function]",UD="[object GeneratorFunction]",zD="[object Map]",$D="[object Number]",rb="[object Object]",qD="[object RegExp]",VD="[object Set]",GD="[object String]",WD="[object Symbol]",HD="[object WeakMap]",KD="[object ArrayBuffer]",YD="[object DataView]",ZD="[object Float32Array]",XD="[object Float64Array]",JD="[object Int8Array]",QD="[object Int16Array]",eR="[object Int32Array]",tR="[object Uint8Array]",rR="[object Uint8ClampedArray]",nR="[object Uint16Array]",iR="[object Uint32Array]",Le={};Le[eb]=Le[LD]=Le[KD]=Le[YD]=Le[MD]=Le[BD]=Le[ZD]=Le[XD]=Le[JD]=Le[QD]=Le[eR]=Le[zD]=Le[$D]=Le[rb]=Le[qD]=Le[VD]=Le[GD]=Le[WD]=Le[tR]=Le[rR]=Le[nR]=Le[iR]=!0;Le[jD]=Le[tb]=Le[HD]=!1;function Fu(t,e,r,n,i,o){var s,a=e&FD,u=e&ND,l=e&PD;if(r&&(s=i?r(t,n,i,o):r(t)),s!==void 0)return s;if(!Ye(t))return t;var c=J(t);if(c){if(s=jy(t),!a)return _x(t,s)}else{var f=gr(t),p=f==tb||f==UD;if(tn(t))return Oy(t,a);if(f==rb||f==eb||p&&!i){if(s=u||p?{}:Hy(t),!a)return u?Fy(t,Ty(s,t)):Ry(t,ky(s,t))}else{if(!Le[f])return i?t:{};s=Wy(t,f,a)}}o||(o=new Nn);var d=o.get(t);if(d)return d;o.set(t,s),Qy(t)?t.forEach(function(g){s.add(Fu(g,e,r,g,t,o))}):Zy(t)&&t.forEach(function(g,b){s.set(b,Fu(g,e,r,b,t,o))});var m=l?u?Ou:ks:u?vn:Pe,y=c?void 0:m(t);return bu(y||t,function(g,b){y&&(b=g,g=t[b]),Tn(s,b,Fu(g,e,r,b,t,o))}),s}var nb=Fu;var oR=4;function sR(t){return nb(t,oR)}var Me=sR;function aR(t){for(var e=-1,r=t==null?0:t.length,n=0,i=[];++e<r;){var o=t[e];o&&(i[n++]=o)}return i}var Mr=aR;var uR="__lodash_hash_undefined__";function lR(t){return this.__data__.set(t,uR),this}var ib=lR;function cR(t){return this.__data__.has(t)}var ob=cR;function Nu(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Si;++e<r;)this.add(t[e])}Nu.prototype.add=Nu.prototype.push=ib;Nu.prototype.has=ob;var Io=Nu;function fR(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var Pu=fR;function pR(t,e){return t.has(e)}var Oo=pR;var dR=1,hR=2;function mR(t,e,r,n,i,o){var s=r&dR,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var l=o.get(t),c=o.get(e);if(l&&c)return l==e&&c==t;var f=-1,p=!0,d=r&hR?new Io:void 0;for(o.set(t,e),o.set(e,t);++f<a;){var m=t[f],y=e[f];if(n)var g=s?n(y,m,f,e,t,o):n(m,y,f,t,e,o);if(g!==void 0){if(g)continue;p=!1;break}if(d){if(!Pu(e,function(b,C){if(!Oo(d,C)&&(m===b||i(m,b,r,n,o)))return d.push(C)})){p=!1;break}}else if(!(m===y||i(m,y,r,n,o))){p=!1;break}}return o.delete(t),o.delete(e),p}var Lu=mR;function gR(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}var sb=gR;function xR(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Do=xR;var yR=1,bR=2,ER="[object Boolean]",AR="[object Date]",wR="[object Error]",CR="[object Map]",kR="[object Number]",TR="[object RegExp]",_R="[object Set]",SR="[object String]",vR="[object Symbol]",IR="[object ArrayBuffer]",OR="[object DataView]",ab=At?At.prototype:void 0,sp=ab?ab.valueOf:void 0;function DR(t,e,r,n,i,o,s){switch(r){case OR:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case IR:return!(t.byteLength!=e.byteLength||!o(new So(t),new So(e)));case ER:case AR:case kR:return Rr(+t,+e);case wR:return t.name==e.name&&t.message==e.message;case TR:case SR:return t==e+"";case CR:var a=sb;case _R:var u=n&yR;if(a||(a=Do),t.size!=e.size&&!u)return!1;var l=s.get(t);if(l)return l==e;n|=bR,s.set(t,e);var c=Lu(a(t),a(e),n,i,o,s);return s.delete(t),c;case vR:if(sp)return sp.call(t)==sp.call(e)}return!1}var ub=DR;var RR=1,FR=Object.prototype,NR=FR.hasOwnProperty;function PR(t,e,r,n,i,o){var s=r&RR,a=ks(t),u=a.length,l=ks(e),c=l.length;if(u!=c&&!s)return!1;for(var f=u;f--;){var p=a[f];if(!(s?p in e:NR.call(e,p)))return!1}var d=o.get(t),m=o.get(e);if(d&&m)return d==e&&m==t;var y=!0;o.set(t,e),o.set(e,t);for(var g=s;++f<u;){p=a[f];var b=t[p],C=e[p];if(n)var w=s?n(C,b,p,e,t,o):n(b,C,p,t,e,o);if(!(w===void 0?b===C||i(b,C,r,n,o):w)){y=!1;break}g||(g=p=="constructor")}if(y&&!g){var D=t.constructor,R=e.constructor;D!=R&&"constructor"in t&&"constructor"in e&&!(typeof D=="function"&&D instanceof D&&typeof R=="function"&&R instanceof R)&&(y=!1)}return o.delete(t),o.delete(e),y}var lb=PR;var LR=1,cb="[object Arguments]",fb="[object Array]",Mu="[object Object]",MR=Object.prototype,pb=MR.hasOwnProperty;function BR(t,e,r,n,i,o){var s=J(t),a=J(e),u=s?fb:gr(t),l=a?fb:gr(e);u=u==cb?Mu:u,l=l==cb?Mu:l;var c=u==Mu,f=l==Mu,p=u==l;if(p&&tn(t)){if(!tn(e))return!1;s=!0,c=!1}if(p&&!c)return o||(o=new Nn),s||go(t)?Lu(t,e,r,n,i,o):ub(t,e,u,r,n,i,o);if(!(r&LR)){var d=c&&pb.call(t,"__wrapped__"),m=f&&pb.call(e,"__wrapped__");if(d||m){var y=d?t.value():t,g=m?e.value():e;return o||(o=new Nn),i(y,g,r,n,o)}}return p?(o||(o=new Nn),lb(t,e,r,n,i,o)):!1}var db=BR;function hb(t,e,r,n,i){return t===e?!0:t==null||e==null||!ot(t)&&!ot(e)?t!==t&&e!==e:db(t,e,r,n,hb,i)}var Bu=hb;var jR=1,UR=2;function zR(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=r[i];var u=a[0],l=t[u],c=a[1];if(s&&a[2]){if(l===void 0&&!(u in t))return!1}else{var f=new Nn;if(n)var p=n(l,c,u,t,e,f);if(!(p===void 0?Bu(c,l,jR|UR,n,f):p))return!1}}return!0}var mb=zR;function $R(t){return t===t&&!Ye(t)}var ju=$R;function qR(t){for(var e=Pe(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,ju(i)]}return e}var gb=qR;function VR(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var Uu=VR;function GR(t){var e=gb(t);return e.length==1&&e[0][2]?Uu(e[0][0],e[0][1]):function(r){return r===t||mb(r,t,e)}}var xb=GR;function WR(t,e){return t!=null&&e in Object(t)}var yb=WR;function HR(t,e,r){e=Fn(e,t);for(var n=-1,i=e.length,o=!1;++n<i;){var s=Lr(e[n]);if(!(o=t!=null&&r(t,s)))break;t=t[s]}return o||++n!=i?o:(i=t==null?0:t.length,!!i&&mo(i)&&kn(s,i)&&(J(t)||Sn(t)))}var zu=HR;function KR(t,e){return t!=null&&zu(t,e,yb)}var bb=KR;var YR=1,ZR=2;function XR(t,e){return xo(t)&&ju(e)?Uu(Lr(t),e):function(r){var n=hy(r,t);return n===void 0&&n===e?bb(r,t):Bu(e,n,YR|ZR)}}var Eb=XR;function JR(t){return function(e){return e?.[t]}}var Ab=JR;function QR(t){return function(e){return Ao(e,t)}}var wb=QR;function eF(t){return xo(t)?Ab(Lr(t)):wb(t)}var Cb=eF;function tF(t){return typeof t=="function"?t:t==null?cr:typeof t=="object"?J(t)?Eb(t[0],t[1]):xb(t):Cb(t)}var pt=tF;function rF(t,e,r,n){for(var i=-1,o=t==null?0:t.length;++i<o;){var s=t[i];e(n,s,r(s),t)}return n}var kb=rF;function nF(t){return function(e,r,n){for(var i=-1,o=Object(e),s=n(e),a=s.length;a--;){var u=s[t?a:++i];if(r(o[u],u,o)===!1)break}return e}}var Tb=nF;var iF=Tb(),_b=iF;function oF(t,e){return t&&_b(t,e,Pe)}var Sb=oF;function sF(t,e){return function(r,n){if(r==null)return r;if(!ft(r))return t(r,n);for(var i=r.length,o=e?i:-1,s=Object(r);(e?o--:++o<i)&&n(s[o],o,s)!==!1;);return r}}var vb=sF;var aF=vb(Sb),qt=aF;function uF(t,e,r,n){return qt(t,function(i,o,s){e(n,i,r(i),s)}),n}var Ib=uF;function lF(t,e){return function(r,n){var i=J(r)?kb:Ib,o=e?e():{};return i(r,t,pt(n,2),o)}}var Ob=lF;var Db=Object.prototype,cF=Db.hasOwnProperty,fF=ho(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&_n(e[0],e[1],i)&&(n=1);++r<n;)for(var o=e[r],s=vn(o),a=-1,u=s.length;++a<u;){var l=s[a],c=t[l];(c===void 0||Rr(c,Db[l])&&!cF.call(t,l))&&(t[l]=o[l])}return t}),Ro=fF;function pF(t){return ot(t)&&ft(t)}var ap=pF;function dF(t,e,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}var $u=dF;var hF=200;function mF(t,e,r,n){var i=-1,o=Au,s=!0,a=t.length,u=[],l=e.length;if(!a)return u;r&&(e=Or(e,Pr(r))),n?(o=$u,s=!1):e.length>=hF&&(o=Oo,s=!1,e=new Io(e));e:for(;++i<a;){var c=t[i],f=r==null?c:r(c);if(c=n||c!==0?c:0,s&&f===f){for(var p=l;p--;)if(e[p]===f)continue e;u.push(c)}else o(e,f,n)||u.push(c)}return u}var Rb=mF;var gF=ho(function(t,e){return ap(t)?Rb(t,Co(e,1,ap,!0)):[]}),Ln=gF;function xF(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var Br=xF;function yF(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:Dr(e),_u(t,e<0?0:e,n)):[]}var st=yF;function bF(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:Dr(e),e=n-e,_u(t,0,e<0?0:e)):[]}var nn=bF;function EF(t){return typeof t=="function"?t:cr}var Fb=EF;function AF(t,e){var r=J(t)?bu:qt;return r(t,Fb(e))}var G=AF;function wF(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}var Nb=wF;function CF(t,e){var r=!0;return qt(t,function(n,i,o){return r=!!e(n,i,o),r}),r}var Pb=CF;function kF(t,e,r){var n=J(t)?Nb:Pb;return r&&_n(t,e,r)&&(e=void 0),n(t,pt(e,3))}var vt=kF;function TF(t,e){var r=[];return qt(t,function(n,i,o){e(n,i,o)&&r.push(n)}),r}var qu=TF;function _F(t,e){var r=J(t)?To:qu;return r(t,pt(e,3))}var It=_F;function SF(t){return function(e,r,n){var i=Object(e);if(!ft(e)){var o=pt(r,3);e=Pe(e),r=function(a){return o(i[a],a,i)}}var s=t(e,r,n);return s>-1?i[o?e[s]:s]:void 0}}var Lb=SF;var vF=Math.max;function IF(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Dr(r);return i<0&&(i=vF(n+i,0)),Eu(t,pt(e,3),i)}var Mb=IF;var OF=Lb(Mb),jr=OF;function DF(t){return t&&t.length?t[0]:void 0}var wt=DF;function RF(t,e){var r=-1,n=ft(t)?Array(t.length):[];return qt(t,function(i,o,s){n[++r]=e(i,o,s)}),n}var Bb=RF;function FF(t,e){var r=J(t)?Or:Bb;return r(t,pt(e,3))}var q=FF;function NF(t,e){return Co(q(t,e),1)}var Lt=NF;var PF=Object.prototype,LF=PF.hasOwnProperty,MF=Ob(function(t,e,r){LF.call(t,r)?t[r].push(e):po(t,r,[e])}),up=MF;var BF=Object.prototype,jF=BF.hasOwnProperty;function UF(t,e){return t!=null&&jF.call(t,e)}var jb=UF;function zF(t,e){return t!=null&&zu(t,e,jb)}var Z=zF;var $F="[object String]";function qF(t){return typeof t=="string"||!J(t)&&ot(t)&&Nt(t)==$F}var yt=qF;function VF(t,e){return Or(e,function(r){return t[r]})}var Ub=VF;function GF(t){return t==null?[]:Ub(t,Pe(t))}var Re=GF;var WF=Math.max;function HF(t,e,r,n){t=ft(t)?t:Re(t),r=r&&!n?Dr(r):0;var i=t.length;return r<0&&(r=WF(i+r,0)),yt(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&fo(t,e,r)>-1}var We=HF;var KF=Math.max;function YF(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Dr(r);return i<0&&(i=KF(n+i,0)),fo(t,e,i)}var Vu=YF;var ZF="[object Map]",XF="[object Set]",JF=Object.prototype,QF=JF.hasOwnProperty;function eN(t){if(t==null)return!0;if(ft(t)&&(J(t)||typeof t=="string"||typeof t.splice=="function"||tn(t)||go(t)||Sn(t)))return!t.length;var e=gr(t);if(e==ZF||e==XF)return!t.size;if(Nr(t))return!ku(t).length;for(var r in t)if(QF.call(t,r))return!1;return!0}var Te=eN;var tN="[object RegExp]";function rN(t){return ot(t)&&Nt(t)==tN}var zb=rN;var $b=fr&&fr.isRegExp,nN=$b?Pr($b):zb,pr=nN;function iN(t){return t===void 0}var Ot=iN;var oN="Expected a function";function sN(t){if(typeof t!="function")throw new TypeError(oN);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}var qb=sN;function aN(t,e,r,n){if(!Ye(t))return t;e=Fn(e,t);for(var i=-1,o=e.length,s=o-1,a=t;a!=null&&++i<o;){var u=Lr(e[i]),l=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(i!=s){var c=a[u];l=n?n(c,u,a):void 0,l===void 0&&(l=Ye(c)?c:kn(e[i+1])?[]:{})}Tn(a,u,l),a=a[u]}return t}var Vb=aN;function uN(t,e,r){for(var n=-1,i=e.length,o={};++n<i;){var s=e[n],a=Ao(t,s);r(a,s)&&Vb(o,Fn(s,t),a)}return o}var Gb=uN;function lN(t,e){if(t==null)return{};var r=Or(Ou(t),function(n){return[n]});return e=pt(e),Gb(t,r,function(n,i){return e(n,i[0])})}var Vt=lN;function cN(t,e,r,n,i){return i(t,function(o,s,a){r=n?(n=!1,o):e(r,o,s,a)}),r}var Wb=cN;function fN(t,e,r){var n=J(t)?yy:Wb,i=arguments.length<3;return n(t,pt(e,4),r,i,qt)}var dt=fN;function pN(t,e){var r=J(t)?To:qu;return r(t,qb(pt(e,3)))}var Mn=pN;function dN(t,e){var r;return qt(t,function(n,i,o){return r=e(n,i,o),!r}),!!r}var Hb=dN;function hN(t,e,r){var n=J(t)?Pu:Hb;return r&&_n(t,e,r)&&(e=void 0),n(t,pt(e,3))}var Ts=hN;var mN=1/0,gN=Pn&&1/Do(new Pn([,-0]))[1]==mN?function(t){return new Pn(t)}:Ze,Kb=gN;var xN=200;function yN(t,e,r){var n=-1,i=Au,o=t.length,s=!0,a=[],u=a;if(r)s=!1,i=$u;else if(o>=xN){var l=e?null:Kb(t);if(l)return Do(l);s=!1,i=Oo,u=new Io}else u=e?[]:a;e:for(;++n<o;){var c=t[n],f=e?e(c):c;if(c=r||c!==0?c:0,s&&f===f){for(var p=u.length;p--;)if(u[p]===f)continue e;e&&u.push(f),a.push(c)}else i(u,f,r)||(u!==a&&u.push(f),a.push(c))}return a}var Yb=yN;function bN(t){return t&&t.length?Yb(t):[]}var Fo=bN;function No(t){console&&console.error&&console.error(`Error: ${t}`)}function _s(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function Ss(t){let e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function vs(t){function e(){}e.prototype=t;let r=new e;function n(){return typeof r.bar}return n(),n(),t;(0,eval)(t)}function EN(t){return AN(t)?t.LABEL:t.name}function AN(t){return yt(t.LABEL)&&t.LABEL!==""}var tr=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),G(this.definition,r=>{r.accept(e)})}},Be=class extends tr{constructor(e){super([]),this.idx=1,kt(this,Vt(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},Mt=class extends tr{constructor(e){super(e.definition),this.orgText="",kt(this,Vt(e,r=>r!==void 0))}},je=class extends tr{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,kt(this,Vt(e,r=>r!==void 0))}},Ge=class extends tr{constructor(e){super(e.definition),this.idx=1,kt(this,Vt(e,r=>r!==void 0))}},at=class extends tr{constructor(e){super(e.definition),this.idx=1,kt(this,Vt(e,r=>r!==void 0))}},ut=class extends tr{constructor(e){super(e.definition),this.idx=1,kt(this,Vt(e,r=>r!==void 0))}},De=class extends tr{constructor(e){super(e.definition),this.idx=1,kt(this,Vt(e,r=>r!==void 0))}},et=class extends tr{constructor(e){super(e.definition),this.idx=1,kt(this,Vt(e,r=>r!==void 0))}},tt=class extends tr{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,kt(this,Vt(e,r=>r!==void 0))}},Ie=class{constructor(e){this.idx=1,kt(this,Vt(e,r=>r!==void 0))}accept(e){e.visit(this)}};function Gu(t){return q(t,Po)}function Po(t){function e(r){return q(r,Po)}if(t instanceof Be){let r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return yt(t.label)&&(r.label=t.label),r}else{if(t instanceof je)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Ge)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof at)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof ut)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Po(new Ie({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof et)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Po(new Ie({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof De)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof tt)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Ie){let r={type:"Terminal",name:t.terminalType.name,label:EN(t.terminalType),idx:t.idx};yt(t.label)&&(r.terminalLabel=t.label);let n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=pr(n)?n.source:n),r}else{if(t instanceof Mt)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}var Bt=class{visit(e){let r=e;switch(r.constructor){case Be:return this.visitNonTerminal(r);case je:return this.visitAlternative(r);case Ge:return this.visitOption(r);case at:return this.visitRepetitionMandatory(r);case ut:return this.visitRepetitionMandatoryWithSeparator(r);case et:return this.visitRepetitionWithSeparator(r);case De:return this.visitRepetition(r);case tt:return this.visitAlternation(r);case Ie:return this.visitTerminal(r);case Mt:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function lp(t){return t instanceof je||t instanceof Ge||t instanceof De||t instanceof at||t instanceof ut||t instanceof et||t instanceof Ie||t instanceof Mt}function Ii(t,e=[]){return t instanceof Ge||t instanceof De||t instanceof et?!0:t instanceof tt?Ts(t.definition,n=>Ii(n,e)):t instanceof Be&&We(e,t)?!1:t instanceof tr?(t instanceof Be&&e.push(t),vt(t.definition,n=>Ii(n,e))):!1}function cp(t){return t instanceof tt}function Gt(t){if(t instanceof Be)return"SUBRULE";if(t instanceof Ge)return"OPTION";if(t instanceof tt)return"OR";if(t instanceof at)return"AT_LEAST_ONE";if(t instanceof ut)return"AT_LEAST_ONE_SEP";if(t instanceof et)return"MANY_SEP";if(t instanceof De)return"MANY";if(t instanceof Ie)return"CONSUME";throw Error("non exhaustive match")}var on=class{walk(e,r=[]){G(e.definition,(n,i)=>{let o=st(e.definition,i+1);if(n instanceof Be)this.walkProdRef(n,o,r);else if(n instanceof Ie)this.walkTerminal(n,o,r);else if(n instanceof je)this.walkFlat(n,o,r);else if(n instanceof Ge)this.walkOption(n,o,r);else if(n instanceof at)this.walkAtLeastOne(n,o,r);else if(n instanceof ut)this.walkAtLeastOneSep(n,o,r);else if(n instanceof et)this.walkManySep(n,o,r);else if(n instanceof De)this.walkMany(n,o,r);else if(n instanceof tt)this.walkOr(n,o,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){let i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){let i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){let i=[new Ge({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){let i=Zb(e,r,n);this.walk(e,i)}walkMany(e,r,n){let i=[new Ge({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){let i=Zb(e,r,n);this.walk(e,i)}walkOr(e,r,n){let i=r.concat(n);G(e.definition,o=>{let s=new je({definition:[o]});this.walk(s,i)})}};function Zb(t,e,r){return[new Ge({definition:[new Ie({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function Oi(t){if(t instanceof Be)return Oi(t.referencedRule);if(t instanceof Ie)return kN(t);if(lp(t))return wN(t);if(cp(t))return CN(t);throw Error("non exhaustive match")}function wN(t){let e=[],r=t.definition,n=0,i=r.length>n,o,s=!0;for(;i&&s;)o=r[n],s=Ii(o),e=e.concat(Oi(o)),n=n+1,i=r.length>n;return Fo(e)}function CN(t){let e=q(t.definition,r=>Oi(r));return Fo(xt(e))}function kN(t){return[t.terminalType]}var Wu="_~IN~_";var fp=class extends on{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){let i=TN(e.referencedRule,e.idx)+this.topProd.name,o=r.concat(n),s=new je({definition:o}),a=Oi(s);this.follows[i]=a}};function Xb(t){let e={};return G(t,r=>{let n=new fp(r).startWalking();kt(e,n)}),e}function TN(t,e){return t.name+e+Wu}function ue(t){return t.charCodeAt(0)}function Hu(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function Lo(t,e){if(t[e]===!0)throw"duplicate flag "+e;let r=t[e];t[e]=!0}function Di(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function Is(){throw Error("Internal Error - Should never get here!")}function pp(t){return t.type==="Character"}var Os=[];for(let t=ue("0");t<=ue("9");t++)Os.push(t);var Ds=[ue("_")].concat(Os);for(let t=ue("a");t<=ue("z");t++)Ds.push(t);for(let t=ue("A");t<=ue("Z");t++)Ds.push(t);var dp=[ue(" "),ue("\f"),ue(`
115
+ `),ue("\r"),ue(" "),ue("\v"),ue(" "),ue("\xA0"),ue("\u1680"),ue("\u2000"),ue("\u2001"),ue("\u2002"),ue("\u2003"),ue("\u2004"),ue("\u2005"),ue("\u2006"),ue("\u2007"),ue("\u2008"),ue("\u2009"),ue("\u200A"),ue("\u2028"),ue("\u2029"),ue("\u202F"),ue("\u205F"),ue("\u3000"),ue("\uFEFF")];var _N=/[0-9a-fA-F]/,Ku=/[0-9]/,SN=/[1-9]/,Rs=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");let r=this.disjunction();this.consumeChar("/");let n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Lo(n,"global");break;case"i":Lo(n,"ignoreCase");break;case"m":Lo(n,"multiLine");break;case"u":Lo(n,"unicode");break;case"y":Lo(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){let e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){let e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break}Di(r);let n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return Is()}quantifier(e=!1){let r,n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":let i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let o;this.isDigit()?(o=this.integerIncludingZero(),r={atLeast:i,atMost:o}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;Di(r);break}if(!(e===!0&&r===void 0)&&Di(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e,r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Di(e)?(e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):Is()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ue(`
116
+ `),ue("\r"),ue("\u2028"),ue("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=Os;break;case"D":e=Os,r=!0;break;case"s":e=dp;break;case"S":e=dp,r=!0;break;case"w":e=Ds;break;case"W":e=Ds,r=!0;break}return Di(e)?{type:"Set",value:e,complement:r}:Is()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=ue("\f");break;case"n":e=ue(`
117
+ `);break;case"r":e=ue("\r");break;case"t":e=ue(" ");break;case"v":e=ue("\v");break}return Di(e)?{type:"Character",value:e}:Is()}controlLetterEscapeAtom(){this.consumeChar("c");let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:ue("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){let e=this.popChar();return{type:"Character",value:ue(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
118
+ `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let e=this.popChar();return{type:"Character",value:ue(e)}}}characterClass(){let e=[],r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){let n=this.classAtom(),i=n.type==="Character";if(pp(n)&&this.isRangeDash()){this.consumeChar("-");let o=this.classAtom(),s=o.type==="Character";if(pp(o)){if(o.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:o.value})}else Hu(n.value,e),e.push(ue("-")),Hu(o.value,e)}else Hu(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
119
+ `:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:ue("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}let r=this.disjunction();this.consumeChar(")");let n={type:"Group",capturing:e,value:r};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(SN.test(e)===!1)throw Error("Expecting a positive integer");for(;Ku.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Ku.test(e)===!1)throw Error("Expecting an integer");for(;Ku.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`
120
+ `:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:ue(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return Ku.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
125
121
  `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}}isQuantifier(){let e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
126
- `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i<e;i++){let o=this.popChar();if(eP.test(o)===!1)throw Error("Expecting a HexDecimal digits");r+=o}return{type:"Character",value:parseInt(r,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){let e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};var $n=class{visitChildren(e){for(let r in e){let n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}};var Ju={},rP=new Bs;function qo(t){let e=t.toString();if(Ju.hasOwnProperty(e))return Ju[e];{let r=rP.pattern(e);return Ju[e]=r,r}}function mE(){Ju={}}var xE="Complement Sets are not supported for first char optimization",js=`Unable to use "first char" lexer optimizations:
127
- `;function yE(t,e=!1){try{let r=qo(t);return Ap(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===xE)e&&Rs(`${js} Unable to optimize: < ${t.toString()} >
122
+ `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i<e;i++){let o=this.popChar();if(_N.test(o)===!1)throw Error("Expecting a HexDecimal digits");r+=o}return{type:"Character",value:parseInt(r,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){let e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};var Bn=class{visitChildren(e){for(let r in e){let n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}};var Yu={},vN=new Rs;function Mo(t){let e=t.toString();if(Yu.hasOwnProperty(e))return Yu[e];{let r=vN.pattern(e);return Yu[e]=r,r}}function Jb(){Yu={}}var eE="Complement Sets are not supported for first char optimization",Fs=`Unable to use "first char" lexer optimizations:
123
+ `;function tE(t,e=!1){try{let r=Mo(t);return hp(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===eE)e&&_s(`${Fs} Unable to optimize: < ${t.toString()} >
128
124
  Complement Sets cannot be automatically optimized.
129
125
  This will disable the lexer's first char optimizations.
130
126
  See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=`
131
127
  This will disable the lexer's first char optimizations.
132
- See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Uo(`${js}
128
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),No(`${Fs}
133
129
  Failed parsing: < ${t.toString()} >
134
130
  Using the @chevrotain/regexp-to-ast library
135
- Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function Ap(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)Ap(t.value[i],e,r);break;case"Alternative":let n=t.value;for(let i=0;i<n.length;i++){let o=n[i];switch(o.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}let s=o;switch(s.type){case"Character":Qu(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error(xE);G(s.value,u=>{if(typeof u=="number")Qu(u,e,r);else{let l=u;if(r===!0)for(let c=l.from;c<=l.to;c++)Qu(c,e,r);else{for(let c=l.from;c<=l.to&&c<Vo;c++)Qu(c,e,r);if(l.to>=Vo){let c=l.from>=Vo?l.from:Vo,f=l.to,p=Gr(c),d=Gr(f);for(let m=p;m<=d;m++)e[m]=m}}}});break;case"Group":Ap(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}let a=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&Cp(s)===!1||s.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return Re(e)}function Qu(t,e,r){let n=Gr(t);e[n]=n,r===!0&&nP(t,e)}function nP(t,e){let r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){let i=Gr(n.charCodeAt(0));e[i]=i}else{let i=r.toLowerCase();if(i!==r){let o=Gr(i.charCodeAt(0));e[o]=o}}}function gE(t,e){return Vr(t.value,r=>{if(typeof r=="number")return He(e,r);{let n=r;return Vr(e,i=>n.from<=i&&i<=n.to)!==void 0}})}function Cp(t){let e=t.quantifier;return e&&e.atLeast===0?!0:t.value?J(t.value)?Dt(t.value,Cp):Cp(t.value):!1}var wp=class extends $n{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return}super.visitChildren(e)}}visitCharacter(e){He(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?gE(e,this.targetCharCodes)===void 0&&(this.found=!0):gE(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function el(t,e){if(e instanceof RegExp){let r=qo(e),n=new wp(t);return n.visit(r),n.found}else return Vr(e,r=>He(t,r.charCodeAt(0)))!==void 0}var Li="PATTERN",Go="defaultMode",tl="modes",Tp=typeof new RegExp("(?:)").sticky=="boolean";function AE(t,e){e=Bo(e,{useSticky:Tp,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
136
- `],tracer:(w,C)=>C()});let r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{AP()});let n;r("Reject Lexer.NA",()=>{n=zn(t,w=>w[Li]===Se.NA)});let i=!1,o;r("Transform Patterns",()=>{i=!1,o=q(n,w=>{let C=w[Li];if(gr(C)){let D=C.source;return D.length===1&&D!=="^"&&D!=="$"&&D!=="."&&!C.ignoreCase?D:D.length===2&&D[0]==="\\"&&!He(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],D[1])?D[1]:e.useSticky?EE(C):bE(C)}else{if(Bt(C))return i=!0,{exec:C};if(typeof C=="object")return i=!0,C;if(typeof C=="string"){if(C.length===1)return C;{let D=C.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),R=new RegExp(D);return e.useSticky?EE(R):bE(R)}}else throw Error("non exhaustive match")}})});let s,a,u,l,c;r("misc mapping",()=>{s=q(n,w=>w.tokenTypeIdx),a=q(n,w=>{let C=w.GROUP;if(C!==Se.SKIPPED){if(Et(C))return C;if(Ft(C))return!1;throw Error("non exhaustive match")}}),u=q(n,w=>{let C=w.LONGER_ALT;if(C)return J(C)?q(C,R=>Hu(n,R)):[Hu(n,C)]}),l=q(n,w=>w.PUSH_MODE),c=q(n,w=>Z(w,"POP_MODE"))});let f;r("Line Terminator Handling",()=>{let w=IE(e.lineTerminatorCharacters);f=q(n,C=>!1),e.positionTracking!=="onlyOffset"&&(f=q(n,C=>Z(C,"LINE_BREAKS")?!!C.LINE_BREAKS:vE(C,w)===!1&&el(w,C.PATTERN)))});let p,d,m,y;r("Misc Mapping #2",()=>{p=q(n,_E),d=q(o,bP),m=mt(n,(w,C)=>{let D=C.GROUP;return Et(D)&&D!==Se.SKIPPED&&(w[D]=[]),w},{}),y=q(o,(w,C)=>({pattern:o[C],longerAlt:u[C],canLineTerminator:f[C],isCustom:p[C],short:d[C],group:a[C],push:l[C],pop:c[C],tokenTypeIdx:s[C],tokenType:n[C]}))});let g=!0,b=[];return e.safeMode||r("First Char Optimization",()=>{b=mt(n,(w,C,D)=>{if(typeof C.PATTERN=="string"){let R=C.PATTERN.charCodeAt(0),S=Gr(R);kp(w,S,y[D])}else if(J(C.START_CHARS_HINT)){let R;G(C.START_CHARS_HINT,S=>{let de=typeof S=="string"?S.charCodeAt(0):S,ye=Gr(de);R!==ye&&(R=ye,kp(w,ye,y[D]))})}else if(gr(C.PATTERN))if(C.PATTERN.unicode)g=!1,e.ensureOptimizations&&Uo(`${js} Unable to analyze < ${C.PATTERN.toString()} > pattern.
131
+ Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function hp(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)hp(t.value[i],e,r);break;case"Alternative":let n=t.value;for(let i=0;i<n.length;i++){let o=n[i];switch(o.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}let s=o;switch(s.type){case"Character":Zu(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error(eE);G(s.value,u=>{if(typeof u=="number")Zu(u,e,r);else{let l=u;if(r===!0)for(let c=l.from;c<=l.to;c++)Zu(c,e,r);else{for(let c=l.from;c<=l.to&&c<Bo;c++)Zu(c,e,r);if(l.to>=Bo){let c=l.from>=Bo?l.from:Bo,f=l.to,p=Ur(c),d=Ur(f);for(let m=p;m<=d;m++)e[m]=m}}}});break;case"Group":hp(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}let a=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&mp(s)===!1||s.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return Re(e)}function Zu(t,e,r){let n=Ur(t);e[n]=n,r===!0&&IN(t,e)}function IN(t,e){let r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){let i=Ur(n.charCodeAt(0));e[i]=i}else{let i=r.toLowerCase();if(i!==r){let o=Ur(i.charCodeAt(0));e[o]=o}}}function Qb(t,e){return jr(t.value,r=>{if(typeof r=="number")return We(e,r);{let n=r;return jr(e,i=>n.from<=i&&i<=n.to)!==void 0}})}function mp(t){let e=t.quantifier;return e&&e.atLeast===0?!0:t.value?J(t.value)?vt(t.value,mp):mp(t.value):!1}var gp=class extends Bn{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return}super.visitChildren(e)}}visitCharacter(e){We(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?Qb(e,this.targetCharCodes)===void 0&&(this.found=!0):Qb(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function Xu(t,e){if(e instanceof RegExp){let r=Mo(e),n=new gp(t);return n.visit(r),n.found}else return jr(e,r=>We(t,r.charCodeAt(0)))!==void 0}var Ri="PATTERN",jo="defaultMode",Ju="modes",yp=typeof new RegExp("(?:)").sticky=="boolean";function iE(t,e){e=Ro(e,{useSticky:yp,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
132
+ `],tracer:(C,w)=>w()});let r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{HN()});let n;r("Reject Lexer.NA",()=>{n=Mn(t,C=>C[Ri]===Se.NA)});let i=!1,o;r("Transform Patterns",()=>{i=!1,o=q(n,C=>{let w=C[Ri];if(pr(w)){let D=w.source;return D.length===1&&D!=="^"&&D!=="$"&&D!=="."&&!w.ignoreCase?D:D.length===2&&D[0]==="\\"&&!We(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],D[1])?D[1]:e.useSticky?nE(w):rE(w)}else{if(Pt(w))return i=!0,{exec:w};if(typeof w=="object")return i=!0,w;if(typeof w=="string"){if(w.length===1)return w;{let D=w.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),R=new RegExp(D);return e.useSticky?nE(R):rE(R)}}else throw Error("non exhaustive match")}})});let s,a,u,l,c;r("misc mapping",()=>{s=q(n,C=>C.tokenTypeIdx),a=q(n,C=>{let w=C.GROUP;if(w!==Se.SKIPPED){if(yt(w))return w;if(Ot(w))return!1;throw Error("non exhaustive match")}}),u=q(n,C=>{let w=C.LONGER_ALT;if(w)return J(w)?q(w,R=>Vu(n,R)):[Vu(n,w)]}),l=q(n,C=>C.PUSH_MODE),c=q(n,C=>Z(C,"POP_MODE"))});let f;r("Line Terminator Handling",()=>{let C=pE(e.lineTerminatorCharacters);f=q(n,w=>!1),e.positionTracking!=="onlyOffset"&&(f=q(n,w=>Z(w,"LINE_BREAKS")?!!w.LINE_BREAKS:fE(w,C)===!1&&Xu(C,w.PATTERN)))});let p,d,m,y;r("Misc Mapping #2",()=>{p=q(n,lE),d=q(o,GN),m=dt(n,(C,w)=>{let D=w.GROUP;return yt(D)&&D!==Se.SKIPPED&&(C[D]=[]),C},{}),y=q(o,(C,w)=>({pattern:o[w],longerAlt:u[w],canLineTerminator:f[w],isCustom:p[w],short:d[w],group:a[w],push:l[w],pop:c[w],tokenTypeIdx:s[w],tokenType:n[w]}))});let g=!0,b=[];return e.safeMode||r("First Char Optimization",()=>{b=dt(n,(C,w,D)=>{if(typeof w.PATTERN=="string"){let R=w.PATTERN.charCodeAt(0),S=Ur(R);xp(C,S,y[D])}else if(J(w.START_CHARS_HINT)){let R;G(w.START_CHARS_HINT,S=>{let de=typeof S=="string"?S.charCodeAt(0):S,ye=Ur(de);R!==ye&&(R=ye,xp(C,ye,y[D]))})}else if(pr(w.PATTERN))if(w.PATTERN.unicode)g=!1,e.ensureOptimizations&&No(`${Fs} Unable to analyze < ${w.PATTERN.toString()} > pattern.
137
133
  The regexp unicode flag is not currently supported by the regexp-to-ast library.
138
134
  This will disable the lexer's first char optimizations.
139
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let R=yE(C.PATTERN,e.ensureOptimizations);Te(R)&&(g=!1),G(R,S=>{kp(w,S,y[D])})}else e.ensureOptimizations&&Uo(`${js} TokenType: <${C.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
135
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let R=tE(w.PATTERN,e.ensureOptimizations);Te(R)&&(g=!1),G(R,S=>{xp(C,S,y[D])})}else e.ensureOptimizations&&No(`${Fs} TokenType: <${w.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
140
136
  This will disable the lexer's first char optimizations.
141
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return w},[])}),{emptyGroups:m,patternIdxToConfig:y,charCodeToPatternIdxToConfig:b,hasCustom:i,canBeOptimized:g}}function CE(t,e){let r=[],n=oP(t);r=r.concat(n.errors);let i=sP(n.valid),o=i.valid;return r=r.concat(i.errors),r=r.concat(iP(o)),r=r.concat(hP(o)),r=r.concat(mP(o,e)),r=r.concat(gP(o)),r}function iP(t){let e=[],r=Rt(t,n=>gr(n[Li]));return e=e.concat(uP(r)),e=e.concat(fP(r)),e=e.concat(pP(r)),e=e.concat(dP(r)),e=e.concat(lP(r)),e}function oP(t){let e=Rt(t,i=>!Z(i,Li)),r=q(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Ke.MISSING_PATTERN,tokenTypes:[i]})),n=Un(t,e);return{errors:r,valid:n}}function sP(t){let e=Rt(t,i=>{let o=i[Li];return!gr(o)&&!Bt(o)&&!Z(o,"exec")&&!Et(o)}),r=q(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Ke.INVALID_PATTERN,tokenTypes:[i]})),n=Un(t,e);return{errors:r,valid:n}}var aP=/[^\\][$]/;function uP(t){class e extends $n{constructor(){super(...arguments),this.found=!1}visitEndAnchor(o){this.found=!0}}let r=Rt(t,i=>{let o=i.PATTERN;try{let s=qo(o),a=new e;return a.visit(s),a.found}catch{return aP.test(o.source)}});return q(r,i=>({message:`Unexpected RegExp Anchor Error:
137
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return C},[])}),{emptyGroups:m,patternIdxToConfig:y,charCodeToPatternIdxToConfig:b,hasCustom:i,canBeOptimized:g}}function oE(t,e){let r=[],n=DN(t);r=r.concat(n.errors);let i=RN(n.valid),o=i.valid;return r=r.concat(i.errors),r=r.concat(ON(o)),r=r.concat(UN(o)),r=r.concat(zN(o,e)),r=r.concat($N(o)),r}function ON(t){let e=[],r=It(t,n=>pr(n[Ri]));return e=e.concat(NN(r)),e=e.concat(MN(r)),e=e.concat(BN(r)),e=e.concat(jN(r)),e=e.concat(PN(r)),e}function DN(t){let e=It(t,i=>!Z(i,Ri)),r=q(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:He.MISSING_PATTERN,tokenTypes:[i]})),n=Ln(t,e);return{errors:r,valid:n}}function RN(t){let e=It(t,i=>{let o=i[Ri];return!pr(o)&&!Pt(o)&&!Z(o,"exec")&&!yt(o)}),r=q(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:He.INVALID_PATTERN,tokenTypes:[i]})),n=Ln(t,e);return{errors:r,valid:n}}var FN=/[^\\][$]/;function NN(t){class e extends Bn{constructor(){super(...arguments),this.found=!1}visitEndAnchor(o){this.found=!0}}let r=It(t,i=>{let o=i.PATTERN;try{let s=Mo(o),a=new e;return a.visit(s),a.found}catch{return FN.test(o.source)}});return q(r,i=>({message:`Unexpected RegExp Anchor Error:
142
138
  Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
143
- See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ke.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function lP(t){let e=Rt(t,n=>n.PATTERN.test(""));return q(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Ke.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}var cP=/[^\\[][\^]|^\^/;function fP(t){class e extends $n{constructor(){super(...arguments),this.found=!1}visitStartAnchor(o){this.found=!0}}let r=Rt(t,i=>{let o=i.PATTERN;try{let s=qo(o),a=new e;return a.visit(s),a.found}catch{return cP.test(o.source)}});return q(r,i=>({message:`Unexpected RegExp Anchor Error:
139
+ See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:He.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function PN(t){let e=It(t,n=>n.PATTERN.test(""));return q(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:He.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}var LN=/[^\\[][\^]|^\^/;function MN(t){class e extends Bn{constructor(){super(...arguments),this.found=!1}visitStartAnchor(o){this.found=!0}}let r=It(t,i=>{let o=i.PATTERN;try{let s=Mo(o),a=new e;return a.visit(s),a.found}catch{return LN.test(o.source)}});return q(r,i=>({message:`Unexpected RegExp Anchor Error:
144
140
  Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
145
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ke.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function pP(t){let e=Rt(t,n=>{let i=n[Li];return i instanceof RegExp&&(i.multiline||i.global)});return q(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ke.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function dP(t){let e=[],r=q(t,o=>mt(t,(s,a)=>(o.PATTERN.source===a.PATTERN.source&&!He(e,a)&&a.PATTERN!==Se.NA&&(e.push(a),s.push(a)),s),[]));r=$r(r);let n=Rt(r,o=>o.length>1);return q(n,o=>{let s=q(o,u=>u.name);return{message:`The same RegExp pattern ->${kt(o).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:Ke.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}})}function hP(t){let e=Rt(t,n=>{if(!Z(n,"GROUP"))return!1;let i=n.GROUP;return i!==Se.SKIPPED&&i!==Se.NA&&!Et(i)});return q(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ke.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function mP(t,e){let r=Rt(t,i=>i.PUSH_MODE!==void 0&&!He(e,i.PUSH_MODE));return q(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:Ke.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function gP(t){let e=[],r=mt(t,(n,i,o)=>{let s=i.PATTERN;return s===Se.NA||(Et(s)?n.push({str:s,idx:o,tokenType:i}):gr(s)&&yP(s)&&n.push({str:s.source,idx:o,tokenType:i})),n},[]);return G(t,(n,i)=>{G(r,({str:o,idx:s,tokenType:a})=>{if(i<s&&xP(o,n.PATTERN)){let u=`Token: ->${a.name}<- can never be matched.
141
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:He.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function BN(t){let e=It(t,n=>{let i=n[Ri];return i instanceof RegExp&&(i.multiline||i.global)});return q(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:He.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function jN(t){let e=[],r=q(t,o=>dt(t,(s,a)=>(o.PATTERN.source===a.PATTERN.source&&!We(e,a)&&a.PATTERN!==Se.NA&&(e.push(a),s.push(a)),s),[]));r=Mr(r);let n=It(r,o=>o.length>1);return q(n,o=>{let s=q(o,u=>u.name);return{message:`The same RegExp pattern ->${wt(o).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:He.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}})}function UN(t){let e=It(t,n=>{if(!Z(n,"GROUP"))return!1;let i=n.GROUP;return i!==Se.SKIPPED&&i!==Se.NA&&!yt(i)});return q(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:He.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function zN(t,e){let r=It(t,i=>i.PUSH_MODE!==void 0&&!We(e,i.PUSH_MODE));return q(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:He.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function $N(t){let e=[],r=dt(t,(n,i,o)=>{let s=i.PATTERN;return s===Se.NA||(yt(s)?n.push({str:s,idx:o,tokenType:i}):pr(s)&&VN(s)&&n.push({str:s.source,idx:o,tokenType:i})),n},[]);return G(t,(n,i)=>{G(r,({str:o,idx:s,tokenType:a})=>{if(i<s&&qN(o,n.PATTERN)){let u=`Token: ->${a.name}<- can never be matched.
146
142
  Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition.
147
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:u,type:Ke.UNREACHABLE_PATTERN,tokenTypes:[n,a]})}})}),e}function xP(t,e){if(gr(e)){let r=e.exec(t);return r!==null&&r.index===0}else{if(Bt(e))return e(t,0,[],{});if(Z(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function yP(t){return Vr([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}function bE(t){let e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function EE(t){let e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function wE(t,e,r){let n=[];return Z(t,Go)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Go+`> property in its definition
148
- `,type:Ke.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Z(t,tl)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+tl+`> property in its definition
149
- `,type:Ke.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Z(t,tl)&&Z(t,Go)&&!Z(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${Go}: <${t.defaultMode}>which does not exist
150
- `,type:Ke.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Z(t,tl)&&G(t.modes,(i,o)=>{G(i,(s,a)=>{if(Ft(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${o}> at index: <${a}>
151
- `,type:Ke.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Z(s,"LONGER_ALT")){let u=J(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];G(u,l=>{!Ft(l)&&!He(i,l)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${l.name}> on token <${s.name}> outside of mode <${o}>
152
- `,type:Ke.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function kE(t,e,r){let n=[],i=!1,o=$r(bt(Re(t.modes))),s=zn(o,u=>u[Li]===Se.NA),a=IE(r);return e&&G(s,u=>{let l=vE(u,a);if(l!==!1){let f={message:EP(u,l),type:l.issue,tokenType:u};n.push(f)}else Z(u,"LINE_BREAKS")?u.LINE_BREAKS===!0&&(i=!0):el(a,u.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
143
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:u,type:He.UNREACHABLE_PATTERN,tokenTypes:[n,a]})}})}),e}function qN(t,e){if(pr(e)){let r=e.exec(t);return r!==null&&r.index===0}else{if(Pt(e))return e(t,0,[],{});if(Z(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function VN(t){return jr([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}function rE(t){let e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function nE(t){let e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function sE(t,e,r){let n=[];return Z(t,jo)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+jo+`> property in its definition
144
+ `,type:He.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Z(t,Ju)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ju+`> property in its definition
145
+ `,type:He.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Z(t,Ju)&&Z(t,jo)&&!Z(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${jo}: <${t.defaultMode}>which does not exist
146
+ `,type:He.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Z(t,Ju)&&G(t.modes,(i,o)=>{G(i,(s,a)=>{if(Ot(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${o}> at index: <${a}>
147
+ `,type:He.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Z(s,"LONGER_ALT")){let u=J(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];G(u,l=>{!Ot(l)&&!We(i,l)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${l.name}> on token <${s.name}> outside of mode <${o}>
148
+ `,type:He.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function aE(t,e,r){let n=[],i=!1,o=Mr(xt(Re(t.modes))),s=Mn(o,u=>u[Ri]===Se.NA),a=pE(r);return e&&G(s,u=>{let l=fE(u,a);if(l!==!1){let f={message:WN(u,l),type:l.issue,tokenType:u};n.push(f)}else Z(u,"LINE_BREAKS")?u.LINE_BREAKS===!0&&(i=!0):Xu(a,u.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
153
149
  This Lexer has been defined to track line and column information,
154
150
  But none of the Token Types can be identified as matching a line terminator.
155
151
  See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
156
- for details.`,type:Ke.NO_LINE_BREAKS_FLAGS}),n}function TE(t){let e={},r=Pe(t);return G(r,n=>{let i=t[n];if(J(i))e[n]=[];else throw Error("non exhaustive match")}),e}function _E(t){let e=t.PATTERN;if(gr(e))return!1;if(Bt(e))return!0;if(Z(e,"exec"))return!0;if(Et(e))return!1;throw Error("non exhaustive match")}function bP(t){return Et(t)&&t.length===1?t.charCodeAt(0):!1}var SE={test:function(t){let e=t.length;for(let r=this.lastIndex;r<e;r++){let n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function vE(t,e){if(Z(t,"LINE_BREAKS"))return!1;if(gr(t.PATTERN)){try{el(e,t.PATTERN)}catch(r){return{issue:Ke.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(Et(t.PATTERN))return!1;if(_E(t))return{issue:Ke.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function EP(t,e){if(e.issue===Ke.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
152
+ for details.`,type:He.NO_LINE_BREAKS_FLAGS}),n}function uE(t){let e={},r=Pe(t);return G(r,n=>{let i=t[n];if(J(i))e[n]=[];else throw Error("non exhaustive match")}),e}function lE(t){let e=t.PATTERN;if(pr(e))return!1;if(Pt(e))return!0;if(Z(e,"exec"))return!0;if(yt(e))return!1;throw Error("non exhaustive match")}function GN(t){return yt(t)&&t.length===1?t.charCodeAt(0):!1}var cE={test:function(t){let e=t.length;for(let r=this.lastIndex;r<e;r++){let n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function fE(t,e){if(Z(t,"LINE_BREAKS"))return!1;if(pr(t.PATTERN)){try{Xu(e,t.PATTERN)}catch(r){return{issue:He.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(yt(t.PATTERN))return!1;if(lE(t))return{issue:He.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function WN(t,e){if(e.issue===He.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
157
153
  The problem is in the <${t.name}> Token Type
158
154
  Root cause: ${e.errMsg}.
159
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===Ke.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
155
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===He.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
160
156
  The problem is in the <${t.name}> Token Type
161
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function IE(t){return q(t,r=>Et(r)?r.charCodeAt(0):r)}function kp(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}var Vo=256,rl=[];function Gr(t){return t<Vo?t:rl[t]}function AP(){if(Te(rl)){rl=new Array(65536);for(let t=0;t<65536;t++)rl[t]=t>255?255+~~(t/255):t}}function cn(t,e){let r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function Wo(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}var OE=1,RE={};function fn(t){let e=CP(t);wP(e),TP(e),kP(e),G(e,r=>{r.isParent=r.categoryMatches.length>0})}function CP(t){let e=Me(t),r=t,n=!0;for(;n;){r=$r(bt(q(r,o=>o.CATEGORIES)));let i=Un(r,e);e=e.concat(i),Te(i)?n=!1:r=i}return e}function wP(t){G(t,e=>{_p(e)||(RE[OE]=e,e.tokenTypeIdx=OE++),DE(e)&&!J(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),DE(e)||(e.CATEGORIES=[]),_P(e)||(e.categoryMatches=[]),SP(e)||(e.categoryMatchesMap={})})}function kP(t){G(t,e=>{e.categoryMatches=[],G(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(RE[n].tokenTypeIdx)})})}function TP(t){G(t,e=>{FE([],e)})}function FE(t,e){G(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),G(e.CATEGORIES,r=>{let n=t.concat(e);He(n,r)||FE(n,r)})}function _p(t){return Z(t,"tokenTypeIdx")}function DE(t){return Z(t,"CATEGORIES")}function _P(t){return Z(t,"categoryMatches")}function SP(t){return Z(t,"categoryMatchesMap")}function NE(t){return Z(t,"tokenTypeIdx")}var Sp={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}};var Ke;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(Ke||(Ke={}));var Us={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
162
- `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Sp,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Us);var Se=class{constructor(e,r=Us){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,o)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${s}--> <${i}>`);let{time:a,value:u}=Fs(o),l=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&l(`${s}<-- <${i}> time: ${a}ms`),this.traceInitIndent--,u}else return o()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
163
- a boolean 2nd argument is no longer supported`);this.config=_t({},Us,r);let n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,o=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Us.lineTerminatorsPattern)this.config.lineTerminatorsPattern=SE;else if(this.config.lineTerminatorCharacters===Us.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
164
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),J(e)?i={modes:{defaultMode:Me(e)},defaultMode:Go}:(o=!1,i=Me(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(wE(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(kE(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},G(i.modes,(a,u)=>{i.modes[u]=zn(a,l=>Ft(l))});let s=Pe(i.modes);if(G(i.modes,(a,u)=>{this.TRACE_INIT(`Mode: <${u}> processing`,()=>{if(this.modes.push(u),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(CE(a,s))}),Te(this.lexerDefinitionErrors)){fn(a);let l;this.TRACE_INIT("analyzeTokenTypes",()=>{l=AE(a,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[u]=l.patternIdxToConfig,this.charCodeToPatternIdxToConfig[u]=l.charCodeToPatternIdxToConfig,this.emptyGroups=_t({},this.emptyGroups,l.emptyGroups),this.hasCustom=l.hasCustom||this.hasCustom,this.canModeBeOptimized[u]=l.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Te(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let u=q(this.lexerDefinitionErrors,l=>l.message).join(`-----------------------
157
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function pE(t){return q(t,r=>yt(r)?r.charCodeAt(0):r)}function xp(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}var Bo=256,Qu=[];function Ur(t){return t<Bo?t:Qu[t]}function HN(){if(Te(Qu)){Qu=new Array(65536);for(let t=0;t<65536;t++)Qu[t]=t>255?255+~~(t/255):t}}function sn(t,e){let r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function Uo(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}var dE=1,mE={};function an(t){let e=KN(t);YN(e),XN(e),ZN(e),G(e,r=>{r.isParent=r.categoryMatches.length>0})}function KN(t){let e=Me(t),r=t,n=!0;for(;n;){r=Mr(xt(q(r,o=>o.CATEGORIES)));let i=Ln(r,e);e=e.concat(i),Te(i)?n=!1:r=i}return e}function YN(t){G(t,e=>{bp(e)||(mE[dE]=e,e.tokenTypeIdx=dE++),hE(e)&&!J(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),hE(e)||(e.CATEGORIES=[]),JN(e)||(e.categoryMatches=[]),QN(e)||(e.categoryMatchesMap={})})}function ZN(t){G(t,e=>{e.categoryMatches=[],G(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(mE[n].tokenTypeIdx)})})}function XN(t){G(t,e=>{gE([],e)})}function gE(t,e){G(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),G(e.CATEGORIES,r=>{let n=t.concat(e);We(n,r)||gE(n,r)})}function bp(t){return Z(t,"tokenTypeIdx")}function hE(t){return Z(t,"CATEGORIES")}function JN(t){return Z(t,"categoryMatches")}function QN(t){return Z(t,"categoryMatchesMap")}function xE(t){return Z(t,"tokenTypeIdx")}var Ep={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}};var He;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(He||(He={}));var Ns={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
158
+ `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Ep,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Ns);var Se=class{constructor(e,r=Ns){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,o)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${s}--> <${i}>`);let{time:a,value:u}=Ss(o),l=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&l(`${s}<-- <${i}> time: ${a}ms`),this.traceInitIndent--,u}else return o()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
159
+ a boolean 2nd argument is no longer supported`);this.config=kt({},Ns,r);let n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,o=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Ns.lineTerminatorsPattern)this.config.lineTerminatorsPattern=cE;else if(this.config.lineTerminatorCharacters===Ns.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
160
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),J(e)?i={modes:{defaultMode:Me(e)},defaultMode:jo}:(o=!1,i=Me(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(sE(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(aE(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},G(i.modes,(a,u)=>{i.modes[u]=Mn(a,l=>Ot(l))});let s=Pe(i.modes);if(G(i.modes,(a,u)=>{this.TRACE_INIT(`Mode: <${u}> processing`,()=>{if(this.modes.push(u),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(oE(a,s))}),Te(this.lexerDefinitionErrors)){an(a);let l;this.TRACE_INIT("analyzeTokenTypes",()=>{l=iE(a,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[u]=l.patternIdxToConfig,this.charCodeToPatternIdxToConfig[u]=l.charCodeToPatternIdxToConfig,this.emptyGroups=kt({},this.emptyGroups,l.emptyGroups),this.hasCustom=l.hasCustom||this.hasCustom,this.canModeBeOptimized[u]=l.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Te(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let u=q(this.lexerDefinitionErrors,l=>l.message).join(`-----------------------
165
161
  `);throw new Error(`Errors detected in definition of Lexer:
166
- `+u)}G(this.lexerDefinitionWarning,a=>{Rs(a.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(Tp?(this.chopInput=hr,this.match=this.matchWithTest):(this.updateLastIndex=Xe,this.match=this.matchWithExec),o&&(this.handleModes=Xe),this.trackStartLines===!1&&(this.computeNewColumn=hr),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Xe),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{let a=mt(this.canModeBeOptimized,(u,l,c)=>(l===!1&&u.push(c),u),[]);if(r.ensureOptimizations&&!Te(a))throw Error(`Lexer Modes: < ${a.join(", ")} > cannot be optimized.
162
+ `+u)}G(this.lexerDefinitionWarning,a=>{_s(a.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(yp?(this.chopInput=cr,this.match=this.matchWithTest):(this.updateLastIndex=Ze,this.match=this.matchWithExec),o&&(this.handleModes=Ze),this.trackStartLines===!1&&(this.computeNewColumn=cr),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Ze),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{let a=dt(this.canModeBeOptimized,(u,l,c)=>(l===!1&&u.push(c),u),[]);if(r.ensureOptimizations&&!Te(a))throw Error(`Lexer Modes: < ${a.join(", ")} > cannot be optimized.
167
163
  Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
168
- Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{mE()}),this.TRACE_INIT("toFastProperties",()=>{Ns(this)})})}tokenize(e,r=this.defaultMode){if(!Te(this.lexerDefinitionErrors)){let i=q(this.lexerDefinitionErrors,o=>o.message).join(`-----------------------
164
+ Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Jb()}),this.TRACE_INIT("toFastProperties",()=>{vs(this)})})}tokenize(e,r=this.defaultMode){if(!Te(this.lexerDefinitionErrors)){let i=q(this.lexerDefinitionErrors,o=>o.message).join(`-----------------------
169
165
  `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
170
- `+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,o,s,a,u,l,c,f,p,d,m,y,g,b,w,C=e,D=C.length,R=0,S=0,de=this.hasCustom?0:Math.floor(e.length/10),ye=new Array(de),be=[],_=this.trackStartLines?1:void 0,L=this.trackStartLines?1:void 0,F=TE(this.emptyGroups),v=this.trackStartLines,P=this.config.lineTerminatorsPattern,j=0,ae=[],ee=[],_e=[],it=[];Object.freeze(it);let x;function Ue(){return ae}function Qe(he){let oe=Gr(he),ce=ee[oe];return ce===void 0?it:ce}let E=he=>{if(_e.length===1&&he.tokenType.PUSH_MODE===void 0){let oe=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(he);be.push({offset:he.startOffset,line:he.startLine,column:he.startColumn,length:he.image.length,message:oe})}else{_e.pop();let oe=qr(_e);ae=this.patternIdxToConfig[oe],ee=this.charCodeToPatternIdxToConfig[oe],j=ae.length;let ce=this.canModeBeOptimized[oe]&&this.config.safeMode===!1;ee&&ce?x=Qe:x=Ue}};function W(he){_e.push(he),ee=this.charCodeToPatternIdxToConfig[he],ae=this.patternIdxToConfig[he],j=ae.length,j=ae.length;let oe=this.canModeBeOptimized[he]&&this.config.safeMode===!1;ee&&oe?x=Qe:x=Ue}W.call(this,r);let Ye,ne=this.config.recoveryEnabled;for(;R<D;){u=null;let he=C.charCodeAt(R),oe=x(he),ce=oe.length;for(n=0;n<ce;n++){Ye=oe[n];let me=Ye.pattern;l=null;let we=Ye.short;if(we!==!1?he===we&&(u=me):Ye.isCustom===!0?(w=me.exec(C,R,ye,F),w!==null?(u=w[0],w.payload!==void 0&&(l=w.payload)):u=null):(this.updateLastIndex(me,R),u=this.match(me,e,R)),u!==null){if(a=Ye.longerAlt,a!==void 0){let Fe=a.length;for(o=0;o<Fe;o++){let ze=ae[a[o]],qt=ze.pattern;if(c=null,ze.isCustom===!0?(w=qt.exec(C,R,ye,F),w!==null?(s=w[0],w.payload!==void 0&&(c=w.payload)):s=null):(this.updateLastIndex(qt,R),s=this.match(qt,e,R)),s&&s.length>u.length){u=s,l=c,Ye=ze;break}}}break}}if(u!==null){if(f=u.length,p=Ye.group,p!==void 0&&(d=Ye.tokenTypeIdx,m=this.createTokenInstance(u,R,d,Ye.tokenType,_,L,f),this.handlePayload(m,l),p===!1?S=this.addToken(ye,S,m):F[p].push(m)),e=this.chopInput(e,f),R=R+f,L=this.computeNewColumn(L,f),v===!0&&Ye.canLineTerminator===!0){let me=0,we,Fe;P.lastIndex=0;do we=P.test(u),we===!0&&(Fe=P.lastIndex-1,me++);while(we===!0);me!==0&&(_=_+me,L=f-Fe,this.updateTokenEndLineColumnLocation(m,p,Fe,me,_,L,f))}this.handleModes(Ye,E,W,m)}else{let me=R,we=_,Fe=L,ze=ne===!1;for(;ze===!1&&R<D;)for(e=this.chopInput(e,1),R++,i=0;i<j;i++){let qt=ae[i],A=qt.pattern,k=qt.short;if(k!==!1?C.charCodeAt(R)===k&&(ze=!0):qt.isCustom===!0?ze=A.exec(C,R,ye,F)!==null:(this.updateLastIndex(A,R),ze=A.exec(e)!==null),ze===!0)break}if(y=R-me,L=this.computeNewColumn(L,y),b=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(C,me,y,we,Fe),be.push({offset:me,line:we,column:Fe,length:y,message:b}),ne===!1)break}}return this.hasCustom||(ye.length=S),{tokens:ye,groups:F,errors:be}}handleModes(e,r,n,i){if(e.pop===!0){let o=e.push;r(i),o!==void 0&&n.call(this,o)}else e.push!==void 0&&n.call(this,e.push)}chopInput(e,r){return e.substring(r)}updateLastIndex(e,r){e.lastIndex=r}updateTokenEndLineColumnLocation(e,r,n,i,o,s,a){let u,l;r!==void 0&&(u=n===a-1,l=u?-1:0,i===1&&u===!0||(e.endLine=o+l,e.endColumn=s-1+-l))}computeNewColumn(e,r){return e+r}createOffsetOnlyToken(e,r,n,i){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:i}}createStartOnlyToken(e,r,n,i,o,s){return{image:e,startOffset:r,startLine:o,startColumn:s,tokenTypeIdx:n,tokenType:i}}createFullToken(e,r,n,i,o,s,a){return{image:e,startOffset:r,endOffset:r+a-1,startLine:o,endLine:o,startColumn:s,endColumn:s+a-1,tokenTypeIdx:n,tokenType:i}}addTokenUsingPush(e,r,n){return e.push(n),r}addTokenUsingMemberAccess(e,r,n){return e[r]=n,r++,r}handlePayloadNoCustom(e,r){}handlePayloadWithCustom(e,r){r!==null&&(e.payload=r)}matchWithTest(e,r,n){return e.test(r)===!0?r.substring(n,e.lastIndex):null}matchWithExec(e,r){let n=e.exec(r);return n!==null?n[0]:null}};Se.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";Se.NA=/NOT_APPLICABLE/;function Mi(t){return vp(t)?t.LABEL:t.name}function vp(t){return Et(t.LABEL)&&t.LABEL!==""}var vP="parent",PE="categories",LE="label",ME="group",BE="push_mode",jE="pop_mode",UE="longer_alt",zE="line_breaks",$E="start_chars_hint";function xe(t){return IP(t)}function IP(t){let e=t.pattern,r={};if(r.name=t.name,Ft(e)||(r.PATTERN=e),Z(t,vP))throw`The parent property is no longer supported.
171
- See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Z(t,PE)&&(r.CATEGORIES=t[PE]),fn([r]),Z(t,LE)&&(r.LABEL=t[LE]),Z(t,ME)&&(r.GROUP=t[ME]),Z(t,jE)&&(r.POP_MODE=t[jE]),Z(t,BE)&&(r.PUSH_MODE=t[BE]),Z(t,UE)&&(r.LONGER_ALT=t[UE]),Z(t,zE)&&(r.LINE_BREAKS=t[zE]),Z(t,$E)&&(r.START_CHARS_HINT=t[$E]),r}var Cr=xe({name:"EOF",pattern:Se.NA});fn([Cr]);function Bi(t,e,r,n,i,o,s,a){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:o,startColumn:s,endColumn:a,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function Ip(t,e){return cn(t,e)}var nl={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${vp(t)?`--> ${Mi(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){let o="Expecting: ",a=`
172
- but found: '`+kt(e).image+"'";if(n)return o+n+a;{let u=mt(t,(p,d)=>p.concat(d),[]),l=q(u,p=>`[${q(p,d=>Mi(d)).join(", ")}]`),f=`one of these possible Token sequences:
166
+ `+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,o,s,a,u,l,c,f,p,d,m,y,g,b,C,w=e,D=w.length,R=0,S=0,de=this.hasCustom?0:Math.floor(e.length/10),ye=new Array(de),be=[],_=this.trackStartLines?1:void 0,L=this.trackStartLines?1:void 0,F=uE(this.emptyGroups),v=this.trackStartLines,P=this.config.lineTerminatorsPattern,j=0,ae=[],ee=[],_e=[],rt=[];Object.freeze(rt);let x;function Ue(){return ae}function Je(he){let oe=Ur(he),ce=ee[oe];return ce===void 0?rt:ce}let E=he=>{if(_e.length===1&&he.tokenType.PUSH_MODE===void 0){let oe=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(he);be.push({offset:he.startOffset,line:he.startLine,column:he.startColumn,length:he.image.length,message:oe})}else{_e.pop();let oe=Br(_e);ae=this.patternIdxToConfig[oe],ee=this.charCodeToPatternIdxToConfig[oe],j=ae.length;let ce=this.canModeBeOptimized[oe]&&this.config.safeMode===!1;ee&&ce?x=Je:x=Ue}};function W(he){_e.push(he),ee=this.charCodeToPatternIdxToConfig[he],ae=this.patternIdxToConfig[he],j=ae.length,j=ae.length;let oe=this.canModeBeOptimized[he]&&this.config.safeMode===!1;ee&&oe?x=Je:x=Ue}W.call(this,r);let Ke,ne=this.config.recoveryEnabled;for(;R<D;){u=null;let he=w.charCodeAt(R),oe=x(he),ce=oe.length;for(n=0;n<ce;n++){Ke=oe[n];let me=Ke.pattern;l=null;let Ce=Ke.short;if(Ce!==!1?he===Ce&&(u=me):Ke.isCustom===!0?(C=me.exec(w,R,ye,F),C!==null?(u=C[0],C.payload!==void 0&&(l=C.payload)):u=null):(this.updateLastIndex(me,R),u=this.match(me,e,R)),u!==null){if(a=Ke.longerAlt,a!==void 0){let Fe=a.length;for(o=0;o<Fe;o++){let ze=ae[a[o]],Ut=ze.pattern;if(c=null,ze.isCustom===!0?(C=Ut.exec(w,R,ye,F),C!==null?(s=C[0],C.payload!==void 0&&(c=C.payload)):s=null):(this.updateLastIndex(Ut,R),s=this.match(Ut,e,R)),s&&s.length>u.length){u=s,l=c,Ke=ze;break}}}break}}if(u!==null){if(f=u.length,p=Ke.group,p!==void 0&&(d=Ke.tokenTypeIdx,m=this.createTokenInstance(u,R,d,Ke.tokenType,_,L,f),this.handlePayload(m,l),p===!1?S=this.addToken(ye,S,m):F[p].push(m)),e=this.chopInput(e,f),R=R+f,L=this.computeNewColumn(L,f),v===!0&&Ke.canLineTerminator===!0){let me=0,Ce,Fe;P.lastIndex=0;do Ce=P.test(u),Ce===!0&&(Fe=P.lastIndex-1,me++);while(Ce===!0);me!==0&&(_=_+me,L=f-Fe,this.updateTokenEndLineColumnLocation(m,p,Fe,me,_,L,f))}this.handleModes(Ke,E,W,m)}else{let me=R,Ce=_,Fe=L,ze=ne===!1;for(;ze===!1&&R<D;)for(e=this.chopInput(e,1),R++,i=0;i<j;i++){let Ut=ae[i],A=Ut.pattern,k=Ut.short;if(k!==!1?w.charCodeAt(R)===k&&(ze=!0):Ut.isCustom===!0?ze=A.exec(w,R,ye,F)!==null:(this.updateLastIndex(A,R),ze=A.exec(e)!==null),ze===!0)break}if(y=R-me,L=this.computeNewColumn(L,y),b=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(w,me,y,Ce,Fe),be.push({offset:me,line:Ce,column:Fe,length:y,message:b}),ne===!1)break}}return this.hasCustom||(ye.length=S),{tokens:ye,groups:F,errors:be}}handleModes(e,r,n,i){if(e.pop===!0){let o=e.push;r(i),o!==void 0&&n.call(this,o)}else e.push!==void 0&&n.call(this,e.push)}chopInput(e,r){return e.substring(r)}updateLastIndex(e,r){e.lastIndex=r}updateTokenEndLineColumnLocation(e,r,n,i,o,s,a){let u,l;r!==void 0&&(u=n===a-1,l=u?-1:0,i===1&&u===!0||(e.endLine=o+l,e.endColumn=s-1+-l))}computeNewColumn(e,r){return e+r}createOffsetOnlyToken(e,r,n,i){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:i}}createStartOnlyToken(e,r,n,i,o,s){return{image:e,startOffset:r,startLine:o,startColumn:s,tokenTypeIdx:n,tokenType:i}}createFullToken(e,r,n,i,o,s,a){return{image:e,startOffset:r,endOffset:r+a-1,startLine:o,endLine:o,startColumn:s,endColumn:s+a-1,tokenTypeIdx:n,tokenType:i}}addTokenUsingPush(e,r,n){return e.push(n),r}addTokenUsingMemberAccess(e,r,n){return e[r]=n,r++,r}handlePayloadNoCustom(e,r){}handlePayloadWithCustom(e,r){r!==null&&(e.payload=r)}matchWithTest(e,r,n){return e.test(r)===!0?r.substring(n,e.lastIndex):null}matchWithExec(e,r){let n=e.exec(r);return n!==null?n[0]:null}};Se.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";Se.NA=/NOT_APPLICABLE/;function Fi(t){return Ap(t)?t.LABEL:t.name}function Ap(t){return yt(t.LABEL)&&t.LABEL!==""}var eP="parent",yE="categories",bE="label",EE="group",AE="push_mode",wE="pop_mode",CE="longer_alt",kE="line_breaks",TE="start_chars_hint";function xe(t){return tP(t)}function tP(t){let e=t.pattern,r={};if(r.name=t.name,Ot(e)||(r.PATTERN=e),Z(t,eP))throw`The parent property is no longer supported.
167
+ See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Z(t,yE)&&(r.CATEGORIES=t[yE]),an([r]),Z(t,bE)&&(r.LABEL=t[bE]),Z(t,EE)&&(r.GROUP=t[EE]),Z(t,wE)&&(r.POP_MODE=t[wE]),Z(t,AE)&&(r.PUSH_MODE=t[AE]),Z(t,CE)&&(r.LONGER_ALT=t[CE]),Z(t,kE)&&(r.LINE_BREAKS=t[kE]),Z(t,TE)&&(r.START_CHARS_HINT=t[TE]),r}var xr=xe({name:"EOF",pattern:Se.NA});an([xr]);function Ni(t,e,r,n,i,o,s,a){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:o,startColumn:s,endColumn:a,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function wp(t,e){return sn(t,e)}var el={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${Ap(t)?`--> ${Fi(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){let o="Expecting: ",a=`
168
+ but found: '`+wt(e).image+"'";if(n)return o+n+a;{let u=dt(t,(p,d)=>p.concat(d),[]),l=q(u,p=>`[${q(p,d=>Fi(d)).join(", ")}]`),f=`one of these possible Token sequences:
173
169
  ${q(l,(p,d)=>` ${d+1}. ${p}`).join(`
174
170
  `)}`;return o+f+a}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){let i="Expecting: ",s=`
175
- but found: '`+kt(e).image+"'";if(r)return i+r+s;{let u=`expecting at least one iteration which starts with one of these possible Token sequences::
176
- <${q(t,l=>`[${q(l,c=>Mi(c)).join(",")}]`).join(" ,")}>`;return i+u+s}}};Object.freeze(nl);var qE={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
177
- inside top level rule: ->`+t.name+"<-"}},wr={buildDuplicateFoundError(t,e){function r(c){return c instanceof Ie?c.terminalType.name:c instanceof Be?c.nonTerminalName:""}let n=t.name,i=kt(e),o=i.idx,s=Kt(i),a=r(i),u=o>0,l=`->${s}${u?o:""}<- ${a?`with argument: ->${a}<-`:""}
171
+ but found: '`+wt(e).image+"'";if(r)return i+r+s;{let u=`expecting at least one iteration which starts with one of these possible Token sequences::
172
+ <${q(t,l=>`[${q(l,c=>Fi(c)).join(",")}]`).join(" ,")}>`;return i+u+s}}};Object.freeze(el);var _E={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
173
+ inside top level rule: ->`+t.name+"<-"}},yr={buildDuplicateFoundError(t,e){function r(c){return c instanceof Ie?c.terminalType.name:c instanceof Be?c.nonTerminalName:""}let n=t.name,i=wt(e),o=i.idx,s=Gt(i),a=r(i),u=o>0,l=`->${s}${u?o:""}<- ${a?`with argument: ->${a}<-`:""}
178
174
  appears more than once (${e.length} times) in the top level rule: ->${n}<-.
179
175
  For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
180
176
  `;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,`
@@ -182,14 +178,14 @@ inside top level rule: ->`+t.name+"<-"}},wr={buildDuplicateFoundError(t,e){funct
182
178
  The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
183
179
  To resolve this make sure each Terminal and Non-Terminal names are unique
184
180
  This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
185
- and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){let e=q(t.prefixPath,i=>Mi(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
181
+ and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){let e=q(t.prefixPath,i=>Fi(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
186
182
  in <OR${r}> inside <${t.topLevelRule.name}> Rule,
187
183
  <${e}> may appears as a prefix path in all these alternatives.
188
184
  See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
189
- For Further details.`},buildAlternationAmbiguityError(t){let e=q(t.prefixPath,i=>Mi(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${r}> inside <${t.topLevelRule.name}> Rule,
185
+ For Further details.`},buildAlternationAmbiguityError(t){let e=q(t.prefixPath,i=>Fi(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${r}> inside <${t.topLevelRule.name}> Rule,
190
186
  <${e}> may appears as a prefix path in all these alternatives.
191
187
  `;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
192
- For Further details.`,n},buildEmptyRepetitionError(t){let e=Kt(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
188
+ For Further details.`,n},buildEmptyRepetitionError(t){let e=Gt(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
193
189
  This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
194
190
  Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
195
191
  <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
@@ -198,51 +194,51 @@ rule: <${e}> can be invoked from itself (directly or indirectly)
198
194
  without consuming any Tokens. The grammar path that causes this is:
199
195
  ${n}
200
196
  To fix this refactor your grammar to remove the left recursion.
201
- see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Ut?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function VE(t,e){let r=new Op(t,e);return r.resolveRefs(),r.errors}var Op=class extends zt{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){G(Re(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:At.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}};var Dp=class extends ln{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Me(this.path.ruleStack).reverse(),this.occurrenceStack=Me(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){Te(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},il=class extends Dp{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let i=r.concat(n),o=new je({definition:i});this.possibleTokTypes=Ni(o),this.found=!0}}},Ho=class extends ln{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},ol=class extends Ho{walkMany(e,r,n){if(e.idx===this.occurrence){let i=kt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ie&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},zs=class extends Ho{walkManySep(e,r,n){if(e.idx===this.occurrence){let i=kt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ie&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},sl=class extends Ho{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){let i=kt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ie&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},$s=class extends Ho{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){let i=kt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ie&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}};function al(t,e,r=[]){r=Me(r);let n=[],i=0;function o(a){return a.concat(ut(t,i+1))}function s(a){let u=al(o(a),e,r);return n.concat(u)}for(;r.length<e&&i<t.length;){let a=t[i];if(a instanceof je)return s(a.definition);if(a instanceof Be)return s(a.definition);if(a instanceof Ge)n=s(a.definition);else if(a instanceof lt){let u=a.definition.concat([new De({definition:a.definition})]);return s(u)}else if(a instanceof ct){let u=[new je({definition:a.definition}),new De({definition:[new Ie({terminalType:a.separator})].concat(a.definition)})];return s(u)}else if(a instanceof rt){let u=a.definition.concat([new De({definition:[new Ie({terminalType:a.separator})].concat(a.definition)})]);n=s(u)}else if(a instanceof De){let u=a.definition.concat([new De({definition:a.definition})]);n=s(u)}else{if(a instanceof nt)return G(a.definition,u=>{Te(u.definition)===!1&&(n=s(u.definition))}),n;if(a instanceof Ie)r.push(a.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:ut(t,i)}),n}function ul(t,e,r,n){let i="EXIT_NONE_TERMINAL",o=[i],s="EXIT_ALTERNATIVE",a=!1,u=e.length,l=u-n-1,c=[],f=[];for(f.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Te(f);){let p=f.pop();if(p===s){a&&qr(f).idx<=l&&f.pop();continue}let d=p.def,m=p.idx,y=p.ruleStack,g=p.occurrenceStack;if(Te(d))continue;let b=d[0];if(b===i){let w={idx:m,def:ut(d),ruleStack:un(y),occurrenceStack:un(g)};f.push(w)}else if(b instanceof Ie)if(m<u-1){let w=m+1,C=e[w];if(r(C,b.terminalType)){let D={idx:w,def:ut(d),ruleStack:y,occurrenceStack:g};f.push(D)}}else if(m===u-1)c.push({nextTokenType:b.terminalType,nextTokenOccurrence:b.idx,ruleStack:y,occurrenceStack:g}),a=!0;else throw Error("non exhaustive match");else if(b instanceof Be){let w=Me(y);w.push(b.nonTerminalName);let C=Me(g);C.push(b.idx);let D={idx:m,def:b.definition.concat(o,ut(d)),ruleStack:w,occurrenceStack:C};f.push(D)}else if(b instanceof Ge){let w={idx:m,def:ut(d),ruleStack:y,occurrenceStack:g};f.push(w),f.push(s);let C={idx:m,def:b.definition.concat(ut(d)),ruleStack:y,occurrenceStack:g};f.push(C)}else if(b instanceof lt){let w=new De({definition:b.definition,idx:b.idx}),C=b.definition.concat([w],ut(d)),D={idx:m,def:C,ruleStack:y,occurrenceStack:g};f.push(D)}else if(b instanceof ct){let w=new Ie({terminalType:b.separator}),C=new De({definition:[w].concat(b.definition),idx:b.idx}),D=b.definition.concat([C],ut(d)),R={idx:m,def:D,ruleStack:y,occurrenceStack:g};f.push(R)}else if(b instanceof rt){let w={idx:m,def:ut(d),ruleStack:y,occurrenceStack:g};f.push(w),f.push(s);let C=new Ie({terminalType:b.separator}),D=new De({definition:[C].concat(b.definition),idx:b.idx}),R=b.definition.concat([D],ut(d)),S={idx:m,def:R,ruleStack:y,occurrenceStack:g};f.push(S)}else if(b instanceof De){let w={idx:m,def:ut(d),ruleStack:y,occurrenceStack:g};f.push(w),f.push(s);let C=new De({definition:b.definition,idx:b.idx}),D=b.definition.concat([C],ut(d)),R={idx:m,def:D,ruleStack:y,occurrenceStack:g};f.push(R)}else if(b instanceof nt)for(let w=b.definition.length-1;w>=0;w--){let C=b.definition[w],D={idx:m,def:C.definition.concat(ut(d)),ruleStack:y,occurrenceStack:g};f.push(D),f.push(s)}else if(b instanceof je)f.push({idx:m,def:b.definition.concat(ut(d)),ruleStack:y,occurrenceStack:g});else if(b instanceof Ut)f.push(OP(b,m,y,g));else throw Error("non exhaustive match")}return c}function OP(t,e,r,n){let i=Me(r);i.push(t.name);let o=Me(n);return o.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:o}}var Je;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(Je||(Je={}));function cl(t){if(t instanceof Ge||t==="Option")return Je.OPTION;if(t instanceof De||t==="Repetition")return Je.REPETITION;if(t instanceof lt||t==="RepetitionMandatory")return Je.REPETITION_MANDATORY;if(t instanceof ct||t==="RepetitionMandatoryWithSeparator")return Je.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof rt||t==="RepetitionWithSeparator")return Je.REPETITION_WITH_SEPARATOR;if(t instanceof nt||t==="Alternation")return Je.ALTERNATION;throw Error("non exhaustive match")}function WE(t,e,r,n,i,o){let s=qs(t,e,r),a=JE(s)?Wo:cn;return o(s,n,a,i)}function HE(t,e,r,n,i,o){let s=Vs(t,e,i,r),a=JE(s)?Wo:cn;return o(s[0],a,n)}function KE(t,e,r,n){let i=t.length,o=Dt(t,s=>Dt(s,a=>a.length===1));if(e)return function(s){let a=q(s,u=>u.GATE);for(let u=0;u<i;u++){let l=t[u],c=l.length,f=a[u];if(!(f!==void 0&&f.call(this)===!1))e:for(let p=0;p<c;p++){let d=l[p],m=d.length;for(let y=0;y<m;y++){let g=this.LA(y+1);if(r(g,d[y])===!1)continue e}return u}}};if(o&&!n){let s=q(t,u=>bt(u)),a=mt(s,(u,l,c)=>(G(l,f=>{Z(u,f.tokenTypeIdx)||(u[f.tokenTypeIdx]=c),G(f.categoryMatches,p=>{Z(u,p)||(u[p]=c)})}),u),{});return function(){let u=this.LA(1);return a[u.tokenTypeIdx]}}else return function(){for(let s=0;s<i;s++){let a=t[s],u=a.length;e:for(let l=0;l<u;l++){let c=a[l],f=c.length;for(let p=0;p<f;p++){let d=this.LA(p+1);if(r(d,c[p])===!1)continue e}return s}}}}function YE(t,e,r){let n=Dt(t,o=>o.length===1),i=t.length;if(n&&!r){let o=bt(t);if(o.length===1&&Te(o[0].categoryMatches)){let a=o[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}else{let s=mt(o,(a,u,l)=>(a[u.tokenTypeIdx]=!0,G(u.categoryMatches,c=>{a[c]=!0}),a),[]);return function(){let a=this.LA(1);return s[a.tokenTypeIdx]===!0}}}else return function(){e:for(let o=0;o<i;o++){let s=t[o],a=s.length;for(let u=0;u<a;u++){let l=this.LA(u+1);if(e(l,s[u])===!1)continue e}return!0}return!1}}var Fp=class extends ln{constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,Je.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,Je.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,Je.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,Je.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,Je.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}},ll=class extends zt{constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,Je.OPTION)}visitRepetition(e){this.checkIsTarget(e,Je.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,Je.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,Je.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,Je.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,Je.ALTERNATION)}};function GE(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function Rp(t){let e=[""];for(let r=0;r<t.length;r++){let n=t[r],i=[];for(let o=0;o<e.length;o++){let s=e[o];i.push(s+"_"+n.tokenTypeIdx);for(let a=0;a<n.categoryMatches.length;a++){let u="_"+n.categoryMatches[a];i.push(s+u)}}e=i}return e}function DP(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;let i=t[n];for(let o=0;o<e.length;o++){let s=e[o];if(i[s]===!0)return!1}}return!0}function ZE(t,e){let r=q(t,s=>al([s],1)),n=GE(r.length),i=q(r,s=>{let a={};return G(s,u=>{let l=Rp(u.partialPath);G(l,c=>{a[c]=!0})}),a}),o=r;for(let s=1;s<=e;s++){let a=o;o=GE(a.length);for(let u=0;u<a.length;u++){let l=a[u];for(let c=0;c<l.length;c++){let f=l[c].partialPath,p=l[c].suffixDef,d=Rp(f);if(DP(i,d,u)||Te(p)||f.length===e){let y=n[u];if(fl(y,f)===!1){y.push(f);for(let g=0;g<d.length;g++){let b=d[g];i[u][b]=!0}}}else{let y=al(p,s+1,f);o[u]=o[u].concat(y),G(y,g=>{let b=Rp(g.partialPath);G(b,w=>{i[u][w]=!0})})}}}}return n}function qs(t,e,r,n){let i=new ll(t,Je.ALTERNATION,n);return e.accept(i),ZE(i.result,r)}function Vs(t,e,r,n){let i=new ll(t,r);e.accept(i);let o=i.result,a=new Fp(e,t,r).startWalking(),u=new je({definition:o}),l=new je({definition:a});return ZE([u,l],n)}function fl(t,e){e:for(let r=0;r<t.length;r++){let n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){let o=e[i],s=n[i];if((o===s||s.categoryMatchesMap[o.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function XE(t,e){return t.length<e.length&&Dt(t,(r,n)=>{let i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function JE(t){return Dt(t,e=>Dt(e,r=>Dt(r,n=>Te(n.categoryMatches))))}function QE(t){let e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return q(e,r=>Object.assign({type:At.CUSTOM_LOOKAHEAD_VALIDATION},r))}function eA(t,e,r,n){let i=jt(t,u=>RP(u,r)),o=BP(t,e,r),s=jt(t,u=>PP(u,r)),a=jt(t,u=>NP(u,t,n,r));return i.concat(o,s,a)}function RP(t,e){let r=new Np;t.accept(r);let n=r.allProductions,i=mp(n,FP),o=Ht(i,a=>a.length>1);return q(Re(o),a=>{let u=kt(a),l=e.buildDuplicateFoundError(t,a),c=Kt(u),f={message:l,type:At.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:c,occurrence:u.idx},p=tA(u);return p&&(f.parameter=p),f})}function FP(t){return`${Kt(t)}_#_${t.idx}_#_${tA(t)}`}function tA(t){return t instanceof Ie?t.terminalType.name:t instanceof Be?t.nonTerminalName:""}var Np=class extends zt{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function NP(t,e,r,n){let i=[];if(mt(e,(s,a)=>a.name===t.name?s+1:s,0)>1){let s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:At.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function rA(t,e,r){let n=[],i;return He(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:At.INVALID_RULE_OVERRIDE,ruleName:t})),n}function Lp(t,e,r,n=[]){let i=[],o=pl(e.definition);if(Te(o))return[];{let s=t.name;He(o,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:At.LEFT_RECURSION,ruleName:s});let u=Un(o,n.concat([t])),l=jt(u,c=>{let f=Me(n);return f.push(c),Lp(t,c,r,f)});return i.concat(l)}}function pl(t){let e=[];if(Te(t))return e;let r=kt(t);if(r instanceof Be)e.push(r.referencedRule);else if(r instanceof je||r instanceof Ge||r instanceof lt||r instanceof ct||r instanceof rt||r instanceof De)e=e.concat(pl(r.definition));else if(r instanceof nt)e=bt(q(r.definition,o=>pl(o.definition)));else if(!(r instanceof Ie))throw Error("non exhaustive match");let n=Fi(r),i=t.length>1;if(n&&i){let o=ut(t);return e.concat(pl(o))}else return e}var Gs=class extends zt{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function nA(t,e){let r=new Gs;t.accept(r);let n=r.alternations;return jt(n,o=>{let s=un(o.definition);return jt(s,(a,u)=>{let l=ul([a],[],cn,1);return Te(l)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:o,emptyChoiceIdx:u}),type:At.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:o.idx,alternative:u+1}]:[]})})}function iA(t,e,r){let n=new Gs;t.accept(n);let i=n.alternations;return i=zn(i,s=>s.ignoreAmbiguities===!0),jt(i,s=>{let a=s.idx,u=s.maxLookahead||e,l=qs(a,t,u,s),c=LP(l,s,t,r),f=MP(l,s,t,r);return c.concat(f)})}var Pp=class extends zt{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function PP(t,e){let r=new Gs;t.accept(r);let n=r.alternations;return jt(n,o=>o.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:o}),type:At.TOO_MANY_ALTS,ruleName:t.name,occurrence:o.idx}]:[])}function oA(t,e,r){let n=[];return G(t,i=>{let o=new Pp;i.accept(o);let s=o.allProductions;G(s,a=>{let u=cl(a),l=a.maxLookahead||e,c=a.idx,p=Vs(c,i,u,l)[0];if(Te(bt(p))){let d=r.buildEmptyRepetitionError({topLevelRule:i,repetition:a});n.push({message:d,type:At.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function LP(t,e,r,n){let i=[],o=mt(t,(a,u,l)=>(e.definition[l].ignoreAmbiguities===!0||G(u,c=>{let f=[l];G(t,(p,d)=>{l!==d&&fl(p,c)&&e.definition[d].ignoreAmbiguities!==!0&&f.push(d)}),f.length>1&&!fl(i,c)&&(i.push(c),a.push({alts:f,path:c}))}),a),[]);return q(o,a=>{let u=q(a.alts,c=>c+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:u,prefixPath:a.path}),type:At.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:a.alts}})}function MP(t,e,r,n){let i=mt(t,(s,a,u)=>{let l=q(a,c=>({idx:u,path:c}));return s.concat(l)},[]);return $r(jt(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];let u=s.idx,l=s.path,c=Rt(i,p=>e.definition[p.idx].ignoreAmbiguities!==!0&&p.idx<u&&XE(p.path,l));return q(c,p=>{let d=[p.idx+1,u+1],m=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:d,prefixPath:p.path}),type:At.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:m,alternatives:d}})}))}function BP(t,e,r){let n=[],i=q(e,o=>o.name);return G(t,o=>{let s=o.name;if(He(i,s)){let a=r.buildNamespaceConflictError(o);n.push({message:a,type:At.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function sA(t){let e=Bo(t,{errMsgProvider:qE}),r={};return G(t.rules,n=>{r[n.name]=n}),VE(r,e.errMsgProvider)}function aA(t){return t=Bo(t,{errMsgProvider:wr}),eA(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}var uA="MismatchedTokenException",lA="NoViableAltException",cA="EarlyExitException",fA="NotAllInputParsedException",pA=[uA,lA,cA,fA];Object.freeze(pA);function qn(t){return He(pA,t.name)}var Ko=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},ji=class extends Ko{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=uA}},Ws=class extends Ko{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=lA}},Hs=class extends Ko{constructor(e,r){super(e,r),this.name=fA}},Ks=class extends Ko{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=cA}};var Mp={},jp="InRuleRecoveryException",Bp=class extends Error{constructor(e){super(e),this.name=jp}},dl=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Z(e,"recoveryEnabled")?e.recoveryEnabled:$t.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=jP)}getTokenToInsert(e){let r=Bi(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){let o=this.findReSyncTokenType(),s=this.exportLexerState(),a=[],u=!1,l=this.LA(1),c=this.LA(1),f=()=>{let p=this.LA(0),d=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:l,previous:p,ruleName:this.getCurrRuleFullName()}),m=new ji(d,l,this.LA(0));m.resyncedTokens=un(a),this.SAVE_ERROR(m)};for(;!u;)if(this.tokenMatcher(c,i)){f();return}else if(n.call(this)){f(),e.apply(this,r);return}else this.tokenMatcher(c,o)?u=!0:(c=this.SKIP_TOKEN(),this.addToResyncTokens(c,a));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){let n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new Bp("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Te(r))return!1;let n=this.LA(1);return Vr(r,o=>this.tokenMatcher(n,o))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return He(n,e)}findReSyncTokenType(){let e=this.flattenFollowSet(),r=this.LA(1),n=2;for(;;){let i=Vr(e,o=>Ip(r,o));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Mp;let e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return q(e,(n,i)=>i===0?Mp:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){let e=q(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return bt(e)}getFollowSetFromFollowKey(e){if(e===Mp)return[Cr];let r=e.ruleName+e.idxInCallingRule+Yu+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,Cr)||r.push(e),r}reSyncTo(e){let r=[],n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return un(r)}attemptInRepetitionRecovery(e,r,n,i,o,s,a){}getCurrentGrammarPath(e,r){let n=this.getHumanReadableRuleStack(),i=Me(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return q(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function jP(t,e,r,n,i,o,s){let a=this.getKeyForAutomaticLookahead(n,i),u=this.firstAfterRepMap[a];if(u===void 0){let p=this.getCurrRuleFullName(),d=this.getGAstProductions()[p];u=new o(d,i).startWalking(),this.firstAfterRepMap[a]=u}let l=u.token,c=u.occurrence,f=u.isEndOfRule;this.RULE_STACK.length===1&&f&&l===void 0&&(l=Cr,c=1),!(l===void 0||c===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,c,s)&&this.tryInRepetitionRecovery(t,e,r,l)}function hl(t,e,r){return r|e|t}var Ys=class{constructor(e){var r;this.maxLookahead=(r=e?.maxLookahead)!==null&&r!==void 0?r:$t.maxLookahead}validate(e){let r=this.validateNoLeftRecursion(e.rules);if(Te(r)){let n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),o=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...o]}return r}validateNoLeftRecursion(e){return jt(e,r=>Lp(r,r,wr))}validateEmptyOrAlternatives(e){return jt(e,r=>nA(r,wr))}validateAmbiguousAlternationAlternatives(e,r){return jt(e,n=>iA(n,r,wr))}validateSomeNonEmptyLookaheadPath(e,r){return oA(e,r,wr)}buildLookaheadForAlternation(e){return WE(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,KE)}buildLookaheadForOptional(e){return HE(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,cl(e.prodType),YE)}};var gl=class{initLooksAhead(e){this.dynamicTokensEnabled=Z(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:$t.dynamicTokensEnabled,this.maxLookahead=Z(e,"maxLookahead")?e.maxLookahead:$t.maxLookahead,this.lookaheadStrategy=Z(e,"lookaheadStrategy")?e.lookaheadStrategy:new Ys({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){G(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:o,repetitionMandatory:s,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:u}=UP(r);G(n,l=>{let c=l.idx===0?"":l.idx;this.TRACE_INIT(`${Kt(l)}${c}`,()=>{let f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:r,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),p=hl(this.fullRuleNameToShort[r.name],256,l.idx);this.setLaFuncCache(p,f)})}),G(i,l=>{this.computeLookaheadFunc(r,l.idx,768,"Repetition",l.maxLookahead,Kt(l))}),G(o,l=>{this.computeLookaheadFunc(r,l.idx,512,"Option",l.maxLookahead,Kt(l))}),G(s,l=>{this.computeLookaheadFunc(r,l.idx,1024,"RepetitionMandatory",l.maxLookahead,Kt(l))}),G(a,l=>{this.computeLookaheadFunc(r,l.idx,1536,"RepetitionMandatoryWithSeparator",l.maxLookahead,Kt(l))}),G(u,l=>{this.computeLookaheadFunc(r,l.idx,1280,"RepetitionWithSeparator",l.maxLookahead,Kt(l))})})})}computeLookaheadFunc(e,r,n,i,o,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{let a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:o||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),u=hl(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(u,a)})}getKeyForAutomaticLookahead(e,r){let n=this.getLastExplicitRuleShortName();return hl(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},Up=class extends zt{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},ml=new Up;function UP(t){ml.reset(),t.accept(ml);let e=ml.dslMethods;return ml.reset(),e}function qp(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function Vp(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function dA(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function hA(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}var zP="name";function Gp(t,e){Object.defineProperty(t,zP,{enumerable:!1,configurable:!0,writable:!1,value:e})}function $P(t,e){let r=Pe(t),n=r.length;for(let i=0;i<n;i++){let o=r[i],s=t[o],a=s.length;for(let u=0;u<a;u++){let l=s[u];l.tokenTypeIdx===void 0&&this[l.name](l.children,e)}}}function mA(t,e){let r=function(){};Gp(r,t+"BaseSemantics");let n={visit:function(i,o){if(J(i)&&(i=i[0]),!Ft(i))return this[i.name](i.children,o)},validateVisitor:function(){let i=qP(this,e);if(!Te(i)){let o=q(i,s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
197
+ see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Mt?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function SE(t,e){let r=new Cp(t,e);return r.resolveRefs(),r.errors}var Cp=class extends Bt{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){G(Re(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:bt.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}};var kp=class extends on{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Me(this.path.ruleStack).reverse(),this.occurrenceStack=Me(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){Te(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},tl=class extends kp{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let i=r.concat(n),o=new je({definition:i});this.possibleTokTypes=Oi(o),this.found=!0}}},zo=class extends on{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},rl=class extends zo{walkMany(e,r,n){if(e.idx===this.occurrence){let i=wt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ie&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},Ps=class extends zo{walkManySep(e,r,n){if(e.idx===this.occurrence){let i=wt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ie&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},nl=class extends zo{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){let i=wt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ie&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},Ls=class extends zo{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){let i=wt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ie&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}};function il(t,e,r=[]){r=Me(r);let n=[],i=0;function o(a){return a.concat(st(t,i+1))}function s(a){let u=il(o(a),e,r);return n.concat(u)}for(;r.length<e&&i<t.length;){let a=t[i];if(a instanceof je)return s(a.definition);if(a instanceof Be)return s(a.definition);if(a instanceof Ge)n=s(a.definition);else if(a instanceof at){let u=a.definition.concat([new De({definition:a.definition})]);return s(u)}else if(a instanceof ut){let u=[new je({definition:a.definition}),new De({definition:[new Ie({terminalType:a.separator})].concat(a.definition)})];return s(u)}else if(a instanceof et){let u=a.definition.concat([new De({definition:[new Ie({terminalType:a.separator})].concat(a.definition)})]);n=s(u)}else if(a instanceof De){let u=a.definition.concat([new De({definition:a.definition})]);n=s(u)}else{if(a instanceof tt)return G(a.definition,u=>{Te(u.definition)===!1&&(n=s(u.definition))}),n;if(a instanceof Ie)r.push(a.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:st(t,i)}),n}function ol(t,e,r,n){let i="EXIT_NONE_TERMINAL",o=[i],s="EXIT_ALTERNATIVE",a=!1,u=e.length,l=u-n-1,c=[],f=[];for(f.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Te(f);){let p=f.pop();if(p===s){a&&Br(f).idx<=l&&f.pop();continue}let d=p.def,m=p.idx,y=p.ruleStack,g=p.occurrenceStack;if(Te(d))continue;let b=d[0];if(b===i){let C={idx:m,def:st(d),ruleStack:nn(y),occurrenceStack:nn(g)};f.push(C)}else if(b instanceof Ie)if(m<u-1){let C=m+1,w=e[C];if(r(w,b.terminalType)){let D={idx:C,def:st(d),ruleStack:y,occurrenceStack:g};f.push(D)}}else if(m===u-1)c.push({nextTokenType:b.terminalType,nextTokenOccurrence:b.idx,ruleStack:y,occurrenceStack:g}),a=!0;else throw Error("non exhaustive match");else if(b instanceof Be){let C=Me(y);C.push(b.nonTerminalName);let w=Me(g);w.push(b.idx);let D={idx:m,def:b.definition.concat(o,st(d)),ruleStack:C,occurrenceStack:w};f.push(D)}else if(b instanceof Ge){let C={idx:m,def:st(d),ruleStack:y,occurrenceStack:g};f.push(C),f.push(s);let w={idx:m,def:b.definition.concat(st(d)),ruleStack:y,occurrenceStack:g};f.push(w)}else if(b instanceof at){let C=new De({definition:b.definition,idx:b.idx}),w=b.definition.concat([C],st(d)),D={idx:m,def:w,ruleStack:y,occurrenceStack:g};f.push(D)}else if(b instanceof ut){let C=new Ie({terminalType:b.separator}),w=new De({definition:[C].concat(b.definition),idx:b.idx}),D=b.definition.concat([w],st(d)),R={idx:m,def:D,ruleStack:y,occurrenceStack:g};f.push(R)}else if(b instanceof et){let C={idx:m,def:st(d),ruleStack:y,occurrenceStack:g};f.push(C),f.push(s);let w=new Ie({terminalType:b.separator}),D=new De({definition:[w].concat(b.definition),idx:b.idx}),R=b.definition.concat([D],st(d)),S={idx:m,def:R,ruleStack:y,occurrenceStack:g};f.push(S)}else if(b instanceof De){let C={idx:m,def:st(d),ruleStack:y,occurrenceStack:g};f.push(C),f.push(s);let w=new De({definition:b.definition,idx:b.idx}),D=b.definition.concat([w],st(d)),R={idx:m,def:D,ruleStack:y,occurrenceStack:g};f.push(R)}else if(b instanceof tt)for(let C=b.definition.length-1;C>=0;C--){let w=b.definition[C],D={idx:m,def:w.definition.concat(st(d)),ruleStack:y,occurrenceStack:g};f.push(D),f.push(s)}else if(b instanceof je)f.push({idx:m,def:b.definition.concat(st(d)),ruleStack:y,occurrenceStack:g});else if(b instanceof Mt)f.push(rP(b,m,y,g));else throw Error("non exhaustive match")}return c}function rP(t,e,r,n){let i=Me(r);i.push(t.name);let o=Me(n);return o.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:o}}var Xe;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(Xe||(Xe={}));function al(t){if(t instanceof Ge||t==="Option")return Xe.OPTION;if(t instanceof De||t==="Repetition")return Xe.REPETITION;if(t instanceof at||t==="RepetitionMandatory")return Xe.REPETITION_MANDATORY;if(t instanceof ut||t==="RepetitionMandatoryWithSeparator")return Xe.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof et||t==="RepetitionWithSeparator")return Xe.REPETITION_WITH_SEPARATOR;if(t instanceof tt||t==="Alternation")return Xe.ALTERNATION;throw Error("non exhaustive match")}function IE(t,e,r,n,i,o){let s=Ms(t,e,r),a=PE(s)?Uo:sn;return o(s,n,a,i)}function OE(t,e,r,n,i,o){let s=Bs(t,e,i,r),a=PE(s)?Uo:sn;return o(s[0],a,n)}function DE(t,e,r,n){let i=t.length,o=vt(t,s=>vt(s,a=>a.length===1));if(e)return function(s){let a=q(s,u=>u.GATE);for(let u=0;u<i;u++){let l=t[u],c=l.length,f=a[u];if(!(f!==void 0&&f.call(this)===!1))e:for(let p=0;p<c;p++){let d=l[p],m=d.length;for(let y=0;y<m;y++){let g=this.LA(y+1);if(r(g,d[y])===!1)continue e}return u}}};if(o&&!n){let s=q(t,u=>xt(u)),a=dt(s,(u,l,c)=>(G(l,f=>{Z(u,f.tokenTypeIdx)||(u[f.tokenTypeIdx]=c),G(f.categoryMatches,p=>{Z(u,p)||(u[p]=c)})}),u),{});return function(){let u=this.LA(1);return a[u.tokenTypeIdx]}}else return function(){for(let s=0;s<i;s++){let a=t[s],u=a.length;e:for(let l=0;l<u;l++){let c=a[l],f=c.length;for(let p=0;p<f;p++){let d=this.LA(p+1);if(r(d,c[p])===!1)continue e}return s}}}}function RE(t,e,r){let n=vt(t,o=>o.length===1),i=t.length;if(n&&!r){let o=xt(t);if(o.length===1&&Te(o[0].categoryMatches)){let a=o[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}else{let s=dt(o,(a,u,l)=>(a[u.tokenTypeIdx]=!0,G(u.categoryMatches,c=>{a[c]=!0}),a),[]);return function(){let a=this.LA(1);return s[a.tokenTypeIdx]===!0}}}else return function(){e:for(let o=0;o<i;o++){let s=t[o],a=s.length;for(let u=0;u<a;u++){let l=this.LA(u+1);if(e(l,s[u])===!1)continue e}return!0}return!1}}var _p=class extends on{constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,Xe.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,Xe.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,Xe.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,Xe.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,Xe.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}},sl=class extends Bt{constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,Xe.OPTION)}visitRepetition(e){this.checkIsTarget(e,Xe.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,Xe.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,Xe.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,Xe.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,Xe.ALTERNATION)}};function vE(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function Tp(t){let e=[""];for(let r=0;r<t.length;r++){let n=t[r],i=[];for(let o=0;o<e.length;o++){let s=e[o];i.push(s+"_"+n.tokenTypeIdx);for(let a=0;a<n.categoryMatches.length;a++){let u="_"+n.categoryMatches[a];i.push(s+u)}}e=i}return e}function nP(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;let i=t[n];for(let o=0;o<e.length;o++){let s=e[o];if(i[s]===!0)return!1}}return!0}function FE(t,e){let r=q(t,s=>il([s],1)),n=vE(r.length),i=q(r,s=>{let a={};return G(s,u=>{let l=Tp(u.partialPath);G(l,c=>{a[c]=!0})}),a}),o=r;for(let s=1;s<=e;s++){let a=o;o=vE(a.length);for(let u=0;u<a.length;u++){let l=a[u];for(let c=0;c<l.length;c++){let f=l[c].partialPath,p=l[c].suffixDef,d=Tp(f);if(nP(i,d,u)||Te(p)||f.length===e){let y=n[u];if(ul(y,f)===!1){y.push(f);for(let g=0;g<d.length;g++){let b=d[g];i[u][b]=!0}}}else{let y=il(p,s+1,f);o[u]=o[u].concat(y),G(y,g=>{let b=Tp(g.partialPath);G(b,C=>{i[u][C]=!0})})}}}}return n}function Ms(t,e,r,n){let i=new sl(t,Xe.ALTERNATION,n);return e.accept(i),FE(i.result,r)}function Bs(t,e,r,n){let i=new sl(t,r);e.accept(i);let o=i.result,a=new _p(e,t,r).startWalking(),u=new je({definition:o}),l=new je({definition:a});return FE([u,l],n)}function ul(t,e){e:for(let r=0;r<t.length;r++){let n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){let o=e[i],s=n[i];if((o===s||s.categoryMatchesMap[o.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function NE(t,e){return t.length<e.length&&vt(t,(r,n)=>{let i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function PE(t){return vt(t,e=>vt(e,r=>vt(r,n=>Te(n.categoryMatches))))}function LE(t){let e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return q(e,r=>Object.assign({type:bt.CUSTOM_LOOKAHEAD_VALIDATION},r))}function ME(t,e,r,n){let i=Lt(t,u=>iP(u,r)),o=cP(t,e,r),s=Lt(t,u=>aP(u,r)),a=Lt(t,u=>sP(u,t,n,r));return i.concat(o,s,a)}function iP(t,e){let r=new Sp;t.accept(r);let n=r.allProductions,i=up(n,oP),o=Vt(i,a=>a.length>1);return q(Re(o),a=>{let u=wt(a),l=e.buildDuplicateFoundError(t,a),c=Gt(u),f={message:l,type:bt.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:c,occurrence:u.idx},p=BE(u);return p&&(f.parameter=p),f})}function oP(t){return`${Gt(t)}_#_${t.idx}_#_${BE(t)}`}function BE(t){return t instanceof Ie?t.terminalType.name:t instanceof Be?t.nonTerminalName:""}var Sp=class extends Bt{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function sP(t,e,r,n){let i=[];if(dt(e,(s,a)=>a.name===t.name?s+1:s,0)>1){let s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:bt.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function jE(t,e,r){let n=[],i;return We(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:bt.INVALID_RULE_OVERRIDE,ruleName:t})),n}function Ip(t,e,r,n=[]){let i=[],o=ll(e.definition);if(Te(o))return[];{let s=t.name;We(o,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:bt.LEFT_RECURSION,ruleName:s});let u=Ln(o,n.concat([t])),l=Lt(u,c=>{let f=Me(n);return f.push(c),Ip(t,c,r,f)});return i.concat(l)}}function ll(t){let e=[];if(Te(t))return e;let r=wt(t);if(r instanceof Be)e.push(r.referencedRule);else if(r instanceof je||r instanceof Ge||r instanceof at||r instanceof ut||r instanceof et||r instanceof De)e=e.concat(ll(r.definition));else if(r instanceof tt)e=xt(q(r.definition,o=>ll(o.definition)));else if(!(r instanceof Ie))throw Error("non exhaustive match");let n=Ii(r),i=t.length>1;if(n&&i){let o=st(t);return e.concat(ll(o))}else return e}var js=class extends Bt{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function UE(t,e){let r=new js;t.accept(r);let n=r.alternations;return Lt(n,o=>{let s=nn(o.definition);return Lt(s,(a,u)=>{let l=ol([a],[],sn,1);return Te(l)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:o,emptyChoiceIdx:u}),type:bt.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:o.idx,alternative:u+1}]:[]})})}function zE(t,e,r){let n=new js;t.accept(n);let i=n.alternations;return i=Mn(i,s=>s.ignoreAmbiguities===!0),Lt(i,s=>{let a=s.idx,u=s.maxLookahead||e,l=Ms(a,t,u,s),c=uP(l,s,t,r),f=lP(l,s,t,r);return c.concat(f)})}var vp=class extends Bt{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function aP(t,e){let r=new js;t.accept(r);let n=r.alternations;return Lt(n,o=>o.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:o}),type:bt.TOO_MANY_ALTS,ruleName:t.name,occurrence:o.idx}]:[])}function $E(t,e,r){let n=[];return G(t,i=>{let o=new vp;i.accept(o);let s=o.allProductions;G(s,a=>{let u=al(a),l=a.maxLookahead||e,c=a.idx,p=Bs(c,i,u,l)[0];if(Te(xt(p))){let d=r.buildEmptyRepetitionError({topLevelRule:i,repetition:a});n.push({message:d,type:bt.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function uP(t,e,r,n){let i=[],o=dt(t,(a,u,l)=>(e.definition[l].ignoreAmbiguities===!0||G(u,c=>{let f=[l];G(t,(p,d)=>{l!==d&&ul(p,c)&&e.definition[d].ignoreAmbiguities!==!0&&f.push(d)}),f.length>1&&!ul(i,c)&&(i.push(c),a.push({alts:f,path:c}))}),a),[]);return q(o,a=>{let u=q(a.alts,c=>c+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:u,prefixPath:a.path}),type:bt.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:a.alts}})}function lP(t,e,r,n){let i=dt(t,(s,a,u)=>{let l=q(a,c=>({idx:u,path:c}));return s.concat(l)},[]);return Mr(Lt(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];let u=s.idx,l=s.path,c=It(i,p=>e.definition[p.idx].ignoreAmbiguities!==!0&&p.idx<u&&NE(p.path,l));return q(c,p=>{let d=[p.idx+1,u+1],m=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:d,prefixPath:p.path}),type:bt.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:m,alternatives:d}})}))}function cP(t,e,r){let n=[],i=q(e,o=>o.name);return G(t,o=>{let s=o.name;if(We(i,s)){let a=r.buildNamespaceConflictError(o);n.push({message:a,type:bt.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function qE(t){let e=Ro(t,{errMsgProvider:_E}),r={};return G(t.rules,n=>{r[n.name]=n}),SE(r,e.errMsgProvider)}function VE(t){return t=Ro(t,{errMsgProvider:yr}),ME(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}var GE="MismatchedTokenException",WE="NoViableAltException",HE="EarlyExitException",KE="NotAllInputParsedException",YE=[GE,WE,HE,KE];Object.freeze(YE);function jn(t){return We(YE,t.name)}var $o=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},Pi=class extends $o{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=GE}},Us=class extends $o{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=WE}},zs=class extends $o{constructor(e,r){super(e,r),this.name=KE}},$s=class extends $o{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=HE}};var Op={},Rp="InRuleRecoveryException",Dp=class extends Error{constructor(e){super(e),this.name=Rp}},cl=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Z(e,"recoveryEnabled")?e.recoveryEnabled:jt.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=fP)}getTokenToInsert(e){let r=Ni(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){let o=this.findReSyncTokenType(),s=this.exportLexerState(),a=[],u=!1,l=this.LA(1),c=this.LA(1),f=()=>{let p=this.LA(0),d=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:l,previous:p,ruleName:this.getCurrRuleFullName()}),m=new Pi(d,l,this.LA(0));m.resyncedTokens=nn(a),this.SAVE_ERROR(m)};for(;!u;)if(this.tokenMatcher(c,i)){f();return}else if(n.call(this)){f(),e.apply(this,r);return}else this.tokenMatcher(c,o)?u=!0:(c=this.SKIP_TOKEN(),this.addToResyncTokens(c,a));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){let n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new Dp("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Te(r))return!1;let n=this.LA(1);return jr(r,o=>this.tokenMatcher(n,o))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return We(n,e)}findReSyncTokenType(){let e=this.flattenFollowSet(),r=this.LA(1),n=2;for(;;){let i=jr(e,o=>wp(r,o));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Op;let e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return q(e,(n,i)=>i===0?Op:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){let e=q(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return xt(e)}getFollowSetFromFollowKey(e){if(e===Op)return[xr];let r=e.ruleName+e.idxInCallingRule+Wu+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,xr)||r.push(e),r}reSyncTo(e){let r=[],n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return nn(r)}attemptInRepetitionRecovery(e,r,n,i,o,s,a){}getCurrentGrammarPath(e,r){let n=this.getHumanReadableRuleStack(),i=Me(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return q(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function fP(t,e,r,n,i,o,s){let a=this.getKeyForAutomaticLookahead(n,i),u=this.firstAfterRepMap[a];if(u===void 0){let p=this.getCurrRuleFullName(),d=this.getGAstProductions()[p];u=new o(d,i).startWalking(),this.firstAfterRepMap[a]=u}let l=u.token,c=u.occurrence,f=u.isEndOfRule;this.RULE_STACK.length===1&&f&&l===void 0&&(l=xr,c=1),!(l===void 0||c===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,c,s)&&this.tryInRepetitionRecovery(t,e,r,l)}function fl(t,e,r){return r|e|t}var qs=class{constructor(e){var r;this.maxLookahead=(r=e?.maxLookahead)!==null&&r!==void 0?r:jt.maxLookahead}validate(e){let r=this.validateNoLeftRecursion(e.rules);if(Te(r)){let n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),o=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...o]}return r}validateNoLeftRecursion(e){return Lt(e,r=>Ip(r,r,yr))}validateEmptyOrAlternatives(e){return Lt(e,r=>UE(r,yr))}validateAmbiguousAlternationAlternatives(e,r){return Lt(e,n=>zE(n,r,yr))}validateSomeNonEmptyLookaheadPath(e,r){return $E(e,r,yr)}buildLookaheadForAlternation(e){return IE(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,DE)}buildLookaheadForOptional(e){return OE(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,al(e.prodType),RE)}};var dl=class{initLooksAhead(e){this.dynamicTokensEnabled=Z(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:jt.dynamicTokensEnabled,this.maxLookahead=Z(e,"maxLookahead")?e.maxLookahead:jt.maxLookahead,this.lookaheadStrategy=Z(e,"lookaheadStrategy")?e.lookaheadStrategy:new qs({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){G(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:o,repetitionMandatory:s,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:u}=pP(r);G(n,l=>{let c=l.idx===0?"":l.idx;this.TRACE_INIT(`${Gt(l)}${c}`,()=>{let f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:r,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),p=fl(this.fullRuleNameToShort[r.name],256,l.idx);this.setLaFuncCache(p,f)})}),G(i,l=>{this.computeLookaheadFunc(r,l.idx,768,"Repetition",l.maxLookahead,Gt(l))}),G(o,l=>{this.computeLookaheadFunc(r,l.idx,512,"Option",l.maxLookahead,Gt(l))}),G(s,l=>{this.computeLookaheadFunc(r,l.idx,1024,"RepetitionMandatory",l.maxLookahead,Gt(l))}),G(a,l=>{this.computeLookaheadFunc(r,l.idx,1536,"RepetitionMandatoryWithSeparator",l.maxLookahead,Gt(l))}),G(u,l=>{this.computeLookaheadFunc(r,l.idx,1280,"RepetitionWithSeparator",l.maxLookahead,Gt(l))})})})}computeLookaheadFunc(e,r,n,i,o,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{let a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:o||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),u=fl(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(u,a)})}getKeyForAutomaticLookahead(e,r){let n=this.getLastExplicitRuleShortName();return fl(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},Fp=class extends Bt{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},pl=new Fp;function pP(t){pl.reset(),t.accept(pl);let e=pl.dslMethods;return pl.reset(),e}function Lp(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function Mp(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function ZE(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function XE(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}var dP="name";function Bp(t,e){Object.defineProperty(t,dP,{enumerable:!1,configurable:!0,writable:!1,value:e})}function hP(t,e){let r=Pe(t),n=r.length;for(let i=0;i<n;i++){let o=r[i],s=t[o],a=s.length;for(let u=0;u<a;u++){let l=s[u];l.tokenTypeIdx===void 0&&this[l.name](l.children,e)}}}function JE(t,e){let r=function(){};Bp(r,t+"BaseSemantics");let n={visit:function(i,o){if(J(i)&&(i=i[0]),!Ot(i))return this[i.name](i.children,o)},validateVisitor:function(){let i=mP(this,e);if(!Te(i)){let o=q(i,s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
202
198
  ${o.join(`
203
199
 
204
200
  `).replace(/\n/g,`
205
- `)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function gA(t,e,r){let n=function(){};Gp(n,t+"BaseSemanticsWithDefaults");let i=Object.create(r.prototype);return G(e,o=>{i[o]=$P}),n.prototype=i,n.prototype.constructor=n,n}var Wp;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Wp||(Wp={}));function qP(t,e){return VP(t,e)}function VP(t,e){let r=Rt(e,i=>Bt(t[i])===!1),n=q(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:Wp.MISSING_METHOD,methodName:i}));return $r(n)}var El=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Z(e,"nodeLocationTracking")?e.nodeLocationTracking:$t.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Xe,this.cstFinallyStateUpdate=Xe,this.cstPostTerminal=Xe,this.cstPostNonTerminal=Xe,this.cstPostRule=Xe;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Vp,this.setNodeLocationFromNode=Vp,this.cstPostRule=Xe,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Xe,this.setNodeLocationFromNode=Xe,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=qp,this.setNodeLocationFromNode=qp,this.cstPostRule=Xe,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Xe,this.setNodeLocationFromNode=Xe,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Xe,this.setNodeLocationFromNode=Xe,this.cstPostRule=Xe,this.setInitialNodeLocation=Xe;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){let r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];dA(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];hA(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(Ft(this.baseCstVisitorConstructor)){let e=mA(this.className,Pe(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Ft(this.baseCstVisitorWithDefaultsConstructor)){let e=gA(this.className,Pe(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){let e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}};var Al=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Yo}LA(e){let r=this.currIdx+e;return r<0||this.tokVectorLength<=r?Yo:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}};var Cl=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=Zo){if(He(this.definedRulesNames,e)){let s={message:wr.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:At.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);let i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=Zo){let i=rA(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let o=this.defineRule(e,r,n);return this[e]=o,o}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(qn(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Ku(Re(this.gastProductionsCache))}};var wl=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Wo,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Z(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
201
+ `)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function QE(t,e,r){let n=function(){};Bp(n,t+"BaseSemanticsWithDefaults");let i=Object.create(r.prototype);return G(e,o=>{i[o]=hP}),n.prototype=i,n.prototype.constructor=n,n}var jp;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(jp||(jp={}));function mP(t,e){return gP(t,e)}function gP(t,e){let r=It(e,i=>Pt(t[i])===!1),n=q(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:jp.MISSING_METHOD,methodName:i}));return Mr(n)}var xl=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Z(e,"nodeLocationTracking")?e.nodeLocationTracking:jt.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Ze,this.cstFinallyStateUpdate=Ze,this.cstPostTerminal=Ze,this.cstPostNonTerminal=Ze,this.cstPostRule=Ze;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Mp,this.setNodeLocationFromNode=Mp,this.cstPostRule=Ze,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Ze,this.setNodeLocationFromNode=Ze,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Lp,this.setNodeLocationFromNode=Lp,this.cstPostRule=Ze,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Ze,this.setNodeLocationFromNode=Ze,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Ze,this.setNodeLocationFromNode=Ze,this.cstPostRule=Ze,this.setInitialNodeLocation=Ze;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){let r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];ZE(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];XE(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(Ot(this.baseCstVisitorConstructor)){let e=JE(this.className,Pe(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Ot(this.baseCstVisitorWithDefaultsConstructor)){let e=QE(this.className,Pe(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){let e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}};var yl=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):qo}LA(e){let r=this.currIdx+e;return r<0||this.tokVectorLength<=r?qo:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}};var bl=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=Vo){if(We(this.definedRulesNames,e)){let s={message:yr.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:bt.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);let i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=Vo){let i=jE(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let o=this.defineRule(e,r,n);return this[e]=o,o}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(jn(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Gu(Re(this.gastProductionsCache))}};var El=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Uo,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Z(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
206
202
  See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
207
203
  For Further details.`);if(J(e)){if(Te(e))throw Error(`A Token Vocabulary cannot be empty.
208
204
  Note that the first argument for the parser constructor
209
205
  is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
210
206
  See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
211
- For Further details.`)}if(J(e))this.tokensMap=mt(e,(o,s)=>(o[s.name]=s,o),{});else if(Z(e,"modes")&&Dt(bt(Re(e.modes)),NE)){let o=bt(Re(e.modes)),s=jo(o);this.tokensMap=mt(s,(a,u)=>(a[u.name]=u,a),{})}else if(Ze(e))this.tokensMap=Me(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Cr;let n=Z(e,"modes")?bt(Re(e.modes)):Re(e),i=Dt(n,o=>Te(o.categoryMatches));this.tokenMatcher=i?Wo:cn,fn(Re(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
212
- Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=Z(n,"resyncEnabled")?n.resyncEnabled:Zo.resyncEnabled,o=Z(n,"recoveryValueFunc")?n.recoveryValueFunc:Zo.recoveryValueFunc,s=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let a;return this.outputCst===!0?a=function(...c){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,c);let f=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(f),f}catch(f){return this.invokeRuleCatch(f,i,o)}finally{this.ruleFinallyStateUpdate()}}:a=function(...c){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,c)}catch(f){return this.invokeRuleCatch(f,i,o)}finally{this.ruleFinallyStateUpdate()}},Object.assign(a,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){let i=this.RULE_STACK.length===1,o=r&&!this.isBackTracking()&&this.recoveryEnabled;if(qn(e)){let s=e;if(o){let a=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))if(s.resyncedTokens=this.reSyncTo(a),this.outputCst){let u=this.CST_STACK[this.CST_STACK.length-1];return u.recoveredNode=!0,u}else return n(e);else{if(this.outputCst){let u=this.CST_STACK[this.CST_STACK.length-1];u.recoveredNode=!0,s.partialCstResult=u}throw s}}else{if(i)return this.moveToTerminatedState(),n(e);throw s}}else throw e}optionInternal(e,r){let n=this.getKeyForAutomaticLookahead(512,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof e!="function"){o=e.DEF;let s=e.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=e;if(i.call(this)===!0)return o.call(this)}atLeastOneInternal(e,r){let n=this.getKeyForAutomaticLookahead(1024,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let s=r.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=r;if(i.call(this)===!0){let s=this.doSingleRepetition(o);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o)}else throw this.raiseEarlyExitException(e,Je.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,1024,e,sl)}atLeastOneSepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA(1),o);for(;this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,$s],a,1536,e,$s)}else throw this.raiseEarlyExitException(e,Je.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let a=r.GATE;if(a!==void 0){let u=i;i=()=>a.call(this)&&u.call(this)}}else o=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,768,e,ol,s)}manySepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA(1),o);for(;this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,zs],a,1280,e,zs)}}repetitionSepSecondInternal(e,r,n,i,o){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,o],n,1536,e,o)}doSingleRepetition(e){let r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){let n=this.getKeyForAutomaticLookahead(256,r),i=J(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){let e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Hs(r,e))}}subruleInternal(e,r,n){let i;try{let o=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,o),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(o){throw this.subruleInternalError(o,n,e.ruleName)}}subruleInternalError(e,r,n){throw qn(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{let o=this.LA(1);this.tokenMatcher(o,e)===!0?(this.consumeToken(),i=o):this.consumeInternalError(e,o,n)}catch(o){i=this.consumeInternalRecovery(e,r,o)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i,o=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:o,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new ji(i,r,o))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){let i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(o){throw o.name===jp?n:o}}else throw n}saveRecogState(){let e=this.errors,r=Me(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Cr)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}};var kl=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Z(e,"errorMessageProvider")?e.errorMessageProvider:$t.errorMessageProvider}SAVE_ERROR(e){if(qn(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Me(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Me(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){let i=this.getCurrRuleFullName(),o=this.getGAstProductions()[i],a=Vs(e,o,r,this.maxLookahead)[0],u=[];for(let c=1;c<=this.maxLookahead;c++)u.push(this.LA(c));let l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:u,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new Ks(l,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],o=qs(e,i,this.maxLookahead),s=[];for(let l=1;l<=this.maxLookahead;l++)s.push(this.LA(l));let a=this.LA(0),u=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:o,actual:s,previous:a,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Ws(u,this.LA(1),a))}};var Tl=class{initContentAssist(){}computeContentAssist(e,r){let n=this.gastProductionsCache[e];if(Ft(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return ul([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){let r=kt(e.ruleStack),i=this.getGAstProductions()[r];return new il(i,e).startWalking()}};var vl={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(vl);var xA=!0,yA=Math.pow(2,8)-1,EA=xe({name:"RECORDING_PHASE_TOKEN",pattern:Se.NA});fn([EA]);var AA=Bi(EA,`This IToken indicates the Parser is in Recording Phase
213
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(AA);var WP={name:`This CSTNode indicates the Parser is in Recording Phase
214
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},_l=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){let r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{let e=this;for(let r=0;r<10;r++){let n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return Yo}topLevelRuleRecord(e,r){try{let n=new Ut({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
207
+ For Further details.`)}if(J(e))this.tokensMap=dt(e,(o,s)=>(o[s.name]=s,o),{});else if(Z(e,"modes")&&vt(xt(Re(e.modes)),xE)){let o=xt(Re(e.modes)),s=Fo(o);this.tokensMap=dt(s,(a,u)=>(a[u.name]=u,a),{})}else if(Ye(e))this.tokensMap=Me(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=xr;let n=Z(e,"modes")?xt(Re(e.modes)):Re(e),i=vt(n,o=>Te(o.categoryMatches));this.tokenMatcher=i?Uo:sn,an(Re(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
208
+ Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=Z(n,"resyncEnabled")?n.resyncEnabled:Vo.resyncEnabled,o=Z(n,"recoveryValueFunc")?n.recoveryValueFunc:Vo.recoveryValueFunc,s=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let a;return this.outputCst===!0?a=function(...c){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,c);let f=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(f),f}catch(f){return this.invokeRuleCatch(f,i,o)}finally{this.ruleFinallyStateUpdate()}}:a=function(...c){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,c)}catch(f){return this.invokeRuleCatch(f,i,o)}finally{this.ruleFinallyStateUpdate()}},Object.assign(a,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){let i=this.RULE_STACK.length===1,o=r&&!this.isBackTracking()&&this.recoveryEnabled;if(jn(e)){let s=e;if(o){let a=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))if(s.resyncedTokens=this.reSyncTo(a),this.outputCst){let u=this.CST_STACK[this.CST_STACK.length-1];return u.recoveredNode=!0,u}else return n(e);else{if(this.outputCst){let u=this.CST_STACK[this.CST_STACK.length-1];u.recoveredNode=!0,s.partialCstResult=u}throw s}}else{if(i)return this.moveToTerminatedState(),n(e);throw s}}else throw e}optionInternal(e,r){let n=this.getKeyForAutomaticLookahead(512,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof e!="function"){o=e.DEF;let s=e.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=e;if(i.call(this)===!0)return o.call(this)}atLeastOneInternal(e,r){let n=this.getKeyForAutomaticLookahead(1024,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let s=r.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=r;if(i.call(this)===!0){let s=this.doSingleRepetition(o);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o)}else throw this.raiseEarlyExitException(e,Xe.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,1024,e,nl)}atLeastOneSepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA(1),o);for(;this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,Ls],a,1536,e,Ls)}else throw this.raiseEarlyExitException(e,Xe.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let a=r.GATE;if(a!==void 0){let u=i;i=()=>a.call(this)&&u.call(this)}}else o=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,768,e,rl,s)}manySepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA(1),o);for(;this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,Ps],a,1280,e,Ps)}}repetitionSepSecondInternal(e,r,n,i,o){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,o],n,1536,e,o)}doSingleRepetition(e){let r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){let n=this.getKeyForAutomaticLookahead(256,r),i=J(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){let e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new zs(r,e))}}subruleInternal(e,r,n){let i;try{let o=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,o),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(o){throw this.subruleInternalError(o,n,e.ruleName)}}subruleInternalError(e,r,n){throw jn(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{let o=this.LA(1);this.tokenMatcher(o,e)===!0?(this.consumeToken(),i=o):this.consumeInternalError(e,o,n)}catch(o){i=this.consumeInternalRecovery(e,r,o)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i,o=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:o,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Pi(i,r,o))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){let i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(o){throw o.name===Rp?n:o}}else throw n}saveRecogState(){let e=this.errors,r=Me(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),xr)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}};var Al=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Z(e,"errorMessageProvider")?e.errorMessageProvider:jt.errorMessageProvider}SAVE_ERROR(e){if(jn(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Me(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Me(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){let i=this.getCurrRuleFullName(),o=this.getGAstProductions()[i],a=Bs(e,o,r,this.maxLookahead)[0],u=[];for(let c=1;c<=this.maxLookahead;c++)u.push(this.LA(c));let l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:u,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new $s(l,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],o=Ms(e,i,this.maxLookahead),s=[];for(let l=1;l<=this.maxLookahead;l++)s.push(this.LA(l));let a=this.LA(0),u=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:o,actual:s,previous:a,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Us(u,this.LA(1),a))}};var wl=class{initContentAssist(){}computeContentAssist(e,r){let n=this.gastProductionsCache[e];if(Ot(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return ol([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){let r=wt(e.ruleStack),i=this.getGAstProductions()[r];return new tl(i,e).startWalking()}};var Tl={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Tl);var eA=!0,tA=Math.pow(2,8)-1,nA=xe({name:"RECORDING_PHASE_TOKEN",pattern:Se.NA});an([nA]);var iA=Ni(nA,`This IToken indicates the Parser is in Recording Phase
209
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(iA);var yP={name:`This CSTNode indicates the Parser is in Recording Phase
210
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Cl=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){let r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{let e=this;for(let r=0;r<10;r++){let n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return qo}topLevelRuleRecord(e,r){try{let n=new Mt({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
215
211
  This error was thrown during the "grammar recording phase" For more info see:
216
- https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return Xs.call(this,Ge,e,r)}atLeastOneInternalRecord(e,r){Xs.call(this,lt,r,e)}atLeastOneSepFirstInternalRecord(e,r){Xs.call(this,ct,r,e,xA)}manyInternalRecord(e,r){Xs.call(this,De,r,e)}manySepFirstInternalRecord(e,r){Xs.call(this,rt,r,e,xA)}orInternalRecord(e,r){return HP.call(this,e,r)}subruleInternalRecord(e,r,n){if(Sl(r),!e||Z(e,"ruleName")===!1){let a=new Error(`<SUBRULE${bA(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
217
- inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}let i=qr(this.recordingProdStack),o=e.ruleName,s=new Be({idx:r,nonTerminalName:o,label:n?.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?WP:vl}consumeInternalRecord(e,r,n){if(Sl(r),!_p(e)){let s=new Error(`<CONSUME${bA(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
218
- inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}let i=qr(this.recordingProdStack),o=new Ie({idx:r,terminalType:e,label:n?.LABEL});return i.definition.push(o),AA}};function Xs(t,e,r,n=!1){Sl(r);let i=qr(this.recordingProdStack),o=Bt(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),Z(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),o.call(this),i.definition.push(s),this.recordingProdStack.pop(),vl}function HP(t,e){Sl(e);let r=qr(this.recordingProdStack),n=J(t)===!1,i=n===!1?t:t.DEF,o=new nt({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});Z(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD);let s=Ds(i,a=>Bt(a.GATE));return o.hasPredicates=s,r.definition.push(o),G(i,a=>{let u=new je({definition:[]});o.definition.push(u),Z(a,"IGNORE_AMBIGUITIES")?u.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:Z(a,"GATE")&&(u.ignoreAmbiguities=!0),this.recordingProdStack.push(u),a.ALT.call(this),this.recordingProdStack.pop()}),vl}function bA(t){return t===0?"":`${t}`}function Sl(t){if(t<0||t>yA){let e=new Error(`Invalid DSL Method idx value: <${t}>
219
- Idx value must be a none negative value smaller than ${yA+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}var Il=class{initPerformanceTracer(e){if(Z(e,"traceInitPerf")){let r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=$t.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);let{time:i,value:o}=Fs(r),s=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${n}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,o}else return r()}};function CA(t,e){e.forEach(r=>{let n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;let o=Object.getOwnPropertyDescriptor(n,i);o&&(o.get||o.set)?Object.defineProperty(t.prototype,i,o):t.prototype[i]=r.prototype[i]})})}var Yo=Bi(Cr,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Yo);var $t=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:nl,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Zo=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0}),At;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(At||(At={}));var Js=class t{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;let r=this.className;this.TRACE_INIT("toFastProps",()=>{Ns(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),G(this.definedRulesNames,i=>{let s=this[i].originalGrammarAction,a;this.TRACE_INIT(`${i} Rule`,()=>{a=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=a})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=sA({rules:Re(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Te(n)&&this.skipValidations===!1){let i=aA({rules:Re(this.gastProductionsCache),tokenTypes:Re(this.tokensMap),errMsgProvider:wr,grammarName:r}),o=QE({lookaheadStrategy:this.lookaheadStrategy,rules:Re(this.gastProductionsCache),tokenTypes:Re(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,o)}}),Te(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{let i=hE(Re(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,o;(o=(i=this.lookaheadStrategy).initialize)===null||o===void 0||o.call(i,{rules:Re(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Re(this.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!Te(this.definitionErrors))throw e=q(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
212
+ https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return Gs.call(this,Ge,e,r)}atLeastOneInternalRecord(e,r){Gs.call(this,at,r,e)}atLeastOneSepFirstInternalRecord(e,r){Gs.call(this,ut,r,e,eA)}manyInternalRecord(e,r){Gs.call(this,De,r,e)}manySepFirstInternalRecord(e,r){Gs.call(this,et,r,e,eA)}orInternalRecord(e,r){return bP.call(this,e,r)}subruleInternalRecord(e,r,n){if(kl(r),!e||Z(e,"ruleName")===!1){let a=new Error(`<SUBRULE${rA(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
213
+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}let i=Br(this.recordingProdStack),o=e.ruleName,s=new Be({idx:r,nonTerminalName:o,label:n?.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?yP:Tl}consumeInternalRecord(e,r,n){if(kl(r),!bp(e)){let s=new Error(`<CONSUME${rA(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
214
+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}let i=Br(this.recordingProdStack),o=new Ie({idx:r,terminalType:e,label:n?.LABEL});return i.definition.push(o),iA}};function Gs(t,e,r,n=!1){kl(r);let i=Br(this.recordingProdStack),o=Pt(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),Z(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),o.call(this),i.definition.push(s),this.recordingProdStack.pop(),Tl}function bP(t,e){kl(e);let r=Br(this.recordingProdStack),n=J(t)===!1,i=n===!1?t:t.DEF,o=new tt({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});Z(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD);let s=Ts(i,a=>Pt(a.GATE));return o.hasPredicates=s,r.definition.push(o),G(i,a=>{let u=new je({definition:[]});o.definition.push(u),Z(a,"IGNORE_AMBIGUITIES")?u.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:Z(a,"GATE")&&(u.ignoreAmbiguities=!0),this.recordingProdStack.push(u),a.ALT.call(this),this.recordingProdStack.pop()}),Tl}function rA(t){return t===0?"":`${t}`}function kl(t){if(t<0||t>tA){let e=new Error(`Invalid DSL Method idx value: <${t}>
215
+ Idx value must be a none negative value smaller than ${tA+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}var _l=class{initPerformanceTracer(e){if(Z(e,"traceInitPerf")){let r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=jt.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);let{time:i,value:o}=Ss(r),s=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${n}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,o}else return r()}};function oA(t,e){e.forEach(r=>{let n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;let o=Object.getOwnPropertyDescriptor(n,i);o&&(o.get||o.set)?Object.defineProperty(t.prototype,i,o):t.prototype[i]=r.prototype[i]})})}var qo=Ni(xr,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(qo);var jt=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:el,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Vo=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0}),bt;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(bt||(bt={}));var Ws=class t{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;let r=this.className;this.TRACE_INIT("toFastProps",()=>{vs(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),G(this.definedRulesNames,i=>{let s=this[i].originalGrammarAction,a;this.TRACE_INIT(`${i} Rule`,()=>{a=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=a})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=qE({rules:Re(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Te(n)&&this.skipValidations===!1){let i=VE({rules:Re(this.gastProductionsCache),tokenTypes:Re(this.tokensMap),errMsgProvider:yr,grammarName:r}),o=LE({lookaheadStrategy:this.lookaheadStrategy,rules:Re(this.gastProductionsCache),tokenTypes:Re(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,o)}}),Te(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{let i=Xb(Re(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,o;(o=(i=this.lookaheadStrategy).initialize)===null||o===void 0||o.call(i,{rules:Re(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Re(this.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!Te(this.definitionErrors))throw e=q(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
220
216
  ${e.join(`
221
217
  -------------------------------
222
218
  `)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),Z(r,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
223
219
  Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
224
220
  See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
225
- For further details.`);this.skipValidations=Z(r,"skipValidations")?r.skipValidations:$t.skipValidations}};Js.DEFER_DEFINITION_ERRORS_HANDLING=!1;CA(Js,[dl,gl,El,Al,wl,Cl,kl,Tl,_l,Il]);var Ui=class extends Js{constructor(e,r=$t){let n=Me(r);n.outputCst=!0,super(e,n)}};var Dl=xe({name:"flag",pattern:/--[\w-]+/}),Zp=xe({longer_alt:Dl,name:"alias",pattern:/-[A-Z]/i}),wA=xe({group:Se.SKIPPED,name:"comma",pattern:/,/}),kA=xe({group:Se.SKIPPED,name:"dollar",pattern:/\$/}),Ol=xe({group:Se.SKIPPED,name:"whiteSpace",pattern:/ /}),TA=xe({group:Se.SKIPPED,name:"newLine",pattern:/\n/}),Xp=xe({name:"word",pattern:/\S+/}),ea=xe({name:"argument",pattern:/(<\S+>|\[.+\])/}),Jp=xe({name:"programDescription",pattern:/\w.+(?=\n\n {2}Usage)/}),_A=xe({group:Se.SKIPPED,name:"startUsage",pattern:/ {2}Usage\n/,push_mode:"USAGE_MODE"}),SA=xe({group:Se.SKIPPED,name:"endUsage",pattern:/\n/,pop_mode:!0}),Qp=xe({name:"startOptions",pattern:/ {2}Options\n/,push_mode:"OPTIONS_MODE"}),ed=xe({name:"startRow",pattern:/ {4}/,push_mode:"ROW_MODE"}),td=xe({name:"rowDescription",pattern:/\w.+/}),vA=xe({group:Se.SKIPPED,name:"endRow",pattern:/\n/,pop_mode:!0}),IA=xe({group:Se.SKIPPED,name:"endOptions",pattern:/\n/,pop_mode:!0}),YP=new Se({defaultMode:"DEFAULT_MODE",modes:{DEFAULT_MODE:[_A,Qp,Jp,TA,Ol],OPTIONS_MODE:[IA,ed],ROW_MODE:[vA,Zp,Dl,wA,ea,td,Ol],USAGE_MODE:[SA,kA,ea,Xp,Ol]}}),ZP=[Dl,Zp,wA,kA,Ol,TA,Xp,ea,Jp,_A,SA,Qp,ed,td,vA,IA],Kp=class extends Ui{sectionRow=this.RULE("sectionRow",()=>{this.CONSUME(ed),this.MANY(()=>{this.OR([{ALT:()=>this.CONSUME(ea)},{ALT:()=>this.CONSUME(Zp)},{ALT:()=>this.CONSUME(Dl)},{ALT:()=>this.CONSUME(td,{LABEL:"description"})}])})});optionsSection=this.RULE("optionsSection",()=>{this.CONSUME(Qp),this.MANY(()=>{this.SUBRULE(this.sectionRow)})});programHelp=this.RULE("programHelp",()=>{this.CONSUME(Jp,{LABEL:"description"}),this.AT_LEAST_ONE(()=>{this.CONSUME(Xp,{LABEL:"commandName"})}),this.MANY(()=>{this.CONSUME(ea)}),this.OPTION(()=>{this.SUBRULE(this.optionsSection)})});constructor(){super(ZP),this.performSelfAnalysis()}},Qs=new Kp,Yp=class extends Qs.getBaseCstVisitorConstructor(){constructor(){super(),this.validateVisitor()}optionsSection(e){return e.sectionRow.map(r=>this.visit(r))}programHelp(e){let{command:r,subcommand:n}=Rl(this.getString(e.commandName));return{arguments:this.getArray(e.argument),commandName:r,description:this.getString(e.description),options:e.optionsSection?this.visit(e.optionsSection):void 0,subcommandName:n}}sectionRow(e){return{aliases:this.getArray(e.alias),arguments:this.getArray(e.argument),description:this.getString(e.description,!0),flags:this.getArray(e.flag)}}clean(e){return e.replaceAll(/^[\s[]*(default:)?\s*|[\s\]]*$/g,"")}getArray(e){if(e!==void 0)return e.map(r=>r.image)}getString(e,r=!1){if(e!==void 0)return e.map(n=>r?this.clean(n.image):n.image).join(" ")}},XP=new Yp;function OA(t){let e=YP.tokenize(t);if(e.errors.length>0)throw new Error(`Errors lexing CLI command: ${JSON.stringify(e.errors,void 0,2)}`);Qs.input=e.tokens;let r=Qs.programHelp();if(Qs.errors.length>0)throw new Error(`Errors parsing CLI command help text: ${JSON.stringify(Qs.errors,void 0,2)}`);let n;try{n=XP.visit(r)}catch(i){if(i instanceof Error)throw new TypeError(`Errors visiting CLI command help text: ${String(i)}`)}if(n===void 0)throw new Error("Could not parse help string");return n}var od=xe({name:"flag",pattern:/--[\w-]+/}),sd=xe({name:"alias",pattern:/-[A-Z]/i}),DA=xe({group:Se.SKIPPED,name:"comma",pattern:/,/}),Xo=xe({name:"word",pattern:/\S+/}),ra=xe({name:"argument",pattern:/<\S+>|\[\S+\]/}),ad=xe({name:"type",pattern:/\[(boolean|string|array|number)\]/}),ud=xe({name:"defaultInfo",pattern:/\[default\]/}),ld=xe({name:"required",pattern:/\[required\]/}),cd=xe({name:"defaultInfoDescription",pattern:/\[default:\s.+\]/}),fd=xe({name:"choices",pattern:/\[choices:\s.+?\]/}),rd=xe({group:Se.SKIPPED,name:"whiteSpace",pattern:/\s/}),RA=xe({group:Se.SKIPPED,name:"startProgramDescription",pattern:/\n\n/,push_mode:"PROGRAM_DESCRIPTION_MODE"}),pd=xe({name:"programDescription",pattern:/.+/}),FA=xe({group:Se.SKIPPED,name:"endProgramDescription",pattern:/\n\n/,pop_mode:!0}),dd=xe({name:"startOptionsSection",pattern:/Options:?\n/,push_mode:"SECTION_MODE"}),hd=xe({name:"startPositionalsSection",pattern:/Positionals:\n/,push_mode:"SECTION_MODE"}),md=xe({name:"startCommandsSection",pattern:/Commands:\n/,push_mode:"SECTION_MODE"}),gd=xe({name:"startRow",pattern:/ {2,}/,push_mode:"ROW_MODE"}),xd=xe({name:"rowDescription",pattern:/ {2}\w.+ {2}/}),yd=xe({name:"rowDescriptionTerminal",pattern:/ {2}\w.+/}),NA=xe({group:Se.SKIPPED,name:"endRow",pattern:/\n/,pop_mode:!0}),PA=xe({group:Se.SKIPPED,name:"endSection",pattern:/\n+/,pop_mode:!0}),JP=new Se({defaultMode:"DEFAULT_MODE",modes:{DEFAULT_MODE:[dd,hd,md,RA,ra,Xo,rd],PROGRAM_DESCRIPTION_MODE:[FA,pd],ROW_MODE:[NA,DA,ad,xd,yd,cd,ud,ld,fd,od,sd,ra,Xo,rd],SECTION_MODE:[gd,PA]}}),QP=[od,sd,DA,Xo,ra,ad,ud,ld,cd,fd,rd,RA,pd,FA,dd,hd,md,gd,xd,yd,NA,PA],nd=class extends Ui{sectionRow=this.RULE("sectionRow",()=>{this.CONSUME(gd),this.OPTION(()=>{this.CONSUME(Xo,{LABEL:"parentCommandName"})}),this.MANY(()=>{this.CONSUME1(Xo,{LABEL:"commandName"})}),this.MANY1(()=>{this.OR([{ALT:()=>this.CONSUME(ra)},{ALT:()=>this.CONSUME(sd)},{ALT:()=>this.CONSUME(od)},{ALT:()=>this.CONSUME(xd,{LABEL:"description"})},{ALT:()=>this.CONSUME(yd,{LABEL:"description"})},{ALT:()=>this.CONSUME(ad)},{ALT:()=>this.CONSUME(ld)},{ALT:()=>this.CONSUME(cd)},{ALT:()=>this.CONSUME(ud)},{ALT:()=>this.CONSUME(fd)}])})});commandsSection=this.RULE("commandsSection",()=>{this.CONSUME(md),this.MANY1(()=>{this.SUBRULE1(this.sectionRow)})});optionsSection=this.RULE("optionsSection",()=>{this.CONSUME(dd),this.MANY2(()=>{this.SUBRULE2(this.sectionRow)})});positionalsSection=this.RULE("positionalsSection",()=>{this.CONSUME(hd),this.MANY(()=>{this.SUBRULE(this.sectionRow)})});programHelp=this.RULE("programHelp",()=>{this.AT_LEAST_ONE(()=>{this.CONSUME(Xo,{LABEL:"commandName"})}),this.MANY1(()=>{this.CONSUME(ra)}),this.OPTION(()=>{this.CONSUME(pd,{LABEL:"description"})}),this.OPTION1(()=>{this.SUBRULE(this.commandsSection)}),this.OPTION2(()=>{this.SUBRULE(this.positionalsSection)}),this.OPTION3(()=>{this.SUBRULE(this.optionsSection)})});constructor(){super(QP),this.performSelfAnalysis()}},ta=new nd,id=class extends ta.getBaseCstVisitorConstructor(){constructor(){super(),this.validateVisitor()}commandsSection(e){return e.sectionRow.map(r=>this.visit(r))}optionsSection(e){return e.sectionRow.map(r=>this.visit(r))}positionalsSection(e){return e.sectionRow.map(r=>this.positionalParentCommandToArguments(this.visit(r)))}programHelp(e){let{command:r,subcommand:n}=Rl(this.getString(e.commandName));return{arguments:this.getArray(e.argument),commandName:r,commands:e.commandsSection?this.visit(e.commandsSection):void 0,description:this.getString(e.description),options:e.optionsSection?this.visit(e.optionsSection):void 0,positionals:e.positionalsSection?this.visit(e.positionalsSection):void 0,subcommandName:n}}sectionRow(e){return{aliases:this.getArray(e.alias),arguments:this.getArray(e.argument),choices:this.splitChoices(this.getString(e.choices)),commandName:this.getString(e.commandName),default:e.defaultInfo?!0:void 0,defaultValue:this.getString(e.defaultInfoDescription,!0),description:this.getString(e.description,!0),flags:this.getArray(e.flag),parentCommandName:this.getString(e.parentCommandName),required:e.required?!0:void 0,type:this.getString(e.type,!0)}}clean(e){return e.endsWith("]]")?e.replaceAll(/(^\[default:\s*)|(\]$)/g,""):e.replaceAll(/^[\s[]*(default:)?\s*|[\s\]]*$/g,"")}getArray(e){if(e!==void 0)return e.map(r=>r.image)}getString(e,r=!1){if(e!==void 0)return e.map(n=>r?this.clean(n.image):n.image).join(" ")}positionalParentCommandToArguments(e){let{arguments:r,parentCommandName:n,...i}=e;return n===void 0?e:{arguments:[n,...r??[]],...i}}splitChoices(e){if(e!==void 0)return this.clean(e.replaceAll(/^\[choices:\s/g,"")).split(", ")}},eL=new id;function LA(t){let e=JP.tokenize(t);if(e.errors.length>0)throw new Error(`Errors lexing CLI command: ${JSON.stringify(e.errors,void 0,2)}`);ta.input=e.tokens;let r=ta.programHelp();if(ta.errors.length>0)throw new Error(`Errors parsing CLI command help text: ${JSON.stringify(ta.errors,void 0,2)}`);let n;try{n=eL.visit(r)}catch(i){if(i instanceof Error)throw new TypeError(`Errors visiting CLI command help text: ${String(i)}`)}if(n===void 0)throw new Error("Could not parse help string");return n}var MA={yargs:LA,meow:OA};function Rl(t){if(t===void 0)throw new Error('Could not find "commandName" entry in help');let e=t.split(" ");if(e.length===0)throw new Error('Could not find "commandName" entry in help');if(e.length===1)return{command:e[0],subcommand:void 0};let r=e.at(-1);return{command:e.slice(0,-1).join(" "),subcommand:r}}function BA(t){for(let[e,r]of Object.entries(MA)){bd.info(`Trying to parse help string with ${e} parser...`);try{return r(t)}catch(n){n instanceof Error&&bd.info(`Error in "${e}" parser: ${String(n)}`);continue}}bd.error("Could not parse help string with any parser")}async function Ed(t,e="--help",r){let n=`${t} ${e}`,i=await iL(n),o=BA(i);return o===void 0?(jA.warn("Falling back to basic cli help text output."),nL(i)):rL(t,e,r??Number.MAX_SAFE_INTEGER,o)}async function rL(t,e,r,n){if(r<=0)return jA.info("Max CLI command help depth reached, stopping recursion"),"";let i=Ax(n,r),o=t.split(" ")[0];if(n.commands)for(let s of n.commands){if(!s.parentCommandName||!s.commandName)continue;let a=await Ed(`${o} ${s.commandName}`,e,r-1);if(a==="")return i;i+=`
221
+ For further details.`);this.skipValidations=Z(r,"skipValidations")?r.skipValidations:jt.skipValidations}};Ws.DEFER_DEFINITION_ERRORS_HANDLING=!1;oA(Ws,[cl,dl,xl,yl,El,bl,Al,wl,Cl,_l]);var Li=class extends Ws{constructor(e,r=jt){let n=Me(r);n.outputCst=!0,super(e,n)}};var vl=xe({name:"flag",pattern:/--[\w-]+/}),qp=xe({longer_alt:vl,name:"alias",pattern:/-[A-Z]/i}),sA=xe({group:Se.SKIPPED,name:"comma",pattern:/,/}),aA=xe({group:Se.SKIPPED,name:"dollar",pattern:/\$/}),Sl=xe({group:Se.SKIPPED,name:"whiteSpace",pattern:/ /}),uA=xe({group:Se.SKIPPED,name:"newLine",pattern:/\n/}),Vp=xe({name:"word",pattern:/\S+/}),Ks=xe({name:"argument",pattern:/(<\S+>|\[.+\])/}),Gp=xe({name:"programDescription",pattern:/\w.+(?=\n\n {2}Usage)/}),lA=xe({group:Se.SKIPPED,name:"startUsage",pattern:/ {2}Usage\n/,push_mode:"USAGE_MODE"}),cA=xe({group:Se.SKIPPED,name:"endUsage",pattern:/\n/,pop_mode:!0}),Wp=xe({name:"startOptions",pattern:/ {2}Options\n/,push_mode:"OPTIONS_MODE"}),Hp=xe({name:"startRow",pattern:/ {4}/,push_mode:"ROW_MODE"}),Kp=xe({name:"rowDescription",pattern:/\w.+/}),fA=xe({group:Se.SKIPPED,name:"endRow",pattern:/\n/,pop_mode:!0}),pA=xe({group:Se.SKIPPED,name:"endOptions",pattern:/\n/,pop_mode:!0}),AP=new Se({defaultMode:"DEFAULT_MODE",modes:{DEFAULT_MODE:[lA,Wp,Gp,uA,Sl],OPTIONS_MODE:[pA,Hp],ROW_MODE:[fA,qp,vl,sA,Ks,Kp,Sl],USAGE_MODE:[cA,aA,Ks,Vp,Sl]}}),wP=[vl,qp,sA,aA,Sl,uA,Vp,Ks,Gp,lA,cA,Wp,Hp,Kp,fA,pA],zp=class extends Li{sectionRow=this.RULE("sectionRow",()=>{this.CONSUME(Hp),this.MANY(()=>{this.OR([{ALT:()=>this.CONSUME(Ks)},{ALT:()=>this.CONSUME(qp)},{ALT:()=>this.CONSUME(vl)},{ALT:()=>this.CONSUME(Kp,{LABEL:"description"})}])})});optionsSection=this.RULE("optionsSection",()=>{this.CONSUME(Wp),this.MANY(()=>{this.SUBRULE(this.sectionRow)})});programHelp=this.RULE("programHelp",()=>{this.CONSUME(Gp,{LABEL:"description"}),this.AT_LEAST_ONE(()=>{this.CONSUME(Vp,{LABEL:"commandName"})}),this.MANY(()=>{this.CONSUME(Ks)}),this.OPTION(()=>{this.SUBRULE(this.optionsSection)})});constructor(){super(wP),this.performSelfAnalysis()}},Hs=new zp,$p=class extends Hs.getBaseCstVisitorConstructor(){constructor(){super(),this.validateVisitor()}optionsSection(e){return e.sectionRow.map(r=>this.visit(r))}programHelp(e){let{command:r,subcommand:n}=Il(this.getString(e.commandName));return{arguments:this.getArray(e.argument),commandName:r,description:this.getString(e.description),options:e.optionsSection?this.visit(e.optionsSection):void 0,subcommandName:n}}sectionRow(e){return{aliases:this.getArray(e.alias),arguments:this.getArray(e.argument),description:this.getString(e.description,!0),flags:this.getArray(e.flag)}}clean(e){return e.replaceAll(/^[\s[]*(default:)?\s*|[\s\]]*$/g,"")}getArray(e){if(e!==void 0)return e.map(r=>r.image)}getString(e,r=!1){if(e!==void 0)return e.map(n=>r?this.clean(n.image):n.image).join(" ")}},CP=new $p;function dA(t){let e=AP.tokenize(t);if(e.errors.length>0)throw new Error(`Errors lexing CLI command: ${JSON.stringify(e.errors,void 0,2)}`);Hs.input=e.tokens;let r=Hs.programHelp();if(Hs.errors.length>0)throw new Error(`Errors parsing CLI command help text: ${JSON.stringify(Hs.errors,void 0,2)}`);let n;try{n=CP.visit(r)}catch(i){if(i instanceof Error)throw new TypeError(`Errors visiting CLI command help text: ${String(i)}`)}if(n===void 0)throw new Error("Could not parse help string");return n}var Jp=xe({name:"flag",pattern:/--[\w-]+/}),Qp=xe({name:"alias",pattern:/-[A-Z]/i}),hA=xe({group:Se.SKIPPED,name:"comma",pattern:/,/}),Go=xe({name:"word",pattern:/\S+/}),Zs=xe({name:"argument",pattern:/<\S+>|\[\S+\]/}),ed=xe({name:"type",pattern:/\[(boolean|string|array|number)\]/}),td=xe({name:"defaultInfo",pattern:/\[default\]/}),rd=xe({name:"required",pattern:/\[required\]/}),nd=xe({name:"defaultInfoDescription",pattern:/\[default:\s.+\]/}),id=xe({name:"choices",pattern:/\[choices:\s.+?\]/}),Yp=xe({group:Se.SKIPPED,name:"whiteSpace",pattern:/\s/}),mA=xe({group:Se.SKIPPED,name:"startProgramDescription",pattern:/\n\n/,push_mode:"PROGRAM_DESCRIPTION_MODE"}),od=xe({name:"programDescription",pattern:/.+/}),gA=xe({group:Se.SKIPPED,name:"endProgramDescription",pattern:/\n\n/,pop_mode:!0}),sd=xe({name:"startOptionsSection",pattern:/Options:?\n/,push_mode:"SECTION_MODE"}),ad=xe({name:"startPositionalsSection",pattern:/Positionals:\n/,push_mode:"SECTION_MODE"}),ud=xe({name:"startCommandsSection",pattern:/Commands:\n/,push_mode:"SECTION_MODE"}),ld=xe({name:"startRow",pattern:/ {2,}/,push_mode:"ROW_MODE"}),cd=xe({name:"rowDescription",pattern:/ {2}\w.+ {2}/}),fd=xe({name:"rowDescriptionTerminal",pattern:/ {2}\w.+/}),xA=xe({group:Se.SKIPPED,name:"endRow",pattern:/\n/,pop_mode:!0}),yA=xe({group:Se.SKIPPED,name:"endSection",pattern:/\n+/,pop_mode:!0}),kP=new Se({defaultMode:"DEFAULT_MODE",modes:{DEFAULT_MODE:[sd,ad,ud,mA,Zs,Go,Yp],PROGRAM_DESCRIPTION_MODE:[gA,od],ROW_MODE:[xA,hA,ed,cd,fd,nd,td,rd,id,Jp,Qp,Zs,Go,Yp],SECTION_MODE:[ld,yA]}}),TP=[Jp,Qp,hA,Go,Zs,ed,td,rd,nd,id,Yp,mA,od,gA,sd,ad,ud,ld,cd,fd,xA,yA],Zp=class extends Li{sectionRow=this.RULE("sectionRow",()=>{this.CONSUME(ld),this.OPTION(()=>{this.CONSUME(Go,{LABEL:"parentCommandName"})}),this.MANY(()=>{this.CONSUME1(Go,{LABEL:"commandName"})}),this.MANY1(()=>{this.OR([{ALT:()=>this.CONSUME(Zs)},{ALT:()=>this.CONSUME(Qp)},{ALT:()=>this.CONSUME(Jp)},{ALT:()=>this.CONSUME(cd,{LABEL:"description"})},{ALT:()=>this.CONSUME(fd,{LABEL:"description"})},{ALT:()=>this.CONSUME(ed)},{ALT:()=>this.CONSUME(rd)},{ALT:()=>this.CONSUME(nd)},{ALT:()=>this.CONSUME(td)},{ALT:()=>this.CONSUME(id)}])})});commandsSection=this.RULE("commandsSection",()=>{this.CONSUME(ud),this.MANY1(()=>{this.SUBRULE1(this.sectionRow)})});optionsSection=this.RULE("optionsSection",()=>{this.CONSUME(sd),this.MANY2(()=>{this.SUBRULE2(this.sectionRow)})});positionalsSection=this.RULE("positionalsSection",()=>{this.CONSUME(ad),this.MANY(()=>{this.SUBRULE(this.sectionRow)})});programHelp=this.RULE("programHelp",()=>{this.AT_LEAST_ONE(()=>{this.CONSUME(Go,{LABEL:"commandName"})}),this.MANY1(()=>{this.CONSUME(Zs)}),this.OPTION(()=>{this.CONSUME(od,{LABEL:"description"})}),this.OPTION1(()=>{this.SUBRULE(this.commandsSection)}),this.OPTION2(()=>{this.SUBRULE(this.positionalsSection)}),this.OPTION3(()=>{this.SUBRULE(this.optionsSection)})});constructor(){super(TP),this.performSelfAnalysis()}},Ys=new Zp,Xp=class extends Ys.getBaseCstVisitorConstructor(){constructor(){super(),this.validateVisitor()}commandsSection(e){return e.sectionRow.map(r=>this.visit(r))}optionsSection(e){return e.sectionRow.map(r=>this.visit(r))}positionalsSection(e){return e.sectionRow.map(r=>this.positionalParentCommandToArguments(this.visit(r)))}programHelp(e){let{command:r,subcommand:n}=Il(this.getString(e.commandName));return{arguments:this.getArray(e.argument),commandName:r,commands:e.commandsSection?this.visit(e.commandsSection):void 0,description:this.getString(e.description),options:e.optionsSection?this.visit(e.optionsSection):void 0,positionals:e.positionalsSection?this.visit(e.positionalsSection):void 0,subcommandName:n}}sectionRow(e){return{aliases:this.getArray(e.alias),arguments:this.getArray(e.argument),choices:this.splitChoices(this.getString(e.choices)),commandName:this.getString(e.commandName),default:e.defaultInfo?!0:void 0,defaultValue:this.getString(e.defaultInfoDescription,!0),description:this.getString(e.description,!0),flags:this.getArray(e.flag),parentCommandName:this.getString(e.parentCommandName),required:e.required?!0:void 0,type:this.getString(e.type,!0)}}clean(e){return e.endsWith("]]")?e.replaceAll(/(^\[default:\s*)|(\]$)/g,""):e.replaceAll(/^[\s[]*(default:)?\s*|[\s\]]*$/g,"")}getArray(e){if(e!==void 0)return e.map(r=>r.image)}getString(e,r=!1){if(e!==void 0)return e.map(n=>r?this.clean(n.image):n.image).join(" ")}positionalParentCommandToArguments(e){let{arguments:r,parentCommandName:n,...i}=e;return n===void 0?e:{arguments:[n,...r??[]],...i}}splitChoices(e){if(e!==void 0)return this.clean(e.replaceAll(/^\[choices:\s/g,"")).split(", ")}},_P=new Xp;function bA(t){let e=kP.tokenize(t);if(e.errors.length>0)throw new Error(`Errors lexing CLI command: ${JSON.stringify(e.errors,void 0,2)}`);Ys.input=e.tokens;let r=Ys.programHelp();if(Ys.errors.length>0)throw new Error(`Errors parsing CLI command help text: ${JSON.stringify(Ys.errors,void 0,2)}`);let n;try{n=_P.visit(r)}catch(i){if(i instanceof Error)throw new TypeError(`Errors visiting CLI command help text: ${String(i)}`)}if(n===void 0)throw new Error("Could not parse help string");return n}var EA={yargs:bA,meow:dA};function Il(t){if(t===void 0)throw new Error('Could not find "commandName" entry in help');let e=t.split(" ");if(e.length===0)throw new Error('Could not find "commandName" entry in help');if(e.length===1)return{command:e[0],subcommand:void 0};let r=e.at(-1);return{command:e.slice(0,-1).join(" "),subcommand:r}}function AA(t){for(let[e,r]of Object.entries(EA)){pd.info(`Trying to parse help string with ${e} parser...`);try{return r(t)}catch(n){n instanceof Error&&pd.info(`Error in "${e}" parser: ${String(n)}`);continue}}pd.error("Could not parse help string with any parser")}async function dd(t,e="--help",r){let n=`${t} ${e}`,i=await OP(n),o=AA(i);return o===void 0?(wA.warn("Falling back to basic cli help text output."),IP(i)):vP(t,e,r??Number.MAX_SAFE_INTEGER,o)}async function vP(t,e,r,n){if(r<=0)return wA.info("Max CLI command help depth reached, stopping recursion"),"";let i=ix(n,r),o=t.split(" ")[0];if(n.commands)for(let s of n.commands){if(!s.parentCommandName||!s.commandName)continue;let a=await dd(`${o} ${s.commandName}`,e,r-1);if(a==="")return i;i+=`
226
222
 
227
- ${a}`}return i}function nL(t){return`\`\`\`txt
223
+ ${a}`}return i}function IP(t){return`\`\`\`txt
228
224
  ${t}
229
- \`\`\``}async function iL(t){let e;try{let{stderr:r,stdout:n}=await tL(t);e=n,(e===void 0||e==="")&&(e=r)}catch(r){if(r instanceof Error)throw new TypeError(`Error running CLI help command: "${t}"
225
+ \`\`\``}async function OP(t){let e;try{let{stderr:r,stdout:n}=await SP(t);e=n,(e===void 0||e==="")&&(e=r)}catch(r){if(r instanceof Error)throw new TypeError(`Error running CLI help command: "${t}"
230
226
  ${r.message}
231
227
  `)}if(e===void 0||e==="")throw new Error(`No result from running CLI help command: "${t}"
232
- `);return e}import UA from"node:process";import oL from"node:path";import sL from"node:fs";import aL from"node:fs/promises";var zA=UA.platform==="win32",uL=zA?new Set(UA.env.PATHEXT?.split(";").map(t=>t.toLowerCase())):[];async function $A(t){try{return await aL.access(t,sL.X_OK),zA?uL.has(oL.extname(t)):!0}catch{return!1}}import lL from"node:path";import{log as cL}from"remark-mdat";import fL from"which";async function qA(t){return t??=await pL(),hL(t)}async function pL(){let t=await rr();if(t.bin){let e=typeof t.bin=="string"?t.bin:String(Object.values(t.bin).at(0));if(dL(e))return cL.info(`Inferred <!-- cli-help --> command to run from package.json: ${e}`),e}throw new Error(`Could not infer which command to run for the <!-- cli-help --> rule. Please pass a "cliCommand" option to the expansion comment, e.g. <!-- cli-help {cliCommand: './dist/bin.js'} -->`)}function dL(t){let e=lL.parse(t);return e.root!==""||e.dir!==""}async function hL(t){let e=await fL(t,{nothrow:!0})??void 0;if(e===void 0&&(e=await mL(t)??void 0),e!==void 0&&await $A(e))return e;throw new Error(`The cli-help rule noticed that "${e}" is not executable.`)}async function mL(t){return(await rr()).bin?.[t]??void 0}var Fl={"cli-help":{async content(t){let e=X.object({cliCommand:X.string().optional(),depth:X.number().optional(),helpFlag:X.string().optional()}).optional().parse(t),r=await qA(e?.cliCommand);return Ed(r,e?.helpFlag,e?.depth)}}};var VA={cli:gL(Fl)};import xL from"node:fs/promises";import GA from"node:path";var WA={code:{async content(t){let e=X.object({file:X.string(),language:X.string().optional()}).parse(t),r=(GA.extname(e.file)??"").replace(/^\./,""),n=await xL.readFile(GA.join(process.cwd(),e.file),"utf8");return`\`\`\`${r}
228
+ `);return e}import CA from"node:process";import DP from"node:path";import RP from"node:fs";import FP from"node:fs/promises";var kA=CA.platform==="win32",NP=kA?new Set(CA.env.PATHEXT?.split(";").map(t=>t.toLowerCase())):[];async function TA(t){try{return await FP.access(t,RP.X_OK),kA?NP.has(DP.extname(t)):!0}catch{return!1}}import PP from"node:path";import{log as LP}from"remark-mdat";import MP from"which";async function _A(t){return t??=await BP(),UP(t)}async function BP(){let t=await Qt();if(t.bin){let e=typeof t.bin=="string"?t.bin:String(Object.values(t.bin).at(0));if(jP(e))return LP.info(`Inferred <!-- cli-help --> command to run from package.json: ${e}`),e}throw new Error(`Could not infer which command to run for the <!-- cli-help --> rule. Please pass a "cliCommand" option to the expansion comment, e.g. <!-- cli-help {cliCommand: './dist/bin.js'} -->`)}function jP(t){let e=PP.parse(t);return e.root!==""||e.dir!==""}async function UP(t){let e=await MP(t,{nothrow:!0})??void 0;if(e??=await zP(t)??void 0,e!==void 0&&await TA(e))return e;throw new Error(`The cli-help rule noticed that "${e}" is not executable.`)}async function zP(t){return(await Qt()).bin?.[t]??void 0}var Ol={"cli-help":{async content(t){let e=X.object({cliCommand:X.string().optional(),depth:X.number().optional(),helpFlag:X.string().optional()}).optional().parse(t),r=await _A(e?.cliCommand);return dd(r,e?.helpFlag,e?.depth)}}};var SA={cli:$P(Ol)};import qP from"node:fs/promises";import vA from"node:path";var IA={code:{async content(t){let e=X.object({file:X.string(),language:X.string().optional()}).parse(t),r=(vA.extname(e.file)??"").replace(/^\./,""),n=await qP.readFile(vA.join(process.cwd(),e.file),"utf8");return`\`\`\`${r}
233
229
  ${n}
234
- \`\`\``}}};var Nl={contributing:{async content(){let e=(await rr()).bugs?.url;if(e===void 0)throw new Error('Could not find "bugs.url" entry in package.json');return`## Contributing
235
- [Issues](${e}) and pull requests are welcome.`},order:15}};var Pl={description:{async content(){let t=await rr();if(t.description===void 0)throw new Error('Could not find "description" entry in package.json');return`**${t.description}**`},order:4}};import{getSoleRule as HA}from"remark-mdat";var Ll={license:{async content(){let t=await rr(),{author:e,license:r}=t;if(e?.name===void 0)throw new Error('Could not find "author.name" entry in package.json');if(r===void 0)throw new Error('Could not find "license" entry in package.json');return`## License
236
- [${r}](license.txt) \xA9 ${e.name}`},order:16}};var KA={footer:{content:[HA(Nl),HA(Ll)],order:17}};import{getSoleRule as jl}from"remark-mdat";import{getSoleRule as yL}from"remark-mdat";var Ml={"short-description":yL(Pl)};var Bl={title:{applicationOrder:2,async content(t){let{postfix:e,prefix:r,titleCase:n}=X.object({postfix:X.string().optional().default(""),prefix:X.string().optional().default(""),titleCase:X.boolean().optional().default(!1)}).parse(t??{}),{name:i}=await rr();return`# ${r}${n?bL(i):i}${e}`},order:1}};function bL(t){return t.split(/[ _-]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}var YA={header:{applicationOrder:2,content:[jl(Bl),jl(yu),jl(gu),jl(Ml)],order:1}};import IL from"node:path";import kL from"node:fs/promises";import{promisify as XA}from"node:util";import{brotliCompress as TL,gzip as _L}from"node:zlib";var EL=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],AL=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],CL=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],wL=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],ZA=(t,e,r)=>{let n=t;return typeof e=="string"||Array.isArray(e)?n=t.toLocaleString(e,r):(e===!0||r!==void 0)&&(n=t.toLocaleString(void 0,r)),n};function Ad(t,e){if(!Number.isFinite(t))throw new TypeError(`Expected a finite number, got ${typeof t}: ${t}`);e={bits:!1,binary:!1,space:!0,...e};let r=e.bits?e.binary?wL:CL:e.binary?AL:EL,n=e.space?" ":"";if(e.signed&&t===0)return` 0${n}${r[0]}`;let i=t<0,o=i?"-":e.signed?"+":"";i&&(t=-t);let s;if(e.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:e.minimumFractionDigits}),e.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:e.maximumFractionDigits,...s}),t<1){let c=ZA(t,e.locale,s);return o+c+n+r[0]}let a=Math.min(Math.floor(e.binary?Math.log(t)/Math.log(1024):Math.log10(t)/3),r.length-1);t/=(e.binary?1024:1e3)**a,s||(t=t.toPrecision(3));let u=ZA(Number(t),e.locale,s),l=r[a];return o+u+n+l}var SL=XA(TL),vL=XA(_L);function Cd(t,e){let r=e===0?0:(e-t)/e*100;return{bytes:t,bytesPretty:Ad(t,{maximumFractionDigits:1}),percent:r,percentPretty:`${Math.round(r)}%`}}async function Ul(t){try{let e=await kL.readFile(t),r=e.length,[n,i]=await Promise.all([SL(e),vL(e)]);return{brotli:Cd(n.length,r),gzip:Cd(i.length,r),original:Cd(r,r)}}catch(e){throw new Error(`Failed to analyze file: ${e instanceof Error?e.message:"Unknown error"}`)}}var OL=X.object({compression:X.enum(["none","brotli","gzip"]).optional().default("none"),file:X.string()});function DL(t,e){switch(e){case"brotli":return t.brotli.bytesPretty;case"gzip":return t.gzip.bytesPretty;case"none":return t.original.bytesPretty}}var JA={size:{async content(t){let e=OL.parse(t),r=IL.join(process.cwd(),e.file),n=await Ul(r);return DL(n,e.compression)}}};import eC from"node:path";var QA=X.union([X.string(),X.array(X.string())]).transform(t=>Array.isArray(t)?t:[t]),RL=X.union([X.object({brotli:X.boolean().optional().default(!0),file:QA,gzip:X.boolean().optional().default(!0),original:X.boolean().optional().default(!0),showPercentage:X.boolean().optional().default(!1)}),X.object({brotli:X.boolean().optional().default(!0),files:QA,gzip:X.boolean().optional().default(!0),original:X.boolean().optional().default(!0),showPercentage:X.boolean().optional().default(!1)})]).transform(t=>{if("file"in t){let{file:e,...r}=t;return{files:e,...r}}return t});function FL(t,e){let r=["File"];e.original&&r.push("Original"),e.gzip&&r.push("Gzip"),e.brotli&&r.push("Brotli");let n=r.map(()=>"---"),i=t.map(([o,s])=>{let a=[eC.basename(o)];return e.original&&a.push(s.original.bytesPretty),e.gzip&&a.push(e.showPercentage?`${s.gzip.bytesPretty} (${s.gzip.percentPretty})`:s.gzip.bytesPretty),e.brotli&&a.push(e.showPercentage?`${s.brotli.bytesPretty} (${s.brotli.percentPretty})`:s.brotli.bytesPretty),a});return[`| ${r.join(" | ")} |`,`| ${n.join(" | ")} |`,...i.map(o=>`| ${o.join(" | ")} |`)].join(`
237
- `)}var tC={"size-table":{async content(t){let e=RL.parse(t),r=await Promise.all(e.files.map(async n=>{let i=eC.join(process.cwd(),n),o=await Ul(i);return[n,o]}));return FL(r,{brotli:e.brotli,gzip:e.gzip,original:e.original,showPercentage:e.showPercentage})}}};var rC=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g;var NL=Object.hasOwnProperty,na=class{constructor(){this.occurrences,this.reset()}slug(e,r){let n=this,i=PL(e,r===!0),o=i;for(;NL.call(n.occurrences,i);)n.occurrences[o]++,i=o+"-"+n.occurrences[o];return n.occurrences[i]=0,i}reset(){this.occurrences=Object.create(null)}};function PL(t,e){return typeof t!="string"?"":(e||(t=t.toLowerCase()),t.replace(rC,"").replace(/ /g,"-"))}function zl(t){return new RegExp("^("+t+")$","i")}var nC=new na;function iC(t,e,r){let n="children"in t?t.children.length:0,i=r.skip?zl(r.skip):void 0,o=Fr(r.parents||function(c){return c===t}),s=[],a,u,l;return nC.reset(),_s(t,"heading",function(c,f,p){let d=tn(c,{includeImageAlt:!1}),m=c.data&&c.data.hProperties&&c.data.hProperties.id,y=nC.slug(m||d);if(o(p)){if(f!==void 0&&e&&!a&&e.test(d)){a=f+1,l=c;return}f!==void 0&&l&&!u&&c.depth<=l.depth&&(u=f),(u||!e)&&(!r.minDepth||c.depth>=r.minDepth)&&(!r.maxDepth||c.depth<=r.maxDepth)&&(!i||!i.test(d))&&s.push({depth:c.depth,children:c.children,id:y})}}),{index:a===void 0?-1:a,endIndex:a===void 0?-1:u||n,map:s}}var oC=typeof self=="object"?self:globalThis,jL=(t,e)=>{let r=(i,o)=>(t.set(o,i),i),n=i=>{if(t.has(i))return t.get(i);let[o,s]=e[i];switch(o){case 0:case-1:return r(s,i);case 1:{let a=r([],i);for(let u of s)a.push(n(u));return a}case 2:{let a=r({},i);for(let[u,l]of s)a[n(u)]=n(l);return a}case 3:return r(new Date(s),i);case 4:{let{source:a,flags:u}=s;return r(new RegExp(a,u),i)}case 5:{let a=r(new Map,i);for(let[u,l]of s)a.set(n(u),n(l));return a}case 6:{let a=r(new Set,i);for(let u of s)a.add(n(u));return a}case 7:{let{name:a,message:u}=s;return r(new oC[a](u),i)}case 8:return r(BigInt(s),i);case"BigInt":return r(Object(BigInt(s)),i);case"ArrayBuffer":return r(new Uint8Array(s).buffer,s);case"DataView":{let{buffer:a}=new Uint8Array(s);return r(new DataView(a),s)}}return r(new oC[o](s),i)};return n},Td=t=>jL(new Map,t)(0);var Jo="",{toString:UL}={},{keys:zL}=Object,ia=t=>{let e=typeof t;if(e!=="object"||!t)return[0,e];let r=UL.call(t).slice(8,-1);switch(r){case"Array":return[1,Jo];case"Object":return[2,Jo];case"Date":return[3,Jo];case"RegExp":return[4,Jo];case"Map":return[5,Jo];case"Set":return[6,Jo];case"DataView":return[1,r]}return r.includes("Array")?[1,r]:r.includes("Error")?[7,r]:[2,r]},ql=([t,e])=>t===0&&(e==="function"||e==="symbol"),$L=(t,e,r,n)=>{let i=(s,a)=>{let u=n.push(s)-1;return r.set(a,u),u},o=s=>{if(r.has(s))return r.get(s);let[a,u]=ia(s);switch(a){case 0:{let c=s;switch(u){case"bigint":a=8,c=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);c=null;break;case"undefined":return i([-1],s)}return i([a,c],s)}case 1:{if(u){let p=s;return u==="DataView"?p=new Uint8Array(s.buffer):u==="ArrayBuffer"&&(p=new Uint8Array(s)),i([u,[...p]],s)}let c=[],f=i([a,c],s);for(let p of s)c.push(o(p));return f}case 2:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(e&&"toJSON"in s)return o(s.toJSON());let c=[],f=i([a,c],s);for(let p of zL(s))(t||!ql(ia(s[p])))&&c.push([o(p),o(s[p])]);return f}case 3:return i([a,s.toISOString()],s);case 4:{let{source:c,flags:f}=s;return i([a,{source:c,flags:f}],s)}case 5:{let c=[],f=i([a,c],s);for(let[p,d]of s)(t||!(ql(ia(p))||ql(ia(d))))&&c.push([o(p),o(d)]);return f}case 6:{let c=[],f=i([a,c],s);for(let p of s)(t||!ql(ia(p)))&&c.push(o(p));return f}}let{message:l}=s;return i([a,{name:u,message:l}],s)};return o},_d=(t,{json:e,lossy:r}={})=>{let n=[];return $L(!(e||r),!!e,new Map,n)(t),n};var Sd=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?Td(_d(t,e)):structuredClone(t):(t,e)=>Td(_d(t,e));function cC(t,e){let{ordered:r=!1,tight:n=!1,prefix:i}=e,o={type:"list",ordered:r,spread:!1,children:[]},s=Number.POSITIVE_INFINITY,a=-1;for(;++a<t.length;)t[a].depth<s&&(s=t[a].depth);for(a=-1;++a<t.length;)t[a].depth-=s-1;for(a=-1;++a<t.length;)oa(t[a],o,{ordered:r,tight:n,prefix:i});return o}function oa(t,e,r){let n=-1,i=e.children[e.children.length-1];if(e.type==="list")if(t.depth===1)e.children.push({type:"listItem",spread:!1,children:[{type:"paragraph",children:[{type:"link",title:null,url:"#"+(r.prefix||"")+t.id,children:vd(t.children)}]}]});else if(e.children.length>0){let o=e.children[e.children.length-1];oa(t,o,r)}else{let o={type:"listItem",spread:!1,children:[]};e.children.push(o),oa(t,o,r)}else if(i&&i.type==="list")t.depth--,oa(t,i,r);else{let o={type:"list",ordered:r.ordered,spread:!1,children:[]};e.children.push(o),t.depth--,oa(t,o,r)}if(e.type==="list"&&!r.tight){for(e.spread=!1;++n<e.children.length;)if(e.children[n].children.length>1){e.spread=!0;break}}else e.spread=!r.tight}function vd(t){let e=[],r=-1;for(;++r<t.length;){let n=qL(t[r]);Array.isArray(n)?e.push(...n):e.push(n)}return e}function qL(t){if(t.type==="footnoteReference")return[];if(t.type==="link"||t.type==="linkReference")return vd(t.children);if("children"in t){let{children:n,position:i,...o}=t;return Object.assign(Sd(o),{children:vd(t.children)})}let{position:e,...r}=t;return Sd(r)}function Id(t,e){let r=e||{},n=r.heading?zl(r.heading):void 0,i=iC(t,n,r);return{index:n?i.index:void 0,endIndex:n?i.endIndex:void 0,map:i.map.length>0?cC(i.map,r):void 0}}var Vl={"table-of-contents":{applicationOrder:1,async content(t,e){let r=X.object({depth:X.union([X.literal(1),X.literal(2),X.literal(3),X.literal(4),X.literal(5),X.literal(6)]).optional()}).optional().parse(t),n=Id(e,{heading:null,maxDepth:r?.depth??3,tight:!0}),i="## Table of contents";if(n.map===void 0)throw new Error("Could not generate table of contents");let o={children:n.map.children,type:"root"},s=mo().use(Tn).stringify(o).replaceAll(`
230
+ \`\`\``}}};var Dl={contributing:{async content(){let e=(await Qt()).bugs?.url;if(e===void 0)throw new Error('Could not find "bugs.url" entry in package.json');return`## Contributing
231
+ [Issues](${e}) and pull requests are welcome.`},order:15}};var Rl={description:{async content(){let t=await Qt();if(t.description===void 0)throw new Error('Could not find "description" entry in package.json');return`**${t.description}**`},order:4}};import{getSoleRule as OA}from"remark-mdat";var Fl={license:{async content(){let t=await Qt(),{author:e,license:r}=t;if(e?.name===void 0)throw new Error('Could not find "author.name" entry in package.json');if(r===void 0)throw new Error('Could not find "license" entry in package.json');return`## License
232
+ [${r}](license.txt) \xA9 ${e.name}`},order:16}};var DA={footer:{content:[OA(Dl),OA(Fl)],order:17}};import{getSoleRule as Ll}from"remark-mdat";import{getSoleRule as VP}from"remark-mdat";var Nl={"short-description":VP(Rl)};var Pl={title:{applicationOrder:2,async content(t){let{postfix:e,prefix:r,titleCase:n}=X.object({postfix:X.string().optional().default(""),prefix:X.string().optional().default(""),titleCase:X.boolean().optional().default(!1)}).parse(t??{}),{name:i}=await Qt();return`# ${r}${n?GP(i):i}${e}`},order:1}};function GP(t){return t.split(/[ _-]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}var RA={header:{applicationOrder:2,content:[Ll(Pl),Ll(mu),Ll(du),Ll(Nl)],order:1}};import nL from"node:path";import JP from"node:fs/promises";import{promisify as PA}from"node:util";import{brotliCompress as QP,gzip as eL}from"node:zlib";var WP=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],HP=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],KP=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],YP=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],FA=(t,e,r)=>{let n=t;return typeof e=="string"||Array.isArray(e)?n=t.toLocaleString(e,r):(e===!0||r!==void 0)&&(n=t.toLocaleString(void 0,r)),n},NA=t=>{if(typeof t=="number")return Math.log10(t);let e=t.toString(10);return e.length+Math.log10("0."+e.slice(0,15))},ZP=t=>typeof t=="number"?Math.log(t):NA(t)*Math.log(10),XP=(t,e)=>{if(typeof t=="number")return t/e;let r=t/BigInt(e),n=t%BigInt(e);return Number(r)+Number(n)/e};function hd(t,e){if(typeof t!="bigint"&&!Number.isFinite(t))throw new TypeError(`Expected a finite number, got ${typeof t}: ${t}`);e={bits:!1,binary:!1,space:!0,...e};let r=e.bits?e.binary?YP:KP:e.binary?HP:WP,n=e.space?" ":"";if(e.signed&&(typeof t=="number"?t===0:t===0n))return` 0${n}${r[0]}`;let i=t<0,o=i?"-":e.signed?"+":"";i&&(t=-t);let s;if(e.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:e.minimumFractionDigits}),e.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:e.maximumFractionDigits,...s}),t<1){let c=FA(t,e.locale,s);return o+c+n+r[0]}let a=Math.min(Math.floor(e.binary?ZP(t)/Math.log(1024):NA(t)/3),r.length-1);t=XP(t,(e.binary?1024:1e3)**a),s||(t=t.toPrecision(3));let u=FA(Number(t),e.locale,s),l=r[a];return o+u+n+l}var tL=PA(QP),rL=PA(eL);function md(t,e){let r=e===0?0:(e-t)/e*100;return{bytes:t,bytesPretty:hd(t,{maximumFractionDigits:1}),percent:r,percentPretty:`${Math.round(r)}%`}}async function Ml(t){try{let e=await JP.readFile(t),r=e.length,[n,i]=await Promise.all([tL(e),rL(e)]);return{brotli:md(n.length,r),gzip:md(i.length,r),original:md(r,r)}}catch(e){throw new Error(`Failed to analyze file: ${e instanceof Error?e.message:"Unknown error"}`)}}var iL=X.object({compression:X.enum(["none","brotli","gzip"]).optional().default("none"),file:X.string()});function oL(t,e){switch(e){case"brotli":return t.brotli.bytesPretty;case"gzip":return t.gzip.bytesPretty;case"none":return t.original.bytesPretty}}var LA={size:{async content(t){let e=iL.parse(t),r=nL.join(process.cwd(),e.file),n=await Ml(r);return oL(n,e.compression)}}};import BA from"node:path";var MA=X.union([X.string(),X.array(X.string())]).transform(t=>Array.isArray(t)?t:[t]),sL=X.union([X.object({brotli:X.boolean().optional().default(!0),file:MA,gzip:X.boolean().optional().default(!0),original:X.boolean().optional().default(!0),showPercentage:X.boolean().optional().default(!1)}),X.object({brotli:X.boolean().optional().default(!0),files:MA,gzip:X.boolean().optional().default(!0),original:X.boolean().optional().default(!0),showPercentage:X.boolean().optional().default(!1)})]).transform(t=>{if("file"in t){let{file:e,...r}=t;return{files:e,...r}}return t});function aL(t,e){let r=["File"];e.original&&r.push("Original"),e.gzip&&r.push("Gzip"),e.brotli&&r.push("Brotli");let n=r.map(()=>"---"),i=t.map(([o,s])=>{let a=[BA.basename(o)];return e.original&&a.push(s.original.bytesPretty),e.gzip&&a.push(e.showPercentage?`${s.gzip.bytesPretty} (${s.gzip.percentPretty})`:s.gzip.bytesPretty),e.brotli&&a.push(e.showPercentage?`${s.brotli.bytesPretty} (${s.brotli.percentPretty})`:s.brotli.bytesPretty),a});return[`| ${r.join(" | ")} |`,`| ${n.join(" | ")} |`,...i.map(o=>`| ${o.join(" | ")} |`)].join(`
233
+ `)}var jA={"size-table":{async content(t){let e=sL.parse(t),r=await Promise.all(e.files.map(async n=>{let i=BA.join(process.cwd(),n),o=await Ml(i);return[n,o]}));return aL(r,{brotli:e.brotli,gzip:e.gzip,original:e.original,showPercentage:e.showPercentage})}}};var UA=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g;var uL=Object.hasOwnProperty,Xs=class{constructor(){this.occurrences,this.reset()}slug(e,r){let n=this,i=lL(e,r===!0),o=i;for(;uL.call(n.occurrences,i);)n.occurrences[o]++,i=o+"-"+n.occurrences[o];return n.occurrences[i]=0,i}reset(){this.occurrences=Object.create(null)}};function lL(t,e){return typeof t!="string"?"":(e||(t=t.toLowerCase()),t.replace(UA,"").replace(/ /g,"-"))}function Bl(t){return new RegExp("^("+t+")$","i")}var zA=new Xs;function $A(t,e,r){let n="children"in t?t.children.length:0,i=r.skip?Bl(r.skip):void 0,o=vr(r.parents||function(c){return c===t}),s=[],a,u,l;return zA.reset(),Es(t,"heading",function(c,f,p){let d=Xr(c,{includeImageAlt:!1}),m=c.data&&c.data.hProperties&&c.data.hProperties.id,y=zA.slug(m||d);if(o(p)){if(f!==void 0&&e&&!a&&e.test(d)){a=f+1,l=c;return}f!==void 0&&l&&!u&&c.depth<=l.depth&&(u=f),(u||!e)&&(!r.minDepth||c.depth>=r.minDepth)&&(!r.maxDepth||c.depth<=r.maxDepth)&&(!i||!i.test(d))&&s.push({depth:c.depth,children:c.children,id:y})}}),{index:a===void 0?-1:a,endIndex:a===void 0?-1:u||n,map:s}}var qA=typeof self=="object"?self:globalThis,dL=(t,e)=>{let r=(i,o)=>(t.set(o,i),i),n=i=>{if(t.has(i))return t.get(i);let[o,s]=e[i];switch(o){case 0:case-1:return r(s,i);case 1:{let a=r([],i);for(let u of s)a.push(n(u));return a}case 2:{let a=r({},i);for(let[u,l]of s)a[n(u)]=n(l);return a}case 3:return r(new Date(s),i);case 4:{let{source:a,flags:u}=s;return r(new RegExp(a,u),i)}case 5:{let a=r(new Map,i);for(let[u,l]of s)a.set(n(u),n(l));return a}case 6:{let a=r(new Set,i);for(let u of s)a.add(n(u));return a}case 7:{let{name:a,message:u}=s;return r(new qA[a](u),i)}case 8:return r(BigInt(s),i);case"BigInt":return r(Object(BigInt(s)),i);case"ArrayBuffer":return r(new Uint8Array(s).buffer,s);case"DataView":{let{buffer:a}=new Uint8Array(s);return r(new DataView(a),s)}}return r(new qA[o](s),i)};return n},yd=t=>dL(new Map,t)(0);var Wo="",{toString:hL}={},{keys:mL}=Object,Js=t=>{let e=typeof t;if(e!=="object"||!t)return[0,e];let r=hL.call(t).slice(8,-1);switch(r){case"Array":return[1,Wo];case"Object":return[2,Wo];case"Date":return[3,Wo];case"RegExp":return[4,Wo];case"Map":return[5,Wo];case"Set":return[6,Wo];case"DataView":return[1,r]}return r.includes("Array")?[1,r]:r.includes("Error")?[7,r]:[2,r]},Ul=([t,e])=>t===0&&(e==="function"||e==="symbol"),gL=(t,e,r,n)=>{let i=(s,a)=>{let u=n.push(s)-1;return r.set(a,u),u},o=s=>{if(r.has(s))return r.get(s);let[a,u]=Js(s);switch(a){case 0:{let c=s;switch(u){case"bigint":a=8,c=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);c=null;break;case"undefined":return i([-1],s)}return i([a,c],s)}case 1:{if(u){let p=s;return u==="DataView"?p=new Uint8Array(s.buffer):u==="ArrayBuffer"&&(p=new Uint8Array(s)),i([u,[...p]],s)}let c=[],f=i([a,c],s);for(let p of s)c.push(o(p));return f}case 2:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(e&&"toJSON"in s)return o(s.toJSON());let c=[],f=i([a,c],s);for(let p of mL(s))(t||!Ul(Js(s[p])))&&c.push([o(p),o(s[p])]);return f}case 3:return i([a,s.toISOString()],s);case 4:{let{source:c,flags:f}=s;return i([a,{source:c,flags:f}],s)}case 5:{let c=[],f=i([a,c],s);for(let[p,d]of s)(t||!(Ul(Js(p))||Ul(Js(d))))&&c.push([o(p),o(d)]);return f}case 6:{let c=[],f=i([a,c],s);for(let p of s)(t||!Ul(Js(p)))&&c.push(o(p));return f}}let{message:l}=s;return i([a,{name:u,message:l}],s)};return o},bd=(t,{json:e,lossy:r}={})=>{let n=[];return gL(!(e||r),!!e,new Map,n)(t),n};var Ed=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?yd(bd(t,e)):structuredClone(t):(t,e)=>yd(bd(t,e));function KA(t,e){let{ordered:r=!1,tight:n=!1,prefix:i}=e,o={type:"list",ordered:r,spread:!1,children:[]},s=Number.POSITIVE_INFINITY,a=-1;for(;++a<t.length;)t[a].depth<s&&(s=t[a].depth);for(a=-1;++a<t.length;)t[a].depth-=s-1;for(a=-1;++a<t.length;)Qs(t[a],o,{ordered:r,tight:n,prefix:i});return o}function Qs(t,e,r){let n=-1,i=e.children[e.children.length-1];if(e.type==="list")if(t.depth===1)e.children.push({type:"listItem",spread:!1,children:[{type:"paragraph",children:[{type:"link",title:null,url:"#"+(r.prefix||"")+t.id,children:Ad(t.children)}]}]});else if(e.children.length>0){let o=e.children[e.children.length-1];Qs(t,o,r)}else{let o={type:"listItem",spread:!1,children:[]};e.children.push(o),Qs(t,o,r)}else if(i&&i.type==="list")t.depth--,Qs(t,i,r);else{let o={type:"list",ordered:r.ordered,spread:!1,children:[]};e.children.push(o),t.depth--,Qs(t,o,r)}if(e.type==="list"&&!r.tight){for(e.spread=!1;++n<e.children.length;)if(e.children[n].children.length>1){e.spread=!0;break}}else e.spread=!r.tight}function Ad(t){let e=[],r=-1;for(;++r<t.length;){let n=xL(t[r]);Array.isArray(n)?e.push(...n):e.push(n)}return e}function xL(t){if(t.type==="footnoteReference")return[];if(t.type==="link"||t.type==="linkReference")return Ad(t.children);if("children"in t){let{children:n,position:i,...o}=t;return Object.assign(Ed(o),{children:Ad(t.children)})}let{position:e,...r}=t;return Ed(r)}function wd(t,e){let r=e||{},n=r.heading?Bl(r.heading):void 0,i=$A(t,n,r);return{index:n?i.index:void 0,endIndex:n?i.endIndex:void 0,map:i.map.length>0?KA(i.map,r):void 0}}var zl={"table-of-contents":{applicationOrder:1,async content(t,e){let r=X.object({depth:X.union([X.literal(1),X.literal(2),X.literal(3),X.literal(4),X.literal(5),X.literal(6)]).optional()}).optional().parse(t),n=wd(e,{heading:null,maxDepth:r?.depth??3,tight:!0}),i="## Table of contents";if(n.map===void 0)throw new Error("Could not generate table of contents");let o={children:n.map.children,type:"root"},s=uo().use(An).stringify(o).replaceAll(`
238
234
 
239
235
  `,`
240
236
  `);return[i,s].join(`
241
- `)},order:6}};import{tldrawToImage as fC}from"@kitschpatrol/tldraw-cli";import VL from"node:crypto";import Qo from"node:fs/promises";import kr from"node:path";var mC={tldraw:{async content(t){let{alt:e="tldraw diagram",src:r}=X.object({alt:X.string().optional(),src:X.string()}).parse(t),{assetsPath:n}=await Or();if(n===void 0)throw new Error("No assets path found");await Qo.mkdir(n,{recursive:!0});let i=await uo(r)?await dC(r):void 0;if(i!==void 0){let l=kr.basename(r,kr.extname(r)),c=kr.join(n,`${l}-${i}-light.svg`),f=kr.join(n,`${l}-${i}-dark.svg`);if(await uo(c)&&await uo(f))return pC(c,f,e)}let[o]=await fC(r,{dark:!1,format:"svg",output:n,transparent:!0});i??=await dC(o);let s=`${hC(o)}-${i}-light.svg`;await Qo.rename(o,s);let[a]=await fC(r,{dark:!0,format:"svg",output:n,transparent:!0}),u=`${hC(a)}-${i}-dark.svg`;if(await Qo.rename(a,u),i!==void 0){let l=kr.basename(u),c=kr.basename(s),f=c.replace(`${i}-light.svg`,""),p=await Qo.readdir(n);for(let d of p){let m=kr.basename(d);m!==l&&m!==c&&m.startsWith(f)&&m.endsWith(".svg")&&await Qo.rm(kr.join(n,m))}}return pC(s,u,e)}}};async function pC(t,e,r){let{packageFile:n}=await Or();if(n===void 0)throw new Error("No package file found");let i=kr.dirname(n),o=kr.relative(i,t);return`<picture>
242
- <source media="(prefers-color-scheme: dark)" srcset="${kr.relative(i,e)}">
237
+ `)},order:6}};import{tldrawToImage as YA}from"@kitschpatrol/tldraw-cli";import yL from"node:crypto";import Ho from"node:fs/promises";import br from"node:path";var QA={tldraw:{async content(t){let{alt:e="tldraw diagram",src:r}=X.object({alt:X.string().optional(),src:X.string()}).parse(t),{assetsPath:n}=await Tr();if(n===void 0)throw new Error("No assets path found");await Ho.mkdir(n,{recursive:!0});let i=await ro(r)?await XA(r):void 0;if(i!==void 0){let l=br.basename(r,br.extname(r)),c=br.join(n,`${l}-${i}-light.svg`),f=br.join(n,`${l}-${i}-dark.svg`);if(await ro(c)&&await ro(f))return ZA(c,f,e)}let[o]=await YA(r,{dark:!1,format:"svg",output:n,transparent:!0});i??=await XA(o);let s=`${JA(o)}-${i}-light.svg`;await Ho.rename(o,s);let[a]=await YA(r,{dark:!0,format:"svg",output:n,transparent:!0}),u=`${JA(a)}-${i}-dark.svg`;if(await Ho.rename(a,u),i!==void 0){let l=br.basename(u),c=br.basename(s),f=c.replace(`${i}-light.svg`,""),p=await Ho.readdir(n);for(let d of p){let m=br.basename(d);m!==l&&m!==c&&m.startsWith(f)&&m.endsWith(".svg")&&await Ho.rm(br.join(n,m))}}return ZA(s,u,e)}}};async function ZA(t,e,r){let{packageFile:n}=await Tr();if(n===void 0)throw new Error("No package file found");let i=br.dirname(n),o=br.relative(i,t);return`<picture>
238
+ <source media="(prefers-color-scheme: dark)" srcset="${br.relative(i,e)}">
243
239
  <source media="(prefers-color-scheme: light)" srcset="${o}">
244
240
  <img alt="${r}" src="${o}">
245
- </picture>`}async function dC(t){let e=await Qo.readFile(t),r=VL.createHash("sha1");return r.update(e),r.digest("hex").slice(0,8)}function hC(t){return t.replace(/\.[^./]+$/,"")}import{getSoleRule as GL}from"remark-mdat";var gC={toc:GL(Vl)};var xC={...gu,...yu,...VA,...Fl,...WA,...Nl,...Pl,...KA,...YA,...Ll,...Ml,...JA,...tC,...Vl,...Bl,...mC,...gC};async function Gl(t){let e={addMetaComment:!0,rules:xC},{additionalConfig:r=[],...n}=t??{},i=Array.isArray(r)?r:[r],o=await Ai({additionalConfig:[e,...i],...n});if(o.packageFile===void 0)throw new Error("Package file path is required in `mdat readme` config");return o}import aa from"node:path";import KL from"node:process";import YL from"node:path";import Lse,{promises as yC}from"node:fs";import{fileURLToPath as ZL}from"node:url";var Od=class{value;next;constructor(e){this.value=e}},sa=class{#e;#t;#r;constructor(){this.clear()}enqueue(e){let r=new Od(e);this.#e?(this.#t.next=r,this.#t=r):(this.#e=r,this.#t=r),this.#r++}dequeue(){let e=this.#e;if(e)return this.#e=this.#e.next,this.#r--,e.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#r=0}get size(){return this.#r}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}};function Wl(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let e=new sa,r=0,n=()=>{r--,e.size>0&&e.dequeue()()},i=async(a,u,l)=>{r++;let c=(async()=>a(...l))();u(c);try{await c}catch{}n()},o=(a,u,l)=>{e.enqueue(i.bind(void 0,a,u,l)),(async()=>(await Promise.resolve(),r<t&&e.size>0&&e.dequeue()()))()},s=(a,...u)=>new Promise(l=>{o(a,l,u)});return Object.defineProperties(s,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}}),s}var Hl=class extends Error{constructor(e){super(),this.value=e}},WL=async(t,e)=>e(await t),HL=async t=>{let e=await Promise.all(t);if(e[1]===!0)throw new Hl(e[0]);return!1};async function Dd(t,e,{concurrency:r=Number.POSITIVE_INFINITY,preserveOrder:n=!0}={}){let i=Wl(r),o=[...t].map(a=>[a,i(WL,a,e)]),s=Wl(n?1:Number.POSITIVE_INFINITY);try{await Promise.all(o.map(a=>s(HL,a)))}catch(a){if(a instanceof Hl)return a.value;throw a}}var bC={directory:"isDirectory",file:"isFile"};function XL(t){if(!Object.hasOwnProperty.call(bC,t))throw new Error(`Invalid type specified: ${t}`)}var JL=(t,e)=>e[bC[t]](),QL=t=>t instanceof URL?ZL(t):t;async function Rd(t,{cwd:e=KL.cwd(),type:r="file",allowSymlinks:n=!0,concurrency:i,preserveOrder:o}={}){XL(r),e=QL(e);let s=n?yC.stat:yC.lstat;return Dd(t,async a=>{try{let u=await s(YL.resolve(e,a));return JL(r,u)}catch{return!1}},{concurrency:i,preserveOrder:o})}import{fileURLToPath as eM}from"node:url";function Fd(t){return t instanceof URL?eM(t):t}var tM=Symbol("findUpStop");async function rM(t,e={}){let r=aa.resolve(Fd(e.cwd)??""),{root:n}=aa.parse(r),i=aa.resolve(r,Fd(e.stopAt??n)),o=e.limit??Number.POSITIVE_INFINITY,s=[t].flat(),a=async l=>{if(typeof t!="function")return Rd(s,l);let c=await t(l.cwd);return typeof c=="string"?Rd([c],l):c},u=[];for(;;){let l=await a({...e,cwd:r});if(l===tM||(l&&u.push(aa.resolve(r,l)),r===i||u.length>=o))break;r=aa.dirname(r)}return u}async function EC(t,e={}){return(await rM(t,{...e,limit:1}))[0]}import nM from"node:path";async function AC({cwd:t}={}){let e=await Ma("package.json",{cwd:t});return e&&nM.dirname(e)}import{log as CC}from"remark-mdat";async function Nd(){CC.info("Searching for package directory...");let t=await AC()??process.cwd(),e=await EC("readme.md",{stopAt:t,type:"file"});if(e!==void 0)return CC.info(`Found closest readme at "${e}"`),e}async function Kl(){let t=await Nd();if(t===void 0)throw new Error("No readme found");return t}async function Yl(t,e,r,n,i){return t??=await Kl(),_n(t,Gl,du,e,r,n,i)}async function wC(t,e,r,n,i){return t??=await Kl(),_n(t,Gl,mu,e,r,n,i)}async function kC(t,e,r,n,i){return t??=await Kl(),_n(t,Gl,hu,e,r,n,i)}import{confirm as DC,group as cM,intro as fM,note as RC,outro as pM,select as Pd}from"@clack/prompts";import dM from"node:fs/promises";import Zl from"node:path";import{deepMergeDefined as hM}from"remark-mdat";var TC=`<!-- header -->
241
+ </picture>`}async function XA(t){let e=await Ho.readFile(t),r=yL.createHash("sha1");return r.update(e),r.digest("hex").slice(0,8)}function JA(t){return t.replace(/\.[^./]+$/,"")}import{getSoleRule as bL}from"remark-mdat";var ew={toc:bL(zl)};var tw={...du,...mu,...SA,...Ol,...IA,...Dl,...Rl,...DA,...RA,...Fl,...Nl,...LA,...jA,...zl,...Pl,...QA,...ew};async function $l(t){let e={addMetaComment:!0,rules:tw},{additionalConfig:r=[],...n}=t??{},i=Array.isArray(r)?r:[r],o=await xi({additionalConfig:[e,...i],...n});if(o.packageFile===void 0)throw new Error("Package file path is required in `mdat readme` config");return o}import ta from"node:path";import wL from"node:process";import CL from"node:path";import Xoe,{promises as rw}from"node:fs";import{fileURLToPath as kL}from"node:url";var Cd=class{value;next;constructor(e){this.value=e}},ea=class{#e;#t;#r;constructor(){this.clear()}enqueue(e){let r=new Cd(e);this.#e?(this.#t.next=r,this.#t=r):(this.#e=r,this.#t=r),this.#r++}dequeue(){let e=this.#e;if(e)return this.#e=this.#e.next,this.#r--,e.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#r=0}get size(){return this.#r}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}*drain(){for(;this.#e;)yield this.dequeue()}};function ql(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let e=new ea,r=0,n=()=>{r--,e.size>0&&e.dequeue()()},i=async(a,u,l)=>{r++;let c=(async()=>a(...l))();u(c);try{await c}catch{}n()},o=(a,u,l)=>{e.enqueue(i.bind(void 0,a,u,l)),(async()=>(await Promise.resolve(),r<t&&e.size>0&&e.dequeue()()))()},s=(a,...u)=>new Promise(l=>{o(a,l,u)});return Object.defineProperties(s,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}}),s}var Vl=class extends Error{constructor(e){super(),this.value=e}},EL=async(t,e)=>e(await t),AL=async t=>{let e=await Promise.all(t);if(e[1]===!0)throw new Vl(e[0]);return!1};async function kd(t,e,{concurrency:r=Number.POSITIVE_INFINITY,preserveOrder:n=!0}={}){let i=ql(r),o=[...t].map(a=>[a,i(EL,a,e)]),s=ql(n?1:Number.POSITIVE_INFINITY);try{await Promise.all(o.map(a=>s(AL,a)))}catch(a){if(a instanceof Vl)return a.value;throw a}}var nw={directory:"isDirectory",file:"isFile"};function TL(t){if(!Object.hasOwnProperty.call(nw,t))throw new Error(`Invalid type specified: ${t}`)}var _L=(t,e)=>e[nw[t]](),SL=t=>t instanceof URL?kL(t):t;async function Td(t,{cwd:e=wL.cwd(),type:r="file",allowSymlinks:n=!0,concurrency:i,preserveOrder:o}={}){TL(r),e=SL(e);let s=n?rw.stat:rw.lstat;return kd(t,async a=>{try{let u=await s(CL.resolve(e,a));return _L(r,u)}catch{return!1}},{concurrency:i,preserveOrder:o})}import{fileURLToPath as vL}from"node:url";function _d(t){return t instanceof URL?vL(t):t}var IL=Symbol("findUpStop");async function OL(t,e={}){let r=ta.resolve(_d(e.cwd)??""),{root:n}=ta.parse(r),i=ta.resolve(r,_d(e.stopAt??n)),o=e.limit??Number.POSITIVE_INFINITY,s=[t].flat(),a=async l=>{if(typeof t!="function")return Td(s,l);let c=await t(l.cwd);return typeof c=="string"?Td([c],l):c},u=[];for(;;){let l=await a({...e,cwd:r});if(l===IL||(l&&u.push(ta.resolve(r,l)),r===i||u.length>=o))break;r=ta.dirname(r)}return u}async function iw(t,e={}){return(await OL(t,{...e,limit:1}))[0]}import DL from"node:path";async function ow({cwd:t}={}){let e=await Fa("package.json",{cwd:t});return e&&DL.dirname(e)}import{log as sw}from"remark-mdat";async function Sd(){sw.info("Searching for package directory...");let t=await ow()??process.cwd(),e=await iw("readme.md",{stopAt:t,type:"file"});if(e!==void 0)return sw.info(`Found closest readme at "${e}"`),e}async function Gl(){let t=await Sd();if(t===void 0)throw new Error("No readme found");return t}async function Wl(t,e,r,n,i){return t??=await Gl(),wn(t,$l,cu,e,r,n,i)}async function aw(t,e,r,n,i){return t??=await Gl(),wn(t,$l,pu,e,r,n,i)}async function uw(t,e,r,n,i){return t??=await Gl(),wn(t,$l,fu,e,r,n,i)}var zr=ts(la(),1);import{confirm as mw,group as BL,intro as jL,note as gw,outro as UL,select as vd}from"@clack/prompts";import zL from"node:fs/promises";import Hl from"node:path";import{deepMergeDefined as $L}from"remark-mdat";var lw=`<!-- header -->
246
242
 
247
243
  <!-- table-of-contents -->
248
244
 
@@ -287,7 +283,7 @@ _List maintainer(s) for a repository, along with one way of contacting them (e.g
287
283
  _State anyone or anything that significantly helped with the development of your project. State public contact hyper-links if applicable._
288
284
 
289
285
  <!-- footer -->
290
- `;var _C=`<!-- title -->
286
+ `;var cw=`<!-- title -->
291
287
 
292
288
  <!-- banner -->
293
289
 
@@ -340,7 +336,7 @@ _State anyone or anything that significantly helped with the development of your
340
336
  <!-- contributing -->
341
337
 
342
338
  <!-- license -->
343
- `;var SC=`<!-- header -->
339
+ `;var fw=`<!-- header -->
344
340
 
345
341
  ## Install
346
342
 
@@ -356,7 +352,7 @@ _State anyone or anything that significantly helped with the development of your
356
352
  \`\`\`
357
353
 
358
354
  <!-- footer -->
359
- `;var vC=`<!-- title -->
355
+ `;var pw=`<!-- title -->
360
356
 
361
357
  <!-- short-description -->
362
358
 
@@ -378,7 +374,7 @@ _State anyone or anything that significantly helped with the development of your
378
374
  <!-- contributing -->
379
375
 
380
376
  <!-- license -->
381
- `;var IC=`<!-- header -->
377
+ `;var dw=`<!-- header -->
382
378
 
383
379
  _Long description goes here._
384
380
 
@@ -441,7 +437,7 @@ _List maintainer(s) for a repository, along with one way of contacting them (e.g
441
437
  _State anyone or anything that significantly helped with the development of your project. State public contact hyper-links if applicable._
442
438
 
443
439
  <!-- footer -->
444
- `;var OC=`<!-- title -->
440
+ `;var hw=`<!-- title -->
445
441
 
446
442
  <!-- banner -->
447
443
 
@@ -512,30 +508,12 @@ _State anyone or anything that significantly helped with the development of your
512
508
  <!-- contributing -->
513
509
 
514
510
  <!-- license -->
515
- `;var zi={"MDAT Readme":{content:{compound:TC,explicit:_C},description:"The house style. An expansive starting point. Prune to your context and taste.",exampleLink:"https://github.com/kitschpatrol/mdat/blob/main/readme.md"},"Standard Readme Basic":{content:{compound:SC,explicit:vC},description:'Includes only the "required" sections from the Standard Readme specification.',exampleLink:"https://github.com/RichardLitt/standard-readme/blob/main/example-readmes/minimal-readme.md"},"Standard Readme Full":{content:{compound:IC,explicit:OC},description:"Includes all sections from the Standard Readme specification.",exampleLink:"https://github.com/RichardLitt/standard-readme/blob/main/example-readmes/maximal-readme.md"}};async function FC(){let t=await Nd(),e=await Ba();return{packageDirectory:e===void 0?void 0:Zl.dirname(Zl.resolve(e)),readmePath:t}}async function NC(){let{packageDirectory:t,readmePath:e}=await FC(),r=Zl.resolve(process.cwd());fM(`Running ${St.bold("mdat readme init")} interactively`);let n=await cM({overwrite:async()=>e===void 0||await DC({message:`Found an existing readme at "${St.blue(e)}". Do you want to overwrite it?`,active:"Overwrite",inactive:"Exit"})?!0:(()=>{throw new Error("`mdat readme init` was cancelled to avoid an overwrite - no changes were made")})(),output:async()=>t!==void 0&&t!==r?Pd({initialValue:t,message:"There's a root package directory nearby, do you want to create the readme there instead of the current directory?",options:[{label:`Create in the current package root: "${St.blue(t)}"`,value:t},{label:`Create in current working directory: "${St.blue(r)}"`,value:r}]}):r,template:async()=>Pd({message:"Which template would you like to use?",options:gM()}),compound:async()=>Pd({message:'Do you want to use "compound comments" where possible, which combine several expansions into a single comment block?',options:[{label:`Yes: Combine things like ${St.green("<!-- title -->")} and ${St.green("<!-- badges -->")} in a single ${St.green("<!-- header -->")} comment.`,value:!0},{label:"No: Use individual MDAT expansion comments for each section.",value:!1}]}),expand:async()=>t===void 0?!1:DC({initialValue:!0,message:"Do you want to run `mdat readme` now to expand the template with content from your package.json?"})},{onCancel(){throw new Error("`mdat readme init` was cancelled - no changes were made")}}),i=await Ld(n);return t===void 0&&RC("No package.json was found. Once you've created one, you can run `mdat readme` to expand the template with content from your package.json."),RC(`Readme created: "${St.bold.blue(i)}"`),pM("Done!"),i}async function Ld(t){let{packageDirectory:e}=await FC(),r=hM({compound:!0,output:e??process.cwd(),overwrite:!0,expand:e!==void 0,template:Object.keys(zi)[0]},t??{}),n=mM(r.template,r.compound),i=Zl.join(r.output,"readme.md");await dM.writeFile(i,n,"utf8");let[o]=await Yl(i);return await pn(o),i}function mM(t,e){let n=zi[t].content[e?"compound":"explicit"];if(n===void 0||n==="")throw new Error(`No template found for "${t}"`);return n}function gM(){return Object.entries(zi).map(([t,e])=>({label:t,hint:e.description,value:t}))}var $i={config:{defaultDescription:"Configuration is loaded if found from the usual places, or defaults are used.",description:"Path(s) to files containing MDAT configuration.",string:!0,type:"array"}},ua={meta:{alias:"m",description:"Embed an extra comment at the top of the generated Markdown warning editors that certain sections of the document have been generated dynamically.",type:"boolean"}},la={name:{alias:"n",defaultDescription:"Same name as input file. Overwrites the input file.",description:"Output file name.",type:"string"}},es={output:{alias:"o",defaultDescription:"Same directory as input file.",description:"Output file directory.",type:"string"}},qi={prefix:{description:"Require a string prefix before all comments to be considered for expansion. Useful if you have a bunch of non-MDAT comments in your Markdown file, or if you're willing to trade some verbosity for safety.",type:"string"}},ca={print:{description:"Print the expanded Markdown to stdout instead of saving to a file. Ignores `--output` and `--name` options.",type:"boolean"}},fa={rules:{alias:"r",description:"Path(s) to files containing MDAT comment expansion rules.",string:!0,type:"array"}},Vn={verbose:{describe:"Enable verbose logging. All verbose logs and prefixed with their log level and are printed to stderr for ease of redirection.",type:"boolean"}},Xl=["files",{array:!0,demandOption:!0,describe:"Markdown file(s) with MDAT placeholder comments.",type:"string"}];var Md={package:{defaultDescription:"The closest package.json file is used by default.",description:"Path to the package.json file to use to populate the readme.",string:!0}},Bd={assets:{defaultDescription:"./assets",description:"Path to find and save readme-related assets.",string:!0}},PC={interactive:{alias:"i",default:!0,description:"Run the guided interactive `init` process. Set explicitly to `false` to use default values and skip the prompt.",type:"boolean"}},LC={overwrite:{default:!1,defaultDescription:"`false`, if an existing readme is found, don't touch it.",description:"Replace an existing readme file if one is found.",type:"boolean"}},MC={expand:{alias:"e",default:!0,description:"Automatically run `mdat readme` immediately after creating the readme template.",type:"boolean"}},BC={template:{alias:"t",choices:Object.keys(zi),default:Object.keys(zi)[0],description:"Specify a template to use for the new readme.",type:"string"}},jC={compound:{alias:"c",default:!0,description:"Use compound comment version of the template to replace several individual comment placeholders where possible. This combines things like `<!-- title -->`, `<!-- badges -->`, etc. in a single `<!-- header -->` comment. It's less clutter when you're editing, but it's also less explicit. The final readme.md output is identical.",type:"boolean"}},Jl=["files",{array:!0,demandOption:!1,describe:"Readme file(s) with MDAT placeholder comments. If not provided, the closest readme.md file is used.",type:"string"}];var Vi=performance.now(),UC=em(xc(process.argv));try{await UC.scriptName("mdat").usage("$0 [command]","Work with MDAT placeholder comments in any Markdown file.").command(["$0 <files..> [options]","expand <files..> [options]"],"Expand MDAT placeholder comments.",t=>t.positional(...Xl).option($i).option(fa).option(es).option(la).option(ua).option(qi).option(ca).option(Vn),async({config:t,files:e,meta:r,name:n,output:i,prefix:o,print:s,rules:a,verbose:u})=>{gt.verbose=u??!1,Ql({name:n,output:i,print:s});let l=rs(t,{addMetaComment:r,keywordPrefix:o}),c=await gx(e,n,i,l,a);for(let f of c)s?process.stdout.write(f.toString()):await pn(f);ts(c),gt.info(`Expanded comments in ${Kr(performance.now()-Vi)}.`),process.exitCode=ns(c)}).command("check <files..> [options]","Validate a Markdown file containing MDAT placeholder comments.",t=>t.positional(...Xl).option($i).option(fa).option(ua).option(qi).option(Vn),async({config:t,files:e,meta:r,prefix:n,rules:i,verbose:o})=>{gt.verbose=o??!1;let s=rs(t,{addMetaComment:r,keywordPrefix:n}),a=await xx(e,void 0,void 0,s,i);ts(a),gt.info(`Checked comments in ${Kr(performance.now()-Vi)}.`),process.exitCode=ns(a)}).command("collapse <files..> [options]","Collapse MDAT placeholder comments.",t=>t.positional(...Xl).option($i).option(es).option(la).option(qi).option(ca).option(Vn),async({config:t,files:e,name:r,output:n,prefix:i,print:o,verbose:s})=>{gt.verbose=s??!1,Ql({name:r,output:n,print:o});let a=rs(t,{keywordPrefix:i}),u=await yx(e,void 0,void 0,a);for(let l of u)o?process.stdout.write(l.toString()):await pn(l);ts(u),gt.info(`Cleaned comments in ${Kr(performance.now()-Vi)}.`),process.exitCode=ns(u)}).command("readme [command]","Work with MDAT comments in your readme.md.",t=>t.command(["$0 [files..] [options]","expand [files..] [options]"],"Expand MDAT comment placeholders in your readme.md using a collection of helpful built-in expansion rules.",e=>e.positional(...Jl).option($i).option(fa).option(es).option(la).option(Md).option(Bd).option(qi).option(ua).option(ca).option(Vn),async({assets:e,config:r,files:n,meta:i,name:o,output:s,package:a,prefix:u,print:l,rules:c,verbose:f})=>{gt.verbose=f??!1,Ql({name:o,output:s,print:l});let p=rs(r,{addMetaComment:i,assetsPath:e,keywordPrefix:u,packageFile:a}),d=await Yl(n,o,s,p,c);for(let y of d)l?process.stdout.write(y.toString()):await pn(y);ts(d);let{packageFile:m}=await Or();gt.info(`Pulled package metadata from: ${St.bold.blue(m)}`),gt.info(`Expanded readme(s) in ${Kr(performance.now()-Vi)}.`),process.exitCode=ns(d)}).command("check [files..] [options]","Validate MDAT placeholder comments in your readme.md.",e=>e.positional(...Jl).option($i).option(fa).option(Md).option(Bd).option(qi).option(ua).option(Vn),async({assets:e,config:r,files:n,meta:i,package:o,prefix:s,rules:a,verbose:u})=>{gt.verbose=u??!1;let l=rs(r,{addMetaComment:i,assetsPath:e,keywordPrefix:s,packageFile:o}),c=await wC(n,void 0,void 0,l,a);ts(c);let{packageFile:f}=await Or();gt.info(`Pulled package metadata from: ${St.bold.blue(f)}`),gt.info(`Checked readme(s) in ${Kr(performance.now()-Vi)}.`),process.exitCode=ns(c)}).command("collapse [files..] [options]","Collapse MDAT placeholder comments in your readme.md.",e=>e.positional(...Jl).option(es).option(la).option(ca).option($i).option(qi).option(Vn),async({config:e,files:r,name:n,output:i,prefix:o,print:s,verbose:a})=>{gt.verbose=a??!1,Ql({name:n,output:i,print:s});let u=rs(e,{keywordPrefix:o}),l=await kC(r,void 0,void 0,u);for(let c of l)s?process.stdout.write(c.toString()):await pn(c);ts(l),gt.info(`Cleaned readme(s) in ${Kr(performance.now()-Vi)}.`),process.exitCode=ns(l)}).command("init [options]","Interactively create a new readme.md file with sensible default MDAT comment placeholders.",e=>e.option(PC).option(LC).option(es).option(MC).option(BC).option(jC).option(Vn),async({compound:e,expand:r,interactive:n,output:i,overwrite:o,template:s,verbose:a})=>{if(gt.verbose=a??!1,n)await NC();else{let u=await Ld({compound:e,expand:r,output:i,overwrite:o,template:s});gt.info(`Created readme at "${St.blue(u)}" in ${Kr(performance.now()-Vi)}.`)}process.exitCode=0}),()=>{gt.error("Root MDAT readme command should be unreachable.")}).help().alias("h","help").version(tm).alias("v","version").wrap(process.stdout.isTTY?Math.min(120,UC.terminalWidth()):0).fail(!1).parse()}catch(t){t instanceof Error&&gt.error(t.message),process.exitCode=1}function Ql(t){t.print&&t.output&&gt.warn("Ignoring --output option because --print is set"),t.print&&t.name&&gt.warn("Ignoring --name option because --print is set")}function rs(t,e){return[...ja(t),e]}function ns(t){return xM(t).reduce((n,i)=>n+i.errors.length,0)>0?1:0}
511
+ `;var Mi={"MDAT Readme":{content:{compound:lw,explicit:cw},description:"The house style. An expansive starting point. Prune to your context and taste.",exampleLink:"https://github.com/kitschpatrol/mdat/blob/main/readme.md"},"Standard Readme Basic":{content:{compound:fw,explicit:pw},description:'Includes only the "required" sections from the Standard Readme specification.',exampleLink:"https://github.com/RichardLitt/standard-readme/blob/main/example-readmes/minimal-readme.md"},"Standard Readme Full":{content:{compound:dw,explicit:hw},description:"Includes all sections from the Standard Readme specification.",exampleLink:"https://github.com/RichardLitt/standard-readme/blob/main/example-readmes/maximal-readme.md"}};async function xw(){let t=await Sd(),e=await Na();return{packageDirectory:e===void 0?void 0:Hl.dirname(Hl.resolve(e)),readmePath:t}}async function yw(){let{packageDirectory:t,readmePath:e}=await xw(),r=Hl.resolve(process.cwd());jL(`Running ${zr.default.bold("mdat readme init")} interactively`);let n=await BL({overwrite:async()=>e===void 0||await mw({message:`Found an existing readme at "${zr.default.blue(e)}". Do you want to overwrite it?`,active:"Overwrite",inactive:"Exit"})?!0:(()=>{throw new Error("`mdat readme init` was cancelled to avoid an overwrite - no changes were made")})(),output:async()=>t!==void 0&&t!==r?vd({initialValue:t,message:"There's a root package directory nearby, do you want to create the readme there instead of the current directory?",options:[{label:`Create in the current package root: "${zr.default.blue(t)}"`,value:t},{label:`Create in current working directory: "${zr.default.blue(r)}"`,value:r}]}):r,template:async()=>vd({message:"Which template would you like to use?",options:VL()}),compound:async()=>vd({message:'Do you want to use "compound comments" where possible, which combine several expansions into a single comment block?',options:[{label:`Yes: Combine things like ${zr.default.green("<!-- title -->")} and ${zr.default.green("<!-- badges -->")} in a single ${zr.default.green("<!-- header -->")} comment.`,value:!0},{label:"No: Use individual MDAT expansion comments for each section.",value:!1}]}),expand:async()=>t===void 0?!1:mw({initialValue:!0,message:"Do you want to run `mdat readme` now to expand the template with content from your package.json?"})},{onCancel(){throw new Error("`mdat readme init` was cancelled - no changes were made")}}),i=await Id(n);return t===void 0&&gw("No package.json was found. Once you've created one, you can run `mdat readme` to expand the template with content from your package.json."),gw(`Readme created: "${zr.default.blue(zr.default.bold(i))}"`),UL("Done!"),i}async function Id(t){let{packageDirectory:e}=await xw(),r=$L({compound:!0,output:e??process.cwd(),overwrite:!0,expand:e!==void 0,template:Object.keys(Mi)[0]},t??{}),n=qL(r.template,r.compound),i=Hl.join(r.output,"readme.md");await zL.writeFile(i,n,"utf8");let[o]=await Wl(i);return await un(o),i}function qL(t,e){let n=Mi[t].content[e?"compound":"explicit"];if(n===void 0||n==="")throw new Error(`No template found for "${t}"`);return n}function VL(){return Object.entries(Mi).map(([t,e])=>({label:t,hint:e.description,value:t}))}var Bi={config:{defaultDescription:"Configuration is loaded if found from the usual places, or defaults are used.",description:"Path(s) to files containing MDAT configuration.",string:!0,type:"array"}},ra={meta:{alias:"m",description:"Embed an extra comment at the top of the generated Markdown warning editors that certain sections of the document have been generated dynamically.",type:"boolean"}},na={name:{alias:"n",defaultDescription:"Same name as input file. Overwrites the input file.",description:"Output file name.",type:"string"}},Ko={output:{alias:"o",defaultDescription:"Same directory as input file.",description:"Output file directory.",type:"string"}},ji={prefix:{description:"Require a string prefix before all comments to be considered for expansion. Useful if you have a bunch of non-MDAT comments in your Markdown file, or if you're willing to trade some verbosity for safety.",type:"string"}},ia={print:{description:"Print the expanded Markdown to stdout instead of saving to a file. Ignores `--output` and `--name` options.",type:"boolean"}},oa={rules:{alias:"r",description:"Path(s) to files containing MDAT comment expansion rules.",string:!0,type:"array"}},Un={verbose:{describe:"Enable verbose logging. All verbose logs and prefixed with their log level and are printed to stderr for ease of redirection.",type:"boolean"}},Kl=["files",{array:!0,demandOption:!0,describe:"Markdown file(s) with MDAT placeholder comments.",type:"string"}];var Od={package:{defaultDescription:"The closest package.json file is used by default.",description:"Path to the package.json file to use to populate the readme.",string:!0}},Dd={assets:{defaultDescription:"./assets",description:"Path to find and save readme-related assets.",string:!0}},bw={interactive:{alias:"i",default:!0,description:"Run the guided interactive `init` process. Set explicitly to `false` to use default values and skip the prompt.",type:"boolean"}},Ew={overwrite:{default:!1,defaultDescription:"`false`, if an existing readme is found, don't touch it.",description:"Replace an existing readme file if one is found.",type:"boolean"}},Aw={expand:{alias:"e",default:!0,description:"Automatically run `mdat readme` immediately after creating the readme template.",type:"boolean"}},ww={template:{alias:"t",choices:Object.keys(Mi),default:Object.keys(Mi)[0],description:"Specify a template to use for the new readme.",type:"string"}},Cw={compound:{alias:"c",default:!0,description:"Use compound comment version of the template to replace several individual comment placeholders where possible. This combines things like `<!-- title -->`, `<!-- badges -->`, etc. in a single `<!-- header -->` comment. It's less clutter when you're editing, but it's also less explicit. The final readme.md output is identical.",type:"boolean"}},Yl=["files",{array:!0,demandOption:!1,describe:"Readme file(s) with MDAT placeholder comments. If not provided, the closest readme.md file is used.",type:"string"}];var Ui=performance.now(),kw=Mh(cc(process.argv));try{await kw.scriptName("mdat").usage("$0 [command]","Work with MDAT placeholder comments in any Markdown file.").command(["$0 <files..> [options]","expand <files..> [options]"],"Expand MDAT placeholder comments.",t=>t.positional(...Kl).option(Bi).option(oa).option(Ko).option(na).option(ra).option(ji).option(ia).option(Un),async({config:t,files:e,meta:r,name:n,output:i,prefix:o,print:s,rules:a,verbose:u})=>{ht.verbose=u??!1,Zl({name:n,output:i,print:s});let l=Zo(t,{addMetaComment:r,keywordPrefix:o}),c=await Qg(e,n,i,l,a);for(let f of c)s?process.stdout.write(f.toString()):await un(f);Yo(c),ht.info(`Expanded comments in ${Vr(performance.now()-Ui)}.`),process.exitCode=Xo(c)}).command("check <files..> [options]","Validate a Markdown file containing MDAT placeholder comments.",t=>t.positional(...Kl).option(Bi).option(oa).option(ra).option(ji).option(Un),async({config:t,files:e,meta:r,prefix:n,rules:i,verbose:o})=>{ht.verbose=o??!1;let s=Zo(t,{addMetaComment:r,keywordPrefix:n}),a=await ex(e,void 0,void 0,s,i);Yo(a),ht.info(`Checked comments in ${Vr(performance.now()-Ui)}.`),process.exitCode=Xo(a)}).command("collapse <files..> [options]","Collapse MDAT placeholder comments.",t=>t.positional(...Kl).option(Bi).option(Ko).option(na).option(ji).option(ia).option(Un),async({config:t,files:e,name:r,output:n,prefix:i,print:o,verbose:s})=>{ht.verbose=s??!1,Zl({name:r,output:n,print:o});let a=Zo(t,{keywordPrefix:i}),u=await tx(e,void 0,void 0,a);for(let l of u)o?process.stdout.write(l.toString()):await un(l);Yo(u),ht.info(`Cleaned comments in ${Vr(performance.now()-Ui)}.`),process.exitCode=Xo(u)}).command("readme [command]","Work with MDAT comments in your readme.md.",t=>t.command(["$0 [files..] [options]","expand [files..] [options]"],"Expand MDAT comment placeholders in your readme.md using a collection of helpful built-in expansion rules.",e=>e.positional(...Yl).option(Bi).option(oa).option(Ko).option(na).option(Od).option(Dd).option(ji).option(ra).option(ia).option(Un),async({assets:e,config:r,files:n,meta:i,name:o,output:s,package:a,prefix:u,print:l,rules:c,verbose:f})=>{ht.verbose=f??!1,Zl({name:o,output:s,print:l});let p=Zo(r,{addMetaComment:i,assetsPath:e,keywordPrefix:u,packageFile:a}),d=await Wl(n,o,s,p,c);for(let y of d)l?process.stdout.write(y.toString()):await un(y);Yo(d);let{packageFile:m}=await Tr();ht.info(`Pulled package metadata from: ${Jo.default.blue(Jo.default.bold(m))}`),ht.info(`Expanded readme(s) in ${Vr(performance.now()-Ui)}.`),process.exitCode=Xo(d)}).command("check [files..] [options]","Validate MDAT placeholder comments in your readme.md.",e=>e.positional(...Yl).option(Bi).option(oa).option(Od).option(Dd).option(ji).option(ra).option(Un),async({assets:e,config:r,files:n,meta:i,package:o,prefix:s,rules:a,verbose:u})=>{ht.verbose=u??!1;let l=Zo(r,{addMetaComment:i,assetsPath:e,keywordPrefix:s,packageFile:o}),c=await aw(n,void 0,void 0,l,a);Yo(c);let{packageFile:f}=await Tr();ht.info(`Pulled package metadata from: ${Jo.default.blue(Jo.default.bold(f))}`),ht.info(`Checked readme(s) in ${Vr(performance.now()-Ui)}.`),process.exitCode=Xo(c)}).command("collapse [files..] [options]","Collapse MDAT placeholder comments in your readme.md.",e=>e.positional(...Yl).option(Ko).option(na).option(ia).option(Bi).option(ji).option(Un),async({config:e,files:r,name:n,output:i,prefix:o,print:s,verbose:a})=>{ht.verbose=a??!1,Zl({name:n,output:i,print:s});let u=Zo(e,{keywordPrefix:o}),l=await uw(r,void 0,void 0,u);for(let c of l)s?process.stdout.write(c.toString()):await un(c);Yo(l),ht.info(`Cleaned readme(s) in ${Vr(performance.now()-Ui)}.`),process.exitCode=Xo(l)}).command("init [options]","Interactively create a new readme.md file with sensible default MDAT comment placeholders.",e=>e.option(bw).option(Ew).option(Ko).option(Aw).option(ww).option(Cw).option(Un),async({compound:e,expand:r,interactive:n,output:i,overwrite:o,template:s,verbose:a})=>{if(ht.verbose=a??!1,n)await yw();else{let u=await Id({compound:e,expand:r,output:i,overwrite:o,template:s});ht.info(`Created readme at "${Jo.default.blue(u)}" in ${Vr(performance.now()-Ui)}.`)}process.exitCode=0}),()=>{ht.error("Root MDAT readme command should be unreachable.")}).help().alias("h","help").version(Bh).alias("v","version").wrap(process.stdout.isTTY?Math.min(120,kw.terminalWidth()):0).fail(!1).parse()}catch(t){t instanceof Error&&ht.error(t.message),process.exitCode=1}function Zl(t){t.print&&t.output&&ht.warn("Ignoring --output option because --print is set"),t.print&&t.name&&ht.warn("Ignoring --name option because --print is set")}function Zo(t,e){return[...Pa(t),e]}function Xo(t){return GL(t).reduce((n,i)=>n+i.errors.length,0)>0?1:0}
516
512
  /*! Bundled license information:
517
513
 
518
514
  yargs-parser/build/lib/string-utils.js:
519
- (**
520
- * @license
521
- * Copyright (c) 2016, Contributors
522
- * SPDX-License-Identifier: ISC
523
- *)
524
-
525
515
  yargs-parser/build/lib/tokenize-arg-string.js:
526
- (**
527
- * @license
528
- * Copyright (c) 2016, Contributors
529
- * SPDX-License-Identifier: ISC
530
- *)
531
-
532
516
  yargs-parser/build/lib/yargs-parser-types.js:
533
- (**
534
- * @license
535
- * Copyright (c) 2016, Contributors
536
- * SPDX-License-Identifier: ISC
537
- *)
538
-
539
517
  yargs-parser/build/lib/yargs-parser.js:
540
518
  (**
541
519
  * @license