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