1"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[6967],{6967:function(e,t,n){n.r(t),n.d(t,{dyte_pip_toggle:function(){return v}});var i=n(5671),a=n(3144),o=n(2304),s=n(2725),r=n(5855),u=n(7622),c=(n(4130),n(1723)),d=n(2274),v=function(){function e(t){(0,i.Z)(this,e),(0,o.r)(this,t),this.stateUpdate=(0,o.c)(this,"dyteStateUpdate",7),this.variant="button",this.meeting=void 0,this.states=void 0,this.config=s.d,this.iconPack=r.d,this.size=void 0,this.t=(0,u.u)(),this.pipEnabled=!1,this.pipSupported=!1}return(0,a.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"disconnectedCallback",value:function(){}},{key:"statesChanged",value:function(e){var t=e||d.s;null!=(null===t||void 0===t?void 0:t.activePipMode)&&(this.pipEnabled=t.activePipMode)}},{key:"meetingChanged",value:function(e){var t;if(null!==e){this.pipSupported=c.s.isSupported()&&(null===(t=e.self.config)||void 0===t?void 0:t.pipMode);var n=this.states||d.s;this.pipEnabled=n.activePipMode}}},{key:"togglePip",value:function(){!0!==(this.states||d.s).activePipMode?(c.s.updateMediaSession(c.P.CAMERA,this.meeting.self.videoEnabled),c.s.updateMediaSession(c.P.MIC,this.meeting.self.audioEnabled),c.s.enable(),this.stateUpdate.emit({activePipMode:!0})):(c.s.disable(),this.stateUpdate.emit({activePipMode:!1})),this.stateUpdate.emit({activeMoreMenu:!1}),d.s.activeMoreMenu=!1}},{key:"render",value:function(){var e=this;if(this.pipSupported)return(0,o.h)(o.H,{tabIndex:0,role:"log","aria-label":"Picture-in-Picture mode"},(0,o.h)("dyte-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,t:this.t,onClick:function(){return e.togglePip()},icon:this.pipEnabled?this.iconPack.pip_on:this.iconPack.pip_off,label:this.pipEnabled?this.t("pip_off"):this.t("pip_on"),variant:this.variant}))}}],[{key:"watchers",get:function(){return{states:["statesChanged"],meeting:["meetingChanged"]}}}]),e}();v.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block}"},1723:function(e,t,n){n.d(t,{P:function(){return i},s:function(){return d}});var i,a=n(9439),o=n(5671),s=n(3144),r=720,u=1280,c=function(e,t,n,i,a,o){var s,r,u,c,d=a,v=o,f=Math.min(n/d,i/v),h=d*f,l=v*f,p=1;return h<n&&(p=n/h),Math.abs(p-1)<1e-14&&l<i&&(p=i/l),(s=.5*(d-(u=d/((h*=p)/n))))<0&&(s=0),(r=.5*(v-(c=v/((l*=p)/i))))<0&&(r=0),u>d&&(u=d),c>v&&(c=v),[s,r,u,c,e,t,n,i]};!function(e){e.CAMERA="CAMERA",e.MIC="MIC",e.END="END"}(i||(i={}));var d=new(function(){function e(){(0,o.Z)(this,e),this.tracks=[],this.sources=[],this.enabled=!1}return(0,s.Z)(e,[{key:"isSupported",value:function(){return!!window.chrome&&document.pictureInPictureEnabled}},{key:"cleanup",value:function(){this.isSupported()&&void 0!==document.exitPictureInPicture&&null!==document.pictureInPictureElement&&document.exitPictureInPicture(),this.canvas=void 0,this.video=void 0,this.tracks=[],this.request=void 0}},{key:"createCanvas",value:function(){var e=document.createElement("canvas");e.height=r,e.width=u,this.canvas=e}},{key:"setupEvents",value:function(e){void 0!==navigator.mediaSession&&void 0!==navigator.mediaSession.setCameraActive&&navigator.mediaSession.setActionHandler("hangup",(function(){e(i.END)}))}},{key:"mountAudioEvents",value:function(e){void 0!==navigator.mediaSession&&void 0!==navigator.mediaSession.setCameraActive&&navigator.mediaSession.setActionHandler("togglemicrophone",(function(){e(i.MIC)}))}},{key:"mountVideoEvents",value:function(e){void 0!==navigator.mediaSession&&void 0!==navigator.mediaSession.setCameraActive&&navigator.mediaSession.setActionHandler("togglecamera",(function(){e(i.CAMERA)}))}},{key:"unmountAudioEvents",value:function(){void 0!==navigator.mediaSession&&void 0!==navigator.mediaSession.setCameraActive&&navigator.mediaSession.setActionHandler("togglemicrophone",void 0)}},{key:"unmountVideoEvents",value:function(){void 0!==navigator.mediaSession&&void 0!==navigator.mediaSession.setCameraActive&&navigator.mediaSession.setActionHandler("togglecamera",void 0)}},{key:"drawGrid",value:function(e,t,n){if(void 0!==this.canvas){var i=this.canvas.getContext("2d");i.fillStyle="#000000",i.fillRect(0,0,u,r);for(var o=0,s=0;o<715;){for(var d=0;d<1275&&s<n;){var v=this.tracks[s],f=c(d,o,e,t,v.videoWidth,v.videoHeight),h=(0,a.Z)(f,8),l=h[0],p=h[1],g=h[2],m=h[3],y=h[4],k=h[5],b=h[6],S=h[7];i.drawImage(v,l,p,g,m,y,k,b,S),s+=1,d+=e}o+=t}}}},{key:"paintCanvas",value:function(){var e=this.tracks.length,t=function(e){switch(e){case 0:case 1:return[u,r];case 2:return[Math.floor(640),r];case 3:case 4:return[Math.floor(640),Math.floor(360)];default:return[Math.floor(426.6666666666667),Math.floor(360)]}}(e),n=(0,a.Z)(t,2),i=n[0],o=n[1];
1this.drawGrid(i,o,e)}},{key:"animate",value:function(){var e=this;void 0!==this.tracks&&this.paintCanvas(),void 0!==this.request&&(this.request=requestAnimationFrame((function(){return e.animate()})))}},{key:"create",value:function(e,t,n){var i=this;this.cleanup(),this.createCanvas(),this.setupEvents(n);var a=document.createElement("video");a.height=r,a.width=u,a.autoplay=!0,a.srcObject=this.canvas.captureStream(24),this.video=a,this.video.onloadedmetadata=function(){try{e(),i.video.onleavepictureinpicture=function(){t()}}catch(n){t(n.getMessage())}},this.paintCanvas()}},{key:"updateMediaSession",value:function(e,t){void 0!==navigator.mediaSession&&(e===i.CAMERA&&void 0!==navigator.mediaSession.setCameraActive&&navigator.mediaSession.setCameraActive(t),e===i.MIC&&void 0!==navigator.mediaSession.setMicrophoneActive&&navigator.mediaSession.setMicrophoneActive(t))}},{key:"updateVideoSources",value:function(){var e=Object.values(this.sources).filter((function(e){return e.enabled})),t=[];e.map((function(e){t.push(e.element)})),this.tracks=t}},{key:"enableSource",value:function(e){void 0!==this.sources[e]&&(this.sources[e].enabled=!0),this.updateVideoSources()}},{key:"disableSource",value:function(e){void 0!==this.sources[e]&&(this.sources[e].enabled=!1),this.updateVideoSources()}},{key:"addSource",value:function(e,t,n){this.sources[e]={element:t,enabled:n}}},{key:"removeSource",value:function(e){delete this.sources[e]}},{key:"removeAllSource",value:function(){this.sources=[]}},{key:"enable",value:function(){var e=this;this.enabled=!0,this.request=requestAnimationFrame((function(){return e.animate()})),this.video.requestPictureInPicture()}},{key:"disable",value:function(){this.enabled=!1,cancelAnimationFrame(this.request),this.request=void 0,document.exitPictureInPicture()}}]),e}())},2274:function(e,t,n){n.d(t,{o:function(){return v},s:function(){return d}});var i=n(7762),a=n(2304),o=function(e){return!("isConnected"in e)||e.isConnected},s=function(e,t){var n;return function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];n&&clearTimeout(n),n=setTimeout((function(){n=0,e.apply(void 0,a)}),t)}}((function(e){var t,n=(0,i.Z)(e.keys());try{for(n.s();!(t=n.n()).done;){var a=t.value;e.set(a,e.get(a).filter(o))}}catch(s){n.e(s)}finally{n.f()}}),2e3),r=function(e){return"function"===typeof e?e():e},u=function(e,t){var n=e.indexOf(t);n>=0&&(e[n]=e[e.length-1],e.length--)},c=function(e,t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e,t){return e!==t},n=r(e),i=new Map(Object.entries(null!==n&&void 0!==n?n:{})),a={dispose:[],get:[],set:[],reset:[]},o=function(){var t;i=new Map(Object.entries(null!==(t=r(e))&&void 0!==t?t:{})),a.reset.forEach((function(e){return e()}))},s=function(e){return a.get.forEach((function(t){return t(e)})),i.get(e)},c=function(e,n){var o=i.get(e);t(n,o,e)&&(i.set(e,n),a.set.forEach((function(t){return t(e,n,o)})))},d="undefined"===typeof Proxy?{}:new Proxy(n,{get:function(e,t){return s(t)},ownKeys:function(e){return Array.from(i.keys())},getOwnPropertyDescriptor:function(){return{enumerable:!0,configurable:!0}},has:function(e,t){return i.has(t)},set:function(e,t,n){return c(t,n),!0}}),v=function(e,t){return a[e].push(t),function(){u(a[e],t)}};return{state:d,get:s,set:c,on:v,onChange:function(t,n){var i=v("set",(function(e,i){e===t&&n(i)})),a=v("reset",(function(){return n(r(e)[t])}));return function(){i(),a()}},use:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=t.reduce((function(e,t){return t.set&&e.push(v("set",t.set)),t.get&&e.push(v("get",t.get)),t.reset&&e.push(v("reset",t.reset)),t.dispose&&e.push(v("dispose",t.dispose)),e}),[]);return function(){return i.forEach((function(e){return e()}))}},dispose:function(){a.dispose.forEach((function(e){return e()})),o()},reset:o,forceUpdate:function(e){var t=i.get(e);a.set.forEach((function(n){return n(e,t,t)}))}}}(e,t);return n.use(function(){if("function"!==typeof a.a)return{};var e=new Map;return{dispose:function(){return e.clear()},get:function(t){var n=(0,a.a)();n&&function(e,t,n){var i=e.get(t);i?i.includes(n)||i.push(n):e.set(t,[n])}
1(e,t,n)},set:function(t){var n=e.get(t);n&&e.set(t,n.filter(a.f)),s(e)},reset:function(){e.forEach((function(e){return e.forEach(a.f)})),s(e)}}}()),n}({}),d=c.state,v=c.onChange}}]); 2//# sourceMappingURL=6967.f8e17c7d.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.