1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[51],{81051:function(n){window,n.exports=function(n){var i={};function a(s){if(i[s])return i[s].exports;var l=i[s]={i:s,l:!1,exports:{}};return n[s].call(l.exports,l,l.exports,a),l.l=!0,l.exports}return a.m=n,a.c=i,a.d=function(n,i,s){a.o(n,i)||Object.defineProperty(n,i,{enumerable:!0,get:s})},a.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},a.t=function(n,i){if(1&i&&(n=a(n)),8&i||4&i&&"object"==typeof n&&n&&n.__esModule)return n;var s=Object.create(null);if(a.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:n}),2&i&&"string"!=typeof n)for(var l in n)a.d(s,l,(function(i){return n[i]}).bind(null,l));return s},a.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return a.d(i,"a",i),i},a.o=function(n,i){return Object.prototype.hasOwnProperty.call(n,i)},a.p="",a(a.s=2)}([function(n,i,s){"use strict";s.r(i);var l="function"==typeof fetch?fetch.bind():function(n,i){return i=i||{},new Promise(function(s,l){var u=new XMLHttpRequest;for(var c in u.open(i.method||"get",n,!0),i.headers)u.setRequestHeader(c,i.headers[c]);u.withCredentials="include"==i.credentials,u.onload=function(){s(function o(){var n,i=[],s=[],l={};return u.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(u,c,d){i.push(c=c.toLowerCase()),s.push([c,d]),n=l[c],l[c]=n?n+","+d:d}),{ok:2==(u.status/100|0),status:u.status,statusText:u.statusText,url:u.responseURL,clone:o,text:function(){return Promise.resolve(u.responseText)},json:function(){return Promise.resolve(u.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([u.response]))},headers:{keys:function(){return i},entries:function(){return s},get:function(n){return l[n.toLowerCase()]},has:function(n){return n.toLowerCase() in l}}}}())},u.onerror=l,u.send(i.body)})};i.default=l},function(n,i,s){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var l=function(){function e(n,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(n,l.key,l)}}return function(n,i,s){return i&&e(n.prototype,i),s&&e(n,s),n}}(),u=function(){function e(n,i){(function(n,i){if(!(n instanceof i))throw TypeError("Cannot call a class as a function")})(this,e),this.pluginName=n}return l(e,[{key:"track",value:function(n,i){window.analytics.track(n,i,{integration:{name:this.pluginName}})}}]),e}();i.default=u},function(n,i,s){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.YouTubeAnalytics=i.VimeoAnalytics=void 0;var l=r(s(3)),u=r(s(4));function r(n){return n&&n.__esModule?n:{default:n}}i.VimeoAnalytics=l.default,i.YouTubeAnalytics=u.default},function(n,i,s){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var l=function(){function e(n,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(n,l.key,l)}}return function(n,i,s){return i&&e(n.prototype,i),s&&e(n,s),n}}(),u=r(s(0));function r(n){return n&&n.__esModule?n:{default:n}}var c=function(n){function t(n,i){!function(n,i){if(!(n instanceof i))throw TypeError("Cannot call a class as a function")}(this,t);var s=function(n,i){if(!n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return i&&("object"==typeof i||"function"==typeof i)?i:n}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"VimeoAnalytics"));return s.authToken=i,s.player=n,s.metadata={content:{},playback:{videoPlayer:"Vimeo"}},s.mostRecentHeartbeat=0,s.isPaused=!1,s}return function(n,i){if("function"!=typeof i&&null!==i)throw TypeError("Super expression must either be null or a function, not "+typeof i);n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),i&&(Object.setPrototypeOf?Object.setPrototypeOf(n,i):n.__proto__=i)}(t,n),l(t,[{key:"initialize",value:function(){var n=this,i={loaded:this.retrieveMetadata,play:this.trackPlay,pause:this.trackPause,ended:this.trackEnded,timeupdate:this.trackHeartbeat};for(var s in i)this.registerHandler(s,i[s]);this.player.getVideoId().then(function(i){n.retrieveMetadata({id:i})}).catch(console.error)}},{key:"registerHandler",value:function(n,i){var s=this;this.player.on(n,function(n){s.updateMetadata(n),i.call(s,n)})}},{key:"trackPlay",value:function(){this.isPaused?(this.track("Video Playback Resumed",this.metadata.playback),this.isPaused=!1):(this.track("Video Playback Started",this.metadata.playback),this.track("Video Content Started",this.metadata.content))}},{key:"trackEnded",value:function(){this.track("Video Playback Completed",this.metadata.playback),this.track("Video Content Completed",this.metadata.content)}},{key:"trackHeartbeat",value:function(){var n=this.mostRecentHeartbeat,i=this.metadata.playback.position;i!==n&&i-n>=10&&(this.track("Video Content Playing",this.metadata.content),this.mostRecentHeartbeat=Math.floor(i))}},{key:"trackPause",value:function(){this.isPaused=!0,this.track("Video Playback Paused",this.metadata.playback)}},{key:"retrieveMetadata",value:function(n){var i=this;return new Promise(function(s,l){var c=n.id;(0,u.default)("https://api.vimeo.com/videos/"+c,{headers:{Authorization:"Bearer "+i.authToken}}).then(function(n){return n.ok?n.json():l(n)}).then(function(n){i.metadata.content.title=n.name,i.metadata.content.description=n.description,i.metadata.content.publisher=n.user.n
1ame,i.metadata.playback.position=0,i.metadata.playback.totalLength=n.duration}).catch(function(n){return console.error("Request to Vimeo API Failed with: ",n),l(n)})})}},{key:"updateMetadata",value:function(n){var i=this;return new Promise(function(s,l){i.player.getVolume().then(function(l){l&&(i.metadata.playback.sound=100*l),i.metadata.playback.position=n.seconds,s()}).catch(l)})}}]),t}(r(s(1)).default);i.default=c},function(n,i,s){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var l=function(){function e(n,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(n,l.key,l)}}return function(n,i,s){return i&&e(n.prototype,i),s&&e(n,s),n}}(),u=o(s(0));function o(n){return n&&n.__esModule?n:{default:n}}var c=function(n){function t(n,i){!function(n,i){if(!(n instanceof i))throw TypeError("Cannot call a class as a function")}(this,t);var s=function(n,i){if(!n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return i&&("object"==typeof i||"function"==typeof i)?i:n}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"YoutubeAnalytics"));return s.player=n,s.apiKey=i,s.playerLoaded=!1,s.playbackStarted=!1,s.contentStarted=!1,s.isPaused=!1,s.isBuffering=!1,s.isSeeking=!1,s.lastRecordedTime={timeReported:Date.now(),timeElapsed:0},s.metadata=[{playback:{video_player:"youtube"},content:{}}],s.playlistIndex=0,s}return function(n,i){if("function"!=typeof i&&null!==i)throw TypeError("Super expression must either be null or a function, not "+typeof i);n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),i&&(Object.setPrototypeOf?Object.setPrototypeOf(n,i):n.__proto__=i)}(t,n),l(t,[{key:"initialize",value:function(){window.segmentYoutubeOnStateChange=this.onPlayerStateChange.bind(this),window.segmentYoutubeOnReady=this.onPlayerReady.bind(this),this.player.addEventListener("onReady","segmentYoutubeOnReady"),this.player.addEventListener("onStateChange","segmentYoutubeOnStateChange")}},{key:"onPlayerReady",value:function(n){this.retrieveMetadata()}},{key:"onPlayerStateChange",value:function(n){var i=this.player.getCurrentTime();switch(this.metadata[this.playlistIndex]&&(this.metadata[this.playlistIndex].playback.position=this.metadata[this.playlistIndex].content.position=i,this.metadata[this.playlistIndex].playback.quality=this.player.getPlaybackQuality(),this.metadata[this.playlistIndex].playback.sound=this.player.isMuted()?0:this.player.getVolume()),n.data){case -1:if(this.playerLoaded)break;this.retrieveMetadata(),this.playerLoaded=!0;break;case YT.PlayerState.BUFFERING:this.handleBuffer();break;case YT.PlayerState.PLAYING:this.handlePlay();break;case YT.PlayerState.PAUSED:this.handlePause();break;case YT.PlayerState.ENDED:this.handleEnd()}this.lastRecordedTime={timeReported:Date.now(),timeElapsed:1e3*this.player.getCurrentTime()}}},{key:"retrieveMetadata",value:function(){var n=this;return new Promise(function(i,s){var l=n.player.getVideoData(),c=n.player.getPlaylist()||[l.video_id],d=c.join();(0,u.default)("https://www.googleapis.com/youtube/v3/videos?id="+d+"&part=snippet,contentDetails&key="+n.apiKey).then(function(n){if(!n.ok){var i=Error("Segment request to Youtube API failed (likely due to a bad API Key. Events will still be sent but will not contain video metadata)");throw i.response=n,i}return n.json()}).then(function(s){n.metadata=[];for(var l=0,u=0;u<c.length;u++){var d=s.items[u];n.metadata.push({content:{title:d.snippet.title,description:d.snippet.description,keywords:d.snippet.tags,channel:d.snippet.channelTitle,airdate:d.snippet.publishedAt}}),l+=function(n){var i=n.match(/PT(\d+H)?(\d+M)?(\d+S)?/);return 3600*(parseInt((i=i.slice(1).map(function(n){if(null!=n)return n.replace(/\D/,"")}))[0])||0)+60*(parseInt(i[1])||0)+(parseInt(i[2])||0)}(d.contentDetails.duration)}for(u=0;u<c.length;u++)n.metadata[u].playback={total_length:l,video_player:"youtube"};i()}).catch(function(i){n.metadata=c.map(function(n){return{playback:{video_player:"youtube"},content:{}}}),s(i)})})}},{key:"handleBuffer",value:function(){var n=this.determineSeek();this.playbackStarted||(this.playbackStarted=!0,this.track("Video Playback Started",this.metadata[this.playlistIndex].playback)),n&&!this.isSeeking&&(this.isSeeking=!0,this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback)),this.isSeeking&&(this.track("Video Playback Seek Completed",this.metadata[this.playlistIndex].playback),this.isSeeking=!1);var i=this.player.getPlaylist();i&&0===this.player.getCurrentTime()&&this.player.getPlaylistIndex()!==this.playlistIndex&&(this.contentStarted=!1,this.playlistIndex===i.length-1&&0===this.player.getPlaylistIndex()&&(this.track("Video Playback Completed",this.metadata[this.player.getPlaylistIndex()].playback),this.track("Video Playback Started",this.metadata[this.player.getPlaylistIndex()].playback))),this.track("Video Playback Buffer Started",this.metadata[this.playlistIndex].playback),this.isBuffering=!0}},{key:"handlePlay",value:function(){this.contentStarted||(this.playlistIndex=this.player.getPlaylistIndex(),-1===this.playlistIndex&&(this.playlistIndex=0),this.track("Video Content Started",this.metadata[this.playlistIndex].content),this.contentStarted=!0),this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused&&(this.track("Video Playback Resumed",this.metadata[this.playlistIndex].playback),this.isPaused=!1)}},{key:"handlePause",value:function(){var n=this.determineSeek();this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused||(n?(this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback),this.isSeeking=!0):(this.track("Video Playback Paused",this.metadata[this.playlistIndex].playback),this.isPaused=!0))}},{key:"handleEnd",value:function(){this.track("Video Content Completed",this.metadata[this.playlistIndex].content),this.contentStarted=!1;var n=this.player.getPlaylistIndex(),i=this.player.getPlaylist();(i&&n===i.length-1||-1===n)&&(this.track("Video Playback Completed",this.metadata[this.playlistIndex].playback),this.playbackStarted=!1)}},{key:"determineSeek",value:function(){return Math.abs((this.isPaused||this.isBuffering?0:Date.now()-this.lastRecordedTime.timeReported)-(1e3*this.player.getCurrentTime()-this.lastRecordedTime.timeElapsed))>2e3}}]),t}(o(s(1)).default);i.default=c}])}}]);
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.