reactjs-tiptap-editor 0.3.30 → 0.3.31
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/lib/{ActionMenuButton-wiDnIxE2.cjs → ActionMenuButton-BCgqJsST.cjs} +1 -1
- package/lib/{ActionMenuButton-B6fitGKu.js → ActionMenuButton-D97K0UWT.js} +5 -5
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.d.cts +15 -15
- package/lib/Attachment.d.ts +15 -15
- package/lib/Attachment.js +1 -1
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.d.cts +15 -15
- package/lib/Blockquote.d.ts +15 -15
- package/lib/Blockquote.js +1 -1
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.d.cts +15 -15
- package/lib/Bold.d.ts +15 -15
- package/lib/Bold.js +1 -1
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.d.cts +15 -15
- package/lib/BulletList.d.ts +15 -15
- package/lib/BulletList.js +1 -1
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.d.cts +15 -15
- package/lib/Clear.d.ts +15 -15
- package/lib/Clear.js +1 -1
- package/lib/Code.cjs +1 -1
- package/lib/Code.d.cts +15 -15
- package/lib/Code.d.ts +15 -15
- package/lib/Code.js +1 -1
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.d.cts +15 -15
- package/lib/CodeBlock.d.ts +15 -15
- package/lib/CodeBlock.js +3 -2
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.d.cts +15 -15
- package/lib/CodeView.d.ts +15 -15
- package/lib/CodeView.js +1 -1
- package/lib/Color.cjs +1 -1
- package/lib/Color.d.cts +15 -15
- package/lib/Color.d.ts +15 -15
- package/lib/Color.js +2 -2
- package/lib/Document.d.cts +15 -15
- package/lib/Document.d.ts +15 -15
- package/lib/Drawer-5Q_-WRhc.cjs +1 -0
- package/lib/{Drawer-BKTU9CpU.js → Drawer-BHkje8ys.js} +250 -249
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.d.cts +15 -15
- package/lib/Drawer.d.ts +15 -15
- package/lib/Drawer.js +2 -2
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.d.cts +15 -15
- package/lib/Emoji.d.ts +15 -15
- package/lib/Emoji.js +22 -21
- package/lib/Excalidraw-CG498239.js +290 -0
- package/lib/Excalidraw-GUVW-IqC.cjs +1 -0
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.d.cts +15 -15
- package/lib/Excalidraw.d.ts +15 -15
- package/lib/Excalidraw.js +1 -1
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.d.cts +15 -15
- package/lib/ExportPdf.d.ts +15 -15
- package/lib/ExportPdf.js +1 -1
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.d.cts +15 -15
- package/lib/ExportWord.d.ts +15 -15
- package/lib/ExportWord.js +1 -1
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.d.cts +15 -15
- package/lib/FontFamily.d.ts +15 -15
- package/lib/FontFamily.js +11 -10
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.d.cts +15 -15
- package/lib/FontSize.d.ts +15 -15
- package/lib/FontSize.js +6 -5
- package/lib/FormatPainter.cjs +1 -1
- package/lib/FormatPainter.d.cts +15 -15
- package/lib/FormatPainter.d.ts +15 -15
- package/lib/FormatPainter.js +1 -1
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.d.cts +15 -15
- package/lib/Heading.d.ts +15 -15
- package/lib/Heading.js +32 -31
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.d.cts +15 -15
- package/lib/Highlight.d.ts +15 -15
- package/lib/Highlight.js +1 -1
- package/lib/History.cjs +1 -1
- package/lib/History.d.cts +15 -15
- package/lib/History.d.ts +15 -15
- package/lib/History.js +1 -1
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.d.cts +15 -15
- package/lib/HorizontalRule.d.ts +15 -15
- package/lib/HorizontalRule.js +1 -1
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.d.cts +15 -15
- package/lib/Iframe.d.ts +15 -15
- package/lib/Iframe.js +1 -1
- package/lib/Image.cjs +1 -1
- package/lib/Image.d.cts +15 -15
- package/lib/Image.d.ts +15 -15
- package/lib/Image.js +1 -1
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.d.cts +15 -15
- package/lib/ImageGif.d.ts +15 -15
- package/lib/ImageGif.js +1 -1
- package/lib/ImportWord.cjs +2 -2
- package/lib/ImportWord.d.cts +15 -15
- package/lib/ImportWord.d.ts +15 -15
- package/lib/ImportWord.js +3 -2
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.d.cts +15 -15
- package/lib/Indent.d.ts +15 -15
- package/lib/Indent.js +1 -1
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.d.cts +15 -15
- package/lib/Italic.d.ts +15 -15
- package/lib/Italic.js +1 -1
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.d.cts +15 -15
- package/lib/Katex.d.ts +15 -15
- package/lib/Katex.js +41 -40
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.d.cts +15 -15
- package/lib/LineHeight.d.ts +15 -15
- package/lib/LineHeight.js +17 -16
- package/lib/Link.cjs +1 -1
- package/lib/Link.d.cts +15 -15
- package/lib/Link.d.ts +15 -15
- package/lib/Link.js +1 -1
- package/lib/ListItem.d.cts +15 -15
- package/lib/ListItem.d.ts +15 -15
- package/lib/Mention.d.cts +15 -15
- package/lib/Mention.d.ts +15 -15
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.d.cts +15 -15
- package/lib/Mermaid.d.ts +15 -15
- package/lib/Mermaid.js +138 -137
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.d.cts +15 -15
- package/lib/MoreMark.d.ts +15 -15
- package/lib/MoreMark.js +1 -1
- package/lib/MultiColumn.cjs +1 -1
- package/lib/MultiColumn.d.cts +15 -15
- package/lib/MultiColumn.d.ts +15 -15
- package/lib/MultiColumn.js +1 -1
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.d.cts +15 -15
- package/lib/OrderedList.d.ts +15 -15
- package/lib/OrderedList.js +1 -1
- package/lib/{RichTextEditor-C8Sm1E6J.cjs → RichTextEditor-DWlLqTl9.cjs} +4 -4
- package/lib/{RichTextEditor-BQN2eLD_.js → RichTextEditor-KP2Rgcqe.js} +15 -39
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.d.cts +15 -15
- package/lib/SearchAndReplace.d.ts +15 -15
- package/lib/SearchAndReplace.js +68 -67
- package/lib/Selection.d.cts +15 -15
- package/lib/Selection.d.ts +15 -15
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.d.cts +15 -15
- package/lib/SlashCommand.d.ts +15 -15
- package/lib/SlashCommand.js +1 -1
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.d.cts +15 -15
- package/lib/Strike.d.ts +15 -15
- package/lib/Strike.js +1 -1
- package/lib/SubAndSuperScript.cjs +1 -1
- package/lib/SubAndSuperScript.d.cts +15 -15
- package/lib/SubAndSuperScript.d.ts +15 -15
- package/lib/SubAndSuperScript.js +1 -1
- package/lib/Table.cjs +1 -1
- package/lib/Table.d.cts +15 -15
- package/lib/Table.d.ts +15 -15
- package/lib/Table.js +2 -1
- package/lib/TableOfContent.cjs +1 -1
- package/lib/TableOfContent.d.cts +15 -15
- package/lib/TableOfContent.d.ts +15 -15
- package/lib/TableOfContent.js +50 -49
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.d.cts +15 -15
- package/lib/TaskList.d.ts +15 -15
- package/lib/TaskList.js +1 -1
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.d.cts +15 -15
- package/lib/TextAlign.d.ts +15 -15
- package/lib/TextAlign.js +8 -7
- package/lib/TextBubble.cjs +1 -1
- package/lib/TextBubble.d.cts +15 -15
- package/lib/TextBubble.d.ts +15 -15
- package/lib/TextBubble.js +1 -1
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.d.cts +15 -15
- package/lib/TextDirection.d.ts +15 -15
- package/lib/TextDirection.js +14 -13
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.d.cts +15 -15
- package/lib/TextUnderline.d.ts +15 -15
- package/lib/TextUnderline.js +1 -1
- package/lib/TrailingNode.d.cts +15 -15
- package/lib/TrailingNode.d.ts +15 -15
- package/lib/{Twitter-Dg6WWauX.js → Twitter-99ivY5qv.js} +62 -61
- package/lib/{Twitter-CL2pu4QM.cjs → Twitter-BvfvUtNT.cjs} +2 -2
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.d.cts +15 -15
- package/lib/Twitter.d.ts +15 -15
- package/lib/Twitter.js +1 -1
- package/lib/Video.cjs +1 -1
- package/lib/Video.d.cts +15 -15
- package/lib/Video.d.ts +15 -15
- package/lib/Video.js +1 -1
- package/lib/bubble-extra.cjs +1 -1
- package/lib/bubble-extra.d.cts +15 -15
- package/lib/bubble-extra.d.ts +15 -15
- package/lib/bubble-extra.js +5 -5
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +16 -15
- package/lib/index.d.ts +16 -15
- package/lib/index.js +2 -2
- package/lib/locale-bundle.d.cts +15 -15
- package/lib/locale-bundle.d.ts +15 -15
- package/lib/{textarea-BglwYF6b.js → textarea-CktfkXNe.js} +1 -1
- package/lib/{textarea-D5WVZMgt.cjs → textarea-DdH64g04.cjs} +1 -1
- package/package.json +1 -1
- package/lib/Drawer-CmoEF-Zg.cjs +0 -1
- package/lib/Excalidraw-CM74U5tG.js +0 -289
- package/lib/Excalidraw-DAPP9qgY.cjs +0 -1
|
@@ -2,7 +2,7 @@ import { N as $t, m as Vt, H as Mt } from "./index-DI9T3iLd.js";
|
|
|
2
2
|
import { c as H, N as jt, R as Bt } from "./dom-dataset-Di3tIRrR.js";
|
|
3
3
|
import { jsx as r, jsxs as g, Fragment as Wt } from "react/jsx-runtime";
|
|
4
4
|
import de, { useState as ce, Fragment as Ft, useEffect as Pe, useMemo as gt, createContext as Pt, useLayoutEffect as Ut, useContext as Ht, useRef as X, useCallback as Te, useDebugValue as zt } from "react";
|
|
5
|
-
import { L as Gt, o as Kt, B as Xt, P as Qt, m as Jt, A as Yt, k as Zt, n as en } from "./RichTextEditor-
|
|
5
|
+
import { L as Gt, o as Kt, B as Xt, P as Qt, m as Jt, A as Yt, k as Zt, n as en } from "./RichTextEditor-KP2Rgcqe.js";
|
|
6
6
|
import { u as tn } from "./index-CsK90iVd.js";
|
|
7
7
|
const nn = "_verified_lvyh0_1", Ue = {
|
|
8
8
|
verified: nn
|
|
@@ -135,10 +135,10 @@ const nn = "_verified_lvyh0_1", Ue = {
|
|
|
135
135
|
separator: Tn,
|
|
136
136
|
brand: xn,
|
|
137
137
|
twitterIcon: bn
|
|
138
|
-
}, En = "_verifiedOld_lcna5_1",
|
|
138
|
+
}, En = "_verifiedOld_lcna5_1", On = "_verifiedBlue_lcna5_4", Nn = "_verifiedGovernment_lcna5_7", xe = {
|
|
139
139
|
verifiedOld: En,
|
|
140
|
-
verifiedBlue:
|
|
141
|
-
verifiedGovernment:
|
|
140
|
+
verifiedBlue: On,
|
|
141
|
+
verifiedGovernment: Nn
|
|
142
142
|
}, yt = ({ user: e, className: t }) => {
|
|
143
143
|
const n = e.verified || e.is_blue_verified || e.verified_type;
|
|
144
144
|
let o = /* @__PURE__ */ r(rn, {}), i = xe.verifiedBlue;
|
|
@@ -155,7 +155,7 @@ const nn = "_verified_lvyh0_1", Ue = {
|
|
|
155
155
|
className: H(t, i),
|
|
156
156
|
children: o
|
|
157
157
|
}) : null;
|
|
158
|
-
},
|
|
158
|
+
}, Rn = ({ tweet: e, components: t }) => {
|
|
159
159
|
var n;
|
|
160
160
|
const o = (n = t == null ? void 0 : t.AvatarImg) != null ? n : wt, { user: i } = e;
|
|
161
161
|
return /* @__PURE__ */ g("div", {
|
|
@@ -603,14 +603,14 @@ const Gn = (e) => ({
|
|
|
603
603
|
})
|
|
604
604
|
})
|
|
605
605
|
]
|
|
606
|
-
}), Tr = "_actions_n2anf_1", xr = "_like_n2anf_13", br = "_reply_n2anf_14", Er = "_copy_n2anf_15",
|
|
606
|
+
}), Tr = "_actions_n2anf_1", xr = "_like_n2anf_13", br = "_reply_n2anf_14", Er = "_copy_n2anf_15", Or = "_likeIconWrapper_n2anf_27", Nr = "_likeCount_n2anf_30", Rr = "_replyIconWrapper_n2anf_35", Lr = "_copyIconWrapper_n2anf_36", Ir = "_likeIcon_n2anf_27", kr = "_replyIcon_n2anf_35", Cr = "_copyIcon_n2anf_36", Dr = "_replyText_n2anf_56", qr = "_copyText_n2anf_57", I = {
|
|
607
607
|
actions: Tr,
|
|
608
608
|
like: xr,
|
|
609
609
|
reply: br,
|
|
610
610
|
copy: Er,
|
|
611
|
-
likeIconWrapper:
|
|
612
|
-
likeCount:
|
|
613
|
-
replyIconWrapper:
|
|
611
|
+
likeIconWrapper: Or,
|
|
612
|
+
likeCount: Nr,
|
|
613
|
+
replyIconWrapper: Rr,
|
|
614
614
|
copyIconWrapper: Lr,
|
|
615
615
|
likeIcon: Ir,
|
|
616
616
|
replyIcon: kr,
|
|
@@ -843,7 +843,7 @@ const Gn = (e) => ({
|
|
|
843
843
|
]);
|
|
844
844
|
return /* @__PURE__ */ g(He, {
|
|
845
845
|
children: [
|
|
846
|
-
/* @__PURE__ */ r(
|
|
846
|
+
/* @__PURE__ */ r(Rn, {
|
|
847
847
|
tweet: o,
|
|
848
848
|
components: t
|
|
849
849
|
}),
|
|
@@ -927,7 +927,7 @@ const Gn = (e) => ({
|
|
|
927
927
|
})
|
|
928
928
|
]
|
|
929
929
|
});
|
|
930
|
-
var pe = { exports: {} },
|
|
930
|
+
var pe = { exports: {} }, Oe = {};
|
|
931
931
|
/**
|
|
932
932
|
* @license React
|
|
933
933
|
* use-sync-external-store-shim.production.js
|
|
@@ -939,7 +939,7 @@ var pe = { exports: {} }, Ne = {};
|
|
|
939
939
|
*/
|
|
940
940
|
var ct;
|
|
941
941
|
function uo() {
|
|
942
|
-
if (ct) return
|
|
942
|
+
if (ct) return Oe;
|
|
943
943
|
ct = 1;
|
|
944
944
|
var e = de;
|
|
945
945
|
function t(d, h) {
|
|
@@ -976,9 +976,9 @@ function uo() {
|
|
|
976
976
|
return h();
|
|
977
977
|
}
|
|
978
978
|
var S = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? _ : u;
|
|
979
|
-
return
|
|
979
|
+
return Oe.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : S, Oe;
|
|
980
980
|
}
|
|
981
|
-
var
|
|
981
|
+
var Ne = {};
|
|
982
982
|
/**
|
|
983
983
|
* @license React
|
|
984
984
|
* use-sync-external-store-shim.development.js
|
|
@@ -1038,15 +1038,15 @@ function fo() {
|
|
|
1038
1038
|
}
|
|
1039
1039
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
1040
1040
|
var i = de, a = typeof Object.is == "function" ? Object.is : e, s = i.useState, u = i.useEffect, p = i.useLayoutEffect, _ = i.useDebugValue, S = !1, d = !1, h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? o : t;
|
|
1041
|
-
|
|
1042
|
-
}()),
|
|
1041
|
+
Ne.useSyncExternalStore = i.useSyncExternalStore !== void 0 ? i.useSyncExternalStore : h, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
1042
|
+
}()), Ne;
|
|
1043
1043
|
}
|
|
1044
1044
|
var dt;
|
|
1045
1045
|
function _o() {
|
|
1046
1046
|
return dt || (dt = 1, process.env.NODE_ENV === "production" ? pe.exports = uo() : pe.exports = fo()), pe.exports;
|
|
1047
1047
|
}
|
|
1048
1048
|
var ho = _o();
|
|
1049
|
-
const bt = 0, Et = 1,
|
|
1049
|
+
const bt = 0, Et = 1, Ot = 2, ut = 3;
|
|
1050
1050
|
var ft = Object.prototype.hasOwnProperty;
|
|
1051
1051
|
function Ae(e, t) {
|
|
1052
1052
|
var n, o;
|
|
@@ -1075,22 +1075,22 @@ const W = /* @__PURE__ */ new WeakMap(), U = () => {
|
|
|
1075
1075
|
), $e = Object, m = (e) => e === L, M = (e) => typeof e == "function", z = (e, t) => ({
|
|
1076
1076
|
...e,
|
|
1077
1077
|
...t
|
|
1078
|
-
}),
|
|
1078
|
+
}), Nt = (e) => M(e.then), Re = {}, ve = {}, ze = "undefined", ue = typeof window != ze, Ve = typeof document != ze, mo = ue && "Deno" in window, po = () => ue && typeof window.requestAnimationFrame != ze, Rt = (e, t) => {
|
|
1079
1079
|
const n = W.get(e);
|
|
1080
1080
|
return [
|
|
1081
1081
|
// Getter
|
|
1082
|
-
() => !m(t) && e.get(t) ||
|
|
1082
|
+
() => !m(t) && e.get(t) || Re,
|
|
1083
1083
|
// Setter
|
|
1084
1084
|
(o) => {
|
|
1085
1085
|
if (!m(t)) {
|
|
1086
1086
|
const i = e.get(t);
|
|
1087
|
-
t in ve || (ve[t] = i), n[5](t, z(i, o), i ||
|
|
1087
|
+
t in ve || (ve[t] = i), n[5](t, z(i, o), i || Re);
|
|
1088
1088
|
}
|
|
1089
1089
|
},
|
|
1090
1090
|
// Subscriber
|
|
1091
1091
|
n[6],
|
|
1092
1092
|
// Get server cache snapshot
|
|
1093
|
-
() => !m(t) && t in ve ? ve[t] : !m(t) && e.get(t) ||
|
|
1093
|
+
() => !m(t) && t in ve ? ve[t] : !m(t) && e.get(t) || Re
|
|
1094
1094
|
];
|
|
1095
1095
|
};
|
|
1096
1096
|
let Me = !0;
|
|
@@ -1182,13 +1182,13 @@ async function Lt(...e) {
|
|
|
1182
1182
|
async function d(h) {
|
|
1183
1183
|
const [l] = Ge(h);
|
|
1184
1184
|
if (!l) return;
|
|
1185
|
-
const [v, f] =
|
|
1185
|
+
const [v, f] = Rt(t, l), [k, c, F, ie] = W.get(t), P = () => {
|
|
1186
1186
|
const A = k[l];
|
|
1187
|
-
return (M(a.revalidate) ? a.revalidate(v().data, h) : a.revalidate !== !1) && (delete F[l], delete ie[l], A && A[0]) ? A[0](
|
|
1187
|
+
return (M(a.revalidate) ? a.revalidate(v().data, h) : a.revalidate !== !1) && (delete F[l], delete ie[l], A && A[0]) ? A[0](Ot).then(() => v().data) : v().data;
|
|
1188
1188
|
};
|
|
1189
1189
|
if (e.length < 3)
|
|
1190
1190
|
return P();
|
|
1191
|
-
let
|
|
1191
|
+
let O = o, C;
|
|
1192
1192
|
const J = Fe();
|
|
1193
1193
|
c[l] = [
|
|
1194
1194
|
J,
|
|
@@ -1198,25 +1198,25 @@ async function Lt(...e) {
|
|
|
1198
1198
|
if (x && (p = M(p) ? p(G, $) : p, f({
|
|
1199
1199
|
data: p,
|
|
1200
1200
|
_c: G
|
|
1201
|
-
})), M(
|
|
1201
|
+
})), M(O))
|
|
1202
1202
|
try {
|
|
1203
|
-
|
|
1203
|
+
O = O(G);
|
|
1204
1204
|
} catch (A) {
|
|
1205
1205
|
C = A;
|
|
1206
1206
|
}
|
|
1207
|
-
if (
|
|
1208
|
-
if (
|
|
1207
|
+
if (O && Nt(O))
|
|
1208
|
+
if (O = await O.catch((A) => {
|
|
1209
1209
|
C = A;
|
|
1210
1210
|
}), J !== c[l][0]) {
|
|
1211
1211
|
if (C) throw C;
|
|
1212
|
-
return
|
|
1212
|
+
return O;
|
|
1213
1213
|
} else C && x && _(C) && (s = !0, f({
|
|
1214
1214
|
data: G,
|
|
1215
1215
|
_c: L
|
|
1216
1216
|
}));
|
|
1217
1217
|
if (s && !C)
|
|
1218
1218
|
if (M(s)) {
|
|
1219
|
-
const A = s(
|
|
1219
|
+
const A = s(O, G);
|
|
1220
1220
|
f({
|
|
1221
1221
|
data: A,
|
|
1222
1222
|
error: L,
|
|
@@ -1224,7 +1224,7 @@ async function Lt(...e) {
|
|
|
1224
1224
|
});
|
|
1225
1225
|
} else
|
|
1226
1226
|
f({
|
|
1227
|
-
data:
|
|
1227
|
+
data: O,
|
|
1228
1228
|
error: L,
|
|
1229
1229
|
_c: L
|
|
1230
1230
|
});
|
|
@@ -1236,13 +1236,13 @@ async function Lt(...e) {
|
|
|
1236
1236
|
if (S) throw C;
|
|
1237
1237
|
return;
|
|
1238
1238
|
}
|
|
1239
|
-
return
|
|
1239
|
+
return O;
|
|
1240
1240
|
}
|
|
1241
1241
|
}
|
|
1242
1242
|
const mt = (e, t) => {
|
|
1243
1243
|
for (const n in e)
|
|
1244
1244
|
e[n][0] && e[n][0](t);
|
|
1245
|
-
},
|
|
1245
|
+
}, Oo = (e, t) => {
|
|
1246
1246
|
if (!W.has(e)) {
|
|
1247
1247
|
const n = z(To, t), o = {}, i = Lt.bind(L, e);
|
|
1248
1248
|
let a = U;
|
|
@@ -1282,16 +1282,16 @@ const mt = (e, t) => {
|
|
|
1282
1282
|
e,
|
|
1283
1283
|
W.get(e)[4]
|
|
1284
1284
|
];
|
|
1285
|
-
},
|
|
1285
|
+
}, No = (e, t, n, o, i) => {
|
|
1286
1286
|
const a = n.errorRetryCount, s = i.retryCount, u = ~~((Math.random() + 0.5) * (1 << (s < 8 ? s : 8))) * n.errorRetryInterval;
|
|
1287
1287
|
!m(a) && s > a || setTimeout(o, u, i);
|
|
1288
|
-
},
|
|
1288
|
+
}, Ro = Ae, [It, Lo] = Oo(/* @__PURE__ */ new Map()), Io = z(
|
|
1289
1289
|
{
|
|
1290
1290
|
// events
|
|
1291
1291
|
onLoadingSlow: U,
|
|
1292
1292
|
onSuccess: U,
|
|
1293
1293
|
onError: U,
|
|
1294
|
-
onErrorRetry:
|
|
1294
|
+
onErrorRetry: No,
|
|
1295
1295
|
onDiscarded: U,
|
|
1296
1296
|
// switches
|
|
1297
1297
|
revalidateOnFocus: !0,
|
|
@@ -1304,7 +1304,7 @@ const mt = (e, t) => {
|
|
|
1304
1304
|
dedupingInterval: 2 * 1e3,
|
|
1305
1305
|
loadingTimeout: ht ? 5e3 : 3e3,
|
|
1306
1306
|
// providers
|
|
1307
|
-
compare:
|
|
1307
|
+
compare: Ro,
|
|
1308
1308
|
isPaused: () => !1,
|
|
1309
1309
|
cache: It,
|
|
1310
1310
|
mutate: Lo,
|
|
@@ -1372,9 +1372,9 @@ const Ce = de.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1372
1372
|
}), De = {
|
|
1373
1373
|
dedupe: !0
|
|
1374
1374
|
}, Fo = (e, t, n) => {
|
|
1375
|
-
const { cache: o, compare: i, suspense: a, fallbackData: s, revalidateOnMount: u, revalidateIfStale: p, refreshInterval: _, refreshWhenHidden: S, refreshWhenOffline: d, keepPreviousData: h } = n, [l, v, f, k] = W.get(o), [c, F] = Ge(e), ie = X(!1), P = X(!1),
|
|
1376
|
-
for (const
|
|
1377
|
-
const T =
|
|
1375
|
+
const { cache: o, compare: i, suspense: a, fallbackData: s, revalidateOnMount: u, revalidateIfStale: p, refreshInterval: _, refreshWhenHidden: S, refreshWhenOffline: d, keepPreviousData: h } = n, [l, v, f, k] = W.get(o), [c, F] = Ge(e), ie = X(!1), P = X(!1), O = X(c), C = X(t), J = X(n), x = () => J.current, Y = () => x().isVisible() && x().isOnline(), [$, Z, G, A] = Rt(o, c), ee = X({}).current, fe = m(s) ? m(n.fallback) ? L : n.fallback[c] : s, Ke = (w, y) => {
|
|
1376
|
+
for (const N in ee) {
|
|
1377
|
+
const T = N;
|
|
1378
1378
|
if (T === "data") {
|
|
1379
1379
|
if (!i(w[T], y[T]) && (!m(w[T]) || !i(he, y[T])))
|
|
1380
1380
|
return !1;
|
|
@@ -1383,19 +1383,19 @@ const Ce = de.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1383
1383
|
}
|
|
1384
1384
|
return !0;
|
|
1385
1385
|
}, Xe = gt(() => {
|
|
1386
|
-
const w = !c || !t ? !1 : m(u) ? x().isPaused() || a ? !1 : p !== !1 : u, y = (
|
|
1387
|
-
const j = z(
|
|
1386
|
+
const w = !c || !t ? !1 : m(u) ? x().isPaused() || a ? !1 : p !== !1 : u, y = (R) => {
|
|
1387
|
+
const j = z(R);
|
|
1388
1388
|
return delete j._k, w ? {
|
|
1389
1389
|
isValidating: !0,
|
|
1390
1390
|
isLoading: !0,
|
|
1391
1391
|
...j
|
|
1392
1392
|
} : j;
|
|
1393
|
-
},
|
|
1393
|
+
}, N = $(), T = A(), V = y(N), re = N === T ? V : y(T);
|
|
1394
1394
|
let b = V;
|
|
1395
1395
|
return [
|
|
1396
1396
|
() => {
|
|
1397
|
-
const
|
|
1398
|
-
return Ke(
|
|
1397
|
+
const R = y($());
|
|
1398
|
+
return Ke(R, b) ? (b.data = R.data, b.isLoading = R.isLoading, b.isValidating = R.isValidating, b.error = R.error, b) : (b = R, R);
|
|
1399
1399
|
},
|
|
1400
1400
|
() => re
|
|
1401
1401
|
];
|
|
@@ -1403,21 +1403,21 @@ const Ce = de.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1403
1403
|
o,
|
|
1404
1404
|
c
|
|
1405
1405
|
]), te = ho.useSyncExternalStore(Te(
|
|
1406
|
-
(w) => G(c, (y,
|
|
1407
|
-
Ke(
|
|
1406
|
+
(w) => G(c, (y, N) => {
|
|
1407
|
+
Ke(N, y) || w();
|
|
1408
1408
|
}),
|
|
1409
1409
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1410
1410
|
[
|
|
1411
1411
|
o,
|
|
1412
1412
|
c
|
|
1413
1413
|
]
|
|
1414
|
-
), Xe[0], Xe[1]), Qe = !ie.current, Ct = l[c] && l[c].length > 0, ne = te.data, K = m(ne) ? fe &&
|
|
1414
|
+
), Xe[0], Xe[1]), Qe = !ie.current, Ct = l[c] && l[c].length > 0, ne = te.data, K = m(ne) ? fe && Nt(fe) ? Ce(fe) : fe : ne, _e = te.error, we = X(K), he = h ? m(ne) ? m(we.current) ? K : we.current : ne : K, Je = Ct && !m(_e) ? !1 : Qe && !m(u) ? u : x().isPaused() ? !1 : a ? m(K) ? !1 : p : m(K) || p, Ye = !!(c && t && Qe && Je), Dt = m(te.isValidating) ? Ye : te.isValidating, qt = m(te.isLoading) ? Ye : te.isLoading, ae = Te(
|
|
1415
1415
|
async (w) => {
|
|
1416
1416
|
const y = C.current;
|
|
1417
1417
|
if (!c || !y || P.current || x().isPaused())
|
|
1418
1418
|
return !1;
|
|
1419
|
-
let
|
|
1420
|
-
const re = w || {}, b = !f[c] || !re.dedupe,
|
|
1419
|
+
let N, T, V = !0;
|
|
1420
|
+
const re = w || {}, b = !f[c] || !re.dedupe, R = () => _t ? !P.current && c === O.current && ie.current : c === O.current, j = {
|
|
1421
1421
|
isValidating: !1,
|
|
1422
1422
|
isLoading: !1
|
|
1423
1423
|
}, et = () => {
|
|
@@ -1431,25 +1431,25 @@ const Ce = de.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1431
1431
|
m($().data) && (nt.isLoading = !0);
|
|
1432
1432
|
try {
|
|
1433
1433
|
if (b && (Z(nt), n.loadingTimeout && m($().data) && setTimeout(() => {
|
|
1434
|
-
V &&
|
|
1434
|
+
V && R() && x().onLoadingSlow(c, n);
|
|
1435
1435
|
}, n.loadingTimeout), f[c] = [
|
|
1436
1436
|
y(F),
|
|
1437
1437
|
Fe()
|
|
1438
|
-
]), [
|
|
1439
|
-
return b &&
|
|
1438
|
+
]), [N, T] = f[c], N = await N, b && setTimeout(tt, n.dedupingInterval), !f[c] || f[c][1] !== T)
|
|
1439
|
+
return b && R() && x().onDiscarded(c), !1;
|
|
1440
1440
|
j.error = L;
|
|
1441
1441
|
const q = v[c];
|
|
1442
1442
|
if (!m(q) && // case 1
|
|
1443
1443
|
(T <= q[0] || // case 2
|
|
1444
1444
|
T <= q[1] || // case 3
|
|
1445
1445
|
q[1] === 0))
|
|
1446
|
-
return et(), b &&
|
|
1446
|
+
return et(), b && R() && x().onDiscarded(c), !1;
|
|
1447
1447
|
const B = $().data;
|
|
1448
|
-
j.data = i(B,
|
|
1448
|
+
j.data = i(B, N) ? B : N, b && R() && x().onSuccess(N, c, n);
|
|
1449
1449
|
} catch (q) {
|
|
1450
1450
|
tt();
|
|
1451
1451
|
const B = x(), { shouldRetryOnError: ye } = B;
|
|
1452
|
-
B.isPaused() || (j.error = q, b &&
|
|
1452
|
+
B.isPaused() || (j.error = q, b && R() && (B.onError(q, c, B), (ye === !0 || M(ye) && ye(q)) && (!x().revalidateOnFocus || !x().revalidateOnReconnect || Y()) && B.onErrorRetry(q, c, B, (At) => {
|
|
1453
1453
|
const Se = l[c];
|
|
1454
1454
|
Se && Se[0] && Se[0](ut, At);
|
|
1455
1455
|
}, {
|
|
@@ -1476,7 +1476,7 @@ const Ce = de.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1476
1476
|
]
|
|
1477
1477
|
), Ze = Te(
|
|
1478
1478
|
// Use callback to make sure `keyRef.current` returns latest result every time
|
|
1479
|
-
(...w) => Lt(o,
|
|
1479
|
+
(...w) => Lt(o, O.current, ...w),
|
|
1480
1480
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1481
1481
|
[]
|
|
1482
1482
|
);
|
|
@@ -1493,13 +1493,13 @@ const Ce = de.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1493
1493
|
} else if (V == Et)
|
|
1494
1494
|
x().revalidateOnReconnect && Y() && w();
|
|
1495
1495
|
else {
|
|
1496
|
-
if (V ==
|
|
1496
|
+
if (V == Ot)
|
|
1497
1497
|
return ae();
|
|
1498
1498
|
if (V == ut)
|
|
1499
1499
|
return ae(re);
|
|
1500
1500
|
}
|
|
1501
1501
|
});
|
|
1502
|
-
return P.current = !1,
|
|
1502
|
+
return P.current = !1, O.current = c, ie.current = !0, Z({
|
|
1503
1503
|
_k: F
|
|
1504
1504
|
}), Je && (m(K) || le ? w() : xo(w)), () => {
|
|
1505
1505
|
P.current = !0, T();
|
|
@@ -1510,9 +1510,9 @@ const Ce = de.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1510
1510
|
let w;
|
|
1511
1511
|
function y() {
|
|
1512
1512
|
const T = M(_) ? _($().data) : _;
|
|
1513
|
-
T && w !== -1 && (w = setTimeout(
|
|
1513
|
+
T && w !== -1 && (w = setTimeout(N, T));
|
|
1514
1514
|
}
|
|
1515
|
-
function
|
|
1515
|
+
function N() {
|
|
1516
1516
|
!$().error && (S || x().isVisible()) && (d || x().isOnline()) ? ae(De).then(y) : y();
|
|
1517
1517
|
}
|
|
1518
1518
|
return y(), () => {
|
|
@@ -1655,6 +1655,7 @@ function Jo(e) {
|
|
|
1655
1655
|
Yt,
|
|
1656
1656
|
{
|
|
1657
1657
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
1658
|
+
tooltipOptions: e == null ? void 0 : e.tooltipOptions,
|
|
1658
1659
|
isActive: e == null ? void 0 : e.isActive,
|
|
1659
1660
|
disabled: e == null ? void 0 : e.disabled,
|
|
1660
1661
|
children: /* @__PURE__ */ r(Zt, { name: e == null ? void 0 : e.icon })
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const je=require("./index-ByRfqzMr.cjs"),M=require("./dom-dataset-Byuf1YmW.cjs"),n=require("react/jsx-runtime"),x=require("react"),H=require("./RichTextEditor-C8Sm1E6J.cjs"),qt=require("./index-D_A0TBRA.cjs"),Dt="_verified_lvyh0_1",We={verified:Dt},$t=()=>n.jsx("svg",{viewBox:"0 0 24 24","aria-label":"Verified account",role:"img",className:We.verified,children:n.jsx("g",{children:n.jsx("path",{d:"M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.33 2.19c-1.4-.46-2.91-.2-3.92.81s-1.26 2.52-.8 3.91c-1.31.67-2.2 1.91-2.2 3.34s.89 2.67 2.2 3.34c-.46 1.39-.21 2.9.8 3.91s2.52 1.26 3.91.81c.67 1.31 1.91 2.19 3.34 2.19s2.68-.88 3.34-2.19c1.39.45 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z"})})}),At=()=>n.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:We.verified,children:n.jsxs("g",{children:[n.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-a",x1:"4.411",x2:"18.083",y1:"2.495",y2:"21.508",children:[n.jsx("stop",{offset:"0",stopColor:"#f4e72a"}),n.jsx("stop",{offset:".539",stopColor:"#cd8105"}),n.jsx("stop",{offset:".68",stopColor:"#cb7b00"}),n.jsx("stop",{offset:"1",stopColor:"#f4ec26"}),n.jsx("stop",{offset:"1",stopColor:"#f4e72a"})]}),n.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-b",x1:"5.355",x2:"16.361",y1:"3.395",y2:"19.133",children:[n.jsx("stop",{offset:"0",stopColor:"#f9e87f"}),n.jsx("stop",{offset:".406",stopColor:"#e2b719"}),n.jsx("stop",{offset:".989",stopColor:"#e2b719"})]}),n.jsxs("g",{clipRule:"evenodd",fillRule:"evenodd",children:[n.jsx("path",{d:"M13.324 3.848L11 1.6 8.676 3.848l-3.201-.453-.559 3.184L2.06 8.095 3.48 11l-1.42 2.904 2.856 1.516.559 3.184 3.201-.452L11 20.4l2.324-2.248 3.201.452.559-3.184 2.856-1.516L18.52 11l1.42-2.905-2.856-1.516-.559-3.184zm-7.09 7.575l3.428 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-a)"}),n.jsx("path",{d:"M13.101 4.533L11 2.5 8.899 4.533l-2.895-.41-.505 2.88-2.583 1.37L4.2 11l-1.284 2.627 2.583 1.37.505 2.88 2.895-.41L11 19.5l2.101-2.033 2.895.41.505-2.88 2.583-1.37L17.8 11l1.284-2.627-2.583-1.37-.505-2.88zm-6.868 6.89l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-b)"}),n.jsx("path",{d:"M6.233 11.423l3.429 3.428 5.65-6.17.038-.033-.005 1.398-5.683 6.206-3.429-3.429-.003-1.405.005.003z",fill:"#d18800"})]})]})}),Vt=()=>n.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:We.verified,children:n.jsx("g",{children:n.jsx("path",{clipRule:"evenodd",d:"M12.05 2.056c-.568-.608-1.532-.608-2.1 0l-1.393 1.49c-.284.303-.685.47-1.1.455L5.42 3.932c-.832-.028-1.514.654-1.486 1.486l.069 2.039c.014.415-.152.816-.456 1.1l-1.49 1.392c-.608.568-.608 1.533 0 2.101l1.49 1.393c.304.284.47.684.456 1.1l-.07 2.038c-.027.832.655 1.514 1.487 1.486l2.038-.069c.415-.014.816.152 1.1.455l1.392 1.49c.569.609 1.533.609 2.102 0l1.393-1.49c.283-.303.684-.47 1.099-.455l2.038.069c.832.028 1.515-.654 1.486-1.486L18 14.542c-.015-.415.152-.815.455-1.099l1.49-1.393c.608-.568.608-1.533 0-2.101l-1.49-1.393c-.303-.283-.47-.684-.455-1.1l.068-2.038c.029-.832-.654-1.514-1.486-1.486l-2.038.07c-.415.013-.816-.153-1.1-.456zm-5.817 9.367l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fillRule:"evenodd"})})}),Mt="_root_98iqw_1",Bt="_article_98iqw_21",et={root:Mt,article:Bt},Fe=({className:e,children:t})=>n.jsx("div",{className:M.clsx("react-tweet-theme",et.root,e),children:n.jsx("article",{className:et.article,children:t})}),mt=e=>n.jsx("img",{...e}),Wt="_header_nqq4j_1",Ft="_avatar_nqq4j_11",Pt="_avatarOverflow_nqq4j_16",Ut="_avatarSquare_nqq4j_23",Ht="_avatarShadow_nqq4j_26",zt="_author_nqq4j_37",Gt="_authorLink_nqq4j_44",Kt="_authorVerified_nqq4j_53",Xt="_authorLinkText_nqq4j_56",Qt="_authorMeta_nqq4j_63",Jt="_authorFollow_nqq4j_66",Yt="_username_nqq4j_69",Zt="_follow_nqq4j_74",en="_separator_nqq4j_82",tn="_brand_nqq4j_86",nn="_twitterIcon_nqq4j_90",b={header:Wt,avatar:Ft,avatarOverflow:Pt,avatarSquare:Ut,avatarShadow:Ht,author:zt,authorLink:Gt,authorVerified:Kt,authorLinkText:Xt,authorMeta:Qt,authorFollow:Jt,username:Yt,follow:Zt,separator:en,brand:tn,twitterIcon:nn},rn="_verifiedOld_lcna5_1",sn="_verifiedBlue_lcna5_4",on="_verifiedGovernment_lcna5_7",we={verifiedOld:rn,verifiedBlue:sn,verifiedGovernment:on},pt=({user:e,className:t})=>{const r=e.verified||e.is_blue_verified||e.verified_type;let s=n.jsx($t,{}),o=we.verifiedBlue;if(r)switch(e.is_blue_verified||(o=we.verifiedOld),e.verified_type){case"Government":s=n.jsx(Vt,{}),o=we.verifiedGovernment;break;case"Business":s=n.jsx(At,{}),o=null;break}return r?n.jsx("div",{className:M.clsx(t,o),children:s}):null},an=({tweet:e,components:t})=>{var r;const s=(r=t==null?void 0:t.AvatarImg)!=null?r:mt,{user:o}=e;return n.jsxs("div",{className:b.header,children:[n.jsxs("a",{href:e.url,className:b.avatar,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:M.clsx(b.avatarOverflow,o.profile_image_shape==="Square"&&b.avatarSquare),children:n.jsx(s,{src:o.profile_image_url_https,alt:o.name,width:48,height:48})}),n.jsx("div",{className:b.avatarOverflow,children:n.jsx("div",{className:b.avatarShadow})})]}),n.jsxs("div",{className:b.author,children:[n.jsxs("a",{href:e.url,className:b.authorLink,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:b.authorLinkText,children:n.jsx("span",{title:o.name,children:o.name})}),n.jsx(pt,{user:o,className:b.authorVerified})]}),n.jsxs("div",{className:b.authorMeta,children:[n.jsx("a",{href:e.url,className:b.username,target:"_blank",rel:"noopener noreferrer",children:n.jsxs("span",{title:`@${o.screen_name}`,children:["@",o.screen_name]})}),n.jsxs("div",{className:b.authorFollow,children:[n.jsx("span",{className:b.separator,children:"·"}),n.jsx("a",{href:o.follow_url,className:b.follow,target:"_blank",rel:"noopener noreferrer",children:"Follow"})]})]})]}),n.jsx("a",{href:e.url,className:b.brand,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Twitter",children:n.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:b.twitterIcon,children:n.jsx("g",{children:n.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})})})]})},cn="_root_1ec15_1",ln={root:cn},un=({tweet:e})=>n.jsxs("a",{href:e.in_reply_to_url,className:ln.root,target:"_blank",rel:"noopener noreferrer",children:["Replying to @",e.in_reply_to_screen_name]}),dn="_root_eihfa_1",fn={root:dn},_n=({href:e,children:t})=>n.jsx("a",{href:e,className:fn.root,target:"_blank",rel:"noopener noreferrer nofollow",children:t}),hn="_root_1xq52_1",mn={root:hn},pn=({tweet:e})=>n.jsx("p",{className:mn.root,lang:e.lang,dir:"auto",children:e.entities.map((t,r)=>{switch(t.type){case"hashtag":case"mention":case"url":case"symbol":return n.jsx(_n,{href:t.href,children:t.text},r);case"media":return;default:return n.jsx("span",{dangerouslySetInnerHTML:{__html:t.text}},r)}})}),tt=e=>`https://x.com/${e.user.screen_name}/status/${e.id_str}`,xt=e=>`https://x.com/${typeof e=="string"?e:e.user.screen_name}`,xn=e=>`https://x.com/intent/like?tweet_id=${e.id_str}`,vn=e=>`https://x.com/intent/tweet?in_reply_to=${e.id_str}`,gn=e=>`https://x.com/intent/follow?screen_name=${e.user.screen_name}`,jn=e=>`https://x.com/hashtag/${e.text}`,wn=e=>`https://x.com/search?q=%24${e.text}`,yn=e=>`https://x.com/${e.in_reply_to_screen_name}/status/${e.in_reply_to_status_id_str}`,vt=(e,t)=>{const r=new URL(e.media_url_https),s=r.pathname.split(".").pop();return s?(r.pathname=r.pathname.replace(`.${s}`,""),r.searchParams.set("format",s),r.searchParams.set("name",t),r.toString()):e.media_url_https},Sn=e=>{const{variants:t}=e.video_info;return t.filter(s=>s.content_type==="video/mp4").sort((s,o)=>{var i,a;return((i=o.bitrate)!=null?i:0)-((a=s.bitrate)!=null?a:0)})},Tn=e=>{const t=Sn(e);return t.length>1?t[1]:t[0]},Ie=e=>e>999999?`${(e/1e6).toFixed(1)}M`:e>999?`${(e/1e3).toFixed(1)}K`:e.toString();function nt(e){const t=Array.from(e.text),r=[{indices:e.display_text_range,type:"text"}];return ae(r,"hashtag",e.entities.hashtags),ae(r,"mention",e.entities.user_mentions),ae(r,"url",e.entities.urls),ae(r,"symbol",e.entities.symbols),e.entities.media&&ae(r,"media",e.entities.media),bn(e,r),r.map(s=>{const o=t.slice(s.indices[0],s.indices[1]).join("");switch(s.type){case"hashtag":return Object.assign(s,{href:jn(s),text:o});case"mention":return Object.assign(s,{href:xt(s.screen_name),text:o});case"url":case"media":return Object.assign(s,{href:s.expanded_url,text:s.display_url});case"symbol":return Object.assign(s,{href:wn(s),text:o});default:return Object.assign(s,{text:o})}})}function ae(e,t,r){for(const s of r)for(const[o,i]of e.entries()){if(i.indices[0]>s.indices[0]||i.indices[1]<s.indices[1])continue;const a=[{...s,type:t}];i.indices[0]<s.indices[0]&&a.unshift({indices:[i.indices[0],s.indices[0]],type:"text"}),i.indices[1]>s.indices[1]&&a.push({indices:[s.indices[1],i.indices[1]],type:"text"}),e.splice(o,1,...a);break}}function bn(e,t){e.entities.media&&e.entities.media[0].indices[0]<e.display_text_range[1]&&(e.display_text_range[1]=e.entities.media[0].indices[0]);const r=t.at(-1);r&&r.indices[1]>e.display_text_range[1]&&(r.indices[1]=e.display_text_range[1])}const En=e=>({...e,url:tt(e),user:{...e.user,url:xt(e),follow_url:gn(e)},like_url:xn(e),reply_url:vn(e),in_reply_to_url:e.in_reply_to_screen_name?yn(e):void 0,entities:nt(e),quoted_tweet:e.quoted_tweet?{...e.quoted_tweet,url:tt(e.quoted_tweet),entities:nt(e.quoted_tweet)}:void 0}),Rn="_root_g9tkv_1",On="_rounded_g9tkv_6",Nn="_mediaWrapper_g9tkv_10",Ln="_grid2Columns_g9tkv_17",kn="_grid3_g9tkv_20",In="_grid2x2_g9tkv_23",Cn="_mediaContainer_g9tkv_26",qn="_mediaLink_g9tkv_34",Dn="_skeleton_g9tkv_38",$n="_image_g9tkv_43",C={root:Rn,rounded:On,mediaWrapper:Nn,grid2Columns:Ln,grid3:kn,grid2x2:In,mediaContainer:Cn,mediaLink:qn,skeleton:Dn,image:$n},An="_anchor_fp31d_1",Vn="_videoButton_fp31d_17",Mn="_videoButtonIcon_fp31d_35",Bn="_watchOnTwitter_fp31d_44",Wn="_viewReplies_fp31d_60",se={anchor:An,videoButton:Vn,videoButtonIcon:Mn,watchOnTwitter:Bn,viewReplies:Wn},Fn=({tweet:e,media:t})=>{const[r,s]=x.useState(!0),[o,i]=x.useState(!1),[a,d]=x.useState(!1),p=Tn(t);let _=0;return n.jsxs(n.Fragment,{children:[n.jsx("video",{className:C.image,poster:vt(t,"small"),controls:!r,playsInline:!0,preload:"none",tabIndex:r?-1:0,onPlay:()=>{_&&window.clearTimeout(_),o||i(!0),a&&d(!1)},onPause:()=>{_&&window.clearTimeout(_),_=window.setTimeout(()=>{o&&i(!1),_=0},100)},onEnded:()=>{d(!0)},children:n.jsx("source",{src:p.url,type:p.content_type})}),r&&n.jsx("button",{type:"button",className:se.videoButton,"aria-label":"View video on X",onClick:w=>{const u=w.currentTarget.previousSibling;w.preventDefault(),s(!1),u.load(),u.play().then(()=>{i(!0),u.focus()}).catch(h=>{console.error("Error playing video:",h),s(!0),i(!1)})},children:n.jsx("svg",{viewBox:"0 0 24 24",className:se.videoButtonIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M21 12L4 2v20l17-10z"})})})}),!o&&!a&&n.jsx("div",{className:se.watchOnTwitter,children:n.jsx("a",{href:e.url,className:se.anchor,target:"_blank",rel:"noopener noreferrer",children:r?"Watch on X":"Continue watching on X"})}),a&&n.jsx("a",{href:e.url,className:M.clsx(se.anchor,se.viewReplies),target:"_blank",rel:"noopener noreferrer",children:"View replies"})]})},Pn=e=>n.jsx("img",{...e}),rt=(e,t)=>{let r=56.25;return t===1&&(r=100/e.original_info.width*e.original_info.height),t===2&&(r=r*2),{width:e.type==="photo"?void 0:"unset",paddingBottom:`${r}%`}},gt=({tweet:e,components:t,quoted:r})=>{var s,o,i;const a=(i=(s=e.mediaDetails)==null?void 0:s.length)!=null?i:0;var d;const p=(d=t==null?void 0:t.MediaImg)!=null?d:Pn;return n.jsx("div",{className:M.clsx(C.root,!r&&C.rounded),children:n.jsx("div",{className:M.clsx(C.mediaWrapper,a>1&&C.grid2Columns,a===3&&C.grid3,a>4&&C.grid2x2),children:(o=e.mediaDetails)==null?void 0:o.map(_=>n.jsx(x.Fragment,{children:_.type==="photo"?n.jsxs("a",{href:e.url,className:M.clsx(C.mediaContainer,C.mediaLink),target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:C.skeleton,style:rt(_,a)}),n.jsx(p,{src:vt(_,"small"),alt:_.ext_alt_text||"Image",className:C.image,draggable:!0})]},_.media_url_https):n.jsxs("div",{className:C.mediaContainer,children:[n.jsx("div",{className:C.skeleton,style:rt(_,a)}),n.jsx(Fn,{tweet:e,media:_})]},_.media_url_https)},_.media_url_https))})})},Un={hour:"numeric",minute:"2-digit",hour12:!0,weekday:"short",month:"short",day:"numeric",year:"numeric"},Hn=new Intl.DateTimeFormat("en-US",Un),zn=e=>{const t={};for(const r of e)t[r.type]=r.value;return t},Gn=e=>{const t=zn(Hn.formatToParts(e)),r=`${t.hour}:${t.minute} ${t.dayPeriod}`,s=`${t.month} ${t.day}, ${t.year}`;return`${r} · ${s}`},Kn="_root_i24yn_1",Xn={root:Kn},Qn=({tweet:e})=>{const t=new Date(e.created_at),r=Gn(t);return n.jsx("a",{className:Xn.root,href:e.url,target:"_blank",rel:"noopener noreferrer","aria-label":r,children:n.jsx("time",{dateTime:t.toISOString(),children:r})})},Jn="_info_19qcj_1",Yn="_infoLink_19qcj_10",Zn="_infoIcon_19qcj_30",ye={info:Jn,infoLink:Yn,infoIcon:Zn},er=({tweet:e})=>n.jsxs("div",{className:ye.info,children:[n.jsx(Qn,{tweet:e}),n.jsx("a",{className:ye.infoLink,href:"https://help.x.com/en/x-for-websites-ads-info-and-privacy",target:"_blank",rel:"noopener noreferrer","aria-label":"Twitter for Websites, Ads Information and Privacy",children:n.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:ye.infoIcon,children:n.jsx("g",{children:n.jsx("path",{d:"M13.5 8.5c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5S11.17 7 12 7s1.5.67 1.5 1.5zM13 17v-5h-2v5h2zm-1 5.25c5.66 0 10.25-4.59 10.25-10.25S17.66 1.75 12 1.75 1.75 6.34 1.75 12 6.34 22.25 12 22.25zM20.25 12c0 4.56-3.69 8.25-8.25 8.25S3.75 16.56 3.75 12 7.44 3.75 12 3.75s8.25 3.69 8.25 8.25z"})})})})]}),tr="_actions_n2anf_1",nr="_like_n2anf_13",rr="_reply_n2anf_14",sr="_copy_n2anf_15",or="_likeIconWrapper_n2anf_27",ir="_likeCount_n2anf_30",ar="_replyIconWrapper_n2anf_35",cr="_copyIconWrapper_n2anf_36",lr="_likeIcon_n2anf_27",ur="_replyIcon_n2anf_35",dr="_copyIcon_n2anf_36",fr="_replyText_n2anf_56",_r="_copyText_n2anf_57",L={actions:tr,like:nr,reply:rr,copy:sr,likeIconWrapper:or,likeCount:ir,replyIconWrapper:ar,copyIconWrapper:cr,likeIcon:lr,replyIcon:ur,copyIcon:dr,replyText:fr,copyText:_r},hr=({tweet:e})=>{const[t,r]=x.useState(!1),s=()=>{navigator.clipboard.writeText(e.url),r(!0)};return x.useEffect(()=>{if(t){const o=setTimeout(()=>{r(!1)},6e3);return()=>clearTimeout(o)}},[t]),n.jsxs("button",{type:"button",className:L.copy,"aria-label":"Copy link",onClick:s,children:[n.jsx("div",{className:L.copyIconWrapper,children:t?n.jsx("svg",{viewBox:"0 0 24 24",className:L.copyIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M9.64 18.952l-5.55-4.861 1.317-1.504 3.951 3.459 8.459-10.948L19.4 6.32 9.64 18.952z"})})}):n.jsx("svg",{viewBox:"0 0 24 24",className:L.copyIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M18.36 5.64c-1.95-1.96-5.11-1.96-7.07 0L9.88 7.05 8.46 5.64l1.42-1.42c2.73-2.73 7.16-2.73 9.9 0 2.73 2.74 2.73 7.17 0 9.9l-1.42 1.42-1.41-1.42 1.41-1.41c1.96-1.96 1.96-5.12 0-7.07zm-2.12 3.53l-7.07 7.07-1.41-1.41 7.07-7.07 1.41 1.41zm-12.02.71l1.42-1.42 1.41 1.42-1.41 1.41c-1.96 1.96-1.96 5.12 0 7.07 1.95 1.96 5.11 1.96 7.07 0l1.41-1.41 1.42 1.41-1.42 1.42c-2.73 2.73-7.16 2.73-9.9 0-2.73-2.74-2.73-7.17 0-9.9z"})})})}),n.jsx("span",{className:L.copyText,children:t?"Copied!":"Copy link"})]})},mr=({tweet:e})=>{const t=Ie(e.favorite_count);return n.jsxs("div",{className:L.actions,children:[n.jsxs("a",{className:L.like,href:e.like_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Like. This Tweet has ${t} likes`,children:[n.jsx("div",{className:L.likeIconWrapper,children:n.jsx("svg",{viewBox:"0 0 24 24",className:L.likeIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M20.884 13.19c-1.351 2.48-4.001 5.12-8.379 7.67l-.503.3-.504-.3c-4.379-2.55-7.029-5.19-8.382-7.67-1.36-2.5-1.41-4.86-.514-6.67.887-1.79 2.647-2.91 4.601-3.01 1.651-.09 3.368.56 4.798 2.01 1.429-1.45 3.146-2.1 4.796-2.01 1.954.1 3.714 1.22 4.601 3.01.896 1.81.846 4.17-.514 6.67z"})})})}),n.jsx("span",{className:L.likeCount,children:t})]}),n.jsxs("a",{className:L.reply,href:e.reply_url,target:"_blank",rel:"noopener noreferrer","aria-label":"Reply to this Tweet on Twitter",children:[n.jsx("div",{className:L.replyIconWrapper,children:n.jsx("svg",{viewBox:"0 0 24 24",className:L.replyIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M1.751 10c0-4.42 3.584-8 8.005-8h4.366c4.49 0 8.129 3.64 8.129 8.13 0 2.96-1.607 5.68-4.196 7.11l-8.054 4.46v-3.69h-.067c-4.49.1-8.183-3.51-8.183-8.01z"})})})}),n.jsx("span",{className:L.replyText,children:"Reply"})]}),n.jsx(hr,{tweet:e})]})},pr="_replies_1cutb_1",xr="_link_1cutb_4",vr="_text_1cutb_23",Se={replies:pr,link:xr,text:vr},gr=({tweet:e})=>n.jsx("div",{className:Se.replies,children:n.jsx("a",{className:Se.link,href:e.url,target:"_blank",rel:"noopener noreferrer",children:n.jsx("span",{className:Se.text,children:e.conversation_count===0?"Read more on X":e.conversation_count===1?`Read ${Ie(e.conversation_count)} reply`:`Read ${Ie(e.conversation_count)} replies`})})}),jr="_root_q5799_1",wr="_article_q5799_16",st={root:jr,article:wr},yr=({tweet:e,children:t})=>n.jsx("div",{className:st.root,onClick:r=>{r.preventDefault(),window.open(e.url,"_blank")},children:n.jsx("article",{className:st.article,children:t})}),Sr="_header_r31i5_1",Tr="_avatar_r31i5_11",br="_avatarSquare_r31i5_17",Er="_author_r31i5_21",Rr="_authorText_r31i5_26",Or="_username_r31i5_33",Q={header:Sr,avatar:Tr,avatarSquare:br,author:Er,authorText:Rr,username:Or},Nr=({tweet:e})=>{const{user:t}=e;return n.jsxs("div",{className:Q.header,children:[n.jsx("a",{href:e.url,className:Q.avatar,target:"_blank",rel:"noopener noreferrer",children:n.jsx("div",{className:M.clsx(Q.avatarOverflow,t.profile_image_shape==="Square"&&Q.avatarSquare),children:n.jsx(mt,{src:t.profile_image_url_https,alt:t.name,width:20,height:20})})}),n.jsxs("div",{className:Q.author,children:[n.jsx("div",{className:Q.authorText,children:n.jsx("span",{title:t.name,children:t.name})}),n.jsx(pt,{user:t}),n.jsx("div",{className:Q.username,children:n.jsxs("span",{title:`@${t.screen_name}`,children:["@",t.screen_name]})})]})]})},Lr="_root_175ot_1",kr={root:Lr},Ir=({tweet:e})=>n.jsx("p",{className:kr.root,lang:e.lang,dir:"auto",children:e.entities.map((t,r)=>n.jsx("span",{dangerouslySetInnerHTML:{__html:t.text}},r))}),Cr=({tweet:e})=>{var t;return n.jsxs(yr,{tweet:e,children:[n.jsx(Nr,{tweet:e}),n.jsx(Ir,{tweet:e}),(t=e.mediaDetails)!=null&&t.length?n.jsx(gt,{quoted:!0,tweet:e}):null]})},qr=({tweet:e,components:t})=>{var r;const s=x.useMemo(()=>En(e),[e]);return n.jsxs(Fe,{children:[n.jsx(an,{tweet:s,components:t}),s.in_reply_to_status_id_str&&n.jsx(un,{tweet:s}),n.jsx(pn,{tweet:s}),(r=s.mediaDetails)!=null&&r.length?n.jsx(gt,{tweet:s,components:t}):null,s.quoted_tweet&&n.jsx(Cr,{tweet:s.quoted_tweet}),n.jsx(er,{tweet:s}),n.jsx(mr,{tweet:s}),n.jsx(gr,{tweet:s})]})},Dr="_root_16yxa_1",$r={root:Dr},Ar=e=>n.jsx(Fe,{children:n.jsxs("div",{className:$r.root,children:[n.jsx("h3",{children:"Tweet not found"}),n.jsx("p",{children:"The embedded tweet could not be found…"})]})}),Vr="_skeleton_oi7hr_1",Mr={skeleton:Vr},_e=({style:e})=>n.jsx("span",{className:Mr.skeleton,style:e}),Br="_root_17qqv_1",Wr={root:Br},Fr=()=>n.jsxs(Fe,{className:Wr.root,children:[n.jsx(_e,{style:{height:"3rem",marginBottom:"0.75rem"}}),n.jsx(_e,{style:{height:"6rem",margin:"0.5rem 0"}}),n.jsx("div",{style:{borderTop:"var(--tweet-border)",margin:"0.5rem 0"}}),n.jsx(_e,{style:{height:"2rem"}}),n.jsx(_e,{style:{height:"2rem",borderRadius:"9999px",marginTop:"0.5rem"}})]});var he={exports:{}},Te={};/**
|
|
1
|
+
"use strict";const je=require("./index-ByRfqzMr.cjs"),M=require("./dom-dataset-Byuf1YmW.cjs"),n=require("react/jsx-runtime"),x=require("react"),H=require("./RichTextEditor-DWlLqTl9.cjs"),qt=require("./index-D_A0TBRA.cjs"),Dt="_verified_lvyh0_1",We={verified:Dt},$t=()=>n.jsx("svg",{viewBox:"0 0 24 24","aria-label":"Verified account",role:"img",className:We.verified,children:n.jsx("g",{children:n.jsx("path",{d:"M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.33 2.19c-1.4-.46-2.91-.2-3.92.81s-1.26 2.52-.8 3.91c-1.31.67-2.2 1.91-2.2 3.34s.89 2.67 2.2 3.34c-.46 1.39-.21 2.9.8 3.91s2.52 1.26 3.91.81c.67 1.31 1.91 2.19 3.34 2.19s2.68-.88 3.34-2.19c1.39.45 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z"})})}),At=()=>n.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:We.verified,children:n.jsxs("g",{children:[n.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-a",x1:"4.411",x2:"18.083",y1:"2.495",y2:"21.508",children:[n.jsx("stop",{offset:"0",stopColor:"#f4e72a"}),n.jsx("stop",{offset:".539",stopColor:"#cd8105"}),n.jsx("stop",{offset:".68",stopColor:"#cb7b00"}),n.jsx("stop",{offset:"1",stopColor:"#f4ec26"}),n.jsx("stop",{offset:"1",stopColor:"#f4e72a"})]}),n.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-b",x1:"5.355",x2:"16.361",y1:"3.395",y2:"19.133",children:[n.jsx("stop",{offset:"0",stopColor:"#f9e87f"}),n.jsx("stop",{offset:".406",stopColor:"#e2b719"}),n.jsx("stop",{offset:".989",stopColor:"#e2b719"})]}),n.jsxs("g",{clipRule:"evenodd",fillRule:"evenodd",children:[n.jsx("path",{d:"M13.324 3.848L11 1.6 8.676 3.848l-3.201-.453-.559 3.184L2.06 8.095 3.48 11l-1.42 2.904 2.856 1.516.559 3.184 3.201-.452L11 20.4l2.324-2.248 3.201.452.559-3.184 2.856-1.516L18.52 11l1.42-2.905-2.856-1.516-.559-3.184zm-7.09 7.575l3.428 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-a)"}),n.jsx("path",{d:"M13.101 4.533L11 2.5 8.899 4.533l-2.895-.41-.505 2.88-2.583 1.37L4.2 11l-1.284 2.627 2.583 1.37.505 2.88 2.895-.41L11 19.5l2.101-2.033 2.895.41.505-2.88 2.583-1.37L17.8 11l1.284-2.627-2.583-1.37-.505-2.88zm-6.868 6.89l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-b)"}),n.jsx("path",{d:"M6.233 11.423l3.429 3.428 5.65-6.17.038-.033-.005 1.398-5.683 6.206-3.429-3.429-.003-1.405.005.003z",fill:"#d18800"})]})]})}),Vt=()=>n.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:We.verified,children:n.jsx("g",{children:n.jsx("path",{clipRule:"evenodd",d:"M12.05 2.056c-.568-.608-1.532-.608-2.1 0l-1.393 1.49c-.284.303-.685.47-1.1.455L5.42 3.932c-.832-.028-1.514.654-1.486 1.486l.069 2.039c.014.415-.152.816-.456 1.1l-1.49 1.392c-.608.568-.608 1.533 0 2.101l1.49 1.393c.304.284.47.684.456 1.1l-.07 2.038c-.027.832.655 1.514 1.487 1.486l2.038-.069c.415-.014.816.152 1.1.455l1.392 1.49c.569.609 1.533.609 2.102 0l1.393-1.49c.283-.303.684-.47 1.099-.455l2.038.069c.832.028 1.515-.654 1.486-1.486L18 14.542c-.015-.415.152-.815.455-1.099l1.49-1.393c.608-.568.608-1.533 0-2.101l-1.49-1.393c-.303-.283-.47-.684-.455-1.1l.068-2.038c.029-.832-.654-1.514-1.486-1.486l-2.038.07c-.415.013-.816-.153-1.1-.456zm-5.817 9.367l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fillRule:"evenodd"})})}),Mt="_root_98iqw_1",Bt="_article_98iqw_21",et={root:Mt,article:Bt},Fe=({className:e,children:t})=>n.jsx("div",{className:M.clsx("react-tweet-theme",et.root,e),children:n.jsx("article",{className:et.article,children:t})}),mt=e=>n.jsx("img",{...e}),Wt="_header_nqq4j_1",Ft="_avatar_nqq4j_11",Pt="_avatarOverflow_nqq4j_16",Ut="_avatarSquare_nqq4j_23",Ht="_avatarShadow_nqq4j_26",zt="_author_nqq4j_37",Gt="_authorLink_nqq4j_44",Kt="_authorVerified_nqq4j_53",Xt="_authorLinkText_nqq4j_56",Qt="_authorMeta_nqq4j_63",Jt="_authorFollow_nqq4j_66",Yt="_username_nqq4j_69",Zt="_follow_nqq4j_74",en="_separator_nqq4j_82",tn="_brand_nqq4j_86",nn="_twitterIcon_nqq4j_90",b={header:Wt,avatar:Ft,avatarOverflow:Pt,avatarSquare:Ut,avatarShadow:Ht,author:zt,authorLink:Gt,authorVerified:Kt,authorLinkText:Xt,authorMeta:Qt,authorFollow:Jt,username:Yt,follow:Zt,separator:en,brand:tn,twitterIcon:nn},rn="_verifiedOld_lcna5_1",sn="_verifiedBlue_lcna5_4",on="_verifiedGovernment_lcna5_7",we={verifiedOld:rn,verifiedBlue:sn,verifiedGovernment:on},pt=({user:e,className:t})=>{const r=e.verified||e.is_blue_verified||e.verified_type;let s=n.jsx($t,{}),o=we.verifiedBlue;if(r)switch(e.is_blue_verified||(o=we.verifiedOld),e.verified_type){case"Government":s=n.jsx(Vt,{}),o=we.verifiedGovernment;break;case"Business":s=n.jsx(At,{}),o=null;break}return r?n.jsx("div",{className:M.clsx(t,o),children:s}):null},an=({tweet:e,components:t})=>{var r;const s=(r=t==null?void 0:t.AvatarImg)!=null?r:mt,{user:o}=e;return n.jsxs("div",{className:b.header,children:[n.jsxs("a",{href:e.url,className:b.avatar,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:M.clsx(b.avatarOverflow,o.profile_image_shape==="Square"&&b.avatarSquare),children:n.jsx(s,{src:o.profile_image_url_https,alt:o.name,width:48,height:48})}),n.jsx("div",{className:b.avatarOverflow,children:n.jsx("div",{className:b.avatarShadow})})]}),n.jsxs("div",{className:b.author,children:[n.jsxs("a",{href:e.url,className:b.authorLink,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:b.authorLinkText,children:n.jsx("span",{title:o.name,children:o.name})}),n.jsx(pt,{user:o,className:b.authorVerified})]}),n.jsxs("div",{className:b.authorMeta,children:[n.jsx("a",{href:e.url,className:b.username,target:"_blank",rel:"noopener noreferrer",children:n.jsxs("span",{title:`@${o.screen_name}`,children:["@",o.screen_name]})}),n.jsxs("div",{className:b.authorFollow,children:[n.jsx("span",{className:b.separator,children:"·"}),n.jsx("a",{href:o.follow_url,className:b.follow,target:"_blank",rel:"noopener noreferrer",children:"Follow"})]})]})]}),n.jsx("a",{href:e.url,className:b.brand,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Twitter",children:n.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:b.twitterIcon,children:n.jsx("g",{children:n.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})})})]})},cn="_root_1ec15_1",ln={root:cn},un=({tweet:e})=>n.jsxs("a",{href:e.in_reply_to_url,className:ln.root,target:"_blank",rel:"noopener noreferrer",children:["Replying to @",e.in_reply_to_screen_name]}),dn="_root_eihfa_1",fn={root:dn},_n=({href:e,children:t})=>n.jsx("a",{href:e,className:fn.root,target:"_blank",rel:"noopener noreferrer nofollow",children:t}),hn="_root_1xq52_1",mn={root:hn},pn=({tweet:e})=>n.jsx("p",{className:mn.root,lang:e.lang,dir:"auto",children:e.entities.map((t,r)=>{switch(t.type){case"hashtag":case"mention":case"url":case"symbol":return n.jsx(_n,{href:t.href,children:t.text},r);case"media":return;default:return n.jsx("span",{dangerouslySetInnerHTML:{__html:t.text}},r)}})}),tt=e=>`https://x.com/${e.user.screen_name}/status/${e.id_str}`,xt=e=>`https://x.com/${typeof e=="string"?e:e.user.screen_name}`,xn=e=>`https://x.com/intent/like?tweet_id=${e.id_str}`,vn=e=>`https://x.com/intent/tweet?in_reply_to=${e.id_str}`,gn=e=>`https://x.com/intent/follow?screen_name=${e.user.screen_name}`,jn=e=>`https://x.com/hashtag/${e.text}`,wn=e=>`https://x.com/search?q=%24${e.text}`,yn=e=>`https://x.com/${e.in_reply_to_screen_name}/status/${e.in_reply_to_status_id_str}`,vt=(e,t)=>{const r=new URL(e.media_url_https),s=r.pathname.split(".").pop();return s?(r.pathname=r.pathname.replace(`.${s}`,""),r.searchParams.set("format",s),r.searchParams.set("name",t),r.toString()):e.media_url_https},Sn=e=>{const{variants:t}=e.video_info;return t.filter(s=>s.content_type==="video/mp4").sort((s,o)=>{var i,a;return((i=o.bitrate)!=null?i:0)-((a=s.bitrate)!=null?a:0)})},Tn=e=>{const t=Sn(e);return t.length>1?t[1]:t[0]},Ie=e=>e>999999?`${(e/1e6).toFixed(1)}M`:e>999?`${(e/1e3).toFixed(1)}K`:e.toString();function nt(e){const t=Array.from(e.text),r=[{indices:e.display_text_range,type:"text"}];return ae(r,"hashtag",e.entities.hashtags),ae(r,"mention",e.entities.user_mentions),ae(r,"url",e.entities.urls),ae(r,"symbol",e.entities.symbols),e.entities.media&&ae(r,"media",e.entities.media),bn(e,r),r.map(s=>{const o=t.slice(s.indices[0],s.indices[1]).join("");switch(s.type){case"hashtag":return Object.assign(s,{href:jn(s),text:o});case"mention":return Object.assign(s,{href:xt(s.screen_name),text:o});case"url":case"media":return Object.assign(s,{href:s.expanded_url,text:s.display_url});case"symbol":return Object.assign(s,{href:wn(s),text:o});default:return Object.assign(s,{text:o})}})}function ae(e,t,r){for(const s of r)for(const[o,i]of e.entries()){if(i.indices[0]>s.indices[0]||i.indices[1]<s.indices[1])continue;const a=[{...s,type:t}];i.indices[0]<s.indices[0]&&a.unshift({indices:[i.indices[0],s.indices[0]],type:"text"}),i.indices[1]>s.indices[1]&&a.push({indices:[s.indices[1],i.indices[1]],type:"text"}),e.splice(o,1,...a);break}}function bn(e,t){e.entities.media&&e.entities.media[0].indices[0]<e.display_text_range[1]&&(e.display_text_range[1]=e.entities.media[0].indices[0]);const r=t.at(-1);r&&r.indices[1]>e.display_text_range[1]&&(r.indices[1]=e.display_text_range[1])}const En=e=>({...e,url:tt(e),user:{...e.user,url:xt(e),follow_url:gn(e)},like_url:xn(e),reply_url:vn(e),in_reply_to_url:e.in_reply_to_screen_name?yn(e):void 0,entities:nt(e),quoted_tweet:e.quoted_tweet?{...e.quoted_tweet,url:tt(e.quoted_tweet),entities:nt(e.quoted_tweet)}:void 0}),Rn="_root_g9tkv_1",On="_rounded_g9tkv_6",Nn="_mediaWrapper_g9tkv_10",Ln="_grid2Columns_g9tkv_17",kn="_grid3_g9tkv_20",In="_grid2x2_g9tkv_23",Cn="_mediaContainer_g9tkv_26",qn="_mediaLink_g9tkv_34",Dn="_skeleton_g9tkv_38",$n="_image_g9tkv_43",C={root:Rn,rounded:On,mediaWrapper:Nn,grid2Columns:Ln,grid3:kn,grid2x2:In,mediaContainer:Cn,mediaLink:qn,skeleton:Dn,image:$n},An="_anchor_fp31d_1",Vn="_videoButton_fp31d_17",Mn="_videoButtonIcon_fp31d_35",Bn="_watchOnTwitter_fp31d_44",Wn="_viewReplies_fp31d_60",se={anchor:An,videoButton:Vn,videoButtonIcon:Mn,watchOnTwitter:Bn,viewReplies:Wn},Fn=({tweet:e,media:t})=>{const[r,s]=x.useState(!0),[o,i]=x.useState(!1),[a,d]=x.useState(!1),p=Tn(t);let _=0;return n.jsxs(n.Fragment,{children:[n.jsx("video",{className:C.image,poster:vt(t,"small"),controls:!r,playsInline:!0,preload:"none",tabIndex:r?-1:0,onPlay:()=>{_&&window.clearTimeout(_),o||i(!0),a&&d(!1)},onPause:()=>{_&&window.clearTimeout(_),_=window.setTimeout(()=>{o&&i(!1),_=0},100)},onEnded:()=>{d(!0)},children:n.jsx("source",{src:p.url,type:p.content_type})}),r&&n.jsx("button",{type:"button",className:se.videoButton,"aria-label":"View video on X",onClick:w=>{const u=w.currentTarget.previousSibling;w.preventDefault(),s(!1),u.load(),u.play().then(()=>{i(!0),u.focus()}).catch(h=>{console.error("Error playing video:",h),s(!0),i(!1)})},children:n.jsx("svg",{viewBox:"0 0 24 24",className:se.videoButtonIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M21 12L4 2v20l17-10z"})})})}),!o&&!a&&n.jsx("div",{className:se.watchOnTwitter,children:n.jsx("a",{href:e.url,className:se.anchor,target:"_blank",rel:"noopener noreferrer",children:r?"Watch on X":"Continue watching on X"})}),a&&n.jsx("a",{href:e.url,className:M.clsx(se.anchor,se.viewReplies),target:"_blank",rel:"noopener noreferrer",children:"View replies"})]})},Pn=e=>n.jsx("img",{...e}),rt=(e,t)=>{let r=56.25;return t===1&&(r=100/e.original_info.width*e.original_info.height),t===2&&(r=r*2),{width:e.type==="photo"?void 0:"unset",paddingBottom:`${r}%`}},gt=({tweet:e,components:t,quoted:r})=>{var s,o,i;const a=(i=(s=e.mediaDetails)==null?void 0:s.length)!=null?i:0;var d;const p=(d=t==null?void 0:t.MediaImg)!=null?d:Pn;return n.jsx("div",{className:M.clsx(C.root,!r&&C.rounded),children:n.jsx("div",{className:M.clsx(C.mediaWrapper,a>1&&C.grid2Columns,a===3&&C.grid3,a>4&&C.grid2x2),children:(o=e.mediaDetails)==null?void 0:o.map(_=>n.jsx(x.Fragment,{children:_.type==="photo"?n.jsxs("a",{href:e.url,className:M.clsx(C.mediaContainer,C.mediaLink),target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:C.skeleton,style:rt(_,a)}),n.jsx(p,{src:vt(_,"small"),alt:_.ext_alt_text||"Image",className:C.image,draggable:!0})]},_.media_url_https):n.jsxs("div",{className:C.mediaContainer,children:[n.jsx("div",{className:C.skeleton,style:rt(_,a)}),n.jsx(Fn,{tweet:e,media:_})]},_.media_url_https)},_.media_url_https))})})},Un={hour:"numeric",minute:"2-digit",hour12:!0,weekday:"short",month:"short",day:"numeric",year:"numeric"},Hn=new Intl.DateTimeFormat("en-US",Un),zn=e=>{const t={};for(const r of e)t[r.type]=r.value;return t},Gn=e=>{const t=zn(Hn.formatToParts(e)),r=`${t.hour}:${t.minute} ${t.dayPeriod}`,s=`${t.month} ${t.day}, ${t.year}`;return`${r} · ${s}`},Kn="_root_i24yn_1",Xn={root:Kn},Qn=({tweet:e})=>{const t=new Date(e.created_at),r=Gn(t);return n.jsx("a",{className:Xn.root,href:e.url,target:"_blank",rel:"noopener noreferrer","aria-label":r,children:n.jsx("time",{dateTime:t.toISOString(),children:r})})},Jn="_info_19qcj_1",Yn="_infoLink_19qcj_10",Zn="_infoIcon_19qcj_30",ye={info:Jn,infoLink:Yn,infoIcon:Zn},er=({tweet:e})=>n.jsxs("div",{className:ye.info,children:[n.jsx(Qn,{tweet:e}),n.jsx("a",{className:ye.infoLink,href:"https://help.x.com/en/x-for-websites-ads-info-and-privacy",target:"_blank",rel:"noopener noreferrer","aria-label":"Twitter for Websites, Ads Information and Privacy",children:n.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:ye.infoIcon,children:n.jsx("g",{children:n.jsx("path",{d:"M13.5 8.5c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5S11.17 7 12 7s1.5.67 1.5 1.5zM13 17v-5h-2v5h2zm-1 5.25c5.66 0 10.25-4.59 10.25-10.25S17.66 1.75 12 1.75 1.75 6.34 1.75 12 6.34 22.25 12 22.25zM20.25 12c0 4.56-3.69 8.25-8.25 8.25S3.75 16.56 3.75 12 7.44 3.75 12 3.75s8.25 3.69 8.25 8.25z"})})})})]}),tr="_actions_n2anf_1",nr="_like_n2anf_13",rr="_reply_n2anf_14",sr="_copy_n2anf_15",or="_likeIconWrapper_n2anf_27",ir="_likeCount_n2anf_30",ar="_replyIconWrapper_n2anf_35",cr="_copyIconWrapper_n2anf_36",lr="_likeIcon_n2anf_27",ur="_replyIcon_n2anf_35",dr="_copyIcon_n2anf_36",fr="_replyText_n2anf_56",_r="_copyText_n2anf_57",L={actions:tr,like:nr,reply:rr,copy:sr,likeIconWrapper:or,likeCount:ir,replyIconWrapper:ar,copyIconWrapper:cr,likeIcon:lr,replyIcon:ur,copyIcon:dr,replyText:fr,copyText:_r},hr=({tweet:e})=>{const[t,r]=x.useState(!1),s=()=>{navigator.clipboard.writeText(e.url),r(!0)};return x.useEffect(()=>{if(t){const o=setTimeout(()=>{r(!1)},6e3);return()=>clearTimeout(o)}},[t]),n.jsxs("button",{type:"button",className:L.copy,"aria-label":"Copy link",onClick:s,children:[n.jsx("div",{className:L.copyIconWrapper,children:t?n.jsx("svg",{viewBox:"0 0 24 24",className:L.copyIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M9.64 18.952l-5.55-4.861 1.317-1.504 3.951 3.459 8.459-10.948L19.4 6.32 9.64 18.952z"})})}):n.jsx("svg",{viewBox:"0 0 24 24",className:L.copyIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M18.36 5.64c-1.95-1.96-5.11-1.96-7.07 0L9.88 7.05 8.46 5.64l1.42-1.42c2.73-2.73 7.16-2.73 9.9 0 2.73 2.74 2.73 7.17 0 9.9l-1.42 1.42-1.41-1.42 1.41-1.41c1.96-1.96 1.96-5.12 0-7.07zm-2.12 3.53l-7.07 7.07-1.41-1.41 7.07-7.07 1.41 1.41zm-12.02.71l1.42-1.42 1.41 1.42-1.41 1.41c-1.96 1.96-1.96 5.12 0 7.07 1.95 1.96 5.11 1.96 7.07 0l1.41-1.41 1.42 1.41-1.42 1.42c-2.73 2.73-7.16 2.73-9.9 0-2.73-2.74-2.73-7.17 0-9.9z"})})})}),n.jsx("span",{className:L.copyText,children:t?"Copied!":"Copy link"})]})},mr=({tweet:e})=>{const t=Ie(e.favorite_count);return n.jsxs("div",{className:L.actions,children:[n.jsxs("a",{className:L.like,href:e.like_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Like. This Tweet has ${t} likes`,children:[n.jsx("div",{className:L.likeIconWrapper,children:n.jsx("svg",{viewBox:"0 0 24 24",className:L.likeIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M20.884 13.19c-1.351 2.48-4.001 5.12-8.379 7.67l-.503.3-.504-.3c-4.379-2.55-7.029-5.19-8.382-7.67-1.36-2.5-1.41-4.86-.514-6.67.887-1.79 2.647-2.91 4.601-3.01 1.651-.09 3.368.56 4.798 2.01 1.429-1.45 3.146-2.1 4.796-2.01 1.954.1 3.714 1.22 4.601 3.01.896 1.81.846 4.17-.514 6.67z"})})})}),n.jsx("span",{className:L.likeCount,children:t})]}),n.jsxs("a",{className:L.reply,href:e.reply_url,target:"_blank",rel:"noopener noreferrer","aria-label":"Reply to this Tweet on Twitter",children:[n.jsx("div",{className:L.replyIconWrapper,children:n.jsx("svg",{viewBox:"0 0 24 24",className:L.replyIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M1.751 10c0-4.42 3.584-8 8.005-8h4.366c4.49 0 8.129 3.64 8.129 8.13 0 2.96-1.607 5.68-4.196 7.11l-8.054 4.46v-3.69h-.067c-4.49.1-8.183-3.51-8.183-8.01z"})})})}),n.jsx("span",{className:L.replyText,children:"Reply"})]}),n.jsx(hr,{tweet:e})]})},pr="_replies_1cutb_1",xr="_link_1cutb_4",vr="_text_1cutb_23",Se={replies:pr,link:xr,text:vr},gr=({tweet:e})=>n.jsx("div",{className:Se.replies,children:n.jsx("a",{className:Se.link,href:e.url,target:"_blank",rel:"noopener noreferrer",children:n.jsx("span",{className:Se.text,children:e.conversation_count===0?"Read more on X":e.conversation_count===1?`Read ${Ie(e.conversation_count)} reply`:`Read ${Ie(e.conversation_count)} replies`})})}),jr="_root_q5799_1",wr="_article_q5799_16",st={root:jr,article:wr},yr=({tweet:e,children:t})=>n.jsx("div",{className:st.root,onClick:r=>{r.preventDefault(),window.open(e.url,"_blank")},children:n.jsx("article",{className:st.article,children:t})}),Sr="_header_r31i5_1",Tr="_avatar_r31i5_11",br="_avatarSquare_r31i5_17",Er="_author_r31i5_21",Rr="_authorText_r31i5_26",Or="_username_r31i5_33",Q={header:Sr,avatar:Tr,avatarSquare:br,author:Er,authorText:Rr,username:Or},Nr=({tweet:e})=>{const{user:t}=e;return n.jsxs("div",{className:Q.header,children:[n.jsx("a",{href:e.url,className:Q.avatar,target:"_blank",rel:"noopener noreferrer",children:n.jsx("div",{className:M.clsx(Q.avatarOverflow,t.profile_image_shape==="Square"&&Q.avatarSquare),children:n.jsx(mt,{src:t.profile_image_url_https,alt:t.name,width:20,height:20})})}),n.jsxs("div",{className:Q.author,children:[n.jsx("div",{className:Q.authorText,children:n.jsx("span",{title:t.name,children:t.name})}),n.jsx(pt,{user:t}),n.jsx("div",{className:Q.username,children:n.jsxs("span",{title:`@${t.screen_name}`,children:["@",t.screen_name]})})]})]})},Lr="_root_175ot_1",kr={root:Lr},Ir=({tweet:e})=>n.jsx("p",{className:kr.root,lang:e.lang,dir:"auto",children:e.entities.map((t,r)=>n.jsx("span",{dangerouslySetInnerHTML:{__html:t.text}},r))}),Cr=({tweet:e})=>{var t;return n.jsxs(yr,{tweet:e,children:[n.jsx(Nr,{tweet:e}),n.jsx(Ir,{tweet:e}),(t=e.mediaDetails)!=null&&t.length?n.jsx(gt,{quoted:!0,tweet:e}):null]})},qr=({tweet:e,components:t})=>{var r;const s=x.useMemo(()=>En(e),[e]);return n.jsxs(Fe,{children:[n.jsx(an,{tweet:s,components:t}),s.in_reply_to_status_id_str&&n.jsx(un,{tweet:s}),n.jsx(pn,{tweet:s}),(r=s.mediaDetails)!=null&&r.length?n.jsx(gt,{tweet:s,components:t}):null,s.quoted_tweet&&n.jsx(Cr,{tweet:s.quoted_tweet}),n.jsx(er,{tweet:s}),n.jsx(mr,{tweet:s}),n.jsx(gr,{tweet:s})]})},Dr="_root_16yxa_1",$r={root:Dr},Ar=e=>n.jsx(Fe,{children:n.jsxs("div",{className:$r.root,children:[n.jsx("h3",{children:"Tweet not found"}),n.jsx("p",{children:"The embedded tweet could not be found…"})]})}),Vr="_skeleton_oi7hr_1",Mr={skeleton:Vr},_e=({style:e})=>n.jsx("span",{className:Mr.skeleton,style:e}),Br="_root_17qqv_1",Wr={root:Br},Fr=()=>n.jsxs(Fe,{className:Wr.root,children:[n.jsx(_e,{style:{height:"3rem",marginBottom:"0.75rem"}}),n.jsx(_e,{style:{height:"6rem",margin:"0.5rem 0"}}),n.jsx("div",{style:{borderTop:"var(--tweet-border)",margin:"0.5rem 0"}}),n.jsx(_e,{style:{height:"2rem"}}),n.jsx(_e,{style:{height:"2rem",borderRadius:"9999px",marginTop:"0.5rem"}})]});var he={exports:{}},Te={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* use-sync-external-store-shim.production.js
|
|
4
4
|
*
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var it;function Ur(){return it||(it=1,process.env.NODE_ENV!=="production"&&function(){function e(l,v){return l===v&&(l!==0||1/l===1/v)||l!==l&&v!==v}function t(l,v){w||o.startTransition===void 0||(w=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var f=v();if(!u){var k=v();i(f,k)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0)}k=a({inst:{value:f,getSnapshot:v}});var c=k[0].inst,P=k[1];return p(function(){c.value=f,c.getSnapshot=v,r(c)&&P({inst:c})},[l,f,v]),d(function(){return r(c)&&P({inst:c}),l(function(){r(c)&&P({inst:c})})},[l]),_(f),f}function r(l){var v=l.getSnapshot;l=l.value;try{var f=v();return!i(l,f)}catch{return!0}}function s(l,v){return v()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=x,i=typeof Object.is=="function"?Object.is:e,a=o.useState,d=o.useEffect,p=o.useLayoutEffect,_=o.useDebugValue,w=!1,u=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?s:t;be.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),be}var at;function Hr(){return at||(at=1,process.env.NODE_ENV==="production"?he.exports=Pr():he.exports=Ur()),he.exports}var zr=Hr();const jt=0,wt=1,yt=2,ct=3;var lt=Object.prototype.hasOwnProperty;function Ce(e,t){var r,s;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((s=e.length)===t.length)for(;s--&&Ce(e[s],t[s]););return s===-1}if(!r||typeof e=="object"){s=0;for(r in e)if(lt.call(e,r)&&++s&&!lt.call(t,r)||!(r in t)||!Ce(e[r],t[r]))return!1;return Object.keys(t).length===s}}return e!==e&&t!==t}const F=new WeakMap,z=()=>{},N=z(),qe=Object,m=e=>e===N,V=e=>typeof e=="function",G=(e,t)=>({...e,...t}),St=e=>V(e.then),Ee={},me={},Pe="undefined",le=typeof window!=Pe,De=typeof document!=Pe,Gr=le&&"Deno"in window,Kr=()=>le&&typeof window.requestAnimationFrame!=Pe,Tt=(e,t)=>{const r=F.get(e);return[()=>!m(t)&&e.get(t)||Ee,s=>{if(!m(t)){const o=e.get(t);t in me||(me[t]=o),r[5](t,G(o,s),o||Ee)}},r[6],()=>!m(t)&&t in me?me[t]:!m(t)&&e.get(t)||Ee]};let $e=!0;const Xr=()=>$e,[Ae,Ve]=le&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[z,z],Qr=()=>{const e=De&&document.visibilityState;return m(e)||e!=="hidden"},Jr=e=>(De&&document.addEventListener("visibilitychange",e),Ae("focus",e),()=>{De&&document.removeEventListener("visibilitychange",e),Ve("focus",e)}),Yr=e=>{const t=()=>{$e=!0,e()},r=()=>{$e=!1};return Ae("online",t),Ae("offline",r),()=>{Ve("online",t),Ve("offline",r)}},Zr={isOnline:Xr,isVisible:Qr},es={initFocus:Jr,initReconnect:Yr},ut=!x.useId,ce=!le||Gr,ts=e=>Kr()?window.requestAnimationFrame(e):setTimeout(e,1),Re=ce?x.useEffect:x.useLayoutEffect,Oe=typeof navigator<"u"&&navigator.connection,dt=!ce&&Oe&&(["slow-2g","2g"].includes(Oe.effectiveType)||Oe.saveData),pe=new WeakMap,Ne=(e,t)=>qe.prototype.toString.call(e)===`[object ${t}]`;let ns=0;const Me=e=>{const t=typeof e,r=Ne(e,"Date"),s=Ne(e,"RegExp"),o=Ne(e,"Object");let i,a;if(qe(e)===e&&!r&&!s){if(i=pe.get(e),i)return i;if(i=++ns+"~",pe.set(e,i),Array.isArray(e)){for(i="@",a=0;a<e.length;a++)i+=Me(e[a])+",";pe.set(e,i)}if(o){i="#";const d=qe.keys(e).sort();for(;!m(a=d.pop());)m(e[a])||(i+=a+":"+Me(e[a])+",");pe.set(e,i)}}else i=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},Ue=e=>{if(V(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Me(e):"",[e,t]};let rs=0;const Be=()=>++rs;async function bt(...e){const[t,r,s,o]=e,i=G({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let a=i.populateCache;const d=i.rollbackOnError;let p=i.optimisticData;const _=h=>typeof d=="function"?d(h):d!==!1,w=i.throwOnError;if(V(r)){const h=r,l=[],v=t.keys();for(const f of v)!/^\$(inf|sub)\$/.test(f)&&h(t.get(f)._k)&&l.push(f);return Promise.all(l.map(u))}return u(r);async function u(h){const[l]=Ue(h);if(!l)return;const[v,f]=Tt(t,l),[k,c,P,oe]=F.get(t),U=()=>{const D=k[l];return(V(i.revalidate)?i.revalidate(v().data,h):i.revalidate!==!1)&&(delete P[l],delete oe[l],D&&D[0])?D[0](yt).then(()=>v().data):v().data};if(e.length<3)return U();let E=s,I;const J=Be();c[l]=[J,0];const S=!m(p),Y=v(),$=Y.data,Z=Y._c,K=m(Z)?$:Z;if(S&&(p=V(p)?p(K,$):p,f({data:p,_c:K})),V(E))try{E=E(K)}catch(D){I=D}if(E&&St(E))if(E=await E.catch(D=>{I=D}),J!==c[l][0]){if(I)throw I;return E}else I&&S&&_(I)&&(a=!0,f({data:K,_c:N}));if(a&&!I)if(V(a)){const D=a(E,K);f({data:D,error:N,_c:N})}else f({data:E,error:N,_c:N});if(c[l][1]=Be(),Promise.resolve(U()).then(()=>{f({_c:N})}),I){if(w)throw I;return}return E}}const ft=(e,t)=>{for(const r in e)e[r][0]&&e[r][0](t)},ss=(e,t)=>{if(!F.has(e)){const r=G(es,t),s={},o=bt.bind(N,e);let i=z;const a={},d=(w,u)=>{const h=a[w]||[];return a[w]=h,h.push(u),()=>h.splice(h.indexOf(u),1)},p=(w,u,h)=>{e.set(w,u);const l=a[w];if(l)for(const v of l)v(u,h)},_=()=>{if(!F.has(e)&&(F.set(e,[s,{},{},{},o,p,d]),!ce)){const w=r.initFocus(setTimeout.bind(N,ft.bind(N,s,jt))),u=r.initReconnect(setTimeout.bind(N,ft.bind(N,s,wt)));i=()=>{w&&w(),u&&u(),F.delete(e)}}};return _(),[e,o,_,i]}return[e,F.get(e)[4]]},os=(e,t,r,s,o)=>{const i=r.errorRetryCount,a=o.retryCount,d=~~((Math.random()+.5)*(1<<(a<8?a:8)))*r.errorRetryInterval;!m(i)&&a>i||setTimeout(s,d,o)},is=Ce,[Et,as]=ss(new Map),cs=G({onLoadingSlow:z,onSuccess:z,onError:z,onErrorRetry:os,onDiscarded:z,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:dt?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:dt?5e3:3e3,compare:is,isPaused:()=>!1,cache:Et,mutate:as,fallback:{}},Zr),ls=(e,t)=>{const r=G(e,t);if(t){const{use:s,fallback:o}=e,{use:i,fallback:a}=t;s&&i&&(r.use=s.concat(i)),o&&a&&(r.fallback=G(o,a))}return r},us=x.createContext({}),ds="$inf$",Rt=le&&window.__SWR_DEVTOOLS_USE__,fs=Rt?window.__SWR_DEVTOOLS_USE__:[],_s=()=>{Rt&&(window.__SWR_DEVTOOLS_REACT__=x)},hs=e=>V(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],ms=()=>G(cs,x.useContext(us)),ps=e=>(t,r,s)=>e(t,r&&((...i)=>{const[a]=Ue(t),[,,,d]=F.get(Et);if(a.startsWith(ds))return r(...i);const p=d[a];return m(p)?r(...i):(delete d[a],p)}),s),xs=fs.concat(ps),vs=e=>function(...r){const s=ms(),[o,i,a]=hs(r),d=ls(s,a);let p=e;const{use:_}=d,w=(_||[]).concat(xs);for(let u=w.length;u--;)p=w[u](p);return p(o,i||d.fetcher||null,d)},gs=(e,t,r)=>{const s=t[e]||(t[e]=[]);return s.push(r),()=>{const o=s.indexOf(r);o>=0&&(s[o]=s[s.length-1],s.pop())}};_s();const Le=x.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),ke={dedupe:!0},js=(e,t,r)=>{const{cache:s,compare:o,suspense:i,fallbackData:a,revalidateOnMount:d,revalidateIfStale:p,refreshInterval:_,refreshWhenHidden:w,refreshWhenOffline:u,keepPreviousData:h}=r,[l,v,f,k]=F.get(s),[c,P]=Ue(e),oe=x.useRef(!1),U=x.useRef(!1),E=x.useRef(c),I=x.useRef(t),J=x.useRef(r),S=()=>J.current,Y=()=>S().isVisible()&&S().isOnline(),[$,Z,K,D]=Tt(s,c),ee=x.useRef({}).current,ue=m(a)?m(r.fallback)?N:r.fallback[c]:a,He=(g,j)=>{for(const R in ee){const y=R;if(y==="data"){if(!o(g[y],j[y])&&(!m(g[y])||!o(fe,j[y])))return!1}else if(j[y]!==g[y])return!1}return!0},ze=x.useMemo(()=>{const g=!c||!t?!1:m(d)?S().isPaused()||i?!1:p!==!1:d,j=O=>{const B=G(O);return delete B._k,g?{isValidating:!0,isLoading:!0,...B}:B},R=$(),y=D(),A=j(R),re=R===y?A:j(y);let T=A;return[()=>{const O=j($());return He(O,T)?(T.data=O.data,T.isLoading=O.isLoading,T.isValidating=O.isValidating,T.error=O.error,T):(T=O,O)},()=>re]},[s,c]),te=zr.useSyncExternalStore(x.useCallback(g=>K(c,(j,R)=>{He(R,j)||g()}),[s,c]),ze[0],ze[1]),Ge=!oe.current,Lt=l[c]&&l[c].length>0,ne=te.data,X=m(ne)?ue&&St(ue)?Le(ue):ue:ne,de=te.error,xe=x.useRef(X),fe=h?m(ne)?m(xe.current)?X:xe.current:ne:X,Ke=Lt&&!m(de)?!1:Ge&&!m(d)?d:S().isPaused()?!1:i?m(X)?!1:p:m(X)||p,Xe=!!(c&&t&&Ge&&Ke),kt=m(te.isValidating)?Xe:te.isValidating,It=m(te.isLoading)?Xe:te.isLoading,ie=x.useCallback(async g=>{const j=I.current;if(!c||!j||U.current||S().isPaused())return!1;let R,y,A=!0;const re=g||{},T=!f[c]||!re.dedupe,O=()=>ut?!U.current&&c===E.current&&oe.current:c===E.current,B={isValidating:!1,isLoading:!1},Je=()=>{Z(B)},Ye=()=>{const q=f[c];q&&q[1]===y&&delete f[c]},Ze={isValidating:!0};m($().data)&&(Ze.isLoading=!0);try{if(T&&(Z(Ze),r.loadingTimeout&&m($().data)&&setTimeout(()=>{A&&O()&&S().onLoadingSlow(c,r)},r.loadingTimeout),f[c]=[j(P),Be()]),[R,y]=f[c],R=await R,T&&setTimeout(Ye,r.dedupingInterval),!f[c]||f[c][1]!==y)return T&&O()&&S().onDiscarded(c),!1;B.error=N;const q=v[c];if(!m(q)&&(y<=q[0]||y<=q[1]||q[1]===0))return Je(),T&&O()&&S().onDiscarded(c),!1;const W=$().data;B.data=o(W,R)?W:R,T&&O()&&S().onSuccess(R,c,r)}catch(q){Ye();const W=S(),{shouldRetryOnError:ve}=W;W.isPaused()||(B.error=q,T&&O()&&(W.onError(q,c,W),(ve===!0||V(ve)&&ve(q))&&(!S().revalidateOnFocus||!S().revalidateOnReconnect||Y())&&W.onErrorRetry(q,c,W,Ct=>{const ge=l[c];ge&&ge[0]&&ge[0](ct,Ct)},{retryCount:(re.retryCount||0)+1,dedupe:!0})))}return A=!1,Je(),!0},[c,s]),Qe=x.useCallback((...g)=>bt(s,E.current,...g),[]);if(Re(()=>{I.current=t,J.current=r,m(ne)||(xe.current=ne)}),Re(()=>{if(!c)return;const g=ie.bind(N,ke);let j=0;const y=gs(c,l,(A,re={})=>{if(A==jt){const T=Date.now();S().revalidateOnFocus&&T>j&&Y()&&(j=T+S().focusThrottleInterval,g())}else if(A==wt)S().revalidateOnReconnect&&Y()&&g();else{if(A==yt)return ie();if(A==ct)return ie(re)}});return U.current=!1,E.current=c,oe.current=!0,Z({_k:P}),Ke&&(m(X)||ce?g():ts(g)),()=>{U.current=!0,y()}},[c]),Re(()=>{let g;function j(){const y=V(_)?_($().data):_;y&&g!==-1&&(g=setTimeout(R,y))}function R(){!$().error&&(w||S().isVisible())&&(u||S().isOnline())?ie(ke).then(j):j()}return j(),()=>{g&&(clearTimeout(g),g=-1)}},[_,w,u,c]),x.useDebugValue(fe),i&&m(X)&&c){if(!ut&&ce)throw new Error("Fallback data is required when using Suspense in SSR.");I.current=t,J.current=r,U.current=!1;const g=k[c];if(!m(g)){const j=Qe(g);Le(j)}if(m(de)){const j=ie(ke);m(fe)||(j.status="fulfilled",j.value=!0),Le(j)}else throw de}return{mutate:Qe,get data(){return ee.data=!0,fe},get error(){return ee.error=!0,de},get isValidating(){return ee.isValidating=!0,kt},get isLoading(){return ee.isLoading=!0,It}}},_t=vs(js);class ws extends Error{constructor({message:t,status:r,data:s}){super(t),this.name="TwitterApiError",this.status=r,this.data=s}}const ys=_t.default||_t,Ss="https://react-tweet.vercel.app";async function Ts([e,t]){const r=await fetch(e,t),s=await r.json();if(r.ok)return s.data||null;throw new ws({message:`Failed to fetch tweet at "${e}" with "${r.status}".`,data:s,status:r.status})}const bs=(e,t,r)=>{const{isLoading:s,data:o,error:i}=ys(()=>t||e?[t||e&&`${Ss}/api/tweet/${e}`,r]:null,Ts,{revalidateIfStale:!1,revalidateOnFocus:!1,shouldRetryOnError:!1});return{isLoading:!!(s||o===void 0&&!i),data:o,error:i}},Es=({id:e,apiUrl:t,fallback:r=n.jsx(Fr,{}),components:s,fetchOptions:o,onError:i})=>{const{data:a,error:d,isLoading:p}=bs(e,t,o);if(p)return r;if(d||!a){const _=(s==null?void 0:s.TweetNotFound)||Ar;return n.jsx(_,{error:i?i(d):d})}return n.jsx(qr,{tweet:a,components:s})};function Rs({node:e}){var s;const t=((s=e==null?void 0:e.attrs)==null?void 0:s.src)||"",r=t==null?void 0:t.split("/").pop();return r?n.jsx(M.NodeViewWrapper,{children:n.jsx("div",{"data-twitter":"",children:n.jsx(Es,{id:r})})}):null}function Ot(e){const{t}=qt.useLocale(),[r,s]=x.useState("");x.useEffect(()=>{var i;if(e!=null&&e.editor){const{src:a}=(i=e.editor)==null?void 0:i.getAttributes(Nt.name);a&&s(a)}},[e==null?void 0:e.editor]);function o(i){i.preventDefault(),i.stopPropagation(),e==null||e.onSetLink(r)}return n.jsx("div",{className:"border-neutral-200 richtext-rounded-lg !richtext-border richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:n.jsxs("form",{className:"richtext-flex richtext-flex-col richtext-gap-2",onSubmit:o,children:[n.jsx(H.Label,{className:"mb-[6px]",children:t("editor.link.dialog.text")}),n.jsx("div",{className:"richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:n.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:n.jsx(H.Input,{className:"richtext-w-80",onChange:i=>s(i.target.value),placeholder:"Text",required:!0,type:"text",value:r})})}),n.jsx(H.Button,{className:"richtext-mt-2 richtext-self-end",type:"submit",children:t("editor.link.dialog.button.apply")})]})})}function Os(e){function t(r){e.action&&e.action(r)}return n.jsxs(H.Popover,{modal:!0,children:[n.jsx(H.PopoverTrigger,{disabled:e==null?void 0:e.disabled,asChild:!0,children:n.jsx(H.ActionButton,{tooltip:e==null?void 0:e.tooltip,isActive:e==null?void 0:e.isActive,disabled:e==null?void 0:e.disabled,children:n.jsx(H.IconComponent,{name:e==null?void 0:e.icon})})}),n.jsx(H.PopoverContent,{hideWhenDetached:!0,className:"richtext-w-full",align:"start",side:"bottom",children:n.jsx(Ot,{editor:e.editor,onSetLink:t})})]})}const Ns=/(https?:\/\/)?(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?/g,Ls=/^https?:\/\/(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?$/;function ht(e){return e.match(Ls)}const Nt=je.Node.create({name:"twitter",draggable:!0,selectable:!0,addOptions(){return{addPasteHandler:!0,HTMLAttributes:{},inline:!1,origin:"",button:({editor:e,t})=>({component:Os,componentProps:{action:r=>{e.commands.setTweet({src:r})},isActive:()=>!1,disabled:!1,icon:"Twitter",tooltip:t("editor.twitter.tooltip"),editor:e}})}},addNodeView(){return M.ReactNodeViewRenderer(Rs,{attrs:this.options.HTMLAttributes})},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{src:{default:null}}},parseHTML(){return[{tag:"div[data-twitter]"}]},addCommands(){return{setTweet:e=>({commands:t})=>ht(e.src)?t.insertContent({type:this.name,attrs:e}):!1,updateTweet:e=>({commands:t})=>ht(e.src)?t.updateAttributes(this.name,{src:e.src}):!1}},addPasteRules(){return this.options.addPasteHandler?[je.nodePasteRule({find:Ns,type:this.type,getAttributes:e=>({src:e.input})})]:[]},renderHTML({HTMLAttributes:e}){return["div",je.mergeAttributes({"data-twitter":""},e)]}});exports.FormEditLinkTwitter=Ot;exports.Twitter=Nt;
|
|
17
|
+
*/var it;function Ur(){return it||(it=1,process.env.NODE_ENV!=="production"&&function(){function e(l,v){return l===v&&(l!==0||1/l===1/v)||l!==l&&v!==v}function t(l,v){w||o.startTransition===void 0||(w=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var f=v();if(!u){var k=v();i(f,k)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0)}k=a({inst:{value:f,getSnapshot:v}});var c=k[0].inst,P=k[1];return p(function(){c.value=f,c.getSnapshot=v,r(c)&&P({inst:c})},[l,f,v]),d(function(){return r(c)&&P({inst:c}),l(function(){r(c)&&P({inst:c})})},[l]),_(f),f}function r(l){var v=l.getSnapshot;l=l.value;try{var f=v();return!i(l,f)}catch{return!0}}function s(l,v){return v()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=x,i=typeof Object.is=="function"?Object.is:e,a=o.useState,d=o.useEffect,p=o.useLayoutEffect,_=o.useDebugValue,w=!1,u=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?s:t;be.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),be}var at;function Hr(){return at||(at=1,process.env.NODE_ENV==="production"?he.exports=Pr():he.exports=Ur()),he.exports}var zr=Hr();const jt=0,wt=1,yt=2,ct=3;var lt=Object.prototype.hasOwnProperty;function Ce(e,t){var r,s;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((s=e.length)===t.length)for(;s--&&Ce(e[s],t[s]););return s===-1}if(!r||typeof e=="object"){s=0;for(r in e)if(lt.call(e,r)&&++s&&!lt.call(t,r)||!(r in t)||!Ce(e[r],t[r]))return!1;return Object.keys(t).length===s}}return e!==e&&t!==t}const F=new WeakMap,z=()=>{},N=z(),qe=Object,m=e=>e===N,V=e=>typeof e=="function",G=(e,t)=>({...e,...t}),St=e=>V(e.then),Ee={},me={},Pe="undefined",le=typeof window!=Pe,De=typeof document!=Pe,Gr=le&&"Deno"in window,Kr=()=>le&&typeof window.requestAnimationFrame!=Pe,Tt=(e,t)=>{const r=F.get(e);return[()=>!m(t)&&e.get(t)||Ee,s=>{if(!m(t)){const o=e.get(t);t in me||(me[t]=o),r[5](t,G(o,s),o||Ee)}},r[6],()=>!m(t)&&t in me?me[t]:!m(t)&&e.get(t)||Ee]};let $e=!0;const Xr=()=>$e,[Ae,Ve]=le&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[z,z],Qr=()=>{const e=De&&document.visibilityState;return m(e)||e!=="hidden"},Jr=e=>(De&&document.addEventListener("visibilitychange",e),Ae("focus",e),()=>{De&&document.removeEventListener("visibilitychange",e),Ve("focus",e)}),Yr=e=>{const t=()=>{$e=!0,e()},r=()=>{$e=!1};return Ae("online",t),Ae("offline",r),()=>{Ve("online",t),Ve("offline",r)}},Zr={isOnline:Xr,isVisible:Qr},es={initFocus:Jr,initReconnect:Yr},ut=!x.useId,ce=!le||Gr,ts=e=>Kr()?window.requestAnimationFrame(e):setTimeout(e,1),Re=ce?x.useEffect:x.useLayoutEffect,Oe=typeof navigator<"u"&&navigator.connection,dt=!ce&&Oe&&(["slow-2g","2g"].includes(Oe.effectiveType)||Oe.saveData),pe=new WeakMap,Ne=(e,t)=>qe.prototype.toString.call(e)===`[object ${t}]`;let ns=0;const Me=e=>{const t=typeof e,r=Ne(e,"Date"),s=Ne(e,"RegExp"),o=Ne(e,"Object");let i,a;if(qe(e)===e&&!r&&!s){if(i=pe.get(e),i)return i;if(i=++ns+"~",pe.set(e,i),Array.isArray(e)){for(i="@",a=0;a<e.length;a++)i+=Me(e[a])+",";pe.set(e,i)}if(o){i="#";const d=qe.keys(e).sort();for(;!m(a=d.pop());)m(e[a])||(i+=a+":"+Me(e[a])+",");pe.set(e,i)}}else i=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},Ue=e=>{if(V(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Me(e):"",[e,t]};let rs=0;const Be=()=>++rs;async function bt(...e){const[t,r,s,o]=e,i=G({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let a=i.populateCache;const d=i.rollbackOnError;let p=i.optimisticData;const _=h=>typeof d=="function"?d(h):d!==!1,w=i.throwOnError;if(V(r)){const h=r,l=[],v=t.keys();for(const f of v)!/^\$(inf|sub)\$/.test(f)&&h(t.get(f)._k)&&l.push(f);return Promise.all(l.map(u))}return u(r);async function u(h){const[l]=Ue(h);if(!l)return;const[v,f]=Tt(t,l),[k,c,P,oe]=F.get(t),U=()=>{const D=k[l];return(V(i.revalidate)?i.revalidate(v().data,h):i.revalidate!==!1)&&(delete P[l],delete oe[l],D&&D[0])?D[0](yt).then(()=>v().data):v().data};if(e.length<3)return U();let E=s,I;const J=Be();c[l]=[J,0];const S=!m(p),Y=v(),$=Y.data,Z=Y._c,K=m(Z)?$:Z;if(S&&(p=V(p)?p(K,$):p,f({data:p,_c:K})),V(E))try{E=E(K)}catch(D){I=D}if(E&&St(E))if(E=await E.catch(D=>{I=D}),J!==c[l][0]){if(I)throw I;return E}else I&&S&&_(I)&&(a=!0,f({data:K,_c:N}));if(a&&!I)if(V(a)){const D=a(E,K);f({data:D,error:N,_c:N})}else f({data:E,error:N,_c:N});if(c[l][1]=Be(),Promise.resolve(U()).then(()=>{f({_c:N})}),I){if(w)throw I;return}return E}}const ft=(e,t)=>{for(const r in e)e[r][0]&&e[r][0](t)},ss=(e,t)=>{if(!F.has(e)){const r=G(es,t),s={},o=bt.bind(N,e);let i=z;const a={},d=(w,u)=>{const h=a[w]||[];return a[w]=h,h.push(u),()=>h.splice(h.indexOf(u),1)},p=(w,u,h)=>{e.set(w,u);const l=a[w];if(l)for(const v of l)v(u,h)},_=()=>{if(!F.has(e)&&(F.set(e,[s,{},{},{},o,p,d]),!ce)){const w=r.initFocus(setTimeout.bind(N,ft.bind(N,s,jt))),u=r.initReconnect(setTimeout.bind(N,ft.bind(N,s,wt)));i=()=>{w&&w(),u&&u(),F.delete(e)}}};return _(),[e,o,_,i]}return[e,F.get(e)[4]]},os=(e,t,r,s,o)=>{const i=r.errorRetryCount,a=o.retryCount,d=~~((Math.random()+.5)*(1<<(a<8?a:8)))*r.errorRetryInterval;!m(i)&&a>i||setTimeout(s,d,o)},is=Ce,[Et,as]=ss(new Map),cs=G({onLoadingSlow:z,onSuccess:z,onError:z,onErrorRetry:os,onDiscarded:z,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:dt?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:dt?5e3:3e3,compare:is,isPaused:()=>!1,cache:Et,mutate:as,fallback:{}},Zr),ls=(e,t)=>{const r=G(e,t);if(t){const{use:s,fallback:o}=e,{use:i,fallback:a}=t;s&&i&&(r.use=s.concat(i)),o&&a&&(r.fallback=G(o,a))}return r},us=x.createContext({}),ds="$inf$",Rt=le&&window.__SWR_DEVTOOLS_USE__,fs=Rt?window.__SWR_DEVTOOLS_USE__:[],_s=()=>{Rt&&(window.__SWR_DEVTOOLS_REACT__=x)},hs=e=>V(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],ms=()=>G(cs,x.useContext(us)),ps=e=>(t,r,s)=>e(t,r&&((...i)=>{const[a]=Ue(t),[,,,d]=F.get(Et);if(a.startsWith(ds))return r(...i);const p=d[a];return m(p)?r(...i):(delete d[a],p)}),s),xs=fs.concat(ps),vs=e=>function(...r){const s=ms(),[o,i,a]=hs(r),d=ls(s,a);let p=e;const{use:_}=d,w=(_||[]).concat(xs);for(let u=w.length;u--;)p=w[u](p);return p(o,i||d.fetcher||null,d)},gs=(e,t,r)=>{const s=t[e]||(t[e]=[]);return s.push(r),()=>{const o=s.indexOf(r);o>=0&&(s[o]=s[s.length-1],s.pop())}};_s();const Le=x.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),ke={dedupe:!0},js=(e,t,r)=>{const{cache:s,compare:o,suspense:i,fallbackData:a,revalidateOnMount:d,revalidateIfStale:p,refreshInterval:_,refreshWhenHidden:w,refreshWhenOffline:u,keepPreviousData:h}=r,[l,v,f,k]=F.get(s),[c,P]=Ue(e),oe=x.useRef(!1),U=x.useRef(!1),E=x.useRef(c),I=x.useRef(t),J=x.useRef(r),S=()=>J.current,Y=()=>S().isVisible()&&S().isOnline(),[$,Z,K,D]=Tt(s,c),ee=x.useRef({}).current,ue=m(a)?m(r.fallback)?N:r.fallback[c]:a,He=(g,j)=>{for(const R in ee){const y=R;if(y==="data"){if(!o(g[y],j[y])&&(!m(g[y])||!o(fe,j[y])))return!1}else if(j[y]!==g[y])return!1}return!0},ze=x.useMemo(()=>{const g=!c||!t?!1:m(d)?S().isPaused()||i?!1:p!==!1:d,j=O=>{const B=G(O);return delete B._k,g?{isValidating:!0,isLoading:!0,...B}:B},R=$(),y=D(),A=j(R),re=R===y?A:j(y);let T=A;return[()=>{const O=j($());return He(O,T)?(T.data=O.data,T.isLoading=O.isLoading,T.isValidating=O.isValidating,T.error=O.error,T):(T=O,O)},()=>re]},[s,c]),te=zr.useSyncExternalStore(x.useCallback(g=>K(c,(j,R)=>{He(R,j)||g()}),[s,c]),ze[0],ze[1]),Ge=!oe.current,Lt=l[c]&&l[c].length>0,ne=te.data,X=m(ne)?ue&&St(ue)?Le(ue):ue:ne,de=te.error,xe=x.useRef(X),fe=h?m(ne)?m(xe.current)?X:xe.current:ne:X,Ke=Lt&&!m(de)?!1:Ge&&!m(d)?d:S().isPaused()?!1:i?m(X)?!1:p:m(X)||p,Xe=!!(c&&t&&Ge&&Ke),kt=m(te.isValidating)?Xe:te.isValidating,It=m(te.isLoading)?Xe:te.isLoading,ie=x.useCallback(async g=>{const j=I.current;if(!c||!j||U.current||S().isPaused())return!1;let R,y,A=!0;const re=g||{},T=!f[c]||!re.dedupe,O=()=>ut?!U.current&&c===E.current&&oe.current:c===E.current,B={isValidating:!1,isLoading:!1},Je=()=>{Z(B)},Ye=()=>{const q=f[c];q&&q[1]===y&&delete f[c]},Ze={isValidating:!0};m($().data)&&(Ze.isLoading=!0);try{if(T&&(Z(Ze),r.loadingTimeout&&m($().data)&&setTimeout(()=>{A&&O()&&S().onLoadingSlow(c,r)},r.loadingTimeout),f[c]=[j(P),Be()]),[R,y]=f[c],R=await R,T&&setTimeout(Ye,r.dedupingInterval),!f[c]||f[c][1]!==y)return T&&O()&&S().onDiscarded(c),!1;B.error=N;const q=v[c];if(!m(q)&&(y<=q[0]||y<=q[1]||q[1]===0))return Je(),T&&O()&&S().onDiscarded(c),!1;const W=$().data;B.data=o(W,R)?W:R,T&&O()&&S().onSuccess(R,c,r)}catch(q){Ye();const W=S(),{shouldRetryOnError:ve}=W;W.isPaused()||(B.error=q,T&&O()&&(W.onError(q,c,W),(ve===!0||V(ve)&&ve(q))&&(!S().revalidateOnFocus||!S().revalidateOnReconnect||Y())&&W.onErrorRetry(q,c,W,Ct=>{const ge=l[c];ge&&ge[0]&&ge[0](ct,Ct)},{retryCount:(re.retryCount||0)+1,dedupe:!0})))}return A=!1,Je(),!0},[c,s]),Qe=x.useCallback((...g)=>bt(s,E.current,...g),[]);if(Re(()=>{I.current=t,J.current=r,m(ne)||(xe.current=ne)}),Re(()=>{if(!c)return;const g=ie.bind(N,ke);let j=0;const y=gs(c,l,(A,re={})=>{if(A==jt){const T=Date.now();S().revalidateOnFocus&&T>j&&Y()&&(j=T+S().focusThrottleInterval,g())}else if(A==wt)S().revalidateOnReconnect&&Y()&&g();else{if(A==yt)return ie();if(A==ct)return ie(re)}});return U.current=!1,E.current=c,oe.current=!0,Z({_k:P}),Ke&&(m(X)||ce?g():ts(g)),()=>{U.current=!0,y()}},[c]),Re(()=>{let g;function j(){const y=V(_)?_($().data):_;y&&g!==-1&&(g=setTimeout(R,y))}function R(){!$().error&&(w||S().isVisible())&&(u||S().isOnline())?ie(ke).then(j):j()}return j(),()=>{g&&(clearTimeout(g),g=-1)}},[_,w,u,c]),x.useDebugValue(fe),i&&m(X)&&c){if(!ut&&ce)throw new Error("Fallback data is required when using Suspense in SSR.");I.current=t,J.current=r,U.current=!1;const g=k[c];if(!m(g)){const j=Qe(g);Le(j)}if(m(de)){const j=ie(ke);m(fe)||(j.status="fulfilled",j.value=!0),Le(j)}else throw de}return{mutate:Qe,get data(){return ee.data=!0,fe},get error(){return ee.error=!0,de},get isValidating(){return ee.isValidating=!0,kt},get isLoading(){return ee.isLoading=!0,It}}},_t=vs(js);class ws extends Error{constructor({message:t,status:r,data:s}){super(t),this.name="TwitterApiError",this.status=r,this.data=s}}const ys=_t.default||_t,Ss="https://react-tweet.vercel.app";async function Ts([e,t]){const r=await fetch(e,t),s=await r.json();if(r.ok)return s.data||null;throw new ws({message:`Failed to fetch tweet at "${e}" with "${r.status}".`,data:s,status:r.status})}const bs=(e,t,r)=>{const{isLoading:s,data:o,error:i}=ys(()=>t||e?[t||e&&`${Ss}/api/tweet/${e}`,r]:null,Ts,{revalidateIfStale:!1,revalidateOnFocus:!1,shouldRetryOnError:!1});return{isLoading:!!(s||o===void 0&&!i),data:o,error:i}},Es=({id:e,apiUrl:t,fallback:r=n.jsx(Fr,{}),components:s,fetchOptions:o,onError:i})=>{const{data:a,error:d,isLoading:p}=bs(e,t,o);if(p)return r;if(d||!a){const _=(s==null?void 0:s.TweetNotFound)||Ar;return n.jsx(_,{error:i?i(d):d})}return n.jsx(qr,{tweet:a,components:s})};function Rs({node:e}){var s;const t=((s=e==null?void 0:e.attrs)==null?void 0:s.src)||"",r=t==null?void 0:t.split("/").pop();return r?n.jsx(M.NodeViewWrapper,{children:n.jsx("div",{"data-twitter":"",children:n.jsx(Es,{id:r})})}):null}function Ot(e){const{t}=qt.useLocale(),[r,s]=x.useState("");x.useEffect(()=>{var i;if(e!=null&&e.editor){const{src:a}=(i=e.editor)==null?void 0:i.getAttributes(Nt.name);a&&s(a)}},[e==null?void 0:e.editor]);function o(i){i.preventDefault(),i.stopPropagation(),e==null||e.onSetLink(r)}return n.jsx("div",{className:"border-neutral-200 richtext-rounded-lg !richtext-border richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:n.jsxs("form",{className:"richtext-flex richtext-flex-col richtext-gap-2",onSubmit:o,children:[n.jsx(H.Label,{className:"mb-[6px]",children:t("editor.link.dialog.text")}),n.jsx("div",{className:"richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:n.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:n.jsx(H.Input,{className:"richtext-w-80",onChange:i=>s(i.target.value),placeholder:"Text",required:!0,type:"text",value:r})})}),n.jsx(H.Button,{className:"richtext-mt-2 richtext-self-end",type:"submit",children:t("editor.link.dialog.button.apply")})]})})}function Os(e){function t(r){e.action&&e.action(r)}return n.jsxs(H.Popover,{modal:!0,children:[n.jsx(H.PopoverTrigger,{disabled:e==null?void 0:e.disabled,asChild:!0,children:n.jsx(H.ActionButton,{tooltip:e==null?void 0:e.tooltip,tooltipOptions:e==null?void 0:e.tooltipOptions,isActive:e==null?void 0:e.isActive,disabled:e==null?void 0:e.disabled,children:n.jsx(H.IconComponent,{name:e==null?void 0:e.icon})})}),n.jsx(H.PopoverContent,{hideWhenDetached:!0,className:"richtext-w-full",align:"start",side:"bottom",children:n.jsx(Ot,{editor:e.editor,onSetLink:t})})]})}const Ns=/(https?:\/\/)?(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?/g,Ls=/^https?:\/\/(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?$/;function ht(e){return e.match(Ls)}const Nt=je.Node.create({name:"twitter",draggable:!0,selectable:!0,addOptions(){return{addPasteHandler:!0,HTMLAttributes:{},inline:!1,origin:"",button:({editor:e,t})=>({component:Os,componentProps:{action:r=>{e.commands.setTweet({src:r})},isActive:()=>!1,disabled:!1,icon:"Twitter",tooltip:t("editor.twitter.tooltip"),editor:e}})}},addNodeView(){return M.ReactNodeViewRenderer(Rs,{attrs:this.options.HTMLAttributes})},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{src:{default:null}}},parseHTML(){return[{tag:"div[data-twitter]"}]},addCommands(){return{setTweet:e=>({commands:t})=>ht(e.src)?t.insertContent({type:this.name,attrs:e}):!1,updateTweet:e=>({commands:t})=>ht(e.src)?t.updateAttributes(this.name,{src:e.src}):!1}},addPasteRules(){return this.options.addPasteHandler?[je.nodePasteRule({find:Ns,type:this.type,getAttributes:e=>({src:e.input})})]:[]},renderHTML({HTMLAttributes:e}){return["div",je.mergeAttributes({"data-twitter":""},e)]}});exports.FormEditLinkTwitter=Ot;exports.Twitter=Nt;
|
package/lib/Twitter.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-ByRfqzMr.cjs");require("./dom-dataset-Byuf1YmW.cjs");const e=require("./Twitter-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-ByRfqzMr.cjs");require("./dom-dataset-Byuf1YmW.cjs");const e=require("./Twitter-BvfvUtNT.cjs");exports.Twitter=e.Twitter;
|
package/lib/Twitter.d.cts
CHANGED
|
@@ -136,6 +136,21 @@ declare module '@tiptap/core' {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
|
|
139
|
+
declare module '@tiptap/core' {
|
|
140
|
+
interface Commands<ReturnType> {
|
|
141
|
+
iframe: {
|
|
142
|
+
/**
|
|
143
|
+
* Add an iframe
|
|
144
|
+
*/
|
|
145
|
+
setIframe: (options: {
|
|
146
|
+
src: string;
|
|
147
|
+
service: string;
|
|
148
|
+
}) => ReturnType;
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
|
|
139
154
|
declare module '@tiptap/core' {
|
|
140
155
|
interface Commands<ReturnType> {
|
|
141
156
|
imageUpload: {
|
|
@@ -156,21 +171,6 @@ declare module '@tiptap/core' {
|
|
|
156
171
|
}
|
|
157
172
|
|
|
158
173
|
|
|
159
|
-
declare module '@tiptap/core' {
|
|
160
|
-
interface Commands<ReturnType> {
|
|
161
|
-
iframe: {
|
|
162
|
-
/**
|
|
163
|
-
* Add an iframe
|
|
164
|
-
*/
|
|
165
|
-
setIframe: (options: {
|
|
166
|
-
src: string;
|
|
167
|
-
service: string;
|
|
168
|
-
}) => ReturnType;
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
174
174
|
declare module '@tiptap/core' {
|
|
175
175
|
interface Commands<ReturnType> {
|
|
176
176
|
imageGifUpload: {
|