@nethesis/phone-island 0.7.42 → 0.7.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/index2.js +1 -1
- package/dist/_virtual/index3.js +1 -1
- package/dist/_virtual/index4.js +1 -1
- package/dist/_virtual/index5.js +1 -1
- package/dist/_virtual/index6.js +1 -1
- package/dist/_virtual/index7.js +1 -1
- package/dist/_virtual/index8.js +1 -1
- package/dist/components/Island.js +1 -1
- package/dist/components/Island.js.map +1 -1
- package/dist/components/RestAPI.js +1 -1
- package/dist/components/RestAPI.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/lib/devices/devices.js +1 -1
- package/dist/lib/devices/devices.js.map +1 -1
- package/dist/models/fetchDefaults.d.ts +32 -0
- package/dist/models/fetchDefaults.js +2 -0
- package/dist/models/fetchDefaults.js.map +1 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +1 -1
- package/dist/models/index.js.map +1 -1
- package/dist/node_modules/@fortawesome/react-fontawesome/index.es.js +1 -1
- package/dist/node_modules/@nethesis/nethesis-regular-svg-icons/index.mjs.js +2 -0
- package/dist/node_modules/@nethesis/nethesis-regular-svg-icons/index.mjs.js.map +1 -0
- package/dist/node_modules/@nethesis/nethesis-solid-svg-icons/index.mjs.js +2 -0
- package/dist/node_modules/@nethesis/nethesis-solid-svg-icons/index.mjs.js.map +1 -0
- package/dist/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +1 -1
- package/dist/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js.map +1 -1
- package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/index.js.map +1 -1
- package/dist/node_modules/mic-check/lib/index.js +1 -1
- package/dist/node_modules/mic-check/lib/index.js.map +1 -1
- package/dist/node_modules/object-assign/index.js +2 -2
- package/dist/node_modules/object-assign/index.js.map +1 -1
- package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +1 -1
- package/dist/node_modules/prop-types/factoryWithTypeCheckers.js.map +1 -1
- package/dist/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/react-moment/dist/index.js +1 -1
- package/dist/node_modules/react-redux/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +1 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js +1 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/services/user.js +1 -1
- package/dist/services/user.js.map +1 -1
- package/package.json +6 -2
- package/dist/_virtual/assert.js +0 -2
- package/dist/_virtual/assert.js.map +0 -1
- package/dist/_virtual/browser.js +0 -2
- package/dist/_virtual/browser.js.map +0 -1
- package/dist/_virtual/events.js +0 -2
- package/dist/_virtual/events.js.map +0 -1
- package/dist/_virtual/index10.js +0 -2
- package/dist/_virtual/index10.js.map +0 -1
- package/dist/_virtual/index11.js +0 -2
- package/dist/_virtual/index11.js.map +0 -1
- package/dist/_virtual/index9.js +0 -2
- package/dist/_virtual/index9.js.map +0 -1
- package/dist/_virtual/inherits.js +0 -2
- package/dist/_virtual/inherits.js.map +0 -1
- package/dist/_virtual/inherits_browser.js +0 -2
- package/dist/_virtual/inherits_browser.js.map +0 -1
- package/dist/_virtual/node.js +0 -2
- package/dist/_virtual/node.js.map +0 -1
- package/dist/_virtual/punycode.js +0 -2
- package/dist/_virtual/punycode.js.map +0 -1
- package/dist/_virtual/url.js +0 -2
- package/dist/_virtual/url.js.map +0 -1
- package/dist/_virtual/util.js +0 -2
- package/dist/_virtual/util.js.map +0 -1
- package/dist/_virtual/util2.js +0 -2
- package/dist/_virtual/util2.js.map +0 -1
- package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.mjs.js +0 -2
- package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.mjs.js.map +0 -1
- package/dist/node_modules/assert/assert.js +0 -9
- package/dist/node_modules/assert/assert.js.map +0 -1
- package/dist/node_modules/assert/node_modules/inherits/inherits.js +0 -2
- package/dist/node_modules/assert/node_modules/inherits/inherits.js.map +0 -1
- package/dist/node_modules/assert/node_modules/util/support/isBuffer.js +0 -2
- package/dist/node_modules/assert/node_modules/util/support/isBuffer.js.map +0 -1
- package/dist/node_modules/assert/node_modules/util/util.js +0 -2
- package/dist/node_modules/assert/node_modules/util/util.js.map +0 -1
- package/dist/node_modules/axios/index.js +0 -2
- package/dist/node_modules/axios/index.js.map +0 -1
- package/dist/node_modules/axios/lib/adapters/adapters.js +0 -2
- package/dist/node_modules/axios/lib/adapters/adapters.js.map +0 -1
- package/dist/node_modules/axios/lib/adapters/http.js +0 -2
- package/dist/node_modules/axios/lib/adapters/http.js.map +0 -1
- package/dist/node_modules/axios/lib/adapters/xhr.js +0 -2
- package/dist/node_modules/axios/lib/adapters/xhr.js.map +0 -1
- package/dist/node_modules/axios/lib/axios.js +0 -2
- package/dist/node_modules/axios/lib/axios.js.map +0 -1
- package/dist/node_modules/axios/lib/cancel/CancelToken.js +0 -2
- package/dist/node_modules/axios/lib/cancel/CancelToken.js.map +0 -1
- package/dist/node_modules/axios/lib/cancel/CanceledError.js +0 -2
- package/dist/node_modules/axios/lib/cancel/CanceledError.js.map +0 -1
- package/dist/node_modules/axios/lib/cancel/isCancel.js +0 -2
- package/dist/node_modules/axios/lib/cancel/isCancel.js.map +0 -1
- package/dist/node_modules/axios/lib/core/Axios.js +0 -2
- package/dist/node_modules/axios/lib/core/Axios.js.map +0 -1
- package/dist/node_modules/axios/lib/core/AxiosError.js +0 -2
- package/dist/node_modules/axios/lib/core/AxiosError.js.map +0 -1
- package/dist/node_modules/axios/lib/core/AxiosHeaders.js +0 -2
- package/dist/node_modules/axios/lib/core/AxiosHeaders.js.map +0 -1
- package/dist/node_modules/axios/lib/core/InterceptorManager.js +0 -2
- package/dist/node_modules/axios/lib/core/InterceptorManager.js.map +0 -1
- package/dist/node_modules/axios/lib/core/buildFullPath.js +0 -2
- package/dist/node_modules/axios/lib/core/buildFullPath.js.map +0 -1
- package/dist/node_modules/axios/lib/core/dispatchRequest.js +0 -2
- package/dist/node_modules/axios/lib/core/dispatchRequest.js.map +0 -1
- package/dist/node_modules/axios/lib/core/mergeConfig.js +0 -2
- package/dist/node_modules/axios/lib/core/mergeConfig.js.map +0 -1
- package/dist/node_modules/axios/lib/core/settle.js +0 -2
- package/dist/node_modules/axios/lib/core/settle.js.map +0 -1
- package/dist/node_modules/axios/lib/core/transformData.js +0 -2
- package/dist/node_modules/axios/lib/core/transformData.js.map +0 -1
- package/dist/node_modules/axios/lib/defaults/index.js +0 -2
- package/dist/node_modules/axios/lib/defaults/index.js.map +0 -1
- package/dist/node_modules/axios/lib/defaults/transitional.js +0 -2
- package/dist/node_modules/axios/lib/defaults/transitional.js.map +0 -1
- package/dist/node_modules/axios/lib/env/classes/FormData.js +0 -2
- package/dist/node_modules/axios/lib/env/classes/FormData.js.map +0 -1
- package/dist/node_modules/axios/lib/env/data.js +0 -2
- package/dist/node_modules/axios/lib/env/data.js.map +0 -1
- package/dist/node_modules/axios/lib/helpers/AxiosTransformStream.js +0 -2
- package/dist/node_modules/axios/lib/helpers/AxiosTransformStream.js.map +0 -1
- package/dist/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +0 -2
- package/dist/node_modules/axios/lib/helpers/AxiosURLSearchParams.js.map +0 -1
- package/dist/node_modules/axios/lib/helpers/HttpStatusCode.js +0 -2
- package/dist/node_modules/axios/lib/helpers/HttpStatusCode.js.map +0 -1
- package/dist/node_modules/axios/lib/helpers/bind.js +0 -2
- package/dist/node_modules/axios/lib/helpers/bind.js.map +0 -1
- package/dist/node_modules/axios/lib/helpers/buildURL.js +0 -2
- package/dist/node_modules/axios/lib/helpers/buildURL.js.map +0 -1
- package/dist/node_modules/axios/lib/helpers/combineURLs.js +0 -2
- package/dist/node_modules/axios/lib/helpers/combineURLs.js.map +0 -1
- package/dist/node_modules/axios/lib/helpers/cookies.js +0 -2
- package/dist/node_modules/axios/lib/helpers/cookies.js.map +0 -1
- package/dist/node_modules/axios/lib/helpers/formDataToJSON.js +0 -2
- package/dist/node_modules/axios/lib/helpers/formDataToJSON.js.map +0 -1
- package/dist/node_modules/axios/lib/helpers/fromDataURI.js +0 -2
- package/dist/node_modules/axios/lib/helpers/fromDataURI.js.map +0 -1
- package/dist/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -2
- package/dist/node_modules/axios/lib/helpers/isAbsoluteURL.js.map +0 -1
- package/dist/node_modules/axios/lib/helpers/isAxiosError.js +0 -2
- package/dist/node_modules/axios/lib/helpers/isAxiosError.js.map +0 -1
- package/dist/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -2
- package/dist/node_modules/axios/lib/helpers/isURLSameOrigin.js.map +0 -1
- package/dist/node_modules/axios/lib/helpers/parseHeaders.js +0 -2
- package/dist/node_modules/axios/lib/helpers/parseHeaders.js.map +0 -1
- package/dist/node_modules/axios/lib/helpers/parseProtocol.js +0 -2
- package/dist/node_modules/axios/lib/helpers/parseProtocol.js.map +0 -1
- package/dist/node_modules/axios/lib/helpers/speedometer.js +0 -2
- package/dist/node_modules/axios/lib/helpers/speedometer.js.map +0 -1
- package/dist/node_modules/axios/lib/helpers/spread.js +0 -2
- package/dist/node_modules/axios/lib/helpers/spread.js.map +0 -1
- package/dist/node_modules/axios/lib/helpers/throttle.js +0 -2
- package/dist/node_modules/axios/lib/helpers/throttle.js.map +0 -1
- package/dist/node_modules/axios/lib/helpers/toFormData.js +0 -2
- package/dist/node_modules/axios/lib/helpers/toFormData.js.map +0 -1
- package/dist/node_modules/axios/lib/helpers/toURLEncodedForm.js +0 -2
- package/dist/node_modules/axios/lib/helpers/toURLEncodedForm.js.map +0 -1
- package/dist/node_modules/axios/lib/helpers/validator.js +0 -2
- package/dist/node_modules/axios/lib/helpers/validator.js.map +0 -1
- package/dist/node_modules/axios/lib/platform/node/classes/FormData.js +0 -2
- package/dist/node_modules/axios/lib/platform/node/classes/FormData.js.map +0 -1
- package/dist/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +0 -2
- package/dist/node_modules/axios/lib/platform/node/classes/URLSearchParams.js.map +0 -1
- package/dist/node_modules/axios/lib/platform/node/index.js +0 -2
- package/dist/node_modules/axios/lib/platform/node/index.js.map +0 -1
- package/dist/node_modules/axios/lib/utils.js +0 -2
- package/dist/node_modules/axios/lib/utils.js.map +0 -1
- package/dist/node_modules/axios/node_modules/form-data/lib/browser.js +0 -2
- package/dist/node_modules/axios/node_modules/form-data/lib/browser.js.map +0 -1
- package/dist/node_modules/debug/src/browser.js +0 -2
- package/dist/node_modules/debug/src/browser.js.map +0 -1
- package/dist/node_modules/debug/src/common.js +0 -2
- package/dist/node_modules/debug/src/common.js.map +0 -1
- package/dist/node_modules/debug/src/index.js +0 -2
- package/dist/node_modules/debug/src/index.js.map +0 -1
- package/dist/node_modules/debug/src/node.js +0 -2
- package/dist/node_modules/debug/src/node.js.map +0 -1
- package/dist/node_modules/events/events.js +0 -2
- package/dist/node_modules/events/events.js.map +0 -1
- package/dist/node_modules/follow-redirects/debug.js +0 -2
- package/dist/node_modules/follow-redirects/debug.js.map +0 -1
- package/dist/node_modules/follow-redirects/index.js +0 -2
- package/dist/node_modules/follow-redirects/index.js.map +0 -1
- package/dist/node_modules/has-flag/index.js +0 -2
- package/dist/node_modules/has-flag/index.js.map +0 -1
- package/dist/node_modules/ms/index.js +0 -2
- package/dist/node_modules/ms/index.js.map +0 -1
- package/dist/node_modules/proxy-from-env/index.js +0 -2
- package/dist/node_modules/proxy-from-env/index.js.map +0 -1
- package/dist/node_modules/querystring/decode.js +0 -2
- package/dist/node_modules/querystring/decode.js.map +0 -1
- package/dist/node_modules/querystring/encode.js +0 -2
- package/dist/node_modules/querystring/encode.js.map +0 -1
- package/dist/node_modules/querystring/index.js +0 -2
- package/dist/node_modules/querystring/index.js.map +0 -1
- package/dist/node_modules/supports-color/index.js +0 -2
- package/dist/node_modules/supports-color/index.js.map +0 -1
- package/dist/node_modules/url/node_modules/punycode/punycode.js +0 -2
- package/dist/node_modules/url/node_modules/punycode/punycode.js.map +0 -1
- package/dist/node_modules/url/url.js +0 -2
- package/dist/node_modules/url/url.js.map +0 -1
- package/dist/node_modules/url/util.js +0 -2
- package/dist/node_modules/url/util.js.map +0 -1
- package/dist/node_modules/util/node_modules/inherits/inherits.js +0 -2
- package/dist/node_modules/util/node_modules/inherits/inherits.js.map +0 -1
- package/dist/node_modules/util/node_modules/inherits/inherits_browser.js +0 -2
- package/dist/node_modules/util/node_modules/inherits/inherits_browser.js.map +0 -1
- package/dist/node_modules/util/support/isBuffer.js +0 -2
- package/dist/node_modules/util/support/isBuffer.js.map +0 -1
- package/dist/node_modules/util/util.js +0 -2
- package/dist/node_modules/util/util.js.map +0 -1
package/dist/_virtual/index2.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.reactIs={exports:{}};
|
|
2
2
|
//# sourceMappingURL=index2.js.map
|
package/dist/_virtual/index3.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.dist={exports:{}};
|
|
2
2
|
//# sourceMappingURL=index3.js.map
|
package/dist/_virtual/index4.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.shim={exports:{}};
|
|
2
2
|
//# sourceMappingURL=index4.js.map
|
package/dist/_virtual/index5.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.propTypes={exports:{}};
|
|
2
2
|
//# sourceMappingURL=index5.js.map
|
package/dist/_virtual/index6.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.reactIs={exports:{}};
|
|
2
2
|
//# sourceMappingURL=index6.js.map
|
package/dist/_virtual/index7.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.reactIs={exports:{}};
|
|
2
2
|
//# sourceMappingURL=index7.js.map
|
package/dist/_virtual/index8.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.__exports={};
|
|
2
2
|
//# sourceMappingURL=index8.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../node_modules/tslib/tslib.es6.js"),t=require("react"),n=require("../styles/Island.styles.js");require("../node_modules/react-redux/es/index.js");var a=require("../node_modules/@fortawesome/react-fontawesome/index.es.js"),r=require("../node_modules/@
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../node_modules/tslib/tslib.es6.js"),t=require("react"),n=require("../styles/Island.styles.js");require("../node_modules/react-redux/es/index.js");var a=require("../node_modules/@fortawesome/react-fontawesome/index.es.js"),r=require("../node_modules/@nethesis/nethesis-solid-svg-icons/index.mjs.js");require("../node_modules/framer-motion/dist/framer-motion.js");var o=require("../utils/useLongPress.js"),i=require("../node_modules/react-moment/dist/index.js"),l=require("../utils/useIsomorphicLayoutEffect.js");require("../store/index.js");var u=require("../utils/useLocalStorage.js"),s=require("../utils/getTranslate.js"),c=require("./AudioBars.js"),d=require("./Button.js"),m=require("../lib/phone/call.js"),f=require("../node_modules/@nethesis/nethesis-regular-svg-icons/index.mjs.js"),p=require("../_virtual/framer-motion.js"),g=require("../node_modules/react-redux/es/hooks/useSelector.js"),h=require("../node_modules/react-redux/es/hooks/useDispatch.js");function x(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v=x(t),y=p.framerMotion.exports.motion(n.StyledDynamicIsland);p.framerMotion.exports.motion(n.StyledMusicIconBar);var E=p.framerMotion.exports.motion(n.StyledAlbumArtThumb);p.framerMotion.exports.motion(n.StyledMusicIcon);var w=p.framerMotion.exports.motion(n.StyledArtistDetails),j=0,S=0,C=function(x){var C=x.always,b=t.useState(!0),A=b[0],q=b[1],I=g.useSelector((function(e){return e.currentCall})),N=I.incoming,M=I.accepted,P=I.outgoing,_=I.displayName,R=I.number,D=I.startTime,z=I.muted,F=I.paused,B=g.useSelector((function(e){return e.player}));B.localAudio;var L=B.remoteAudio,T=p.framerMotion.exports.useDragControls(),k=u.useLocalStorage("phone-island",null),O=k[0],V=k[1],H=t.useRef(null),W=t.useRef(null),G=t.useState(O&&O.position?O.position:null),J=G[0],K=G[1],Q=t.useState(!1),U=Q[0],X=Q[1],Y=h.useDispatch();function Z(){return!P&&!M}var $=o.useLongPress((function(){console.log("long press trigger")}),(function(){q(!A)}),U,(function(){X(!1)}),{shouldPreventDefault:!0,delay:250}),ee={open:{width:"48px",height:"48px",borderRadius:"12px",margin:"0 auto"},closed:{width:"20px",height:"20px",borderRadius:"4px"}},te=t.useState(null),ne=te[0],ae=te[1];t.useEffect((function(){function e(){null==L||L.addEventListener("play",(function(){navigator.userAgent.indexOf("Firefox")>-1?ae(L.mozCaptureStream()):ae(L.captureStream())}))}return e(),function(){null==L||L.removeEventListener("play",e)}}),[L]);var re=t.useRef(null),oe=t.useRef(null),ie=t.useRef(null),le=t.useRef(null);return l.useIsomorphicLayoutEffect((function(){Y.player.updatePlayer({localAudio:re.current,localVideo:ie.current,remoteVideo:le.current,remoteAudio:oe.current})}),[]),v.default.createElement("div",{ref:W,className:"absolute min-w-full min-h-full left-0 top-0 overflow-hidden pointer-events-none flex items-center justify-center content-center phone-island-container z-1000"},(N||P||M||C)&&v.default.createElement(y,e.__assign({className:"font-sans absolute pointer-events-auto",incoming:N,accepted:M,outgoing:P,isOpen:A,animate:A&&(N||P)&&!M?"openIncoming":A&&M?"openAccepted":"closed",variants:{openIncoming:{width:"418px",height:"96px",borderRadius:"20px"},openAccepted:{width:"348px",height:"236px",borderRadius:"20px"},closed:{width:"156px",height:"36px",borderRadius:"99px"}},drag:!0,onPointerDown:function(e){T.start(e)},onDragStart:function(){X(!0)},dragTransition:{power:0},initial:{x:(null==J?void 0:J.x)||j,y:(null==J?void 0:J.y)||S},style:{padding:A?"24px":"8px 16px"},dragControls:T,dragConstraints:W,onDragEnd:function(){var e=s.getTranslateValues(H.current),t=e.x,n=e.y;t=function(e){var t=W.current.offsetWidth/2-H.current.offsetWidth/2;return e>0&&e>t?t:e<0&&e<-t?-t:e}(Math.round(t)),n=function(e){var t=W.current.offsetHeight/2-H.current.offsetHeight/2;return e>0&&e>t?t:e<0&&e<-t?-t:e}(Math.round(n)),V({position:{x:t,y:n}}),K({x:t,y:n})},ref:H},$),v.default.createElement(n.StyledDynamicIslandTopContent,{isOpen:A,incoming:N,accepted:M,outgoing:P},v.default.createElement("div",{className:"relative w-12 h-12"},(N||P&&!M)&&v.default.createElement(p.framerMotion.exports.motion.div,{style:{animation:"ping 2s cubic-bezier(0, 0, 0.2, 1) infinite",borderRadius:"4px"},animate:A?"open":"closed",variants:ee,className:"rounded-xl bg-white absolute opacity-60 -z-10 top-0 left-0 animate-ping h-12 w-12"}),v.default.createElement(E,{className:"z-10 h-12 w-12 bg-gray-300 rounded-sm",animate:A?"open":"closed",variants:ee})),v.default.createElement("div",null,A&&v.default.createElement(w,{initial:{opacity:0},animate:{opacity:1}},v.default.createElement(n.StyledSongName,null,_&&_),v.default.createElement(n.StyledArtistName,null,M?v.default.createElement(i.default,{date:D||(new Date).getTime()/1e3,interval:1e3,format:"hh:mm:ss",trim:"mid",unix:!0,durationFromNow:!0}):v.default.createElement(v.default.Fragment,null,R&&R)))),M&&v.default.createElement(c.AudioBars,{audioStream:ne})),A&&v.default.createElement("div",{className:"grid gap-y-5"},M&&v.default.createElement("div",{className:"grid grid-cols-4 auto-cols-max gap-y-5 justify-items-center place-items-center justify-center"},v.default.createElement(d.Button,{variant:"default",active:!!F,onClick:function(){return F?m.unpauseCurrentCall():m.pauseCurrentCall()}},F?v.default.createElement(a.FontAwesomeIcon,{size:"xl",icon:r.faPlay}):v.default.createElement(a.FontAwesomeIcon,{size:"xl",icon:f.faPause})),v.default.createElement(d.Button,{variant:"default",active:!!z,onClick:function(){return z?m.unmuteCurrentCall():m.muteCurrentCall()}},z?v.default.createElement(a.FontAwesomeIcon,{size:"xl",icon:r.faMicrophoneSlash}):v.default.createElement(a.FontAwesomeIcon,{size:"xl",icon:f.faMicrophone})),v.default.createElement(d.Button,{variant:"default"},v.default.createElement(a.FontAwesomeIcon,{size:"xl",icon:f.faRightLeft})),v.default.createElement(d.Button,{variant:"neutral"},v.default.createElement(a.FontAwesomeIcon,{size:"xl",icon:f.faChevronDown}))),v.default.createElement(p.framerMotion.exports.motion.div,{className:"grid ".concat(Z()?"grid-cols-2":M?"grid-cols-1 justify-items-center":"grid-cols-1 justify-items-end"," gap-3.5"),animate:{opacity:1}},v.default.createElement(d.Button,{onClick:function(e){e.stopPropagation(),m.hangupCurrentCall()},variant:"red"},v.default.createElement(a.FontAwesomeIcon,{className:"rotate-135 w-6 h-6",icon:r.faPhone})),Z()&&v.default.createElement(d.Button,{onClick:function(e){m.answerIncomingCall()},variant:"green"},v.default.createElement(a.FontAwesomeIcon,{className:"w-6 h-6",icon:r.faPhone}))))),v.default.createElement("div",{className:"hidden"},v.default.createElement("audio",{autoPlay:!0,ref:re}),v.default.createElement("audio",{autoPlay:!0,ref:oe}),v.default.createElement("video",{muted:!0,autoPlay:!0,ref:ie}),v.default.createElement("video",{autoPlay:!0,ref:le})))};C.displayName="Island",exports.Island=C;
|
|
2
2
|
//# sourceMappingURL=Island.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Island.js","sources":["../../src/components/Island.tsx"],"sourcesContent":["// Copyright (C) 2022 Nethesis S.r.l.\n// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport React, { useState, useRef, useEffect } from 'react'\nimport {\n StyledAlbumArtThumb,\n StyledArtistDetails,\n StyledArtistName,\n StyledDynamicIsland,\n StyledDynamicIslandTopContent,\n StyledMusicIcon,\n StyledMusicIconBar,\n StyledPlayBar,\n StyledPlayBarWrapper,\n StyledSongControls,\n StyledSongControlsWrappers,\n StyledSongName,\n} from '../styles/Island.styles'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { RootState } from '../store'\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\nimport {\n faBackward,\n faPause,\n faForward,\n faCompactDisc,\n faPhone,\n faMicrophone,\n faMicrophoneSlash,\n faRightLeft,\n faChevronDown,\n faPlay,\n faChevronUp,\n} from '@fortawesome/free-solid-svg-icons'\nimport { motion, useDragControls, useAnimation } from 'framer-motion/dist/framer-motion'\nimport { useLongPress } from '../utils/useLongPress'\nimport Moment from 'react-moment'\nimport { useLocalStorage, getTranslateValues } from '../utils'\nimport { AudioBars } from './AudioBars'\nimport { Button } from './Button'\nimport {\n hangupCurrentCall,\n answerIncomingCall,\n muteCurrentCall,\n unmuteCurrentCall,\n pauseCurrentCall,\n unpauseCurrentCall,\n} from '../lib/phone/call'\n\nconst StyledDynamicIslandMotion = motion(StyledDynamicIsland)\nconst StyledMusicIconBarMotion = motion(StyledMusicIconBar)\nconst StyledMusicAlbumArtThumbMotion = motion(StyledAlbumArtThumb)\nconst StyledMusicIconMotion = motion(StyledMusicIcon)\nconst StyledArtistDetailsMotion = motion(StyledArtistDetails)\n\nimport { useIsomorphicLayoutEffect } from '../utils'\n\ninterface IslandProps {\n always?: boolean\n}\n\ninterface PositionTypes {\n x: number\n y: number\n}\n\ninterface PhoneIslandStorageTypes {\n position: PositionTypes\n}\n\nconst ISLAND_STARTING_POSITION = {\n x: 0,\n y: 0,\n}\n\nexport const Island = ({ always }: IslandProps) => {\n const [isOpen, setIsOpen] = useState(true)\n // Get the currentCall info\n const { incoming, accepted, outgoing, displayName, number, startTime, muted, paused } =\n useSelector((state: RootState) => state.currentCall)\n\n const { localAudio: storeLocalAudio, remoteAudio: storeRemoteAudio } = useSelector(\n (state: RootState) => state.player,\n )\n const controls = useDragControls()\n\n const [phoneIslandStorage, setPhoneIslandStorage] =\n useLocalStorage<PhoneIslandStorageTypes | null>('phone-island', null)\n\n const islandRef = useRef<any>(null)\n\n const islandContainerRef = useRef<any>(null)\n\n const [position, setPosition] = useState<PositionTypes | null>(\n phoneIslandStorage && phoneIslandStorage.position ? phoneIslandStorage.position : null,\n )\n\n const [moved, setMoved] = useState<boolean>(false)\n\n const dispatch = useDispatch()\n\n function isAnswerVisible() {\n return !outgoing && !accepted\n }\n\n function startDrag(event) {\n controls.start(event)\n }\n\n function handleAnswer(event) {\n answerIncomingCall()\n }\n\n function handleHangup(event) {\n event.stopPropagation()\n hangupCurrentCall()\n }\n\n const onLongPress = () => {\n console.log('long press trigger')\n }\n\n const islandClick = () => {\n setIsOpen(!isOpen)\n }\n\n function innerXPosition(x) {\n // Get horizontal constraints\n const xConstraintPosition =\n islandContainerRef.current.offsetWidth / 2 - islandRef.current.offsetWidth / 2\n\n // Return the X position inside the constraints\n return x > 0 && x > xConstraintPosition\n ? xConstraintPosition\n : x < 0 && x < -xConstraintPosition\n ? -xConstraintPosition\n : x\n }\n\n function innerYPosition(y) {\n // Get vertical constraints\n const yConstraintPosition =\n islandContainerRef.current.offsetHeight / 2 - islandRef.current.offsetHeight / 2\n\n // Return the Y position inside the constraints\n return y > 0 && y > yConstraintPosition\n ? yConstraintPosition\n : y < 0 && y < -yConstraintPosition\n ? -yConstraintPosition\n : y\n }\n\n const onDragEnd = () => {\n // Get initial translation values\n let { x, y }: any = getTranslateValues(islandRef.current)\n\n // Round position\n x = innerXPosition(Math.round(x))\n y = innerYPosition(Math.round(y))\n\n // Save the new position to localstorage\n setPhoneIslandStorage({\n position: {\n x,\n y,\n },\n })\n // Set position to variable\n setPosition({\n x,\n y,\n })\n }\n\n function resetMoved() {\n setMoved(false)\n }\n\n function dragStarted() {\n setMoved(true)\n }\n\n const longPressEvent = useLongPress(onLongPress, islandClick, moved, resetMoved, {\n shouldPreventDefault: true,\n delay: 250,\n })\n\n const variants = {\n openIncoming: {\n width: '418px',\n height: '96px',\n borderRadius: '20px',\n },\n openAccepted: {\n width: '348px',\n height: '236px',\n borderRadius: '20px',\n },\n closed: {\n width: '156px',\n height: '36px',\n borderRadius: '99px',\n },\n }\n\n const iconVariants = {\n open: {\n width: '48px',\n height: '48px',\n borderRadius: '12px',\n margin: '0 auto',\n },\n closed: {\n width: '20px',\n height: '20px',\n borderRadius: '4px',\n },\n }\n\n const [audioStream, setAudioStream] = useState<MediaStream | null>(null)\n\n useEffect(() => {\n function audioStreamListener() {\n storeRemoteAudio?.addEventListener('play', () => {\n if (navigator.userAgent.indexOf('Firefox') > -1) {\n // @ts-ignore\n setAudioStream(storeRemoteAudio.mozCaptureStream())\n } else {\n // @ts-ignore\n setAudioStream(storeRemoteAudio.captureStream())\n }\n })\n }\n audioStreamListener()\n return () => {\n storeRemoteAudio?.removeEventListener('play', audioStreamListener)\n }\n }, [storeRemoteAudio])\n\n const localAudio = useRef<HTMLAudioElement>(null)\n const remoteAudio = useRef<HTMLAudioElement>(null)\n const localVideo = useRef<HTMLVideoElement>(null)\n const remoteVideo = useRef<HTMLVideoElement>(null)\n\n useIsomorphicLayoutEffect(() => {\n dispatch.player.updatePlayer({\n localAudio: localAudio.current,\n localVideo: localVideo.current,\n remoteVideo: remoteVideo.current,\n remoteAudio: remoteAudio.current,\n })\n }, [])\n\n return (\n <div\n ref={islandContainerRef}\n className='absolute min-w-full min-h-full left-0 top-0 overflow-hidden pointer-events-none flex items-center justify-center content-center phone-island-container z-1000'\n >\n {/* <div className='bg-black h-72 w-72 flex justify-center '>\n <AudioBars audioStream={audioStream} />\n </div> */}\n\n {(incoming || outgoing || accepted || always) && (\n <StyledDynamicIslandMotion\n className='font-sans absolute pointer-events-auto'\n incoming={incoming}\n accepted={accepted}\n outgoing={outgoing}\n isOpen={isOpen}\n animate={\n isOpen && (incoming || outgoing) && !accepted\n ? 'openIncoming'\n : isOpen && accepted\n ? 'openAccepted'\n : 'closed'\n }\n variants={variants}\n drag\n onPointerDown={startDrag}\n onDragStart={dragStarted}\n dragTransition={{\n power: 0,\n }}\n initial={{\n x: position?.x || ISLAND_STARTING_POSITION.x,\n y: position?.y || ISLAND_STARTING_POSITION.y,\n }}\n style={{\n padding: isOpen ? '24px' : '8px 16px',\n }}\n dragControls={controls}\n dragConstraints={islandContainerRef}\n onDragEnd={onDragEnd}\n ref={islandRef}\n {...longPressEvent}\n >\n <StyledDynamicIslandTopContent\n isOpen={isOpen}\n incoming={incoming}\n accepted={accepted}\n outgoing={outgoing}\n >\n <div className='relative w-12 h-12'>\n {(incoming || (outgoing && !accepted)) && (\n <motion.div\n style={{\n animation: 'ping 2s cubic-bezier(0, 0, 0.2, 1) infinite',\n borderRadius: '4px',\n }}\n animate={isOpen ? 'open' : 'closed'}\n variants={iconVariants}\n className={`rounded-xl bg-white absolute opacity-60 -z-10 top-0 left-0 animate-ping h-12 w-12`}\n ></motion.div>\n )}\n <StyledMusicAlbumArtThumbMotion\n className='z-10 h-12 w-12 bg-gray-300 rounded-sm'\n animate={isOpen ? 'open' : 'closed'}\n variants={iconVariants}\n />\n </div>\n <div>\n {isOpen && (\n <StyledArtistDetailsMotion initial={{ opacity: 0 }} animate={{ opacity: 1 }}>\n <StyledSongName>{displayName && displayName}</StyledSongName>\n <StyledArtistName>\n {accepted ? (\n <Moment\n date={startTime || new Date().getTime() / 1000}\n interval={1000}\n format='hh:mm:ss'\n trim='mid'\n unix\n durationFromNow\n />\n ) : (\n <>{number && number}</>\n )}\n </StyledArtistName>\n </StyledArtistDetailsMotion>\n )}\n </div>\n {accepted && <AudioBars audioStream={audioStream} />}\n {/* <StyledMusicIconMotion animate={{ opacity: isOpen ? [0, 1] : 1 }}>\n <StyledMusicIconBarMotion\n initial={{ height: '0' }}\n animate={{ height: '100%' }}\n transition={{ duration: 1, delay: 0.5, repeat: Infinity }}\n />\n <StyledMusicIconBarMotion\n initial={{ height: '0' }}\n animate={{ height: '100%' }}\n transition={{ duration: 1, delay: 0.75, repeat: Infinity }}\n />\n <StyledMusicIconBarMotion\n initial={{ height: '0' }}\n animate={{ height: '75%' }}\n transition={{ duration: 1, delay: 0.3, repeat: Infinity }}\n />\n </StyledMusicIconMotion> */}\n </StyledDynamicIslandTopContent>\n {isOpen && (\n <div className='grid gap-y-5'>\n {/* <StyledPlayBarWrapper>\n <span>2:30</span>\n <StyledPlayBar />\n <span>-1:35</span>\n </StyledPlayBarWrapper>\n <StyledSongControlsWrappers>\n <StyledSongControls>\n <FontAwesomeIcon size='2x' icon={faBackward} />\n <FontAwesomeIcon size='3x' icon={faPause} />\n <FontAwesomeIcon size='2x' icon={faForward} />\n </StyledSongControls>\n <div>\n <FontAwesomeIcon size='2x' icon={faCompactDisc} />\n </div>\n </StyledSongControlsWrappers> */}\n {accepted && (\n <div className='grid grid-cols-4 auto-cols-max gap-y-5 justify-items-center place-items-center justify-center'>\n <Button\n variant='default'\n active={paused ? true : false}\n onClick={() => (paused ? unpauseCurrentCall() : pauseCurrentCall())}\n >\n {paused ? (\n <FontAwesomeIcon size='xl' icon={faPlay} />\n ) : (\n <FontAwesomeIcon size='xl' icon={faPause} />\n )}\n </Button>\n <Button\n variant='default'\n active={muted ? true : false}\n onClick={() => (muted ? unmuteCurrentCall() : muteCurrentCall())}\n >\n {muted ? (\n <FontAwesomeIcon size='xl' icon={faMicrophoneSlash} />\n ) : (\n <FontAwesomeIcon size='xl' icon={faMicrophone} />\n )}\n </Button>\n <Button variant='default'>\n <FontAwesomeIcon size='xl' icon={faRightLeft} />\n </Button>\n <Button variant='neutral'>\n <FontAwesomeIcon size='xl' icon={faChevronDown} />\n </Button>\n </div>\n )}\n <motion.div\n className={`grid ${\n isAnswerVisible()\n ? 'grid-cols-2'\n : accepted\n ? 'grid-cols-1 justify-items-center'\n : 'grid-cols-1 justify-items-end'\n } gap-3.5`}\n animate={{ opacity: 1 }}\n >\n <Button onClick={handleHangup} variant='red'>\n <FontAwesomeIcon className='rotate-135' size='2x' icon={faPhone} />\n </Button>\n {isAnswerVisible() && (\n <Button onClick={handleAnswer} variant='green'>\n <FontAwesomeIcon size='2x' icon={faPhone} />\n </Button>\n )}\n </motion.div>\n </div>\n )}\n </StyledDynamicIslandMotion>\n )}\n <div className='hidden'>\n <audio autoPlay ref={localAudio}></audio>\n <audio autoPlay ref={remoteAudio}></audio>\n <video muted={true} autoPlay ref={localVideo}></video>\n <video autoPlay ref={remoteVideo}></video>\n </div>\n </div>\n )\n}\n\nIsland.displayName = 'Island'\n"],"names":["StyledDynamicIslandMotion","motion","StyledDynamicIsland","framerMotion","exports","StyledMusicIconBar","StyledMusicAlbumArtThumbMotion","StyledAlbumArtThumb","StyledMusicIcon","StyledArtistDetailsMotion","StyledArtistDetails","ISLAND_STARTING_POSITION","Island","_a","always","_b","useState","isOpen","setIsOpen","_c","useSelector","state","currentCall","incoming","accepted","outgoing","displayName","number","startTime","muted","paused","_d","player","storeRemoteAudio","controls","useDragControls","_e","useLocalStorage","phoneIslandStorage","setPhoneIslandStorage","islandRef","useRef","islandContainerRef","_f","position","setPosition","_g","moved","setMoved","dispatch","useDispatch","isAnswerVisible","longPressEvent","useLongPress","console","log","shouldPreventDefault","delay","iconVariants","open","width","height","borderRadius","margin","closed","_h","audioStream","setAudioStream","useEffect","audioStreamListener","addEventListener","navigator","userAgent","indexOf","mozCaptureStream","captureStream","removeEventListener","localAudio","remoteAudio","localVideo","remoteVideo","useIsomorphicLayoutEffect","updatePlayer","current","React","ref","className","__assign","animate","variants","openIncoming","openAccepted","drag","onPointerDown","event","start","onDragStart","dragTransition","power","initial","x","y","style","padding","dragControls","dragConstraints","onDragEnd","getTranslateValues","xConstraintPosition","offsetWidth","innerXPosition","Math","round","yConstraintPosition","offsetHeight","innerYPosition","createElement","StyledDynamicIslandTopContent","div","animation","opacity","StyledSongName","StyledArtistName","Moment","date","Date","getTime","interval","format","trim","unix","durationFromNow","Fragment","AudioBars","Button","variant","active","onClick","unpauseCurrentCall","pauseCurrentCall","FontAwesomeIcon","size","icon","faPlay","faPause","unmuteCurrentCall","muteCurrentCall","faMicrophoneSlash","faMicrophone","faRightLeft","faChevronDown","concat","stopPropagation","hangupCurrentCall","faPhone","answerIncomingCall","autoPlay"],"mappings":"whCAiDMA,EAA4BC,EAAAA,aAAAA,QAAAA,OAAOC,EAAAA,qBACRD,EAAME,aAAAC,QAAAH,OAACI,sBACxC,IAAMC,EAAiCL,EAAAA,aAAAA,QAAAA,OAAOM,EAAAA,qBAChBN,EAAME,aAAAC,QAAAH,OAACO,mBACrC,IAAMC,EAA4BR,EAAAA,aAAAA,QAAAA,OAAOS,EAAAA,qBAiBnCC,EACD,EADCA,EAED,EAGQC,EAAS,SAACC,GAAE,IAAAC,EAAMD,EAAAC,OACvBC,EAAsBC,EAAAA,UAAS,GAA9BC,EAAMF,EAAA,GAAEG,EAASH,EAAA,GAElBI,EACJC,EAAAA,aAAY,SAACC,GAAqB,OAAAA,EAAMC,eADlCC,aAAUC,EAAQL,EAAAK,SAAEC,EAAQN,EAAAM,SAAEC,EAAWP,EAAAO,YAAEC,EAAMR,EAAAQ,OAAEC,cAAWC,UAAOC,WAGvEC,EAAiEX,EAAWA,aAChF,SAACC,GAAqB,OAAAA,EAAMW,MAAN,iBAD0B,IAAAC,gBAG5CC,EAAWC,EAAAA,aAAAA,QAAAA,kBAEXC,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sB3C,GACpB6D,EAAAA,oBACD,EAwT8CpB,QAAQ,SACrCnD,EAAAA,QAAAgC,cAACwB,kBAAgB,CAAAC,KAAK,KAAKC,KAAMY,EAAAA,cAQ/CtE,EAAAA,QAAKgC,cAAA,MAAA,CAAA9B,UAAU,UACbF,EAAA,QAAAgC,cAAA,QAAA,CAAOwC,UAAQ,EAACvE,IAAKR,KACrBO,EAAA,QAAAgC,cAAA,QAAA,CAAOwC,UAAQ,EAACvE,IAAKP,KACrBM,UAAOgC,cAAA,QAAA,CAAAvF,OAAO,EAAM+H,UAAS,EAAAvE,IAAKN,KAClCK,UAAOgC,cAAA,QAAA,CAAAwC,YAASvE,IAAKL,MAI7B,EAEApE,EAAOc,YAAc"}
|
|
1
|
+
{"version":3,"file":"Island.js","sources":["../../src/components/Island.tsx"],"sourcesContent":["// Copyright (C) 2022 Nethesis S.r.l.\n// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport React, { useState, useRef, useEffect } from 'react'\nimport {\n StyledAlbumArtThumb,\n StyledArtistDetails,\n StyledArtistName,\n StyledDynamicIsland,\n StyledDynamicIslandTopContent,\n StyledMusicIcon,\n StyledMusicIconBar,\n StyledPlayBar,\n StyledPlayBarWrapper,\n StyledSongControls,\n StyledSongControlsWrappers,\n StyledSongName,\n} from '../styles/Island.styles'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { RootState } from '../store'\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\nimport {\n faBackward,\n faPause,\n faForward,\n faCompactDisc,\n faPhone,\n faMicrophone,\n faMicrophoneSlash,\n faChevronDown,\n faPlay,\n faChevronUp,\n} from '@nethesis/nethesis-solid-svg-icons'\nimport { motion, useDragControls, useAnimation } from 'framer-motion/dist/framer-motion'\nimport { useLongPress } from '../utils/useLongPress'\nimport Moment from 'react-moment'\nimport { useLocalStorage, getTranslateValues } from '../utils'\nimport { AudioBars } from './AudioBars'\nimport { Button } from './Button'\nimport {\n hangupCurrentCall,\n answerIncomingCall,\n muteCurrentCall,\n unmuteCurrentCall,\n pauseCurrentCall,\n unpauseCurrentCall,\n} from '../lib/phone/call'\nimport {\n faPause as faPauseRegular,\n faMicrophone as faMicrophoneRegular,\n faRightLeft as faRightLeftRegualar,\n faChevronDown as faChevronDownRegular,\n} from '@nethesis/nethesis-regular-svg-icons'\n\nconst StyledDynamicIslandMotion = motion(StyledDynamicIsland)\nconst StyledMusicIconBarMotion = motion(StyledMusicIconBar)\nconst StyledMusicAlbumArtThumbMotion = motion(StyledAlbumArtThumb)\nconst StyledMusicIconMotion = motion(StyledMusicIcon)\nconst StyledArtistDetailsMotion = motion(StyledArtistDetails)\n\nimport { useIsomorphicLayoutEffect } from '../utils'\n\ninterface IslandProps {\n always?: boolean\n}\n\ninterface PositionTypes {\n x: number\n y: number\n}\n\ninterface PhoneIslandStorageTypes {\n position: PositionTypes\n}\n\nconst ISLAND_STARTING_POSITION = {\n x: 0,\n y: 0,\n}\n\nexport const Island = ({ always }: IslandProps) => {\n const [isOpen, setIsOpen] = useState(true)\n // Get the currentCall info\n const { incoming, accepted, outgoing, displayName, number, startTime, muted, paused } =\n useSelector((state: RootState) => state.currentCall)\n\n const { localAudio: storeLocalAudio, remoteAudio: storeRemoteAudio } = useSelector(\n (state: RootState) => state.player,\n )\n const controls = useDragControls()\n\n const [phoneIslandStorage, setPhoneIslandStorage] =\n useLocalStorage<PhoneIslandStorageTypes | null>('phone-island', null)\n\n const islandRef = useRef<any>(null)\n\n const islandContainerRef = useRef<any>(null)\n\n const [position, setPosition] = useState<PositionTypes | null>(\n phoneIslandStorage && phoneIslandStorage.position ? phoneIslandStorage.position : null,\n )\n\n const [moved, setMoved] = useState<boolean>(false)\n\n const dispatch = useDispatch()\n\n function isAnswerVisible() {\n return !outgoing && !accepted\n }\n\n function startDrag(event) {\n controls.start(event)\n }\n\n function handleAnswer(event) {\n answerIncomingCall()\n }\n\n function handleHangup(event) {\n event.stopPropagation()\n hangupCurrentCall()\n }\n\n const onLongPress = () => {\n console.log('long press trigger')\n }\n\n const islandClick = () => {\n setIsOpen(!isOpen)\n }\n\n function innerXPosition(x) {\n // Get horizontal constraints\n const xConstraintPosition =\n islandContainerRef.current.offsetWidth / 2 - islandRef.current.offsetWidth / 2\n\n // Return the X position inside the constraints\n return x > 0 && x > xConstraintPosition\n ? xConstraintPosition\n : x < 0 && x < -xConstraintPosition\n ? -xConstraintPosition\n : x\n }\n\n function innerYPosition(y) {\n // Get vertical constraints\n const yConstraintPosition =\n islandContainerRef.current.offsetHeight / 2 - islandRef.current.offsetHeight / 2\n\n // Return the Y position inside the constraints\n return y > 0 && y > yConstraintPosition\n ? yConstraintPosition\n : y < 0 && y < -yConstraintPosition\n ? -yConstraintPosition\n : y\n }\n\n const onDragEnd = () => {\n // Get initial translation values\n let { x, y }: any = getTranslateValues(islandRef.current)\n\n // Round position\n x = innerXPosition(Math.round(x))\n y = innerYPosition(Math.round(y))\n\n // Save the new position to localstorage\n setPhoneIslandStorage({\n position: {\n x,\n y,\n },\n })\n // Set position to variable\n setPosition({\n x,\n y,\n })\n }\n\n function resetMoved() {\n setMoved(false)\n }\n\n function dragStarted() {\n setMoved(true)\n }\n\n const longPressEvent = useLongPress(onLongPress, islandClick, moved, resetMoved, {\n shouldPreventDefault: true,\n delay: 250,\n })\n\n const variants = {\n openIncoming: {\n width: '418px',\n height: '96px',\n borderRadius: '20px',\n },\n openAccepted: {\n width: '348px',\n height: '236px',\n borderRadius: '20px',\n },\n closed: {\n width: '156px',\n height: '36px',\n borderRadius: '99px',\n },\n }\n\n const iconVariants = {\n open: {\n width: '48px',\n height: '48px',\n borderRadius: '12px',\n margin: '0 auto',\n },\n closed: {\n width: '20px',\n height: '20px',\n borderRadius: '4px',\n },\n }\n\n const [audioStream, setAudioStream] = useState<MediaStream | null>(null)\n\n useEffect(() => {\n function audioStreamListener() {\n storeRemoteAudio?.addEventListener('play', () => {\n if (navigator.userAgent.indexOf('Firefox') > -1) {\n // @ts-ignore\n setAudioStream(storeRemoteAudio.mozCaptureStream())\n } else {\n // @ts-ignore\n setAudioStream(storeRemoteAudio.captureStream())\n }\n })\n }\n audioStreamListener()\n return () => {\n storeRemoteAudio?.removeEventListener('play', audioStreamListener)\n }\n }, [storeRemoteAudio])\n\n const localAudio = useRef<HTMLAudioElement>(null)\n const remoteAudio = useRef<HTMLAudioElement>(null)\n const localVideo = useRef<HTMLVideoElement>(null)\n const remoteVideo = useRef<HTMLVideoElement>(null)\n\n useIsomorphicLayoutEffect(() => {\n dispatch.player.updatePlayer({\n localAudio: localAudio.current,\n localVideo: localVideo.current,\n remoteVideo: remoteVideo.current,\n remoteAudio: remoteAudio.current,\n })\n }, [])\n\n return (\n <div\n ref={islandContainerRef}\n className='absolute min-w-full min-h-full left-0 top-0 overflow-hidden pointer-events-none flex items-center justify-center content-center phone-island-container z-1000'\n >\n {/* <div className='bg-black h-72 w-72 flex justify-center '>\n <AudioBars audioStream={audioStream} />\n </div> */}\n\n {(incoming || outgoing || accepted || always) && (\n <StyledDynamicIslandMotion\n className='font-sans absolute pointer-events-auto'\n incoming={incoming}\n accepted={accepted}\n outgoing={outgoing}\n isOpen={isOpen}\n animate={\n isOpen && (incoming || outgoing) && !accepted\n ? 'openIncoming'\n : isOpen && accepted\n ? 'openAccepted'\n : 'closed'\n }\n variants={variants}\n drag\n onPointerDown={startDrag}\n onDragStart={dragStarted}\n dragTransition={{\n power: 0,\n }}\n initial={{\n x: position?.x || ISLAND_STARTING_POSITION.x,\n y: position?.y || ISLAND_STARTING_POSITION.y,\n }}\n style={{\n padding: isOpen ? '24px' : '8px 16px',\n }}\n dragControls={controls}\n dragConstraints={islandContainerRef}\n onDragEnd={onDragEnd}\n ref={islandRef}\n {...longPressEvent}\n >\n <StyledDynamicIslandTopContent\n isOpen={isOpen}\n incoming={incoming}\n accepted={accepted}\n outgoing={outgoing}\n >\n <div className='relative w-12 h-12'>\n {(incoming || (outgoing && !accepted)) && (\n <motion.div\n style={{\n animation: 'ping 2s cubic-bezier(0, 0, 0.2, 1) infinite',\n borderRadius: '4px',\n }}\n animate={isOpen ? 'open' : 'closed'}\n variants={iconVariants}\n className={`rounded-xl bg-white absolute opacity-60 -z-10 top-0 left-0 animate-ping h-12 w-12`}\n ></motion.div>\n )}\n <StyledMusicAlbumArtThumbMotion\n className='z-10 h-12 w-12 bg-gray-300 rounded-sm'\n animate={isOpen ? 'open' : 'closed'}\n variants={iconVariants}\n />\n </div>\n <div>\n {isOpen && (\n <StyledArtistDetailsMotion initial={{ opacity: 0 }} animate={{ opacity: 1 }}>\n <StyledSongName>{displayName && displayName}</StyledSongName>\n <StyledArtistName>\n {accepted ? (\n <Moment\n date={startTime || new Date().getTime() / 1000}\n interval={1000}\n format='hh:mm:ss'\n trim='mid'\n unix\n durationFromNow\n />\n ) : (\n <>{number && number}</>\n )}\n </StyledArtistName>\n </StyledArtistDetailsMotion>\n )}\n </div>\n {accepted && <AudioBars audioStream={audioStream} />}\n {/* <StyledMusicIconMotion animate={{ opacity: isOpen ? [0, 1] : 1 }}>\n <StyledMusicIconBarMotion\n initial={{ height: '0' }}\n animate={{ height: '100%' }}\n transition={{ duration: 1, delay: 0.5, repeat: Infinity }}\n />\n <StyledMusicIconBarMotion\n initial={{ height: '0' }}\n animate={{ height: '100%' }}\n transition={{ duration: 1, delay: 0.75, repeat: Infinity }}\n />\n <StyledMusicIconBarMotion\n initial={{ height: '0' }}\n animate={{ height: '75%' }}\n transition={{ duration: 1, delay: 0.3, repeat: Infinity }}\n />\n </StyledMusicIconMotion> */}\n </StyledDynamicIslandTopContent>\n {isOpen && (\n <div className='grid gap-y-5'>\n {/* <StyledPlayBarWrapper>\n <span>2:30</span>\n <StyledPlayBar />\n <span>-1:35</span>\n </StyledPlayBarWrapper>\n <StyledSongControlsWrappers>\n <StyledSongControls>\n <FontAwesomeIcon size='2x' icon={faBackward} />\n <FontAwesomeIcon size='3x' icon={faPause} />\n <FontAwesomeIcon size='2x' icon={faForward} />\n </StyledSongControls>\n <div>\n <FontAwesomeIcon size='2x' icon={faCompactDisc} />\n </div>\n </StyledSongControlsWrappers> */}\n {accepted && (\n <div className='grid grid-cols-4 auto-cols-max gap-y-5 justify-items-center place-items-center justify-center'>\n <Button\n variant='default'\n active={paused ? true : false}\n onClick={() => (paused ? unpauseCurrentCall() : pauseCurrentCall())}\n >\n {paused ? (\n <FontAwesomeIcon size='xl' icon={faPlay} />\n ) : (\n <FontAwesomeIcon size='xl' icon={faPauseRegular} />\n )}\n </Button>\n <Button\n variant='default'\n active={muted ? true : false}\n onClick={() => (muted ? unmuteCurrentCall() : muteCurrentCall())}\n >\n {muted ? (\n <FontAwesomeIcon size='xl' icon={faMicrophoneSlash} />\n ) : (\n <FontAwesomeIcon size='xl' icon={faMicrophoneRegular} />\n )}\n </Button>\n <Button variant='default'>\n <FontAwesomeIcon size='xl' icon={faRightLeftRegualar} />\n </Button>\n <Button variant='neutral'>\n <FontAwesomeIcon size='xl' icon={faChevronDownRegular} />\n </Button>\n </div>\n )}\n <motion.div\n className={`grid ${\n isAnswerVisible()\n ? 'grid-cols-2'\n : accepted\n ? 'grid-cols-1 justify-items-center'\n : 'grid-cols-1 justify-items-end'\n } gap-3.5`}\n animate={{ opacity: 1 }}\n >\n <Button onClick={handleHangup} variant='red'>\n <FontAwesomeIcon className='rotate-135 w-6 h-6' icon={faPhone} />\n </Button>\n {isAnswerVisible() && (\n <Button onClick={handleAnswer} variant='green'>\n <FontAwesomeIcon className='w-6 h-6' icon={faPhone} />\n </Button>\n )}\n </motion.div>\n </div>\n )}\n </StyledDynamicIslandMotion>\n )}\n <div className='hidden'>\n <audio autoPlay ref={localAudio}></audio>\n <audio autoPlay ref={remoteAudio}></audio>\n <video muted={true} autoPlay ref={localVideo}></video>\n <video autoPlay ref={remoteVideo}></video>\n </div>\n </div>\n )\n}\n\nIsland.displayName = 'Island'\n"],"names":["StyledDynamicIslandMotion","motion","StyledDynamicIsland","framerMotion","exports","StyledMusicIconBar","StyledMusicAlbumArtThumbMotion","StyledAlbumArtThumb","StyledMusicIcon","StyledArtistDetailsMotion","StyledArtistDetails","ISLAND_STARTING_POSITION","Island","_a","always","_b","useState","isOpen","setIsOpen","_c","useSelector","state","currentCall","incoming","accepted","outgoing","displayName","number","startTime","muted","paused","_d","player","storeRemoteAudio","controls","useDragControls","_e","useLocalStorage","phoneIslandStorage","setPhoneIslandStorage","islandRef","useRef","islandContainerRef","_f","position","setPosition","_g","moved","setMoved","dispatch","useDispatch","isAnswerVisible","longPressEvent","useLongPress","console","log","shouldPreventDefault","delay","iconVariants","open","width","height","borderRadius","margin","closed","_h","audioStream","setAudioStream","useEffect","audioStreamListener","addEventListener","navigator","userAgent","indexOf","mozCaptureStream","captureStream","removeEventListener","localAudio","remoteAudio","localVideo","remoteVideo","useIsomorphicLayoutEffect","updatePlayer","current","React","ref","className","__assign","animate","variants","openIncoming","openAccepted","drag","onPointerDown","event","start","onDragStart","dragTransition","power","initial","x","y","style","padding","dragControls","dragConstraints","onDragEnd","getTranslateValues","xConstraintPosition","offsetWidth","innerXPosition","Math","round","yConstraintPosition","offsetHeight","innerYPosition","createElement","StyledDynamicIslandTopContent","div","animation","opacity","StyledSongName","StyledArtistName","Moment","date","Date","getTime","interval","format","trim","unix","durationFromNow","Fragment","AudioBars","Button","variant","active","onClick","unpauseCurrentCall","pauseCurrentCall","FontAwesomeIcon","size","icon","faPlay","faPauseRegular","unmuteCurrentCall","muteCurrentCall","faMicrophoneSlash","faMicrophoneRegular","faRightLeftRegualar","faRightLeft","faChevronDownRegular","concat","stopPropagation","hangupCurrentCall","faPhone","answerIncomingCall","autoPlay"],"mappings":"wmCAsDMA,EAA4BC,EAAAA,aAAAA,QAAAA,OAAOC,EAAAA,qBACRD,EAAME,aAAAC,QAAAH,OAACI,sBACxC,IAAMC,EAAiCL,EAAAA,aAAAA,QAAAA,OAAOM,EAAAA,qBAChBN,EAAME,aAAAC,QAAAH,OAACO,mBACrC,IAAMC,EAA4BR,EAAAA,aAAAA,QAAAA,OAAOS,EAAAA,qBAiBnCC,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AMS,EAAAA,kBAIvCnE,UAACgC,cAAAnH,EAAAA,aAAAA,QAAAA,OAAOqH,IAAG,CACThC,UAAW,QAAAkE,OACTrG,IACI,cACA3B,EACA,mCACA,gCAA+B,YAErCgE,QAAS,CAAEgC,QAAS,IAEpBpC,EAAC,QAAAgC,cAAAkB,UAAOG,QAlTtB,SAAsB3C,GACpBA,EAAM2D,kBACNC,EAAAA,mBACD,EA+S4CnB,QAAQ,OACrCnD,UAACgC,cAAAwB,EAAAA,gBAAgB,CAAAtD,UAAU,qBAAqBwD,KAAMa,EAAOA,WAE9DxG,KACCiC,EAAA,QAAAgC,cAACkB,EAAAA,OAAM,CAACG,QA1TxB,SAAsB3C,GACpB8D,EAAAA,oBACD,EAwT8CrB,QAAQ,SACrCnD,EAAAA,QAAAgC,cAACwB,kBAAgB,CAAAtD,UAAU,UAAUwD,KAAMa,EAAAA,cAQzDvE,EAAAA,QAAKgC,cAAA,MAAA,CAAA9B,UAAU,UACbF,EAAA,QAAAgC,cAAA,QAAA,CAAOyC,UAAQ,EAACxE,IAAKR,KACrBO,EAAA,QAAAgC,cAAA,QAAA,CAAOyC,UAAQ,EAACxE,IAAKP,KACrBM,UAAOgC,cAAA,QAAA,CAAAvF,OAAO,EAAMgI,UAAS,EAAAxE,IAAKN,KAClCK,UAAOgC,cAAA,QAAA,CAAAyC,YAASxE,IAAKL,MAI7B,EAEApE,EAAOc,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../node_modules/tslib/tslib.es6.js"),t=require("react")
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../node_modules/tslib/tslib.es6.js"),t=require("react"),r=require("../services/user.js");require("../node_modules/react-redux/es/index.js");var u=require("../node_modules/react-redux/es/hooks/useDispatch.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=s(t);exports.RestAPI=function(s){var a=s.hostName,c=s.username,o=s.authToken,i=s.children,d=u.useDispatch();return t.useEffect((function(){d.fetchDefaults.updateFetchBaseURL("https://".concat(a,"/webrest")),d.fetchDefaults.updateFetchHeaders({Authorization:"".concat(c,":").concat(o)}),function(){e.__awaiter(this,void 0,void 0,(function(){var t;return e.__generator(this,(function(e){switch(e.label){case 0:return[4,r.getCurrentUserInfo()];case 1:return null!=(t=e.sent())&&d.currentUser.updateCurrentUser(t),[2]}}))}))}()}),[]),n.default.createElement(n.default.Fragment,null,i)};
|
|
2
2
|
//# sourceMappingURL=RestAPI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RestAPI.js","sources":["../../src/components/RestAPI.tsx"],"sourcesContent":["// Copyright (C) 2022 Nethesis S.r.l.\n// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport React, { type ReactNode, type FC, useEffect } from 'react'\nimport
|
|
1
|
+
{"version":3,"file":"RestAPI.js","sources":["../../src/components/RestAPI.tsx"],"sourcesContent":["// Copyright (C) 2022 Nethesis S.r.l.\n// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport React, { type ReactNode, type FC, useEffect } from 'react'\nimport { getCurrentUserInfo } from '../services/user'\nimport { useDispatch } from 'react-redux'\nimport { Dispatch } from '../store'\n\nexport const RestAPI: FC<RestAPIProps> = ({ hostName, username, authToken, children }) => {\n const dispatch = useDispatch<Dispatch>()\n\n useEffect(() => {\n // Initialize axios\n dispatch.fetchDefaults.updateFetchBaseURL(`https://${hostName}/webrest`)\n dispatch.fetchDefaults.updateFetchHeaders({\n Authorization: `${username}:${authToken}`,\n })\n\n async function initUserInfo() {\n const userInfo = await getCurrentUserInfo()\n if (userInfo != undefined) {\n dispatch.currentUser.updateCurrentUser(userInfo)\n }\n }\n initUserInfo()\n }, [])\n\n return <>{children}</>\n}\n\ninterface RestAPIProps {\n children: ReactNode\n hostName: string\n username: string\n authToken: string\n}\n"],"names":["_a","hostName","username","authToken","children","dispatch","useDispatch","useEffect","fetchDefaults","updateFetchBaseURL","concat","updateFetchHeaders","Authorization","getCurrentUserInfo","undefined","userInfo","sent","currentUser","updateCurrentUser","initUserInfo","React","createElement","Fragment"],"mappings":"uYAQyC,SAACA,OAAEC,EAAQD,EAAAC,SAAEC,EAAQF,EAAAE,SAAEC,EAASH,EAAAG,UAAEC,EAAQJ,EAAAI,SAC3EC,EAAWC,EAAAA,cAkBjB,OAhBAC,EAAAA,WAAU,WAERF,EAASG,cAAcC,mBAAmB,WAAWC,OAAAT,EAAkB,aACvEI,EAASG,cAAcG,mBAAmB,CACxCC,cAAe,GAAAF,OAAGR,EAAQ,KAAAQ,OAAIP,KAGhC,0HACmB,MAAM,CAAA,EAAAU,EAAAA,oCACPC,OADVC,EAAWf,EAA0BgB,SAEzCX,EAASY,YAAYC,kBAAkBH,aAE1C,CACDI,EACD,GAAE,IAEIC,EAAAA,QAAAC,cAAAD,EAAAA,QAAAE,SAAA,KAAGlB,EACZ"}
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.absolute{position:absolute}.relative{position:relative}.left-0{left:0}.top-0{top:0}.z-1000{z-index:1000}.-z-10{z-index:-10}.z-10{z-index:10}.col-start-auto{grid-column-start:auto}.-mt-1\.5{margin-top:-.375rem}.-mt-1{margin-top:-.25rem}.inline-block{display:inline-block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-12{height:3rem}.h-1{height:.25rem}.h-72{height:18rem}.min-h-full{min-height:100%}.w-12{width:3rem}.w-1{width:.25rem}.w-72{width:18rem}.min-w-full{min-width:100%}.rotate-135{--tw-rotate:135deg}.rotate-135,.transform{-webkit-transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@-webkit-keyframes ping{75%,to{opacity:0;-webkit-transform:scale(2);transform:scale(2)}}@keyframes ping{75%,to{opacity:0;-webkit-transform:scale(2);transform:scale(2)}}.animate-ping{-webkit-animation:ping 1s cubic-bezier(0,0,.2,1) infinite;animation:ping 1s cubic-bezier(0,0,.2,1) infinite}.auto-cols-max{grid-auto-columns:-webkit-max-content;grid-auto-columns:max-content}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.place-items-center{place-items:center}.content-center{align-content:center}.items-center{align-items:center}.justify-center{justify-content:center}.justify-items-end{justify-items:end}.justify-items-center{justify-items:center}.gap-0\.5{gap:.125rem}.gap-0{gap:0}.gap-3\.5{gap:.875rem}.gap-3{gap:.75rem}.gap-y-5{row-gap:1.25rem}.overflow-hidden{overflow:hidden}.rounded-full{border-radius:9999px}.rounded-xl{border-radius:.75rem}.rounded-sm{border-radius:.125rem}.rounded-md{border-radius:.375rem}.rounded{border-radius:.25rem}.border{border-width:1px}.border-transparent{border-color:transparent}.border-gray-700{--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity))}.bg-emerald-600{--tw-bg-opacity:1;background-color:rgb(5 150 105/var(--tw-bg-opacity))}.bg-red-600{--tw-bg-opacity:1;background-color:rgb(220 38 38/var(--tw-bg-opacity))}.bg-green-600{--tw-bg-opacity:1;background-color:rgb(22 163 74/var(--tw-bg-opacity))}.bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.bg-transparent{background-color:initial}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity))}.bg-sky-600{--tw-bg-opacity:1;background-color:rgb(2 132 199/var(--tw-bg-opacity))}.px-3{padding-left:.75rem;padding-right:.75rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.text-sm{font-size:.875rem;line-height:1.25rem}.font-medium{font-weight:500}.leading-4{line-height:1rem}.tracking-wide{letter-spacing:.025em}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.opacity-60{opacity:.6}.filter{-webkit-filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,-webkit-transform,-webkit-filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-transform,-webkit-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.hover\:border-gray-500:hover{--tw-border-opacity:1;border-color:rgb(107 114 128/var(--tw-border-opacity))}.hover\:bg-red-700:hover{--tw-bg-opacity:1;background-color:rgb(185 28 28/var(--tw-bg-opacity))}.hover\:bg-green-700:hover{--tw-bg-opacity:1;background-color:rgb(21 128 61/var(--tw-bg-opacity))}.hover\:bg-gray-500:hover{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.hover\:bg-sky-700:hover{--tw-bg-opacity:1;background-color:rgb(3 105 161/var(--tw-bg-opacity))}.focus\:z-20:focus{z-index:20}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\:ring-0:focus,.focus\:ring-2:focus{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring-0:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\:ring-red-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(239 68 68/var(--tw-ring-opacity))}.focus\:ring-green-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(34 197 94/var(--tw-ring-opacity))}.focus\:ring-gray-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(107 114 128/var(--tw-ring-opacity))}.focus\:ring-sky-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(14 165 233/var(--tw-ring-opacity))}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px}.focus\:ring-offset-black:focus{--tw-ring-offset-color:#000}.focus\:ring-offset-white:focus{--tw-ring-offset-color:#fff}.disabled\:opacity-75:disabled{opacity:.75}
|
|
1
|
+
*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.absolute{position:absolute}.relative{position:relative}.left-0{left:0}.top-0{top:0}.z-1000{z-index:1000}.-z-10{z-index:-10}.z-10{z-index:10}.col-start-auto{grid-column-start:auto}.-mt-1\.5{margin-top:-.375rem}.-mt-1{margin-top:-.25rem}.inline-block{display:inline-block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-12{height:3rem}.h-1{height:.25rem}.h-72{height:18rem}.h-6{height:1.5rem}.min-h-full{min-height:100%}.w-12{width:3rem}.w-1{width:.25rem}.w-72{width:18rem}.w-6{width:1.5rem}.min-w-full{min-width:100%}.rotate-135{--tw-rotate:135deg}.rotate-135,.transform{-webkit-transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@-webkit-keyframes ping{75%,to{opacity:0;-webkit-transform:scale(2);transform:scale(2)}}@keyframes ping{75%,to{opacity:0;-webkit-transform:scale(2);transform:scale(2)}}.animate-ping{-webkit-animation:ping 1s cubic-bezier(0,0,.2,1) infinite;animation:ping 1s cubic-bezier(0,0,.2,1) infinite}.auto-cols-max{grid-auto-columns:-webkit-max-content;grid-auto-columns:max-content}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.place-items-center{place-items:center}.content-center{align-content:center}.items-center{align-items:center}.justify-center{justify-content:center}.justify-items-end{justify-items:end}.justify-items-center{justify-items:center}.gap-0\.5{gap:.125rem}.gap-0{gap:0}.gap-3\.5{gap:.875rem}.gap-3{gap:.75rem}.gap-y-5{row-gap:1.25rem}.overflow-hidden{overflow:hidden}.rounded-full{border-radius:9999px}.rounded-xl{border-radius:.75rem}.rounded-sm{border-radius:.125rem}.rounded-md{border-radius:.375rem}.rounded{border-radius:.25rem}.border{border-width:1px}.border-transparent{border-color:transparent}.border-gray-700{--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity))}.bg-emerald-600{--tw-bg-opacity:1;background-color:rgb(5 150 105/var(--tw-bg-opacity))}.bg-red-600{--tw-bg-opacity:1;background-color:rgb(220 38 38/var(--tw-bg-opacity))}.bg-green-600{--tw-bg-opacity:1;background-color:rgb(22 163 74/var(--tw-bg-opacity))}.bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.bg-transparent{background-color:initial}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity))}.bg-sky-600{--tw-bg-opacity:1;background-color:rgb(2 132 199/var(--tw-bg-opacity))}.px-3{padding-left:.75rem;padding-right:.75rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.text-sm{font-size:.875rem;line-height:1.25rem}.font-medium{font-weight:500}.leading-4{line-height:1rem}.tracking-wide{letter-spacing:.025em}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.opacity-60{opacity:.6}.filter{-webkit-filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,-webkit-transform,-webkit-filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-transform,-webkit-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.hover\:border-gray-500:hover{--tw-border-opacity:1;border-color:rgb(107 114 128/var(--tw-border-opacity))}.hover\:bg-red-700:hover{--tw-bg-opacity:1;background-color:rgb(185 28 28/var(--tw-bg-opacity))}.hover\:bg-green-700:hover{--tw-bg-opacity:1;background-color:rgb(21 128 61/var(--tw-bg-opacity))}.hover\:bg-gray-500:hover{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.hover\:bg-sky-700:hover{--tw-bg-opacity:1;background-color:rgb(3 105 161/var(--tw-bg-opacity))}.focus\:z-20:focus{z-index:20}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\:ring-0:focus,.focus\:ring-2:focus{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring-0:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\:ring-red-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(239 68 68/var(--tw-ring-opacity))}.focus\:ring-green-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(34 197 94/var(--tw-ring-opacity))}.focus\:ring-gray-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(107 114 128/var(--tw-ring-opacity))}.focus\:ring-sky-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(14 165 233/var(--tw-ring-opacity))}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px}.focus\:ring-offset-black:focus{--tw-ring-offset-color:#000}.focus\:ring-offset-white:focus{--tw-ring-offset-color:#fff}.disabled\:opacity-75:disabled{opacity:.75}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../../node_modules/mic-check/lib/index.js");var e=require("../webrtc/janus.js"),i=require("../../_virtual/
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../../node_modules/mic-check/lib/index.js");var e=require("../webrtc/janus.js"),i=require("../../_virtual/index8.js"),r=e.default;exports.checkMediaPermissions=function(){i.__exports.requestMediaPermissions().then((function(){})).catch((function(e){var a=e.type;e.name,e.message,a===i.__exports.MediaPermissionsErrorType.SystemPermissionDenied?r.error&&r.error("WebRTC: browser does not have permission to access camera or microphone"):a===i.__exports.MediaPermissionsErrorType.UserPermissionDenied?r.error&&r.error("WebRTC: user didn't allow app to access camera or microphone"):a===i.__exports.MediaPermissionsErrorType.CouldNotStartVideoSource?r.error&&r.error("WebRTC: camera is in use by another application (Zoom, Skype) or browser tab (Google Meet, Messenger Video)"):r.error&&r.error("WebRTC: can't access audio or camere on this device. unknown error")}))},exports.getSupportedDevices=function(e){navigator.mediaDevices.getUserMedia({video:!0,audio:!0}),navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices&&(navigator.enumerateDevices=function(e){navigator.mediaDevices.enumerateDevices().then(e)});var i=[],r="https:"===location.protocol,a=!1;("undefined"!=typeof MediaStreamTrack&&"getSources"in MediaStreamTrack||navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices)&&(a=!0);var o,n=!1,t=!1;o=function(){e()},a&&(!navigator.enumerateDevices&&window.MediaStreamTrack&&window.MediaStreamTrack.getSources&&(navigator.enumerateDevices=window.MediaStreamTrack.getSources.bind(window.MediaStreamTrack)),!navigator.enumerateDevices&&navigator.enumerateDevices&&(navigator.enumerateDevices=navigator.enumerateDevices.bind(navigator)),navigator.enumerateDevices?(i=[],navigator.enumerateDevices((function(e){e.forEach((function(e){var a,o={};for(var s in e)o[s]=e[s];"audio"===o.kind&&(o.kind="audioinput"),"video"===o.kind&&(o.kind="videoinput"),i.forEach((function(e){e.id===o.id&&e.kind===o.kind&&(a=!0)})),a||(o.deviceId||(o.deviceId=o.id),o.id||(o.id=o.deviceId),o.label?("videoinput"!==o.kind||t||(t=!0),"audioinput"!==o.kind||n||(n=!0)):(o.label="Please invoke getUserMedia once.",r||(o.label="HTTPs is required to get label of this "+o.kind+" device.")),o.kind,o.kind,o.kind,i.push(o))})),o&&o()}))):o&&o())};
|
|
2
2
|
//# sourceMappingURL=devices.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devices.js","sources":["../../../src/lib/devices/devices.ts"],"sourcesContent":["// Copyright (C) 2022 Nethesis S.r.l.\n// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport {\n MediaPermissionsError,\n MediaPermissionsErrorType,\n requestMediaPermissions,\n} from 'mic-check'\nimport JanusLib from '../webrtc/janus'\nimport { JanusTypes } from '../webrtc/types'\n\nconst Janus: JanusTypes = JanusLib\n\nexport const getSupportedDevices = function (origCallback) {\n let supportedDevices = null\n\n navigator.mediaDevices.getUserMedia({\n video: true,\n audio: true,\n })\n\n if (navigator.mediaDevices && navigator.mediaDevices.enumerateDevices) {\n // Firefox 38+ seems having support of enumerateDevicesx\n // @ts-ignore\n navigator.enumerateDevices = function (callback) {\n navigator.mediaDevices.enumerateDevices().then(callback)\n }\n }\n\n var MediaDevices = []\n var isHTTPs = location.protocol === 'https:'\n var canEnumerate = false\n\n if (typeof MediaStreamTrack !== 'undefined' && 'getSources' in MediaStreamTrack) {\n canEnumerate = true\n } else if (navigator.mediaDevices && !!navigator.mediaDevices.enumerateDevices) {\n canEnumerate = true\n }\n\n var hasMicrophone = false\n var hasSpeakers = false\n var hasWebcam = false\n\n var isMicrophoneAlreadyCaptured = false\n var isWebcamAlreadyCaptured = false\n\n function checkDeviceSupport(callback) {\n if (!canEnumerate) {\n return\n }\n\n if (\n // @ts-ignore\n !navigator.enumerateDevices &&\n window.MediaStreamTrack &&\n // @ts-ignore\n window.MediaStreamTrack.getSources\n ) {\n // @ts-ignore\n navigator.enumerateDevices = window.MediaStreamTrack.getSources.bind(window.MediaStreamTrack)\n }\n // @ts-ignore\n if (!navigator.enumerateDevices && navigator.enumerateDevices) {\n // @ts-ignore\n navigator.enumerateDevices = navigator.enumerateDevices.bind(navigator)\n }\n // @ts-ignore\n if (!navigator.enumerateDevices) {\n if (callback) {\n callback()\n }\n return\n }\n\n MediaDevices = []\n // @ts-ignore\n navigator.enumerateDevices(function (devices) {\n devices.forEach(function (_device) {\n var device = {}\n for (var d in _device) {\n device[d] = _device[d]\n }\n // @ts-ignore\n if (device.kind === 'audio') {\n // @ts-ignore\n device.kind = 'audioinput'\n }\n // @ts-ignore\n if (device.kind === 'video') {\n // @ts-ignore\n device.kind = 'videoinput'\n }\n\n var skip\n MediaDevices.forEach(function (d) {\n // @ts-ignore\n if (d.id === device.id && d.kind === device.kind) {\n skip = true\n }\n })\n\n if (skip) {\n return\n }\n // @ts-ignore\n if (!device.deviceId) {\n // @ts-ignore\n device.deviceId = device.id\n }\n // @ts-ignore\n if (!device.id) {\n // @ts-ignore\n device.id = device.deviceId\n }\n // @ts-ignore\n if (!device.label) {\n // @ts-ignore\n device.label = 'Please invoke getUserMedia once.'\n if (!isHTTPs) {\n // @ts-ignore\n device.label = 'HTTPs is required to get label of this ' + device.kind + ' device.'\n }\n } else {\n // @ts-ignore\n if (device.kind === 'videoinput' && !isWebcamAlreadyCaptured) {\n isWebcamAlreadyCaptured = true\n }\n // @ts-ignore\n if (device.kind === 'audioinput' && !isMicrophoneAlreadyCaptured) {\n isMicrophoneAlreadyCaptured = true\n }\n }\n // @ts-ignore\n if (device.kind === 'audioinput') {\n hasMicrophone = true\n }\n // @ts-ignore\n if (device.kind === 'audiooutput') {\n hasSpeakers = true\n }\n // @ts-ignore\n if (device.kind === 'videoinput') {\n hasWebcam = true\n }\n\n // there is no 'videoouput' in the spec.\n // @ts-ignore\n MediaDevices.push(device)\n })\n\n if (callback) {\n callback()\n }\n })\n }\n\n // check for microphone/camera support!\n checkDeviceSupport(function () {\n // @ts-ignore\n supportedDevices = {\n audio: hasMicrophone,\n audioCap: isMicrophoneAlreadyCaptured,\n video: hasWebcam,\n videoCap: isWebcamAlreadyCaptured,\n }\n // @ts-ignore\n // janus.log('supportedDevices=', supportedDevices)\n origCallback()\n })\n}\n\nexport const checkMediaPermissions = function () {\n requestMediaPermissions()\n .then(() => {\n // can successfully access camera and microphone streams\n // save permissions state on rematch to get access globally on the app\n })\n .catch((err: MediaPermissionsError) => {\n const { type, name, message } = err\n if (type === MediaPermissionsErrorType.SystemPermissionDenied) {\n // browser does not have permission to access camera or microphone\n if (Janus.error)\n Janus.error('WebRTC: browser does not have permission to access camera or microphone')\n } else if (type === MediaPermissionsErrorType.UserPermissionDenied) {\n // user didn't allow app to access camera or microphone\n if (Janus.error) Janus.error(\"WebRTC: user didn't allow app to access camera or microphone\")\n } else if (type === MediaPermissionsErrorType.CouldNotStartVideoSource) {\n // camera is in use by another application (Zoom, Skype) or browser tab (Google Meet, Messenger Video)\n // (mostly Windows specific problem)\n if (Janus.error)\n Janus.error(\n 'WebRTC: camera is in use by another application (Zoom, Skype) or browser tab (Google Meet, Messenger Video)',\n )\n } else {\n if (Janus.error)\n // not all error types are handled by this library\n Janus.error(\"WebRTC: can't access audio or camere on this device. unknown error\")\n }\n })\n}\n"],"names":["Janus","JanusLib","requestMediaPermissions","then","catch","err","type","name","MediaPermissionsErrorType","__exports","SystemPermissionDenied","error","UserPermissionDenied","CouldNotStartVideoSource","origCallback","navigator","mediaDevices","getUserMedia","video","audio","enumerateDevices","callback","MediaDevices","isHTTPs","location","protocol","canEnumerate","MediaStreamTrack","isMicrophoneAlreadyCaptured","isWebcamAlreadyCaptured","window","getSources","bind","devices","forEach","_device","skip","device","d","kind","id","deviceId","label","push"],"mappings":"
|
|
1
|
+
{"version":3,"file":"devices.js","sources":["../../../src/lib/devices/devices.ts"],"sourcesContent":["// Copyright (C) 2022 Nethesis S.r.l.\n// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport {\n MediaPermissionsError,\n MediaPermissionsErrorType,\n requestMediaPermissions,\n} from 'mic-check'\nimport JanusLib from '../webrtc/janus'\nimport { JanusTypes } from '../webrtc/types'\n\nconst Janus: JanusTypes = JanusLib\n\nexport const getSupportedDevices = function (origCallback) {\n let supportedDevices = null\n\n navigator.mediaDevices.getUserMedia({\n video: true,\n audio: true,\n })\n\n if (navigator.mediaDevices && navigator.mediaDevices.enumerateDevices) {\n // Firefox 38+ seems having support of enumerateDevicesx\n // @ts-ignore\n navigator.enumerateDevices = function (callback) {\n navigator.mediaDevices.enumerateDevices().then(callback)\n }\n }\n\n var MediaDevices = []\n var isHTTPs = location.protocol === 'https:'\n var canEnumerate = false\n\n if (typeof MediaStreamTrack !== 'undefined' && 'getSources' in MediaStreamTrack) {\n canEnumerate = true\n } else if (navigator.mediaDevices && !!navigator.mediaDevices.enumerateDevices) {\n canEnumerate = true\n }\n\n var hasMicrophone = false\n var hasSpeakers = false\n var hasWebcam = false\n\n var isMicrophoneAlreadyCaptured = false\n var isWebcamAlreadyCaptured = false\n\n function checkDeviceSupport(callback) {\n if (!canEnumerate) {\n return\n }\n\n if (\n // @ts-ignore\n !navigator.enumerateDevices &&\n window.MediaStreamTrack &&\n // @ts-ignore\n window.MediaStreamTrack.getSources\n ) {\n // @ts-ignore\n navigator.enumerateDevices = window.MediaStreamTrack.getSources.bind(window.MediaStreamTrack)\n }\n // @ts-ignore\n if (!navigator.enumerateDevices && navigator.enumerateDevices) {\n // @ts-ignore\n navigator.enumerateDevices = navigator.enumerateDevices.bind(navigator)\n }\n // @ts-ignore\n if (!navigator.enumerateDevices) {\n if (callback) {\n callback()\n }\n return\n }\n\n MediaDevices = []\n // @ts-ignore\n navigator.enumerateDevices(function (devices) {\n devices.forEach(function (_device) {\n var device = {}\n for (var d in _device) {\n device[d] = _device[d]\n }\n // @ts-ignore\n if (device.kind === 'audio') {\n // @ts-ignore\n device.kind = 'audioinput'\n }\n // @ts-ignore\n if (device.kind === 'video') {\n // @ts-ignore\n device.kind = 'videoinput'\n }\n\n var skip\n MediaDevices.forEach(function (d) {\n // @ts-ignore\n if (d.id === device.id && d.kind === device.kind) {\n skip = true\n }\n })\n\n if (skip) {\n return\n }\n // @ts-ignore\n if (!device.deviceId) {\n // @ts-ignore\n device.deviceId = device.id\n }\n // @ts-ignore\n if (!device.id) {\n // @ts-ignore\n device.id = device.deviceId\n }\n // @ts-ignore\n if (!device.label) {\n // @ts-ignore\n device.label = 'Please invoke getUserMedia once.'\n if (!isHTTPs) {\n // @ts-ignore\n device.label = 'HTTPs is required to get label of this ' + device.kind + ' device.'\n }\n } else {\n // @ts-ignore\n if (device.kind === 'videoinput' && !isWebcamAlreadyCaptured) {\n isWebcamAlreadyCaptured = true\n }\n // @ts-ignore\n if (device.kind === 'audioinput' && !isMicrophoneAlreadyCaptured) {\n isMicrophoneAlreadyCaptured = true\n }\n }\n // @ts-ignore\n if (device.kind === 'audioinput') {\n hasMicrophone = true\n }\n // @ts-ignore\n if (device.kind === 'audiooutput') {\n hasSpeakers = true\n }\n // @ts-ignore\n if (device.kind === 'videoinput') {\n hasWebcam = true\n }\n\n // there is no 'videoouput' in the spec.\n // @ts-ignore\n MediaDevices.push(device)\n })\n\n if (callback) {\n callback()\n }\n })\n }\n\n // check for microphone/camera support!\n checkDeviceSupport(function () {\n // @ts-ignore\n supportedDevices = {\n audio: hasMicrophone,\n audioCap: isMicrophoneAlreadyCaptured,\n video: hasWebcam,\n videoCap: isWebcamAlreadyCaptured,\n }\n // @ts-ignore\n // janus.log('supportedDevices=', supportedDevices)\n origCallback()\n })\n}\n\nexport const checkMediaPermissions = function () {\n requestMediaPermissions()\n .then(() => {\n // can successfully access camera and microphone streams\n // save permissions state on rematch to get access globally on the app\n })\n .catch((err: MediaPermissionsError) => {\n const { type, name, message } = err\n if (type === MediaPermissionsErrorType.SystemPermissionDenied) {\n // browser does not have permission to access camera or microphone\n if (Janus.error)\n Janus.error('WebRTC: browser does not have permission to access camera or microphone')\n } else if (type === MediaPermissionsErrorType.UserPermissionDenied) {\n // user didn't allow app to access camera or microphone\n if (Janus.error) Janus.error(\"WebRTC: user didn't allow app to access camera or microphone\")\n } else if (type === MediaPermissionsErrorType.CouldNotStartVideoSource) {\n // camera is in use by another application (Zoom, Skype) or browser tab (Google Meet, Messenger Video)\n // (mostly Windows specific problem)\n if (Janus.error)\n Janus.error(\n 'WebRTC: camera is in use by another application (Zoom, Skype) or browser tab (Google Meet, Messenger Video)',\n )\n } else {\n if (Janus.error)\n // not all error types are handled by this library\n Janus.error(\"WebRTC: can't access audio or camere on this device. unknown error\")\n }\n })\n}\n"],"names":["Janus","JanusLib","requestMediaPermissions","then","catch","err","type","name","MediaPermissionsErrorType","__exports","SystemPermissionDenied","error","UserPermissionDenied","CouldNotStartVideoSource","origCallback","navigator","mediaDevices","getUserMedia","video","audio","enumerateDevices","callback","MediaDevices","isHTTPs","location","protocol","canEnumerate","MediaStreamTrack","isMicrophoneAlreadyCaptured","isWebcamAlreadyCaptured","window","getSources","bind","devices","forEach","_device","skip","device","d","kind","id","deviceId","label","push"],"mappings":"mMAWMA,EAAoBC,EAAAA,sCAgKW,WACnCC,sCACGC,MAAK,WAGN,IACCC,OAAM,SAACC,GACE,IAAAC,EAAwBD,EAAGC,KAAHD,EAAGE,KAAHF,UAC5BC,IAASE,EAAyBC,UAAAD,0BAACE,uBAEjCV,EAAMW,OACRX,EAAMW,MAAM,2EACLL,IAASE,EAAyBC,UAAAD,0BAACI,qBAExCZ,EAAMW,OAA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,EAAOK,OASU,eAAhBL,EAAOE,MAA0BV,IACnCA,GAA0B,GAGR,eAAhBQ,EAAOE,MAA0BX,IACnCA,GAA8B,KAZhCS,EAAOK,MAAQ,mCACVnB,IAEHc,EAAOK,MAAQ,0CAA4CL,EAAOE,KAAO,aAazEF,EAAOE,KAIPF,EAAOE,KAIPF,EAAOE,KAMXjB,EAAaqB,KAAKN,GACpB,IAEIhB,GACFA,GAEJ,KArFMA,GACFA,IAoGR"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { RootModel } from '.';
|
|
2
|
+
export declare const fetchDefaults: {
|
|
3
|
+
name?: string | undefined;
|
|
4
|
+
state: FetchTypes;
|
|
5
|
+
} & ({} | {
|
|
6
|
+
effects: import("@rematch/core").ModelEffects<RootModel>;
|
|
7
|
+
} | {
|
|
8
|
+
effects: import("@rematch/core").ModelEffectsCreator<RootModel>;
|
|
9
|
+
}) & {
|
|
10
|
+
reducers: {
|
|
11
|
+
updateFetchBaseURL: (state: FetchTypes, payload: string) => {
|
|
12
|
+
baseURL: string;
|
|
13
|
+
headers?: HeadersTypes | undefined;
|
|
14
|
+
};
|
|
15
|
+
updateFetchHeaders: (state: FetchTypes, payload: HeadersTypes) => {
|
|
16
|
+
headers: {
|
|
17
|
+
[x: string]: string;
|
|
18
|
+
};
|
|
19
|
+
baseURL?: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
} & ({} | {
|
|
23
|
+
baseReducer: import("redux").Reducer<FetchTypes, import("redux").AnyAction>;
|
|
24
|
+
});
|
|
25
|
+
interface HeadersTypes {
|
|
26
|
+
[key: string]: string;
|
|
27
|
+
}
|
|
28
|
+
interface FetchTypes {
|
|
29
|
+
baseURL?: string;
|
|
30
|
+
headers?: HeadersTypes;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../node_modules/tslib/tslib.es6.js"),s=require("../node_modules/@rematch/core/dist/core.esm.js").createModel()({state:{baseURL:"",headers:{Accept:"application/json, text/plain, */*"}},reducers:{updateFetchBaseURL:function(s,t){return e.__assign(e.__assign({},s),{baseURL:t})},updateFetchHeaders:function(s,t){return e.__assign(e.__assign({},s),{headers:e.__assign(e.__assign({},s.headers),t)})}}});exports.fetchDefaults=s;
|
|
2
|
+
//# sourceMappingURL=fetchDefaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchDefaults.js","sources":["../../src/models/fetchDefaults.ts"],"sourcesContent":["// Copyright (C) 2022 Nethesis S.r.l.\n// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport { createModel } from '@rematch/core'\nimport type { RootModel } from '.'\n\nconst defaultState: FetchTypes = {\n baseURL: '',\n headers: {\n Accept: 'application/json, text/plain, */*',\n },\n}\n\nexport const fetchDefaults = createModel<RootModel>()({\n state: defaultState,\n reducers: {\n updateFetchBaseURL: (state, payload: string) => {\n return {\n ...state,\n baseURL: payload,\n }\n },\n updateFetchHeaders: (state, payload: HeadersTypes) => {\n return {\n ...state,\n headers: {\n ...state.headers,\n ...payload,\n },\n }\n },\n },\n})\n\ninterface HeadersTypes {\n [key: string]: string\n}\n\ninterface FetchTypes {\n baseURL?: string\n headers?: HeadersTypes\n}\n"],"names":["fetchDefaults","createModel","state","baseURL","headers","Accept","reducers","updateFetchBaseURL","payload","__assign","updateFetchHeaders"],"mappings":"wHAaaA,4DAA2BC,aAAXA,CAAyB,CACpDC,MAR+B,CAC/BC,QAAS,GACTC,QAAS,CACPC,OAAQ,sCAMVC,SAAU,CACRC,mBAAoB,SAACL,EAAOM,GAC1B,OAAAC,EAAAA,SAAAA,EAAAA,SAAA,GACKP,GAAK,CACRC,QAASK,GAEZ,EACDE,mBAAoB,SAACR,EAAOM,GAC1B,OACKC,EAAAA,SAAAA,EAAAA,SAAA,CAAA,EAAAP,IACHE,QAAOK,EAAAA,SAAAA,EAAAA,SAAA,CAAA,EACFP,EAAME,SACNI,IAGR"}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -3,10 +3,12 @@ import { player } from './player';
|
|
|
3
3
|
import { webrtc } from './webrtc';
|
|
4
4
|
import { currentCall } from './currentCall';
|
|
5
5
|
import { currentUser } from './currentUser';
|
|
6
|
+
import { fetchDefaults } from './fetchDefaults';
|
|
6
7
|
export interface RootModel extends Models<RootModel> {
|
|
7
8
|
player: typeof player;
|
|
8
9
|
webrtc: typeof webrtc;
|
|
9
10
|
currentCall: typeof currentCall;
|
|
10
11
|
currentUser: typeof currentUser;
|
|
12
|
+
fetchDefaults: typeof fetchDefaults;
|
|
11
13
|
}
|
|
12
14
|
export declare const models: RootModel;
|
package/dist/models/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./player.js"),r=require("./webrtc.js"),t=require("./currentCall.js"),s=require("./currentUser.js"),u=require("./fetchDefaults.js"),l={player:e.player,webrtc:r.webrtc,currentCall:t.currentCall,currentUser:s.currentUser,fetchDefaults:u.fetchDefaults};exports.models=l;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/models/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/models/index.ts"],"sourcesContent":["import { Models } from '@rematch/core'\nimport { player } from './player'\nimport { webrtc } from './webrtc'\nimport { currentCall } from './currentCall'\nimport { currentUser } from './currentUser'\n\nexport interface RootModel extends Models<RootModel> {\n player: typeof player\n webrtc: typeof webrtc\n currentCall: typeof currentCall\n currentUser: typeof currentUser\n}\n\nexport const models: RootModel = {\n player,\n webrtc,\n currentCall,\n currentUser,\n}\n"],"names":["models","player","webrtc","currentCall","currentUser"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/models/index.ts"],"sourcesContent":["import { Models } from '@rematch/core'\nimport { player } from './player'\nimport { webrtc } from './webrtc'\nimport { currentCall } from './currentCall'\nimport { currentUser } from './currentUser'\nimport { fetchDefaults } from './fetchDefaults'\n\nexport interface RootModel extends Models<RootModel> {\n player: typeof player\n webrtc: typeof webrtc\n currentCall: typeof currentCall\n currentUser: typeof currentUser\n fetchDefaults: typeof fetchDefaults\n}\n\nexport const models: RootModel = {\n player,\n webrtc,\n currentCall,\n currentUser,\n fetchDefaults\n}\n"],"names":["models","player","webrtc","currentCall","currentUser","fetchDefaults"],"mappings":"sNAeaA,EAAoB,CAC/BC,OAAMA,EAAAA,OACNC,OAAMA,EAAAA,OACNC,YAAWA,EAAAA,YACXC,YAAWA,EAAAA,YACXC,cAAaA,EAAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../fontawesome-svg-core/index.mjs.js");require("../../prop-types/index.js");var r=require("react"),t=require("../../../_virtual/
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../fontawesome-svg-core/index.mjs.js");require("../../prop-types/index.js");var r=require("react"),t=require("../../../_virtual/index5.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=o(r);function s(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function p(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?s(Object(t),!0).forEach((function(r){i(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function i(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function l(e,r){if(null==e)return{};var t,o,n=function(e,r){if(null==e)return{};var t,o,n={},s=Object.keys(e);for(o=0;o<s.length;o++)t=s[o],r.indexOf(t)>=0||(n[t]=e[t]);return n}(e,r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)t=s[o],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}function f(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,r){if(!e)return;if("string"==typeof e)return c(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return c(e,r)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,o=new Array(r);t<r;t++)o[t]=e[t];return o}function u(e){return r=e,(r-=0)==r?e:(e=e.replace(/[\-_\s]+(.)?/g,(function(e,r){return r?r.toUpperCase():""}))).substr(0,1).toLowerCase()+e.substr(1);var r}var y=["style"];function b(e){return e.split(";").map((function(e){return e.trim()})).filter((function(e){return e})).reduce((function(e,r){var t,o=r.indexOf(":"),n=u(r.slice(0,o)),s=r.slice(o+1).trim();return n.startsWith("webkit")?e[(t=n,t.charAt(0).toUpperCase()+t.slice(1))]=s:e[n]=s,e}),{})}var d=!1;try{d="production"===process.env.NODE_ENV}catch(e){}function x(r){return r&&"object"===a(r)&&r.prefix&&r.iconName&&r.icon?r:e.parse.icon?e.parse.icon(r):null===r?null:r&&"object"===a(r)&&r.prefix&&r.iconName?r:Array.isArray(r)&&2===r.length?{prefix:r[0],iconName:r[1]}:"string"==typeof r?{prefix:"fas",iconName:r}:void 0}function m(e,r){return Array.isArray(r)&&r.length>0||!Array.isArray(r)&&r?i({},e,r):{}}var O=n.default.forwardRef((function(r,t){var o=r.icon,n=r.mask,s=r.symbol,a=r.className,l=r.title,c=r.titleId,u=r.maskId,y=x(o),b=m("classes",[].concat(f(function(e){var r,t=e.beat,o=e.fade,n=e.beatFade,s=e.bounce,p=e.shake,a=e.flash,l=e.spin,f=e.spinPulse,c=e.spinReverse,u=e.pulse,y=e.fixedWidth,b=e.inverse,d=e.border,x=e.listItem,m=e.flip,O=e.size,v=e.rotation,T=e.pull,h=(i(r={"fa-beat":t,"fa-fade":o,"fa-beat-fade":n,"fa-bounce":s,"fa-shake":p,"fa-flash":a,"fa-spin":l,"fa-spin-reverse":c,"fa-spin-pulse":f,"fa-pulse":u,"fa-fw":y,"fa-inverse":b,"fa-border":d,"fa-li":x,"fa-flip":!0===m,"fa-flip-horizontal":"horizontal"===m||"both"===m,"fa-flip-vertical":"vertical"===m||"both"===m},"fa-".concat(O),null!=O),i(r,"fa-rotate-".concat(v),null!=v&&0!==v),i(r,"fa-pull-".concat(T),null!=T),i(r,"fa-swap-opacity",e.swapOpacity),r);return Object.keys(h).map((function(e){return h[e]?e:null})).filter((function(e){return e}))}(r)),f(a.split(" ")))),T=m("transform","string"==typeof r.transform?e.parse.transform(r.transform):r.transform),h=m("mask",x(n)),g=e.icon(y,p(p(p(p({},b),T),h),{},{symbol:s,title:l,titleId:c,maskId:u}));if(!g)return function(){var e;!d&&console&&"function"==typeof console.error&&(e=console).error.apply(e,arguments)}("Could not find icon",y),null;var j=g.abstract,w={ref:t};return Object.keys(r).forEach((function(e){O.defaultProps.hasOwnProperty(e)||(w[e]=r[e])})),v(j[0],w)}));O.displayName="FontAwesomeIcon",O.propTypes={beat:t.propTypes.exports.bool,border:t.propTypes.exports.bool,beatFade:t.propTypes.exports.bool,bounce:t.propTypes.exports.bool,className:t.propTypes.exports.string,fade:t.propTypes.exports.bool,flash:t.propTypes.exports.bool,mask:t.propTypes.exports.oneOfType([t.propTypes.exports.object,t.propTypes.exports.array,t.propTypes.exports.string]),maskId:t.propTypes.exports.string,fixedWidth:t.propTypes.exports.bool,inverse:t.propTypes.exports.bool,flip:t.propTypes.exports.oneOf([!0,!1,"horizontal","vertical","both"]),icon:t.propTypes.exports.oneOfType([t.propTypes.exports.object,t.propTypes.exports.array,t.propTypes.exports.string]),listItem:t.propTypes.exports.bool,pull:t.propTypes.exports.oneOf(["right","left"]),pulse:t.propTypes.exports.bool,rotation:t.propTypes.exports.oneOf([0,90,180,270]),shake:t.propTypes.exports.bool,size:t.propTypes.exports.oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:t.propTypes.exports.bool,spinPulse:t.propTypes.exports.bool,spinReverse:t.propTypes.exports.bool,symbol:t.propTypes.exports.oneOfType([t.propTypes.exports.bool,t.propTypes.exports.string]),title:t.propTypes.exports.string,titleId:t.propTypes.exports.string,transform:t.propTypes.exports.oneOfType([t.propTypes.exports.string,t.propTypes.exports.object]),swapOpacity:t.propTypes.exports.bool},O.defaultProps={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1};var v=function e(r,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof t)return t;var n=(t.children||[]).map((function(t){return e(r,t)})),s=Object.keys(t.attributes||{}).reduce((function(e,r){var o=t.attributes[r];switch(r){case"class":e.attrs.className=o,delete t.attributes.class;break;case"style":e.attrs.style=b(o);break;default:0===r.indexOf("aria-")||0===r.indexOf("data-")?e.attrs[r.toLowerCase()]=o:e.attrs[u(r)]=o}return e}),{attrs:{}}),a=o.style,i=void 0===a?{}:a,c=l(o,y);return s.attrs.style=p(p({},s.attrs.style),i),r.apply(void 0,[t.tag,p(p({},s.attrs),c)].concat(f(n)))}.bind(null,n.default.createElement);exports.FontAwesomeIcon=O;
|
|
2
2
|
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.faChevronDown={prefix:"far",iconName:"chevron-down",icon:[448,512,[],"f078","M432.6 209.3l-191.1 183.1C235.1 397.8 229.1 400 224 400s-11.97-2.219-16.59-6.688L15.41 209.3C5.814 200.2 5.502 184.1 14.69 175.4c9.125-9.625 24.38-9.938 33.91-.7187L224 342.8l175.4-168c9.5-9.219 24.78-8.906 33.91 .7187C442.5 184.1 442.2 200.2 432.6 209.3z"]},exports.faMicrophone={prefix:"far",iconName:"microphone",icon:[384,512,[],"f130","M344 192C330.7 192 320 202.7 320 215.1V256c0 74.75-64.5 134.9-140.8 127.4C112.8 376.9 64 317.1 64 250.2V215.1C64 202.7 53.25 192 40 192S16 202.7 16 215.1v32.15c0 89.63 64 169.6 152 181.7V464H119.1C106.7 464 96 474.7 96 487.1S106.7 512 119.1 512h144C277.3 512 288 501.3 288 488S277.3 464 264 464H216v-33.77C301.8 418.5 368 344.9 368 256V215.1C368 202.7 357.3 192 344 192zM192 352c53 0 96-43 96-96v-160c0-52.1-43-96-96-96s-96 43-96 96v160C96 309 139 352 192 352zM144 96c0-26.5 21.5-48 48-48s48 21.5 48 48v160c0 26.5-21.5 48-48 48S144 282.5 144 256V96z"]},exports.faPause={prefix:"far",iconName:"pause",icon:[320,512,[9208],"f04c","M56 64C42.75 64 32 74.75 32 88v336C32 437.3 42.75 448 56 448s24-10.75 24-24V88C80 74.75 69.25 64 56 64zM264 64c-13.25 0-24 10.75-24 24v336c0 13.25 10.75 24 24 24S288 437.3 288 424V88C288 74.75 277.3 64 264 64z"]},exports.faRightLeft={prefix:"far",iconName:"right-left",icon:[512,512,["exchange-alt"],"f362","M24 152h328.1l-.1318 80c0 9.547 5.666 18.19 14.41 22s18.95 2.078 25.93-4.406l112-104c10.22-9.5 10.22-25.69 0-35.19l-112-104c-6.979-6.484-17.18-8.221-25.93-4.408s-14.41 12.46-14.41 22L352.1 104H24C10.75 104 0 114.7 0 127.1S10.75 152 24 152zM488 360H159.9L160 279.1c0-9.547-5.666-18.19-14.41-22S126.7 255.9 119.7 262.4l-112 104c-10.22 9.5-10.22 25.69 0 35.19l112 104c6.979 6.484 17.18 8.219 25.93 4.406S160 497.5 160 488l-.1318-80H488c13.25 0 24-10.75 24-24S501.3 360 488 360z"]};
|
|
2
|
+
//# sourceMappingURL=index.mjs.js.map
|