1 var __create = Object.create;
2 var __defProp = Object.defineProperty;
3 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4 var __getOwnPropNames = Object.getOwnPropertyNames;
5 var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6 var __getProtoOf = Object.getPrototypeOf;
7 var __hasOwnProp = Object.prototype.hasOwnProperty;
8 var __propIsEnum = Object.prototype.propertyIsEnumerable;
9 var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10 var __spreadValues = (a, b) => {
11 for (var prop in b || (b = {}))
12 if (__hasOwnProp.call(b, prop))
13 __defNormalProp(a, prop, b[prop]);
14 if (__getOwnPropSymbols)
15 for (var prop of __getOwnPropSymbols(b)) {
16 if (__propIsEnum.call(b, prop))
17 __defNormalProp(a, prop, b[prop]);
21 var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
22 var __commonJS = (cb, mod) => function __require() {
23 return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
25 var __export = (target, all) => {
26 __markAsModule(target);
28 __defProp(target, name, { get: all[name], enumerable: true });
30 var __reExport = (target, module2, desc) => {
31 if (module2 && typeof module2 === "object" || typeof module2 === "function") {
32 for (let key of __getOwnPropNames(module2))
33 if (!__hasOwnProp.call(target, key) && key !== "default")
34 __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
38 var __toModule = (module2) => {
39 return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
42 // node_modules/deep-extend/lib/deep-extend.js
43 var require_deep_extend = __commonJS({
44 "node_modules/deep-extend/lib/deep-extend.js"(exports, module2) {
46 function isSpecificValue(val) {
47 return val instanceof Buffer || val instanceof Date || val instanceof RegExp ? true : false;
49 function cloneSpecificValue(val) {
50 if (val instanceof Buffer) {
51 var x = Buffer.alloc ? Buffer.alloc(val.length) : new Buffer(val.length);
54 } else if (val instanceof Date) {
55 return new Date(val.getTime());
56 } else if (val instanceof RegExp) {
57 return new RegExp(val);
59 throw new Error("Unexpected situation");
62 function deepCloneArray(arr) {
64 arr.forEach(function(item, index) {
65 if (typeof item === "object" && item !== null) {
66 if (Array.isArray(item)) {
67 clone[index] = deepCloneArray(item);
68 } else if (isSpecificValue(item)) {
69 clone[index] = cloneSpecificValue(item);
71 clone[index] = deepExtend({}, item);
79 function safeGetProperty(object, property) {
80 return property === "__proto__" ? void 0 : object[property];
82 var deepExtend = module2.exports = function() {
83 if (arguments.length < 1 || typeof arguments[0] !== "object") {
86 if (arguments.length < 2) {
89 var target = arguments[0];
90 var args = Array.prototype.slice.call(arguments, 1);
92 args.forEach(function(obj) {
93 if (typeof obj !== "object" || obj === null || Array.isArray(obj)) {
96 Object.keys(obj).forEach(function(key) {
97 src = safeGetProperty(target, key);
98 val = safeGetProperty(obj, key);
101 } else if (typeof val !== "object" || val === null) {
104 } else if (Array.isArray(val)) {
105 target[key] = deepCloneArray(val);
107 } else if (isSpecificValue(val)) {
108 target[key] = cloneSpecificValue(val);
110 } else if (typeof src !== "object" || src === null || Array.isArray(src)) {
111 target[key] = deepExtend({}, val);
114 target[key] = deepExtend(src, val);
124 // node_modules/entities/lib/maps/entities.json
125 var require_entities = __commonJS({
126 "node_modules/entities/lib/maps/entities.json"(exports, module2) {
127 module2.exports = { Aacute: "\xC1", aacute: "\xE1", Abreve: "\u0102", abreve: "\u0103", ac: "\u223E", acd: "\u223F", acE: "\u223E\u0333", Acirc: "\xC2", acirc: "\xE2", acute: "\xB4", Acy: "\u0410", acy: "\u0430", AElig: "\xC6", aelig: "\xE6", af: "\u2061", Afr: "\u{1D504}", afr: "\u{1D51E}", Agrave: "\xC0", agrave: "\xE0", alefsym: "\u2135", aleph: "\u2135", Alpha: "\u0391", alpha: "\u03B1", Amacr: "\u0100", amacr: "\u0101", amalg: "\u2A3F", amp: "&", AMP: "&", andand: "\u2A55", And: "\u2A53", and: "\u2227", andd: "\u2A5C", andslope: "\u2A58", andv: "\u2A5A", ang: "\u2220", ange: "\u29A4", angle: "\u2220", angmsdaa: "\u29A8", angmsdab: "\u29A9", angmsdac: "\u29AA", angmsdad: "\u29AB", angmsdae: "\u29AC", angmsdaf: "\u29AD", angmsdag: "\u29AE", angmsdah: "\u29AF", angmsd: "\u2221", angrt: "\u221F", angrtvb: "\u22BE", angrtvbd: "\u299D", angsph: "\u2222", angst: "\xC5", angzarr: "\u237C", Aogon: "\u0104", aogon: "\u0105", Aopf: "\u{1D538}", aopf: "\u{1D552}", apacir: "\u2A6F", ap: "\u2248", apE: "\u2A70", ape: "\u224A", apid: "\u224B", apos: "'", ApplyFunction: "\u2061", approx: "\u2248", approxeq: "\u224A", Aring: "\xC5", aring: "\xE5", Ascr: "\u{1D49C}", ascr: "\u{1D4B6}", Assign: "\u2254", ast: "*", asymp: "\u2248", asympeq: "\u224D", Atilde: "\xC3", atilde: "\xE3", Auml: "\xC4", auml: "\xE4", awconint: "\u2233", awint: "\u2A11", backcong: "\u224C", backepsilon: "\u03F6", backprime: "\u2035", backsim: "\u223D", backsimeq: "\u22CD", Backslash: "\u2216", Barv: "\u2AE7", barvee: "\u22BD", barwed: "\u2305", Barwed: "\u2306", barwedge: "\u2305", bbrk: "\u23B5", bbrktbrk: "\u23B6", bcong: "\u224C", Bcy: "\u0411", bcy: "\u0431", bdquo: "\u201E", becaus: "\u2235", because: "\u2235", Because: "\u2235", bemptyv: "\u29B0", bepsi: "\u03F6", bernou: "\u212C", Bernoullis: "\u212C", Beta: "\u0392", beta: "\u03B2", beth: "\u2136", between: "\u226C", Bfr: "\u{1D505}", 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: "\u2AED", bnot: "\u2310", Bopf: "\u{1D539}", bopf: "\u{1D553}", bot: "\u22A5", bottom: "\u22A5", bowtie: "\u22C8", boxbox: "\u29C9", boxdl: "\u2510", boxdL: "\u2555", boxDl: "\u2556", boxDL: "\u2557", boxdr: "\u250C", boxdR: "\u2552", boxDr: "\u2553", boxDR: "\u2554", boxh: "\u2500", boxH: "\u2550", boxhd: "\u252C", boxHd: "\u2564", boxhD: "\u2565", boxHD: "\u2566", boxhu: "\u2534", boxHu: "\u2567", boxhU: "\u2568", boxHU: "\u2569", boxminus: "\u229F", boxplus: "\u229E", boxtimes: "\u22A0", boxul: "\u2518", boxuL: "\u255B", boxUl: "\u255C", boxUL: "\u255D", boxur: "\u2514", boxuR: "\u2558", boxUr: "\u2559", boxUR: "\u255A", boxv: "\u2502", boxV: "\u2551", boxvh: "\u253C", boxvH: "\u256A", boxVh: "\u256B", boxVH: "\u256C", boxvl: "\u2524", boxvL: "\u2561", boxVl: "\u2562", boxVL: "\u2563", boxvr: "\u251C", boxvR: "\u255E", boxVr: "\u255F", boxVR: "\u2560", bprime: "\u2035", breve: "\u02D8", Breve: "\u02D8", brvbar: "\xA6", bscr: "\u{1D4B7}", Bscr: "\u212C", bsemi: "\u204F", bsim: "\u223D", bsime: "\u22CD", bsolb: "\u29C5", bsol: "\\", bsolhsub: "\u27C8", bull: "\u2022", bullet: "\u2022", bump: "\u224E", bumpE: "\u2AAE", bumpe: "\u224F", Bumpeq: "\u224E", bumpeq: "\u224F", Cacute: "\u0106", cacute: "\u0107", capand: "\u2A44", capbrcup: "\u2A49", capcap: "\u2A4B", cap: "\u2229", Cap: "\u22D2", capcup: "\u2A47", capdot: "\u2A40", CapitalDifferentialD: "\u2145", caps: "\u2229\uFE00", caret: "\u2041", caron: "\u02C7", Cayleys: "\u212D", ccaps: "\u2A4D", Ccaron: "\u010C", ccaron: "\u010D", Ccedil: "\xC7", ccedil: "\xE7", Ccirc: "\u0108", ccirc: "\u0109", Cconint: "\u2230", ccups: "\u2A4C", ccupssm: "\u2A50", Cdot: "\u010A", cdot: "\u010B", cedil: "\xB8", Cedilla: "\xB8", cemptyv: "\u29B2", cent: "\xA2", centerdot: "\xB7", CenterDot: "\xB7", cfr: "\u{1D520}", Cfr: "\u212D", CHcy: "\u0427", chcy: "\u0447", check: "\u2713", checkmark: "\u2713", Chi: "\u03A7", chi: "\u03C7", circ: "\u02C6", circeq: "\u2257", circlearrowleft: "\u21BA", circlearrowright: "\u21BB", circledast: "\u229B", circledcirc: "\u229A", circleddash: "\u229D", CircleDot: "\u2299", circledR: "\xAE", circledS: "\u24C8", CircleMinus: "\u2296", CirclePlus: "\u2295", CircleTimes: "\u2297", cir: "\u25CB", cirE: "\u29C3", cire: "\u2257", cirfnint: "\u2A10", cirmid: "\u2AEF", cirscir: "\u29C2", ClockwiseContourIntegral: "\u2232", CloseCurlyDoubleQuote: "\u201D", CloseCurlyQuote: "\u2019", clubs: "\u2663", clubsuit: "\u2663", colon: ":", Colon: "\u2237", Colone: "\u2A74", colone: "\u2254", coloneq: "\u2254", comma: ",", commat: "@", comp: "\u2201", compfn: "\u2218", complement: "\u2201", complexes: "\u2102", cong: "\u2245", congdot: "\u2A6D", Congruent: "\u2261", conint: "\u222E", Conint: "\u222F", ContourIntegral: "\u222E", copf: "\u{1D554}", Copf: "\u2102", coprod: "\u2210", Coproduct: "\u2210", copy: "\xA9", COPY: "\xA9", copysr: "\u2117", CounterClockwiseContourIntegral: "\u2233", crarr: "\u21B5", cross: "\u2717", Cross: "\u2A2F", Cscr: "\u{1D49E}", 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", cupbrcap: "\u2A48", cupcap: "\u2A46", CupCap: "\u224D", cup: "\u222A", Cup: "\u22D3", 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", dagger: "\u2020", Dagger: "\u2021", daleth: "\u2138", darr: "\u2193", Darr: "\u21A1", dArr: "\u21D3", dash: "\u2010", Dashv: "\u2AE4", dashv: "\u22A3", dbkarow: "\u290F", dblac: "\u02DD", Dcaron: "\u010E", dcaron: "\u010F", Dcy: "\u0414", dcy: "\u0434", ddagger: "\u2021", ddarr: "\u21CA", DD: "\u2145", dd: "\u2146", DDotrahd: "\u2911", ddotseq: "\u2A77", deg: "\xB0", Del: "\u2207", Delta: "\u0394", delta: "\u03B4", demptyv: "\u29B1", dfisht: "\u297F", Dfr: "\u{1D507}", dfr: "\u{1D521}", dHar: "\u2965", dharl: "\u21C3", dharr: "\u21C2", DiacriticalAcute: "\xB4", DiacriticalDot: "\u02D9", DiacriticalDoubleAcute: "\u02DD", DiacriticalGrave: "`", DiacriticalTilde: "\u02DC", diam: "\u22C4", diamond: "\u22C4", Diamond: "\u22C4", diamondsuit: "\u2666", diams: "\u2666", die: "\xA8", DifferentialD: "\u2146", digamma: "\u03DD", disin: "\u22F2", div: "\xF7", divide: "\xF7", divideontimes: "\u22C7", divonx: "\u22C7", DJcy: "\u0402", djcy: "\u0452", dlcorn: "\u231E", dlcrop: "\u230D", dollar: "$", Dopf: "\u{1D53B}", dopf: "\u{1D555}", Dot: "\xA8", dot: "\u02D9", DotDot: "\u20DC", doteq: "\u2250", doteqdot: "\u2251", DotEqual: "\u2250", dotminus: "\u2238", dotplus: "\u2214", dotsquare: "\u22A1", doublebarwedge: "\u2306", 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", DownArrowBar: "\u2913", downarrow: "\u2193", DownArrow: "\u2193", Downarrow: "\u21D3", DownArrowUpArrow: "\u21F5", DownBreve: "\u0311", downdownarrows: "\u21CA", downharpoonleft: "\u21C3", downharpoonright: "\u21C2", DownLeftRightVector: "\u2950", DownLeftTeeVector: "\u295E", DownLeftVectorBar: "\u2956", DownLeftVector: "\u21BD", DownRightTeeVector: "\u295F", DownRightVectorBar: "\u2957", DownRightVector: "\u21C1", DownTeeArrow: "\u21A7", DownTee: "\u22A4", drbkarow: "\u2910", drcorn: "\u231F", drcrop: "\u230C", Dscr: "\u{1D49F}", dscr: "\u{1D4B9}", DScy: "\u0405", dscy: "\u0455", dsol: "\u29F6", Dstrok: "\u0110", dstrok: "\u0111", dtdot: "\u22F1", dtri: "\u25BF", dtrif: "\u25BE", duarr: "\u21F5", duhar: "\u296F", dwangle: "\u29A6", DZcy: "\u040F", dzcy: "\u045F", dzigrarr: "\u27FF", Eacute: "\xC9", eacute: "\xE9", easter: "\u2A6E", Ecaron: "\u011A", ecaron: "\u011B", Ecirc: "\xCA", ecirc: "\xEA", ecir: "\u2256", ecolon: "\u2255", Ecy: "\u042D", ecy: "\u044D", eDDot: "\u2A77", Edot: "\u0116", edot: "\u0117", eDot: "\u2251", ee: "\u2147", efDot: "\u2252", Efr: "\u{1D508}", efr: "\u{1D522}", eg: "\u2A9A", Egrave: "\xC8", egrave: "\xE8", egs: "\u2A96", egsdot: "\u2A98", el: "\u2A99", Element: "\u2208", elinters: "\u23E7", ell: "\u2113", els: "\u2A95", elsdot: "\u2A97", Emacr: "\u0112", emacr: "\u0113", empty: "\u2205", emptyset: "\u2205", EmptySmallSquare: "\u25FB", emptyv: "\u2205", EmptyVerySmallSquare: "\u25AB", emsp13: "\u2004", emsp14: "\u2005", emsp: "\u2003", ENG: "\u014A", eng: "\u014B", ensp: "\u2002", Eogon: "\u0118", eogon: "\u0119", Eopf: "\u{1D53C}", eopf: "\u{1D556}", epar: "\u22D5", eparsl: "\u29E3", eplus: "\u2A71", epsi: "\u03B5", Epsilon: "\u0395", epsilon: "\u03B5", epsiv: "\u03F5", eqcirc: "\u2256", eqcolon: "\u2255", eqsim: "\u2242", eqslantgtr: "\u2A96", eqslantless: "\u2A95", Equal: "\u2A75", equals: "=", EqualTilde: "\u2242", equest: "\u225F", Equilibrium: "\u21CC", equiv: "\u2261", equivDD: "\u2A78", eqvparsl: "\u29E5", erarr: "\u2971", erDot: "\u2253", escr: "\u212F", Escr: "\u2130", esdot: "\u2250", Esim: "\u2A73", esim: "\u2242", Eta: "\u0397", eta: "\u03B7", ETH: "\xD0", eth: "\xF0", Euml: "\xCB", euml: "\xEB", euro: "\u20AC", excl: "!", exist: "\u2203", Exists: "\u2203", expectation: "\u2130", exponentiale: "\u2147", ExponentialE: "\u2147", fallingdotseq: "\u2252", Fcy: "\u0424", fcy: "\u0444", female: "\u2640", ffilig: "\uFB03", fflig: "\uFB00", ffllig: "\uFB04", Ffr: "\u{1D509}", ffr: "\u{1D523}", filig: "\uFB01", FilledSmallSquare: "\u25FC", FilledVerySmallSquare: "\u25AA", fjlig: "fj", flat: "\u266D", fllig: "\uFB02", fltns: "\u25B1", fnof: "\u0192", Fopf: "\u{1D53D}", fopf: "\u{1D557}", forall: "\u2200", ForAll: "\u2200", fork: "\u22D4", forkv: "\u2AD9", Fouriertrf: "\u2131", 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}", Fscr: "\u2131", gacute: "\u01F5", Gamma: "\u0393", gamma: "\u03B3", Gammad: "\u03DC", gammad: "\u03DD", gap: "\u2A86", Gbreve: "\u011E", gbreve: "\u011F", Gcedil: "\u0122", Gcirc: "\u011C", gcirc: "\u011D", Gcy: "\u0413", gcy: "\u0433", Gdot: "\u0120", gdot: "\u0121", ge: "\u2265", gE: "\u2267", gEl: "\u2A8C", gel: "\u22DB", geq: "\u2265", geqq: "\u2267", geqslant: "\u2A7E", gescc: "\u2AA9", ges: "\u2A7E", gesdot: "\u2A80", gesdoto: "\u2A82", gesdotol: "\u2A84", gesl: "\u22DB\uFE00", gesles: "\u2A94", Gfr: "\u{1D50A}", gfr: "\u{1D524}", gg: "\u226B", Gg: "\u22D9", ggg: "\u22D9", gimel: "\u2137", GJcy: "\u0403", gjcy: "\u0453", gla: "\u2AA5", gl: "\u2277", glE: "\u2A92", glj: "\u2AA4", gnap: "\u2A8A", gnapprox: "\u2A8A", gne: "\u2A88", gnE: "\u2269", gneq: "\u2A88", gneqq: "\u2269", gnsim: "\u22E7", Gopf: "\u{1D53E}", gopf: "\u{1D558}", grave: "`", GreaterEqual: "\u2265", GreaterEqualLess: "\u22DB", GreaterFullEqual: "\u2267", GreaterGreater: "\u2AA2", GreaterLess: "\u2277", GreaterSlantEqual: "\u2A7E", GreaterTilde: "\u2273", Gscr: "\u{1D4A2}", gscr: "\u210A", gsim: "\u2273", gsime: "\u2A8E", gsiml: "\u2A90", gtcc: "\u2AA7", gtcir: "\u2A7A", gt: ">", GT: ">", Gt: "\u226B", 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", Hacek: "\u02C7", hairsp: "\u200A", half: "\xBD", hamilt: "\u210B", HARDcy: "\u042A", hardcy: "\u044A", harrcir: "\u2948", harr: "\u2194", hArr: "\u21D4", harrw: "\u21AD", Hat: "^", hbar: "\u210F", Hcirc: "\u0124", hcirc: "\u0125", hearts: "\u2665", heartsuit: "\u2665", hellip: "\u2026", hercon: "\u22B9", hfr: "\u{1D525}", Hfr: "\u210C", HilbertSpace: "\u210B", hksearow: "\u2925", hkswarow: "\u2926", hoarr: "\u21FF", homtht: "\u223B", hookleftarrow: "\u21A9", hookrightarrow: "\u21AA", hopf: "\u{1D559}", Hopf: "\u210D", horbar: "\u2015", HorizontalLine: "\u2500", hscr: "\u{1D4BD}", Hscr: "\u210B", hslash: "\u210F", Hstrok: "\u0126", hstrok: "\u0127", HumpDownHump: "\u224E", HumpEqual: "\u224F", hybull: "\u2043", hyphen: "\u2010", Iacute: "\xCD", iacute: "\xED", ic: "\u2063", Icirc: "\xCE", icirc: "\xEE", Icy: "\u0418", icy: "\u0438", Idot: "\u0130", IEcy: "\u0415", iecy: "\u0435", iexcl: "\xA1", iff: "\u21D4", ifr: "\u{1D526}", Ifr: "\u2111", Igrave: "\xCC", igrave: "\xEC", ii: "\u2148", iiiint: "\u2A0C", iiint: "\u222D", iinfin: "\u29DC", iiota: "\u2129", IJlig: "\u0132", ijlig: "\u0133", Imacr: "\u012A", imacr: "\u012B", image: "\u2111", ImaginaryI: "\u2148", imagline: "\u2110", imagpart: "\u2111", imath: "\u0131", Im: "\u2111", imof: "\u22B7", imped: "\u01B5", Implies: "\u21D2", incare: "\u2105", in: "\u2208", infin: "\u221E", infintie: "\u29DD", inodot: "\u0131", intcal: "\u22BA", int: "\u222B", Int: "\u222C", integers: "\u2124", Integral: "\u222B", intercal: "\u22BA", Intersection: "\u22C2", intlarhk: "\u2A17", intprod: "\u2A3C", InvisibleComma: "\u2063", InvisibleTimes: "\u2062", IOcy: "\u0401", iocy: "\u0451", Iogon: "\u012E", iogon: "\u012F", Iopf: "\u{1D540}", iopf: "\u{1D55A}", Iota: "\u0399", iota: "\u03B9", iprod: "\u2A3C", iquest: "\xBF", iscr: "\u{1D4BE}", Iscr: "\u2110", isin: "\u2208", isindot: "\u22F5", isinE: "\u22F9", isins: "\u22F4", isinsv: "\u22F3", isinv: "\u2208", it: "\u2062", Itilde: "\u0128", itilde: "\u0129", Iukcy: "\u0406", iukcy: "\u0456", Iuml: "\xCF", iuml: "\xEF", Jcirc: "\u0134", jcirc: "\u0135", Jcy: "\u0419", jcy: "\u0439", Jfr: "\u{1D50D}", jfr: "\u{1D527}", jmath: "\u0237", Jopf: "\u{1D541}", jopf: "\u{1D55B}", Jscr: "\u{1D4A5}", jscr: "\u{1D4BF}", Jsercy: "\u0408", jsercy: "\u0458", Jukcy: "\u0404", jukcy: "\u0454", Kappa: "\u039A", kappa: "\u03BA", kappav: "\u03F0", Kcedil: "\u0136", kcedil: "\u0137", Kcy: "\u041A", kcy: "\u043A", Kfr: "\u{1D50E}", kfr: "\u{1D528}", kgreen: "\u0138", KHcy: "\u0425", khcy: "\u0445", KJcy: "\u040C", kjcy: "\u045C", Kopf: "\u{1D542}", kopf: "\u{1D55C}", Kscr: "\u{1D4A6}", kscr: "\u{1D4C0}", lAarr: "\u21DA", Lacute: "\u0139", lacute: "\u013A", laemptyv: "\u29B4", lagran: "\u2112", Lambda: "\u039B", lambda: "\u03BB", lang: "\u27E8", Lang: "\u27EA", langd: "\u2991", langle: "\u27E8", lap: "\u2A85", Laplacetrf: "\u2112", laquo: "\xAB", larrb: "\u21E4", larrbfs: "\u291F", larr: "\u2190", Larr: "\u219E", lArr: "\u21D0", larrfs: "\u291D", larrhk: "\u21A9", larrlp: "\u21AB", larrpl: "\u2939", larrsim: "\u2973", larrtl: "\u21A2", latail: "\u2919", lAtail: "\u291B", lat: "\u2AAB", late: "\u2AAD", lates: "\u2AAD\uFE00", lbarr: "\u290C", lBarr: "\u290E", lbbrk: "\u2772", lbrace: "{", lbrack: "[", lbrke: "\u298B", lbrksld: "\u298F", lbrkslu: "\u298D", Lcaron: "\u013D", lcaron: "\u013E", Lcedil: "\u013B", lcedil: "\u013C", lceil: "\u2308", lcub: "{", Lcy: "\u041B", lcy: "\u043B", ldca: "\u2936", ldquo: "\u201C", ldquor: "\u201E", ldrdhar: "\u2967", ldrushar: "\u294B", ldsh: "\u21B2", le: "\u2264", lE: "\u2266", LeftAngleBracket: "\u27E8", LeftArrowBar: "\u21E4", leftarrow: "\u2190", LeftArrow: "\u2190", Leftarrow: "\u21D0", LeftArrowRightArrow: "\u21C6", leftarrowtail: "\u21A2", LeftCeiling: "\u2308", LeftDoubleBracket: "\u27E6", LeftDownTeeVector: "\u2961", LeftDownVectorBar: "\u2959", LeftDownVector: "\u21C3", LeftFloor: "\u230A", leftharpoondown: "\u21BD", leftharpoonup: "\u21BC", leftleftarrows: "\u21C7", leftrightarrow: "\u2194", LeftRightArrow: "\u2194", Leftrightarrow: "\u21D4", leftrightarrows: "\u21C6", leftrightharpoons: "\u21CB", leftrightsquigarrow: "\u21AD", LeftRightVector: "\u294E", LeftTeeArrow: "\u21A4", LeftTee: "\u22A3", LeftTeeVector: "\u295A", leftthreetimes: "\u22CB", LeftTriangleBar: "\u29CF", LeftTriangle: "\u22B2", LeftTriangleEqual: "\u22B4", LeftUpDownVector: "\u2951", LeftUpTeeVector: "\u2960", LeftUpVectorBar: "\u2958", LeftUpVector: "\u21BF", LeftVectorBar: "\u2952", LeftVector: "\u21BC", lEg: "\u2A8B", leg: "\u22DA", leq: "\u2264", leqq: "\u2266", leqslant: "\u2A7D", lescc: "\u2AA8", les: "\u2A7D", lesdot: "\u2A7F", lesdoto: "\u2A81", lesdotor: "\u2A83", lesg: "\u22DA\uFE00", lesges: "\u2A93", lessapprox: "\u2A85", lessdot: "\u22D6", lesseqgtr: "\u22DA", lesseqqgtr: "\u2A8B", LessEqualGreater: "\u22DA", LessFullEqual: "\u2266", LessGreater: "\u2276", lessgtr: "\u2276", LessLess: "\u2AA1", lesssim: "\u2272", LessSlantEqual: "\u2A7D", LessTilde: "\u2272", lfisht: "\u297C", lfloor: "\u230A", Lfr: "\u{1D50F}", lfr: "\u{1D529}", lg: "\u2276", lgE: "\u2A91", lHar: "\u2962", lhard: "\u21BD", lharu: "\u21BC", lharul: "\u296A", lhblk: "\u2584", LJcy: "\u0409", ljcy: "\u0459", llarr: "\u21C7", ll: "\u226A", Ll: "\u22D8", llcorner: "\u231E", Lleftarrow: "\u21DA", llhard: "\u296B", lltri: "\u25FA", Lmidot: "\u013F", lmidot: "\u0140", lmoustache: "\u23B0", lmoust: "\u23B0", lnap: "\u2A89", lnapprox: "\u2A89", lne: "\u2A87", lnE: "\u2268", lneq: "\u2A87", lneqq: "\u2268", lnsim: "\u22E6", loang: "\u27EC", loarr: "\u21FD", lobrk: "\u27E6", longleftarrow: "\u27F5", LongLeftArrow: "\u27F5", Longleftarrow: "\u27F8", longleftrightarrow: "\u27F7", LongLeftRightArrow: "\u27F7", Longleftrightarrow: "\u27FA", longmapsto: "\u27FC", longrightarrow: "\u27F6", LongRightArrow: "\u27F6", Longrightarrow: "\u27F9", looparrowleft: "\u21AB", looparrowright: "\u21AC", lopar: "\u2985", Lopf: "\u{1D543}", lopf: "\u{1D55D}", loplus: "\u2A2D", lotimes: "\u2A34", lowast: "\u2217", lowbar: "_", LowerLeftArrow: "\u2199", LowerRightArrow: "\u2198", 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}", Lscr: "\u2112", lsh: "\u21B0", Lsh: "\u21B0", lsim: "\u2272", lsime: "\u2A8D", lsimg: "\u2A8F", lsqb: "[", lsquo: "\u2018", lsquor: "\u201A", Lstrok: "\u0141", lstrok: "\u0142", ltcc: "\u2AA6", ltcir: "\u2A79", lt: "<", LT: "<", Lt: "\u226A", ltdot: "\u22D6", lthree: "\u22CB", ltimes: "\u22C9", ltlarr: "\u2976", ltquest: "\u2A7B", ltri: "\u25C3", ltrie: "\u22B4", ltrif: "\u25C2", ltrPar: "\u2996", lurdshar: "\u294A", luruhar: "\u2966", lvertneqq: "\u2268\uFE00", lvnE: "\u2268\uFE00", macr: "\xAF", male: "\u2642", malt: "\u2720", maltese: "\u2720", Map: "\u2905", map: "\u21A6", mapsto: "\u21A6", mapstodown: "\u21A7", mapstoleft: "\u21A4", mapstoup: "\u21A5", marker: "\u25AE", mcomma: "\u2A29", Mcy: "\u041C", mcy: "\u043C", mdash: "\u2014", mDDot: "\u223A", measuredangle: "\u2221", MediumSpace: "\u205F", Mellintrf: "\u2133", Mfr: "\u{1D510}", mfr: "\u{1D52A}", mho: "\u2127", micro: "\xB5", midast: "*", midcir: "\u2AF0", mid: "\u2223", middot: "\xB7", minusb: "\u229F", minus: "\u2212", minusd: "\u2238", minusdu: "\u2A2A", MinusPlus: "\u2213", mlcp: "\u2ADB", mldr: "\u2026", mnplus: "\u2213", models: "\u22A7", Mopf: "\u{1D544}", mopf: "\u{1D55E}", mp: "\u2213", mscr: "\u{1D4C2}", Mscr: "\u2133", mstpos: "\u223E", Mu: "\u039C", mu: "\u03BC", multimap: "\u22B8", mumap: "\u22B8", nabla: "\u2207", Nacute: "\u0143", nacute: "\u0144", nang: "\u2220\u20D2", nap: "\u2249", napE: "\u2A70\u0338", napid: "\u224B\u0338", napos: "\u0149", napprox: "\u2249", natural: "\u266E", naturals: "\u2115", natur: "\u266E", nbsp: "\xA0", nbump: "\u224E\u0338", nbumpe: "\u224F\u0338", ncap: "\u2A43", Ncaron: "\u0147", ncaron: "\u0148", Ncedil: "\u0145", ncedil: "\u0146", ncong: "\u2247", ncongdot: "\u2A6D\u0338", ncup: "\u2A42", Ncy: "\u041D", ncy: "\u043D", ndash: "\u2013", nearhk: "\u2924", nearr: "\u2197", neArr: "\u21D7", nearrow: "\u2197", ne: "\u2260", nedot: "\u2250\u0338", NegativeMediumSpace: "\u200B", NegativeThickSpace: "\u200B", NegativeThinSpace: "\u200B", NegativeVeryThinSpace: "\u200B", nequiv: "\u2262", nesear: "\u2928", nesim: "\u2242\u0338", NestedGreaterGreater: "\u226B", NestedLessLess: "\u226A", NewLine: "\n", nexist: "\u2204", nexists: "\u2204", Nfr: "\u{1D511}", nfr: "\u{1D52B}", ngE: "\u2267\u0338", nge: "\u2271", ngeq: "\u2271", ngeqq: "\u2267\u0338", ngeqslant: "\u2A7E\u0338", nges: "\u2A7E\u0338", nGg: "\u22D9\u0338", ngsim: "\u2275", nGt: "\u226B\u20D2", ngt: "\u226F", ngtr: "\u226F", nGtv: "\u226B\u0338", nharr: "\u21AE", nhArr: "\u21CE", nhpar: "\u2AF2", ni: "\u220B", nis: "\u22FC", nisd: "\u22FA", niv: "\u220B", NJcy: "\u040A", njcy: "\u045A", nlarr: "\u219A", nlArr: "\u21CD", nldr: "\u2025", nlE: "\u2266\u0338", nle: "\u2270", nleftarrow: "\u219A", nLeftarrow: "\u21CD", nleftrightarrow: "\u21AE", nLeftrightarrow: "\u21CE", nleq: "\u2270", nleqq: "\u2266\u0338", nleqslant: "\u2A7D\u0338", nles: "\u2A7D\u0338", nless: "\u226E", nLl: "\u22D8\u0338", nlsim: "\u2274", nLt: "\u226A\u20D2", nlt: "\u226E", nltri: "\u22EA", nltrie: "\u22EC", nLtv: "\u226A\u0338", nmid: "\u2224", NoBreak: "\u2060", NonBreakingSpace: "\xA0", nopf: "\u{1D55F}", Nopf: "\u2115", Not: "\u2AEC", not: "\xAC", 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", notin: "\u2209", notindot: "\u22F5\u0338", notinE: "\u22F9\u0338", notinva: "\u2209", notinvb: "\u22F7", notinvc: "\u22F6", NotLeftTriangleBar: "\u29CF\u0338", NotLeftTriangle: "\u22EA", NotLeftTriangleEqual: "\u22EC", NotLess: "\u226E", NotLessEqual: "\u2270", NotLessGreater: "\u2278", NotLessLess: "\u226A\u0338", NotLessSlantEqual: "\u2A7D\u0338", NotLessTilde: "\u2274", NotNestedGreaterGreater: "\u2AA2\u0338", NotNestedLessLess: "\u2AA1\u0338", notni: "\u220C", notniva: "\u220C", notnivb: "\u22FE", notnivc: "\u22FD", NotPrecedes: "\u2280", NotPrecedesEqual: "\u2AAF\u0338", NotPrecedesSlantEqual: "\u22E0", NotReverseElement: "\u220C", NotRightTriangleBar: "\u29D0\u0338", NotRightTriangle: "\u22EB", 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", nparallel: "\u2226", npar: "\u2226", nparsl: "\u2AFD\u20E5", npart: "\u2202\u0338", npolint: "\u2A14", npr: "\u2280", nprcue: "\u22E0", nprec: "\u2280", npreceq: "\u2AAF\u0338", npre: "\u2AAF\u0338", nrarrc: "\u2933\u0338", nrarr: "\u219B", nrArr: "\u21CF", nrarrw: "\u219D\u0338", nrightarrow: "\u219B", nRightarrow: "\u21CF", nrtri: "\u22EB", nrtrie: "\u22ED", nsc: "\u2281", nsccue: "\u22E1", nsce: "\u2AB0\u0338", Nscr: "\u{1D4A9}", 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: "\xD1", ntilde: "\xF1", ntlg: "\u2278", ntriangleleft: "\u22EA", ntrianglelefteq: "\u22EC", ntriangleright: "\u22EB", ntrianglerighteq: "\u22ED", Nu: "\u039D", nu: "\u03BD", num: "#", numero: "\u2116", numsp: "\u2007", nvap: "\u224D\u20D2", nvdash: "\u22AC", nvDash: "\u22AD", nVdash: "\u22AE", nVDash: "\u22AF", nvge: "\u2265\u20D2", nvgt: ">\u20D2", nvHarr: "\u2904", nvinfin: "\u29DE", nvlArr: "\u2902", nvle: "\u2264\u20D2", nvlt: "<\u20D2", nvltrie: "\u22B4\u20D2", nvrArr: "\u2903", nvrtrie: "\u22B5\u20D2", nvsim: "\u223C\u20D2", nwarhk: "\u2923", nwarr: "\u2196", nwArr: "\u21D6", nwarrow: "\u2196", nwnear: "\u2927", Oacute: "\xD3", oacute: "\xF3", oast: "\u229B", Ocirc: "\xD4", ocirc: "\xF4", ocir: "\u229A", Ocy: "\u041E", ocy: "\u043E", odash: "\u229D", Odblac: "\u0150", odblac: "\u0151", odiv: "\u2A38", odot: "\u2299", odsold: "\u29BC", OElig: "\u0152", oelig: "\u0153", ofcir: "\u29BF", Ofr: "\u{1D512}", ofr: "\u{1D52C}", ogon: "\u02DB", Ograve: "\xD2", ograve: "\xF2", ogt: "\u29C1", ohbar: "\u29B5", ohm: "\u03A9", oint: "\u222E", olarr: "\u21BA", olcir: "\u29BE", olcross: "\u29BB", oline: "\u203E", olt: "\u29C0", Omacr: "\u014C", omacr: "\u014D", Omega: "\u03A9", omega: "\u03C9", Omicron: "\u039F", omicron: "\u03BF", omid: "\u29B6", ominus: "\u2296", Oopf: "\u{1D546}", oopf: "\u{1D560}", opar: "\u29B7", OpenCurlyDoubleQuote: "\u201C", OpenCurlyQuote: "\u2018", operp: "\u29B9", oplus: "\u2295", orarr: "\u21BB", Or: "\u2A54", or: "\u2228", ord: "\u2A5D", order: "\u2134", orderof: "\u2134", ordf: "\xAA", ordm: "\xBA", origof: "\u22B6", oror: "\u2A56", orslope: "\u2A57", orv: "\u2A5B", oS: "\u24C8", Oscr: "\u{1D4AA}", oscr: "\u2134", Oslash: "\xD8", oslash: "\xF8", osol: "\u2298", Otilde: "\xD5", otilde: "\xF5", otimesas: "\u2A36", Otimes: "\u2A37", otimes: "\u2297", Ouml: "\xD6", ouml: "\xF6", ovbar: "\u233D", OverBar: "\u203E", OverBrace: "\u23DE", OverBracket: "\u23B4", OverParenthesis: "\u23DC", para: "\xB6", parallel: "\u2225", par: "\u2225", parsim: "\u2AF3", parsl: "\u2AFD", part: "\u2202", PartialD: "\u2202", Pcy: "\u041F", pcy: "\u043F", percnt: "%", period: ".", permil: "\u2030", perp: "\u22A5", pertenk: "\u2031", Pfr: "\u{1D513}", pfr: "\u{1D52D}", Phi: "\u03A6", phi: "\u03C6", phiv: "\u03D5", phmmat: "\u2133", phone: "\u260E", Pi: "\u03A0", pi: "\u03C0", pitchfork: "\u22D4", piv: "\u03D6", planck: "\u210F", planckh: "\u210E", plankv: "\u210F", plusacir: "\u2A23", plusb: "\u229E", pluscir: "\u2A22", plus: "+", plusdo: "\u2214", plusdu: "\u2A25", pluse: "\u2A72", PlusMinus: "\xB1", plusmn: "\xB1", plussim: "\u2A26", plustwo: "\u2A27", pm: "\xB1", Poincareplane: "\u210C", pointint: "\u2A15", popf: "\u{1D561}", Popf: "\u2119", pound: "\xA3", prap: "\u2AB7", Pr: "\u2ABB", pr: "\u227A", prcue: "\u227C", precapprox: "\u2AB7", prec: "\u227A", preccurlyeq: "\u227C", Precedes: "\u227A", PrecedesEqual: "\u2AAF", PrecedesSlantEqual: "\u227C", PrecedesTilde: "\u227E", preceq: "\u2AAF", precnapprox: "\u2AB9", precneqq: "\u2AB5", precnsim: "\u22E8", pre: "\u2AAF", prE: "\u2AB3", precsim: "\u227E", prime: "\u2032", Prime: "\u2033", primes: "\u2119", prnap: "\u2AB9", prnE: "\u2AB5", prnsim: "\u22E8", prod: "\u220F", Product: "\u220F", profalar: "\u232E", profline: "\u2312", profsurf: "\u2313", prop: "\u221D", Proportional: "\u221D", Proportion: "\u2237", propto: "\u221D", prsim: "\u227E", prurel: "\u22B0", Pscr: "\u{1D4AB}", pscr: "\u{1D4C5}", Psi: "\u03A8", psi: "\u03C8", puncsp: "\u2008", Qfr: "\u{1D514}", qfr: "\u{1D52E}", qint: "\u2A0C", qopf: "\u{1D562}", Qopf: "\u211A", qprime: "\u2057", Qscr: "\u{1D4AC}", qscr: "\u{1D4C6}", quaternions: "\u210D", quatint: "\u2A16", quest: "?", questeq: "\u225F", quot: '"', QUOT: '"', rAarr: "\u21DB", race: "\u223D\u0331", Racute: "\u0154", racute: "\u0155", radic: "\u221A", raemptyv: "\u29B3", rang: "\u27E9", Rang: "\u27EB", rangd: "\u2992", range: "\u29A5", rangle: "\u27E9", raquo: "\xBB", rarrap: "\u2975", rarrb: "\u21E5", rarrbfs: "\u2920", rarrc: "\u2933", rarr: "\u2192", Rarr: "\u21A0", rArr: "\u21D2", rarrfs: "\u291E", rarrhk: "\u21AA", rarrlp: "\u21AC", rarrpl: "\u2945", rarrsim: "\u2974", Rarrtl: "\u2916", rarrtl: "\u21A3", rarrw: "\u219D", ratail: "\u291A", rAtail: "\u291C", ratio: "\u2236", rationals: "\u211A", rbarr: "\u290D", rBarr: "\u290F", RBarr: "\u2910", rbbrk: "\u2773", rbrace: "}", rbrack: "]", rbrke: "\u298C", rbrksld: "\u298E", rbrkslu: "\u2990", Rcaron: "\u0158", rcaron: "\u0159", Rcedil: "\u0156", rcedil: "\u0157", rceil: "\u2309", rcub: "}", Rcy: "\u0420", rcy: "\u0440", rdca: "\u2937", rdldhar: "\u2969", rdquo: "\u201D", rdquor: "\u201D", rdsh: "\u21B3", real: "\u211C", realine: "\u211B", realpart: "\u211C", reals: "\u211D", Re: "\u211C", rect: "\u25AD", reg: "\xAE", REG: "\xAE", ReverseElement: "\u220B", ReverseEquilibrium: "\u21CB", ReverseUpEquilibrium: "\u296F", rfisht: "\u297D", rfloor: "\u230B", rfr: "\u{1D52F}", Rfr: "\u211C", rHar: "\u2964", rhard: "\u21C1", rharu: "\u21C0", rharul: "\u296C", Rho: "\u03A1", rho: "\u03C1", rhov: "\u03F1", RightAngleBracket: "\u27E9", RightArrowBar: "\u21E5", rightarrow: "\u2192", RightArrow: "\u2192", Rightarrow: "\u21D2", RightArrowLeftArrow: "\u21C4", rightarrowtail: "\u21A3", RightCeiling: "\u2309", RightDoubleBracket: "\u27E7", RightDownTeeVector: "\u295D", RightDownVectorBar: "\u2955", RightDownVector: "\u21C2", RightFloor: "\u230B", rightharpoondown: "\u21C1", rightharpoonup: "\u21C0", rightleftarrows: "\u21C4", rightleftharpoons: "\u21CC", rightrightarrows: "\u21C9", rightsquigarrow: "\u219D", RightTeeArrow: "\u21A6", RightTee: "\u22A2", RightTeeVector: "\u295B", rightthreetimes: "\u22CC", RightTriangleBar: "\u29D0", RightTriangle: "\u22B3", RightTriangleEqual: "\u22B5", RightUpDownVector: "\u294F", RightUpTeeVector: "\u295C", RightUpVectorBar: "\u2954", RightUpVector: "\u21BE", RightVectorBar: "\u2953", RightVector: "\u21C0", ring: "\u02DA", risingdotseq: "\u2253", rlarr: "\u21C4", rlhar: "\u21CC", rlm: "\u200F", rmoustache: "\u23B1", rmoust: "\u23B1", rnmid: "\u2AEE", roang: "\u27ED", roarr: "\u21FE", robrk: "\u27E7", ropar: "\u2986", ropf: "\u{1D563}", Ropf: "\u211D", roplus: "\u2A2E", rotimes: "\u2A35", RoundImplies: "\u2970", rpar: ")", rpargt: "\u2994", rppolint: "\u2A12", rrarr: "\u21C9", Rrightarrow: "\u21DB", rsaquo: "\u203A", rscr: "\u{1D4C7}", Rscr: "\u211B", rsh: "\u21B1", Rsh: "\u21B1", rsqb: "]", rsquo: "\u2019", rsquor: "\u2019", rthree: "\u22CC", rtimes: "\u22CA", rtri: "\u25B9", rtrie: "\u22B5", rtrif: "\u25B8", rtriltri: "\u29CE", RuleDelayed: "\u29F4", ruluhar: "\u2968", rx: "\u211E", Sacute: "\u015A", sacute: "\u015B", sbquo: "\u201A", scap: "\u2AB8", Scaron: "\u0160", scaron: "\u0161", Sc: "\u2ABC", sc: "\u227B", sccue: "\u227D", sce: "\u2AB0", scE: "\u2AB4", Scedil: "\u015E", scedil: "\u015F", Scirc: "\u015C", scirc: "\u015D", scnap: "\u2ABA", scnE: "\u2AB6", scnsim: "\u22E9", scpolint: "\u2A13", scsim: "\u227F", Scy: "\u0421", scy: "\u0441", sdotb: "\u22A1", sdot: "\u22C5", sdote: "\u2A66", searhk: "\u2925", searr: "\u2198", seArr: "\u21D8", searrow: "\u2198", sect: "\xA7", semi: ";", seswar: "\u2929", setminus: "\u2216", setmn: "\u2216", sext: "\u2736", Sfr: "\u{1D516}", sfr: "\u{1D530}", sfrown: "\u2322", sharp: "\u266F", SHCHcy: "\u0429", shchcy: "\u0449", SHcy: "\u0428", shcy: "\u0448", ShortDownArrow: "\u2193", ShortLeftArrow: "\u2190", shortmid: "\u2223", shortparallel: "\u2225", ShortRightArrow: "\u2192", ShortUpArrow: "\u2191", shy: "\xAD", Sigma: "\u03A3", 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", SmallCircle: "\u2218", smallsetminus: "\u2216", smashp: "\u2A33", smeparsl: "\u29E4", smid: "\u2223", smile: "\u2323", smt: "\u2AAA", smte: "\u2AAC", smtes: "\u2AAC\uFE00", SOFTcy: "\u042C", softcy: "\u044C", solbar: "\u233F", solb: "\u29C4", sol: "/", Sopf: "\u{1D54A}", sopf: "\u{1D564}", spades: "\u2660", spadesuit: "\u2660", spar: "\u2225", sqcap: "\u2293", sqcaps: "\u2293\uFE00", sqcup: "\u2294", sqcups: "\u2294\uFE00", Sqrt: "\u221A", sqsub: "\u228F", sqsube: "\u2291", sqsubset: "\u228F", sqsubseteq: "\u2291", sqsup: "\u2290", sqsupe: "\u2292", sqsupset: "\u2290", sqsupseteq: "\u2292", square: "\u25A1", Square: "\u25A1", SquareIntersection: "\u2293", SquareSubset: "\u228F", SquareSubsetEqual: "\u2291", SquareSuperset: "\u2290", SquareSupersetEqual: "\u2292", SquareUnion: "\u2294", squarf: "\u25AA", squ: "\u25A1", squf: "\u25AA", srarr: "\u2192", Sscr: "\u{1D4AE}", sscr: "\u{1D4C8}", ssetmn: "\u2216", ssmile: "\u2323", sstarf: "\u22C6", Star: "\u22C6", star: "\u2606", starf: "\u2605", straightepsilon: "\u03F5", straightphi: "\u03D5", strns: "\xAF", sub: "\u2282", Sub: "\u22D0", subdot: "\u2ABD", subE: "\u2AC5", sube: "\u2286", subedot: "\u2AC3", submult: "\u2AC1", subnE: "\u2ACB", subne: "\u228A", subplus: "\u2ABF", subrarr: "\u2979", subset: "\u2282", Subset: "\u22D0", subseteq: "\u2286", subseteqq: "\u2AC5", SubsetEqual: "\u2286", subsetneq: "\u228A", subsetneqq: "\u2ACB", subsim: "\u2AC7", subsub: "\u2AD5", subsup: "\u2AD3", succapprox: "\u2AB8", succ: "\u227B", succcurlyeq: "\u227D", Succeeds: "\u227B", SucceedsEqual: "\u2AB0", SucceedsSlantEqual: "\u227D", SucceedsTilde: "\u227F", succeq: "\u2AB0", succnapprox: "\u2ABA", succneqq: "\u2AB6", succnsim: "\u22E9", succsim: "\u227F", SuchThat: "\u220B", sum: "\u2211", Sum: "\u2211", sung: "\u266A", sup1: "\xB9", sup2: "\xB2", sup3: "\xB3", sup: "\u2283", Sup: "\u22D1", supdot: "\u2ABE", supdsub: "\u2AD8", supE: "\u2AC6", supe: "\u2287", supedot: "\u2AC4", Superset: "\u2283", SupersetEqual: "\u2287", suphsol: "\u27C9", suphsub: "\u2AD7", suplarr: "\u297B", supmult: "\u2AC2", supnE: "\u2ACC", supne: "\u228B", supplus: "\u2AC0", supset: "\u2283", Supset: "\u22D1", supseteq: "\u2287", supseteqq: "\u2AC6", supsetneq: "\u228B", supsetneqq: "\u2ACC", supsim: "\u2AC8", supsub: "\u2AD4", supsup: "\u2AD6", swarhk: "\u2926", swarr: "\u2199", swArr: "\u21D9", swarrow: "\u2199", swnwar: "\u292A", szlig: "\xDF", Tab: " ", target: "\u2316", Tau: "\u03A4", tau: "\u03C4", tbrk: "\u23B4", Tcaron: "\u0164", tcaron: "\u0165", Tcedil: "\u0162", tcedil: "\u0163", Tcy: "\u0422", tcy: "\u0442", tdot: "\u20DB", telrec: "\u2315", Tfr: "\u{1D517}", tfr: "\u{1D531}", there4: "\u2234", therefore: "\u2234", Therefore: "\u2234", Theta: "\u0398", theta: "\u03B8", thetasym: "\u03D1", thetav: "\u03D1", thickapprox: "\u2248", thicksim: "\u223C", ThickSpace: "\u205F\u200A", ThinSpace: "\u2009", thinsp: "\u2009", thkap: "\u2248", thksim: "\u223C", THORN: "\xDE", thorn: "\xFE", tilde: "\u02DC", Tilde: "\u223C", TildeEqual: "\u2243", TildeFullEqual: "\u2245", TildeTilde: "\u2248", timesbar: "\u2A31", timesb: "\u22A0", times: "\xD7", timesd: "\u2A30", tint: "\u222D", toea: "\u2928", topbot: "\u2336", topcir: "\u2AF1", top: "\u22A4", Topf: "\u{1D54B}", topf: "\u{1D565}", topfork: "\u2ADA", tosa: "\u2929", tprime: "\u2034", trade: "\u2122", TRADE: "\u2122", triangle: "\u25B5", triangledown: "\u25BF", triangleleft: "\u25C3", trianglelefteq: "\u22B4", triangleq: "\u225C", triangleright: "\u25B9", trianglerighteq: "\u22B5", tridot: "\u25EC", trie: "\u225C", triminus: "\u2A3A", TripleDot: "\u20DB", triplus: "\u2A39", trisb: "\u29CD", tritime: "\u2A3B", trpezium: "\u23E2", Tscr: "\u{1D4AF}", tscr: "\u{1D4C9}", TScy: "\u0426", tscy: "\u0446", TSHcy: "\u040B", tshcy: "\u045B", Tstrok: "\u0166", tstrok: "\u0167", twixt: "\u226C", twoheadleftarrow: "\u219E", twoheadrightarrow: "\u21A0", Uacute: "\xDA", uacute: "\xFA", uarr: "\u2191", Uarr: "\u219F", uArr: "\u21D1", Uarrocir: "\u2949", Ubrcy: "\u040E", ubrcy: "\u045E", Ubreve: "\u016C", ubreve: "\u016D", Ucirc: "\xDB", ucirc: "\xFB", Ucy: "\u0423", ucy: "\u0443", udarr: "\u21C5", Udblac: "\u0170", udblac: "\u0171", udhar: "\u296E", ufisht: "\u297E", Ufr: "\u{1D518}", ufr: "\u{1D532}", Ugrave: "\xD9", ugrave: "\xF9", uHar: "\u2963", uharl: "\u21BF", uharr: "\u21BE", uhblk: "\u2580", ulcorn: "\u231C", ulcorner: "\u231C", ulcrop: "\u230F", ultri: "\u25F8", Umacr: "\u016A", umacr: "\u016B", uml: "\xA8", UnderBar: "_", UnderBrace: "\u23DF", UnderBracket: "\u23B5", UnderParenthesis: "\u23DD", Union: "\u22C3", UnionPlus: "\u228E", Uogon: "\u0172", uogon: "\u0173", Uopf: "\u{1D54C}", uopf: "\u{1D566}", UpArrowBar: "\u2912", uparrow: "\u2191", UpArrow: "\u2191", Uparrow: "\u21D1", UpArrowDownArrow: "\u21C5", updownarrow: "\u2195", UpDownArrow: "\u2195", Updownarrow: "\u21D5", UpEquilibrium: "\u296E", upharpoonleft: "\u21BF", upharpoonright: "\u21BE", uplus: "\u228E", UpperLeftArrow: "\u2196", UpperRightArrow: "\u2197", upsi: "\u03C5", Upsi: "\u03D2", upsih: "\u03D2", Upsilon: "\u03A5", upsilon: "\u03C5", UpTeeArrow: "\u21A5", UpTee: "\u22A5", upuparrows: "\u21C8", urcorn: "\u231D", urcorner: "\u231D", urcrop: "\u230E", Uring: "\u016E", uring: "\u016F", urtri: "\u25F9", Uscr: "\u{1D4B0}", uscr: "\u{1D4CA}", utdot: "\u22F0", Utilde: "\u0168", utilde: "\u0169", utri: "\u25B5", utrif: "\u25B4", uuarr: "\u21C8", Uuml: "\xDC", uuml: "\xFC", uwangle: "\u29A7", vangrt: "\u299C", varepsilon: "\u03F5", varkappa: "\u03F0", varnothing: "\u2205", varphi: "\u03D5", varpi: "\u03D6", varpropto: "\u221D", varr: "\u2195", vArr: "\u21D5", varrho: "\u03F1", varsigma: "\u03C2", varsubsetneq: "\u228A\uFE00", varsubsetneqq: "\u2ACB\uFE00", varsupsetneq: "\u228B\uFE00", varsupsetneqq: "\u2ACC\uFE00", vartheta: "\u03D1", vartriangleleft: "\u22B2", vartriangleright: "\u22B3", vBar: "\u2AE8", Vbar: "\u2AEB", vBarv: "\u2AE9", Vcy: "\u0412", vcy: "\u0432", vdash: "\u22A2", vDash: "\u22A8", Vdash: "\u22A9", VDash: "\u22AB", Vdashl: "\u2AE6", veebar: "\u22BB", vee: "\u2228", Vee: "\u22C1", veeeq: "\u225A", vellip: "\u22EE", verbar: "|", Verbar: "\u2016", vert: "|", Vert: "\u2016", VerticalBar: "\u2223", VerticalLine: "|", VerticalSeparator: "\u2758", VerticalTilde: "\u2240", VeryThinSpace: "\u200A", Vfr: "\u{1D519}", vfr: "\u{1D533}", vltri: "\u22B2", vnsub: "\u2282\u20D2", vnsup: "\u2283\u20D2", Vopf: "\u{1D54D}", vopf: "\u{1D567}", vprop: "\u221D", vrtri: "\u22B3", Vscr: "\u{1D4B1}", vscr: "\u{1D4CB}", vsubnE: "\u2ACB\uFE00", vsubne: "\u228A\uFE00", vsupnE: "\u2ACC\uFE00", vsupne: "\u228B\uFE00", Vvdash: "\u22AA", vzigzag: "\u299A", Wcirc: "\u0174", wcirc: "\u0175", wedbar: "\u2A5F", wedge: "\u2227", Wedge: "\u22C0", wedgeq: "\u2259", weierp: "\u2118", Wfr: "\u{1D51A}", wfr: "\u{1D534}", Wopf: "\u{1D54E}", wopf: "\u{1D568}", wp: "\u2118", wr: "\u2240", wreath: "\u2240", Wscr: "\u{1D4B2}", wscr: "\u{1D4CC}", xcap: "\u22C2", xcirc: "\u25EF", xcup: "\u22C3", xdtri: "\u25BD", Xfr: "\u{1D51B}", xfr: "\u{1D535}", xharr: "\u27F7", xhArr: "\u27FA", Xi: "\u039E", xi: "\u03BE", xlarr: "\u27F5", xlArr: "\u27F8", xmap: "\u27FC", xnis: "\u22FB", xodot: "\u2A00", Xopf: "\u{1D54F}", xopf: "\u{1D569}", xoplus: "\u2A01", xotime: "\u2A02", xrarr: "\u27F6", xrArr: "\u27F9", Xscr: "\u{1D4B3}", xscr: "\u{1D4CD}", xsqcup: "\u2A06", xuplus: "\u2A04", xutri: "\u25B3", xvee: "\u22C1", xwedge: "\u22C0", Yacute: "\xDD", yacute: "\xFD", YAcy: "\u042F", yacy: "\u044F", Ycirc: "\u0176", ycirc: "\u0177", Ycy: "\u042B", ycy: "\u044B", yen: "\xA5", Yfr: "\u{1D51C}", yfr: "\u{1D536}", YIcy: "\u0407", yicy: "\u0457", Yopf: "\u{1D550}", yopf: "\u{1D56A}", Yscr: "\u{1D4B4}", yscr: "\u{1D4CE}", YUcy: "\u042E", yucy: "\u044E", yuml: "\xFF", Yuml: "\u0178", Zacute: "\u0179", zacute: "\u017A", Zcaron: "\u017D", zcaron: "\u017E", Zcy: "\u0417", zcy: "\u0437", Zdot: "\u017B", zdot: "\u017C", zeetrf: "\u2128", ZeroWidthSpace: "\u200B", Zeta: "\u0396", zeta: "\u03B6", zfr: "\u{1D537}", Zfr: "\u2128", ZHcy: "\u0416", zhcy: "\u0436", zigrarr: "\u21DD", zopf: "\u{1D56B}", Zopf: "\u2124", Zscr: "\u{1D4B5}", zscr: "\u{1D4CF}", zwj: "\u200D", zwnj: "\u200C" };
131 // node_modules/markdown-it/lib/common/entities.js
132 var require_entities2 = __commonJS({
133 "node_modules/markdown-it/lib/common/entities.js"(exports, module2) {
135 module2.exports = require_entities();
139 // node_modules/uc.micro/categories/P/regex.js
140 var require_regex = __commonJS({
141 "node_modules/uc.micro/categories/P/regex.js"(exports, module2) {
142 module2.exports = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/;
146 // node_modules/mdurl/encode.js
147 var require_encode = __commonJS({
148 "node_modules/mdurl/encode.js"(exports, module2) {
150 var encodeCache = {};
151 function getEncodeCache(exclude) {
152 var i, ch, cache = encodeCache[exclude];
156 cache = encodeCache[exclude] = [];
157 for (i = 0; i < 128; i++) {
158 ch = String.fromCharCode(i);
159 if (/^[0-9a-z]$/i.test(ch)) {
162 cache.push("%" + ("0" + i.toString(16).toUpperCase()).slice(-2));
165 for (i = 0; i < exclude.length; i++) {
166 cache[exclude.charCodeAt(i)] = exclude[i];
170 function encode(string, exclude, keepEscaped) {
171 var i, l, code, nextCode, cache, result = "";
172 if (typeof exclude !== "string") {
173 keepEscaped = exclude;
174 exclude = encode.defaultChars;
176 if (typeof keepEscaped === "undefined") {
179 cache = getEncodeCache(exclude);
180 for (i = 0, l = string.length; i < l; i++) {
181 code = string.charCodeAt(i);
182 if (keepEscaped && code === 37 && i + 2 < l) {
183 if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) {
184 result += string.slice(i, i + 3);
190 result += cache[code];
193 if (code >= 55296 && code <= 57343) {
194 if (code >= 55296 && code <= 56319 && i + 1 < l) {
195 nextCode = string.charCodeAt(i + 1);
196 if (nextCode >= 56320 && nextCode <= 57343) {
197 result += encodeURIComponent(string[i] + string[i + 1]);
202 result += "%EF%BF%BD";
205 result += encodeURIComponent(string[i]);
209 encode.defaultChars = ";/?:@&=+$,-_.!~*'()#";
210 encode.componentChars = "-_.!~*'()";
211 module2.exports = encode;
215 // node_modules/mdurl/decode.js
216 var require_decode = __commonJS({
217 "node_modules/mdurl/decode.js"(exports, module2) {
219 var decodeCache = {};
220 function getDecodeCache(exclude) {
221 var i, ch, cache = decodeCache[exclude];
225 cache = decodeCache[exclude] = [];
226 for (i = 0; i < 128; i++) {
227 ch = String.fromCharCode(i);
230 for (i = 0; i < exclude.length; i++) {
231 ch = exclude.charCodeAt(i);
232 cache[ch] = "%" + ("0" + ch.toString(16).toUpperCase()).slice(-2);
236 function decode(string, exclude) {
238 if (typeof exclude !== "string") {
239 exclude = decode.defaultChars;
241 cache = getDecodeCache(exclude);
242 return string.replace(/(%[a-f0-9]{2})+/gi, function(seq2) {
243 var i, l, b1, b2, b3, b4, chr, result = "";
244 for (i = 0, l = seq2.length; i < l; i += 3) {
245 b1 = parseInt(seq2.slice(i + 1, i + 3), 16);
250 if ((b1 & 224) === 192 && i + 3 < l) {
251 b2 = parseInt(seq2.slice(i + 4, i + 6), 16);
252 if ((b2 & 192) === 128) {
253 chr = b1 << 6 & 1984 | b2 & 63;
255 result += "\uFFFD\uFFFD";
257 result += String.fromCharCode(chr);
263 if ((b1 & 240) === 224 && i + 6 < l) {
264 b2 = parseInt(seq2.slice(i + 4, i + 6), 16);
265 b3 = parseInt(seq2.slice(i + 7, i + 9), 16);
266 if ((b2 & 192) === 128 && (b3 & 192) === 128) {
267 chr = b1 << 12 & 61440 | b2 << 6 & 4032 | b3 & 63;
268 if (chr < 2048 || chr >= 55296 && chr <= 57343) {
269 result += "\uFFFD\uFFFD\uFFFD";
271 result += String.fromCharCode(chr);
277 if ((b1 & 248) === 240 && i + 9 < l) {
278 b2 = parseInt(seq2.slice(i + 4, i + 6), 16);
279 b3 = parseInt(seq2.slice(i + 7, i + 9), 16);
280 b4 = parseInt(seq2.slice(i + 10, i + 12), 16);
281 if ((b2 & 192) === 128 && (b3 & 192) === 128 && (b4 & 192) === 128) {
282 chr = b1 << 18 & 1835008 | b2 << 12 & 258048 | b3 << 6 & 4032 | b4 & 63;
283 if (chr < 65536 || chr > 1114111) {
284 result += "\uFFFD\uFFFD\uFFFD\uFFFD";
287 result += String.fromCharCode(55296 + (chr >> 10), 56320 + (chr & 1023));
298 decode.defaultChars = ";/?:@&=+$,#";
299 decode.componentChars = "";
300 module2.exports = decode;
304 // node_modules/mdurl/format.js
305 var require_format = __commonJS({
306 "node_modules/mdurl/format.js"(exports, module2) {
308 module2.exports = function format(url) {
310 result += url.protocol || "";
311 result += url.slashes ? "//" : "";
312 result += url.auth ? url.auth + "@" : "";
313 if (url.hostname && url.hostname.indexOf(":") !== -1) {
314 result += "[" + url.hostname + "]";
316 result += url.hostname || "";
318 result += url.port ? ":" + url.port : "";
319 result += url.pathname || "";
320 result += url.search || "";
321 result += url.hash || "";
327 // node_modules/mdurl/parse.js
328 var require_parse = __commonJS({
329 "node_modules/mdurl/parse.js"(exports, module2) {
332 this.protocol = null;
336 this.hostname = null;
339 this.pathname = null;
341 var protocolPattern = /^([a-z0-9.+-]+:)/i;
342 var portPattern = /:[0-9]*$/;
343 var simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/;
344 var delims = ["<", ">", '"', "`", " ", "\r", "\n", " "];
345 var unwise = ["{", "}", "|", "\\", "^", "`"].concat(delims);
346 var autoEscape = ["'"].concat(unwise);
347 var nonHostChars = ["%", "/", "?", ";", "#"].concat(autoEscape);
348 var hostEndingChars = ["/", "?", "#"];
349 var hostnameMaxLen = 255;
350 var hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/;
351 var hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/;
352 var hostlessProtocol = {
356 var slashedProtocol = {
368 function urlParse(url, slashesDenoteHost) {
369 if (url && url instanceof Url) {
373 u.parse(url, slashesDenoteHost);
376 Url.prototype.parse = function(url, slashesDenoteHost) {
377 var i, l, lowerProto, hec, slashes, rest = url;
379 if (!slashesDenoteHost && url.split("#").length === 1) {
380 var simplePath = simplePathPattern.exec(rest);
382 this.pathname = simplePath[1];
384 this.search = simplePath[2];
389 var proto = protocolPattern.exec(rest);
392 lowerProto = proto.toLowerCase();
393 this.protocol = proto;
394 rest = rest.substr(proto.length);
396 if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
397 slashes = rest.substr(0, 2) === "//";
398 if (slashes && !(proto && hostlessProtocol[proto])) {
399 rest = rest.substr(2);
403 if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {
405 for (i = 0; i < hostEndingChars.length; i++) {
406 hec = rest.indexOf(hostEndingChars[i]);
407 if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
412 if (hostEnd === -1) {
413 atSign = rest.lastIndexOf("@");
415 atSign = rest.lastIndexOf("@", hostEnd);
418 auth = rest.slice(0, atSign);
419 rest = rest.slice(atSign + 1);
423 for (i = 0; i < nonHostChars.length; i++) {
424 hec = rest.indexOf(nonHostChars[i]);
425 if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
429 if (hostEnd === -1) {
430 hostEnd = rest.length;
432 if (rest[hostEnd - 1] === ":") {
435 var host = rest.slice(0, hostEnd);
436 rest = rest.slice(hostEnd);
437 this.parseHost(host);
438 this.hostname = this.hostname || "";
439 var ipv6Hostname = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
441 var hostparts = this.hostname.split(/\./);
442 for (i = 0, l = hostparts.length; i < l; i++) {
443 var part = hostparts[i];
447 if (!part.match(hostnamePartPattern)) {
449 for (var j = 0, k = part.length; j < k; j++) {
450 if (part.charCodeAt(j) > 127) {
456 if (!newpart.match(hostnamePartPattern)) {
457 var validParts = hostparts.slice(0, i);
458 var notHost = hostparts.slice(i + 1);
459 var bit = part.match(hostnamePartStart);
461 validParts.push(bit[1]);
462 notHost.unshift(bit[2]);
464 if (notHost.length) {
465 rest = notHost.join(".") + rest;
467 this.hostname = validParts.join(".");
473 if (this.hostname.length > hostnameMaxLen) {
477 this.hostname = this.hostname.substr(1, this.hostname.length - 2);
480 var hash = rest.indexOf("#");
482 this.hash = rest.substr(hash);
483 rest = rest.slice(0, hash);
485 var qm = rest.indexOf("?");
487 this.search = rest.substr(qm);
488 rest = rest.slice(0, qm);
491 this.pathname = rest;
493 if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) {
498 Url.prototype.parseHost = function(host) {
499 var port = portPattern.exec(host);
503 this.port = port.substr(1);
505 host = host.substr(0, host.length - port.length);
508 this.hostname = host;
511 module2.exports = urlParse;
515 // node_modules/mdurl/index.js
516 var require_mdurl = __commonJS({
517 "node_modules/mdurl/index.js"(exports, module2) {
519 module2.exports.encode = require_encode();
520 module2.exports.decode = require_decode();
521 module2.exports.format = require_format();
522 module2.exports.parse = require_parse();
526 // node_modules/uc.micro/properties/Any/regex.js
527 var require_regex2 = __commonJS({
528 "node_modules/uc.micro/properties/Any/regex.js"(exports, module2) {
529 module2.exports = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
533 // node_modules/uc.micro/categories/Cc/regex.js
534 var require_regex3 = __commonJS({
535 "node_modules/uc.micro/categories/Cc/regex.js"(exports, module2) {
536 module2.exports = /[\0-\x1F\x7F-\x9F]/;
540 // node_modules/uc.micro/categories/Cf/regex.js
541 var require_regex4 = __commonJS({
542 "node_modules/uc.micro/categories/Cf/regex.js"(exports, module2) {
543 module2.exports = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/;
547 // node_modules/uc.micro/categories/Z/regex.js
548 var require_regex5 = __commonJS({
549 "node_modules/uc.micro/categories/Z/regex.js"(exports, module2) {
550 module2.exports = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;
554 // node_modules/uc.micro/index.js
555 var require_uc = __commonJS({
556 "node_modules/uc.micro/index.js"(exports) {
558 exports.Any = require_regex2();
559 exports.Cc = require_regex3();
560 exports.Cf = require_regex4();
561 exports.P = require_regex();
562 exports.Z = require_regex5();
566 // node_modules/markdown-it/lib/common/utils.js
567 var require_utils = __commonJS({
568 "node_modules/markdown-it/lib/common/utils.js"(exports) {
570 function _class2(obj) {
571 return Object.prototype.toString.call(obj);
573 function isString(obj) {
574 return _class2(obj) === "[object String]";
576 var _hasOwnProperty2 = Object.prototype.hasOwnProperty;
577 function has(object, key) {
578 return _hasOwnProperty2.call(object, key);
580 function assign(obj) {
581 var sources = Array.prototype.slice.call(arguments, 1);
582 sources.forEach(function(source) {
586 if (typeof source !== "object") {
587 throw new TypeError(source + "must be object");
589 Object.keys(source).forEach(function(key) {
590 obj[key] = source[key];
595 function arrayReplaceAt(src, pos, newElements) {
596 return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));
598 function isValidEntityCode(c) {
599 if (c >= 55296 && c <= 57343) {
602 if (c >= 64976 && c <= 65007) {
605 if ((c & 65535) === 65535 || (c & 65535) === 65534) {
608 if (c >= 0 && c <= 8) {
614 if (c >= 14 && c <= 31) {
617 if (c >= 127 && c <= 159) {
625 function fromCodePoint(c) {
628 var surrogate1 = 55296 + (c >> 10), surrogate2 = 56320 + (c & 1023);
629 return String.fromCharCode(surrogate1, surrogate2);
631 return String.fromCharCode(c);
633 var UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g;
634 var ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi;
635 var UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + "|" + ENTITY_RE.source, "gi");
636 var DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;
637 var entities = require_entities2();
638 function replaceEntityPattern(match, name) {
640 if (has(entities, name)) {
641 return entities[name];
643 if (name.charCodeAt(0) === 35 && DIGITAL_ENTITY_TEST_RE.test(name)) {
644 code = name[1].toLowerCase() === "x" ? parseInt(name.slice(2), 16) : parseInt(name.slice(1), 10);
645 if (isValidEntityCode(code)) {
646 return fromCodePoint(code);
651 function unescapeMd(str2) {
652 if (str2.indexOf("\\") < 0) {
655 return str2.replace(UNESCAPE_MD_RE, "$1");
657 function unescapeAll(str2) {
658 if (str2.indexOf("\\") < 0 && str2.indexOf("&") < 0) {
661 return str2.replace(UNESCAPE_ALL_RE, function(match, escaped, entity) {
665 return replaceEntityPattern(match, entity);
668 var HTML_ESCAPE_TEST_RE = /[&<>"]/;
669 var HTML_ESCAPE_REPLACE_RE = /[&<>"]/g;
670 var HTML_REPLACEMENTS = {
676 function replaceUnsafeChar(ch) {
677 return HTML_REPLACEMENTS[ch];
679 function escapeHtml(str2) {
680 if (HTML_ESCAPE_TEST_RE.test(str2)) {
681 return str2.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar);
685 var REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g;
686 function escapeRE(str2) {
687 return str2.replace(REGEXP_ESCAPE_RE, "\\$&");
689 function isSpace(code) {
697 function isWhiteSpace(code) {
698 if (code >= 8192 && code <= 8202) {
717 var UNICODE_PUNCT_RE = require_regex();
718 function isPunctChar(ch) {
719 return UNICODE_PUNCT_RE.test(ch);
721 function isMdAsciiPunct(ch) {
760 function normalizeReference(str2) {
761 str2 = str2.trim().replace(/\s+/g, " ");
762 if ("\u1E9E".toLowerCase() === "\u1E7E") {
763 str2 = str2.replace(/ẞ/g, "\xDF");
765 return str2.toLowerCase().toUpperCase();
768 exports.lib.mdurl = require_mdurl();
769 exports.lib.ucmicro = require_uc();
770 exports.assign = assign;
771 exports.isString = isString;
773 exports.unescapeMd = unescapeMd;
774 exports.unescapeAll = unescapeAll;
775 exports.isValidEntityCode = isValidEntityCode;
776 exports.fromCodePoint = fromCodePoint;
777 exports.escapeHtml = escapeHtml;
778 exports.arrayReplaceAt = arrayReplaceAt;
779 exports.isSpace = isSpace;
780 exports.isWhiteSpace = isWhiteSpace;
781 exports.isMdAsciiPunct = isMdAsciiPunct;
782 exports.isPunctChar = isPunctChar;
783 exports.escapeRE = escapeRE;
784 exports.normalizeReference = normalizeReference;
788 // node_modules/markdown-it/lib/helpers/parse_link_label.js
789 var require_parse_link_label = __commonJS({
790 "node_modules/markdown-it/lib/helpers/parse_link_label.js"(exports, module2) {
792 module2.exports = function parseLinkLabel(state, start, disableNested) {
793 var level, found, marker, prevPos, labelEnd = -1, max = state.posMax, oldPos = state.pos;
794 state.pos = start + 1;
796 while (state.pos < max) {
797 marker = state.src.charCodeAt(state.pos);
806 state.md.inline.skipToken(state);
808 if (prevPos === state.pos - 1) {
810 } else if (disableNested) {
817 labelEnd = state.pos;
825 // node_modules/markdown-it/lib/helpers/parse_link_destination.js
826 var require_parse_link_destination = __commonJS({
827 "node_modules/markdown-it/lib/helpers/parse_link_destination.js"(exports, module2) {
829 var unescapeAll = require_utils().unescapeAll;
830 module2.exports = function parseLinkDestination(str2, pos, max) {
831 var code, level, lines = 0, start = pos, result = {
837 if (str2.charCodeAt(pos) === 60) {
840 code = str2.charCodeAt(pos);
848 result.pos = pos + 1;
849 result.str = unescapeAll(str2.slice(start + 1, pos));
853 if (code === 92 && pos + 1 < max) {
863 code = str2.charCodeAt(pos);
867 if (code < 32 || code === 127) {
870 if (code === 92 && pos + 1 < max) {
871 if (str2.charCodeAt(pos + 1) === 32) {
897 result.str = unescapeAll(str2.slice(start, pos));
898 result.lines = lines;
906 // node_modules/markdown-it/lib/helpers/parse_link_title.js
907 var require_parse_link_title = __commonJS({
908 "node_modules/markdown-it/lib/helpers/parse_link_title.js"(exports, module2) {
910 var unescapeAll = require_utils().unescapeAll;
911 module2.exports = function parseLinkTitle(str2, pos, max) {
912 var code, marker, lines = 0, start = pos, result = {
921 marker = str2.charCodeAt(pos);
922 if (marker !== 34 && marker !== 39 && marker !== 40) {
930 code = str2.charCodeAt(pos);
931 if (code === marker) {
932 result.pos = pos + 1;
933 result.lines = lines;
934 result.str = unescapeAll(str2.slice(start + 1, pos));
937 } else if (code === 40 && marker === 41) {
939 } else if (code === 10) {
941 } else if (code === 92 && pos + 1 < max) {
943 if (str2.charCodeAt(pos) === 10) {
954 // node_modules/markdown-it/lib/helpers/index.js
955 var require_helpers = __commonJS({
956 "node_modules/markdown-it/lib/helpers/index.js"(exports) {
958 exports.parseLinkLabel = require_parse_link_label();
959 exports.parseLinkDestination = require_parse_link_destination();
960 exports.parseLinkTitle = require_parse_link_title();
964 // node_modules/markdown-it/lib/renderer.js
965 var require_renderer = __commonJS({
966 "node_modules/markdown-it/lib/renderer.js"(exports, module2) {
968 var assign = require_utils().assign;
969 var unescapeAll = require_utils().unescapeAll;
970 var escapeHtml = require_utils().escapeHtml;
971 var default_rules = {};
972 default_rules.code_inline = function(tokens, idx, options, env, slf) {
973 var token = tokens[idx];
974 return "<code" + slf.renderAttrs(token) + ">" + escapeHtml(tokens[idx].content) + "</code>";
976 default_rules.code_block = function(tokens, idx, options, env, slf) {
977 var token = tokens[idx];
978 return "<pre" + slf.renderAttrs(token) + "><code>" + escapeHtml(tokens[idx].content) + "</code></pre>\n";
980 default_rules.fence = function(tokens, idx, options, env, slf) {
981 var token = tokens[idx], info = token.info ? unescapeAll(token.info).trim() : "", langName = "", langAttrs = "", highlighted, i, arr, tmpAttrs, tmpToken;
983 arr = info.split(/(\s+)/g);
985 langAttrs = arr.slice(2).join("");
987 if (options.highlight) {
988 highlighted = options.highlight(token.content, langName, langAttrs) || escapeHtml(token.content);
990 highlighted = escapeHtml(token.content);
992 if (highlighted.indexOf("<pre") === 0) {
993 return highlighted + "\n";
996 i = token.attrIndex("class");
997 tmpAttrs = token.attrs ? token.attrs.slice() : [];
999 tmpAttrs.push(["class", options.langPrefix + langName]);
1001 tmpAttrs[i] = tmpAttrs[i].slice();
1002 tmpAttrs[i][1] += " " + options.langPrefix + langName;
1007 return "<pre><code" + slf.renderAttrs(tmpToken) + ">" + highlighted + "</code></pre>\n";
1009 return "<pre><code" + slf.renderAttrs(token) + ">" + highlighted + "</code></pre>\n";
1011 default_rules.image = function(tokens, idx, options, env, slf) {
1012 var token = tokens[idx];
1013 token.attrs[token.attrIndex("alt")][1] = slf.renderInlineAsText(token.children, options, env);
1014 return slf.renderToken(tokens, idx, options);
1016 default_rules.hardbreak = function(tokens, idx, options) {
1017 return options.xhtmlOut ? "<br />\n" : "<br>\n";
1019 default_rules.softbreak = function(tokens, idx, options) {
1020 return options.breaks ? options.xhtmlOut ? "<br />\n" : "<br>\n" : "\n";
1022 default_rules.text = function(tokens, idx) {
1023 return escapeHtml(tokens[idx].content);
1025 default_rules.html_block = function(tokens, idx) {
1026 return tokens[idx].content;
1028 default_rules.html_inline = function(tokens, idx) {
1029 return tokens[idx].content;
1031 function Renderer() {
1032 this.rules = assign({}, default_rules);
1034 Renderer.prototype.renderAttrs = function renderAttrs(token) {
1040 for (i = 0, l = token.attrs.length; i < l; i++) {
1041 result += " " + escapeHtml(token.attrs[i][0]) + '="' + escapeHtml(token.attrs[i][1]) + '"';
1045 Renderer.prototype.renderToken = function renderToken(tokens, idx, options) {
1046 var nextToken, result = "", needLf = false, token = tokens[idx];
1050 if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) {
1053 result += (token.nesting === -1 ? "</" : "<") + token.tag;
1054 result += this.renderAttrs(token);
1055 if (token.nesting === 0 && options.xhtmlOut) {
1060 if (token.nesting === 1) {
1061 if (idx + 1 < tokens.length) {
1062 nextToken = tokens[idx + 1];
1063 if (nextToken.type === "inline" || nextToken.hidden) {
1065 } else if (nextToken.nesting === -1 && nextToken.tag === token.tag) {
1071 result += needLf ? ">\n" : ">";
1074 Renderer.prototype.renderInline = function(tokens, options, env) {
1075 var type2, result = "", rules = this.rules;
1076 for (var i = 0, len = tokens.length; i < len; i++) {
1077 type2 = tokens[i].type;
1078 if (typeof rules[type2] !== "undefined") {
1079 result += rules[type2](tokens, i, options, env, this);
1081 result += this.renderToken(tokens, i, options);
1086 Renderer.prototype.renderInlineAsText = function(tokens, options, env) {
1088 for (var i = 0, len = tokens.length; i < len; i++) {
1089 if (tokens[i].type === "text") {
1090 result += tokens[i].content;
1091 } else if (tokens[i].type === "image") {
1092 result += this.renderInlineAsText(tokens[i].children, options, env);
1093 } else if (tokens[i].type === "softbreak") {
1099 Renderer.prototype.render = function(tokens, options, env) {
1100 var i, len, type2, result = "", rules = this.rules;
1101 for (i = 0, len = tokens.length; i < len; i++) {
1102 type2 = tokens[i].type;
1103 if (type2 === "inline") {
1104 result += this.renderInline(tokens[i].children, options, env);
1105 } else if (typeof rules[type2] !== "undefined") {
1106 result += rules[tokens[i].type](tokens, i, options, env, this);
1108 result += this.renderToken(tokens, i, options, env);
1113 module2.exports = Renderer;
1117 // node_modules/markdown-it/lib/ruler.js
1118 var require_ruler = __commonJS({
1119 "node_modules/markdown-it/lib/ruler.js"(exports, module2) {
1122 this.__rules__ = [];
1123 this.__cache__ = null;
1125 Ruler.prototype.__find__ = function(name) {
1126 for (var i = 0; i < this.__rules__.length; i++) {
1127 if (this.__rules__[i].name === name) {
1133 Ruler.prototype.__compile__ = function() {
1136 self.__rules__.forEach(function(rule) {
1137 if (!rule.enabled) {
1140 rule.alt.forEach(function(altName) {
1141 if (chains.indexOf(altName) < 0) {
1142 chains.push(altName);
1146 self.__cache__ = {};
1147 chains.forEach(function(chain) {
1148 self.__cache__[chain] = [];
1149 self.__rules__.forEach(function(rule) {
1150 if (!rule.enabled) {
1153 if (chain && rule.alt.indexOf(chain) < 0) {
1156 self.__cache__[chain].push(rule.fn);
1160 Ruler.prototype.at = function(name, fn, options) {
1161 var index = this.__find__(name);
1162 var opt = options || {};
1164 throw new Error("Parser rule not found: " + name);
1166 this.__rules__[index].fn = fn;
1167 this.__rules__[index].alt = opt.alt || [];
1168 this.__cache__ = null;
1170 Ruler.prototype.before = function(beforeName, ruleName, fn, options) {
1171 var index = this.__find__(beforeName);
1172 var opt = options || {};
1174 throw new Error("Parser rule not found: " + beforeName);
1176 this.__rules__.splice(index, 0, {
1182 this.__cache__ = null;
1184 Ruler.prototype.after = function(afterName, ruleName, fn, options) {
1185 var index = this.__find__(afterName);
1186 var opt = options || {};
1188 throw new Error("Parser rule not found: " + afterName);
1190 this.__rules__.splice(index + 1, 0, {
1196 this.__cache__ = null;
1198 Ruler.prototype.push = function(ruleName, fn, options) {
1199 var opt = options || {};
1200 this.__rules__.push({
1206 this.__cache__ = null;
1208 Ruler.prototype.enable = function(list, ignoreInvalid) {
1209 if (!Array.isArray(list)) {
1213 list.forEach(function(name) {
1214 var idx = this.__find__(name);
1216 if (ignoreInvalid) {
1219 throw new Error("Rules manager: invalid rule name " + name);
1221 this.__rules__[idx].enabled = true;
1224 this.__cache__ = null;
1227 Ruler.prototype.enableOnly = function(list, ignoreInvalid) {
1228 if (!Array.isArray(list)) {
1231 this.__rules__.forEach(function(rule) {
1232 rule.enabled = false;
1234 this.enable(list, ignoreInvalid);
1236 Ruler.prototype.disable = function(list, ignoreInvalid) {
1237 if (!Array.isArray(list)) {
1241 list.forEach(function(name) {
1242 var idx = this.__find__(name);
1244 if (ignoreInvalid) {
1247 throw new Error("Rules manager: invalid rule name " + name);
1249 this.__rules__[idx].enabled = false;
1252 this.__cache__ = null;
1255 Ruler.prototype.getRules = function(chainName) {
1256 if (this.__cache__ === null) {
1259 return this.__cache__[chainName] || [];
1261 module2.exports = Ruler;
1265 // node_modules/markdown-it/lib/rules_core/normalize.js
1266 var require_normalize = __commonJS({
1267 "node_modules/markdown-it/lib/rules_core/normalize.js"(exports, module2) {
1269 var NEWLINES_RE = /\r\n?|\n/g;
1270 var NULL_RE = /\0/g;
1271 module2.exports = function normalize(state) {
1273 str2 = state.src.replace(NEWLINES_RE, "\n");
1274 str2 = str2.replace(NULL_RE, "\uFFFD");
1280 // node_modules/markdown-it/lib/rules_core/block.js
1281 var require_block = __commonJS({
1282 "node_modules/markdown-it/lib/rules_core/block.js"(exports, module2) {
1284 module2.exports = function block(state) {
1286 if (state.inlineMode) {
1287 token = new state.Token("inline", "", 0);
1288 token.content = state.src;
1290 token.children = [];
1291 state.tokens.push(token);
1293 state.md.block.parse(state.src, state.md, state.env, state.tokens);
1299 // node_modules/markdown-it/lib/rules_core/inline.js
1300 var require_inline = __commonJS({
1301 "node_modules/markdown-it/lib/rules_core/inline.js"(exports, module2) {
1303 module2.exports = function inline(state) {
1304 var tokens = state.tokens, tok, i, l;
1305 for (i = 0, l = tokens.length; i < l; i++) {
1307 if (tok.type === "inline") {
1308 state.md.inline.parse(tok.content, state.md, state.env, tok.children);
1315 // node_modules/markdown-it/lib/rules_core/linkify.js
1316 var require_linkify = __commonJS({
1317 "node_modules/markdown-it/lib/rules_core/linkify.js"(exports, module2) {
1319 var arrayReplaceAt = require_utils().arrayReplaceAt;
1320 function isLinkOpen(str2) {
1321 return /^<a[>\s]/i.test(str2);
1323 function isLinkClose(str2) {
1324 return /^<\/a\s*>/i.test(str2);
1326 module2.exports = function linkify(state) {
1327 var i, j, l, tokens, token, currentToken, nodes, ln, text, pos, lastPos, level, htmlLinkLevel, url, fullUrl, urlText, blockTokens = state.tokens, links;
1328 if (!state.md.options.linkify) {
1331 for (j = 0, l = blockTokens.length; j < l; j++) {
1332 if (blockTokens[j].type !== "inline" || !state.md.linkify.pretest(blockTokens[j].content)) {
1335 tokens = blockTokens[j].children;
1337 for (i = tokens.length - 1; i >= 0; i--) {
1338 currentToken = tokens[i];
1339 if (currentToken.type === "link_close") {
1341 while (tokens[i].level !== currentToken.level && tokens[i].type !== "link_open") {
1346 if (currentToken.type === "html_inline") {
1347 if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) {
1350 if (isLinkClose(currentToken.content)) {
1354 if (htmlLinkLevel > 0) {
1357 if (currentToken.type === "text" && state.md.linkify.test(currentToken.content)) {
1358 text = currentToken.content;
1359 links = state.md.linkify.match(text);
1361 level = currentToken.level;
1363 for (ln = 0; ln < links.length; ln++) {
1364 url = links[ln].url;
1365 fullUrl = state.md.normalizeLink(url);
1366 if (!state.md.validateLink(fullUrl)) {
1369 urlText = links[ln].text;
1370 if (!links[ln].schema) {
1371 urlText = state.md.normalizeLinkText("http://" + urlText).replace(/^http:\/\//, "");
1372 } else if (links[ln].schema === "mailto:" && !/^mailto:/i.test(urlText)) {
1373 urlText = state.md.normalizeLinkText("mailto:" + urlText).replace(/^mailto:/, "");
1375 urlText = state.md.normalizeLinkText(urlText);
1377 pos = links[ln].index;
1378 if (pos > lastPos) {
1379 token = new state.Token("text", "", 0);
1380 token.content = text.slice(lastPos, pos);
1381 token.level = level;
1384 token = new state.Token("link_open", "a", 1);
1385 token.attrs = [["href", fullUrl]];
1386 token.level = level++;
1387 token.markup = "linkify";
1388 token.info = "auto";
1390 token = new state.Token("text", "", 0);
1391 token.content = urlText;
1392 token.level = level;
1394 token = new state.Token("link_close", "a", -1);
1395 token.level = --level;
1396 token.markup = "linkify";
1397 token.info = "auto";
1399 lastPos = links[ln].lastIndex;
1401 if (lastPos < text.length) {
1402 token = new state.Token("text", "", 0);
1403 token.content = text.slice(lastPos);
1404 token.level = level;
1407 blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes);
1415 // node_modules/markdown-it/lib/rules_core/replacements.js
1416 var require_replacements = __commonJS({
1417 "node_modules/markdown-it/lib/rules_core/replacements.js"(exports, module2) {
1419 var RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/;
1420 var SCOPED_ABBR_TEST_RE = /\((c|tm|r|p)\)/i;
1421 var SCOPED_ABBR_RE = /\((c|tm|r|p)\)/ig;
1428 function replaceFn(match, name) {
1429 return SCOPED_ABBR[name.toLowerCase()];
1431 function replace_scoped(inlineTokens) {
1432 var i, token, inside_autolink = 0;
1433 for (i = inlineTokens.length - 1; i >= 0; i--) {
1434 token = inlineTokens[i];
1435 if (token.type === "text" && !inside_autolink) {
1436 token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn);
1438 if (token.type === "link_open" && token.info === "auto") {
1441 if (token.type === "link_close" && token.info === "auto") {
1446 function replace_rare(inlineTokens) {
1447 var i, token, inside_autolink = 0;
1448 for (i = inlineTokens.length - 1; i >= 0; i--) {
1449 token = inlineTokens[i];
1450 if (token.type === "text" && !inside_autolink) {
1451 if (RARE_RE.test(token.content)) {
1452 token.content = token.content.replace(/\+-/g, "\xB1").replace(/\.{2,}/g, "\u2026").replace(/([?!])…/g, "$1..").replace(/([?!]){4,}/g, "$1$1$1").replace(/,{2,}/g, ",").replace(/(^|[^-])---(?=[^-]|$)/mg, "$1\u2014").replace(/(^|\s)--(?=\s|$)/mg, "$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg, "$1\u2013");
1455 if (token.type === "link_open" && token.info === "auto") {
1458 if (token.type === "link_close" && token.info === "auto") {
1463 module2.exports = function replace(state) {
1465 if (!state.md.options.typographer) {
1468 for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
1469 if (state.tokens[blkIdx].type !== "inline") {
1472 if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {
1473 replace_scoped(state.tokens[blkIdx].children);
1475 if (RARE_RE.test(state.tokens[blkIdx].content)) {
1476 replace_rare(state.tokens[blkIdx].children);
1483 // node_modules/markdown-it/lib/rules_core/smartquotes.js
1484 var require_smartquotes = __commonJS({
1485 "node_modules/markdown-it/lib/rules_core/smartquotes.js"(exports, module2) {
1487 var isWhiteSpace = require_utils().isWhiteSpace;
1488 var isPunctChar = require_utils().isPunctChar;
1489 var isMdAsciiPunct = require_utils().isMdAsciiPunct;
1490 var QUOTE_TEST_RE = /['"]/;
1491 var QUOTE_RE = /['"]/g;
1492 var APOSTROPHE = "\u2019";
1493 function replaceAt(str2, index, ch) {
1494 return str2.substr(0, index) + ch + str2.substr(index + 1);
1496 function process_inlines(tokens, state) {
1497 var i, token, text, t, pos, max, thisLevel, item, lastChar, nextChar, isLastPunctChar, isNextPunctChar, isLastWhiteSpace, isNextWhiteSpace, canOpen, canClose, j, isSingle, stack, openQuote, closeQuote;
1499 for (i = 0; i < tokens.length; i++) {
1501 thisLevel = tokens[i].level;
1502 for (j = stack.length - 1; j >= 0; j--) {
1503 if (stack[j].level <= thisLevel) {
1507 stack.length = j + 1;
1508 if (token.type !== "text") {
1511 text = token.content;
1516 QUOTE_RE.lastIndex = pos;
1517 t = QUOTE_RE.exec(text);
1521 canOpen = canClose = true;
1523 isSingle = t[0] === "'";
1525 if (t.index - 1 >= 0) {
1526 lastChar = text.charCodeAt(t.index - 1);
1528 for (j = i - 1; j >= 0; j--) {
1529 if (tokens[j].type === "softbreak" || tokens[j].type === "hardbreak")
1531 if (!tokens[j].content)
1533 lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1);
1539 nextChar = text.charCodeAt(pos);
1541 for (j = i + 1; j < tokens.length; j++) {
1542 if (tokens[j].type === "softbreak" || tokens[j].type === "hardbreak")
1544 if (!tokens[j].content)
1546 nextChar = tokens[j].content.charCodeAt(0);
1550 isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
1551 isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
1552 isLastWhiteSpace = isWhiteSpace(lastChar);
1553 isNextWhiteSpace = isWhiteSpace(nextChar);
1554 if (isNextWhiteSpace) {
1556 } else if (isNextPunctChar) {
1557 if (!(isLastWhiteSpace || isLastPunctChar)) {
1561 if (isLastWhiteSpace) {
1563 } else if (isLastPunctChar) {
1564 if (!(isNextWhiteSpace || isNextPunctChar)) {
1568 if (nextChar === 34 && t[0] === '"') {
1569 if (lastChar >= 48 && lastChar <= 57) {
1570 canClose = canOpen = false;
1573 if (canOpen && canClose) {
1574 canOpen = isLastPunctChar;
1575 canClose = isNextPunctChar;
1577 if (!canOpen && !canClose) {
1579 token.content = replaceAt(token.content, t.index, APOSTROPHE);
1584 for (j = stack.length - 1; j >= 0; j--) {
1586 if (stack[j].level < thisLevel) {
1589 if (item.single === isSingle && stack[j].level === thisLevel) {
1592 openQuote = state.md.options.quotes[2];
1593 closeQuote = state.md.options.quotes[3];
1595 openQuote = state.md.options.quotes[0];
1596 closeQuote = state.md.options.quotes[1];
1598 token.content = replaceAt(token.content, t.index, closeQuote);
1599 tokens[item.token].content = replaceAt(tokens[item.token].content, item.pos, openQuote);
1600 pos += closeQuote.length - 1;
1601 if (item.token === i) {
1602 pos += openQuote.length - 1;
1604 text = token.content;
1618 } else if (canClose && isSingle) {
1619 token.content = replaceAt(token.content, t.index, APOSTROPHE);
1624 module2.exports = function smartquotes(state) {
1626 if (!state.md.options.typographer) {
1629 for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
1630 if (state.tokens[blkIdx].type !== "inline" || !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {
1633 process_inlines(state.tokens[blkIdx].children, state);
1639 // node_modules/markdown-it/lib/token.js
1640 var require_token = __commonJS({
1641 "node_modules/markdown-it/lib/token.js"(exports, module2) {
1643 function Token(type2, tag, nesting) {
1648 this.nesting = nesting;
1650 this.children = null;
1656 this.hidden = false;
1658 Token.prototype.attrIndex = function attrIndex(name) {
1664 for (i = 0, len = attrs.length; i < len; i++) {
1665 if (attrs[i][0] === name) {
1671 Token.prototype.attrPush = function attrPush(attrData) {
1673 this.attrs.push(attrData);
1675 this.attrs = [attrData];
1678 Token.prototype.attrSet = function attrSet(name, value) {
1679 var idx = this.attrIndex(name), attrData = [name, value];
1681 this.attrPush(attrData);
1683 this.attrs[idx] = attrData;
1686 Token.prototype.attrGet = function attrGet(name) {
1687 var idx = this.attrIndex(name), value = null;
1689 value = this.attrs[idx][1];
1693 Token.prototype.attrJoin = function attrJoin(name, value) {
1694 var idx = this.attrIndex(name);
1696 this.attrPush([name, value]);
1698 this.attrs[idx][1] = this.attrs[idx][1] + " " + value;
1701 module2.exports = Token;
1705 // node_modules/markdown-it/lib/rules_core/state_core.js
1706 var require_state_core = __commonJS({
1707 "node_modules/markdown-it/lib/rules_core/state_core.js"(exports, module2) {
1709 var Token = require_token();
1710 function StateCore(src, md, env) {
1714 this.inlineMode = false;
1717 StateCore.prototype.Token = Token;
1718 module2.exports = StateCore;
1722 // node_modules/markdown-it/lib/parser_core.js
1723 var require_parser_core = __commonJS({
1724 "node_modules/markdown-it/lib/parser_core.js"(exports, module2) {
1726 var Ruler = require_ruler();
1728 ["normalize", require_normalize()],
1729 ["block", require_block()],
1730 ["inline", require_inline()],
1731 ["linkify", require_linkify()],
1732 ["replacements", require_replacements()],
1733 ["smartquotes", require_smartquotes()]
1736 this.ruler = new Ruler();
1737 for (var i = 0; i < _rules.length; i++) {
1738 this.ruler.push(_rules[i][0], _rules[i][1]);
1741 Core.prototype.process = function(state) {
1743 rules = this.ruler.getRules("");
1744 for (i = 0, l = rules.length; i < l; i++) {
1748 Core.prototype.State = require_state_core();
1749 module2.exports = Core;
1753 // node_modules/markdown-it/lib/rules_block/table.js
1754 var require_table = __commonJS({
1755 "node_modules/markdown-it/lib/rules_block/table.js"(exports, module2) {
1757 var isSpace = require_utils().isSpace;
1758 function getLine2(state, line) {
1759 var pos = state.bMarks[line] + state.tShift[line], max = state.eMarks[line];
1760 return state.src.substr(pos, max - pos);
1762 function escapedSplit(str2) {
1763 var result = [], pos = 0, max = str2.length, ch, isEscaped = false, lastPos = 0, current = "";
1764 ch = str2.charCodeAt(pos);
1768 result.push(current + str2.substring(lastPos, pos));
1772 current += str2.substring(lastPos, pos - 1);
1776 isEscaped = ch === 92;
1778 ch = str2.charCodeAt(pos);
1780 result.push(current + str2.substring(lastPos));
1783 module2.exports = function table(state, startLine, endLine, silent) {
1784 var ch, lineText, pos, i, l, nextLine, columns, columnCount, token, aligns, t, tableLines, tbodyLines, oldParentType, terminate, terminatorRules, firstCh, secondCh;
1785 if (startLine + 2 > endLine) {
1788 nextLine = startLine + 1;
1789 if (state.sCount[nextLine] < state.blkIndent) {
1792 if (state.sCount[nextLine] - state.blkIndent >= 4) {
1795 pos = state.bMarks[nextLine] + state.tShift[nextLine];
1796 if (pos >= state.eMarks[nextLine]) {
1799 firstCh = state.src.charCodeAt(pos++);
1800 if (firstCh !== 124 && firstCh !== 45 && firstCh !== 58) {
1803 if (pos >= state.eMarks[nextLine]) {
1806 secondCh = state.src.charCodeAt(pos++);
1807 if (secondCh !== 124 && secondCh !== 45 && secondCh !== 58 && !isSpace(secondCh)) {
1810 if (firstCh === 45 && isSpace(secondCh)) {
1813 while (pos < state.eMarks[nextLine]) {
1814 ch = state.src.charCodeAt(pos);
1815 if (ch !== 124 && ch !== 45 && ch !== 58 && !isSpace(ch)) {
1820 lineText = getLine2(state, startLine + 1);
1821 columns = lineText.split("|");
1823 for (i = 0; i < columns.length; i++) {
1824 t = columns[i].trim();
1826 if (i === 0 || i === columns.length - 1) {
1832 if (!/^:?-+:?$/.test(t)) {
1835 if (t.charCodeAt(t.length - 1) === 58) {
1836 aligns.push(t.charCodeAt(0) === 58 ? "center" : "right");
1837 } else if (t.charCodeAt(0) === 58) {
1838 aligns.push("left");
1843 lineText = getLine2(state, startLine).trim();
1844 if (lineText.indexOf("|") === -1) {
1847 if (state.sCount[startLine] - state.blkIndent >= 4) {
1850 columns = escapedSplit(lineText);
1851 if (columns.length && columns[0] === "")
1853 if (columns.length && columns[columns.length - 1] === "")
1855 columnCount = columns.length;
1856 if (columnCount === 0 || columnCount !== aligns.length) {
1862 oldParentType = state.parentType;
1863 state.parentType = "table";
1864 terminatorRules = state.md.block.ruler.getRules("blockquote");
1865 token = state.push("table_open", "table", 1);
1866 token.map = tableLines = [startLine, 0];
1867 token = state.push("thead_open", "thead", 1);
1868 token.map = [startLine, startLine + 1];
1869 token = state.push("tr_open", "tr", 1);
1870 token.map = [startLine, startLine + 1];
1871 for (i = 0; i < columns.length; i++) {
1872 token = state.push("th_open", "th", 1);
1874 token.attrs = [["style", "text-align:" + aligns[i]]];
1876 token = state.push("inline", "", 0);
1877 token.content = columns[i].trim();
1878 token.children = [];
1879 token = state.push("th_close", "th", -1);
1881 token = state.push("tr_close", "tr", -1);
1882 token = state.push("thead_close", "thead", -1);
1883 for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {
1884 if (state.sCount[nextLine] < state.blkIndent) {
1888 for (i = 0, l = terminatorRules.length; i < l; i++) {
1889 if (terminatorRules[i](state, nextLine, endLine, true)) {
1897 lineText = getLine2(state, nextLine).trim();
1901 if (state.sCount[nextLine] - state.blkIndent >= 4) {
1904 columns = escapedSplit(lineText);
1905 if (columns.length && columns[0] === "")
1907 if (columns.length && columns[columns.length - 1] === "")
1909 if (nextLine === startLine + 2) {
1910 token = state.push("tbody_open", "tbody", 1);
1911 token.map = tbodyLines = [startLine + 2, 0];
1913 token = state.push("tr_open", "tr", 1);
1914 token.map = [nextLine, nextLine + 1];
1915 for (i = 0; i < columnCount; i++) {
1916 token = state.push("td_open", "td", 1);
1918 token.attrs = [["style", "text-align:" + aligns[i]]];
1920 token = state.push("inline", "", 0);
1921 token.content = columns[i] ? columns[i].trim() : "";
1922 token.children = [];
1923 token = state.push("td_close", "td", -1);
1925 token = state.push("tr_close", "tr", -1);
1928 token = state.push("tbody_close", "tbody", -1);
1929 tbodyLines[1] = nextLine;
1931 token = state.push("table_close", "table", -1);
1932 tableLines[1] = nextLine;
1933 state.parentType = oldParentType;
1934 state.line = nextLine;
1940 // node_modules/markdown-it/lib/rules_block/code.js
1941 var require_code = __commonJS({
1942 "node_modules/markdown-it/lib/rules_block/code.js"(exports, module2) {
1944 module2.exports = function code(state, startLine, endLine) {
1945 var nextLine, last, token;
1946 if (state.sCount[startLine] - state.blkIndent < 4) {
1949 last = nextLine = startLine + 1;
1950 while (nextLine < endLine) {
1951 if (state.isEmpty(nextLine)) {
1955 if (state.sCount[nextLine] - state.blkIndent >= 4) {
1963 token = state.push("code_block", "code", 0);
1964 token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + "\n";
1965 token.map = [startLine, state.line];
1971 // node_modules/markdown-it/lib/rules_block/fence.js
1972 var require_fence = __commonJS({
1973 "node_modules/markdown-it/lib/rules_block/fence.js"(exports, module2) {
1975 module2.exports = function fence(state, startLine, endLine, silent) {
1976 var marker, len, params, nextLine, mem, token, markup, haveEndMarker = false, pos = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine];
1977 if (state.sCount[startLine] - state.blkIndent >= 4) {
1980 if (pos + 3 > max) {
1983 marker = state.src.charCodeAt(pos);
1984 if (marker !== 126 && marker !== 96) {
1988 pos = state.skipChars(pos, marker);
1993 markup = state.src.slice(mem, pos);
1994 params = state.src.slice(pos, max);
1995 if (marker === 96) {
1996 if (params.indexOf(String.fromCharCode(marker)) >= 0) {
2003 nextLine = startLine;
2006 if (nextLine >= endLine) {
2009 pos = mem = state.bMarks[nextLine] + state.tShift[nextLine];
2010 max = state.eMarks[nextLine];
2011 if (pos < max && state.sCount[nextLine] < state.blkIndent) {
2014 if (state.src.charCodeAt(pos) !== marker) {
2017 if (state.sCount[nextLine] - state.blkIndent >= 4) {
2020 pos = state.skipChars(pos, marker);
2021 if (pos - mem < len) {
2024 pos = state.skipSpaces(pos);
2028 haveEndMarker = true;
2031 len = state.sCount[startLine];
2032 state.line = nextLine + (haveEndMarker ? 1 : 0);
2033 token = state.push("fence", "code", 0);
2034 token.info = params;
2035 token.content = state.getLines(startLine + 1, nextLine, len, true);
2036 token.markup = markup;
2037 token.map = [startLine, state.line];
2043 // node_modules/markdown-it/lib/rules_block/blockquote.js
2044 var require_blockquote = __commonJS({
2045 "node_modules/markdown-it/lib/rules_block/blockquote.js"(exports, module2) {
2047 var isSpace = require_utils().isSpace;
2048 module2.exports = function blockquote(state, startLine, endLine, silent) {
2049 var adjustTab, ch, i, initial, l, lastLineEmpty, lines, nextLine, offset, oldBMarks, oldBSCount, oldIndent, oldParentType, oldSCount, oldTShift, spaceAfterMarker, terminate, terminatorRules, token, isOutdented, oldLineMax = state.lineMax, pos = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine];
2050 if (state.sCount[startLine] - state.blkIndent >= 4) {
2053 if (state.src.charCodeAt(pos++) !== 62) {
2059 initial = offset = state.sCount[startLine] + 1;
2060 if (state.src.charCodeAt(pos) === 32) {
2065 spaceAfterMarker = true;
2066 } else if (state.src.charCodeAt(pos) === 9) {
2067 spaceAfterMarker = true;
2068 if ((state.bsCount[startLine] + offset) % 4 === 3) {
2077 spaceAfterMarker = false;
2079 oldBMarks = [state.bMarks[startLine]];
2080 state.bMarks[startLine] = pos;
2082 ch = state.src.charCodeAt(pos);
2085 offset += 4 - (offset + state.bsCount[startLine] + (adjustTab ? 1 : 0)) % 4;
2094 oldBSCount = [state.bsCount[startLine]];
2095 state.bsCount[startLine] = state.sCount[startLine] + 1 + (spaceAfterMarker ? 1 : 0);
2096 lastLineEmpty = pos >= max;
2097 oldSCount = [state.sCount[startLine]];
2098 state.sCount[startLine] = offset - initial;
2099 oldTShift = [state.tShift[startLine]];
2100 state.tShift[startLine] = pos - state.bMarks[startLine];
2101 terminatorRules = state.md.block.ruler.getRules("blockquote");
2102 oldParentType = state.parentType;
2103 state.parentType = "blockquote";
2104 for (nextLine = startLine + 1; nextLine < endLine; nextLine++) {
2105 isOutdented = state.sCount[nextLine] < state.blkIndent;
2106 pos = state.bMarks[nextLine] + state.tShift[nextLine];
2107 max = state.eMarks[nextLine];
2111 if (state.src.charCodeAt(pos++) === 62 && !isOutdented) {
2112 initial = offset = state.sCount[nextLine] + 1;
2113 if (state.src.charCodeAt(pos) === 32) {
2118 spaceAfterMarker = true;
2119 } else if (state.src.charCodeAt(pos) === 9) {
2120 spaceAfterMarker = true;
2121 if ((state.bsCount[nextLine] + offset) % 4 === 3) {
2130 spaceAfterMarker = false;
2132 oldBMarks.push(state.bMarks[nextLine]);
2133 state.bMarks[nextLine] = pos;
2135 ch = state.src.charCodeAt(pos);
2138 offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;
2147 lastLineEmpty = pos >= max;
2148 oldBSCount.push(state.bsCount[nextLine]);
2149 state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0);
2150 oldSCount.push(state.sCount[nextLine]);
2151 state.sCount[nextLine] = offset - initial;
2152 oldTShift.push(state.tShift[nextLine]);
2153 state.tShift[nextLine] = pos - state.bMarks[nextLine];
2156 if (lastLineEmpty) {
2160 for (i = 0, l = terminatorRules.length; i < l; i++) {
2161 if (terminatorRules[i](state, nextLine, endLine, true)) {
2167 state.lineMax = nextLine;
2168 if (state.blkIndent !== 0) {
2169 oldBMarks.push(state.bMarks[nextLine]);
2170 oldBSCount.push(state.bsCount[nextLine]);
2171 oldTShift.push(state.tShift[nextLine]);
2172 oldSCount.push(state.sCount[nextLine]);
2173 state.sCount[nextLine] -= state.blkIndent;
2177 oldBMarks.push(state.bMarks[nextLine]);
2178 oldBSCount.push(state.bsCount[nextLine]);
2179 oldTShift.push(state.tShift[nextLine]);
2180 oldSCount.push(state.sCount[nextLine]);
2181 state.sCount[nextLine] = -1;
2183 oldIndent = state.blkIndent;
2184 state.blkIndent = 0;
2185 token = state.push("blockquote_open", "blockquote", 1);
2187 token.map = lines = [startLine, 0];
2188 state.md.block.tokenize(state, startLine, nextLine);
2189 token = state.push("blockquote_close", "blockquote", -1);
2191 state.lineMax = oldLineMax;
2192 state.parentType = oldParentType;
2193 lines[1] = state.line;
2194 for (i = 0; i < oldTShift.length; i++) {
2195 state.bMarks[i + startLine] = oldBMarks[i];
2196 state.tShift[i + startLine] = oldTShift[i];
2197 state.sCount[i + startLine] = oldSCount[i];
2198 state.bsCount[i + startLine] = oldBSCount[i];
2200 state.blkIndent = oldIndent;
2206 // node_modules/markdown-it/lib/rules_block/hr.js
2207 var require_hr = __commonJS({
2208 "node_modules/markdown-it/lib/rules_block/hr.js"(exports, module2) {
2210 var isSpace = require_utils().isSpace;
2211 module2.exports = function hr(state, startLine, endLine, silent) {
2212 var marker, cnt, ch, token, pos = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine];
2213 if (state.sCount[startLine] - state.blkIndent >= 4) {
2216 marker = state.src.charCodeAt(pos++);
2217 if (marker !== 42 && marker !== 45 && marker !== 95) {
2222 ch = state.src.charCodeAt(pos++);
2223 if (ch !== marker && !isSpace(ch)) {
2226 if (ch === marker) {
2236 state.line = startLine + 1;
2237 token = state.push("hr", "hr", 0);
2238 token.map = [startLine, state.line];
2239 token.markup = Array(cnt + 1).join(String.fromCharCode(marker));
2245 // node_modules/markdown-it/lib/rules_block/list.js
2246 var require_list = __commonJS({
2247 "node_modules/markdown-it/lib/rules_block/list.js"(exports, module2) {
2249 var isSpace = require_utils().isSpace;
2250 function skipBulletListMarker(state, startLine) {
2251 var marker, pos, max, ch;
2252 pos = state.bMarks[startLine] + state.tShift[startLine];
2253 max = state.eMarks[startLine];
2254 marker = state.src.charCodeAt(pos++);
2255 if (marker !== 42 && marker !== 45 && marker !== 43) {
2259 ch = state.src.charCodeAt(pos);
2266 function skipOrderedListMarker(state, startLine) {
2267 var ch, start = state.bMarks[startLine] + state.tShift[startLine], pos = start, max = state.eMarks[startLine];
2268 if (pos + 1 >= max) {
2271 ch = state.src.charCodeAt(pos++);
2272 if (ch < 48 || ch > 57) {
2279 ch = state.src.charCodeAt(pos++);
2280 if (ch >= 48 && ch <= 57) {
2281 if (pos - start >= 10) {
2286 if (ch === 41 || ch === 46) {
2292 ch = state.src.charCodeAt(pos);
2299 function markTightParagraphs(state, idx) {
2300 var i, l, level = state.level + 2;
2301 for (i = idx + 2, l = state.tokens.length - 2; i < l; i++) {
2302 if (state.tokens[i].level === level && state.tokens[i].type === "paragraph_open") {
2303 state.tokens[i + 2].hidden = true;
2304 state.tokens[i].hidden = true;
2309 module2.exports = function list(state, startLine, endLine, silent) {
2310 var ch, contentStart, i, indent, indentAfterMarker, initial, isOrdered, itemLines, l, listLines, listTokIdx, markerCharCode, markerValue, max, nextLine, offset, oldListIndent, oldParentType, oldSCount, oldTShift, oldTight, pos, posAfterMarker, prevEmptyEnd, start, terminate, terminatorRules, token, isTerminatingParagraph = false, tight = true;
2311 if (state.sCount[startLine] - state.blkIndent >= 4) {
2314 if (state.listIndent >= 0 && state.sCount[startLine] - state.listIndent >= 4 && state.sCount[startLine] < state.blkIndent) {
2317 if (silent && state.parentType === "paragraph") {
2318 if (state.tShift[startLine] >= state.blkIndent) {
2319 isTerminatingParagraph = true;
2322 if ((posAfterMarker = skipOrderedListMarker(state, startLine)) >= 0) {
2324 start = state.bMarks[startLine] + state.tShift[startLine];
2325 markerValue = Number(state.src.slice(start, posAfterMarker - 1));
2326 if (isTerminatingParagraph && markerValue !== 1)
2328 } else if ((posAfterMarker = skipBulletListMarker(state, startLine)) >= 0) {
2333 if (isTerminatingParagraph) {
2334 if (state.skipSpaces(posAfterMarker) >= state.eMarks[startLine])
2337 markerCharCode = state.src.charCodeAt(posAfterMarker - 1);
2341 listTokIdx = state.tokens.length;
2343 token = state.push("ordered_list_open", "ol", 1);
2344 if (markerValue !== 1) {
2345 token.attrs = [["start", markerValue]];
2348 token = state.push("bullet_list_open", "ul", 1);
2350 token.map = listLines = [startLine, 0];
2351 token.markup = String.fromCharCode(markerCharCode);
2352 nextLine = startLine;
2353 prevEmptyEnd = false;
2354 terminatorRules = state.md.block.ruler.getRules("list");
2355 oldParentType = state.parentType;
2356 state.parentType = "list";
2357 while (nextLine < endLine) {
2358 pos = posAfterMarker;
2359 max = state.eMarks[nextLine];
2360 initial = offset = state.sCount[nextLine] + posAfterMarker - (state.bMarks[startLine] + state.tShift[startLine]);
2362 ch = state.src.charCodeAt(pos);
2364 offset += 4 - (offset + state.bsCount[nextLine]) % 4;
2365 } else if (ch === 32) {
2373 if (contentStart >= max) {
2374 indentAfterMarker = 1;
2376 indentAfterMarker = offset - initial;
2378 if (indentAfterMarker > 4) {
2379 indentAfterMarker = 1;
2381 indent = initial + indentAfterMarker;
2382 token = state.push("list_item_open", "li", 1);
2383 token.markup = String.fromCharCode(markerCharCode);
2384 token.map = itemLines = [startLine, 0];
2386 token.info = state.src.slice(start, posAfterMarker - 1);
2388 oldTight = state.tight;
2389 oldTShift = state.tShift[startLine];
2390 oldSCount = state.sCount[startLine];
2391 oldListIndent = state.listIndent;
2392 state.listIndent = state.blkIndent;
2393 state.blkIndent = indent;
2395 state.tShift[startLine] = contentStart - state.bMarks[startLine];
2396 state.sCount[startLine] = offset;
2397 if (contentStart >= max && state.isEmpty(startLine + 1)) {
2398 state.line = Math.min(state.line + 2, endLine);
2400 state.md.block.tokenize(state, startLine, endLine, true);
2402 if (!state.tight || prevEmptyEnd) {
2405 prevEmptyEnd = state.line - startLine > 1 && state.isEmpty(state.line - 1);
2406 state.blkIndent = state.listIndent;
2407 state.listIndent = oldListIndent;
2408 state.tShift[startLine] = oldTShift;
2409 state.sCount[startLine] = oldSCount;
2410 state.tight = oldTight;
2411 token = state.push("list_item_close", "li", -1);
2412 token.markup = String.fromCharCode(markerCharCode);
2413 nextLine = startLine = state.line;
2414 itemLines[1] = nextLine;
2415 contentStart = state.bMarks[startLine];
2416 if (nextLine >= endLine) {
2419 if (state.sCount[nextLine] < state.blkIndent) {
2422 if (state.sCount[startLine] - state.blkIndent >= 4) {
2426 for (i = 0, l = terminatorRules.length; i < l; i++) {
2427 if (terminatorRules[i](state, nextLine, endLine, true)) {
2436 posAfterMarker = skipOrderedListMarker(state, nextLine);
2437 if (posAfterMarker < 0) {
2440 start = state.bMarks[nextLine] + state.tShift[nextLine];
2442 posAfterMarker = skipBulletListMarker(state, nextLine);
2443 if (posAfterMarker < 0) {
2447 if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) {
2452 token = state.push("ordered_list_close", "ol", -1);
2454 token = state.push("bullet_list_close", "ul", -1);
2456 token.markup = String.fromCharCode(markerCharCode);
2457 listLines[1] = nextLine;
2458 state.line = nextLine;
2459 state.parentType = oldParentType;
2461 markTightParagraphs(state, listTokIdx);
2468 // node_modules/markdown-it/lib/rules_block/reference.js
2469 var require_reference = __commonJS({
2470 "node_modules/markdown-it/lib/rules_block/reference.js"(exports, module2) {
2472 var normalizeReference = require_utils().normalizeReference;
2473 var isSpace = require_utils().isSpace;
2474 module2.exports = function reference(state, startLine, _endLine, silent) {
2475 var ch, destEndPos, destEndLineNo, endLine, href, i, l, label, labelEnd, oldParentType, res, start, str2, terminate, terminatorRules, title, lines = 0, pos = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine], nextLine = startLine + 1;
2476 if (state.sCount[startLine] - state.blkIndent >= 4) {
2479 if (state.src.charCodeAt(pos) !== 91) {
2482 while (++pos < max) {
2483 if (state.src.charCodeAt(pos) === 93 && state.src.charCodeAt(pos - 1) !== 92) {
2484 if (pos + 1 === max) {
2487 if (state.src.charCodeAt(pos + 1) !== 58) {
2493 endLine = state.lineMax;
2494 terminatorRules = state.md.block.ruler.getRules("reference");
2495 oldParentType = state.parentType;
2496 state.parentType = "reference";
2497 for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
2498 if (state.sCount[nextLine] - state.blkIndent > 3) {
2501 if (state.sCount[nextLine] < 0) {
2505 for (i = 0, l = terminatorRules.length; i < l; i++) {
2506 if (terminatorRules[i](state, nextLine, endLine, true)) {
2515 str2 = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
2517 for (pos = 1; pos < max; pos++) {
2518 ch = str2.charCodeAt(pos);
2521 } else if (ch === 93) {
2524 } else if (ch === 10) {
2526 } else if (ch === 92) {
2528 if (pos < max && str2.charCodeAt(pos) === 10) {
2533 if (labelEnd < 0 || str2.charCodeAt(labelEnd + 1) !== 58) {
2536 for (pos = labelEnd + 2; pos < max; pos++) {
2537 ch = str2.charCodeAt(pos);
2540 } else if (isSpace(ch)) {
2545 res = state.md.helpers.parseLinkDestination(str2, pos, max);
2549 href = state.md.normalizeLink(res.str);
2550 if (!state.md.validateLink(href)) {
2556 destEndLineNo = lines;
2558 for (; pos < max; pos++) {
2559 ch = str2.charCodeAt(pos);
2562 } else if (isSpace(ch)) {
2567 res = state.md.helpers.parseLinkTitle(str2, pos, max);
2568 if (pos < max && start !== pos && res.ok) {
2575 lines = destEndLineNo;
2578 ch = str2.charCodeAt(pos);
2584 if (pos < max && str2.charCodeAt(pos) !== 10) {
2588 lines = destEndLineNo;
2590 ch = str2.charCodeAt(pos);
2598 if (pos < max && str2.charCodeAt(pos) !== 10) {
2601 label = normalizeReference(str2.slice(1, labelEnd));
2608 if (typeof state.env.references === "undefined") {
2609 state.env.references = {};
2611 if (typeof state.env.references[label] === "undefined") {
2612 state.env.references[label] = { title, href };
2614 state.parentType = oldParentType;
2615 state.line = startLine + lines + 1;
2621 // node_modules/markdown-it/lib/common/html_blocks.js
2622 var require_html_blocks = __commonJS({
2623 "node_modules/markdown-it/lib/common/html_blocks.js"(exports, module2) {
2692 // node_modules/markdown-it/lib/common/html_re.js
2693 var require_html_re = __commonJS({
2694 "node_modules/markdown-it/lib/common/html_re.js"(exports, module2) {
2696 var attr_name = "[a-zA-Z_:][a-zA-Z0-9:._-]*";
2697 var unquoted = "[^\"'=<>`\\x00-\\x20]+";
2698 var single_quoted = "'[^']*'";
2699 var double_quoted = '"[^"]*"';
2700 var attr_value = "(?:" + unquoted + "|" + single_quoted + "|" + double_quoted + ")";
2701 var attribute = "(?:\\s+" + attr_name + "(?:\\s*=\\s*" + attr_value + ")?)";
2702 var open_tag = "<[A-Za-z][A-Za-z0-9\\-]*" + attribute + "*\\s*\\/?>";
2703 var close_tag = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>";
2704 var comment = "<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->";
2705 var processing = "<[?][\\s\\S]*?[?]>";
2706 var declaration = "<![A-Z]+\\s+[^>]*>";
2707 var cdata = "<!\\[CDATA\\[[\\s\\S]*?\\]\\]>";
2708 var HTML_TAG_RE = new RegExp("^(?:" + open_tag + "|" + close_tag + "|" + comment + "|" + processing + "|" + declaration + "|" + cdata + ")");
2709 var HTML_OPEN_CLOSE_TAG_RE = new RegExp("^(?:" + open_tag + "|" + close_tag + ")");
2710 module2.exports.HTML_TAG_RE = HTML_TAG_RE;
2711 module2.exports.HTML_OPEN_CLOSE_TAG_RE = HTML_OPEN_CLOSE_TAG_RE;
2715 // node_modules/markdown-it/lib/rules_block/html_block.js
2716 var require_html_block = __commonJS({
2717 "node_modules/markdown-it/lib/rules_block/html_block.js"(exports, module2) {
2719 var block_names = require_html_blocks();
2720 var HTML_OPEN_CLOSE_TAG_RE = require_html_re().HTML_OPEN_CLOSE_TAG_RE;
2721 var HTML_SEQUENCES = [
2722 [/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, true],
2723 [/^<!--/, /-->/, true],
2724 [/^<\?/, /\?>/, true],
2725 [/^<![A-Z]/, />/, true],
2726 [/^<!\[CDATA\[/, /\]\]>/, true],
2727 [new RegExp("^</?(" + block_names.join("|") + ")(?=(\\s|/?>|$))", "i"), /^$/, true],
2728 [new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + "\\s*$"), /^$/, false]
2730 module2.exports = function html_block(state, startLine, endLine, silent) {
2731 var i, nextLine, token, lineText, pos = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine];
2732 if (state.sCount[startLine] - state.blkIndent >= 4) {
2735 if (!state.md.options.html) {
2738 if (state.src.charCodeAt(pos) !== 60) {
2741 lineText = state.src.slice(pos, max);
2742 for (i = 0; i < HTML_SEQUENCES.length; i++) {
2743 if (HTML_SEQUENCES[i][0].test(lineText)) {
2747 if (i === HTML_SEQUENCES.length) {
2751 return HTML_SEQUENCES[i][2];
2753 nextLine = startLine + 1;
2754 if (!HTML_SEQUENCES[i][1].test(lineText)) {
2755 for (; nextLine < endLine; nextLine++) {
2756 if (state.sCount[nextLine] < state.blkIndent) {
2759 pos = state.bMarks[nextLine] + state.tShift[nextLine];
2760 max = state.eMarks[nextLine];
2761 lineText = state.src.slice(pos, max);
2762 if (HTML_SEQUENCES[i][1].test(lineText)) {
2763 if (lineText.length !== 0) {
2770 state.line = nextLine;
2771 token = state.push("html_block", "", 0);
2772 token.map = [startLine, nextLine];
2773 token.content = state.getLines(startLine, nextLine, state.blkIndent, true);
2779 // node_modules/markdown-it/lib/rules_block/heading.js
2780 var require_heading = __commonJS({
2781 "node_modules/markdown-it/lib/rules_block/heading.js"(exports, module2) {
2783 var isSpace = require_utils().isSpace;
2784 module2.exports = function heading(state, startLine, endLine, silent) {
2785 var ch, level, tmp, token, pos = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine];
2786 if (state.sCount[startLine] - state.blkIndent >= 4) {
2789 ch = state.src.charCodeAt(pos);
2790 if (ch !== 35 || pos >= max) {
2794 ch = state.src.charCodeAt(++pos);
2795 while (ch === 35 && pos < max && level <= 6) {
2797 ch = state.src.charCodeAt(++pos);
2799 if (level > 6 || pos < max && !isSpace(ch)) {
2805 max = state.skipSpacesBack(max, pos);
2806 tmp = state.skipCharsBack(max, 35, pos);
2807 if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) {
2810 state.line = startLine + 1;
2811 token = state.push("heading_open", "h" + String(level), 1);
2812 token.markup = "########".slice(0, level);
2813 token.map = [startLine, state.line];
2814 token = state.push("inline", "", 0);
2815 token.content = state.src.slice(pos, max).trim();
2816 token.map = [startLine, state.line];
2817 token.children = [];
2818 token = state.push("heading_close", "h" + String(level), -1);
2819 token.markup = "########".slice(0, level);
2825 // node_modules/markdown-it/lib/rules_block/lheading.js
2826 var require_lheading = __commonJS({
2827 "node_modules/markdown-it/lib/rules_block/lheading.js"(exports, module2) {
2829 module2.exports = function lheading(state, startLine, endLine) {
2830 var content, terminate, i, l, token, pos, max, level, marker, nextLine = startLine + 1, oldParentType, terminatorRules = state.md.block.ruler.getRules("paragraph");
2831 if (state.sCount[startLine] - state.blkIndent >= 4) {
2834 oldParentType = state.parentType;
2835 state.parentType = "paragraph";
2836 for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
2837 if (state.sCount[nextLine] - state.blkIndent > 3) {
2840 if (state.sCount[nextLine] >= state.blkIndent) {
2841 pos = state.bMarks[nextLine] + state.tShift[nextLine];
2842 max = state.eMarks[nextLine];
2844 marker = state.src.charCodeAt(pos);
2845 if (marker === 45 || marker === 61) {
2846 pos = state.skipChars(pos, marker);
2847 pos = state.skipSpaces(pos);
2849 level = marker === 61 ? 1 : 2;
2855 if (state.sCount[nextLine] < 0) {
2859 for (i = 0, l = terminatorRules.length; i < l; i++) {
2860 if (terminatorRules[i](state, nextLine, endLine, true)) {
2872 content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
2873 state.line = nextLine + 1;
2874 token = state.push("heading_open", "h" + String(level), 1);
2875 token.markup = String.fromCharCode(marker);
2876 token.map = [startLine, state.line];
2877 token = state.push("inline", "", 0);
2878 token.content = content;
2879 token.map = [startLine, state.line - 1];
2880 token.children = [];
2881 token = state.push("heading_close", "h" + String(level), -1);
2882 token.markup = String.fromCharCode(marker);
2883 state.parentType = oldParentType;
2889 // node_modules/markdown-it/lib/rules_block/paragraph.js
2890 var require_paragraph = __commonJS({
2891 "node_modules/markdown-it/lib/rules_block/paragraph.js"(exports, module2) {
2893 module2.exports = function paragraph(state, startLine) {
2894 var content, terminate, i, l, token, oldParentType, nextLine = startLine + 1, terminatorRules = state.md.block.ruler.getRules("paragraph"), endLine = state.lineMax;
2895 oldParentType = state.parentType;
2896 state.parentType = "paragraph";
2897 for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
2898 if (state.sCount[nextLine] - state.blkIndent > 3) {
2901 if (state.sCount[nextLine] < 0) {
2905 for (i = 0, l = terminatorRules.length; i < l; i++) {
2906 if (terminatorRules[i](state, nextLine, endLine, true)) {
2915 content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
2916 state.line = nextLine;
2917 token = state.push("paragraph_open", "p", 1);
2918 token.map = [startLine, state.line];
2919 token = state.push("inline", "", 0);
2920 token.content = content;
2921 token.map = [startLine, state.line];
2922 token.children = [];
2923 token = state.push("paragraph_close", "p", -1);
2924 state.parentType = oldParentType;
2930 // node_modules/markdown-it/lib/rules_block/state_block.js
2931 var require_state_block = __commonJS({
2932 "node_modules/markdown-it/lib/rules_block/state_block.js"(exports, module2) {
2934 var Token = require_token();
2935 var isSpace = require_utils().isSpace;
2936 function StateBlock(src, md, env, tokens) {
2937 var ch, s, start, pos, len, indent, offset, indent_found;
2941 this.tokens = tokens;
2952 this.listIndent = -1;
2953 this.parentType = "root";
2957 indent_found = false;
2958 for (start = pos = indent = offset = 0, len = s.length; pos < len; pos++) {
2959 ch = s.charCodeAt(pos);
2960 if (!indent_found) {
2964 offset += 4 - offset % 4;
2970 indent_found = true;
2973 if (ch === 10 || pos === len - 1) {
2977 this.bMarks.push(start);
2978 this.eMarks.push(pos);
2979 this.tShift.push(indent);
2980 this.sCount.push(offset);
2981 this.bsCount.push(0);
2982 indent_found = false;
2988 this.bMarks.push(s.length);
2989 this.eMarks.push(s.length);
2990 this.tShift.push(0);
2991 this.sCount.push(0);
2992 this.bsCount.push(0);
2993 this.lineMax = this.bMarks.length - 1;
2995 StateBlock.prototype.push = function(type2, tag, nesting) {
2996 var token = new Token(type2, tag, nesting);
3000 token.level = this.level;
3003 this.tokens.push(token);
3006 StateBlock.prototype.isEmpty = function isEmpty(line) {
3007 return this.bMarks[line] + this.tShift[line] >= this.eMarks[line];
3009 StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) {
3010 for (var max = this.lineMax; from < max; from++) {
3011 if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) {
3017 StateBlock.prototype.skipSpaces = function skipSpaces(pos) {
3019 for (var max = this.src.length; pos < max; pos++) {
3020 ch = this.src.charCodeAt(pos);
3027 StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) {
3032 if (!isSpace(this.src.charCodeAt(--pos))) {
3038 StateBlock.prototype.skipChars = function skipChars(pos, code) {
3039 for (var max = this.src.length; pos < max; pos++) {
3040 if (this.src.charCodeAt(pos) !== code) {
3046 StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) {
3051 if (code !== this.src.charCodeAt(--pos)) {
3057 StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) {
3058 var i, lineIndent, ch, first, last, queue, lineStart, line = begin;
3062 queue = new Array(end - begin);
3063 for (i = 0; line < end; line++, i++) {
3065 lineStart = first = this.bMarks[line];
3066 if (line + 1 < end || keepLastLF) {
3067 last = this.eMarks[line] + 1;
3069 last = this.eMarks[line];
3071 while (first < last && lineIndent < indent) {
3072 ch = this.src.charCodeAt(first);
3075 lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4;
3079 } else if (first - lineStart < this.tShift[line]) {
3086 if (lineIndent > indent) {
3087 queue[i] = new Array(lineIndent - indent + 1).join(" ") + this.src.slice(first, last);
3089 queue[i] = this.src.slice(first, last);
3092 return queue.join("");
3094 StateBlock.prototype.Token = Token;
3095 module2.exports = StateBlock;
3099 // node_modules/markdown-it/lib/parser_block.js
3100 var require_parser_block = __commonJS({
3101 "node_modules/markdown-it/lib/parser_block.js"(exports, module2) {
3103 var Ruler = require_ruler();
3105 ["table", require_table(), ["paragraph", "reference"]],
3106 ["code", require_code()],
3107 ["fence", require_fence(), ["paragraph", "reference", "blockquote", "list"]],
3108 ["blockquote", require_blockquote(), ["paragraph", "reference", "blockquote", "list"]],
3109 ["hr", require_hr(), ["paragraph", "reference", "blockquote", "list"]],
3110 ["list", require_list(), ["paragraph", "reference", "blockquote"]],
3111 ["reference", require_reference()],
3112 ["html_block", require_html_block(), ["paragraph", "reference", "blockquote"]],
3113 ["heading", require_heading(), ["paragraph", "reference", "blockquote"]],
3114 ["lheading", require_lheading()],
3115 ["paragraph", require_paragraph()]
3117 function ParserBlock() {
3118 this.ruler = new Ruler();
3119 for (var i = 0; i < _rules.length; i++) {
3120 this.ruler.push(_rules[i][0], _rules[i][1], { alt: (_rules[i][2] || []).slice() });
3123 ParserBlock.prototype.tokenize = function(state, startLine, endLine) {
3124 var ok, i, rules = this.ruler.getRules(""), len = rules.length, line = startLine, hasEmptyLines = false, maxNesting = state.md.options.maxNesting;
3125 while (line < endLine) {
3126 state.line = line = state.skipEmptyLines(line);
3127 if (line >= endLine) {
3130 if (state.sCount[line] < state.blkIndent) {
3133 if (state.level >= maxNesting) {
3134 state.line = endLine;
3137 for (i = 0; i < len; i++) {
3138 ok = rules[i](state, line, endLine, false);
3143 state.tight = !hasEmptyLines;
3144 if (state.isEmpty(state.line - 1)) {
3145 hasEmptyLines = true;
3148 if (line < endLine && state.isEmpty(line)) {
3149 hasEmptyLines = true;
3155 ParserBlock.prototype.parse = function(src, md, env, outTokens) {
3160 state = new this.State(src, md, env, outTokens);
3161 this.tokenize(state, state.line, state.lineMax);
3163 ParserBlock.prototype.State = require_state_block();
3164 module2.exports = ParserBlock;
3168 // node_modules/markdown-it/lib/rules_inline/text.js
3169 var require_text = __commonJS({
3170 "node_modules/markdown-it/lib/rules_inline/text.js"(exports, module2) {
3172 function isTerminatorChar(ch) {
3202 module2.exports = function text(state, silent) {
3203 var pos = state.pos;
3204 while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) {
3207 if (pos === state.pos) {
3211 state.pending += state.src.slice(state.pos, pos);
3219 // node_modules/markdown-it/lib/rules_inline/newline.js
3220 var require_newline = __commonJS({
3221 "node_modules/markdown-it/lib/rules_inline/newline.js"(exports, module2) {
3223 var isSpace = require_utils().isSpace;
3224 module2.exports = function newline(state, silent) {
3225 var pmax, max, pos = state.pos;
3226 if (state.src.charCodeAt(pos) !== 10) {
3229 pmax = state.pending.length - 1;
3232 if (pmax >= 0 && state.pending.charCodeAt(pmax) === 32) {
3233 if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 32) {
3234 state.pending = state.pending.replace(/ +$/, "");
3235 state.push("hardbreak", "br", 0);
3237 state.pending = state.pending.slice(0, -1);
3238 state.push("softbreak", "br", 0);
3241 state.push("softbreak", "br", 0);
3245 while (pos < max && isSpace(state.src.charCodeAt(pos))) {
3254 // node_modules/markdown-it/lib/rules_inline/escape.js
3255 var require_escape = __commonJS({
3256 "node_modules/markdown-it/lib/rules_inline/escape.js"(exports, module2) {
3258 var isSpace = require_utils().isSpace;
3260 for (i = 0; i < 256; i++) {
3264 "\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(ch) {
3265 ESCAPED[ch.charCodeAt(0)] = 1;
3267 module2.exports = function escape(state, silent) {
3268 var ch, pos = state.pos, max = state.posMax;
3269 if (state.src.charCodeAt(pos) !== 92) {
3274 ch = state.src.charCodeAt(pos);
3275 if (ch < 256 && ESCAPED[ch] !== 0) {
3277 state.pending += state.src[pos];
3284 state.push("hardbreak", "br", 0);
3288 ch = state.src.charCodeAt(pos);
3299 state.pending += "\\";
3307 // node_modules/markdown-it/lib/rules_inline/backticks.js
3308 var require_backticks = __commonJS({
3309 "node_modules/markdown-it/lib/rules_inline/backticks.js"(exports, module2) {
3311 module2.exports = function backtick(state, silent) {
3312 var start, max, marker, token, matchStart, matchEnd, openerLength, closerLength, pos = state.pos, ch = state.src.charCodeAt(pos);
3319 while (pos < max && state.src.charCodeAt(pos) === 96) {
3322 marker = state.src.slice(start, pos);
3323 openerLength = marker.length;
3324 if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start) {
3326 state.pending += marker;
3327 state.pos += openerLength;
3330 matchStart = matchEnd = pos;
3331 while ((matchStart = state.src.indexOf("`", matchEnd)) !== -1) {
3332 matchEnd = matchStart + 1;
3333 while (matchEnd < max && state.src.charCodeAt(matchEnd) === 96) {
3336 closerLength = matchEnd - matchStart;
3337 if (closerLength === openerLength) {
3339 token = state.push("code_inline", "code", 0);
3340 token.markup = marker;
3341 token.content = state.src.slice(pos, matchStart).replace(/\n/g, " ").replace(/^ (.+) $/, "$1");
3343 state.pos = matchEnd;
3346 state.backticks[closerLength] = matchStart;
3348 state.backticksScanned = true;
3350 state.pending += marker;
3351 state.pos += openerLength;
3357 // node_modules/markdown-it/lib/rules_inline/strikethrough.js
3358 var require_strikethrough = __commonJS({
3359 "node_modules/markdown-it/lib/rules_inline/strikethrough.js"(exports, module2) {
3361 module2.exports.tokenize = function strikethrough(state, silent) {
3362 var i, scanned, token, len, ch, start = state.pos, marker = state.src.charCodeAt(start);
3366 if (marker !== 126) {
3369 scanned = state.scanDelims(state.pos, true);
3370 len = scanned.length;
3371 ch = String.fromCharCode(marker);
3376 token = state.push("text", "", 0);
3380 for (i = 0; i < len; i += 2) {
3381 token = state.push("text", "", 0);
3382 token.content = ch + ch;
3383 state.delimiters.push({
3387 token: state.tokens.length - 1,
3389 open: scanned.can_open,
3390 close: scanned.can_close
3393 state.pos += scanned.length;
3396 function postProcess(state, delimiters) {
3397 var i, j, startDelim, endDelim, token, loneMarkers = [], max = delimiters.length;
3398 for (i = 0; i < max; i++) {
3399 startDelim = delimiters[i];
3400 if (startDelim.marker !== 126) {
3403 if (startDelim.end === -1) {
3406 endDelim = delimiters[startDelim.end];
3407 token = state.tokens[startDelim.token];
3408 token.type = "s_open";
3411 token.markup = "~~";
3413 token = state.tokens[endDelim.token];
3414 token.type = "s_close";
3417 token.markup = "~~";
3419 if (state.tokens[endDelim.token - 1].type === "text" && state.tokens[endDelim.token - 1].content === "~") {
3420 loneMarkers.push(endDelim.token - 1);
3423 while (loneMarkers.length) {
3424 i = loneMarkers.pop();
3426 while (j < state.tokens.length && state.tokens[j].type === "s_close") {
3431 token = state.tokens[j];
3432 state.tokens[j] = state.tokens[i];
3433 state.tokens[i] = token;
3437 module2.exports.postProcess = function strikethrough(state) {
3438 var curr, tokens_meta = state.tokens_meta, max = state.tokens_meta.length;
3439 postProcess(state, state.delimiters);
3440 for (curr = 0; curr < max; curr++) {
3441 if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
3442 postProcess(state, tokens_meta[curr].delimiters);
3449 // node_modules/markdown-it/lib/rules_inline/emphasis.js
3450 var require_emphasis = __commonJS({
3451 "node_modules/markdown-it/lib/rules_inline/emphasis.js"(exports, module2) {
3453 module2.exports.tokenize = function emphasis(state, silent) {
3454 var i, scanned, token, start = state.pos, marker = state.src.charCodeAt(start);
3458 if (marker !== 95 && marker !== 42) {
3461 scanned = state.scanDelims(state.pos, marker === 42);
3462 for (i = 0; i < scanned.length; i++) {
3463 token = state.push("text", "", 0);
3464 token.content = String.fromCharCode(marker);
3465 state.delimiters.push({
3467 length: scanned.length,
3469 token: state.tokens.length - 1,
3471 open: scanned.can_open,
3472 close: scanned.can_close
3475 state.pos += scanned.length;
3478 function postProcess(state, delimiters) {
3479 var i, startDelim, endDelim, token, ch, isStrong, max = delimiters.length;
3480 for (i = max - 1; i >= 0; i--) {
3481 startDelim = delimiters[i];
3482 if (startDelim.marker !== 95 && startDelim.marker !== 42) {
3485 if (startDelim.end === -1) {
3488 endDelim = delimiters[startDelim.end];
3489 isStrong = i > 0 && delimiters[i - 1].end === startDelim.end + 1 && delimiters[i - 1].token === startDelim.token - 1 && delimiters[startDelim.end + 1].token === endDelim.token + 1 && delimiters[i - 1].marker === startDelim.marker;
3490 ch = String.fromCharCode(startDelim.marker);
3491 token = state.tokens[startDelim.token];
3492 token.type = isStrong ? "strong_open" : "em_open";
3493 token.tag = isStrong ? "strong" : "em";
3495 token.markup = isStrong ? ch + ch : ch;
3497 token = state.tokens[endDelim.token];
3498 token.type = isStrong ? "strong_close" : "em_close";
3499 token.tag = isStrong ? "strong" : "em";
3501 token.markup = isStrong ? ch + ch : ch;
3504 state.tokens[delimiters[i - 1].token].content = "";
3505 state.tokens[delimiters[startDelim.end + 1].token].content = "";
3510 module2.exports.postProcess = function emphasis(state) {
3511 var curr, tokens_meta = state.tokens_meta, max = state.tokens_meta.length;
3512 postProcess(state, state.delimiters);
3513 for (curr = 0; curr < max; curr++) {
3514 if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
3515 postProcess(state, tokens_meta[curr].delimiters);
3522 // node_modules/markdown-it/lib/rules_inline/link.js
3523 var require_link = __commonJS({
3524 "node_modules/markdown-it/lib/rules_inline/link.js"(exports, module2) {
3526 var normalizeReference = require_utils().normalizeReference;
3527 var isSpace = require_utils().isSpace;
3528 module2.exports = function link(state, silent) {
3529 var attrs, code, label, labelEnd, labelStart, pos, res, ref, token, href = "", title = "", oldPos = state.pos, max = state.posMax, start = state.pos, parseReference = true;
3530 if (state.src.charCodeAt(state.pos) !== 91) {
3533 labelStart = state.pos + 1;
3534 labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true);
3539 if (pos < max && state.src.charCodeAt(pos) === 40) {
3540 parseReference = false;
3542 for (; pos < max; pos++) {
3543 code = state.src.charCodeAt(pos);
3544 if (!isSpace(code) && code !== 10) {
3552 res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
3554 href = state.md.normalizeLink(res.str);
3555 if (state.md.validateLink(href)) {
3561 for (; pos < max; pos++) {
3562 code = state.src.charCodeAt(pos);
3563 if (!isSpace(code) && code !== 10) {
3567 res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
3568 if (pos < max && start !== pos && res.ok) {
3571 for (; pos < max; pos++) {
3572 code = state.src.charCodeAt(pos);
3573 if (!isSpace(code) && code !== 10) {
3579 if (pos >= max || state.src.charCodeAt(pos) !== 41) {
3580 parseReference = true;
3584 if (parseReference) {
3585 if (typeof state.env.references === "undefined") {
3588 if (pos < max && state.src.charCodeAt(pos) === 91) {
3590 pos = state.md.helpers.parseLinkLabel(state, pos);
3592 label = state.src.slice(start, pos++);
3600 label = state.src.slice(labelStart, labelEnd);
3602 ref = state.env.references[normalizeReference(label)];
3611 state.pos = labelStart;
3612 state.posMax = labelEnd;
3613 token = state.push("link_open", "a", 1);
3614 token.attrs = attrs = [["href", href]];
3616 attrs.push(["title", title]);
3618 state.md.inline.tokenize(state);
3619 token = state.push("link_close", "a", -1);
3628 // node_modules/markdown-it/lib/rules_inline/image.js
3629 var require_image = __commonJS({
3630 "node_modules/markdown-it/lib/rules_inline/image.js"(exports, module2) {
3632 var normalizeReference = require_utils().normalizeReference;
3633 var isSpace = require_utils().isSpace;
3634 module2.exports = function image(state, silent) {
3635 var attrs, code, content, label, labelEnd, labelStart, pos, ref, res, title, token, tokens, start, href = "", oldPos = state.pos, max = state.posMax;
3636 if (state.src.charCodeAt(state.pos) !== 33) {
3639 if (state.src.charCodeAt(state.pos + 1) !== 91) {
3642 labelStart = state.pos + 2;
3643 labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false);
3648 if (pos < max && state.src.charCodeAt(pos) === 40) {
3650 for (; pos < max; pos++) {
3651 code = state.src.charCodeAt(pos);
3652 if (!isSpace(code) && code !== 10) {
3660 res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
3662 href = state.md.normalizeLink(res.str);
3663 if (state.md.validateLink(href)) {
3670 for (; pos < max; pos++) {
3671 code = state.src.charCodeAt(pos);
3672 if (!isSpace(code) && code !== 10) {
3676 res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
3677 if (pos < max && start !== pos && res.ok) {
3680 for (; pos < max; pos++) {
3681 code = state.src.charCodeAt(pos);
3682 if (!isSpace(code) && code !== 10) {
3689 if (pos >= max || state.src.charCodeAt(pos) !== 41) {
3695 if (typeof state.env.references === "undefined") {
3698 if (pos < max && state.src.charCodeAt(pos) === 91) {
3700 pos = state.md.helpers.parseLinkLabel(state, pos);
3702 label = state.src.slice(start, pos++);
3710 label = state.src.slice(labelStart, labelEnd);
3712 ref = state.env.references[normalizeReference(label)];
3721 content = state.src.slice(labelStart, labelEnd);
3722 state.md.inline.parse(content, state.md, state.env, tokens = []);
3723 token = state.push("image", "img", 0);
3724 token.attrs = attrs = [["src", href], ["alt", ""]];
3725 token.children = tokens;
3726 token.content = content;
3728 attrs.push(["title", title]);
3738 // node_modules/markdown-it/lib/rules_inline/autolink.js
3739 var require_autolink = __commonJS({
3740 "node_modules/markdown-it/lib/rules_inline/autolink.js"(exports, module2) {
3742 var EMAIL_RE = /^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/;
3743 var AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/;
3744 module2.exports = function autolink(state, silent) {
3745 var url, fullUrl, token, ch, start, max, pos = state.pos;
3746 if (state.src.charCodeAt(pos) !== 60) {
3754 ch = state.src.charCodeAt(pos);
3760 url = state.src.slice(start + 1, pos);
3761 if (AUTOLINK_RE.test(url)) {
3762 fullUrl = state.md.normalizeLink(url);
3763 if (!state.md.validateLink(fullUrl)) {
3767 token = state.push("link_open", "a", 1);
3768 token.attrs = [["href", fullUrl]];
3769 token.markup = "autolink";
3770 token.info = "auto";
3771 token = state.push("text", "", 0);
3772 token.content = state.md.normalizeLinkText(url);
3773 token = state.push("link_close", "a", -1);
3774 token.markup = "autolink";
3775 token.info = "auto";
3777 state.pos += url.length + 2;
3780 if (EMAIL_RE.test(url)) {
3781 fullUrl = state.md.normalizeLink("mailto:" + url);
3782 if (!state.md.validateLink(fullUrl)) {
3786 token = state.push("link_open", "a", 1);
3787 token.attrs = [["href", fullUrl]];
3788 token.markup = "autolink";
3789 token.info = "auto";
3790 token = state.push("text", "", 0);
3791 token.content = state.md.normalizeLinkText(url);
3792 token = state.push("link_close", "a", -1);
3793 token.markup = "autolink";
3794 token.info = "auto";
3796 state.pos += url.length + 2;
3804 // node_modules/markdown-it/lib/rules_inline/html_inline.js
3805 var require_html_inline = __commonJS({
3806 "node_modules/markdown-it/lib/rules_inline/html_inline.js"(exports, module2) {
3808 var HTML_TAG_RE = require_html_re().HTML_TAG_RE;
3809 function isLetter(ch) {
3811 return lc >= 97 && lc <= 122;
3813 module2.exports = function html_inline(state, silent) {
3814 var ch, match, max, token, pos = state.pos;
3815 if (!state.md.options.html) {
3819 if (state.src.charCodeAt(pos) !== 60 || pos + 2 >= max) {
3822 ch = state.src.charCodeAt(pos + 1);
3823 if (ch !== 33 && ch !== 63 && ch !== 47 && !isLetter(ch)) {
3826 match = state.src.slice(pos).match(HTML_TAG_RE);
3831 token = state.push("html_inline", "", 0);
3832 token.content = state.src.slice(pos, pos + match[0].length);
3834 state.pos += match[0].length;
3840 // node_modules/markdown-it/lib/rules_inline/entity.js
3841 var require_entity = __commonJS({
3842 "node_modules/markdown-it/lib/rules_inline/entity.js"(exports, module2) {
3844 var entities = require_entities2();
3845 var has = require_utils().has;
3846 var isValidEntityCode = require_utils().isValidEntityCode;
3847 var fromCodePoint = require_utils().fromCodePoint;
3848 var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i;
3849 var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;
3850 module2.exports = function entity(state, silent) {
3851 var ch, code, match, pos = state.pos, max = state.posMax;
3852 if (state.src.charCodeAt(pos) !== 38) {
3855 if (pos + 1 < max) {
3856 ch = state.src.charCodeAt(pos + 1);
3858 match = state.src.slice(pos).match(DIGITAL_RE);
3861 code = match[1][0].toLowerCase() === "x" ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10);
3862 state.pending += isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(65533);
3864 state.pos += match[0].length;
3868 match = state.src.slice(pos).match(NAMED_RE);
3870 if (has(entities, match[1])) {
3872 state.pending += entities[match[1]];
3874 state.pos += match[0].length;
3881 state.pending += "&";
3889 // node_modules/markdown-it/lib/rules_inline/balance_pairs.js
3890 var require_balance_pairs = __commonJS({
3891 "node_modules/markdown-it/lib/rules_inline/balance_pairs.js"(exports, module2) {
3893 function processDelimiters(state, delimiters) {
3894 var closerIdx, openerIdx, closer, opener, minOpenerIdx, newMinOpenerIdx, isOddMatch, lastJump, openersBottom = {}, max = delimiters.length;
3895 for (closerIdx = 0; closerIdx < max; closerIdx++) {
3896 closer = delimiters[closerIdx];
3897 closer.length = closer.length || 0;
3900 if (!openersBottom.hasOwnProperty(closer.marker)) {
3901 openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1];
3903 minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + closer.length % 3];
3904 openerIdx = closerIdx - closer.jump - 1;
3907 newMinOpenerIdx = openerIdx;
3908 for (; openerIdx > minOpenerIdx; openerIdx -= opener.jump + 1) {
3909 opener = delimiters[openerIdx];
3910 if (opener.marker !== closer.marker)
3912 if (opener.open && opener.end < 0) {
3914 if (opener.close || closer.open) {
3915 if ((opener.length + closer.length) % 3 === 0) {
3916 if (opener.length % 3 !== 0 || closer.length % 3 !== 0) {
3922 lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ? delimiters[openerIdx - 1].jump + 1 : 0;
3923 closer.jump = closerIdx - openerIdx + lastJump;
3924 closer.open = false;
3925 opener.end = closerIdx;
3926 opener.jump = lastJump;
3927 opener.close = false;
3928 newMinOpenerIdx = -1;
3933 if (newMinOpenerIdx !== -1) {
3934 openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length || 0) % 3] = newMinOpenerIdx;
3938 module2.exports = function link_pairs(state) {
3939 var curr, tokens_meta = state.tokens_meta, max = state.tokens_meta.length;
3940 processDelimiters(state, state.delimiters);
3941 for (curr = 0; curr < max; curr++) {
3942 if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
3943 processDelimiters(state, tokens_meta[curr].delimiters);
3950 // node_modules/markdown-it/lib/rules_inline/text_collapse.js
3951 var require_text_collapse = __commonJS({
3952 "node_modules/markdown-it/lib/rules_inline/text_collapse.js"(exports, module2) {
3954 module2.exports = function text_collapse(state) {
3955 var curr, last, level = 0, tokens = state.tokens, max = state.tokens.length;
3956 for (curr = last = 0; curr < max; curr++) {
3957 if (tokens[curr].nesting < 0)
3959 tokens[curr].level = level;
3960 if (tokens[curr].nesting > 0)
3962 if (tokens[curr].type === "text" && curr + 1 < max && tokens[curr + 1].type === "text") {
3963 tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
3965 if (curr !== last) {
3966 tokens[last] = tokens[curr];
3971 if (curr !== last) {
3972 tokens.length = last;
3978 // node_modules/markdown-it/lib/rules_inline/state_inline.js
3979 var require_state_inline = __commonJS({
3980 "node_modules/markdown-it/lib/rules_inline/state_inline.js"(exports, module2) {
3982 var Token = require_token();
3983 var isWhiteSpace = require_utils().isWhiteSpace;
3984 var isPunctChar = require_utils().isPunctChar;
3985 var isMdAsciiPunct = require_utils().isMdAsciiPunct;
3986 function StateInline(src, md, env, outTokens) {
3990 this.tokens = outTokens;
3991 this.tokens_meta = Array(outTokens.length);
3993 this.posMax = this.src.length;
3996 this.pendingLevel = 0;
3998 this.delimiters = [];
3999 this._prev_delimiters = [];
4000 this.backticks = {};
4001 this.backticksScanned = false;
4003 StateInline.prototype.pushPending = function() {
4004 var token = new Token("text", "", 0);
4005 token.content = this.pending;
4006 token.level = this.pendingLevel;
4007 this.tokens.push(token);
4011 StateInline.prototype.push = function(type2, tag, nesting) {
4015 var token = new Token(type2, tag, nesting);
4016 var token_meta = null;
4019 this.delimiters = this._prev_delimiters.pop();
4021 token.level = this.level;
4024 this._prev_delimiters.push(this.delimiters);
4025 this.delimiters = [];
4026 token_meta = { delimiters: this.delimiters };
4028 this.pendingLevel = this.level;
4029 this.tokens.push(token);
4030 this.tokens_meta.push(token_meta);
4033 StateInline.prototype.scanDelims = function(start, canSplitWord) {
4034 var pos = start, lastChar, nextChar, count, can_open, can_close, isLastWhiteSpace, isLastPunctChar, isNextWhiteSpace, isNextPunctChar, left_flanking = true, right_flanking = true, max = this.posMax, marker = this.src.charCodeAt(start);
4035 lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 32;
4036 while (pos < max && this.src.charCodeAt(pos) === marker) {
4039 count = pos - start;
4040 nextChar = pos < max ? this.src.charCodeAt(pos) : 32;
4041 isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
4042 isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
4043 isLastWhiteSpace = isWhiteSpace(lastChar);
4044 isNextWhiteSpace = isWhiteSpace(nextChar);
4045 if (isNextWhiteSpace) {
4046 left_flanking = false;
4047 } else if (isNextPunctChar) {
4048 if (!(isLastWhiteSpace || isLastPunctChar)) {
4049 left_flanking = false;
4052 if (isLastWhiteSpace) {
4053 right_flanking = false;
4054 } else if (isLastPunctChar) {
4055 if (!(isNextWhiteSpace || isNextPunctChar)) {
4056 right_flanking = false;
4059 if (!canSplitWord) {
4060 can_open = left_flanking && (!right_flanking || isLastPunctChar);
4061 can_close = right_flanking && (!left_flanking || isNextPunctChar);
4063 can_open = left_flanking;
4064 can_close = right_flanking;
4072 StateInline.prototype.Token = Token;
4073 module2.exports = StateInline;
4077 // node_modules/markdown-it/lib/parser_inline.js
4078 var require_parser_inline = __commonJS({
4079 "node_modules/markdown-it/lib/parser_inline.js"(exports, module2) {
4081 var Ruler = require_ruler();
4083 ["text", require_text()],
4084 ["newline", require_newline()],
4085 ["escape", require_escape()],
4086 ["backticks", require_backticks()],
4087 ["strikethrough", require_strikethrough().tokenize],
4088 ["emphasis", require_emphasis().tokenize],
4089 ["link", require_link()],
4090 ["image", require_image()],
4091 ["autolink", require_autolink()],
4092 ["html_inline", require_html_inline()],
4093 ["entity", require_entity()]
4096 ["balance_pairs", require_balance_pairs()],
4097 ["strikethrough", require_strikethrough().postProcess],
4098 ["emphasis", require_emphasis().postProcess],
4099 ["text_collapse", require_text_collapse()]
4101 function ParserInline() {
4103 this.ruler = new Ruler();
4104 for (i = 0; i < _rules.length; i++) {
4105 this.ruler.push(_rules[i][0], _rules[i][1]);
4107 this.ruler2 = new Ruler();
4108 for (i = 0; i < _rules2.length; i++) {
4109 this.ruler2.push(_rules2[i][0], _rules2[i][1]);
4112 ParserInline.prototype.skipToken = function(state) {
4113 var ok, i, pos = state.pos, rules = this.ruler.getRules(""), len = rules.length, maxNesting = state.md.options.maxNesting, cache = state.cache;
4114 if (typeof cache[pos] !== "undefined") {
4115 state.pos = cache[pos];
4118 if (state.level < maxNesting) {
4119 for (i = 0; i < len; i++) {
4121 ok = rules[i](state, true);
4128 state.pos = state.posMax;
4133 cache[pos] = state.pos;
4135 ParserInline.prototype.tokenize = function(state) {
4136 var ok, i, rules = this.ruler.getRules(""), len = rules.length, end = state.posMax, maxNesting = state.md.options.maxNesting;
4137 while (state.pos < end) {
4138 if (state.level < maxNesting) {
4139 for (i = 0; i < len; i++) {
4140 ok = rules[i](state, false);
4147 if (state.pos >= end) {
4152 state.pending += state.src[state.pos++];
4154 if (state.pending) {
4155 state.pushPending();
4158 ParserInline.prototype.parse = function(str2, md, env, outTokens) {
4160 var state = new this.State(str2, md, env, outTokens);
4161 this.tokenize(state);
4162 rules = this.ruler2.getRules("");
4164 for (i = 0; i < len; i++) {
4168 ParserInline.prototype.State = require_state_inline();
4169 module2.exports = ParserInline;
4173 // node_modules/linkify-it/lib/re.js
4174 var require_re = __commonJS({
4175 "node_modules/linkify-it/lib/re.js"(exports, module2) {
4177 module2.exports = function(opts) {
4179 re.src_Any = require_regex2().source;
4180 re.src_Cc = require_regex3().source;
4181 re.src_Z = require_regex5().source;
4182 re.src_P = require_regex().source;
4183 re.src_ZPCc = [re.src_Z, re.src_P, re.src_Cc].join("|");
4184 re.src_ZCc = [re.src_Z, re.src_Cc].join("|");
4185 var text_separators = "[><\uFF5C]";
4186 re.src_pseudo_letter = "(?:(?!" + text_separators + "|" + re.src_ZPCc + ")" + re.src_Any + ")";
4187 re.src_ip4 = "(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)";
4188 re.src_auth = "(?:(?:(?!" + re.src_ZCc + "|[@/\\[\\]()]).)+@)?";
4189 re.src_port = "(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?";
4190 re.src_host_terminator = "(?=$|" + text_separators + "|" + re.src_ZPCc + ")(?!-|_|:\\d|\\.-|\\.(?!$|" + re.src_ZPCc + "))";
4191 re.src_path = "(?:[/?#](?:(?!" + re.src_ZCc + "|" + text_separators + `|[()[\\]{}.,"'?!\\-]).|\\[(?:(?!` + re.src_ZCc + "|\\]).)*\\]|\\((?:(?!" + re.src_ZCc + "|[)]).)*\\)|\\{(?:(?!" + re.src_ZCc + '|[}]).)*\\}|\\"(?:(?!' + re.src_ZCc + `|["]).)+\\"|\\'(?:(?!` + re.src_ZCc + "|[']).)+\\'|\\'(?=" + re.src_pseudo_letter + "|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!" + re.src_ZCc + "|[.]).|" + (opts && opts["---"] ? "\\-(?!--(?:[^-]|$))(?:-*)|" : "\\-+|") + "\\,(?!" + re.src_ZCc + ").|\\!+(?!" + re.src_ZCc + "|[!]).|\\?(?!" + re.src_ZCc + "|[?]).)+|\\/)?";
4192 re.src_email_name = '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*';
4193 re.src_xn = "xn--[a-z0-9\\-]{1,59}";
4194 re.src_domain_root = "(?:" + re.src_xn + "|" + re.src_pseudo_letter + "{1,63})";
4195 re.src_domain = "(?:" + re.src_xn + "|(?:" + re.src_pseudo_letter + ")|(?:" + re.src_pseudo_letter + "(?:-|" + re.src_pseudo_letter + "){0,61}" + re.src_pseudo_letter + "))";
4196 re.src_host = "(?:(?:(?:(?:" + re.src_domain + ")\\.)*" + re.src_domain + "))";
4197 re.tpl_host_fuzzy = "(?:" + re.src_ip4 + "|(?:(?:(?:" + re.src_domain + ")\\.)+(?:%TLDS%)))";
4198 re.tpl_host_no_ip_fuzzy = "(?:(?:(?:" + re.src_domain + ")\\.)+(?:%TLDS%))";
4199 re.src_host_strict = re.src_host + re.src_host_terminator;
4200 re.tpl_host_fuzzy_strict = re.tpl_host_fuzzy + re.src_host_terminator;
4201 re.src_host_port_strict = re.src_host + re.src_port + re.src_host_terminator;
4202 re.tpl_host_port_fuzzy_strict = re.tpl_host_fuzzy + re.src_port + re.src_host_terminator;
4203 re.tpl_host_port_no_ip_fuzzy_strict = re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator;
4204 re.tpl_host_fuzzy_test = "localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:" + re.src_ZPCc + "|>|$))";
4205 re.tpl_email_fuzzy = "(^|" + text_separators + '|"|\\(|' + re.src_ZCc + ")(" + re.src_email_name + "@" + re.tpl_host_fuzzy_strict + ")";
4206 re.tpl_link_fuzzy = "(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|" + re.src_ZPCc + "))((?![$+<=>^`|\uFF5C])" + re.tpl_host_port_fuzzy_strict + re.src_path + ")";
4207 re.tpl_link_no_ip_fuzzy = "(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|" + re.src_ZPCc + "))((?![$+<=>^`|\uFF5C])" + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ")";
4213 // node_modules/linkify-it/index.js
4214 var require_linkify_it = __commonJS({
4215 "node_modules/linkify-it/index.js"(exports, module2) {
4217 function assign(obj) {
4218 var sources = Array.prototype.slice.call(arguments, 1);
4219 sources.forEach(function(source) {
4223 Object.keys(source).forEach(function(key) {
4224 obj[key] = source[key];
4229 function _class2(obj) {
4230 return Object.prototype.toString.call(obj);
4232 function isString(obj) {
4233 return _class2(obj) === "[object String]";
4235 function isObject2(obj) {
4236 return _class2(obj) === "[object Object]";
4238 function isRegExp(obj) {
4239 return _class2(obj) === "[object RegExp]";
4241 function isFunction(obj) {
4242 return _class2(obj) === "[object Function]";
4244 function escapeRE(str2) {
4245 return str2.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
4247 var defaultOptions = {
4252 function isOptionsObj(obj) {
4253 return Object.keys(obj || {}).reduce(function(acc, k) {
4254 return acc || defaultOptions.hasOwnProperty(k);
4257 var defaultSchemas = {
4259 validate: function(text, pos, self) {
4260 var tail = text.slice(pos);
4261 if (!self.re.http) {
4262 self.re.http = new RegExp("^\\/\\/" + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, "i");
4264 if (self.re.http.test(tail)) {
4265 return tail.match(self.re.http)[0].length;
4273 validate: function(text, pos, self) {
4274 var tail = text.slice(pos);
4275 if (!self.re.no_http) {
4276 self.re.no_http = new RegExp("^" + self.re.src_auth + "(?:localhost|(?:(?:" + self.re.src_domain + ")\\.)+" + self.re.src_domain_root + ")" + self.re.src_port + self.re.src_host_terminator + self.re.src_path, "i");
4278 if (self.re.no_http.test(tail)) {
4279 if (pos >= 3 && text[pos - 3] === ":") {
4282 if (pos >= 3 && text[pos - 3] === "/") {
4285 return tail.match(self.re.no_http)[0].length;
4291 validate: function(text, pos, self) {
4292 var tail = text.slice(pos);
4293 if (!self.re.mailto) {
4294 self.re.mailto = new RegExp("^" + self.re.src_email_name + "@" + self.re.src_host_strict, "i");
4296 if (self.re.mailto.test(tail)) {
4297 return tail.match(self.re.mailto)[0].length;
4303 var tlds_2ch_src_re = "a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]";
4304 var tlds_default = "biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");
4305 function resetScanCache(self) {
4306 self.__index__ = -1;
4307 self.__text_cache__ = "";
4309 function createValidator(re) {
4310 return function(text, pos) {
4311 var tail = text.slice(pos);
4312 if (re.test(tail)) {
4313 return tail.match(re)[0].length;
4318 function createNormalizer() {
4319 return function(match, self) {
4320 self.normalize(match);
4323 function compile(self) {
4324 var re = self.re = require_re()(self.__opts__);
4325 var tlds = self.__tlds__.slice();
4327 if (!self.__tlds_replaced__) {
4328 tlds.push(tlds_2ch_src_re);
4330 tlds.push(re.src_xn);
4331 re.src_tlds = tlds.join("|");
4332 function untpl(tpl) {
4333 return tpl.replace("%TLDS%", re.src_tlds);
4335 re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), "i");
4336 re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), "i");
4337 re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), "i");
4338 re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), "i");
4340 self.__compiled__ = {};
4341 function schemaError(name, val) {
4342 throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val);
4344 Object.keys(self.__schemas__).forEach(function(name) {
4345 var val = self.__schemas__[name];
4349 var compiled = { validate: null, link: null };
4350 self.__compiled__[name] = compiled;
4351 if (isObject2(val)) {
4352 if (isRegExp(val.validate)) {
4353 compiled.validate = createValidator(val.validate);
4354 } else if (isFunction(val.validate)) {
4355 compiled.validate = val.validate;
4357 schemaError(name, val);
4359 if (isFunction(val.normalize)) {
4360 compiled.normalize = val.normalize;
4361 } else if (!val.normalize) {
4362 compiled.normalize = createNormalizer();
4364 schemaError(name, val);
4368 if (isString(val)) {
4372 schemaError(name, val);
4374 aliases.forEach(function(alias) {
4375 if (!self.__compiled__[self.__schemas__[alias]]) {
4378 self.__compiled__[alias].validate = self.__compiled__[self.__schemas__[alias]].validate;
4379 self.__compiled__[alias].normalize = self.__compiled__[self.__schemas__[alias]].normalize;
4381 self.__compiled__[""] = { validate: null, normalize: createNormalizer() };
4382 var slist = Object.keys(self.__compiled__).filter(function(name) {
4383 return name.length > 0 && self.__compiled__[name];
4384 }).map(escapeRE).join("|");
4385 self.re.schema_test = RegExp("(^|(?!_)(?:[><\uFF5C]|" + re.src_ZPCc + "))(" + slist + ")", "i");
4386 self.re.schema_search = RegExp("(^|(?!_)(?:[><\uFF5C]|" + re.src_ZPCc + "))(" + slist + ")", "ig");
4387 self.re.pretest = RegExp("(" + self.re.schema_test.source + ")|(" + self.re.host_fuzzy_test.source + ")|@", "i");
4388 resetScanCache(self);
4390 function Match(self, shift) {
4391 var start = self.__index__, end = self.__last_index__, text = self.__text_cache__.slice(start, end);
4392 this.schema = self.__schema__.toLowerCase();
4393 this.index = start + shift;
4394 this.lastIndex = end + shift;
4399 function createMatch(self, shift) {
4400 var match = new Match(self, shift);
4401 self.__compiled__[match.schema].normalize(match, self);
4404 function LinkifyIt(schemas, options) {
4405 if (!(this instanceof LinkifyIt)) {
4406 return new LinkifyIt(schemas, options);
4409 if (isOptionsObj(schemas)) {
4414 this.__opts__ = assign({}, defaultOptions, options);
4415 this.__index__ = -1;
4416 this.__last_index__ = -1;
4417 this.__schema__ = "";
4418 this.__text_cache__ = "";
4419 this.__schemas__ = assign({}, defaultSchemas, schemas);
4420 this.__compiled__ = {};
4421 this.__tlds__ = tlds_default;
4422 this.__tlds_replaced__ = false;
4426 LinkifyIt.prototype.add = function add(schema2, definition) {
4427 this.__schemas__[schema2] = definition;
4431 LinkifyIt.prototype.set = function set2(options) {
4432 this.__opts__ = assign(this.__opts__, options);
4435 LinkifyIt.prototype.test = function test(text) {
4436 this.__text_cache__ = text;
4437 this.__index__ = -1;
4441 var m, ml, me, len, shift, next, re, tld_pos, at_pos;
4442 if (this.re.schema_test.test(text)) {
4443 re = this.re.schema_search;
4445 while ((m = re.exec(text)) !== null) {
4446 len = this.testSchemaAt(text, m[2], re.lastIndex);
4448 this.__schema__ = m[2];
4449 this.__index__ = m.index + m[1].length;
4450 this.__last_index__ = m.index + m[0].length + len;
4455 if (this.__opts__.fuzzyLink && this.__compiled__["http:"]) {
4456 tld_pos = text.search(this.re.host_fuzzy_test);
4458 if (this.__index__ < 0 || tld_pos < this.__index__) {
4459 if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {
4460 shift = ml.index + ml[1].length;
4461 if (this.__index__ < 0 || shift < this.__index__) {
4462 this.__schema__ = "";
4463 this.__index__ = shift;
4464 this.__last_index__ = ml.index + ml[0].length;
4470 if (this.__opts__.fuzzyEmail && this.__compiled__["mailto:"]) {
4471 at_pos = text.indexOf("@");
4473 if ((me = text.match(this.re.email_fuzzy)) !== null) {
4474 shift = me.index + me[1].length;
4475 next = me.index + me[0].length;
4476 if (this.__index__ < 0 || shift < this.__index__ || shift === this.__index__ && next > this.__last_index__) {
4477 this.__schema__ = "mailto:";
4478 this.__index__ = shift;
4479 this.__last_index__ = next;
4484 return this.__index__ >= 0;
4486 LinkifyIt.prototype.pretest = function pretest(text) {
4487 return this.re.pretest.test(text);
4489 LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema2, pos) {
4490 if (!this.__compiled__[schema2.toLowerCase()]) {
4493 return this.__compiled__[schema2.toLowerCase()].validate(text, pos, this);
4495 LinkifyIt.prototype.match = function match(text) {
4496 var shift = 0, result = [];
4497 if (this.__index__ >= 0 && this.__text_cache__ === text) {
4498 result.push(createMatch(this, shift));
4499 shift = this.__last_index__;
4501 var tail = shift ? text.slice(shift) : text;
4502 while (this.test(tail)) {
4503 result.push(createMatch(this, shift));
4504 tail = tail.slice(this.__last_index__);
4505 shift += this.__last_index__;
4507 if (result.length) {
4512 LinkifyIt.prototype.tlds = function tlds(list, keepOld) {
4513 list = Array.isArray(list) ? list : [list];
4515 this.__tlds__ = list.slice();
4516 this.__tlds_replaced__ = true;
4520 this.__tlds__ = this.__tlds__.concat(list).sort().filter(function(el, idx, arr) {
4521 return el !== arr[idx - 1];
4526 LinkifyIt.prototype.normalize = function normalize(match) {
4527 if (!match.schema) {
4528 match.url = "http://" + match.url;
4530 if (match.schema === "mailto:" && !/^mailto:/i.test(match.url)) {
4531 match.url = "mailto:" + match.url;
4534 LinkifyIt.prototype.onCompile = function onCompile() {
4536 module2.exports = LinkifyIt;
4540 // node_modules/markdown-it/lib/presets/default.js
4541 var require_default = __commonJS({
4542 "node_modules/markdown-it/lib/presets/default.js"(exports, module2) {
4549 langPrefix: "language-",
4552 quotes: "\u201C\u201D\u2018\u2019",
4565 // node_modules/markdown-it/lib/presets/zero.js
4566 var require_zero = __commonJS({
4567 "node_modules/markdown-it/lib/presets/zero.js"(exports, module2) {
4574 langPrefix: "language-",
4577 quotes: "\u201C\u201D\u2018\u2019",
4608 // node_modules/markdown-it/lib/presets/commonmark.js
4609 var require_commonmark = __commonJS({
4610 "node_modules/markdown-it/lib/presets/commonmark.js"(exports, module2) {
4617 langPrefix: "language-",
4620 quotes: "\u201C\u201D\u2018\u2019",
4670 // node_modules/markdown-it/lib/index.js
4671 var require_lib = __commonJS({
4672 "node_modules/markdown-it/lib/index.js"(exports, module2) {
4674 var utils = require_utils();
4675 var helpers = require_helpers();
4676 var Renderer = require_renderer();
4677 var ParserCore = require_parser_core();
4678 var ParserBlock = require_parser_block();
4679 var ParserInline = require_parser_inline();
4680 var LinkifyIt = require_linkify_it();
4681 var mdurl = require_mdurl();
4682 var punycode = require("punycode");
4684 default: require_default(),
4685 zero: require_zero(),
4686 commonmark: require_commonmark()
4688 var BAD_PROTO_RE = /^(vbscript|javascript|file|data):/;
4689 var GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/;
4690 function validateLink(url) {
4691 var str2 = url.trim().toLowerCase();
4692 return BAD_PROTO_RE.test(str2) ? GOOD_DATA_RE.test(str2) ? true : false : true;
4694 var RECODE_HOSTNAME_FOR = ["http:", "https:", "mailto:"];
4695 function normalizeLink(url) {
4696 var parsed = mdurl.parse(url, true);
4697 if (parsed.hostname) {
4698 if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
4700 parsed.hostname = punycode.toASCII(parsed.hostname);
4705 return mdurl.encode(mdurl.format(parsed));
4707 function normalizeLinkText(url) {
4708 var parsed = mdurl.parse(url, true);
4709 if (parsed.hostname) {
4710 if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
4712 parsed.hostname = punycode.toUnicode(parsed.hostname);
4717 return mdurl.decode(mdurl.format(parsed), mdurl.decode.defaultChars + "%");
4719 function MarkdownIt(presetName, options) {
4720 if (!(this instanceof MarkdownIt)) {
4721 return new MarkdownIt(presetName, options);
4724 if (!utils.isString(presetName)) {
4725 options = presetName || {};
4726 presetName = "default";
4729 this.inline = new ParserInline();
4730 this.block = new ParserBlock();
4731 this.core = new ParserCore();
4732 this.renderer = new Renderer();
4733 this.linkify = new LinkifyIt();
4734 this.validateLink = validateLink;
4735 this.normalizeLink = normalizeLink;
4736 this.normalizeLinkText = normalizeLinkText;
4738 this.helpers = utils.assign({}, helpers);
4740 this.configure(presetName);
4745 MarkdownIt.prototype.set = function(options) {
4746 utils.assign(this.options, options);
4749 MarkdownIt.prototype.configure = function(presets) {
4750 var self = this, presetName;
4751 if (utils.isString(presets)) {
4752 presetName = presets;
4753 presets = config2[presetName];
4755 throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name');
4759 throw new Error("Wrong `markdown-it` preset, can't be empty");
4761 if (presets.options) {
4762 self.set(presets.options);
4764 if (presets.components) {
4765 Object.keys(presets.components).forEach(function(name) {
4766 if (presets.components[name].rules) {
4767 self[name].ruler.enableOnly(presets.components[name].rules);
4769 if (presets.components[name].rules2) {
4770 self[name].ruler2.enableOnly(presets.components[name].rules2);
4776 MarkdownIt.prototype.enable = function(list, ignoreInvalid) {
4778 if (!Array.isArray(list)) {
4781 ["core", "block", "inline"].forEach(function(chain) {
4782 result = result.concat(this[chain].ruler.enable(list, true));
4784 result = result.concat(this.inline.ruler2.enable(list, true));
4785 var missed = list.filter(function(name) {
4786 return result.indexOf(name) < 0;
4788 if (missed.length && !ignoreInvalid) {
4789 throw new Error("MarkdownIt. Failed to enable unknown rule(s): " + missed);
4793 MarkdownIt.prototype.disable = function(list, ignoreInvalid) {
4795 if (!Array.isArray(list)) {
4798 ["core", "block", "inline"].forEach(function(chain) {
4799 result = result.concat(this[chain].ruler.disable(list, true));
4801 result = result.concat(this.inline.ruler2.disable(list, true));
4802 var missed = list.filter(function(name) {
4803 return result.indexOf(name) < 0;
4805 if (missed.length && !ignoreInvalid) {
4806 throw new Error("MarkdownIt. Failed to disable unknown rule(s): " + missed);
4810 MarkdownIt.prototype.use = function(plugin) {
4811 var args = [this].concat(Array.prototype.slice.call(arguments, 1));
4812 plugin.apply(plugin, args);
4815 MarkdownIt.prototype.parse = function(src, env) {
4816 if (typeof src !== "string") {
4817 throw new Error("Input data should be a String");
4819 var state = new this.core.State(src, this, env);
4820 this.core.process(state);
4821 return state.tokens;
4823 MarkdownIt.prototype.render = function(src, env) {
4825 return this.renderer.render(this.parse(src, env), this.options, env);
4827 MarkdownIt.prototype.parseInline = function(src, env) {
4828 var state = new this.core.State(src, this, env);
4829 state.inlineMode = true;
4830 this.core.process(state);
4831 return state.tokens;
4833 MarkdownIt.prototype.renderInline = function(src, env) {
4835 return this.renderer.render(this.parseInline(src, env), this.options, env);
4837 module2.exports = MarkdownIt;
4841 // node_modules/markdown-it/index.js
4842 var require_markdown_it = __commonJS({
4843 "node_modules/markdown-it/index.js"(exports, module2) {
4845 module2.exports = require_lib();
4849 // node_modules/markdownlint/package.json
4850 var require_package = __commonJS({
4851 "node_modules/markdownlint/package.json"(exports, module2) {
4853 name: "markdownlint",
4855 description: "A Node.js style checker and lint tool for Markdown/CommonMark files.",
4856 main: "lib/markdownlint.js",
4857 types: "lib/markdownlint.d.ts",
4858 author: "David Anson (https://dlaa.me/)",
4860 homepage: "https://github.com/DavidAnson/markdownlint",
4863 url: "https://github.com/DavidAnson/markdownlint.git"
4865 bugs: "https://github.com/DavidAnson/markdownlint/issues",
4867 "build-config": "npm run build-config-schema && npm run build-config-example",
4868 "build-config-example": "node schema/build-config-example.js",
4869 "build-config-schema": "node schema/build-config-schema.js",
4870 "build-declaration": "tsc --allowJs --declaration --emitDeclarationOnly --resolveJsonModule lib/markdownlint.js && rimraf 'lib/{c,md,r}*.d.ts' 'helpers/*.d.ts'",
4871 "build-demo": "cpy node_modules/markdown-it/dist/markdown-it.min.js demo && cd demo && rimraf markdownlint-browser.* && webpack --no-stats",
4872 "build-example": "npm install --no-save --ignore-scripts grunt grunt-cli gulp through2",
4873 ci: "npm-run-all --continue-on-error --parallel test-cover lint declaration build-config build-demo && git diff --exit-code",
4874 "clean-test-repos": "rimraf test-repos",
4875 "clone-test-repos-dotnet-docs": "cd test-repos && git clone https://github.com/dotnet/docs dotnet-docs --depth 1 --no-tags --quiet",
4876 "clone-test-repos-eslint-eslint": "cd test-repos && git clone https://github.com/eslint/eslint eslint-eslint --depth 1 --no-tags --quiet",
4877 "clone-test-repos-mkdocs-mkdocs": "cd test-repos && git clone https://github.com/mkdocs/mkdocs mkdocs-mkdocs --depth 1 --no-tags --quiet",
4878 "clone-test-repos-mochajs-mocha": "cd test-repos && git clone https://github.com/mochajs/mocha mochajs-mocha --depth 1 --no-tags --quiet",
4879 "clone-test-repos-pi-hole-docs": "cd test-repos && git clone https://github.com/pi-hole/docs pi-hole-docs --depth 1 --no-tags --quiet",
4880 "clone-test-repos-v8-v8-dev": "cd test-repos && git clone https://github.com/v8/v8.dev v8-v8-dev --depth 1 --no-tags --quiet",
4881 "clone-test-repos-webhintio-hint": "cd test-repos && git clone https://github.com/webhintio/hint webhintio-hint --depth 1 --no-tags --quiet",
4882 "clone-test-repos-webpack-webpack-js-org": "cd test-repos && git clone https://github.com/webpack/webpack.js.org webpack-webpack-js-org --depth 1 --no-tags --quiet",
4883 "clone-test-repos": "mkdir test-repos && cd test-repos && npm run clone-test-repos-eslint-eslint && npm run clone-test-repos-mkdocs-mkdocs && npm run clone-test-repos-mochajs-mocha && npm run clone-test-repos-pi-hole-docs && npm run clone-test-repos-webhintio-hint && npm run clone-test-repos-webpack-webpack-js-org",
4884 "clone-test-repos-large": "npm run clone-test-repos && cd test-repos && npm run clone-test-repos-dotnet-docs && npm run clone-test-repos-v8-v8-dev",
4885 declaration: "npm run build-declaration && npm run test-declaration",
4886 example: "cd example && node standalone.js && grunt markdownlint --force && gulp markdownlint",
4887 lint: "eslint --max-warnings 0 .",
4888 "lint-test-repos": "ava --timeout=5m test/markdownlint-test-repos.js",
4889 test: "ava test/markdownlint-test.js test/markdownlint-test-custom-rules.js test/markdownlint-test-helpers.js test/markdownlint-test-result-object.js test/markdownlint-test-scenarios.js",
4890 "test-cover": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 npm test",
4891 "test-declaration": "cd example/typescript && tsc && node type-check.js",
4892 "test-extra": "ava --timeout=5m test/markdownlint-test-extra.js"
4898 "markdown-it": "12.2.0"
4903 "cpy-cli": "~3.1.1",
4905 "eslint-plugin-jsdoc": "~36.0.7",
4906 "eslint-plugin-node": "~11.1.0",
4907 "eslint-plugin-unicorn": "~35.0.0",
4909 "js-yaml": "~4.1.0",
4910 "markdown-it-for-inline": "~0.1.1",
4911 "markdown-it-sub": "~1.0.0",
4912 "markdown-it-sup": "~1.0.0",
4913 "markdown-it-texmath": "~0.9.1",
4914 "markdownlint-rule-helpers": "~0.14.0",
4915 "npm-run-all": "~4.1.5",
4917 "strip-json-comments": "~3.1.1",
4919 "ts-loader": "~9.2.5",
4921 typescript: "~4.3.5",
4923 "webpack-cli": "~4.8.0"
4936 // node_modules/markdownlint/helpers/helpers.js
4937 var require_helpers2 = __commonJS({
4938 "node_modules/markdownlint/helpers/helpers.js"(exports, module2) {
4940 var os = require("os");
4941 var newLineRe = /\r\n?|\n/g;
4942 module2.exports.newLineRe = newLineRe;
4943 module2.exports.frontMatterRe = /((^---\s*$[^]*?^---\s*$)|(^\+\+\+\s*$[^]*?^(\+\+\+|\.\.\.)\s*$)|(^\{\s*$[^]*?^\}\s*$))(\r\n|\r|\n|$)/m;
4944 var inlineCommentRe = /<!--\s*markdownlint-(?:(?:(disable|enable|capture|restore|disable-file|enable-file|disable-next-line)((?:\s+[a-z0-9_-]+)*))|(?:(configure-file)\s+([\s\S]*?)))\s*-->/ig;
4945 module2.exports.inlineCommentRe = inlineCommentRe;
4946 module2.exports.bareUrlRe = /(?:http|ftp)s?:\/\/[^\s\]"']*(?:\/|[^\s\]"'\W])/ig;
4947 module2.exports.listItemMarkerRe = /^([\s>]*)(?:[*+-]|\d+[.)])\s+/;
4948 module2.exports.orderedListItemMarkerRe = /^[\s>]*0*(\d+)[.)]/;
4949 var emphasisMarkersRe = /[_*]/g;
4950 var linkRe = /(\[(?:[^[\]]|\[[^\]]*\])*\])(\(\S*\)|\[\S*\])?/g;
4951 module2.exports.linkRe = linkRe;
4952 module2.exports.linkReferenceRe = /^ {0,3}\[[^\]]+]:\s.*$/;
4953 var allPunctuation = ".,;:!?\u3002\uFF0C\uFF1B\uFF1A\uFF01\uFF1F";
4954 module2.exports.allPunctuation = allPunctuation;
4955 module2.exports.allPunctuationNoQuestion = allPunctuation.replace(/[??]/gu, "");
4956 module2.exports.isNumber = function isNumber(obj) {
4957 return typeof obj === "number";
4959 module2.exports.isString = function isString(obj) {
4960 return typeof obj === "string";
4962 module2.exports.isEmptyString = function isEmptyString(str2) {
4963 return str2.length === 0;
4965 module2.exports.isObject = function isObject2(obj) {
4966 return obj !== null && typeof obj === "object" && !Array.isArray(obj);
4968 var blankLineRe = />|(?:<!--.*?-->)/g;
4969 module2.exports.isBlankLine = function isBlankLine(line) {
4970 return !line || !line.trim() || !line.replace(blankLineRe, "").trim();
4972 module2.exports.numericSortAscending = function numericSortAscending(a, b) {
4975 module2.exports.includesSorted = function includesSorted(array, element) {
4977 let right = array.length - 1;
4978 while (left <= right) {
4979 const mid = left + right >> 1;
4980 if (array[mid] < element) {
4982 } else if (array[mid] > element) {
4990 var htmlCommentBegin = "<!--";
4991 var htmlCommentEnd = "-->";
4992 module2.exports.clearHtmlCommentText = function clearHtmlCommentText(text) {
4994 while ((i = text.indexOf(htmlCommentBegin, i)) !== -1) {
4995 const j = text.indexOf(htmlCommentEnd, i + 2);
4999 if (j > i + htmlCommentBegin.length) {
5001 while (text[k] === " ") {
5005 const content = text.slice(i + htmlCommentBegin.length, j);
5006 const isBlock = k < 0 || text[k] === "\n";
5007 const isValid = isBlock || !content.startsWith(">") && !content.startsWith("->") && !content.endsWith("-") && !content.includes("--");
5009 const inlineCommentIndex = text.slice(i, j + htmlCommentEnd.length).search(inlineCommentRe);
5010 if (inlineCommentIndex === -1) {
5011 text = text.slice(0, i + htmlCommentBegin.length) + content.replace(/[^\r\n]/g, ".") + text.slice(j);
5016 i = j + htmlCommentEnd.length;
5020 module2.exports.escapeForRegExp = function escapeForRegExp(str2) {
5021 return str2.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
5023 var escapedMarkdownRe = /\\./g;
5024 module2.exports.unescapeMarkdown = function unescapeMarkdown(markdown, replacement) {
5025 return markdown.replace(escapedMarkdownRe, (match) => {
5026 const char = match[1];
5027 if ("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~".includes(char)) {
5028 return replacement || char;
5033 module2.exports.fencedCodeBlockStyleFor = function fencedCodeBlockStyleFor(markup) {
5034 switch (markup[0]) {
5041 function indentFor(token) {
5042 const line = token.line.replace(/^[\s>]*(> |>)/, "");
5043 return line.length - line.trimStart().length;
5045 module2.exports.indentFor = indentFor;
5046 module2.exports.headingStyleFor = function headingStyleFor(token) {
5047 if (token.map[1] - token.map[0] === 1) {
5048 if (/[^\\]#\s*$/.test(token.line)) {
5049 return "atx_closed";
5055 module2.exports.unorderedListStyleFor = function unorderedListStyleFor(token) {
5056 switch (token.markup) {
5065 function filterTokens(params, type2, handler) {
5066 params.tokens.forEach(function forToken(token) {
5067 if (token.type === type2) {
5072 module2.exports.filterTokens = filterTokens;
5073 function isMathBlock(token) {
5074 return token.tag === "math" && token.type.startsWith("math_block") && !token.type.endsWith("_end");
5076 module2.exports.getLineMetadata = function getLineMetadata(params) {
5077 const lineMetadata = params.lines.map((line, index) => [line, index, false, 0, false, false, false, false]);
5078 filterTokens(params, "fence", (token) => {
5079 lineMetadata[token.map[0]][3] = 1;
5080 lineMetadata[token.map[1] - 1][3] = -1;
5081 for (let i = token.map[0] + 1; i < token.map[1] - 1; i++) {
5082 lineMetadata[i][2] = true;
5085 filterTokens(params, "code_block", (token) => {
5086 for (let i = token.map[0]; i < token.map[1]; i++) {
5087 lineMetadata[i][2] = true;
5090 filterTokens(params, "table_open", (token) => {
5091 for (let i = token.map[0]; i < token.map[1]; i++) {
5092 lineMetadata[i][4] = true;
5095 filterTokens(params, "list_item_open", (token) => {
5097 for (let i = token.map[0]; i < token.map[1]; i++) {
5098 lineMetadata[i][5] = count;
5102 filterTokens(params, "hr", (token) => {
5103 lineMetadata[token.map[0]][6] = true;
5105 params.tokens.filter(isMathBlock).forEach((token) => {
5106 for (let i = token.map[0]; i < token.map[1]; i++) {
5107 lineMetadata[i][7] = true;
5110 return lineMetadata;
5112 module2.exports.forEachLine = function forEachLine(lineMetadata, handler) {
5113 lineMetadata.forEach(function forMetadata(metadata) {
5114 handler(...metadata);
5117 module2.exports.flattenLists = function flattenLists(tokens) {
5118 const flattenedLists = [];
5122 const nestingStack = [];
5123 let lastWithMap = { "map": [0, 1] };
5124 tokens.forEach((token) => {
5125 if (isMathBlock(token) && token.map[1]) {
5128 if (token.type === "bullet_list_open" || token.type === "ordered_list_open") {
5129 stack.push(current);
5131 "unordered": token.type === "bullet_list_open",
5132 "parentsUnordered": !current || current.unordered && current.parentsUnordered,
5134 "indent": indentFor(token),
5135 "parentIndent": current && current.indent || 0,
5138 "lastLineIndex": -1,
5139 "insert": flattenedLists.length
5142 } else if (token.type === "bullet_list_close" || token.type === "ordered_list_close") {
5143 current.lastLineIndex = lastWithMap.map[1];
5144 flattenedLists.splice(current.insert, 0, current);
5145 delete current.insert;
5146 current = stack.pop();
5148 } else if (token.type === "list_item_open") {
5149 current.items.push(token);
5150 } else if (token.type === "blockquote_open") {
5151 nestingStack.push(nesting);
5153 } else if (token.type === "blockquote_close") {
5154 nesting = nestingStack.pop();
5155 } else if (token.map) {
5156 lastWithMap = token;
5159 return flattenedLists;
5161 module2.exports.forEachInlineChild = function forEachInlineChild(params, type2, handler) {
5162 filterTokens(params, "inline", function forToken(token) {
5163 token.children.forEach(function forChild(child) {
5164 if (child.type === type2) {
5165 handler(child, token);
5170 module2.exports.forEachHeading = function forEachHeading(params, handler) {
5172 params.tokens.forEach(function forToken(token) {
5173 if (token.type === "heading_open") {
5175 } else if (token.type === "heading_close") {
5177 } else if (token.type === "inline" && heading) {
5178 handler(heading, token.content);
5182 function forEachInlineCodeSpan(input, handler) {
5183 let currentLine = 0;
5184 let currentColumn = 0;
5186 while (index < input.length) {
5187 let startIndex = -1;
5189 let startColumn = -1;
5191 let currentTicks = 0;
5192 let state = "normal";
5193 for (; index <= input.length; index++) {
5194 const char = input[index];
5195 if (char === "[" && state === "normal") {
5196 state = "linkTextOpen";
5197 } else if (char === "]" && state === "linkTextOpen") {
5198 state = "linkTextClosed";
5199 } else if (char === "(" && state === "linkTextClosed") {
5200 state = "linkDestinationOpen";
5201 } else if (char === "(" && state === "linkDestinationOpen" || char === ")" && state === "linkDestinationOpen" || state === "linkTextClosed") {
5204 if (char === "`" && state !== "linkDestinationOpen") {
5206 if (startIndex === -1 || startColumn === -1) {
5207 startIndex = index + 1;
5210 if (startIndex >= 0 && startColumn >= 0 && tickCount === currentTicks) {
5211 handler(input.substring(startIndex, index - currentTicks), startLine, startColumn, tickCount);
5214 } else if (startIndex >= 0 && startColumn === -1) {
5215 tickCount = currentTicks;
5216 startLine = currentLine;
5217 startColumn = currentColumn;
5221 if (char === "\n") {
5224 } else if (char === "\\" && (startIndex === -1 || startColumn === -1) && input[index + 1] !== "\n") {
5231 if (startIndex >= 0) {
5233 currentLine = startLine;
5234 currentColumn = startColumn;
5238 module2.exports.forEachInlineCodeSpan = forEachInlineCodeSpan;
5239 function addError(onError, lineNumber, detail, context, range, fixInfo) {
5248 module2.exports.addError = addError;
5249 module2.exports.addErrorDetailIf = function addErrorDetailIf(onError, lineNumber, expected, actual, detail, context, range, fixInfo) {
5250 if (expected !== actual) {
5251 addError(onError, lineNumber, "Expected: " + expected + "; Actual: " + actual + (detail ? "; " + detail : ""), context, range, fixInfo);
5254 module2.exports.addErrorContext = function addErrorContext(onError, lineNumber, context, left, right, range, fixInfo) {
5255 if (context.length <= 30) {
5256 } else if (left && right) {
5257 context = context.substr(0, 15) + "..." + context.substr(-15);
5259 context = "..." + context.substr(-30);
5261 context = context.substr(0, 30) + "...";
5263 addError(onError, lineNumber, null, context, range, fixInfo);
5265 module2.exports.inlineCodeSpanRanges = (lines) => {
5266 const exclusions = [];
5267 forEachInlineCodeSpan(lines.join("\n"), (code, lineIndex, columnIndex) => {
5268 const codeLines = code.split(newLineRe);
5269 for (let i = 0; i < codeLines.length; i++) {
5270 exclusions.push([lineIndex + i, columnIndex, codeLines[i].length]);
5276 module2.exports.overlapsAnyRange = (ranges, lineIndex, index, length) => !ranges.every((span) => lineIndex !== span[0] || index + length < span[1] || index > span[1] + span[2]);
5277 module2.exports.rangeFromRegExp = function rangeFromRegExp(line, regexp) {
5279 const match = line.match(regexp);
5281 const column = match.index + 1;
5282 const length = match[0].length;
5283 range = [column, length];
5287 module2.exports.frontMatterHasTitle = function frontMatterHasTitle(frontMatterLines, frontMatterTitlePattern) {
5288 const ignoreFrontMatter = frontMatterTitlePattern !== void 0 && !frontMatterTitlePattern;
5289 const frontMatterTitleRe = new RegExp(String(frontMatterTitlePattern || '^\\s*"?title"?\\s*[:=]'), "i");
5290 return !ignoreFrontMatter && frontMatterLines.some((line) => frontMatterTitleRe.test(line));
5292 function emphasisMarkersInContent(params) {
5293 const { lines } = params;
5294 const byLine = new Array(lines.length);
5295 filterTokens(params, "inline", (token) => {
5296 const { children, lineNumber, map: map2 } = token;
5297 if (children.some((child) => child.type === "code_inline")) {
5298 const tokenLines = lines.slice(map2[0], map2[1]);
5299 forEachInlineCodeSpan(tokenLines.join("\n"), (code, lineIndex, column, tickCount) => {
5300 const codeLines = code.split(newLineRe);
5301 codeLines.forEach((codeLine, codeLineIndex) => {
5303 while (match = emphasisMarkersRe.exec(codeLine)) {
5304 const byLineIndex = lineNumber - 1 + lineIndex + codeLineIndex;
5305 const inLine = byLine[byLineIndex] || [];
5306 const codeLineOffset = codeLineIndex ? 0 : column - 1 + tickCount;
5307 inLine.push(codeLineOffset + match.index);
5308 byLine[byLineIndex] = inLine;
5314 lines.forEach((tokenLine, tokenLineIndex) => {
5315 let linkMatch = null;
5316 while (linkMatch = linkRe.exec(tokenLine)) {
5317 let markerMatch = null;
5318 while (markerMatch = emphasisMarkersRe.exec(linkMatch[0])) {
5319 const inLine = byLine[tokenLineIndex] || [];
5320 inLine.push(linkMatch.index + markerMatch.index);
5321 byLine[tokenLineIndex] = inLine;
5327 module2.exports.emphasisMarkersInContent = emphasisMarkersInContent;
5328 function getPreferredLineEnding(input) {
5332 const endings = input.match(newLineRe) || [];
5333 endings.forEach((ending) => {
5346 let preferredLineEnding = null;
5347 if (!cr && !lf && !crlf) {
5348 preferredLineEnding = os.EOL;
5349 } else if (lf >= crlf && lf >= cr) {
5350 preferredLineEnding = "\n";
5351 } else if (crlf >= cr) {
5352 preferredLineEnding = "\r\n";
5354 preferredLineEnding = "\r";
5356 return preferredLineEnding;
5358 module2.exports.getPreferredLineEnding = getPreferredLineEnding;
5359 function normalizeFixInfo(fixInfo, lineNumber) {
5361 "lineNumber": fixInfo.lineNumber || lineNumber,
5362 "editColumn": fixInfo.editColumn || 1,
5363 "deleteCount": fixInfo.deleteCount || 0,
5364 "insertText": fixInfo.insertText || ""
5367 function applyFix2(line, fixInfo, lineEnding) {
5368 const { editColumn, deleteCount, insertText } = normalizeFixInfo(fixInfo);
5369 const editIndex = editColumn - 1;
5370 return deleteCount === -1 ? null : line.slice(0, editIndex) + insertText.replace(/\n/g, lineEnding || "\n") + line.slice(editIndex + deleteCount);
5372 module2.exports.applyFix = applyFix2;
5373 module2.exports.applyFixes = function applyFixes2(input, errors) {
5374 const lineEnding = getPreferredLineEnding(input);
5375 const lines = input.split(newLineRe);
5376 let fixInfos = errors.filter((error) => error.fixInfo).map((error) => normalizeFixInfo(error.fixInfo, error.lineNumber));
5377 fixInfos.sort((a, b) => {
5378 const aDeletingLine = a.deleteCount === -1;
5379 const bDeletingLine = b.deleteCount === -1;
5380 return b.lineNumber - a.lineNumber || (aDeletingLine ? 1 : bDeletingLine ? -1 : 0) || b.editColumn - a.editColumn || b.insertText.length - a.insertText.length;
5382 let lastFixInfo = {};
5383 fixInfos = fixInfos.filter((fixInfo) => {
5384 const unique = fixInfo.lineNumber !== lastFixInfo.lineNumber || fixInfo.editColumn !== lastFixInfo.editColumn || fixInfo.deleteCount !== lastFixInfo.deleteCount || fixInfo.insertText !== lastFixInfo.insertText;
5385 lastFixInfo = fixInfo;
5389 fixInfos.forEach((fixInfo) => {
5390 if (fixInfo.lineNumber === lastFixInfo.lineNumber && fixInfo.editColumn === lastFixInfo.editColumn && !fixInfo.insertText && fixInfo.deleteCount > 0 && lastFixInfo.insertText && !lastFixInfo.deleteCount) {
5391 fixInfo.insertText = lastFixInfo.insertText;
5392 lastFixInfo.lineNumber = 0;
5394 lastFixInfo = fixInfo;
5396 fixInfos = fixInfos.filter((fixInfo) => fixInfo.lineNumber);
5397 let lastLineIndex = -1;
5398 let lastEditIndex = -1;
5399 fixInfos.forEach((fixInfo) => {
5400 const { lineNumber, editColumn, deleteCount } = fixInfo;
5401 const lineIndex = lineNumber - 1;
5402 const editIndex = editColumn - 1;
5403 if (lineIndex !== lastLineIndex || deleteCount === -1 || editIndex + deleteCount <= lastEditIndex - (deleteCount > 0 ? 0 : 1)) {
5404 lines[lineIndex] = applyFix2(lines[lineIndex], fixInfo, lineEnding);
5406 lastLineIndex = lineIndex;
5407 lastEditIndex = editIndex;
5409 return lines.filter((line) => line !== null).join(lineEnding);
5414 // node_modules/markdownlint/lib/md001.js
5415 var require_md001 = __commonJS({
5416 "node_modules/markdownlint/lib/md001.js"(exports, module2) {
5418 var { addErrorDetailIf, filterTokens } = require_helpers2();
5420 "names": ["MD001", "heading-increment", "header-increment"],
5421 "description": "Heading levels should only increment by one level at a time",
5422 "tags": ["headings", "headers"],
5423 "function": function MD001(params, onError) {
5425 filterTokens(params, "heading_open", function forToken(token) {
5426 const level = Number.parseInt(token.tag.slice(1), 10);
5427 if (prevLevel && level > prevLevel) {
5428 addErrorDetailIf(onError, token.lineNumber, "h" + (prevLevel + 1), "h" + level);
5437 // node_modules/markdownlint/lib/md002.js
5438 var require_md002 = __commonJS({
5439 "node_modules/markdownlint/lib/md002.js"(exports, module2) {
5441 var { addErrorDetailIf } = require_helpers2();
5443 "names": ["MD002", "first-heading-h1", "first-header-h1"],
5444 "description": "First heading should be a top-level heading",
5445 "tags": ["headings", "headers"],
5446 "function": function MD002(params, onError) {
5447 const level = Number(params.config.level || 1);
5448 const tag = "h" + level;
5449 params.tokens.every(function forToken(token) {
5450 if (token.type === "heading_open") {
5451 addErrorDetailIf(onError, token.lineNumber, tag, token.tag);
5461 // node_modules/markdownlint/lib/md003.js
5462 var require_md003 = __commonJS({
5463 "node_modules/markdownlint/lib/md003.js"(exports, module2) {
5465 var { addErrorDetailIf, filterTokens, headingStyleFor } = require_helpers2();
5467 "names": ["MD003", "heading-style", "header-style"],
5468 "description": "Heading style",
5469 "tags": ["headings", "headers"],
5470 "function": function MD003(params, onError) {
5471 let style = String(params.config.style || "consistent");
5472 filterTokens(params, "heading_open", function forToken(token) {
5473 const styleForToken = headingStyleFor(token);
5474 if (style === "consistent") {
5475 style = styleForToken;
5477 if (styleForToken !== style) {
5478 const h12 = /h[12]/.test(token.tag);
5479 const setextWithAtx = style === "setext_with_atx" && (h12 && styleForToken === "setext" || !h12 && styleForToken === "atx");
5480 const setextWithAtxClosed = style === "setext_with_atx_closed" && (h12 && styleForToken === "setext" || !h12 && styleForToken === "atx_closed");
5481 if (!setextWithAtx && !setextWithAtxClosed) {
5482 let expected = style;
5483 if (style === "setext_with_atx") {
5484 expected = h12 ? "setext" : "atx";
5485 } else if (style === "setext_with_atx_closed") {
5486 expected = h12 ? "setext" : "atx_closed";
5488 addErrorDetailIf(onError, token.lineNumber, expected, styleForToken);
5497 // node_modules/markdownlint/lib/cache.js
5498 var require_cache = __commonJS({
5499 "node_modules/markdownlint/lib/cache.js"(exports, module2) {
5501 var flattenedLists = null;
5502 module2.exports.flattenedLists = (value) => {
5504 flattenedLists = value;
5506 return flattenedLists;
5508 var inlineCodeSpanRanges = null;
5509 module2.exports.inlineCodeSpanRanges = (value) => {
5511 inlineCodeSpanRanges = value;
5513 return inlineCodeSpanRanges;
5515 var lineMetadata = null;
5516 module2.exports.lineMetadata = (value) => {
5518 lineMetadata = value;
5520 return lineMetadata;
5522 module2.exports.clear = () => {
5523 flattenedLists = null;
5524 inlineCodeSpanRanges = null;
5525 lineMetadata = null;
5530 // node_modules/markdownlint/lib/md004.js
5531 var require_md004 = __commonJS({
5532 "node_modules/markdownlint/lib/md004.js"(exports, module2) {
5534 var { addErrorDetailIf, listItemMarkerRe, unorderedListStyleFor } = require_helpers2();
5535 var { flattenedLists } = require_cache();
5536 var expectedStyleToMarker = {
5541 var differentItemStyle = {
5546 var validStyles = Object.keys(expectedStyleToMarker);
5548 "names": ["MD004", "ul-style"],
5549 "description": "Unordered list style",
5550 "tags": ["bullet", "ul"],
5551 "function": function MD004(params, onError) {
5552 const style = String(params.config.style || "consistent");
5553 let expectedStyle = style;
5554 const nestingStyles = [];
5555 flattenedLists().forEach((list) => {
5556 if (list.unordered) {
5557 if (expectedStyle === "consistent") {
5558 expectedStyle = unorderedListStyleFor(list.items[0]);
5560 list.items.forEach((item) => {
5561 const itemStyle = unorderedListStyleFor(item);
5562 if (style === "sublist") {
5563 const nesting = list.nesting;
5564 if (!nestingStyles[nesting]) {
5565 nestingStyles[nesting] = itemStyle === nestingStyles[nesting - 1] ? differentItemStyle[itemStyle] : itemStyle;
5567 expectedStyle = nestingStyles[nesting];
5569 if (!validStyles.includes(expectedStyle)) {
5570 expectedStyle = validStyles[0];
5574 const match = item.line.match(listItemMarkerRe);
5576 const column = match.index + 1;
5577 const length = match[0].length;
5578 range = [column, length];
5580 "editColumn": match[1].length + 1,
5582 "insertText": expectedStyleToMarker[expectedStyle]
5585 addErrorDetailIf(onError, item.lineNumber, expectedStyle, itemStyle, null, null, range, fixInfo);
5594 // node_modules/markdownlint/lib/md005.js
5595 var require_md005 = __commonJS({
5596 "node_modules/markdownlint/lib/md005.js"(exports, module2) {
5603 orderedListItemMarkerRe,
5605 } = require_helpers2();
5606 var { flattenedLists } = require_cache();
5608 "names": ["MD005", "list-indent"],
5609 "description": "Inconsistent indentation for list items at the same level",
5610 "tags": ["bullet", "ul", "indentation"],
5611 "function": function MD005(params, onError) {
5612 flattenedLists().forEach((list) => {
5613 const expectedIndent = list.indent;
5614 let expectedEnd = 0;
5616 let endMatching = false;
5617 list.items.forEach((item) => {
5618 const { line, lineNumber } = item;
5619 const actualIndent = indentFor(item);
5621 if (list.unordered) {
5622 addErrorDetailIf(onError, lineNumber, expectedIndent, actualIndent, null, null, rangeFromRegExp(line, listItemMarkerRe));
5623 } else if (match = orderedListItemMarkerRe.exec(line)) {
5624 actualEnd = match[0].length;
5625 expectedEnd = expectedEnd || actualEnd;
5626 const markerLength = match[1].length + 1;
5627 if (expectedIndent !== actualIndent || endMatching) {
5628 if (expectedEnd === actualEnd) {
5631 const detail = endMatching ? `Expected: (${expectedEnd}); Actual: (${actualEnd})` : `Expected: ${expectedIndent}; Actual: ${actualIndent}`;
5632 const expected = endMatching ? expectedEnd - markerLength : expectedIndent;
5633 const actual = endMatching ? actualEnd - markerLength : actualIndent;
5634 addError(onError, lineNumber, detail, null, rangeFromRegExp(line, listItemMarkerRe), {
5635 "editColumn": Math.min(actual, expected) + 1,
5636 "deleteCount": Math.max(actual - expected, 0),
5637 "insertText": "".padEnd(Math.max(expected - actual, 0))
5649 // node_modules/markdownlint/lib/md006.js
5650 var require_md006 = __commonJS({
5651 "node_modules/markdownlint/lib/md006.js"(exports, module2) {
5653 var { addErrorDetailIf, listItemMarkerRe, rangeFromRegExp } = require_helpers2();
5654 var { flattenedLists } = require_cache();
5656 "names": ["MD006", "ul-start-left"],
5657 "description": "Consider starting bulleted lists at the beginning of the line",
5658 "tags": ["bullet", "ul", "indentation"],
5659 "function": function MD006(params, onError) {
5660 flattenedLists().forEach((list) => {
5661 if (list.unordered && !list.nesting && list.indent !== 0) {
5662 list.items.forEach((item) => {
5663 const { lineNumber, line } = item;
5664 addErrorDetailIf(onError, lineNumber, 0, list.indent, null, null, rangeFromRegExp(line, listItemMarkerRe), {
5665 "deleteCount": line.length - line.trimStart().length
5675 // node_modules/markdownlint/lib/md007.js
5676 var require_md007 = __commonJS({
5677 "node_modules/markdownlint/lib/md007.js"(exports, module2) {
5679 var { addErrorDetailIf, indentFor, listItemMarkerRe } = require_helpers2();
5680 var { flattenedLists } = require_cache();
5682 "names": ["MD007", "ul-indent"],
5683 "description": "Unordered list indentation",
5684 "tags": ["bullet", "ul", "indentation"],
5685 "function": function MD007(params, onError) {
5686 const indent = Number(params.config.indent || 2);
5687 const startIndented = !!params.config.start_indented;
5688 flattenedLists().forEach((list) => {
5689 if (list.unordered && list.parentsUnordered) {
5690 list.items.forEach((item) => {
5691 const { lineNumber, line } = item;
5692 const expectedNesting = list.nesting + (startIndented ? 1 : 0);
5693 const expectedIndent = expectedNesting * indent;
5694 const actualIndent = indentFor(item);
5697 const match = line.match(listItemMarkerRe);
5699 range = [1, match[0].length];
5700 editColumn += match[1].length - actualIndent;
5702 addErrorDetailIf(onError, lineNumber, expectedIndent, actualIndent, null, null, range, {
5704 "deleteCount": actualIndent,
5705 "insertText": "".padEnd(expectedIndent)
5715 // node_modules/markdownlint/lib/md009.js
5716 var require_md009 = __commonJS({
5717 "node_modules/markdownlint/lib/md009.js"(exports, module2) {
5722 forEachInlineCodeSpan,
5726 numericSortAscending
5727 } = require_helpers2();
5728 var { lineMetadata } = require_cache();
5730 "names": ["MD009", "no-trailing-spaces"],
5731 "description": "Trailing spaces",
5732 "tags": ["whitespace"],
5733 "function": function MD009(params, onError) {
5734 let brSpaces = params.config.br_spaces;
5735 brSpaces = Number(brSpaces === void 0 ? 2 : brSpaces);
5736 const listItemEmptyLines = !!params.config.list_item_empty_lines;
5737 const strict = !!params.config.strict;
5738 const listItemLineNumbers = [];
5739 if (listItemEmptyLines) {
5740 filterTokens(params, "list_item_open", (token) => {
5741 for (let i = token.map[0]; i < token.map[1]; i++) {
5742 listItemLineNumbers.push(i + 1);
5745 listItemLineNumbers.sort(numericSortAscending);
5747 const paragraphLineNumbers = [];
5748 const codeInlineLineNumbers = [];
5750 filterTokens(params, "paragraph_open", (token) => {
5751 for (let i = token.map[0]; i < token.map[1] - 1; i++) {
5752 paragraphLineNumbers.push(i + 1);
5755 paragraphLineNumbers.sort(numericSortAscending);
5756 filterTokens(params, "inline", (token) => {
5757 if (token.children.some((child) => child.type === "code_inline")) {
5758 const tokenLines = params.lines.slice(token.map[0], token.map[1]);
5759 forEachInlineCodeSpan(tokenLines.join("\n"), (code, lineIndex) => {
5760 const codeLineCount = code.split(newLineRe).length;
5761 for (let i = 0; i < codeLineCount; i++) {
5762 codeInlineLineNumbers.push(token.lineNumber + lineIndex + i);
5767 codeInlineLineNumbers.sort(numericSortAscending);
5769 const expected = brSpaces < 2 ? 0 : brSpaces;
5770 forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
5771 const lineNumber = lineIndex + 1;
5772 const trailingSpaces = line.length - line.trimEnd().length;
5773 if (trailingSpaces && !inCode && !includesSorted(listItemLineNumbers, lineNumber) && (expected !== trailingSpaces || strict && (!includesSorted(paragraphLineNumbers, lineNumber) || includesSorted(codeInlineLineNumbers, lineNumber)))) {
5774 const column = line.length - trailingSpaces + 1;
5775 addError(onError, lineNumber, "Expected: " + (expected === 0 ? "" : "0 or ") + expected + "; Actual: " + trailingSpaces, null, [column, trailingSpaces], {
5776 "editColumn": column,
5777 "deleteCount": trailingSpaces
5786 // node_modules/markdownlint/lib/md010.js
5787 var require_md010 = __commonJS({
5788 "node_modules/markdownlint/lib/md010.js"(exports, module2) {
5790 var { addError, forEachLine } = require_helpers2();
5791 var { lineMetadata } = require_cache();
5794 "names": ["MD010", "no-hard-tabs"],
5795 "description": "Hard tabs",
5796 "tags": ["whitespace", "hard_tab"],
5797 "function": function MD010(params, onError) {
5798 const codeBlocks = params.config.code_blocks;
5799 const includeCodeBlocks = codeBlocks === void 0 ? true : !!codeBlocks;
5800 const spacesPerTab = params.config.spaces_per_tab;
5801 const spaceMultiplier = spacesPerTab === void 0 ? 1 : Math.max(0, Number(spacesPerTab));
5802 forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
5803 if (!inCode || includeCodeBlocks) {
5805 while ((match = tabRe.exec(line)) !== null) {
5806 const column = match.index + 1;
5807 const length = match[0].length;
5808 addError(onError, lineIndex + 1, "Column: " + column, null, [column, length], {
5809 "editColumn": column,
5810 "deleteCount": length,
5811 "insertText": "".padEnd(length * spaceMultiplier)
5821 // node_modules/markdownlint/lib/md011.js
5822 var require_md011 = __commonJS({
5823 "node_modules/markdownlint/lib/md011.js"(exports, module2) {
5825 var { addError, forEachLine, overlapsAnyRange } = require_helpers2();
5826 var { inlineCodeSpanRanges, lineMetadata } = require_cache();
5827 var reversedLinkRe = /(^|[^\\])\(([^)]+)\)\[([^\]^][^\]]*)](?!\()/g;
5829 "names": ["MD011", "no-reversed-links"],
5830 "description": "Reversed link syntax",
5832 "function": function MD011(params, onError) {
5833 const exclusions = inlineCodeSpanRanges();
5834 forEachLine(lineMetadata(), (line, lineIndex, inCode, onFence) => {
5835 if (!inCode && !onFence) {
5837 while ((match = reversedLinkRe.exec(line)) !== null) {
5838 const [reversedLink, preChar, linkText, linkDestination] = match;
5839 const index = match.index + preChar.length;
5840 const length = match[0].length - preChar.length;
5841 if (!linkText.endsWith("\\") && !linkDestination.endsWith("\\") && !overlapsAnyRange(exclusions, lineIndex, index, length)) {
5842 addError(onError, lineIndex + 1, reversedLink.slice(preChar.length), null, [index + 1, length], {
5843 "editColumn": index + 1,
5844 "deleteCount": length,
5845 "insertText": `[${linkText}](${linkDestination})`
5856 // node_modules/markdownlint/lib/md012.js
5857 var require_md012 = __commonJS({
5858 "node_modules/markdownlint/lib/md012.js"(exports, module2) {
5860 var { addErrorDetailIf, forEachLine } = require_helpers2();
5861 var { lineMetadata } = require_cache();
5863 "names": ["MD012", "no-multiple-blanks"],
5864 "description": "Multiple consecutive blank lines",
5865 "tags": ["whitespace", "blank_lines"],
5866 "function": function MD012(params, onError) {
5867 const maximum = Number(params.config.maximum || 1);
5869 forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
5870 count = inCode || line.trim().length > 0 ? 0 : count + 1;
5871 if (maximum < count) {
5872 addErrorDetailIf(onError, lineIndex + 1, maximum, count, null, null, null, {
5882 // node_modules/markdownlint/lib/md013.js
5883 var require_md013 = __commonJS({
5884 "node_modules/markdownlint/lib/md013.js"(exports, module2) {
5892 } = require_helpers2();
5893 var { lineMetadata } = require_cache();
5894 var longLineRePrefix = "^.{";
5895 var longLineRePostfixRelaxed = "}.*\\s.*$";
5896 var longLineRePostfixStrict = "}.+$";
5897 var labelRe = /^\s*\[.*[^\\]]:/;
5898 var linkOrImageOnlyLineRe = /^[es]*(lT?L|I)[ES]*$/;
5899 var sternModeRe = /^([#>\s]*\s)?\S*$/;
5900 var tokenTypeMap = {
5907 "strong_close": "S",
5911 "names": ["MD013", "line-length"],
5912 "description": "Line length",
5913 "tags": ["line_length"],
5914 "function": function MD013(params, onError) {
5915 const lineLength = Number(params.config.line_length || 80);
5916 const headingLineLength = Number(params.config.heading_line_length || lineLength);
5917 const codeLineLength = Number(params.config.code_block_line_length || lineLength);
5918 const strict = !!params.config.strict;
5919 const stern = !!params.config.stern;
5920 const longLineRePostfix = strict || stern ? longLineRePostfixStrict : longLineRePostfixRelaxed;
5921 const longLineRe = new RegExp(longLineRePrefix + lineLength + longLineRePostfix);
5922 const longHeadingLineRe = new RegExp(longLineRePrefix + headingLineLength + longLineRePostfix);
5923 const longCodeLineRe = new RegExp(longLineRePrefix + codeLineLength + longLineRePostfix);
5924 const codeBlocks = params.config.code_blocks;
5925 const includeCodeBlocks = codeBlocks === void 0 ? true : !!codeBlocks;
5926 const tables = params.config.tables;
5927 const includeTables = tables === void 0 ? true : !!tables;
5928 let headings = params.config.headings;
5929 if (headings === void 0) {
5930 headings = params.config.headers;
5932 const includeHeadings = headings === void 0 ? true : !!headings;
5933 const headingLineNumbers = [];
5934 forEachHeading(params, (heading) => {
5935 headingLineNumbers.push(heading.lineNumber);
5937 const linkOnlyLineNumbers = [];
5938 filterTokens(params, "inline", (token) => {
5939 let childTokenTypes = "";
5940 token.children.forEach((child) => {
5941 if (child.type !== "text" || child.content !== "") {
5942 childTokenTypes += tokenTypeMap[child.type] || "x";
5945 if (linkOrImageOnlyLineRe.test(childTokenTypes)) {
5946 linkOnlyLineNumbers.push(token.lineNumber);
5949 forEachLine(lineMetadata(), (line, lineIndex, inCode, onFence, inTable) => {
5950 const lineNumber = lineIndex + 1;
5951 const isHeading = includesSorted(headingLineNumbers, lineNumber);
5952 const length = inCode ? codeLineLength : isHeading ? headingLineLength : lineLength;
5953 const lengthRe = inCode ? longCodeLineRe : isHeading ? longHeadingLineRe : longLineRe;
5954 if ((includeCodeBlocks || !inCode) && (includeTables || !inTable) && (includeHeadings || !isHeading) && (strict || !(stern && sternModeRe.test(line)) && !includesSorted(linkOnlyLineNumbers, lineNumber) && !labelRe.test(line)) && lengthRe.test(line)) {
5955 addErrorDetailIf(onError, lineNumber, length, line.length, null, null, [length + 1, line.length - length]);
5963 // node_modules/markdownlint/lib/md014.js
5964 var require_md014 = __commonJS({
5965 "node_modules/markdownlint/lib/md014.js"(exports, module2) {
5967 var { addErrorContext, filterTokens } = require_helpers2();
5968 var dollarCommandRe = /^(\s*)(\$\s+)/;
5970 "names": ["MD014", "commands-show-output"],
5971 "description": "Dollar signs used before commands without showing output",
5973 "function": function MD014(params, onError) {
5974 ["code_block", "fence"].forEach((type2) => {
5975 filterTokens(params, type2, (token) => {
5976 const margin = token.type === "fence" ? 1 : 0;
5977 const dollarInstances = [];
5978 let allDollars = true;
5979 for (let i = token.map[0] + margin; i < token.map[1] - margin; i++) {
5980 const line = params.lines[i];
5981 const lineTrim = line.trim();
5983 const match = dollarCommandRe.exec(line);
5985 const column = match[1].length + 1;
5986 const length = match[2].length;
5987 dollarInstances.push([i, lineTrim, column, length]);
5994 dollarInstances.forEach((instance) => {
5995 const [i, lineTrim, column, length] = instance;
5996 addErrorContext(onError, i + 1, lineTrim, null, null, [column, length], {
5997 "editColumn": column,
5998 "deleteCount": length
6009 // node_modules/markdownlint/lib/md018.js
6010 var require_md018 = __commonJS({
6011 "node_modules/markdownlint/lib/md018.js"(exports, module2) {
6013 var { addErrorContext, forEachLine } = require_helpers2();
6014 var { lineMetadata } = require_cache();
6016 "names": ["MD018", "no-missing-space-atx"],
6017 "description": "No space after hash on atx style heading",
6018 "tags": ["headings", "headers", "atx", "spaces"],
6019 "function": function MD018(params, onError) {
6020 forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
6021 if (!inCode && /^#+[^# \t]/.test(line) && !/#\s*$/.test(line) && !line.startsWith("#\uFE0F\u20E3")) {
6022 const hashCount = /^#+/.exec(line)[0].length;
6023 addErrorContext(onError, lineIndex + 1, line.trim(), null, null, [1, hashCount + 1], {
6024 "editColumn": hashCount + 1,
6034 // node_modules/markdownlint/lib/md019.js
6035 var require_md019 = __commonJS({
6036 "node_modules/markdownlint/lib/md019.js"(exports, module2) {
6038 var { addErrorContext, filterTokens, headingStyleFor } = require_helpers2();
6040 "names": ["MD019", "no-multiple-space-atx"],
6041 "description": "Multiple spaces after hash on atx style heading",
6042 "tags": ["headings", "headers", "atx", "spaces"],
6043 "function": function MD019(params, onError) {
6044 filterTokens(params, "heading_open", (token) => {
6045 if (headingStyleFor(token) === "atx") {
6046 const { line, lineNumber } = token;
6047 const match = /^(#+)([ \t]{2,})(?:\S)/.exec(line);
6051 { "length": hashLength },
6052 { "length": spacesLength }
6054 addErrorContext(onError, lineNumber, line.trim(), null, null, [1, hashLength + spacesLength + 1], {
6055 "editColumn": hashLength + 1,
6056 "deleteCount": spacesLength - 1
6066 // node_modules/markdownlint/lib/md020.js
6067 var require_md020 = __commonJS({
6068 "node_modules/markdownlint/lib/md020.js"(exports, module2) {
6070 var { addErrorContext, forEachLine } = require_helpers2();
6071 var { lineMetadata } = require_cache();
6073 "names": ["MD020", "no-missing-space-closed-atx"],
6074 "description": "No space inside hashes on closed atx style heading",
6075 "tags": ["headings", "headers", "atx_closed", "spaces"],
6076 "function": function MD020(params, onError) {
6077 forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
6079 const match = /^(#+)([ \t]*)([^#]*?[^#\\])([ \t]*)((?:\\#)?)(#+)(\s*)$/.exec(line);
6084 { "length": leftSpaceLength },
6086 { "length": rightSpaceLength },
6089 { "length": trailSpaceLength }
6091 const leftHashLength = leftHash.length;
6092 const rightHashLength = rightHash.length;
6093 const left = !leftSpaceLength;
6094 const right = !rightSpaceLength || rightEscape;
6095 const rightEscapeReplacement = rightEscape ? `${rightEscape} ` : "";
6096 if (left || right) {
6097 const range = left ? [
6101 line.length - trailSpaceLength - rightHashLength,
6104 addErrorContext(onError, lineIndex + 1, line.trim(), left, right, range, {
6106 "deleteCount": line.length,
6107 "insertText": `${leftHash} ${content} ${rightEscapeReplacement}${rightHash}`
6118 // node_modules/markdownlint/lib/md021.js
6119 var require_md021 = __commonJS({
6120 "node_modules/markdownlint/lib/md021.js"(exports, module2) {
6122 var { addErrorContext, filterTokens, headingStyleFor } = require_helpers2();
6124 "names": ["MD021", "no-multiple-space-closed-atx"],
6125 "description": "Multiple spaces inside hashes on closed atx style heading",
6126 "tags": ["headings", "headers", "atx_closed", "spaces"],
6127 "function": function MD021(params, onError) {
6128 filterTokens(params, "heading_open", (token) => {
6129 if (headingStyleFor(token) === "atx_closed") {
6130 const { line, lineNumber } = token;
6131 const match = /^(#+)([ \t]+)([^#]+?)([ \t]+)(#+)(\s*)$/.exec(line);
6136 { "length": leftSpaceLength },
6138 { "length": rightSpaceLength },
6140 { "length": trailSpaceLength }
6142 const left = leftSpaceLength > 1;
6143 const right = rightSpaceLength > 1;
6144 if (left || right) {
6145 const length = line.length;
6146 const leftHashLength = leftHash.length;
6147 const rightHashLength = rightHash.length;
6148 const range = left ? [
6150 leftHashLength + leftSpaceLength + 1
6152 length - trailSpaceLength - rightHashLength - rightSpaceLength,
6153 rightSpaceLength + rightHashLength + 1
6155 addErrorContext(onError, lineNumber, line.trim(), left, right, range, {
6157 "deleteCount": length,
6158 "insertText": `${leftHash} ${content} ${rightHash}`
6169 // node_modules/markdownlint/lib/md022.js
6170 var require_md022 = __commonJS({
6171 "node_modules/markdownlint/lib/md022.js"(exports, module2) {
6173 var { addErrorDetailIf, filterTokens, isBlankLine } = require_helpers2();
6175 "names": ["MD022", "blanks-around-headings", "blanks-around-headers"],
6176 "description": "Headings should be surrounded by blank lines",
6177 "tags": ["headings", "headers", "blank_lines"],
6178 "function": function MD022(params, onError) {
6179 let linesAbove = params.config.lines_above;
6180 linesAbove = Number(linesAbove === void 0 ? 1 : linesAbove);
6181 let linesBelow = params.config.lines_below;
6182 linesBelow = Number(linesBelow === void 0 ? 1 : linesBelow);
6183 const { lines } = params;
6184 filterTokens(params, "heading_open", (token) => {
6185 const [topIndex, nextIndex] = token.map;
6186 let actualAbove = 0;
6187 for (let i = 0; i < linesAbove; i++) {
6188 if (isBlankLine(lines[topIndex - i - 1])) {
6192 addErrorDetailIf(onError, topIndex + 1, linesAbove, actualAbove, "Above", lines[topIndex].trim(), null, {
6193 "insertText": "".padEnd(linesAbove - actualAbove, "\n")
6195 let actualBelow = 0;
6196 for (let i = 0; i < linesBelow; i++) {
6197 if (isBlankLine(lines[nextIndex + i])) {
6201 addErrorDetailIf(onError, topIndex + 1, linesBelow, actualBelow, "Below", lines[topIndex].trim(), null, {
6202 "lineNumber": nextIndex + 1,
6203 "insertText": "".padEnd(linesBelow - actualBelow, "\n")
6211 // node_modules/markdownlint/lib/md023.js
6212 var require_md023 = __commonJS({
6213 "node_modules/markdownlint/lib/md023.js"(exports, module2) {
6215 var { addErrorContext, filterTokens } = require_helpers2();
6216 var spaceBeforeHeadingRe = /^((?:\s+)|(?:[>\s]+\s\s))[^>\s]/;
6218 "names": ["MD023", "heading-start-left", "header-start-left"],
6219 "description": "Headings must start at the beginning of the line",
6220 "tags": ["headings", "headers", "spaces"],
6221 "function": function MD023(params, onError) {
6222 filterTokens(params, "heading_open", function forToken(token) {
6223 const { lineNumber, line } = token;
6224 const match = line.match(spaceBeforeHeadingRe);
6226 const [prefixAndFirstChar, prefix] = match;
6227 let deleteCount = prefix.length;
6228 const prefixLengthNoSpace = prefix.trimEnd().length;
6229 if (prefixLengthNoSpace) {
6230 deleteCount -= prefixLengthNoSpace - 1;
6232 addErrorContext(onError, lineNumber, line, null, null, [1, prefixAndFirstChar.length], {
6233 "editColumn": prefixLengthNoSpace + 1,
6234 "deleteCount": deleteCount
6243 // node_modules/markdownlint/lib/md024.js
6244 var require_md024 = __commonJS({
6245 "node_modules/markdownlint/lib/md024.js"(exports, module2) {
6247 var { addErrorContext, forEachHeading } = require_helpers2();
6249 "names": ["MD024", "no-duplicate-heading", "no-duplicate-header"],
6250 "description": "Multiple headings with the same content",
6251 "tags": ["headings", "headers"],
6252 "function": function MD024(params, onError) {
6253 const siblingsOnly = !!params.config.siblings_only || !!params.config.allow_different_nesting || false;
6254 const knownContents = [null, []];
6256 let knownContent = knownContents[lastLevel];
6257 forEachHeading(params, (heading, content) => {
6259 const newLevel = heading.tag.slice(1);
6260 while (lastLevel < newLevel) {
6262 knownContents[lastLevel] = [];
6264 while (lastLevel > newLevel) {
6265 knownContents[lastLevel] = [];
6268 knownContent = knownContents[newLevel];
6270 if (knownContent.includes(content)) {
6271 addErrorContext(onError, heading.lineNumber, heading.line.trim());
6273 knownContent.push(content);
6281 // node_modules/markdownlint/lib/md025.js
6282 var require_md025 = __commonJS({
6283 "node_modules/markdownlint/lib/md025.js"(exports, module2) {
6285 var { addErrorContext, filterTokens, frontMatterHasTitle } = require_helpers2();
6287 "names": ["MD025", "single-title", "single-h1"],
6288 "description": "Multiple top-level headings in the same document",
6289 "tags": ["headings", "headers"],
6290 "function": function MD025(params, onError) {
6291 const level = Number(params.config.level || 1);
6292 const tag = "h" + level;
6293 const foundFrontMatterTitle = frontMatterHasTitle(params.frontMatterLines, params.config.front_matter_title);
6294 let hasTopLevelHeading = false;
6295 filterTokens(params, "heading_open", function forToken(token) {
6296 if (token.tag === tag) {
6297 if (hasTopLevelHeading || foundFrontMatterTitle) {
6298 addErrorContext(onError, token.lineNumber, token.line.trim());
6299 } else if (token.lineNumber === 1) {
6300 hasTopLevelHeading = true;
6309 // node_modules/markdownlint/lib/md026.js
6310 var require_md026 = __commonJS({
6311 "node_modules/markdownlint/lib/md026.js"(exports, module2) {
6313 var { addError, allPunctuationNoQuestion, escapeForRegExp, forEachHeading } = require_helpers2();
6314 var endOfLineHtmlEntityRe = /&#?[0-9a-zA-Z]+;$/;
6316 "names": ["MD026", "no-trailing-punctuation"],
6317 "description": "Trailing punctuation in heading",
6318 "tags": ["headings", "headers"],
6319 "function": function MD026(params, onError) {
6320 let punctuation = params.config.punctuation;
6321 punctuation = String(punctuation === void 0 ? allPunctuationNoQuestion : punctuation);
6322 const trailingPunctuationRe = new RegExp("\\s*[" + escapeForRegExp(punctuation) + "]+$");
6323 forEachHeading(params, (heading) => {
6324 const { line, lineNumber } = heading;
6325 const trimmedLine = line.replace(/[\s#]*$/, "");
6326 const match = trailingPunctuationRe.exec(trimmedLine);
6327 if (match && !endOfLineHtmlEntityRe.test(trimmedLine)) {
6328 const fullMatch = match[0];
6329 const column = match.index + 1;
6330 const length = fullMatch.length;
6331 addError(onError, lineNumber, `Punctuation: '${fullMatch}'`, null, [column, length], {
6332 "editColumn": column,
6333 "deleteCount": length
6342 // node_modules/markdownlint/lib/md027.js
6343 var require_md027 = __commonJS({
6344 "node_modules/markdownlint/lib/md027.js"(exports, module2) {
6346 var { addErrorContext, newLineRe } = require_helpers2();
6347 var spaceAfterBlockQuoteRe = /^((?:\s*>)+)(\s{2,})\S/;
6349 "names": ["MD027", "no-multiple-space-blockquote"],
6350 "description": "Multiple spaces after blockquote symbol",
6351 "tags": ["blockquote", "whitespace", "indentation"],
6352 "function": function MD027(params, onError) {
6353 let blockquoteNesting = 0;
6354 let listItemNesting = 0;
6355 params.tokens.forEach((token) => {
6356 const { content, lineNumber, type: type2 } = token;
6357 if (type2 === "blockquote_open") {
6358 blockquoteNesting++;
6359 } else if (type2 === "blockquote_close") {
6360 blockquoteNesting--;
6361 } else if (type2 === "list_item_open") {
6363 } else if (type2 === "list_item_close") {
6365 } else if (type2 === "inline" && blockquoteNesting) {
6366 const lineCount = content.split(newLineRe).length;
6367 for (let i = 0; i < lineCount; i++) {
6368 const line = params.lines[lineNumber + i - 1];
6369 const match = line.match(spaceAfterBlockQuoteRe);
6373 { "length": blockquoteLength },
6374 { "length": spaceLength }
6376 if (!listItemNesting || fullMatch[fullMatch.length - 1] === ">") {
6377 addErrorContext(onError, lineNumber + i, line, null, null, [1, fullMatch.length], {
6378 "editColumn": blockquoteLength + 1,
6379 "deleteCount": spaceLength - 1
6391 // node_modules/markdownlint/lib/md028.js
6392 var require_md028 = __commonJS({
6393 "node_modules/markdownlint/lib/md028.js"(exports, module2) {
6395 var { addError } = require_helpers2();
6397 "names": ["MD028", "no-blanks-blockquote"],
6398 "description": "Blank line inside blockquote",
6399 "tags": ["blockquote", "whitespace"],
6400 "function": function MD028(params, onError) {
6402 let prevLineNumber = null;
6403 params.tokens.forEach(function forToken(token) {
6404 if (token.type === "blockquote_open" && prevToken.type === "blockquote_close") {
6405 for (let lineNumber = prevLineNumber; lineNumber < token.lineNumber; lineNumber++) {
6406 addError(onError, lineNumber);
6410 if (token.type === "blockquote_open") {
6411 prevLineNumber = token.map[1] + 1;
6419 // node_modules/markdownlint/lib/md029.js
6420 var require_md029 = __commonJS({
6421 "node_modules/markdownlint/lib/md029.js"(exports, module2) {
6426 orderedListItemMarkerRe,
6428 } = require_helpers2();
6429 var { flattenedLists } = require_cache();
6430 var listStyleExamples = {
6436 "names": ["MD029", "ol-prefix"],
6437 "description": "Ordered list item prefix",
6439 "function": function MD029(params, onError) {
6440 const style = String(params.config.style || "one_or_ordered");
6441 flattenedLists().filter((list) => !list.unordered).forEach((list) => {
6442 const { items } = list;
6444 let incrementing = false;
6445 if (items.length >= 2) {
6446 const first = orderedListItemMarkerRe.exec(items[0].line);
6447 const second = orderedListItemMarkerRe.exec(items[1].line);
6448 if (first && second) {
6449 const [, firstNumber] = first;
6450 const [, secondNumber] = second;
6451 if (secondNumber !== "1" || firstNumber === "0") {
6452 incrementing = true;
6453 if (firstNumber === "0") {
6459 let listStyle = style;
6460 if (listStyle === "one_or_ordered") {
6461 listStyle = incrementing ? "ordered" : "one";
6463 if (listStyle === "zero") {
6465 } else if (listStyle === "one") {
6468 items.forEach((item) => {
6469 const match = orderedListItemMarkerRe.exec(item.line);
6471 addErrorDetailIf(onError, item.lineNumber, String(current), match[1], "Style: " + listStyleExamples[listStyle], null, rangeFromRegExp(item.line, listItemMarkerRe));
6472 if (listStyle === "ordered") {
6483 // node_modules/markdownlint/lib/md030.js
6484 var require_md030 = __commonJS({
6485 "node_modules/markdownlint/lib/md030.js"(exports, module2) {
6487 var { addErrorDetailIf } = require_helpers2();
6488 var { flattenedLists } = require_cache();
6490 "names": ["MD030", "list-marker-space"],
6491 "description": "Spaces after list markers",
6492 "tags": ["ol", "ul", "whitespace"],
6493 "function": function MD030(params, onError) {
6494 const ulSingle = Number(params.config.ul_single || 1);
6495 const olSingle = Number(params.config.ol_single || 1);
6496 const ulMulti = Number(params.config.ul_multi || 1);
6497 const olMulti = Number(params.config.ol_multi || 1);
6498 flattenedLists().forEach((list) => {
6499 const lineCount = list.lastLineIndex - list.open.map[0];
6500 const allSingle = lineCount === list.items.length;
6501 const expectedSpaces = list.unordered ? allSingle ? ulSingle : ulMulti : allSingle ? olSingle : olMulti;
6502 list.items.forEach((item) => {
6503 const { line, lineNumber } = item;
6504 const match = /^[\s>]*\S+(\s*)/.exec(line);
6505 const [{ "length": matchLength }, { "length": actualSpaces }] = match;
6506 if (matchLength < line.length) {
6508 if (expectedSpaces !== actualSpaces) {
6510 "editColumn": matchLength - actualSpaces + 1,
6511 "deleteCount": actualSpaces,
6512 "insertText": "".padEnd(expectedSpaces)
6515 addErrorDetailIf(onError, lineNumber, expectedSpaces, actualSpaces, null, null, [1, matchLength], fixInfo);
6524 // node_modules/markdownlint/lib/md031.js
6525 var require_md031 = __commonJS({
6526 "node_modules/markdownlint/lib/md031.js"(exports, module2) {
6528 var { addErrorContext, forEachLine, isBlankLine } = require_helpers2();
6529 var { lineMetadata } = require_cache();
6530 var codeFencePrefixRe = /^(.*?)\s*[`~]/;
6532 "names": ["MD031", "blanks-around-fences"],
6533 "description": "Fenced code blocks should be surrounded by blank lines",
6534 "tags": ["code", "blank_lines"],
6535 "function": function MD031(params, onError) {
6536 const listItems = params.config.list_items;
6537 const includeListItems = listItems === void 0 ? true : !!listItems;
6538 const { lines } = params;
6539 forEachLine(lineMetadata(), (line, i, inCode, onFence, inTable, inItem) => {
6540 const onTopFence = onFence > 0;
6541 const onBottomFence = onFence < 0;
6542 if ((includeListItems || !inItem) && (onTopFence && !isBlankLine(lines[i - 1]) || onBottomFence && !isBlankLine(lines[i + 1]))) {
6543 const [, prefix] = line.match(codeFencePrefixRe) || [];
6544 const fixInfo = prefix === void 0 ? null : {
6545 "lineNumber": i + (onTopFence ? 1 : 2),
6546 "insertText": `${prefix}
6549 addErrorContext(onError, i + 1, lines[i].trim(), null, null, null, fixInfo);
6557 // node_modules/markdownlint/lib/md032.js
6558 var require_md032 = __commonJS({
6559 "node_modules/markdownlint/lib/md032.js"(exports, module2) {
6561 var { addErrorContext, isBlankLine } = require_helpers2();
6562 var { flattenedLists } = require_cache();
6563 var quotePrefixRe = /^[>\s]*/;
6565 "names": ["MD032", "blanks-around-lists"],
6566 "description": "Lists should be surrounded by blank lines",
6567 "tags": ["bullet", "ul", "ol", "blank_lines"],
6568 "function": function MD032(params, onError) {
6569 const { lines } = params;
6570 flattenedLists().filter((list) => !list.nesting).forEach((list) => {
6571 const firstIndex = list.open.map[0];
6572 if (!isBlankLine(lines[firstIndex - 1])) {
6573 const line = lines[firstIndex];
6574 const quotePrefix = line.match(quotePrefixRe)[0].trimEnd();
6575 addErrorContext(onError, firstIndex + 1, line.trim(), null, null, null, {
6576 "insertText": `${quotePrefix}
6580 const lastIndex = list.lastLineIndex - 1;
6581 if (!isBlankLine(lines[lastIndex + 1])) {
6582 const line = lines[lastIndex];
6583 const quotePrefix = line.match(quotePrefixRe)[0].trimEnd();
6584 addErrorContext(onError, lastIndex + 1, line.trim(), null, null, null, {
6585 "lineNumber": lastIndex + 2,
6586 "insertText": `${quotePrefix}
6596 // node_modules/markdownlint/lib/md033.js
6597 var require_md033 = __commonJS({
6598 "node_modules/markdownlint/lib/md033.js"(exports, module2) {
6600 var { addError, forEachLine, unescapeMarkdown } = require_helpers2();
6601 var { lineMetadata } = require_cache();
6602 var htmlElementRe = /<(([A-Za-z][A-Za-z0-9-]*)(?:\s[^>]*)?)\/?>/g;
6603 var linkDestinationRe = /]\(\s*$/;
6604 var inlineCodeRe = /^[^`]*(`+[^`]+`+[^`]+)*`+[^`]*$/;
6605 var emailAddressRe = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
6607 "names": ["MD033", "no-inline-html"],
6608 "description": "Inline HTML",
6610 "function": function MD033(params, onError) {
6611 let allowedElements = params.config.allowed_elements;
6612 allowedElements = Array.isArray(allowedElements) ? allowedElements : [];
6613 allowedElements = allowedElements.map((element) => element.toLowerCase());
6614 forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
6616 while (!inCode && (match = htmlElementRe.exec(line)) !== null) {
6617 const [tag, content, element] = match;
6618 if (!allowedElements.includes(element.toLowerCase()) && !tag.endsWith("\\>") && !emailAddressRe.test(content)) {
6619 const prefix = line.substring(0, match.index);
6620 if (!linkDestinationRe.test(prefix) && !inlineCodeRe.test(prefix)) {
6621 const unescaped = unescapeMarkdown(prefix + "<", "_");
6622 if (!unescaped.endsWith("_") && (unescaped + "`").match(/`/g).length % 2) {
6623 addError(onError, lineIndex + 1, "Element: " + element, null, [match.index + 1, tag.length]);
6634 // node_modules/markdownlint/lib/md034.js
6635 var require_md034 = __commonJS({
6636 "node_modules/markdownlint/lib/md034.js"(exports, module2) {
6638 var { addErrorContext, bareUrlRe, filterTokens } = require_helpers2();
6640 "names": ["MD034", "no-bare-urls"],
6641 "description": "Bare URL used",
6642 "tags": ["links", "url"],
6643 "function": function MD034(params, onError) {
6644 filterTokens(params, "inline", (token) => {
6646 token.children.forEach((child) => {
6647 const { content, line, lineNumber, type: type2 } = child;
6649 if (type2 === "link_open") {
6651 } else if (type2 === "link_close") {
6653 } else if (type2 === "text" && !inLink) {
6654 while ((match = bareUrlRe.exec(content)) !== null) {
6655 const [bareUrl] = match;
6656 const matchIndex = match.index;
6657 const bareUrlLength = bareUrl.length;
6658 const leftChar = content[matchIndex - 1];
6659 const rightChar = content[matchIndex + bareUrlLength];
6660 if (!(leftChar === "[" && rightChar === "]") && !(leftChar === '"' && rightChar === '"') && !(leftChar === "'" && rightChar === "'")) {
6661 const index = line.indexOf(content);
6662 const range = index === -1 ? null : [
6663 index + matchIndex + 1,
6666 const fixInfo = range ? {
6667 "editColumn": range[0],
6668 "deleteCount": range[1],
6669 "insertText": `<${bareUrl}>`
6671 addErrorContext(onError, lineNumber, bareUrl, null, null, range, fixInfo);
6682 // node_modules/markdownlint/lib/md035.js
6683 var require_md035 = __commonJS({
6684 "node_modules/markdownlint/lib/md035.js"(exports, module2) {
6686 var { addErrorDetailIf, filterTokens } = require_helpers2();
6688 "names": ["MD035", "hr-style"],
6689 "description": "Horizontal rule style",
6691 "function": function MD035(params, onError) {
6692 let style = String(params.config.style || "consistent");
6693 filterTokens(params, "hr", function forToken(token) {
6694 const lineTrim = token.line.trim();
6695 if (style === "consistent") {
6698 addErrorDetailIf(onError, token.lineNumber, style, lineTrim);
6705 // node_modules/markdownlint/lib/md036.js
6706 var require_md036 = __commonJS({
6707 "node_modules/markdownlint/lib/md036.js"(exports, module2) {
6709 var { addErrorContext, allPunctuation } = require_helpers2();
6711 "names": ["MD036", "no-emphasis-as-heading", "no-emphasis-as-header"],
6712 "description": "Emphasis used instead of a heading",
6713 "tags": ["headings", "headers", "emphasis"],
6714 "function": function MD036(params, onError) {
6715 let punctuation = params.config.punctuation;
6716 punctuation = String(punctuation === void 0 ? allPunctuation : punctuation);
6717 const re = new RegExp("[" + punctuation + "]$");
6718 function base(token) {
6719 if (token.type === "paragraph_open") {
6720 return function inParagraph(t) {
6721 const children = t.children.filter(function notEmptyText(child) {
6722 return child.type !== "text" || child.content !== "";
6724 if (children.length === 3 && (children[0].type === "strong_open" || children[0].type === "em_open") && children[1].type === "text" && !re.test(children[1].content)) {
6725 addErrorContext(onError, t.lineNumber, children[1].content);
6729 } else if (token.type === "blockquote_open") {
6730 return function inBlockquote(t) {
6731 if (t.type !== "blockquote_close") {
6732 return inBlockquote;
6736 } else if (token.type === "list_item_open") {
6737 return function inListItem(t) {
6738 if (t.type !== "list_item_close") {
6747 params.tokens.forEach(function forToken(token) {
6748 state = state(token);
6755 // node_modules/markdownlint/lib/md037.js
6756 var require_md037 = __commonJS({
6757 "node_modules/markdownlint/lib/md037.js"(exports, module2) {
6759 var { addErrorContext, emphasisMarkersInContent, forEachLine, isBlankLine } = require_helpers2();
6760 var { lineMetadata } = require_cache();
6761 var emphasisRe = /(^|[^\\]|\\\\)(?:(\*\*?\*?)|(__?_?))/g;
6762 var asteriskListItemMarkerRe = /^([\s>]*)\*(\s+)/;
6763 var leftSpaceRe = /^\s+/;
6764 var rightSpaceRe = /\s+$/;
6765 var tablePipeRe = /\|/;
6767 "names": ["MD037", "no-space-in-emphasis"],
6768 "description": "Spaces inside emphasis markers",
6769 "tags": ["whitespace", "emphasis"],
6770 "function": function MD037(params, onError) {
6771 let effectiveEmphasisLength, emphasisIndex, emphasisKind, emphasisLength, pendingError = null;
6772 function resetRunTracking() {
6776 effectiveEmphasisLength = 0;
6777 pendingError = null;
6779 function handleRunEnd(line, lineIndex, contextLength, match, matchIndex, inTable) {
6780 let content = line.substring(emphasisIndex, matchIndex);
6781 if (!emphasisLength) {
6782 content = content.trimStart();
6785 content = content.trimEnd();
6787 const leftSpace = leftSpaceRe.test(content);
6788 const rightSpace = rightSpaceRe.test(content);
6789 if ((leftSpace || rightSpace) && (!inTable || !tablePipeRe.test(content))) {
6790 const contextStart = emphasisIndex - emphasisLength;
6791 const contextEnd = matchIndex + contextLength;
6792 const context = line.substring(contextStart, contextEnd);
6793 const column = contextStart + 1;
6794 const length = contextEnd - contextStart;
6795 const leftMarker = line.substring(contextStart, emphasisIndex);
6796 const rightMarker = match ? match[2] || match[3] : "";
6797 const fixedText = `${leftMarker}${content.trim()}${rightMarker}`;
6806 "editColumn": column,
6807 "deleteCount": length,
6808 "insertText": fixedText
6814 const ignoreMarkersByLine = emphasisMarkersInContent(params);
6816 forEachLine(lineMetadata(), (line, lineIndex, inCode, onFence, inTable, inItem, onBreak, inMath) => {
6817 const onItemStart = inItem === 1;
6818 if (inCode || onFence || inTable || onBreak || onItemStart || isBlankLine(line)) {
6821 if (inCode || onFence || onBreak || inMath) {
6825 line = line.replace(asteriskListItemMarkerRe, "$1 $2");
6828 while (match = emphasisRe.exec(line)) {
6829 const ignoreMarkersForLine = ignoreMarkersByLine[lineIndex] || [];
6830 const matchIndex = match.index + match[1].length;
6831 if (ignoreMarkersForLine.includes(matchIndex)) {
6834 const matchLength = match[0].length - match[1].length;
6835 const matchKind = (match[2] || match[3])[0];
6836 if (emphasisIndex === -1) {
6837 emphasisIndex = matchIndex + matchLength;
6838 emphasisLength = matchLength;
6839 emphasisKind = matchKind;
6840 effectiveEmphasisLength = matchLength;
6841 } else if (matchKind === emphasisKind) {
6842 if (matchLength === effectiveEmphasisLength) {
6844 addErrorContext(...pendingError);
6845 pendingError = null;
6847 const error = handleRunEnd(line, lineIndex, effectiveEmphasisLength, match, matchIndex, inTable);
6849 addErrorContext(...error);
6852 } else if (matchLength === 3) {
6853 effectiveEmphasisLength = matchLength - effectiveEmphasisLength;
6854 } else if (effectiveEmphasisLength === 3) {
6855 effectiveEmphasisLength -= matchLength;
6857 effectiveEmphasisLength += matchLength;
6859 if (emphasisRe.lastIndex > 1) {
6860 emphasisRe.lastIndex--;
6862 } else if (emphasisRe.lastIndex > 1) {
6863 emphasisRe.lastIndex--;
6866 if (emphasisIndex !== -1) {
6867 pendingError = pendingError || handleRunEnd(line, lineIndex, 0, null, line.length, inTable);
6877 // node_modules/markdownlint/lib/md038.js
6878 var require_md038 = __commonJS({
6879 "node_modules/markdownlint/lib/md038.js"(exports, module2) {
6881 var { addErrorContext, filterTokens, forEachInlineCodeSpan, newLineRe } = require_helpers2();
6882 var leftSpaceRe = /^\s([^`]|$)/;
6883 var rightSpaceRe = /[^`]\s$/;
6884 var singleLeftRightSpaceRe = /^\s(?:\S.*\S|\S)\s$/;
6886 "names": ["MD038", "no-space-in-code"],
6887 "description": "Spaces inside code span elements",
6888 "tags": ["whitespace", "code"],
6889 "function": function MD038(params, onError) {
6890 filterTokens(params, "inline", (token) => {
6891 if (token.children.some((child) => child.type === "code_inline")) {
6892 const tokenLines = params.lines.slice(token.map[0], token.map[1]);
6893 forEachInlineCodeSpan(tokenLines.join("\n"), (code, lineIndex, columnIndex, tickCount) => {
6894 let rangeIndex = columnIndex - tickCount;
6895 let rangeLength = code.length + 2 * tickCount;
6896 let rangeLineOffset = 0;
6897 let fixIndex = columnIndex;
6898 let fixLength = code.length;
6899 const codeLines = code.split(newLineRe);
6900 const left = leftSpaceRe.test(code);
6901 const right = !left && rightSpaceRe.test(code);
6902 if (right && codeLines.length > 1) {
6904 rangeLineOffset = codeLines.length - 1;
6907 const allowed = singleLeftRightSpaceRe.test(code);
6908 if ((left || right) && !allowed) {
6909 const codeLinesRange = codeLines[rangeLineOffset];
6910 if (codeLines.length > 1) {
6911 rangeLength = codeLinesRange.length + tickCount;
6912 fixLength = codeLinesRange.length;
6914 const context = tokenLines[lineIndex + rangeLineOffset].substring(rangeIndex, rangeIndex + rangeLength);
6915 const codeLinesRangeTrim = codeLinesRange.trim();
6916 const fixText = (codeLinesRangeTrim.startsWith("`") ? " " : "") + codeLinesRangeTrim + (codeLinesRangeTrim.endsWith("`") ? " " : "");
6917 addErrorContext(onError, token.lineNumber + lineIndex + rangeLineOffset, context, left, right, [rangeIndex + 1, rangeLength], {
6918 "editColumn": fixIndex + 1,
6919 "deleteCount": fixLength,
6920 "insertText": fixText
6931 // node_modules/markdownlint/lib/md039.js
6932 var require_md039 = __commonJS({
6933 "node_modules/markdownlint/lib/md039.js"(exports, module2) {
6935 var { addErrorContext, filterTokens } = require_helpers2();
6936 var spaceInLinkRe = /\[(?:\s+(?:[^\]]*?)\s*|(?:[^\]]*?)\s+)](?=\(\S*\))/;
6938 "names": ["MD039", "no-space-in-links"],
6939 "description": "Spaces inside link text",
6940 "tags": ["whitespace", "links"],
6941 "function": function MD039(params, onError) {
6942 filterTokens(params, "inline", (token) => {
6943 const { children } = token;
6944 let { lineNumber } = token;
6948 children.forEach((child) => {
6949 const { content, type: type2 } = child;
6950 if (type2 === "link_open") {
6953 } else if (type2 === "link_close") {
6955 const left = linkText.trimStart().length !== linkText.length;
6956 const right = linkText.trimEnd().length !== linkText.length;
6957 if (left || right) {
6958 const line = params.lines[lineNumber - 1];
6961 const match = line.slice(lineIndex).match(spaceInLinkRe);
6963 const column = match.index + lineIndex + 1;
6964 const length = match[0].length;
6965 range = [column, length];
6967 "editColumn": column + 1,
6968 "deleteCount": length - 2,
6969 "insertText": linkText.trim()
6971 lineIndex = column + length - 1;
6973 addErrorContext(onError, lineNumber, `[${linkText}]`, left, right, range, fixInfo);
6975 } else if (type2 === "softbreak" || type2 === "hardbreak") {
6978 } else if (inLink) {
6979 linkText += content;
6988 // node_modules/markdownlint/lib/md040.js
6989 var require_md040 = __commonJS({
6990 "node_modules/markdownlint/lib/md040.js"(exports, module2) {
6992 var { addErrorContext, filterTokens } = require_helpers2();
6994 "names": ["MD040", "fenced-code-language"],
6995 "description": "Fenced code blocks should have a language specified",
6996 "tags": ["code", "language"],
6997 "function": function MD040(params, onError) {
6998 filterTokens(params, "fence", function forToken(token) {
6999 if (!token.info.trim()) {
7000 addErrorContext(onError, token.lineNumber, token.line);
7008 // node_modules/markdownlint/lib/md041.js
7009 var require_md041 = __commonJS({
7010 "node_modules/markdownlint/lib/md041.js"(exports, module2) {
7012 var { addErrorContext, frontMatterHasTitle } = require_helpers2();
7014 "names": ["MD041", "first-line-heading", "first-line-h1"],
7015 "description": "First line in a file should be a top-level heading",
7016 "tags": ["headings", "headers"],
7017 "function": function MD041(params, onError) {
7018 const level = Number(params.config.level || 1);
7019 const tag = "h" + level;
7020 const foundFrontMatterTitle = frontMatterHasTitle(params.frontMatterLines, params.config.front_matter_title);
7021 if (!foundFrontMatterTitle) {
7022 const htmlHeadingRe = new RegExp(`^<h${level}[ />]`, "i");
7023 params.tokens.every((token) => {
7024 let isError = false;
7025 if (token.type === "html_block") {
7026 if (token.content.startsWith("<!--")) {
7028 } else if (!htmlHeadingRe.test(token.content)) {
7031 } else if (token.type !== "heading_open" || token.tag !== tag) {
7035 addErrorContext(onError, token.lineNumber, token.line);
7045 // node_modules/markdownlint/lib/md042.js
7046 var require_md042 = __commonJS({
7047 "node_modules/markdownlint/lib/md042.js"(exports, module2) {
7049 var { addErrorContext, filterTokens, rangeFromRegExp } = require_helpers2();
7050 var emptyLinkRe = /\[[^\]]*](?:\((?:#?|(?:<>))\))/;
7052 "names": ["MD042", "no-empty-links"],
7053 "description": "No empty links",
7055 "function": function MD042(params, onError) {
7056 filterTokens(params, "inline", function forToken(token) {
7059 let emptyLink = false;
7060 token.children.forEach(function forChild(child) {
7061 if (child.type === "link_open") {
7064 child.attrs.forEach(function forAttr(attr) {
7065 if (attr[0] === "href" && (!attr[1] || attr[1] === "#")) {
7069 } else if (child.type === "link_close") {
7072 addErrorContext(onError, child.lineNumber, "[" + linkText + "]()", null, null, rangeFromRegExp(child.line, emptyLinkRe));
7075 } else if (inLink) {
7076 linkText += child.content;
7085 // node_modules/markdownlint/lib/md043.js
7086 var require_md043 = __commonJS({
7087 "node_modules/markdownlint/lib/md043.js"(exports, module2) {
7089 var { addErrorContext, addErrorDetailIf, forEachHeading } = require_helpers2();
7091 "names": ["MD043", "required-headings", "required-headers"],
7092 "description": "Required heading structure",
7093 "tags": ["headings", "headers"],
7094 "function": function MD043(params, onError) {
7095 const requiredHeadings = params.config.headings || params.config.headers;
7096 if (Array.isArray(requiredHeadings)) {
7098 [1, 2, 3, 4, 5, 6].forEach((level) => {
7099 levels["h" + level] = "######".substr(-level);
7102 let matchAny = false;
7103 let hasError = false;
7104 let anyHeadings = false;
7105 const getExpected = () => requiredHeadings[i++] || "[None]";
7106 forEachHeading(params, (heading, content) => {
7109 const actual = levels[heading.tag] + " " + content;
7110 const expected = getExpected();
7111 if (expected === "*") {
7112 const nextExpected = getExpected();
7113 if (nextExpected.toLowerCase() !== actual.toLowerCase()) {
7117 } else if (expected === "+") {
7119 } else if (expected.toLowerCase() === actual.toLowerCase()) {
7121 } else if (matchAny) {
7124 addErrorDetailIf(onError, heading.lineNumber, expected, actual);
7129 const extraHeadings = requiredHeadings.length - i;
7130 if (!hasError && (extraHeadings > 1 || extraHeadings === 1 && requiredHeadings[i] !== "*") && (anyHeadings || !requiredHeadings.every((heading) => heading === "*"))) {
7131 addErrorContext(onError, params.lines.length, requiredHeadings[i]);
7139 // node_modules/markdownlint/lib/md044.js
7140 var require_md044 = __commonJS({
7141 "node_modules/markdownlint/lib/md044.js"(exports, module2) {
7151 } = require_helpers2();
7152 var { inlineCodeSpanRanges, lineMetadata } = require_cache();
7154 "names": ["MD044", "proper-names"],
7155 "description": "Proper names should have the correct capitalization",
7156 "tags": ["spelling"],
7157 "function": function MD044(params, onError) {
7158 let names = params.config.names;
7159 names = Array.isArray(names) ? names : [];
7160 names.sort((a, b) => b.length - a.length || a.localeCompare(b));
7161 const codeBlocks = params.config.code_blocks;
7162 const includeCodeBlocks = codeBlocks === void 0 ? true : !!codeBlocks;
7163 const exclusions = [];
7164 forEachLine(lineMetadata(), (line, lineIndex) => {
7165 if (linkReferenceRe.test(line)) {
7166 exclusions.push([lineIndex, 0, line.length]);
7169 while ((match = bareUrlRe.exec(line)) !== null) {
7170 exclusions.push([lineIndex, match.index, match[0].length]);
7172 while ((match = linkRe.exec(line)) !== null) {
7173 const [, text, destination] = match;
7175 exclusions.push([lineIndex, match.index + text.length, destination.length]);
7180 if (!includeCodeBlocks) {
7181 exclusions.push(...inlineCodeSpanRanges());
7183 for (const name of names) {
7184 const escapedName = escapeForRegExp(name);
7185 const startNamePattern = /^\W/.test(name) ? "" : "\\b_*";
7186 const endNamePattern = /\W$/.test(name) ? "" : "_*\\b";
7187 const namePattern = `(${startNamePattern})(${escapedName})${endNamePattern}`;
7188 const nameRe = new RegExp(namePattern, "gi");
7189 forEachLine(lineMetadata(), (line, lineIndex, inCode, onFence) => {
7190 if (includeCodeBlocks || !inCode && !onFence) {
7192 while ((match = nameRe.exec(line)) !== null) {
7193 const [, leftMatch, nameMatch] = match;
7194 const index = match.index + leftMatch.length;
7195 const length = nameMatch.length;
7196 if (!overlapsAnyRange(exclusions, lineIndex, index, length)) {
7197 addErrorDetailIf(onError, lineIndex + 1, name, nameMatch, null, null, [index + 1, length], {
7198 "editColumn": index + 1,
7199 "deleteCount": length,
7203 exclusions.push([lineIndex, index, length]);
7213 // node_modules/markdownlint/lib/md045.js
7214 var require_md045 = __commonJS({
7215 "node_modules/markdownlint/lib/md045.js"(exports, module2) {
7217 var { addError, forEachInlineChild } = require_helpers2();
7219 "names": ["MD045", "no-alt-text"],
7220 "description": "Images should have alternate text (alt text)",
7221 "tags": ["accessibility", "images"],
7222 "function": function MD045(params, onError) {
7223 forEachInlineChild(params, "image", function forToken(token) {
7224 if (token.content === "") {
7225 addError(onError, token.lineNumber);
7233 // node_modules/markdownlint/lib/md046.js
7234 var require_md046 = __commonJS({
7235 "node_modules/markdownlint/lib/md046.js"(exports, module2) {
7237 var { addErrorDetailIf } = require_helpers2();
7238 var tokenTypeToStyle = {
7240 "code_block": "indented"
7243 "names": ["MD046", "code-block-style"],
7244 "description": "Code block style",
7246 "function": function MD046(params, onError) {
7247 let expectedStyle = String(params.config.style || "consistent");
7248 params.tokens.filter((token) => token.type === "code_block" || token.type === "fence").forEach((token) => {
7249 const { lineNumber, type: type2 } = token;
7250 if (expectedStyle === "consistent") {
7251 expectedStyle = tokenTypeToStyle[type2];
7253 addErrorDetailIf(onError, lineNumber, expectedStyle, tokenTypeToStyle[type2]);
7260 // node_modules/markdownlint/lib/md047.js
7261 var require_md047 = __commonJS({
7262 "node_modules/markdownlint/lib/md047.js"(exports, module2) {
7264 var { addError, isBlankLine } = require_helpers2();
7266 "names": ["MD047", "single-trailing-newline"],
7267 "description": "Files should end with a single newline character",
7268 "tags": ["blank_lines"],
7269 "function": function MD047(params, onError) {
7270 const lastLineNumber = params.lines.length;
7271 const lastLine = params.lines[lastLineNumber - 1];
7272 if (!isBlankLine(lastLine)) {
7273 addError(onError, lastLineNumber, null, null, [lastLine.length, 1], {
7275 "editColumn": lastLine.length + 1
7283 // node_modules/markdownlint/lib/md048.js
7284 var require_md048 = __commonJS({
7285 "node_modules/markdownlint/lib/md048.js"(exports, module2) {
7287 var { addErrorDetailIf, fencedCodeBlockStyleFor } = require_helpers2();
7289 "names": ["MD048", "code-fence-style"],
7290 "description": "Code fence style",
7292 "function": function MD048(params, onError) {
7293 const style = String(params.config.style || "consistent");
7294 let expectedStyle = style;
7295 params.tokens.filter((token) => token.type === "fence").forEach((fenceToken) => {
7296 const { lineNumber, markup } = fenceToken;
7297 if (expectedStyle === "consistent") {
7298 expectedStyle = fencedCodeBlockStyleFor(markup);
7300 addErrorDetailIf(onError, lineNumber, expectedStyle, fencedCodeBlockStyleFor(markup));
7307 // node_modules/markdownlint/lib/rules.js
7308 var require_rules = __commonJS({
7309 "node_modules/markdownlint/lib/rules.js"(exports, module2) {
7311 var URL2 = require("url").URL;
7312 var packageJson = require_package();
7313 var homepage = packageJson.homepage;
7314 var version = packageJson.version;
7361 rules.forEach((rule) => {
7362 const name = rule.names[0].toLowerCase();
7363 rule["information"] = new URL2(`${homepage}/blob/v${version}/doc/Rules.md#${name}`);
7365 module2.exports = rules;
7369 // node_modules/markdownlint/lib/markdownlint.js
7370 var require_markdownlint = __commonJS({
7371 "node_modules/markdownlint/lib/markdownlint.js"(exports, module2) {
7373 var path2 = require("path");
7374 var { promisify } = require("util");
7375 var markdownIt = require_markdown_it();
7376 var rules = require_rules();
7377 var helpers = require_helpers2();
7378 var cache = require_cache();
7379 var dynamicRequire = typeof __non_webpack_require__ === "undefined" ? require : __non_webpack_require__;
7380 var deprecatedRuleNames = ["MD002", "MD006"];
7381 function validateRuleList(ruleList) {
7383 if (ruleList.length === rules.length) {
7387 ruleList.forEach(function forRule(rule, index) {
7388 const customIndex = index - rules.length;
7389 function newError(property) {
7390 return new Error("Property '" + property + "' of custom rule at index " + customIndex + " is incorrect.");
7392 ["names", "tags"].forEach(function forProperty(property) {
7393 const value = rule[property];
7394 if (!result && (!value || !Array.isArray(value) || value.length === 0 || !value.every(helpers.isString) || value.some(helpers.isEmptyString))) {
7395 result = newError(property);
7399 ["description", "string"],
7400 ["function", "function"]
7401 ].forEach(function forProperty(propertyInfo) {
7402 const property = propertyInfo[0];
7403 const value = rule[property];
7404 if (!result && (!value || typeof value !== propertyInfo[1])) {
7405 result = newError(property);
7408 if (!result && rule.information && Object.getPrototypeOf(rule.information) !== URL.prototype) {
7409 result = newError("information");
7412 rule.names.forEach(function forName(name) {
7413 const nameUpper = name.toUpperCase();
7414 if (!result && allIds[nameUpper] !== void 0) {
7415 result = new Error("Name '" + name + "' of custom rule at index " + customIndex + " is already used as a name or tag.");
7417 allIds[nameUpper] = true;
7419 rule.tags.forEach(function forTag(tag) {
7420 const tagUpper = tag.toUpperCase();
7421 if (!result && allIds[tagUpper]) {
7422 result = new Error("Tag '" + tag + "' of custom rule at index " + customIndex + " is already used as a name.");
7424 allIds[tagUpper] = false;
7430 function newResults(ruleList) {
7431 const lintResults = {};
7432 function toString2(useAlias) {
7433 let ruleNameToRule = null;
7435 const keys = Object.keys(lintResults);
7437 keys.forEach(function forFile(file) {
7438 const fileResults = lintResults[file];
7439 if (Array.isArray(fileResults)) {
7440 fileResults.forEach(function forResult(result) {
7441 const ruleMoniker = result.ruleNames ? result.ruleNames.join("/") : result.ruleName + "/" + result.ruleAlias;
7442 results.push(file + ": " + result.lineNumber + ": " + ruleMoniker + " " + result.ruleDescription + (result.errorDetail ? " [" + result.errorDetail + "]" : "") + (result.errorContext ? ' [Context: "' + result.errorContext + '"]' : ""));
7445 if (!ruleNameToRule) {
7446 ruleNameToRule = {};
7447 ruleList.forEach(function forRule(rule) {
7448 const ruleName = rule.names[0].toUpperCase();
7449 ruleNameToRule[ruleName] = rule;
7452 Object.keys(fileResults).forEach(function forRule(ruleName) {
7453 const rule = ruleNameToRule[ruleName.toUpperCase()];
7454 const ruleResults = fileResults[ruleName];
7455 ruleResults.forEach(function forLine(lineNumber) {
7456 const nameIndex = Math.min(useAlias ? 1 : 0, rule.names.length - 1);
7457 const result = file + ": " + lineNumber + ": " + rule.names[nameIndex] + " " + rule.description;
7458 results.push(result);
7463 return results.join("\n");
7465 Object.defineProperty(lintResults, "toString", { "value": toString2 });
7468 function removeFrontMatter(content, frontMatter) {
7469 let frontMatterLines = [];
7471 const frontMatterMatch = content.match(frontMatter);
7472 if (frontMatterMatch && !frontMatterMatch.index) {
7473 const contentMatched = frontMatterMatch[0];
7474 content = content.slice(contentMatched.length);
7475 frontMatterLines = contentMatched.split(helpers.newLineRe);
7476 if (frontMatterLines.length > 0 && frontMatterLines[frontMatterLines.length - 1] === "") {
7477 frontMatterLines.length--;
7483 "frontMatterLines": frontMatterLines
7486 function annotateTokens(tokens, lines) {
7487 let tableMap = null;
7488 tokens.forEach(function forToken(token) {
7489 if (token.type === "thead_open" || token.type === "tbody_open") {
7490 tableMap = [...token.map];
7491 } else if (token.type === "tr_close" && tableMap) {
7493 } else if (token.type === "thead_close" || token.type === "tbody_close") {
7496 if (tableMap && !token.map) {
7497 token.map = [...tableMap];
7500 token.line = lines[token.map[0]];
7501 token.lineNumber = token.map[0] + 1;
7502 while (token.map[1] && !(lines[token.map[1] - 1] || "").trim()) {
7505 let lineNumber = token.lineNumber;
7506 const codeSpanExtraLines = [];
7507 helpers.forEachInlineCodeSpan(token.content, function handleInlineCodeSpan(code) {
7508 codeSpanExtraLines.push(code.split(helpers.newLineRe).length - 1);
7510 (token.children || []).forEach(function forChild(child) {
7511 child.lineNumber = lineNumber;
7512 child.line = lines[lineNumber - 1];
7513 if (child.type === "softbreak" || child.type === "hardbreak") {
7515 } else if (child.type === "code_inline") {
7516 lineNumber += codeSpanExtraLines.shift();
7522 function mapAliasToRuleNames(ruleList) {
7523 const aliasToRuleNames = {};
7524 ruleList.forEach(function forRule(rule) {
7525 const ruleName = rule.names[0].toUpperCase();
7526 rule.names.forEach(function forName(name) {
7527 const nameUpper = name.toUpperCase();
7528 aliasToRuleNames[nameUpper] = [ruleName];
7530 rule.tags.forEach(function forTag(tag) {
7531 const tagUpper = tag.toUpperCase();
7532 const ruleNames = aliasToRuleNames[tagUpper] || [];
7533 ruleNames.push(ruleName);
7534 aliasToRuleNames[tagUpper] = ruleNames;
7537 return aliasToRuleNames;
7539 function getEffectiveConfig(ruleList, config2, aliasToRuleNames) {
7540 const defaultKey = Object.keys(config2).filter((key) => key.toUpperCase() === "DEFAULT");
7541 const ruleDefault = defaultKey.length === 0 || !!config2[defaultKey[0]];
7542 const effectiveConfig = {};
7543 ruleList.forEach((rule) => {
7544 const ruleName = rule.names[0].toUpperCase();
7545 effectiveConfig[ruleName] = ruleDefault;
7547 deprecatedRuleNames.forEach((ruleName) => {
7548 effectiveConfig[ruleName] = false;
7550 Object.keys(config2).forEach((key) => {
7551 let value = config2[key];
7553 if (!(value instanceof Object)) {
7559 const keyUpper = key.toUpperCase();
7560 (aliasToRuleNames[keyUpper] || []).forEach((ruleName) => {
7561 effectiveConfig[ruleName] = value;
7564 return effectiveConfig;
7566 function getEnabledRulesPerLineNumber(ruleList, lines, frontMatterLines, noInlineConfig, config2, aliasToRuleNames) {
7567 let enabledRules = {};
7568 let capturedRules = {};
7569 const allRuleNames = [];
7570 const enabledRulesPerLineNumber = new Array(1 + frontMatterLines.length);
7571 function handleInlineConfig(perLine, forEachMatch, forEachLine) {
7572 const input = perLine ? lines : [lines.join("\n")];
7573 input.forEach((line, lineIndex) => {
7574 if (!noInlineConfig) {
7576 while (match = helpers.inlineCommentRe.exec(line)) {
7577 const action = (match[1] || match[3]).toUpperCase();
7578 const parameter = match[2] || match[4];
7579 forEachMatch(action, parameter, lineIndex + 1);
7587 function configureFile(action, parameter) {
7588 if (action === "CONFIGURE-FILE") {
7590 const json2 = JSON.parse(parameter);
7591 config2 = __spreadValues(__spreadValues({}, config2), json2);
7596 function applyEnableDisable(action, parameter, state) {
7597 const enabled = action.startsWith("ENABLE");
7598 const items = parameter ? parameter.trim().toUpperCase().split(/\s+/) : allRuleNames;
7599 items.forEach((nameUpper) => {
7600 (aliasToRuleNames[nameUpper] || []).forEach((ruleName) => {
7601 state[ruleName] = enabled;
7605 function enableDisableFile(action, parameter) {
7606 if (action === "ENABLE-FILE" || action === "DISABLE-FILE") {
7607 applyEnableDisable(action, parameter, enabledRules);
7610 function captureRestoreEnableDisable(action, parameter) {
7611 if (action === "CAPTURE") {
7612 capturedRules = __spreadValues({}, enabledRules);
7613 } else if (action === "RESTORE") {
7614 enabledRules = __spreadValues({}, capturedRules);
7615 } else if (action === "ENABLE" || action === "DISABLE") {
7616 enabledRules = __spreadValues({}, enabledRules);
7617 applyEnableDisable(action, parameter, enabledRules);
7620 function updateLineState() {
7621 enabledRulesPerLineNumber.push(__spreadValues({}, enabledRules));
7623 function disableNextLine(action, parameter, lineNumber) {
7624 if (action === "DISABLE-NEXT-LINE") {
7625 applyEnableDisable(action, parameter, enabledRulesPerLineNumber[lineNumber + 1] || {});
7628 handleInlineConfig(false, configureFile);
7629 const effectiveConfig = getEffectiveConfig(ruleList, config2, aliasToRuleNames);
7630 ruleList.forEach((rule) => {
7631 const ruleName = rule.names[0].toUpperCase();
7632 allRuleNames.push(ruleName);
7633 enabledRules[ruleName] = !!effectiveConfig[ruleName];
7635 capturedRules = enabledRules;
7636 handleInlineConfig(true, enableDisableFile);
7637 handleInlineConfig(true, captureRestoreEnableDisable, updateLineState);
7638 handleInlineConfig(true, disableNextLine);
7641 enabledRulesPerLineNumber
7644 function lineNumberComparison(a, b) {
7645 return a.lineNumber - b.lineNumber;
7647 function filterAllValues() {
7650 function uniqueFilterForSortedErrors(value, index, array) {
7651 return index === 0 || value.lineNumber > array[index - 1].lineNumber;
7653 function lintContent(ruleList, name, content, md, config2, frontMatter, handleRuleFailures, noInlineConfig, resultVersion, callback) {
7654 content = content.replace(/^\uFEFF/, "");
7655 const removeFrontMatterResult = removeFrontMatter(content, frontMatter);
7656 const frontMatterLines = removeFrontMatterResult.frontMatterLines;
7657 content = helpers.clearHtmlCommentText(removeFrontMatterResult.content);
7658 const tokens = md.parse(content, {});
7659 const lines = content.split(helpers.newLineRe);
7660 annotateTokens(tokens, lines);
7661 const aliasToRuleNames = mapAliasToRuleNames(ruleList);
7662 const { effectiveConfig, enabledRulesPerLineNumber } = getEnabledRulesPerLineNumber(ruleList, lines, frontMatterLines, noInlineConfig, config2, aliasToRuleNames);
7669 cache.lineMetadata(helpers.getLineMetadata(params));
7670 cache.flattenedLists(helpers.flattenLists(params.tokens));
7671 cache.inlineCodeSpanRanges(helpers.inlineCodeSpanRanges(params.lines));
7672 const result = resultVersion === 0 ? {} : [];
7673 function forRule(rule) {
7674 const ruleNameFriendly = rule.names[0];
7675 const ruleName = ruleNameFriendly.toUpperCase();
7676 params.config = effectiveConfig[ruleName];
7677 function throwError2(property) {
7678 throw new Error("Property '" + property + "' of onError parameter is incorrect.");
7681 function onError(errorInfo) {
7682 if (!errorInfo || !helpers.isNumber(errorInfo.lineNumber) || errorInfo.lineNumber < 1 || errorInfo.lineNumber > lines.length) {
7683 throwError2("lineNumber");
7685 if (errorInfo.detail && !helpers.isString(errorInfo.detail)) {
7686 throwError2("detail");
7688 if (errorInfo.context && !helpers.isString(errorInfo.context)) {
7689 throwError2("context");
7691 if (errorInfo.range && (!Array.isArray(errorInfo.range) || errorInfo.range.length !== 2 || !helpers.isNumber(errorInfo.range[0]) || errorInfo.range[0] < 1 || !helpers.isNumber(errorInfo.range[1]) || errorInfo.range[1] < 1 || errorInfo.range[0] + errorInfo.range[1] - 1 > lines[errorInfo.lineNumber - 1].length)) {
7692 throwError2("range");
7694 const fixInfo = errorInfo.fixInfo;
7695 const cleanFixInfo = {};
7697 if (!helpers.isObject(fixInfo)) {
7698 throwError2("fixInfo");
7700 if (fixInfo.lineNumber !== void 0) {
7701 if (!helpers.isNumber(fixInfo.lineNumber) || fixInfo.lineNumber < 1 || fixInfo.lineNumber > lines.length) {
7702 throwError2("fixInfo.lineNumber");
7704 cleanFixInfo.lineNumber = fixInfo.lineNumber + frontMatterLines.length;
7706 const effectiveLineNumber = fixInfo.lineNumber || errorInfo.lineNumber;
7707 if (fixInfo.editColumn !== void 0) {
7708 if (!helpers.isNumber(fixInfo.editColumn) || fixInfo.editColumn < 1 || fixInfo.editColumn > lines[effectiveLineNumber - 1].length + 1) {
7709 throwError2("fixInfo.editColumn");
7711 cleanFixInfo.editColumn = fixInfo.editColumn;
7713 if (fixInfo.deleteCount !== void 0) {
7714 if (!helpers.isNumber(fixInfo.deleteCount) || fixInfo.deleteCount < -1 || fixInfo.deleteCount > lines[effectiveLineNumber - 1].length) {
7715 throwError2("fixInfo.deleteCount");
7717 cleanFixInfo.deleteCount = fixInfo.deleteCount;
7719 if (fixInfo.insertText !== void 0) {
7720 if (!helpers.isString(fixInfo.insertText)) {
7721 throwError2("fixInfo.insertText");
7723 cleanFixInfo.insertText = fixInfo.insertText;
7727 "lineNumber": errorInfo.lineNumber + frontMatterLines.length,
7728 "detail": errorInfo.detail || null,
7729 "context": errorInfo.context || null,
7730 "range": errorInfo.range ? [...errorInfo.range] : null,
7731 "fixInfo": fixInfo ? cleanFixInfo : null
7734 if (handleRuleFailures) {
7736 rule.function(params, onError);
7740 "detail": `This rule threw an exception: ${error.message}`
7744 rule.function(params, onError);
7746 if (errors.length > 0) {
7747 errors.sort(lineNumberComparison);
7748 const filteredErrors = errors.filter(resultVersion === 3 ? filterAllValues : uniqueFilterForSortedErrors).filter(function removeDisabledRules(error) {
7749 return enabledRulesPerLineNumber[error.lineNumber][ruleName];
7750 }).map(function formatResults(error) {
7751 if (resultVersion === 0) {
7752 return error.lineNumber;
7754 const errorObject = {};
7755 errorObject.lineNumber = error.lineNumber;
7756 if (resultVersion === 1) {
7757 errorObject.ruleName = ruleNameFriendly;
7758 errorObject.ruleAlias = rule.names[1] || rule.names[0];
7760 errorObject.ruleNames = rule.names;
7762 errorObject.ruleDescription = rule.description;
7763 errorObject.ruleInformation = rule.information ? rule.information.href : null;
7764 errorObject.errorDetail = error.detail;
7765 errorObject.errorContext = error.context;
7766 errorObject.errorRange = error.range;
7767 if (resultVersion === 3) {
7768 errorObject.fixInfo = error.fixInfo;
7772 if (filteredErrors.length > 0) {
7773 if (resultVersion === 0) {
7774 result[ruleNameFriendly] = filteredErrors;
7776 Array.prototype.push.apply(result, filteredErrors);
7782 ruleList.forEach(forRule);
7785 return callback(error);
7788 return callback(null, result);
7790 function lintFile(ruleList, file, md, config2, frontMatter, handleRuleFailures, noInlineConfig, resultVersion, fs2, synchronous, callback) {
7791 function lintContentWrapper(err, content) {
7793 return callback(err);
7795 return lintContent(ruleList, file, content, md, config2, frontMatter, handleRuleFailures, noInlineConfig, resultVersion, callback);
7798 lintContentWrapper(null, fs2.readFileSync(file, "utf8"));
7800 fs2.readFile(file, "utf8", lintContentWrapper);
7803 function lintInput(options, synchronous, callback) {
7804 options = options || {};
7805 callback = callback || function noop() {
7807 const ruleList = rules.concat(options.customRules || []);
7808 const ruleErr = validateRuleList(ruleList);
7810 return callback(ruleErr);
7813 if (Array.isArray(options.files)) {
7814 files = [...options.files];
7815 } else if (options.files) {
7816 files = [String(options.files)];
7818 const strings = options.strings || {};
7819 const stringsKeys = Object.keys(strings);
7820 const config2 = options.config || { "default": true };
7821 const frontMatter = options.frontMatter === void 0 ? helpers.frontMatterRe : options.frontMatter;
7822 const handleRuleFailures = !!options.handleRuleFailures;
7823 const noInlineConfig = !!options.noInlineConfig;
7824 const resultVersion = options.resultVersion === void 0 ? 2 : options.resultVersion;
7825 const md = markdownIt({ "html": true });
7826 const markdownItPlugins = options.markdownItPlugins || [];
7827 markdownItPlugins.forEach(function forPlugin(plugin) {
7830 const fs2 = options.fs || require("fs");
7831 const results = newResults(ruleList);
7833 let syncItem = null;
7834 function syncCallback(err, result) {
7837 return callback(err);
7839 results[syncItem] = result;
7842 while (!done && (syncItem = stringsKeys.shift())) {
7843 lintContent(ruleList, syncItem, strings[syncItem] || "", md, config2, frontMatter, handleRuleFailures, noInlineConfig, resultVersion, syncCallback);
7846 while (!done && (syncItem = files.shift())) {
7847 lintFile(ruleList, syncItem, md, config2, frontMatter, handleRuleFailures, noInlineConfig, resultVersion, fs2, synchronous, syncCallback);
7849 return done || callback(null, results);
7851 let concurrency = 0;
7852 function lintConcurrently() {
7853 const asyncItem = files.shift();
7855 } else if (asyncItem) {
7857 lintFile(ruleList, asyncItem, md, config2, frontMatter, handleRuleFailures, noInlineConfig, resultVersion, fs2, synchronous, (err, result) => {
7861 return callback(err);
7863 results[asyncItem] = result;
7867 } else if (concurrency === 0) {
7869 return callback(null, results);
7883 function markdownlint(options, callback) {
7884 return lintInput(options, false, callback);
7886 var markdownlintPromisify = promisify && promisify(markdownlint);
7887 function markdownlintPromise(options) {
7888 return markdownlintPromisify(options);
7890 function markdownlintSync(options) {
7892 lintInput(options, true, function callback(error, res) {
7900 function parseConfiguration(name, content, parsers) {
7904 (parsers || [JSON.parse]).every((parser) => {
7906 config2 = parser(content);
7908 errors.push(error.message);
7913 errors.unshift(`Unable to parse '${name}'`);
7914 message = errors.join("; ");
7921 function resolveConfigExtends(configFile, referenceId, fs2, callback) {
7922 const configFileDirname = path2.dirname(configFile);
7923 const resolvedExtendsFile = path2.resolve(configFileDirname, referenceId);
7924 fs2.access(resolvedExtendsFile, (err) => {
7927 return callback(null, dynamicRequire.resolve(referenceId, { "paths": [configFileDirname] }));
7931 return callback(null, resolvedExtendsFile);
7934 function resolveConfigExtendsSync(configFile, referenceId, fs2) {
7935 const configFileDirname = path2.dirname(configFile);
7936 const resolvedExtendsFile = path2.resolve(configFileDirname, referenceId);
7938 fs2.accessSync(resolvedExtendsFile);
7939 return resolvedExtendsFile;
7943 return dynamicRequire.resolve(referenceId, { "paths": [configFileDirname] });
7946 return resolvedExtendsFile;
7948 function readConfig(file, parsers, fs2, callback) {
7959 fs2 = require("fs");
7961 fs2.readFile(file, "utf8", (err, content) => {
7963 return callback(err);
7965 const { config: config2, message } = parseConfiguration(file, content, parsers);
7967 return callback(new Error(message));
7969 const configExtends = config2.extends;
7970 if (configExtends) {
7971 delete config2.extends;
7972 return resolveConfigExtends(file, configExtends, fs2, (_, resolvedExtends) => readConfig(resolvedExtends, parsers, fs2, (errr, extendsConfig) => {
7974 return callback(errr);
7976 return callback(null, __spreadValues(__spreadValues({}, extendsConfig), config2));
7979 return callback(null, config2);
7982 var readConfigPromisify = promisify && promisify(readConfig);
7983 function readConfigPromise(file, parsers, fs2) {
7984 return readConfigPromisify(file, parsers, fs2);
7986 function readConfigSync2(file, parsers, fs2) {
7988 fs2 = require("fs");
7990 const content = fs2.readFileSync(file, "utf8");
7991 const { config: config2, message } = parseConfiguration(file, content, parsers);
7993 throw new Error(message);
7995 const configExtends = config2.extends;
7996 if (configExtends) {
7997 delete config2.extends;
7998 const resolvedExtends = resolveConfigExtendsSync(file, configExtends, fs2);
7999 return __spreadValues(__spreadValues({}, readConfigSync2(resolvedExtends, parsers, fs2)), config2);
8003 function getVersion() {
8004 return require_package().version;
8006 markdownlint.sync = markdownlintSync;
8007 markdownlint.readConfig = readConfig;
8008 markdownlint.readConfigSync = readConfigSync2;
8009 markdownlint.getVersion = getVersion;
8010 markdownlint.promises = {
8011 "markdownlint": markdownlintPromise,
8012 "readConfig": readConfigPromise
8014 module2.exports = markdownlint;
8018 // node_modules/markdownlint-rule-helpers/helpers.js
8019 var require_helpers3 = __commonJS({
8020 "node_modules/markdownlint-rule-helpers/helpers.js"(exports, module2) {
8022 var os = require("os");
8023 var newLineRe = /\r\n?|\n/g;
8024 module2.exports.newLineRe = newLineRe;
8025 module2.exports.frontMatterRe = /((^---\s*$[^]*?^---\s*$)|(^\+\+\+\s*$[^]*?^(\+\+\+|\.\.\.)\s*$)|(^\{\s*$[^]*?^\}\s*$))(\r\n|\r|\n|$)/m;
8026 var inlineCommentRe = /<!--\s*markdownlint-(?:(?:(disable|enable|capture|restore|disable-file|enable-file|disable-next-line)((?:\s+[a-z0-9_-]+)*))|(?:(configure-file)\s+([\s\S]*?)))\s*-->/ig;
8027 module2.exports.inlineCommentRe = inlineCommentRe;
8028 module2.exports.bareUrlRe = /(?:http|ftp)s?:\/\/[^\s\]"']*(?:\/|[^\s\]"'\W])/ig;
8029 module2.exports.listItemMarkerRe = /^([\s>]*)(?:[*+-]|\d+[.)])\s+/;
8030 module2.exports.orderedListItemMarkerRe = /^[\s>]*0*(\d+)[.)]/;
8031 var emphasisMarkersRe = /[_*]/g;
8032 var linkRe = /(\[(?:[^[\]]|\[[^\]]*\])*\])(\(\S*\)|\[\S*\])?/g;
8033 module2.exports.linkRe = linkRe;
8034 module2.exports.linkReferenceRe = /^ {0,3}\[[^\]]+]:\s.*$/;
8035 var allPunctuation = ".,;:!?\u3002\uFF0C\uFF1B\uFF1A\uFF01\uFF1F";
8036 module2.exports.allPunctuation = allPunctuation;
8037 module2.exports.allPunctuationNoQuestion = allPunctuation.replace(/[??]/gu, "");
8038 module2.exports.isNumber = function isNumber(obj) {
8039 return typeof obj === "number";
8041 module2.exports.isString = function isString(obj) {
8042 return typeof obj === "string";
8044 module2.exports.isEmptyString = function isEmptyString(str2) {
8045 return str2.length === 0;
8047 module2.exports.isObject = function isObject2(obj) {
8048 return obj !== null && typeof obj === "object" && !Array.isArray(obj);
8050 var blankLineRe = />|(?:<!--.*?-->)/g;
8051 module2.exports.isBlankLine = function isBlankLine(line) {
8052 return !line || !line.trim() || !line.replace(blankLineRe, "").trim();
8054 module2.exports.numericSortAscending = function numericSortAscending(a, b) {
8057 module2.exports.includesSorted = function includesSorted(array, element) {
8059 let right = array.length - 1;
8060 while (left <= right) {
8061 const mid = left + right >> 1;
8062 if (array[mid] < element) {
8064 } else if (array[mid] > element) {
8072 var htmlCommentBegin = "<!--";
8073 var htmlCommentEnd = "-->";
8074 module2.exports.clearHtmlCommentText = function clearHtmlCommentText(text) {
8076 while ((i = text.indexOf(htmlCommentBegin, i)) !== -1) {
8077 const j = text.indexOf(htmlCommentEnd, i + 2);
8081 if (j > i + htmlCommentBegin.length) {
8083 while (text[k] === " ") {
8087 const content = text.slice(i + htmlCommentBegin.length, j);
8088 const isBlock = k < 0 || text[k] === "\n";
8089 const isValid = isBlock || !content.startsWith(">") && !content.startsWith("->") && !content.endsWith("-") && !content.includes("--");
8091 const inlineCommentIndex = text.slice(i, j + htmlCommentEnd.length).search(inlineCommentRe);
8092 if (inlineCommentIndex === -1) {
8093 text = text.slice(0, i + htmlCommentBegin.length) + content.replace(/[^\r\n]/g, ".") + text.slice(j);
8098 i = j + htmlCommentEnd.length;
8102 module2.exports.escapeForRegExp = function escapeForRegExp(str2) {
8103 return str2.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
8105 var escapedMarkdownRe = /\\./g;
8106 module2.exports.unescapeMarkdown = function unescapeMarkdown(markdown, replacement) {
8107 return markdown.replace(escapedMarkdownRe, (match) => {
8108 const char = match[1];
8109 if ("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~".includes(char)) {
8110 return replacement || char;
8115 module2.exports.fencedCodeBlockStyleFor = function fencedCodeBlockStyleFor(markup) {
8116 switch (markup[0]) {
8123 function indentFor(token) {
8124 const line = token.line.replace(/^[\s>]*(> |>)/, "");
8125 return line.length - line.trimStart().length;
8127 module2.exports.indentFor = indentFor;
8128 module2.exports.headingStyleFor = function headingStyleFor(token) {
8129 if (token.map[1] - token.map[0] === 1) {
8130 if (/[^\\]#\s*$/.test(token.line)) {
8131 return "atx_closed";
8137 module2.exports.unorderedListStyleFor = function unorderedListStyleFor(token) {
8138 switch (token.markup) {
8147 function filterTokens(params, type2, handler) {
8148 params.tokens.forEach(function forToken(token) {
8149 if (token.type === type2) {
8154 module2.exports.filterTokens = filterTokens;
8155 function isMathBlock(token) {
8156 return token.tag === "math" && token.type.startsWith("math_block") && !token.type.endsWith("_end");
8158 module2.exports.getLineMetadata = function getLineMetadata(params) {
8159 const lineMetadata = params.lines.map((line, index) => [line, index, false, 0, false, false, false, false]);
8160 filterTokens(params, "fence", (token) => {
8161 lineMetadata[token.map[0]][3] = 1;
8162 lineMetadata[token.map[1] - 1][3] = -1;
8163 for (let i = token.map[0] + 1; i < token.map[1] - 1; i++) {
8164 lineMetadata[i][2] = true;
8167 filterTokens(params, "code_block", (token) => {
8168 for (let i = token.map[0]; i < token.map[1]; i++) {
8169 lineMetadata[i][2] = true;
8172 filterTokens(params, "table_open", (token) => {
8173 for (let i = token.map[0]; i < token.map[1]; i++) {
8174 lineMetadata[i][4] = true;
8177 filterTokens(params, "list_item_open", (token) => {
8179 for (let i = token.map[0]; i < token.map[1]; i++) {
8180 lineMetadata[i][5] = count;
8184 filterTokens(params, "hr", (token) => {
8185 lineMetadata[token.map[0]][6] = true;
8187 params.tokens.filter(isMathBlock).forEach((token) => {
8188 for (let i = token.map[0]; i < token.map[1]; i++) {
8189 lineMetadata[i][7] = true;
8192 return lineMetadata;
8194 module2.exports.forEachLine = function forEachLine(lineMetadata, handler) {
8195 lineMetadata.forEach(function forMetadata(metadata) {
8196 handler(...metadata);
8199 module2.exports.flattenLists = function flattenLists(tokens) {
8200 const flattenedLists = [];
8204 const nestingStack = [];
8205 let lastWithMap = { "map": [0, 1] };
8206 tokens.forEach((token) => {
8207 if (isMathBlock(token) && token.map[1]) {
8210 if (token.type === "bullet_list_open" || token.type === "ordered_list_open") {
8211 stack.push(current);
8213 "unordered": token.type === "bullet_list_open",
8214 "parentsUnordered": !current || current.unordered && current.parentsUnordered,
8216 "indent": indentFor(token),
8217 "parentIndent": current && current.indent || 0,
8220 "lastLineIndex": -1,
8221 "insert": flattenedLists.length
8224 } else if (token.type === "bullet_list_close" || token.type === "ordered_list_close") {
8225 current.lastLineIndex = lastWithMap.map[1];
8226 flattenedLists.splice(current.insert, 0, current);
8227 delete current.insert;
8228 current = stack.pop();
8230 } else if (token.type === "list_item_open") {
8231 current.items.push(token);
8232 } else if (token.type === "blockquote_open") {
8233 nestingStack.push(nesting);
8235 } else if (token.type === "blockquote_close") {
8236 nesting = nestingStack.pop();
8237 } else if (token.map) {
8238 lastWithMap = token;
8241 return flattenedLists;
8243 module2.exports.forEachInlineChild = function forEachInlineChild(params, type2, handler) {
8244 filterTokens(params, "inline", function forToken(token) {
8245 token.children.forEach(function forChild(child) {
8246 if (child.type === type2) {
8247 handler(child, token);
8252 module2.exports.forEachHeading = function forEachHeading(params, handler) {
8254 params.tokens.forEach(function forToken(token) {
8255 if (token.type === "heading_open") {
8257 } else if (token.type === "heading_close") {
8259 } else if (token.type === "inline" && heading) {
8260 handler(heading, token.content);
8264 function forEachInlineCodeSpan(input, handler) {
8265 let currentLine = 0;
8266 let currentColumn = 0;
8268 while (index < input.length) {
8269 let startIndex = -1;
8271 let startColumn = -1;
8273 let currentTicks = 0;
8274 let state = "normal";
8275 for (; index <= input.length; index++) {
8276 const char = input[index];
8277 if (char === "[" && state === "normal") {
8278 state = "linkTextOpen";
8279 } else if (char === "]" && state === "linkTextOpen") {
8280 state = "linkTextClosed";
8281 } else if (char === "(" && state === "linkTextClosed") {
8282 state = "linkDestinationOpen";
8283 } else if (char === "(" && state === "linkDestinationOpen" || char === ")" && state === "linkDestinationOpen" || state === "linkTextClosed") {
8286 if (char === "`" && state !== "linkDestinationOpen") {
8288 if (startIndex === -1 || startColumn === -1) {
8289 startIndex = index + 1;
8292 if (startIndex >= 0 && startColumn >= 0 && tickCount === currentTicks) {
8293 handler(input.substring(startIndex, index - currentTicks), startLine, startColumn, tickCount);
8296 } else if (startIndex >= 0 && startColumn === -1) {
8297 tickCount = currentTicks;
8298 startLine = currentLine;
8299 startColumn = currentColumn;
8303 if (char === "\n") {
8306 } else if (char === "\\" && (startIndex === -1 || startColumn === -1) && input[index + 1] !== "\n") {
8313 if (startIndex >= 0) {
8315 currentLine = startLine;
8316 currentColumn = startColumn;
8320 module2.exports.forEachInlineCodeSpan = forEachInlineCodeSpan;
8321 function addError(onError, lineNumber, detail, context, range, fixInfo) {
8330 module2.exports.addError = addError;
8331 module2.exports.addErrorDetailIf = function addErrorDetailIf(onError, lineNumber, expected, actual, detail, context, range, fixInfo) {
8332 if (expected !== actual) {
8333 addError(onError, lineNumber, "Expected: " + expected + "; Actual: " + actual + (detail ? "; " + detail : ""), context, range, fixInfo);
8336 module2.exports.addErrorContext = function addErrorContext(onError, lineNumber, context, left, right, range, fixInfo) {
8337 if (context.length <= 30) {
8338 } else if (left && right) {
8339 context = context.substr(0, 15) + "..." + context.substr(-15);
8341 context = "..." + context.substr(-30);
8343 context = context.substr(0, 30) + "...";
8345 addError(onError, lineNumber, null, context, range, fixInfo);
8347 module2.exports.inlineCodeSpanRanges = (lines) => {
8348 const exclusions = [];
8349 forEachInlineCodeSpan(lines.join("\n"), (code, lineIndex, columnIndex) => {
8350 const codeLines = code.split(newLineRe);
8351 for (let i = 0; i < codeLines.length; i++) {
8352 exclusions.push([lineIndex + i, columnIndex, codeLines[i].length]);
8358 module2.exports.overlapsAnyRange = (ranges, lineIndex, index, length) => !ranges.every((span) => lineIndex !== span[0] || index + length < span[1] || index > span[1] + span[2]);
8359 module2.exports.rangeFromRegExp = function rangeFromRegExp(line, regexp) {
8361 const match = line.match(regexp);
8363 const column = match.index + 1;
8364 const length = match[0].length;
8365 range = [column, length];
8369 module2.exports.frontMatterHasTitle = function frontMatterHasTitle(frontMatterLines, frontMatterTitlePattern) {
8370 const ignoreFrontMatter = frontMatterTitlePattern !== void 0 && !frontMatterTitlePattern;
8371 const frontMatterTitleRe = new RegExp(String(frontMatterTitlePattern || '^\\s*"?title"?\\s*[:=]'), "i");
8372 return !ignoreFrontMatter && frontMatterLines.some((line) => frontMatterTitleRe.test(line));
8374 function emphasisMarkersInContent(params) {
8375 const { lines } = params;
8376 const byLine = new Array(lines.length);
8377 filterTokens(params, "inline", (token) => {
8378 const { children, lineNumber, map: map2 } = token;
8379 if (children.some((child) => child.type === "code_inline")) {
8380 const tokenLines = lines.slice(map2[0], map2[1]);
8381 forEachInlineCodeSpan(tokenLines.join("\n"), (code, lineIndex, column, tickCount) => {
8382 const codeLines = code.split(newLineRe);
8383 codeLines.forEach((codeLine, codeLineIndex) => {
8385 while (match = emphasisMarkersRe.exec(codeLine)) {
8386 const byLineIndex = lineNumber - 1 + lineIndex + codeLineIndex;
8387 const inLine = byLine[byLineIndex] || [];
8388 const codeLineOffset = codeLineIndex ? 0 : column - 1 + tickCount;
8389 inLine.push(codeLineOffset + match.index);
8390 byLine[byLineIndex] = inLine;
8396 lines.forEach((tokenLine, tokenLineIndex) => {
8397 let linkMatch = null;
8398 while (linkMatch = linkRe.exec(tokenLine)) {
8399 let markerMatch = null;
8400 while (markerMatch = emphasisMarkersRe.exec(linkMatch[0])) {
8401 const inLine = byLine[tokenLineIndex] || [];
8402 inLine.push(linkMatch.index + markerMatch.index);
8403 byLine[tokenLineIndex] = inLine;
8409 module2.exports.emphasisMarkersInContent = emphasisMarkersInContent;
8410 function getPreferredLineEnding(input) {
8414 const endings = input.match(newLineRe) || [];
8415 endings.forEach((ending) => {
8428 let preferredLineEnding = null;
8429 if (!cr && !lf && !crlf) {
8430 preferredLineEnding = os.EOL;
8431 } else if (lf >= crlf && lf >= cr) {
8432 preferredLineEnding = "\n";
8433 } else if (crlf >= cr) {
8434 preferredLineEnding = "\r\n";
8436 preferredLineEnding = "\r";
8438 return preferredLineEnding;
8440 module2.exports.getPreferredLineEnding = getPreferredLineEnding;
8441 function normalizeFixInfo(fixInfo, lineNumber) {
8443 "lineNumber": fixInfo.lineNumber || lineNumber,
8444 "editColumn": fixInfo.editColumn || 1,
8445 "deleteCount": fixInfo.deleteCount || 0,
8446 "insertText": fixInfo.insertText || ""
8449 function applyFix2(line, fixInfo, lineEnding) {
8450 const { editColumn, deleteCount, insertText } = normalizeFixInfo(fixInfo);
8451 const editIndex = editColumn - 1;
8452 return deleteCount === -1 ? null : line.slice(0, editIndex) + insertText.replace(/\n/g, lineEnding || "\n") + line.slice(editIndex + deleteCount);
8454 module2.exports.applyFix = applyFix2;
8455 module2.exports.applyFixes = function applyFixes2(input, errors) {
8456 const lineEnding = getPreferredLineEnding(input);
8457 const lines = input.split(newLineRe);
8458 let fixInfos = errors.filter((error) => error.fixInfo).map((error) => normalizeFixInfo(error.fixInfo, error.lineNumber));
8459 fixInfos.sort((a, b) => {
8460 const aDeletingLine = a.deleteCount === -1;
8461 const bDeletingLine = b.deleteCount === -1;
8462 return b.lineNumber - a.lineNumber || (aDeletingLine ? 1 : bDeletingLine ? -1 : 0) || b.editColumn - a.editColumn || b.insertText.length - a.insertText.length;
8464 let lastFixInfo = {};
8465 fixInfos = fixInfos.filter((fixInfo) => {
8466 const unique = fixInfo.lineNumber !== lastFixInfo.lineNumber || fixInfo.editColumn !== lastFixInfo.editColumn || fixInfo.deleteCount !== lastFixInfo.deleteCount || fixInfo.insertText !== lastFixInfo.insertText;
8467 lastFixInfo = fixInfo;
8471 fixInfos.forEach((fixInfo) => {
8472 if (fixInfo.lineNumber === lastFixInfo.lineNumber && fixInfo.editColumn === lastFixInfo.editColumn && !fixInfo.insertText && fixInfo.deleteCount > 0 && lastFixInfo.insertText && !lastFixInfo.deleteCount) {
8473 fixInfo.insertText = lastFixInfo.insertText;
8474 lastFixInfo.lineNumber = 0;
8476 lastFixInfo = fixInfo;
8478 fixInfos = fixInfos.filter((fixInfo) => fixInfo.lineNumber);
8479 let lastLineIndex = -1;
8480 let lastEditIndex = -1;
8481 fixInfos.forEach((fixInfo) => {
8482 const { lineNumber, editColumn, deleteCount } = fixInfo;
8483 const lineIndex = lineNumber - 1;
8484 const editIndex = editColumn - 1;
8485 if (lineIndex !== lastLineIndex || deleteCount === -1 || editIndex + deleteCount <= lastEditIndex - (deleteCount > 0 ? 0 : 1)) {
8486 lines[lineIndex] = applyFix2(lines[lineIndex], fixInfo, lineEnding);
8488 lastLineIndex = lineIndex;
8489 lastEditIndex = editIndex;
8491 return lines.filter((line) => line !== null).join(lineEnding);
8496 // node_modules/ini/ini.js
8497 var require_ini = __commonJS({
8498 "node_modules/ini/ini.js"(exports) {
8499 exports.parse = exports.decode = decode;
8500 exports.stringify = exports.encode = encode;
8501 exports.safe = safe;
8502 exports.unsafe = unsafe;
8503 var eol = typeof process !== "undefined" && process.platform === "win32" ? "\r\n" : "\n";
8504 function encode(obj, opt) {
8507 if (typeof opt === "string") {
8513 opt = opt || Object.create(null);
8514 opt.whitespace = opt.whitespace === true;
8516 var separator = opt.whitespace ? " = " : "=";
8517 Object.keys(obj).forEach(function(k, _, __) {
8519 if (val && Array.isArray(val)) {
8520 val.forEach(function(item) {
8521 out += safe(k + "[]") + separator + safe(item) + "\n";
8523 } else if (val && typeof val === "object")
8526 out += safe(k) + separator + safe(val) + eol;
8528 if (opt.section && out.length)
8529 out = "[" + safe(opt.section) + "]" + eol + out;
8530 children.forEach(function(k, _, __) {
8531 var nk = dotSplit(k).join("\\.");
8532 var section = (opt.section ? opt.section + "." : "") + nk;
8533 var child = encode(obj[k], {
8535 whitespace: opt.whitespace
8537 if (out.length && child.length)
8543 function dotSplit(str2) {
8544 return str2.replace(/\1/g, "
\ 2LITERAL\\1LITERAL
\ 2").replace(/\\\./g, "
\ 1").split(/\./).map(function(part) {
8545 return part.replace(/\1/g, "\\.").replace(/\2LITERAL\\1LITERAL\2/g, "
\ 1");
8548 function decode(str2) {
8549 var out = Object.create(null);
8552 var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;
8553 var lines = str2.split(/[\r\n]+/g);
8554 lines.forEach(function(line, _, __) {
8555 if (!line || line.match(/^\s*[;#]/))
8557 var match = line.match(re);
8560 if (match[1] !== void 0) {
8561 section = unsafe(match[1]);
8562 if (section === "__proto__") {
8563 p = Object.create(null);
8566 p = out[section] = out[section] || Object.create(null);
8569 var key = unsafe(match[2]);
8570 if (key === "__proto__")
8572 var value = match[3] ? unsafe(match[4]) : true;
8577 value = JSON.parse(value);
8579 if (key.length > 2 && key.slice(-2) === "[]") {
8580 key = key.substring(0, key.length - 2);
8581 if (key === "__proto__")
8585 else if (!Array.isArray(p[key]))
8588 if (Array.isArray(p[key]))
8593 Object.keys(out).filter(function(k, _, __) {
8594 if (!out[k] || typeof out[k] !== "object" || Array.isArray(out[k]))
8596 var parts = dotSplit(k);
8598 var l = parts.pop();
8599 var nl = l.replace(/\\\./g, ".");
8600 parts.forEach(function(part, _2, __2) {
8601 if (part === "__proto__")
8603 if (!p2[part] || typeof p2[part] !== "object")
8604 p2[part] = Object.create(null);
8607 if (p2 === out && nl === l)
8611 }).forEach(function(del, _, __) {
8616 function isQuoted(val) {
8617 return val.charAt(0) === '"' && val.slice(-1) === '"' || val.charAt(0) === "'" && val.slice(-1) === "'";
8619 function safe(val) {
8620 return typeof val !== "string" || val.match(/[=\r\n]/) || val.match(/^\[/) || val.length > 1 && isQuoted(val) || val !== val.trim() ? JSON.stringify(val) : val.replace(/;/g, "\\;").replace(/#/g, "\\#");
8622 function unsafe(val, doUnesc) {
8623 val = (val || "").trim();
8624 if (isQuoted(val)) {
8625 if (val.charAt(0) === "'")
8626 val = val.substr(1, val.length - 2);
8628 val = JSON.parse(val);
8634 for (var i = 0, l = val.length; i < l; i++) {
8635 var c = val.charAt(i);
8637 if ("\\;#".indexOf(c) !== -1)
8642 } else if (";#".indexOf(c) !== -1)
8644 else if (c === "\\")
8651 return unesc.trim();
8658 // node_modules/rc/node_modules/strip-json-comments/index.js
8659 var require_strip_json_comments = __commonJS({
8660 "node_modules/rc/node_modules/strip-json-comments/index.js"(exports, module2) {
8662 var singleComment = 1;
8663 var multiComment = 2;
8664 function stripWithoutWhitespace() {
8667 function stripWithWhitespace(str2, start, end) {
8668 return str2.slice(start, end).replace(/\S/g, " ");
8670 module2.exports = function(str2, opts) {
8674 var insideString = false;
8675 var insideComment = false;
8678 var strip = opts.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace;
8679 for (var i = 0; i < str2.length; i++) {
8680 currentChar = str2[i];
8681 nextChar = str2[i + 1];
8682 if (!insideComment && currentChar === '"') {
8683 var escaped = str2[i - 1] === "\\" && str2[i - 2] !== "\\";
8685 insideString = !insideString;
8691 if (!insideComment && currentChar + nextChar === "//") {
8692 ret += str2.slice(offset, i);
8694 insideComment = singleComment;
8696 } else if (insideComment === singleComment && currentChar + nextChar === "\r\n") {
8698 insideComment = false;
8699 ret += strip(str2, offset, i);
8702 } else if (insideComment === singleComment && currentChar === "\n") {
8703 insideComment = false;
8704 ret += strip(str2, offset, i);
8706 } else if (!insideComment && currentChar + nextChar === "/*") {
8707 ret += str2.slice(offset, i);
8709 insideComment = multiComment;
8712 } else if (insideComment === multiComment && currentChar + nextChar === "*/") {
8714 insideComment = false;
8715 ret += strip(str2, offset, i + 1);
8720 return ret + (insideComment ? strip(str2.substr(offset)) : str2.substr(offset));
8725 // node_modules/rc/lib/utils.js
8726 var require_utils2 = __commonJS({
8727 "node_modules/rc/lib/utils.js"(exports) {
8729 var fs2 = require("fs");
8730 var ini = require_ini();
8731 var path2 = require("path");
8732 var stripJsonComments = require_strip_json_comments();
8733 var parse = exports.parse = function(content) {
8734 if (/^\s*{/.test(content))
8735 return JSON.parse(stripJsonComments(content));
8736 return ini.parse(content);
8738 var file = exports.file = function() {
8739 var args = [].slice.call(arguments).filter(function(arg) {
8743 if (typeof args[i] !== "string")
8745 var file2 = path2.join.apply(null, args);
8748 return fs2.readFileSync(file2, "utf-8");
8753 var json2 = exports.json = function() {
8754 var content = file.apply(null, arguments);
8755 return content ? parse(content) : null;
8757 var env = exports.env = function(prefix, env2) {
8758 env2 = env2 || process.env;
8760 var l = prefix.length;
8761 for (var k in env2) {
8762 if (k.toLowerCase().indexOf(prefix.toLowerCase()) === 0) {
8763 var keypath = k.substring(l).split("__");
8764 var _emptyStringIndex;
8765 while ((_emptyStringIndex = keypath.indexOf("")) > -1) {
8766 keypath.splice(_emptyStringIndex, 1);
8769 keypath.forEach(function _buildSubObj(_subkey, i) {
8770 if (!_subkey || typeof cursor !== "object")
8772 if (i === keypath.length - 1)
8773 cursor[_subkey] = env2[k];
8774 if (cursor[_subkey] === void 0)
8775 cursor[_subkey] = {};
8776 cursor = cursor[_subkey];
8782 var find = exports.find = function() {
8783 var rel = path2.join.apply(null, [].slice.call(arguments));
8784 function find2(start, rel2) {
8785 var file2 = path2.join(start, rel2);
8787 fs2.statSync(file2);
8790 if (path2.dirname(start) !== start)
8791 return find2(path2.dirname(start), rel2);
8794 return find2(process.cwd(), rel);
8799 // node_modules/minimist/index.js
8800 var require_minimist = __commonJS({
8801 "node_modules/minimist/index.js"(exports, module2) {
8802 module2.exports = function(args, opts) {
8805 var flags = { bools: {}, strings: {}, unknownFn: null };
8806 if (typeof opts["unknown"] === "function") {
8807 flags.unknownFn = opts["unknown"];
8809 if (typeof opts["boolean"] === "boolean" && opts["boolean"]) {
8810 flags.allBools = true;
8812 [].concat(opts["boolean"]).filter(Boolean).forEach(function(key2) {
8813 flags.bools[key2] = true;
8817 Object.keys(opts.alias || {}).forEach(function(key2) {
8818 aliases[key2] = [].concat(opts.alias[key2]);
8819 aliases[key2].forEach(function(x) {
8820 aliases[x] = [key2].concat(aliases[key2].filter(function(y) {
8825 [].concat(opts.string).filter(Boolean).forEach(function(key2) {
8826 flags.strings[key2] = true;
8827 if (aliases[key2]) {
8828 flags.strings[aliases[key2]] = true;
8831 var defaults = opts["default"] || {};
8832 var argv = { _: [] };
8833 Object.keys(flags.bools).forEach(function(key2) {
8834 setArg(key2, defaults[key2] === void 0 ? false : defaults[key2]);
8837 if (args.indexOf("--") !== -1) {
8838 notFlags = args.slice(args.indexOf("--") + 1);
8839 args = args.slice(0, args.indexOf("--"));
8841 function argDefined(key2, arg2) {
8842 return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases[key2];
8844 function setArg(key2, val, arg2) {
8845 if (arg2 && flags.unknownFn && !argDefined(key2, arg2)) {
8846 if (flags.unknownFn(arg2) === false)
8849 var value2 = !flags.strings[key2] && isNumber(val) ? Number(val) : val;
8850 setKey(argv, key2.split("."), value2);
8851 (aliases[key2] || []).forEach(function(x) {
8852 setKey(argv, x.split("."), value2);
8855 function setKey(obj, keys, value2) {
8857 for (var i2 = 0; i2 < keys.length - 1; i2++) {
8858 var key2 = keys[i2];
8859 if (key2 === "__proto__")
8861 if (o[key2] === void 0)
8863 if (o[key2] === Object.prototype || o[key2] === Number.prototype || o[key2] === String.prototype)
8865 if (o[key2] === Array.prototype)
8869 var key2 = keys[keys.length - 1];
8870 if (key2 === "__proto__")
8872 if (o === Object.prototype || o === Number.prototype || o === String.prototype)
8874 if (o === Array.prototype)
8876 if (o[key2] === void 0 || flags.bools[key2] || typeof o[key2] === "boolean") {
8878 } else if (Array.isArray(o[key2])) {
8879 o[key2].push(value2);
8881 o[key2] = [o[key2], value2];
8884 function aliasIsBoolean(key2) {
8885 return aliases[key2].some(function(x) {
8886 return flags.bools[x];
8889 for (var i = 0; i < args.length; i++) {
8891 if (/^--.+=/.test(arg)) {
8892 var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
8895 if (flags.bools[key]) {
8896 value = value !== "false";
8898 setArg(key, value, arg);
8899 } else if (/^--no-.+/.test(arg)) {
8900 var key = arg.match(/^--no-(.+)/)[1];
8901 setArg(key, false, arg);
8902 } else if (/^--.+/.test(arg)) {
8903 var key = arg.match(/^--(.+)/)[1];
8904 var next = args[i + 1];
8905 if (next !== void 0 && !/^-/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) {
8906 setArg(key, next, arg);
8908 } else if (/^(true|false)$/.test(next)) {
8909 setArg(key, next === "true", arg);
8912 setArg(key, flags.strings[key] ? "" : true, arg);
8914 } else if (/^-[^-]+/.test(arg)) {
8915 var letters = arg.slice(1, -1).split("");
8917 for (var j = 0; j < letters.length; j++) {
8918 var next = arg.slice(j + 2);
8920 setArg(letters[j], next, arg);
8923 if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {
8924 setArg(letters[j], next.split("=")[1], arg);
8928 if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
8929 setArg(letters[j], next, arg);
8933 if (letters[j + 1] && letters[j + 1].match(/\W/)) {
8934 setArg(letters[j], arg.slice(j + 2), arg);
8938 setArg(letters[j], flags.strings[letters[j]] ? "" : true, arg);
8941 var key = arg.slice(-1)[0];
8942 if (!broken && key !== "-") {
8943 if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) {
8944 setArg(key, args[i + 1], arg);
8946 } else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {
8947 setArg(key, args[i + 1] === "true", arg);
8950 setArg(key, flags.strings[key] ? "" : true, arg);
8954 if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
8955 argv._.push(flags.strings["_"] || !isNumber(arg) ? arg : Number(arg));
8957 if (opts.stopEarly) {
8958 argv._.push.apply(argv._, args.slice(i + 1));
8963 Object.keys(defaults).forEach(function(key2) {
8964 if (!hasKey(argv, key2.split("."))) {
8965 setKey(argv, key2.split("."), defaults[key2]);
8966 (aliases[key2] || []).forEach(function(x) {
8967 setKey(argv, x.split("."), defaults[key2]);
8972 argv["--"] = new Array();
8973 notFlags.forEach(function(key2) {
8974 argv["--"].push(key2);
8977 notFlags.forEach(function(key2) {
8983 function hasKey(obj, keys) {
8985 keys.slice(0, -1).forEach(function(key2) {
8988 var key = keys[keys.length - 1];
8991 function isNumber(x) {
8992 if (typeof x === "number")
8994 if (/^0x[0-9a-f]+$/i.test(x))
8996 return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
9001 // node_modules/rc/index.js
9002 var require_rc = __commonJS({
9003 "node_modules/rc/index.js"(exports, module2) {
9004 var cc = require_utils2();
9005 var join = require("path").join;
9006 var deepExtend = require_deep_extend();
9008 var win = process.platform === "win32";
9009 var home = win ? process.env.USERPROFILE : process.env.HOME;
9010 module2.exports = function(name, defaults, argv, parse) {
9011 if (typeof name !== "string")
9012 throw new Error("rc(name): name *must* be string");
9014 argv = require_minimist()(process.argv.slice(2));
9015 defaults = (typeof defaults === "string" ? cc.json(defaults) : defaults) || {};
9016 parse = parse || cc.parse;
9017 var env = cc.env(name + "_");
9018 var configs = [defaults];
9019 var configFiles = [];
9020 function addConfigFile(file) {
9021 if (configFiles.indexOf(file) >= 0)
9023 var fileConfig = cc.file(file);
9025 configs.push(parse(fileConfig));
9026 configFiles.push(file);
9031 join(etc, name, "config"),
9032 join(etc, name + "rc")
9033 ].forEach(addConfigFile);
9036 join(home, ".config", name, "config"),
9037 join(home, ".config", name),
9038 join(home, "." + name, "config"),
9039 join(home, "." + name + "rc")
9040 ].forEach(addConfigFile);
9041 addConfigFile(cc.find("." + name + "rc"));
9043 addConfigFile(env.config);
9045 addConfigFile(argv.config);
9046 return deepExtend.apply(null, configs.concat([
9049 configFiles.length ? { configs: configFiles, config: configFiles[configFiles.length - 1] } : void 0
9057 activate: () => activate
9059 var import_coc2 = __toModule(require("coc.nvim"));
9062 var import_coc = __toModule(require("coc.nvim"));
9063 var import_deep_extend = __toModule(require_deep_extend());
9064 var import_fs = __toModule(require("fs"));
9066 // node_modules/js-yaml/dist/js-yaml.mjs
9067 function isNothing(subject) {
9068 return typeof subject === "undefined" || subject === null;
9070 function isObject(subject) {
9071 return typeof subject === "object" && subject !== null;
9073 function toArray(sequence) {
9074 if (Array.isArray(sequence))
9076 else if (isNothing(sequence))
9080 function extend(target, source) {
9081 var index, length, key, sourceKeys;
9083 sourceKeys = Object.keys(source);
9084 for (index = 0, length = sourceKeys.length; index < length; index += 1) {
9085 key = sourceKeys[index];
9086 target[key] = source[key];
9091 function repeat(string, count) {
9092 var result = "", cycle;
9093 for (cycle = 0; cycle < count; cycle += 1) {
9098 function isNegativeZero(number) {
9099 return number === 0 && Number.NEGATIVE_INFINITY === 1 / number;
9101 var isNothing_1 = isNothing;
9102 var isObject_1 = isObject;
9103 var toArray_1 = toArray;
9104 var repeat_1 = repeat;
9105 var isNegativeZero_1 = isNegativeZero;
9106 var extend_1 = extend;
9108 isNothing: isNothing_1,
9109 isObject: isObject_1,
9112 isNegativeZero: isNegativeZero_1,
9115 function formatError(exception2, compact) {
9116 var where = "", message = exception2.reason || "(unknown reason)";
9117 if (!exception2.mark)
9119 if (exception2.mark.name) {
9120 where += 'in "' + exception2.mark.name + '" ';
9122 where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")";
9123 if (!compact && exception2.mark.snippet) {
9124 where += "\n\n" + exception2.mark.snippet;
9126 return message + " " + where;
9128 function YAMLException$1(reason, mark) {
9130 this.name = "YAMLException";
9131 this.reason = reason;
9133 this.message = formatError(this, false);
9134 if (Error.captureStackTrace) {
9135 Error.captureStackTrace(this, this.constructor);
9137 this.stack = new Error().stack || "";
9140 YAMLException$1.prototype = Object.create(Error.prototype);
9141 YAMLException$1.prototype.constructor = YAMLException$1;
9142 YAMLException$1.prototype.toString = function toString(compact) {
9143 return this.name + ": " + formatError(this, compact);
9145 var exception = YAMLException$1;
9146 function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
9149 var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
9150 if (position - lineStart > maxHalfLength) {
9152 lineStart = position - maxHalfLength + head.length;
9154 if (lineEnd - position > maxHalfLength) {
9156 lineEnd = position + maxHalfLength - tail.length;
9159 str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "\u2192") + tail,
9160 pos: position - lineStart + head.length
9163 function padStart(string, max) {
9164 return common.repeat(" ", max - string.length) + string;
9166 function makeSnippet(mark, options) {
9167 options = Object.create(options || null);
9170 if (!options.maxLength)
9171 options.maxLength = 79;
9172 if (typeof options.indent !== "number")
9174 if (typeof options.linesBefore !== "number")
9175 options.linesBefore = 3;
9176 if (typeof options.linesAfter !== "number")
9177 options.linesAfter = 2;
9178 var re = /\r?\n|\r|\0/g;
9179 var lineStarts = [0];
9182 var foundLineNo = -1;
9183 while (match = re.exec(mark.buffer)) {
9184 lineEnds.push(match.index);
9185 lineStarts.push(match.index + match[0].length);
9186 if (mark.position <= match.index && foundLineNo < 0) {
9187 foundLineNo = lineStarts.length - 2;
9190 if (foundLineNo < 0)
9191 foundLineNo = lineStarts.length - 1;
9192 var result = "", i, line;
9193 var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
9194 var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
9195 for (i = 1; i <= options.linesBefore; i++) {
9196 if (foundLineNo - i < 0)
9198 line = getLine(mark.buffer, lineStarts[foundLineNo - i], lineEnds[foundLineNo - i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), maxLineLength);
9199 result = common.repeat(" ", options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line.str + "\n" + result;
9201 line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
9202 result += common.repeat(" ", options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n";
9203 result += common.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n";
9204 for (i = 1; i <= options.linesAfter; i++) {
9205 if (foundLineNo + i >= lineEnds.length)
9207 line = getLine(mark.buffer, lineStarts[foundLineNo + i], lineEnds[foundLineNo + i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), maxLineLength);
9208 result += common.repeat(" ", options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line.str + "\n";
9210 return result.replace(/\n$/, "");
9212 var snippet = makeSnippet;
9213 var TYPE_CONSTRUCTOR_OPTIONS = [
9225 var YAML_NODE_KINDS = [
9230 function compileStyleAliases(map2) {
9232 if (map2 !== null) {
9233 Object.keys(map2).forEach(function(style) {
9234 map2[style].forEach(function(alias) {
9235 result[String(alias)] = style;
9241 function Type$1(tag, options) {
9242 options = options || {};
9243 Object.keys(options).forEach(function(name) {
9244 if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
9245 throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
9248 this.options = options;
9250 this.kind = options["kind"] || null;
9251 this.resolve = options["resolve"] || function() {
9254 this.construct = options["construct"] || function(data) {
9257 this.instanceOf = options["instanceOf"] || null;
9258 this.predicate = options["predicate"] || null;
9259 this.represent = options["represent"] || null;
9260 this.representName = options["representName"] || null;
9261 this.defaultStyle = options["defaultStyle"] || null;
9262 this.multi = options["multi"] || false;
9263 this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
9264 if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
9265 throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
9269 function compileList(schema2, name) {
9271 schema2[name].forEach(function(currentType) {
9272 var newIndex = result.length;
9273 result.forEach(function(previousType, previousIndex) {
9274 if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
9275 newIndex = previousIndex;
9278 result[newIndex] = currentType;
9282 function compileMap() {
9295 function collectType(type2) {
9297 result.multi[type2.kind].push(type2);
9298 result.multi["fallback"].push(type2);
9300 result[type2.kind][type2.tag] = result["fallback"][type2.tag] = type2;
9303 for (index = 0, length = arguments.length; index < length; index += 1) {
9304 arguments[index].forEach(collectType);
9308 function Schema$1(definition) {
9309 return this.extend(definition);
9311 Schema$1.prototype.extend = function extend2(definition) {
9314 if (definition instanceof type) {
9315 explicit.push(definition);
9316 } else if (Array.isArray(definition)) {
9317 explicit = explicit.concat(definition);
9318 } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
9319 if (definition.implicit)
9320 implicit = implicit.concat(definition.implicit);
9321 if (definition.explicit)
9322 explicit = explicit.concat(definition.explicit);
9324 throw new exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
9326 implicit.forEach(function(type$1) {
9327 if (!(type$1 instanceof type)) {
9328 throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
9330 if (type$1.loadKind && type$1.loadKind !== "scalar") {
9331 throw new exception("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
9334 throw new exception("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
9337 explicit.forEach(function(type$1) {
9338 if (!(type$1 instanceof type)) {
9339 throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
9342 var result = Object.create(Schema$1.prototype);
9343 result.implicit = (this.implicit || []).concat(implicit);
9344 result.explicit = (this.explicit || []).concat(explicit);
9345 result.compiledImplicit = compileList(result, "implicit");
9346 result.compiledExplicit = compileList(result, "explicit");
9347 result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
9350 var schema = Schema$1;
9351 var str = new type("tag:yaml.org,2002:str", {
9353 construct: function(data) {
9354 return data !== null ? data : "";
9357 var seq = new type("tag:yaml.org,2002:seq", {
9359 construct: function(data) {
9360 return data !== null ? data : [];
9363 var map = new type("tag:yaml.org,2002:map", {
9365 construct: function(data) {
9366 return data !== null ? data : {};
9369 var failsafe = new schema({
9376 function resolveYamlNull(data) {
9379 var max = data.length;
9380 return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
9382 function constructYamlNull() {
9385 function isNull(object) {
9386 return object === null;
9388 var _null = new type("tag:yaml.org,2002:null", {
9390 resolve: resolveYamlNull,
9391 construct: constructYamlNull,
9394 canonical: function() {
9397 lowercase: function() {
9400 uppercase: function() {
9403 camelcase: function() {
9410 defaultStyle: "lowercase"
9412 function resolveYamlBoolean(data) {
9415 var max = data.length;
9416 return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
9418 function constructYamlBoolean(data) {
9419 return data === "true" || data === "True" || data === "TRUE";
9421 function isBoolean(object) {
9422 return Object.prototype.toString.call(object) === "[object Boolean]";
9424 var bool = new type("tag:yaml.org,2002:bool", {
9426 resolve: resolveYamlBoolean,
9427 construct: constructYamlBoolean,
9428 predicate: isBoolean,
9430 lowercase: function(object) {
9431 return object ? "true" : "false";
9433 uppercase: function(object) {
9434 return object ? "TRUE" : "FALSE";
9436 camelcase: function(object) {
9437 return object ? "True" : "False";
9440 defaultStyle: "lowercase"
9442 function isHexCode(c) {
9443 return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102;
9445 function isOctCode(c) {
9446 return 48 <= c && c <= 55;
9448 function isDecCode(c) {
9449 return 48 <= c && c <= 57;
9451 function resolveYamlInteger(data) {
9454 var max = data.length, index = 0, hasDigits = false, ch;
9458 if (ch === "-" || ch === "+") {
9462 if (index + 1 === max)
9467 for (; index < max; index++) {
9471 if (ch !== "0" && ch !== "1")
9475 return hasDigits && ch !== "_";
9479 for (; index < max; index++) {
9483 if (!isHexCode(data.charCodeAt(index)))
9487 return hasDigits && ch !== "_";
9491 for (; index < max; index++) {
9495 if (!isOctCode(data.charCodeAt(index)))
9499 return hasDigits && ch !== "_";
9504 for (; index < max; index++) {
9508 if (!isDecCode(data.charCodeAt(index))) {
9513 if (!hasDigits || ch === "_")
9517 function constructYamlInteger(data) {
9518 var value = data, sign = 1, ch;
9519 if (value.indexOf("_") !== -1) {
9520 value = value.replace(/_/g, "");
9523 if (ch === "-" || ch === "+") {
9526 value = value.slice(1);
9532 if (value[1] === "b")
9533 return sign * parseInt(value.slice(2), 2);
9534 if (value[1] === "x")
9535 return sign * parseInt(value.slice(2), 16);
9536 if (value[1] === "o")
9537 return sign * parseInt(value.slice(2), 8);
9539 return sign * parseInt(value, 10);
9541 function isInteger(object) {
9542 return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common.isNegativeZero(object));
9544 var int = new type("tag:yaml.org,2002:int", {
9546 resolve: resolveYamlInteger,
9547 construct: constructYamlInteger,
9548 predicate: isInteger,
9550 binary: function(obj) {
9551 return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
9553 octal: function(obj) {
9554 return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1);
9556 decimal: function(obj) {
9557 return obj.toString(10);
9559 hexadecimal: function(obj) {
9560 return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
9563 defaultStyle: "decimal",
9567 decimal: [10, "dec"],
9568 hexadecimal: [16, "hex"]
9571 var YAML_FLOAT_PATTERN = new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
9572 function resolveYamlFloat(data) {
9575 if (!YAML_FLOAT_PATTERN.test(data) || data[data.length - 1] === "_") {
9580 function constructYamlFloat(data) {
9582 value = data.replace(/_/g, "").toLowerCase();
9583 sign = value[0] === "-" ? -1 : 1;
9584 if ("+-".indexOf(value[0]) >= 0) {
9585 value = value.slice(1);
9587 if (value === ".inf") {
9588 return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
9589 } else if (value === ".nan") {
9592 return sign * parseFloat(value, 10);
9594 var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
9595 function representYamlFloat(object, style) {
9597 if (isNaN(object)) {
9606 } else if (Number.POSITIVE_INFINITY === object) {
9615 } else if (Number.NEGATIVE_INFINITY === object) {
9624 } else if (common.isNegativeZero(object)) {
9627 res = object.toString(10);
9628 return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
9630 function isFloat(object) {
9631 return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object));
9633 var float = new type("tag:yaml.org,2002:float", {
9635 resolve: resolveYamlFloat,
9636 construct: constructYamlFloat,
9638 represent: representYamlFloat,
9639 defaultStyle: "lowercase"
9641 var json = failsafe.extend({
9650 var YAML_DATE_REGEXP = new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$");
9651 var YAML_TIMESTAMP_REGEXP = new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");
9652 function resolveYamlTimestamp(data) {
9655 if (YAML_DATE_REGEXP.exec(data) !== null)
9657 if (YAML_TIMESTAMP_REGEXP.exec(data) !== null)
9661 function constructYamlTimestamp(data) {
9662 var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
9663 match = YAML_DATE_REGEXP.exec(data);
9665 match = YAML_TIMESTAMP_REGEXP.exec(data);
9667 throw new Error("Date resolve error");
9669 month = +match[2] - 1;
9672 return new Date(Date.UTC(year, month, day));
9678 fraction = match[7].slice(0, 3);
9679 while (fraction.length < 3) {
9682 fraction = +fraction;
9685 tz_hour = +match[10];
9686 tz_minute = +(match[11] || 0);
9687 delta = (tz_hour * 60 + tz_minute) * 6e4;
9688 if (match[9] === "-")
9691 date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
9693 date.setTime(date.getTime() - delta);
9696 function representYamlTimestamp(object) {
9697 return object.toISOString();
9699 var timestamp = new type("tag:yaml.org,2002:timestamp", {
9701 resolve: resolveYamlTimestamp,
9702 construct: constructYamlTimestamp,
9704 represent: representYamlTimestamp
9706 function resolveYamlMerge(data) {
9707 return data === "<<" || data === null;
9709 var merge = new type("tag:yaml.org,2002:merge", {
9711 resolve: resolveYamlMerge
9713 var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
9714 function resolveYamlBinary(data) {
9717 var code, idx, bitlen = 0, max = data.length, map2 = BASE64_MAP;
9718 for (idx = 0; idx < max; idx++) {
9719 code = map2.indexOf(data.charAt(idx));
9726 return bitlen % 8 === 0;
9728 function constructYamlBinary(data) {
9729 var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map2 = BASE64_MAP, bits = 0, result = [];
9730 for (idx = 0; idx < max; idx++) {
9731 if (idx % 4 === 0 && idx) {
9732 result.push(bits >> 16 & 255);
9733 result.push(bits >> 8 & 255);
9734 result.push(bits & 255);
9736 bits = bits << 6 | map2.indexOf(input.charAt(idx));
9738 tailbits = max % 4 * 6;
9739 if (tailbits === 0) {
9740 result.push(bits >> 16 & 255);
9741 result.push(bits >> 8 & 255);
9742 result.push(bits & 255);
9743 } else if (tailbits === 18) {
9744 result.push(bits >> 10 & 255);
9745 result.push(bits >> 2 & 255);
9746 } else if (tailbits === 12) {
9747 result.push(bits >> 4 & 255);
9749 return new Uint8Array(result);
9751 function representYamlBinary(object) {
9752 var result = "", bits = 0, idx, tail, max = object.length, map2 = BASE64_MAP;
9753 for (idx = 0; idx < max; idx++) {
9754 if (idx % 3 === 0 && idx) {
9755 result += map2[bits >> 18 & 63];
9756 result += map2[bits >> 12 & 63];
9757 result += map2[bits >> 6 & 63];
9758 result += map2[bits & 63];
9760 bits = (bits << 8) + object[idx];
9764 result += map2[bits >> 18 & 63];
9765 result += map2[bits >> 12 & 63];
9766 result += map2[bits >> 6 & 63];
9767 result += map2[bits & 63];
9768 } else if (tail === 2) {
9769 result += map2[bits >> 10 & 63];
9770 result += map2[bits >> 4 & 63];
9771 result += map2[bits << 2 & 63];
9773 } else if (tail === 1) {
9774 result += map2[bits >> 2 & 63];
9775 result += map2[bits << 4 & 63];
9781 function isBinary(obj) {
9782 return Object.prototype.toString.call(obj) === "[object Uint8Array]";
9784 var binary = new type("tag:yaml.org,2002:binary", {
9786 resolve: resolveYamlBinary,
9787 construct: constructYamlBinary,
9788 predicate: isBinary,
9789 represent: representYamlBinary
9791 var _hasOwnProperty$3 = Object.prototype.hasOwnProperty;
9792 var _toString$2 = Object.prototype.toString;
9793 function resolveYamlOmap(data) {
9796 var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
9797 for (index = 0, length = object.length; index < length; index += 1) {
9798 pair = object[index];
9800 if (_toString$2.call(pair) !== "[object Object]")
9802 for (pairKey in pair) {
9803 if (_hasOwnProperty$3.call(pair, pairKey)) {
9812 if (objectKeys.indexOf(pairKey) === -1)
9813 objectKeys.push(pairKey);
9819 function constructYamlOmap(data) {
9820 return data !== null ? data : [];
9822 var omap = new type("tag:yaml.org,2002:omap", {
9824 resolve: resolveYamlOmap,
9825 construct: constructYamlOmap
9827 var _toString$1 = Object.prototype.toString;
9828 function resolveYamlPairs(data) {
9831 var index, length, pair, keys, result, object = data;
9832 result = new Array(object.length);
9833 for (index = 0, length = object.length; index < length; index += 1) {
9834 pair = object[index];
9835 if (_toString$1.call(pair) !== "[object Object]")
9837 keys = Object.keys(pair);
9838 if (keys.length !== 1)
9840 result[index] = [keys[0], pair[keys[0]]];
9844 function constructYamlPairs(data) {
9847 var index, length, pair, keys, result, object = data;
9848 result = new Array(object.length);
9849 for (index = 0, length = object.length; index < length; index += 1) {
9850 pair = object[index];
9851 keys = Object.keys(pair);
9852 result[index] = [keys[0], pair[keys[0]]];
9856 var pairs = new type("tag:yaml.org,2002:pairs", {
9858 resolve: resolveYamlPairs,
9859 construct: constructYamlPairs
9861 var _hasOwnProperty$2 = Object.prototype.hasOwnProperty;
9862 function resolveYamlSet(data) {
9865 var key, object = data;
9866 for (key in object) {
9867 if (_hasOwnProperty$2.call(object, key)) {
9868 if (object[key] !== null)
9874 function constructYamlSet(data) {
9875 return data !== null ? data : {};
9877 var set = new type("tag:yaml.org,2002:set", {
9879 resolve: resolveYamlSet,
9880 construct: constructYamlSet
9882 var _default = core.extend({
9894 var _hasOwnProperty$1 = Object.prototype.hasOwnProperty;
9895 var CONTEXT_FLOW_IN = 1;
9896 var CONTEXT_FLOW_OUT = 2;
9897 var CONTEXT_BLOCK_IN = 3;
9898 var CONTEXT_BLOCK_OUT = 4;
9899 var CHOMPING_CLIP = 1;
9900 var CHOMPING_STRIP = 2;
9901 var CHOMPING_KEEP = 3;
9902 var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
9903 var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
9904 var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
9905 var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
9906 var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
9907 function _class(obj) {
9908 return Object.prototype.toString.call(obj);
9910 function is_EOL(c) {
9911 return c === 10 || c === 13;
9913 function is_WHITE_SPACE(c) {
9914 return c === 9 || c === 32;
9916 function is_WS_OR_EOL(c) {
9917 return c === 9 || c === 32 || c === 10 || c === 13;
9919 function is_FLOW_INDICATOR(c) {
9920 return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
9922 function fromHexCode(c) {
9924 if (48 <= c && c <= 57) {
9928 if (97 <= lc && lc <= 102) {
9929 return lc - 97 + 10;
9933 function escapedHexLen(c) {
9945 function fromDecimalCode(c) {
9946 if (48 <= c && c <= 57) {
9951 function simpleEscapeSequence(c) {
9952 return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? "\r" : c === 101 ? "
\e" : c === 32 ? " " : c === 34 ? '"' : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "\x85" : c === 95 ? "\xA0" : c === 76 ? "\u2028" : c === 80 ? "\u2029" : "";
9954 function charFromCodepoint(c) {
9956 return String.fromCharCode(c);
9958 return String.fromCharCode((c - 65536 >> 10) + 55296, (c - 65536 & 1023) + 56320);
9960 var simpleEscapeCheck = new Array(256);
9961 var simpleEscapeMap = new Array(256);
9962 for (i = 0; i < 256; i++) {
9963 simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
9964 simpleEscapeMap[i] = simpleEscapeSequence(i);
9967 function State$1(input, options) {
9969 this.filename = options["filename"] || null;
9970 this.schema = options["schema"] || _default;
9971 this.onWarning = options["onWarning"] || null;
9972 this.legacy = options["legacy"] || false;
9973 this.json = options["json"] || false;
9974 this.listener = options["listener"] || null;
9975 this.implicitTypes = this.schema.compiledImplicit;
9976 this.typeMap = this.schema.compiledTypeMap;
9977 this.length = input.length;
9981 this.lineIndent = 0;
9982 this.firstTabInLine = -1;
9983 this.documents = [];
9985 function generateError(state, message) {
9987 name: state.filename,
9988 buffer: state.input.slice(0, -1),
9989 position: state.position,
9991 column: state.position - state.lineStart
9993 mark.snippet = snippet(mark);
9994 return new exception(message, mark);
9996 function throwError(state, message) {
9997 throw generateError(state, message);
9999 function throwWarning(state, message) {
10000 if (state.onWarning) {
10001 state.onWarning.call(null, generateError(state, message));
10004 var directiveHandlers = {
10005 YAML: function handleYamlDirective(state, name, args) {
10006 var match, major, minor;
10007 if (state.version !== null) {
10008 throwError(state, "duplication of %YAML directive");
10010 if (args.length !== 1) {
10011 throwError(state, "YAML directive accepts exactly one argument");
10013 match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
10014 if (match === null) {
10015 throwError(state, "ill-formed argument of the YAML directive");
10017 major = parseInt(match[1], 10);
10018 minor = parseInt(match[2], 10);
10020 throwError(state, "unacceptable YAML version of the document");
10022 state.version = args[0];
10023 state.checkLineBreaks = minor < 2;
10024 if (minor !== 1 && minor !== 2) {
10025 throwWarning(state, "unsupported YAML version of the document");
10028 TAG: function handleTagDirective(state, name, args) {
10029 var handle, prefix;
10030 if (args.length !== 2) {
10031 throwError(state, "TAG directive accepts exactly two arguments");
10035 if (!PATTERN_TAG_HANDLE.test(handle)) {
10036 throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
10038 if (_hasOwnProperty$1.call(state.tagMap, handle)) {
10039 throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
10041 if (!PATTERN_TAG_URI.test(prefix)) {
10042 throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
10045 prefix = decodeURIComponent(prefix);
10047 throwError(state, "tag prefix is malformed: " + prefix);
10049 state.tagMap[handle] = prefix;
10052 function captureSegment(state, start, end, checkJson) {
10053 var _position, _length, _character, _result;
10055 _result = state.input.slice(start, end);
10057 for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
10058 _character = _result.charCodeAt(_position);
10059 if (!(_character === 9 || 32 <= _character && _character <= 1114111)) {
10060 throwError(state, "expected valid JSON character");
10063 } else if (PATTERN_NON_PRINTABLE.test(_result)) {
10064 throwError(state, "the stream contains non-printable characters");
10066 state.result += _result;
10069 function mergeMappings(state, destination, source, overridableKeys) {
10070 var sourceKeys, key, index, quantity;
10071 if (!common.isObject(source)) {
10072 throwError(state, "cannot merge mappings; the provided source object is unacceptable");
10074 sourceKeys = Object.keys(source);
10075 for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
10076 key = sourceKeys[index];
10077 if (!_hasOwnProperty$1.call(destination, key)) {
10078 destination[key] = source[key];
10079 overridableKeys[key] = true;
10083 function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) {
10084 var index, quantity;
10085 if (Array.isArray(keyNode)) {
10086 keyNode = Array.prototype.slice.call(keyNode);
10087 for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
10088 if (Array.isArray(keyNode[index])) {
10089 throwError(state, "nested arrays are not supported inside keys");
10091 if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") {
10092 keyNode[index] = "[object Object]";
10096 if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") {
10097 keyNode = "[object Object]";
10099 keyNode = String(keyNode);
10100 if (_result === null) {
10103 if (keyTag === "tag:yaml.org,2002:merge") {
10104 if (Array.isArray(valueNode)) {
10105 for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
10106 mergeMappings(state, _result, valueNode[index], overridableKeys);
10109 mergeMappings(state, _result, valueNode, overridableKeys);
10112 if (!state.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) {
10113 state.line = startLine || state.line;
10114 state.lineStart = startLineStart || state.lineStart;
10115 state.position = startPos || state.position;
10116 throwError(state, "duplicated mapping key");
10118 if (keyNode === "__proto__") {
10119 Object.defineProperty(_result, keyNode, {
10120 configurable: true,
10126 _result[keyNode] = valueNode;
10128 delete overridableKeys[keyNode];
10132 function readLineBreak(state) {
10134 ch = state.input.charCodeAt(state.position);
10137 } else if (ch === 13) {
10139 if (state.input.charCodeAt(state.position) === 10) {
10143 throwError(state, "a line break is expected");
10146 state.lineStart = state.position;
10147 state.firstTabInLine = -1;
10149 function skipSeparationSpace(state, allowComments, checkIndent) {
10150 var lineBreaks = 0, ch = state.input.charCodeAt(state.position);
10152 while (is_WHITE_SPACE(ch)) {
10153 if (ch === 9 && state.firstTabInLine === -1) {
10154 state.firstTabInLine = state.position;
10156 ch = state.input.charCodeAt(++state.position);
10158 if (allowComments && ch === 35) {
10160 ch = state.input.charCodeAt(++state.position);
10161 } while (ch !== 10 && ch !== 13 && ch !== 0);
10164 readLineBreak(state);
10165 ch = state.input.charCodeAt(state.position);
10167 state.lineIndent = 0;
10168 while (ch === 32) {
10169 state.lineIndent++;
10170 ch = state.input.charCodeAt(++state.position);
10176 if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
10177 throwWarning(state, "deficient indentation");
10181 function testDocumentSeparator(state) {
10182 var _position = state.position, ch;
10183 ch = state.input.charCodeAt(_position);
10184 if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
10186 ch = state.input.charCodeAt(_position);
10187 if (ch === 0 || is_WS_OR_EOL(ch)) {
10193 function writeFoldedLines(state, count) {
10195 state.result += " ";
10196 } else if (count > 1) {
10197 state.result += common.repeat("\n", count - 1);
10200 function readPlainScalar(state, nodeIndent, withinFlowCollection) {
10201 var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch;
10202 ch = state.input.charCodeAt(state.position);
10203 if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) {
10206 if (ch === 63 || ch === 45) {
10207 following = state.input.charCodeAt(state.position + 1);
10208 if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
10212 state.kind = "scalar";
10214 captureStart = captureEnd = state.position;
10215 hasPendingContent = false;
10218 following = state.input.charCodeAt(state.position + 1);
10219 if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
10222 } else if (ch === 35) {
10223 preceding = state.input.charCodeAt(state.position - 1);
10224 if (is_WS_OR_EOL(preceding)) {
10227 } else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) {
10229 } else if (is_EOL(ch)) {
10230 _line = state.line;
10231 _lineStart = state.lineStart;
10232 _lineIndent = state.lineIndent;
10233 skipSeparationSpace(state, false, -1);
10234 if (state.lineIndent >= nodeIndent) {
10235 hasPendingContent = true;
10236 ch = state.input.charCodeAt(state.position);
10239 state.position = captureEnd;
10240 state.line = _line;
10241 state.lineStart = _lineStart;
10242 state.lineIndent = _lineIndent;
10246 if (hasPendingContent) {
10247 captureSegment(state, captureStart, captureEnd, false);
10248 writeFoldedLines(state, state.line - _line);
10249 captureStart = captureEnd = state.position;
10250 hasPendingContent = false;
10252 if (!is_WHITE_SPACE(ch)) {
10253 captureEnd = state.position + 1;
10255 ch = state.input.charCodeAt(++state.position);
10257 captureSegment(state, captureStart, captureEnd, false);
10258 if (state.result) {
10261 state.kind = _kind;
10262 state.result = _result;
10265 function readSingleQuotedScalar(state, nodeIndent) {
10266 var ch, captureStart, captureEnd;
10267 ch = state.input.charCodeAt(state.position);
10271 state.kind = "scalar";
10274 captureStart = captureEnd = state.position;
10275 while ((ch = state.input.charCodeAt(state.position)) !== 0) {
10277 captureSegment(state, captureStart, state.position, true);
10278 ch = state.input.charCodeAt(++state.position);
10280 captureStart = state.position;
10282 captureEnd = state.position;
10286 } else if (is_EOL(ch)) {
10287 captureSegment(state, captureStart, captureEnd, true);
10288 writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
10289 captureStart = captureEnd = state.position;
10290 } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
10291 throwError(state, "unexpected end of the document within a single quoted scalar");
10294 captureEnd = state.position;
10297 throwError(state, "unexpected end of the stream within a single quoted scalar");
10299 function readDoubleQuotedScalar(state, nodeIndent) {
10300 var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
10301 ch = state.input.charCodeAt(state.position);
10305 state.kind = "scalar";
10308 captureStart = captureEnd = state.position;
10309 while ((ch = state.input.charCodeAt(state.position)) !== 0) {
10311 captureSegment(state, captureStart, state.position, true);
10314 } else if (ch === 92) {
10315 captureSegment(state, captureStart, state.position, true);
10316 ch = state.input.charCodeAt(++state.position);
10318 skipSeparationSpace(state, false, nodeIndent);
10319 } else if (ch < 256 && simpleEscapeCheck[ch]) {
10320 state.result += simpleEscapeMap[ch];
10322 } else if ((tmp = escapedHexLen(ch)) > 0) {
10325 for (; hexLength > 0; hexLength--) {
10326 ch = state.input.charCodeAt(++state.position);
10327 if ((tmp = fromHexCode(ch)) >= 0) {
10328 hexResult = (hexResult << 4) + tmp;
10330 throwError(state, "expected hexadecimal character");
10333 state.result += charFromCodepoint(hexResult);
10336 throwError(state, "unknown escape sequence");
10338 captureStart = captureEnd = state.position;
10339 } else if (is_EOL(ch)) {
10340 captureSegment(state, captureStart, captureEnd, true);
10341 writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
10342 captureStart = captureEnd = state.position;
10343 } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
10344 throwError(state, "unexpected end of the document within a double quoted scalar");
10347 captureEnd = state.position;
10350 throwError(state, "unexpected end of the stream within a double quoted scalar");
10352 function readFlowCollection(state, nodeIndent) {
10353 var readNext = true, _line, _lineStart, _pos, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = Object.create(null), keyNode, keyTag, valueNode, ch;
10354 ch = state.input.charCodeAt(state.position);
10359 } else if (ch === 123) {
10366 if (state.anchor !== null) {
10367 state.anchorMap[state.anchor] = _result;
10369 ch = state.input.charCodeAt(++state.position);
10371 skipSeparationSpace(state, true, nodeIndent);
10372 ch = state.input.charCodeAt(state.position);
10373 if (ch === terminator) {
10376 state.anchor = _anchor;
10377 state.kind = isMapping ? "mapping" : "sequence";
10378 state.result = _result;
10380 } else if (!readNext) {
10381 throwError(state, "missed comma between flow collection entries");
10382 } else if (ch === 44) {
10383 throwError(state, "expected the node content, but found ','");
10385 keyTag = keyNode = valueNode = null;
10386 isPair = isExplicitPair = false;
10388 following = state.input.charCodeAt(state.position + 1);
10389 if (is_WS_OR_EOL(following)) {
10390 isPair = isExplicitPair = true;
10392 skipSeparationSpace(state, true, nodeIndent);
10395 _line = state.line;
10396 _lineStart = state.lineStart;
10397 _pos = state.position;
10398 composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
10399 keyTag = state.tag;
10400 keyNode = state.result;
10401 skipSeparationSpace(state, true, nodeIndent);
10402 ch = state.input.charCodeAt(state.position);
10403 if ((isExplicitPair || state.line === _line) && ch === 58) {
10405 ch = state.input.charCodeAt(++state.position);
10406 skipSeparationSpace(state, true, nodeIndent);
10407 composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
10408 valueNode = state.result;
10411 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
10412 } else if (isPair) {
10413 _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
10415 _result.push(keyNode);
10417 skipSeparationSpace(state, true, nodeIndent);
10418 ch = state.input.charCodeAt(state.position);
10421 ch = state.input.charCodeAt(++state.position);
10426 throwError(state, "unexpected end of the stream within a flow collection");
10428 function readBlockScalar(state, nodeIndent) {
10429 var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
10430 ch = state.input.charCodeAt(state.position);
10433 } else if (ch === 62) {
10438 state.kind = "scalar";
10441 ch = state.input.charCodeAt(++state.position);
10442 if (ch === 43 || ch === 45) {
10443 if (CHOMPING_CLIP === chomping) {
10444 chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
10446 throwError(state, "repeat of a chomping mode identifier");
10448 } else if ((tmp = fromDecimalCode(ch)) >= 0) {
10450 throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
10451 } else if (!detectedIndent) {
10452 textIndent = nodeIndent + tmp - 1;
10453 detectedIndent = true;
10455 throwError(state, "repeat of an indentation width identifier");
10461 if (is_WHITE_SPACE(ch)) {
10463 ch = state.input.charCodeAt(++state.position);
10464 } while (is_WHITE_SPACE(ch));
10467 ch = state.input.charCodeAt(++state.position);
10468 } while (!is_EOL(ch) && ch !== 0);
10472 readLineBreak(state);
10473 state.lineIndent = 0;
10474 ch = state.input.charCodeAt(state.position);
10475 while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) {
10476 state.lineIndent++;
10477 ch = state.input.charCodeAt(++state.position);
10479 if (!detectedIndent && state.lineIndent > textIndent) {
10480 textIndent = state.lineIndent;
10486 if (state.lineIndent < textIndent) {
10487 if (chomping === CHOMPING_KEEP) {
10488 state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
10489 } else if (chomping === CHOMPING_CLIP) {
10490 if (didReadContent) {
10491 state.result += "\n";
10497 if (is_WHITE_SPACE(ch)) {
10498 atMoreIndented = true;
10499 state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
10500 } else if (atMoreIndented) {
10501 atMoreIndented = false;
10502 state.result += common.repeat("\n", emptyLines + 1);
10503 } else if (emptyLines === 0) {
10504 if (didReadContent) {
10505 state.result += " ";
10508 state.result += common.repeat("\n", emptyLines);
10511 state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
10513 didReadContent = true;
10514 detectedIndent = true;
10516 captureStart = state.position;
10517 while (!is_EOL(ch) && ch !== 0) {
10518 ch = state.input.charCodeAt(++state.position);
10520 captureSegment(state, captureStart, state.position, false);
10524 function readBlockSequence(state, nodeIndent) {
10525 var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch;
10526 if (state.firstTabInLine !== -1)
10528 if (state.anchor !== null) {
10529 state.anchorMap[state.anchor] = _result;
10531 ch = state.input.charCodeAt(state.position);
10533 if (state.firstTabInLine !== -1) {
10534 state.position = state.firstTabInLine;
10535 throwError(state, "tab characters must not be used in indentation");
10540 following = state.input.charCodeAt(state.position + 1);
10541 if (!is_WS_OR_EOL(following)) {
10546 if (skipSeparationSpace(state, true, -1)) {
10547 if (state.lineIndent <= nodeIndent) {
10548 _result.push(null);
10549 ch = state.input.charCodeAt(state.position);
10553 _line = state.line;
10554 composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
10555 _result.push(state.result);
10556 skipSeparationSpace(state, true, -1);
10557 ch = state.input.charCodeAt(state.position);
10558 if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
10559 throwError(state, "bad indentation of a sequence entry");
10560 } else if (state.lineIndent < nodeIndent) {
10566 state.anchor = _anchor;
10567 state.kind = "sequence";
10568 state.result = _result;
10573 function readBlockMapping(state, nodeIndent, flowIndent) {
10574 var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
10575 if (state.firstTabInLine !== -1)
10577 if (state.anchor !== null) {
10578 state.anchorMap[state.anchor] = _result;
10580 ch = state.input.charCodeAt(state.position);
10582 if (!atExplicitKey && state.firstTabInLine !== -1) {
10583 state.position = state.firstTabInLine;
10584 throwError(state, "tab characters must not be used in indentation");
10586 following = state.input.charCodeAt(state.position + 1);
10587 _line = state.line;
10588 if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
10590 if (atExplicitKey) {
10591 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
10592 keyTag = keyNode = valueNode = null;
10595 atExplicitKey = true;
10596 allowCompact = true;
10597 } else if (atExplicitKey) {
10598 atExplicitKey = false;
10599 allowCompact = true;
10601 throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
10603 state.position += 1;
10606 _keyLine = state.line;
10607 _keyLineStart = state.lineStart;
10608 _keyPos = state.position;
10609 if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
10612 if (state.line === _line) {
10613 ch = state.input.charCodeAt(state.position);
10614 while (is_WHITE_SPACE(ch)) {
10615 ch = state.input.charCodeAt(++state.position);
10618 ch = state.input.charCodeAt(++state.position);
10619 if (!is_WS_OR_EOL(ch)) {
10620 throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
10622 if (atExplicitKey) {
10623 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
10624 keyTag = keyNode = valueNode = null;
10627 atExplicitKey = false;
10628 allowCompact = false;
10629 keyTag = state.tag;
10630 keyNode = state.result;
10631 } else if (detected) {
10632 throwError(state, "can not read an implicit mapping pair; a colon is missed");
10635 state.anchor = _anchor;
10638 } else if (detected) {
10639 throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
10642 state.anchor = _anchor;
10646 if (state.line === _line || state.lineIndent > nodeIndent) {
10647 if (atExplicitKey) {
10648 _keyLine = state.line;
10649 _keyLineStart = state.lineStart;
10650 _keyPos = state.position;
10652 if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
10653 if (atExplicitKey) {
10654 keyNode = state.result;
10656 valueNode = state.result;
10659 if (!atExplicitKey) {
10660 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
10661 keyTag = keyNode = valueNode = null;
10663 skipSeparationSpace(state, true, -1);
10664 ch = state.input.charCodeAt(state.position);
10666 if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
10667 throwError(state, "bad indentation of a mapping entry");
10668 } else if (state.lineIndent < nodeIndent) {
10672 if (atExplicitKey) {
10673 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
10677 state.anchor = _anchor;
10678 state.kind = "mapping";
10679 state.result = _result;
10683 function readTagProperty(state) {
10684 var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch;
10685 ch = state.input.charCodeAt(state.position);
10688 if (state.tag !== null) {
10689 throwError(state, "duplication of a tag property");
10691 ch = state.input.charCodeAt(++state.position);
10694 ch = state.input.charCodeAt(++state.position);
10695 } else if (ch === 33) {
10698 ch = state.input.charCodeAt(++state.position);
10702 _position = state.position;
10705 ch = state.input.charCodeAt(++state.position);
10706 } while (ch !== 0 && ch !== 62);
10707 if (state.position < state.length) {
10708 tagName = state.input.slice(_position, state.position);
10709 ch = state.input.charCodeAt(++state.position);
10711 throwError(state, "unexpected end of the stream within a verbatim tag");
10714 while (ch !== 0 && !is_WS_OR_EOL(ch)) {
10717 tagHandle = state.input.slice(_position - 1, state.position + 1);
10718 if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
10719 throwError(state, "named tag handle cannot contain such characters");
10722 _position = state.position + 1;
10724 throwError(state, "tag suffix cannot contain exclamation marks");
10727 ch = state.input.charCodeAt(++state.position);
10729 tagName = state.input.slice(_position, state.position);
10730 if (PATTERN_FLOW_INDICATORS.test(tagName)) {
10731 throwError(state, "tag suffix cannot contain flow indicator characters");
10734 if (tagName && !PATTERN_TAG_URI.test(tagName)) {
10735 throwError(state, "tag name cannot contain such characters: " + tagName);
10738 tagName = decodeURIComponent(tagName);
10740 throwError(state, "tag name is malformed: " + tagName);
10743 state.tag = tagName;
10744 } else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) {
10745 state.tag = state.tagMap[tagHandle] + tagName;
10746 } else if (tagHandle === "!") {
10747 state.tag = "!" + tagName;
10748 } else if (tagHandle === "!!") {
10749 state.tag = "tag:yaml.org,2002:" + tagName;
10751 throwError(state, 'undeclared tag handle "' + tagHandle + '"');
10755 function readAnchorProperty(state) {
10757 ch = state.input.charCodeAt(state.position);
10760 if (state.anchor !== null) {
10761 throwError(state, "duplication of an anchor property");
10763 ch = state.input.charCodeAt(++state.position);
10764 _position = state.position;
10765 while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
10766 ch = state.input.charCodeAt(++state.position);
10768 if (state.position === _position) {
10769 throwError(state, "name of an anchor node must contain at least one character");
10771 state.anchor = state.input.slice(_position, state.position);
10774 function readAlias(state) {
10775 var _position, alias, ch;
10776 ch = state.input.charCodeAt(state.position);
10779 ch = state.input.charCodeAt(++state.position);
10780 _position = state.position;
10781 while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
10782 ch = state.input.charCodeAt(++state.position);
10784 if (state.position === _position) {
10785 throwError(state, "name of an alias node must contain at least one character");
10787 alias = state.input.slice(_position, state.position);
10788 if (!_hasOwnProperty$1.call(state.anchorMap, alias)) {
10789 throwError(state, 'unidentified alias "' + alias + '"');
10791 state.result = state.anchorMap[alias];
10792 skipSeparationSpace(state, true, -1);
10795 function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
10796 var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type2, flowIndent, blockIndent;
10797 if (state.listener !== null) {
10798 state.listener("open", state);
10801 state.anchor = null;
10803 state.result = null;
10804 allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
10806 if (skipSeparationSpace(state, true, -1)) {
10808 if (state.lineIndent > parentIndent) {
10810 } else if (state.lineIndent === parentIndent) {
10812 } else if (state.lineIndent < parentIndent) {
10817 if (indentStatus === 1) {
10818 while (readTagProperty(state) || readAnchorProperty(state)) {
10819 if (skipSeparationSpace(state, true, -1)) {
10821 allowBlockCollections = allowBlockStyles;
10822 if (state.lineIndent > parentIndent) {
10824 } else if (state.lineIndent === parentIndent) {
10826 } else if (state.lineIndent < parentIndent) {
10830 allowBlockCollections = false;
10834 if (allowBlockCollections) {
10835 allowBlockCollections = atNewLine || allowCompact;
10837 if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
10838 if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
10839 flowIndent = parentIndent;
10841 flowIndent = parentIndent + 1;
10843 blockIndent = state.position - state.lineStart;
10844 if (indentStatus === 1) {
10845 if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) {
10848 if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) {
10850 } else if (readAlias(state)) {
10852 if (state.tag !== null || state.anchor !== null) {
10853 throwError(state, "alias node should not have any properties");
10855 } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
10857 if (state.tag === null) {
10861 if (state.anchor !== null) {
10862 state.anchorMap[state.anchor] = state.result;
10865 } else if (indentStatus === 0) {
10866 hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
10869 if (state.tag === null) {
10870 if (state.anchor !== null) {
10871 state.anchorMap[state.anchor] = state.result;
10873 } else if (state.tag === "?") {
10874 if (state.result !== null && state.kind !== "scalar") {
10875 throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
10877 for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
10878 type2 = state.implicitTypes[typeIndex];
10879 if (type2.resolve(state.result)) {
10880 state.result = type2.construct(state.result);
10881 state.tag = type2.tag;
10882 if (state.anchor !== null) {
10883 state.anchorMap[state.anchor] = state.result;
10888 } else if (state.tag !== "!") {
10889 if (_hasOwnProperty$1.call(state.typeMap[state.kind || "fallback"], state.tag)) {
10890 type2 = state.typeMap[state.kind || "fallback"][state.tag];
10893 typeList = state.typeMap.multi[state.kind || "fallback"];
10894 for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
10895 if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
10896 type2 = typeList[typeIndex];
10902 throwError(state, "unknown tag !<" + state.tag + ">");
10904 if (state.result !== null && type2.kind !== state.kind) {
10905 throwError(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type2.kind + '", not "' + state.kind + '"');
10907 if (!type2.resolve(state.result, state.tag)) {
10908 throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
10910 state.result = type2.construct(state.result, state.tag);
10911 if (state.anchor !== null) {
10912 state.anchorMap[state.anchor] = state.result;
10916 if (state.listener !== null) {
10917 state.listener("close", state);
10919 return state.tag !== null || state.anchor !== null || hasContent;
10921 function readDocument(state) {
10922 var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
10923 state.version = null;
10924 state.checkLineBreaks = state.legacy;
10925 state.tagMap = Object.create(null);
10926 state.anchorMap = Object.create(null);
10927 while ((ch = state.input.charCodeAt(state.position)) !== 0) {
10928 skipSeparationSpace(state, true, -1);
10929 ch = state.input.charCodeAt(state.position);
10930 if (state.lineIndent > 0 || ch !== 37) {
10933 hasDirectives = true;
10934 ch = state.input.charCodeAt(++state.position);
10935 _position = state.position;
10936 while (ch !== 0 && !is_WS_OR_EOL(ch)) {
10937 ch = state.input.charCodeAt(++state.position);
10939 directiveName = state.input.slice(_position, state.position);
10940 directiveArgs = [];
10941 if (directiveName.length < 1) {
10942 throwError(state, "directive name must not be less than one character in length");
10945 while (is_WHITE_SPACE(ch)) {
10946 ch = state.input.charCodeAt(++state.position);
10950 ch = state.input.charCodeAt(++state.position);
10951 } while (ch !== 0 && !is_EOL(ch));
10956 _position = state.position;
10957 while (ch !== 0 && !is_WS_OR_EOL(ch)) {
10958 ch = state.input.charCodeAt(++state.position);
10960 directiveArgs.push(state.input.slice(_position, state.position));
10963 readLineBreak(state);
10964 if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) {
10965 directiveHandlers[directiveName](state, directiveName, directiveArgs);
10967 throwWarning(state, 'unknown document directive "' + directiveName + '"');
10970 skipSeparationSpace(state, true, -1);
10971 if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) {
10972 state.position += 3;
10973 skipSeparationSpace(state, true, -1);
10974 } else if (hasDirectives) {
10975 throwError(state, "directives end mark is expected");
10977 composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
10978 skipSeparationSpace(state, true, -1);
10979 if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
10980 throwWarning(state, "non-ASCII line breaks are interpreted as content");
10982 state.documents.push(state.result);
10983 if (state.position === state.lineStart && testDocumentSeparator(state)) {
10984 if (state.input.charCodeAt(state.position) === 46) {
10985 state.position += 3;
10986 skipSeparationSpace(state, true, -1);
10990 if (state.position < state.length - 1) {
10991 throwError(state, "end of the stream or a document separator is expected");
10996 function loadDocuments(input, options) {
10997 input = String(input);
10998 options = options || {};
10999 if (input.length !== 0) {
11000 if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) {
11003 if (input.charCodeAt(0) === 65279) {
11004 input = input.slice(1);
11007 var state = new State$1(input, options);
11008 var nullpos = input.indexOf("\0");
11009 if (nullpos !== -1) {
11010 state.position = nullpos;
11011 throwError(state, "null byte is not allowed in input");
11013 state.input += "\0";
11014 while (state.input.charCodeAt(state.position) === 32) {
11015 state.lineIndent += 1;
11016 state.position += 1;
11018 while (state.position < state.length - 1) {
11019 readDocument(state);
11021 return state.documents;
11023 function loadAll$1(input, iterator, options) {
11024 if (iterator !== null && typeof iterator === "object" && typeof options === "undefined") {
11025 options = iterator;
11028 var documents = loadDocuments(input, options);
11029 if (typeof iterator !== "function") {
11032 for (var index = 0, length = documents.length; index < length; index += 1) {
11033 iterator(documents[index]);
11036 function load$1(input, options) {
11037 var documents = loadDocuments(input, options);
11038 if (documents.length === 0) {
11040 } else if (documents.length === 1) {
11041 return documents[0];
11043 throw new exception("expected a single document in the stream, but found more");
11045 var loadAll_1 = loadAll$1;
11046 var load_1 = load$1;
11048 loadAll: loadAll_1,
11051 var _toString = Object.prototype.toString;
11052 var _hasOwnProperty = Object.prototype.hasOwnProperty;
11053 var CHAR_BOM = 65279;
11055 var CHAR_LINE_FEED = 10;
11056 var CHAR_CARRIAGE_RETURN = 13;
11057 var CHAR_SPACE = 32;
11058 var CHAR_EXCLAMATION = 33;
11059 var CHAR_DOUBLE_QUOTE = 34;
11060 var CHAR_SHARP = 35;
11061 var CHAR_PERCENT = 37;
11062 var CHAR_AMPERSAND = 38;
11063 var CHAR_SINGLE_QUOTE = 39;
11064 var CHAR_ASTERISK = 42;
11065 var CHAR_COMMA = 44;
11066 var CHAR_MINUS = 45;
11067 var CHAR_COLON = 58;
11068 var CHAR_EQUALS = 61;
11069 var CHAR_GREATER_THAN = 62;
11070 var CHAR_QUESTION = 63;
11071 var CHAR_COMMERCIAL_AT = 64;
11072 var CHAR_LEFT_SQUARE_BRACKET = 91;
11073 var CHAR_RIGHT_SQUARE_BRACKET = 93;
11074 var CHAR_GRAVE_ACCENT = 96;
11075 var CHAR_LEFT_CURLY_BRACKET = 123;
11076 var CHAR_VERTICAL_LINE = 124;
11077 var CHAR_RIGHT_CURLY_BRACKET = 125;
11078 var ESCAPE_SEQUENCES = {};
11079 ESCAPE_SEQUENCES[0] = "\\0";
11080 ESCAPE_SEQUENCES[7] = "\\a";
11081 ESCAPE_SEQUENCES[8] = "\\b";
11082 ESCAPE_SEQUENCES[9] = "\\t";
11083 ESCAPE_SEQUENCES[10] = "\\n";
11084 ESCAPE_SEQUENCES[11] = "\\v";
11085 ESCAPE_SEQUENCES[12] = "\\f";
11086 ESCAPE_SEQUENCES[13] = "\\r";
11087 ESCAPE_SEQUENCES[27] = "\\e";
11088 ESCAPE_SEQUENCES[34] = '\\"';
11089 ESCAPE_SEQUENCES[92] = "\\\\";
11090 ESCAPE_SEQUENCES[133] = "\\N";
11091 ESCAPE_SEQUENCES[160] = "\\_";
11092 ESCAPE_SEQUENCES[8232] = "\\L";
11093 ESCAPE_SEQUENCES[8233] = "\\P";
11094 var DEPRECATED_BOOLEANS_SYNTAX = [
11112 var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
11113 function compileStyleMap(schema2, map2) {
11114 var result, keys, index, length, tag, style, type2;
11118 keys = Object.keys(map2);
11119 for (index = 0, length = keys.length; index < length; index += 1) {
11121 style = String(map2[tag]);
11122 if (tag.slice(0, 2) === "!!") {
11123 tag = "tag:yaml.org,2002:" + tag.slice(2);
11125 type2 = schema2.compiledTypeMap["fallback"][tag];
11126 if (type2 && _hasOwnProperty.call(type2.styleAliases, style)) {
11127 style = type2.styleAliases[style];
11129 result[tag] = style;
11133 function encodeHex(character) {
11134 var string, handle, length;
11135 string = character.toString(16).toUpperCase();
11136 if (character <= 255) {
11139 } else if (character <= 65535) {
11142 } else if (character <= 4294967295) {
11146 throw new exception("code point within a string may not be greater than 0xFFFFFFFF");
11148 return "\\" + handle + common.repeat("0", length - string.length) + string;
11150 var QUOTING_TYPE_SINGLE = 1;
11151 var QUOTING_TYPE_DOUBLE = 2;
11152 function State(options) {
11153 this.schema = options["schema"] || _default;
11154 this.indent = Math.max(1, options["indent"] || 2);
11155 this.noArrayIndent = options["noArrayIndent"] || false;
11156 this.skipInvalid = options["skipInvalid"] || false;
11157 this.flowLevel = common.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"];
11158 this.styleMap = compileStyleMap(this.schema, options["styles"] || null);
11159 this.sortKeys = options["sortKeys"] || false;
11160 this.lineWidth = options["lineWidth"] || 80;
11161 this.noRefs = options["noRefs"] || false;
11162 this.noCompatMode = options["noCompatMode"] || false;
11163 this.condenseFlow = options["condenseFlow"] || false;
11164 this.quotingType = options["quotingType"] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
11165 this.forceQuotes = options["forceQuotes"] || false;
11166 this.replacer = typeof options["replacer"] === "function" ? options["replacer"] : null;
11167 this.implicitTypes = this.schema.compiledImplicit;
11168 this.explicitTypes = this.schema.compiledExplicit;
11171 this.duplicates = [];
11172 this.usedDuplicates = null;
11174 function indentString(string, spaces) {
11175 var ind = common.repeat(" ", spaces), position = 0, next = -1, result = "", line, length = string.length;
11176 while (position < length) {
11177 next = string.indexOf("\n", position);
11179 line = string.slice(position);
11182 line = string.slice(position, next + 1);
11183 position = next + 1;
11185 if (line.length && line !== "\n")
11191 function generateNextLine(state, level) {
11192 return "\n" + common.repeat(" ", state.indent * level);
11194 function testImplicitResolving(state, str2) {
11195 var index, length, type2;
11196 for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
11197 type2 = state.implicitTypes[index];
11198 if (type2.resolve(str2)) {
11204 function isWhitespace(c) {
11205 return c === CHAR_SPACE || c === CHAR_TAB;
11207 function isPrintable(c) {
11208 return 32 <= c && c <= 126 || 161 <= c && c <= 55295 && c !== 8232 && c !== 8233 || 57344 <= c && c <= 65533 && c !== CHAR_BOM || 65536 <= c && c <= 1114111;
11210 function isNsCharOrWhitespace(c) {
11211 return isPrintable(c) && c !== CHAR_BOM && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
11213 function isPlainSafe(c, prev, inblock) {
11214 var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
11215 var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
11216 return (inblock ? cIsNsCharOrWhitespace : cIsNsCharOrWhitespace && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET) && c !== CHAR_SHARP && !(prev === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP || prev === CHAR_COLON && cIsNsChar;
11218 function isPlainSafeFirst(c) {
11219 return isPrintable(c) && c !== CHAR_BOM && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT;
11221 function isPlainSafeLast(c) {
11222 return !isWhitespace(c) && c !== CHAR_COLON;
11224 function codePointAt(string, pos) {
11225 var first = string.charCodeAt(pos), second;
11226 if (first >= 55296 && first <= 56319 && pos + 1 < string.length) {
11227 second = string.charCodeAt(pos + 1);
11228 if (second >= 56320 && second <= 57343) {
11229 return (first - 55296) * 1024 + second - 56320 + 65536;
11234 function needIndentIndicator(string) {
11235 var leadingSpaceRe = /^\n* /;
11236 return leadingSpaceRe.test(string);
11238 var STYLE_PLAIN = 1;
11239 var STYLE_SINGLE = 2;
11240 var STYLE_LITERAL = 3;
11241 var STYLE_FOLDED = 4;
11242 var STYLE_DOUBLE = 5;
11243 function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) {
11246 var prevChar = null;
11247 var hasLineBreak = false;
11248 var hasFoldableLine = false;
11249 var shouldTrackWidth = lineWidth !== -1;
11250 var previousLineBreak = -1;
11251 var plain = isPlainSafeFirst(codePointAt(string, 0)) && isPlainSafeLast(codePointAt(string, string.length - 1));
11252 if (singleLineOnly || forceQuotes) {
11253 for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
11254 char = codePointAt(string, i);
11255 if (!isPrintable(char)) {
11256 return STYLE_DOUBLE;
11258 plain = plain && isPlainSafe(char, prevChar, inblock);
11262 for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
11263 char = codePointAt(string, i);
11264 if (char === CHAR_LINE_FEED) {
11265 hasLineBreak = true;
11266 if (shouldTrackWidth) {
11267 hasFoldableLine = hasFoldableLine || i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
11268 previousLineBreak = i;
11270 } else if (!isPrintable(char)) {
11271 return STYLE_DOUBLE;
11273 plain = plain && isPlainSafe(char, prevChar, inblock);
11276 hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ");
11278 if (!hasLineBreak && !hasFoldableLine) {
11279 if (plain && !forceQuotes && !testAmbiguousType(string)) {
11280 return STYLE_PLAIN;
11282 return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
11284 if (indentPerLevel > 9 && needIndentIndicator(string)) {
11285 return STYLE_DOUBLE;
11287 if (!forceQuotes) {
11288 return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
11290 return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
11292 function writeScalar(state, string, level, iskey, inblock) {
11293 state.dump = function() {
11294 if (string.length === 0) {
11295 return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
11297 if (!state.noCompatMode) {
11298 if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {
11299 return state.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string + '"' : "'" + string + "'";
11302 var indent = state.indent * Math.max(1, level);
11303 var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
11304 var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
11305 function testAmbiguity(string2) {
11306 return testImplicitResolving(state, string2);
11308 switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {
11312 return "'" + string.replace(/'/g, "''") + "'";
11313 case STYLE_LITERAL:
11314 return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent));
11316 return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
11318 return '"' + escapeString(string) + '"';
11320 throw new exception("impossible error: invalid scalar style");
11324 function blockHeader(string, indentPerLevel) {
11325 var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
11326 var clip = string[string.length - 1] === "\n";
11327 var keep = clip && (string[string.length - 2] === "\n" || string === "\n");
11328 var chomp = keep ? "+" : clip ? "" : "-";
11329 return indentIndicator + chomp + "\n";
11331 function dropEndingNewline(string) {
11332 return string[string.length - 1] === "\n" ? string.slice(0, -1) : string;
11334 function foldString(string, width) {
11335 var lineRe = /(\n+)([^\n]*)/g;
11336 var result = function() {
11337 var nextLF = string.indexOf("\n");
11338 nextLF = nextLF !== -1 ? nextLF : string.length;
11339 lineRe.lastIndex = nextLF;
11340 return foldLine(string.slice(0, nextLF), width);
11342 var prevMoreIndented = string[0] === "\n" || string[0] === " ";
11345 while (match = lineRe.exec(string)) {
11346 var prefix = match[1], line = match[2];
11347 moreIndented = line[0] === " ";
11348 result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
11349 prevMoreIndented = moreIndented;
11353 function foldLine(line, width) {
11354 if (line === "" || line[0] === " ")
11356 var breakRe = / [^ ]/g;
11358 var start = 0, end, curr = 0, next = 0;
11360 while (match = breakRe.exec(line)) {
11361 next = match.index;
11362 if (next - start > width) {
11363 end = curr > start ? curr : next;
11364 result += "\n" + line.slice(start, end);
11370 if (line.length - start > width && curr > start) {
11371 result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
11373 result += line.slice(start);
11375 return result.slice(1);
11377 function escapeString(string) {
11381 for (var i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
11382 char = codePointAt(string, i);
11383 escapeSeq = ESCAPE_SEQUENCES[char];
11384 if (!escapeSeq && isPrintable(char)) {
11385 result += string[i];
11387 result += string[i + 1];
11389 result += escapeSeq || encodeHex(char);
11394 function writeFlowSequence(state, level, object) {
11395 var _result = "", _tag = state.tag, index, length, value;
11396 for (index = 0, length = object.length; index < length; index += 1) {
11397 value = object[index];
11398 if (state.replacer) {
11399 value = state.replacer.call(object, String(index), value);
11401 if (writeNode(state, level, value, false, false) || typeof value === "undefined" && writeNode(state, level, null, false, false)) {
11402 if (_result !== "")
11403 _result += "," + (!state.condenseFlow ? " " : "");
11404 _result += state.dump;
11408 state.dump = "[" + _result + "]";
11410 function writeBlockSequence(state, level, object, compact) {
11411 var _result = "", _tag = state.tag, index, length, value;
11412 for (index = 0, length = object.length; index < length; index += 1) {
11413 value = object[index];
11414 if (state.replacer) {
11415 value = state.replacer.call(object, String(index), value);
11417 if (writeNode(state, level + 1, value, true, true, false, true) || typeof value === "undefined" && writeNode(state, level + 1, null, true, true, false, true)) {
11418 if (!compact || _result !== "") {
11419 _result += generateNextLine(state, level);
11421 if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
11426 _result += state.dump;
11430 state.dump = _result || "[]";
11432 function writeFlowMapping(state, level, object) {
11433 var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer;
11434 for (index = 0, length = objectKeyList.length; index < length; index += 1) {
11436 if (_result !== "")
11437 pairBuffer += ", ";
11438 if (state.condenseFlow)
11440 objectKey = objectKeyList[index];
11441 objectValue = object[objectKey];
11442 if (state.replacer) {
11443 objectValue = state.replacer.call(object, objectKey, objectValue);
11445 if (!writeNode(state, level, objectKey, false, false)) {
11448 if (state.dump.length > 1024)
11449 pairBuffer += "? ";
11450 pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " ");
11451 if (!writeNode(state, level, objectValue, false, false)) {
11454 pairBuffer += state.dump;
11455 _result += pairBuffer;
11458 state.dump = "{" + _result + "}";
11460 function writeBlockMapping(state, level, object, compact) {
11461 var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer;
11462 if (state.sortKeys === true) {
11463 objectKeyList.sort();
11464 } else if (typeof state.sortKeys === "function") {
11465 objectKeyList.sort(state.sortKeys);
11466 } else if (state.sortKeys) {
11467 throw new exception("sortKeys must be a boolean or a function");
11469 for (index = 0, length = objectKeyList.length; index < length; index += 1) {
11471 if (!compact || _result !== "") {
11472 pairBuffer += generateNextLine(state, level);
11474 objectKey = objectKeyList[index];
11475 objectValue = object[objectKey];
11476 if (state.replacer) {
11477 objectValue = state.replacer.call(object, objectKey, objectValue);
11479 if (!writeNode(state, level + 1, objectKey, true, true, true)) {
11482 explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024;
11483 if (explicitPair) {
11484 if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
11487 pairBuffer += "? ";
11490 pairBuffer += state.dump;
11491 if (explicitPair) {
11492 pairBuffer += generateNextLine(state, level);
11494 if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
11497 if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
11500 pairBuffer += ": ";
11502 pairBuffer += state.dump;
11503 _result += pairBuffer;
11506 state.dump = _result || "{}";
11508 function detectType(state, object, explicit) {
11509 var _result, typeList, index, length, type2, style;
11510 typeList = explicit ? state.explicitTypes : state.implicitTypes;
11511 for (index = 0, length = typeList.length; index < length; index += 1) {
11512 type2 = typeList[index];
11513 if ((type2.instanceOf || type2.predicate) && (!type2.instanceOf || typeof object === "object" && object instanceof type2.instanceOf) && (!type2.predicate || type2.predicate(object))) {
11515 if (type2.multi && type2.representName) {
11516 state.tag = type2.representName(object);
11518 state.tag = type2.tag;
11523 if (type2.represent) {
11524 style = state.styleMap[type2.tag] || type2.defaultStyle;
11525 if (_toString.call(type2.represent) === "[object Function]") {
11526 _result = type2.represent(object, style);
11527 } else if (_hasOwnProperty.call(type2.represent, style)) {
11528 _result = type2.represent[style](object, style);
11530 throw new exception("!<" + type2.tag + '> tag resolver accepts not "' + style + '" style');
11532 state.dump = _result;
11539 function writeNode(state, level, object, block, compact, iskey, isblockseq) {
11541 state.dump = object;
11542 if (!detectType(state, object, false)) {
11543 detectType(state, object, true);
11545 var type2 = _toString.call(state.dump);
11546 var inblock = block;
11549 block = state.flowLevel < 0 || state.flowLevel > level;
11551 var objectOrArray = type2 === "[object Object]" || type2 === "[object Array]", duplicateIndex, duplicate;
11552 if (objectOrArray) {
11553 duplicateIndex = state.duplicates.indexOf(object);
11554 duplicate = duplicateIndex !== -1;
11556 if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) {
11559 if (duplicate && state.usedDuplicates[duplicateIndex]) {
11560 state.dump = "*ref_" + duplicateIndex;
11562 if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
11563 state.usedDuplicates[duplicateIndex] = true;
11565 if (type2 === "[object Object]") {
11566 if (block && Object.keys(state.dump).length !== 0) {
11567 writeBlockMapping(state, level, state.dump, compact);
11569 state.dump = "&ref_" + duplicateIndex + state.dump;
11572 writeFlowMapping(state, level, state.dump);
11574 state.dump = "&ref_" + duplicateIndex + " " + state.dump;
11577 } else if (type2 === "[object Array]") {
11578 if (block && state.dump.length !== 0) {
11579 if (state.noArrayIndent && !isblockseq && level > 0) {
11580 writeBlockSequence(state, level - 1, state.dump, compact);
11582 writeBlockSequence(state, level, state.dump, compact);
11585 state.dump = "&ref_" + duplicateIndex + state.dump;
11588 writeFlowSequence(state, level, state.dump);
11590 state.dump = "&ref_" + duplicateIndex + " " + state.dump;
11593 } else if (type2 === "[object String]") {
11594 if (state.tag !== "?") {
11595 writeScalar(state, state.dump, level, iskey, inblock);
11597 } else if (type2 === "[object Undefined]") {
11600 if (state.skipInvalid)
11602 throw new exception("unacceptable kind of an object to dump " + type2);
11604 if (state.tag !== null && state.tag !== "?") {
11605 tagStr = encodeURI(state.tag[0] === "!" ? state.tag.slice(1) : state.tag).replace(/!/g, "%21");
11606 if (state.tag[0] === "!") {
11607 tagStr = "!" + tagStr;
11608 } else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") {
11609 tagStr = "!!" + tagStr.slice(18);
11611 tagStr = "!<" + tagStr + ">";
11613 state.dump = tagStr + " " + state.dump;
11618 function getDuplicateReferences(object, state) {
11619 var objects = [], duplicatesIndexes = [], index, length;
11620 inspectNode(object, objects, duplicatesIndexes);
11621 for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
11622 state.duplicates.push(objects[duplicatesIndexes[index]]);
11624 state.usedDuplicates = new Array(length);
11626 function inspectNode(object, objects, duplicatesIndexes) {
11627 var objectKeyList, index, length;
11628 if (object !== null && typeof object === "object") {
11629 index = objects.indexOf(object);
11630 if (index !== -1) {
11631 if (duplicatesIndexes.indexOf(index) === -1) {
11632 duplicatesIndexes.push(index);
11635 objects.push(object);
11636 if (Array.isArray(object)) {
11637 for (index = 0, length = object.length; index < length; index += 1) {
11638 inspectNode(object[index], objects, duplicatesIndexes);
11641 objectKeyList = Object.keys(object);
11642 for (index = 0, length = objectKeyList.length; index < length; index += 1) {
11643 inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
11649 function dump$1(input, options) {
11650 options = options || {};
11651 var state = new State(options);
11653 getDuplicateReferences(input, state);
11655 if (state.replacer) {
11656 value = state.replacer.call({ "": value }, "", value);
11658 if (writeNode(state, 0, value, true, true))
11659 return state.dump + "\n";
11662 var dump_1 = dump$1;
11666 function renamed(from, to) {
11667 return function() {
11668 throw new Error("Function yaml." + from + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default.");
11672 var Schema = schema;
11673 var FAILSAFE_SCHEMA = failsafe;
11674 var JSON_SCHEMA = json;
11675 var CORE_SCHEMA = core;
11676 var DEFAULT_SCHEMA = _default;
11677 var load = loader.load;
11678 var loadAll = loader.loadAll;
11679 var dump = dumper.dump;
11680 var YAMLException = exception;
11696 var safeLoad = renamed("safeLoad", "load");
11697 var safeLoadAll = renamed("safeLoadAll", "loadAll");
11698 var safeDump = renamed("safeDump", "dump");
11715 var js_yaml_default = jsYaml;
11718 var import_markdownlint = __toModule(require_markdownlint());
11719 var import_markdownlint_rule_helpers = __toModule(require_helpers3());
11720 var import_path = __toModule(require("path"));
11721 var import_rc = __toModule(require_rc());
11722 var projectConfigFiles = [".markdownlint.json", ".markdownlint.yaml", ".markdownlint.yml"];
11723 var configFileParsers = [JSON.parse, js_yaml_default.load];
11724 var MarkdownlintEngine = class {
11726 this.fixAllCommandName = "markdownlint.fixAll";
11727 this.source = "markdownlint";
11728 this.outputChannel = import_coc.window.createOutputChannel(this.source);
11729 this.diagnosticCollection = import_coc.languages.createDiagnosticCollection(this.source);
11732 outputLine(message) {
11733 if (this.outputChannel) {
11734 this.outputChannel.appendLine(`[${new Date().toLocaleTimeString()}] ${message}`);
11737 async parseConfig() {
11739 this.config = (0, import_rc.default)(this.source, {});
11740 this.outputLine(`Info: global config: ${JSON.stringify((0, import_rc.default)(this.source, {}))}`);
11742 this.outputLine(`Error: global config parse failed: ${e}`);
11745 for (const projectConfigFile of projectConfigFiles) {
11746 const fullPath = import_path.default.join(import_coc.workspace.root, projectConfigFile);
11747 if (import_fs.default.existsSync(fullPath)) {
11748 const projectConfig = (0, import_markdownlint.readConfigSync)(fullPath, configFileParsers);
11749 this.config = (0, import_deep_extend.default)(this.config, projectConfig);
11750 this.outputLine(`Info: local config: ${fullPath}, ${JSON.stringify(projectConfig)}`);
11755 this.outputLine(`Error: local config parse failed: ${e}`);
11757 const cocConfig = import_coc.workspace.getConfiguration("markdownlint").get("config");
11759 this.config = (0, import_deep_extend.default)(this.config, cocConfig);
11760 this.outputLine(`Info: config from coc-settings.json: ${JSON.stringify(cocConfig)}`);
11762 this.outputLine(`Info: full config: ${JSON.stringify(this.config)}`);
11764 markdownlintWrapper(document) {
11767 config: this.config,
11769 [document.uri]: document.getText()
11774 results = (0, import_markdownlint.sync)(options)[document.uri];
11776 this.outputLine(`Error: lint exception: ${e}`);
11778 return results || [];
11780 async provideCodeActions(document, range, context) {
11781 const doc = import_coc.workspace.getDocument(document.uri);
11782 const wholeRange = import_coc.Range.create(0, 0, doc.lineCount, 0);
11784 if (range.start.line === wholeRange.start.line && range.start.character === wholeRange.start.character && range.end.line === wholeRange.end.line && range.end.character === wholeRange.end.character) {
11787 const codeActions = [];
11788 const fixInfoDiagnostics = [];
11789 for (const diagnostic of context.diagnostics) {
11790 if (diagnostic.fixInfo) {
11791 const lineNumber = diagnostic.fixInfo.lineNumber - 1 || diagnostic.range.start.line;
11792 const line = await import_coc.workspace.getLine(document.uri, lineNumber);
11793 const newText = (0, import_markdownlint_rule_helpers.applyFix)(line, diagnostic.fixInfo, "\n");
11794 const edit = { changes: {} };
11795 if (typeof newText === "string") {
11796 const range2 = import_coc.Range.create(lineNumber, 0, lineNumber, line.length);
11797 edit.changes[document.uri] = [import_coc.TextEdit.replace(range2, newText)];
11799 edit.changes[document.uri] = [import_coc.TextEdit.del(diagnostic.range)];
11801 const title = `Fix: ${diagnostic.message.split(":")[0]}`;
11805 diagnostics: [...context.diagnostics]
11807 fixInfoDiagnostics.push(diagnostic);
11809 codeActions.push(action);
11813 if (range.start.line === range.end.line && range.start.character === 0) {
11814 const edit = import_coc.TextEdit.insert(import_coc.Position.create(range.start.line, 0), "<!-- markdownlint-disable-next-line -->\n");
11816 title: "Disable markdownlint for current line",
11825 const edit = import_coc.TextEdit.insert(import_coc.Position.create(0, 0), "<!-- markdownlint-disable-file -->\n");
11827 title: "Disable markdownlint for current file",
11835 if (fixInfoDiagnostics.length) {
11836 const title = "Fix All error found by markdownlint";
11837 const sourceFixAllAction = {
11839 kind: import_coc.CodeActionKind.SourceFixAll,
11840 diagnostics: fixInfoDiagnostics,
11843 command: this.fixAllCommandName
11846 codeActions.push(sourceFixAllAction);
11848 return codeActions;
11851 if (document.languageId !== "markdown") {
11854 this.diagnosticCollection.set(document.uri);
11855 const results = this.markdownlintWrapper(document);
11856 if (!results.length) {
11859 const diagnostics = [];
11860 results.forEach((result) => {
11861 const ruleDescription = result.ruleDescription;
11862 let message = result.ruleNames.join("/") + ": " + ruleDescription;
11863 if (result.errorDetail) {
11864 message += " [" + result.errorDetail + "]";
11866 const start = import_coc.Position.create(result.lineNumber - 1, 0);
11867 const end = import_coc.Position.create(result.lineNumber - 1, 0);
11868 if (result.errorRange) {
11869 start.character = result.errorRange[0] - 1;
11870 end.character = start.character + result.errorRange[1];
11872 const range = import_coc.Range.create(start, end);
11873 const diagnostic = import_coc.Diagnostic.create(range, message);
11874 diagnostic.severity = import_coc.DiagnosticSeverity.Warning;
11875 diagnostic.source = this.source;
11876 diagnostic.fixInfo = result.fixInfo;
11877 diagnostics.push(diagnostic);
11879 this.diagnosticCollection.set(document.uri, diagnostics);
11881 async fixAll(document) {
11882 const results = this.markdownlintWrapper(document);
11883 if (!results.length) {
11886 const text = document.getText();
11887 const fixedText = (0, import_markdownlint_rule_helpers.applyFixes)(text, results);
11888 if (text != fixedText) {
11889 const doc = import_coc.workspace.getDocument(document.uri);
11890 const end = import_coc.Position.create(doc.lineCount - 1, doc.getline(doc.lineCount - 1).length);
11893 [document.uri]: [import_coc.TextEdit.replace(import_coc.Range.create(import_coc.Position.create(0, 0), end), fixedText)]
11896 await import_coc.workspace.applyEdit(edit);
11902 var documentSelector = [
11904 language: "markdown",
11908 language: "markdown",
11912 var documentVersion = 0;
11913 var engine = new MarkdownlintEngine();
11914 var config = import_coc2.workspace.getConfiguration("markdownlint");
11915 function didOpenTextDocument(document) {
11916 if (config.get("onOpen", true)) {
11917 engine.lint(document);
11920 async function didChangeTextDocument(params) {
11921 if (!config.get("onChange", true)) {
11924 if (params.textDocument.version && documentVersion !== params.textDocument.version) {
11925 documentVersion = params.textDocument.version;
11926 const { document } = await import_coc2.workspace.getCurrentState();
11927 engine.lint(document);
11930 async function didSaveTextDocument(document) {
11931 if (config.get("onSave", true)) {
11932 engine.lint(document);
11935 async function activate(context) {
11936 await engine.parseConfig();
11937 context.subscriptions.push(import_coc2.languages.registerCodeActionProvider(documentSelector, engine, "markdownlint"), import_coc2.commands.registerCommand(engine.fixAllCommandName, async () => {
11938 const { document } = await import_coc2.workspace.getCurrentState();
11939 engine.fixAll(document);
11940 }), import_coc2.workspace.onDidOpenTextDocument(didOpenTextDocument), import_coc2.workspace.onDidChangeTextDocument(didChangeTextDocument), import_coc2.workspace.onDidSaveTextDocument(didSaveTextDocument));
11941 import_coc2.workspace.documents.map((doc) => {
11942 didOpenTextDocument(doc.textDocument);
11945 // Annotate the CommonJS export names for ESM import in node:
11946 0 && (module.exports = {
11950 * @description Recursive object extending
11951 * @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
11954 * The MIT License (MIT)
11956 * Copyright (c) 2013-2018 Viacheslav Lotsmanov
11958 * Permission is hereby granted, free of charge, to any person obtaining a copy of
11959 * this software and associated documentation files (the "Software"), to deal in
11960 * the Software without restriction, including without limitation the rights to
11961 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11962 * the Software, and to permit persons to whom the Software is furnished to do so,
11963 * subject to the following conditions:
11965 * The above copyright notice and this permission notice shall be included in all
11966 * copies or substantial portions of the Software.
11968 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11969 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
11970 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
11971 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
11972 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
11973 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11975 /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */