translation-waveform-audio
Version:
Waveform react audioplayer
1 lines • 98.9 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-motion"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-motion","react-dom"],t):"object"==typeof exports?exports.ReactAudioplayer=t(require("react"),require("react-motion"),require("react-dom")):e.ReactAudioplayer=t(e.React,e.ReactMotion,e.ReactDOM)}(this,function(e,t,n){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="build/",t(t.s=41)}([function(t,n){t.exports=e},function(e,t,n){e.exports=n(48)()},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),s=n(0),u=o(s),d=n(1),c=o(d),f=n(42),m=n(3),p=function(e){function t(e){r(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={mouseOver:!1},n}return l(t,e),i(t,[{key:"render",value:function(){var e=this,t=(0,f.combineClassNames)(m.svgBtnDefault,this.props.className);return u.default.createElement("button",{className:t,onClick:this.props.onClick,onMouseOver:function(){e.setState({mouseOver:!0})},onMouseOut:function(){e.setState({mouseOver:!1})},style:{border:this.state.mouseOver?".5px solid "+this.context.color:null}},this.props.children)}}]),t}(u.default.PureComponent);Object.defineProperty(p,"propTypes",{enumerable:!0,writable:!0,value:{onClick:c.default.func}}),Object.defineProperty(p,"defaultProps",{enumerable:!0,writable:!0,value:{onClick:null}}),p.contextTypes={color:c.default.string},t.default=p},function(e,t,n){var o=n(44);"string"==typeof o&&(o=[[e.i,o,""]]);n(6)(o,{});o.locals&&(e.exports=o.locals)},function(e,n){e.exports=t},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t];n[2]?e.push("@media "+n[2]+"{"+n[1]+"}"):e.push(n[1])}return e.join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var o={},r=0;r<this.length;r++){var a=this[r][0];"number"==typeof a&&(o[a]=!0)}for(r=0;r<t.length;r++){var l=t[r];"number"==typeof l[0]&&o[l[0]]||(n&&!l[2]?l[2]=n:n&&(l[2]="("+l[2]+") and ("+n+")"),e.push(l))}},e}},function(e,t){function n(e,t){for(var n=0;n<e.length;n++){var o=e[n],r=f[o.id];if(r){r.refs++;for(var a=0;a<r.parts.length;a++)r.parts[a](o.parts[a]);for(;a<o.parts.length;a++)r.parts.push(s(o.parts[a],t))}else{for(var l=[],a=0;a<o.parts.length;a++)l.push(s(o.parts[a],t));f[o.id]={id:o.id,refs:1,parts:l}}}}function o(e){for(var t=[],n={},o=0;o<e.length;o++){var r=e[o],a=r[0],l=r[1],i=r[2],s=r[3],u={css:l,media:i,sourceMap:s};n[a]?n[a].parts.push(u):t.push(n[a]={id:a,parts:[u]})}return t}function r(e,t){var n=h(),o=y[y.length-1];if("top"===e.insertAt)o?o.nextSibling?n.insertBefore(t,o.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),y.push(t);else{if("bottom"!==e.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(t)}}function a(e){e.parentNode.removeChild(e);var t=y.indexOf(e);t>=0&&y.splice(t,1)}function l(e){var t=document.createElement("style");return t.type="text/css",r(e,t),t}function i(e){var t=document.createElement("link");return t.rel="stylesheet",r(e,t),t}function s(e,t){var n,o,r;if(t.singleton){var s=v++;n=b||(b=l(t)),o=u.bind(null,n,s,!1),r=u.bind(null,n,s,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=i(t),o=c.bind(null,n),r=function(){a(n),n.href&&URL.revokeObjectURL(n.href)}):(n=l(t),o=d.bind(null,n),r=function(){a(n)});return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else r()}}function u(e,t,n,o){var r=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=_(t,r);else{var a=document.createTextNode(r),l=e.childNodes;l[t]&&e.removeChild(l[t]),l.length?e.insertBefore(a,l[t]):e.appendChild(a)}}function d(e,t){var n=t.css,o=t.media;if(o&&e.setAttribute("media",o),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function c(e,t){var n=t.css,o=t.sourceMap;o&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var r=new Blob([n],{type:"text/css"}),a=e.href;e.href=URL.createObjectURL(r),a&&URL.revokeObjectURL(a)}var f={},m=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}},p=m(function(){return/msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())}),h=m(function(){return document.head||document.getElementsByTagName("head")[0]}),b=null,v=0,y=[];e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");t=t||{},void 0===t.singleton&&(t.singleton=p()),void 0===t.insertAt&&(t.insertAt="bottom");var r=o(e);return n(r,t),function(e){for(var a=[],l=0;l<r.length;l++){var i=r[l],s=f[i.id];s.refs--,a.push(s)}if(e){n(o(e),t)}for(var l=0;l<a.length;l++){var s=a[l];if(0===s.refs){for(var u=0;u<s.parts.length;u++)s.parts[u]();delete f[s.id]}}}};var _=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t,n){var o=n(43);"string"==typeof o&&(o=[[e.i,o,""]]);n(6)(o,{});o.locals&&(e.exports=o.locals)},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=o(r),l=n(1),i=o(l),s=function(e,t){var n=e.width,o=e.height,r=e.translate,l=e.visibility,i=e.onMouseDown,s=t.color;return a.default.createElement("g",{visibility:l?"visible":"hidden",transform:r,onMouseDown:i},a.default.createElement("rect",{x:0,y:"0",width:n,height:o,fill:s}),a.default.createElement("rect",{x:n/3,y:o/3,width:n/3,height:o/3,fill:"#000"}))};s.propTypes={width:i.default.number.isRequired,height:i.default.number.isRequired,translate:i.default.string.isRequired,onMouseDown:i.default.func.isRequired},s.contextTypes={color:i.default.string},t.default=s},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=o(r),l=n(1),i=o(l),s=n(2),u=o(s),d=function(e,t){return a.default.createElement(u.default,e,a.default.createElement("svg",{version:"1.0",xmlns:"http://www.w3.org/2000/svg",width:"25px",height:"25px",viewBox:"10 0 999.000000 1665.000000",preserveAspectRatio:"xMidYMid meet"},a.default.createElement("g",{transform:"translate(0.000000,1665.000000) scale(0.100000,-0.100000)",fill:""+t.color,stroke:"none"},a.default.createElement("path",{d:"M4060 16635 c-792 -124 -1462 -729 -1670 -1509 -64 -238 -60 16 -60\n-3805 0 -3835 -4 -3562 61 -3807 92 -348 273 -658 539 -924 310 -310 709 -515\n1130 -582 122 -19 1736 -19 1860 0 217 34 400 92 592 187 547 272 965 793\n1098 1368 11 48 20 90 20 92 0 3 -445 5 -990 5 l-990 0 0 330 0 330 1005 0\n1005 0 0 340 0 340 -1005 0 -1005 0 0 325 0 325 1005 0 1005 0 0 340 0 340\n-1005 0 -1005 0 0 325 0 325 1005 0 1005 0 0 340 0 340 -1005 0 -1005 0 0 330\n0 330 1005 0 1005 0 0 335 0 335 -1005 0 -1005 0 0 330 0 330 1005 0 1005 0 0\n335 0 335 -1005 0 -1005 0 0 330 0 330 990 0 c785 0 990 3 990 13 0 25 -59\n235 -91 322 -96 265 -297 568 -510 770 -318 301 -692 487 -1107 550 -140 21\n-1728 21 -1862 0z"}),a.default.createElement("path",{d:"M3 8973 c4 -1467 1 -1395 58 -1713 118 -664 394 -1292 811 -1845 602\n-798 1454 -1373 2401 -1620 307 -80 697 -135 955 -135 l92 0 0 -1160 0 -1160\n-1415 0 -1415 0 0 -670 0 -670 3505 0 3505 0 0 670 0 670 -1415 0 -1415 0 0\n1160 0 1160 93 0 c106 0 371 23 515 45 889 134 1718 549 2386 1195 659 638\n1107 1474 1265 2360 57 318 54 246 58 1713 l4 1357 -670 0 -670 0 -4 -1312\nc-3 -1417 -1 -1344 -57 -1615 -130 -628 -489 -1233 -985 -1660 -468 -404\n-1010 -646 -1615 -724 -152 -20 -1838 -20 -1990 0 -605 78 -1147 320 -1615\n724 -496 427 -855 1032 -985 1660 -56 271 -54 198 -57 1615 l-4 1312 -670 0\n-670 0 4 -1357z"}))))};d.contextTypes={color:i.default.string},t.default=d},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.RecordBtn=t.CloseBtn=t.CommentSendBtn=t.CommentStartBtn=t.VolumeMutedBtn=t.VolumeLowBtn=t.VolumeHighBtn=t.SkipPrevBtn=t.SkipNextBtn=t.PlaylistBtn=t.PauseBtn=t.PlayBtn=t.ShuffleBtn=t.RepeatBtn=t.CycleBtn=t.LikeBtn=void 0;var r=n(30),a=o(r),l=n(29),i=o(l),s=n(34),u=o(s),d=n(35),c=o(d),f=n(32),m=o(f),p=n(31),h=o(p),b=n(33),v=o(b),y=n(36),_=o(y),g=n(37),x=o(g),w=n(38),C=o(w),E=n(39),k=o(E),W=n(40),B=o(W),Q=n(28),L=o(Q),O=n(27),M=o(O),Z=n(26),F=o(Z),j=n(9),P=o(j);t.LikeBtn=a.default,t.CycleBtn=i.default,t.RepeatBtn=u.default,t.ShuffleBtn=c.default,t.PlayBtn=m.default,t.PauseBtn=h.default,t.PlaylistBtn=v.default,t.SkipNextBtn=_.default,t.SkipPrevBtn=x.default,t.VolumeHighBtn=C.default,t.VolumeLowBtn=k.default,t.VolumeMutedBtn=B.default,t.CommentStartBtn=L.default,t.CommentSendBtn=M.default,t.CloseBtn=F.default,t.RecordBtn=P.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u=n(0),d=o(u),c=n(1),f=o(c),m=n(18),p=o(m),h=n(15),b=o(h),v=n(19),y=o(v),_=n(50),g=o(_),x=n(7),w=o(x),C=function(e){function t(){return r(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),s(t,[{key:"getChildContext",value:function(){return{color:this.props.color}}},{key:"render",value:function(){var e=this.props,t=e.showMarkers,n=e.markers,o=e.width,r=e.name,a=e.fullPlayer,l=e.comment,s=e.volumeOrientationDown,u=e.recordButton,c=e.CommentsWrapperStates,f=e.controlStates,m=e.controlCallbacks,p=e.timelineStates,h=e.timelineCallbacks,v=a?this.props.height:52,_=i({},{width:o+"px",height:v+"px"},this.props.style),x=parseInt(_.width),C=parseInt(_.height);return d.default.createElement("div",{className:g.default.rootContainer+" "+w.default.audio,style:_},a?d.default.createElement(b.default,i({comment:l,width:x,height:C-52,progress:p.progress},c)):null,d.default.createElement(y.default,{width:x,name:r,comment:l,buttonRecord:u,volumeOrientationDown:s,controlStates:f,controlCallbacks:m,timelineStates:p,timelineCallbacks:h,mic:this.props.mic,markers:n,showMarkers:t}))}}]),t}(d.default.PureComponent);Object.defineProperty(C,"propTypes",{enumerable:!0,writable:!0,value:{showMarkers:f.default.bool,markers:f.default.object,width:f.default.number,height:f.default.number,fullPlayer:f.default.bool,recordButton:f.default.func,comment:f.default.bool,volumeOrientationDown:f.default.bool,color:f.default.string,buttonRecord:f.default.func,CommentsWrapperStates:f.default.shape({songImageSrc:f.default.string}),controlStates:f.default.shape({playing:f.default.bool,playingState:f.default.oneOf([0,1,2]),volume:f.default.number}),controlCallbacks:f.default.shape({setVolume:f.default.func,togglePlayPause:f.default.func,togglePlayingState:f.default.func,skipToNext:f.default.func,skipToPrevious:f.default.func}),timelineStates:f.default.shape({title:f.default.string,playing:f.default.bool,progress:f.default.number,duration:f.default.number}),timelineCallbacks:f.default.shape({setProgress:f.default.func,togglePlayPause:f.default.func})}}),Object.defineProperty(C,"defaultProps",{enumerable:!0,writable:!0,value:{width:700,height:300,songImage:!1,color:"#212121",fullPlayer:!1,recordButton2:!1,comment:!1,volumeOrientationDown:!1,onCommentSubmit:null,record:null}}),Object.defineProperty(C,"childContextTypes",{enumerable:!0,writable:!0,value:{color:f.default.string}}),t.default=(0,p.default)(C)},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=o(r),l=n(7),i=o(l),s=function(e){var t=e.children,n={width:50*a.default.Children.count(t)+"px"};return a.default.createElement("div",{className:i.default.flexButtonBox,style:n},t)};t.default=s},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u=n(0),d=o(u),c=n(4),f=n(3),m=o(f),p=function(e){function t(e){r(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={full:!1,hover:!1},n.onClick=n.onClick.bind(n),n.onMouseOver=n.onMouseOver.bind(n),n.onMouseOut=n.onMouseOut.bind(n),n}return l(t,e),s(t,[{key:"onClick",value:function(){this.setState({full:!this.state.full})}},{key:"onMouseOver",value:function(){this.setState({hover:!0})}},{key:"onMouseOut",value:function(){this.setState({hover:!1})}},{key:"getMotionStyle",value:function(){return this.state.hover?{opacity:(0,c.spring)(1)}:{opacity:(0,c.spring)(.8)}}},{key:"getStyle",value:function(e){return i({},this.props.style,{transform:"translate3d(0, -"+e.y+"px, 0)",backgroundColor:"rgba(255, 255, 255, "+e.opacity+")"})}},{key:"render",value:function(){var e=this;return d.default.createElement(c.Motion,{style:this.getMotionStyle()},function(t){return d.default.createElement("p",{className:m.default.comment,style:e.getStyle(t),onClick:e.onClick,onMouseOver:e.onMouseOver,onMouseOut:e.onMouseOut},e.props.content)})}}]),t}(d.default.Component);t.default=p},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),s=n(0),u=o(s),d=n(1),c=o(d),f=n(4),m=n(13),p=o(m),h=function(e){function t(e){r(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={visibleComments:[],commentHeight:32,scroll:!0,clearScreen:!1},n.willLeave=n.willLeave.bind(n),n.onMouseEnter=n.onMouseEnter.bind(n),n.onMouseLeave=n.onMouseLeave.bind(n),n}return l(t,e),i(t,[{key:"componentWillReceiveProps",value:function(e){var t=e.height,n=e.progress,o=e.comments,r=o.filter(function(e){return n>=e.time}).sort(this.sortComments),a=r.length;if(0===a)return this.setState({visibleComments:[]});var l=Math.floor(t/this.state.commentHeight);return a>l?this.setState({visibleComments:r.slice(a-l,a)}):this.setState({visibleComments:r})}},{key:"shouldComponentUpdate",value:function(){return this.state.scroll}},{key:"onMouseEnter",value:function(){this.setState({scroll:!1})}},{key:"onMouseLeave",value:function(){this.setState({scroll:!0})}},{key:"sortComments",value:function(e,t){return e.time<t.time?-1:e.time>t.time?1:0}},{key:"willEnter",value:function(){return{height:0,opacity:0}}},{key:"willLeave",value:function(){return this.state.clearScreen?null:{height:(0,f.spring)(0),opacity:(0,f.spring)(0),fontSize:0}}},{key:"render",value:function(){var e=this;return u.default.createElement(f.TransitionMotion,{willEnter:this.willEnter,willLeave:this.willLeave,styles:this.state.visibleComments.map(function(t){return{key:""+t.time,data:t.content,style:{height:(0,f.spring)(e.state.commentHeight),opacity:(0,f.spring)(1)}}})},function(t){return u.default.createElement("div",{className:e.props.className,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave},t.map(function(e){return u.default.createElement(p.default,{key:e.key,content:e.data,style:e.style})}))})}}]),t}(u.default.Component);Object.defineProperty(h,"propTypes",{enumerable:!0,writable:!0,value:{className:c.default.string,height:c.default.number,progress:c.default.number}}),t.default=h},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),s=n(0),u=o(s),d=n(1),c=o(d),f=n(14),m=o(f),p=n(17),h=o(p),b=n(3),v=o(b),y=function(e){function t(e){r(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={fullComment:!1,fullCommentTextNode:null},n.onClickComment=n.onClickComment.bind(n),n.documentClickHandler=n.documentClickHandler.bind(n),n}return l(t,e),i(t,[{key:"componentDidMount",value:function(){if(this.props.comment){document.querySelector("."+v.default.commentsContainer).addEventListener("click",this.onClickComment)}}},{key:"onClickComment",value:function(e){var t=e.target;if("p"===t.tagName.toLowerCase()){if(!this.state.fullComment)return this.setState({fullComment:!0,fullCommentTextNode:t.firstChild}),document.addEventListener("click",this.documentClickHandler);if(t.firstChild===this.state.fullCommentTextNode)return document.removeEventListener("click",this.documentClickHandler),this.setState({fullComment:!1});this.setState({fullCommentTextNode:t.firstChild})}}},{key:"documentClickHandler",value:function(e){document.querySelector("."+v.default.commentsContainer).contains(e.target)||(this.setState({fullComment:!1}),document.removeEventListener(e.type,this.documentClickHandler))}},{key:"render",value:function(){var e=this.props,t=e.songImageSrc,n=e.width,o=e.height,r=e.progress,a=e.comments,l=e.comment,i=Math.min(.4*n,o)-40;return u.default.createElement("div",{className:v.default.commentsWrapper,style:{height:o+"px"}},u.default.createElement("section",{className:v.default.albumCoverContainer},u.default.createElement("div",{className:v.default.coverWrapper,style:{width:i+"px",height:i+"px"}},u.default.createElement("img",{src:t,alt:"Album cover"}),l?u.default.createElement(h.default,{className:v.default.fullComment,show:this.state.fullComment,content:this.state.fullCommentTextNode}):null)),l?u.default.createElement(m.default,{className:v.default.commentsContainer,height:o,progress:r,comments:a}):null,u.default.createElement("div",{className:v.default.commentsWrapperBackgroundMask}),u.default.createElement("div",{className:v.default.commentsWrapperBackground,style:{backgroundImage:"url("+t+")"}}))}}]),t}(u.default.PureComponent);Object.defineProperty(y,"propTypes",{enumerable:!0,writable:!0,value:{songImageSrc:c.default.string.isRequired,width:c.default.number,height:c.default.number,comment:c.default.bool}}),Object.defineProperty(y,"defaultProps",{enumerable:!0,writable:!0,value:{songImageSrc:"",height:340}}),t.default=y},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=o(r),l=n(1),i=o(l),s=n(10),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(s),d=n(25),c=o(d),f=n(12),m=o(f),p=function(e){var t=e.playing,n=e.volume,o=e.playingState,r=e.setVolume,l=e.togglePlayPause,i=(e.record,e.skipToNext,e.skipToPrevious,e.volumeOrientationDown),s=void 0;switch(t){case!0:s=u.PauseBtn;break;case!1:s=u.PlayBtn}switch(o){case 0:u.CycleBtn;break;case 1:u.RepeatBtn;break;case 2:u.ShuffleBtn}return a.default.createElement(m.default,null,a.default.createElement(s,{onClick:l}),a.default.createElement(c.default,{volume:n,setVolume:r,volumeOrientationDown:i}))};p.propTypes={playing:i.default.bool.isRequired,volume:i.default.number.isRequired,playingState:i.default.number.isRequired,setVolume:i.default.func.isRequired,togglePlayPause:i.default.func.isRequired,togglePlayingState:i.default.func.isRequired,skipToNext:i.default.func.isRequired,skipToPrevious:i.default.func.isRequired,record:i.default.bool.isRequired},t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=function(e){return e&&e.__esModule?e:{default:e}}(o),a=n(4),l=function(e){var t=e.show,n=e.className,o=e.content;return r.default.createElement(a.Motion,{style:{y:(0,a.spring)(t?0:100),yc:(0,a.spring)(t?0:100),o:(0,a.spring)(t?1:0)}},function(e){var t=e.y,a=e.yc,l=e.o;return r.default.createElement("div",{className:n,style:{transform:"translate3d(0, "+t+"%, 0)",opacity:""+l}},r.default.createElement("p",{className:"testppp",style:{transform:"translate3d(0, "+a+"%, 0)"}},o?o.nodeValue:null))})};t.default=l},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),d=n(0),c=o(d),f=n(52),m=o(f),p=n(1),h=o(p),b=function(e){var t,n;return n=t=function(t){function n(e){a(this,n);var t=l(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));if(!t.props.playlist||0===t.props.playlist.length)throw new Error("You should provide a playlist which contains at least 1 audio object");t.props.fullPlayer&&t.props.playlist.forEach(function(e){if(!e.img)throw new Error("You should provide song.img when the fullPlayer is enabled.");if(t.props.comment&&!e.comments)throw new Error("You turned on commenting function and you need to provide the `comments` field for each song in the playlist")}),t.loadSrc=t.loadSrc.bind(t),t.togglePlayPause=t.togglePlayPause.bind(t),t.onCanPlay=t.onCanPlay.bind(t),t.onEnded=t.onEnded.bind(t),t.onPlay=t.onPlay.bind(t),t.onPause=t.onPause.bind(t),t.setVolume=t.setVolume.bind(t),t.setProgress=t.setProgress.bind(t),t.skipToNext=t.skipToNext.bind(t),t.skipToPrevious=t.skipToPrevious.bind(t),t.togglePlayingState=t.togglePlayingState.bind(t),t.playEventHandler=t.playEventHandler.bind(t),t.pauseEventHandler=t.pauseEventHandler.bind(t),t.skipToNextEventHandler=t.skipToNextEventHandler.bind(t),t.skipToPreviousEventHandler=t.skipToPreviousEventHandler.bind(t);var o=Math.ceil(e.playlist.length/2);return t.state={playing:!1,currentPlaylistPos:0,playingState:0,progress:0,duration:0,volume:1,shuffleState:{size:o,drawPile:[].concat(r(Array(e.playlist.length).keys())),discardPile:[]}},t}return i(n,t),u(n,[{key:"onCanPlay",value:function(){this.setState({duration:this.audioElement.duration})}},{key:"onPlay",value:function(){var e=this;this.playNext=!0,this.setState({playing:!0}),this.intervalId=setInterval(function(){e.setState({progress:e.audioElement.currentTime})},900)}},{key:"onPause",value:function(){this.setState({playing:!1}),this._clearInterval()}},{key:"onEnded",value:function(){this.playNext&&this.handleEndedProgress()}},{key:"handleEndedProgress",value:function(){switch(this.playNext=!0,this.state.playingState){case 0:this.skipToNext();break;case 1:this.setState({progress:0}),this.audioElement.currentTime=0,this.togglePlayPause();break;case 2:var e=this.state.shuffleState,t=e.drawPile.indexOf(this.state.currentPlaylistPos),n=e.drawPile,o=e.discardPile;-1!==t&&(n.splice(t,1),o.push(this.state.currentPlaylistPos));var r=Math.floor(Math.random()*e.drawPile.length),a=n.slice(r,r+1);if(this.setState({currentPlaylistPos:a[0],shuffleState:{size:e.size,drawPile:n,discardPile:o}}),o.length===e.size){var l=o.shift();n.push(l),this.setState({shuffleState:{size:e.size,drawPile:n,discardPile:o}})}this.loadSrc()}}},{key:"setVolume",value:function(e){this.audioElement.volume=e,this.setState({volume:e})}},{key:"setProgress",value:function(e){var t=e,n=this.audioElement.duration;t>n&&(t=n),this.audioElement.currentTime=t,this.setState({progress:t})}},{key:"_clearInterval",value:function(){null!==this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)}},{key:"loadSrc",value:function(){this.state.currentPlaylistPos<this.props.playlist.length&&(this.audioElement.src=this.props.playlist[this.state.currentPlaylistPos].src,this.audioElement.load(),this.playNext&&this.audioElement.play(),this.setState({progress:0}),this._clearInterval())}},{key:"togglePlayPause",value:function(){this.state.playing?this.audioElement.pause():this.audioElement.currentTime===this.audioElement.duration?this.handleEndedProgress():this.audioElement.play()}},{key:"skipToNext",value:function(){this.state.currentPlaylistPos=this.setCycleNumPos(this.state.currentPlaylistPos,1,this.props.playlist.length),this.loadSrc()}},{key:"skipToPrevious",value:function(){this.state.currentPlaylistPos=this.setCycleNumPos(this.state.currentPlaylistPos,-1,this.props.playlist.length),this.loadSrc()}},{key:"togglePlayingState",value:function(){this.setState({playingState:this.setCycleNumPos(this.state.playingState,1,3)})}},{key:"setCycleNumPos",value:function(e,t,n){var o=e+t;return o>=n&&(o-=n),o<0&&(o+=n),o}},{key:"render",value:function(){var t=s({},{name:this.props.playlist[this.state.currentPlaylistPos].name,CommentsWrapperStates:{songImageSrc:this.props.playlist[this.state.currentPlaylistPos].img,comments:this.props.fullPlayer&&this.props.comment?this.props.playlist[this.state.currentPlaylistPos].comments:null,pos:this.state.currentPlaylistPos},controlStates:{playing:this.state.playing,playingState:this.state.playingState,volume:100*this.state.volume},controlCallbacks:{setVolume:this.setVolume,togglePlayPause:this.togglePlayPause,togglePlayingState:this.togglePlayingState,skipToNext:this.skipToNext,skipToPrevious:this.skipToPrevious},timelineStates:{playing:this.state.playing,progress:this.state.progress,duration:this.state.duration},timelineCallbacks:{setProgress:this.setProgress,togglePlayPause:this.togglePlayPause},children:this.props.children},this.props);return c.default.createElement(e,t)}},{key:"playEventHandler",value:function(){this.audioElement.play()}},{key:"pauseEventHandler",value:function(){this.audioElement.pause()}},{key:"skipToNextEventHandler",value:function(){this.skipToNext()}},{key:"skipToPreviousEventHandler",value:function(){this.skipToPrevious()}},{key:"componentDidMount",value:function(){console.log(this),this.audioElement=document.createElement("audio"),this.audioElement.addEventListener("canplay",this.onCanPlay),this.audioElement.addEventListener("ended",this.onEnded),this.audioElement.addEventListener("play",this.onPlay),this.audioElement.addEventListener("pause",this.onPause),this.audioElement.addEventListener("volumechange",this.onVolumeChange),this.loadSrc(),this.setState({volume:this.audioElement.volume}),m.default.findDOMNode(this).addEventListener("audio-play",this.playEventHandler),m.default.findDOMNode(this).addEventListener("audio-pause",this.pauseEventHandler),m.default.findDOMNode(this).addEventListener("audio-skip-to-next",this.skipToNextEventHandler),m.default.findDOMNode(this).addEventListener("audio-skip-to-previous",this.skipToPreviousEventHandler)}},{key:"componentWillUnmount",value:function(){this._clearInterval(),this.audioElement.removeEventListener("canplay",this.onCanPlay),this.audioElement.removeEventListener("ended",this.onEnded),this.audioElement.removeEventListener("play",this.onPlay),this.audioElement.removeEventListener("pause",this.onPause),this.audioElement.removeEventListener("volumechange",this.onVolumeChange),this.audioElement=null,m.default.findDOMNode(this).removeEventListener("audio-play",this.playEventHandler),m.default.findDOMNode(this).removeEventListener("audio-pause",this.pauseEventHandler),m.default.findDOMNode(this).removeEventListener("audio-skip-to-next",this.skipToNextEventHandler),m.default.findDOMNode(this).removeEventListener("audio-skip-to-previous",this.skipToPreviousEventHandler)}}]),n}(c.default.Component),Object.defineProperty(t,"propTypes",{enumerable:!0,writable:!0,value:{playlist:h.default.arrayOf(h.default.shape({name:h.default.string,src:h.default.string,img:h.default.string,comments:h.default.arrayOf(h.default.shape({time:h.default.oneOfType([h.default.number,h.default.string]),content:h.default.string}))})).isRequired}}),n};t.default=b},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u=n(0),d=o(u),c=n(1),f=o(c),m=n(23),p=o(m),h=n(16),b=o(h),v=n(22),y=o(v),_=n(3),g=o(_),x=n(9),w=o(x),C=function(e){function t(e){r(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={progressTime:0},n.updateProgressTime=n.updateProgressTime.bind(n),n}return l(t,e),s(t,[{key:"componentWillReceiveProps",value:function(e){this.setState({progressTime:e.timelineStates.progress})}},{key:"updateProgressTime",value:function(e){this.setState({progressTime:e})}},{key:"render",value:function(){var e=this.props,t=e.showMarkers,n=e.markers,o=e.width,r=e.name,a=(e.comment,e.volumeOrientationDown),l=e.className,s=(e.onCommentSubmit,e.controlStates),u=e.controlCallbacks,c=e.timelineStates,f=e.timelineCallbacks,m=(e.buttonRecord,(g.default.mainPlayer+" "+l).trim());return d.default.createElement("div",{className:m},d.default.createElement("div",{className:g.default.btnStack},d.default.createElement(b.default,i({volumeOrientationDown:a},s,u)),d.default.createElement(p.default,i({showMarkers:t,markers:n,appWidth:o-250,updateProgressTime:this.updateProgressTime},c,f)),this.props.mic?d.default.createElement(w.default,{onClick:this.props.buttonRecord}):"",d.default.createElement("div",{className:g.default.timeNameContainer,style:{color:this.context.color}},d.default.createElement("div",{className:g.default.nameContainer,title:r},r),d.default.createElement("div",{className:g.default.timeContainer},d.default.createElement(y.default,{time:this.state.progressTime}),d.default.createElement("span",null,"/"),d.default.createElement(y.default,{time:c.duration})))))}}]),t}(d.default.Component);Object.defineProperty(C,"propTypes",{enumerable:!0,writable:!0,value:{markers:f.default.object,showMarkers:f.default.bool}}),C.propTypes={className:f.default.string,buttonRecord:f.default.func},C.defaultProps={className:"",buttonRecord:f.default.func},C.contextTypes={color:f.default.string},t.default=C},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),s=n(0),u=o(s),d=n(1),c=o(d),f=function(e){function t(){return r(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),i(t,[{key:"render",value:function(){var e=this.props.text,t=e.length,n="-7",o=this.props.translate;return console.log("position",o),1===t&&(n="-4"),t>2&&(n="-10"),t>3&&(e=""),"translate(0)"===o&&(o="translate(16)"),u.default.createElement("g",{transform:o},u.default.createElement("polygon",{points:"0,10 12,10 12,40 0,30 -12,40 -12,10",style:{fill:"F0FF36",stroke:"504C4C",strokeWidth:.3}}),u.default.createElement("text",{x:n,y:"25",fontFamily:"roboto",fontSize:"11",fill:"#3B3935"},e))}}]),t}(u.default.Component);f.propTypes={translate:c.default.string.isRequired},f.contextTypes={color:c.default.string},t.default=f},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=o(r),l=n(1),i=o(l),s=function(e,t){var n=e.overflow,o=e.width,r=e.height,l=e.barHeight,i=(e.handlerWidth,e.translate),s=(e.duration,e.onMouseDown),u=e.onMouseOver,d=e.onMouseOut,c=e.children,f=t.color,m=(r-l)/2;return a.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:o,height:r,viewBox:"0 0 "+o+" "+r,onMouseOver:u,onMouseOut:d,overflow:n},a.default.createElement("g",{onMouseDown:s},a.default.createElement("rect",{x:0,y:0,width:o,height:r,opacity:"0"}),a.default.createElement("rect",{x:0,y:m,width:o,height:l,fill:"#E0E0E0"}),a.default.createElement("rect",{x:0,y:m,width:i,height:l,fill:f})),c)};s.propTypes={width:i.default.number.isRequired,height:i.default.number.isRequired,barHeight:i.default.number.isRequired,translate:i.default.number.isRequired,onMouseDown:i.default.func.isRequired},s.contextTypes={color:i.default.string},t.default=s},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=o(r),l=n(3),i=o(l),s=function(e){return 0===e?"00":e>=10?""+e:"0"+e},u=function(e,t,n){var o=s(n);return 0===e?t+":"+o:e+":"+s(t)+":"+o},d=function(e){var t=e.time,n=t,o=Math.floor(n/3600);n-=3600*o;var r=Math.floor(n/60);n-=60*r;var l=Math.floor(n),s=u(o,r,l);return a.default.createElement("p",{className:i.default.time},s)};t.default=d},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),s=n(0),u=o(s),d=n(1),c=o(d),f=n(21),m=o(f),p=n(8),h=o(p),b=n(3),v=o(b),y=n(20),_=o(y),g=n(51),x=(o(g),function(e){function t(e){r(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={showHandler:!1,barWidth:e.appWidth<300?300:e.appWidth,translate:0},n.holding=!1,n.shouldTogglePlayPause=n.props.playing,n.changeTranslate=n.changeTranslate.bind(n),n._onMouseDownProgressBar=n._onMouseDownProgressBar.bind(n),n._onMouseOverProgressBar=n._onMouseOverProgressBar.bind(n),n._onMouseOutProgressBar=n._onMouseOutProgressBar.bind(n),n._onMouseDownProgressBarHandler=n._onMouseDownProgressBarHandler.bind(n),n._onMouseUp=n._onMouseUp.bind(n),n.onMouseMoveFunctionRef=null,n}return l(t,e),i(t,[{key:"componentWillReceiveProps",value:function(e){if(0!==e.duration&&!this.holding){var t=this.state.barWidth/e.duration,n=e.progress*t;this.changeTranslate(n),this.shouldTogglePlayPause=e.playing}}},{key:"_onMouseOverProgressBar",value:function(){this.setState({showHandler:!0})}},{key:"_onMouseOutProgressBar",value:function(){this.setState({showHandler:!1})}},{key:"_onMouseDownProgressBar",value:function(e){e.stopPropagation(),this.shouldTogglePlayPause&&this.props.togglePlayPause();var t=e.target.parentNode.getBoundingClientRect().left,n=e.pageX-t;this.changeTranslate(n),this.holding=!0,this.onMouseMoveFunctionRef=this._onMouseMove(e.pageX,n),document.addEventListener("mousemove",this.onMouseMoveFunctionRef),document.addEventListener("mouseup",this._onMouseUp)}},{key:"_onMouseDownProgressBarHandler",value:function(e){e.stopPropagation(),this.holding=!0,this.shouldTogglePlayPause&&this.props.togglePlayPause(),this.onMouseMoveFunctionRef=this._onMouseMove(e.pageX,this.state.translate),document.addEventListener("mousemove",this.onMouseMoveFunctionRef),document.addEventListener("mouseup",this._onMouseUp)}},{key:"_onMouseMove",value:function(e,t){var n=this;return function(o){if(n.holding){var r=o.pageX-e+t;n.changeTranslate(r),n.props.updateProgressTime(n.state.translate/n.state.barWidth*n.props.duration)}}}},{key:"_onMouseUp",value:function(){var e=this;this.shouldTogglePlayPause&&this.props.playing&&setTimeout(function(){return e.props.togglePlayPause()},0),this.shouldTogglePlayPause&&!this.props.playing&&this.props.togglePlayPause(),this.holding=!1,this.props.setProgress(this.state.translate/this.state.barWidth*this.props.duration),document.removeEventListener("mousemove",this.onMouseMoveFunctionRef),document.removeEventListener("mouseup",this._onMouseUp)}},{key:"changeTranslate",value:function(e){var t=e,n=this.state.barWidth;t<0&&(t=0),t>n&&(t=n),this.setState({translate:t})}},{key:"callMarker",value:function(){var e=[],t=this.props.markers;for(var n in t){var o=t[n]/44100/this.props.duration*this.state.barWidth;e.push(u.default.createElement(_.default,{style:{overflow:"visible"},visibility:!0,translate:"translate("+o+")",text:n}))}return e}},{key:"render",value:function(){var e=this.state.barWidth,t=this.state.barWidth;return u.default.createElement("div",{style:{overflow:"visible"}},u.default.createElement("div",{style:{height:10,width:t,transform:"translateY(10px)",overflow:"visible"}},u.default.createElement(m.default,{overflow:"visible",width:t,height:112,barHeight:0,handlerWidth:12,translate:this.state.translate,duration:this.props.duration,onMouseDown:this._onMouseDownProgressBar,onMouseOver:this._onMouseOverProgressBar,onMouseOut:this._onMouseOutProgressBar},this.props.showMarkers?this.callMarker():"")),u.default.createElement("div",{className:v.default.timeLine,style:{height:100,width:e,transform:"translateY(-4px)"}},u.default.createElement(m.default,{width:e,height:12,barHeight:4,handlerWidth:12,translate:this.state.translate,duration:this.props.duration,onMouseDown:this._onMouseDownProgressBar,onMouseOver:this._onMouseOverProgressBar,onMouseOut:this._onMouseOutProgressBar},u.default.createElement(h.default,{width:12,height:12,visibility:this.state.showHandler||this.holding,translate:"translate("+(this.state.translate-6)+")",onMouseDown:this._onMouseDownProgressBarHandler}))))}}]),t}(u.default.Component));Object.defineProperty(x,"propTypes",{enumerable:!0,writable:!0,value:{appWidth:c.default.number.isRequired,duration:c.default.number.isRequired}}),t.default=x},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=o(r),l=n(1),i=o(l),s=function(e,t){var n=e.width,o=e.height,r=e.barWidth,l=(e.handlerWidth,e.handlerHeight),i=e.translate,s=e.onClick,u=e.children,d=t.color,c=(n-r)/2;return a.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:o,viewBox:"0 0 "+n+" "+o},a.default.createElement("g",{onClick:s},a.default.createElement("rect",{x:c,y:l/2,width:r,height:o-l,fill:d}),a.default.createElement("rect",{x:c,y:l/2,width:r,height:i,fill:"#E0E0E0"})),u)};s.propTypes={width:i.default.number.isRequired,height:i.default.number.isRequired,barWidth:i.default.number.isRequired,translate:i.default.number.isRequired,onClick:i.default.func.isRequired},s.contextTypes={color:i.default.string},t.default=s},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),s=n(0),u=o(s),d=n(1),c=o(d),f=n(4),m=n(10),p=n(8),h=o(p),b=n(24),v=o(b),y=n(7),_=o(y),g=function(e){function t(e){r(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={mouseOverBox:!1,translate:e.volume,volume:e.volume,mutedVolume:100},n.handlerWidth=12,n.handlerHeight=12,n.svgWidth=12,n.svgHeight=72,n.volumeWidth=4,n.holding=!1,n.onClick=n.onClick.bind(n),n.onClickMute=n.onClickMute.bind(n),n.onMouseDown=n.onMouseDown.bind(n),n.onMouseDragging=n.onMouseDragging.bind(n),n.onMouseOver=n.onMouseOver.bind(n),n.onMouseOut=n.onMouseOut.bind(n),n._onMouseUp=n._onMouseUp.bind(n),n.onDraggingFunctionRef=null,n}return l(t,e),i(t,[{key:"componentWillReceiveProps",value:function(e){this.holding||this.setState({translate:.6*(100-e.volume),volume:Math.round(e.volume)})}},{key:"onClick",value:function(e){var t=Math.round(100-(e.clientY-e.target.getBoundingClientRect().top)/.6)/100;this.props.setVolume(t)}},{key:"onMouseDown",value:function(e){this.holding=!0,document.onmousemove&&(this.onmousemoveSaver=document.onmousemove),document.onmouseup&&(this.onmouseupSaver=document.onmouseup),this.onDraggingFunctionRef=this.onMouseDragging(e.clientY,this.state.translate),document.addEventListener("mousemove",this.onDraggingFunctionRef),document.addEventListener("mouseup",this._onMouseUp)}},{key:"onMouseDragging",value:function(e,t){var n=this;return function(o){if(n.holding){var r=o.clientY-e+t;r<0&&(r=0),r>72-n.handlerHeight&&(r=72-n.handlerHeight),n.setState({translate:r,volume:Math.round(100-r/.6)}),n.props.setVolume(n.state.volume/100)}}}},{key:"onMouseOver",value:function(){this.setState({mouseOverBox:!0})}},{key:"onMouseOut",value:function(){this.setState({mouseOverBox:!1})}},{key:"onClickMute",value:function(){this.state.volume>0?(this.setState({mutedVolume:this.state.volume}),this.props.setVolume(0)):this.props.setVolume(this.state.mutedVolume/100)}},{key:"_onMouseUp",value:function(){this.holding=!1,this.props.setVolume(this.state.volume/100),document.removeEventListener("mousemove",this.onDraggingFunctionRef),document.removeEventListener("mouseup",this._onMouseUp)}},{key:"render",value:function(){var e=this,t=void 0;t=this.state.volume>0?this.state.volume>50?m.VolumeHighBtn:m.VolumeLowBtn:m.VolumeMutedBtn;var n=this.props.volumeOrientationDown?40:90;return u.default.createElement("div",{className:_.default.volumeContainer,onMouseOver:this.onMouseOver,onMouseOut:this.onMouseOut},u.default.createElement(f.Motion,{style:{h:(0,f.spring)(this.state.mouseOverBox||this.holding?n:0),opacity:(0,f.spring)(this.state.mouseOverBox?1:0)}},function(t){var n=t.h,o=t.opacity;return u.default.createElement("div",{className:_.default.volumeAdjustBox,style:{width:"40px",height:e.props.volumeOrientationDown?n*(9/4)+"px":n+"px",transform:e.props.volumeOrientationDown?"translate3d(0, "+n+"px, 0)":"translate3d(0, -"+n+"px, 0)",opacity:o}},u.default.createElement(v.default,{width:e.svgWidth,height:e.svgHeight,barWidth:e.volumeWidth,handlerWidth:e.handlerWidth,handlerHeight:e.handlerHeight*(n/80),translate:e.state.translate,onClick:e.onClick},u.default.createElement(h.default,{width:e.handlerWidth,height:e.handlerHeight,visibility:!0,translate:"translate(0, "+e.state.translate+")",onMouseDown:e.onMouseDown})))}),u.default.createElement(t,{onClick:this.onClickMute}))}}]),t}(u.default.PureComponent);Object.defineProperty(g,"propTypes",{enumerable:!0,writable:!0,value:{volumeOrientationDown:c.default.bool,volume:c.default.number.isRequired,setVolume:c.default.func.isRequired}}),Object.defineProperty(g,"defaultProps",{enumerable:!0,writable:!0,value:{volumeOrientationDown:!1}}),t.default=g},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=o(