if (self.CavalryLogger) { CavalryLogger.start_js(["g6aG0"]); }

__d("SpatialReactionConsumptionTypedLogger",["Banzai","GeneratedLoggerUtils","nullthrows"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();function h(){this.clear()}h.prototype.log=function(){c("GeneratedLoggerUtils").log("logger:SpatialReactionConsumptionLoggerConfig",this.$SpatialReactionConsumptionTypedLogger1,c("Banzai").BASIC)};h.prototype.logVital=function(){c("GeneratedLoggerUtils").log("logger:SpatialReactionConsumptionLoggerConfig",this.$SpatialReactionConsumptionTypedLogger1,c("Banzai").VITAL)};h.prototype.clear=function(){this.$SpatialReactionConsumptionTypedLogger1={};return this};h.prototype.updateData=function(j){this.$SpatialReactionConsumptionTypedLogger1=babelHelpers["extends"]({},this.$SpatialReactionConsumptionTypedLogger1,j);return this};h.prototype.setCenterPitch=function(j){this.$SpatialReactionConsumptionTypedLogger1.center_pitch=j;return this};h.prototype.setCenterYaw=function(j){this.$SpatialReactionConsumptionTypedLogger1.center_yaw=j;return this};h.prototype.setDisplayState=function(j){this.$SpatialReactionConsumptionTypedLogger1.display_state=j;return this};h.prototype.setEvent=function(j){this.$SpatialReactionConsumptionTypedLogger1.event=j;return this};h.prototype.setFriendCount=function(j){this.$SpatialReactionConsumptionTypedLogger1.friend_count=j;return this};h.prototype.setHasNonFriend=function(j){this.$SpatialReactionConsumptionTypedLogger1.has_non_friend=j;return this};h.prototype.setMoveTowardsHint=function(j){this.$SpatialReactionConsumptionTypedLogger1.move_towards_hint=j;return this};h.prototype.setPitch=function(j){this.$SpatialReactionConsumptionTypedLogger1.pitch=j;return this};h.prototype.setReactionKey=function(j){this.$SpatialReactionConsumptionTypedLogger1.reaction_key=j;return this};h.prototype.setVideoTimestamp=function(j){this.$SpatialReactionConsumptionTypedLogger1.video_timestamp=j;return this};h.prototype.setYaw=function(j){this.$SpatialReactionConsumptionTypedLogger1.yaw=j;return this};var i={center_pitch:true,center_yaw:true,display_state:true,event:true,friend_count:true,has_non_friend:true,move_towards_hint:true,pitch:true,reaction_key:true,video_timestamp:true,yaw:true};f.exports=h}),null);
__d("SpatialReactionExperimentsStore",["SphericalVideoComponentConstants","SphericalVideoComponentDispatcher","FluxMapStore","immutable","idx"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();var h,i,j,k;h=babelHelpers.inherits(l,c("immutable").Record({viewportLimiting:""}));i=h&&h.prototype;function l(){h.apply(this,arguments)}j=babelHelpers.inherits(m,c("FluxMapStore"));k=j&&j.prototype;m.prototype.getInitialState=function(){return c("immutable").Map({})};m.prototype.reduce=function(n,o){var p=o.id;switch(o.type){case c("SphericalVideoComponentConstants").ACTIONS.REGISTER_EXPERIMENT_CONFIG:var q=o.config;n=n.set(p,new l(babelHelpers["extends"]({},q)));break;default:break}return n};m.prototype.shouldDisableReactions=function(n){var o,p=this.getState().get(n);return((o=p)!=null?o.viewportLimiting:o)==="none"};m.prototype.shouldDisableInitialViewportReactions=function(n){var o,p=this.getState().get(n);return((o=p)!=null?o.viewportLimiting:o)==="no_initial_viewport"};m.prototype.shouldOnlyShowHints=function(n){var o,p=this.getState().get(n);return((o=p)!=null?o.viewportLimiting:o)==="hint_only"};function m(){j.apply(this,arguments)}f.exports=new m(c("SphericalVideoComponentDispatcher"))}),null);
__d("SpatialReactionLoggingConstants",[],(function a(b,c,d,e,f,g){"use strict";var h={FUNNEL_ACTIONS:{CLICK_LIKE:"click_like",OPEN_REACTION_MENU:"open_reaction_menu",CLICK_REACTION:"click_reaction",CLOSE_REACTION_MENU:"close_reaction_menu",PICK_UP_REACTION:"pick_up_reaction",RELEASE_REACTION_ON_VIDEO:"relase_reactions_on_video",RELEASE_REACTION_SOMEWHERE_ELSE:"release_reaction_somewhere_else"},FUNNEL_NAME:"WWW_SPATIAL_REACTION_PRODUCTION_FUNNEL",PLAY_TAG:"video_is_playing",PAUSE_TAG:"video_is_paused",CONSUMPTION_DISPLAY_STATES:{DISPLAY:0,HINT:1,OUT_OF_VIEWPORT:2,DISABLED:3}};f.exports=h}),null);
__d("SpatialReaction",["FeedbackReactionType","immutable"],(function a(b,c,d,e,f,g){"use strict";var h,i,j=c("immutable").Record({animationRandomSeed:0,isFriend:false,profilePictureURI:null,reactionType:c("FeedbackReactionType").LIKE,positionIndex:-1});h=babelHelpers.inherits(k,j);i=h&&h.prototype;function k(){h.apply(this,arguments)}f.exports=k}),null);
__d("SpatialReactionAnimationConfig",["CubicBezier"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();var h=60,i=function i(o,p,q,r){return{solve:function s(t,u,v,w){var x=new(c("CubicBezier"))([o,p],[q,r]);return v*x.solve(t/w)+u}}},j={solve:function o(p,q,r,s){return p/s*r+q}},k=function k(o){return{solve:function p(q,r,s,t,u){if(q<u)return r;else return o.solve(q-u,r,s,t-u)}}},l=function l(o){return{solve:function p(q,r,s,t,u){if(q<t-u)return o.solve(q,r,s,t-u);else return r+s}}},m=function m(o){return{solve:function p(q,r,s,t,u,v){if(u+v>t)throw new Error("Delay exceeds total steps");if(q<u)return r;else if(q>=t-v)return r+s;else return o.solve(q-u,r,s,t-u-v)}}},n={CLICK:{NUM_POSITIONS:2,LEFT_RIGHT_MARGIN:{PERCENT:.1}},CURVES:{MOVE_TO_CENTER_SCALE:i(.25,0,.58,1.02),MOVE_TO_CENTER_PATH_X:i(.3,.3,.5,1),MOVE_TO_CENTER_PATH_Y:i(0,.75,.9,.8),LOOK_AT_CENTER_PATH_X:l(i(.2,.2,.3,1)),LOOK_AT_CENTER_PATH_Y:l(i(.2,.2,.6,1)),LOOK_AT_CENTER_SCALE_SELF:m(i(0,.7,.6,1)),LOOK_AT_CENTER_SCALE_NON_SELF:m(i(.9,0,.25,1)),LOOK_AT_CENTER_FACE_POSITION:j,LOOK_AT_CENTER_FACE_SCALE_X:j,FACE_FLIP:m(j),MOVE_BACK_TOWARD_CENTER_PATH_X:i(.4,0,0,.8),MOVE_BACK_TOWARD_CENTER_PATH_Y:i(.4,.6,0,1),MOVE_BACK_TOWARD_CENTER_SCALE:m(i(.9,0,.25,1)),MOVE_BACK_TOWARD_CENTER_FACE_SCALE_X:m(j)},DRAG:{THROTTLE_INTERVAL:{MS:200},THRESHOLD:{MS:200},FRICTION_COEFFICIENT:.15,ORIGINAL_SCALE_VALUE:"scale(0.8)",VELOCITY:{MAX:600},FACE:{OFFSET:{LOVE:{PX:15}},SCALE:{MIN:.85}}},DURATIONS:{SELF:{TOTAL:{SECONDS:2.15,FRAMES:2.15*h},MOVE_TO_CENTER:{SECONDS:.35,FRAMES:.35*h},LOOK_AT_CENTER:{SECONDS:.7,FRAMES:.7*h,MAX_RANDOM_DELAY_FRAMES:0*h,MIN_RANDOM_SCALE_DELAY_FRAMES:0*h,MAX_RANDOM_SCALE_DELAY_FRAMES:0*h},MOVE_BACK_TOWARD_CENTER:{SECONDS:1.1,FRAMES:1.1*h,MAX_RANDOM_SCALE_DELAY_FRAMES:.95*h},SCALE_DOWN:{SECONDS:.15,FRAMES:.15*h},SCALE_UP:{SECONDS:.15,FRAMES:.15*h},FACE_FLIP:{SECONDS:.15,FRAMES:.15*h},FACE_HANG:{SECONDS:.2,FRAMES:.2*h}},NON_SELF:{TOTAL:{SECONDS:2,FRAMES:2*h},MOVE_TO_CENTER:{SECONDS:0,FRAMES:0*h},LOOK_AT_CENTER:{SECONDS:1.5,FRAMES:1.5*h,MAX_RANDOM_DELAY_FRAMES:.8*h,MIN_RANDOM_SCALE_DELAY_FRAMES:.3*h,MAX_RANDOM_SCALE_DELAY_FRAMES:1.35*h},MOVE_BACK_TOWARD_CENTER:{SECONDS:.5,FRAMES:.5*h,MAX_RANDOM_SCALE_DELAY_FRAMES:.35*h},SCALE_DOWN:{SECONDS:.15,FRAMES:.15*h},SCALE_UP:{SECONDS:.15,FRAMES:.15*h},FACE_FLIP:{SECONDS:.15,FRAMES:.15*h},FACE_HANG:{SECONDS:.2,FRAMES:.2*h}}},SHADOW:{COLOR:"rgba(0, 0, 0, 0.4)",BLUR:70,OFFSET_X:6,OFFSET_Y:6},SIZES:{BASE:{PX:38},PROFILE:{PX:34},FACE:{PX:38}},OPACITY:{MAX:1,MIN:0},SCALES:{COIN_FLIP_MORPH_START:.7,MOVE_TO_CENTER:{MIN:.6,MAX:1},LOOK_AT_CENTER:{MIN:.6,MID:.8,MAX:1,SELF_MIN:0},LOOK_AT_CENTER_FACE_X:{MAX:1,MIN:.8},MOVE_BACK_TOWARD_CENTER:{MAX:1,MIN:0}},DISTANCES:{LOOK_AT_CENTER:{SELF:{X:{PX:125},Y:{PX:100}},NON_SELF:{X:{PX:185},Y:{PX:100}},RANDOM_OFFSET_X:{MIN:{PX:-10},MAX:{PX:40}}},MOVE_BACK_TOWARD_CENTER:{X:{PX:40},Y:{PX:30}},MAX_FACE_OFFSET:{PX:6},FACE_FLIP_OUT_OFFSET:{PX:30},MAX_PROFILE_PICTURE_OFFSET:{PX:38}}};f.exports=n}),null);
__d("SpatialReactionClusterBase",["immutable"],(function a(b,c,d,e,f,g){"use strict";var h,i,j=c("immutable").Record({animationDurationFrames:-1,animationPitch:null,animationProgressFrames:-1,animationYaw:null,anonymousReactions:c("immutable").Set(),friendReactions:c("immutable").Set(),isHint:false,isSelfReaction:false,originalPitch:0,originalYaw:0,timestamp:-1});h=babelHelpers.inherits(k,j);i=h&&h.prototype;function k(){h.apply(this,arguments)}f.exports=k}),null);
__d("SpatialReactionCluster",["SpatialReactionClusterBase"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();var h,i;h=babelHelpers.inherits(j,c("SpatialReactionClusterBase"));i=h&&h.prototype;j.prototype.hasStartedAnimating=function(){return this.animationProgressFrames>=0};j.prototype.startAnimation=function(k,l){var m=arguments.length<=2||arguments[2]===undefined?false:arguments[2];return this.set("animationProgressFrames",0).set("isHint",m).set("animationYaw",k).set("animationPitch",l)};j.prototype.stopAnimation=function(){return this.set("animationProgressFrames",-1).set("isHint",false)};j.prototype.tickAnimation=function(){var k=this.animationProgressFrames;return this.set("animationProgressFrames",k+1)};j.prototype.isAnimationFinished=function(){return this.animationProgressFrames>=this.animationDurationFrames};function j(){h.apply(this,arguments)}f.exports=j}),null);
__d("denormalizeYaw",[],(function a(b,c,d,e,f,g){function h(i){var j=arguments.length<=1||arguments[1]===undefined?false:arguments[1],k=j?Math.PI:180,l=k*2;return i<=0?i+l:i}f.exports=h}),null);
__d("SpatialReactionsUtils",["csx","invariant","Alea","SpatialReactionAnimationConfig","DOM","DOMClone","DOMQuery","immutable","Rect","SpatialReaction","Scroll","Style","Vector","SpatialReactionCluster","VideoChannel","denormalizeYaw","getElementPosition"],(function a(b,c,d,e,f,g,h,i){"use strict";__p&&__p();var j={processServerReactionsPayloads:function k(l){__p&&__p();var m=c("immutable").Set();for(var n=l,o=Array.isArray(n),p=0,n=o?n:n[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var q;if(o){if(p>=n.length)break;q=n[p++]}else{p=n.next();if(p.done)break;q=p.value}var r=q;m=m.add(j.createSpatialReactionClusterFromData(r))}return m},createSpatialReactionClusterFromData:function k(l){var m=l.yaw,n=l.pitch,o=l.timestamp;m=c("denormalizeYaw")(m);var p=0,q=c("SpatialReactionAnimationConfig").DURATIONS.NON_SELF.TOTAL.FRAMES,r=new(c("Alea"))(m+n+o+""),s=l.friend_reactions.reduce(function(u,v){return u.add(new(c("SpatialReaction"))({animationRandomSeed:r(),reactionType:v.reaction_type,profilePictureURI:v.profile_picture_uri,isFriend:true,positionIndex:p++}))},c("immutable").Set()),t=l.popular_reactions.reduce(function(u,v){return u.add(new(c("SpatialReaction"))({animationRandomSeed:r(),reactionType:v.reaction_type,positionIndex:p++}))},c("immutable").Set());return new(c("SpatialReactionCluster"))({animationDurationFrames:q,anonymousReactions:t,friendReactions:s,originalPitch:n,originalYaw:m,timestamp:o})},getFriendReaction:function k(l){var m=null,n=l.feedback_add_streaming_reaction_subscribe;if(n.reactor.is_viewer_friend)m={profilePictureURI:n.reactor.profile_picture.uri,reactionType:n.reaction_info.reaction_type,reactionRegionId:this._getMostRecentlyActiveRegionId(n.regional_spatial_reaction_counts)};return m},_getMostRecentlyActiveRegionId:function k(l){l.length>0||i(0);var m=l[0];return m.region_id},fetchNewLiveReactions:function k(l,m,n,o){__p&&__p();if(n.length===0)return null;var p=j.getMostActiveRegion(n,m);if(!p)return null;var q=0,r=c("immutable").Set(),s={},t=null,u=Math.ceil(l);if(o){s=j.getPitchAndYawFromRegionId(o.reactionRegionId);t=new(c("Alea"))(s.pitch+s.yaw+u);r=r.add(new(c("SpatialReaction"))({animationRandomSeed:t(),reactionType:o.reactionType,profilePictureURI:o.profilePictureURI,isFriend:true,positionIndex:q++}))}else s=j.getPitchAndYawFromRegionId(p.region_id);var v=c("SpatialReactionAnimationConfig").DURATIONS.NON_SELF.TOTAL.FRAMES,w=s,x=w.pitch,y=w.yaw;if(!t)t=new(c("Alea"))(y+x+u);if(p){var z=j.getAnonymousReactions(p,m,q,t);return c("immutable").Set().add(new(c("SpatialReactionCluster"))({animationDurationFrames:v,anonymousReactions:z,friendReactions:r,originalPitch:x,originalYaw:y,timestamp:u}))}return null},updateReactionRegionMap:function k(l,m){return l.reduce(function(n,o){var p=o.region_id,q=o.region_reaction_counts.reduce(function(r,s){return r.set(s.reaction_type,s.count)},c("immutable").Map());return n.set(p,q)},c("immutable").Map())},getAnonymousReactions:function k(l,m,n,o){__p&&__p();var p=m.get(l.region_id),q=l.region_reaction_counts,r=c("immutable").Set(),s=c("immutable").Map();if(p&&!p.isEmpty())for(var t=q,u=Array.isArray(t),v=0,t=u?t:t[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var w;if(u){if(v>=t.length)break;w=t[v++]}else{v=t.next();if(v.done)break;w=v.value}var x=w,y=p.get(x.reaction_type),z=x.count-y;if(z>0)s=s.set(x.reaction_type,z)}else s=q.reduce(function(C,x){if(x.count>0)return C.set(x.reaction_type,x.count);else return C},c("immutable").Map());var A=s.sort().toMap(),B=A.slice(0,q.length-n);r=B.reduce(function(C,D,E){return C.add(new(c("SpatialReaction"))({animationRandomSeed:o(),reactionType:E,positionIndex:n++}))},c("immutable").Set());return r},getPitchAndYawFromRegionId:function k(l){var m=10,n=l%(360/m),o=l-n,p=n*m;p-=180;p=p===0?p:c("denormalizeYaw")(p);var q=o/(360/m);q*=m;q-=90;p+=m/2;q+=m/2;return{yaw:p,pitch:q}},getMostActiveRegion:function k(l,m){__p&&__p();var n=null,o=0;for(var p=l,q=Array.isArray(p),r=0,p=q?p:p[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var s;if(q){if(r>=p.length)break;s=p[r++]}else{r=p.next();if(r.done)break;s=r.value}var t=s,u=t.region_id,v=0,w=t.region_reaction_counts,x=w.reduce(function(A,B){return A+B.count},0),y=m.get(u);if(y){var z=y.reduce(function(A,B){return A+B},0);v=x-z}else v=x;if(v>o){o=v;n=t}}return n},getChannelViewViewportRect:function k(){if(c("VideoChannel").get())return new(c("Rect"))(c("DOMQuery").find(c("VideoChannel").get().getDialogContent(),"._1kfk"));else throw new Error("Not currently in channel view")},isVectorWithinViewport:function k(l,m,n){return!(l.x>m||l.x<0||l.y>n||l.y<0)},getRootElement:function k(){return c("DOM").find(document.body,"._li")},getReactionCenterVector:function k(l){var m=c("SpatialReactionAnimationConfig").SIZES.BASE.PX/2,n=c("getElementPosition")(l);return new(c("Vector"))(n.x+m+c("Scroll").getLeft(document.body),n.y+m+c("Scroll").getTop(document.body),"document")},insertOnTop:function k(l,m){var n=arguments.length<=2||arguments[2]===undefined?0:arguments[2],o=j.getRootElement(),p=l.getBoundingClientRect(),q=c("Scroll").getTop(document.body),r=p.top-p.width+q,s=p.left;c("DOM").insertAfter(o,m);c("Style").set(m,"position","absolute");c("Style").set(m,"left",s+"px");c("Style").set(m,"top",r-n+"px");c("Style").set(m,"z-index","1000")},cloneNode:function k(l){return c("DOMClone").deepClone(l)},hashId:function k(l){var m=0;if(l.length===0)return m;for(var n=0;n<l.length;n++){var o=l.charCodeAt(n);m=(m<<5)-m+o;m&=m}return m}};f.exports=j}),null);
__d("SpatialReactionFunnelLoggingStore",["SphericalVideoComponentConstants","SpatialReactionLoggingConstants","SphericalVideoComponentDispatcher","FluxReduceStore","FunnelLogger","VideoPlayerControllerStore","curry","SpatialReactionsUtils"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();var h,i,j=c("SphericalVideoComponentConstants").ACTIONS,k=c("SpatialReactionsUtils").hashId;h=babelHelpers.inherits(l,c("FluxReduceStore"));i=h&&h.prototype;l.prototype.getInitialState=function(){return{}};l.prototype.reduce=function(m,n){__p&&__p();var o=n.id,p=c("curry")(this.$SpatialReactionFunnelLoggingStore1,o);switch(n.type){case j.CLICK_LIKE_BUTTON:this.$SpatialReactionFunnelLoggingStore2(o);p(c("SpatialReactionLoggingConstants").FUNNEL_ACTIONS.CLICK_LIKE);this.$SpatialReactionFunnelLoggingStore3(o);break;case j.OPEN_REACTION_MENU:this.$SpatialReactionFunnelLoggingStore2(o);p(c("SpatialReactionLoggingConstants").FUNNEL_ACTIONS.OPEN_REACTION_MENU);break;case j.CLOSE_REACTION_MENU:p(c("SpatialReactionLoggingConstants").FUNNEL_ACTIONS.CLOSE_REACTION_MENU);this.$SpatialReactionFunnelLoggingStore3(o);break;case j.CLICK_REACTION:p(c("SpatialReactionLoggingConstants").FUNNEL_ACTIONS.CLICK_REACTION);this.$SpatialReactionFunnelLoggingStore3(o);break;case j.SET_MOUSE_DOWN:p(c("SpatialReactionLoggingConstants").FUNNEL_ACTIONS.PICK_UP_REACTION);break;case j.DROP_REACTION:if(n.recordMouseLocation){p(n.reactionOutsideViewport?c("SpatialReactionLoggingConstants").FUNNEL_ACTIONS.RELEASE_REACTION_SOMEWHERE_ELSE:c("SpatialReactionLoggingConstants").FUNNEL_ACTIONS.RELEASE_REACTION_ON_VIDEO);this.$SpatialReactionFunnelLoggingStore3(o)}break;default:break}return m};l.prototype.$SpatialReactionFunnelLoggingStore2=function(m){var n=k(m),o=c("VideoPlayerControllerStore").getIsPlaying(m),p=o?c("SpatialReactionLoggingConstants").PLAY_TAG:c("SpatialReactionLoggingConstants").PAUSE_TAG;c("FunnelLogger").startFunnel(c("SpatialReactionLoggingConstants").FUNNEL_NAME,n);c("FunnelLogger").addFunnelTag(c("SpatialReactionLoggingConstants").FUNNEL_NAME,n,p)};l.prototype.$SpatialReactionFunnelLoggingStore3=function(m){var n=k(m);c("FunnelLogger").endFunnel(c("SpatialReactionLoggingConstants").FUNNEL_NAME,n)};l.prototype.$SpatialReactionFunnelLoggingStore1=function(m,n){var o=k(m);c("FunnelLogger").appendAction(c("SpatialReactionLoggingConstants").FUNNEL_NAME,o,n)};function l(){h.apply(this,arguments)}f.exports=new l(c("SphericalVideoComponentDispatcher"))}),null);
__d("SpatialReactionConsumptionLoggingEvents",[],(function a(b,c,d,e,f,g){f.exports=Object.freeze({SPATIAL_REACTION_DISPLAY:"spatial_reaction_display"})}),null);
__d("SpatialReactionDisplayStates",[],(function a(b,c,d,e,f,g){f.exports=Object.freeze({DISPLAY:0,HINT:1,OUT_OF_VIEWPORT:2,DISABLED:3})}),null);
__d("SpatialReactionAnimationUtils",["Promise","SpatialReactionAnimationConfig","CSS","Style","Vector","FeedbackReactionType","SphericalProjectionUtils","SpatialReactionsUtils","getVendorPrefixedEventName","setInterval"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();var h=c("SpatialReactionAnimationConfig").CURVES,i=h.LOOK_AT_CENTER_FACE_POSITION,j=h.LOOK_AT_CENTER_FACE_SCALE_X,k=h.FACE_FLIP,l=h.MOVE_BACK_TOWARD_CENTER_FACE_SCALE_X,m=c("getVendorPrefixedEventName")("animationend"),n=c("getVendorPrefixedEventName")("transitionend"),o=10,p={canStartClusterAnimation:function q(r,s,t){__p&&__p();var u=s.friendReactions.union(s.anonymousReactions),v=function v(x,y){var z=y.profilePictureURI,A=y.reactionType;if(z){var B=t.hasFriendImage(z);x=x&&B}var C=t.hasReactionBaseImage(A)&&t.hasReactionFaceImage(A);x=x&&C;return x},w=u.reduce(v,true);return p.clusterIsWithinOneSecond(r,s.timestamp)&&!s.hasStartedAnimating()&&w},resetClusterAnimationIfNeeded:function q(r){return r.isAnimationFinished()?p.resetClusterAnimation(r):r},resetClusterAnimation:function q(r){var s=p.convertToNonSelfAnimation;return s(r.stopAnimation())},convertToNonSelfAnimation:function q(r){if(r.isSelfReaction){var s=c("SpatialReactionAnimationConfig").DURATIONS.NON_SELF.TOTAL.FRAMES;r=r.set("isSelfReaction",false);r=r.set("animationDurationFrames",s)}return r},getReactionBaseSize:function q(r){return Math.floor(c("SpatialReactionAnimationConfig").SIZES.BASE.PX*r)},getReactionRadius:function q(r){return Math.floor(c("SpatialReactionAnimationConfig").SIZES.BASE.PX/2*r)},getProfilePictureRadius:function q(r){return Math.floor(c("SpatialReactionAnimationConfig").SIZES.PROFILE.PX/2*r)},getReactionIndexOnLeft:function q(r){return r.positionIndex%2===0},getReactionFaceDimensions:function q(r,s,t){__p&&__p();var u=p.getDurationsForClusterType,v=p.getClusterIsLookingAtCenter,w=p.getLookAtCenterProgressFrames,x=p.getClusterIsMovingBackTowardCenter,y=p.getMoveBackTowardCenterProgressFrames,z=1,A=1,B=c("SpatialReactionAnimationConfig").SIZES.FACE.PX,C=c("SpatialReactionAnimationConfig").SCALES.LOOK_AT_CENTER_FACE_X.MIN,D=c("SpatialReactionAnimationConfig").SCALES.LOOK_AT_CENTER_FACE_X.MAX,E=u(r,c("SpatialReactionAnimationConfig")),F=E.LOOK_AT_CENTER.FRAMES;if(v(r)){var G=w(r);z=j.solve(G,D,-(D-C),F)}else if(x(r)){var H=E.MOVE_BACK_TOWARD_CENTER.FRAMES,I=E.SCALE_DOWN.FRAMES,J=y(r),K=c("SpatialReactionAnimationConfig").SCALES.MOVE_BACK_TOWARD_CENTER.MIN,L=c("SpatialReactionAnimationConfig").SCALES.LOOK_AT_CENTER_FACE_X.MAX,M=E.MOVE_BACK_TOWARD_CENTER.MAX_RANDOM_SCALE_DELAY_FRAMES,N=Math.floor(s.animationRandomSeed*M),O=H-N-I;z=l.solve(J,L,-(L-K),H,N,O)}return new(c("Vector"))(Math.floor(B*t*z),Math.floor(B*t*A))},clusterIsWithinOneSecond:function q(r,s){var t=s-.5,u=s+.5;return r>t&&r<u},getPercentageWithOffset:function q(r,s,t){return(s-r)/(t-r)},getPercentageWithMax:function q(r,s){return Math.min(r,s)/s},getDurationsForClusterType:function q(r,s){return r.isSelfReaction?s.DURATIONS.SELF:s.DURATIONS.NON_SELF},getMoveToCenterProgressFrames:function q(r){if(!r.isSelfReaction)throw new Error("Non self clusters do not move to center");else{var s=c("SpatialReactionAnimationConfig").DURATIONS,t=s.SELF.MOVE_TO_CENTER.FRAMES,u=r.animationProgressFrames;if(u<0||u>=t)throw new Error("Animation progress value not in move to center range: "+u);return u}},getLookAtCenterProgressFrames:function q(r){var s=r.animationProgressFrames,t=p.getDurationsForClusterType(r,c("SpatialReactionAnimationConfig")),u=t.LOOK_AT_CENTER.FRAMES,v=t.MOVE_TO_CENTER.FRAMES,w=s-v;if(w<0||w>=u)throw new Error("Animation progress value not in look at center range: "+w);return w},getMoveBackTowardCenterProgressFrames:function q(r){var s=r.animationProgressFrames,t=p.getDurationsForClusterType(r,c("SpatialReactionAnimationConfig")),u=t.MOVE_BACK_TOWARD_CENTER.FRAMES,v=t.MOVE_TO_CENTER.FRAMES+t.LOOK_AT_CENTER.FRAMES,w=s-v;if(w<0||w>=u)throw new Error("Animation progress value not in face flip range: "+w);return w},getClusterIsMovingToCenter:function q(r){var s=p.getDurationsForClusterType(r,c("SpatialReactionAnimationConfig")),t=s.MOVE_TO_CENTER.FRAMES;return r.isSelfReaction&&r.hasStartedAnimating()&&r.animationProgressFrames<t},getClusterIsLookingAtCenter:function q(r){var s=r.animationProgressFrames,t=p.getDurationsForClusterType(r,c("SpatialReactionAnimationConfig")),u=t.MOVE_TO_CENTER.FRAMES,v=u+t.LOOK_AT_CENTER.FRAMES;return s>=u&&s<v},getClusterIsMovingBackTowardCenter:function q(r){var s=r.animationProgressFrames,t=p.getDurationsForClusterType(r,c("SpatialReactionAnimationConfig")),u=t.MOVE_TO_CENTER.FRAMES+t.LOOK_AT_CENTER.FRAMES,v=u+t.MOVE_BACK_TOWARD_CENTER.FRAMES;return s>=u&&s<v},getReactionFaceOffset:function q(r,s){var t=p.getClusterIsLookingAtCenter,u=p.getClusterIsMovingBackTowardCenter,v=p.getLookAtCenterProgressFrames,w=p.getReactionIndexOnLeft,x=w(s),y=0,z=c("SpatialReactionAnimationConfig").DISTANCES.MAX_FACE_OFFSET.PX*(x?1:-1);if(t(r)){var A=v(r),B=p.getDurationsForClusterType(r,c("SpatialReactionAnimationConfig")),C=B.LOOK_AT_CENTER.FRAMES;return i.solve(A,y,z,C)}else if(u(r))return z;else return y},getReactionFaceFlipOutOffset:function q(r,s){var t=p.getClusterIsLookingAtCenter,u=p.getLookAtCenterProgressFrames,v=p.getReactionIndexOnLeft,w=p.getClusterIsMovingBackTowardCenter,x=v(s),y=0,z=c("SpatialReactionAnimationConfig").DISTANCES.FACE_FLIP_OUT_OFFSET.PX*(x?1:-1);if(t(r)){var A=u(r),B=p.getDurationsForClusterType(r,c("SpatialReactionAnimationConfig")),C=B.LOOK_AT_CENTER.FRAMES,D=B.FACE_FLIP.FRAMES,E=B.FACE_HANG.FRAMES,F=C-D-E;return k.solve(A,y,z,C,F,E)}else if(w(r))return z;else return y},getReactionProfilePictureOffset:function q(r,s){var t=p.getLookAtCenterProgressFrames,u=p.getClusterIsLookingAtCenter,v=p.getClusterIsMovingBackTowardCenter,w=p.getReactionIndexOnLeft,x=w(s),y=0,z=c("SpatialReactionAnimationConfig").DISTANCES.MAX_PROFILE_PICTURE_OFFSET.PX*(x?1:-1);if(u(r)){var A=t(r),B=p.getDurationsForClusterType(r,c("SpatialReactionAnimationConfig")),C=B.LOOK_AT_CENTER.FRAMES,D=B.FACE_FLIP.FRAMES,E=B.FACE_HANG.FRAMES,F=C-D-E;return k.solve(A,z,-(z-y),C,F,E)}else if(v(r))return y;else return z},addTransitionEndListener:function q(r,s){return new(c("Promise"))(function(t,u){r.addEventListener(n,function(v){if(v.propertyName===s)t()})})},addTransition:function q(r,s,t,u){var v=p.addTransitionEndListener(r,t);c("CSS").addClass(r,s);u();return v},addAnimationEndListener:function q(r,s){return new(c("Promise"))(function(t,u){r.addEventListener(m,function(v){if(v.animationName===s)t()})})},addTemporaryAnimation:function q(r,s,t){return new(c("Promise"))(function(u,v){p.addAnimationEndListener(r,t).then(function(){c("CSS").removeClass(r,s);u()}).done();c("CSS").addClass(r,s)})},moveElementToPosition:function q(r,s){c("Style").set(r,"left",s.x+"px");c("Style").set(r,"top",s.y+"px")},pollForAnimationProgress:function q(r){return new(c("Promise"))(function(s,t){var u=c("setInterval")(function(){if(r()){clearInterval(u);s()}},o)})},getReactionCenterOffset:function q(r){return new(c("Vector"))(r/2,r/2)},getReactionClickPositionRelativeToViewport:function q(r,s,t){__p&&__p();var u=c("SpatialReactionAnimationConfig").SIZES.BASE.PX,v=p.getReactionCenterOffset(u),w=6,x=0;switch(t){case c("FeedbackReactionType").LOVE:x=1;break;case c("FeedbackReactionType").HAHA:x=2;break;case c("FeedbackReactionType").WOW:x=3;break;case c("FeedbackReactionType").SORRY:x=4;break;case c("FeedbackReactionType").ANGER:x=5;break;default:break}var y=s-v.y,z=v.x+u*x+w*x;return new(c("Vector"))(Math.floor(z),Math.floor(y))},isPositionIndexOnLeftSide:function q(r){return r<Math.floor(c("SpatialReactionAnimationConfig").CLICK.NUM_POSITIONS/2)},clusterIsVisibleOnLeft:function q(r,s,t,u,v,w,x){return p.clusterIsVisibleInViewport(r,s-u,t,v,w,x)},clusterIsVisibleOnRight:function q(r,s,t,u,v,w,x){return p.clusterIsVisibleInViewport(r,s+u,t,v,w,x)},clusterIsVisibleInViewport:function q(r,s,t,u,v,w){var x=p.get2dDiscretePointFromCurrentView(r.originalYaw,r.originalPitch,s,t,u,v,w),y=x.x,z=x.y;return c("SpatialReactionsUtils").isVectorWithinViewport({x:y,y:z},v,w)},get2dDiscretePointFromCurrentView:function q(r,s,t,u,v,w,x){var y=c("SphericalProjectionUtils").convert3dTo2dScaledUnique(r,s,t,u,v,w,x),z=y.x,A=y.y;return{x:Math.floor(z),y:Math.floor(A)}}};f.exports=p}),null);
__d("SpatialReactionsImageCache",["Promise","DOM","FeedbackReactionType","immutable","SpatialReactionImagePaths"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();var h=[c("SpatialReactionImagePaths").BASES.LIKE,c("SpatialReactionImagePaths").BASES.LOVE,c("SpatialReactionImagePaths").BASES.WOW,c("SpatialReactionImagePaths").BASES.HAHA,c("SpatialReactionImagePaths").BASES.SORRY,c("SpatialReactionImagePaths").BASES.ANGER,c("SpatialReactionImagePaths").FACES.LIKE,c("SpatialReactionImagePaths").FACES.LOVE,c("SpatialReactionImagePaths").FACES.WOW,c("SpatialReactionImagePaths").FACES.HAHA,c("SpatialReactionImagePaths").FACES.SORRY,c("SpatialReactionImagePaths").FACES.ANGER];function i(){this.$SpatialReactionsImageCache1=c("immutable").Map();this.$SpatialReactionsImageCache2=c("immutable").Map();this.$SpatialReactionsImageCache3=c("immutable").Map()}i.prototype.loadStaticImages=function(j){this.$SpatialReactionsImageCache4=j;var k=h.concat(j).map(this.$SpatialReactionsImageCache5);return new(c("Promise"))(function(l,m){c("Promise").all(k).then(function(n){var o=n[0],p=n[1],q=n[2],r=n[3],s=n[4],t=n[5],u=n[6],v=n[7],w=n[8],x=n[9],y=n[10],z=n[11],A=n[12];this.$SpatialReactionsImageCache1=this.$SpatialReactionsImageCache1.set(c("FeedbackReactionType").LIKE,o).set(c("FeedbackReactionType").LOVE,p).set(c("FeedbackReactionType").WOW,q).set(c("FeedbackReactionType").HAHA,r).set(c("FeedbackReactionType").SORRY,s).set(c("FeedbackReactionType").ANGER,t);this.$SpatialReactionsImageCache2=this.$SpatialReactionsImageCache1.set(c("FeedbackReactionType").LIKE,u).set(c("FeedbackReactionType").LOVE,v).set(c("FeedbackReactionType").WOW,w).set(c("FeedbackReactionType").HAHA,x).set(c("FeedbackReactionType").SORRY,y).set(c("FeedbackReactionType").ANGER,z);this.$SpatialReactionsImageCache3=this.$SpatialReactionsImageCache3.set(j,A);l()}.bind(this),m).done()}.bind(this))};i.prototype.getReactionBaseImage=function(j){return this.$SpatialReactionsImageCache1.get(j)};i.prototype.getReactionFaceImage=function(j){return this.$SpatialReactionsImageCache2.get(j)};i.prototype.hasReactionBaseImage=function(j){return this.$SpatialReactionsImageCache1.has(j)};i.prototype.hasReactionFaceImage=function(j){return this.$SpatialReactionsImageCache2.has(j)};i.prototype.putFriendImage=function(j){return this.$SpatialReactionsImageCache6(j)};i.prototype.getFriendImage=function(j){return this.$SpatialReactionsImageCache3.get(j)};i.prototype.hasFriendImage=function(j){return this.$SpatialReactionsImageCache3.has(j)};i.prototype.getOwnProfilePhotoURI=function(){return this.$SpatialReactionsImageCache4};i.prototype.$SpatialReactionsImageCache6=function(j){return new(c("Promise"))(function(k,l){if(this.hasFriendImage(j))k(null);else this.$SpatialReactionsImageCache5(j).then(function(m){this.$SpatialReactionsImageCache3=this.$SpatialReactionsImageCache3.set(j,m);k(null)}.bind(this)).done()}.bind(this))};i.prototype.$SpatialReactionsImageCache5=function(j){return new(c("Promise"))(function(k,l){var m=c("DOM").create("img");m.onload=function(){return k(m)};m.onerror=l;m.src=j})};f.exports=new i()}),null);
__d("SpatialReactionsProductionStore",["SpatialReactionAnimationConfig","SphericalVideoComponentConstants","SphericalVideoComponentDispatcher","FluxReduceStore","SphericalViewportControlStore","immutable","Vector","UFIVideoPlayerRegistry","SpatialReactionsUtils","range"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();var h,i,j,k,l=c("SpatialReactionsUtils").isVectorWithinViewport,m=c("SpatialReactionAnimationConfig").CLICK.NUM_POSITIONS;h=babelHelpers.inherits(n,c("immutable").Record({shouldLeaveReactionMenuOpen:false,isMouseDown:false,isDragging:false,mousePositionRelativeToCanvas:null,nextClickReactionPositionIndex:0,originalDragPosition:null}));i=h&&h.prototype;function n(){h.apply(this,arguments)}j=babelHelpers.inherits(o,c("FluxReduceStore"));k=j&&j.prototype;o.prototype.getVideoPlayerController=function(p){var q=c("UFIVideoPlayerRegistry").getAvailableVideoPlayerController(p);if(!q)return null;return q};o.prototype.getInitialState=function(){return new n()};o.prototype.reduce=function(p,q){__p&&__p();switch(q.type){case c("SphericalVideoComponentConstants").ACTIONS.SET_SHOULD_LEAVE_REACTION_MENU_OPEN:p=p.set("shouldLeaveReactionMenuOpen",q.leaveOpen);break;case c("SphericalVideoComponentConstants").ACTIONS.SET_MOUSE_DOWN:p=this.$SpatialReactionsProductionStore1(p,q.reactionCenter);break;case c("SphericalVideoComponentConstants").ACTIONS.SET_MOUSE_UP:p=this.$SpatialReactionsProductionStore2(p,q.id,q.reactionCenter);break;case c("SphericalVideoComponentConstants").ACTIONS.SET_IS_DRAGGING:p=p.set("isDragging",q.isDragging);break;case c("SphericalVideoComponentConstants").ACTIONS.DROP_REACTION:p=p.set("mousePositionRelativeToCanvas",null);p=p.set("originalDragPosition",null);break;case c("SphericalVideoComponentConstants").ACTIONS.CLICK_REACTION:p=this.$SpatialReactionsProductionStore3(p);break;default:break}return p};o.prototype.shouldLeaveReactionMenuOpen=function(){return this.$SpatialReactionsProductionStore4(this.getState())};o.prototype.getIsMouseDown=function(){return this.$SpatialReactionsProductionStore5(this.getState())};o.prototype.getOriginalMousePosition=function(){var p=this.$SpatialReactionsProductionStore6(this.getState());if(!p)throw new Error("User is not dragging yet");return p};o.prototype.getReactionPositionVector=function(){return this.$SpatialReactionsProductionStore7(this.getState())};o.prototype.getIsReactionWithinViewport=function(p,q){return this.$SpatialReactionsProductionStore8.apply(this,[this.getState()].concat(Array.prototype.slice.call(arguments)))};o.prototype.getNextClickReactionPositionIndex=function(){return this.$SpatialReactionsProductionStore9(this.getState())};o.prototype.$SpatialReactionsProductionStore7=function(p){var q=p.mousePositionRelativeToCanvas;if(!q)throw new Error("User is not dragging yet");return q};o.prototype.$SpatialReactionsProductionStore8=function(p,q,r){var s=p.mousePositionRelativeToCanvas;if(!s)throw new Error("User is not dragging yet");return l(s,q,r)};o.prototype.$SpatialReactionsProductionStore4=function(p){return p.shouldLeaveReactionMenuOpen};o.prototype.$SpatialReactionsProductionStore5=function(p){return p.isMouseDown};o.prototype.$SpatialReactionsProductionStore6=function(p){return p.originalDragPosition};o.prototype.$SpatialReactionsProductionStore10=function(p,q){return q.sub(c("SphericalViewportControlStore").getViewportPositionVector(p))};o.prototype.$SpatialReactionsProductionStore9=function(p){return p.nextClickReactionPositionIndex};o.prototype.$SpatialReactionsProductionStore1=function(p,q){var r=new(c("Vector"))(c("SpatialReactionAnimationConfig").SIZES.BASE.PX/2,0),s=q.sub(r);p=p.set("originalDragPosition",s);p=p.set("isMouseDown",true);return p};o.prototype.$SpatialReactionsProductionStore2=function(p,q,r){p=p.set("isMouseDown",false);var s=this.$SpatialReactionsProductionStore10(q,r);p=p.set("mousePositionRelativeToCanvas",s);return p};o.prototype.$SpatialReactionsProductionStore3=function(p){var q=p.nextClickReactionPositionIndex,r=Math.floor(m/2),s=q<r,t=c("range")(0,m).filter(function(u){return s?!(u<r):u<r}).reduce(function(u,v,w,x){return u===null?x[Math.floor(Math.random()*x.length)]:u},null);return p.set("nextClickReactionPositionIndex",t)};function o(){j.apply(this,arguments)}f.exports=new o(c("SphericalVideoComponentDispatcher"))}),null);
__d("SpatialReactionsState",["immutable"],(function a(b,c,d,e,f,g){var h,i;h=babelHelpers.inherits(j,c("immutable").Record({reactionClusters:c("immutable").Set()}));i=h&&h.prototype;function j(){"use strict";h.apply(this,arguments)}f.exports=j}),null);
__d("SpatialReactionsConsumptionStore",["invariant","SpatialReactionAnimationConfig","SpatialReactionAnimationUtils","SphericalVideoComponentConstants","SphericalVideoComponentDispatcher","FluxMapStore","SpatialReactionsImageCache","immutable","SpatialReaction","SpatialReactionCluster","SpatialReactionsState","SpatialReactionsProductionStore","VideoPlayerControllerStore","SpatialReactionExperimentsStore","SphericalViewportControlStore","curry","denormalizeYaw","degToRad","radToDeg","SphericalProjectionUtils"],(function a(b,c,d,e,f,g,h){"use strict";__p&&__p();var i,j,k=c("SphericalProjectionUtils").distanceBetweenSphericalCoordinatesDeg,l=c("SpatialReactionAnimationConfig").DURATIONS.SELF.TOTAL.FRAMES,m=.7;i=babelHelpers.inherits(n,c("FluxMapStore"));j=i&&i.prototype;n.prototype.getInitialState=function(){return c("immutable").Map({})};n.prototype.reduce=function(o,p){__p&&__p();var q=p.id,r=c("curry")(o.set.bind(o),q);switch(p.type){case c("SphericalVideoComponentConstants").ACTIONS.REGISTER_NEW_REACTIONS_STATE:o=r(new(c("SpatialReactionsState"))());break;case c("SphericalVideoComponentConstants").ACTIONS.ADD_SPATIAL_REACTIONS:o=this.$SpatialReactionsConsumptionStore1(q,o,p.reactionClusters);break;case c("SphericalVideoComponentConstants").ACTIONS.DROP_REACTION:o=this.$SpatialReactionsConsumptionStore2(q,o,p.reactionType,p.reactionOutsideViewport,p.recordMouseLocation,p.viewportWidth,p.viewportHeight,p.viewportYaw,p.viewportPitch,p.viewportFieldOfView,p.recordReactionCallback);break;case c("SphericalVideoComponentConstants").ACTIONS.TICK_ANIMATION:o=this.$SpatialReactionsConsumptionStore3(q,o);o=this.$SpatialReactionsConsumptionStore4(q,o);break;case c("SphericalVideoComponentConstants").ACTIONS.START_ANIMATION_FOR_FRAME:o=this.$SpatialReactionsConsumptionStore5(q,o,p.timestamp,p.yaw,p.pitch,p.fieldOfView,p.viewportWidth,p.viewportHeight);break;case c("SphericalVideoComponentConstants").ACTIONS.SEEK_START:o=this.$SpatialReactionsConsumptionStore6(q,o);break;default:break}return o};n.prototype.getSpatialReactionsState=function(o){return this.$SpatialReactionsConsumptionStore7(o,this.getState())};n.prototype.$SpatialReactionsConsumptionStore7=function(o,p){return p.get(o)};n.prototype.$SpatialReactionsConsumptionStore8=function(o,p,q,r){var s=p.get(o).set(q,r);return p.set(o,s)};n.prototype.$SpatialReactionsConsumptionStore2=function(o,p,q,r,s,t,u,v,w,x,y){if(r||c("SpatialReactionExperimentsStore").shouldDisableReactions(o)){y();return p}y(Math.floor(v),Math.floor(w));return this.$SpatialReactionsConsumptionStore9(o,p,q,v,w,c("VideoPlayerControllerStore").getCurrentTime(o))};n.prototype.$SpatialReactionsConsumptionStore9=function(o,p,q,r,s,t){var u=c("SpatialReactionsImageCache").getOwnProfilePhotoURI();if(!u)return p;var v=p.get(o),w=new(c("SpatialReactionCluster"))({animationDurationFrames:l,animationProgressFrames:-1,friendReactions:c("immutable").Set.of(new(c("SpatialReaction"))({animationRandomSeed:Math.random(),isFriend:true,profilePictureURI:u,reactionType:q,positionIndex:c("SpatialReactionsProductionStore").getNextClickReactionPositionIndex()})),originalYaw:c("denormalizeYaw")(r),originalPitch:s,timestamp:t,isSelfReaction:true});p=p.set(o,v);return this.$SpatialReactionsConsumptionStore1(o,p,c("immutable").Set.of(w))};n.prototype.$SpatialReactionsConsumptionStore1=function(o,p,q){__p&&__p();var r=p.get(o),s=r,t=s.reactionClusters;q.forEach(function(u){var v=u.friendReactions;v.forEach(function(w){w.profilePictureURI||h(0);w.isFriend||h(0);c("SpatialReactionsImageCache").putFriendImage(w.profilePictureURI)})});t=t.union(q);r=r.set("reactionClusters",t);return p.set(o,r)};n.prototype.$SpatialReactionsConsumptionStore5=function(o,p,q,r,s,t,u,v){__p&&__p();var w=c("SpatialReactionAnimationUtils").canStartClusterAnimation,x=c("SpatialReactionAnimationUtils").clusterIsVisibleOnLeft,y=c("SpatialReactionAnimationUtils").clusterIsVisibleOnRight,z=c("SpatialReactionAnimationUtils").clusterIsVisibleInViewport,A=p.get(o),B=A.reactionClusters,C=c("SpatialReactionExperimentsStore").shouldDisableInitialViewportReactions(o),D=k(c("SphericalViewportControlStore").getInitialYaw(o),c("SphericalViewportControlStore").getInitialPitch(o),r,s),E=D<30,F=c("SpatialReactionExperimentsStore").shouldOnlyShowHints(o),G=B.count(function(K){return K.hasStartedAnimating()&&!K.isSelfReaction}),H=u/v,I=c("radToDeg")(2*Math.atan(Math.tan(c("degToRad")(t)/2)*H)),J=function J(K){__p&&__p();var L=K;if(w(q,K,c("SpatialReactionsImageCache")))if(K.isSelfReaction)L=K.startAnimation(r,s);else if(G<1)if(z(K,r,s,t,u,v)){if(!(F||C&&E))L=K.startAnimation(r,s)}else if(x(K,r,s,I,t,u,v)){var M=true;L=K.startAnimation(r-I*m,s,M)}else if(y(K,r,s,I,t,u,v)){var N=true;L=K.startAnimation(r+I*m,s,N)}return L};return this.$SpatialReactionsConsumptionStore10(o,p,J)};n.prototype.$SpatialReactionsConsumptionStore3=function(o,p){var q=function q(r){return r.hasStartedAnimating()?r.tickAnimation():r};return this.$SpatialReactionsConsumptionStore10(o,p,q)};n.prototype.$SpatialReactionsConsumptionStore4=function(o,p){var q=c("SpatialReactionAnimationUtils").resetClusterAnimationIfNeeded;p=this.$SpatialReactionsConsumptionStore10(o,p,q);return p};n.prototype.$SpatialReactionsConsumptionStore6=function(o,p){return this.$SpatialReactionsConsumptionStore10(o,p,c("SpatialReactionAnimationUtils").resetClusterAnimation)};n.prototype.$SpatialReactionsConsumptionStore10=function(o,p,q){var r=p.get(o),s=r,t=s.reactionClusters;t=t.map(q);r=r.set("reactionClusters",t);return p.set(o,r)};n.prototype.$SpatialReactionsConsumptionStore11=function(o,p,q){var r=p.get(o),s=r,t=s.reactionClusters;t=t.filter(q);r=r.set("reactionClusters",t);return p.set(o,r)};function n(){i.apply(this,arguments)}f.exports=new n(c("SphericalVideoComponentDispatcher"))}),null);
__d("SpatialReactionsConsumptionLoggingStore",["invariant","SphericalVideoComponentConstants","SphericalVideoComponentDispatcher","FluxMapStore","immutable","SpatialReactionsConsumptionStore","SphericalViewportControlStore","SpatialReactionConsumptionTypedLogger","SpatialReactionConsumptionLoggingEvents","SpatialReactionDisplayStates"],(function a(b,c,d,e,f,g,h){"use strict";__p&&__p();var i,j,k,l,m=100,n=Math.floor;i=babelHelpers.inherits(o,c("immutable").Record({clusterPitch:null,clusterYaw:null,displayState:null,friendCount:0,hasNonFriend:false,isDisplayingCluster:false,moveTowardHint:false,reactionType:null,timestamp:null,viewportPitch:null,viewportYaw:null}));j=i&&i.prototype;function o(){i.apply(this,arguments)}k=babelHelpers.inherits(p,c("FluxMapStore"));l=k&&k.prototype;p.prototype.getInitialState=function(){return c("immutable").Map({})};p.prototype.reduce=function(q,r){var s=r.id;switch(r.type){case c("SphericalVideoComponentConstants").ACTIONS.REGISTER_NEW_REACTIONS_STATE:q=q.set(s,new o());break;case c("SphericalVideoComponentConstants").ACTIONS.TICK_ANIMATION:q=this.$SpatialReactionsConsumptionLoggingStore1(q,s);break;default:break}return q};p.prototype.$SpatialReactionsConsumptionLoggingStore1=function(q,r){__p&&__p();var s=this.$SpatialReactionsConsumptionLoggingStore2(r,q),t=s.isDisplayingCluster,u=c("SpatialReactionsConsumptionStore").getSpatialReactionsState(r);if(u){var v=u.get("reactionClusters"),w=v.filter(function(y){return!y.isSelfReaction&&y.hasStartedAnimating()}),x=w.size>0;if(x&&!t)q=this.$SpatialReactionsConsumptionLoggingStore3(r,q,v);else if(!x&&t){q=this.$SpatialReactionsConsumptionLoggingStore4(r,q);this.$SpatialReactionsConsumptionLoggingStore5(q.get(r));q=this.$SpatialReactionsConsumptionLoggingStore6(r,q)}}return q};p.prototype.$SpatialReactionsConsumptionLoggingStore3=function(q,r,s){__p&&__p();var t=s.filter(function(u){return!u.isSelfReaction&&u.hasStartedAnimating()});if(t.size===1){var u=t.first(),v=u.animationYaw,w=u.animationPitch,x=u.friendReactions,y=u.anonymousReactions,z=u.timestamp;v!==null&&w!==null||h(0);var A=c("SphericalViewportControlStore").getOrientation(q),B=this.$SpatialReactionsConsumptionLoggingStore2(q,r),C=x.union(y).countBy(function(G){return G.reactionType}).sortBy(function(G,H){return-G}).flip().first(),D=x.size,E=y.size>0,F=u.isHint?c("SpatialReactionDisplayStates").HINT:c("SpatialReactionDisplayStates").DISPLAY;B=B.set("isDisplayingCluster",true).set("clusterYaw",n(v)).set("clusterPitch",n(w)).set("timestamp",n(z)).set("reactionType",C).set("friendCount",D).set("hasNonFriend",E).set("viewportYaw",n(A.yaw)).set("viewportPitch",n(A.pitch)).set("displayState",F);r=r.set(q,B)}return r};p.prototype.$SpatialReactionsConsumptionLoggingStore4=function(q,r){var s=this.$SpatialReactionsConsumptionLoggingStore2(q,r);if(s.displayState===c("SpatialReactionDisplayStates").HINT){var t=c("SphericalViewportControlStore").getOrientation(q),u=s,v=u.viewportYaw,w=u.viewportPitch,x=u.clusterYaw,y=u.clusterPitch;v!==null&&w!==null&&x!==null&&y!==null||h(0);var z=this.$SpatialReactionsConsumptionLoggingStore7(v-x,w-y),A=this.$SpatialReactionsConsumptionLoggingStore7(t.yaw-x,t.pitch-y);s=s.set("moveTowardHint",z-A>m)}r=r.set(q,s);return r};p.prototype.$SpatialReactionsConsumptionLoggingStore7=function(q,r){return r*r+q*q};p.prototype.$SpatialReactionsConsumptionLoggingStore6=function(q,r){return r.set(q,new o())};p.prototype.$SpatialReactionsConsumptionLoggingStore5=function(q){var r=new(c("SpatialReactionConsumptionTypedLogger"))();r.setEvent(c("SpatialReactionConsumptionLoggingEvents").SPATIAL_REACTION_DISPLAY).setYaw(q.get("clusterYaw")).setPitch(q.get("clusterPitch")).setDisplayState(q.get("displayState")).setFriendCount(q.get("friendCount")).setHasNonFriend(q.get("hasNonFriend")).setMoveTowardsHint(q.get("moveTowardHint")).setReactionKey(q.get("reactionType")).setVideoTimestamp(q.get("timestamp")).setCenterYaw(q.get("viewportYaw")).setCenterPitch(q.get("viewportPitch"));r.log();r.clear()};p.prototype.$SpatialReactionsConsumptionLoggingStore2=function(q,r){return r.get(q)};p.prototype.finishTrackingCluster=function(q,r){return this.$SpatialReactionsConsumptionLoggingStore4(q,r)};function p(){k.apply(this,arguments)}f.exports=new p(c("SphericalVideoComponentDispatcher"))}),null);
__d("SphericalVideoComponent",["SphericalVideoComponentActions","SphericalVideoComponentDispatcher","VideoPlayerControllerStore","SphericalViewportControlStore","SpatialReactionsConsumptionStore","SpatialReactionsProductionStore","SpatialReactionFunnelLoggingStore","SpatialReactionsConsumptionLoggingStore","SpatialReactionExperimentsStore","abstractMethod"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();h.getStores=function(){return[c("VideoPlayerControllerStore"),c("SphericalViewportControlStore"),c("SpatialReactionsConsumptionStore"),c("SpatialReactionsProductionStore"),c("SpatialReactionFunnelLoggingStore"),c("SpatialReactionsConsumptionLoggingStore"),c("SpatialReactionExperimentsStore")]};h.prototype.getInitialState=function(i){return c("abstractMethod")("SphericalVideoComponent","getInitialState")};h.prototype.calculateState=function(i){return c("abstractMethod")("SphericalVideoComponent","calculateState")};function h(i){__p&&__p();this.onStoreChange=function(){var o=this.calculateState(this.state);this.onStateChange(this.state,o);this.state=o}.bind(this);c("SphericalVideoComponentDispatcher").explicitlyRegisterStores([c("SphericalViewportControlStore"),c("VideoPlayerControllerStore"),c("SpatialReactionsConsumptionStore"),c("SpatialReactionsProductionStore"),c("SpatialReactionFunnelLoggingStore"),c("SpatialReactionsConsumptionLoggingStore"),c("SpatialReactionExperimentsStore")]);this.id=i.getVideoPlayerID();c("SphericalVideoComponentActions").registerVideoPlayerController(i);this.state=this.getInitialState(this.id);for(var j=h.getStores(),k=Array.isArray(j),l=0,j=k?j:j[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var m;if(k){if(l>=j.length)break;m=j[l++]}else{l=j.next();if(l.done)break;m=l.value}var n=m;n.addListener(this.onStoreChange)}}h.prototype.onStateChange=function(i,j){return};f.exports=h}),null);
__d("SpatialReactionAnimationPositioner",["SpatialReactionAnimationConfig","Vector","SpatialReactionAnimationUtils","curry"],(function a(b,c,d,aa,e,ba){"use strict";__p&&__p();var f=c("SpatialReactionAnimationUtils").getClusterIsMovingToCenter,g=c("SpatialReactionAnimationUtils").getClusterIsLookingAtCenter,h=c("SpatialReactionAnimationUtils").getClusterIsMovingBackTowardCenter,i=c("SpatialReactionAnimationUtils").getMoveToCenterProgressFrames,j=c("SpatialReactionAnimationUtils").getLookAtCenterProgressFrames,k=c("SpatialReactionAnimationUtils").getMoveBackTowardCenterProgressFrames,l=c("SpatialReactionAnimationUtils").getReactionIndexOnLeft,m=c("SpatialReactionAnimationUtils").getReactionClickPositionRelativeToViewport,n=c("SpatialReactionAnimationConfig").CURVES,o=n.MOVE_TO_CENTER_PATH_X,p=n.MOVE_TO_CENTER_PATH_Y,q=n.LOOK_AT_CENTER_PATH_X,r=n.LOOK_AT_CENTER_PATH_Y,s=n.MOVE_BACK_TOWARD_CENTER_PATH_X,t=n.MOVE_BACK_TOWARD_CENTER_PATH_Y;u.prototype.setCluster=function(v){this.$SpatialReactionAnimationPositioner5=v;return this};u.prototype.setViewportWidth=function(v){this.$SpatialReactionAnimationPositioner1=v;return this};u.prototype.setViewportHeight=function(v){this.$SpatialReactionAnimationPositioner2=v;return this};u.prototype.setClusterCenterX=function(v){this.$SpatialReactionAnimationPositioner3=v;return this};u.prototype.setClusterCenterY=function(v){this.$SpatialReactionAnimationPositioner4=v;return this};u.prototype.getReactionPosition=function(v){return this.$SpatialReactionAnimationPositioner6(this.$SpatialReactionAnimationPositioner1,this.$SpatialReactionAnimationPositioner2,this.$SpatialReactionAnimationPositioner3,this.$SpatialReactionAnimationPositioner4,this.$SpatialReactionAnimationPositioner5,v)};u.prototype.$SpatialReactionAnimationPositioner6=function(v,w,x,y,z,A){var B=z.animationProgressFrames;if(!z.hasStartedAnimating())throw new Error("Reactions cluster with progress: "+B+"\n         has not started animating");return this.$SpatialReactionAnimationPositioner7.apply(this,arguments)};u.prototype.$SpatialReactionAnimationPositioner7=function(v,w,x,y,z,A){__p&&__p();var B=c("curry")(this.$SpatialReactionAnimationPositioner8,A),C=c("curry")(B,0),D=z.isSelfReaction,E=D?c("SpatialReactionAnimationConfig").DURATIONS.SELF:c("SpatialReactionAnimationConfig").DURATIONS.NON_SELF,F=D?c("SpatialReactionAnimationConfig").DISTANCES.LOOK_AT_CENTER.SELF:c("SpatialReactionAnimationConfig").DISTANCES.LOOK_AT_CENTER.NON_SELF,G=l(A),H=m(v,w,A.reactionType),I=H.x,J=H.y,K=F.X.PX;K*=G?-1:1;var L=c("SpatialReactionAnimationConfig").DISTANCES.LOOK_AT_CENTER.RANDOM_OFFSET_X.MAX.PX,M=c("SpatialReactionAnimationConfig").DISTANCES.LOOK_AT_CENTER.RANDOM_OFFSET_X.MIN.PX;K+=B(M,L);var N=this.$SpatialReactionAnimationPositioner9(F.Y.PX,A),O=x,P=y,Q=c("SpatialReactionAnimationConfig").DISTANCES.MOVE_BACK_TOWARD_CENTER.X.PX,R=c("SpatialReactionAnimationConfig").DISTANCES.MOVE_BACK_TOWARD_CENTER.Y.PX;Q*=G?1:-1;var S=void 0,T=void 0;if(f(z)){var U=E.MOVE_TO_CENTER.FRAMES,V=i(z);S=o.solve(V,I,O-I,U);T=p.solve(V,J,P-J,U)}else if(g(z)){var W=E.LOOK_AT_CENTER.FRAMES,X=E.LOOK_AT_CENTER.MAX_RANDOM_DELAY_FRAMES,Y=j(z);S=q.solve(Y,O,K,W,C(X));T=r.solve(Y,P,-N,W,C(X))}else if(h(z)){var Z=E.MOVE_BACK_TOWARD_CENTER.FRAMES,$=k(z);S=s.solve($,O+K,Q,Z);T=t.solve($,P-N,R,Z)}else throw new Error("Animation config is invalid");return new(c("Vector"))(Math.floor(S),Math.floor(T))};u.prototype.$SpatialReactionAnimationPositioner9=function(v,w){var x=w.positionIndex,y=v;if(x>1)y/=3;if(x>3)y*=-2;return y};u.prototype.$SpatialReactionAnimationPositioner8=function(v,w,x){var y=v.animationRandomSeed;return w+Math.floor(y*(x-w))};function u(){}e.exports=u}),null);
__d("SpatialReactionAnimationScaler",["SpatialReactionAnimationConfig","SpatialReactionAnimationUtils"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();var h=c("SpatialReactionAnimationUtils").getMoveToCenterProgressFrames,i=c("SpatialReactionAnimationUtils").getLookAtCenterProgressFrames,j=c("SpatialReactionAnimationUtils").getMoveBackTowardCenterProgressFrames,k=c("SpatialReactionAnimationUtils").getClusterIsMovingToCenter,l=c("SpatialReactionAnimationUtils").getClusterIsLookingAtCenter,m=c("SpatialReactionAnimationUtils").getClusterIsMovingBackTowardCenter,n=c("SpatialReactionAnimationUtils").getDurationsForClusterType,o=Math.floor,p=c("SpatialReactionAnimationConfig").CURVES,q=p.MOVE_TO_CENTER_SCALE,r=p.LOOK_AT_CENTER_SCALE_SELF,s=p.LOOK_AT_CENTER_SCALE_NON_SELF,t=p.MOVE_BACK_TOWARD_CENTER_SCALE;u.prototype.setCluster=function(v){this.$SpatialReactionAnimationScaler1=v};u.prototype.getReactionScale=function(v){__p&&__p();if(!this.$SpatialReactionAnimationScaler1.hasStartedAnimating())throw new Error("Reactions this._cluster with progress: "+this.$SpatialReactionAnimationScaler1.animationProgressFrames+"\n         has not started animating");var w=this.$SpatialReactionAnimationScaler1.isSelfReaction,x=n(this.$SpatialReactionAnimationScaler1,c("SpatialReactionAnimationConfig")),y=this.$SpatialReactionAnimationScaler2(v);if(k(this.$SpatialReactionAnimationScaler1)){var z=x.MOVE_TO_CENTER.FRAMES,A=h(this.$SpatialReactionAnimationScaler1),B=c("SpatialReactionAnimationConfig").SCALES.MOVE_TO_CENTER.MIN,C=c("SpatialReactionAnimationConfig").SCALES.MOVE_TO_CENTER.MAX;return q.solve(A,C,-(C-B),z)}else if(l(this.$SpatialReactionAnimationScaler1)){var D=x.LOOK_AT_CENTER.FRAMES,E=x.SCALE_DOWN.FRAMES,F=i(this.$SpatialReactionAnimationScaler1),G=w?r:s,H=w?c("SpatialReactionAnimationConfig").SCALES.LOOK_AT_CENTER.MIN:c("SpatialReactionAnimationConfig").SCALES.LOOK_AT_CENTER.SELF_MIN,I=x.LOOK_AT_CENTER.MAX_RANDOM_SCALE_DELAY_FRAMES,J=x.LOOK_AT_CENTER.MIN_RANDOM_SCALE_DELAY_FRAMES,K=o(J+v.animationRandomSeed*(I-J)),L=D-K-E;return G.solve(F,H,y-H,D,K,L)}else if(m(this.$SpatialReactionAnimationScaler1)){var M=x.MOVE_BACK_TOWARD_CENTER.FRAMES,N=x.SCALE_DOWN.FRAMES,O=j(this.$SpatialReactionAnimationScaler1),P=c("SpatialReactionAnimationConfig").SCALES.MOVE_BACK_TOWARD_CENTER.MIN,Q=x.MOVE_BACK_TOWARD_CENTER.MAX_RANDOM_SCALE_DELAY_FRAMES,R=o(v.animationRandomSeed*Q),S=M-R-N;return t.solve(O,y,-(y-P),M,R,S)}else throw new Error("Animation config is invalid")};u.prototype.$SpatialReactionAnimationScaler2=function(v){var w=v.positionIndex,x=c("SpatialReactionAnimationConfig").SCALES.LOOK_AT_CENTER;if(v.isFriend)return x.MAX;switch(w){case 0:case 5:return x.MAX;case 1:case 4:return x.MIN;default:return x.MID}};function u(){}f.exports=u}),null);
__d("SpatialReactionCanvasDrawingUtils",[],(function a(b,c,d,e,f,g){__p&&__p();var h=Math.floor,i={clearCanvas:function j(k,l,m){k.clearRect(0,0,l,m)},setShadowBlur:function j(k,l,m,n,o){k.save();k.shadowColor=l;k.shadowBlur=m;k.shadowOffsetX=n;k.shadowOffsetY=o},restoreShadowBlur:function j(k){k.restore()},drawCroppedCircularImage:function j(k,l,m,n,o){var p=2*o,q=m-o,r=n-o;k.save();i.drawCirclePath(k,h(m),h(n),h(o));k.clip();k.drawImage(l,h(q),h(r),h(p),h(p));k.restore()},clipCircle:function j(k,l,m,n){k.save();i.drawCirclePath(k,h(l),h(m),h(n));k.clip()},restoreClip:function j(k){k.restore()},drawSquareImage:function j(k,l,m,n,o){var p=o/2,q=m-p,r=n-p;k.drawImage(l,h(q),h(r),h(o),h(o))},drawScaledImage:function j(k,l,m,n,o,p){var q=o/2,r=p/2,s=m-q,t=n-r;k.drawImage(l,h(s),h(t),h(o),h(p))},drawCirclePath:function j(k,l,m,n){k.beginPath();k.arc(h(l),h(m),h(n),0,Math.PI*2);k.closePath()}};f.exports=i}),null);
__d("SpatialReactionAnimation",["invariant","SpatialReactionAnimationConfig","SpatialReactionAnimationUtils","SpatialReactionCanvasDrawingUtils","SpatialReactionAnimationPositioner","SpatialReactionAnimationScaler","clamp"],(function a(b,c,d,e,f,g,h){"use strict";__p&&__p();var i=c("SpatialReactionAnimationUtils").get2dDiscretePointFromCurrentView,j=Math.max(window.devicePixelRatio||1,1);function k(l){__p&&__p();this.$SpatialReactionAnimation3=false;this.$SpatialReactionAnimation16=function(n){if(n.hasStartedAnimating()){var o=n.animationYaw,p=n.animationPitch;o!==null&&p!==null||h(0);var q=i(o,p,this.$SpatialReactionAnimation6,this.$SpatialReactionAnimation7,this.$SpatialReactionAnimation8,this.$SpatialReactionAnimation4,this.$SpatialReactionAnimation5),r=c("SpatialReactionAnimationConfig").DISTANCES.LOOK_AT_CENTER.NON_SELF.X.PX,s=-r,t=this.$SpatialReactionAnimation4+r;this.$SpatialReactionAnimation17(n,c("clamp")(q.x,s,t),q.y)}}.bind(this);this.$SpatialReactionAnimation1=l;var m=this.$SpatialReactionAnimation1.getContext("2d");this.$SpatialReactionAnimation12=new(c("SpatialReactionAnimationPositioner"))();this.$SpatialReactionAnimation13=new(c("SpatialReactionAnimationScaler"))();if(m){this.$SpatialReactionAnimation2=m;this.$SpatialReactionAnimation14()}else this.$SpatialReactionAnimation3=true}k.prototype.constructedSuccessfully=function(){return!this.$SpatialReactionAnimation3};k.prototype.resizeCanvas=function(l,m){if(l<0||m<0)throw new Error("Canvas cannot be resized to values width: "+l+", height: "+m);this.$SpatialReactionAnimation1.width=l*j;this.$SpatialReactionAnimation1.height=m*j;this.$SpatialReactionAnimation2.scale(j,j)};k.prototype.clearAnimation=function(){this.$SpatialReactionAnimation15()};k.prototype.drawFrame=function(l,m,n,o,p,q,r,s,t){__p&&__p();if(m<=0||n<=0)return;if(s<=this.$SpatialReactionAnimation10)throw new Error("You are trying to draw two frames at once, or a frame in the past");this.$SpatialReactionAnimation11=l;this.$SpatialReactionAnimation4=m;this.$SpatialReactionAnimation5=n;this.$SpatialReactionAnimation6=o;this.$SpatialReactionAnimation7=p;this.$SpatialReactionAnimation8=q;this.$SpatialReactionAnimation9=r;this.$SpatialReactionAnimation10=s;this.$SpatialReactionAnimation15();t.reactionClusters.forEach(this.$SpatialReactionAnimation16)};k.prototype.$SpatialReactionAnimation17=function(l,m,n){this.$SpatialReactionAnimation12.setViewportWidth(this.$SpatialReactionAnimation4).setViewportHeight(this.$SpatialReactionAnimation5).setClusterCenterX(m).setClusterCenterY(n).setCluster(l);this.$SpatialReactionAnimation13.setCluster(l);var o=l.anonymousReactions,p=l.friendReactions,q=function(r){var s=this.$SpatialReactionAnimation12.getReactionPosition(r),t=s.x,u=s.y,v=this.$SpatialReactionAnimation13.getReactionScale(r);this.$SpatialReactionAnimation18(l,r,t,u,v)}.bind(this);if(l.isSelfReaction)q(p.first());else p.union(o).forEach(q)};k.prototype.$SpatialReactionAnimation18=function(l,m,n,o,p){c("SpatialReactionCanvasDrawingUtils").setShadowBlur(this.$SpatialReactionAnimation2,c("SpatialReactionAnimationConfig").SHADOW.COLOR,c("SpatialReactionAnimationConfig").SHADOW.BLUR,c("SpatialReactionAnimationConfig").SHADOW.OFFSET_X,c("SpatialReactionAnimationConfig").SHADOW.OFFSET_Y);this.$SpatialReactionAnimation19.apply(this,arguments);c("SpatialReactionCanvasDrawingUtils").restoreShadowBlur(this.$SpatialReactionAnimation2);this.$SpatialReactionAnimation20(n,o,c("SpatialReactionAnimationUtils").getReactionRadius(p));this.$SpatialReactionAnimation21.apply(this,arguments);this.$SpatialReactionAnimation22();this.$SpatialReactionAnimation20(n,o,c("SpatialReactionAnimationUtils").getProfilePictureRadius(p));this.$SpatialReactionAnimation23.apply(this,arguments);this.$SpatialReactionAnimation22()};k.prototype.$SpatialReactionAnimation23=function(l,m,n,o,p){var q=c("SpatialReactionAnimationUtils").getReactionBaseSize,r=c("SpatialReactionAnimationUtils").getReactionProfilePictureOffset,s=m.isFriend,t=m.profilePictureURI;if(s&&t){var u=this.$SpatialReactionAnimation11.getFriendImage(t),v=q(p),w=r(l,m);this.$SpatialReactionAnimation24(u,n-w,o,v)}};k.prototype.$SpatialReactionAnimation19=function(l,m,n,o,p){var q=m.reactionType,r=this.$SpatialReactionAnimation11.getReactionBaseImage(q),s=c("SpatialReactionAnimationUtils").getReactionBaseSize(p);this.$SpatialReactionAnimation24(r,n,o,s)};k.prototype.$SpatialReactionAnimation21=function(l,m,n,o,p){var q=m.reactionType,r=m.isFriend,s=m.profilePictureURI,t=this.$SpatialReactionAnimation11.getReactionFaceImage(q),u=c("SpatialReactionAnimationUtils").getReactionFaceDimensions(l,m,p),v=c("SpatialReactionAnimationUtils").getReactionFaceOffset(l,m);if(r&&s)v+=c("SpatialReactionAnimationUtils").getReactionFaceFlipOutOffset(l,m);this.$SpatialReactionAnimation25(t,n+v,o,u.x,u.y)};k.prototype.$SpatialReactionAnimation15=function(){c("SpatialReactionCanvasDrawingUtils").clearCanvas(this.$SpatialReactionAnimation2,this.$SpatialReactionAnimation4,this.$SpatialReactionAnimation5)};k.prototype.$SpatialReactionAnimation14=function(){this.$SpatialReactionAnimation2.mozImageSmoothingEnabled=false;this.$SpatialReactionAnimation2.imageSmoothingEnabled=false};k.prototype.$SpatialReactionAnimation24=function(l,m,n,o){c("SpatialReactionCanvasDrawingUtils").drawSquareImage.apply(c("SpatialReactionCanvasDrawingUtils"),[this.$SpatialReactionAnimation2].concat(Array.prototype.slice.call(arguments)))};k.prototype.$SpatialReactionAnimation25=function(l,m,n,o,p){c("SpatialReactionCanvasDrawingUtils").drawScaledImage.apply(c("SpatialReactionCanvasDrawingUtils"),[this.$SpatialReactionAnimation2].concat(Array.prototype.slice.call(arguments)))};k.prototype.$SpatialReactionAnimation20=function(l,m,n){c("SpatialReactionCanvasDrawingUtils").clipCircle(this.$SpatialReactionAnimation2,l,m,n)};k.prototype.$SpatialReactionAnimation22=function(){c("SpatialReactionCanvasDrawingUtils").restoreClip(this.$SpatialReactionAnimation2)};f.exports=k}),null);
__d("FenwickTree",["idx"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();var h=function h(j){return j&-j};function i(j,k){var l;j=((l=k)!=null?l.length:l)||j;this.$FenwickTree1=new Array(j).fill(0);if(k)for(var m=0;m<j;++m)this.add(m,k[m])}i.prototype.add=function(j,k){for(;j<this.$FenwickTree1.length;j+=h(j+1))this.$FenwickTree1[j]+=k};i.prototype.get=function(j){return this.rangeSum(j,j+1)};i.prototype.set=function(j,k){var l=this.get(j);if(k!==l)this.add(j,k-l)};i.prototype.prefixSum=function(j){var k=0;for(;j>0;j-=h(j))k+=this.$FenwickTree1[j-1];return k};i.prototype.rangeSum=function(j,k){var l=0;for(;k>j;k-=h(k))l+=this.$FenwickTree1[k-1];for(;j>k;j-=h(j))l-=this.$FenwickTree1[j-1];return l};f.exports=i}),null);
__d("SpatialReactionRequestIntervalTracker",["FenwickTree"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();var h=1;function i(j,k,l){this.$SpatialReactionRequestIntervalTracker2=k;this.$SpatialReactionRequestIntervalTracker3=l;var m=Math.ceil(Math.ceil(j)/h);this.$SpatialReactionRequestIntervalTracker1=new(c("FenwickTree"))(m)}i.prototype.recordInterval=function(j){var k=this.$SpatialReactionRequestIntervalTracker4(j),l=this.$SpatialReactionRequestIntervalTracker4(this.$SpatialReactionRequestIntervalTracker5(j));if(this.$SpatialReactionRequestIntervalTracker1)while(k<l)this.$SpatialReactionRequestIntervalTracker1.set(k++,1)};i.prototype.shouldFetchInterval=function(j){var k=this.$SpatialReactionRequestIntervalTracker4(j),l=this.$SpatialReactionRequestIntervalTracker4(this.$SpatialReactionRequestIntervalTracker5(j));if(this.$SpatialReactionRequestIntervalTracker1.get(k)<1)return true;return this.$SpatialReactionRequestIntervalTracker1.rangeSum(k,l)+(this.$SpatialReactionRequestIntervalTracker2-this.$SpatialReactionRequestIntervalTracker3)/h<=l-k};i.prototype.getIntervalSum=function(j){var k=this.$SpatialReactionRequestIntervalTracker4(j),l=this.$SpatialReactionRequestIntervalTracker4(this.$SpatialReactionRequestIntervalTracker5(j));return this.$SpatialReactionRequestIntervalTracker1.rangeSum(k,l)};i.prototype.$SpatialReactionRequestIntervalTracker4=function(j){return Math.floor(j/h)};i.prototype.$SpatialReactionRequestIntervalTracker5=function(j){return j+this.$SpatialReactionRequestIntervalTracker2};f.exports=i}),null);
__d("SpatialReactionsFetcherVOD",["Promise","AsyncRequest","SpatialReactionRequestIntervalTracker","XVODStreamingReactionsAsyncController","compose","SpatialReactionsUtils"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();var h=c("SpatialReactionsUtils").processServerReactionsPayloads,i=15,j=5;function k(l){this.$SpatialReactionsFetcherVOD4=l;this.$SpatialReactionsFetcherVOD1=null;this.$SpatialReactionsFetcherVOD2=null;this.$SpatialReactionsFetcherVOD3=-1}k.prototype.fetchNewReactionsIfNeeded=function(l){l=Math.floor(l);if(this.$SpatialReactionsFetcherVOD5(l))return this.$SpatialReactionsFetcherVOD6(l);else return new(c("Promise"))(function(m,n){return m(null)})};k.prototype.trackIntervals=function(l){this.$SpatialReactionsFetcherVOD2=new(c("SpatialReactionRequestIntervalTracker"))(l,i,j);if(this.$SpatialReactionsFetcherVOD3>0)this.$SpatialReactionsFetcherVOD7(this.$SpatialReactionsFetcherVOD3)};k.prototype.isTrackingIntervals=function(){return this.$SpatialReactionsFetcherVOD2!==null};k.prototype.$SpatialReactionsFetcherVOD6=function(l){return new(c("Promise"))(function(m,n){var o=c("compose")(m,this.$SpatialReactionsFetcherVOD8),p=function(){this.$SpatialReactionsFetcherVOD1=null}.bind(this),q=function(s){this.$SpatialReactionsFetcherVOD7(l);o(s)}.bind(this),r=this.$SpatialReactionsFetcherVOD9(l).setHandler(q).setFinallyHandler(p);this.$SpatialReactionsFetcherVOD1=r;r.send()}.bind(this))};k.prototype.$SpatialReactionsFetcherVOD9=function(l){var m=new(c("AsyncRequest"))(),n=c("XVODStreamingReactionsAsyncController").getURIBuilder().setString("eft_id",this.$SpatialReactionsFetcherVOD4).setFloat("start_time",l).setFloat("end_time",l+i).getURI();m.setURI(n);return m};k.prototype.$SpatialReactionsFetcherVOD8=function(l){var m=l.getPayload();if(m.reactionpayloads)return h(m.reactionpayloads);else return null};k.prototype.$SpatialReactionsFetcherVOD5=function(l){if(this.$SpatialReactionsFetcherVOD1!==null)return false;if(!this.$SpatialReactionsFetcherVOD2)return this.$SpatialReactionsFetcherVOD3<0;else return this.$SpatialReactionsFetcherVOD2.shouldFetchInterval(l)};k.prototype.$SpatialReactionsFetcherVOD7=function(l){this.$SpatialReactionsFetcherVOD3=l;if(this.$SpatialReactionsFetcherVOD2)this.$SpatialReactionsFetcherVOD2.recordInterval(l)};f.exports=k}),null);
__d("SpatialReactionsFetcherLive",["SphericalVideoComponentActions","ChannelManager","FeedbackAddStreamingReactionSubscription","immutable","SpatialReactionCluster","SpatialReactionsUtils"],(function a(b,c,d,e,f,g){"use strict";__p&&__p();function h(i,j){__p&&__p();this.$SpatialReactionsFetcherLive7=function(k){var l=k.feedback_add_streaming_reaction_subscribe;this.$SpatialReactionsFetcherLive4=l.regional_spatial_reaction_counts;if(this.$SpatialReactionsFetcherLive5>-1)this.$SpatialReactionsFetcherLive8(c("SpatialReactionsUtils").getFriendReaction(k))}.bind(this);this.$SpatialReactionsFetcherLive1=i;this.$SpatialReactionsFetcherLive3=c("immutable").Map();this.$SpatialReactionsFetcherLive4=[];this.$SpatialReactionsFetcherLive5=-1;this.$SpatialReactionsFetcherLive6=j}h.prototype.subscribeToReactions=function(){this.$SpatialReactionsFetcherLive2=c("FeedbackAddStreamingReactionSubscription").subscribe(this.$SpatialReactionsFetcherLive1,this.$SpatialReactionsFetcherLive7)};h.prototype.unsubscribeToReactions=function(){this.$SpatialReactionsFetcherLive2&&this.$SpatialReactionsFetcherLive2.unsubscribe()};h.prototype.updateStateTime=function(i){this.$SpatialReactionsFetcherLive5=i};h.prototype.$SpatialReactionsFetcherLive8=function(i){var j=c("SpatialReactionsUtils").fetchNewLiveReactions(this.$SpatialReactionsFetcherLive5,this.$SpatialReactionsFetcherLive3,this.$SpatialReactionsFetcherLive4,i);this.$SpatialReactionsFetcherLive3=c("SpatialReactionsUtils").updateReactionRegionMap(this.$SpatialReactionsFetcherLive4,this.$SpatialReactionsFetcherLive3);if(j)c("SphericalVideoComponentActions").addSpatialReactionClusters(this.$SpatialReactionsFetcherLive6,j)};f.exports=h}),null);
__d("SphericalVideoSpatialReactionsContainer",["invariant","SphericalVideoComponentActions","SpatialReactionAnimation","SpatialReactionsConsumptionStore","SpatialReactionsFetcherVOD","SpatialReactionsFetcherLive","SpatialReactionsImageCache","SphericalVideoComponent","SphericalViewportControlStore","VideoPlayerControllerStore","SpatialReactionExperimentsStore","curry","requestAnimationFrame","cancelAnimationFrame"],(function a(b,c,d,e,f,g,h){"use strict";__p&&__p();var i,j;i=babelHelpers.inherits(k,c("SphericalVideoComponent"));j=i&&i.prototype;function k(l,m,n,o,p,q,r){__p&&__p();j.constructor.call(this,m);this.$SphericalVideoSpatialReactionsContainer14=function(s,t){var u=this.state,v=u.viewportWidth,w=u.viewportHeight,x=u.viewportYaw,y=u.viewportPitch,z=u.viewportFieldOfView,A=u.spatialReactionsState,B=u.videoCurrentTime;if(this.state.videoIsPlaying)c("SphericalVideoComponentActions").startAnimationForFrame(s,B,x,y,z,v,w);A&&this.$SphericalVideoSpatialReactionsContainer1||h(0);this.$SphericalVideoSpatialReactionsContainer1.drawFrame(c("SpatialReactionsImageCache"),v,w,x,y,z,B,t,A);c("SphericalVideoComponentActions").tickAnimation(s);this.$SphericalVideoSpatialReactionsContainer6=c("requestAnimationFrame")(c("curry")(this.$SphericalVideoSpatialReactionsContainer14,s))}.bind(this);this.$SphericalVideoSpatialReactionsContainer4=l;this.$SphericalVideoSpatialReactionsContainer5=n;this.$SphericalVideoSpatialReactionsContainer7=o;this.$SphericalVideoSpatialReactionsContainer9=r;this.$SphericalVideoSpatialReactionsContainer8=q;c("SphericalVideoComponentActions").registerExperimentConfig(this.id,p);c("SphericalVideoComponentActions").registerNewSpatialReactionsState(this.id);c("SphericalVideoComponentActions").setInitialViewport(this.id,o.initialHeading,o.initialPitch)}k.prototype.getInitialState=function(l){var m=c("VideoPlayerControllerStore").getState().get("videoPlayerControllerStates").get(l),n=m.currentTime,o=m.durationSeconds,p=c("SphericalViewportControlStore").getState().get("sphericalViewportControlStates").get(l),q=p.yaw,r=p.pitch,s=p.fieldOfView,t=p.viewportWidth,u=p.viewportHeight,v=p.isInTahoe,w=p.isInChannelView,x=c("SpatialReactionsConsumptionStore").getSpatialReactionsState(l),y=c("SpatialReactionExperimentsStore").shouldDisableReactions(l);return{isInFeed:!v&&!w,spatialReactionsState:x,videoCurrentTime:n,videoDurationSeconds:o,videoIsPlaying:c("VideoPlayerControllerStore").getIsPlaying(l),videoIsPlayable:c("VideoPlayerControllerStore").getIsVideoPlayable(l),viewportFieldOfView:s,viewportHeight:u,viewportPitch:r,viewportWidth:t,viewportYaw:q,disableReactions:y}};k.prototype.calculateState=function(l){return this.getInitialState(this.id)};k.prototype.onStateChange=function(l,m){__p&&__p();var n=this.$SphericalVideoSpatialReactionsContainer1,o=m.viewportWidth,p=m.viewportHeight,q=m.videoCurrentTime,r=m.videoIsPlayable,s=m.videoDurationSeconds,t=m.spatialReactionsState,u=m.isInFeed,v=m.disableReactions;if(r&&!n&&u&&!v)this.$SphericalVideoSpatialReactionsContainer10();else if(!r&&n||!u&&n)this.$SphericalVideoSpatialReactionsContainer11();if(n&&t){if(s>0&&!this.$SphericalVideoSpatialReactionsContainer9&&this.$SphericalVideoSpatialReactionsContainer2&&!this.$SphericalVideoSpatialReactionsContainer2.isTrackingIntervals())this.$SphericalVideoSpatialReactionsContainer2.trackIntervals(s);if(this.$SphericalVideoSpatialReactionsContainer12(l,m))n.resizeCanvas(o,p);if(l.videoCurrentTime!==q)if(this.$SphericalVideoSpatialReactionsContainer9&&this.$SphericalVideoSpatialReactionsContainer3)this.$SphericalVideoSpatialReactionsContainer3.updateStateTime(q);else if(this.$SphericalVideoSpatialReactionsContainer2)this.$SphericalVideoSpatialReactionsContainer13(this.id,this.$SphericalVideoSpatialReactionsContainer2,q)}};k.prototype.$SphericalVideoSpatialReactionsContainer10=function(){__p&&__p();var l=new(c("SpatialReactionAnimation"))(this.$SphericalVideoSpatialReactionsContainer4);if(l.constructedSuccessfully()){this.$SphericalVideoSpatialReactionsContainer1=l;this.$SphericalVideoSpatialReactionsContainer1.resizeCanvas(this.state.viewportWidth,this.state.viewportHeight);if(this.$SphericalVideoSpatialReactionsContainer9){this.$SphericalVideoSpatialReactionsContainer3=new(c("SpatialReactionsFetcherLive"))(this.$SphericalVideoSpatialReactionsContainer8,this.id);this.$SphericalVideoSpatialReactionsContainer3.subscribeToReactions()}else{this.$SphericalVideoSpatialReactionsContainer2=new(c("SpatialReactionsFetcherVOD"))(c("VideoPlayerControllerStore").getVideoID(this.id));this.$SphericalVideoSpatialReactionsContainer13(this.id,this.$SphericalVideoSpatialReactionsContainer2,0)}c("SpatialReactionsImageCache").loadStaticImages(this.$SphericalVideoSpatialReactionsContainer5).then(function(){return this.$SphericalVideoSpatialReactionsContainer6=c("requestAnimationFrame")(c("curry")(this.$SphericalVideoSpatialReactionsContainer14,this.id))}.bind(this)).done()}};k.prototype.$SphericalVideoSpatialReactionsContainer11=function(){c("cancelAnimationFrame")(this.$SphericalVideoSpatialReactionsContainer6);if(this.$SphericalVideoSpatialReactionsContainer1){this.$SphericalVideoSpatialReactionsContainer1.clearAnimation();this.$SphericalVideoSpatialReactionsContainer1=null}if(this.$SphericalVideoSpatialReactionsContainer9&&this.$SphericalVideoSpatialReactionsContainer3)this.$SphericalVideoSpatialReactionsContainer3.unsubscribeToReactions()};k.prototype.$SphericalVideoSpatialReactionsContainer13=function(l,m,n){m.fetchNewReactionsIfNeeded(n).then(function(o){if(o)c("SphericalVideoComponentActions").addSpatialReactionClusters(l,o)}).done()};k.prototype.$SphericalVideoSpatialReactionsContainer12=function(l,m){return m.viewportWidth>0&&m.viewportHeight>0&&(l.viewportWidth!==m.viewportWidth||l.viewportHeight!==m.viewportHeight)};f.exports=k}),null);