vendor: 4,100 bytes, lines 1-9
1// source --> https://myworstinvestmentever.com/wp-includes/js/imagesloaded.min.js?ver=5.7.17 2/*! This file is auto-generated */ 3/*! 4 * imagesLoaded PACKAGED v4.1.4 5 * JavaScript is all like "You images are done yet or what?" 6 * MIT License 7 */ 8 9!function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},n=i[e]=i[e]||[];return n.indexOf(t)==-1&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{},n=i[e]=i[e]||{};return n[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexOf(t);return n!=-1&&i.splice(n,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){i=i.slice(0),t=t||[];for(var n=this._onceEvents&&this._onceEvents[e],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(e,r),delete n[r]),r.apply(this,t)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},e}),function(e,t){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return t(e,i)}):"object"==typeof module&&module.exports?module.exports=t(e,require("ev-emitter")):e.imagesLoaded=t(e,e.EvEmitter)}("undefined"!=typeof window?window:this,function(e,t){function i(e,t){for(var i in t)e[i]=t[i];return e}function n(e){if(Array.isArray(e))return e;var t="object"==typeof e&&"number"==typeof e.length;return t?d.call(e):[e]}function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);var s=e;return"string"==typeof e&&(s=document.querySelectorAll(e)),s?(this.elements=n(s),this.options=i({},this.options),"function"==typeof t?r=t:i(this.options,t),r&&this.on("always",r),this.getImages(),h&&(this.jqDeferred=new h.Deferred),void setTimeout(this.check.bind(this))):void a.error("Bad element for imagesLoaded "+(s||e))}function r(e){this.img=e}function s(e,t){this.url=e,this.element=t,this.img=new Image}var h=e.jQuery,a=e.console,d=Array.prototype.slice;o.prototype=Object.create(t.prototype),o.prototype.options={},o.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},o.prototype.addElementImages=function(e){"IMG"==e.nodeName&&this.addImage(e),this.options.background===!0&&this.addElementBackgroundImages(e);var t=e.nodeType;if(t&&u[t]){for(var i=e.querySelectorAll("img"),n=0;n<i.length;n++){var o=i[n];this.addImage(o)}if("string"==typeof this.options.background){var r=e.querySelectorAll(this.options.background);for(n=0;n<r.length;n++){var s=r[n];this.addElementBackgroundImages(s)}}}};var u={1:!0,9:!0,11:!0};return o.prototype.addElementBackgroundImages=function(e){var t=getComputedStyle(e);if(t)for(var i=/url\((['"])?(.*?)\1\)/gi,n=i.exec(t.backgroundImage);null!==n;){var o=n&&n[2];o&&this.addBackground(o,e),n=i.exec(t.backgroundImage)}},o.prototype.addImage=function(e){var t=new r(e);this.images.push(t)},o.prototype.addBackground=function(e,t){var i=new s(e,t);this.images.push(i)},o.prototype.check=function(){function e(e,i,n){setTimeout(function(){t.progress(e,i,n)})}var t=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(t){t.once("progress",e),t.check()}):void this.complete()},o.prototype.progress=function(e,t,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&a&&a.log("progress: "+i,e,t)},o.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(e,[this]),this.emitEvent("always",[this]),this.jqDeferred){var t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},r.prototype=Object.create(t.prototype),r.prototype.check=function(){var e=this.getIsImageComplete();
9return e?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},r.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},r.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.img,t])},r.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},r.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},r.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},r.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype=Object.create(r.prototype),s.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url;var e=this.getIsImageComplete();e&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},s.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.element,t])},o.makeJQueryPlugin=function(t){t=t||e.jQuery,t&&(h=t,h.fn.imagesLoaded=function(e,t){var i=new o(this,e,t);return i.jqDeferred.promise(h(this))})},o.makeJQueryPlugin(),o}); 10// source --> https://myworstinvestmentever.com/wp-content/plugins/simple-podcast-press/responsive_audio_player/js/soundmanager2.js?ver=5.7.17 11!function(a,b){"use strict";function d(c,d){function mb(a){return f.preferFlash&&Ka&&!f.ignoreFlash&&f.flash[a]!==b&&f.flash[a]}function nb(a){return function(b){var d,c=this._s;return c&&c._a?d=a.call(this,b):(c&&c.id?f._wD(c.id+": Ignoring "+b.type):f._wD(k+"Ignoring "+b.type),d=null),d}}this.setupOptions={url:c||null,flashVersion:8,debugMode:!1,debugFlash:!1,useConsole:!0,consoleOnly:!0,waitForWindowLoad:!1,bgColor:"#ffffff",useHighPerformance:!0,flashPollingInterval:null,html5PollingInterval:null,flashLoadTimeout:1e3,wmode:null,allowScriptAccess:"always",useFlashBlock:!1,useHTML5Audio:!0,forceUseGlobalHTML5Audio:!1,ignoreMobileRestrictions:!1,html5Test:/^(probably|maybe)$/i,preferFlash:!1,noSWFCache:!1,idPrefix:"sound"},this.defaultOptions={autoLoad:!1,autoPlay:!1,from:null,loops:1,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onposition:null,onstop:null,onfailure:null,onfinish:null,multiShot:!0,multiShotEvents:!1,position:null,pan:0,playbackRate:1,stream:!0,to:null,type:null,usePolicyFile:!1,volume:100},this.flash9Options={isMovieStar:null,usePeakData:!1,useWaveformData:!1,useEQData:!1,onbufferchange:null,ondataerror:null},this.movieStarOptions={bufferTime:3,serverURL:null,onconnect:null,duration:null},this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:!0},mp4:{related:["aac","m4a","m4b"],type:['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],required:!1},ogg:{type:["audio/ogg; codecs=vorbis"],required:!1},opus:{type:["audio/ogg; codecs=opus","audio/opus"],required:!1},wav:{type:['audio/wav; codecs="1"',"audio/wav","audio/wave","audio/x-wav"],required:!1}},this.movieID="sm2-container",this.id=d||"sm2movie",this.debugID="soundmanager-debug",this.debugURLParam=/([#?&])debug=1/i,this.versionNumber="V2.97a.20150601",this.version=null,this.movieURL=null,this.altURL=null,this.swfLoaded=!1,this.enabled=!1,this.oMC=null,this.sounds={},this.soundIDs=[],this.muted=!1,this.didFlashBlock=!1,this.filePattern=null,this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i},this.features={buffering:!1,peakData:!1,waveformData:!1,eqData:!1,movieStar:!1},this.sandbox={type:null,types:{remote:"remote (domain-based) rules",localWithFile:"local with file access (no internet access)",localWithNetwork:"local with network (internet access only, no local access)",localTrusted:"local, trusted (local+internet access)"},description:null,noRemote:null,noLocal:null},this.html5={usingFlash:null},this.flash={},this.html5Only=!1,this.ignoreFlash=!1;var e,l,p,q,r,s,v,B,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,_,aa,ba,ea,fa,ga,ha,ia,ja,ka,la,ma,pa,qa,ra,ua,wa,ya,za,Aa,Ba,Ca,Da,Ea,Fa,Ga,Ja,Ka,La,Ma,Na,Oa,Pa,Qa,Sa,f=this,g=null,h=null,i="soundManager",j=i+": ",k="HTML5::",m=navigator.userAgent,n=a.location.href.toString(),o=document,t=[],u=!0,w=!1,x=!1,y=!1,z=!1,A=!1,C=0,Z=["log","info","warn","error"],$=8,ca=null,da=null,na=!1,oa=!1,sa=0,ta=null,va=[],xa=null,Ha=Array.prototype.slice,Ia=!1,Ra=0,Ta=1e3,Ua=m.match(/(i
11pad|iphone|ipod)/i),Va=m.match(/android/i),Wa=m.match(/(msie|trident)/i),Xa=m.match(/webkit/i),Ya=m.match(/safari/i)&&!m.match(/chrome/i),Za=m.match(/opera/i),$a=m.match(/(mobile|pre\/|xoom)/i)||Ua||Va,_a=!n.match(/usehtml5audio/i)&&!n.match(/sm2\-ignorebadua/i)&&Ya&&!m.match(/silk/i)&&m.match(/OS X 10_6_([3-7])/i),ab=a.console!==b&&console.log!==b,bb=o.hasFocus!==b?o.hasFocus():null,cb=Ya&&(o.hasFocus===b||!o.hasFocus()),db=!cb,eb=/(mp3|mp4|mpa|m4a|m4b)/i,fb="about:blank",gb="data:audio/wave;base64,/UklGRiYAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQIAAAD//w==",hb=o.location?o.location.protocol.match(/http/i):null,ib=hb?"":"http://",jb=/^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4||m4v|m4a|m4b|mp4v|3gp|3g2)\s*(?:$|;)/i,kb=["mpeg4","aac","flv","mov","mp4","m4v","f4v","m4a","m4b","mp4v","3gp","3g2"],lb=new RegExp("\\.("+kb.join("|")+")(\\?.*)?$","i");this.mimePattern=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i,this.useAltURL=!hb,ha={swfBox:"sm2-object-box",swfDefault:"movieContainer",swfError:"swf_error",swfTimedout:"swf_timedout",swfLoaded:"swf_loaded",swfUnblocked:"swf_unblocked",sm2Debug:"sm2_debug",highPerf:"high_performance",flashDebug:"flash_debug"},Ba=[null,"MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"],this.hasHTML5=function(){try{return Audio!==b&&(Za&&opera!==b&&opera.version()<10?new Audio(null):new Audio).canPlayType!==b}catch(a){return!1}}(),this.setup=function(a){var c=!f.url;return a!==b&&y&&xa&&f.ok()&&(a.flashVersion!==b||a.url!==b||a.html5Test!==b)&&la(ea("setupLate")),F(a),Ia||($a?f.setupOptions.ignoreMobileRestrictions&&!f.setupOptions.forceUseGlobalHTML5Audio||(va.push(P.globalHTML5),Ia=!0):f.setupOptions.forceUseGlobalHTML5Audio&&(va.push(P.globalHTML5),Ia=!0)),!Sa&&$a&&(f.setupOptions.ignoreMobileRestrictions?va.push(P.ignoreMobile):(f.setupOptions.useHTML5Audio&&!f.setupOptions.preferFlash||f._wD(P.mobileUA),f.setupOptions.useHTML5Audio=!0,f.setupOptions.preferFlash=!1,Ua?f.ignoreFlash=!0:(Va&&!m.match(/android\s2\.3/i)||!Va)&&(f._wD(P.globalHTML5),Ia=!0))),a&&(c&&T&&a.url!==b&&f.beginDelayedInit(),T||a.url===b||"complete"!==o.readyState||setTimeout(R,1)),Sa=!0,f},this.ok=function(){return xa?y&&!z:f.useHTML5Audio&&f.hasHTML5},this.supported=this.ok,this.getMovie=function(b){return l(b)||o[b]||a[b]},this.createSound=function(a,c){function l(){return j=ja(j),f.sounds[j.id]=new e(j),f.soundIDs.push(j.id),f.sounds[j.id]}var d,g,j,k=null;if(d=i+".createSound(): ",g=d+ea(y?"notOK":"notReady"),!y||!f.ok())return la(g),!1;if(c!==b&&(a={id:a,url:c}),j=E(a),j.url=ua(j.url),j.id===b&&(j.id=f.setupOptions.idPrefix+Ra++),j.id.toString().charAt(0).match(/^[0-9]$/)&&f._wD(d+ea("badID",j.id),2),f._wD(d+j.id+(j.url?" ("+j.url+")":""),1),ma(j.id,!0))return f._wD(d+j.id+" exists",1),f.sounds[j.id];if(za(j))k=l(),f.html5Only||f._wD(j.id+": Using HTML5"),k._setup_html5(j);else{if(f.html5Only)return f._wD(j.id+": No HTML5 support for this sound, and no Flash. Exiting."),l();if(f.html5.usingFlash&&j.url&&j.url.match(/data\:/i))return f._wD(j.id+": data: URIs not supported via Flash. Exiting."),l();s>8&&(null===j.isMovieStar&&(j.isMovieStar=!!(j.serverURL||!!j.type&&j.type.match(jb)||j.url&&j.url.match(lb))),j.isMovieStar&&(f._wD(d+"using MovieStar handling"),j.loops>1&&B("noNSLoop"))),j=ka(j,d),k=l(),8===s?h._createSound(j.id,j.loops||1,j.usePolicyFile):(h._createSound(j.id,j.url,j.usePeakData,j.useWaveformData,j.useEQData,j.isMovieStar,!!j.isMovieStar&&j.bufferTime,j.loops||1,j.serverURL,j.duration||null,j.autoPlay,!0,j.autoLoad,j.usePolicyFile),j.serverURL||(k.connected=!0,j.onconnect&&j.onconnect.apply(k))),j.serverURL||!j.autoLoad&&!j.autoPlay||k.load(j)}return!j.serverURL&&j.autoPlay&&k.play(),k},this.destroySound=function(a,b){if(!ma(a))return!1;var d,c=f.sounds[a];for(c.stop(),c._iO={},c.unload(),d=0;d<f.soundIDs.length;d++)if(f.soundIDs[d]===a){f.soundIDs.splice(d,1);break}return b||c.destruct(!0),c=null,delete f.sounds[a],!0},this.load=function(a,b){return!!ma(a)&&f.sounds[a].load(b)},this.unload=function(a){return!!ma(a)&&f.sounds[a].unload()},this.onPosition=function(a,b,c,d){return!!ma(a)&&f.sounds[a].onposition(b,c,d)},this.onposition=this.onPosition,this.clearOnPosition=function(a,b,c){return!!ma(a)&&f.sounds[a].clearOnPosition(b,c)},this.play=function(a,b){var c=null,d=b&&!(b instanceof Object);if(!y||!f.ok())return la(i+".play(): "+ea(y?"notOK":"notReady")),!1;if(ma(a,d))d&&(b={url:b});else{if(!d)return!1;d&&(b={url:b}),b&&b.url&&(f._wD(i+'.play(): Attempting to create "'+a+'"',1),b.id=a,c=f.createSound(b).play())}return null===c&&(c=f.sounds[a].play(b)),c},this.start=this.play,this.setPlaybackRate=function(a,b,c){return!!ma(a)&&f.sounds[a].setPlaybackRate(b,c)},this.setPosition=function(a,b){return!!ma(a)&&f.sounds[a].setPosition(b)},this.stop=function(a){return!!ma(a)&&(f._wD(i+".stop("+a+")",1),f.sounds[a].stop())},this.stopAll=function(){var a;f._wD(i+".stopAll()",1);for(a in f.sounds)f.sounds.hasOwnProperty(a)&&f.sounds[a].stop()},this.pause=function(a){return!!ma(a)&&f.sounds[a].pause()},this.pauseAll=function(){var a;for(a=f.soundIDs.length-1;a>=0;a--)f.sounds[f.soundIDs[a]].pause()},this.resume=function(a){return!!ma(a)&&f.sounds[a].resume()},this.resumeAll=function(){var a;for(a=f.soundIDs.length-1;a>=0;a--)f.sounds[f.soundIDs[a]].resume()},this.togglePause=function(a){return!!ma(a)&&f.sounds[a].togglePause()},this.setPan=function(a,b){return!!ma(a)&&f.sounds[a].setPan(b)},this.setVolume=function(a,c){var d,e;{if(a===b||isNaN(a)||c!==b)return!!ma(a)&&f.sounds[a].setVolume(c);for(d=0,e=f.soundIDs.length;d<e;d++)f.sounds[f.soundIDs[d]].setVolume(a)}},this.mute=function(a){var b=0;if(a instanceof String&&(a=null),a)return!!ma(a)&&(f._wD(i+'.mute(): Muting "'+a+'"'),f.sounds[a].mute());
11for(f._wD(i+".mute(): Muting all sounds"),b=f.soundIDs.length-1;b>=0;b--)f.sounds[f.soundIDs[b]].mute();return f.muted=!0,!0},this.muteAll=function(){f.mute()},this.unmute=function(a){var b;if(a instanceof String&&(a=null),a)return!!ma(a)&&(f._wD(i+'.unmute(): Unmuting "'+a+'"'),f.sounds[a].unmute());for(f._wD(i+".unmute(): Unmuting all sounds"),b=f.soundIDs.length-1;b>=0;b--)f.sounds[f.soundIDs[b]].unmute();return f.muted=!1,!0},this.unmuteAll=function(){f.unmute()},this.toggleMute=function(a){return!!ma(a)&&f.sounds[a].toggleMute()},this.getMemoryUse=function(){var a=0;return h&&8!==s&&(a=parseInt(h._getMemoryUse(),10)),a},this.disable=function(c){var d;if(c===b&&(c=!1),z)return!1;for(z=!0,B("shutdown",1),d=f.soundIDs.length-1;d>=0;d--)_(f.sounds[f.soundIDs[d]]);return _(f),D(c),Ga.remove(a,"load",J),!0},this.canPlayMIME=function(a){var b;return f.hasHTML5&&(b=Aa({type:a})),!b&&xa&&(b=a&&f.ok()?!!((s>8?a.match(jb):null)||a.match(f.mimePattern)):null),b},this.canPlayURL=function(a){var b;return f.hasHTML5&&(b=Aa({url:a})),!b&&xa&&(b=a&&f.ok()?!!a.match(f.filePattern):null),b},this.canPlayLink=function(a){return!(a.type===b||!a.type||!f.canPlayMIME(a.type))||f.canPlayURL(a.href)},this.getSoundById=function(a,b){if(!a)return null;var c=f.sounds[a];return c||b||f._wD(i+'.getSoundById(): Sound "'+a+'" not found.',2),c},this.onready=function(b,c){var d="onready",e=!1;if("function"!=typeof b)throw ea("needFunction",d);return y&&f._wD(ea("queue",d)),c||(c=a),H(d,b,c),I(),e=!0,e},this.ontimeout=function(b,c){var d="ontimeout",e=!1;if("function"!=typeof b)throw ea("needFunction",d);return y&&f._wD(ea("queue",d)),c||(c=a),H(d,b,c),I({type:d}),e=!0,e},this._writeDebug=function(a,c){var e,g,d="soundmanager-debug";return!!f.setupOptions.debugMode&&(!!(ab&&f.useConsole&&(c&&"object"==typeof c?console.log(a,c):Z[c]!==b?console[Z[c]](a):console.log(a),f.consoleOnly))||!!(e=l(d))&&(g=o.createElement("div"),++C%2===0&&(g.className="sm2-alt"),c=c===b?0:parseInt(c,10),g.appendChild(o.createTextNode(a)),c&&(c>=2&&(g.style.fontWeight="bold"),3===c&&(g.style.color="#ff3333")),e.insertBefore(g,e.firstChild),e=null,!0))},n.indexOf("sm2-debug=alert")!==-1&&(this._writeDebug=function(b){a.alert(b)}),this._wD=this._writeDebug,this._debug=function(){var a,b;for(B("currentObj",1),a=0,b=f.soundIDs.length;a<b;a++)f.sounds[f.soundIDs[a]]._debug()},this.reboot=function(b,c){f.soundIDs.length&&f._wD("Destroying "+f.soundIDs.length+" SMSound object"+(1!==f.soundIDs.length?"s":"")+"...");var d,e,g;for(d=f.soundIDs.length-1;d>=0;d--)f.sounds[f.soundIDs[d]].destruct();if(h)try{Wa&&(da=h.innerHTML),ca=h.parentNode.removeChild(h)}catch(a){B("badRemove",2)}if(da=ca=xa=h=null,f.enabled=T=y=na=oa=w=x=z=Ia=f.swfLoaded=!1,f.soundIDs=[],f.sounds={},Ra=0,Sa=!1,b)t=[];else for(d in t)if(t.hasOwnProperty(d))for(e=0,g=t[d].length;e<g;e++)t[d][e].fired=!1;return c||f._wD(i+": Rebooting..."),f.html5={usingFlash:null},f.flash={},f.html5Only=!1,f.ignoreFlash=!1,a.setTimeout(function(){c||f.beginDelayedInit()},20),f},this.reset=function(){return B("reset"),f.reboot(!0,!0)},this.getMoviePercent=function(){return h&&"PercentLoaded"in h?h.PercentLoaded():null},this.beginDelayedInit=function(){A=!0,R(),setTimeout(function(){return!oa&&(V(),Q(),oa=!0,!0)},20),K()},this.destruct=function(){f._wD(i+".destruct()"),f.disable(!0)},e=function(a){var d,e,i,j,k,l,p,q,t,u,c=this,m=!1,n=[],o=0,r=null;t={duration:null,time:null},this.id=a.id,this.sID=this.id,this.url=a.url,this.options=E(a),this.instanceOptions=this.options,this._iO=this.instanceOptions,this.pan=this.options.pan,this.volume=this.options.volume,this.isHTML5=!1,this._a=null,u=!this.url,this.id3={},this._debug=function(){f._wD(c.id+": Merged options:",c.options)},this.load=function(a){var e,d=null;if(a!==b?c._iO=E(a,c.options):(a=c.options,c._iO=a,r&&r!==c.url&&(B("manURL"),c._iO.url=c.url,c.url=null)),c._iO.url||(c._iO.url=c.url),c._iO.url=ua(c._iO.url),c.instanceOptions=c._iO,e=c._iO,f._wD(c.id+": load ("+e.url+")"),!e.url&&!c.url)return f._wD(c.id+": load(): url is unassigned. Exiting.",2),c;if(c.isHTML5||8!==s||c.url||e.autoPlay||f._wD(c.id+": Flash 8 load() limitation: Wait for onload() before calling play().",1),e.url===c.url&&0!==c.readyState&&2!==c.readyState)return B("onURL",1),3===c.readyState&&e.onload&&Qa(c,function(){e.onload.apply(c,[!!c.duration])}),c;if(c.loaded=!1,c.readyState=1,c.playState=0,c.id3={},za(e))d=c._setup_html5(e),d._called_load?f._wD(c.id+": Ignoring request to load again"):(c._html5_canplay=!1,c.url!==e.url&&(f._wD(B("manURL")+": "+e.url),c._a.src=e.url,c.setPosition(0)),c._a.autobuffer="auto",c._a.preload="auto",c._a._called_load=!0);else{if(f.html5Only)return f._wD(c.id+": No flash support. Exiting."),c;if(c._iO.url&&c._iO.url.match(/data\:/i))return f._wD(c.id+": data: URIs not supported via Flash. Exiting."),c;try{c.isHTML5=!1,c._iO=ka(ja(e)),c._iO.autoPlay&&(c._iO.position||c._iO.from)&&(f._w
11D(c.id+": Disabling autoPlay because of non-zero offset case"),c._iO.autoPlay=!1),e=c._iO,8===s?h._load(c.id,e.url,e.stream,e.autoPlay,e.usePolicyFile):h._load(c.id,e.url,!!e.stream,!!e.autoPlay,e.loops||1,!!e.autoLoad,e.usePolicyFile)}catch(a){B("smError",2),v("onload",!1),W({type:"SMSOUND_LOAD_JS_EXCEPTION",fatal:!0})}}return c.url=e.url,c},this.unload=function(){return 0!==c.readyState&&(f._wD(c.id+": unload()"),c.isHTML5?(j(),c._a&&(c._a.pause(),r=Da(c._a))):8===s?h._unload(c.id,fb):h._unload(c.id),d()),c},this.destruct=function(a){f._wD(c.id+": Destruct"),c.isHTML5?(j(),c._a&&(c._a.pause(),Da(c._a),Ia||i(),c._a._s=null,c._a=null)):(c._iO.onfailure=null,h._destroySound(c.id)),a||f.destroySound(c.id,!0)},this.play=function(a,d){var e,g,i,j,n,o,p,r=!0,t=null;if(e=c.id+": play(): ",d=d===b||d,a||(a={}),c.url&&(c._iO.url=c.url),c._iO=E(c._iO,c.options),c._iO=E(a,c._iO),c._iO.url=ua(c._iO.url),c.instanceOptions=c._iO,!c.isHTML5&&c._iO.serverURL&&!c.connected)return c.getAutoPlay()||(f._wD(e+" Netstream not connected yet - setting autoPlay"),c.setAutoPlay(!0)),c;if(za(c._iO)&&(c._setup_html5(c._iO),k()),1!==c.playState||c.paused||(g=c._iO.multiShot,g?f._wD(e+"Already playing (multi-shot)",1):(f._wD(e+"Already playing (one-shot)",1),c.isHTML5&&c.setPosition(c._iO.position),t=c)),null!==t)return t;if(a.url&&a.url!==c.url&&(c.readyState||c.isHTML5||8!==s||!u?c.load(c._iO):u=!1),c.loaded?f._wD(e.substr(0,e.lastIndexOf(":"))):0===c.readyState?(f._wD(e+"Attempting to load"),c.isHTML5||f.html5Only?c.isHTML5?c.load(c._iO):(f._wD(e+"Unsupported type. Exiting."),t=c):(c._iO.autoPlay=!0,c.load(c._iO)),c.instanceOptions=c._iO):2===c.readyState?(f._wD(e+"Could not load - exiting",2),t=c):f._wD(e+"Loading - attempting to play..."),null!==t)return t;if(!c.isHTML5&&9===s&&c.position>0&&c.position===c.duration&&(f._wD(e+"Sound at end, resetting to position: 0"),a.position=0),c.paused&&c.position>=0&&(!c._iO.serverURL||c.position>0))f._wD(e+"Resuming from paused state",1),c.resume();else{if(c._iO=E(a,c._iO),(!c.isHTML5&&null!==c._iO.position&&c._iO.position>0||null!==c._iO.from&&c._iO.from>0||null!==c._iO.to)&&0===c.instanceCount&&0===c.playState&&!c._iO.serverURL){if(j=function(){c._iO=E(a,c._iO),c.play(c._iO)},c.isHTML5&&!c._html5_canplay?(f._wD(e+"Beginning load for non-zero offset case"),c.load({_oncanplay:j}),t=!1):c.isHTML5||c.loaded||c.readyState&&2===c.readyState||(f._wD(e+"Preloading for non-zero offset case"),c.load({onload:j}),t=!1),null!==t)return t;c._iO=q()}(!c.instanceCount||c._iO.multiShotEvents||c.isHTML5&&c._iO.multiShot&&!Ia||!c.isHTML5&&s>8&&!c.getAutoPlay())&&c.instanceCount++,c._iO.onposition&&0===c.playState&&l(c),c.playState=1,c.paused=!1,c.position=c._iO.position===b||isNaN(c._iO.position)?0:c._iO.position,c.isHTML5||(c._iO=ka(ja(c._iO))),c._iO.onplay&&d&&(c._iO.onplay.apply(c),m=!0),c.setVolume(c._iO.volume,!0),c.setPan(c._iO.pan,!0),1!==c._iO.playbackRate&&c.setPlaybackRate(c._iO.playbackRate),c.isHTML5?c.instanceCount<2?(k(),i=c._setup_html5(),c.setPosition(c._iO.position),i.play()):(f._wD(c.id+": Cloning Audio() for instance #"+c.instanceCount+"..."),n=new Audio(c._iO.url),o=function(){Ga.remove(n,"ended",o),c._onfinish(c),Da(n),n=null},p=function(){Ga.remove(n,"canplay",p);try{n.currentTime=c._iO.position/Ta}catch(a){la(c.id+": multiShot play() failed to apply position of "+c._iO.position/Ta)}n.play()},Ga.add(n,"ended",o),c._iO.volume!==b&&(n.volume=Math.max(0,Math.min(1,c._iO.volume/100))),c.muted&&(n.muted=!0),c._iO.position?Ga.add(n,"canplay",p):n.play()):(r=h._start(c.id,c._iO.loops||1,9===s?c.position:c.position/Ta,c._iO.multiShot||!1),9!==s||r||(f._wD(e+"No sound hardware, or 32-sound ceiling hit",2),c._iO.onplayerror&&c._iO.onplayerror.apply(c)))}return c},this.start=this.play,this.stop=function(a){var d,b=c._iO;return 1===c.playState&&(f._wD(c.id+": stop()"),c._onbufferchange(0),c._resetOnPosition(0),c.paused=!1,c.isHTML5||(c.playState=0),p(),b.to&&c.clearOnPosition(b.to),c.isHTML5?c._a&&(d=c.position,c.setPosition(0),c.position=d,c._a.pause(),c.playState=0,c._onTimer(),j()):(h._stop(c.id,a),b.serverURL&&c.unload()),c.instanceCount=0,c._iO={},b.onstop&&b.onstop.apply(c)),c},this.setAutoPlay=function(a){f._wD(c.id+": Autoplay turned "+(a?"on":"off")),c._iO.autoPlay=a,c.isHTML5||(h._setAutoPlay(c.id,a),a&&(c.instanceCount||1!==c.readyState||(c.instanceCount++,f._wD(c.id+": Incremented instance count to "+c.instanceCount))))},this.getAutoPlay=function(){return c._iO.autoPlay},this.setPlaybackRate=function(a){var b=Math.max(.5,Math.min(4,a));if(b!==a&&f._wD(c.id+": setPlaybackRate("+a+"): limiting rate to "+b,2),c.isHTML5)try{c._iO.playbackRate=b,c._a.playbackRate=b}catch(a){f._wD(c.id+": setPlaybackRate("+b+") failed: "+a.message,2)}return c},this.setPosition=function(a){a===b&&(a=0);var d,e,g=c.isHTML5?Math.max(a,0):Math.min(c.duration||c._iO.duration,Math.max(a,0));if(c.position=g,e=c.position/Ta,c._resetOnPosition(c.position),c._iO.position=g,c.isHTML5){if(c._a){if(c._html5_canplay){if(c._a.currentTime!==e){f._wD(c.id+": setPosition("+e+")");try{c._a.currentTime=e,(0===c.playState||c.paused)&&c._a.pause()}catch(a){f._wD(c.id+": setPosition("+e+") failed: "+a.message,2)}}}else if(e)return f._wD(c.id+": setPosition("+e+"): Cannot seek yet, sound not ready",2),c;c.paused&&c._onTimer(!0)}}else d=9===s?c.position:e,c.readyState&&2!==c.readyState&&h._setPosition(c.id,d,c.paused||!c.playState,c._iO.multiSh
11ot);return c},this.pause=function(a){return c.paused||0===c.playState&&1!==c.readyState?c:(f._wD(c.id+": pause()"),c.paused=!0,c.isHTML5?(c._setup_html5().pause(),j()):(a||a===b)&&h._pause(c.id,c._iO.multiShot),c._iO.onpause&&c._iO.onpause.apply(c),c)},this.resume=function(){var a=c._iO;return c.paused?(f._wD(c.id+": resume()"),c.paused=!1,c.playState=1,c.isHTML5?(c._setup_html5().play(),k()):(a.isMovieStar&&!a.serverURL&&c.setPosition(c.position),h._pause(c.id,a.multiShot)),!m&&a.onplay?(a.onplay.apply(c),m=!0):a.onresume&&a.onresume.apply(c),c):c},this.togglePause=function(){return f._wD(c.id+": togglePause()"),0===c.playState?(c.play({position:9!==s||c.isHTML5?c.position/Ta:c.position}),c):(c.paused?c.resume():c.pause(),c)},this.setPan=function(a,d){return a===b&&(a=0),d===b&&(d=!1),c.isHTML5||h._setPan(c.id,a),c._iO.pan=a,d||(c.pan=a,c.options.pan=a),c},this.setVolume=function(a,d){return a===b&&(a=100),d===b&&(d=!1),c.isHTML5?c._a&&(f.muted&&!c.muted&&(c.muted=!0,c._a.muted=!0),c._a.volume=Math.max(0,Math.min(1,a/100))):h._setVolume(c.id,f.muted&&!c.muted||c.muted?0:a),c._iO.volume=a,d||(c.volume=a,c.options.volume=a),c},this.mute=function(){return c.muted=!0,c.isHTML5?c._a&&(c._a.muted=!0):h._setVolume(c.id,0),c},this.unmute=function(){c.muted=!1;var a=c._iO.volume!==b;return c.isHTML5?c._a&&(c._a.muted=!1):h._setVolume(c.id,a?c._iO.volume:c.options.volume),c},this.toggleMute=function(){return c.muted?c.unmute():c.mute()},this.onPosition=function(a,d,e){return n.push({position:parseInt(a,10),method:d,scope:e!==b?e:c,fired:!1}),c},this.onposition=this.onPosition,this.clearOnPosition=function(a,b){var c;if(a=parseInt(a,10),isNaN(a))return!1;for(c=0;c<n.length;c++)a===n[c].position&&(b&&b!==n[c].method||(n[c].fired&&o--,n.splice(c,1)))},this._processOnPosition=function(){var a,b,d=n.length;if(!d||!c.playState||o>=d)return!1;for(a=d-1;a>=0;a--)b=n[a],!b.fired&&c.position>=b.position&&(b.fired=!0,o++,b.method.apply(b.scope,[b.position]),d=n.length);return!0},this._resetOnPosition=function(a){var b,c,d=n.length;if(!d)return!1;for(b=d-1;b>=0;b--)c=n[b],c.fired&&a<=c.position&&(c.fired=!1,o--);return!0},q=function(){var e,g,a=c._iO,b=a.from,d=a.to;return g=function(){f._wD(c.id+': "To" time of '+d+" reached."),c.clearOnPosition(d,g),c.stop()},e=function(){f._wD(c.id+': Playing "from" '+b),null===d||isNaN(d)||c.onPosition(d,g)},null===b||isNaN(b)||(a.position=b,a.multiShot=!1,e()),a},l=function(){var a,b=c._iO.onposition;if(b)for(a in b)b.hasOwnProperty(a)&&c.onPosition(parseInt(a,10),b[a])},p=function(){var a,b=c._iO.onposition;if(b)for(a in b)b.hasOwnProperty(a)&&c.clearOnPosition(parseInt(a,10))},k=function(){c.isHTML5&&pa(c)},j=function(){c.isHTML5&&qa(c)},d=function(a){a||(n=[],o=0),m=!1,c._hasTimer=null,c._a=null,c._html5_canplay=!1,c.bytesLoaded=null,c.bytesTotal=null,c.duration=c._iO&&c._iO.duration?c._iO.duration:null,c.durationEstimate=null,c.buffered=[],c.eqData=[],c.eqData.left=[],c.eqData.right=[],c.failures=0,c.isBuffering=!1,c.instanceOptions={},c.instanceCount=0,c.loaded=!1,c.metadata={},c.readyState=0,c.muted=!1,c.paused=!1,c.peakData={left:0,right:0},c.waveformData={left:[],right:[]},c.playState=0,c.position=null,c.id3={}},d(),this._onTimer=function(a){var b,e,d=!1,f={};if(c._hasTimer||a)return c._a&&(a||(c.playState>0||1===c.readyState)&&!c.paused)&&(b=c._get_html5_duration(),b!==t.duration&&(t.duration=b,c.duration=b,d=!0),c.durationEstimate=c.duration,e=c._a.currentTime*Ta||0,e!==t.time&&(t.time=e,d=!0),(d||a)&&c._whileplaying(e,f,f,f,f)),d},this._get_html5_duration=function(){var a=c._iO,b=c._a&&c._a.duration?c._a.duration*Ta:a&&a.duration?a.duration:null,d=b&&!isNaN(b)&&b!==1/0?b:null;return d},this._apply_loop=function(a,b){!a.loop&&b>1&&f._wD("Note: Native HTML5 looping is infinite.",1),a.loop=b>1?"loop":""},this._setup_html5=function(a){var i,b=E(c._iO,a),f=Ia?g:c._a,h=decodeURI(b.url);if(Ia?h===decodeURI(Ja)&&(i=!0):h===decodeURI(r)&&(i=!0),f){if(f._s)if(Ia)f._s&&f._s.playState&&!i&&f._s.stop();else if(!Ia&&h===decodeURI(r))return c._apply_loop(f,b.loops),f;i||(r&&d(!1),f.src=b.url,c.url=b.url,r=b.url,Ja=b.url,f._called_load=!1)}else b.autoLoad||b.autoPlay?(c._a=new Audio(b.url),c._a.load()):c._a=Za&&opera.version()<10?new Audio(null):new Audio,f=c._a,f._called_load=!1,Ia&&(g=f);return c.isHTML5=!0,c._a=f,f._s=c,e(),c._apply_loop(f,b.loops),b.autoLoad||b.autoPlay?c.load():(f.autobuffer=!1,f.preload="auto"),f},e=function(){function b(a,b,d){return c._a?c._a.addEventListener(a,b,d||!1):null}if(c._a._added_events)return!1;var a;c._a._added_events=!0;for(a in Na)Na.hasOwnProperty(a)&&b(a,Na[a]);return!0},i=function(){function b(a,b,d){return c._a?c._a.removeEventListener(a,b,d||!1):null}var a;f._wD(c.id+": Removing event listeners"),c._a._added_events=!1;for(a in Na)Na.hasOwnProperty(a)&&b(a,Na[a])},this._onload=function(a){var b,d=!!a||!c.isHTML5&&8===s&&c.duration;return b=c.id+": ",f._wD(b+(d?"onload()":"Failed to load / invali
11d sound?"+(c.duration?" -":" Zero-length duration reported.")+" ("+c.url+")"),d?1:2),d||c.isHTML5||(f.sandbox.noRemote===!0&&f._wD(b+ea("noNet"),1),f.sandbox.noLocal===!0&&f._wD(b+ea("noLocal"),1)),c.loaded=d,c.readyState=d?3:2,c._onbufferchange(0),c._iO.onload&&Qa(c,function(){c._iO.onload.apply(c,[d])}),!0},this._onbufferchange=function(a){return 0!==c.playState&&(!(a&&c.isBuffering||!a&&!c.isBuffering)&&(c.isBuffering=1===a,c._iO.onbufferchange&&(f._wD(c.id+": Buffer state change: "+a),c._iO.onbufferchange.apply(c,[a])),!0))},this._onsuspend=function(){return c._iO.onsuspend&&(f._wD(c.id+": Playback suspended"),c._iO.onsuspend.apply(c)),!0},this._onfailure=function(a,b,d){c.failures++,f._wD(c.id+": Failure ("+c.failures+"): "+a),c._iO.onfailure&&1===c.failures?c._iO.onfailure(a,b,d):f._wD(c.id+": Ignoring failure")},this._onwarning=function(a,b,d){c._iO.onwarning&&c._iO.onwarning(a,b,d)},this._onfinish=function(){var a=c._iO.onfinish;c._onbufferchange(0),c._resetOnPosition(0),c.instanceCount&&(c.instanceCount--,c.instanceCount||(p(),c.playState=0,c.paused=!1,c.instanceCount=0,c.instanceOptions={},c._iO={},j(),c.isHTML5&&(c.position=0)),c.instanceCount&&!c._iO.multiShotEvents||a&&(f._wD(c.id+": onfinish()"),Qa(c,function(){a.apply(c)})))},this._whileloading=function(a,b,d,e){var f=c._iO;c.bytesLoaded=a,c.bytesTotal=b,c.duration=Math.floor(d),c.bufferLength=e,c.isHTML5||f.isMovieStar?c.durationEstimate=c.duration:f.duration?c.durationEstimate=c.duration>f.duration?c.duration:f.duration:c.durationEstimate=parseInt(c.bytesTotal/c.bytesLoaded*c.duration,10),c.isHTML5||(c.buffered=[{start:0,end:c.duration}]),(3!==c.readyState||c.isHTML5)&&f.whileloading&&f.whileloading.apply(c)},this._whileplaying=function(a,d,e,f,g){var i,h=c._iO;return!isNaN(a)&&null!==a&&(c.position=Math.max(0,a),c._processOnPosition(),!c.isHTML5&&s>8&&(h.usePeakData&&d!==b&&d&&(c.peakData={left:d.leftPeak,right:d.rightPeak}),h.useWaveformData&&e!==b&&e&&(c.waveformData={left:e.split(","),right:f.split(",")}),h.useEQData&&g!==b&&g&&g.leftEQ&&(i=g.leftEQ.split(","),c.eqData=i,c.eqData.left=i,g.rightEQ!==b&&g.rightEQ&&(c.eqData.right=g.rightEQ.split(",")))),1===c.playState&&(c.isHTML5||8!==s||c.position||!c.isBuffering||c._onbufferchange(0),h.whileplaying&&h.whileplaying.apply(c)),!0)},this._oncaptiondata=function(a){f._wD(c.id+": Caption data received."),c.captiondata=a,c._iO.oncaptiondata&&c._iO.oncaptiondata.apply(c,[a])},this._onmetadata=function(a,b){f._wD(c.id+": Metadata received.");var e,g,d={};for(e=0,g=a.length;e<g;e++)d[a[e]]=b[e];c.metadata=d,c._iO.onmetadata&&c._iO.onmetadata.call(c,c.metadata)},this._onid3=function(a,b){f._wD(c.id+": ID3 data received.");var e,g,d=[];for(e=0,g=a.length;e<g;e++)d[a[e]]=b[e];c.id3=E(c.id3,d),c._iO.onid3&&c._iO.onid3.apply(c)},this._onconnect=function(a){a=1===a,f._wD(c.id+": "+(a?"Connected.":"Failed to connect? - "+c.url),a?1:2),c.connected=a,a&&(c.failures=0,ma(c.id)&&(c.getAutoPlay()?c.play(b,c.getAutoPlay()):c._iO.autoLoad&&c.load()),c._iO.onconnect&&c._iO.onconnect.apply(c,[a]))},this._ondataerror=function(a){c.playState>0&&(f._wD(c.id+": Data error: "+a),c._iO.ondataerror&&c._iO.ondataerror.apply(c))},this._debug()},U=function(){return o.body||o.getElementsByTagName("div")[0]},l=function(a){return o.getElementById(a)},E=function(a,c){var e,g,d=a||{};e=c===b?f.defaultOptions:c;for(g in e)e.hasOwnProperty(g)&&d[g]===b&&("object"!=typeof e[g]||null===e[g]?d[g]=e[g]:d[g]=E(d[g],e[g]));return d},Qa=function(b,c){b.isHTML5||8!==s?c():a.setTimeout(c,0)},G={onready:1,ontimeout:1,defaultOptions:1,flash9Options:1,movieStarOptions:1},F=function(a,c){var d,e=!0,g=c!==b,h=f.setupOptions,i=G;if(a===b){e=[];for(d in h)h.hasOwnProperty(d)&&e.push(d);for(d in i)i.hasOwnProperty(d)&&("object"==typeof f[d]?e.push(d+": {...}"):f[d]instanceof Function?e.push(d+": function() {...}"):e.push(d));return f._wD(ea("setup",e.join(", "))),!1}for(d in a)if(a.hasOwnProperty(d))if("object"!=typeof a[d]||null===a[d]||a[d]instanceof Array||a[d]instanceof RegExp)g&&i[c]!==b?f[c][d]=a[d]:h[d]!==b?(f.setupOptions[d]=a[d],f[d]=a[d]):i[d]===b?(la(ea(f[d]===b?"setupUndef":"setupError",d),2),e=!1):f[d]instanceof Function?f[d].apply(f,a[d]instanceof Array?a[d]:[a[d]]):f[d]=a[d];else{if(i[d]!==b)return F(a[d],d);la(ea(f[d]===b?"setupUndef":"setupError",d),2),e=!1}return e},Ga=function(){function d(a){var c=Ha.call(a),d=c.length;return b?(c[1]="on"+c[1],d>3&&c.pop()):3===d&&c.push(!1),c}function e(a,d){var e=a.shift(),f=[c[d]];b?e[f](a[0],a[1]):e[f].apply(e,a)}function f(){e(d(arguments),"add")}function g(){e(d(arguments),"remove")}var b=a.attachEvent,c={add:b?"attachEvent":"addEventListener",remove:b?"detachEvent":"removeEventListener"};return{add:f,remove:g}}(),Na={abort:nb(function(){f._wD(this._s.id+": abort")}),canplay:nb(function(){var c,a=this._s;if(a._html5_canplay)return!0;
11if(a._html5_canplay=!0,f._wD(a.id+": canplay"),a._onbufferchange(0),c=a._iO.position===b||isNaN(a._iO.position)?null:a._iO.position/Ta,this.currentTime!==c){f._wD(a.id+": canplay: Setting position to "+c);try{this.currentTime=c}catch(b){f._wD(a.id+": canplay: Setting position of "+c+" failed: "+b.message,2)}}a._iO._oncanplay&&a._iO._oncanplay()}),canplaythrough:nb(function(){var a=this._s;a.loaded||(a._onbufferchange(0),a._whileloading(a.bytesLoaded,a.bytesTotal,a._get_html5_duration()),a._onload(!0))}),durationchange:nb(function(){var b,a=this._s;b=a._get_html5_duration(),isNaN(b)||b===a.duration||(f._wD(this._s.id+": durationchange ("+b+")"+(a.duration?", previously "+a.duration:"")),a.durationEstimate=a.duration=b)}),ended:nb(function(){var a=this._s;f._wD(a.id+": ended"),a._onfinish()}),error:nb(function(){f._wD(this._s.id+": HTML5 error, code "+this.error.code),this._s._onload(!1)}),loadeddata:nb(function(){var a=this._s;f._wD(a.id+": loadeddata"),a._loaded||Ya||(a.duration=a._get_html5_duration())}),loadedmetadata:nb(function(){f._wD(this._s.id+": loadedmetadata")}),loadstart:nb(function(){f._wD(this._s.id+": loadstart"),this._s._onbufferchange(1)}),play:nb(function(){this._s._onbufferchange(0)}),playing:nb(function(){f._wD(this._s.id+": playing "+String.fromCharCode(9835)),this._s._onbufferchange(0)}),progress:nb(function(a){var c,d,e,b=this._s,g=0,h="progress"===a.type,i=a.target.buffered,j=a.loaded||0,k=a.total||1;if(b.buffered=[],i&&i.length){for(c=0,d=i.length;c<d;c++)b.buffered.push({start:i.start(c)*Ta,end:i.end(c)*Ta});if(g=(i.end(0)-i.start(0))*Ta,j=Math.min(1,g/(a.target.duration*Ta)),h&&i.length>1){for(e=[],d=i.length,c=0;c<d;c++)e.push(a.target.buffered.start(c)*Ta+"-"+a.target.buffered.end(c)*Ta);f._wD(this._s.id+": progress, timeRanges: "+e.join(", "))}h&&!isNaN(j)&&f._wD(this._s.id+": progress, "+Math.floor(100*j)+"% loaded")}isNaN(j)||(b._whileloading(j,k,b._get_html5_duration()),j&&k&&j===k&&Na.canplaythrough.call(this,a))}),ratechange:nb(function(){f._wD(this._s.id+": ratechange")}),suspend:nb(function(a){var b=this._s;f._wD(this._s.id+": suspend"),Na.progress.call(this,a),b._onsuspend()}),stalled:nb(function(){f._wD(this._s.id+": stalled")}),timeupdate:nb(function(){this._s._onTimer()}),waiting:nb(function(){var a=this._s;f._wD(this._s.id+": waiting"),a._onbufferchange(1)})},za=function(a){var b;return b=!(!a||!(a.type||a.url||a.serverURL))&&(!(a.serverURL||a.type&&mb(a.type))&&(a.type?Aa({type:a.type}):Aa({url:a.url})||f.html5Only||a.url.match(/data\:/i)))},Da=function(a){var c;return a&&(c=Ya?fb:f.html5.canPlayType("audio/wav")?gb:fb,a.src=c,a._called_unload!==b&&(a._called_load=!1)),Ia&&(Ja=null),c},Aa=function(a){if(!f.useHTML5Audio||!f.hasHTML5)return!1;var g,h,i,j,c=a.url||null,d=a.type||null,e=f.audioFormats;if(d&&f.html5[d]!==b)return f.html5[d]&&!mb(d);if(!Ca){Ca=[];for(j in e)e.hasOwnProperty(j)&&(Ca.push(j),e[j].related&&(Ca=Ca.concat(e[j].related)));Ca=new RegExp("\\.("+Ca.join("|")+")(\\?.*)?$","i")}return i=c?c.toLowerCase().match(Ca):null, 12i&&i.length?i=i[1]:d?(h=d.indexOf(";"),i=(h!==-1?d.substr(0,h):d).substr(6)):g=!1,i&&f.html5[i]!==b?g=f.html5[i]&&!mb(i):(d="audio/"+i,g=f.html5.canPlayType({type:d}),f.html5[i]=g,g=g&&f.html5[d]&&!mb(d)),g},Fa=function(){function i(b){var c,d,e=!1,g=!1;if(!a||"function"!=typeof a.canPlayType)return e;if(b instanceof Array){for(h=0,d=b.length;h<d;h++)(f.html5[b[h]]||a.canPlayType(b[h]).match(f.html5Test))&&(g=!0,f.html5[b[h]]=!0,f.flash[b[h]]=!!b[h].match(eb));e=g}else c=!(!a||"function"!=typeof a.canPlayType)&&a.canPlayType(b),e=!(!c||!c.match(f.html5Test));return e}if(!f.useHTML5Audio||!f.hasHTML5)return f.html5.usingFlash=!0,xa=!0,!1;var c,d,g,h,a=Audio!==b?Za&&opera.version()<10?new Audio(null):new Audio:null,e={};g=f.audioFormats;for(c in g)if(g.hasOwnProperty(c)&&(d="audio/"+c,e[c]=i(g[c].type),e[d]=e[c],c.match(eb)?(f.flash[c]=!0,f.flash[d]=!0):(f.flash[c]=!1,f.flash[d]=!1),g[c]&&g[c].related))for(h=g[c].related.length-1;h>=0;h--)e["audio/"+g[c].related[h]]=e[c],f.html5[g[c].related[h]]=e[c],f.flash[g[c].related[h]]=e[c];return e.canPlayType=a?i:null,f.html5=E(f.html5,e),f.html5.usingFlash=ya(),xa=f.html5.usingFlash,!0},P={notReady:"Unavailable - wait until onready() has fired.",notOK:"Audio support is not available.",domError:i+"exception caught while appending SWF to DOM.",spcWmode:"Removing wmode, preventing known SWF loading issue(s)",swf404:j+"Verify that %s is a valid path.",tryDebug:"Try "+i+".debugFlash = true for more security details (output goes to SWF.)",checkSWF:"See SWF output for more debug info.",localFail:j+"Non-HTTP page ("+o.location.protocol+" URL?) Review Flash player security settings for this special case:\nhttp://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html\nM
12ay need to add/allow path, eg. c:/sm2/ or /users/me/sm2/",waitFocus:j+"Special case: Waiting for SWF to load with window focus...",waitForever:j+"Waiting indefinitely for Flash (will recover if unblocked)...",waitSWF:j+"Waiting for 100% SWF load...",needFunction:j+"Function object expected for %s",badID:'Sound ID "%s" should be a string, starting with a non-numeric character',currentObj:j+"_debug(): Current sound objects",waitOnload:j+"Waiting for window.onload()",docLoaded:j+"Document already loaded",onload:j+"initComplete(): calling soundManager.onload()",onloadOK:i+".onload() complete",didInit:j+"init(): Already called?",secNote:"Flash security note: Network/internet URLs will not load due to security restrictions. Access can be configured via Flash Player Global Security Settings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html",badRemove:j+"Failed to remove Flash node.",shutdown:i+".disable(): Shutting down",queue:j+"Queueing %s handler",smError:"SMSound.load(): Exception: JS-Flash communication failed, or JS error.",fbTimeout:"No flash response, applying ."+ha.swfTimedout+" CSS...",fbLoaded:"Flash loaded",fbHandler:j+"flashBlockHandler()",manURL:"SMSound.load(): Using manually-assigned URL",onURL:i+".load(): current URL already assigned.",badFV:i+'.flashVersion must be 8 or 9. "%s" is invalid. Reverting to %s.',as2loop:"Note: Setting stream:false so looping can work (flash 8 limitation)",noNSLoop:"Note: Looping not implemented for MovieStar formats",needfl9:"Note: Switching to flash 9, required for MP4 formats.",mfTimeout:"Setting flashLoadTimeout = 0 (infinite) for off-screen, mobile flash case",needFlash:j+"Fatal error: Flash is needed to play some required formats, but is not available.",gotFocus:j+"Got window focus.",policy:"Enabling usePolicyFile for data access",setup:i+".setup(): allowed parameters: %s",setupError:i+'.setup(): "%s" cannot be assigned with this method.',setupUndef:i+'.setup(): Could not find option "%s"',setupLate:i+".setup(): url, flashVersion and html5Test property changes will not take effect until reboot().",noURL:j+"Flash URL required. Call soundManager.setup({url:...}) to get started.",sm2Loaded:"SoundManager 2: Ready. "+String.fromCharCode(10003),reset:i+".reset(): Removing event callbacks",mobileUA:"Mobile UA detected, preferring HTML5 by default.",globalHTML5:"Using singleton HTML5 Audio() pattern for this device.",ignoreMobile:"Ignoring mobile restrictions for this device."},ea=function(){var a,b,c,d,e;if(a=Ha.call(arguments),d=a.shift(),e=P&&P[d]?P[d]:"",e&&a&&a.length)for(b=0,c=a.length;b<c;b++)e=e.replace("%s",a[b]);return e},ja=function(a){return 8===s&&a.loops>1&&a.stream&&(B("as2loop"),a.stream=!1),a},ka=function(a,b){return a&&!a.usePolicyFile&&(a.onid3||a.usePeakData||a.useWaveformData||a.useEQData)&&(f._wD((b||"")+ea("policy")),a.usePolicyFile=!0),a},la=function(a){ab&&console.warn!==b?console.warn(a):f._wD(a)},p=function(){return!1},_=function(a){var b;for(b in a)a.hasOwnProperty(b)&&"function"==typeof a[b]&&(a[b]=p);b=null},aa=function(a){a===b&&(a=!1),(z||a)&&f.disable(a)},ba=function(a){var c,b=null;if(a)if(a.match(/\.swf(\?.*)?$/i)){if(b=a.substr(a.toLowerCase().lastIndexOf(".swf?")+4))return a}else a.lastIndexOf("/")!==a.length-1&&(a+="/");return c=(a&&a.lastIndexOf("/")!==-1?a.substr(0,a.lastIndexOf("/")+1):"./")+f.movieURL,f.noSWFCache&&(c+="?ts="+(new Date).getTime()),c},N=function(){s=parseInt(f.flashVersion,10),8!==s&&9!==s&&(f._wD(ea("badFV",s,$)),f.flashVersion=s=$);var a=f.debugMode||f.debugFlash?"_debug.swf":".swf";f.useHTML5Audio&&!f.html5Only&&f.audioFormats.mp4.required&&s<9&&(f._wD(ea("needfl9")),f.flashVersion=s=9),f.version=f.versionNumber+(f.html5Only?" (HTML5-only mode)":9===s?" (AS3/Flash 9)":" (AS2/Flash 8)"),s>8?(f.defaultOptions=E(f.defaultOptions,f.flash9Options),f.features.buffering=!0,f.defaultOptions=E(f.defaultOptions,f.movieStarOptions),f.filePatterns.flash9=new RegExp("\\.(mp3|"+kb.join("|")+")(\\?.*)?$","i"),f.features.movieStar=!0):f.features.movieStar=!1,f.filePattern=f.filePatterns[8!==s?"flash9":"flash8"],f.movieURL=(8===s?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",a),f.features.peakData=f.features.waveformData=f.features.eqData=s>8},X=function(a,b){return!!h&&void h._setPolling(a,b)},Y=function(){if(f.debugURLParam.test(n)&&(f.setupOptions.debugMode=f.debugMode=!0),l(f.debugID))return!1;var a,b,c,d,e;if(f.debugMode&&!l(f.debugID)&&(!ab||!f.useConsole||!f.consoleOnly)){a=o.createElement("div"),a.id=f.debugID+"-toggle",d={position:"fixed",bottom:"0px",right:"0px",width:"1.2em",height:"1.2em",lineHeight:"1.2em",margin:"2px",textAlign:"center",border:"1px solid #999",curs
12or:"pointer",background:"#fff",color:"#333",zIndex:10001},a.appendChild(o.createTextNode("-")),a.onclick=ia,a.title="Toggle SM2 debug console",m.match(/msie 6/i)&&(a.style.position="absolute",a.style.cursor="hand");for(e in d)d.hasOwnProperty(e)&&(a.style[e]=d[e]);if(b=o.createElement("div"),b.id=f.debugID,b.style.display=f.debugMode?"block":"none",f.debugMode&&!l(a.id)){try{c=U(),c.appendChild(a)}catch(a){throw new Error(ea("domError")+" \n"+a.toString())}c.appendChild(b)}}c=null},ma=this.getSoundById,B=function(a,b){return a?f._wD(ea(a),b):""},ia=function(){var a=l(f.debugID),b=l(f.debugID+"-toggle");return!!a&&(u?(b.innerHTML="+",a.style.display="none"):(b.innerHTML="-",a.style.display="block"),void(u=!u))},v=function(c,d,e){if(a.sm2Debugger!==b)try{sm2Debugger.handleEvent(c,d,e)}catch(a){return!1}return!0},ga=function(){var a=[];return f.debugMode&&a.push(ha.sm2Debug),f.debugFlash&&a.push(ha.flashDebug),f.useHighPerformance&&a.push(ha.highPerf),a.join(" ")},fa=function(){var a=ea("fbHandler"),b=f.getMoviePercent(),c=ha,d={type:"FLASHBLOCK"};return!f.html5Only&&void(f.ok()?(f.didFlashBlock&&f._wD(a+": Unblocked"),f.oMC&&(f.oMC.className=[ga(),c.swfDefault,c.swfLoaded+(f.didFlashBlock?" "+c.swfUnblocked:"")].join(" "))):(xa&&(f.oMC.className=ga()+" "+c.swfDefault+" "+(null===b?c.swfTimedout:c.swfError),f._wD(a+": "+ea("fbTimeout")+(b?" ("+ea("fbLoaded")+")":""))),f.didFlashBlock=!0,I({type:"ontimeout",ignoreInit:!0,error:d}),W(d)))},H=function(a,c,d){t[a]===b&&(t[a]=[]),t[a].push({method:c,scope:d||null,fired:!1})},I=function(a){if(a||(a={type:f.ok()?"onready":"ontimeout"}),!y&&a&&!a.ignoreInit)return!1;if("ontimeout"===a.type&&(f.ok()||z&&!a.ignoreInit))return!1;var e,g,b={success:a&&a.ignoreInit?f.ok():!z},c=a&&a.type?t[a.type]||[]:[],d=[],h=[b],i=xa&&!f.ok();for(a.error&&(h[0].error=a.error),e=0,g=c.length;e<g;e++)c[e].fired!==!0&&d.push(c[e]);if(d.length)for(e=0,g=d.length;e<g;e++)d[e].scope?d[e].method.apply(d[e].scope,h):d[e].method.apply(this,h),i||(d[e].fired=!0);return!0},J=function(){a.setTimeout(function(){f.useFlashBlock&&fa(),I(),"function"==typeof f.onload&&(B("onload",1),f.onload.apply(a),B("onloadOK",1)),f.waitForWindowLoad&&Ga.add(a,"load",J)},1)},La=function(){if(Ka!==b)return Ka;var f,g,h,c=!1,d=navigator,e=d.plugins,i=a.ActiveXObject;if(e&&e.length)g="application/x-shockwave-flash",h=d.mimeTypes,h&&h[g]&&h[g].enabledPlugin&&h[g].enabledPlugin.description&&(c=!0);else if(i!==b&&!m.match(/MSAppHost/i)){try{f=new i("ShockwaveFlash.ShockwaveFlash")}catch(a){f=null}c=!!f,f=null}return Ka=c,c},ya=function(){var a,b,c=f.audioFormats,d=Ua&&!!m.match(/os (1|2|3_0|3_1)\s/i);if(d?(f.hasHTML5=!1,f.html5Only=!0,f.oMC&&(f.oMC.style.display="none")):f.useHTML5Audio&&(f.html5&&f.html5.canPlayType||(f._wD("SoundManager: No HTML5 Audio() support detected."),f.hasHTML5=!1),_a&&f._wD(j+"Note: Buggy HTML5 Audio in Safari on this OS X release, see https://bugs.webkit.org/show_bug.cgi?id=32159 - "+(Ka?"will use flash fallback for MP3/MP4, if available":" would use flash fallback for MP3/MP4, but none detected."),1)),f.useHTML5Audio&&f.hasHTML5){wa=!0;for(b in c)c.hasOwnProperty(b)&&c[b].required&&(f.html5.canPlayType(c[b].type)?f.preferFlash&&(f.flash[b]||f.flash[c[b].type])&&(a=!0):(wa=!1,a=!0))}return f.ignoreFlash&&(a=!1,wa=!0),f.html5Only=f.hasHTML5&&f.useHTML5Audio&&!a,!f.html5Only},ua=function(a){var b,c,e,d=0;if(a instanceof Array){for(b=0,c=a.length;b<c;b++)if(a[b]instanceof Object){if(f.canPlayMIME(a[b].type)){d=b;break}}else if(f.canPlayURL(a[b])){d=b;break}a[d].url&&(a[d]=a[d].url),e=a[d]}else e=a;return e},pa=function(a){a._hasTimer||(a._hasTimer=!0,!$a&&f.html5PollingInterval&&(null===ta&&0===sa&&(ta=setInterval(ra,f.html5PollingInterval)),sa++))},qa=function(a){a._hasTimer&&(a._hasTimer=!1,!$a&&f.html5PollingInterval&&sa--)},ra=function(){var a;if(null!==ta&&!sa)return clearInterval(ta),ta=null,!1;for(a=f.soundIDs.length-1;a>=0;a--)f.sounds[f.soundIDs[a]].isHTML5&&f.sounds[f.soundIDs[a]]._hasTimer&&f.sounds[f.soundIDs[a]]._onTimer()},W=function(c){c=c!==b?c:{},"function"==typeof f.onerror&&f.onerror.apply(a,[{type:c.type!==b?c.type:null}]),c.fatal!==b&&c.fatal&&f.disable()},Ma=function(){if(!_a||!La())return!1;var b,c,a=f.audioFormats;for(c in a)if(a.hasOwnProperty(c)&&("mp3"===c||"mp4"===c)&&(f._wD(i+": Using flash fallback for "+c+" format"),f.html5[c]=!1,a[c]&&a[c].related))for(b=a[c].related.length-1;b>=0;b--)f.html5[a[c].related[b]]=!1},this._setSandboxType=function(a){var c=f.sandbox;c.type=a,c.description=c.types[c.types[a]!==b?a:"unknown"],"localWithFile"===c.type?(c.noRemote=!0,c.noLocal=!1,B("secNote",2)):"localW
12ithNetwork"===c.type?(c.noRemote=!1,c.noLocal=!0):"localTrusted"===c.type&&(c.noRemote=!1,c.noLocal=!1)},this._externalInterfaceOK=function(a){if(f.swfLoaded)return!1;var b;return v("swf",!0),v("flashtojs",!0),f.swfLoaded=!0,cb=!1,_a&&Ma(),a&&a.replace(/\+dev/i,"")===f.versionNumber.replace(/\+dev/i,"")?void setTimeout(r,Wa?100:1):(b=i+': Fatal: JavaScript file build "'+f.versionNumber+'" does not match Flash SWF build "'+a+'" at '+f.url+". Ensure both are up-to-date.",setTimeout(function(){throw new Error(b)},0),!1)},V=function(a,c){function d(){var b,a=[],c=[],d=" + ";b="SoundManager "+f.version+(!f.html5Only&&f.useHTML5Audio?f.hasHTML5?" + HTML5 audio":", no HTML5 audio support":""),f.html5Only?f.html5PollingInterval&&a.push("html5PollingInterval ("+f.html5PollingInterval+"ms)"):(f.preferFlash&&a.push("preferFlash"),f.useHighPerformance&&a.push("useHighPerformance"),f.flashPollingInterval&&a.push("flashPollingInterval ("+f.flashPollingInterval+"ms)"),f.html5PollingInterval&&a.push("html5PollingInterval ("+f.html5PollingInterval+"ms)"),f.wmode&&a.push("wmode ("+f.wmode+")"),f.debugFlash&&a.push("debugFlash"),f.useFlashBlock&&a.push("flashBlock")),a.length&&(c=c.concat([a.join(d)])),f._wD(b+(c.length?d+c.join(", "):""),1),Oa()}function A(a,b){return'<param name="'+a+'" value="'+b+'" />'}if(w&&x)return!1;if(f.html5Only)return N(),d(),f.oMC=l(f.movieID),r(),w=!0,x=!0,!1;var p,q,s,t,u,v,y,z,e=c||f.url,g=f.altURL||e,h="JS/Flash audio component (SoundManager 2)",i=U(),j=ga(),k=null,n=o.getElementsByTagName("html")[0];if(k=n&&n.dir&&n.dir.match(/rtl/i),a=a===b?f.id:a,N(),f.url=ba(hb?e:g),c=f.url,f.wmode=!f.wmode&&f.useHighPerformance?"transparent":f.wmode,null!==f.wmode&&(m.match(/msie 8/i)||!Wa&&!f.useHighPerformance)&&navigator.platform.match(/win32|win64/i)&&(va.push(P.spcWmode),f.wmode=null),p={name:a,id:a,src:c,quality:"high",allowScriptAccess:f.allowScriptAccess,bgcolor:f.bgColor,pluginspage:ib+"www.macromedia.com/go/getflashplayer",title:h,type:"application/x-shockwave-flash",wmode:f.wmode,hasPriority:"true"},f.debugFlash&&(p.FlashVars="debug=1"),f.wmode||delete p.wmode,Wa)q=o.createElement("div"),t=['<object id="'+a+'" data="'+c+'" type="'+p.type+'" title="'+p.title+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">',A("movie",c),A("AllowScriptAccess",f.allowScriptAccess),A("quality",p.quality),f.wmode?A("wmode",f.wmode):"",A("bgcolor",f.bgColor),A("hasPriority","true"),f.debugFlash?A("FlashVars",p.FlashVars):"","</object>"].join("");else{q=o.createElement("embed");for(s in p)p.hasOwnProperty(s)&&q.setAttribute(s,p[s])}if(Y(),j=ga(),i=U())if(f.oMC=l(f.movieID)||o.createElement("div"),f.oMC.id)z=f.oMC.className,f.oMC.className=(z?z+" ":ha.swfDefault)+(j?" "+j:""),f.oMC.appendChild(q),Wa&&(u=f.oMC.appendChild(o.createElement("div")),u.className=ha.swfBox,u.innerHTML=t),x=!0;else{if(f.oMC.id=f.movieID,f.oMC.className=ha.swfDefault+" "+j,v=null,u=null,f.useFlashBlock||(f.useHighPerformance?v={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"}:(v={position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"},k&&(v.left=Math.abs(parseInt(v.left,10))+"px"))),Xa&&(f.oMC.style.zIndex=1e4),!f.debugFlash)for(y in v)v.hasOwnProperty(y)&&(f.oMC.style[y]=v[y]);try{Wa||f.oMC.appendChild(q),i.appendChild(f.oMC),Wa&&(u=f.oMC.appendChild(o.createElement("div")),u.className=ha.swfBox,u.innerHTML=t),x=!0}catch(a){throw new Error(ea("domError")+" \n"+a.toString())}}return w=!0,d(),!0},Q=function(){return f.html5Only?(V(),!1):!h&&(f.url?(h=f.getMovie(f.id),h||(ca?(Wa?f.oMC.innerHTML=da:f.oMC.appendChild(ca),ca=null,w=!0):V(f.id,f.url),h=f.getMovie(f.id)),"function"==typeof f.oninitmovie&&setTimeout(f.oninitmovie,1),Pa(),!0):(B("noURL"),!1))},K=function(){setTimeout(L,1e3)},M=function(){a.setTimeout(function(){la(j+"useFlashBlock is false, 100% HTML5 mode is possible. Rebooting with preferFlash: false..."),f.setup({preferFlash:!1}).reboot(),f.didFlashBlock=!0,f.beginDelayedInit()},1)},L=function(){var b,c=!1;return!!f.url&&(!na&&(na=!0,Ga.remove(a,"load",K),Ka&&cb&&!bb?(B("waitFocus"),!1):(y||(b=f.getMoviePercent(),b>0&&b<100&&(c=!0)),void setTimeout(function(){return b=f.getMoviePercent(),c?(na=!1,f._wD(ea("waitSWF")),a.setTimeout(K,1),!1):(y||(f._w
12D(i+": No Flash response within expected time. Likely causes: "+(0===b?"SWF load failed, ":"")+"Flash blocked or JS-Flash security error."+(f.debugFlash?" "+ea("checkSWF"):""),2),!hb&&b&&(B("localFail",2),f.debugFlash||B("tryDebug",2)),0===b&&f._wD(ea("swf404",f.url),1),v("flashtojs",!1,": Timed out"+(hb?" (Check flash security or flash blockers)":" (No plugin/missing SWF?)"))),void(!y&&db&&(null===b?f.useFlashBlock||0===f.flashLoadTimeout?(f.useFlashBlock&&fa(),B("waitForever")):!f.useFlashBlock&&wa?M():(B("waitForever"),I({type:"ontimeout",ignoreInit:!0,error:{type:"INIT_FLASHBLOCK"}})):0===f.flashLoadTimeout?B("waitForever"):!f.useFlashBlock&&wa?M():aa(!0))))},f.flashLoadTimeout))))},O=function(){function b(){Ga.remove(a,"focus",O)}return bb||!cb?(b(),!0):(db=!0,bb=!0,B("gotFocus"),na=!1,K(),b(),!0)},Pa=function(){va.length&&(f._wD("SoundManager 2: "+va.join(" "),1),va=[])},Oa=function(){Pa();var a,b=[];if(f.useHTML5Audio&&f.hasHTML5){for(a in f.audioFormats)f.audioFormats.hasOwnProperty(a)&&b.push(a+" = "+f.html5[a]+(!f.html5[a]&&xa&&f.flash[a]?" (using flash)":f.preferFlash&&f.flash[a]&&xa?" (preferring flash)":f.html5[a]?"":" ("+(f.audioFormats[a].required?"required, ":"")+"and no flash support)"));f._wD("SoundManager 2 HTML5 support: "+b.join(", "),1)}},D=function(b){if(y)return!1;if(f.html5Only)return B("sm2Loaded",1),y=!0,J(),v("onload",!0),!0;var e,c=f.useFlashBlock&&f.flashLoadTimeout&&!f.getMoviePercent(),d=!0;return c||(y=!0),e={type:!Ka&&xa?"NO_FLASH":"INIT_TIMEOUT"},f._wD("SoundManager 2 "+(z?"failed to load":"loaded")+" ("+(z?"Flash security/load error":"OK")+") "+String.fromCharCode(z?10006:10003),z?2:1),z||b?(f.useFlashBlock&&f.oMC&&(f.oMC.className=ga()+" "+(null===f.getMoviePercent()?ha.swfTimedout:ha.swfError)),I({type:"ontimeout",error:e,ignoreInit:!0}),v("onload",!1),W(e),d=!1):v("onload",!0),z||(f.waitForWindowLoad&&!A?(B("waitOnload"),Ga.add(a,"load",J)):(f.waitForWindowLoad&&A&&B("docLoaded"),J())),d},q=function(){var a,c=f.setupOptions;for(a in c)c.hasOwnProperty(a)&&(f[a]===b?f[a]=c[a]:f[a]!==c[a]&&(f.setupOptions[a]=f[a]))},r=function(){function b(){Ga.remove(a,"load",f.beginDelayedInit)}if(y)return B("didInit"),!1;if(f.html5Only)return y||(b(),f.enabled=!0,D()),!0;Q();try{h._externalInterfaceTest(!1),X(!0,f.flashPollingInterval||(f.useHighPerformance?10:50)),f.debugMode||h._disableDebug(),f.enabled=!0,v("jstoflash",!0),f.html5Only||Ga.add(a,"unload",p)}catch(a){return f._wD("js/flash exception: "+a.toString()),v("jstoflash",!1),W({type:"JS_TO_FLASH_EXCEPTION",fatal:!0}),aa(!0),D(),!1}return D(),b(),!0},R=function(){return!T&&(T=!0,q(),Y(),!Ka&&f.hasHTML5&&(f._wD("SoundManager 2: No Flash detected"+(f.useHTML5Audio?". Trying HTML5-only mode.":", enabling HTML5."),1),f.setup({useHTML5Audio:!0,preferFlash:!1})),Fa(),!Ka&&xa&&(va.push(P.needFlash),f.setup({flashLoadTimeout:1})),o.removeEventListener&&o.removeEventListener("DOMContentLoaded",R,!1),Q(),!0)},Ea=function(){return"complete"===o.readyState&&(R(),o.detachEvent("onreadystatechange",Ea)),!0},S=function(){A=!0,R(),Ga.remove(a,"load",S)},La(),Ga.add(a,"focus",O),Ga.add(a,"load",K),Ga.add(a,"load",S),o.addEventListener?o.addEventListener("DOMContentLoaded",R,!1):o.attachEvent?o.attachEvent("onreadystatechange",Ea):(v("onload",!1),W({type:"NO_DOM2_EVENTS",fatal:!0}))}if(!a||!a.document)throw new Error("SoundManager requires a browser with window and document objects.");var c=null;a.SM2_DEFER!==b&&SM2_DEFER||(c=new d),"object"==typeof module&&module&&"object"==typeof module.exports?(module.exports.SoundManager=d,module.exports.soundManager=c):"function"==typeof define&&define.amd&&define(function(){function b(b){if(!a.soundManager&&b instanceof Function){var c=b(d);c instanceof d&&(a.soundManager=c)}return a.soundManager}return{constructor:d,getInstance:b}}),a.SoundManager=d,a.soundManager=c}(window); 13// source --> https://myworstinvestmentever.com/wp-content/plugins/simple-podcast-press/responsive_audio_player/js/bar-ui.js?ver=5.7.17 14/*jslint plusplus: true, white: true, nomen: true */ 15/*global console, document, navigator, soundManager, window */ 16 17(function(window) { 18 19 /** 20 * SoundManager 2: "Bar UI" player 21 * Copyright (c) 2014, Scott Schiller. All rights reserved. 22 * http://www.schillmania.com/projects/soundmanager2/ 23 * Code provided under BSD license. 24 * http://schillmania.com/projects/soundmanager2/license.txt 25 */ 26 27 "use strict"; 28 29 var Player, 30 players = [], 31 // CSS selector that will get us the top-level DOM node for the player UI. 32 playerSelector = '.sm2-bar-ui', 33 playerOptions, 34 utils; 35 36 /** 37 * Slightly hackish: event callbacks. 38 * Override globally by setting window.sm2BarPlayers.on = {}, or individually by window.sm2BarPlayers[0].on = {} etc. 39 */ 40 players.on = { 41 /* 42 play: function(player) { 43 console.log('playing', player); 44 }, 45 pause: function(player) { 46 console.log('pause', player); 47 }, 48 error: function(player) { 49 console.log('error', player); 50 }, 51 stop: function(player) { 52 console.log('stop', player); 53 } 54 */ 55 }; 56 57 playerOptions = { 58 // useful when multiple players are in use, or other SM2 sounds are active etc. 59 stopOtherSounds: true, 60 // CSS class to let the browser load the URL directly e.g., <a href="foo.mp3" class="sm2-exclude">download foo.mp3</a> 61 excludeClass: 'sm2-exclude' 62 }; 63 64 soundManager.setup({ 65 // trade-off: higher UI responsiveness (play/progress bar), but may use more CPU. 66 html5PollingInterval: 50, 67 flashVersion: 9 68 }); 69 70 soundManager.onready(function() { 71 72 var nodes, i, j; 73 74 nodes = utils.dom.getAll(playerSelector); 75 76 if (nodes && nodes.length) { 77 for (i=0, j=nodes.length; i<j; i++) {
78 players.push(new Player(nodes[i])); 79 } 80 } 81 82 }); 83 84 /** 85 * player bits 86 */ 87 88 Player = function(playerNode) { 89 90 var css, dom, extras, playlistController, soundObject, actions, actionData, defaultItem, defaultVolume, firstOpen, exports; 91 92 css = { 93 disabled: 'disabled', 94 selected: 'selected', 95 active: 'active', 96 legacy: 'legacy', 97 noVolume: 'no-volume', 98 playlistOpen: 'playlist-open' 99 }; 100 101 dom = { 102 o: null, 103 playlist: null, 104 playlistTarget: null, 105 playlistContainer: null, 106 time: null, 107 player: null, 108 progress: null, 109 progressTrack: null, 110 progressBar: null, 111 duration: null, 112 volume: null 113 }; 114 115 // prepended to tracks when a sound fails to load/play 116 extras = { 117 loadFailedCharacter: '<span title="Failed to load/play." class="load-error">✖</span>' 118 }; 119 120 function stopOtherSounds() { 121 122 if (playerOptions.stopOtherSounds) { 123 soundManager.stopAll(); 124 } 125 126 } 127 128 function callback(method) { 129 if (method) { 130 // fire callback, passing current turntable object 131 if (exports.on && exports.on[method]) { 132 exports.on[method](exports); 133 } else if (players.on[method]) { 134 players.on[method](exports); 135 } 136 } 137 } 138 139 function getTime(millisec, useString) { 140 141 // convert milliseconds to hh:mm:ss, return as object literal or string 142 var seconds = (millisec / 1000).toFixed(0); 143 var minutes = Math.floor(seconds / 60); 144 var hours = ""; 145 if (minutes > 59) { 146 hours = Math.floor(minutes / 60); 147 hours = (hours >= 10) ? hours : "0" + hours; 148 minutes = minutes - (hours * 60); 149 minutes = (minutes >= 10) ? minutes : "0" + minutes; 150 } 151 152 seconds = Math.floor(seconds % 60); 153 seconds = (seconds >= 10) ? seconds : "0" + seconds; 154 if (hours != "") { 155 return hours + ":" + minutes + ":" + seconds; 156 } 157 return minutes + ":" + seconds; 158 } 159 160 function setTitle(item) { 161 162 // given a link, update the "now playing" UI. 163 164 // if this is an <li> with an inner link, grab and use the text from that. 165 var links = item.getElementsByTagName('a'); 166 167 if (links.length) { 168 item = links[0]; 169 } 170 171 // remove any failed character sequence, also 172 dom.playlistTarget.innerHTML = '<ul class="sm2-playlist-bd"><li>' + item.innerHTML.replace(extras.loadFailedCharacter, '') + '</li></ul>'; 173 174 if (dom.playlistTarget.getElementsByTagName('li')[0].scrollWidth > dom.playlistTarget.offsetWidth) { 175 // this item can use <marquee>, in fact. 176 dom.playlistTarget.innerHTML = '<ul class="sm2-playlist-bd"><li><marquee>' + item.innerHTML + '</marquee></li></ul>'; 177 } 178 179 } 180 181 function makeSound(url) { 182 183 var sound = soundManager.createSound({ 184 185 url: url, 186 187 volume: defaultVolume, 188 189 whileplaying: function() { 190 191 var progressMaxLeft = 100, 192 left, 193 width; 194 195 left = Math.min(progressMaxLeft, Math.max(0, (progressMaxLeft * (this.position / this.durationEstimate)))) + '%'; 196 width = Math.min(100, Math.max(0, (100 * this.position / this.durationEstimate))) + '%'; 197 198 if (this.duration) { 199 200 dom.progress.style.left = left; 201 dom.progressBar.style.width = width; 202 203 // TODO: only write changes 204 dom.time.innerHTML = getTime(this.position, true); 205 206 } 207 208 }, 209 210 onbufferchange: function(isBuffering) { 211 212 if (isBuffering) { 213 utils.css.add(dom.o, 'buffering'); 214 } else { 215 utils.css.remove(dom.o, 'buffering'); 216 } 217 218 }, 219 220 onplay: function() { 221 utils.css.swap(dom.o, 'paused', 'playing'); 222 callback('play'); 223 }, 224 225 onpause: function() { 226 utils.css.swap(dom.o, 'playing', 'paused'); 227 callback('pause'); 228 }, 229 230 onresume: function() { 231 utils.css.swap(dom.o, 'paused', 'playing'); 232 }, 233 234 whileloading: function() { 235 236 if (!this.isHTML5) { 237 dom.duration.innerHTML = getTime(this.durationEstimate, true); 238 } 239 240 }, 241 242 onload: function(ok) { 243 244 if (ok) { 245 246 dom.duration.innerHTML = getTime(this.duration, true); 247 248 } else if (this._iO && this._iO.onerror) { 249 250 this._iO.onerror(); 251 252 } 253 254 }, 255 256 onerror: function() { 257 258 // sound failed to load. 259 var item, element, html; 260 261 item = playlistController.getItem(); 262 263 if (item) { 264 265 // note error, delay 2 seconds and advance? 266 // playlistTarget.innerHTML = '<ul class="sm2-playlist-bd"><li>' + item.innerHTML + '</li></ul>'; 267 268 if (extras.loadFailedCharacter) { 269 dom.playlistTarget.innerHTML = dom.playlistTarget.innerHTML.replace('<li>' ,'<li>' + extras.loadFailedCharacter + ' '); 270 if (playlistController.data.playlist && playlistController.data.playlist[playlistController.data.selectedIndex]) { 271 element = playlistController.data.playlist[playlistController.data.selectedIndex].getElementsByTagName('a')[0]; 272 html = element.innerHTML; 273 if (html.indexOf(extras.loadFailedCharacter) === -1) { 274 element.innerHTML = extras.loadFailedCharacter + ' ' + html; 275 } 276 } 277 } 278 279 } 280 281 callback('error'); 282 283 // load next, possibly with delay. 284 285 if (navigator.userAgent.match(/mobile/i)) { 286 // mobile will likely block the next play() call if there is a setTimeout() - so don't use one here. 287 actions.next(); 288 } else { 289 if (playlistController.data.timer) { 290 window.clearTimeout(playlistController.data.timer); 291 } 292 playlistController.data.timer = window.setTimeout(actions.next, 2000); 293 } 294 295 }, 296 297 onstop: function() { 298 299 utils.css.remove(dom.o, 'playing'); 300 callback('stop'); 301 302 }, 303 304 onfinish: function() { 305 306 var lastIndex, item; 307 308 utils.css.remove(dom.o, 'playing'); 309 310 dom.progress.style.left = '0%'; 311 312 lastIndex = playlistController.data.selectedIndex; 313 314 // next track? 315 item = playlistController.getNext(); 316 317 // don't play the same item over and over again, if at end of playlist etc. 318 if (item && playlistController.data.selectedIndex !== lastIndex) { 319 320 playlistController.select(item); 321 322 setTitle(item); 323 324 stopOtherSounds(); 325 326 // play next 327 this.play({
328 url: playlistController.getURL() 329 }); 330 331 }/* else { 332 // explicitly stop? 333 // this.stop(); 334 }*/ 335 336 } 337 338 }); 339 340 return sound; 341 342 } 343 344 function playLink(link) { 345 346 // if a link is OK, play it. 347 348 if (soundManager.canPlayURL(link.href)) { 349 350 // if there's a timer due to failure to play one track, cancel it. 351 // catches case when user may use previous/next after an error. 352 if (playlistController.data.timer) { 353 window.clearTimeout(playlistController.data.timer); 354 playlistController.data.timer = null; 355 } 356 357 if (!soundObject) { 358 soundObject = makeSound(link.href); 359 } 360 361 // required to reset pause/play state on iOS so whileplaying() works? odd. 362 soundObject.stop(); 363 364 playlistController.select(link.parentNode); 365 366 // TODO: ancestor('li') 367 setTitle(link.parentNode); 368 369 // reset the UI 370 // TODO: function that also resets/hides timing info. 371 dom.progress.style.left = '0px'; 372 dom.progressBar.style.width = '0px'; 373 374 stopOtherSounds(); 375 376 soundObject.play({ 377 url: link.href, 378 position: 0 379 }); 380 381 } 382 383 } 384 385 function PlaylistController() { 386 387 var data; 388 389 data = { 390 391 // list of nodes? 392 playlist: [], 393 394 // shuffledIndex: [], 395 396 // selection 397 selectedIndex: 0, 398 399 // shuffleMode: false, 400 401 loopMode: false, 402 403 timer: null 404 405 }; 406 407 function getPlaylist() { 408 409 return data.playlist; 410 411 } 412 413 function getItem(offset) { 414 415 var list, 416 item; 417 418 // given the current selection (or an offset), return the current item. 419 420 // if currently null, may be end of list case. bail. 421 if (data.selectedIndex === null) { 422 return offset; 423 } 424 425 list = getPlaylist(); 426 427 // use offset if provided, otherwise take default selected. 428 offset = (offset !== undefined ? offset : data.selectedIndex); 429 430 // safety check - limit to between 0 and list length 431 offset = Math.max(0, Math.min(offset, list.length)); 432 433 item = list[offset]; 434 435 return item; 436 437 } 438 439 function findOffsetFromItem(item) { 440 441 // given an <li> item, find it in the playlist array and return the index. 442 var list, 443 i, 444 j, 445 offset; 446 447 offset = -1; 448 449 list = getPlaylist(); 450 451 if (list) { 452 453 for (i=0, j=list.length; i<j; i++) { 454 if (list[i] === item) { 455 offset = i; 456 break; 457 } 458 } 459 460 } 461 462 return offset; 463 464 } 465 466 function getNext() { 467 468 // don't increment if null. 469 if (data.selectedIndex !== null) { 470 data.selectedIndex++; 471 } 472 473 if (data.playlist.length > 1) { 474 475 if (data.selectedIndex >= data.playlist.length) { 476 477 if (data.loopMode) { 478 479 // loop to beginning 480 data.selectedIndex = 0; 481 482 } else { 483 484 // no change 485 data.selectedIndex--; 486 487 // end playback 488 // data.selectedIndex = null; 489 490 } 491 492 } 493 494 } else { 495 496 data.selectedIndex = null; 497 498 } 499 500 return getItem(); 501 502 } 503 504 function getPrevious() { 505 506 data.selectedIndex--; 507 508 if (data.selectedIndex < 0) { 509 // wrapping around beginning of list? loop or exit. 510 if (data.loopMode) { 511 data.selectedIndex = data.playlist.length - 1; 512 } else { 513 // undo 514 data.selectedIndex++; 515 } 516 } 517 518 return getItem(); 519 520 } 521 522 function resetLastSelected() { 523 524 // remove UI highlight(s) on selected items. 525 var items, 526 i, j; 527 528 items = utils.dom.getAll(dom.playlist, '.' + css.selected); 529 530 for (i=0, j=items.length; i<j; i++) { 531 utils.css.remove(items[i], css.selected); 532 } 533 534 } 535 536 function select(item) { 537 538 var offset, 539 itemTop, 540 itemBottom, 541 containerHeight, 542 scrollTop, 543 itemPadding; 544 545 // remove last selected, if any 546 resetLastSelected(); 547 548 if (item) { 549 550 utils.css.add(item, css.selected); 551 552 itemTop = item.offsetTop; 553 itemBottom = itemTop + item.offsetHeight; 554 containerHeight = dom.playlistContainer.offsetHeight; 555 scrollTop = dom.playlist.scrollTop; 556 itemPadding = 8; 557 558 if (itemBottom > containerHeight + scrollTop) { 559 // bottom-align 560 dom.playlist.scrollTop = itemBottom - containerHeight + itemPadding; 561 } else if (itemTop < scrollTop) { 562 // top-align 563 dom.playlist.scrollTop = item.offsetTop - itemPadding; 564 } 565 566 } 567 568 // update selected offset, too. 569 offset = findOffsetFromItem(item); 570 571 data.selectedIndex = offset; 572 573 } 574 575 function playItemByOffset(offset) { 576 577 var item; 578 579 offset = (offset || 0); 580 581 item = getItem(offset); 582 583 if (item) { 584 playLink(item.getElementsByTagName('a')[0]); 585 } 586 587 } 588 589 function getURL() { 590 591 // return URL of currently-selected item 592 var item, url; 593 594 item = getItem(); 595 596 if (item) { 597 url = item.getElementsByTagName('a')[0].href; 598 } 599 600 return url; 601 602 } 603 604 function refreshDOM() { 605 606 // get / update playlist from DOM 607 608 if (!dom.playlist) { 609 if (window.console && console.warn) { 610 console.warn('refreshDOM(): playlist node not found?'); 611 } 612 return false;
613 } 614 615 data.playlist = dom.playlist.getElementsByTagName('li'); 616 617 } 618 619 function initDOM() { 620 621 dom.playlistTarget = utils.dom.get(dom.o, '.sm2-playlist-target'); 622 dom.playlistContainer = utils.dom.get(dom.o, '.sm2-playlist-drawer'); 623 dom.playlist = utils.dom.get(dom.o, '.sm2-playlist-bd'); 624 625 } 626 627 function init() { 628 629 // inherit the default SM2 volume 630 defaultVolume = soundManager.defaultOptions.volume; 631 632 initDOM(); 633 refreshDOM(); 634 635 // animate playlist open, if HTML classname indicates so. 636 if (utils.css.has(dom.o, css.playlistOpen)) { 637 // hackish: run this after API has returned 638 window.setTimeout(function() { 639 actions.menu(true); 640 }, 1); 641 } 642 643 } 644 645 init(); 646 647 return { 648 data: data, 649 refresh: refreshDOM, 650 getNext: getNext, 651 getPrevious: getPrevious, 652 getItem: getItem, 653 getURL: getURL, 654 playItemByOffset: playItemByOffset, 655 select: select 656 }; 657 658 } 659 660 function isRightClick(e) { 661 662 // only pay attention to left clicks. old IE differs where there's no e.which, but e.button is 1 on left click. 663 if (e && ((e.which && e.which === 2) || (e.which === undefined && e.button !== 1))) { 664 // http://www.quirksmode.org/js/events_properties.html#button 665 return true; 666 } 667 668 } 669 670 function getActionData(target) { 671 672 // DOM measurements for volume slider 673 674 if (!target) { 675 return false; 676 } 677 678 actionData.volume.x = utils.position.getOffX(target); 679 actionData.volume.y = utils.position.getOffY(target); 680 681 actionData.volume.width = target.offsetWidth; 682 actionData.volume.height = target.offsetHeight; 683 684 // potentially dangerous: this should, but may not be a percentage-based value. 685 actionData.volume.backgroundSize = parseInt(utils.style.get(target, 'background-size'), 10); 686 687 // IE gives pixels even if background-size specified as % in CSS. Boourns. 688 if (window.navigator.userAgent.match(/msie|trident/i)) { 689 actionData.volume.backgroundSize = (actionData.volume.backgroundSize / actionData.volume.width) * 100; 690 } 691 692 } 693 694 function handleMouseDown(e) { 695 696 var links, 697 target; 698 699 target = e.target || e.srcElement; 700 701 if (isRightClick(e)) { 702 return true; 703 } 704 705 // normalize to <a>, if applicable. 706 if (target.nodeName.toLowerCase() !== 'a') { 707 708 links = target.getElementsByTagName('a'); 709 if (links && links.length) { 710 target = target.getElementsByTagName('a')[0]; 711 } 712 713 } 714 715 if (utils.css.has(target, 'sm2-volume-control')) { 716 717 // drag case for volume 718 719 getActionData(target); 720 721 utils.events.add(document, 'mousemove', actions.adjustVolume); 722 utils.events.add(document, 'mouseup', actions.releaseVolume); 723 724 // and apply right away 725 return actions.adjustVolume(e); 726 727 } 728 729 } 730 731 function handleClick(e) { 732 733 var evt, 734 target, 735 offset, 736 targetNodeName, 737 methodName, 738 href, 739 handled; 740 741 evt = (e || window.event); 742 743 target = evt.target || evt.srcElement; 744 745 if (target && target.nodeName) { 746 747 targetNodeName = target.nodeName.toLowerCase(); 748 749 if (targetNodeName !== 'a') { 750 751 // old IE (IE 8) might return nested elements inside the <a>, eg., <b> etc. Try to find the parent <a>. 752 753 if (target.parentNode) { 754 755 do { 756 target = target.parentNode; 757 targetNodeName = target.nodeName.toLowerCase(); 758 } while (targetNodeName !== 'a' && target.parentNode); 759 760 if (!target) { 761 // something went wrong. bail. 762 return false; 763 } 764 765 } 766 767 } 768 769 if (targetNodeName === 'a') { 770 771 // yep, it's a link. 772 773 href = target.href; 774 775 if (soundManager.canPlayURL(href)) { 776 777 // not excluded 778 if (!utils.css.has(target, playerOptions.excludeClass)) { 779 780 // find this in the playlist 781 782 playLink(target); 783 784 handled = true; 785 786 } 787 788 } else { 789 790 // is this one of the action buttons, eg., play/pause, volume, etc.? 791 offset = target.href.lastIndexOf('#'); 792 793 if (offset !== -1) { 794 795 methodName = target.href.substr(offset+1); 796 797 if (methodName && actions[methodName]) { 798 handled = true; 799 actions[methodName](e); 800 } 801 802 } 803 804 } 805 806 // fall-through case 807 808 if (handled) { 809 // prevent browser fall-through 810 return utils.events.preventDefault(evt); 811 } 812 813 } 814 815 } 816 817 } 818 819 function handleMouse(e) { 820 821 var target, barX, barWidth, x, newPosition, sound; 822 823 target = dom.progressTrack; 824 825 barX = utils.position.getOffX(target); 826 barWidth = target.offsetWidth; 827 828 x = (e.clientX - barX); 829 830 newPosition = (x / barWidth); 831 832 sound = soundObject; 833 834 if (sound && sound.duration) { 835 836 sound.setPosition(sound.duration * newPosition); 837 838 // a little hackish: ensure UI updates immediately with current position, even if audio is buffering and hasn't moved there yet. 839 if (sound._iO && sound._iO.whileplaying) { 840 sound._iO.whileplaying.apply(sound); 841 } 842 843 } 844 845 if (e.preventDefault) { 846 e.preventDefault(); 847 } 848 849 return false;
850 851 } 852 853 function releaseMouse(e) { 854 855 utils.events.remove(document, 'mousemove', handleMouse); 856 857 utils.css.remove(dom.o, 'grabbing'); 858 859 utils.events.remove(document, 'mouseup', releaseMouse); 860 861 utils.events.preventDefault(e); 862 863 return false; 864 865 } 866 867 function init() { 868 869 // init DOM? 870 871 if (!playerNode) { 872 console.warn('init(): No playerNode element?'); 873 } 874 875 dom.o = playerNode; 876 877 // are we dealing with a crap browser? apply legacy CSS if so. 878 if (window.navigator.userAgent.match(/msie [678]/i)) { 879 utils.css.add(dom.o, css.legacy); 880 } 881 882 if (window.navigator.userAgent.match(/mobile/i)) { 883 // majority of mobile devices don't let HTML5 audio set volume. 884 utils.css.add(dom.o, css.noVolume); 885 } 886 887 dom.progress = utils.dom.get(dom.o, '.sm2-progress-ball'); 888 889 dom.progressTrack = utils.dom.get(dom.o, '.sm2-progress-track'); 890 891 dom.progressBar = utils.dom.get(dom.o, '.sm2-progress-bar'); 892 893 dom.volume = utils.dom.get(dom.o, 'a.sm2-volume-control'); 894 895 // measure volume control dimensions 896 if (dom.volume) { 897 getActionData(dom.volume); 898 } 899 900 dom.duration = utils.dom.get(dom.o, '.sm2-inline-duration'); 901 902 dom.time = utils.dom.get(dom.o, '.sm2-inline-time'); 903 904 playlistController = new PlaylistController(); 905 906 defaultItem = playlistController.getItem(0); 907 908 playlistController.select(defaultItem); 909 910 setTitle(defaultItem); 911 912 utils.events.add(dom.o, 'mousedown', handleMouseDown); 913 914 utils.events.add(dom.o, 'click', handleClick); 915 916 utils.events.add(dom.progressTrack, 'mousedown', function(e) { 917 918 if (isRightClick(e)) { 919 return true; 920 } 921 922 utils.css.add(dom.o, 'grabbing'); 923 utils.events.add(document, 'mousemove', handleMouse); 924 utils.events.add(document, 'mouseup', releaseMouse); 925 926 return handleMouse(e); 927 928 }); 929 930 } 931 932 // --- 933 934 actionData = { 935 936 volume: { 937 x: 0, 938 y: 0, 939 width: 0, 940 height: 0, 941 backgroundSize: 0 942 } 943 944 }; 945 946 actions = { 947 948 play: function(offsetOrEvent) { 949 950 /** 951 * This is an overloaded function that takes mouse/touch events or offset-based item indices. 952 * Remember, "auto-play" will not work on mobile devices unless this function is called immediately from a touch or click event. 953 * If you have the link but not the offset, you can also pass a fake event object with a target of an <a> inside the playlist - e.g. { target: someMP3Link } 954 */ 955 956 var target, 957 href, 958 e; 959 960 if (offsetOrEvent !== undefined && !isNaN(offsetOrEvent)) { 961 // smells like a number. 962 return playlistController.playItemByOffset(offsetOrEvent); 963 } 964 965 // DRY things a bit 966 e = offsetOrEvent; 967 968 if (e && e.target) { 969 970 target = e.target || e.srcElement; 971 972 href = target.href; 973 974 } 975 976 // haaaack - if null due to no event, OR '#' due to play/pause link, get first link from playlist 977 if (!href || href.indexOf('#') !== -1) { 978 href = dom.playlist.getElementsByTagName('a')[0].href; 979 } 980 981 if (!soundObject) { 982 soundObject = makeSound(href); 983 } 984 985 // edge case: if the current sound is not playing, stop all others. 986 if (!soundObject.playState) { 987 stopOtherSounds(); 988 } 989 990 // TODO: if user pauses + unpauses a sound that had an error, try to play next? 991 soundObject.togglePause(); 992 993 // special case: clear "play next" timeout, if one exists. 994 // edge case: user pauses after a song failed to load. 995 if (soundObject.paused && playlistController.data.timer) { 996 window.clearTimeout(playlistController.data.timer); 997 playlistController.data.timer = null; 998 } 999 1000 }, 1001 1002 pause: function() { 1003 1004 if (soundObject && soundObject.readyState) { 1005 soundObject.pause(); 1006 } 1007 1008 }, 1009 1010 resume: function() { 1011 1012 if (soundObject && soundObject.readyState) { 1013 soundObject.resume(); 1014 } 1015 1016 }, 1017 1018 stop: function() { 1019 1020 // just an alias for pause, really. 1021 // don't actually stop because that will mess up some UI state, i.e., dragging the slider. 1022 return actions.pause(); 1023 1024 }, 1025 1026 next: function(/* e */) { 1027 1028 var item, lastIndex; 1029 1030 // special case: clear "play next" timeout, if one exists. 1031 if (playlistController.data.timer) { 1032 window.clearTimeout(playlistController.data.timer); 1033 playlistController.data.timer = null; 1034 } 1035 1036 lastIndex = playlistController.data.selectedIndex; 1037 1038 item = playlistController.getNext(true); 1039 1040 // don't play the same item again 1041 if (item && playlistController.data.selectedIndex !== lastIndex) { 1042 playLink(item.getElementsByTagName('a')[0]); 1043 } 1044 1045 }, 1046 1047 prev: function(/* e */) { 1048 1049 var item, lastIndex; 1050 1051 lastIndex = playlistController.data.selectedIndex; 1052 1053 item = playlistController.getPrevious(); 1054 1055 // don't play the same item again 1056 if (item && playlistController.data.selectedIndex !== lastIndex) { 1057 playLink(item.getElementsByTagName('a')[0]); 1058 } 1059 1060 }, 1061 1062 shuffle: function(e) { 1063 1064 // NOTE: not implemented yet. 1065 1066 var target = (e ? e.target || e.srcElement : utils.dom.get(dom.o, '.shuffle')); 1067 1068 if (target && !utils.css.has(target, css.disabled)) { 1069 utils.css.toggle(target.parentNode, css.active); 1070 playlistController.data.shuffleMode = !playlistController.data.shuffleMode; 1071 } 1072 1073 }, 1074 1075 repeat: function(e) { 1076 1077 var target = (e ? e.target || e.srcElement : utils.dom.get(dom.o, '.repeat')); 1078 1079 if (target && !utils.css.has(target, css.disabled)) { 1080 utils.css.toggle(target.parentNode, css.active); 1081 playlistController.data.loopMode = !playlistController.data.loopMode; 1082 } 1083 1084 }, 1085 1086 menu: function(ignoreToggle) { 1087 1088 var isOpen; 1089 1090 isOpen = utils.css.has(dom.o, css.playlistOpen); 1091 1092 // hackish: reset scrollTop in default first open case. odd, but some browsers have a non-zero scroll offset the first time the playlist opens. 1093 if (playlistController && !playlistController.data.selectedIndex && !firstOpen) { 1094 dom.playlist.scrollTop = 0; 1095 firstOpen = true; 1096 } 1097 1098 // sniff out booleans from mouse events, as this is referenced directly by event handlers. 1099 if (typeof ignoreToggle !== 'boolean' || !ignoreToggle) { 1100 1101 if (!isOpen) { 1102 jQuery(".sm2-bar-ui .sm2-inline-element:first-of-type").css('border-bottom-left-radius', '0px'); 1103 } 1104 if (isOpen) { 1105 jQuery(".sm2-bar-ui .sm2-inline-element:first-of-type").css('border-bottom-left-radius', '6px'); 1106 } 1107 if (!isOpen) { 1108 // explicitly set height:0, so the first closed -> open animation runs properly 1109 dom.playlistContainer.style.height = '0px'; 1110 } 1111 1112 isOpen = utils.css.toggle(dom.o, css.playlistOpen); 1113 1114 } 1115 1116 // playlist 1117 dom.playlistContainer.style.height = (isOpen ? dom.playlistContainer.scrollHeight : 0) + 'px'; 1118 1119 }, 1120 1121 adjustVolume: function(e) { 1122 1123 /** 1124 * NOTE: this is the mousemove() event handler version. 1125 * Use setVolume(50), etc., to assign volume directly. 1126 */ 1127 1128 var backgroundMargin, 1129 pixelMargin, 1130 target, 1131 value, 1132 volume; 1133 1134 value = 0; 1135 1136 target = dom.volume; 1137 1138 // safety net 1139 if (e === undefined) { 1140 return false;
1141 } 1142 1143 if (!e || e.clientX === undefined) { 1144 // called directly or with a non-mouseEvent object, etc. 1145 // proxy to the proper method. 1146 if (arguments.length && window.console && window.console.warn) { 1147 console.warn('Bar UI: call setVolume(' + e + ') instead of adjustVolume(' + e + ').'); 1148 } 1149 return actions.setVolume.apply(this, arguments); 1150 } 1151 1152 // based on getStyle() result 1153 // figure out spacing around background image based on background size, eg. 60% background size. 1154 // 60% wide means 20% margin on each side. 1155 backgroundMargin = (100 - actionData.volume.backgroundSize) / 2; 1156 1157 // relative position of mouse over element 1158 value = Math.max(0, Math.min(1, (e.clientX - actionData.volume.x) / actionData.volume.width)); 1159 1160 target.style.clip = 'rect(0px, ' + (actionData.volume.width * value) + 'px, ' + actionData.volume.height + 'px, ' + (actionData.volume.width * (backgroundMargin/100)) + 'px)'; 1161 1162 // determine logical volume, including background margin 1163 pixelMargin = ((backgroundMargin/100) * actionData.volume.width); 1164 1165 volume = Math.max(0, Math.min(1, ((e.clientX - actionData.volume.x) - pixelMargin) / (actionData.volume.width - (pixelMargin*2)))) * 100; 1166 1167 // set volume 1168 if (soundObject) { 1169 soundObject.setVolume(volume); 1170 } 1171 1172 defaultVolume = volume; 1173 1174 return utils.events.preventDefault(e); 1175 1176 }, 1177 1178 releaseVolume: function(/* e */) { 1179 1180 utils.events.remove(document, 'mousemove', actions.adjustVolume); 1181 utils.events.remove(document, 'mouseup', actions.releaseVolume); 1182 1183 }, 1184 1185 setVolume: function(volume) { 1186 1187 // set volume (0-100) and update volume slider UI. 1188 1189 var backgroundSize, 1190 backgroundMargin, 1191 backgroundOffset, 1192 target, 1193 from, 1194 to; 1195 1196 if (volume === undefined || isNaN(volume)) { 1197 return; 1198 } 1199 1200 if (dom.volume) { 1201 1202 target = dom.volume; 1203 1204 // based on getStyle() result 1205 backgroundSize = actionData.volume.backgroundSize; 1206 1207 // figure out spacing around background image based on background size, eg. 60% background size. 1208 // 60% wide means 20% margin on each side. 1209 backgroundMargin = (100 - backgroundSize) / 2; 1210 1211 // margin as pixel value relative to width 1212 backgroundOffset = actionData.volume.width * (backgroundMargin/100); 1213 1214 from = backgroundOffset; 1215 to = from + ((actionData.volume.width - (backgroundOffset*2)) * (volume/100)); 1216 1217 target.style.clip = 'rect(0px, ' + to + 'px, ' + actionData.volume.height + 'px, ' + from + 'px)'; 1218 1219 } 1220 1221 // apply volume to sound, as applicable 1222 if (soundObject) { 1223 soundObject.setVolume(volume); 1224 } 1225 1226 defaultVolume = volume; 1227 1228 } 1229 1230 }; 1231 1232 init(); 1233 1234 // TODO: mixin actions -> exports 1235 1236 exports = { 1237 // Per-instance events: window.sm2BarPlayers[0].on = { ... } etc. See global players.on example above for reference. 1238 on: null, 1239 actions: actions, 1240 dom: dom, 1241 playlistController: playlistController 1242 }; 1243 soundObject = makeSound(playlistController.getURL()); 1244 1245 return exports; 1246 1247 }; 1248 1249 // barebones utilities for logic, CSS, DOM, events etc. 1250 1251 utils = { 1252 1253 array: (function() { 1254 1255 function compare(property) { 1256 1257 var result; 1258 1259 return function(a, b) { 1260 1261 if (a[property] < b[property]) { 1262 result = -1; 1263 } else if (a[property] > b[property]) { 1264 result = 1; 1265 } else { 1266 result = 0; 1267 } 1268 return result; 1269 }; 1270 1271 } 1272 1273 function shuffle(array) { 1274 1275 // Fisher-Yates shuffle algo 1276 1277 var i, j, temp; 1278 1279 for (i = array.length - 1; i > 0; i--) { 1280 j = Math.floor(Math.random() * (i+1)); 1281 temp = array[i]; 1282 array[i] = array[j]; 1283 array[j] = temp; 1284 } 1285 1286 return array; 1287 1288 } 1289 1290 return { 1291 compare: compare, 1292 shuffle: shuffle 1293 }; 1294 1295 }()), 1296 1297 css: (function() { 1298 1299 function hasClass(o, cStr) { 1300 1301 return (o.className !== undefined ? new RegExp('(^|\\s)' + cStr + '(\\s|$)').test(o.className) : false); 1302 1303 } 1304 1305 function addClass(o, cStr) { 1306 1307 if (!o || !cStr || hasClass(o, cStr)) { 1308 return false; // safety net 1309 } 1310 o.className = (o.className ? o.className + ' ' : '') + cStr; 1311 1312 } 1313 1314 function removeClass(o, cStr) { 1315 1316 if (!o || !cStr || !hasClass(o, cStr)) { 1317 return false;
1318 } 1319 o.className = o.className.replace(new RegExp('( ' + cStr + ')|(' + cStr + ')', 'g'), ''); 1320 1321 } 1322 1323 function swapClass(o, cStr1, cStr2) { 1324 1325 var tmpClass = { 1326 className: o.className 1327 }; 1328 1329 removeClass(tmpClass, cStr1); 1330 addClass(tmpClass, cStr2); 1331 1332 o.className = tmpClass.className; 1333 1334 } 1335 1336 function toggleClass(o, cStr) { 1337 1338 var found, 1339 method; 1340 1341 found = hasClass(o, cStr); 1342 1343 method = (found ? removeClass : addClass); 1344 1345 method(o, cStr); 1346 1347 // indicate the new state... 1348 return !found; 1349 1350 } 1351 1352 return { 1353 has: hasClass, 1354 add: addClass, 1355 remove: removeClass, 1356 swap: swapClass, 1357 toggle: toggleClass 1358 }; 1359 1360 }()), 1361 1362 dom: (function() { 1363 1364 function getAll(param1, param2) { 1365 1366 var node, 1367 selector, 1368 results; 1369 1370 if (arguments.length === 1) { 1371 1372 // .selector case 1373 node = document.documentElement; 1374 // first param is actually the selector 1375 selector = param1; 1376 1377 } else { 1378 1379 // node, .selector 1380 node = param1; 1381 selector = param2; 1382 1383 } 1384 1385 // sorry, IE 7 users; IE 8+ required. 1386 if (node && node.querySelectorAll) { 1387 1388 results = node.querySelectorAll(selector); 1389 1390 } 1391 1392 return results; 1393 1394 } 1395 1396 function get(/* parentNode, selector */) { 1397 1398 var results = getAll.apply(this, arguments); 1399 1400 // hackish: if an array, return the last item. 1401 if (results && results.length) { 1402 return results[results.length-1]; 1403 } 1404 1405 // handle "not found" case 1406 return results && results.length === 0 ? null : results; 1407 1408 } 1409 1410 return { 1411 get: get, 1412 getAll: getAll 1413 }; 1414 1415 }()), 1416 1417 position: (function() { 1418 1419 function getOffX(o) { 1420 1421 // http://www.xs4all.nl/~ppk/js/findpos.html 1422 var curleft = 0; 1423 1424 if (o.offsetParent) { 1425 1426 while (o.offsetParent) { 1427 1428 curleft += o.offsetLeft; 1429 1430 o = o.offsetParent; 1431 1432 } 1433 1434 } else if (o.x) { 1435 1436 curleft += o.x; 1437 1438 } 1439 1440 return curleft; 1441 1442 } 1443 1444 function getOffY(o) { 1445 1446 // http://www.xs4all.nl/~ppk/js/findpos.html 1447 var curtop = 0; 1448 1449 if (o.offsetParent) { 1450 1451 while (o.offsetParent) { 1452 1453 curtop += o.offsetTop; 1454 1455 o = o.offsetParent; 1456 1457 } 1458 1459 } else if (o.y) { 1460 1461 curtop += o.y; 1462 1463 } 1464 1465 return curtop; 1466 1467 } 1468 1469 return { 1470 getOffX: getOffX, 1471 getOffY: getOffY 1472 }; 1473 1474 }()), 1475 1476 style: (function() { 1477 1478 function get(node, styleProp) { 1479 1480 // http://www.quirksmode.org/dom/getstyles.html 1481 var value; 1482 1483 if (node.currentStyle) { 1484 1485 value = node.currentStyle[styleProp]; 1486 1487 } else if (window.getComputedStyle) { 1488 1489 value = document.defaultView.getComputedStyle(node, null).getPropertyValue(styleProp); 1490 1491 } 1492 1493 return value; 1494 1495 } 1496 1497 return { 1498 get: get 1499 }; 1500 1501 }()), 1502 1503 events: (function() { 1504 1505 var add, remove, preventDefault; 1506 1507 add = function(o, evtName, evtHandler) { 1508 // return an object with a convenient detach method. 1509 var eventObject = { 1510 detach: function() { 1511 return remove(o, evtName, evtHandler); 1512 } 1513 }; 1514 if (window.addEventListener) { 1515 o.addEventListener(evtName, evtHandler, false); 1516 } else { 1517 o.attachEvent('on' + evtName, evtHandler); 1518 } 1519 return eventObject; 1520 }; 1521 1522 remove = (window.removeEventListener !== undefined ? function(o, evtName, evtHandler) { 1523 return o.removeEventListener(evtName, evtHandler, false); 1524 } : function(o, evtName, evtHandler) { 1525 return o.detachEvent('on' + evtName, evtHandler); 1526 }); 1527 1528 preventDefault = function(e) { 1529 if (e.preventDefault) { 1530 e.preventDefault(); 1531 } else { 1532 e.returnValue = false; 1533 e.cancelBubble = true; 1534 } 1535 return false;
1536 }; 1537 1538 return { 1539 add: add, 1540 preventDefault: preventDefault, 1541 remove: remove 1542 }; 1543 1544 }()), 1545 1546 features: (function() { 1547 1548 var getAnimationFrame, 1549 localAnimationFrame, 1550 localFeatures, 1551 prop, 1552 styles, 1553 testDiv, 1554 transform; 1555 1556 testDiv = document.createElement('div'); 1557 1558 /** 1559 * hat tip: paul irish 1560 * http://paulirish.com/2011/requestanimationframe-for-smart-animating/ 1561 * https://gist.github.com/838785 1562 */ 1563 1564 localAnimationFrame = (window.requestAnimationFrame 1565 || window.webkitRequestAnimationFrame 1566 || window.mozRequestAnimationFrame 1567 || window.oRequestAnimationFrame 1568 || window.msRequestAnimationFrame 1569 || null); 1570 1571 // apply to window, avoid "illegal invocation" errors in Chrome 1572 getAnimationFrame = localAnimationFrame ? function() { 1573 return localAnimationFrame.apply(window, arguments); 1574 } : null; 1575 1576 function has(prop) { 1577 1578 // test for feature support 1579 var result = testDiv.style[prop]; 1580 1581 return (result !== undefined ? prop : null); 1582 1583 } 1584 1585 // note local scope. 1586 localFeatures = { 1587 1588 transform: { 1589 ie: has('-ms-transform'), 1590 moz: has('MozTransform'), 1591 opera: has('OTransform'), 1592 webkit: has('webkitTransform'), 1593 w3: has('transform'), 1594 prop: null // the normalized property value 1595 }, 1596 1597 rotate: { 1598 has3D: false, 1599 prop: null 1600 }, 1601 1602 getAnimationFrame: getAnimationFrame 1603 1604 }; 1605 1606 localFeatures.transform.prop = ( 1607 localFeatures.transform.w3 || 1608 localFeatures.transform.moz || 1609 localFeatures.transform.webkit || 1610 localFeatures.transform.ie || 1611 localFeatures.transform.opera 1612 ); 1613 1614 function attempt(style) { 1615 1616 try { 1617 testDiv.style[transform] = style; 1618 } catch(e) { 1619 // that *definitely* didn't work. 1620 return false; 1621 } 1622 // if we can read back the style, it should be cool. 1623 return !!testDiv.style[transform]; 1624 1625 } 1626 1627 if (localFeatures.transform.prop) { 1628 1629 // try to derive the rotate/3D support. 1630 transform = localFeatures.transform.prop; 1631 styles = { 1632 css_2d: 'rotate(0deg)', 1633 css_3d: 'rotate3d(0,0,0,0deg)' 1634 }; 1635 1636 if (attempt(styles.css_3d)) { 1637 localFeatures.rotate.has3D = true; 1638 prop = 'rotate3d'; 1639 } else if (attempt(styles.css_2d)) { 1640 prop = 'rotate'; 1641 } 1642 1643 localFeatures.rotate.prop = prop; 1644 1645 } 1646 1647 testDiv = null; 1648 1649 return localFeatures; 1650 1651 }()) 1652 1653 }; 1654 1655 // --- 1656 1657 // expose to global 1658 window.sm2BarPlayers = players; 1659 window.sm2BarPlayerOptions = playerOptions; 1660 window.SM2BarPlayer = Player; 1661//if (playervars.autoplay == 1){ 1662// 1663//} 1664}(window)); 1665// source --> https://myworstinvestmentever.com/wp-content/plugins/simple-podcast-press/responsive_audio_player/js/sm_timestamp.js?ver=5.7.17 1666jQuery(document).ready(function ($) { 1667 $("a.spp-timestamp").click(function(){ 1668 1669 1670 var time = $(this).attr("time"); 1671 1672 var listSoundIds = window.soundManager.soundIDs; 1673 var soundId = window.soundManager.soundIDs[0]; 1674 1675 if (listSoundIds[0] == null) { 1676 $( ".sm2-inline-button")[0].click(); 1677 soundId = window.soundManager.soundIDs[0]; 1678 soundManager.getSoundById(soundId).setPosition(time*1000); 1679 } 1680 1681 1682 else if (soundManager.getSoundById(soundId).paused) { 1683 soundManager.getSoundById(soundId).setPosition(time*1000); 1684 setTimeout(function(){ 1685 soundManager.resume(soundId); 1686 },500); 1687 1688 1689 } 1690 1691 // Either playing or never started 1692 else { 1693 $( ".sm2-inline-button")[0].click(); 1694 soundManager.resume(soundId); 1695 soundManager.getSoundById(soundId).setPosition(time*1000); 1696 } 1697 1698 1699 1700 }); 1701}); 1702// source --> https://myworstinvestmentever.com/wp-content/plugins/simple-podcast-press/responsive_audio_player/js/transcript.js?ver=5.7.17 1703jQuery(document).ready(function ($) { 1704 1705 $('.accordion-toggle').on('click', function(event){ 1706 event.preventDefault(); 1707 // create accordion variables 1708 var accordion = $(this); 1709 var accordionaccordion_content = accordion.next('.accordion-accordion_content'); 1710 var accordionToggleIcon = $(this).children('.toggle-icon'); 1711 1712 // toggle accordion link open class 1713 accordion.toggleClass("open"); 1714 // toggle accordion accordion_content 1715 accordionaccordion_content.slideToggle(250); 1716 1717 // change plus/minus icon 1718 if (accordion.hasClass("open")) { 1719 accordionToggleIcon.html("<i class='fa fa-angle-double-up'></i>"); 1720 } else { 1721 accordionToggleIcon.html("<i class='fa fa-angle-double-down'></i>"); 1722 } 1723 }); 1724 1725}); 1726// source --> https://myworstinvestmentever.com/wp-content/plugins/simple-podcast-press/responsive_audio_player/js/jquery.webui-popover.min.js?ver=5.7.17 1727/* 1728 * webui popover plugin - v1.2.0 1729 * A lightWeight popover plugin with jquery ,enchance the popover plugin of bootstrap with some awesome new features. It works well with bootstrap ,but bootstrap is not necessary! 1730 * https://github.com/sandywalker/webui-popover 1731 * 1732 * Made by Sandy Duan 1733 * Under MIT License 1734 */ 1735!function(a,b,c){"use strict";function d(b,c){this.$element=a(b),c&&("string"===a.type(c.delay)||"number"===a.type(c.delay))&&(c.delay={show:c.delay,hide:c.delay}),this.options=a.extend({},h,c),this._defaults=h,this._name=e,this._targetclick=!1,this.init(),i.push(this.$element)}var e="webuiPopover",f="webui-popover",g="webui.popover",h={placement:"auto",width:"auto",height:"auto",trigger:"click",
1735style:"",delay:{show:null,hide:null},async:{before:null,success:null},cache:!0,multi:!1,arrow:!0,title:"",content:"",closeable:!1,padding:!0,url:"",type:"html",animation:null,template:'<div class="webui-popover"><div class="arrow"></div><div class="webui-popover-inner"><a href="#" class="close">x</a><h3 class="webui-popover-title"></h3><div class="webui-popover-content"><i class="icon-refresh"></i> <p> </p></div></div></div>',backdrop:!1,dismissible:!0,onShow:null,onHide:null,abortXHR:!0,autoHide:!1,offsetTop:0,offsetLeft:0},i=[],j=a('<div class="webui-popover-backdrop"></div>'),k=0,l=!1,m=-2e3,n=a(c),o=function(a,b){return isNaN(a)?b||0:Number(a)};d.prototype={init:function(){"click"===this.getTrigger()?this.$element.off("click touchend").on("click touchend",a.proxy(this.toggle,this)):"hover"===this.getTrigger()&&this.$element.off("mouseenter mouseleave click").on("mouseenter",a.proxy(this.mouseenterHandler,this)).on("mouseleave",a.proxy(this.mouseleaveHandler,this)),this._poped=!1,this._inited=!0,this._opened=!1,this._idSeed=k,this.options.backdrop&&j.appendTo(c.body).hide(),k++,"sticky"===this.getTrigger()&&this.show()},destroy:function(){for(var a=-1,b=0;b<i.length;b++)if(i[b]===this.$element){a=b;break}i.splice(a,1),this.hide(),this.$element.data("plugin_"+e,null),"click"===this.getTrigger()?this.$element.off("click"):"hover"===this.getTrigger()&&this.$element.off("mouseenter mouseleave"),this.$target&&this.$target.remove()},hide:function(b,c){if((b||"sticky"!==this.getTrigger())&&this._opened){c&&(c.preventDefault(),c.stopPropagation()),this.xhr&&this.options.abortXHR===!0&&(this.xhr.abort(),this.xhr=null);var d=a.Event("hide."+g);if(this.$element.trigger(d,[this.$target]),this.$target){this.$target.removeClass("in").addClass(this.getHideAnimation());var e=this;setTimeout(function(){e.$target.hide()},300)}this.options.backdrop&&j.hide(),this._opened=!1,this.$element.trigger("hidden."+g,[this.$target]),this.options.onHide&&this.options.onHide(this.$target)}},resetAutoHide:function(){var a=this,b=a.getAutoHide();b&&(a.autoHideHandler&&clearTimeout(a.autoHideHandler),a.autoHideHandler=setTimeout(function(){a.hide()},b))},toggle:function(a){a&&(a.preventDefault(),a.stopPropagation()),this[this.getTarget().hasClass("in")?"hide":"show"]()},hideAll:function(){for(var a=0;a<i.length;a++)i[a].webuiPopover("hide");n.trigger("hiddenAll."+g)},show:function(){var a=this.getTarget().removeClass().addClass(f).addClass(this._customTargetClass);this.options.multi||this.hideAll(),this._opened||(this.getCache()&&this._poped&&""!==this.content||(this.content="",this.setTitle(this.getTitle()),this.options.closeable||a.find(".close").off("click").remove(),this.isAsync()?this.setContentASync(this.options.content):this.setContent(this.getContent()),a.show()),this.displayContent(),this.options.onShow&&this.options.onShow(a),this.bindBodyEvents(),this.options.backdrop&&j.show(),this._opened=!0,this.resetAutoHide())},displayContent:function(){var b=this.getElementPosition(),d=this.getTarget().removeClass().addClass(f).addClass(this._customTargetClass),e=this.getContentElement(),h=d[0].offsetWidth,i=d[0].offsetHeight,j="bottom",k=a.Event("show."+g);this.$element.trigger(k,[d]),"auto"!==this.options.width&&d.width(this.options.width),"auto"!==this.options.height&&e.height(this.options.height),this.options.style&&this.$target.addClass(f+"-"+this.options.style),this.options.arrow||d.find(".arrow").remove(),d.detach().css({top:m,left:m,display:"block"}),this.getAnimation()&&d.addClass(this.getAnimation()),d.appendTo(c.body),j=this.getPlacement(b),this.$element.trigger("added."+g),this.initTargetEvents(),this.options.padding||("auto"!==this.options.height&&e.css("height",e.outerHeight()),this.$target.addClass("webui-no-padding")),h=d[0].offsetWidth,i=d[0].offsetHeight;var l=this.getTargetPositin(b,j,h,i);if(this.$target.css(l.position).addClass(j).addClass("in"),"iframe"===this.options.type){var n=d.find("iframe");n.width(d.width()).height(n.parent().height())}if(this.options.arrow||this.$target.css({margin:0}),this.options.arrow){var o=this.$target.find(".arrow");o.removeAttr("style"),l.arrowOffset&&(-1===l.arrowOffset.left||-1===l.arrowOffset.top?o.hide():o.css(l.arrowOffset))}this._poped=!0,this.$element.trigger("shown."+g,[this.$target])},isTargetLoaded:function(){return 0===this.getTarget().find("i.glyphicon-refresh").length},getTriggerElement:function(){return this.$element},getTarget:function(){if(!this.$target){var b=e+this._idSeed;this.$target=a(this.options.template).attr("id",b).data("trigger-element",this.getTriggerElement()),this._customTargetClass=this.$target.attr("class")!==f?this.$target.attr("class"):null,this.getTriggerElement().attr("data-target",b)}return this.$target},getTitleElement:function(){return this.getTarget().find("."+f+"-title")},getContentElement:function(){return this.$contentElement||(this.$contentElement=this.getTarget().find("."+f+"-content"),console.log(this.$contentElement),this.$contentElement.show()),this.$contentElement},getTitle:function(){return this.$element.attr("data-title")||this.options.title||this.$element.attr("title")},getUrl:function(){return this.$element.attr("data-url")||this.options.url},getAutoHide:function(){return this.$element.attr("data-auto-hide")||this.options.autoHide},getOffsetTop:function(){return o(this.$element.attr("data-offset-top"))||this.options.offsetTop},getOffsetLeft:function(){return o(this.$element.attr("data-offset-left"))||this.options.offsetLeft},getCache:function(){var a=this.$element.attr("data-cache");if("undefined"!=typeof a)switch(a.toLowerCase()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":return!1}return this.options.cache},getTrigger:function(){return this.$element.attr("data-trigger")||this.options.trigger},getDelayShow:function(){var a=this.$element.attr("data-delay-show");return"undefined"!=typeof a?a:0===this.options.delay.show?0:this.options.delay.show||100},getHideDelay:function(){var a=this.$element.attr("data-delay-hide");return"undefined"!=typeof a?a:0===this.options.delay.hide?0:this.options.delay.hide||100},getAnimation:function(){var a=this.$element.attr("data-animation");return a||this.options.animation},getHideAnimation:function(){var a=this.getAnimation();return a?a+"-out":"out"},setTitle:function(a){var b=this.getTitleElement();a?b.html(a):b.remove()},hasContent:function(){return this.getContent()},getContent:function(){if(this.getUrl())switch(this.options.type){case"iframe":this.content=a('<iframe frameborder="0"></iframe>').attr("src",this.getUrl());break;case"html":try{this.content=a(this.getUrl()),this.content.is(":visible")||this.content.show()}catch(b){throw new Error("Unable to get popover content. Invalid selector specified.")}}else if(!this.content){var c="";if(c=a.isFunction(this.options.content)?this.options.content.apply(this.$element[0],[this]):this.options.content,this.content=this.$element.attr("data-content")||c,!this.content){var d=this.$element.next();d&&d.hasClass(f+"-content")&&(this.content=d)}}return this.content},setContent:function(a){var b=this.getTarget(),c=this.getContentElement();"string"==typeof a?c.html(a):a instanceof jQuery&&(a.removeClass(f+"-content"),c.html(""),a.appendTo(c)),this.$target=b},isAsync:function(){return"async"===this.options.type},setContentASync:function(b){var c=this;
1735this.xhr||(this.xhr=a.ajax({url:this.getUrl(),type:"GET",cache:this.getCache(),beforeSend:function(a){c.options.async.before&&c.options.async.before(c,a)},success:function(d){c.bindBodyEvents(),c.content=b&&a.isFunction(b)?b.apply(c.$element[0],[d]):d,c.setContent(c.content);var e=c.getContentElement();e.removeAttr("style"),c.displayContent(),c.options.async.success&&c.options.async.success(c,d)},complete:function(){c.xhr=null}}))},bindBodyEvents:function(){this.options.dismissible&&"click"===this.getTrigger()&&!l&&(n.off("keyup.webui-popover").on("keyup.webui-popover",a.proxy(this.escapeHandler,this)),n.off("click.webui-popover touchend.webui-popover").on("click.webui-popover touchend.webui-popover",a.proxy(this.bodyClickHandler,this)))},mouseenterHandler:function(){var a=this;a._timeout&&clearTimeout(a._timeout),a._enterTimeout=setTimeout(function(){a.getTarget().is(":visible")||a.show()},this.getDelayShow())},mouseleaveHandler:function(){var a=this;clearTimeout(a._enterTimeout),a._timeout=setTimeout(function(){a.hide()},this.getHideDelay())},escapeHandler:function(a){27===a.keyCode&&this.hideAll()},bodyClickHandler:function(){l=!0,"click"===this.getTrigger()&&(this._targetclick?this._targetclick=!1:this.hideAll())},targetClickHandler:function(){this._targetclick=!0},initTargetEvents:function(){"hover"===this.getTrigger()&&this.$target.off("mouseenter mouseleave").on("mouseenter",a.proxy(this.mouseenterHandler,this)).on("mouseleave",a.proxy(this.mouseleaveHandler,this)),this.$target.find(".close").off("click").on("click",a.proxy(this.hide,this,!0)),this.$target.off("click.webui-popover").on("click.webui-popover",a.proxy(this.targetClickHandler,this))},getPlacement:function(a){var b,d=c.documentElement,e=c.body,f=d.clientWidth,g=d.clientHeight,h=Math.max(e.scrollTop,d.scrollTop),i=Math.max(e.scrollLeft,d.scrollLeft),j=Math.max(0,a.left-i),k=Math.max(0,a.top-h);b="function"==typeof this.options.placement?this.options.placement.call(this,this.getTarget()[0],this.$element[0]):this.$element.data("placement")||this.options.placement;var l="horizontal"===b,m="vertical"===b,n="auto"===b||l||m;return n?b=f/3>j?g/3>k?l?"right-bottom":"bottom-right":2*g/3>k?m?g/2>=k?"bottom-right":"top-right":"right":l?"right-top":"top-right":2*f/3>j?g/3>k?l?f/2>=j?"right-bottom":"left-bottom":"bottom":2*g/3>k?l?f/2>=j?"right":"left":g/2>=k?"bottom":"top":l?f/2>=j?"right-top":"left-top":"top":g/3>k?l?"left-bottom":"bottom-left":2*g/3>k?m?g/2>=k?"bottom-left":"top-left":"left":l?"left-top":"top-left":"auto-top"===b?b=f/3>j?"top-right":2*f/3>j?"top":"top-left":"auto-bottom"===b?b=f/3>j?"bottom-right":2*f/3>j?"bottom":"bottom-left":"auto-left"===b?b=g/3>k?"left-top":2*g/3>k?"left":"left-bottom":"auto-right"===b&&(b=g/3>k?"right-top":2*g/3>k?"right":"right-bottom"),b},getElementPosition:function(){return a.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTargetPositin:function(a,b,d,e){var f=a,g=c.documentElement,h=c.body,i=g.clientWidth,j=g.clientHeight,k=this.$element.outerWidth(),l=this.$element.outerHeight(),n=Math.max(h.scrollTop,g.scrollTop),o=Math.max(h.scrollLeft,g.scrollLeft),p={},q=null,r=this.options.arrow?20:0,s=10,t=r+s>k?r:0,u=r+s>l?r:0,v=0,w=j+n,x=i+o,y=f.left+f.width/2-t>0,z=f.left+f.width/2+t<x,A=f.top+f.height/2-u>0,B=f.top+f.height/2+u<w;switch(b){case"bottom":p={top:f.top+f.height,left:f.left+f.width/2-d/2};break;case"top":p={top:f.top-e,left:f.left+f.width/2-d/2};break;case"left":p={top:f.top+f.height/2-e/2,left:f.left-d};break;case"right":p={top:f.top+f.height/2-e/2,left:f.left+f.width};break;case"top-right":p={top:f.top-e,left:y?f.left-t:s},q={left:y?Math.min(k,d)/2+t:m};break;case"top-left":v=z?t:-s,p={top:f.top-e,left:f.left-d+f.width+v},q={left:z?d-Math.min(k,d)/2-t:m};break;case"bottom-right":p={top:f.top+f.height,left:y?f.left-t:s},q={left:y?Math.min(k,d)/2+t:m};break;case"bottom-left":v=z?t:-s,p={top:f.top+f.height,left:f.left-d+f.width+v},q={left:z?d-Math.min(k,d)/2-t:m};break;case"right-top":v=B?u:-s,p={top:f.top-e+f.height+v,left:f.left+f.width},q={top:B?e-Math.min(l,e)/2-u:m};break;case"right-bottom":p={top:A?f.top-u:s,left:f.left+f.width},q={top:A?Math.min(l,e)/2+u:m};break;case"left-top":v=B?u:-s,p={top:f.top-e+f.height+v,left:f.left-d}
1735,q={top:B?e-Math.min(l,e)/2-u:m};break;case"left-bottom":p={top:A?f.top-u:s,left:f.left-d},q={top:A?Math.min(l,e)/2+u:m}}return p.top+=this.getOffsetTop(),p.left+=this.getOffsetLeft(),{position:p,arrowOffset:q}}},a.fn[e]=function(b,c){var f=[],g=this.each(function(){var g=a.data(this,"plugin_"+e);g?"destroy"===b?g.destroy():"string"==typeof b&&f.push(g[b]()):(b?"string"==typeof b?"destroy"!==b&&(c||(g=new d(this,null),f.push(g[b]()))):"object"==typeof b&&(g=new d(this,b)):g=new d(this,null),a.data(this,"plugin_"+e,g))});return f.length?f:g}}(jQuery,window,document); 1736// source --> https://myworstinvestmentever.com/wp-content/plugins/simple-podcast-press/responsive_audio_player/js/clammrit.js?ver=5.7.17 1737function sppClammrIt(starttime,endtime, audio_file, chnale_image, post_title, post_content) { 1738 var sppCurrentTime = document.getElementsByClassName("audioplayer-time audioplayer-time-current"); 1739 var sppCurStartTime = starttime; 1740 var sppCurEndTime = endtime; 1741 var sppReferralName = 'SimplePodcastPress'; 1742 1743 var p = sppCurStartTime.split(':'), 1744 s = 0, m = 1; 1745 while (p.length > 0) { 1746 s += m * parseInt(p.pop(), 10); 1747 m *= 60; 1748 } 1749 1750 var p1 = sppCurEndTime.split(':'), 1751 s1 = 0, m1 = 1; 1752 while (p1.length > 0) { 1753 s1 += m1 * parseInt(p1.pop(), 10); 1754 m1 *= 60; 1755 } 1756 var sppCurStartTimeMs = s * 1000; 1757 var sppCurEndTimeMs = s1 * 1000; 1758 // var sppCurEndTimeMs = sppCurStartTimeMs + 24000; 1759 var clammrUrlEncoded = "https://www.clammr.com/app/clammr/crop"; 1760 clammrUrlEncoded += "?audioUrl=" + encodeURIComponent(audio_file); 1761 clammrUrlEncoded += "&imageUrl=" + encodeURIComponent(chnale_image); 1762 clammrUrlEncoded += "&audioStartTime=" + encodeURIComponent(sppCurStartTimeMs); 1763 clammrUrlEncoded += "&audioEndTime=" + encodeURIComponent(sppCurEndTimeMs); 1764 clammrUrlEncoded += "&title=" + post_title; 1765 clammrUrlEncoded += "&description=" + encodeURIComponent(post_content); 1766 clammrUrlEncoded += "&referralName=" + encodeURIComponent("SimplePodcastPress"); 1767 1768 if (document.getElementsByClassName("sppaudioplayer").item(0) != null) 1769 jQuery('.sppaudioplayer').trigger("pause"); 1770 // SM players 1771 else if (window.soundManager) { 1772 var soundId = window.soundManager.soundIDs[0]; 1773 if (soundId != null) { 1774 soundManager.getSoundById(soundId).pause(); 1775 jQuery("div.smart-track-player").removeClass("spp-playing"); 1776 } 1777 } 1778 1779 1780 window.open(clammrUrlEncoded, 'cropPlugin', 'width=1000, height=750, top=50, left=200'); 1781}; 1782// source --> https://myworstinvestmentever.com/wp-content/plugins/simple-podcast-press/responsive_audio_player/js/jquery.reveal.js?ver=5.7.17 1783/* 1784 * jQuery Reveal Plugin 1.0 1785 * www.ZURB.com 1786 * Copyright 2010, ZURB 1787 * Free to use under the MIT license. 1788 * http://www.opensource.org/licenses/mit-license.php 1789*/ 1790 1791 1792(function($) { 1793 1794/*--------------------------- 1795 Defaults for Reveal 1796----------------------------*/ 1797 1798/*--------------------------- 1799 Listener for data-reveal-id attributes 1800----------------------------*/ 1801 1802 $('a[data-reveal-id]').live('click', function(e) { 1803 e.preventDefault(); 1804 var modalLocation = $(this).attr('data-reveal-id'); 1805 $('#'+modalLocation).reveal($(this).data()); 1806 }); 1807 1808/*--------------------------- 1809 Extend and Execute 1810----------------------------*/ 1811 1812 $.fn.reveal = function(options) { 1813 1814 1815 var defaults = { 1816 animation: 'fadeAndPop', //fade, fadeAndPop, none 1817 animationspeed: 300, //how fast animtions are 1818 closeonbackgroundclick: true, //if you click background will modal close?
1819 dismissmodalclass: 'close-reveal-modal' //the class of a button or element that will close an open modal 1820 }; 1821 1822 //Extend dem' options 1823 var options = $.extend({}, defaults, options); 1824 1825 return this.each(function() { 1826 1827/*--------------------------- 1828 Global Variables 1829----------------------------*/ 1830 var modal = $(this), 1831 topMeasure = parseInt(modal.css('top')), 1832 topOffset = modal.height() + topMeasure, 1833 locked = false, 1834 modalBG = $('.reveal-modal-bg'); 1835 1836 1837/*--------------------------- 1838 Create Modal BG 1839----------------------------*/ 1840 if(modalBG.length == 0) { 1841 modalBG = $('<div class="reveal-modal-bg" />').insertAfter(modal); 1842 } 1843 1844/*--------------------------- 1845 Open & Close Animations 1846----------------------------*/ 1847 //Entrance Animations 1848 modal.bind('reveal:open', function () { 1849 modalBG.unbind('click.modalEvent'); 1850 $('.' + options.dismissmodalclass).unbind('click.modalEvent'); 1851 if(!locked) { 1852 lockModal(); 1853 if(options.animation == "fadeAndPop") { 1854 modal.css({'top': $(document).scrollTop()-topOffset, 'opacity' : 0, 'visibility' : 'visible'}); 1855 modalBG.fadeIn(options.animationspeed/2); 1856 modal.delay(options.animationspeed/2).animate({ 1857 "top": $(document).scrollTop()+topMeasure + 'px', 1858 "opacity" : 1 1859 }, options.animationspeed,unlockModal()); 1860 } 1861 if(options.animation == "fade") { 1862 modal.css({'opacity' : 0, 'visibility' : 'visible', 'top': $(document).scrollTop()+topMeasure}); 1863 modalBG.fadeIn(options.animationspeed/2); 1864 modal.delay(options.animationspeed/2).animate({ 1865 "opacity" : 1 1866 }, options.animationspeed,unlockModal()); 1867 } 1868 if(options.animation == "none") { 1869 modal.css({'visibility' : 'visible', 'top':$(document).scrollTop()+topMeasure}); 1870 modalBG.css({"display":"block"}); 1871 unlockModal() 1872 } 1873 } 1874 modal.unbind('reveal:open'); 1875 }); 1876 1877 //Closing Animation 1878 modal.bind('reveal:close', function () { 1879 if(!locked) { 1880 lockModal(); 1881 if(options.animation == "fadeAndPop") { 1882 modalBG.delay(options.animationspeed).fadeOut(options.animationspeed); 1883 modal.animate({ 1884 "top": $(document).scrollTop()-topOffset + 'px', 1885 "opacity" : 0 1886 }, options.animationspeed/2, function() { 1887 modal.css({'top':topMeasure, 'opacity' : 1, 'visibility' : 'hidden'}); 1888 unlockModal(); 1889 }); 1890 } 1891 if(options.animation == "fade") { 1892 modalBG.delay(options.animationspeed).fadeOut(options.animationspeed); 1893 modal.animate({ 1894 "opacity" : 0 1895 }, options.animationspeed, function() { 1896 modal.css({'opacity' : 1, 'visibility' : 'hidden', 'top' : topMeasure}); 1897 unlockModal(); 1898 }); 1899 } 1900 if(options.animation == "none") { 1901 modal.css({'visibility' : 'hidden', 'top' : topMeasure}); 1902 modalBG.css({'display' : 'none'}); 1903 } 1904 } 1905 modal.unbind('reveal:close'); 1906 }); 1907 1908/*--------------------------- 1909 Open and add Closing Listeners 1910----------------------------*/ 1911 //Open Modal Immediately 1912 modal.trigger('reveal:open') 1913 1914 //Close Modal Listeners 1915 var closeButton = $('.' + options.dismissmodalclass).bind('click.modalEvent', function () { 1916 modal.trigger('reveal:close') 1917 }); 1918 1919 if(options.closeonbackgroundclick) { 1920 modalBG.css({"cursor":"pointer"}) 1921 modalBG.bind('click.modalEvent', function () { 1922 modal.trigger('reveal:close') 1923 }); 1924 } 1925 $('body').keyup(function(e) { 1926 if(e.which===27){ modal.trigger('reveal:close'); } // 27 is the keycode for the Escape key 1927 }); 1928 1929 1930/*--------------------------- 1931 Animations Locks 1932----------------------------*/ 1933 function unlockModal() { 1934 locked = false; 1935 } 1936 function lockModal() { 1937 locked = true; 1938 } 1939 1940 });//each call 1941 }//orbit plugin call 1942})(jQuery); 1943// source --> https://myworstinvestmentever.com/wp-content/plugins/simple-podcast-press/responsive_audio_player/js/rotator.js?ver=5.7.17 1944jQuery(document).ready(function(){ 1945 1946 jQuery(".reviews_view").each(function(){ 1947 var format = jQuery(this).attr("style"); 1948 if(format == 'slideshow'){ 1949 var obj = this; 1950 jQuery(this).find('li').css({"display":"none"}); 1951 jQuery(this).find('li').eq(0).css({"display":"block"}); 1952 setInterval(function(){ 1953 var count = jQuery(obj).children('li').length; 1954 var rand = Math.floor(Math.random()*count);
1955 var current = parseInt(jQuery(obj).attr("current"),10); 1956 jQuery(obj).find("li").eq(current).fadeOut("slow","linear",function(){ 1957 jQuery(obj).find("li").eq(rand).fadeIn("slow","linear",function(){ 1958 jQuery(obj).attr({"current":rand}); 1959 1960 }); 1961 1962 }); 1963 1964 },10000); 1965 } 1966 }); 1967}); 1968// source --> https://myworstinvestmentever.com/wp-content/plugins/simple-social-icons/svgxuse.js?ver=1.1.21 1969/*! 1970 * @copyright Copyright (c) 2016 IcoMoon.io 1971 * @license Licensed under MIT license 1972 * See https://github.com/Keyamoon/svgxuse 1973 * @version 1.1.21 1974 */ 1975/*jslint browser: true */ 1976/*global XDomainRequest, MutationObserver, window */ 1977(function () { 1978 'use strict'; 1979 if (window && window.addEventListener) { 1980 var cache = Object.create(null); // holds xhr objects to prevent multiple requests 1981 var checkUseElems; 1982 var tid; // timeout id 1983 var debouncedCheck = function () { 1984 clearTimeout(tid); 1985 tid = setTimeout(checkUseElems, 100); 1986 }; 1987 var unobserveChanges = function () { 1988 return; 1989 }; 1990 var observeChanges = function () { 1991 var observer; 1992 window.addEventListener('resize', debouncedCheck, false); 1993 window.addEventListener('orientationchange', debouncedCheck, false); 1994 if (window.MutationObserver) { 1995 observer = new MutationObserver(debouncedCheck); 1996 observer.observe(document.documentElement, { 1997 childList: true, 1998 subtree: true, 1999 attributes: true 2000 }); 2001 unobserveChanges = function () { 2002 try { 2003 observer.disconnect(); 2004 window.removeEventListener('resize', debouncedCheck, false); 2005 window.removeEventListener('orientationchange', debouncedCheck, false); 2006 } catch (ignore) {} 2007 }; 2008 } else { 2009 document.documentElement.addEventListener('DOMSubtreeModified', debouncedCheck, false); 2010 unobserveChanges = function () { 2011 document.documentElement.removeEventListener('DOMSubtreeModified', debouncedCheck, false); 2012 window.removeEventListener('resize', debouncedCheck, false); 2013 window.removeEventListener('orientationchange', debouncedCheck, false); 2014 }; 2015 } 2016 }; 2017 var createRequest = function (url) { 2018 // In IE 9, cross domain requests can only be sent using XDomainRequest. 2019 // XDomainRequest would fail if CORS headers are not set. 2020 // Therefore, XDomainRequest should only be used with cross domain requests. 2021 function getHostname(href) { 2022 var a = document.createElement('a'); 2023 a.href = href; 2024 return a.hostname; 2025 } 2026 var Request; 2027 var hname = location.hostname; 2028 var hname2; 2029 if (window.XMLHttpRequest) { 2030 Request = new XMLHttpRequest(); 2031 hname2 = getHostname(url); 2032 if (Request.withCredentials === undefined && hname2 !== '' && hname2 !== hname) { 2033 Request = XDomainRequest || undefined; 2034 } else { 2035 Request = XMLHttpRequest; 2036 } 2037 } 2038 return Request; 2039 }; 2040 var xlinkNS = 'http://www.w3.org/1999/xlink'; 2041 checkUseElems = function () { 2042 var base; 2043 var bcr; 2044 var fallback = ''; // optional fallback URL in case no base path to SVG file was given and no symbol definition was found. 2045 var hash; 2046 var href; 2047 var i; 2048 var inProgressCount = 0; 2049 var isHidden; 2050 var Request; 2051 var url; 2052 var uses; 2053 var xhr; 2054 function observeIfDone() { 2055 // If done with making changes, start watching for chagnes in DOM again 2056 inProgressCount -= 1; 2057 if (inProgressCount === 0) { // if all xhrs were resolved 2058 unobserveChanges(); // make sure to remove old handlers 2059 observeChanges(); // watch for changes to DOM 2060 } 2061 } 2062 function attrUpdateFunc(spec) { 2063 return function () { 2064 if (cache[spec.base] !== true) { 2065 spec.useEl.setAttributeNS(xlinkNS, 'xlink:href', '#' + spec.hash); 2066 } 2067 }; 2068 } 2069 function onloadFunc(xhr) { 2070 return function () { 2071 var body = document.body; 2072 var x = document.createElement('x'); 2073 var svg; 2074 xhr.onload = null; 2075 x.innerHTML = xhr.responseText; 2076 svg = x.getElementsByTagName('svg')[0]; 2077 if (svg) { 2078 svg.setAttribute('aria-hidden', 'true'); 2079 svg.style.position = 'absolute'; 2080 svg.style.width = 0; 2081 svg.style.height = 0; 2082 svg.style.overflow = 'hidden'; 2083 body.insertBefore(svg, body.firstChild); 2084 } 2085 observeIfDone(); 2086 }; 2087 } 2088 function onErrorTimeout(xhr) { 2089 return function () { 2090 xhr.onerror = null; 2091 xhr.ontimeout = null; 2092 observeIfDone(); 2093 }; 2094 } 2095 unobserveChanges(); // stop watching for changes to DOM 2096 // find all use elements 2097 uses = document.getElementsByTagName('use'); 2098 for (i = 0; i < uses.length; i += 1) { 2099 try { 2100 bcr = uses[i].getBoundingClientRect(); 2101 } catch (ignore) { 2102 // failed to get bounding rectangle of the use element 2103 bcr = false;
vendor: 2,123 bytes, lines 2104-2146
2104 } 2105 href = uses[i].getAttributeNS(xlinkNS, 'href'); 2106 if (href && href.split) { 2107 url = href.split('#'); 2108 } else { 2109 url = ["", ""]; 2110 } 2111 base = url[0]; 2112 hash = url[1]; 2113 isHidden = bcr && bcr.left === 0 && bcr.right === 0 && bcr.top === 0 && bcr.bottom === 0; 2114 if (bcr && bcr.width === 0 && bcr.height === 0 && !isHidden) { 2115 // the use element is empty 2116 // if there is a reference to an external SVG, try to fetch it 2117 // use the optional fallback URL if there is no reference to an external SVG 2118 if (fallback && !base.length && hash && !document.getElementById(hash)) { 2119 base = fallback; 2120 } 2121 if (base.length) { 2122 // schedule updating xlink:href 2123 xhr = cache[base]; 2124 if (xhr !== true) { 2125 // true signifies that prepending the SVG was not required 2126 setTimeout(attrUpdateFunc({ 2127 useEl: uses[i], 2128 base: base, 2129 hash: hash 2130 }), 0); 2131 } 2132 if (xhr === undefined) { 2133 Request = createRequest(base); 2134 if (Request !== undefined) { 2135 xhr = new Request(); 2136 cache[base] = xhr; 2137 xhr.onload = onloadFunc(xhr); 2138 xhr.onerror = onErrorTimeout(xhr); 2139 xhr.ontimeout = onErrorTimeout(xhr); 2140 xhr.open('GET', base); 2141 xhr.send(); 2142 inProgressCount += 1; 2143 } 2144 } 2145 } 2146 } else {
2147 if (!isHidden) { 2148 if (cache[base] === undefined) { 2149 // remember this URL if the use element was not empty and no request was sent 2150 cache[base] = true; 2151 } else if (cache[base].onload) { 2152 // if it turns out that prepending the SVG is not necessary, 2153 // abort the in-progress xhr. 2154 cache[base].abort(); 2155 delete cache[base].onload; 2156 cache[base] = true; 2157 } 2158 } else if (base.length && cache[base]) { 2159 attrUpdateFunc({ 2160 useEl: uses[i], 2161 base: base, 2162 hash: hash 2163 })(); 2164 } 2165 } 2166 } 2167 uses = ''; 2168 inProgressCount += 1; 2169 observeIfDone(); 2170 }; 2171 // The load event fires when all resources have finished loading, which allows detecting whether SVG use elements are empty. 2172 window.addEventListener('load', function winLoad() { 2173 window.removeEventListener('load', winLoad, false); // to prevent memory leaks 2174 tid = setTimeout(checkUseElems, 0); 2175 }, false); 2176 } 2177}());
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.