2 lines
38 KiB
JavaScript
Executable File
2 lines
38 KiB
JavaScript
Executable File
"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[5713],{71251:(e,t,a)=>{a.d(t,{j:()=>l});var i=a(50959),s=a(22795),n=a(57562),o=a(13734),r=a(11527);const l=i.memo((function({uri:e,size:t=n.q.md,className:a,onClick:l,canDownload:c,condensedAll:d}){const[u,g]=(0,s.Z)(e),p=(0,o.o)(),m=(0,i.useCallback)((()=>{p({targetUri:e,intent:u?"unsave":"save",type:"click"}),g(!u)}),[p,e,u,g]);return(0,r.jsx)(n.o,{className:a,isFollowing:u,onFollow:m,onClick:l,uri:e,size:t,canDownload:c,condensedAll:d})}))},19514:(e,t,a)=>{a.d(t,{V:()=>D,e:()=>U});var i=a(50959),s=a(35869),n=a(10226),o=a(41657),r=a(11317),l=a(8810),c=a(4612),d=a(82579),u=a(64329),g=a(18050),p=a(12553),m=a(51040),x=a(71459),h=a(94739),y=a(17053),j=a(13734),b=a(50540),k=a(53758),f=a(44724),v=a(52993),P=a(45438),C=a(61058),S=a(23769),w=a(80626),I=a(73928),N=a(74234),A=a(58301),E=a(17676),R=a(11527);function U(e){return{uri:e.uri,name:e.name,trailer:e.trailer,showTypes:e.showTypes}}const B=e=>`activation-trigger-mme-${e}`,D=i.memo((function({index:e=-1,showMetadata:t,episode:a,usePlayContextItem:D,status:F,variant:L}){const T=(0,A.E)(),M=a.playedState.playPositionMilliseconds,O=a.uri,z=(0,i.useRef)(null),[_,W]=(0,i.useState)(a.playedState.state===I.sY.Completed),K=(0,y.O)(),G=(0,b.g)(),Y=(0,C.jh)(),H=(0,j.o)(),X=(0,s.I0)(),{UBIFragment:q,spec:V,logger:Z}=(0,w.fU)(o.createDesktopEpisodeBlockEventFactory,{data:{uri:O,reason:a.requestId||"",position:e}}),$=(0,w.Wi)(V),{isActive:J,isPlaying:Q,togglePlay:ee}=D({uri:O}),[te]=(0,S.z)(1e4,(e=>e?.item?.uri===O));(0,i.useEffect)((()=>{Q&&(z.current=te)}),[Q,te]),(0,i.useEffect)((()=>{!Q&&z.current&&a.duration.milliseconds<=z.current&&W(!0)}),[Q,a.duration.milliseconds]);const ae=(0,i.useCallback)((e=>{e||(z.current=0),W(e)}),[]),ie=e=>{if(e.target!==e.currentTarget)return;const i=`${a.name} • ${t.name}`;K(e,{itemUris:[O],dragLabelText:i,contextUri:t.uri})},se=U(t),ne=(0,k.s)({...a,coverArt:{sources:a.coverArt}},se),oe=(0,i.useCallback)((()=>{if(a.episodeType===I.Wf.Episode&&T)x.y.set((()=>({triggerId:B(a.uri),triggerAction:null})));else if(G)ne();else{let e;e=Q?V.playButtonFactory().hitPause({itemToBePaused:O}):J?V.playButtonFactory().hitResume({itemToBeResumed:O}):V.playButtonFactory().hitPlay({itemToBePlayed:O});const t=Z.logInteraction(e);H({targetUri:O,intent:Q?"pause":"play",type:"click"}),ee({loggingParams:t})}}),[J,ne,H,ee,O,Q,G,a,T,Z,V]),re=(0,i.useCallback)((()=>{Z.logInteraction(V.hitUiNavigate({destination:O})),H({type:"click",targetUri:O,intent:"navigate"})}),[O,H,Z,V]),le=a.podcastSubscription?.isPaywalled??!1,ce=a.podcastSubscription?.isUserSubscribed??!1,de=le&&!ce,ue=le&&G,{badges:ge}=(0,N.r)({contentRating:a.contentRating?.label,isPaywalled:le}),pe=(0,i.useCallback)((()=>X((0,l.RM)(t.uri))),[t.uri,X]),me=(0,i.useCallback)((e=>{let i=e;return(de||ue)&&(i=(0,R.jsx)(m.l,{enabled:!0,showUri:t.uri,children:i})),!a.playability.playable&&ge.nineteen&&(i=(0,R.jsx)("div",{onClick:e=>{e.stopPropagation(),pe()},children:e})),i=(0,R.jsx)(c.D,{id:B(O),targetURI:(0,r.EC)(O),children:i}),i}),[O,de,ue,t.uri,ge.nineteen,a.playability.playable,pe]),xe=(0,n.W6)(E.eli,{loadingValue:!1});return(0,R.jsx)(q,{spec:V,children:(0,R.jsx)(P.JL,{value:"row",index:e,children:(0,R.jsx)(d._,{onShow:()=>{Z.logInteraction(V.secondaryHitUiReveal())},menu:(0,R.jsx)(u.k,{uri:O,showUri:t.uri,sharingInfo:a.sharingInfo,isPlayed:_,onMarkAsPlayed:ae}),children:xe?(0,R.jsx)(p.k,{ref:$,requestId:a.requestId,index:e,uri:O,size:Y,images:a.coverArt||[],name:a.name,showName:t.name,description:a.description,isPlayable:a.playability.playable||de,fullyPlayed:_,durationMs:a.duration.milliseconds,releaseDate:a.releaseDate?.isoString||"",resumePositionMs:z.current??M,handleDragStart:ie,handlePlaybackClick:oe,handleClick:re,isCurrentlyPlaying:J,isPaywalled:le,isUserSubscribed:ce,isPlaying:Q,position:Q?te:void 0,episodeSharingInfo:a.sharingInfo,onMarkAsPlayed:ae,contentInformation:a.contentInformation,showUri:t.uri,mediaTypes:a.mediaTypes??void 0,badges:(0,R.jsxs)(R.Fragment,{children:[ge.explicit&&(0,R.jsx)(f.N,{}),ge.paid&&(0,R.jsx)(h.g,{}),ge.nineteen&&(0,R.jsx)(v.X,{size:16})]}),playButtonWrapper:me,onMoreButtonClick:()=>{Z.logInteraction(V.moreButtonFactory().hitUiReveal())},status:F,variant:L}):(0,R.jsx)(g.X,{ref:$,requestId:a.requestId,index:e,uri:O,size:Y,images:a.coverArt||[],name:a.name,showName:t.name,description:a.description,isPlayable:a.playability.playable||de,fullyPlayed:_,durationMs:a.duration.milliseconds,releaseDate:a.releaseDate?.isoString||"",resumePositionMs:z.current??M,handleDragStart:ie,handlePlaybackClick:oe,handleClick:re,isCurrentlyPlaying:J,isPaywalled:le,isUserSubscribed:ce,isPlaying:Q,position:Q?te:void 0,episodeSharingInfo:a.sharingInfo,onMarkAsPlayed:ae,contentInformation:a.contentInformation,badges:(0,R.jsxs)(R.Fragment,{children:[ge.explicit&&(0,R.jsx)(f.N,{}),ge.paid&&(0,R.jsx)(h.g,{}),ge.nineteen&&(0,R.jsx)(v.X,{size:16})]}),playButtonWrapper:me,onMoreButtonClick:()=>{Z.logInteraction(V.moreButtonFactory().hitUiReveal())},showUri:t.uri,mediaTypes:a.mediaTypes??void 0,status:F,variant:L})})})})}))},66713:(e,t,a)=>{a.d(t,{k:()=>o});a(86277);var i=a(58206);const s="rTMkDBDp47Eo12ZEQv4U";var n=a(11527);const o=({copyrights:e,courtesyLine:t})=>{const a=(e||[]).map(((e,t)=>{const a=e.text.replace(/^(\(C\)\s+)/,"").replace(/^(\(P\)\s+)/,"").replace(/^(©\s+)/,"").replace(/^(℗\s+)/,"");let s;return s="C"===e.type?"©":"P"===e.type?"℗":`(${e.type})`,(0,n.jsx)(i.D,{as:"p",variant:"finale",dir:"auto",children:`${s} ${a}`},t)}));return t&&a.unshift((0,n.jsx)(i.D,{as:"p",variant:"finale",dir:"auto",children:t},a.length)),(0,n.jsx)("div",{className:s,children:a})}},89992:(e,t,a)=>{a.r(t),a.d(t,{default:()=>ai});var i=a(50959),s=a(75802),n=a(20521),o=a(75095),r=a(11317),l=a(85648),c=a(41038),d=a(91643),u=a(82187),g=a.n(u),p=a(35869),m=a(69736),x=a(10226),h=a(22085),y=a(2386),j=a(97013),b=a(40235),k=a(91939),f=a(85770),v=a(58206),P=a(21611),C=a(93421),S=a(11401),w=a(44724),I=a(52993),N=a(13128),A=a(20747),E=a(82857),R=a(74234),U=a(61027);const B="Bns6t3CfzQaCA4DLRzPQ",D="zGFcpmwFVhJxRDXUXoXA",F="_FLyhB96W9W0msGYNWUl",L="Si5iVyGLDY7mGWH_U2wA",T="HLBtD6mJyIB9EeOzDtXE",M="DRO0ur1WXqpK9BelywtE",O="vtlBEOtYFwv1cxC32ccc",z="Pq_DZj9ECxwTsK8pBxe0",_="bu7LVUNyDPF_FcrKMv74",W="bYP2npsc_CeChpMGcr6g",K="Ux7aVnDYlwojS4AmkSLg";var G=a(11527);let Y=function(e){return e.SMALL="small",e.LARGE="large",e}({});const H=({images:e,title:t,contentRating:a,duration:i,moreButton:s,onClick:n,onContextMenu:o,onTouchStart:r,onTouchEnd:l,isPlaying:c,isActive:d,size:u,className:p,label:m,isPlayable:x=!0})=>{const h=u===Y.LARGE?"medium":"small",{badges:y}=(0,R.r)({contentRating:a});return(0,G.jsxs)("div",{"data-testid":"trailer-component",className:g()(B,p,{[D]:d}),onContextMenu:o,onTouchStart:r,onTouchEnd:l,children:[(0,G.jsxs)("div",{className:L,children:[(0,G.jsxs)("div",{className:z,children:[(0,G.jsx)(C.O,{type:E.p.EPISODE,title:t,className:g()(O,{[K]:u===Y.SMALL,[W]:u===Y.LARGE}),size:S.m$.SIZE_56,images:e,shape:C.K.ROUNDED_CORNERS}),(0,G.jsx)("div",{className:_,children:(0,G.jsx)(U.f,{"data-testid":"trailer-play-button",version:P.ul.transparent,size:h,isPlaying:c,onClick:n,disabled:!x})})]}),(0,G.jsxs)("div",{children:[(0,G.jsx)("div",{className:T,children:(0,G.jsx)(v.D,{dir:"auto",className:F,variant:"balladBold",children:t})}),(0,G.jsxs)("div",{className:M,children:[(0,G.jsx)(N.V,{text:m}),y.explicit&&(0,G.jsx)(w.N,{}),y.nineteen&&(0,G.jsx)(I.X,{}),(0,G.jsx)(v.D,{dir:"auto",variant:"mesto",children:(0,G.jsx)(A.nL,{durationMs:i})})]})]})]}),s]})};var X=a(13734),q=a(71318),V=a(66713),Z=a(40688),$=a(15764);const J="_yl4tOZxcpoUt28k6B8I",Q="lcJflizNrSwDM9yPNk6h",ee="ret7iHkCxcJvsZU14oPY",te=({rating:e,className:t,onClick:a})=>{if(!e)return null;const i=Boolean(e.rating?.rating);return(0,G.jsxs)("button",{className:g()(J,t),onClick:a,children:[(0,G.jsx)(v.D,{dir:"auto",variant:"mestoBold",children:e.averageRating?.showAverage?l.ag.formatNumber(e.averageRating.average,{maximumFractionDigits:1}):l.ag.get("web-player.audiobooks.noRating")}),i?(0,G.jsx)(Z.u,{iconSize:16,className:g()(Q)}):(0,G.jsx)($.G,{iconSize:16,className:g()(Q)}),e.averageRating?.showAverage&&(0,G.jsxs)(v.D,{variant:"mesto",className:g()(ee),children:["(",l.ag.formatNumberCompact(Number(e.averageRating.totalRatings)),")"]})]})};var ae=a(61058),ie=a(90979),se=a(22527),ne=a(98692),oe=a(29673),re=a(80626),le=a(73461);const ce=({htmlDescription:e,narrators:t,spec:a})=>{const s=(0,X.o)(),n=(0,re.$P)(),o=(0,i.useCallback)((e=>{s({intent:"expand-description",type:"click"});const t=a.seeMoreButtonFactory();n.logInteraction(e?t.hitUiReveal():t.hitUiHide())}),[n,s,a]);return(0,G.jsxs)(G.Fragment,{children:[t.length?(0,G.jsx)(m.x,{as:"p",variant:"bodyMedium",children:l.ag.get("web-player.audiobooks.narratedByX",t.join(l.ag.getSeparator()))}):null,e&&(0,G.jsx)(le.o,{maxLines:4,content:e,htmlContent:e,onExpanded:o})]})};var de=a(38338),ue=a(71251),ge=a(20580),pe=a(91023);const me="8px",xe="mmCZ5VczybT9VqKB5wFU",he="At_ihDspJfh1yw3Cn2cq",ye="u3LLJx1KnMchfNCzi6k5",je="Yqz1Nv6wj1n3HmXL_qji",be="qRqn3JrWLPbGW9k2a63n",ke="HAah1_lK_dHgyyE71I8Z",fe="eiC4nh70nb5UHZBYMgNA",ve="hl2eRCaYcZ1Jm1bgNYlU",Pe="eYtmwXEvi1UdCevg8WoK",Ce="QOp2aYTYmZHZ6DFFHuYE",Se=({explicit:e,durationMs:t,publishDate:a})=>(0,G.jsxs)("div",{className:Pe,children:[e&&(0,G.jsx)(w.N,{fullText:!0}),(0,G.jsxs)("div",{children:[a&&(0,G.jsx)(m.x,{variant:"bodySmall",className:Ce,children:l.ag.formatDate(a)}),(0,G.jsx)(m.x,{variant:"bodySmall",children:(0,G.jsx)(A.nL,{durationMs:t})})]})]});var we=a(22795),Ie=a(5542),Ne=a(57986),Ae=a(49857),Ee=a(3533),Re=a(76963),Ue=a(50540),Be=a(19039);const De="iZut9Dh2KEjNVhDUxzWw";function Fe({uri:e,price:t,size:a,spec:i,logger:s,onPlayback:n}){const{enqueueSnackbar:o}=(0,Be.D)(),r=(0,Ue.g)(),c=0===t?.finalPrice?.amount,d=c?i.getButtonFactory({uri:e}):i.buyButtonFactory({uri:e}),u=(0,Ae.y1)((async()=>{if(s.logInteraction(d.hitShowPaywall({paywalledItem:e})),r)n();else{try{t?.finalPrice?await(0,Re.Q)({show_uri:e,currency:t.finalPrice.currency,price:t.finalPrice.amount}):o(l.ag.get("error.generic"))}catch(e){o(l.ag.get("error.generic"))}n()}}),2e3,{leading:!0,trailing:!1});return(0,G.jsx)(Ee.D,{size:a,className:De,style:{flexShrink:0},onClick:u,children:c?l.ag.get("web-player.audiobooks.buyFree"):l.ag.get("web-player.audiobooks.buy")})}const Le=({uri:e,isLocked:t,price:a,isPlaying:i,isConsumptionCapped:s,onPlayback:n,logger:o,spec:r,size:l="large"})=>t&&!s?(0,G.jsx)(Fe,{size:l,uri:e,price:a,logger:o,spec:r,onPlayback:n}):(0,G.jsx)(Ne.$,{size:l,isPlaying:i,uri:e,onClick:n});var Te=a(94948),Me=a(15842),Oe=a(66205),ze=a(6395),_e=a(66819),We=a(9443);const Ke=i.memo((function({backgroundColor:e,uri:t,name:a,isPlaying:s,togglePlay:n,isLocked:o,consumptionCapExplanation:r,price:c,spec:d,isExplicit:u,publishDate:g,duration:m}){const[x,h]=(0,we.Z)(t),y=!(0,We.k)(),b=(0,p.I0)(),k=(0,X.o)(),f=(0,re.$P)(),v=(0,i.useCallback)((()=>{k({targetUri:t,intent:x?"unsave":"save",type:"click"});const e=d.saveToLibraryButtonFactory();x?f.logInteraction(e.hitUnfollow({itemToBeUnfollowed:t})):f.logInteraction(e.hitFollow({itemToBeFollowed:t})),h(!x)}),[k,t,x,d,h,f]),P=(0,i.useCallback)(((e,a)=>{const i=d.downloadButtonFactory();r?b((0,Te.S3)(r)):a===Ie.mc.ADD?f.logInteraction(i.hitDownload({itemToDownload:t})):a===Ie.mc.REMOVE?f.logInteraction(i.hitRemoveDownload({itemToRemoveFromDownloads:t})):a===Ie.mc.NO_PERMISSION&&f.logInteraction(i.hitUiReveal())}),[r,b,f,d,t]),C=(0,i.useCallback)((()=>{const e=d.contextButtonFactory().hitUiReveal();f.logInteraction(e)}),[f,d]),S=(0,_e.j)(),w=!!r,I=!o&&!w;return(0,G.jsxs)(Me.o,{backgroundColor:e,style:{"--action-bar-padding-bottom":me},children:[(0,G.jsx)(Oe.F,{testId:"book-action-bar-metadata",children:(0,G.jsx)(Se,{explicit:u,publishDate:g,durationMs:m})}),(0,G.jsxs)(Oe.F,{children:[(0,G.jsx)(Le,{uri:t,isLocked:o,isConsumptionCapped:w,price:c,isPlaying:s,onPlayback:n,logger:f,spec:d,size:S}),(0,G.jsx)(ze.r,{children:(0,G.jsx)(de.H,{isAdded:x,onClick:v,disabled:y,size:S,isAudiobook:!0})},"follow-button"),(0,G.jsx)(ue.j,{uri:t,onClick:P,size:S,canDownload:I}),(0,G.jsx)(ge.yj,{menu:(0,G.jsx)(pe.X,{uri:t}),children:(0,G.jsx)(j.z,{label:l.ag.get("more.label.context",a),onClick:C,size:S})})]})]})}));var Ge=a(78734),Ye=a(97922),He=a(81639),Xe=a(16118),qe=a(15632),Ve=a(59099);const Ze=i.memo((function({coverArt:e,name:t,authorName:a,uri:i,backgroundColor:s,isPlaying:n,togglePlay:o,isLocked:r,price:c,isConsumptionCapped:d,logger:u,spec:g}){return(0,G.jsxs)(Ye.gF,{backgroundColor:s,children:[(0,G.jsxs)(He.W,{children:[(0,G.jsx)(Le,{uri:i,isLocked:r,price:c,isPlaying:n,isConsumptionCapped:d,onPlayback:o,logger:u,spec:g,size:"medium"}),(0,G.jsx)(Xe.i,{text:t,dragUri:i,dragLabel:t})]}),(0,G.jsx)(ge._P,{menu:(0,G.jsx)(pe.X,{uri:i}),children:(0,G.jsx)(Ye.Oz,{images:e,name:t,dragUri:i,dragMimeType:Ge.RN.AUDIOBOOKS,shape:C.K.SQUARE})}),(0,G.jsxs)(Ye.sP,{children:[(0,G.jsx)(qe.g,{children:l.ag.get("web-player.audiobooks.audiobook")}),(0,G.jsx)(Ye.xd,{canEdit:!1,onClick:()=>{},scaleAtMinWidth:Ye.vz,dragUri:i,dragMimeType:Ge.RN.AUDIOBOOKS,dragLabel:t,children:t}),(0,G.jsx)(Ve.m,{children:a})]})]})})),$e="HvVxzh4ZoggYAhgSxSth",Je=i.memo((({price:e})=>e.finalPrice&&e.finalListPrice?0===e.finalPrice.amount&&0===e.finalListPrice.amount?(0,G.jsxs)("div",{className:$e,children:[(0,G.jsx)(m.x,{variant:"bodyMediumBold",semanticColor:"textBase",children:l.ag.get("audiobook.freePriceDescription")}),(0,G.jsx)(m.x,{variant:"bodySmall",children:l.ag.get("audiobook.freePriceExplanation")})]}):(0,G.jsxs)("div",{className:$e,children:[(0,G.jsx)(m.x,{variant:"titleSmall",semanticColor:"textBase",children:e.finalPrice.formattedPrice}),e.finalPrice.amount<e.finalListPrice.amount&&(0,G.jsx)(m.x,{variant:"bodyMedium",semanticColor:"textSubdued",children:l.ag.get("web-player.audiobooks.retailPrice",(0,G.jsx)("span",{style:{textDecoration:"line-through"},children:e.finalListPrice.formattedPrice}))})]}):null));a(46758),a(53321),a(86277);var Qe=a(80936),et=a(93246);var tt=a(77861);var at=a(78706),it=a(64222),st=a(17676),nt=a(23769);const ot="b0Vng72SrQiFroJKXfk2",rt="FfeP3XKSZcAdfviyk8fv",lt="eWxDd0LanTnTlSl8SOHX",ct="eAOkseqV13_CAmzuDJpa",dt="fovofKIYdEIURgIYoKm2",ut="NXXFrQO7npgPCRuSKaAA",gt="ekkhhuxKVGAzkEmuh9kE",pt="zd6xqobF255bxHFtCmXy",mt=i.memo((function({name:e,duration:t,uri:a,bookName:s,usePlayContextItem:n,isChapterLocked:o,isPlayable:r,resumePositionMs:c,isFullyPlayed:d,isExplicit:u,is19PlusOnly:h,spec:y,index:b,consumptionCapExplanation:f}){const v=(0,i.useRef)(c),{isPlaying:P,togglePlay:C,isActive:S}=n({uri:a}),N=(0,re.$P)(),A=(0,Ue.g)(),E=(0,p.I0)(),R=(0,x.W6)(st.vWw,{loadingValue:!1}),{position:B,isFullyPlayed:D}=((e,t,a,s)=>{const n=(0,i.useRef)(null),[o,r]=(0,i.useState)(s),[l]=(0,nt.z)(1e4,(t=>t?.item?.uri===e));return(0,i.useEffect)((()=>{a&&(n.current=l)}),[a,l]),(0,i.useEffect)((()=>{!a&&n.current&&t.milliseconds<=n.current+1e4&&r(!0)}),[a,t.milliseconds]),{position:a?l:null,isFullyPlayed:o}})(a,t,P,d);null!==B&&(v.current=B);const F=(0,i.useCallback)((e=>{e.stopPropagation(),e.preventDefault()}),[]),L=(0,X.o)(),T=(0,i.useCallback)((e=>{if(F(e),f&&!A&&R)return void E((0,Te.S3)(f));const t=y.chapterBlockFactory({position:b,uri:a}).playButtonFactory();if(o)L({type:"click",intent:"audiobook-gated-entry-point",itemIdSuffix:"target-chapter"}),N.logInteraction(t.hitShowPaywall({paywalledItem:a}));else{const e=(0,it.aK)({isPlaying:P,isActive:S,spec:t,logger:N,uri:a});C({loggingParams:e})}}),[f,E,b,R,S,A,o,P,N,L,y,F,C,a]),M=(0,i.useCallback)((()=>{const e=y.chapterBlockFactory({position:b,uri:a}).secondaryHitUiReveal();N.logInteraction(e)}),[b,N,y,a]),O=(0,i.useCallback)((e=>{F(e);const t=y.chapterBlockFactory({position:b,uri:a}).contextMenuFactory().hitUiReveal();N.logInteraction(t)}),[b,N,y,F,a]),z=(0,i.useMemo)((()=>!(o||f)),[f,o]),_=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("hr",{className:lt,"aria-hidden":!0}),(0,G.jsxs)("div",{className:ot,onDoubleClick:e=>{L({targetUri:a,intent:"play",type:"double-click"}),T(e)},children:[(0,G.jsx)(m.x,{as:"h2",variant:"bodyMediumBold",className:g()(ut,{[rt]:S}),semanticColor:"textBase",children:e}),(0,G.jsxs)("div",{className:gt,children:[(0,G.jsx)(U.f,{size:"small",version:U.u.secondary,onClick:T,isPlaying:P,ariaPlayLabel:l.ag.get("tracklist.a11y.play",e,s),ariaPauseLabel:l.ag.get("tracklist.a11y.pause",e,s),locked:o&&!f,disabled:!r&&!(o||f)}),u&&(0,G.jsx)(w.N,{fullText:!0}),h&&(0,G.jsx)(I.X,{size:16}),(0,G.jsx)("div",{className:pt,children:(0,G.jsx)(at.E,{isPlaying:P,fullyPlayed:D,durationMs:t.milliseconds,resumePositionMs:v.current,position:B??void 0})})]}),z?(0,G.jsx)(ge.yj,{menu:(0,G.jsx)(k.r,{uri:a}),children:(0,G.jsx)(j.z,{className:dt,size:j.q.sm,label:l.ag.get("more.label.context",e),onClick:O,condensedAll:!0})}):null]})]});return z?(0,G.jsx)(ge._P,{menu:(0,G.jsx)(k.r,{uri:a}),onShow:M,children:(0,G.jsx)("div",{className:ct,children:_})}):(0,G.jsx)("div",{className:ct,children:_})}));var xt=a(97345),ht=a(16601),yt=a(65019),jt=a(43806);const bt="XG_S4BkuyAMohXFLGKU1",kt="NrMNU3Sf4iy2c6JJx7R8",ft="n8V7RFwuVx9PaIT1n_mA",vt="kTtB_Y_yizhUj6SMYY8e",Pt="f2XS5sEjEtvk4TdlzHK3",Ct="d9YBRXX3qqxAD43sqNzE",St="Jvp5er4UpzTljUao_SrR",wt="EQCGoB4MqhFPtwUwp1rh",It="UTBQUpUwOPb37ou2ULmH",Nt="Dnwv7PC1vjXvcwYEfqqf",At=i.memo((function({name:e,duration:t,uri:a,bookName:s,usePlayContextItem:n,isChapterLocked:o,isPlayable:r,resumePositionMs:c,isFullyPlayed:d,isExplicit:u,is19PlusOnly:m,spec:h,index:y,consumptionCapExplanation:b}){const f=(0,i.useRef)(c),{isPlaying:v,togglePlay:P,isActive:C}=n({uri:a}),S=(0,re.$P)(),N=(0,Ue.g)(),A=(0,p.I0)(),E=(0,x.W6)(st.vWw,{loadingValue:!1}),R=(0,yt.Y)((e=>{if(e?.item?.uri===a){const t=(0,jt.k)(e)??0;return f.current=t,t}return 0})),B=(0,i.useCallback)((e=>{e.stopPropagation(),e.preventDefault()}),[]),D=(0,X.o)(),F=(0,i.useCallback)((e=>{if(B(e),b&&!N&&E)return void A((0,Te.S3)(b));const t=h.chapterBlockFactory({position:y,uri:a}).playButtonFactory();if(o)D({type:"click",intent:"audiobook-gated-entry-point",itemIdSuffix:"target-chapter"}),S.logInteraction(t.hitShowPaywall({paywalledItem:a}));else{const e=(0,it.aK)({isPlaying:v,isActive:C,spec:t,logger:S,uri:a});P({loggingParams:e})}}),[b,A,y,E,C,N,o,v,S,D,h,B,P,a]),L=(0,i.useCallback)((()=>{const e=h.chapterBlockFactory({position:y,uri:a}).secondaryHitUiReveal();S.logInteraction(e)}),[y,S,h,a]),T=(0,i.useCallback)((e=>{B(e);const t=h.chapterBlockFactory({position:y,uri:a}).contextMenuFactory().hitUiReveal();S.logInteraction(t)}),[y,S,h,B,a]),M=!(o||b),O=(0,G.jsx)(xt.g,{className:g()({[kt]:C}),children:e}),z=(0,G.jsxs)("div",{className:Ct,children:[u&&(0,G.jsx)(w.N,{fullText:!0}),m&&(0,G.jsx)(I.X,{size:16}),(0,G.jsx)("div",{className:St,children:(0,G.jsx)(at.E,{isPlaying:v,fullyPlayed:d,durationMs:t.milliseconds,resumePositionMs:f.current,position:v?R:void 0})})]}),_=(0,G.jsxs)("div",{className:It,children:[(0,G.jsx)("div",{className:Nt,children:M?(0,G.jsx)(ge.yj,{menu:(0,G.jsx)(k.r,{uri:a}),children:(0,G.jsx)(j.z,{className:Pt,size:j.q.xs,label:l.ag.get("more.label.context",e),onClick:T})}):null}),(0,G.jsx)("div",{className:wt,children:(0,G.jsx)(U.f,{size:"small",version:U.u.secondary,onClick:F,isPlaying:v,ariaPlayLabel:l.ag.get("tracklist.a11y.play",e,s),ariaPauseLabel:l.ag.get("tracklist.a11y.pause",e,s),locked:o&&!b,disabled:!r&&!(o||b)})})]}),W=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("hr",{className:ft,"aria-hidden":!0}),(0,G.jsx)(ht.w,{id:`chapter-${y}`,title:O,body:z,footer:_,onDoubleClick:e=>{D({targetUri:a,intent:"play",type:"double-click"}),F(e)},className:bt})]});return M?(0,G.jsx)(ge._P,{menu:(0,G.jsx)(k.r,{uri:a}),onShow:L,children:(0,G.jsx)("div",{className:vt,children:W})}):(0,G.jsx)("div",{className:vt,children:W})})),Et=({bookUri:e,bookName:t,sampleUri:a,isFinishedUnlockingJourney:s,usePlayContextItem:n,spec:o,consumptionCapExplanation:r})=>{const l=function(e,t){const a=(0,et.z)();return(0,i.useCallback)((async(i,s)=>a.getBookContents(e,{offset:i,limit:s,doRefreshSubscription:t})),[t,a,e])}(e,s),c=(0,i.useRef)(!1),d=(0,i.useRef)(0),u=(0,x.W6)(st.eli,{loadingValue:!1}),[g,p]=(0,i.useState)([]),m=(0,i.useCallback)((e=>e?.uri===a),[a]),h=(0,i.useCallback)((e=>(e=>null!==e)(e)&&!m(e)),[m]),y=(0,i.useCallback)((()=>{l&&(c.current||null===d.current||(c.current=!0,l(d.current,50).then((e=>{c.current=!1,d.current=e.nextOffset,e.items.length>0&&p((t=>t.concat(e.items.filter(h))))}))))}),[l,h]);return(0,i.useEffect)((()=>{d.current=0,p([])}),[e]),(0,G.jsx)("ul",{children:(0,G.jsx)(Qe.C,{onReachBottom:y,triggerOnInitialLoad:!0,children:g.map(((e,a)=>{const{name:i,duration:s,uri:l,playability:{playable:c},playedState:{playPositionMilliseconds:d,state:g},isExplicit:p,is19PlusOnly:m}=e,x=function(e){return!e.playability?.playable&&(e.playability?.reason===tt.WY.PaymentRequired||e.playability?.reason===tt.WY.Anonymous)}(e);return u?(0,G.jsx)(At,{name:i,duration:s,uri:l,bookName:t,usePlayContextItem:n,isPlayable:c,isChapterLocked:x,consumptionCapExplanation:r,resumePositionMs:d,isFullyPlayed:g===tt.sY.Completed,isExplicit:p,is19PlusOnly:m,spec:o,index:a},l):(0,G.jsx)(mt,{name:i,duration:s,uri:l,bookName:t,usePlayContextItem:n,isPlayable:c,isChapterLocked:x,consumptionCapExplanation:r,resumePositionMs:d,isFullyPlayed:g===tt.sY.Completed,isExplicit:p,is19PlusOnly:m,spec:o,index:a},l)}))})})};var Rt=a(7863),Ut=a(90755),Bt=a(85039),Dt=a(58912),Ft=a(40537);const Lt="QEd1L2SSRW1ol_sQQN6m",Tt="ENuWK8u3C9kmadnqkErf",Mt="i0gSVhns0PjhiUKm4OG1",Ot="jKVb6K0dga3SfW1dp2Pg",zt="MOpV0_YizQER2NksxLju",_t="vrR8bh9DvivyDfUrh1vD",Wt="_toO3CqMPAPTbny7Rh8R",Kt="Iudw61HRePwOAJpbDRvA",Gt="GWaz1n1SADn9enzKdi_Z",Yt=i.memo((function({coverArt:e,toggleModal:t,uri:a,isBook:i}){const s=(0,Dt.X)(e,{desiredSize:320}),{spec:n,logger:r}=(0,re.fU)(Ut.createDesktopPodcastRatingEventFactory,{data:{identifier:i?o.Wg.RATINGS_AND_REVIEWS_RATINGS_AUDIOBOOK:o.Wg.RATINGS_AND_REVIEWS_RATINGS,uri:a}});return(0,G.jsx)(Ft.Z,{contentLabel:"podcast-rating-modal",isOpen:!0,onRequestClose:t,children:(0,G.jsxs)("div",{className:Lt,children:[(0,G.jsxs)("div",{className:Mt,children:[(0,G.jsx)(m.x,{as:"h1",variant:"titleSmall",className:Wt,children:i?l.ag.get("web-player.audiobooks.rating.rateAudiobook"):l.ag.get("web-player.show.rating.header")}),(0,G.jsxs)("button",{className:Ot,onClick:()=>{const e=n.closeButtonFactory().hitUiNavigateBack();r.logInteraction(e),t()},children:[(0,G.jsx)(Rt.k,{role:"presentation"}),(0,G.jsx)("span",{className:"hidden-visually",children:l.ag.get("web-player.audiobooks.rating.closeModal")})]})]}),(0,G.jsxs)("div",{className:zt,children:[(0,G.jsx)(Bt.Ee,{loading:"eager",src:s?.url,className:Tt}),(0,G.jsxs)("div",{className:_t,children:[(0,G.jsx)(m.x,{as:"p",variant:"bodyMediumBold",className:Kt,children:i?l.ag.get("web-player.audiobooks.rating.wantToRate"):l.ag.get("web-player.show.rating.want-to-rate")}),(0,G.jsx)(m.x,{as:"p",className:Gt,children:l.ag.get("web-player.audiobooks.rating.goToApp")}),(0,G.jsx)(Ee.D,{colorSet:"invertedLight",onClick:()=>{const e=n.okButtonFactory().hitUiNavigateBack();r.logInteraction(e),t()},children:l.ag.get("web-player.audiobooks.rating.ok")})]})]})]})})})),Ht={shuffle:!1,repeat:ne.zq.REPEAT_NONE},Xt=i.memo((function({metadata:e}){const{uri:t,coverArt:a,name:n,htmlDescriptionPlain:r,authorName:d,sample:u,narrators:v,rating:P,isExplicit:C,duration:S,copyrights:w,publishDate:I,price:N,isLocked:A,consumptionCapExplanation:E,signifierText:R,latestPlayedEpisodeLink:U,topics:B}=e,{search:D}=(0,s.TH)(),F=!!new URLSearchParams(D).get("isUnlockingAudiobook"),L=!(!(0,ie.D)(F)||F),T=(0,Ue.g)(),M=(0,q.Z)(a[0]?.url),O=(0,p.I0)(),[z,_]=(0,i.useState)(!1),W=(0,X.o)(),K=(0,x.W6)(st.vWw,{loadingValue:!1}),{spec:Z,logger:$}=(0,re.fU)(h.createDesktopAudiobookEventFactory,{data:{uri:t,identifier:o.Wg.PODCAST_SHOW_AUDIOBOOK}}),{spec:J,logger:Q}=(0,re.fU)(h.createDesktopAudiobookEventFactory,{data:{uri:t,identifier:o.Wg.RATINGS_AND_REVIEWS_RATINGS_AUDIOBOOK}}),{spec:ee,logger:ne}=(0,re.fU)(y.createDesktopLockedAudiobookEventFactory,{data:{uri:t,identifier:o.Wg.PODCAST_SHOW_AUDIOBOOK}}),le=(0,i.useMemo)((()=>Z.actionBarFactory()),[Z]),de=(0,i.useMemo)((()=>J.aboutSectionFactory()),[J]),ue=(0,i.useMemo)((()=>Z.chapterListFactory()),[Z]);(0,i.useEffect)((()=>{W({type:"view",intent:"audiobook"})}),[W]),(0,i.useEffect)((()=>{A&&ne.logImpression(ee.impression())}),[ee,ne,A]);const{isPlaying:ge,togglePlay:pe,usePlayContextItem:me,isActive:Pe,triggerPlay:Ce}=(0,se.n)({uri:t},{featureIdentifier:"audiobook"},Ht),{togglePlay:Se,isPlaying:we,isActive:Ie}=(0,se.n)({uri:u?.uri??""},{featureIdentifier:"audiobook"},Ht),Ne=ge&&!we,Ae=Pe&&!Ie,Ee=(0,i.useCallback)((async()=>{const e=Z.actionBarFactory().playButtonFactory();if(E&&!T&&K)return $.logInteraction(e.hitShowPaywall({paywalledItem:t})),void O((0,Te.S3)(E));if(!A||T)if(T)pe();else{const a=(0,it.aK)({isPlaying:Ne,isActive:Ae,spec:e,logger:$,uri:t});Ae?pe({loggingParams:a}):Ce({skipTo:U?{uri:U}:void 0,loggingParams:a})}}),[Z,E,T,K,A,$,t,O,pe,Ne,Ae,Ce,U]),Re=(0,i.useCallback)((()=>{u?.uri&&(W({targetUri:u.uri,intent:we?"play":"pause",type:"click"}),Se())}),[we,W,Se,u?.uri]),Be=(0,i.useCallback)((()=>{const e=de.ratingButtonFactory().hitUiReveal();Q.logInteraction(e),_((e=>!e))}),[de,Q]),De=(0,ae.jh)(),Fe=A&&!E&&N;return(0,G.jsxs)("section",{className:xe,children:[(0,G.jsx)(c.$,{children:(0,oe.Od)({showOrAudiobookName:n,type:"Audiobook"})}),(0,G.jsx)(Ze,{name:n,authorName:d,uri:t,coverArt:a,backgroundColor:M,togglePlay:Ee,isPlaying:Ne,isLocked:A,isConsumptionCapped:!!E,price:N,logger:$,spec:Z.actionBarFactory()}),(0,G.jsx)(Ke,{name:n,backgroundColor:M,uri:t,togglePlay:Ee,isPlaying:Ne,isLocked:A,consumptionCapExplanation:E,isExplicit:C,duration:S,publishDate:I,price:N,spec:le}),(0,G.jsxs)("div",{className:g()(he,"contentSpacing",{[ye]:De===ae.Uo.LARGE}),children:[(0,G.jsxs)("div",{className:je,children:[(0,G.jsxs)("div",{className:ve,children:[R&&(0,G.jsx)(m.x,{variant:"bodyMedium",as:"p",semanticColor:"textBrightAccent",children:R}),!R&&Fe&&(0,G.jsx)(Je,{price:N})]}),(0,G.jsx)(ce,{htmlDescription:r,narrators:v,spec:de})]}),(0,G.jsxs)("div",{className:be,children:[u?.isPlayable&&(0,G.jsx)(H,{label:l.ag.get("audiobook.page.sample"),images:u.coverArt,title:u.name,duration:u.duration.milliseconds,moreButton:A?null:(0,G.jsx)(b.y,{menu:(0,G.jsx)(k.r,{uri:u.uri}),children:(0,G.jsx)(j.z,{})}),onClick:Re,isPlaying:we,isActive:Ie,size:Y.LARGE,contentRating:u.contentRating?.label,isPlayable:u.isPlayable}),(0,G.jsx)("div",{className:ke,children:(0,G.jsx)(te,{rating:P,onClick:Be})}),B.length>0&&(0,G.jsx)(f.v,{topics:B})]}),(0,G.jsxs)("div",{className:fe,children:[(0,G.jsx)(Et,{bookUri:t,bookName:n,sampleUri:u?.uri,isFinishedUnlockingJourney:L,usePlayContextItem:me,spec:ue,consumptionCapExplanation:E},`${t}-${A}-${!!E}`),(0,G.jsx)(V.k,{copyrights:w})]})]}),z&&(0,G.jsx)(Yt,{toggleModal:()=>_(!1),coverArt:a,uri:t,isBook:!0})]})}));var qt=a(96989),Vt=a(35078),Zt=a(90291),$t=a(75463),Jt=a(67208);const Qt=({uri:e,name:t,backgroundColor:a,spec:s})=>{const n=(0,re.$P)(),o=(0,X.o)(),r=!(0,We.k)(),[c,d]=(0,we.Z)(e),u=(0,i.useCallback)((()=>{o({targetUri:e,intent:c?"unsave":"save",type:"click"});const t=s.followButtonFactory();n.logInteraction(c?t.hitUnfollow({itemToBeUnfollowed:e}):t.hitFollow({itemToBeFollowed:e})),d(!c)}),[o,e,c,s,n,d]),g=(0,i.useCallback)((()=>{n.logInteraction(s.contextButtonFactory().hitUiReveal())}),[n,s]),p=(0,_e.j)();return(0,G.jsx)(Me.o,{backgroundColor:a,children:(0,G.jsxs)(Oe.F,{children:[(0,G.jsx)(ze.r,{children:(0,G.jsx)(Jt.e,{isFollowing:c,onClick:u,disabled:r})},"follow-button"),(0,G.jsx)(b.y,{menu:(0,G.jsx)($t.M,{uri:e}),onShow:g,children:(0,G.jsx)(j.z,{label:l.ag.get("more.label.context",t),size:p})})]})})},ea=(0,i.lazy)((()=>a.e(6341).then(a.bind(a,6341)))),ta=(0,i.lazy)((()=>a.e(8092).then(a.bind(a,28092))));function aa(e){const t=(0,x.W6)(st.$f6),a=(0,x.W6)(st.BOn);return t&&a?(0,G.jsx)(ta,{uri:e.uri}):t?(0,G.jsx)(i.Suspense,{fallback:!0,children:(0,G.jsx)(ea,{...e})}):null}var ia=a(82579),sa=a(64329),na=a(53758),oa=a(2994),ra=a(19514),la=a(45438),ca=a(80090);const da=(0,i.createContext)({setSortState:()=>{throw new Error("setSortState must be used within a ShowFilterProvider")},sortState:[]}),ua=i.memo((function({uri:e,children:t}){return(0,G.jsx)(ca.r,{uri:e,defaultState:[],sortContext:da,localStorageKey:"showFilterParams-v2",children:t})}));a(39301);var ga=a(13199);const pa={field:ga.ay.PUBLISH_DATE,order:ga.i5.DESC},ma={field:ga.ay.PUBLISH_DATE,order:ga.i5.ASC},xa=ma,ha={episodic:pa,sequential:ma,recent:pa};function ya(){return new Map([[pa,{key:"newest-to-oldest",value:l.ag.get("shows.sort.newest-to-oldest")}],[ma,{key:"oldest-to-newest",value:l.ag.get("shows.sort.oldest-to-newest")}]])}function ja(e){return ha[e]}const ba=(0,i.createContext)({setSortState:()=>{throw new Error("setSortState must be used within a ShowSortProvider")},sortState:ja("recent")}),ka=e=>{const t=ya();return Array.from(t.keys()).some((({field:t})=>t===e?.field))},fa=i.memo((function({uri:e,children:t,defaultSortParam:a}){return(0,G.jsx)(ca.r,{uri:e,defaultState:a,sortContext:ba,localStorageKey:"showSortParam",validator:ka,children:t})})),va="cJJXVm4gQW6AdfCQRhpX",Pa="show-episodeBlock-episodeBlock",Ca={totalCount:0,nextOffset:0,items:[]},Sa=i.memo((function({showMetadata:e,usePlayContextItem:t}){const{sortState:a}=(0,i.useContext)(ba),{sortState:s}=(0,i.useContext)(da),n=(0,oa.ZM)(e.uri,a,s),[o,r]=(0,i.useState)(Ca),l=(0,i.useRef)(!1),c=(0,i.useRef)(0),d=(0,i.useCallback)(((e=!1)=>{if(!n)return;const t=c.current;null!==t&&(l.current||(l.current=!0,n(t,50).then((a=>{r((i=>{const s=e?[]:[...i.items];return s.splice(t,a.items.length,...a.items),c.current=a.nextOffset,{...a,items:s}})),l.current=!1}))))}),[n]);return(0,i.useEffect)((()=>{r(Ca)}),[e.uri]),(0,i.useEffect)((()=>{c.current=0,d(!0)}),[d]),(0,G.jsx)(la.JL,{value:"track-list",children:(0,G.jsx)(Qe.C,{onReachBottom:d,triggerOnInitialLoad:!0,children:o.items.map(((a,i)=>a&&(0,G.jsxs)("div",{className:Pa,children:[(0,G.jsx)("hr",{className:va,"aria-hidden":!0}),(0,G.jsx)(ra.V,{index:i,episode:a,showMetadata:e,usePlayContextItem:t},`${a.uri}/${i}`)]},`${i}${a.uri}`)))})})}));a(45205);var wa=a(67408);const Ia={field:ga.YG.ISPLAYED,operator:ga.NK.EQUALS,value:!1},Na={field:ga.YG.STARTEDPLAYING,operator:ga.NK.GREATER_THAN,value:0};const Aa="all-episodes",Ea=({onFilter:e})=>{const{sortState:t,setSortState:a}=(0,i.useContext)(da),s=new Map([[Ia,{key:"is-played",value:l.ag.get("shows.filter.unplayed")}],[Na,{key:"started-playing",value:l.ag.get("shows.filter.in-progress")}]]),n=Array.from(s.values());n.unshift({key:Aa,value:l.ag.get("mwp.podcast.all.episodes")});const o=Array.from(s.keys()),r=(0,i.useCallback)((t=>{if(t===Aa)a([]);else{const e=o.find((e=>s.get(e)?.key===t));e&&a([e])}e()}),[e,a,o,s]);if(!s.size||!o)return null;let c=n[0];const d=Array.from(s.entries()).filter((e=>t?.some((t=>t.field===e[0].field&&t.operator===e[0].operator))));return d.length>0&&(c=d[0][1]),(0,G.jsx)(wa.A,{options:n,onSelect:e=>r(e),selected:c,variant:"bodyMediumBold",semanticColor:"textBase",heading:l.ag.get("drop_down.filter_by")})},Ra=({onSort:e})=>{const{sortState:t,setSortState:a}=(0,i.useContext)(ba),s=ya(),n=Array.from(s.values()),o=Array.from(s.keys()),r=(0,i.useCallback)((t=>{const i=o.find((e=>s.get(e)?.key===t));i&&a(i),e()}),[o,e,s,a]);if(!s.size||!t)return null;const c=Array.from(s.keys()).find((e=>e.field===t.field&&e.order===t.order));if(!c)return null;const d=s.get(c);return d?(0,G.jsx)(wa.A,{options:n,onSelect:e=>r(e),selected:d,heading:l.ag.get("drop_down.sort_by")}):null},Ua="show-showPage-sectionWrapper",Ba="TYB4Y2xQujO7cifhHush",Da="sSXKiPRvp2AHmwfHoCCS",Fa="YJlizbhw6DBPHT9OYbdj",La="TfjbWiK8hca4HHEBnonP",Ta="show-show-episodesHeader",Ma="show-show-episodesFilter",Oa="show-show-episodesFilter",za="fejGrhq7pxGC99cUdyVw",_a="T0OjvsNXAJJGd23eBG2m",Wa="Ppm5YkDdE5ktTPwZC1Dw",Ka="urKYEVZPj2k0hwDT1qzt",Ga=({spec:e})=>{const t=(0,re.$P)(),{canSort:a,canFilter:s}=(0,oa.zZ)().capabilities,n=(0,i.useCallback)((()=>{t.logInteraction(e.episodeListFactory().filterButtonFactory().hitFilter())}),[t,e]),o=(0,i.useCallback)((()=>{t.logInteraction(e.episodeListFactory().sortButtonFactory().hitSort())}),[t,e]);return(0,G.jsxs)("div",{className:Ta,children:[s&&(0,G.jsx)("div",{className:Oa,children:(0,G.jsx)(Ea,{onFilter:n})}),!s&&(0,G.jsx)(m.x,{as:"h3",variant:"titleSmall",semanticColor:"textBase",className:za,children:l.ag.get("mwp.podcast.all.episodes")}),a&&(0,G.jsx)("div",{className:Ma,children:(0,G.jsx)(Ra,{onSort:o})})]})};var Ya=a(39600),Ha=a(40234),Xa=a(58301);const qa=e=>{switch(e){case tt.it.TRAILER:return l.ag.get("podcasts.next-episode.trailer");case tt.it.UP_NEXT:return l.ag.get("podcasts.next-episode.up-next");case tt.it.CONTINUE_LISTENING:return l.ag.get("podcasts.next-episode.continue-listening");case tt.it.FIRST_PUBLISHED:return l.ag.get("podcasts.next-episode.first-published");case tt.it.LATEST_PUBLISHED:return l.ag.get("podcasts.next-episode.latest-published");default:return}},Va=({breakpoint:e,metadata:t,showId:a,spec:n})=>{const{uri:o,trailer:r,topics:c,description:d,htmlDescription:u,coverArt:p,rating:h}=t,y=(0,re.$P)(),k=(0,i.useMemo)((()=>n.episodeListFactory()),[n]),[v,P]=(0,i.useState)(!1),C=(0,X.o)(),S=(0,Ue.g)(),{sortState:w}=(0,i.useContext)(da),I=(0,oa.zZ)(),{usePlayContextItem:N}=(0,se.n)({uri:o,metadata:{[ne.sb.SORTING_CRITERIA]:I.getPlayerSort(xa),[ne.sb.FILTERING_PREDICATE]:I.getPlayerFilter(w)}},{featureIdentifier:"show"}),{isActive:A,isPlaying:E,togglePlay:R}=N({uri:r?.uri||""}),U=(0,i.useCallback)((e=>{C({intent:"expand-description",type:"click"});const t=n.aboutSectionFactory().seeMoreButtonFactory(),a=e?t.hitUiReveal():t.hitUiHide();y.logInteraction(a)}),[y,C,n]),B=(0,i.useCallback)(((e,t)=>{const a=n.aboutSectionFactory().topicFactory(t).hitUiNavigate({destination:t.uri});y.logInteraction(a)}),[y,n]),D=r?{name:r.name,uri:r.uri,audio:{items:r.audio.items.map((e=>({url:e.url})))}}:null,F=(0,ra.e)(t),L=(0,na.s)(D,F),T=(0,i.useCallback)((()=>{r?.uri&&(S?L():(C({targetUri:r.uri,intent:E?"play":"pause",type:"click"}),R()))}),[L,S,E,C,R,r?.uri]),{ref:M,breakpoint:O}=(0,ae.Db)({[ae.Uo.MEDIUM]:0,[ae.Uo.LARGE]:600}),z=c.length>0,_=d||u,W=_||z,K=(()=>{const e=(0,Xa.E)(),t=(0,s.TH)(),a=(0,x.W6)(st.Khh),i=(0,Ya.vI)(Ha.k.ILRShow,t);return!!e&&(i||a===st.juN.VARIANT)})();return(0,G.jsxs)("div",{className:g()(Ba,"contentSpacing",{[Da]:e===ae.Uo.LARGE}),ref:M,children:[(0,G.jsxs)("div",{className:Fa,children:[W&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(m.x,{as:"h3",variant:"titleSmall",semanticColor:"textBase",className:za,children:l.ag.get("artist.about")}),_&&(0,G.jsx)(le.o,{maxLines:4,content:(d||"").trim(),onExpanded:U,htmlContent:u||void 0}),h&&(0,G.jsx)("div",{className:Ka,children:(0,G.jsx)(te,{rating:h,onClick:()=>P(!0)})}),z&&(0,G.jsx)(f.v,{topics:c,onClick:B})]}),(0,G.jsx)(aa,{showId:a,uri:o}),r&&!t.nextBestEpisode&&(0,G.jsx)(ia._,{menu:(0,G.jsx)(sa.k,{uri:r.uri,showUri:o,sharingInfo:r.sharingInfo}),children:(0,G.jsx)(H,{label:l.ag.get("track-trailer"),className:_a,images:r.coverArt,title:r.name,duration:r.duration.milliseconds,moreButton:(0,G.jsx)(b.y,{menu:(0,G.jsx)(sa.k,{uri:r.uri,sharingInfo:r.sharingInfo,showUri:o}),children:(0,G.jsx)(j.z,{})}),onClick:T,isPlaying:E,isActive:A,size:Y.LARGE,contentRating:r.contentRating?.label})})]}),(0,G.jsx)(ae.ZU.Provider,{value:O,children:(0,G.jsxs)("div",{className:La,"data-testid":"show-all-episode-list",children:[t.nextBestEpisode&&(0,G.jsx)(ra.V,{showMetadata:t,episode:t.nextBestEpisode.data,usePlayContextItem:N,status:qa(t.nextBestEpisode.type),variant:"next-best-episode"}),(0,G.jsx)(Ga,{spec:n}),(0,G.jsx)(re.Nh,{spec:k,children:(0,G.jsx)(Sa,{showMetadata:t,usePlayContextItem:N})})]})}),(0,G.jsx)(V.k,{copyrights:[]}),K&&(0,G.jsx)("div",{"data-testid":"show-ilr-component-to-be-added"}),v&&(0,G.jsx)(Yt,{toggleModal:()=>P(!1),coverArt:p,uri:o,isBook:!1})]})},Za=i.memo(Va);var $a=a(1502);const Ja=({reason:e})=>{const t=(0,x.W6)(st.ALT),a=function(e){switch(e){case"OTP":return l.ag.get("podcasts.subscriber-indicator.otp");case"SUBSCRIPTION":return l.ag.get("podcasts.subscriber-indicator.subscription");default:return""}}(e);return t&&a?(0,G.jsx)(m.x,{className:Wa,children:a}):null};const Qa=({metadata:e,backgroundColor:t})=>{const{uri:a,coverArt:i,name:s,podcastType:n,publisherName:o,gatedContentAccessReason:r}=e;return(0,G.jsxs)(Ye.gF,{backgroundColor:t,children:[(0,G.jsx)(He.W,{children:(0,G.jsx)(Xe.i,{text:s,dragUri:a,dragLabel:s})}),(0,G.jsx)($a.k,{children:(0,G.jsx)(ia._,{menu:(0,G.jsx)($t.M,{uri:a}),children:(0,G.jsx)(Ye.Oe,{loading:"eager",name:s,images:i,placeholderType:"show",shape:Ye.Kc.SQUARE})})}),(0,G.jsxs)(Ye.sP,{children:[(0,G.jsxs)(qe.g,{children:["SHOW"===n?l.ag.get("type.show"):l.ag.get("type.podcast"),r&&(0,G.jsx)(Ja,{reason:r})]}),(0,G.jsx)(ia._,{menu:(0,G.jsx)($t.M,{uri:a}),children:(0,G.jsx)(Ye.xd,{dragUri:a,dragLabel:s,scaleAtMinWidth:Ye.vz,children:(0,G.jsx)("span",{"data-testid":"show-title",children:s})})}),(0,G.jsx)(Ve.m,{children:o})]})]})};var ei=a(71059);const ti=({metadata:e,showId:t})=>{const{coverArt:a,name:s,uri:o}=e,{spec:r}=(0,re.fU)(n.createDesktopPodcastEventFactory,{data:{uri:o}}),l=(0,i.useMemo)((()=>r.actionBarFactory()),[r]),d=(0,q.Z)(a[0]?.url||null),u=(0,ae.jh)();return(0,G.jsxs)("section",{className:Ua,children:[(0,G.jsx)(c.$,{children:(0,oe.Od)({showOrAudiobookName:s,type:"Podcast"})}),(0,G.jsx)(Qa,{metadata:e,backgroundColor:d}),(0,G.jsx)(Qt,{uri:o,name:s,backgroundColor:d,spec:l}),(0,G.jsx)(Za,{breakpoint:u,metadata:e,showId:t,spec:r})]})},ai=(0,i.memo)((function(){const{showId:e=""}=(0,s.UO)(),t=`spotify:show:${e}`,{data:a,error:n,redirectUri:c}=(0,Zt.l)(t);if(c){const e=(0,r._b)(c);return(0,G.jsx)(qt.InstrumentedRedirect,{to:e.toURLPath(!0)})}return!a||n?n instanceof Vt.E?(0,G.jsx)(d.h,{hasError:!0,errorMessage:l.ag.get("error-page.not-available-in-region.title")}):(0,G.jsx)(d.h,{hasError:!!n,errorMessage:l.ag.get("error.not_found.title.page")}):(0,tt.l6)(a)?(0,G.jsx)(i.Suspense,{fallback:null,children:(0,G.jsx)(ei.C,{pageId:o.Wg.PODCAST_SHOW_AUDIOBOOK,uri:t,children:(0,G.jsx)(Xt,{metadata:a},`${!!a.consumptionCapExplanation}`)})}):(0,G.jsx)(i.Suspense,{fallback:null,children:(0,G.jsx)(ei.C,{pageId:o.Wg.PODCAST,uri:t,children:(0,G.jsx)(ua,{uri:a.uri,children:(0,G.jsx)(fa,{uri:a.uri,defaultSortParam:ja(a.consumptionOrder),children:(0,G.jsx)(ti,{showId:e,metadata:a})})})})})}))},39600:(e,t,a)=>{a.d(t,{vI:()=>i});a(86277);const i=(e,t)=>{const a=t?new URLSearchParams(t.search):void 0;return"1"===a?.get(e)}},40234:(e,t,a)=>{a.d(t,{k:()=>i});let i=function(e){return e.I18nSEO="i18nSEO",e.RTPTrackCredits="rtpv2p2",e.I18nAdditionalPages="i18nap",e.RichPlaylistPages="rpp",e.ILRAlbum="ilra",e.ILRAlbumAbove="ilraa",e.ILRAlbumBelow="ilrab",e.ILRShow="ilrs",e.PlaylistInternalTrackLinks="pitl",e.PlaylistInternalTrackAndArtistLinks="pital",e}({})}}]);
|
|
//# sourceMappingURL=xpui-routes-show.js.map
|