solorice/config/spicetify/Extracted/Themed/xpui/xpui-routes-cultural-moment-hub.js
Kristofers Solo a42ded1119 Use dotter
2024-08-28 09:02:07 +03:00

2 lines
6.5 KiB
JavaScript
Executable File

"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[3838],{46339:(e,t,n)=>{n.r(t),n.d(t,{CulturalMomentHub:()=>te,REDIRECT_BASE:()=>G,default:()=>ne});var s=n(81987),i=n(30758),r=n(97500),l=n.n(r),a=n(78757),o=n(11808),u=n(38308),c=n(31685),d=n(83028),m=n(71306),p=n(82442),h=n(74793),g=n(59116),b=n(21752),x=n(55194),f=n(12669),v=n(86070);const y=({image:e,color:t=m.vyq,title:n})=>{const s=void 0===e?p.K.SMALL:p.K.DEFAULT,i=e?.custom?.sizes?.flatMap((e=>e.uri?[{url:e.uri,width:e.width,height:e.height}]:[]))??(e?.uri?[{url:e?.uri}]:[]);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(p.z,{backgroundImages:i,backgroundColor:t,size:s,children:[(0,v.jsx)(g.h,{children:n?(0,v.jsx)(b.X,{text:n}):null}),(0,v.jsx)(h.Y,{children:n?(0,v.jsx)(x.mm,{children:n}):null})]}),(0,v.jsx)(f.f,{color:t})]})};var j=n(61544),w=n(1019),A=n(62952),k=n(33779);const _=e=>{if("number"==typeof e){return new Date(1e3*e).toISOString()}return null};const N=(e,t,n)=>{if(void 0===e.id)return null;const s=t.map(((e,t)=>function(e,t){const n=e.component?.id,s=e.id;if(void 0===n||void 0===s)return null;const i=e.events?.click?.data?.uri,r=e.images?.main?.uri,l=r?[{url:r}]:[];switch(n){case"culturalmoments:mediumEpisodeCard":case"culturalmoments:episodeCardActionsMedium":return void 0===i?null:(0,v.jsx)(A.U,{uri:i,name:e.text?.title??"",images:l,showImages:l,description:e.text?.description??e.text?.subtitle??"",durationMilliseconds:(a=e.custom?.duration,"number"==typeof a?a:0),releaseDate:_(e.custom?.releaseDate),resume_point:null,isExplicit:!1,is19PlusOnly:!1,sharingInfo:null,index:t},i);case"culturalmoments:playlistCard":case"culturalmoments:playlistCardActionsMedium":return void 0===i?null:(0,v.jsx)(k.B,{uri:i,name:e.text?.title??"",images:l,description:e.text?.description??"",authorName:e.text?.subtitle??"",index:t},i);default:return null}var a}(e,t))).flatMap((e=>e?[e]:[]));if(0===s.length)return null;const i=(0,j.o_)(e.events?.click?.data?.uri??"")?.toURLPath(!0);return(0,v.jsx)(w.p,{title:e.text?.title??"",total:s.length,seeAllUri:i,index:n,id:e.id,seeAllLabel:e.text?.accessory,children:s})},D=e=>{const t=(e=>{const t=Array();let n,s=Array();return e.forEach((e=>{"culturalmoments:sectionHeaderWithAction"===e.component?.id?(n&&0!==s.length&&t.push({heading:n,components:s}),n=e,s=Array()):n&&("culturalmoments:carousel"===e.component?.id||"glue2:carousel"===e.component?.id?e.children?.forEach((e=>{s.push(e)})):s.push(e))})),n&&0!==s.length&&t.push({heading:n,components:s}),t})(e);return(0,v.jsx)(v.Fragment,{children:t.map(((e,t)=>N(e.heading,e.components,t)))})};var I=n(69644),R=n(12783),C=n(21953),M=n(84492),z=n(59996),E=n(94549),S=n(79303),T=n(48905);const F="MT6jAR25XYfoarcSqHDd",H="IYZA3J2VTMydirxq_bdg",O="t6RJK1eND2uPmFYOi32l";var B=function(e){return e.ANDROID="https://play.google.com/store/apps/details?id=com.spotify.music",e.IOS="https://apps.apple.com/app/spotify-music/id324684580",e}(B||{});const L=({spec:e})=>{const t=o.Ru.getLocaleForTranslation(),n=(0,S.s)(),s=(0,T.t)(e),i=t=>{if(t===B.ANDROID){const s=e.googleBadgeFactory().hitNavigateToWebviewUri({destination:t});n.logInteraction(s)}else{const s=e.appleBadgeFactory().hitNavigateToWebviewUri({destination:t});n.logInteraction(s)}};return(0,v.jsxs)(I.a,{variant:"tinted",style:{width:600},ref:s,children:[(0,v.jsx)(R.E,{as:"p",variant:"bodyMediumBold",style:{marginBottom:C.v4},children:o.Ru.get("web-player.cultural-moments.unsupportedHeading")}),(0,v.jsx)(R.E,{as:"p",variant:"bodySmall",style:{marginBottom:C.CD},children:o.Ru.get("web-player.cultural-moments.unsupportedDescription")}),(0,v.jsxs)("div",{className:l()(O),children:[(0,v.jsx)(z.N,{to:B.IOS,target:"_blank",onClick:()=>i(B.IOS),children:(0,v.jsx)("img",{src:(0,M.b)((0,E.f)(t)),alt:o.Ru.get("web-player.cultural-moments.unsupported.appleAppStoreAlt"),className:F})}),(0,v.jsx)(z.N,{to:B.ANDROID,target:"_blank",onClick:()=>i(B.ANDROID),children:(0,v.jsx)("img",{src:(0,M.b)((0,E.A)(t)),alt:o.Ru.get("web-player.cultural-moments.unsupported.googlePlayStoreAlt"),className:l()(F,H)})})]})]})};var P=n(97513),U=n(38481);const V=(e,t)=>{const n=new Intl.DateTimeFormat;return e.build().withHost(U.LG).withPath("/hub").withQueryParameters({id:t,userHasRiF:!1,clientTimezone:n.resolvedOptions().timeZone??""}).withoutMarket().withEndpointIdentifier("cultural-moment/hub").send()};var Z=n(79973),q=n(72091);const Q="B9Q1L66F7wl4eUMgp4Lg",W="gtqpWbwIV4PTEp8Q0ZW4",Y="edYsLe1QCBdzPglEiROZ",$=({uri:e,id:t})=>{const{data:n,error:s,loading:r}=(0,Z.Z)(V,[t]),{spec:m,UBIFragment:p}=(0,q.r)(a.j,{data:{identifier:e,uri:e}}),h=(0,i.useMemo)((()=>m.shelvesFactory()),[m]),g=(0,i.useMemo)((()=>m.mobilePromptFactory()),[m]),b=n?.body.hubViewData?.body,x=n?.body.hubViewData?.header;if(null===n||void 0===b||void 0===x||r||null!==s)return(0,v.jsx)(d.A,{hasError:null!==s,errorMessage:o.Ru.get("error.generic")});const f=n.body.hubViewData?.title,j=x?.text?.title;return(0,v.jsxs)(p,{spec:m,children:[(0,v.jsx)(c.Q,{children:f??""}),j?(0,v.jsx)("div",{className:Q,children:(0,v.jsx)(y,{title:x?.text?.title,image:x.images?.background})}):null,(0,v.jsx)(p,{spec:h,children:(0,v.jsxs)("div",{className:Y,children:[j&&(0,v.jsx)(u.K,{}),(0,v.jsx)("div",{className:l()("contentSpacing",W),children:(0,v.jsxs)(P._,{children:[(0,v.jsx)(L,{spec:g}),b?D(b):null]})})]})})]})};var K=n(15891),J=n(63198),X=n(19159);const G="https://accounts.spotify.com/login",ee=()=>{const e=window.location.href;return window.location.href=`${G}?continue=${encodeURIComponent(e)}`,null},te=e=>{const t=(0,J.V)(),n=(0,s.NC)(X.Be8,{loadingValue:!1});return t?(0,v.jsx)(ee,{}):n?(0,v.jsx)($,{...e}):(0,v.jsx)(K.$,{to:"/"})},ne=te},94549:(e,t,n)=>{n.d(t,{A:()=>l,f:()=>r});const s=["ar","az","bg","cs_CZ","da","de","ee","el","en","es","es_mx","fi","fp","fr","fr_ca","he","hu","id","it","ja","ko","lt","lv","ms","mt","nb","nl","pl","pt","pt_br","ro","ru","sk","sl","sv","th_TH","tr","vi_VN","zh_HANS","zh_HANT"],i=["af","ar","am","az","be","bg","bn","bs","ca","cr","cs_CZ","da","de","el","en","es","es_419","et","eu","fa","fi","fp","fr","fr_ca","gl","gu","he","hi","hr","hu","hy","id","is","it","ja","ka","kk","km","kn","ko","ky","lo","lt","lv","mk","ml","mn","mr","ms","my","nb","ne","nl","pa","pl","pt","pt_br","ro","ru","si","sk","sl","sq","sr","sv","sw","ta","te","th_TH","tr","ua","ur","uz","vi_VN","zh_HANS","zh_HANT","zh_hk","zu"],r=e=>`images/download-badges/apple/${s.includes(e)?e:"int"}.svg`,l=e=>`images/download-badges/google/${i.includes(e)?e:"int"}.svg`}}]);
//# sourceMappingURL=xpui-routes-cultural-moment-hub.js.map