;/*FB_PKG_DELIM*/ __d("TrustedTypesChromecastScriptURLPolicy",["TrustedTypes","err"],(function(t,n,r,o,a,i,l){"use strict";var e=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","hfaagokkkhdbgiakmmlclaapfelnkoah","fmfcbgogabcbclcofgocippekhfcmgfj","enhhojjnijigcajfphajepfemndkmdlo"];function s(t){var n=e.join("|"),r=new RegExp("^chrome-extension://(?:null|"+n+")/cast_sender\\.js$");return r.test(t)}var u={createScriptURL:function(t){if(s(t))return t;throw r("err")("Violated policy TrustedTypesChromecastScriptURLPolicy: "+t+" is not a Chromecast extension URI.")}},c=r("TrustedTypes").createPolicy("chromecast-extension-uri",u),d=c;l.default=d}),98); __d("ChromecastAPI",["Promise","TrustedTypesChromecastScriptURLPolicy","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","hfaagokkkhdbgiakmmlclaapfelnkoah","fmfcbgogabcbclcofgocippekhfcmgfj","enhhojjnijigcajfphajepfemndkmdlo"],u=null,c={},d=c;c.getSenderAPI=function(){return u||(t.chrome?t.chrome.cast&&t.chrome.cast.isAvailable?(u=(e||(e=n("Promise"))).resolve(t.chrome.cast),u):(u=(e||(e=n("Promise"))).resolve().then(function(){return m()}).then(function(o){return new(e||(e=n("Promise")))(function(e,n){t.chrome.cast=t.chrome.cast||{},t.chrome.cast.extensionId=o,t.__onGCastApiAvailable=function(r,o){o?n(o):e(t.chrome.cast)};var a=document.createElement("script");a.onerror=n,a.src=r("TrustedTypesChromecastScriptURLPolicy").createScriptURL(g(o)),(document.head||document.documentElement).appendChild(a)})}),u):(u=(e||(e=n("Promise"))).reject(new Error("Browser not supported")),u))};function m(){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){for(var e=0;e=0),e},i.startCasting=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){if(!this.isCasting(e)){var o=null;r("ChromecastConfig").VERSION_LAUNCH_MESSAGE&&n?o=yield this.sendVersionLaunch(e,t,n):o=yield this.sendLaunch(e);var a=o,i=a.target;this.$CastingExperienceManager$p_7=i}});function t(t,n,r){return e.apply(this,arguments)}return t})(),i.stopCasting=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(this.isCasting()){var e=yield this.getSession();yield e.disconnect()}this.$CastingExperienceManager$p_17()});function t(){return e.apply(this,arguments)}return t})(),i.$CastingExperienceManager$p_17=function(){this.$CastingExperienceManager$p_6=null,this.$CastingExperienceManager$p_7=null},i.getTarget=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!this.$CastingExperienceManager$p_7){yield this.getSession();var e=yield this.sendVersion(),t=e.currently_running_experience;if(!t)throw new Error("Session has no target");this.$CastingExperienceManager$p_7=t}return this.$CastingExperienceManager$p_7});function t(){return e.apply(this,arguments)}return t})(),i.setVolume=function(t){this.isCasting()&&this.$CastingExperienceManager$p_6&&this.$CastingExperienceManager$p_6.setVolume(t)},i.mute=function(){this.isCasting()&&this.$CastingExperienceManager$p_6&&this.$CastingExperienceManager$p_6.mute()},i.unmute=function(){this.isCasting()&&this.$CastingExperienceManager$p_6&&this.$CastingExperienceManager$p_6.unmute()},i.isFeedbackEnabled=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield this.getExperienceState(),t=e.feedback_disabled;return!!t});function t(){return e.apply(this,arguments)}return t})(),i.setFeedbackEnabled=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(this.isCasting()){var t=e?"turn_on_feedback":"turn_off_feedback";yield this.sendCommand(t)}});function t(t){return e.apply(this,arguments)}return t})(),i.sendMessage=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=yield this.getSession();r||s(0,4274);var o={target:e,type:t,data:n,num:this.$CastingExperienceManager$p_4+=2,timestamp:Date.now()};return yield r.sendMessage(o),{msgNum:o.num}});function t(t,n,r){return e.apply(this,arguments)}return t})(),i.receiveMessage=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var r=yield this.getSession();return r||s(0,4763),new(e||(e=n("Promise")))(function(e,n){var o=r.addListener("message",function(r){try{var a=JSON.parse(r),i=!t||t(a);i&&(o.remove(),e(a))}catch(e){o.remove(),n(e)}})})});function r(e){return t.apply(this,arguments)}return r})(),i.sendVersion=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=this.getSessionKey(),t=yield this.sendMessage("version","version_request",{version:a.VERSION,client_cast_session:e}),n=t.msgNum,r=yield this.receiveMessage(function(e){return e.response_num===n});return r.type==="version_response"||s(0,12335),r.data||s(0,4765),r.data});function t(){return e.apply(this,arguments)}return t})(),i.sendLaunch=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield this.sendMessage("experience","launch",{name:e}),n=t.msgNum,r=yield this.receiveMessage(function(e){return e.response_num===n});return r.type==="launch_response"||s(0,12333),r.data});function t(t){return e.apply(this,arguments)}return t})(),i.sendVersionLaunch=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=this.getSessionKey(),o=yield this.sendMessage("version_launch","version_launch",{version:a.VERSION,client_cast_session:r,name:e,params:t,payload:n}),i=o.msgNum,l=yield this.receiveMessage(function(e){return e.response_num===i});return l.type==="version_launch_response"||s(0,4767),l.data});function t(t,n,r){return e.apply(this,arguments)}return t})(),i.sendCommand=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=yield this.getTarget(),o=yield this.sendMessage(r,"experience_command",{cmd:e,params:t,payload:n}),i=o.msgNum,l=yield this.receiveMessage(function(e){return e.response_num===i});return l.type==="command_result"||s(0,12332),e==="stop_showing_photo"&&this.emit(a.STOP_VIEW),l.data});function t(t,n,r){return e.apply(this,arguments)}return t})(),i.getExperienceState=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=this,n=e||"",o=this.$CastingExperienceManager$p_10.get(n);if(!o){o=this.$CastingExperienceManager$p_18(e),this.$CastingExperienceManager$p_10.set(n,o);var a=function(){return t.$CastingExperienceManager$p_10.delete(n)};r("promiseDone")(o.then(a,a))}return o});function t(t){return e.apply(this,arguments)}return t})(),i.$CastingExperienceManager$p_18=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){e||(e=yield this.getTarget());var t=yield this.sendMessage(e,"get_experience_state",{}),n=t.msgNum,r=yield this.receiveMessage(function(e){return e.response_num===n});return r.type==="experience_state"||s(0,12334),r.data});function t(t){return e.apply(this,arguments)}return t})(),i.$CastingExperienceManager$p_11=function(t){var e=t.foundReceiver;this.emit(a.RECEIVER_STATUS_CHANGED,!!e)},i.$CastingExperienceManager$p_12=function(){this.$CastingExperienceManager$p_17(),this.emit(a.RECEIVER_DISCONNECTED)},i.$CastingExperienceManager$p_13=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=this;this.$CastingExperienceManager$p_6=e;var n="extension";this.$CastingExperienceManager$p_9&&(n="site");var r=yield this.sendVersion(),o=r.currently_running_experience,i=r.success;if(!i)throw new Error("Failed to sync versions with session");o&&(this.$CastingExperienceManager$p_7=o),this.emit(a.SESSION_STARTED,{session:e,source:n,success:i,target:this.$CastingExperienceManager$p_7}),e.addListener("message",function(e){try{var n=JSON.parse(e);t.$CastingExperienceManager$p_19(n)}catch(e){t.emit(a.ERROR,e)}})});function t(t){return e.apply(this,arguments)}return t})(),i.$CastingExperienceManager$p_14=function(){var e=this.$CastingExperienceManager$p_6;this.$CastingExperienceManager$p_17(),this.emit(a.SESSION_DISCONNECTED,e)},i.$CastingExperienceManager$p_19=function(t){this.emit(a.SESSION_MESSAGE,t),t.type==="experience_ended"&&(this.$CastingExperienceManager$p_7=null,this.emit(a.EXPERIENCE_ENDED))},i.$CastingExperienceManager$p_15=function(t){this.$CastingExperienceManager$p_3=t,this.emit(a.ERROR,t)},a})(r("EventEmitter"));m.VERSION="1.2.0",m.RECEIVER_STATUS_CHANGED="receiverstatuschanged",m.RECEIVER_DISCONNECTED="receiverdisconnected",m.SESSION_STARTED="sessionstarted",m.SESSION_MESSAGE="sessionmessage",m.SESSION_DISCONNECTED="sessiondisconnected",m.EXPERIENCE_ENDED="experienceended",m.ERROR="error",m.NOT_SUPPORTED="notsupported",m.READY="ready",m.STOP_VIEW="stopview",l.default=m}),98); __d("StreamingReactionsTrayEvents",[],(function(t,n,r,o,a,i){var e="streamingReactionsTray/AddReactionAnimate",l="streamingReactionsTray/HideChannelViewDetails",s="streamingReactionsTray/ShowChannelViewDetails",u="streamingReactionsTray/UpdateSurface",c="streamingReactionsTray/ResizeChannelViewWindow",d="streamingReactionsTray/ReactionStateChange",m="streamingReactionsTray/FireworksAnimating",p="streamingReactionsTray/DisableReactions",_="streamingReactionsTray/EnableReactions";i.AddReactionAnimate=e,i.HideChannelViewDetails=l,i.ShowChannelViewDetails=s,i.UpdateSurface=u,i.ResizeChannelViewWindow=c,i.ReactionStateChange=d,i.FireworksAnimating=m,i.DisableReactions=p,i.EnableReactions=_}),66); __d("VideoCastingComponent",["cx","Arbiter","AsyncRequest","CSS","CastingExperienceManager","ChromecastConfig","Promise","ScriptPath","StreamingReactionsTrayEvents","SubscriptionsHandler","ThisControllerNoLongerExists","asyncToGeneratorRuntime","collectDataAttributes","promiseDone"],(function(t,n,r,o,a,i,l,s){"use strict";var e,u=(function(){function t(e,t){var n=this,a;this.$1=r("ChromecastConfig").EXPERIENCE_NAME,this.$2=(a=r("CastingExperienceManager")).getInstance(),this.$3=e,this.$4=!1,this.$5=!1,this.$6=!1,this.$7=null,this.$9=null,this.$12=null,this.$8=t,this.$10=new(r("SubscriptionsHandler")),o("CSS").addClass(this.$3.getVideoNode(),"_1_d1"),e.registerOption("casting","isSupported",function(){return n.$2.hasSupport()}),e.registerOption("casting","hasFoundReceiver",function(){return n.$2.hasFoundReceiver()}),e.registerOption("casting","isCasting",function(){return n.$4},function(e){return r("promiseDone")(n.$13(e))}),e.registerOption("casting","isPlaying",function(){return n.$6},function(e){return r("promiseDone")(n.$14(e))}),e.registerOption("casting","lastError",function(){return n.$2.getLastError()}),this.$10.addSubscriptions(this.$2.addListener(a.RECEIVER_STATUS_CHANGED,function(e){return r("promiseDone")(n.$15(e))}),this.$2.addListener(a.RECEIVER_DISCONNECTED,function(){return r("promiseDone")(n.$16())}),this.$2.addListener(a.SESSION_DISCONNECTED,function(){return r("promiseDone")(n.$16())}),this.$2.addListener(a.EXPERIENCE_ENDED,function(){return r("promiseDone")(n.$16())}),this.$2.addListener(a.NOT_SUPPORTED,function(){return r("promiseDone")(n.$17())}),this.$2.addListener(a.READY,function(){return r("promiseDone")(n.$18())}),this.$2.addListener(a.SESSION_MESSAGE,function(e){return r("promiseDone")(n.$19(e))}),this.$2.addListener(a.ERROR,function(e){return r("promiseDone")(n.$20(e))}),this.$3.addListener("seekEnd",function(e){var t=e.position;n.$3.isLiveVideo()||r("promiseDone")(n.$21(t))}),this.$3.addListener("muteVideo",function(){r("promiseDone")(n.$22())}),this.$3.addListener("unmuteVideo",function(){r("promiseDone")(n.$23())}),this.$3.addListener("changeVolume",function(e){var t=e.volume;r("promiseDone")(n.$24(t))}),this.$3.addListener("stateChange",function(){n.$3.isState("destroyed")&&n.destroy(),n.$3.isState("playing")&&r("promiseDone")(n.$25())}),r("Arbiter").subscribe(o("StreamingReactionsTrayEvents").HideChannelViewDetails,function(){return r("promiseDone")(n.$26(!0))}),r("Arbiter").subscribe(o("StreamingReactionsTrayEvents").ShowChannelViewDetails,function(){return r("promiseDone")(n.$26(!1))}))}var a=t.prototype;return a.destroy=function(){this.$10.release()},a.$27=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return this.$7||(this.$7=this.$28()),yield this.$7});function t(){return e.apply(this,arguments)}return t})(),a.$28=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var t=o("ThisControllerNoLongerExists").__DEADURI__("o0vbvk3w9"),a=this.$29();return yield new(e||(e=n("Promise")))(function(e,n){new(r("AsyncRequest"))().setURI(t).setMethod("POST").setData(a).setErrorHandler(function(e){return n(new Error(e.errorDescription))}).setHandler(function(t){return e(t.getPayload())}).send()})});function a(){return t.apply(this,arguments)}return a})(),a.$29=function(){var e=babelHelpers.extends({},this.$8,{video_id:this.$3.getVideoID(),is_ad:this.$3.isAd(),script_path:o("ScriptPath").getScriptPath()}),t=this.$3.getVideoChannelID();t&&(e.video_channel_id=t);var n=this.$3.getPlayerOrigin();n&&(e.player_origin=n);var a=this.$3.getPlayerSuborigin();a&&(e.player_suborigin=a);var i=r("collectDataAttributes")(this.$3.getRootNode(),["ft"]);return i&&i.ft&&(e.tracking_codes=[JSON.stringify(i.ft)]),e},a.$13=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(this.$3.logEvent("chromecast_button_clicked"),e){this.$4=!0,this.$3.emit("casting/castingStateChange",this.$4),this.$3.isState("playing")&&this.$3.pause("user_initiated");try{yield this.$30()}catch(e){this.$4=!1,this.$3.emit("casting/castingStateChange",this.$4)}}else this.$4=!1,this.$3.emit("casting/castingStateChange",this.$4),yield this.$31()});function t(t){return e.apply(this,arguments)}return t})(),a.$30=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){this.$3.pause("user_initiated");var t=this.$3.getCurrentTimePosition();this.$12=t;var o=this.$27(),a=this.$2.isCasting(this.$1);if(!a)if(r("ChromecastConfig").VERSION_LAUNCH_MESSAGE){var i=yield(e||(e=n("Promise"))).all([o,this.$2.getSession()]),l=i[0];yield this.$32(!0),yield this.$2.startCasting(this.$1,{position:t},l)}else yield this.$2.startCasting(this.$1);yield this.$32(!0);var s=yield this.$2.getSession(),u=s.getVolume();if(!s.isMuted()&&u&&(this.$3.unmute(),this.$3.setVolume(u)),!(!a&&r("ChromecastConfig").VERSION_LAUNCH_MESSAGE)){var c=yield this.$33(),d=!!c.playing_video_id,m=this.$9&&c.playing_video_id===this.$9;if(!d||!m){var p=yield o;yield this.$34(p)}if(!d||m){var _=yield this.$35(t);this.$9=_.reference_id}else{this.$9=null,yield this.$36();var f=yield this.$37(t);this.$9=f.reference_id}}});function o(){return t.apply(this,arguments)}return o})(),a.$31=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){this.$6&&(yield this.$38(),this.$6=!1),yield this.$39()});function t(){return e.apply(this,arguments)}return t})(),a.$14=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){e?yield this.$35():yield this.$40(),this.$6=e,this.$3.emit("casting/playStateChange",this.$6)});function t(t){return e.apply(this,arguments)}return t})(),a.$32=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){o("CSS").conditionClass(this.$3.getVideoNode(),"_1_d3",e)});function t(t){return e.apply(this,arguments)}return t})(),a.$41=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){typeof e!="number"&&(e=this.$12),this.$3.seek(e)});function t(t){return e.apply(this,arguments)}return t})(),a.$26=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){yield this.$2.setFeedbackEnabled(!e),this.$5=e});function t(t){return e.apply(this,arguments)}return t})(),a.$39=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){this.$6&&(this.$6=!1,this.$3.emit("casting/playStateChange",this.$6)),this.$4&&(this.$4=!1,this.$3.emit("casting/castingStateChange",this.$4)),typeof this.$12=="number"&&(yield this.$41()),yield this.$32(!1)});function t(){return e.apply(this,arguments)}return t})(),a.$19=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){this.$4&&e.type==="status_update"&&(yield this.$42(e.data))});function t(t){return e.apply(this,arguments)}return t})(),a.$42=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(this.$9&&this.$9!==e.reference_id){yield this.$39();return}var t=e.state==="play";t!==this.$6&&(this.$6=t,this.$3.emit("casting/playStateChange",this.$6)),e.position>0&&(this.$12=e.position,this.$3.emit("casting/updateStatus",{position:e.position}))});function t(t){return e.apply(this,arguments)}return t})(),a.$21=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){this.$4&&(yield this.$37(e),this.$6||(yield this.$14(!0)))});function t(t){return e.apply(this,arguments)}return t})(),a.$24=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){this.$4&&this.$2.setVolume(e)});function t(t){return e.apply(this,arguments)}return t})(),a.$22=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){this.$4&&this.$2.mute()});function t(){return e.apply(this,arguments)}return t})(),a.$23=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){this.$4&&this.$2.unmute()});function t(){return e.apply(this,arguments)}return t})(),a.$15=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t;this.$3.logEvent("chromecast_availability_checked",(t={player:this.$3.getPlayerVersion(),cast_button_visible:e,connection:null,raw_client_time:Date.now()/1e3},t.chromecast_receiver_available=e,t)),this.$3.emit("casting/receiverStateChange",e)});function t(t){return e.apply(this,arguments)}return t})(),a.$16=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield this.$39()});function t(){return e.apply(this,arguments)}return t})(),a.$18=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){this.$3.emit("casting/supportStateChange")});function t(){return e.apply(this,arguments)}return t})(),a.$17=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){this.$3.logEvent("chromecast_not_supported"),this.$3.emit("casting/notSupported")});function t(){return e.apply(this,arguments)}return t})(),a.$25=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){this.$4&&(this.$3.pause("user_initiated"),this.$6?yield this.$40():yield this.$35())});function t(){return e.apply(this,arguments)}return t})(),a.$34=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return yield this.$2.sendCommand("next_video",{feedback_disabled:this.$5},e)});function t(t){return e.apply(this,arguments)}return t})(),a.$35=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return yield this.$2.sendCommand("play_video",{position:e})});function t(t){return e.apply(this,arguments)}return t})(),a.$40=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return yield this.$2.sendCommand("pause_video")});function t(){return e.apply(this,arguments)}return t})(),a.$37=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return yield this.$2.sendCommand("seek_video",{position:e})});function t(t){return e.apply(this,arguments)}return t})(),a.$36=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return yield this.$2.sendCommand("skip_video")});function t(){return e.apply(this,arguments)}return t})(),a.$38=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return yield this.$2.sendCommand("stop_video")});function t(){return e.apply(this,arguments)}return t})(),a.$33=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield this.$2.getExperienceState();return e.experience_specific_state});function t(){return e.apply(this,arguments)}return t})(),a.$20=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){this.$11=e,this.$3.emit("casting/error",e)});function t(t){return e.apply(this,arguments)}return t})(),t})();l.default=u}),98);