markdown-flow-ui 0.3.11 → 0.3.13

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.
Files changed (113) hide show
  1. package/README.md +50 -0
  2. package/dist/_virtual/index10.cjs +1 -1
  3. package/dist/_virtual/index10.es.js +3 -2
  4. package/dist/_virtual/index10.es.js.map +1 -1
  5. package/dist/_virtual/index11.cjs +1 -1
  6. package/dist/_virtual/index11.es.js +2 -3
  7. package/dist/_virtual/index11.es.js.map +1 -1
  8. package/dist/_virtual/index3.cjs +1 -1
  9. package/dist/_virtual/index3.es.js +5 -4
  10. package/dist/_virtual/index3.es.js.map +1 -1
  11. package/dist/_virtual/index4.cjs +1 -1
  12. package/dist/_virtual/index4.es.js +4 -5
  13. package/dist/_virtual/index4.es.js.map +1 -1
  14. package/dist/_virtual/index6.cjs +1 -1
  15. package/dist/_virtual/index6.es.js +2 -3
  16. package/dist/_virtual/index6.es.js.map +1 -1
  17. package/dist/_virtual/index7.cjs +1 -1
  18. package/dist/_virtual/index7.es.js +3 -5
  19. package/dist/_virtual/index7.es.js.map +1 -1
  20. package/dist/_virtual/index8.cjs +1 -1
  21. package/dist/_virtual/index8.es.js +5 -2
  22. package/dist/_virtual/index8.es.js.map +1 -1
  23. package/dist/_virtual/index9.cjs +1 -1
  24. package/dist/_virtual/index9.es.js +2 -2
  25. package/dist/assets/markdown-flow-ui.css +1 -1
  26. package/dist/components/ContentRender/ContentRender.cjs +2 -2
  27. package/dist/components/ContentRender/ContentRender.cjs.map +1 -1
  28. package/dist/components/ContentRender/ContentRender.d.ts +5 -0
  29. package/dist/components/ContentRender/ContentRender.es.js +405 -394
  30. package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
  31. package/dist/components/ContentRender/ImageInputGroup.cjs +2 -0
  32. package/dist/components/ContentRender/ImageInputGroup.cjs.map +1 -0
  33. package/dist/components/ContentRender/ImageInputGroup.d.ts +31 -0
  34. package/dist/components/ContentRender/ImageInputGroup.es.js +101 -0
  35. package/dist/components/ContentRender/ImageInputGroup.es.js.map +1 -0
  36. package/dist/components/ContentRender/MarkdownFlowInput.cjs +1 -1
  37. package/dist/components/ContentRender/MarkdownFlowInput.cjs.map +1 -1
  38. package/dist/components/ContentRender/MarkdownFlowInput.d.ts +5 -0
  39. package/dist/components/ContentRender/MarkdownFlowInput.es.js +54 -50
  40. package/dist/components/ContentRender/MarkdownFlowInput.es.js.map +1 -1
  41. package/dist/components/ContentRender/contentRenderI18n.cjs.map +1 -1
  42. package/dist/components/ContentRender/contentRenderI18n.d.ts +4 -0
  43. package/dist/components/ContentRender/contentRenderI18n.es.js.map +1 -1
  44. package/dist/components/ContentRender/locales/contentRender.json.cjs +1 -1
  45. package/dist/components/ContentRender/locales/contentRender.json.d.ts +55 -11
  46. package/dist/components/ContentRender/locales/contentRender.json.es.js +11 -11
  47. package/dist/components/ContentRender/plugins/CustomVariable.cjs +1 -1
  48. package/dist/components/ContentRender/plugins/CustomVariable.cjs.map +1 -1
  49. package/dist/components/ContentRender/plugins/CustomVariable.d.ts +4 -1
  50. package/dist/components/ContentRender/plugins/CustomVariable.es.js +212 -173
  51. package/dist/components/ContentRender/plugins/CustomVariable.es.js.map +1 -1
  52. package/dist/components/MarkdownFlow/MarkdownFlow.cjs +1 -1
  53. package/dist/components/MarkdownFlow/MarkdownFlow.cjs.map +1 -1
  54. package/dist/components/MarkdownFlow/MarkdownFlow.d.ts +7 -0
  55. package/dist/components/MarkdownFlow/MarkdownFlow.es.js +63 -53
  56. package/dist/components/MarkdownFlow/MarkdownFlow.es.js.map +1 -1
  57. package/dist/components/Slide/Slide.cjs +1 -1
  58. package/dist/components/Slide/Slide.cjs.map +1 -1
  59. package/dist/components/Slide/Slide.d.ts +5 -0
  60. package/dist/components/Slide/Slide.es.js +638 -621
  61. package/dist/components/Slide/Slide.es.js.map +1 -1
  62. package/dist/components/Slide/utils/interactionResolution.cjs +1 -1
  63. package/dist/components/Slide/utils/interactionResolution.cjs.map +1 -1
  64. package/dist/components/Slide/utils/interactionResolution.es.js +15 -15
  65. package/dist/components/Slide/utils/interactionResolution.es.js.map +1 -1
  66. package/dist/components/types.d.ts +2 -0
  67. package/dist/components/ui/inputGroup/textarea.cjs +1 -1
  68. package/dist/components/ui/inputGroup/textarea.es.js +1 -1
  69. package/dist/lib/interaction-defaults.cjs +1 -1
  70. package/dist/lib/interaction-defaults.cjs.map +1 -1
  71. package/dist/lib/interaction-defaults.d.ts +4 -0
  72. package/dist/lib/interaction-defaults.es.js +47 -41
  73. package/dist/lib/interaction-defaults.es.js.map +1 -1
  74. package/dist/markdown-flow-ui-lib.css +1 -1
  75. package/dist/markdown-flow-ui.css +1 -1
  76. package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs +1 -1
  77. package/dist/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
  78. package/dist/node_modules/classnames/index.cjs +1 -1
  79. package/dist/node_modules/classnames/index.es.js +1 -1
  80. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.cjs +1 -1
  81. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.es.js +1 -1
  82. package/dist/node_modules/lucide-react/dist/esm/icons/image-plus.cjs +2 -0
  83. package/dist/node_modules/lucide-react/dist/esm/icons/image-plus.cjs.map +1 -0
  84. package/dist/node_modules/lucide-react/dist/esm/icons/image-plus.es.js +19 -0
  85. package/dist/node_modules/lucide-react/dist/esm/icons/image-plus.es.js.map +1 -0
  86. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-6MUBBAK2.cjs +1 -1
  87. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-6MUBBAK2.es.js +1 -1
  88. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-HFQBQIA3.cjs +1 -1
  89. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-HFQBQIA3.es.js +1 -1
  90. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-MALGAFMO.cjs +1 -1
  91. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-MALGAFMO.es.js +1 -1
  92. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-23REXITY.cjs +1 -1
  93. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-23REXITY.es.js +1 -1
  94. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-5NDRBG5M.cjs +1 -1
  95. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-5NDRBG5M.es.js +1 -1
  96. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/swimlanesDiagram-OMPLPG4O.cjs +1 -1
  97. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/swimlanesDiagram-OMPLPG4O.es.js +1 -1
  98. package/dist/node_modules/rc-input/es/BaseInput.cjs +1 -1
  99. package/dist/node_modules/rc-input/es/BaseInput.es.js +1 -1
  100. package/dist/node_modules/rc-textarea/es/ResizableTextArea.cjs +1 -1
  101. package/dist/node_modules/rc-textarea/es/ResizableTextArea.es.js +1 -1
  102. package/dist/node_modules/rc-textarea/es/TextArea.cjs +1 -1
  103. package/dist/node_modules/rc-textarea/es/TextArea.es.js +1 -1
  104. package/dist/node_modules/rc-textarea/es/index.cjs +1 -1
  105. package/dist/node_modules/rc-textarea/es/index.es.js +1 -1
  106. package/dist/node_modules/rc-util/es/ref.cjs +1 -1
  107. package/dist/node_modules/rc-util/es/ref.es.js +1 -1
  108. package/dist/node_modules/remark-flow/dist/interaction-plugin-core.cjs +1 -1
  109. package/dist/node_modules/remark-flow/dist/interaction-plugin-core.es.js +1 -1
  110. package/dist/node_modules/style-to-object/cjs/index.cjs +1 -1
  111. package/dist/node_modules/style-to-object/cjs/index.es.js +1 -1
  112. package/dist/renderer.d.ts +1 -0
  113. package/package.json +2 -2
