@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.
- package/dist/chunks/{App.UJOunL6d.js → App.CXxtuimC.js} +4 -4
- package/dist/chunks/ChatBubbleAssistant.CfsALTQw.js +6818 -0
- package/dist/chunks/{index.gR0cu5Od.js → index.0cIpNIn7.js} +1 -1
- package/dist/chunks/index.BjoSA8Gx.js +13907 -0
- package/dist/chunks/index.Bzwo7fse.js +255 -0
- package/dist/chunks/index.CBr_x36W.js +1914 -0
- package/dist/chunks/index.Cevyj8oy.js +272 -0
- package/dist/chunks/index.Cyw5OC0t.js +12 -0
- package/dist/chunks/index.DPHH2crp.js +13125 -0
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/dist/chunks/ChatBubbleAssistant.CC-BKqpU.js +0 -8693
- package/dist/chunks/MarkdownWithExtra.Crs6q3MM.js +0 -27566
@@ -0,0 +1,255 @@
|
|
1
|
+
import { convert as A, convertElement as u } from "./ChatBubbleAssistant.CfsALTQw.js";
|
2
|
+
const f = (
|
3
|
+
// Note: overloads like this are needed to support optional generics.
|
4
|
+
/**
|
5
|
+
* @type {(
|
6
|
+
* (<Kind extends UnistParent, Check extends Test>(parent: Kind, index: Child<Kind> | number, test: Check) => Matches<Child<Kind>, Check> | undefined) &
|
7
|
+
* (<Kind extends UnistParent>(parent: Kind, index: Child<Kind> | number, test?: null | undefined) => Child<Kind> | undefined)
|
8
|
+
* )}
|
9
|
+
*/
|
10
|
+
/**
|
11
|
+
* @param {UnistParent} parent
|
12
|
+
* @param {UnistNode | number} index
|
13
|
+
* @param {Test} [test]
|
14
|
+
* @returns {UnistNode | undefined}
|
15
|
+
*/
|
16
|
+
function(e, n, l) {
|
17
|
+
const r = A(l);
|
18
|
+
if (!e || !e.type || !e.children)
|
19
|
+
throw new Error("Expected parent node");
|
20
|
+
if (typeof n == "number") {
|
21
|
+
if (n < 0 || n === Number.POSITIVE_INFINITY)
|
22
|
+
throw new Error("Expected positive finite number as index");
|
23
|
+
} else if (n = e.children.indexOf(n), n < 0)
|
24
|
+
throw new Error("Expected child node or index");
|
25
|
+
for (; ++n < e.children.length; )
|
26
|
+
if (r(e.children[n], n, e))
|
27
|
+
return e.children[n];
|
28
|
+
}
|
29
|
+
), d = /\n/g, g = /[\t ]+/g, p = u("br"), m = u(B), E = u("p"), b = u("tr"), T = u([
|
30
|
+
// List from: <https://html.spec.whatwg.org/multipage/rendering.html#hidden-elements>
|
31
|
+
"datalist",
|
32
|
+
"head",
|
33
|
+
"noembed",
|
34
|
+
"noframes",
|
35
|
+
"noscript",
|
36
|
+
// Act as if we support scripting.
|
37
|
+
"rp",
|
38
|
+
"script",
|
39
|
+
"style",
|
40
|
+
"template",
|
41
|
+
"title",
|
42
|
+
// Hidden attribute.
|
43
|
+
v,
|
44
|
+
// From: <https://html.spec.whatwg.org/multipage/rendering.html#flow-content-3>
|
45
|
+
S
|
46
|
+
]), w = u([
|
47
|
+
"address",
|
48
|
+
// Flow content
|
49
|
+
"article",
|
50
|
+
// Sections and headings
|
51
|
+
"aside",
|
52
|
+
// Sections and headings
|
53
|
+
"blockquote",
|
54
|
+
// Flow content
|
55
|
+
"body",
|
56
|
+
// Page
|
57
|
+
"caption",
|
58
|
+
// `table-caption`
|
59
|
+
"center",
|
60
|
+
// Flow content (legacy)
|
61
|
+
"dd",
|
62
|
+
// Lists
|
63
|
+
"dialog",
|
64
|
+
// Flow content
|
65
|
+
"dir",
|
66
|
+
// Lists (legacy)
|
67
|
+
"dl",
|
68
|
+
// Lists
|
69
|
+
"dt",
|
70
|
+
// Lists
|
71
|
+
"div",
|
72
|
+
// Flow content
|
73
|
+
"figure",
|
74
|
+
// Flow content
|
75
|
+
"figcaption",
|
76
|
+
// Flow content
|
77
|
+
"footer",
|
78
|
+
// Flow content
|
79
|
+
"form,",
|
80
|
+
// Flow content
|
81
|
+
"h1",
|
82
|
+
// Sections and headings
|
83
|
+
"h2",
|
84
|
+
// Sections and headings
|
85
|
+
"h3",
|
86
|
+
// Sections and headings
|
87
|
+
"h4",
|
88
|
+
// Sections and headings
|
89
|
+
"h5",
|
90
|
+
// Sections and headings
|
91
|
+
"h6",
|
92
|
+
// Sections and headings
|
93
|
+
"header",
|
94
|
+
// Flow content
|
95
|
+
"hgroup",
|
96
|
+
// Sections and headings
|
97
|
+
"hr",
|
98
|
+
// Flow content
|
99
|
+
"html",
|
100
|
+
// Page
|
101
|
+
"legend",
|
102
|
+
// Flow content
|
103
|
+
"li",
|
104
|
+
// Lists (as `display: list-item`)
|
105
|
+
"listing",
|
106
|
+
// Flow content (legacy)
|
107
|
+
"main",
|
108
|
+
// Flow content
|
109
|
+
"menu",
|
110
|
+
// Lists
|
111
|
+
"nav",
|
112
|
+
// Sections and headings
|
113
|
+
"ol",
|
114
|
+
// Lists
|
115
|
+
"p",
|
116
|
+
// Flow content
|
117
|
+
"plaintext",
|
118
|
+
// Flow content (legacy)
|
119
|
+
"pre",
|
120
|
+
// Flow content
|
121
|
+
"section",
|
122
|
+
// Sections and headings
|
123
|
+
"ul",
|
124
|
+
// Lists
|
125
|
+
"xmp"
|
126
|
+
// Flow content (legacy)
|
127
|
+
]);
|
128
|
+
function _(e, n) {
|
129
|
+
const l = n || {}, r = "children" in e ? e.children : [], s = w(e), i = y(e, {
|
130
|
+
whitespace: l.whitespace || "normal",
|
131
|
+
breakBefore: !1,
|
132
|
+
breakAfter: !1
|
133
|
+
}), t = [];
|
134
|
+
(e.type === "text" || e.type === "comment") && t.push(
|
135
|
+
...k(e, {
|
136
|
+
whitespace: i,
|
137
|
+
breakBefore: !0,
|
138
|
+
breakAfter: !0
|
139
|
+
})
|
140
|
+
);
|
141
|
+
let c = -1;
|
142
|
+
for (; ++c < r.length; )
|
143
|
+
t.push(
|
144
|
+
...x(
|
145
|
+
r[c],
|
146
|
+
// @ts-expect-error: `tree` is a parent if we’re here.
|
147
|
+
e,
|
148
|
+
{
|
149
|
+
whitespace: i,
|
150
|
+
breakBefore: c ? void 0 : s,
|
151
|
+
breakAfter: c < r.length - 1 ? p(r[c + 1]) : s
|
152
|
+
}
|
153
|
+
)
|
154
|
+
);
|
155
|
+
const o = [];
|
156
|
+
let h;
|
157
|
+
for (c = -1; ++c < t.length; ) {
|
158
|
+
const a = t[c];
|
159
|
+
typeof a == "number" ? h !== void 0 && a > h && (h = a) : a && (h !== void 0 && h > -1 && o.push(`
|
160
|
+
`.repeat(h) || " "), h = -1, o.push(a));
|
161
|
+
}
|
162
|
+
return o.join("");
|
163
|
+
}
|
164
|
+
function x(e, n, l) {
|
165
|
+
return e.type === "element" ? C(e, n, l) : e.type === "text" ? l.whitespace === "normal" ? k(e, l) : I(e) : [];
|
166
|
+
}
|
167
|
+
function C(e, n, l) {
|
168
|
+
const r = y(e, l), s = e.children || [];
|
169
|
+
let i = -1, t = [];
|
170
|
+
if (T(e))
|
171
|
+
return t;
|
172
|
+
let c, o;
|
173
|
+
for (p(e) || b(e) && // @ts-expect-error: something up with types of parents.
|
174
|
+
f(n, e, b) ? o = `
|
175
|
+
` : E(e) ? (c = 2, o = 2) : w(e) && (c = 1, o = 1); ++i < s.length; )
|
176
|
+
t = t.concat(
|
177
|
+
x(s[i], e, {
|
178
|
+
whitespace: r,
|
179
|
+
breakBefore: i ? void 0 : c,
|
180
|
+
breakAfter: i < s.length - 1 ? p(s[i + 1]) : o
|
181
|
+
})
|
182
|
+
);
|
183
|
+
return m(e) && // @ts-expect-error: something up with types of parents.
|
184
|
+
f(n, e, m) && t.push(" "), c && t.unshift(c), o && t.push(o), t;
|
185
|
+
}
|
186
|
+
function k(e, n) {
|
187
|
+
const l = String(e.value), r = [], s = [];
|
188
|
+
let i = 0;
|
189
|
+
for (; i <= l.length; ) {
|
190
|
+
d.lastIndex = i;
|
191
|
+
const o = d.exec(l), h = o && "index" in o ? o.index : l.length;
|
192
|
+
r.push(
|
193
|
+
// Any sequence of collapsible spaces and tabs immediately preceding or
|
194
|
+
// following a segment break is removed.
|
195
|
+
N(
|
196
|
+
// […] ignoring bidi formatting characters (characters with the
|
197
|
+
// Bidi_Control property [UAX9]: ALM, LTR, RTL, LRE-RLO, LRI-PDI) as if
|
198
|
+
// they were not there.
|
199
|
+
l.slice(i, h).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g, ""),
|
200
|
+
i === 0 ? n.breakBefore : !0,
|
201
|
+
h === l.length ? n.breakAfter : !0
|
202
|
+
)
|
203
|
+
), i = h + 1;
|
204
|
+
}
|
205
|
+
let t = -1, c;
|
206
|
+
for (; ++t < r.length; )
|
207
|
+
r[t].charCodeAt(r[t].length - 1) === 8203 || t < r.length - 1 && r[t + 1].charCodeAt(0) === 8203 ? (s.push(r[t]), c = void 0) : r[t] ? (typeof c == "number" && s.push(c), s.push(r[t]), c = 0) : (t === 0 || t === r.length - 1) && s.push(0);
|
208
|
+
return s;
|
209
|
+
}
|
210
|
+
function I(e) {
|
211
|
+
return [String(e.value)];
|
212
|
+
}
|
213
|
+
function N(e, n, l) {
|
214
|
+
const r = [];
|
215
|
+
let s = 0, i;
|
216
|
+
for (; s < e.length; ) {
|
217
|
+
g.lastIndex = s;
|
218
|
+
const t = g.exec(e);
|
219
|
+
i = t ? t.index : e.length, !s && !i && t && !n && r.push(""), s !== i && r.push(e.slice(s, i)), s = t ? i + t[0].length : i;
|
220
|
+
}
|
221
|
+
return s !== i && !l && r.push(""), r.join(" ");
|
222
|
+
}
|
223
|
+
function y(e, n) {
|
224
|
+
if (e.type === "element") {
|
225
|
+
const l = e.properties || {};
|
226
|
+
switch (e.tagName) {
|
227
|
+
case "listing":
|
228
|
+
case "plaintext":
|
229
|
+
case "xmp":
|
230
|
+
return "pre";
|
231
|
+
case "nobr":
|
232
|
+
return "nowrap";
|
233
|
+
case "pre":
|
234
|
+
return l.wrap ? "pre-wrap" : "pre";
|
235
|
+
case "td":
|
236
|
+
case "th":
|
237
|
+
return l.noWrap ? "nowrap" : n.whitespace;
|
238
|
+
case "textarea":
|
239
|
+
return "pre-wrap";
|
240
|
+
}
|
241
|
+
}
|
242
|
+
return n.whitespace;
|
243
|
+
}
|
244
|
+
function v(e) {
|
245
|
+
return !!(e.properties || {}).hidden;
|
246
|
+
}
|
247
|
+
function B(e) {
|
248
|
+
return e.tagName === "td" || e.tagName === "th";
|
249
|
+
}
|
250
|
+
function S(e) {
|
251
|
+
return e.tagName === "dialog" && !(e.properties || {}).open;
|
252
|
+
}
|
253
|
+
export {
|
254
|
+
_ as toText
|
255
|
+
};
|