1import{r as i,j as e}from"./index-Bx5zKZla.js";import{g as m}from"./LandingPage-UOdvPSYF.js";import"./accordion-D3vmm_ML.js";import"./index-Dp3b-ot_.js";import"./index-B-Hrw_6V.js";import"./chevron-down-Cudi7XHl.js";import"./SeoHead-C_DhxIi0.js";import"./BrandLogo-EmTXoLyB.js";import"./search-C0Dxc_zm.js";import"./layout-grid-QkOtN1sW.js";import"./file-text-RD0TgmGP.js";import"./folder-open-C837neoh.js";import"./VaultyCallout-BMkWaPVv.js";import"./Vaulty-D7MMqg0k.js";import"./check-Da0Q540f.js";const v=[{id:"art",kind:"Article",title:"The Internet Is Rotting",source:"theatlantic.com",url:"https://www.theatlantic.com/technology/archive/2021/06/the-internet-is-rotting/619827/",collection:"Research",excerpt:"Links break. Pages vanish. Citations point at nothing. A captured copy keeps the words you meant to keep.",captured:"12 Mar 2024"},{id:"vid",kind:"Video",title:"How Link Rot Breaks the Web",source:"youtube.com · Veritasium",url:"https://www.youtube.com/watch?v=example-link-rot",collection:"Watch later",excerpt:"Video record archived in your vault, still openable when the live page or embed is gone.",captured:"4 Jun 2024"},{id:"pdf",kind:"PDF",title:"Attention Is All You Need",source:"arxiv.org · Vaswani et al.",url:"https://arxiv.org/pdf/1706.03762",collection:"Papers",excerpt:"Saved from the URL into your vault so the paper stays findable beside your notes and tags.",captured:"18 Jan 2025"}];function G(){const[h,u]=i.useState(!1),[r,k]=i.useState([]),[_,y]=i.useState(null),[n,p]=i.useState(null),[j,o]=i.useState(!1),d=i.useRef(null),w=i.useRef(!1);i.useEffect(()=>{w.current=window.matchMedia("(prefers-reduced-motion: reduce)").matches},[]);const b=t=>{const l=r.includes(t.id);if(u(!0),y(t.id),p(null),o(!1),l||k(f=>[...f,t.id]),l||w.current||!d.current)return;const a=d.current.querySelector(`[data-chip="${t.id}"]`),c=d.current.querySelector(".lg-vault__mouth");if(!a||!c)return;const x=a.getBoundingClientRect(),g=c.getBoundingClientRect(),I=g.left+g.width/2-(x.left+x.width/2),T=g.top+g.height/2-(x.top+x.height/2);m.fromTo(a,{x:0,y:0,scale:1,opacity:1},{x:I,y:T,scale:.35,opacity:0,duration:.55,ease:"power3.in",onComplete:()=>{var N;m.set(a,{clearProps:"all"});const f=(N=d.current)==null?void 0:N.querySelector(".lg-vault__pulse");f&&m.fromTo(f,{scale:.6,opacity:.7},{scale:1.4,opacity:0,duration:.55,ease:"power2.out"})}})},S=(t,l)=>{if(r.includes(l.id)){t.preventDefault();return}t.dataTransfer.setData("text/plain",l.id),t.dataTransfer.effectAllowed="move",p(l.id),u(!0)},D=()=>{p(null),o(!1)},R=t=>{n&&(t.preventDefault(),t.dataTransfer.dropEffect="move",o(!0))},C=t=>{t.currentTarget.contains(t.relatedTarget)||o(!1)},A=t=>{t.preventDefault();const l=t.dataTransfer.getData("text/plain")||n,a=v.find(c=>c.id===l);a&&b(a),o(!1),p(null)},$=v.filter(t=>!r.includes(t.id)).length===0,s=v.find(t=>t.id===_)??null;return e.jsxs("div",{ref:d,className:"lg-vault",children:[e.jsxs("div",{className:"lg-vault__stage",children:[e.jsx("div",{className:`lg-vault__drop${j?" is-ready":""}${n?" is-dragging":""}`,onDragOver:R,onDragLeave:C,onDrop:A,children:e.jsxs("button",{type:"button",className:`lg-vault__btn${h?" is-open":""}`,onClick:()=>u(t=>!t),"aria-expanded":h,"aria-label":h?"Close vault":"Open vault",children:[e.jsxs("svg",{className:"lg-vault__svg",viewBox:"0 0 320 280",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:[e.jsx("ellipse",{cx:"160",cy:"252",rx:"96",ry:"10",fill:"#28333f",fillOpacity:"0.08"}),e.jsx("rect",{x:"48",y:"36",width:"224",height:"200",rx:"18",fill:"#28333f"}),e.jsx("rect",{x:"56",y:"44",width:"208",height:"184",rx:"14",fill:"#1e2833"}),[[68,56],[252,56],[68,204],[252,204]].map(([t,l])=>e.jsx("circle",{cx:t,cy:l,r:"5",fill:"#2a2a32",stroke:"#3a3a44"},`${t}-${l}`)),e.jsxs("g",{className:"lg-vault__chamber",children:[e.jsx("rect",{className:"lg-vault__mouth",x:"92",y:"72",width:"136",height:"128",rx:"8",fill:"#0c0c10"}),e.jsx("rect",{x:"104",y:"88",width:"72",height:"6",rx:"3",fill:"#5b89d8",fillOpacity:"0.55"}),e.jsx("rect",{x:"104",y:"104",width:"96",height:"4",rx:"2",fill:"#fff",fillOpacity:"0.12"}),e.jsx("rect",{x:"104",y:"116",width:"80",height:"4",rx:"2",fill:"#fff",fillOpacity:"0.08"}),r.includes("art")&&e.jsx("rect",{x:"112",y:"148",width:"96",height:"14",rx:"2",fill:"#f8f9fb",opacity:"0.9"}),r.includes("vid")&&e.jsx("rect",{x:"118",y:"160",width:"90",height:"14",rx:"2",fill:"#5b89d8",opacity:"0.85"}),r.includes("pdf")&&e.jsx("rect",{x:"124",y:"172",width:"84",height:"14",rx:"2",fill:"#f8f9fb",opacity:"0.75"}),e.jsx("circle",{className:"lg-vault__pulse",cx:"160",cy:"136",r:"18",fill:"#5b89d8",opacity:"0"})]}),e.jsxs("g",{className:"lg-vault__door lg-vault__door--left",children:[e.jsx("rect",{x:"92",y:"72",width:"68",height:"128",rx:"4",fill:"#2a3542",stroke:"#28333f",strokeWidth:"2"}),e.jsx("rect",{x:"102",y:"84",width:"48",height:"104",rx:"2",fill:"#24242c"}
1),e.jsx("circle",{cx:"148",cy:"136",r:"8",fill:"#5b89d8"}),e.jsx("circle",{cx:"148",cy:"136",r:"3.5",fill:"#f8f9fb"})]}),e.jsxs("g",{className:"lg-vault__door lg-vault__door--right",children:[e.jsx("rect",{x:"160",y:"72",width:"68",height:"128",rx:"4",fill:"#323e4c",stroke:"#28333f",strokeWidth:"2"}),e.jsx("rect",{x:"170",y:"84",width:"48",height:"104",rx:"2",fill:"#282830"}),e.jsx("circle",{cx:"172",cy:"136",r:"8",fill:"#5b89d8"}),e.jsx("circle",{cx:"172",cy:"136",r:"3.5",fill:"#f8f9fb"})]}),e.jsx("rect",{x:"118",y:"28",width:"84",height:"22",rx:"4",fill:"#5b89d8"}),e.jsx("text",{x:"160",y:"43",textAnchor:"middle",fill:"#fff",fontFamily:"IBM Plex Mono, monospace",fontSize:"9",fontWeight:"600",letterSpacing:"1.5",children:"VAULT"})]}),e.jsx("span",{className:"lg-vault__hint",children:j?"Drop to archive":n?"Drop into the vault":h?"Click to close":"Click to open"})]})}),e.jsxs("div",{className:"lg-vault__queue",children:[e.jsx("p",{className:"lg-vault__queue-label",children:$?"All sources archived. Select one to inspect.":"Select an item to archive it"}),e.jsx("ul",{className:"lg-vault__chips",children:v.map(t=>{const l=r.includes(t.id),a=_===t.id;return e.jsx("li",{children:e.jsxs("button",{type:"button","data-chip":t.id,draggable:!l,className:`lg-vault__chip lg-vault__chip--${t.kind.toLowerCase()}${l?" is-archived":""}${n===t.id?" is-dragging":""}${a?" is-selected":""}`,onClick:()=>{l?(y(t.id),u(!0)):b(t)},onDragStart:c=>S(c,t),onDragEnd:D,"aria-pressed":a,"aria-label":l?`View archived ${t.title}`:`Archive ${t.title}: drag or click`,children:[e.jsx("span",{className:"lg-vault__chip-kind",children:t.kind}),e.jsxs("span",{className:"lg-vault__chip-copy",children:[e.jsx("span",{className:"lg-vault__chip-label",children:t.title}),e.jsx("span",{className:"lg-vault__chip-source",children:t.source})]}),l&&e.jsx("span",{className:"lg-stamp lg-stamp--tiny",children:"Archived"})]})},t.id)})})]})]}),s?e.jsxs("div",{className:"lg-vault__record",role:"status","aria-live":"polite",children:[e.jsxs("div",{className:"lg-vault__record-top",children:[e.jsx("span",{className:"lg-stamp",children:"Archived copy"}),e.jsx("span",{className:"lg-vault__record-kind",children:s.kind})]}),e.jsx("h3",{className:"lg-vault__record-title",children:s.title}),e.jsx("p",{className:"lg-vault__record-url",children:s.url}),e.jsxs("p",{className:"lg-vault__record-meta",children:["Captured ",s.captured,e.jsx("span",{"aria-hidden":!0,children:" · "}),"Collection: ",s.collection]}),e.jsxs("p",{className:"lg-vault__record-excerpt",children:[e.jsx("span",{className:"lg-vault__record-search-label",children:"Searchable text"}),s.excerpt]})]}):e.jsx("p",{className:"lg-vault__fallback",children:"Drag or select a source to see how an archived page is stored: URL, capture date, collection, and searchable text."})]})}export{G as InteractiveVault};
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.