@@ -1,98 +1,98 @@
1
- import { jsx as s, jsxs as Fe, Fragment as dt } from "react/jsx-runtime";
2
- import { d as Ge } from "../../_virtual/index.es.js";
3
- import X, { useMemo as h, useState as _e, useRef as b, useEffect as te } from "react";
4
- import { sanitizeInvalidTagName as mt } from "./utils/sanitize-invalid-tag-name.es.js";
5
- import { stripSvgTextLineBreaks as pt } from "./utils/strip-svg-text-line-breaks.es.js";
1
+ import { jsx as s, jsxs as qe, Fragment as gt } from "react/jsx-runtime";
2
+ import { d as Qe } from "../../_virtual/index.es.js";
3
+ import X, { useMemo as h, useState as Oe, useRef as T, useEffect as re } from "react";
4
+ import { sanitizeInvalidTagName as vt } from "./utils/sanitize-invalid-tag-name.es.js";
5
+ import { stripSvgTextLineBreaks as xt } from "./utils/strip-svg-text-line-breaks.es.js";
6
6
  /* empty css */
7
7
  /* empty css */
8
8
  /* empty css */
9
9
  /* empty css */
10
- import ft, { CodeBlockContext as ht } from "./CodeBlock.es.js";
11
- import gt from "./plugins/CustomVariable.es.js";
10
+ import yt, { CodeBlockContext as wt } from "./CodeBlock.es.js";
11
+ import Ct from "./plugins/CustomVariable.es.js";
12
12
  import ke from "./plugins/MermaidChart.es.js";
13
- import { preserveCustomVariableProperties as vt, restoreCustomVariableProperties as xt } from "./utils/custom-variable-props.es.js";
14
- import { subsetLanguages as yt, highlightLanguages as wt } from "./utils/highlight-languages.es.js";
15
- import { parseMarkdownSegments as je, mermaidBlockIsComplete as Ct } from "./utils/mermaid-parse.es.js";
16
- import { getMarkdownSourceAnalysis as kt, getInlineCodeRanges as Tt } from "./utils/inline-code-ranges.es.js";
17
- import { remarkPlugins as Ue } from "./utils/markdown-plugins.es.js";
13
+ import { preserveCustomVariableProperties as kt, restoreCustomVariableProperties as Tt } from "./utils/custom-variable-props.es.js";
14
+ import { subsetLanguages as bt, highlightLanguages as St } from "./utils/highlight-languages.es.js";
15
+ import { parseMarkdownSegments as Ue, mermaidBlockIsComplete as Rt } from "./utils/mermaid-parse.es.js";
16
+ import { getMarkdownSourceAnalysis as Bt, getInlineCodeRanges as Nt } from "./utils/inline-code-ranges.es.js";
17
+ import { remarkPlugins as Je } from "./utils/markdown-plugins.es.js";
18
18
  import { normalizeInlineHtml as we } from "./utils/normalize-inline-html.es.js";
19
19
  import { escapeTypedMarkdownMetadata as Te } from "./utils/escape-typed-metadata.es.js";
20
- import bt from "./IframeSandbox.es.js";
21
- import { getTrailingTypewriterGrapheme as Ce, appendContentAwareTypewriterQueue as He, consumeContentAwareTypewriterQueue as St, CONTENT_AWARE_TYPEWRITER_TICK_BUDGET as Rt, isContentAwareTypewriterQueueEmpty as Bt } from "./utils/typewriter-pacing.es.js";
22
- import { normalizeWrappedSandboxContent as Nt, splitContentSegments as Lt } from "./utils/split-content.es.js";
23
- import { getInteractionDefaultValues as Mt } from "../../lib/interaction-defaults.es.js";
24
- import { getMarkdownFlowDirection as At, getMarkdownFlowLanguage as Vt } from "../../lib/locale.es.js";
20
+ import Lt from "./IframeSandbox.es.js";
21
+ import { getTrailingTypewriterGrapheme as Ce, appendContentAwareTypewriterQueue as Ke, consumeContentAwareTypewriterQueue as Mt, CONTENT_AWARE_TYPEWRITER_TICK_BUDGET as At, isContentAwareTypewriterQueueEmpty as It } from "./utils/typewriter-pacing.es.js";
22
+ import { normalizeWrappedSandboxContent as Vt, splitContentSegments as $t } from "./utils/split-content.es.js";
23
+ import { getInteractionDefaultValues as Et } from "../../lib/interaction-defaults.es.js";
24
+ import { getMarkdownFlowDirection as Pt, getMarkdownFlowLanguage as Dt } from "../../lib/locale.es.js";
25
25
  import { getContentRenderLocaleTexts as Se } from "./contentRenderI18n.es.js";
