@reactoo/watchtogether-sdk-js 2.7.6 → 2.7.8
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/watchtogether-sdk.js +7 -7
- package/dist/watchtogether-sdk.min.js +2 -2
- package/package.json +1 -1
- package/src/models/asset.js +24 -12
- package/src/models/room.js +2 -2
- package/src/models/user.js +21 -9
- package/src/models/utils.js +0 -2
- package/src/modules/wt-utils.js +9 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @reactoo/watchtogether-sdk-js
|
|
3
|
-
* @version 2.7.
|
|
3
|
+
* @version 2.7.8
|
|
4
4
|
*/
|
|
5
5
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
6
6
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -8604,7 +8604,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mod
|
|
|
8604
8604
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
8605
8605
|
|
|
8606
8606
|
"use strict";
|
|
8607
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/wt-utils */ \"./src/modules/wt-utils.js\");\n\n\n\nlet asset = function () {\n var _this = this;\n return {\n getAssetList: _ref => {\n let {\n type = 'instanceType',\n instanceType,\n assetType,\n size = 20,\n startKey = null,\n roomId,\n ids\n } = _ref;\n let apiParams = {\n
|
|
8607
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/wt-utils */ \"./src/modules/wt-utils.js\");\n\n\n\nlet asset = function () {\n var _this = this;\n return {\n getAssetList: _ref => {\n let {\n type = 'instanceType',\n instanceType,\n assetType,\n size = 20,\n startKey = null,\n roomId,\n ids\n } = _ref;\n return Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"chunkArray\"])(ids, 50).reduce((promiseChain, idsChunk) => {\n return promiseChain.then(chainResponse => {\n let apiParams = {\n type,\n ...(instanceType && {\n instanceType: instanceType === true ? this.__instanceType : instanceType\n }),\n ...(assetType && {\n assetType\n }),\n ...(size && !ids && {\n size\n }),\n ...((idsChunk === null || idsChunk === void 0 ? void 0 : idsChunk.length) && {\n ids: idsChunk.join(',')\n }),\n ...(roomId && {\n roomId\n }),\n ...(startKey && {\n startKey\n })\n };\n return this.__privates.auth.__client.then(client => client.apis.asset.getAssetList(apiParams)).then(response => type === 'ids' ? {\n data: {\n items: [...chainResponse.data.items, ...response.data.items],\n size: chainResponse.data.size + response.data.size,\n startKey: null\n }\n } : response);\n });\n }, Promise.resolve({\n data: {\n items: [],\n size: 0,\n startKey: null\n }\n }));\n },\n getAssetById: id => {\n return this.__privates.auth.__client.then(client => client.apis.asset.getAssetById({\n id\n }));\n },\n updateAsset: function () {\n let {\n id,\n assetType,\n title,\n roomIds,\n customAttributes,\n encodeTransparency\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.asset.updateAsset({\n id\n }, {\n requestBody: {\n assetType,\n title,\n roomIds,\n customAttributes,\n encodeTransparency\n }\n }));\n },\n deleteAsset: id => {\n return this.__privates.auth.__client.then(client => client.apis.asset.deleteAsset({\n id\n }));\n },\n initiateAssetUpload: function () {\n let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n return _this.__privates.auth.__client.then(client => client.apis.asset.initiateAssetUpload());\n },\n uploadAsset: function (file, roomIds) {\n let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n let initiationData = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n return _this.__privates.auth.__client.then(client => Promise.all([client, initiationData ? Promise.resolve(initiationData) : client.apis.asset.initiateAssetUpload({\n id: id || Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"generateUUID\"])()\n })])).then(_ref2 => {\n let [client, response] = _ref2;\n return Promise.all([client, client.http({\n url: response.data.signedUrl,\n method: response.data.httpMethod,\n headers: {\n \"Content-Type\": file.type\n },\n body: file\n }), response.data.id]);\n }).then(_ref3 => {\n let [client, response, idn] = _ref3;\n return Promise.all([client.apis.asset.publishAsset({\n id: idn\n }, {\n requestBody: {\n title: file.name,\n ...(roomIds ? {\n roomIds\n } : {})\n }\n }), idn]);\n });\n },\n downloadAsset: function (url) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return _this.__privates.auth.__client.then(client => client.http({\n url,\n method: 'GET',\n ...options\n }));\n }\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (asset);\n\n//# sourceURL=webpack://WatchTogetherSDK/./src/models/asset.js?");
|
|
8608
8608
|
|
|
8609
8609
|
/***/ }),
|
|
8610
8610
|
|
|
@@ -8652,7 +8652,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mod
|
|
|
8652
8652
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
8653
8653
|
|
|
8654
8654
|
"use strict";
|
|
8655
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _room_session__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./room-session */ \"./src/models/room-session.js\");\n/* harmony import */ var _streaming_session__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./streaming-session */ \"./src/models/streaming-session.js\");\n/* harmony import */ var _modules_wt_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../modules/wt-utils */ \"./src/modules/wt-utils.js\");\n\n\n\n\n\nlet room = function () {\n var _this = this;\n let roomSessions = [];\n let setExitListeners = () => {\n window.addEventListener('pagehide', event => {\n if (!event.persisted) {\n this.room.destroySessions();\n }\n });\n window.addEventListener('beforeunload', () => {\n this.room.destroySessions();\n });\n };\n setExitListeners();\n return {\n //TODO:deprecated\n integration: function () {\n let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.system.integration({\n type: _this.__instanceType\n }, {\n requestBody: {\n ...data\n },\n requestInterceptor: req => {\n if (!req.headers) {\n req.headers = {};\n }\n req.headers['Authorization'] = 'Bearer ' + localStorage.getItem('rwt_idToken');\n return req;\n }\n }));\n },\n //TODO:deprecated\n getAnalytics: function () {\n let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.system.getAnalytics({\n instanceType: _this.__instanceType,\n ...data\n }));\n },\n sendChatMessage: _ref => {\n let {\n roomId,\n message,\n options,\n senderUserId\n } = _ref;\n return this.__privates.auth.__client.then(client => client.apis.wt.sendRoomMessage({}, {\n requestBody: {\n roomId,\n message,\n options,\n senderUserId\n }\n }));\n },\n createRoom: function () {\n let {\n sourceRoomId,\n title,\n description,\n isPublic,\n isRouter,\n isStudioLayout,\n wtChannelId,\n isHd,\n disableSync,\n reduceRoomControls,\n hasStudioChat,\n maxParticipants,\n customAttributes,\n chatRoomId,\n linkedRoomId,\n type,\n dotAttribute\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let _da = dotAttribute ? Array.isArray(dotAttribute) ? dotAttribute.reduce((p, cv) => (p[cv.name] = cv.value) && p || p, {}) : {\n [dotAttribute.name]: dotAttribute.value\n } : {};\n return _this.__privates.auth.__client.then(client => client.apis.wt.createRoom({\n sourceRoomId\n }, {\n requestBody: {\n title,\n description,\n isRouter,\n isPublic,\n isStudioLayout,\n wtChannelId,\n isHd,\n disableSync,\n reduceRoomControls,\n chatRoomId,\n linkedRoomId,\n hasStudioChat,\n maxParticipants,\n type,\n customAttributes,\n ..._da,\n instanceType: _this.__instanceType\n }\n }));\n },\n updateRoom: function () {\n let {\n roomId,\n title,\n description,\n isPublic,\n isRouter,\n recordings,\n slug,\n password,\n maxParticipants,\n setInstanceType = false,\n wtChannelId,\n isHd,\n isStudioLayout,\n hasStudioChat,\n reduceRoomControls,\n chatRoomId,\n linkedRoomId,\n type,\n disableSync,\n defaultRegion,\n customAttributes,\n dotAttribute\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let _da = dotAttribute ? Array.isArray(dotAttribute) ? dotAttribute.reduce((p, cv) => (p[cv.name] = cv.value) && p || p, {}) : {\n [dotAttribute.name]: dotAttribute.value\n } : {};\n return _this.__privates.auth.__client.then(client => client.apis.wt.updateRoom({\n id: roomId\n }, {\n requestBody: {\n title,\n description,\n slug,\n password,\n isPublic,\n isRouter,\n isHd,\n isStudioLayout,\n hasStudioChat,\n maxParticipants,\n reduceRoomControls,\n chatRoomId,\n linkedRoomId,\n type,\n disableSync,\n defaultRegion,\n customAttributes,\n wtChannelId,\n ..._da,\n ...(setInstanceType && {\n instanceType: setInstanceType === true ? _this.__instanceType : setInstanceType\n }),\n ...(recordings && {\n recordings\n })\n }\n }));\n },\n deleteRoom: roomId => {\n return this.__privates.auth.__client.then(client => client.apis.wt.deleteRoom({\n id: roomId\n }));\n },\n leaveRoom: roomId => {\n return this.__privates.auth.__client.then(client => client.apis.wt.leave({\n roomId\n }));\n },\n updateLayout: _ref2 => {\n let {\n roomId,\n operation,\n name,\n attributeName,\n value,\n target\n } = _ref2;\n //operation : clearLayouts, setLayout, setLayouts, unsetLayout, setName, setTarget, setStyle, setAttribute, unsetAttribute,'sendMessage'\n\n return this.__privates.auth.__client.then(client => client.apis.wt.updateLayout({}, {\n requestBody: {\n roomId,\n operation,\n name,\n attributeName,\n value,\n target\n }\n }));\n },\n getInviteUrl: (roomId, domain, url) => {\n return this.__privates.auth.__client.then(client => client.apis.wt.invite({}, {\n requestBody: {\n roomId,\n domain: domain || location.host,\n url: url || location.href\n }\n }));\n },\n getRoomChatList: function () {\n let {\n roomId,\n type = \"normal\",\n size = 50,\n startKey = null\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let apiParams = {\n roomId,\n type,\n size,\n ...(startKey && {\n startKey\n })\n };\n return _this.__privates.auth.__client.then(client => client.apis.wt.getRoomChatList(apiParams));\n },\n getRoomsList: function () {\n let {\n type = 'participant',\n activeOnly = null,\n instanceType = _this.__instanceType,\n size = 20,\n startKey = null,\n includeWtEventModels = false,\n demo = false,\n viewType = 'list',\n wtChannelId = undefined\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let apiParams = {\n type,\n instanceType,\n size,\n includeWtEventModels,\n demo,\n viewType,\n ...(wtChannelId && {\n wtChannelId\n }),\n ...(activeOnly && {\n activeOnly\n }),\n ...(startKey && {\n startKey\n })\n };\n return _this.__privates.auth.__client.then(client => client.apis.wt.getRoomList(apiParams));\n },\n setUser: _ref3 => {\n let {\n messageId,\n userId,\n roomId,\n flag,\n timestamp,\n option\n } = _ref3;\n //leave, kick, ban, unban, approve, report\n return this.__privates.auth.__client.then(client => client.apis.wt.setUser({\n messageId,\n userId,\n roomId,\n flag,\n timestamp,\n option\n }));\n },\n getRoomById: function (id) {\n let pinHash = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n let showPublic = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n let demo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n let signal = arguments.length > 4 ? arguments[4] : undefined;\n return _this.__privates.auth.__client.then(client => client.apis.wt.getRoom({\n id,\n pinHash,\n \"public\": showPublic,\n demo\n }, {\n ...(signal ? {\n requestInterceptor: req => {\n req.signal = signal;\n return req;\n }\n } : {})\n }));\n },\n getRoomBySlug: function (slug) {\n let password = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n let showPublic = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n let demo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n return _this.__privates.auth.__client.then(client => client.apis.wt.getRoom({\n slug,\n password,\n \"public\": showPublic,\n demo\n }));\n },\n roomRecorder: function () {\n let {\n roomId,\n operation = 'get',\n config,\n outputs,\n destinationIds,\n screenWidth,\n screenHeight\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.wt.recordRoom({}, {\n requestBody: {\n roomId,\n operation,\n config,\n outputs,\n destinationIds,\n screenWidth,\n screenHeight\n }\n }));\n },\n __joinRoom: function () {\n let {\n roomId,\n pinHash,\n instanceType = _this.__instanceType,\n role = 'participant',\n customBearer = undefined\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let signal = arguments.length > 1 ? arguments[1] : undefined;\n return _this.__privates.auth.__client.then(client => client.apis.wt.join({\n roomId,\n pinHash,\n instanceType,\n role,\n platform: _this.browser === 'firefox' ? 'web-firefox' : 'web'\n }, {\n ...(signal ? {\n requestInterceptor: req => {\n req.signal = signal;\n return req;\n }\n } : {})\n }));\n },\n isSafariSupported: () => {\n return this.__privates.room.safariVp8;\n },\n isWebrtcSupported: () => {\n return this.__privates.room.isWebrtcSupported;\n },\n createStreamingSession: function () {\n let {\n constructId,\n roomId,\n pinHash,\n streamId,\n href,\n iceServers,\n accessToken\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.room.whenInitialized.then(lib => _streaming_session__WEBPACK_IMPORTED_MODULE_1__[\"default\"].call(_this, {\n roomId,\n pinHash,\n streamId,\n href,\n iceServers,\n accessToken\n }, lib.createSession(constructId, 'streaming'), _this)).then(newSession => {\n let existingSessionIndex = roomSessions.findIndex(session => session.constructId === newSession.constructId);\n if (existingSessionIndex > -1) {\n return _this.room.destroySession(newSession.constructId).then(() => {\n roomSessions.push(newSession);\n return newSession;\n });\n } else {\n roomSessions.push(newSession);\n return newSession;\n }\n });\n },\n createSession: _ref4 => {\n let {\n constructId,\n roomId,\n pinHash,\n role,\n options\n } = _ref4;\n return this.__privates.room.whenInitialized.then(lib => _room_session__WEBPACK_IMPORTED_MODULE_0__[\"default\"].call(this, {\n roomId,\n pinHash,\n role,\n options\n }, lib.createSession(constructId, 'reactooroom', options), this)).then(newSession => {\n let existingSessionIndex = roomSessions.findIndex(session => session.constructId === newSession.constructId);\n if (existingSessionIndex > -1) {\n return this.room.destroySession(newSession.constructId).then(() => {\n roomSessions.push(newSession);\n return newSession;\n });\n } else {\n roomSessions.push(newSession);\n return newSession;\n }\n });\n },\n getSessions: () => {\n return roomSessions;\n },\n getSessionByConstructId: constructId => {\n return roomSessions.find(session => session.constructId === constructId) || null;\n },\n getSessionBySessionId: sessionId => {\n return roomSessions.find(session => session.sessionId === sessionId) || null;\n },\n getSessionByRoomId: roomId => {\n return roomSessions.find(session => session.roomId === roomId) || null;\n },\n getSessionByUserId: userId => {\n return roomSessions.find(session => {\n var _decodeJanusDisplay;\n return ((_decodeJanusDisplay = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_2__[\"decodeJanusDisplay\"])(session.userId)) === null || _decodeJanusDisplay === void 0 ? void 0 : _decodeJanusDisplay.userId) === userId;\n }) || null;\n },\n getSessionByStreamId: streamId => {\n return roomSessions.find(session => session.streamId === streamId) || null;\n },\n destroySession: constructId => {\n let sessionIndex = roomSessions.findIndex(session => session.constructId === constructId);\n if (sessionIndex > -1) {\n return roomSessions[sessionIndex].kill().finally(() => {\n roomSessions.splice(sessionIndex, 1);\n return true;\n });\n }\n return Promise.resolve();\n },\n destroySessionBySessionId: sessionId => {\n let sessionIndex = roomSessions.findIndex(session => session.sessionId === sessionId);\n if (sessionIndex > -1) {\n return roomSessions[sessionIndex].kill().finally(() => {\n roomSessions.splice(sessionIndex, 1);\n return true;\n });\n }\n return Promise.resolve();\n },\n destroySessions: () => {\n roomSessions.forEach(session => session.destroy().catch(e => this.log(e)));\n roomSessions.length = 0;\n },\n queue: function () {\n let {\n roomId,\n operation,\n userId\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n //Enum: \"status\" \"join\" \"approve\" \"reject\" \"block\" \"unblock\"\n return _this.__privates.auth.__client.then(client => client.apis.wt.queue({}, {\n requestBody: {\n roomId,\n operation,\n userId\n }\n }));\n },\n getDefaultRegions: () => {\n return this.__privates.auth.__client.then(client => {\n var _client$spec, _client$spec$componen, _client$spec$componen2, _client$spec$componen3, _client$spec$componen4, _client$spec$componen5;\n return [...(((_client$spec = client.spec) === null || _client$spec === void 0 ? void 0 : (_client$spec$componen = _client$spec.components) === null || _client$spec$componen === void 0 ? void 0 : (_client$spec$componen2 = _client$spec$componen.schemas) === null || _client$spec$componen2 === void 0 ? void 0 : (_client$spec$componen3 = _client$spec$componen2.WtRoom) === null || _client$spec$componen3 === void 0 ? void 0 : (_client$spec$componen4 = _client$spec$componen3.properties) === null || _client$spec$componen4 === void 0 ? void 0 : (_client$spec$componen5 = _client$spec$componen4.defaultRegion) === null || _client$spec$componen5 === void 0 ? void 0 : _client$spec$componen5.enum) || [''])];\n });\n }\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (room);\n\n//# sourceURL=webpack://WatchTogetherSDK/./src/models/room.js?");
|
|
8655
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _room_session__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./room-session */ \"./src/models/room-session.js\");\n/* harmony import */ var _streaming_session__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./streaming-session */ \"./src/models/streaming-session.js\");\n/* harmony import */ var _modules_wt_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../modules/wt-utils */ \"./src/modules/wt-utils.js\");\n\n\n\n\n\nlet room = function () {\n var _this = this;\n let roomSessions = [];\n let setExitListeners = () => {\n window.addEventListener('pagehide', event => {\n if (!event.persisted) {\n this.room.destroySessions();\n }\n });\n window.addEventListener('beforeunload', () => {\n this.room.destroySessions();\n });\n };\n setExitListeners();\n return {\n //TODO:deprecated\n integration: function () {\n let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.system.integration({\n type: _this.__instanceType\n }, {\n requestBody: {\n ...data\n },\n requestInterceptor: req => {\n if (!req.headers) {\n req.headers = {};\n }\n req.headers['Authorization'] = 'Bearer ' + localStorage.getItem('rwt_idToken');\n return req;\n }\n }));\n },\n //TODO:deprecated\n getAnalytics: function () {\n let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.system.getAnalytics({\n instanceType: _this.__instanceType,\n ...data\n }));\n },\n sendChatMessage: _ref => {\n let {\n roomId,\n message,\n options,\n senderUserId\n } = _ref;\n return this.__privates.auth.__client.then(client => client.apis.wt.sendRoomMessage({}, {\n requestBody: {\n roomId,\n message,\n options,\n senderUserId\n }\n }));\n },\n createRoom: function () {\n let {\n sourceRoomId,\n title,\n description,\n isPublic,\n isRouter,\n isStudioLayout,\n wtChannelId,\n isHd,\n disableSync,\n reduceRoomControls,\n hasStudioChat,\n maxParticipants,\n customAttributes,\n chatRoomId,\n linkedRoomId,\n type,\n dotAttribute\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let _da = dotAttribute ? Array.isArray(dotAttribute) ? dotAttribute.reduce((p, cv) => (p[cv.name] = cv.value) && p || p, {}) : {\n [dotAttribute.name]: dotAttribute.value\n } : {};\n return _this.__privates.auth.__client.then(client => client.apis.wt.createRoom({\n sourceRoomId\n }, {\n requestBody: {\n title,\n description,\n isRouter,\n isPublic,\n isStudioLayout,\n wtChannelId,\n isHd,\n disableSync,\n reduceRoomControls,\n chatRoomId,\n linkedRoomId,\n hasStudioChat,\n maxParticipants,\n type,\n customAttributes,\n ..._da,\n instanceType: _this.__instanceType\n }\n }));\n },\n updateRoom: function () {\n let {\n roomId,\n title,\n description,\n isPublic,\n isRouter,\n recordings,\n slug,\n password,\n maxParticipants,\n setInstanceType = false,\n wtChannelId,\n isHd,\n isStudioLayout,\n hasStudioChat,\n reduceRoomControls,\n chatRoomId,\n linkedRoomId,\n type,\n disableSync,\n defaultRegion,\n customAttributes,\n dotAttribute\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let _da = dotAttribute ? Array.isArray(dotAttribute) ? dotAttribute.reduce((p, cv) => (p[cv.name] = cv.value) && p || p, {}) : {\n [dotAttribute.name]: dotAttribute.value\n } : {};\n return _this.__privates.auth.__client.then(client => client.apis.wt.updateRoom({\n id: roomId\n }, {\n requestBody: {\n title,\n description,\n slug,\n password,\n isPublic,\n isRouter,\n isHd,\n isStudioLayout,\n hasStudioChat,\n maxParticipants,\n reduceRoomControls,\n chatRoomId,\n linkedRoomId,\n type,\n disableSync,\n defaultRegion,\n customAttributes,\n wtChannelId,\n ..._da,\n ...(setInstanceType && {\n instanceType: setInstanceType === true ? _this.__instanceType : setInstanceType\n }),\n ...(recordings && {\n recordings\n })\n }\n }));\n },\n deleteRoom: roomId => {\n return this.__privates.auth.__client.then(client => client.apis.wt.deleteRoom({\n id: roomId\n }));\n },\n leaveRoom: roomId => {\n return this.__privates.auth.__client.then(client => client.apis.wt.leave({\n roomId\n }));\n },\n updateLayout: _ref2 => {\n let {\n roomId,\n operation,\n name,\n attributeName,\n value,\n target\n } = _ref2;\n //operation : clearLayouts, setLayout, setLayouts, unsetLayout, setName, setTarget, setStyle, setAttribute, unsetAttribute,'sendMessage'\n\n return this.__privates.auth.__client.then(client => client.apis.wt.updateLayout({}, {\n requestBody: {\n roomId,\n operation,\n name,\n attributeName,\n value,\n target\n }\n }));\n },\n getInviteUrl: (roomId, domain, url) => {\n return this.__privates.auth.__client.then(client => client.apis.wt.invite({}, {\n requestBody: {\n roomId,\n domain: domain || location.host,\n url: url || location.href\n }\n }));\n },\n getRoomChatList: function () {\n let {\n roomId,\n type = \"normal\",\n size = 50,\n startKey = null\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let apiParams = {\n roomId,\n type,\n size,\n ...(startKey && {\n startKey\n })\n };\n return _this.__privates.auth.__client.then(client => client.apis.wt.getRoomChatList(apiParams));\n },\n getRoomsList: function () {\n let {\n type = 'participant',\n activeOnly = null,\n instanceType = _this.__instanceType,\n size = 20,\n startKey = null,\n includeWtEventModels = false,\n demo = false,\n viewType = 'list',\n wtChannelId = undefined\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let apiParams = {\n type,\n instanceType,\n size,\n includeWtEventModels,\n demo,\n viewType,\n ...(wtChannelId && {\n wtChannelId\n }),\n ...(activeOnly && {\n activeOnly\n }),\n ...(startKey && {\n startKey\n })\n };\n return _this.__privates.auth.__client.then(client => client.apis.wt.getRoomList(apiParams));\n },\n setUser: _ref3 => {\n let {\n messageId,\n userId,\n roomId,\n flag,\n timestamp,\n option\n } = _ref3;\n //leave, kick, ban, unban, approve, report\n return this.__privates.auth.__client.then(client => client.apis.wt.setUser({\n messageId,\n userId,\n roomId,\n flag,\n timestamp,\n option\n }));\n },\n getRoomById: function (id) {\n let pinHash = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n let showPublic = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n let demo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n let signal = arguments.length > 4 ? arguments[4] : undefined;\n return _this.__privates.auth.__client.then(client => client.apis.wt.getRoom({\n id,\n pinHash,\n \"public\": showPublic,\n demo\n }, {\n ...(signal ? {\n requestInterceptor: req => {\n req.signal = signal;\n return req;\n }\n } : {})\n }));\n },\n getRoomBySlug: function (slug) {\n let password = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n let showPublic = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n let demo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n return _this.__privates.auth.__client.then(client => client.apis.wt.getRoom({\n slug,\n password,\n \"public\": showPublic,\n demo\n }));\n },\n roomRecorder: function () {\n let {\n roomId,\n operation = 'get',\n config,\n outputs,\n destinationIds,\n screenWidth,\n screenHeight,\n payload\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.wt.recordRoom({}, {\n requestBody: {\n roomId,\n operation,\n config,\n outputs,\n destinationIds,\n screenWidth,\n screenHeight,\n payload\n }\n }));\n },\n __joinRoom: function () {\n let {\n roomId,\n pinHash,\n instanceType = _this.__instanceType,\n role = 'participant',\n customBearer = undefined\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let signal = arguments.length > 1 ? arguments[1] : undefined;\n return _this.__privates.auth.__client.then(client => client.apis.wt.join({\n roomId,\n pinHash,\n instanceType,\n role,\n platform: _this.browser === 'firefox' ? 'web-firefox' : 'web'\n }, {\n ...(signal ? {\n requestInterceptor: req => {\n req.signal = signal;\n return req;\n }\n } : {})\n }));\n },\n isSafariSupported: () => {\n return this.__privates.room.safariVp8;\n },\n isWebrtcSupported: () => {\n return this.__privates.room.isWebrtcSupported;\n },\n createStreamingSession: function () {\n let {\n constructId,\n roomId,\n pinHash,\n streamId,\n href,\n iceServers,\n accessToken\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.room.whenInitialized.then(lib => _streaming_session__WEBPACK_IMPORTED_MODULE_1__[\"default\"].call(_this, {\n roomId,\n pinHash,\n streamId,\n href,\n iceServers,\n accessToken\n }, lib.createSession(constructId, 'streaming'), _this)).then(newSession => {\n let existingSessionIndex = roomSessions.findIndex(session => session.constructId === newSession.constructId);\n if (existingSessionIndex > -1) {\n return _this.room.destroySession(newSession.constructId).then(() => {\n roomSessions.push(newSession);\n return newSession;\n });\n } else {\n roomSessions.push(newSession);\n return newSession;\n }\n });\n },\n createSession: _ref4 => {\n let {\n constructId,\n roomId,\n pinHash,\n role,\n options\n } = _ref4;\n return this.__privates.room.whenInitialized.then(lib => _room_session__WEBPACK_IMPORTED_MODULE_0__[\"default\"].call(this, {\n roomId,\n pinHash,\n role,\n options\n }, lib.createSession(constructId, 'reactooroom', options), this)).then(newSession => {\n let existingSessionIndex = roomSessions.findIndex(session => session.constructId === newSession.constructId);\n if (existingSessionIndex > -1) {\n return this.room.destroySession(newSession.constructId).then(() => {\n roomSessions.push(newSession);\n return newSession;\n });\n } else {\n roomSessions.push(newSession);\n return newSession;\n }\n });\n },\n getSessions: () => {\n return roomSessions;\n },\n getSessionByConstructId: constructId => {\n return roomSessions.find(session => session.constructId === constructId) || null;\n },\n getSessionBySessionId: sessionId => {\n return roomSessions.find(session => session.sessionId === sessionId) || null;\n },\n getSessionByRoomId: roomId => {\n return roomSessions.find(session => session.roomId === roomId) || null;\n },\n getSessionByUserId: userId => {\n return roomSessions.find(session => {\n var _decodeJanusDisplay;\n return ((_decodeJanusDisplay = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_2__[\"decodeJanusDisplay\"])(session.userId)) === null || _decodeJanusDisplay === void 0 ? void 0 : _decodeJanusDisplay.userId) === userId;\n }) || null;\n },\n getSessionByStreamId: streamId => {\n return roomSessions.find(session => session.streamId === streamId) || null;\n },\n destroySession: constructId => {\n let sessionIndex = roomSessions.findIndex(session => session.constructId === constructId);\n if (sessionIndex > -1) {\n return roomSessions[sessionIndex].kill().finally(() => {\n roomSessions.splice(sessionIndex, 1);\n return true;\n });\n }\n return Promise.resolve();\n },\n destroySessionBySessionId: sessionId => {\n let sessionIndex = roomSessions.findIndex(session => session.sessionId === sessionId);\n if (sessionIndex > -1) {\n return roomSessions[sessionIndex].kill().finally(() => {\n roomSessions.splice(sessionIndex, 1);\n return true;\n });\n }\n return Promise.resolve();\n },\n destroySessions: () => {\n roomSessions.forEach(session => session.destroy().catch(e => this.log(e)));\n roomSessions.length = 0;\n },\n queue: function () {\n let {\n roomId,\n operation,\n userId\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n //Enum: \"status\" \"join\" \"approve\" \"reject\" \"block\" \"unblock\"\n return _this.__privates.auth.__client.then(client => client.apis.wt.queue({}, {\n requestBody: {\n roomId,\n operation,\n userId\n }\n }));\n },\n getDefaultRegions: () => {\n return this.__privates.auth.__client.then(client => {\n var _client$spec, _client$spec$componen, _client$spec$componen2, _client$spec$componen3, _client$spec$componen4, _client$spec$componen5;\n return [...(((_client$spec = client.spec) === null || _client$spec === void 0 ? void 0 : (_client$spec$componen = _client$spec.components) === null || _client$spec$componen === void 0 ? void 0 : (_client$spec$componen2 = _client$spec$componen.schemas) === null || _client$spec$componen2 === void 0 ? void 0 : (_client$spec$componen3 = _client$spec$componen2.WtRoom) === null || _client$spec$componen3 === void 0 ? void 0 : (_client$spec$componen4 = _client$spec$componen3.properties) === null || _client$spec$componen4 === void 0 ? void 0 : (_client$spec$componen5 = _client$spec$componen4.defaultRegion) === null || _client$spec$componen5 === void 0 ? void 0 : _client$spec$componen5.enum) || [''])];\n });\n }\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (room);\n\n//# sourceURL=webpack://WatchTogetherSDK/./src/models/room.js?");
|
|
8656
8656
|
|
|
8657
8657
|
/***/ }),
|
|
8658
8658
|
|
|
@@ -8688,7 +8688,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var seri
|
|
|
8688
8688
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
8689
8689
|
|
|
8690
8690
|
"use strict";
|
|
8691
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/wt-utils */ \"./src/modules/wt-utils.js\");\n/* harmony import */ var serialize_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! serialize-error */ \"./node_modules/serialize-error/index.js\");\n\n\n\n\nlet user = function () {\n var _this = this;\n return {\n updateUserSelf: function () {\n let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.user.updateMyself({\n ...(data.lastRoomId && {\n lastRoomId: data.lastRoomId\n })\n }, {\n requestBody: {\n ...data\n }\n }));\n },\n updateUser: function () {\n let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.user.updateUser({\n id: data.id,\n lastRoomId: data.lastRoomId\n }, {\n requestBody: {\n displayname: data.displayname,\n bio: data.bio\n }\n }));\n },\n uploadAvatar: (file, lastRoomId) => {\n let id = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"generateUUID\"])();\n return this.__privates.auth.__client.then(client => Promise.all([client, client.apis.user.initiateMyAvatarUpload({\n id\n })])).then(_ref => {\n let [client, response] = _ref;\n return Promise.all([client, client.http({\n url: response.data.signedUrl,\n method: response.data.httpMethod,\n headers: {\n \"Content-Type\": file.type\n },\n body: file\n })]);\n }).then(_ref2 => {\n let [client, response] = _ref2;\n return client.apis.user.publishMyAvatar({\n id,\n lastRoomId\n });\n });\n },\n unsetAvatar: lastRoomId => {\n return this.__privates.auth.__client.then(client => client.apis.user.publishMyAvatar({\n lastRoomId\n }));\n },\n uploadReaction: files => {\n let id = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"generateUUID\"])();\n return this.__privates.auth.__client.then(client => Promise.all([client, client.apis.reaction.initiateReactionUpload({\n id: id,\n segmentCount: files.length || 0\n })])).then(_ref3 => {\n let [client, response] = _ref3;\n return Promise.all([client, ...response.data.signedUrlSegments.map((url, index) => client.http({\n url,\n method: response.data.httpMethod,\n headers: {\n \"Content-Type\": files[index].type\n },\n body: files[index]\n }))]);\n }).then(_ref4 => {\n let [client] = _ref4;\n return client.apis.reaction.processReaction({\n id: id,\n type: 'concat'\n });\n }).then(response => response.data.key);\n },\n uploadVideo: function (roomId, files) {\n let privateAttributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n let id = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"generateUUID\"])();\n return _this.__privates.auth.__client.then(client => Promise.all([client, client.apis.video.initiateVideoUpload({\n id,\n segmentCount: files.length || 0\n })])).then(_ref5 => {\n let [client, response] = _ref5;\n return Promise.all([client, response.data.signedUrlSegments.reduce((acc, url, index) => acc.then(() => client.http({\n url,\n method: response.data.httpMethod,\n headers: {\n \"Content-Type\": files[index].type\n },\n body: files[index]\n })), Promise.resolve())]);\n }).then(_ref6 => {\n let [client] = _ref6;\n return client.apis.video.publishVideo({\n _id: id,\n roomId\n }, {\n requestBody: {\n _id: id,\n roomId,\n privateAttributes\n }\n });\n });\n },\n getReactionById: id => {\n return this.__privates.auth.__client.then(client => client.apis.reaction.getReactionById({\n id\n }));\n },\n getReactions: function () {\n let {\n userId,\n roomId,\n type,\n size,\n startKey,\n includeUserModels = false\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let apiParams = {\n ...(roomId && {\n roomId\n }),\n ...(userId && {\n userId\n }),\n ...(size && {\n size\n }),\n ...(startKey && {\n startKey\n }),\n includeUserModels,\n type\n };\n return _this.__privates.auth.__client.then(client => client.apis.reaction.getReactions(apiParams));\n },\n getVideoById: id => {\n return this.__privates.auth.__client.then(client => client.apis.video.getVideoById({\n id\n }));\n },\n getVideos: function () {\n let {\n roomId,\n userId,\n type,\n size,\n startKey,\n includeUserModels = false,\n includeRoomQueueStatus\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let apiParams = {\n ...(roomId && {\n roomId\n }),\n ...(userId && {\n userId\n }),\n ...(size && {\n size\n }),\n ...(startKey && {\n startKey\n }),\n ...(includeRoomQueueStatus && {\n includeRoomQueueStatus\n }),\n includeUserModels,\n type\n };\n return _this.__privates.auth.__client.then(client => client.apis.video.getVideos(apiParams));\n },\n deleteVideo: id => {\n return this.__privates.auth.__client.then(client => client.apis.video.deleteVideo({\n id\n }));\n },\n getUserSelf: () => {\n return this.__privates.auth.__client.then(client => client.apis.user.getUserMyself());\n },\n getUserById: id => {\n return this.__privates.auth.__client.then(client => client.apis.user.getUserById({\n id\n }));\n },\n getUsersByIds: function () {\n let {\n ids = [],\n size = null,\n startKey = null\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let apiParams = {\n type: 'ids',\n ...(size && {\n size\n }),\n ...(ids && {\n ids: ids.join(',')\n }),\n ...(startKey && {\n startKey\n })\n };\n return _this.__privates.auth.__client.then(client => client.apis.user.getUsers(apiParams));\n },\n getUsers: function () {\n let {\n type,\n userId,\n roomId,\n size = 20,\n startKey = null\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let apiParams = {\n type,\n size,\n ...(roomId && {\n roomId\n }),\n ...(userId && {\n userId\n }),\n ...(startKey && {\n startKey\n })\n };\n return _this.__privates.auth.__client.then(client => client.apis.user.getUsers(apiParams));\n },\n //TODO:deprecated\n track: function () {\n let {\n eventType = 'ERROR',\n message\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.wt.track({}, {\n requestBody: {\n \"eventType\": eventType,\n \"appType\": \"web\",\n \"deviceType\": `desktop${navigator.maxTouchPoints ? '/touch' : ''}`,\n \"os\": navigator.platform,\n \"browser\": navigator.userAgent,\n \"domain\": location.host,\n \"url\": location.href,\n \"message\": Object(serialize_error__WEBPACK_IMPORTED_MODULE_1__[\"serializeError\"])(message)\n }\n }));\n },\n //TODO:deprecated\n getTranslation: function () {\n let {\n namespace = 'wt'\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.system.getTranslation({\n namespace\n }));\n },\n //TODO:deprecated\n getConfig: function () {\n let {\n instanceType = _this.__instanceType,\n domain = location.hostname\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.system.getConfig({\n instanceType,\n domain\n }));\n },\n //TODO:deprecated\n getIntegrationPublic: function (type) {\n let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return _this.__privates.auth.__client.then(client => client.apis.system.integrationPublic({\n type\n }, {\n requestBody: {\n ...data\n }\n }));\n },\n //TODO:deprecated\n updateConfig: function () {\n let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.wt.updateConfig({\n id: data.instanceType || _this.__instanceType\n }, {\n requestBody: {\n ...data\n }\n }));\n },\n //TODO:deprecated\n admin: function () {\n let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.wt.admin({}, {\n requestBody: {\n instanceType: _this.__instanceType,\n ...data\n }\n }));\n },\n //TODO:deprecated\n analytics: function () {\n let {\n action,\n startKey = null,\n limit = 20\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let apiParams = {\n action,\n limit,\n ...(startKey && {\n startKey\n })\n };\n return _this.__privates.auth.__client.then(client => client.apis.wt.analytics({}, {\n requestBody: {\n instanceType: _this.__instanceType,\n ...apiParams\n }\n }));\n }\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (user);\n\n//# sourceURL=webpack://WatchTogetherSDK/./src/models/user.js?");
|
|
8691
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/wt-utils */ \"./src/modules/wt-utils.js\");\n/* harmony import */ var serialize_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! serialize-error */ \"./node_modules/serialize-error/index.js\");\n\n\n\n\nlet user = function () {\n var _this = this;\n return {\n updateUserSelf: function () {\n let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.user.updateMyself({\n ...(data.lastRoomId && {\n lastRoomId: data.lastRoomId\n })\n }, {\n requestBody: {\n ...data\n }\n }));\n },\n updateUser: function () {\n let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.user.updateUser({\n id: data.id,\n lastRoomId: data.lastRoomId\n }, {\n requestBody: {\n displayname: data.displayname,\n bio: data.bio\n }\n }));\n },\n uploadAvatar: (file, lastRoomId) => {\n let id = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"generateUUID\"])();\n return this.__privates.auth.__client.then(client => Promise.all([client, client.apis.user.initiateMyAvatarUpload({\n id\n })])).then(_ref => {\n let [client, response] = _ref;\n return Promise.all([client, client.http({\n url: response.data.signedUrl,\n method: response.data.httpMethod,\n headers: {\n \"Content-Type\": file.type\n },\n body: file\n })]);\n }).then(_ref2 => {\n let [client, response] = _ref2;\n return client.apis.user.publishMyAvatar({\n id,\n lastRoomId\n });\n });\n },\n unsetAvatar: lastRoomId => {\n return this.__privates.auth.__client.then(client => client.apis.user.publishMyAvatar({\n lastRoomId\n }));\n },\n uploadReaction: files => {\n let id = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"generateUUID\"])();\n return this.__privates.auth.__client.then(client => Promise.all([client, client.apis.reaction.initiateReactionUpload({\n id: id,\n segmentCount: files.length || 0\n })])).then(_ref3 => {\n let [client, response] = _ref3;\n return Promise.all([client, ...response.data.signedUrlSegments.map((url, index) => client.http({\n url,\n method: response.data.httpMethod,\n headers: {\n \"Content-Type\": files[index].type\n },\n body: files[index]\n }))]);\n }).then(_ref4 => {\n let [client] = _ref4;\n return client.apis.reaction.processReaction({\n id: id,\n type: 'concat'\n });\n }).then(response => response.data.key);\n },\n uploadVideo: function (roomId, files) {\n let privateAttributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n let id = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"generateUUID\"])();\n return _this.__privates.auth.__client.then(client => Promise.all([client, client.apis.video.initiateVideoUpload({\n id,\n segmentCount: files.length || 0\n })])).then(_ref5 => {\n let [client, response] = _ref5;\n return Promise.all([client, response.data.signedUrlSegments.reduce((acc, url, index) => acc.then(() => client.http({\n url,\n method: response.data.httpMethod,\n headers: {\n \"Content-Type\": files[index].type\n },\n body: files[index]\n })), Promise.resolve())]);\n }).then(_ref6 => {\n let [client] = _ref6;\n return client.apis.video.publishVideo({\n _id: id,\n roomId\n }, {\n requestBody: {\n _id: id,\n roomId,\n privateAttributes\n }\n });\n });\n },\n getReactionById: id => {\n return this.__privates.auth.__client.then(client => client.apis.reaction.getReactionById({\n id\n }));\n },\n getReactions: function () {\n let {\n userId,\n roomId,\n type,\n size,\n startKey,\n includeUserModels = false\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let apiParams = {\n ...(roomId && {\n roomId\n }),\n ...(userId && {\n userId\n }),\n ...(size && {\n size\n }),\n ...(startKey && {\n startKey\n }),\n includeUserModels,\n type\n };\n return _this.__privates.auth.__client.then(client => client.apis.reaction.getReactions(apiParams));\n },\n getVideoById: id => {\n return this.__privates.auth.__client.then(client => client.apis.video.getVideoById({\n id\n }));\n },\n getVideos: function () {\n let {\n roomId,\n userId,\n type,\n size,\n startKey,\n includeUserModels = false,\n includeRoomQueueStatus\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let apiParams = {\n ...(roomId && {\n roomId\n }),\n ...(userId && {\n userId\n }),\n ...(size && {\n size\n }),\n ...(startKey && {\n startKey\n }),\n ...(includeRoomQueueStatus && {\n includeRoomQueueStatus\n }),\n includeUserModels,\n type\n };\n return _this.__privates.auth.__client.then(client => client.apis.video.getVideos(apiParams));\n },\n deleteVideo: id => {\n return this.__privates.auth.__client.then(client => client.apis.video.deleteVideo({\n id\n }));\n },\n getUserSelf: () => {\n return this.__privates.auth.__client.then(client => client.apis.user.getUserMyself());\n },\n getUserById: id => {\n return this.__privates.auth.__client.then(client => client.apis.user.getUserById({\n id\n }));\n },\n getUsersByIds: function () {\n let {\n ids = [],\n size = null,\n startKey = null\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"chunkArray\"])(ids, 50).reduce((promiseChain, idsChunk) => {\n return promiseChain.then(chainResponse => {\n let apiParams = {\n type: 'ids',\n ...(size && {\n size\n }),\n ...((idsChunk === null || idsChunk === void 0 ? void 0 : idsChunk.length) && {\n ids: idsChunk.join(',')\n }),\n ...(startKey && {\n startKey\n })\n };\n return _this.__privates.auth.__client.then(client => client.apis.user.getUsers(apiParams)).then(response => ({\n data: {\n items: [...chainResponse.data.items, ...response.data.items],\n size: chainResponse.data.size + response.data.size,\n startKey: null\n }\n }));\n });\n }, Promise.resolve({\n data: {\n items: [],\n size: 0,\n startKey: null\n }\n }));\n },\n getUsers: function () {\n let {\n type,\n userId,\n roomId,\n size = 20,\n startKey = null\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let apiParams = {\n type,\n size,\n ...(roomId && {\n roomId\n }),\n ...(userId && {\n userId\n }),\n ...(startKey && {\n startKey\n })\n };\n return _this.__privates.auth.__client.then(client => client.apis.user.getUsers(apiParams));\n },\n //TODO:deprecated\n track: function () {\n let {\n eventType = 'ERROR',\n message\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.wt.track({}, {\n requestBody: {\n \"eventType\": eventType,\n \"appType\": \"web\",\n \"deviceType\": `desktop${navigator.maxTouchPoints ? '/touch' : ''}`,\n \"os\": navigator.platform,\n \"browser\": navigator.userAgent,\n \"domain\": location.host,\n \"url\": location.href,\n \"message\": Object(serialize_error__WEBPACK_IMPORTED_MODULE_1__[\"serializeError\"])(message)\n }\n }));\n },\n //TODO:deprecated\n getTranslation: function () {\n let {\n namespace = 'wt'\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.system.getTranslation({\n namespace\n }));\n },\n //TODO:deprecated\n getConfig: function () {\n let {\n instanceType = _this.__instanceType,\n domain = location.hostname\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.system.getConfig({\n instanceType,\n domain\n }));\n },\n //TODO:deprecated\n getIntegrationPublic: function (type) {\n let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return _this.__privates.auth.__client.then(client => client.apis.system.integrationPublic({\n type\n }, {\n requestBody: {\n ...data\n }\n }));\n },\n //TODO:deprecated\n updateConfig: function () {\n let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.wt.updateConfig({\n id: data.instanceType || _this.__instanceType\n }, {\n requestBody: {\n ...data\n }\n }));\n },\n //TODO:deprecated\n admin: function () {\n let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.wt.admin({}, {\n requestBody: {\n instanceType: _this.__instanceType,\n ...data\n }\n }));\n },\n //TODO:deprecated\n analytics: function () {\n let {\n action,\n startKey = null,\n limit = 20\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let apiParams = {\n action,\n limit,\n ...(startKey && {\n startKey\n })\n };\n return _this.__privates.auth.__client.then(client => client.apis.wt.analytics({}, {\n requestBody: {\n instanceType: _this.__instanceType,\n ...apiParams\n }\n }));\n }\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (user);\n\n//# sourceURL=webpack://WatchTogetherSDK/./src/models/user.js?");
|
|
8692
8692
|
|
|
8693
8693
|
/***/ }),
|
|
8694
8694
|
|
|
@@ -8700,7 +8700,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mod
|
|
|
8700
8700
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
8701
8701
|
|
|
8702
8702
|
"use strict";
|
|
8703
|
-
eval("__webpack_require__.r(__webpack_exports__);\n\n\
|
|
8703
|
+
eval("__webpack_require__.r(__webpack_exports__);\n\n\nconst getUserMediaConstraints = _ref => {\n let {\n hasVideo,\n hasAudio = true,\n aDeviceId,\n vDeviceId,\n autoGainControl = false,\n echoCancellation = true,\n noiseSuppression = true,\n channelCount = 1,\n width = 1280,\n height = 720\n } = _ref;\n // optional: Array (6)\n // • 0: {googEchoCancellation: true}\n // • 1: {googEchoCancellation2: true}\n // • 2: {googAutoGainControl: true}\n // • 3: {googNoiseSuppression: true}\n // » 4: {googHighpassFilter: true}\n // • 5: {googAudioMirroring: true}\n // googTypingNoiseDetection\n\n let audioOnlyConstraints = {\n audio: {\n ...(aDeviceId && {\n deviceId: {\n exact: aDeviceId\n }\n }),\n autoGainControl,\n echoCancellation,\n noiseSuppression,\n channelCount\n }\n };\n let videoOnlyConstraints = {\n video: {\n ...(vDeviceId && {\n deviceId: {\n exact: vDeviceId\n }\n }),\n facingMode: {\n ideal: \"user\"\n },\n frameRate: {\n ideal: 30,\n max: 30\n },\n width: {\n ideal: width\n },\n height: {\n ideal: height\n }\n }\n };\n return {\n ...(hasAudio ? audioOnlyConstraints : {\n audio: false\n }),\n ...(hasVideo ? videoOnlyConstraints : {\n video: false\n })\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n //TODO: add more constraints\n applyConstraints(_ref2) {\n let {\n autoGainControl = false,\n echoCancellation = true,\n noiseSuppression = true,\n channelCount = 1,\n stream = null,\n width,\n height\n } = _ref2;\n if (stream) {\n let fullConstraints = getUserMediaConstraints({\n hasVideo: true,\n hasAudio: true,\n autoGainControl,\n echoCancellation,\n noiseSuppression,\n channelCount,\n width,\n height\n });\n let returnPromises = [];\n const videoTrack = stream.getVideoTracks()[0];\n if (videoTrack) {\n returnPromises.push(videoTrack.applyConstraints(fullConstraints.video));\n }\n const audioTrack = stream.getAudioTracks()[0];\n if (audioTrack) {\n returnPromises.push(audioTrack.applyConstraints(fullConstraints.audio));\n }\n return Promise.all(returnPromises).then(() => {\n return stream;\n });\n } else return Promise.resolve(null);\n },\n getUserStream() {\n let {\n hasVideo,\n hasAudio = true,\n aDeviceId,\n vDeviceId,\n autoGainControl = false,\n echoCancellation = true,\n noiseSuppression = true,\n channelCount = 1,\n muteAudio = false,\n muteVideo = false,\n width = 1280,\n height = 720\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let fullConstraints = getUserMediaConstraints({\n hasVideo,\n hasAudio,\n aDeviceId,\n vDeviceId,\n autoGainControl,\n echoCancellation,\n noiseSuppression,\n channelCount,\n width,\n height\n });\n return navigator.mediaDevices.getUserMedia(fullConstraints).then(stream => {\n stream.getAudioTracks().forEach(track => track.enabled = !muteAudio);\n stream.getVideoTracks().forEach(track => track.enabled = !muteVideo);\n return stream;\n });\n },\n getHostStream() {\n let {\n hasAudio,\n hasVideo,\n aDeviceId,\n vDeviceId,\n autoGainControl = false,\n echoCancellation = false,\n noiseSuppression = false,\n channelCount = 1,\n width = 1920,\n height = 1080\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let audioOnlyConstraints = {\n audio: {\n ...(aDeviceId && {\n deviceId: {\n exact: aDeviceId\n }\n }),\n autoGainControl,\n echoCancellation,\n noiseSuppression,\n channelCount\n }\n };\n let videoOnlyConstraints = {\n video: {\n ...(vDeviceId && {\n deviceId: {\n exact: vDeviceId\n }\n }),\n frameRate: {\n ideal: 30,\n max: 30\n },\n width,\n height\n }\n };\n let fullConstraints = {\n ...(hasAudio ? audioOnlyConstraints : {\n audio: false\n }),\n ...(hasVideo ? videoOnlyConstraints : {\n video: false\n })\n };\n return navigator.mediaDevices.getUserMedia(fullConstraints);\n },\n getDisplayMedia() {\n const constraints = {\n video: {\n cursor: \"always\",\n displaySurface: \"monitor\",\n logicalSurface: false\n },\n surfaceSwitching: \"include\",\n selfBrowserSurface: \"exclude\",\n systemAudio: \"exclude\"\n };\n return navigator.mediaDevices.getDisplayMedia(constraints);\n }\n});\n\n//# sourceURL=webpack://WatchTogetherSDK/./src/models/utils.js?");
|
|
8704
8704
|
|
|
8705
8705
|
/***/ }),
|
|
8706
8706
|
|
|
@@ -8936,11 +8936,11 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var webr
|
|
|
8936
8936
|
/*!*********************************!*\
|
|
8937
8937
|
!*** ./src/modules/wt-utils.js ***!
|
|
8938
8938
|
\*********************************/
|
|
8939
|
-
/*! exports provided: wait, getBrowserFingerprint, generateUUID, decodeJanusDisplay, setExactTimeout, clearExactTimeout, median, maxJitter */
|
|
8939
|
+
/*! exports provided: wait, getBrowserFingerprint, generateUUID, decodeJanusDisplay, setExactTimeout, clearExactTimeout, median, maxJitter, chunkArray */
|
|
8940
8940
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
8941
8941
|
|
|
8942
8942
|
"use strict";
|
|
8943
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"wait\", function() { return wait; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBrowserFingerprint\", function() { return getBrowserFingerprint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"generateUUID\", function() { return generateUUID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decodeJanusDisplay\", function() { return decodeJanusDisplay; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setExactTimeout\", function() { return setExactTimeout; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clearExactTimeout\", function() { return clearExactTimeout; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"median\", function() { return median; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"maxJitter\", function() { return maxJitter; });\n/* harmony import */ var _wt_fingerprint__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wt-fingerprint */ \"./src/modules/wt-fingerprint.js\");\n// import FingerprintJs from \"@fingerprintjs/fingerprintjs\";\n// import FingerprintJsPro from \"@fingerprintjs/fingerprintjs-pro\";\n\nlet wait = function (ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n};\nlet median = function (values) {\n if (values.length === 0) return 0;\n values.sort(function (a, b) {\n return a - b;\n });\n var half = Math.floor(values.length / 2);\n if (values.length % 2) return values[half];\n return (values[half - 1] + values[half]) / 2.0;\n};\n\n// const getFingerPrint = function(instanceType, salt) {\n//\n// let fingerprint = FingerprintJs.load({\n// monitoring: false\n// })\n//\n// return fingerprint\n// .then(fp => fp.get())\n// .then(result => {\n// const components = {\n// ...result.components,\n// instanceType: { value: instanceType + '_' + salt },\n// }\n// return [8,13,18,23].reduce((acc, cur) => {\n// return acc.slice(0,cur) + '-' + acc.slice(cur)\n// }, FingerprintJs.hashComponents(components)).substring(0,36)\n// })\n// }\n//\n// const getPreciseFingerPrint = function() {\n//\n// let fingerprintPro = FingerprintJsPro.load({\n// monitoring: false,\n// apiKey: '5UHdpSuX3wHr3CjyEiSP',\n// endpoint: \"https://fingerprint.reactoo.com\"\n// })\n//\n// return fingerprintPro\n// .then(fp => fp.get())\n// .then(result => {\n// let id = result.visitorId.padEnd(32, '0');\n// return [8,13,18,23].reduce((acc, cur) => {\n// return acc.slice(0,cur) + '-' + acc.slice(cur)\n// }, id).substring(0,36)\n// })\n// }\n\nlet getBrowserFingerprint = function () {\n let instanceType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n let usePrecise = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n let salt = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n // if(!usePrecise) {\n // return getFingerPrint(instanceType, salt)\n // }\n // else {\n // return getPreciseFingerPrint()\n // .catch(() => getFingerPrint(instanceType, salt))\n // }\n\n return Object(_wt_fingerprint__WEBPACK_IMPORTED_MODULE_0__[\"getFingerPrint\"])(instanceType, salt);\n};\nlet generateUUID = function () {\n var d = Date.now();\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c == 'x' ? r : r & 0x3 | 0x8).toString(16);\n });\n};\nconst janusDisplayDelimiter = ',';\nconst decodeJanusDisplay = display => {\n let output = {\n userId: null,\n role: \"participant\",\n start: Date.now(),\n displayName: \"?\"\n };\n if (display && typeof display === \"string\") {\n if (display.indexOf(janusDisplayDelimiter) >= 0) {\n let values = display.split(new RegExp(`\\\\${janusDisplayDelimiter}(?=(?:(?:[^\"]*\"){2})*[^\"]*$)`, 'mi')).map(v => v && v.startsWith('\"') || v.endsWith('\"') ? v.substring(1, v.length - 1) : /^\\d+$/.test(v) ? parseInt(v) : v);\n Object.keys(output).forEach((key, i) => values[i] ? output[key] = values[i] : null);\n } else {\n output.userId = display;\n }\n return output;\n } else if (display && typeof display === \"object\") {\n return Object.assign({}, output, display);\n }\n return null;\n};\nconst setExactTimeout = function (callback, duration, resolution) {\n const start = new Date().getTime();\n const timeout = setInterval(function () {\n if (new Date().getTime() - start > duration) {\n callback();\n clearInterval(timeout);\n }\n }, resolution);\n return timeout;\n};\nconst clearExactTimeout = function (timeout) {\n clearInterval(timeout);\n};\nconst maxJitter = x => {\n // A function that returns a value between 0.3 and 0.5 depending on the input x\n // The function is based on a logistic curve with parameters a, b, c, and d\n // The parameters are chosen such that f(30) = 0.3 and f(2) = 0.5\n let a = 0.2; // The maximum value of the function\n let b = -0.1; // The growth rate of the function\n let c = 16; // The inflection point of the function\n let d = 0.3; // The minimum value of the function\n return a / (1 + Math.exp(-b * (x - c))) + d; // Fixed the typo here\n};\n\n\n\n//# sourceURL=webpack://WatchTogetherSDK/./src/modules/wt-utils.js?");
|
|
8943
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"wait\", function() { return wait; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBrowserFingerprint\", function() { return getBrowserFingerprint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"generateUUID\", function() { return generateUUID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decodeJanusDisplay\", function() { return decodeJanusDisplay; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setExactTimeout\", function() { return setExactTimeout; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clearExactTimeout\", function() { return clearExactTimeout; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"median\", function() { return median; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"maxJitter\", function() { return maxJitter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"chunkArray\", function() { return chunkArray; });\n/* harmony import */ var _wt_fingerprint__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wt-fingerprint */ \"./src/modules/wt-fingerprint.js\");\n// import FingerprintJs from \"@fingerprintjs/fingerprintjs\";\n// import FingerprintJsPro from \"@fingerprintjs/fingerprintjs-pro\";\n\nlet wait = function (ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n};\nlet median = function (values) {\n if (values.length === 0) return 0;\n values.sort(function (a, b) {\n return a - b;\n });\n var half = Math.floor(values.length / 2);\n if (values.length % 2) return values[half];\n return (values[half - 1] + values[half]) / 2.0;\n};\n\n// const getFingerPrint = function(instanceType, salt) {\n//\n// let fingerprint = FingerprintJs.load({\n// monitoring: false\n// })\n//\n// return fingerprint\n// .then(fp => fp.get())\n// .then(result => {\n// const components = {\n// ...result.components,\n// instanceType: { value: instanceType + '_' + salt },\n// }\n// return [8,13,18,23].reduce((acc, cur) => {\n// return acc.slice(0,cur) + '-' + acc.slice(cur)\n// }, FingerprintJs.hashComponents(components)).substring(0,36)\n// })\n// }\n//\n// const getPreciseFingerPrint = function() {\n//\n// let fingerprintPro = FingerprintJsPro.load({\n// monitoring: false,\n// apiKey: '5UHdpSuX3wHr3CjyEiSP',\n// endpoint: \"https://fingerprint.reactoo.com\"\n// })\n//\n// return fingerprintPro\n// .then(fp => fp.get())\n// .then(result => {\n// let id = result.visitorId.padEnd(32, '0');\n// return [8,13,18,23].reduce((acc, cur) => {\n// return acc.slice(0,cur) + '-' + acc.slice(cur)\n// }, id).substring(0,36)\n// })\n// }\n\nlet getBrowserFingerprint = function () {\n let instanceType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n let usePrecise = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n let salt = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n // if(!usePrecise) {\n // return getFingerPrint(instanceType, salt)\n // }\n // else {\n // return getPreciseFingerPrint()\n // .catch(() => getFingerPrint(instanceType, salt))\n // }\n\n return Object(_wt_fingerprint__WEBPACK_IMPORTED_MODULE_0__[\"getFingerPrint\"])(instanceType, salt);\n};\nlet generateUUID = function () {\n var d = Date.now();\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c == 'x' ? r : r & 0x3 | 0x8).toString(16);\n });\n};\nconst janusDisplayDelimiter = ',';\nconst decodeJanusDisplay = display => {\n let output = {\n userId: null,\n role: \"participant\",\n start: Date.now(),\n displayName: \"?\"\n };\n if (display && typeof display === \"string\") {\n if (display.indexOf(janusDisplayDelimiter) >= 0) {\n let values = display.split(new RegExp(`\\\\${janusDisplayDelimiter}(?=(?:(?:[^\"]*\"){2})*[^\"]*$)`, 'mi')).map(v => v && v.startsWith('\"') || v.endsWith('\"') ? v.substring(1, v.length - 1) : /^\\d+$/.test(v) ? parseInt(v) : v);\n Object.keys(output).forEach((key, i) => values[i] ? output[key] = values[i] : null);\n } else {\n output.userId = display;\n }\n return output;\n } else if (display && typeof display === \"object\") {\n return Object.assign({}, output, display);\n }\n return null;\n};\nconst setExactTimeout = function (callback, duration, resolution) {\n const start = new Date().getTime();\n const timeout = setInterval(function () {\n if (new Date().getTime() - start > duration) {\n callback();\n clearInterval(timeout);\n }\n }, resolution);\n return timeout;\n};\nconst clearExactTimeout = function (timeout) {\n clearInterval(timeout);\n};\nconst maxJitter = x => {\n // A function that returns a value between 0.3 and 0.5 depending on the input x\n // The function is based on a logistic curve with parameters a, b, c, and d\n // The parameters are chosen such that f(30) = 0.3 and f(2) = 0.5\n let a = 0.2; // The maximum value of the function\n let b = -0.1; // The growth rate of the function\n let c = 16; // The inflection point of the function\n let d = 0.3; // The minimum value of the function\n return a / (1 + Math.exp(-b * (x - c))) + d; // Fixed the typo here\n};\n\nconst chunkArray = (array, chunkSize) => {\n if (!(array !== null && array !== void 0 && array.length)) return [[]];\n let results = [];\n while (array.length) {\n results.push(array.splice(0, chunkSize));\n }\n return results;\n};\n\n\n//# sourceURL=webpack://WatchTogetherSDK/./src/modules/wt-utils.js?");
|
|
8944
8944
|
|
|
8945
8945
|
/***/ }),
|
|
8946
8946
|
|