1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,552070,e=>{"use strict";var t=e.i(942956),r=e.i(402652),l=e.i(216920);function n(e,t){if("string"!=typeof e)return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{}return null}}let o=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),s=new Set(["javascript:","data:","file:","vbscript:"]);function a(e,t,r,l=!1,i=!1,d=[]){if(!e)return null;if("string"==typeof e&&e.startsWith("#")&&!i)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if("string"==typeof e&&e.startsWith("data:"))return i&&l&&e.startsWith("data:image/")?e:null;if("string"==typeof e&&e.startsWith("blob:")){try{let t=new URL(e);if("blob:"===t.protocol&&e.length>5){let t=e.substring(5);if(t&&t.length>0&&"invalid"!==t)return e}}catch{}return null}let c=n(e,r);if(!c||s.has(c.protocol)||!(o.has(c.protocol)||d.includes(c.protocol)||d.includes("*")))return null;if("mailto:"===c.protocol||!c.protocol.match(/^https?:$/))return c.href;let u="string"==typeof e&&(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"));return c&&t.some(e=>{let t=n(e,r);
1return!!t&&t.origin===c.origin&&c.href.startsWith(t.href)})?u?c.pathname+c.search+c.hash:c.href:t.includes("*")?"https:"!==c.protocol&&"http:"!==c.protocol?null:u?c.pathname+c.search+c.hash:c.href:null}let i=Symbol("node-seen");var d=e.i(71345),c=e.i(511356),u=e.i(812878),m=Object.defineProperty,h=Object.defineProperties,p=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,x=(e,t,r)=>t in e?m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v=(e,t)=>{for(var r in t||(t={}))g.call(t,r)&&x(e,r,t[r]);if(f)for(var r of f(t))b.call(t,r)&&x(e,r,t[r]);return e},y=/(\*\*)([^*]*\*?)$/,w=/(__)([^_]*?)$/,j=/(\*\*\*)([^*]*?)$/,k=/(\*)([^*]*?)$/,C=/(_)([^_]*?)$/,N=/(`)([^`]*?)$/,L=/(~~)([^~]*?)$/,M=/^[\s_~*`]*$/,$=/^[\s]*[-*+][\s]+$/,V=/[\p{L}\p{N}_]/u,H=/^```[^`\n]*```?$/,S=/^\*{4,}$/,E=/(__)([^_]+)_$/,R=/(~~)([^~]+)~$/,P=/__/g,O=/~~/g,T=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||95===t||V.test(e)},z=(e,t)=>{let r=!1;for(let l=0;l<t;l+=1)"`"===e[l]&&"`"===e[l+1]&&"`"===e[l+2]&&(r=!r,l+=2);return r},A=(e,t)=>{let r=1;for(let l=t+1;l<e.length;l+=1)if("["===e[l])r+=1;else if("]"===e[l]&&0==(r-=1))return l;return -1},I=(e,t)=>{let r=!1,l=!1;for(let n=0;n<e.length&&n<t;n+=1){if("\\"===e[n]&&"$"===e[n+1]){n+=1;continue}"$"===e[n]&&("$"===e[n+1]?(l=!l,n+=1,r=!1):l||(r=!r))}return r||l},q=(e,t)=>{for(let r=t;r<e.length;r+=1){if(")"===e[r])return!0;if(e[r]===` 2`)break}return!1},_=(e,t)=>{for(let r=t-1;r>=0&&")"!==e[r];r-=1){if("("===e[r])return r>0&&"]"===e[r-1]&&q(e,t);if(e[r]===` 3`)break}return!1},D=(e,t,r)=>{let l=0;for(let r=t-1;r>=0;r-=1)if(e[r]===` 4`){l=r+1;break}let n=e.length;for(let r=t;r<e.length;r+=1)if(e[r]===` 5`){n=r;break}let o=e.substring(l,n),s=0,a=!1;for(let e of o)if(e===r)s+=1;else if(" "!==e&&" "!==e){a=!0;break}return s>=3&&!a},W=(e,t,r,l)=>!!("\\"===r||e.includes("$")&&I(e,t))||("*"!==r&&"*"===l?(t<e.length-2?e[t+2]:"")!=="*":!!("*"===r||r&&l&&T(r)&&T(l)||((e,t,r)=>{if(" "!==r&&" "!==r)return!1;let l=0;for(let r=t-1;r>=0;r-=1)if(e[r]===` 6`){l=r+1;break}for(let r=l;r<t;r+=1)if(" "!==e[r]&&" "!==e[r])return!1;return!0})(e,t,l))),Z=e=>{let t=0,r=e.length;for(let l=0;l<r;l+=1){if("*"!==e[l])continue;let n=l>0?e[l-1]:"",o=l<r-1?e[l+1]:"";W(e,l,n,o)||(t+=1)}return t},B=(e,t,r,l)=>!!("\\"===r||e.includes("$")&&I(e,t)||_(e,t)||"_"===r||"_"===l||r&&l&&T(r)&&T(l)),K=e=>{for(let t=0;t<e.length;t+=1)if("_"===e[t]&&"_"!==e[t-1]&&"_"!==e[t+1]&&"\\"!==e[t-1]&&!I(e,t)&&!_(e,t)){let r=t>0?e[t-1]:"",l=t<e.length-1?e[t+1]:"";if(r&&l&&T(r)&&T(l))continue;return t}return -1},U=(e,t)=>{let r=!1,l=!1;for(let n=0;n<t;n+=1){if("```"===e.substring(n,n+3)){l=!l,n+=2;continue}l||"`"!==e[n]||(r=!r)}return r||l},F=(e,t)=>{let r="```"===e.substring(t,t+3),l=t>0&&"```"===e.substring(t-1,t+2),n=t>1&&"```"===e.substring(t-2,t+1);return r||l||n},G=(e,t)=>t>=2&&"```"===e.substring(t-2,t+1)||t>=1&&"```"===e.substring(t-1,t+2)||t<=e.length-3&&"```"===e.substring(t,t+3),Y=(e,t)=>{for(let r=0;r<=t;r++)if("["===e[r]&&!U(e,r)){if(r>0&&"!"===e[r-1])continue;let t=A(e,r);if(-1===t)return r;if(t+1<e.length&&"("===e[t+1]){let l=e.indexOf(")",t+2);-1!==l&&(r=l)}}return -1},J=(e,t,r)=>{let l=t>0&&"!"===e[t-1],n=l?t-1:t,o=e.substring(t+1);if(!o.includes("]")){let s=e.substring(0,n);if(l)return s;if("text-only"===r){let r=Y(e,t);return -1!==r?e.substring(0,r)+e.substring(r+1):`${s}${o}`}return`${e}
6](streamdown:incomplete-link)`}if(-1===A(e,t)){let o=e.substring(0,n);if(l)return o;if("text-only"===r){let r=Y(e,t);if(-1!==r)return e.substring(0,r)+e.substring(r+1);let l=e.substring(t+1);return`${o}${l}`}return`${e}](streamdown:incomplete-link)`}return null},X=(e,t="protocol")=>{let r=e.lastIndexOf("](");if(-1!==r&&!U(e,r)){let l=((e,t,r)=>{if(e.substring(t+2).includes(")"))return null;let l=((e,t)=>{let r=1;for(let l=t-1;l>=0;l-=1)if("]"===e[l])r+=1;else if("["===e[l]&&0==(r-=1))return l;return -1})(e,t);if(-1===l||U(e,l))return null;let n=l>0&&"!"===e[l-1],o=e.substring(0,n?l-1:l);if(n)return o;let s=e.substring(l+1,t);return"text-only"===r?`${o}${s}`:`${o}[${s}](streamdown:incomplete-link)`})(e,r,t);if(null!==l)return l}for(let r=e.length-1;r>=0;r-=1)if("["===e[r]&&!U(e,r)){let l=J(e,r,t);if(null!==l)return l}return e},Q=/^-{1,2}$/,ee=/^[\s]*-{1,2}[\s]+$/,et=/^={1,2}$/,er=/^[\s]*={1,2}[\s]+$/,el=[{handler:{name:"setextHeadings",handle:e=>{if(!e||"string"!=typeof e)return e;let t=e.lastIndexOf(` 7`);if(-1===t)return e;let r=e.substring(t+1),l=e.substring(0,t),n=r.trim();if(Q.test(n)&&!r.match(ee)){let t=l.split(` 8`).at(-1);if(t&&t.trim().length>0)return`${e}\u200B`}if(et.test(n)&&!r.match(er)){let t=l.split(` 9`).at(-1);if(t&&t.trim().length>0)return`${e}\u200B`}return e},priority:0},optionKey:"setextHeadings"},{handler:{name:"links",handle:X,priority:10},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:e=>{let t,r;if(S.test(e))return e;let l=e.match(j);if(!l)return e;let n=l[2],o=e.lastIndexOf(l[1]);return!n||M.test(n)||z(e,o)||D(e,o,"*")?e:(e=>{let t=0,r=0;for(let l=0;l<e.length;l+=1)"*"===e[l]?r+=1:(r>=3&&(t+=Math.floor(r/3)),r=0);return r>=3&&(t+=Math.floor(r/3)),t})(e)%2==1?(t=(e.match(/\*\*/g)||[]).length,r=Z(e),t%2==0&&r%2==0)?e:`${e}***`:e},priority:20},optionKey:"boldItalic"},{handler:{name:"bold",handle:e=>{let t=e.match(y);if(!t)return e;let r=t[2],l=e.lastIndexOf(t[1]);return z(e,l)||((e,t,r)=>{if(!t||M.test(t))return!0;let l=e.substring(0,r).lastIndexOf(` 10`),n=e.substring(-1===l?0:l+1,r);return!!($.test(n)&&t.includes(` 11`))||D(e,r,"*")})(e,r,l)?e:(e.match(/\*\*/g)||[]).length%2==1?r.endsWith("*")?`${e}*`:`${e}**`:e},priority:30},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:e=>{let t=e.match(w);if(!t){let t=e.match(E);if(t){let r=e.lastIndexOf(t[1]);if(!z(e,r)&&(e.match(P)||[]).length%2==1)return`${e}_`}return e}let r=t[2],l=e.lastIndexOf(t[1]);return z(e,l)||((e,t,r)=>{if(!t||M.test(t))return!0;let l=e.substring(0,r).lastIndexOf(` 12`),n=e.substring(-1===l?0:l+1,r);return!!($.test(n)&&t.includes(` 13`))||D(e,r,"_")})(e,r,l)?e:(e.match(/__/g)||[]).length%2==1?`${e}__`:e},priority:40},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:e=>{if(!e.match(k))return e;let t=(e=>{for(let t=0;t<e.length;t+=1)if("*"===e[t]&&"*"!==e[t-1]&&"*"!==e[t+1]&&"\\"!==e[t-1]&&!I(e,t)){let r=t>0?e[t-1]:"",l=t<e.length-1?e[t+1]:"";if(r&&l&&T(r)&&T(l))continue;return t}return -1})(e);if(-1===t||z(e,t))return e;let r=e.substring(t+1);return!r||M.test(r)?e:Z(e)%2==1?`${e}*`:e},priority:41},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:e=>{if(!e.match(C))return e;let t=K(e);if(-1===t||z(e,t))return e;let r=e.substring(t+1);if(!r||M.test(r))return e;if((e=>{let t=0,r=e.length;for(let l=0;l<r;l+=1){if("_"!==e[l])continue;let n=l>0?e[l-1]:"",o=l<r-1?e[l+1]:"";B(e,l,n,o)||(t+=1)}return t})(e)%2==1){let t=(e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if((t.match(/\*\*/g)||[]).length%2!=1)return null;let r=t.indexOf("**"),l=K(t);return -1!==r&&-1!==l&&r<l?`${t}_**`:null})(e);return null!==t?t:(e=>{let t=e.length;for(;t>0&&e[t-1]===` 14`;)t-=1;if(t<e.length){let r=e.slice(0,t),l=e.slice(t);return`${r}_${l}`}return`${e}_`})(e)}return e},priority:42},optionKey:"italic"},{handler:{name:"inlineCode",handle:e=>{let t=!e.match(H)||e.includes(` 15`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e;if(null!==t)return t;let r=e.match(N);if(r&&(e.match(/```/g)||[]).length%2!=1){let t=r[2];if(!t||M.test(t))return e;if((e=>{let t=0;for(let r=0;r<e.length;r+=1)"`"!==e[r]||F(e,r)||(t+=1);return t})(e)%2==1)return`${e}\``}return e},priority:50},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:e=>{let t=e.match(L);if(t){let r=t[2];if(!r||M.test(r))return e;if((e.match(O)||[]).length%2==1)return`${e}~~`}else if(e.match(R)&&(e.match(O)||[]).length%2==1)return`${e}~`;return e},priority:60},optionKey:"strikethrough"},{handler:{name:"katex",handle:e=>{let t;return(e=>{let t=0,r=!1;for(let l=0;l<e.length-1;l+=1)"`"!==e[l]||G(e,l)||(r=!r),r||"$"!==e[l]||"$"!==e[l+1]||(t+=1,l+=1);return t})(e)%2==0?e:-1===(t=e.indexOf("$$"))||-1===e.indexOf(` 16`,t)||e.endsWith(` 17`)?`${e}$$`:`${e} 18$$`},priority:70},optionKey:"katex"}],en=e.i(410331),eo=e.i(7284),es=e.i(877130),ea=e.i(945334),ei=e.i(403010),ed=e.i(652652),ec=e.i(8793
1802),eu=e.i(752932),em=e=>(0,en.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,en.jsx)("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),eh=e=>(0,en.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,en.jsx)("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),ep=e=>(0,en.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,en.jsx)("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),ef=e=>(0,en.jsxs)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[(0,en.jsx)("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),(0,en.jsx)("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,en.jsx)("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),(0,en.jsx)("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),(0,en.jsx)("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),(0,en.jsx)("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),(0,en.jsx)("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),(0,en.jsx)("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),(0,en.jsx)("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),(0,en.jsx)("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),eg=e=>(0,en.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,en.jsx)("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),eb=e=>(0,en.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,en.jsx)("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),ex=e=>(0,en.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,en.jsx)("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),ev=e=>(0,en.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,en.jsx)("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),ey=e=>(0,en.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,en.jsx)("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),ew=e=>(0,en.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,en.jsx)("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),ej=(...e)=>(0,es.twMerge)((0,eo.clsx)(e)),ek=(e,t,r)=>{let l="string"==typeof t?new Blob([t],{type:r}):t,n=URL.createObjectURL(l),o=document.createElement("a");o.href=n,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(n)},eC=(0,t.createContext)({code:""}),eN=()=>(0,t.useContext)(eC),eL=({onCopy:e,onError:r,timeout:l=2e3,children:n,className:o,code:s,...a})=>{let[i,d]=(0,t.useState)(!1),c=(0,t.useRef)(0),{code:u}=eN(),{isAnimating:m}=(0,t.useContext)(tO),h=null!=s?s:u,p=async()=>{var t;if("u"<typeof window||!(null!=(t=null==navigator?void 0:navigator.clipboard)&&t.writeText)){null==r||r(Error("Clipboard API not available"));return}try{i||(await navigator.clipboard.writeText(h),d(!0),null==e||e(),c.current=window.setTimeout(()=>d(!1),l))}catch(e){null==r||r(e)}};return(0,t.useEffect)(()=>()=>{window.clearTimeout(c.current)},[]),(0,en.jsx)("button",{className:ej("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",o),"data-streamdown":"code-block-copy-button",disabled:m,onClick:p,title:"Copy Code",type:"button",...a,children:null!=n?n:(0,en.jsx)(i?em:eh,{size:14})})},eM={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",da
18x:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",æè¨:"wy"},e$=({onDownload:e,onError:r,language:l,children:n,className:o,code:s,...a})=>{let{code:i}=eN(),{isAnimating:d}=(0,t.useContext)(tO),c=null!=s?s:i,u=`file.${l&&l in eM?eM[l]:"txt"}`;return(0,en.jsx)("button",{className:ej("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",o),"data-streamdown":"code-block-download-button",disabled:d,onClick:()=>{try{ek(u,c,"text/plain"),null==e||e()}catch(e){null==r||r(e)}},title:"Download file",type:"button",...a,children:null!=n?n:(0,en.jsx)(ep,{size:14})})},eV=()=>(0,en.jsxs)("div",{className:"w-full divide-y divide-border overflow-hidden rounded-xl border border-border",children:[(0,en.jsx)("div",{className:"h-[46px] w-full bg-muted/80"}),(0,en.jsx)("div",{className:"flex w-full items-center justify-center p-4",children:(0,en.jsx)(ef,{className:"size-4 animate-spin"})})]}),eH=/\.[^/.]+$/,eS=0,eE=({url:e,isOpen:r,onClose:l,onConfirm:n})=>{let[o,s]=(0,t.useState)(!1),a=(0,t.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),2e3)}catch(e){}},[e]),i=(0,t.useCallback)(()=>{n(),l()},[n,l]);return(0,t.useEffect)(()=>
18{if(r){1===(eS+=1)&&(document.body.style.overflow="hidden");let e=e=>{"Escape"===e.key&&l()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e),0===(eS=Math.max(0,eS-1))&&(document.body.style.overflow="")}}},[r,l]),r?(0,en.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm","data-streamdown":"link-safety-modal",onClick:l,onKeyDown:e=>{"Escape"===e.key&&l()},role:"button",tabIndex:0,children:(0,en.jsxs)("div",{className:"relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:"presentation",children:[(0,en.jsx)("button",{className:"absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:l,title:"Close",type:"button",children:(0,en.jsx)(ex,{size:16})}),(0,en.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,en.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-lg",children:[(0,en.jsx)(ev,{size:20}),(0,en.jsx)("span",{children:"Open external link?"})]}),(0,en.jsx)("p",{className:"text-muted-foreground text-sm",children:"You're about to visit an external website."})]}),(0,en.jsx)("div",{className:ej("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),(0,en.jsxs)("div",{className:"flex gap-2",children:[(0,en.jsx)("button",{className:"flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted",onClick:a,type:"button",children:o?(0,en.jsxs)(en.Fragment,{children:[(0,en.jsx)(em,{size:14}),(0,en.jsx)("span",{children:"Copied"})]}):(0,en.jsxs)(en.Fragment,{children:[(0,en.jsx)(eh,{size:14}),(0,en.jsx)("span",{children:"Copy link"})]})}),(0,en.jsxs)("button",{className:"flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90",onClick:i,type:"button",children:[(0,en.jsx)(ev,{size:14}),(0,en.jsx)("span",{children:"Open link"})]})]})]})}):null},eR=(0,t.createContext)(null),eP=()=>(0,t.useContext)(eR),eO=()=>{var e;let t=eP();return null!=(e=null==t?void 0:t.mermaid)?e:null},eT=({chart:e,children:r,className:l,onDownload:n,config:o,onError:s})=>{let[a,i]=(0,t.useState)(!1),d=(0,t.useRef)(null),{isAnimating:c}=(0,t.useContext)(tO),u=eO(),m=async t=>{try{if("mmd"===t){ek("diagram.mmd",e,"text/plain"),i(!1),null==n||n(t);return}if(!u){null==s||s(Error("Mermaid plugin not available"));return}let l=u.getMermaid(o),a=e.split("").reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),d=`mermaid-${Math.abs(a)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:c}=await l.render(d,e);if(!c){null==s||s(Error("SVG not found. Please wait for the diagram to render."));return}if("svg"===t){ek("diagram.svg",c,"image/svg+xml"),i(!1),null==n||n(t);return}if("png"===t){var r;let e=await (r=c,new Promise((e,t)=>{let l="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(r))),n=new Image;n.crossOrigin="anonymous",n.onload=()=>{let r=document.createElement("canvas"),l=5*n.width,o=5*n.height;r.width=l,r.height=o;let s=r.getContext("2d");s?(s.drawImage(n,0,0,l,o),r.toBlob(r=>{r?e(r):t(Error("Failed to create PNG blob"))},"image/png")):t(Error("Failed to create 2D canvas context for PNG export"))},n.onerror=()=>t(Error("Failed to load SVG image")),n.src=l}));ek("diagram.png",e,"image/png"),null==n||n(t),i(!1);return}}catch(e){null==s||s(e)}};return(0,t.useEffect)(()=>{let e=e=>{let t=e.composedPath();d.current&&!t.includes(d.current)&&i(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),(0,en.jsxs)("div",{className:"relative",ref:d,children:[(0,en.jsx)("button",{className:ej("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",l),disabled:c,onClick:()=>i(!a),title:"Download diagram",type:"button",children:null!=r?r:(0,en.jsx)(ep,{size:14})}),a?(0,en.jsxs)("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[(0,en.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>m("svg"),title:"Download diagram as SVG",type:"button",children:"SVG"}),(0,en.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>m("png"),title:"Download diagram as PNG",type:"button",children:"PNG"}),(0,en.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>m("mmd"),title:"Download diagram as MMD",type:"button",children:"MMD"})]}):null]})},ez=0,eA=({chart:e,config:r,onFullscreen:l,onExit:n,className:o,...s})=>{let[a,i]=(0,t.useState)(!1),{isAnimating:d,controls:c}=(0,t.useContext)(tO),u=(()=>
18{if("boolean"==typeof c)return c;let e=c.mermaid;return!1!==e&&(!0===e||void 0===e||!1!==e.panZoom)})(),m=()=>{i(!a)};return(0,t.useEffect)(()=>{if(a){1===(ez+=1)&&(document.body.style.overflow="hidden");let e=e=>{"Escape"===e.key&&i(!1)};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e),0===(ez=Math.max(0,ez-1))&&(document.body.style.overflow="")}}},[a]),(0,t.useEffect)(()=>{a?null==l||l():n&&n()},[a,l,n]),(0,en.jsxs)(en.Fragment,{children:[(0,en.jsx)("button",{className:ej("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",o),disabled:d,onClick:m,title:"View fullscreen",type:"button",...s,children:(0,en.jsx)(eg,{size:14})}),a?(0,en.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm",onClick:m,onKeyDown:e=>{"Escape"===e.key&&m()},role:"button",tabIndex:0,children:[(0,en.jsx)("button",{className:"absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:m,title:"Exit fullscreen",type:"button",children:(0,en.jsx)(ex,{size:20})}),(0,en.jsx)("div",{className:"flex size-full items-center justify-center p-4",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:"presentation",children:(0,en.jsx)(tq,{chart:e,className:"size-full [&_svg]:h-auto [&_svg]:w-auto",config:r,fullscreen:!0,showControls:u})})]}):null]})},eI=e=>{var t,r;let l=[],n=[];for(let r of e.querySelectorAll("thead th"))l.push((null==(t=r.textContent)?void 0:t.trim())||"");for(let t of e.querySelectorAll("tbody tr")){let e=[];
18for(let l of t.querySelectorAll("td"))e.push((null==(r=l.textContent)?void 0:r.trim())||"");n.push(e)}return{headers:l,rows:n}},eq=e=>{let{headers:t,rows:r}=e,l=e=>{let t=!1,r=!1;for(let l of e){if('"'===l){t=!0,r=!0;break}(","===l||l===` 19`)&&(t=!0)}return t?r?`"${e.replace(/"/g,'""')}"`:`"${e}"`:e},n=Array(t.length>0?r.length+1:r.length),o=0;for(let e of(t.length>0&&(n[o]=t.map(l).join(","),o+=1),r))n[o]=e.map(l).join(","),o+=1;return n.join(` 20`)},e_=e=>{let t=!1;for(let r of e)if("\\"===r||"|"===r){t=!0;break}if(!t)return e;let r=[];for(let t of e)"\\"===t?r.push("\\\\"):"|"===t?r.push("\\|"):r.push(t);return r.join("")},eD=({children:e,className:r,onCopy:l,onError:n,timeout:o=2e3})=>{let[s,a]=(0,t.useState)(!1),[i,d]=(0,t.useState)(!1),c=(0,t.useRef)(null),u=(0,t.useRef)(0),{isAnimating:m}=(0,t.useContext)(tO),h=async e=>{var t,r;if("u"<typeof window||!(null!=(t=null==navigator?void 0:navigator.clipboard)&&t.write)){null==n||n(Error("Clipboard API not available"));return}try{let t=null==(r=c.current)?void 0:r.closest('[data-streamdown="table-wrapper"]'),s=null==t?void 0:t.querySelector("table");if(!s){null==n||n(Error("Table not found"));return}let i=eI(s),m="csv"===e?eq(i):(e=>{let{headers:t,rows:r}=e,l=e=>{let t=!1;for(let r of e)if(" "===r||r===` 21`||"\r"===r){t=!0;break}if(!t)return e;let r=[];for(let t of e)" "===t?r.push("\\t"):t===` 22`?r.push("\\n"):"\r"===t?r.push("\\r"):r.push(t);return r.join("")},n=Array(t.length>0?r.length+1:r.length),o=0;for(let e of(t.length>0&&(n[o]=t.map(l).join(" "),o+=1),r))n[o]=e.map(l).join(" "),o+=1;return n.join(` 23`)})(i),h=new ClipboardItem({"text/plain":new Blob([m],{type:"text/plain"}),"text/html":new Blob([s.outerHTML],{type:"text/html"})});await navigator.clipboard.write([h]),d(!0),a(!1),null==l||l(e),u.current=window.setTimeout(()=>d(!1),o)}catch(e){null==n||n(e)}};return(0,t.useEffect)(()=>{let e=e=>{let t=e.composedPath();c.current&&!t.includes(c.current)&&a(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e),window.clearTimeout(u.current)}},[]),(0,en.jsxs)("div",{className:"relative",ref:c,children:[(0,en.jsx)("button",{className:ej("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",r),disabled:m,onClick:()=>a(!s),title:"Copy table",type:"button",children:null!=e?e:(0,en.jsx)(i?em:eh,{size:14})}),s?(0,en.jsxs)("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[(0,en.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>h("csv"),title:"Copy table as CSV",type:"button",children:"CSV"}),(0,en.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>h("tsv"),title:"Copy table as TSV",type:"button",children:"TSV"})]}):null]})},eW=({children:e,className:r,onDownload:l,onError:n})=>{let[o,s]=(0,t.useState)(!1),a=(0,t.useRef)(null),{isAnimating:i}=(0,t.useContext)(tO),d=e=>{var t;try{let r=null==(t=a.current)?void 0:t.closest('[data-streamdown="table-wrapper"]'),o=null==r?void 0:r.querySelector("table");if(!o){null==n||n(Error("Table not found"));return}let i=eI(o),d="csv"===e?eq(i):(e=>{let{headers:t,rows:r}=e;if(0===t.length)return"";let l=Array(r.length+2),n=0,o=t.map(e=>e_(e));l[n]=`| ${o.join(" | ")} |`,n+=1;let s=Array(t.length);for(let e=0;e<t.length;e+=1)s[e]="---";for(let e of(l[n]=`| ${s.join(" | ")} |`,n+=1,r))if(e.length<t.length){let r=Array(t.length);for(let l=0;l<t.length;l+=1)r[l]=l<e.length?e_(e[l]):"";l[n]=`| ${r.join(" | ")} |`,n+=1}else{let t=e.map(e=>e_(e));l[n]=`| ${t.join(" | ")} |`,n+=1}return l.join(` 24`)})(i);ek(`table.${"csv"===e?"csv":"md"}`,d,"csv"===e?"text/csv":"text/markdown"),s(!1),null==l||l(e)}catch(e){null==n||n(e)}};return(0,t.useEffect)(()=>{let e=e=>{let t=e.composedPath();a.current&&!t.includes(a.current)&&s(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),(0,en.jsxs)("div",{className:"relative",ref:a,children:[(0,en.jsx)("button",{className:ej("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",r),disabled:i,onClick:()=>s(!o),title:"Download table",type:"button",children:null!=e?e:(0,en.jsx)(ep,{size:14})}),o?(0,en.jsxs)("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[(0,en.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>d("csv"),title:"Download table as CSV",type:"button",children:"CSV"}),(0,en.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>d("markdown"),title:"Download table as Markdown",type:"button",children:"Markdown"})]}):null]})},eZ=({children:e,className:t,showControls:r,...l})=>(0,en.jsxs)("div",{className:"my-4 flex flex-col space-y-2","data-streamdown":"table-wrapper",children:[r?(0,en.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,en.jsx)(eD,{}),(0,en.jsx)(eW,{})]}):null,(0,en.jsx)("div",{className:"overflow-x-auto",children:(0,en.jsx)("table",{className:ej("w-full border-collapse border border-border",t),"data-streamdown":"table",...l,children:e})})]}),eB=(0,t.lazy)(()=>e.A(609791).then(e=>({default:e.CodeBlock}))),eK=(0,t.lazy)(()=>e.A(786880).then(e=>({default:e.Mermaid}))),eU=/language-([^\s]+)/;function eF(e,t){if(!(null!=e&&e.position||null!=t&&t.position))return!0;
24if(!(null!=e&&e.position&&null!=t&&t.position))return!1;let r=e.position.start,l=t.position.start,n=e.position.end,o=t.position.end;return(null==r?void 0:r.line)===(null==l?void 0:l.line)&&(null==r?void 0:r.column)===(null==l?void 0:l.column)&&(null==n?void 0:n.line)===(null==o?void 0:o.line)&&(null==n?void 0:n.column)===(null==o?void 0:o.column)}function eG(e,t){return e.className===t.className&&eF(e.node,t.node)}var eY=(e,t)=>"boolean"==typeof e?e:!1!==e[t],eJ=(e,t)=>{if("boolean"==typeof e)return e;let r=e.mermaid;return!1!==r&&(!0===r||void 0===r||!1!==r[t])},eX=(0,t.memo)(({children:e,className:t,node:r,...l})=>(0,en.jsx)("ol",{className:ej("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...l,children:e}),(e,t)=>eG(e,t));eX.displayName="MarkdownOl";var eQ=(0,t.memo)(({children:e,className:t,node:r,...l})=>(0,en.jsx)("li",{className:ej("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...l,children:e}),(e,t)=>e.className===t.className&&eF(e.node,t.node));eQ.displayName="MarkdownLi";var e0=(0,t.memo)(({children:e,className:t,node:r,...l})=>(0,en.jsx)("ul",{className:ej("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...l,children:e}),(e,t)=>eG(e,t));e0.displayName="MarkdownUl";var e1=(0,t.memo)(({className:e,node:t,...r})=>(0,en.jsx)("hr",{className:ej("my-6 border-border",e),"data-streamdown":"horizontal-rule",...r}),(e,t)=>eG(e,t));e1.displayName="MarkdownHr";var e5=(0,t.memo)(({children:e,className:t,node:r,...l})=>(0,en.jsx)("span",{className:ej("font-semibold",t),"data-streamdown":"strong",...l,children:e}),(e,t)=>eG(e,t));e5.displayName="MarkdownStrong";var e2=(0,t.memo)(({children:e,className:r,href:l,node:n,...o})=>{let{linkSafety:s}=(0,t.useContext)(tO),[a,i]=(0,t.useState)(!1),d="streamdown:incomplete-link"===l,c=(0,t.useCallback)(async e=>{if(!(!(null!=s&&s.enabled&&l)||d)){if(e.preventDefault(),s.onLinkCheck&&await s.onLinkCheck(l))return void window.open(l,"_blank","noreferrer");i(!0)}},[s,l,d]),u=(0,t.useCallback)(()=>{l&&window.open(l,"_blank","noreferrer")},[l]),m={url:null!=l?l:"",isOpen:a,onClose:(0,t.useCallback)(()=>{i(!1)},[]),onConfirm:u};return null!=s&&s.enabled&&l?(0,en.jsxs)(en.Fragment,{children:[(0,en.jsx)("button",{className:ej("wrap-anywhere appearance-none text-left font-medium text-primary underline",r),"data-incomplete":d,"data-streamdown":"link",onClick:c,type:"button",children:e}),s.renderModal?s.renderModal(m):(0,en.jsx)(eE,{...m})]}):(0,en.jsx)("a",{className:ej("wrap-anywhere font-medium text-primary underline",r),"data-incomplete":d,"data-streamdown":"link",href:l,rel:"noreferrer",target:"_blank",...o,children:e})},(e,t)=>eG(e,t)&&e.href===t.href);e2.displayName="MarkdownA";var e3=(0,t.memo)(({children:e,className:t,node:r,...l})=>(0,en.jsx)("h1",{className:ej("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...l,children:e}),(e,t)=>eG(e,t));e3.displayName="MarkdownH1";var e6=(0,t.memo)(({children:e,className:t,node:r,...l})=>(0,en.jsx)("h2",{className:ej("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...l,children:e}),(e,t)=>eG(e,t));e6.displayName="MarkdownH2";var e9=(0,t.memo)(({children:e,className:t,node:r,...l})=>(0,en.jsx)("h3",{className:ej("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...l,children:e}),(e,t)=>eG(e,t));e9.displayName="MarkdownH3";var e4=(0,t.memo)(({children:e,className:t,node:r,...l})=>(0,en.jsx)("h4",{className:ej("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...l,children:e}),(e,t)=>eG(e,t));e4.displayName="MarkdownH4";var e7=(0,t.memo)(({children:e,className:t,node:r,...l})=>(0,en.jsx)("h5",{className:ej("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...l,children:e}),(e,t)=>eG(e,t));e7.displayName="MarkdownH5";var e8=(0,t.memo)(({children:e,className:t,node:r,...l})=>(0,en.jsx)("h6",{className:ej("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...l,children:e}),(e,t)=>eG(e,t));e8.displayName="MarkdownH6";
24var te=(0,t.memo)(({children:e,className:r,node:l,...n})=>{let{controls:o}=(0,t.useContext)(tO),s=eY(o,"table");return(0,en.jsx)(eZ,{className:r,showControls:s,...n,children:e})},(e,t)=>eG(e,t));te.displayName="MarkdownTable";var tt=(0,t.memo)(({children:e,className:t,node:r,...l})=>(0,en.jsx)("thead",{className:ej("bg-muted/80",t),"data-streamdown":"table-header",...l,children:e}),(e,t)=>eG(e,t));tt.displayName="MarkdownThead";var tr=(0,t.memo)(({children:e,className:t,node:r,...l})=>(0,en.jsx)("tbody",{className:ej("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...l,children:e}),(e,t)=>eG(e,t));tr.displayName="MarkdownTbody";var tl=(0,t.memo)(({children:e,className:t,node:r,...l})=>(0,en.jsx)("tr",{className:ej("border-border border-b",t),"data-streamdown":"table-row",...l,children:e}),(e,t)=>eG(e,t));tl.displayName="MarkdownTr";var tn=(0,t.memo)(({children:e,className:t,node:r,...l})=>(0,en.jsx)("th",{className:ej("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...l,children:e}),(e,t)=>eG(e,t));tn.displayName="MarkdownTh";var to=(0,t.memo)(({children:e,className:t,node:r,...l})=>(0,en.jsx)("td",{className:ej("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...l,children:e}),(e,t)=>eG(e,t));to.displayName="MarkdownTd";var ts=(0,t.memo)(({children:e,className:t,node:r,...l})=>(0,en.jsx)("blockquote",{className:ej("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...l,children:e}),(e,t)=>eG(e,t));ts.displayName="MarkdownBlockquote";var ta=(0,t.memo)(({children:e,className:t,node:r,...l})=>(0,en.jsx)("sup",{className:ej("text-sm",t),"data-streamdown":"superscript",...l,children:e}),(e,t)=>eG(e,t));ta.displayName="MarkdownSup";var ti=(0,t.memo)(({children:e,className:t,node:r,...l})=>(0,en.jsx)("sub",{className:ej("text-sm",t),"data-streamdown":"subscript",...l,children:e}),(e,t)=>eG(e,t));ti.displayName="MarkdownSub";var td=(0,t.memo)(({children:e,className:r,node:l,...n})=>{if("data-footnotes"in n){let l=Array.isArray(e)?e.map(e=>{if(!(0,t.isValidElement)(e))return e;if(e.type===eX){let r=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!(e=>{var r,l;if(!(0,t.isValidElement)(e))return!1;let n=Array.isArray(e.props.children)?e.props.children:[e.props.children],o=!1,s=!1;for(let e of n)if(e){if("string"==typeof e)""!==e.trim()&&(o=!0);else if((0,t.isValidElement)(e)){if((null==(r=e.props)?void 0:r["data-footnote-backref"])!==void 0)s=!0;else for(let r of Array.isArray(e.props.children)?e.props.children:[e.props.children])if("string"==typeof r&&""!==r.trim()||(0,t.isValidElement)(r)&&(null==(l=r.props)?void 0:l["data-footnote-backref"])===void 0){o=!0;break}}}return s&&!o})(e));return 0===r.length?null:{...e,props:{...e.props,children:r}}}return e}):e;return(Array.isArray(l)?l.some(e=>null!==e):null!==l)?(0,en.jsx)("section",{className:r,...n,children:l}):null}return(0,en.jsx)("section",{className:r,...n,children:e})},(e,t)=>eG(e,t));td.displayName="MarkdownSection";var tc=(0,t.memo)(({node:e,className:r,children:l,...n})=>{var o,s,a;let i=(null==(o=null==e?void 0:e.position)?void 0:o.start.line)===(null==(s=null==e?void 0:e.position)?void 0:s.end.line),{mermaid:d,controls:c}=(0,t.useContext)(tO),u=eO();if(i)return(0,en.jsx)("code",{className:ej("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",r),"data-streamdown":"inline-code",...n,children:l});let m=null==r?void 0:r.match(eU),h=null!=(a=null==m?void 0:m.at(1))?a:"",p="";if((0,t.isValidElement)(l)&&l.props&&"object"==typeof l.props&&"children"in l.props&&"string"==typeof l.props.children?p=l.props.children:"string"==typeof l&&(p=l),"mermaid"===h&&u){let e=eY(c,"mermaid"),l=eJ(c,"download"),n=eJ(c,"copy"),o=eJ(c,"fullscreen"),s=eJ(c,"panZoom");return(0,en.jsx)(t.Suspense,{fallback:(0,en.jsx)(eV,{}),children:(0,en.jsxs)("div",{className:ej("group relative my-4 h-auto rounded-xl border p-4",r),"data-streamdown":"mermaid-block",children:[e&&(l||n||o)?(0,en.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[l?(0,en.jsx)(eT,{chart:p,config:null==d?void 0:d.config}):null,n?(0,en.jsx)(eL,{code:p}):null,o?(0,en.jsx)(eA,{chart:p,config:null==d?void 0:d.config}):null]}):null,(0,en.jsx)(eK,{chart:p,config:null==d?void 0:d.config,showControls:s})]})})}let f=eY(c,"code");return(0,en.jsx)(t.Suspense,{fallback:(0,en.jsx)(eV,{}),children:(0,en.jsx)(eB,{className:ej("overflow-x-auto border-border border-t",r),code:p,language:h,children:f?(0,en.jsxs)(en.Fragment,{children:[(0,en.jsx)(e$,{code:p,language:h}),(0,en.jsx)(eL,{})]}):null})})},(e,t)=>e.className===t.className&&eF(e.node,t.node));tc.displayName="MarkdownCode";var tu=(0,t.memo)(({node:e,className:t,src:r,alt:l,...n})=>{let o=async()=>
24{if(r)try{let e=await (await fetch(r)).blob(),t=new URL(r,window.location.origin).pathname.split("/").pop()||"",n=t.split(".").pop(),o=t.includes(".")&&void 0!==n&&n.length<=4,s="";if(o)s=t;else{let r=e.type,n="png";r.includes("jpeg")||r.includes("jpg")?n="jpg":r.includes("png")?n="png":r.includes("svg")?n="svg":r.includes("gif")?n="gif":r.includes("webp")&&(n="webp"),s=`${(l||t||"image").replace(eH,"")}.${n}`}ek(s,e,e.type)}catch(e){window.open(r,"_blank")}};return r?(0,en.jsxs)("div",{className:"group relative my-4 inline-block","data-streamdown":"image-wrapper",children:[(0,en.jsx)("img",{alt:l,className:ej("max-w-full rounded-lg",t),"data-streamdown":"image",src:r,...n}),(0,en.jsx)("div",{className:"pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"}),(0,en.jsx)("button",{className:ej("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:o,title:"Download image",type:"button",children:(0,en.jsx)(ep,{size:14})})]}):null},(e,t)=>e.className===t.className&&eF(e.node,t.node));tu.displayName="MarkdownImg";var tm=(0,t.memo)(({children:e,className:r,node:l,...n})=>{var o,s;let a=(Array.isArray(e)?e:[e]).filter(e=>null!=e&&""!==e);if(1===a.length&&(0,t.isValidElement)(a[0])){let t=a[0].props.node,r=null==t?void 0:t.tagName;if("img"===r||"code"===r&&(null==(o=null==t?void 0:t.position)?void 0:o.start.line)!==(null==(s=null==t?void 0:t.position)?void 0:s.end.line))return(0,en.jsx)(en.Fragment,{children:e})}return(0,en.jsx)("p",{className:r,...n,children:e})},(e,t)=>eG(e,t));tm.displayName="MarkdownParagraph";var th={ol:eX,li:eQ,ul:e0,hr:e1,strong:e5,a:e2,h1:e3,h2:e6,h3:e9,h4:e4,h5:e7,h6:e8,table:te,thead:tt,tbody:tr,tr:tl,th:tn,td:to,blockquote:ts,code:tc,img:tu,pre:({children:e})=>e,sup:ta,sub:ti,p:tm,section:td},tp=[],tf={allowDangerousHtml:!0},tg=new WeakMap,tb=new class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let r=e.rehypePlugins,l=e.remarkPlugins,n=e.remarkRehypeOptions;if(!(r||l||n)){let t="default";return this.keyCache.set(e,t),t}let o=e=>{if(!e||0===e.length)return"";let t="";for(let r=0;r<e.length;r+=1){let l=e[r];if(r>0&&(t+=","),Array.isArray(l)){let[e,r]=l;if("function"==typeof e){let r=tg.get(e);r||(r=e.name,tg.set(e,r)),t+=r}else t+=String(e);t+=":",t+=JSON.stringify(r)}else if("function"==typeof l){let e=tg.get(l);e||(e=l.name,tg.set(l,e)),t+=e}else t+=String(l)}return t},s=o(r),a=o(l),i=n?JSON.stringify(n):"",d=`${a}::${s}::${i}`;return this.keyCache.set(e,d),d}get(e){let t=this.generateCacheKey(e),r=this.cache.get(t);return r&&(this.cache.delete(t),this.cache.set(t,r)),r}set(e,t){let r=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(r,t)}clear(){this.cache.clear()}},tx=e=>{let t=tv(e),r=e.children||"";return tw(t.runSync(t.parse(r),r),e)},tv=e=>{let t=tb.get(e);if(t)return t;let r=ty(e);return tb.set(e,r),r},ty=e=>{let t=e.rehypePlugins||tp,r=e.remarkPlugins||tp,l=e.remarkRehypeOptions?{...tf,...e.remarkRehypeOptions}:tf;return(0,ec.unified)().use(ei.default).use(r).use(ed.default,l).use(t)},tw=(e,t)=>(0,ea.toJsxRuntime)(e,{Fragment:en.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:en.jsx,jsxs:en.jsxs,passKeys:!0,passNode:!0}),tj=/\[\^[^\]\s]{1,200}\](?!:)/,tk=/\[\^[^\]\s]{1,200}\]:/,tC=/<\/(\w+)>/,tN=/<(\w+)[\s>]/,tL=e=>{let t=0;for(;t<e.length&&(" "===e[t]||" "===e[t]||e[t]===` 25`||"\r"===e[t]);)t+=1;return t+1<e.length&&"$"===e[t]&&"$"===e[t+1]},tM=e=>{let t=e.length-1;for(;t>=0&&(" "===e[t]||" "===e[t]||e[t]===` 26`||"\r"===e[t]);)t-=1;return t>=1&&"$"===e[t]&&"$"===e[t-1]},t$=e=>{let t=0;for(let r=0;r<e.length-1;r+=1)"$"===e[r]&&"$"===e[r+1]&&(t+=1,r+=1);return t},tV=e=>{let t=tj.test(e),r=tk.test(e);if(t||r)return[e];let l=eu.Lexer.lex(e,{gfm:!0}),n=[],o=[];for(let e of l){let t=e.raw,r=n.length;if(o.length>0){if(n[r-1]+=t,"html"===e.type){let e=t.match(tC);if(e){let t=e[1];o.at(-1)===t&&o.pop()}}continue}if("html"===e.type&&e.block){let e=t.match(tN);if(e){let r=e[1];t.includes(`</${r}>`)||o.push(r)}}if("$$"===t.trim()&&r>0){let e=n[r-1],l=tL(e),o=t$(e);if(l&&o%2==1){n[r-1]=e+t;continue}}if(r>0&&tM(t)){let e=n[r-1],l=tL(e),o=t$(e),s=t$(t);if(l&&o%2==1&&!tL(t)&&1===s){n[r-1]=e+t;continue}}n.push(t)}return n},tH={raw:d.default,sanitize:[c.default,{}],harden:[function({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:o=!1,allowedProtocols:s=[],blockedImageClass:d="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:c="text-gray-500"}){let u=t.length&&!t.every(e=>"*"===e),m=n.length&&!n.every(e=>"*"===e);if(!e&&(u||m))throw Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return u=>{var m,h,p,f,g,b,x;
26let v,y=(m=e,h=t,p=n,f=o,g=s,b=d,x=c,v=(e,t,n)=>{if("element"!==e.type||e[i])return r.CONTINUE;if("a"===e.tagName){let o=a(e.properties.href,h,m,!1,!1,g);return null===o?(e[i]=!0,(0,l.visit)(e,v),n&&"number"==typeof t&&(n.children[t]={type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(e.properties.href),class:x},children:[...e.children,{type:"text",value:" [blocked]"}]}),r.SKIP):(e.properties.href=o,e.properties.target="_blank",e.properties.rel="noopener noreferrer",r.CONTINUE)}if("img"===e.tagName){let o=a(e.properties.src,p,m,f,!0,g);if(null===o)return e[i]=!0,(0,l.visit)(e,v),n&&"number"==typeof t&&(n.children[t]={type:"element",tagName:"span",properties:{class:b},children:[{type:"text",value:"[Image blocked: "+String(e.properties.alt||"No description")+"]"}]}),r.SKIP;e.properties.src=o}return r.CONTINUE});(0,l.visit)(u,y)}},{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},tS={gfm:[u.default,{}]},tE=Object.values(tH),tR=Object.values(tS),tP={block:" â",circle:" â"},tO=(0,t.createContext)({shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}}),tT=(0,t.memo)(({content:e,shouldParseIncompleteMarkdown:t,index:r,...l})=>(0,en.jsx)(tx,{...l,children:e}),(e,t)=>{if(e.content!==t.content||e.index!==t.index)return!1;if(e.components!==t.components){let r=Object.keys(e.components||{}),l=Object.keys(t.components||{});if(r.length!==l.length||r.some(r=>{var l,n;return(null==(l=e.components)?void 0:l[r])!==(null==(n=t.components)?void 0:n[r])}))return!1}return e.rehypePlugins===t.rehypePlugins&&e.remarkPlugins===t.remarkPlugins});tT.displayName="Block";var tz=["github-light","github-dark"],tA=(0,t.memo)(({children:e,mode:r="streaming",parseIncompleteMarkdown:l=!0,components:n,rehypePlugins:o=tE,remarkPlugins:s=tR,className:a,shikiTheme:i=tz,mermaid:d,controls:c=!0,isAnimating:u=!1,BlockComponent:m=tT,parseMarkdownIntoBlocksFn:f=tV,caret:g,plugins:b,remend:x,linkSafety:y={enabled:!0},...w})=>{let j=(0,t.useId)(),[k,C]=(0,t.useTransition)(),N=(0,t.useMemo)(()=>"string"!=typeof e?"":"streaming"===r&&l?((e,t)=>{var r,l;let n;if(!e||"string"!=typeof e)return e;let o=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e;for(let{handler:e,earlyReturn:s}of[...(n=null!=(l=null==t?void 0:t.linkMode)?l:"protocol",el.filter(({handler:e,optionKey:r})=>"links"===e.name?!1!==(null==t?void 0:t.links)||!1!==(null==t?void 0:t.images):!1!==(null==t?void 0:t[r])).map(({handler:e,earlyReturn:t})=>"links"===e.name?{handler:h(v({},e),p({handle:e=>X(e,n)})),earlyReturn:"protocol"===n?t:void 0}:{handler:e,earlyReturn:t})),...(null!=(r=null==t?void 0:t.handlers)?r:[]).map(e=>{var t;return{handler:h(v({},e),p({priority:null!=(t=e.priority)?t:100})),earlyReturn:void 0}})].sort((e,t)=>{var r,l;return(null!=(r=e.handler.priority)?r:100)-(null!=(l=t.handler.priority)?l:100)}))if(o=e.handle(o),null!=s&&s(o))break;return o})(e,x):e,[e,r,l,x]),L=(0,t.useMemo)(()=>f(N),[N,f]),[M,$]=(0,t.useState)(L);(0,t.useEffect)(()=>{"streaming"===r?C(()=>{$(L)}):$(L)},[L,r]);let V="streaming"===r?M:L,H=(0,t.useMemo)(()=>V.map((e,t)=>`${j}-${t}`),[V.length,j]),S=(0,t.useMemo)(()=>{var e,t;return{shikiTheme:null!=(t=null==(e=null==b?void 0:b.code)?void 0:e.getThemes())?t:i,controls:c,isAnimating:u,mode:r,mermaid:d,linkSafety:y}},[i,c,u,r,d,y,null==b?void 0:b.code]),E=(0,t.useMemo)(()=>({...th,...n}),[n]),R=(0,t.useMemo)(()=>{let e=[];return null!=b&&b.cjk&&(e=[...e,...b.cjk.remarkPluginsBefore]),e=[...e,...s],null!=b&&b.cjk&&(e=[...e,...b.cjk.remarkPluginsAfter]),null!=b&&b.math&&(e=[...e,b.math.remarkPlugin]),e},[s,null==b?void 0:b.math,null==b?void 0:b.cjk]),P=(0,t.useMemo)(()=>null!=b&&b.math?[...o,b.math.rehypePlugin]:o,[o,null==b?void 0:b.math]),O=(0,t.useMemo)(()=>g&&u?{"--streamdown-caret":`"${tP[g]}"`}:void 0,[g,u]);return"static"===r?(0,en.jsx)(eR.Provider,{value:null!=b?b:null,children:(0,en.jsx)(tO.Provider,{value:S,children:(0,en.jsx)("div",{className:ej("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",a),children:(0,en.jsx)(tx,{components:E,rehypePlugins:P,remarkPlugins:R,...w,children:e})})})}):(0,en.jsx)(eR.Provider,{value:null!=b?b:null,children:(0,en.jsx)(tO.Provider,{value:S,children:(0,en.jsxs)("div",{className:ej("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",g?"*:last:after:inline *:last:after:align-baseline *:last:after:content-(--streamdown-caret)":null,a),style:O,children:[0===V.length&&g&&u&&(0,en.jsx)("span",{}),V.map((e,t)=>(0,en.jsx)(m,{components:E,content:e,index:t,rehypePlugins:P,remarkPlugins:R,shouldParseIncompleteMarkdown:l,...w},H[t]))]})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety);tA.displayName="Streamdown";var tI=({children:e,className:r,minZoom:l=.5,maxZoom:n=3,zoomStep:o=.1,showControls:s=!0,initialZoom:a=1,fullscreen:i=!1})=>{let d=(0,t.useRef)(null),c=(0,t.useRef)(null),[u,m]=(0,t.useState)(a),[h,p]=(0,t.useState)({x:0,y:0}),[f,g]=(0,t.useState)(!1),[b,x]=(0,t.useState)({x:0,y:0}),[v,y]=(0,t.useState)({x:0,y:0}),w=(0,t.useCallback)(e=>{m(t=>Math.max(l,Math.min(n,t+e)))},[l,n]),j=(0,t.useCallback)(()=>{w(o)},[w,o]),k=(0,t.useCallback)(()=>{w(-o)},[w,o]),C=(0,t.useCallback)(()=>{m(a),p({x:0,y:0})},[a]),N=(0,t.useCallback)(e=>{e.preventDefault(),w(e.deltaY>0?-o:o)},[w,o]),L=(0,t.useCallback)(e=>{if(0!==e.button||!1===e.isPrimary)return;g(!0),x({x:e.clientX,y:e.clientY}),y(h);let t=e.currentTarget;t instanceof HTMLElement&&t.setPointerCapture(e.pointerId)},[h]),M=(0,t.useCallback)(e=>{if(!f)return;e.preventDefault();let t=e.clientX-b.x,r=e.clientY-b.y;p({x:v.x+t,y:v.y+r})},[f,b,v]),$=(0,t.useCallback)(e=>{g(!1);let t=e.currentTarget;t instanceof HTMLElement&&t.releasePointerCapture(e.pointerId)},[]);return(0,t.useEffect)(()=>{let e=d.current;if(e)return e.addEventListener("wheel",N,{passive:!1}),()=>{e.removeEventListener("wheel",N)}},[N]),(0,t.useEffect)(()=>
26{let e=c.current;if(e&&f)return document.body.style.userSelect="none",e.addEventListener("pointermove",M,{passive:!1}),e.addEventListener("pointerup",$),e.addEventListener("pointercancel",$),()=>{document.body.style.userSelect="",e.removeEventListener("pointermove",M),e.removeEventListener("pointerup",$),e.removeEventListener("pointercancel",$)}},[f,M,$]),(0,en.jsxs)("div",{className:ej("relative flex flex-col",i?"h-full w-full":"min-h-28 w-full",r),ref:d,style:{cursor:f?"grabbing":"grab"},children:[s?(0,en.jsxs)("div",{className:ej("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/90 p-1 shadow-sm backdrop-blur-sm",i?"bottom-4 left-4":"bottom-2 left-2"),children:[(0,en.jsx)("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:u>=n,onClick:j,title:"Zoom in",type:"button",children:(0,en.jsx)(ey,{size:16})}),(0,en.jsx)("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:u<=l,onClick:k,title:"Zoom out",type:"button",children:(0,en.jsx)(ew,{size:16})}),(0,en.jsx)("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:C,title:"Reset zoom and pan",type:"button",children:(0,en.jsx)(eb,{size:16})})]}):null,(0,en.jsx)("div",{className:ej("flex-1 origin-center transition-transform duration-150 ease-out",i?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:L,ref:c,role:"application",style:{transform:`translate(${h.x}px, ${h.y}px) scale(${u})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},tq=({chart:e,className:r,config:l,fullscreen:n=!1,showControls:o=!0})=>{let[s,a]=(0,t.useState)(null),[i,d]=(0,t.useState)(!1),[c,u]=(0,t.useState)(""),[m,h]=(0,t.useState)(""),[p,f]=(0,t.useState)(0),{mermaid:g}=(0,t.useContext)(tO),b=eO(),x=null==g?void 0:g.errorComponent,{shouldRender:v,containerRef:y}=function(e={}){let{immediate:r=!1,debounceDelay:l=300,rootMargin:n="300px",idleTimeout:o=500}=e,[s,a]=(0,t.useState)(!1),i=(0,t.useRef)(null),d=(0,t.useRef)(null),c=(0,t.useRef)(null),u=(0,t.useMemo)(()=>e=>{let t=Date.now();return window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})},1)},[]),m=(0,t.useMemo)(()=>"u">typeof window&&window.requestIdleCallback?(e,t)=>window.requestIdleCallback(e,t):u,[u]),h=(0,t.useMemo)(()=>"u">typeof window&&window.cancelIdleCallback?e=>window.cancelIdleCallback(e):e=>{clearTimeout(e)},[]);return(0,t.useEffect)(()=>{if(r)return void a(!0);let e=i.current;if(!e)return;d.current&&(clearTimeout(d.current),d.current=null),c.current&&(h(c.current),c.current=null);let t=()=>{d.current&&(clearTimeout(d.current),d.current=null),c.current&&(h(c.current),c.current=null)},s=(e,r)=>{e.isIntersecting?(t(),d.current=window.setTimeout(()=>{var e,t;let l=r.takeRecords();(0===l.length||null!=(t=null==(e=l.at(-1))?void 0:e.isIntersecting)&&t)&&(c.current=m(e=>{e.timeRemaining()>0||e.didTimeout?(a(!0),r.disconnect()):c.current=m(()=>{a(!0),r.disconnect()},{timeout:o/2})},{timeout:o}))},l)):t()},u=new IntersectionObserver(e=>{for(let t of e)s(t,u)},{rootMargin:n,threshold:0});return u.observe(e),()=>{d.current&&clearTimeout(d.current),c.current&&h(c.current),u.disconnect()}},[r,l,n,o,h,m]),{shouldRender:s,containerRef:i}}({immediate:n});return((0,t.useEffect)(()=>{if(v){if(!b)return void a("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");(async()=>{try{a(null),d(!0);let t=b.getMermaid(l),r=e.split("").reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),n=`mermaid-${Math.abs(r)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:o}=await t.render(n,e);u(o),h(o)}catch(e){m||c||a(e instanceof Error?e.message:"Failed to render Mermaid chart")}finally{d(!1)}})()}},[e,l,p,v,b]),v||c||m)?!i||c||m?!s||c||m?(0,en.jsx)("div",{className:ej("size-full",r),"data-streamdown":"mermaid",ref:y,children:(0,en.jsx)(tI,{className:ej(n?"size-full overflow-hidden":"my-4 overflow-hidden",r),fullscreen:n,maxZoom:3,minZoom:.5,showControls:o,zoomStep:.1,children:(0,en.jsx)("div",{"aria-label":"Mermaid chart",className:ej("flex justify-center",n?"size-full items-center":null),dangerouslySetInnerHTML:{__html:c||m},role:"img"})})}):x?(0,en.jsx)("div",{ref:y,children:(0,en.jsx)(x,{chart:e,error:s,retry:()=>f(e=>e+1)})}):(0,en.jsxs)("div",{className:ej("rounded-lg border border-red-200 bg-red-50 p-4",r),ref:y,
26children:[(0,en.jsxs)("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",s]}),(0,en.jsxs)("details",{className:"mt-2",children:[(0,en.jsx)("summary",{className:"cursor-pointer text-red-600 text-xs",children:"Show Code"}),(0,en.jsx)("pre",{className:"mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs",children:e})]})]}):(0,en.jsx)("div",{className:ej("my-4 flex justify-center p-4",r),ref:y,children:(0,en.jsxs)("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[(0,en.jsx)("div",{className:"h-4 w-4 animate-spin rounded-full border-current border-b-2"}),(0,en.jsx)("span",{className:"text-sm",children:"Loading diagram..."})]})}):(0,en.jsx)("div",{className:ej("my-4 min-h-[200px]",r),ref:y})};e.s(["a",0,ej,"b",0,eC,"c",0,()=>{var e;let t=eP();return null!=(e=null==t?void 0:t.code)?e:null},"d",0,tq,"h",0,tO,"j",0,tA],552070)}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.