{"version":3,"file":"CodeBlock.HTOgGxQS.mjs","names":["_Fragment"],"sources":["https:/framerusercontent.com/modules/eqSKrCPdXOhpjVpjEv2r/1mgs3tSIVA5wdKOHeAGy/CodeBlock.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect}from\"react\";/**\n * CodeBlock — SQL or any code, exactly as typed: straight quotes, indents,\n * line numbers, comments in a quieter colour, and marked lines. Native text\n * in Framer turns ' into curly quotes, which breaks code; this does not.\n *\n * Comments start with \"--\" or \"//\" and run to the end of the line.\n * Line Name and Mark Name label every line and the marked part, so the site's\n * motion engine can play them (Term Line / Term Hi, SQL Line).\n *\n * @framerDisableUnlink\n * @framerIntrinsicWidth 560\n * @framerIntrinsicHeight 200\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n */const FAMILY=\"Snout Body\";const GOOGLE=\"https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Fragment+Mono&display=swap\";const tok=v=>v&&typeof v===\"object\"&&\"value\"in v?v.value:v;// mirror of the loader in Logit/code/RowType.tsx — Framer takes no imports between code files\nfunction loadWideArchivo(){const w=window;if(w.__snoutBody)return w.__snoutBody;w.__snoutBody=fetch(GOOGLE).then(r=>r.text()).then(css=>{const s=document.createElement(\"style\");s.setAttribute(\"data-snoutbody\",\"\");s.textContent=css.replace(/font-family:\\s*'Geist'/g,`font-family: '${FAMILY}'`);document.head.appendChild(s);}).catch(()=>{}).then(()=>Promise.all([document.fonts.load(`800 expanded 90px \"${FAMILY}\"`),document.fonts.load(`800 condensed 50px \"${FAMILY}\"`),document.fonts.load(`800 90px \"${FAMILY}\"`)])).catch(()=>{}).then(()=>document.fonts.ready).then(()=>undefined);return w.__snoutBody;}export default function CodeBlock(props){const{code,numbers,marked,size,lineHeight,scroll,lineName,markName,style}=props;const ink=tok(props.ink)||\"#000000\";const comment=tok(props.comment)||\"#6B6D65\";const num=tok(props.number)||\"#6B6D65\";const mark=tok(props.mark)||\"#FFE53B\";const markInk=tok(props.markInk)||\"#000000\";const marks=new Set((marked||\"\").split(/[\\s,]+/).map(s=>parseInt(s,10)).filter(n=>n>0));const lines=(code||\"\").replace(/\\r/g,\"\").split(/\\n|\\\\n/);const digits=String(lines.length).length;useEffect(()=>{loadWideArchivo();},[]);return /*#__PURE__*/_jsx(\"div\",{style:{fontFamily:'\"Fragment Mono\", ui-monospace, SFMono-Regular, Menlo, Consolas, \"Liberation Mono\", monospace',fontSize:size,lineHeight,color:ink,overflowX:scroll?\"auto\":\"hidden\",...style},children:lines.map((line,i)=>{const n=i+1;const cut=line.search(/--|\\/\\//);const body=cut>=0?line.slice(0,cut):line;const rest=cut>=0?line.slice(cut):\"\";const isMark=marks.has(n);return /*#__PURE__*/_jsxs(\"div\",{\"data-framer-name\":lineName||undefined,style:{display:\"flex\",gap:\"0 16px\",whiteSpace:\"pre\"},children:[numbers&&/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{color:num,textAlign:\"right\",minWidth:digits+\"ch\",userSelect:\"none\",flex:\"none\"},children:n}),/*#__PURE__*/_jsxs(\"span\",{children:[isMark?/*#__PURE__*/_jsxs(\"span\",{\"data-framer-name\":markName||undefined,style:{background:mark,color:markInk},children:[body,rest&&/*#__PURE__*/_jsx(\"span\",{children:rest})]}):/*#__PURE__*/_jsxs(_Fragment,{children:[body,rest&&/*#__PURE__*/_jsx(\"span\",{style:{color:comment},children:rest})]}),line===\"\"?\"​\":null]})]},i);})});}CodeBlock.displayName=\"Code Block\";CodeBlock.defaultProps={code:\"-- Repeat orders by region\\nselect r.name as region, count(*)\\nfrom orders o\\nwhere o.is_repeat\\ngroup by 1;\",numbers:true,marked:\"\",size:12.5,lineHeight:1.72,scroll:true,ink:\"#000000\",comment:\"#6B6D65\",number:\"#6B6D65\",mark:\"#FFE53B\",markInk:\"#000000\",lineName:\"\",markName:\"\"};addPropertyControls(CodeBlock,{code:{type:ControlType.String,title:\"Code\",displayTextArea:true},numbers:{type:ControlType.Boolean,title:\"Line Numbers\"},marked:{type:ControlType.String,title:\"Marked Lines\",description:\"Line numbers to mark, comma-separated.\"},size:{type:ControlType.Number,title:\"Size\",min:8,max:24,step:.5,unit:\"px\"},lineHeight:{type:ControlType.Number,title:\"Line Height\",min:1,max:2.4,step:.01},scroll:{type:ControlType.Boolean,title:\"Scroll\",description:\"Long lines scroll sideways instead of being cut off.\"},ink:{type:ControlType.Color,title:\"Text\"},comment:{type:ControlType.Color,title:\"Comments\"},number:{type:ControlType.Color,title:\"Numbers\"},mark:{type:ControlType.Color,title:\"Mark\"},markInk:{type:ControlType.Color,title:\"Mark Text\"},lineName:{type:ControlType.String,title:\"Line Name\",description:\"Name for each line, for the motion engine (e.g. Term Line).\"},markName:{type:ControlType.String,title:\"Mark Name\",description:\"Name for the marked part (e.g. Term Hi).\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CodeBlock\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CodeBlock.map"],"mappings":"4LAeA,SAAS,GAAiB,CAAC,IAAM,EAAE,EAAiiB,MAAvhB,CAAmC,EAAE,cAAY,MAAM,CAAM,CAAC,CAAC,KAAK,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,GAAK,CAAC,IAAM,EAAE,SAAS,cAAc,OAAO,EAAE,EAAE,aAAa,iBAAiB,EAAE,EAAE,EAAE,YAAY,EAAI,QAAQ,0BAA0B,iBAAiB,EAAO,EAAE,EAAE,SAAS,KAAK,YAAY,CAAC,CAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,QAAQ,IAAI,CAAC,SAAS,MAAM,KAAK,sBAAsB,EAAO,EAAE,EAAE,SAAS,MAAM,KAAK,uBAAuB,EAAO,EAAE,EAAE,SAAS,MAAM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