{
  "version": 3,
  "sources": ["ssg:https://framer.com/m/framer/store.js@^1.0.0", "ssg:https://framerusercontent.com/modules/4V4IN33efgPjQLJmwIax/JneZmAtTTkzOYePMdf3K/MarkdownTable.js"],
  "sourcesContent": ["import{useState,useEffect}from\"react\";import{Data,useObserveData}from\"framer\";export function createStore(state1){// Use Data so that a Preview reload resets the state\nconst dataStore=Data({state:Object.freeze({...state1})});// Create a set function that updates the state\nconst setDataStore=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(dataStore.state);}dataStore.state=Object.freeze({...dataStore.state,...newState});};// Store the initial state, copy the object if it's an object\nlet storeState=typeof state1===\"object\"?Object.freeze({...state1}):state1;// Keep a list of all the listeners, in the form of React hook setters\nconst storeSetters=new Set();// Create a set function that updates all the listeners / setters\nconst setStoreState=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(storeState);}storeState=typeof newState===\"object\"?Object.freeze({...storeState,...newState}):newState;// Update all the listeners / setters with the new value\nstoreSetters.forEach(setter=>setter(storeState));};// Create the actual hook based on everything above\nfunction useStore(){// Create the hook we are going to use as a listener\nconst[state,setState]=useState(storeState);// If we unmount the component using this hook, we need to remove the listener\n// @ts-ignore\nuseEffect(()=>{// But right now, we need to add the listener\nstoreSetters.add(setState);return()=>storeSetters.delete(setState);},[]);// If Data context exists, use Data, otherwise use vanilla React state\nif(useObserveData()===true){useObserveData();return[dataStore.state,setDataStore];}else{// Return the state and a function to update the central store\nreturn[state,setStoreState];}}return useStore;}\nexport const __FramerMetadata__ = {\"exports\":{\"createStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./createStore.map", "import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";const useStore=createStore({background:\"#ff00ff\"});const cellBackground=\"#FFF\";const headerBackground=\"rgba(0,0,0,0.05)\";const textColor=\"#14141f\";const borderColor=\"rgba(0,0,0,0.2)\";export function TableOverride(Component){return props=>{const[store]=useStore();const extractAndFormatTable=React.useCallback(()=>{const contentDivs=document.querySelectorAll('[data-framer-component-type=\"RichTextContainer\"]');contentDivs.forEach(contentDiv=>{const codeBlocks=contentDiv.querySelectorAll(\".framer-text.framer-text-module\");codeBlocks.forEach(codeBlock=>{if(codeBlock instanceof HTMLElement){// Ensure codeBlock has content before proceeding\nif(!codeBlock.textContent||codeBlock.textContent.trim()===\"\"){return;// Skip if no content is present\n}// Get the framer-cb div to access CSS variables\nconst framerCbDiv=codeBlock.querySelector(\".framer-cb\");if(!framerCbDiv)return;// Extract CSS variables from the style attribute\nconst styleAttr=framerCbDiv.getAttribute(\"style\")||\"\";const cssVars={};styleAttr.split(\";\").forEach(pair=>{const[key,value]=pair.split(\":\").map(s=>s.trim());if(key.startsWith(\"--\")){cssVars[key]=value;}});// Determine if we're in light or dark mode\nconst colorScheme=cssVars[\"--cb-color-scheme-dark\"]===\"light\"?\"light\":\"dark\";// Find the div with the border (sp-layout)\nconst borderDiv=codeBlock.querySelector(\".sp-layout\");if(!borderDiv)return;// Extract the border properties and padding from the style attribute\nconst borderStyle=window.getComputedStyle(borderDiv);const borderWidth=borderStyle.borderWidth;const borderRadius=borderStyle.borderRadius;const padding=borderStyle.getPropertyValue(\"--cb-padding\")||\"27px\"// Default to 27px if not set\n;// Create an outer container for the border\nconst outerContainer=document.createElement(\"div\");outerContainer.style.cssText=`\n                            border: ${borderWidth} solid ${borderColor};\n                            border-radius: ${borderRadius};\n                            overflow: hidden;\n                            width: 100%;\n                            height: 100%;\n                        `;// Create an inner container for the scrollable content\nconst innerContainer=document.createElement(\"div\");innerContainer.style.cssText=`\n                            overflow: auto;\n                            width: 100%;\n                            height: 100%;\n                        `;// Create the table\nconst table=document.createElement(\"table\");table.style.cssText=`\n                            border-collapse: separate;\n                            border-spacing: 0;\n                            width: 100%;\n                            min-width: 600px;\n                        `;// Convert extracted content to HTML table\nconst codeContent=codeBlock.textContent||\"\";const tableLines=codeContent.split(/\\r?\\n/).filter(line=>line.trim()!==\"\");const tableHtml=tableLines.map((row,index)=>{const cells=row.split(\"|\").map(cell=>cell.trim()).filter(cell=>cell!==\"\");if(index===0){return`<tr>${cells.map((cell,cellIndex)=>`<th${cellIndex===0?' class=\"first-column\"':\"\"}>${cell}</th>`).join(\"\")}</tr>`;}else if(index===1){return\"\"// Skip the separator row\n;}else{return`<tr>${cells.map((cell,cellIndex)=>`<td${cellIndex===0?' class=\"first-column\"':\"\"}>${cell.replace(/\\<br\\>/g,\"<br>\")}</td>`).join(\"\")}</tr>`;}}).filter(row=>row!==\"\").join(\"\");table.innerHTML=`\n                            <table style=\"width: 100%; border-collapse: separate; border-spacing: 0;\">\n                                ${tableHtml}\n                            </table>\n                        `;// Add styles\nconst style=document.createElement(\"style\");style.textContent=`\n                            table th, table td {\n                                padding: ${padding};\n                                text-align: left;\n                                color: ${textColor};\n                                border-right: 1px solid ${borderColor};\n                                border-bottom: 1px solid ${borderColor};\n                                word-break: normal;\n                            }\n                            table td {\n                                background-color: ${cellBackground};\n                            }\n                            table th {\n                                font-weight: bold;\n                                background: ${headerBackground};\n                                position: sticky;\n                                top: 0;\n                                z-index: 1;\n                            }\n                            .first-column {\n                                // white-space: nowrap;\n                                // overflow: hidden;\n                                // text-overflow: ellipsis;\n                            }\n                            table tr:last-child td {\n                                border-bottom: none;\n                            }\n                            table th:last-child,\n                            table td:last-child {\n                                border-right: none;\n                            }\n                        `;outerContainer.appendChild(style);// Assemble the structure\ninnerContainer.appendChild(table);outerContainer.appendChild(innerContainer);// Replace the content of the code block with the new structure\ncodeBlock.innerHTML=\"\";codeBlock.appendChild(outerContainer);}});});},[store.background]);React.useEffect(()=>{extractAndFormatTable();// Add a MutationObserver to handle dynamic content changes\nconst observer=new MutationObserver(extractAndFormatTable);const contentDivs=document.querySelectorAll('[data-framer-name=\"MarkdownTable\"] > [data-framer-component-type=\"RichTextContainer\"]');contentDivs.forEach(contentDiv=>{observer.observe(contentDiv,{childList:true,subtree:true});});// Remove white-space: pre-wrap from the Content div\nconst style=document.createElement(\"style\");style.textContent=`\n                [data-framer-name=\"MarkdownTable\"] > [data-framer-component-type=\"RichTextContainer\"] {\n                    white-space: normal !important;\n                }\n                [data-framer-name=\"MarkdownTable\"] > [data-framer-component-type=\"RichTextContainer\"] > div {\n                    white-space: normal !important;\n                }\n            `;document.head.appendChild(style);return()=>{observer.disconnect();document.head.removeChild(style);};},[extractAndFormatTable]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"TableOverride\":{\"type\":\"reactHoc\",\"name\":\"TableOverride\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MarkdownTable.map"],
  "mappings": "uJAAqF,SAASA,EAAYC,EAAO,CACjH,IAAMC,EAAUC,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAGF,CAAM,CAAC,CAAC,CAAC,EACjDG,EAAaC,GAAU,CAC1B,OAAOA,GAAW,aAAYA,EAASA,EAASH,EAAU,KAAK,GAAGA,EAAU,MAAM,OAAO,OAAO,CAAC,GAAGA,EAAU,MAAM,GAAGG,CAAQ,CAAC,CAAE,EACjIC,EAAW,OAAOL,GAAS,SAAS,OAAO,OAAO,CAAC,GAAGA,CAAM,CAAC,EAAEA,EAC7DM,EAAa,IAAI,IACjBC,EAAcH,GAAU,CAC3B,OAAOA,GAAW,aAAYA,EAASA,EAASC,CAAU,GAAGA,EAAW,OAAOD,GAAW,SAAS,OAAO,OAAO,CAAC,GAAGC,EAAW,GAAGD,CAAQ,CAAC,EAAEA,EACjJE,EAAa,QAAQE,GAAQA,EAAOH,CAAU,CAAC,CAAE,EACjD,SAASI,GAAU,CACnB,GAAK,CAACC,EAAMC,CAAQ,EAAEC,EAASP,CAAU,EAIzC,OAFAQ,EAAU,KACVP,EAAa,IAAIK,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AAA;AAAA;AAAA;AAAA;AAAA,0BAiBpCyB,EAAe,YAAYU,CAAK,EAC1DT,EAAe,YAAYC,CAAK,EAAEF,EAAe,YAAYC,CAAc,EAC3EhB,EAAU,UAAU,GAAGA,EAAU,YAAYe,CAAc,CAAE,CAAC,CAAC,CAAE,CAAC,CAAE,EAAE,CAACnB,EAAM,UAAU,CAAC,EAAE,OAAM8B,EAAU,IAAI,CAAC7B,EAAsB,EACrI,IAAM8B,EAAS,IAAI,iBAAiB9B,CAAqB,EAAoB,SAAS,iBAAiB,uFAAuF,EAAc,QAAQE,GAAY,CAAC4B,EAAS,QAAQ5B,EAAW,CAAC,UAAU,GAAK,QAAQ,EAAI,CAAC,CAAE,CAAC,EAC7R,IAAM0B,EAAM,SAAS,cAAc,OAAO,EAAE,OAAAA,EAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAOhD,SAAS,KAAK,YAAYA,CAAK,EAAQ,IAAI,CAACE,EAAS,WAAW,EAAE,SAAS,KAAK,YAAYF,CAAK,CAAE,CAAE,EAAE,CAAC5B,CAAqB,CAAC,EAAsB+B,EAAKlC,EAAU,CAAC,GAAGC,CAAK,CAAC,CAAE,CAAE",
  "names": ["createStore", "state1", "dataStore", "Data", "setDataStore", "newState", "storeState", "storeSetters", "setStoreState", "setter", "useStore", "state", "setState", "ye", "ue", "useObserveData", "useStore", "createStore", "cellBackground", "headerBackground", "textColor", "borderColor", "TableOverride", "Component", "props", "store", "extractAndFormatTable", "te", "contentDiv", "codeBlock", "framerCbDiv", "styleAttr", "cssVars", "pair", "key", "value", "s", "colorScheme", "borderDiv", "borderStyle", "window", "borderWidth", "borderRadius", "padding", "outerContainer", "innerContainer", "table", "tableHtml", "line", "row", "index", "cells", "cell", "cellIndex", "style", "ue", "observer", "p"]
}
