@commentkit/comment-kit 1.6.0 → 2.0.1
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/CHANGELOG.md +298 -590
- package/README.md +421 -145
- package/SECURITY.md +47 -46
- package/dist/node/THIRD_PARTY_NOTICES.txt +56 -0
- package/dist/node/browser.js +17 -0
- package/dist/node/cli/api.js +226 -0
- package/dist/node/cli/bin.js +18 -0
- package/dist/node/cli/credentials.js +268 -0
- package/dist/node/cli/doctor.js +789 -0
- package/dist/node/cli/format.js +54 -0
- package/dist/node/cli/init.js +686 -0
- package/dist/node/cli/main.js +537 -0
- package/dist/node/cli/mcp.js +295 -0
- package/dist/node/cli/open.js +20 -0
- package/dist/node/plugins/astro-B5y1Gtbf.js +31 -0
- package/dist/node/plugins/astro.js +26 -0
- package/dist/node/plugins/git-BIXLbL3f.js +92 -0
- package/dist/node/plugins/jsx-Bg4BdSph.js +7958 -0
- package/dist/node/plugins/next.js +48 -0
- package/dist/node/plugins/options-THop1K92.js +71 -0
- package/dist/node/plugins/transform-CKiAuSbk.js +1155 -0
- package/dist/node/plugins/vite-BdAYUW10.js +74 -0
- package/dist/node/plugins/vite.js +1 -0
- package/dist/node/plugins/webpack-R2U2DLlY.js +35 -0
- package/dist/node/plugins/webpack-loader.cjs +21 -0
- package/dist/node/plugins/webpack-loader.js +18 -0
- package/dist/node/plugins/webpack.js +1 -0
- package/dist/node/shared/dashboard-places.js +33 -0
- package/dist/node/shared/endpoint.js +26 -0
- package/dist/node/shared/format.js +63 -0
- package/dist/node/types/astro.d.ts +11 -0
- package/dist/node/types/next.d.ts +34 -0
- package/dist/node/types/options.d.ts +59 -0
- package/dist/node/types/vite.d.ts +11 -0
- package/dist/node/types/webpack-loader.d.ts +22 -0
- package/dist/node/types/webpack.d.ts +27 -0
- package/dist/npm/THIRD_PARTY_NOTICES.txt +6 -6
- package/dist/npm/chunks/AgentSend-DOy3jhyF.js +68 -0
- package/dist/npm/chunks/Checklist-CW_SwMpS.js +282 -0
- package/dist/npm/chunks/Composer-Bveq5QrK.js +727 -0
- package/dist/npm/chunks/Guest-7hcN765o.js +270 -0
- package/dist/npm/chunks/MarkupEditor-6bJGpWGO.js +345 -0
- package/dist/npm/chunks/Panel-ChPUB68C.js +1211 -0
- package/dist/npm/chunks/Settings-CB5eEKnf.js +231 -0
- package/dist/npm/chunks/Shortcuts-eAyjJ89P.js +62 -0
- package/dist/npm/chunks/StyleEditor-CZTdAA5c.js +46 -0
- package/dist/npm/chunks/StylePanel-B4pHQUL9.js +199 -0
- package/dist/npm/chunks/TaskFields-C8BX0Sgg.js +289 -0
- package/dist/npm/chunks/ThreadCard-B1EsX3PR.js +1160 -0
- package/dist/npm/chunks/Viewer-DY6zb90M.js +114 -0
- package/dist/npm/chunks/{agent-BDMQtOzH.js → agent-MTQHr9ei.js} +9 -9
- package/dist/npm/chunks/{anchor-BsradQhn.js → anchor-BsQNVkHj.js} +108 -85
- package/dist/npm/chunks/{ar-8tPch6W4.js → ar-L5cQ-NPe.js} +71 -19
- package/dist/npm/chunks/card-bits-CTdrkYn8.js +53 -0
- package/dist/npm/chunks/{client-EFTWxHbJ.js → client-7eVxvg5j.js} +282 -290
- package/dist/npm/chunks/confetti-BIs5s14P.js +49 -0
- package/dist/npm/chunks/context-BuMl7A07.js +48 -0
- package/dist/npm/chunks/context-Cf6khm7A.js +20 -0
- package/dist/npm/chunks/{de-C63897uD.js → de-D0C-v6tP.js} +62 -18
- package/dist/npm/chunks/dialog-DvdIkCW0.js +3 -0
- package/dist/npm/chunks/dpop-0A76OPa9.js +96 -0
- package/dist/npm/chunks/drafts-B0ctr1g9.js +21 -0
- package/dist/npm/chunks/{es-CI2bSpvB.js → es-Bw4Dj9tN.js} +62 -18
- package/dist/npm/chunks/extension-DFVOvciD.js +62 -0
- package/dist/npm/chunks/{extension-BST6LH1q.js → extension-SmoH5AA4.js} +20 -12
- package/dist/npm/chunks/files-4lV9YQIX.js +114 -0
- package/dist/npm/chunks/{fr-rsVe-Lqk.js → fr-TkuQaIAa.js} +120 -76
- package/dist/npm/chunks/{hi-cvwbSaWP.js → hi-DXSH2U8d.js} +63 -19
- package/dist/npm/chunks/{i18n-C4v0M-6z.js → i18n-aVSu9TcJ.js} +136 -92
- package/dist/npm/chunks/identify-BGYh2dVo.js +106 -0
- package/dist/npm/chunks/{it-C8tnV0BF.js → it-CiWA_bch.js} +81 -37
- package/dist/npm/chunks/{ja-BWxDfC2f.js → ja-C-QmR3yz.js} +60 -16
- package/dist/npm/chunks/late-words-80_VWt8S.js +14 -0
- package/dist/npm/chunks/live-BExWHzQ7.js +85 -0
- package/dist/npm/chunks/locale-D8Q4Q2Nt.js +26 -0
- package/dist/npm/chunks/{nl-DNQ6eCht.js → nl-CEmZRqjX.js} +63 -19
- package/dist/npm/chunks/page-key-HSY3Lze5.js +62 -0
- package/dist/npm/chunks/{pick-CLyOdjnD.js → pick-B3sR7jtS.js} +45 -44
- package/dist/npm/chunks/pkce-CfZhiNBi.js +8 -0
- package/dist/npm/chunks/placement-BF_HOUDD.js +74 -0
- package/dist/npm/chunks/privacy-BWUGlHw5.js +57 -0
- package/dist/npm/chunks/{pt-BR-CkG7vpU2.js → pt-BR-b-a8sxO8.js} +62 -18
- package/dist/npm/chunks/{realtime-DIo-Wth4.js → realtime-C79zF50C.js} +14 -12
- package/dist/npm/chunks/report-DaVuoRYS.js +44 -0
- package/dist/npm/chunks/show-BoN8AC-F.js +97 -0
- package/dist/npm/chunks/signin-BOWr_WCo.js +75 -0
- package/dist/npm/chunks/{source-CS7C6wJA.js → source-mk3rGBBQ.js} +1 -1
- package/dist/npm/chunks/src-C8rZFyL_.js +215 -0
- package/dist/npm/chunks/start-CV4j78_q.js +1894 -0
- package/dist/npm/chunks/states-b9Bv3Ci7.js +3 -0
- package/dist/npm/chunks/upload-B2mkgMeJ.js +42 -0
- package/dist/npm/chunks/uploads-8AxyRq7g.js +1147 -0
- package/dist/npm/chunks/wrap-DW6EFbVQ.js +69 -0
- package/dist/npm/chunks/{zh-CN-BKuZOLBE.js → zh-CN-JTscW8u8.js} +61 -17
- package/dist/npm/element.js +58 -21
- package/dist/npm/headless.js +7 -3
- package/dist/npm/index.js +3 -3
- package/dist/npm/react.js +18 -11
- package/dist/npm/svelte.js +28 -12
- package/dist/npm/types/adapters/react.d.ts +4 -1
- package/dist/npm/types/adapters/svelte.d.ts +4 -1
- package/dist/npm/types/adapters/vue.d.ts +35 -2
- package/dist/npm/types/anchor/index.d.ts +19 -0
- package/dist/npm/types/capture/privacy.d.ts +14 -0
- package/dist/npm/types/core/api.d.ts +20 -1
- package/dist/npm/types/core/auth.d.ts +40 -21
- package/dist/npm/types/core/client.d.ts +60 -4
- package/dist/npm/types/core/page-key.d.ts +42 -0
- package/dist/npm/types/core/types.d.ts +87 -4
- package/dist/npm/types/element.d.ts +17 -7
- package/dist/npm/types/headless.d.ts +2 -1
- package/dist/npm/types/index.d.ts +16 -6
- package/dist/npm/vue.js +44 -9
- package/package.json +90 -14
- package/dist/npm/chunks/AgentSend-2JPDseOo.js +0 -63
- package/dist/npm/chunks/Checklist-BpDXQebo.js +0 -257
- package/dist/npm/chunks/Composer-CAyj-c8e.js +0 -677
- package/dist/npm/chunks/Guest-ZdFmTcXI.js +0 -187
- package/dist/npm/chunks/MarkupEditor-BFplZwFy.js +0 -332
- package/dist/npm/chunks/Panel-BhZ4XRDR.js +0 -861
- package/dist/npm/chunks/Settings-SPG9EHUZ.js +0 -204
- package/dist/npm/chunks/Shortcuts-C28HVDw6.js +0 -58
- package/dist/npm/chunks/StyleEditor-ByZMtq10.js +0 -43
- package/dist/npm/chunks/StylePanel-Iwhce2tE.js +0 -197
- package/dist/npm/chunks/TaskFields-BsP_fVJg.js +0 -273
- package/dist/npm/chunks/ThreadCard-BzVZdDCb.js +0 -1030
- package/dist/npm/chunks/Viewer-CqtGrdD8.js +0 -108
- package/dist/npm/chunks/card-bits-Bna-g3Py.js +0 -124
- package/dist/npm/chunks/confetti-DTKpwF3O.js +0 -40
- package/dist/npm/chunks/drafts-akdBsOd0.js +0 -50
- package/dist/npm/chunks/extension-D-V3utTm.js +0 -53
- package/dist/npm/chunks/live-BCpJVBeN.js +0 -33
- package/dist/npm/chunks/report-BBrT3r89.js +0 -27
- package/dist/npm/chunks/src-C4FsVoUp.js +0 -148
- package/dist/npm/chunks/start-i9M-r3aH.js +0 -1800
- package/dist/npm/chunks/upload-DSv7EyBD.js +0 -41
- package/dist/npm/chunks/uploads-I01kdqQF.js +0 -1103
|
@@ -267,11 +267,11 @@ function W(e, t) {
|
|
|
267
267
|
return e >= n.__.length && n.__.push({}), n.__[e];
|
|
268
268
|
}
|
|
269
269
|
function fe(e) {
|
|
270
|
-
return V = 1, pe(
|
|
270
|
+
return V = 1, pe(Ce, e);
|
|
271
271
|
}
|
|
272
272
|
function pe(e, t, n) {
|
|
273
273
|
var r = W(L++, 2);
|
|
274
|
-
if (r.t = e, !r.__c && (r.__ = [n ? n(t) :
|
|
274
|
+
if (r.t = e, !r.__c && (r.__ = [n ? n(t) : Ce(void 0, t), function(e) {
|
|
275
275
|
var t = r.__N ? r.__N[0] : r.__[0], n = r.t(t, e);
|
|
276
276
|
B(t, n) || (r.__N = [n, r.__[1]], r.__c.setState({}));
|
|
277
277
|
}], r.__c = R, !R.__f)) {
|
|
@@ -315,6 +315,15 @@ function _e(e, t) {
|
|
|
315
315
|
}, t);
|
|
316
316
|
}
|
|
317
317
|
function ve() {
|
|
318
|
+
var e = W(L++, 11);
|
|
319
|
+
if (!e.__) {
|
|
320
|
+
for (var t = R.__v; !t.__m && t.__;) t = t.__;
|
|
321
|
+
var n = t.__m || (t.__m = [0, 0]);
|
|
322
|
+
e.__ = "P" + n[0] + "-" + n[1]++;
|
|
323
|
+
}
|
|
324
|
+
return e.__;
|
|
325
|
+
}
|
|
326
|
+
function ye() {
|
|
318
327
|
var e;
|
|
319
328
|
do {
|
|
320
329
|
for (; e = H.shift();) try {
|
|
@@ -345,7 +354,7 @@ U.__b = function(e) {
|
|
|
345
354
|
}, U.diffed = function(e) {
|
|
346
355
|
ce && ce(e);
|
|
347
356
|
var t = e.__c;
|
|
348
|
-
t && t.__H && (t.__H.__h.length &&
|
|
357
|
+
t && t.__H && (t.__H.__h.length && Se(ae.push(t)), t.__H.__.some(function(e) {
|
|
349
358
|
e.u && (e.__H = e.u);
|
|
350
359
|
})), z = R = null;
|
|
351
360
|
}, U.__c = function(e, t) {
|
|
@@ -370,22 +379,22 @@ U.__b = function(e) {
|
|
|
370
379
|
for (n = e.__; n && (!n.__c || !n.__c.__P);) n = n.__;
|
|
371
380
|
n = n && n.__c;
|
|
372
381
|
}
|
|
373
|
-
r.__P = n,
|
|
382
|
+
r.__P = n, Se(H.push(r));
|
|
374
383
|
} else K(r);
|
|
375
384
|
} catch (e) {
|
|
376
385
|
t = e;
|
|
377
386
|
}
|
|
378
387
|
}), r.__H = void 0, t && U.__e(t, r.__v));
|
|
379
388
|
};
|
|
380
|
-
var
|
|
381
|
-
function
|
|
389
|
+
var be = typeof requestAnimationFrame == "function";
|
|
390
|
+
function xe(e) {
|
|
382
391
|
var t, n = function() {
|
|
383
|
-
clearTimeout(r),
|
|
392
|
+
clearTimeout(r), be && cancelAnimationFrame(t), setTimeout(e);
|
|
384
393
|
}, r = setTimeout(n, 35);
|
|
385
|
-
|
|
394
|
+
be && (t = requestAnimationFrame(n));
|
|
386
395
|
}
|
|
387
|
-
function
|
|
388
|
-
e != 1 && ie == U.requestAnimationFrame || ((ie = U.requestAnimationFrame) ||
|
|
396
|
+
function Se(e) {
|
|
397
|
+
e != 1 && ie == U.requestAnimationFrame || ((ie = U.requestAnimationFrame) || xe)(ye);
|
|
389
398
|
}
|
|
390
399
|
function K(e) {
|
|
391
400
|
var t = R, n = e.__c;
|
|
@@ -400,13 +409,13 @@ function J(e, t) {
|
|
|
400
409
|
return !B(t, e[n]);
|
|
401
410
|
});
|
|
402
411
|
}
|
|
403
|
-
function
|
|
412
|
+
function Ce(e, t) {
|
|
404
413
|
return typeof t == "function" ? t(e) : t;
|
|
405
414
|
}
|
|
406
415
|
// node_modules/preact/jsx-runtime/dist/jsxRuntime.mjs
|
|
407
|
-
var
|
|
416
|
+
var we = Symbol.for("pv"), Te = 0;
|
|
408
417
|
Array.isArray;
|
|
409
|
-
function
|
|
418
|
+
function Ee(t, n, r, i, a, o) {
|
|
410
419
|
n || (n = {});
|
|
411
420
|
var s, c, l = n;
|
|
412
421
|
if ("ref" in l && typeof t != "function") for (c in l = {}, n) c == "ref" ? s = n[c] : l[c] = n[c];
|
|
@@ -420,8 +429,8 @@ function Te(t, n, r, i, a, o) {
|
|
|
420
429
|
__b: 0,
|
|
421
430
|
__e: null,
|
|
422
431
|
__c: null,
|
|
423
|
-
constructor:
|
|
424
|
-
__v: --
|
|
432
|
+
constructor: we,
|
|
433
|
+
__v: --Te,
|
|
425
434
|
__i: -1,
|
|
426
435
|
__u: 0
|
|
427
436
|
};
|
|
@@ -446,7 +455,7 @@ var Y = {
|
|
|
446
455
|
attach: "Attach a file",
|
|
447
456
|
screenshot: "Screenshot",
|
|
448
457
|
screenshotIncluded: "A screenshot of what you see is included automatically.",
|
|
449
|
-
screenshotRemove: "
|
|
458
|
+
screenshotRemove: "Remove screenshot",
|
|
450
459
|
screenshotAdd: "Include screenshot",
|
|
451
460
|
markup: "Draw on screenshot",
|
|
452
461
|
markupDone: "Done drawing",
|
|
@@ -454,7 +463,7 @@ var Y = {
|
|
|
454
463
|
tool_arrow: "Arrow",
|
|
455
464
|
tool_rect: "Box",
|
|
456
465
|
tool_pen: "Pen",
|
|
457
|
-
tool_blur: "
|
|
466
|
+
tool_blur: "Pixelate",
|
|
458
467
|
tool_text: "Text",
|
|
459
468
|
markupTextPrompt: "What should the note say?",
|
|
460
469
|
undo: "Undo",
|
|
@@ -470,21 +479,23 @@ var Y = {
|
|
|
470
479
|
signIn: "Continue",
|
|
471
480
|
signInMember: "Sign in",
|
|
472
481
|
signOut: "Sign out",
|
|
473
|
-
popupBlocked: "Your browser blocked the sign-in window.
|
|
482
|
+
popupBlocked: "Your browser blocked the sign-in window. Try again, or allow pop-ups for this site.",
|
|
474
483
|
signInCancelled: "Sign-in was closed before it finished. Your comment is still here.",
|
|
484
|
+
insecureContext: "Sign-in only works on a secure (https) address. Ask the website's team for the https link to this page.",
|
|
475
485
|
sent: "Sent! The team has been notified.",
|
|
476
|
-
sentGuest: "Sent! We
|
|
486
|
+
sentGuest: "Sent! We’ll email you when someone replies.",
|
|
477
487
|
thisPage: "This page",
|
|
478
488
|
allPages: "All pages",
|
|
479
489
|
notifications: "Notifications",
|
|
480
490
|
nothingHere: "No feedback on this page yet.",
|
|
481
491
|
nothingHereHint: "Click Comment, then click anything on the page.",
|
|
492
|
+
nothingHereHintTouch: "Tap Comment, then tap anything on the page.",
|
|
482
493
|
nothingAnywhere: "No feedback on this site yet.",
|
|
483
494
|
noMatch: "No feedback matches your search or filters.",
|
|
484
495
|
clearFilters: "Clear filters",
|
|
485
|
-
allCaughtUp: "You
|
|
496
|
+
allCaughtUp: "You’re all caught up.",
|
|
486
497
|
search: "Search feedback",
|
|
487
|
-
detached: "We can
|
|
498
|
+
detached: "We can’t find this spot on the page anymore. It may have changed since the comment was left.",
|
|
488
499
|
moved: "This part of the page changed since the comment was left.",
|
|
489
500
|
screen_phone: "Left on a phone-sized screen",
|
|
490
501
|
screen_tablet: "Left on a tablet-sized screen",
|
|
@@ -500,11 +511,11 @@ var Y = {
|
|
|
500
511
|
resolve: "Resolve",
|
|
501
512
|
resolveHint: "Mark this as fixed",
|
|
502
513
|
resolvedToast: "Resolved {ref}.",
|
|
503
|
-
undoTooLate: "It
|
|
514
|
+
undoTooLate: "It’s too late to undo this. Reopen {ref} if it still needs work.",
|
|
504
515
|
reopen: "Reopen",
|
|
505
516
|
markInProgress: "Start working",
|
|
506
|
-
markInReview: "
|
|
507
|
-
closeThread: "Close without
|
|
517
|
+
markInReview: "Mark ready for review",
|
|
518
|
+
closeThread: "Close without fixing",
|
|
508
519
|
reviewAsk: "The team thinks this is fixed. Does it look right to you?",
|
|
509
520
|
looksGood: "Looks good — resolve",
|
|
510
521
|
notYet: "Not yet — reply",
|
|
@@ -520,7 +531,7 @@ var Y = {
|
|
|
520
531
|
agentReady_one: "1 comment ready",
|
|
521
532
|
openIn: "Open in {agent}",
|
|
522
533
|
copyPrompt: "Copy prompt",
|
|
523
|
-
agentOpened: "Opening {agent} with the prompt filled in. It
|
|
534
|
+
agentOpened: "Opening {agent} with the prompt filled in. It’s on your clipboard too.",
|
|
524
535
|
agentOpenedShort: "Opening {agent} with a short version. The full prompt is on your clipboard.",
|
|
525
536
|
agentCopied: "Copied {n} comments for your agent.",
|
|
526
537
|
agentCopied_one: "Copied 1 comment for your agent.",
|
|
@@ -530,26 +541,27 @@ var Y = {
|
|
|
530
541
|
delete: "Delete",
|
|
531
542
|
edit: "Edit",
|
|
532
543
|
edited: "edited",
|
|
544
|
+
teamOnly: "Team only",
|
|
533
545
|
save: "Save",
|
|
534
546
|
saving: "Saving…",
|
|
535
547
|
mute: "Turn off notifications",
|
|
536
548
|
unmute: "Turn on notifications",
|
|
537
|
-
muted: "You won
|
|
538
|
-
followed: "We
|
|
549
|
+
muted: "You won’t get emails about {ref} anymore.",
|
|
550
|
+
followed: "We’ll email you about {ref} again.",
|
|
539
551
|
unassigned: "Unassigned",
|
|
540
|
-
readOnly: "Feedback is read-only right now because your team
|
|
552
|
+
readOnly: "Feedback is read-only right now because your team’s subscription has ended. You can still read everything.",
|
|
541
553
|
readOnlyGuest: "New feedback is paused on this site right now. You can still read everything.",
|
|
542
554
|
paused: "Feedback is paused on this site right now. Check back later.",
|
|
543
|
-
offline: "You
|
|
544
|
-
offlineSend: "You
|
|
545
|
-
errorGeneric: "That didn
|
|
546
|
-
loadFailed: "We couldn
|
|
547
|
-
sendFailed: "Your comment wasn
|
|
555
|
+
offline: "You’re offline. We’ll keep your draft until you’re back.",
|
|
556
|
+
offlineSend: "You’re offline. Your comment is saved here; send it when you’re back online.",
|
|
557
|
+
errorGeneric: "That didn’t work. Check your connection and try again.",
|
|
558
|
+
loadFailed: "We couldn’t load the feedback. Check your connection and try again.",
|
|
559
|
+
sendFailed: "Your comment wasn’t sent yet. It’s still here, so you can try again.",
|
|
548
560
|
savedHere: "Your comment is saved on this device.",
|
|
549
561
|
retry: "Try again",
|
|
550
562
|
loadingThread: "Loading the conversation…",
|
|
551
563
|
readOnlyReply: "You can read this conversation, but replies are turned off right now.",
|
|
552
|
-
noReplyAccess: "You can read this
|
|
564
|
+
noReplyAccess: "You can read this conversation, but you don’t have permission to reply.",
|
|
553
565
|
notOnPage: "Not found on this page",
|
|
554
566
|
more: "More",
|
|
555
567
|
allStatuses: "All",
|
|
@@ -594,58 +606,63 @@ var Y = {
|
|
|
594
606
|
peopleHere_one: "{n} person here",
|
|
595
607
|
markupTextAdd: "Add note",
|
|
596
608
|
includeDiagnostics: "Include technical details to help the developer",
|
|
609
|
+
diagnosticsSee: "See what's included",
|
|
610
|
+
diagnosticsEmpty: "Nothing has been recorded on this page yet.",
|
|
597
611
|
filters: "Filters",
|
|
598
612
|
assignedToMe: "Assigned to me",
|
|
599
613
|
assigneeFilter: "Assigned to",
|
|
600
614
|
anyone: "Anyone",
|
|
601
615
|
labelFilter: "Label",
|
|
602
616
|
anyLabel: "Any label",
|
|
603
|
-
fileNotAllowed: "{name} can
|
|
617
|
+
fileNotAllowed: "{name} can’t be attached. You can attach images, PDFs, text, video and Office files.",
|
|
604
618
|
fileTooBig: "{name} is too big to attach. The limit is {size}.",
|
|
605
619
|
tooManyFiles: "You can attach up to {n} files.",
|
|
606
620
|
tooManyFiles_one: "You can attach up to {n} file.",
|
|
607
621
|
removeFile: "Remove {name}",
|
|
608
622
|
threadNotFound: "This feedback was deleted, or you no longer have access to it.",
|
|
609
623
|
readOnlyShort: "Read-only: you can read feedback, but not add to it right now.",
|
|
610
|
-
guestExplain: "We
|
|
624
|
+
guestExplain: "We’ll email you a 6-digit code. Your comment is published as soon as you enter the code.",
|
|
611
625
|
guestName: "Your name",
|
|
612
626
|
guestEmail: "Your email",
|
|
613
627
|
guestIntro: "Your name and email, so the team can reply. No account needed.",
|
|
614
|
-
guestPrivacy: "Your name, email and
|
|
628
|
+
guestPrivacy: "Your name, email, comments, the screenshot and basic browser details go to the team that runs this website, and to CommentKit, which runs this comment tool for them.",
|
|
615
629
|
guestPrivacyLink: "Privacy notice",
|
|
630
|
+
guestPrivacySite: "Privacy notice of {website}",
|
|
616
631
|
guestNameMissing: "Add your name so the team knows who wrote this.",
|
|
617
632
|
guestEmailInvalid: "Check your email address, for example name@company.com.",
|
|
618
|
-
shareExpired: "This
|
|
633
|
+
shareExpired: "This review link has expired. Ask the team for a new one.",
|
|
619
634
|
verifyTitle: "Check your email",
|
|
620
635
|
verifyBody: "Enter the 6-digit code to publish your comment. We sent it to {email}.",
|
|
621
|
-
verifyLookFor: "Look for an email from CommentKit: “Your code for {website}”. Check spam if it isn
|
|
636
|
+
verifyLookFor: "Look for an email from CommentKit: “Your code for {website}”. Check spam if it isn’t there.",
|
|
622
637
|
signInLinkTitle: "Welcome back to {project}",
|
|
623
|
-
signInLinkBody: "Continue to see the feedback and reply. We
|
|
638
|
+
signInLinkBody: "Continue to see the feedback and reply. We’ll email you a 6-digit code to confirm it’s you.",
|
|
624
639
|
notNow: "Not now",
|
|
625
640
|
verifyCode: "6-digit code",
|
|
626
641
|
verifyPublish: "Publish comment",
|
|
627
642
|
verifyResend: "Send a new code",
|
|
628
643
|
verifyResent: "We sent a new code. It can take a minute to arrive.",
|
|
629
644
|
verifyWait: "Wait a minute before asking for another code.",
|
|
630
|
-
|
|
645
|
+
guestCodesPaused: "This website has sent too many codes today. Try again tomorrow, or ask the team for help.",
|
|
646
|
+
verifyWrong: "That code isn’t right. Check the email, or send a new code.",
|
|
631
647
|
verifyDifferent: "Use a different email",
|
|
632
648
|
verifyExpired: "This code can no longer be used. Your comment is still saved on this device.",
|
|
633
|
-
verifyLinkExpired: "This
|
|
649
|
+
verifyLinkExpired: "This review link has expired. Ask the person who sent it for a new one. Your comment is saved on this device.",
|
|
634
650
|
verifyRemoved: "The team removed your access to this site. Ask them to add you again.",
|
|
635
651
|
writeAgain: "Write it again",
|
|
636
652
|
pendingNote: "Your comment is waiting for the code we emailed to {email}.",
|
|
637
653
|
enterCode: "Enter code",
|
|
638
654
|
feedbackRef: "Feedback {ref}",
|
|
639
|
-
networkError: "Couldn
|
|
640
|
-
serverError: "Something went wrong on CommentKit
|
|
641
|
-
noAccess: "You don
|
|
642
|
-
originNotAllowed: "Feedback can
|
|
643
|
-
forbidden: "You don
|
|
655
|
+
networkError: "Couldn’t reach CommentKit. Check your connection and try again.",
|
|
656
|
+
serverError: "Something went wrong on CommentKit’s side. Try again in a moment.",
|
|
657
|
+
noAccess: "You don’t have access to feedback on this site. Ask the team to invite you again.",
|
|
658
|
+
originNotAllowed: "Feedback can’t be sent from this web address yet. Ask the team to add it to the project.",
|
|
659
|
+
forbidden: "You don’t have permission to do that. Ask the team if you need it.",
|
|
644
660
|
tooFast: "That was a lot at once. Wait a moment, then try again.",
|
|
645
|
-
sentWithoutScreenshot: "Sent, but without the screenshot: it couldn
|
|
646
|
-
sentWithoutFiles: "Sent, but some files couldn
|
|
647
|
-
replyFailed: "Your reply wasn
|
|
661
|
+
sentWithoutScreenshot: "Sent, but without the screenshot: it couldn’t be uploaded.",
|
|
662
|
+
sentWithoutFiles: "Sent, but some files couldn’t be attached. You can add them in a reply.",
|
|
663
|
+
replyFailed: "Your reply wasn’t sent yet. It’s still here, so you can try again.",
|
|
648
664
|
taskDetails: "Task details",
|
|
665
|
+
taskDetailsSet: "Task details added",
|
|
649
666
|
priority: "Priority",
|
|
650
667
|
priority_none: "No priority",
|
|
651
668
|
priority_low: "Low",
|
|
@@ -664,9 +681,9 @@ var Y = {
|
|
|
664
681
|
formatCode: "Code",
|
|
665
682
|
reopenedToast: "{ref} is open again.",
|
|
666
683
|
editedToast: "Comment updated.",
|
|
667
|
-
editConflict: "Someone
|
|
684
|
+
editConflict: "Someone else edited this a moment ago. Their version is shown now, so make your change again.",
|
|
668
685
|
threadDeleted: "{ref} deleted.",
|
|
669
|
-
detailCreated: "
|
|
686
|
+
detailCreated: "Posted",
|
|
670
687
|
detailResolved: "Resolved",
|
|
671
688
|
detailPage: "Page",
|
|
672
689
|
detailBrowser: "Browser",
|
|
@@ -683,7 +700,7 @@ var Y = {
|
|
|
683
700
|
noReplies: "No replies yet. Be the first to respond.",
|
|
684
701
|
jumpToLatest: "Jump to latest",
|
|
685
702
|
replyToReopen: "Reply to reopen…",
|
|
686
|
-
quoteCancel: "Don
|
|
703
|
+
quoteCancel: "Don’t quote this message",
|
|
687
704
|
hideWidget: "Hide CommentKit",
|
|
688
705
|
hideWidgetHint: "{keys} brings it back",
|
|
689
706
|
shortcutNewLine: "New line",
|
|
@@ -692,8 +709,9 @@ var Y = {
|
|
|
692
709
|
results_one: "{n} result",
|
|
693
710
|
results: "{n} results",
|
|
694
711
|
resultsMore: "{n}+ results",
|
|
712
|
+
firstPageThreads: "Showing the first {n} comments on this page",
|
|
695
713
|
showMore: "Show more",
|
|
696
|
-
livePaused: "
|
|
714
|
+
livePaused: "Not connected. New comments show up after you reconnect.",
|
|
697
715
|
clearSearch: "Clear search",
|
|
698
716
|
filtersOn_one: "{n} filter on",
|
|
699
717
|
filtersOn: "{n} filters on",
|
|
@@ -714,7 +732,7 @@ var Y = {
|
|
|
714
732
|
color_purple: "Purple",
|
|
715
733
|
color_pink: "Pink",
|
|
716
734
|
markupTools: "Tools",
|
|
717
|
-
markupColors: "
|
|
735
|
+
markupColors: "Colors",
|
|
718
736
|
markupSize: "Line thickness",
|
|
719
737
|
markupHistory: "History",
|
|
720
738
|
redo: "Redo",
|
|
@@ -726,9 +744,10 @@ var Y = {
|
|
|
726
744
|
nextImage: "Next image",
|
|
727
745
|
attachments: "Attachments",
|
|
728
746
|
openImage: "Open {name}",
|
|
747
|
+
openImageMore: "Open {name} and {n} more",
|
|
729
748
|
uploading: "Uploading {name}",
|
|
730
749
|
retryUpload: "Try uploading {name} again",
|
|
731
|
-
uploadFailedShort: "This file didn
|
|
750
|
+
uploadFailedShort: "This file didn’t upload.",
|
|
732
751
|
moreReactions: "More reactions",
|
|
733
752
|
settings: "Settings",
|
|
734
753
|
account: "Your account",
|
|
@@ -745,7 +764,7 @@ var Y = {
|
|
|
745
764
|
checklist: "Checklist",
|
|
746
765
|
description: "Description",
|
|
747
766
|
checklistProgress: "{n} of {total} done",
|
|
748
|
-
checklistAdd: "Add an item
|
|
767
|
+
checklistAdd: "Add an item",
|
|
749
768
|
removeItem: "Remove {item}",
|
|
750
769
|
addChecklist: "Add a checklist",
|
|
751
770
|
checklistShort_one: "{done}/{n} done",
|
|
@@ -766,8 +785,8 @@ var Y = {
|
|
|
766
785
|
previousThread: "Previous",
|
|
767
786
|
nextThread: "Next",
|
|
768
787
|
showOnPage: "Show on the page",
|
|
769
|
-
doubleClickHint: "
|
|
770
|
-
spot_element: "On
|
|
788
|
+
doubleClickHint: "To close the inbox, press Esc or double-click the page.",
|
|
789
|
+
spot_element: "On a spot",
|
|
771
790
|
spot_region: "On an area",
|
|
772
791
|
spot_text: "On selected text",
|
|
773
792
|
spot_page: "On the whole page",
|
|
@@ -790,8 +809,33 @@ var Y = {
|
|
|
790
809
|
styleDone: "Done",
|
|
791
810
|
stylePrevious: "Previous value for {property}",
|
|
792
811
|
styleNext: "Next value for {property}",
|
|
793
|
-
styleEdit: "Edit the suggested style changes"
|
|
794
|
-
|
|
812
|
+
styleEdit: "Edit the suggested style changes",
|
|
813
|
+
shortcutsSetting: "Single-key shortcuts",
|
|
814
|
+
shortcutsSettingHint: "Use C, J, K, E and ? to comment, move between comments and resolve them. Turn this off if they get in the way of your screen reader or other tools.",
|
|
815
|
+
movePin: "Move pin",
|
|
816
|
+
movePinHint: "Click the new spot, or Tab to it and press Enter · Esc to cancel",
|
|
817
|
+
movePinHintTouch: "Tap the new spot for this comment",
|
|
818
|
+
unread: "Unread",
|
|
819
|
+
otherKind: "{actor} updated this",
|
|
820
|
+
unitKB: "{n} KB",
|
|
821
|
+
unitMB: "{n} MB",
|
|
822
|
+
unitGB: "{n} GB",
|
|
823
|
+
signOff: "Page sign-off",
|
|
824
|
+
signOffAsk: "Happy with this page?",
|
|
825
|
+
signOffApprove: "Approve this page",
|
|
826
|
+
signOffAgain: "Approve again",
|
|
827
|
+
signOffNote: "Add a note (optional)",
|
|
828
|
+
signOffDone: "Approved. The team has been notified.",
|
|
829
|
+
signOffMine: "You approved this page on {date}.",
|
|
830
|
+
signOffBy: "Approved by {name}",
|
|
831
|
+
signOffByMore: "Approved by {name} and {n} others",
|
|
832
|
+
signOffByMore_one: "Approved by {name} and {n} other",
|
|
833
|
+
signOffNewFeedback: "New feedback came in after this page was approved.",
|
|
834
|
+
signOffNewCommit: "This page has changed since it was approved.",
|
|
835
|
+
signOffOpen: "{n} comments on this page are still open. You can approve it anyway.",
|
|
836
|
+
signOffOpen_one: "{n} comment on this page is still open. You can approve it anyway.",
|
|
837
|
+
signOffWithdraw: "Withdraw approval"
|
|
838
|
+
}, De = [
|
|
795
839
|
"en",
|
|
796
840
|
"es",
|
|
797
841
|
"fr",
|
|
@@ -803,77 +847,77 @@ var Y = {
|
|
|
803
847
|
"zh-CN",
|
|
804
848
|
"hi",
|
|
805
849
|
"ar"
|
|
806
|
-
],
|
|
807
|
-
es: () => import("./es-
|
|
808
|
-
fr: () => import("./fr-
|
|
809
|
-
de: () => import("./de-
|
|
810
|
-
"pt-BR": () => import("./pt-BR-
|
|
811
|
-
it: () => import("./it-
|
|
812
|
-
nl: () => import("./nl-
|
|
813
|
-
ja: () => import("./ja-
|
|
814
|
-
"zh-CN": () => import("./zh-CN-
|
|
815
|
-
hi: () => import("./hi-
|
|
816
|
-
ar: () => import("./ar-
|
|
850
|
+
], Oe = {
|
|
851
|
+
es: () => import("./es-Bw4Dj9tN.js"),
|
|
852
|
+
fr: () => import("./fr-TkuQaIAa.js"),
|
|
853
|
+
de: () => import("./de-D0C-v6tP.js"),
|
|
854
|
+
"pt-BR": () => import("./pt-BR-b-a8sxO8.js"),
|
|
855
|
+
it: () => import("./it-CiWA_bch.js"),
|
|
856
|
+
nl: () => import("./nl-CEmZRqjX.js"),
|
|
857
|
+
ja: () => import("./ja-C-QmR3yz.js"),
|
|
858
|
+
"zh-CN": () => import("./zh-CN-JTscW8u8.js"),
|
|
859
|
+
hi: () => import("./hi-DXSH2U8d.js"),
|
|
860
|
+
ar: () => import("./ar-L5cQ-NPe.js")
|
|
817
861
|
}, X = /^(ar|he|iw|fa|ur|ps|yi|ckb|sd|ug|dv)(-|$)/i, Z = "en", Q = Y, $ = Promise.resolve();
|
|
818
|
-
function
|
|
862
|
+
function ke(e) {
|
|
819
863
|
let t = (e ?? "").trim().replace(/_/g, "-").toLowerCase();
|
|
820
864
|
if (!/^[a-z]{2,3}(-[a-z0-9]{1,8})*$/.test(t)) return null;
|
|
821
|
-
let n =
|
|
865
|
+
let n = De.find((e) => e.toLowerCase() === t);
|
|
822
866
|
if (n) return n;
|
|
823
867
|
let r = t.split("-")[0];
|
|
824
|
-
return
|
|
868
|
+
return De.find((e) => e.toLowerCase().split("-")[0] === r) ?? null;
|
|
825
869
|
}
|
|
826
|
-
function
|
|
870
|
+
function Ae(e) {
|
|
827
871
|
let t = [e];
|
|
828
872
|
typeof document < "u" && t.push(document.documentElement.lang), typeof navigator < "u" && t.push(...navigator.languages ?? [], navigator.language);
|
|
829
873
|
for (let e of t) {
|
|
830
|
-
let t =
|
|
874
|
+
let t = ke(e);
|
|
831
875
|
if (t) return t;
|
|
832
876
|
}
|
|
833
877
|
return "en";
|
|
834
878
|
}
|
|
835
|
-
function
|
|
836
|
-
let t =
|
|
837
|
-
return Z = t, t === "en" ? (Q = Y, $ = Promise.resolve(), $) : ($ =
|
|
879
|
+
function je(e) {
|
|
880
|
+
let t = Ae(e);
|
|
881
|
+
return Z = t, t === "en" ? (Q = Y, $ = Promise.resolve(), $) : ($ = Oe[t]().then((e) => {
|
|
838
882
|
Z === t && (Q = e.default);
|
|
839
883
|
}, () => {
|
|
840
884
|
Z === t && (Z = "en", Q = Y);
|
|
841
885
|
}), $);
|
|
842
886
|
}
|
|
843
|
-
function
|
|
887
|
+
function Me() {
|
|
844
888
|
return Z;
|
|
845
889
|
}
|
|
846
|
-
function
|
|
890
|
+
function Ne(e, t) {
|
|
847
891
|
let n = X.test(Z);
|
|
848
892
|
return e.replace(/\{(\w+)\}/g, (e, r) => {
|
|
849
893
|
let i = String(t[r] ?? "");
|
|
850
894
|
return n && i ? `\u2068${i}\u2069` : i;
|
|
851
895
|
});
|
|
852
896
|
}
|
|
853
|
-
function
|
|
854
|
-
return
|
|
897
|
+
function Pe(e, t = {}) {
|
|
898
|
+
return Ne(Q[e] ?? Y[e], t);
|
|
855
899
|
}
|
|
856
|
-
function
|
|
900
|
+
function Fe(e, t) {
|
|
857
901
|
let [n = "", r = ""] = (Q[e] ?? Y[e]).split(`{${t}}`);
|
|
858
902
|
return [n, r];
|
|
859
903
|
}
|
|
860
|
-
function
|
|
904
|
+
function Ie(e, t, n = {}) {
|
|
861
905
|
let r = "other", i = String(t);
|
|
862
906
|
try {
|
|
863
907
|
r = new Intl.PluralRules(Z).select(t), i = new Intl.NumberFormat(Z).format(t);
|
|
864
908
|
} catch {}
|
|
865
909
|
let a = Y;
|
|
866
|
-
return
|
|
910
|
+
return Ne(Q[`${e}_${r}`] ?? Q[e] ?? a[`${e}_${r}`] ?? Y[e], {
|
|
867
911
|
...n,
|
|
868
912
|
n: i
|
|
869
913
|
});
|
|
870
914
|
}
|
|
871
|
-
function
|
|
915
|
+
function Le() {
|
|
872
916
|
if (X.test(Z)) return "rtl";
|
|
873
917
|
let e = document.documentElement.dir || document.body?.dir;
|
|
874
918
|
return e === "rtl" || e === "ltr" ? e : X.test(document.documentElement.lang || "") ? "rtl" : "ltr";
|
|
875
919
|
}
|
|
876
|
-
function
|
|
920
|
+
function Re(e) {
|
|
877
921
|
let t = e ? new Date(e).getTime() : NaN;
|
|
878
922
|
if (!Number.isFinite(t)) return "";
|
|
879
923
|
try {
|
|
@@ -885,11 +929,11 @@ function Le(e) {
|
|
|
885
929
|
return new Date(t).toLocaleString();
|
|
886
930
|
}
|
|
887
931
|
}
|
|
888
|
-
function
|
|
932
|
+
function ze(e, t = Date.now()) {
|
|
889
933
|
let n = new Date(e).getTime();
|
|
890
934
|
if (!Number.isFinite(n)) return "";
|
|
891
935
|
let r = Math.max(0, (t - n) / 1e3);
|
|
892
|
-
if (r < 60) return
|
|
936
|
+
if (r < 60) return Pe("justNow");
|
|
893
937
|
if (r >= 2592e3) return new Date(n).toLocaleDateString(Z);
|
|
894
938
|
let [i, a] = r < 3600 ? ["minute", 60] : r < 86400 ? ["hour", 3600] : ["day", 86400], o = Math.floor(r / a);
|
|
895
939
|
try {
|
|
@@ -898,4 +942,4 @@ function Re(e, t = Date.now()) {
|
|
|
898
942
|
return `${o} ${i}`;
|
|
899
943
|
}
|
|
900
944
|
}
|
|
901
|
-
export {
|
|
945
|
+
export { fe as _, Ie as a, y as b, Pe as c, me as d, he as f, _e as g, pe as h, Re as i, Le as l, ge as m, Me as n, ze as o, ve as p, Y as r, je as s, Fe as t, Ee as u, G as v, b as x, I as y };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { _ as e, g as t, i as n, v as r } from "./client-7eVxvg5j.js";
|
|
2
|
+
import { t as i } from "./locale-D8Q4Q2Nt.js";
|
|
3
|
+
// src/core/identify.ts
|
|
4
|
+
var a = "See https://commentkit.dev/docs/identify", o = {
|
|
5
|
+
identity_not_set_up: "Sign-in from your website is not set up for this project yet. Create the identity secret in CommentKit (the website's Settings → For developers, under Sign in from your website) and sign the tokens with it on your server.",
|
|
6
|
+
identity_invalid: "The identity token was refused. It must be an HS256 JWT signed on your server with the website's identity secret, with sub, email, iat, exp (at most 10 minutes after iat) and aud set to your project key.",
|
|
7
|
+
identity_expired: "The identity token has expired. Make a fresh token for each page load (they last at most 10 minutes), or pass a function as `identity` that fetches one.",
|
|
8
|
+
identity_replayed: "This identity token was used already: every token works once. Make a new token for every sign-in, or pass a function as `identity` so CommentKit can ask for one.",
|
|
9
|
+
identity_conflict: "This email address already belongs to a reviewer who joined with an emailed code, so your website cannot sign someone in with it. To let your website's login vouch for that address, turn on \"Trust email addresses from my website's login\" in CommentKit (the website's Settings → For developers); or sign this person in with a different address.",
|
|
10
|
+
guest_removed: "The team removed this person from the website in CommentKit, so they cannot be signed in. Someone on the team can invite them again.",
|
|
11
|
+
plan_required: "This website is read-only in CommentKit (its plan has ended or does not include this), so nobody can be signed in from your website until the workspace owner renews it.",
|
|
12
|
+
origin_not_allowed: "This website is not on the project's list of websites, so sign-in from your website is refused here (it never works on localhost). Add it in CommentKit, in the website's Settings → Install, under Addresses."
|
|
13
|
+
}, s = 3, c = 30, l = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakSet();
|
|
14
|
+
function d(e, t, n, r = !1) {
|
|
15
|
+
r && typeof t == "function" && !u.has(e) && (u.add(e), e.auth.onChange((n, r) => {
|
|
16
|
+
!n && r && d(e, t);
|
|
17
|
+
}));
|
|
18
|
+
let i = (l.get(e) ?? Promise.resolve(!1)).then(() => p(e, t)).then((e) => (e && n?.(), e)).catch(() => !1);
|
|
19
|
+
return l.set(e, i), i;
|
|
20
|
+
}
|
|
21
|
+
async function f(e) {
|
|
22
|
+
let t;
|
|
23
|
+
try {
|
|
24
|
+
t = typeof e == "function" ? await e() : e;
|
|
25
|
+
} catch (e) {
|
|
26
|
+
return console.warn(`[CommentKit] The identity function threw, so nobody was signed in. ${a}`, e), null;
|
|
27
|
+
}
|
|
28
|
+
return typeof t != "string" || !t.trim() ? (console.warn(`[CommentKit] The identity function gave no token (it must return the token as a string). ${a}`), null) : t.trim();
|
|
29
|
+
}
|
|
30
|
+
async function p(e, t) {
|
|
31
|
+
let n = e.state.get().config?.disabled_reason;
|
|
32
|
+
if (t == null || t === "" || n === "version_blocked" || n === "not_live") return !1;
|
|
33
|
+
let r = e.auth, i = r.hasSession() ? e.state.get().session ?? await e.loadSession().catch(() => null) : null;
|
|
34
|
+
if (i && i.role !== "guest") return !1;
|
|
35
|
+
let l = await f(t);
|
|
36
|
+
if (!l) return !1;
|
|
37
|
+
let u = i?.email;
|
|
38
|
+
if (i && (!u || u.toLowerCase() === g(l))) return !0;
|
|
39
|
+
for (let n = 1;; n++) {
|
|
40
|
+
let u = await m(e, l);
|
|
41
|
+
if ("tokens" in u) return i && await r.signOut(), r.adopt(u.tokens), await e.loadSession().catch(() => null), r.hasSession();
|
|
42
|
+
let { error: d } = u, p = n >= s, g = u.retryAfter >= 0 ? u.retryAfter : 2 ** n;
|
|
43
|
+
if (d.status === 429 && !p && g <= c) await h(g * 1e3);
|
|
44
|
+
else {
|
|
45
|
+
if (d.status === 0 || d.status >= 500 && d.code !== "widget_disabled") {
|
|
46
|
+
if (!p && typeof t == "function") {
|
|
47
|
+
if (await h(500 * 2 ** n), l = await f(t), !l) return !1;
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
console.warn(`[CommentKit] Could not sign your user in: ${d.status ? "CommentKit failed to answer" : "the connection was lost"}. ${typeof t == "function" ? "Tried again with new tokens; the next page load tries again." : "A token works once, so it was not sent again: pass a function as `identity` (or call identify() with a new token) so CommentKit can ask for a fresh one."} ${a}`);
|
|
51
|
+
} else {
|
|
52
|
+
let e = o[d.code];
|
|
53
|
+
e ? console.warn(`[CommentKit] ${e} (${d.code}${d.code === "identity_invalid" ? `: ${d.message}` : ""}) ${a}`) : d.status === 429 && console.warn(`[CommentKit] Too many sign-ins from your website right now, so your user was not signed in. The next page load tries again. ${a}`);
|
|
54
|
+
}
|
|
55
|
+
return e.emit("error", { error: d }), !1;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async function m(a, o) {
|
|
60
|
+
let s = a.api.url("/widget/identify");
|
|
61
|
+
for (let c = !0;; c = !1) {
|
|
62
|
+
let l = await a.auth.proof("POST", s), u = e(t);
|
|
63
|
+
try {
|
|
64
|
+
let e = await fetch(s, {
|
|
65
|
+
method: "POST",
|
|
66
|
+
headers: {
|
|
67
|
+
Accept: "application/json",
|
|
68
|
+
"Content-Type": "application/json",
|
|
69
|
+
"X-CommentKit-SDK": n,
|
|
70
|
+
DPoP: l
|
|
71
|
+
},
|
|
72
|
+
body: JSON.stringify({
|
|
73
|
+
client_id: a.options.project,
|
|
74
|
+
identity: o,
|
|
75
|
+
locale: i(a.options.locale)
|
|
76
|
+
}),
|
|
77
|
+
credentials: "omit",
|
|
78
|
+
signal: u.signal
|
|
79
|
+
}), t = await e.json().catch(() => null);
|
|
80
|
+
if (a.auth.seen(e, t?.code) && c) continue;
|
|
81
|
+
if (e.ok && t?.access_token) return { tokens: t };
|
|
82
|
+
let d = Number(e.headers.get("Retry-After") ?? -1);
|
|
83
|
+
return {
|
|
84
|
+
error: new r(e.status, t?.code ?? `http_${e.status}`, t?.detail ?? t?.title ?? "Something went wrong. Please try again."),
|
|
85
|
+
retryAfter: Number.isFinite(d) && d >= 0 ? d : -1
|
|
86
|
+
};
|
|
87
|
+
} catch {
|
|
88
|
+
return {
|
|
89
|
+
error: new r(0, "network_error", "Couldn't reach CommentKit. Check your connection and try again."),
|
|
90
|
+
retryAfter: 0
|
|
91
|
+
};
|
|
92
|
+
} finally {
|
|
93
|
+
u.done();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
var h = (e) => new Promise((t) => setTimeout(t, e));
|
|
98
|
+
function g(e) {
|
|
99
|
+
try {
|
|
100
|
+
let t = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), n = JSON.parse(new TextDecoder().decode(Uint8Array.from(atob(t), (e) => e.charCodeAt(0))));
|
|
101
|
+
return typeof n.email == "string" ? n.email.toLowerCase() : null;
|
|
102
|
+
} catch {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
export { d as identify };
|