@xapp/chat-widget 1.105.3 → 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.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
- // src/index.ts
36961
-
36962
- // src/devtoolsExtension.ts
36963
- var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() {
36964
- if (arguments.length === 0) return void 0;
36965
- if (typeof arguments[0] === "object") return compose;
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 _Tuple extends Array {
36969
- constructor(...items) {
36970
- super(...items);
36971
- Object.setPrototypeOf(this, _Tuple.prototype);
36972
- }
36973
- static get [Symbol.species]() {
36974
- return _Tuple;
36975
- }
36976
- concat(...arr) {
36977
- return super.concat.apply(this, arr);
36978
- }
36979
- prepend(...arr) {
36980
- if (arr.length === 1 && Array.isArray(arr[0])) {
36981
- return new _Tuple(...arr[0].concat(this));
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
- // src/getDefaultMiddleware.ts
36982
+ //#endregion
36983
+ //#region src/getDefaultMiddleware.ts
36988
36984
  function isBoolean(x) {
36989
- return typeof x === "boolean";
36990
- }
36991
- var buildGetDefaultMiddleware = () => function getDefaultMiddleware(options) {
36992
- const {
36993
- thunk: thunk$1 = true,
36994
- immutableCheck = true,
36995
- serializableCheck = true,
36996
- actionCreatorCheck = true
36997
- } = options ?? {};
36998
- let middlewareArray = new Tuple();
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
- // src/autoBatchEnhancer.ts
37010
- var SHOULD_AUTOBATCH = "RTK_autoBatch";
37011
- var createQueueWithTimer = (timeout) => {
37012
- return (notify) => {
37013
- setTimeout(notify, timeout);
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
- var createRafWithFallbackTimer = (raf, timeout) => {
37017
- return (notify) => {
37018
- let called = false;
37019
- const callback = () => {
37020
- if (called) return;
37021
- called = true;
37022
- cancelAnimationFrame(rafId);
37023
- clearTimeout(timerId);
37024
- notify();
37025
- };
37026
- const rafId = raf(callback);
37027
- const timerId = setTimeout(callback, timeout);
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
- var autoBatchEnhancer = (options = {
37031
- type: "raf"
37032
- }) => (next) => (...args) => {
37033
- const store = next(...args);
37034
- let notifying = true;
37035
- let shouldNotifyAtEndOfTick = false;
37036
- let notificationQueued = false;
37037
- const listeners = /* @__PURE__ */ new Set();
37038
- const queueCallback = options.type === "tick" ? queueMicrotask : options.type === "raf" ? (
37039
- // requestAnimationFrame won't exist in SSR environments. Fall back to a vague approximation just to keep from erroring.
37040
- typeof window !== "undefined" && window.requestAnimationFrame ? createRafWithFallbackTimer(window.requestAnimationFrame, 100) : createQueueWithTimer(10)
37041
- ) : options.type === "callback" ? options.queueNotification : createQueueWithTimer(options.timeout);
37042
- const notifyListeners = () => {
37043
- notificationQueued = false;
37044
- if (shouldNotifyAtEndOfTick) {
37045
- shouldNotifyAtEndOfTick = false;
37046
- listeners.forEach((l) => l());
37047
- }
37048
- };
37049
- return Object.assign({}, store, {
37050
- // Override the base `store.subscribe` method to keep original listeners
37051
- // from running if we're delaying notifications
37052
- subscribe(listener2) {
37053
- const wrappedListener = () => notifying && listener2();
37054
- const unsubscribe = store.subscribe(wrappedListener);
37055
- listeners.add(listener2);
37056
- return () => {
37057
- unsubscribe();
37058
- listeners.delete(listener2);
37059
- };
37060
- },
37061
- // Override the base `store.dispatch` method so that we can check actions
37062
- // for the `shouldAutoBatch` flag and determine if batching is active
37063
- dispatch(action) {
37064
- try {
37065
- notifying = !action?.meta?.[SHOULD_AUTOBATCH];
37066
- shouldNotifyAtEndOfTick = !notifying;
37067
- if (shouldNotifyAtEndOfTick) {
37068
- if (!notificationQueued) {
37069
- notificationQueued = true;
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
- // src/getDefaultEnhancers.ts
37082
- var buildGetDefaultEnhancers = (middlewareEnhancer) => function getDefaultEnhancers(options) {
37083
- const {
37084
- autoBatch = true
37085
- } = options ?? {};
37086
- let enhancerArray = new Tuple(middlewareEnhancer);
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
- // src/configureStore.ts
37069
+ //#endregion
37070
+ //#region src/configureStore.ts
37094
37071
  function configureStore(options) {
37095
- const getDefaultMiddleware = buildGetDefaultMiddleware();
37096
- const {
37097
- reducer = void 0,
37098
- middleware,
37099
- devTools = true,
37100
- duplicateMiddlewareCheck = true,
37101
- preloadedState = void 0,
37102
- enhancers = void 0
37103
- } = options || {};
37104
- let rootReducer;
37105
- if (typeof reducer === "function") {
37106
- rootReducer = reducer;
37107
- } else if (isPlainObject(reducer)) {
37108
- rootReducer = combineReducers(reducer);
37109
- } else {
37110
- throw new Error(formatProdErrorMessage(1) );
37111
- }
37112
- let finalMiddleware;
37113
- if (typeof middleware === "function") {
37114
- finalMiddleware = middleware(getDefaultMiddleware);
37115
- } else {
37116
- finalMiddleware = getDefaultMiddleware();
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
- 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. `;
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