!function(){"use strict";var t="2.1.5";const e=(t,e,i)=>e?i&&e[i]&&e[i].length?"file"===i?t.getAbsolutePath(e[i]):e[i]:e.file?e.file:e.sources?((t,e)=>{const i=[];for(let t=e.length-1;t--;)e[t].file&&i.push(e[t].file);return i.sort(),t.getAbsolutePath(i[0])})(t,e.sources):"":"",i={universalga:"ga",trackerName:"",label:"file",trackingobject:"_gaq",gtag:"gtag"};class s{constructor(t,s){if(this.player=t,this.utils=t.utils,this._=t._,this._config=this._.extend({},i,s),this.onGaTrack=s.debug&&this._.isFunction(s.onGaTrack)?s.onGaTrack:this.utils.noop,this._universalWrapper=void 0,this._currItem=void 0,this._state=void 0,this._casting=!1,("string"!=typeof this._config.gtag||void 0===window[this._config.gtag])&&"function"!=typeof this._config.gtag){const t=this._getTrackingObject();if(!t||"string"==typeof t)return void this.utils.log("Could not find Google Analytics Interface.",this._config)}this.player.on("playlistItem",(t=>{const i=t.item;this._currItem=this._.extend({played:!1},i),this._currItem.label=e(this.utils,i,this._config.label)})),this.player.on("play",(t=>{this._currItem.played?"paused"===this._state&&this.trackEventNew("Resume","interaction"!==t.playReason):(this._currItem.played=!0,this.trackEventNew("Play","interaction"!==t.playReason)),this._state="playing"})),this.player.on("buffer",(()=>{this.trackEventNew("Buffer",!0),this._state="buffering"})),this.player.on("pause",(t=>{this.trackEventNew("Pause","interaction"!==t.pauseReason),this._state="paused"})),this.player.on("seek",(()=>{this.trackEventNew("Seek",!0)})),this.player.on("complete",(()=>{this.trackEventNew("Complete",!0)})),this.player.on("cast",(t=>{this._casting=Boolean(t.active)}))}_getTrackingObject(){return window[this._config.universalga]?(this._universalWrapper||(this._universalWrapper={push:t=>{const e=window[this._config.universalga],i=this._config.trackerName?`${this._config.trackerName}.send`:"send";t.splice(0,1,i,"event"),t[5]={nonInteraction:t[6]},t.length=6,e.apply(window,t)}}),this._universalWrapper):"string"==typeof this._config.trackingobject?window[this._config.trackingobject]:this._config.trackingobject}trackAsync(t,e,i,s){this._getTrackingObject().push(["_trackEvent",t,e,i,void 0,s])}trackSync(t,e,i,s){this._getTrackingObject()._trackEvent(t,e,i,void 0,s)}trackGtag(t,e,i,s,n){t("event",i,{event_category:e,event_label:s,event_action:i,non_interaction:n})}trackEventNew(t,e){let i="";const s="function"==typeof this._config.gtag?this._config.gtag:window[this._config.gtag];this._casting||(s?(i="gtag",this.trackGtag(s,"JW Player Video",t,this._currItem.label,e)):void 0!==this._getTrackingObject()._trackEvent?(i="sync",this.trackSync("JW Player Video",t,this._currItem.label,e)):void 0!==this._getTrackingObject().push&&(i="async",this.trackAsync("JW Player Video",t,this._currItem.label,e)),this.onGaTrack({type:i,category:"JW Player Video",action:t,label:this._currItem.label,nonInteraction:e}))}}s.version=t;const n={label:"file",gtag:"gtag"};class r{constructor(t,i){this.player=t,this.utils=t.utils,this.config=Object.assign({},n,i),this.sendEnhancedEvents=Boolean(this.config.sendEnhancedEvents),this.currItem=null,window[this.config.gtag]?(this.player.on("playlistItem",(t=>{var i,s;this.currItem=t.item,this.currItem.label=e(this.utils,this.currItem,null==(i=this.config)?void 0:i.label),this.resetProgressTracker(null==(s=this.currItem)?void 0:s.duration)})),this.player.on("meta",(t=>{this.currItem.progressTracker||this.resetProgressTracker(null==t?void 0:t.duration)})),this.sendEnhancedEvents&&(this.player.on("firstFrame",(()=>{this.sendCustomEvent("video_start")})),this.player.on("time",(t=>{var e;const i=Math.floor(t.currentTime/t.duration*100);!1===(null==(e=this.currItem)?void 0:e.progressTracker[i])&&(this.sendCustomEvent("video_percentage",i),this.currItem.progressTracker[i]=!0)}))),this.player.on("play",(t=>{this.currItem.played?"paused"===t.oldstate&&this.sendCustomEvent(this.sendEnhancedEvents?"video_resume":"Resume"):(this.currItem.played=!0,this.sendCustomEvent(this.sendEnhancedEvents?"video_play":"Play"))})),this.player.on("buffer",(()=>{this.sendCustomEvent(this.sendEnhancedEvents?"video_buffer":"Buffer")})),this.player.on("pause",(()=>{this.sendCustomEvent(this.sendEnhancedEvents?"video_pause":"Pause")})),this.player.on("seek",(()=>{this.sendCustomEvent(this.sendEnhancedEvents?"video_seek":"Seek")})),this.player.on("complete",(()=>{this.sendCustomEvent(this.sendEnhancedEvents?"video_complete":"Complete")})),this.player.on("cast",(t=>{this.casting=Boolean(t.active)}))):this.utils.log("Could not find Google Analytics Interface.",this.config)}sendCustomEvent(t,e=0){if(this.casting||!window[this.config.gtag])return;const i=this.player.getPosition(),s=this.player.getViewable(),n={event_label:this.currItem.label||"",video_current_time:i>=0?i:null,video_duration:this.currItem.duration||null,video_percent:"complete"===t?100:e,video_provider:"JW Player",video_title:this.currItem.title||null,video_url:this.currItem.file||null,visible:s?"true":"false"};window[this.config.gtag]("event",t,n)}resetProgressTracker(t){t&&(this.currItem.progressTracker={10:!1,25:!1,50:!1,75:!1})}}var a,o,c;r.version=t;const l=window.jwplayerPluginJsonp||window.jwplayer().registerPlugin;let h=!1;!0===(null==(a=window.jwplayer().getConfig())||null==(o=a.setupConfig)||null==(c=o.ga)?void 0:c.useUniversalAnalytics)&&(h=!0),l("gapro","8.0.0",h?s:r)}();