solorice/config/spicetify/Extracted/Raw/xpui/2611.js

2 lines
6.3 KiB
JavaScript
Executable File

"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[2611],{22611:(e,i,t)=>{t.d(i,{B:()=>F,q:()=>_});var n=t(52542),a=t(12341),r=(t(7651),t(14551),t(83234),t(30456),t(26701),t(47994),t(37417),t(11737),t(51691),t(702),t(5672),t(43379),t(34192),t(88856),t(51565),t(18316),t(30758)),o=t(88677),l=t(93493),s=t(34382),u=t(80366),c=t(7352),d=t(91471),p=t(83643),y=t(53163),g=t(48106),f=t(88712),v=t(64333),b=t(57581),m=t(8016),h=t(8574),P=t(86429),j=t(27719),w=t(62562),k=t(58114),x=t(64348),I=t(57186),C=t(46198),S=t(53607),U=t(60455),O=t(33814),B=t(60256),A=t(12574),T=t(4140),D=t(97724),M=t(86070);function R(e,i){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);i&&(n=n.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),t.push.apply(t,n)}return t}function q(e){for(var i=1;i<arguments.length;i++){var t=null!=arguments[i]?arguments[i]:{};i%2?R(Object(t),!0).forEach((function(i){(0,n.A)(e,i,t[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):R(Object(t)).forEach((function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))}))}return e}function F(e){return{uri:e.uri,name:e.name,trailer:e.trailer,showTypes:e.showTypes}}var E=function(e){return"activation-trigger-mme-".concat(e)},_=r.memo((function(e){var i,t,n,R,_,z,N,W,V,H,K,L,Z,G,J=e.index,Q=void 0===J?-1:J,X=e.showMetadata,Y=e.episode,$=e.usePlayContextItem,ee=e.status,ie=e.variant,te=(0,j.c)(),ne=Y.playedState.playPositionMilliseconds,ae=Y.uri,re=(0,r.useRef)(null),oe=(0,r.useState)(Y.playedState.state===T._w.Completed),le=(0,a.A)(oe,2),se=le[0],ue=le[1],ce=(0,m.P)(),de=ce.draggable,pe=ce.onDragStart,ye=(0,P.V)(),ge=(0,U.y)(),fe=(0,h.W)(),ve=(0,o.wA)(),be=(0,A.r)(s.d,{data:{uri:ae,reason:Y.requestId||"",position:Q}}),me=be.UBIFragment,he=be.spec,Pe=be.logger,je=(0,B.t)(he),we=$({uri:ae}),ke=we.isActive,xe=we.isPlaying,Ie=we.togglePlay,Ce=(0,O.S)(1e4,(function(e){var i;return(null==e||null===(i=e.item)||void 0===i?void 0:i.uri)===ae})),Se=(0,a.A)(Ce,1)[0];(0,r.useEffect)((function(){xe&&(re.current=Se)}),[xe,Se]),(0,r.useEffect)((function(){!xe&&re.current&&Y.duration.milliseconds<=re.current&&ue(!0)}),[xe,Y.duration.milliseconds]);var Ue=(0,r.useCallback)((function(e){e||(re.current=0),ue(e)}),[]),Oe=function(e){if(e.target===e.currentTarget){var i="".concat(Y.name," • ").concat(X.name);pe(e,{itemUris:[ae],dragLabelText:i,contextUri:X.uri})}},Be=F(X),Ae=(0,w.C)(q(q({},Y),{},{coverArt:{sources:Y.coverArt}}),Be),Te=(0,r.useCallback)((function(){if(Y.episodeType===T.I_.Episode&&te)b.h.set((function(){return{triggerId:E(Y.uri),triggerAction:null}}));else if(ye)Ae();else{var e;e=xe?he.playButtonFactory().hitPause({itemToBePaused:ae}):ke?he.playButtonFactory().hitResume({itemToBeResumed:ae}):he.playButtonFactory().hitPlay({itemToBePlayed:ae});var i=Pe.logInteraction(e);fe({targetUri:ae,intent:xe?"pause":"play",type:"click"}),Ie({loggingParams:i})}}),[ke,Ae,fe,Ie,ae,xe,ye,Y,te,Pe,he]),De=(0,r.useCallback)((function(){Pe.logInteraction(he.hitUiNavigate({destination:ae})),fe({type:"click",targetUri:ae,intent:"navigate"})}),[ae,fe,Pe,he]),Me=null!==(i=null===(t=Y.podcastSubscription)||void 0===t?void 0:t.isPaywalled)&&void 0!==i&&i,Re=null!==(n=null===(R=Y.podcastSubscription)||void 0===R?void 0:R.isUserSubscribed)&&void 0!==n&&n,qe=Me&&!Re,Fe=Me&&ye,Ee=(0,D.b)({contentRating:null===(_=Y.contentRating)||void 0===_?void 0:_.label,isPaywalled:Me}).badges,_e=(0,r.useCallback)((function(){return ve((0,c.Tf)(X.uri))}),[X.uri,ve]),ze=(0,r.useCallback)((function(e){var i,t=e;(qe||Fe)&&(t=(0,M.jsx)(v.f,{enabled:!0,showUri:(null===(i=Y.podcast)||void 0===i?void 0:i.uri)||X.uri,children:t}));return!Y.playability.playable&&Ee.nineteen&&(t=(0,M.jsx)("div",{onClick:function(e){e.stopPropagation(),_e()},children:e})),t=(0,M.jsx)(d.k,{id:E(ae),targetURI:(0,u.o_)(ae),children:t})}),[ae,qe,Fe,X.uri,Ee.nineteen,Y.playability.playable,_e,null===(z=Y.podcast)||void 0===z?void 0:z.uri]),Ne=(0,l.NC)(k.cKd,{loadingValue:!1});return(0,M.jsx)(me,{spec:he,children:(0,M.jsx)(S.pZ,{value:"row",index:Q,children:(0,M.jsx)(p.h,{onShow:function(){Pe.logInteraction(he.secondaryHitUiReveal())},menu:(0,M.jsx)(y.b,{uri:ae,showUri:X.uri,sharingInfo:Y.sharingInfo,isPlayed:se,onMarkAsPlayed:Ue}),children:Ne?(0,M.jsx)(f.k,{ref:je,requestId:Y.requestId,index:Q,uri:ae,size:ge,images:Y.coverArt||[],name:Y.name,showName:(null===(N=Y.podcast)||void 0===N?void 0:N.name)||X.name,description:Y.description,isPlayable:Y.playability.playable||qe,fullyPlayed:se,durationMs:Y.duration.milliseconds,releaseDate:(null===(W=Y.releaseDate)||void 0===W?void 0:W.isoString)||"",resumePositionMs:null!==(V=re.current)&&void 0!==V?V:ne,draggable:de,handleDragStart:Oe,handlePlaybackClick:Te,handleClick:De,isCurrentlyPlaying:ke,isPaywalled:Me,isUserSubscribed:Re,isPlaying:xe,position:xe?Se:void 0,episodeSharingInfo:Y.sharingInfo,onMarkAsPlayed:Ue,contentInformation:Y.contentInformation,showUri:(null===(H=Y.podcast)||void 0===H?void 0:H.uri)||X.uri,mediaTypes:null!==(K=Y.mediaTypes)&&void 0!==K?K:void 0,badges:(0,M.jsxs)(M.Fragment,{children:[Ee.explicit&&(0,M.jsx)(x.U,{}),Ee.paid&&(0,M.jsx)(I.y,{}),Ee.nineteen&&(0,M.jsx)(C.q,{size:16})]}),playButtonWrapper:ze,onMoreButtonClick:function(){Pe.logInteraction(he.moreButtonFactory().hitUiReveal())},status:ee,variant:ie}):(0,M.jsx)(g.R,{ref:je,requestId:Y.requestId,index:Q,uri:ae,size:ge,images:Y.coverArt||[],name:Y.name,showName:X.name,description:Y.description,isPlayable:Y.playability.playable||qe,fullyPlayed:se,durationMs:Y.duration.milliseconds,releaseDate:(null===(L=Y.releaseDate)||void 0===L?void 0:L.isoString)||"",resumePositionMs:null!==(Z=re.current)&&void 0!==Z?Z:ne,handleDragStart:Oe,handlePlaybackClick:Te,handleClick:De,isCurrentlyPlaying:ke,isPaywalled:Me,isUserSubscribed:Re,isPlaying:xe,position:xe?Se:void 0,episodeSharingInfo:Y.sharingInfo,onMarkAsPlayed:Ue,contentInformation:Y.contentInformation,badges:(0,M.jsxs)(M.Fragment,{children:[Ee.explicit&&(0,M.jsx)(x.U,{}),Ee.paid&&(0,M.jsx)(I.y,{}),Ee.nineteen&&(0,M.jsx)(C.q,{size:16})]}),playButtonWrapper:ze,onMoreButtonClick:function(){Pe.logInteraction(he.moreButtonFactory().hitUiReveal())},showUri:X.uri,mediaTypes:null!==(G=Y.mediaTypes)&&void 0!==G?G:void 0,status:ee,variant:ie})})})})}))}}]);
//# sourceMappingURL=2611.js.map