@farero-ai/ui 0.4.4 → 0.4.6

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/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@farero-ai/ui",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
- "description": "Read-only React renderer for agent replies and chat transcripts, as Farero draws them.",
6
+ "description": "React renderer for agent replies, chat transcripts, and generated panels, as Farero draws them.",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/farero-ai/farero.git",
@@ -42,6 +42,14 @@
42
42
  "types": "./dist/fence.d.ts",
43
43
  "import": "./dist/fence.js"
44
44
  },
45
+ "./generated-ui": {
46
+ "types": "./dist/generated-ui.d.ts",
47
+ "import": "./dist/generated-ui.js"
48
+ },
49
+ "./generated-ui/parse": {
50
+ "types": "./dist/generated-ui/parse.d.ts",
51
+ "import": "./dist/generated-ui/parse.js"
52
+ },
45
53
  "./icons": {
46
54
  "types": "./dist/icons.d.ts",
47
55
  "import": "./dist/icons.js"
@@ -78,6 +86,8 @@
78
86
  },
79
87
  "dependencies": {
80
88
  "@d2lang/d2": "0.1.34",
89
+ "@json-render/core": "0.21.4",
90
+ "@json-render/react": "0.21.4",
81
91
  "@types/hast": "^3.0.5",
82
92
  "clsx": "^2.1.1",
83
93
  "katex": "^0.18.9",
@@ -1 +0,0 @@
1
- import{a}from"./chunk-UNO25KYE.js";import"./chunk-LHMFMBHY.js";import"./chunk-ITKN2ASJ.js";import"./chunk-RR7BB4EQ.js";import"./chunk-ZVJQ5X63.js";import"./chunk-HGN4GN2E.js";import"./chunk-5SBKMKFB.js";import"./chunk-3I4YBQX6.js";export{a as default};
@@ -1 +0,0 @@
1
- import{a as O,b as q,c as G,e as K}from"./chunk-LHMFMBHY.js";import{g as A}from"./chunk-RR7BB4EQ.js";import{a as I,c as N}from"./chunk-ZVJQ5X63.js";import{a as R}from"./chunk-HGN4GN2E.js";import{a as b}from"./chunk-3I4YBQX6.js";import{useContext as Y,useEffect as ee,useMemo as Q,useRef as k,useState as d}from"react";import{createPortal as te}from"react-dom";import{jsx as t,jsxs as s}from"react/jsx-runtime";var m=100,r="rounded-md px-2 py-1 text-xs text-muted hover:bg-surface-2 focus-visible:outline-2 focus-visible:outline-accent disabled:opacity-40";function oe({columns:y,rows:g,sourceRows:T,sourceTable:x,totalRows:v,onClose:S}){let Z=Y(O),[h,E]=d(""),[l,M]=d(null),[c,w]=d(()=>new Set),[_,f]=d(0),[i,C]=d(!1),[L,P]=d(),H=k(null),$=k(null),[j,J]=d(0),B=k(null),z=Q(()=>T??g.map(e=>e.map(o=>typeof o=="string"?o:String(o??""))),[T,g]),a=Q(()=>{let e=h.toLocaleLowerCase(),o=z.map((n,p)=>({cells:n,index:p})).filter(n=>!e||n.cells.some(p=>p.toLocaleLowerCase().includes(e)));return l&&o.sort((n,p)=>(n.cells[l.column]??"").localeCompare(p.cells[l.column]??"",void 0,{numeric:!0})*(l.descending?-1:1)||n.index-p.index),o},[z,h,l]),u=Math.min(_,Math.max(0,Math.ceil(a.length/m)-1)),U=a.slice(u*m,(u+1)*m),W=a.filter(e=>c.has(e.index)).length;ee(()=>{if(i)return H.current?.showModal(),()=>B.current?.focus({preventScroll:!0})},[i]);let D=b(()=>a.filter(e=>!c.size||c.has(e.index)),"exportMatches"),X=b(()=>x?G(x,D().map(e=>e.index)):null,"exportTable"),F=b(()=>[y,...D().map(e=>e.cells)],"exported"),V=s("div",{className:"flex min-h-0 flex-col rounded-lg border border-border-soft bg-bg text-xs",children:[s("div",{className:"flex flex-wrap items-center gap-1 border-border-soft border-b p-2","data-document-controls":!0,children:[t("input",{type:"search","aria-label":"Filter table rows",placeholder:"Filter rows\u2026",value:h,onChange:e=>{E(e.target.value),f(0)},className:"min-w-0 flex-1 rounded-md border border-border-soft bg-bg px-2 py-1 text-base sm:text-xs"}),t("button",{type:"button",className:r,onClick:()=>{M(null),E(""),f(0),w(new Set)},children:"Original order"}),t("button",{type:"button",className:r,onClick:b(()=>{P(void 0),R(N(F()," ")).catch(()=>P("Could not copy rows. Try again."))},"copy"),children:c.size?`Copy ${W} selected in view`:"Copy for spreadsheet"}),x?t(K,{getTable:X}):null,c.size?t("button",{type:"button",className:r,onClick:()=>w(new Set),children:"Clear selection"}):null,t("button",{type:"button",className:r,onClick:()=>I(new Blob([N(F(),",")],{type:"text/csv;charset=utf-8"}),q(Z,y)),children:"CSV"}),t("button",{ref:B,type:"button",className:r,onClick:()=>{i||J($.current?.getBoundingClientRect().height??0),C(e=>!e)},children:i?"Exit fullscreen":"Fullscreen"}),S&&!i?t("button",{type:"button",className:r,onClick:S,children:"Authored view"}):null]}),s("p",{className:"!m-0 px-2 py-1 text-muted tabular-nums","data-document-controls":!0,children:[a.length," supplied rows",v!==void 0&&v>g.length?` of ${v}; remaining rows not supplied`:"; dataset completeness unknown",". ",l?"Sorted view":"Original order",h?" \xB7 filtered":"",". Exports use the current view",c.size?" and selection":"","."]}),t("div",{className:"max-h-[60dvh] min-h-0 overflow-auto overscroll-contain",children:s("table",{className:"!m-0 w-full",children:[t("thead",{className:"sticky top-0 z-10 bg-surface",children:s("tr",{children:[t("th",{scope:"col",children:t("span",{className:"sr-only",children:"Select row"})}),y.map((e,o)=>t("th",{scope:"col","aria-sort":l?.column===o?l.descending?"descending":"ascending":"none",children:s("button",{type:"button",className:"w-full text-left",onClick:()=>{M(n=>({column:o,descending:n?.column===o&&!n.descending})),f(0)},children:[e,l?.column===o?l.descending?" \u2193":" \u2191":""]})},`${o}:${e}`))]})}),t("tbody",{children:U.map(({index:e})=>s("tr",{children:[t("td",{children:t("input",{type:"checkbox","aria-label":`Select supplied row ${e+1}`,checked:c.has(e),onChange:()=>w(o=>{let n=new Set(o);return n.has(e)?n.delete(e):n.add(e),n})})}),g[e].map((o,n)=>t("td",{children:o},`${e}:${n}`))]},e))})]})}),a.length>m?s("div",{className:"flex items-center justify-end gap-2 p-2","data-document-controls":!0,children:[t("button",{type:"button",className:r,disabled:!u,onClick:()=>f(u-1),children:"Previous"}),s("span",{className:"tabular-nums",children:["Page ",u+1," of ",Math.ceil(a.length/m)]}),t("button",{type:"button",className:r,disabled:(u+1)*m>=a.length,onClick:()=>f(u+1),children:"Next"})]}):null,L?t("p",{role:"status",className:"px-2 text-del",children:L}):null]});return t("div",{ref:$,className:"farero-ui",style:i?{height:j}:void 0,children:i?te(s("dialog",{ref:H,onCancel:()=>C(!1),"aria-label":"Table exploration",className:"farero-ui fixed inset-0 m-auto max-h-[90dvh] w-[96vw] max-w-6xl overflow-hidden overscroll-contain rounded-xl border border-border bg-bg p-0 text-text backdrop:bg-black/60",children:[t(A,{title:"Table",closeLabel:"Close fullscreen table",onClose:()=>C(!1)}),V]}),document.body):V})}b(oe,"DataTable");export{oe as a};
@@ -1,5 +0,0 @@
1
- import{a as B}from"./chunk-756GM57N.js";import{a as k,b as v}from"./chunk-ONVWTQLU.js";import{a as _,j as D}from"./chunk-WMKRKKIS.js";import{e as N}from"./chunk-RR7BB4EQ.js";import{b as W,c as z}from"./chunk-PCK4EJ7D.js";import{e as w,i as O}from"./chunk-YGPVIEBZ.js";import{a as H,c as $,g as y,h as b}from"./chunk-2FSGXRY6.js";import{d as I}from"./chunk-HGN4GN2E.js";import{a as S}from"./chunk-5SBKMKFB.js";import{a as s}from"./chunk-3I4YBQX6.js";function U(e,t=null){return e.startsWith("~/")||/^[A-Za-z]:[\\/]/.test(e)||t&&(e===t||e.startsWith(`${t}/`))?!0:e.startsWith("/Users/")||e.startsWith("/home/")||e.startsWith("/private/")}s(U,"isAbsoluteFilePath");function q(e){if(!e.startsWith("file://"))return null;let t=e.slice(7),n=t.startsWith("/")?t:t.startsWith("localhost/")?t.slice(9):null;return n?/^\/[A-Za-z]:[\\/]/.test(n)?n.slice(1):n:null}s(q,"fileUrlToLocalPath");var x="farero-attachment.invalid";function C(e){return`https://${x}/?path=${encodeURIComponent(e)}`}s(C,"attachmentHref");function E(e,t=!1){let n=H(e);for(let a=n.length-1;a>=0;a--){let l=n[a],u=n[a+1],c=u&&!e.slice(l.end,u.start).trim()?`
2
- ${e.slice(u.start)}`:e.slice(l.end),p=l.handoff.sources.at(-1).title.replace(/[\\`*_[\]<>]/g,"\\$&");e=`${e.slice(0,l.start)}[${p}](${$(l.handoff)})${c}`}let r=y(e);if(!r.length)return e;let i="",o=0;for(let a of r){if(i+=e.slice(o,a.start),!t||!/^Transcript of .+\.md$/.test(a.name)){let l=a.name.replace(/[\\`*_[\]<>]/g,"\\$&");i+=`[${l}](${C(a.path)})`}o=a.end}return i+e.slice(o)}s(E,"markdownSource");function Be(e){return/\.(?:md|markdown|mdown|mkd|mkdn)$/i.test(e)}s(Be,"isMarkdownFile");function G(e){let t="",n=s(r=>{for(let i of r)i.type==="text"?t+=i.value:i.type==="element"&&n(i.children)},"walk");return n(e.children),t.replace(/\n$/,"")}s(G,"fenceSource");function h(e){if(!e)return null;try{let t=new URL(e);return t.hostname===x?t.searchParams.get("path"):null}catch{return null}}s(h,"attachmentPath");function P(e){if(!e)return!1;try{let t=new URL(e,location.origin);return t.origin===location.origin&&t.pathname.startsWith("/w/")&&t.searchParams.has("handoff")&&!!t.searchParams.get("session")}catch{return!1}}s(P,"isChatHandoffHref");function T(e){let t=e&&(q(e)??e);if(!t?.startsWith("/")||!U(t))return null;let n=t.match(/:([1-9]\d*)(?::\d+)?$/),r=n?t.slice(0,-n[0].length):t;return b(r)?null:r.slice(r.lastIndexOf("/")+1).includes(".")?t:null}s(T,"sourceReference");function Ze(e){if(!e)return null;let t=e.split(/\r?\n/).filter(Boolean);if(t.length<2)return null;let n=t.map(T);return n.every(r=>r!==null)?n:null}s(Ze,"sourceReferences");function je({reference:e,external:t,externalPreview:n,button:r,metaKey:i,ctrlKey:o,shiftKey:a,altKey:l,defaultPrevented:u}){return u?"browser":r===0&&!i&&!o&&!a&&!l&&!e&&t&&n?"external-preview":e&&(r===0||r===1)?"preview":"browser"}s(je,"chatLinkAction");var le=/^[a-z0-9-]+(?:\.[a-z0-9-]+)+$/,ce=/^[\d.]+$/,ue=/(?:^|\.)(?:corp|example|home|home\.arpa|internal|intranet|invalid|lan|local|localhost|onion|private|test|ts\.net)$/;function Ye(e){let t;try{t=new URL(e).hostname}catch{return null}return!le.test(t)||ce.test(t)||ue.test(t)||t===location.hostname?null:`https://icons.duckduckgo.com/ip3/${t}.ico`}s(Ye,"linkFaviconUrl");function Je(e){return typeof e=="string"?e:Array.isArray(e)&&e.filter(n=>typeof n=="string").join("")||null}s(Je,"linkText");import{Children as de,isValidElement as Z}from"react";import{jsx as L,jsxs as X}from"react/jsx-runtime";function K(e){return typeof e=="string"&&!e.trim()}s(K,"isBlank");function pe(e){return Z(e)&&e.type==="br"}s(pe,"isLineBreak");function V(e){if(!Z(e))return null;let{href:t}=e.props;return typeof t!="string"?null:h(t)!==null||P(t)?t:null}s(V,"referenceHref");var j=s(({children:e,node:t,...n})=>{let r=de.toArray(e),i=[],o=[],a=[],l=0;for(let c=0;c<=r.length;c++){if(c<r.length&&!pe(r[c])){a.push(r[c]);continue}if(!a.every(p=>K(p)||V(p)))break;for(let p of a){let f=V(p);if(!f)continue;let m=h(f);m&&b(m)?i.push(p):o.push(p)}a=[],l=c+1}if(!i.length&&!o.length)return L("p",{...n,children:e});let u=r.slice(l);return X("p",{...n,children:[X("span",{className:S("flex flex-col gap-1",u.some(c=>!K(c))&&"mb-[0.5em]"),children:[i.length?L("span",{className:"flex flex-wrap items-start gap-2",children:i}):null,o.length?L("span",{className:"flex flex-wrap items-center gap-1.5",children:o}):null]}),u]})},"ChatParagraph");import{useCallback as fe,useEffect as me,useRef as Y,useState as ge}from"react";import{createPortal as he}from"react-dom";import{Fragment as ye,jsx as R,jsxs as J}from"react/jsx-runtime";var Q=s(({href:e,children:t,...n})=>{let[r,i]=ge(),o=Y(null),a=Y(null),l=fe(()=>{i(void 0),o.current?.focus({preventScroll:!0})},[]);return me(()=>{if(!r)return;a.current?.querySelector("button")?.focus({preventScroll:!0});let u=s(f=>{let m=f.target;!o.current?.contains(m)&&!a.current?.contains(m)&&i(void 0)},"dismiss"),c=s(f=>{f.key==="Escape"&&(f.preventDefault(),f.stopPropagation(),i(void 0),o.current?.focus({preventScroll:!0}))},"onEscape"),p=s(f=>{a.current?.contains(f.target)||i(void 0)},"scroll");return document.addEventListener("pointerdown",u),document.addEventListener("keydown",c,!0),document.addEventListener("scroll",p,!0),window.addEventListener("resize",l),()=>{document.removeEventListener("pointerdown",u),document.removeEventListener("keydown",c,!0),document.removeEventListener("scroll",p,!0),window.removeEventListener("resize",l)}},[r,l]),J(ye,{children:[R("a",{...n,ref:o,href:e,"aria-expanded":!!r,"aria-haspopup":"dialog",onClick:u=>{let c=u.currentTarget.closest(".md"),p=e?.slice(1),f=p?Array.from(c?.querySelectorAll("[id]")??[]).find(g=>g.id===p):void 0;if(!f)return;u.preventDefault();let m=f.cloneNode(!0);for(let g of m.querySelectorAll("[data-footnote-backref]"))g.remove();let F=u.currentTarget.getBoundingClientRect();i(g=>g?void 0:{text:m.textContent?.trim()??"",left:Math.max(8,Math.min(F.left,window.innerWidth-272)),top:Math.max(8,Math.min(F.bottom+6,window.innerHeight-208))})},children:t}),r?he(J("div",{ref:a,role:"dialog","aria-label":"Footnote","data-document-controls":!0,className:"farero-ui fixed z-50 max-h-48 w-64 max-w-[calc(100vw-1rem)] overflow-auto overscroll-contain rounded-lg border border-border bg-surface p-3 text-text text-xs shadow-xl",style:{left:r.left,top:r.top},children:[R("p",{className:"whitespace-pre-wrap",children:r.text}),R("a",{href:e,className:"mt-2 inline-block text-accent underline",onClick:()=>{let u=e?document.getElementById(e.slice(1)):null;for(let c=u?.closest("details");c;c=c.parentElement?.closest("details")??null)c.open=!0;i(void 0)},children:"Go to note"}),R("button",{type:"button",className:"ml-3 rounded px-1 text-muted",onClick:l,children:"Close"})]}),document.body):null]})},"FootnoteReference");import{useId as be,useMemo as ie}from"react";import xe from"react-markdown";import Ce from"remark-breaks";import Pe from"remark-gfm";import Re from"remark-math";function M({foldHeadings:e=!0}={}){return t=>{let n=s(r=>{for(let i of r){if(i.type!=="element")continue;let o=i.position?.start.offset;if(o!==void 0&&/^(h[1-6]|p|table|pre)$/.test(i.tagName)&&(i.properties["data-block-id"]=`b${o}`),i.tagName==="pre"){let a=i.children.find(l=>l.type==="element"&&l.tagName==="code");a?.type==="element"&&(i.properties["data-fence-complete"]=a.properties["data-fence-complete"])}n(i.children)}},"anchor");n(t.children),e&&(t.children=ee(t.children))}}s(M,"documentStructure");function ee(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(r.type!=="element"||!/^h[1-6]$/.test(r.tagName)){t.push(r);continue}let i=Number(r.tagName[1]),o=n+1;for(;o<e.length;){let l=e[o];if(l.type==="element"&&/^h[1-6]$/.test(l.tagName)&&Number(l.tagName[1])<=i)break;o++}let a={type:"element",tagName:"summary",properties:{},children:[r]};t.push({type:"element",tagName:"details",properties:{open:!0,"data-document-section":!0},children:[a,...ee(e.slice(n+1,o)).filter(l=>l.type!=="doctype")]}),n=o-1}return t}s(ee,"sections");function te(){let e="",t,n=!1;return s(function(){let i=this.parser;i&&(this.parser=(o,a)=>{let l,u=o.startsWith(e);u||(n=!1);let c=t&&u&&!n?t.children.slice(0,-2):[],p=t?.children[c.length],f=c.length?p?.position?.start:void 0;f?.offset!==void 0?(l=i(o.slice(f.offset),a),oe(l,f),l.children=[...c,...l.children]):l=i(o,a),!n&&l.children.slice(c.length).some(ne)&&(n=!0,c.length&&(l=i(o,a)));for(let m of l.children.slice(n?0:c.length))re(m,o);return e=o,t=l,l})},"plugin")}s(te,"incrementalMarkdown");function ne(e){return["definition","footnoteDefinition","linkReference","imageReference","footnoteReference"].includes(e.type)||e.type==="text"&&/\[[^\]\n]+\]/.test(e.value)?!0:(e.children??[]).some(ne)}s(ne,"hasReferences");function oe(e,t){if(e.position)for(let n of[e.position.start,e.position.end])n.line===1&&(n.column+=t.column-1),n.line+=t.line-1,n.offset!==void 0&&(n.offset+=t.offset??0);for(let n of e.children??[])oe(n,t)}s(oe,"shiftPositions");function re(e,t){if(e.type==="code"){let n=t.slice(e.position?.start.offset,e.position?.end.offset),r=n.match(/^ {0,3}(`{3,}|~{3,})/),i=n.slice(n.lastIndexOf(`
3
- `)+1).replace(/^\s*(?:>\s*)+/,"").trimStart(),o=!r||n.includes(`
4
- `)&&new RegExp(`^ {0,3}${r[1][0]}{${r[1].length},}[ \\t]*$`).test(i);e.data={...e.data,hProperties:{...e.data?.hProperties,"data-fence-complete":o?"true":"false"}}}for(let n of e.children??[])re(n,t)}s(re,"markFence");import{jsx as se}from"react/jsx-runtime";var we=[M],ke=[[M,{foldHeadings:!1}]],vt=s(({children:e,components:t,foldHeadings:n=!0,hideTranscriptAttachments:r=!1,onContextMenu:i})=>{let o=ie(()=>[Pe,[Re,{singleDollarTextMath:!1}],te(),Ce],[]),a=be(),l=ie(()=>({clobberPrefix:`note-${a}-`}),[a]);return se("div",{className:"md farero-ui",onContextMenu:i,children:se(xe,{remarkPlugins:o,rehypePlugins:n?we:ke,remarkRehypeOptions:l,components:t,children:E(e,r)})})},"MarkdownBody");import{MessageSquare as ve,Paperclip as Ne}from"lucide-react";import{lazy as Ee,Suspense as Te}from"react";import{jsx as d,jsxs as A}from"react/jsx-runtime";var Le=Ee(()=>import("./MathEquation-7ZVYQFEK.js")),Me=/^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;function ae(e){return e.startsWith("http://")||e.startsWith("https://")}s(ae,"isHttpUrl");function Ae(e){return typeof e=="string"?e:Array.isArray(e)&&e.every(t=>typeof t=="string")?e.join(""):null}s(Ae,"fenceText");var Fe=s(({href:e,children:t,onOpenFile:n,filePaths:r,node:i,...o})=>{if(i?.properties.dataFootnoteRef)return d(Q,{href:e,...o,children:t});if(!e)return d("span",{title:o.title,children:t});let a=h(e);if(a){let[u]=y(C(a)),c=u?u.name:a.slice(a.lastIndexOf("/")+1),p=[N(t??c),o.title,a].filter(Boolean).join(`
5
- `);return d("span",{title:a,className:k(),children:d(v,{icon:Ne,title:p,children:t??c})})}if(P(e))return d("span",{className:k(),children:d(v,{icon:ve,title:N(t),children:t})});let l=T(e)??(r?.includes(e)?e:null);return l?n?d("button",{type:"button",title:`Open ${l}`,onClick:()=>n(l),className:"inline select-text text-left text-accent underline decoration-accent/40 underline-offset-2 hover:decoration-accent focus-visible:outline-2 focus-visible:outline-accent",children:t}):d("code",{title:l,className:"text-accent underline decoration-dotted underline-offset-2",children:t}):ae(e)?d("a",{href:e,target:"_blank",rel:"noopener noreferrer",...o,children:t}):d("a",{href:e,...o,children:t})},"ReadonlyLink"),Se=s(({className:e,children:t,node:n,...r})=>{let i=w(e),o=Ae(t);return e?.includes("language-math")&&o!==null?d(Te,{fallback:d("code",{children:o}),children:d(Le,{source:o.replace(/\n$/,""),display:e.includes("math-display")})}):!e&&o!==null&&Me.test(o)?A("code",{...r,children:[d("span",{"aria-hidden":"true",style:{backgroundColor:o},className:"mr-1 inline-block size-[0.85em] shrink-0 translate-y-[0.1em] rounded-[3px] border border-black/25 dark:border-white/25"}),t]}):d("code",{className:e,...r,children:i&&o!==null?d(O,{text:o,language:i}):t})},"ReadonlyCode"),He=s(({src:e,alt:t,node:n,images:r,...i})=>{if(typeof e=="string"&&ae(e))return d("img",{src:e,alt:t??"",...i});let o=typeof e=="string"?r?.[e]:void 0;return o?d("img",{...i,src:o.src,width:o.width,height:o.height,alt:t??"",decoding:"async",className:"border border-border-soft"}):A("span",{className:"my-2 block rounded-lg border border-border-soft px-3 py-2 text-muted text-xs",children:[t||"Image"," unavailable in preview"]})},"ReadonlyImage"),$e=s(({node:e,children:t,...n})=>{let r=e?G(e):"",i=e?.children.find(c=>c.type==="element"&&c.tagName==="code"),o=i?.type==="element"?i.properties.className:void 0,a=_(o),l=e?.properties["data-fence-complete"]!=="false";if(r&&a&&l)return d("div",{children:d(D,{source:r,language:a},a)});let u=Array.isArray(o)?o.join(" "):typeof o=="string"?o:void 0;if(r&&!u?.includes("language-math")){let c=u?.match(/language-([\w+-]+)/)?.[1]?.toLowerCase()??"";return d(z,{source:r,language:w(u)??(c||null),kind:W(c,r),complete:l})}return A("div",{className:"group relative my-3 overflow-hidden rounded-xl border border-border-soft bg-bg",children:[d("pre",{...n,className:"!m-0 !rounded-none !border-0 overflow-x-auto overscroll-x-contain",children:t}),r?d("div",{className:"absolute top-1 right-1 rounded-md border border-border-soft bg-bg/90 opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100",children:d(I,{text:r,label:"code",size:12,className:"size-6 rounded-md"})}):null]})},"ReadonlyPre");function Oe(e={}){let{onOpenFile:t,filePaths:n,images:r}=e;return{a:s(a=>d(Fe,{...a,onOpenFile:t,filePaths:n}),"link"),code:Se,img:s(a=>d(He,{...a,images:r}),"image"),p:j,pre:$e,table:B}}s(Oe,"createReadonlyComponents");var Kt=Oe();export{U as a,q as b,x as c,C as d,E as e,Be as f,G as g,h,P as i,T as j,Ze as k,je as l,Ye as m,Je as n,j as o,Q as p,vt as q,Oe as r,Kt as s};