@box/box-ai-content-answers 1.19.4 → 1.21.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/dist/chunks/clear-conversation-button.js +15 -16
- package/dist/chunks/stopResponseButton.js +19 -23
- package/dist/chunks/types.js +8 -8
- package/dist/chunks/warning-message.js +15 -16
- package/dist/esm/lib/components/answer/answer-content.js +15 -15
- package/dist/esm/lib/components/answer/answer.js +107 -109
- package/dist/esm/lib/components/answer/citation.js +23 -24
- package/dist/esm/lib/components/answer/copy-button.js +3 -3
- package/dist/esm/lib/components/answer/embed-the-answer-button.js +44 -44
- package/dist/esm/lib/components/answer/feedback-tooltip.js +63 -56
- package/dist/esm/lib/components/answer/inline-error.js +1 -1
- package/dist/esm/lib/components/answer/loading-indicator.js +15 -18
- package/dist/esm/lib/components/answer/references.js +30 -30
- package/dist/esm/lib/components/answer/thumb-buttons.js +95 -96
- package/dist/esm/lib/components/api-wrapper/hooks/useContentAnswers.js +166 -167
- package/dist/esm/lib/components/api-wrapper/reducer.js +1 -1
- package/dist/esm/lib/components/api-wrapper/utils/request.js +8 -8
- package/dist/esm/lib/components/api-wrapper/utils/stream.js +24 -25
- package/dist/esm/lib/components/chat/chat.js +78 -79
- package/dist/esm/lib/components/common/focusInputUtils.js +3 -4
- package/dist/esm/lib/components/common/markdown-react.js +91 -93
- package/dist/esm/lib/components/common/markdown.js +2666 -2696
- package/dist/esm/lib/components/content/content.js +38 -39
- package/dist/esm/lib/components/footer/footer-actions.js +3 -3
- package/dist/esm/lib/components/footer/footer.js +97 -98
- package/dist/esm/lib/components/modal/modal.js +121 -122
- package/dist/esm/lib/components/sidebar/content.js +95 -101
- package/dist/esm/lib/components/sidebar/sidebar.js +82 -83
- package/dist/esm/lib/components/suggested-questions/suggested-questions.js +1 -1
- package/dist/esm/lib/components/suggested-questions/suggestions.js +30 -30
- package/dist/esm/lib/components/welcome-message/contextual-items-message.js +36 -38
- package/dist/esm/lib/components/welcome-message/items-dropdown.js +27 -27
- package/dist/esm/lib/hooks/usePromptFocus.js +13 -14
- package/dist/i18n/en-x-pseudo.js +89 -89
- package/dist/i18n/en-x-pseudo.properties +89 -89
- package/dist/styles/answer-content.css +1 -1
- package/dist/styles/answer.css +1 -1
- package/dist/styles/box-ai-content-answers.css +1 -1
- package/dist/styles/chat.css +1 -1
- package/dist/styles/clear-conversation-button.css +1 -1
- package/dist/styles/content.css +1 -1
- package/dist/styles/content2.css +1 -1
- package/dist/styles/markdown2.css +1 -1
- package/dist/styles/question.css +1 -1
- package/dist/styles/stopResponseButton.css +1 -1
- package/dist/styles/warning-message.css +1 -1
- package/dist/types/lib/components/api-wrapper/hooks/useContentAnswers.d.ts +1 -1
- package/package.json +11 -11
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
import f, { FETCH_TIMEOUT as p } from "./stream.js";
|
|
2
|
+
const w = (i, e, t) => setTimeout(() => {
|
|
3
|
+
f.abortRequest(i), t && t({
|
|
4
4
|
eventType: "ai-client-initial-streaming-timeout-error",
|
|
5
5
|
message: "Initial streaming timeout error",
|
|
6
6
|
origin: "AIClientErrorLog"
|
|
7
7
|
});
|
|
8
|
-
}, e),
|
|
9
|
-
let
|
|
10
|
-
const
|
|
11
|
-
return e &&
|
|
8
|
+
}, e), b = async (i, e = !1, t, o, r, a, s, l, u, m, T) => {
|
|
9
|
+
let n;
|
|
10
|
+
const c = m?.initial || p.initial, g = w(t, c, T);
|
|
11
|
+
return e && l ? n = await l(i, o, r, u, a) : s && (n = await s(i, o, r, a)), clearTimeout(g), n;
|
|
12
12
|
};
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
b as getAnswerRequest
|
|
15
15
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { A as
|
|
3
|
-
const
|
|
1
|
+
import O from "lodash/camelCase";
|
|
2
|
+
import { A as u } from "../../../../../chunks/types.js";
|
|
3
|
+
const C = {
|
|
4
4
|
chunk: 15 * 1e3,
|
|
5
5
|
// fetch timeout for each chunk. We need to abort the fetch if needed.
|
|
6
6
|
initial: 45 * 1e3
|
|
7
7
|
// latency p99 (30s) + buffer. Other host integrations can override this value.
|
|
8
|
-
},
|
|
9
|
-
RESPONSE_FAILED:
|
|
10
|
-
RESPONSE_INTERRUPTED:
|
|
11
|
-
RESPONSE_STOPPED:
|
|
12
|
-
},
|
|
8
|
+
}, E = {
|
|
9
|
+
RESPONSE_FAILED: u.RESPONSE_FAILED,
|
|
10
|
+
RESPONSE_INTERRUPTED: u.RESPONSE_INTERRUPTED,
|
|
11
|
+
RESPONSE_STOPPED: u.RESPONSE_STOPPED
|
|
12
|
+
}, d = {
|
|
13
13
|
CONTINUE: "continue",
|
|
14
14
|
DONE: "done",
|
|
15
15
|
ERROR: "error"
|
|
16
16
|
};
|
|
17
|
-
class
|
|
17
|
+
class T {
|
|
18
18
|
constructor() {
|
|
19
|
-
this.abortControllerMap = /* @__PURE__ */ new Map(), this.chunkTimeout =
|
|
19
|
+
this.abortControllerMap = /* @__PURE__ */ new Map(), this.chunkTimeout = C.chunk;
|
|
20
20
|
}
|
|
21
21
|
abortRequest(r, e = !1) {
|
|
22
22
|
const t = this.abortControllerMap.get(r);
|
|
@@ -62,9 +62,9 @@ class f {
|
|
|
62
62
|
n.forEach((h) => {
|
|
63
63
|
try {
|
|
64
64
|
const a = JSON.parse(h);
|
|
65
|
-
a[t] && (s += a[t]), a.thinking_answer && (r.thinkingAnswer || (r.thinkingAnswer = ""), r.thinkingAnswer += a.thinking_answer), Object.entries(a).forEach(([
|
|
66
|
-
const
|
|
67
|
-
|
|
65
|
+
a[t] && (s += a[t]), a.thinking_answer && (r.thinkingAnswer || (r.thinkingAnswer = ""), r.thinkingAnswer += a.thinking_answer), Object.entries(a).forEach(([c, f]) => {
|
|
66
|
+
const N = O(c);
|
|
67
|
+
N !== t && N !== "thinkingAnswer" && (r[N] = f);
|
|
68
68
|
});
|
|
69
69
|
} catch (a) {
|
|
70
70
|
console.error("Failed to parse NDJSON line:", a);
|
|
@@ -72,9 +72,8 @@ class f {
|
|
|
72
72
|
}), r.data += s;
|
|
73
73
|
}
|
|
74
74
|
receiveStreamedResponse(r, e, t, o = "answer", i, n) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if (this.chunkTimeout = (i == null ? void 0 : i.chunk) || d.chunk, !s) {
|
|
75
|
+
const l = this.initializeStreamedResponseState(), s = e.body?.getReader();
|
|
76
|
+
if (this.chunkTimeout = i?.chunk || C.chunk, !s) {
|
|
78
77
|
this.handleNoResponseBody(t, l);
|
|
79
78
|
return;
|
|
80
79
|
}
|
|
@@ -107,16 +106,16 @@ class f {
|
|
|
107
106
|
const {
|
|
108
107
|
completionReason: l
|
|
109
108
|
} = i;
|
|
110
|
-
i.isCompleted = t.done || l !== null, t.value && this.parseNDJSON(i, t.value, n), i.isCompleted && (this.removeAbortController(o), l !==
|
|
109
|
+
i.isCompleted = t.done || l !== null, t.value && this.parseNDJSON(i, t.value, n), i.isCompleted && (this.removeAbortController(o), l !== d.DONE && (i.data ? i.error = l === d.CONTINUE ? E.RESPONSE_INTERRUPTED : E.RESPONSE_FAILED : i.error = u.NO_CONTENT)), e(i);
|
|
111
110
|
}
|
|
112
111
|
handleChunkError(r, e, t, o) {
|
|
113
|
-
o.error =
|
|
112
|
+
o.error = E.RESPONSE_FAILED;
|
|
114
113
|
const i = this.abortControllerMap.get(t);
|
|
115
|
-
i && i.isUserInitiatedAbort && (o.error =
|
|
114
|
+
i && i.isUserInitiatedAbort && (o.error = E.RESPONSE_STOPPED, o.isAborted = i.isUserInitiatedAbort), o.isCompleted = !0, this.removeAbortController(t), clearTimeout(r), e(o);
|
|
116
115
|
}
|
|
117
116
|
// eslint-disable-next-line class-methods-use-this
|
|
118
117
|
handleNoResponseBody(r, e) {
|
|
119
|
-
e.error =
|
|
118
|
+
e.error = u.NO_CONTENT, e.isCompleted = !0, r(e);
|
|
120
119
|
}
|
|
121
120
|
removeAbortController(r) {
|
|
122
121
|
this.abortControllerMap.delete(r);
|
|
@@ -131,10 +130,10 @@ class f {
|
|
|
131
130
|
}, this.chunkTimeout);
|
|
132
131
|
}
|
|
133
132
|
}
|
|
134
|
-
const
|
|
133
|
+
const A = new T();
|
|
135
134
|
export {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
135
|
+
C as FETCH_TIMEOUT,
|
|
136
|
+
d as STREAMING_COMPLETION_REASON,
|
|
137
|
+
E as STREAM_ERROR,
|
|
138
|
+
A as default
|
|
140
139
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Text as w } from "@box/blueprint-web";
|
|
2
2
|
import { BoxAiLogo as L } from "@box/blueprint-web-assets/icons/Logo";
|
|
3
|
-
import { Size10 as
|
|
3
|
+
import { Size10 as f } from "@box/blueprint-web-assets/tokens/tokens";
|
|
4
4
|
import P from "clsx";
|
|
5
5
|
import * as S from "react";
|
|
6
6
|
import { useIntl as ee } from "react-intl";
|
|
@@ -9,59 +9,58 @@ import { MediaContainer as oe } from "../common/media-container.js";
|
|
|
9
9
|
import { Question as ae } from "../question/question.js";
|
|
10
10
|
import { SuggestedQuestions as ie } from "../suggested-questions/suggested-questions.js";
|
|
11
11
|
import { ThinkingBubble as re } from "../thinkingBubble/thinkingBubble.js";
|
|
12
|
-
import
|
|
13
|
-
import { WelcomeMessage as
|
|
14
|
-
import { jsx as e, jsxs as
|
|
15
|
-
import '../../../../styles/chat.css';const
|
|
16
|
-
chat:
|
|
17
|
-
clearChatText:
|
|
18
|
-
landingPage:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
sidebar: xe
|
|
12
|
+
import ne from "../welcome-message/messages.js";
|
|
13
|
+
import { WelcomeMessage as se } from "../welcome-message/welcome-message.js";
|
|
14
|
+
import { jsx as e, jsxs as h } from "react/jsx-runtime";
|
|
15
|
+
import '../../../../styles/chat.css';const me = "_chat_15mnd_2", ce = "_clearChatText_15mnd_2", le = "_landingPage_15mnd_8", de = "_iconAvatar_15mnd_24", pe = "_sidebar_15mnd_42", a = {
|
|
16
|
+
chat: me,
|
|
17
|
+
clearChatText: ce,
|
|
18
|
+
landingPage: le,
|
|
19
|
+
iconAvatar: de,
|
|
20
|
+
sidebar: pe
|
|
22
21
|
}, Ne = ({
|
|
23
22
|
askSuggestedQuestion: _,
|
|
24
|
-
contentType:
|
|
25
|
-
hasCustomSuggestedQuestions:
|
|
26
|
-
hasRequestInProgress:
|
|
27
|
-
isCitationsEnabled:
|
|
23
|
+
contentType: s,
|
|
24
|
+
hasCustomSuggestedQuestions: T,
|
|
25
|
+
hasRequestInProgress: b,
|
|
26
|
+
isCitationsEnabled: x,
|
|
28
27
|
isFeedbackEnabled: C,
|
|
29
28
|
isFeedbackFormEnabled: g,
|
|
30
|
-
isInlineCitationsEnabled:
|
|
31
|
-
isInlineCitationV2Enabled:
|
|
32
|
-
isMarkdownEnabled:
|
|
33
|
-
isSessionLoading:
|
|
34
|
-
onCitationClick:
|
|
35
|
-
onAnswerCopy:
|
|
36
|
-
embedTheAnswerButtonConfig:
|
|
37
|
-
onFeedbackFormSubmit:
|
|
38
|
-
onDropdownOpenChange:
|
|
39
|
-
onSuggestedQuestionInteraction:
|
|
40
|
-
questions:
|
|
41
|
-
recordAction:
|
|
42
|
-
setAnswerFeedback:
|
|
43
|
-
setAskSuggestedQuestion:
|
|
44
|
-
suggestedQuestions:
|
|
45
|
-
suggestedQuestionsRequestState:
|
|
46
|
-
shouldFeedbackFormIncludeFeedbackText:
|
|
47
|
-
shouldFeedbackIncludePromptData:
|
|
29
|
+
isInlineCitationsEnabled: F = !1,
|
|
30
|
+
isInlineCitationV2Enabled: k,
|
|
31
|
+
isMarkdownEnabled: u,
|
|
32
|
+
isSessionLoading: A = !1,
|
|
33
|
+
onCitationClick: I,
|
|
34
|
+
onAnswerCopy: N,
|
|
35
|
+
embedTheAnswerButtonConfig: O,
|
|
36
|
+
onFeedbackFormSubmit: v,
|
|
37
|
+
onDropdownOpenChange: j,
|
|
38
|
+
onSuggestedQuestionInteraction: y,
|
|
39
|
+
questions: B,
|
|
40
|
+
recordAction: m,
|
|
41
|
+
setAnswerFeedback: M,
|
|
42
|
+
setAskSuggestedQuestion: c,
|
|
43
|
+
suggestedQuestions: l,
|
|
44
|
+
suggestedQuestionsRequestState: q,
|
|
45
|
+
shouldFeedbackFormIncludeFeedbackText: z,
|
|
46
|
+
shouldFeedbackIncludePromptData: R,
|
|
48
47
|
shouldShowLandingPage: o,
|
|
49
|
-
useAnimation:
|
|
48
|
+
useAnimation: W,
|
|
50
49
|
variant: t = "modal",
|
|
51
|
-
hostAppName:
|
|
52
|
-
isReactMarkdownEnabled:
|
|
53
|
-
welcomeMessageClearText:
|
|
50
|
+
hostAppName: D = "",
|
|
51
|
+
isReactMarkdownEnabled: E,
|
|
52
|
+
welcomeMessageClearText: G,
|
|
54
53
|
...d
|
|
55
54
|
}) => {
|
|
56
55
|
const {
|
|
57
|
-
formatMessage:
|
|
58
|
-
} = ee(), [
|
|
59
|
-
|
|
56
|
+
formatMessage: H
|
|
57
|
+
} = ee(), [J, K] = S.useState(null), Q = (i, r) => {
|
|
58
|
+
K(i ? r : null);
|
|
60
59
|
};
|
|
61
60
|
return /* @__PURE__ */ e("div", {
|
|
62
61
|
className: a.chat,
|
|
63
62
|
"data-testid": "content-answers-chat",
|
|
64
|
-
children: /* @__PURE__ */
|
|
63
|
+
children: /* @__PURE__ */ h("div", {
|
|
65
64
|
className: P({
|
|
66
65
|
[a.landingPage]: o,
|
|
67
66
|
[a.sidebar]: t === "sidebar"
|
|
@@ -71,87 +70,87 @@ import '../../../../styles/chat.css';const ce = "_chat_1dqxr_2", le = "_clearCha
|
|
|
71
70
|
children: /* @__PURE__ */ e("div", {
|
|
72
71
|
className: a.iconAvatar,
|
|
73
72
|
children: /* @__PURE__ */ e(L, {
|
|
74
|
-
height:
|
|
73
|
+
height: f,
|
|
75
74
|
role: "presentation",
|
|
76
|
-
width:
|
|
75
|
+
width: f
|
|
77
76
|
})
|
|
78
77
|
})
|
|
79
|
-
}), /* @__PURE__ */ e(
|
|
78
|
+
}), /* @__PURE__ */ e(se, {
|
|
80
79
|
contentType: "",
|
|
81
80
|
shouldShowLandingPage: o,
|
|
82
81
|
...d,
|
|
83
82
|
variant: t
|
|
84
|
-
}), o &&
|
|
83
|
+
}), o && l !== void 0 && c !== void 0 && /* @__PURE__ */ e(ie, {
|
|
85
84
|
askSuggestedQuestion: _,
|
|
86
|
-
hasCustomSuggestedQuestions:
|
|
87
|
-
isLoading:
|
|
88
|
-
onSuggestedQuestionInteraction:
|
|
89
|
-
recordAction:
|
|
90
|
-
setAskSuggestedQuestion:
|
|
91
|
-
suggestedQuestions:
|
|
92
|
-
suggestedQuestionsRequestState:
|
|
85
|
+
hasCustomSuggestedQuestions: T,
|
|
86
|
+
isLoading: b,
|
|
87
|
+
onSuggestedQuestionInteraction: y,
|
|
88
|
+
recordAction: m,
|
|
89
|
+
setAskSuggestedQuestion: c,
|
|
90
|
+
suggestedQuestions: l,
|
|
91
|
+
suggestedQuestionsRequestState: q,
|
|
93
92
|
variant: t
|
|
94
93
|
}), /* @__PURE__ */ e(w, {
|
|
95
94
|
as: "p",
|
|
96
95
|
className: a.clearChatText,
|
|
97
|
-
children:
|
|
98
|
-
type:
|
|
96
|
+
children: G || H(ne.welcomeClearChatText, {
|
|
97
|
+
type: s
|
|
99
98
|
})
|
|
100
99
|
}), !o && /* @__PURE__ */ e("ul", {
|
|
101
|
-
children:
|
|
100
|
+
children: B.map(({
|
|
102
101
|
answer: i,
|
|
103
102
|
thinkingAnswer: r,
|
|
104
103
|
citations: U,
|
|
105
|
-
id:
|
|
104
|
+
id: n,
|
|
106
105
|
isCompleted: V,
|
|
107
106
|
isLoading: X,
|
|
108
107
|
error: Y,
|
|
109
108
|
prompt: p,
|
|
110
109
|
promptType: Z,
|
|
111
110
|
feedbackValue: $
|
|
112
|
-
}) => /* @__PURE__ */
|
|
111
|
+
}) => /* @__PURE__ */ h("li", {
|
|
113
112
|
children: [/* @__PURE__ */ e(ae, {
|
|
114
113
|
prompt: p,
|
|
115
114
|
variant: t
|
|
116
115
|
}), r && /* @__PURE__ */ e(re, {
|
|
117
116
|
content: r,
|
|
118
117
|
isThinkingComplete: !!i,
|
|
119
|
-
onDropdownOpenChange:
|
|
118
|
+
onDropdownOpenChange: j,
|
|
120
119
|
variant: t
|
|
121
120
|
}), /* @__PURE__ */ e(te, {
|
|
122
121
|
answer: i,
|
|
123
122
|
citations: U,
|
|
124
|
-
contentType:
|
|
125
|
-
embedTheAnswerButtonConfig:
|
|
123
|
+
contentType: s,
|
|
124
|
+
embedTheAnswerButtonConfig: O,
|
|
126
125
|
error: Y,
|
|
127
126
|
feedbackValue: $,
|
|
128
|
-
hostAppName:
|
|
129
|
-
isCitationsEnabled:
|
|
127
|
+
hostAppName: D,
|
|
128
|
+
isCitationsEnabled: x,
|
|
130
129
|
isCompleted: V,
|
|
131
130
|
isFeedbackEnabled: C,
|
|
132
131
|
isFeedbackFormEnabled: g,
|
|
133
|
-
isFeedbackTooltipOpen:
|
|
134
|
-
isInlineCitationsEnabled:
|
|
135
|
-
isInlineCitationV2Enabled:
|
|
136
|
-
isLoading: X ||
|
|
137
|
-
isMarkdownEnabled:
|
|
138
|
-
isReactMarkdownEnabled:
|
|
132
|
+
isFeedbackTooltipOpen: J === n,
|
|
133
|
+
isInlineCitationsEnabled: F,
|
|
134
|
+
isInlineCitationV2Enabled: k,
|
|
135
|
+
isLoading: X || A,
|
|
136
|
+
isMarkdownEnabled: u,
|
|
137
|
+
isReactMarkdownEnabled: E,
|
|
139
138
|
items: d.items,
|
|
140
|
-
onAnswerCopy:
|
|
141
|
-
onCitationClick:
|
|
142
|
-
onFeedbackFormSubmit:
|
|
143
|
-
onFeedbackTooltipOpenChange:
|
|
139
|
+
onAnswerCopy: N,
|
|
140
|
+
onCitationClick: I,
|
|
141
|
+
onFeedbackFormSubmit: v,
|
|
142
|
+
onFeedbackTooltipOpenChange: Q,
|
|
144
143
|
prompt: p,
|
|
145
144
|
promptType: Z,
|
|
146
|
-
questionId:
|
|
147
|
-
recordAction:
|
|
148
|
-
setAnswerFeedback:
|
|
149
|
-
shouldFeedbackFormIncludeFeedbackText:
|
|
150
|
-
shouldFeedbackIncludePromptData:
|
|
151
|
-
useAnimation:
|
|
145
|
+
questionId: n,
|
|
146
|
+
recordAction: m,
|
|
147
|
+
setAnswerFeedback: M,
|
|
148
|
+
shouldFeedbackFormIncludeFeedbackText: z,
|
|
149
|
+
shouldFeedbackIncludePromptData: R,
|
|
150
|
+
useAnimation: W,
|
|
152
151
|
variant: t
|
|
153
152
|
})]
|
|
154
|
-
},
|
|
153
|
+
}, n))
|
|
155
154
|
})]
|
|
156
155
|
})
|
|
157
156
|
});
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { INPUT_TARGET_ID as t } from "../footer/constants.js";
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
o == null || o.focus();
|
|
2
|
+
function n() {
|
|
3
|
+
document.querySelector(`[data-target-id="${t}"]`)?.focus();
|
|
5
4
|
}
|
|
6
5
|
export {
|
|
7
|
-
|
|
6
|
+
n as focusInput
|
|
8
7
|
};
|
|
@@ -1,136 +1,134 @@
|
|
|
1
|
-
import { Link as
|
|
2
|
-
import
|
|
1
|
+
import { Link as d } from "@box/blueprint-web";
|
|
2
|
+
import p from "react-markdown";
|
|
3
3
|
import f from "remark-gfm";
|
|
4
|
-
import { isBoxDomain as
|
|
5
|
-
import
|
|
4
|
+
import { isBoxDomain as h, isBoxCitation as k } from "../../utils/inlineCitationsUtils.js";
|
|
5
|
+
import N from "./inline-citation.js";
|
|
6
6
|
import { s as r } from "../../../../chunks/markdown.module.js";
|
|
7
|
-
import {
|
|
8
|
-
const
|
|
9
|
-
children:
|
|
10
|
-
className:
|
|
7
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
8
|
+
const b = (n) => n?.startsWith("#user-content-fn") ?? !1, g = (n) => n ? k(n) : !1, j = (n) => n ? n.startsWith("http://") || n.startsWith("https://") : !1, x = (n) => n ? h(n) : !1, C = ({
|
|
9
|
+
children: n,
|
|
10
|
+
className: t
|
|
11
11
|
}) => {
|
|
12
|
-
const
|
|
12
|
+
const i = t ? t.replace("language-", "") : "", l = (o) => o.trim().split(/\r?\n/).map((a, u) => /* @__PURE__ */ c("div", {
|
|
13
13
|
className: "hljs-line",
|
|
14
|
-
children: [/* @__PURE__ */
|
|
14
|
+
children: [/* @__PURE__ */ e("span", {
|
|
15
15
|
className: "hljs-line-number",
|
|
16
|
-
children:
|
|
17
|
-
}), /* @__PURE__ */
|
|
16
|
+
children: u + 1
|
|
17
|
+
}), /* @__PURE__ */ e("span", {
|
|
18
18
|
className: "hljs-line-content",
|
|
19
|
-
children:
|
|
19
|
+
children: a
|
|
20
20
|
})]
|
|
21
|
-
}, `line-${
|
|
22
|
-
return /* @__PURE__ */
|
|
21
|
+
}, `line-${a.substring(0, 20)}-${Date.now()}`));
|
|
22
|
+
return /* @__PURE__ */ c("div", {
|
|
23
23
|
className: r.hljs,
|
|
24
|
-
children: [/* @__PURE__ */
|
|
24
|
+
children: [/* @__PURE__ */ e("span", {
|
|
25
25
|
className: r.hljsLanguage,
|
|
26
|
-
children:
|
|
27
|
-
}), /* @__PURE__ */
|
|
28
|
-
children:
|
|
26
|
+
children: i || "auto"
|
|
27
|
+
}), /* @__PURE__ */ e("code", {
|
|
28
|
+
children: l(n)
|
|
29
29
|
})]
|
|
30
30
|
});
|
|
31
|
-
},
|
|
32
|
-
children:
|
|
33
|
-
}) => /* @__PURE__ */
|
|
31
|
+
}, L = ({
|
|
32
|
+
children: n
|
|
33
|
+
}) => /* @__PURE__ */ e("div", {
|
|
34
34
|
className: r.tableWrapper,
|
|
35
|
-
children: /* @__PURE__ */
|
|
36
|
-
children:
|
|
35
|
+
children: /* @__PURE__ */ e("table", {
|
|
36
|
+
children: n
|
|
37
37
|
})
|
|
38
|
-
}),
|
|
39
|
-
children:
|
|
40
|
-
href:
|
|
41
|
-
}) => !
|
|
42
|
-
href:
|
|
38
|
+
}), m = ({
|
|
39
|
+
children: n,
|
|
40
|
+
href: t
|
|
41
|
+
}) => !t || t === "" ? null : x(t) ? /* @__PURE__ */ e("a", {
|
|
42
|
+
href: t,
|
|
43
43
|
rel: "noopener noreferrer",
|
|
44
44
|
target: "_blank",
|
|
45
|
-
children:
|
|
46
|
-
}) : /* @__PURE__ */
|
|
47
|
-
children: [
|
|
48
|
-
}),
|
|
49
|
-
children:
|
|
50
|
-
}) => /* @__PURE__ */
|
|
45
|
+
children: n
|
|
46
|
+
}) : /* @__PURE__ */ c("span", {
|
|
47
|
+
children: [n, " (", t, ")"]
|
|
48
|
+
}), v = ({
|
|
49
|
+
children: n
|
|
50
|
+
}) => /* @__PURE__ */ e("blockquote", {
|
|
51
51
|
className: r.blockquote,
|
|
52
|
-
children:
|
|
53
|
-
}),
|
|
54
|
-
children:
|
|
55
|
-
}) => /* @__PURE__ */
|
|
52
|
+
children: n
|
|
53
|
+
}), B = ({
|
|
54
|
+
children: n
|
|
55
|
+
}) => /* @__PURE__ */ e("ol", {
|
|
56
56
|
className: r.orderedList,
|
|
57
|
-
children:
|
|
58
|
-
}),
|
|
59
|
-
children:
|
|
57
|
+
children: n
|
|
58
|
+
}), q = ({
|
|
59
|
+
children: n
|
|
60
60
|
}) => {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return /* @__PURE__ */ n("span", {
|
|
61
|
+
const t = n?.toString().match(/^(\d+)/)?.[1] || n;
|
|
62
|
+
return /* @__PURE__ */ e("span", {
|
|
64
63
|
className: r.footnote,
|
|
65
|
-
children:
|
|
64
|
+
children: t
|
|
66
65
|
});
|
|
67
|
-
},
|
|
68
|
-
code:
|
|
69
|
-
table:
|
|
70
|
-
blockquote:
|
|
71
|
-
ol:
|
|
72
|
-
sup:
|
|
66
|
+
}, w = {
|
|
67
|
+
code: C,
|
|
68
|
+
table: L,
|
|
69
|
+
blockquote: v,
|
|
70
|
+
ol: B,
|
|
71
|
+
sup: q,
|
|
73
72
|
p: ({
|
|
74
|
-
children:
|
|
75
|
-
}) => /* @__PURE__ */
|
|
73
|
+
children: n
|
|
74
|
+
}) => /* @__PURE__ */ e("div", {
|
|
76
75
|
className: r.inlineParagraph,
|
|
77
|
-
children:
|
|
76
|
+
children: n
|
|
78
77
|
}),
|
|
79
|
-
a:
|
|
78
|
+
a: m
|
|
80
79
|
}, M = ({
|
|
81
|
-
children:
|
|
82
|
-
isInlineCitationV2Enabled:
|
|
80
|
+
children: n,
|
|
81
|
+
isInlineCitationV2Enabled: t = !1
|
|
83
82
|
}) => {
|
|
84
|
-
const
|
|
85
|
-
...
|
|
86
|
-
a: (
|
|
87
|
-
var i;
|
|
83
|
+
const i = {
|
|
84
|
+
...w,
|
|
85
|
+
a: (l) => {
|
|
88
86
|
const {
|
|
89
|
-
href:
|
|
90
|
-
children:
|
|
91
|
-
} =
|
|
92
|
-
if (
|
|
93
|
-
const
|
|
94
|
-
return /* @__PURE__ */
|
|
95
|
-
href:
|
|
96
|
-
children: /* @__PURE__ */
|
|
87
|
+
href: o,
|
|
88
|
+
children: s
|
|
89
|
+
} = l;
|
|
90
|
+
if (b(o)) {
|
|
91
|
+
const a = s?.toString().match(/^(\d+)/)?.[1] || s;
|
|
92
|
+
return /* @__PURE__ */ e(d, {
|
|
93
|
+
href: o,
|
|
94
|
+
children: /* @__PURE__ */ e("span", {
|
|
97
95
|
className: r.footnoteReference,
|
|
98
|
-
children:
|
|
96
|
+
children: a
|
|
99
97
|
})
|
|
100
98
|
});
|
|
101
99
|
}
|
|
102
|
-
if (
|
|
103
|
-
const
|
|
104
|
-
return /* @__PURE__ */
|
|
105
|
-
fileName:
|
|
106
|
-
href:
|
|
107
|
-
isInlineCitationV2Enabled:
|
|
100
|
+
if (g(o)) {
|
|
101
|
+
const a = s?.toString() || "";
|
|
102
|
+
return /* @__PURE__ */ e(N, {
|
|
103
|
+
fileName: a,
|
|
104
|
+
href: o,
|
|
105
|
+
isInlineCitationV2Enabled: t
|
|
108
106
|
});
|
|
109
107
|
}
|
|
110
|
-
return j(
|
|
111
|
-
href:
|
|
112
|
-
children:
|
|
113
|
-
}) : /* @__PURE__ */
|
|
114
|
-
href:
|
|
115
|
-
children:
|
|
108
|
+
return j(o) ? /* @__PURE__ */ e(m, {
|
|
109
|
+
href: o,
|
|
110
|
+
children: s
|
|
111
|
+
}) : /* @__PURE__ */ e(m, {
|
|
112
|
+
href: o,
|
|
113
|
+
children: s
|
|
116
114
|
});
|
|
117
115
|
}
|
|
118
116
|
};
|
|
119
|
-
return /* @__PURE__ */
|
|
117
|
+
return /* @__PURE__ */ e("div", {
|
|
120
118
|
className: r.markdownContent,
|
|
121
|
-
children: /* @__PURE__ */
|
|
122
|
-
components:
|
|
119
|
+
children: /* @__PURE__ */ e(p, {
|
|
120
|
+
components: i,
|
|
123
121
|
remarkPlugins: [f],
|
|
124
|
-
children:
|
|
122
|
+
children: n
|
|
125
123
|
})
|
|
126
124
|
});
|
|
127
125
|
};
|
|
128
126
|
export {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
127
|
+
v as Blockquote,
|
|
128
|
+
C as CodeBlock,
|
|
129
|
+
q as Footnote,
|
|
130
|
+
m as Link,
|
|
131
|
+
B as Ol,
|
|
132
|
+
L as Table,
|
|
135
133
|
M as default
|
|
136
134
|
};
|