").html(e.src).html().replace("&","&"),this.isPremium&&!1!==o&&"feedurl"===o.from){if(void 0!==e.key){var h={ppplayer:o.fprint,ppepisode:e.key},p=jQuery.param(h),c=o.permalink;s=c?c+(c.indexOf("?")<0?"?":"&")+p:s,s=encodeURIComponent(s)}}else if(this.isPremium){var m=jQuery.param({sharedby:"pplayer"});s=s+(s.indexOf("?")<0?"?":"&")+encodeURIComponent(m)}var u="https://www.facebook.com/sharer.php?u="+s,y="https://twitter.com/intent/tweet?url="+s+"&text="+i,f="https://www.linkedin.com/shareArticle?mini=true&url="+s,g="mailto:?subject="+i+"&body=Link:"+s;return this.listItem.addClass("activeEpisode media-playing"),this.episode.find(".episode-single__title").html(e.title),this.episode.find(".episode-single__author > .single-author").html(e.author),this.controls.find(".ppjs__episode-title").html(e.title),this.controls.find(".ppjs__episode-excerpt").text(n),this.episode.find(".episode-single__description").html(e.description),r.find(".ppsocial__facebook").attr("href",u),r.find(".ppsocial__twitter").attr("href",y),r.find(".ppsocial__linkedin").attr("href",f),r.find(".ppsocial__email").attr("href",g),r.find(".ppshare__download").attr("href",a),(n=!!(n=this.episode.find(".episode-single__description")).length&&n.text())&&(n=n.split(" ").splice(0,18).join(" "),this.controls.find(".ppjs__excerpt-content").text(n)),this.mediaObj.setSrc(a),this.mediaObj.load(),this.playMessage(),!0}},{key:"btnImage",value:function(){var t="pp-podcast-".concat(this.instance),e=this.listItem.attr("id"),s=this.listItem.hasClass("episode-list__search-entry")?this.data.search[e]:this.data[t][e],i=s.featured,a=s.fset;i?(this.player.find(".ppjs__img-btn").attr("srcset",a).attr("src",i).closest(".ppjs__img-wrapper").removeClass("noimg"),this.modalObj&&this.modalObj.modal.find(".ppjs__img-btn").attr("scrset",a).attr("src",i).closest(".ppjs__img-wrapper").removeClass("noimg")):(this.player.find(".ppjs__img-wrapper").addClass("noimg"),this.modalObj&&this.modalObj.modal.find(".ppjs__img-wrapper").addClass("noimg"))}},{key:"playPauseBtn",value:function(){if(!1!==this.played)this.mediaObj.paused?(this.mediaObj.play(),this.listItem&&this.listItem.addClass("activeEpisode media-playing")):(this.mediaObj.pause(),this.listItem&&this.listItem.removeClass("activeEpisode media-playing"));else if(this.played=!0,this.playMessage(),!this.playingAmsg){this.mediaObj.play();var t=this.list.find(".episode-list__entry").first();t.length&&(this.listItem=t,this.listItem.addClass("activeEpisode media-playing"))}}},{key:"play",value:function(){if(this.listItem.hasClass("activeEpisode"))return this.listItem.removeClass("activeEpisode"),this.mediaObj.pause(),this.player.removeClass("msg-playing"),this.playingAmsg=!1,void(this.msgMediaObj&&(this.msgMediaObj.pause(),this.msgMediaObj.currentTime=0));this.modalObj.modal&&this.modalObj.modal.hasClass("pp-modal-open")&&this.modalObj.returnElem(),this.common(),this.btnImage(),this.playingAmsg||this.mediaObj.play(),this.podcast.hasClass("wide-player")?jQuery("html, body").animate({scrollTop:this.player.offset().top-200},400):jQuery("html, body").animate({scrollTop:this.player.offset().top},400)}},{key:"playModal",value:function(t){this.modalObj&&(this.listItem.hasClass("activeEpisode")?t?(this.modalObj.modal.removeClass("inline-view").addClass("modal-view"),this.modalObj.scrollDisable(),this.playingAmsg||(this.modalObj.modal.find(".episode-primary__title").find(".episode-single__title").html(this.episode.find(".episode-single__title").html()),this.mediaObj.play(),this.modalObj.modal.removeClass("media-paused"),this.listItem.addClass("media-playing"))):this.msgMediaObj&&this.playingAmsg?this.msgMediaObj.paused?(this.msgMediaObj.play(),this.modalObj.modal.removeClass("media-paused"),this.listItem.addClass("media-playing")):(this.msgMediaObj.pause(),this.modalObj.modal.addClass("media-paused"),this.listItem.removeClass("media-playing")):this.mediaObj.paused?(this.mediaObj.play(),this.modalObj.modal.removeClass("media-paused"),this.listItem.addClass("media-playing")):(this.mediaObj.pause(),this.modalObj.modal.addClass("media-paused"),this.listItem.removeClass("media-playing")):(this.common(),this.singleWrap.hasClass("activePodcast")?t&&(this.modalObj.modal.find(".episode-primary__title").find(".episode-single__title").html(this.episode.find(".episode-single__title").html()),this.modalObj.modal.removeClass("inline-view").addClass("modal-view"),this.modalObj.scrollDisable()):(this.modalObj.modal.hasClass("pp-modal-open")&&this.modalObj.returnElem(),this.modalObj.create(this.singleWrap,this.mediaObj,this.msgMediaObj,t),this.singleWrap.addClass("activePodcast")),this.playingAmsg||this.mediaObj.play(),this.modalObj.modal.removeClass("media-paused"),this.btnImage()))}},{key:"playMessage",value:function(){var t="pp-podcast-".concat(this.instance),e=!!this.data[t]&&this.data[t].rdata;if(e&&void 0!==e.audiomsg)if(e.playfreq<=this.msgFreqCounter||!1===this.played){if(this.msgFreqCounter=0,"start"===e.msgstart)this.playingAmsg=!0,this.player.addClass("msg-playing"),this.msgMediaObj&&this.msgMediaObj.play();else if("end"===e.msgstart)this.playAmsg=!0;else if("custom"===e.msgstart){var s=60*e.msgtime[0]*60+60*e.msgtime[1]+e.msgtime[2];this.deferredPlay(s)}}else this.msgFreqCounter++,this.playingAmsg=!1}},{key:"deferredPlay",value:function(t){var e=this;if(t){var s=this.mediaObj.currentTime;s&&s>=t?(this.playingAmsg=!0,this.mediaObj.pause(),this.msgMediaObj&&this.msgMediaObj.play(),this.player.addClass("msg-playing")):setTimeout((function(){e.deferredPlay(t)}),1e3)}}},{key:"mediaEnded",value:function(){!0===this.playAmsg?(this.playingAmsg=!1,this.player.addClass("msg-playing"),this.msgMediaObj&&this.msgMediaObj.play()):this.listItem&&!this.listItem.hasClass("episode-list__search-entry")&&this.playNextEpisode()}},{key:"msgMediaEnded",value:function(){!0===this.playingAmsg?(this.player.removeClass("msg-playing"),this.playingAmsg=!1,this.mediaObj.play()):!0===this.playAmsg&&this.listItem&&!this.listItem.hasClass("episode-list__search-entry")&&this.playNextEpisode()}}])&&d(e.prototype,s),a&&d(e,a),t}();function p(t,e){for(var s=0;s
"),d=e.find(".pod-entry__image"),r=d.length?d.attr("sizes"):"",h="";for("posts"===s&&(h="fetch-post-title");l<=n;l++){var p="ppe-".concat(this.instance,"-").concat(l),c=this.data[t][p];if(void 0!==c){var m=c.title,u=c.description,y=c.author,f=c.date,g=c.link,v=c.featured,b=c.fset,_=jQuery("
",{href:g,class:h}).html(m),j=jQuery("
",{class:"pod-entry__title"}).html(_),w=jQuery("
",{class:"pod-entry__date"}).text(f),C=jQuery("
",{class:"pod-entry__author"}).html(y),O=void 0;if(this.podcast.hasClass("postview")){var M=i.args.display,k=u?jQuery(u).text():"",x=jQuery("
",{class:"pod-entry__play"}).html(this.settings.ppPlayCircle+this.settings.ppPauseBtn),E=void 0,P="";if(E=M&&this.isStyleSupport(M,"playbtn")?"":(E=v?jQuery("
",{class:"pod-entry__image",src:v,srcset:b,sizes:r}):"")?'
'.concat(E[0].outerHTML,"
"):"",M&&this.isStyleSupport(M,"excerpt")){var T=k?k.split(" ").splice(0,a).join(" "):"",B=T?jQuery("
",{class:"pod-entry__excerpt"}).text(T+"..."):"";P=B?B[0].outerHTML:""}O='\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t').concat(x[0].outerHTML,"\n\t\t\t\t\t\t\t").concat(E,'\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t').concat(j[0].outerHTML).concat(P).concat(w[0].outerHTML).concat(C[0].outerHTML,"\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t")}else O='\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t').concat(j[0].outerHTML).concat(w[0].outerHTML).concat(C[0].outerHTML,"\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t");o.append(jQuery(O))}}this.loadbtn.parent().before(o.html()),i.displayed=n,this.fetchEpisodes()}},{key:"fetchEpisodes",value:function(){var t="pp-podcast-".concat(this.instance),e=this.data[t].rdata;"feedurl"===e.from?this.fetchFromFeed():"posts"===e.from&&this.fetchFromPosts()}},{key:"fetchFromFeed",value:function(){var t=this,e="pp-podcast-".concat(this.instance),s=this.data[e].load_info,i=this.data.ajax_info,a={action:"pp_fetch_episodes",security:i.security,instance:this.instance,loaded:s.loaded,maxItems:s.maxItems,feedUrl:s.src,step:s.step,sortby:s.sortby,filterby:s.filterby,args:s.args};s.loaded>=s.maxItems?s.displayed>=s.loaded&&this.loadbtn.slideUp("slow"):jQuery.ajax({url:i.ajaxurl,data:a,type:"POST",timeout:4e3,success:function(i){var a=jQuery.parseJSON(i);s.loaded=a.loaded,jQuery.extend(!0,t.data[e],a.episodes)},error:function(){t.loadbtn.hide()}})}},{key:"fetchFromPosts",value:function(){var t=this,e="pp-podcast-".concat(this.instance),s=this.data[e].load_info,i=this.data.ajax_info,a={action:"pp_fetch_posts",security:i.security,instance:this.instance,offset:s.offset,loaded:s.loaded,args:s.args};0!==s.offset?jQuery.ajax({url:i.ajaxurl,data:a,type:"POST",timeout:4e3,success:function(i){var a=jQuery.parseJSON(i);jQuery.isEmptyObject(a)?(s.offset=0,t.loadbtn.slideUp("slow")):(s.loaded=a.loaded,jQuery.extend(!0,t.data[e],a.episodes),s.offset+=s.step)},error:function(){t.loadbtn.hide()}}):this.loadbtn.slideUp("slow")}}])&&p(e.prototype,s),a&&p(e,a),t}();function m(t,e){for(var s=0;s
input"),this.searchResults=this.list.find(".episode-search"),this.searchClose=this.list.find(".episode-list__clear-search"),this.events()}var e,s,a;return e=t,(s=[{key:"events",value:function(){this.searchBox.on("keyup",this.initSearch.bind(this)),this.searchClose.click(this.clearSearch.bind(this))}},{key:"initSearch",value:function(){var t="";!1===this.isSrchOpen&&(this.podcast.addClass("search-opened"),this.searchResults.addClass("toggled-on"),this.loadbtn.hide(),this.prevBtn.attr("disabled",!0),this.nextBtn.attr("disabled",!0),this.searchClose.show(),this.isSrchOpen=!0),clearTimeout(this.localTimeOut),this.localTimeOut=setTimeout(function(){(t=jQuery.trim(this.searchBox.val().toLowerCase()))&&this.filterEpisodes(t)}.bind(this),100),clearTimeout(this.serverTimeOut),this.serverTimeOut=setTimeout(function(){if(t){if(this.prevSearchTerm===t)return;this.liveSearch(t)}else this.clearSearch()}.bind(this),500)}},{key:"filterEpisodes",value:function(t){this.episodes.find(".episode-list__entry").each((function(){jQuery(this).filter("[data-search-term *="+t+"]").length>0||t.length<1?jQuery(this).show():jQuery(this).hide()}))}},{key:"liveSearch",value:function(t){if(!1===this.hasLoading){var e=jQuery("",{class:"episode-search__loading"}).html(this.settings.ppVidLoading);this.searchResults.html(e),this.hasLoading=!0}this.fetchResults(t)}},{key:"fetchResults",value:function(t){var e="pp-podcast-".concat(this.instance),s=this.data[e].rdata;"feedurl"===s.from?this.fetchFromFeed(t):"posts"===s.from&&this.fetchFromPosts(t)}},{key:"fetchFromFeed",value:function(t){var e=this,s="pp-podcast-".concat(this.instance),i=this.data[s].load_info,a=this.data.ajax_info,n={action:"pp_search_episodes",security:a.security,instance:"s",loaded:i.displayed,maxItems:i.maxItems,feedUrl:i.src,sortby:i.sortby,filterby:i.filterby,search:t,args:i.args};i.displayed>=i.maxItems?this.flushSearchResults():jQuery.ajax({url:a.ajaxurl,data:n,type:"POST",timeout:4e3,success:function(t){var s=jQuery.parseJSON(t);jQuery.isEmptyObject(s)?e.flushSearchResults():(e.data.search=s.episodes,e.showSearchResults(s.episodes))},error:function(){e.flushSearchResults()}})}},{key:"fetchFromPosts",value:function(t){var e=this,s="pp-podcast-".concat(this.instance),i=this.data[s].load_info,a=this.data.ajax_info,n={action:"pp_search_posts",security:a.security,offset:i.displayed,args:i.args,instance:"s",search:t};jQuery.ajax({url:a.ajaxurl,data:n,type:"POST",timeout:4e3,success:function(t){var s=jQuery.parseJSON(t);jQuery.isEmptyObject(s)?e.flushSearchResults():(e.data.search=s.episodes,e.showSearchResults(s.episodes))},error:function(){e.flushSearchResults()}})}},{key:"clearSearch",value:function(){var t="pp-podcast-".concat(this.instance),e=this.data[t].load_info;this.searchBox.val(""),this.prevSearchTerm="",this.isSrchOpen=!1,this.podcast.removeClass("search-opened"),this.searchResults.removeClass("toggled-on"),this.searchClose.hide(),this.episodes.find(".episode-list__entry").show(),this.flushSearchResults(),e.displayed");l<=a;l++){var d=i[l],r=t[d],h=r.title,p=r.description,c=r.author,m=r.date,u=r.link,y=r.featured;y||(y=(y=s.args.imgurl)||"");var f=jQuery("",{href:u}).html(h),g=jQuery("",{class:"pod-entry__title"}).html(f),v=jQuery("",{class:"pod-entry__date"}).text(m),b=jQuery("",{class:"pod-entry__author"}).html(c),_=void 0;if(this.podcast.hasClass("postview")){var j=s.args.display,w=p?jQuery(p).text():"",C=jQuery("",{class:"pod-entry__play"}).html(this.settings.ppPlayCircle+this.settings.ppPauseBtn),O=void 0,M="";if(O=j&&this.isStyleSupport(j,"playbtn")?"":(O=y?jQuery("",{class:"pod-entry__image",src:y}):"")?''.concat(O[0].outerHTML,"
"):"",j&&this.isStyleSupport(j,"excerpt")){var k=w?w.split(" ").splice(0,n).join(" "):"",x=k?jQuery("",{class:"pod-entry__excerpt"}).text(k+"..."):"";M=x?x[0].outerHTML:""}_='\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t').concat(C[0].outerHTML,"\n\t\t\t\t\t\t").concat(O,'\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t').concat(g[0].outerHTML).concat(M).concat(v[0].outerHTML).concat(b[0].outerHTML,"\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t")}else _='\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t').concat(g[0].outerHTML).concat(v[0].outerHTML).concat(b[0].outerHTML,"\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t");o.append(jQuery(_)),this.searchResults.html(o.html()),this.hasLoading=!1}}}])&&m(e.prototype,s),a&&m(e,a),t}();function f(t,e){for(var s=0;s768?(e="wider-player wide-player",i.a[this.id].isWide=!0):this.width>600?(e="wide-player",i.a[this.id].isWide=!0):this.width>280&&(e="narrow-player"),t.addClass(e)}},{key:"managerHeader",value:function(){new n(this.id)}},{key:"mediaElements",value:function(){new o(this.id)}},{key:"entryEpisodes",value:function(){new h(this.id)}},{key:"loadMore",value:function(){i.a[this.id].loadMore=new c(this.id)}},{key:"searchEpisodes",value:function(){new y(this.id)}}])&&f(e.prototype,s),a&&f(e,a),t}();e.a=v},,,function(t,e,s){"use strict";s.r(e);var i,a,n,l,o,d=s(0),r=s(2),h=s(1);i=jQuery,a=i(".pp-podcast"),n=i(".pp-social-shared").first(),l=window.ppmejsSettings||{},o=l.isPremium?new h.a:"",a.each((function(){var t=i(this),e=t.attr("id"),s=new MediaElementPlayer(e+"-player",l),a=t.find(".pod-content__list"),n=t.find(".pod-content__episode"),h=a.find(".episode-list__wrapper"),p=n.find(".episode-single__wrapper"),c=t.find(".pp-podcast__single"),m=t.find(".pp-podcast__player"),u=t.find(".pp-player__amsg"),y=!1;u.length&&(y=new MediaElementPlayer(e+"-amsg-player",l)),d.a[e]={podcast:t,mediaObj:s,settings:l,list:a,episode:n,msgMediaObj:y,amsg:u,episodes:h,single:p,player:m,modal:o,singleWrap:c,instance:e.replace("pp-podcast-","")},new r.a(e)})),n.length&&i("html, body").animate({scrollTop:n.offset().top-200},400)}]);