@connectycube/chat-widget 0.38.2 → 0.38.3
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/index.es.js +278 -10
- package/dist/index.umd.js +39257 -0
- package/package.json +2 -1
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import React, { useRef, useEffect, useState, useMemo, useCallback, forwardRef, useImperativeHandle, memo } from "react";
|
|
1
2
|
import i18n from "i18next";
|
|
2
3
|
import { initReactI18next, useTranslation } from "react-i18next";
|
|
3
|
-
import React, { useRef, useEffect, useState, useMemo, useCallback, forwardRef, useImperativeHandle, memo } from "react";
|
|
4
4
|
import { create } from "zustand";
|
|
5
5
|
import { ConnectyCube, DevicePlatform, NotificationChannel, initConnectyCube, useConnectyCube, CallDataType, DialogType, ActiveMedia, CallType, MessageStatus, ChatStatus, ChatType } from "@connectycube/react";
|
|
6
6
|
import getBrowserFingerprint from "get-browser-fingerprint";
|
|
@@ -65,12 +65,280 @@ function requireReactJsxRuntime_production() {
|
|
|
65
65
|
reactJsxRuntime_production.jsxs = jsxProd;
|
|
66
66
|
return reactJsxRuntime_production;
|
|
67
67
|
}
|
|
68
|
+
var reactJsxRuntime_development = {};
|
|
69
|
+
/**
|
|
70
|
+
* @license React
|
|
71
|
+
* react-jsx-runtime.development.js
|
|
72
|
+
*
|
|
73
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
74
|
+
*
|
|
75
|
+
* This source code is licensed under the MIT license found in the
|
|
76
|
+
* LICENSE file in the root directory of this source tree.
|
|
77
|
+
*/
|
|
78
|
+
var hasRequiredReactJsxRuntime_development;
|
|
79
|
+
function requireReactJsxRuntime_development() {
|
|
80
|
+
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
81
|
+
hasRequiredReactJsxRuntime_development = 1;
|
|
82
|
+
"production" !== process.env.NODE_ENV && (function() {
|
|
83
|
+
function getComponentNameFromType(type) {
|
|
84
|
+
if (null == type) return null;
|
|
85
|
+
if ("function" === typeof type)
|
|
86
|
+
return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
|
87
|
+
if ("string" === typeof type) return type;
|
|
88
|
+
switch (type) {
|
|
89
|
+
case REACT_FRAGMENT_TYPE:
|
|
90
|
+
return "Fragment";
|
|
91
|
+
case REACT_PROFILER_TYPE:
|
|
92
|
+
return "Profiler";
|
|
93
|
+
case REACT_STRICT_MODE_TYPE:
|
|
94
|
+
return "StrictMode";
|
|
95
|
+
case REACT_SUSPENSE_TYPE:
|
|
96
|
+
return "Suspense";
|
|
97
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
98
|
+
return "SuspenseList";
|
|
99
|
+
case REACT_ACTIVITY_TYPE:
|
|
100
|
+
return "Activity";
|
|
101
|
+
}
|
|
102
|
+
if ("object" === typeof type)
|
|
103
|
+
switch ("number" === typeof type.tag && console.error(
|
|
104
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
105
|
+
), type.$$typeof) {
|
|
106
|
+
case REACT_PORTAL_TYPE:
|
|
107
|
+
return "Portal";
|
|
108
|
+
case REACT_CONTEXT_TYPE:
|
|
109
|
+
return type.displayName || "Context";
|
|
110
|
+
case REACT_CONSUMER_TYPE:
|
|
111
|
+
return (type._context.displayName || "Context") + ".Consumer";
|
|
112
|
+
case REACT_FORWARD_REF_TYPE:
|
|
113
|
+
var innerType = type.render;
|
|
114
|
+
type = type.displayName;
|
|
115
|
+
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
|
116
|
+
return type;
|
|
117
|
+
case REACT_MEMO_TYPE:
|
|
118
|
+
return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
|
119
|
+
case REACT_LAZY_TYPE:
|
|
120
|
+
innerType = type._payload;
|
|
121
|
+
type = type._init;
|
|
122
|
+
try {
|
|
123
|
+
return getComponentNameFromType(type(innerType));
|
|
124
|
+
} catch (x) {
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
function testStringCoercion(value) {
|
|
130
|
+
return "" + value;
|
|
131
|
+
}
|
|
132
|
+
function checkKeyStringCoercion(value) {
|
|
133
|
+
try {
|
|
134
|
+
testStringCoercion(value);
|
|
135
|
+
var JSCompiler_inline_result = false;
|
|
136
|
+
} catch (e) {
|
|
137
|
+
JSCompiler_inline_result = true;
|
|
138
|
+
}
|
|
139
|
+
if (JSCompiler_inline_result) {
|
|
140
|
+
JSCompiler_inline_result = console;
|
|
141
|
+
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
142
|
+
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
143
|
+
JSCompiler_temp_const.call(
|
|
144
|
+
JSCompiler_inline_result,
|
|
145
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
146
|
+
JSCompiler_inline_result$jscomp$0
|
|
147
|
+
);
|
|
148
|
+
return testStringCoercion(value);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function getTaskName(type) {
|
|
152
|
+
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
153
|
+
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
|
|
154
|
+
return "<...>";
|
|
155
|
+
try {
|
|
156
|
+
var name = getComponentNameFromType(type);
|
|
157
|
+
return name ? "<" + name + ">" : "<...>";
|
|
158
|
+
} catch (x) {
|
|
159
|
+
return "<...>";
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function getOwner() {
|
|
163
|
+
var dispatcher = ReactSharedInternals.A;
|
|
164
|
+
return null === dispatcher ? null : dispatcher.getOwner();
|
|
165
|
+
}
|
|
166
|
+
function UnknownOwner() {
|
|
167
|
+
return Error("react-stack-top-frame");
|
|
168
|
+
}
|
|
169
|
+
function hasValidKey(config) {
|
|
170
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
171
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
172
|
+
if (getter && getter.isReactWarning) return false;
|
|
173
|
+
}
|
|
174
|
+
return void 0 !== config.key;
|
|
175
|
+
}
|
|
176
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
177
|
+
function warnAboutAccessingKey() {
|
|
178
|
+
specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
|
|
179
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
180
|
+
displayName
|
|
181
|
+
));
|
|
182
|
+
}
|
|
183
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
184
|
+
Object.defineProperty(props, "key", {
|
|
185
|
+
get: warnAboutAccessingKey,
|
|
186
|
+
configurable: true
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function elementRefGetterWithDeprecationWarning() {
|
|
190
|
+
var componentName = getComponentNameFromType(this.type);
|
|
191
|
+
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
|
|
192
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
193
|
+
));
|
|
194
|
+
componentName = this.props.ref;
|
|
195
|
+
return void 0 !== componentName ? componentName : null;
|
|
196
|
+
}
|
|
197
|
+
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
|
198
|
+
var refProp = props.ref;
|
|
199
|
+
type = {
|
|
200
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
201
|
+
type,
|
|
202
|
+
key,
|
|
203
|
+
props,
|
|
204
|
+
_owner: owner
|
|
205
|
+
};
|
|
206
|
+
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
|
|
207
|
+
enumerable: false,
|
|
208
|
+
get: elementRefGetterWithDeprecationWarning
|
|
209
|
+
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
210
|
+
type._store = {};
|
|
211
|
+
Object.defineProperty(type._store, "validated", {
|
|
212
|
+
configurable: false,
|
|
213
|
+
enumerable: false,
|
|
214
|
+
writable: true,
|
|
215
|
+
value: 0
|
|
216
|
+
});
|
|
217
|
+
Object.defineProperty(type, "_debugInfo", {
|
|
218
|
+
configurable: false,
|
|
219
|
+
enumerable: false,
|
|
220
|
+
writable: true,
|
|
221
|
+
value: null
|
|
222
|
+
});
|
|
223
|
+
Object.defineProperty(type, "_debugStack", {
|
|
224
|
+
configurable: false,
|
|
225
|
+
enumerable: false,
|
|
226
|
+
writable: true,
|
|
227
|
+
value: debugStack
|
|
228
|
+
});
|
|
229
|
+
Object.defineProperty(type, "_debugTask", {
|
|
230
|
+
configurable: false,
|
|
231
|
+
enumerable: false,
|
|
232
|
+
writable: true,
|
|
233
|
+
value: debugTask
|
|
234
|
+
});
|
|
235
|
+
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
236
|
+
return type;
|
|
237
|
+
}
|
|
238
|
+
function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
|
|
239
|
+
var children = config.children;
|
|
240
|
+
if (void 0 !== children)
|
|
241
|
+
if (isStaticChildren)
|
|
242
|
+
if (isArrayImpl(children)) {
|
|
243
|
+
for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++)
|
|
244
|
+
validateChildKeys(children[isStaticChildren]);
|
|
245
|
+
Object.freeze && Object.freeze(children);
|
|
246
|
+
} else
|
|
247
|
+
console.error(
|
|
248
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
249
|
+
);
|
|
250
|
+
else validateChildKeys(children);
|
|
251
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
252
|
+
children = getComponentNameFromType(type);
|
|
253
|
+
var keys = Object.keys(config).filter(function(k) {
|
|
254
|
+
return "key" !== k;
|
|
255
|
+
});
|
|
256
|
+
isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
257
|
+
didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
258
|
+
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
|
259
|
+
isStaticChildren,
|
|
260
|
+
children,
|
|
261
|
+
keys,
|
|
262
|
+
children
|
|
263
|
+
), didWarnAboutKeySpread[children + isStaticChildren] = true);
|
|
264
|
+
}
|
|
265
|
+
children = null;
|
|
266
|
+
void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
|
|
267
|
+
hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
|
|
268
|
+
if ("key" in config) {
|
|
269
|
+
maybeKey = {};
|
|
270
|
+
for (var propName in config)
|
|
271
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
272
|
+
} else maybeKey = config;
|
|
273
|
+
children && defineKeyPropWarningGetter(
|
|
274
|
+
maybeKey,
|
|
275
|
+
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
|
276
|
+
);
|
|
277
|
+
return ReactElement(
|
|
278
|
+
type,
|
|
279
|
+
children,
|
|
280
|
+
maybeKey,
|
|
281
|
+
getOwner(),
|
|
282
|
+
debugStack,
|
|
283
|
+
debugTask
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
function validateChildKeys(node) {
|
|
287
|
+
isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
|
|
288
|
+
}
|
|
289
|
+
function isValidElement(object) {
|
|
290
|
+
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
291
|
+
}
|
|
292
|
+
var React$1 = React, REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React$1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
|
|
293
|
+
return null;
|
|
294
|
+
};
|
|
295
|
+
React$1 = {
|
|
296
|
+
react_stack_bottom_frame: function(callStackForError) {
|
|
297
|
+
return callStackForError();
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
var specialPropKeyWarningShown;
|
|
301
|
+
var didWarnAboutElementRef = {};
|
|
302
|
+
var unknownOwnerDebugStack = React$1.react_stack_bottom_frame.bind(
|
|
303
|
+
React$1,
|
|
304
|
+
UnknownOwner
|
|
305
|
+
)();
|
|
306
|
+
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
307
|
+
var didWarnAboutKeySpread = {};
|
|
308
|
+
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
309
|
+
reactJsxRuntime_development.jsx = function(type, config, maybeKey) {
|
|
310
|
+
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
311
|
+
return jsxDEVImpl(
|
|
312
|
+
type,
|
|
313
|
+
config,
|
|
314
|
+
maybeKey,
|
|
315
|
+
false,
|
|
316
|
+
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
|
317
|
+
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
318
|
+
);
|
|
319
|
+
};
|
|
320
|
+
reactJsxRuntime_development.jsxs = function(type, config, maybeKey) {
|
|
321
|
+
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
322
|
+
return jsxDEVImpl(
|
|
323
|
+
type,
|
|
324
|
+
config,
|
|
325
|
+
maybeKey,
|
|
326
|
+
true,
|
|
327
|
+
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
|
328
|
+
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
329
|
+
);
|
|
330
|
+
};
|
|
331
|
+
})();
|
|
332
|
+
return reactJsxRuntime_development;
|
|
333
|
+
}
|
|
68
334
|
var hasRequiredJsxRuntime;
|
|
69
335
|
function requireJsxRuntime() {
|
|
70
336
|
if (hasRequiredJsxRuntime) return jsxRuntime.exports;
|
|
71
337
|
hasRequiredJsxRuntime = 1;
|
|
72
|
-
{
|
|
338
|
+
if (process.env.NODE_ENV === "production") {
|
|
73
339
|
jsxRuntime.exports = requireReactJsxRuntime_production();
|
|
340
|
+
} else {
|
|
341
|
+
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
74
342
|
}
|
|
75
343
|
return jsxRuntime.exports;
|
|
76
344
|
}
|
|
@@ -584,13 +852,13 @@ const useAlertBusyStore = create((set) => ({
|
|
|
584
852
|
const resetAlertBusyStore = () => {
|
|
585
853
|
useAlertBusyStore.setState({ visible: false, title: alertBusyStoreInitialState.title });
|
|
586
854
|
};
|
|
587
|
-
const __vite_import_meta_env__$3 = {
|
|
855
|
+
const __vite_import_meta_env__$3 = {};
|
|
588
856
|
const {
|
|
589
857
|
CHAT_WIDGET_CONNECTYCUBE_SINGLE_VIEW_CHAT_EXTERNAL_ID,
|
|
590
858
|
CHAT_WIDGET_CONNECTYCUBE_SINGLE_VIEW_CHAT_NAME,
|
|
591
859
|
CHAT_WIDGET_CONNECTYCUBE_SINGLE_VIEW_CHAT_PHOTO,
|
|
592
860
|
CHAT_WIDGET_CONNECTYCUBE_SINGLE_VIEW_CHAT_OPPONENTS_IDS
|
|
593
|
-
} = __vite_import_meta_env__$3 ||
|
|
861
|
+
} = __vite_import_meta_env__$3 || process.env;
|
|
594
862
|
var DefaultChatTypes = /* @__PURE__ */ ((DefaultChatTypes2) => {
|
|
595
863
|
DefaultChatTypes2["SINGLE"] = "1on1";
|
|
596
864
|
DefaultChatTypes2["GROUP"] = "group";
|
|
@@ -1020,8 +1288,8 @@ const isGuestUser = () => {
|
|
|
1020
1288
|
return isBrowser ? Boolean(localStorage.getItem(GUEST_KEY)) : false;
|
|
1021
1289
|
};
|
|
1022
1290
|
const isTempSession = () => isGuestUser() && !isRememberMe();
|
|
1023
|
-
const __vite_import_meta_env__$2 = {
|
|
1024
|
-
const { CHAT_WIDGET_CONNECTYCUBE_TERMS_AND_CONDITIONS } = __vite_import_meta_env__$2 ||
|
|
1291
|
+
const __vite_import_meta_env__$2 = {};
|
|
1292
|
+
const { CHAT_WIDGET_CONNECTYCUBE_TERMS_AND_CONDITIONS } = __vite_import_meta_env__$2 || process.env;
|
|
1025
1293
|
const appSettingsStoreInitialState = {
|
|
1026
1294
|
userAuthorized: false,
|
|
1027
1295
|
attachmentsAccept: "*/*",
|
|
@@ -1091,8 +1359,8 @@ const isSupportedFileMimeType = (file, attachmentsAcceptList) => {
|
|
|
1091
1359
|
(acceptType) => acceptType.startsWith("*") || acceptType === fileMimeType || acceptType.endsWith("/*") && acceptType.startsWith(fileType) || acceptType.startsWith(".") && acceptType.slice(1) === fileSubtype
|
|
1092
1360
|
);
|
|
1093
1361
|
};
|
|
1094
|
-
const __vite_import_meta_env__$1 = {
|
|
1095
|
-
const { CHAT_WIDGET_CONNECTYCUBE_WEB_PUSH_VAPID_PUBLIC_KEY, CHAT_WIDGET_CONNECTYCUBE_WEB_PUSH_SERVICE_WORKER_PATH } = __vite_import_meta_env__$1 ||
|
|
1362
|
+
const __vite_import_meta_env__$1 = {};
|
|
1363
|
+
const { CHAT_WIDGET_CONNECTYCUBE_WEB_PUSH_VAPID_PUBLIC_KEY, CHAT_WIDGET_CONNECTYCUBE_WEB_PUSH_SERVICE_WORKER_PATH } = __vite_import_meta_env__$1 || process.env;
|
|
1096
1364
|
const appNotificationStoreInitialState = {
|
|
1097
1365
|
muted: false,
|
|
1098
1366
|
showNotifications: false,
|
|
@@ -1336,8 +1604,8 @@ const restoreUserSettingsStore = async () => {
|
|
|
1336
1604
|
const subscribed = await managePushNotificationsSubscription(userSettings.isPushNotifications);
|
|
1337
1605
|
useUserSettingsStore.setState({ ...userSettings, isPushNotifications: subscribed });
|
|
1338
1606
|
};
|
|
1339
|
-
const __vite_import_meta_env__ = {
|
|
1340
|
-
const { CHAT_WIDGET_CONNECTYCUBE_GOOGLE_GENERATIVE_AI_API_KEY } = __vite_import_meta_env__ ||
|
|
1607
|
+
const __vite_import_meta_env__ = {};
|
|
1608
|
+
const { CHAT_WIDGET_CONNECTYCUBE_GOOGLE_GENERATIVE_AI_API_KEY } = __vite_import_meta_env__ || process.env;
|
|
1341
1609
|
const appAIStoreInitialState = {
|
|
1342
1610
|
changeMessageTone: false,
|
|
1343
1611
|
textSummarization: false,
|