1"use strict";(globalThis.webpackChunktest=globalThis.webpackChunktest||[]).push([[6851],{76851(e,t,n){n.r(t),n.d(t,{default:()=>u,rememberLinkCreator:()=>c,resolveExternalLink:()=>s});var r=n(82483),i=n(93376),a=n(97756),o=n(21451),l=n(56723);async function s(e){const t=new AbortController,n=setTimeout(()=>t.abort(),8e3);try{const n=await fetch(`${e}?resolve=1`,{signal:t.signal,cache:"no-store"});if(!n.ok)throw new Error(404===n.status?"missing":"unavailable");const r=await n.json(),i=new URL(r.destination_url);if(!["http:","https:"].includes(i.protocol)||i.username||i.password)throw new Error("unavailable");return r}finally{clearTimeout(n)}}function c(e){try{/^\d+$/.test(String(e))&&!localStorage.getItem("referred_creator")&&localStorage.setItem("referred_creator",String(e))}catch(t){}}function u(){const{code:e}=(0,i.g)(),{t:t}=(0,a.Bd)(),[n,u]=(0,r.useState)(null),d=(0,r.useRef)(null),h=`${(0,o.wE)()}l/${encodeURIComponent(e)}/`;return(0,r.useEffect)(()=>{let e=!0;return u(null),d.current&&d.current.endpoint===h||(d.current={endpoint:h,result:s(h)}),d.current.result.then(t=>{e&&(c(t.creator_id),window.location.replace(t.destination_url))}).catch(t=>{e&&u(t.message)}),()=>{e=!1}},[h]),(0,l.jsx)("main",{style:{maxWidth:480,margin:"15vh auto",padding:24,fontFamily:"sans-serif"},children:n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("h1",{children:t("autoDm.linkRedirect.errorTitle","We couldn\u2019t open this link")}),(0,l.jsx)("p",{children:"missing"===n?t("autoDm.linkRedirect.missing","This link is no longer available. Please ask the creator for a new link."):t("autoDm.linkRedirect.retry","Please try opening it again.")}),"missing"!==n&&(0,l.jsx)("a",{href:h,children:t("autoDm.linkRedirect.open","Open link")})]}):(0,l.jsx)("p",{role:"status",children:t("autoDm.linkRedirect.opening","Opening your link\u2026")})})}}}]); 2//# sourceMappingURL=6851.f044815f.chunk.js.map
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.