reactjs-tiptap-editor 1.0.7 → 1.0.9
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-fTe9ka2F.js → ActionMenuButton-C4aNFFa8.js} +2 -2
- package/lib/{ActionMenuButton-wU6jxKJv.cjs → ActionMenuButton-CmDopTWt.cjs} +1 -1
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.js +3 -3
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.js +3 -3
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +3 -3
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +3 -3
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +3 -3
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +3 -3
- package/lib/CodeBlock.cjs +39 -39
- package/lib/CodeBlock.js +945 -837
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +3 -3
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +8 -8
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +3 -3
- package/lib/{Drawer-BGSwHoka.cjs → Drawer-CTr2snNd.cjs} +1 -1
- package/lib/{Drawer-DmtILKW4.js → Drawer-DG0gPU_U.js} +14 -14
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +3 -3
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +15 -15
- package/lib/{Excalidraw-CrG8fW-7.js → Excalidraw-DpgdxOsc.js} +18 -18
- package/lib/{Excalidraw-BG2U9i30.cjs → Excalidraw-DtezFdjR.cjs} +1 -1
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +2 -2
- package/lib/ExportPdf.cjs +2 -2
- package/lib/ExportPdf.js +26 -26
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +3 -3
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +5 -5
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +5 -5
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +13 -13
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +8 -8
- package/lib/History.cjs +1 -1
- package/lib/History.js +4 -4
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +3 -3
- package/lib/{Icon-CysGlJkv.js → Icon-C_buGjWy.js} +1 -1
- package/lib/{Icon-C3j4ls73.cjs → Icon-b6HQAURz.cjs} +1 -1
- package/lib/{Iframe-CXDghI6m.cjs → Iframe-CUrXCDxj.cjs} +1 -1
- package/lib/{Iframe-BmqguWbj.js → Iframe-De88TYvj.js} +11 -11
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +2 -2
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +46 -46
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +9 -9
- package/lib/ImportWord.cjs +2 -2
- package/lib/ImportWord.js +8 -8
- package/lib/{Indent-BhnGkEaY.js → Indent-Bensb2nf.js} +3 -3
- package/lib/{Indent-B1glTHHl.cjs → Indent-D_KtZNHW.cjs} +1 -1
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +3 -3
- package/lib/{Katex-D4eBjS34.js → Katex-C0dtqznb.js} +974 -941
- package/lib/Katex-NqelWRoi.cjs +4 -0
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +2 -2
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +13 -13
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/{LinkEditBlock-DW17TyCA.cjs → LinkEditBlock-BSZ-vgNB.cjs} +2 -2
- package/lib/{LinkEditBlock-D1eSM0kn.js → LinkEditBlock-Bv12sKvW.js} +29 -29
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.js +138 -132
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.js +20 -20
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +12 -12
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +3 -3
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +20 -20
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +14 -14
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +3 -3
- package/lib/{Table-BIZppoiY.js → Table-D9ckv6Tb.js} +5 -5
- package/lib/{Table-CIzgfvr9.cjs → Table-cy1mUM2X.cjs} +1 -1
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +3 -3
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +10 -10
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +10 -10
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +3 -3
- package/lib/Twitter-Bvs3sW8F.cjs +1 -0
- package/lib/{Twitter-DhczYjbR.js → Twitter-KUvyySA0.js} +566 -524
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +2 -2
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +22 -22
- package/lib/bubble.cjs +4 -4
- package/lib/bubble.js +1342 -1314
- package/lib/{button-C81t4pb1.js → button-D8SI-g7p.js} +1 -1
- package/lib/{button-B6ukqDUf.cjs → button-U6XpZt2X.cjs} +1 -1
- package/lib/{checkbox-ZdxysUFa.cjs → checkbox-DaIBNthL.cjs} +1 -1
- package/lib/{checkbox-CUE9ex4D.js → checkbox-xrY2c5yo.js} +1 -1
- package/lib/{dialog-Cfx8yjkr.cjs → dialog-DgnnVCfv.cjs} +1 -1
- package/lib/{dialog-DMJStzBb.js → dialog-DjnkASYP.js} +1 -1
- package/lib/{dropdown-menu-Busg3FNn.cjs → dropdown-menu-BvVMltdB.cjs} +1 -1
- package/lib/{dropdown-menu-B8iyTZcP.js → dropdown-menu-bI14Gyw4.js} +1 -1
- package/lib/extensions/Katex/Katex.d.ts +1 -1
- package/lib/extensions/Mention/Mention.d.ts +3 -1
- package/lib/extensions/Mention/components/NodeViewMentionList.d.ts +7 -1
- package/lib/{index-DCJheRBq.cjs → index--nUS7Y66.cjs} +1 -1
- package/lib/{index--knBGB61.js → index-4pRt5Vqu.js} +680 -791
- package/lib/{index-DLqogznp.cjs → index-BBNITgNi.cjs} +7 -7
- package/lib/{index-ccgHvIfu.js → index-BQ6ZdLsu.js} +1 -1
- package/lib/{index-DylewabB.cjs → index-BZ6DfR2r.cjs} +1 -1
- package/lib/{index-Dwt9--mS.js → index-BimeTI7q.js} +1 -1
- package/lib/{index-TMqmkmT6.cjs → index-CApXPpjF.cjs} +1 -1
- package/lib/{index-BvYjBPF9.js → index-CbIQPoF6.js} +12 -11
- package/lib/index-DvvMf6Wu.cjs +7 -0
- package/lib/{index-RKufd2EL.js → index-EKFybgpP.js} +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.js +2 -2
- package/lib/{input-BxzQAIRv.cjs → input-BtDj0NeF.cjs} +1 -1
- package/lib/{input-DR_5pbuA.js → input-C5zU49Q1.js} +1 -1
- package/lib/{isNumber-1y3eeW-y.js → isNumber-8HKEgTkA.js} +1 -1
- package/lib/{isNumber-C2saEiG2.cjs → isNumber-Bv1Qhmw8.cjs} +1 -1
- package/lib/{label-D-0oXKCn.js → label-BEUVs-IA.js} +1 -1
- package/lib/{label-BfWfLggp.cjs → label-C8BonzOY.cjs} +1 -1
- package/lib/{popover-D3spkemr.js → popover-CPY5lMCj.js} +1 -1
- package/lib/{popover-sP8CwbV-.cjs → popover-DjL0De8d.cjs} +1 -1
- package/lib/{separator-rM48NeAo.js → separator-BlIlS7LP.js} +18 -18
- package/lib/{separator-yycaNdlI.cjs → separator-BzMkiI_c.cjs} +1 -1
- package/lib/{store-BajRl43v.cjs → store-BSCjQxMK.cjs} +1 -1
- package/lib/{store-NKeQOve_.js → store-D_GvIPxo.js} +1 -1
- package/lib/style.css +1 -1
- package/lib/{tabs-D2nCIOVL.cjs → tabs-CHy82_rs.cjs} +1 -1
- package/lib/{tabs-Cb6Bmpbb.js → tabs-tQpXIzfV.js} +1 -1
- package/lib/{textarea-Cbwi_h4h.cjs → textarea-B-qfanCT.cjs} +1 -1
- package/lib/{textarea-BYZu1lUC.js → textarea-CMDYVXYo.js} +1 -1
- package/lib/{throttle-CjwXmkIY.js → throttle-BIkZV3Y_.js} +1 -1
- package/lib/{throttle-DXN-aiH5.cjs → throttle-BM3Bmbf_.cjs} +1 -1
- package/lib/{updatePosition-BAGpT34H.js → updatePosition-GLTrgcib.js} +1 -1
- package/lib/{updatePosition-C17CDdjq.cjs → updatePosition-u2mTh3mG.cjs} +1 -1
- package/lib/{useButtonProps-TfmRCM9r.cjs → useButtonProps-BqBGuqoP.cjs} +1 -1
- package/lib/{useButtonProps-BIH_9bXT.js → useButtonProps-DTngjZge.js} +2 -2
- package/package.json +55 -55
- package/lib/Katex-BKL_6NWF.cjs +0 -4
- package/lib/Twitter-DwWVNAV5.cjs +0 -1
- package/lib/index-D42xFOzI.cjs +0 -7
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { C as U, aa as rt, s as
|
|
2
|
-
import { jsx as r, jsxs as h, Fragment as
|
|
3
|
-
import Be, { useState as se, Fragment as
|
|
4
|
-
import { A as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
const
|
|
13
|
-
verified:
|
|
14
|
-
},
|
|
1
|
+
import { C as U, aa as rt, s as Mt, N as jt, m as Wt, ab as Bt, R as Ft } from "./index-CbIQPoF6.js";
|
|
2
|
+
import { jsx as r, jsxs as h, Fragment as Pt } from "react/jsx-runtime";
|
|
3
|
+
import Be, { useState as se, Fragment as Ut, useEffect as Fe, useMemo as Pe, createContext as zt, useLayoutEffect as Ht, useContext as Gt, useRef as K, useCallback as Te, useDebugValue as Xt } from "react";
|
|
4
|
+
import { A as Kt } from "./index-4pRt5Vqu.js";
|
|
5
|
+
import { u as Qt } from "./index-0OnGZkVF.js";
|
|
6
|
+
import { L as Jt } from "./label-BEUVs-IA.js";
|
|
7
|
+
import { I as Yt } from "./input-C5zU49Q1.js";
|
|
8
|
+
import { B as Zt } from "./button-D8SI-g7p.js";
|
|
9
|
+
import { c as en, u as tn, a as nn } from "./useButtonProps-DTngjZge.js";
|
|
10
|
+
import { P as rn, a as on, b as an } from "./popover-CPY5lMCj.js";
|
|
11
|
+
import { I as sn } from "./Icon-C_buGjWy.js";
|
|
12
|
+
const cn = "_verified_lvyh0_1", Ue = {
|
|
13
|
+
verified: cn
|
|
14
|
+
}, ln = () => /* @__PURE__ */ r("svg", {
|
|
15
15
|
viewBox: "0 0 24 24",
|
|
16
16
|
"aria-label": "Verified account",
|
|
17
17
|
role: "img",
|
|
@@ -21,7 +21,7 @@ const sn = "_verified_lvyh0_1", Ue = {
|
|
|
21
21
|
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"
|
|
22
22
|
})
|
|
23
23
|
})
|
|
24
|
-
}),
|
|
24
|
+
}), dn = () => /* @__PURE__ */ r("svg", {
|
|
25
25
|
viewBox: "0 0 22 22",
|
|
26
26
|
"aria-label": "Verified account",
|
|
27
27
|
role: "img",
|
|
@@ -100,7 +100,7 @@ const sn = "_verified_lvyh0_1", Ue = {
|
|
|
100
100
|
})
|
|
101
101
|
]
|
|
102
102
|
})
|
|
103
|
-
}),
|
|
103
|
+
}), un = () => /* @__PURE__ */ r("svg", {
|
|
104
104
|
viewBox: "0 0 22 22",
|
|
105
105
|
"aria-label": "Verified account",
|
|
106
106
|
role: "img",
|
|
@@ -112,9 +112,9 @@ const sn = "_verified_lvyh0_1", Ue = {
|
|
|
112
112
|
fillRule: "evenodd"
|
|
113
113
|
})
|
|
114
114
|
})
|
|
115
|
-
}),
|
|
116
|
-
root:
|
|
117
|
-
article:
|
|
115
|
+
}), fn = "_root_98iqw_1", hn = "_article_98iqw_21", ot = {
|
|
116
|
+
root: fn,
|
|
117
|
+
article: hn
|
|
118
118
|
}, ze = ({ className: e, children: t }) => /* @__PURE__ */ r("div", {
|
|
119
119
|
className: U("react-tweet-theme", ot.root, e),
|
|
120
120
|
children: /* @__PURE__ */ r("article", {
|
|
@@ -123,46 +123,60 @@ const sn = "_verified_lvyh0_1", Ue = {
|
|
|
123
123
|
})
|
|
124
124
|
}), vt = (e) => /* @__PURE__ */ r("img", {
|
|
125
125
|
...e
|
|
126
|
-
}),
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
avatarSquare: mn,
|
|
131
|
-
avatarShadow: pn,
|
|
132
|
-
author: vn,
|
|
133
|
-
authorLink: gn,
|
|
134
|
-
authorVerified: wn,
|
|
135
|
-
authorLinkText: yn,
|
|
136
|
-
authorMeta: Tn,
|
|
137
|
-
authorFollow: bn,
|
|
138
|
-
username: xn,
|
|
139
|
-
follow: Nn,
|
|
140
|
-
separator: Rn,
|
|
141
|
-
brand: In,
|
|
142
|
-
twitterIcon: kn
|
|
143
|
-
}, Sn = "_verifiedOld_lcna5_1", En = "_verifiedBlue_lcna5_4", Cn = "_verifiedGovernment_lcna5_7", xe = {
|
|
144
|
-
verifiedOld: Sn,
|
|
145
|
-
verifiedBlue: En,
|
|
146
|
-
verifiedGovernment: Cn
|
|
126
|
+
}), _n = "_verifiedOld_lcna5_1", mn = "_verifiedBlue_lcna5_4", pn = "_verifiedGovernment_lcna5_7", xe = {
|
|
127
|
+
verifiedOld: _n,
|
|
128
|
+
verifiedBlue: mn,
|
|
129
|
+
verifiedGovernment: pn
|
|
147
130
|
}, gt = ({ user: e, className: t }) => {
|
|
148
131
|
const n = e.verified || e.is_blue_verified || e.verified_type;
|
|
149
|
-
let o = /* @__PURE__ */ r(
|
|
132
|
+
let o = /* @__PURE__ */ r(ln, {}), a = xe.verifiedBlue;
|
|
150
133
|
if (n)
|
|
151
|
-
switch (e.is_blue_verified || (
|
|
134
|
+
switch (e.is_blue_verified || (a = xe.verifiedOld), e.verified_type) {
|
|
152
135
|
case "Government":
|
|
153
|
-
o = /* @__PURE__ */ r(
|
|
136
|
+
o = /* @__PURE__ */ r(un, {}), a = xe.verifiedGovernment;
|
|
154
137
|
break;
|
|
155
138
|
case "Business":
|
|
156
|
-
o = /* @__PURE__ */ r(
|
|
139
|
+
o = /* @__PURE__ */ r(dn, {}), a = null;
|
|
157
140
|
break;
|
|
158
141
|
}
|
|
159
142
|
return n ? /* @__PURE__ */ r("div", {
|
|
160
|
-
className: U(t,
|
|
143
|
+
className: U(t, a),
|
|
161
144
|
children: o
|
|
162
145
|
}) : null;
|
|
163
|
-
},
|
|
146
|
+
}, vn = "_label_36ucz_1", gn = {
|
|
147
|
+
label: vn
|
|
148
|
+
}, wt = ({ user: e, className: t }) => {
|
|
164
149
|
var n;
|
|
165
|
-
const o =
|
|
150
|
+
const o = e.highlighted_label;
|
|
151
|
+
if (!o) return null;
|
|
152
|
+
const a = (n = o.badge) == null ? void 0 : n.url;
|
|
153
|
+
return a ? /* @__PURE__ */ r("div", {
|
|
154
|
+
className: U(gn.label, t),
|
|
155
|
+
children: /* @__PURE__ */ r("img", {
|
|
156
|
+
src: a,
|
|
157
|
+
alt: o.description
|
|
158
|
+
})
|
|
159
|
+
}) : null;
|
|
160
|
+
}, wn = "_header_nqq4j_1", yn = "_avatar_nqq4j_11", bn = "_avatarOverflow_nqq4j_16", Tn = "_avatarSquare_nqq4j_23", xn = "_avatarShadow_nqq4j_26", Nn = "_author_nqq4j_37", In = "_authorLink_nqq4j_44", Rn = "_authorVerified_nqq4j_53", Sn = "_authorLinkText_nqq4j_56", kn = "_authorMeta_nqq4j_63", En = "_authorFollow_nqq4j_66", Cn = "_username_nqq4j_69", On = "_follow_nqq4j_74", Ln = "_separator_nqq4j_82", $n = "_brand_nqq4j_86", qn = "_twitterIcon_nqq4j_90", N = {
|
|
161
|
+
header: wn,
|
|
162
|
+
avatar: yn,
|
|
163
|
+
avatarOverflow: bn,
|
|
164
|
+
avatarSquare: Tn,
|
|
165
|
+
avatarShadow: xn,
|
|
166
|
+
author: Nn,
|
|
167
|
+
authorLink: In,
|
|
168
|
+
authorVerified: Rn,
|
|
169
|
+
authorLinkText: Sn,
|
|
170
|
+
authorMeta: kn,
|
|
171
|
+
authorFollow: En,
|
|
172
|
+
username: Cn,
|
|
173
|
+
follow: On,
|
|
174
|
+
separator: Ln,
|
|
175
|
+
brand: $n,
|
|
176
|
+
twitterIcon: qn
|
|
177
|
+
}, Dn = ({ tweet: e, components: t }) => {
|
|
178
|
+
var n;
|
|
179
|
+
const o = (n = t == null ? void 0 : t.AvatarImg) != null ? n : vt, { user: a } = e;
|
|
166
180
|
return /* @__PURE__ */ h("div", {
|
|
167
181
|
className: N.header,
|
|
168
182
|
children: [
|
|
@@ -173,10 +187,10 @@ const sn = "_verified_lvyh0_1", Ue = {
|
|
|
173
187
|
rel: "noopener noreferrer",
|
|
174
188
|
children: [
|
|
175
189
|
/* @__PURE__ */ r("div", {
|
|
176
|
-
className: U(N.avatarOverflow,
|
|
190
|
+
className: U(N.avatarOverflow, a.profile_image_shape === "Square" && N.avatarSquare),
|
|
177
191
|
children: /* @__PURE__ */ r(o, {
|
|
178
|
-
src:
|
|
179
|
-
alt:
|
|
192
|
+
src: a.profile_image_url_https,
|
|
193
|
+
alt: a.name,
|
|
180
194
|
width: 48,
|
|
181
195
|
height: 48
|
|
182
196
|
})
|
|
@@ -201,13 +215,16 @@ const sn = "_verified_lvyh0_1", Ue = {
|
|
|
201
215
|
/* @__PURE__ */ r("div", {
|
|
202
216
|
className: N.authorLinkText,
|
|
203
217
|
children: /* @__PURE__ */ r("span", {
|
|
204
|
-
title:
|
|
205
|
-
children:
|
|
218
|
+
title: a.name,
|
|
219
|
+
children: a.name
|
|
206
220
|
})
|
|
207
221
|
}),
|
|
208
222
|
/* @__PURE__ */ r(gt, {
|
|
209
|
-
user:
|
|
223
|
+
user: a,
|
|
210
224
|
className: N.authorVerified
|
|
225
|
+
}),
|
|
226
|
+
/* @__PURE__ */ r(wt, {
|
|
227
|
+
user: a
|
|
211
228
|
})
|
|
212
229
|
]
|
|
213
230
|
}),
|
|
@@ -220,10 +237,10 @@ const sn = "_verified_lvyh0_1", Ue = {
|
|
|
220
237
|
target: "_blank",
|
|
221
238
|
rel: "noopener noreferrer",
|
|
222
239
|
children: /* @__PURE__ */ h("span", {
|
|
223
|
-
title: `@${
|
|
240
|
+
title: `@${a.screen_name}`,
|
|
224
241
|
children: [
|
|
225
242
|
"@",
|
|
226
|
-
|
|
243
|
+
a.screen_name
|
|
227
244
|
]
|
|
228
245
|
})
|
|
229
246
|
}),
|
|
@@ -235,7 +252,7 @@ const sn = "_verified_lvyh0_1", Ue = {
|
|
|
235
252
|
children: "·"
|
|
236
253
|
}),
|
|
237
254
|
/* @__PURE__ */ r("a", {
|
|
238
|
-
href:
|
|
255
|
+
href: a.follow_url,
|
|
239
256
|
className: N.follow,
|
|
240
257
|
target: "_blank",
|
|
241
258
|
rel: "noopener noreferrer",
|
|
@@ -266,64 +283,97 @@ const sn = "_verified_lvyh0_1", Ue = {
|
|
|
266
283
|
})
|
|
267
284
|
]
|
|
268
285
|
});
|
|
269
|
-
},
|
|
270
|
-
root:
|
|
271
|
-
},
|
|
286
|
+
}, An = "_root_1ec15_1", Vn = {
|
|
287
|
+
root: An
|
|
288
|
+
}, Mn = ({ tweet: e }) => /* @__PURE__ */ h("a", {
|
|
272
289
|
href: e.in_reply_to_url,
|
|
273
|
-
className:
|
|
290
|
+
className: Vn.root,
|
|
274
291
|
target: "_blank",
|
|
275
292
|
rel: "noopener noreferrer",
|
|
276
293
|
children: [
|
|
277
294
|
"Replying to @",
|
|
278
295
|
e.in_reply_to_screen_name
|
|
279
296
|
]
|
|
280
|
-
}),
|
|
281
|
-
root:
|
|
282
|
-
},
|
|
297
|
+
}), jn = "_root_eihfa_1", Wn = {
|
|
298
|
+
root: jn
|
|
299
|
+
}, yt = ({ href: e, children: t }) => /* @__PURE__ */ r("a", {
|
|
283
300
|
href: e,
|
|
284
|
-
className:
|
|
301
|
+
className: Wn.root,
|
|
285
302
|
target: "_blank",
|
|
286
303
|
rel: "noopener noreferrer nofollow",
|
|
287
304
|
children: t
|
|
288
|
-
}),
|
|
289
|
-
root:
|
|
290
|
-
},
|
|
291
|
-
className:
|
|
305
|
+
}), Bn = "_root_1xq52_1", Fn = {
|
|
306
|
+
root: Bn
|
|
307
|
+
}, Pn = ({ tweet: e }) => /* @__PURE__ */ h("p", {
|
|
308
|
+
className: Fn.root,
|
|
292
309
|
lang: e.lang,
|
|
293
310
|
dir: "auto",
|
|
294
|
-
children:
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
}),
|
|
311
|
+
children: [
|
|
312
|
+
e.entities.map((t, n) => {
|
|
313
|
+
switch (t.type) {
|
|
314
|
+
case "hashtag":
|
|
315
|
+
case "mention":
|
|
316
|
+
case "url":
|
|
317
|
+
case "symbol":
|
|
318
|
+
return /* @__PURE__ */ r(yt, {
|
|
319
|
+
href: t.href,
|
|
320
|
+
children: t.text
|
|
321
|
+
}, n);
|
|
322
|
+
case "media":
|
|
323
|
+
return;
|
|
324
|
+
default:
|
|
325
|
+
return /* @__PURE__ */ r("span", {
|
|
326
|
+
dangerouslySetInnerHTML: {
|
|
327
|
+
__html: t.text
|
|
328
|
+
}
|
|
329
|
+
}, n);
|
|
330
|
+
}
|
|
331
|
+
}),
|
|
332
|
+
e.note_tweet ? /* @__PURE__ */ r(Un, {
|
|
333
|
+
tweet: e
|
|
334
|
+
}) : null
|
|
335
|
+
]
|
|
336
|
+
});
|
|
337
|
+
function Un({ tweet: e }) {
|
|
338
|
+
return /* @__PURE__ */ h(yt, {
|
|
339
|
+
href: e.url,
|
|
340
|
+
children: [
|
|
341
|
+
/* @__PURE__ */ r("span", {
|
|
342
|
+
children: " "
|
|
343
|
+
}),
|
|
344
|
+
"Show more"
|
|
345
|
+
]
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
const zn = {
|
|
349
|
+
hour: "numeric",
|
|
350
|
+
minute: "2-digit",
|
|
351
|
+
hour12: !0,
|
|
352
|
+
weekday: "short",
|
|
353
|
+
month: "short",
|
|
354
|
+
day: "numeric",
|
|
355
|
+
year: "numeric"
|
|
356
|
+
}, Hn = new Intl.DateTimeFormat("en-US", zn), Gn = (e) => {
|
|
357
|
+
const t = {};
|
|
358
|
+
for (const n of e)
|
|
359
|
+
t[n.type] = n.value;
|
|
360
|
+
return t;
|
|
361
|
+
}, Xn = (e) => {
|
|
362
|
+
const t = Gn(Hn.formatToParts(e)), n = `${t.hour}:${t.minute} ${t.dayPeriod}`, o = `${t.month} ${t.day}, ${t.year}`;
|
|
363
|
+
return `${n} · ${o}`;
|
|
364
|
+
}, at = (e) => `https://x.com/${e.user.screen_name}/status/${e.id_str}`, bt = (e) => `https://x.com/${typeof e == "string" ? e : e.user.screen_name}`, Kn = (e) => `https://x.com/intent/like?tweet_id=${e.id_str}`, Qn = (e) => `https://x.com/intent/tweet?in_reply_to=${e.id_str}`, Jn = (e) => `https://x.com/intent/follow?screen_name=${e.user.screen_name}`, Yn = (e) => `https://x.com/hashtag/${e.text}`, Zn = (e) => `https://x.com/search?q=%24${e.text}`, er = (e) => `https://x.com/${e.in_reply_to_screen_name}/status/${e.in_reply_to_status_id_str}`, Tt = (e, t) => {
|
|
315
365
|
const n = new URL(e.media_url_https), o = n.pathname.split(".").pop();
|
|
316
366
|
return o ? (n.pathname = n.pathname.replace(`.${o}`, ""), n.searchParams.set("format", o), n.searchParams.set("name", t), n.toString()) : e.media_url_https;
|
|
317
|
-
},
|
|
367
|
+
}, tr = (e) => {
|
|
318
368
|
const { variants: t } = e.video_info;
|
|
319
|
-
return t.filter((o) => o.content_type === "video/mp4").sort((o,
|
|
320
|
-
var
|
|
321
|
-
return ((
|
|
369
|
+
return t.filter((o) => o.content_type === "video/mp4").sort((o, a) => {
|
|
370
|
+
var i, s;
|
|
371
|
+
return ((i = a.bitrate) != null ? i : 0) - ((s = o.bitrate) != null ? s : 0);
|
|
322
372
|
});
|
|
323
|
-
},
|
|
324
|
-
const t =
|
|
373
|
+
}, nr = (e) => {
|
|
374
|
+
const t = tr(e);
|
|
325
375
|
return t.length > 1 ? t[1] : t[0];
|
|
326
|
-
},
|
|
376
|
+
}, Le = (e) => e > 999999 ? `${(e / 1e6).toFixed(1)}M` : e > 999 ? `${(e / 1e3).toFixed(1)}K` : e.toString();
|
|
327
377
|
function st(e) {
|
|
328
378
|
const t = Array.from(e.text), n = [
|
|
329
379
|
{
|
|
@@ -331,18 +381,18 @@ function st(e) {
|
|
|
331
381
|
type: "text"
|
|
332
382
|
}
|
|
333
383
|
];
|
|
334
|
-
return de(n, "hashtag", e.entities.hashtags), de(n, "mention", e.entities.user_mentions), de(n, "url", e.entities.urls), de(n, "symbol", e.entities.symbols), e.entities.media && de(n, "media", e.entities.media),
|
|
335
|
-
const
|
|
384
|
+
return de(n, "hashtag", e.entities.hashtags), de(n, "mention", e.entities.user_mentions), de(n, "url", e.entities.urls), de(n, "symbol", e.entities.symbols), e.entities.media && de(n, "media", e.entities.media), rr(e, n), n.map((o) => {
|
|
385
|
+
const a = t.slice(o.indices[0], o.indices[1]).join("");
|
|
336
386
|
switch (o.type) {
|
|
337
387
|
case "hashtag":
|
|
338
388
|
return Object.assign(o, {
|
|
339
|
-
href:
|
|
340
|
-
text:
|
|
389
|
+
href: Yn(o),
|
|
390
|
+
text: a
|
|
341
391
|
});
|
|
342
392
|
case "mention":
|
|
343
393
|
return Object.assign(o, {
|
|
344
|
-
href:
|
|
345
|
-
text:
|
|
394
|
+
href: bt(o.screen_name),
|
|
395
|
+
text: a
|
|
346
396
|
});
|
|
347
397
|
case "url":
|
|
348
398
|
case "media":
|
|
@@ -352,20 +402,20 @@ function st(e) {
|
|
|
352
402
|
});
|
|
353
403
|
case "symbol":
|
|
354
404
|
return Object.assign(o, {
|
|
355
|
-
href:
|
|
356
|
-
text:
|
|
405
|
+
href: Zn(o),
|
|
406
|
+
text: a
|
|
357
407
|
});
|
|
358
408
|
default:
|
|
359
409
|
return Object.assign(o, {
|
|
360
|
-
text:
|
|
410
|
+
text: a
|
|
361
411
|
});
|
|
362
412
|
}
|
|
363
413
|
});
|
|
364
414
|
}
|
|
365
415
|
function de(e, t, n) {
|
|
366
416
|
for (const o of n)
|
|
367
|
-
for (const [
|
|
368
|
-
if (
|
|
417
|
+
for (const [a, i] of e.entries()) {
|
|
418
|
+
if (i.indices[0] > o.indices[0] || i.indices[1] < o.indices[1])
|
|
369
419
|
continue;
|
|
370
420
|
const s = [
|
|
371
421
|
{
|
|
@@ -373,79 +423,79 @@ function de(e, t, n) {
|
|
|
373
423
|
type: t
|
|
374
424
|
}
|
|
375
425
|
];
|
|
376
|
-
|
|
426
|
+
i.indices[0] < o.indices[0] && s.unshift({
|
|
377
427
|
indices: [
|
|
378
|
-
|
|
428
|
+
i.indices[0],
|
|
379
429
|
o.indices[0]
|
|
380
430
|
],
|
|
381
431
|
type: "text"
|
|
382
|
-
}),
|
|
432
|
+
}), i.indices[1] > o.indices[1] && s.push({
|
|
383
433
|
indices: [
|
|
384
434
|
o.indices[1],
|
|
385
|
-
|
|
435
|
+
i.indices[1]
|
|
386
436
|
],
|
|
387
437
|
type: "text"
|
|
388
|
-
}), e.splice(
|
|
438
|
+
}), e.splice(a, 1, ...s);
|
|
389
439
|
break;
|
|
390
440
|
}
|
|
391
441
|
}
|
|
392
|
-
function
|
|
442
|
+
function rr(e, t) {
|
|
393
443
|
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]);
|
|
394
444
|
const n = t.at(-1);
|
|
395
445
|
n && n.indices[1] > e.display_text_range[1] && (n.indices[1] = e.display_text_range[1]);
|
|
396
446
|
}
|
|
397
|
-
const
|
|
447
|
+
const or = (e) => ({
|
|
398
448
|
...e,
|
|
399
|
-
url:
|
|
449
|
+
url: at(e),
|
|
400
450
|
user: {
|
|
401
451
|
...e.user,
|
|
402
|
-
url:
|
|
403
|
-
follow_url:
|
|
452
|
+
url: bt(e),
|
|
453
|
+
follow_url: Jn(e)
|
|
404
454
|
},
|
|
405
|
-
like_url:
|
|
406
|
-
reply_url:
|
|
407
|
-
in_reply_to_url: e.in_reply_to_screen_name ?
|
|
455
|
+
like_url: Kn(e),
|
|
456
|
+
reply_url: Qn(e),
|
|
457
|
+
in_reply_to_url: e.in_reply_to_screen_name ? er(e) : void 0,
|
|
408
458
|
entities: st(e),
|
|
409
459
|
quoted_tweet: e.quoted_tweet ? {
|
|
410
460
|
...e.quoted_tweet,
|
|
411
|
-
url:
|
|
461
|
+
url: at(e.quoted_tweet),
|
|
412
462
|
entities: st(e.quoted_tweet)
|
|
413
463
|
} : void 0
|
|
414
|
-
}),
|
|
415
|
-
root:
|
|
416
|
-
rounded:
|
|
417
|
-
mediaWrapper:
|
|
418
|
-
grid2Columns:
|
|
419
|
-
grid3:
|
|
420
|
-
grid2x2:
|
|
421
|
-
mediaContainer:
|
|
422
|
-
mediaLink:
|
|
423
|
-
skeleton:
|
|
424
|
-
image:
|
|
425
|
-
},
|
|
426
|
-
anchor:
|
|
427
|
-
videoButton:
|
|
428
|
-
videoButtonIcon:
|
|
429
|
-
watchOnTwitter:
|
|
430
|
-
viewReplies:
|
|
431
|
-
},
|
|
432
|
-
const [n, o] = se(!0), [
|
|
464
|
+
}), ar = "_root_g9tkv_1", sr = "_rounded_g9tkv_6", ir = "_mediaWrapper_g9tkv_10", cr = "_grid2Columns_g9tkv_17", lr = "_grid3_g9tkv_20", dr = "_grid2x2_g9tkv_23", ur = "_mediaContainer_g9tkv_26", fr = "_mediaLink_g9tkv_34", hr = "_skeleton_g9tkv_38", _r = "_image_g9tkv_43", C = {
|
|
465
|
+
root: ar,
|
|
466
|
+
rounded: sr,
|
|
467
|
+
mediaWrapper: ir,
|
|
468
|
+
grid2Columns: cr,
|
|
469
|
+
grid3: lr,
|
|
470
|
+
grid2x2: dr,
|
|
471
|
+
mediaContainer: ur,
|
|
472
|
+
mediaLink: fr,
|
|
473
|
+
skeleton: hr,
|
|
474
|
+
image: _r
|
|
475
|
+
}, mr = "_anchor_fp31d_1", pr = "_videoButton_fp31d_17", vr = "_videoButtonIcon_fp31d_35", gr = "_watchOnTwitter_fp31d_44", wr = "_viewReplies_fp31d_60", ae = {
|
|
476
|
+
anchor: mr,
|
|
477
|
+
videoButton: pr,
|
|
478
|
+
videoButtonIcon: vr,
|
|
479
|
+
watchOnTwitter: gr,
|
|
480
|
+
viewReplies: wr
|
|
481
|
+
}, yr = ({ tweet: e, media: t }) => {
|
|
482
|
+
const [n, o] = se(!0), [a, i] = se(!1), [s, c] = se(!1), f = nr(t);
|
|
433
483
|
let d = 0;
|
|
434
|
-
return /* @__PURE__ */ h(
|
|
484
|
+
return /* @__PURE__ */ h(Pt, {
|
|
435
485
|
children: [
|
|
436
486
|
/* @__PURE__ */ r("video", {
|
|
437
487
|
className: C.image,
|
|
438
|
-
poster:
|
|
488
|
+
poster: Tt(t, "small"),
|
|
439
489
|
controls: !n,
|
|
440
490
|
playsInline: !0,
|
|
441
491
|
preload: "none",
|
|
442
492
|
tabIndex: n ? -1 : 0,
|
|
443
493
|
onPlay: () => {
|
|
444
|
-
d && window.clearTimeout(d),
|
|
494
|
+
d && window.clearTimeout(d), a || i(!0), s && c(!1);
|
|
445
495
|
},
|
|
446
496
|
onPause: () => {
|
|
447
497
|
d && window.clearTimeout(d), d = window.setTimeout(() => {
|
|
448
|
-
|
|
498
|
+
a && i(!1), d = 0;
|
|
449
499
|
}, 100);
|
|
450
500
|
},
|
|
451
501
|
onEnded: () => {
|
|
@@ -458,19 +508,19 @@ const Qn = (e) => ({
|
|
|
458
508
|
}),
|
|
459
509
|
n && /* @__PURE__ */ r("button", {
|
|
460
510
|
type: "button",
|
|
461
|
-
className:
|
|
511
|
+
className: ae.videoButton,
|
|
462
512
|
"aria-label": "View video on X",
|
|
463
513
|
onClick: (g) => {
|
|
464
514
|
const m = g.currentTarget.previousSibling;
|
|
465
515
|
g.preventDefault(), o(!1), m.load(), m.play().then(() => {
|
|
466
|
-
|
|
467
|
-
}).catch((
|
|
468
|
-
console.error("Error playing video:",
|
|
516
|
+
i(!0), m.focus();
|
|
517
|
+
}).catch((b) => {
|
|
518
|
+
console.error("Error playing video:", b), o(!0), i(!1);
|
|
469
519
|
});
|
|
470
520
|
},
|
|
471
521
|
children: /* @__PURE__ */ r("svg", {
|
|
472
522
|
viewBox: "0 0 24 24",
|
|
473
|
-
className:
|
|
523
|
+
className: ae.videoButtonIcon,
|
|
474
524
|
"aria-hidden": "true",
|
|
475
525
|
children: /* @__PURE__ */ r("g", {
|
|
476
526
|
children: /* @__PURE__ */ r("path", {
|
|
@@ -479,11 +529,11 @@ const Qn = (e) => ({
|
|
|
479
529
|
})
|
|
480
530
|
})
|
|
481
531
|
}),
|
|
482
|
-
!
|
|
483
|
-
className:
|
|
532
|
+
!a && !s && /* @__PURE__ */ r("div", {
|
|
533
|
+
className: ae.watchOnTwitter,
|
|
484
534
|
children: /* @__PURE__ */ r("a", {
|
|
485
535
|
href: e.url,
|
|
486
|
-
className:
|
|
536
|
+
className: ae.anchor,
|
|
487
537
|
target: "_blank",
|
|
488
538
|
rel: "noopener noreferrer",
|
|
489
539
|
children: n ? "Watch on X" : "Continue watching on X"
|
|
@@ -491,31 +541,31 @@ const Qn = (e) => ({
|
|
|
491
541
|
}),
|
|
492
542
|
s && /* @__PURE__ */ r("a", {
|
|
493
543
|
href: e.url,
|
|
494
|
-
className: U(
|
|
544
|
+
className: U(ae.anchor, ae.viewReplies),
|
|
495
545
|
target: "_blank",
|
|
496
546
|
rel: "noopener noreferrer",
|
|
497
547
|
children: "View replies"
|
|
498
548
|
})
|
|
499
549
|
]
|
|
500
550
|
});
|
|
501
|
-
},
|
|
551
|
+
}, br = (e) => /* @__PURE__ */ r("img", {
|
|
502
552
|
...e
|
|
503
|
-
}),
|
|
553
|
+
}), it = (e, t) => {
|
|
504
554
|
let n = 56.25;
|
|
505
555
|
return t === 1 && (n = 100 / e.original_info.width * e.original_info.height), t === 2 && (n = n * 2), {
|
|
506
556
|
width: e.type === "photo" ? void 0 : "unset",
|
|
507
557
|
paddingBottom: `${n}%`
|
|
508
558
|
};
|
|
509
|
-
},
|
|
510
|
-
var o,
|
|
511
|
-
const s = (
|
|
559
|
+
}, xt = ({ tweet: e, components: t, quoted: n }) => {
|
|
560
|
+
var o, a, i;
|
|
561
|
+
const s = (i = (o = e.mediaDetails) == null ? void 0 : o.length) != null ? i : 0;
|
|
512
562
|
var c;
|
|
513
|
-
const f = (c = t == null ? void 0 : t.MediaImg) != null ? c :
|
|
563
|
+
const f = (c = t == null ? void 0 : t.MediaImg) != null ? c : br;
|
|
514
564
|
return /* @__PURE__ */ r("div", {
|
|
515
565
|
className: U(C.root, !n && C.rounded),
|
|
516
566
|
children: /* @__PURE__ */ r("div", {
|
|
517
567
|
className: U(C.mediaWrapper, s > 1 && C.grid2Columns, s === 3 && C.grid3, s > 4 && C.grid2x2),
|
|
518
|
-
children: (
|
|
568
|
+
children: (a = e.mediaDetails) == null ? void 0 : a.map((d) => /* @__PURE__ */ r(Ut, {
|
|
519
569
|
children: d.type === "photo" ? /* @__PURE__ */ h("a", {
|
|
520
570
|
href: e.url,
|
|
521
571
|
className: U(C.mediaContainer, C.mediaLink),
|
|
@@ -524,10 +574,10 @@ const Qn = (e) => ({
|
|
|
524
574
|
children: [
|
|
525
575
|
/* @__PURE__ */ r("div", {
|
|
526
576
|
className: C.skeleton,
|
|
527
|
-
style:
|
|
577
|
+
style: it(d, s)
|
|
528
578
|
}),
|
|
529
579
|
/* @__PURE__ */ r(f, {
|
|
530
|
-
src:
|
|
580
|
+
src: Tt(d, "small"),
|
|
531
581
|
alt: d.ext_alt_text || "Image",
|
|
532
582
|
className: C.image,
|
|
533
583
|
draggable: !0
|
|
@@ -538,9 +588,9 @@ const Qn = (e) => ({
|
|
|
538
588
|
children: [
|
|
539
589
|
/* @__PURE__ */ r("div", {
|
|
540
590
|
className: C.skeleton,
|
|
541
|
-
style:
|
|
591
|
+
style: it(d, s)
|
|
542
592
|
}),
|
|
543
|
-
/* @__PURE__ */ r(
|
|
593
|
+
/* @__PURE__ */ r(yr, {
|
|
544
594
|
tweet: e,
|
|
545
595
|
media: d
|
|
546
596
|
})
|
|
@@ -549,28 +599,12 @@ const Qn = (e) => ({
|
|
|
549
599
|
}, d.media_url_https))
|
|
550
600
|
})
|
|
551
601
|
});
|
|
552
|
-
},
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
weekday: "short",
|
|
557
|
-
month: "short",
|
|
558
|
-
day: "numeric",
|
|
559
|
-
year: "numeric"
|
|
560
|
-
}, mr = new Intl.DateTimeFormat("en-US", _r), pr = (e) => {
|
|
561
|
-
const t = {};
|
|
562
|
-
for (const n of e)
|
|
563
|
-
t[n.type] = n.value;
|
|
564
|
-
return t;
|
|
565
|
-
}, vr = (e) => {
|
|
566
|
-
const t = pr(mr.formatToParts(e)), n = `${t.hour}:${t.minute} ${t.dayPeriod}`, o = `${t.month} ${t.day}, ${t.year}`;
|
|
567
|
-
return `${n} · ${o}`;
|
|
568
|
-
}, gr = "_root_i24yn_1", wr = {
|
|
569
|
-
root: gr
|
|
570
|
-
}, yr = ({ tweet: e }) => {
|
|
571
|
-
const t = new Date(e.created_at), n = vr(t);
|
|
602
|
+
}, Tr = "_root_i24yn_1", xr = {
|
|
603
|
+
root: Tr
|
|
604
|
+
}, Nr = ({ tweet: e }) => {
|
|
605
|
+
const t = new Date(e.created_at), n = Xn(t);
|
|
572
606
|
return /* @__PURE__ */ r("a", {
|
|
573
|
-
className:
|
|
607
|
+
className: xr.root,
|
|
574
608
|
href: e.url,
|
|
575
609
|
target: "_blank",
|
|
576
610
|
rel: "noopener noreferrer",
|
|
@@ -580,14 +614,14 @@ const Qn = (e) => ({
|
|
|
580
614
|
children: n
|
|
581
615
|
})
|
|
582
616
|
});
|
|
583
|
-
},
|
|
584
|
-
info:
|
|
585
|
-
infoLink:
|
|
586
|
-
infoIcon:
|
|
587
|
-
},
|
|
617
|
+
}, Ir = "_info_19qcj_1", Rr = "_infoLink_19qcj_10", Sr = "_infoIcon_19qcj_30", Ne = {
|
|
618
|
+
info: Ir,
|
|
619
|
+
infoLink: Rr,
|
|
620
|
+
infoIcon: Sr
|
|
621
|
+
}, kr = ({ tweet: e }) => /* @__PURE__ */ h("div", {
|
|
588
622
|
className: Ne.info,
|
|
589
623
|
children: [
|
|
590
|
-
/* @__PURE__ */ r(
|
|
624
|
+
/* @__PURE__ */ r(Nr, {
|
|
591
625
|
tweet: e
|
|
592
626
|
}),
|
|
593
627
|
/* @__PURE__ */ r("a", {
|
|
@@ -608,44 +642,44 @@ const Qn = (e) => ({
|
|
|
608
642
|
})
|
|
609
643
|
})
|
|
610
644
|
]
|
|
611
|
-
}),
|
|
612
|
-
actions:
|
|
613
|
-
like:
|
|
614
|
-
reply:
|
|
615
|
-
copy:
|
|
616
|
-
likeIconWrapper:
|
|
617
|
-
likeCount:
|
|
618
|
-
replyIconWrapper:
|
|
619
|
-
copyIconWrapper:
|
|
620
|
-
likeIcon:
|
|
621
|
-
replyIcon:
|
|
622
|
-
copyIcon:
|
|
623
|
-
replyText:
|
|
624
|
-
copyText:
|
|
625
|
-
},
|
|
645
|
+
}), Er = "_actions_n2anf_1", Cr = "_like_n2anf_13", Or = "_reply_n2anf_14", Lr = "_copy_n2anf_15", $r = "_likeIconWrapper_n2anf_27", qr = "_likeCount_n2anf_30", Dr = "_replyIconWrapper_n2anf_35", Ar = "_copyIconWrapper_n2anf_36", Vr = "_likeIcon_n2anf_27", Mr = "_replyIcon_n2anf_35", jr = "_copyIcon_n2anf_36", Wr = "_replyText_n2anf_56", Br = "_copyText_n2anf_57", k = {
|
|
646
|
+
actions: Er,
|
|
647
|
+
like: Cr,
|
|
648
|
+
reply: Or,
|
|
649
|
+
copy: Lr,
|
|
650
|
+
likeIconWrapper: $r,
|
|
651
|
+
likeCount: qr,
|
|
652
|
+
replyIconWrapper: Dr,
|
|
653
|
+
copyIconWrapper: Ar,
|
|
654
|
+
likeIcon: Vr,
|
|
655
|
+
replyIcon: Mr,
|
|
656
|
+
copyIcon: jr,
|
|
657
|
+
replyText: Wr,
|
|
658
|
+
copyText: Br
|
|
659
|
+
}, Fr = ({ tweet: e }) => {
|
|
626
660
|
const [t, n] = se(!1), o = () => {
|
|
627
661
|
navigator.clipboard.writeText(e.url), n(!0);
|
|
628
662
|
};
|
|
629
663
|
return Fe(() => {
|
|
630
664
|
if (t) {
|
|
631
|
-
const
|
|
665
|
+
const a = setTimeout(() => {
|
|
632
666
|
n(!1);
|
|
633
667
|
}, 6e3);
|
|
634
|
-
return () => clearTimeout(
|
|
668
|
+
return () => clearTimeout(a);
|
|
635
669
|
}
|
|
636
670
|
}, [
|
|
637
671
|
t
|
|
638
672
|
]), /* @__PURE__ */ h("button", {
|
|
639
673
|
type: "button",
|
|
640
|
-
className:
|
|
674
|
+
className: k.copy,
|
|
641
675
|
"aria-label": "Copy link",
|
|
642
676
|
onClick: o,
|
|
643
677
|
children: [
|
|
644
678
|
/* @__PURE__ */ r("div", {
|
|
645
|
-
className:
|
|
679
|
+
className: k.copyIconWrapper,
|
|
646
680
|
children: t ? /* @__PURE__ */ r("svg", {
|
|
647
681
|
viewBox: "0 0 24 24",
|
|
648
|
-
className:
|
|
682
|
+
className: k.copyIcon,
|
|
649
683
|
"aria-hidden": "true",
|
|
650
684
|
children: /* @__PURE__ */ r("g", {
|
|
651
685
|
children: /* @__PURE__ */ r("path", {
|
|
@@ -654,7 +688,7 @@ const Qn = (e) => ({
|
|
|
654
688
|
})
|
|
655
689
|
}) : /* @__PURE__ */ r("svg", {
|
|
656
690
|
viewBox: "0 0 24 24",
|
|
657
|
-
className:
|
|
691
|
+
className: k.copyIcon,
|
|
658
692
|
"aria-hidden": "true",
|
|
659
693
|
children: /* @__PURE__ */ r("g", {
|
|
660
694
|
children: /* @__PURE__ */ r("path", {
|
|
@@ -664,28 +698,28 @@ const Qn = (e) => ({
|
|
|
664
698
|
})
|
|
665
699
|
}),
|
|
666
700
|
/* @__PURE__ */ r("span", {
|
|
667
|
-
className:
|
|
701
|
+
className: k.copyText,
|
|
668
702
|
children: t ? "Copied!" : "Copy link"
|
|
669
703
|
})
|
|
670
704
|
]
|
|
671
705
|
});
|
|
672
|
-
},
|
|
673
|
-
const t =
|
|
706
|
+
}, Pr = ({ tweet: e }) => {
|
|
707
|
+
const t = Le(e.favorite_count);
|
|
674
708
|
return /* @__PURE__ */ h("div", {
|
|
675
|
-
className:
|
|
709
|
+
className: k.actions,
|
|
676
710
|
children: [
|
|
677
711
|
/* @__PURE__ */ h("a", {
|
|
678
|
-
className:
|
|
712
|
+
className: k.like,
|
|
679
713
|
href: e.like_url,
|
|
680
714
|
target: "_blank",
|
|
681
715
|
rel: "noopener noreferrer",
|
|
682
716
|
"aria-label": `Like. This Tweet has ${t} likes`,
|
|
683
717
|
children: [
|
|
684
718
|
/* @__PURE__ */ r("div", {
|
|
685
|
-
className:
|
|
719
|
+
className: k.likeIconWrapper,
|
|
686
720
|
children: /* @__PURE__ */ r("svg", {
|
|
687
721
|
viewBox: "0 0 24 24",
|
|
688
|
-
className:
|
|
722
|
+
className: k.likeIcon,
|
|
689
723
|
"aria-hidden": "true",
|
|
690
724
|
children: /* @__PURE__ */ r("g", {
|
|
691
725
|
children: /* @__PURE__ */ r("path", {
|
|
@@ -695,23 +729,23 @@ const Qn = (e) => ({
|
|
|
695
729
|
})
|
|
696
730
|
}),
|
|
697
731
|
/* @__PURE__ */ r("span", {
|
|
698
|
-
className:
|
|
732
|
+
className: k.likeCount,
|
|
699
733
|
children: t
|
|
700
734
|
})
|
|
701
735
|
]
|
|
702
736
|
}),
|
|
703
737
|
/* @__PURE__ */ h("a", {
|
|
704
|
-
className:
|
|
738
|
+
className: k.reply,
|
|
705
739
|
href: e.reply_url,
|
|
706
740
|
target: "_blank",
|
|
707
741
|
rel: "noopener noreferrer",
|
|
708
742
|
"aria-label": "Reply to this Tweet on Twitter",
|
|
709
743
|
children: [
|
|
710
744
|
/* @__PURE__ */ r("div", {
|
|
711
|
-
className:
|
|
745
|
+
className: k.replyIconWrapper,
|
|
712
746
|
children: /* @__PURE__ */ r("svg", {
|
|
713
747
|
viewBox: "0 0 24 24",
|
|
714
|
-
className:
|
|
748
|
+
className: k.replyIcon,
|
|
715
749
|
"aria-hidden": "true",
|
|
716
750
|
children: /* @__PURE__ */ r("g", {
|
|
717
751
|
children: /* @__PURE__ */ r("path", {
|
|
@@ -721,36 +755,36 @@ const Qn = (e) => ({
|
|
|
721
755
|
})
|
|
722
756
|
}),
|
|
723
757
|
/* @__PURE__ */ r("span", {
|
|
724
|
-
className:
|
|
758
|
+
className: k.replyText,
|
|
725
759
|
children: "Reply"
|
|
726
760
|
})
|
|
727
761
|
]
|
|
728
762
|
}),
|
|
729
|
-
/* @__PURE__ */ r(
|
|
763
|
+
/* @__PURE__ */ r(Fr, {
|
|
730
764
|
tweet: e
|
|
731
765
|
})
|
|
732
766
|
]
|
|
733
767
|
});
|
|
734
|
-
},
|
|
735
|
-
replies:
|
|
736
|
-
link:
|
|
737
|
-
text:
|
|
738
|
-
},
|
|
739
|
-
className:
|
|
768
|
+
}, Ur = "_replies_1cutb_1", zr = "_link_1cutb_4", Hr = "_text_1cutb_23", Ie = {
|
|
769
|
+
replies: Ur,
|
|
770
|
+
link: zr,
|
|
771
|
+
text: Hr
|
|
772
|
+
}, Gr = ({ tweet: e }) => /* @__PURE__ */ r("div", {
|
|
773
|
+
className: Ie.replies,
|
|
740
774
|
children: /* @__PURE__ */ r("a", {
|
|
741
|
-
className:
|
|
775
|
+
className: Ie.link,
|
|
742
776
|
href: e.url,
|
|
743
777
|
target: "_blank",
|
|
744
778
|
rel: "noopener noreferrer",
|
|
745
779
|
children: /* @__PURE__ */ r("span", {
|
|
746
|
-
className:
|
|
747
|
-
children: e.conversation_count === 0 ? "Read more on X" : e.conversation_count === 1 ? `Read ${
|
|
780
|
+
className: Ie.text,
|
|
781
|
+
children: e.conversation_count === 0 ? "Read more on X" : e.conversation_count === 1 ? `Read ${Le(e.conversation_count)} reply` : `Read ${Le(e.conversation_count)} replies`
|
|
748
782
|
})
|
|
749
783
|
})
|
|
750
|
-
}),
|
|
751
|
-
root:
|
|
752
|
-
article:
|
|
753
|
-
},
|
|
784
|
+
}), Xr = "_root_q5799_1", Kr = "_article_q5799_16", ct = {
|
|
785
|
+
root: Xr,
|
|
786
|
+
article: Kr
|
|
787
|
+
}, Qr = ({ tweet: e, children: t }) => /* @__PURE__ */ r("div", {
|
|
754
788
|
className: ct.root,
|
|
755
789
|
onClick: (n) => {
|
|
756
790
|
n.preventDefault(), window.open(e.url, "_blank");
|
|
@@ -759,15 +793,18 @@ const Qn = (e) => ({
|
|
|
759
793
|
className: ct.article,
|
|
760
794
|
children: t
|
|
761
795
|
})
|
|
762
|
-
}),
|
|
763
|
-
header:
|
|
764
|
-
avatar:
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
796
|
+
}), Jr = "_header_f00ab_1", Yr = "_avatar_f00ab_11", Zr = "_avatarOverflow_f00ab_16", eo = "_avatarSquare_f00ab_23", to = "_author_f00ab_27", no = "_authorText_f00ab_33", ro = "_username_f00ab_40", Q = {
|
|
797
|
+
header: Jr,
|
|
798
|
+
avatar: Yr,
|
|
799
|
+
avatarOverflow: Zr,
|
|
800
|
+
avatarSquare: eo,
|
|
801
|
+
author: to,
|
|
802
|
+
authorText: no,
|
|
803
|
+
username: ro
|
|
804
|
+
}, oo = ({ tweet: e, components: t }) => {
|
|
805
|
+
const { user: n } = e;
|
|
806
|
+
var o;
|
|
807
|
+
const a = (o = t == null ? void 0 : t.AvatarImg) != null ? o : vt;
|
|
771
808
|
return /* @__PURE__ */ h("div", {
|
|
772
809
|
className: Q.header,
|
|
773
810
|
children: [
|
|
@@ -777,10 +814,10 @@ const Qn = (e) => ({
|
|
|
777
814
|
target: "_blank",
|
|
778
815
|
rel: "noopener noreferrer",
|
|
779
816
|
children: /* @__PURE__ */ r("div", {
|
|
780
|
-
className: U(Q.avatarOverflow,
|
|
781
|
-
children: /* @__PURE__ */ r(
|
|
782
|
-
src:
|
|
783
|
-
alt:
|
|
817
|
+
className: U(Q.avatarOverflow, n.profile_image_shape === "Square" && Q.avatarSquare),
|
|
818
|
+
children: /* @__PURE__ */ r(a, {
|
|
819
|
+
src: n.profile_image_url_https,
|
|
820
|
+
alt: n.name,
|
|
784
821
|
width: 20,
|
|
785
822
|
height: 20
|
|
786
823
|
})
|
|
@@ -792,20 +829,23 @@ const Qn = (e) => ({
|
|
|
792
829
|
/* @__PURE__ */ r("div", {
|
|
793
830
|
className: Q.authorText,
|
|
794
831
|
children: /* @__PURE__ */ r("span", {
|
|
795
|
-
title:
|
|
796
|
-
children:
|
|
832
|
+
title: n.name,
|
|
833
|
+
children: n.name
|
|
797
834
|
})
|
|
798
835
|
}),
|
|
799
836
|
/* @__PURE__ */ r(gt, {
|
|
800
|
-
user:
|
|
837
|
+
user: n
|
|
838
|
+
}),
|
|
839
|
+
/* @__PURE__ */ r(wt, {
|
|
840
|
+
user: n
|
|
801
841
|
}),
|
|
802
842
|
/* @__PURE__ */ r("div", {
|
|
803
843
|
className: Q.username,
|
|
804
844
|
children: /* @__PURE__ */ h("span", {
|
|
805
|
-
title: `@${
|
|
845
|
+
title: `@${n.screen_name}`,
|
|
806
846
|
children: [
|
|
807
847
|
"@",
|
|
808
|
-
|
|
848
|
+
n.screen_name
|
|
809
849
|
]
|
|
810
850
|
})
|
|
811
851
|
})
|
|
@@ -813,10 +853,10 @@ const Qn = (e) => ({
|
|
|
813
853
|
})
|
|
814
854
|
]
|
|
815
855
|
});
|
|
816
|
-
},
|
|
817
|
-
root:
|
|
818
|
-
},
|
|
819
|
-
className:
|
|
856
|
+
}, ao = "_root_175ot_1", so = {
|
|
857
|
+
root: ao
|
|
858
|
+
}, io = ({ tweet: e }) => /* @__PURE__ */ r("p", {
|
|
859
|
+
className: so.root,
|
|
820
860
|
lang: e.lang,
|
|
821
861
|
dir: "auto",
|
|
822
862
|
children: e.entities.map((t, n) => /* @__PURE__ */ r("span", {
|
|
@@ -824,63 +864,65 @@ const Qn = (e) => ({
|
|
|
824
864
|
__html: t.text
|
|
825
865
|
}
|
|
826
866
|
}, n))
|
|
827
|
-
}),
|
|
828
|
-
var
|
|
829
|
-
return /* @__PURE__ */ h(
|
|
867
|
+
}), co = ({ tweet: e, components: t }) => {
|
|
868
|
+
var n;
|
|
869
|
+
return /* @__PURE__ */ h(Qr, {
|
|
830
870
|
tweet: e,
|
|
831
871
|
children: [
|
|
832
|
-
/* @__PURE__ */ r(
|
|
833
|
-
tweet: e
|
|
872
|
+
/* @__PURE__ */ r(oo, {
|
|
873
|
+
tweet: e,
|
|
874
|
+
components: t
|
|
834
875
|
}),
|
|
835
|
-
/* @__PURE__ */ r(
|
|
876
|
+
/* @__PURE__ */ r(io, {
|
|
836
877
|
tweet: e
|
|
837
878
|
}),
|
|
838
|
-
(
|
|
879
|
+
(n = e.mediaDetails) != null && n.length ? /* @__PURE__ */ r(xt, {
|
|
839
880
|
quoted: !0,
|
|
840
881
|
tweet: e
|
|
841
882
|
}) : null
|
|
842
883
|
]
|
|
843
884
|
});
|
|
844
|
-
},
|
|
885
|
+
}, lo = ({ tweet: e, components: t }) => {
|
|
845
886
|
var n;
|
|
846
|
-
const o = Pe(() =>
|
|
887
|
+
const o = Pe(() => or(e), [
|
|
847
888
|
e
|
|
848
889
|
]);
|
|
849
890
|
return /* @__PURE__ */ h(ze, {
|
|
850
891
|
children: [
|
|
851
|
-
/* @__PURE__ */ r(
|
|
892
|
+
/* @__PURE__ */ r(Dn, {
|
|
852
893
|
tweet: o,
|
|
853
894
|
components: t
|
|
854
895
|
}),
|
|
855
|
-
o.in_reply_to_status_id_str && /* @__PURE__ */ r(
|
|
896
|
+
o.in_reply_to_status_id_str && /* @__PURE__ */ r(Mn, {
|
|
856
897
|
tweet: o
|
|
857
898
|
}),
|
|
858
|
-
/* @__PURE__ */ r(
|
|
899
|
+
/* @__PURE__ */ r(Pn, {
|
|
859
900
|
tweet: o
|
|
860
901
|
}),
|
|
861
|
-
(n = o.mediaDetails) != null && n.length ? /* @__PURE__ */ r(
|
|
902
|
+
(n = o.mediaDetails) != null && n.length ? /* @__PURE__ */ r(xt, {
|
|
862
903
|
tweet: o,
|
|
863
904
|
components: t
|
|
864
905
|
}) : null,
|
|
865
|
-
o.quoted_tweet && /* @__PURE__ */ r(
|
|
866
|
-
tweet: o.quoted_tweet
|
|
906
|
+
o.quoted_tweet && /* @__PURE__ */ r(co, {
|
|
907
|
+
tweet: o.quoted_tweet,
|
|
908
|
+
components: t
|
|
867
909
|
}),
|
|
868
|
-
/* @__PURE__ */ r(
|
|
910
|
+
/* @__PURE__ */ r(kr, {
|
|
869
911
|
tweet: o
|
|
870
912
|
}),
|
|
871
|
-
/* @__PURE__ */ r(
|
|
913
|
+
/* @__PURE__ */ r(Pr, {
|
|
872
914
|
tweet: o
|
|
873
915
|
}),
|
|
874
|
-
/* @__PURE__ */ r(
|
|
916
|
+
/* @__PURE__ */ r(Gr, {
|
|
875
917
|
tweet: o
|
|
876
918
|
})
|
|
877
919
|
]
|
|
878
920
|
});
|
|
879
|
-
},
|
|
880
|
-
root:
|
|
881
|
-
},
|
|
921
|
+
}, uo = "_root_16yxa_1", fo = {
|
|
922
|
+
root: uo
|
|
923
|
+
}, ho = (e) => /* @__PURE__ */ r(ze, {
|
|
882
924
|
children: /* @__PURE__ */ h("div", {
|
|
883
|
-
className:
|
|
925
|
+
className: fo.root,
|
|
884
926
|
children: [
|
|
885
927
|
/* @__PURE__ */ r("h3", {
|
|
886
928
|
children: "Tweet not found"
|
|
@@ -890,15 +932,15 @@ const Qn = (e) => ({
|
|
|
890
932
|
})
|
|
891
933
|
]
|
|
892
934
|
})
|
|
893
|
-
}),
|
|
894
|
-
skeleton:
|
|
935
|
+
}), _o = "_skeleton_oi7hr_1", mo = {
|
|
936
|
+
skeleton: _o
|
|
895
937
|
}, pe = ({ style: e }) => /* @__PURE__ */ r("span", {
|
|
896
|
-
className:
|
|
938
|
+
className: mo.skeleton,
|
|
897
939
|
style: e
|
|
898
|
-
}),
|
|
899
|
-
root:
|
|
900
|
-
},
|
|
901
|
-
className:
|
|
940
|
+
}), po = "_root_17qqv_1", vo = {
|
|
941
|
+
root: po
|
|
942
|
+
}, go = () => /* @__PURE__ */ h(ze, {
|
|
943
|
+
className: vo.root,
|
|
902
944
|
children: [
|
|
903
945
|
/* @__PURE__ */ r(pe, {
|
|
904
946
|
style: {
|
|
@@ -931,9 +973,9 @@ const Qn = (e) => ({
|
|
|
931
973
|
}
|
|
932
974
|
})
|
|
933
975
|
]
|
|
934
|
-
}),
|
|
976
|
+
}), Nt = 0, It = 1, Rt = 2, lt = 3;
|
|
935
977
|
var dt = Object.prototype.hasOwnProperty;
|
|
936
|
-
function
|
|
978
|
+
function $e(e, t) {
|
|
937
979
|
var n, o;
|
|
938
980
|
if (e === t) return !0;
|
|
939
981
|
if (e && t && (n = e.constructor) === t.constructor) {
|
|
@@ -941,56 +983,56 @@ function qe(e, t) {
|
|
|
941
983
|
if (n === RegExp) return e.toString() === t.toString();
|
|
942
984
|
if (n === Array) {
|
|
943
985
|
if ((o = e.length) === t.length)
|
|
944
|
-
for (; o-- &&
|
|
986
|
+
for (; o-- && $e(e[o], t[o]); ) ;
|
|
945
987
|
return o === -1;
|
|
946
988
|
}
|
|
947
989
|
if (!n || typeof e == "object") {
|
|
948
990
|
o = 0;
|
|
949
991
|
for (n in e)
|
|
950
|
-
if (dt.call(e, n) && ++o && !dt.call(t, n) || !(n in t) ||
|
|
992
|
+
if (dt.call(e, n) && ++o && !dt.call(t, n) || !(n in t) || !$e(e[n], t[n])) return !1;
|
|
951
993
|
return Object.keys(t).length === o;
|
|
952
994
|
}
|
|
953
995
|
}
|
|
954
996
|
return e !== e && t !== t;
|
|
955
997
|
}
|
|
956
998
|
const F = /* @__PURE__ */ new WeakMap(), P = () => {
|
|
957
|
-
},
|
|
999
|
+
}, R = (
|
|
958
1000
|
/*#__NOINLINE__*/
|
|
959
1001
|
P()
|
|
960
|
-
),
|
|
1002
|
+
), qe = Object, u = (e) => e === R, j = (e) => typeof e == "function", z = (e, t) => ({
|
|
961
1003
|
...e,
|
|
962
1004
|
...t
|
|
963
|
-
}),
|
|
1005
|
+
}), St = (e) => j(e.then), Re = {}, ve = {}, He = "undefined", ue = typeof window != He, De = typeof document != He, wo = ue && "Deno" in window, yo = () => ue && typeof window.requestAnimationFrame != He, kt = (e, t) => {
|
|
964
1006
|
const n = F.get(e);
|
|
965
1007
|
return [
|
|
966
1008
|
// Getter
|
|
967
|
-
() => !u(t) && e.get(t) ||
|
|
1009
|
+
() => !u(t) && e.get(t) || Re,
|
|
968
1010
|
// Setter
|
|
969
1011
|
(o) => {
|
|
970
1012
|
if (!u(t)) {
|
|
971
|
-
const
|
|
972
|
-
t in ve || (ve[t] =
|
|
1013
|
+
const a = e.get(t);
|
|
1014
|
+
t in ve || (ve[t] = a), n[5](t, z(a, o), a || Re);
|
|
973
1015
|
}
|
|
974
1016
|
},
|
|
975
1017
|
// Subscriber
|
|
976
1018
|
n[6],
|
|
977
1019
|
// Get server cache snapshot
|
|
978
|
-
() => !u(t) && t in ve ? ve[t] : !u(t) && e.get(t) ||
|
|
1020
|
+
() => !u(t) && t in ve ? ve[t] : !u(t) && e.get(t) || Re
|
|
979
1021
|
];
|
|
980
1022
|
};
|
|
981
1023
|
let Ae = !0;
|
|
982
|
-
const
|
|
1024
|
+
const bo = () => Ae, [Ve, Me] = ue && window.addEventListener ? [
|
|
983
1025
|
window.addEventListener.bind(window),
|
|
984
1026
|
window.removeEventListener.bind(window)
|
|
985
1027
|
] : [
|
|
986
1028
|
P,
|
|
987
1029
|
P
|
|
988
|
-
],
|
|
989
|
-
const e =
|
|
1030
|
+
], To = () => {
|
|
1031
|
+
const e = De && document.visibilityState;
|
|
990
1032
|
return u(e) || e !== "hidden";
|
|
991
|
-
},
|
|
992
|
-
|
|
993
|
-
}),
|
|
1033
|
+
}, xo = (e) => (De && document.addEventListener("visibilitychange", e), Ve("focus", e), () => {
|
|
1034
|
+
De && document.removeEventListener("visibilitychange", e), Me("focus", e);
|
|
1035
|
+
}), No = (e) => {
|
|
994
1036
|
const t = () => {
|
|
995
1037
|
Ae = !0, e();
|
|
996
1038
|
}, n = () => {
|
|
@@ -999,30 +1041,30 @@ const po = () => Ae, [Ve, Me] = ue && window.addEventListener ? [
|
|
|
999
1041
|
return Ve("online", t), Ve("offline", n), () => {
|
|
1000
1042
|
Me("online", t), Me("offline", n);
|
|
1001
1043
|
};
|
|
1002
|
-
},
|
|
1003
|
-
isOnline:
|
|
1004
|
-
isVisible:
|
|
1005
|
-
},
|
|
1006
|
-
initFocus:
|
|
1007
|
-
initReconnect:
|
|
1008
|
-
}, ut = !Be.useId,
|
|
1044
|
+
}, Io = {
|
|
1045
|
+
isOnline: bo,
|
|
1046
|
+
isVisible: To
|
|
1047
|
+
}, Ro = {
|
|
1048
|
+
initFocus: xo,
|
|
1049
|
+
initReconnect: No
|
|
1050
|
+
}, ut = !Be.useId, ie = !ue || wo, So = (e) => yo() ? window.requestAnimationFrame(e) : setTimeout(e, 1), Se = ie ? Fe : Ht, ke = typeof navigator < "u" && navigator.connection, ft = !ie && ke && ([
|
|
1009
1051
|
"slow-2g",
|
|
1010
1052
|
"2g"
|
|
1011
|
-
].includes(
|
|
1012
|
-
let
|
|
1053
|
+
].includes(ke.effectiveType) || ke.saveData), ge = /* @__PURE__ */ new WeakMap(), ko = (e) => qe.prototype.toString.call(e), Ee = (e, t) => e === `[object ${t}]`;
|
|
1054
|
+
let Eo = 0;
|
|
1013
1055
|
const je = (e) => {
|
|
1014
|
-
const t = typeof e, n =
|
|
1056
|
+
const t = typeof e, n = ko(e), o = Ee(n, "Date"), a = Ee(n, "RegExp"), i = Ee(n, "Object");
|
|
1015
1057
|
let s, c;
|
|
1016
|
-
if (
|
|
1058
|
+
if (qe(e) === e && !o && !a) {
|
|
1017
1059
|
if (s = ge.get(e), s) return s;
|
|
1018
|
-
if (s = ++
|
|
1060
|
+
if (s = ++Eo + "~", ge.set(e, s), Array.isArray(e)) {
|
|
1019
1061
|
for (s = "@", c = 0; c < e.length; c++)
|
|
1020
1062
|
s += je(e[c]) + ",";
|
|
1021
1063
|
ge.set(e, s);
|
|
1022
1064
|
}
|
|
1023
|
-
if (
|
|
1065
|
+
if (i) {
|
|
1024
1066
|
s = "#";
|
|
1025
|
-
const f =
|
|
1067
|
+
const f = qe.keys(e).sort();
|
|
1026
1068
|
for (; !u(c = f.pop()); )
|
|
1027
1069
|
u(e[c]) || (s += c + ":" + je(e[c]) + ",");
|
|
1028
1070
|
ge.set(e, s);
|
|
@@ -1043,140 +1085,140 @@ const je = (e) => {
|
|
|
1043
1085
|
t
|
|
1044
1086
|
];
|
|
1045
1087
|
};
|
|
1046
|
-
let
|
|
1047
|
-
const We = () => ++
|
|
1048
|
-
async function
|
|
1049
|
-
const [t, n, o,
|
|
1088
|
+
let Co = 0;
|
|
1089
|
+
const We = () => ++Co;
|
|
1090
|
+
async function Et(...e) {
|
|
1091
|
+
const [t, n, o, a] = e, i = z({
|
|
1050
1092
|
populateCache: !0,
|
|
1051
1093
|
throwOnError: !0
|
|
1052
|
-
}, typeof
|
|
1053
|
-
revalidate:
|
|
1054
|
-
} :
|
|
1055
|
-
let s =
|
|
1056
|
-
const c =
|
|
1057
|
-
let f =
|
|
1058
|
-
const d = (
|
|
1094
|
+
}, typeof a == "boolean" ? {
|
|
1095
|
+
revalidate: a
|
|
1096
|
+
} : a || {});
|
|
1097
|
+
let s = i.populateCache;
|
|
1098
|
+
const c = i.rollbackOnError;
|
|
1099
|
+
let f = i.optimisticData;
|
|
1100
|
+
const d = (b) => typeof c == "function" ? c(b) : c !== !1, g = i.throwOnError;
|
|
1059
1101
|
if (j(n)) {
|
|
1060
|
-
const
|
|
1061
|
-
for (const
|
|
1102
|
+
const b = n, I = [], E = t.keys();
|
|
1103
|
+
for (const L of E)
|
|
1062
1104
|
// Skip the special useSWRInfinite and useSWRSubscription keys.
|
|
1063
|
-
!/^\$(inf|sub)\$/.test(
|
|
1064
|
-
return Promise.all(
|
|
1105
|
+
!/^\$(inf|sub)\$/.test(L) && b(t.get(L)._k) && I.push(L);
|
|
1106
|
+
return Promise.all(I.map(m));
|
|
1065
1107
|
}
|
|
1066
1108
|
return m(n);
|
|
1067
|
-
async function m(
|
|
1068
|
-
const [
|
|
1069
|
-
if (!
|
|
1070
|
-
const [E,
|
|
1071
|
-
const
|
|
1072
|
-
return (j(
|
|
1109
|
+
async function m(b) {
|
|
1110
|
+
const [I] = Ge(b);
|
|
1111
|
+
if (!I) return;
|
|
1112
|
+
const [E, L] = kt(t, I), [D, ce, l, fe] = F.get(t), J = () => {
|
|
1113
|
+
const $ = D[I];
|
|
1114
|
+
return (j(i.revalidate) ? i.revalidate(E().data, b) : i.revalidate !== !1) && (delete l[I], delete fe[I], $ && $[0]) ? $[0](Rt).then(() => E().data) : E().data;
|
|
1073
1115
|
};
|
|
1074
1116
|
if (e.length < 3)
|
|
1075
1117
|
return J();
|
|
1076
|
-
let
|
|
1118
|
+
let T = o, A, V = !1;
|
|
1077
1119
|
const Y = We();
|
|
1078
|
-
ce[
|
|
1120
|
+
ce[I] = [
|
|
1079
1121
|
Y,
|
|
1080
1122
|
0
|
|
1081
1123
|
];
|
|
1082
1124
|
const p = !u(f), Z = E(), M = Z.data, ee = Z._c, H = u(ee) ? M : ee;
|
|
1083
|
-
if (p && (f = j(f) ? f(H, M) : f,
|
|
1125
|
+
if (p && (f = j(f) ? f(H, M) : f, L({
|
|
1084
1126
|
data: f,
|
|
1085
1127
|
_c: H
|
|
1086
|
-
})), j(
|
|
1128
|
+
})), j(T))
|
|
1087
1129
|
try {
|
|
1088
|
-
|
|
1089
|
-
} catch (
|
|
1090
|
-
A =
|
|
1130
|
+
T = T(H);
|
|
1131
|
+
} catch ($) {
|
|
1132
|
+
A = $, V = !0;
|
|
1091
1133
|
}
|
|
1092
|
-
if (
|
|
1093
|
-
if (
|
|
1094
|
-
A =
|
|
1095
|
-
}), Y !== ce[
|
|
1134
|
+
if (T && St(T))
|
|
1135
|
+
if (T = await T.catch(($) => {
|
|
1136
|
+
A = $, V = !0;
|
|
1137
|
+
}), Y !== ce[I][0]) {
|
|
1096
1138
|
if (V) throw A;
|
|
1097
|
-
return
|
|
1098
|
-
} else V && p && d(A) && (s = !0,
|
|
1139
|
+
return T;
|
|
1140
|
+
} else V && p && d(A) && (s = !0, L({
|
|
1099
1141
|
data: H,
|
|
1100
|
-
_c:
|
|
1142
|
+
_c: R
|
|
1101
1143
|
}));
|
|
1102
1144
|
if (s && !V)
|
|
1103
1145
|
if (j(s)) {
|
|
1104
|
-
const
|
|
1105
|
-
|
|
1106
|
-
data:
|
|
1107
|
-
error:
|
|
1108
|
-
_c:
|
|
1146
|
+
const $ = s(T, H);
|
|
1147
|
+
L({
|
|
1148
|
+
data: $,
|
|
1149
|
+
error: R,
|
|
1150
|
+
_c: R
|
|
1109
1151
|
});
|
|
1110
1152
|
} else
|
|
1111
|
-
|
|
1112
|
-
data:
|
|
1113
|
-
error:
|
|
1114
|
-
_c:
|
|
1153
|
+
L({
|
|
1154
|
+
data: T,
|
|
1155
|
+
error: R,
|
|
1156
|
+
_c: R
|
|
1115
1157
|
});
|
|
1116
|
-
if (ce[
|
|
1117
|
-
|
|
1118
|
-
_c:
|
|
1158
|
+
if (ce[I][1] = We(), Promise.resolve(J()).then(() => {
|
|
1159
|
+
L({
|
|
1160
|
+
_c: R
|
|
1119
1161
|
});
|
|
1120
1162
|
}), V) {
|
|
1121
1163
|
if (g) throw A;
|
|
1122
1164
|
return;
|
|
1123
1165
|
}
|
|
1124
|
-
return
|
|
1166
|
+
return T;
|
|
1125
1167
|
}
|
|
1126
1168
|
}
|
|
1127
1169
|
const ht = (e, t) => {
|
|
1128
1170
|
for (const n in e)
|
|
1129
1171
|
e[n][0] && e[n][0](t);
|
|
1130
|
-
},
|
|
1172
|
+
}, Oo = (e, t) => {
|
|
1131
1173
|
if (!F.has(e)) {
|
|
1132
|
-
const n = z(
|
|
1133
|
-
let
|
|
1174
|
+
const n = z(Ro, t), o = /* @__PURE__ */ Object.create(null), a = Et.bind(R, e);
|
|
1175
|
+
let i = P;
|
|
1134
1176
|
const s = /* @__PURE__ */ Object.create(null), c = (g, m) => {
|
|
1135
|
-
const
|
|
1136
|
-
return s[g] =
|
|
1137
|
-
}, f = (g, m,
|
|
1177
|
+
const b = s[g] || [];
|
|
1178
|
+
return s[g] = b, b.push(m), () => b.splice(b.indexOf(m), 1);
|
|
1179
|
+
}, f = (g, m, b) => {
|
|
1138
1180
|
e.set(g, m);
|
|
1139
|
-
const
|
|
1140
|
-
if (
|
|
1141
|
-
for (const E of
|
|
1142
|
-
E(m,
|
|
1181
|
+
const I = s[g];
|
|
1182
|
+
if (I)
|
|
1183
|
+
for (const E of I)
|
|
1184
|
+
E(m, b);
|
|
1143
1185
|
}, d = () => {
|
|
1144
1186
|
if (!F.has(e) && (F.set(e, [
|
|
1145
1187
|
o,
|
|
1146
1188
|
/* @__PURE__ */ Object.create(null),
|
|
1147
1189
|
/* @__PURE__ */ Object.create(null),
|
|
1148
1190
|
/* @__PURE__ */ Object.create(null),
|
|
1149
|
-
|
|
1191
|
+
a,
|
|
1150
1192
|
f,
|
|
1151
1193
|
c
|
|
1152
|
-
]), !
|
|
1153
|
-
const g = n.initFocus(setTimeout.bind(
|
|
1154
|
-
|
|
1194
|
+
]), !ie)) {
|
|
1195
|
+
const g = n.initFocus(setTimeout.bind(R, ht.bind(R, o, Nt))), m = n.initReconnect(setTimeout.bind(R, ht.bind(R, o, It)));
|
|
1196
|
+
i = () => {
|
|
1155
1197
|
g && g(), m && m(), F.delete(e);
|
|
1156
1198
|
};
|
|
1157
1199
|
}
|
|
1158
1200
|
};
|
|
1159
1201
|
return d(), [
|
|
1160
1202
|
e,
|
|
1161
|
-
|
|
1203
|
+
a,
|
|
1162
1204
|
d,
|
|
1163
|
-
|
|
1205
|
+
i
|
|
1164
1206
|
];
|
|
1165
1207
|
}
|
|
1166
1208
|
return [
|
|
1167
1209
|
e,
|
|
1168
1210
|
F.get(e)[4]
|
|
1169
1211
|
];
|
|
1170
|
-
},
|
|
1171
|
-
const
|
|
1172
|
-
!u(
|
|
1173
|
-
},
|
|
1212
|
+
}, Lo = (e, t, n, o, a) => {
|
|
1213
|
+
const i = n.errorRetryCount, s = a.retryCount, c = ~~((Math.random() + 0.5) * (1 << (s < 8 ? s : 8))) * n.errorRetryInterval;
|
|
1214
|
+
!u(i) && s > i || setTimeout(o, c, a);
|
|
1215
|
+
}, $o = $e, [Ct, qo] = Oo(/* @__PURE__ */ new Map()), Do = z(
|
|
1174
1216
|
{
|
|
1175
1217
|
// events
|
|
1176
1218
|
onLoadingSlow: P,
|
|
1177
1219
|
onSuccess: P,
|
|
1178
1220
|
onError: P,
|
|
1179
|
-
onErrorRetry:
|
|
1221
|
+
onErrorRetry: Lo,
|
|
1180
1222
|
onDiscarded: P,
|
|
1181
1223
|
// switches
|
|
1182
1224
|
revalidateOnFocus: !0,
|
|
@@ -1189,24 +1231,24 @@ const ht = (e, t) => {
|
|
|
1189
1231
|
dedupingInterval: 2 * 1e3,
|
|
1190
1232
|
loadingTimeout: ft ? 5e3 : 3e3,
|
|
1191
1233
|
// providers
|
|
1192
|
-
compare:
|
|
1234
|
+
compare: $o,
|
|
1193
1235
|
isPaused: () => !1,
|
|
1194
|
-
cache:
|
|
1195
|
-
mutate:
|
|
1236
|
+
cache: Ct,
|
|
1237
|
+
mutate: qo,
|
|
1196
1238
|
fallback: {}
|
|
1197
1239
|
},
|
|
1198
1240
|
// use web preset by default
|
|
1199
|
-
|
|
1200
|
-
),
|
|
1241
|
+
Io
|
|
1242
|
+
), Ao = (e, t) => {
|
|
1201
1243
|
const n = z(e, t);
|
|
1202
1244
|
if (t) {
|
|
1203
|
-
const { use: o, fallback:
|
|
1204
|
-
o &&
|
|
1245
|
+
const { use: o, fallback: a } = e, { use: i, fallback: s } = t;
|
|
1246
|
+
o && i && (n.use = o.concat(i)), a && s && (n.fallback = z(a, s));
|
|
1205
1247
|
}
|
|
1206
1248
|
return n;
|
|
1207
|
-
},
|
|
1208
|
-
|
|
1209
|
-
},
|
|
1249
|
+
}, Vo = zt({}), Mo = "$inf$", Ot = ue && window.__SWR_DEVTOOLS_USE__, jo = Ot ? window.__SWR_DEVTOOLS_USE__ : [], Wo = () => {
|
|
1250
|
+
Ot && (window.__SWR_DEVTOOLS_REACT__ = Be);
|
|
1251
|
+
}, Bo = (e) => j(e[1]) ? [
|
|
1210
1252
|
e[0],
|
|
1211
1253
|
e[1],
|
|
1212
1254
|
e[2] || {}
|
|
@@ -1214,32 +1256,32 @@ const ht = (e, t) => {
|
|
|
1214
1256
|
e[0],
|
|
1215
1257
|
null,
|
|
1216
1258
|
(e[1] === null ? e[2] : e[1]) || {}
|
|
1217
|
-
],
|
|
1218
|
-
const e =
|
|
1219
|
-
return Pe(() => z(
|
|
1259
|
+
], Fo = () => {
|
|
1260
|
+
const e = Gt(Vo);
|
|
1261
|
+
return Pe(() => z(Do, e), [
|
|
1220
1262
|
e
|
|
1221
1263
|
]);
|
|
1222
|
-
},
|
|
1223
|
-
const [s] = Ge(t), [, , , c] = F.get(
|
|
1224
|
-
if (s.startsWith(
|
|
1225
|
-
return n(...
|
|
1264
|
+
}, Po = (e) => (t, n, o) => e(t, n && ((...i) => {
|
|
1265
|
+
const [s] = Ge(t), [, , , c] = F.get(Ct);
|
|
1266
|
+
if (s.startsWith(Mo))
|
|
1267
|
+
return n(...i);
|
|
1226
1268
|
const f = c[s];
|
|
1227
|
-
return u(f) ? n(...
|
|
1228
|
-
}), o),
|
|
1229
|
-
const o =
|
|
1269
|
+
return u(f) ? n(...i) : (delete c[s], f);
|
|
1270
|
+
}), o), Uo = jo.concat(Po), zo = (e) => function(...n) {
|
|
1271
|
+
const o = Fo(), [a, i, s] = Bo(n), c = Ao(o, s);
|
|
1230
1272
|
let f = e;
|
|
1231
|
-
const { use: d } = c, g = (d || []).concat(
|
|
1273
|
+
const { use: d } = c, g = (d || []).concat(Uo);
|
|
1232
1274
|
for (let m = g.length; m--; )
|
|
1233
1275
|
f = g[m](f);
|
|
1234
|
-
return f(
|
|
1235
|
-
},
|
|
1276
|
+
return f(a, i || c.fetcher || null, c);
|
|
1277
|
+
}, Ho = (e, t, n) => {
|
|
1236
1278
|
const o = t[e] || (t[e] = []);
|
|
1237
1279
|
return o.push(n), () => {
|
|
1238
|
-
const
|
|
1239
|
-
|
|
1280
|
+
const a = o.indexOf(n);
|
|
1281
|
+
a >= 0 && (o[a] = o[o.length - 1], o.pop());
|
|
1240
1282
|
};
|
|
1241
1283
|
};
|
|
1242
|
-
|
|
1284
|
+
Wo();
|
|
1243
1285
|
const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the generic and JSX sytax
|
|
1244
1286
|
// and emitting an error.
|
|
1245
1287
|
// We assume that this is only for the `use(thenable)` case, not `use(context)`.
|
|
@@ -1259,40 +1301,40 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1259
1301
|
e.status = "rejected", e.reason = t;
|
|
1260
1302
|
}), e;
|
|
1261
1303
|
}
|
|
1262
|
-
}),
|
|
1304
|
+
}), Oe = {
|
|
1263
1305
|
dedupe: !0
|
|
1264
|
-
}, _t = Promise.resolve(
|
|
1265
|
-
const { cache: o, compare:
|
|
1306
|
+
}, _t = Promise.resolve(R), Go = (e, t, n) => {
|
|
1307
|
+
const { cache: o, compare: a, suspense: i, fallbackData: s, revalidateOnMount: c, revalidateIfStale: f, refreshInterval: d, refreshWhenHidden: g, refreshWhenOffline: m, keepPreviousData: b, strictServerPrefetchWarning: I } = n, [E, L, D, ce] = F.get(o), [l, fe] = Ge(e), J = K(!1), T = K(!1), A = K(l), V = K(t), Y = K(n), p = () => Y.current, Z = () => p().isVisible() && p().isOnline(), [M, ee, H, $] = kt(o, l), te = K({}).current, he = u(s) ? u(n.fallback) ? R : n.fallback[l] : s, Xe = (_, v) => {
|
|
1266
1308
|
for (const y in te) {
|
|
1267
1309
|
const w = y;
|
|
1268
1310
|
if (w === "data") {
|
|
1269
|
-
if (!
|
|
1311
|
+
if (!a(_[w], v[w]) && (!u(_[w]) || !a(me, v[w])))
|
|
1270
1312
|
return !1;
|
|
1271
1313
|
} else if (v[w] !== _[w])
|
|
1272
1314
|
return !1;
|
|
1273
1315
|
}
|
|
1274
1316
|
return !0;
|
|
1275
1317
|
}, Ke = Pe(() => {
|
|
1276
|
-
const _ = !l || !t ? !1 : u(c) ? p().isPaused() ||
|
|
1277
|
-
const W = z(
|
|
1318
|
+
const _ = !l || !t ? !1 : u(c) ? p().isPaused() || i ? !1 : f !== !1 : c, v = (S) => {
|
|
1319
|
+
const W = z(S);
|
|
1278
1320
|
return delete W._k, _ ? {
|
|
1279
1321
|
isValidating: !0,
|
|
1280
1322
|
isLoading: !0,
|
|
1281
1323
|
...W
|
|
1282
1324
|
} : W;
|
|
1283
|
-
}, y = M(), w =
|
|
1284
|
-
let x =
|
|
1325
|
+
}, y = M(), w = $(), q = v(y), oe = y === w ? q : v(w);
|
|
1326
|
+
let x = q;
|
|
1285
1327
|
return [
|
|
1286
1328
|
() => {
|
|
1287
|
-
const
|
|
1288
|
-
return Xe(
|
|
1329
|
+
const S = v(M());
|
|
1330
|
+
return Xe(S, x) ? (x.data = S.data, x.isLoading = S.isLoading, x.isValidating = S.isValidating, x.error = S.error, x) : (x = S, S);
|
|
1289
1331
|
},
|
|
1290
1332
|
() => oe
|
|
1291
1333
|
];
|
|
1292
1334
|
}, [
|
|
1293
1335
|
o,
|
|
1294
1336
|
l
|
|
1295
|
-
]), ne = rt.useSyncExternalStore(
|
|
1337
|
+
]), ne = rt.useSyncExternalStore(Te(
|
|
1296
1338
|
(_) => H(l, (v, y) => {
|
|
1297
1339
|
Xe(y, v) || _();
|
|
1298
1340
|
}),
|
|
@@ -1301,56 +1343,56 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1301
1343
|
o,
|
|
1302
1344
|
l
|
|
1303
1345
|
]
|
|
1304
|
-
), Ke[0], Ke[1]), Qe = !J.current,
|
|
1346
|
+
), Ke[0], Ke[1]), Qe = !J.current, $t = E[l] && E[l].length > 0, re = ne.data, G = u(re) ? he && St(he) ? Ce(he) : he : re, _e = ne.error, we = K(G), me = b ? u(re) ? u(we.current) ? G : we.current : re : G, X = l && u(G), qt = !ie && // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1305
1347
|
rt.useSyncExternalStore(() => P, () => !1, () => !0);
|
|
1306
|
-
|
|
1307
|
-
const Je =
|
|
1348
|
+
I && qt && !i && X && console.warn(`Missing pre-initiated data for serialized key "${l}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);
|
|
1349
|
+
const Je = $t && !u(_e) ? !1 : Qe && !u(c) ? c : p().isPaused() ? !1 : i ? u(G) ? !1 : f : u(G) || f, Ye = !!(l && t && Qe && Je), Dt = u(ne.isValidating) ? Ye : ne.isValidating, At = u(ne.isLoading) ? Ye : ne.isLoading, le = Te(
|
|
1308
1350
|
async (_) => {
|
|
1309
1351
|
const v = V.current;
|
|
1310
|
-
if (!l || !v ||
|
|
1352
|
+
if (!l || !v || T.current || p().isPaused())
|
|
1311
1353
|
return !1;
|
|
1312
|
-
let y, w,
|
|
1313
|
-
const oe = _ || {}, x =
|
|
1354
|
+
let y, w, q = !0;
|
|
1355
|
+
const oe = _ || {}, x = !D[l] || !oe.dedupe, S = () => ut ? !T.current && l === A.current && J.current : l === A.current, W = {
|
|
1314
1356
|
isValidating: !1,
|
|
1315
1357
|
isLoading: !1
|
|
1316
1358
|
}, et = () => {
|
|
1317
1359
|
ee(W);
|
|
1318
1360
|
}, tt = () => {
|
|
1319
|
-
const
|
|
1320
|
-
|
|
1361
|
+
const O = D[l];
|
|
1362
|
+
O && O[1] === w && delete D[l];
|
|
1321
1363
|
}, nt = {
|
|
1322
1364
|
isValidating: !0
|
|
1323
1365
|
};
|
|
1324
1366
|
u(M().data) && (nt.isLoading = !0);
|
|
1325
1367
|
try {
|
|
1326
1368
|
if (x && (ee(nt), n.loadingTimeout && u(M().data) && setTimeout(() => {
|
|
1327
|
-
|
|
1328
|
-
}, n.loadingTimeout),
|
|
1369
|
+
q && S() && p().onLoadingSlow(l, n);
|
|
1370
|
+
}, n.loadingTimeout), D[l] = [
|
|
1329
1371
|
v(fe),
|
|
1330
1372
|
We()
|
|
1331
|
-
]), [y, w] =
|
|
1332
|
-
return x &&
|
|
1333
|
-
W.error =
|
|
1334
|
-
const
|
|
1335
|
-
if (!u(
|
|
1336
|
-
(w <=
|
|
1337
|
-
w <=
|
|
1338
|
-
|
|
1339
|
-
return et(), x &&
|
|
1373
|
+
]), [y, w] = D[l], y = await y, x && setTimeout(tt, n.dedupingInterval), !D[l] || D[l][1] !== w)
|
|
1374
|
+
return x && S() && p().onDiscarded(l), !1;
|
|
1375
|
+
W.error = R;
|
|
1376
|
+
const O = L[l];
|
|
1377
|
+
if (!u(O) && // case 1
|
|
1378
|
+
(w <= O[0] || // case 2
|
|
1379
|
+
w <= O[1] || // case 3
|
|
1380
|
+
O[1] === 0))
|
|
1381
|
+
return et(), x && S() && p().onDiscarded(l), !1;
|
|
1340
1382
|
const B = M().data;
|
|
1341
|
-
W.data =
|
|
1342
|
-
} catch (
|
|
1383
|
+
W.data = a(B, y) ? B : y, x && S() && p().onSuccess(y, l, n);
|
|
1384
|
+
} catch (O) {
|
|
1343
1385
|
tt();
|
|
1344
1386
|
const B = p(), { shouldRetryOnError: ye } = B;
|
|
1345
|
-
B.isPaused() || (W.error =
|
|
1346
|
-
const
|
|
1347
|
-
|
|
1387
|
+
B.isPaused() || (W.error = O, x && S() && (B.onError(O, l, B), (ye === !0 || j(ye) && ye(O)) && (!p().revalidateOnFocus || !p().revalidateOnReconnect || Z()) && B.onErrorRetry(O, l, B, (Vt) => {
|
|
1388
|
+
const be = E[l];
|
|
1389
|
+
be && be[0] && be[0](lt, Vt);
|
|
1348
1390
|
}, {
|
|
1349
1391
|
retryCount: (oe.retryCount || 0) + 1,
|
|
1350
1392
|
dedupe: !0
|
|
1351
1393
|
})));
|
|
1352
1394
|
}
|
|
1353
|
-
return
|
|
1395
|
+
return q = !1, et(), !0;
|
|
1354
1396
|
},
|
|
1355
1397
|
// `setState` is immutable, and `eventsCallback`, `fnArg`, and
|
|
1356
1398
|
// `keyValidating` are depending on `key`, so we can exclude them from
|
|
@@ -1367,47 +1409,47 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1367
1409
|
l,
|
|
1368
1410
|
o
|
|
1369
1411
|
]
|
|
1370
|
-
), Ze =
|
|
1412
|
+
), Ze = Te(
|
|
1371
1413
|
// Use callback to make sure `keyRef.current` returns latest result every time
|
|
1372
|
-
(..._) =>
|
|
1414
|
+
(..._) => Et(o, A.current, ..._),
|
|
1373
1415
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1374
1416
|
[]
|
|
1375
1417
|
);
|
|
1376
|
-
if (
|
|
1418
|
+
if (Se(() => {
|
|
1377
1419
|
V.current = t, Y.current = n, u(re) || (we.current = re);
|
|
1378
|
-
}),
|
|
1420
|
+
}), Se(() => {
|
|
1379
1421
|
if (!l) return;
|
|
1380
|
-
const _ = le.bind(
|
|
1422
|
+
const _ = le.bind(R, Oe);
|
|
1381
1423
|
let v = 0;
|
|
1382
1424
|
p().revalidateOnFocus && (v = Date.now() + p().focusThrottleInterval);
|
|
1383
|
-
const w =
|
|
1384
|
-
if (
|
|
1425
|
+
const w = Ho(l, E, (q, oe = {}) => {
|
|
1426
|
+
if (q == Nt) {
|
|
1385
1427
|
const x = Date.now();
|
|
1386
1428
|
p().revalidateOnFocus && x > v && Z() && (v = x + p().focusThrottleInterval, _());
|
|
1387
|
-
} else if (
|
|
1429
|
+
} else if (q == It)
|
|
1388
1430
|
p().revalidateOnReconnect && Z() && _();
|
|
1389
1431
|
else {
|
|
1390
|
-
if (
|
|
1432
|
+
if (q == Rt)
|
|
1391
1433
|
return le();
|
|
1392
|
-
if (
|
|
1434
|
+
if (q == lt)
|
|
1393
1435
|
return le(oe);
|
|
1394
1436
|
}
|
|
1395
1437
|
});
|
|
1396
|
-
return
|
|
1438
|
+
return T.current = !1, A.current = l, J.current = !0, ee({
|
|
1397
1439
|
_k: fe
|
|
1398
|
-
}), Je && (
|
|
1399
|
-
|
|
1440
|
+
}), Je && (D[l] || (u(G) || ie ? _() : So(_))), () => {
|
|
1441
|
+
T.current = !0, w();
|
|
1400
1442
|
};
|
|
1401
1443
|
}, [
|
|
1402
1444
|
l
|
|
1403
|
-
]),
|
|
1445
|
+
]), Se(() => {
|
|
1404
1446
|
let _;
|
|
1405
1447
|
function v() {
|
|
1406
1448
|
const w = j(d) ? d(M().data) : d;
|
|
1407
1449
|
w && _ !== -1 && (_ = setTimeout(y, w));
|
|
1408
1450
|
}
|
|
1409
1451
|
function y() {
|
|
1410
|
-
!M().error && (g || p().isVisible()) && (m || p().isOnline()) ? le(
|
|
1452
|
+
!M().error && (g || p().isVisible()) && (m || p().isOnline()) ? le(Oe).then(v) : v();
|
|
1411
1453
|
}
|
|
1412
1454
|
return v(), () => {
|
|
1413
1455
|
_ && (clearTimeout(_), _ = -1);
|
|
@@ -1417,14 +1459,14 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1417
1459
|
g,
|
|
1418
1460
|
m,
|
|
1419
1461
|
l
|
|
1420
|
-
]),
|
|
1421
|
-
if (!ut &&
|
|
1462
|
+
]), Xt(me), i) {
|
|
1463
|
+
if (!ut && ie && X)
|
|
1422
1464
|
throw new Error("Fallback data is required when using Suspense in SSR.");
|
|
1423
|
-
X && (V.current = t, Y.current = n,
|
|
1465
|
+
X && (V.current = t, Y.current = n, T.current = !1);
|
|
1424
1466
|
const _ = ce[l], v = !u(_) && X ? Ze(_) : _t;
|
|
1425
1467
|
if (Ce(v), !u(_e) && X)
|
|
1426
1468
|
throw _e;
|
|
1427
|
-
const y = X ? le(
|
|
1469
|
+
const y = X ? le(Oe) : _t;
|
|
1428
1470
|
!u(me) && X && (y.status = "fulfilled", y.value = !0), Ce(y);
|
|
1429
1471
|
}
|
|
1430
1472
|
return {
|
|
@@ -1436,33 +1478,33 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1436
1478
|
return te.error = !0, _e;
|
|
1437
1479
|
},
|
|
1438
1480
|
get isValidating() {
|
|
1439
|
-
return te.isValidating = !0,
|
|
1481
|
+
return te.isValidating = !0, Dt;
|
|
1440
1482
|
},
|
|
1441
1483
|
get isLoading() {
|
|
1442
|
-
return te.isLoading = !0,
|
|
1484
|
+
return te.isLoading = !0, At;
|
|
1443
1485
|
}
|
|
1444
1486
|
};
|
|
1445
|
-
}, mt =
|
|
1446
|
-
class
|
|
1487
|
+
}, mt = zo(Go);
|
|
1488
|
+
class Xo extends Error {
|
|
1447
1489
|
constructor({ message: t, status: n, data: o }) {
|
|
1448
1490
|
super(t), this.name = "TwitterApiError", this.status = n, this.data = o;
|
|
1449
1491
|
}
|
|
1450
1492
|
}
|
|
1451
|
-
const
|
|
1452
|
-
async function
|
|
1493
|
+
const Ko = mt.default || mt, Qo = "https://react-tweet.vercel.app";
|
|
1494
|
+
async function Jo([e, t]) {
|
|
1453
1495
|
const n = await fetch(e, t), o = await n.json();
|
|
1454
1496
|
if (n.ok) return o.data || null;
|
|
1455
|
-
throw new
|
|
1497
|
+
throw new Xo({
|
|
1456
1498
|
message: `Failed to fetch tweet at "${e}" with "${n.status}".`,
|
|
1457
1499
|
data: o,
|
|
1458
1500
|
status: n.status
|
|
1459
1501
|
});
|
|
1460
1502
|
}
|
|
1461
|
-
const
|
|
1462
|
-
const { isLoading: o, data:
|
|
1463
|
-
t || e && `${
|
|
1503
|
+
const Yo = (e, t, n) => {
|
|
1504
|
+
const { isLoading: o, data: a, error: i } = Ko(() => t || e ? [
|
|
1505
|
+
t || e && `${Qo}/api/tweet/${e}`,
|
|
1464
1506
|
n
|
|
1465
|
-
] : null,
|
|
1507
|
+
] : null, Jo, {
|
|
1466
1508
|
revalidateIfStale: !1,
|
|
1467
1509
|
revalidateOnFocus: !1,
|
|
1468
1510
|
shouldRetryOnError: !1
|
|
@@ -1470,53 +1512,53 @@ const Go = (e, t, n) => {
|
|
|
1470
1512
|
return {
|
|
1471
1513
|
// If data is `undefined` then it might be the first render where SWR hasn't started doing
|
|
1472
1514
|
// any work, so we set `isLoading` to `true`.
|
|
1473
|
-
isLoading: !!(o ||
|
|
1474
|
-
data:
|
|
1475
|
-
error:
|
|
1515
|
+
isLoading: !!(o || a === void 0 && !i),
|
|
1516
|
+
data: a,
|
|
1517
|
+
error: i
|
|
1476
1518
|
};
|
|
1477
|
-
},
|
|
1478
|
-
const { data: s, error: c, isLoading: f } =
|
|
1519
|
+
}, Zo = ({ id: e, apiUrl: t, fallback: n = /* @__PURE__ */ r(go, {}), components: o, fetchOptions: a, onError: i }) => {
|
|
1520
|
+
const { data: s, error: c, isLoading: f } = Yo(e, t, a);
|
|
1479
1521
|
if (f) return n;
|
|
1480
1522
|
if (c || !s) {
|
|
1481
|
-
const d = (o == null ? void 0 : o.TweetNotFound) ||
|
|
1523
|
+
const d = (o == null ? void 0 : o.TweetNotFound) || ho;
|
|
1482
1524
|
return /* @__PURE__ */ r(d, {
|
|
1483
|
-
error:
|
|
1525
|
+
error: i ? i(c) : c
|
|
1484
1526
|
});
|
|
1485
1527
|
}
|
|
1486
|
-
return /* @__PURE__ */ r(
|
|
1528
|
+
return /* @__PURE__ */ r(lo, {
|
|
1487
1529
|
tweet: s,
|
|
1488
1530
|
components: o
|
|
1489
1531
|
});
|
|
1490
1532
|
};
|
|
1491
|
-
function
|
|
1533
|
+
function ea({ node: e }) {
|
|
1492
1534
|
var o;
|
|
1493
1535
|
const t = ((o = e == null ? void 0 : e.attrs) == null ? void 0 : o.src) || "", n = t == null ? void 0 : t.split("/").pop();
|
|
1494
|
-
return n ? /* @__PURE__ */ r(
|
|
1536
|
+
return n ? /* @__PURE__ */ r(Mt, { children: /* @__PURE__ */ r("div", { "data-twitter": "", children: /* @__PURE__ */ r(Zo, { id: n }) }) }) : null;
|
|
1495
1537
|
}
|
|
1496
|
-
function
|
|
1497
|
-
const { t } =
|
|
1538
|
+
function ta(e) {
|
|
1539
|
+
const { t } = Qt(), [n, o] = se("");
|
|
1498
1540
|
Fe(() => {
|
|
1499
|
-
var
|
|
1541
|
+
var i;
|
|
1500
1542
|
if (e != null && e.editor) {
|
|
1501
|
-
const { src: s } = (
|
|
1543
|
+
const { src: s } = (i = e.editor) == null ? void 0 : i.getAttributes(Lt.name);
|
|
1502
1544
|
s && o(s);
|
|
1503
1545
|
}
|
|
1504
1546
|
}, [e == null ? void 0 : e.editor]);
|
|
1505
|
-
function i
|
|
1506
|
-
|
|
1547
|
+
function a(i) {
|
|
1548
|
+
i.preventDefault(), i.stopPropagation(), e == null || e.onSetLink(n);
|
|
1507
1549
|
}
|
|
1508
1550
|
return /* @__PURE__ */ h(
|
|
1509
1551
|
"form",
|
|
1510
1552
|
{
|
|
1511
1553
|
className: "richtext-flex richtext-flex-col richtext-gap-2",
|
|
1512
|
-
onSubmit:
|
|
1554
|
+
onSubmit: a,
|
|
1513
1555
|
children: [
|
|
1514
|
-
/* @__PURE__ */ r(
|
|
1556
|
+
/* @__PURE__ */ r(Jt, { className: "mb-[6px]", children: t("editor.link.dialog.text") }),
|
|
1515
1557
|
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ r("div", { className: "richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center", children: /* @__PURE__ */ r(
|
|
1516
|
-
|
|
1558
|
+
Yt,
|
|
1517
1559
|
{
|
|
1518
1560
|
className: "richtext-w-80",
|
|
1519
|
-
onChange: (
|
|
1561
|
+
onChange: (i) => o(i.target.value),
|
|
1520
1562
|
placeholder: "Text",
|
|
1521
1563
|
required: !0,
|
|
1522
1564
|
type: "text",
|
|
@@ -1524,7 +1566,7 @@ function Qo(e) {
|
|
|
1524
1566
|
}
|
|
1525
1567
|
) }) }),
|
|
1526
1568
|
/* @__PURE__ */ r(
|
|
1527
|
-
|
|
1569
|
+
Zt,
|
|
1528
1570
|
{
|
|
1529
1571
|
className: "richtext-mt-2 richtext-self-end",
|
|
1530
1572
|
type: "submit",
|
|
@@ -1535,43 +1577,43 @@ function Qo(e) {
|
|
|
1535
1577
|
}
|
|
1536
1578
|
);
|
|
1537
1579
|
}
|
|
1538
|
-
function
|
|
1539
|
-
const [e, t] = se(!1), n =
|
|
1540
|
-
icon:
|
|
1541
|
-
tooltip:
|
|
1580
|
+
function pa() {
|
|
1581
|
+
const [e, t] = se(!1), n = en(), o = tn(Lt.name), {
|
|
1582
|
+
icon: a = void 0,
|
|
1583
|
+
tooltip: i = void 0,
|
|
1542
1584
|
tooltipOptions: s = {},
|
|
1543
1585
|
action: c = void 0,
|
|
1544
1586
|
isActive: f = void 0
|
|
1545
|
-
} = (o == null ? void 0 : o.componentProps) ?? {}, { editorDisabled: d } =
|
|
1587
|
+
} = (o == null ? void 0 : o.componentProps) ?? {}, { editorDisabled: d } = nn(f);
|
|
1546
1588
|
function g(m) {
|
|
1547
1589
|
d || c && (c(m), t(!1));
|
|
1548
1590
|
}
|
|
1549
1591
|
return /* @__PURE__ */ h(
|
|
1550
|
-
|
|
1592
|
+
rn,
|
|
1551
1593
|
{
|
|
1552
1594
|
modal: !0,
|
|
1553
1595
|
onOpenChange: t,
|
|
1554
1596
|
open: e,
|
|
1555
1597
|
children: [
|
|
1556
|
-
/* @__PURE__ */ r(
|
|
1557
|
-
|
|
1598
|
+
/* @__PURE__ */ r(on, { asChild: !0, children: /* @__PURE__ */ r(
|
|
1599
|
+
Kt,
|
|
1558
1600
|
{
|
|
1559
1601
|
disabled: d,
|
|
1560
1602
|
isActive: f,
|
|
1561
|
-
tooltip:
|
|
1603
|
+
tooltip: i,
|
|
1562
1604
|
tooltipOptions: s,
|
|
1563
|
-
children: /* @__PURE__ */ r(
|
|
1605
|
+
children: /* @__PURE__ */ r(sn, { name: a })
|
|
1564
1606
|
}
|
|
1565
1607
|
) }),
|
|
1566
1608
|
/* @__PURE__ */ r(
|
|
1567
|
-
|
|
1609
|
+
an,
|
|
1568
1610
|
{
|
|
1569
1611
|
align: "start",
|
|
1570
1612
|
className: "richtext-w-full",
|
|
1571
1613
|
hideWhenDetached: !0,
|
|
1572
1614
|
side: "bottom",
|
|
1573
1615
|
children: /* @__PURE__ */ r(
|
|
1574
|
-
|
|
1616
|
+
ta,
|
|
1575
1617
|
{
|
|
1576
1618
|
editor: n,
|
|
1577
1619
|
onSetLink: g
|
|
@@ -1583,11 +1625,11 @@ function ui() {
|
|
|
1583
1625
|
}
|
|
1584
1626
|
);
|
|
1585
1627
|
}
|
|
1586
|
-
const
|
|
1628
|
+
const na = /(https?:\/\/)?(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?/g, ra = /^https?:\/\/(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?$/;
|
|
1587
1629
|
function pt(e) {
|
|
1588
|
-
return e.match(
|
|
1630
|
+
return e.match(ra);
|
|
1589
1631
|
}
|
|
1590
|
-
const
|
|
1632
|
+
const Lt = /* @__PURE__ */ jt.create({
|
|
1591
1633
|
name: "twitter",
|
|
1592
1634
|
draggable: !0,
|
|
1593
1635
|
selectable: !0,
|
|
@@ -1612,7 +1654,7 @@ const Ct = /* @__PURE__ */ Vt.create({
|
|
|
1612
1654
|
};
|
|
1613
1655
|
},
|
|
1614
1656
|
addNodeView() {
|
|
1615
|
-
return
|
|
1657
|
+
return Ft(ea, { attrs: this.options.HTMLAttributes });
|
|
1616
1658
|
},
|
|
1617
1659
|
inline() {
|
|
1618
1660
|
return this.options.inline;
|
|
@@ -1645,19 +1687,19 @@ const Ct = /* @__PURE__ */ Vt.create({
|
|
|
1645
1687
|
},
|
|
1646
1688
|
addPasteRules() {
|
|
1647
1689
|
return this.options.addPasteHandler ? [
|
|
1648
|
-
|
|
1649
|
-
find:
|
|
1690
|
+
Bt({
|
|
1691
|
+
find: na,
|
|
1650
1692
|
type: this.type,
|
|
1651
1693
|
getAttributes: (e) => ({ src: e.input })
|
|
1652
1694
|
})
|
|
1653
1695
|
] : [];
|
|
1654
1696
|
},
|
|
1655
1697
|
renderHTML({ HTMLAttributes: e }) {
|
|
1656
|
-
return ["div",
|
|
1698
|
+
return ["div", Wt({ "data-twitter": "" }, e)];
|
|
1657
1699
|
}
|
|
1658
1700
|
});
|
|
1659
1701
|
export {
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1702
|
+
ta as F,
|
|
1703
|
+
pa as R,
|
|
1704
|
+
Lt as T
|
|
1663
1705
|
};
|