import{r as o,j as e,R as c}from"./react-D_B_5QVd.js";import{B as l}from"./index-BdwitBZy.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const i=["funtion","functoin","funciton","contructor","cosntructor","consle","conosle","cosnole","varable","varaible","vairable","docment","docuemnt","docmunet","componnet","componenet","compnent","retunr","retrun","asnyc","asycn","awai","awiat","promse","resolv","rejct","catach","thne","lenght","lengt","prperty","undefinded","nul","booleon","numbar","srtring","arrya","objcet","elemnt","attriubte","eveent","listner","handeler","clieck","submitt","resposne","requset","stauts","eror","sucess","implemnt","overide","extned","pbulic","prvate","procted","statci","abstact","interace","enmu","moduel","packge","importt","exprot","defualt","namspace","tyep","clsas","whiel","swich","cse","brek","contiune","thrwo","finnaly"],r=new RegExp(`\\b(${i.join("|")})\\b`,"gi"),m=c.memo(({text:t})=>{const s=o.useMemo(()=>t.split(r).map((n,a)=>r.test(n)?e.jsx("span",{className:"underline decoration-red-500 decoration-wavy",title:"Possible typo",children:n},a):n),[t]);return e.jsx(e.Fragment,{children:s})}),y=()=>{const[t,s]=o.useState(`funtion myFunction() { consle.log("Hello World"); const myVarable = docment.getElementById("root"); // This is a React componnet }`);return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8 text-text-primary",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl flex items-center",children:[e.jsx(l,{}),e.jsx("span",{className:"ml-3",children:"Code Spell Checker"})]}),e.jsx("p",{className:"text-text-secondary mt-1",children:"A simple tool that finds and highlights common typos in code."})]}),e.jsxs("div",{className:"relative flex-grow font-mono text-sm bg-surface border border-border rounded-lg p-4 overflow-auto",children:[e.jsx("textarea",{value:t,onChange:n=>s(n.target.value),className:"absolute inset-0 w-full h-full p-4 bg-transparent text-transparent caret-primary resize-none z-10",spellCheck:"false"}),e.jsx("pre",{className:"absolute inset-0 w-full h-full p-4 pointer-events-none whitespace-pre-wrap","aria-hidden":"true",children:e.jsx(m,{text:t})})]}),e.jsx("p",{className:"text-xs text-text-secondary mt-2 text-center",children:"This checker uses a predefined list of common typos and does not use AI."})]})};export{y as CodeSpellChecker}; //# sourceMappingURL=CodeSpellChecker-CjNFapKd.js.map