mirror of
https://github.com/kristoferssolo/solorice.git
synced 2025-10-21 20:10:34 +00:00
2 lines
26 KiB
JavaScript
Executable File
2 lines
26 KiB
JavaScript
Executable File
"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[4374],{15374:(e,n,t)=>{t.d(n,{x:()=>Z});var a=t(12341);const l="playback-bar",r="playback-bar__progress-time-elapsed",o="gglUjikTBtMzCZFgSmpS",i="dN6OLjjcmnuleiECu55A",s="DSdahCi0SDG37V9ZmsGO",c="playback-progressbar-container";var u=t(30758),d=t(97500),p=t.n(d),v=t(88677),b=t(13534),g=t(93493),f=t(92107),h=t(40441),m=t(26024),k=t(8540),y=t(34300),x=t(73188);const w="main-playbackBarRemainingTime-container";var O=t(86070),j=function(e){var n=e.position,t=e.duration,l=e.isPreview,r=e.semanticColor,o=void 0===r?"textSubdued":r,i=e.isFullscreenMode,s=void 0!==i&&i,c=e.className,d=(0,y.x)(k.fC,!1),v=(0,a.A)(d,2),g=v[0],f=v[1],h=(0,u.useCallback)((function(){l||f(!g)}),[g,f,l]);return(0,O.jsx)(b.E,{as:"div","data-testid":"playback-duration","data-test-position":n,variant:s?"bodyMedium":"marginal",className:p()(w,c),onClick:h,semanticColor:o,children:g?"-".concat((0,x.f)(t-n)):(0,x.f)(t)})},S=t(85093),D=(t(78551),t(34518),t(47994),t(2823),t(65594),t(43772)),C=t(5248),R=t(93892);const A="Bn7RYdPUyzN4qo1bC1Ic",N="OEe8k2xe6o6x9x0FAc4b";var P=[{name:"Anakin",vars:{"--bg-color":"","--fg-color":"transparent","--is-active-fg-color":"transparent","--progress-bar-height":"7px","--core-color":"white","--edge-glow-color":"rgb(55, 132, 214)","--blur-glow-color":"#2e77d0","--blur-radius":"16px","--spread-radius":"8px","--saber-hilt-url":"url(".concat((0,D.b)("images/sw_saber_anakin.png"),")"),"--saber-hilt-overlap":"5px"}},{name:"Luke",vars:{"--bg-color":"","--fg-color":"transparent","--is-active-fg-color":"transparent","--progress-bar-height":"9px","--core-color":"white","--edge-glow-color":"rgb(135, 220, 90)","--blur-glow-color":"#1ed760","--blur-radius":"16px","--spread-radius":"4px","--saber-hilt-url":"url(".concat((0,D.b)("images/sw_saber_luke.png"),")"),"--saber-hilt-overlap":"5px"}},{name:"Vader",vars:{"--bg-color":"","--fg-color":"transparent","--is-active-fg-color":"transparent","--progress-bar-height":"10px","--core-color":"white","--edge-glow-color":"rgb(229, 17, 21)","--blur-glow-color":"#cd1a2b","--blur-radius":"20px","--spread-radius":"14px","--saber-hilt-url":"url(".concat((0,D.b)("images/sw_saber_vader.png"),")"),"--saber-hilt-overlap":"6px"}},{name:"Rey",vars:{"--bg-color":"","--fg-color":"transparent","--is-active-fg-color":"transparent","--progress-bar-height":"8px","--core-color":"white","--edge-glow-color":"rgb(249, 164, 11)","--blur-glow-color":"rgb(253, 175, 33)","--blur-radius":"20px","--spread-radius":"5px","--saber-hilt-url":"url(".concat((0,D.b)("images/sw_saber_rey.png"),")"),"--saber-hilt-overlap":"3px"}},{name:"Leia",vars:{"--bg-color":"","--fg-color":"transparent","--is-active-fg-color":"transparent","--progress-bar-height":"9px","--core-color":"white","--edge-glow-color":"rgb(55, 132, 214)","--blur-glow-color":"#2e77d0","--blur-radius":"16px","--spread-radius":"8px","--saber-hilt-url":"url(".concat((0,D.b)("images/sw_saber_leia.png"),")"),"--saber-hilt-overlap":"2px"}},{name:"Mace",vars:{"--bg-color":"","--fg-color":"transparent","--is-active-fg-color":"transparent","--progress-bar-height":"9px","--core-color":"white","--edge-glow-color":"rgb(90, 22, 167)","--blur-glow-color":"rgb(172, 57, 193)","--blur-radius":"20px","--spread-radius":"8px","--saber-hilt-url":"url(".concat((0,D.b)("images/sw_saber_mace.png"),")"),"--saber-hilt-overlap":"1px"}},{name:"Ahsoka",vars:{"--bg-color":"","--fg-color":"transparent","--is-active-fg-color":"transparent","--progress-bar-height":"6px","--core-color":"white","--edge-glow-color":"rgb(255,255,255)","--blur-glow-color":"rgb(255,255,255)","--blur-radius":"20px","--spread-radius":"5px","--saber-hilt-url":"url(".concat((0,D.b)("images/sw_saber_ahsoka1.png"),")"),"--saber-hilt-overlap":"-9px","--saber-hilt-width":"100px","--saber-hilt-height":"36px"}}],E=["spotify:playlist:37i9dQZF1DXaUaRhCgtpCo","spotify:playlist:69BOXIItwwyxTgdz6flzvU","spotify:playlist:37i9dQZF1DWUgUvAPAFxdh"],_=["official_star_wars","kirbysayshi","hansencc"],z=/Star Wars/i,M="THX1138",H=M.length;function T(e){var n,t,l,r,o,i,s,c,d=e.onChange,p=function(e){var n=(0,u.useState)(0),t=(0,a.A)(n,2),l=t[0],r=t[1];return{next:function(){r((l+1)%P.length)},config:e?P[l]:null}}((n=(0,u.useState)([]),t=(0,a.A)(n,2),l=t[0],r=t[1],o=(0,u.useState)(!1),i=(0,a.A)(o,2),s=i[0],c=i[1],(0,u.useEffect)((function(){var e=function(e){for(l.push(e.key);l.length>H;)l.shift();l.join("")===M&&c(!s),r((0,S.A)(l))};return window.addEventListener("keypress",e),function(){window.removeEventListener("keypress",e)}}),[l,s]),(0,C.o)((function(e){var n,t,a,l,r=null!==(n=null==e?void 0:e.context.uri)&&void 0!==n?n:"",o=null!==(t=null==e||null===(a=e.context)||void 0===a||null===(a=a.metadata)||void 0===a?void 0:a.context_owner)&&void 0!==t?t:"",i=null!==(l=null==e?void 0:e.item)&&void 0!==l?l:void 0;return!!E.includes(r)||!!_.includes(o)||!!(0,R.v)(i)&&(z.test(i.name)||z.test(i.album.name))}))||s)),v=p.next,b=p.config,g=(0,u.useRef)(d);return g.current=d,(0,u.useEffect)((function(){var e;g.current(null!==(e=null==b?void 0:b.vars)&&void 0!==e?e:null)}),[b]),b?(0,O.jsx)("div",{className:A,children:(0,O.jsx)("button",{"data-testid":"saber-hilt-button","aria-label":f.Ru.get("playback-control.a11y.lightsaber-hilt-button",null==b?void 0:b.name),className:N,style:b.vars,onClick:v})}):null}var B=["spotify:playlist:37i9dQZF1DXc3KPAjGyPdm"];var W=t(8574),I=t(58114),V=t(64869),L=t(33814),F=t(18741),X=1e3,Z=function(e){var n,t,d,k,y,w=e.isPreview,S=e.isFullscreenMode,D=void 0!==S&&S,R=e.timerPlacement,A=void 0===R?"inline":R,N=e.onChange,P=e.onDragStart,E=e.onDragEnd,_=(0,g.NC)(I.O14),z=(0,u.useState)(null),M=(0,a.A)(z,2),H=M[0],Z=M[1],U=(0,W.W)(),q=(0,V.z)(),Y=(0,C.o)((function(e){return e}),(function(e,n){var t,a;return(null==e?void 0:e.duration)===(null==n?void 0:n.duration)&&(null==e?void 0:e.hasContext)===(null==n?void 0:n.hasContext)&&(null==e||null===(t=e.restrictions)||void 0===t?void 0:t.canSeek)===(null==n||null===(a=n.restrictions)||void 0===a?void 0:a.canSeek)})),Q=(0,F.p)(),G=Q.seekBackward,K=Q.seekForward,$=Q.seekOffsetMs,J=null!==(n=null==Y?void 0:Y.duration)&&void 0!==n?n:0,ee=null!==(t=null==Y?void 0:Y.hasContext)&&void 0!==t&&t,ne=null!==(d=null==Y||null===(k=Y.restrictions)||void 0===k?void 0:k.canSeek)&&void 0!==d&&d,te=(0,L.S)(X),ae=(0,a.A)(te,3),le=ae[0],re=ae[1],oe=ae[2],ie=(0,u.useState)(null),se=(0,a.A)(ie,2),ce=se[0],ue=se[1],de=null!==ce?ce:le,pe=null!==ce?ce:le+(_&&!oe?X:0),ve=function(e){ue(e*J),null==P||P()},be=(de>0||J>0)&&"true"!==(null==Y||null===(y=Y.item)||void 0===y||null===(y=y.metadata)||void 0===y?void 0:y.is_narration),ge=(0,x.f)(be?de:NaN),fe=(0,x.f)(be?J:NaN),he=(0,v.d4)((function(e){var n;return!(null==e||null===(n=e.ui)||void 0===n||null===(n=n.fullscreenMode)||void 0===n||!n.isOpen)})),me=(0,C.o)((function(e){var n,t=null!==(n=null==e?void 0:e.context.uri)&&void 0!==n?n:"";return B.includes(t)})),ke=(0,m.O)();if(D!==he)return null;var ye="above"===A?i:o;return(0,O.jsxs)("div",{className:p()(l,ye),children:[(0,O.jsx)(b.E,{"data-testid":"playback-position",as:"div",variant:D?"bodyMedium":"marginal",className:r,semanticColor:D?"textBase":"textSubdued",children:ge}),(0,O.jsxs)("div",{className:c,children:[ee?(0,O.jsx)(T,{onChange:function(e){Z(e)}}):null,(0,O.jsx)(h.z2,{labelText:f.Ru.get("playback-control.a11y.seek-slider-button"),value:pe,updateFrequency:X,offFrequencyUpdate:oe,max:J,step:$,"aria-valuetext":f.Ru.get("download.progress-global",ge,fe),isInteractive:ee&&be,onDragStart:ve,onDragMove:ve,onDragEnd:function(e,n){var t=n.wasDraggedBeforeReleased;if(ue(null),U({intent:"seek",type:"click"}),null==E||E(),ne){var a=e*J;re(a),q.seekTo(a),null==N||N(a,t?"drag":"hit")}},onStepBackward:function(){if(ne){var e=G();re(Math.max(0,Math.min(J,le-e)))}},onStepForward:function(){if(ne){var e=K();re(Math.max(0,Math.min(J,le+e)))}},saberConfig:H,isPlayingStrangerThings:me,isAttackOnTitanEasterEggActive:ke,"data-testid":"playback-progressbar",enableAnimation:_})]}),(0,O.jsx)(j,{position:de,duration:be?J:NaN,isPreview:w,semanticColor:D?"textBase":"textSubdued",isFullscreenMode:D,className:s})]})}},63186:(e,n,t)=>{t.d(n,{x:()=>g});var a=t(15057),l=t(11854),r=t(15801),o=t(12137),i=t(92107),s=t(17011),c=t(56827),u=t(8574),d=t(64869),p=t(5248),v=t(75397),b=t(86070),g=function(e){var n=e.iconSize,t=void 0===n?"small":n,g=e.onClick,f=e.className,h=e.showDelayOnHover,m=(0,d.z)(),k=(0,u.W)(),y=(0,p.o)((function(e){return{hasContext:null==e?void 0:e.hasContext,isPaused:null==e?void 0:e.isPaused,canPause:null==e?void 0:e.restrictions.canPause,canResume:null==e?void 0:e.restrictions.canResume}}),v.a),x=y.hasContext,w=y.isPaused,O=y.canPause,j=y.canResume,S=(0,a.YQ)((function(e){k({type:"click",intent:w?"play":"pause"}),w&&j?(null==g||g("resume"),m.resume(),(0,c.aX)(e,"play/resume")):!w&&O&&(null==g||g("pause"),m.pause())}),100,{leading:!0,trailing:!1}),D=w?i.Ru.get("playback-control.play"):i.Ru.get("playback-control.pause"),C=!x||(w?!j:!O);return(0,b.jsx)(s.Zp,{label:D,showDelay:h,children:(0,b.jsx)(l.$,{iconOnly:w?r.A:o._,className:f,size:{small:"small",medium:"medium",large:"large"}[t]||"small",disabled:C,"aria-label":D,"data-testid":"control-button-playpause",onClick:S,colorSet:"invertedLight"})})}},64233:(e,n,t)=>{t.d(n,{s:()=>y});var a=t(12341),l=t(52542),r=(t(13661),t(97500)),o=t.n(r),i=t(2648),s=t(25025),c=t(11234),u=t(92107),d=t(17011),p=t(8574),v=t(37247),b=t(5248),g=t(53724);const f="vW9NFcNIj8useE43Vx9G";var h=t(86070);function m(e,n,t){return n&&t?(e+1)%3:n?(e+1)%2:t?1===e?2:(e+2)%4:g.p.REPEAT_NONE}var k=(0,l.A)((0,l.A)((0,l.A)({},g.p.REPEAT_NONE,{get label(){return u.Ru.get("playback-control.disable-repeat")},intent:"repeat-off",ariaChecked:"false"}),g.p.REPEAT_CONTEXT,{get label(){return u.Ru.get("playback-control.enable-repeat")},intent:"repeat-all",ariaChecked:"true"}),g.p.REPEAT_TRACK,{get label(){return u.Ru.get("playback-control.enable-repeat-one")},intent:"repeat-single",ariaChecked:"mixed"}),y=function(e){var n=e.onClick,t=e.className,r=e.showDelayOnHover,u=(0,p.W)(),y=(0,v.V)(),x=y.setRepeat,w=y.repeat,O=(0,b.o)((function(e){var n,t;return[null!==(n=null==e?void 0:e.restrictions.canToggleRepeatContext)&&void 0!==n&&n,null!==(t=null==e?void 0:e.restrictions.canToggleRepeatTrack)&&void 0!==t&&t]})),j=(0,a.A)(O,2),S=j[0],D=j[1],C=!S&&!D,R=k[m(w,S,D)].label,A=w!==g.p.REPEAT_NONE;return(0,h.jsx)(d.Zp,{label:R,showDelay:r,children:(0,h.jsx)(i.H,{className:o()((0,l.A)({},f,A),t),iconOnly:w===g.p.REPEAT_TRACK?s.I:c.B,size:"small",disabled:C,"aria-label":R,"data-testid":"control-button-repeat",onClick:function(){var e=m(w,S,D);u({type:"click",intent:k[e].intent}),null==n||n(e),x(e)},role:"checkbox","aria-checked":k[w].ariaChecked,semanticColor:A?"textBrightAccent":void 0})})}},70648:(e,n,t)=>{t.d(n,{h:()=>d});var a=t(2648),l=t(61177),r=t(92107),o=t(17011),i=t(8574),s=t(64869),c=t(5248),u=t(86070),d=function(e){var n=e.onClick,t=e.className,d=e.showDelayOnHover,p=(0,i.W)(),v=(0,s.z)(),b=(0,c.o)((function(e){var n;return null!==(n=null==e?void 0:e.restrictions.canSeek)&&void 0!==n&&n}));return(0,u.jsx)(o.Zp,{label:r.Ru.get("playback-control.skip-backward-15"),showDelay:d,children:(0,u.jsx)(a.H,{iconOnly:l.e,size:"small",onClick:function(){p({type:"click",intent:"skip-back-15"}),null==n||n(-15e3),v.seekBackward(15e3)},disabled:!b,"aria-label":r.Ru.get("playback-control.skip-backward-15"),"data-testid":"control-button-seek-back-15",className:t})})}},78080:(e,n,t)=>{t.d(n,{v:()=>d});var a=t(2648),l=t(20637),r=t(92107),o=t(17011),i=t(8574),s=t(64869),c=t(5248),u=t(86070),d=function(e){var n=e.onClick,t=e.className,d=e.showDelayOnHover,p=(0,i.W)(),v=(0,s.z)(),b=(0,c.o)((function(e){var n;return null!==(n=null==e?void 0:e.restrictions.canSeek)&&void 0!==n&&n}));return(0,u.jsx)(o.Zp,{label:r.Ru.get("playback-control.skip-forward-15"),showDelay:d,children:(0,u.jsx)(a.H,{iconOnly:l.A,size:"small",onClick:function(){p({type:"click",intent:"skip-forward-15"}),null==n||n(15e3),v.seekForward(15e3)},disabled:!b,"aria-label":r.Ru.get("playback-control.skip-forward-15"),"data-testid":"control-button-seek-forward-15",className:t})})}},58060:(e,n,t)=>{t.d(n,{u:()=>b});var a=t(52542),l=t(97500),r=t.n(l),o=t(2648),i=t(780),s=t(92107),c=t(17011),u=t(8574),d=t(37247);const p="fZjbVIqD8Xc3auRZOxu5";var v=t(86070),b=function(e){var n=e.onClick,t=e.className,l=e.showDelayOnHover,b=(0,u.W)(),g=(0,d.V)(),f=g.shuffle,h=g.setShuffle,m=g.canToggleShuffle,k=f?s.Ru.get("playback-control.disable-shuffle"):s.Ru.get("playback-control.enable-shuffle");return(0,v.jsx)(c.Zp,{label:k,showDelay:l,children:(0,v.jsx)(o.H,{className:r()((0,a.A)({},p,f),t),iconOnly:i.p,size:"small",onClick:function(){var e=!f;b({type:"click",intent:"shuffle"}),null==n||n(e),h(e)},disabled:!m,role:"switch","aria-checked":f?"true":"false","aria-label":k,"data-testid":"control-button-shuffle",semanticColor:f?"textBrightAccent":void 0})})}},59400:(e,n,t)=>{t.d(n,{d:()=>v});var a=t(15057),l=t(2648),r=t(30791),o=t(92107),i=t(17011),s=t(56827),c=t(8574),u=t(64869),d=t(5248),p=t(86070),v=function(e){var n=e.onClick,t=e.className,v=e.showDelayOnHover,b=(0,u.z)(),g=(0,c.W)(),f=(0,d.o)((function(e){var n;return null!==(n=(null==e?void 0:e.restrictions.canSkipPrevious)||(null==e?void 0:e.restrictions.canSeek))&&void 0!==n&&n})),h=(0,a.YQ)((function(e){g({type:"click",intent:"previous"}),null==n||n(),b.skipToPrevious(),(0,s.aX)(e,"skip-back")}),100,{leading:!0,trailing:!1});return(0,p.jsx)(i.Zp,{label:o.Ru.get("playback-control.skip-back"),showDelay:v,children:(0,p.jsx)(l.H,{iconOnly:r.A,size:"small",disabled:!f,"aria-label":o.Ru.get("playback-control.skip-back"),"data-testid":"control-button-skip-back",onClick:h,className:t})})}},20110:(e,n,t)=>{t.d(n,{$:()=>v});var a=t(15057),l=t(2648),r=t(18243),o=t(92107),i=t(17011),s=t(56827),c=t(8574),u=t(64869),d=t(5248),p=t(86070),v=function(e){var n=e.onClick,t=e.className,v=e.showDelayOnHover,b=(0,u.z)(),g=(0,c.W)(),f=(0,d.o)((function(e){var n;return null!==(n=null==e?void 0:e.restrictions.canSkipNext)&&void 0!==n?n:null})),h=(0,a.YQ)((function(e){g({type:"click",intent:"next"}),null==n||n(),b.skipToNext(),(0,s.aX)(e,"skip-forward")}),100,{leading:!0,trailing:!1});return(0,p.jsx)(i.Zp,{label:o.Ru.get("playback-control.skip-forward"),showDelay:v,children:(0,p.jsx)(l.H,{iconOnly:r.s,size:"small",disabled:!f,"aria-label":o.Ru.get("playback-control.skip-forward"),"data-testid":"control-button-skip-forward",onClick:h,className:t})})}},81347:(e,n,t)=>{t.d(n,{w:()=>re});var a=t(52542),l=t(93493),r=t(92107),o=t(76840),i=t(17011),s=t(62002),c=t(851),u=t(46792),d=t(54097),p=t(52574),v=t(3816),b=t(66965),g=t(79576),f=t(17667),h=t(9286),m=t(26297),k=t(53612),y=t(57431),x=t(4106),w=t(20861),O=t(56517),j=t(27176),S=t(95013),D=t(69682),C=t(80967),R=t(99676),A=t(71049),N=t(67510),P=t(61083),E=t(2800),_=t(27442),z=t(31063),M=t(54502),H=t(13798),T=t(38104),B=t(14115);const W="INvB6IvAqjjvyfm0ezDi";var I=t(86070),V={.5:s.D4,.6:c.k,.7:u.l,.8:d.W9,.9:p.l,1:v.P,1.1:b.g,1.2:g.Dx,1.3:f.A,1.4:h.l,1.5:m.in,1.6:k.h,1.7:y.e,1.8:x.B,1.9:w.T,2:O.c,2.1:j.F,2.2:S.W,2.3:D.Z,2.4:C.U,2.5:R.X,2.6:A.m,2.7:N.n,2.8:P.Y,2.9:E.X,3:_.f,3.1:z.y,3.2:M.T,3.3:H.Q,3.4:T.l,3.5:B.i},L=function(e){var n=e.speed,t=e.iconSize,a=void 0===t?20:t,l=V[n];return l?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(l,{className:W,iconSize:a,style:{width:"".concat(a,"px"),height:"".concat(a,"px")}}),(0,I.jsx)("span",{className:"hidden-visually",children:"".concat(n,"x")})]}):(0,I.jsx)("span",{children:"".concat(n,"x")})},F=(t(25550),t(15342),t(30758)),X=t(85673),Z=t(33233),U=t(67963),q=t(12341),Y=(t(70750),t(47710),[.5,.6,.7,.8,.9,1,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3,3.1,3.2,3.3,3.4,3.5]),Q=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=Y.slice().sort((function(n,t){return Math.abs(n-e)-Math.abs(t-e)}));return(0,q.A)(n,1)[0]},G=t(8574);const K="Is0ZfXiIyRoHd9y1OWtv";var $=function(e){var n=e.selectedSpeed,t=e.setSelectedSpeed,a=(0,G.W)(),l=Y,o=(0,F.useRef)(null),i=(0,F.useCallback)((function(e){null!==e&&(o.current=e)}),[]);return(0,F.useEffect)((function(){null!=o&&o.current&&o.current.scrollIntoView({block:"center"})}),[o]),(0,I.jsxs)(X.W,{getInitialFocusElement:function(e){return null==e?void 0:e.querySelector('[aria-checked="true"]')},children:[(0,I.jsx)(Z.y,{children:r.Ru.get("playback-control.playback-speed")}),(0,I.jsx)("div",{className:K,children:l.map((function(e){return(0,I.jsx)(U.D,{elementRef:e===n?i:void 0,onClick:function(){t(e),a({type:"click",intent:"choose-speed",itemIdSuffix:"option-".concat(e,"x")})},"data-testid":"playback-speed-option-".concat(e),role:"menuitemradio","aria-label":r.Ru.get("playback-control.playback-speed-button-a11y",e),"aria-checked":e===n,children:"".concat(e,"x")},e)}))})]})},J=t(34300),ee=t(37247),ne=t(79916);var te=t(3424),ae=t(61325);const le="Ww5ppB6W74laf1c0H_pR";var re=function(e){var n=e.iconSize,t=void 0===n?20:n,s=e.onClick,c=function(){var e=(0,l.NC)(ne.hd),n=(0,ee.V)(),t=n.speed,a=n.setSpeed,r=n.canChangeSpeed,o=(0,J.x)("playbackSpeed",1),i=(0,q.A)(o,2),s=i[0],c=i[1],u=(0,F.useMemo)((function(){return Q(null!=s?s:Y)}),[s]),d=(0,F.useMemo)((function(){return Boolean(t)?Q(t):u}),[t,u]),p=(0,F.useCallback)((function(e){c(e),a(e)}),[c,a]);return{speed:e===ne._9.ESPERANTO?d:u,setSpeed:p,canChangeSpeed:r}}(),u=c.speed,d=c.setSpeed,p=c.canChangeSpeed,v=(0,G.W)(),b=(0,te.v)((function(e){return e.connectionStatus===ae.zP.NOT_CONNECTED})),g=(0,l.NC)(ne.hd),f=(0,a.A)({},"--button-size","".concat(2*t,"px"));return p?(0,I.jsx)(o.t,{renderInline:!0,placement:"top-start",menu:(0,I.jsx)($,{selectedSpeed:u,setSelectedSpeed:function(e){null==s||s(e),d(e)}}),children:function(e,n,a){return(0,I.jsx)(i.Zp,{label:r.Ru.get("playback-control.change-playback-speed"),children:(0,I.jsx)("button",{style:f,ref:a,className:le,onClick:function(e){n(e),v({type:"click",intent:"choose-speed"})},"aria-label":r.Ru.get("playback-control.change-playback-speed"),"data-testid":"control-button-playback-speed",disabled:!b&&g===ne._9.DEFAULT,children:(0,I.jsx)(L,{speed:u,iconSize:t})})})}}):null}},94849:(e,n,t)=>{t.d(n,{M:()=>H,V:()=>M});t(7651),t(30456),t(26701),t(37417),t(11737),t(51691),t(702),t(5672),t(43379),t(34192),t(88856),t(51565),t(18316);var a=t(52542),l=t(12341),r=t(30758),o=t(97500),i=t.n(o),s=t(15057),c=t(92107),u=t(17011),d=t(40441),p=t(13734),v=t(32802),b=t(18422),g=t(16292),f=t(23721),h=t(86070),m=["volume","iconSize"];function k(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function y(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?k(Object(t),!0).forEach((function(n){(0,a.A)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):k(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var x=function(e){var n=e.volume,t=void 0===n?1:n,a=e.iconSize,l=y({size:void 0===a?"small":a,role:"presentation"},(0,p.A)(e,m));return 0===t?(0,h.jsx)(v.X,y({"aria-label":c.Ru.get("playback-control.a11y.volume-off")},l)):t<1/3?(0,h.jsx)(b.D,y({"aria-label":c.Ru.get("playback-control.a11y.volume-low")},l)):t<2/3?(0,h.jsx)(g.z,y({"aria-label":c.Ru.get("playback-control.a11y.volume-medium")},l)):(0,h.jsx)(f.C,y({"aria-label":c.Ru.get("playback-control.a11y.volume-high")},l))},w=t(94199),O=t(95381);const j="volume-bar",S="RyUTmsGCr7jM4YTwqq8p",D="HGaOzijxBrKrSQhwI6rT",C="volume-bar__slider-container",R="DLZvnBAg9muHrwjSyIus",A="ekolz0hXwCXtCyFNmvqb",N="volume-bar__icon-button",P="aDDQP2meKLCk46Bn7Zz1",E="XRpLYcl6xtWmk7bNdHkS";function _(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function z(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?_(Object(t),!0).forEach((function(n){(0,a.A)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var M=function(e){return e[e.SHOW_SLIDER_ALWAYS=0]="SHOW_SLIDER_ALWAYS",e[e.SHOW_SLIDER_ON_HOVER=1]="SHOW_SLIDER_ON_HOVER",e}({}),H=function(e){var n=e.iconSize,t=void 0===n?"small":n,o=e.onVolumeBarClick,p=e.onVolumeBarDrag,v=e.onToggleMuteClick,b=e.className,g=e.mode,f=void 0===g?M.SHOW_SLIDER_ALWAYS:g,m=e.sliderSize,k=e.sliderDirection,y=void 0===k?"horizontal":k,_=e.volumeIconRef,H=e.isMiniPlayer,T=e.showDelayOnHover,B=(0,w.n)(),W=B.volume,I=B.setVolume,V=B.raiseVolume,L=B.lowerVolume,F=-1!==W,X=Math.min(1,Math.max(0,W)),Z=(0,r.useState)({isDragging:!1,isHoveringButton:!1,toggleVolumeLevel:null,dragPosition:0,shouldDragValueBeUsed:!1}),U=(0,l.A)(Z,2),q=U[0],Y=U[1],Q=q.shouldDragValueBeUsed,G=q.dragPosition,K=q.isHoveringButton,$=q.toggleVolumeLevel,J=q.isDragging,ee=Q?G:X;F||(ee=1);var ne=(0,s.YQ)((function(e){var n=Math.min(1,Math.max(0,e));I(n)}),25,{maxWait:50,leading:!0}),te=function(){Y((function(e){return z(z({},e),{},{isHoveringButton:!0})}))},ae=function(){Y((function(e){return z(z({},e),{},{isHoveringButton:!1})}))},le=0===W?c.Ru.get("playback-control.unmute"):c.Ru.get("playback-control.mute"),re=(0,a.A)((0,a.A)({},"--button-size","".concat(2*(0,O.k)(t),"px")),"--slider-width",m?"".concat(m,"px"):"100%");return(0,h.jsxs)("div",{style:re,className:i()(j,b,(0,a.A)((0,a.A)((0,a.A)((0,a.A)({},P,!F),S,"vertical"===y),R,f===M.SHOW_SLIDER_ON_HOVER),D,H)),"data-testid":"volume-bar",dir:"ltr",onWheel:function(e){var n;if(F){var t=Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX,a=Math.max(-120,Math.min(120,(null==e||null===(n=e.nativeEvent)||void 0===n?void 0:n.wheelDelta)||t))/1200,l=Math.max(0,Math.min(1,ee+a));I(l)}},ref:_,children:[(0,h.jsx)(u.Zp,{label:le,showDelay:T,children:(0,h.jsx)("button",{className:i()(N,"control-button",(0,a.A)({},E,H)),onClick:function(){0===ee?(null==v||v("not_muted"),ne(null!=$?$:.7)):(Y((function(e){return z(z({},e),{},{toggleVolumeLevel:ee})})),null==v||v("muted"),ne(0))},disabled:!F,"aria-label":0===W?c.Ru.get("playback-control.unmute"):c.Ru.get("playback-control.mute"),onMouseEnter:te,onMouseLeave:ae,"aria-describedby":"volume-icon","data-testid":"volume-bar-toggle-mute-button",children:(0,h.jsx)(x,{id:"volume-icon",iconSize:t,volume:ee})})}),(0,h.jsx)("div",{className:i()(C,(0,a.A)({},A,"vertical"===y)),onMouseEnter:te,onMouseLeave:ae,children:(0,h.jsx)(d.z2,{labelText:c.Ru.get("playback-control.a11y.volume-slider-button"),value:ee,max:1,step:.1,onDragStart:function(e){Y((function(n){return z(z({},n),{},{isDragging:!0,dragPosition:e,shouldDragValueBeUsed:!0})}))},onDragMove:function(e){Y((function(n){return z(z({},n),{},{dragPosition:e,shouldDragValueBeUsed:!0})})),J&&(null==p||p(e),ne(e))},onDragEnd:function(e){Y((function(e){return z(z({},e),{},{shouldDragValueBeUsed:!1,dragPosition:0,isDragging:!1})})),null==o||o(e),ne(e)},onStepBackward:L,onStepForward:V,forceActiveStyles:K,direction:y})})]})}},8283:(e,n,t)=>{t.d(n,{w:()=>u});t(7651),t(30456),t(26701),t(37417),t(11737),t(51691),t(702),t(5672),t(43379),t(34192),t(88856),t(51565),t(18316);var a=t(52542),l=t(30758),r=t(76535),o=t(86070);function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function s(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?i(Object(t),!0).forEach((function(n){(0,a.A)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var c=function(e){var n=e.renderDisabled,t=void 0===n?function(){return null}:n,a=e.renderEnabled;return(0,r.XR)(!0)?a():t()},u=function(e){return(0,o.jsx)(l.Suspense,{fallback:null,children:(0,o.jsx)(c,s({},e))})}},4005:(e,n,t)=>{t.d(n,{a:()=>u});var a=t(780),l=t(60558),r=t(29751),o=t(37247),i=t(5248),s=t(56603),c=t(86070),u=function(e){var n=e.size,t=e.withSnackbar,u=e.className,d=e.showDelayOnHover,p=(0,i.o)((function(e){return null==e?void 0:e.context}),(function(e,n){return(null==e?void 0:e.uri)===(null==n?void 0:n.uri)})),v=(0,r.g)(!0).title,b=(0,o.V)().canToggleShuffle;return(0,s.O)(p)?(0,c.jsx)(l.Y,{size:n,contextUri:p.uri,entityName:null!=v?v:"",isActive:!0,activationPlacement:"top",offsetDotDistance:!1,withPadding:!0,disabled:!b,withActivation:!1,withSnackbar:t,className:u,showDelayOnHover:d}):(0,c.jsx)(l.u,{size:n,shuffleModeConfig:{icon:a.p},shuffleIsOn:!1,disabled:!0,withPadding:!0,className:u,showDelayOnHover:d})}},29751:(e,n,t)=>{t.d(n,{g:()=>v});t(30456),t(34518),t(47994),t(43379),t(34192),t(88856);var a=t(88677),l=t(80366),r=t(92107),o=t(42299),i=t(73606),s=t(65249),c=t(70029),u=t(5248),d=t(77970),p=function(e){var n,t;return null!==(n=null===(t=(0,l.o_)(e))||void 0===t?void 0:t.toURLPath(!0))&&void 0!==n?n:""},v=function(e){var n,t,l,v,b,g=(0,a.d4)(s.Ht).user,f=(0,u.o)((function(e){return{item:null==e?void 0:e.item,context:null==e?void 0:e.context}}),(function(e,n){var t,a;return(null===(t=e.item)||void 0===t?void 0:t.uri)===(null===(a=n.item)||void 0===a?void 0:a.uri)})),h=f.item,m=f.context;if(!h||!m)return{title:null,link:null};var k=(0,i.Iu)();if(m.uri===k.uri||m.uri===c.bV)return{title:k.name,link:p(c.bV)};if((0,d.N)(h)&&!e)return{title:r.Ru.get("ad-formats.advertisement"),link:null};if("queue"===h.provider&&!e)return{title:r.Ru.get("playback-control.queue"),link:p("spotify:app:queue")};var y=(0,i.$R)(null==g?void 0:g.id);if(m.uri===(null==y?void 0:y.uri))return{title:null==y?void 0:y.name,link:p(null==y?void 0:y.uri)};var x,w,O=(0,i.n5)(null==g?void 0:g.id);return m.uri===(null==O?void 0:O.uri)?{title:null==O?void 0:O.name,link:p(null==O?void 0:O.uri)}:(0,o.HS)(m)?{title:[null===(x=h.metadata)||void 0===x?void 0:x.station_title,null===(w=h.metadata)||void 0===w?void 0:w.station_subtitle].filter(Boolean).join(" • "),link:null}:{title:null!==(n=null!==(t=null===(l=m.metadata)||void 0===l?void 0:l.context_description)&&void 0!==t?t:null==h?void 0:h.name)&&void 0!==n?n:"",link:null!==(v=null!==(b=p(m.uri))&&void 0!==b?b:p(h.uri))&&void 0!==v?v:""}}}}]);
|
|
//# sourceMappingURL=4374.js.map
|