PluginProbe
Gutenberg / 24.1.0
Gutenberg v24.1.0
24.1.0 24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 All 404 releases
← All changes | build/scripts/blocks/index.js +1124 -1053 23.9.0 → 24.1.0 View file →
@@ -574,56 +574,56 @@
574 574 // node_modules/fast-deep-equal/es6/index.js
575 575 var require_es6 = __commonJS({
576 576 "node_modules/fast-deep-equal/es6/index.js"(exports, module) {
577 577 "use strict";
578 - module.exports = function equal(a2, b3) {
579 - if (a2 === b3) return true;
580 - if (a2 && b3 && typeof a2 == "object" && typeof b3 == "object") {
581 - if (a2.constructor !== b3.constructor) return false;
582 - var length, i2, keys;
583 - if (Array.isArray(a2)) {
584 - length = a2.length;
585 - if (length != b3.length) return false;
586 - for (i2 = length; i2-- !== 0; )
587 - if (!equal(a2[i2], b3[i2])) return false;
578 + module.exports = function equal(a, b2) {
579 + if (a === b2) return true;
580 + if (a && b2 && typeof a == "object" && typeof b2 == "object") {
581 + if (a.constructor !== b2.constructor) return false;
582 + var length, i, keys;
583 + if (Array.isArray(a)) {
584 + length = a.length;
585 + if (length != b2.length) return false;
586 + for (i = length; i-- !== 0; )
587 + if (!equal(a[i], b2[i])) return false;
588 588 return true;
589 589 }
590 - if (a2 instanceof Map && b3 instanceof Map) {
591 - if (a2.size !== b3.size) return false;
592 - for (i2 of a2.entries())
593 - if (!b3.has(i2[0])) return false;
594 - for (i2 of a2.entries())
595 - if (!equal(i2[1], b3.get(i2[0]))) return false;
590 + if (a instanceof Map && b2 instanceof Map) {
591 + if (a.size !== b2.size) return false;
592 + for (i of a.entries())
593 + if (!b2.has(i[0])) return false;
594 + for (i of a.entries())
595 + if (!equal(i[1], b2.get(i[0]))) return false;
596 596 return true;
597 597 }
598 - if (a2 instanceof Set && b3 instanceof Set) {
599 - if (a2.size !== b3.size) return false;
600 - for (i2 of a2.entries())
601 - if (!b3.has(i2[0])) return false;
598 + if (a instanceof Set && b2 instanceof Set) {
599 + if (a.size !== b2.size) return false;
600 + for (i of a.entries())
601 + if (!b2.has(i[0])) return false;
602 602 return true;
603 603 }
604 - if (ArrayBuffer.isView(a2) && ArrayBuffer.isView(b3)) {
605 - length = a2.length;
606 - if (length != b3.length) return false;
607 - for (i2 = length; i2-- !== 0; )
608 - if (a2[i2] !== b3[i2]) return false;
604 + if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b2)) {
605 + length = a.length;
606 + if (length != b2.length) return false;
607 + for (i = length; i-- !== 0; )
608 + if (a[i] !== b2[i]) return false;
609 609 return true;
610 610 }
611 - if (a2.constructor === RegExp) return a2.source === b3.source && a2.flags === b3.flags;
612 - if (a2.valueOf !== Object.prototype.valueOf) return a2.valueOf() === b3.valueOf();
613 - if (a2.toString !== Object.prototype.toString) return a2.toString() === b3.toString();
614 - keys = Object.keys(a2);
611 + if (a.constructor === RegExp) return a.source === b2.source && a.flags === b2.flags;
612 + if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b2.valueOf();
613 + if (a.toString !== Object.prototype.toString) return a.toString() === b2.toString();
614 + keys = Object.keys(a);
615 615 length = keys.length;
616 - if (length !== Object.keys(b3).length) return false;
617 - for (i2 = length; i2-- !== 0; )
618 - if (!Object.prototype.hasOwnProperty.call(b3, keys[i2])) return false;
619 - for (i2 = length; i2-- !== 0; ) {
620 - var key = keys[i2];
621 - if (!equal(a2[key], b3[key])) return false;
616 + if (length !== Object.keys(b2).length) return false;
617 + for (i = length; i-- !== 0; )
618 + if (!Object.prototype.hasOwnProperty.call(b2, keys[i])) return false;
619 + for (i = length; i-- !== 0; ) {
620 + var key = keys[i];
621 + if (!equal(a[key], b2[key])) return false;
622 622 }
623 623 return true;
624 624 }
625 - return a2 !== a2 && b3 !== b3;
625 + return a !== a && b2 !== b2;
626 626 };
627 627 }
628 628 });
629 629
@@ -967,14 +967,14 @@
967 967 var import_data5 = __toESM(require_data(), 1);
968 968
969 969 // node_modules/tslib/tslib.es6.mjs
970 970 var __assign = function() {
971 - __assign = Object.assign || function __assign2(t3) {
972 - for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) {
973 - s2 = arguments[i2];
974 - for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t3[p2] = s2[p2];
971 + __assign = Object.assign || function __assign2(t2) {
972 + for (var s, i = 1, n = arguments.length; i < n; i++) {
973 + s = arguments[i];
974 + for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2)) t2[p2] = s[p2];
975 975 }
976 - return t3;
976 + return t2;
977 977 };
978 978 return __assign.apply(this, arguments);
979 979 };
980 980
@@ -999,13 +999,13 @@
999 999 while (result.charAt(end - 1) === "\0")
1000 1000 end--;
1001 1001 return result.slice(start, end).split("\0").map(transform).join(delimiter);
1002 1002 }
1003 - function replace(input, re2, value) {
1004 - if (re2 instanceof RegExp)
1005 - return input.replace(re2, value);
1006 - return re2.reduce(function(input2, re3) {
1007 - return input2.replace(re3, value);
1003 + function replace(input, re, value) {
1004 + if (re instanceof RegExp)
1005 + return input.replace(re, value);
1006 + return re.reduce(function(input2, re2) {
1007 + return input2.replace(re2, value);
1008 1008 }, input);
1009 1009 }
1010 1010
1011 1011 // node_modules/pascal-case/dist.es2015/index.js
@@ -1041,217 +1041,230 @@
1041 1041 var import_data2 = __toESM(require_data(), 1);
1042 1042 var import_i18n3 = __toESM(require_i18n(), 1);
1043 1043
1044 1044 // node_modules/colord/index.mjs
1045 - var r = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) };
1046 - var t = function(r2) {
1047 - return "string" == typeof r2 ? r2.length > 0 : "number" == typeof r2;
1045 + for (r2 = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, t2 = function(r3) {
1046 + return "string" == typeof r3 ? r3.length > 0 : "number" == typeof r3;
1047 + }, n = function(r3, t3, n2) {
1048 + return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = Math.pow(10, t3)), Math.round(n2 * r3) / n2 + 0;
1049 + }, u = function(r3, t3, n2) {
1050 + return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = 1), r3 > n2 ? n2 : r3 > t3 ? r3 : t3;
1051 + }, e2 = function(r3) {
1052 + return (r3 = isFinite(r3) ? r3 % 360 : 0) < 0 ? r3 + 360 : r3;
1053 + }, o2 = function(r3, t3) {
1054 + return void 0 === t3 && (t3 = 0), n(r3, t3) % 360;
1055 + }, a = function(r3) {
1056 + return { r: u(r3.r, 0, 255), g: u(r3.g, 0, 255), b: u(r3.b, 0, 255), a: u(r3.a) };
1057 + }, i = function(r3) {
1058 + return { r: n(r3.r), g: n(r3.g), b: n(r3.b), a: n(r3.a, 3) };
1059 + }, s = /^#([0-9a-f]{3,8})$/i, d2 = function(r3, t3) {
1060 + var n2 = r3.charCodeAt(t3);
1061 + return (15 & n2) + 9 * (n2 >> 6);
1062 + }, h = function(r3, t3) {
1063 + return d2(r3, t3) << 4 | d2(r3, t3 + 1);
1064 + }, b2 = [], f2 = 0; f2 < 256; f2++) b2.push((f2 < 16 ? "0" : "") + f2.toString(16));
1065 + var r2;
1066 + var t2;
1067 + var n;
1068 + var u;
1069 + var e2;
1070 + var o2;
1071 + var a;
1072 + var i;
1073 + var s;
1074 + var d2;
1075 + var h;
1076 + var b2;
1077 + var f2;
1078 + var g = function(r2) {
1079 + return b2[u(r2, 0, 255)];
1048 1080 };
1049 - var n = function(r2, t3, n2) {
1050 - return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = Math.pow(10, t3)), Math.round(n2 * r2) / n2 + 0;
1081 + var c = function(r2) {
1082 + var t2 = r2.r, n = r2.g, u = r2.b, e2 = r2.a, o2 = Math.max(t2, n, u), a = o2 - Math.min(t2, n, u), i = a ? o2 === t2 ? (n - u) / a : o2 === n ? 2 + (u - t2) / a : 4 + (t2 - n) / a : 0;
1083 + return { h: 60 * (i < 0 ? i + 6 : i), s: o2 ? a / o2 * 100 : 0, v: o2 / 255 * 100, a: e2 };
1051 1084 };
1052 - var e = function(r2, t3, n2) {
1053 - return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = 1), r2 > n2 ? n2 : r2 > t3 ? r2 : t3;
1085 + var v = function(r2) {
1086 + var t2 = r2.h, n = r2.s, u = r2.v, e2 = r2.a;
1087 + t2 = t2 / 360 * 6, n /= 100, u /= 100;
1088 + var o2 = Math.floor(t2), a = u * (1 - n), i = u * (1 - (t2 - o2) * n), s = u * (1 - (1 - t2 + o2) * n), d2 = o2 % 6;
1089 + return { r: 255 * [u, i, a, a, s, u][d2], g: 255 * [s, u, u, i, a, a][d2], b: 255 * [a, a, s, u, u, i][d2], a: e2 };
1054 1090 };
1055 - var u = function(r2) {
1056 - return (r2 = isFinite(r2) ? r2 % 360 : 0) > 0 ? r2 : r2 + 360;
1091 + var l = function(r2) {
1092 + return { h: e2(r2.h), s: u(r2.s, 0, 100), l: u(r2.l, 0, 100), a: u(r2.a) };
1057 1093 };
1058 - var a = function(r2) {
1059 - return { r: e(r2.r, 0, 255), g: e(r2.g, 0, 255), b: e(r2.b, 0, 255), a: e(r2.a) };
1094 + var p = function(r2) {
1095 + return { h: o2(r2.h), s: n(r2.s), l: n(r2.l), a: n(r2.a, 3) };
1060 1096 };
1061 - var o = function(r2) {
1062 - return { r: n(r2.r), g: n(r2.g), b: n(r2.b), a: n(r2.a, 3) };
1097 + var m = function(r2) {
1098 + return v((n = (t2 = r2).s, { h: t2.h, s: (n *= ((u = t2.l) < 50 ? u : 100 - u) / 100) > 0 ? 2 * n / (u + n) * 100 : 0, v: u + n, a: t2.a }));
1099 + var t2, n, u;
1063 1100 };
1064 - var i = /^#([0-9a-f]{3,8})$/i;
1065 - var s = function(r2) {
1066 - var t3 = r2.toString(16);
1067 - return t3.length < 2 ? "0" + t3 : t3;
1101 + var y = function(r2) {
1102 + return { h: (t2 = c(r2)).h, s: (e2 = (200 - (n = t2.s)) * (u = t2.v) / 100) > 0 && e2 < 200 ? n * u / 100 / (e2 <= 100 ? e2 : 200 - e2) * 100 : 0, l: e2 / 2, a: t2.a };
1103 + var t2, n, u, e2;
1068 1104 };
1069 - var h = function(r2) {
1070 - var t3 = r2.r, n2 = r2.g, e2 = r2.b, u2 = r2.a, a2 = Math.max(t3, n2, e2), o3 = a2 - Math.min(t3, n2, e2), i2 = o3 ? a2 === t3 ? (n2 - e2) / o3 : a2 === n2 ? 2 + (e2 - t3) / o3 : 4 + (t3 - n2) / o3 : 0;
1071 - return { h: 60 * (i2 < 0 ? i2 + 6 : i2), s: a2 ? o3 / a2 * 100 : 0, v: a2 / 255 * 100, a: u2 };
1072 - };
1073 - var b = function(r2) {
1074 - var t3 = r2.h, n2 = r2.s, e2 = r2.v, u2 = r2.a;
1075 - t3 = t3 / 360 * 6, n2 /= 100, e2 /= 100;
1076 - var a2 = Math.floor(t3), o3 = e2 * (1 - n2), i2 = e2 * (1 - (t3 - a2) * n2), s2 = e2 * (1 - (1 - t3 + a2) * n2), h2 = a2 % 6;
1077 - return { r: 255 * [e2, i2, o3, o3, s2, e2][h2], g: 255 * [s2, e2, e2, i2, o3, o3][h2], b: 255 * [o3, o3, s2, e2, e2, i2][h2], a: u2 };
1078 - };
1079 - var g = function(r2) {
1080 - return { h: u(r2.h), s: e(r2.s, 0, 100), l: e(r2.l, 0, 100), a: e(r2.a) };
1081 - };
1082 - var d = function(r2) {
1083 - return { h: n(r2.h), s: n(r2.s), l: n(r2.l), a: n(r2.a, 3) };
1084 - };
1085 - var f = function(r2) {
1086 - return b((n2 = (t3 = r2).s, { h: t3.h, s: (n2 *= ((e2 = t3.l) < 50 ? e2 : 100 - e2) / 100) > 0 ? 2 * n2 / (e2 + n2) * 100 : 0, v: e2 + n2, a: t3.a }));
1087 - var t3, n2, e2;
1088 - };
1089 - var c = function(r2) {
1090 - return { h: (t3 = h(r2)).h, s: (u2 = (200 - (n2 = t3.s)) * (e2 = t3.v) / 100) > 0 && u2 < 200 ? n2 * e2 / 100 / (u2 <= 100 ? u2 : 200 - u2) * 100 : 0, l: u2 / 2, a: t3.a };
1091 - var t3, n2, e2, u2;
1092 - };
1093 - var l = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
1094 - var p = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
1095 - var v = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
1096 - var m = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
1097 - var y = { string: [[function(r2) {
1098 - var t3 = i.exec(r2);
1099 - return t3 ? (r2 = t3[1]).length <= 4 ? { r: parseInt(r2[0] + r2[0], 16), g: parseInt(r2[1] + r2[1], 16), b: parseInt(r2[2] + r2[2], 16), a: 4 === r2.length ? n(parseInt(r2[3] + r2[3], 16) / 255, 2) : 1 } : 6 === r2.length || 8 === r2.length ? { r: parseInt(r2.substr(0, 2), 16), g: parseInt(r2.substr(2, 2), 16), b: parseInt(r2.substr(4, 2), 16), a: 8 === r2.length ? n(parseInt(r2.substr(6, 2), 16) / 255, 2) : 1 } : null : null;
1105 + var N = /^hsla?\(\s*([+-]?(?:\d*\.\d+|\d+))(deg|rad|grad|turn)?\s*,\s*([+-]?(?:\d*\.\d+|\d+))%\s*,\s*([+-]?(?:\d*\.\d+|\d+))%\s*(?:,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i;
1106 + var x = /^hsla?\(\s*([+-]?(?:\d*\.\d+|\d+))(deg|rad|grad|turn)?\s+([+-]?(?:\d*\.\d+|\d+))%\s+([+-]?(?:\d*\.\d+|\d+))%\s*(?:\/\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i;
1107 + var M = /^rgba?\(\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*(?:,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i;
1108 + var H = /^rgba?\(\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s+([+-]?(?:\d*\.\d+|\d+))(%)?\s+([+-]?(?:\d*\.\d+|\d+))(%)?\s*(?:\/\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i;
1109 + var $ = { string: [[function(r2) {
1110 + if (!s.test(r2)) return null;
1111 + var t2 = r2.length;
1112 + return t2 <= 5 ? { r: 17 * d2(r2, 1), g: 17 * d2(r2, 2), b: 17 * d2(r2, 3), a: 5 === t2 ? n(17 * d2(r2, 4) / 255, 2) : 1 } : 7 === t2 || 9 === t2 ? { r: h(r2, 1), g: h(r2, 3), b: h(r2, 5), a: 9 === t2 ? n(h(r2, 7) / 255, 2) : 1 } : null;
1100 1113 }, "hex"], [function(r2) {
1101 - var t3 = v.exec(r2) || m.exec(r2);
1102 - return t3 ? t3[2] !== t3[4] || t3[4] !== t3[6] ? null : a({ r: Number(t3[1]) / (t3[2] ? 100 / 255 : 1), g: Number(t3[3]) / (t3[4] ? 100 / 255 : 1), b: Number(t3[5]) / (t3[6] ? 100 / 255 : 1), a: void 0 === t3[7] ? 1 : Number(t3[7]) / (t3[8] ? 100 : 1) }) : null;
1103 - }, "rgb"], [function(t3) {
1104 - var n2 = l.exec(t3) || p.exec(t3);
1105 - if (!n2) return null;
1106 - var e2, u2, a2 = g({ h: (e2 = n2[1], u2 = n2[2], void 0 === u2 && (u2 = "deg"), Number(e2) * (r[u2] || 1)), s: Number(n2[3]), l: Number(n2[4]), a: void 0 === n2[5] ? 1 : Number(n2[5]) / (n2[6] ? 100 : 1) });
1107 - return f(a2);
1114 + var t2 = M.exec(r2) || H.exec(r2);
1115 + return t2 ? t2[2] !== t2[4] || t2[4] !== t2[6] ? null : a({ r: Number(t2[1]) / (t2[2] ? 100 / 255 : 1), g: Number(t2[3]) / (t2[4] ? 100 / 255 : 1), b: Number(t2[5]) / (t2[6] ? 100 / 255 : 1), a: void 0 === t2[7] ? 1 : Number(t2[7]) / (t2[8] ? 100 : 1) }) : null;
1116 + }, "rgb"], [function(t2) {
1117 + var n = N.exec(t2) || x.exec(t2);
1118 + if (!n) return null;
1119 + var u, e2, o2 = l({ h: (u = n[1], e2 = n[2], void 0 === e2 && (e2 = "deg"), Number(u) * (r2[e2] || 1)), s: Number(n[3]), l: Number(n[4]), a: void 0 === n[5] ? 1 : Number(n[5]) / (n[6] ? 100 : 1) });
1120 + return m(o2);
1108 1121 }, "hsl"]], object: [[function(r2) {
1109 - var n2 = r2.r, e2 = r2.g, u2 = r2.b, o3 = r2.a, i2 = void 0 === o3 ? 1 : o3;
1110 - return t(n2) && t(e2) && t(u2) ? a({ r: Number(n2), g: Number(e2), b: Number(u2), a: Number(i2) }) : null;
1122 + var n = r2.r, u = r2.g, e2 = r2.b, o2 = r2.a, i = void 0 === o2 ? 1 : o2;
1123 + return t2(n) && t2(u) && t2(e2) ? a({ r: Number(n), g: Number(u), b: Number(e2), a: Number(i) }) : null;
1111 1124 }, "rgb"], [function(r2) {
1112 - var n2 = r2.h, e2 = r2.s, u2 = r2.l, a2 = r2.a, o3 = void 0 === a2 ? 1 : a2;
1113 - if (!t(n2) || !t(e2) || !t(u2)) return null;
1114 - var i2 = g({ h: Number(n2), s: Number(e2), l: Number(u2), a: Number(o3) });
1115 - return f(i2);
1125 + var n = r2.h, u = r2.s, e2 = r2.l, o2 = r2.a, a = void 0 === o2 ? 1 : o2;
1126 + if (!t2(n) || !t2(u) || !t2(e2)) return null;
1127 + var i = l({ h: Number(n), s: Number(u), l: Number(e2), a: Number(a) });
1128 + return m(i);
1116 1129 }, "hsl"], [function(r2) {
1117 - var n2 = r2.h, a2 = r2.s, o3 = r2.v, i2 = r2.a, s2 = void 0 === i2 ? 1 : i2;
1118 - if (!t(n2) || !t(a2) || !t(o3)) return null;
1119 - var h2 = (function(r3) {
1120 - return { h: u(r3.h), s: e(r3.s, 0, 100), v: e(r3.v, 0, 100), a: e(r3.a) };
1121 - })({ h: Number(n2), s: Number(a2), v: Number(o3), a: Number(s2) });
1122 - return b(h2);
1130 + var n = r2.h, o2 = r2.s, a = r2.v, i = r2.a, s = void 0 === i ? 1 : i;
1131 + if (!t2(n) || !t2(o2) || !t2(a)) return null;
1132 + var d2 = (function(r3) {
1133 + return { h: e2(r3.h), s: u(r3.s, 0, 100), v: u(r3.v, 0, 100), a: u(r3.a) };
1134 + })({ h: Number(n), s: Number(o2), v: Number(a), a: Number(s) });
1135 + return v(d2);
1123 1136 }, "hsv"]] };
1124 - var N = function(r2, t3) {
1125 - for (var n2 = 0; n2 < t3.length; n2++) {
1126 - var e2 = t3[n2][0](r2);
1127 - if (e2) return [e2, t3[n2][1]];
1137 + var j = function(r2, t2) {
1138 + for (var n = 0; n < t2.length; n++) {
1139 + var u = t2[n][0](r2);
1140 + if (u) return [u, t2[n][1]];
1128 1141 }
1129 1142 return [null, void 0];
1130 1143 };
1131 - var x = function(r2) {
1132 - return "string" == typeof r2 ? N(r2.trim(), y.string) : "object" == typeof r2 && null !== r2 ? N(r2, y.object) : [null, void 0];
1144 + var w = function(r2) {
1145 + return "string" == typeof r2 ? j(r2.trim(), $.string) : "object" == typeof r2 && null !== r2 ? j(r2, $.object) : [null, void 0];
1133 1146 };
1134 - var M = function(r2, t3) {
1135 - var n2 = c(r2);
1136 - return { h: n2.h, s: e(n2.s + 100 * t3, 0, 100), l: n2.l, a: n2.a };
1147 + var k = function(r2, t2) {
1148 + var n = y(r2);
1149 + return { h: n.h, s: u(n.s + 100 * t2, 0, 100), l: n.l, a: n.a };
1137 1150 };
1138 - var H = function(r2) {
1151 + var E = function(r2) {
1139 1152 return (299 * r2.r + 587 * r2.g + 114 * r2.b) / 1e3 / 255;
1140 1153 };
1141 - var $ = function(r2, t3) {
1142 - var n2 = c(r2);
1143 - return { h: n2.h, s: n2.s, l: e(n2.l + 100 * t3, 0, 100), a: n2.a };
1154 + var R = function(r2, t2) {
1155 + var n = y(r2);
1156 + return { h: n.h, s: n.s, l: u(n.l + 100 * t2, 0, 100), a: n.a };
1144 1157 };
1145 - var j = (function() {
1158 + var q = (function() {
1146 1159 function r2(r3) {
1147 - this.parsed = x(r3)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 };
1160 + this.parsed = w(r3)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 };
1148 1161 }
1149 1162 return r2.prototype.isValid = function() {
1150 1163 return null !== this.parsed;
1151 1164 }, r2.prototype.brightness = function() {
1152 - return n(H(this.rgba), 2);
1165 + return n(E(this.rgba), 2);
1153 1166 }, r2.prototype.isDark = function() {
1154 - return H(this.rgba) < 0.5;
1167 + return E(this.rgba) < 0.5;
1155 1168 }, r2.prototype.isLight = function() {
1156 - return H(this.rgba) >= 0.5;
1169 + return E(this.rgba) >= 0.5;
1157 1170 }, r2.prototype.toHex = function() {
1158 - return r3 = o(this.rgba), t3 = r3.r, e2 = r3.g, u2 = r3.b, i2 = (a2 = r3.a) < 1 ? s(n(255 * a2)) : "", "#" + s(t3) + s(e2) + s(u2) + i2;
1159 - var r3, t3, e2, u2, a2, i2;
1171 + return r3 = i(this.rgba), t2 = r3.r, u = r3.g, e2 = r3.b, a = (o2 = r3.a) < 1 ? g(n(255 * o2)) : "", "#" + g(t2) + g(u) + g(e2) + a;
1172 + var r3, t2, u, e2, o2, a;
1160 1173 }, r2.prototype.toRgb = function() {
1161 - return o(this.rgba);
1174 + return i(this.rgba);
1162 1175 }, r2.prototype.toRgbString = function() {
1163 - return r3 = o(this.rgba), t3 = r3.r, n2 = r3.g, e2 = r3.b, (u2 = r3.a) < 1 ? "rgba(" + t3 + ", " + n2 + ", " + e2 + ", " + u2 + ")" : "rgb(" + t3 + ", " + n2 + ", " + e2 + ")";
1164 - var r3, t3, n2, e2, u2;
1176 + return r3 = i(this.rgba), t2 = r3.r, n = r3.g, u = r3.b, (e2 = r3.a) < 1 ? "rgba(" + t2 + ", " + n + ", " + u + ", " + e2 + ")" : "rgb(" + t2 + ", " + n + ", " + u + ")";
1177 + var r3, t2, n, u, e2;
1165 1178 }, r2.prototype.toHsl = function() {
1166 - return d(c(this.rgba));
1179 + return p(y(this.rgba));
1167 1180 }, r2.prototype.toHslString = function() {
1168 - return r3 = d(c(this.rgba)), t3 = r3.h, n2 = r3.s, e2 = r3.l, (u2 = r3.a) < 1 ? "hsla(" + t3 + ", " + n2 + "%, " + e2 + "%, " + u2 + ")" : "hsl(" + t3 + ", " + n2 + "%, " + e2 + "%)";
1169 - var r3, t3, n2, e2, u2;
1181 + return r3 = p(y(this.rgba)), t2 = r3.h, n = r3.s, u = r3.l, (e2 = r3.a) < 1 ? "hsla(" + t2 + ", " + n + "%, " + u + "%, " + e2 + ")" : "hsl(" + t2 + ", " + n + "%, " + u + "%)";
1182 + var r3, t2, n, u, e2;
1170 1183 }, r2.prototype.toHsv = function() {
1171 - return r3 = h(this.rgba), { h: n(r3.h), s: n(r3.s), v: n(r3.v), a: n(r3.a, 3) };
1184 + return r3 = c(this.rgba), { h: o2(r3.h), s: n(r3.s), v: n(r3.v), a: n(r3.a, 3) };
1172 1185 var r3;
1173 1186 }, r2.prototype.invert = function() {
1174 - return w({ r: 255 - (r3 = this.rgba).r, g: 255 - r3.g, b: 255 - r3.b, a: r3.a });
1187 + return A({ r: 255 - (r3 = this.rgba).r, g: 255 - r3.g, b: 255 - r3.b, a: r3.a });
1175 1188 var r3;
1176 1189 }, r2.prototype.saturate = function(r3) {
1177 - return void 0 === r3 && (r3 = 0.1), w(M(this.rgba, r3));
1190 + return void 0 === r3 && (r3 = 0.1), A(k(this.rgba, r3));
1178 1191 }, r2.prototype.desaturate = function(r3) {
1179 - return void 0 === r3 && (r3 = 0.1), w(M(this.rgba, -r3));
1192 + return void 0 === r3 && (r3 = 0.1), A(k(this.rgba, -r3));
1180 1193 }, r2.prototype.grayscale = function() {
1181 - return w(M(this.rgba, -1));
1194 + return A(k(this.rgba, -1));
1182 1195 }, r2.prototype.lighten = function(r3) {
1183 - return void 0 === r3 && (r3 = 0.1), w($(this.rgba, r3));
1196 + return void 0 === r3 && (r3 = 0.1), A(R(this.rgba, r3));
1184 1197 }, r2.prototype.darken = function(r3) {
1185 - return void 0 === r3 && (r3 = 0.1), w($(this.rgba, -r3));
1198 + return void 0 === r3 && (r3 = 0.1), A(R(this.rgba, -r3));
1186 1199 }, r2.prototype.rotate = function(r3) {
1187 - return void 0 === r3 && (r3 = 15), this.hue(this.hue() + r3);
1200 + return void 0 === r3 && (r3 = 15), this.hue(y(this.rgba).h + r3);
1188 1201 }, r2.prototype.alpha = function(r3) {
1189 - return "number" == typeof r3 ? w({ r: (t3 = this.rgba).r, g: t3.g, b: t3.b, a: r3 }) : n(this.rgba.a, 3);
1190 - var t3;
1202 + return "number" == typeof r3 ? A({ r: (t2 = this.rgba).r, g: t2.g, b: t2.b, a: r3 }) : n(this.rgba.a, 3);
1203 + var t2;
1191 1204 }, r2.prototype.hue = function(r3) {
1192 - var t3 = c(this.rgba);
1193 - return "number" == typeof r3 ? w({ h: r3, s: t3.s, l: t3.l, a: t3.a }) : n(t3.h);
1205 + var t2 = y(this.rgba);
1206 + return "number" == typeof r3 ? A({ h: r3, s: t2.s, l: t2.l, a: t2.a }) : o2(t2.h);
1194 1207 }, r2.prototype.isEqual = function(r3) {
1195 - return this.toHex() === w(r3).toHex();
1208 + return this.toHex() === A(r3).toHex();
1196 1209 }, r2;
1197 1210 })();
1198 - var w = function(r2) {
1199 - return r2 instanceof j ? r2 : new j(r2);
1211 + var A = function(r2) {
1212 + return r2 instanceof q ? r2 : new q(r2);
1200 1213 };
1201 - var S = [];
1202 - var k = function(r2) {
1214 + var C = [];
1215 + var D = function(r2) {
1203 1216 r2.forEach(function(r3) {
1204 - S.indexOf(r3) < 0 && (r3(j, y), S.push(r3));
1217 + C.indexOf(r3) < 0 && (r3(q, $), C.push(r3));
1205 1218 });
1206 1219 };
1207 1220
1208 1221 // node_modules/colord/plugins/names.mjs
1209 - function names_default(e2, f2) {
1210 - var a2 = { white: "#ffffff", bisque: "#ffe4c4", blue: "#0000ff", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", antiquewhite: "#faebd7", aqua: "#00ffff", azure: "#f0ffff", whitesmoke: "#f5f5f5", papayawhip: "#ffefd5", plum: "#dda0dd", blanchedalmond: "#ffebcd", black: "#000000", gold: "#ffd700", goldenrod: "#daa520", gainsboro: "#dcdcdc", cornsilk: "#fff8dc", cornflowerblue: "#6495ed", burlywood: "#deb887", aquamarine: "#7fffd4", beige: "#f5f5dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkkhaki: "#bdb76b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", peachpuff: "#ffdab9", darkmagenta: "#8b008b", darkred: "#8b0000", darkorchid: "#9932cc", darkorange: "#ff8c00", darkslateblue: "#483d8b", gray: "#808080", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", deeppink: "#ff1493", deepskyblue: "#00bfff", wheat: "#f5deb3", firebrick: "#b22222", floralwhite: "#fffaf0", ghostwhite: "#f8f8ff", darkviolet: "#9400d3", magenta: "#ff00ff", green: "#008000", dodgerblue: "#1e90ff", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", blueviolet: "#8a2be2", forestgreen: "#228b22", lawngreen: "#7cfc00", indianred: "#cd5c5c", indigo: "#4b0082", fuchsia: "#ff00ff", brown: "#a52a2a", maroon: "#800000", mediumblue: "#0000cd", lightcoral: "#f08080", darkturquoise: "#00ced1", lightcyan: "#e0ffff", ivory: "#fffff0", lightyellow: "#ffffe0", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", linen: "#faf0e6", mediumaquamarine: "#66cdaa", lemonchiffon: "#fffacd", lime: "#00ff00", khaki: "#f0e68c", mediumseagreen: "#3cb371", limegreen: "#32cd32", mediumspringgreen: "#00fa9a", lightskyblue: "#87cefa", lightblue: "#add8e6", midnightblue: "#191970", lightpink: "#ffb6c1", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", mintcream: "#f5fffa", lightslategray: "#778899", lightslategrey: "#778899", navajowhite: "#ffdead", navy: "#000080", mediumvioletred: "#c71585", powderblue: "#b0e0e6", palegoldenrod: "#eee8aa", oldlace: "#fdf5e6", paleturquoise: "#afeeee", mediumturquoise: "#48d1cc", mediumorchid: "#ba55d3", rebeccapurple: "#663399", lightsteelblue: "#b0c4de", mediumslateblue: "#7b68ee", thistle: "#d8bfd8", tan: "#d2b48c", orchid: "#da70d6", mediumpurple: "#9370db", purple: "#800080", pink: "#ffc0cb", skyblue: "#87ceeb", springgreen: "#00ff7f", palegreen: "#98fb98", red: "#ff0000", yellow: "#ffff00", slateblue: "#6a5acd", lavenderblush: "#fff0f5", peru: "#cd853f", palevioletred: "#db7093", violet: "#ee82ee", teal: "#008080", slategray: "#708090", slategrey: "#708090", aliceblue: "#f0f8ff", darkseagreen: "#8fbc8f", darkolivegreen: "#556b2f", greenyellow: "#adff2f", seagreen: "#2e8b57", seashell: "#fff5ee", tomato: "#ff6347", silver: "#c0c0c0", sienna: "#a0522d", lavender: "#e6e6fa", lightgreen: "#90ee90", orange: "#ffa500", orangered: "#ff4500", steelblue: "#4682b4", royalblue: "#4169e1", turquoise: "#40e0d0", yellowgreen: "#9acd32", salmon: "#fa8072", saddlebrown: "#8b4513", sandybrown: "#f4a460", rosybrown: "#bc8f8f", darksalmon: "#e9967a", lightgoldenrodyellow: "#fafad2", snow: "#fffafa", lightgrey: "#d3d3d3", lightgray: "#d3d3d3", dimgray: "#696969", dimgrey: "#696969", olivedrab: "#6b8e23", olive: "#808000" }, r2 = {};
1211 - for (var d3 in a2) r2[a2[d3]] = d3;
1222 + var e = function(e2, f2) {
1223 + var a = { white: "#ffffff", bisque: "#ffe4c4", blue: "#0000ff", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", antiquewhite: "#faebd7", aqua: "#00ffff", azure: "#f0ffff", whitesmoke: "#f5f5f5", papayawhip: "#ffefd5", plum: "#dda0dd", blanchedalmond: "#ffebcd", black: "#000000", gold: "#ffd700", goldenrod: "#daa520", gainsboro: "#dcdcdc", cornsilk: "#fff8dc", cornflowerblue: "#6495ed", burlywood: "#deb887", aquamarine: "#7fffd4", beige: "#f5f5dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkkhaki: "#bdb76b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", peachpuff: "#ffdab9", darkmagenta: "#8b008b", darkred: "#8b0000", darkorchid: "#9932cc", darkorange: "#ff8c00", darkslateblue: "#483d8b", gray: "#808080", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", deeppink: "#ff1493", deepskyblue: "#00bfff", wheat: "#f5deb3", firebrick: "#b22222", floralwhite: "#fffaf0", ghostwhite: "#f8f8ff", darkviolet: "#9400d3", magenta: "#ff00ff", green: "#008000", dodgerblue: "#1e90ff", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", blueviolet: "#8a2be2", forestgreen: "#228b22", lawngreen: "#7cfc00", indianred: "#cd5c5c", indigo: "#4b0082", fuchsia: "#ff00ff", brown: "#a52a2a", maroon: "#800000", mediumblue: "#0000cd", lightcoral: "#f08080", darkturquoise: "#00ced1", lightcyan: "#e0ffff", ivory: "#fffff0", lightyellow: "#ffffe0", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", linen: "#faf0e6", mediumaquamarine: "#66cdaa", lemonchiffon: "#fffacd", lime: "#00ff00", khaki: "#f0e68c", mediumseagreen: "#3cb371", limegreen: "#32cd32", mediumspringgreen: "#00fa9a", lightskyblue: "#87cefa", lightblue: "#add8e6", midnightblue: "#191970", lightpink: "#ffb6c1", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", mintcream: "#f5fffa", lightslategray: "#778899", lightslategrey: "#778899", navajowhite: "#ffdead", navy: "#000080", mediumvioletred: "#c71585", powderblue: "#b0e0e6", palegoldenrod: "#eee8aa", oldlace: "#fdf5e6", paleturquoise: "#afeeee", mediumturquoise: "#48d1cc", mediumorchid: "#ba55d3", rebeccapurple: "#663399", lightsteelblue: "#b0c4de", mediumslateblue: "#7b68ee", thistle: "#d8bfd8", tan: "#d2b48c", orchid: "#da70d6", mediumpurple: "#9370db", purple: "#800080", pink: "#ffc0cb", skyblue: "#87ceeb", springgreen: "#00ff7f", palegreen: "#98fb98", red: "#ff0000", yellow: "#ffff00", slateblue: "#6a5acd", lavenderblush: "#fff0f5", peru: "#cd853f", palevioletred: "#db7093", violet: "#ee82ee", teal: "#008080", slategray: "#708090", slategrey: "#708090", aliceblue: "#f0f8ff", darkseagreen: "#8fbc8f", darkolivegreen: "#556b2f", greenyellow: "#adff2f", seagreen: "#2e8b57", seashell: "#fff5ee", tomato: "#ff6347", silver: "#c0c0c0", sienna: "#a0522d", lavender: "#e6e6fa", lightgreen: "#90ee90", orange: "#ffa500", orangered: "#ff4500", steelblue: "#4682b4", royalblue: "#4169e1", turquoise: "#40e0d0", yellowgreen: "#9acd32", salmon: "#fa8072", saddlebrown: "#8b4513", sandybrown: "#f4a460", rosybrown: "#bc8f8f", darksalmon: "#e9967a", lightgoldenrodyellow: "#fafad2", snow: "#fffafa", lightgrey: "#d3d3d3", lightgray: "#d3d3d3", dimgray: "#696969", dimgrey: "#696969", olivedrab: "#6b8e23", olive: "#808000" }, r2 = {};
1224 + for (var d2 in a) r2[a[d2]] = d2;
1212 1225 var l4 = {};
1213 1226 e2.prototype.toName = function(f3) {
1214 1227 if (!(this.rgba.a || this.rgba.r || this.rgba.g || this.rgba.b)) return "transparent";
1215 - var d4, i2, n2 = r2[this.toHex()];
1216 - if (n2) return n2;
1228 + var d3, i, n = r2[this.toHex()];
1229 + if (n) return n;
1217 1230 if (null == f3 ? void 0 : f3.closest) {
1218 - var o3 = this.toRgb(), t3 = 1 / 0, b3 = "black";
1219 - if (!l4.length) for (var c2 in a2) l4[c2] = new e2(a2[c2]).toRgb();
1220 - for (var g3 in a2) {
1221 - var u2 = (d4 = o3, i2 = l4[g3], Math.pow(d4.r - i2.r, 2) + Math.pow(d4.g - i2.g, 2) + Math.pow(d4.b - i2.b, 2));
1222 - u2 < t3 && (t3 = u2, b3 = g3);
1231 + var o2 = this.toRgb(), t2 = 1 / 0, b2 = "black";
1232 + if (!l4.length) for (var c2 in a) l4[c2] = new e2(a[c2]).toRgb();
1233 + for (var g2 in a) {
1234 + var u = (d3 = o2, i = l4[g2], Math.pow(d3.r - i.r, 2) + Math.pow(d3.g - i.g, 2) + Math.pow(d3.b - i.b, 2));
1235 + u < t2 && (t2 = u, b2 = g2);
1223 1236 }
1224 - return b3;
1237 + return b2;
1225 1238 }
1226 1239 };
1227 1240 f2.string.push([function(f3) {
1228 - var r3 = f3.toLowerCase(), d4 = "transparent" === r3 ? "#0000" : a2[r3];
1229 - return d4 ? new e2(d4).toRgb() : null;
1241 + var r3 = f3.toLowerCase(), d3 = "transparent" === r3 ? "#0000" : a[r3];
1242 + return d3 ? new e2(d3).toRgb() : null;
1230 1243 }, "name"]);
1231 - }
1244 + };
1232 1245
1233 1246 // node_modules/colord/plugins/a11y.mjs
1234 - var o2 = function(o3) {
1235 - var t3 = o3 / 255;
1236 - return t3 < 0.04045 ? t3 / 12.92 : Math.pow((t3 + 0.055) / 1.055, 2.4);
1247 + var o = function(o2) {
1248 + var t2 = o2 / 255;
1249 + return t2 < 0.04045 ? t2 / 12.92 : Math.pow((t2 + 0.055) / 1.055, 2.4);
1237 1250 };
1238 - var t2 = function(t3) {
1239 - return 0.2126 * o2(t3.r) + 0.7152 * o2(t3.g) + 0.0722 * o2(t3.b);
1251 + var t = function(t2) {
1252 + return 0.2126 * o(t2.r) + 0.7152 * o(t2.g) + 0.0722 * o(t2.b);
1240 1253 };
1241 - function a11y_default(o3) {
1242 - o3.prototype.luminance = function() {
1243 - return o4 = t2(this.rgba), void 0 === (r2 = 2) && (r2 = 0), void 0 === n2 && (n2 = Math.pow(10, r2)), Math.round(n2 * o4) / n2 + 0;
1244 - var o4, r2, n2;
1245 - }, o3.prototype.contrast = function(r2) {
1254 + var r = function(o2) {
1255 + o2.prototype.luminance = function() {
1256 + return o3 = t(this.rgba), void 0 === (r2 = 2) && (r2 = 0), void 0 === n && (n = Math.pow(10, r2)), Math.round(n * o3) / n + 0;
1257 + var o3, r2, n;
1258 + }, o2.prototype.contrast = function(r2) {
1246 1259 void 0 === r2 && (r2 = "#FFF");
1247 - var n2, a2, i2, e2, v3, u2, d3, c2 = r2 instanceof o3 ? r2 : new o3(r2);
1248 - return e2 = this.rgba, v3 = c2.toRgb(), u2 = t2(e2), d3 = t2(v3), n2 = u2 > d3 ? (u2 + 0.05) / (d3 + 0.05) : (d3 + 0.05) / (u2 + 0.05), void 0 === (a2 = 2) && (a2 = 0), void 0 === i2 && (i2 = Math.pow(10, a2)), Math.floor(i2 * n2) / i2 + 0;
1249 - }, o3.prototype.isReadable = function(o4, t3) {
1250 - return void 0 === o4 && (o4 = "#FFF"), void 0 === t3 && (t3 = {}), this.contrast(o4) >= (e2 = void 0 === (i2 = (r2 = t3).size) ? "normal" : i2, "AAA" === (a2 = void 0 === (n2 = r2.level) ? "AA" : n2) && "normal" === e2 ? 7 : "AA" === a2 && "large" === e2 ? 3 : 4.5);
1251 - var r2, n2, a2, i2, e2;
1260 + var n, a, i, e2, v3, u, d2, c2 = r2 instanceof o2 ? r2 : new o2(r2);
1261 + return e2 = this.rgba, v3 = c2.toRgb(), u = t(e2), d2 = t(v3), n = u > d2 ? (u + 0.05) / (d2 + 0.05) : (d2 + 0.05) / (u + 0.05), void 0 === (a = 2) && (a = 0), void 0 === i && (i = Math.pow(10, a)), Math.floor(i * n) / i + 0;
1262 + }, o2.prototype.isReadable = function(o3, t2) {
1263 + return void 0 === o3 && (o3 = "#FFF"), void 0 === t2 && (t2 = {}), this.contrast(o3) >= (e2 = void 0 === (i = (r2 = t2).size) ? "normal" : i, "AAA" === (a = void 0 === (n = r2.level) ? "AA" : n) && "normal" === e2 ? 7 : "AA" === a && "large" === e2 ? 3 : 4.5);
1264 + var r2, n, a, i, e2;
1252 1265 };
1253 - }
1266 + };
1254 1267
1255 1268 // packages/blocks/build-module/api/utils.mjs
1256 1269 var import_element = __toESM(require_element(), 1);
1257 1270 var import_i18n2 = __toESM(require_i18n(), 1);
@@ -1532,8 +1545,13 @@
1532 1545 value: ["typography", "textIndent"],
1533 1546 support: ["typography", "textIndent"],
1534 1547 useEngine: true
1535 1548 },
1549 + textShadow: {
1550 + value: ["typography", "textShadow"],
1551 + support: ["typography", "textShadow"],
1552 + useEngine: true
1553 + },
1536 1554 writingMode: {
1537 1555 value: ["typography", "writingMode"],
1538 1556 support: ["typography", "__experimentalWritingMode"],
1539 1557 useEngine: true
@@ -1908,9 +1926,9 @@
1908 1926 return unlock((0, import_data.select)(store)).getAllBlockBindingsSources();
1909 1927 }
1910 1928
1911 1929 // packages/blocks/build-module/api/utils.mjs
1912 - k([names_default, a11y_default]);
1930 + D([e, r]);
1913 1931 var ICON_COLORS = ["#191e23", "#f8f9f9"];
1914 1932 function isUnmodifiedBlock(block, role) {
1915 1933 const blockAttributes = getBlockType(block.name)?.attributes ?? {};
1916 1934 const attributesByRole = role ? Object.entries(blockAttributes).filter(([key, definition]) => {
@@ -1945,9 +1963,9 @@
1945 1963 return { src: resolvedIcon };
1946 1964 }
1947 1965 const iconDescriptor = resolvedIcon;
1948 1966 if ("background" in iconDescriptor) {
1949 - const colordBgColor = w(iconDescriptor.background);
1967 + const colordBgColor = A(iconDescriptor.background);
1950 1968 const getColorContrast = (iconColor) => colordBgColor.contrast(iconColor);
1951 1969 const maxContrast = Math.max(...ICON_COLORS.map(getColorContrast));
1952 1970 return {
1953 1971 ...iconDescriptor,
@@ -2501,8 +2519,9 @@
2501 2519 "textAlign",
2502 2520 "textDecoration",
2503 2521 "textIndent",
2504 2522 "textTransform",
2523 + "textShadow",
2505 2524 "letterSpacing"
2506 2525 ];
2507 2526 function filterElementBlockSupports(blockSupports, name, element) {
2508 2527 return blockSupports.filter((support) => {
@@ -2625,10 +2644,13 @@
2625 2644 });
2626 2645 }
2627 2646 const transforms = state.blockTypes[blockName]?.transforms;
2628 2647 for (const transform of transforms?.to ?? []) {
2648 + if (transform.type !== "block") {
2649 + continue;
2650 + }
2629 2651 const targetBlockName = transform.blocks?.[0];
2630 - if (transform.type !== "block" || !targetBlockName) {
2652 + if (!targetBlockName) {
2631 2653 continue;
2632 2654 }
2633 2655 for (const shortcut of transform.shortcuts ?? []) {
2634 2656 shortcuts.push({
@@ -2872,15 +2894,15 @@
2872 2894 });
2873 2895 var import_deprecated5 = __toESM(require_deprecated(), 1);
2874 2896
2875 2897 // node_modules/is-plain-object/dist/is-plain-object.mjs
2876 - function isObject3(o3) {
2877 - return Object.prototype.toString.call(o3) === "[object Object]";
2898 + function isObject3(o2) {
2899 + return Object.prototype.toString.call(o2) === "[object Object]";
2878 2900 }
2879 - function isPlainObject(o3) {
2901 + function isPlainObject(o2) {
2880 2902 var ctor, prot;
2881 - if (isObject3(o3) === false) return false;
2882 - ctor = o3.constructor;
2903 + if (isObject3(o2) === false) return false;
2904 + ctor = o2.constructor;
2883 2905 if (ctor === void 0) return true;
2884 2906 prot = ctor.prototype;
2885 2907 if (isObject3(prot) === false) return false;
2886 2908 if (prot.hasOwnProperty("isPrototypeOf") === false) {
@@ -3227,10 +3249,10 @@
3227 3249 unlock(store).registerPrivateActions(private_actions_exports);
3228 3250
3229 3251 // node_modules/uuid/dist/stringify.js
3230 3252 var byteToHex = [];
3231 - for (let i2 = 0; i2 < 256; ++i2) {
3232 - byteToHex.push((i2 + 256).toString(16).slice(1));
3253 + for (let i = 0; i < 256; ++i) {
3254 + byteToHex.push((i + 256).toString(16).slice(1));
3233 3255 }
3234 3256 function unsafeStringify(arr, offset = 0) {
3235 3257 return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
3236 3258 }
@@ -3260,10 +3282,10 @@
3260 3282 offset = offset || 0;
3261 3283 if (offset < 0 || offset + 16 > buf.length) {
3262 3284 throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
3263 3285 }
3264 - for (let i2 = 0; i2 < 16; ++i2) {
3265 - buf[offset + i2] = rnds[i2];
3286 + for (let i = 0; i < 16; ++i) {
3287 + buf[offset + i] = rnds[i];
3266 3288 }
3267 3289 return buf;
3268 3290 }
3269 3291 return unsafeStringify(rnds);
@@ -3273,8 +3295,9 @@
3273 3295 // packages/blocks/build-module/api/factory.mjs
3274 3296 var import_hooks2 = __toESM(require_hooks(), 1);
3275 3297 var import_deprecated6 = __toESM(require_deprecated(), 1);
3276 3298 var import_warning3 = __toESM(require_warning(), 1);
3299 + var isBlockTypeTransform = (transform) => transform?.type === "block";
3277 3300 var getBlockTypeWithTransformMetadata = (blockType, transform) => transform.variationName ? { ...blockType, variationName: transform.variationName } : blockType;
3278 3301 function createBlock(name, attributes = {}, innerBlocks = [], innerContent) {
3279 3302 if (!isBlockRegistered(name)) {
3280 3303 return createBlock("core/missing", {
@@ -3376,12 +3399,8 @@
3376 3399 }
3377 3400 if (!isWildcardBlockTransform(transform) && !blocks.every((block) => block.name === firstBlockName)) {
3378 3401 return false;
3379 3402 }
3380 - const isBlockType = transform.type === "block";
3381 - if (!isBlockType) {
3382 - return false;
3383 - }
3384 3403 const sourceBlock = blocks[0];
3385 3404 const hasMatchingName = direction !== "from" || transform.blocks.indexOf(sourceBlock.name) !== -1 || isWildcardBlockTransform(transform);
3386 3405 if (!hasMatchingName) {
3387 3406 return false;
@@ -3401,9 +3420,9 @@
3401 3420 const allBlockTypes = getBlockTypes();
3402 3421 const blockTypesWithPossibleFromTransforms = allBlockTypes.flatMap(
3403 3422 (blockType) => {
3404 3423 const fromTransforms = getBlockTransforms("from", blockType.name);
3405 - return fromTransforms.filter(
3424 + return fromTransforms.filter(isBlockTypeTransform).filter(
3406 3425 (transform) => isPossibleTransformForSource(transform, "from", blocks)
3407 3426 ).map(
3408 3427 (transform) => getBlockTypeWithTransformMetadata(blockType, transform)
3409 3428 );
@@ -3417,13 +3436,13 @@
3417 3436 }
3418 3437 const sourceBlock = blocks[0];
3419 3438 const blockType = getBlockType(sourceBlock.name);
3420 3439 const transformsTo = blockType ? getBlockTransforms("to", blockType.name) : [];
3421 - const possibleTransforms = transformsTo.filter((transform) => {
3422 - return transform && isPossibleTransformForSource(transform, "to", blocks);
3423 - });
3440 + const possibleTransforms = transformsTo.filter(isBlockTypeTransform).filter(
3441 + (transform) => isPossibleTransformForSource(transform, "to", blocks)
3442 + );
3424 3443 return possibleTransforms.flatMap((transformation) => {
3425 - return (transformation.blocks || []).map((name) => {
3444 + return (transformation.blocks ?? []).map((name) => {
3426 3445 const transformedBlockType = getBlockType(name);
3427 3446 return transformedBlockType ? getBlockTypeWithTransformMetadata(
3428 3447 transformedBlockType,
3429 3448 transformation
@@ -3428,11 +3447,11 @@
3428 3447 transformedBlockType,
3429 3448 transformation
3430 3449 ) : void 0;
3431 3450 });
3432 - }).filter((bt) => !!bt);
3451 + }).filter((bt2) => !!bt2);
3433 3452 };
3434 - var isWildcardBlockTransform = (t3) => !!t3 && t3.type === "block" && Array.isArray(t3.blocks) && t3.blocks.includes("*");
3453 + var isWildcardBlockTransform = (t2) => isBlockTypeTransform(t2) && Array.isArray(t2.blocks) && t2.blocks.includes("*");
3435 3454 var isContainerGroupBlock = (name) => name === getGroupingBlockName();
3436 3455 function getPossibleBlockTransformations(blocks) {
3437 3456 if (!blocks.length) {
3438 3457 return [];
@@ -3452,14 +3471,14 @@
3452 3471 return [...blockTypesByNameAndVariation.values()];
3453 3472 }
3454 3473 function findTransform(transforms, predicate) {
3455 3474 const hooks = (0, import_hooks2.createHooks)();
3456 - for (let i2 = 0; i2 < transforms.length; i2++) {
3457 - const candidate = transforms[i2];
3475 + for (let i = 0; i < transforms.length; i++) {
3476 + const candidate = transforms[i];
3458 3477 if (predicate(candidate)) {
3459 3478 hooks.addFilter(
3460 3479 "transform",
3461 - "transform/" + i2.toString(),
3480 + "transform/" + i.toString(),
3462 3481 (result) => result ? result : candidate,
3463 3482 candidate.priority
3464 3483 );
3465 3484 }
@@ -3470,37 +3489,15 @@
3470 3489 if (blockTypeOrName === void 0) {
3471 3490 return getBlockTypes().map(({ name }) => getBlockTransforms(direction, name)).flat();
3472 3491 }
3473 3492 const blockType = normalizeBlockType(blockTypeOrName);
3474 - const { name: blockName, transforms } = blockType || {};
3475 - const directionTransforms = transforms?.[direction];
3476 - if (!transforms || !Array.isArray(directionTransforms)) {
3493 + const directionTransforms = blockType?.transforms?.[direction];
3494 + if (!blockType || !Array.isArray(directionTransforms)) {
3477 3495 return [];
3478 3496 }
3479 - const usingMobileTransformations = transforms.supportedMobileTransforms && Array.isArray(transforms.supportedMobileTransforms);
3480 - const filteredTransforms = usingMobileTransformations ? directionTransforms.filter((t3) => {
3481 - if (t3.type === "raw") {
3482 - return true;
3483 - }
3484 - if (t3.type === "prefix") {
3485 - return true;
3486 - }
3487 - if (!t3.blocks || !t3.blocks.length) {
3488 - return false;
3489 - }
3490 - if (isWildcardBlockTransform(t3)) {
3491 - return true;
3492 - }
3493 - return t3.blocks.every(
3494 - (transformBlockName) => transforms.supportedMobileTransforms.includes(
3495 - transformBlockName
3496 - )
3497 - );
3498 - }) : directionTransforms;
3499 - return filteredTransforms.map((transform) => ({
3497 + return directionTransforms.map((transform) => ({
3500 3498 ...transform,
3501 - blockName,
3502 - usingMobileTransformations
3499 + blockName: blockType.name
3503 3500 }));
3504 3501 }
3505 3502 function maybeCheckTransformIsMatch(transform, blocks) {
3506 3503 if (typeof transform.isMatch !== "function") {
@@ -3515,17 +3512,21 @@
3515 3512 const blocksArray = Array.isArray(blocks) ? blocks : [blocks];
3516 3513 const isMultiBlock = blocksArray.length > 1;
3517 3514 const firstBlock = blocksArray[0];
3518 3515 const sourceName = firstBlock.name;
3519 - const transformationsFrom = getBlockTransforms("from", name);
3520 - const transformationsTo = getBlockTransforms("to", sourceName);
3521 - const isMatchingVariation = (t3) => variationName ? t3.variationName === variationName : !t3.variationName;
3516 + const transformationsFrom = getBlockTransforms("from", name).filter(
3517 + isBlockTypeTransform
3518 + );
3519 + const transformationsTo = getBlockTransforms("to", sourceName).filter(
3520 + isBlockTypeTransform
3521 + );
3522 + const isMatchingVariation = (t2) => variationName ? t2.variationName === variationName : !t2.variationName;
3522 3523 const transformation = findTransform(
3523 3524 transformationsTo,
3524 - (t3) => t3.type === "block" && isMatchingVariation(t3) && (isWildcardBlockTransform(t3) || t3.blocks.indexOf(name) !== -1) && (!isMultiBlock || !!t3.isMultiBlock) && maybeCheckTransformIsMatch(t3, blocksArray)
3525 + (t2) => isMatchingVariation(t2) && (isWildcardBlockTransform(t2) || t2.blocks.indexOf(name) !== -1) && (!isMultiBlock || !!t2.isMultiBlock) && maybeCheckTransformIsMatch(t2, blocksArray)
3525 3526 ) || findTransform(
3526 3527 transformationsFrom,
3527 - (t3) => t3.type === "block" && isMatchingVariation(t3) && (isWildcardBlockTransform(t3) || t3.blocks.indexOf(sourceName) !== -1) && (!isMultiBlock || !!t3.isMultiBlock) && maybeCheckTransformIsMatch(t3, blocksArray)
3528 + (t2) => isMatchingVariation(t2) && (isWildcardBlockTransform(t2) || t2.blocks.indexOf(sourceName) !== -1) && (!isMultiBlock || !!t2.isMultiBlock) && maybeCheckTransformIsMatch(t2, blocksArray)
3528 3529 );
3529 3530 if (!transformation) {
3530 3531 return null;
3531 3532 }
@@ -4449,10 +4450,10 @@
4449 4450 }
4450 4451 if (arguments.length === 0) {
4451 4452 return token;
4452 4453 }
4453 - for (var i2 = 0; i2 < arguments.length; i2++) {
4454 - if (token.type === arguments[i2]) {
4454 + for (var i = 0; i < arguments.length; i++) {
4455 + if (token.type === arguments[i]) {
4455 4456 return token;
4456 4457 }
4457 4458 }
4458 4459 throw new Error("token type was unexpectedly " + token.type);
@@ -4706,10 +4707,10 @@
4706 4707 }
4707 4708 function isEquivalentTextTokens(actual, expected, logger = createLogger()) {
4708 4709 let actualChars = actual.chars;
4709 4710 let expectedChars = expected.chars;
4710 - for (let i2 = 0; i2 < TEXT_NORMALIZATIONS.length; i2++) {
4711 - const normalize = TEXT_NORMALIZATIONS[i2];
4711 + for (let i = 0; i < TEXT_NORMALIZATIONS.length; i++) {
4712 + const normalize = TEXT_NORMALIZATIONS[i];
4712 4713 actualChars = normalize(actualChars);
4713 4714 expectedChars = normalize(expectedChars);
4714 4715 if (actualChars === expectedChars) {
4715 4716 return true;
@@ -4778,13 +4779,13 @@
4778 4779 );
4779 4780 return false;
4780 4781 }
4781 4782 const expectedAttributes = {};
4782 - for (let i2 = 0; i2 < expected.length; i2++) {
4783 - expectedAttributes[expected[i2][0].toLowerCase()] = expected[i2][1];
4783 + for (let i = 0; i < expected.length; i++) {
4784 + expectedAttributes[expected[i][0].toLowerCase()] = expected[i][1];
4784 4785 }
4785 - for (let i2 = 0; i2 < actual.length; i2++) {
4786 - const [name, actualValue] = actual[i2];
4786 + for (let i = 0; i < actual.length; i++) {
4787 + const [name, actualValue] = actual[i];
4787 4788 const nameLower = name.toLowerCase();
4788 4789 if (!expectedAttributes.hasOwnProperty(nameLower)) {
4789 4790 logger.warning("Encountered unexpected attribute `%s`.", name);
4790 4791 return false;
@@ -5175,16 +5176,16 @@
5175 5176 var head;
5176 5177 var tail;
5177 5178 options = options || {};
5178 5179 function memoized() {
5179 - var node = head, len = arguments.length, args, i2;
5180 + var node = head, len = arguments.length, args, i;
5180 5181 searchCache: while (node) {
5181 5182 if (node.args.length !== arguments.length) {
5182 5183 node = node.next;
5183 5184 continue;
5184 5185 }
5185 - for (i2 = 0; i2 < len; i2++) {
5186 - if (node.args[i2] !== arguments[i2]) {
5186 + for (i = 0; i < len; i++) {
5187 + if (node.args[i] !== arguments[i]) {
5187 5188 node = node.next;
5188 5189 continue searchCache;
5189 5190 }
5190 5191 }
@@ -5203,10 +5204,10 @@
5203 5204 }
5204 5205 return node.val;
5205 5206 }
5206 5207 args = new Array(len);
5207 - for (i2 = 0; i2 < len; i2++) {
5208 - args[i2] = arguments[i2];
5208 + for (i = 0; i < len; i++) {
5209 + args[i] = arguments[i];
5209 5210 }
5210 5211 node = {
5211 5212 args,
5212 5213 // Generate the result from original function
@@ -5268,12 +5269,12 @@
5268 5269 alternative: "wp.richText.concat",
5269 5270 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
5270 5271 });
5271 5272 const result = [];
5272 - for (let i2 = 0; i2 < blockNodes.length; i2++) {
5273 - const blockNode = Array.isArray(blockNodes[i2]) ? blockNodes[i2] : [blockNodes[i2]];
5274 - for (let j3 = 0; j3 < blockNode.length; j3++) {
5275 - const child = blockNode[j3];
5273 + for (let i = 0; i < blockNodes.length; i++) {
5274 + const blockNode = Array.isArray(blockNodes[i]) ? blockNodes[i] : [blockNodes[i]];
5275 + for (let j2 = 0; j2 < blockNode.length; j2++) {
5276 + const child = blockNode[j2];
5276 5277 const canConcatToPreviousString = typeof child === "string" && typeof result[result.length - 1] === "string";
5277 5278 if (canConcatToPreviousString) {
5278 5279 result[result.length - 1] += child;
5279 5280 } else {
@@ -5290,11 +5291,11 @@
5290 5291 alternative: "wp.richText.create",
5291 5292 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
5292 5293 });
5293 5294 const result = [];
5294 - for (let i2 = 0; i2 < domNodes.length; i2++) {
5295 + for (let i = 0; i < domNodes.length; i++) {
5295 5296 try {
5296 - result.push(fromDOM2(domNodes[i2]));
5297 + result.push(fromDOM2(domNodes[i]));
5297 5298 } catch {
5298 5299 }
5299 5300 }
5300 5301 return result;
@@ -5345,10 +5346,10 @@
5345 5346 return typeof node !== "string" && node?.type === type;
5346 5347 }
5347 5348 function getNamedNodeMapAsObject(nodeMap) {
5348 5349 const result = {};
5349 - for (let i2 = 0; i2 < nodeMap.length; i2++) {
5350 - const { name, value } = nodeMap[i2];
5350 + for (let i = 0; i < nodeMap.length; i++) {
5351 + const { name, value } = nodeMap[i];
5351 5352 result[name] = value;
5352 5353 }
5353 5354 return result;
5354 5355 }
@@ -5553,9 +5554,12 @@
5553 5554 }
5554 5555 }
5555 5556 );
5556 5557 function parseHtml(innerHTML) {
5557 - return parse(innerHTML, (h2) => h2);
5558 + return parse(
5559 + innerHTML ?? "",
5560 + (h) => h
5561 + );
5558 5562 }
5559 5563 function parseWithAttributeSchema(innerHTML, attributeSchema) {
5560 5564 return matcherFromSource(attributeSchema)(
5561 5565 parseHtml(innerHTML)
@@ -5691,10 +5695,10 @@
5691 5695 const { deprecated: deprecatedDefinitions } = blockType;
5692 5696 if (!deprecatedDefinitions || !deprecatedDefinitions.length) {
5693 5697 return block;
5694 5698 }
5695 - for (let i2 = 0; i2 < deprecatedDefinitions.length; i2++) {
5696 - const { isEligible = stubFalse } = deprecatedDefinitions[i2];
5699 + for (let i = 0; i < deprecatedDefinitions.length; i++) {
5700 + const { isEligible = stubFalse } = deprecatedDefinitions[i];
5697 5701 if (block.isValid && !isEligible(parsedAttributes, block.innerBlocks, {
5698 5702 blockNode: rawBlock,
5699 5703 block
5700 5704 })) {
@@ -5704,9 +5708,9 @@
5704 5708 omit(
5705 5709 blockType,
5706 5710 DEPRECATED_ENTRY_KEYS
5707 5711 ),
5708 - deprecatedDefinitions[i2]
5712 + deprecatedDefinitions[i]
5709 5713 );
5710 5714 let migratedBlock = {
5711 5715 ...block,
5712 5716 attributes: getBlockAttributes(
@@ -5891,14 +5895,14 @@
5891 5895 var import_dom13 = __toESM(require_dom(), 1);
5892 5896
5893 5897 // packages/blocks/build-module/api/raw-handling/get-raw-transforms.mjs
5894 5898 function getRawTransforms() {
5895 - return getBlockTransforms("from").filter(({ type }) => type === "raw").map((transform) => {
5896 - return transform.isMatch ? transform : {
5897 - ...transform,
5898 - isMatch: (node) => transform.selector && node.matches(transform.selector)
5899 - };
5900 - });
5899 + return getBlockTransforms("from").filter(
5900 + (transform) => transform.type === "raw"
5901 + ).map((transform) => ({
5902 + ...transform,
5903 + isMatch: transform.isMatch ?? ((node) => !!transform.selector && node.matches(transform.selector))
5904 + }));
5901 5905 }
5902 5906
5903 5907 // packages/blocks/build-module/api/raw-handling/html-to-blocks.mjs
5904 5908 function htmlToBlocks(html2, handler) {
@@ -5907,12 +5911,9 @@
5907 5911 return Array.from(doc.body.children).flatMap((node) => {
5908 5912 const transforms = getRawTransforms();
5909 5913 const rawTransform = findTransform(
5910 5914 transforms,
5911 - ((t3) => {
5912 - const transform2 = t3;
5913 - return transform2.isMatch(node);
5914 - })
5915 + (transform2) => transform2.isMatch(node)
5915 5916 );
5916 5917 if (!rawTransform) {
5917 5918 return createBlock(
5918 5919 // Should not be hardcoded.
@@ -6150,19 +6151,16 @@
6150 6151 var castArray = (maybeArray) => Array.isArray(maybeArray) ? maybeArray : [maybeArray];
6151 6152 var beforeLineRegexp = /(\n|<p>|<br\s*\/?>)\s*$/;
6152 6153 var afterLineRegexp = /^\s*(\n|<\/p>|<br\s*\/?>)/;
6153 6154 function segmentHTMLToShortcodeBlock(HTML, lastIndex = 0, excludedBlockNames = []) {
6154 - const transformsFrom = getBlockTransforms(
6155 - "from"
6155 + const transformsFrom = getBlockTransforms("from").filter(
6156 + (transform) => transform.type === "shortcode"
6156 6157 );
6157 6158 const transformation = findTransform(
6158 6159 transformsFrom,
6159 - ((transform) => {
6160 - const t3 = transform;
6161 - return excludedBlockNames.indexOf(t3.blockName) === -1 && t3.type === "shortcode" && castArray(t3.tag).some(
6162 - (tag) => (0, import_shortcode.regexp)(tag).test(HTML)
6163 - );
6164 - })
6160 + (transform) => excludedBlockNames.indexOf(transform.blockName) === -1 && castArray(transform.tag).some(
6161 + (tag) => (0, import_shortcode.regexp)(tag).test(HTML)
6162 + )
6165 6163 );
6166 6164 if (!transformation) {
6167 6165 return [HTML];
6168 6166 }
@@ -6169,76 +6167,74 @@
6169 6167 const transformTags = castArray(transformation.tag);
6170 6168 const transformTag = transformTags.find(
6171 6169 (tag) => (0, import_shortcode.regexp)(tag).test(HTML)
6172 6170 );
6173 - let match;
6174 6171 const previousIndex = lastIndex;
6175 - if (match = (0, import_shortcode.next)(transformTag, HTML, lastIndex)) {
6176 - lastIndex = match.index + match.content.length;
6177 - const beforeHTML = HTML.substr(0, match.index);
6178 - const afterHTML = HTML.substr(lastIndex);
6179 - if (!match.shortcode.content?.includes("<") && !(beforeLineRegexp.test(beforeHTML) && afterLineRegexp.test(afterHTML))) {
6180 - return segmentHTMLToShortcodeBlock(HTML, lastIndex);
6181 - }
6182 - if (transformation.isMatch && !transformation.isMatch(match.shortcode.attrs)) {
6183 - return segmentHTMLToShortcodeBlock(HTML, previousIndex, [
6184 - ...excludedBlockNames,
6185 - transformation.blockName
6186 - ]);
6187 - }
6188 - let blocks = [];
6189 - if (typeof transformation.transform === "function") {
6190 - blocks = [].concat(
6191 - transformation.transform(match.shortcode.attrs, match)
6192 - );
6193 - blocks = blocks.map((block) => {
6194 - block.originalContent = match.shortcode.content;
6195 - return applyBuiltInValidationFixes(
6196 - block,
6197 - getBlockType(block.name)
6198 - );
6199 - });
6200 - } else {
6201 - const attributes = Object.fromEntries(
6202 - Object.entries(transformation.attributes).filter(([, schema]) => schema.shortcode).map(([key, schema]) => [
6203 - key,
6204 - schema.shortcode(match.shortcode.attrs, match)
6205 - ])
6206 - );
6207 - const blockType = getBlockType(transformation.blockName);
6208 - if (!blockType) {
6209 - return [HTML];
6210 - }
6211 - const transformationBlockType = {
6212 - ...blockType,
6213 - attributes: transformation.attributes
6214 - };
6215 - let block = createBlock(
6216 - transformation.blockName,
6217 - getBlockAttributes(
6218 - transformationBlockType,
6219 - match.shortcode.content,
6220 - attributes
6221 - )
6222 - );
6172 + const match = (0, import_shortcode.next)(transformTag, HTML, lastIndex);
6173 + if (!match) {
6174 + return [HTML];
6175 + }
6176 + lastIndex = match.index + match.content.length;
6177 + const beforeHTML = HTML.substr(0, match.index);
6178 + const afterHTML = HTML.substr(lastIndex);
6179 + if (!match.shortcode.content?.includes("<") && !(beforeLineRegexp.test(beforeHTML) && afterLineRegexp.test(afterHTML))) {
6180 + return segmentHTMLToShortcodeBlock(HTML, lastIndex);
6181 + }
6182 + if (transformation.isMatch && !transformation.isMatch(match.shortcode.attrs)) {
6183 + return segmentHTMLToShortcodeBlock(HTML, previousIndex, [
6184 + ...excludedBlockNames,
6185 + transformation.blockName
6186 + ]);
6187 + }
6188 + let blocks = [];
6189 + if (typeof transformation.transform === "function") {
6190 + blocks = [].concat(
6191 + transformation.transform(match.shortcode.attrs, match)
6192 + );
6193 + blocks = blocks.map((block) => {
6223 6194 block.originalContent = match.shortcode.content;
6224 - block = applyBuiltInValidationFixes(
6195 + return applyBuiltInValidationFixes(
6225 6196 block,
6226 - transformationBlockType
6197 + getBlockType(block.name)
6227 6198 );
6228 - blocks = [block];
6199 + });
6200 + } else {
6201 + const blockType = getBlockType(transformation.blockName);
6202 + if (!blockType) {
6203 + return [HTML];
6229 6204 }
6230 - return [
6231 - ...segmentHTMLToShortcodeBlock(
6232 - beforeHTML.replace(beforeLineRegexp, "")
6233 - ),
6234 - ...blocks,
6235 - ...segmentHTMLToShortcodeBlock(
6236 - afterHTML.replace(afterLineRegexp, "")
6205 + const transformAttributes = transformation.attributes ?? blockType.attributes;
6206 + const attributes = Object.fromEntries(
6207 + Object.entries(transformAttributes).filter(([, schema]) => schema.shortcode).map(([key, schema]) => [
6208 + key,
6209 + schema.shortcode(match.shortcode.attrs, match)
6210 + ])
6211 + );
6212 + const transformationBlockType = {
6213 + ...blockType,
6214 + attributes: transformAttributes
6215 + };
6216 + let block = createBlock(
6217 + transformation.blockName,
6218 + getBlockAttributes(
6219 + transformationBlockType,
6220 + match.shortcode.content,
6221 + attributes
6237 6222 )
6238 - ];
6223 + );
6224 + block.originalContent = match.shortcode.content;
6225 + block = applyBuiltInValidationFixes(block, transformationBlockType);
6226 + blocks = [block];
6239 6227 }
6240 - return [HTML];
6228 + return [
6229 + ...segmentHTMLToShortcodeBlock(
6230 + beforeHTML.replace(beforeLineRegexp, "")
6231 + ),
6232 + ...blocks,
6233 + ...segmentHTMLToShortcodeBlock(
6234 + afterHTML.replace(afterLineRegexp, "")
6235 + )
6236 + ];
6241 6237 }
6242 6238 var shortcode_converter_default = segmentHTMLToShortcodeBlock;
6243 6239
6244 6240 // packages/blocks/build-module/api/raw-handling/utils.mjs
@@ -6304,41 +6300,41 @@
6304 6300 return [...objValue || [], ...srcValue || []];
6305 6301 }
6306 6302 }
6307 6303 }
6308 - function mergeTagNameSchemas(a2, b3) {
6309 - if (a2 === b3) {
6310 - return a2;
6304 + function mergeTagNameSchemas(a, b2) {
6305 + if (a === b2) {
6306 + return a;
6311 6307 }
6312 - for (const key in b3) {
6313 - if (a2[key]) {
6314 - a2[key] = mergeTagNameSchemaProperties(
6315 - a2[key],
6316 - b3[key],
6308 + for (const key in b2) {
6309 + if (a[key]) {
6310 + a[key] = mergeTagNameSchemaProperties(
6311 + a[key],
6312 + b2[key],
6317 6313 key
6318 6314 );
6319 - } else if (Array.isArray(b3[key])) {
6320 - a2[key] = b3[key].slice();
6315 + } else if (Array.isArray(b2[key])) {
6316 + a[key] = b2[key].slice();
6321 6317 } else {
6322 - a2[key] = { ...b3[key] };
6318 + a[key] = { ...b2[key] };
6323 6319 }
6324 6320 }
6325 - return a2;
6321 + return a;
6326 6322 }
6327 - function mergeSchemas(a2, b3) {
6328 - if (a2 === b3) {
6329 - return a2;
6323 + function mergeSchemas(a, b2) {
6324 + if (a === b2) {
6325 + return a;
6330 6326 }
6331 - for (const key in b3) {
6332 - if (a2[key]) {
6333 - a2[key] = mergeTagNameSchemas(a2[key], b3[key]);
6334 - } else if (Array.isArray(b3[key])) {
6335 - a2[key] = b3[key].slice();
6327 + for (const key in b2) {
6328 + if (a[key]) {
6329 + a[key] = mergeTagNameSchemas(a[key], b2[key]);
6330 + } else if (Array.isArray(b2[key])) {
6331 + a[key] = b2[key].slice();
6336 6332 } else {
6337 - a2[key] = { ...b3[key] };
6333 + a[key] = { ...b2[key] };
6338 6334 }
6339 6335 }
6340 - return a2;
6336 + return a;
6341 6337 }
6342 6338 return schemas.reduce(mergeSchemas, {});
6343 6339 }
6344 6340 function getBlockContentSchema(context) {
@@ -6354,10 +6350,10 @@
6354 6350 return false;
6355 6351 }
6356 6352 const wrapper = doc.body.children.item(0);
6357 6353 const descendants = wrapper.getElementsByTagName("*");
6358 - for (let i2 = 0; i2 < descendants.length; i2++) {
6359 - if (descendants.item(i2).tagName !== "BR") {
6354 + for (let i = 0; i < descendants.length; i++) {
6355 + if (descendants.item(i).tagName !== "BR") {
6360 6356 return false;
6361 6357 }
6362 6358 }
6363 6359 if (wrapper.tagName !== "SPAN") {
@@ -6419,9 +6415,9 @@
6419 6415 ["ul", "li", "ol"],
6420 6416 ["h1", "h2", "h3", "h4", "h5", "h6"]
6421 6417 ];
6422 6418 return inlineAllowedTagGroups.some(
6423 - (tagGroup) => [tag, contextTag].filter((t3) => !tagGroup.includes(t3)).length === 0
6419 + (tagGroup) => [tag, contextTag].filter((t2) => !tagGroup.includes(t2)).length === 0
6424 6420 );
6425 6421 }
6426 6422 function deepCheck(nodes, contextTag) {
6427 6423 return nodes.every(
@@ -6587,10 +6583,10 @@
6587 6583 node.src = "";
6588 6584 return;
6589 6585 }
6590 6586 const uint8Array = new Uint8Array(decoded.length);
6591 - for (let i2 = 0; i2 < uint8Array.length; i2++) {
6592 - uint8Array[i2] = decoded.charCodeAt(i2);
6587 + for (let i = 0; i < uint8Array.length; i++) {
6588 + uint8Array[i] = decoded.charCodeAt(i);
6593 6589 }
6594 6590 const name = type.replace("/", ".");
6595 6591 const file = new window.File([uint8Array], name, { type });
6596 6592 node.src = (0, import_blob.createBlobURL)(file);
@@ -6609,24 +6605,31 @@
6609 6605 node.innerHTML = normaliseBlocks(node.innerHTML);
6610 6606 }
6611 6607
6612 6608 // node_modules/marked/lib/marked.esm.js
6613 - function z() {
6609 + function A2() {
6614 6610 return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
6615 6611 }
6616 - var T = z();
6617 - function G(l4) {
6612 + var T = A2();
6613 + function U(l4) {
6618 6614 T = l4;
6619 6615 }
6620 - var _ = { exec: () => null };
6621 - function d2(l4, e2 = "") {
6622 - let t3 = typeof l4 == "string" ? l4 : l4.source, n2 = { replace: (s2, r2) => {
6623 - let i2 = typeof r2 == "string" ? r2 : r2.source;
6624 - return i2 = i2.replace(m2.caret, "$1"), t3 = t3.replace(s2, i2), n2;
6625 - }, getRegex: () => new RegExp(t3, e2) };
6626 - return n2;
6616 + var E2 = { exec: () => null };
6617 + function I(l4) {
6618 + let e2 = [];
6619 + return (t2) => {
6620 + let n = Math.max(0, Math.min(3, t2 - 1)), i = e2[n];
6621 + return i || (i = l4(n), e2[n] = i), i;
6622 + };
6627 6623 }
6628 - var Re = ((l4 = "") => {
6624 + function d(l4, e2 = "") {
6625 + let t2 = typeof l4 == "string" ? l4 : l4.source, n = { replace: (i, r2) => {
6626 + let o2 = typeof r2 == "string" ? r2 : r2.source;
6627 + return o2 = o2.replace(m2.caret, "$1"), t2 = t2.replace(i, o2), n;
6628 + }, getRegex: () => new RegExp(t2, e2) };
6629 + return n;
6630 + }
6631 + var we = ((l4 = "") => {
6629 6632 try {
6630 6633 return !!new RegExp("(?<=1)(?<!1)" + l4);
6631 6634 } catch {
6632 6635 return false;
@@ -6631,80 +6634,92 @@
6631 6634 } catch {
6632 6635 return false;
6633 6636 }
6634 6637 })();
6635 - var m2 = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (l4) => new RegExp(`^( {0,3}${l4})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}#`), htmlBeginRegex: (l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}<(?:[a-z].*>|!--)`, "i"), blockquoteBeginRegex: (l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}>`) };
6636 - var Te = /^(?:[ \t]*(?:\n|$))+/;
6637 - var Oe = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
6638 - var we = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
6639 - var I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
6640 - var ye = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
6641 - var Q = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
6642 - var ie = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
6643 - var oe = d2(ie).replace(/bull/g, Q).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
6644 - var Pe = d2(ie).replace(/bull/g, Q).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
6645 - var j2 = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
6646 - var Se = /^[^\n]+/;
6647 - var F = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
6648 - var $e = d2(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", F).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
6649 - var Le = d2(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Q).getRegex();
6650 - var v2 = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
6651 - var U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
6652 - var _e = d2("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", U).replace("tag", v2).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
6653 - var ae = d2(j2).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v2).getRegex();
6654 - var Me = d2(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ae).getRegex();
6655 - var K = { blockquote: Me, code: Oe, def: $e, fences: we, heading: ye, hr: I, html: _e, lheading: oe, list: Le, newline: Te, paragraph: ae, table: _, text: Se };
6656 - var re = d2("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v2).getRegex();
6657 - var ze = { ...K, lheading: Pe, table: re, paragraph: d2(j2).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", re).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v2).getRegex() };
6658 - var Ee = { ...K, html: d2(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", U).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: _, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: d2(j2).replace("hr", I).replace("heading", ` *#{1,6} *[^
6659 -]`).replace("lheading", oe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
6660 - var Ae = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
6661 - var Ce = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
6662 - var le = /^( {2,}|\\)\n(?!\s*$)/;
6663 - var Ie = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
6664 - var E = /[\p{P}\p{S}]/u;
6665 - var H2 = /[\s\p{P}\p{S}]/u;
6666 - var W = /[^\s\p{P}\p{S}]/u;
6667 - var Be = d2(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, H2).getRegex();
6668 - var ue = /(?!~)[\p{P}\p{S}]/u;
6669 - var De = /(?!~)[\s\p{P}\p{S}]/u;
6670 - var qe = /(?:[^\s\p{P}\p{S}]|~)/u;
6671 - var ve = d2(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Re ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
6672 - var pe = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
6673 - var He = d2(pe, "u").replace(/punct/g, E).getRegex();
6674 - var Ze = d2(pe, "u").replace(/punct/g, ue).getRegex();
6675 - var ce = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
6676 - var Ge = d2(ce, "gu").replace(/notPunctSpace/g, W).replace(/punctSpace/g, H2).replace(/punct/g, E).getRegex();
6677 - var Ne = d2(ce, "gu").replace(/notPunctSpace/g, qe).replace(/punctSpace/g, De).replace(/punct/g, ue).getRegex();
6678 - var Qe = d2("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, W).replace(/punctSpace/g, H2).replace(/punct/g, E).getRegex();
6679 - var je = d2(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, E).getRegex();
6680 - var Fe = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)";
6681 - var Ue = d2(Fe, "gu").replace(/notPunctSpace/g, W).replace(/punctSpace/g, H2).replace(/punct/g, E).getRegex();
6682 - var Ke = d2(/\\(punct)/, "gu").replace(/punct/g, E).getRegex();
6683 - var We = d2(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();
6684 - var Xe = d2(U).replace("(?:-->|$)", "-->").getRegex();
6685 - var Je = d2("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Xe).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
6686 - var q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/;
6687 - var Ve = d2(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
6688 - var he = d2(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", F).getRegex();
6689 - var ke = d2(/^!?\[(ref)\](?:\[\])?/).replace("ref", F).getRegex();
6690 - var Ye = d2("reflink|nolink(?!\\()", "g").replace("reflink", he).replace("nolink", ke).getRegex();
6691 - var se = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
6692 - var X = { _backpedal: _, anyPunctuation: Ke, autolink: We, blockSkip: ve, br: le, code: Ce, del: _, delLDelim: _, delRDelim: _, emStrongLDelim: He, emStrongRDelimAst: Ge, emStrongRDelimUnd: Qe, escape: Ae, link: Ve, nolink: ke, punctuation: Be, reflink: he, reflinkSearch: Ye, tag: Je, text: Ie, url: _ };
6693 - var et = { ...X, link: d2(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: d2(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() };
6694 - var N2 = { ...X, emStrongRDelimAst: Ne, emStrongLDelim: Ze, delLDelim: je, delRDelim: Ue, url: d2(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", se).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: d2(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", se).getRegex() };
6695 - var tt = { ...N2, br: d2(le).replace("{2,}", "*").getRegex(), text: d2(N2.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
6696 - var B = { normal: K, gfm: ze, pedantic: Ee };
6697 - var A = { normal: X, gfm: N2, breaks: tt, pedantic: et };
6698 - var nt = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" };
6699 - var de = (l4) => nt[l4];
6700 - function O(l4, e2) {
6638 + var m2 = { codeRemoveIndent: /^(?: {0,3}\t| {1,4})/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, endingSpaceTabChar: /[ \t]$/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (l4) => new RegExp(`^( {0,3}${l4})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: I((l4) => new RegExp(`^ {0,${l4}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: I((l4) => new RegExp(`^ {0,${l4}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)), fencesBeginRegex: I((l4) => new RegExp(`^ {0,${l4}}(?:\`\`\`|~~~)`)), headingBeginRegex: I((l4) => new RegExp(`^ {0,${l4}}#`)), htmlBeginRegex: I((l4) => new RegExp(`^ {0,${l4}}(?:</?(?:${H2})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")), blockquoteBeginRegex: I((l4) => new RegExp(`^ {0,${l4}}>`)) };
6639 + var ye = /^(?:[ \t]*(?:\n|$))+/;
6640 + var Pe = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
6641 + var Se = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
6642 + var v2 = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
6643 + var _e = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
6644 + var K = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
6645 + var le = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
6646 + var ue = d(le).replace(/bull/g, K).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
6647 + var $e = d(le).replace(/bull/g, K).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
6648 + var W = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/;
6649 + var Le = /^[^\n]+/;
6650 + var X = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
6651 + var ze = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", X).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
6652 + var Ee = d(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, K).getRegex();
6653 + var H2 = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
6654 + var J = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
6655 + var Me = d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", J).replace("tag", H2).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
6656 + var pe = (l4) => d(W).replace("hr", v2).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", l4).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H2).getRegex();
6657 + var Ae = pe(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/);
6658 + var Ie = pe(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/);
6659 + var Ce = d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ie).getRegex();
6660 + var V = { blockquote: Ce, code: Pe, def: ze, fences: Se, heading: _e, hr: v2, html: Me, lheading: ue, list: Ee, newline: ye, paragraph: Ae, table: E2, text: Le };
6661 + var ie = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", v2).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H2).getRegex();
6662 + var Be = { ...V, lheading: $e, table: ie, paragraph: d(W).replace("hr", v2).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ie).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H2).getRegex() };
6663 + var De = { ...V, html: d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", J).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: E2, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: d(W).replace("hr", v2).replace("heading", ` *#{1,6} *[^
6664 +]`).replace("lheading", ue).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
6665 + var qe = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
6666 + var ve = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
6667 + var ce = /^( {2,}|\\)\n(?!\s*$)[ \t]*/;
6668 + var He = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
6669 + var _ = /[\p{P}\p{S}]/u;
6670 + var C2 = /[\s\p{P}\p{S}]/u;
6671 + var Z = /[^\s\p{P}\p{S}]/u;
6672 + var Ze = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, C2).getRegex();
6673 + var Ge = /[\p{Pi}\p{Ps}"']/u;
6674 + var he = /(?!~)[\p{P}\p{S}]/u;
6675 + var Qe = /(?!~)[\s\p{P}\p{S}]/u;
6676 + var Ne = /(?:[^\s\p{P}\p{S}]|~)/u;
6677 + var je = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", we ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
6678 + var de = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
6679 + var Ue = d(de, "u").replace(/punct/g, _).getRegex();
6680 + var Fe = d(de, "u").replace(/punct/g, he).getRegex();
6681 + var Ke = /^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/;
6682 + var We = d(Ke, "u").replace(/openQuote/g, Ge).replace(/punct/g, _).getRegex();
6683 + var ke = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
6684 + var Xe = d(ke, "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C2).replace(/punct/g, _).getRegex();
6685 + var Je = d(ke, "gu").replace(/notPunctSpace/g, Ne).replace(/punctSpace/g, Qe).replace(/punct/g, he).getRegex();
6686 + var Ve = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)";
6687 + var Ye = d(Ve, "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C2).replace(/punct/g, _).getRegex();
6688 + var et = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C2).replace(/punct/g, _).getRegex();
6689 + var tt = "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)";
6690 + var nt = d(tt, "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C2).replace(/punct/g, _).getRegex();
6691 + var rt = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, _).getRegex();
6692 + var st = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)";
6693 + var it = d(st, "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C2).replace(/punct/g, _).getRegex();
6694 + var ot = d(/\\(punct)/, "gu").replace(/punct/g, _).getRegex();
6695 + var at = d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();
6696 + var lt = d(J).replace("(?:-->|$)", "-->").getRegex();
6697 + var ut = d("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", lt).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
6698 + var ge = /\[(?:\\[\s\S]|[^\[\]\\])*\]/;
6699 + var N2 = d(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", ge).getRegex();
6700 + var pt = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", N2).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
6701 + var ct = d(/^!?\[(label)\]\[(ref)\]/).replace("label", N2).replace("ref", X).getRegex();
6702 + var ht = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", X).getRegex();
6703 + var oe = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/;
6704 + var dt = d(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", ge).getRegex();
6705 + var kt = d("reflink|nolink(?!\\()", "g").replace("reflink", d(/^!?\[(label)\]\[(ref)\]/).replace("label", dt).replace("ref", oe).getRegex()).replace("nolink", d(/^!?\[(ref)\](?:\[\])?/).replace("ref", oe).getRegex()).getRegex();
6706 + var ae = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
6707 + var Y = { _backpedal: E2, anyPunctuation: ot, autolink: at, blockSkip: je, br: ce, code: ve, del: E2, delLDelim: E2, delRDelim: E2, emStrongLDelim: Ue, emStrongRDelimAst: Xe, emStrongRDelimUnd: et, escape: qe, link: pt, nolink: ht, punctuation: Ze, reflink: ct, reflinkSearch: kt, tag: ut, text: He, url: E2 };
6708 + var gt = { ...Y, emStrongLDelim: We, emStrongRDelimAst: Ye, emStrongRDelimUnd: nt, link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", N2).getRegex(), reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", N2).getRegex() };
6709 + var F = { ...Y, emStrongRDelimAst: Je, emStrongLDelim: Fe, delLDelim: rt, delRDelim: it, url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ae).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: d(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ae).getRegex() };
6710 + var ft = { ...F, br: d(ce).replace("{2,}", "*").getRegex(), text: d(F.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
6711 + var G = { normal: V, gfm: Be, pedantic: De };
6712 + var B = { normal: Y, gfm: F, breaks: ft, pedantic: gt };
6713 + var mt = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" };
6714 + var fe = (l4) => mt[l4];
6715 + function R2(l4, e2) {
6701 6716 if (e2) {
6702 - if (m2.escapeTest.test(l4)) return l4.replace(m2.escapeReplace, de);
6703 - } else if (m2.escapeTestNoEncode.test(l4)) return l4.replace(m2.escapeReplaceNoEncode, de);
6717 + if (m2.escapeTest.test(l4)) return l4.replace(m2.escapeReplace, fe);
6718 + } else if (m2.escapeTestNoEncode.test(l4)) return l4.replace(m2.escapeReplaceNoEncode, fe);
6704 6719 return l4;
6705 6720 }
6706 - function J(l4) {
6721 + function ee(l4) {
6707 6722 try {
6708 6723 l4 = encodeURI(l4).replace(m2.percentDecode, "%");
6709 6724 } catch {
6710 6725 return null;
@@ -6710,74 +6725,109 @@
6710 6725 return null;
6711 6726 }
6712 6727 return l4;
6713 6728 }
6714 - function V(l4, e2) {
6715 - let t3 = l4.replace(m2.findPipe, (r2, i2, o3) => {
6716 - let u2 = false, a2 = i2;
6717 - for (; --a2 >= 0 && o3[a2] === "\\"; ) u2 = !u2;
6718 - return u2 ? "|" : " |";
6719 - }), n2 = t3.split(m2.splitPipe), s2 = 0;
6720 - if (n2[0].trim() || n2.shift(), n2.length > 0 && !n2.at(-1)?.trim() && n2.pop(), e2) if (n2.length > e2) n2.splice(e2);
6721 - else for (; n2.length < e2; ) n2.push("");
6722 - for (; s2 < n2.length; s2++) n2[s2] = n2[s2].trim().replace(m2.slashPipe, "|");
6723 - return n2;
6729 + function te(l4, e2) {
6730 + let t2 = l4.replace(m2.findPipe, (r2, o2, s) => {
6731 + let u = false, a = o2;
6732 + for (; --a >= 0 && s[a] === "\\"; ) u = !u;
6733 + return u ? "|" : " |";
6734 + }), n = t2.split(m2.splitPipe), i = 0;
6735 + if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e2) if (n.length > e2) n.splice(e2);
6736 + else for (; n.length < e2; ) n.push("");
6737 + for (; i < n.length; i++) n[i] = n[i].trim().replace(m2.slashPipe, "|");
6738 + return n;
6724 6739 }
6725 - function $2(l4, e2, t3) {
6726 - let n2 = l4.length;
6727 - if (n2 === 0) return "";
6728 - let s2 = 0;
6729 - for (; s2 < n2; ) {
6730 - let r2 = l4.charAt(n2 - s2 - 1);
6731 - if (r2 === e2 && !t3) s2++;
6732 - else if (r2 !== e2 && t3) s2++;
6740 + function $2(l4, e2, t2) {
6741 + let n = l4.length;
6742 + if (n === 0) return "";
6743 + let i = 0;
6744 + for (; i < n; ) {
6745 + let r2 = l4.charAt(n - i - 1);
6746 + if (r2 === e2 && !t2) i++;
6747 + else if (r2 !== e2 && t2) i++;
6733 6748 else break;
6734 6749 }
6735 - return l4.slice(0, n2 - s2);
6750 + return l4.slice(0, n - i);
6736 6751 }
6737 - function Y(l4) {
6752 + function ne(l4) {
6738 6753 let e2 = l4.split(`
6739 -`), t3 = e2.length - 1;
6740 - for (; t3 >= 0 && m2.blankLine.test(e2[t3]); ) t3--;
6741 - return e2.length - t3 <= 2 ? l4 : e2.slice(0, t3 + 1).join(`
6754 +`), t2 = e2.length - 1;
6755 + for (; t2 >= 0 && m2.blankLine.test(e2[t2]); ) t2--;
6756 + return e2.length - t2 <= 2 ? l4 : e2.slice(0, t2 + 1).join(`
6742 6757 `);
6743 6758 }
6744 - function ge(l4, e2) {
6759 + function D2(l4) {
6760 + return l4.toLowerCase().toUpperCase().toLowerCase();
6761 + }
6762 + function me(l4, e2) {
6745 6763 if (l4.indexOf(e2[1]) === -1) return -1;
6746 - let t3 = 0;
6747 - for (let n2 = 0; n2 < l4.length; n2++) if (l4[n2] === "\\") n2++;
6748 - else if (l4[n2] === e2[0]) t3++;
6749 - else if (l4[n2] === e2[1] && (t3--, t3 < 0)) return n2;
6750 - return t3 > 0 ? -2 : -1;
6764 + let t2 = 0;
6765 + for (let n = 0; n < l4.length; n++) if (l4[n] === "\\") n++;
6766 + else if (l4[n] === e2[0]) t2++;
6767 + else if (l4[n] === e2[1] && (t2--, t2 < 0)) return n;
6768 + return t2 > 0 ? -2 : -1;
6751 6769 }
6752 - function fe(l4, e2 = 0) {
6753 - let t3 = e2, n2 = "";
6754 - for (let s2 of l4) if (s2 === " ") {
6755 - let r2 = 4 - t3 % 4;
6756 - n2 += " ".repeat(r2), t3 += r2;
6757 - } else n2 += s2, t3++;
6758 - return n2;
6770 + function xe(l4, e2 = 0) {
6771 + let t2 = e2, n = "";
6772 + for (let i of l4) if (i === " ") {
6773 + let r2 = 4 - t2 % 4;
6774 + n += " ".repeat(r2), t2 += r2;
6775 + } else n += i, t2++;
6776 + return n;
6759 6777 }
6760 - function me(l4, e2, t3, n2, s2) {
6761 - let r2 = e2.href, i2 = e2.title || null, o3 = l4[1].replace(s2.other.outputLinkReplace, "$1");
6762 - n2.state.inLink = true;
6763 - let u2 = { type: l4[0].charAt(0) === "!" ? "image" : "link", raw: t3, href: r2, title: i2, text: o3, tokens: n2.inlineTokens(o3) };
6764 - return n2.state.inLink = false, u2;
6778 + function be(l4, e2, t2, n, i) {
6779 + let r2 = e2.href, o2 = e2.title || null, s = l4[1].replace(i.other.outputLinkReplace, "$1"), u = l4[0].charAt(0) === "!";
6780 + n.state.inLink = true;
6781 + let a = n.state.linkEmitted, p2 = n.state.inRawBlock;
6782 + n.state.linkEmitted = false;
6783 + let c2 = n.inlineTokens(s), h = n.state.linkEmitted;
6784 + if (n.state.linkEmitted = a, n.state.inLink = false, !u) {
6785 + if (h) {
6786 + n.state.inRawBlock = p2;
6787 + return;
6788 + }
6789 + n.state.linkEmitted = true;
6790 + }
6791 + return { type: u ? "image" : "link", raw: t2, href: r2, title: o2, text: s, tokens: c2 };
6765 6792 }
6766 - function rt(l4, e2, t3) {
6767 - let n2 = l4.match(t3.other.indentCodeCompensation);
6768 - if (n2 === null) return e2;
6769 - let s2 = n2[1];
6793 + function xt(l4, e2, t2) {
6794 + let n = l4.match(t2.other.indentCodeCompensation);
6795 + if (n === null) return e2;
6796 + let i = n[1];
6770 6797 return e2.split(`
6771 6798 `).map((r2) => {
6772 - let i2 = r2.match(t3.other.beginningSpace);
6773 - if (i2 === null) return r2;
6774 - let [o3] = i2;
6775 - return o3.length >= s2.length ? r2.slice(s2.length) : r2;
6799 + let o2 = r2.match(t2.other.beginningSpace);
6800 + if (o2 === null) return r2;
6801 + let [s] = o2;
6802 + return r2.slice(Math.min(s.length, i.length));
6776 6803 }).join(`
6777 6804 `);
6778 6805 }
6779 - var w2 = class {
6806 + function Re(l4, e2, t2, n) {
6807 + if (!e2.includes("<")) return false;
6808 + for (let i = 0; i < e2.length; i++) {
6809 + if (e2[i] === "\\") {
6810 + i++;
6811 + continue;
6812 + }
6813 + if (e2[i] === "`") {
6814 + let s = n.inline.code.exec(e2.slice(i));
6815 + if (s) {
6816 + i += s[0].length - 1;
6817 + continue;
6818 + }
6819 + }
6820 + if (e2[i] !== "<") continue;
6821 + let r2 = l4.slice(t2 + i), o2 = n.inline.tag.exec(r2) || n.inline.autolink.exec(r2);
6822 + if (o2) {
6823 + if (o2[0].length > e2.length - i) return true;
6824 + i += o2[0].length - 1;
6825 + }
6826 + }
6827 + return false;
6828 + }
6829 + var y2 = class {
6780 6830 options;
6781 6831 rules;
6782 6832 lexer;
6783 6833 constructor(e2) {
@@ -6783,319 +6833,326 @@
6783 6833 constructor(e2) {
6784 6834 this.options = e2 || T;
6785 6835 }
6786 6836 space(e2) {
6787 - let t3 = this.rules.block.newline.exec(e2);
6788 - if (t3 && t3[0].length > 0) return { type: "space", raw: t3[0] };
6837 + let t2 = this.rules.block.newline.exec(e2);
6838 + if (t2 && t2[0].length > 0) return { type: "space", raw: t2[0] };
6789 6839 }
6790 6840 code(e2) {
6791 - let t3 = this.rules.block.code.exec(e2);
6792 - if (t3) {
6793 - let n2 = this.options.pedantic ? t3[0] : Y(t3[0]), s2 = n2.replace(this.rules.other.codeRemoveIndent, "");
6794 - return { type: "code", raw: n2, codeBlockStyle: "indented", text: s2 };
6841 + let t2 = this.rules.block.code.exec(e2);
6842 + if (t2) {
6843 + let n = this.options.pedantic ? t2[0] : ne(t2[0]), i = n.replace(this.rules.other.codeRemoveIndent, "");
6844 + return { type: "code", raw: n, codeBlockStyle: "indented", text: i };
6795 6845 }
6796 6846 }
6797 6847 fences(e2) {
6798 - let t3 = this.rules.block.fences.exec(e2);
6799 - if (t3) {
6800 - let n2 = t3[0], s2 = rt(n2, t3[3] || "", this.rules);
6801 - return { type: "code", raw: n2, lang: t3[2] ? t3[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t3[2], text: s2 };
6848 + let t2 = this.rules.block.fences.exec(e2);
6849 + if (t2) {
6850 + let n = t2[0], i = xt(n, t2[3] || "", this.rules);
6851 + return { type: "code", raw: n, lang: t2[2] ? t2[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t2[2], text: i };
6802 6852 }
6803 6853 }
6804 6854 heading(e2) {
6805 - let t3 = this.rules.block.heading.exec(e2);
6806 - if (t3) {
6807 - let n2 = t3[2].trim();
6808 - if (this.rules.other.endingHash.test(n2)) {
6809 - let s2 = $2(n2, "#");
6810 - (this.options.pedantic || !s2 || this.rules.other.endingSpaceChar.test(s2)) && (n2 = s2.trim());
6855 + let t2 = this.rules.block.heading.exec(e2);
6856 + if (t2) {
6857 + let n = t2[2].trim();
6858 + if (this.rules.other.endingHash.test(n)) {
6859 + let i = $2(n, "#");
6860 + (this.options.pedantic || !i || this.rules.other.endingSpaceTabChar.test(i)) && (n = i.trim());
6811 6861 }
6812 - return { type: "heading", raw: $2(t3[0], `
6813 -`), depth: t3[1].length, text: n2, tokens: this.lexer.inline(n2) };
6862 + return { type: "heading", raw: $2(t2[0], `
6863 +`), depth: t2[1].length, text: n, tokens: this.lexer.inline(n) };
6814 6864 }
6815 6865 }
6816 6866 hr(e2) {
6817 - let t3 = this.rules.block.hr.exec(e2);
6818 - if (t3) return { type: "hr", raw: $2(t3[0], `
6867 + let t2 = this.rules.block.hr.exec(e2);
6868 + if (t2) return { type: "hr", raw: $2(t2[0], `
6819 6869 `) };
6820 6870 }
6821 6871 blockquote(e2) {
6822 - let t3 = this.rules.block.blockquote.exec(e2);
6823 - if (t3) {
6824 - let n2 = $2(t3[0], `
6872 + let t2 = this.rules.block.blockquote.exec(e2);
6873 + if (t2) {
6874 + let n = $2(t2[0], `
6825 6875 `).split(`
6826 -`), s2 = "", r2 = "", i2 = [];
6827 - for (; n2.length > 0; ) {
6828 - let o3 = false, u2 = [], a2;
6829 - for (a2 = 0; a2 < n2.length; a2++) if (this.rules.other.blockquoteStart.test(n2[a2])) u2.push(n2[a2]), o3 = true;
6830 - else if (!o3) u2.push(n2[a2]);
6876 +`), i = "", r2 = "", o2 = [];
6877 + for (; n.length > 0; ) {
6878 + let s = false, u = [], a;
6879 + for (a = 0; a < n.length; a++) if (this.rules.other.blockquoteStart.test(n[a])) u.push(n[a]), s = true;
6880 + else if (!s) u.push(n[a]);
6831 6881 else break;
6832 - n2 = n2.slice(a2);
6833 - let c2 = u2.join(`
6834 -`), p2 = c2.replace(this.rules.other.blockquoteSetextReplace, `
6882 + n = n.slice(a);
6883 + let p2 = u.join(`
6884 +`), c2 = p2.replace(this.rules.other.blockquoteSetextReplace, `
6835 6885 $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
6836 - s2 = s2 ? `${s2}
6837 -${c2}` : c2, r2 = r2 ? `${r2}
6838 -${p2}` : p2;
6839 - let k2 = this.lexer.state.top;
6840 - if (this.lexer.state.top = true, this.lexer.blockTokens(p2, i2, true), this.lexer.state.top = k2, n2.length === 0) break;
6841 - let h2 = i2.at(-1);
6842 - if (h2?.type === "code") break;
6843 - if (h2?.type === "blockquote") {
6844 - let R = h2, f2 = R.raw + `
6845 -` + n2.join(`
6846 -`), S2 = this.blockquote(f2);
6847 - i2[i2.length - 1] = S2, s2 = s2.substring(0, s2.length - R.raw.length) + S2.raw, r2 = r2.substring(0, r2.length - R.text.length) + S2.text;
6886 + i = i ? `${i}
6887 +${p2}` : p2, r2 = r2 ? `${r2}
6888 +${c2}` : c2;
6889 + let h = this.lexer.state.top;
6890 + if (this.lexer.state.top = true, this.lexer.blockTokens(c2, o2, true), this.lexer.state.top = h, n.length === 0) break;
6891 + let k2 = o2.at(-1);
6892 + if (k2?.type === "code") break;
6893 + if (k2?.type === "blockquote") {
6894 + let O = k2, g2 = n.join(`
6895 +`), w2 = O.raw + `
6896 +` + g2.replace(this.rules.other.blockquoteSetextReplace2, ""), z = this.blockquote(w2);
6897 + o2[o2.length - 1] = z, i = `${i}
6898 +${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + z.text;
6848 6899 break;
6849 - } else if (h2?.type === "list") {
6850 - let R = h2, f2 = R.raw + `
6851 -` + n2.join(`
6852 -`), S2 = this.list(f2);
6853 - i2[i2.length - 1] = S2, s2 = s2.substring(0, s2.length - h2.raw.length) + S2.raw, r2 = r2.substring(0, r2.length - R.raw.length) + S2.raw, n2 = f2.substring(i2.at(-1).raw.length).split(`
6900 + } else if (k2?.type === "list") {
6901 + let O = k2, g2 = O.raw + `
6902 +` + n.join(`
6903 +`), w2 = this.list(g2);
6904 + o2[o2.length - 1] = w2, i = i.substring(0, i.length - k2.raw.length) + w2.raw, r2 = r2.substring(0, r2.length - O.raw.length) + w2.raw, n = g2.substring(o2.at(-1).raw.length).split(`
6854 6905 `);
6855 6906 continue;
6856 6907 }
6857 6908 }
6858 - return { type: "blockquote", raw: s2, tokens: i2, text: r2 };
6909 + return { type: "blockquote", raw: i, tokens: o2, text: r2 };
6859 6910 }
6860 6911 }
6861 6912 list(e2) {
6862 - let t3 = this.rules.block.list.exec(e2);
6863 - if (t3) {
6864 - let n2 = t3[1].trim(), s2 = n2.length > 1, r2 = { type: "list", raw: "", ordered: s2, start: s2 ? +n2.slice(0, -1) : "", loose: false, items: [] };
6865 - n2 = s2 ? `\\d{1,9}\\${n2.slice(-1)}` : `\\${n2}`, this.options.pedantic && (n2 = s2 ? n2 : "[*+-]");
6866 - let i2 = this.rules.other.listItemRegex(n2), o3 = false;
6913 + let t2 = this.rules.block.list.exec(e2);
6914 + if (t2) {
6915 + let n = t2[1].trim(), i = n.length > 1, r2 = { type: "list", raw: "", ordered: i, start: i ? +n.slice(0, -1) : "", loose: false, items: [] };
6916 + n = i ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = i ? n : "[*+-]");
6917 + let o2 = this.rules.other.listItemRegex(n), s = false;
6867 6918 for (; e2; ) {
6868 - let a2 = false, c2 = "", p2 = "";
6869 - if (!(t3 = i2.exec(e2)) || this.rules.block.hr.test(e2)) break;
6870 - c2 = t3[0], e2 = e2.substring(c2.length);
6871 - let k2 = fe(t3[2].split(`
6872 -`, 1)[0], t3[1].length), h2 = e2.split(`
6873 -`, 1)[0], R = !k2.trim(), f2 = 0;
6874 - if (this.options.pedantic ? (f2 = 2, p2 = k2.trimStart()) : R ? f2 = t3[1].length + 1 : (f2 = k2.search(this.rules.other.nonSpaceChar), f2 = f2 > 4 ? 1 : f2, p2 = k2.slice(f2), f2 += t3[1].length), R && this.rules.other.blankLine.test(h2) && (c2 += h2 + `
6875 -`, e2 = e2.substring(h2.length + 1), a2 = true), !a2) {
6876 - let S2 = this.rules.other.nextBulletRegex(f2), ee = this.rules.other.hrRegex(f2), te = this.rules.other.fencesBeginRegex(f2), ne = this.rules.other.headingBeginRegex(f2), xe = this.rules.other.htmlBeginRegex(f2), be = this.rules.other.blockquoteBeginRegex(f2);
6919 + let a = false, p2 = "", c2 = "";
6920 + if (!(t2 = o2.exec(e2)) || this.rules.block.hr.test(e2)) break;
6921 + p2 = t2[0], e2 = e2.substring(p2.length);
6922 + let h = xe(t2[2].split(`
6923 +`, 1)[0], t2[1].length), k2 = e2.split(`
6924 +`, 1)[0], O = !h.trim(), g2 = 0;
6925 + if (this.options.pedantic ? (g2 = 2, c2 = h.trimStart()) : O ? g2 = t2[1].length + 1 : (g2 = h.search(this.rules.other.nonSpaceChar), g2 = g2 > 4 ? 1 : g2, c2 = h.slice(g2), g2 += t2[1].length), O && this.rules.other.blankLine.test(k2) && (p2 += k2 + `
6926 +`, e2 = e2.substring(k2.length + 1), a = true), !a) {
6927 + let w2 = this.rules.other.nextBulletRegex(g2), z = this.rules.other.hrRegex(g2), re = this.rules.other.fencesBeginRegex(g2), se = this.rules.other.headingBeginRegex(g2), Te = this.rules.other.htmlBeginRegex(g2), Oe = this.rules.other.blockquoteBeginRegex(g2);
6877 6928 for (; e2; ) {
6878 - let Z = e2.split(`
6879 -`, 1)[0], C;
6880 - if (h2 = Z, this.options.pedantic ? (h2 = h2.replace(this.rules.other.listReplaceNesting, " "), C = h2) : C = h2.replace(this.rules.other.tabCharGlobal, " "), te.test(h2) || ne.test(h2) || xe.test(h2) || be.test(h2) || S2.test(h2) || ee.test(h2)) break;
6881 - if (C.search(this.rules.other.nonSpaceChar) >= f2 || !h2.trim()) p2 += `
6882 -` + C.slice(f2);
6929 + let j2 = e2.split(`
6930 +`, 1)[0], q2;
6931 + if (k2 = j2, this.options.pedantic ? (k2 = k2.replace(this.rules.other.listReplaceNesting, " "), q2 = k2) : q2 = k2.replace(this.rules.other.tabCharGlobal, " "), re.test(k2) || se.test(k2) || Te.test(k2) || Oe.test(k2) || w2.test(k2) || z.test(k2)) break;
6932 + if (q2.search(this.rules.other.nonSpaceChar) >= g2 || !k2.trim()) c2 += `
6933 +` + q2.slice(g2);
6883 6934 else {
6884 - if (R || k2.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || te.test(k2) || ne.test(k2) || ee.test(k2)) break;
6885 - p2 += `
6886 -` + h2;
6935 + if (O || h.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || re.test(h) || se.test(h) || z.test(h)) break;
6936 + c2 += `
6937 +` + k2;
6887 6938 }
6888 - R = !h2.trim(), c2 += Z + `
6889 -`, e2 = e2.substring(Z.length + 1), k2 = C.slice(f2);
6939 + O = !k2.trim(), p2 += j2 + `
6940 +`, e2 = e2.substring(j2.length + 1), h = q2.slice(g2);
6890 6941 }
6891 6942 }
6892 - r2.loose || (o3 ? r2.loose = true : this.rules.other.doubleBlankLine.test(c2) && (o3 = true)), r2.items.push({ type: "list_item", raw: c2, task: !!this.options.gfm && this.rules.other.listIsTask.test(p2), loose: false, text: p2, tokens: [] }), r2.raw += c2;
6943 + r2.loose || (s ? r2.loose = true : this.rules.other.doubleBlankLine.test(p2) && (s = true)), r2.items.push({ type: "list_item", raw: p2, task: !!this.options.gfm && this.rules.other.listIsTask.test(c2), loose: false, text: c2, tokens: [] }), r2.raw += p2;
6893 6944 }
6894 - let u2 = r2.items.at(-1);
6895 - if (u2) u2.raw = u2.raw.trimEnd(), u2.text = u2.text.trimEnd();
6945 + let u = r2.items.at(-1);
6946 + if (u) u.raw = u.raw.trimEnd(), u.text = u.text.trimEnd();
6896 6947 else return;
6897 6948 r2.raw = r2.raw.trimEnd();
6898 - for (let a2 of r2.items) {
6899 - this.lexer.state.top = false, a2.tokens = this.lexer.blockTokens(a2.text, []);
6900 - let c2 = a2.tokens[0];
6901 - if (a2.task && (c2?.type === "text" || c2?.type === "paragraph")) {
6902 - a2.text = a2.text.replace(this.rules.other.listReplaceTask, ""), c2.raw = c2.raw.replace(this.rules.other.listReplaceTask, ""), c2.text = c2.text.replace(this.rules.other.listReplaceTask, "");
6903 - for (let k2 = this.lexer.inlineQueue.length - 1; k2 >= 0; k2--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[k2].src)) {
6904 - this.lexer.inlineQueue[k2].src = this.lexer.inlineQueue[k2].src.replace(this.rules.other.listReplaceTask, "");
6949 + for (let a of r2.items) if (this.lexer.state.top = false, a.tokens = this.lexer.blockTokens(a.text, []), !r2.loose) {
6950 + let p2 = a.tokens.filter((h) => h.type === "space"), c2 = p2.length > 0 && p2.some((h) => this.rules.other.anyLine.test(h.raw));
6951 + r2.loose = c2;
6952 + }
6953 + for (let a of r2.items) {
6954 + let p2 = a.tokens[0];
6955 + if (a.task && (p2?.type === "text" || p2?.type === "paragraph")) {
6956 + a.text = a.text.replace(this.rules.other.listReplaceTask, ""), p2.raw = p2.raw.replace(this.rules.other.listReplaceTask, ""), p2.text = p2.text.replace(this.rules.other.listReplaceTask, "");
6957 + for (let h = this.lexer.inlineQueue.length - 1; h >= 0; h--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)) {
6958 + this.lexer.inlineQueue[h].src = this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask, "");
6905 6959 break;
6906 6960 }
6907 - let p2 = this.rules.other.listTaskCheckbox.exec(a2.raw);
6908 - if (p2) {
6909 - let k2 = { type: "checkbox", raw: p2[0] + " ", checked: p2[0] !== "[ ]" };
6910 - a2.checked = k2.checked, r2.loose ? a2.tokens[0] && ["paragraph", "text"].includes(a2.tokens[0].type) && "tokens" in a2.tokens[0] && a2.tokens[0].tokens ? (a2.tokens[0].raw = k2.raw + a2.tokens[0].raw, a2.tokens[0].text = k2.raw + a2.tokens[0].text, a2.tokens[0].tokens.unshift(k2)) : a2.tokens.unshift({ type: "paragraph", raw: k2.raw, text: k2.raw, tokens: [k2] }) : a2.tokens.unshift(k2);
6961 + let c2 = this.rules.other.listTaskCheckbox.exec(a.raw);
6962 + if (c2) {
6963 + let h = { type: "checkbox", raw: c2[0] + " ", checked: c2[0] !== "[ ]" };
6964 + a.checked = h.checked, r2.loose ? a.tokens[0] && ["paragraph", "text"].includes(a.tokens[0].type) && "tokens" in a.tokens[0] && a.tokens[0].tokens ? (a.tokens[0].raw = h.raw + a.tokens[0].raw, a.tokens[0].text = h.raw + a.tokens[0].text, a.tokens[0].tokens.unshift(h)) : a.tokens.unshift({ type: "paragraph", raw: h.raw, text: h.raw, tokens: [h] }) : a.tokens.unshift(h);
6911 6965 }
6912 - } else a2.task && (a2.task = false);
6913 - if (!r2.loose) {
6914 - let p2 = a2.tokens.filter((h2) => h2.type === "space"), k2 = p2.length > 0 && p2.some((h2) => this.rules.other.anyLine.test(h2.raw));
6915 - r2.loose = k2;
6916 - }
6966 + } else a.task && (a.task = false);
6917 6967 }
6918 - if (r2.loose) for (let a2 of r2.items) {
6919 - a2.loose = true;
6920 - for (let c2 of a2.tokens) c2.type === "text" && (c2.type = "paragraph");
6968 + if (r2.loose) for (let a of r2.items) {
6969 + a.loose = true;
6970 + for (let p2 of a.tokens) p2.type === "text" && (p2.type = "paragraph");
6921 6971 }
6922 6972 return r2;
6923 6973 }
6924 6974 }
6925 6975 html(e2) {
6926 - let t3 = this.rules.block.html.exec(e2);
6927 - if (t3) {
6928 - let n2 = Y(t3[0]);
6929 - return { type: "html", block: true, raw: n2, pre: t3[1] === "pre" || t3[1] === "script" || t3[1] === "style", text: n2 };
6976 + let t2 = this.rules.block.html.exec(e2);
6977 + if (t2) {
6978 + let n = ne(t2[0]);
6979 + return { type: "html", block: true, raw: n, pre: t2[1] === "pre" || t2[1] === "script" || t2[1] === "style", text: n };
6930 6980 }
6931 6981 }
6932 6982 def(e2) {
6933 - let t3 = this.rules.block.def.exec(e2);
6934 - if (t3) {
6935 - let n2 = t3[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), s2 = t3[2] ? t3[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r2 = t3[3] ? t3[3].substring(1, t3[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t3[3];
6936 - return { type: "def", tag: n2, raw: $2(t3[0], `
6937 -`), href: s2, title: r2 };
6983 + let t2 = this.rules.block.def.exec(e2);
6984 + if (t2) {
6985 + let n = D2(t2[1]).replace(this.rules.other.multipleSpaceGlobal, " "), i = t2[2] ? t2[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r2 = t2[3] ? t2[3].substring(1, t2[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t2[3];
6986 + return { type: "def", tag: n, raw: $2(t2[0], `
6987 +`), href: i, title: r2 };
6938 6988 }
6939 6989 }
6940 6990 table(e2) {
6941 - let t3 = this.rules.block.table.exec(e2);
6942 - if (!t3 || !this.rules.other.tableDelimiter.test(t3[2])) return;
6943 - let n2 = V(t3[1]), s2 = t3[2].replace(this.rules.other.tableAlignChars, "").split("|"), r2 = t3[3]?.trim() ? t3[3].replace(this.rules.other.tableRowBlankLine, "").split(`
6944 -`) : [], i2 = { type: "table", raw: $2(t3[0], `
6991 + let t2 = this.rules.block.table.exec(e2);
6992 + if (!t2 || !this.rules.other.tableDelimiter.test(t2[2])) return;
6993 + let n = te(t2[1]), i = t2[2].replace(this.rules.other.tableAlignChars, "").split("|"), r2 = t2[3]?.trim() ? t2[3].replace(this.rules.other.tableRowBlankLine, "").split(`
6994 +`) : [], o2 = { type: "table", raw: $2(t2[0], `
6945 6995 `), header: [], align: [], rows: [] };
6946 - if (n2.length === s2.length) {
6947 - for (let o3 of s2) this.rules.other.tableAlignRight.test(o3) ? i2.align.push("right") : this.rules.other.tableAlignCenter.test(o3) ? i2.align.push("center") : this.rules.other.tableAlignLeft.test(o3) ? i2.align.push("left") : i2.align.push(null);
6948 - for (let o3 = 0; o3 < n2.length; o3++) i2.header.push({ text: n2[o3], tokens: this.lexer.inline(n2[o3]), header: true, align: i2.align[o3] });
6949 - for (let o3 of r2) i2.rows.push(V(o3, i2.header.length).map((u2, a2) => ({ text: u2, tokens: this.lexer.inline(u2), header: false, align: i2.align[a2] })));
6950 - return i2;
6996 + if (n.length === i.length) {
6997 + for (let s of i) this.rules.other.tableAlignRight.test(s) ? o2.align.push("right") : this.rules.other.tableAlignCenter.test(s) ? o2.align.push("center") : this.rules.other.tableAlignLeft.test(s) ? o2.align.push("left") : o2.align.push(null);
6998 + for (let s = 0; s < n.length; s++) o2.header.push({ text: n[s], tokens: this.lexer.inline(n[s]), header: true, align: o2.align[s] });
6999 + for (let s of r2) o2.rows.push(te(s, o2.header.length).map((u, a) => ({ text: u, tokens: this.lexer.inline(u), header: false, align: o2.align[a] })));
7000 + return o2;
6951 7001 }
6952 7002 }
6953 7003 lheading(e2) {
6954 - let t3 = this.rules.block.lheading.exec(e2);
6955 - if (t3) {
6956 - let n2 = t3[1].trim();
6957 - return { type: "heading", raw: $2(t3[0], `
6958 -`), depth: t3[2].charAt(0) === "=" ? 1 : 2, text: n2, tokens: this.lexer.inline(n2) };
7004 + let t2 = this.rules.block.lheading.exec(e2);
7005 + if (t2) {
7006 + let n = t2[1].trim();
7007 + return { type: "heading", raw: $2(t2[0], `
7008 +`), depth: t2[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
6959 7009 }
6960 7010 }
6961 7011 paragraph(e2) {
6962 - let t3 = this.rules.block.paragraph.exec(e2);
6963 - if (t3) {
6964 - let n2 = t3[1].charAt(t3[1].length - 1) === `
6965 -` ? t3[1].slice(0, -1) : t3[1];
6966 - return { type: "paragraph", raw: t3[0], text: n2, tokens: this.lexer.inline(n2) };
7012 + let t2 = this.rules.block.paragraph.exec(e2);
7013 + if (t2) {
7014 + let n = t2[1].charAt(t2[1].length - 1) === `
7015 +` ? t2[1].slice(0, -1) : t2[1];
7016 + return { type: "paragraph", raw: t2[0], text: n, tokens: this.lexer.inline(n) };
6967 7017 }
6968 7018 }
6969 7019 text(e2) {
6970 - let t3 = this.rules.block.text.exec(e2);
6971 - if (t3) return { type: "text", raw: t3[0], text: t3[0], tokens: this.lexer.inline(t3[0]) };
7020 + let t2 = this.rules.block.text.exec(e2);
7021 + if (t2) return { type: "text", raw: t2[0], text: t2[0], tokens: this.lexer.inline(t2[0]) };
6972 7022 }
6973 7023 escape(e2) {
6974 - let t3 = this.rules.inline.escape.exec(e2);
6975 - if (t3) return { type: "escape", raw: t3[0], text: t3[1] };
7024 + let t2 = this.rules.inline.escape.exec(e2);
7025 + if (t2) return { type: "escape", raw: t2[0], text: t2[1] };
6976 7026 }
6977 7027 tag(e2) {
6978 - let t3 = this.rules.inline.tag.exec(e2);
6979 - if (t3) return !this.lexer.state.inLink && this.rules.other.startATag.test(t3[0]) ? this.lexer.state.inLink = true : this.lexer.state.inLink && this.rules.other.endATag.test(t3[0]) && (this.lexer.state.inLink = false), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t3[0]) ? this.lexer.state.inRawBlock = true : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t3[0]) && (this.lexer.state.inRawBlock = false), { type: "html", raw: t3[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: false, text: t3[0] };
7028 + let t2 = this.rules.inline.tag.exec(e2);
7029 + if (t2) return !this.lexer.state.inLink && this.rules.other.startATag.test(t2[0]) ? this.lexer.state.inLink = true : this.lexer.state.inLink && this.rules.other.endATag.test(t2[0]) && (this.lexer.state.inLink = false), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t2[0]) ? this.lexer.state.inRawBlock = true : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t2[0]) && (this.lexer.state.inRawBlock = false), { type: "html", raw: t2[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: false, text: t2[0] };
6980 7030 }
6981 7031 link(e2) {
6982 - let t3 = this.rules.inline.link.exec(e2);
6983 - if (t3) {
6984 - let n2 = t3[2].trim();
6985 - if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n2)) {
6986 - if (!this.rules.other.endAngleBracket.test(n2)) return;
6987 - let i2 = $2(n2.slice(0, -1), "\\");
6988 - if ((n2.length - i2.length) % 2 === 0) return;
7032 + let t2 = this.rules.inline.link.exec(e2);
7033 + if (t2) {
7034 + let n = t2[0].charAt(0) === "!" ? 2 : 1;
7035 + if (!this.options.pedantic && Re(e2, t2[1], n, this.rules)) return;
7036 + let i = t2[2].trim();
7037 + if (!this.options.pedantic && this.rules.other.startAngleBracket.test(i)) {
7038 + if (!this.rules.other.endAngleBracket.test(i)) return;
7039 + let s = $2(i.slice(0, -1), "\\");
7040 + if ((i.length - s.length) % 2 === 0) return;
6989 7041 } else {
6990 - let i2 = ge(t3[2], "()");
6991 - if (i2 === -2) return;
6992 - if (i2 > -1) {
6993 - let u2 = (t3[0].indexOf("!") === 0 ? 5 : 4) + t3[1].length + i2;
6994 - t3[2] = t3[2].substring(0, i2), t3[0] = t3[0].substring(0, u2).trim(), t3[3] = "";
7042 + let s = me(t2[2], "()");
7043 + if (s === -2) return;
7044 + if (s > -1) {
7045 + let a = (t2[0].indexOf("!") === 0 ? 5 : 4) + t2[1].length + s;
7046 + t2[2] = t2[2].substring(0, s), t2[0] = t2[0].substring(0, a).trim(), t2[3] = "";
6995 7047 }
6996 7048 }
6997 - let s2 = t3[2], r2 = "";
7049 + let r2 = t2[2], o2 = "";
6998 7050 if (this.options.pedantic) {
6999 - let i2 = this.rules.other.pedanticHrefTitle.exec(s2);
7000 - i2 && (s2 = i2[1], r2 = i2[3]);
7001 - } else r2 = t3[3] ? t3[3].slice(1, -1) : "";
7002 - return s2 = s2.trim(), this.rules.other.startAngleBracket.test(s2) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n2) ? s2 = s2.slice(1) : s2 = s2.slice(1, -1)), me(t3, { href: s2 && s2.replace(this.rules.inline.anyPunctuation, "$1"), title: r2 && r2.replace(this.rules.inline.anyPunctuation, "$1") }, t3[0], this.lexer, this.rules);
7051 + let s = this.rules.other.pedanticHrefTitle.exec(r2);
7052 + s && (r2 = s[1], o2 = s[3]);
7053 + } else o2 = t2[3] ? t2[3].slice(1, -1) : "";
7054 + return r2 = r2.trim(), this.rules.other.startAngleBracket.test(r2) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(i) ? r2 = r2.slice(1) : r2 = r2.slice(1, -1)), be(t2, { href: r2 && r2.replace(this.rules.inline.anyPunctuation, "$1"), title: o2 && o2.replace(this.rules.inline.anyPunctuation, "$1") }, t2[0], this.lexer, this.rules);
7003 7055 }
7004 7056 }
7005 - reflink(e2, t3) {
7006 - let n2;
7007 - if ((n2 = this.rules.inline.reflink.exec(e2)) || (n2 = this.rules.inline.nolink.exec(e2))) {
7008 - let s2 = (n2[2] || n2[1]).replace(this.rules.other.multipleSpaceGlobal, " "), r2 = t3[s2.toLowerCase()];
7009 - if (!r2) {
7010 - let i2 = n2[0].charAt(0);
7011 - return { type: "text", raw: i2, text: i2 };
7057 + reflink(e2, t2) {
7058 + let n;
7059 + if ((n = this.rules.inline.reflink.exec(e2)) || (n = this.rules.inline.nolink.exec(e2))) {
7060 + let i = n[0].charAt(0) === "!" ? 2 : 1;
7061 + if (!this.options.pedantic && Re(e2, n[1], i, this.rules)) return;
7062 + let r2 = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), o2 = t2[D2(r2)];
7063 + if (!o2) {
7064 + let s = n[0].charAt(0);
7065 + return { type: "text", raw: s, text: s };
7012 7066 }
7013 - return me(n2, r2, n2[0], this.lexer, this.rules);
7067 + return be(n, o2, n[0], this.lexer, this.rules);
7014 7068 }
7015 7069 }
7016 - emStrong(e2, t3, n2 = "") {
7017 - let s2 = this.rules.inline.emStrongLDelim.exec(e2);
7018 - if (!s2 || !s2[1] && !s2[2] && !s2[3] && !s2[4] || s2[4] && n2.match(this.rules.other.unicodeAlphaNumeric)) return;
7019 - if (!(s2[1] || s2[3] || "") || !n2 || this.rules.inline.punctuation.exec(n2)) {
7020 - let i2 = [...s2[0]].length - 1, o3, u2, a2 = i2, c2 = 0, p2 = s2[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
7021 - for (p2.lastIndex = 0, t3 = t3.slice(-1 * e2.length + i2); (s2 = p2.exec(t3)) !== null; ) {
7022 - if (o3 = s2[1] || s2[2] || s2[3] || s2[4] || s2[5] || s2[6], !o3) continue;
7023 - if (u2 = [...o3].length, s2[3] || s2[4]) {
7024 - a2 += u2;
7070 + emStrong(e2, t2, n = "") {
7071 + let i = this.rules.inline.emStrongLDelim.exec(e2);
7072 + if (!i || !i[1] && !i[2] && !i[3] && !i[4] || i[4] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
7073 + if (!(i[1] || i[3] || "") || !n || this.rules.inline.punctuation.exec(n)) {
7074 + let o2 = [...i[0]].length - 1, s, u, a = o2, p2 = 0, c2 = i[0][0], h = n === c2, k2 = c2 === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
7075 + for (k2.lastIndex = 0, t2 = t2.slice(-1 * e2.length + o2); (i = k2.exec(t2)) !== null; ) {
7076 + if (s = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !s) continue;
7077 + if (u = [...s].length, i[3] || i[4]) {
7078 + a += u;
7025 7079 continue;
7026 - } else if ((s2[5] || s2[6]) && i2 % 3 && !((i2 + u2) % 3)) {
7027 - c2 += u2;
7028 - continue;
7080 + } else if (i[5] || i[6]) {
7081 + if (o2 % 3 && !((o2 + u) % 3)) {
7082 + p2 += u;
7083 + continue;
7084 + }
7085 + if (h) break;
7029 7086 }
7030 - if (a2 -= u2, a2 > 0) continue;
7031 - u2 = Math.min(u2, u2 + a2 + c2);
7032 - let k2 = [...s2[0]][0].length, h2 = e2.slice(0, i2 + s2.index + k2 + u2);
7033 - if (Math.min(i2, u2) % 2) {
7034 - let f2 = h2.slice(1, -1);
7035 - return { type: "em", raw: h2, text: f2, tokens: this.lexer.inlineTokens(f2) };
7087 + if (a -= u, a > 0) continue;
7088 + u = Math.min(u, u + a + p2);
7089 + let O = [...i[0]][0].length, g2 = e2.slice(0, o2 + i.index + O + u);
7090 + if (Math.min(o2, u) % 2) {
7091 + let z = g2.slice(1, -1);
7092 + return { type: "em", raw: g2, text: z, tokens: this.lexer.inlineTokens(z) };
7036 7093 }
7037 - let R = h2.slice(2, -2);
7038 - return { type: "strong", raw: h2, text: R, tokens: this.lexer.inlineTokens(R) };
7094 + let w2 = g2.slice(2, -2);
7095 + return { type: "strong", raw: g2, text: w2, tokens: this.lexer.inlineTokens(w2) };
7039 7096 }
7040 7097 }
7041 7098 }
7042 7099 codespan(e2) {
7043 - let t3 = this.rules.inline.code.exec(e2);
7044 - if (t3) {
7045 - let n2 = t3[2].replace(this.rules.other.newLineCharGlobal, " "), s2 = this.rules.other.nonSpaceChar.test(n2), r2 = this.rules.other.startingSpaceChar.test(n2) && this.rules.other.endingSpaceChar.test(n2);
7046 - return s2 && r2 && (n2 = n2.substring(1, n2.length - 1)), { type: "codespan", raw: t3[0], text: n2 };
7100 + let t2 = this.rules.inline.code.exec(e2);
7101 + if (t2) {
7102 + let n = t2[2].replace(this.rules.other.newLineCharGlobal, " "), i = this.rules.other.nonSpaceChar.test(n), r2 = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
7103 + return i && r2 && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: t2[0], text: n };
7047 7104 }
7048 7105 }
7049 7106 br(e2) {
7050 - let t3 = this.rules.inline.br.exec(e2);
7051 - if (t3) return { type: "br", raw: t3[0] };
7107 + let t2 = this.rules.inline.br.exec(e2);
7108 + if (t2) return { type: "br", raw: t2[0] };
7052 7109 }
7053 - del(e2, t3, n2 = "") {
7054 - let s2 = this.rules.inline.delLDelim.exec(e2);
7055 - if (!s2) return;
7056 - if (!(s2[1] || "") || !n2 || this.rules.inline.punctuation.exec(n2)) {
7057 - let i2 = [...s2[0]].length - 1, o3, u2, a2 = i2, c2 = this.rules.inline.delRDelim;
7058 - for (c2.lastIndex = 0, t3 = t3.slice(-1 * e2.length + i2); (s2 = c2.exec(t3)) !== null; ) {
7059 - if (o3 = s2[1] || s2[2] || s2[3] || s2[4] || s2[5] || s2[6], !o3 || (u2 = [...o3].length, u2 !== i2)) continue;
7060 - if (s2[3] || s2[4]) {
7061 - a2 += u2;
7110 + del(e2, t2, n = "") {
7111 + let i = this.rules.inline.delLDelim.exec(e2);
7112 + if (!i) return;
7113 + if (!(i[1] || "") || !n || this.rules.inline.punctuation.exec(n)) {
7114 + let o2 = [...i[0]].length - 1, s, u, a = o2, p2 = this.rules.inline.delRDelim;
7115 + for (p2.lastIndex = 0, t2 = t2.slice(-1 * e2.length + o2); (i = p2.exec(t2)) !== null; ) {
7116 + if (s = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !s || (u = [...s].length, u !== o2)) continue;
7117 + if (i[3] || i[4]) {
7118 + a += u;
7062 7119 continue;
7063 7120 }
7064 - if (a2 -= u2, a2 > 0) continue;
7065 - u2 = Math.min(u2, u2 + a2);
7066 - let p2 = [...s2[0]][0].length, k2 = e2.slice(0, i2 + s2.index + p2 + u2), h2 = k2.slice(i2, -i2);
7067 - return { type: "del", raw: k2, text: h2, tokens: this.lexer.inlineTokens(h2) };
7121 + if (a -= u, a > 0) continue;
7122 + u = Math.min(u, u + a);
7123 + let c2 = [...i[0]][0].length, h = e2.slice(0, o2 + i.index + c2 + u), k2 = h.slice(o2, -o2);
7124 + return { type: "del", raw: h, text: k2, tokens: this.lexer.inlineTokens(k2) };
7068 7125 }
7069 7126 }
7070 7127 }
7071 7128 autolink(e2) {
7072 - let t3 = this.rules.inline.autolink.exec(e2);
7073 - if (t3) {
7074 - let n2, s2;
7075 - return t3[2] === "@" ? (n2 = t3[1], s2 = "mailto:" + n2) : (n2 = t3[1], s2 = n2), { type: "link", raw: t3[0], text: n2, href: s2, tokens: [{ type: "text", raw: n2, text: n2 }] };
7129 + let t2 = this.rules.inline.autolink.exec(e2);
7130 + if (t2) {
7131 + let n, i;
7132 + return t2[2] === "@" ? (n = t2[1], i = "mailto:" + n) : (n = t2[1], i = n), { type: "link", raw: t2[0], text: n, href: i, autolink: true, tokens: [{ type: "text", raw: n, text: n }] };
7076 7133 }
7077 7134 }
7078 7135 url(e2) {
7079 - let t3;
7080 - if (t3 = this.rules.inline.url.exec(e2)) {
7081 - let n2, s2;
7082 - if (t3[2] === "@") n2 = t3[0], s2 = "mailto:" + n2;
7136 + let t2;
7137 + if (t2 = this.rules.inline.url.exec(e2)) {
7138 + let n, i;
7139 + if (t2[2] === "@") n = t2[0], i = "mailto:" + n;
7083 7140 else {
7084 7141 let r2;
7085 7142 do
7086 - r2 = t3[0], t3[0] = this.rules.inline._backpedal.exec(t3[0])?.[0] ?? "";
7087 - while (r2 !== t3[0]);
7088 - n2 = t3[0], t3[1] === "www." ? s2 = "http://" + t3[0] : s2 = t3[0];
7143 + r2 = t2[0], t2[0] = this.rules.inline._backpedal.exec(t2[0])?.[0] ?? "";
7144 + while (r2 !== t2[0]);
7145 + n = t2[0], t2[1] === "www." ? i = "http://" + t2[0] : i = t2[0];
7089 7146 }
7090 - return { type: "link", raw: t3[0], text: n2, href: s2, tokens: [{ type: "text", raw: n2, text: n2 }] };
7147 + return { type: "link", raw: t2[0], text: n, href: i, autolink: true, tokens: [{ type: "text", raw: n, text: n }] };
7091 7148 }
7092 7149 }
7093 7150 inlineText(e2) {
7094 - let t3 = this.rules.inline.text.exec(e2);
7095 - if (t3) {
7096 - let n2 = this.lexer.state.inRawBlock;
7097 - return { type: "text", raw: t3[0], text: t3[0], escaped: n2 };
7151 + let t2 = this.rules.inline.text.exec(e2);
7152 + if (t2) {
7153 + let n = this.lexer.state.inRawBlock;
7154 + return { type: "text", raw: t2[0], text: t2[0], escaped: n };
7098 7155 }
7099 7156 }
7100 7157 };
7101 7158 var x2 = class l2 {
@@ -7104,120 +7161,120 @@
7104 7161 state;
7105 7162 inlineQueue;
7106 7163 tokenizer;
7107 7164 constructor(e2) {
7108 - this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e2 || T, this.options.tokenizer = this.options.tokenizer || new w2(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
7109 - let t3 = { other: m2, block: B.normal, inline: A.normal };
7110 - this.options.pedantic ? (t3.block = B.pedantic, t3.inline = A.pedantic) : this.options.gfm && (t3.block = B.gfm, this.options.breaks ? t3.inline = A.breaks : t3.inline = A.gfm), this.tokenizer.rules = t3;
7165 + this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e2 || T, this.options.tokenizer = this.options.tokenizer || new y2(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, linkEmitted: false, top: true };
7166 + let t2 = { other: m2, block: G.normal, inline: B.normal };
7167 + this.options.pedantic ? (t2.block = G.pedantic, t2.inline = B.pedantic) : this.options.gfm && (t2.block = G.gfm, this.options.breaks ? t2.inline = B.breaks : t2.inline = B.gfm), this.tokenizer.rules = t2;
7111 7168 }
7112 7169 static get rules() {
7113 - return { block: B, inline: A };
7170 + return { block: G, inline: B };
7114 7171 }
7115 - static lex(e2, t3) {
7116 - return new l2(t3).lex(e2);
7172 + static lex(e2, t2) {
7173 + return new l2(t2).lex(e2);
7117 7174 }
7118 - static lexInline(e2, t3) {
7119 - return new l2(t3).inlineTokens(e2);
7175 + static lexInline(e2, t2) {
7176 + return new l2(t2).inlineTokens(e2);
7120 7177 }
7121 7178 lex(e2) {
7122 7179 e2 = e2.replace(m2.carriageReturn, `
7123 7180 `), this.blockTokens(e2, this.tokens);
7124 - for (let t3 = 0; t3 < this.inlineQueue.length; t3++) {
7125 - let n2 = this.inlineQueue[t3];
7126 - this.inlineTokens(n2.src, n2.tokens);
7181 + for (let t2 = 0; t2 < this.inlineQueue.length; t2++) {
7182 + let n = this.inlineQueue[t2];
7183 + this.inlineTokens(n.src, n.tokens);
7127 7184 }
7128 7185 return this.inlineQueue = [], this.tokens;
7129 7186 }
7130 - blockTokens(e2, t3 = [], n2 = false) {
7187 + blockTokens(e2, t2 = [], n = false) {
7131 7188 this.tokenizer.lexer = this, this.options.pedantic && (e2 = e2.replace(m2.tabCharGlobal, " ").replace(m2.spaceLine, ""));
7132 - let s2 = 1 / 0;
7189 + let i = 1 / 0;
7133 7190 for (; e2; ) {
7134 - if (e2.length < s2) s2 = e2.length;
7191 + if (e2.length < i) i = e2.length;
7135 7192 else {
7136 7193 this.infiniteLoopError(e2.charCodeAt(0));
7137 7194 break;
7138 7195 }
7139 7196 let r2;
7140 - if (this.options.extensions?.block?.some((o3) => (r2 = o3.call({ lexer: this }, e2, t3)) ? (e2 = e2.substring(r2.raw.length), t3.push(r2), true) : false)) continue;
7197 + if (this.options.extensions?.block?.some((s) => (r2 = s.call({ lexer: this }, e2, t2)) ? (e2 = e2.substring(r2.raw.length), t2.push(r2), true) : false)) continue;
7141 7198 if (r2 = this.tokenizer.space(e2)) {
7142 7199 e2 = e2.substring(r2.raw.length);
7143 - let o3 = t3.at(-1);
7144 - r2.raw.length === 1 && o3 !== void 0 ? o3.raw += `
7145 -` : t3.push(r2);
7200 + let s = t2.at(-1);
7201 + r2.raw.length === 1 && s !== void 0 ? s.raw += `
7202 +` : t2.push(r2);
7146 7203 continue;
7147 7204 }
7148 7205 if (r2 = this.tokenizer.code(e2)) {
7149 7206 e2 = e2.substring(r2.raw.length);
7150 - let o3 = t3.at(-1);
7151 - o3?.type === "paragraph" || o3?.type === "text" ? (o3.raw += (o3.raw.endsWith(`
7207 + let s = t2.at(-1);
7208 + s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
7152 7209 `) ? "" : `
7153 -`) + r2.raw, o3.text += `
7154 -` + r2.text, this.inlineQueue.at(-1).src = o3.text) : t3.push(r2);
7210 +`) + r2.raw, s.text += `
7211 +` + r2.text, this.inlineQueue.at(-1).src = s.text) : t2.push(r2);
7155 7212 continue;
7156 7213 }
7157 7214 if (r2 = this.tokenizer.fences(e2)) {
7158 - e2 = e2.substring(r2.raw.length), t3.push(r2);
7215 + e2 = e2.substring(r2.raw.length), t2.push(r2);
7159 7216 continue;
7160 7217 }
7161 7218 if (r2 = this.tokenizer.heading(e2)) {
7162 - e2 = e2.substring(r2.raw.length), t3.push(r2);
7219 + e2 = e2.substring(r2.raw.length), t2.push(r2);
7163 7220 continue;
7164 7221 }
7165 7222 if (r2 = this.tokenizer.hr(e2)) {
7166 - e2 = e2.substring(r2.raw.length), t3.push(r2);
7223 + e2 = e2.substring(r2.raw.length), t2.push(r2);
7167 7224 continue;
7168 7225 }
7169 7226 if (r2 = this.tokenizer.blockquote(e2)) {
7170 - e2 = e2.substring(r2.raw.length), t3.push(r2);
7227 + e2 = e2.substring(r2.raw.length), t2.push(r2);
7171 7228 continue;
7172 7229 }
7173 7230 if (r2 = this.tokenizer.list(e2)) {
7174 - e2 = e2.substring(r2.raw.length), t3.push(r2);
7231 + e2 = e2.substring(r2.raw.length), t2.push(r2);
7175 7232 continue;
7176 7233 }
7177 7234 if (r2 = this.tokenizer.html(e2)) {
7178 - e2 = e2.substring(r2.raw.length), t3.push(r2);
7235 + e2 = e2.substring(r2.raw.length), t2.push(r2);
7179 7236 continue;
7180 7237 }
7181 7238 if (r2 = this.tokenizer.def(e2)) {
7182 7239 e2 = e2.substring(r2.raw.length);
7183 - let o3 = t3.at(-1);
7184 - o3?.type === "paragraph" || o3?.type === "text" ? (o3.raw += (o3.raw.endsWith(`
7240 + let s = t2.at(-1);
7241 + s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
7185 7242 `) ? "" : `
7186 -`) + r2.raw, o3.text += `
7187 -` + r2.raw, this.inlineQueue.at(-1).src = o3.text) : this.tokens.links[r2.tag] || (this.tokens.links[r2.tag] = { href: r2.href, title: r2.title }, t3.push(r2));
7243 +`) + r2.raw, s.text += `
7244 +` + r2.raw, this.inlineQueue.at(-1).src = s.text) : this.tokens.links[r2.tag] || (this.tokens.links[r2.tag] = { href: r2.href, title: r2.title }, t2.push(r2));
7188 7245 continue;
7189 7246 }
7190 7247 if (r2 = this.tokenizer.table(e2)) {
7191 - e2 = e2.substring(r2.raw.length), t3.push(r2);
7248 + e2 = e2.substring(r2.raw.length), t2.push(r2);
7192 7249 continue;
7193 7250 }
7194 7251 if (r2 = this.tokenizer.lheading(e2)) {
7195 - e2 = e2.substring(r2.raw.length), t3.push(r2);
7252 + e2 = e2.substring(r2.raw.length), t2.push(r2);
7196 7253 continue;
7197 7254 }
7198 - let i2 = e2;
7255 + let o2 = e2;
7199 7256 if (this.options.extensions?.startBlock) {
7200 - let o3 = 1 / 0, u2 = e2.slice(1), a2;
7201 - this.options.extensions.startBlock.forEach((c2) => {
7202 - a2 = c2.call({ lexer: this }, u2), typeof a2 == "number" && a2 >= 0 && (o3 = Math.min(o3, a2));
7203 - }), o3 < 1 / 0 && o3 >= 0 && (i2 = e2.substring(0, o3 + 1));
7257 + let s = 1 / 0, u = e2.slice(1), a;
7258 + this.options.extensions.startBlock.forEach((p2) => {
7259 + a = p2.call({ lexer: this }, u), typeof a == "number" && a >= 0 && (s = Math.min(s, a));
7260 + }), s < 1 / 0 && s >= 0 && (o2 = e2.substring(0, s + 1));
7204 7261 }
7205 - if (this.state.top && (r2 = this.tokenizer.paragraph(i2))) {
7206 - let o3 = t3.at(-1);
7207 - n2 && o3?.type === "paragraph" ? (o3.raw += (o3.raw.endsWith(`
7262 + if (this.state.top && (r2 = this.tokenizer.paragraph(o2))) {
7263 + let s = t2.at(-1);
7264 + n && s?.type === "paragraph" ? (s.raw += (s.raw.endsWith(`
7208 7265 `) ? "" : `
7209 -`) + r2.raw, o3.text += `
7210 -` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o3.text) : t3.push(r2), n2 = i2.length !== e2.length, e2 = e2.substring(r2.raw.length);
7266 +`) + r2.raw, s.text += `
7267 +` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t2.push(r2), n = o2.length !== e2.length, e2 = e2.substring(r2.raw.length);
7211 7268 continue;
7212 7269 }
7213 7270 if (r2 = this.tokenizer.text(e2)) {
7214 7271 e2 = e2.substring(r2.raw.length);
7215 - let o3 = t3.at(-1);
7216 - o3?.type === "text" ? (o3.raw += (o3.raw.endsWith(`
7272 + let s = t2.at(-1);
7273 + s?.type === "text" ? (s.raw += (s.raw.endsWith(`
7217 7274 `) ? "" : `
7218 -`) + r2.raw, o3.text += `
7219 -` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o3.text) : t3.push(r2);
7275 +`) + r2.raw, s.text += `
7276 +` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t2.push(r2);
7220 7277 continue;
7221 7278 }
7222 7279 if (e2) {
7223 7280 this.infiniteLoopError(e2.charCodeAt(0));
@@ -7223,87 +7280,105 @@
7223 7280 this.infiniteLoopError(e2.charCodeAt(0));
7224 7281 break;
7225 7282 }
7226 7283 }
7227 - return this.state.top = true, t3;
7284 + return this.state.top = true, t2;
7228 7285 }
7229 - inline(e2, t3 = []) {
7230 - return this.inlineQueue.push({ src: e2, tokens: t3 }), t3;
7286 + inline(e2, t2 = []) {
7287 + return this.inlineQueue.push({ src: e2, tokens: t2 }), t2;
7231 7288 }
7232 - inlineTokens(e2, t3 = []) {
7289 + linkInText(e2) {
7290 + if (!e2.includes("[")) return false;
7291 + let t2 = this.tokenizer.rules.inline.link;
7292 + for (let n of e2.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t2.test(n[0]) && e2.charAt(n.index - 1) !== "!") return true;
7293 + for (let n of e2.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
7294 + let i = n[0], r2 = i.lastIndexOf("[");
7295 + if (!(i.charAt(0) === "!" || !Object.hasOwn(this.tokens.links, D2(i.slice(r2 + 1, -1)))) && !(r2 > 1 && this.linkInText(i.slice(1, r2 - 1)))) return true;
7296 + }
7297 + return false;
7298 + }
7299 + inlineTokens(e2, t2 = []) {
7233 7300 this.tokenizer.lexer = this;
7234 - let n2 = e2, s2 = null;
7235 - if (this.tokens.links) {
7236 - let a2 = Object.keys(this.tokens.links);
7237 - if (a2.length > 0) for (; (s2 = this.tokenizer.rules.inline.reflinkSearch.exec(n2)) !== null; ) a2.includes(s2[0].slice(s2[0].lastIndexOf("[") + 1, -1)) && (n2 = n2.slice(0, s2.index) + "[" + "a".repeat(s2[0].length - 2) + "]" + n2.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
7301 + let n = e2;
7302 + if (this.tokens.links && e2.includes("[")) {
7303 + let s = this.tokenizer.rules.inline.reflinkSearch, u = (a) => {
7304 + let p2 = a.lastIndexOf("[");
7305 + if (!Object.hasOwn(this.tokens.links, D2(a.slice(p2 + 1, -1)))) return a;
7306 + if (p2 > 1 && a.charAt(0) !== "!") {
7307 + let c2 = a.slice(1, p2 - 1);
7308 + if (this.linkInText(c2)) return "[" + c2.replace(s, u) + "][" + "a".repeat(a.length - p2 - 2) + "]";
7309 + }
7310 + return "[" + "a".repeat(a.length - 2) + "]";
7311 + };
7312 + n = n.replace(s, u);
7238 7313 }
7239 - for (; (s2 = this.tokenizer.rules.inline.anyPunctuation.exec(n2)) !== null; ) n2 = n2.slice(0, s2.index) + "++" + n2.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
7240 - let r2;
7241 - for (; (s2 = this.tokenizer.rules.inline.blockSkip.exec(n2)) !== null; ) r2 = s2[2] ? s2[2].length : 0, n2 = n2.slice(0, s2.index + r2) + "[" + "a".repeat(s2[0].length - r2 - 2) + "]" + n2.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
7242 - n2 = this.options.hooks?.emStrongMask?.call({ lexer: this }, n2) ?? n2;
7243 - let i2 = false, o3 = "", u2 = 1 / 0;
7314 + n = n.replace(this.tokenizer.rules.inline.anyPunctuation, (s) => "+".repeat(s.length)), n = n.replace(this.tokenizer.rules.inline.blockSkip, (s, u, a) => {
7315 + let p2 = a ? a.length : 0;
7316 + return s.slice(0, p2) + "[" + "a".repeat(s.length - p2 - 2) + "]";
7317 + }), n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
7318 + let i = false, r2 = "", o2 = 1 / 0;
7244 7319 for (; e2; ) {
7245 - if (e2.length < u2) u2 = e2.length;
7320 + if (e2.length < o2) o2 = e2.length;
7246 7321 else {
7247 7322 this.infiniteLoopError(e2.charCodeAt(0));
7248 7323 break;
7249 7324 }
7250 - i2 || (o3 = ""), i2 = false;
7251 - let a2;
7252 - if (this.options.extensions?.inline?.some((p2) => (a2 = p2.call({ lexer: this }, e2, t3)) ? (e2 = e2.substring(a2.raw.length), t3.push(a2), true) : false)) continue;
7253 - if (a2 = this.tokenizer.escape(e2)) {
7254 - e2 = e2.substring(a2.raw.length), t3.push(a2);
7325 + i || (r2 = ""), i = false;
7326 + let s;
7327 + if (this.options.extensions?.inline?.some((a) => (s = a.call({ lexer: this }, e2, t2)) ? (e2 = e2.substring(s.raw.length), t2.push(s), true) : false)) continue;
7328 + if (s = this.tokenizer.escape(e2)) {
7329 + e2 = e2.substring(s.raw.length), t2.push(s);
7255 7330 continue;
7256 7331 }
7257 - if (a2 = this.tokenizer.tag(e2)) {
7258 - e2 = e2.substring(a2.raw.length), t3.push(a2);
7332 + if (s = this.tokenizer.tag(e2)) {
7333 + e2 = e2.substring(s.raw.length), t2.push(s);
7259 7334 continue;
7260 7335 }
7261 - if (a2 = this.tokenizer.link(e2)) {
7262 - e2 = e2.substring(a2.raw.length), t3.push(a2);
7336 + if (s = this.tokenizer.link(e2)) {
7337 + e2 = e2.substring(s.raw.length), t2.push(s);
7263 7338 continue;
7264 7339 }
7265 - if (a2 = this.tokenizer.reflink(e2, this.tokens.links)) {
7266 - e2 = e2.substring(a2.raw.length);
7267 - let p2 = t3.at(-1);
7268 - a2.type === "text" && p2?.type === "text" ? (p2.raw += a2.raw, p2.text += a2.text) : t3.push(a2);
7340 + if (s = this.tokenizer.reflink(e2, this.tokens.links)) {
7341 + e2 = e2.substring(s.raw.length);
7342 + let a = t2.at(-1);
7343 + s.type === "text" && a?.type === "text" ? (a.raw += s.raw, a.text += s.text) : t2.push(s);
7269 7344 continue;
7270 7345 }
7271 - if (a2 = this.tokenizer.emStrong(e2, n2, o3)) {
7272 - e2 = e2.substring(a2.raw.length), t3.push(a2);
7346 + if (s = this.tokenizer.emStrong(e2, n, r2)) {
7347 + e2 = e2.substring(s.raw.length), t2.push(s);
7273 7348 continue;
7274 7349 }
7275 - if (a2 = this.tokenizer.codespan(e2)) {
7276 - e2 = e2.substring(a2.raw.length), t3.push(a2);
7350 + if (s = this.tokenizer.codespan(e2)) {
7351 + e2 = e2.substring(s.raw.length), t2.push(s);
7277 7352 continue;
7278 7353 }
7279 - if (a2 = this.tokenizer.br(e2)) {
7280 - e2 = e2.substring(a2.raw.length), t3.push(a2);
7354 + if (s = this.tokenizer.br(e2)) {
7355 + e2 = e2.substring(s.raw.length), t2.push(s);
7281 7356 continue;
7282 7357 }
7283 - if (a2 = this.tokenizer.del(e2, n2, o3)) {
7284 - e2 = e2.substring(a2.raw.length), t3.push(a2);
7358 + if (s = this.tokenizer.del(e2, n, r2)) {
7359 + e2 = e2.substring(s.raw.length), t2.push(s);
7285 7360 continue;
7286 7361 }
7287 - if (a2 = this.tokenizer.autolink(e2)) {
7288 - e2 = e2.substring(a2.raw.length), t3.push(a2);
7362 + if (s = this.tokenizer.autolink(e2)) {
7363 + e2 = e2.substring(s.raw.length), t2.push(s);
7289 7364 continue;
7290 7365 }
7291 - if (!this.state.inLink && (a2 = this.tokenizer.url(e2))) {
7292 - e2 = e2.substring(a2.raw.length), t3.push(a2);
7366 + if (!this.state.inLink && (s = this.tokenizer.url(e2))) {
7367 + e2 = e2.substring(s.raw.length), t2.push(s);
7293 7368 continue;
7294 7369 }
7295 - let c2 = e2;
7370 + let u = e2;
7296 7371 if (this.options.extensions?.startInline) {
7297 - let p2 = 1 / 0, k2 = e2.slice(1), h2;
7298 - this.options.extensions.startInline.forEach((R) => {
7299 - h2 = R.call({ lexer: this }, k2), typeof h2 == "number" && h2 >= 0 && (p2 = Math.min(p2, h2));
7300 - }), p2 < 1 / 0 && p2 >= 0 && (c2 = e2.substring(0, p2 + 1));
7372 + let a = 1 / 0, p2 = e2.slice(1), c2;
7373 + this.options.extensions.startInline.forEach((h) => {
7374 + c2 = h.call({ lexer: this }, p2), typeof c2 == "number" && c2 >= 0 && (a = Math.min(a, c2));
7375 + }), a < 1 / 0 && a >= 0 && (u = e2.substring(0, a + 1));
7301 7376 }
7302 - if (a2 = this.tokenizer.inlineText(c2)) {
7303 - e2 = e2.substring(a2.raw.length), a2.raw.slice(-1) !== "_" && (o3 = a2.raw.slice(-1)), i2 = true;
7304 - let p2 = t3.at(-1);
7305 - p2?.type === "text" ? (p2.raw += a2.raw, p2.text += a2.text) : t3.push(a2);
7377 + if (s = this.tokenizer.inlineText(u)) {
7378 + e2 = e2.substring(s.raw.length), s.raw.slice(-1) !== "_" && (r2 = s.raw.slice(-1)), i = true;
7379 + let a = t2.at(-1);
7380 + a?.type === "text" ? (a.raw += s.raw, a.text += s.text) : t2.push(s);
7306 7381 continue;
7307 7382 }
7308 7383 if (e2) {
7309 7384 this.infiniteLoopError(e2.charCodeAt(0));
@@ -7309,17 +7384,17 @@
7309 7384 this.infiniteLoopError(e2.charCodeAt(0));
7310 7385 break;
7311 7386 }
7312 7387 }
7313 - return t3;
7388 + return t2;
7314 7389 }
7315 7390 infiniteLoopError(e2) {
7316 - let t3 = "Infinite loop on byte: " + e2;
7317 - if (this.options.silent) console.error(t3);
7318 - else throw new Error(t3);
7391 + let t2 = "Infinite loop on byte: " + e2;
7392 + if (this.options.silent) console.error(t2);
7393 + else throw new Error(t2);
7319 7394 }
7320 7395 };
7321 - var y2 = class {
7396 + var P = class {
7322 7397 options;
7323 7398 parser;
7324 7399 constructor(e2) {
7325 7400 this.options = e2 || T;
@@ -7326,14 +7401,14 @@
7326 7401 }
7327 7402 space(e2) {
7328 7403 return "";
7329 7404 }
7330 - code({ text: e2, lang: t3, escaped: n2 }) {
7331 - let s2 = (t3 || "").match(m2.notSpaceStart)?.[0], r2 = e2.replace(m2.endingNewline, "") + `
7405 + code({ text: e2, lang: t2, escaped: n }) {
7406 + let i = (t2 || "").match(m2.notSpaceStart)?.[0], r2 = e2 ? e2.replace(m2.endingNewline, "") + `
7407 +` : "";
7408 + return i ? '<pre><code class="language-' + R2(i) + '">' + (n ? r2 : R2(r2, true)) + `</code></pre>
7409 +` : "<pre><code>" + (n ? r2 : R2(r2, true)) + `</code></pre>
7332 7410 `;
7333 - return s2 ? '<pre><code class="language-' + O(s2) + '">' + (n2 ? r2 : O(r2, true)) + `</code></pre>
7334 -` : "<pre><code>" + (n2 ? r2 : O(r2, true)) + `</code></pre>
7335 -`;
7336 7411 }
7337 7412 blockquote({ tokens: e2 }) {
7338 7413 return `<blockquote>
7339 7414 ${this.parser.parse(e2)}</blockquote>
@@ -7344,10 +7419,10 @@
7344 7419 }
7345 7420 def(e2) {
7346 7421 return "";
7347 7422 }
7348 - heading({ tokens: e2, depth: t3 }) {
7349 - return `<h${t3}>${this.parser.parseInline(e2)}</h${t3}>
7423 + heading({ tokens: e2, depth: t2 }) {
7424 + return `<h${t2}>${this.parser.parseInline(e2)}</h${t2}>
7350 7425 `;
7351 7426 }
7352 7427 hr(e2) {
7353 7428 return `<hr>
@@ -7353,16 +7428,16 @@
7353 7428 return `<hr>
7354 7429 `;
7355 7430 }
7356 7431 list(e2) {
7357 - let t3 = e2.ordered, n2 = e2.start, s2 = "";
7358 - for (let o3 = 0; o3 < e2.items.length; o3++) {
7359 - let u2 = e2.items[o3];
7360 - s2 += this.listitem(u2);
7432 + let t2 = e2.ordered, n = e2.start, i = "";
7433 + for (let s = 0; s < e2.items.length; s++) {
7434 + let u = e2.items[s];
7435 + i += this.listitem(u);
7361 7436 }
7362 - let r2 = t3 ? "ol" : "ul", i2 = t3 && n2 !== 1 ? ' start="' + n2 + '"' : "";
7363 - return "<" + r2 + i2 + `>
7364 -` + s2 + "</" + r2 + `>
7437 + let r2 = t2 ? "ol" : "ul", o2 = t2 && n !== 1 ? ' start="' + n + '"' : "";
7438 + return "<" + r2 + o2 + `>
7439 +` + i + "</" + r2 + `>
7365 7440 `;
7366 7441 }
7367 7442 listitem(e2) {
7368 7443 return `<li>${this.parser.parse(e2.tokens)}</li>
@@ -7375,22 +7450,22 @@
7375 7450 return `<p>${this.parser.parseInline(e2)}</p>
7376 7451 `;
7377 7452 }
7378 7453 table(e2) {
7379 - let t3 = "", n2 = "";
7380 - for (let r2 = 0; r2 < e2.header.length; r2++) n2 += this.tablecell(e2.header[r2]);
7381 - t3 += this.tablerow({ text: n2 });
7382 - let s2 = "";
7454 + let t2 = "", n = "";
7455 + for (let r2 = 0; r2 < e2.header.length; r2++) n += this.tablecell(e2.header[r2]);
7456 + t2 += this.tablerow({ text: n });
7457 + let i = "";
7383 7458 for (let r2 = 0; r2 < e2.rows.length; r2++) {
7384 - let i2 = e2.rows[r2];
7385 - n2 = "";
7386 - for (let o3 = 0; o3 < i2.length; o3++) n2 += this.tablecell(i2[o3]);
7387 - s2 += this.tablerow({ text: n2 });
7459 + let o2 = e2.rows[r2];
7460 + n = "";
7461 + for (let s = 0; s < o2.length; s++) n += this.tablecell(o2[s]);
7462 + i += this.tablerow({ text: n });
7388 7463 }
7389 - return s2 && (s2 = `<tbody>${s2}</tbody>`), `<table>
7464 + return i && (i = `<tbody>${i}</tbody>`), `<table>
7390 7465 <thead>
7391 -` + t3 + `</thead>
7392 -` + s2 + `</table>
7466 +` + t2 + `</thead>
7467 +` + i + `</table>
7393 7468 `;
7394 7469 }
7395 7470 tablerow({ text: e2 }) {
7396 7471 return `<tr>
@@ -7397,10 +7472,10 @@
7397 7472 ${e2}</tr>
7398 7473 `;
7399 7474 }
7400 7475 tablecell(e2) {
7401 - let t3 = this.parser.parseInline(e2.tokens), n2 = e2.header ? "th" : "td";
7402 - return (e2.align ? `<${n2} align="${e2.align}">` : `<${n2}>`) + t3 + `</${n2}>
7476 + let t2 = this.parser.parseInline(e2.tokens), n = e2.header ? "th" : "td";
7477 + return (e2.align ? `<${n} align="${e2.align}">` : `<${n}>`) + t2 + `</${n}>
7403 7478 `;
7404 7479 }
7405 7480 strong({ tokens: e2 }) {
7406 7481 return `<strong>${this.parser.parseInline(e2)}</strong>`;
@@ -7408,9 +7483,9 @@
7408 7483 em({ tokens: e2 }) {
7409 7484 return `<em>${this.parser.parseInline(e2)}</em>`;
7410 7485 }
7411 7486 codespan({ text: e2 }) {
7412 - return `<code>${O(e2, true)}</code>`;
7487 + return `<code>${R2(e2, true)}</code>`;
7413 7488 }
7414 7489 br(e2) {
7415 7490 return "<br>";
7416 7491 }
@@ -7416,25 +7491,25 @@
7416 7491 }
7417 7492 del({ tokens: e2 }) {
7418 7493 return `<del>${this.parser.parseInline(e2)}</del>`;
7419 7494 }
7420 - link({ href: e2, title: t3, tokens: n2 }) {
7421 - let s2 = this.parser.parseInline(n2), r2 = J(e2);
7422 - if (r2 === null) return s2;
7423 - e2 = r2;
7424 - let i2 = '<a href="' + e2 + '"';
7425 - return t3 && (i2 += ' title="' + O(t3) + '"'), i2 += ">" + s2 + "</a>", i2;
7495 + link({ href: e2, title: t2, text: n, tokens: i, autolink: r2 }) {
7496 + let o2 = r2 ? R2(n, true) : this.parser.parseInline(i), s = ee(e2);
7497 + if (s === null) return o2;
7498 + e2 = R2(s, r2);
7499 + let u = '<a href="' + e2 + '"';
7500 + return t2 && (u += ' title="' + R2(t2) + '"'), u += ">" + o2 + "</a>", u;
7426 7501 }
7427 - image({ href: e2, title: t3, text: n2, tokens: s2 }) {
7428 - s2 && (n2 = this.parser.parseInline(s2, this.parser.textRenderer));
7429 - let r2 = J(e2);
7430 - if (r2 === null) return O(n2);
7502 + image({ href: e2, title: t2, text: n, tokens: i }) {
7503 + i && (n = this.parser.parseInline(i, this.parser.textRenderer));
7504 + let r2 = ee(e2);
7505 + if (r2 === null) return R2(n);
7431 7506 e2 = r2;
7432 - let i2 = `<img src="${e2}" alt="${O(n2)}"`;
7433 - return t3 && (i2 += ` title="${O(t3)}"`), i2 += ">", i2;
7507 + let o2 = `<img src="${R2(e2)}" alt="${R2(n)}"`;
7508 + return t2 && (o2 += ` title="${R2(t2)}"`), o2 += ">", o2;
7434 7509 }
7435 7510 text(e2) {
7436 - return "tokens" in e2 && e2.tokens ? this.parser.parseInline(e2.tokens) : "escaped" in e2 && e2.escaped ? e2.text : O(e2.text);
7511 + return "tokens" in e2 && e2.tokens ? this.parser.parseInline(e2.tokens) : "escaped" in e2 && e2.escaped ? e2.text : R2(e2.text);
7437 7512 }
7438 7513 };
7439 7514 var L = class {
7440 7515 strong({ text: e2 }) {
@@ -7467,161 +7542,161 @@
7467 7542 checkbox({ raw: e2 }) {
7468 7543 return e2;
7469 7544 }
7470 7545 };
7471 - var b2 = class l3 {
7546 + var b = class l3 {
7472 7547 options;
7473 7548 renderer;
7474 7549 textRenderer;
7475 7550 constructor(e2) {
7476 - this.options = e2 || T, this.options.renderer = this.options.renderer || new y2(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L();
7551 + this.options = e2 || T, this.options.renderer = this.options.renderer || new P(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L();
7477 7552 }
7478 - static parse(e2, t3) {
7479 - return new l3(t3).parse(e2);
7553 + static parse(e2, t2) {
7554 + return new l3(t2).parse(e2);
7480 7555 }
7481 - static parseInline(e2, t3) {
7482 - return new l3(t3).parseInline(e2);
7556 + static parseInline(e2, t2) {
7557 + return new l3(t2).parseInline(e2);
7483 7558 }
7484 7559 parse(e2) {
7485 7560 this.renderer.parser = this;
7486 - let t3 = "";
7487 - for (let n2 = 0; n2 < e2.length; n2++) {
7488 - let s2 = e2[n2];
7489 - if (this.options.extensions?.renderers?.[s2.type]) {
7490 - let i2 = s2, o3 = this.options.extensions.renderers[i2.type].call({ parser: this }, i2);
7491 - if (o3 !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(i2.type)) {
7492 - t3 += o3 || "";
7561 + let t2 = "";
7562 + for (let n = 0; n < e2.length; n++) {
7563 + let i = e2[n];
7564 + if (this.options.extensions?.renderers?.[i.type]) {
7565 + let o2 = i, s = this.options.extensions.renderers[o2.type].call({ parser: this }, o2);
7566 + if (s !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "checkbox", "html", "def", "paragraph", "text"].includes(o2.type)) {
7567 + t2 += s || "";
7493 7568 continue;
7494 7569 }
7495 7570 }
7496 - let r2 = s2;
7571 + let r2 = i;
7497 7572 switch (r2.type) {
7498 7573 case "space": {
7499 - t3 += this.renderer.space(r2);
7574 + t2 += this.renderer.space(r2);
7500 7575 break;
7501 7576 }
7502 7577 case "hr": {
7503 - t3 += this.renderer.hr(r2);
7578 + t2 += this.renderer.hr(r2);
7504 7579 break;
7505 7580 }
7506 7581 case "heading": {
7507 - t3 += this.renderer.heading(r2);
7582 + t2 += this.renderer.heading(r2);
7508 7583 break;
7509 7584 }
7510 7585 case "code": {
7511 - t3 += this.renderer.code(r2);
7586 + t2 += this.renderer.code(r2);
7512 7587 break;
7513 7588 }
7514 7589 case "table": {
7515 - t3 += this.renderer.table(r2);
7590 + t2 += this.renderer.table(r2);
7516 7591 break;
7517 7592 }
7518 7593 case "blockquote": {
7519 - t3 += this.renderer.blockquote(r2);
7594 + t2 += this.renderer.blockquote(r2);
7520 7595 break;
7521 7596 }
7522 7597 case "list": {
7523 - t3 += this.renderer.list(r2);
7598 + t2 += this.renderer.list(r2);
7524 7599 break;
7525 7600 }
7526 7601 case "checkbox": {
7527 - t3 += this.renderer.checkbox(r2);
7602 + t2 += this.renderer.checkbox(r2);
7528 7603 break;
7529 7604 }
7530 7605 case "html": {
7531 - t3 += this.renderer.html(r2);
7606 + t2 += this.renderer.html(r2);
7532 7607 break;
7533 7608 }
7534 7609 case "def": {
7535 - t3 += this.renderer.def(r2);
7610 + t2 += this.renderer.def(r2);
7536 7611 break;
7537 7612 }
7538 7613 case "paragraph": {
7539 - t3 += this.renderer.paragraph(r2);
7614 + t2 += this.renderer.paragraph(r2);
7540 7615 break;
7541 7616 }
7542 7617 case "text": {
7543 - t3 += this.renderer.text(r2);
7618 + t2 += this.renderer.text(r2);
7544 7619 break;
7545 7620 }
7546 7621 default: {
7547 - let i2 = 'Token with "' + r2.type + '" type was not found.';
7548 - if (this.options.silent) return console.error(i2), "";
7549 - throw new Error(i2);
7622 + let o2 = 'Token with "' + r2.type + '" type was not found.';
7623 + if (this.options.silent) return console.error(o2), "";
7624 + throw new Error(o2);
7550 7625 }
7551 7626 }
7552 7627 }
7553 - return t3;
7628 + return t2;
7554 7629 }
7555 - parseInline(e2, t3 = this.renderer) {
7630 + parseInline(e2, t2 = this.renderer) {
7556 7631 this.renderer.parser = this;
7557 - let n2 = "";
7558 - for (let s2 = 0; s2 < e2.length; s2++) {
7559 - let r2 = e2[s2];
7632 + let n = "";
7633 + for (let i = 0; i < e2.length; i++) {
7634 + let r2 = e2[i];
7560 7635 if (this.options.extensions?.renderers?.[r2.type]) {
7561 - let o3 = this.options.extensions.renderers[r2.type].call({ parser: this }, r2);
7562 - if (o3 !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(r2.type)) {
7563 - n2 += o3 || "";
7636 + let s = this.options.extensions.renderers[r2.type].call({ parser: this }, r2);
7637 + if (s !== false || !["escape", "html", "link", "image", "checkbox", "strong", "em", "codespan", "br", "del", "text"].includes(r2.type)) {
7638 + n += s || "";
7564 7639 continue;
7565 7640 }
7566 7641 }
7567 - let i2 = r2;
7568 - switch (i2.type) {
7642 + let o2 = r2;
7643 + switch (o2.type) {
7569 7644 case "escape": {
7570 - n2 += t3.text(i2);
7645 + n += t2.text(o2);
7571 7646 break;
7572 7647 }
7573 7648 case "html": {
7574 - n2 += t3.html(i2);
7649 + n += t2.html(o2);
7575 7650 break;
7576 7651 }
7577 7652 case "link": {
7578 - n2 += t3.link(i2);
7653 + n += t2.link(o2);
7579 7654 break;
7580 7655 }
7581 7656 case "image": {
7582 - n2 += t3.image(i2);
7657 + n += t2.image(o2);
7583 7658 break;
7584 7659 }
7585 7660 case "checkbox": {
7586 - n2 += t3.checkbox(i2);
7661 + n += t2.checkbox(o2);
7587 7662 break;
7588 7663 }
7589 7664 case "strong": {
7590 - n2 += t3.strong(i2);
7665 + n += t2.strong(o2);
7591 7666 break;
7592 7667 }
7593 7668 case "em": {
7594 - n2 += t3.em(i2);
7669 + n += t2.em(o2);
7595 7670 break;
7596 7671 }
7597 7672 case "codespan": {
7598 - n2 += t3.codespan(i2);
7673 + n += t2.codespan(o2);
7599 7674 break;
7600 7675 }
7601 7676 case "br": {
7602 - n2 += t3.br(i2);
7677 + n += t2.br(o2);
7603 7678 break;
7604 7679 }
7605 7680 case "del": {
7606 - n2 += t3.del(i2);
7681 + n += t2.del(o2);
7607 7682 break;
7608 7683 }
7609 7684 case "text": {
7610 - n2 += t3.text(i2);
7685 + n += t2.text(o2);
7611 7686 break;
7612 7687 }
7613 7688 default: {
7614 - let o3 = 'Token with "' + i2.type + '" type was not found.';
7615 - if (this.options.silent) return console.error(o3), "";
7616 - throw new Error(o3);
7689 + let s = 'Token with "' + o2.type + '" type was not found.';
7690 + if (this.options.silent) return console.error(s), "";
7691 + throw new Error(s);
7617 7692 }
7618 7693 }
7619 7694 }
7620 - return n2;
7695 + return n;
7621 7696 }
7622 7697 };
7623 - var P = class {
7698 + var S = class {
7624 7699 options;
7625 7700 block;
7626 7701 constructor(e2) {
7627 7702 this.options = e2 || T;
@@ -7643,210 +7718,210 @@
7643 7718 provideLexer(e2 = this.block) {
7644 7719 return e2 ? x2.lex : x2.lexInline;
7645 7720 }
7646 7721 provideParser(e2 = this.block) {
7647 - return e2 ? b2.parse : b2.parseInline;
7722 + return e2 ? b.parse : b.parseInline;
7648 7723 }
7649 7724 };
7650 - var D = class {
7651 - defaults = z();
7725 + var Q = class {
7726 + defaults = A2();
7652 7727 options = this.setOptions;
7653 7728 parse = this.parseMarkdown(true);
7654 7729 parseInline = this.parseMarkdown(false);
7655 - Parser = b2;
7656 - Renderer = y2;
7730 + Parser = b;
7731 + Renderer = P;
7657 7732 TextRenderer = L;
7658 7733 Lexer = x2;
7659 - Tokenizer = w2;
7660 - Hooks = P;
7734 + Tokenizer = y2;
7735 + Hooks = S;
7661 7736 constructor(...e2) {
7662 7737 this.use(...e2);
7663 7738 }
7664 - walkTokens(e2, t3) {
7665 - let n2 = [];
7666 - for (let s2 of e2) switch (n2 = n2.concat(t3.call(this, s2)), s2.type) {
7739 + walkTokens(e2, t2) {
7740 + let n = [];
7741 + for (let i of e2) switch (n = n.concat(t2.call(this, i)), i.type) {
7667 7742 case "table": {
7668 - let r2 = s2;
7669 - for (let i2 of r2.header) n2 = n2.concat(this.walkTokens(i2.tokens, t3));
7670 - for (let i2 of r2.rows) for (let o3 of i2) n2 = n2.concat(this.walkTokens(o3.tokens, t3));
7743 + let r2 = i;
7744 + for (let o2 of r2.header) n = n.concat(this.walkTokens(o2.tokens, t2));
7745 + for (let o2 of r2.rows) for (let s of o2) n = n.concat(this.walkTokens(s.tokens, t2));
7671 7746 break;
7672 7747 }
7673 7748 case "list": {
7674 - let r2 = s2;
7675 - n2 = n2.concat(this.walkTokens(r2.items, t3));
7749 + let r2 = i;
7750 + n = n.concat(this.walkTokens(r2.items, t2));
7676 7751 break;
7677 7752 }
7678 7753 default: {
7679 - let r2 = s2;
7680 - this.defaults.extensions?.childTokens?.[r2.type] ? this.defaults.extensions.childTokens[r2.type].forEach((i2) => {
7681 - let o3 = r2[i2].flat(1 / 0);
7682 - n2 = n2.concat(this.walkTokens(o3, t3));
7683 - }) : r2.tokens && (n2 = n2.concat(this.walkTokens(r2.tokens, t3)));
7754 + let r2 = i;
7755 + this.defaults.extensions?.childTokens?.[r2.type] ? this.defaults.extensions.childTokens[r2.type].forEach((o2) => {
7756 + let s = r2[o2].flat(1 / 0);
7757 + n = n.concat(this.walkTokens(s, t2));
7758 + }) : r2.tokens && (n = n.concat(this.walkTokens(r2.tokens, t2)));
7684 7759 }
7685 7760 }
7686 - return n2;
7761 + return n;
7687 7762 }
7688 7763 use(...e2) {
7689 - let t3 = this.defaults.extensions || { renderers: {}, childTokens: {} };
7690 - return e2.forEach((n2) => {
7691 - let s2 = { ...n2 };
7692 - if (s2.async = this.defaults.async || s2.async || false, n2.extensions && (n2.extensions.forEach((r2) => {
7764 + let t2 = this.defaults.extensions || { renderers: {}, childTokens: {} };
7765 + return e2.forEach((n) => {
7766 + let i = { ...n };
7767 + if (i.async = this.defaults.async || i.async || false, n.extensions && (n.extensions.forEach((r2) => {
7693 7768 if (!r2.name) throw new Error("extension name required");
7694 7769 if ("renderer" in r2) {
7695 - let i2 = t3.renderers[r2.name];
7696 - i2 ? t3.renderers[r2.name] = function(...o3) {
7697 - let u2 = r2.renderer.apply(this, o3);
7698 - return u2 === false && (u2 = i2.apply(this, o3)), u2;
7699 - } : t3.renderers[r2.name] = r2.renderer;
7770 + let o2 = t2.renderers[r2.name];
7771 + o2 ? t2.renderers[r2.name] = function(...s) {
7772 + let u = r2.renderer.apply(this, s);
7773 + return u === false && (u = o2.apply(this, s)), u;
7774 + } : t2.renderers[r2.name] = r2.renderer;
7700 7775 }
7701 7776 if ("tokenizer" in r2) {
7702 7777 if (!r2.level || r2.level !== "block" && r2.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
7703 - let i2 = t3[r2.level];
7704 - i2 ? i2.unshift(r2.tokenizer) : t3[r2.level] = [r2.tokenizer], r2.start && (r2.level === "block" ? t3.startBlock ? t3.startBlock.push(r2.start) : t3.startBlock = [r2.start] : r2.level === "inline" && (t3.startInline ? t3.startInline.push(r2.start) : t3.startInline = [r2.start]));
7778 + let o2 = t2[r2.level];
7779 + o2 ? o2.unshift(r2.tokenizer) : t2[r2.level] = [r2.tokenizer], r2.start && (r2.level === "block" ? t2.startBlock ? t2.startBlock.push(r2.start) : t2.startBlock = [r2.start] : r2.level === "inline" && (t2.startInline ? t2.startInline.push(r2.start) : t2.startInline = [r2.start]));
7705 7780 }
7706 - "childTokens" in r2 && r2.childTokens && (t3.childTokens[r2.name] = r2.childTokens);
7707 - }), s2.extensions = t3), n2.renderer) {
7708 - let r2 = this.defaults.renderer || new y2(this.defaults);
7709 - for (let i2 in n2.renderer) {
7710 - if (!(i2 in r2)) throw new Error(`renderer '${i2}' does not exist`);
7711 - if (["options", "parser"].includes(i2)) continue;
7712 - let o3 = i2, u2 = n2.renderer[o3], a2 = r2[o3];
7713 - r2[o3] = (...c2) => {
7714 - let p2 = u2.apply(r2, c2);
7715 - return p2 === false && (p2 = a2.apply(r2, c2)), p2 || "";
7781 + "childTokens" in r2 && r2.childTokens && (t2.childTokens[r2.name] = r2.childTokens);
7782 + }), i.extensions = t2), n.renderer) {
7783 + let r2 = this.defaults.renderer || new P(this.defaults);
7784 + for (let o2 in n.renderer) {
7785 + if (!(o2 in r2)) throw new Error(`renderer '${o2}' does not exist`);
7786 + if (["options", "parser"].includes(o2)) continue;
7787 + let s = o2, u = n.renderer[s], a = r2[s];
7788 + r2[s] = (...p2) => {
7789 + let c2 = u.apply(r2, p2);
7790 + return c2 === false && (c2 = a.apply(r2, p2)), c2 || "";
7716 7791 };
7717 7792 }
7718 - s2.renderer = r2;
7793 + i.renderer = r2;
7719 7794 }
7720 - if (n2.tokenizer) {
7721 - let r2 = this.defaults.tokenizer || new w2(this.defaults);
7722 - for (let i2 in n2.tokenizer) {
7723 - if (!(i2 in r2)) throw new Error(`tokenizer '${i2}' does not exist`);
7724 - if (["options", "rules", "lexer"].includes(i2)) continue;
7725 - let o3 = i2, u2 = n2.tokenizer[o3], a2 = r2[o3];
7726 - r2[o3] = (...c2) => {
7727 - let p2 = u2.apply(r2, c2);
7728 - return p2 === false && (p2 = a2.apply(r2, c2)), p2;
7795 + if (n.tokenizer) {
7796 + let r2 = this.defaults.tokenizer || new y2(this.defaults);
7797 + for (let o2 in n.tokenizer) {
7798 + if (!(o2 in r2)) throw new Error(`tokenizer '${o2}' does not exist`);
7799 + if (["options", "rules", "lexer"].includes(o2)) continue;
7800 + let s = o2, u = n.tokenizer[s], a = r2[s];
7801 + r2[s] = (...p2) => {
7802 + let c2 = u.apply(r2, p2);
7803 + return c2 === false && (c2 = a.apply(r2, p2)), c2;
7729 7804 };
7730 7805 }
7731 - s2.tokenizer = r2;
7806 + i.tokenizer = r2;
7732 7807 }
7733 - if (n2.hooks) {
7734 - let r2 = this.defaults.hooks || new P();
7735 - for (let i2 in n2.hooks) {
7736 - if (!(i2 in r2)) throw new Error(`hook '${i2}' does not exist`);
7737 - if (["options", "block"].includes(i2)) continue;
7738 - let o3 = i2, u2 = n2.hooks[o3], a2 = r2[o3];
7739 - P.passThroughHooks.has(i2) ? r2[o3] = (c2) => {
7740 - if (this.defaults.async && P.passThroughHooksRespectAsync.has(i2)) return (async () => {
7741 - let k2 = await u2.call(r2, c2);
7742 - return a2.call(r2, k2);
7808 + if (n.hooks) {
7809 + let r2 = this.defaults.hooks || new S();
7810 + for (let o2 in n.hooks) {
7811 + if (!(o2 in r2)) throw new Error(`hook '${o2}' does not exist`);
7812 + if (["options", "block"].includes(o2)) continue;
7813 + let s = o2, u = n.hooks[s], a = r2[s];
7814 + S.passThroughHooks.has(o2) ? r2[s] = (p2) => {
7815 + if (this.defaults.async && S.passThroughHooksRespectAsync.has(o2)) return (async () => {
7816 + let h = await u.call(r2, p2);
7817 + return a.call(r2, h);
7743 7818 })();
7744 - let p2 = u2.call(r2, c2);
7745 - return a2.call(r2, p2);
7746 - } : r2[o3] = (...c2) => {
7819 + let c2 = u.call(r2, p2);
7820 + return a.call(r2, c2);
7821 + } : r2[s] = (...p2) => {
7747 7822 if (this.defaults.async) return (async () => {
7748 - let k2 = await u2.apply(r2, c2);
7749 - return k2 === false && (k2 = await a2.apply(r2, c2)), k2;
7823 + let h = await u.apply(r2, p2);
7824 + return h === false && (h = await a.apply(r2, p2)), h;
7750 7825 })();
7751 - let p2 = u2.apply(r2, c2);
7752 - return p2 === false && (p2 = a2.apply(r2, c2)), p2;
7826 + let c2 = u.apply(r2, p2);
7827 + return c2 === false && (c2 = a.apply(r2, p2)), c2;
7753 7828 };
7754 7829 }
7755 - s2.hooks = r2;
7830 + i.hooks = r2;
7756 7831 }
7757 - if (n2.walkTokens) {
7758 - let r2 = this.defaults.walkTokens, i2 = n2.walkTokens;
7759 - s2.walkTokens = function(o3) {
7760 - let u2 = [];
7761 - return u2.push(i2.call(this, o3)), r2 && (u2 = u2.concat(r2.call(this, o3))), u2;
7832 + if (n.walkTokens) {
7833 + let r2 = this.defaults.walkTokens, o2 = n.walkTokens;
7834 + i.walkTokens = function(s) {
7835 + let u = [];
7836 + return u.push(o2.call(this, s)), r2 && (u = u.concat(r2.call(this, s))), u;
7762 7837 };
7763 7838 }
7764 - this.defaults = { ...this.defaults, ...s2 };
7839 + this.defaults = { ...this.defaults, ...i };
7765 7840 }), this;
7766 7841 }
7767 7842 setOptions(e2) {
7768 7843 return this.defaults = { ...this.defaults, ...e2 }, this;
7769 7844 }
7770 - lexer(e2, t3) {
7771 - return x2.lex(e2, t3 ?? this.defaults);
7845 + lexer(e2, t2) {
7846 + return x2.lex(e2, t2 ?? this.defaults);
7772 7847 }
7773 - parser(e2, t3) {
7774 - return b2.parse(e2, t3 ?? this.defaults);
7848 + parser(e2, t2) {
7849 + return b.parse(e2, t2 ?? this.defaults);
7775 7850 }
7776 7851 parseMarkdown(e2) {
7777 - return (n2, s2) => {
7778 - let r2 = { ...s2 }, i2 = { ...this.defaults, ...r2 }, o3 = this.onError(!!i2.silent, !!i2.async);
7779 - if (this.defaults.async === true && r2.async === false) return o3(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
7780 - if (typeof n2 > "u" || n2 === null) return o3(new Error("marked(): input parameter is undefined or null"));
7781 - if (typeof n2 != "string") return o3(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n2) + ", string expected"));
7782 - if (i2.hooks && (i2.hooks.options = i2, i2.hooks.block = e2), i2.async) return (async () => {
7783 - let u2 = i2.hooks ? await i2.hooks.preprocess(n2) : n2, c2 = await (i2.hooks ? await i2.hooks.provideLexer(e2) : e2 ? x2.lex : x2.lexInline)(u2, i2), p2 = i2.hooks ? await i2.hooks.processAllTokens(c2) : c2;
7784 - i2.walkTokens && await Promise.all(this.walkTokens(p2, i2.walkTokens));
7785 - let h2 = await (i2.hooks ? await i2.hooks.provideParser(e2) : e2 ? b2.parse : b2.parseInline)(p2, i2);
7786 - return i2.hooks ? await i2.hooks.postprocess(h2) : h2;
7787 - })().catch(o3);
7852 + return (n, i) => {
7853 + let r2 = { ...i }, o2 = { ...this.defaults, ...r2 }, s = this.onError(!!o2.silent, !!o2.async);
7854 + if (this.defaults.async === true && r2.async === false) return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
7855 + if (typeof n > "u" || n === null) return s(new Error("marked(): input parameter is undefined or null"));
7856 + if (typeof n != "string") return s(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
7857 + if (o2.hooks && (o2.hooks.options = o2, o2.hooks.block = e2), o2.async) return (async () => {
7858 + let u = o2.hooks ? await o2.hooks.preprocess(n) : n, p2 = await (o2.hooks ? await o2.hooks.provideLexer(e2) : e2 ? x2.lex : x2.lexInline)(u, o2), c2 = o2.hooks ? await o2.hooks.processAllTokens(p2) : p2;
7859 + o2.walkTokens && await Promise.all(this.walkTokens(c2, o2.walkTokens));
7860 + let k2 = await (o2.hooks ? await o2.hooks.provideParser(e2) : e2 ? b.parse : b.parseInline)(c2, o2);
7861 + return o2.hooks ? await o2.hooks.postprocess(k2) : k2;
7862 + })().catch(s);
7788 7863 try {
7789 - i2.hooks && (n2 = i2.hooks.preprocess(n2));
7790 - let a2 = (i2.hooks ? i2.hooks.provideLexer(e2) : e2 ? x2.lex : x2.lexInline)(n2, i2);
7791 - i2.hooks && (a2 = i2.hooks.processAllTokens(a2)), i2.walkTokens && this.walkTokens(a2, i2.walkTokens);
7792 - let p2 = (i2.hooks ? i2.hooks.provideParser(e2) : e2 ? b2.parse : b2.parseInline)(a2, i2);
7793 - return i2.hooks && (p2 = i2.hooks.postprocess(p2)), p2;
7794 - } catch (u2) {
7795 - return o3(u2);
7864 + o2.hooks && (n = o2.hooks.preprocess(n));
7865 + let a = (o2.hooks ? o2.hooks.provideLexer(e2) : e2 ? x2.lex : x2.lexInline)(n, o2);
7866 + o2.hooks && (a = o2.hooks.processAllTokens(a)), o2.walkTokens && this.walkTokens(a, o2.walkTokens);
7867 + let c2 = (o2.hooks ? o2.hooks.provideParser(e2) : e2 ? b.parse : b.parseInline)(a, o2);
7868 + return o2.hooks && (c2 = o2.hooks.postprocess(c2)), c2;
7869 + } catch (u) {
7870 + return s(u);
7796 7871 }
7797 7872 };
7798 7873 }
7799 - onError(e2, t3) {
7800 - return (n2) => {
7801 - if (n2.message += `
7874 + onError(e2, t2) {
7875 + return (n) => {
7876 + if (n.message += `
7802 7877 Please report this to https://github.com/markedjs/marked.`, e2) {
7803 - let s2 = "<p>An error occurred:</p><pre>" + O(n2.message + "", true) + "</pre>";
7804 - return t3 ? Promise.resolve(s2) : s2;
7878 + let i = "<p>An error occurred:</p><pre>" + R2(n.message + "", true) + "</pre>";
7879 + return t2 ? Promise.resolve(i) : i;
7805 7880 }
7806 - if (t3) return Promise.reject(n2);
7807 - throw n2;
7881 + if (t2) return Promise.reject(n);
7882 + throw n;
7808 7883 };
7809 7884 }
7810 7885 };
7811 - var M2 = new D();
7812 - function g2(l4, e2) {
7886 + var M2 = new Q();
7887 + function f(l4, e2) {
7813 7888 return M2.parse(l4, e2);
7814 7889 }
7815 - g2.options = g2.setOptions = function(l4) {
7816 - return M2.setOptions(l4), g2.defaults = M2.defaults, G(g2.defaults), g2;
7890 + f.options = f.setOptions = function(l4) {
7891 + return M2.setOptions(l4), f.defaults = M2.defaults, U(f.defaults), f;
7817 7892 };
7818 - g2.getDefaults = z;
7819 - g2.defaults = T;
7820 - g2.use = function(...l4) {
7821 - return M2.use(...l4), g2.defaults = M2.defaults, G(g2.defaults), g2;
7822 - };
7823 - g2.walkTokens = function(l4, e2) {
7893 + f.getDefaults = A2;
7894 + f.defaults = T;
7895 + function bt(...l4) {
7896 + return M2.use(...l4), f.defaults = M2.defaults, U(f.defaults), f;
7897 + }
7898 + f.use = bt;
7899 + f.walkTokens = function(l4, e2) {
7824 7900 return M2.walkTokens(l4, e2);
7825 7901 };
7826 - g2.parseInline = M2.parseInline;
7827 - g2.Parser = b2;
7828 - g2.parser = b2.parse;
7829 - g2.Renderer = y2;
7830 - g2.TextRenderer = L;
7831 - g2.Lexer = x2;
7832 - g2.lexer = x2.lex;
7833 - g2.Tokenizer = w2;
7834 - g2.Hooks = P;
7835 - g2.parse = g2;
7836 - var jt = g2.options;
7837 - var Ft = g2.setOptions;
7838 - var Ut = g2.use;
7839 - var Kt = g2.walkTokens;
7840 - var Wt = g2.parseInline;
7841 - var Jt = b2.parse;
7842 - var Vt = x2.lex;
7902 + f.parseInline = M2.parseInline;
7903 + f.Parser = b;
7904 + f.parser = b.parse;
7905 + f.Renderer = P;
7906 + f.TextRenderer = L;
7907 + f.Lexer = x2;
7908 + f.lexer = x2.lex;
7909 + f.Tokenizer = y2;
7910 + f.Hooks = S;
7911 + f.parse = f;
7912 + var un = f.options;
7913 + var pn = f.setOptions;
7914 + var cn = f.walkTokens;
7915 + var hn = f.parseInline;
7916 + var kn = b.parse;
7917 + var gn = x2.lex;
7843 7918
7844 7919 // packages/blocks/build-module/api/raw-handling/markdown-converter.mjs
7845 7920 function escapeBodyText(value) {
7846 7921 return value.replace(/&(?!#?\w+;)/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
7847 7922 }
7848 - var converter = new D({
7923 + var converter = new Q({
7849 7924 gfm: true,
7850 7925 breaks: true,
7851 7926 renderer: {
7852 7927 // Match showdown's `omitExtraWLInCodeBlocks`: marked appends `\n`
@@ -8042,13 +8117,13 @@
8042 8117 if (/\\[a-zA-Z]+\s*\{/g.test(text2)) {
8043 8118 return true;
8044 8119 }
8045 8120 const softClues = [
8046 - (t3) => t3.includes("^") && !t3.startsWith("^"),
8047 - (t3) => ["=", "+", "-", "/", "*"].some(
8048 - (operator) => t3.includes(operator)
8121 + (t2) => t2.includes("^") && !t2.startsWith("^"),
8122 + (t2) => ["=", "+", "-", "/", "*"].some(
8123 + (operator) => t2.includes(operator)
8049 8124 ),
8050 - (t3) => /\\[a-zA-Z]+/g.test(t3)
8125 + (t2) => /\\[a-zA-Z]+/g.test(t2)
8051 8126 ];
8052 8127 if (softClues.filter((clue) => clue(text2)).length >= 2) {
8053 8128 return true;
8054 8129 }
@@ -8327,16 +8402,12 @@
8327 8402 );
8328 8403 }
8329 8404
8330 8405 // packages/blocks/build-module/api/index.mjs
8331 - var fieldsKey = /* @__PURE__ */ Symbol("fields");
8332 - var formKey = /* @__PURE__ */ Symbol("form");
8333 8406 var editableRootKey = /* @__PURE__ */ Symbol("editableRoot");
8334 8407 var privateApis = {};
8335 8408 lock(privateApis, {
8336 8409 isContentBlock,
8337 - fieldsKey,
8338 - formKey,
8339 8410 editableRootKey,
8340 8411 parseRawBlock
8341 8412 });
8342 8413