1"use strict";(self.webpackChunkpolygon_web_ordering=self.webpackChunkpolygon_web_ordering||[]).push([[53],{35053:function(t,e,i){i.r(e),i.d(e,{GoogleCastProvider:function(){return Ct}});var a=i(74165),s=i(15861),n=i(4942),r=i(37762),h=i(15671),o=i(43144),l=i(40101),u=i(72346),c=i(43889),Z=i(86033),d=i(13092),v=i(56906),f=i(20995),k=i(58042),p=(i(72791),new WeakMap),y=new WeakSet,w=function(){function t(e){(0,h.Z)(this,t),(0,l.Z)(this,y),(0,u.Z)(this,p,{writable:!0,value:void 0}),(0,d.Z)(this,p,new chrome.cast.media.MediaInfo(e.src,e.type))}return(0,o.Z)(t,[{key:"build",value:function(){return(0,Z.Z)(this,p)}},{key:"setStreamType",value:function(t){return t.includes("live")?(0,Z.Z)(this,p).streamType=chrome.cast.media.StreamType.LIVE:(0,Z.Z)(this,p).streamType=chrome.cast.media.StreamType.BUFFERED,this}},{key:"setTracks",value:function(t){return(0,Z.Z)(this,p).tracks=t.map((0,c.Z)(this,y,m)),this}},{key:"setMetadata",value:function(t,e){return(0,Z.Z)(this,p).metadata=new chrome.cast.media.GenericMediaMetadata,(0,Z.Z)(this,p).metadata.title=t,(0,Z.Z)(this,p).metadata.images=[{url:e}],this}}]),t}();function m(t,e){var i=new chrome.cast.media.Track(e,chrome.cast.media.TrackType.TEXT);return i.name=t.label,i.trackContentId=t.src,i.trackContentType="text/vtt",i.language=t.language,i.subtype=t.kind.toUpperCase(),i}var S=chrome.cast.media.TrackType.TEXT,T=chrome.cast.media.TrackType.AUDIO,g=new WeakMap,E=new WeakMap,b=new WeakMap,C=new WeakSet,W=new WeakSet,M=new WeakSet,L=new WeakSet,A=new WeakSet,I=new WeakSet,_=new WeakSet,D=new WeakSet,x=function(){function t(e,i,a){(0,h.Z)(this,t),(0,l.Z)(this,D),(0,l.Z)(this,_),(0,l.Z)(this,I),(0,l.Z)(this,A),(0,l.Z)(this,L),(0,l.Z)(this,M),(0,l.Z)(this,W),(0,l.Z)(this,C),(0,u.Z)(this,g,{writable:!0,value:void 0}),(0,u.Z)(this,E,{writable:!0,value:void 0}),(0,u.Z)(this,b,{writable:!0,value:void 0}),(0,d.Z)(this,g,e),(0,d.Z)(this,E,i),(0,d.Z)(this,b,a)}return(0,o.Z)(t,[{key:"setup",value:function(){var t=this.syncRemoteActiveIds.bind(this);(0,v.listenEvent)((0,Z.Z)(this,E).audioTracks,"change",t),(0,v.listenEvent)((0,Z.Z)(this,E).textTracks,"mode-change",t),(0,v.effect)((0,c.Z)(this,L,G).bind(this))}},{key:"getLocalTextTracks",value:function(){return(0,Z.Z)(this,E).$state.textTracks().filter((function(t){return t.src&&"vtt"===t.type}))}},{key:"syncRemoteTracks",value:function(t){if((0,Z.Z)(this,g).isMediaLoaded){var e,i=(0,c.Z)(this,C,N).call(this),a=this.getLocalTextTracks(),s=(0,c.Z)(this,W,O).call(this,T),n=(0,c.Z)(this,W,O).call(this,S),h=(0,r.Z)(s);try{for(h.s();!(e=h.n()).done;){var o,l=e.value;if(!(0,c.Z)(this,I,$).call(this,i,l)){var u={id:l.trackId.toString(),label:l.name,language:l.language,kind:null!==(o=l.subtype)&&void 0!==o?o:"main",selected:!1};(0,Z.Z)(this,E).audioTracks[f.HV.add](u,t)}}}catch(y){h.e(y)}finally{h.f()}var d,v=(0,r.Z)(n);try{for(v.s();!(d=v.n()).done;){var k=d.value;if(!(0,c.Z)(this,I,$).call(this,a,k)){var p={id:k.trackId.toString(),src:k.trackContentId,label:k.name,language:k.language,kind:k.subtype.toLowerCase()};(0,Z.Z)(this,E).textTracks.add(p,t)}}}catch(y){v.e(y)}finally{v.f()}}}},{key:"syncRemoteActiveIds",value:function(t){if((0,Z.Z)(this,g).isMediaLoaded){var e=(0,c.Z)(this,M,P).call(this),i=new chrome.cast.media.EditTracksInfoRequest(e);(0,c.Z)(this,A,R).call(this,i).catch((function(t){}))}}}]),t}();function N(){return(0,Z.Z)(this,E).$state.audioTracks()}function O(t){var e,i,a=null!==(e=null===(i=(0,Z.Z)(this,g).mediaInfo)||void 0===i?void 0:i.tracks)&&void 0!==e?e:[];return t?a.filter((function(e){return e.type===t})):a}function P(){var t=[],e=(0,c.Z)(this,C,N).call(this).find((function(t){return t.selected})),i=this.getLocalTextTracks().filter((function(t){return"showing"===t.mode}));if(e){var a=(0,c.Z)(this,W,O).call(this,T),s=(0,c.Z)(this,_,V).call(this,a,e);s&&t.push(s.trackId)}if(null!==i&&void 0!==i&&i.length){var n=(0,c.Z)(this,W,O).call(this,S);if(n.length){var h,o=(0,r.Z)(i);try{for(o.s();!(h=o.n()).done;
1){var l=h.value,u=(0,c.Z)(this,_,V).call(this,n,l);u&&t.push(u.trackId)}}catch(Z){o.e(Z)}finally{o.f()}}}return t}function G(){var t=this,e=this.getLocalTextTracks();if((0,Z.Z)(this,g).isMediaLoaded){var i,a=(0,c.Z)(this,W,O).call(this,S),s=(0,r.Z)(e);try{for(s.s();!(i=s.n()).done;){var n=i.value;if(!(0,c.Z)(this,_,V).call(this,a,n)){(0,v.untrack)((function(){var e;return null===(e=(0,Z.Z)(t,b))||void 0===e?void 0:e.call(t)}));break}}}catch(h){s.e(h)}finally{s.f()}}}function R(t){var e=(0,k.getCastSessionMedia)();return new Promise((function(i,a){return null===e||void 0===e?void 0:e.editTracksInfo(t,i,a)}))}function $(t,e){var i=this;return t.find((function(t){return(0,c.Z)(i,D,H).call(i,t,e)}))}function V(t,e){var i=this;return t.find((function(t){return(0,c.Z)(i,D,H).call(i,e,t)}))}function H(t,e){return e.name===t.label&&e.language===t.language&&e.subtype.toLowerCase()===t.kind.toLowerCase()}var U=new WeakMap,F=new WeakMap,B=new WeakMap,K=new WeakMap,Y=new WeakMap,q=new WeakMap,X=new WeakMap,j=new WeakMap,z=new WeakMap,J=new WeakMap,Q=new WeakMap,tt=new WeakMap,et=new WeakSet,it=new WeakSet,at=new WeakSet,st=new WeakSet,nt=new WeakSet,rt=new WeakSet,ht=new WeakSet,ot=new WeakSet,lt=new WeakSet,ut=new WeakSet,ct=new WeakSet,Zt=new WeakSet,dt=new WeakSet,vt=new WeakSet,ft=new WeakSet,kt=new WeakSet,pt=new WeakSet,yt=new WeakSet,wt=new WeakSet,mt=new WeakSet,St=new WeakSet,Tt=new WeakSet,gt=new WeakSet,Et=new WeakSet,bt=new WeakSet,Ct=function(){function t(e,i){(0,h.Z)(this,t),(0,l.Z)(this,bt),(0,l.Z)(this,Et),(0,l.Z)(this,gt),(0,l.Z)(this,Tt),(0,l.Z)(this,St),(0,l.Z)(this,mt),(0,l.Z)(this,wt),(0,l.Z)(this,yt),(0,l.Z)(this,pt),(0,l.Z)(this,kt),(0,l.Z)(this,ft),(0,l.Z)(this,vt),(0,l.Z)(this,dt),(0,l.Z)(this,Zt),(0,l.Z)(this,ct),(0,l.Z)(this,ut),(0,l.Z)(this,lt),(0,l.Z)(this,ot),(0,l.Z)(this,ht),(0,l.Z)(this,rt),(0,l.Z)(this,nt),(0,l.Z)(this,st),(0,l.Z)(this,at),(0,l.Z)(this,it),(0,l.Z)(this,et),(0,n.Z)(this,"$$PROVIDER_TYPE","GOOGLE_CAST"),(0,n.Z)(this,"scope",(0,v.createScope)()),(0,u.Z)(this,U,{writable:!0,value:void 0}),(0,u.Z)(this,F,{writable:!0,value:void 0}),(0,u.Z)(this,B,{writable:!0,value:void 0}),(0,u.Z)(this,K,{writable:!0,value:null}),(0,u.Z)(this,Y,{writable:!0,value:"disconnected"}),(0,u.Z)(this,q,{writable:!0,value:0}),(0,u.Z)(this,X,{writable:!0,value:0}),(0,u.Z)(this,j,{writable:!0,value:new f.tn(0,0)}),(0,u.Z)(this,z,{writable:!0,value:new f.LK((0,c.Z)(this,ht,Dt).bind(this))}),(0,u.Z)(this,J,{writable:!0,value:void 0}),(0,u.Z)(this,Q,{writable:!0,value:null}),(0,u.Z)(this,tt,{writable:!0,value:!1}),(0,d.Z)(this,U,e),(0,d.Z)(this,F,i),(0,d.Z)(this,B,new x(e,i,(0,c.Z)(this,bt,Jt).bind(this)))}return(0,o.Z)(t,[{key:"type",get:function(){return"google-cast"}},{key:"currentSrc",get:function(){return(0,Z.Z)(this,K)}},{key:"player",get:function(){return(0,Z.Z)(this,U)}},{key:"cast",get:function(){return(0,k.getCastContext)()}},{key:"session",get:function(){return(0,k.getCastSession)()}},{key:"media",get:function(){return(0,k.getCastSessionMedia)()}},{key:"hasActiveSession",get:function(){return(0,k.hasActiveCastSession)((0,Z.Z)(this,K))}},{key:"setup",value:function(){(0,c.Z)(this,et,Wt).call(this),(0,c.Z)(this,it,Mt).call(this),(0,Z.Z)(this,B).setup(),(0,Z.Z)(this,F).notify("provider-setup",this)}},{key:"play",value:function(){var t=(0,s.Z)((0,a.Z)().mark((function t(){var e;return(0,a.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((0,Z.Z)(this,U).isPaused||(0,Z.Z)(this,tt)){t.next=2;break}return t.abrupt("return");case 2:if(!(0,Z.Z)(this,tt)){t.next=6;break}return t.next=5,(0,c.Z)(this,Et,jt).call(this,!1,0);case 5:return t.abrupt("return");case 6:null===(e=(0,Z.Z)(this,U).controller)||void 0===e||e.playOrPause();case 7:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"pause",value:function(){var t=(0,s.Z)((0,a.Z)().mark((function t(){var e;return(0,a.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(0,Z.Z)(this,U).isPaused){t.next=2;break}return t.abrupt("return");case 2:null===(e=(0,Z.Z)(this,U).controller)||void 0===e||e.playOrPause();case 3:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"getMediaStatus",value:function(t){var e=this;return new Promise((function(i,a){var s;null===(s=e.media)||void 0===s||s.getStatus(t,i,a)}))}},{key:"setMuted",value:function(t){var e;(t&&!(0,Z.Z)(this,U).isMuted||!t&&(0,Z.Z)(this,U).isMuted)&&(null===(e=(0,Z.Z)(this,U).controller)||void 0===e||e.muteOr
1Unmute())}},{key:"setCurrentTime",value:function(t){var e;(0,Z.Z)(this,U).currentTime=t,(0,Z.Z)(this,F).notify("seeking",t),null===(e=(0,Z.Z)(this,U).controller)||void 0===e||e.seek()}},{key:"setVolume",value:function(t){var e;(0,Z.Z)(this,U).volumeLevel=t,null===(e=(0,Z.Z)(this,U).controller)||void 0===e||e.setVolumeLevel()}},{key:"loadSource",value:function(){var t=(0,s.Z)((0,a.Z)().mark((function t(e){var i,s,n;return(0,a.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((null===(i=(0,Z.Z)(this,Q))||void 0===i?void 0:i.src)!==e&&(0,d.Z)(this,Q,null),!(0,k.hasActiveCastSession)(e)){t.next=5;break}return(0,c.Z)(this,st,At).call(this),(0,d.Z)(this,K,e),t.abrupt("return");case 5:return(0,Z.Z)(this,F).notify("load-start"),s=(0,c.Z)(this,gt,Xt).call(this,e),t.next=9,this.session.loadMedia(s);case 9:if(!(n=t.sent)){t.next=14;break}return(0,d.Z)(this,K,null),(0,Z.Z)(this,F).notify("error",Error((0,k.getCastErrorMessage)(n))),t.abrupt("return");case 14:(0,d.Z)(this,K,e);case 15:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"destroy",value:function(){(0,c.Z)(this,at,Lt).call(this),(0,c.Z)(this,nt,It).call(this)}}]),t}();function Wt(){(0,k.listenCastContextEvent)(cast.framework.CastContextEventType.CAST_STATE_CHANGED,(0,c.Z)(this,lt,Nt).bind(this))}function Mt(){var t,e=this,i=cast.framework.RemotePlayerEventType,a=(t={},(0,n.Z)(t,i.IS_CONNECTED_CHANGED,(0,c.Z)(this,lt,Nt)),(0,n.Z)(t,i.IS_MEDIA_LOADED_CHANGED,(0,c.Z)(this,ut,Ot)),(0,n.Z)(t,i.CAN_CONTROL_VOLUME_CHANGED,(0,c.Z)(this,ct,Pt)),(0,n.Z)(t,i.CAN_SEEK_CHANGED,(0,c.Z)(this,Zt,Gt)),(0,n.Z)(t,i.DURATION_CHANGED,(0,c.Z)(this,ft,Vt)),(0,n.Z)(t,i.IS_MUTED_CHANGED,(0,c.Z)(this,kt,Ht)),(0,n.Z)(t,i.VOLUME_LEVEL_CHANGED,(0,c.Z)(this,kt,Ht)),(0,n.Z)(t,i.IS_PAUSED_CHANGED,(0,c.Z)(this,pt,Ut)),(0,n.Z)(t,i.LIVE_SEEKABLE_RANGE_CHANGED,(0,c.Z)(this,yt,Ft)),(0,n.Z)(t,i.PLAYER_STATE_CHANGED,(0,c.Z)(this,wt,Bt)),t);(0,d.Z)(this,J,a);var s,h=(0,c.Z)(this,ot,xt).bind(this),o=(0,r.Z)((0,v.keysOf)(a));try{for(o.s();!(s=o.n()).done;){var l=s.value;(0,Z.Z)(this,U).controller.addEventListener(l,h)}}catch(u){o.e(u)}finally{o.f()}(0,v.onDispose)((function(){var t,i=(0,r.Z)((0,v.keysOf)(a));try{for(i.s();!(t=i.n()).done;){var s=t.value;(0,Z.Z)(e,U).controller.removeEventListener(s,h)}}catch(u){i.e(u)}finally{i.f()}}))}function Lt(){(0,Z.Z)(this,Q)||((0,d.Z)(this,X,0),(0,d.Z)(this,j,new f.tn(0,0))),(0,Z.Z)(this,z).stop(),(0,d.Z)(this,q,0),(0,d.Z)(this,Q,null)}function At(){var t,e=new v.DOMEvent("resume-session",{detail:this.session});(0,c.Z)(this,ut,Ot).call(this,e);var i=(0,Z.Z)(this,F).$state,a=i.muted,s=i.volume,n=(0,i.savedState)();this.setCurrentTime(Math.max((0,Z.Z)(this,U).currentTime,null!==(t=null===n||void 0===n?void 0:n.currentTime)&&void 0!==t?t:0)),this.setMuted(a()),this.setVolume(s()),!1===(null===n||void 0===n?void 0:n.paused)&&this.play()}function It(){this.cast.endCurrentSession(!0),(0,Z.Z)(this,F).$state.remotePlaybackLoader.set(null)}function _t(){(0,Z.Z)(this,F).$state.savedState.set({paused:(0,Z.Z)(this,U).isPaused,currentTime:(0,Z.Z)(this,U).currentTime}),(0,c.Z)(this,nt,It).call(this)}function Dt(){(0,c.Z)(this,vt,$t).call(this)}function xt(t){(0,Z.Z)(this,J)[t.type].call(this,t)}function Nt(t){var e=this.cast.getCastState(),i=e===cast.framework.CastState.CONNECTED?"connected":e===cast.framework.CastState.CONNECTING?"connecting":"disconnected";if((0,Z.Z)(this,Y)!==i){var a={type:"google-cast",state:i},s=(0,c.Z)(this,St,Yt).call(this,t);(0,d.Z)(this,Y,i),(0,Z.Z)(this,F).notify("remote-playback-change",a,s),"disconnected"===i&&(0,c.Z)(this,rt,_t).call(this)}}function Ot(t){var e=this;if(!!(0,Z.Z)(this,U).isMediaLoaded){var i=(0,v.peek)((0,Z.Z)(this,F).$state.source);Promise.resolve().then((function(){if(i===(0,v.peek)((0,Z.Z)(e,F).$state.source)&&(0,Z.Z)(e,U).isMediaLoaded){(0,c.Z)(e,at,Lt).call(e);var a=(0,Z.Z)(e,U).duration;(0,d.Z)(e,j,new f.tn(0,a));var s={provider:e,duration:a,buffered:new f.tn(0,0),seekable:(0,c.Z)(e,mt,Kt).call(e)},n=(0,c.Z)(e,St,Yt).call(e,t);(0,Z.Z)(e,F).notify("loaded-metadata",void 0,n),(0,Z.Z)(e,F).notify("loaded-data",void 0,n),(0,Z.Z)(e,F).notify("can-play",s,n),(0,c.Z)(e,ct,Pt).call(e),(0,c.Z)(e,Zt,Gt).call(e,t);var r=(0,Z.Z)(e,F).$state,h=r.volume,o=r.muted;e.setVolume(h()),e.setMuted(o()),(0,Z.Z)(e,z).start(),(0,Z.Z)(e,B).syncRemoteTracks(n),(0,Z.Z)(e,B).syncRemoteActiveIds(n)}}))}}function Pt(){(0,Z.Z)(this,F).$state.canSetVolume.set((0,Z.Z)(this,U).canControlVolume)}function Gt(t){var e=(0,c.Z)(this,St,Yt).call(this,t);(0,Z.Z)(this,F).notify("stream-type-change",(0,c.Z)(this,dt,Rt).call(this),e)}function Rt(){var t;return(null===(t=(0,Z.Z)(this,U).mediaInfo)||void 0===t?void 0:t.streamType)===chrome.cast.media.StreamType.LIVE?(0,Z.Z)(this,U).canSeek?"live:dvr":"live":"on-demand"}function $t(){if(!(0,Z.Z)(this,Q)){var t=(0,Z.Z)(this,U).currentTime;t!==(0,Z.Z)(this,q)&&((0,Z.Z)(this,F).notify("time-change",t),t>(0,Z.Z)(this,X)&&((0,d.Z)(this,X,t),(0,c.Z)(this,yt,Ft).call(this)),(0,Z.Z)(this,F).$state.seeking()&&(0,Z.Z)(this,F).notify("seeked",t),(0,d.Z)(this,q,t))}}function Vt(t){if((0,Z.Z)(this,U).isMediaLoaded&&!(0,Z.Z)(this,Q)){var e=(0,Z.Z)(this,U).duration,i=(0,c.Z)(this,St,Yt).call(this,t);(0,d.Z)(this,j,new f.tn(0,e)),(0,Z.Z)(this,F).notify("duration-change",e,i)}}function Ht(t){if((0,Z.Z)(this,U).isMediaLoaded){var e={muted:(0,Z.Z)(this,U).isMuted,volume:(0,Z.Z)(this,U).volumeLevel},i=(0,c.Z)(this,St,Yt).call(this,t);(0,Z.Z)(this,F).notify("volume-change",e,i)}}function Ut(t){var e=(0,c.Z)(this,St,Yt).call(this,t);(0,Z.Z)(this,U).isPaused?(0,Z.Z)(this,F).notify("pause",void 0,e):(0,Z.Z)(this,F).notify("play",void 0,e)}function Ft(t){var e={seekable:(0,c.Z)(this,mt,Kt).call(this),buffered:new f.t
1n(0,(0,Z.Z)(this,X))},i=t?(0,c.Z)(this,St,Yt).call(this,t):void 0;(0,Z.Z)(this,F).notify("progress",e,i)}function Bt(t){var e=(0,Z.Z)(this,U).playerState,i=chrome.cast.media.PlayerState;if((0,d.Z)(this,tt,e===i.IDLE),e!==i.PAUSED){var a=(0,c.Z)(this,St,Yt).call(this,t);switch(e){case i.PLAYING:(0,Z.Z)(this,F).notify("playing",void 0,a);break;case i.BUFFERING:(0,Z.Z)(this,F).notify("waiting",void 0,a);break;case i.IDLE:(0,Z.Z)(this,z).stop(),(0,Z.Z)(this,F).notify("pause"),(0,Z.Z)(this,F).notify("end")}}}function Kt(){return(0,Z.Z)(this,U).liveSeekableRange?new f.tn((0,Z.Z)(this,U).liveSeekableRange.start,(0,Z.Z)(this,U).liveSeekableRange.end):(0,Z.Z)(this,j)}function Yt(t){return t instanceof Event?t:new v.DOMEvent(t.type,{detail:t})}function qt(t){var e=(0,Z.Z)(this,F).$state,i=e.streamType,a=e.title,s=e.poster;return new w(t).setMetadata(a(),s()).setStreamType(i()).setTracks((0,Z.Z)(this,B).getLocalTextTracks()).build()}function Xt(t){var e,i,a,s,n,r=(0,c.Z)(this,Tt,qt).call(this,t),h=new chrome.cast.media.LoadRequest(r),o=(0,Z.Z)(this,F).$state.savedState();return h.autoplay=!1===(null!==(e=null===(i=(0,Z.Z)(this,Q))||void 0===i?void 0:i.paused)&&void 0!==e?e:null===o||void 0===o?void 0:o.paused),h.currentTime=null!==(a=null!==(s=null===(n=(0,Z.Z)(this,Q))||void 0===n?void 0:n.time)&&void 0!==s?s:null===o||void 0===o?void 0:o.currentTime)&&void 0!==a?a:0,h}function jt(t,e){return zt.apply(this,arguments)}function zt(){return(zt=(0,s.Z)((0,a.Z)().mark((function t(e,i){var s;return(0,a.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=(0,v.peek)((0,Z.Z)(this,F).$state.source),(0,d.Z)(this,Q,{src:s,paused:e,time:i}),t.next=4,this.loadSource(s);case 4:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function Jt(){(0,c.Z)(this,Et,jt).call(this,(0,Z.Z)(this,U).isPaused,(0,Z.Z)(this,U).currentTime).catch((function(t){}))}}}]); 2//# sourceMappingURL=53.fdafd4a9.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.