@daily-co/daily-react
Advanced tools
Comparing version 0.14.0 to 0.14.1
@@ -1,2 +0,2 @@ | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var n=require("react"),t=e(n),i=require("recoil"),r=e(require("lodash.throttle")),a=e(require("@daily-co/daily-js")),o=e(require("fast-deep-equal"));function u(e,n,t,i,r,a,o){try{var u=e[a](o),l=u.value}catch(e){return void t(e)}u.done?n(l):Promise.resolve(l).then(i,r)}function l(e){return function(){var n=this,t=arguments;return new Promise((function(i,r){var a=e.apply(n,t);function o(e){u(a,i,r,o,l,"next",e)}function l(e){u(a,i,r,o,l,"throw",e)}o(void 0)}))}}function c(){return(c=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)}function s(e,n){if(null==e)return{};var t,i,r={},a=Object.keys(e);for(i=0;i<a.length;i++)n.indexOf(t=a[i])>=0||(r[t]=e[t]);return r}function d(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,i=new Array(n);t<n;t++)i[t]=e[t];return i}function f(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return d(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?d(e,void 0):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var p=n.createContext(null),v=function(){return n.useContext(p)},y=n.createContext({on:function(){},off:function(){}}),m=0,g=function(){return m++},k=function(e,t){var i=n.useContext(y),r=i.off,a=i.on,o=n.useState(!1),u=o[0],l=o[1],c=n.useRef(0),s=n.useMemo((function(){return g()}),[]);n.useEffect((function(){if(e&&!u){if(c.current>1e5)return console.error("useDailyEvent called with potentially non-memoized event callback or due to too many re-renders.\n Memoize using useCallback to avoid re-render loop or reduce the amount of state transitions the callback depends on.\n Passed callback for '"+e+"' event is NOT registered.",t),void l(!0);c.current++;var n=setTimeout((function(){c.current=0}),50);return a(e,t,s),function(){clearTimeout(n),r(e,s)}}}),[t,e,s,u,r,a])},b=i.atomFamily({key:"daily-react-participant-property-paths",default:[]}),h=i.atomFamily({key:"daily-react-participant-property",default:null,dangerouslyAllowMutability:!0}),S=i.selectorFamily({key:"daily-react-participant-properties",get:function(e){var n=e.id,t=e.properties;return function(e){var i=e.get;return t.map((function(e){return i(h({id:n,property:e}))}))}},dangerouslyAllowMutability:!0}),C=function(e,n){return i.useRecoilValue(Array.isArray(n)?S({id:e,properties:n}):h({id:e,property:n}))},R=function(e,t,i){void 0===i&&(i=100);var a=n.useContext(y),o=a.off,u=a.on,l=n.useMemo((function(){var n;return Array.isArray(e)?e.reduce((function(e,n){return e[n]=g(),e}),{}):((n={})[e]=g(),n)}),[e]),c=n.useRef([]);k("call-instance-destroyed",n.useCallback((function(){c.current=[]}),[]));var s=n.useMemo((function(){return r((function(){0!==c.current.length&&(t(c.current),c.current=[])}),i,{trailing:!0})}),[t,i]);n.useEffect((function(){if(e){var n=function(e){c.current.push(e),setTimeout(s,0)};return Array.isArray(e)?e.forEach((function(e){return u(e,n,l[e])})):u(e,n,l[e]),function(){Array.isArray(e)?e.forEach((function(e){return o(e,l[e])})):o(e,l[e])}}}),[s,e,l,o,u])};function A(e,n){if(e===n)return!0;if(e instanceof MediaStream&&n instanceof MediaStream)return e.id===n.id&&e.active===n.active&&e.getTracks().length===n.getTracks().length&&e.getTracks().every((function(e,t){return A(e,n.getTracks()[t])}));if(e instanceof MediaStreamTrack&&n instanceof MediaStreamTrack)return e.id===n.id&&e.kind===n.kind&&e.readyState===n.readyState;if(e instanceof Date&&n instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp&&n instanceof RegExp)return e.source===n.source&&e.flags===n.flags;if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(var t,i=f(e.values());!(t=i()).done;)if(!n.has(t.value))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(var r,a=f(e.entries());!(r=a()).done;){var o=r.value,u=o[0],l=o[1];if(!n.has(u))return!1;if(!A(l,n.get(u)))return!1}return!0}if("object"!=typeof e||null===e||"object"!=typeof n||null===n)return!1;var c=Object.keys(e),s=Object.keys(n);if(c.length!==s.length)return!1;for(var d=0,p=c;d<p.length;d++){var v=p[d];if(!(v in n)||!A(e[v],n[v]))return!1}return!0}var E=function(e){return function e(n,t){if(void 0===t&&(t=""),"object"!=typeof n||null===n)return[t];var i=[];for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var a=t?t+"."+r:r;i.push.apply(i,[a].concat(e(n[r],a)))}return i}(e)},w=function(e,n){return n.map((function(n){return function(e,n){return String(n).split(".").filter((function(e){return e.length})).reduce((function(e,n){return e&&e[n]}),e)}(e,n)}))},_=i.atom({key:"daily-react-active-id",default:null}),x=i.atom({key:"daily-react-local-id",default:""}),T=i.atom({key:"daily-react-local-joined-date",default:null}),L=i.atom({key:"daily-react-participant-ids",default:[]}),I=i.atomFamily({key:"daily-react-participant-state",default:null,dangerouslyAllowMutability:!0}),P=i.selector({key:"daily-react-participants",get:function(e){var n=e.get;return n(L).map((function(e){return n(I(e))})).filter(Boolean)},dangerouslyAllowMutability:!0}),D=i.atom({key:"daily-react-waiting-participants",default:[]}),j=i.atomFamily({key:"daily-react-waiting-participant",default:{awaitingAccess:{level:"full"},id:"",name:""}}),M=i.selector({key:"daily-react-waitingParticipantsSelector",get:function(e){var n=e.get;return n(D).map((function(e){return n(j(e))}))}}),V=function(e){var r=e.children,a=v(),o=n.useState(!1),u=o[0],l=o[1],s=i.useRecoilCallback((function(e){var n=e.transact_UNSTABLE;return function(e){n((function(n){var t=n.set;t(x,e.local.session_id);var i=Object.values(e),r=i.map((function(e){return e.session_id}));t(L,r),i.forEach((function(e){t(I(e.session_id),e);var n=E(e);t(b(e.session_id),n),n.forEach((function(n){var i=w(e,[n])[0];t(h({id:e.session_id,property:n}),i)}))})),l(!0)}))}}),[]);n.useEffect((function(){if(a&&!u){var e=setInterval((function(){var n=a.participants();"local"in n&&(s(n),clearInterval(e))}),100);return function(){clearInterval(e)}}}),[a,u,s]);var d=n.useCallback((function(){if(a){var e=null==a?void 0:a.participants();e.local&&s(e)}}),[a,s]);return k("started-camera",d),k("access-state-updated",d),k("joining-meeting",i.useRecoilCallback((function(e){var n=e.set;return function(){n(T,new Date),d()}}),[d])),k("joined-meeting",n.useCallback((function(e){s(e.participants)}),[s])),R(["active-speaker-change","call-instance-destroyed","left-meeting","participant-joined","participant-updated","participant-left"],i.useRecoilCallback((function(e){var n=e.transact_UNSTABLE;return function(e){n((function(n){var t=n.get,i=n.reset,r=n.set;e.forEach((function(e){switch(e.action){case"active-speaker-change":var n=e.activeSpeaker.peerId;r(_,n),r(I(n),(function(e){return e?c({},e,{last_active:new Date}):null}));break;case"participant-joined":r(L,(function(n){return n.includes(e.participant.session_id)?n:[].concat(n,[e.participant.session_id])})),r(I(e.participant.session_id),e.participant);var a=E(e.participant);r(b(e.participant.session_id),a),a.forEach((function(n){var t=w(e.participant,[n])[0];r(h({id:e.participant.session_id,property:n}),t)}));break;case"participant-updated":r(I(e.participant.session_id),(function(n){return c({},n,e.participant)})),e.participant.local&&r(x,(function(n){return n!==e.participant.session_id?e.participant.session_id:n}));var o=E(e.participant),u=t(b(e.participant.session_id));r(b(e.participant.session_id),(function(e){return A(e,o)?e:o})),u.filter((function(e){return!o.includes(e)})).forEach((function(n){i(h({id:e.participant.session_id,property:n}))})),o.forEach((function(n){var t=w(e.participant,[n])[0];r(h({id:e.participant.session_id,property:n}),(function(e){return A(e,t)?e:t}))}));break;case"participant-left":r(L,(function(n){return n.includes(e.participant.session_id)?[].concat(n.filter((function(n){return n!==e.participant.session_id}))):n})),i(I(e.participant.session_id)),t(b(e.participant.session_id)).forEach((function(n){i(h({id:e.participant.session_id,property:n}))})),i(b(e.participant.session_id));break;case"call-instance-destroyed":case"left-meeting":i(x),t(L).forEach((function(e){return i(I(e))})),i(L)}}))}))}}),[])),R(["waiting-participant-added","waiting-participant-updated","waiting-participant-removed"],i.useRecoilCallback((function(e){var n=e.transact_UNSTABLE;return function(e){n((function(n){var t=n.reset,i=n.set;e.forEach((function(e){switch(e.action){case"waiting-participant-added":i(D,(function(n){return n.includes(e.participant.id)?n:[].concat(n,[e.participant.id])})),i(j(e.participant.id),e.participant);break;case"waiting-participant-updated":i(j(e.participant.id),e.participant);break;case"waiting-participant-removed":i(D,(function(n){return n.filter((function(n){return n!==e.participant.id}))})),t(j(e.participant.id))}}))}))}}),[])),t.createElement(t.Fragment,null,r)},B=function(){return i.useRecoilValue(x)},O=function(){return!0},F=function(e){var t=void 0===e?{}:e,r=t.filter,a=void 0===r?O:r,o=t.ignoreLocal,u=void 0!==o&&o,l=B(),c=i.useRecoilValue(_),s=n.useState(null),d=s[0],f=s[1];return n.useEffect((function(){u&&c===l||null!=a&&a(c)&&f(c)}),[a,l,u,c]),d},U=function(e){return["blocked","off"].includes(e)},N=i.selectorFamily({key:"daily-react-participant-ids-filtered-sorted",get:function(e){var n=e.filter,t=e.sort;return function(e){var i=e.get;return i(L).filter((function(e){switch(n){case"local":case"owner":case"record":return i(h({id:e,property:n}));case"remote":return!i(h({id:e,property:"local"}));case"screen":var t=i(S({id:e,properties:["tracks.screenAudio.state","tracks.screenVideo.state"]})),r=t[1];return!U(t[0])||!U(r);default:return!0}})).sort((function(e,n){switch(t){case"joined_at":case"session_id":case"user_id":case"user_name":var r=i(S({id:e,properties:[t]}))[0],a=i(S({id:n,properties:[t]}))[0];if(void 0!==r||void 0!==a){if(void 0===r)return-1;if(void 0===a)return 1;if(r>a)return 1;if(r<a)return-1}return 0;default:return 0}}))}}}),q=function(e){var t=void 0===e?{}:e,r=t.filter,a=t.onActiveSpeakerChange,o=t.onParticipantJoined,u=t.onParticipantLeft,c=t.onParticipantUpdated,s=t.sort,d=i.useRecoilValue(N({filter:"string"==typeof r?r:null,sort:"string"==typeof s?s:null})),f=n.useState([]),p=f[0],v=f[1],y=i.useRecoilCallback((function(e){var n=e.snapshot;return l((function*(){if("function"==typeof r||"function"==typeof s){var e=(yield Promise.all(d.map(function(){var e=l((function*(e){return yield n.getPromise(I(e))}));return function(n){return e.apply(this,arguments)}}()))).filter(Boolean).filter("function"==typeof r?r:function(){return!0}).sort("function"==typeof s?s:function(){return 0}).map((function(e){return e.session_id})).filter(Boolean);A(p,e)||v(e)}}))}),[p,r,d,s]);return n.useEffect((function(){y()}),[y]),i.useRecoilTransactionObserver_UNSTABLE((function(){y()})),R(["participant-joined","participant-updated","active-speaker-change","participant-left"],n.useCallback((function(e){e.length&&e.forEach((function(e){switch(e.action){case"participant-joined":null==o||o(e);break;case"participant-updated":null==c||c(e);break;case"active-speaker-change":null==a||a(e);break;case"participant-left":null==u||u(e)}}))}),[a,o,u,c])),"function"==typeof r||"function"==typeof s?p:d},W=n.createContext({screens:[]}),z=function(e){var r=e.children,a=q({filter:"screen"}),o=n.useState([]),u=o[0],c=o[1],s=n.useCallback((function(e){c((function(n){return A(e,n)?n:e}))}),[]),d=i.useRecoilCallback((function(e){var n=e.snapshot;return function(){var e=l((function*(e){return(yield Promise.all(e.map(function(){var e=l((function*(e){return yield n.getPromise(I(e))}));return function(n){return e.apply(this,arguments)}}()))).filter((function(e){return Boolean(e)})).map((function(e){return{local:e.local,screenAudio:e.tracks.screenAudio,screenVideo:e.tracks.screenVideo,screenId:e.session_id+"-screen",session_id:e.session_id}})).filter(Boolean)}));return function(n){return e.apply(this,arguments)}}()}),[]),f=n.useCallback(l((function*(){s(yield d(a))})),[d,s,a]);return n.useEffect((function(){f()}),[f]),i.useRecoilTransactionObserver_UNSTABLE(l((function*(){s(yield d(a))}))),t.createElement(W.Provider,{value:{screens:u}},r)},H=function(e){var t=void 0===e?{}:e,i=t.onError,r=t.onLocalScreenShareStarted,a=t.onLocalScreenShareStopped,o=v(),u=n.useCallback((function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];null==o||o.startScreenShare.apply(o,n)}),[o]),l=n.useCallback((function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];null==o||o.stopScreenShare.apply(o,n)}),[o]);k("local-screen-share-started",n.useCallback((function(){return null==r?void 0:r()}),[r])),k("local-screen-share-stopped",n.useCallback((function(){return null==a?void 0:a()}),[a])),k("nonfatal-error",n.useCallback((function(e){"screen-share-error"===e.type&&(null==i||i(e))}),[i]));var c=n.useContext(W).screens;return{isSharingScreen:c.some((function(e){return e.local})),screens:c,startScreenShare:u,stopScreenShare:l}},G=function(e,n){void 0===n&&(n="video");var t=C(e,"tracks."+n);return t?c({},t,{isOff:"blocked"===t.state||"off"===t.state}):{isOff:!0,persistentTrack:void 0,state:"off",subscribed:!1}};function Q(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n.useCallback((function(e){for(var n=0;n<t.length;n++){var i=t[n];"function"==typeof i?i(e):i&&"object"==typeof i&&(i.current=e)}}),t)}var J=["onPlayFailed","sessionId","type"],$=n.memo(n.forwardRef((function(e,i){var r=e.onPlayFailed,a=e.sessionId,o=e.type,u=void 0===o?"audio":o,l=s(e,J),c=n.useRef(null),d=G(a,u),f=Q(c,i);return n.useEffect((function(){var e=c.current;if(e&&null!=d&&d.persistentTrack){var n,t=function(){n=setTimeout((function(){(e.readyState!==e.HAVE_ENOUGH_DATA||e.paused)&&(null==r||r({sessionId:a,target:e,type:u}))}),1500)},i=function(){clearTimeout(n)};return e.addEventListener("canplay",t),e.addEventListener("play",i),e.srcObject=new MediaStream([null==d?void 0:d.persistentTrack]),function(){null==e||e.removeEventListener("canplay",t),null==e||e.removeEventListener("play",i)}}}),[null==d?void 0:d.persistentTrack,r,a,u]),t.createElement("audio",Object.assign({autoPlay:!0,playsInline:!0,ref:f},l,{"data-session-id":a,"data-audio-type":u}))})));$.displayName="DailyAudioTrack";var K=n.memo(n.forwardRef((function(e,r){var a=e.autoSubscribeActiveSpeaker,o=void 0!==a&&a,u=e.maxSpeakers,c=void 0===u?5:u,s=e.onPlayFailed,d=e.playLocalScreenAudio,f=void 0!==d&&d,p=v(),y=n.useState(new Array(c).fill("")),m=y[0],g=y[1],k=H().screens,b=B(),h=F({ignoreLocal:!0}),S=n.useRef(null);n.useImperativeHandle(r,(function(){return{getActiveSpeakerAudio:function(){var e,n;return null!=(e=null==(n=S.current)?void 0:n.querySelector('audio[data-session-id="'+h+'"][data-audio-type="audio"]'))?e:null},getAllAudio:function(){var e,n;return Array.from(null!=(e=null==(n=S.current)?void 0:n.querySelectorAll("audio"))?e:[])},getAudioBySessionId:function(e){var n,t;return null!=(n=null==(t=S.current)?void 0:t.querySelector('audio[data-session-id="'+e+'"][data-audio-type="audio"]'))?n:null},getRmpAudio:function(){var e,n;return Array.from(null!=(e=null==(n=S.current)?void 0:n.querySelectorAll('audio[data-audio-type="rmpAudio"]'))?e:[])},getScreenAudio:function(){var e,n;return Array.from(null!=(e=null==(n=S.current)?void 0:n.querySelectorAll('audio[data-audio-type="screenAudio"]'))?e:[])},getRmpAudioBySessionId:function(e){var n,t;return null!=(n=null==(t=S.current)?void 0:t.querySelector('audio[data-session-id="'+e+'"][data-audio-type="rmpAudio"]'))?n:null},getScreenAudioBySessionId:function(e){var n,t;return null!=(n=null==(t=S.current)?void 0:t.querySelector('audio[data-session-id="'+e+'"][data-audio-type="screenAudio"]'))?n:null}}}),[h]);var C=i.useRecoilCallback((function(e){var n=e.snapshot;return function(){var e=l((function*(e){var t=(yield n.getPromise(P)).filter((function(e){return!e.local&&Boolean(e.tracks.audio.subscribed)})),i=function(e){return t.some((function(n){return n.session_id===e}))};if(!i(e)){if(!p||p.isDestroyed()||!o||p.subscribeToTracksAutomatically())return;p.updateParticipant(e,{setSubscribedTracks:{audio:!0}})}g((function(n){var r;if(n.includes(e))return n;var a=function(e){return!e||!i(e)};if(n.some(a)){var o=n.findIndex(a);return n[o]=e,[].concat(n)}var u=n.findIndex((function(e){return t.some((function(n){return n.session_id===e&&U(n.tracks.audio.state)}))}));if(u>=0)return n[u]=e,[].concat(n);var l=t.filter((function(e){return n.includes(e.session_id)&&e.session_id!==h})).sort((function(e,n){var t,i,r=null!=(t=null==e?void 0:e.last_active)?t:new Date("1970-01-01"),a=null!=(i=null==n?void 0:n.last_active)?i:new Date("1970-01-01");return r>a?1:r<a?-1:0}));if(!l.length){var c=n.findIndex((function(e){return e!==h}));return n[c]=e,[].concat(n)}var s=n.indexOf(null==(r=l[0])?void 0:r.session_id);return n[s]=e,[].concat(n)}))}));return function(n){return e.apply(this,arguments)}}()}),[h,o,p]),A=n.useCallback((function(e){g((function(n){if(!n.includes(e))return n;var t=[].concat(n),i=t.indexOf(e);return t[i]="",t}))}),[]);R(["active-speaker-change","track-started","participant-left"],n.useCallback((function(e){e.forEach((function(e){switch(e.action){case"active-speaker-change":if(e.activeSpeaker.peerId===b)return;C(e.activeSpeaker.peerId);break;case"track-started":"audio"===e.track.kind&&e.participant&&!e.participant.local&&C(e.participant.session_id);break;case"participant-left":A(e.participant.session_id)}}))}),[C,b,A]));var E=q({filter:n.useCallback((function(e){var n;return Boolean(null==e||null==(n=e.tracks)?void 0:n.rmpAudio)}),[])});return t.createElement("div",{ref:S},m.map((function(e,n){return t.createElement($,{key:"speaker-slot-"+n,onPlayFailed:s,sessionId:e,type:"audio"})})),k.filter((function(e){return!!f||!e.local})).map((function(e){return t.createElement($,{key:e.screenId,onPlayFailed:s,sessionId:e.session_id,type:"screenAudio"})})),E.map((function(e){return t.createElement($,{key:e+"-rmp",onPlayFailed:s,sessionId:e,type:"rmpAudio"})})))})));K.displayName="DailyAudio";var X=["automirror","fit","mirror","onResize","playableStyle","sessionId","style","type"],Y=n.forwardRef((function(e,i){var r=e.automirror,a=e.fit,o=void 0===a?"contain":a,u=e.mirror,l=e.onResize,d=e.playableStyle,f=void 0===d?{}:d,p=e.sessionId,v=e.style,y=void 0===v?{}:v,m=e.type,g=void 0===m?"video":m,k=s(e,X),b=B()===p,h="screenVideo"===g,S=b&&!h,R=n.useRef(null),A=Q(R,i),E=G(p,g),w=E.persistentTrack,_=S||h||!E.isOff,x=C(p,"tracks."+g),T=null==x?void 0:x.subscribed,L=n.useMemo((function(){if("boolean"==typeof u)return u;if(!r)return!1;if(!w)return S;var e=w.getSettings();return"facingMode"in e?S&&"user"===e.facingMode:S}),[r,S,u,w]);return n.useEffect((function(){var e=R.current;if(e){var n=function(){var n=e.play();void 0!==n&&n.then((function(){e.controls=!1})).catch((function(n){e.controls=!0,console.warn("Failed to play video",n)}))},t=function(){e.paused&&n()},i=function(){e.style.transform="scale(1)"},r=function(){e.style.transform="",setTimeout((function(){e.paused&&n()}),100)},a=function(){"hidden"!==document.visibilityState&&e.paused&&n()};return e.addEventListener("canplay",t),e.addEventListener("enterpictureinpicture",i),e.addEventListener("leavepictureinpicture",r),document.addEventListener("visibilitychange",a),function(){e.removeEventListener("canplay",t),e.removeEventListener("enterpictureinpicture",i),e.removeEventListener("leavepictureinpicture",r),document.removeEventListener("visibilitychange",a)}}}),[]),n.useEffect((function(){var e=R.current;if(e&&w)return e.srcObject=new MediaStream([w]),e.load(),function(){e.srcObject=null,e.load()}}),[w,null==w?void 0:w.id]),n.useEffect((function(){var e,n=R.current;if(l&&n)return t(),n.addEventListener("loadedmetadata",t),n.addEventListener("resize",t),function(){e&&cancelAnimationFrame(e),n.removeEventListener("loadedmetadata",t),n.removeEventListener("resize",t)};function t(){e&&cancelAnimationFrame(e),e=requestAnimationFrame((function(){var e=R.current;if(e&&!document.hidden){var n=e.videoWidth,t=e.videoHeight;n&&t&&(null==l||l({aspectRatio:n/t,height:t,width:n}))}}))}}),[l]),t.createElement("video",Object.assign({autoPlay:!0,muted:!0,playsInline:!0,ref:A,"data-local":b,"data-mirrored":L||void 0,"data-playable":_||void 0,"data-session-id":p,"data-subscribed":T,"data-video-type":g,style:c({objectFit:o,transform:L?"scale(-1, 1)":""},y,_?f:{})},k))}));Y.displayName="DailyVideo";var Z=n.createContext({refreshDevices:function(){return Promise.resolve()}}),ee=i.atom({key:"daily-react-general-camera-state",default:"idle"}),ne=i.atom({key:"daily-react-general-microphone-state",default:"idle"}),te=i.atom({key:"daily-react-camera-devices",default:[]}),ie=i.atom({key:"daily-react-microphone-devices",default:[]}),re=i.atom({key:"daily-react-speaker-devices",default:[]}),ae=i.atom({key:"daily-react-last-camera-error",default:null}),oe=function(e){var r=e.children,a=v(),o=i.useRecoilCallback((function(e){var n=e.transact_UNSTABLE;return l((function*(){var e,t,i,r;if(void 0!==(null==(e=navigator)||null==(t=e.mediaDevices)?void 0:t.getUserMedia)&&void 0!==(null==(i=navigator)||null==(r=i.mediaDevices)?void 0:r.enumerateDevices)){if(a)try{var o=(yield a.enumerateDevices()).devices,u=o.filter((function(e){return"videoinput"===e.kind&&""!==e.deviceId})),l=o.filter((function(e){return"audioinput"===e.kind&&""!==e.deviceId})),c=o.filter((function(e){return"audiooutput"===e.kind&&""!==e.deviceId})),s=yield a.getInputDevices(),d=s.camera,f=s.mic,p=s.speaker,v=function(e,n,t){var i,r;return{device:n,selected:"deviceId"in e&&n.deviceId===e.deviceId,state:null!=(i=null==(r=t.find((function(e){return e.device.deviceId===n.deviceId})))?void 0:r.state)?i:"granted"}},y=function(e,n){return"default"===e.device.deviceId?-1:"default"===n.device.deviceId?1:e.device.label<n.device.label?-1:e.device.label>n.device.label?1:0};n((function(e){var n=e.set;n(te,(function(e){return u.filter(Boolean).map((function(n){return v(d,n,e)})).sort(y)})),n(ie,(function(e){return l.filter(Boolean).map((function(n){return v(f,n,e)})).sort(y)})),n(re,(function(e){return c.filter(Boolean).map((function(n){return v(p,n,e)})).sort(y)}))}))}catch(e){n((function(e){var n=e.set;n(ee,"not-supported"),n(ne,"not-supported")}))}}else n((function(e){var n=e.set;n(ee,"not-supported"),n(ne,"not-supported")}))}))}),[a]),u=i.useRecoilCallback((function(e){var n=e.set,t=e.snapshot,i=e.transact_UNSTABLE;return l((function*(){var e,r,u,l,s,d,f,p,v,y,m,g,k,b;if(a){var h=yield t.getPromise(ee),S=yield t.getPromise(ne),C=a.participants();if(C.local){var R=C.local.tracks,A="prompt",E="prompt";if(navigator.permissions)try{A=(yield navigator.permissions.query({name:"camera"})).state,E=(yield navigator.permissions.query({name:"microphone"})).state}catch(e){}var w="prompt"===A&&["idle","pending"].includes(h)&&"interrupted"===R.video.state&&!R.video.persistentTrack,_=["idle","pending"].includes(h)&&!R.video.persistentTrack&&Boolean(null==(e=R.video.off)?void 0:e.byUser),x="prompt"===E&&["idle","pending"].includes(S)&&"interrupted"===R.audio.state&&!R.audio.persistentTrack,T=["idle","pending"].includes(S)&&!R.audio.persistentTrack&&Boolean(null==(r=R.audio.off)?void 0:r.byUser);null!=(u=R.audio)&&null!=(l=u.blocked)&&l.byDeviceInUse?i((function(e){var n=e.set;n(ne,"in-use"),n(ie,(function(e){return e.map((function(e){return e.selected?c({},e,{state:"in-use"}):e}))}))})):null!=(s=R.audio)&&null!=(d=s.blocked)&&d.byDeviceMissing?n(ne,"not-found"):null!=(f=R.audio)&&null!=(p=f.blocked)&&p.byPermissions||"denied"===E?n(ne,"blocked"):x?n(ne,"pending"):T?n(ne,"idle"):i((function(e){var n=e.set;n(ne,"granted"),n(ie,(function(e){return e.map((function(e){return e.selected?c({},e,{state:"granted"}):e}))}))})),null!=(v=R.video)&&null!=(y=v.blocked)&&y.byDeviceInUse?i((function(e){var n=e.set;n(ee,"in-use"),n(te,(function(e){return e.map((function(e){return e.selected?c({},e,{state:"in-use"}):e}))}))})):null!=(m=R.video)&&null!=(g=m.blocked)&&g.byDeviceMissing?n(ee,"not-found"):null!=(k=R.video)&&null!=(b=k.blocked)&&b.byPermissions||"denied"===A?n(ee,"blocked"):w?n(ee,"pending"):_?n(ee,"idle"):i((function(e){var n=e.set;n(ee,"granted"),n(te,(function(e){return e.map((function(e){return e.selected?c({},e,{state:"granted"}):e}))}))})),o()}}}))}),[a,o]);return k("participant-updated",n.useCallback((function(e){e.participant.local&&u()}),[u])),k("available-devices-updated",o),k("selected-devices-updated",o),k("camera-error",i.useRecoilCallback((function(e){var n=e.transact_UNSTABLE;return function(e){n((function(n){var t,i,r,a,o,u,l,c=n.set;switch(c(ae,e.error),null==(t=e.error)?void 0:t.type){case"cam-in-use":c(ee,"in-use");break;case"mic-in-use":c(ne,"in-use");break;case"cam-mic-in-use":c(ee,"in-use"),c(ne,"in-use");break;case"not-found":null!=(i=e.error)&&i.missingMedia.includes("video")&&c(ee,"not-found"),null!=(r=e.error)&&r.missingMedia.includes("audio")&&c(ne,"not-found");break;case"permissions":null!=(a=e.error)&&a.blockedMedia.includes("video")&&c(ee,"blocked"),null!=(o=e.error)&&o.blockedMedia.includes("audio")&&c(ne,"blocked");break;case"constraints":"invalid"===(null==(u=e.error)?void 0:u.reason)?(c(ee,"constraints-invalid"),c(ne,"constraints-invalid")):"none-specified"===(null==(l=e.error)?void 0:l.reason)&&(c(ee,"constraints-none-specified"),c(ne,"constraints-none-specified"));break;case"undefined-mediadevices":c(ee,"undefined-mediadevices"),c(ne,"undefined-mediadevices");break;case"unknown":default:c(ee,"unknown"),c(ne,"unknown")}}))}}),[])),k("started-camera",i.useRecoilCallback((function(e){var n=e.transact_UNSTABLE;return function(){n((function(e){var n=e.set;n(ee,"granted"),n(ne,"granted")})),u()}}),[u])),t.createElement(Z.Provider,{value:{refreshDevices:o}},r)},ue=i.atom({key:"daily-react-live-streaming",default:{errorMsg:void 0,isLiveStreaming:!1,layout:void 0}}),le=function(e){var n=e.children;return k("live-streaming-started",i.useRecoilCallback((function(e){var n=e.set;return function(e){n(ue,{isLiveStreaming:!0,layout:null==e?void 0:e.layout})}}),[])),k("live-streaming-stopped",i.useRecoilCallback((function(e){var n=e.set;return function(){n(ue,(function(e){return c({},e,{isLiveStreaming:!1,layout:void 0})}))}}),[])),k("live-streaming-error",i.useRecoilCallback((function(e){var n=e.set;return function(e){n(ue,(function(n){return c({},n,{errorMsg:e.errorMsg})}))}}),[])),k("left-meeting",i.useRecoilCallback((function(e){var n=e.reset;return function(){n(ue)}}),[])),t.createElement(t.Fragment,null,n)},ce=i.atom({key:"daily-react-meeting-state",default:"new"}),se=i.atom({key:"daily-react-meeting-error",default:null}),de=i.atom({key:"daily-react-non-fatal-error",default:null}),fe=i.atom({key:"meeting-session-data",default:{data:void 0,topology:"none"}}),pe=function(e){var n=e.children,r=v(),a=i.useRecoilCallback((function(e){var n=e.set;return function(){if(r){var e=r.meetingState();return n(ce,e),e}}}),[r]);k("loading",a),k("loaded",a),k("joining-meeting",a),k("joined-meeting",a),k("left-meeting",a),k("error",i.useRecoilCallback((function(e){var n=e.set;return function(e){n(se,e),a()}}),[a])),k("nonfatal-error",i.useRecoilCallback((function(e){var n=e.set;return function(e){n(de,e)}}),[]));var o=i.useRecoilCallback((function(e){var n=e.set;return function(){r&&n(fe,r.meetingSessionState())}}),[r]);return k("joined-meeting",o),k("meeting-session-state-updated",i.useRecoilCallback((function(e){var n=e.set;return function(e){n(fe,e.meetingSessionState)}}),[])),k("left-meeting",i.useRecoilCallback((function(e){var n=e.reset;return function(){n(fe)}}),[])),k("call-instance-destroyed",i.useRecoilCallback((function(e){var n=e.transact_UNSTABLE;return function(){n((function(e){var n=e.reset;n(ce),n(se),n(de),n(fe)}))}}),[])),t.createElement(t.Fragment,null,n)},ve=i.atom({key:"daily-react-topology",default:"none"}),ye=i.atom({key:"daily-react-networkQuality",default:100}),me=i.atom({key:"daily-react-networkThreshold",default:"good"}),ge=function(e){var r=e.children,a=v(),o=i.useRecoilValue(ve),u=i.useRecoilCallback((function(e){var n=e.set;return l((function*(){if(a){var e=yield a.getNetworkTopology();e&&"none"!==(null==e?void 0:e.topology)&&n(ve,e.topology)}}))}),[a]);return k("joined-meeting",u),k("network-connection",i.useRecoilCallback((function(e){var n=e.set;return function(e){switch(e.event){case"connected":"peer-to-peer"===e.type&&n(ve,"peer"),"sfu"===e.type&&n(ve,"sfu")}}}),[])),k("network-quality-change",i.useRecoilCallback((function(e){var n=e.transact_UNSTABLE;return function(e){n((function(n){var t=n.set;t(ye,(function(n){return n!==e.quality?e.quality:n})),t(me,(function(n){return n!==e.threshold?e.threshold:n}))}))}}),[])),k("left-meeting",i.useRecoilCallback((function(e){var n=e.transact_UNSTABLE;return function(){n((function(e){var n=e.reset;n(ve),n(ye),n(me)}))}}),[])),n.useEffect((function(){a&&"none"===o&&u()}),[a,u,o]),t.createElement(t.Fragment,null,r)},ke=i.atom({key:"daily-react-recording",default:{isLocalParticipantRecorded:!1,isRecording:!1}}),be=function(e){var r=e.children,a=i.useSetRecoilState(ke),o=B(),u=q({filter:"record"});return n.useEffect((function(){var e=u.length>0,n=u.includes(o||"local");a((function(t){return c({},t,{isLocalParticipantRecorded:"local"!==(null==t?void 0:t.type)&&null!=t&&t.type?t.isLocalParticipantRecorded:e,isRecording:"local"!==(null==t?void 0:t.type)&&null!=t&&t.type?t.isRecording:e,local:"local"!==(null==t?void 0:t.type)&&null!=t&&t.type||!e?null==t?void 0:t.local:n,type:e?"local":null==t?void 0:t.type})}))}),[o,u,a]),k("recording-started",i.useRecoilCallback((function(e){var n=e.set;return function(e){var t=!0;switch(e.type){case"cloud-beta":case"cloud":var i;o&&"single-participant"===(null==(i=e.layout)?void 0:i.preset)&&e.layout.session_id!==o&&(t=!1)}n(ke,{error:!1,isLocalParticipantRecorded:t,isRecording:!0,layout:null==e?void 0:e.layout,local:null==e?void 0:e.local,recordingId:null==e?void 0:e.recordingId,recordingStartedDate:new Date,startedBy:null==e?void 0:e.startedBy,type:null==e?void 0:e.type})}}),[o])),k("recording-stopped",i.useRecoilCallback((function(e){var n=e.set;return function(){n(ke,(function(e){return c({},e,{isLocalParticipantRecorded:!1,isRecording:!1})}))}}),[])),k("recording-error",i.useRecoilCallback((function(e){var n=e.set;return function(){n(ke,(function(e){return c({},e,{error:!0,isLocalParticipantRecorded:!1,isRecording:!1})}))}}),[])),k("left-meeting",i.useRecoilCallback((function(e){var n=e.reset;return function(){n(ke)}}),[])),t.createElement(t.Fragment,null,r)},he=function(){return i.useRecoilValue(ce)},Se=i.atom({key:"daily-react-room",default:null}),Ce=function(e){var n=e.children,r=v(),a=he(),o=i.useRecoilCallback((function(e){var n=e.set;return l((function*(){if(r&&"left-meeting"!==a){var e=yield r.room();return e&&"id"in e&&n(Se,e),e}}))}),[r,a]);return k("access-state-updated",o),k("left-meeting",i.useRecoilCallback((function(e){var n=e.reset;return function(){n(Se)}}),[])),t.createElement(t.Fragment,null,n)},Re=["children","recoilRootProps"],Ae=function(e,t){var r=void 0===t?{}:t,a=r.onParticipantLeft,o=r.onParticipantUpdated,u=i.useRecoilValue(I(e));return R(["participant-updated","participant-left"],n.useCallback((function(n){var t=n.filter((function(n){return n.participant.session_id===e}));t.length&&t.forEach((function(e){switch(e.action){case"participant-updated":null==o||o(e);break;case"participant-left":null==a||a(e)}}))}),[a,o,e])),u},Ee="data:application/javascript;charset=utf8,"+encodeURIComponent("\n class AudioLevelProcessor extends AudioWorkletProcessor {\n volume;\n interval;\n nextFrame;\n \n constructor() {\n super();\n this.volume = 0;\n this.interval = 25;\n this.nextFrame = this.interval;\n }\n \n get intervalInFrames() {\n // sampleRate is globally defined in AudioWorklets.\n // See https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletGlobalScope\n // eslint-disable-next-line no-undef\n return (this.interval / 1000) * sampleRate;\n }\n \n process(inputList) {\n const firstInput = inputList[0];\n \n if (firstInput.length > 0) {\n const inputData = firstInput[0];\n let total = 0;\n \n for (let i = 0; i < inputData.length; ++i) {\n total += Math.abs(inputData[i]);\n }\n \n const rms = Math.sqrt(total / inputData.length);\n this.volume = Math.max(0, Math.min(1, rms));\n \n this.nextFrame -= inputData.length;\n if (this.nextFrame < 0) {\n this.nextFrame += this.intervalInFrames;\n this.port.postMessage({ volume: this.volume });\n }\n }\n \n return true;\n }\n }\n \n registerProcessor('audiolevel', AudioLevelProcessor); \n"),we=i.atom({key:"cpu-load-state",default:{state:"low",reason:"none"}}),_e=i.atom({key:"daily-react-input-settings",default:null}),xe=i.atom({key:"daily-react-participant-counts",default:{hidden:0,present:0}}),Te=i.atomFamily({key:"daily-react-participant-receive-settings",default:{}}),Le=function(){return i.useRecoilValue(Se)},Ie=i.atom({key:"daily-react-send-settings",default:null}),Pe=i.atom({key:"daily-react-transcription",default:{isTranscriptionEnabled:!1,isTranscribing:!1,model:"general",language:"en",transcriptions:[]}});exports.DailyAudio=K,exports.DailyAudioTrack=$,exports.DailyProvider=function(e){var r=e.children,o=e.recoilRootProps,u=void 0===o?{}:o,d=s(e,Re),v="callObject"in d?d.callObject:null,m=n.useState(v),g=m[0],k=m[1],b=n.useRef({});n.useEffect((function(){v&&(v?((null==g?void 0:g._callFrameId)!==(null==v?void 0:v._callFrameId)||!g&&v)&&k(v):k(null))}),[g,v]);var h=n.useCallback((function(e){if("action"in e)for(var n,t=f(null!=(i=null==(r=b.current)||null==(a=r[e.action])?void 0:a.values())?i:[]);!(n=t()).done;){var i,r,a;(0,n.value)(e)}}),[]),S=n.useCallback((function(e){e&&Object.keys(b.current).forEach((function(n){e.off(n,h),e.isDestroyed()||e.on(n,h)}))}),[h]),C=n.useRef();n.useEffect((function(){if("callObject"in d)return k(d.callObject),void S(d.callObject);function e(){return(e=l((function*(e){yield e.destroy()}))).apply(this,arguments)}if(g)A(C.current,d)||function(n){e.apply(this,arguments)}(g);else{var n=a.getCallInstance();n||(n=a.createCallObject(c({},d)),C.current=d),k(n),S(n),n.once("call-instance-destroyed",(function(){k(null)}))}}),[g,S,d]);var R=n.useCallback((function(e,n,t){var i,r;b.current[e]||(b.current[e]=new Map,g&&(g.off(e,h),g.isDestroyed()||g.on(e,h))),null!=(i=b.current[e])&&i.has(t)||null==(r=b.current[e])||r.set(t,n)}),[g,h]),E=n.useCallback((function(e,n){var t,i;null==(t=b.current[e])||t.delete(n),0===(null==(i=b.current[e])?void 0:i.size)&&(null==g||g.off(e,h),delete b.current[e])}),[g,h]);return t.createElement(i.RecoilRoot,Object.assign({},u),t.createElement(p.Provider,{value:g},t.createElement(y.Provider,{value:{on:R,off:E}},t.createElement(Ce,null,t.createElement(pe,null,t.createElement(ge,null,t.createElement(V,null,t.createElement(z,null,t.createElement(be,null,t.createElement(le,null,t.createElement(oe,null,r)))))))))))},exports.DailyVideo=Y,exports.useActiveParticipant=function(e){var t=void 0===e?{}:e,r=t.ignoreLocal,a=void 0!==r&&r,o=t.onActiveSpeakerChange,u=v(),l=i.useRecoilValue(_),c=n.useState(""),s=c[1],d=Ae(c[0]);return n.useEffect((function(){var e;if(u){var n=null==u||null==(e=u.participants())?void 0:e.local;a&&l===(null==n?void 0:n.session_id)||s(null!=l?l:"")}}),[u,a,l]),k("active-speaker-change",n.useCallback((function(e){null==o||o(e)}),[o])),d},exports.useActiveSpeakerId=F,exports.useAppMessage=function(e){var t=(void 0===e?{}:e).onAppMessage,i=v(),r=n.useCallback((function(e,n){void 0===n&&(n="*"),i&&i.sendAppMessage(e,n)}),[i]),a=n.useCallback((function(e){null==t||t(e,r)}),[t,r]);return k("app-message",a),r},exports.useAudioLevel=function(e,t){var i=n.useRef();n.useEffect((function(){if(e){var n="undefined"!=typeof AudioContext?AudioContext:void 0!==window.webkitAudioContext?window.webkitAudioContext:null;if(n){i.current||(i.current=new n);var r=i.current;if(r){var a,o=r.createMediaStreamSource(new MediaStream([e]));return function(){var e=l((function*(){try{a=new AudioWorkletNode(r,"audiolevel")}catch(e){try{yield r.audioWorklet.addModule(Ee),a=new AudioWorkletNode(r,"audiolevel")}catch(e){console.error(e)}}if(a){a.port.onmessage=function(e){var n=0;e.data.volume&&(n=e.data.volume),a&&t(n)};try{o.connect(a).connect(r.destination)}catch(e){console.warn(e)}}}));return function(){return e.apply(this,arguments)}}()(),function(){var e;null==(e=a)||e.disconnect(),a=null,null==o||o.disconnect()}}}}}),[t,e])},exports.useAudioTrack=function(e){return G(e,"audio")},exports.useCPULoad=function(e){var t=(void 0===e?{}:e).onCPULoadChange,r=i.useRecoilValue(we),a=v(),u=he(),c=i.useRecoilCallback((function(e){var n=e.set,t=e.snapshot;return function(){var e=l((function*(e){var i=yield t.getPromise(we);o(i,e)||n(we,e)}));return function(n){return e.apply(this,arguments)}}()}),[]);return n.useEffect((function(){var e=!0;if(a&&!a.isDestroyed()&&"joined-meeting"===u)return a.getCpuLoadStats().then((function(n){e&&c({state:n.cpuLoadState,reason:n.cpuLoadStateReason})})),function(){e=!1}}),[a,u,c]),k("cpu-load-change",n.useCallback((function(e){c({state:e.cpuLoadState,reason:e.cpuLoadStateReason}),null==t||t(e)}),[t,c])),r},exports.useDaily=v,exports.useDailyEvent=k,exports.useDevices=function(){var e=v(),t=i.useRecoilValue(ee),r=i.useRecoilValue(ne),a=i.useRecoilValue(te),o=i.useRecoilValue(ie),u=i.useRecoilValue(re),c=i.useRecoilValue(ae),s=n.useContext(Z).refreshDevices,d=n.useCallback(function(){var n=l((function*(n){yield null==e?void 0:e.setInputDevicesAsync({audioDeviceId:null,videoDeviceId:n})}));return function(e){return n.apply(this,arguments)}}(),[e]),f=n.useCallback(function(){var n=l((function*(n){yield null==e?void 0:e.setInputDevicesAsync({audioDeviceId:n,videoDeviceId:null})}));return function(e){return n.apply(this,arguments)}}(),[e]),p=n.useCallback(function(){var n=l((function*(n){yield null==e?void 0:e.setOutputDeviceAsync({outputDeviceId:n})}));return function(e){return n.apply(this,arguments)}}(),[e]),y=["blocked","in-use","not-found","constraints-invalid","constraints-none-specified","undefined-mediadevices","unknown"];return{cameraError:c,cameras:a,camState:t,currentCam:a.find((function(e){return e.selected})),currentMic:o.find((function(e){return e.selected})),currentSpeaker:u.find((function(e){return e.selected})),hasCamError:y.includes(t),hasMicError:y.includes(r),microphones:o,micState:r,refreshDevices:s,setCamera:d,setMicrophone:f,setSpeaker:p,speakers:u}},exports.useInputSettings=function(e){var t=void 0===e?{}:e,r=t.onError,a=t.onInputSettingsUpdated,o=i.useRecoilValue(_e),u=(i.useRecoilValue(se),i.useRecoilValue(de)),l=v(),c=i.useRecoilCallback((function(e){var n=e.set;return function(e){n(_e,e)}}),[]);n.useEffect((function(){l&&l.getInputSettings().then(c)}),[l,c]),k("input-settings-updated",n.useCallback((function(e){c(e.inputSettings),null==a||a(e)}),[a,c])),k("nonfatal-error",n.useCallback((function(e){"input-settings-error"===e.type&&(null==r||r(e))}),[r]));var s=n.useCallback((function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];null==l||l.updateInputSettings.apply(l,n)}),[l]);return{errorMsg:"input-settings-error"===(null==u?void 0:u.type)?u.errorMsg:null,inputSettings:o,updateInputSettings:s}},exports.useLiveStreaming=function(e){var t=void 0===e?{}:e,r=t.onLiveStreamingError,a=t.onLiveStreamingStarted,o=t.onLiveStreamingStopped,u=t.onLiveStreamingUpdated,l=t.onLiveStreamingWarning,s=v(),d=i.useRecoilValue(ue);return k("live-streaming-started",n.useCallback((function(e){null==a||a(e)}),[a])),k("live-streaming-stopped",n.useCallback((function(e){null==o||o(e)}),[o])),k("live-streaming-updated",n.useCallback((function(e){null==u||u(e)}),[u])),k("live-streaming-error",n.useCallback((function(e){null==r||r(e)}),[r])),k("nonfatal-error",n.useCallback((function(e){"live-streaming-warning"===e.type&&(null==l||l(e))}),[l])),c({},d,{startLiveStreaming:n.useCallback((function(){s&&s.startLiveStreaming.apply(s,arguments)}),[s]),stopLiveStreaming:n.useCallback((function(){s&&s.stopLiveStreaming.apply(s,arguments)}),[s]),updateLiveStreaming:n.useCallback((function(){s&&s.updateLiveStreaming.apply(s,arguments)}),[s])})},exports.useLocalParticipant=function(){var e=i.useRecoilValue(x);return Ae(e)},exports.useLocalSessionId=B,exports.useMediaTrack=G,exports.useMeetingSessionState=function(e){var t=(void 0===e?{}:e).onError,r=i.useRecoilValue(fe);return k("nonfatal-error",n.useCallback((function(e){"meeting-session-data-error"===e.type&&(null==t||t(e))}),[t])),{data:null==r?void 0:r.data,topology:null==r?void 0:r.topology}},exports.useMeetingState=he,exports.useNetwork=function(e){var t=void 0===e?{}:e,r=t.onNetworkConnection,a=t.onNetworkQualityChange,o=v(),u=i.useRecoilValue(ve),c=i.useRecoilValue(ye),s=i.useRecoilValue(me);return k("network-connection",n.useCallback((function(e){null==r||r(e)}),[r])),k("network-quality-change",n.useCallback((function(e){null==a||a(e)}),[a])),{getStats:n.useCallback(l((function*(){var e=yield null==o?void 0:o.getNetworkStats();return null==e?void 0:e.stats})),[o]),quality:c,threshold:s,topology:u}},exports.useParticipant=Ae,exports.useParticipantCounts=function(e){var t=(void 0===e?{}:e).onParticipantCountsUpdated,r=v(),a=i.useRecoilValue(xe),o=i.useRecoilCallback((function(e){var n=e.set;return function(e){n(xe,e)}}),[]);return k("participant-counts-updated",n.useCallback((function(e){o(e.participantCounts),null==t||t(e)}),[t,o])),n.useEffect((function(){r&&!r.isDestroyed()&&o(r.participantCounts())}),[r,o]),a},exports.useParticipantIds=q,exports.useParticipantProperty=C,exports.usePermissions=function(e){var n,t,i,r,a,o,u,l,c,s=B(),d=C(null!=e?e:s,"permissions"),f="boolean"==typeof(null==d?void 0:d.canSend)?null==d?void 0:d.canSend:Boolean(null==d||null==(n=d.canSend)?void 0:n.has("audio")),p="boolean"==typeof(null==d?void 0:d.canSend)?null==d?void 0:d.canSend:Boolean(null==d||null==(t=d.canSend)?void 0:t.has("video")),v="boolean"==typeof(null==d?void 0:d.canSend)?null==d?void 0:d.canSend:Boolean(null==d||null==(i=d.canSend)?void 0:i.has("customAudio")),y="boolean"==typeof(null==d?void 0:d.canSend)?null==d?void 0:d.canSend:Boolean(null==d||null==(r=d.canSend)?void 0:r.has("customVideo")),m="boolean"==typeof(null==d?void 0:d.canSend)?null==d?void 0:d.canSend:Boolean(null==d||null==(a=d.canSend)?void 0:a.has("screenAudio")),g="boolean"==typeof(null==d?void 0:d.canSend)?null==d?void 0:d.canSend:Boolean(null==d||null==(o=d.canSend)?void 0:o.has("screenVideo"));return{canAdminParticipants:"boolean"==typeof(null==d?void 0:d.canAdmin)?null==d?void 0:d.canAdmin:Boolean(null==d||null==(u=d.canAdmin)?void 0:u.has("participants")),canAdminStreaming:"boolean"==typeof(null==d?void 0:d.canAdmin)?null==d?void 0:d.canAdmin:Boolean(null==d||null==(l=d.canAdmin)?void 0:l.has("streaming")),canAdminTranscription:"boolean"==typeof(null==d?void 0:d.canAdmin)?null==d?void 0:d.canAdmin:Boolean(null==d||null==(c=d.canAdmin)?void 0:c.has("transcription")),canSendAudio:f,canSendCustomAudio:v,canSendCustomVideo:y,canSendScreenAudio:m,canSendScreenVideo:g,canSendVideo:p,hasPresence:null==d?void 0:d.hasPresence,permissions:d}},exports.useReceiveSettings=function(e){var t=void 0===e?{}:e,r=t.id,a=void 0===r?"base":r,o=t.onReceiveSettingsUpdated,u=i.useRecoilValue(Te("base")),l=i.useRecoilValue(Te(a)),s=v(),d=he(),f=i.useRecoilCallback((function(e){var n=e.transact_UNSTABLE;return function(e){n((function(n){for(var t=n.reset,i=n.set,r=c({},e),o=0,u=Object.entries(r);o<u.length;o++){var l=u[o],s=l[1];i(Te(l[0]),s)}a in r||t(Te(a))}))}}),[a]);k("receive-settings-updated",n.useCallback((function(e){f(e.receiveSettings),null==o||o(e)}),[o,f])),n.useEffect((function(){s&&!s.isDestroyed()&&s.getReceiveSettings().then(f)}),[s,f]);var p=n.useCallback((function(){if(s&&"joined-meeting"===d){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];null==s||null==s.updateReceiveSettings||s.updateReceiveSettings.apply(s,n)}}),[s,d]);return{receiveSettings:"base"===a||0===Object.keys(l).length?u:l,updateReceiveSettings:p}},exports.useRecording=function(e){var t=void 0===e?{}:e,r=t.onRecordingData,a=t.onRecordingError,o=t.onRecordingStarted,u=t.onRecordingStopped,l=v(),s=i.useRecoilValue(ke);return k("recording-started",n.useCallback((function(e){null==o||o(e)}),[o])),k("recording-stopped",n.useCallback((function(e){null==u||u(e)}),[u])),k("recording-error",n.useCallback((function(e){null==a||a(e)}),[a])),k("recording-data",n.useCallback((function(e){null==r||r(e)}),[r])),c({},s,{startRecording:n.useCallback((function(){l&&l.startRecording.apply(l,arguments)}),[l]),stopRecording:n.useCallback((function(){l&&l.stopRecording.apply(l,arguments)}),[l]),updateRecording:n.useCallback((function(){l&&l.updateRecording.apply(l,arguments)}),[l])})},exports.useRoom=Le,exports.useRoomExp=function(e){var t,r,a,o,u,l,c=(void 0===e?{}:e).onCountdown,s=i.useRecoilValue(T),d=Le(),f=n.useState(null),p=f[0],v=f[1];return n.useEffect((function(){var e,n,t,i,r,a,o,u,l,c,f,p,y=null!=(e=null!=(n=null==d||null==(t=d.tokenConfig)?void 0:t.eject_after_elapsed)?n:null==d||null==(i=d.config)?void 0:i.eject_after_elapsed)?e:0,m=null!=(r=null!=(a=null==d||null==(o=d.tokenConfig)?void 0:o.exp)?a:null==d||null==(u=d.config)?void 0:u.exp)?r:0,g=null!=(l=null!=(c=null==d||null==(f=d.tokenConfig)?void 0:f.eject_at_token_exp)?c:null==d||null==(p=d.config)?void 0:p.eject_at_room_exp)&&l,k=new Date(0);if(y&&s&&(k=new Date(s.getTime()+1e3*y)),g&&m){var b=new Date(1e3*m);(!k.getTime()||k.getTime()>0&&b<k)&&(k=b)}0!==k.getTime()&&v((function(e){return(null==e?void 0:e.getTime())!==k.getTime()?k:e}))}),[s,null==d||null==(t=d.config)?void 0:t.eject_after_elapsed,null==d||null==(r=d.config)?void 0:r.eject_at_room_exp,null==d||null==(a=d.config)?void 0:a.exp,null==d||null==(o=d.tokenConfig)?void 0:o.eject_after_elapsed,null==d||null==(u=d.tokenConfig)?void 0:u.eject_at_token_exp,null==d||null==(l=d.tokenConfig)?void 0:l.exp]),n.useEffect((function(){if(p&&0!==p.getTime()){var e=setInterval((function(){var e,n=(null!=(e=null==p?void 0:p.getTime())?e:0)/1e3-Date.now()/1e3;if(!(n<0)){var t=Math.max(0,Math.floor(n/3600)),i=Math.max(0,Math.floor(n%3600/60)),r=Math.max(0,Math.floor(n%60));null==c||c({hours:t,minutes:i,seconds:r})}}),1e3);return function(){clearInterval(e)}}}),[p,c]),{ejectDate:p}},exports.useScreenAudioTrack=function(e){return G(e,"screenAudio")},exports.useScreenShare=H,exports.useScreenVideoTrack=function(e){return G(e,"screenVideo")},exports.useSendSettings=function(e){var t=(void 0===e?{}:e).onSendSettingsUpdated,r=v(),a=i.useRecoilValue(Ie);k("send-settings-updated",i.useRecoilCallback((function(e){var n=e.set;return function(e){n(Ie,e.sendSettings),null==t||t(e)}}),[t]));var o=i.useRecoilCallback((function(e){var n=e.set;return function(e){n(Ie,e)}}),[]);return n.useEffect((function(){r&&!r.isDestroyed()&&o(r.getSendSettings())}),[r,o]),{sendSettings:a,updateSendSettings:n.useCallback(l((function*(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var i=yield null==r?void 0:r.updateSendSettings.apply(r,n);if(i)return o(i),i})),[r,o])}},exports.useThrottledDailyEvent=R,exports.useTranscription=function(e){var t,r=void 0===e?{}:e,a=r.onTranscriptionAppData,o=r.onTranscriptionError,u=r.onTranscriptionStarted,l=r.onTranscriptionStopped,s=v(),d=i.useRecoilValue(Pe),f=i.useSetRecoilState(Pe),p=Le();return n.useEffect((function(){var e;null!=p&&null!=(e=p.domainConfig)&&e.enable_transcription&&f((function(e){return c({},e,{isTranscriptionEnabled:!0})}))}),[null==p||null==(t=p.domainConfig)?void 0:t.enable_transcription,f]),k("transcription-started",i.useRecoilCallback((function(e){var n=e.set;return function(e){n(Pe,c({isTranscriptionEnabled:!0,error:!1,isTranscribing:!0,transcriptionStartDate:new Date,transcriptions:[]},e)),null==u||u(e)}}),[u])),k("transcription-stopped",i.useRecoilCallback((function(e){var n=e.set;return function(e){n(Pe,(function(n){return c({},n,{updatedBy:null==e?void 0:e.updatedBy,isTranscribing:!1})})),null==l||l(e)}}),[l])),k("transcription-error",i.useRecoilCallback((function(e){var n=e.set;return function(e){n(Pe,(function(e){return c({},e,{error:!0,isTranscribing:!1})})),null==o||o(e)}}),[o])),k("app-message",i.useRecoilCallback((function(e){var n=e.set;return function(e){var t;"transcription"===(null==e?void 0:e.fromId)&&null!=e&&null!=(t=e.data)&&t.is_final&&(n(Pe,(function(n){return c({},n,{isTranscribing:!0,transcriptions:[].concat(n.transcriptions,[e.data])})})),null==a||a(e))}}),[a])),c({},d,{startTranscription:n.useCallback((function(){s&&s.startTranscription.apply(s,arguments)}),[s]),stopTranscription:n.useCallback((function(){s&&s.stopTranscription.apply(s,arguments)}),[s])})},exports.useVideoTrack=function(e){return G(e,"video")},exports.useWaitingParticipants=function(e){var t=void 0===e?{}:e,r=t.onWaitingParticipantAdded,a=t.onWaitingParticipantRemoved,o=t.onWaitingParticipantUpdated,u=v(),l=i.useRecoilValue(M);k("waiting-participant-added",n.useCallback((function(e){null==r||r(e)}),[r])),k("waiting-participant-removed",n.useCallback((function(e){null==a||a(e)}),[a])),k("waiting-participant-updated",n.useCallback((function(e){null==o||o(e)}),[o]));var c=n.useCallback((function(e,n){"*"!==e?null==u||u.updateWaitingParticipant(e,{grantRequestedAccess:n}):null==u||u.updateWaitingParticipants({"*":{grantRequestedAccess:n}})}),[u]);return{waitingParticipants:l,grantAccess:n.useCallback((function(e){c(e,!0)}),[c]),denyAccess:n.useCallback((function(e){c(e,!1)}),[c])}}; | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var n=require("react"),t=e(n),i=require("recoil"),r=e(require("lodash.throttle")),a=e(require("@daily-co/daily-js")),o=e(require("fast-deep-equal"));function u(e,n,t,i,r,a,o){try{var u=e[a](o),l=u.value}catch(e){return void t(e)}u.done?n(l):Promise.resolve(l).then(i,r)}function l(e){return function(){var n=this,t=arguments;return new Promise((function(i,r){var a=e.apply(n,t);function o(e){u(a,i,r,o,l,"next",e)}function l(e){u(a,i,r,o,l,"throw",e)}o(void 0)}))}}function c(){return(c=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)}function s(e,n){if(null==e)return{};var t,i,r={},a=Object.keys(e);for(i=0;i<a.length;i++)n.indexOf(t=a[i])>=0||(r[t]=e[t]);return r}function d(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,i=new Array(n);t<n;t++)i[t]=e[t];return i}function f(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return d(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?d(e,void 0):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var p=n.createContext(null),v=function(){return n.useContext(p)},y=n.createContext({on:function(){},off:function(){}}),m=0,g=function(){return m++},k=function(e,t){var i=n.useContext(y),r=i.off,a=i.on,o=n.useState(!1),u=o[0],l=o[1],c=n.useRef(0),s=n.useMemo((function(){return g()}),[]);n.useEffect((function(){if(e&&!u){if(c.current>1e5)return console.error("useDailyEvent called with potentially non-memoized event callback or due to too many re-renders.\n Memoize using useCallback to avoid re-render loop or reduce the amount of state transitions the callback depends on.\n Passed callback for '"+e+"' event is NOT registered.",t),void l(!0);c.current++;var n=setTimeout((function(){c.current=0}),50);return a(e,t,s),function(){clearTimeout(n),r(e,s)}}}),[t,e,s,u,r,a])},b=i.atomFamily({key:"daily-react-participant-property-paths",default:[]}),h=i.atomFamily({key:"daily-react-participant-property",default:null,dangerouslyAllowMutability:!0}),S=i.selectorFamily({key:"daily-react-participant-properties",get:function(e){var n=e.id,t=e.properties;return function(e){var i=e.get;return t.map((function(e){return i(h({id:n,property:e}))}))}},dangerouslyAllowMutability:!0}),C=function(e,n){return i.useRecoilValue(Array.isArray(n)?S({id:e,properties:n}):h({id:e,property:n}))},R=function(e,t,i){void 0===i&&(i=100);var a=n.useContext(y),o=a.off,u=a.on,l=n.useMemo((function(){var n;return Array.isArray(e)?e.reduce((function(e,n){return e[n]=g(),e}),{}):((n={})[e]=g(),n)}),[e]),c=n.useRef([]);k("call-instance-destroyed",n.useCallback((function(){c.current=[]}),[]));var s=n.useMemo((function(){return r((function(){0!==c.current.length&&(t(c.current),c.current=[])}),i,{trailing:!0})}),[t,i]);n.useEffect((function(){if(e){var n=function(e){c.current.push(e),setTimeout(s,0)};return Array.isArray(e)?e.forEach((function(e){return u(e,n,l[e])})):u(e,n,l[e]),function(){Array.isArray(e)?e.forEach((function(e){return o(e,l[e])})):o(e,l[e])}}}),[s,e,l,o,u])};function A(e,n){if(e===n)return!0;if(e instanceof MediaStream&&n instanceof MediaStream)return e.id===n.id&&e.active===n.active&&e.getTracks().length===n.getTracks().length&&e.getTracks().every((function(e,t){return A(e,n.getTracks()[t])}));if(e instanceof MediaStreamTrack&&n instanceof MediaStreamTrack)return e.id===n.id&&e.kind===n.kind&&e.readyState===n.readyState;if(e instanceof Date&&n instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp&&n instanceof RegExp)return e.source===n.source&&e.flags===n.flags;if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(var t,i=f(e.values());!(t=i()).done;)if(!n.has(t.value))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(var r,a=f(e.entries());!(r=a()).done;){var o=r.value,u=o[0],l=o[1];if(!n.has(u))return!1;if(!A(l,n.get(u)))return!1}return!0}if("object"!=typeof e||null===e||"object"!=typeof n||null===n)return!1;var c=Object.keys(e),s=Object.keys(n);if(c.length!==s.length)return!1;for(var d=0,p=c;d<p.length;d++){var v=p[d];if(!(v in n)||!A(e[v],n[v]))return!1}return!0}var E=function(e){return function e(n,t){if(void 0===t&&(t=""),"object"!=typeof n||null===n)return[t];var i=[];for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var a=t?t+"."+r:r;i.push.apply(i,[a].concat(e(n[r],a)))}return i}(e)},w=function(e,n){return n.map((function(n){return function(e,n){return String(n).split(".").filter((function(e){return e.length})).reduce((function(e,n){return e&&e[n]}),e)}(e,n)}))},_=i.atom({key:"daily-react-active-id",default:null}),x=i.atom({key:"daily-react-local-id",default:""}),T=i.atom({key:"daily-react-local-joined-date",default:null}),L=i.atom({key:"daily-react-participant-ids",default:[]}),I=i.atomFamily({key:"daily-react-participant-state",default:null,dangerouslyAllowMutability:!0}),P=i.selector({key:"daily-react-participants",get:function(e){var n=e.get;return n(L).map((function(e){return n(I(e))})).filter(Boolean)},dangerouslyAllowMutability:!0}),D=i.atom({key:"daily-react-waiting-participants",default:[]}),j=i.atomFamily({key:"daily-react-waiting-participant",default:{awaitingAccess:{level:"full"},id:"",name:""}}),M=i.selector({key:"daily-react-waitingParticipantsSelector",get:function(e){var n=e.get;return n(D).map((function(e){return n(j(e))}))}}),V=function(e){var r=e.children,a=v(),o=n.useState(!1),u=o[0],l=o[1],s=i.useRecoilCallback((function(e){var n=e.transact_UNSTABLE;return function(e){n((function(n){var t=n.set;t(x,e.local.session_id);var i=Object.values(e),r=i.map((function(e){return e.session_id}));t(L,r),i.forEach((function(e){t(I(e.session_id),e);var n=E(e);t(b(e.session_id),n),n.forEach((function(n){var i=w(e,[n])[0];t(h({id:e.session_id,property:n}),i)}))})),l(!0)}))}}),[]);n.useEffect((function(){if(a&&!u){var e=setInterval((function(){var n=a.participants();"local"in n&&(s(n),clearInterval(e))}),100);return function(){clearInterval(e)}}}),[a,u,s]);var d=n.useCallback((function(){if(a){var e=null==a?void 0:a.participants();e.local&&s(e)}}),[a,s]);return k("started-camera",d),k("access-state-updated",d),k("joining-meeting",i.useRecoilCallback((function(e){var n=e.set;return function(){n(T,new Date),d()}}),[d])),k("joined-meeting",n.useCallback((function(e){s(e.participants)}),[s])),R(["active-speaker-change","call-instance-destroyed","left-meeting","participant-joined","participant-updated","participant-left"],i.useRecoilCallback((function(e){var n=e.transact_UNSTABLE;return function(e){n((function(n){var t=n.get,i=n.reset,r=n.set;e.forEach((function(e){switch(e.action){case"active-speaker-change":var n=e.activeSpeaker.peerId;r(_,n),r(I(n),(function(e){return e?c({},e,{last_active:new Date}):null}));break;case"participant-joined":r(L,(function(n){return n.includes(e.participant.session_id)?n:[].concat(n,[e.participant.session_id])})),r(I(e.participant.session_id),e.participant);var a=E(e.participant);r(b(e.participant.session_id),a),a.forEach((function(n){var t=w(e.participant,[n])[0];r(h({id:e.participant.session_id,property:n}),t)}));break;case"participant-updated":r(I(e.participant.session_id),(function(n){return c({},n,e.participant)})),e.participant.local&&r(x,(function(n){return n!==e.participant.session_id?e.participant.session_id:n}));var o=E(e.participant),u=t(b(e.participant.session_id));r(b(e.participant.session_id),(function(e){return A(e,o)?e:o})),u.filter((function(e){return!o.includes(e)})).forEach((function(n){i(h({id:e.participant.session_id,property:n}))})),o.forEach((function(n){var t=w(e.participant,[n])[0];r(h({id:e.participant.session_id,property:n}),(function(e){return A(e,t)?e:t}))}));break;case"participant-left":r(L,(function(n){return n.includes(e.participant.session_id)?[].concat(n.filter((function(n){return n!==e.participant.session_id}))):n})),i(I(e.participant.session_id)),t(b(e.participant.session_id)).forEach((function(n){i(h({id:e.participant.session_id,property:n}))})),i(b(e.participant.session_id));break;case"call-instance-destroyed":case"left-meeting":i(x),t(L).forEach((function(e){return i(I(e))})),i(L)}}))}))}}),[])),R(["waiting-participant-added","waiting-participant-updated","waiting-participant-removed"],i.useRecoilCallback((function(e){var n=e.transact_UNSTABLE;return function(e){n((function(n){var t=n.reset,i=n.set;e.forEach((function(e){switch(e.action){case"waiting-participant-added":i(D,(function(n){return n.includes(e.participant.id)?n:[].concat(n,[e.participant.id])})),i(j(e.participant.id),e.participant);break;case"waiting-participant-updated":i(j(e.participant.id),e.participant);break;case"waiting-participant-removed":i(D,(function(n){return n.filter((function(n){return n!==e.participant.id}))})),t(j(e.participant.id))}}))}))}}),[])),t.createElement(t.Fragment,null,r)},B=function(){return i.useRecoilValue(x)},O=function(){return!0},F=function(e){var t=void 0===e?{}:e,r=t.filter,a=void 0===r?O:r,o=t.ignoreLocal,u=void 0!==o&&o,l=B(),c=i.useRecoilValue(_),s=n.useState(null),d=s[0],f=s[1];return n.useEffect((function(){u&&c===l||null!=a&&a(c)&&f(c)}),[a,l,u,c]),d},U=function(e){return["blocked","off"].includes(e)},N=i.selectorFamily({key:"daily-react-participant-ids-filtered-sorted",get:function(e){var n=e.filter,t=e.sort;return function(e){var i=e.get;return i(L).filter((function(e){switch(n){case"local":case"owner":case"record":return i(h({id:e,property:n}));case"remote":return!i(h({id:e,property:"local"}));case"screen":var t=i(S({id:e,properties:["tracks.screenAudio.state","tracks.screenVideo.state"]})),r=t[1];return!U(t[0])||!U(r);default:return!0}})).sort((function(e,n){switch(t){case"joined_at":case"session_id":case"user_id":case"user_name":var r=i(S({id:e,properties:[t]}))[0],a=i(S({id:n,properties:[t]}))[0];if(void 0!==r||void 0!==a){if(void 0===r)return-1;if(void 0===a)return 1;if(r>a)return 1;if(r<a)return-1}return 0;default:return 0}}))}}}),q=function(e){var t=void 0===e?{}:e,r=t.filter,a=t.onActiveSpeakerChange,o=t.onParticipantJoined,u=t.onParticipantLeft,c=t.onParticipantUpdated,s=t.sort,d=i.useRecoilValue(N({filter:"string"==typeof r?r:null,sort:"string"==typeof s?s:null})),f=n.useState([]),p=f[0],v=f[1],y=i.useRecoilCallback((function(e){var n=e.snapshot;return l((function*(){if("function"==typeof r||"function"==typeof s){var e=(yield Promise.all(d.map(function(){var e=l((function*(e){return yield n.getPromise(I(e))}));return function(n){return e.apply(this,arguments)}}()))).filter(Boolean).filter("function"==typeof r?r:function(){return!0}).sort("function"==typeof s?s:function(){return 0}).map((function(e){return e.session_id})).filter(Boolean);A(p,e)||v(e)}}))}),[p,r,d,s]);return n.useEffect((function(){y()}),[y]),i.useRecoilTransactionObserver_UNSTABLE((function(){y()})),R(["participant-joined","participant-updated","active-speaker-change","participant-left"],n.useCallback((function(e){e.length&&e.forEach((function(e){switch(e.action){case"participant-joined":null==o||o(e);break;case"participant-updated":null==c||c(e);break;case"active-speaker-change":null==a||a(e);break;case"participant-left":null==u||u(e)}}))}),[a,o,u,c])),"function"==typeof r||"function"==typeof s?p:d},W=n.createContext({screens:[]}),z=function(e){var r=e.children,a=q({filter:"screen"}),o=n.useState([]),u=o[0],c=o[1],s=n.useCallback((function(e){c((function(n){return A(e,n)?n:e}))}),[]),d=i.useRecoilCallback((function(e){var n=e.snapshot;return function(){var e=l((function*(e){return(yield Promise.all(e.map(function(){var e=l((function*(e){return yield n.getPromise(I(e))}));return function(n){return e.apply(this,arguments)}}()))).filter((function(e){return Boolean(e)})).map((function(e){return{local:e.local,screenAudio:e.tracks.screenAudio,screenVideo:e.tracks.screenVideo,screenId:e.session_id+"-screen",session_id:e.session_id}})).filter(Boolean)}));return function(n){return e.apply(this,arguments)}}()}),[]),f=n.useCallback(l((function*(){s(yield d(a))})),[d,s,a]);return n.useEffect((function(){f()}),[f]),i.useRecoilTransactionObserver_UNSTABLE(l((function*(){s(yield d(a))}))),t.createElement(W.Provider,{value:{screens:u}},r)},H=function(e){var t=void 0===e?{}:e,i=t.onError,r=t.onLocalScreenShareStarted,a=t.onLocalScreenShareStopped,o=v(),u=n.useCallback((function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];null==o||o.startScreenShare.apply(o,n)}),[o]),l=n.useCallback((function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];null==o||o.stopScreenShare.apply(o,n)}),[o]);k("local-screen-share-started",n.useCallback((function(){return null==r?void 0:r()}),[r])),k("local-screen-share-stopped",n.useCallback((function(){return null==a?void 0:a()}),[a])),k("nonfatal-error",n.useCallback((function(e){"screen-share-error"===e.type&&(null==i||i(e))}),[i]));var c=n.useContext(W).screens;return{isSharingScreen:c.some((function(e){return e.local})),screens:c,startScreenShare:u,stopScreenShare:l}},G=function(e,n){void 0===n&&(n="video");var t=C(e,"tracks."+n);return t?c({},t,{isOff:"blocked"===t.state||"off"===t.state}):{isOff:!0,persistentTrack:void 0,state:"off",subscribed:!1}};function Q(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n.useCallback((function(e){for(var n=0;n<t.length;n++){var i=t[n];"function"==typeof i?i(e):i&&"object"==typeof i&&(i.current=e)}}),t)}var J=["onPlayFailed","sessionId","type"],$=n.memo(n.forwardRef((function(e,i){var r=e.onPlayFailed,a=e.sessionId,o=e.type,u=void 0===o?"audio":o,l=s(e,J),c=n.useRef(null),d=G(a,u),f=Q(c,i);return n.useEffect((function(){var e=c.current;if(e&&null!=d&&d.persistentTrack){var n,t=function(){n=setTimeout((function(){(e.readyState!==e.HAVE_ENOUGH_DATA||e.paused)&&(null==r||r({sessionId:a,target:e,type:u}))}),1500)},i=function(){clearTimeout(n)};return e.addEventListener("canplay",t),e.addEventListener("play",i),e.srcObject=new MediaStream([null==d?void 0:d.persistentTrack]),function(){null==e||e.removeEventListener("canplay",t),null==e||e.removeEventListener("play",i)}}}),[null==d?void 0:d.persistentTrack,r,a,u]),t.createElement("audio",Object.assign({autoPlay:!0,playsInline:!0,ref:f},l,{"data-session-id":a,"data-audio-type":u}))})));$.displayName="DailyAudioTrack";var K=n.memo(n.forwardRef((function(e,r){var a=e.autoSubscribeActiveSpeaker,o=void 0!==a&&a,u=e.maxSpeakers,c=void 0===u?5:u,s=e.onPlayFailed,d=e.playLocalScreenAudio,f=void 0!==d&&d,p=v(),y=n.useState(new Array(c).fill("")),m=y[0],g=y[1],k=H().screens,b=B(),h=F({ignoreLocal:!0}),S=n.useRef(null);n.useImperativeHandle(r,(function(){return{getActiveSpeakerAudio:function(){var e,n;return null!=(e=null==(n=S.current)?void 0:n.querySelector('audio[data-session-id="'+h+'"][data-audio-type="audio"]'))?e:null},getAllAudio:function(){var e,n;return Array.from(null!=(e=null==(n=S.current)?void 0:n.querySelectorAll("audio"))?e:[])},getAudioBySessionId:function(e){var n,t;return null!=(n=null==(t=S.current)?void 0:t.querySelector('audio[data-session-id="'+e+'"][data-audio-type="audio"]'))?n:null},getRmpAudio:function(){var e,n;return Array.from(null!=(e=null==(n=S.current)?void 0:n.querySelectorAll('audio[data-audio-type="rmpAudio"]'))?e:[])},getScreenAudio:function(){var e,n;return Array.from(null!=(e=null==(n=S.current)?void 0:n.querySelectorAll('audio[data-audio-type="screenAudio"]'))?e:[])},getRmpAudioBySessionId:function(e){var n,t;return null!=(n=null==(t=S.current)?void 0:t.querySelector('audio[data-session-id="'+e+'"][data-audio-type="rmpAudio"]'))?n:null},getScreenAudioBySessionId:function(e){var n,t;return null!=(n=null==(t=S.current)?void 0:t.querySelector('audio[data-session-id="'+e+'"][data-audio-type="screenAudio"]'))?n:null}}}),[h]);var C=i.useRecoilCallback((function(e){var n=e.snapshot;return function(){var e=l((function*(e){var t=(yield n.getPromise(P)).filter((function(e){return!e.local&&Boolean(e.tracks.audio.subscribed)})),i=function(e){return t.some((function(n){return n.session_id===e}))};if(!i(e)){if(!p||p.isDestroyed()||!o||p.subscribeToTracksAutomatically())return;p.updateParticipant(e,{setSubscribedTracks:{audio:!0}})}g((function(n){var r;if(n.includes(e))return n;var a=function(e){return!e||!i(e)};if(n.some(a)){var o=n.findIndex(a);return n[o]=e,[].concat(n)}var u=n.findIndex((function(e){return t.some((function(n){return n.session_id===e&&U(n.tracks.audio.state)}))}));if(u>=0)return n[u]=e,[].concat(n);var l=t.filter((function(e){return n.includes(e.session_id)&&e.session_id!==h})).sort((function(e,n){var t,i,r=null!=(t=null==e?void 0:e.last_active)?t:new Date("1970-01-01"),a=null!=(i=null==n?void 0:n.last_active)?i:new Date("1970-01-01");return r>a?1:r<a?-1:0}));if(!l.length){var c=n.findIndex((function(e){return e!==h}));return n[c]=e,[].concat(n)}var s=n.indexOf(null==(r=l[0])?void 0:r.session_id);return n[s]=e,[].concat(n)}))}));return function(n){return e.apply(this,arguments)}}()}),[h,o,p]),A=n.useCallback((function(e){g((function(n){if(!n.includes(e))return n;var t=[].concat(n),i=t.indexOf(e);return t[i]="",t}))}),[]);R(["active-speaker-change","track-started","participant-left"],n.useCallback((function(e){e.forEach((function(e){switch(e.action){case"active-speaker-change":if(e.activeSpeaker.peerId===b)return;C(e.activeSpeaker.peerId);break;case"track-started":"audio"===e.track.kind&&e.participant&&!e.participant.local&&C(e.participant.session_id);break;case"participant-left":A(e.participant.session_id)}}))}),[C,b,A]));var E=q({filter:n.useCallback((function(e){var n;return Boolean(null==e||null==(n=e.tracks)?void 0:n.rmpAudio)}),[])});return t.createElement("div",{ref:S},m.map((function(e,n){return t.createElement($,{key:"speaker-slot-"+n,onPlayFailed:s,sessionId:e,type:"audio"})})),k.filter((function(e){return!!f||!e.local})).map((function(e){return t.createElement($,{key:e.screenId,onPlayFailed:s,sessionId:e.session_id,type:"screenAudio"})})),E.map((function(e){return t.createElement($,{key:e+"-rmp",onPlayFailed:s,sessionId:e,type:"rmpAudio"})})))})));K.displayName="DailyAudio";var X=["automirror","fit","mirror","onResize","playableStyle","sessionId","style","type"],Y=n.forwardRef((function(e,i){var r=e.automirror,a=e.fit,o=void 0===a?"contain":a,u=e.mirror,l=e.onResize,d=e.playableStyle,f=void 0===d?{}:d,p=e.sessionId,v=e.style,y=void 0===v?{}:v,m=e.type,g=void 0===m?"video":m,k=s(e,X),b=B()===p,h="screenVideo"===g,S=b&&!h,R=n.useRef(null),A=Q(R,i),E=G(p,g),w=E.persistentTrack,_=S||h||!E.isOff,x=C(p,"tracks."+g),T=null==x?void 0:x.subscribed,L=n.useMemo((function(){if("boolean"==typeof u)return u;if(!r)return!1;if(!w)return S;var e=w.getSettings();return"facingMode"in e?S&&"user"===e.facingMode:S}),[r,S,u,w]);return n.useEffect((function(){var e=R.current;if(e){var n=function(){var n=e.play();void 0!==n&&n.then((function(){e.controls=!1})).catch((function(n){e.controls=!0,console.warn("Failed to play video",n)}))},t=function(){e.paused&&n()},i=function(){e.style.transform="scale(1)"},r=function(){e.style.transform="",setTimeout((function(){e.paused&&n()}),100)},a=function(){"hidden"!==document.visibilityState&&e.paused&&n()};return e.addEventListener("canplay",t),e.addEventListener("enterpictureinpicture",i),e.addEventListener("leavepictureinpicture",r),document.addEventListener("visibilitychange",a),function(){e.removeEventListener("canplay",t),e.removeEventListener("enterpictureinpicture",i),e.removeEventListener("leavepictureinpicture",r),document.removeEventListener("visibilitychange",a)}}}),[]),n.useEffect((function(){var e=R.current;if(e&&w)return e.srcObject=new MediaStream([w]),e.load(),function(){e.srcObject=null,e.load()}}),[w,null==w?void 0:w.id]),n.useEffect((function(){var e,n=R.current;if(l&&n)return t(),n.addEventListener("loadedmetadata",t),n.addEventListener("resize",t),function(){e&&cancelAnimationFrame(e),n.removeEventListener("loadedmetadata",t),n.removeEventListener("resize",t)};function t(){e&&cancelAnimationFrame(e),e=requestAnimationFrame((function(){var e=R.current;if(e&&!document.hidden){var n=e.videoWidth,t=e.videoHeight;n&&t&&(null==l||l({aspectRatio:n/t,height:t,width:n}))}}))}}),[l]),t.createElement("video",Object.assign({autoPlay:!0,muted:!0,playsInline:!0,ref:A,"data-local":b,"data-mirrored":L||void 0,"data-playable":_||void 0,"data-session-id":p,"data-subscribed":T,"data-video-type":g,style:c({objectFit:o,transform:L?"scale(-1, 1)":""},y,_?f:{})},k))}));Y.displayName="DailyVideo";var Z=n.createContext({refreshDevices:function(){return Promise.resolve()}}),ee=i.atom({key:"daily-react-general-camera-state",default:"idle"}),ne=i.atom({key:"daily-react-general-microphone-state",default:"idle"}),te=i.atom({key:"daily-react-camera-devices",default:[]}),ie=i.atom({key:"daily-react-microphone-devices",default:[]}),re=i.atom({key:"daily-react-speaker-devices",default:[]}),ae=i.atom({key:"daily-react-last-camera-error",default:null}),oe=function(e){var r=e.children,a=v(),o=i.useRecoilCallback((function(e){var n=e.transact_UNSTABLE;return l((function*(){var e,t,i,r;if(void 0!==(null==(e=navigator)||null==(t=e.mediaDevices)?void 0:t.getUserMedia)&&void 0!==(null==(i=navigator)||null==(r=i.mediaDevices)?void 0:r.enumerateDevices)){if(a)try{var o=(yield a.enumerateDevices()).devices,u=o.filter((function(e){return"videoinput"===e.kind&&""!==e.deviceId})),l=o.filter((function(e){return"audioinput"===e.kind&&""!==e.deviceId})),c=o.filter((function(e){return"audiooutput"===e.kind&&""!==e.deviceId})),s=yield a.getInputDevices(),d=s.camera,f=s.mic,p=s.speaker,v=function(e,n,t){var i,r;return{device:n,selected:"deviceId"in e&&n.deviceId===e.deviceId,state:null!=(i=null==(r=t.find((function(e){return e.device.deviceId===n.deviceId})))?void 0:r.state)?i:"granted"}},y=function(e,n){return"default"===e.device.deviceId?-1:"default"===n.device.deviceId?1:e.device.label<n.device.label?-1:e.device.label>n.device.label?1:0};n((function(e){var n=e.set;n(te,(function(e){return u.filter(Boolean).map((function(n){return v(d,n,e)})).sort(y)})),n(ie,(function(e){return l.filter(Boolean).map((function(n){return v(f,n,e)})).sort(y)})),n(re,(function(e){return c.filter(Boolean).map((function(n){return v(p,n,e)})).sort(y)}))}))}catch(e){n((function(e){var n=e.set;n(ee,"not-supported"),n(ne,"not-supported")}))}}else n((function(e){var n=e.set;n(ee,"not-supported"),n(ne,"not-supported")}))}))}),[a]),u=i.useRecoilCallback((function(e){var n=e.set,t=e.snapshot,i=e.transact_UNSTABLE;return l((function*(){var e,r,u,l,s,d,f,p,v,y,m,g,k,b;if(a){var h=yield t.getPromise(ee),S=yield t.getPromise(ne),C=a.participants();if(C.local){var R=C.local.tracks,A="prompt",E="prompt";if(navigator.permissions)try{A=(yield navigator.permissions.query({name:"camera"})).state,E=(yield navigator.permissions.query({name:"microphone"})).state}catch(e){}var w="prompt"===A&&["idle","pending"].includes(h)&&"interrupted"===R.video.state&&!R.video.persistentTrack,_=["idle","pending"].includes(h)&&!R.video.persistentTrack&&Boolean(null==(e=R.video.off)?void 0:e.byUser),x="prompt"===E&&["idle","pending"].includes(S)&&"interrupted"===R.audio.state&&!R.audio.persistentTrack,T=["idle","pending"].includes(S)&&!R.audio.persistentTrack&&Boolean(null==(r=R.audio.off)?void 0:r.byUser);null!=(u=R.audio)&&null!=(l=u.blocked)&&l.byDeviceInUse?i((function(e){var n=e.set;n(ne,"in-use"),n(ie,(function(e){return e.map((function(e){return e.selected?c({},e,{state:"in-use"}):e}))}))})):null!=(s=R.audio)&&null!=(d=s.blocked)&&d.byDeviceMissing?n(ne,"not-found"):null!=(f=R.audio)&&null!=(p=f.blocked)&&p.byPermissions||"denied"===E?n(ne,"blocked"):x?n(ne,"pending"):T?n(ne,"idle"):i((function(e){var n=e.set;n(ne,"granted"),n(ie,(function(e){return e.map((function(e){return e.selected?c({},e,{state:"granted"}):e}))}))})),null!=(v=R.video)&&null!=(y=v.blocked)&&y.byDeviceInUse?i((function(e){var n=e.set;n(ee,"in-use"),n(te,(function(e){return e.map((function(e){return e.selected?c({},e,{state:"in-use"}):e}))}))})):null!=(m=R.video)&&null!=(g=m.blocked)&&g.byDeviceMissing?n(ee,"not-found"):null!=(k=R.video)&&null!=(b=k.blocked)&&b.byPermissions||"denied"===A?n(ee,"blocked"):w?n(ee,"pending"):_?n(ee,"idle"):i((function(e){var n=e.set;n(ee,"granted"),n(te,(function(e){return e.map((function(e){return e.selected?c({},e,{state:"granted"}):e}))}))})),o()}}}))}),[a,o]);return k("participant-updated",n.useCallback((function(e){e.participant.local&&u()}),[u])),k("available-devices-updated",o),k("selected-devices-updated",o),k("camera-error",i.useRecoilCallback((function(e){var n=e.transact_UNSTABLE;return function(e){n((function(n){var t,i,r,a,o,u,l,c=n.set;switch(c(ae,e.error),null==(t=e.error)?void 0:t.type){case"cam-in-use":c(ee,"in-use");break;case"mic-in-use":c(ne,"in-use");break;case"cam-mic-in-use":c(ee,"in-use"),c(ne,"in-use");break;case"not-found":null!=(i=e.error)&&i.missingMedia.includes("video")&&c(ee,"not-found"),null!=(r=e.error)&&r.missingMedia.includes("audio")&&c(ne,"not-found");break;case"permissions":null!=(a=e.error)&&a.blockedMedia.includes("video")&&c(ee,"blocked"),null!=(o=e.error)&&o.blockedMedia.includes("audio")&&c(ne,"blocked");break;case"constraints":"invalid"===(null==(u=e.error)?void 0:u.reason)?(c(ee,"constraints-invalid"),c(ne,"constraints-invalid")):"none-specified"===(null==(l=e.error)?void 0:l.reason)&&(c(ee,"constraints-none-specified"),c(ne,"constraints-none-specified"));break;case"undefined-mediadevices":c(ee,"undefined-mediadevices"),c(ne,"undefined-mediadevices");break;case"unknown":default:c(ee,"unknown"),c(ne,"unknown")}}))}}),[])),k("started-camera",i.useRecoilCallback((function(e){var n=e.transact_UNSTABLE;return function(){n((function(e){var n=e.set;n(ee,"granted"),n(ne,"granted")})),u()}}),[u])),t.createElement(Z.Provider,{value:{refreshDevices:o}},r)},ue=i.atom({key:"daily-react-live-streaming",default:{errorMsg:void 0,isLiveStreaming:!1,layout:void 0}}),le=function(e){var n=e.children;return k("live-streaming-started",i.useRecoilCallback((function(e){var n=e.set;return function(e){n(ue,{isLiveStreaming:!0,layout:null==e?void 0:e.layout})}}),[])),k("live-streaming-stopped",i.useRecoilCallback((function(e){var n=e.set;return function(){n(ue,(function(e){return c({},e,{isLiveStreaming:!1,layout:void 0})}))}}),[])),k("live-streaming-error",i.useRecoilCallback((function(e){var n=e.set;return function(e){n(ue,(function(n){return c({},n,{errorMsg:e.errorMsg})}))}}),[])),k("left-meeting",i.useRecoilCallback((function(e){var n=e.reset;return function(){n(ue)}}),[])),t.createElement(t.Fragment,null,n)},ce=i.atom({key:"daily-react-meeting-state",default:"new"}),se=i.atom({key:"daily-react-meeting-error",default:null}),de=i.atom({key:"daily-react-non-fatal-error",default:null}),fe=i.atom({key:"meeting-session-data",default:{data:void 0,topology:"none"}}),pe=function(e){var n=e.children,r=v(),a=i.useRecoilCallback((function(e){var n=e.set;return function(){if(r){var e=r.meetingState();return n(ce,e),e}}}),[r]);k("loading",a),k("loaded",a),k("joining-meeting",a),k("joined-meeting",a),k("left-meeting",a),k("error",i.useRecoilCallback((function(e){var n=e.set;return function(e){n(se,e),a()}}),[a])),k("nonfatal-error",i.useRecoilCallback((function(e){var n=e.set;return function(e){n(de,e)}}),[]));var o=i.useRecoilCallback((function(e){var n=e.set;return function(){r&&n(fe,r.meetingSessionState())}}),[r]);return k("joined-meeting",o),k("meeting-session-state-updated",i.useRecoilCallback((function(e){var n=e.set;return function(e){n(fe,e.meetingSessionState)}}),[])),k("left-meeting",i.useRecoilCallback((function(e){var n=e.reset;return function(){n(fe)}}),[])),k("call-instance-destroyed",i.useRecoilCallback((function(e){var n=e.transact_UNSTABLE;return function(){n((function(e){var n=e.reset;n(ce),n(se),n(de),n(fe)}))}}),[])),t.createElement(t.Fragment,null,n)},ve=i.atom({key:"daily-react-topology",default:"none"}),ye=i.atom({key:"daily-react-networkQuality",default:100}),me=i.atom({key:"daily-react-networkThreshold",default:"good"}),ge=function(e){var r=e.children,a=v(),o=i.useRecoilValue(ve),u=i.useRecoilCallback((function(e){var n=e.set;return l((function*(){if(a){var e=yield a.getNetworkTopology();e&&"none"!==(null==e?void 0:e.topology)&&n(ve,e.topology)}}))}),[a]);return k("joined-meeting",u),k("network-connection",i.useRecoilCallback((function(e){var n=e.set;return function(e){switch(e.event){case"connected":"peer-to-peer"===e.type&&n(ve,"peer"),"sfu"===e.type&&n(ve,"sfu")}}}),[])),k("network-quality-change",i.useRecoilCallback((function(e){var n=e.transact_UNSTABLE;return function(e){n((function(n){var t=n.set;t(ye,(function(n){return n!==e.quality?e.quality:n})),t(me,(function(n){return n!==e.threshold?e.threshold:n}))}))}}),[])),k("left-meeting",i.useRecoilCallback((function(e){var n=e.transact_UNSTABLE;return function(){n((function(e){var n=e.reset;n(ve),n(ye),n(me)}))}}),[])),n.useEffect((function(){a&&"none"===o&&u()}),[a,u,o]),t.createElement(t.Fragment,null,r)},ke=i.atom({key:"daily-react-recording",default:{isLocalParticipantRecorded:!1,isRecording:!1}}),be=function(e){var r=e.children,a=i.useSetRecoilState(ke),o=B(),u=q({filter:"record"});return n.useEffect((function(){var e=u.length>0,n=u.includes(o||"local");a((function(t){return c({},t,{isLocalParticipantRecorded:"local"!==(null==t?void 0:t.type)&&null!=t&&t.type?t.isLocalParticipantRecorded:e,isRecording:"local"!==(null==t?void 0:t.type)&&null!=t&&t.type?t.isRecording:e,local:"local"!==(null==t?void 0:t.type)&&null!=t&&t.type||!e?null==t?void 0:t.local:n,type:e?"local":null==t?void 0:t.type})}))}),[o,u,a]),k("recording-started",i.useRecoilCallback((function(e){var n=e.set;return function(e){var t=!0;switch(e.type){case"cloud-beta":case"cloud":var i;o&&"single-participant"===(null==(i=e.layout)?void 0:i.preset)&&e.layout.session_id!==o&&(t=!1)}n(ke,{error:!1,isLocalParticipantRecorded:t,isRecording:!0,layout:null==e?void 0:e.layout,local:null==e?void 0:e.local,recordingId:null==e?void 0:e.recordingId,recordingStartedDate:new Date,startedBy:null==e?void 0:e.startedBy,type:null==e?void 0:e.type})}}),[o])),k("recording-stopped",i.useRecoilCallback((function(e){var n=e.set;return function(){n(ke,(function(e){return c({},e,{isLocalParticipantRecorded:!1,isRecording:!1})}))}}),[])),k("recording-error",i.useRecoilCallback((function(e){var n=e.set;return function(){n(ke,(function(e){return c({},e,{error:!0,isLocalParticipantRecorded:!1,isRecording:!1})}))}}),[])),k("left-meeting",i.useRecoilCallback((function(e){var n=e.reset;return function(){n(ke)}}),[])),t.createElement(t.Fragment,null,r)},he=function(){return i.useRecoilValue(ce)},Se=i.atom({key:"daily-react-room",default:null}),Ce=function(e){var n=e.children,r=v(),a=he(),o=i.useRecoilCallback((function(e){var n=e.set;return l((function*(){if(r&&"left-meeting"!==a){var e=yield r.room();return e&&"id"in e&&n(Se,e),e}}))}),[r,a]);return k("access-state-updated",o),k("left-meeting",i.useRecoilCallback((function(e){var n=e.reset;return function(){n(Se)}}),[])),t.createElement(t.Fragment,null,n)},Re=["children","recoilRootProps"],Ae=function(e,t){var r=void 0===t?{}:t,a=r.onParticipantLeft,o=r.onParticipantUpdated,u=i.useRecoilValue(I(e));return R(["participant-updated","participant-left"],n.useCallback((function(n){var t=n.filter((function(n){return n.participant.session_id===e}));t.length&&t.forEach((function(e){switch(e.action){case"participant-updated":null==o||o(e);break;case"participant-left":null==a||a(e)}}))}),[a,o,e])),u},Ee="data:application/javascript;charset=utf8,"+encodeURIComponent("\n class AudioLevelProcessor extends AudioWorkletProcessor {\n volume;\n interval;\n nextFrame;\n \n constructor() {\n super();\n this.volume = 0;\n this.interval = 25;\n this.nextFrame = this.interval;\n }\n \n get intervalInFrames() {\n // sampleRate is globally defined in AudioWorklets.\n // See https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletGlobalScope\n // eslint-disable-next-line no-undef\n return (this.interval / 1000) * sampleRate;\n }\n \n process(inputList) {\n const firstInput = inputList[0];\n \n if (firstInput.length > 0) {\n const inputData = firstInput[0];\n let total = 0;\n \n for (let i = 0; i < inputData.length; ++i) {\n total += Math.abs(inputData[i]);\n }\n \n const rms = Math.sqrt(total / inputData.length);\n this.volume = Math.max(0, Math.min(1, rms));\n \n this.nextFrame -= inputData.length;\n if (this.nextFrame < 0) {\n this.nextFrame += this.intervalInFrames;\n this.port.postMessage({ volume: this.volume });\n }\n }\n \n return true;\n }\n }\n \n registerProcessor('audiolevel', AudioLevelProcessor); \n"),we=i.atom({key:"cpu-load-state",default:{state:"low",reason:"none"}}),_e=function(){return{meetingError:i.useRecoilValue(se),nonFatalError:i.useRecoilValue(de)}},xe=i.atom({key:"daily-react-input-settings",default:null}),Te=i.atom({key:"daily-react-participant-counts",default:{hidden:0,present:0}}),Le=i.atomFamily({key:"daily-react-participant-receive-settings",default:{}}),Ie=function(){return i.useRecoilValue(Se)},Pe=i.atom({key:"daily-react-send-settings",default:null}),De=i.atom({key:"daily-react-transcription",default:{isTranscriptionEnabled:!1,isTranscribing:!1,model:"general",language:"en",transcriptions:[]}});exports.DailyAudio=K,exports.DailyAudioTrack=$,exports.DailyProvider=function(e){var r=e.children,o=e.recoilRootProps,u=void 0===o?{}:o,d=s(e,Re),v="callObject"in d?d.callObject:null,m=n.useState(v),g=m[0],k=m[1],b=n.useRef({});n.useEffect((function(){v&&(v?((null==g?void 0:g._callFrameId)!==(null==v?void 0:v._callFrameId)||!g&&v)&&k(v):k(null))}),[g,v]);var h=n.useCallback((function(e){if("action"in e)for(var n,t=f(null!=(i=null==(r=b.current)||null==(a=r[e.action])?void 0:a.values())?i:[]);!(n=t()).done;){var i,r,a;(0,n.value)(e)}}),[]),S=n.useCallback((function(e){e&&Object.keys(b.current).forEach((function(n){e.off(n,h),e.isDestroyed()||e.on(n,h)}))}),[h]),C=n.useRef();n.useEffect((function(){if("callObject"in d)return k(d.callObject),void S(d.callObject);function e(){return(e=l((function*(e){yield e.destroy()}))).apply(this,arguments)}if(g)A(C.current,d)||function(n){e.apply(this,arguments)}(g);else{var n=a.getCallInstance();n||(n=a.createCallObject(c({},d)),C.current=d),k(n),S(n),n.once("call-instance-destroyed",(function(){k(null)}))}}),[g,S,d]);var R=n.useCallback((function(e,n,t){var i,r;b.current[e]||(b.current[e]=new Map,g&&(g.off(e,h),g.isDestroyed()||g.on(e,h))),null!=(i=b.current[e])&&i.has(t)||null==(r=b.current[e])||r.set(t,n)}),[g,h]),E=n.useCallback((function(e,n){var t,i;null==(t=b.current[e])||t.delete(n),0===(null==(i=b.current[e])?void 0:i.size)&&(null==g||g.off(e,h),delete b.current[e])}),[g,h]);return t.createElement(i.RecoilRoot,Object.assign({},u),t.createElement(p.Provider,{value:g},t.createElement(y.Provider,{value:{on:R,off:E}},t.createElement(Ce,null,t.createElement(pe,null,t.createElement(ge,null,t.createElement(V,null,t.createElement(z,null,t.createElement(be,null,t.createElement(le,null,t.createElement(oe,null,r)))))))))))},exports.DailyVideo=Y,exports.useActiveParticipant=function(e){var t=void 0===e?{}:e,r=t.ignoreLocal,a=void 0!==r&&r,o=t.onActiveSpeakerChange,u=v(),l=i.useRecoilValue(_),c=n.useState(""),s=c[1],d=Ae(c[0]);return n.useEffect((function(){var e;if(u){var n=null==u||null==(e=u.participants())?void 0:e.local;a&&l===(null==n?void 0:n.session_id)||s(null!=l?l:"")}}),[u,a,l]),k("active-speaker-change",n.useCallback((function(e){null==o||o(e)}),[o])),d},exports.useActiveSpeakerId=F,exports.useAppMessage=function(e){var t=(void 0===e?{}:e).onAppMessage,i=v(),r=n.useCallback((function(e,n){void 0===n&&(n="*"),i&&i.sendAppMessage(e,n)}),[i]),a=n.useCallback((function(e){null==t||t(e,r)}),[t,r]);return k("app-message",a),r},exports.useAudioLevel=function(e,t){var i=n.useRef();n.useEffect((function(){if(e){var n="undefined"!=typeof AudioContext?AudioContext:void 0!==window.webkitAudioContext?window.webkitAudioContext:null;if(n){i.current||(i.current=new n);var r=i.current;if(r){var a,o=r.createMediaStreamSource(new MediaStream([e]));return function(){var e=l((function*(){try{a=new AudioWorkletNode(r,"audiolevel")}catch(e){try{yield r.audioWorklet.addModule(Ee),a=new AudioWorkletNode(r,"audiolevel")}catch(e){console.error(e)}}if(a){a.port.onmessage=function(e){var n=0;e.data.volume&&(n=e.data.volume),a&&t(n)};try{o.connect(a).connect(r.destination)}catch(e){console.warn(e)}}}));return function(){return e.apply(this,arguments)}}()(),function(){var e;null==(e=a)||e.disconnect(),a=null,null==o||o.disconnect()}}}}}),[t,e])},exports.useAudioTrack=function(e){return G(e,"audio")},exports.useCPULoad=function(e){var t=(void 0===e?{}:e).onCPULoadChange,r=i.useRecoilValue(we),a=v(),u=he(),c=i.useRecoilCallback((function(e){var n=e.set,t=e.snapshot;return function(){var e=l((function*(e){var i=yield t.getPromise(we);o(i,e)||n(we,e)}));return function(n){return e.apply(this,arguments)}}()}),[]);return n.useEffect((function(){var e=!0;if(a&&!a.isDestroyed()&&"joined-meeting"===u)return a.getCpuLoadStats().then((function(n){e&&c({state:n.cpuLoadState,reason:n.cpuLoadStateReason})})),function(){e=!1}}),[a,u,c]),k("cpu-load-change",n.useCallback((function(e){c({state:e.cpuLoadState,reason:e.cpuLoadStateReason}),null==t||t(e)}),[t,c])),r},exports.useDaily=v,exports.useDailyError=_e,exports.useDailyEvent=k,exports.useDevices=function(){var e=v(),t=i.useRecoilValue(ee),r=i.useRecoilValue(ne),a=i.useRecoilValue(te),o=i.useRecoilValue(ie),u=i.useRecoilValue(re),c=i.useRecoilValue(ae),s=n.useContext(Z).refreshDevices,d=n.useCallback(function(){var n=l((function*(n){yield null==e?void 0:e.setInputDevicesAsync({audioDeviceId:null,videoDeviceId:n})}));return function(e){return n.apply(this,arguments)}}(),[e]),f=n.useCallback(function(){var n=l((function*(n){yield null==e?void 0:e.setInputDevicesAsync({audioDeviceId:n,videoDeviceId:null})}));return function(e){return n.apply(this,arguments)}}(),[e]),p=n.useCallback(function(){var n=l((function*(n){yield null==e?void 0:e.setOutputDeviceAsync({outputDeviceId:n})}));return function(e){return n.apply(this,arguments)}}(),[e]),y=["blocked","in-use","not-found","constraints-invalid","constraints-none-specified","undefined-mediadevices","unknown"];return{cameraError:c,cameras:a,camState:t,currentCam:a.find((function(e){return e.selected})),currentMic:o.find((function(e){return e.selected})),currentSpeaker:u.find((function(e){return e.selected})),hasCamError:y.includes(t),hasMicError:y.includes(r),microphones:o,micState:r,refreshDevices:s,setCamera:d,setMicrophone:f,setSpeaker:p,speakers:u}},exports.useInputSettings=function(e){var t=void 0===e?{}:e,r=t.onError,a=t.onInputSettingsUpdated,o=i.useRecoilValue(xe),u=_e().nonFatalError,l=v(),c=i.useRecoilCallback((function(e){var n=e.set;return function(e){n(xe,e)}}),[]);n.useEffect((function(){l&&l.getInputSettings().then(c)}),[l,c]),k("input-settings-updated",n.useCallback((function(e){c(e.inputSettings),null==a||a(e)}),[a,c])),k("nonfatal-error",n.useCallback((function(e){"input-settings-error"===e.type&&(null==r||r(e))}),[r]));var s=n.useCallback((function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];null==l||l.updateInputSettings.apply(l,n)}),[l]);return{errorMsg:"input-settings-error"===(null==u?void 0:u.type)?u.errorMsg:null,inputSettings:o,updateInputSettings:s}},exports.useLiveStreaming=function(e){var t=void 0===e?{}:e,r=t.onLiveStreamingError,a=t.onLiveStreamingStarted,o=t.onLiveStreamingStopped,u=t.onLiveStreamingUpdated,l=t.onLiveStreamingWarning,s=v(),d=i.useRecoilValue(ue);return k("live-streaming-started",n.useCallback((function(e){null==a||a(e)}),[a])),k("live-streaming-stopped",n.useCallback((function(e){null==o||o(e)}),[o])),k("live-streaming-updated",n.useCallback((function(e){null==u||u(e)}),[u])),k("live-streaming-error",n.useCallback((function(e){null==r||r(e)}),[r])),k("nonfatal-error",n.useCallback((function(e){"live-streaming-warning"===e.type&&(null==l||l(e))}),[l])),c({},d,{startLiveStreaming:n.useCallback((function(){s&&s.startLiveStreaming.apply(s,arguments)}),[s]),stopLiveStreaming:n.useCallback((function(){s&&s.stopLiveStreaming.apply(s,arguments)}),[s]),updateLiveStreaming:n.useCallback((function(){s&&s.updateLiveStreaming.apply(s,arguments)}),[s])})},exports.useLocalParticipant=function(){var e=i.useRecoilValue(x);return Ae(e)},exports.useLocalSessionId=B,exports.useMediaTrack=G,exports.useMeetingSessionState=function(e){var t=(void 0===e?{}:e).onError,r=i.useRecoilValue(fe);return k("nonfatal-error",n.useCallback((function(e){"meeting-session-data-error"===e.type&&(null==t||t(e))}),[t])),{data:null==r?void 0:r.data,topology:null==r?void 0:r.topology}},exports.useMeetingState=he,exports.useNetwork=function(e){var t=void 0===e?{}:e,r=t.onNetworkConnection,a=t.onNetworkQualityChange,o=v(),u=i.useRecoilValue(ve),c=i.useRecoilValue(ye),s=i.useRecoilValue(me);return k("network-connection",n.useCallback((function(e){null==r||r(e)}),[r])),k("network-quality-change",n.useCallback((function(e){null==a||a(e)}),[a])),{getStats:n.useCallback(l((function*(){var e=yield null==o?void 0:o.getNetworkStats();return null==e?void 0:e.stats})),[o]),quality:c,threshold:s,topology:u}},exports.useParticipant=Ae,exports.useParticipantCounts=function(e){var t=(void 0===e?{}:e).onParticipantCountsUpdated,r=v(),a=i.useRecoilValue(Te),o=i.useRecoilCallback((function(e){var n=e.set;return function(e){n(Te,e)}}),[]);return k("participant-counts-updated",n.useCallback((function(e){o(e.participantCounts),null==t||t(e)}),[t,o])),n.useEffect((function(){r&&!r.isDestroyed()&&o(r.participantCounts())}),[r,o]),a},exports.useParticipantIds=q,exports.useParticipantProperty=C,exports.usePermissions=function(e){var n,t,i,r,a,o,u,l,c,s=B(),d=C(null!=e?e:s,"permissions"),f="boolean"==typeof(null==d?void 0:d.canSend)?null==d?void 0:d.canSend:Boolean(null==d||null==(n=d.canSend)?void 0:n.has("audio")),p="boolean"==typeof(null==d?void 0:d.canSend)?null==d?void 0:d.canSend:Boolean(null==d||null==(t=d.canSend)?void 0:t.has("video")),v="boolean"==typeof(null==d?void 0:d.canSend)?null==d?void 0:d.canSend:Boolean(null==d||null==(i=d.canSend)?void 0:i.has("customAudio")),y="boolean"==typeof(null==d?void 0:d.canSend)?null==d?void 0:d.canSend:Boolean(null==d||null==(r=d.canSend)?void 0:r.has("customVideo")),m="boolean"==typeof(null==d?void 0:d.canSend)?null==d?void 0:d.canSend:Boolean(null==d||null==(a=d.canSend)?void 0:a.has("screenAudio")),g="boolean"==typeof(null==d?void 0:d.canSend)?null==d?void 0:d.canSend:Boolean(null==d||null==(o=d.canSend)?void 0:o.has("screenVideo"));return{canAdminParticipants:"boolean"==typeof(null==d?void 0:d.canAdmin)?null==d?void 0:d.canAdmin:Boolean(null==d||null==(u=d.canAdmin)?void 0:u.has("participants")),canAdminStreaming:"boolean"==typeof(null==d?void 0:d.canAdmin)?null==d?void 0:d.canAdmin:Boolean(null==d||null==(l=d.canAdmin)?void 0:l.has("streaming")),canAdminTranscription:"boolean"==typeof(null==d?void 0:d.canAdmin)?null==d?void 0:d.canAdmin:Boolean(null==d||null==(c=d.canAdmin)?void 0:c.has("transcription")),canSendAudio:f,canSendCustomAudio:v,canSendCustomVideo:y,canSendScreenAudio:m,canSendScreenVideo:g,canSendVideo:p,hasPresence:null==d?void 0:d.hasPresence,permissions:d}},exports.useReceiveSettings=function(e){var t=void 0===e?{}:e,r=t.id,a=void 0===r?"base":r,o=t.onReceiveSettingsUpdated,u=i.useRecoilValue(Le("base")),l=i.useRecoilValue(Le(a)),s=v(),d=he(),f=i.useRecoilCallback((function(e){var n=e.transact_UNSTABLE;return function(e){n((function(n){for(var t=n.reset,i=n.set,r=c({},e),o=0,u=Object.entries(r);o<u.length;o++){var l=u[o],s=l[1];i(Le(l[0]),s)}a in r||t(Le(a))}))}}),[a]);k("receive-settings-updated",n.useCallback((function(e){f(e.receiveSettings),null==o||o(e)}),[o,f])),n.useEffect((function(){s&&!s.isDestroyed()&&s.getReceiveSettings().then(f)}),[s,f]);var p=n.useCallback((function(){if(s&&"joined-meeting"===d){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];null==s||null==s.updateReceiveSettings||s.updateReceiveSettings.apply(s,n)}}),[s,d]);return{receiveSettings:"base"===a||0===Object.keys(l).length?u:l,updateReceiveSettings:p}},exports.useRecording=function(e){var t=void 0===e?{}:e,r=t.onRecordingData,a=t.onRecordingError,o=t.onRecordingStarted,u=t.onRecordingStopped,l=v(),s=i.useRecoilValue(ke);return k("recording-started",n.useCallback((function(e){null==o||o(e)}),[o])),k("recording-stopped",n.useCallback((function(e){null==u||u(e)}),[u])),k("recording-error",n.useCallback((function(e){null==a||a(e)}),[a])),k("recording-data",n.useCallback((function(e){null==r||r(e)}),[r])),c({},s,{startRecording:n.useCallback((function(){l&&l.startRecording.apply(l,arguments)}),[l]),stopRecording:n.useCallback((function(){l&&l.stopRecording.apply(l,arguments)}),[l]),updateRecording:n.useCallback((function(){l&&l.updateRecording.apply(l,arguments)}),[l])})},exports.useRoom=Ie,exports.useRoomExp=function(e){var t,r,a,o,u,l,c=(void 0===e?{}:e).onCountdown,s=i.useRecoilValue(T),d=Ie(),f=n.useState(null),p=f[0],v=f[1];return n.useEffect((function(){var e,n,t,i,r,a,o,u,l,c,f,p,y=null!=(e=null!=(n=null==d||null==(t=d.tokenConfig)?void 0:t.eject_after_elapsed)?n:null==d||null==(i=d.config)?void 0:i.eject_after_elapsed)?e:0,m=null!=(r=null!=(a=null==d||null==(o=d.tokenConfig)?void 0:o.exp)?a:null==d||null==(u=d.config)?void 0:u.exp)?r:0,g=null!=(l=null!=(c=null==d||null==(f=d.tokenConfig)?void 0:f.eject_at_token_exp)?c:null==d||null==(p=d.config)?void 0:p.eject_at_room_exp)&&l,k=new Date(0);if(y&&s&&(k=new Date(s.getTime()+1e3*y)),g&&m){var b=new Date(1e3*m);(!k.getTime()||k.getTime()>0&&b<k)&&(k=b)}0!==k.getTime()&&v((function(e){return(null==e?void 0:e.getTime())!==k.getTime()?k:e}))}),[s,null==d||null==(t=d.config)?void 0:t.eject_after_elapsed,null==d||null==(r=d.config)?void 0:r.eject_at_room_exp,null==d||null==(a=d.config)?void 0:a.exp,null==d||null==(o=d.tokenConfig)?void 0:o.eject_after_elapsed,null==d||null==(u=d.tokenConfig)?void 0:u.eject_at_token_exp,null==d||null==(l=d.tokenConfig)?void 0:l.exp]),n.useEffect((function(){if(p&&0!==p.getTime()){var e=setInterval((function(){var e,n=(null!=(e=null==p?void 0:p.getTime())?e:0)/1e3-Date.now()/1e3;if(!(n<0)){var t=Math.max(0,Math.floor(n/3600)),i=Math.max(0,Math.floor(n%3600/60)),r=Math.max(0,Math.floor(n%60));null==c||c({hours:t,minutes:i,seconds:r})}}),1e3);return function(){clearInterval(e)}}}),[p,c]),{ejectDate:p}},exports.useScreenAudioTrack=function(e){return G(e,"screenAudio")},exports.useScreenShare=H,exports.useScreenVideoTrack=function(e){return G(e,"screenVideo")},exports.useSendSettings=function(e){var t=(void 0===e?{}:e).onSendSettingsUpdated,r=v(),a=i.useRecoilValue(Pe);k("send-settings-updated",i.useRecoilCallback((function(e){var n=e.set;return function(e){n(Pe,e.sendSettings),null==t||t(e)}}),[t]));var o=i.useRecoilCallback((function(e){var n=e.set;return function(e){n(Pe,e)}}),[]);return n.useEffect((function(){r&&!r.isDestroyed()&&o(r.getSendSettings())}),[r,o]),{sendSettings:a,updateSendSettings:n.useCallback(l((function*(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var i=yield null==r?void 0:r.updateSendSettings.apply(r,n);if(i)return o(i),i})),[r,o])}},exports.useThrottledDailyEvent=R,exports.useTranscription=function(e){var t,r=void 0===e?{}:e,a=r.onTranscriptionAppData,o=r.onTranscriptionError,u=r.onTranscriptionStarted,l=r.onTranscriptionStopped,s=v(),d=i.useRecoilValue(De),f=i.useSetRecoilState(De),p=Ie();return n.useEffect((function(){var e;null!=p&&null!=(e=p.domainConfig)&&e.enable_transcription&&f((function(e){return c({},e,{isTranscriptionEnabled:!0})}))}),[null==p||null==(t=p.domainConfig)?void 0:t.enable_transcription,f]),k("transcription-started",i.useRecoilCallback((function(e){var n=e.set;return function(e){n(De,c({isTranscriptionEnabled:!0,error:!1,isTranscribing:!0,transcriptionStartDate:new Date,transcriptions:[]},e)),null==u||u(e)}}),[u])),k("transcription-stopped",i.useRecoilCallback((function(e){var n=e.set;return function(e){n(De,(function(n){return c({},n,{updatedBy:null==e?void 0:e.updatedBy,isTranscribing:!1})})),null==l||l(e)}}),[l])),k("transcription-error",i.useRecoilCallback((function(e){var n=e.set;return function(e){n(De,(function(e){return c({},e,{error:!0,isTranscribing:!1})})),null==o||o(e)}}),[o])),k("app-message",i.useRecoilCallback((function(e){var n=e.set;return function(e){var t;"transcription"===(null==e?void 0:e.fromId)&&null!=e&&null!=(t=e.data)&&t.is_final&&(n(De,(function(n){return c({},n,{isTranscribing:!0,transcriptions:[].concat(n.transcriptions,[e.data])})})),null==a||a(e))}}),[a])),c({},d,{startTranscription:n.useCallback((function(){s&&s.startTranscription.apply(s,arguments)}),[s]),stopTranscription:n.useCallback((function(){s&&s.stopTranscription.apply(s,arguments)}),[s])})},exports.useVideoTrack=function(e){return G(e,"video")},exports.useWaitingParticipants=function(e){var t=void 0===e?{}:e,r=t.onWaitingParticipantAdded,a=t.onWaitingParticipantRemoved,o=t.onWaitingParticipantUpdated,u=v(),l=i.useRecoilValue(M);k("waiting-participant-added",n.useCallback((function(e){null==r||r(e)}),[r])),k("waiting-participant-removed",n.useCallback((function(e){null==a||a(e)}),[a])),k("waiting-participant-updated",n.useCallback((function(e){null==o||o(e)}),[o]));var c=n.useCallback((function(e,n){"*"!==e?null==u||u.updateWaitingParticipant(e,{grantRequestedAccess:n}):null==u||u.updateWaitingParticipants({"*":{grantRequestedAccess:n}})}),[u]);return{waitingParticipants:l,grantAccess:n.useCallback((function(e){c(e,!0)}),[c]),denyAccess:n.useCallback((function(e){c(e,!1)}),[c])}}; | ||
//# sourceMappingURL=daily-react.cjs.production.min.js.map |
@@ -14,2 +14,3 @@ export { DailyAudio } from './components/DailyAudio'; | ||
export { useDaily } from './hooks/useDaily'; | ||
export { useDailyError } from './hooks/useDailyError'; | ||
export { useDailyEvent } from './hooks/useDailyEvent'; | ||
@@ -16,0 +17,0 @@ export { useDevices } from './hooks/useDevices'; |
{ | ||
"version": "0.14.0", | ||
"version": "0.14.1", | ||
"license": "BSD-2-Clause", | ||
@@ -4,0 +4,0 @@ "keywords": [ |
@@ -14,2 +14,3 @@ export { DailyAudio } from './components/DailyAudio'; | ||
export { useDaily } from './hooks/useDaily'; | ||
export { useDailyError } from './hooks/useDailyError'; | ||
export { useDailyEvent } from './hooks/useDailyEvent'; | ||
@@ -16,0 +17,0 @@ export { useDevices } from './hooks/useDevices'; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1220331
12204