Google
Edit File: audio-player-a36e3da4690056a23718-min.js
webpackJsonp([23],{0:function(f,c,a){a(1715);a(1713);a(1797);a(1534);a(1757)},303:function(f,c,a){f.exports={"default":a(955),__esModule:!0}},304:function(f,c,a){function e(d){return d&&d.__esModule?d:{"default":d}}c.__esModule=!0;f=a(1393);var g=e(f);f=a(1392);var d=e(f);a=a(1009);var k=e(a);c.default=function(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+("undefined"===typeof b?"undefined":(0,k.default)(b)));a.prototype=(0, d.default)(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(g.default?(0,g.default)(a,b):a.__proto__=b)}},305:function(f,c,a){c.__esModule=!0;var e=(f=a(1009))&&f.__esModule?f:{"default":f};c.default=function(a,d){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&("object"===("undefined"===typeof d?"undefined":(0,e.default)(d))||"function"===typeof d)?d:a}},479:function(f,c,a){var e=a(222),g=a(69),d=a(859),k= a(480),h=a(246).f;f.exports=function(b){var a=g.Symbol||(g.Symbol=d?{}:e.Symbol||{});"_"!=b.charAt(0)&&!(b in a)&&h(a,b,{value:k.f(b)})}},480:function(f,c,a){c.f=a(207)},502:function(f,c,a){var e=a(160),g=a(69),d=a(307);f.exports=function(a,h){var b=(g.Object||{})[a]||Object[a],m={};m[a]=h(b);e(e.S+e.F*d(function(){b(1)}),"Object",m)}},567:function(f,c,a){a(1239);a(1238);a(1240);a(1241);f.exports=a(69).Symbol},568:function(f,c,a){a(862);a(961);f.exports=a(480).f("iterator")},681:function(f,c,a){var e= (c=a(136))&&c.__esModule?c:{"default":c},g=(c=a(137))&&c.__esModule?c:{"default":c},d=a(1387),k=a(1007);a=function(){function a(){(0,e.default)(this,a)}(0,g.default)(a,[{key:"connectToNode",value:function(b){var a=this;this.container=b;this.trackNodes=this.getTrackNodes(b);b=this.trackNodes.map(this.getUrlFromTrackNode);this.albumController=new d(b,{handleTrackPositionChange:function(b,d,h){return a.handleTrackPositionChange(b,d,h)},handleCurrentTrackPositionChange:function(b,d){return a.handleCurrentTrackPositionChange(b, d)},handleActiveTrackChange:function(b){return a.handleActiveTrackChange(b)},handlePlayingChange:function(b){return a.handlePlayingChange(b)},handleTrackDurationChange:function(b,d){return a.handleTrackDurationChange(b,d)}});this.bindUIEvents()}},{key:"getTrackNodes",value:function(b){b=b.querySelectorAll(".tracks .track");for(var d=Array(b.length),a=0;a<b.length;a++)d[a]=b[a];return d}},{key:"getUrlFromTrackNode",value:function(b){return b.querySelector(".link").getAttribute("href")}},{key:"bindUIEvents", value:function(){throw Error("Not implemented");}},{key:"handleCurrentTrackPositionChange",value:function(b,d){}},{key:"handleTrackPositionChange",value:function(b,d,a){}},{key:"handleActiveTrackChange",value:function(b){}},{key:"handlePlayingChange",value:function(b){this.container.classList.toggle("playing",b);this.container.classList.toggle("paused",!b)}},{key:"handleTrackDurationChange",value:function(b,d){}},{key:"getScrubHandlerForTrack",value:function(b){var d=this.albumController,a=k(function(){d.skipToTrack(b); d.beginScrubbing()},function(){return d.endScrubbing()},function(a){return d.seekTrackByPercentage(b,a)});return function(h){b===d.currentTrackId&&a(h)}}}]);return a}();f.exports=a},682:function(f,c){f.exports=function(a){var c=Math.floor(a%60);a=Math.floor(a/60);var g=Math.floor(a/60);0<g&&(a%=60);var d="";0<g&&(d+=g+":",10>a&&(d+="0"));10>c&&(c="0"+c);return d+(a+":"+c)}},683:function(f,c,a){var e=a(861)("meta"),g=a(314),d=a(327),k=a(246).f,h=0,b=Object.isExtensible||function(){return!0},m=!a(307)(function(){return b(Object.preventExtensions({}))}), r=function(b){k(b,e,{value:{i:"O"+ ++h,w:{}}})},q=f.exports={KEY:e,NEED:!1,fastKey:function(a,h){if(!g(a))return"symbol"==typeof a?a:("string"==typeof a?"S":"P")+a;if(!d(a,e)){if(!b(a))return"F";if(!h)return"E";r(a)}return a[e].i},getWeak:function(a,h){if(!d(a,e)){if(!b(a))return!0;if(!h)return!1;r(a)}return a[e].w},onFreeze:function(a){m&&(q.NEED&&b(a)&&!d(a,e))&&r(a);return a}}},684:function(f,c,a){var e=a(554),g=a(685),d=a(257),k=a(960),h=a(327),b=a(1408),m=Object.getOwnPropertyDescriptor;c.f= a(306)?m:function(a,c){a=d(a);c=k(c,!0);if(b)try{return m(a,c)}catch(f){}if(h(a,c))return g(!e.f.call(a,c),a[c])}},741:function(f,c,a){c=a(1390);f.exports=new c},860:function(f,c,a){var e=a(1409),g=a(1233).concat("length","prototype");c.f=Object.getOwnPropertyNames||function(d){return e(d,g)}},954:function(f,c,a){a(1413);var e=a(69).Object;f.exports=function(a,d){return e.create(a,d)}},955:function(f,c,a){a(1414);f.exports=a(69).Object.getPrototypeOf},956:function(f,c,a){a(1416);f.exports=a(69).Object.setPrototypeOf}, 1007:function(f,c){var a=function(a,c,d,f){var h=f.currentTarget,b=document.createElement("div");b.style.cssText="position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10000000; cursor: pointer;";var m=function(b){var a=0,d=h.ownerDocument.defaultView;if(d=d.parent===d?null:d.parent)a=d.document.querySelector("iframe#sqs-site-frame").getBoundingClientRect().left;d=h.getBoundingClientRect();return Math.max(Math.min((b-(d.left+a))/(d.right-d.left),1),0)},r=function(a){b.onmousemove=null;b.onmouseup= null;b.remove();a.preventDefault();d(m(a.clientX));c();window.onmouseleave=null};b.onmousemove=function(b){b.preventDefault();d(m(b.clientX))};b.onmouseup=r;window.onmouseleave=r;f.preventDefault();a();document.body.appendChild(b)};f.exports=function(c,g,d){return a.bind(null,c,g,d)}},1008:function(f,c,a){f.exports={"default":a(1166),__esModule:!0}},1009:function(f,c,a){c.__esModule=!0;f=(f=a(1395))&&f.__esModule?f:{"default":f};var e=(a=a(1394))&&a.__esModule?a:{"default":a},g="function"===typeof e.default&& "symbol"===typeof f.default?function(d){return typeof d}:function(d){return d&&"function"===typeof e.default&&d.constructor===e.default?"symbol":typeof d};c.default="function"===typeof e.default&&"symbol"===g(f.default)?function(d){return"undefined"===typeof d?"undefined":g(d)}:function(d){return d&&"function"===typeof e.default&&d.constructor===e.default?"symbol":"undefined"===typeof d?"undefined":g(d)}},1010:function(f,c,a){function e(d,b,a){this.fn=d;this.context=b;this.once=a||!1}function g(){} var d=Object.prototype.hasOwnProperty,k="function"!==typeof Object.create?"~":!1;g.prototype._events=void 0;g.prototype.eventNames=function(){var a=this._events,b=[],c;if(!a)return b;for(c in a)d.call(a,c)&&b.push(k?c.slice(1):c);return Object.getOwnPropertySymbols?b.concat(Object.getOwnPropertySymbols(a)):b};g.prototype.listeners=function(a,b){var d=k?k+a:a,d=this._events&&this._events[d];if(b)return!!d;if(!d)return[];if(d.fn)return[d.fn];for(var c=0,e=d.length,g=Array(e);c<e;c++)g[c]=d[c].fn;return g}; g.prototype.emit=function(d,b,a,c,e,g){var l=k?k+d:d;if(!this._events||!this._events[l])return!1;var l=this._events[l],f=arguments.length,t,n;if("function"===typeof l.fn){l.once&&this.removeListener(d,l.fn,void 0,!0);switch(f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,b),!0;case 3:return l.fn.call(l.context,b,a),!0;case 4:return l.fn.call(l.context,b,a,c),!0;case 5:return l.fn.call(l.context,b,a,c,e),!0;case 6:return l.fn.call(l.context,b,a,c,e,g),!0}n=1;for(t=Array(f- 1);n<f;n++)t[n-1]=arguments[n];l.fn.apply(l.context,t)}else{var x=l.length,p;for(n=0;n<x;n++)switch(l[n].once&&this.removeListener(d,l[n].fn,void 0,!0),f){case 1:l[n].fn.call(l[n].context);break;case 2:l[n].fn.call(l[n].context,b);break;case 3:l[n].fn.call(l[n].context,b,a);break;default:if(!t){p=1;for(t=Array(f-1);p<f;p++)t[p-1]=arguments[p]}l[n].fn.apply(l[n].context,t)}}return!0};g.prototype.on=function(d,b,a){b=new e(b,a||this);d=k?k+d:d;this._events||(this._events=k?{}:Object.create(null));this._events[d]? this._events[d].fn?this._events[d]=[this._events[d],b]:this._events[d].push(b):this._events[d]=b;return this};g.prototype.once=function(d,b,a){b=new e(b,a||this,!0);d=k?k+d:d;this._events||(this._events=k?{}:Object.create(null));this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],b]:this._events[d].push(b):this._events[d]=b;return this};g.prototype.removeListener=function(d,b,a,c){d=k?k+d:d;if(!this._events||!this._events[d])return this;var e=this._events[d],g=[];if(b)if(e.fn)(e.fn!== b||c&&!e.once||a&&e.context!==a)&&g.push(e);else for(var f=0,s=e.length;f<s;f++)(e[f].fn!==b||c&&!e[f].once||a&&e[f].context!==a)&&g.push(e[f]);g.length?this._events[d]=1===g.length?g[0]:g:delete this._events[d];return this};g.prototype.removeAllListeners=function(d){if(!this._events)return this;d?delete this._events[k?k+d:d]:this._events=k?{}:Object.create(null);return this};g.prototype.off=g.prototype.removeListener;g.prototype.addListener=g.prototype.on;g.prototype.setMaxListeners=function(){return this}; g.prefixed=k;f.exports=g},1011:function(f,c,a){var e=a(1397),g=a(948);f.exports=function(d,a,c){var b=!0,m=!0;if("function"!=typeof d)throw new TypeError("Expected a function");!1===c?b=!1:g(c)&&(b="leading"in c?!!c.leading:b,m="trailing"in c?!!c.trailing:m);return e(d,a,{leading:b,maxWait:+a,trailing:m})}},1116:function(f,c,a){var e=a(957);f.exports=Array.isArray||function(a){return"Array"==e(a)}},1166:function(f,c,a){a(1415);f.exports=a(69).Object.keys},1222:function(f,c,a){f.exports={AlbumBlockViewBinder:a(1384), AlbumPageViewBinder:a(1385),CoverPageViewBinder:a(1386)}},1234:function(f,c,a){var e=a(315),g=a(958),d=a(554);f.exports=function(a){var c=e(a),b=g.f;if(b)for(var b=b(a),m=d.f,f=0,q;b.length>f;)m.call(a,q=b[f++])&&c.push(q);return c}},1235:function(f,c,a){var e=a(315),g=a(257);f.exports=function(d,a){for(var c=g(d),b=e(c),m=b.length,f=0,q;m>f;)if(c[q=b[f++]]===a)return q}},1236:function(f,c,a){var e=a(257),g=a(860).f,d={}.toString,k="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window): [];f.exports.f=function(a){var b;if(k&&"[object Window]"==d.call(a))try{b=g(a)}catch(c){b=k.slice()}else b=g(e(a));return b}},1239:function(f,c,a){f=a(222);var e=a(327),g=a(306);c=a(160);var d=a(1410),k=a(683).KEY,h=a(307),b=a(1237),m=a(959),r=a(861),q=a(207),w=a(480),l=a(479),s=a(1235),t=a(1234),n=a(1116),x=a(442),p=a(257),C=a(960),A=a(685),z=a(915),D=a(1236),E=a(684),P=a(246),Y=a(315),Q=E.f,F=P.f,R=D.f,u=f.Symbol,I=f.JSON,J=I&&I.stringify,v=q("_hidden"),S=q("toPrimitive"),Z={}.propertyIsEnumerable, K=b("symbol-registry"),B=b("symbols"),H=b("op-symbols"),y=Object.prototype,b="function"==typeof u,G=f.QObject,M=!G||!G.prototype||!G.prototype.findChild,N=g&&h(function(){return 7!=z(F({},"a",{get:function(){return F(this,"a",{value:7}).a}})).a})?function(b,d,a){var c=Q(y,d);c&&delete y[d];F(b,d,a);c&&b!==y&&F(y,d,c)}:F,T=function(b){var d=B[b]=z(u.prototype);d._k=b;return d},O=b&&"symbol"==typeof u.iterator?function(b){return"symbol"==typeof b}:function(b){return b instanceof u},L=function(b,d,a){b=== y&&L(H,d,a);x(b);d=C(d,!0);x(a);return e(B,d)?(a.enumerable?(e(b,v)&&b[v][d]&&(b[v][d]=!1),a=z(a,{enumerable:A(0,!1)})):(e(b,v)||F(b,v,A(1,{})),b[v][d]=!0),N(b,d,a)):F(b,d,a)},U=function(b,d){x(b);for(var a=t(d=p(d)),c=0,h=a.length,e;h>c;)L(b,e=a[c++],d[e]);return b},V=function(b){var d=Z.call(this,b=C(b,!0));return this===y&&e(B,b)&&!e(H,b)?!1:d||!e(this,b)||!e(B,b)||e(this,v)&&this[v][b]?d:!0},G=function(b,d){b=p(b);d=C(d,!0);if(!(b===y&&e(B,d)&&!e(H,d))){var a=Q(b,d);if(a&&e(B,d)&&(!e(b,v)||!b[v][d]))a.enumerable= !0;return a}},W=function(b){b=R(p(b));for(var d=[],a=0,c;b.length>a;)!e(B,c=b[a++])&&(c!=v&&c!=k)&&d.push(c);return d},X=function(b){var d=b===y;b=R(d?H:p(b));for(var a=[],c=0,h;b.length>c;)e(B,h=b[c++])&&(d?e(y,h):1)&&a.push(B[h]);return a};b||(u=function(){if(this instanceof u)throw TypeError("Symbol is not a constructor!");var b=r(0<arguments.length?arguments[0]:void 0),d=function(a){this===y&&d.call(H,a);e(this,v)&&e(this[v],b)&&(this[v][b]=!1);N(this,b,A(1,a))};g&&M&&N(y,b,{configurable:!0,set:d}); return T(b)},d(u.prototype,"toString",function(){return this._k}),E.f=G,P.f=L,a(860).f=D.f=W,a(554).f=V,a(958).f=X,g&&!a(859)&&d(y,"propertyIsEnumerable",V,!0),w.f=function(b){return T(q(b))});c(c.G+c.W+c.F*!b,{Symbol:u});d="hasInstance isConcatSpreadable iterator match replace search species split toPrimitive toStringTag unscopables".split(" ");for(w=0;d.length>w;)q(d[w++]);d=Y(q.store);for(w=0;d.length>w;)l(d[w++]);c(c.S+c.F*!b,"Symbol",{"for":function(b){return e(K,b+="")?K[b]:K[b]=u(b)},keyFor:function(b){if(O(b))return s(K, b);throw TypeError(b+" is not a symbol!");},useSetter:function(){M=!0},useSimple:function(){M=!1}});c(c.S+c.F*!b,"Object",{create:function(b,d){return void 0===d?z(b):U(z(b),d)},defineProperty:L,defineProperties:U,getOwnPropertyDescriptor:G,getOwnPropertyNames:W,getOwnPropertySymbols:X});I&&c(c.S+c.F*(!b||h(function(){var b=u();return"[null]"!=J([b])||"{}"!=J({a:b})||"{}"!=J(Object(b))})),"JSON",{stringify:function(b){if(!(void 0===b||O(b))){for(var d=[b],a=1,c;arguments.length>a;)d.push(arguments[a++]); a=d[1];"function"==typeof a&&(c=a);if(c||!n(a))a=function(b,d){c&&(d=c.call(this,b,d));if(!O(d))return d};d[1]=a;return J.apply(I,d)}}});u.prototype[S]||a(553)(u.prototype,S,u.prototype.valueOf);m(u,"Symbol");m(Math,"Math",!0);m(f.JSON,"JSON",!0)},1240:function(f,c,a){a(479)("asyncIterator")},1241:function(f,c,a){a(479)("observable")},1384:function(f,c,a){function e(b){return b&&b.__esModule?b:{"default":b}}c=a(303);var g=e(c);c=a(136);var d=e(c);c=a(137);var k=e(c);c=a(305);var h=e(c);c=a(304);var b= e(c);c=a(681);var m=a(1007),r=a(682),q=a(1011);a=function(a){function c(){(0,d.default)(this,c);return(0,h.default)(this,(c.__proto__||(0,g.default)(c)).apply(this,arguments))}(0,b.default)(c,a);(0,k.default)(c,[{key:"bindUIEvents",value:function(){var b=this,d=this.container,a=this.albumController;d.querySelector(".album-controls .button.playpause").addEventListener("click",function(){return a.isPlaying?a.pause():a.play()});var h=d.querySelector(".universal-controls");h.querySelector(".play").addEventListener("click", function(){return a.play()});h.querySelector(".pause").addEventListener("click",function(){return a.pause()});h.querySelector(".prev").addEventListener("click",function(){return a.goToPreviousTrack()});h.querySelector(".next").addEventListener("click",function(){return a.goToNextTrack()});d.querySelector(".universal-track .track-progress-bar").addEventListener("mousedown",m(function(){return a.beginScrubbing()},function(){return a.endScrubbing()},function(b){return a.seekCurrentTrackByPercentage(b)})); this.trackNodes.forEach(function(d,c){d.querySelector(".track-progress-bar").addEventListener("mousedown",b.getScrubHandlerForTrack(c));d.addEventListener("click",function(b){b.preventDefault();a.skipToTrack(c);a.play()})});d.ownerDocument.defaultView.addEventListener("resize",q(this.handleWindowResize.bind(this),40));c.updateSizeClass(this.container)}},{key:"handleWindowResize",value:function(){this.ownerDocument.body.contains(this.container)&&c.updateSizeClass(this.container)}},{key:"handleCurrentTrackPositionChange", value:function(b,d){var a=this.container.querySelector(".universal-track");c.updateElapsedTimer(a,b,d)}},{key:"handleTrackPositionChange",value:function(b,d,a){c.updateElapsedTimer(this.trackNodes[b],d,a)}},{key:"handleTrackDurationChange",value:function(b,d){var a=this.trackNodes[b],c=r(d);a.querySelector(".timers .duration").textContent=c;b===this.albumController.currentTrackId&&(this.container.querySelector(".universal-track .timers .duration").textContent=c)}},{key:"handleActiveTrackChange",value:function(b){this.trackNodes.forEach(function(b, d){return b.classList.remove("selected")});if(null!==b){var d=this.trackNodes[b];d.classList.add("selected");b=d.getAttribute("data-artist");var d=d.getAttribute("data-title"),a=this.container.querySelector(".universal-track .track-info");a.querySelector(".title").textContent=d;a.querySelector(".artist").textContent=b}}}],[{key:"updateElapsedTimer",value:function(b,d,a){b.querySelector(".track-progress-bar .play-bar").style.width=100*a+"%";b.querySelector(".timers .elapsed").textContent=r(d)}},{key:"updateSizeClass", value:function(b){var d=parseInt(b.ownerDocument.defaultView.getComputedStyle(b).width,10),d=640>d?"sm":800>d?"md":"lg";b=b.classList;b.remove("sm");b.remove("md");b.remove("lg");b.add(d)}}]);return c}(c);f.exports=a},1385:function(f,c,a){function e(b){return b&&b.__esModule?b:{"default":b}}c=a(303);var g=e(c);c=a(136);var d=e(c);c=a(137);var k=e(c);c=a(305);var h=e(c);c=a(304);var b=e(c);c=a(681);var m=a(682),r=a(1011);a=function(a){function c(){(0,d.default)(this,c);return(0,h.default)(this,(c.__proto__|| (0,g.default)(c)).apply(this,arguments))}(0,b.default)(c,a);(0,k.default)(c,[{key:"bindUIEvents",value:function(){var b=this;this.eventHandlers=[{node:this.container.querySelector("a.button"),type:"click",fn:this.handleButtonClick.bind(this)},{node:this.container.ownerDocument.defaultView,type:"resize",fn:r(this.handleWindowResize.bind(this),40)}];this.trackNodes.forEach(function(d,a){b.eventHandlers.push({node:d,type:"click",fn:b.handleTrackNodeClick.bind(b,a)},{node:d.querySelector(".track-progress-bar"), type:"mousedown",fn:b.getScrubHandlerForTrack.call(b,a)})});this.eventHandlers.forEach(function(b){b.node.addEventListener(b.type,b.fn)});this.handleWindowResize()}},{key:"destroy",value:function(){this.eventHandlers.forEach(function(b){b.node.removeEventListener(b.type,b.fn)});this.albumController.changeCurrentTrackImpl(null);this.albumController=this.eventHandlers=null}},{key:"handleButtonClick",value:function(b){b.preventDefault();this.albumController.playpause()}},{key:"handleTrackNodeClick", value:function(b,d){var a=this.albumController;d.preventDefault();a.skipToTrack(b);a.play()}},{key:"handleWindowResize",value:function(){var b=this.container.ownerDocument.defaultView;b.document.body.contains(this.container)&&(b=parseInt(b.getComputedStyle(this.container).width,10),this.container.classList.toggle("tablet",800>b),this.container.classList.toggle("phone",480>b))}},{key:"handleTrackPositionChange",value:function(b,d,a){b=this.trackNodes[b];b.querySelector(".track-progress-bar .play-bar").style.width= 100*a+"%";b.querySelector(".track-time").textContent=m(d)}},{key:"handleActiveTrackChange",value:function(b){this.trackNodes.forEach(function(b,d){return b.classList.remove("selected")});null!==b&&this.trackNodes[b].classList.add("selected")}}]);return c}(c);f.exports=a},1386:function(f,c,a){function e(b){return b&&b.__esModule?b:{"default":b}}c=a(303);var g=e(c);c=a(136);var d=e(c);c=a(137);var k=e(c);c=a(305);var h=e(c);c=a(304);var b=e(c);c=a(681);var m=a(682);a=function(a){function c(){(0,d.default)(this, c);return(0,h.default)(this,(c.__proto__||(0,g.default)(c)).apply(this,arguments))}(0,b.default)(c,a);(0,k.default)(c,[{key:"bindUIEvents",value:function(){var b=this,d=this.container,a=this.albumController,c=d.querySelector(".button-play-pause");c&&c.addEventListener("click",function(){return a.playpause()});(c=d.querySelector(".button-previous"))&&c.addEventListener("click",function(){return a.goToPreviousTrack()});(d=d.querySelector(".button-next"))&&d.addEventListener("click",function(){return a.goToNextTrack()}); this.trackNodes.forEach(function(d,c){d.querySelector(".track-progress-bar").addEventListener("mousedown",b.getScrubHandlerForTrack(c));d.addEventListener("click",function(b){b.preventDefault();a.skipToTrack(c);a.play()})})}},{key:"handleTrackPositionChange",value:function(b,d,a){b=this.trackNodes[b];b.querySelector(".track-progress-bar .play-bar").style.width=100*a+"%";b.querySelector(".track-time").textContent=m(d)}},{key:"handleActiveTrackChange",value:function(b){this.trackNodes.forEach(function(b, d){return b.classList.remove("selected")});null!==b&&this.trackNodes[b].classList.add("selected")}}]);return c}(c);f.exports=a},1387:function(f,c,a){function e(b){return b&&b.__esModule?b:{"default":b}}c=a(1008);var g=e(c);c=a(912);var d=e(c);c=a(136);var k=e(c);c=a(137);var h=e(c),b=a(741);a=function(){};var m={handleTrackPositionChange:a,handleCurrentTrackPositionChange:a,handleActiveTrackChange:a,handlePlayingChange:a,handleTrackDurationChange:a};a=function(){function a(c,h){var e=this;(0,k.default)(this, a);this.handlers=(0,d.default)({},m,h);this.tracks=c.map(function(d){return b.createTrack(d)});this.currentTrackId=null;this.isPlaying=!1;this._currentTrackEventListeners={};this.tracks.forEach(function(b,d){b.on("positionChange",function(){e.handlers.handleTrackPositionChange(d,b.position,b.position/b.duration)}).on("durationChange",function(){e.handlers.handleTrackDurationChange(d,b.duration)})});this.currentTrackEventListeners={positionChange:function(b){return e.handlers.handleCurrentTrackPositionChange(b.position, b.position/b.duration)},ended:function(){return!e.isScrubbing&&e.goToNextTrack()},inactive:function(){return e.setIsPlayingImpl(!1)}}}(0,h.default)(a,[{key:"skipToTrack",value:function(b){var d=1>=arguments.length||void 0===arguments[1]?!1:arguments[1];if(0>b||b>=this.tracks.length)b=null;d&&null!==b&&this.seekTrack(b,0);this.changeCurrentTrackImpl(b)}},{key:"play",value:function(){null!==this.currentTrackId?(this.tracks[this.currentTrackId].play(),this.setIsPlayingImpl(!0)):0<this.tracks.length&& (this.skipToTrack(0,!0),this.play())}},{key:"pause",value:function(){null!==this.currentTrackId&&this.tracks[this.currentTrackId].pause();this.setIsPlayingImpl(!1)}},{key:"playpause",value:function(){this.isPlaying?this.pause():this.play()}},{key:"goToPreviousTrack",value:function(){var b=0>=arguments.length||void 0===arguments[0]?!0:arguments[0];null!==this.currentTrackId&&this.skipToTrack(this.currentTrackId-1,b)}},{key:"goToNextTrack",value:function(){var b=0>=arguments.length||void 0===arguments[0]? !0:arguments[0];null!==this.currentTrackId&&this.skipToTrack(this.currentTrackId+1,b)}},{key:"seekCurrentTrack",value:function(b){null!==this.currentTrackId&&this.seekTrack(this.currentTrackId)}},{key:"seekCurrentTrackByPercentage",value:function(b){null!==this.currentTrackId&&this.seekTrackByPercentage(this.currentTrackId,b)}},{key:"seekTrack",value:function(b,d){this.tracks[b].seek(d)}},{key:"seekTrackByPercentage",value:function(b,d){this.seekTrack(b,d*this.tracks[b].duration)}},{key:"beginScrubbing", value:function(){this.isScrubbing=!0}},{key:"endScrubbing",value:function(){this.isScrubbing=!1;this.isPlaying&&this.tracks[this.currentTrackId].play()}},{key:"changeCurrentTrackImpl",value:function(b){var d=this,a=this.currentTrackEventListeners;b!==this.currentTrackId&&(null!==this.currentTrackId&&function(){var b=d.tracks[d.currentTrackId];b.pause();(0,g.default)(a).forEach(function(d){return b.removeListener(d,a[d])})}(),null!==b?function(){var c=d.tracks[b];(0,g.default)(a).forEach(function(b){return c.on(b, a[b])});d.isPlaying&&c.play()}():this.setIsPlayingImpl(!1),this.currentTrackId=b,this.handlers.handleActiveTrackChange(b))}},{key:"setIsPlayingImpl",value:function(b){b!==this.isPlaying&&(this.isPlaying=b,this.handlers.handlePlayingChange(b))}}]);return a}();f.exports=a},1388:function(f,c,a){function e(b){return b&&b.__esModule?b:{"default":b}}c=a(1008);var g=e(c);c=a(912);var d=e(c);c=a(303);var k=e(c);c=a(136);var h=e(c);c=a(137);var b=e(c);c=a(305);var m=e(c);c=a(304);var r=e(c);c=a(1010);var q= a(1391),w={timeupdate:"playing",loadstart:"load",durationchange:"durationchange",canplay:"ready",pause:"pause",playing:"play",ended:"ended"},l={url:null,volume:1};a=function(a){function c(){var b=0>=arguments.length||void 0===arguments[0]?{}:arguments[0];(0,h.default)(this,c);var a=(0,m.default)(this,(c.__proto__||(0,k.default)(c)).call(this)),b=(0,d.default)({},l,b);a.audioEl=document.createElement("audio");b.url&&(a.audioEl.src=a.url=b.url);a.audioEl.volume=b.volume;a._needsLoad=!0;a.audioEvents= [];(0,g.default)(w).forEach(function(b){var d=function(){return a.emit(w[b])};a.audioEvents.push({name:b,fn:d});a.audioEl.addEventListener(b,d)});return a}(0,r.default)(c,a);(0,b.default)(c,[{key:"destroy",value:function(){var b=this;this.audioEvents.forEach(function(d){b.audioEl.removeEventListener(d.name,d.fn)})}},{key:"setVolume",value:function(b){this.audioEl.volume=b}},{key:"getVolume",value:function(){return this.audioEl.volume}},{key:"setSrc",value:function(b){this.audioEl.src=this.url=b;this._needsLoad= !0}},{key:"play",value:function(){var b=this;if(!this.audioEl.src)throw Error("Cannot play: Need to set a url first.");this._needsLoad?(this.once("ready",function(){return b.audioEl.play()}),this.audioEl.load(),this.audioEl.play(),this._needsLoad=!1):3<=this.audioEl.readyState&&this.audioEl.play()}},{key:"playFrom",value:function(b){var d=this;if(!this.audioEl.src)throw Error("Cannot play: Need to set a url first.");this._needsLoad?(this.once("ready",function(){d.audioEl.currentTime=b;d.audioEl.play()}), this.audioEl.load(),this.audioEl.play(),this._needsLoad=!1):3<=this.audioEl.readyState&&(this.audioEl.currentTime=b,this.audioEl.play())}},{key:"pause",value:function(){this.audioEl.pause()}},{key:"seek",value:function(b){if(0!==this.audioEl.readyState){!this.audioEl.paused&&q&&(b=Math.floor(b));var d=this.audioEl.currentTime;this.audioEl.currentTime=b;this.emit("seek",d,b)}}},{key:"getPosition",value:function(){return this.audioEl.currentTime}},{key:"getDuration",value:function(){return this.audioEl.duration}}]); return c}(c);f.exports=a},1389:function(f,c,a){function e(b){return b&&b.__esModule?b:{"default":b}}c=a(912);var g=e(c);c=a(303);var d=e(c);c=a(136);var k=e(c);c=a(137);var h=e(c);c=a(305);var b=e(c);c=a(304);var m=e(c);a=a(1010);c=function(){};var r={handlePlay:c,handlePause:c,handleSeek:c};a=function(a){function c(a){(0,k.default)(this,c);var h=(0,b.default)(this,(c.__proto__||(0,d.default)(c)).call(this));h.url=a;h.position=0;h.duration=0;h.isActive=!1;h.callbacks=(0,g.default)({},r);return h} (0,m.default)(c,a);(0,h.default)(c,[{key:"setCallbacks",value:function(b){this.callbacks=(0,g.default)({},r,b)}},{key:"play",value:function(){this.callbacks.handlePlay()}},{key:"pause",value:function(){this.callbacks.handlePause()}},{key:"seek",value:function(b){this.callbacks.handleSeek(b)}},{key:"handlePositionChanged",value:function(b){this.position=b;this.emit("positionChange",this)}},{key:"handlePlay",value:function(){this.emit("play",this)}},{key:"handlePaused",value:function(){this.emit("pause", this)}},{key:"handleEnded",value:function(){this.emit("ended",this)}},{key:"handleDurationChanged",value:function(b){this.duration=b;this.emit("durationChange",this)}},{key:"handleReady",value:function(){this.emit("ready",this)}},{key:"handleActiveChange",value:function(b){this.isActive=b;this.emit(b?"active":"inactive",this)}}]);return c}(a);f.exports=a},1390:function(f,c,a){var e=(c=a(136))&&c.__esModule?c:{"default":c},g=(c=a(137))&&c.__esModule?c:{"default":c},d=a(1388),k=a(1389);a=function(){function a(){var b= this;(0,e.default)(this,a);this.player=new d;this.activeTrack=null;this.player.on("playing",function(){b.activeTrack&&b.activeTrack.handlePositionChanged(b.player.getPosition())}).on("durationchange",function(){b.activeTrack&&b.activeTrack.handleDurationChanged(b.player.getDuration())}).on("ready",function(){b.activeTrack&&b.activeTrack.handleReady()}).on("play",function(){b.activeTrack&&b.activeTrack.handlePlay()}).on("pause",function(){b.activeTrack&&b.activeTrack.handlePaused()}).on("ended",function(){b.activeTrack&& b.activeTrack.handleEnded()})}(0,g.default)(a,[{key:"createTrack",value:function(b){var d=this,a=new k(b);a.setCallbacks({handlePlay:function(){d.activate(a);d.player.playFrom(a.position)},handlePause:function(){a.isActive&&d.player.pause()},handleSeek:function(b){a.isActive&&d.player.seek(b);a.handlePositionChanged(b)}});return a}},{key:"activate",value:function(b){if(this.activeTrack!==b&&(this.activeTrack&&(this.activeTrack.pause(),this.activeTrack.handleActiveChange(!1)),this.activeTrack=b))this.player.setSrc(b.url), b.handleActiveChange(!0)}}]);return a}();f.exports=a},1391:function(f,c){var a=navigator.userAgent.toLowerCase(),a=-1!==a.indexOf("safari")&&-1===a.indexOf("chrome");f.exports=a},1392:function(f,c,a){f.exports={"default":a(954),__esModule:!0}},1393:function(f,c,a){f.exports={"default":a(956),__esModule:!0}},1394:function(f,c,a){f.exports={"default":a(567),__esModule:!0}},1395:function(f,c,a){f.exports={"default":a(568),__esModule:!0}},1396:function(f,c,a){c=a(1626)(Date,"now")||function(){return(new Date).getTime()}; f.exports=c},1397:function(f,c,a){var e=a(948),g=a(1396),d=Math.max;f.exports=function(a,c,b){function m(b,d){d&&clearTimeout(d);s=p=C=void 0;b&&(A=g(),t=a.apply(x,l),!p&&!s&&(l=x=void 0))}function f(){var b=c-(g()-n);0>=b||b>c?m(C,s):p=setTimeout(f,b)}function q(){m(D,p)}function w(){l=arguments;n=g();x=this;C=D&&(p||!E);if(!1===z)var b=E&&!p;else{!s&&!E&&(A=n);var d=z-(n-A),e=0>=d||d>z;e?(s&&(s=clearTimeout(s)),A=n,t=a.apply(x,l)):s||(s=setTimeout(q,d))}e&&p?p=clearTimeout(p):!p&&c!==z&&(p=setTimeout(f, c));b&&(e=!0,t=a.apply(x,l));e&&(!p&&!s)&&(l=x=void 0);return t}var l,s,t,n,x,p,C,A=0,z=!1,D=!0;if("function"!=typeof a)throw new TypeError("Expected a function");c=0>c?0:+c||0;if(!0===b)var E=!0,D=!1;else e(b)&&(E=!!b.leading,z="maxWait"in b&&d(+b.maxWait||0,c),D="trailing"in b?!!b.trailing:D);w.cancel=function(){p&&clearTimeout(p);s&&clearTimeout(s);A=0;s=p=C=void 0};return w}},1411:function(f,c,a){var e=a(314),g=a(442),d=function(d,a){g(d);if(!e(a)&&null!==a)throw TypeError(a+": can't set as prototype!"); };f.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(c,h,b){try{b=a(569)(Function.call,a(684).f(Object.prototype,"__proto__").set,2),b(c,[]),h=!(c instanceof Array)}catch(e){h=!0}return function(a,c){d(a,c);h?a.__proto__=c:b(a,c);return a}}({},!1):void 0),check:d}},1413:function(f,c,a){f=a(160);f(f.S,"Object",{create:a(915)})},1414:function(f,c,a){var e=a(686),g=a(1519);a(502)("getPrototypeOf",function(){return function(d){return g(e(d))}})},1415:function(f,c,a){var e=a(686),g=a(315); a(502)("keys",function(){return function(d){return g(e(d))}})},1416:function(f,c,a){f=a(160);f(f.S,"Object",{setPrototypeOf:a(1411).set})},1534:function(f,c){YUI.add("squarespace-block-audio-player-template",function(a){var c=a.Handlebars;(function(){var a=c.template;(c.templates=c.templates||{})["block-audio-player.html"]=a(function(d,a,c,b,e){this.compilerInfo=[4,">= 1.0.0"];c=this.merge(c,d.helpers);e=e||{};var f=this.escapeExpression;d='<div class="player">\n <div class="action">\n <div class="play">\n <div class="play-button"></div>\n </div>\n <div class="pause">\n <div class="pause-button"></div>\n </div>\n </div>\n <div class="labels">\n <div class="title-wrapper">\n <div class="title" title="'; (b=c.title)?b=b.call(a,{hash:{},data:e}):(b=a.title,b="function"===typeof b?b.apply(a):b);d+=f(b)+'" data-title="';(b=c.title)?b=b.call(a,{hash:{},data:e}):(b=a.title,b="function"===typeof b?b.apply(a):b);d+=f(b)+'">';(b=c.title)?b=b.call(a,{hash:{},data:e}):(b=a.title,b="function"===typeof b?b.apply(a):b);d+=f(b)+'</div>\n </div>\n <div class="artistName" title="';(b=c.artistName)?b=b.call(a,{hash:{},data:e}):(b=a.artistName,b="function"===typeof b?b.apply(a):b);d+=f(b)+'">';(b=c.artistName)? b=b.call(a,{hash:{},data:e}):(b=a.artistName,b="function"===typeof b?b.apply(a):b);d+=f(b)+'</div>\n </div>\n <div class="secondary-controls">\n <div class="time">\n <span class="progress"></span>\n <span class="total">';(b=c.duration)?b=b.call(a,{hash:{},data:e}):(b=a.duration,b="function"===typeof b?b.apply(a):b);return d+=f(b)+'</span>\n </div>\n </div>\n <div class="track">\n <span class="played"><span class="icon"></span></span>\n </div>\n</div>\n'})})();a.Handlebars.registerPartial("block-audio-player.html".replace("/", "."),c.templates["block-audio-player.html"])},"1.0",{requires:["handlebars-base"]})},1713:function(f,c,a){var e=a(1222).AlbumPageViewBinder;YUI.add("squarespace-album-player",function(a){var d,c=function(d){var b=d.one(".album-cover img");b&&a.config.win.ImageLoader.load(b,{load:!0});d.removeClass("loading")};a.on("windowresize",function(){a.all(".sqs-audio-playlist").each(function(a){c(a)})});a.config.win.Squarespace.onInitialize(a,function(){d=[];a.all(".sqs-audio-playlist").each(function(a){var b= new e;d.push(b);b.connectToNode(a.getDOMNode());c(a)})});a.config.win.Squarespace.onDestroy(a,function(){d.forEach(function(a){a.destroy()});d=null})},"1.0",{requires:["event-resize"]})},1715:function(f,c,a){var e=a(1),g=a(741);YUI.add("squarespace-audio-player",function(a){var c=a.namespace("Squarespace.Widgets").AudioPlayer=a.Base.create("audioPlayer",a.Squarespace.Widgets.SSWidget,[],{initializer:function(b){b=this.get("render");a.Lang.isBoolean(b)?b=null:a.Lang.isString(b)&&(b=a.one(b));b&&(b._audioPlayer&& b._audioPlayer.destroy(),b._audioPlayer=this,a.Object.each(b.getData(),function(b,a){b&&this.set(a,b)},this))},destructor:function(){this._audio&&(this.stop(),this._audio=null);g.player.pause()},renderUI:function(){c.superclass.renderUI.apply(this,arguments);var b=this.get("boundingBox"),e=b.one(".placeholder"),f=this.get("title"),h=this.get("author");f&&h?e.setContent(a.Node.create('<div class="wrapper"><div class="audio-author">'+h+'</div><div class="audio-title">'+f+"</div></div>")):f?e.setContent(a.Node.create('<div class="wrapper"><div class="audio-title">'+ f+"</div></div>")):e.setContent(a.Node.create('<div class="wrapper">'+this.get("strings.placeholder")+"</div>"));"true"===this.get("show-download")&&(e='<div class="download"><a href="'+a.Squarespace.UrlUtils.addQueryParam(this.get("url"),"download","true")+'" target="_blank">Download</a></div>',this.get("contentBox").append(e),b.addClass("download"));b.one(".progress-inner").setStyle("width","0px");e=this._volumeNode=b.one(".volume");if(!e)throw Error(this.name+": No div.volume in template.");for(f= this.get("volumeLevels");0<f;f--)e.prepend('<div class="bar level-"'+f+'" data-volume-level="'+f+'"></div>');b.one(".duration").setContent(this.get("strings.durationPlaceHolder"))},bindUI:function(){var b=this.get("id");this.get("boundingBox").on(b+"|click",this._onClick,this);this.after(b+"|volumeChange",function(b){this._setVolume(b.newVal)},this);this.after(b+"|playStateChange",this._uiUpdateWrapperClass,this);this.after(b+"|readyStateChange",this._afterReadyStateChange,this);this.after(b+"|disabledChange", function(b){b.newVal&&this.stop()},this);a.on(b+"|audioPlayer:stopAll",function(b){var c=b?b.container:null;c&&a.Lang.isString(c)&&(c=a.one(c));(!b||!b.hasOwnProperty("container")||c instanceof a.Node&&c.contains(this.get("boundingBox")))&&this.stop()},this)},syncUI:function(){this._uiUpdateWrapperClass();this._uiUpdateVolumeLevel();var b=this.get("boundingBox");b.ancestor(".sqs-editing")&&(g.player.pause(),this.pause());b.toggleClass("tiny",300>b.get("offsetWidth"))},play:function(){var b=this.getProperty("PLAY_STATES"); g.player.setVolume(this.get("volume")/100);this._audio?this.get("playState")!==b.PLAYING&&this._audio.play():(this._registerTrack(),this._audio.play());this._set("playState",b.PLAYING)},pause:function(){this._audio&&this._audio.pause()},stop:function(){var b=this.get("playState"),a=this.getProperty("PLAY_STATES");b===a.PLAYING&&this._audio&&this._audio.pause()},seek:function(b){100<b||0>b?console.warn(this.name+": seek() - Percentage between 0-100 required."):(this._audio||(this._registerTrack(), this.play()),this._audio.seek(this._audio.duration*(b/100)))},setVolume:function(b){this.set("volume",b)},_setVolume:function(b){this._audio&&g.player.setVolume(b/100);this._set("volume",b);this._uiUpdateVolumeLevel()},_setVolumeLevel:function(b){this._setVolume(Math.round(100*(b/this.get("volumeLevels"))))},_registerTrack:function(){if(!this._audio){var b=this.get("boundingBox"),c=this.get("fixedUrl");b.addClass("loading");if(!c){this._showError(e("No URL provided."));return}this._audio=g.createTrack(c); this._audio.on("pause",a.bind(this._onPause,this));this._audio.on("ended",a.bind(this._onStop,this));this._audio.on("inactive",a.bind(this._onPause,this));this._audio.on("positionChange",a.bind(this._onWhilePlaying,this));this._audio.on("ready",a.bind(this._onLoad,this));return!!this._audio}return!1},_uiUpdateVolumeLevel:function(){var b=this._volumeNode.get("children"),a=this.get("volumeLevels"),d=this.get("volume"),c=Math.round(d/100*a);b.each(function(b){parseInt(b.getAttribute("data-volume-level"), 10)<=c?b.addClass("active"):b.removeClass("active")},this)},_uiUpdateWrapperClass:function(){var b=this.getProperty("READY_STATES"),a=this.getProperty("PLAY_STATES"),d=this.get("boundingBox"),c=d.getAttribute("class").split(" "),e;for(e in a)c.remove("play-state-"+a[e]);for(e in b)c.remove("ready-state-"+b[e]);d.addClass("ready-state-"+this.get("readyState"));d.setAttribute("class",c.join(" ")).addClass("play-state-"+this.get("playState")).addClass("ready-state-"+this.get("readyState"))},_onClick:function(b){if(a.UA.ios)window.location.href= this.get("url");else if(!b.target.ancestor().hasClass("download")&&(b.halt(),b.stopImmediatePropagation(),!this.get("disabled")&&!b.target.hasClass("duration")))if(b.target.ancestor(".volume"))this._setVolumeLevel(parseInt(b.target.getAttribute("data-volume-level"),10));else if(b.target.ancestor(".placeholder",!0))this.play();else{if(b.target.ancestor(".controls",!0)){b=this.get("playState");var c=this.getProperty("PLAY_STATES");switch(b){case c.PLAYING:this.pause();return;case c.PAUSED:case c.STOPPED:this.play(); return;default:console.warn(this.name+": Wait, what? How did you get here? Case was ",b);return}}c=this.get("boundingBox").one(".progress").get("region");b.pageX>=c.left&&b.pageX<=c.right&&this.seek(100*((b.pageX-c.left)/c.width))}},_afterReadyStateChange:function(b){b=this.getProperty("READY_STATES");var a=this.get("readyState"),d=this.get("strings"),c=!1;switch(a){case b.INITIALIZED:this.enable();break;case b.FLASH_BLOCKED:c=d.soundManagerFlashFail;break;case b.SECURITY_ERROR:c=d.soundManagerSecurityFail; this._reportAudioError(b.SECURITY_ERROR);break;case b.SOUND_LOAD_FAILED:c=d.soundManagerURLFail;this._reportAudioError(b.SOUND_LOAD_FAILED);break;case b.SOUND_LOADED:break;default:console.warn(this.name+": Invalid ready state ("+a+").")}c&&(console.warn("AUDIO ERROR: "+c),this._showError(c),this.disable());this._uiUpdateWrapperClass()},_reportAudioError:function(b){try{var c=this.get("url");0<c.indexOf("static.squarespace.com")&&a.Squarespace.Analytics.trackInternal("system_audio_play_error",{readyState:this.get("readyState"), url:c})}catch(e){}},_getPlaytimeString:function(b){if(!this._audio)return this.get("strings.durationPlaceHolder");var a="0:00",d="0:00",a=this._getMinSecString(this._audio.duration);b&&(d=this._getMinSecString(b));return d+" / "+a},_getMinSecString:function(b){return a.Squarespace.DateUtils.humanizeDuration(1E3*b)},_showError:function(b){this.get("boundingBox").addClass("error");this.get("boundingBox").one(".placeholder").setContent("Error: "+b)},_onWhilePlaying:function(b){if(!this.get("destroyed")){var a= this.get("boundingBox");a.one(".duration").setContent(this._getPlaytimeString(b.position));var d=this.getProperty("READY_STATES");this.get("readyState")!==d.SOUND_LOADED&&this._set("readyState",d.SOUND_LOADED);d=a.one(".progress-inner");b=100*(b.position/this._audio.duration);a.removeClass("loading");d&&d.setStyle("width",b+"%")}},_onStop:function(){this._set("playState",this.getProperty("PLAY_STATES").STOPPED)},_onPause:function(){this._set("playState",this.getProperty("PLAY_STATES").PAUSED)},_onDataError:function(){this.stop(); this._set("playState",this.getProperty("PLAY_STATES").STOPPED)},_onLoad:function(b){b||(this._loadFailTimer=a.later(1E4,this,function(){this.stop();this._set("readyState",this.getProperty("READY_STATES").SOUND_LOAD_FAILED)}))}},{CSS_PREFIX:"sqs-audio-player",PLAY_STATES:{PLAYING:"playing",PAUSED:"paused",STOPPED:"stopped"},READY_STATES:{INITIALIZED:"initialized",FLASH_BLOCKED:"flash-blocked",SECURITY_ERROR:"security-error",SOUND_LOAD_FAILED:"sound-load-failed",SOUND_LOADED:"sound-loaded"},TEMPLATE:'<div class="controls"></div><div class="placeholder"></div><div class="progress"><div class="progress-inner"><div class="scrubber"></div></div></div><div class="duration"></div><div class="volume"></div>', ATTRS:{strings:{value:{placeholder:e("Click to play..."),durationPlaceHolder:"0:00 / 0:00",loadFail:e("Unable to load sound at the URL"),soundManagerFlashFail:e("Sorry, could not load because flash is blocked."),soundManagerSecurityFail:e("Sorry, there was a JavaScript security error."),soundManagerURLFail:e("Unable to access audio stream.")}},fixedUrl:{getter:function(){var b=this.get("url");0<b.indexOf(Static.SQUARESPACE_CONTEXT.appDomain)&&(b=b.replace(/^(http:\/\/|https:\/\/|\/\/)/i,window.location.protocol+ "//"));return b},readOnly:!0},playState:{lazyAdd:!1,valueFn:function(){return this.getProperty("PLAY_STATES").STOPPED},readOnly:!0},readyState:{lazyAdd:!1,valueFn:function(){return this.getProperty("READY_STATES").INITIALIZED},readOnly:!0},url:{value:null},volume:{validator:function(b){(0>b||100<b)&&console.warn(this.name+": Volume must be between 0 and 100, volume remains unchanged.");return!0},value:66},volumeLevels:{value:6,writeOnce:"initOnly"},stopOthersOnPlay:{value:!0},render:{value:!0}}}), f;a.config.win.Squarespace.onInitialize(a,function(){f=[];a.all(".sqs-audio-embed").each(function(b){if(!(0<b.get("children").size())&&!a.Widget.getByNode(b.one("."+a.Squarespace.Widgets.AudioPlayer.CSS_PREFIX))){switch(a.Object.getValue(b.getData(),"design-style")||"minimal"){case "legacy":b=new a.Squarespace.Widgets.AudioPlayer({render:b});break;default:b=new a.Squarespace.Widgets.AudioPlayerMinimal({render:b})}f.push(b)}})});a.config.win.Squarespace.onDestroy(a,function(){f.forEach(function(b){b.destroy()}); f=null})},"1.0",{requires:"base event node squarespace-album-player squarespace-date-utils squarespace-ss-widget squarespace-url-utils squarespace-util squarespace-widgets-audio-player".split(" ")})},1757:function(f,c,a){var e=a(85);YUI.add("squarespace-media-tracker",function(a){a.namespace("Squarespace");a.Squarespace.MediaTracker=a.Base.create("MediaTracker",a.Base,[],{initializer:function(){this.on("scrollStarted",function(a){this.set("isScrolling",!0)});this.on("scrollFinished",function(a){this.set("isScrolling", !1)});var d=this.get("audio");this._detachAudioEvents();a.Array.forEach("playing load ready pause play ended".split(" "),function(c){var b=a.bind(function(){this._trackEvent({time:Math.floor(d.getPosition()),seekStart:Math.floor(d.getPosition()),from:0,to:0,track:d.url,duration:Math.floor(d.getDuration()),recordType:e.AUDIO,type:"audio:"+c})},this);d.on(c,b);this.audioEvents.push({type:c,fn:b})}.bind(this));var c=a.bind(function(a,b){this._trackEvent({seek:!0,time:Math.floor(d.getPosition()),from:0, to:0,track:d.url,duration:Math.floor(d.getDuration()),seekStart:Math.floor(a),recordType:e.AUDIO,type:"audio:playing"})},this);d.on("seek",c);this.audioEvents.push({type:"seek",fn:c})},destructor:function(){var a=this.get("audio");a&&a.pause();this._detachAudioEvents()},_detachAudioEvents:function(){var d=this.get("audio");d&&this.audioEvents&&a.Array.forEach(this.audioEvents,function(a){d.removeListener(a.type,a.fn)});this.audioEvents=[]},_postMediaEvent:function(d,c){!0!==a.config.win.__WE_ARE_SQUARESPACE_DISABLING_CENSUS__&& a.Data.post({url:"/api/census/RecordHit",data:{data:d},success:noop,failure:noop})},_trackEvent:function(a){!this._updateTrackSwitch(a)&&!this._updateIgnoredEvent(a)&&(this._isDroppedBuffer(a)||this.set("seekStart",a.seekStart),!this._updateScroll(a)&&!this._updateHeartbeat(a)&&(this._updateSeek(a),this._updateMetaData(a)))},_isUpdatedPosition:function(a){return this.get("seekStart")!==this._retrieveTrackPosition(a.track)},_isDroppedBuffer:function(a){return a.seek&&"load"===this.get("prevEvent")}, _shouldRecordLastPlay:function(a){a=this.get("seekStart")-this._retrieveTrackPosition(a.track);return 1<=a&&5>=a},_isPlayBlock:function(a){a=a.time-this._retrieveTrackPosition(a.track);return 1<=a&&5>=a},_isFirstPlay:function(a){return 0===a.time},_isPlayEvent:function(a){return"playing"===a.type&&!this.get("isTrackSwitching")&&!this.get("isScrolling")},_isPauseEvent:function(a){return"pause"===a.type},_isReadyEvent:function(a){return"ready"===a.type},_isLoadEvent:function(a){return"load"===a.type}, _isSeekEvent:function(a){return a.seek&&1<Math.abs(a.time-this.get("seekStart"))&&!this.get("isScrolling")},_isTrackSwitchingEvent:function(a){return a.track!==this.get("curTrack")},_isInitialScrollEvent:function(a){return this.get("isScrolling")&&0===this.get("scrollCount")},_isFinalScrollEvent:function(a){return!this.get("isScrolling")&&this.get("wasScroll")},_isUnrecordedPause:function(a){return 0!==a.time%5&&0!=a.time},_isHeartbeatBoundary:function(a){return 0===a.time%5||a.time===a.duration}, _isHeartbeat:function(a){return this._isPlayEvent(a)&&this._isHeartbeatBoundary(a)&&a.time!=this._retrieveTrackPosition(a.track)||this._isPauseEvent(a)&&this._isUnrecordedPause(a)},_retrieveTrackPosition:function(a){a=this.get("trackMap")[a];void 0===a&&(a=0);return a},_updateIgnoredEvent:function(a){return this._isReadyEvent(a)||this._isLoadEvent(a)||this._retrieveTrackPosition(a.track)===a.time?(this.set("prevEvent",a.type),!0):!1},_updateTrackMap:function(d,c){var e=this.get("trackMap"),b={};b[d]= c;e=a.merge(e,b);this.set("trackMap",e)},_updateHeartbeat:function(a){return this._isHeartbeat(a)?(this._handleHeartbeat(a),this._updateMetaData(a),!0):!1},_updateSeek:function(a){this._isSeekEvent(a)&&(this._handleSkipEvent(a),this._updateMetaData(a))},_updateTrackSwitch:function(a){if(this._isTrackSwitchingEvent(a))if(""===this.get("curTrack"))this.set("curTrack",a.track),this._updateTrackMap(a.track,0);else return this.setAttrs({prevTrack:this.get("curTrack"),curTrack:a.track||"",isTrackSwitching:!0}), this._handleSwitchEvent(a),this._updateMetaData(a),!0;return!1},_updateScroll:function(a){return this._isInitialScrollEvent()?(this.setAttrs({scrollPrev:a.time,scrollCount:this.get("scrollCount")+1,wasScroll:!0}),!0):this._isFinalScrollEvent()?(this.setAttrs({scrollCount:0,scrollEnd:a.time,wasScroll:!1}),this._handleScrollEvent(a),this._updateMetaData(a),!0):!1},_updateMetaData:function(a){this.setAttrs({curDuration:a.duration,prevPlayPosition:a.time})},_recordPreviousPlay:function(a,c,f){this.set("globalOrder", this.get("globalOrder")+1);this._postMediaEvent({type:"playing",from:c,to:f,track:a.track,duration:a.duration,ordering:this.get("globalOrder"),recordType:e.AUDIO})},_recordSeek:function(a,c,f){this.set("globalOrder",this.get("globalOrder")+1);this._postMediaEvent({type:"seek",from:c,to:f,track:a.track,duration:this.get("curDuration"),ordering:this.get("globalOrder"),recordType:e.AUDIO});this._updateTrackMap(a.track,f)},_handleSwitchEvent:function(a){a=this._retrieveTrackPosition(this.get("prevTrack")); void 0===a&&(a=0);this.set("globalOrder",this.get("globalOrder")+1);this._postMediaEvent({type:"playing",from:a,to:this.get("prevPlayPosition"),track:this.get("prevTrack"),duration:this.get("curDuration"),ordering:this.get("globalOrder"),recordType:e.AUDIO});this.set("isTrackSwitching",!1);this._updateTrackMap(this.get("prevTrack"),this.get("prevPlayPosition"))},_handleScrollEvent:function(a){this._isUpdatedPosition(a)&&this._shouldRecordLastPlay(a)&&this._recordPreviousPlay(a,this._retrieveTrackPosition(a.track), this.get("scrollPrev"));this._recordSeek(a,this.get("scrollPrev"),this.get("scrollEnd"))},_handleSkipEvent:function(a){this._isUpdatedPosition(a)&&this._shouldRecordLastPlay(a)&&this._recordPreviousPlay(a,this._retrieveTrackPosition(a.track),this.get("seekStart"));this._recordSeek(a,this.get("seekStart"),a.time)},_handleHeartbeat:function(a){this._isPlayBlock(a)&&(this._recordPreviousPlay(a,this._retrieveTrackPosition(a.track),a.time),this._updateTrackMap(a.track,a.time))}},{ATTRS:{audio:{},isScrolling:{value:!1, validator:a.Squarespace.AttrValidators.isBoolean},isTrackSwitching:{value:!1,validator:a.Squarespace.AttrValidators.isBoolean},scrollPrev:{value:0,validator:a.Squarespace.AttrValidators.isNumber},scrollEnd:{value:0,validator:a.Squarespace.AttrValidators.isNumber},scrollCount:{value:0,validator:a.Squarespace.AttrValidators.isNumber},wasScroll:{value:!1,validator:a.Squarespace.AttrValidators.isBoolean},prevEvent:{value:"",validator:a.Squarespace.AttrValidators.isString},curDuration:{value:0},trackMap:{value:{}}, prevTrack:{value:"",validator:a.Squarespace.AttrValidators.isString},curTrack:{value:"",validator:a.Squarespace.AttrValidators.isString},globalOrder:{value:0,validator:a.Squarespace.AttrValidators.isNumber},prevPlayPosition:{value:0,validator:a.Squarespace.AttrValidators.isNumber},seekStart:{value:0,validator:a.Squarespace.AttrValidators.isNumber}}})},"1.0",{requires:["base","squarespace-damask-context-globals"]})},1797:function(f,c,a){var e=a(1),g=a(741);YUI.add("squarespace-widgets-audio-player", function(a){var c=a.namespace("Squarespace.Widgets").AudioPlayerMinimal=a.Base.create("audioPlayer",a.Squarespace.Widgets.SSWidget,[],{initializer:function(){this.mediaTracker=new a.Squarespace.MediaTracker({audio:g.player});this.setAttrs(this.get("render").getData());""===this.get("title")&&this.set("title","Untitled");this.set("showDownload","true"===this.get("show-download"));this.set("colorTheme",this.get("color-theme"));this.set("artistName",this.get("author"));this._resizeEmitter=new a.Squarespace.ResizeEmitter; this._registerTrack()},destructor:function(){a.Lang.isValue(this._funk)&&(this._funk.pause(),this._funk=null);a.Lang.isValue(this._resizeEmitter)&&(this._resizeEmitter.destroy(),this._resizeEmitter=null);this.mediaTracker.destroy();this.mediaTracker=null},renderUI:function(){c.superclass.renderUI.call(this);this.get("showDownload")&&this._renderDownloadLink();this.get("boundingBox").addClass(this.get("colorTheme"))},bindUI:function(){var a=this.get("contentBox");a.one(".action").on("click",function(){this.get("firstPlay")|| this.set("playing",!this.get("playing"))},this);this.after("playingChange",this._playingChange,this);this.after("progressChange",function(a){var b=this.get("contentBox").one(".player .time .progress");b.setContent(a.newVal);b.addClass("loaded");this._updateTracker(this.get("position"))},this);this.after("durationChange",function(a){var b=this.get("contentBox").one(".player .time .total");b.setContent(a.newVal);b.addClass("loaded");this.syncUI()},this);this.after("titleChange",function(a){this.get("contentBox").one(".player .labels .title").setContent(a.newVal)}, this);this.after("artistNameChange",function(a){this.get("contentBox").one(".player .labels .artistName").setContent(a.newVal)},this);this._registerEvent(this._resizeEmitter.on("resize:end",this.syncUI,this));var b=a.on("click",function(a){!(this.get("showDownload")&&a.target===this._downloadNode.one("a"))&&this.get("firstPlay")&&(a.halt(),b.detach(),b=null,this._setupScrubber(),this.set("firstPlay",!1),this.set("playing",!0))},this)},syncUI:function(){var a=this.get("boundingBox");if(a.getDOMNode()){a.ancestor(".sqs-editing")&& (this.mediaTracker.destroy(),this.set("playing",!1));var b=a.get("offsetWidth");a.one(".player .track").setStyle("width",b);a.toggleClass("playing",this.get("playing"));a.toggleClass("tiny",300>b);a.toggleClass("no-artist",""===this.get("artistName"));a.toggleClass("first-play",this.get("firstPlay"));a=a.one(".player .labels .title");b=a.get("offsetWidth")<a.get("scrollWidth");a.toggleClass("marquee-mark",b)}},_renderNativeAudio:function(){var e=a.Lang.sub(c.NATIVE_TEMPLATE,this.getAttrs());this.get("contentBox").replace(a.Node.create(e))}, _renderDownloadLink:function(){var c=this.get("contentBox").one(".player"),b='<div class="download"><a href="'+a.Squarespace.UrlUtils.addQueryParam(this.get("url"),"download","true")+'" target="_blank">Download</a></div>';this._downloadNode=c.one(".secondary-controls").appendChild(b);c.addClass("download")},_renderVisualizer:function(){for(var a=this.get("contentBox").one(".visualizer"),b="",c=0;100>c;c++)b+='<div class="eq-bar"><div class="height"></div></div>';a.append(b)},_playingChange:function(c){var b= this.get("fixedUrl");a.UA.ios?window.location.href=b:(a.Lang.isValue(this._funk)||this._registerTrack(),c.newVal?this._funk.play():this._funk.pause(),this.syncUI())},_registerTrack:function(){var c=a.bind(function(){this.set("playing",!1)},this),b=a.bind(function(){this.set("playing",!0);g.player.setVolume(this.get("volume")/100)},this),e=a.bind(function(){var a=this._funk.duration;0<a&&(a=this._durationToStr(a),this.set("duration",a))},this),f=a.bind(function(){this.set("playing",!1);this.set("position", 0)},this);this._funk=g.createTrack(this.get("fixedUrl"));this._funk.on("ready",e);this._funk.on("ended",f);this._funk.on("play",b);this._funk.on("pause",c);this._funk.on("inactive",c);this._funk.on("positionChange",a.bind(this._whilePlaying,this))},_whilePlaying:function(a){this.get("playing")&&(this.set("position",a.position),this.set("progress",this._durationToStr(a.position)))},_updateTracker:function(a){this.get("contentBox").one(".track .played").setStyle("width",100*(a/this._funk.duration)+ "%")},_mergeEQData:function(){for(var a=theSound.eqData,b=a.left,a=a.right,c=b.length,d=[],e=0;e<c;e++)d.push((parseFloat(b[e])+parseFloat(a[e]))/2);return d},_calculateEQChunks:function(){for(var c=this._mergeEQData(),b=[],e=0;e<length;e+=2){var f=0;a.Array.each(c.slice(e,e+2),function(a){f+=a});b.push(75*(f/2))}return b},_drawEQBars:function(){var c=this.get("contentBox").all(".eq-bar .height"),b=this._calculateEQChunks();a.Array.each(b,function(e,f){var g=c.item(f);a.Lang.isValue(g)&&g.setStyle("height", Math.min(45,b[f]))},this);this.syncUI()},_setupScrubber:function(){var c=a.Node.create('<div class="scrubber-shim"></div>'),b;c.setStyles({position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:Math.pow(10,7),cursor:"none"});this.get("contentBox").one(".player .track").on("mousedown",function(e){this._updatePosition(e);var f=g.player.getVolume();b=this.get("contentBox").one(".track").get("region");this._funk.isActive&&g.player.setVolume(0.25*f);a.one("body").append(c);c.once("mouseup",function(){g.player.setVolume(f); c.remove()},this)},this);c.on("mousemove",function(a){a=this._getRelativePosition(b,a.pageX);this.mediaTracker.fire("scrollStarted");this._funk.seek(a);this.get("playing")||(this.set("progress",this._durationToStr(a)),this.set("position",a))},this);c.on("mouseup",function(a){this._getRelativePosition(b,a.pageX);this.mediaTracker.fire("scrollFinished")},this)},_updatePosition:function(a){if(!this.get("firstPlay")){var b=this.get("contentBox").one(".track").get("region"),c=this.get("contentBox").one(".track .played .icon").get("offsetWidth")/ 2;this._funk.seek(this._getRelativePosition(b,a.pageX-c))}},_durationToStr:function(a){var b=Math.floor(a%60);a=Math.floor(a/60);var c=Math.floor(a/60);0<c&&(a%=60);var d="";0<c&&(d+=c+":",10>a&&(d+="0"));10>b&&(b="0"+b);return d+(a+":"+b)},_getRelativePosition:function(a,b){return this._funk.duration*Math.min(1,Math.max(0,(b-a.left)/a.width))},_selectVolume:function(c){var b=this.get("contentBox").all(".player .volume .bar");b.removeClass("active");b.filter(function(a){return parseInt(a.getAttribute("data-level"), 10)<=c}).addClass("active");a.Squarespace.Singletons.Audio.set("volume",c)}},{CSS_PREFIX:"sqs-widgets-audio-player",HANDLEBARS_TEMPLATE:"block-audio-player.html",ATTRS:{fixedUrl:{getter:function(){var a=this.get("url");0<a.indexOf(Static.SQUARESPACE_CONTEXT.appDomain)&&(a=a.replace(/^(http:\/\/|https:\/\/|\/\/)/i,window.location.protocol+"//"));return a},readOnly:!0},firstPlay:{value:!0,validator:a.Squarespace.AttrValidators.isBoolean},position:{value:0,validator:a.Squarespace.AttrValidators.isNumber}, progress:{validator:a.Squarespace.AttrValidators.isNullOrString},duration:{validator:a.Squarespace.AttrValidators.isNullOrString},title:{value:e(""),validator:a.Squarespace.AttrValidators.isString},artistName:{value:"",validator:a.Squarespace.AttrValidators.isString},playing:{value:!1,validator:a.Squarespace.AttrValidators.isBoolean},volume:{value:100,validator:a.Squarespace.AttrValidators.isNumber}}})},"1.0",{requires:"base node squarespace-block-audio-player-template squarespace-dom-emitters-resize squarespace-media-tracker squarespace-ss-widget squarespace-url-utils widget".split(" ")})}});