import{i as S,k as q,n as E,o as L}from"../depicter-editor.js";function T(u,i){for(var p=0;p<i.length;p++){const a=i[p];if(typeof a!="string"&&!Array.isArray(a)){for(const n in a)if(n!=="default"&&!(n in u)){const c=Object.getOwnPropertyDescriptor(a,n);c&&Object.defineProperty(u,n,c.get?c:{enumerable:!0,get:()=>a[n]})}}}return Object.freeze(Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}))}var y,v;function C(){if(v)return y;v=1;var u=Object.create,i=Object.defineProperty,p=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,n=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,O=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,M=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},_=(t,e,r,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of a(e))!c.call(t,s)&&s!==r&&i(t,s,{get:()=>e[s],enumerable:!(l=p(e,s))||l.enumerable});return t},b=(t,e,r)=>(r=t!=null?u(n(t)):{},_(!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),x=t=>_(i({},"__esModule",{value:!0}),t),o=(t,e,r)=>(O(t,typeof e!="symbol"?e+"":e,r),r),f={};M(f,{default:()=>d}),y=x(f);var m=b(S()),h=q(),g=E();const w="https://widget.mixcloud.com/media/js/widgetApi.js",j="Mixcloud";class d extends m.Component{constructor(){super(...arguments),o(this,"callPlayer",h.callPlayer),o(this,"duration",null),o(this,"currentTime",null),o(this,"secondsLoaded",null),o(this,"mute",()=>{}),o(this,"unmute",()=>{}),o(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,h.getSDK)(w,j).then(r=>{this.player=r.PlayerWidget(this.iframe),this.player.ready.then(()=>{this.player.events.play.on(this.props.onPlay),this.player.events.pause.on(this.props.onPause),this.player.events.ended.on(this.props.onEnded),this.player.events.error.on(this.props.error),this.player.events.progress.on((l,s)=>{this.currentTime=l,this.duration=s}),this.props.onReady()})},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return null}render(){const{url:e,config:r}=this.props,l=e.match(g.MATCH_URL_MIXCLOUD)[1],s={width:"100%",height:"100%"},D=(0,h.queryString)({...r.options,feed:`/${l}/`});return m.default.createElement("iframe",{key:l,ref:this.ref,style:s,src:`https://www.mixcloud.com/widget/iframe/?${D}`,frameBorder:"0",allow:"autoplay"})}}return o(d,"displayName","Mixcloud"),o(d,"canPlay",g.canPlay.mixcloud),o(d,"loopOnEnded",!0),y}var P=C();const N=L(P),R=T({__proto__:null,default:N},[P]);export{R as M};
