markstream-react 0.0.56-beta.2 → 0.0.56-beta.4
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 +47 -1
- package/dist/Tooltip-DygdyBfV.js +205 -0
- package/dist/codeBlockExtraProps-B08PlQGP.js +8 -0
- package/dist/{index-D0DspXy9.js → index-BQgUvQrW.js} +41 -41
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/index.px.css +1 -1
- package/dist/index.tailwind.css +1 -1
- package/dist/languageIconExtended-DRR7G3nV.js +1 -0
- package/dist/markstream-react.css +1 -1
- package/dist/next.d.ts +2 -0
- package/dist/next.js +1 -1
- package/dist/server.d.ts +3 -1
- package/dist/server.js +1 -1
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.js +1 -1
- package/dist/types/components/CodeBlockNode/PreCodeNode.d.ts +1 -1
- package/dist/types/components/CodeBlockNode/codeTypography.d.ts +14 -0
- package/dist/types/hooks/useSmoothMarkdownStream.d.ts +18 -1
- package/dist/types/server-renderer/index.d.ts +1 -1
- package/dist/types/types/component-props.d.ts +2 -0
- package/package.json +6 -2
- package/dist/Tooltip-Bx_S1cbE.js +0 -207
- package/dist/codeBlockExtraProps-RaPzFq78.js +0 -3
- package/dist/languageIconExtended-B1nZmPQn.js +0 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{jsx as e,Fragment as t,jsxs as n}from"react/jsx-runtime";import a,{useMemo as r}from"react";import{normalizeCustomHtmlTagName as l,hasCustomHtmlComponents as o,tokenizeHtml as s,BLOCKED_HTML_TAGS as i,isHtmlTagHardBlocked as c,isHtmlTagBlocked as h,sanitizeHtmlAttrs as u,isCustomHtmlComponentTag as d,convertHtmlAttrsToProps as m,getHtmlTagFromContent as p}from"stream-markdown-parser";const v=/* @__PURE__ */new Set(["table","code_block","html_block","blockquote","list","list_item","definition_list","footnote","footnote_reference","footnote_anchor","admonition","thematic_break","math_block","thinking","vmr_container"]);function f(e){if(Array.isArray(e)&&0!==e.length)return e.reduce((e,[t,n])=>t?(e["for"===t?"htmlFor":"class"===t?"className":t]=null==n||n,e):e,{})}function g(t,n,a,r){if(!Array.isArray(t)||0===t.length)return null;const l=[];for(let o=0;o<t.length;o++){const s=t[o];if(s){if("label_open"===s.type){const i=[];for(o++;o<t.length;){const e=t[o];if("label_close"===(null==e?void 0:e.type))break;e&&i.push(e),o++}const c=`${a}-label-${o}`;l.push(
|
|
2
|
+
/* @__PURE__ */e("label",{...f(s.attrs),children:g(i,n,`${c}-child`,r)},c));continue}"label_close"!==s.type&&l.push(r(s,`${a}-${o}`,n))}}return l}function w(n,a,r,l){/* @__PURE__ */
|
|
3
|
+
return e(t,{children:g(n,a,`${r}-inline`,l)})}const x=!1;function k(){return x}const y="__global__",b="__MARKSTREAM_REACT_CUSTOM_COMPONENTS_STORE__",N=(()=>{const e=globalThis;if(e[b])return e[b];const t={scopedComponents:{},revision:0,listeners:/* @__PURE__ */new Set};return e[b]=t,t})();function C(){N.revision++;for(const e of Array.from(N.listeners))try{e()}catch{}}function M(e){return N.listeners.add(e),()=>{N.listeners.delete(e)}}function $(){return N.revision}function _(e,t){"string"==typeof e?N.scopedComponents[e]={...t||{}}:N.scopedComponents[y]={...e},C()}function H(e){const t=N.scopedComponents[y]||{};if(!e)return t;const n=N.scopedComponents[e]||{};return t&&0!==Object.keys(t).length?n&&0!==Object.keys(n).length?{...t,...n}:t:n}function z(e){if(e===y)throw new Error("removeCustomComponents: cannot delete global mapping; call clearGlobalCustomComponents instead.");delete N.scopedComponents[e],C()}function B(){delete N.scopedComponents[y],C()}function A(e){return null==e?void 0:e.markstreamDisplay}function j(e,t){return e.markstreamDisplay=t,e}function S(e){return e}function V(e){return e}function L(e){if(!e)return{};const t={};for(const[n,a]of Object.entries(e)){const e=l(n);e&&(t[e]=a)}return t}function O(e,t,n){if(k())for(const a of Object.keys(e))t[a]&&!n.has(a)&&(n.add(a),console.warn(`[markstream-react] "${a}" was provided in both streamingComponents and htmlComponents. The streamingComponents entry will be used for parser-backed rendering.`))}const q='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M30 14v-2h-2V8h-2v4h-2V8h-2v4h-2v2h2v2h-2v2h2v4h2v-4h2v4h2v-4h2v-2h-2v-2Zm-4 2h-2v-2h2Zm-12.437 6A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>',T='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>';let E=null,F=null,P=null;const Z=/* @__PURE__ */new Set;function K(e){E=null!=e?e:null}const I={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",d2lang:"d2",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"},W={"":T,plain:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>',text:T,javascript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ffca28" d="M2 2v12h12V2zm6 6h1v4a1.003 1.003 0 0 1-1 1H7a1.003 1.003 0 0 1-1-1v-1h1v1h1zm3 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>',typescript:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 16 16"><path fill="#0288d1" d="M2 2v12h12V2zm4 6h3v1H8v4H7V9H6zm5 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>',jsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00bcd4" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#00bcd4" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#00bcd4" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#00bcd4" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>',tsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#0288d1" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#0288d1" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#0288d1" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>',html:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#e65100" d="m4 4 2 22 10 2 10-2 2-22Zm19.72 7H11.28l.29 3h11.86l-.802 9.335L15.99 25l-6.635-1.646L8.93 19h3.02l.19 2 3.86.77 3.84-.77.29-4H8.84L8 8h16Z"/></svg>',css:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#7e57c2" d="M20 18h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 20 22h2v2h2v-2c0-.388-.562-.851-1.254-1.034C20.356 20.34 20 18.84 20 18m-3.254 2.966C14.356 20.34 14 18.84 14 18h-2v-2h-2v8h2v-2h4v2h2v-2c0-.388-.562-.851-1.254-1.034"/><path fill="#7e57c2" d="M24 4H4v20a4 4 0 0 0 4 4h16.16A3.84 3.84 0 0 0 28 24.16V8a4 4 0 0 0-4-4m2 14h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 26 22v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2Z"/></svg>',scss:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ec407a" d="M27.837 5.673a4.33 4.33 0 0 0-2.293-2.701c-2.362-1.261-6.11-1.298-9.548-.092a26.3 26.3 0 0 0-8.76 4.966c-2.752 2.542-3.438 4.925-3.189 6.194.523 2.668 3.274 4.539 5.485 6.042.418.284.822.559 1.175.816-1.429.76-4.261 2.444-5.088 4.248a3.88 3.88 0 0 0-.118 3.332A2.37 2.37 0 0 0 6.869 29.8a5.6 5.6 0 0 0 1.49.2 6.35 6.35 0 0 0 5.19-2.856 6.74 6.74 0 0 0 .864-5.382 7.3 7.3 0 0 1 2.044-.03 3.92 3.92 0 0 1 2.816 1.311 1.82 1.82 0 0 1 .423 1.262 1.55 1.55 0 0 1-.772 1.05c-.234.14-.586.355-.504.803.036.194.198.633.894.512a2.93 2.93 0 0 0 2.145-2.651 4 4 0 0 0-1.197-2.904 5.94 5.94 0 0 0-4.396-1.626 10.6 10.6 0 0 0-2.672.304 20 20 0 0 0-2.203-1.846c-1.712-1.3-3.33-2.529-3.235-4.26.125-2.263 2.468-4.532 6.964-6.744 4.016-1.976 7.254-2.037 8.944-1.438a2 2 0 0 1 1.204.883 2.77 2.77 0 0 1-.36 2.47 9.71 9.71 0 0 1-7.425 4.304 3.86 3.86 0 0 1-3.238-.757c-.278-.302-.593-.645-1.074-.383q-.565.31-.225 1.189a3.9 3.9 0 0 0 2.407 1.92 11.7 11.7 0 0 0 7.128-.671c3.527-1.35 6.681-5.202 5.756-8.787M11.895 24.475a4 4 0 0 1-.192.468 4.5 4.5 0 0 1-.753 1.081 2.83 2.83 0 0 1-2.533 1.107c-.056-.032-.078-.146-.085-.193a3.28 3.28 0 0 1 1.076-2.284 11.3 11.3 0 0 1 2.644-1.933 3.85 3.85 0 0 1-.157 1.754"/></svg>',json:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="#f9a825" d="M560-160v-80h120q17 0 28.5-11.5T720-280v-80q0-38 22-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50 0 85 35t35 85v80q0 17 11.5 28.5T840-560h40v160h-40q-17 0-28.5 11.5T800-360v80q0 50-35 85t-85 35zm-280 0q-50 0-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17 0 28.5-11.5T160-600v-80q0-50 35-85t85-35h120v80H280q-17 0-28.5 11.5T240-680v80q0 38-22 69t-58 44v14q36 13 58 44t22 69v80q0 17 11.5 28.5T280-240h120v80z"/></svg>',python:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#0288d1" d="M9.86 2A2.86 2.86 0 0 0 7 4.86v1.68h4.29c.39 0 .71.57.71.96H4.86A2.86 2.86 0 0 0 2 10.36v3.781a2.86 2.86 0 0 0 2.86 2.86h1.18v-2.68a2.85 2.85 0 0 1 2.85-2.86h5.25c1.58 0 2.86-1.271 2.86-2.851V4.86A2.86 2.86 0 0 0 14.14 2zm-.72 1.61c.4 0 .72.12.72.71s-.32.891-.72.891c-.39 0-.71-.3-.71-.89s.32-.711.71-.711"/><path fill="#fdd835" d="M17.959 7v2.68a2.85 2.85 0 0 1-2.85 2.859H9.86A2.85 2.85 0 0 0 7 15.389v3.75a2.86 2.86 0 0 0 2.86 2.86h4.28A2.86 2.86 0 0 0 17 19.14v-1.68h-4.291c-.39 0-.709-.57-.709-.96h7.14A2.86 2.86 0 0 0 22 13.64V9.86A2.86 2.86 0 0 0 19.14 7zM8.32 11.513l-.004.004.038-.004zm6.54 7.276c.39 0 .71.3.71.89a.71.71 0 0 1-.71.71c-.4 0-.72-.12-.72-.71s.32-.89.72-.89"/></svg>',ruby:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#f44336" d="M18.041 3.177c2.24.382 2.879 1.919 2.843 3.527V6.67l-1.013 13.266-13.132.897h.008c-1.093-.044-3.518-.151-3.634-3.545l1.217-2.222 2.462 5.74 2.097-6.77-.045.009.018-.018 6.85 2.186L13.945 9.3l6.53-.409-5.144-4.212 2.71-1.51v.009M3.113 17.252v.017zM6.916 6.874c2.63-2.622 6.033-4.168 7.34-2.844 1.297 1.306-.072 4.523-2.702 7.135-2.666 2.613-6.015 4.248-7.322 2.933-1.306-1.324.036-4.612 2.675-7.224z"/></svg>',go:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00acc1" d="M2 12h4v2H2zm-2 4h6v2H0zm4 4h2v2H4zm16.954-5H14v3h3.239a4.42 4.42 0 0 1-3.531 2 2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 15.292 13a2.73 2.73 0 0 1 1.749.584l2.962-1.185A5.6 5.6 0 0 0 15.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 6.4 6.4 0 0 0 .003-1.5"/><path fill="#00acc1" d="M26.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 5.614 5.614 0 0 0-5.659-6.5m2.681 6.137A4.515 4.515 0 0 1 24.708 20a2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 26.292 13a2.65 2.65 0 0 1 2.053.858 2.86 2.86 0 0 1 .628 2.28Z"/></svg>',java:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#f44336" d="M4 26h24v2H4zM28 4H7a1 1 0 0 0-1 1v13a4 4 0 0 0 4 4h10a4 4 0 0 0 4-4v-4h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 8h-4V6h4Z"/></svg>',kotlin:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><defs><linearGradient id="a" x1="1.725" x2="22.185" y1="22.67" y2="1.982" gradientTransform="translate(1.306 1.129)scale(.89324)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7c4dff"/><stop offset=".5" stop-color="#d500f9"/><stop offset="1" stop-color="#ef5350"/></linearGradient></defs><path fill="url(#a)" d="M2.975 2.976v18.048h18.05v-.03l-4.478-4.511-4.48-4.515 4.48-4.515 4.443-4.477z"/></svg>',c:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M19.563 22A5.57 5.57 0 0 1 14 16.437v-2.873A5.57 5.57 0 0 1 19.563 8H24V2h-4.437A11.563 11.563 0 0 0 8 13.563v2.873A11.564 11.564 0 0 0 19.563 28H24v-6Z"/></svg>',cpp:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M28 14v-4h-2v4h-6v-4h-2v4h-4v2h4v4h2v-4h6v4h2v-4h4v-2z"/><path fill="#0288d1" d="M13.563 22A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>',cs:q,csharp:q,php:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#1e88e5" d="M12 18.08c-6.63 0-12-2.72-12-6.08s5.37-6.08 12-6.08S24 8.64 24 12s-5.37 6.08-12 6.08m-5.19-7.95c.54 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.58 1.09q-.42.33-1.29.33h-.87l.53-2.76zm-3.5 5.55h1.44l.34-1.75h1.23c.54 0 .98-.06 1.33-.17.35-.12.67-.31.96-.58.24-.22.43-.46.58-.73.15-.26.26-.56.31-.88.16-.78.05-1.39-.33-1.82-.39-.44-.99-.65-1.82-.65H4.59zm7.25-8.33-1.28 6.58h1.42l.74-3.77h1.14c.36 0 .6.06.71.18s.13.34.07.66l-.57 2.93h1.45l.59-3.07c.13-.62.03-1.07-.27-1.36-.3-.27-.85-.4-1.65-.4h-1.27L12 7.35zM18 10.13c.55 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.57 1.09-.29.22-.72.33-1.3.33h-.85l.5-2.76zm-3.5 5.55h1.44l.34-1.75h1.22c.55 0 1-.06 1.35-.17.35-.12.65-.31.95-.58.24-.22.44-.46.58-.73.15-.26.26-.56.32-.88.15-.78.04-1.39-.34-1.82-.36-.44-.99-.65-1.82-.65h-2.75z"/></svg>',shell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>',powershell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#03a9f4" d="M29.07 6H7.677A1.535 1.535 0 0 0 6.24 7.113l-4.2 17.774A.852.852 0 0 0 2.93 26h21.393a1.535 1.535 0 0 0 1.436-1.113L29.96 7.112A.852.852 0 0 0 29.07 6M8.626 23.797a1.4 1.4 0 0 1-1.814-.31l-.007-.009a1.075 1.075 0 0 1 .315-1.599l9.6-6.061-6.102-5.852-.01-.01a1.068 1.068 0 0 1 .084-1.625l.037-.03a1.38 1.38 0 0 1 1.8.07l7.233 6.957a1.1 1.1 0 0 1 .236.739 1.08 1.08 0 0 1-.412.79c-.074.04-.146.119-10.951 6.935ZM24 22.94A1.135 1.135 0 0 1 22.803 24h-5.634a1.061 1.061 0 1 1 .001-2.112h5.633A1.134 1.134 0 0 1 24 22.938Z"/></svg>',sql:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ffca28" d="M16 24c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-8c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-12C10.477 4 6 4.895 6 6v4c0 1.1 4.475 2 10 2s10-.9 10-2V6c0-1.105-4.477-2-10-2"/></svg>',yaml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#ff5252" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12c0 1.1-.9 2-2 2H6c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2m12 16v-2H9v2zm-4-4v-2H6v2z"/></svg>',markdown:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>',xml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#8bc34a" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.11.89-2 2-2m.12 13.5 3.74 3.74 1.42-1.41-2.33-2.33 2.33-2.33-1.42-1.41zm11.16 0-3.74-3.74-1.42 1.41 2.33 2.33-2.33 2.33 1.42 1.41z"/></svg>',rust:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ff7043" d="m30 12-4-2V6h-4l-2-4-4 2-4-2-2 4H6v4l-4 2 2 4-2 4 4 2v4h4l2 4 4-2 4 2 2-4h4v-4l4-2-2-4ZM6 16a9.9 9.9 0 0 1 .842-4H10v8H6.842A9.9 9.9 0 0 1 6 16m10 10a9.98 9.98 0 0 1-7.978-4H16v-2h-2v-2h4c.819.819.297 2.308 1.179 3.37a1.89 1.89 0 0 0 1.46.63h3.34A9.98 9.98 0 0 1 16 26m-2-12v-2h4a1 1 0 0 1 0 2Zm11.158 6H24a2.006 2.006 0 0 1-2-2 2 2 0 0 0-2-2 3 3 0 0 0 3-3q0-.08-.004-.161A3.115 3.115 0 0 0 19.83 10H8.022a9.986 9.986 0 0 1 17.136 10"/></svg>',vue:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#41b883" d="M1.791 3.851 12 21.471 22.209 3.936V3.85H18.24l-6.18 10.616L5.906 3.851z"/><path fill="#35495e" d="m5.907 3.851 6.152 10.617L18.24 3.851h-3.723L12.084 8.03 9.66 3.85z"/></svg>',mermaid:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>'};function D(e){var t;const n=function(e){if(!e)return"";const t=e.trim();if(!t)return"";const[n]=t.split(/\s+/),[a]=n.split(":");return a.toLowerCase()}(e);return null!=(t=I[n])?t:n}function G(e){const t=D(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}async function U(){return F||(P||(P=import("./languageIconExtended-DRR7G3nV.js").then(e=>(F=e.EXTENDED_LANGUAGE_ICON_MAP,function(){for(const e of Z)try{e()}catch{}}(),F)).catch(()=>null)),P)}async function R(){await U()}function J(e){return Z.add(e),()=>{Z.delete(e)}}function X(e){if(E){const t=E(e);if(null!=t&&""!==t)return t}const t=D(e),n=W[t];if(n)return n;return(null==F?void 0:F[t])||(U(),'<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>')}const Q={javascript:"JavaScript",typescript:"TypeScript",jsx:"JSX",tsx:"TSX",shell:"Shell",plain:"Text",text:"Text",markdown:"Markdown",json:"JSON",python:"Python",cpp:"C++",csharp:"C#",vue:"Vue",html:"HTML",css:"CSS",svg:"SVG",mermaid:"Mermaid",d2:"D2"},Y=12;function ee(e){return"number"==typeof e&&Number.isFinite(e)&&e>0?e:void 0}function te(e,t){var n,a,r;const l=null!=(a=null!=(n=ee(null==e?void 0:e.fontSize))?n:ee(t))?a:12,o=null!=(r=ee(null==e?void 0:e.lineHeight))?r:12===l?18:Math.max(12,Math.round(1.5*l));return{fontFamily:"string"==typeof(null==e?void 0:e.fontFamily)&&e.fontFamily.trim()?e.fontFamily.trim():'"SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono", "Courier New", monospace',fontSize:l,lineHeight:o}}function ne(e){var t;return String(null!=(t=String(null!=e?e:"").split(/\s+/g)[0])?t:"").split(":")[0].toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}function ae(e){const t=String(null!=e?e:"");return t?t.split(/\r\n|\n|\r/):[]}function re(e){return e.startsWith("-")&&!e.startsWith("---")}function le(e){return e.startsWith("+")&&!e.startsWith("+++")}function oe(e,t){return n=e[t],!(0===String(null!=n?n:"").trim().length)||t<e.length-1;var n}function se(e,t,n,a,r={}){const l=0===String(null!=e?e:"").trim().length;return{code:e,empty:l,kind:l&&"hunk"!==t&&!r.preserveBlankKind?"context":t,key:n,number:a}}function ie(e,t){const n=ae(e),a=ae(t),r=function(e,t){const n=e.length,a=t.length;if((n+1)*(a+1)>15e5)return null;const r=a+1,l=new Uint16Array((n+1)*(a+1));for(let c=n-1;c>=0;c--)for(let n=a-1;n>=0;n--){const a=c*r+n;e[c]===t[n]?l[a]=l[(c+1)*r+n+1]+1:l[a]=Math.max(l[(c+1)*r+n],l[c*r+n+1])}const o=[];let s=0,i=0;for(;s<n&&i<a;)e[s]===t[i]?(o.push({originalIndex:s,modifiedIndex:i}),s++,i++):l[(s+1)*r+i]>=l[s*r+i+1]?s++:i++;return o}(n,a);if(r){const e=[];let t=0,l=0;for(const o of r){for(;t<o.originalIndex;)e.push(se(n[t],"removed",`inline-removed-source-${t}`,"",{preserveBlankKind:oe(n,t)})),t++;for(;l<o.modifiedIndex;)e.push(se(a[l],"added",`inline-added-source-${l}`,l+1,{preserveBlankKind:oe(a,l)})),l++;e.push(se(a[o.modifiedIndex],"context",`inline-context-source-${o.originalIndex}-${o.modifiedIndex}`,o.modifiedIndex+1)),t=o.originalIndex+1,l=o.modifiedIndex+1}for(;t<n.length;)e.push(se(n[t],"removed",`inline-removed-source-${t}`,"",{preserveBlankKind:oe(n,t)})),t++;for(;l<a.length;)e.push(se(a[l],"added",`inline-added-source-${l}`,l+1,{preserveBlankKind:oe(a,l)})),l++;return e}const l=[];let o=0,s=n.length-1,i=a.length-1;for(;o<=s&&o<=i&&n[o]===a[o];)l.push(se(a[o],"context",`inline-prefix-${o}`,o+1)),o++;const c=[];for(;s>=o&&i>=o&&n[s]===a[i];)c.unshift(se(a[i],"context",`inline-suffix-${i}`,i+1)),s--,i--;for(let h=o;h<=s;h++)l.push(se(n[h],"removed",`inline-removed-source-${h}`,"",{preserveBlankKind:oe(n,h)}));for(let h=o;h<=i;h++)l.push(se(a[h],"added",`inline-added-source-${h}`,h+1,{preserveBlankKind:oe(a,h)}));return l.concat(c)}function ce(e,t=!1,n=ne(null==e?void 0:e.language)){const a=(r=null==e?void 0:e.code,String(null!=r?r:"").split(/\r\n|\n|\r/));var r;if(!function(e,t,n){const a=e.some(e=>re(e)),r=e.some(e=>le(e));return a&&r||function(e,t){var n,a,r;if("diff"===t)return!0;const l=null!=(r=null==(a=String(null!=(n=null==e?void 0:e.raw)?n:"").split(/\r?\n/,1)[0])?void 0:a.trim())?r:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(l)}(t,n)&&(a||r)}(a,e,n)&&function(e){return null!=(null==e?void 0:e.originalCode)||null!=(null==e?void 0:e.updatedCode)}(e)){if(t)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:ie(null==e?void 0:e.originalCode,null==e?void 0:e.updatedCode)}];const n=ae(null==e?void 0:e.originalCode),a=ae(null==e?void 0:e.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:n.map((e,t)=>se(e,a[t]===e?"context":"removed",`original-${t}`,t+1,{preserveBlankKind:oe(n,t)}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:a.map((e,t)=>se(e,n[t]===e?"context":"added",`modified-${t}`,t+1,{preserveBlankKind:oe(a,t)}))}]}if(t){const e=function(e){let t=1;return e.map((e,n)=>e.startsWith("@@")?se(e,"hunk",`inline-hunk-${n}`,""):re(e)?se(e.slice(1),"removed",`inline-removed-${n}`,"",{preserveBlankKind:!0}):le(e)?se(e.slice(1),"added",`inline-added-${n}`,t++,{preserveBlankKind:!0}):se(e.startsWith(" ")?e.slice(1):e,"context",`inline-context-${n}`,t++))}(a);return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:e}]}const l=[],o=[];let s=1,i=1;for(const[c,h]of a.entries())if(h.startsWith("@@"))l.push(se(h,"hunk",`original-hunk-${c}`,"")),o.push(se(h,"hunk",`modified-hunk-${c}`,""));else if(re(h))l.push(se(h.slice(1),"removed",`original-removed-${c}`,s++,{preserveBlankKind:!0}));else if(le(h))o.push(se(h.slice(1),"added",`modified-added-${c}`,i++,{preserveBlankKind:!0}));else{const e=h.startsWith(" ")?h.slice(1):h;l.push(se(e,"context",`original-context-${c}`,s++)),o.push(se(e,"context",`modified-context-${c}`,i++))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:l},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:o}]}function he({node:a,className:l,diffInline:o,showLineNumbers:s,style:i,monacoOptions:c}){const h=r(()=>ne(null==a?void 0:a.language),[a]),u=`language-${h}`,d=h?`Code block: ${h}`:"Code block",m=!0===s&&!0===(null==a?void 0:a.diff),p=r(()=>m?ce(a,!0===o,h):[],[o,m,a,h]),v=r(()=>function(e){var t,n;if(!0===(null==e?void 0:e.diff))return String(null!=(t=null==e?void 0:e.code)?t:"");const a=String(null!=(n=null==e?void 0:e.code)?n:"");return!0===(null==e?void 0:e.loading)?a:a.replace(/\r\n$|\n$|\r$/,"")}(a),[a]),f=r(()=>function(e){let t=1;for(let n=0;n<e.length;n++)"\n"===e[n]?t++:"\r"===e[n]&&(t++,"\n"===e[n+1]&&n++);return t}(v),[v]),g=r(()=>{let e="";for(let t=1;t<=f;t++)e+=`${e?"\n":""}${t}`;return e},[f]),w=r(()=>{if(!0===s&&!m)return{"--markstream-pre-line-number-width":`${Math.max(4,String(f).length)}ch`,"--markstream-code-padding-left":"calc(var(--markstream-pre-line-number-padding-left, 2ch) + var(--markstream-pre-line-number-width, 2ch) + var(--markstream-pre-line-number-padding-right, 1ch) + var(--markstream-pre-line-number-separator-width, 2px) + var(--markstream-pre-line-number-gap-to-code, 1ch))"}},[m,s,f]),x=r(()=>{var e;const t=!0===(null==l?void 0:l.split(/\s+/).includes("code-fallback-plain")),n=t?te(c):{fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',fontSize:16,lineHeight:28},a=t?function(e,t=8){var n,a;const r=null==e?void 0:e.padding;if(!r||"object"!=typeof r)return{top:t,bottom:t};const l=r;return{top:null!=(n=ee(l.top))?n:0,bottom:null!=(a=ee(l.bottom))?a:0}}(c,m?0:8):{top:0,bottom:0};return{"--markstream-pre-line-number-top":`${a.top}px`,fontFamily:n.fontFamily,fontSize:`${n.fontSize}px`,lineHeight:`${n.lineHeight}px`,paddingBottom:`${a.bottom}px`,paddingTop:`${a.top}px`,tabSize:t?null!=(e=ee(null==c?void 0:c.tabSize))?e:4:2,...i,...w}},[l,m,w,c,i]);/* @__PURE__ */
|
|
4
|
+
return e("pre",{className:[u,l,s?"markstream-pre--line-numbers":"",m?"markstream-pre--diff-preview":"",m&&o?"markstream-pre--diff-inline":""].filter(Boolean).join(" "),style:x,"aria-busy":!0===(null==a?void 0:a.loading),"aria-label":d,"data-language":h,"data-markstream-line-numbers":s?"1":void 0,"data-markstream-pre":"1",tabIndex:0,children:m?/* @__PURE__ */e("code",{translate:"no",className:"markstream-pre__diff-code",children:p.map(t=>/* @__PURE__ */e("span",{className:["markstream-pre__diff-pane",t.className].join(" "),children:t.lines.map(t=>/* @__PURE__ */n("span",{className:["markstream-pre__diff-line",`markstream-pre__diff-line--${t.kind}`,t.empty?"markstream-pre__diff-line--empty":""].filter(Boolean).join(" "),children:[
|
|
5
|
+
/* @__PURE__ */e("span",{className:"markstream-pre__diff-rail","aria-hidden":"true"}),
|
|
6
|
+
/* @__PURE__ */e("span",{className:"markstream-pre__diff-number","aria-hidden":"true",children:t.number}),
|
|
7
|
+
/* @__PURE__ */e("span",{className:"markstream-pre__diff-content",children:/* @__PURE__ */e("span",{className:"markstream-pre__diff-content-inner",children:t.code})})]},t.key))},t.key))}):/* @__PURE__ */n(t,{children:[s&&/* @__PURE__ */e("span",{className:"markstream-pre__line-numbers","aria-hidden":"true",children:/* @__PURE__ */e("span",{className:"markstream-pre__line-numbers-text",children:g})}),
|
|
8
|
+
/* @__PURE__ */e("code",{translate:"no",className:"markstream-pre__code",children:v})]})})}function ue(e){return e.startsWith("--")?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function de(e){const t={...e};if(Object.prototype.hasOwnProperty.call(t,"class")&&(t.className=t.class,delete t.class),Object.prototype.hasOwnProperty.call(t,"for")&&(t.htmlFor=t.for,delete t.for),"string"==typeof t.style){const e=function(e){const t=e.trim();if(!t)return;const n={};for(const a of t.split(";")){const e=a.trim();if(!e)continue;const t=e.indexOf(":");if(-1===t)continue;const r=ue(e.slice(0,t).trim()),l=e.slice(t+1).trim();r&&(n[r]=l)}return Object.keys(n).length?n:void 0}(t.style);e?t.style=e:delete t.style}return t}const me=s,pe=u;function ve(e,t){return d(e,t)}function fe(e,t){return o(e,t)}function ge(e,t,n=!1){const a=Object.entries(null!=t?t:{}),r=a.length>0?a.map(([e,t])=>""===t?` ${e}`:` ${e}="${t}"`).join(""):"";return n?`<${e}${r} />`:`<${e}${r}>`}function we(e,t){Array.isArray(t)?e.push(...t):null!=t&&e.push(t)}function xe(e,t){var n,a;return(null==(n=t.nodeComponents)?void 0:n[e])||(null==(a=t.nodeComponents)?void 0:a[e.toLowerCase()])}function ke(e){if(null==e||"boolean"==typeof e)return"";if("string"==typeof e||"number"==typeof e)return String(e);if(Array.isArray(e))return e.map(ke).join("");if(!a.isValidElement(e))return"";const t=e;if("string"!=typeof t.type)return ke(t.props.children);const n=Object.entries(t.props).filter(([e,t])=>"children"!==e&&"key"!==e&&"ref"!==e&&null!=t&&"boolean"!=typeof t).map(([e,t])=>` ${"className"===e?"class":e}="${String(t)}"`).join("");return`<${t.type}${n}>${ke(t.props.children)}</${t.type}>`}function ye(e){return Object.entries(e).map(([e,t])=>[e,""===t?null:t])}function be(e){var t,n;const a=e.sourceNode,r=!0!==(null==(t=e.ctx)?void 0:t.final)&&(!1===(null==(n=e.ctx)?void 0:n.final)||Boolean(null==a?void 0:a.loading));return{loading:r,autoClosed:r||Boolean(null==a?void 0:a.autoClosed)}}function Ne(e,t,n){return function(e,t){var n,a;return Boolean((null==(n=t.propComponents)?void 0:n[e])||(null==(a=t.propComponents)?void 0:a[e.toLowerCase()]))}(e,n)?m(t):t}function Ce(e,t,n,r,o,s,i,c=be(o)){const h=l(e),u=null!=s?s:function(e){return e.map(ke).join("")}(n),d={type:h,tag:h,attrs:ye(t),content:u,raw:null!=i?i:`${ge(e,t)}${u}</${e}>`,loading:c.loading,autoClosed:c.autoClosed};if(o.ctx&&o.renderNode)return o.renderNode(d,r,o.ctx);const m=xe(e,o);return m?a.createElement(m,{key:r,node:d}):null}function Me(e,t,n="safe",r={}){var l,o,s;if(!e)return[];if("escape"===n)return[e];try{const u=me(e);let d=0;const m=null!=(l=r.keyPrefix)?l:"ms-html",p=[],v=[];for(const e of u){if("text"===e.type){if(p.length>0&&p[p.length-1].hardBlocked)continue;(p.length>0?p[p.length-1].children:v).push(null!=(o=e.content)?o:""),p.length>0&&p[p.length-1].sourceParts.push(null!=(s=e.content)?s:"");continue}if("self_closing"===e.type){const l=e.attrs||{},o=ge(e.tagName,l,!0),s=ve(e.tagName,t),u=Boolean(xe(e.tagName,r));if(i.has(e.tagName.toLowerCase())||!s&&!u&&c(e.tagName,n))continue;if(!s&&!u&&h(e.tagName,n)){(p.length>0?p[p.length-1].children:v).push(o),p.length>0&&p[p.length-1].sourceParts.push(o);continue}const f=pe(l,n,e.tagName),g=f.key,w=null!=g&&""!==g?g:`${m}-${d++}`,x=s?t[e.tagName]||t[e.tagName.toLowerCase()]:void 0,k=p.length>0?p[p.length-1].children:v;if(u)k.push(Ce(e.tagName,l,[],w,r,"",o,{loading:!1,autoClosed:!1}));else if(x){const t=Ne(e.tagName,f,r);k.push(a.createElement(x,{...t,key:w}))}else k.push(a.createElement(e.tagName,{...de(f),key:w,suppressHydrationWarning:!0}));p.length>0&&p[p.length-1].sourceParts.push(o);continue}if("tag_open"===e.type){const a=p.length>0&&p[p.length-1].hardBlocked,l=ve(e.tagName,t),o=Boolean(xe(e.tagName,r));p.push({tagName:e.tagName,children:[],attrs:e.attrs,sourceParts:[],customComponent:l||o,hardBlocked:a||i.has(e.tagName.toLowerCase())||!l&&!o&&c(e.tagName,n),softBlocked:!a&&!l&&!o&&h(e.tagName,n)});continue}const l=e.tagName.toLowerCase();let u=-1;for(let e=p.length-1;e>=0;e--)if(p[e].tagName.toLowerCase()===l){u=e;break}if(-1!==u)for(;p.length>u;){const e=p.pop();if(!e)continue;const o=e.sourceParts.join(""),s=`${ge(e.tagName,e.attrs)}${o}</${e.tagName}>`;let i;if(e.hardBlocked)i=null;else if(e.softBlocked)i=[ge(e.tagName,e.attrs),...e.children,`</${e.tagName}>`];else{const c=pe(e.attrs||{},n,e.tagName),h=c.key,u=null!=h&&""!==h?h:`${m}-${d++}`,p=e.customComponent?t[e.tagName]||t[e.tagName.toLowerCase()]:void 0;if(Boolean(xe(e.tagName,r))){const t=e.tagName.toLowerCase()===l?{loading:!1,autoClosed:!1}:be(r);i=Ce(e.tagName,e.attrs||{},e.children,u,r,o,s,t)}else i=p?a.createElement(p,{...Ne(e.tagName,c,r),key:u},...e.children):a.createElement(e.tagName,{...de(c),key:u,suppressHydrationWarning:!0},...e.children)}p.length>0?we(p[p.length-1].children,i):we(v,i),p.length>0&&!e.hardBlocked&&p[p.length-1].sourceParts.push(s)}}for(;p.length>0;){const e=p.pop();if(!e||e.hardBlocked)continue;const l=e.sourceParts.join(""),o=`${ge(e.tagName,e.attrs)}${l}`;if(e.softBlocked){we(v,[ge(e.tagName,e.attrs),...e.children,`</${e.tagName}>`]),p.length>0&&p[p.length-1].sourceParts.push(o);continue}const s=pe(e.attrs||{},n,e.tagName),i=s.key,c=null!=i&&""!==i?i:`${m}-${d++}`,h=e.customComponent?t[e.tagName]||t[e.tagName.toLowerCase()]:void 0;let u;u=Boolean(xe(e.tagName,r))?Ce(e.tagName,e.attrs||{},e.children,c,r,l,o,be(r)):h?a.createElement(h,{...Ne(e.tagName,s,r),key:c},...e.children):a.createElement(e.tagName,{...de(s),key:c,suppressHydrationWarning:!0},...e.children),v.push(u),p.length>0&&p[p.length-1].sourceParts.push(o)}return v}catch{return null}}function $e(e){const t="number"==typeof e?e:Number.parseFloat(String(null!=e?e:""));return Number.isFinite(t)&&t>0?t:null}function _e(e){const t=e.split(/\r?\n/).filter(e=>/^\s*-\s+/.test(e)).length;return t>=3?500:t>0?280+60*t:360}function He(e,t=360,n=500){return null==n?Math.max(t,e):Math.min(Math.max(t,e),n)}function ze(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}function Be(e){const t="number"==typeof e?e:Number.parseFloat(String(null!=e?e:""));return Number.isFinite(t)&&t>0?t:null}function Ae(e){const t=e.split(/\r?\n/).map(e=>e.trim()).filter(e=>e&&!e.startsWith("%%")),n=Math.max(1,t.length),a=function(e){var t;for(const n of e.split(/\r?\n/)){const e=n.trim();if(!e||e.startsWith("%%"))continue;const a=e.match(/^([A-Z][\w-]*)\b/i);return(null==(t=null==a?void 0:a[1])?void 0:t.toLowerCase())||""}return""}(e);return"gantt"===a?220+28*n:"sequencediagram"===a?180+26*n:"classdiagram"===a||"statediagram"===a||"erdiagram"===a?180+24*n:"flowchart"===a||"graph"===a?170+28*n:200+22*n}function je(e,t=360,n=500){return null==n?Math.max(t,e):Math.min(Math.max(t,e),n)}function Se(e,t,n){var a,r;const o=l(e.type),s=(null!=n?n:[]).map(e=>l(e)).filter(Boolean),i="html_inline"===o||"html_block"===o;if(!i&&!s.includes(o))return null;const c=i?l(e.tag)||p(e.content):l(e.tag)||o;if(!c)return null;const h=s.includes(c),u=null!=(r=null!=(a=t[c])?a:t[o])?r:null,d=h||i?u:null;return{tag:c,isWhitelisted:h,component:d,display:A(d)}}function Ve(e,t,n){var a;return"block"===(null==(a=Se(e,t,n))?void 0:a.display)}const Le=/* @__PURE__ */new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function Oe(e,t={}){var n;const a={},r=new Set(null!=(n=t.omit)?n:[]);if(!e||"object"!=typeof e)return a;const l=Object.getOwnPropertyDescriptors(e);for(const[o,s]of Object.entries(l))Le.has(o)||r.has(o)||s.enumerable&&"value"in s&&(a[o]=s.value);return a}export{ee as A,v as B,z as C,w as D,g as E,te as F,Se as G,G as H,pe as I,_ as J,K,M as L,J as M,f as N,me as O,he as P,O as Q,j as R,je as a,B as b,He as c,Y as d,V as e,S as f,_e as g,Ae as h,Oe as i,A as j,$ as k,H as l,X as m,fe as n,ve as o,k as p,Ve as q,Q as r,L as s,de as t,ze as u,D as v,Me as w,Be as x,$e as y,R as z};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{normalizeShikiLanguage as r}from"markstream-core";import l from"react";import{normalizeCustomHtmlTagName as o,NON_STRUCTURING_HTML_TAGS as i,isHtmlTagBlocked as a,sanitizeHtmlTokenAttrs as d,convertHtmlAttrsToProps as c,tokenAttrsToRecord as s,sanitizeImageSrc as u,sanitizeHtmlAttrs as m,shouldOpenLinkInNewTab as h,mergeCustomHtmlTags as p,getMarkdown as g,parseMarkdownToStructure as y,stripCustomHtmlWrapper as f,shouldRenderUnknownHtmlTagAsText as x}from"stream-markdown-parser";import{
|
|
1
|
+
import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{normalizeShikiLanguage as r}from"markstream-core";import l from"react";import{normalizeCustomHtmlTagName as o,NON_STRUCTURING_HTML_TAGS as i,isHtmlTagBlocked as a,sanitizeHtmlTokenAttrs as d,convertHtmlAttrsToProps as c,tokenAttrsToRecord as s,sanitizeImageSrc as u,sanitizeHtmlAttrs as m,shouldOpenLinkInNewTab as h,mergeCustomHtmlTags as p,getMarkdown as g,parseMarkdownToStructure as y,stripCustomHtmlWrapper as f,shouldRenderUnknownHtmlTagAsText as x}from"stream-markdown-parser";import{u as k,E as v,D as w,l as N,w as b,s as S,Q as $,B as K,q as _,P as B,N as T,G as C,t as P,v as I,i as A,x as D,a as H,h as E,y as M,c as L,g as W}from"./codeBlockExtraProps-B08PlQGP.js";let O,j=!1;function q(e,n,t){const r=k(e);if(!r)return null;if(globalThis.__MARKSTREAM_REACT_DISABLE_SYNC_KATEX__)return null;const l=function(){if(O)return O;if(j)return null;j=!0;try{const e=function(){try{const e=Reflect.get(globalThis,"process"),n="function"==typeof(null==e?void 0:e.getBuiltinModule)?e.getBuiltinModule("module"):null;return"function"==typeof(null==n?void 0:n.createRequire)?n.createRequire(import.meta.url):null}catch{return null}}();if(!e)return null;const n=e("katex");try{e("katex/contrib/mhchem")}catch{}return O=n,O}catch{return null}}();if(!l)return null;try{return l.renderToString(r,{displayMode:n,throwOnError:t})}catch{return null}}const R=g();function F(t,r,l){var o,i;const a=function(e){var n;return String(null!=(n=String(null!=e?e:"").split(/\s+/g)[0])?n:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}(r.language),d=String(null!=(i=null!=(o=r.code)?o:r.raw)?i:""),c=function(e){const n=I(String(null!=e?e:""));return n&&"plaintext"!==n?n.charAt(0).toUpperCase()+n.slice(1):"Text"}(r.language);/* @__PURE__ */
|
|
2
2
|
return e("div",{className:`${t} ${t}--ssr`,"data-ssr-fallback":l.fallback,children:[!1!==l.showHeader&&/* @__PURE__ */n("div",{className:`${t}__header`,children:/* @__PURE__ */n("span",{className:`${t}__language`,children:c})}),
|
|
3
|
-
/* @__PURE__ */n("div",{className:`${t}__body`,children:/* @__PURE__ */n("pre",{className:`language-${a}`,"aria-busy":!0===r.loading,"aria-label":`Code block: ${a}`,"data-language":a,tabIndex:0,children:/* @__PURE__ */n("code",{translate:"no",children:d})})})]})}function z(e,n,t,r,o={}){var i,a,d,c,s,u;const m=
|
|
4
|
-
return n("span",{className:"text-node whitespace-pre-wrap break-words"+(t.center?" text-node-center":""),children:null!=r?r:t.content})}function
|
|
5
|
-
return n("p",{dir:"auto",className:"paragraph-node",children:m});const h=null!=(r=d.children)?r:[],p={...null!=(o=c.customComponents)?o:
|
|
6
|
-
/* @__PURE__ */n("p",{dir:"auto",className:"paragraph-node",children:
|
|
7
|
-
/* @__PURE__ */n(l.Fragment,{children:s(e,`${String(null!=u?u:"paragraph")}-block-${t}`,c)},`${String(null!=u?u:"paragraph")}-block-${t}`))):y.push(e)}),f(),g.length?/* @__PURE__ */n(t,{children:g}):/* @__PURE__ */n("p",{dir:"auto",className:"paragraph-node",children:
|
|
8
|
-
return n(d,{dir:"auto",className:p,..."object"==typeof m&&null!=m?{style:m}:{},...h,children:null!=i?i:r&&l?v(t.children,r,String(null!=o?o:`heading-${a}`),l):null})}function
|
|
3
|
+
/* @__PURE__ */n("div",{className:`${t}__body`,children:/* @__PURE__ */n("pre",{className:`language-${a}`,"aria-busy":!0===r.loading,"aria-label":`Code block: ${a}`,"data-language":a,tabIndex:0,children:/* @__PURE__ */n("code",{translate:"no",children:d})})})]})}function z(e,n,t,r,o={}){var i,a,d,c,s,u;const m=A(r.codeBlockProps);return l.createElement(e,{key:t,node:n,loading:Boolean(n.loading),stream:r.codeBlockStream,customId:r.customId,isDark:r.isDark,darkTheme:null==(i=r.codeBlockThemes)?void 0:i.darkTheme,lightTheme:null==(a=r.codeBlockThemes)?void 0:a.lightTheme,themes:null==(d=r.codeBlockThemes)?void 0:d.themes,langs:null==(c=r.codeBlockThemes)?void 0:c.langs,minWidth:null==(s=r.codeBlockThemes)?void 0:s.minWidth,maxWidth:null==(u=r.codeBlockThemes)?void 0:u.maxWidth,onCopy:r.events.onCopy,...m,...o,ctx:r,renderNode:Ee,indexKey:t,typewriter:r.typewriter,fade:r.fade})}function U(e,n,t,r,o={}){return l.createElement(e,{key:t,node:n,isDark:r.isDark,...o})}function G(e){const{node:t,children:r}=e;/* @__PURE__ */
|
|
4
|
+
return n("span",{className:"text-node whitespace-pre-wrap break-words"+(t.center?" text-node-center":""),children:null!=r?r:t.content})}function Q(e){var n;return"text"===(null==e?void 0:e.type)&&""===String(null!=(n=null==e?void 0:e.content)?n:"").trim()}function V(e,t,r,o){const i=e.filter(e=>!Q(e)),a=i.length>0&&i.every(e=>"image"===e.type||function(e){var n;const t=function(e){return"link"===(null==e?void 0:e.type)&&Array.isArray(null==e?void 0:e.children)?e.children.filter(e=>!Q(e)):[]}(e);return 1===t.length&&"image"===(null==(n=t[0])?void 0:n.type)}(e));if(!a||i.length<=1)return v(e,r,o,t);const d=[];for(let n=0;n<e.length;n++){const t=e[n];if(!Q(t)){d.push(t);continue}const r=d.length>0,l=e.slice(n+1).some(e=>!Q(e));r&&l&&d.push({...t,content:" ",raw:" "})}return d.map((e,i)=>{var d;return a&&Q(e)?/* @__PURE__ */n(l.Fragment,{children:String(null!=(d=null==e?void 0:e.content)?d:"")},`${o}-${i}`):t(e,`${o}-${i}`,r)})}function X(e){var r,o,i,a;const{node:d,ctx:c,renderNode:s,indexKey:u,children:m}=e;if(!c||!s)/* @__PURE__ */
|
|
5
|
+
return n("p",{dir:"auto",className:"paragraph-node",children:m});const h=null!=(r=d.children)?r:[],p={...null!=(o=c.customComponents)?o:N(c.customId),...null!=(i=c.htmlComponents)?i:{},...null!=(a=c.streamingComponents)?a:{}},g=[],y=[],f=()=>{if(!y.length)return;const e=g.length;g.push(
|
|
6
|
+
/* @__PURE__ */n("p",{dir:"auto",className:"paragraph-node",children:V(y.slice(),s,c,`${String(null!=u?u:"paragraph")}-${e}`)},`${String(null!=u?u:"paragraph")}-inline-${e}`)),y.length=0};return h.forEach((e,t)=>{var r;const o="escape"!==(null!=(r=c.htmlPolicy)?r:"safe")||"html_inline"!==e.type&&"html_block"!==e.type;K.has(e.type)||o&&_(e,p,c.customHtmlTags)?(f(),g.push(
|
|
7
|
+
/* @__PURE__ */n(l.Fragment,{children:s(e,`${String(null!=u?u:"paragraph")}-block-${t}`,c)},`${String(null!=u?u:"paragraph")}-block-${t}`))):y.push(e)}),f(),g.length?/* @__PURE__ */n(t,{children:g}):/* @__PURE__ */n("p",{dir:"auto",className:"paragraph-node",children:V(h,s,c,String(null!=u?u:"paragraph"))})}function Y(e){const{node:t,ctx:r,renderNode:l,indexKey:o,children:i}=e,a=Math.min(6,Math.max(1,Number(t.level)||1)),d=`h${a}`,c=null==t?void 0:t.attrs,{class:s,className:u,style:m,...h}=null!=c?c:{},p=["heading-node","font-semibold",`heading-${a}`,s,u].filter(Boolean).join(" ");/* @__PURE__ */
|
|
8
|
+
return n(d,{dir:"auto",className:p,..."object"==typeof m&&null!=m?{style:m}:{},...h,children:null!=i?i:r&&l?v(t.children,r,String(null!=o?o:`heading-${a}`),l):null})}function J(e){const{node:t,ctx:r,renderNode:l,indexKey:o,children:i}=e;/* @__PURE__ */
|
|
9
9
|
return n("blockquote",{className:"blockquote-node",dir:"auto",cite:t.cite,children:null!=i?i:r&&l?v(t.children,r,String(null!=o?o:"blockquote"),l):null})}function Z(e){const{node:t,ctx:r,renderNode:l,value:o,indexKey:i,children:a}=e;/* @__PURE__ */
|
|
10
|
-
return n("li",{className:"list-item pl-1.5 my-2",dir:"auto",value:null==o?void 0:o,children:null!=a?a:r&&l?v(t.children,r,String(null!=i?i:"list-item"),l):null})}function ee(e){var t;const{node:r,ctx:l,renderNode:o,indexKey:i}=e,a=r.ordered?"ol":"ul",d=r.ordered&&r.start?r.start:void 0,c=l&&
|
|
10
|
+
return n("li",{className:"list-item pl-1.5 my-2",dir:"auto",value:null==o?void 0:o,children:null!=a?a:r&&l?v(t.children,r,String(null!=i?i:"list-item"),l):null})}function ee(e){var t;const{node:r,ctx:l,renderNode:o,indexKey:i}=e,a=r.ordered?"ol":"ul",d=r.ordered&&r.start?r.start:void 0,c=l&&N(l.customId).list_item||Z;/* @__PURE__ */
|
|
11
11
|
return n(a,{className:r.ordered?"list-node my-5 pl-[calc(13/8*1em)] list-decimal":"list-node my-5 pl-[calc(13/8*1em)] list-disc max-lg:my-[calc(4/3*1em)] max-lg:pl-[calc(14/9*1em)]",start:d,children:null==(t=r.items)?void 0:t.map((e,t)=>{var a;/* @__PURE__ */
|
|
12
12
|
return n(c,{node:e,value:r.ordered?(null!=(a=r.start)?a:1)+t:void 0,ctx:l,renderNode:o,indexKey:`${String(null!=i?i:"list")}-${t}`,customId:null==l?void 0:l.customId,isDark:null==l?void 0:l.isDark,typewriter:null==l?void 0:l.typewriter},`${String(null!=i?i:"list")}-${t}`)})})}function ne(t){var r;const{node:l,ctx:o,renderNode:i,indexKey:a}=t,d=Array.isArray(null==(r=null==l?void 0:l.header)?void 0:r.cells)?l.header.cells:[],c=Boolean(null==l?void 0:l.loading),s=Array.isArray(null==l?void 0:l.rows)?l.rows:[],u=e=>"right"===e?"text-right":"center"===e?"text-center":"text-left";/* @__PURE__ */
|
|
13
13
|
return e("div",{className:"table-node-wrapper","data-index-key":a,children:[
|
|
@@ -37,49 +37,49 @@ return n("sub",{className:"subscript-node",children:null!=r?r:l&&o?v(t.children,
|
|
|
37
37
|
return n("sup",{className:"superscript-node",children:null!=r?r:l&&o?v(t.children,l,`${String(null!=i?i:"superscript")}-superscript`,o):null})}function ye(e){/* @__PURE__ */
|
|
38
38
|
return n("br",{})}function fe(e){/* @__PURE__ */
|
|
39
39
|
return n("hr",{className:"thematic-break-node"})}function xe(e){const{node:t,children:r}=e;/* @__PURE__ */
|
|
40
|
-
return n("code",{className:"inline-code inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full",children:null!=r?r:t.code})}function ke(t){var r,l,o,i,a,d,c,s,u;const{node:p,ctx:g,renderNode:y,indexKey:f}=t,x=void 0!==t.underlineBottom?"number"==typeof t.underlineBottom?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",k=null!=(r=t.animationOpacity)?r:.35,w=Math.max(.12,Math.min(.5*k,k)),
|
|
40
|
+
return n("code",{className:"inline-code inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full",children:null!=r?r:t.code})}function ke(t){var r,l,o,i,a,d,c,s,u;const{node:p,ctx:g,renderNode:y,indexKey:f}=t,x=void 0!==t.underlineBottom?"number"==typeof t.underlineBottom?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",k=null!=(r=t.animationOpacity)?r:.35,w=Math.max(.12,Math.min(.5*k,k)),N={"--link-color":null!=(l=t.color)?l:"#0366d6","--underline-height":`${null!=(o=t.underlineHeight)?o:2}px`,"--underline-bottom":x,"--underline-opacity":String(k),"--underline-rest-opacity":String(w),"--underline-duration":`${null!=(i=t.animationDuration)?i:1.6}s`,"--underline-timing":null!=(a=t.animationTiming)?a:"ease-in-out","--underline-iteration":"number"==typeof t.animationIteration?String(t.animationIteration):null!=(d=t.animationIteration)?d:"infinite"},b=m({href:String(null!=(c=p.href)?c:"")}).href,S="string"==typeof p.title&&p.title.trim().length>0?p.title:String(null!=b?b:""),$=h(b);return p.loading?/* @__PURE__ */n("span",{className:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":"false",style:N,children:/* @__PURE__ */e("span",{className:"link-text-wrapper relative inline-flex",children:[
|
|
41
41
|
/* @__PURE__ */n("span",{className:"leading-[normal] link-text",children:/* @__PURE__ */n(G,{node:{type:"text",content:String(null!=(s=p.text)?s:"")},ctx:g,indexKey:`${String(null!=f?f:"link")}-loading`,typewriter:t.typewriter})}),
|
|
42
|
-
/* @__PURE__ */n("span",{className:"link-loading-indicator","aria-hidden":"true"})]})}):/* @__PURE__ */n("a",{className:"link-node",href:
|
|
43
|
-
return n(
|
|
44
|
-
return n("div",o?{className:"math-block text-center overflow-x-auto relative min-h-[40px]",children:/* @__PURE__ */n("div",{dangerouslySetInnerHTML:{__html:o}})}:{className:"math-block text-center overflow-x-auto relative min-h-[40px]",children:/* @__PURE__ */n("div",{children:String(null!=(l=null!=(r=e.raw)?r:e.content)?l:"")})})}function Be({node:e}){var t,r,l;const o="$$"===e.markup,i=
|
|
45
|
-
return n("span",i?{className:"math-inline-wrapper",children:/* @__PURE__ */n("span",{className:"math-inline",dangerouslySetInnerHTML:{__html:i}})}:{className:"math-inline-wrapper",children:/* @__PURE__ */n("span",{className:"math-inline",children:String(null!=(l=null!=(r=e.raw)?r:e.content)?l:"")})})}function
|
|
46
|
-
return n("span",{className:"reference-node cursor-pointer bg-[hsl(var(--muted))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))]",role:"button",tabIndex:0,"data-reference-id":t.id,children:t.id})}function
|
|
47
|
-
return n(t,null==G?{children:String(null!=(j=e.node.content)?j:"")}:{children:G})}function Pe(e){var r,i,u,m,h,p,g,y,f,x,k,w,$,
|
|
48
|
-
return n(t,null==
|
|
42
|
+
/* @__PURE__ */n("span",{className:"link-loading-indicator","aria-hidden":"true"})]})}):/* @__PURE__ */n("a",{className:"link-node",href:b||void 0,title:S,"aria-label":`Link: ${S}`,target:$?"_blank":void 0,rel:$?"noopener noreferrer":void 0,style:N,children:g&&y?v(p.children,g,String(null!=f?f:"link"),y):/* @__PURE__ */n(G,{node:{type:"text",content:String(null!=(u=p.text)?u:"")},ctx:g,indexKey:`${String(null!=f?f:"link")}-fallback`,typewriter:t.typewriter})})}function ve(e){var t,r,l,o,i;const a=e,d=u(a.node.src)||u(a.fallbackSrc);return d?/* @__PURE__ */n("img",{src:d,alt:String(null!=(r=null!=(t=a.node.alt)?t:a.node.title)?r:""),title:String(null!=(o=null!=(l=a.node.title)?l:a.node.alt)?o:""),className:"image-node__img is-loaded",loading:!1===a.lazy?"eager":"lazy",decoding:"async",tabIndex:0,"aria-label":null!=(i=a.node.alt)?i:"Preview image"}):null}function we(e){/* @__PURE__ */
|
|
43
|
+
return n(B,{...e})}function Ne(e){return F("code-block-node",e.node,{showHeader:e.showHeader,fallback:"code-block"})}function be(e){return F("markdown-code-block-node",e.node,{showHeader:e.showHeader,fallback:"markdown-code-block"})}function Se(e){return F("mermaid-block-node",e.node,{showHeader:e.showHeader,fallback:"mermaid"})}function $e(e){return F("d2-block-node",e.node,{showHeader:e.showHeader,fallback:"d2"})}function Ke(e){return F("infographic-block-node",e.node,{showHeader:e.showHeader,fallback:"infographic"})}function _e({node:e}){var t,r,l;const o=q(String(null!=(t=e.content)?t:""),!0,Boolean(e.loading));/* @__PURE__ */
|
|
44
|
+
return n("div",o?{className:"math-block text-center overflow-x-auto relative min-h-[40px]",children:/* @__PURE__ */n("div",{dangerouslySetInnerHTML:{__html:o}})}:{className:"math-block text-center overflow-x-auto relative min-h-[40px]",children:/* @__PURE__ */n("div",{children:String(null!=(l=null!=(r=e.raw)?r:e.content)?l:"")})})}function Be({node:e}){var t,r,l;const o="$$"===e.markup,i=q(String(null!=(t=e.content)?t:""),o,Boolean(e.loading));/* @__PURE__ */
|
|
45
|
+
return n("span",i?{className:"math-inline-wrapper",children:/* @__PURE__ */n("span",{className:"math-inline",dangerouslySetInnerHTML:{__html:i}})}:{className:"math-inline-wrapper",children:/* @__PURE__ */n("span",{className:"math-inline",children:String(null!=(l=null!=(r=e.raw)?r:e.content)?l:"")})})}function Te(e){const{node:t}=e;/* @__PURE__ */
|
|
46
|
+
return n("span",{className:"reference-node cursor-pointer bg-[hsl(var(--muted))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))]",role:"button",tabIndex:0,"data-reference-id":t.id,children:t.id})}function Ce(e){var r,u,m,h,p,g,y,f,x,k,w,S,$,K,_,B,C,I,A,D,H,E,M,L,W,O,j;const q=String(null!=(u=null==(r=e.node)?void 0:r.tag)?u:"").trim().toLowerCase(),R=o(q),F=Array.isArray(null==(m=e.node)?void 0:m.children)?e.node.children:[],z=R?null==(p=null==(h=e.ctx)?void 0:h.htmlComponents)?void 0:p[R]:void 0;if(F.length>0&&q&&!i.has(q)&&!a(q,null!=(y=null==(g=e.ctx)?void 0:g.htmlPolicy)?y:"safe")&&e.ctx&&e.renderNode){const n=v(F,e.ctx,`${String(null!=(f=e.indexKey)?f:"html-block")}-structured`,e.renderNode);if(z){const t=d(null!=(k=null==(x=e.node)?void 0:x.attrs)?k:null,null!=(S=null==(w=e.ctx)?void 0:w.htmlPolicy)?S:"safe",R);return l.createElement(z,c(s(t)),n)}return l.createElement(q,function(e,n="safe",t){const r={...P(T(d(null!=e?e:void 0,n,t))||{})},l="string"==typeof r.className?r.className.trim():"";return r.className=l?`html-block-node ${l}`:"html-block-node",r}(null!=(K=null==($=e.node)?void 0:$.attrs)?K:null,null!=(B=null==(_=e.ctx)?void 0:_.htmlPolicy)?B:"safe",q),n)}const U={...null!=(I=null==(C=e.ctx)?void 0:C.customComponents)?I:N(e.customId),...null!=(D=null==(A=e.ctx)?void 0:A.htmlComponents)?D:{}},G=b(String(null!=(H=e.node.content)?H:""),U,null!=(M=null==(E=e.ctx)?void 0:E.htmlPolicy)?M:"safe",{ctx:e.ctx,keyPrefix:String(null!=(L=e.indexKey)?L:"html-block"),nodeComponents:null==(W=e.ctx)?void 0:W.streamingComponents,propComponents:null==(O=e.ctx)?void 0:O.htmlComponents,renderNode:e.renderNode,sourceNode:e.node});/* @__PURE__ */
|
|
47
|
+
return n(t,null==G?{children:String(null!=(j=e.node.content)?j:"")}:{children:G})}function Pe(e){var r,i,u,m,h,p,g,y,f,x,k,w,S,$,K,_,B,T,C;const P=null!=(i=null==(r=e.ctx)?void 0:r.htmlPolicy)?i:"safe",I=String(null!=(m=null==(u=e.node)?void 0:u.tag)?m:"").trim().toLowerCase(),A=o(I),D=Array.isArray(null==(h=e.node)?void 0:h.children)?e.node.children:[],H=A?null==(g=null==(p=e.ctx)?void 0:p.htmlComponents)?void 0:g[A]:void 0;if(D.length>0&&I&&"escape"!==P&&!a(I,P)&&e.ctx&&e.renderNode&&H){const n=v(D,e.ctx,`${String(null!=(y=e.indexKey)?y:"html-inline")}-structured`,e.renderNode),t=d(null!=(x=null==(f=e.node)?void 0:f.attrs)?x:null,P,A);return l.createElement(H,c(s(t)),n)}const E={...null!=(w=null==(k=e.ctx)?void 0:k.customComponents)?w:N(e.customId),...null!=($=null==(S=e.ctx)?void 0:S.htmlComponents)?$:{}},M=b(String(null!=(K=e.node.content)?K:""),E,P,{ctx:e.ctx,keyPrefix:String(null!=(_=e.indexKey)?_:"html-inline"),nodeComponents:null==(B=e.ctx)?void 0:B.streamingComponents,propComponents:null==(T=e.ctx)?void 0:T.htmlComponents,renderNode:e.renderNode,sourceNode:e.node});/* @__PURE__ */
|
|
48
|
+
return n(t,null==M?{children:String(null!=(C=e.node.content)?C:"")}:{children:M})}function Ie(e){const{node:t,ctx:r,renderNode:o,indexKey:i}=e,a=t.attrs?Array.isArray(t.attrs)?T(t.attrs):t.attrs:void 0;/* @__PURE__ */
|
|
49
49
|
return n("div",{className:`vmr-container vmr-container-${t.name}`,...a,children:r&&o&&Array.isArray(t.children)?t.children.map((e,t)=>/* @__PURE__ */n(l.Fragment,{children:o(e,`${String(null!=i?i:"vmr-container")}-${t}`,r)},`${String(null!=i?i:"vmr-container")}-${t}`)):null})}function Ae(e){return null}function De(e){return null}function He(n){const{node:t}=n;/* @__PURE__ */
|
|
50
|
-
return e("div",{className:"unknown-node text-sm text-gray-500 italic",children:["Unsupported node type:"," ",String(null==t?void 0:t.type)]})}function
|
|
50
|
+
return e("div",{className:"unknown-node text-sm text-gray-500 italic",children:["Unsupported node type:"," ",String(null==t?void 0:t.type)]})}function Ee(e,t,i){var a,u,m,h,p,g,y,k,w;const b=null!=(a=i.customComponents)?a:N(i.customId),S=null!=(u=i.streamingComponents)?u:{},$=null!=(m=i.htmlComponents)?m:{},K=function(e){if("html_block"===e.type||"html_inline"===e.type)return"";const n=o(e.type),t=o(e.tag);return n&&t&&n===t?n:""}(e),_=K?S[K]:null,B=K&&!_?$[K]:null,T="code_block"===e.type?null:b[e.type];if(_)return l.createElement(_,{key:t,node:e,customId:i.customId,isDark:i.isDark,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter,fade:i.fade});if(B)return function(e,n,t,r,o){var i,a,u;const m=d(null!=(i=n.attrs)?i:void 0,null!=(a=r.htmlPolicy)?a:"safe",o),h=c(s(m)),p=Array.isArray(n.children)?v(n.children,r,`${String(t)}-html`,Ee):null!=(u=n.content)?u:null;return l.createElement(e,{...h,key:t},p)}(B,e,t,i,K);if(T)return l.createElement(T,{key:t,node:e,customId:i.customId,isDark:i.isDark,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter,fade:i.fade});if("html_block"===e.type||"html_inline"===e.type){const r={...b,...S},o=C(e,r,i.customHtmlTags),a=null!=(h=null==o?void 0:o.tag)?h:"",d=null!=(p=null==o?void 0:o.isWhitelisted)&&p,c=null!=(g=null==o?void 0:o.component)?g:null;if(d&&c){const n={...e,type:a,tag:a,content:f(e.content,a)};return l.createElement(c,{key:t,node:n,customId:i.customId,isDark:i.isDark,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter,fade:i.fade})}const s=String(null!=(k=null!=(y=e.content)?y:e.raw)?k:"");if(!d&&x(s,a))return"html_inline"===e.type?/* @__PURE__ */n(G,{node:{type:"text",content:s,raw:s},ctx:i,indexKey:t,typewriter:i.typewriter},t):/* @__PURE__ */n(X,{node:{type:"paragraph",children:[{type:"text",content:s,raw:s}],raw:s},ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter},t)}switch(e.type){case"text":/* @__PURE__ */
|
|
51
51
|
return n(G,{node:e,ctx:i,indexKey:t,typewriter:i.typewriter},t);case"text_special":/* @__PURE__ */
|
|
52
52
|
return n(G,{node:{type:"text",content:null!=(w=e.content)?w:"",center:e.center},ctx:i,indexKey:t,typewriter:i.typewriter},t);case"paragraph":/* @__PURE__ */
|
|
53
|
-
return n(
|
|
54
|
-
return n(
|
|
55
|
-
return n(
|
|
56
|
-
return n(ee,{node:e,ctx:i,renderNode:
|
|
57
|
-
return n(Z,{node:e,ctx:i,renderNode:
|
|
58
|
-
return n(ne,{node:e,ctx:i,renderNode:
|
|
59
|
-
return n(te,{node:e,ctx:i,renderNode:
|
|
60
|
-
return n(re,{node:e,ctx:i,renderNode:
|
|
53
|
+
return n(X,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter},t);case"heading":/* @__PURE__ */
|
|
54
|
+
return n(Y,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter},t);case"blockquote":/* @__PURE__ */
|
|
55
|
+
return n(J,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter},t);case"list":/* @__PURE__ */
|
|
56
|
+
return n(ee,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter},t);case"list_item":/* @__PURE__ */
|
|
57
|
+
return n(Z,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter},t);case"table":/* @__PURE__ */
|
|
58
|
+
return n(ne,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter},t);case"definition_list":/* @__PURE__ */
|
|
59
|
+
return n(te,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter},t);case"footnote":/* @__PURE__ */
|
|
60
|
+
return n(re,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter},t);case"footnote_reference":/* @__PURE__ */
|
|
61
61
|
return n(le,{node:e},t);case"footnote_anchor":/* @__PURE__ */
|
|
62
62
|
return n(oe,{node:e},t);case"admonition":/* @__PURE__ */
|
|
63
|
-
return n(ie,{node:e,ctx:i,renderNode:
|
|
63
|
+
return n(ie,{node:e,ctx:i,renderNode:Ee,indexKey:t,isDark:i.isDark,typewriter:i.typewriter},t);case"hardbreak":/* @__PURE__ */
|
|
64
64
|
return n(ye,{node:e,typewriter:i.typewriter},t);case"link":/* @__PURE__ */
|
|
65
|
-
return n(ke,{node:e,ctx:i,renderNode:
|
|
65
|
+
return n(ke,{node:e,ctx:i,renderNode:Ee,indexKey:t,isDark:i.isDark,showTooltip:"boolean"==typeof i.showTooltips?i.showTooltips:void 0,typewriter:i.typewriter},t);case"image":/* @__PURE__ */
|
|
66
66
|
return n(ve,{node:e},t);case"inline_code":/* @__PURE__ */
|
|
67
|
-
return n(xe,{node:e,ctx:i,indexKey:t,typewriter:i.typewriter},t);case"code_block":return function(e,t,l,o){var i,a,d,c,s;const
|
|
68
|
-
return n(ce,{node:e,children:v(e.children,i,`${String(t)}-strong`,
|
|
69
|
-
return n(se,{node:e,children:v(e.children,i,`${String(t)}-em`,
|
|
70
|
-
return n(ue,{node:e,children:v(e.children,i,`${String(t)}-strike`,
|
|
71
|
-
return n(me,{node:e,children:v(e.children,i,`${String(t)}-highlight`,
|
|
72
|
-
return n(he,{node:e,children:v(e.children,i,`${String(t)}-insert`,
|
|
73
|
-
return n(pe,{node:e,children:v(e.children,i,`${String(t)}-sub`,
|
|
74
|
-
return n(ge,{node:e,children:v(e.children,i,`${String(t)}-sup`,
|
|
67
|
+
return n(xe,{node:e,ctx:i,indexKey:t,typewriter:i.typewriter},t);case"code_block":return function(e,t,l,o){var i,a,d,c,s,u,m;const h=String((null==e?void 0:e.language)||"").trim(),p=h?String(null!=(i=h.split(/\s+/)[0])?i:"").split(":")[0].toLowerCase():"",g=I(p),y=function(e,n){const t=n.trim().toLowerCase();if(!t)return null;for(const l of[t,I(t),r(t)]){const n=l&&e[l];if(n)return n}return null}(o,p);if("mermaid"===g){const r=function(e,n){var t,r;const l={...n.mermaidProps||{}};return null==D(l.estimatedPreviewHeightPx)&&(l.estimatedPreviewHeightPx=H(E(String(null!=(t=null==e?void 0:e.code)?t:"")),void 0,"none"===l.maxHeight?null:null!=(r=D(l.maxHeight))?r:void 0)),l}(e,l),i=y||o.mermaid;return i?U(i,e,t,l,r):/* @__PURE__ */n(Se,{node:e,isDark:l.isDark,loading:Boolean(e.loading),...r},t)}if("infographic"===g){const r=function(e,n){var t,r;const l={...n.infographicProps||{}};return null==M(l.estimatedPreviewHeightPx)&&(l.estimatedPreviewHeightPx=L(W(String(null!=(t=null==e?void 0:e.code)?t:"")),void 0,"none"===l.maxHeight?null:null!=(r=M(l.maxHeight))?r:void 0)),l}(e,l),i=y||o.infographic;return i?U(i,e,t,l,r):/* @__PURE__ */n(Ke,{node:e,isDark:l.isDark,loading:Boolean(e.loading),...r},t)}if("d2"===g||"d2lang"===g){const r=y||o.d2;return r?U(r,e,t,l,l.d2Props||{}):/* @__PURE__ */n($e,{node:e,isDark:l.isDark,loading:Boolean(e.loading),...l.d2Props||{}},t)}if(y)return z(y,e,t,l);const f=o.code_block;return f?z(f,e,t,l):l.renderCodeBlocksAsPre?/* @__PURE__ */n(we,{node:e,monacoOptions:null==(a=l.codeBlockThemes)?void 0:a.monacoOptions,showLineNumbers:!0===(null==(d=l.codeBlockProps)?void 0:d.showLineNumbers)},t):/* @__PURE__ */n(Ne,{node:e,loading:Boolean(e.loading),stream:l.codeBlockStream,monacoOptions:null==(c=l.codeBlockThemes)?void 0:c.monacoOptions,themes:null==(s=l.codeBlockThemes)?void 0:s.themes,minWidth:null==(u=l.codeBlockThemes)?void 0:u.minWidth,maxWidth:null==(m=l.codeBlockThemes)?void 0:m.maxWidth,isDark:l.isDark,...A(l.codeBlockProps,{omit:["langs"]})},t)}(e,t,i,b);case"strong":/* @__PURE__ */
|
|
68
|
+
return n(ce,{node:e,children:v(e.children,i,`${String(t)}-strong`,Ee)},t);case"emphasis":/* @__PURE__ */
|
|
69
|
+
return n(se,{node:e,children:v(e.children,i,`${String(t)}-em`,Ee)},t);case"strikethrough":/* @__PURE__ */
|
|
70
|
+
return n(ue,{node:e,children:v(e.children,i,`${String(t)}-strike`,Ee)},t);case"highlight":/* @__PURE__ */
|
|
71
|
+
return n(me,{node:e,children:v(e.children,i,`${String(t)}-highlight`,Ee)},t);case"insert":/* @__PURE__ */
|
|
72
|
+
return n(he,{node:e,children:v(e.children,i,`${String(t)}-insert`,Ee)},t);case"subscript":/* @__PURE__ */
|
|
73
|
+
return n(pe,{node:e,children:v(e.children,i,`${String(t)}-sub`,Ee)},t);case"superscript":/* @__PURE__ */
|
|
74
|
+
return n(ge,{node:e,children:v(e.children,i,`${String(t)}-sup`,Ee)},t);case"checkbox":case"checkbox_input":/* @__PURE__ */
|
|
75
75
|
return n(ae,{node:e,typewriter:i.typewriter},t);case"emoji":/* @__PURE__ */
|
|
76
76
|
return n(de,{node:e,typewriter:i.typewriter},t);case"thematic_break":/* @__PURE__ */
|
|
77
77
|
return n(fe,{node:e},t);case"math_inline":/* @__PURE__ */
|
|
78
78
|
return n(Be,{node:e},t);case"math_block":/* @__PURE__ */
|
|
79
79
|
return n(_e,{node:e},t);case"reference":/* @__PURE__ */
|
|
80
|
-
return n(
|
|
81
|
-
return n(
|
|
82
|
-
return n(Pe,{node:e,ctx:i,renderNode:
|
|
83
|
-
return n(Ie,{node:e,ctx:i,renderNode:
|
|
84
|
-
return n(He,{node:e},t)}}function
|
|
85
|
-
return n("div",{className:"markstream-react markdown-renderer"+(e.isDark?" dark":""),"data-custom-id":e.customId,children:k.map((e,t)=>/* @__PURE__ */n("div",{className:"node-slot","data-node-index":t,"data-node-type":e.type,children:/* @__PURE__ */n("div",{className:"node-content",children:
|
|
80
|
+
return n(Te,{node:e,ctx:i,typewriter:i.typewriter},t);case"html_block":/* @__PURE__ */
|
|
81
|
+
return n(Ce,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter,fade:i.fade,customId:i.customId},t);case"html_inline":/* @__PURE__ */
|
|
82
|
+
return n(Pe,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter,fade:i.fade,customId:i.customId},t);case"vmr_container":/* @__PURE__ */
|
|
83
|
+
return n(Ie,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter},t);case"label_open":case"label_close":return null;default:/* @__PURE__ */
|
|
84
|
+
return n(He,{node:e},t)}}function Me(e){var t,r,l;const o=N(e.customId),i=S(e.streamingComponents),a=S(e.htmlComponents);$(i,a,/* @__PURE__ */new Set);const d=null!=(t=e.parseOptions)?t:{},c=null!=(r=d.customHtmlTags)?r:[],s=p(e.customHtmlTags,Array.isArray(c)?c:[],Object.keys(i)),u=e.customId?`server-renderer-${e.customId}`:"server-renderer",m=s.length>0?g(u,{customHtmlTags:s}):g(u),h=e.customMarkdownIt?e.customMarkdownIt(m):m,f=null!=(l=e.final)?l:d.final,x=null==f&&0===s.length?d:{...d,...null!=f?{final:f}:{},...s.length>0?{customHtmlTags:s}:{}},k=Array.isArray(e.nodes)&&e.nodes.length?e.nodes.map(e=>({...e})):e.content?y(e.content,null!=h?h:R,x):[],v=null!=e.indexKey?String(e.indexKey):"markdown-renderer",w=function(e,n,t,r,l,o,i){var a;return{customId:e.customId,final:i,customComponents:n,customHtmlTags:o,htmlPolicy:null!=(a=e.htmlPolicy)?a:"safe",isDark:e.isDark,indexKey:l,typewriter:e.typewriter,fade:e.fade,showTooltips:e.showTooltips,streamingComponents:t,htmlComponents:r,renderCodeBlocksAsPre:e.renderCodeBlocksAsPre,codeBlockStream:e.codeBlockStream,codeBlockProps:{..."boolean"==typeof e.showTooltips?{showTooltips:e.showTooltips}:{},...e.codeBlockProps||{}},mermaidProps:{...e.mermaidProps||{}},d2Props:{...e.d2Props||{}},infographicProps:{...e.infographicProps||{}},codeBlockThemes:{themes:e.themes,langs:e.langs,darkTheme:e.codeBlockDarkTheme,lightTheme:e.codeBlockLightTheme,monacoOptions:e.codeBlockMonacoOptions,minWidth:e.codeBlockMinWidth,maxWidth:e.codeBlockMaxWidth},events:{onCopy:e.onCopy,onHandleArtifactClick:e.onHandleArtifactClick}}}(e,o,i,a,v,s,f);/* @__PURE__ */
|
|
85
|
+
return n("div",{className:"markstream-react markdown-renderer"+(e.isDark?" dark":""),"data-custom-id":e.customId,children:k.map((e,t)=>/* @__PURE__ */n("div",{className:"node-slot","data-node-index":t,"data-node-type":e.type,children:/* @__PURE__ */n("div",{className:"node-content",children:Ee(e,`${v}-${t}`,w)})},`${v}-${t}`))})}export{ie as A,J as B,ae as C,$e as D,de as E,He as F,Ee as G,ye as H,ve as I,ke as L,be as M,Me as N,X as P,Te as R,ue as S,ne as T,Ie as V,Ne as a,te as b,se as c,oe as d,re as e,le as f,Y as g,me as h,Ce as i,Pe as j,De as k,Ke as l,xe as m,he as n,Z as o,ee as p,_e as q,Be as r,Se as s,we as t,ce as u,pe as v,ge as w,G as x,fe as y,Ae as z};
|