(window.webpackJsonp=window.webpackJsonp||[]).push([[343],{1655:function(e,t,n){var content=n(2317);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[e.i,content,""]]),content.locals&&(e.exports=content.locals);(0,n(252).default)("7f81cb42",content,!0,{sourceMap:!1})},2316:function(e,t,n){"use strict";n(1655)},2317:function(e,t,n){var o=n(251)((function(i){return i[1]}));o.push([e.i,".c-shortcodeYoutubeVideo{height:0;margin-bottom:2rem;overflow:hidden;padding-bottom:56.25%;position:relative;text-align:center;width:100%}.c-shortcodeYoutubeVideo iframe{height:100%;left:0;position:absolute;top:0;width:100%}",""]),o.locals={},e.exports=o},2955:function(e,t,n){"use strict";n.r(t);var o=n(6),l=(n(29),n(13)),r=n(7),d=(n(22),n(224),n(21),n(26),n(87));function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function v(e){for(var t=1;t{var v;if(0==document.querySelectorAll('script[src="https://www.youtube.com/iframe_api"]').length){var y=document.createElement("script");y.src="https://www.youtube.com/iframe_api";var h=document.getElementsByTagName("script")[0];h.parentNode.insertBefore(y,h)}void 0!==(null===(v=window.YT)||void 0===v?void 0:v.Player)?d(I(e,t,n,o,l,r)):(window.addEventListener("youtube_ready",(function(){d(I(e,t,n,o,l,r))})),window.onYouTubeIframeAPIReady=function(){window.YT.ready((()=>{m=!0;var e=new Event("youtube_ready");window.dispatchEvent(e)}))}),setTimeout((()=>{m||(m=!0,c(new Error("Iframe is not ready")))}),1e4)}))}(e,t,n,o,l,r);return d}));return function(t,n,o,l,r,d){return e.apply(this,arguments)}}(),w=e=>{var t,n,o,l,r,d,c,v,m,h,f,w,E,I,_,O,T,P=null!=e&&e.getPlaylistId()?null==e?void 0:e.getPlaylistId():null==e||null===(t=e.getVideoData())||void 0===t?void 0:t.video_id;return{count:null==e||null===(n=e.g)||void 0===n?void 0:n.getAttribute("data-count"),module:"Video",module_id:null==e||null===(o=e.playerInfo)||void 0===o||null===(o=o.videoData)||void 0===o?void 0:o.video_id,element_label:null==e||null===(l=e.playerInfo)||void 0===l||null===(l=l.videoData)||void 0===l?void 0:l.title,sequence_type:null!=e&&null!==(r=e.playerInfo)&&void 0!==r&&r.playlistId?"playlist":"single",module_owner:"YouTube",total_duration_seconds:Math.round(null==e||null===(d=e.playerInfo)||void 0===d?void 0:d.duration),playhead_position:Math.round(null==e||null===(c=e.playerInfo)||void 0===c?void 0:c.currentTime),volume:null!=e&&e.isMuted()?0:null==e||null===(v=e.playerInfo)||void 0===v?void 0:v.volume,ad_enabled:!(null===(m=y[P])||void 0===m||!m.adsEnabled||null!==(h=y[P])&&void 0!==h&&h.autostart),location:null!==(f=y[P])&&void 0!==f&&null!==(f=f.placement)&&void 0!==f&&f.location?null===(w=y[P])||void 0===w||null===(w=w.placement)||void 0===w?void 0:w.location:"UNKNOWN",type:null!==(E=y[P])&&void 0!==E&&null!==(E=E.placement)&&void 0!==E&&E.articlePlacement?null===(I=y[P])||void 0===I||null===(I=I.placement)||void 0===I?void 0:I.articlePlacement:"",autoplay:null===(_=y[P])||void 0===_?void 0:_.autostart,view_correlation_id:null==e||null===(O=e.g)||void 0===O?void 0:O.getAttribute("data-view-correlation-id"),is_contextual:"Embedded",livestream:null==e||null===(T=e.playerInfo)||void 0===T||null===(T=T.videoData)||void 0===T?void 0:T.isLive}},E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return"video_interrupted"===e&&t?{error_message:t}:"video_pause"===e?{pause_type:"Manual"}:{}};function I(e,t,n,o,l,r){return null==y[e]&&(y[e]={target:null,lastEvent:{},timeWatched:0,eventTypes:n,interval:null,percentWatched:0,lastVol:0,muted:!1,inView:!1,autostart:l,isFullscreen:!1,placement:o,adsEnabled:r}),t?new YT.Player("iframe-".concat(e),{playerVars:{listType:"playlist",list:e,rel:0},host:"https://www.youtube.com",events:{onReady:_,onStateChange:T,onError:O}}):new YT.Player("iframe-".concat(e),{videoId:e,playerVars:{modestbranding:1,rel:0},host:"https://www.youtube.com",events:{onReady:_,onStateChange:T,onError:O}}),["","webkit","moz","ms"].forEach((t=>document.addEventListener(t+"fullscreenchange",(function(){null===document.fullscreenElement?y[e].isFullscreen=!1:document.fullscreenElement.id.includes(e)&&(y[e].isFullscreen=!y[e].isFullscreen)}),!1))),window.onscroll=function(){for(var e in y)if(y[e].target){var t=document.getElementById("iframe-".concat(e)),n=t.getBoundingClientRect();n.top-n.height<=0&&n.top+n.height>0&&!1===y[e].inView?(y[e].inView=!0,t.dispatchEvent(new CustomEvent("stateChange-".concat(e),{detail:{payload:{"@event":"video_player_inview",videoContext:w(y[e].target)}}}))):(n.top+n.height<=0||n.top-n.height>0)&&!0===y[e].inView&&(y[e].inView=!1)}},document.getElementById("iframe-".concat(e))}function _(e){var t,n,o,l=null!==(t=e.target)&&void 0!==t&&t.getPlaylistId()?null===(n=e.target)||void 0===n?void 0:n.getPlaylistId():null===(o=e.target)||void 0===o||null===(o=o.getVideoData())||void 0===o?void 0:o.video_id,r=document.getElementById("iframe-".concat(l));y[l].target=e.target,h=Object(d.v4)(),r.setAttribute("data-view-correlation-id",h),y[l].autostart&&e.target.playVideo(),null==r||r.dispatchEvent(new CustomEvent("stateChange-".concat(l),{detail:{payload:{"@event":"video_load",videoContext:w(e.target)}}}))}function O(e){var t,n,o,l,r=null!==(t=e.target)&&void 0!==t&&t.getPlaylistId()?null===(n=e.target)||void 0===n?void 0:n.getPlaylistId():null===(o=e.target)||void 0===o||null===(o=o.getVideoData())||void 0===o?void 0:o.video_id,d=null===(l=document)||void 0===l?void 0:l.getElementById("iframe-".concat(r)),c="";switch(e.data){case 2:c="The API request contains an invalid parameter value.";break;case 5:c="The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.";break;case 100:c="The video requested was not found. This error occurs when a video has been removed or has been marked as private.";break;case 101:case 105:c="The owner of the requested video does not allow it to be played in embedded players.";break;default:c="Unknown error"}null==d||d.dispatchEvent(new CustomEvent("stateChange-".concat(r),{detail:{payload:{"@event":"video_interrupted",videoContext:w(e.target),additionalContext:E("video_interrupted",c)}}}))}function T(e){null===(t=e.target.playerInfo)||void 0===t||t.currentTime;var t,n,o,l,r,d,c,m=null!==(n=e.target)&&void 0!==n&&n.getPlaylistId()?null===(o=e.target)||void 0===o?void 0:o.getPlaylistId():null===(l=e.target)||void 0===l||null===(l=l.getVideoData())||void 0===l?void 0:l.video_id,h=document.getElementById("iframe-".concat(m)),f=y[m].eventTypes,I=y[m].lastEvent;if(1!==e.data&&null!==y[m].interval&&clearInterval(y[m].interval),0===e.data&&f.includes("completed"))r="videoCompleted",d="video_complete";else if(1===e.data){var _,O;if(y[m].lastVol=null===(_=e.target.playerInfo)||void 0===_?void 0:_.volume,y[m].muted=e.target.isMuted(),y[m].interval=setInterval((function(){!function(e,t){var n,o=document.getElementById("iframe-".concat(t));if(y[t].eventTypes.includes("watched")){var l,r;y[t].timeWatched+=1;var d=null===(l=e.target.playerInfo)||void 0===l?void 0:l.duration,c=null===(r=e.target.playerInfo)||void 0===r?void 0:r.currentTime;c>=d-3&&y[t].percentWatched<100?(o.dispatchEvent(new CustomEvent("stateChange-".concat(t),{detail:{payload:{"@event":"video_watched",videoContext:v(v({},w(e.target)),{},{percent:100})}}})),y[t].percentWatched=100):c>=d*(3/4)&&y[t].percentWatched<75?(o.dispatchEvent(new CustomEvent("stateChange-".concat(t),{detail:{payload:{"@event":"video_watched",videoContext:v(v({},w(e.target)),{},{percent:75})}}})),y[t].percentWatched=75):c>=d/2&&y[t].percentWatched<50?(o.dispatchEvent(new CustomEvent("stateChange-".concat(t),{detail:{payload:{"@event":"video_watched",videoContext:v(v({},w(e.target)),{},{percent:50})}}})),y[t].percentWatched=50):c>=d/4&&y[t].percentWatched<25&&(o.dispatchEvent(new CustomEvent("stateChange-".concat(t),{detail:{payload:{"@event":"video_watched",videoContext:v(v({},w(e.target)),{},{percent:25})}}})),y[t].percentWatched=25)}if(y[t].eventTypes.includes("volume")&&(y[t].muted!==e.target.isMuted()||y[t].lastVol!==(null===(n=e.target.playerInfo)||void 0===n?void 0:n.volume))){var m;y[t].lastVol=null===(m=e.target.playerInfo)||void 0===m?void 0:m.volume,y[t].muted=e.target.isMuted()}}(e,m)}),1e3),"videoSeekStarted"===I.type||(null===(O=e.target.playerInfo)||void 0===O?void 0:O.currentTime)-I.videoTime>1&&f.includes("seek"))y[m].timeWatched-I.videoTime>0&&(y[m].timeWatched=y[m].timeWatched-(y[m].timeWatched-I.videoTime)),r="videoSeekCompleted";else if(f.includes("playing")&&"videoInterrupted"!==y[m].lastEvent.type){var T;if("notStarted"===y[m].lastEvent.type?(r="videoStarted",d="video_start"):(r="videoPlayed",d="video_play"),0===Math.floor(null===(T=e.target.playerInfo)||void 0===T?void 0:T.currentTime)){var P=h.getAttribute("data-count");h.setAttribute("data-count",null!==P?parseInt(P)+1:0)}}}else if(2===e.data){var C;0!=I.eventTime&&Math.abs(.001*(Date.now()-I.eventTime)-((null===(C=e.target.playerInfo)||void 0===C?void 0:C.currentTime)-I.videoTime))<2&&f.includes("paused")?(r="videoPaused",d="video_pause"):f.includes("seek")&&(r="videoSeekStarted")}else if(3===e.data)"notStarted"!==I.type&&"videoSeekStarted"!==I.type&&(r="videoInterrupted");else if(-1===e.data){var S;y[m].lastEvent={type:"notStarted",eventTime:Date.now(),videoTime:null===(S=e.target.playerInfo)||void 0===S?void 0:S.currentTime}}void 0!==r&&(y[m].lastEvent={type:r,eventTime:Date.now(),videoTime:null===(c=e.target.playerInfo)||void 0===c?void 0:c.currentTime},d&&h.dispatchEvent(new CustomEvent("stateChange-".concat(m),{detail:{payload:{"@event":d,videoContext:w(e.target),additionalContext:E(d)}}})),"video_complete"===d&&(y[m].timeWatched=0,y[m].interval=null,y[m].percentWatched=0,y[m].lastEvent={}))}var P={createVideoPlayer:f};function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function S(e){for(var t=1;t({pattern:/^https?:\/\/(?:www.)?youtu(?:\.be\/|be\.com\/(?:embed\/|live\/|shorts\/|watch\?v=|watch\?.+?&v=|v\/|playlist\?list=))([^(?|&|$|#|\n)]+)/,player:null}),computed:{youtubeTitle(){try{var e=this.oembed?JSON.parse(this.oembed):null;return(null==e?void 0:e.title)||""}catch(e){return""}},iframeLabelId(){var e=this.pattern.exec(this.url),t=(null==e?void 0:e.length)>1?e[1]:"";return"iframe-".concat(t)},videoId(){return this.url?this.pattern.exec(this.url)[1]:""}},beforeMount(){this.$store.dispatch("tracking/setPageComponents",{vo02:!0})},mounted(){this.player=P.createVideoPlayer(this.videoId,!1,["loaded","started","playing","paused","completed","watched","viewed","seek"],{articlePlacement:"Youtube Embed",location:"CONTENTBLOCK"},!1,!1),this.player.then((e=>{null==e||e.addEventListener("stateChange-".concat(this.videoId),(e=>{if(e.detail.payload["@event"]){var t,n,o=S(S({"@event":e.detail.payload["@event"]},null==e||null===(t=e.detail)||void 0===t||null===(t=t.payload)||void 0===t?void 0:t.videoContext),null==e||null===(n=e.detail)||void 0===n||null===(n=n.payload)||void 0===n?void 0:n.additionalContext);this.$tracking.trackPageEvent(o,["googleAnalytics"])}}))})),this.$store.commit("reviews/setHasVideo",this.iframeLabelId)},methods:{}}),V=(n(2316),n(152)),component=Object(V.a)(j,(function(){var e=this,t=e._self._c;e._self._setupProxy;return e.$services.isFeatureEnabled("youtube")?t("div",{staticClass:"c-shortcodeYoutubeVideo"},[t("div",{attrs:{id:e.iframeLabelId,title:e.youtubeTitle}})]):e._e()}),[],!1,null,null,null);t.default=component.exports}}]);