@versini/sassysaint 8.3.3 → 8.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,272 @@
1
+ import { factorySpace as M, markdownLineEnding as g } from "./ChatBubbleAssistant.CfsALTQw.js";
2
+ import { longestStreak as q } from "./index.Cyw5OC0t.js";
3
+ function b() {
4
+ return {
5
+ enter: {
6
+ mathFlow: t,
7
+ mathFlowFenceMeta: u,
8
+ mathText: c
9
+ },
10
+ exit: {
11
+ mathFlow: e,
12
+ mathFlowFence: i,
13
+ mathFlowFenceMeta: o,
14
+ mathFlowValue: m,
15
+ mathText: s,
16
+ mathTextData: m
17
+ }
18
+ };
19
+ function t(r) {
20
+ const l = {
21
+ type: "element",
22
+ tagName: "code",
23
+ properties: { className: ["language-math", "math-display"] },
24
+ children: []
25
+ };
26
+ this.enter(
27
+ {
28
+ type: "math",
29
+ meta: null,
30
+ value: "",
31
+ data: { hName: "pre", hChildren: [l] }
32
+ },
33
+ r
34
+ );
35
+ }
36
+ function u() {
37
+ this.buffer();
38
+ }
39
+ function o() {
40
+ const r = this.resume(), l = this.stack[this.stack.length - 1];
41
+ l.meta = r;
42
+ }
43
+ function i() {
44
+ this.data.mathFlowInside || (this.buffer(), this.data.mathFlowInside = !0);
45
+ }
46
+ function e(r) {
47
+ const l = this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""), h = this.stack[this.stack.length - 1];
48
+ this.exit(r), h.value = l, /** @type {HastElement} */
49
+ h.data.hChildren[0].children.push({ type: "text", value: l }), this.data.mathFlowInside = void 0;
50
+ }
51
+ function c(r) {
52
+ this.enter(
53
+ {
54
+ type: "inlineMath",
55
+ value: "",
56
+ data: {
57
+ hName: "code",
58
+ hProperties: { className: ["language-math", "math-inline"] },
59
+ hChildren: []
60
+ }
61
+ },
62
+ r
63
+ ), this.buffer();
64
+ }
65
+ function s(r) {
66
+ const l = this.resume(), h = this.stack[this.stack.length - 1];
67
+ this.exit(r), h.value = l, /** @type {Array<HastElementContent>} */
68
+ // @ts-expect-error: we defined it in `enterMathFlow`.
69
+ h.data.hChildren.push({ type: "text", value: l });
70
+ }
71
+ function m(r) {
72
+ this.config.enter.data.call(this, r), this.config.exit.data.call(this, r);
73
+ }
74
+ }
75
+ function P(t) {
76
+ let u = (t || {}).singleDollarTextMath;
77
+ return u == null && (u = !0), i.peek = e, {
78
+ unsafe: [
79
+ { character: "\r", inConstruct: "mathFlowMeta" },
80
+ { character: `
81
+ `, inConstruct: "mathFlowMeta" },
82
+ {
83
+ character: "$",
84
+ after: u ? void 0 : "\\$",
85
+ inConstruct: "phrasing"
86
+ },
87
+ { character: "$", inConstruct: "mathFlowMeta" },
88
+ { atBreak: !0, character: "$", after: "\\$" }
89
+ ],
90
+ handlers: { math: o, inlineMath: i }
91
+ };
92
+ function o(c, s, m, r) {
93
+ const l = c.value || "", h = m.createTracker(r), p = "$".repeat(Math.max(q(l, "$") + 1, 2)), w = m.enter("mathFlow");
94
+ let x = h.move(p);
95
+ if (c.meta) {
96
+ const F = m.enter("mathFlowMeta");
97
+ x += h.move(
98
+ m.safe(c.meta, {
99
+ after: `
100
+ `,
101
+ before: x,
102
+ encode: ["$"],
103
+ ...h.current()
104
+ })
105
+ ), F();
106
+ }
107
+ return x += h.move(`
108
+ `), l && (x += h.move(l + `
109
+ `)), x += h.move(p), w(), x;
110
+ }
111
+ function i(c, s, m) {
112
+ let r = c.value || "", l = 1;
113
+ for (u || l++; new RegExp("(^|[^$])" + "\\$".repeat(l) + "([^$]|$)").test(r); )
114
+ l++;
115
+ const h = "$".repeat(l);
116
+ // Contains non-space.
117
+ /[^ \r\n]/.test(r) && // Starts with space and ends with space.
118
+ (/^[ \r\n]/.test(r) && /[ \r\n]$/.test(r) || // Starts or ends with dollar.
119
+ /^\$|\$$/.test(r)) && (r = " " + r + " ");
120
+ let p = -1;
121
+ for (; ++p < m.unsafe.length; ) {
122
+ const w = m.unsafe[p];
123
+ if (!w.atBreak) continue;
124
+ const x = m.compilePattern(w);
125
+ let F;
126
+ for (; F = x.exec(r); ) {
127
+ let a = F.index;
128
+ r.codePointAt(a) === 10 && r.codePointAt(a - 1) === 13 && a--, r = r.slice(0, a) + " " + r.slice(F.index + 1);
129
+ }
130
+ }
131
+ return h + r + h;
132
+ }
133
+ function e() {
134
+ return "$";
135
+ }
136
+ }
137
+ const D = {
138
+ tokenize: v,
139
+ concrete: !0,
140
+ name: "mathFlow"
141
+ }, E = {
142
+ tokenize: N,
143
+ partial: !0
144
+ };
145
+ function v(t, u, o) {
146
+ const i = this, e = i.events[i.events.length - 1], c = e && e[1].type === "linePrefix" ? e[2].sliceSerialize(e[1], !0).length : 0;
147
+ let s = 0;
148
+ return m;
149
+ function m(n) {
150
+ return t.enter("mathFlow"), t.enter("mathFlowFence"), t.enter("mathFlowFenceSequence"), r(n);
151
+ }
152
+ function r(n) {
153
+ return n === 36 ? (t.consume(n), s++, r) : s < 2 ? o(n) : (t.exit("mathFlowFenceSequence"), M(t, l, "whitespace")(n));
154
+ }
155
+ function l(n) {
156
+ return n === null || g(n) ? p(n) : (t.enter("mathFlowFenceMeta"), t.enter("chunkString", {
157
+ contentType: "string"
158
+ }), h(n));
159
+ }
160
+ function h(n) {
161
+ return n === null || g(n) ? (t.exit("chunkString"), t.exit("mathFlowFenceMeta"), p(n)) : n === 36 ? o(n) : (t.consume(n), h);
162
+ }
163
+ function p(n) {
164
+ return t.exit("mathFlowFence"), i.interrupt ? u(n) : t.attempt(E, w, f)(n);
165
+ }
166
+ function w(n) {
167
+ return t.attempt({
168
+ tokenize: z,
169
+ partial: !0
170
+ }, f, x)(n);
171
+ }
172
+ function x(n) {
173
+ return (c ? M(t, F, "linePrefix", c + 1) : F)(n);
174
+ }
175
+ function F(n) {
176
+ return n === null ? f(n) : g(n) ? t.attempt(E, w, f)(n) : (t.enter("mathFlowValue"), a(n));
177
+ }
178
+ function a(n) {
179
+ return n === null || g(n) ? (t.exit("mathFlowValue"), F(n)) : (t.consume(n), a);
180
+ }
181
+ function f(n) {
182
+ return t.exit("mathFlow"), u(n);
183
+ }
184
+ function z(n, C, k) {
185
+ let T = 0;
186
+ return M(n, $, "linePrefix", i.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4);
187
+ function $(d) {
188
+ return n.enter("mathFlowFence"), n.enter("mathFlowFenceSequence"), y(d);
189
+ }
190
+ function y(d) {
191
+ return d === 36 ? (T++, n.consume(d), y) : T < s ? k(d) : (n.exit("mathFlowFenceSequence"), M(n, S, "whitespace")(d));
192
+ }
193
+ function S(d) {
194
+ return d === null || g(d) ? (n.exit("mathFlowFence"), C(d)) : k(d);
195
+ }
196
+ }
197
+ }
198
+ function N(t, u, o) {
199
+ const i = this;
200
+ return e;
201
+ function e(s) {
202
+ return s === null ? u(s) : (t.enter("lineEnding"), t.consume(s), t.exit("lineEnding"), c);
203
+ }
204
+ function c(s) {
205
+ return i.parser.lazy[i.now().line] ? o(s) : u(s);
206
+ }
207
+ }
208
+ function I(t) {
209
+ let o = t.singleDollarTextMath;
210
+ return o == null && (o = !0), {
211
+ tokenize: i,
212
+ resolve: O,
213
+ previous: L,
214
+ name: "mathText"
215
+ };
216
+ function i(e, c, s) {
217
+ let m = 0, r, l;
218
+ return h;
219
+ function h(a) {
220
+ return e.enter("mathText"), e.enter("mathTextSequence"), p(a);
221
+ }
222
+ function p(a) {
223
+ return a === 36 ? (e.consume(a), m++, p) : m < 2 && !o ? s(a) : (e.exit("mathTextSequence"), w(a));
224
+ }
225
+ function w(a) {
226
+ return a === null ? s(a) : a === 36 ? (l = e.enter("mathTextSequence"), r = 0, F(a)) : a === 32 ? (e.enter("space"), e.consume(a), e.exit("space"), w) : g(a) ? (e.enter("lineEnding"), e.consume(a), e.exit("lineEnding"), w) : (e.enter("mathTextData"), x(a));
227
+ }
228
+ function x(a) {
229
+ return a === null || a === 32 || a === 36 || g(a) ? (e.exit("mathTextData"), w(a)) : (e.consume(a), x);
230
+ }
231
+ function F(a) {
232
+ return a === 36 ? (e.consume(a), r++, F) : r === m ? (e.exit("mathTextSequence"), e.exit("mathText"), c(a)) : (l.type = "mathTextData", x(a));
233
+ }
234
+ }
235
+ }
236
+ function O(t) {
237
+ let u = t.length - 4, o = 3, i, e;
238
+ if ((t[o][1].type === "lineEnding" || t[o][1].type === "space") && (t[u][1].type === "lineEnding" || t[u][1].type === "space")) {
239
+ for (i = o; ++i < u; )
240
+ if (t[i][1].type === "mathTextData") {
241
+ t[u][1].type = "mathTextPadding", t[o][1].type = "mathTextPadding", o += 2, u -= 2;
242
+ break;
243
+ }
244
+ }
245
+ for (i = o - 1, u++; ++i <= u; )
246
+ e === void 0 ? i !== u && t[i][1].type !== "lineEnding" && (e = i) : (i === u || t[i][1].type === "lineEnding") && (t[e][1].type = "mathTextData", i !== e + 2 && (t[e][1].end = t[i - 1][1].end, t.splice(e + 2, i - e - 2), u -= i - e - 2, i = e + 2), e = void 0);
247
+ return t;
248
+ }
249
+ function L(t) {
250
+ return t !== 36 || this.events[this.events.length - 1][1].type === "characterEscape";
251
+ }
252
+ function _(t) {
253
+ return {
254
+ flow: {
255
+ 36: D
256
+ },
257
+ text: {
258
+ 36: I(t)
259
+ }
260
+ };
261
+ }
262
+ const A = {};
263
+ function R(t) {
264
+ const u = (
265
+ /** @type {Processor} */
266
+ this
267
+ ), o = t || A, i = u.data(), e = i.micromarkExtensions || (i.micromarkExtensions = []), c = i.fromMarkdownExtensions || (i.fromMarkdownExtensions = []), s = i.toMarkdownExtensions || (i.toMarkdownExtensions = []);
268
+ e.push(_(o)), c.push(b()), s.push(P(o));
269
+ }
270
+ export {
271
+ R as default
272
+ };
@@ -0,0 +1,12 @@
1
+ function f(l, t) {
2
+ const i = String(l);
3
+ let e = i.indexOf(t), n = e, o = 0, r = 0;
4
+ if (typeof t != "string")
5
+ throw new TypeError("Expected substring");
6
+ for (; e !== -1; )
7
+ e === n ? ++o > r && (r = o) : o = 1, n = e + t.length, e = i.indexOf(t, n);
8
+ return r;
9
+ }
10
+ export {
11
+ f as longestStreak
12
+ };