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