@jam-comments/server-utilities 1.0.3 → 1.0.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/index.es.js +269 -264
- package/dist/index.umd.js +5 -5
- package/dist/markupFetcher.d.ts +1 -1
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -1,29 +1,34 @@
|
|
|
1
|
-
const
|
|
1
|
+
const V = () => {
|
|
2
|
+
var u, h;
|
|
3
|
+
return typeof process > "u" ? !1 : ((u = process.env) == null ? void 0 : u.NODE_ENV) === "production" || ((h = process.env) == null ? void 0 : h.JAM_COMMENTS_ENV) == "production";
|
|
4
|
+
}, K = () => {
|
|
2
5
|
var u;
|
|
3
6
|
return typeof process < "u" && ((u = process.env) == null ? void 0 : u.JAM_COMMENTS_BASE_URL) ? process.env.JAM_COMMENTS_BASE_URL : "https://go.jamcomments.com";
|
|
4
|
-
},
|
|
5
|
-
path:
|
|
6
|
-
domain:
|
|
7
|
-
apiKey:
|
|
7
|
+
}, ue = (u, h = fetch) => async ({
|
|
8
|
+
path: a,
|
|
9
|
+
domain: g,
|
|
10
|
+
apiKey: e
|
|
8
11
|
}) => {
|
|
9
|
-
const
|
|
10
|
-
path:
|
|
11
|
-
domain:
|
|
12
|
-
})
|
|
12
|
+
const o = new URLSearchParams({
|
|
13
|
+
path: a || "/",
|
|
14
|
+
domain: g
|
|
15
|
+
});
|
|
16
|
+
V() || o.set("stub", "true");
|
|
17
|
+
const t = `${K()}/api/markup?${o}`, n = await h(t, {
|
|
13
18
|
method: "GET",
|
|
14
19
|
headers: {
|
|
15
|
-
Authorization: `Bearer ${
|
|
20
|
+
Authorization: `Bearer ${e}`,
|
|
16
21
|
Accept: "application/json",
|
|
17
22
|
"X-Platform": u
|
|
18
23
|
}
|
|
19
24
|
});
|
|
20
|
-
if (
|
|
25
|
+
if (n.status === 401)
|
|
21
26
|
throw "JamComments: Unauthorized! Are your domain and API key set correctly?";
|
|
22
|
-
if (!
|
|
23
|
-
throw `JamComments request failed! Status code: ${
|
|
24
|
-
return await
|
|
27
|
+
if (!n.ok)
|
|
28
|
+
throw `JamComments request failed! Status code: ${n.status}, message: ${n.statusText}, request URL: ${t}`;
|
|
29
|
+
return await n.text();
|
|
25
30
|
};
|
|
26
|
-
var
|
|
31
|
+
var L = { exports: {} }, j, q;
|
|
27
32
|
function Y() {
|
|
28
33
|
return q || (q = 1, j = {
|
|
29
34
|
aliceblue: [240, 248, 255],
|
|
@@ -176,10 +181,10 @@ function Y() {
|
|
|
176
181
|
yellowgreen: [154, 205, 50]
|
|
177
182
|
}), j;
|
|
178
183
|
}
|
|
179
|
-
var
|
|
184
|
+
var E, _;
|
|
180
185
|
function U() {
|
|
181
186
|
if (_)
|
|
182
|
-
return
|
|
187
|
+
return E;
|
|
183
188
|
_ = 1;
|
|
184
189
|
const u = Y(), h = {};
|
|
185
190
|
for (const e of Object.keys(u))
|
|
@@ -201,7 +206,7 @@ function U() {
|
|
|
201
206
|
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
202
207
|
gray: { channels: 1, labels: ["gray"] }
|
|
203
208
|
};
|
|
204
|
-
|
|
209
|
+
E = a;
|
|
205
210
|
for (const e of Object.keys(a)) {
|
|
206
211
|
if (!("channels" in a[e]))
|
|
207
212
|
throw new Error("missing channels property: " + e);
|
|
@@ -209,109 +214,109 @@ function U() {
|
|
|
209
214
|
throw new Error("missing channel labels property: " + e);
|
|
210
215
|
if (a[e].labels.length !== a[e].channels)
|
|
211
216
|
throw new Error("channel and label counts mismatch: " + e);
|
|
212
|
-
const { channels:
|
|
213
|
-
delete a[e].channels, delete a[e].labels, Object.defineProperty(a[e], "channels", { value:
|
|
217
|
+
const { channels: o, labels: t } = a[e];
|
|
218
|
+
delete a[e].channels, delete a[e].labels, Object.defineProperty(a[e], "channels", { value: o }), Object.defineProperty(a[e], "labels", { value: t });
|
|
214
219
|
}
|
|
215
220
|
a.rgb.hsl = function(e) {
|
|
216
|
-
const
|
|
221
|
+
const o = e[0] / 255, t = e[1] / 255, n = e[2] / 255, r = Math.min(o, t, n), s = Math.max(o, t, n), l = s - r;
|
|
217
222
|
let c, i;
|
|
218
|
-
s ===
|
|
219
|
-
const f = (
|
|
220
|
-
return s ===
|
|
223
|
+
s === r ? c = 0 : o === s ? c = (t - n) / l : t === s ? c = 2 + (n - o) / l : n === s && (c = 4 + (o - t) / l), c = Math.min(c * 60, 360), c < 0 && (c += 360);
|
|
224
|
+
const f = (r + s) / 2;
|
|
225
|
+
return s === r ? i = 0 : f <= 0.5 ? i = l / (s + r) : i = l / (2 - s - r), [c, i * 100, f * 100];
|
|
221
226
|
}, a.rgb.hsv = function(e) {
|
|
222
|
-
let
|
|
227
|
+
let o, t, n, r, s;
|
|
223
228
|
const l = e[0] / 255, c = e[1] / 255, i = e[2] / 255, f = Math.max(l, c, i), b = f - Math.min(l, c, i), d = function(m) {
|
|
224
229
|
return (f - m) / 6 / b + 1 / 2;
|
|
225
230
|
};
|
|
226
|
-
return b === 0 ? (
|
|
227
|
-
|
|
231
|
+
return b === 0 ? (r = 0, s = 0) : (s = b / f, o = d(l), t = d(c), n = d(i), l === f ? r = n - t : c === f ? r = 1 / 3 + o - n : i === f && (r = 2 / 3 + t - o), r < 0 ? r += 1 : r > 1 && (r -= 1)), [
|
|
232
|
+
r * 360,
|
|
228
233
|
s * 100,
|
|
229
234
|
f * 100
|
|
230
235
|
];
|
|
231
236
|
}, a.rgb.hwb = function(e) {
|
|
232
|
-
const
|
|
233
|
-
let
|
|
234
|
-
const
|
|
235
|
-
return
|
|
237
|
+
const o = e[0], t = e[1];
|
|
238
|
+
let n = e[2];
|
|
239
|
+
const r = a.rgb.hsl(e)[0], s = 1 / 255 * Math.min(o, Math.min(t, n));
|
|
240
|
+
return n = 1 - 1 / 255 * Math.max(o, Math.max(t, n)), [r, s * 100, n * 100];
|
|
236
241
|
}, a.rgb.cmyk = function(e) {
|
|
237
|
-
const
|
|
238
|
-
return [s * 100, l * 100, c * 100,
|
|
242
|
+
const o = e[0] / 255, t = e[1] / 255, n = e[2] / 255, r = Math.min(1 - o, 1 - t, 1 - n), s = (1 - o - r) / (1 - r) || 0, l = (1 - t - r) / (1 - r) || 0, c = (1 - n - r) / (1 - r) || 0;
|
|
243
|
+
return [s * 100, l * 100, c * 100, r * 100];
|
|
239
244
|
};
|
|
240
|
-
function g(e,
|
|
241
|
-
return (e[0] -
|
|
245
|
+
function g(e, o) {
|
|
246
|
+
return (e[0] - o[0]) ** 2 + (e[1] - o[1]) ** 2 + (e[2] - o[2]) ** 2;
|
|
242
247
|
}
|
|
243
248
|
return a.rgb.keyword = function(e) {
|
|
244
|
-
const
|
|
245
|
-
if (
|
|
246
|
-
return
|
|
247
|
-
let t = 1 / 0,
|
|
248
|
-
for (const
|
|
249
|
-
const s = u[
|
|
250
|
-
l < t && (t = l,
|
|
249
|
+
const o = h[e];
|
|
250
|
+
if (o)
|
|
251
|
+
return o;
|
|
252
|
+
let t = 1 / 0, n;
|
|
253
|
+
for (const r of Object.keys(u)) {
|
|
254
|
+
const s = u[r], l = g(e, s);
|
|
255
|
+
l < t && (t = l, n = r);
|
|
251
256
|
}
|
|
252
|
-
return
|
|
257
|
+
return n;
|
|
253
258
|
}, a.keyword.rgb = function(e) {
|
|
254
259
|
return u[e];
|
|
255
260
|
}, a.rgb.xyz = function(e) {
|
|
256
|
-
let
|
|
257
|
-
|
|
258
|
-
const
|
|
259
|
-
return [
|
|
261
|
+
let o = e[0] / 255, t = e[1] / 255, n = e[2] / 255;
|
|
262
|
+
o = o > 0.04045 ? ((o + 0.055) / 1.055) ** 2.4 : o / 12.92, t = t > 0.04045 ? ((t + 0.055) / 1.055) ** 2.4 : t / 12.92, n = n > 0.04045 ? ((n + 0.055) / 1.055) ** 2.4 : n / 12.92;
|
|
263
|
+
const r = o * 0.4124 + t * 0.3576 + n * 0.1805, s = o * 0.2126 + t * 0.7152 + n * 0.0722, l = o * 0.0193 + t * 0.1192 + n * 0.9505;
|
|
264
|
+
return [r * 100, s * 100, l * 100];
|
|
260
265
|
}, a.rgb.lab = function(e) {
|
|
261
|
-
const
|
|
262
|
-
let t =
|
|
263
|
-
t /= 95.047,
|
|
264
|
-
const s = 116 *
|
|
266
|
+
const o = a.rgb.xyz(e);
|
|
267
|
+
let t = o[0], n = o[1], r = o[2];
|
|
268
|
+
t /= 95.047, n /= 100, r /= 108.883, t = t > 8856e-6 ? t ** (1 / 3) : 7.787 * t + 16 / 116, n = n > 8856e-6 ? n ** (1 / 3) : 7.787 * n + 16 / 116, r = r > 8856e-6 ? r ** (1 / 3) : 7.787 * r + 16 / 116;
|
|
269
|
+
const s = 116 * n - 16, l = 500 * (t - n), c = 200 * (n - r);
|
|
265
270
|
return [s, l, c];
|
|
266
271
|
}, a.hsl.rgb = function(e) {
|
|
267
|
-
const
|
|
268
|
-
let
|
|
272
|
+
const o = e[0] / 360, t = e[1] / 100, n = e[2] / 100;
|
|
273
|
+
let r, s, l;
|
|
269
274
|
if (t === 0)
|
|
270
|
-
return l =
|
|
271
|
-
|
|
272
|
-
const c = 2 *
|
|
275
|
+
return l = n * 255, [l, l, l];
|
|
276
|
+
n < 0.5 ? r = n * (1 + t) : r = n + t - n * t;
|
|
277
|
+
const c = 2 * n - r, i = [0, 0, 0];
|
|
273
278
|
for (let f = 0; f < 3; f++)
|
|
274
|
-
s =
|
|
279
|
+
s = o + 1 / 3 * -(f - 1), s < 0 && s++, s > 1 && s--, 6 * s < 1 ? l = c + (r - c) * 6 * s : 2 * s < 1 ? l = r : 3 * s < 2 ? l = c + (r - c) * (2 / 3 - s) * 6 : l = c, i[f] = l * 255;
|
|
275
280
|
return i;
|
|
276
281
|
}, a.hsl.hsv = function(e) {
|
|
277
|
-
const
|
|
278
|
-
let t = e[1] / 100,
|
|
279
|
-
const s = Math.max(
|
|
280
|
-
|
|
281
|
-
const l = (
|
|
282
|
-
return [
|
|
282
|
+
const o = e[0];
|
|
283
|
+
let t = e[1] / 100, n = e[2] / 100, r = t;
|
|
284
|
+
const s = Math.max(n, 0.01);
|
|
285
|
+
n *= 2, t *= n <= 1 ? n : 2 - n, r *= s <= 1 ? s : 2 - s;
|
|
286
|
+
const l = (n + t) / 2, c = n === 0 ? 2 * r / (s + r) : 2 * t / (n + t);
|
|
287
|
+
return [o, c * 100, l * 100];
|
|
283
288
|
}, a.hsv.rgb = function(e) {
|
|
284
|
-
const
|
|
285
|
-
let
|
|
286
|
-
const
|
|
287
|
-
switch (
|
|
289
|
+
const o = e[0] / 60, t = e[1] / 100;
|
|
290
|
+
let n = e[2] / 100;
|
|
291
|
+
const r = Math.floor(o) % 6, s = o - Math.floor(o), l = 255 * n * (1 - t), c = 255 * n * (1 - t * s), i = 255 * n * (1 - t * (1 - s));
|
|
292
|
+
switch (n *= 255, r) {
|
|
288
293
|
case 0:
|
|
289
|
-
return [
|
|
294
|
+
return [n, i, l];
|
|
290
295
|
case 1:
|
|
291
|
-
return [c,
|
|
296
|
+
return [c, n, l];
|
|
292
297
|
case 2:
|
|
293
|
-
return [l,
|
|
298
|
+
return [l, n, i];
|
|
294
299
|
case 3:
|
|
295
|
-
return [l, c,
|
|
300
|
+
return [l, c, n];
|
|
296
301
|
case 4:
|
|
297
|
-
return [i, l,
|
|
302
|
+
return [i, l, n];
|
|
298
303
|
case 5:
|
|
299
|
-
return [
|
|
304
|
+
return [n, l, c];
|
|
300
305
|
}
|
|
301
306
|
}, a.hsv.hsl = function(e) {
|
|
302
|
-
const
|
|
307
|
+
const o = e[0], t = e[1] / 100, n = e[2] / 100, r = Math.max(n, 0.01);
|
|
303
308
|
let s, l;
|
|
304
|
-
l = (2 - t) *
|
|
305
|
-
const c = (2 - t) *
|
|
306
|
-
return s = t *
|
|
309
|
+
l = (2 - t) * n;
|
|
310
|
+
const c = (2 - t) * r;
|
|
311
|
+
return s = t * r, s /= c <= 1 ? c : 2 - c, s = s || 0, l /= 2, [o, s * 100, l * 100];
|
|
307
312
|
}, a.hwb.rgb = function(e) {
|
|
308
|
-
const
|
|
309
|
-
let t = e[1] / 100,
|
|
310
|
-
const
|
|
313
|
+
const o = e[0] / 360;
|
|
314
|
+
let t = e[1] / 100, n = e[2] / 100;
|
|
315
|
+
const r = t + n;
|
|
311
316
|
let s;
|
|
312
|
-
|
|
313
|
-
const l = Math.floor(6 *
|
|
314
|
-
s = 6 *
|
|
317
|
+
r > 1 && (t /= r, n /= r);
|
|
318
|
+
const l = Math.floor(6 * o), c = 1 - n;
|
|
319
|
+
s = 6 * o - l, (l & 1) !== 0 && (s = 1 - s);
|
|
315
320
|
const i = t + s * (c - t);
|
|
316
321
|
let f, b, d;
|
|
317
322
|
switch (l) {
|
|
@@ -338,127 +343,127 @@ function U() {
|
|
|
338
343
|
}
|
|
339
344
|
return [f * 255, b * 255, d * 255];
|
|
340
345
|
}, a.cmyk.rgb = function(e) {
|
|
341
|
-
const
|
|
346
|
+
const o = e[0] / 100, t = e[1] / 100, n = e[2] / 100, r = e[3] / 100, s = 1 - Math.min(1, o * (1 - r) + r), l = 1 - Math.min(1, t * (1 - r) + r), c = 1 - Math.min(1, n * (1 - r) + r);
|
|
342
347
|
return [s * 255, l * 255, c * 255];
|
|
343
348
|
}, a.xyz.rgb = function(e) {
|
|
344
|
-
const
|
|
345
|
-
let
|
|
346
|
-
return
|
|
349
|
+
const o = e[0] / 100, t = e[1] / 100, n = e[2] / 100;
|
|
350
|
+
let r, s, l;
|
|
351
|
+
return r = o * 3.2406 + t * -1.5372 + n * -0.4986, s = o * -0.9689 + t * 1.8758 + n * 0.0415, l = o * 0.0557 + t * -0.204 + n * 1.057, r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92, s = s > 31308e-7 ? 1.055 * s ** (1 / 2.4) - 0.055 : s * 12.92, l = l > 31308e-7 ? 1.055 * l ** (1 / 2.4) - 0.055 : l * 12.92, r = Math.min(Math.max(0, r), 1), s = Math.min(Math.max(0, s), 1), l = Math.min(Math.max(0, l), 1), [r * 255, s * 255, l * 255];
|
|
347
352
|
}, a.xyz.lab = function(e) {
|
|
348
|
-
let
|
|
349
|
-
|
|
350
|
-
const
|
|
351
|
-
return [
|
|
353
|
+
let o = e[0], t = e[1], n = e[2];
|
|
354
|
+
o /= 95.047, t /= 100, n /= 108.883, o = o > 8856e-6 ? o ** (1 / 3) : 7.787 * o + 16 / 116, t = t > 8856e-6 ? t ** (1 / 3) : 7.787 * t + 16 / 116, n = n > 8856e-6 ? n ** (1 / 3) : 7.787 * n + 16 / 116;
|
|
355
|
+
const r = 116 * t - 16, s = 500 * (o - t), l = 200 * (t - n);
|
|
356
|
+
return [r, s, l];
|
|
352
357
|
}, a.lab.xyz = function(e) {
|
|
353
|
-
const
|
|
354
|
-
let
|
|
355
|
-
s = (
|
|
356
|
-
const c = s ** 3, i =
|
|
357
|
-
return s = c > 8856e-6 ? c : (s - 16 / 116) / 7.787,
|
|
358
|
+
const o = e[0], t = e[1], n = e[2];
|
|
359
|
+
let r, s, l;
|
|
360
|
+
s = (o + 16) / 116, r = t / 500 + s, l = s - n / 200;
|
|
361
|
+
const c = s ** 3, i = r ** 3, f = l ** 3;
|
|
362
|
+
return s = c > 8856e-6 ? c : (s - 16 / 116) / 7.787, r = i > 8856e-6 ? i : (r - 16 / 116) / 7.787, l = f > 8856e-6 ? f : (l - 16 / 116) / 7.787, r *= 95.047, s *= 100, l *= 108.883, [r, s, l];
|
|
358
363
|
}, a.lab.lch = function(e) {
|
|
359
|
-
const
|
|
360
|
-
let
|
|
361
|
-
|
|
362
|
-
const l = Math.sqrt(t * t +
|
|
363
|
-
return [
|
|
364
|
+
const o = e[0], t = e[1], n = e[2];
|
|
365
|
+
let r;
|
|
366
|
+
r = Math.atan2(n, t) * 360 / 2 / Math.PI, r < 0 && (r += 360);
|
|
367
|
+
const l = Math.sqrt(t * t + n * n);
|
|
368
|
+
return [o, l, r];
|
|
364
369
|
}, a.lch.lab = function(e) {
|
|
365
|
-
const
|
|
366
|
-
return [
|
|
367
|
-
}, a.rgb.ansi16 = function(e,
|
|
368
|
-
const [t,
|
|
369
|
-
let s =
|
|
370
|
+
const o = e[0], t = e[1], r = e[2] / 360 * 2 * Math.PI, s = t * Math.cos(r), l = t * Math.sin(r);
|
|
371
|
+
return [o, s, l];
|
|
372
|
+
}, a.rgb.ansi16 = function(e, o = null) {
|
|
373
|
+
const [t, n, r] = e;
|
|
374
|
+
let s = o === null ? a.rgb.hsv(e)[2] : o;
|
|
370
375
|
if (s = Math.round(s / 50), s === 0)
|
|
371
376
|
return 30;
|
|
372
|
-
let l = 30 + (Math.round(
|
|
377
|
+
let l = 30 + (Math.round(r / 255) << 2 | Math.round(n / 255) << 1 | Math.round(t / 255));
|
|
373
378
|
return s === 2 && (l += 60), l;
|
|
374
379
|
}, a.hsv.ansi16 = function(e) {
|
|
375
380
|
return a.rgb.ansi16(a.hsv.rgb(e), e[2]);
|
|
376
381
|
}, a.rgb.ansi256 = function(e) {
|
|
377
|
-
const
|
|
378
|
-
return
|
|
382
|
+
const o = e[0], t = e[1], n = e[2];
|
|
383
|
+
return o === t && t === n ? o < 8 ? 16 : o > 248 ? 231 : Math.round((o - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(o / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(n / 255 * 5);
|
|
379
384
|
}, a.ansi16.rgb = function(e) {
|
|
380
|
-
let
|
|
381
|
-
if (
|
|
382
|
-
return e > 50 && (
|
|
383
|
-
const t = (~~(e > 50) + 1) * 0.5,
|
|
384
|
-
return [
|
|
385
|
+
let o = e % 10;
|
|
386
|
+
if (o === 0 || o === 7)
|
|
387
|
+
return e > 50 && (o += 3.5), o = o / 10.5 * 255, [o, o, o];
|
|
388
|
+
const t = (~~(e > 50) + 1) * 0.5, n = (o & 1) * t * 255, r = (o >> 1 & 1) * t * 255, s = (o >> 2 & 1) * t * 255;
|
|
389
|
+
return [n, r, s];
|
|
385
390
|
}, a.ansi256.rgb = function(e) {
|
|
386
391
|
if (e >= 232) {
|
|
387
392
|
const s = (e - 232) * 10 + 8;
|
|
388
393
|
return [s, s, s];
|
|
389
394
|
}
|
|
390
395
|
e -= 16;
|
|
391
|
-
let
|
|
392
|
-
const t = Math.floor(e / 36) / 5 * 255,
|
|
393
|
-
return [t,
|
|
396
|
+
let o;
|
|
397
|
+
const t = Math.floor(e / 36) / 5 * 255, n = Math.floor((o = e % 36) / 6) / 5 * 255, r = o % 6 / 5 * 255;
|
|
398
|
+
return [t, n, r];
|
|
394
399
|
}, a.rgb.hex = function(e) {
|
|
395
400
|
const t = (((Math.round(e[0]) & 255) << 16) + ((Math.round(e[1]) & 255) << 8) + (Math.round(e[2]) & 255)).toString(16).toUpperCase();
|
|
396
401
|
return "000000".substring(t.length) + t;
|
|
397
402
|
}, a.hex.rgb = function(e) {
|
|
398
|
-
const
|
|
399
|
-
if (!
|
|
403
|
+
const o = e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
404
|
+
if (!o)
|
|
400
405
|
return [0, 0, 0];
|
|
401
|
-
let t =
|
|
402
|
-
|
|
403
|
-
const
|
|
404
|
-
return [
|
|
406
|
+
let t = o[0];
|
|
407
|
+
o[0].length === 3 && (t = t.split("").map((c) => c + c).join(""));
|
|
408
|
+
const n = parseInt(t, 16), r = n >> 16 & 255, s = n >> 8 & 255, l = n & 255;
|
|
409
|
+
return [r, s, l];
|
|
405
410
|
}, a.rgb.hcg = function(e) {
|
|
406
|
-
const
|
|
411
|
+
const o = e[0] / 255, t = e[1] / 255, n = e[2] / 255, r = Math.max(Math.max(o, t), n), s = Math.min(Math.min(o, t), n), l = r - s;
|
|
407
412
|
let c, i;
|
|
408
|
-
return l < 1 ? c = s / (1 - l) : c = 0, l <= 0 ? i = 0 :
|
|
413
|
+
return l < 1 ? c = s / (1 - l) : c = 0, l <= 0 ? i = 0 : r === o ? i = (t - n) / l % 6 : r === t ? i = 2 + (n - o) / l : i = 4 + (o - t) / l, i /= 6, i %= 1, [i * 360, l * 100, c * 100];
|
|
409
414
|
}, a.hsl.hcg = function(e) {
|
|
410
|
-
const
|
|
411
|
-
let
|
|
412
|
-
return
|
|
415
|
+
const o = e[1] / 100, t = e[2] / 100, n = t < 0.5 ? 2 * o * t : 2 * o * (1 - t);
|
|
416
|
+
let r = 0;
|
|
417
|
+
return n < 1 && (r = (t - 0.5 * n) / (1 - n)), [e[0], n * 100, r * 100];
|
|
413
418
|
}, a.hsv.hcg = function(e) {
|
|
414
|
-
const
|
|
415
|
-
let
|
|
416
|
-
return
|
|
419
|
+
const o = e[1] / 100, t = e[2] / 100, n = o * t;
|
|
420
|
+
let r = 0;
|
|
421
|
+
return n < 1 && (r = (t - n) / (1 - n)), [e[0], n * 100, r * 100];
|
|
417
422
|
}, a.hcg.rgb = function(e) {
|
|
418
|
-
const
|
|
423
|
+
const o = e[0] / 360, t = e[1] / 100, n = e[2] / 100;
|
|
419
424
|
if (t === 0)
|
|
420
|
-
return [
|
|
421
|
-
const
|
|
425
|
+
return [n * 255, n * 255, n * 255];
|
|
426
|
+
const r = [0, 0, 0], s = o % 1 * 6, l = s % 1, c = 1 - l;
|
|
422
427
|
let i = 0;
|
|
423
428
|
switch (Math.floor(s)) {
|
|
424
429
|
case 0:
|
|
425
|
-
|
|
430
|
+
r[0] = 1, r[1] = l, r[2] = 0;
|
|
426
431
|
break;
|
|
427
432
|
case 1:
|
|
428
|
-
|
|
433
|
+
r[0] = c, r[1] = 1, r[2] = 0;
|
|
429
434
|
break;
|
|
430
435
|
case 2:
|
|
431
|
-
|
|
436
|
+
r[0] = 0, r[1] = 1, r[2] = l;
|
|
432
437
|
break;
|
|
433
438
|
case 3:
|
|
434
|
-
|
|
439
|
+
r[0] = 0, r[1] = c, r[2] = 1;
|
|
435
440
|
break;
|
|
436
441
|
case 4:
|
|
437
|
-
|
|
442
|
+
r[0] = l, r[1] = 0, r[2] = 1;
|
|
438
443
|
break;
|
|
439
444
|
default:
|
|
440
|
-
|
|
445
|
+
r[0] = 1, r[1] = 0, r[2] = c;
|
|
441
446
|
}
|
|
442
|
-
return i = (1 - t) *
|
|
443
|
-
(t *
|
|
444
|
-
(t *
|
|
445
|
-
(t *
|
|
447
|
+
return i = (1 - t) * n, [
|
|
448
|
+
(t * r[0] + i) * 255,
|
|
449
|
+
(t * r[1] + i) * 255,
|
|
450
|
+
(t * r[2] + i) * 255
|
|
446
451
|
];
|
|
447
452
|
}, a.hcg.hsv = function(e) {
|
|
448
|
-
const
|
|
449
|
-
let
|
|
450
|
-
return
|
|
453
|
+
const o = e[1] / 100, t = e[2] / 100, n = o + t * (1 - o);
|
|
454
|
+
let r = 0;
|
|
455
|
+
return n > 0 && (r = o / n), [e[0], r * 100, n * 100];
|
|
451
456
|
}, a.hcg.hsl = function(e) {
|
|
452
|
-
const
|
|
453
|
-
let
|
|
454
|
-
return
|
|
457
|
+
const o = e[1] / 100, n = e[2] / 100 * (1 - o) + 0.5 * o;
|
|
458
|
+
let r = 0;
|
|
459
|
+
return n > 0 && n < 0.5 ? r = o / (2 * n) : n >= 0.5 && n < 1 && (r = o / (2 * (1 - n))), [e[0], r * 100, n * 100];
|
|
455
460
|
}, a.hcg.hwb = function(e) {
|
|
456
|
-
const
|
|
457
|
-
return [e[0], (
|
|
461
|
+
const o = e[1] / 100, t = e[2] / 100, n = o + t * (1 - o);
|
|
462
|
+
return [e[0], (n - o) * 100, (1 - n) * 100];
|
|
458
463
|
}, a.hwb.hcg = function(e) {
|
|
459
|
-
const
|
|
464
|
+
const o = e[1] / 100, n = 1 - e[2] / 100, r = n - o;
|
|
460
465
|
let s = 0;
|
|
461
|
-
return
|
|
466
|
+
return r < 1 && (s = (n - r) / (1 - r)), [e[0], r * 100, s * 100];
|
|
462
467
|
}, a.apple.rgb = function(e) {
|
|
463
468
|
return [e[0] / 65535 * 255, e[1] / 65535 * 255, e[2] / 65535 * 255];
|
|
464
469
|
}, a.rgb.apple = function(e) {
|
|
@@ -474,94 +479,94 @@ function U() {
|
|
|
474
479
|
}, a.gray.lab = function(e) {
|
|
475
480
|
return [e[0], 0, 0];
|
|
476
481
|
}, a.gray.hex = function(e) {
|
|
477
|
-
const
|
|
478
|
-
return "000000".substring(
|
|
482
|
+
const o = Math.round(e[0] / 100 * 255) & 255, n = ((o << 16) + (o << 8) + o).toString(16).toUpperCase();
|
|
483
|
+
return "000000".substring(n.length) + n;
|
|
479
484
|
}, a.rgb.gray = function(e) {
|
|
480
485
|
return [(e[0] + e[1] + e[2]) / 3 / 255 * 100];
|
|
481
|
-
},
|
|
486
|
+
}, E;
|
|
482
487
|
}
|
|
483
488
|
var O, I;
|
|
484
|
-
function
|
|
489
|
+
function H() {
|
|
485
490
|
if (I)
|
|
486
491
|
return O;
|
|
487
492
|
I = 1;
|
|
488
493
|
const u = U();
|
|
489
494
|
function h() {
|
|
490
|
-
const
|
|
491
|
-
for (let
|
|
492
|
-
|
|
495
|
+
const o = {}, t = Object.keys(u);
|
|
496
|
+
for (let n = t.length, r = 0; r < n; r++)
|
|
497
|
+
o[t[r]] = {
|
|
493
498
|
distance: -1,
|
|
494
499
|
parent: null
|
|
495
500
|
};
|
|
496
|
-
return
|
|
501
|
+
return o;
|
|
497
502
|
}
|
|
498
|
-
function a(
|
|
499
|
-
const t = h(),
|
|
500
|
-
for (t[
|
|
501
|
-
const
|
|
503
|
+
function a(o) {
|
|
504
|
+
const t = h(), n = [o];
|
|
505
|
+
for (t[o].distance = 0; n.length; ) {
|
|
506
|
+
const r = n.pop(), s = Object.keys(u[r]);
|
|
502
507
|
for (let l = s.length, c = 0; c < l; c++) {
|
|
503
508
|
const i = s[c], f = t[i];
|
|
504
|
-
f.distance === -1 && (f.distance = t[
|
|
509
|
+
f.distance === -1 && (f.distance = t[r].distance + 1, f.parent = r, n.unshift(i));
|
|
505
510
|
}
|
|
506
511
|
}
|
|
507
512
|
return t;
|
|
508
513
|
}
|
|
509
|
-
function g(
|
|
510
|
-
return function(
|
|
511
|
-
return t(
|
|
514
|
+
function g(o, t) {
|
|
515
|
+
return function(n) {
|
|
516
|
+
return t(o(n));
|
|
512
517
|
};
|
|
513
518
|
}
|
|
514
|
-
function e(
|
|
515
|
-
const
|
|
516
|
-
let
|
|
519
|
+
function e(o, t) {
|
|
520
|
+
const n = [t[o].parent, o];
|
|
521
|
+
let r = u[t[o].parent][o], s = t[o].parent;
|
|
517
522
|
for (; t[s].parent; )
|
|
518
|
-
|
|
519
|
-
return
|
|
523
|
+
n.unshift(t[s].parent), r = g(u[t[s].parent][s], r), s = t[s].parent;
|
|
524
|
+
return r.conversion = n, r;
|
|
520
525
|
}
|
|
521
|
-
return O = function(
|
|
522
|
-
const t = a(
|
|
523
|
-
for (let s =
|
|
524
|
-
const c =
|
|
525
|
-
t[c].parent !== null && (
|
|
526
|
+
return O = function(o) {
|
|
527
|
+
const t = a(o), n = {}, r = Object.keys(t);
|
|
528
|
+
for (let s = r.length, l = 0; l < s; l++) {
|
|
529
|
+
const c = r[l];
|
|
530
|
+
t[c].parent !== null && (n[c] = e(c, t));
|
|
526
531
|
}
|
|
527
|
-
return
|
|
532
|
+
return n;
|
|
528
533
|
}, O;
|
|
529
534
|
}
|
|
530
|
-
var
|
|
531
|
-
function
|
|
535
|
+
var B, N;
|
|
536
|
+
function Q() {
|
|
532
537
|
if (N)
|
|
533
|
-
return
|
|
538
|
+
return B;
|
|
534
539
|
N = 1;
|
|
535
|
-
const u = U(), h =
|
|
540
|
+
const u = U(), h = H(), a = {}, g = Object.keys(u);
|
|
536
541
|
function e(t) {
|
|
537
|
-
const
|
|
538
|
-
const s =
|
|
539
|
-
return s == null ? s : (s.length > 1 && (
|
|
542
|
+
const n = function(...r) {
|
|
543
|
+
const s = r[0];
|
|
544
|
+
return s == null ? s : (s.length > 1 && (r = s), t(r));
|
|
540
545
|
};
|
|
541
|
-
return "conversion" in t && (
|
|
546
|
+
return "conversion" in t && (n.conversion = t.conversion), n;
|
|
542
547
|
}
|
|
543
|
-
function
|
|
544
|
-
const
|
|
545
|
-
const s =
|
|
548
|
+
function o(t) {
|
|
549
|
+
const n = function(...r) {
|
|
550
|
+
const s = r[0];
|
|
546
551
|
if (s == null)
|
|
547
552
|
return s;
|
|
548
|
-
s.length > 1 && (
|
|
549
|
-
const l = t(
|
|
553
|
+
s.length > 1 && (r = s);
|
|
554
|
+
const l = t(r);
|
|
550
555
|
if (typeof l == "object")
|
|
551
556
|
for (let c = l.length, i = 0; i < c; i++)
|
|
552
557
|
l[i] = Math.round(l[i]);
|
|
553
558
|
return l;
|
|
554
559
|
};
|
|
555
|
-
return "conversion" in t && (
|
|
560
|
+
return "conversion" in t && (n.conversion = t.conversion), n;
|
|
556
561
|
}
|
|
557
562
|
return g.forEach((t) => {
|
|
558
563
|
a[t] = {}, Object.defineProperty(a[t], "channels", { value: u[t].channels }), Object.defineProperty(a[t], "labels", { value: u[t].labels });
|
|
559
|
-
const
|
|
560
|
-
Object.keys(
|
|
561
|
-
const l =
|
|
562
|
-
a[t][s] =
|
|
564
|
+
const n = h(t);
|
|
565
|
+
Object.keys(n).forEach((s) => {
|
|
566
|
+
const l = n[s];
|
|
567
|
+
a[t][s] = o(l), a[t][s].raw = e(l);
|
|
563
568
|
});
|
|
564
|
-
}),
|
|
569
|
+
}), B = a, B;
|
|
565
570
|
}
|
|
566
571
|
(function(u) {
|
|
567
572
|
const h = (l, c) => (...i) => `\x1B[${l(...i) + c}m`, a = (l, c) => (...i) => {
|
|
@@ -570,7 +575,7 @@ function H() {
|
|
|
570
575
|
}, g = (l, c) => (...i) => {
|
|
571
576
|
const f = l(...i);
|
|
572
577
|
return `\x1B[${38 + c};2;${f[0]};${f[1]};${f[2]}m`;
|
|
573
|
-
}, e = (l) => l,
|
|
578
|
+
}, e = (l) => l, o = (l, c, i) => [l, c, i], t = (l, c, i) => {
|
|
574
579
|
Object.defineProperty(l, c, {
|
|
575
580
|
get: () => {
|
|
576
581
|
const f = i();
|
|
@@ -584,11 +589,11 @@ function H() {
|
|
|
584
589
|
configurable: !0
|
|
585
590
|
});
|
|
586
591
|
};
|
|
587
|
-
let
|
|
588
|
-
const
|
|
589
|
-
|
|
592
|
+
let n;
|
|
593
|
+
const r = (l, c, i, f) => {
|
|
594
|
+
n === void 0 && (n = Q());
|
|
590
595
|
const b = f ? 10 : 0, d = {};
|
|
591
|
-
for (const [m, p] of Object.entries(
|
|
596
|
+
for (const [m, p] of Object.entries(n)) {
|
|
592
597
|
const y = m === "ansi16" ? "ansi" : m;
|
|
593
598
|
m === c ? d[y] = l(i, b) : typeof p == "object" && (d[y] = l(p[c], b));
|
|
594
599
|
}
|
|
@@ -658,43 +663,43 @@ function H() {
|
|
|
658
663
|
return Object.defineProperty(c, "codes", {
|
|
659
664
|
value: l,
|
|
660
665
|
enumerable: !1
|
|
661
|
-
}), c.color.close = "\x1B[39m", c.bgColor.close = "\x1B[49m", t(c.color, "ansi", () =>
|
|
666
|
+
}), c.color.close = "\x1B[39m", c.bgColor.close = "\x1B[49m", t(c.color, "ansi", () => r(h, "ansi16", e, !1)), t(c.color, "ansi256", () => r(a, "ansi256", e, !1)), t(c.color, "ansi16m", () => r(g, "rgb", o, !1)), t(c.bgColor, "ansi", () => r(h, "ansi16", e, !0)), t(c.bgColor, "ansi256", () => r(a, "ansi256", e, !0)), t(c.bgColor, "ansi16m", () => r(g, "rgb", o, !0)), c;
|
|
662
667
|
}
|
|
663
668
|
Object.defineProperty(u, "exports", {
|
|
664
669
|
enumerable: !0,
|
|
665
670
|
get: s
|
|
666
671
|
});
|
|
667
|
-
})(
|
|
668
|
-
var
|
|
672
|
+
})(L);
|
|
673
|
+
var Z = {
|
|
669
674
|
stdout: !1,
|
|
670
675
|
stderr: !1
|
|
671
676
|
};
|
|
672
|
-
const
|
|
677
|
+
const ee = (u, h, a) => {
|
|
673
678
|
let g = u.indexOf(h);
|
|
674
679
|
if (g === -1)
|
|
675
680
|
return u;
|
|
676
681
|
const e = h.length;
|
|
677
|
-
let
|
|
682
|
+
let o = 0, t = "";
|
|
678
683
|
do
|
|
679
|
-
t += u.substr(
|
|
684
|
+
t += u.substr(o, g - o) + h + a, o = g + e, g = u.indexOf(h, o);
|
|
680
685
|
while (g !== -1);
|
|
681
|
-
return t += u.substr(
|
|
682
|
-
},
|
|
683
|
-
let e = 0,
|
|
686
|
+
return t += u.substr(o), t;
|
|
687
|
+
}, te = (u, h, a, g) => {
|
|
688
|
+
let e = 0, o = "";
|
|
684
689
|
do {
|
|
685
690
|
const t = u[g - 1] === "\r";
|
|
686
|
-
|
|
691
|
+
o += u.substr(e, (t ? g - 1 : g) - e) + h + (t ? `\r
|
|
687
692
|
` : `
|
|
688
693
|
`) + a, e = g + 1, g = u.indexOf(`
|
|
689
694
|
`, e);
|
|
690
695
|
} while (g !== -1);
|
|
691
|
-
return
|
|
696
|
+
return o += u.substr(e), o;
|
|
692
697
|
};
|
|
693
|
-
var
|
|
694
|
-
stringReplaceAll:
|
|
695
|
-
stringEncaseCRLFWithFirstIndex:
|
|
698
|
+
var ne = {
|
|
699
|
+
stringReplaceAll: ee,
|
|
700
|
+
stringEncaseCRLFWithFirstIndex: te
|
|
696
701
|
}, S, z;
|
|
697
|
-
function
|
|
702
|
+
function re() {
|
|
698
703
|
if (z)
|
|
699
704
|
return S;
|
|
700
705
|
z = 1;
|
|
@@ -711,7 +716,7 @@ function ne() {
|
|
|
711
716
|
["e", "\x1B"],
|
|
712
717
|
["a", "\x07"]
|
|
713
718
|
]);
|
|
714
|
-
function
|
|
719
|
+
function o(s) {
|
|
715
720
|
const l = s[0] === "u", c = s[1] === "{";
|
|
716
721
|
return l && !c && s.length === 5 || s[0] === "x" && s.length === 3 ? String.fromCharCode(parseInt(s.slice(1), 16)) : l && c ? String.fromCodePoint(parseInt(s.slice(2, -1), 16)) : e.get(s) || s;
|
|
717
722
|
}
|
|
@@ -723,13 +728,13 @@ function ne() {
|
|
|
723
728
|
if (!Number.isNaN(d))
|
|
724
729
|
c.push(d);
|
|
725
730
|
else if (f = b.match(a))
|
|
726
|
-
c.push(f[2].replace(g, (m, p, y) => p ?
|
|
731
|
+
c.push(f[2].replace(g, (m, p, y) => p ? o(p) : y));
|
|
727
732
|
else
|
|
728
733
|
throw new Error(`Invalid Chalk template style argument: ${b} (in style '${s}')`);
|
|
729
734
|
}
|
|
730
735
|
return c;
|
|
731
736
|
}
|
|
732
|
-
function
|
|
737
|
+
function n(s) {
|
|
733
738
|
h.lastIndex = 0;
|
|
734
739
|
const l = [];
|
|
735
740
|
let c;
|
|
@@ -743,7 +748,7 @@ function ne() {
|
|
|
743
748
|
}
|
|
744
749
|
return l;
|
|
745
750
|
}
|
|
746
|
-
function
|
|
751
|
+
function r(s, l) {
|
|
747
752
|
const c = {};
|
|
748
753
|
for (const f of l)
|
|
749
754
|
for (const b of f.styles)
|
|
@@ -762,14 +767,14 @@ function ne() {
|
|
|
762
767
|
let f = [];
|
|
763
768
|
if (l.replace(u, (b, d, m, p, y, D) => {
|
|
764
769
|
if (d)
|
|
765
|
-
f.push(
|
|
770
|
+
f.push(o(d));
|
|
766
771
|
else if (p) {
|
|
767
|
-
const
|
|
768
|
-
f = [], i.push(c.length === 0 ?
|
|
772
|
+
const F = f.join("");
|
|
773
|
+
f = [], i.push(c.length === 0 ? F : r(s, c)(F)), c.push({ inverse: m, styles: n(p) });
|
|
769
774
|
} else if (y) {
|
|
770
775
|
if (c.length === 0)
|
|
771
776
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
772
|
-
i.push(
|
|
777
|
+
i.push(r(s, c)(f.join(""))), f = [], c.pop();
|
|
773
778
|
} else
|
|
774
779
|
f.push(D);
|
|
775
780
|
}), i.push(f.join("")), c.length > 0) {
|
|
@@ -779,38 +784,38 @@ function ne() {
|
|
|
779
784
|
return i.join("");
|
|
780
785
|
}, S;
|
|
781
786
|
}
|
|
782
|
-
const w =
|
|
783
|
-
stringReplaceAll:
|
|
784
|
-
stringEncaseCRLFWithFirstIndex:
|
|
785
|
-
} =
|
|
787
|
+
const w = L.exports, { stdout: $, stderr: P } = Z, {
|
|
788
|
+
stringReplaceAll: oe,
|
|
789
|
+
stringEncaseCRLFWithFirstIndex: se
|
|
790
|
+
} = ne, { isArray: k } = Array, G = [
|
|
786
791
|
"ansi",
|
|
787
792
|
"ansi",
|
|
788
793
|
"ansi256",
|
|
789
794
|
"ansi16m"
|
|
790
|
-
], v = /* @__PURE__ */ Object.create(null),
|
|
795
|
+
], v = /* @__PURE__ */ Object.create(null), le = (u, h = {}) => {
|
|
791
796
|
if (h.level && !(Number.isInteger(h.level) && h.level >= 0 && h.level <= 3))
|
|
792
797
|
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
793
798
|
const a = $ ? $.level : 0;
|
|
794
799
|
u.level = h.level === void 0 ? a : h.level;
|
|
795
800
|
};
|
|
796
|
-
class
|
|
801
|
+
class ce {
|
|
797
802
|
constructor(h) {
|
|
798
803
|
return J(h);
|
|
799
804
|
}
|
|
800
805
|
}
|
|
801
806
|
const J = (u) => {
|
|
802
807
|
const h = {};
|
|
803
|
-
return
|
|
808
|
+
return le(h, u), h.template = (...a) => X(h.template, ...a), Object.setPrototypeOf(h, M.prototype), Object.setPrototypeOf(h.template, h), h.template.constructor = () => {
|
|
804
809
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
805
|
-
}, h.template.Instance =
|
|
810
|
+
}, h.template.Instance = ce, h.template;
|
|
806
811
|
};
|
|
807
|
-
function
|
|
812
|
+
function M(u) {
|
|
808
813
|
return J(u);
|
|
809
814
|
}
|
|
810
815
|
for (const [u, h] of Object.entries(w))
|
|
811
816
|
v[u] = {
|
|
812
817
|
get() {
|
|
813
|
-
const a = C(this,
|
|
818
|
+
const a = C(this, R(h.open, h.close, this._styler), this._isEmpty);
|
|
814
819
|
return Object.defineProperty(this, u, { value: a }), a;
|
|
815
820
|
}
|
|
816
821
|
};
|
|
@@ -826,7 +831,7 @@ for (const u of W)
|
|
|
826
831
|
get() {
|
|
827
832
|
const { level: h } = this;
|
|
828
833
|
return function(...a) {
|
|
829
|
-
const g =
|
|
834
|
+
const g = R(w.color[G[h]][u](...a), w.color.close, this._styler);
|
|
830
835
|
return C(this, g, this._isEmpty);
|
|
831
836
|
};
|
|
832
837
|
}
|
|
@@ -837,13 +842,13 @@ for (const u of W) {
|
|
|
837
842
|
get() {
|
|
838
843
|
const { level: a } = this;
|
|
839
844
|
return function(...g) {
|
|
840
|
-
const e =
|
|
845
|
+
const e = R(w.bgColor[G[a]][u](...g), w.bgColor.close, this._styler);
|
|
841
846
|
return C(this, e, this._isEmpty);
|
|
842
847
|
};
|
|
843
848
|
}
|
|
844
849
|
};
|
|
845
850
|
}
|
|
846
|
-
const
|
|
851
|
+
const ae = Object.defineProperties(() => {
|
|
847
852
|
}, {
|
|
848
853
|
...v,
|
|
849
854
|
level: {
|
|
@@ -855,7 +860,7 @@ const ce = Object.defineProperties(() => {
|
|
|
855
860
|
this._generator.level = u;
|
|
856
861
|
}
|
|
857
862
|
}
|
|
858
|
-
}),
|
|
863
|
+
}), R = (u, h, a) => {
|
|
859
864
|
let g, e;
|
|
860
865
|
return a === void 0 ? (g = u, e = h) : (g = a.openAll + u, e = h + a.closeAll), {
|
|
861
866
|
open: u,
|
|
@@ -865,9 +870,9 @@ const ce = Object.defineProperties(() => {
|
|
|
865
870
|
parent: a
|
|
866
871
|
};
|
|
867
872
|
}, C = (u, h, a) => {
|
|
868
|
-
const g = (...e) => k(e[0]) && k(e[0].raw) ?
|
|
869
|
-
return Object.setPrototypeOf(g,
|
|
870
|
-
},
|
|
873
|
+
const g = (...e) => k(e[0]) && k(e[0].raw) ? T(g, X(g, ...e)) : T(g, e.length === 1 ? "" + e[0] : e.join(" "));
|
|
874
|
+
return Object.setPrototypeOf(g, ae), g._generator = u, g._styler = h, g._isEmpty = a, g;
|
|
875
|
+
}, T = (u, h) => {
|
|
871
876
|
if (u.level <= 0 || !h)
|
|
872
877
|
return u._isEmpty ? "" : h;
|
|
873
878
|
let a = u._styler;
|
|
@@ -876,10 +881,10 @@ const ce = Object.defineProperties(() => {
|
|
|
876
881
|
const { openAll: g, closeAll: e } = a;
|
|
877
882
|
if (h.indexOf("\x1B") !== -1)
|
|
878
883
|
for (; a !== void 0; )
|
|
879
|
-
h =
|
|
880
|
-
const
|
|
884
|
+
h = oe(h, a.close, a.open), a = a.parent;
|
|
885
|
+
const o = h.indexOf(`
|
|
881
886
|
`);
|
|
882
|
-
return
|
|
887
|
+
return o !== -1 && (h = se(h, e, g, o)), g + h + e;
|
|
883
888
|
};
|
|
884
889
|
let A;
|
|
885
890
|
const X = (u, ...h) => {
|
|
@@ -887,26 +892,26 @@ const X = (u, ...h) => {
|
|
|
887
892
|
if (!k(a) || !k(a.raw))
|
|
888
893
|
return h.join(" ");
|
|
889
894
|
const g = h.slice(1), e = [a.raw[0]];
|
|
890
|
-
for (let
|
|
895
|
+
for (let o = 1; o < a.length; o++)
|
|
891
896
|
e.push(
|
|
892
|
-
String(g[
|
|
893
|
-
String(a.raw[
|
|
897
|
+
String(g[o - 1]).replace(/[{}\\]/g, "\\$&"),
|
|
898
|
+
String(a.raw[o])
|
|
894
899
|
);
|
|
895
|
-
return A === void 0 && (A =
|
|
900
|
+
return A === void 0 && (A = re()), A(u, e.join(""));
|
|
896
901
|
};
|
|
897
|
-
Object.defineProperties(
|
|
898
|
-
const
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
var
|
|
903
|
-
const
|
|
904
|
-
console.log(`${
|
|
905
|
-
},
|
|
902
|
+
Object.defineProperties(M.prototype, v);
|
|
903
|
+
const x = M();
|
|
904
|
+
x.supportsColor = $;
|
|
905
|
+
x.stderr = M({ level: P ? P.level : 0 });
|
|
906
|
+
x.stderr.supportsColor = P;
|
|
907
|
+
var ie = x;
|
|
908
|
+
const he = (u) => {
|
|
909
|
+
console.log(`${ie.magenta("JamComments:")} ${u}`);
|
|
910
|
+
}, fe = (u) => {
|
|
906
911
|
console.error(`JamComments: ${u}`);
|
|
907
912
|
};
|
|
908
913
|
export {
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
914
|
+
he as log,
|
|
915
|
+
fe as logError,
|
|
916
|
+
ue as markupFetcher
|
|
912
917
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(m,k){typeof exports=="object"&&typeof module<"u"?k(exports):typeof define=="function"&&define.amd?define(["exports"],k):(m=typeof globalThis<"u"?globalThis:m||self,k(m.JamComments={}))})(this,function(m){"use strict";const k=()=>{var u;return typeof process<"u"&&((u=process.env)==null?void 0:u.JAM_COMMENTS_BASE_URL)?process.env.JAM_COMMENTS_BASE_URL:"https://go.jamcomments.com"},Y=u=>async({path:h,domain:i,apiKey:g})=>{const e=new URLSearchParams({path:h||"/",domain:i}),r=`${k()}/api/markup?${e}`,t=await fetch(r,{method:"GET",headers:{Authorization:`Bearer ${g}`,Accept:"application/json","X-Platform":u}});if(t.status===401)throw"JamComments: Unauthorized! Are your domain and API key set correctly?";if(!t.ok)throw`JamComments request failed! Status code: ${t.status}, message: ${t.statusText}, request URL: ${r}`;return await t.text()};var _={exports:{}},O,I;function V(){return I||(I=1,O={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),O}var B,N;function T(){if(N)return B;N=1;const u=V(),h={};for(const e of Object.keys(u))h[u[e]]=e;const i={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};B=i;for(const e of Object.keys(i)){if(!("channels"in i[e]))throw new Error("missing channels property: "+e);if(!("labels"in i[e]))throw new Error("missing channel labels property: "+e);if(i[e].labels.length!==i[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:r,labels:t}=i[e];delete i[e].channels,delete i[e].labels,Object.defineProperty(i[e],"channels",{value:r}),Object.defineProperty(i[e],"labels",{value:t})}i.rgb.hsl=function(e){const r=e[0]/255,t=e[1]/255,o=e[2]/255,n=Math.min(r,t,o),s=Math.max(r,t,o),l=s-n;let c,a;s===n?c=0:r===s?c=(t-o)/l:t===s?c=2+(o-r)/l:o===s&&(c=4+(r-t)/l),c=Math.min(c*60,360),c<0&&(c+=360);const f=(n+s)/2;return s===n?a=0:f<=.5?a=l/(s+n):a=l/(2-s-n),[c,a*100,f*100]},i.rgb.hsv=function(e){let r,t,o,n,s;const l=e[0]/255,c=e[1]/255,a=e[2]/255,f=Math.max(l,c,a),d=f-Math.min(l,c,a),b=function(p){return(f-p)/6/d+1/2};return d===0?(n=0,s=0):(s=d/f,r=b(l),t=b(c),o=b(a),l===f?n=o-t:c===f?n=1/3+r-o:a===f&&(n=2/3+t-r),n<0?n+=1:n>1&&(n-=1)),[n*360,s*100,f*100]},i.rgb.hwb=function(e){const r=e[0],t=e[1];let o=e[2];const n=i.rgb.hsl(e)[0],s=1/255*Math.min(r,Math.min(t,o));return o=1-1/255*Math.max(r,Math.max(t,o)),[n,s*100,o*100]},i.rgb.cmyk=function(e){const r=e[0]/255,t=e[1]/255,o=e[2]/255,n=Math.min(1-r,1-t,1-o),s=(1-r-n)/(1-n)||0,l=(1-t-n)/(1-n)||0,c=(1-o-n)/(1-n)||0;return[s*100,l*100,c*100,n*100]};function g(e,r){return(e[0]-r[0])**2+(e[1]-r[1])**2+(e[2]-r[2])**2}return i.rgb.keyword=function(e){const r=h[e];if(r)return r;let t=1/0,o;for(const n of Object.keys(u)){const s=u[n],l=g(e,s);l<t&&(t=l,o=n)}return o},i.keyword.rgb=function(e){return u[e]},i.rgb.xyz=function(e){let r=e[0]/255,t=e[1]/255,o=e[2]/255;r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92;const n=r*.4124+t*.3576+o*.1805,s=r*.2126+t*.7152+o*.0722,l=r*.0193+t*.1192+o*.9505;return[n*100,s*100,l*100]},i.rgb.lab=function(e){const r=i.rgb.xyz(e);let t=r[0],o=r[1],n=r[2];t/=95.047,o/=100,n/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;const s=116*o-16,l=500*(t-o),c=200*(o-n);return[s,l,c]},i.hsl.rgb=function(e){const r=e[0]/360,t=e[1]/100,o=e[2]/100;let n,s,l;if(t===0)return l=o*255,[l,l,l];o<.5?n=o*(1+t):n=o+t-o*t;const c=2*o-n,a=[0,0,0];for(let f=0;f<3;f++)s=r+1/3*-(f-1),s<0&&s++,s>1&&s--,6*s<1?l=c+(n-c)*6*s:2*s<1?l=n:3*s<2?l=c+(n-c)*(2/3-s)*6:l=c,a[f]=l*255;return a},i.hsl.hsv=function(e){const r=e[0];let t=e[1]/100,o=e[2]/100,n=t;const s=Math.max(o,.01);o*=2,t*=o<=1?o:2-o,n*=s<=1?s:2-s;const l=(o+t)/2,c=o===0?2*n/(s+n):2*t/(o+t);return[r,c*100,l*100]},i.hsv.rgb=function(e){const r=e[0]/60,t=e[1]/100;let o=e[2]/100;const n=Math.floor(r)%6,s=r-Math.floor(r),l=255*o*(1-t),c=255*o*(1-t*s),a=255*o*(1-t*(1-s));switch(o*=255,n){case 0:return[o,a,l];case 1:return[c,o,l];case 2:return[l,o,a];case 3:return[l,c,o];case 4:return[a,l,o];case 5:return[o,l,c]}},i.hsv.hsl=function(e){const r=e[0],t=e[1]/100,o=e[2]/100,n=Math.max(o,.01);let s,l;l=(2-t)*o;const c=(2-t)*n;return s=t*n,s/=c<=1?c:2-c,s=s||0,l/=2,[r,s*100,l*100]},i.hwb.rgb=function(e){const r=e[0]/360;let t=e[1]/100,o=e[2]/100;const n=t+o;let s;n>1&&(t/=n,o/=n);const l=Math.floor(6*r),c=1-o;s=6*r-l,(l&1)!==0&&(s=1-s);const a=t+s*(c-t);let f,d,b;switch(l){default:case 6:case 0:f=c,d=a,b=t;break;case 1:f=a,d=c,b=t;break;case 2:f=t,d=c,b=a;break;case 3:f=t,d=a,b=c;break;case 4:f=a,d=t,b=c;break;case 5:f=c,d=t,b=a;break}return[f*255,d*255,b*255]},i.cmyk.rgb=function(e){const r=e[0]/100,t=e[1]/100,o=e[2]/100,n=e[3]/100,s=1-Math.min(1,r*(1-n)+n),l=1-Math.min(1,t*(1-n)+n),c=1-Math.min(1,o*(1-n)+n);return[s*255,l*255,c*255]},i.xyz.rgb=function(e){const r=e[0]/100,t=e[1]/100,o=e[2]/100;let n,s,l;return n=r*3.2406+t*-1.5372+o*-.4986,s=r*-.9689+t*1.8758+o*.0415,l=r*.0557+t*-.204+o*1.057,n=n>.0031308?1.055*n**(1/2.4)-.055:n*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,n=Math.min(Math.max(0,n),1),s=Math.min(Math.max(0,s),1),l=Math.min(Math.max(0,l),1),[n*255,s*255,l*255]},i.xyz.lab=function(e){let r=e[0],t=e[1],o=e[2];r/=95.047,t/=100,o/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,t=t>.008856?t**(1/3):7.787*t+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;const n=116*t-16,s=500*(r-t),l=200*(t-o);return[n,s,l]},i.lab.xyz=function(e){const r=e[0],t=e[1],o=e[2];let n,s,l;s=(r+16)/116,n=t/500+s,l=s-o/200;const c=s**3,a=n**3,f=l**3;return s=c>.008856?c:(s-16/116)/7.787,n=a>.008856?a:(n-16/116)/7.787,l=f>.008856?f:(l-16/116)/7.787,n*=95.047,s*=100,l*=108.883,[n,s,l]},i.lab.lch=function(e){const r=e[0],t=e[1],o=e[2];let n;n=Math.atan2(o,t)*360/2/Math.PI,n<0&&(n+=360);const l=Math.sqrt(t*t+o*o);return[r,l,n]},i.lch.lab=function(e){const r=e[0],t=e[1],n=e[2]/360*2*Math.PI,s=t*Math.cos(n),l=t*Math.sin(n);return[r,s,l]},i.rgb.ansi16=function(e,r=null){const[t,o,n]=e;let s=r===null?i.rgb.hsv(e)[2]:r;if(s=Math.round(s/50),s===0)return 30;let l=30+(Math.round(n/255)<<2|Math.round(o/255)<<1|Math.round(t/255));return s===2&&(l+=60),l},i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])},i.rgb.ansi256=function(e){const r=e[0],t=e[1],o=e[2];return r===t&&t===o?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(t/255*5)+Math.round(o/255*5)},i.ansi16.rgb=function(e){let r=e%10;if(r===0||r===7)return e>50&&(r+=3.5),r=r/10.5*255,[r,r,r];const t=(~~(e>50)+1)*.5,o=(r&1)*t*255,n=(r>>1&1)*t*255,s=(r>>2&1)*t*255;return[o,n,s]},i.ansi256.rgb=function(e){if(e>=232){const s=(e-232)*10+8;return[s,s,s]}e-=16;let r;const t=Math.floor(e/36)/5*255,o=Math.floor((r=e%36)/6)/5*255,n=r%6/5*255;return[t,o,n]},i.rgb.hex=function(e){const t=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(t.length)+t},i.hex.rgb=function(e){const r=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!r)return[0,0,0];let t=r[0];r[0].length===3&&(t=t.split("").map(c=>c+c).join(""));const o=parseInt(t,16),n=o>>16&255,s=o>>8&255,l=o&255;return[n,s,l]},i.rgb.hcg=function(e){const r=e[0]/255,t=e[1]/255,o=e[2]/255,n=Math.max(Math.max(r,t),o),s=Math.min(Math.min(r,t),o),l=n-s;let c,a;return l<1?c=s/(1-l):c=0,l<=0?a=0:n===r?a=(t-o)/l%6:n===t?a=2+(o-r)/l:a=4+(r-t)/l,a/=6,a%=1,[a*360,l*100,c*100]},i.hsl.hcg=function(e){const r=e[1]/100,t=e[2]/100,o=t<.5?2*r*t:2*r*(1-t);let n=0;return o<1&&(n=(t-.5*o)/(1-o)),[e[0],o*100,n*100]},i.hsv.hcg=function(e){const r=e[1]/100,t=e[2]/100,o=r*t;let n=0;return o<1&&(n=(t-o)/(1-o)),[e[0],o*100,n*100]},i.hcg.rgb=function(e){const r=e[0]/360,t=e[1]/100,o=e[2]/100;if(t===0)return[o*255,o*255,o*255];const n=[0,0,0],s=r%1*6,l=s%1,c=1-l;let a=0;switch(Math.floor(s)){case 0:n[0]=1,n[1]=l,n[2]=0;break;case 1:n[0]=c,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=l;break;case 3:n[0]=0,n[1]=c,n[2]=1;break;case 4:n[0]=l,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=c}return a=(1-t)*o,[(t*n[0]+a)*255,(t*n[1]+a)*255,(t*n[2]+a)*255]},i.hcg.hsv=function(e){const r=e[1]/100,t=e[2]/100,o=r+t*(1-r);let n=0;return o>0&&(n=r/o),[e[0],n*100,o*100]},i.hcg.hsl=function(e){const r=e[1]/100,o=e[2]/100*(1-r)+.5*r;let n=0;return o>0&&o<.5?n=r/(2*o):o>=.5&&o<1&&(n=r/(2*(1-o))),[e[0],n*100,o*100]},i.hcg.hwb=function(e){const r=e[1]/100,t=e[2]/100,o=r+t*(1-r);return[e[0],(o-r)*100,(1-o)*100]},i.hwb.hcg=function(e){const r=e[1]/100,o=1-e[2]/100,n=o-r;let s=0;return n<1&&(s=(o-n)/(1-n)),[e[0],n*100,s*100]},i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},i.gray.hsl=function(e){return[0,0,e[0]]},i.gray.hsv=i.gray.hsl,i.gray.hwb=function(e){return[0,100,e[0]]},i.gray.cmyk=function(e){return[0,0,0,e[0]]},i.gray.lab=function(e){return[e[0],0,0]},i.gray.hex=function(e){const r=Math.round(e[0]/100*255)&255,o=((r<<16)+(r<<8)+r).toString(16).toUpperCase();return"000000".substring(o.length)+o},i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]},B}var S,z;function H(){if(z)return S;z=1;const u=T();function h(){const r={},t=Object.keys(u);for(let o=t.length,n=0;n<o;n++)r[t[n]]={distance:-1,parent:null};return r}function i(r){const t=h(),o=[r];for(t[r].distance=0;o.length;){const n=o.pop(),s=Object.keys(u[n]);for(let l=s.length,c=0;c<l;c++){const a=s[c],f=t[a];f.distance===-1&&(f.distance=t[n].distance+1,f.parent=n,o.unshift(a))}}return t}function g(r,t){return function(o){return t(r(o))}}function e(r,t){const o=[t[r].parent,r];let n=u[t[r].parent][r],s=t[r].parent;for(;t[s].parent;)o.unshift(t[s].parent),n=g(u[t[s].parent][s],n),s=t[s].parent;return n.conversion=o,n}return S=function(r){const t=i(r),o={},n=Object.keys(t);for(let s=n.length,l=0;l<s;l++){const c=n[l];t[c].parent!==null&&(o[c]=e(c,t))}return o},S}var $,L;function Q(){if(L)return $;L=1;const u=T(),h=H(),i={},g=Object.keys(u);function e(t){const o=function(...n){const s=n[0];return s==null?s:(s.length>1&&(n=s),t(n))};return"conversion"in t&&(o.conversion=t.conversion),o}function r(t){const o=function(...n){const s=n[0];if(s==null)return s;s.length>1&&(n=s);const l=t(n);if(typeof l=="object")for(let c=l.length,a=0;a<c;a++)l[a]=Math.round(l[a]);return l};return"conversion"in t&&(o.conversion=t.conversion),o}return g.forEach(t=>{i[t]={},Object.defineProperty(i[t],"channels",{value:u[t].channels}),Object.defineProperty(i[t],"labels",{value:u[t].labels});const o=h(t);Object.keys(o).forEach(s=>{const l=o[s];i[t][s]=r(l),i[t][s].raw=e(l)})}),$=i,$}(function(u){const h=(l,c)=>(...a)=>`\x1B[${l(...a)+c}m`,i=(l,c)=>(...a)=>{const f=l(...a);return`\x1B[${38+c};5;${f}m`},g=(l,c)=>(...a)=>{const f=l(...a);return`\x1B[${38+c};2;${f[0]};${f[1]};${f[2]}m`},e=l=>l,r=(l,c,a)=>[l,c,a],t=(l,c,a)=>{Object.defineProperty(l,c,{get:()=>{const f=a();return Object.defineProperty(l,c,{value:f,enumerable:!0,configurable:!0}),f},enumerable:!0,configurable:!0})};let o;const n=(l,c,a,f)=>{o===void 0&&(o=Q());const d=f?10:0,b={};for(const[p,y]of Object.entries(o)){const w=p==="ansi16"?"ansi":p;p===c?b[w]=l(a,d):typeof y=="object"&&(b[w]=l(y[c],d))}return b};function s(){const l=new Map,c={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};c.color.gray=c.color.blackBright,c.bgColor.bgGray=c.bgColor.bgBlackBright,c.color.grey=c.color.blackBright,c.bgColor.bgGrey=c.bgColor.bgBlackBright;for(const[a,f]of Object.entries(c)){for(const[d,b]of Object.entries(f))c[d]={open:`\x1B[${b[0]}m`,close:`\x1B[${b[1]}m`},f[d]=c[d],l.set(b[0],b[1]);Object.defineProperty(c,a,{value:f,enumerable:!1})}return Object.defineProperty(c,"codes",{value:l,enumerable:!1}),c.color.close="\x1B[39m",c.bgColor.close="\x1B[49m",t(c.color,"ansi",()=>n(h,"ansi16",e,!1)),t(c.color,"ansi256",()=>n(i,"ansi256",e,!1)),t(c.color,"ansi16m",()=>n(g,"rgb",r,!1)),t(c.bgColor,"ansi",()=>n(h,"ansi16",e,!0)),t(c.bgColor,"ansi256",()=>n(i,"ansi256",e,!0)),t(c.bgColor,"ansi16m",()=>n(g,"rgb",r,!0)),c}Object.defineProperty(u,"exports",{enumerable:!0,get:s})})(_);var Z={stdout:!1,stderr:!1},ee={stringReplaceAll:(u,h,i)=>{let g=u.indexOf(h);if(g===-1)return u;const e=h.length;let r=0,t="";do t+=u.substr(r,g-r)+h+i,r=g+e,g=u.indexOf(h,r);while(g!==-1);return t+=u.substr(r),t},stringEncaseCRLFWithFirstIndex:(u,h,i,g)=>{let e=0,r="";do{const t=u[g-1]==="\r";r+=u.substr(e,(t?g-1:g)-e)+h+(t?`\r
|
|
1
|
+
(function(m,k){typeof exports=="object"&&typeof module<"u"?k(exports):typeof define=="function"&&define.amd?define(["exports"],k):(m=typeof globalThis<"u"?globalThis:m||self,k(m.JamComments={}))})(this,function(m){"use strict";const k=()=>{var u,h;return typeof process>"u"?!1:((u=process.env)==null?void 0:u.NODE_ENV)==="production"||((h=process.env)==null?void 0:h.JAM_COMMENTS_ENV)=="production"},K=()=>{var u;return typeof process<"u"&&((u=process.env)==null?void 0:u.JAM_COMMENTS_BASE_URL)?process.env.JAM_COMMENTS_BASE_URL:"https://go.jamcomments.com"},Y=(u,h=fetch)=>async({path:i,domain:d,apiKey:e})=>{const o=new URLSearchParams({path:i||"/",domain:d});k()||o.set("stub","true");const t=`${K()}/api/markup?${o}`,n=await h(t,{method:"GET",headers:{Authorization:`Bearer ${e}`,Accept:"application/json","X-Platform":u}});if(n.status===401)throw"JamComments: Unauthorized! Are your domain and API key set correctly?";if(!n.ok)throw`JamComments request failed! Status code: ${n.status}, message: ${n.statusText}, request URL: ${t}`;return await n.text()};var _={exports:{}},O,I;function H(){return I||(I=1,O={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),O}var B,N;function T(){if(N)return B;N=1;const u=H(),h={};for(const e of Object.keys(u))h[u[e]]=e;const i={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};B=i;for(const e of Object.keys(i)){if(!("channels"in i[e]))throw new Error("missing channels property: "+e);if(!("labels"in i[e]))throw new Error("missing channel labels property: "+e);if(i[e].labels.length!==i[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:o,labels:t}=i[e];delete i[e].channels,delete i[e].labels,Object.defineProperty(i[e],"channels",{value:o}),Object.defineProperty(i[e],"labels",{value:t})}i.rgb.hsl=function(e){const o=e[0]/255,t=e[1]/255,n=e[2]/255,r=Math.min(o,t,n),s=Math.max(o,t,n),l=s-r;let c,a;s===r?c=0:o===s?c=(t-n)/l:t===s?c=2+(n-o)/l:n===s&&(c=4+(o-t)/l),c=Math.min(c*60,360),c<0&&(c+=360);const f=(r+s)/2;return s===r?a=0:f<=.5?a=l/(s+r):a=l/(2-s-r),[c,a*100,f*100]},i.rgb.hsv=function(e){let o,t,n,r,s;const l=e[0]/255,c=e[1]/255,a=e[2]/255,f=Math.max(l,c,a),g=f-Math.min(l,c,a),b=function(p){return(f-p)/6/g+1/2};return g===0?(r=0,s=0):(s=g/f,o=b(l),t=b(c),n=b(a),l===f?r=n-t:c===f?r=1/3+o-n:a===f&&(r=2/3+t-o),r<0?r+=1:r>1&&(r-=1)),[r*360,s*100,f*100]},i.rgb.hwb=function(e){const o=e[0],t=e[1];let n=e[2];const r=i.rgb.hsl(e)[0],s=1/255*Math.min(o,Math.min(t,n));return n=1-1/255*Math.max(o,Math.max(t,n)),[r,s*100,n*100]},i.rgb.cmyk=function(e){const o=e[0]/255,t=e[1]/255,n=e[2]/255,r=Math.min(1-o,1-t,1-n),s=(1-o-r)/(1-r)||0,l=(1-t-r)/(1-r)||0,c=(1-n-r)/(1-r)||0;return[s*100,l*100,c*100,r*100]};function d(e,o){return(e[0]-o[0])**2+(e[1]-o[1])**2+(e[2]-o[2])**2}return i.rgb.keyword=function(e){const o=h[e];if(o)return o;let t=1/0,n;for(const r of Object.keys(u)){const s=u[r],l=d(e,s);l<t&&(t=l,n=r)}return n},i.keyword.rgb=function(e){return u[e]},i.rgb.xyz=function(e){let o=e[0]/255,t=e[1]/255,n=e[2]/255;o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;const r=o*.4124+t*.3576+n*.1805,s=o*.2126+t*.7152+n*.0722,l=o*.0193+t*.1192+n*.9505;return[r*100,s*100,l*100]},i.rgb.lab=function(e){const o=i.rgb.xyz(e);let t=o[0],n=o[1],r=o[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;const s=116*n-16,l=500*(t-n),c=200*(n-r);return[s,l,c]},i.hsl.rgb=function(e){const o=e[0]/360,t=e[1]/100,n=e[2]/100;let r,s,l;if(t===0)return l=n*255,[l,l,l];n<.5?r=n*(1+t):r=n+t-n*t;const c=2*n-r,a=[0,0,0];for(let f=0;f<3;f++)s=o+1/3*-(f-1),s<0&&s++,s>1&&s--,6*s<1?l=c+(r-c)*6*s:2*s<1?l=r:3*s<2?l=c+(r-c)*(2/3-s)*6:l=c,a[f]=l*255;return a},i.hsl.hsv=function(e){const o=e[0];let t=e[1]/100,n=e[2]/100,r=t;const s=Math.max(n,.01);n*=2,t*=n<=1?n:2-n,r*=s<=1?s:2-s;const l=(n+t)/2,c=n===0?2*r/(s+r):2*t/(n+t);return[o,c*100,l*100]},i.hsv.rgb=function(e){const o=e[0]/60,t=e[1]/100;let n=e[2]/100;const r=Math.floor(o)%6,s=o-Math.floor(o),l=255*n*(1-t),c=255*n*(1-t*s),a=255*n*(1-t*(1-s));switch(n*=255,r){case 0:return[n,a,l];case 1:return[c,n,l];case 2:return[l,n,a];case 3:return[l,c,n];case 4:return[a,l,n];case 5:return[n,l,c]}},i.hsv.hsl=function(e){const o=e[0],t=e[1]/100,n=e[2]/100,r=Math.max(n,.01);let s,l;l=(2-t)*n;const c=(2-t)*r;return s=t*r,s/=c<=1?c:2-c,s=s||0,l/=2,[o,s*100,l*100]},i.hwb.rgb=function(e){const o=e[0]/360;let t=e[1]/100,n=e[2]/100;const r=t+n;let s;r>1&&(t/=r,n/=r);const l=Math.floor(6*o),c=1-n;s=6*o-l,(l&1)!==0&&(s=1-s);const a=t+s*(c-t);let f,g,b;switch(l){default:case 6:case 0:f=c,g=a,b=t;break;case 1:f=a,g=c,b=t;break;case 2:f=t,g=c,b=a;break;case 3:f=t,g=a,b=c;break;case 4:f=a,g=t,b=c;break;case 5:f=c,g=t,b=a;break}return[f*255,g*255,b*255]},i.cmyk.rgb=function(e){const o=e[0]/100,t=e[1]/100,n=e[2]/100,r=e[3]/100,s=1-Math.min(1,o*(1-r)+r),l=1-Math.min(1,t*(1-r)+r),c=1-Math.min(1,n*(1-r)+r);return[s*255,l*255,c*255]},i.xyz.rgb=function(e){const o=e[0]/100,t=e[1]/100,n=e[2]/100;let r,s,l;return r=o*3.2406+t*-1.5372+n*-.4986,s=o*-.9689+t*1.8758+n*.0415,l=o*.0557+t*-.204+n*1.057,r=r>.0031308?1.055*r**(1/2.4)-.055:r*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,r=Math.min(Math.max(0,r),1),s=Math.min(Math.max(0,s),1),l=Math.min(Math.max(0,l),1),[r*255,s*255,l*255]},i.xyz.lab=function(e){let o=e[0],t=e[1],n=e[2];o/=95.047,t/=100,n/=108.883,o=o>.008856?o**(1/3):7.787*o+16/116,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;const r=116*t-16,s=500*(o-t),l=200*(t-n);return[r,s,l]},i.lab.xyz=function(e){const o=e[0],t=e[1],n=e[2];let r,s,l;s=(o+16)/116,r=t/500+s,l=s-n/200;const c=s**3,a=r**3,f=l**3;return s=c>.008856?c:(s-16/116)/7.787,r=a>.008856?a:(r-16/116)/7.787,l=f>.008856?f:(l-16/116)/7.787,r*=95.047,s*=100,l*=108.883,[r,s,l]},i.lab.lch=function(e){const o=e[0],t=e[1],n=e[2];let r;r=Math.atan2(n,t)*360/2/Math.PI,r<0&&(r+=360);const l=Math.sqrt(t*t+n*n);return[o,l,r]},i.lch.lab=function(e){const o=e[0],t=e[1],r=e[2]/360*2*Math.PI,s=t*Math.cos(r),l=t*Math.sin(r);return[o,s,l]},i.rgb.ansi16=function(e,o=null){const[t,n,r]=e;let s=o===null?i.rgb.hsv(e)[2]:o;if(s=Math.round(s/50),s===0)return 30;let l=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return s===2&&(l+=60),l},i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])},i.rgb.ansi256=function(e){const o=e[0],t=e[1],n=e[2];return o===t&&t===n?o<8?16:o>248?231:Math.round((o-8)/247*24)+232:16+36*Math.round(o/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},i.ansi16.rgb=function(e){let o=e%10;if(o===0||o===7)return e>50&&(o+=3.5),o=o/10.5*255,[o,o,o];const t=(~~(e>50)+1)*.5,n=(o&1)*t*255,r=(o>>1&1)*t*255,s=(o>>2&1)*t*255;return[n,r,s]},i.ansi256.rgb=function(e){if(e>=232){const s=(e-232)*10+8;return[s,s,s]}e-=16;let o;const t=Math.floor(e/36)/5*255,n=Math.floor((o=e%36)/6)/5*255,r=o%6/5*255;return[t,n,r]},i.rgb.hex=function(e){const t=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(t.length)+t},i.hex.rgb=function(e){const o=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!o)return[0,0,0];let t=o[0];o[0].length===3&&(t=t.split("").map(c=>c+c).join(""));const n=parseInt(t,16),r=n>>16&255,s=n>>8&255,l=n&255;return[r,s,l]},i.rgb.hcg=function(e){const o=e[0]/255,t=e[1]/255,n=e[2]/255,r=Math.max(Math.max(o,t),n),s=Math.min(Math.min(o,t),n),l=r-s;let c,a;return l<1?c=s/(1-l):c=0,l<=0?a=0:r===o?a=(t-n)/l%6:r===t?a=2+(n-o)/l:a=4+(o-t)/l,a/=6,a%=1,[a*360,l*100,c*100]},i.hsl.hcg=function(e){const o=e[1]/100,t=e[2]/100,n=t<.5?2*o*t:2*o*(1-t);let r=0;return n<1&&(r=(t-.5*n)/(1-n)),[e[0],n*100,r*100]},i.hsv.hcg=function(e){const o=e[1]/100,t=e[2]/100,n=o*t;let r=0;return n<1&&(r=(t-n)/(1-n)),[e[0],n*100,r*100]},i.hcg.rgb=function(e){const o=e[0]/360,t=e[1]/100,n=e[2]/100;if(t===0)return[n*255,n*255,n*255];const r=[0,0,0],s=o%1*6,l=s%1,c=1-l;let a=0;switch(Math.floor(s)){case 0:r[0]=1,r[1]=l,r[2]=0;break;case 1:r[0]=c,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=l;break;case 3:r[0]=0,r[1]=c,r[2]=1;break;case 4:r[0]=l,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=c}return a=(1-t)*n,[(t*r[0]+a)*255,(t*r[1]+a)*255,(t*r[2]+a)*255]},i.hcg.hsv=function(e){const o=e[1]/100,t=e[2]/100,n=o+t*(1-o);let r=0;return n>0&&(r=o/n),[e[0],r*100,n*100]},i.hcg.hsl=function(e){const o=e[1]/100,n=e[2]/100*(1-o)+.5*o;let r=0;return n>0&&n<.5?r=o/(2*n):n>=.5&&n<1&&(r=o/(2*(1-n))),[e[0],r*100,n*100]},i.hcg.hwb=function(e){const o=e[1]/100,t=e[2]/100,n=o+t*(1-o);return[e[0],(n-o)*100,(1-n)*100]},i.hwb.hcg=function(e){const o=e[1]/100,n=1-e[2]/100,r=n-o;let s=0;return r<1&&(s=(n-r)/(1-r)),[e[0],r*100,s*100]},i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},i.gray.hsl=function(e){return[0,0,e[0]]},i.gray.hsv=i.gray.hsl,i.gray.hwb=function(e){return[0,100,e[0]]},i.gray.cmyk=function(e){return[0,0,0,e[0]]},i.gray.lab=function(e){return[e[0],0,0]},i.gray.hex=function(e){const o=Math.round(e[0]/100*255)&255,n=((o<<16)+(o<<8)+o).toString(16).toUpperCase();return"000000".substring(n.length)+n},i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]},B}var S,z;function Q(){if(z)return S;z=1;const u=T();function h(){const o={},t=Object.keys(u);for(let n=t.length,r=0;r<n;r++)o[t[r]]={distance:-1,parent:null};return o}function i(o){const t=h(),n=[o];for(t[o].distance=0;n.length;){const r=n.pop(),s=Object.keys(u[r]);for(let l=s.length,c=0;c<l;c++){const a=s[c],f=t[a];f.distance===-1&&(f.distance=t[r].distance+1,f.parent=r,n.unshift(a))}}return t}function d(o,t){return function(n){return t(o(n))}}function e(o,t){const n=[t[o].parent,o];let r=u[t[o].parent][o],s=t[o].parent;for(;t[s].parent;)n.unshift(t[s].parent),r=d(u[t[s].parent][s],r),s=t[s].parent;return r.conversion=n,r}return S=function(o){const t=i(o),n={},r=Object.keys(t);for(let s=r.length,l=0;l<s;l++){const c=r[l];t[c].parent!==null&&(n[c]=e(c,t))}return n},S}var A,L;function Z(){if(L)return A;L=1;const u=T(),h=Q(),i={},d=Object.keys(u);function e(t){const n=function(...r){const s=r[0];return s==null?s:(s.length>1&&(r=s),t(r))};return"conversion"in t&&(n.conversion=t.conversion),n}function o(t){const n=function(...r){const s=r[0];if(s==null)return s;s.length>1&&(r=s);const l=t(r);if(typeof l=="object")for(let c=l.length,a=0;a<c;a++)l[a]=Math.round(l[a]);return l};return"conversion"in t&&(n.conversion=t.conversion),n}return d.forEach(t=>{i[t]={},Object.defineProperty(i[t],"channels",{value:u[t].channels}),Object.defineProperty(i[t],"labels",{value:u[t].labels});const n=h(t);Object.keys(n).forEach(s=>{const l=n[s];i[t][s]=o(l),i[t][s].raw=e(l)})}),A=i,A}(function(u){const h=(l,c)=>(...a)=>`\x1B[${l(...a)+c}m`,i=(l,c)=>(...a)=>{const f=l(...a);return`\x1B[${38+c};5;${f}m`},d=(l,c)=>(...a)=>{const f=l(...a);return`\x1B[${38+c};2;${f[0]};${f[1]};${f[2]}m`},e=l=>l,o=(l,c,a)=>[l,c,a],t=(l,c,a)=>{Object.defineProperty(l,c,{get:()=>{const f=a();return Object.defineProperty(l,c,{value:f,enumerable:!0,configurable:!0}),f},enumerable:!0,configurable:!0})};let n;const r=(l,c,a,f)=>{n===void 0&&(n=Z());const g=f?10:0,b={};for(const[p,y]of Object.entries(n)){const w=p==="ansi16"?"ansi":p;p===c?b[w]=l(a,g):typeof y=="object"&&(b[w]=l(y[c],g))}return b};function s(){const l=new Map,c={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};c.color.gray=c.color.blackBright,c.bgColor.bgGray=c.bgColor.bgBlackBright,c.color.grey=c.color.blackBright,c.bgColor.bgGrey=c.bgColor.bgBlackBright;for(const[a,f]of Object.entries(c)){for(const[g,b]of Object.entries(f))c[g]={open:`\x1B[${b[0]}m`,close:`\x1B[${b[1]}m`},f[g]=c[g],l.set(b[0],b[1]);Object.defineProperty(c,a,{value:f,enumerable:!1})}return Object.defineProperty(c,"codes",{value:l,enumerable:!1}),c.color.close="\x1B[39m",c.bgColor.close="\x1B[49m",t(c.color,"ansi",()=>r(h,"ansi16",e,!1)),t(c.color,"ansi256",()=>r(i,"ansi256",e,!1)),t(c.color,"ansi16m",()=>r(d,"rgb",o,!1)),t(c.bgColor,"ansi",()=>r(h,"ansi16",e,!0)),t(c.bgColor,"ansi256",()=>r(i,"ansi256",e,!0)),t(c.bgColor,"ansi16m",()=>r(d,"rgb",o,!0)),c}Object.defineProperty(u,"exports",{enumerable:!0,get:s})})(_);var ee={stdout:!1,stderr:!1},te={stringReplaceAll:(u,h,i)=>{let d=u.indexOf(h);if(d===-1)return u;const e=h.length;let o=0,t="";do t+=u.substr(o,d-o)+h+i,o=d+e,d=u.indexOf(h,o);while(d!==-1);return t+=u.substr(o),t},stringEncaseCRLFWithFirstIndex:(u,h,i,d)=>{let e=0,o="";do{const t=u[d-1]==="\r";o+=u.substr(e,(t?d-1:d)-e)+h+(t?`\r
|
|
2
2
|
`:`
|
|
3
|
-
`)+i,e=
|
|
4
|
-
`,e)}while(
|
|
5
|
-
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function
|
|
6
|
-
`);return
|
|
3
|
+
`)+i,e=d+1,d=u.indexOf(`
|
|
4
|
+
`,e)}while(d!==-1);return o+=u.substr(e),o}},$,U;function ne(){if(U)return $;U=1;const u=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,h=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,i=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,d=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,e=new Map([["n",`
|
|
5
|
+
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function o(s){const l=s[0]==="u",c=s[1]==="{";return l&&!c&&s.length===5||s[0]==="x"&&s.length===3?String.fromCharCode(parseInt(s.slice(1),16)):l&&c?String.fromCodePoint(parseInt(s.slice(2,-1),16)):e.get(s)||s}function t(s,l){const c=[],a=l.trim().split(/\s*,\s*/g);let f;for(const g of a){const b=Number(g);if(!Number.isNaN(b))c.push(b);else if(f=g.match(i))c.push(f[2].replace(d,(p,y,w)=>y?o(y):w));else throw new Error(`Invalid Chalk template style argument: ${g} (in style '${s}')`)}return c}function n(s){h.lastIndex=0;const l=[];let c;for(;(c=h.exec(s))!==null;){const a=c[1];if(c[2]){const f=t(a,c[2]);l.push([a].concat(f))}else l.push([a])}return l}function r(s,l){const c={};for(const f of l)for(const g of f.styles)c[g[0]]=f.inverse?null:g.slice(1);let a=s;for(const[f,g]of Object.entries(c))if(!!Array.isArray(g)){if(!(f in a))throw new Error(`Unknown Chalk style: ${f}`);a=g.length>0?a[f](...g):a[f]}return a}return $=(s,l)=>{const c=[],a=[];let f=[];if(l.replace(u,(g,b,p,y,w,he)=>{if(b)f.push(o(b));else if(y){const V=f.join("");f=[],a.push(c.length===0?V:r(s,c)(V)),c.push({inverse:p,styles:n(y)})}else if(w){if(c.length===0)throw new Error("Found extraneous } in Chalk template literal");a.push(r(s,c)(f.join(""))),f=[],c.pop()}else f.push(he)}),a.push(f.join("")),c.length>0){const g=`Chalk template literal is missing ${c.length} closing bracket${c.length===1?"":"s"} (\`}\`)`;throw new Error(g)}return a.join("")},$}const M=_.exports,{stdout:F,stderr:R}=ee,{stringReplaceAll:re,stringEncaseCRLFWithFirstIndex:oe}=te,{isArray:C}=Array,G=["ansi","ansi","ansi256","ansi16m"],v=Object.create(null),se=(u,h={})=>{if(h.level&&!(Number.isInteger(h.level)&&h.level>=0&&h.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const i=F?F.level:0;u.level=h.level===void 0?i:h.level};class le{constructor(h){return J(h)}}const J=u=>{const h={};return se(h,u),h.template=(...i)=>D(h.template,...i),Object.setPrototypeOf(h,x.prototype),Object.setPrototypeOf(h.template,h),h.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},h.template.Instance=le,h.template};function x(u){return J(u)}for(const[u,h]of Object.entries(M))v[u]={get(){const i=j(this,P(h.open,h.close,this._styler),this._isEmpty);return Object.defineProperty(this,u,{value:i}),i}};v.visible={get(){const u=j(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:u}),u}};const W=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const u of W)v[u]={get(){const{level:h}=this;return function(...i){const d=P(M.color[G[h]][u](...i),M.color.close,this._styler);return j(this,d,this._isEmpty)}}};for(const u of W){const h="bg"+u[0].toUpperCase()+u.slice(1);v[h]={get(){const{level:i}=this;return function(...d){const e=P(M.bgColor[G[i]][u](...d),M.bgColor.close,this._styler);return j(this,e,this._isEmpty)}}}}const ce=Object.defineProperties(()=>{},{...v,level:{enumerable:!0,get(){return this._generator.level},set(u){this._generator.level=u}}}),P=(u,h,i)=>{let d,e;return i===void 0?(d=u,e=h):(d=i.openAll+u,e=h+i.closeAll),{open:u,close:h,openAll:d,closeAll:e,parent:i}},j=(u,h,i)=>{const d=(...e)=>C(e[0])&&C(e[0].raw)?X(d,D(d,...e)):X(d,e.length===1?""+e[0]:e.join(" "));return Object.setPrototypeOf(d,ce),d._generator=u,d._styler=h,d._isEmpty=i,d},X=(u,h)=>{if(u.level<=0||!h)return u._isEmpty?"":h;let i=u._styler;if(i===void 0)return h;const{openAll:d,closeAll:e}=i;if(h.indexOf("\x1B")!==-1)for(;i!==void 0;)h=re(h,i.close,i.open),i=i.parent;const o=h.indexOf(`
|
|
6
|
+
`);return o!==-1&&(h=oe(h,e,d,o)),d+h+e};let q;const D=(u,...h)=>{const[i]=h;if(!C(i)||!C(i.raw))return h.join(" ");const d=h.slice(1),e=[i.raw[0]];for(let o=1;o<i.length;o++)e.push(String(d[o-1]).replace(/[{}\\]/g,"\\$&"),String(i.raw[o]));return q===void 0&&(q=ne()),q(u,e.join(""))};Object.defineProperties(x.prototype,v);const E=x();E.supportsColor=F,E.stderr=x({level:R?R.level:0}),E.stderr.supportsColor=R;var ie=E;const ae=u=>{console.log(`${ie.magenta("JamComments:")} ${u}`)},ue=u=>{console.error(`JamComments: ${u}`)};m.log=ae,m.logError=ue,m.markupFetcher=Y,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/markupFetcher.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const markupFetcher: (platform: string) => Function;
|
|
1
|
+
export declare const markupFetcher: (platform: string, fetchImplementation?: typeof fetch) => Function;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jam-comments/server-utilities",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Various JavaScript utilities for JamComments.",
|
|
5
5
|
"main": "dist/index.umd.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"homepage": "https://jamcomments.com",
|
|
25
25
|
"license": "GPL-2.0",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@jam-comments/server-utilities": "^1.0.
|
|
27
|
+
"@jam-comments/server-utilities": "^1.0.5",
|
|
28
28
|
"@jam-comments/shared-utilities": "^0.0.4",
|
|
29
29
|
"graphql-quest": "^1.1.2",
|
|
30
30
|
"typescript": "^4.9.3",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "94d1edbe4bf2e543bd9ddce05bc1106e69d88c1e"
|
|
42
42
|
}
|