26
- import { createVideoMarkdownRunPlan as $t, cloneVideoMarkdownSourceTree as Et, prepareVideoMarkdownRun as Pt, projectVideoMarkdownRun as It, getVideoMarkdownNodeState as Dt } from "./utils/video-markdown-run.es.js";
27
- import { unified as qe } from "../../node_modules/unified/lib/index.es.js";
28
- import Wt from "../../node_modules/remark-rehype/lib/index.es.js";
29
- import zt from "../../node_modules/rehype-raw/lib/index.es.js";
30
- import Ft from "../../node_modules/rehype-highlight/lib/index.es.js";
31
- import Gt from "../../node_modules/rehype-katex/lib/index.es.js";
32
- import { Markdown as Ke } from "../../node_modules/react-markdown/lib/index.es.js";
33
- const _t = 2, be = ({
26
+ import { createVideoMarkdownRunPlan as Wt, cloneVideoMarkdownSourceTree as zt, prepareVideoMarkdownRun as Ft, projectVideoMarkdownRun as Gt, getVideoMarkdownNodeState as _t } from "./utils/video-markdown-run.es.js";
27
+ import { unified as Ye } from "../../node_modules/unified/lib/index.es.js";
28
+ import jt from "../../node_modules/remark-rehype/lib/index.es.js";
29
+ import Ht from "../../node_modules/rehype-raw/lib/index.es.js";
30
+ import qt from "../../node_modules/rehype-highlight/lib/index.es.js";
31
+ import Qt from "../../node_modules/rehype-katex/lib/index.es.js";
32
+ import { Markdown as et } from "../../node_modules/react-markdown/lib/index.es.js";
33
+ const Ot = 2, be = ({
34
34
  svg: t,
35
35
  inline: r = !1
36
36
  }) => {
37
- const c = b(null), o = r ? "span" : "div";
38
- return te(() => {
39
- const u = c.current;
37
+ const i = T(null), o = r ? "span" : "div";
38
+ return re(() => {
39
+ const u = i.current;
40
40
  if (!u) return;
41
41
  const m = u.shadowRoot ?? u.attachShadow({ mode: "open" }), y = "content-render-svg-style";
42
- let g = m.getElementById(y);
43
- g || (g = document.createElement("style"), g.id = y, g.textContent = `
42
+ let v = m.getElementById(y);
43
+ v || (v = document.createElement("style"), v.id = y, v.textContent = `
44
44
  svg { height: auto; display: inline-block; }
45
45
  svg.content-render-svg-el--responsive { width: 100%; max-width: 100%; }
46
46
  svg.content-render-svg-el--fixed { max-width: none; }
47
- `, m.appendChild(g)), Array.from(m.childNodes).filter(
48
- (i) => i !== g
49
- ).forEach((i) => m.removeChild(i));
50
- const Q = document.createElement("template"), f = pt(t);
51
- Q.innerHTML = f, m.append(Q.content.cloneNode(!0));
52
- let S = !1, A = !1;
53
- m.querySelectorAll("svg").forEach((i) => {
54
- const V = i.getAttribute("viewBox");
55
- if (!V) return;
56
- const W = V.trim().split(/[\s,]+/).map((w) => Number(w));
47
+ `, m.appendChild(v)), Array.from(m.childNodes).filter(
48
+ (c) => c !== v
49
+ ).forEach((c) => m.removeChild(c));
50
+ const O = document.createElement("template"), f = xt(t);
51
+ O.innerHTML = f, m.append(O.content.cloneNode(!0));
52
+ let b = !1, A = !1;
53
+ m.querySelectorAll("svg").forEach((c) => {
54
+ const I = c.getAttribute("viewBox");
55
+ if (!I) return;
56
+ const W = I.trim().split(/[\s,]+/).map((D) => Number(D));
57
57
  if (W.length !== 4 || W.some(Number.isNaN)) return;
58
- const [, , I, C] = W, O = i.getAttribute("width"), D = i.getAttribute("height"), U = (w) => {
59
- if (!w) return !1;
60
- const $ = w.trim().toLowerCase();
61
- return $ === "auto" || $.endsWith("%");
62
- }, ne = (w) => {
63
- if (!w) return null;
64
- const $ = w.trim().toLowerCase();
65
- if ($ === "auto" || $.endsWith("%"))
58
+ const [, , P, w] = W, z = c.getAttribute("width"), V = c.getAttribute("height"), U = (D) => {
59
+ if (!D) return !1;
60
+ const F = D.trim().toLowerCase();
61
+ return F === "auto" || F.endsWith("%");
62
+ }, oe = (D) => {
63
+ if (!D) return null;
64
+ const F = D.trim().toLowerCase();
65
+ if (F === "auto" || F.endsWith("%"))
66
66
  return null;
67
- const j = Number.parseFloat($);
68
- return Number.isNaN(j) ? null : j;
69
- }, ie = U(O), ue = U(D), re = !O || O === "0", oe = !D || D === "0", le = ne(O), de = ne(D);
70
- if (ie || ue || re && oe || le === I && de === C) {
71
- S = !0, i.classList.add("content-render-svg-el--responsive"), i.classList.remove("content-render-svg-el--fixed"), i.style.width = "100%", i.style.height = "auto", !i.style.aspectRatio && C > 0 && (i.style.aspectRatio = `${I} / ${C}`);
67
+ const B = Number.parseFloat(F);
68
+ return Number.isNaN(B) ? null : B;
69
+ }, de = U(z), me = U(V), se = !z || z === "0", ae = !V || V === "0", pe = oe(z), fe = oe(V);
70
+ if (de || me || se && ae || pe === P && fe === w) {
71
+ b = !0, c.classList.add("content-render-svg-el--responsive"), c.classList.remove("content-render-svg-el--fixed"), c.style.width = "100%", c.style.height = "auto", !c.style.aspectRatio && w > 0 && (c.style.aspectRatio = `${P} / ${w}`);
72
72
  return;
73
73
  }
74
- A = !0, i.classList.add("content-render-svg-el--fixed"), i.classList.remove("content-render-svg-el--responsive"), re && I > 0 && i.setAttribute("width", `${I}`), oe && C > 0 && i.setAttribute("height", `${C}`);
74
+ A = !0, c.classList.add("content-render-svg-el--fixed"), c.classList.remove("content-render-svg-el--responsive"), se && P > 0 && c.setAttribute("width", `${P}`), ae && w > 0 && c.setAttribute("height", `${w}`);
75
75
  });
76
- const l = S && !A;
76
+ const l = b && !A;
77
77
  u.classList.toggle("content-render-svg--responsive", l), u.classList.toggle("content-render-svg--fixed", !l);
78
78
  }, [t]), /* @__PURE__ */ s(o, { className: "content-render-svg-scroll", children: /* @__PURE__ */ s(
79
79
  o,
80
80
  {
81
81
  className: "content-render-svg",
82
82
  ref: (u) => {
83
- c.current = u;
83
+ i.current = u;
84
84
  }
85
85
  }
86
86
  ) });
87
- }, ce = X.createContext(
87
+ }, le = X.createContext(
88
88
  null
89
- ), Ye = (t) => {
90
- const { receivedTree: r, ...c } = t, o = X.useContext(ce), u = X.useContext(ht);
89
+ ), tt = (t) => {
90
+ const { receivedTree: r, ...i } = t, o = X.useContext(le), u = X.useContext(wt);
91
91
  if (!o)
92
92
  throw new Error("Markdown code renderer requires ContentRender context.");
93
- const { className: m, children: y, ...g } = c;
93
+ const { className: m, children: y, ...v } = i;
94
94
  if (/language-(\w+)/.exec(m || "")?.[1] === "mermaid") {
95
- const f = y?.toString().replace(/\n$/, "") || "", S = Ct(
95
+ const f = y?.toString().replace(/\n$/, "") || "", b = Rt(
96
96
  o.current.renderContent,
97
97
  f
98
98
  );
@@ -100,7 +100,7 @@ const _t = 2, be = ({
100
100
  ke,
101
101
  {
102
102
  chart: f,
103
- frozen: r ? !S : S,
103
+ frozen: r ? !b : b,
104
104
  messages: o.current.mermaidMessages
105
105
  }
106
106
  );
@@ -109,29 +109,29 @@ const _t = 2, be = ({
109
109
  "code",
110
110
  {
111
111
  className: m,
112
- ...g,
113
- dir: g.dir ?? (u ? void 0 : "ltr"),
112
+ ...v,
113
+ dir: v.dir ?? (u ? void 0 : "ltr"),
114
114
  children: y
115
115
  }
116
116
  );
117
- }, Xe = [
117
+ }, nt = [
118
+ kt,
119
+ Ht,
118
120
  vt,
119
- zt,
120
- mt,
121
- xt
122
- ], Ze = [
123
- [Ft, { languages: wt, subset: yt }],
124
- Gt
125
- ], jt = [
126
- ...Xe,
127
- ...Ze
128
- ], Qe = ({ content: t, components: r, locale: c }) => {
129
- const o = Se(c);
121
+ Tt
122
+ ], rt = [
123
+ [qt, { languages: St, subset: bt }],
124
+ Qt
125
+ ], Ut = [
126
+ ...nt,
127
+ ...rt
128
+ ], Xe = ({ content: t, components: r, locale: i }) => {
129
+ const o = Se(i);
130
130
  return /* @__PURE__ */ s("div", { className: "markdown-renderer", children: /* @__PURE__ */ s(
131
- Ke,
131
+ et,
132
132
  {
133
- remarkPlugins: Ue,
134
- rehypePlugins: jt,
133
+ remarkPlugins: Je,
134
+ rehypePlugins: Ut,
135
135
  remarkRehypeOptions: {
136
136
  footnoteLabel: o.footnoteLabel,
137
137
  footnoteBackLabel: (u, m) => {
@@ -143,103 +143,103 @@ const _t = 2, be = ({
143
143
  children: t
144
144
  }
145
145
  ) });
146
- }, Ht = function() {
146
+ }, Kt = function() {
147
147
  this.parser = () => ({ type: "root", children: [] });
148
- }, qt = ({ plan: t, renderedSegments: r, components: c, locale: o }) => {
148
+ }, Yt = ({ plan: t, renderedSegments: r, components: i, locale: o }) => {
149
149
  const u = h(() => {
150
- const f = Se(o), S = qe().use(Ue).use(Wt, {
150
+ const f = Se(o), b = Ye().use(Je).use(jt, {
151
151
  allowDangerousHtml: !0,
152
152
  footnoteLabel: f.footnoteLabel,
153
- footnoteBackLabel: (i, V) => f.footnoteBackLabel.replace(
153
+ footnoteBackLabel: (c, I) => f.footnoteBackLabel.replace(
154
154
  "{reference}",
155
- String(i + 1) + (V > 1 ? `-${V}` : "")
155
+ String(c + 1) + (I > 1 ? `-${I}` : "")
156
156
  )
157
- }).use(Xe), A = qe().use(Ze), l = S.runSync(
158
- Et(t),
157
+ }).use(nt), A = Ye().use(rt), l = b.runSync(
158
+ zt(t),
159
159
  t.markdownSource
160
160
  );
161
- return Pt(
161
+ return Ft(
162
162
  t,
163
163
  l,
164
- (i) => A.runSync(i, t.fullSource)
164
+ (c) => A.runSync(c, t.fullSource)
165
165
  );
166
166
  }, [t, o]), m = h(
167
- () => It(u, r),
167
+ () => Gt(u, r),
168
168
  [u, r]
169
- ), y = b(c);
170
- y.current = c;
171
- const g = b(
169
+ ), y = T(i);
170
+ y.current = i;
171
+ const v = T(
172
172
  /* @__PURE__ */ new Map()
173
173
  ), J = h(() => {
174
- const f = /* @__PURE__ */ new Set(), S = (l) => {
175
- l.type === "element" && f.add(l.tagName), "children" in l && l.children.forEach(S);
174
+ const f = /* @__PURE__ */ new Set(), b = (l) => {
175
+ l.type === "element" && f.add(l.tagName), "children" in l && l.children.forEach(b);
176
176
  };
177
- S(u.tree);
177
+ b(u.tree);
178
178
  const A = {};
179
179
  for (const l of f) {
180
- if (!g.current.has(l)) {
181
- const i = ({
182
- node: V,
180
+ if (!v.current.has(l)) {
181
+ const c = ({
182
+ node: I,
183
183
  children: W,
184
- ...I
184
+ ...P
185
185
  }) => {
186
- const C = Dt(V);
187
- if (C?.svg)
188
- return C.svgSource ? /* @__PURE__ */ s(be, { svg: C.svgSource, inline: !0 }) : null;
189
- if (C?.atomic)
190
- return C.active ? /* @__PURE__ */ s(dt, { children: W }) : null;
191
- if (C?.active === !1 && l !== "a") return null;
192
- const D = y.current[l], U = C?.active === !1 ? { ...I, href: void 0, tabIndex: -1 } : I;
193
- return D ? X.createElement(
194
- D,
186
+ const w = _t(I);
187
+ if (w?.svg)
188
+ return w.svgSource ? /* @__PURE__ */ s(be, { svg: w.svgSource, inline: !0 }) : null;
189
+ if (w?.atomic)
190
+ return w.active ? /* @__PURE__ */ s(gt, { children: W }) : null;
191
+ if (w?.active === !1 && l !== "a") return null;
192
+ const V = y.current[l], U = w?.active === !1 ? { ...P, href: void 0, tabIndex: -1 } : P;
193
+ return V ? X.createElement(
194
+ V,
195
195
  {
196
196
  ...U,
197
- node: V,
198
- ...D === Ye ? { receivedTree: !0 } : {}
197
+ node: I,
198
+ ...V === tt ? { receivedTree: !0 } : {}
199
199
  },
200
200
  W
201
201
  ) : X.createElement(l, U, W);
202
202
  };
203
- i.displayName = `StableMarkdown(${l})`, g.current.set(l, i);
203
+ c.displayName = `StableMarkdown(${l})`, v.current.set(l, c);
204
204
  }
205
- A[l] = g.current.get(l);
205
+ A[l] = v.current.get(l);
206
206
  }
207
207
  return A;
208
- }, [u]), Q = h(
208
+ }, [u]), O = h(
209
209
  () => [() => () => m],
210
210
  [m]
211
211
  );
212
212
  return /* @__PURE__ */ s("div", { className: "markdown-renderer", children: /* @__PURE__ */ s(
213
- Ke,
213
+ et,
214
214
  {
215
- remarkPlugins: [Ht],
216
- rehypePlugins: Q,
215
+ remarkPlugins: [Kt],
216
+ rehypePlugins: O,
217
217
  components: J,
218
218
  children: ""
219
219
  }
220
220
  ) });
221
- }, _ = (t) => t.type === "markdown" && t.immediate === !0, Qt = (t) => {
221
+ }, H = (t) => t.type === "markdown" && t.immediate === !0, Xt = (t) => {
222
222
  if (t.length <= 1) return t;
223
223
  const r = [];
224
- return t.forEach((c) => {
225
- if (c.type === "sandbox" || _(c)) {
226
- r.push(c);
224
+ return t.forEach((i) => {
225
+ if (i.type === "sandbox" || H(i)) {
226
+ r.push(i);
227
227
  return;
228
228
  }
229
229
  const o = r[r.length - 1];
230
- if (o && o.type !== "sandbox" && !_(o)) {
230
+ if (o && o.type !== "sandbox" && !H(o)) {
231
231
  r[r.length - 1] = {
232
232
  type: "markdown",
233
- value: `${o.value}${c.value}`
233
+ value: `${o.value}${i.value}`
234
234
  };
235
235
  return;
236
236
  }
237
- r.push({ type: "markdown", value: c.value });
237
+ r.push({ type: "markdown", value: i.value });
238
238
  }), r;
239
- }, Ot = (t, r, c) => {
239
+ }, Zt = (t, r, i) => {
240
240
  if (t.length >= r.length) return t;
241
- const o = c.find(
242
- ({ start: y, end: g }) => y < t.length && t.length < g
241
+ const o = i.find(
242
+ ({ start: y, end: v }) => y < t.length && t.length < v
243
243
  );
244
244
  if (!o) return t;
245
245
  const u = /^`+/.exec(r.slice(o.start))?.[0];
@@ -247,115 +247,117 @@ const _t = 2, be = ({
247
247
  return t;
248
248
  const m = o.end - u.length;
249
249
  return t.length > m ? t + u.slice(t.length - m) : t + (t.endsWith("`") ? " " : "") + u;
250
- }, Oe = (t, r, c, o, u = 0) => {
251
- const m = Ot(t, r, c);
250
+ }, Ze = (t, r, i, o, u = 0) => {
251
+ const m = Zt(t, r, i);
252
252
  return Te(t, o, u) + m.slice(t.length);
253
- }, Ut = (t, r) => {
254
- const c = Math.max(1, r), o = Array.from(t);
253
+ }, Jt = (t, r) => {
254
+ const i = Math.max(1, r), o = Array.from(t);
255
255
  return {
256
- chunk: o.slice(0, c).join(""),
257
- rest: o.slice(c).join("")
256
+ chunk: o.slice(0, i).join(""),
257
+ rest: o.slice(i).join("")
258
258
  };
259
- }, Kt = (t, r) => t === r ? !0 : !t || !r || t.length !== r.length ? !1 : t.every((c, o) => c === r[o]), Yt = (t) => {
260
- const r = b(t);
261
- return Kt(r.current, t) || (r.current = t), r.current;
262
- }, Vn = ({
259
+ }, en = (t, r) => t === r ? !0 : !t || !r || t.length !== r.length ? !1 : t.every((i, o) => i === r[o]), tn = (t) => {
260
+ const r = T(t);
261
+ return en(r.current, t) || (r.current = t), r.current;
262
+ }, Dn = ({
263
263
  onPlaceholderAccepted: t,
264
264
  content: r,
265
- contentType: c,
265
+ contentType: i,
266
266
  locale: o,
267
267
  lang: u,
268
268
  dir: m,
269
269
  customRenderBar: y,
270
- onSend: g,
270
+ onSend: v,
271
271
  typingSpeed: J = 30,
272
- enableTypewriter: Q = !1,
272
+ enableTypewriter: O = !1,
273
273
  typewriterPacing: f = "fixed",
274
- onTypeFinished: S,
274
+ onTypeFinished: b,
275
275
  onTypewriterStateChange: A,
276
276
  userInput: l,
277
- interactionDefaultValueOptions: i,
278
- defaultButtonText: V,
277
+ interactionDefaultValueOptions: c,
278
+ defaultButtonText: I,
279
279
  defaultInputText: W,
280
- defaultSelectedValues: I,
281
- readonly: C = !1,
282
- confirmButtonText: O,
283
- copyButtonText: D,
284
- copiedButtonText: U,
285
- sandboxLoadingText: ne,
286
- sandboxStyleLoadingText: ie,
287
- sandboxScriptLoadingText: ue,
288
- disableSandboxLoadingOverlay: re = !1,
289
- sandboxFullscreenButtonText: oe,
290
- sandboxExitFullscreenButtonText: le,
291
- sandboxMode: de = "content",
292
- onClickCustomButtonAfterContent: me,
293
- beforeSend: pe
280
+ defaultSelectedValues: P,
281
+ readonly: w = !1,
282
+ showImageInput: z = !1,
283
+ imageInput: V,
284
+ confirmButtonText: U,
285
+ copyButtonText: oe,
286
+ copiedButtonText: de,
287
+ sandboxLoadingText: me,
288
+ sandboxStyleLoadingText: se,
289
+ sandboxScriptLoadingText: ae,
290
+ disableSandboxLoadingOverlay: pe = !1,
291
+ sandboxFullscreenButtonText: fe,
292
+ sandboxExitFullscreenButtonText: Re,
293
+ sandboxMode: Be = "content",
294
+ onClickCustomButtonAfterContent: D,
295
+ beforeSend: F
294
296
  }) => {
295
- const w = Se(o), $ = h(
297
+ const B = Se(o), ce = h(
296
298
  () => ({
297
- loading: w.mermaidLoadingText,
298
- emptyChart: w.mermaidEmptyChartText,
299
- error: w.mermaidErrorText
299
+ loading: B.mermaidLoadingText,
300
+ emptyChart: B.mermaidEmptyChartText,
301
+ error: B.mermaidErrorText
300
302
  }),
301
- [w]
302
- ), j = m ?? At(o), ee = u ?? Vt(o), Re = O || w.confirmButtonText, Be = D || w.copyButtonText, Ne = U || w.copiedButtonText, Je = oe || w.sandboxFullscreenButtonText, et = le || w.sandboxExitFullscreenButtonText, p = !!Q && (!c || c === "text"), R = h(
303
- () => Nt(r),
303
+ [B]
304
+ ), ee = m ?? Pt(o), te = u ?? Dt(o), Ne = U || B.confirmButtonText, Le = oe || B.copyButtonText, Me = de || B.copiedButtonText, ot = fe || B.sandboxFullscreenButtonText, st = Re || B.sandboxExitFullscreenButtonText, p = !!O && (!i || i === "text"), S = h(
305
+ () => Vt(r),
304
306
  [r]
305
307
  ), N = h(
306
- () => kt(R),
307
- [R]
308
- ), k = h(() => {
309
- const e = Qt(
310
- Lt(R, !0, !0, N)
308
+ () => Bt(S),
309
+ [S]
310
+ ), C = h(() => {
311
+ const e = Xt(
312
+ $t(S, !0, !0, N)
311
313
  );
312
- return R !== r && e.length && (e[0].type === "sandbox" || _(e[0])) ? [{ type: "text", value: "" }, ...e] : e;
313
- }, [r, R, N]), K = k.some(
314
- (e) => e.type === "sandbox" || _(e)
315
- ), v = K ? k.filter(
316
- (e) => e.type !== "sandbox" && !_(e)
317
- ).map((e) => e.value).join("") : R, Le = Math.max(0, J), tt = f === "fixed" ? v : void 0, [E, Me] = _e(
318
- () => p ? "" : v
319
- ), se = b(E), L = b(""), P = b({
314
+ return S !== r && e.length && (e[0].type === "sandbox" || H(e[0])) ? [{ type: "text", value: "" }, ...e] : e;
315
+ }, [r, S, N]), K = C.some(
316
+ (e) => e.type === "sandbox" || H(e)
317
+ ), x = K ? C.filter(
318
+ (e) => e.type !== "sandbox" && !H(e)
319
+ ).map((e) => e.value).join("") : S, Ae = Math.max(0, J), at = f === "fixed" ? x : void 0, [$, Ie] = Oe(
320
+ () => p ? "" : x
321
+ ), ie = T($), L = T(""), E = T({
320
322
  tokens: [],
321
323
  head: 0,
322
324
  trailingGrapheme: ""
323
- }), H = b(0), Ae = b(p), Ve = b(f), $e = b(v), fe = b(r), he = b(!1), [nt, rt] = _e(0);
324
- te(() => {
325
- const e = Ae.current, n = Ve.current, a = $e.current, d = !!L.current, T = fe.current !== r, ye = T && r.startsWith(fe.current);
326
- fe.current = r, Ae.current = p, Ve.current = f, $e.current = v, (T || p !== e) && (he.current = !1);
325
+ }), q = T(0), Ve = T(p), $e = T(f), Ee = T(x), he = T(r), ge = T(!1), [ct, it] = Oe(0);
326
+ re(() => {
327
+ const e = Ve.current, n = $e.current, a = Ee.current, d = !!L.current, k = he.current !== r, ye = k && r.startsWith(he.current);
328
+ he.current = r, Ve.current = p, $e.current = f, Ee.current = x, (k || p !== e) && (ge.current = !1);
327
329
  const Y = () => {
328
- L.current = "", P.current = {
330
+ L.current = "", E.current = {
329
331
  tokens: [],
330
332
  head: 0,
331
333
  trailingGrapheme: ""
332
- }, H.current = 0;
333
- }, Z = (B) => {
334
- se.current = B, Me(B);
334
+ }, q.current = 0;
335
+ }, Z = (R) => {
336
+ ie.current = R, Ie(R);
335
337
  };
336
338
  if (!p) {
337
- Y(), Z(v);
339
+ Y(), Z(x);
338
340
  return;
339
341
  }
340
342
  e || (Y(), Z(""));
341
- let M = e ? se.current : "";
342
- if (!v.startsWith(M)) {
343
+ let M = e ? ie.current : "";
344
+ if (!x.startsWith(M)) {
343
345
  if (Y(), !ye) {
344
- Z(v), f === "content-aware" && (P.current = {
346
+ Z(x), f === "content-aware" && (E.current = {
345
347
  tokens: [],
346
348
  head: 0,
347
- trailingGrapheme: Ce(v)
349
+ trailingGrapheme: Ce(x)
348
350
  });
349
351
  return;
350
352
  }
351
- let B = 0;
352
- for (; B < M.length && B < v.length && M[B] === v[B]; )
353
- B += 1;
354
- M = M.slice(0, B), Z(M);
353
+ let R = 0;
354
+ for (; R < M.length && R < x.length && M[R] === x[R]; )
355
+ R += 1;
356
+ M = M.slice(0, R), Z(M);
355
357
  }
356
- let q = v.slice(M.length);
357
- if (!q) {
358
- L.current = "", H.current = 0, P.current = f === "content-aware" ? {
358
+ let Q = x.slice(M.length);
359
+ if (!Q) {
360
+ L.current = "", q.current = 0, E.current = f === "content-aware" ? {
359
361
  tokens: [],
360
362
  head: 0,
361
363
  trailingGrapheme: Ce(M)
@@ -363,46 +365,46 @@ const _t = 2, be = ({
363
365
  return;
364
366
  }
365
367
  if (f === "content-aware") {
366
- const B = a.slice(
368
+ const R = a.slice(
367
369
  M.length
368
370
  );
369
- if (e && n === "content-aware" && v.startsWith(a) && L.current === B) {
370
- const G = He(
371
- P.current,
372
- v.slice(a.length)
371
+ if (e && n === "content-aware" && x.startsWith(a) && L.current === R) {
372
+ const j = Ke(
373
+ E.current,
374
+ x.slice(a.length)
373
375
  );
374
- P.current = G.queue, G.immediateChunk && (q = q.slice(
375
- G.immediateChunk.length
376
- ), Z(`${M}${G.immediateChunk}`));
376
+ E.current = j.queue, j.immediateChunk && (Q = Q.slice(
377
+ j.immediateChunk.length
378
+ ), Z(`${M}${j.immediateChunk}`));
377
379
  } else {
378
- const G = He(
380
+ const j = Ke(
379
381
  {
380
382
  tokens: [],
381
383
  head: 0,
382
384
  trailingGrapheme: Ce(M)
383
385
  },
384
- q
386
+ Q
385
387
  );
386
- P.current = G.queue, G.immediateChunk && (q = q.slice(
387
- G.immediateChunk.length
388
- ), Z(`${M}${G.immediateChunk}`)), H.current = 0;
388
+ E.current = j.queue, j.immediateChunk && (Q = Q.slice(
389
+ j.immediateChunk.length
390
+ ), Z(`${M}${j.immediateChunk}`)), q.current = 0;
389
391
  }
390
392
  } else
391
- P.current = {
393
+ E.current = {
392
394
  tokens: [],
393
395
  head: 0,
394
396
  trailingGrapheme: ""
395
- }, H.current = 0;
396
- L.current = q, !d && q && rt((B) => B + 1);
397
- }, [r, v, p, f]), te(() => {
398
- p && (he.current || L.current || E !== v || (he.current = !0, S?.()));
397
+ }, q.current = 0;
398
+ L.current = Q, !d && Q && it((R) => R + 1);
399
+ }, [r, x, p, f]), re(() => {
400
+ p && (ge.current || L.current || $ !== x || (ge.current = !0, b?.()));
399
401
  }, [
400
402
  r,
401
- v,
402
- E,
403
+ x,
404
+ $,
403
405
  p,
404
- S
405
- ]), te(() => {
406
+ b
407
+ ]), re(() => {
406
408
  if (!p || !L.current)
407
409
  return;
408
410
  const e = window.setTimeout(() => {
@@ -410,189 +412,196 @@ const _t = 2, be = ({
410
412
  return;
411
413
  let n = "";
412
414
  if (f === "content-aware") {
413
- const d = St(
414
- P.current,
415
- H.current + Rt
415
+ const d = Mt(
416
+ E.current,
417
+ q.current + At
416
418
  );
417
- n = d.chunk, P.current = d.queue, Bt(d.queue) ? H.current = 0 : H.current = d.remainingBudget;
419
+ n = d.chunk, E.current = d.queue, It(d.queue) ? q.current = 0 : q.current = d.remainingBudget;
418
420
  } else
419
- n = Ut(
421
+ n = Jt(
420
422
  L.current,
421
- _t
423
+ Ot
422
424
  ).chunk;
423
425
  if (!n)
424
426
  return;
425
- L.current = L.current.slice(n.length), L.current || (P.current = f === "content-aware" ? {
427
+ L.current = L.current.slice(n.length), L.current || (E.current = f === "content-aware" ? {
426
428
  tokens: [],
427
429
  head: 0,
428
- trailingGrapheme: P.current.trailingGrapheme
429
- } : { tokens: [], head: 0, trailingGrapheme: "" }, H.current = 0);
430
- const a = `${se.current}${n}`;
431
- se.current = a, Me(a);
432
- }, Le);
430
+ trailingGrapheme: E.current.trailingGrapheme
431
+ } : { tokens: [], head: 0, trailingGrapheme: "" }, q.current = 0);
432
+ const a = `${ie.current}${n}`;
433
+ ie.current = a, Ie(a);
434
+ }, Ae);
433
435
  return () => window.clearTimeout(e);
434
436
  }, [
435
- E,
436
- tt,
437
+ $,
438
+ at,
437
439
  p,
438
440
  f,
439
- Le,
440
- nt
441
+ Ae,
442
+ ct
441
443
  ]);
442
- const z = h(() => {
444
+ const G = h(() => {
443
445
  let e = 0;
444
- return k.map((n) => {
446
+ return C.map((n) => {
445
447
  if (!p) return n;
446
- if (n.type === "sandbox" || _(n))
447
- return E.length >= e ? n : { ...n, value: "" };
448
- const a = E.slice(
448
+ if (n.type === "sandbox" || H(n))
449
+ return $.length >= e ? n : { ...n, value: "" };
450
+ const a = $.slice(
449
451
  e,
450
452
  e + n.value.length
451
453
  );
452
454
  return e += n.value.length, { ...n, value: a };
453
455
  });
454
- }, [k, E, p]), Ee = h(
456
+ }, [C, $, p]), Pe = h(
455
457
  () => ({
456
458
  isTypewriterEnabled: p,
457
- isTyping: p && E !== v,
458
- isComplete: E === v,
459
- renderedLength: r.length - k.reduce(
460
- (e, n, a) => e + n.value.length - z[a].value.length,
459
+ isTyping: p && $ !== x,
460
+ isComplete: $ === x,
461
+ renderedLength: r.length - C.reduce(
462
+ (e, n, a) => e + n.value.length - G[a].value.length,
461
463
  0
462
464
  ),
463
465
  totalLength: r.length
464
466
  }),
465
467
  [
466
468
  r,
467
- v,
468
- E,
469
+ x,
470
+ $,
469
471
  p,
470
- k,
471
- z
472
+ C,
473
+ G
472
474
  ]
473
475
  );
474
- te(() => {
475
- A?.(Ee);
476
- }, [A, Ee]);
477
- const ge = h(() => {
476
+ re(() => {
477
+ A?.(Pe);
478
+ }, [A, Pe]);
479
+ const ve = h(() => {
478
480
  let e = 0;
479
- return k.map((n) => {
481
+ return C.map((n) => {
480
482
  const a = e;
481
483
  return e += n.value.length, a;
482
484
  });
483
- }, [k]), ae = h(
484
- () => p ? k.map(
485
- (e) => e.type === "sandbox" || _(e) ? [] : e.value === R ? N.inline : Tt(e.value)
485
+ }, [C]), ue = h(
486
+ () => p ? C.map(
487
+ (e) => e.type === "sandbox" || H(e) ? [] : e.value === S ? N.inline : Nt(e.value)
486
488
  ) : [],
487
- [p, k, R, N]
488
- ), ot = h(
489
- () => K ? z.map(
490
- (e, n) => e.type === "sandbox" || _(e) ? e.value : p ? Oe(
489
+ [p, C, S, N]
490
+ ), ut = h(
491
+ () => K ? G.map(
492
+ (e, n) => e.type === "sandbox" || H(e) ? e.value : p ? Ze(
491
493
  e.value,
492
- k[n].value,
493
- ae[n] ?? [],
494
+ C[n].value,
495
+ ue[n] ?? [],
494
496
  N.metadata,
495
- ge[n]
497
+ ve[n]
496
498
  ) : Te(
497
499
  e.value,
498
500
  N.metadata,
499
- ge[n]
501
+ ve[n]
500
502
  )
501
503
  ) : [],
502
504
  [
503
505
  K,
504
506
  p,
505
- z,
506
- ae,
507
- k,
507
+ G,
508
+ ue,
509
+ C,
508
510
  N.metadata,
509
- ge
511
+ ve
510
512
  ]
511
- ), st = h(() => {
513
+ ), lt = h(() => {
512
514
  const e = [];
513
- k.forEach((n, a) => {
515
+ C.forEach((n, a) => {
514
516
  const d = e.at(-1);
515
517
  n.type !== "sandbox" && d && !d.sandbox ? d.indices.push(a) : e.push({ indices: [a], sandbox: n.type === "sandbox" });
516
518
  });
517
519
  for (const n of e)
518
- if (!n.sandbox && n.indices.some((a) => _(k[a]))) {
519
- const a = n.indices.map((T) => k[T]), d = a.map((T) => T.value).join("");
520
- n.plan = $t(
520
+ if (!n.sandbox && n.indices.some((a) => H(C[a]))) {
521
+ const a = n.indices.map((k) => C[k]), d = a.map((k) => k.value).join("");
522
+ n.plan = Wt(
521
523
  a,
522
- d === R ? N : void 0
524
+ d === S ? N : void 0
523
525
  );
524
526
  }
525
527
  return e;
526
- }, [k, R, N]), F = K ? z.map((e) => e.value).join("") : p ? E : R, at = h(
527
- () => y ? we(F) : "",
528
- [y, F]
529
- ), Pe = h(
528
+ }, [C, S, N]), _ = K ? G.map((e) => e.value).join("") : p ? $ : S, dt = h(
529
+ () => y ? we(_) : "",
530
+ [y, _]
531
+ ), De = h(
530
532
  () => K ? "" : we(
531
- p ? Oe(
532
- F,
533
- R,
534
- ae[0] ?? [],
533
+ p ? Ze(
534
+ _,
535
+ S,
536
+ ue[0] ?? [],
535
537
  N.metadata
536
538
  ) : Te(
537
- F,
539
+ _,
538
540
  N.metadata
539
541
  )
540
542
  ),
541
543
  [
542
- R,
544
+ S,
543
545
  K,
544
546
  p,
545
- F,
546
- ae,
547
+ _,
548
+ ue,
547
549
  N.metadata
548
550
  ]
549
- ), ve = h(
550
- () => Mt(
551
- F,
551
+ ), We = z || !!V, ze = h(
552
+ () => We ? { ...c, allowImages: !0 } : c,
553
+ [We, c]
554
+ ), ne = h(
555
+ () => Et(
556
+ _,
552
557
  l,
553
- i
558
+ ze
554
559
  ),
555
- [i, F, l]
556
- ), Ie = (V ? Ge.trimVariablePadding(V) : void 0) || ve.buttonText, De = W?.trim() || ve.inputText, ct = h(
557
- () => l ? l.split(",").map((e) => Ge.trimVariablePadding(e)).filter(Boolean) : void 0,
560
+ [ze, _, l]
561
+ ), Fe = V ?? (ne.images?.length ? { images: ne.images } : void 0), Ge = (I ? Qe.trimVariablePadding(I) : void 0) || ne.buttonText, _e = W?.trim() || ne.inputText, mt = h(
562
+ () => l ? l.split(",").map((e) => Qe.trimVariablePadding(e)).filter(Boolean) : void 0,
558
563
  [l]
559
- ), it = I?.length ? I : ve.selectedValues || ct, We = Yt(
560
- it
561
- ), x = b({
564
+ ), pt = P?.length ? P : ne.selectedValues || mt, je = tn(
565
+ pt
566
+ ), g = T({
567
+ showImageInput: z,
568
+ imageInput: Fe,
562
569
  onPlaceholderAccepted: t,
563
- direction: j,
564
- language: ee,
565
- mermaidMessages: $,
566
- beforeSend: pe,
570
+ direction: ee,
571
+ language: te,
572
+ mermaidMessages: ce,
573
+ beforeSend: F,
567
574
  locale: o,
568
- onClickCustomButtonAfterContent: me,
569
- onSend: g,
570
- readonly: C,
571
- renderContent: F,
572
- resolvedConfirmButtonText: Re,
573
- resolvedCopiedButtonText: Ne,
574
- resolvedCopyButtonText: Be,
575
- resolvedDefaultButtonText: Ie,
576
- resolvedDefaultInputText: De,
577
- resolvedDefaultSelectedValues: We
575
+ onClickCustomButtonAfterContent: D,
576
+ onSend: v,
577
+ readonly: w,
578
+ renderContent: _,
579
+ resolvedConfirmButtonText: Ne,
580
+ resolvedCopiedButtonText: Me,
581
+ resolvedCopyButtonText: Le,
582
+ resolvedDefaultButtonText: Ge,
583
+ resolvedDefaultInputText: _e,
584
+ resolvedDefaultSelectedValues: je
578
585
  });
579
- x.current = {
586
+ g.current = {
587
+ showImageInput: z,
588
+ imageInput: Fe,
580
589
  onPlaceholderAccepted: t,
581
- direction: j,
582
- language: ee,
583
- mermaidMessages: $,
584
- beforeSend: pe,
590
+ direction: ee,
591
+ language: te,
592
+ mermaidMessages: ce,
593
+ beforeSend: F,
585
594
  locale: o,
586
- onClickCustomButtonAfterContent: me,
587
- onSend: g,
588
- readonly: C,
589
- renderContent: F,
590
- resolvedConfirmButtonText: Re,
591
- resolvedCopiedButtonText: Ne,
592
- resolvedCopyButtonText: Be,
593
- resolvedDefaultButtonText: Ie,
594
- resolvedDefaultInputText: De,
595
- resolvedDefaultSelectedValues: We
595
+ onClickCustomButtonAfterContent: D,
596
+ onSend: v,
597
+ readonly: w,
598
+ renderContent: _,
599
+ resolvedConfirmButtonText: Ne,
600
+ resolvedCopiedButtonText: Me,
601
+ resolvedCopyButtonText: Le,
602
+ resolvedDefaultButtonText: Ge,
603
+ resolvedDefaultInputText: _e,
604
+ resolvedDefaultSelectedValues: je
596
605
  };
597
606
  const xe = h(
598
607
  () => ({
@@ -602,28 +611,30 @@ const _t = 2, be = ({
602
611
  "button",
603
612
  {
604
613
  className: "content-render-custom-button-after-content",
605
- onClick: x.current.onClickCustomButtonAfterContent,
614
+ onClick: g.current.onClickCustomButtonAfterContent,
606
615
  children: /* @__PURE__ */ s("span", { className: "content-render-custom-button-after-content-inner", children: e })
607
616
  }
608
617
  ),
609
618
  "custom-variable": (e) => /* @__PURE__ */ s(
610
- gt,
619
+ Ct,
611
620
  {
612
621
  ...e,
613
- readonly: x.current.readonly,
614
- defaultButtonText: x.current.resolvedDefaultButtonText,
615
- defaultInputText: x.current.resolvedDefaultInputText,
616
- defaultSelectedValues: x.current.resolvedDefaultSelectedValues,
617
- onSend: x.current.onSend,
618
- onPlaceholderAccepted: x.current.onPlaceholderAccepted,
619
- beforeSend: x.current.beforeSend,
620
- locale: x.current.locale,
621
- dir: x.current.direction,
622
- lang: x.current.language,
623
- confirmButtonText: x.current.resolvedConfirmButtonText
622
+ showImageInput: g.current.showImageInput,
623
+ imageInput: g.current.imageInput,
624
+ readonly: g.current.readonly,
625
+ defaultButtonText: g.current.resolvedDefaultButtonText,
626
+ defaultInputText: g.current.resolvedDefaultInputText,
627
+ defaultSelectedValues: g.current.resolvedDefaultSelectedValues,
628
+ onSend: g.current.onSend,
629
+ onPlaceholderAccepted: g.current.onPlaceholderAccepted,
630
+ beforeSend: g.current.beforeSend,
631
+ locale: g.current.locale,
632
+ dir: g.current.direction,
633
+ lang: g.current.language,
634
+ confirmButtonText: g.current.resolvedConfirmButtonText
624
635
  }
625
636
  ),
626
- code: Ye,
637
+ code: tt,
627
638
  table: ({ ...e }) => /* @__PURE__ */ s("div", { className: "content-render-table-container", children: /* @__PURE__ */ s("table", { className: "content-render-table", ...e }) }),
628
639
  th: ({ ...e }) => /* @__PURE__ */ s("th", { className: "content-render-th", ...e }),
629
640
  td: ({ ...e }) => /* @__PURE__ */ s("td", { className: "content-render-td", ...e }),
@@ -645,119 +656,119 @@ const _t = 2, be = ({
645
656
  ) : /* @__PURE__ */ s("input", { ...e }),
646
657
  a: ({ children: e, ...n }) => /* @__PURE__ */ s("a", { target: "_blank", rel: "noopener noreferrer", ...n, children: e }),
647
658
  pre: (e) => /* @__PURE__ */ s(
648
- ft,
659
+ yt,
649
660
  {
650
661
  ...e,
651
- copyButtonText: x.current.resolvedCopyButtonText,
652
- copiedButtonText: x.current.resolvedCopiedButtonText
662
+ copyButtonText: g.current.resolvedCopyButtonText,
663
+ copiedButtonText: g.current.resolvedCopiedButtonText
653
664
  }
654
665
  )
655
666
  }),
656
667
  []
657
- ), ut = h(
658
- () => je(Pe),
659
- [Pe]
660
- ), lt = (e, n) => {
668
+ ), ft = h(
669
+ () => Ue(De),
670
+ [De]
671
+ ), ht = (e, n) => {
661
672
  const a = we(e);
662
- return je(a).map((T, ye) => {
663
- const Y = `${n}-${T.type}-${ye}`;
664
- return T.type === "text" ? /* @__PURE__ */ s(
665
- ce.Provider,
673
+ return Ue(a).map((k, ye) => {
674
+ const Y = `${n}-${k.type}-${ye}`;
675
+ return k.type === "text" ? /* @__PURE__ */ s(
676
+ le.Provider,
666
677
  {
667
- value: x,
678
+ value: g,
668
679
  children: /* @__PURE__ */ s(
669
- Qe,
680
+ Xe,
670
681
  {
671
682
  locale: o,
672
683
  components: xe,
673
- content: T.value
684
+ content: k.value
674
685
  }
675
686
  )
676
687
  },
677
688
  Y
678
- ) : T.type === "mermaid" ? /* @__PURE__ */ s(
689
+ ) : k.type === "mermaid" ? /* @__PURE__ */ s(
679
690
  ke,
680
691
  {
681
- chart: T.value,
682
- frozen: !T.complete,
683
- messages: $
692
+ chart: k.value,
693
+ frozen: !k.complete,
694
+ messages: ce
684
695
  },
685
696
  Y
686
- ) : T.type === "svg" ? /* @__PURE__ */ s(be, { svg: T.value }, Y) : null;
697
+ ) : k.type === "svg" ? /* @__PURE__ */ s(be, { svg: k.value }, Y) : null;
687
698
  });
688
- }, ze = y ? /* @__PURE__ */ s("div", { className: "content-render-custom-bar", children: X.createElement(y, {
699
+ }, He = y ? /* @__PURE__ */ s("div", { className: "content-render-custom-bar", children: X.createElement(y, {
689
700
  content: r,
690
- displayContent: at,
691
- onSend: g
701
+ displayContent: dt,
702
+ onSend: v
692
703
  }) }) : null;
693
- return K ? /* @__PURE__ */ Fe(
704
+ return K ? /* @__PURE__ */ qe(
694
705
  "div",
695
706
  {
696
707
  className: "content-render markdown-body",
697
- dir: j,
698
- lang: ee,
708
+ dir: ee,
709
+ lang: te,
699
710
  children: [
700
- st.map((e) => {
701
- const n = e.indices[0], a = z[n];
711
+ lt.map((e) => {
712
+ const n = e.indices[0], a = G[n];
702
713
  return e.sandbox ? a.type === "sandbox" && a.value && !a.pending ? /* @__PURE__ */ s(
703
- bt,
714
+ Lt,
704
715
  {
705
716
  hideFullScreen: !0,
706
717
  type: "sandbox",
707
718
  content: a.value,
708
719
  className: "content-render-iframe",
709
720
  locale: o,
710
- dir: j,
711
- lang: ee,
712
- loadingText: ne,
713
- styleLoadingText: ie,
714
- scriptLoadingText: ue,
715
- disableLoadingOverlay: re,
716
- fullScreenButtonText: Je,
717
- exitFullScreenButtonText: et,
718
- mode: de
721
+ dir: ee,
722
+ lang: te,
723
+ loadingText: me,
724
+ styleLoadingText: se,
725
+ scriptLoadingText: ae,
726
+ disableLoadingOverlay: pe,
727
+ fullScreenButtonText: ot,
728
+ exitFullScreenButtonText: st,
729
+ mode: Be
719
730
  },
720
731
  `sandbox-${n}`
721
732
  ) : null : e.plan ? /* @__PURE__ */ s(
722
- ce.Provider,
733
+ le.Provider,
723
734
  {
724
- value: x,
735
+ value: g,
725
736
  children: /* @__PURE__ */ s(
726
- qt,
737
+ Yt,
727
738
  {
728
739
  locale: o,
729
740
  components: xe,
730
741
  plan: e.plan,
731
742
  renderedSegments: e.indices.map(
732
- (d) => z[d]
743
+ (d) => G[d]
733
744
  )
734
745
  }
735
746
  )
736
747
  },
737
748
  `md-${n}`
738
- ) : e.indices.map((d) => /* @__PURE__ */ s(X.Fragment, { children: z[d].type === "markdown" && z[d].pending ? null : lt(
739
- ot[d],
749
+ ) : e.indices.map((d) => /* @__PURE__ */ s(X.Fragment, { children: G[d].type === "markdown" && G[d].pending ? null : ht(
750
+ ut[d],
740
751
  `md-${d}`
741
752
  ) }, `md-${d}`));
742
753
  }),
743
- ze
754
+ He
744
755
  ]
745
756
  }
746
- ) : /* @__PURE__ */ Fe(
757
+ ) : /* @__PURE__ */ qe(
747
758
  "div",
748
759
  {
749
760
  className: "content-render markdown-body",
750
- dir: j,
751
- lang: ee,
761
+ dir: ee,
762
+ lang: te,
752
763
  children: [
753
- ut.map((e, n) => {
764
+ ft.map((e, n) => {
754
765
  if (e.type === "text")
755
766
  return /* @__PURE__ */ s(
756
- ce.Provider,
767
+ le.Provider,
757
768
  {
758
- value: x,
769
+ value: g,
759
770
  children: /* @__PURE__ */ s(
760
- Qe,
771
+ Xe,
761
772
  {
762
773
  locale: o,
763
774
  components: xe,
@@ -773,20 +784,20 @@ const _t = 2, be = ({
773
784
  {
774
785
  chart: e.value,
775
786
  frozen: !e.complete,
776
- messages: $
787
+ messages: ce
777
788
  },
778
789
  n
779
790
  );
780
791
  if (e.type === "svg")
781
792
  return /* @__PURE__ */ s(be, { svg: e.value }, n);
782
793
  }),
783
- ze
794
+ He
784
795
  ]
785
796
  }
786
797
  );
787
798
  };
788
799
  export {
789
- Qe as MarkdownRenderer,
790
- Vn as default
800
+ Xe as MarkdownRenderer,
801
+ Dn as default
791
802
  };
792
803
  //# sourceMappingURL=ContentRender.es.js.map