1import{j as n}from"./app-C1iegf7Q.js";import{b as x}from"./inertia-BpyZy4w-.js";import{M as j,r as g}from"./index-DnOwzyLg.js";/* empty css */const b=x.createContext({});function W({titles:t,children:e}){return n.jsx(b.Provider,{value:t,children:e})}function L({body:t,streaming:e=!1,onAnchorClick:r}){const a=x.useContext(b);return t?n.jsx("div",{className:"agent-md",children:n.jsx(j,{remarkPlugins:[g],allowedElements:$,unwrapDisallowed:!0,components:y(e,r,a),children:t})}):e?n.jsx("p",{className:"agent-md-streaming",children:n.jsx("span",{className:"stream-cursor","aria-hidden":!0,children:"â"})}):null}const $=["p","br","strong","em","del","code","pre","a","ul","ol","li","blockquote","h1","h2","h3","h4","h5","h6","hr","table","thead","tbody","tr","th","td"];function y(t,e,r){return{p:({children:a})=>n.jsx("p",{children:p(a,e,r)}),li:({children:a})=>n.jsx("li",{children:p(a,e,r)}),a:({href:a,children:o,...i})=>n.jsx("a",{...i,href:E(a),target:"_blank",rel:"noopener noreferrer",children:o}),pre:a=>n.jsx("pre",{className:"agent-md-pre",...a}),...t?{}:{}}}function p(t,e,r){return typeof t=="string"?h(t,e,r):Array.isArray(t)?t.map((a,o)=>typeof a=="string"?n.jsx("span",{children:h(a,e,r)},o):a):t}function h(t,e,r){return t.split(/(\[(?:ref|doc):[A-Za-z0-9._-]+\])/g).map((o,i)=>{const m=o.match(/^\[ref:([A-Za-z0-9._-]+)\]$/);if(m){const c=m[1],l=`criterion-${c}`,s=r[c],d=s?v(s):c,f=s?`Criterion ${c} â ${s}`:`Criterion ${c}`;return e?n.jsx("button",{type:"button",className:"agent-md-ref",title:f,onClick:()=>e(l),children:d},i):n.jsx("span",{className:"agent-md-ref",title:f,children:d},i)}const u=o.match(/^\[doc:([A-Za-z0-9._-]+)\]$/);if(u){const c=u[1],{anchor:l,label:s}=N(c);return e?n.jsx("button",{type:"button",className:"agent-md-doc",onClick:()=>e(l),title:`Open ${s} in workspace`,children:s},i):n.jsx("span",{className:"agent-md-doc",children:s},i)}return n.jsx("span",{children:o},i)})}function v(t,e=28){const r=t.trim();return r.length<=e?r:`${r.slice(0,e-1).trimEnd()}â¦`}function N(t){if(t==="cv")return{anchor:"document-cv-1",label:"your CV"};if(t==="draft"||t==="personal_statement")return{anchor:"draft-personal_statement",label:"your personal statement"};if(t==="strategy")return{anchor:"strategy",label:"your strategy"};const e=t.match(/^evidence-(\d+)$/);if(e)return{anchor:`document-evidence-${e[1]}`,label:`evidence #${e[1]}`};const r=t.match(/^referee-(\d+)$/);return r?{anchor:`document-reference_letters-${r[1]}`,label:`referee #${r[1]}`}:{anchor:t,label:t}}function E(t){if(!t)return"#";const e=t.trim().toLowerCase();return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("mailto:")||e.startsWith("/")||e.startsWith("#")?t:"#"}export{L as AgentMarkdown,W as CriteriaTitleProvider};
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.