PageSourceSearch

https://land2home.lovable.app/assets/PlanViewer-DIxa3Sr0.js

js land2home.lovable.app collected 2026-10-03 03:35:59 UTC 5,436 bytes, 7 lines download raw bytes

1import{c as I,u as T,r,j as e,v as V,I as M,X as R,Z as b,a6 as _,G as A,a as j}from"./index-7mkuvndX.js";import{R as g}from"./refresh-cw-B1B6mppY.js";import{M as B}from"./index-9HJm3DnR.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const v=I("Book",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]);function E(a){const n=a.split(`
7`),d=[];let i=!1;for(const x of n){if(x.trim().startsWith("```")){i=!i;continue}if(i)continue;const c=x.match(/^(#{1,4})\s+(.+)/);if(c){const p=c[2].replace(/[*_`]/g,"").trim(),o=p.toLowerCase().replace(/[^\w\s-áéíóúñü]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-");d.push({level:c[1].length,text:p,id:o})}}return d}const N=15e3,O=()=>{const{t:a}=T(),[n,d]=r.useState(""),[i,x]=r.useState(!0),[c,p]=r.useState(null),[o,f]=r.useState(""),[k,y]=r.useState(""),[w,C]=r.useState(!0),m=r.useCallback(async()=>{try{const s=await fetch(`/plan.md?t=${Date.now()}`);if(s.ok){const t=await s.text();d(t),p(new Date)}}catch{}finally{x(!1)}},[]);r.useEffect(()=>{m();const s=setInterval(m,N);return()=>clearInterval(s)},[m]);const h=r.useMemo(()=>E(n),[n]),S=r.useMemo(()=>{if(!o)return h;const s=o.toLowerCase();return h.filter(t=>t.text.toLowerCase().includes(s))},[h,o]),L=s=>{y(s);const t=document.getElementById(s);t&&t.scrollIntoView({behavior:"smooth",block:"start"})};return i?e.jsx("div",{className:"flex items-center justify-center min-h-screen bg-background",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx(g,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{children:a("planViewer.loading")})]})}):e.jsxs("div",{className:"flex h-[calc(100vh-7rem)] bg-background",children:[w&&e.jsxs("aside",{className:"w-72 lg:w-80 border-r border-border flex flex-col bg-card shrink-0",children:[e.jsxs("div",{className:"p-4 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(v,{className:"h-4 w-4 text-primary"}),e.jsx("h2",{className:"text-sm font-semibold text-foreground",children:a("planViewer.tocTitle")})]}),e.jsxs("div",{className:"relative",children:[e.jsx(V,{className:"absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground"}),e.jsx(M,{placeholder:a("planViewer.searchPlaceholder"),value:o,onChange:s=>f(s.target.value),className:"pl-8 h-8 text-xs"}),o&&e.jsx("button",{onClick:()=>f(""),className:"absolute right-2 top-2 text-muted-foreground hover:text-foreground",children:e.jsx(R,{className:"h-3.5 w-3.5"})})]})]}),e.jsx(b,{className:"flex-1",children:e.jsx("nav",{className:"p-3 space-y-0.5",children:S.map((s,t)=>e.jsx("button",{onClick:()=>L(s.id),className:_("w-full text-left px-2 py-1.5 rounded-md text-xs transition-colors hover:bg-accent",s.level===1&&"font-bold text-foreground",s.level===2&&"pl-4 font-semibold text-foreground/90",s.level===3&&"pl-7 text-muted-foreground",s.level===4&&"pl-10 text-muted-foreground/80",k===s.id&&"bg-primary/10 text-primary"),children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[s.level>1&&e.jsx(A,{className:"h-2.5 w-2.5 shrink-0"}),e.jsx("span",{className:"line-clamp-2",children:s.text})]})},`${s.id}-${t}`))})}),c&&e.jsxs("div",{className:"p-3 border-t border-border text-[10px] text-muted-foreground flex items-center gap-1.5",children:[e.jsx(g,{className:"h-3 w-3"}),a("planViewer.updatedAt")," ",c.toLocaleTimeString(),e.jsx("span",{className:"ml-auto opacity-60",children:a("planViewer.autoRefresh",{seconds:N/1e3})})]})]}),e.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border bg-card",children:[e.jsx(j,{variant:"ghost",size:"sm",onClick:()=>C(!w),className:"h-7 w-7 p-0",children:e.jsx(v,{className:"h-3.5 w-3.5"})}),e.jsxs("h1",{className:"text-sm font-semibold text-foreground truncate",children:["📋 ",a("planViewer.pageTitle")]}),e.jsxs(j,{variant:"ghost",size:"sm",onClick:m,className:"ml-auto h-7 px-2 text-xs",children:[e.jsx(g,{className:"h-3 w-3 mr-1"}),a("planViewer.refresh")]})]}),e.jsx(b,{className:"flex-1",children:e.jsx("article",{className:"max-w-4xl mx-auto px-6 md:px-10 py-8 prose prose-sm dark:prose-invert prose-headings:scroll-mt-20 prose-h1:text-2xl prose-h2:text-xl prose-h3:text-lg prose-h4:text-base prose-table:text-xs prose-pre:text-xs prose-pre:bg-muted prose-pre:border prose-pre:border-border",children:e.jsx(B,{components:{h1:({children:s,...t})=>{const l=String(s).replace(/[*_`]/g,"").trim().toLowerCase().replace(/[^\w\s-áéíóúñü]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-");return e.jsx("h1",{id:l,...t,children:s})},h2:({children:s,...t})=>{const l=String(s).replace(/[*_`]/g,"").trim().toLowerCase().replace(/[^\w\s-áéíóúñü]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-");return e.jsx("h2",{id:l,...t,children:s})},h3:({children:s,...t})=>{const l=String(s).replace(/[*_`]/g,"").trim().toLowerCase().replace(/[^\w\s-áéíóúñü]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-");return e.jsx("h3",{id:l,...t,children:s})},h4:({children:s,...t})=>{const l=String(s).replace(/[*_`]/g,"").trim().toLowerCase().replace(/[^\w\s-áéíóúñü]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-");return e.jsx("h4",{id:l,...t,children:s})}},children:n})})})]})]})};export{O as default};

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.