@xapp/chat-widget 1.105.2 → 1.105.4
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.css +1 -1
- package/dist/index.es.js +128 -167
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +128 -167
- package/dist/index.js.map +1 -1
- package/dist/xapp-chat-widget.css +1 -1
- package/dist/xapp-chat-widget.js +1 -1
- package/dist/xapp-chat-widget.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -10906,7 +10906,6 @@ class Socket extends Emitter_1 {
|
|
|
10906
10906
|
case PacketType.CONNECT_ERROR:
|
|
10907
10907
|
this.destroy();
|
|
10908
10908
|
const err = new Error(packet.data.message);
|
|
10909
|
-
// @ts-ignore
|
|
10910
10909
|
err.data = packet.data.data;
|
|
10911
10910
|
this.emitReserved("connect_error", err);
|
|
10912
10911
|
break;
|
|
@@ -36958,182 +36957,144 @@ function createThunkMiddleware(extraArgument) {
|
|
|
36958
36957
|
var thunk = createThunkMiddleware();
|
|
36959
36958
|
var withExtraArgument = createThunkMiddleware;
|
|
36960
36959
|
|
|
36961
|
-
|
|
36962
|
-
|
|
36963
|
-
|
|
36964
|
-
|
|
36965
|
-
|
|
36966
|
-
|
|
36967
|
-
return compose.apply(null, arguments);
|
|
36960
|
+
//#endregion
|
|
36961
|
+
//#region src/devtoolsExtension.ts
|
|
36962
|
+
const composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() {
|
|
36963
|
+
if (arguments.length === 0) return void 0;
|
|
36964
|
+
if (typeof arguments[0] === "object") return compose;
|
|
36965
|
+
return compose.apply(null, arguments);
|
|
36968
36966
|
};
|
|
36969
|
-
var Tuple = class
|
|
36970
|
-
|
|
36971
|
-
|
|
36972
|
-
|
|
36973
|
-
|
|
36974
|
-
|
|
36975
|
-
|
|
36976
|
-
|
|
36977
|
-
|
|
36978
|
-
|
|
36979
|
-
|
|
36980
|
-
|
|
36981
|
-
|
|
36982
|
-
|
|
36983
|
-
|
|
36984
|
-
return new _Tuple(...arr.concat(this));
|
|
36985
|
-
}
|
|
36967
|
+
var Tuple = class Tuple extends Array {
|
|
36968
|
+
constructor(...items) {
|
|
36969
|
+
super(...items);
|
|
36970
|
+
Object.setPrototypeOf(this, Tuple.prototype);
|
|
36971
|
+
}
|
|
36972
|
+
static get [Symbol.species]() {
|
|
36973
|
+
return Tuple;
|
|
36974
|
+
}
|
|
36975
|
+
concat(...arr) {
|
|
36976
|
+
return super.concat.apply(this, arr);
|
|
36977
|
+
}
|
|
36978
|
+
prepend(...arr) {
|
|
36979
|
+
if (arr.length === 1 && Array.isArray(arr[0])) return new Tuple(...arr[0].concat(this));
|
|
36980
|
+
return new Tuple(...arr.concat(this));
|
|
36981
|
+
}
|
|
36986
36982
|
};
|
|
36987
|
-
|
|
36988
|
-
|
|
36983
|
+
//#endregion
|
|
36984
|
+
//#region src/getDefaultMiddleware.ts
|
|
36989
36985
|
function isBoolean(x) {
|
|
36990
|
-
|
|
36991
|
-
}
|
|
36992
|
-
|
|
36993
|
-
|
|
36994
|
-
|
|
36995
|
-
|
|
36996
|
-
|
|
36997
|
-
|
|
36998
|
-
|
|
36999
|
-
|
|
37000
|
-
if (thunk$1) {
|
|
37001
|
-
if (isBoolean(thunk$1)) {
|
|
37002
|
-
middlewareArray.push(thunk);
|
|
37003
|
-
} else {
|
|
37004
|
-
middlewareArray.push(withExtraArgument(thunk$1.extraArgument));
|
|
37005
|
-
}
|
|
37006
|
-
}
|
|
37007
|
-
return middlewareArray;
|
|
36986
|
+
return typeof x === "boolean";
|
|
36987
|
+
}
|
|
36988
|
+
const buildGetDefaultMiddleware = () => function getDefaultMiddleware(options) {
|
|
36989
|
+
const { thunk: thunk$1 = true, immutableCheck = true, serializableCheck = true, actionCreatorCheck = true } = options ?? {};
|
|
36990
|
+
let middlewareArray = new Tuple();
|
|
36991
|
+
if (thunk$1) {
|
|
36992
|
+
if (isBoolean(thunk$1)) middlewareArray.push(thunk);
|
|
36993
|
+
else middlewareArray.push(withExtraArgument(thunk$1.extraArgument));
|
|
36994
|
+
}
|
|
36995
|
+
return middlewareArray;
|
|
37008
36996
|
};
|
|
37009
|
-
|
|
37010
|
-
|
|
37011
|
-
|
|
37012
|
-
|
|
37013
|
-
|
|
37014
|
-
|
|
37015
|
-
|
|
36997
|
+
//#endregion
|
|
36998
|
+
//#region src/autoBatchEnhancer.ts
|
|
36999
|
+
const SHOULD_AUTOBATCH = "RTK_autoBatch";
|
|
37000
|
+
const createQueueWithTimer = (timeout) => {
|
|
37001
|
+
return (notify) => {
|
|
37002
|
+
setTimeout(notify, timeout);
|
|
37003
|
+
};
|
|
37016
37004
|
};
|
|
37017
|
-
|
|
37018
|
-
|
|
37019
|
-
|
|
37020
|
-
|
|
37021
|
-
|
|
37022
|
-
|
|
37023
|
-
|
|
37024
|
-
|
|
37025
|
-
|
|
37026
|
-
|
|
37027
|
-
|
|
37028
|
-
|
|
37029
|
-
|
|
37005
|
+
const createRafWithFallbackTimer = (raf, timeout) => {
|
|
37006
|
+
return (notify) => {
|
|
37007
|
+
let called = false;
|
|
37008
|
+
let rafId;
|
|
37009
|
+
let timerId;
|
|
37010
|
+
const callback = () => {
|
|
37011
|
+
if (called) return;
|
|
37012
|
+
called = true;
|
|
37013
|
+
cancelAnimationFrame(rafId);
|
|
37014
|
+
clearTimeout(timerId);
|
|
37015
|
+
notify();
|
|
37016
|
+
};
|
|
37017
|
+
rafId = raf(callback);
|
|
37018
|
+
timerId = setTimeout(callback, timeout);
|
|
37019
|
+
};
|
|
37030
37020
|
};
|
|
37031
|
-
|
|
37032
|
-
|
|
37033
|
-
|
|
37034
|
-
|
|
37035
|
-
|
|
37036
|
-
|
|
37037
|
-
|
|
37038
|
-
|
|
37039
|
-
|
|
37040
|
-
|
|
37041
|
-
|
|
37042
|
-
|
|
37043
|
-
|
|
37044
|
-
|
|
37045
|
-
|
|
37046
|
-
|
|
37047
|
-
|
|
37048
|
-
|
|
37049
|
-
|
|
37050
|
-
|
|
37051
|
-
|
|
37052
|
-
|
|
37053
|
-
|
|
37054
|
-
|
|
37055
|
-
|
|
37056
|
-
|
|
37057
|
-
|
|
37058
|
-
|
|
37059
|
-
|
|
37060
|
-
|
|
37061
|
-
|
|
37062
|
-
|
|
37063
|
-
|
|
37064
|
-
|
|
37065
|
-
|
|
37066
|
-
|
|
37067
|
-
|
|
37068
|
-
|
|
37069
|
-
|
|
37070
|
-
|
|
37071
|
-
queueCallback(notifyListeners);
|
|
37072
|
-
}
|
|
37073
|
-
}
|
|
37074
|
-
return store.dispatch(action);
|
|
37075
|
-
} finally {
|
|
37076
|
-
notifying = true;
|
|
37077
|
-
}
|
|
37078
|
-
}
|
|
37079
|
-
});
|
|
37021
|
+
const autoBatchEnhancer = (options = { type: "raf" }) => (next) => (...args) => {
|
|
37022
|
+
const store = next(...args);
|
|
37023
|
+
let notifying = true;
|
|
37024
|
+
let shouldNotifyAtEndOfTick = false;
|
|
37025
|
+
let notificationQueued = false;
|
|
37026
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
37027
|
+
const queueCallback = options.type === "tick" ? queueMicrotask : options.type === "raf" ? typeof window !== "undefined" && window.requestAnimationFrame ? createRafWithFallbackTimer(window.requestAnimationFrame, 100) : createQueueWithTimer(10) : options.type === "callback" ? options.queueNotification : createQueueWithTimer(options.timeout);
|
|
37028
|
+
const notifyListeners = () => {
|
|
37029
|
+
notificationQueued = false;
|
|
37030
|
+
if (shouldNotifyAtEndOfTick) {
|
|
37031
|
+
shouldNotifyAtEndOfTick = false;
|
|
37032
|
+
listeners.forEach((l) => l());
|
|
37033
|
+
}
|
|
37034
|
+
};
|
|
37035
|
+
return Object.assign({}, store, {
|
|
37036
|
+
subscribe(listener) {
|
|
37037
|
+
const wrappedListener = () => notifying && listener();
|
|
37038
|
+
const unsubscribe = store.subscribe(wrappedListener);
|
|
37039
|
+
listeners.add(listener);
|
|
37040
|
+
return () => {
|
|
37041
|
+
unsubscribe();
|
|
37042
|
+
listeners.delete(listener);
|
|
37043
|
+
};
|
|
37044
|
+
},
|
|
37045
|
+
dispatch(action) {
|
|
37046
|
+
try {
|
|
37047
|
+
notifying = !action?.meta?.[SHOULD_AUTOBATCH];
|
|
37048
|
+
shouldNotifyAtEndOfTick = !notifying;
|
|
37049
|
+
if (shouldNotifyAtEndOfTick) {
|
|
37050
|
+
if (!notificationQueued) {
|
|
37051
|
+
notificationQueued = true;
|
|
37052
|
+
queueCallback(notifyListeners);
|
|
37053
|
+
}
|
|
37054
|
+
}
|
|
37055
|
+
return store.dispatch(action);
|
|
37056
|
+
} finally {
|
|
37057
|
+
notifying = true;
|
|
37058
|
+
}
|
|
37059
|
+
}
|
|
37060
|
+
});
|
|
37080
37061
|
};
|
|
37081
|
-
|
|
37082
|
-
|
|
37083
|
-
|
|
37084
|
-
|
|
37085
|
-
|
|
37086
|
-
|
|
37087
|
-
|
|
37088
|
-
if (autoBatch) {
|
|
37089
|
-
enhancerArray.push(autoBatchEnhancer(typeof autoBatch === "object" ? autoBatch : void 0));
|
|
37090
|
-
}
|
|
37091
|
-
return enhancerArray;
|
|
37062
|
+
//#endregion
|
|
37063
|
+
//#region src/getDefaultEnhancers.ts
|
|
37064
|
+
const buildGetDefaultEnhancers = (middlewareEnhancer) => function getDefaultEnhancers(options) {
|
|
37065
|
+
const { autoBatch = true } = options ?? {};
|
|
37066
|
+
let enhancerArray = new Tuple(middlewareEnhancer);
|
|
37067
|
+
if (autoBatch) enhancerArray.push(autoBatchEnhancer(typeof autoBatch === "object" ? autoBatch : void 0));
|
|
37068
|
+
return enhancerArray;
|
|
37092
37069
|
};
|
|
37093
|
-
|
|
37094
|
-
|
|
37070
|
+
//#endregion
|
|
37071
|
+
//#region src/configureStore.ts
|
|
37095
37072
|
function configureStore(options) {
|
|
37096
|
-
|
|
37097
|
-
|
|
37098
|
-
|
|
37099
|
-
|
|
37100
|
-
|
|
37101
|
-
|
|
37102
|
-
|
|
37103
|
-
|
|
37104
|
-
|
|
37105
|
-
|
|
37106
|
-
|
|
37107
|
-
|
|
37108
|
-
|
|
37109
|
-
|
|
37110
|
-
|
|
37111
|
-
|
|
37112
|
-
|
|
37113
|
-
|
|
37114
|
-
|
|
37115
|
-
|
|
37116
|
-
|
|
37117
|
-
|
|
37118
|
-
|
|
37119
|
-
let finalCompose = compose;
|
|
37120
|
-
if (devTools) {
|
|
37121
|
-
finalCompose = composeWithDevTools({
|
|
37122
|
-
// Enable capture of stack traces for dispatched Redux actions
|
|
37123
|
-
trace: "production" !== "production",
|
|
37124
|
-
...typeof devTools === "object" && devTools
|
|
37125
|
-
});
|
|
37126
|
-
}
|
|
37127
|
-
const middlewareEnhancer = applyMiddleware(...finalMiddleware);
|
|
37128
|
-
const getDefaultEnhancers = buildGetDefaultEnhancers(middlewareEnhancer);
|
|
37129
|
-
let storeEnhancers = typeof enhancers === "function" ? enhancers(getDefaultEnhancers) : getDefaultEnhancers();
|
|
37130
|
-
const composedEnhancer = finalCompose(...storeEnhancers);
|
|
37131
|
-
return createStore(rootReducer, preloadedState, composedEnhancer);
|
|
37132
|
-
}
|
|
37133
|
-
|
|
37134
|
-
// src/formatProdErrorMessage.ts
|
|
37073
|
+
const getDefaultMiddleware = buildGetDefaultMiddleware();
|
|
37074
|
+
const { reducer = void 0, middleware, devTools = true, duplicateMiddlewareCheck = true, preloadedState = void 0, enhancers = void 0 } = options || {};
|
|
37075
|
+
let rootReducer;
|
|
37076
|
+
if (typeof reducer === "function") rootReducer = reducer;
|
|
37077
|
+
else if (isPlainObject(reducer)) rootReducer = combineReducers(reducer);
|
|
37078
|
+
else throw new Error(formatProdErrorMessage(1) );
|
|
37079
|
+
let finalMiddleware;
|
|
37080
|
+
if (typeof middleware === "function") {
|
|
37081
|
+
finalMiddleware = middleware(getDefaultMiddleware);
|
|
37082
|
+
} else finalMiddleware = getDefaultMiddleware();
|
|
37083
|
+
let finalCompose = compose;
|
|
37084
|
+
if (devTools) finalCompose = composeWithDevTools({
|
|
37085
|
+
trace: "production" !== "production",
|
|
37086
|
+
...typeof devTools === "object" && devTools
|
|
37087
|
+
});
|
|
37088
|
+
const middlewareEnhancer = applyMiddleware(...finalMiddleware);
|
|
37089
|
+
const getDefaultEnhancers = buildGetDefaultEnhancers(middlewareEnhancer);
|
|
37090
|
+
let storeEnhancers = typeof enhancers === "function" ? enhancers(getDefaultEnhancers) : getDefaultEnhancers();
|
|
37091
|
+
const composedEnhancer = finalCompose(...storeEnhancers);
|
|
37092
|
+
return createStore(rootReducer, preloadedState, composedEnhancer);
|
|
37093
|
+
}
|
|
37094
|
+
//#endregion
|
|
37095
|
+
//#region src/formatProdErrorMessage.ts
|
|
37135
37096
|
function formatProdErrorMessage(code) {
|
|
37136
|
-
|
|
37097
|
+
return `Minified Redux Toolkit error #${code}; visit https://redux-toolkit.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;
|
|
37137
37098
|
}
|
|
37138
37099
|
|
|
37139
37100
|
// Function to create a static reducer
|