dotfiles/.config/spicetify/Extracted/Themed/xpui/xpui-routes-offline-browse.js

2 lines
3.7 KiB
JavaScript
Executable File

"use strict";(("undefined"!=typeof self?self:global).webpackChunkopen=("undefined"!=typeof self?self:global).webpackChunkopen||[]).push([[1997],{99653:(e,a,n)=>{n.d(a,{z:()=>d});var i=n(28604),t=n(79823),r=n(79351),s=n(75523),l=n(58089),u=n(9374),c=n(12741),o=n(4637);function d(e,a){switch(e.type){case u.p.ALBUM:return(0,o.jsx)(i.r,{uri:e.uri,name:e.name,images:e.images,sharingInfo:null,artists:e.artists,index:a},e.uri);case u.p.ARTIST:return(0,o.jsx)(t.I,{uri:e.uri,name:e.name,images:e.images,index:a},e.uri);case u.p.SHOW:return(0,o.jsx)(l._,{uri:e.uri,name:e.name,images:e.images,publisher:e.publisher,sharingInfo:null,mediaType:c.E.UNKNOWN,index:a},e.uri);case u.p.AUDIOBOOK:return(0,o.jsx)(r.c,{uri:e.uri,name:e.name,images:e.images,authorName:e.authorName,index:a},e.uri);case u.p.PLAYLIST:return(0,o.jsx)(s.Z,{uri:e.uri,name:e.name,images:e.images,description:"",authorName:e.creatorName,index:a},e.uri);default:return null}}},35638:(e,a,n)=>{n.d(a,{P:()=>b});var i=n(59496),t=n(85830),r=n(3802),s=n(24952),l=n(96768),u=n(79923),c=n(39669),o=n(13791),d=n(11685),g=n(89039),m=n(39097),f=n(48607),x=n(30301),h=n(73460),p=n(4637);const y=function({uri:e,name:a,images:n,index:u}){const y=(0,d.u)(),b=(0,i.useRef)(null),j=(0,i.useRef)(!0),w=(0,i.useContext)(g.t),{isPlaying:S}=(0,x.cR)(o.b),{togglePlay:v}=(0,f.n)({uri:o.b,pages:[{items:b.current?.map((e=>({...e,provider:null})))||[]}]},{featureIdentifier:"local_files"});(0,i.useEffect)((()=>(j.current=!0,()=>{j.current=!1})),[]);const I=(0,m.I)(),N=(0,t.y1)((async(e,a)=>{if(!b.current){const e=await w.getTracks();b.current=e}j&&v({loggingParams:a},{uri:o.b,pages:[{items:b.current?.map((e=>({...e,provider:null})))||[]}]})}),c.s_,{leading:!0,trailing:!1});return y.canFetchAllTracks&&I?(0,p.jsx)(s.Z,{index:u,delegatePlayback:!0,delegateLogging:!0,isPlaying:S,onPlay:N,headerText:a,featureIdentifier:"local_files",uri:e,renderCardImage:()=>(0,p.jsx)(l.x,{images:n,FallbackComponent:h.S}),renderSubHeaderContent:()=>(0,p.jsx)("span",{children:r.ag.get("local-files.description")})}):null},b=({index:e})=>{const a=(0,u.gB)();return(0,p.jsx)(i.Suspense,{fallback:null,children:(0,p.jsx)(y,{index:e,name:a.name,uri:a.uri,images:a.images})})}},40479:(e,a,n)=>{n.r(a),n.d(a,{default:()=>p});var i=n(84875),t=n.n(i),r=n(3802),s=n(99653),l=n(5488),u=n(35638),c=n(35302),o=n(56162);const d={offline:"ctcxxigybw6qGQde916g",emptyStateContainer:"QGlY4v4eRdOcBHgHljcF",icon:"LFYYI0yKpFvSeNhBWRw4"};var g=n(4637);const m=()=>(0,g.jsxs)("div",{className:d.emptyStateContainer,children:[(0,g.jsx)(c.D,{iconSize:64,className:d.icon}),(0,g.jsx)(o.D,{as:"h1",variant:"brio",semanticColor:"textBase",dir:"auto",children:r.ag.get("web-player.offline.empty-state.title")}),(0,g.jsx)(o.D,{as:"h2",variant:"ballad",semanticColor:"textSubdued",dir:"auto",children:r.ag.get("web-player.offline.empty-state.subtitle")})]});var f=n(98340),x=n(39097),h=n(98147);const p=function(){const{hasError:e,items:a}=(0,h.G)(),n=(0,x.I)();return e?null:(0,g.jsx)("div",{className:t()(d.offline,"contentSpacing"),children:a.length>0||n?(0,g.jsxs)(f.JL,{value:"headered-grid",children:[(0,g.jsx)(l.P,{title:r.ag.get("music_downloads"),total:a.length,seeAllUri:"/collection/music-downloads",alwaysShowSeeAll:!0,children:a.map(((e,a)=>(0,g.jsx)(f.JL,{value:"card",index:a,children:(0,s.z)(e,a)},e.uri)))}),n&&(0,g.jsx)(l.P,{title:r.ag.get("local-files"),total:1,showAll:!0,children:(0,g.jsx)(u.P,{index:0})})]}):(0,g.jsx)(m,{})})}},98147:(e,a,n)=>{n.d(a,{G:()=>r});var i=n(59496),t=n(49873);function r(){const e=(0,t.c)(),[a,n]=(0,i.useState)(!0),[r,s]=(0,i.useState)(!1),[l,u]=(0,i.useState)([]);return(0,i.useEffect)((()=>{(async()=>{try{const a=await e.getDownloads();u(a)}catch(e){s(!0)}finally{n(!1)}})()}),[e]),{isLoading:a,hasError:r,items:l}}}}]);
//# sourceMappingURL=xpui-routes-offline-browse.js.map