PageSourceSearch

https://alphapup.io/assets/PublicFeed-Kj3wfANt.js

js alphapup.io collected 2026-10-09 05:02:19 UTC 6,166 bytes, 1 lines download raw bytes

1import{$ as e,B as t,D as n,G as r,H as i,J as a,K as o,L as s,M as c,N as l,Q as u,R as d,U as f,V as ee,X as p,Y as te,Z as m,_ as h,a as g,at as _,b as ne,et as re,f as v,g as y,h as b,i as x,it as S,lt as C,nt as w,ot as T,p as E,q as ie,r as D,s as O,st as k,v as ae,w as oe,x as se}from"./index-T97GA9bV.js";o(),T(),w(),l();var ce={class:`public-feed`},le={class:`feed-header`},ue={key:0,class:`feed-subtitle`},de={key:0,class:`feed-error`},fe={key:1,class:`feed-grid`},pe={key:2,class:`coming-soon`},me=[`src`,`alt`,`onLoad`],A=[`aria-label`],j={class:`art-failed-title`},M={key:2,class:`card-art skeleton-art`},N={class:`card-title`},P={class:`card-artist`},F={class:`card-actions`},I={key:0,class:`feed-loading-more`},L=800,R=20,z=20,B=30,V=D({__name:`PublicFeed`,setup(o){let l=c(),w=S(!1),T=null,D=S([]),V=S([]),H=S(!0),U=S(null),W=S({}),G=S({}),K=S(!1),q=S({}),J=S(null),Y=null,X=S(localStorage.getItem(`streamingPref`)||`spotify`),Z=e=>{X.value=e.detail||`spotify`},Q=e=>(X.value===`apple`?e.appleMusicUrl:e.spotifyUrl)||e.linkfireUrl||``,he=e=>{if(e.length<=1)return e;let t=new Date(new Date);t.setMonth(t.getMonth()-6);let n=[],r=[];for(let i of e){let e=!1;if(i.releaseDate!=null)try{let n=typeof i.releaseDate?.toDate==`function`?i.releaseDate.toDate():new Date(i.releaseDate);!isNaN(n.getTime())&&n>=t&&(e=!0)}catch{}(e?n:r).push(i)}let i=e=>{for(let t=e.length-1;t>0;t--){let n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}return e};if(n.length===0||r.length===0)return i([...e]);i(n),i(r);let a=[n.shift()],o=0,s=Math.random()<.5?2:3;for(;n.length>0||r.length>0;){if(n.length===0){a.push(...r);break}if(r.length===0){a.push(...n);break}o>=s?(a.push(n.shift()),o=0,s=Math.random()<.5?2:3):(a.push(r.shift()),o++)}return a},$=async e=>{for(let t=0;t<e.length;t+=z){let n=e.slice(t,t+z);await Promise.all(n.map(async e=>{let t=e.upc;if(!(t in W.value||G.value[t])){W.value={...W.value,[t]:null};try{let e=E(O,`coverart/${t}/${t}_thumb.webp`),n=await v(e);W.value={...W.value,[t]:n}}catch{try{let e=E(O,`coverart/${t}/${t}.jpg`),n=await v(e);W.value={...W.value,[t]:n}}catch{G.value={...G.value,[t]:!0}}}}}))}},ge=async()=>{H.value=!0,U.value=null;try{let e=se(b(g,`products`),oe(`isFeatured`,`==`,!0),ne(`displayOrder`,`asc`)),t=await ae(e),n=t.docs.map(e=>e.id),r=await Promise.all(n.map(e=>h(y(g,`linkfire-urls`,e)))),i={};r.forEach((e,t)=>{e.exists()&&(i[n[t]]=e.data().linkfireUrl||``)});let a=await Promise.all(n.map(e=>h(y(g,`external-urls`,e)))),o={};a.forEach((e,t)=>{o[n[t]]=e.exists()?{spotifyUrl:e.data().spotifyUrl||``,appleMusicUrl:e.data().appleMusicUrl||``}:{spotifyUrl:``,appleMusicUrl:``}});let s=t.docs.map(e=>({upc:e.id,title:e.data().title||``,artist:e.data().artist||``,releaseDate:e.data().releaseDate||null,linkfireUrl:i[e.id]||``,spotifyUrl:o[e.id]?.spotifyUrl||``,appleMusicUrl:o[e.id]?.appleMusicUrl||``})),c=he(s);D.value=c;let l=c.slice(0,B);await $(l),V.value=l.map(e=>({...e,_copyIndex:0,_key:`${e.upc}-0`})),H.value=!1}catch(e){U.value=`Could not load feed: `+e.message,H.value=!1}},_e=async()=>{if(D.value.length!==0&&!(V.value.length>=L)&&!K.value){K.value=!0;try{let e=V.value.filter(e=>e._copyIndex===0).length;if(e<D.value.length){let t=D.value.slice(e,e+B);await $(t);let n=t.map(e=>({...e,_copyIndex:0,_key:`${e.upc}-0`}));V.value=[...V.value,...n]}else{let e=V.value[V.value.length-1]._copyIndex+1,t=D.value.map(t=>({...t,_copyIndex:e,_key:`${t.upc}-${e}`})),n=L-V.value.length;V.value=[...V.value,...t.slice(0,n)],$(D.value)}}finally{K.value=!1}}},ve=()=>{J.value&&D.value.length!==0&&(Y=new IntersectionObserver(e=>{e[0].isIntersecting&&_e()},{rootMargin:`400px`}),Y.observe(J.value))};return a(async()=>{document.documentElement.style.backgroundColor=`#0f1219`,document.body.style.backgroundColor=`#0f1219`;let e=document.querySelector(`.app-container`);e&&(e.style.backgroundColor=`#0f1219`),T=n(x,e=>{w.value=!!e}),window.addEventListener(`streamingPrefChanged`,Z),await ge(),requestAnimationFrame(()=>ve())}),te(()=>{document.documentElement.style.backgroundColor=``,document.body.style.backgroundColor=``;let e=document.querySelector(`.app-container`);e&&(e.style.backgroundColor=``),Y&&Y.disconnect(),T&&T(),window.removeEventListener(`streamingPrefChanged`,Z)}),(n,a)=>{let o=u(`font-awesome-icon`);return p(),f(`div`,ce,[t(`header`,le,[a[1]||=t(`h1`,{class:`feed-title`},`Alpha Pup`,-1),H.value||D.value.length>0?(p(),f(`p`,ue,`Est. 2004, Los Angeles`)):i(``,!0)]),U.value?(p(),f(`div`,de,C(U.value),1)):H.value?(p(),f(`div`,fe,[(p(),f(d,null,m(R,e=>t(`div`,{key:`sk-`+e,class:`feed-card skeleton-card`},[...a[2]||=[t(`div`,{class:`card-art skeleton-art`},null,-1),t(`div`,{class:`skeleton-line skeleton-title-line`},null,-1),t(`div`,{class:`skeleton-line skeleton-artist-line`},null,-1)]])),64))])):D.value.length===0?(p(),f(`div`,pe,[...a[3]||=[t(`p`,{class:`coming-soon-text`},`Coming Soon`,-1)]])):(p(),f(`div`,{key:3,class:k([`feed-grid`,{"feed-grid--single":D.value.length===1}])}
1,[(p(!0),f(d,null,m(V.value,n=>(p(),f(`div`,{key:n._key,class:`feed-card`},[(p(),ee(e(Q(n)?`a`:`span`),ie({ref_for:!0},Q(n)?{href:Q(n),target:`_blank`,rel:`noopener noreferrer`}:{},{class:[`card-art-wrap`,{"card-art-link":Q(n)}]}),{default:re(()=>[W.value[n.upc]?(p(),f(`img`,{key:0,src:W.value[n.upc],alt:n.title,class:k([`card-art card-art-img`,{"img-loaded":q.value[n.upc]}]),loading:`lazy`,onLoad:e=>q.value[n.upc]=!0},null,42,me)):G.value[n.upc]?(p(),f(`div`,{key:1,class:`card-art art-failed-placeholder`,"aria-label":n.title},[t(`span`,j,C(n.title),1)],8,A)):(p(),f(`div`,M))]),_:2},1040,[`class`])),t(`p`,N,C(n.title),1),t(`p`,P,C(n.artist),1),t(`div`,F,[r(o,{icon:`circle-info`,class:`card-action-icon`,onClick:s(e=>_(l).push(`/product/${n.upc}`),[`stop`])},null,8,[`onClick`])])]))),128)),V.value.length>0&&K.value?(p(),f(`div`,I,[...a[4]||=[t(`div`,{class:`feed-spinner`},null,-1)]])):i(``,!0),t(`div`,{ref_key:`sentinel`,ref:J,class:`sentinel`,"aria-hidden":`true`},null,512)],2)),w.value?(p(),f(`a`,{key:4,class:`admin-link`,href:`/feed-admin`,onClick:a[0]||=s(e=>_(l).push(`/feed-admin`),[`prevent`])},`Manage Feed`)):i(``,!0)])}}},[[`__scopeId`,`data-v-10f1d1d4`]]);export{V 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.