diff --git a/patches/0005-Add-OS-spoof.patch b/patches/0005-Add-OS-spoof.patch new file mode 100644 index 0000000..7e02378 --- /dev/null +++ b/patches/0005-Add-OS-spoof.patch @@ -0,0 +1,9 @@ +diff --git a/app/_next/static/chunks/app/(product)/layout-9789348d9aaa7892.js b/app/_next/static/chunks/app/(product)/layout-9789348d9aaa7892.js +--- a/app/_next/static/chunks/app/(product)/layout-9789348d9aaa7892.js ++++ b/app/_next/static/chunks/app/(product)/layout-9789348d9aaa7892.js +@@ -1,4 +1,4 @@ +-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4720,9889,2121,3799,1521,1593,9880,8910,2499,105,5001,4870,2286,1871,9264],{35582:function(e,t,i){"use strict";i.r(t);var a,o,r,n,l,s,d,u,c,C,h,m,p,v,E,f,_,y,A,P,L,x,b,g,N,V,S,T,w,R,M,H,k,j,B,Z,I,O,q,D,U,z,F,W,Y,G,K,J,$,X,Q,ee,et,ei,ea,eo,er,en,el,es,ed,eu,ec,eC,eh,em,ep,ev,eE,ef,e_,ey,eA,eP,eL,ex,eb,eg,eN,eV,eS,eT,ew,eR,eM,eH,ek,ej,eB,eZ,eI,eO,eq,eD,eU=i(99616);function ez(){return(ez=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let e=(0,n.useRouter)(),t=(0,c.uK)(),i=t.get(c.xi),o=(0,l.useCallback)(()=>{i.authorizationUrl&&e.push(i.authorizationUrl)},[i.authorizationUrl,e]);return(0,a.jsxs)("div",{className:h().root,children:[(0,a.jsx)(u.Heading,{className:(0,r.W)(h().title,h().important),variant:"h3",size:"xs",children:(0,a.jsx)(s.Z,{id:"authorization.enter-title"})}),(0,a.jsx)(u.Caption,{className:(0,r.W)(h().text,h().important),variant:"span",type:"text",size:"l",weight:"normal",children:(0,a.jsx)(s.Z,{id:"authorization.enter-text"})}),(0,a.jsx)(d.z,{onClick:o,className:h().button,role:"link",color:"primary",size:"l",radius:"xxxl",children:(0,a.jsx)(u.Caption,{type:"controls",variant:"span",size:"m",children:(0,a.jsx)(s.Z,{id:"authorization.enter-button"})})})]})}),p=(0,o.Pi)(e=>{let{children:t}=e,{user:i}=(0,c.oR)();return i.isAuthorized?t:(0,a.jsx)(m,{})})},40466:function(e,t,i){"use strict";i.r(t),i.d(t,{WithBetaUser:function(){return A}});var a=i(8759),o=i(33423),r=i(35338),n=i(11769),l=i(99616),s=i(65244),d=i(2814),u=i(15527),c=i(13410),C=i(28036),h=i(1918),m=i(57921),p=i(39479),v=i(5674),E=i(44285),f=i(99800),_=i.n(f);let y=(0,o.Pi)(e=>{let{withoutExperiment:t=!1,showLoginButton:o=!1,showUserProfile:f=!1,withOffer:y=!1}=e,A=(0,n.useRouter)(),P=(0,v.uK)(),{settings:L}=(0,v.oR)(),{formatMessage:x}=(0,s.Z)(),b=P.get(v.xi),g=P.get(v.U5),N=(0,v.yy)(g.oldWebHost),V=(0,l.useMemo)(()=>L.layout===v.t8.Mobile?i(25811).Z.src:i(11737).Z.src,[L.layout]),S=(0,l.useCallback)(()=>{b.authorizationUrl&&A.push(b.authorizationUrl)},[b.authorizationUrl,A]);(0,v.NO)(!0);let T=(0,l.useMemo)(()=>y?(0,a.jsx)(h.Heading,{variant:"h1",size:"xl",weight:"bold",className:(0,r.W)(_().title,_().text),children:(0,a.jsx)(d.Z,{id:"welcome-page.offer-header"})}):t?(0,a.jsx)(h.Heading,{variant:"h1",size:"xxl",weight:"bold",className:(0,r.W)(_().title,_().text),children:(0,a.jsx)(d.Z,{id:"welcome-page.beta-header",values:{br:(0,a.jsx)("br",{})}})}):(0,a.jsx)(h.Heading,{variant:"h1",size:"xxl",weight:"bold",className:(0,r.W)(_().title,_().text),children:(0,a.jsx)(d.Z,{id:"welcome-page.not-auth-header",values:{br:(0,a.jsx)("br",{})}})}),[y,t]),w=(0,l.useMemo)(()=>t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Caption,{variant:"span",type:"text",size:"l",className:_().text,children:(0,a.jsx)(d.Z,{id:"welcome-page.beta-text-short"})}),(0,a.jsx)(C.y,{children:(0,a.jsx)(h.Heading,{variant:"h2",children:(0,a.jsx)(d.Z,{id:"welcome-page.beta-text-short"})})})]}):y?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Caption,{variant:"span",type:"text",size:"l",className:_().offerText,children:(0,a.jsx)(d.Z,{id:"welcome-page.offer-text"})}),(0,a.jsx)(C.y,{children:(0,a.jsx)(h.Heading,{variant:"h2",children:(0,a.jsx)(d.Z,{id:"welcome-page.offer-text"})})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Caption,{variant:"span",type:"text",size:"l",className:_().text,children:(0,a.jsx)(d.Z,{id:"welcome-page.not-auth-text",values:{br:(0,a.jsx)("br",{})}})}),(0,a.jsx)(C.y,{children:(0,a.jsx)(h.Heading,{variant:"h2",children:(0,a.jsx)(d.Z,{id:"welcome-page.not-auth-text",values:{br:(0,a.jsx)("br",{})}})})})]}),[y,t]),R=(0,l.useMemo)(()=>{if(o)return(0,a.jsx)(u.z,{onClick:S,className:_().loginButton,role:"link",color:"primary",size:"m",radius:"xxxl",children:(0,a.jsx)(d.Z,{id:"authorization.enter-button"})});if(y){let e="https://".concat(N,"/pay");return(0,a.jsx)(E.rU,{className:_().offerButtonLink,href:e,"aria-label":x({id:"payment.offer-button"}),target:"_blank",children:(0,a.jsx)(u.z,{className:(0,r.W)(_().offerButton,_().offerButton_important),role:"link",color:"plus",size:"l",radius:"m",withRipple:!1,children:(0,a.jsx)(d.Z,{id:"payment.offer-button"})})})}},[x,S,N,o,y]);return(0,v.ZP)(!0),(0,a.jsxs)("div",{className:(0,r.W)(_().root),children:[(0,a.jsx)(m.TF,{withSecondaryColor:!0}),(0,a.jsx)("div",{className:_().logoContainer,children:(0,a.jsx)(c.T,{alignIcon:"center",lang:"ru",className:_().logo})}),T,w,R,(0,a.jsx)("img",{className:_().image,src:V}),f&&(0,a.jsx)(p.Iw,{className:_().user,withMeta:L.layout!==v.t8.Mobile,variant:L.layout===v.t8.Mobile?"mobile":"desktop",usernameClassName:(0,r.W)(_().username,_().important)})]})}),A=(0,o.Pi)(e=>{let{children:t}=e,{user:i,experiments:o}=(0,v.oR)();return i.isAuthorized?o.checkExperiment(v.pe.WebNext,"on")&&!i.isChild?i.hasPlus||o.checkExperiment(v.pe.WebNextFreemium,"on")?t:(0,a.jsx)(y,{withOffer:!0,showUserProfile:!0}):(0,a.jsx)(y,{withoutExperiment:!0,showUserProfile:!0}):(0,a.jsx)(y,{showLoginButton:!0})})},12286:function(e,t,i){"use strict";i.r(t);var a=i(8759),o=i(35338),r=i(99616),n=i(92318),l=i(89788),s=i(5674),d=i(37500),u=i.n(d),c=i(21535);t.default=e=>{let{children:t}=e,{state:i,toggleTrue:d}=(0,n.O)(!1),{state:C,toggleTrue:h}=(0,n.O)(!1),m=(0,r.useMemo)(()=>{let e=new l.JC;return(0,s.NK)(e.get(s.BU.Theme),(0,s.Q$)())},[]),p=(0,r.useCallback)(e=>{let t=c.env.ASSET_PREFIX||"";return"".concat(t,"/video/splash_screen/splash_screen_").concat(m,".").concat(e)},[m]),v=(0,r.useMemo)(()=>({isVisible:!i}),[i]);return(0,a.jsxs)(s.IP.Provider,{value:v,children:[!i&&(0,a.jsx)("div",{className:(0,o.W)(u().root,u()["root_".concat(m)],{[u().root_hidden]:C}),onAnimationEnd:d,children:(0,a.jsxs)("video",{className:u().video,autoPlay:!0,muted:!0,playsInline:!0,onEnded:h,onError:d,children:[(0,a.jsx)("source",{src:p("webm"),type:"video/webm"}),(0,a.jsx)("source",{src:p("mp4"),type:"video/mp4"})]})}),t]})}},44495:function(e,t,i){"use strict";i.r(t),i.d(t,{DesktopInitializer:function(){return d}});var a=i(8759),o=i(35338),r=i(99616),n=i(48769),l=i(57921),s=i(5674);let d=()=>{let e=(0,s.Xf)(),{dictionary:t}=(0,s.ZS)();{let{theme:e}=(0,s.Fg)(),t=(0,s.sv)();(0,l.Tk)(),(0,l.Er)(),(0,l.bO)(),(0,l.vs)(),(0,l.Zw)(),(0,r.useEffect)(()=>{(0,l.Yl)(),(0,l.l7)()},[]),(0,r.useEffect)(()=>{let e=(0,s.bo)();e&&t.count(e,"appVersion")},[t]),(0,r.useEffect)(()=>{(0,l.F5)(e),t.count(e,"appTheme")},[e])}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Notification,{className:(0,o.W)({updateNotificationContainer:!0,updateNotificationContainer_application_windows:e===s.t4.WINDOWS,updateNotificationContainer_application_macos:e===s.t4.MACOS}),enableMultiContainer:!0,containerId:s.W$.APPLICATION_UPDATE,position:"top-center"}),(0,a.jsx)(l.Pj,{dictionary:t})]})}},49842:function(e,t,i){"use strict";i.r(t),i.d(t,{UrlInitializer:function(){return n}});var a=i(33423),o=i(11769),r=i(5674);let n=(0,a.Pi)(e=>{let{host:t}=e,{location:i}=(0,r.oR)(),a=(0,o.usePathname)(),n=(0,o.useSearchParams)().toString(),l=window.location.host,s=t||l,d="https://".concat(s),u="https://".concat(s).concat(a).concat(n?"?":"").concat(n);d=s,u="".concat(s).concat(a).concat(n?"?":"").concat(n),i.setPathname(a),i.setSearchParams(n),i.setHost(s),i.setTld((0,r.p$)(s)||"ru"),i.setOrigin(d),i.setHref(u)})},85816:function(e,t,i){"use strict";i.r(t),i.d(t,{WebInitializer:function(){return s}});var a=i(8759);i(99616);var o=i(5674),r=i(33423);let n=(0,r.Pi)(e=>{let{children:t,userIp:i}=e,{location:a}=(0,o.oR)();return t}),l=e=>{let{children:t}=e;return t},s=e=>{let{userIp:t}=e,i=(0,o.uK)(),r=i.get(o.V0);return r.get(o.BU.DisallowDeeplinksRedirect),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l,{}),(0,a.jsx)(n,{userIp:t})]})}},52207:function(e,t,i){"use strict";i.r(t),i.d(t,{NavigationEvents:function(){return n}});var a=i(11769),o=i(99616),r=i(5674);let n=()=>{let e=(0,r.sv)(),t=(0,a.usePathname)(),i=(0,a.useSearchParams)();return(0,o.useEffect)(()=>{let a="".concat(t).concat(i.size>0?"?".concat(i):"");e.hit(a)},[t,i,e]),null}},75576:function(e,t,i){"use strict";i.r(t),i.d(t,{AnalyticsProvider:function(){return s}});var a=i(8759),o=i(99616),r=i(82834),n=i(5674);let l=null,s=e=>{let{children:t}=e,i=(0,n.sv)(),s=(0,n.wL)(),d=(0,n.uK)(),u=d.get(n.V0),c=(0,o.useMemo)(()=>{if(l)return l;let e="on"===u.get(n.BU.AllowAnalyticsLogs),t=(0,r.HQ)(e=>i.count(e,"evgen"),s,e),a=(0,r.hz)(),o=(0,r.y_)();return l=new r.yx(t,a,o)},[u,s,i]);return(0,a.jsx)(n.fC.Provider,{value:c,children:(0,a.jsx)(n.tK,{children:t})})}},83622:function(e,t,i){"use strict";i.r(t),i.d(t,{HistoryProvider:function(){return s}});var a=i(8759),o=i(11769),r=i(99616),n=i(5674);let l=null,s=e=>{let{children:t}=e,i=(0,n.uK)(),s=(0,o.useRouter)(),d=(0,o.usePathname)(),u=(0,o.useSearchParams)(),[c,C]=(0,r.useState)(!1),[h,m]=(0,r.useState)(!1),[p,v]=(0,r.useState)(null),E=(0,r.useMemo)(()=>{if(l)return l;let e=i.get(n.Ar);return l=new n.QQ(e)},[i]),f=(0,r.useCallback)(()=>{E&&(C(E.canBack),m(E.canForward),v(E.state))},[E]),_=(0,r.useCallback)(e=>{E&&(E.replaceState(e),s.replace(e.href))},[E,s]),y=(0,r.useCallback)(e=>{E&&(E.pushState(e),f())},[E,f]),A=(0,r.useCallback)(()=>{E&&(E.back(),f(),s.back())},[E,s,f]),P=(0,r.useCallback)(()=>{E&&(E.forward(),f(),s.forward())},[E,s,f]);return(0,r.useEffect)(()=>{var e;let t=[d,u.toString()].join("?");(!(null==E?void 0:E.state)||(null==E?void 0:null===(e=E.state)||void 0===e?void 0:e.isLocationNotEqual(t)))&&y({href:t})},[E,d,u,y]),(0,a.jsx)(n.Tl.Provider,{value:{pushState:y,replaceState:_,canForward:h,canBack:c,back:A,forward:P,state:p},children:t})}},75707:function(e,t,i){"use strict";i.r(t),i.d(t,{LayoutProvider:function(){return d},setClientSideLayout:function(){return s}});var a=i(8759),o=i(57285),r=i(33423),n=i(99616),l=i(5674);let s=e=>{document.body.classList.remove("desktop"),e.setLayout((0,l.jP)(window.innerWidth))},d=(0,r.Pi)(e=>{let{children:t,userAgent:i}=e,{settings:r}=(0,l.oR)(),d=(0,l.Xf)(),[u,c]=(0,n.useState)(null);d&&r.setPlatform(d),r.layout;let C=(0,n.useMemo)(()=>(0,o.Z)(()=>{s(r)},100),[r]),h=(0,n.useCallback)(e=>{c(e)},[]);(0,n.useLayoutEffect)(()=>{s(r)},[r]),(0,n.useEffect)(()=>(window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}),[C]);let m=(0,n.useMemo)(()=>({contentRef:u,setContentRef:h}),[u,h]);return(0,a.jsx)(l.VY.Provider,{value:m,children:t})})},29371:function(e,t,i){"use strict";i.r(t),i.d(t,{PrefetchDataProvider:function(){return s}});var a=i(33423),o=i(99616),r=i(5674),n=i(75707);let l=async(e,t,i)=>{let{user:a,library:o,experiments:n,pinsCollection:l}=e;if(t?await a.getAbout():a.setUnauthorized(),a.puid&&i.setPassportUid(a.puid),await n.getData(),a.isAuthorized){let e=[a.getSettings(),o.getData()];n.checkExperiment(r.pe.WebPins,"on")&&e.push(l.getData()),await Promise.all(e)}},s=(0,a.Pi)(e=>{let{children:t}=e,i=(0,r.oR)(),a=(0,r.uK)(),s=a.get(r.xi),d=a.get(r.Hz),u=s.hasAuthorizationCredentials;return(0,n.setClientSideLayout)(i.settings),i.user.account.loadingState===r.Gu.IDLE&&(0,o.use)(l(i,u,d)),t})},85709:function(e,t,i){"use strict";i.r(t),i.d(t,{ShortcutsProvider:function(){return d}});var a=i(8759),o=i(33423),r=i(99616),n=i(98125),l=i(5674);let s=null,d=(0,o.Pi)(e=>{let{children:t}=e,i=(0,l.R$)(),o=(0,l.uK)(),d=o.get(l.V0),u=(0,n.K)(),{sonataState:c}=(0,l.oR)(),C=(0,r.useMemo)(()=>(s||(s=new l.OI(new l.yr)),s),[]);return(0,r.useEffect)(()=>(null==C||C.addShortcutsListener(l.yx.DECREASE_VOLUME,async()=>{let e=await (null==i?void 0:i.decreaseVolume(.05));d.set(l.BU.YmPlayerVolume,e)}),null==C||C.addShortcutsListener(l.yx.INCREASE_VOLUME,async()=>{let e=await (null==i?void 0:i.increaseVolume(.05));d.set(l.BU.YmPlayerVolume,e)}),null==C||C.addShortcutsListener(l.yx.TOGGLE_MUTE,async()=>{let e=null==i?void 0:i.state.playerState.volume.value;void 0!==e&&await u(e)}),()=>{null==C||C.removeShortcutsListener(l.yx.DECREASE_VOLUME),null==C||C.removeShortcutsListener(l.yx.INCREASE_VOLUME),null==C||C.removeShortcutsListener(l.yx.TOGGLE_MUTE)}),[C,i,d,u]),(0,r.useEffect)(()=>{if(!c.isGenerativeContext)return null==C||C.addShortcutsListener(l.yx.MOVE_BACKWARD,async()=>{var e;(null==i?void 0:null===(e=i.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveBackward.value)&&await i.moveBackward()}),null==C||C.addShortcutsListener(l.yx.MOVE_FORWARD,async()=>{var e;(null==i?void 0:null===(e=i.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveForward.value)&&await (null==i?void 0:i.moveForward())}),null==C||C.addShortcutsListener(l.yx.SLIDE_BACKWARD,async()=>{let e=null==i?void 0:i.state.playerState.progress.value.duration;e&&await (null==i?void 0:i.slideBackward(2))}),null==C||C.addShortcutsListener(l.yx.SLIDE_FORWARD,async()=>{let e=null==i?void 0:i.state.playerState.progress.value.duration;e&&await (null==i?void 0:i.slideForward(2))}),()=>{null==C||C.removeShortcutsListener(l.yx.MOVE_FORWARD),null==C||C.removeShortcutsListener(l.yx.MOVE_BACKWARD),null==C||C.removeShortcutsListener(l.yx.SLIDE_BACKWARD),null==C||C.removeShortcutsListener(l.yx.SLIDE_FORWARD)}},[C,i,d,c.isGenerativeContext]),(0,a.jsx)(l.cw.Provider,{value:C,children:t})})},48085:function(e,t,i){"use strict";i.r(t),i.d(t,{SonataProvider:function(){return eu}});var a,o,r,n,l=i(8759),s=i(33423),d=i(99616),u=i(8124);class c extends Error{constructor(e){super(e),this.name="AudioError"}}let C={BAD_STATE:"action is not permited from current state"},h={EVENT_PLAY:"play",EVENT_STOP:"stop",EVENT_PAUSE:"pause",EVENT_RESUME:"resume",EVENT_PROGRESS:"progress",EVENT_SEEKED:"seeked",EVENT_VOLUMECHANGE:"volumechange",EVENT_RATECHANGE:"ratechange",EVENT_LOADING:"loading",EVENT_LOADED:"loaded",EVENT_ENDED:"ended",EVENT_CRASHED:"crashed",EVENT_ERROR:"error",EVENT_STALLED:"stalled",EVENT_CANPLAY:"canplay",EVENT_PLAYING:"playing",HLS_EVENT_ERROR:"hlserror",EVENT_DESTROY:"destroy",EVENT_STATE:"state",EVENT_SWAP:"swap",STATE_INIT:"init",STATE_CRASHED:"crashed",STATE_IDLE:"idle",STATE_PLAYING:"playing",STATE_PAUSED:"paused"};var m=i(23681);let p={updateInterval:30,EMPTY_SOUND:"data:audio/mp3;base64,//uQZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAADAAAC2QBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr///////////////////////////////////////////8AAAA8TEFNRTMuOThyBK8AAAAAAAAAADQgJAimTQABzAAAAtmIVtmVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//sQZAAO4AAAf4AAAAgAAA/wAAABAoQDLmAAACBYgGYMAAAE+oH///////0WKFRVzjKnAmjp+XX9qP//////p0USaKtMwpjZNhNFyEM61QAAOAP////////nfSpMQU1FMy45OC4yqqr/+xBEDI/wAAB/gAAACAxgGaMAAAEAAAH+AAAAIAAAP8AAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqv/7EGQoD/AAAGkAAAAIAAANIAAAAQAAAaQAAAAgAAA0gAAABKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",EVENT_NATIVE_PLAY:"play",EVENT_NATIVE_PAUSE:"pause",EVENT_NATIVE_TIMEUPDATE:"timeupdate",EVENT_NATIVE_ENDED:"ended",EVENT_NATIVE_DURATION:"durationchange",EVENT_NATIVE_LOADING:"progress",EVENT_NATIVE_META:"loadedmetadata",EVENT_NATIVE_CANPLAY:"canplay",EVENT_NATIVE_PLAYING:"playing",EVENT_NATIVE_ERROR:"error",EVENT_NATIVE_STALLED:"stalled",EVENT_VOLUMECHANGE:"volumechange",EVENT_RATECHANGE:"ratechange",EVENT_SEEKED:"seeked",promiseLoadedEvents:["progress"],promisePlayingEvents:["timeupdate"],promiseMetadataEvents:["loadedmetadata","canplay"],loaderInteruptReasons:["load","stop","startPlay","play","destroy"]};class v{isOnlyDeviceVolume(){let e=!0;try{let t=document.createElement("audio");t.volume=.63,e=Math.abs(t.volume-.63)>.01}catch(t){e=!0}return e}parseParams(e){let t=e.split("?")[1];return t&&t.length?t.split("&").reduce(function(e,t){let i=t.split("="),a=i[0],o=i[1];return a&&o&&(e[a]=o),e},{}):{}}updateUrl(e,t){let i=this.parseParams(e),a="";for(let e in Object.assign(i,t),i)Object.prototype.hasOwnProperty.call(i,e)&&(a+=`${e}=${i[e]}`);return e+(a?`?${a}`:"")}getCookie(e){let t=document.cookie.split(";").reduce((e,t)=>{let[i,a]=t.trim().split("=");return i&&a?{...e,[i]:a}:e},{})[e];return t||""}}let E=1,f=()=>{let e=document.createElement("audio");return e.autoplay=!1,e.loop=!1,e.preload="auto",e.crossOrigin="anonymous",e};class _{audio=f();browser=new v;emitter;src="";position=0;lastGoodTime=0;lastUpdate=0;notLoading=!0;shouldUseHlsPlayer;shouldPause=!1;shouldPlay=!1;playing=!1;ended=!1;promiseMode=!1;isHlsTrack=!1;promises={};audioContext=null;loaderTimer=null;promiseCheckTO=null;retry=0;playerInitializationTime;clearInitListener=null;clearNativePauseListener=null;hls=null;isAutoplayable=!1;name=E++;whenReady;constructor(e,t){this.shouldUseHlsPlayer=e,this.playerInitializationTime=Date.now(),this.emitter=t,this.startupAudio=this.startupAudio.bind(this),this.updateProgress=this.updateProgress.bind(this),this.onNativeLoading=this.onNativeLoading.bind(this),this.onNativeEnded=this.onNativeEnded.bind(this),this.onNativeError=this.onNativeError.bind(this),this.onNativePause=this.onNativePause.bind(this),this.onNativePlay=this.onNativePlay.bind(this),this.onNativeSeeked=this.onNativeSeeked.bind(this),this.onNativeStalled=this.onNativeStalled.bind(this),this.onNativeCanplay=this.onNativeCanplay.bind(this),this.onNativePlaying=this.onNativePlaying.bind(this),this.onNativeVolumeChange=this.onNativeVolumeChange.bind(this),this.onNativeRatechange=this.onNativeRatechange.bind(this),this.whenReady=this.init()}updateProgress(){let e=Number(new Date);if(e-this.lastUpdate=this.audio.duration-.1&&this.emitter.emit(h.EVENT_LOADED)}}onNativeEnded(){this.ended=!0,this.playing=!1,this.shouldPause=!0,this.emitter.emit(h.EVENT_ENDED)}onNativeError(){this.src&&this.src!==p.EMPTY_SOUND&&(this.audio&&this.audio.error&&this.emitter.emit(h.EVENT_ERROR,this.audio.error),this.playing=!1)}onNativePause(){this.emitter.emit(h.EVENT_PAUSE),this.shouldPause=!1}onNativePlay(){this.emitter.emit(h.EVENT_PLAY),this.shouldPlay=!1}onNativeSeeked(){this.emitter.emit(h.EVENT_SEEKED)}onNativeStalled(){this.emitter.emit(h.EVENT_STALLED)}onNativeCanplay(){this.emitter.emit(h.EVENT_CANPLAY)}onNativePlaying(){this.playing&&this.emitter.emit(h.EVENT_PLAYING)}onNativeVolumeChange(){this.emitter.emit(h.EVENT_VOLUMECHANGE,this.volumeLevel)}onNativeRatechange(){this.emitter.emit(h.EVENT_RATECHANGE,this.playbackRate)}initUserEvents(){document.body.addEventListener("mousedown",this.startupAudio,!0),document.body.addEventListener("keydown",this.startupAudio,!0),document.body.addEventListener("touchstart",this.startupAudio,!0)}deinitUserEvents(){document.body.removeEventListener("mousedown",this.startupAudio,!0),document.body.removeEventListener("keydown",this.startupAudio,!0),document.body.removeEventListener("touchstart",this.startupAudio,!0)}initNativeEvents(){this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,this.onNativePause),this.audio.addEventListener(p.EVENT_NATIVE_PLAY,this.onNativePlay),this.audio.addEventListener(p.EVENT_NATIVE_ENDED,this.onNativeEnded),this.audio.addEventListener(p.EVENT_NATIVE_TIMEUPDATE,this.updateProgress),this.audio.addEventListener(p.EVENT_NATIVE_DURATION,this.updateProgress),this.audio.addEventListener(p.EVENT_NATIVE_LOADING,this.onNativeLoading),this.audio.addEventListener(p.EVENT_NATIVE_ERROR,this.onNativeError),this.audio.addEventListener(p.EVENT_SEEKED,this.onNativeSeeked),this.audio.addEventListener(p.EVENT_NATIVE_STALLED,this.onNativeStalled),this.audio.addEventListener(p.EVENT_NATIVE_CANPLAY,this.onNativeCanplay),this.audio.addEventListener(p.EVENT_NATIVE_PLAYING,this.onNativePlaying),this.audio.addEventListener(p.EVENT_VOLUMECHANGE,this.onNativeVolumeChange),this.audio.addEventListener(p.EVENT_RATECHANGE,this.onNativeRatechange))}deinitNativeEvents(){this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PAUSE,this.onNativePause),this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,this.onNativePlay),this.audio.removeEventListener(p.EVENT_NATIVE_ENDED,this.onNativeEnded),this.audio.removeEventListener(p.EVENT_NATIVE_TIMEUPDATE,this.updateProgress),this.audio.removeEventListener(p.EVENT_NATIVE_DURATION,this.updateProgress),this.audio.removeEventListener(p.EVENT_NATIVE_LOADING,this.onNativeLoading),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,this.onNativeError),this.audio.removeEventListener(p.EVENT_SEEKED,this.onNativeSeeked),this.audio.removeEventListener(p.EVENT_NATIVE_STALLED,this.onNativeStalled),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,this.onNativeCanplay),this.audio.removeEventListener(p.EVENT_NATIVE_PLAYING,this.onNativePlaying),this.audio.removeEventListener(p.EVENT_VOLUMECHANGE,this.onNativeVolumeChange),this.audio.removeEventListener(p.EVENT_RATECHANGE,this.onNativeRatechange))}init(){return this.initEvents().then(()=>{this.shouldUseHlsPlayer&&this.initHls()})}initEvents(){return new Promise(e=>{this.initUserEvents(),this.initNativeEvents(),e()})}startupAudio(){this.audioContext&&this.audioContext.resume(),this.deinitUserEvents();let e=()=>{this.shouldPlay=!1,this.isAutoplayable=!0},t=e=>{this.shouldPlay=!1,console.info(`_startupAudio:failReason:${e||""}`)},i=()=>{if(this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_META,i),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,i)),this.promiseMode)return;let t=()=>{this.audio&&this.audio.removeEventListener(p.EVENT_NATIVE_PAUSE,t),e()};this.clearNativePauseListener=()=>{this.audio&&this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,t)},this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,t),this.audio.pause(),this.shouldPause=!0)};this.clearInitListener=()=>{this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_META,i),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,i))},this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PLAY,i),this.audio.addEventListener(p.EVENT_NATIVE_CANPLAY,i),this.audio.addEventListener(p.EVENT_NATIVE_META,i),this.audio.addEventListener(p.EVENT_NATIVE_ERROR,i),this.audio.load(),this.shouldPlay=!0,this.promiseMode=!0,this.audio.play().then(()=>{e(),this.shouldPause=!0,this.shouldPlay=!1,this.audio&&this.audio.pause()}).catch(()=>{this.shouldPause=!0,this.shouldPlay=!1,t("audio.play")}))}initAndCheckAutoplay(){return new Promise(e=>{let t=()=>{this.shouldPlay=!1,this.isAutoplayable=!0,e()},i=t=>{this.shouldPlay=!1,this.isAutoplayable=!1,console.info(this,`initAndCheckAutoplay:failReason:${t||""}`),e()},a=e=>{if(this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,a),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,a),this.audio.removeEventListener(p.EVENT_NATIVE_META,a),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,a)),this.promiseMode)return;if(e.type===p.EVENT_NATIVE_ERROR||e.type===p.EVENT_NATIVE_META){i(e.type);return}let o=e=>{if(e.type===p.EVENT_NATIVE_ERROR){i(e.type);return}this.audio&&this.audio.removeEventListener(p.EVENT_NATIVE_PAUSE,o),t()};this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,o),this.audio.pause()),this.shouldPause=!0};this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PLAY,a),this.audio.addEventListener(p.EVENT_NATIVE_CANPLAY,a),this.audio.addEventListener(p.EVENT_NATIVE_META,a),this.audio.addEventListener(p.EVENT_NATIVE_ERROR,a),this.audio.src=p.EMPTY_SOUND,this.audio.load(),this.shouldPlay=!0,this.promiseMode=!0,this.audio.play().then(()=>{t(),this.shouldPause=!0,this.shouldPlay=!1,this.audio&&this.audio.pause()}).catch(()=>{this.shouldPause=!0,this.shouldPlay=!1,i("audio.play")}))})}breakStartup(e){this.deinitUserEvents(),this.clearInitListener&&this.clearInitListener(),this.clearNativePauseListener&&this.clearNativePauseListener(),console.warn("_startupAudio:interrupted",e)}waitFor(e,t,i){let a;let o=this.promises[e];if(o)a=o.promise();else{let o=()=>{},r=[new Promise((e,t)=>{o=t})],n={},l=e=>new Promise(i=>{let a=()=>{t()&&i()};this.audio&&(this.audio.addEventListener(e,a),n[e]=a)}),s=()=>{for(let e of Object.keys(n))if(this.audio){let t=n[e];t&&this.audio.removeEventListener(e,t)}};for(let e of i)r.push(l(e));let d=Promise.race(r);d.then(s).catch(s),this.promises[e]={promise:()=>d,reject:o},a=d}return a}cancelWait(e,t){let i;(i=this.promises[e])&&(delete this.promises[e],i.reject(t))}abortPromises(e){for(let t in this.promises)Object.prototype.hasOwnProperty.call(this.promises,t)&&this.cancelWait(t,e)}promiseMetadataCheck(){return!!this.audio&&this.audio.readyState>this.audio.HAVE_METADATA}promiseMetadata(){return this.waitFor("metadata",()=>this.promiseMetadataCheck(),p.promiseMetadataEvents)}promiseLoadedCheck(){if(this.loaderTimer?clearTimeout(this.loaderTimer):this.loaderTimer=setTimeout(()=>{this.cancelWait("loaded","timeout")},5e3),this.audio){let e=Math.min(this.position+45,this.audio.duration),t=this.audio.buffered.end(0)-this.audio.buffered.start(0);return 0!==this.audio.buffered.length&&t>=e}return!1}promiseLoaded(){let e=this.waitFor("loaded",()=>this.promiseLoadedCheck(),p.promiseLoadedEvents),t=()=>{this.loaderTimer&&clearTimeout(this.loaderTimer)};return e.then(t).catch(t),e}promisePlayingCheck(){if(this.audio){let e=Math.min(this.position+.2,this.audio.duration);return this.promiseCheckTO&&clearTimeout(this.promiseCheckTO),0!==this.audio.currentTime||this.audio.paused||(this.promiseCheckTO=setTimeout(()=>{this.audio&&0===this.audio.currentTime&&!this.audio.paused&&(this.audio.currentTime=1)},1e3)),this.audio.currentTime>=e}return!1}promisePlaying(){return this.waitFor("playing",()=>this.promisePlayingCheck(),p.promisePlayingEvents)}promiseStartPlaying(){let e,t=!1;if(this.promises.startPlaying)e=this.promises.startPlaying.promise();else{let i,a=()=>{},o=new Promise((e,o)=>{this.promisePlaying().then(()=>{t=!0,clearTimeout(i),e()}).catch(e=>{t=!0,clearTimeout(i),this.cancelWait("startPlaying",e)}),this.promiseLoaded().then(()=>{t||(i=setTimeout(()=>{o("timeout"),this.cancelWait("playing","timeout"),console.warn("startPlaying:failed")},5e3))}).catch(e=>{t=!0,clearTimeout(i),this.cancelWait("startPlaying",e)}),a=o});this.promises.startPlaying={promise:()=>o,reject:a},e=this.promises.startPlaying.promise()}return e}load(e){this.abortPromises("load"),this.breakStartup("load"),this.ended=!1,this.playing=!1,this.notLoading=!0,this.position=0,this.lastGoodTime=0,this.src=e,this.audio&&(/\.m3u8$/.test(e)?(this.isHlsTrack=!0,this.destroyHls(),this.initHls(),this.hls?.loadSource(this.getHlsPlayingEntityUrl(e))):(this.isHlsTrack=!1,this.audio.src=e),this.audio.load())}stop(){this.abortPromises("stop"),this.breakStartup("stop"),this.isHlsTrack&&this.destroyHls(),this.load("")}startPlay(){this.audio&&(this.audio.currentTime=this.position),this.playing&&(this.breakStartup("startPlay"),this.shouldPlay=!0,this.audio&&this.audio.play().catch(e=>{console.error(e)}),this.hls&&this.hls.startLoad(),this.promiseStartPlaying().then(()=>{this.retry=0}))}play(e){this.retry=0,this.loadMetadata(e)}loadMetadata(e){this.playing||(this.breakStartup("play"),this.ended=!1,this.playing=!0,null!=e&&(this.position=e),this.promiseMetadata().then(()=>this.startPlay()).catch(e=>{"string"==typeof e&&p.loaderInteruptReasons.includes(e)||console.error(e)}))}initHls(){this.hls||(this.hls=new m.ZP({liveDurationInfinity:!0,maxBufferSize:3e6}),this.audio&&this.hls.attachMedia(this.audio),this.initHlsEvents())}initHlsEvents(){this.hls&&(this.hls.on(m.ZP.Events.ERROR,(e,t)=>{if(t.fatal&&this.hls)switch(t.type){case m.ZP.ErrorTypes.NETWORK_ERROR:this.retry++,this.retry>2?(this.destroyHls(),this.playing=!1,this.emitter.emit(h.EVENT_ERROR,t)):this.hls.startLoad();break;case m.ZP.ErrorTypes.MEDIA_ERROR:this.hls.recoverMediaError();break;default:this.destroyHls(),this.playing=!1,this.emitter.emit(h.EVENT_ERROR,t)}}),this.hls.on(m.ZP.Events.DESTROYING,()=>{this.hls=null}))}getHlsPlayingEntityUrl(e){let t="";for(;t.length<44;)t+=(Math.random()+1).toString(36).substring(3);t=t.slice(0,44);let i=this.playerInitializationTime.toString().slice(0,10),a=`${t}xWEBx0001x${i}`;return this.browser.updateUrl(e,{vsid:a})}destroyHls(){this.retry=0,this.hls&&(this.hls.stopLoad(),this.hls.destroy(),this.hls=null)}pause(){this.shouldPause=!0,this.playing=!1,this.isHlsTrack&&this.hls&&this.hls.stopLoad(),this.audio&&(this.audio.pause(),this.position=this.audio.currentTime)}setPosition(e){if(!isFinite(e)){console.warn("setPositionFailed",e);return}this.position=e,this.promiseMetadata().then(()=>{this.audio&&(this.audio.currentTime=this.position)})}destroy(){this.audio&&(this.shouldPause=!0,this.audio.pause(),this.deinitNativeEvents()),this.abortPromises("destroy"),this.deinitUserEvents(),this.promises={}}get currentTime(){return this.audio?this.audio.currentTime:null}get duration(){return this.audio?this.audio.duration:null}get loaded(){let e;if(this.audio&&this.audio.buffered.length){let t=this.audio.buffered.length-1;e=this.audio.buffered.end(t)}else e=null;return e}get volumeLevel(){return this.audio?this.audio.volume:0}set volumeLevel(e){this.audio&&(this.audio.volume=e)}set defaultPlaybackRate(e){this.audio&&(this.audio.defaultPlaybackRate=e)}get playbackRate(){return this.audio?this.audio.playbackRate:1}set playbackRate(e){this.audio&&(this.audio.playbackRate=e)}get audioSrc(){return this.src}get audioNotLoading(){return this.notLoading}get autoplayable(){return this.isAutoplayable}}let y=1;class A{browser=new v;emitter;loader;name=y++;type="html5";whenReady;constructor(e,t){this.emitter=t,this.loader=new _(e,t),this.whenReady=this.loader.whenReady}get source(){return this.loader.audio}play(e,t){this.loader.load(e),this.loader.play(t)}setSrc(e,t){this.loader.load(e),this.loader.setPosition(t)}pause(){this.loader.pause()}resume(){this.loader.play()}stop(){this.loader.stop(),this.emitter.emit(h.EVENT_STOP)}destroy(){this.loader.destroy(),this.emitter.emit(h.EVENT_DESTROY)}getPosition(){return this.loader.currentTime}setPosition(e){this.loader.setPosition(e-.001)}getDuration(){return this.loader.duration}getLoaded(){return this.loader.loaded?this.loader.loaded:0}get volumeLevel(){return this.loader.volumeLevel}set volumeLevel(e){this.loader.volumeLevel=Math.min(1,e)}get speedLevel(){return this.loader.playbackRate}set speedLevel(e){this.loader.defaultPlaybackRate=e,this.loader.playbackRate=e}getSrc(){return""!==this.loader.audioSrc?this.loader.audioSrc:null}isDeviceVolume(){return this.browser.isOnlyDeviceVolume()}isAutoplayable(){return this.loader.autoplayable}}let P=1;class L{emitter=new u.v;played=0;lastSkip=0;playId=null;shouldUseHlsPlayer;implementation;promises={};name=P++;state=h.STATE_INIT;constructor(e=!1){this.shouldUseHlsPlayer=e,window.addEventListener("beforeunload",()=>this.onBeforeUnload(),!0),this.implementation=new A(this.shouldUseHlsPlayer,this.emitter),this.onAudioPlayerInit()}get source(){return this.implementation?.source}on(e,t){this.emitter.on(e,t)}off(e,t){this.emitter.off(e,t)}onAudioPlayerInit(){this.handleImplementationEvents(),this.setState(h.STATE_IDLE)}handleImplementationEvents(){this.emitter.on(h.EVENT_PLAY,()=>{this.implementationEventHandler(h.EVENT_PLAY)}),this.emitter.on(h.EVENT_ENDED,()=>{this.implementationEventHandler(h.EVENT_ENDED)}),this.emitter.on(h.EVENT_SWAP,()=>{this.implementationEventHandler(h.EVENT_SWAP)}),this.emitter.on(h.EVENT_STOP,()=>{this.implementationEventHandler(h.EVENT_STOP)}),this.emitter.on(h.EVENT_ERROR,()=>{this.implementationEventHandler(h.EVENT_ERROR)}),this.emitter.on(h.HLS_EVENT_ERROR,()=>{this.implementationEventHandler(h.HLS_EVENT_ERROR)}),this.emitter.on(h.EVENT_PAUSE,()=>{this.implementationEventHandler(h.EVENT_PAUSE)}),this.emitter.on(h.EVENT_CRASHED,()=>{this.implementationEventHandler(h.EVENT_CRASHED)})}implementationEventHandler(e){switch(e){case h.EVENT_PLAY:this.setState(h.STATE_PLAYING);break;case h.EVENT_ENDED:case h.EVENT_SWAP:case h.EVENT_STOP:case h.EVENT_ERROR:case h.HLS_EVENT_ERROR:this.setState(h.STATE_IDLE);break;case h.EVENT_PAUSE:this.setState(h.STATE_PAUSED);break;case h.EVENT_CRASHED:this.setState(h.STATE_CRASHED)}}onBeforeUnload(){"undefined"!=typeof window&&navigator&&1===navigator.maxTouchPoints||this.destroy()}setState(e){if(e===h.STATE_PAUSED&&this.state!==h.STATE_PLAYING)return;let t=this.state!==e;this.state=e,t&&this.emitter.emit(h.EVENT_STATE,e)}waitEvents(e,t,i){let a=()=>{},o=()=>{},r=new Promise((e,t)=>{a=e,o=t});this.promises[e]={promise:()=>r,reject:o};let n=()=>{for(let e of t)this.off(e,a);for(let e of i)this.off(e,o);delete this.promises[e]};for(let e of t)this.on(e,a);let l=e=>t=>{let i=t instanceof Error?t:new c(e);o(i)};for(let e of i)this.on(e,l(e));return r.then(n).catch(n),r}getState(){return this.state}getSrc(){return this.implementation?this.implementation.getSrc():null}play(e,t){this.played=0,this.lastSkip=0,this.generatePlayId(),this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_PLAY),this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_PLAY),this.promises.whenStop&&this.promises.whenStop.reject(h.EVENT_PLAY);let i=this.waitEvents("whenPlay",[h.EVENT_PLAY],[h.EVENT_STOP,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]);return this.implementation&&this.implementation.play(e,t),i}setSrc(e,t){this.implementation&&this.implementation.setSrc(e,t)}restart(){return this.getDuration()?(this.generatePlayId(),this.setPosition(0),this.played=0,this.lastSkip=0,this.resume()):Promise.reject(new c(C.BAD_STATE))}stop(){let e;return this.implementation&&(this.implementation.stop(),Promise.resolve()),this.played=0,this.lastSkip=0,this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_STOP),this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_STOP),e=this.promises.whenStop?this.promises.whenStop.promise():this.waitEvents("_whenStop",[h.EVENT_STOP],[h.EVENT_PLAY,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]),this.implementation&&this.implementation.stop(),e}pause(){let e;return this.state!==h.STATE_PLAYING?Promise.reject(new c(C.BAD_STATE)):(this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_PAUSE),e=this.promises.whenPause?this.promises.whenPause.promise():this.waitEvents("_whenPause",[h.EVENT_PAUSE],[h.EVENT_STOP,h.EVENT_PLAY,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]),this.implementation&&this.implementation.pause(),e)}resume(){let e;return this.state!==h.STATE_PLAYING||this.promises.whenPause?this.state===h.STATE_IDLE||this.state===h.STATE_PAUSED||this.state===h.STATE_PLAYING?(this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_RESUME),e=this.promises.whenPlay?this.promises.whenPlay.promise():this.waitEvents("_whenPlay",[h.EVENT_PLAY],[h.EVENT_STOP,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]),this.implementation&&this.implementation.resume(),e.then(()=>{this.emitter.emit(h.EVENT_RESUME)})):Promise.reject(new c(C.BAD_STATE)):Promise.resolve()}destroy(){this.played=0,this.lastSkip=0,this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_DESTROY),this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_DESTROY),this.implementation&&this.implementation.destroy()}getPosition(){let e=null;return this.implementation&&(e=this.implementation.getPosition()),e||0}setPosition(e){return this.implementation&&this.implementation.setPosition(e),this.played+=this.getPosition()-this.lastSkip,this.lastSkip=e,e}getDuration(){let e=null;return this.implementation&&(e=this.implementation.getDuration()),null===e?0:e}getLoaded(){return this.implementation?this.implementation.getLoaded():0}getPlayed(){let e=this.getPosition();return this.played+=e-this.lastSkip,this.lastSkip=e,this.played}getVolume(){return this.implementation?this.implementation.volumeLevel:0}setVolume(e){let t=0;return this.implementation&&(this.implementation.volumeLevel=e,t=e),t}getSpeed(){return this.implementation?this.implementation.speedLevel:0}setSpeed(e){let t=0;return this.implementation&&(this.implementation.speedLevel=e,t=e),t}isDeviceVolume(){return!this.implementation||this.implementation.isDeviceVolume()}isAutoplayable(){let e=null;return this.implementation&&(e=this.implementation.isAutoplayable()),null!==e&&e}generatePlayId(){this.playId=Math.random().toString().slice(2)}getPlayId(){return this.playId}}class x{pauseHandlers=[];core=new L;get source(){return this.core.source}play(e,t){return this.core.play(e,t)}setSrc(e,t){this.core.setSrc(e,t)}setProgress(e){let t=this.core.setPosition(e);return Promise.resolve(t)}pause(){return this.core.pause()}resume(){return this.core.resume()}setVolume(e){let t=this.core.setVolume(e);return Promise.resolve(t)}setSpeed(e){let t=this.core.setSpeed(e);return Promise.resolve(t)}stop(){return this.core.stop()}onAudioEnd(e){this.core.on(h.EVENT_ENDED,e)}onAudioPaused(e){let t=()=>{"paused"===this.core.getState()&&e()};this.pauseHandlers.push({handler:t,originalCallback:e}),this.core.on(h.EVENT_STATE,t)}onAudioResume(e){this.core.on(h.EVENT_RESUME,e)}onAudioUpdatingProgress(e){this.core.on(h.EVENT_PROGRESS,e)}onAudioSeeked(e){this.core.on(h.EVENT_SEEKED,e)}onAudioStalled(e){this.core.on(h.EVENT_STALLED,e)}onAudioCanplay(e){this.core.on(h.EVENT_CANPLAY,e)}onAudioPlaying(e){this.core.on(h.EVENT_PLAYING,e)}onAudioError(e){this.core.on(h.EVENT_ERROR,e)}onAudioVolumeChange(e){this.core.on(h.EVENT_VOLUMECHANGE,e)}onAudioSpeedChange(e){this.core.on(h.EVENT_RATECHANGE,e)}offAudioEnd(e){this.core.off(h.EVENT_ENDED,e)}offAudioPaused(e){let t=this.pauseHandlers.find(t=>t.originalCallback===e);t&&this.core.off(h.EVENT_STATE,t.handler)}offAudioResume(e){this.core.off(h.EVENT_RESUME,e)}offAudioUpdatingProgress(e){this.core.off(h.EVENT_PROGRESS,e)}offAudioSeeked(e){this.core.off(h.EVENT_SEEKED,e)}offAudioStalled(e){this.core.off(h.EVENT_STALLED,e)}offAudioCanplay(e){this.core.off(h.EVENT_CANPLAY,e)}offAudioPlaying(e){this.core.off(h.EVENT_PLAYING,e)}offAudioError(e){this.core.off(h.EVENT_ERROR,e)}offAudioVolumeChange(e){this.core.off(h.EVENT_VOLUMECHANGE,e)}offAudioSpeedChange(e){this.core.off(h.EVENT_RATECHANGE,e)}}var b=i(57413),g=i(14408),N=i(68244);class V{apply(e){let{hooks:t,playback:i}=e;t.afterContextSet.tap("ApplyContextPlugin",()=>{let e=i.state.currentContext.value;e&&e instanceof N.$n&&e.apply({hooks:t,playback:i})})}}let S=null;function T(e){let t=e.state.queueState.index.value,i=e.state.currentContext.value,a=void 0!==e.state.queueState.order.value[t-1];i&&(i.availableActions.moveBackward.value=a),null!==S&&(S(),S=null),0===t&&(S=e.state.playerState.progress.onChange(e=>{i&&(i.availableActions.moveBackward.value=!!e&&e.position>N.lz)}))}var w=i(34603);function R(e){let{value:t}=e.state.currentContext,{value:i}=e.state.queueState.currentEntity,a=void 0!==t;if(a&&void 0!==i){let{meta:a}=i.entity.data,o=(0,b.xA)(t)||(0,b.Q7)(t)||"type"in a&&a.type&&w.UE.includes(a.type);o?(t.availableActions.repeat.value=!1,t.availableActions.shuffle.value=!1,e.state.queueState.repeat.value!==N.zq.NONE&&e.setRepeatMode(N.zq.NONE),e.state.queueState.shuffle.value&&e.toggleShuffle()):(t.availableActions.repeat.value=!0,t.availableActions.shuffle.value=!0)}}let M=e=>{let t="albums"in e&&e.albums&&e.albums.length>0&&e.albums[0]&&e.albums[0].type===w.VZ.PODCAST,i="type"in e&&e.type===w.Vc.PODCAST;return!!(i||t)};function H(e){let{value:t}=e.state.currentContext,{value:i}=e.state.queueState.currentEntity,a=void 0!==t;if(a&&void 0!==i){let{meta:e}=i.entity.data,a=M(e);t.availableActions.speed.value=!!a}}class k{apply(e){let{hooks:t,playback:i}=e;t.afterContextSet.tap("AvailableActionsPlugin",()=>{R(i),H(i)}),t.beforeMediaStartPlaying.tap("AvailableActionsPlugin",()=>{R(i),H(i)}),i.state.queueState.entityList.onChange(()=>{T(i)}),i.state.queueState.index.onChange(()=>{T(i)})}}class j{apply(e){let{playback:t,hooks:i}=e;t.state.playerState.event.onChange(()=>{let{currentEntity:e}=t.state.queueState;if(e.value)switch(t.state.playerState.event.value){case N.KX.PAUSED:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:`event-${N.KX.PAUSED}`});break;case N.KX.STALLED:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:`event-${N.KX.STALLED}`});break;case N.KX.PLAYING:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.PLAYING,reason:`event-${N.KX.PLAYING}`});break;case N.KX.MEDIA_ELEMENT_ERROR:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:`event-${N.KX.MEDIA_ELEMENT_ERROR}`})}}),i.beforeEntityPlayingProcessStart.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.clearTimeStagesOfPlayback(),Promise.resolve()}),i.afterMediaStartPlaying.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.PLAYING,reason:"hook-afterMediaStartPlaying"}),Promise.resolve()}),i.afterMediaEndPlaying.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:"hook-afterMediaEndPlaying"}),Promise.resolve()}),i.beforeEntityChange.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:"hook-beforeEntityChange"}),Promise.resolve()}),i.beforeContextSet.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:"hook-beforeContextSet"}),Promise.resolve()})}}var B=i(42503),Z=i(59899);function I(){let e=new Date;return e.toISOString()}function O(e){let t;let{contextEntityPair:i,totalPlayedSeconds:a,endPositionSeconds:o,type:r,maxPlayerStage:n}=e,{entity:l,context:s}=i,d=String(l.data.meta.id),u=function(e){let t;if("albums"in e.data.meta){let{data:{meta:{albums:i}}}=e;if(i){let e=i[0];e&&(t=String(e.id))}}return t}(l),c=0;"durationMs"in l.data.meta&&l.data.meta.durationMs&&(c=l.data.meta.durationMs/1e3);let C=a,h=o;.5>Math.abs(c-a)&&(C=c),.5>Math.abs(c-o)&&(h=c),t=(0,b.Q7)(s)?{generativeStreamId:String(s.data.meta.stream?.id)}:{trackId:d};let m={playId:l.playId,timestamp:I(),totalPlayedSeconds:C,endPositionSeconds:h,trackLengthSeconds:c,albumId:u,from:s.from,context:s.data.type,contextItem:String(s.data.meta.id),addTracksToPlayerTime:l.addTracksToPlayerTime,audioAuto:"none",audioOutputName:"Динамик",audioOutputType:"Speaker",maxPlayerStage:n,...t};if((0,b.xA)(s)&&s.data.meta.session&&(m.radioSessionId=s.data.meta.session.radioSessionId,m.context="radio",m.contextItem=s.data.meta.session.wave.stationId),(0,b.KT)(s)&&(m.playlistId=`${s.data.meta.uid}:${s.data.meta.kind}`,m.contextItem=`${s.data.meta.uid}:${s.data.meta.kind}`),(0,b.dt)(s)){let e=[b.Zc.Search,b.Zc.Other],t=s.data.overrideContextType??b.Zc.Other;m.context=t,e.includes(t)&&(m.contextItem=null)}return{type:r,isSent:!1,data:m}}(a=r||(r={})).START="start",a.END="end";var q=i(63278);class D extends q.y{name="PlaysException";constructor(e,{code:t="E_PLAYS",...i}={}){super(e,{code:t,...i}),Object.setPrototypeOf(this,D.prototype)}}class U{entityPlaysMap={};playerStageByEntitiesPlayId=new Map;playsResource;variables;constructor(e){let{httpClient:t,playsResourceConfig:i,variables:a}=e;this.playsResource=new w.ol(t,i),this.variables=a||{}}apply(e){let{hooks:t,playback:i}=e;i.state.playerState.event.onChange(()=>{let{currentEntity:e}=i.state.queueState;e.value&&i.state.playerState.event.value===N.KX.PLAYING&&this.changePlayerStageByPlayId({playId:e.value.entity.playId,stage:w.KZ.PLAY})}),t.beforeEntityPlayingProcessStart.tapPromise("PlaysPlugin",()=>new Promise(e=>{this.sendStartEntityPlay(i,t),e()})),t.afterMediaEndPlaying.tapPromise("PlaysPlugin",()=>new Promise(e=>{let{index:{value:a},entityList:{value:o},repeat:{value:r}}=i.state.queueState;(a===o.length-1||r===N.zq.ONE)&&this.sendEndEntityPlay(i,t),e()})),t.afterError.tapPromise("PlaysPlugin",e=>((e instanceof Z.Tb||e instanceof N.YR)&&this.sendEndEntityPlay(i,t),Promise.resolve())),t.beforeContextSet.tapPromise("PlaysPlugin",()=>new Promise(e=>{i.state.queueState.currentEntity.value&&i.state.currentContext.value?(0,b.xA)(i.state.currentContext.value)?this.sendEndEntityPlay(i,t).then(e):(this.sendEndEntityPlay(i,t),e()):e()})),t.beforeEntityChange.tapPromise("PlaysPlugin",()=>new Promise(e=>{i.state.queueState.currentEntity.value&&i.state.currentContext.value?(0,b.xA)(i.state.currentContext.value)?this.sendEndEntityPlay(i,t).then(e):(this.sendEndEntityPlay(i,t),e()):e()}))}sendStartEntityPlay(e,t){return new Promise(i=>{let a=e.state.queueState.currentEntity.value;try{if(a){a.entity.playId=(0,B.Z)(),a.entity.addTracksToPlayerTime=`${Math.random().toString().slice(2)}-${Math.ceil(Number(new Date)/1e3)}`;let o=O({type:r.START,contextEntityPair:a,totalPlayedSeconds:0,endPositionSeconds:0});this.saveEntityPlay(o),o.data.totalPlayedSeconds>2e3&&t.afterError.promise(new D("Plays error. Too big play time",{code:"E_PLAYS_BIG_PLAY_TIME",data:{timeStagesOfPlayback:a.entity.timeStagesOfPlayback,contextId:a.context.data.meta.id,entityId:a.entity.data.meta.id,totalPlayedSeconds:o.data.totalPlayedSeconds,trackLengthSeconds:o.data.trackLengthSeconds,playId:o.data.playId,isOnStart:!0,entityListLength:e.state.queueState.entityList.value.length,index:e.state.queueState.index.value,repeat:e.state.queueState.repeat.value}})),this.variables.disableSendPlaysOnTrackStart?i():this.playsResource.sendPlays({clientNow:I(),plays:[o.data]}).then(()=>{o.isSent=!0,i()}).catch(e=>{o.isSent=!1;let r="",n="";a&&(r=a.context.data.meta.id,n=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:e,data:{contextId:r,entityId:n}})),i()})}else i()}catch(r){let e="",o="";a&&(e=a.context.data.meta.id,o=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:r,data:{contextId:e,entityId:o}})),i()}})}sendEndEntityPlay(e,t){return new Promise(i=>{let a=e.state.queueState.currentEntity.value;try{if(a&&!(0,b.Q7)(a.context)){let o,n;let{entity:l}=a,s=this.entityPlaysMap[l.playId],d=!1;if(s&&(d=!!s.find(e=>e.type===r.END)),d){i();return}let u=a.entity.totalPlayedSeconds;this.variables.enableSendMaxPlayerStage&&(n=this.playerStageByEntitiesPlayId.get(l.playId)||w.KZ.PREPARE),o=0===u?O({type:r.END,contextEntityPair:a,totalPlayedSeconds:.1,endPositionSeconds:.1,maxPlayerStage:n}):O({type:r.END,contextEntityPair:a,totalPlayedSeconds:u,endPositionSeconds:e.state.playerState.progress.value.position,maxPlayerStage:n}),this.saveEntityPlay(o),this.playerStageByEntitiesPlayId.delete(o.data.playId),o.data.totalPlayedSeconds>2e3&&t.afterError.promise(new D("Plays error. Too big play time",{code:"E_PLAYS_BIG_PLAY_TIME",data:{timeStagesOfPlayback:a.entity.timeStagesOfPlayback,contextId:a.context.data.meta.id,entityId:a.entity.data.meta.id,totalPlayedSeconds:o.data.totalPlayedSeconds,trackLengthSeconds:o.data.trackLengthSeconds,playId:o.data.playId,isOnStart:!1,entityListLength:e.state.queueState.entityList.value.length,index:e.state.queueState.index.value,repeat:e.state.queueState.repeat.value}})),this.playsResource.sendPlays({clientNow:I(),plays:[o.data]}).then(()=>{o.isSent=!0,i()}).catch(e=>{o.isSent=!1;let r="",n="";a&&(r=a.context.data.meta.id,n=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:e,data:{contextId:r,entityId:n}})),i()})}else i()}catch(r){let e="",o="";a&&(e=a.context.data.meta.id,o=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:r,data:{contextId:e,entityId:o}})),i()}})}saveEntityPlay(e){let t=this.entityPlaysMap[e.data.playId];void 0===t?this.entityPlaysMap[e.data.playId]=[e]:t.push(e)}changePlayerStageByPlayId({playId:e,stage:t}){this.playerStageByEntitiesPlayId.set(e,t)}}(o=n||(n={})).PLAY="play",o.PAUSE="pause",o.NEXT="nexttrack",o.PREV="previoustrack",o.SEEK="seekto",o.STOP="stop";let z=[40,50,80,100,200,300,400],F=[n.PLAY,n.PAUSE,n.STOP,n.SEEK];class W{browserName;browserVersion;constructor({browserName:e,browserVersion:t}){this.browserName=e,this.browserVersion=t}isSupported(){return"mediaSession"in window.navigator&&"MediaMetadata"in window}handleMediaActionEvents(e,t){let{action:i}=e;switch(i){case n.PLAY:t.resume();break;case n.PAUSE:case n.STOP:t.pause();break;case n.NEXT:t.moveForward();break;case n.PREV:t.moveBackward();break;case n.SEEK:{if((0,g.OX)(t.state.queueState.currentEntity.value?.entity))return;let{seekTime:i}=e;i&&t.setProgress(i)}}}prepareMetadata(e){let t,i;let a={title:e.title};if("artists"in e){let t=(e.artists||[]).map(e=>e.name).join(", ");a.artist=t}if("albums"in e){let t=e.albums?.[0]?.title;a.album=t}return"coverUri"in e&&(t=e.coverUri),"imageUrl"in e&&(t=e.imageUrl),t&&(i=z.map(e=>{let i=`${e}x${e}`;return"Safari"===this.browserName&&(i=`${2*e}x${2*e}`),{sizes:i,src:`https://${t.replace("%%",i)}`,type:"image/jpg"}})),a.artwork=i,a}updateMetadata(e){if(!e)return;let t=this.prepareMetadata(e);window.navigator.mediaSession.metadata=new MediaMetadata(t)}handlePlayerEvents(e){let t,i;e.state.playerState.event.onChange(()=>{(e.state.playerState.event.value===N.KX.START||e.state.playerState.event.value===N.KX.UPDATING_PROGRESS)&&(this.updateMetadata(e.state.queueState.currentEntity.value?.entity.data.meta),(0,g.OX)(e.state.queueState.currentEntity.value?.entity)?navigator.mediaSession.setPositionState({duration:0,position:0}):navigator.mediaSession.setPositionState(),F.forEach(t=>{try{window.navigator.mediaSession.setActionHandler(t,t=>this.handleMediaActionEvents(t,e))}catch{console.log(`The media session action "${t}" is not supported yet.`)}}))}),e.state.currentContext.onChange(()=>{t?.(),i?.(),t=e.state.currentContext.value?.availableActions.moveBackward.onChange(()=>{let t=e.state.currentContext.value?.availableActions.moveBackward.value??!1;window.navigator.mediaSession.setActionHandler(n.PREV,t?t=>this.handleMediaActionEvents(t,e):null)}),i=e.state.currentContext.value?.availableActions.moveForward.onChange(()=>{let t=e.state.currentContext.value?.availableActions.moveForward.value??!1;window.navigator.mediaSession.setActionHandler(n.NEXT,t?t=>this.handleMediaActionEvents(t,e):null)})})}apply(e){let{playback:t}=e;this.isSupported()&&this.handlePlayerEvents(t)}}class Y{logger;constructor(e){let{logger:t}=e;this.logger=t}apply(e){let{hooks:t,playback:i}=e;t.afterError.tapPromise("LoggerPlugin",e=>{let t;let a=i.state.queueState.currentEntity.value?i.state.queueState.currentEntity.value.entity.mediaSource:null;return(t=e instanceof q.y?e:new q.y("Error in Sonata player",{code:"E_SONATA",cause:e})).name=`[Sonata] ${t.name}`,this.logger.error(t,{...t.data,...a||{},code:t.code,cause:t.cause,stack:t.stack}),Promise.resolve()})}}let G=[b.Ak.Album,b.Ak.Artist,b.Ak.Playlist,b.Ak.Various],K=(e,t)=>{let i=e.state.currentContext.value?.data;if(!i)return"";let a=i.type,o=e.state.queueState.entityList.value.length||0;return a===b.Ak.Various&&1===o&&(a="track"),i.type===b.Ak.Various&&i.overrideContextType&&(a=i.overrideContextType),`${t}-radio-${a}-autoflow`},J=e=>{let t=e.state.currentContext.value?.data;if(t){if(t.type===b.Ak.Album)return[`album:${t.meta.id}`];if(t.type===b.Ak.Artist)return[`artist:${t.meta.id}`];if(t.type===b.Ak.Playlist&&t.meta.owner?.uid&&t.meta.kind)return[`playlist:${t.meta.owner?.uid}_${t.meta.kind}`];if(t.type===b.Ak.Various){if(t.overrideAutoflowSeeds)return t.overrideAutoflowSeeds;let i=e.state.queueState.currentEntity.value?.entity.data.meta.id;return[`track:${i}`]}}};class ${contextFactory;platform;constructor({contextFactory:e,platform:t}){this.contextFactory=e,this.platform=t}apply(e){let{playback:t,hooks:i}=e;i.afterContextEnd.tapPromise("AutoflowPlugin",()=>{let e=t.state.currentContext.value?.data.type;return e&&G.includes(e)&&this.playAutoflow(t),Promise.resolve()})}playAutoflow(e){let t=e.state.currentContext.value?.data.type,i=J(e);if(!(t&&i))return;let a=this.contextFactory.create({data:{type:b.Ak.Vibe,meta:{id:b.Ak.Vibe},seeds:i,from:K(e,this.platform),includeTracksInResponse:!0}});e.playContext({context:a,loadContextMeta:!0})}}class X{quality;constructor(e){this.quality=e}apply(e){let{playback:t,hooks:i}=e;this.quality.onChange(()=>{t.state.playerState.status.value!==N.Xz.IDLE&&t.reloadEntity().catch(e=>{i.afterError.promise(e)})})}}class Q{streamsResource;timeoutId=0;constructor(e){let{httpClient:t,streamsResourceConfig:i}=e;this.streamsResource=new w.hd(t,i)}apply(e){let{hooks:t,playback:i}=e;t.beforeEntityChange.tapPromise("ContinuePlayingPlugin",()=>{let{position:e,duration:t}=this.getTimingsFromPlayback(i);return new Promise(a=>{e!==t&&this.checkBeforeProgressSync(i),a()})}),i.state.playerState.status.onChange(e=>{let{position:t,duration:a}=this.getTimingsFromPlayback(i);if(e===N.Xz.PAUSED||e===N.Xz.STOPPED){if(e===N.Xz.PAUSED&&t===a)return;this.clearTimeout(),this.checkBeforeProgressSync(i)}e===N.Xz.PLAYING&&this.shouldSendProgressSync(i)&&this.setTimeout(i)})}checkBeforeProgressSync(e){if(this.clearTimeout(),!this.shouldSendProgressSync(e))return;let{position:t,duration:i}=this.getTimingsFromPlayback(e),a=e.state.queueState.currentEntity.value?.entity.data.meta.id;Number.isFinite(i)&&Number.isFinite(t)&&i&&t&&a&&(this.sendProgressSync({duration:i,position:t,trackId:a}),e.state.playerState.status.value===N.Xz.PLAYING&&this.setTimeout(e))}sendProgressSync(e){let t=new Date().toISOString(),{duration:i,position:a,trackId:o}=e;this.streamsResource.progressSync({lastSyncTimestamp:t,trackStreams:[{trackId:o,positionSec:a,trackLengthSec:i,finished:a===i,timestamp:t}]})}shouldSendProgressSync(e){let t=e.state.queueState.currentEntity.value?.entity.data.meta;return!!(t&&"rememberPosition"in t&&t.rememberPosition)}setTimeout(e){this.clearTimeout(),this.timeoutId=window.setTimeout(()=>{this.checkBeforeProgressSync(e)},18e4)}clearTimeout(){window.clearTimeout(this.timeoutId)}getTimingsFromPlayback(e){return{duration:Math.floor(e.state.playerState.progress.value.duration),position:Math.floor(e.state.playerState.progress.value.position)}}}var ee=i(45412),et=i(86502),ei=i(66026),ea=i(57921),eo=i(69559),er=i(68085),en=i(5674);let el=null,es=null,ed=null,eu=(0,s.Pi)(e=>{let{children:t,hostTld:i,userAgent:a,quality:o}=e,r=(0,en.uK)(),{sonataState:n,experiments:s,library:u,user:c}=(0,en.oR)(),C=(0,en.wL)(),h=r.get(en.V0),{language:m}=(0,en.ZS)(),p=(0,d.useMemo)(()=>(el||(el=new Z.$J(o)),el),[o]),v=(0,d.useMemo)(()=>{if(es)return es;let e=r.get(en.U5),t=r.get(en.pI),o=t({credentials:"include"}),n=r.get(en.xi),{resources:l,player:{gateway:{prefixUrl:d,headers:c}}}=e,{timeouts:h,retryPolicyConfig:v}=l.musicExternalApi,E=new b.Tg({httpClient:o,logger:C,config:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},retryPolicyConfig:v,resourceTimeoutsConfig:h,gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c},contextVariables:{vibe:{get sendFeedbackToSessionTracks(){return s.checkExperiment(en.pe.WebNextWaveNewFeedbacks,"on")}}}}}),f=new g.nS({likeStore:u}),{overembed:_,externalDomain:y,...A}={params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},retryPolicyConfig:v,timeouts:h.tracksResource,gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c},overembed:e.player.overembed,externalDomain:e.player.externalDomain},P=new Z.Ez({downloadInfoProviderParams:{httpClient:o,resourceConfig:{...A,overembed:_,externalDomain:y},secretKey:e.player.secretKey,mediaConfigController:p},getFileInfoProviderParams:{httpClient:o,resourceConfig:A,secretKey:e.player.secretKey,mediaConfigController:p,transport:w.J7.RAW,variables:{get useNewCorrespondenceBetweenQualityParams(){return s.checkExperiment(en.pe.WebNextEnableNewQuality,"on")}}},variables:{get switchToStrmWithoutEncrypt(){return s.checkExperiment(en.pe.WebNextSwitchToStrmWithoutEncrypt,"on")}}}),L=new Z.sd({httpClient:o,config:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},retryPolicyConfig:v,timeouts:h.tracksResource,gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c}}}),N=new x;return es=new et.$7({contextFactory:E,entityFactory:f,audioCore:N,mediaProvider:P,entityProvider:L,windowPaginationConfig:{windowSize:30,setupQueueWindowSize:80},config:{mediaElementErrorReloadCount:2},plugins:[new k,new V,new j,new U({httpClient:o,playsResourceConfig:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c}},variables:{get disableSendPlaysOnTrackStart(){return s.checkExperiment(en.pe.WebNextDisableSendPlaysOnTrackStart,"on")},get enableSendMaxPlayerStage(){return s.checkExperiment(en.pe.WebPlayAudioSendPrepare,"on")}}}),new W({browserName:a.browserName,browserVersion:a.browserVersion}),new Y({logger:C}),new $({contextFactory:E,platform:"desktop"}),new X(p.quality),new Q({httpClient:o,streamsResourceConfig:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c}}})]})},[s,r,C,i,p,a.browserName,a.browserVersion,m,u]),E=(0,d.useMemo)(()=>(ed||(null==v?void 0:v.source)&&(ed="Safari"===a.browserName?new ei.Qz:new ei.WZ(v.source)),ed),[null==v?void 0:v.source,a.browserName]);v&&(0,ea.A4)(v),(0,d.useEffect)(()=>{let e,t,i,a,o;let r=null==v?void 0:v.state.queueState.currentEntity.onChange(e=>{var t;let i=null==e?void 0:e.context.data.type,a=null==e?void 0:e.context.data.meta.id;n.setEntityMeta(null!==(t=null==e?void 0:e.entity)&&void 0!==t?t:null),i&&n.setContextType(i),a&&n.setContextId(a)}),l=null==v?void 0:v.state.queueState.order.onChange(e=>{let t=v.state.queueState.index.value;if(e){let i=e[t];v.state.queueState.order.value.length>0&&"number"==typeof i&&n.setCurrentlyPlayingTrackIndex(i)}}),s=null==v?void 0:v.state.playerState.status.onChange(e=>{e&&(n.setStatus(e),(0,ea.Pt)({isPlaying:e===et.Xz.PLAYING}))}),d=null==v?void 0:v.state.currentContext.onChange(()=>{var r,l,s,d,u,c,C,m,p,E,f;null===(r=e)||void 0===r||r(),null===(l=t)||void 0===l||l(),null===(s=i)||void 0===s||s(),null===(d=a)||void 0===d||d(),null===(u=o)||void 0===u||u();let _=null!==(f=h.get(en.BU.YmPlayerRepeatMode))&&void 0!==f?f:ee.zq.NONE;v.setRepeatMode(_);let y=!!h.get(en.BU.YmPlayerShuffle);v.setShuffle(y),e=null==v?void 0:null===(c=v.state.currentContext.value)||void 0===c?void 0:c.availableActions.moveBackward.onChange(()=>{var e;let t=!!(null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveBackward.value);n.setCanMoveBackward(t),(0,ea.Pt)({canMoveBackward:t})}),t=null==v?void 0:null===(C=v.state.currentContext.value)||void 0===C?void 0:C.availableActions.moveForward.onChange(()=>{var e;let t=!!(null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveForward.value);n.setCanMoveForward(t),(0,ea.Pt)({canMoveForward:t})}),i=null==v?void 0:null===(m=v.state.currentContext.value)||void 0===m?void 0:m.availableActions.repeat.onChange(()=>{var e;let t=null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.repeat.value;"boolean"==typeof t&&n.setCanChangeRepeatMode(t)}),a=null==v?void 0:null===(p=v.state.currentContext.value)||void 0===p?void 0:p.availableActions.shuffle.onChange(()=>{var e;let t=null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.shuffle.value;"boolean"==typeof t&&n.setCanShuffle(t)}),o=null==v?void 0:null===(E=v.state.currentContext.value)||void 0===E?void 0:E.availableActions.speed.onChange(()=>{var e;let t=null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.speed.value;"boolean"==typeof t&&(n.setCanSpeed(t),!t&&v&&v.setSpeed(1))})}),u=null==v?void 0:v.state.playerState.volume.onChange(()=>{let e=v.state.playerState.volume.value;"number"==typeof e&&n.setVolume(e)}),c=null==v?void 0:v.state.queueState.repeat.onChange(()=>{let e=v.state.queueState.repeat.value;n.setRepeatMode(e),h.set(en.BU.YmPlayerRepeatMode,e)}),C=null==v?void 0:v.state.queueState.shuffle.onChange(()=>{let e=v.state.queueState.shuffle.value;n.setShuffle(e),h.set(en.BU.YmPlayerShuffle,e)});return()=>{null==r||r(),null==l||l(),null==s||s(),null==d||d(),null==u||u(),null==c||c(),null==C||C()}},[v,n,h]),(0,d.useEffect)(()=>{let e=h.get(en.BU.YmPlayerVolume);"number"==typeof e?(null==v||v.setVolume(e),n.setVolume(e)):(null==v||v.setVolume(1),n.setVolume(1))},[h,v,n]);let f=(0,d.useMemo)(()=>{let e=s.checkExperiment(en.pe.WebNextEnableNewQuality,"on");if(!c.hasPlus)return Z.nJ.PREVIEW;let t=h.get(en.BU.YmPlayerQuality);return(e||t!==Z.nJ.HQ_PLUS)&&t||(h.set(en.BU.YmPlayerQuality,Z.nJ.HQ),Z.nJ.HQ)},[s,c.hasPlus,h]);return(0,d.useEffect)(()=>{p.setQuality(f),n.setQuality(f)},[p,n,f]),(0,l.jsx)(en.Xe.Provider,{value:p,children:(0,l.jsx)(en.R8.Provider,{value:v,children:(0,l.jsx)(eo.y5.Provider,{value:E,children:t})})})})},42622:function(e,t,i){"use strict";i.r(t),i.d(t,{ThemeProvider:function(){return n}});var a=i(8759),o=i(99616),r=i(5674);let n=e=>{let{children:t}=e,i=(0,r.uK)(),n=i.get(r.V0),l=(0,r.oz)(),[s,d]=(0,o.useState)((0,r.NK)(n.get(r.BU.Theme),l));(0,o.useEffect)(()=>{(0,r.kz)(n.get(r.BU.Theme))},[n]),(0,o.useEffect)(()=>{n.get(r.BU.Theme)===r.rL&&d(l)},[l,n]);let u=(0,o.useMemo)(()=>({theme:s,setTheme:d}),[s]);return(0,a.jsx)(r.Ni.Provider,{value:u,children:t})}},19976:function(e,t,i){"use strict";i.r(t),i.d(t,{TranslationsProvider:function(){return s}});var a=i(8759),o=i(99616),r=i(17516),n=i(28151),l=i(5674);let s=e=>{let{children:t}=e,{dictionary:i,language:s,defaultLanguage:d}=(0,l.ZS)(),u=(0,l.wL)(),c=(0,o.useCallback)(e=>{if("code"in e&&e.code===r.bc.MISSING_DATA)return;let t=e&&"object"==typeof e&&"code"in e&&e.code,i="IntlProviderError";t&&(i+=":".concat(t)),u.error(i,{error:null==e?void 0:e.message,stack:null==e?void 0:e.stack})},[u]);return(0,a.jsx)(n.Z,{onError:c,defaultLocale:d,locale:s,messages:i,children:t})}},98125:function(e,t,i){"use strict";i.d(t,{F:function(){return v},K:function(){return h}});var a=i(8759),o=i(35338),r=i(33423),n=i(99616),l=i(65244),s=i(454),d=i(15527),u=i(14581),c=i(22926),C=i(5674);let h=()=>{let e=(0,C.uK)(),t=e.get(C.V0),i=(0,C.R$)();return(0,n.useCallback)(async e=>{var a;if(0!==e)t.set(C.BU.YmPlayerPrevVolume,e),await (null==i?void 0:i.setVolume(0)),t.set(C.BU.YmPlayerVolume,0);else{let e=null!==(a=t.get(C.BU.YmPlayerPrevVolume))&&void 0!==a?a:1;t.remove(C.BU.YmPlayerPrevVolume),await (null==i?void 0:i.setVolume(e)),t.set(C.BU.YmPlayerVolume,e)}},[i,t])};var m=i(73939),p=i.n(m);let v=(0,r.Pi)(e=>{var t,i;let{className:r}=e,{formatMessage:m}=(0,l.Z)(),v=(0,C.uK)(),E=(0,C.R$)(),{sonataState:f}=(0,C.oR)(),_=h(),y=v.get(C.V0),A=null!==(i=null!==(t=y.get(C.BU.YmPlayerVolume))&&void 0!==t?t:f.volume)&&void 0!==i?i:1,P=(0,n.useCallback)(e=>{null==E||E.setVolume(e),y.set(C.BU.YmPlayerVolume,e)},[E,y]),L=(0,n.useCallback)(async()=>{await _(f.volume)},[_,f.volume]),x=m(0===f.volume?{id:"player-actions.volume-on"}:{id:"player-actions.volume-off"});return(0,a.jsxs)("div",{className:(0,o.W)(p().root,r),children:[(0,a.jsx)(d.z,{radius:"round",size:"xxxs",variant:"text",withRipple:!1,onClick:L,"aria-label":x,icon:(0,a.jsx)(u.J,{size:"xs",className:p().icon,variant:0===A?"volumeOff":"volume"}),className:p().button,...(0,s.BA)(s.bG.changeVolume.CHANGE_VOLUME_BUTTON)}),(0,a.jsx)(c.i,{thumbSize:"s",trackSize:"s",value:A,maxValue:1,step:.01,onChange:P,"aria-label":m({id:"player-actions.volume-control"}),...(0,s.BA)(s.bG.changeVolume.CHANGE_VOLUME_SLIDER)})]})})},65151:function(e,t,i){"use strict";i.d(t,{t:function(){return s}});var a=i(8759),o=i(99616),r=i(45412),n=i(5674),l=i(34512);let s=()=>{let{notify:e}=(0,n.d$)(),{sonataState:t,modals:{fullscreenPlayerModal:i}}=(0,n.oR)(),s=(0,n.R$)();return(0,o.useCallback)(()=>{if(null===t.entityMeta||!t.canChangeRepeatMode)return;let o=r.zq.NONE;switch(t.repeatMode){case r.zq.NONE:o=r.zq.CONTEXT;break;case r.zq.CONTEXT:o=r.zq.ONE}null==s||s.setRepeatMode(o),e((0,a.jsx)(l.NotificationRepeat,{repeatMode:o}),{containerId:i.isOpened?n.W$.FULLSCREEN_INFO:n.W$.INFO})},[i.isOpened,e,s,t.canChangeRepeatMode,t.entityMeta,t.repeatMode])}},37960:function(e,t,i){"use strict";i.d(t,{m:function(){return l}});var a=i(8759),o=i(99616),r=i(5674),n=i(74758);let l=()=>{let{notify:e}=(0,r.d$)(),{sonataState:t,modals:{fullscreenPlayerModal:i}}=(0,r.oR)(),l=(0,r.R$)();return(0,o.useCallback)(()=>{null!==t.entityMeta&&t.canShuffle&&(null==l||l.toggleShuffle(),e((0,a.jsx)(n.NotificationShuffle,{shuffle:!!(null==l?void 0:l.state.queueState.shuffle.value)}),{containerId:i.isOpened?r.W$.FULLSCREEN_INFO:r.W$.INFO}))},[i.isOpened,e,l,t.canShuffle,t.entityMeta])}},34512:function(e,t,i){"use strict";i.r(t),i.d(t,{NotificationRepeat:function(){return h}});var a=i(8759),o=i(35338),r=i(99616),n=i(2814),l=i(45412),s=i(14581),d=i(1918),u=i(44285),c=i(55075),C=i.n(c);let h=e=>{let{repeatMode:t,closeToast:i}=e,c=t===l.zq.ONE?"repeat_one":"repeat",h=(0,r.useMemo)(()=>{let e;switch(t){case l.zq.CONTEXT:e=(0,a.jsx)(n.Z,{id:"notifications-info.change-repeat-context"});break;case l.zq.ONE:e=(0,a.jsx)(n.Z,{id:"notifications-info.change-repeat-track"});break;case l.zq.NONE:default:e=(0,a.jsx)(n.Z,{id:"notifications-info.change-repeat-none"})}return(0,a.jsx)(d.Caption,{className:C().message,variant:"div",type:"controls",size:"m",children:e})},[t]);return(0,a.jsx)(u.Yj,{cover:(0,a.jsx)(s.J,{className:(0,o.W)(C().icon,{[C().icon_unset]:t===l.zq.NONE}),size:"xs",variant:c}),message:h,closeToast:i})}},74758:function(e,t,i){"use strict";i.r(t),i.d(t,{NotificationShuffle:function(){return C}});var a=i(8759),o=i(35338),r=i(99616),n=i(2814),l=i(14581),s=i(1918),d=i(44285),u=i(46520),c=i.n(u);let C=e=>{let{shuffle:t,closeToast:i}=e,u=(0,r.useMemo)(()=>{let e;return e=t?(0,a.jsx)(n.Z,{id:"notifications-info.shuffle-enabled"}):(0,a.jsx)(n.Z,{id:"notifications-info.shuffle-disabled"}),(0,a.jsx)(s.Caption,{className:c().message,variant:"div",type:"controls",size:"m",children:e})},[t]);return(0,a.jsx)(d.Yj,{cover:(0,a.jsx)(l.J,{className:(0,o.W)(c().icon,{[c().icon_unset]:!t}),size:"xs",variant:"shuffle"}),message:u,closeToast:i})}},6769:function(e,t,i){"use strict";i.r(t),i.d(t,{RepeatButton:function(){return m}});var a=i(8759),o=i(35338),r=i(65244),n=i(454),l=i(45412),s=i(15527),d=i(14581),u=i(65151),c=i(20873),C=i.n(c);let h=(e,t,i)=>t(e===l.zq.NONE||i?{id:"player-actions.repeat"}:e===l.zq.ONE?{id:"player-actions.repeat-one"}:{id:"player-actions.repeat-context"}),m=e=>{let{isDisabled:t,repeatMode:i,className:c,iconClassName:m,size:p="xxxs",iconSize:v="xs",color:E,variant:f="default"}=e,_=(0,u.t)(),{formatMessage:y}=(0,r.Z)(),A=t||i!==l.zq.ONE?"repeat":"repeat_one",P=h(i,y,t);return(0,a.jsx)(s.z,{className:c,radius:"round",size:p,variant:f,color:E,disabled:t,withRipple:!1,"aria-label":P,"aria-pressed":!t&&i!==l.zq.NONE,onClick:_,icon:(0,a.jsx)(d.J,{size:v,variant:A,className:(0,o.W)(C().repeatIcon,C()["repeatIcon_".concat(i)],{[C().repeatIcon_disabled]:t},m)}),...(0,n.BA)(n.bG.sonata.REPEAT_BUTTON)})}},66403:function(e,t,i){"use strict";i.r(t),i.d(t,{ShuffleButton:function(){return C}});var a=i(8759),o=i(35338),r=i(65244),n=i(454),l=i(15527),s=i(14581),d=i(37960),u=i(94406),c=i.n(u);let C=e=>{let{isDisabled:t,shuffle:i,className:u,size:C="xxxs",variant:h="default",iconSize:m="xs",color:p}=e,v=(0,d.m)(),{formatMessage:E}=(0,r.Z)();return(0,a.jsx)(l.z,{className:u,radius:"round",size:C,variant:h,color:p,withRipple:!1,disabled:t,"aria-label":E({id:"player-actions.shuffle"}),"aria-pressed":!t&&i,icon:(0,a.jsx)(s.J,{variant:"shuffle",size:m,className:(0,o.W)(c().shuffleIcon,{[c().shuffleIcon_disabled]:t,[c().shuffleIcon_on]:!t&&i,[c().shuffleIcon_off]:!t&&!i})}),onClick:v,...(0,n.BA)(n.bG.sonata.SHUFFLE_BUTTON)})}},21871:function(e,t,i){"use strict";i.r(t),i.d(t,{SonataControls:function(){return w}});var a=i(8759),o=i(33423),r=i(99616),n=i(86502),l=i(5674),s=i(65151),d=i(37960),u=i(35338),c=i(65244),C=i(454),h=i(15527),m=i(14581),p=i(44285),v=i(6769),E=i(66403),f=i(19035),_=i.n(f);let y=(0,o.Pi)(e=>{let{disabled:t,isPlaying:i,repeatMode:o,canMoveForward:r,canMoveBackward:n,canShuffle:l,shuffle:s,onClickNext:d,onClickPrev:f,onClickPlayPause:y,canChangeRepeatMode:A,className:P}=e,{formatMessage:L}=(0,c.Z)();return(0,a.jsxs)("div",{className:(0,u.W)(_().root,P),children:[(0,a.jsx)("div",{className:_().buttonContainer,children:(t||l)&&(0,a.jsx)(E.ShuffleButton,{className:_().sonataButton,size:"xxxs",variant:"text",iconSize:"xs",isDisabled:t,shuffle:s})}),(0,a.jsxs)("div",{className:_().sonataButtons,children:[(0,a.jsx)(h.z,{className:_().sonataButton,variant:"text",size:"m",radius:"round",disabled:!n,withRipple:!1,"aria-label":L({id:"player-actions.previous-track"}),icon:(0,a.jsx)(m.J,{variant:"previous"}),onClick:f,...(0,C.BA)(C.bG.sonata.PREVIOUS_TRACK_BUTTON)}),(0,a.jsx)(p.JM,{className:_().sonataButton,iconSize:"l",variant:"filled",isPlaying:i,iconClassName:_().playButtonIcon,onClick:y}),(0,a.jsx)(h.z,{className:_().sonataButton,radius:"round",size:"m",variant:"text",disabled:!r,withRipple:!1,"aria-label":L({id:"player-actions.next-track"}),icon:(0,a.jsx)(m.J,{variant:"next"}),onClick:d,...(0,C.BA)(C.bG.sonata.NEXT_TRACK_BUTTON)})]}),(0,a.jsx)("div",{className:_().buttonContainer,children:(t||A)&&(0,a.jsx)(v.RepeatButton,{className:_().sonataButton,size:"xxxs",variant:"text",isDisabled:t,iconSize:"xs",repeatMode:o})})]})});var A=i(57004);let P=e=>{let{disabled:t,isPlaying:i,onClickPlayPause:o,className:r}=e;return(0,a.jsx)(A.PlayButton,{className:r,size:"s",disabled:t,isPlaying:i,onClick:o})};var L=i(24516),x=i.n(L);let b=(0,o.Pi)(e=>{let{disabled:t,isPlaying:i,repeatMode:o,canMoveForward:r,canMoveBackward:n,canShuffle:l,onClickNext:s,onClickPrev:d,onClickPlayPause:f,canChangeRepeatMode:_,shuffle:y,className:A}=e,{formatMessage:P}=(0,c.Z)();return(0,a.jsxs)("div",{className:(0,u.W)(x().root,A),children:[(0,a.jsx)("div",{className:x().buttonContainer,children:(t||l)&&(0,a.jsx)(E.ShuffleButton,{className:x().sonataButton,size:"s",iconSize:"xxs",color:"secondary",isDisabled:t,shuffle:y})}),(0,a.jsxs)("div",{className:x().sonataButtons,children:[(0,a.jsx)(h.z,{className:x().sonataButton,color:"secondary",size:"m",radius:"round",disabled:!n,withRipple:!1,"aria-label":P({id:"player-actions.previous-track"}),icon:(0,a.jsx)(m.J,{variant:"previous"}),onClick:d,...(0,C.BA)(C.bG.sonata.PREVIOUS_TRACK_BUTTON)}),(0,a.jsx)(p.JM,{className:x().sonataButton,iconSize:"m",size:"l",radius:"round",color:"secondary",buttonVariant:"default",isPlaying:i,iconClassName:x().playPauseButtonIcon,onClick:f}),(0,a.jsx)(h.z,{className:x().sonataButton,radius:"round",size:"m",color:"secondary",disabled:!r,withRipple:!1,"aria-label":P({id:"player-actions.next-track"}),icon:(0,a.jsx)(m.J,{variant:"next"}),onClick:s,...(0,C.BA)(C.bG.sonata.NEXT_TRACK_BUTTON)})]}),(0,a.jsx)("div",{className:x().buttonContainer,children:(t||_)&&(0,a.jsx)(v.RepeatButton,{className:x().sonataButton,size:"s",color:"secondary",isDisabled:t,iconSize:"xxs",repeatMode:o})})]})});var g=i(57413),N=i(43310),V=i(3273),S=i.n(V);let T=(0,o.Pi)(e=>{let{isPlaying:t,canMoveForward:i,canMoveBackward:o,onClickNext:n,onClickPrev:s,onClickPlayPause:d,className:C}=e,{formatMessage:v}=(0,c.Z)(),{user:E,sonataState:f}=(0,l.oR)(),_=(0,l.XU)(),y=f.entityMeta,A=f.contextType===g.Ak.Generative,P=E.isAuthorized&&!A,L=(0,N.SB)(f.entityMeta),x=(0,N.KX)(f.entityMeta);return(0,r.useEffect)(()=>{if(!f.isGenerativeContext)return null==_||_.addShortcutsListener(l.yx.LIKE,L),null==_||_.addShortcutsListener(l.yx.DISLIKE,x),()=>{null==_||_.removeShortcutsListener(l.yx.LIKE),null==_||_.removeShortcutsListener(l.yx.DISLIKE)}},[x,L,_,f.isGenerativeContext]),(0,a.jsxs)("div",{className:(0,u.W)(S().root,C),children:[(0,a.jsx)("div",{className:S().buttonContainer,children:y&&P&&(0,a.jsx)(p.Q1,{isDisliked:y.isDisliked,onClick:x})}),(0,a.jsxs)("div",{className:S().sonataButtons,children:[(0,a.jsx)(h.z,{className:S().sonataButton,variant:"text",color:"secondary",size:"m",radius:"round",disabled:!o,withRipple:!1,"aria-label":v({id:"player-actions.previous-track"}),icon:(0,a.jsx)(m.J,{variant:"previous"}),onClick:s}),(0,a.jsx)(p.JM,{className:S().sonataButton,iconSize:"xxl",variant:"filled",color:"secondary",isPlaying:t,iconClassName:S().playPauseButtonIcon,onClick:d}),(0,a.jsx)(h.z,{className:S().sonataButton,variant:"text",radius:"round",size:"m",color:"secondary",disabled:!i,withRipple:!1,"aria-label":v({id:"player-actions.next-track"}),icon:(0,a.jsx)(m.J,{variant:"next"}),onClick:n})]}),(0,a.jsx)("div",{className:S().buttonContainer,children:y&&P&&(0,a.jsx)(p.dJ,{isLiked:y.isLiked,onClick:L})})]})}),w=(0,o.Pi)(e=>{var t,i;let{isMobile:o,entityMeta:u,isFullscreen:c,className:C}=e,{sonataState:h,vibe:m}=(0,l.oR)(),p=(0,l.XU)(),v=(0,l.R$)(),{togglePlay:E}=(0,l.Qh)({seeds:null!==(i=null===(t=m.meta)||void 0===t?void 0:t.seeds)&&void 0!==i?i:[],pageIdForFrom:l.Rh.HOME,blockIdForFrom:l.BE.RUP_MAIN_RADIO}),f=(0,r.useMemo)(()=>{let e=[n.Xz.PLAYING,n.Xz.LOADING_MEDIA_SOURCE,n.Xz.LOADING_MEDIA_DATA];return e.includes(h.status)},[h.status]),_=(0,r.useCallback)(()=>{u?null==v||v.togglePause():E()},[u,v,E]),A=(0,r.useCallback)(()=>{null==v||v.moveForward()},[v]),L=(0,r.useCallback)(()=>{null==v||v.moveBackward()},[v]),x=(0,d.m)(),g=(0,s.t)();(0,r.useEffect)(()=>{if(!c)return null==p||p.addShortcutsListener(l.yx.TOGGLE_PLAY,_),null==p||p.addShortcutsListener(l.yx.TOGGLE_REPEAT,g),null==p||p.addShortcutsListener(l.yx.TOGGLE_SHUFFLE,x),()=>{null==p||p.removeShortcutsListener(l.yx.TOGGLE_PLAY),null==p||p.removeShortcutsListener(l.yx.TOGGLE_SHUFFLE),null==p||p.removeShortcutsListener(l.yx.TOGGLE_REPEAT)}},[c,_,g,x,p]);let N=(0,r.useMemo)(()=>c?o?T:b:o?P:y,[o,c]);return(0,a.jsx)(N,{className:C,disabled:null===h.entityMeta,isPlaying:f,canMoveBackward:h.canMoveBackward,canMoveForward:h.canMoveForward,canShuffle:h.canShuffle,shuffle:h.shuffle,onClickPlayPause:_,onClickNext:A,onClickPrev:L,canChangeRepeatMode:h.canChangeRepeatMode,repeatMode:h.repeatMode})})},68085:function(e,t,i){"use strict";i.d(t,{$:function(){return d}});var a,o,r=i(28307),n=i(93991),l=i(39351);(a=o||(o={})).WEB="YandexMusicWebNext",a.DESKTOP="YandexMusicDesktopApp";let s=(e,t)=>"".concat(e,"/").concat(t),d=()=>{{let e=(0,l.b)()||"1.0",t="".concat(o.DESKTOP).concat((0,n.y)((0,r.X)()));return s(t,e)}}},93991:function(e,t,i){"use strict";i.d(t,{y:function(){return o}});var a=i(38060);let o=e=>{switch(e){case"win32":return a.B.WINDOWS;case"darwin":return a.B.MACOS;case"linux":return a.B.LINUX}return null}},38060:function(e,t,i){"use strict";var a,o;i.d(t,{B:function(){return a}}),(o=a||(a={})).WINDOWS="Windows",o.MACOS="MacOS",o.LINUX="Linux"},2365:function(e,t,i){"use strict";i.d(t,{T:function(){return a.NotFound}});var a=i(54529)},54529:function(e,t,i){"use strict";i.r(t),i.d(t,{NotFound:function(){return m}});var a=i(8759),o=i(35338),r=i(33423),n=i(2814),l=i(15527),s=i(14581),d=i(1918),u=i(42769),c=i(5674),C=i(94170),h=i.n(C);let m=(0,r.Pi)(e=>{let{className:t}=e,{contentRef:i}=(0,c.$Y)(),r=(0,c.s0)("/");return(0,c.ZP)(!0),(0,a.jsxs)("div",{className:(0,o.W)(h().root,{[h().root_desktop]:!i},t),children:[(0,a.jsx)(u.n,{withBackwardFallback:"/",className:h().navigation,withForwardControl:!1}),(0,a.jsxs)("div",{className:h().content,children:[(0,a.jsx)(s.J,{className:h().icon,variant:"musicLogo",size:"xxl"}),(0,a.jsx)(d.Heading,{className:(0,o.W)(h().title,h().important),variant:"h3",size:"xs",children:(0,a.jsx)(n.Z,{id:"page-error.page-does-not-exist"})}),(0,a.jsx)(d.Caption,{className:(0,o.W)(h().text,h().important),variant:"span",type:"text",size:"l",weight:"normal",children:(0,a.jsx)(n.Z,{id:"page-error.page-does-not-exist-description"})}),(0,a.jsx)(l.z,{onClick:r,className:h().button,role:"link",color:"secondary",size:"l",radius:"xxxl",children:(0,a.jsx)(d.Caption,{type:"controls",variant:"span",size:"m",children:(0,a.jsx)(n.Z,{id:"navigation.page-main"})})})]})]})})},48157:function(e,t,i){"use strict";i.d(t,{hx:function(){return O},f3:function(){return ea},Vm:function(){return eg},KC:function(){return eT}});var a,o=i(8759),r=i(35338),n=i(33423),l=i(99616),s=i.t(l,2),d=i(65244),u=i(2814),c=i(454),C=i(57413),h=i(15527),m=i(14581),p=i(96437),v=i(1918),E=i(96911),f=i(96169),_=i(81446),y=i(5674),A=i(44285);let P=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.filter(e=>!e.composer),i=t.filter(e=>!e.various),a=e.filter(e=>e.composer&&!e.various),o=[];return i.length>0?o=i:t.length>0&&(o=t),o.concat(a)};var L=i(33779),x=i.n(L),b=i(13236),g=i(41342),N=i.n(g);let V=(0,n.Pi)(e=>{let{className:t,text:i="",maxTextLength:a,minTextLength:n,variant:s="input",shouldFinishOnKeyPress:d=!1,placeholder:u,onChangeFinish:c}=e,[C,h]=(0,l.useState)(i),m=(0,l.useRef)(!1),p=(0,l.useRef)(null),v=(0,l.useCallback)(e=>{h(e.target.value)},[]),E=(0,l.useCallback)(e=>{if(d&&["Enter","Escape"].includes(e.key)){var t;"Escape"===e.key&&(m.current=!0),null===(t=e.currentTarget)||void 0===t||t.blur()}},[d]),f=(0,l.useCallback)(()=>{let e=C.trim();m.current||n&&e.length{p.current&&(p.current.selectionStart=p.current.value.length,p.current.selectionEnd=p.current.value.length)},[]),(0,l.useLayoutEffect)(()=>{let e=p.current;if(e){e.style.height="0px";let t=e.scrollHeight;e.style.height="".concat(t,"px")}},[p,C]);let _=(0,l.useMemo)(()=>"textarea"===s?e=>(0,o.jsx)("textarea",{ref:p,rows:6,...e}):e=>(0,o.jsx)("input",{...e}),[s]);return(0,o.jsx)(_,{className:(0,r.W)(N().root,t,{[N().root_textarea]:"textarea"===s}),type:"text",value:C,maxLength:a,onBlur:f,onChange:v,onKeyDown:E,placeholder:u,autoFocus:!0})});var S=i(74081),T=i.n(S);let w=(0,n.Pi)(e=>{let{title:t="","aria-labelledby":i,canChange:a=!1,onChange:n,maxTitleLength:s,version:u="",onVersionClick:C,className:p}=e,{settings:E}=(0,y.oR)(),{formatMessage:f}=(0,d.Z)(),[_,A]=(0,l.useState)(!1),P=(0,l.useRef)(null),L=E.layout===y.t8.Mobile,x=t.length+u.length,g=x>25,N=(0,l.useMemo)(()=>L?T().font_mobile:g?T().font_long:T().font_short,[L,g]),S=!L&&a&&_,w=(0,l.useCallback)(()=>{var e;A(!0),null===(e=P.current)||void 0===e||e.focus()},[]),R=(0,l.useCallback)(e=>{A(!1),null==n||n(e)},[n]);return(0,o.jsxs)(o.Fragment,{children:[!S&&(0,o.jsxs)("div",{className:(0,r.W)(T().root,p),children:[(0,o.jsx)(b.b4,{title:t,className:T().stickyTitle,children:(0,o.jsxs)(v.Heading,{variant:"h2",id:i,className:(0,r.W)(T().heading,{[T().heading_withVersion]:u}),...(0,c.BA)(c.QM.pageHeader.ENTITY_TITLE),children:[(0,o.jsx)(v.Caption,{className:(0,r.W)(T().font,N,T().title),variant:"span",children:t}),u&&(0,o.jsx)(v.Caption,{onClick:C,className:(0,r.W)(T().font,N,T().version,{[T().version_withOtherVersions]:C}),variant:"span",...(0,c.BA)(c.QM.pageHeader.ENTITY_VERSION),children:" ".concat(u)})]})}),a&&(0,o.jsx)("div",{className:(0,r.W)(T().editButton,{[T().editButton_centered]:!g&&!L}),children:(0,o.jsx)(h.z,{onClick:w,"aria-label":f({id:"playlist-actions.change-title"}),icon:(0,o.jsx)(m.J,{size:"xxs",variant:"pencil"}),size:"s",radius:"round",...(0,c.BA)(c.QM.pageHeader.EDIT_TITLE_BUTTON)})})]}),S&&(0,o.jsx)("div",{className:T().textFieldContainer,children:(0,o.jsx)(V,{text:t,className:(0,r.W)(T().font,N,T().textField,T().title,{[T().textField_long]:g&&!L}),onChangeFinish:R,maxTextLength:s,minTextLength:1,placeholder:f({id:"playlist-actions.enter-title"}),shouldFinishOnKeyPress:!0})})]})}),R=(0,n.Pi)(e=>{let{"aria-labelledby":t,entityName:i,title:a,meta:n,controls:s,className:d,forwardRef:u,canChangeTitle:C=!1,maxTitleLength:h,onTitleChange:m,cover:p,version:E,onVersionClick:f,disclaimerLabel:_,entityNameIcon:y}=e,A=(0,l.isValidElement)(_),P=(0,l.useMemo)(()=>A?(0,o.jsx)("div",{className:x().entityContainer,children:_}):(0,o.jsxs)(v.Caption,{variant:"div",type:"text",size:"m",weight:"medium",className:x().entityName,children:[i,y]}),[_,i,y,A]);return(0,o.jsxs)("div",{className:(0,r.W)(x().root,d),ref:u,...(0,c.BA)(c.QM.pageHeader.ENTITY_HEADER),children:[(0,o.jsx)("div",{className:x().coverCell,children:p}),(0,o.jsxs)("div",{className:x().content,children:[(0,o.jsxs)("div",{className:x().info,children:[P,(0,o.jsx)(w,{className:(0,r.W)(x().title,{[x().title_withDisclaimerLabel]:A}),title:a,"aria-labelledby":t,canChange:C,maxTitleLength:h,onChange:m,version:E,onVersionClick:f}),!!n&&(0,o.jsx)("div",{className:(0,r.W)(x().meta,{[x().meta_withDisclaimerLabel]:A}),children:n})]}),(0,o.jsx)("div",{className:x().controls,children:s})]})]})}),M=(0,l.forwardRef)((e,t)=>(0,o.jsx)(R,{forwardRef:t,...e}));var H=i(86252),k=i.n(H);let j=e=>{let{coverVariant:t,coverUri:i,isAvailable:a,className:r,withBookmateBadge:n}=e;return(0,o.jsxs)(p.Paper,{radius:"round"===t?"round":"m",className:r,children:[(0,o.jsx)(A.BE,{fit:"cover",src:i,size:300,className:k().coverImage,withAvatarReplace:!0,isAvailable:a}),n&&(0,o.jsx)(m.J,{variant:"bookmateBadge",className:k().bookmateBadge})]})};var B=i(89998),Z=i.n(B);let I=(0,n.Pi)(e=>{var t,i,a;let n,{album:s,className:L,"aria-labelledby":x,forwardRef:b,onVersionClick:g}=e,N=(0,y.x5)({pageId:y.Rh.ALBUM,blockId:y.aU.ALBUM}),{formatMessage:V}=(0,d.Z)(),{settings:S,sonataState:{status:T,unloadedEntitiesData:w},experiments:R}=(0,y.oR)(),[H,k]=(0,l.useState)(!1),B=(0,f.SB)(s),I=(0,f.BV)(s),O=S.layout===y.t8.Mobile,q=R.checkExperiment(y.pe.WebPins,"on")&&!O,D=(0,f.TL)(s),U=(0,y.uK)(),z=U.get(y.U5),F=z.features.nonMusic&&s.isPodcast;F&&(n=s.isLiked?V({id:"interface-actions.subscribed"}):V({id:"interface-actions.subscribe"}));let W=(0,l.useMemo)(()=>P(s.artists),[s.artists]),Y=(null==W?void 0:W.length)===1&&!(null===(t=W[0])||void 0===t?void 0:t.decomposed)&&!(null===(i=W[0])||void 0===i?void 0:i.various),G=(0,f.H0)(s.type),{isPlaying:K,togglePlay:J}=(0,y.qm)({playContextParams:{contextData:{type:C.Ak.Album,meta:{id:s.id},from:N},loadContextMeta:!0,entitiesData:w},sonataStatus:T}),$=(0,o.jsxs)("div",{className:Z().meta,children:[Y&&(0,o.jsx)(p.Paper,{radius:"round",className:Z().artistCover,children:(0,o.jsx)(A.BE,{src:null===(a=W[0])||void 0===a?void 0:a.coverUri,size:30,withAvatarReplace:!0})}),(0,o.jsx)(_.jO,{artists:W,lineClamp:O?1:void 0,className:Z().artists,spoilerClassName:Z().artistsSpoiler,visibleArtistsCount:O?void 0:2,linkClassName:Z().artistLink,captionClassName:Z().artistLabel,variant:O?"breakAll":"breakWord"}),s.year&&(0,o.jsx)(v.Caption,{variant:"div",type:"text",size:"m",weight:"medium",className:(0,r.W)(Z().year,{[Z().year_dot]:W.length>0}),...(0,c.BA)(c.QM.pageHeader.ALBUM_RELEASE_DATE),children:s.year})]}),X=(0,l.useMemo)(()=>O?(0,o.jsx)(A.JM,{className:Z().playControl,color:"primary",buttonVariant:"default",iconSize:"xxl",isPlaying:K,onClick:J,variant:"filled",disabled:!s.isAvailable}):(0,o.jsx)(A.JM,{className:Z().playControl,withRipple:!0,buttonVariant:"default",radius:"xxxl",size:"s",color:"primary",iconSize:"xxs",isPlaying:K,onClick:J,disabled:!s.isAvailable,children:(0,o.jsx)(u.Z,{id:"player-actions.listen"})}),[s.isAvailable,O,K,J]),Q=(0,l.useMemo)(()=>{let e=O?"l":"s",t=O?"m":"xxs";return(0,o.jsxs)("div",{className:Z().controls,children:[X,(0,o.jsx)(A.dJ,{className:Z().likeControl,isLiked:s.isLiked,onClick:B,variant:"default",size:e,iconSize:t,iconClassName:Z().likeIcon,withRipple:!O,disabled:!s.isAvailable,"aria-label":n}),q&&(0,o.jsx)(A.RT,{onClick:I,isPinned:s.isPinned,isDisabled:!s.isAvailable,className:Z().pinControl}),(0,o.jsx)(E.oK,{album:s,open:H,onOpenChange:k,reference:(0,o.jsx)(h.z,{className:Z().menuControl,size:e,radius:"round",withRipple:!O,"aria-label":V({id:"interface-actions.context-menu"}),icon:(0,o.jsx)(m.J,{size:t,variant:"more"}),...(0,c.BA)(c.QM.pageHeader.ALBUM_HEADER_CONTEXT_MENU)})})]})},[O,X,s,B,n,q,I,H,V]),ee=(0,l.useMemo)(()=>{if(D)return(0,o.jsx)(m.J,{variant:"bookmateLogo",className:Z().bookmateLogo})},[D]);return(0,o.jsx)(M,{ref:b,className:L,controls:Q,meta:$,entityName:G,entityNameIcon:ee,title:s.title,cover:(0,o.jsx)(j,{coverVariant:"square",coverUri:s.coverUri,isAvailable:s.isAvailable,withBookmateBadge:D}),"aria-labelledby":x,version:s.version,onVersionClick:g})}),O=(0,l.forwardRef)((e,t)=>(0,o.jsx)(I,{forwardRef:t,...e}));var q=i(34603),D={5881:(e,t,i)=>{function a(){for(var e,t,i=0,a="";ia,default:()=>o});let o=a},5025:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root:"LizdJ2L0HW7JWOvPrfly"}},435:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root_controls_xxs:"tRaaBpDMg9Qu8v6gKjtn",root_entity_xxs:"M9zvtlcpLUVn6DKdcHhj",root_text_xxs:"ln0PYYwDmFnfYxCDJsFU",root_controls_xs:"n5AeWEsJC3_AYXcbK4Lt",root_entity_xs:"__hrMKGmNbw54T54IUyh",root_text_xs:"SehSa7OyRpC2nzYTVb2Q",root_controls_s:"_oBLf5gprWsKjCw4Ce58",root_entity_s:"mxSPe5xpZnie9gpIqacd",root_text_s:"Ai2iRN9elHpk_u5splD6",root_controls_m:"tk7ahHRDYXJMMB879KUA",root_entity_m:"Z_WIr2W8JU4MPQek3hgR",root_text_m:"g3qWNP6xl__7qxNmtrvd",root_controls_l:"grvxapJE3vGArOKDWf6n",root_entity_l:"Esj5A1UeSi4xV4tZ839D",root_text_l:"V3WU123oO65AxsprotU9",root_weight_normal:"ZYV27jeWd30QDXu4GhaH",root_weight_medium:"_3_Mxw7Si7j2g4kWjlpR",root_weight_bold:"Vi7Rd0SZWqD17F0872TB"}},5668:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root_size_xs:"qJJ288377iHlWN_RXeEE",root_size_s:"_sd8Q9d_Ttn0Ufe4ISWS",root_size_m:"Ctk8dbecq31Qh7isOJPQ",root_size_l:"M_Djh6ppIkCO3A2k_BTA",root_size_xl:"dtxlzGQMPAbM2MEndXWX",root_size_xxl:"IUb9XLplTAoZqne9rNUL",root_size_xxxl:"ZYZamUwql_rfFR4RpI2B",root_size_xxxxl:"ZBZyxow5njdq8z5dnRPY",root_weight_bold:"nSU6fV9y80WrZEfafvww",root_weight_black:"KBeGPPK4DinQzAP41Y_N"}},3594:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root:"_MWOVuZRvUQdXKTMcOPx",root_clamp:"LezmJlldtbHWqU7l1950",root_clamp_oneline:"oyQL2RSmoNbNQf3Vc6YI",root_clamp_multiline:"jMyoZB5J9iZbzJmWOrF0"}},6161:(e,t,i)=>{/** ++(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4720,9889,2121,3799,1521,1593,9880,8910,2499,105,5001,4870,2286,1871,9264],{35582:function(e,t,i){"use strict";i.r(t);var a,o,r,n,l,s,d,u,c,C,h,m,p,v,E,f,_,y,A,P,L,x,b,g,N,V,S,T,w,R,M,H,k,j,B,Z,I,O,q,D,U,z,F,W,Y,G,K,J,$,X,Q,ee,et,ei,ea,eo,er,en,el,es,ed,eu,ec,eC,eh,em,ep,ev,eE,ef,e_,ey,eA,eP,eL,ex,eb,eg,eN,eV,eS,eT,ew,eR,eM,eH,ek,ej,eB,eZ,eI,eO,eq,eD,eU=i(99616);function ez(){return(ez=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let e=(0,n.useRouter)(),t=(0,c.uK)(),i=t.get(c.xi),o=(0,l.useCallback)(()=>{i.authorizationUrl&&e.push(i.authorizationUrl)},[i.authorizationUrl,e]);return(0,a.jsxs)("div",{className:h().root,children:[(0,a.jsx)(u.Heading,{className:(0,r.W)(h().title,h().important),variant:"h3",size:"xs",children:(0,a.jsx)(s.Z,{id:"authorization.enter-title"})}),(0,a.jsx)(u.Caption,{className:(0,r.W)(h().text,h().important),variant:"span",type:"text",size:"l",weight:"normal",children:(0,a.jsx)(s.Z,{id:"authorization.enter-text"})}),(0,a.jsx)(d.z,{onClick:o,className:h().button,role:"link",color:"primary",size:"l",radius:"xxxl",children:(0,a.jsx)(u.Caption,{type:"controls",variant:"span",size:"m",children:(0,a.jsx)(s.Z,{id:"authorization.enter-button"})})})]})}),p=(0,o.Pi)(e=>{let{children:t}=e,{user:i}=(0,c.oR)();return i.isAuthorized?t:(0,a.jsx)(m,{})})},40466:function(e,t,i){"use strict";i.r(t),i.d(t,{WithBetaUser:function(){return A}});var a=i(8759),o=i(33423),r=i(35338),n=i(11769),l=i(99616),s=i(65244),d=i(2814),u=i(15527),c=i(13410),C=i(28036),h=i(1918),m=i(57921),p=i(39479),v=i(5674),E=i(44285),f=i(99800),_=i.n(f);let y=(0,o.Pi)(e=>{let{withoutExperiment:t=!1,showLoginButton:o=!1,showUserProfile:f=!1,withOffer:y=!1}=e,A=(0,n.useRouter)(),P=(0,v.uK)(),{settings:L}=(0,v.oR)(),{formatMessage:x}=(0,s.Z)(),b=P.get(v.xi),g=P.get(v.U5),N=(0,v.yy)(g.oldWebHost),V=(0,l.useMemo)(()=>L.layout===v.t8.Mobile?i(25811).Z.src:i(11737).Z.src,[L.layout]),S=(0,l.useCallback)(()=>{b.authorizationUrl&&A.push(b.authorizationUrl)},[b.authorizationUrl,A]);(0,v.NO)(!0);let T=(0,l.useMemo)(()=>y?(0,a.jsx)(h.Heading,{variant:"h1",size:"xl",weight:"bold",className:(0,r.W)(_().title,_().text),children:(0,a.jsx)(d.Z,{id:"welcome-page.offer-header"})}):t?(0,a.jsx)(h.Heading,{variant:"h1",size:"xxl",weight:"bold",className:(0,r.W)(_().title,_().text),children:(0,a.jsx)(d.Z,{id:"welcome-page.beta-header",values:{br:(0,a.jsx)("br",{})}})}):(0,a.jsx)(h.Heading,{variant:"h1",size:"xxl",weight:"bold",className:(0,r.W)(_().title,_().text),children:(0,a.jsx)(d.Z,{id:"welcome-page.not-auth-header",values:{br:(0,a.jsx)("br",{})}})}),[y,t]),w=(0,l.useMemo)(()=>t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Caption,{variant:"span",type:"text",size:"l",className:_().text,children:(0,a.jsx)(d.Z,{id:"welcome-page.beta-text-short"})}),(0,a.jsx)(C.y,{children:(0,a.jsx)(h.Heading,{variant:"h2",children:(0,a.jsx)(d.Z,{id:"welcome-page.beta-text-short"})})})]}):y?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Caption,{variant:"span",type:"text",size:"l",className:_().offerText,children:(0,a.jsx)(d.Z,{id:"welcome-page.offer-text"})}),(0,a.jsx)(C.y,{children:(0,a.jsx)(h.Heading,{variant:"h2",children:(0,a.jsx)(d.Z,{id:"welcome-page.offer-text"})})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Caption,{variant:"span",type:"text",size:"l",className:_().text,children:(0,a.jsx)(d.Z,{id:"welcome-page.not-auth-text",values:{br:(0,a.jsx)("br",{})}})}),(0,a.jsx)(C.y,{children:(0,a.jsx)(h.Heading,{variant:"h2",children:(0,a.jsx)(d.Z,{id:"welcome-page.not-auth-text",values:{br:(0,a.jsx)("br",{})}})})})]}),[y,t]),R=(0,l.useMemo)(()=>{if(o)return(0,a.jsx)(u.z,{onClick:S,className:_().loginButton,role:"link",color:"primary",size:"m",radius:"xxxl",children:(0,a.jsx)(d.Z,{id:"authorization.enter-button"})});if(y){let e="https://".concat(N,"/pay");return(0,a.jsx)(E.rU,{className:_().offerButtonLink,href:e,"aria-label":x({id:"payment.offer-button"}),target:"_blank",children:(0,a.jsx)(u.z,{className:(0,r.W)(_().offerButton,_().offerButton_important),role:"link",color:"plus",size:"l",radius:"m",withRipple:!1,children:(0,a.jsx)(d.Z,{id:"payment.offer-button"})})})}},[x,S,N,o,y]);return(0,v.ZP)(!0),(0,a.jsxs)("div",{className:(0,r.W)(_().root),children:[(0,a.jsx)(m.TF,{withSecondaryColor:!0}),(0,a.jsx)("div",{className:_().logoContainer,children:(0,a.jsx)(c.T,{alignIcon:"center",lang:"ru",className:_().logo})}),T,w,R,(0,a.jsx)("img",{className:_().image,src:V}),f&&(0,a.jsx)(p.Iw,{className:_().user,withMeta:L.layout!==v.t8.Mobile,variant:L.layout===v.t8.Mobile?"mobile":"desktop",usernameClassName:(0,r.W)(_().username,_().important)})]})}),A=(0,o.Pi)(e=>{let{children:t}=e,{user:i,experiments:o}=(0,v.oR)();return i.isAuthorized?o.checkExperiment(v.pe.WebNext,"on")&&!i.isChild?i.hasPlus||o.checkExperiment(v.pe.WebNextFreemium,"on")?t:(0,a.jsx)(y,{withOffer:!0,showUserProfile:!0}):(0,a.jsx)(y,{withoutExperiment:!0,showUserProfile:!0}):(0,a.jsx)(y,{showLoginButton:!0})})},12286:function(e,t,i){"use strict";i.r(t);var a=i(8759),o=i(35338),r=i(99616),n=i(92318),l=i(89788),s=i(5674),d=i(37500),u=i.n(d),c=i(21535);t.default=e=>{let{children:t}=e,{state:i,toggleTrue:d}=(0,n.O)(!1),{state:C,toggleTrue:h}=(0,n.O)(!1),m=(0,r.useMemo)(()=>{let e=new l.JC;return(0,s.NK)(e.get(s.BU.Theme),(0,s.Q$)())},[]),p=(0,r.useCallback)(e=>{let t=c.env.ASSET_PREFIX||"";return"".concat(t,"/video/splash_screen/splash_screen_").concat(m,".").concat(e)},[m]),v=(0,r.useMemo)(()=>({isVisible:!i}),[i]);return(0,a.jsxs)(s.IP.Provider,{value:v,children:[!i&&(0,a.jsx)("div",{className:(0,o.W)(u().root,u()["root_".concat(m)],{[u().root_hidden]:C}),onAnimationEnd:d,children:(0,a.jsxs)("video",{className:u().video,autoPlay:!0,muted:!0,playsInline:!0,onEnded:h,onError:d,children:[(0,a.jsx)("source",{src:p("webm"),type:"video/webm"}),(0,a.jsx)("source",{src:p("mp4"),type:"video/mp4"})]})}),t]})}},44495:function(e,t,i){"use strict";i.r(t),i.d(t,{DesktopInitializer:function(){return d}});var a=i(8759),o=i(35338),r=i(99616),n=i(48769),l=i(57921),s=i(5674);let d=()=>{let e=(0,s.Xf)(),{dictionary:t}=(0,s.ZS)();{let{theme:e}=(0,s.Fg)(),t=(0,s.sv)();(0,l.Tk)(),(0,l.Er)(),(0,l.bO)(),(0,l.vs)(),(0,l.Zw)(),(0,r.useEffect)(()=>{(0,l.Yl)(),(0,l.l7)()},[]),(0,r.useEffect)(()=>{let e=(0,s.bo)();e&&t.count(e,"appVersion")},[t]),(0,r.useEffect)(()=>{(0,l.F5)(e),t.count(e,"appTheme")},[e])}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Notification,{className:(0,o.W)({updateNotificationContainer:!0,updateNotificationContainer_application_windows:e===s.t4.WINDOWS,updateNotificationContainer_application_macos:e===s.t4.MACOS}),enableMultiContainer:!0,containerId:s.W$.APPLICATION_UPDATE,position:"top-center"}),(0,a.jsx)(l.Pj,{dictionary:t})]})}},49842:function(e,t,i){"use strict";i.r(t),i.d(t,{UrlInitializer:function(){return n}});var a=i(33423),o=i(11769),r=i(5674);let n=(0,a.Pi)(e=>{let{host:t}=e,{location:i}=(0,r.oR)(),a=(0,o.usePathname)(),n=(0,o.useSearchParams)().toString(),l=window.location.host,s=t||l,d="https://".concat(s),u="https://".concat(s).concat(a).concat(n?"?":"").concat(n);d=s,u="".concat(s).concat(a).concat(n?"?":"").concat(n),i.setPathname(a),i.setSearchParams(n),i.setHost(s),i.setTld((0,r.p$)(s)||"ru"),i.setOrigin(d),i.setHref(u)})},85816:function(e,t,i){"use strict";i.r(t),i.d(t,{WebInitializer:function(){return s}});var a=i(8759);i(99616);var o=i(5674),r=i(33423);let n=(0,r.Pi)(e=>{let{children:t,userIp:i}=e,{location:a}=(0,o.oR)();return t}),l=e=>{let{children:t}=e;return t},s=e=>{let{userIp:t}=e,i=(0,o.uK)(),r=i.get(o.V0);return r.get(o.BU.DisallowDeeplinksRedirect),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l,{}),(0,a.jsx)(n,{userIp:t})]})}},52207:function(e,t,i){"use strict";i.r(t),i.d(t,{NavigationEvents:function(){return n}});var a=i(11769),o=i(99616),r=i(5674);let n=()=>{let e=(0,r.sv)(),t=(0,a.usePathname)(),i=(0,a.useSearchParams)();return(0,o.useEffect)(()=>{let a="".concat(t).concat(i.size>0?"?".concat(i):"");e.hit(a)},[t,i,e]),null}},75576:function(e,t,i){"use strict";i.r(t),i.d(t,{AnalyticsProvider:function(){return s}});var a=i(8759),o=i(99616),r=i(82834),n=i(5674);let l=null,s=e=>{let{children:t}=e,i=(0,n.sv)(),s=(0,n.wL)(),d=(0,n.uK)(),u=d.get(n.V0),c=(0,o.useMemo)(()=>{if(l)return l;let e="on"===u.get(n.BU.AllowAnalyticsLogs),t=(0,r.HQ)(e=>i.count(e,"evgen"),s,e),a=(0,r.hz)(),o=(0,r.y_)();return l=new r.yx(t,a,o)},[u,s,i]);return(0,a.jsx)(n.fC.Provider,{value:c,children:(0,a.jsx)(n.tK,{children:t})})}},83622:function(e,t,i){"use strict";i.r(t),i.d(t,{HistoryProvider:function(){return s}});var a=i(8759),o=i(11769),r=i(99616),n=i(5674);let l=null,s=e=>{let{children:t}=e,i=(0,n.uK)(),s=(0,o.useRouter)(),d=(0,o.usePathname)(),u=(0,o.useSearchParams)(),[c,C]=(0,r.useState)(!1),[h,m]=(0,r.useState)(!1),[p,v]=(0,r.useState)(null),E=(0,r.useMemo)(()=>{if(l)return l;let e=i.get(n.Ar);return l=new n.QQ(e)},[i]),f=(0,r.useCallback)(()=>{E&&(C(E.canBack),m(E.canForward),v(E.state))},[E]),_=(0,r.useCallback)(e=>{E&&(E.replaceState(e),s.replace(e.href))},[E,s]),y=(0,r.useCallback)(e=>{E&&(E.pushState(e),f())},[E,f]),A=(0,r.useCallback)(()=>{E&&(E.back(),f(),s.back())},[E,s,f]),P=(0,r.useCallback)(()=>{E&&(E.forward(),f(),s.forward())},[E,s,f]);return(0,r.useEffect)(()=>{var e;let t=[d,u.toString()].join("?");(!(null==E?void 0:E.state)||(null==E?void 0:null===(e=E.state)||void 0===e?void 0:e.isLocationNotEqual(t)))&&y({href:t})},[E,d,u,y]),(0,a.jsx)(n.Tl.Provider,{value:{pushState:y,replaceState:_,canForward:h,canBack:c,back:A,forward:P,state:p},children:t})}},75707:function(e,t,i){"use strict";i.r(t),i.d(t,{LayoutProvider:function(){return d},setClientSideLayout:function(){return s}});var a=i(8759),o=i(57285),r=i(33423),n=i(99616),l=i(5674);let s=e=>{document.body.classList.remove("desktop"),e.setLayout((0,l.jP)(window.innerWidth))},d=(0,r.Pi)(e=>{let{children:t,userAgent:i}=e,{settings:r}=(0,l.oR)(),d=(0,l.Xf)(),[u,c]=(0,n.useState)(null);d&&r.setPlatform(d),r.layout;let C=(0,n.useMemo)(()=>(0,o.Z)(()=>{s(r)},100),[r]),h=(0,n.useCallback)(e=>{c(e)},[]);(0,n.useLayoutEffect)(()=>{s(r)},[r]),(0,n.useEffect)(()=>(window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}),[C]);let m=(0,n.useMemo)(()=>({contentRef:u,setContentRef:h}),[u,h]);return(0,a.jsx)(l.VY.Provider,{value:m,children:t})})},29371:function(e,t,i){"use strict";i.r(t),i.d(t,{PrefetchDataProvider:function(){return s}});var a=i(33423),o=i(99616),r=i(5674),n=i(75707);let l=async(e,t,i)=>{let{user:a,library:o,experiments:n,pinsCollection:l}=e;if(t?await a.getAbout():a.setUnauthorized(),a.puid&&i.setPassportUid(a.puid),await n.getData(),a.isAuthorized){let e=[a.getSettings(),o.getData()];n.checkExperiment(r.pe.WebPins,"on")&&e.push(l.getData()),await Promise.all(e)}},s=(0,a.Pi)(e=>{let{children:t}=e,i=(0,r.oR)(),a=(0,r.uK)(),s=a.get(r.xi),d=a.get(r.Hz),u=s.hasAuthorizationCredentials;return(0,n.setClientSideLayout)(i.settings),i.user.account.loadingState===r.Gu.IDLE&&(0,o.use)(l(i,u,d)),t})},85709:function(e,t,i){"use strict";i.r(t),i.d(t,{ShortcutsProvider:function(){return d}});var a=i(8759),o=i(33423),r=i(99616),n=i(98125),l=i(5674);let s=null,d=(0,o.Pi)(e=>{let{children:t}=e,i=(0,l.R$)(),o=(0,l.uK)(),d=o.get(l.V0),u=(0,n.K)(),{sonataState:c}=(0,l.oR)(),C=(0,r.useMemo)(()=>(s||(s=new l.OI(new l.yr)),s),[]);return(0,r.useEffect)(()=>(null==C||C.addShortcutsListener(l.yx.DECREASE_VOLUME,async()=>{let e=await (null==i?void 0:i.decreaseVolume(.05));d.set(l.BU.YmPlayerVolume,e)}),null==C||C.addShortcutsListener(l.yx.INCREASE_VOLUME,async()=>{let e=await (null==i?void 0:i.increaseVolume(.05));d.set(l.BU.YmPlayerVolume,e)}),null==C||C.addShortcutsListener(l.yx.TOGGLE_MUTE,async()=>{let e=null==i?void 0:i.state.playerState.volume.value;void 0!==e&&await u(e)}),()=>{null==C||C.removeShortcutsListener(l.yx.DECREASE_VOLUME),null==C||C.removeShortcutsListener(l.yx.INCREASE_VOLUME),null==C||C.removeShortcutsListener(l.yx.TOGGLE_MUTE)}),[C,i,d,u]),(0,r.useEffect)(()=>{if(!c.isGenerativeContext)return null==C||C.addShortcutsListener(l.yx.MOVE_BACKWARD,async()=>{var e;(null==i?void 0:null===(e=i.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveBackward.value)&&await i.moveBackward()}),null==C||C.addShortcutsListener(l.yx.MOVE_FORWARD,async()=>{var e;(null==i?void 0:null===(e=i.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveForward.value)&&await (null==i?void 0:i.moveForward())}),null==C||C.addShortcutsListener(l.yx.SLIDE_BACKWARD,async()=>{let e=null==i?void 0:i.state.playerState.progress.value.duration;e&&await (null==i?void 0:i.slideBackward(2))}),null==C||C.addShortcutsListener(l.yx.SLIDE_FORWARD,async()=>{let e=null==i?void 0:i.state.playerState.progress.value.duration;e&&await (null==i?void 0:i.slideForward(2))}),()=>{null==C||C.removeShortcutsListener(l.yx.MOVE_FORWARD),null==C||C.removeShortcutsListener(l.yx.MOVE_BACKWARD),null==C||C.removeShortcutsListener(l.yx.SLIDE_BACKWARD),null==C||C.removeShortcutsListener(l.yx.SLIDE_FORWARD)}},[C,i,d,c.isGenerativeContext]),(0,a.jsx)(l.cw.Provider,{value:C,children:t})})},48085:function(e,t,i){"use strict";i.r(t),i.d(t,{SonataProvider:function(){return eu}});var a,o,r,n,l=i(8759),s=i(33423),d=i(99616),u=i(8124);class c extends Error{constructor(e){super(e),this.name="AudioError"}}let C={BAD_STATE:"action is not permited from current state"},h={EVENT_PLAY:"play",EVENT_STOP:"stop",EVENT_PAUSE:"pause",EVENT_RESUME:"resume",EVENT_PROGRESS:"progress",EVENT_SEEKED:"seeked",EVENT_VOLUMECHANGE:"volumechange",EVENT_RATECHANGE:"ratechange",EVENT_LOADING:"loading",EVENT_LOADED:"loaded",EVENT_ENDED:"ended",EVENT_CRASHED:"crashed",EVENT_ERROR:"error",EVENT_STALLED:"stalled",EVENT_CANPLAY:"canplay",EVENT_PLAYING:"playing",HLS_EVENT_ERROR:"hlserror",EVENT_DESTROY:"destroy",EVENT_STATE:"state",EVENT_SWAP:"swap",STATE_INIT:"init",STATE_CRASHED:"crashed",STATE_IDLE:"idle",STATE_PLAYING:"playing",STATE_PAUSED:"paused"};var m=i(23681);let p={updateInterval:30,EMPTY_SOUND:"data:audio/mp3;base64,//uQZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAADAAAC2QBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr///////////////////////////////////////////8AAAA8TEFNRTMuOThyBK8AAAAAAAAAADQgJAimTQABzAAAAtmIVtmVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//sQZAAO4AAAf4AAAAgAAA/wAAABAoQDLmAAACBYgGYMAAAE+oH///////0WKFRVzjKnAmjp+XX9qP//////p0USaKtMwpjZNhNFyEM61QAAOAP////////nfSpMQU1FMy45OC4yqqr/+xBEDI/wAAB/gAAACAxgGaMAAAEAAAH+AAAAIAAAP8AAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqv/7EGQoD/AAAGkAAAAIAAANIAAAAQAAAaQAAAAgAAA0gAAABKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",EVENT_NATIVE_PLAY:"play",EVENT_NATIVE_PAUSE:"pause",EVENT_NATIVE_TIMEUPDATE:"timeupdate",EVENT_NATIVE_ENDED:"ended",EVENT_NATIVE_DURATION:"durationchange",EVENT_NATIVE_LOADING:"progress",EVENT_NATIVE_META:"loadedmetadata",EVENT_NATIVE_CANPLAY:"canplay",EVENT_NATIVE_PLAYING:"playing",EVENT_NATIVE_ERROR:"error",EVENT_NATIVE_STALLED:"stalled",EVENT_VOLUMECHANGE:"volumechange",EVENT_RATECHANGE:"ratechange",EVENT_SEEKED:"seeked",promiseLoadedEvents:["progress"],promisePlayingEvents:["timeupdate"],promiseMetadataEvents:["loadedmetadata","canplay"],loaderInteruptReasons:["load","stop","startPlay","play","destroy"]};class v{isOnlyDeviceVolume(){let e=!0;try{let t=document.createElement("audio");t.volume=.63,e=Math.abs(t.volume-.63)>.01}catch(t){e=!0}return e}parseParams(e){let t=e.split("?")[1];return t&&t.length?t.split("&").reduce(function(e,t){let i=t.split("="),a=i[0],o=i[1];return a&&o&&(e[a]=o),e},{}):{}}updateUrl(e,t){let i=this.parseParams(e),a="";for(let e in Object.assign(i,t),i)Object.prototype.hasOwnProperty.call(i,e)&&(a+=`${e}=${i[e]}`);return e+(a?`?${a}`:"")}getCookie(e){let t=document.cookie.split(";").reduce((e,t)=>{let[i,a]=t.trim().split("=");return i&&a?{...e,[i]:a}:e},{})[e];return t||""}}let E=1,f=()=>{let e=document.createElement("audio");return e.autoplay=!1,e.loop=!1,e.preload="auto",e.crossOrigin="anonymous",e};class _{audio=f();browser=new v;emitter;src="";position=0;lastGoodTime=0;lastUpdate=0;notLoading=!0;shouldUseHlsPlayer;shouldPause=!1;shouldPlay=!1;playing=!1;ended=!1;promiseMode=!1;isHlsTrack=!1;promises={};audioContext=null;loaderTimer=null;promiseCheckTO=null;retry=0;playerInitializationTime;clearInitListener=null;clearNativePauseListener=null;hls=null;isAutoplayable=!1;name=E++;whenReady;constructor(e,t){this.shouldUseHlsPlayer=e,this.playerInitializationTime=Date.now(),this.emitter=t,this.startupAudio=this.startupAudio.bind(this),this.updateProgress=this.updateProgress.bind(this),this.onNativeLoading=this.onNativeLoading.bind(this),this.onNativeEnded=this.onNativeEnded.bind(this),this.onNativeError=this.onNativeError.bind(this),this.onNativePause=this.onNativePause.bind(this),this.onNativePlay=this.onNativePlay.bind(this),this.onNativeSeeked=this.onNativeSeeked.bind(this),this.onNativeStalled=this.onNativeStalled.bind(this),this.onNativeCanplay=this.onNativeCanplay.bind(this),this.onNativePlaying=this.onNativePlaying.bind(this),this.onNativeVolumeChange=this.onNativeVolumeChange.bind(this),this.onNativeRatechange=this.onNativeRatechange.bind(this),this.whenReady=this.init()}updateProgress(){let e=Number(new Date);if(e-this.lastUpdate=this.audio.duration-.1&&this.emitter.emit(h.EVENT_LOADED)}}onNativeEnded(){this.ended=!0,this.playing=!1,this.shouldPause=!0,this.emitter.emit(h.EVENT_ENDED)}onNativeError(){this.src&&this.src!==p.EMPTY_SOUND&&(this.audio&&this.audio.error&&this.emitter.emit(h.EVENT_ERROR,this.audio.error),this.playing=!1)}onNativePause(){this.emitter.emit(h.EVENT_PAUSE),this.shouldPause=!1}onNativePlay(){this.emitter.emit(h.EVENT_PLAY),this.shouldPlay=!1}onNativeSeeked(){this.emitter.emit(h.EVENT_SEEKED)}onNativeStalled(){this.emitter.emit(h.EVENT_STALLED)}onNativeCanplay(){this.emitter.emit(h.EVENT_CANPLAY)}onNativePlaying(){this.playing&&this.emitter.emit(h.EVENT_PLAYING)}onNativeVolumeChange(){this.emitter.emit(h.EVENT_VOLUMECHANGE,this.volumeLevel)}onNativeRatechange(){this.emitter.emit(h.EVENT_RATECHANGE,this.playbackRate)}initUserEvents(){document.body.addEventListener("mousedown",this.startupAudio,!0),document.body.addEventListener("keydown",this.startupAudio,!0),document.body.addEventListener("touchstart",this.startupAudio,!0)}deinitUserEvents(){document.body.removeEventListener("mousedown",this.startupAudio,!0),document.body.removeEventListener("keydown",this.startupAudio,!0),document.body.removeEventListener("touchstart",this.startupAudio,!0)}initNativeEvents(){this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,this.onNativePause),this.audio.addEventListener(p.EVENT_NATIVE_PLAY,this.onNativePlay),this.audio.addEventListener(p.EVENT_NATIVE_ENDED,this.onNativeEnded),this.audio.addEventListener(p.EVENT_NATIVE_TIMEUPDATE,this.updateProgress),this.audio.addEventListener(p.EVENT_NATIVE_DURATION,this.updateProgress),this.audio.addEventListener(p.EVENT_NATIVE_LOADING,this.onNativeLoading),this.audio.addEventListener(p.EVENT_NATIVE_ERROR,this.onNativeError),this.audio.addEventListener(p.EVENT_SEEKED,this.onNativeSeeked),this.audio.addEventListener(p.EVENT_NATIVE_STALLED,this.onNativeStalled),this.audio.addEventListener(p.EVENT_NATIVE_CANPLAY,this.onNativeCanplay),this.audio.addEventListener(p.EVENT_NATIVE_PLAYING,this.onNativePlaying),this.audio.addEventListener(p.EVENT_VOLUMECHANGE,this.onNativeVolumeChange),this.audio.addEventListener(p.EVENT_RATECHANGE,this.onNativeRatechange))}deinitNativeEvents(){this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PAUSE,this.onNativePause),this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,this.onNativePlay),this.audio.removeEventListener(p.EVENT_NATIVE_ENDED,this.onNativeEnded),this.audio.removeEventListener(p.EVENT_NATIVE_TIMEUPDATE,this.updateProgress),this.audio.removeEventListener(p.EVENT_NATIVE_DURATION,this.updateProgress),this.audio.removeEventListener(p.EVENT_NATIVE_LOADING,this.onNativeLoading),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,this.onNativeError),this.audio.removeEventListener(p.EVENT_SEEKED,this.onNativeSeeked),this.audio.removeEventListener(p.EVENT_NATIVE_STALLED,this.onNativeStalled),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,this.onNativeCanplay),this.audio.removeEventListener(p.EVENT_NATIVE_PLAYING,this.onNativePlaying),this.audio.removeEventListener(p.EVENT_VOLUMECHANGE,this.onNativeVolumeChange),this.audio.removeEventListener(p.EVENT_RATECHANGE,this.onNativeRatechange))}init(){return this.initEvents().then(()=>{this.shouldUseHlsPlayer&&this.initHls()})}initEvents(){return new Promise(e=>{this.initUserEvents(),this.initNativeEvents(),e()})}startupAudio(){this.audioContext&&this.audioContext.resume(),this.deinitUserEvents();let e=()=>{this.shouldPlay=!1,this.isAutoplayable=!0},t=e=>{this.shouldPlay=!1,console.info(`_startupAudio:failReason:${e||""}`)},i=()=>{if(this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_META,i),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,i)),this.promiseMode)return;let t=()=>{this.audio&&this.audio.removeEventListener(p.EVENT_NATIVE_PAUSE,t),e()};this.clearNativePauseListener=()=>{this.audio&&this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,t)},this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,t),this.audio.pause(),this.shouldPause=!0)};this.clearInitListener=()=>{this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_META,i),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,i))},this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PLAY,i),this.audio.addEventListener(p.EVENT_NATIVE_CANPLAY,i),this.audio.addEventListener(p.EVENT_NATIVE_META,i),this.audio.addEventListener(p.EVENT_NATIVE_ERROR,i),this.audio.load(),this.shouldPlay=!0,this.promiseMode=!0,this.audio.play().then(()=>{e(),this.shouldPause=!0,this.shouldPlay=!1,this.audio&&this.audio.pause()}).catch(()=>{this.shouldPause=!0,this.shouldPlay=!1,t("audio.play")}))}initAndCheckAutoplay(){return new Promise(e=>{let t=()=>{this.shouldPlay=!1,this.isAutoplayable=!0,e()},i=t=>{this.shouldPlay=!1,this.isAutoplayable=!1,console.info(this,`initAndCheckAutoplay:failReason:${t||""}`),e()},a=e=>{if(this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,a),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,a),this.audio.removeEventListener(p.EVENT_NATIVE_META,a),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,a)),this.promiseMode)return;if(e.type===p.EVENT_NATIVE_ERROR||e.type===p.EVENT_NATIVE_META){i(e.type);return}let o=e=>{if(e.type===p.EVENT_NATIVE_ERROR){i(e.type);return}this.audio&&this.audio.removeEventListener(p.EVENT_NATIVE_PAUSE,o),t()};this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,o),this.audio.pause()),this.shouldPause=!0};this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PLAY,a),this.audio.addEventListener(p.EVENT_NATIVE_CANPLAY,a),this.audio.addEventListener(p.EVENT_NATIVE_META,a),this.audio.addEventListener(p.EVENT_NATIVE_ERROR,a),this.audio.src=p.EMPTY_SOUND,this.audio.load(),this.shouldPlay=!0,this.promiseMode=!0,this.audio.play().then(()=>{t(),this.shouldPause=!0,this.shouldPlay=!1,this.audio&&this.audio.pause()}).catch(()=>{this.shouldPause=!0,this.shouldPlay=!1,i("audio.play")}))})}breakStartup(e){this.deinitUserEvents(),this.clearInitListener&&this.clearInitListener(),this.clearNativePauseListener&&this.clearNativePauseListener(),console.warn("_startupAudio:interrupted",e)}waitFor(e,t,i){let a;let o=this.promises[e];if(o)a=o.promise();else{let o=()=>{},r=[new Promise((e,t)=>{o=t})],n={},l=e=>new Promise(i=>{let a=()=>{t()&&i()};this.audio&&(this.audio.addEventListener(e,a),n[e]=a)}),s=()=>{for(let e of Object.keys(n))if(this.audio){let t=n[e];t&&this.audio.removeEventListener(e,t)}};for(let e of i)r.push(l(e));let d=Promise.race(r);d.then(s).catch(s),this.promises[e]={promise:()=>d,reject:o},a=d}return a}cancelWait(e,t){let i;(i=this.promises[e])&&(delete this.promises[e],i.reject(t))}abortPromises(e){for(let t in this.promises)Object.prototype.hasOwnProperty.call(this.promises,t)&&this.cancelWait(t,e)}promiseMetadataCheck(){return!!this.audio&&this.audio.readyState>this.audio.HAVE_METADATA}promiseMetadata(){return this.waitFor("metadata",()=>this.promiseMetadataCheck(),p.promiseMetadataEvents)}promiseLoadedCheck(){if(this.loaderTimer?clearTimeout(this.loaderTimer):this.loaderTimer=setTimeout(()=>{this.cancelWait("loaded","timeout")},5e3),this.audio){let e=Math.min(this.position+45,this.audio.duration),t=this.audio.buffered.end(0)-this.audio.buffered.start(0);return 0!==this.audio.buffered.length&&t>=e}return!1}promiseLoaded(){let e=this.waitFor("loaded",()=>this.promiseLoadedCheck(),p.promiseLoadedEvents),t=()=>{this.loaderTimer&&clearTimeout(this.loaderTimer)};return e.then(t).catch(t),e}promisePlayingCheck(){if(this.audio){let e=Math.min(this.position+.2,this.audio.duration);return this.promiseCheckTO&&clearTimeout(this.promiseCheckTO),0!==this.audio.currentTime||this.audio.paused||(this.promiseCheckTO=setTimeout(()=>{this.audio&&0===this.audio.currentTime&&!this.audio.paused&&(this.audio.currentTime=1)},1e3)),this.audio.currentTime>=e}return!1}promisePlaying(){return this.waitFor("playing",()=>this.promisePlayingCheck(),p.promisePlayingEvents)}promiseStartPlaying(){let e,t=!1;if(this.promises.startPlaying)e=this.promises.startPlaying.promise();else{let i,a=()=>{},o=new Promise((e,o)=>{this.promisePlaying().then(()=>{t=!0,clearTimeout(i),e()}).catch(e=>{t=!0,clearTimeout(i),this.cancelWait("startPlaying",e)}),this.promiseLoaded().then(()=>{t||(i=setTimeout(()=>{o("timeout"),this.cancelWait("playing","timeout"),console.warn("startPlaying:failed")},5e3))}).catch(e=>{t=!0,clearTimeout(i),this.cancelWait("startPlaying",e)}),a=o});this.promises.startPlaying={promise:()=>o,reject:a},e=this.promises.startPlaying.promise()}return e}load(e){this.abortPromises("load"),this.breakStartup("load"),this.ended=!1,this.playing=!1,this.notLoading=!0,this.position=0,this.lastGoodTime=0,this.src=e,this.audio&&(/\.m3u8$/.test(e)?(this.isHlsTrack=!0,this.destroyHls(),this.initHls(),this.hls?.loadSource(this.getHlsPlayingEntityUrl(e))):(this.isHlsTrack=!1,this.audio.src=e),this.audio.load())}stop(){this.abortPromises("stop"),this.breakStartup("stop"),this.isHlsTrack&&this.destroyHls(),this.load("")}startPlay(){this.audio&&(this.audio.currentTime=this.position),this.playing&&(this.breakStartup("startPlay"),this.shouldPlay=!0,this.audio&&this.audio.play().catch(e=>{console.error(e)}),this.hls&&this.hls.startLoad(),this.promiseStartPlaying().then(()=>{this.retry=0}))}play(e){this.retry=0,this.loadMetadata(e)}loadMetadata(e){this.playing||(this.breakStartup("play"),this.ended=!1,this.playing=!0,null!=e&&(this.position=e),this.promiseMetadata().then(()=>this.startPlay()).catch(e=>{"string"==typeof e&&p.loaderInteruptReasons.includes(e)||console.error(e)}))}initHls(){this.hls||(this.hls=new m.ZP({liveDurationInfinity:!0,maxBufferSize:3e6}),this.audio&&this.hls.attachMedia(this.audio),this.initHlsEvents())}initHlsEvents(){this.hls&&(this.hls.on(m.ZP.Events.ERROR,(e,t)=>{if(t.fatal&&this.hls)switch(t.type){case m.ZP.ErrorTypes.NETWORK_ERROR:this.retry++,this.retry>2?(this.destroyHls(),this.playing=!1,this.emitter.emit(h.EVENT_ERROR,t)):this.hls.startLoad();break;case m.ZP.ErrorTypes.MEDIA_ERROR:this.hls.recoverMediaError();break;default:this.destroyHls(),this.playing=!1,this.emitter.emit(h.EVENT_ERROR,t)}}),this.hls.on(m.ZP.Events.DESTROYING,()=>{this.hls=null}))}getHlsPlayingEntityUrl(e){let t="";for(;t.length<44;)t+=(Math.random()+1).toString(36).substring(3);t=t.slice(0,44);let i=this.playerInitializationTime.toString().slice(0,10),a=`${t}xWEBx0001x${i}`;return this.browser.updateUrl(e,{vsid:a})}destroyHls(){this.retry=0,this.hls&&(this.hls.stopLoad(),this.hls.destroy(),this.hls=null)}pause(){this.shouldPause=!0,this.playing=!1,this.isHlsTrack&&this.hls&&this.hls.stopLoad(),this.audio&&(this.audio.pause(),this.position=this.audio.currentTime)}setPosition(e){if(!isFinite(e)){console.warn("setPositionFailed",e);return}this.position=e,this.promiseMetadata().then(()=>{this.audio&&(this.audio.currentTime=this.position)})}destroy(){this.audio&&(this.shouldPause=!0,this.audio.pause(),this.deinitNativeEvents()),this.abortPromises("destroy"),this.deinitUserEvents(),this.promises={}}get currentTime(){return this.audio?this.audio.currentTime:null}get duration(){return this.audio?this.audio.duration:null}get loaded(){let e;if(this.audio&&this.audio.buffered.length){let t=this.audio.buffered.length-1;e=this.audio.buffered.end(t)}else e=null;return e}get volumeLevel(){return this.audio?this.audio.volume:0}set volumeLevel(e){this.audio&&(this.audio.volume=e)}set defaultPlaybackRate(e){this.audio&&(this.audio.defaultPlaybackRate=e)}get playbackRate(){return this.audio?this.audio.playbackRate:1}set playbackRate(e){this.audio&&(this.audio.playbackRate=e)}get audioSrc(){return this.src}get audioNotLoading(){return this.notLoading}get autoplayable(){return this.isAutoplayable}}let y=1;class A{browser=new v;emitter;loader;name=y++;type="html5";whenReady;constructor(e,t){this.emitter=t,this.loader=new _(e,t),this.whenReady=this.loader.whenReady}get source(){return this.loader.audio}play(e,t){this.loader.load(e),this.loader.play(t)}setSrc(e,t){this.loader.load(e),this.loader.setPosition(t)}pause(){this.loader.pause()}resume(){this.loader.play()}stop(){this.loader.stop(),this.emitter.emit(h.EVENT_STOP)}destroy(){this.loader.destroy(),this.emitter.emit(h.EVENT_DESTROY)}getPosition(){return this.loader.currentTime}setPosition(e){this.loader.setPosition(e-.001)}getDuration(){return this.loader.duration}getLoaded(){return this.loader.loaded?this.loader.loaded:0}get volumeLevel(){return this.loader.volumeLevel}set volumeLevel(e){this.loader.volumeLevel=Math.min(1,e)}get speedLevel(){return this.loader.playbackRate}set speedLevel(e){this.loader.defaultPlaybackRate=e,this.loader.playbackRate=e}getSrc(){return""!==this.loader.audioSrc?this.loader.audioSrc:null}isDeviceVolume(){return this.browser.isOnlyDeviceVolume()}isAutoplayable(){return this.loader.autoplayable}}let P=1;class L{emitter=new u.v;played=0;lastSkip=0;playId=null;shouldUseHlsPlayer;implementation;promises={};name=P++;state=h.STATE_INIT;constructor(e=!1){this.shouldUseHlsPlayer=e,window.addEventListener("beforeunload",()=>this.onBeforeUnload(),!0),this.implementation=new A(this.shouldUseHlsPlayer,this.emitter),this.onAudioPlayerInit()}get source(){return this.implementation?.source}on(e,t){this.emitter.on(e,t)}off(e,t){this.emitter.off(e,t)}onAudioPlayerInit(){this.handleImplementationEvents(),this.setState(h.STATE_IDLE)}handleImplementationEvents(){this.emitter.on(h.EVENT_PLAY,()=>{this.implementationEventHandler(h.EVENT_PLAY)}),this.emitter.on(h.EVENT_ENDED,()=>{this.implementationEventHandler(h.EVENT_ENDED)}),this.emitter.on(h.EVENT_SWAP,()=>{this.implementationEventHandler(h.EVENT_SWAP)}),this.emitter.on(h.EVENT_STOP,()=>{this.implementationEventHandler(h.EVENT_STOP)}),this.emitter.on(h.EVENT_ERROR,()=>{this.implementationEventHandler(h.EVENT_ERROR)}),this.emitter.on(h.HLS_EVENT_ERROR,()=>{this.implementationEventHandler(h.HLS_EVENT_ERROR)}),this.emitter.on(h.EVENT_PAUSE,()=>{this.implementationEventHandler(h.EVENT_PAUSE)}),this.emitter.on(h.EVENT_CRASHED,()=>{this.implementationEventHandler(h.EVENT_CRASHED)})}implementationEventHandler(e){switch(e){case h.EVENT_PLAY:this.setState(h.STATE_PLAYING);break;case h.EVENT_ENDED:case h.EVENT_SWAP:case h.EVENT_STOP:case h.EVENT_ERROR:case h.HLS_EVENT_ERROR:this.setState(h.STATE_IDLE);break;case h.EVENT_PAUSE:this.setState(h.STATE_PAUSED);break;case h.EVENT_CRASHED:this.setState(h.STATE_CRASHED)}}onBeforeUnload(){"undefined"!=typeof window&&navigator&&1===navigator.maxTouchPoints||this.destroy()}setState(e){if(e===h.STATE_PAUSED&&this.state!==h.STATE_PLAYING)return;let t=this.state!==e;this.state=e,t&&this.emitter.emit(h.EVENT_STATE,e)}waitEvents(e,t,i){let a=()=>{},o=()=>{},r=new Promise((e,t)=>{a=e,o=t});this.promises[e]={promise:()=>r,reject:o};let n=()=>{for(let e of t)this.off(e,a);for(let e of i)this.off(e,o);delete this.promises[e]};for(let e of t)this.on(e,a);let l=e=>t=>{let i=t instanceof Error?t:new c(e);o(i)};for(let e of i)this.on(e,l(e));return r.then(n).catch(n),r}getState(){return this.state}getSrc(){return this.implementation?this.implementation.getSrc():null}play(e,t){this.played=0,this.lastSkip=0,this.generatePlayId(),this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_PLAY),this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_PLAY),this.promises.whenStop&&this.promises.whenStop.reject(h.EVENT_PLAY);let i=this.waitEvents("whenPlay",[h.EVENT_PLAY],[h.EVENT_STOP,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]);return this.implementation&&this.implementation.play(e,t),i}setSrc(e,t){this.implementation&&this.implementation.setSrc(e,t)}restart(){return this.getDuration()?(this.generatePlayId(),this.setPosition(0),this.played=0,this.lastSkip=0,this.resume()):Promise.reject(new c(C.BAD_STATE))}stop(){let e;return this.implementation&&(this.implementation.stop(),Promise.resolve()),this.played=0,this.lastSkip=0,this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_STOP),this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_STOP),e=this.promises.whenStop?this.promises.whenStop.promise():this.waitEvents("_whenStop",[h.EVENT_STOP],[h.EVENT_PLAY,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]),this.implementation&&this.implementation.stop(),e}pause(){let e;return this.state!==h.STATE_PLAYING?Promise.reject(new c(C.BAD_STATE)):(this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_PAUSE),e=this.promises.whenPause?this.promises.whenPause.promise():this.waitEvents("_whenPause",[h.EVENT_PAUSE],[h.EVENT_STOP,h.EVENT_PLAY,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]),this.implementation&&this.implementation.pause(),e)}resume(){let e;return this.state!==h.STATE_PLAYING||this.promises.whenPause?this.state===h.STATE_IDLE||this.state===h.STATE_PAUSED||this.state===h.STATE_PLAYING?(this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_RESUME),e=this.promises.whenPlay?this.promises.whenPlay.promise():this.waitEvents("_whenPlay",[h.EVENT_PLAY],[h.EVENT_STOP,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]),this.implementation&&this.implementation.resume(),e.then(()=>{this.emitter.emit(h.EVENT_RESUME)})):Promise.reject(new c(C.BAD_STATE)):Promise.resolve()}destroy(){this.played=0,this.lastSkip=0,this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_DESTROY),this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_DESTROY),this.implementation&&this.implementation.destroy()}getPosition(){let e=null;return this.implementation&&(e=this.implementation.getPosition()),e||0}setPosition(e){return this.implementation&&this.implementation.setPosition(e),this.played+=this.getPosition()-this.lastSkip,this.lastSkip=e,e}getDuration(){let e=null;return this.implementation&&(e=this.implementation.getDuration()),null===e?0:e}getLoaded(){return this.implementation?this.implementation.getLoaded():0}getPlayed(){let e=this.getPosition();return this.played+=e-this.lastSkip,this.lastSkip=e,this.played}getVolume(){return this.implementation?this.implementation.volumeLevel:0}setVolume(e){let t=0;return this.implementation&&(this.implementation.volumeLevel=e,t=e),t}getSpeed(){return this.implementation?this.implementation.speedLevel:0}setSpeed(e){let t=0;return this.implementation&&(this.implementation.speedLevel=e,t=e),t}isDeviceVolume(){return!this.implementation||this.implementation.isDeviceVolume()}isAutoplayable(){let e=null;return this.implementation&&(e=this.implementation.isAutoplayable()),null!==e&&e}generatePlayId(){this.playId=Math.random().toString().slice(2)}getPlayId(){return this.playId}}class x{pauseHandlers=[];core=new L;get source(){return this.core.source}play(e,t){return this.core.play(e,t)}setSrc(e,t){this.core.setSrc(e,t)}setProgress(e){let t=this.core.setPosition(e);return Promise.resolve(t)}pause(){return this.core.pause()}resume(){return this.core.resume()}setVolume(e){let t=this.core.setVolume(e);return Promise.resolve(t)}setSpeed(e){let t=this.core.setSpeed(e);return Promise.resolve(t)}stop(){return this.core.stop()}onAudioEnd(e){this.core.on(h.EVENT_ENDED,e)}onAudioPaused(e){let t=()=>{"paused"===this.core.getState()&&e()};this.pauseHandlers.push({handler:t,originalCallback:e}),this.core.on(h.EVENT_STATE,t)}onAudioResume(e){this.core.on(h.EVENT_RESUME,e)}onAudioUpdatingProgress(e){this.core.on(h.EVENT_PROGRESS,e)}onAudioSeeked(e){this.core.on(h.EVENT_SEEKED,e)}onAudioStalled(e){this.core.on(h.EVENT_STALLED,e)}onAudioCanplay(e){this.core.on(h.EVENT_CANPLAY,e)}onAudioPlaying(e){this.core.on(h.EVENT_PLAYING,e)}onAudioError(e){this.core.on(h.EVENT_ERROR,e)}onAudioVolumeChange(e){this.core.on(h.EVENT_VOLUMECHANGE,e)}onAudioSpeedChange(e){this.core.on(h.EVENT_RATECHANGE,e)}offAudioEnd(e){this.core.off(h.EVENT_ENDED,e)}offAudioPaused(e){let t=this.pauseHandlers.find(t=>t.originalCallback===e);t&&this.core.off(h.EVENT_STATE,t.handler)}offAudioResume(e){this.core.off(h.EVENT_RESUME,e)}offAudioUpdatingProgress(e){this.core.off(h.EVENT_PROGRESS,e)}offAudioSeeked(e){this.core.off(h.EVENT_SEEKED,e)}offAudioStalled(e){this.core.off(h.EVENT_STALLED,e)}offAudioCanplay(e){this.core.off(h.EVENT_CANPLAY,e)}offAudioPlaying(e){this.core.off(h.EVENT_PLAYING,e)}offAudioError(e){this.core.off(h.EVENT_ERROR,e)}offAudioVolumeChange(e){this.core.off(h.EVENT_VOLUMECHANGE,e)}offAudioSpeedChange(e){this.core.off(h.EVENT_RATECHANGE,e)}}var b=i(57413),g=i(14408),N=i(68244);class V{apply(e){let{hooks:t,playback:i}=e;t.afterContextSet.tap("ApplyContextPlugin",()=>{let e=i.state.currentContext.value;e&&e instanceof N.$n&&e.apply({hooks:t,playback:i})})}}let S=null;function T(e){let t=e.state.queueState.index.value,i=e.state.currentContext.value,a=void 0!==e.state.queueState.order.value[t-1];i&&(i.availableActions.moveBackward.value=a),null!==S&&(S(),S=null),0===t&&(S=e.state.playerState.progress.onChange(e=>{i&&(i.availableActions.moveBackward.value=!!e&&e.position>N.lz)}))}var w=i(34603);function R(e){let{value:t}=e.state.currentContext,{value:i}=e.state.queueState.currentEntity,a=void 0!==t;if(a&&void 0!==i){let{meta:a}=i.entity.data,o=(0,b.xA)(t)||(0,b.Q7)(t)||"type"in a&&a.type&&w.UE.includes(a.type);o?(t.availableActions.repeat.value=!1,t.availableActions.shuffle.value=!1,e.state.queueState.repeat.value!==N.zq.NONE&&e.setRepeatMode(N.zq.NONE),e.state.queueState.shuffle.value&&e.toggleShuffle()):(t.availableActions.repeat.value=!0,t.availableActions.shuffle.value=!0)}}let M=e=>{let t="albums"in e&&e.albums&&e.albums.length>0&&e.albums[0]&&e.albums[0].type===w.VZ.PODCAST,i="type"in e&&e.type===w.Vc.PODCAST;return!!(i||t)};function H(e){let{value:t}=e.state.currentContext,{value:i}=e.state.queueState.currentEntity,a=void 0!==t;if(a&&void 0!==i){let{meta:e}=i.entity.data,a=M(e);t.availableActions.speed.value=!!a}}class k{apply(e){let{hooks:t,playback:i}=e;t.afterContextSet.tap("AvailableActionsPlugin",()=>{R(i),H(i)}),t.beforeMediaStartPlaying.tap("AvailableActionsPlugin",()=>{R(i),H(i)}),i.state.queueState.entityList.onChange(()=>{T(i)}),i.state.queueState.index.onChange(()=>{T(i)})}}class j{apply(e){let{playback:t,hooks:i}=e;t.state.playerState.event.onChange(()=>{let{currentEntity:e}=t.state.queueState;if(e.value)switch(t.state.playerState.event.value){case N.KX.PAUSED:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:`event-${N.KX.PAUSED}`});break;case N.KX.STALLED:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:`event-${N.KX.STALLED}`});break;case N.KX.PLAYING:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.PLAYING,reason:`event-${N.KX.PLAYING}`});break;case N.KX.MEDIA_ELEMENT_ERROR:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:`event-${N.KX.MEDIA_ELEMENT_ERROR}`})}}),i.beforeEntityPlayingProcessStart.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.clearTimeStagesOfPlayback(),Promise.resolve()}),i.afterMediaStartPlaying.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.PLAYING,reason:"hook-afterMediaStartPlaying"}),Promise.resolve()}),i.afterMediaEndPlaying.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:"hook-afterMediaEndPlaying"}),Promise.resolve()}),i.beforeEntityChange.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:"hook-beforeEntityChange"}),Promise.resolve()}),i.beforeContextSet.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:"hook-beforeContextSet"}),Promise.resolve()})}}var B=i(42503),Z=i(59899);function I(){let e=new Date;return e.toISOString()}function O(e){let t;let{contextEntityPair:i,totalPlayedSeconds:a,endPositionSeconds:o,type:r,maxPlayerStage:n}=e,{entity:l,context:s}=i,d=String(l.data.meta.id),u=function(e){let t;if("albums"in e.data.meta){let{data:{meta:{albums:i}}}=e;if(i){let e=i[0];e&&(t=String(e.id))}}return t}(l),c=0;"durationMs"in l.data.meta&&l.data.meta.durationMs&&(c=l.data.meta.durationMs/1e3);let C=a,h=o;.5>Math.abs(c-a)&&(C=c),.5>Math.abs(c-o)&&(h=c),t=(0,b.Q7)(s)?{generativeStreamId:String(s.data.meta.stream?.id)}:{trackId:d};let m={playId:l.playId,timestamp:I(),totalPlayedSeconds:C,endPositionSeconds:h,trackLengthSeconds:c,albumId:u,from:s.from,context:s.data.type,contextItem:String(s.data.meta.id),addTracksToPlayerTime:l.addTracksToPlayerTime,audioAuto:"none",audioOutputName:"Динамик",audioOutputType:"Speaker",maxPlayerStage:n,...t};if((0,b.xA)(s)&&s.data.meta.session&&(m.radioSessionId=s.data.meta.session.radioSessionId,m.context="radio",m.contextItem=s.data.meta.session.wave.stationId),(0,b.KT)(s)&&(m.playlistId=`${s.data.meta.uid}:${s.data.meta.kind}`,m.contextItem=`${s.data.meta.uid}:${s.data.meta.kind}`),(0,b.dt)(s)){let e=[b.Zc.Search,b.Zc.Other],t=s.data.overrideContextType??b.Zc.Other;m.context=t,e.includes(t)&&(m.contextItem=null)}return{type:r,isSent:!1,data:m}}(a=r||(r={})).START="start",a.END="end";var q=i(63278);class D extends q.y{name="PlaysException";constructor(e,{code:t="E_PLAYS",...i}={}){super(e,{code:t,...i}),Object.setPrototypeOf(this,D.prototype)}}class U{entityPlaysMap={};playerStageByEntitiesPlayId=new Map;playsResource;variables;constructor(e){let{httpClient:t,playsResourceConfig:i,variables:a}=e;this.playsResource=new w.ol(t,i),this.variables=a||{}}apply(e){let{hooks:t,playback:i}=e;i.state.playerState.event.onChange(()=>{let{currentEntity:e}=i.state.queueState;e.value&&i.state.playerState.event.value===N.KX.PLAYING&&this.changePlayerStageByPlayId({playId:e.value.entity.playId,stage:w.KZ.PLAY})}),t.beforeEntityPlayingProcessStart.tapPromise("PlaysPlugin",()=>new Promise(e=>{this.sendStartEntityPlay(i,t),e()})),t.afterMediaEndPlaying.tapPromise("PlaysPlugin",()=>new Promise(e=>{let{index:{value:a},entityList:{value:o},repeat:{value:r}}=i.state.queueState;(a===o.length-1||r===N.zq.ONE)&&this.sendEndEntityPlay(i,t),e()})),t.afterError.tapPromise("PlaysPlugin",e=>((e instanceof Z.Tb||e instanceof N.YR)&&this.sendEndEntityPlay(i,t),Promise.resolve())),t.beforeContextSet.tapPromise("PlaysPlugin",()=>new Promise(e=>{i.state.queueState.currentEntity.value&&i.state.currentContext.value?(0,b.xA)(i.state.currentContext.value)?this.sendEndEntityPlay(i,t).then(e):(this.sendEndEntityPlay(i,t),e()):e()})),t.beforeEntityChange.tapPromise("PlaysPlugin",()=>new Promise(e=>{i.state.queueState.currentEntity.value&&i.state.currentContext.value?(0,b.xA)(i.state.currentContext.value)?this.sendEndEntityPlay(i,t).then(e):(this.sendEndEntityPlay(i,t),e()):e()}))}sendStartEntityPlay(e,t){return new Promise(i=>{let a=e.state.queueState.currentEntity.value;try{if(a){a.entity.playId=(0,B.Z)(),a.entity.addTracksToPlayerTime=`${Math.random().toString().slice(2)}-${Math.ceil(Number(new Date)/1e3)}`;let o=O({type:r.START,contextEntityPair:a,totalPlayedSeconds:0,endPositionSeconds:0});this.saveEntityPlay(o),o.data.totalPlayedSeconds>2e3&&t.afterError.promise(new D("Plays error. Too big play time",{code:"E_PLAYS_BIG_PLAY_TIME",data:{timeStagesOfPlayback:a.entity.timeStagesOfPlayback,contextId:a.context.data.meta.id,entityId:a.entity.data.meta.id,totalPlayedSeconds:o.data.totalPlayedSeconds,trackLengthSeconds:o.data.trackLengthSeconds,playId:o.data.playId,isOnStart:!0,entityListLength:e.state.queueState.entityList.value.length,index:e.state.queueState.index.value,repeat:e.state.queueState.repeat.value}})),this.variables.disableSendPlaysOnTrackStart?i():this.playsResource.sendPlays({clientNow:I(),plays:[o.data]}).then(()=>{o.isSent=!0,i()}).catch(e=>{o.isSent=!1;let r="",n="";a&&(r=a.context.data.meta.id,n=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:e,data:{contextId:r,entityId:n}})),i()})}else i()}catch(r){let e="",o="";a&&(e=a.context.data.meta.id,o=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:r,data:{contextId:e,entityId:o}})),i()}})}sendEndEntityPlay(e,t){return new Promise(i=>{let a=e.state.queueState.currentEntity.value;try{if(a&&!(0,b.Q7)(a.context)){let o,n;let{entity:l}=a,s=this.entityPlaysMap[l.playId],d=!1;if(s&&(d=!!s.find(e=>e.type===r.END)),d){i();return}let u=a.entity.totalPlayedSeconds;this.variables.enableSendMaxPlayerStage&&(n=this.playerStageByEntitiesPlayId.get(l.playId)||w.KZ.PREPARE),o=0===u?O({type:r.END,contextEntityPair:a,totalPlayedSeconds:.1,endPositionSeconds:.1,maxPlayerStage:n}):O({type:r.END,contextEntityPair:a,totalPlayedSeconds:u,endPositionSeconds:e.state.playerState.progress.value.position,maxPlayerStage:n}),this.saveEntityPlay(o),this.playerStageByEntitiesPlayId.delete(o.data.playId),o.data.totalPlayedSeconds>2e3&&t.afterError.promise(new D("Plays error. Too big play time",{code:"E_PLAYS_BIG_PLAY_TIME",data:{timeStagesOfPlayback:a.entity.timeStagesOfPlayback,contextId:a.context.data.meta.id,entityId:a.entity.data.meta.id,totalPlayedSeconds:o.data.totalPlayedSeconds,trackLengthSeconds:o.data.trackLengthSeconds,playId:o.data.playId,isOnStart:!1,entityListLength:e.state.queueState.entityList.value.length,index:e.state.queueState.index.value,repeat:e.state.queueState.repeat.value}})),this.playsResource.sendPlays({clientNow:I(),plays:[o.data]}).then(()=>{o.isSent=!0,i()}).catch(e=>{o.isSent=!1;let r="",n="";a&&(r=a.context.data.meta.id,n=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:e,data:{contextId:r,entityId:n}})),i()})}else i()}catch(r){let e="",o="";a&&(e=a.context.data.meta.id,o=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:r,data:{contextId:e,entityId:o}})),i()}})}saveEntityPlay(e){let t=this.entityPlaysMap[e.data.playId];void 0===t?this.entityPlaysMap[e.data.playId]=[e]:t.push(e)}changePlayerStageByPlayId({playId:e,stage:t}){this.playerStageByEntitiesPlayId.set(e,t)}}(o=n||(n={})).PLAY="play",o.PAUSE="pause",o.NEXT="nexttrack",o.PREV="previoustrack",o.SEEK="seekto",o.STOP="stop";let z=[40,50,80,100,200,300,400],F=[n.PLAY,n.PAUSE,n.STOP,n.SEEK];class W{browserName;browserVersion;constructor({browserName:e,browserVersion:t}){this.browserName=e,this.browserVersion=t}isSupported(){return"mediaSession"in window.navigator&&"MediaMetadata"in window}handleMediaActionEvents(e,t){let{action:i}=e;switch(i){case n.PLAY:t.resume();break;case n.PAUSE:case n.STOP:t.pause();break;case n.NEXT:t.moveForward();break;case n.PREV:t.moveBackward();break;case n.SEEK:{if((0,g.OX)(t.state.queueState.currentEntity.value?.entity))return;let{seekTime:i}=e;i&&t.setProgress(i)}}}prepareMetadata(e){let t,i;let a={title:e.title};if("artists"in e){let t=(e.artists||[]).map(e=>e.name).join(", ");a.artist=t}if("albums"in e){let t=e.albums?.[0]?.title;a.album=t}return"coverUri"in e&&(t=e.coverUri),"imageUrl"in e&&(t=e.imageUrl),t&&(i=z.map(e=>{let i=`${e}x${e}`;return"Safari"===this.browserName&&(i=`${2*e}x${2*e}`),{sizes:i,src:`https://${t.replace("%%",i)}`,type:"image/jpg"}})),a.artwork=i,a}updateMetadata(e){if(!e)return;let t=this.prepareMetadata(e);window.navigator.mediaSession.metadata=new MediaMetadata(t)}handlePlayerEvents(e){let t,i;e.state.playerState.event.onChange(()=>{(e.state.playerState.event.value===N.KX.START||e.state.playerState.event.value===N.KX.UPDATING_PROGRESS)&&(this.updateMetadata(e.state.queueState.currentEntity.value?.entity.data.meta),(0,g.OX)(e.state.queueState.currentEntity.value?.entity)?navigator.mediaSession.setPositionState({duration:0,position:0}):navigator.mediaSession.setPositionState(),F.forEach(t=>{try{window.navigator.mediaSession.setActionHandler(t,t=>this.handleMediaActionEvents(t,e))}catch{console.log(`The media session action "${t}" is not supported yet.`)}}))}),e.state.currentContext.onChange(()=>{t?.(),i?.(),t=e.state.currentContext.value?.availableActions.moveBackward.onChange(()=>{let t=e.state.currentContext.value?.availableActions.moveBackward.value??!1;window.navigator.mediaSession.setActionHandler(n.PREV,t?t=>this.handleMediaActionEvents(t,e):null)}),i=e.state.currentContext.value?.availableActions.moveForward.onChange(()=>{let t=e.state.currentContext.value?.availableActions.moveForward.value??!1;window.navigator.mediaSession.setActionHandler(n.NEXT,t?t=>this.handleMediaActionEvents(t,e):null)})})}apply(e){let{playback:t}=e;this.isSupported()&&this.handlePlayerEvents(t)}}class Y{logger;constructor(e){let{logger:t}=e;this.logger=t}apply(e){let{hooks:t,playback:i}=e;t.afterError.tapPromise("LoggerPlugin",e=>{let t;let a=i.state.queueState.currentEntity.value?i.state.queueState.currentEntity.value.entity.mediaSource:null;return(t=e instanceof q.y?e:new q.y("Error in Sonata player",{code:"E_SONATA",cause:e})).name=`[Sonata] ${t.name}`,this.logger.error(t,{...t.data,...a||{},code:t.code,cause:t.cause,stack:t.stack}),Promise.resolve()})}}let G=[b.Ak.Album,b.Ak.Artist,b.Ak.Playlist,b.Ak.Various],K=(e,t)=>{let i=e.state.currentContext.value?.data;if(!i)return"";let a=i.type,o=e.state.queueState.entityList.value.length||0;return a===b.Ak.Various&&1===o&&(a="track"),i.type===b.Ak.Various&&i.overrideContextType&&(a=i.overrideContextType),`${t}-radio-${a}-autoflow`},J=e=>{let t=e.state.currentContext.value?.data;if(t){if(t.type===b.Ak.Album)return[`album:${t.meta.id}`];if(t.type===b.Ak.Artist)return[`artist:${t.meta.id}`];if(t.type===b.Ak.Playlist&&t.meta.owner?.uid&&t.meta.kind)return[`playlist:${t.meta.owner?.uid}_${t.meta.kind}`];if(t.type===b.Ak.Various){if(t.overrideAutoflowSeeds)return t.overrideAutoflowSeeds;let i=e.state.queueState.currentEntity.value?.entity.data.meta.id;return[`track:${i}`]}}};class ${contextFactory;platform;constructor({contextFactory:e,platform:t}){this.contextFactory=e,this.platform=t}apply(e){let{playback:t,hooks:i}=e;i.afterContextEnd.tapPromise("AutoflowPlugin",()=>{let e=t.state.currentContext.value?.data.type;return e&&G.includes(e)&&this.playAutoflow(t),Promise.resolve()})}playAutoflow(e){let t=e.state.currentContext.value?.data.type,i=J(e);if(!(t&&i))return;let a=this.contextFactory.create({data:{type:b.Ak.Vibe,meta:{id:b.Ak.Vibe},seeds:i,from:K(e,this.platform),includeTracksInResponse:!0}});e.playContext({context:a,loadContextMeta:!0})}}class X{quality;constructor(e){this.quality=e}apply(e){let{playback:t,hooks:i}=e;this.quality.onChange(()=>{t.state.playerState.status.value!==N.Xz.IDLE&&t.reloadEntity().catch(e=>{i.afterError.promise(e)})})}}class Q{streamsResource;timeoutId=0;constructor(e){let{httpClient:t,streamsResourceConfig:i}=e;this.streamsResource=new w.hd(t,i)}apply(e){let{hooks:t,playback:i}=e;t.beforeEntityChange.tapPromise("ContinuePlayingPlugin",()=>{let{position:e,duration:t}=this.getTimingsFromPlayback(i);return new Promise(a=>{e!==t&&this.checkBeforeProgressSync(i),a()})}),i.state.playerState.status.onChange(e=>{let{position:t,duration:a}=this.getTimingsFromPlayback(i);if(e===N.Xz.PAUSED||e===N.Xz.STOPPED){if(e===N.Xz.PAUSED&&t===a)return;this.clearTimeout(),this.checkBeforeProgressSync(i)}e===N.Xz.PLAYING&&this.shouldSendProgressSync(i)&&this.setTimeout(i)})}checkBeforeProgressSync(e){if(this.clearTimeout(),!this.shouldSendProgressSync(e))return;let{position:t,duration:i}=this.getTimingsFromPlayback(e),a=e.state.queueState.currentEntity.value?.entity.data.meta.id;Number.isFinite(i)&&Number.isFinite(t)&&i&&t&&a&&(this.sendProgressSync({duration:i,position:t,trackId:a}),e.state.playerState.status.value===N.Xz.PLAYING&&this.setTimeout(e))}sendProgressSync(e){let t=new Date().toISOString(),{duration:i,position:a,trackId:o}=e;this.streamsResource.progressSync({lastSyncTimestamp:t,trackStreams:[{trackId:o,positionSec:a,trackLengthSec:i,finished:a===i,timestamp:t}]})}shouldSendProgressSync(e){let t=e.state.queueState.currentEntity.value?.entity.data.meta;return!!(t&&"rememberPosition"in t&&t.rememberPosition)}setTimeout(e){this.clearTimeout(),this.timeoutId=window.setTimeout(()=>{this.checkBeforeProgressSync(e)},18e4)}clearTimeout(){window.clearTimeout(this.timeoutId)}getTimingsFromPlayback(e){return{duration:Math.floor(e.state.playerState.progress.value.duration),position:Math.floor(e.state.playerState.progress.value.position)}}}var ee=i(45412),et=i(86502),ei=i(66026),ea=i(57921),eo=i(69559),er=i(68085),en=i(5674);let el=null,es=null,ed=null,eu=(0,s.Pi)(e=>{let{children:t,hostTld:i,userAgent:a,quality:o}=e,r=(0,en.uK)(),{sonataState:n,experiments:s,library:u,user:c}=(0,en.oR)(),C=(0,en.wL)(),h=r.get(en.V0),{language:m}=(0,en.ZS)(),p=(0,d.useMemo)(()=>(el||(el=new Z.$J(o)),el),[o]),v=(0,d.useMemo)(()=>{if(es)return es;let e=r.get(en.U5),t=r.get(en.pI),o=t({credentials:"include"}),n=r.get(en.xi),{resources:l,player:{gateway:{prefixUrl:d,headers:c}}}=e,{timeouts:h,retryPolicyConfig:v}=l.musicExternalApi,E=new b.Tg({httpClient:o,logger:C,config:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},retryPolicyConfig:v,resourceTimeoutsConfig:h,gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c},contextVariables:{vibe:{get sendFeedbackToSessionTracks(){return s.checkExperiment(en.pe.WebNextWaveNewFeedbacks,"on")}}}}}),f=new g.nS({likeStore:u}),{overembed:_,externalDomain:y,...A}={params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},retryPolicyConfig:v,timeouts:h.tracksResource,gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c},overembed:e.player.overembed,externalDomain:e.player.externalDomain},P=new Z.Ez({downloadInfoProviderParams:{httpClient:o,resourceConfig:{...A,overembed:_,externalDomain:y},secretKey:e.player.secretKey,mediaConfigController:p},getFileInfoProviderParams:{httpClient:o,resourceConfig:A,secretKey:e.player.secretKey,mediaConfigController:p,transport:w.J7.RAW,variables:{get useNewCorrespondenceBetweenQualityParams(){return s.checkExperiment(en.pe.WebNextEnableNewQuality,"on")}}},variables:{get switchToStrmWithoutEncrypt(){return s.checkExperiment(en.pe.WebNextSwitchToStrmWithoutEncrypt,"on")}}}),L=new Z.sd({httpClient:o,config:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},retryPolicyConfig:v,timeouts:h.tracksResource,gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c}}}),N=new x;return es=new et.$7({contextFactory:E,entityFactory:f,audioCore:N,mediaProvider:P,entityProvider:L,windowPaginationConfig:{windowSize:30,setupQueueWindowSize:80},config:{mediaElementErrorReloadCount:2},plugins:[new k,new V,new j,new U({httpClient:o,playsResourceConfig:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c}},variables:{get disableSendPlaysOnTrackStart(){return s.checkExperiment(en.pe.WebNextDisableSendPlaysOnTrackStart,"on")},get enableSendMaxPlayerStage(){return s.checkExperiment(en.pe.WebPlayAudioSendPrepare,"on")}}}),new W({browserName:a.browserName,browserVersion:a.browserVersion}),new Y({logger:C}),new $({contextFactory:E,platform:"desktop"}),new X(p.quality),new Q({httpClient:o,streamsResourceConfig:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c}}})]})},[s,r,C,i,p,a.browserName,a.browserVersion,m,u]),E=(0,d.useMemo)(()=>(ed||(null==v?void 0:v.source)&&(ed="Safari"===a.browserName?new ei.Qz:new ei.WZ(v.source)),ed),[null==v?void 0:v.source,a.browserName]);v&&(0,ea.A4)(v),(0,d.useEffect)(()=>{let e,t,i,a,o;let r=null==v?void 0:v.state.queueState.currentEntity.onChange(e=>{var t;let i=null==e?void 0:e.context.data.type,a=null==e?void 0:e.context.data.meta.id;n.setEntityMeta(null!==(t=null==e?void 0:e.entity)&&void 0!==t?t:null),i&&n.setContextType(i),a&&n.setContextId(a)}),l=null==v?void 0:v.state.queueState.order.onChange(e=>{let t=v.state.queueState.index.value;if(e){let i=e[t];v.state.queueState.order.value.length>0&&"number"==typeof i&&n.setCurrentlyPlayingTrackIndex(i)}}),s=null==v?void 0:v.state.playerState.status.onChange(e=>{e&&(n.setStatus(e),(0,ea.Pt)({isPlaying:e===et.Xz.PLAYING}))}),d=null==v?void 0:v.state.currentContext.onChange(()=>{var r,l,s,d,u,c,C,m,p,E,f;null===(r=e)||void 0===r||r(),null===(l=t)||void 0===l||l(),null===(s=i)||void 0===s||s(),null===(d=a)||void 0===d||d(),null===(u=o)||void 0===u||u();let _=null!==(f=h.get(en.BU.YmPlayerRepeatMode))&&void 0!==f?f:ee.zq.NONE;v.setRepeatMode(_);let y=!!h.get(en.BU.YmPlayerShuffle);v.setShuffle(y),e=null==v?void 0:null===(c=v.state.currentContext.value)||void 0===c?void 0:c.availableActions.moveBackward.onChange(()=>{var e;let t=!!(null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveBackward.value);n.setCanMoveBackward(t),(0,ea.Pt)({canMoveBackward:t})}),t=null==v?void 0:null===(C=v.state.currentContext.value)||void 0===C?void 0:C.availableActions.moveForward.onChange(()=>{var e;let t=!!(null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveForward.value);n.setCanMoveForward(t),(0,ea.Pt)({canMoveForward:t})}),i=null==v?void 0:null===(m=v.state.currentContext.value)||void 0===m?void 0:m.availableActions.repeat.onChange(()=>{var e;let t=null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.repeat.value;"boolean"==typeof t&&n.setCanChangeRepeatMode(t)}),a=null==v?void 0:null===(p=v.state.currentContext.value)||void 0===p?void 0:p.availableActions.shuffle.onChange(()=>{var e;let t=null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.shuffle.value;"boolean"==typeof t&&n.setCanShuffle(t)}),o=null==v?void 0:null===(E=v.state.currentContext.value)||void 0===E?void 0:E.availableActions.speed.onChange(()=>{var e;let t=null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.speed.value;"boolean"==typeof t&&(n.setCanSpeed(t),!t&&v&&v.setSpeed(1))})}),u=null==v?void 0:v.state.playerState.volume.onChange(()=>{let e=v.state.playerState.volume.value;"number"==typeof e&&n.setVolume(e)}),c=null==v?void 0:v.state.queueState.repeat.onChange(()=>{let e=v.state.queueState.repeat.value;n.setRepeatMode(e),h.set(en.BU.YmPlayerRepeatMode,e)}),C=null==v?void 0:v.state.queueState.shuffle.onChange(()=>{let e=v.state.queueState.shuffle.value;n.setShuffle(e),h.set(en.BU.YmPlayerShuffle,e)});return()=>{null==r||r(),null==l||l(),null==s||s(),null==d||d(),null==u||u(),null==c||c(),null==C||C()}},[v,n,h]),(0,d.useEffect)(()=>{let e=h.get(en.BU.YmPlayerVolume);"number"==typeof e?(null==v||v.setVolume(e),n.setVolume(e)):(null==v||v.setVolume(1),n.setVolume(1))},[h,v,n]);let f=(0,d.useMemo)(()=>{let e=s.checkExperiment(en.pe.WebNextEnableNewQuality,"on");if(!c.hasPlus)return Z.nJ.PREVIEW;let t=h.get(en.BU.YmPlayerQuality);return(e||t!==Z.nJ.HQ_PLUS)&&t||(h.set(en.BU.YmPlayerQuality,Z.nJ.HQ),Z.nJ.HQ)},[s,c.hasPlus,h]);return(0,d.useEffect)(()=>{p.setQuality(f),n.setQuality(f)},[p,n,f]),(0,l.jsx)(en.Xe.Provider,{value:p,children:(0,l.jsx)(en.R8.Provider,{value:v,children:(0,l.jsx)(eo.y5.Provider,{value:E,children:t})})})})},42622:function(e,t,i){"use strict";i.r(t),i.d(t,{ThemeProvider:function(){return n}});var a=i(8759),o=i(99616),r=i(5674);let n=e=>{let{children:t}=e,i=(0,r.uK)(),n=i.get(r.V0),l=(0,r.oz)(),[s,d]=(0,o.useState)((0,r.NK)(n.get(r.BU.Theme),l));(0,o.useEffect)(()=>{(0,r.kz)(n.get(r.BU.Theme))},[n]),(0,o.useEffect)(()=>{n.get(r.BU.Theme)===r.rL&&d(l)},[l,n]);let u=(0,o.useMemo)(()=>({theme:s,setTheme:d}),[s]);return(0,a.jsx)(r.Ni.Provider,{value:u,children:t})}},19976:function(e,t,i){"use strict";i.r(t),i.d(t,{TranslationsProvider:function(){return s}});var a=i(8759),o=i(99616),r=i(17516),n=i(28151),l=i(5674);let s=e=>{let{children:t}=e,{dictionary:i,language:s,defaultLanguage:d}=(0,l.ZS)(),u=(0,l.wL)(),c=(0,o.useCallback)(e=>{if("code"in e&&e.code===r.bc.MISSING_DATA)return;let t=e&&"object"==typeof e&&"code"in e&&e.code,i="IntlProviderError";t&&(i+=":".concat(t)),u.error(i,{error:null==e?void 0:e.message,stack:null==e?void 0:e.stack})},[u]);return(0,a.jsx)(n.Z,{onError:c,defaultLocale:d,locale:s,messages:i,children:t})}},98125:function(e,t,i){"use strict";i.d(t,{F:function(){return v},K:function(){return h}});var a=i(8759),o=i(35338),r=i(33423),n=i(99616),l=i(65244),s=i(454),d=i(15527),u=i(14581),c=i(22926),C=i(5674);let h=()=>{let e=(0,C.uK)(),t=e.get(C.V0),i=(0,C.R$)();return(0,n.useCallback)(async e=>{var a;if(0!==e)t.set(C.BU.YmPlayerPrevVolume,e),await (null==i?void 0:i.setVolume(0)),t.set(C.BU.YmPlayerVolume,0);else{let e=null!==(a=t.get(C.BU.YmPlayerPrevVolume))&&void 0!==a?a:1;t.remove(C.BU.YmPlayerPrevVolume),await (null==i?void 0:i.setVolume(e)),t.set(C.BU.YmPlayerVolume,e)}},[i,t])};var m=i(73939),p=i.n(m);let v=(0,r.Pi)(e=>{var t,i;let{className:r}=e,{formatMessage:m}=(0,l.Z)(),v=(0,C.uK)(),E=(0,C.R$)(),{sonataState:f}=(0,C.oR)(),_=h(),y=v.get(C.V0),A=null!==(i=null!==(t=y.get(C.BU.YmPlayerVolume))&&void 0!==t?t:f.volume)&&void 0!==i?i:1,P=(0,n.useCallback)(e=>{null==E||E.setVolume(e),y.set(C.BU.YmPlayerVolume,e)},[E,y]),L=(0,n.useCallback)(async()=>{await _(f.volume)},[_,f.volume]),x=m(0===f.volume?{id:"player-actions.volume-on"}:{id:"player-actions.volume-off"});return(0,a.jsxs)("div",{className:(0,o.W)(p().root,r),children:[(0,a.jsx)(d.z,{radius:"round",size:"xxxs",variant:"text",withRipple:!1,onClick:L,"aria-label":x,icon:(0,a.jsx)(u.J,{size:"xs",className:p().icon,variant:0===A?"volumeOff":"volume"}),className:p().button,...(0,s.BA)(s.bG.changeVolume.CHANGE_VOLUME_BUTTON)}),(0,a.jsx)(c.i,{thumbSize:"s",trackSize:"s",value:A,maxValue:1,step:.01,onChange:P,"aria-label":m({id:"player-actions.volume-control"}),...(0,s.BA)(s.bG.changeVolume.CHANGE_VOLUME_SLIDER)})]})})},65151:function(e,t,i){"use strict";i.d(t,{t:function(){return s}});var a=i(8759),o=i(99616),r=i(45412),n=i(5674),l=i(34512);let s=()=>{let{notify:e}=(0,n.d$)(),{sonataState:t,modals:{fullscreenPlayerModal:i}}=(0,n.oR)(),s=(0,n.R$)();return(0,o.useCallback)(()=>{if(null===t.entityMeta||!t.canChangeRepeatMode)return;let o=r.zq.NONE;switch(t.repeatMode){case r.zq.NONE:o=r.zq.CONTEXT;break;case r.zq.CONTEXT:o=r.zq.ONE}null==s||s.setRepeatMode(o),e((0,a.jsx)(l.NotificationRepeat,{repeatMode:o}),{containerId:i.isOpened?n.W$.FULLSCREEN_INFO:n.W$.INFO})},[i.isOpened,e,s,t.canChangeRepeatMode,t.entityMeta,t.repeatMode])}},37960:function(e,t,i){"use strict";i.d(t,{m:function(){return l}});var a=i(8759),o=i(99616),r=i(5674),n=i(74758);let l=()=>{let{notify:e}=(0,r.d$)(),{sonataState:t,modals:{fullscreenPlayerModal:i}}=(0,r.oR)(),l=(0,r.R$)();return(0,o.useCallback)(()=>{null!==t.entityMeta&&t.canShuffle&&(null==l||l.toggleShuffle(),e((0,a.jsx)(n.NotificationShuffle,{shuffle:!!(null==l?void 0:l.state.queueState.shuffle.value)}),{containerId:i.isOpened?r.W$.FULLSCREEN_INFO:r.W$.INFO}))},[i.isOpened,e,l,t.canShuffle,t.entityMeta])}},34512:function(e,t,i){"use strict";i.r(t),i.d(t,{NotificationRepeat:function(){return h}});var a=i(8759),o=i(35338),r=i(99616),n=i(2814),l=i(45412),s=i(14581),d=i(1918),u=i(44285),c=i(55075),C=i.n(c);let h=e=>{let{repeatMode:t,closeToast:i}=e,c=t===l.zq.ONE?"repeat_one":"repeat",h=(0,r.useMemo)(()=>{let e;switch(t){case l.zq.CONTEXT:e=(0,a.jsx)(n.Z,{id:"notifications-info.change-repeat-context"});break;case l.zq.ONE:e=(0,a.jsx)(n.Z,{id:"notifications-info.change-repeat-track"});break;case l.zq.NONE:default:e=(0,a.jsx)(n.Z,{id:"notifications-info.change-repeat-none"})}return(0,a.jsx)(d.Caption,{className:C().message,variant:"div",type:"controls",size:"m",children:e})},[t]);return(0,a.jsx)(u.Yj,{cover:(0,a.jsx)(s.J,{className:(0,o.W)(C().icon,{[C().icon_unset]:t===l.zq.NONE}),size:"xs",variant:c}),message:h,closeToast:i})}},74758:function(e,t,i){"use strict";i.r(t),i.d(t,{NotificationShuffle:function(){return C}});var a=i(8759),o=i(35338),r=i(99616),n=i(2814),l=i(14581),s=i(1918),d=i(44285),u=i(46520),c=i.n(u);let C=e=>{let{shuffle:t,closeToast:i}=e,u=(0,r.useMemo)(()=>{let e;return e=t?(0,a.jsx)(n.Z,{id:"notifications-info.shuffle-enabled"}):(0,a.jsx)(n.Z,{id:"notifications-info.shuffle-disabled"}),(0,a.jsx)(s.Caption,{className:c().message,variant:"div",type:"controls",size:"m",children:e})},[t]);return(0,a.jsx)(d.Yj,{cover:(0,a.jsx)(l.J,{className:(0,o.W)(c().icon,{[c().icon_unset]:!t}),size:"xs",variant:"shuffle"}),message:u,closeToast:i})}},6769:function(e,t,i){"use strict";i.r(t),i.d(t,{RepeatButton:function(){return m}});var a=i(8759),o=i(35338),r=i(65244),n=i(454),l=i(45412),s=i(15527),d=i(14581),u=i(65151),c=i(20873),C=i.n(c);let h=(e,t,i)=>t(e===l.zq.NONE||i?{id:"player-actions.repeat"}:e===l.zq.ONE?{id:"player-actions.repeat-one"}:{id:"player-actions.repeat-context"}),m=e=>{let{isDisabled:t,repeatMode:i,className:c,iconClassName:m,size:p="xxxs",iconSize:v="xs",color:E,variant:f="default"}=e,_=(0,u.t)(),{formatMessage:y}=(0,r.Z)(),A=t||i!==l.zq.ONE?"repeat":"repeat_one",P=h(i,y,t);return(0,a.jsx)(s.z,{className:c,radius:"round",size:p,variant:f,color:E,disabled:t,withRipple:!1,"aria-label":P,"aria-pressed":!t&&i!==l.zq.NONE,onClick:_,icon:(0,a.jsx)(d.J,{size:v,variant:A,className:(0,o.W)(C().repeatIcon,C()["repeatIcon_".concat(i)],{[C().repeatIcon_disabled]:t},m)}),...(0,n.BA)(n.bG.sonata.REPEAT_BUTTON)})}},66403:function(e,t,i){"use strict";i.r(t),i.d(t,{ShuffleButton:function(){return C}});var a=i(8759),o=i(35338),r=i(65244),n=i(454),l=i(15527),s=i(14581),d=i(37960),u=i(94406),c=i.n(u);let C=e=>{let{isDisabled:t,shuffle:i,className:u,size:C="xxxs",variant:h="default",iconSize:m="xs",color:p}=e,v=(0,d.m)(),{formatMessage:E}=(0,r.Z)();return(0,a.jsx)(l.z,{className:u,radius:"round",size:C,variant:h,color:p,withRipple:!1,disabled:t,"aria-label":E({id:"player-actions.shuffle"}),"aria-pressed":!t&&i,icon:(0,a.jsx)(s.J,{variant:"shuffle",size:m,className:(0,o.W)(c().shuffleIcon,{[c().shuffleIcon_disabled]:t,[c().shuffleIcon_on]:!t&&i,[c().shuffleIcon_off]:!t&&!i})}),onClick:v,...(0,n.BA)(n.bG.sonata.SHUFFLE_BUTTON)})}},21871:function(e,t,i){"use strict";i.r(t),i.d(t,{SonataControls:function(){return w}});var a=i(8759),o=i(33423),r=i(99616),n=i(86502),l=i(5674),s=i(65151),d=i(37960),u=i(35338),c=i(65244),C=i(454),h=i(15527),m=i(14581),p=i(44285),v=i(6769),E=i(66403),f=i(19035),_=i.n(f);let y=(0,o.Pi)(e=>{let{disabled:t,isPlaying:i,repeatMode:o,canMoveForward:r,canMoveBackward:n,canShuffle:l,shuffle:s,onClickNext:d,onClickPrev:f,onClickPlayPause:y,canChangeRepeatMode:A,className:P}=e,{formatMessage:L}=(0,c.Z)();return(0,a.jsxs)("div",{className:(0,u.W)(_().root,P),children:[(0,a.jsx)("div",{className:_().buttonContainer,children:(t||l)&&(0,a.jsx)(E.ShuffleButton,{className:_().sonataButton,size:"xxxs",variant:"text",iconSize:"xs",isDisabled:t,shuffle:s})}),(0,a.jsxs)("div",{className:_().sonataButtons,children:[(0,a.jsx)(h.z,{className:_().sonataButton,variant:"text",size:"m",radius:"round",disabled:!n,withRipple:!1,"aria-label":L({id:"player-actions.previous-track"}),icon:(0,a.jsx)(m.J,{variant:"previous"}),onClick:f,...(0,C.BA)(C.bG.sonata.PREVIOUS_TRACK_BUTTON)}),(0,a.jsx)(p.JM,{className:_().sonataButton,iconSize:"l",variant:"filled",isPlaying:i,iconClassName:_().playButtonIcon,onClick:y}),(0,a.jsx)(h.z,{className:_().sonataButton,radius:"round",size:"m",variant:"text",disabled:!r,withRipple:!1,"aria-label":L({id:"player-actions.next-track"}),icon:(0,a.jsx)(m.J,{variant:"next"}),onClick:d,...(0,C.BA)(C.bG.sonata.NEXT_TRACK_BUTTON)})]}),(0,a.jsx)("div",{className:_().buttonContainer,children:(t||A)&&(0,a.jsx)(v.RepeatButton,{className:_().sonataButton,size:"xxxs",variant:"text",isDisabled:t,iconSize:"xs",repeatMode:o})})]})});var A=i(57004);let P=e=>{let{disabled:t,isPlaying:i,onClickPlayPause:o,className:r}=e;return(0,a.jsx)(A.PlayButton,{className:r,size:"s",disabled:t,isPlaying:i,onClick:o})};var L=i(24516),x=i.n(L);let b=(0,o.Pi)(e=>{let{disabled:t,isPlaying:i,repeatMode:o,canMoveForward:r,canMoveBackward:n,canShuffle:l,onClickNext:s,onClickPrev:d,onClickPlayPause:f,canChangeRepeatMode:_,shuffle:y,className:A}=e,{formatMessage:P}=(0,c.Z)();return(0,a.jsxs)("div",{className:(0,u.W)(x().root,A),children:[(0,a.jsx)("div",{className:x().buttonContainer,children:(t||l)&&(0,a.jsx)(E.ShuffleButton,{className:x().sonataButton,size:"s",iconSize:"xxs",color:"secondary",isDisabled:t,shuffle:y})}),(0,a.jsxs)("div",{className:x().sonataButtons,children:[(0,a.jsx)(h.z,{className:x().sonataButton,color:"secondary",size:"m",radius:"round",disabled:!n,withRipple:!1,"aria-label":P({id:"player-actions.previous-track"}),icon:(0,a.jsx)(m.J,{variant:"previous"}),onClick:d,...(0,C.BA)(C.bG.sonata.PREVIOUS_TRACK_BUTTON)}),(0,a.jsx)(p.JM,{className:x().sonataButton,iconSize:"m",size:"l",radius:"round",color:"secondary",buttonVariant:"default",isPlaying:i,iconClassName:x().playPauseButtonIcon,onClick:f}),(0,a.jsx)(h.z,{className:x().sonataButton,radius:"round",size:"m",color:"secondary",disabled:!r,withRipple:!1,"aria-label":P({id:"player-actions.next-track"}),icon:(0,a.jsx)(m.J,{variant:"next"}),onClick:s,...(0,C.BA)(C.bG.sonata.NEXT_TRACK_BUTTON)})]}),(0,a.jsx)("div",{className:x().buttonContainer,children:(t||_)&&(0,a.jsx)(v.RepeatButton,{className:x().sonataButton,size:"s",color:"secondary",isDisabled:t,iconSize:"xxs",repeatMode:o})})]})});var g=i(57413),N=i(43310),V=i(3273),S=i.n(V);let T=(0,o.Pi)(e=>{let{isPlaying:t,canMoveForward:i,canMoveBackward:o,onClickNext:n,onClickPrev:s,onClickPlayPause:d,className:C}=e,{formatMessage:v}=(0,c.Z)(),{user:E,sonataState:f}=(0,l.oR)(),_=(0,l.XU)(),y=f.entityMeta,A=f.contextType===g.Ak.Generative,P=E.isAuthorized&&!A,L=(0,N.SB)(f.entityMeta),x=(0,N.KX)(f.entityMeta);return(0,r.useEffect)(()=>{if(!f.isGenerativeContext)return null==_||_.addShortcutsListener(l.yx.LIKE,L),null==_||_.addShortcutsListener(l.yx.DISLIKE,x),()=>{null==_||_.removeShortcutsListener(l.yx.LIKE),null==_||_.removeShortcutsListener(l.yx.DISLIKE)}},[x,L,_,f.isGenerativeContext]),(0,a.jsxs)("div",{className:(0,u.W)(S().root,C),children:[(0,a.jsx)("div",{className:S().buttonContainer,children:y&&P&&(0,a.jsx)(p.Q1,{isDisliked:y.isDisliked,onClick:x})}),(0,a.jsxs)("div",{className:S().sonataButtons,children:[(0,a.jsx)(h.z,{className:S().sonataButton,variant:"text",color:"secondary",size:"m",radius:"round",disabled:!o,withRipple:!1,"aria-label":v({id:"player-actions.previous-track"}),icon:(0,a.jsx)(m.J,{variant:"previous"}),onClick:s}),(0,a.jsx)(p.JM,{className:S().sonataButton,iconSize:"xxl",variant:"filled",color:"secondary",isPlaying:t,iconClassName:S().playPauseButtonIcon,onClick:d}),(0,a.jsx)(h.z,{className:S().sonataButton,variant:"text",radius:"round",size:"m",color:"secondary",disabled:!i,withRipple:!1,"aria-label":v({id:"player-actions.next-track"}),icon:(0,a.jsx)(m.J,{variant:"next"}),onClick:n})]}),(0,a.jsx)("div",{className:S().buttonContainer,children:y&&P&&(0,a.jsx)(p.dJ,{isLiked:y.isLiked,onClick:L})})]})}),w=(0,o.Pi)(e=>{var t,i;let{isMobile:o,entityMeta:u,isFullscreen:c,className:C}=e,{sonataState:h,vibe:m}=(0,l.oR)(),p=(0,l.XU)(),v=(0,l.R$)(),{togglePlay:E}=(0,l.Qh)({seeds:null!==(i=null===(t=m.meta)||void 0===t?void 0:t.seeds)&&void 0!==i?i:[],pageIdForFrom:l.Rh.HOME,blockIdForFrom:l.BE.RUP_MAIN_RADIO}),f=(0,r.useMemo)(()=>{let e=[n.Xz.PLAYING,n.Xz.LOADING_MEDIA_SOURCE,n.Xz.LOADING_MEDIA_DATA];return e.includes(h.status)},[h.status]),_=(0,r.useCallback)(()=>{u?null==v||v.togglePause():E()},[u,v,E]),A=(0,r.useCallback)(()=>{null==v||v.moveForward()},[v]),L=(0,r.useCallback)(()=>{null==v||v.moveBackward()},[v]),x=(0,d.m)(),g=(0,s.t)();(0,r.useEffect)(()=>{if(!c)return null==p||p.addShortcutsListener(l.yx.TOGGLE_PLAY,_),null==p||p.addShortcutsListener(l.yx.TOGGLE_REPEAT,g),null==p||p.addShortcutsListener(l.yx.TOGGLE_SHUFFLE,x),()=>{null==p||p.removeShortcutsListener(l.yx.TOGGLE_PLAY),null==p||p.removeShortcutsListener(l.yx.TOGGLE_SHUFFLE),null==p||p.removeShortcutsListener(l.yx.TOGGLE_REPEAT)}},[c,_,g,x,p]);let N=(0,r.useMemo)(()=>c?o?T:b:o?P:y,[o,c]);return(0,a.jsx)(N,{className:C,disabled:null===h.entityMeta,isPlaying:f,canMoveBackward:h.canMoveBackward,canMoveForward:h.canMoveForward,canShuffle:h.canShuffle,shuffle:h.shuffle,onClickPlayPause:_,onClickNext:A,onClickPrev:L,canChangeRepeatMode:h.canChangeRepeatMode,repeatMode:h.repeatMode})})},68085:function(e,t,i){"use strict";i.d(t,{$:function(){return d}});var a,o,r=i(28307),n=i(93991),l=i(39351);(a=o||(o={})).WEB="YandexMusicWebNext",a.DESKTOP="YandexMusicDesktopApp";let s=(e,t)=>"".concat(e,"/").concat(t),d=()=>{{let e=(0,l.b)()||"1.0",t="".concat(o.DESKTOP).concat((0,n.y)((0,r.X)()));return s(t,e)}}},93991:function(e,t,i){"use strict";i.d(t,{y:function(){return o}});var a=i(38060);let o=e=>{switch(e){case"win32":return a.B.WINDOWS;case"darwin":return a.B.MACOS;case"linux":return a.B.WINDOWS}return null}},38060:function(e,t,i){"use strict";var a,o;i.d(t,{B:function(){return a}}),(o=a||(a={})).WINDOWS="Windows",o.MACOS="MacOS",o.LINUX="Linux"},2365:function(e,t,i){"use strict";i.d(t,{T:function(){return a.NotFound}});var a=i(54529)},54529:function(e,t,i){"use strict";i.r(t),i.d(t,{NotFound:function(){return m}});var a=i(8759),o=i(35338),r=i(33423),n=i(2814),l=i(15527),s=i(14581),d=i(1918),u=i(42769),c=i(5674),C=i(94170),h=i.n(C);let m=(0,r.Pi)(e=>{let{className:t}=e,{contentRef:i}=(0,c.$Y)(),r=(0,c.s0)("/");return(0,c.ZP)(!0),(0,a.jsxs)("div",{className:(0,o.W)(h().root,{[h().root_desktop]:!i},t),children:[(0,a.jsx)(u.n,{withBackwardFallback:"/",className:h().navigation,withForwardControl:!1}),(0,a.jsxs)("div",{className:h().content,children:[(0,a.jsx)(s.J,{className:h().icon,variant:"musicLogo",size:"xxl"}),(0,a.jsx)(d.Heading,{className:(0,o.W)(h().title,h().important),variant:"h3",size:"xs",children:(0,a.jsx)(n.Z,{id:"page-error.page-does-not-exist"})}),(0,a.jsx)(d.Caption,{className:(0,o.W)(h().text,h().important),variant:"span",type:"text",size:"l",weight:"normal",children:(0,a.jsx)(n.Z,{id:"page-error.page-does-not-exist-description"})}),(0,a.jsx)(l.z,{onClick:r,className:h().button,role:"link",color:"secondary",size:"l",radius:"xxxl",children:(0,a.jsx)(d.Caption,{type:"controls",variant:"span",size:"m",children:(0,a.jsx)(n.Z,{id:"navigation.page-main"})})})]})]})})},48157:function(e,t,i){"use strict";i.d(t,{hx:function(){return O},f3:function(){return ea},Vm:function(){return eg},KC:function(){return eT}});var a,o=i(8759),r=i(35338),n=i(33423),l=i(99616),s=i.t(l,2),d=i(65244),u=i(2814),c=i(454),C=i(57413),h=i(15527),m=i(14581),p=i(96437),v=i(1918),E=i(96911),f=i(96169),_=i(81446),y=i(5674),A=i(44285);let P=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.filter(e=>!e.composer),i=t.filter(e=>!e.various),a=e.filter(e=>e.composer&&!e.various),o=[];return i.length>0?o=i:t.length>0&&(o=t),o.concat(a)};var L=i(33779),x=i.n(L),b=i(13236),g=i(41342),N=i.n(g);let V=(0,n.Pi)(e=>{let{className:t,text:i="",maxTextLength:a,minTextLength:n,variant:s="input",shouldFinishOnKeyPress:d=!1,placeholder:u,onChangeFinish:c}=e,[C,h]=(0,l.useState)(i),m=(0,l.useRef)(!1),p=(0,l.useRef)(null),v=(0,l.useCallback)(e=>{h(e.target.value)},[]),E=(0,l.useCallback)(e=>{if(d&&["Enter","Escape"].includes(e.key)){var t;"Escape"===e.key&&(m.current=!0),null===(t=e.currentTarget)||void 0===t||t.blur()}},[d]),f=(0,l.useCallback)(()=>{let e=C.trim();m.current||n&&e.length{p.current&&(p.current.selectionStart=p.current.value.length,p.current.selectionEnd=p.current.value.length)},[]),(0,l.useLayoutEffect)(()=>{let e=p.current;if(e){e.style.height="0px";let t=e.scrollHeight;e.style.height="".concat(t,"px")}},[p,C]);let _=(0,l.useMemo)(()=>"textarea"===s?e=>(0,o.jsx)("textarea",{ref:p,rows:6,...e}):e=>(0,o.jsx)("input",{...e}),[s]);return(0,o.jsx)(_,{className:(0,r.W)(N().root,t,{[N().root_textarea]:"textarea"===s}),type:"text",value:C,maxLength:a,onBlur:f,onChange:v,onKeyDown:E,placeholder:u,autoFocus:!0})});var S=i(74081),T=i.n(S);let w=(0,n.Pi)(e=>{let{title:t="","aria-labelledby":i,canChange:a=!1,onChange:n,maxTitleLength:s,version:u="",onVersionClick:C,className:p}=e,{settings:E}=(0,y.oR)(),{formatMessage:f}=(0,d.Z)(),[_,A]=(0,l.useState)(!1),P=(0,l.useRef)(null),L=E.layout===y.t8.Mobile,x=t.length+u.length,g=x>25,N=(0,l.useMemo)(()=>L?T().font_mobile:g?T().font_long:T().font_short,[L,g]),S=!L&&a&&_,w=(0,l.useCallback)(()=>{var e;A(!0),null===(e=P.current)||void 0===e||e.focus()},[]),R=(0,l.useCallback)(e=>{A(!1),null==n||n(e)},[n]);return(0,o.jsxs)(o.Fragment,{children:[!S&&(0,o.jsxs)("div",{className:(0,r.W)(T().root,p),children:[(0,o.jsx)(b.b4,{title:t,className:T().stickyTitle,children:(0,o.jsxs)(v.Heading,{variant:"h2",id:i,className:(0,r.W)(T().heading,{[T().heading_withVersion]:u}),...(0,c.BA)(c.QM.pageHeader.ENTITY_TITLE),children:[(0,o.jsx)(v.Caption,{className:(0,r.W)(T().font,N,T().title),variant:"span",children:t}),u&&(0,o.jsx)(v.Caption,{onClick:C,className:(0,r.W)(T().font,N,T().version,{[T().version_withOtherVersions]:C}),variant:"span",...(0,c.BA)(c.QM.pageHeader.ENTITY_VERSION),children:" ".concat(u)})]})}),a&&(0,o.jsx)("div",{className:(0,r.W)(T().editButton,{[T().editButton_centered]:!g&&!L}),children:(0,o.jsx)(h.z,{onClick:w,"aria-label":f({id:"playlist-actions.change-title"}),icon:(0,o.jsx)(m.J,{size:"xxs",variant:"pencil"}),size:"s",radius:"round",...(0,c.BA)(c.QM.pageHeader.EDIT_TITLE_BUTTON)})})]}),S&&(0,o.jsx)("div",{className:T().textFieldContainer,children:(0,o.jsx)(V,{text:t,className:(0,r.W)(T().font,N,T().textField,T().title,{[T().textField_long]:g&&!L}),onChangeFinish:R,maxTextLength:s,minTextLength:1,placeholder:f({id:"playlist-actions.enter-title"}),shouldFinishOnKeyPress:!0})})]})}),R=(0,n.Pi)(e=>{let{"aria-labelledby":t,entityName:i,title:a,meta:n,controls:s,className:d,forwardRef:u,canChangeTitle:C=!1,maxTitleLength:h,onTitleChange:m,cover:p,version:E,onVersionClick:f,disclaimerLabel:_,entityNameIcon:y}=e,A=(0,l.isValidElement)(_),P=(0,l.useMemo)(()=>A?(0,o.jsx)("div",{className:x().entityContainer,children:_}):(0,o.jsxs)(v.Caption,{variant:"div",type:"text",size:"m",weight:"medium",className:x().entityName,children:[i,y]}),[_,i,y,A]);return(0,o.jsxs)("div",{className:(0,r.W)(x().root,d),ref:u,...(0,c.BA)(c.QM.pageHeader.ENTITY_HEADER),children:[(0,o.jsx)("div",{className:x().coverCell,children:p}),(0,o.jsxs)("div",{className:x().content,children:[(0,o.jsxs)("div",{className:x().info,children:[P,(0,o.jsx)(w,{className:(0,r.W)(x().title,{[x().title_withDisclaimerLabel]:A}),title:a,"aria-labelledby":t,canChange:C,maxTitleLength:h,onChange:m,version:E,onVersionClick:f}),!!n&&(0,o.jsx)("div",{className:(0,r.W)(x().meta,{[x().meta_withDisclaimerLabel]:A}),children:n})]}),(0,o.jsx)("div",{className:x().controls,children:s})]})]})}),M=(0,l.forwardRef)((e,t)=>(0,o.jsx)(R,{forwardRef:t,...e}));var H=i(86252),k=i.n(H);let j=e=>{let{coverVariant:t,coverUri:i,isAvailable:a,className:r,withBookmateBadge:n}=e;return(0,o.jsxs)(p.Paper,{radius:"round"===t?"round":"m",className:r,children:[(0,o.jsx)(A.BE,{fit:"cover",src:i,size:300,className:k().coverImage,withAvatarReplace:!0,isAvailable:a}),n&&(0,o.jsx)(m.J,{variant:"bookmateBadge",className:k().bookmateBadge})]})};var B=i(89998),Z=i.n(B);let I=(0,n.Pi)(e=>{var t,i,a;let n,{album:s,className:L,"aria-labelledby":x,forwardRef:b,onVersionClick:g}=e,N=(0,y.x5)({pageId:y.Rh.ALBUM,blockId:y.aU.ALBUM}),{formatMessage:V}=(0,d.Z)(),{settings:S,sonataState:{status:T,unloadedEntitiesData:w},experiments:R}=(0,y.oR)(),[H,k]=(0,l.useState)(!1),B=(0,f.SB)(s),I=(0,f.BV)(s),O=S.layout===y.t8.Mobile,q=R.checkExperiment(y.pe.WebPins,"on")&&!O,D=(0,f.TL)(s),U=(0,y.uK)(),z=U.get(y.U5),F=z.features.nonMusic&&s.isPodcast;F&&(n=s.isLiked?V({id:"interface-actions.subscribed"}):V({id:"interface-actions.subscribe"}));let W=(0,l.useMemo)(()=>P(s.artists),[s.artists]),Y=(null==W?void 0:W.length)===1&&!(null===(t=W[0])||void 0===t?void 0:t.decomposed)&&!(null===(i=W[0])||void 0===i?void 0:i.various),G=(0,f.H0)(s.type),{isPlaying:K,togglePlay:J}=(0,y.qm)({playContextParams:{contextData:{type:C.Ak.Album,meta:{id:s.id},from:N},loadContextMeta:!0,entitiesData:w},sonataStatus:T}),$=(0,o.jsxs)("div",{className:Z().meta,children:[Y&&(0,o.jsx)(p.Paper,{radius:"round",className:Z().artistCover,children:(0,o.jsx)(A.BE,{src:null===(a=W[0])||void 0===a?void 0:a.coverUri,size:30,withAvatarReplace:!0})}),(0,o.jsx)(_.jO,{artists:W,lineClamp:O?1:void 0,className:Z().artists,spoilerClassName:Z().artistsSpoiler,visibleArtistsCount:O?void 0:2,linkClassName:Z().artistLink,captionClassName:Z().artistLabel,variant:O?"breakAll":"breakWord"}),s.year&&(0,o.jsx)(v.Caption,{variant:"div",type:"text",size:"m",weight:"medium",className:(0,r.W)(Z().year,{[Z().year_dot]:W.length>0}),...(0,c.BA)(c.QM.pageHeader.ALBUM_RELEASE_DATE),children:s.year})]}),X=(0,l.useMemo)(()=>O?(0,o.jsx)(A.JM,{className:Z().playControl,color:"primary",buttonVariant:"default",iconSize:"xxl",isPlaying:K,onClick:J,variant:"filled",disabled:!s.isAvailable}):(0,o.jsx)(A.JM,{className:Z().playControl,withRipple:!0,buttonVariant:"default",radius:"xxxl",size:"s",color:"primary",iconSize:"xxs",isPlaying:K,onClick:J,disabled:!s.isAvailable,children:(0,o.jsx)(u.Z,{id:"player-actions.listen"})}),[s.isAvailable,O,K,J]),Q=(0,l.useMemo)(()=>{let e=O?"l":"s",t=O?"m":"xxs";return(0,o.jsxs)("div",{className:Z().controls,children:[X,(0,o.jsx)(A.dJ,{className:Z().likeControl,isLiked:s.isLiked,onClick:B,variant:"default",size:e,iconSize:t,iconClassName:Z().likeIcon,withRipple:!O,disabled:!s.isAvailable,"aria-label":n}),q&&(0,o.jsx)(A.RT,{onClick:I,isPinned:s.isPinned,isDisabled:!s.isAvailable,className:Z().pinControl}),(0,o.jsx)(E.oK,{album:s,open:H,onOpenChange:k,reference:(0,o.jsx)(h.z,{className:Z().menuControl,size:e,radius:"round",withRipple:!O,"aria-label":V({id:"interface-actions.context-menu"}),icon:(0,o.jsx)(m.J,{size:t,variant:"more"}),...(0,c.BA)(c.QM.pageHeader.ALBUM_HEADER_CONTEXT_MENU)})})]})},[O,X,s,B,n,q,I,H,V]),ee=(0,l.useMemo)(()=>{if(D)return(0,o.jsx)(m.J,{variant:"bookmateLogo",className:Z().bookmateLogo})},[D]);return(0,o.jsx)(M,{ref:b,className:L,controls:Q,meta:$,entityName:G,entityNameIcon:ee,title:s.title,cover:(0,o.jsx)(j,{coverVariant:"square",coverUri:s.coverUri,isAvailable:s.isAvailable,withBookmateBadge:D}),"aria-labelledby":x,version:s.version,onVersionClick:g})}),O=(0,l.forwardRef)((e,t)=>(0,o.jsx)(I,{forwardRef:t,...e}));var q=i(34603),D={5881:(e,t,i)=>{function a(){for(var e,t,i=0,a="";ia,default:()=>o});let o=a},5025:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root:"LizdJ2L0HW7JWOvPrfly"}},435:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root_controls_xxs:"tRaaBpDMg9Qu8v6gKjtn",root_entity_xxs:"M9zvtlcpLUVn6DKdcHhj",root_text_xxs:"ln0PYYwDmFnfYxCDJsFU",root_controls_xs:"n5AeWEsJC3_AYXcbK4Lt",root_entity_xs:"__hrMKGmNbw54T54IUyh",root_text_xs:"SehSa7OyRpC2nzYTVb2Q",root_controls_s:"_oBLf5gprWsKjCw4Ce58",root_entity_s:"mxSPe5xpZnie9gpIqacd",root_text_s:"Ai2iRN9elHpk_u5splD6",root_controls_m:"tk7ahHRDYXJMMB879KUA",root_entity_m:"Z_WIr2W8JU4MPQek3hgR",root_text_m:"g3qWNP6xl__7qxNmtrvd",root_controls_l:"grvxapJE3vGArOKDWf6n",root_entity_l:"Esj5A1UeSi4xV4tZ839D",root_text_l:"V3WU123oO65AxsprotU9",root_weight_normal:"ZYV27jeWd30QDXu4GhaH",root_weight_medium:"_3_Mxw7Si7j2g4kWjlpR",root_weight_bold:"Vi7Rd0SZWqD17F0872TB"}},5668:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root_size_xs:"qJJ288377iHlWN_RXeEE",root_size_s:"_sd8Q9d_Ttn0Ufe4ISWS",root_size_m:"Ctk8dbecq31Qh7isOJPQ",root_size_l:"M_Djh6ppIkCO3A2k_BTA",root_size_xl:"dtxlzGQMPAbM2MEndXWX",root_size_xxl:"IUb9XLplTAoZqne9rNUL",root_size_xxxl:"ZYZamUwql_rfFR4RpI2B",root_size_xxxxl:"ZBZyxow5njdq8z5dnRPY",root_weight_bold:"nSU6fV9y80WrZEfafvww",root_weight_black:"KBeGPPK4DinQzAP41Y_N"}},3594:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root:"_MWOVuZRvUQdXKTMcOPx",root_clamp:"LezmJlldtbHWqU7l1950",root_clamp_oneline:"oyQL2RSmoNbNQf3Vc6YI",root_clamp_multiline:"jMyoZB5J9iZbzJmWOrF0"}},6161:(e,t,i)=>{/** + * @license React + * react-jsx-runtime.production.min.js + *