dotfiles/.config/spicetify/Extracted/Themed/xpui/xpui-routes-collection-conc...

2 lines
27 KiB
JavaScript
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";(("undefined"!=typeof self?self:global).webpackChunkopen=("undefined"!=typeof self?self:global).webpackChunkopen||[]).push([[5835],{48532:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(59496),s=n(56162),o=n(3802),r=n(63120),c=n(23521),i=n(75252),l=n(97009),d=n(27532);const m="MUiWCNTfb6FcSwVPvQ1V",g="UAk3bMhekwJTV_wIyfsT",u="X9w6LPfKsZHMCs38sVIQ",h="NXn5KjeUOjLGlAfS1Gao",p="N0wgFMDDvCiby4QB5kLJ",v="nloNe2BLRHjz9dxlwfLU",f="JzXND83mXvcEuntCNR34",j="GR08E4L_rOGljyQQX30R";var x=n(4637);const y=(0,a.memo)((e=>{const{concert:t,isVirtual:n,onClick:a}=e,{venue:y,location:N}=t,b=t.artists[0],w=(0,l.CH)(t.startDate.localDate);return(0,x.jsxs)(r.Link,{to:`/concert/${t.id}`,className:m,onClick:a,children:[b.imageUri&&(0,x.jsx)(c.Z,{children:(0,x.jsx)("div",{role:"img",className:j,style:{backgroundImage:`linear-gradient(180deg, rgba(18, 18, 18, 0) 0%, rgba(6, 6, 6, 0.6) 60%, rgba(0, 0, 0, 0.7) 100%), url(${b.imageUri})`}})}),(0,x.jsx)("time",{className:g,dateTime:t.startDate.localDate,children:(0,x.jsx)(s.D,{as:"h5",variant:"mestoBold",children:(0,l.jx)(w)})}),(0,x.jsxs)("div",{className:u,dir:"auto",children:[(0,x.jsxs)(s.D,{as:"h2",className:f,variant:"mesto",children:[(0,i.FO)(w)," • ",(0,l.hK)(w)]}),(0,x.jsx)(s.D,{as:"h2",variant:"cello",weight:"bold",className:h,children:(0,d.ij)(t)}),(0,x.jsx)("div",{className:p,children:(0,x.jsx)(s.D,{as:"h2",className:v,variant:"mesto","data-testid":"location-name",children:n?y:[y,N].join(o.ag.getSeparator())})})]})]})}))},47698:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Ht});var a=n(59496),s=n(61740),o=n(89605),r=n(33103),c=n(94041),i=n(84588),l=n(78780),d=n(17096),m=n(56162),g=n(36844),u=n(78328),h=n(3802),p=n(22521),v=n(41226),f=n(16743),j=n(73997),x=n(82108),y=n(96170),N=n(42495),b=n(63082),w=n(91703),D=n(45911),_=n(23627),C=n(5488),I=n(64709),k=n(18845),S=n(83680),F=n(24697),E=n(30366),O=n(83185),U=n(63120),M=n(97009),L=n(27532);const P="cELOd04or4B6BbTbNWA7",$="CHJYbX33oDik9u4n4ohH",G="woQ0wEe6FL4lsGW05bsb",A="KTDREr8pDWjrmnzXzZ2z",W="UUTvdEOH2v_rejoXdl9Z",H="cBbTozR921ppaoNZP0Uh",T="SNyyQ0t_VvlWzzB9li7v",B="lwO4iko6mhCUgZN1s9AW",R="akvZI06vqHOow1pOL29J",Q="WWZp3WM0maWJzl2qWEHE",z="YdkAHxbDekz9SiAxHG6M",K="AK37djOBJ2BuJOGuG1kQ",Z="JfYURQbEA_ntMsMZV6tK",J="du0mOGaZfHg3hsHwRMIu",V="Rvzy4ltiiHIp9mvlxf0c";var X=n(4637);const q=(0,a.memo)((e=>{const{concert:t,position:n,modalSpec:s}=e,{id:o,venue:r,location:c}=t,i=t.startDate.localDate,l=(0,M.CH)(i),d="ONLINE"===t.category,g=(0,a.useMemo)((()=>s?.eventRowFactory({position:n,uri:`spotify:concert:${t.id}`})),[s,n,t]),u=(0,y.$P)();return(0,X.jsxs)(U.Link,{to:`/concert/${t.id}`,className:B,onClick:()=>{g&&u.logInteraction(g.hitUiNavigate({destination:`/concert/${o}`}))},children:[(0,X.jsxs)("div",{className:R,"aria-hidden":!0,children:[(0,X.jsx)(m.D,{as:"h5",variant:"mestoBold",className:Q,children:(0,M.jw)(l)}),(0,X.jsx)(m.D,{as:"h1",variant:"cello",className:z,children:(0,M.wf)(l)})]}),(0,X.jsxs)("div",{className:K,children:[(0,X.jsx)(m.D,{as:"div",variant:"violaBold",className:Z,"data-testid":"event-title",children:(0,L.Yl)(t)}),(0,X.jsx)(k.T,{children:(0,M.jx)(l)}),(0,X.jsxs)(m.D,{as:"div",variant:"viola",className:J,children:[(0,M.FO)(l)," • ",(0,M.hK)(l)]}),(0,X.jsx)(m.D,{as:"div",variant:"viola",className:V,"data-testid":"event-venue",children:d?r:[r,c].join(h.ag.getSeparator())})]})]},t.id)})),Y=(0,a.memo)((e=>{const{event:t,locationName:n,onClose:s,feedSpec:o}=e,r=t?.concerts[0]?.concert,c=r?.artists[0],i=(0,a.useMemo)((()=>o?.groupedEventModalFactory({uri:c?.uri||""})),[o,c]),l=(0,y.$P)(),d=(0,y.Wi)(i);if(!t||!r||!c)return null;const g=()=>{i&&l.logInteraction(i.closeButtonFactory().hitUiHide()),s()};return(0,X.jsx)(O.Z,{contentLabel:h.ag.get("live_events.label"),isOpen:!0,className:P,onRequestClose:g,children:(0,X.jsxs)("section",{className:$,ref:d,children:[(0,X.jsx)("div",{className:G,children:(0,X.jsx)(ee,{"aria-label":h.ag.get("close"),iconOnly:S.k,buttonSize:"sm",onClick:g})}),(0,X.jsxs)("div",{className:A,children:[(0,X.jsx)(F.E,{height:"48",width:"48",className:W,src:c.imageUri}),(0,X.jsxs)("div",{className:H,children:[(0,X.jsx)(m.D,{as:"h3",variant:"cello",className:T,"data-testid":"event-venue",children:c.name}),(0,X.jsx)(m.D,{as:"h3",variant:"mesto","data-testid":"event-venue",children:`${h.ag.get("concerts.count_near_location",t.concerts.length,n)}`})]})]}),t.concerts.map(((e,t)=>(0,X.jsx)(q,{concert:e.concert,position:t,modalSpec:i},e.concert.id)))]})})}));var ee=(0,I.ZP)(E.o).withConfig({displayName:"ConcertFeedGroupedModal___StyledButtonTertiary",componentId:"sc-1o845wh-0"})({color:"#FFFFFF",backgroundColor:"#000000",cursor:"pointer"}),te=n(9102),ne=n(25899),ae=n(82710);const se=async()=>(await(0,ae.getSavedConcertsHub)(ne.b.getInstance())).body,oe=e=>{const[,{geonameId:t}]=e.queryKey;return(async e=>(await(0,ae.getConcertsForUser)(ne.b.getInstance(),e)).body)(t)},re=e=>{const[,,t]=e.queryKey;return(async(e=1,t)=>{const{geonameId:n,startDate:a,endDate:s}=t;return(await(0,ae.getAllConcerts)(ne.b.getInstance(),{page:e,geonameId:n,startDate:a,endDate:s})).body})(e.pageParam,t)},ce=e=>{const[,,{geonameId:t}]=e.queryKey;return(async e=>(await(0,ae.getConcertsHub)(ne.b.getInstance(),void 0,e)).body)(t)},ie=6e5,le=/^(\d+)/,de=(e,t)=>{const n=(()=>{const{location:e}=(0,o.UO)(),[,t]=e?.match(le)||[];if(t)try{return parseInt(t,10)}catch(e){return}})(),[a]=(0,r.lr)(),s=a.get("filter")?.trim();return e||"all"===s?{type:"all",geonameId:n}:t&&"saved"===s?{type:"saved"}:{type:"recommended",geonameId:n}};var me=n(72942),ge=n(95663),ue=n(50346),he=n(48532),pe=n(23521);const ve="pU4WoqT8T6PmtjPbFtK0",fe="FC5Y_KFJ9rJyTpydqtOW",je="AAYLcavkBdCuebn9AQxT",xe="lYHCmxpdReachiOORWGo",ye="JtKEdtTtcK7s6EpGecaC",Ne="myHDa69cI5CHC8fhIhkG",be=(0,a.memo)((e=>{const{event:t,onClick:n}=e,s=(0,a.useCallback)((()=>n(t)),[t,n]),o=(0,M.CH)(t.openingDate),r=(0,M.CH)(t.closingDate),c=t.concerts[0].concert,i=c.artists[0];return(0,X.jsxs)(E.o,{onClick:s,className:ve,component:"div",role:"button",children:[i.imageUri&&(0,X.jsx)(pe.Z,{children:(0,X.jsx)("div",{role:"img",className:Ne,style:{backgroundImage:`linear-gradient(180deg, rgba(18, 18, 18, 0) 0%, rgba(6, 6, 6, 0.6) 60%, rgba(0, 0, 0, 0.7) 100%), url(${i.imageUri})`}})}),(0,X.jsx)("time",{className:fe,dateTime:o.toISOString(),children:(0,X.jsx)(m.D,{as:"h5",variant:"mestoBold",children:(0,M.Bc)(o,r)})}),(0,X.jsxs)("div",{className:je,dir:"auto",children:[(0,X.jsx)(m.D,{as:"h2",variant:"cello",weight:"bold",className:xe,children:(0,L.ij)(c)}),(0,X.jsx)("div",{className:ye,children:(0,X.jsx)(m.D,{as:"h2",variant:"mesto","data-testid":"concerts-count",children:h.ag.get("concerts.count",t.concerts.length)})})]})]})})),we=(0,a.memo)((e=>{const{event:t,position:n,sectionSpec:s,onOpenGroupedEvent:o}=e,r=t.concerts[0]?.concert,c=r?.id,i=r&&(0,ue.g3)(r.id).toURI(),l=(0,y.$P)(),d=(0,a.useMemo)((()=>s?.eventCardFactory({identifier:c??"",position:n,uri:i??""})),[s,c,i,n]),m=(0,y.Wi)(d),g=e=>{o(e),d&&l.logInteraction(d.hitUiReveal())};if(t.concerts.length>1)return(0,X.jsx)("div",{ref:m,children:(0,X.jsx)(be,{event:t,onClick:g})});return(0,X.jsx)("div",{ref:m,children:(0,X.jsx)(he.Z,{concert:r,isVirtual:"online"===t.source,onClick:()=>{d&&l.logInteraction(d.hitUiNavigate({destination:i}))}})})}));var De=n(98340);const _e="MVPegsivznZB6gdkcnkH",Ce="MlK79hskRbFrN2OBjMkl",Ie="VxaXFH9Uq1NU0LtsVhIu",ke="UDVDNa40iTSPS9uHCG7Q",Se="ofURwIKv0qEXJGTraIis",Fe="fN_lJHkYih9H3j9YSEzS",Ee="LOJZO2MnGW5dCIawF767",Oe="tyc7QRlEJigVFIAeLGOB",Ue="PoljWhTLU3MKqIx2gSPY",Me="ajxCNAuBJSgYfKUUBWBT",Le="WR2h2Li5XTrBn_Rdme_k",Pe="WNhsvOyu4doInF525pLE",$e="qSR4imCvzdznIQ4F2kBO",Ge=(0,a.memo)((e=>{const{title:t="",identifier:n,position:s,events:o,feedSpec:r,onOpenGroupedEvent:c}=e,i=(0,a.useMemo)((()=>r?.eventSectionFactory({identifier:n,position:s})),[r,n,s]),l=(0,y.Wi)(i);return 0===o.length?null:(0,X.jsx)("div",{className:_e,ref:l,children:(0,X.jsx)(De.ZP,{value:"headered-grid",index:s,children:(0,X.jsx)(C.P,{total:o.length,title:t,showAll:!0,children:o.map(((e,t)=>{const n=e.concerts[0]?.concert;return(0,X.jsx)(we,{event:e,position:t,sectionSpec:i,onOpenGroupedEvent:c},n.id)}))})})})})),Ae=(e,t)=>{if(!e)return"/concerts";const n=t?.normalize().replaceAll(/\W+/g,"-");return n?`/concerts/location/${e}-${n}`:`/concerts/location/${e}`},We=10;const He=(0,a.memo)((e=>{const{eventGroups:t,locationName:n,isLoading:s,feedSpec:o,onOpenGroupedEvent:r}=e,c=(0,a.useMemo)((()=>o?.eventSectionFactory({identifier:"all",position:0})),[o]),i=(0,y.Wi)(c);return s?(0,X.jsx)(_.h,{hasError:!1,errorMessage:""}):t?0===t.length||0===t[0].events.length?(0,X.jsx)(D.u,{title:h.ag.get("concerts.error.no_concerts_found_title"),message:h.ag.get("concerts.error.no_concerts_found_message",n),renderInline:!0}):(0,X.jsx)("div",{ref:i,children:t.map((e=>(0,X.jsx)("div",{className:Pe,children:(0,X.jsx)(C.P,{total:e.events.length,title:h.ag.formatDate(new Date(`${e.date}T00:00:00`),{weekday:"long",day:"numeric",month:"long",year:"numeric"}),showAll:!0,children:e.events.map(((e,t)=>{const n=e.concerts[0]?.concert;return(0,X.jsx)(we,{event:e,position:t,sectionSpec:c,onOpenGroupedEvent:r},n.id)}))})},e.date)))}):null})),Te=(0,a.memo)((e=>{const{geonameId:t,spec:n}=e,{startDate:s,endDate:c}=(()=>{const[e]=(0,r.lr)(),t=e.get("startDate")?.trim(),n=e.get("endDate")?.trim();return{startDate:t,endDate:n}})(),i=(0,o.s0)(),[l]=(0,r.lr)(),[d,m]=(0,a.useState)(),g=(0,ge.o)(),u=(0,a.useMemo)((()=>n?.headerFactory()),[n]),{data:p,isLoading:v,hasNextPage:f,isFetchingNextPage:j,fetchNextPage:x}=(y={geonameId:t,startDate:s,endDate:c},(0,te.useInfiniteQuery)(["concerts","all",y],re,{staleTime:ie,keepPreviousData:!0,getNextPageParam:(e,t)=>{if(!(t.length>=50)&&0!==e.events.length)return t.length+1}}));var y;const N=(e=>(0,te.useQuery)(["concerts","popular",{geonameId:e}],ce,{staleTime:ie,keepPreviousData:!0}))(t),D=(0,a.useMemo)((()=>function(e){if(0===e.length)return[];if(0===e[0].events.length)return[];const t=[];let n={date:e[0].events[0].openingDate.slice(0,We),events:[]};for(const a of e)for(const e of a.events){const a=e.openingDate.slice(0,We);n.date!==a&&(t.push(n),n={date:a,events:[]}),n.events.push(e)}return t.push(n),t}(p?.pages??[])),[p?.pages]),_=p?.pages[0]?.userLocation||h.ag.get("concerts.default_location"),C=e=>{m(e);const t=e.concerts[0]?.concert.artistUris[0];g({type:"click",intent:"open-grouped-live-event",targetUri:t})};return(0,X.jsxs)("div",{children:[(0,X.jsx)(w.$,{children:`${h.ag.get("concerts_shows_in")} ${_}`}),(0,X.jsx)("div",{className:_e,"data-testid":"location-selector",children:(0,X.jsx)(me.Z,{handleLocationChange:e=>{g({type:"click",intent:"change-live-events-location"}),e?.geonameId&&i({pathname:Ae(e.geonameId,e.location),search:`?${l.toString()}`})},locationStr:_,headerSpec:u})}),(0,X.jsx)(He,{isLoading:v,locationName:_,eventGroups:D,onOpenGroupedEvent:C,feedSpec:n}),f&&(0,X.jsx)("div",{className:$e,children:(0,X.jsx)(b.P,{disabled:j,onClick:()=>{x()},children:h.ag.get("concerts.load_more")})}),!v&&N.data&&(0,X.jsx)(Ge,{title:h.ag.get("concerts_popular_near_you"),identifier:"popular",position:1,events:N.data.events,onOpenGroupedEvent:C,feedSpec:n}),(0,X.jsx)(Y,{event:d,locationName:_,feedSpec:n,onClose:()=>m(void 0)})]})})),Be=Te;var Re=n(28638),Qe=n(31354),ze=n(75252);const Ke=e=>24===e.length?new Date(e.substring(0,19)):22===e.length?new Date(e.substring(0,16)):new Date(e),Ze=e=>h.ag.formatDate(e,{month:"short",day:"numeric"}),Je=e=>h.ag.formatDate(e,{hour:"numeric",minute:"numeric"}),Ve=(e,t)=>{if(e.toDateString()===t.toDateString())return(e=>h.ag.formatDate(e,{weekday:"short",month:"short",day:"numeric"}))(e);if(e.getMonth()===t.getMonth()){return`${h.ag.formatDate(e,{day:"numeric",month:"short"})}${h.ag.formatDate(t,{day:"numeric"})}`}return`${h.ag.formatDate(e,{day:"numeric",month:"short"})}${h.ag.formatDate(t,{day:"numeric",month:"short"})}`};var Xe=n(46651),qe=n(12243);const Ye="QYX01DsOaw_MzJWWRL2R",et="wpTjIgQz7QkLGlEM2SbD",tt="nfOfj83N2J77AhkT4NNC",nt="RVBcsEWqZBqE8LlyMmmT",at="M5l3yVBFFsTeGr0FCQ53",st="pYZtdiW_JXpCpEpUNBl3",ot="smnK8C6twajPDjNeIZpu",rt="yEPFml56fHXdbEaxMRxQ",ct="VJN_K93zj5zcQWuKpudd",it="YvO7J4oC8u1QqRMBY4pg",lt=(0,a.memo)((e=>{const{concert:t,isVirtual:n,spec:s,position:o}=e,r=t?.id,c=(0,ue.g3)(t.id).toURI(),{venue:i,location:l}=t,d=t.artists[0],g=Ke(t.startDate.localDate),u=(0,y.$P)(),p=(0,a.useMemo)((()=>(0,Xe.F)(e.followers)),[e.followers]),v=(0,a.useMemo)((()=>s.concertCardFactory({identifier:r,position:o,uri:c})),[s,c,r,o]),f=(0,a.useMemo)((()=>(0,Qe.w)()),[]),j=(0,y.Wi)(v);return(0,X.jsxs)(U.Link,{to:`/concert/${t.id}`,className:Ye,onClick:()=>{u.logInteraction(v.hitUiNavigate({destination:c}))},ref:j,children:[d.imageUri&&(0,X.jsx)(pe.Z,{children:(0,X.jsx)("div",{role:"img",className:rt,style:{backgroundImage:`linear-gradient(180deg, rgba(18, 18, 18, 0) 0%, rgba(6, 6, 6, 0.6) 60%, rgba(0, 0, 0, 0.7) 100%), url(${d.imageUri})`}})}),(0,X.jsx)("time",{className:et,dateTime:t.startDate.localDate,children:(0,X.jsx)(m.D,{as:"h5",variant:"mestoBold",children:Ze(g)})}),(0,X.jsxs)("div",{className:tt,dir:"auto",children:[(0,X.jsxs)(m.D,{as:"h2",className:ot,variant:"mesto",children:[(0,ze.FO)(g)," • ",Je(g)]}),(0,X.jsx)(m.D,{as:"h2",variant:"cello",weight:"bold",className:nt,children:(0,Xe.i)(t)}),(0,X.jsx)("div",{className:at,children:(0,X.jsx)(m.D,{as:"h2",className:st,variant:"mesto","data-testid":"location-name",children:n?i:[i,l].join(h.ag.getSeparator())})})]}),(0,X.jsx)(y.Nh,{spec:v,children:(0,X.jsxs)("div",{className:ct,onClick:()=>{u.logInteraction(f.hitNoAction())},children:[(0,X.jsx)(qe.D,{followers:e.followers,spec:f}),(0,X.jsx)(m.D,{as:"p",variant:"mesto",children:p})]})})]})})),dt=(0,a.memo)((e=>{const{event:t,onClick:n,spec:s,position:o}=e,r=t.concerts[0].concert?.id,c=(0,ue.g3)(r).toURI(),i=(0,y.$P)(),l=(0,a.useMemo)((()=>s.concertCardFactory({identifier:r,position:o,uri:c})),[s,c,r,o]),d=(0,a.useMemo)((()=>(0,Qe.w)()),[]),g=(0,a.useCallback)((()=>{i.logInteraction(l.hitUiReveal()),n(t)}),[t,n,l,i]),u=(0,y.Wi)(l),p=Ke(t.openingDate),v=Ke(t.closingDate),f=t.concerts[0].concert,j=f.artists[0],x=(0,a.useMemo)((()=>(0,Xe.F)(e.followers)),[e.followers]),N=(0,a.useCallback)((()=>{i.logInteraction(d.hitNoAction())}),[i,d]);return(0,X.jsxs)("div",{onClick:g,className:Ye,role:"button",tabIndex:0,onKeyDown:e=>{"Enter"===e.key&&g()},ref:u,children:[j.imageUri&&(0,X.jsx)(pe.Z,{children:(0,X.jsx)("div",{role:"img",className:rt,style:{backgroundImage:`linear-gradient(180deg, rgba(18, 18, 18, 0) 0%, rgba(6, 6, 6, 0.6) 60%, rgba(0, 0, 0, 0.7) 100%), url(${j.imageUri})`}})}),(0,X.jsx)("time",{className:et,dateTime:p.toISOString(),children:(0,X.jsx)(m.D,{as:"h5",variant:"mestoBold",children:Ve(p,v)})}),(0,X.jsxs)("div",{className:tt,dir:"auto",children:[(0,X.jsx)(m.D,{as:"h2",variant:"cello",weight:"bold",className:nt,children:(0,Xe.i)(f)}),(0,X.jsx)("div",{className:at,children:(0,X.jsx)(m.D,{as:"h2",variant:"mesto","data-testid":"concerts-count",children:h.ag.get("concerts.count",t.concerts.length)})})]}),(0,X.jsx)(y.Nh,{spec:s,children:(0,X.jsxs)("div",{className:ct,onClick:N,children:[(0,X.jsx)(qe.D,{followers:e.followers,spec:d}),(0,X.jsx)(m.D,{as:"p",variant:"mesto",className:it,children:x})]})})]})}));var mt=n(84875),gt=n.n(mt);const ut="LN9pdza5hvbdl1QB8dKo",ht="P6SpMz_j_hH6lfVNSO2w",pt="axY_3UzUiQCQ2Asp0mQt",vt="CVhxc8GXvAXDO7De7zal",ft="IXXvh3b5U_b8xjeKorvb",jt=a.memo((function({headline:e,className:t,spec:n}){const a=(0,y.Wi)(n.welcomeCardFactory()),s=(0,y.$P)();return(0,X.jsx)("div",{className:gt()(ut,t),ref:a,onClick:()=>{s.logInteraction(n.welcomeCardFactory().hitNoAction())},children:(0,X.jsx)("div",{className:gt()(ft),children:(0,X.jsx)(m.D,{as:"p",variant:"cello",className:gt()(vt),children:e})})})})),xt=({spec:e})=>(0,X.jsx)(jt,{spec:e,headline:h.ag.get("web-player.family-duo-concerts-shelf.main-card-family"),className:ht}),yt=({spec:e})=>(0,X.jsx)(jt,{spec:e,headline:h.ag.get("web-player.family-duo-concerts-shelf.main-card-duo"),className:pt});var Nt=n(15342),bt=n(40576),wt=n(59359),Dt=n(23329),_t=n(22345);const Ct="pSD8FAzxnwWRFeP817di",It=a.memo(a.forwardRef((function(e,t){const{className:n,render:s,numberOfElements:o}=e,r=(0,a.useRef)(null),[c,i]=(0,a.useState)({columnCount:-1});(0,a.useImperativeHandle)(t,(()=>r.current));const l=(0,a.useCallback)((()=>{const e=r.current;if(!e||!e.parentElement)return;const t=((e,t)=>{const n=e;return n/t<196?Math.floor((n-24)/196):t})(e.parentElement.offsetWidth,o);i({columnCount:t})}),[o]);(0,_t.y)({refOrElement:r,observeOnly:"width",onResize:()=>{l()}}),(0,a.useLayoutEffect)((()=>{l()}),[l]);const d={"--column-count":`${c.columnCount}`,"--responsive-column-count":""+(c.columnCount-1)};return(0,X.jsx)("div",{ref:r,className:gt()(Ct,n),style:d,children:s(c)})})));It.displayName="GridContainer";const kt="J16VxLN1EwiAF59N0j9C",St="_1F6U2s5XM0jZxxOSpm4f",Ft="Nafv5vKVkay8bxmKRw05",Et=a.memo((function({title:e,children:t,seeAllUri:n,className:s="",testId:o="component",seeAllLabel:r,onClickShelfTitle:c,onClickShelfSeeAll:i,elementRef:l}){const d=(0,a.useCallback)((({columnCount:e})=>{if(!Array.isArray(t))return(0,X.jsx)(X.Fragment,{});const n=a.Children.toArray(t);return(0,X.jsx)(X.Fragment,{children:n.filter(((t,n)=>n<e))})}),[t]);return Array.isArray(t)&&0===t.length?null:(0,X.jsxs)("section",{ref:l,className:gt()(s,kt),"data-testid":`${o}-shelf`,"aria-label":e,children:[(0,X.jsx)("div",{className:St,children:(0,X.jsx)(wt.r,{title:e,seeAllUri:n,seeAllLabel:r,onClickTitle:c,onClickSeeAll:i})}),(0,X.jsx)(It,{className:gt()(Ft),render:d,numberOfElements:a.Children.count(t)})]})}));Et.displayName="BaseShelf";const Ot=e=>(0,X.jsx)(bt.L,{onError:e=>{(0,Dt.vK)(e,"Shelf")},children:(0,X.jsx)(Et,{...e})});const Ut=e=>{const{spec:t}=(0,Nt.f)(Re.u,{}),n=(0,a.useMemo)((()=>t.concertsShelfContainerFactory({position:e.position})),[t,e.position]),s=(0,y.Wi)(n);return(0,X.jsx)("div",{"data-testid":"family-duo-concerts-shelf",ref:s,children:(0,X.jsxs)(Ot,{title:h.ag.get("web-player.family-duo-concerts-shelf.shelf-title-family"),children:["family"===e.shelfData.planType?(0,X.jsx)(xt,{spec:n}):(0,X.jsx)(yt,{spec:n}),e.shelfData.concerts.map(((t,a)=>function(e,t,n,a){const{concert:s,members:o}=e;return 1===s.concerts.length?(0,X.jsx)(lt,{concert:s.concerts[0].concert,followers:o,spec:n,position:a},`concert-card-${s.concerts[0].concert.id}`):(0,X.jsx)(dt,{event:s,onClick:t,followers:o,spec:n,position:a},`concert-grouped-card-${s.location}-${s.artists.join()}`)}(t,e.onOpenGroupedEvent,n,a)))]})})},Mt=(0,a.memo)((e=>{const{enableInterestedFeature:t=!1,isLoading:n,events:a,locationName:s,spec:o,onOpenGroupedEvent:r,familyDuoShelfData:c}=e;if(n)return(0,X.jsx)(_.h,{hasError:!1,errorMessage:""});if(0===a.length)return(0,X.jsx)(D.u,{title:h.ag.get("concerts.error.no_concerts_found_title"),message:h.ag.get("concerts.error.no_concerts_found_message",s),renderInline:!0});const i=(e=>{const t={popular:[],recommended:[],online:[]};return e.forEach((e=>{switch(e.source){case"recommendation":t.recommended.push(e);break;case"popular":t.popular.push(e);break;case"online":t.online.push(e)}})),t})(a);return(0,X.jsxs)(X.Fragment,{children:[c&&(0,X.jsx)(Ut,{shelfData:c,onOpenGroupedEvent:r,position:0}),(0,X.jsx)(Ge,{title:h.ag.get("concerts_upcoming_virtual_events"),identifier:"online",position:c?1:0,events:i.online,onOpenGroupedEvent:r,feedSpec:o}),(0,X.jsx)(Ge,{title:t?"":h.ag.get("concerts_recommended_for_you"),identifier:"recommended",position:c?2:1,events:i.recommended,onOpenGroupedEvent:r,feedSpec:o}),(0,X.jsx)(Ge,{title:h.ag.get("concerts_popular_near_you"),identifier:"popular",position:c?3:2,events:i.popular,onOpenGroupedEvent:r,feedSpec:o})]})}));var Lt=n(66734),Pt=n(41836);const $t=(0,a.memo)((e=>{const{enableInterestedFeature:t=!1,geonameId:n,spec:s}=e,r=(0,o.s0)(),[c,i]=(0,a.useState)(),l=(0,ge.o)(),d=(0,a.useMemo)((()=>s.headerFactory()),[s]),{data:m,isLoading:u}=(e=>{const t=(0,te.useQueryClient)();return(0,te.useQuery)(["concerts",e],oe,{staleTime:ie,keepPreviousData:!0,onSuccess(n){if(e.geonameId||!n.userLocationGeonameId)return;const a=parseInt(n.userLocationGeonameId,10),s=["concerts",{...e,geonameId:a}];t.setQueryData(s,(()=>n))}})})({geonameId:n}),p=m?.userLocation||h.ag.get("concerts.default_location");((e={})=>{(0,te.useQuery)(["family-duo-concert-recommendations-aa-test",e],Lt.P,{enabled:(0,g.W6)(Pt.hj)})})({geonameId:e.geonameId});const{data:v,isFetched:f,isLoading:j}=((e={})=>(0,te.useQuery)(["family-duo-concert-recommendations",e],Lt.P,{enabled:(0,g.W6)(Pt.YC),retry:!1}))({geonameId:e.geonameId}),x=v&&f,y=(v?.concerts??[]).length>0;return(0,X.jsxs)("div",{children:[(0,X.jsx)(w.$,{children:`${h.ag.get("concerts_shows_in")} ${p}`}),(0,X.jsx)("div",{className:_e,"data-testid":"location-selector",children:(0,X.jsx)(me.Z,{handleLocationChange:e=>{l({type:"click",intent:"change-live-events-location"}),e?.geonameId&&r(Ae(e.geonameId,e.location))},locationStr:p,headerSpec:d})}),(0,X.jsx)(Mt,{enableInterestedFeature:t,isLoading:u||j,familyDuoShelfData:x&&y?v:void 0,events:m?.events||[],locationName:p,spec:s,onOpenGroupedEvent:e=>{i(e);const t=e.concerts[0]?.concert.artistUris[0];l({type:"click",intent:"open-grouped-live-event",targetUri:t})}}),(0,X.jsx)(Y,{event:c,locationName:p,feedSpec:s,onClose:()=>i(void 0)})]})})),Gt=(0,a.memo)((e=>{const{spec:t}=e,n=(0,te.useQuery)("savedConcerts",se,{keepPreviousData:!1});return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(w.$,{children:`${h.ag.get("live_events.label")}`}),n.data?.events.length?(0,X.jsx)(X.Fragment,{children:(0,X.jsx)(Ge,{title:h.ag.get("concerts_upcoming"),identifier:"saved",position:0,events:n.data?.events,feedSpec:t,onOpenGroupedEvent:()=>{}})}):(0,X.jsxs)("div",{className:Ee,children:[(0,X.jsx)(m.D,{as:"h2",variant:"canon",semanticColor:"textBase",className:Me,children:h.ag.get("concerts_interested_in_live_events")}),(0,X.jsx)(m.D,{as:"p",className:Le,children:h.ag.get("concerts_no_events_description")}),(0,X.jsx)(U.default,{to:"/concerts",className:Oe,children:(0,X.jsx)(b.P,{as:"span",className:Ue,children:h.ag.get("concerts_browse_more_events")})})]})]})})),At=c.vI0,Wt={url:"https://tickets.spotifycdn.com/partner-assets/Hub%20header%20image/Desktop%20header%20IMG.png",width:2736,height:720},Ht=()=>{const{isAnonymous:e}=(0,s.v9)(x.Gg),t=(0,o.TH)(),n=t.pathname+t.search,c=(0,y.$P)(),b=(0,g.W6)(N.tp),{spec:w}=(0,y.fU)(u.y,{}),D=de(e,b),_=(0,a.useMemo)((()=>w.headerFactory().liveEventsNavbarFactory({uri:n,reason:D.type})),[w,D,n]),C=(0,y.Wi)(_),I=(e,t)=>{const n=w.headerFactory().liveEventsNavbarFactory({uri:e,reason:t}).hitUiNavigate({destination:e});c.logInteraction(n)};return(0,X.jsxs)("section",{className:Ce,children:[(0,X.jsxs)(v.gF,{size:v.fR.SMALL,backgroundColor:At,backgroundImages:[Wt],children:[(0,X.jsx)(v.sP,{children:(0,X.jsx)(v.xd,{children:h.ag.get("live_events.label")})}),(0,X.jsx)(f.W,{children:(0,X.jsx)(j.i,{text:h.ag.get("live_events.label")})})]}),(0,X.jsxs)("div",{className:Ie,children:[(0,X.jsx)(p.I,{backgroundColor:At}),!e&&(0,X.jsx)("div",{className:Se,ref:C,children:(0,X.jsx)(i.l,{list:(0,X.jsx)("nav",{"aria-label":"live events navbar",children:(0,X.jsxs)(l.F,{children:[(0,X.jsx)(d.c,{id:"recommended_for_you_link",label:h.ag.get("live_events.for_you_tab"),active:"recommended"===D.type,className:Fe,component:r.rU,onClick:()=>I("/concerts","recommended"),sentenceCase:!0,to:"/concerts"},"recommended"),(0,X.jsx)(d.c,{id:"concerts_all_link",label:h.ag.get("live_events.all_events_tab"),active:"all"===D.type,className:Fe,component:r.rU,onClick:()=>I("/concerts?filter=all","all"),sentenceCase:!0,to:"/concerts?filter=all"},"all"),b&&(0,X.jsx)(d.c,{id:"concerts_interested_link",label:h.ag.get("concerts_interested"),active:"saved"===D.type,className:Fe,component:r.rU,onClick:()=>I("/concerts?filter=saved","saved"),sentenceCase:!0,to:"/concerts?filter=saved"},"saved")]})})})}),(0,X.jsxs)("div",{className:ke,children:["recommended"===D.type&&(0,X.jsx)($t,{geonameId:D.geonameId,spec:w,enableInterestedFeature:b}),"all"===D.type&&(0,X.jsx)(Be,{geonameId:D.geonameId,spec:w}),"saved"===D.type&&(0,X.jsx)(Gt,{spec:w}),(0,X.jsx)(m.D,{variant:"finale",semanticColor:"textSubdued",children:h.ag.get("live_events.disclaimer")})]})]})]})}},66734:(e,t,n)=>{n.d(t,{g:()=>r,P:()=>o});var a=n(25899),s=n(27555);const o=async e=>{const[t,{geonameId:n}]=e.queryKey,o=await((e,t)=>e.build().withMethod("GET").withHost(s.gH).withPath("/concerts/").withEndpointIdentifier("/cooper/concerts").withQueryParameters({...t&&{geonameId:t}}).withoutMarket().send())(a.b.getInstance(),n);return o.body},r=async e=>{const[t,{artists:n}]=e.queryKey,o=await((e,t)=>e.build().withMethod("POST").withHost(s.gH).withPath("/followers/").withEndpointIdentifier("/cooper/followers").withHeaders([{key:"content-type",value:"application/json"},{key:"accept",value:"application/json"}]).withBody(JSON.stringify({artists:t})).withoutMarket().send())(a.b.getInstance(),n);return o.body}},12243:(e,t,n)=>{n.d(t,{D:()=>d});var a=n(59496),s=n(96170);const o="g4AhdK8faqTe7v8VqC3x";var r=n(4637);const c=(0,a.memo)((({alt:e})=>(0,r.jsxs)("svg",{height:8,width:8,"aria-hidden":"true",viewBox:"-8 -8 32 32",className:o,children:[(0,r.jsx)("title",{children:e}),(0,r.jsx)("path",{d:"M6.233.371a4.388 4.388 0 0 1 5.002 1.052c.421.459.713.992.904 1.554.143.421.263 1.173.22 1.894-.078 1.322-.638 2.408-1.399 3.316l-.127.152a.75.75 0 0 0 .201 1.13l2.209 1.275a4.75 4.75 0 0 1 2.375 4.114V16H.382v-1.143a4.75 4.75 0 0 1 2.375-4.113l2.209-1.275a.75.75 0 0 0 .201-1.13l-.126-.152c-.761-.908-1.322-1.994-1.4-3.316-.043-.721.077-1.473.22-1.894a4.346 4.346 0 0 1 .904-1.554c.411-.448.91-.807 1.468-1.052zM8 1.5a2.888 2.888 0 0 0-2.13.937 2.85 2.85 0 0 0-.588 1.022c-.077.226-.175.783-.143 1.323.054.921.44 1.712 1.051 2.442l.002.001.127.153a2.25 2.25 0 0 1-.603 3.39l-2.209 1.275A3.25 3.25 0 0 0 1.902 14.5h12.196a3.25 3.25 0 0 0-1.605-2.457l-2.209-1.275a2.25 2.25 0 0 1-.603-3.39l.127-.153.002-.001c.612-.73.997-1.52 1.052-2.442.032-.54-.067-1.097-.144-1.323a2.85 2.85 0 0 0-.588-1.022A2.888 2.888 0 0 0 8 1.5z"})]}))),i="WCQhjx2ZwtN1mwka_4wj",l=e=>{const t=(0,s.$P)(),n=`spotify:user:${e.follower.username}`;return(0,a.useEffect)((()=>{t.logImpression(e.spec.planMemberFactory({identifier:e.follower.memberId,uri:n}).impression())})),e.follower.profileImageUrl?(0,r.jsx)("img",{src:e.follower.profileImageUrl,alt:e.follower.displayName??e.follower.username},`follower-${e.follower.displayName??e.follower.username}`):(0,r.jsx)(c,{alt:e.follower.displayName},`follower-${e.follower.displayName}`)},d=(0,a.memo)((e=>(0,r.jsx)("div",{className:i,children:e.followers.map(((t,n)=>(0,r.jsx)(l,{follower:t,spec:e.spec},`follower-${n}`)))})))},46651:(e,t,n)=>{n.d(t,{F:()=>o,i:()=>s});var a=n(3802);const s=e=>{if((e=>!!e.title&&(e.festival||!e.artists.length))(e))return e.title;const t=(e=>e.artists.map((e=>e.name)))(e);return 1===t.length?a.ag.get("concert.header.upcoming_concert_title_1",...t):2===t.length?a.ag.get("concert.header.upcoming_concert_title_2",...t):3===t.length?a.ag.get("concert.header.upcoming_concert_title_3",...t):4===t.length?a.ag.get("concert.header.upcoming_concert_title_4",...t):t.length>4?a.ag.get("concert.header.upcoming_concert_title_more",...t):""},o=e=>1===e.length?a.ag.get("web-player.family-duo-concerts-shelf.X-follows",e[0].displayName??e[0].username):a.ag.get("web-player.family-duo-concerts-shelf.X-of-your-family-follow",e.length)}}]);
//# sourceMappingURL=xpui-routes-collection-concerts.js.map