(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,229734,(e,t,r)=>{let o,s,i;var l=Object.create,a=Object.defineProperty,n=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,p=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,d=(e,t,r,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of u(t))h.call(e,s)||s===r||a(e,s,{get:()=>t[s],enumerable:!(o=n(t,s))||o.enumerable});return e},c=(e,t,r)=>{let o;return(o="symbol"!=typeof t?t+"":t)in e?a(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r,r},y={},m={default:()=>O};for(var f in m)a(y,f,{get:m[f],enumerable:!0});t.exports=d(a({},"__esModule",{value:!0}),y);var b=(i=null!=(o=e.r(271645))?l(p(o)):{},d(!s&&o&&o.__esModule?i:a(i,"default",{value:o,enumerable:!0}),o)),P=e.r(762406),g=e.r(933066);class O extends b.Component{constructor(){super(...arguments),c(this,"callPlayer",P.callPlayer),c(this,"duration",null),c(this,"currentTime",null),c(this,"fractionLoaded",null),c(this,"mute",()=>{this.setVolume(0)}),c(this,"unmute",()=>{null!==this.props.volume&&this.setVolume(this.props.volume)}),c(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,t){(0,P.getSDK)("https://w.soundcloud.com/player/api.js","SC").then(r=>{if(!this.iframe)return;let{PLAY:o,PLAY_PROGRESS:s,PAUSE:i,FINISH:l,ERROR:a}=r.Widget.Events;t||(this.player=r.Widget(this.iframe),this.player.bind(o,this.props.onPlay),this.player.bind(i,()=>{this.duration-this.currentTime<.05||this.props.onPause()}),this.player.bind(s,e=>{this.currentTime=e.currentPosition/1e3,this.fractionLoaded=e.loadedProgress}),this.player.bind(l,()=>this.props.onEnded()),this.player.bind(a,e=>this.props.onError(e))),this.player.load(e,{...this.props.config.options,callback:()=>{this.player.getDuration(e=>{this.duration=e/1e3,this.props.onReady()})}})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("seekTo",1e3*e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",100*e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.fractionLoaded*this.duration}render(){let{display:e}=this.props;return b.default.createElement("iframe",{ref:this.ref,src:`https://w.soundcloud.com/player/?url=${encodeURIComponent(this.props.url)}`,style:{width:"100%",height:"100%",display:e},frameBorder:0,allow:"autoplay"})}}c(O,"displayName","SoundCloud"),c(O,"canPlay",g.canPlay.soundcloud),c(O,"loopOnEnded",!0)}]);