1import{r as o,s as c,j as e}from"./index-Ct8eLu1I.js";function x(){const[i,t]=o.useState(null);return o.useEffect(()=>{const s=decodeURIComponent(window.location.pathname.replace(/^\/+/,"")),n=s.startsWith("s/")?s.slice(2).split("/")[0]:s.split("/")[0];if(!n){t("No short code provided.");return}(async()=>{const{data:a,error:l}=await c.rpc("resolve_shared_link",{_code:n}),r=Array.isArray(a)?a[0]:a;if(l||!r||!r.target_url){t("This link is invalid or has been removed.");return}if(r.expires_at&&new Date(r.expires_at)<new Date){t("This link has expired.");return}c.rpc("increment_shared_link_click",{_code:n}).then(()=>{},()=>{}),window.location.replace(r.target_url)})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-6 bg-background",children:e.jsx("div",{className:"max-w-md text-center space-y-2",children:i?e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-xl font-semibold",children:"Link unavailable"}),e.jsx("p",{className:"text-muted-foreground",children:i})]}):e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-xl font-semibold",children:"Redirectingâ¦"}),e.jsx("p",{className:"text-muted-foreground",children:"Taking you to your destination."})]})})})}export{x 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.