@jam-comments/server-utilities 1.0.3 → 1.0.4
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 +212 -212
- package/dist/index.umd.js +4 -4
- package/dist/markupFetcher.d.ts +1 -1
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
const K = () => {
|
|
2
2
|
var u;
|
|
3
3
|
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
|
-
}, ie = (u) => async ({
|
|
5
|
-
path:
|
|
6
|
-
domain:
|
|
7
|
-
apiKey:
|
|
4
|
+
}, ie = (u, h = fetch) => async ({
|
|
5
|
+
path: a,
|
|
6
|
+
domain: g,
|
|
7
|
+
apiKey: e
|
|
8
8
|
}) => {
|
|
9
|
-
const
|
|
10
|
-
path:
|
|
11
|
-
domain:
|
|
12
|
-
}),
|
|
9
|
+
const o = new URLSearchParams({
|
|
10
|
+
path: a || "/",
|
|
11
|
+
domain: g
|
|
12
|
+
}), t = `${K()}/api/markup?${o}`, n = await h(t, {
|
|
13
13
|
method: "GET",
|
|
14
14
|
headers: {
|
|
15
|
-
Authorization: `Bearer ${
|
|
15
|
+
Authorization: `Bearer ${e}`,
|
|
16
16
|
Accept: "application/json",
|
|
17
17
|
"X-Platform": u
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
if (
|
|
20
|
+
if (n.status === 401)
|
|
21
21
|
throw "JamComments: Unauthorized! Are your domain and API key set correctly?";
|
|
22
|
-
if (!
|
|
23
|
-
throw `JamComments request failed! Status code: ${
|
|
24
|
-
return await
|
|
22
|
+
if (!n.ok)
|
|
23
|
+
throw `JamComments request failed! Status code: ${n.status}, message: ${n.statusText}, request URL: ${t}`;
|
|
24
|
+
return await n.text();
|
|
25
25
|
};
|
|
26
26
|
var T = { exports: {} }, j, q;
|
|
27
27
|
function Y() {
|
|
@@ -209,109 +209,109 @@ function U() {
|
|
|
209
209
|
throw new Error("missing channel labels property: " + e);
|
|
210
210
|
if (a[e].labels.length !== a[e].channels)
|
|
211
211
|
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:
|
|
212
|
+
const { channels: o, labels: t } = a[e];
|
|
213
|
+
delete a[e].channels, delete a[e].labels, Object.defineProperty(a[e], "channels", { value: o }), Object.defineProperty(a[e], "labels", { value: t });
|
|
214
214
|
}
|
|
215
215
|
a.rgb.hsl = function(e) {
|
|
216
|
-
const
|
|
216
|
+
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
217
|
let c, i;
|
|
218
|
-
s ===
|
|
219
|
-
const f = (
|
|
220
|
-
return s ===
|
|
218
|
+
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);
|
|
219
|
+
const f = (r + s) / 2;
|
|
220
|
+
return s === r ? i = 0 : f <= 0.5 ? i = l / (s + r) : i = l / (2 - s - r), [c, i * 100, f * 100];
|
|
221
221
|
}, a.rgb.hsv = function(e) {
|
|
222
|
-
let
|
|
222
|
+
let o, t, n, r, s;
|
|
223
223
|
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
224
|
return (f - m) / 6 / b + 1 / 2;
|
|
225
225
|
};
|
|
226
|
-
return b === 0 ? (
|
|
227
|
-
|
|
226
|
+
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)), [
|
|
227
|
+
r * 360,
|
|
228
228
|
s * 100,
|
|
229
229
|
f * 100
|
|
230
230
|
];
|
|
231
231
|
}, a.rgb.hwb = function(e) {
|
|
232
|
-
const
|
|
233
|
-
let
|
|
234
|
-
const
|
|
235
|
-
return
|
|
232
|
+
const o = e[0], t = e[1];
|
|
233
|
+
let n = e[2];
|
|
234
|
+
const r = a.rgb.hsl(e)[0], s = 1 / 255 * Math.min(o, Math.min(t, n));
|
|
235
|
+
return n = 1 - 1 / 255 * Math.max(o, Math.max(t, n)), [r, s * 100, n * 100];
|
|
236
236
|
}, a.rgb.cmyk = function(e) {
|
|
237
|
-
const
|
|
238
|
-
return [s * 100, l * 100, c * 100,
|
|
237
|
+
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;
|
|
238
|
+
return [s * 100, l * 100, c * 100, r * 100];
|
|
239
239
|
};
|
|
240
|
-
function g(e,
|
|
241
|
-
return (e[0] -
|
|
240
|
+
function g(e, o) {
|
|
241
|
+
return (e[0] - o[0]) ** 2 + (e[1] - o[1]) ** 2 + (e[2] - o[2]) ** 2;
|
|
242
242
|
}
|
|
243
243
|
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,
|
|
244
|
+
const o = h[e];
|
|
245
|
+
if (o)
|
|
246
|
+
return o;
|
|
247
|
+
let t = 1 / 0, n;
|
|
248
|
+
for (const r of Object.keys(u)) {
|
|
249
|
+
const s = u[r], l = g(e, s);
|
|
250
|
+
l < t && (t = l, n = r);
|
|
251
251
|
}
|
|
252
|
-
return
|
|
252
|
+
return n;
|
|
253
253
|
}, a.keyword.rgb = function(e) {
|
|
254
254
|
return u[e];
|
|
255
255
|
}, a.rgb.xyz = function(e) {
|
|
256
|
-
let
|
|
257
|
-
|
|
258
|
-
const
|
|
259
|
-
return [
|
|
256
|
+
let o = e[0] / 255, t = e[1] / 255, n = e[2] / 255;
|
|
257
|
+
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;
|
|
258
|
+
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;
|
|
259
|
+
return [r * 100, s * 100, l * 100];
|
|
260
260
|
}, a.rgb.lab = function(e) {
|
|
261
|
-
const
|
|
262
|
-
let t =
|
|
263
|
-
t /= 95.047,
|
|
264
|
-
const s = 116 *
|
|
261
|
+
const o = a.rgb.xyz(e);
|
|
262
|
+
let t = o[0], n = o[1], r = o[2];
|
|
263
|
+
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;
|
|
264
|
+
const s = 116 * n - 16, l = 500 * (t - n), c = 200 * (n - r);
|
|
265
265
|
return [s, l, c];
|
|
266
266
|
}, a.hsl.rgb = function(e) {
|
|
267
|
-
const
|
|
268
|
-
let
|
|
267
|
+
const o = e[0] / 360, t = e[1] / 100, n = e[2] / 100;
|
|
268
|
+
let r, s, l;
|
|
269
269
|
if (t === 0)
|
|
270
|
-
return l =
|
|
271
|
-
|
|
272
|
-
const c = 2 *
|
|
270
|
+
return l = n * 255, [l, l, l];
|
|
271
|
+
n < 0.5 ? r = n * (1 + t) : r = n + t - n * t;
|
|
272
|
+
const c = 2 * n - r, i = [0, 0, 0];
|
|
273
273
|
for (let f = 0; f < 3; f++)
|
|
274
|
-
s =
|
|
274
|
+
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
275
|
return i;
|
|
276
276
|
}, a.hsl.hsv = function(e) {
|
|
277
|
-
const
|
|
278
|
-
let t = e[1] / 100,
|
|
279
|
-
const s = Math.max(
|
|
280
|
-
|
|
281
|
-
const l = (
|
|
282
|
-
return [
|
|
277
|
+
const o = e[0];
|
|
278
|
+
let t = e[1] / 100, n = e[2] / 100, r = t;
|
|
279
|
+
const s = Math.max(n, 0.01);
|
|
280
|
+
n *= 2, t *= n <= 1 ? n : 2 - n, r *= s <= 1 ? s : 2 - s;
|
|
281
|
+
const l = (n + t) / 2, c = n === 0 ? 2 * r / (s + r) : 2 * t / (n + t);
|
|
282
|
+
return [o, c * 100, l * 100];
|
|
283
283
|
}, a.hsv.rgb = function(e) {
|
|
284
|
-
const
|
|
285
|
-
let
|
|
286
|
-
const
|
|
287
|
-
switch (
|
|
284
|
+
const o = e[0] / 60, t = e[1] / 100;
|
|
285
|
+
let n = e[2] / 100;
|
|
286
|
+
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));
|
|
287
|
+
switch (n *= 255, r) {
|
|
288
288
|
case 0:
|
|
289
|
-
return [
|
|
289
|
+
return [n, i, l];
|
|
290
290
|
case 1:
|
|
291
|
-
return [c,
|
|
291
|
+
return [c, n, l];
|
|
292
292
|
case 2:
|
|
293
|
-
return [l,
|
|
293
|
+
return [l, n, i];
|
|
294
294
|
case 3:
|
|
295
|
-
return [l, c,
|
|
295
|
+
return [l, c, n];
|
|
296
296
|
case 4:
|
|
297
|
-
return [i, l,
|
|
297
|
+
return [i, l, n];
|
|
298
298
|
case 5:
|
|
299
|
-
return [
|
|
299
|
+
return [n, l, c];
|
|
300
300
|
}
|
|
301
301
|
}, a.hsv.hsl = function(e) {
|
|
302
|
-
const
|
|
302
|
+
const o = e[0], t = e[1] / 100, n = e[2] / 100, r = Math.max(n, 0.01);
|
|
303
303
|
let s, l;
|
|
304
|
-
l = (2 - t) *
|
|
305
|
-
const c = (2 - t) *
|
|
306
|
-
return s = t *
|
|
304
|
+
l = (2 - t) * n;
|
|
305
|
+
const c = (2 - t) * r;
|
|
306
|
+
return s = t * r, s /= c <= 1 ? c : 2 - c, s = s || 0, l /= 2, [o, s * 100, l * 100];
|
|
307
307
|
}, a.hwb.rgb = function(e) {
|
|
308
|
-
const
|
|
309
|
-
let t = e[1] / 100,
|
|
310
|
-
const
|
|
308
|
+
const o = e[0] / 360;
|
|
309
|
+
let t = e[1] / 100, n = e[2] / 100;
|
|
310
|
+
const r = t + n;
|
|
311
311
|
let s;
|
|
312
|
-
|
|
313
|
-
const l = Math.floor(6 *
|
|
314
|
-
s = 6 *
|
|
312
|
+
r > 1 && (t /= r, n /= r);
|
|
313
|
+
const l = Math.floor(6 * o), c = 1 - n;
|
|
314
|
+
s = 6 * o - l, (l & 1) !== 0 && (s = 1 - s);
|
|
315
315
|
const i = t + s * (c - t);
|
|
316
316
|
let f, b, d;
|
|
317
317
|
switch (l) {
|
|
@@ -338,127 +338,127 @@ function U() {
|
|
|
338
338
|
}
|
|
339
339
|
return [f * 255, b * 255, d * 255];
|
|
340
340
|
}, a.cmyk.rgb = function(e) {
|
|
341
|
-
const
|
|
341
|
+
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
342
|
return [s * 255, l * 255, c * 255];
|
|
343
343
|
}, a.xyz.rgb = function(e) {
|
|
344
|
-
const
|
|
345
|
-
let
|
|
346
|
-
return
|
|
344
|
+
const o = e[0] / 100, t = e[1] / 100, n = e[2] / 100;
|
|
345
|
+
let r, s, l;
|
|
346
|
+
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
347
|
}, a.xyz.lab = function(e) {
|
|
348
|
-
let
|
|
349
|
-
|
|
350
|
-
const
|
|
351
|
-
return [
|
|
348
|
+
let o = e[0], t = e[1], n = e[2];
|
|
349
|
+
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;
|
|
350
|
+
const r = 116 * t - 16, s = 500 * (o - t), l = 200 * (t - n);
|
|
351
|
+
return [r, s, l];
|
|
352
352
|
}, 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,
|
|
353
|
+
const o = e[0], t = e[1], n = e[2];
|
|
354
|
+
let r, s, l;
|
|
355
|
+
s = (o + 16) / 116, r = t / 500 + s, l = s - n / 200;
|
|
356
|
+
const c = s ** 3, i = r ** 3, f = l ** 3;
|
|
357
|
+
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
358
|
}, a.lab.lch = function(e) {
|
|
359
|
-
const
|
|
360
|
-
let
|
|
361
|
-
|
|
362
|
-
const l = Math.sqrt(t * t +
|
|
363
|
-
return [
|
|
359
|
+
const o = e[0], t = e[1], n = e[2];
|
|
360
|
+
let r;
|
|
361
|
+
r = Math.atan2(n, t) * 360 / 2 / Math.PI, r < 0 && (r += 360);
|
|
362
|
+
const l = Math.sqrt(t * t + n * n);
|
|
363
|
+
return [o, l, r];
|
|
364
364
|
}, a.lch.lab = function(e) {
|
|
365
|
-
const
|
|
366
|
-
return [
|
|
367
|
-
}, a.rgb.ansi16 = function(e,
|
|
368
|
-
const [t,
|
|
369
|
-
let s =
|
|
365
|
+
const o = e[0], t = e[1], r = e[2] / 360 * 2 * Math.PI, s = t * Math.cos(r), l = t * Math.sin(r);
|
|
366
|
+
return [o, s, l];
|
|
367
|
+
}, a.rgb.ansi16 = function(e, o = null) {
|
|
368
|
+
const [t, n, r] = e;
|
|
369
|
+
let s = o === null ? a.rgb.hsv(e)[2] : o;
|
|
370
370
|
if (s = Math.round(s / 50), s === 0)
|
|
371
371
|
return 30;
|
|
372
|
-
let l = 30 + (Math.round(
|
|
372
|
+
let l = 30 + (Math.round(r / 255) << 2 | Math.round(n / 255) << 1 | Math.round(t / 255));
|
|
373
373
|
return s === 2 && (l += 60), l;
|
|
374
374
|
}, a.hsv.ansi16 = function(e) {
|
|
375
375
|
return a.rgb.ansi16(a.hsv.rgb(e), e[2]);
|
|
376
376
|
}, a.rgb.ansi256 = function(e) {
|
|
377
|
-
const
|
|
378
|
-
return
|
|
377
|
+
const o = e[0], t = e[1], n = e[2];
|
|
378
|
+
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
379
|
}, a.ansi16.rgb = function(e) {
|
|
380
|
-
let
|
|
381
|
-
if (
|
|
382
|
-
return e > 50 && (
|
|
383
|
-
const t = (~~(e > 50) + 1) * 0.5,
|
|
384
|
-
return [
|
|
380
|
+
let o = e % 10;
|
|
381
|
+
if (o === 0 || o === 7)
|
|
382
|
+
return e > 50 && (o += 3.5), o = o / 10.5 * 255, [o, o, o];
|
|
383
|
+
const t = (~~(e > 50) + 1) * 0.5, n = (o & 1) * t * 255, r = (o >> 1 & 1) * t * 255, s = (o >> 2 & 1) * t * 255;
|
|
384
|
+
return [n, r, s];
|
|
385
385
|
}, a.ansi256.rgb = function(e) {
|
|
386
386
|
if (e >= 232) {
|
|
387
387
|
const s = (e - 232) * 10 + 8;
|
|
388
388
|
return [s, s, s];
|
|
389
389
|
}
|
|
390
390
|
e -= 16;
|
|
391
|
-
let
|
|
392
|
-
const t = Math.floor(e / 36) / 5 * 255,
|
|
393
|
-
return [t,
|
|
391
|
+
let o;
|
|
392
|
+
const t = Math.floor(e / 36) / 5 * 255, n = Math.floor((o = e % 36) / 6) / 5 * 255, r = o % 6 / 5 * 255;
|
|
393
|
+
return [t, n, r];
|
|
394
394
|
}, a.rgb.hex = function(e) {
|
|
395
395
|
const t = (((Math.round(e[0]) & 255) << 16) + ((Math.round(e[1]) & 255) << 8) + (Math.round(e[2]) & 255)).toString(16).toUpperCase();
|
|
396
396
|
return "000000".substring(t.length) + t;
|
|
397
397
|
}, a.hex.rgb = function(e) {
|
|
398
|
-
const
|
|
399
|
-
if (!
|
|
398
|
+
const o = e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
399
|
+
if (!o)
|
|
400
400
|
return [0, 0, 0];
|
|
401
|
-
let t =
|
|
402
|
-
|
|
403
|
-
const
|
|
404
|
-
return [
|
|
401
|
+
let t = o[0];
|
|
402
|
+
o[0].length === 3 && (t = t.split("").map((c) => c + c).join(""));
|
|
403
|
+
const n = parseInt(t, 16), r = n >> 16 & 255, s = n >> 8 & 255, l = n & 255;
|
|
404
|
+
return [r, s, l];
|
|
405
405
|
}, a.rgb.hcg = function(e) {
|
|
406
|
-
const
|
|
406
|
+
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
407
|
let c, i;
|
|
408
|
-
return l < 1 ? c = s / (1 - l) : c = 0, l <= 0 ? i = 0 :
|
|
408
|
+
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
409
|
}, a.hsl.hcg = function(e) {
|
|
410
|
-
const
|
|
411
|
-
let
|
|
412
|
-
return
|
|
410
|
+
const o = e[1] / 100, t = e[2] / 100, n = t < 0.5 ? 2 * o * t : 2 * o * (1 - t);
|
|
411
|
+
let r = 0;
|
|
412
|
+
return n < 1 && (r = (t - 0.5 * n) / (1 - n)), [e[0], n * 100, r * 100];
|
|
413
413
|
}, a.hsv.hcg = function(e) {
|
|
414
|
-
const
|
|
415
|
-
let
|
|
416
|
-
return
|
|
414
|
+
const o = e[1] / 100, t = e[2] / 100, n = o * t;
|
|
415
|
+
let r = 0;
|
|
416
|
+
return n < 1 && (r = (t - n) / (1 - n)), [e[0], n * 100, r * 100];
|
|
417
417
|
}, a.hcg.rgb = function(e) {
|
|
418
|
-
const
|
|
418
|
+
const o = e[0] / 360, t = e[1] / 100, n = e[2] / 100;
|
|
419
419
|
if (t === 0)
|
|
420
|
-
return [
|
|
421
|
-
const
|
|
420
|
+
return [n * 255, n * 255, n * 255];
|
|
421
|
+
const r = [0, 0, 0], s = o % 1 * 6, l = s % 1, c = 1 - l;
|
|
422
422
|
let i = 0;
|
|
423
423
|
switch (Math.floor(s)) {
|
|
424
424
|
case 0:
|
|
425
|
-
|
|
425
|
+
r[0] = 1, r[1] = l, r[2] = 0;
|
|
426
426
|
break;
|
|
427
427
|
case 1:
|
|
428
|
-
|
|
428
|
+
r[0] = c, r[1] = 1, r[2] = 0;
|
|
429
429
|
break;
|
|
430
430
|
case 2:
|
|
431
|
-
|
|
431
|
+
r[0] = 0, r[1] = 1, r[2] = l;
|
|
432
432
|
break;
|
|
433
433
|
case 3:
|
|
434
|
-
|
|
434
|
+
r[0] = 0, r[1] = c, r[2] = 1;
|
|
435
435
|
break;
|
|
436
436
|
case 4:
|
|
437
|
-
|
|
437
|
+
r[0] = l, r[1] = 0, r[2] = 1;
|
|
438
438
|
break;
|
|
439
439
|
default:
|
|
440
|
-
|
|
440
|
+
r[0] = 1, r[1] = 0, r[2] = c;
|
|
441
441
|
}
|
|
442
|
-
return i = (1 - t) *
|
|
443
|
-
(t *
|
|
444
|
-
(t *
|
|
445
|
-
(t *
|
|
442
|
+
return i = (1 - t) * n, [
|
|
443
|
+
(t * r[0] + i) * 255,
|
|
444
|
+
(t * r[1] + i) * 255,
|
|
445
|
+
(t * r[2] + i) * 255
|
|
446
446
|
];
|
|
447
447
|
}, a.hcg.hsv = function(e) {
|
|
448
|
-
const
|
|
449
|
-
let
|
|
450
|
-
return
|
|
448
|
+
const o = e[1] / 100, t = e[2] / 100, n = o + t * (1 - o);
|
|
449
|
+
let r = 0;
|
|
450
|
+
return n > 0 && (r = o / n), [e[0], r * 100, n * 100];
|
|
451
451
|
}, a.hcg.hsl = function(e) {
|
|
452
|
-
const
|
|
453
|
-
let
|
|
454
|
-
return
|
|
452
|
+
const o = e[1] / 100, n = e[2] / 100 * (1 - o) + 0.5 * o;
|
|
453
|
+
let r = 0;
|
|
454
|
+
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
455
|
}, a.hcg.hwb = function(e) {
|
|
456
|
-
const
|
|
457
|
-
return [e[0], (
|
|
456
|
+
const o = e[1] / 100, t = e[2] / 100, n = o + t * (1 - o);
|
|
457
|
+
return [e[0], (n - o) * 100, (1 - n) * 100];
|
|
458
458
|
}, a.hwb.hcg = function(e) {
|
|
459
|
-
const
|
|
459
|
+
const o = e[1] / 100, n = 1 - e[2] / 100, r = n - o;
|
|
460
460
|
let s = 0;
|
|
461
|
-
return
|
|
461
|
+
return r < 1 && (s = (n - r) / (1 - r)), [e[0], r * 100, s * 100];
|
|
462
462
|
}, a.apple.rgb = function(e) {
|
|
463
463
|
return [e[0] / 65535 * 255, e[1] / 65535 * 255, e[2] / 65535 * 255];
|
|
464
464
|
}, a.rgb.apple = function(e) {
|
|
@@ -474,8 +474,8 @@ function U() {
|
|
|
474
474
|
}, a.gray.lab = function(e) {
|
|
475
475
|
return [e[0], 0, 0];
|
|
476
476
|
}, a.gray.hex = function(e) {
|
|
477
|
-
const
|
|
478
|
-
return "000000".substring(
|
|
477
|
+
const o = Math.round(e[0] / 100 * 255) & 255, n = ((o << 16) + (o << 8) + o).toString(16).toUpperCase();
|
|
478
|
+
return "000000".substring(n.length) + n;
|
|
479
479
|
}, a.rgb.gray = function(e) {
|
|
480
480
|
return [(e[0] + e[1] + e[2]) / 3 / 255 * 100];
|
|
481
481
|
}, B;
|
|
@@ -487,44 +487,44 @@ function V() {
|
|
|
487
487
|
I = 1;
|
|
488
488
|
const u = U();
|
|
489
489
|
function h() {
|
|
490
|
-
const
|
|
491
|
-
for (let
|
|
492
|
-
|
|
490
|
+
const o = {}, t = Object.keys(u);
|
|
491
|
+
for (let n = t.length, r = 0; r < n; r++)
|
|
492
|
+
o[t[r]] = {
|
|
493
493
|
distance: -1,
|
|
494
494
|
parent: null
|
|
495
495
|
};
|
|
496
|
-
return
|
|
496
|
+
return o;
|
|
497
497
|
}
|
|
498
|
-
function a(
|
|
499
|
-
const t = h(),
|
|
500
|
-
for (t[
|
|
501
|
-
const
|
|
498
|
+
function a(o) {
|
|
499
|
+
const t = h(), n = [o];
|
|
500
|
+
for (t[o].distance = 0; n.length; ) {
|
|
501
|
+
const r = n.pop(), s = Object.keys(u[r]);
|
|
502
502
|
for (let l = s.length, c = 0; c < l; c++) {
|
|
503
503
|
const i = s[c], f = t[i];
|
|
504
|
-
f.distance === -1 && (f.distance = t[
|
|
504
|
+
f.distance === -1 && (f.distance = t[r].distance + 1, f.parent = r, n.unshift(i));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
return t;
|
|
508
508
|
}
|
|
509
|
-
function g(
|
|
510
|
-
return function(
|
|
511
|
-
return t(
|
|
509
|
+
function g(o, t) {
|
|
510
|
+
return function(n) {
|
|
511
|
+
return t(o(n));
|
|
512
512
|
};
|
|
513
513
|
}
|
|
514
|
-
function e(
|
|
515
|
-
const
|
|
516
|
-
let
|
|
514
|
+
function e(o, t) {
|
|
515
|
+
const n = [t[o].parent, o];
|
|
516
|
+
let r = u[t[o].parent][o], s = t[o].parent;
|
|
517
517
|
for (; t[s].parent; )
|
|
518
|
-
|
|
519
|
-
return
|
|
518
|
+
n.unshift(t[s].parent), r = g(u[t[s].parent][s], r), s = t[s].parent;
|
|
519
|
+
return r.conversion = n, r;
|
|
520
520
|
}
|
|
521
|
-
return O = function(
|
|
522
|
-
const t = a(
|
|
523
|
-
for (let s =
|
|
524
|
-
const c =
|
|
525
|
-
t[c].parent !== null && (
|
|
521
|
+
return O = function(o) {
|
|
522
|
+
const t = a(o), n = {}, r = Object.keys(t);
|
|
523
|
+
for (let s = r.length, l = 0; l < s; l++) {
|
|
524
|
+
const c = r[l];
|
|
525
|
+
t[c].parent !== null && (n[c] = e(c, t));
|
|
526
526
|
}
|
|
527
|
-
return
|
|
527
|
+
return n;
|
|
528
528
|
}, O;
|
|
529
529
|
}
|
|
530
530
|
var E, N;
|
|
@@ -534,32 +534,32 @@ function H() {
|
|
|
534
534
|
N = 1;
|
|
535
535
|
const u = U(), h = V(), a = {}, g = Object.keys(u);
|
|
536
536
|
function e(t) {
|
|
537
|
-
const
|
|
538
|
-
const s =
|
|
539
|
-
return s == null ? s : (s.length > 1 && (
|
|
537
|
+
const n = function(...r) {
|
|
538
|
+
const s = r[0];
|
|
539
|
+
return s == null ? s : (s.length > 1 && (r = s), t(r));
|
|
540
540
|
};
|
|
541
|
-
return "conversion" in t && (
|
|
541
|
+
return "conversion" in t && (n.conversion = t.conversion), n;
|
|
542
542
|
}
|
|
543
|
-
function
|
|
544
|
-
const
|
|
545
|
-
const s =
|
|
543
|
+
function o(t) {
|
|
544
|
+
const n = function(...r) {
|
|
545
|
+
const s = r[0];
|
|
546
546
|
if (s == null)
|
|
547
547
|
return s;
|
|
548
|
-
s.length > 1 && (
|
|
549
|
-
const l = t(
|
|
548
|
+
s.length > 1 && (r = s);
|
|
549
|
+
const l = t(r);
|
|
550
550
|
if (typeof l == "object")
|
|
551
551
|
for (let c = l.length, i = 0; i < c; i++)
|
|
552
552
|
l[i] = Math.round(l[i]);
|
|
553
553
|
return l;
|
|
554
554
|
};
|
|
555
|
-
return "conversion" in t && (
|
|
555
|
+
return "conversion" in t && (n.conversion = t.conversion), n;
|
|
556
556
|
}
|
|
557
557
|
return g.forEach((t) => {
|
|
558
558
|
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] =
|
|
559
|
+
const n = h(t);
|
|
560
|
+
Object.keys(n).forEach((s) => {
|
|
561
|
+
const l = n[s];
|
|
562
|
+
a[t][s] = o(l), a[t][s].raw = e(l);
|
|
563
563
|
});
|
|
564
564
|
}), E = a, E;
|
|
565
565
|
}
|
|
@@ -570,7 +570,7 @@ function H() {
|
|
|
570
570
|
}, g = (l, c) => (...i) => {
|
|
571
571
|
const f = l(...i);
|
|
572
572
|
return `\x1B[${38 + c};2;${f[0]};${f[1]};${f[2]}m`;
|
|
573
|
-
}, e = (l) => l,
|
|
573
|
+
}, e = (l) => l, o = (l, c, i) => [l, c, i], t = (l, c, i) => {
|
|
574
574
|
Object.defineProperty(l, c, {
|
|
575
575
|
get: () => {
|
|
576
576
|
const f = i();
|
|
@@ -584,11 +584,11 @@ function H() {
|
|
|
584
584
|
configurable: !0
|
|
585
585
|
});
|
|
586
586
|
};
|
|
587
|
-
let
|
|
588
|
-
const
|
|
589
|
-
|
|
587
|
+
let n;
|
|
588
|
+
const r = (l, c, i, f) => {
|
|
589
|
+
n === void 0 && (n = H());
|
|
590
590
|
const b = f ? 10 : 0, d = {};
|
|
591
|
-
for (const [m, p] of Object.entries(
|
|
591
|
+
for (const [m, p] of Object.entries(n)) {
|
|
592
592
|
const y = m === "ansi16" ? "ansi" : m;
|
|
593
593
|
m === c ? d[y] = l(i, b) : typeof p == "object" && (d[y] = l(p[c], b));
|
|
594
594
|
}
|
|
@@ -658,7 +658,7 @@ function H() {
|
|
|
658
658
|
return Object.defineProperty(c, "codes", {
|
|
659
659
|
value: l,
|
|
660
660
|
enumerable: !1
|
|
661
|
-
}), c.color.close = "\x1B[39m", c.bgColor.close = "\x1B[49m", t(c.color, "ansi", () =>
|
|
661
|
+
}), 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
662
|
}
|
|
663
663
|
Object.defineProperty(u, "exports", {
|
|
664
664
|
enumerable: !0,
|
|
@@ -674,21 +674,21 @@ const Z = (u, h, a) => {
|
|
|
674
674
|
if (g === -1)
|
|
675
675
|
return u;
|
|
676
676
|
const e = h.length;
|
|
677
|
-
let
|
|
677
|
+
let o = 0, t = "";
|
|
678
678
|
do
|
|
679
|
-
t += u.substr(
|
|
679
|
+
t += u.substr(o, g - o) + h + a, o = g + e, g = u.indexOf(h, o);
|
|
680
680
|
while (g !== -1);
|
|
681
|
-
return t += u.substr(
|
|
681
|
+
return t += u.substr(o), t;
|
|
682
682
|
}, ee = (u, h, a, g) => {
|
|
683
|
-
let e = 0,
|
|
683
|
+
let e = 0, o = "";
|
|
684
684
|
do {
|
|
685
685
|
const t = u[g - 1] === "\r";
|
|
686
|
-
|
|
686
|
+
o += u.substr(e, (t ? g - 1 : g) - e) + h + (t ? `\r
|
|
687
687
|
` : `
|
|
688
688
|
`) + a, e = g + 1, g = u.indexOf(`
|
|
689
689
|
`, e);
|
|
690
690
|
} while (g !== -1);
|
|
691
|
-
return
|
|
691
|
+
return o += u.substr(e), o;
|
|
692
692
|
};
|
|
693
693
|
var te = {
|
|
694
694
|
stringReplaceAll: Z,
|
|
@@ -711,7 +711,7 @@ function ne() {
|
|
|
711
711
|
["e", "\x1B"],
|
|
712
712
|
["a", "\x07"]
|
|
713
713
|
]);
|
|
714
|
-
function
|
|
714
|
+
function o(s) {
|
|
715
715
|
const l = s[0] === "u", c = s[1] === "{";
|
|
716
716
|
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
717
|
}
|
|
@@ -723,13 +723,13 @@ function ne() {
|
|
|
723
723
|
if (!Number.isNaN(d))
|
|
724
724
|
c.push(d);
|
|
725
725
|
else if (f = b.match(a))
|
|
726
|
-
c.push(f[2].replace(g, (m, p, y) => p ?
|
|
726
|
+
c.push(f[2].replace(g, (m, p, y) => p ? o(p) : y));
|
|
727
727
|
else
|
|
728
728
|
throw new Error(`Invalid Chalk template style argument: ${b} (in style '${s}')`);
|
|
729
729
|
}
|
|
730
730
|
return c;
|
|
731
731
|
}
|
|
732
|
-
function
|
|
732
|
+
function n(s) {
|
|
733
733
|
h.lastIndex = 0;
|
|
734
734
|
const l = [];
|
|
735
735
|
let c;
|
|
@@ -743,7 +743,7 @@ function ne() {
|
|
|
743
743
|
}
|
|
744
744
|
return l;
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function r(s, l) {
|
|
747
747
|
const c = {};
|
|
748
748
|
for (const f of l)
|
|
749
749
|
for (const b of f.styles)
|
|
@@ -762,14 +762,14 @@ function ne() {
|
|
|
762
762
|
let f = [];
|
|
763
763
|
if (l.replace(u, (b, d, m, p, y, D) => {
|
|
764
764
|
if (d)
|
|
765
|
-
f.push(
|
|
765
|
+
f.push(o(d));
|
|
766
766
|
else if (p) {
|
|
767
767
|
const P = f.join("");
|
|
768
|
-
f = [], i.push(c.length === 0 ? P :
|
|
768
|
+
f = [], i.push(c.length === 0 ? P : r(s, c)(P)), c.push({ inverse: m, styles: n(p) });
|
|
769
769
|
} else if (y) {
|
|
770
770
|
if (c.length === 0)
|
|
771
771
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
772
|
-
i.push(
|
|
772
|
+
i.push(r(s, c)(f.join(""))), f = [], c.pop();
|
|
773
773
|
} else
|
|
774
774
|
f.push(D);
|
|
775
775
|
}), i.push(f.join("")), c.length > 0) {
|
|
@@ -877,9 +877,9 @@ const ce = Object.defineProperties(() => {
|
|
|
877
877
|
if (h.indexOf("\x1B") !== -1)
|
|
878
878
|
for (; a !== void 0; )
|
|
879
879
|
h = re(h, a.close, a.open), a = a.parent;
|
|
880
|
-
const
|
|
880
|
+
const o = h.indexOf(`
|
|
881
881
|
`);
|
|
882
|
-
return
|
|
882
|
+
return o !== -1 && (h = oe(h, e, g, o)), g + h + e;
|
|
883
883
|
};
|
|
884
884
|
let A;
|
|
885
885
|
const X = (u, ...h) => {
|
|
@@ -887,10 +887,10 @@ const X = (u, ...h) => {
|
|
|
887
887
|
if (!k(a) || !k(a.raw))
|
|
888
888
|
return h.join(" ");
|
|
889
889
|
const g = h.slice(1), e = [a.raw[0]];
|
|
890
|
-
for (let
|
|
890
|
+
for (let o = 1; o < a.length; o++)
|
|
891
891
|
e.push(
|
|
892
|
-
String(g[
|
|
893
|
-
String(a.raw[
|
|
892
|
+
String(g[o - 1]).replace(/[{}\\]/g, "\\$&"),
|
|
893
|
+
String(a.raw[o])
|
|
894
894
|
);
|
|
895
895
|
return A === void 0 && (A = ne()), A(u, e.join(""));
|
|
896
896
|
};
|
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;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:g,apiKey:e})=>{const o=new URLSearchParams({path:i||"/",domain:g}),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 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: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),d=f-Math.min(l,c,a),b=function(p){return(f-p)/6/d+1/2};return d===0?(r=0,s=0):(s=d/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 g(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=g(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,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 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 H(){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 g(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=g(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 $,L;function Q(){if(L)return $;L=1;const u=T(),h=H(),i={},g=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 g.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)})}),$=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,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=Q());const d=f?10:0,b={};for(const[p,y]of Object.entries(n)){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",()=>r(h,"ansi16",e,!1)),t(c.color,"ansi256",()=>r(i,"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(i,"ansi256",e,!0)),t(c.bgColor,"ansi16m",()=>r(g,"rgb",o,!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 o=0,t="";do t+=u.substr(o,g-o)+h+i,o=g+e,g=u.indexOf(h,o);while(g!==-1);return t+=u.substr(o),t},stringEncaseCRLFWithFirstIndex:(u,h,i,g)=>{let e=0,o="";do{const t=u[g-1]==="\r";o+=u.substr(e,(t?g-1:g)-e)+h+(t?`\r
|
|
2
2
|
`:`
|
|
3
3
|
`)+i,e=g+1,g=u.indexOf(`
|
|
4
|
-
`,e)}while(g!==-1);return
|
|
5
|
-
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function
|
|
6
|
-
`);return
|
|
4
|
+
`,e)}while(g!==-1);return o+=u.substr(e),o}},A,U;function te(){if(U)return A;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$/,g=/\\(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 d of a){const b=Number(d);if(!Number.isNaN(b))c.push(b);else if(f=d.match(i))c.push(f[2].replace(g,(p,y,w)=>y?o(y):w));else throw new Error(`Invalid Chalk template style argument: ${d} (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 d of f.styles)c[d[0]]=f.inverse?null:d.slice(1);let a=s;for(const[f,d]of Object.entries(c))if(!!Array.isArray(d)){if(!(f in a))throw new Error(`Unknown Chalk style: ${f}`);a=d.length>0?a[f](...d):a[f]}return a}return A=(s,l)=>{const c=[],a=[];let f=[];if(l.replace(u,(d,b,p,y,w,ue)=>{if(b)f.push(o(b));else if(y){const K=f.join("");f=[],a.push(c.length===0?K:r(s,c)(K)),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(ue)}),a.push(f.join("")),c.length>0){const d=`Chalk template literal is missing ${c.length} closing bracket${c.length===1?"":"s"} (\`}\`)`;throw new Error(d)}return a.join("")},A}const C=_.exports,{stdout:F,stderr:R}=Z,{stringReplaceAll:ne,stringEncaseCRLFWithFirstIndex:re}=ee,{isArray:M}=Array,G=["ansi","ansi","ansi256","ansi16m"],v=Object.create(null),oe=(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 se{constructor(h){return J(h)}}const J=u=>{const h={};return oe(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=se,h.template};function x(u){return J(u)}for(const[u,h]of Object.entries(C))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 g=P(C.color[G[h]][u](...i),C.color.close,this._styler);return j(this,g,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(...g){const e=P(C.bgColor[G[i]][u](...g),C.bgColor.close,this._styler);return j(this,e,this._isEmpty)}}}}const le=Object.defineProperties(()=>{},{...v,level:{enumerable:!0,get(){return this._generator.level},set(u){this._generator.level=u}}}),P=(u,h,i)=>{let g,e;return i===void 0?(g=u,e=h):(g=i.openAll+u,e=h+i.closeAll),{open:u,close:h,openAll:g,closeAll:e,parent:i}},j=(u,h,i)=>{const g=(...e)=>M(e[0])&&M(e[0].raw)?X(g,D(g,...e)):X(g,e.length===1?""+e[0]:e.join(" "));return Object.setPrototypeOf(g,le),g._generator=u,g._styler=h,g._isEmpty=i,g},X=(u,h)=>{if(u.level<=0||!h)return u._isEmpty?"":h;let i=u._styler;if(i===void 0)return h;const{openAll:g,closeAll:e}=i;if(h.indexOf("\x1B")!==-1)for(;i!==void 0;)h=ne(h,i.close,i.open),i=i.parent;const o=h.indexOf(`
|
|
6
|
+
`);return o!==-1&&(h=re(h,e,g,o)),g+h+e};let q;const D=(u,...h)=>{const[i]=h;if(!M(i)||!M(i.raw))return h.join(" ");const g=h.slice(1),e=[i.raw[0]];for(let o=1;o<i.length;o++)e.push(String(g[o-1]).replace(/[{}\\]/g,"\\$&"),String(i.raw[o]));return q===void 0&&(q=te()),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 ce=E;const ie=u=>{console.log(`${ce.magenta("JamComments:")} ${u}`)},ae=u=>{console.error(`JamComments: ${u}`)};m.log=ie,m.logError=ae,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.4",
|
|
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.4",
|
|
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": "bf211fadf04379b2c470f1d53fea5b6f2cde3060"
|
|
42
42
|
}
|