PageSourceSearch

https://shared.sx/assets/PrivateShareLanding-1zfi41Wj.js

js shared.sx collected 2026-10-03 22:06:24 UTC 3,314 bytes, 1 lines download raw bytes

1import{k as P,r as l,A as C,B as L,l as c,q as r,D as R,t as f,E as U,o as u}from"./vendor-D0Q8KstH.js";const b={class:"private-share-landing"},T={class:"container"},q={key:0,class:"loading-state"},A={key:1,class:"error-state"},S={key:2,class:"success-state"},E={__name:"PrivateShareLanding",setup(j){const v=L(),a=U(),d=l(!0),s=l(null),p=l(!1),m=l(null);async function g(o){try{const e=await fetch(`/api/share/${o}/`,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest"},credentials:"include"});if(e.ok){p.value=!0;const t=await e.json().catch(()=>null);if(t?.creator_username&&(m.value=t.creator_username),t?.redirect_url||t?.creator_username){await new Promise(n=>setTimeout(n,100));const i=t?.creator_username||t?.redirect_url?.match(/\/s\/([^\/\?]+)/)?.[1];if(i)a.push({name:"CreatorPage",params:{username:i},query:{from_share:"true"}});else if(t?.redirect_url){const n=new URL(t.redirect_url,window.location.origin);n.searchParams.set("from_share","true"),window.location.href=n.toString()}}return}if(e.status===302){const t=e.headers.get("Location");if(t){await new Promise(y=>setTimeout(y,100));const i=new URL(t,window.location.origin);i.searchParams.set("from_share","true");const n=i.pathname.match(/\/s\/([^\/\?]+)/)?.[1];n?a.push({name:"CreatorPage",params:{username:n},query:{from_share:"true"}}):window.location.href=i.toString();return}}const h=await e.json().catch(()=>({}));e.status===404?s.value={title:"Invalid Link",message:h?.error||"This share link is invalid or has expired."}:e.status===410?s.value={title:"Link Already Used",message:h?.error||"This share link has already been used."}:s.value={title:"Error",message:h?.error||"An error occurred while redeeming the share link."}}catch(e){console.error("Failed to redeem share link:",e),s.value={title:"Network Error",message:"Unable to connect to the server. Please try again later."}}finally{d.value=!1}}function k(){a.push("/")}function w(){if(m.value)a.push({name:"CreatorPage",params:{username:m.value},query:{from_share:"true"}});else{const e=new URL(window.location.href).pathname.match(/^\/s\/([^\/]+)/);e?a.push({name:"CreatorPage",params:{username:e[1]},query:{from_share:"true"}}):a.push("/")}}function _(){a.push("/register")}return C(()=>{const o=v.params.token;o?g(o):(s.value={title:"Invalid Link",message:"No share token provided."},d.value=!1)}),(o,e)=>(u(),c("div",b,[r("div",T,[d.value?(u(),c("div",q,[...e[0]||(e[0]=[r("div",{class:"spinner"},null,-1),r("p",null,"Redeeming share link...",-1)])])):s.value?(u(),c("div",A,[e[1]||(e[1]=r("div",{class:"error-icon"},"❌",-1)),r("h2",null,f(s.value.title),1),r("p",null,f(s.value.message),1),r("button",{onClick:k,class:"btn-primary"},"Go to Homepage")])):p.value?(u(),c("div",S,[e[2]||(e[2]=r("div",{class:"success-icon"},"✅",-1)),e[3]||(e[3]=r("h2",null,"Access Granted!",-1)),e[4]||(e[4]=r("p",null,"You now have access to this private content.",-1)),e[5]||(e[5]=r("p",null,"You can create an account to keep permanent access to this and future private content.",-1)),r("div",{class:"actions"},[r("button",{onClick:w,class:"btn-primary"},"View Content"),r("button",{onClick:_,class:"btn-secondary"},"Create Account")])])):R("",!0)])]))}},B=P(E,[["__scopeId","data-v-931cece7"]]);export{B 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.