@bringg/dashboard-sdk 9.55.0 → 9.56.0

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.
@@ -2360,7 +2360,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
2360
2360
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2361
2361
 
2362
2362
  "use strict";
2363
- eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.AnonymousServiceRequest = exports.AuthorizedServiceRequest = exports.ResponseHandler = exports.RequestOptions = exports.logErrorResponse = void 0;\nvar axios_1 = __importDefault(__webpack_require__(/*! axios */ \"./node_modules/axios/index.js\"));\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar BringgException_1 = __webpack_require__(/*! ../Core/BringgException */ \"./dist/Core/BringgException.js\");\nvar Logger_1 = __importDefault(__webpack_require__(/*! ../Core/Logger */ \"./dist/Core/Logger.js\"));\nvar abort_1 = __webpack_require__(/*! ../utils/abort */ \"./dist/utils/abort.js\");\nvar version = '9.55.0';\nfunction logErrorResponse(response) {\n var data = response.data, status = response.status;\n try {\n Logger_1.default.error(response.config.method.toUpperCase(), response.config.url, status);\n }\n catch (e) {\n //\n }\n try {\n Logger_1.default.info(response.config.method.toUpperCase(), response.config.url, status, data);\n }\n catch (e) {\n //\n }\n try {\n Logger_1.default.debug(response);\n }\n catch (e) {\n //\n }\n}\nexports.logErrorResponse = logErrorResponse;\nvar DEFAULT_TIMEOUT = 120000;\nvar RequestOptions = /** @class */ (function () {\n function RequestOptions(clientId, timeout, queryString, authenticationToken, headers, responseType, signal) {\n // NiceToHave: move headers to HttpHeaders class\n this.headers = __assign(__assign({ 'Content-Type': 'application/json' }, headers), { 'sdk-version': version, Client: clientId });\n this.timeout = timeout;\n this.validateStatus = lodash_1.stubTrue;\n if (queryString) {\n this.params = queryString;\n }\n if (authenticationToken) {\n this.headers['Authorization'] = \"Token token=\".concat(authenticationToken);\n }\n if (responseType) {\n this.responseType = responseType;\n }\n if (signal) {\n this.signal = signal;\n }\n }\n RequestOptions.new = function (_a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.clientId, clientId = _c === void 0 ? 'Bringg Dashboard' : _c, _d = _b.timeout, timeout = _d === void 0 ? DEFAULT_TIMEOUT : _d, queryString = _b.queryString, authenticationToken = _b.authenticationToken, headers = _b.headers, responseType = _b.responseType, signal = _b.signal;\n return new RequestOptions(clientId, timeout || DEFAULT_TIMEOUT, queryString, authenticationToken, headers, responseType, signal);\n };\n return RequestOptions;\n}());\nexports.RequestOptions = RequestOptions;\nvar ResponseHandler = /** @class */ (function () {\n function ResponseHandler(response, signal) {\n this.axiosPromise = response;\n this.signal = signal;\n }\n ResponseHandler.prototype.handle = function (consumer) {\n return __awaiter(this, void 0, void 0, function () {\n var axiosResponse, e_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if ((0, lodash_1.isUndefined)(consumer)) {\n throw new Error('consumer must be defined');\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this.axiosPromise];\n case 2:\n axiosResponse = _a.sent();\n return [2 /*return*/, consumer(axiosResponse)];\n case 3:\n e_1 = _a.sent();\n if (axios_1.default.isCancel(e_1)) {\n (0, abort_1.throwAbortError)(this.signal, 'Request Aborted');\n }\n if (e_1 instanceof BringgException_1.BringgException) {\n throw e_1;\n }\n return [2 /*return*/, consumer(e_1)];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n return ResponseHandler;\n}());\nexports.ResponseHandler = ResponseHandler;\nfunction get(axiosInstance, host, uri, queryString, signal) {\n return new ResponseHandler(axiosInstance.get(\"\".concat(host).concat(uri), { params: queryString, signal: signal }), signal);\n}\nfunction post(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.post(\"\".concat(host).concat(uri), payload, { params: queryString, signal: signal }), signal);\n}\nfunction put(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.put(\"\".concat(host).concat(uri), payload, { params: queryString, signal: signal }), signal);\n}\nfunction patch(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.patch(\"\".concat(host).concat(uri), payload, { params: queryString, signal: signal }), signal);\n}\nfunction remove(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.delete(\"\".concat(host).concat(uri), { params: queryString, data: payload, signal: signal }), signal);\n}\nfunction routify(axiosInstance, endpoint, route, routeParams, queryString, payload, signal) {\n switch (route.httpMethod) {\n case 0 /* HttpMethod.GET */:\n return get(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, signal);\n case 1 /* HttpMethod.POST */:\n return post(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n case 2 /* HttpMethod.PUT */:\n return put(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n case 3 /* HttpMethod.PATCH */:\n return patch(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n case 4 /* HttpMethod.DELETE */:\n return remove(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n }\n}\nfunction wrapWithInterceptors(axios) {\n axios.interceptors.request.use(function (req) {\n var method = req.method, url = req.url, params = req.params, headers = req.headers, data = req.data;\n try {\n Logger_1.default.debug('REQUEST:', method.toUpperCase(), url);\n }\n catch (e) {\n //\n }\n try {\n Logger_1.default.trace('REQUEST-query-string:', params);\n Logger_1.default.trace('REQUEST-headers:', headers);\n Logger_1.default.trace('REQUEST-data:', data);\n }\n catch (e) {\n //\n }\n return req;\n });\n axios.interceptors.response.use(function (res) {\n var statusText = res.statusText, status = res.status, headers = res.headers, data = res.data;\n try {\n Logger_1.default.debug('RESPONSE:', res.config.url, status, statusText);\n }\n catch (e) {\n //\n }\n try {\n Logger_1.default.trace('RESPONSE-headers:', headers);\n Logger_1.default.trace('RESPONSE-data:', data);\n }\n catch (e) {\n //\n }\n return res;\n });\n return axios;\n}\nfunction axiosInstance(clientId, authenticationToken, headers, responseType, timeout, signal) {\n return wrapWithInterceptors(axios_1.default.create(RequestOptions.new({ clientId: clientId, authenticationToken: authenticationToken, headers: headers, responseType: responseType, timeout: timeout, signal: signal })));\n}\nfunction anonymousAxiosInstance(clientId, headers, signal) {\n return wrapWithInterceptors(axios_1.default.create(RequestOptions.new({ clientId: clientId, headers: headers, signal: signal })));\n}\nvar AuthorizedServiceRequest = /** @class */ (function () {\n function AuthorizedServiceRequest(clientId, authToken) {\n this.authToken = authToken;\n this.clientId = clientId;\n }\n AuthorizedServiceRequest.prototype.invoke = function (endpoint, route, routeParams, queryString, payload, headers, responseType, timeout, signal) {\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n (0, abort_1.throwAbortError)(signal, 'Request aborted (before even started the request)');\n }\n return routify(axiosInstance(this.clientId, this.authToken, headers, responseType, timeout), endpoint, route, routeParams, queryString, payload, signal);\n };\n return AuthorizedServiceRequest;\n}());\nexports.AuthorizedServiceRequest = AuthorizedServiceRequest;\nvar AnonymousServiceRequest = /** @class */ (function () {\n function AnonymousServiceRequest(clientId, headers) {\n this.clientId = clientId;\n this.headers = headers;\n }\n AnonymousServiceRequest.prototype.invoke = function (endpoint, route, routeParams, queryString, payload, signal) {\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n (0, abort_1.throwAbortError)(signal, 'Request aborted (before even started the request)');\n }\n return routify(anonymousAxiosInstance(this.clientId, this.headers, signal), endpoint, route, routeParams, queryString, payload);\n };\n return AnonymousServiceRequest;\n}());\nexports.AnonymousServiceRequest = AnonymousServiceRequest;\n//# sourceMappingURL=ServiceRequest.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/Services/ServiceRequest.js?");
2363
+ eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.AnonymousServiceRequest = exports.AuthorizedServiceRequest = exports.ResponseHandler = exports.RequestOptions = exports.logErrorResponse = void 0;\nvar axios_1 = __importDefault(__webpack_require__(/*! axios */ \"./node_modules/axios/index.js\"));\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar BringgException_1 = __webpack_require__(/*! ../Core/BringgException */ \"./dist/Core/BringgException.js\");\nvar Logger_1 = __importDefault(__webpack_require__(/*! ../Core/Logger */ \"./dist/Core/Logger.js\"));\nvar abort_1 = __webpack_require__(/*! ../utils/abort */ \"./dist/utils/abort.js\");\nvar version = '9.56.0';\nfunction logErrorResponse(response) {\n var data = response.data, status = response.status;\n try {\n Logger_1.default.error(response.config.method.toUpperCase(), response.config.url, status);\n }\n catch (e) {\n //\n }\n try {\n Logger_1.default.info(response.config.method.toUpperCase(), response.config.url, status, data);\n }\n catch (e) {\n //\n }\n try {\n Logger_1.default.debug(response);\n }\n catch (e) {\n //\n }\n}\nexports.logErrorResponse = logErrorResponse;\nvar DEFAULT_TIMEOUT = 120000;\nvar RequestOptions = /** @class */ (function () {\n function RequestOptions(clientId, timeout, queryString, authenticationToken, headers, responseType, signal) {\n // NiceToHave: move headers to HttpHeaders class\n this.headers = __assign(__assign({ 'Content-Type': 'application/json' }, headers), { 'sdk-version': version, Client: clientId });\n this.timeout = timeout;\n this.validateStatus = lodash_1.stubTrue;\n if (queryString) {\n this.params = queryString;\n }\n if (authenticationToken) {\n this.headers['Authorization'] = \"Token token=\".concat(authenticationToken);\n }\n if (responseType) {\n this.responseType = responseType;\n }\n if (signal) {\n this.signal = signal;\n }\n }\n RequestOptions.new = function (_a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.clientId, clientId = _c === void 0 ? 'Bringg Dashboard' : _c, _d = _b.timeout, timeout = _d === void 0 ? DEFAULT_TIMEOUT : _d, queryString = _b.queryString, authenticationToken = _b.authenticationToken, headers = _b.headers, responseType = _b.responseType, signal = _b.signal;\n return new RequestOptions(clientId, timeout || DEFAULT_TIMEOUT, queryString, authenticationToken, headers, responseType, signal);\n };\n return RequestOptions;\n}());\nexports.RequestOptions = RequestOptions;\nvar ResponseHandler = /** @class */ (function () {\n function ResponseHandler(response, signal) {\n this.axiosPromise = response;\n this.signal = signal;\n }\n ResponseHandler.prototype.handle = function (consumer) {\n return __awaiter(this, void 0, void 0, function () {\n var axiosResponse, e_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if ((0, lodash_1.isUndefined)(consumer)) {\n throw new Error('consumer must be defined');\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this.axiosPromise];\n case 2:\n axiosResponse = _a.sent();\n return [2 /*return*/, consumer(axiosResponse)];\n case 3:\n e_1 = _a.sent();\n if (axios_1.default.isCancel(e_1)) {\n (0, abort_1.throwAbortError)(this.signal, 'Request Aborted');\n }\n if (e_1 instanceof BringgException_1.BringgException) {\n throw e_1;\n }\n return [2 /*return*/, consumer(e_1)];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n return ResponseHandler;\n}());\nexports.ResponseHandler = ResponseHandler;\nfunction get(axiosInstance, host, uri, queryString, signal) {\n return new ResponseHandler(axiosInstance.get(\"\".concat(host).concat(uri), { params: queryString, signal: signal }), signal);\n}\nfunction post(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.post(\"\".concat(host).concat(uri), payload, { params: queryString, signal: signal }), signal);\n}\nfunction put(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.put(\"\".concat(host).concat(uri), payload, { params: queryString, signal: signal }), signal);\n}\nfunction patch(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.patch(\"\".concat(host).concat(uri), payload, { params: queryString, signal: signal }), signal);\n}\nfunction remove(axiosInstance, host, uri, queryString, payload, signal) {\n return new ResponseHandler(axiosInstance.delete(\"\".concat(host).concat(uri), { params: queryString, data: payload, signal: signal }), signal);\n}\nfunction routify(axiosInstance, endpoint, route, routeParams, queryString, payload, signal) {\n switch (route.httpMethod) {\n case 0 /* HttpMethod.GET */:\n return get(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, signal);\n case 1 /* HttpMethod.POST */:\n return post(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n case 2 /* HttpMethod.PUT */:\n return put(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n case 3 /* HttpMethod.PATCH */:\n return patch(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n case 4 /* HttpMethod.DELETE */:\n return remove(axiosInstance, endpoint.encode(), route.applyParams(routeParams), queryString, payload, signal);\n }\n}\nfunction wrapWithInterceptors(axios) {\n axios.interceptors.request.use(function (req) {\n var method = req.method, url = req.url, params = req.params, headers = req.headers, data = req.data;\n try {\n Logger_1.default.debug('REQUEST:', method.toUpperCase(), url);\n }\n catch (e) {\n //\n }\n try {\n Logger_1.default.trace('REQUEST-query-string:', params);\n Logger_1.default.trace('REQUEST-headers:', headers);\n Logger_1.default.trace('REQUEST-data:', data);\n }\n catch (e) {\n //\n }\n return req;\n });\n axios.interceptors.response.use(function (res) {\n var statusText = res.statusText, status = res.status, headers = res.headers, data = res.data;\n try {\n Logger_1.default.debug('RESPONSE:', res.config.url, status, statusText);\n }\n catch (e) {\n //\n }\n try {\n Logger_1.default.trace('RESPONSE-headers:', headers);\n Logger_1.default.trace('RESPONSE-data:', data);\n }\n catch (e) {\n //\n }\n return res;\n });\n return axios;\n}\nfunction axiosInstance(clientId, authenticationToken, headers, responseType, timeout, signal) {\n return wrapWithInterceptors(axios_1.default.create(RequestOptions.new({ clientId: clientId, authenticationToken: authenticationToken, headers: headers, responseType: responseType, timeout: timeout, signal: signal })));\n}\nfunction anonymousAxiosInstance(clientId, headers, signal) {\n return wrapWithInterceptors(axios_1.default.create(RequestOptions.new({ clientId: clientId, headers: headers, signal: signal })));\n}\nvar AuthorizedServiceRequest = /** @class */ (function () {\n function AuthorizedServiceRequest(clientId, authToken) {\n this.authToken = authToken;\n this.clientId = clientId;\n }\n AuthorizedServiceRequest.prototype.invoke = function (endpoint, route, routeParams, queryString, payload, headers, responseType, timeout, signal) {\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n (0, abort_1.throwAbortError)(signal, 'Request aborted (before even started the request)');\n }\n return routify(axiosInstance(this.clientId, this.authToken, headers, responseType, timeout), endpoint, route, routeParams, queryString, payload, signal);\n };\n return AuthorizedServiceRequest;\n}());\nexports.AuthorizedServiceRequest = AuthorizedServiceRequest;\nvar AnonymousServiceRequest = /** @class */ (function () {\n function AnonymousServiceRequest(clientId, headers) {\n this.clientId = clientId;\n this.headers = headers;\n }\n AnonymousServiceRequest.prototype.invoke = function (endpoint, route, routeParams, queryString, payload, signal) {\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n (0, abort_1.throwAbortError)(signal, 'Request aborted (before even started the request)');\n }\n return routify(anonymousAxiosInstance(this.clientId, this.headers, signal), endpoint, route, routeParams, queryString, payload);\n };\n return AnonymousServiceRequest;\n}());\nexports.AnonymousServiceRequest = AnonymousServiceRequest;\n//# sourceMappingURL=ServiceRequest.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/Services/ServiceRequest.js?");
2364
2364
 
2365
2365
  /***/ }),
2366
2366
 
@@ -2998,7 +2998,7 @@ eval("\nvar __extends = (this && this.__extends) || (function () {\n var exte
2998
2998
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2999
2999
 
3000
3000
  "use strict";
3001
- eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar types_1 = __webpack_require__(/*! @bringg/types */ \"./node_modules/@bringg/types/index.js\");\nvar lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nvar rxjs_1 = __webpack_require__(/*! rxjs */ \"./node_modules/rxjs/_esm5/index.js\");\nvar operators_1 = __webpack_require__(/*! rxjs/operators */ \"./node_modules/rxjs/_esm5/operators/index.js\");\nvar BaseStore_1 = __importDefault(__webpack_require__(/*! ../../Core/BaseStore */ \"./dist/Core/BaseStore.js\"));\nvar UsersService_1 = __importDefault(__webpack_require__(/*! ../Service/UsersService */ \"./dist/User/Service/UsersService.js\"));\nvar User_consts_1 = __webpack_require__(/*! ../User.consts */ \"./dist/User/User.consts.js\");\nvar UserHelpers_1 = __webpack_require__(/*! ../UserHelpers */ \"./dist/User/UserHelpers.js\");\nvar THROTTLE_TIME = 500;\nvar UsersStore = /** @class */ (function (_super) {\n __extends(UsersStore, _super);\n function UsersStore(session, throttleTimeValue) {\n var e_1, _a;\n var _this = _super.call(this) || this;\n _this.groupUpdateEvents = [];\n _this.groupedValues = new Map();\n _this.drivers = [];\n _this.fetchedStatus = {\n drivers: false,\n customers: false,\n adminsAndDispatchers: false\n };\n _this.usersService = new UsersService_1.default(session, _this);\n _this.onlineDriversCounterByTeam = new Map();\n try {\n for (var _b = __values(Object.keys(User_consts_1.GROUP_VALUES)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var groupId = _c.value;\n _this.groupedValues.set(User_consts_1.GROUP_VALUES[groupId], new Set());\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n throttleTimeValue = throttleTimeValue || THROTTLE_TIME;\n _this.onItemRemoved(function (userId, user) {\n var e_2, _a;\n var isDriverOnline = (user === null || user === void 0 ? void 0 : user.status) === types_1.Connection.Online;\n if (isDriverOnline && user.team_ids) {\n try {\n for (var _b = __values(user.team_ids), _c = _b.next(); !_c.done; _c = _b.next()) {\n var teamId = _c.value;\n _this.onlineDriversCounterByTeam.set(teamId, Math.max(_this.onlineDriversCounterByTeam.get(teamId) - 1, 0));\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n });\n //group by and save ids | can add config to throttle through users( maybe increase if admin )\n _this.state$\n .pipe((0, operators_1.throttleTime)(throttleTimeValue, rxjs_1.asyncScheduler, { trailing: true, leading: false }))\n .subscribe(function (users) {\n _this.initGroups(users.values());\n _this.emitGroupEvents();\n });\n return _this;\n }\n UsersStore.prototype.getRelevantDrivers = function (groupsToInit) {\n if (groupsToInit.length === Object.keys(User_consts_1.GROUP_VALUES).length) {\n return [];\n }\n else {\n return this.drivers.filter(function (driver) {\n return !((UserHelpers_1.UserHelpers.isOnlineDriver(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.OnlineDrivers)) ||\n (UserHelpers_1.UserHelpers.isOfflineDriver(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.OfflineDrivers)) ||\n (UserHelpers_1.UserHelpers.isOnShiftDriver(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.OnShiftDrivers)) ||\n (UserHelpers_1.UserHelpers.isAdmin(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.Admins)) ||\n (UserHelpers_1.UserHelpers.isDispatcher(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.Dispatchers)) ||\n (UserHelpers_1.UserHelpers.isCustomer(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.Customers)));\n });\n }\n };\n UsersStore.prototype.initGroups = function (users, groupsToInit) {\n var e_3, _a, _b, e_4, _c, e_5, _d, e_6, _e, e_7, _f;\n if (groupsToInit === void 0) { groupsToInit = Object.keys(User_consts_1.GROUP_VALUES); }\n var groups = {};\n try {\n for (var groupsToInit_1 = __values(groupsToInit), groupsToInit_1_1 = groupsToInit_1.next(); !groupsToInit_1_1.done; groupsToInit_1_1 = groupsToInit_1.next()) {\n var groupId = groupsToInit_1_1.value;\n groups[groupId] = new Set();\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (groupsToInit_1_1 && !groupsToInit_1_1.done && (_a = groupsToInit_1.return)) _a.call(groupsToInit_1);\n }\n finally { if (e_3) throw e_3.error; }\n }\n var relevantDrivers = this.getRelevantDrivers(groupsToInit);\n this.drivers.length = 0; // do not change drivers ref - manu pointer rely on it on their state on bringg-web\n (_b = this.drivers).push.apply(_b, __spreadArray([], __read(relevantDrivers), false));\n this.onlineDriversCounterByTeam = new Map();\n try {\n for (var users_1 = __values(users), users_1_1 = users_1.next(); !users_1_1.done; users_1_1 = users_1.next()) {\n var user = users_1_1.value;\n if (user.driver) {\n this.drivers.push(user);\n var isDriverOnline = user.status === types_1.Connection.Online;\n if (isDriverOnline && user.team_ids) {\n try {\n for (var _g = (e_5 = void 0, __values(user.team_ids)), _h = _g.next(); !_h.done; _h = _g.next()) {\n var teamId = _h.value;\n this.onlineDriversCounterByTeam.set(teamId, this.onlineDriversCounterByTeam.has(teamId)\n ? this.onlineDriversCounterByTeam.get(teamId) + 1\n : 1);\n }\n }\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\n finally {\n try {\n if (_h && !_h.done && (_d = _g.return)) _d.call(_g);\n }\n finally { if (e_5) throw e_5.error; }\n }\n }\n }\n var groupIds = (0, User_consts_1.userToGroupsMapper)(user);\n try {\n for (var groupIds_1 = (e_6 = void 0, __values(groupIds)), groupIds_1_1 = groupIds_1.next(); !groupIds_1_1.done; groupIds_1_1 = groupIds_1.next()) {\n var groupId = groupIds_1_1.value;\n if (groups[groupId]) {\n groups[groupId].add(user);\n }\n }\n }\n catch (e_6_1) { e_6 = { error: e_6_1 }; }\n finally {\n try {\n if (groupIds_1_1 && !groupIds_1_1.done && (_e = groupIds_1.return)) _e.call(groupIds_1);\n }\n finally { if (e_6) throw e_6.error; }\n }\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (users_1_1 && !users_1_1.done && (_c = users_1.return)) _c.call(users_1);\n }\n finally { if (e_4) throw e_4.error; }\n }\n try {\n for (var groupsToInit_2 = __values(groupsToInit), groupsToInit_2_1 = groupsToInit_2.next(); !groupsToInit_2_1.done; groupsToInit_2_1 = groupsToInit_2.next()) {\n var groupId = groupsToInit_2_1.value;\n this.groupedValues.set(User_consts_1.GROUP_VALUES[groupId], groups[groupId] || new Set());\n }\n }\n catch (e_7_1) { e_7 = { error: e_7_1 }; }\n finally {\n try {\n if (groupsToInit_2_1 && !groupsToInit_2_1.done && (_f = groupsToInit_2.return)) _f.call(groupsToInit_2);\n }\n finally { if (e_7) throw e_7.error; }\n }\n };\n UsersStore.prototype.create = function (user) {\n return __awaiter(this, void 0, void 0, function () {\n var newUser;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.create(user)];\n case 1:\n newUser = _a.sent();\n this.addToStore(newUser);\n return [2 /*return*/, newUser];\n }\n });\n });\n };\n UsersStore.prototype.getDriversByTeam = function (teamId) {\n return __awaiter(this, void 0, void 0, function () {\n var users;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.getDriversByTeam(teamId)];\n case 1:\n users = _a.sent();\n users.forEach(function (user) { return _this.addToStore(user); });\n return [2 /*return*/, users];\n }\n });\n });\n };\n UsersStore.prototype.getAll = function (page, limit) {\n if (page === void 0) { page = 1; }\n if (limit === void 0) { limit = 50; }\n return __awaiter(this, void 0, void 0, function () {\n var response;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.getAll(page, limit)];\n case 1:\n response = _a.sent();\n (0, lodash_1.forEach)(response.users, function (user) { return (_this.getItem(user.id) ? _this.updateInStore(user) : _this.addToStore(user)); });\n return [2 /*return*/, response];\n }\n });\n });\n };\n UsersStore.prototype.getAllKeysetPagination = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.getAllKeysetPagination(request)];\n case 1:\n response = _a.sent();\n (0, lodash_1.forEach)(response.users, function (user) { return (_this.getItem(user.id) ? _this.updateInStore(user) : _this.addToStore(user)); });\n this.initGroups(this.getItems());\n return [2 /*return*/, response];\n }\n });\n });\n };\n UsersStore.prototype.invite = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.invite(userId)];\n case 1:\n user = _a.sent();\n this.updateInStore(user);\n return [2 /*return*/, user];\n }\n });\n });\n };\n UsersStore.prototype.inviteByEmail = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.inviteByEmail(userId)];\n case 1:\n user = _a.sent();\n this.updateInStore(user);\n return [2 /*return*/, user];\n }\n });\n });\n };\n UsersStore.prototype.getAllAdminsAndDispatchers = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var _this = this;\n return __generator(this, function (_a) {\n return [2 /*return*/, this.getOrFetchUsers(request, this.fetchedStatus.adminsAndDispatchers, function (isAllAdminsAndDispatchersFetched) {\n return (_this.fetchedStatus.adminsAndDispatchers = isAllAdminsAndDispatchersFetched);\n }, function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return (_a = _this.usersService).getAllAdminsAndDispatchers.apply(_a, __spreadArray([], __read(args), false));\n }, function () { return _this.getAllLocalAdminsAndDispatchers(); })];\n });\n });\n };\n UsersStore.prototype.getAllDrivers = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var options, response, isOnlyCustomer, isOnlyOnlineDrivers, groups;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n options = request.options;\n isOnlyCustomer = options === null || options === void 0 ? void 0 : options.onlyCustomers;\n isOnlyOnlineDrivers = options === null || options === void 0 ? void 0 : options.onlyOnlineDriver;\n if (!isOnlyCustomer) return [3 /*break*/, 2];\n return [4 /*yield*/, this.getOrFetchUsers(request, this.fetchedStatus.customers, function (isAllCustomersFetched) { return (_this.fetchedStatus.customers = isAllCustomersFetched); }, this.usersService.getAllDrivers, function () { return _this.getCustomers(); })];\n case 1:\n response = _a.sent();\n return [3 /*break*/, 4];\n case 2: return [4 /*yield*/, this.getOrFetchUsers(request, this.fetchedStatus.drivers, function (isAllDriversFetched) { return (_this.fetchedStatus.drivers = isAllDriversFetched); }, function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return (_a = _this.usersService).getAllDrivers.apply(_a, __spreadArray([], __read(args), false));\n }, function () { return (isOnlyOnlineDrivers ? __spreadArray([], __read(_this.getOnlineDrivers()), false) : __spreadArray([], __read(_this.getAllLocalDrivers()), false)); })];\n case 3:\n response = _a.sent();\n _a.label = 4;\n case 4:\n groups = isOnlyCustomer\n ? [User_consts_1.GROUP_VALUES.Customers]\n : isOnlyOnlineDrivers\n ? [User_consts_1.GROUP_VALUES.OnlineDrivers]\n : [User_consts_1.GROUP_VALUES.OfflineDrivers, User_consts_1.GROUP_VALUES.OnlineDrivers, User_consts_1.GROUP_VALUES.OnShiftDrivers];\n this.initGroups(response.users, groups);\n return [2 /*return*/, response];\n }\n });\n });\n };\n UsersStore.prototype.getOrFetchUsers = function (request, isFetchedFlag, setIsFetchedFlag, fetchUsers, getLocalUsers) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!isFetchedFlag) return [3 /*break*/, 2];\n return [4 /*yield*/, fetchUsers(request)];\n case 1:\n response = _a.sent();\n response.users.forEach(function (driver) { return _this.addToStore(driver); });\n if (!response.next_page_cursor && !response.previous_page_cursor) {\n setIsFetchedFlag(true);\n }\n return [2 /*return*/, response];\n case 2: return [2 /*return*/, {\n next_page_cursor: null,\n previous_page_cursor: null,\n users: getLocalUsers()\n }];\n }\n });\n });\n };\n UsersStore.prototype.byUserType = function (userTypeId) {\n return __awaiter(this, void 0, void 0, function () {\n var users;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.byUserType(userTypeId)];\n case 1:\n users = _a.sent();\n users.forEach(function (user) { return _this.addToStore(user); });\n return [2 /*return*/, users];\n }\n });\n });\n };\n UsersStore.prototype.makeAdmin = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.makeAdmin(userId)];\n case 1:\n user = _a.sent();\n this.updateInStore(user);\n return [2 /*return*/, user];\n }\n });\n });\n };\n UsersStore.prototype.update = function (userId, userDelta) {\n return __awaiter(this, void 0, void 0, function () {\n var user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.update(userId, userDelta)];\n case 1:\n user = _a.sent();\n this.updateInStore(user);\n return [2 /*return*/, user];\n }\n });\n });\n };\n UsersStore.prototype.delete = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var success;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.delete(userId)];\n case 1:\n success = _a.sent();\n if (success) {\n this.removeFromStore(userId);\n }\n return [2 /*return*/, success];\n }\n });\n });\n };\n UsersStore.prototype.get = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n var _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.getItem(id);\n if (_a) return [3 /*break*/, 2];\n return [4 /*yield*/, this.usersService.get(id)];\n case 1:\n _a = (_b.sent());\n _b.label = 2;\n case 2: return [2 /*return*/, _a];\n }\n });\n });\n };\n UsersStore.prototype.getMany = function (ids, commonOptions) {\n return __awaiter(this, void 0, void 0, function () {\n var foundedItems, idsSet, missingIds, missingUsers;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n foundedItems = this.getItemsByIds(ids);\n if (foundedItems.length === ids.length) {\n return [2 /*return*/, foundedItems];\n }\n idsSet = new Set(ids);\n foundedItems.forEach(function (user) { return idsSet.delete(user.id); });\n missingIds = Array.from(idsSet);\n return [4 /*yield*/, this.usersService.fetchAllPages(function (page) {\n if (page === void 0) { page = 1; }\n return __awaiter(_this, void 0, void 0, function () {\n var response, fetchedUsers;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.getMany({\n usersIds: missingIds,\n page: page,\n limit: 50\n }, commonOptions)];\n case 1:\n response = _a.sent();\n fetchedUsers = response.users;\n // Adding here and not after getting all, so we won't stop the event loop for too long, if we have a lot\n this.addItems(fetchedUsers);\n return [2 /*return*/, {\n values: fetchedUsers,\n hasMore: response.has_next_page,\n nextCursor: page + 1\n }];\n }\n });\n });\n }, { signal: commonOptions === null || commonOptions === void 0 ? void 0 : commonOptions.signal })];\n case 1:\n missingUsers = _a.sent();\n return [2 /*return*/, foundedItems.concat(missingUsers)];\n }\n });\n });\n };\n UsersStore.prototype.unlock = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.unlock(userId)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.assignedTasksCount = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.assignedTasksCount(userId)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.totalEmployeesCount = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.totalEmployeesCount()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.totalDriversCount = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.totalDriversCount()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.getProfileImage = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.getProfileImage(userId)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.validatePhone = function (phone) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.validatePhone(phone)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.closedTasks = function (userId, page) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.closedTasks(userId, page)];\n case 1: return [2 /*return*/, _a.sent()]; // in future - add this tasks to store :)\n }\n });\n });\n };\n UsersStore.prototype.messageDriver = function (userId, message) {\n return this.usersService.messageDriver(userId, message);\n };\n UsersStore.prototype.subscribeToGroupUpdates = function (fn) {\n this.groupUpdateEvents.push(fn);\n };\n UsersStore.prototype.getOfflineDrivers = function () {\n return this.groupedValues.get(User_consts_1.GROUP_VALUES.OfflineDrivers) || new Set();\n };\n UsersStore.prototype.getOnlineDrivers = function () {\n return this.groupedValues.get(User_consts_1.GROUP_VALUES.OnlineDrivers) || new Set();\n };\n UsersStore.prototype.getOnShiftDrivers = function () {\n return Array.from(this.groupedValues.get(User_consts_1.GROUP_VALUES.OnShiftDrivers) || []);\n };\n UsersStore.prototype.getCustomers = function () {\n return Array.from(this.groupedValues.get(User_consts_1.GROUP_VALUES.Customers) || []);\n };\n UsersStore.prototype.getAdmins = function () {\n return Array.from(this.groupedValues.get(User_consts_1.GROUP_VALUES.Admins) || []);\n };\n UsersStore.prototype.getDispatchers = function () {\n return Array.from(this.groupedValues.get(User_consts_1.GROUP_VALUES.Dispatchers) || []);\n };\n UsersStore.prototype.emitGroupEvents = function () {\n var _this = this;\n this.groupUpdateEvents.forEach(function (fn) { return fn(_this.groupedValues); });\n };\n UsersStore.prototype.getAllLocalDrivers = function () {\n return this.drivers;\n };\n UsersStore.prototype.getOnlineDriversCountByTeam = function (teamId) {\n return this.onlineDriversCounterByTeam.get(teamId) || 0;\n };\n UsersStore.prototype.getAllLocalAdminsAndDispatchers = function () {\n return __spreadArray([], __read(new Set(this.getAdmins().concat(this.getDispatchers()))), false);\n };\n return UsersStore;\n}(BaseStore_1.default));\nexports[\"default\"] = UsersStore;\n//# sourceMappingURL=UsersStore.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/User/Store/UsersStore.js?");
3001
+ eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.MAX_CONCURRENT_CHUNKED_REQUESTS = exports.DEFAULT_CHUNK_SIZE = void 0;\nvar types_1 = __webpack_require__(/*! @bringg/types */ \"./node_modules/@bringg/types/index.js\");\nvar chunk_1 = __importDefault(__webpack_require__(/*! lodash/chunk */ \"./node_modules/lodash/chunk.js\"));\nvar forEach_1 = __importDefault(__webpack_require__(/*! lodash/forEach */ \"./node_modules/lodash/forEach.js\"));\nvar last_1 = __importDefault(__webpack_require__(/*! lodash/last */ \"./node_modules/lodash/last.js\"));\nvar rxjs_1 = __webpack_require__(/*! rxjs */ \"./node_modules/rxjs/_esm5/index.js\");\nvar operators_1 = __webpack_require__(/*! rxjs/operators */ \"./node_modules/rxjs/_esm5/operators/index.js\");\nvar BaseStore_1 = __importDefault(__webpack_require__(/*! ../../Core/BaseStore */ \"./dist/Core/BaseStore.js\"));\nvar UsersService_1 = __importDefault(__webpack_require__(/*! ../Service/UsersService */ \"./dist/User/Service/UsersService.js\"));\nvar User_consts_1 = __webpack_require__(/*! ../User.consts */ \"./dist/User/User.consts.js\");\nvar UserHelpers_1 = __webpack_require__(/*! ../UserHelpers */ \"./dist/User/UserHelpers.js\");\nvar THROTTLE_TIME = 500;\nvar MIN_INTERVAL_BETWEEN_CHUNKED_REQUESTS = 300;\nexports.DEFAULT_CHUNK_SIZE = 50;\nexports.MAX_CONCURRENT_CHUNKED_REQUESTS = 4;\nvar UsersStore = /** @class */ (function (_super) {\n __extends(UsersStore, _super);\n function UsersStore(session, throttleTimeValue) {\n var e_1, _a;\n var _this = _super.call(this) || this;\n _this.groupUpdateEvents = [];\n _this.groupedValues = new Map();\n _this.drivers = [];\n _this.fetchedStatus = {\n drivers: false,\n customers: false,\n adminsAndDispatchers: false\n };\n _this.usersService = new UsersService_1.default(session, _this);\n _this.onlineDriversCounterByTeam = new Map();\n try {\n for (var _b = __values(Object.keys(User_consts_1.GROUP_VALUES)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var groupId = _c.value;\n _this.groupedValues.set(User_consts_1.GROUP_VALUES[groupId], new Set());\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n throttleTimeValue = throttleTimeValue || THROTTLE_TIME;\n _this.onItemRemoved(function (userId, user) {\n var e_2, _a;\n var isDriverOnline = (user === null || user === void 0 ? void 0 : user.status) === types_1.Connection.Online;\n if (isDriverOnline && user.team_ids) {\n try {\n for (var _b = __values(user.team_ids), _c = _b.next(); !_c.done; _c = _b.next()) {\n var teamId = _c.value;\n _this.onlineDriversCounterByTeam.set(teamId, Math.max(_this.onlineDriversCounterByTeam.get(teamId) - 1, 0));\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n });\n //group by and save ids | can add config to throttle through users( maybe increase if admin )\n _this.state$\n .pipe((0, operators_1.throttleTime)(throttleTimeValue, rxjs_1.asyncScheduler, { trailing: true, leading: false }))\n .subscribe(function (users) {\n _this.initGroups(users.values());\n _this.emitGroupEvents();\n });\n return _this;\n }\n UsersStore.prototype.getRelevantDrivers = function (groupsToInit) {\n if (groupsToInit.length === Object.keys(User_consts_1.GROUP_VALUES).length) {\n return [];\n }\n else {\n return this.drivers.filter(function (driver) {\n return !((UserHelpers_1.UserHelpers.isOnlineDriver(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.OnlineDrivers)) ||\n (UserHelpers_1.UserHelpers.isOfflineDriver(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.OfflineDrivers)) ||\n (UserHelpers_1.UserHelpers.isOnShiftDriver(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.OnShiftDrivers)) ||\n (UserHelpers_1.UserHelpers.isAdmin(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.Admins)) ||\n (UserHelpers_1.UserHelpers.isDispatcher(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.Dispatchers)) ||\n (UserHelpers_1.UserHelpers.isCustomer(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.Customers)));\n });\n }\n };\n UsersStore.prototype.initGroups = function (users, groupsToInit) {\n var e_3, _a, _b, e_4, _c, e_5, _d, e_6, _e, e_7, _f;\n if (groupsToInit === void 0) { groupsToInit = Object.keys(User_consts_1.GROUP_VALUES); }\n var groups = {};\n try {\n for (var groupsToInit_1 = __values(groupsToInit), groupsToInit_1_1 = groupsToInit_1.next(); !groupsToInit_1_1.done; groupsToInit_1_1 = groupsToInit_1.next()) {\n var groupId = groupsToInit_1_1.value;\n groups[groupId] = new Set();\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (groupsToInit_1_1 && !groupsToInit_1_1.done && (_a = groupsToInit_1.return)) _a.call(groupsToInit_1);\n }\n finally { if (e_3) throw e_3.error; }\n }\n var relevantDrivers = this.getRelevantDrivers(groupsToInit);\n this.drivers.length = 0; // do not change drivers ref - manu pointer rely on it on their state on bringg-web\n (_b = this.drivers).push.apply(_b, __spreadArray([], __read(relevantDrivers), false));\n this.onlineDriversCounterByTeam = new Map();\n try {\n for (var users_1 = __values(users), users_1_1 = users_1.next(); !users_1_1.done; users_1_1 = users_1.next()) {\n var user = users_1_1.value;\n if (user.driver) {\n this.drivers.push(user);\n var isDriverOnline = user.status === types_1.Connection.Online;\n if (isDriverOnline && user.team_ids) {\n try {\n for (var _g = (e_5 = void 0, __values(user.team_ids)), _h = _g.next(); !_h.done; _h = _g.next()) {\n var teamId = _h.value;\n this.onlineDriversCounterByTeam.set(teamId, this.onlineDriversCounterByTeam.has(teamId)\n ? this.onlineDriversCounterByTeam.get(teamId) + 1\n : 1);\n }\n }\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\n finally {\n try {\n if (_h && !_h.done && (_d = _g.return)) _d.call(_g);\n }\n finally { if (e_5) throw e_5.error; }\n }\n }\n }\n var groupIds = (0, User_consts_1.userToGroupsMapper)(user);\n try {\n for (var groupIds_1 = (e_6 = void 0, __values(groupIds)), groupIds_1_1 = groupIds_1.next(); !groupIds_1_1.done; groupIds_1_1 = groupIds_1.next()) {\n var groupId = groupIds_1_1.value;\n if (groups[groupId]) {\n groups[groupId].add(user);\n }\n }\n }\n catch (e_6_1) { e_6 = { error: e_6_1 }; }\n finally {\n try {\n if (groupIds_1_1 && !groupIds_1_1.done && (_e = groupIds_1.return)) _e.call(groupIds_1);\n }\n finally { if (e_6) throw e_6.error; }\n }\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (users_1_1 && !users_1_1.done && (_c = users_1.return)) _c.call(users_1);\n }\n finally { if (e_4) throw e_4.error; }\n }\n try {\n for (var groupsToInit_2 = __values(groupsToInit), groupsToInit_2_1 = groupsToInit_2.next(); !groupsToInit_2_1.done; groupsToInit_2_1 = groupsToInit_2.next()) {\n var groupId = groupsToInit_2_1.value;\n this.groupedValues.set(User_consts_1.GROUP_VALUES[groupId], groups[groupId] || new Set());\n }\n }\n catch (e_7_1) { e_7 = { error: e_7_1 }; }\n finally {\n try {\n if (groupsToInit_2_1 && !groupsToInit_2_1.done && (_f = groupsToInit_2.return)) _f.call(groupsToInit_2);\n }\n finally { if (e_7) throw e_7.error; }\n }\n };\n UsersStore.prototype.create = function (user) {\n return __awaiter(this, void 0, void 0, function () {\n var newUser;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.create(user)];\n case 1:\n newUser = _a.sent();\n this.addToStore(newUser);\n return [2 /*return*/, newUser];\n }\n });\n });\n };\n UsersStore.prototype.getDriversByTeam = function (teamId) {\n return __awaiter(this, void 0, void 0, function () {\n var users;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.getDriversByTeam(teamId)];\n case 1:\n users = _a.sent();\n users.forEach(function (user) { return _this.addToStore(user); });\n return [2 /*return*/, users];\n }\n });\n });\n };\n UsersStore.prototype.getAll = function (page, limit) {\n if (page === void 0) { page = 1; }\n if (limit === void 0) { limit = 50; }\n return __awaiter(this, void 0, void 0, function () {\n var response;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.getAll(page, limit)];\n case 1:\n response = _a.sent();\n (0, forEach_1.default)(response.users, function (user) { return (_this.getItem(user.id) ? _this.updateInStore(user) : _this.addToStore(user)); });\n return [2 /*return*/, response];\n }\n });\n });\n };\n UsersStore.prototype.getAllKeysetPagination = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.getAllKeysetPagination(request)];\n case 1:\n response = _a.sent();\n (0, forEach_1.default)(response.users, function (user) { return (_this.getItem(user.id) ? _this.updateInStore(user) : _this.addToStore(user)); });\n this.initGroups(this.getItems());\n return [2 /*return*/, response];\n }\n });\n });\n };\n UsersStore.prototype.invite = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.invite(userId)];\n case 1:\n user = _a.sent();\n this.updateInStore(user);\n return [2 /*return*/, user];\n }\n });\n });\n };\n UsersStore.prototype.inviteByEmail = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.inviteByEmail(userId)];\n case 1:\n user = _a.sent();\n this.updateInStore(user);\n return [2 /*return*/, user];\n }\n });\n });\n };\n UsersStore.prototype.getAllAdminsAndDispatchers = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var _this = this;\n return __generator(this, function (_a) {\n return [2 /*return*/, this.getOrFetchUsers(request, this.fetchedStatus.adminsAndDispatchers, function (isAllAdminsAndDispatchersFetched) {\n return (_this.fetchedStatus.adminsAndDispatchers = isAllAdminsAndDispatchersFetched);\n }, function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return (_a = _this.usersService).getAllAdminsAndDispatchers.apply(_a, __spreadArray([], __read(args), false));\n }, function () { return _this.getAllLocalAdminsAndDispatchers(); })];\n });\n });\n };\n UsersStore.prototype.getAllDrivers = function (request) {\n return __awaiter(this, void 0, void 0, function () {\n var options, response, isOnlyCustomer, isOnlyOnlineDrivers, groups;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n options = request.options;\n isOnlyCustomer = options === null || options === void 0 ? void 0 : options.onlyCustomers;\n isOnlyOnlineDrivers = options === null || options === void 0 ? void 0 : options.onlyOnlineDriver;\n if (!isOnlyCustomer) return [3 /*break*/, 2];\n return [4 /*yield*/, this.getOrFetchUsers(request, this.fetchedStatus.customers, function (isAllCustomersFetched) { return (_this.fetchedStatus.customers = isAllCustomersFetched); }, this.usersService.getAllDrivers, function () { return _this.getCustomers(); })];\n case 1:\n response = _a.sent();\n return [3 /*break*/, 4];\n case 2: return [4 /*yield*/, this.getOrFetchUsers(request, this.fetchedStatus.drivers, function (isAllDriversFetched) { return (_this.fetchedStatus.drivers = isAllDriversFetched); }, function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return (_a = _this.usersService).getAllDrivers.apply(_a, __spreadArray([], __read(args), false));\n }, function () { return (isOnlyOnlineDrivers ? __spreadArray([], __read(_this.getOnlineDrivers()), false) : __spreadArray([], __read(_this.getAllLocalDrivers()), false)); })];\n case 3:\n response = _a.sent();\n _a.label = 4;\n case 4:\n groups = isOnlyCustomer\n ? [User_consts_1.GROUP_VALUES.Customers]\n : isOnlyOnlineDrivers\n ? [User_consts_1.GROUP_VALUES.OnlineDrivers]\n : [User_consts_1.GROUP_VALUES.OfflineDrivers, User_consts_1.GROUP_VALUES.OnlineDrivers, User_consts_1.GROUP_VALUES.OnShiftDrivers];\n this.initGroups(response.users, groups);\n return [2 /*return*/, response];\n }\n });\n });\n };\n UsersStore.prototype.getOrFetchUsers = function (request, isFetchedFlag, setIsFetchedFlag, fetchUsers, getLocalUsers) {\n return __awaiter(this, void 0, void 0, function () {\n var response;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!isFetchedFlag) return [3 /*break*/, 2];\n return [4 /*yield*/, fetchUsers(request)];\n case 1:\n response = _a.sent();\n response.users.forEach(function (driver) { return _this.addToStore(driver); });\n if (!response.next_page_cursor && !response.previous_page_cursor) {\n setIsFetchedFlag(true);\n }\n return [2 /*return*/, response];\n case 2: return [2 /*return*/, {\n next_page_cursor: null,\n previous_page_cursor: null,\n users: getLocalUsers()\n }];\n }\n });\n });\n };\n UsersStore.prototype.byUserType = function (userTypeId) {\n return __awaiter(this, void 0, void 0, function () {\n var users;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.byUserType(userTypeId)];\n case 1:\n users = _a.sent();\n users.forEach(function (user) { return _this.addToStore(user); });\n return [2 /*return*/, users];\n }\n });\n });\n };\n UsersStore.prototype.makeAdmin = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.makeAdmin(userId)];\n case 1:\n user = _a.sent();\n this.updateInStore(user);\n return [2 /*return*/, user];\n }\n });\n });\n };\n UsersStore.prototype.update = function (userId, userDelta) {\n return __awaiter(this, void 0, void 0, function () {\n var user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.update(userId, userDelta)];\n case 1:\n user = _a.sent();\n this.updateInStore(user);\n return [2 /*return*/, user];\n }\n });\n });\n };\n UsersStore.prototype.delete = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var success;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.delete(userId)];\n case 1:\n success = _a.sent();\n if (success) {\n this.removeFromStore(userId);\n }\n return [2 /*return*/, success];\n }\n });\n });\n };\n UsersStore.prototype.get = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n var _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.getItem(id);\n if (_a) return [3 /*break*/, 2];\n return [4 /*yield*/, this.usersService.get(id)];\n case 1:\n _a = (_b.sent());\n _b.label = 2;\n case 2: return [2 /*return*/, _a];\n }\n });\n });\n };\n UsersStore.prototype.getMany = function (ids, commonOptions) {\n return __awaiter(this, void 0, void 0, function () {\n var idsSet, uniqIds, foundItems, missingIds, missingUsers, missingIdsChunks, concurrentChunks, concurrentChunks_1, concurrentChunks_1_1, concurrentChunk, promises, rejectReason, results, results_1, results_1_1, result, users, e_8_1;\n var e_8, _a, e_9, _b;\n var _this = this;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n idsSet = new Set(ids);\n uniqIds = Array.from(idsSet);\n foundItems = this.getItemsByIds(uniqIds);\n if (foundItems.length === uniqIds.length) {\n return [2 /*return*/, foundItems];\n }\n foundItems.forEach(function (user) { return idsSet.delete(user.id); });\n missingIds = Array.from(idsSet);\n missingUsers = [];\n missingIdsChunks = (0, chunk_1.default)(missingIds, exports.DEFAULT_CHUNK_SIZE);\n concurrentChunks = (0, chunk_1.default)(missingIdsChunks, exports.MAX_CONCURRENT_CHUNKED_REQUESTS);\n _c.label = 1;\n case 1:\n _c.trys.push([1, 6, 7, 8]);\n concurrentChunks_1 = __values(concurrentChunks), concurrentChunks_1_1 = concurrentChunks_1.next();\n _c.label = 2;\n case 2:\n if (!!concurrentChunks_1_1.done) return [3 /*break*/, 5];\n concurrentChunk = concurrentChunks_1_1.value;\n promises = concurrentChunk.map(function (idsChunk) { return __awaiter(_this, void 0, void 0, function () {\n var chunkResult;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.getMany({ usersIds: idsChunk }, commonOptions)];\n case 1:\n chunkResult = _a.sent();\n return [2 /*return*/, chunkResult.users];\n }\n });\n }); });\n // Rate limit to one set of requests per MIN_INTERVAL_BETWEEN_CHUNKED_REQUESTS\n if (concurrentChunk !== (0, last_1.default)(concurrentChunks)) {\n promises.push(new Promise(function (resolve) { return setTimeout(function () { return resolve([]); }, MIN_INTERVAL_BETWEEN_CHUNKED_REQUESTS); }));\n }\n rejectReason = null;\n return [4 /*yield*/, Promise.allSettled(promises)];\n case 3:\n results = _c.sent();\n try {\n for (results_1 = (e_9 = void 0, __values(results)), results_1_1 = results_1.next(); !results_1_1.done; results_1_1 = results_1.next()) {\n result = results_1_1.value;\n if (result.status === 'fulfilled') {\n users = result.value;\n missingUsers.push.apply(missingUsers, __spreadArray([], __read(users), false));\n this.addItems(users);\n }\n else {\n if (!rejectReason) {\n rejectReason = result.reason;\n }\n }\n }\n }\n catch (e_9_1) { e_9 = { error: e_9_1 }; }\n finally {\n try {\n if (results_1_1 && !results_1_1.done && (_b = results_1.return)) _b.call(results_1);\n }\n finally { if (e_9) throw e_9.error; }\n }\n if (rejectReason) {\n throw rejectReason;\n }\n _c.label = 4;\n case 4:\n concurrentChunks_1_1 = concurrentChunks_1.next();\n return [3 /*break*/, 2];\n case 5: return [3 /*break*/, 8];\n case 6:\n e_8_1 = _c.sent();\n e_8 = { error: e_8_1 };\n return [3 /*break*/, 8];\n case 7:\n try {\n if (concurrentChunks_1_1 && !concurrentChunks_1_1.done && (_a = concurrentChunks_1.return)) _a.call(concurrentChunks_1);\n }\n finally { if (e_8) throw e_8.error; }\n return [7 /*endfinally*/];\n case 8: return [2 /*return*/, foundItems.concat(missingUsers)];\n }\n });\n });\n };\n UsersStore.prototype.unlock = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.unlock(userId)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.assignedTasksCount = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.assignedTasksCount(userId)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.totalEmployeesCount = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.totalEmployeesCount()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.totalDriversCount = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.totalDriversCount()];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.getProfileImage = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.getProfileImage(userId)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.validatePhone = function (phone) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.validatePhone(phone)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n UsersStore.prototype.closedTasks = function (userId, page) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.usersService.closedTasks(userId, page)];\n case 1: return [2 /*return*/, _a.sent()]; // in future - add this tasks to store :)\n }\n });\n });\n };\n UsersStore.prototype.messageDriver = function (userId, message) {\n return this.usersService.messageDriver(userId, message);\n };\n UsersStore.prototype.subscribeToGroupUpdates = function (fn) {\n this.groupUpdateEvents.push(fn);\n };\n UsersStore.prototype.getOfflineDrivers = function () {\n return this.groupedValues.get(User_consts_1.GROUP_VALUES.OfflineDrivers) || new Set();\n };\n UsersStore.prototype.getOnlineDrivers = function () {\n return this.groupedValues.get(User_consts_1.GROUP_VALUES.OnlineDrivers) || new Set();\n };\n UsersStore.prototype.getOnShiftDrivers = function () {\n return Array.from(this.groupedValues.get(User_consts_1.GROUP_VALUES.OnShiftDrivers) || []);\n };\n UsersStore.prototype.getCustomers = function () {\n return Array.from(this.groupedValues.get(User_consts_1.GROUP_VALUES.Customers) || []);\n };\n UsersStore.prototype.getAdmins = function () {\n return Array.from(this.groupedValues.get(User_consts_1.GROUP_VALUES.Admins) || []);\n };\n UsersStore.prototype.getDispatchers = function () {\n return Array.from(this.groupedValues.get(User_consts_1.GROUP_VALUES.Dispatchers) || []);\n };\n UsersStore.prototype.emitGroupEvents = function () {\n var _this = this;\n this.groupUpdateEvents.forEach(function (fn) { return fn(_this.groupedValues); });\n };\n UsersStore.prototype.getAllLocalDrivers = function () {\n return this.drivers;\n };\n UsersStore.prototype.getOnlineDriversCountByTeam = function (teamId) {\n return this.onlineDriversCounterByTeam.get(teamId) || 0;\n };\n UsersStore.prototype.getAllLocalAdminsAndDispatchers = function () {\n return __spreadArray([], __read(new Set(this.getAdmins().concat(this.getDispatchers()))), false);\n };\n return UsersStore;\n}(BaseStore_1.default));\nexports[\"default\"] = UsersStore;\n//# sourceMappingURL=UsersStore.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/User/Store/UsersStore.js?");
3002
3002
 
3003
3003
  /***/ }),
3004
3004
 
@@ -7436,6 +7436,16 @@ eval("var constant = __webpack_require__(/*! ./constant */ \"./node_modules/loda
7436
7436
 
7437
7437
  /***/ }),
7438
7438
 
7439
+ /***/ "./node_modules/lodash/_baseSlice.js":
7440
+ /*!*******************************************!*\
7441
+ !*** ./node_modules/lodash/_baseSlice.js ***!
7442
+ \*******************************************/
7443
+ /***/ ((module) => {
7444
+
7445
+ eval("/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nmodule.exports = baseSlice;\n\n\n//# sourceURL=webpack://BringgDashboardSDK/./node_modules/lodash/_baseSlice.js?");
7446
+
7447
+ /***/ }),
7448
+
7439
7449
  /***/ "./node_modules/lodash/_baseTimes.js":
7440
7450
  /*!*******************************************!*\
7441
7451
  !*** ./node_modules/lodash/_baseTimes.js ***!
@@ -7456,6 +7466,16 @@ eval("var Symbol = __webpack_require__(/*! ./_Symbol */ \"./node_modules/lodash/
7456
7466
 
7457
7467
  /***/ }),
7458
7468
 
7469
+ /***/ "./node_modules/lodash/_baseTrim.js":
7470
+ /*!******************************************!*\
7471
+ !*** ./node_modules/lodash/_baseTrim.js ***!
7472
+ \******************************************/
7473
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7474
+
7475
+ eval("var trimmedEndIndex = __webpack_require__(/*! ./_trimmedEndIndex */ \"./node_modules/lodash/_trimmedEndIndex.js\");\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n\n\n//# sourceURL=webpack://BringgDashboardSDK/./node_modules/lodash/_baseTrim.js?");
7476
+
7477
+ /***/ }),
7478
+
7459
7479
  /***/ "./node_modules/lodash/_baseUnary.js":
7460
7480
  /*!*******************************************!*\
7461
7481
  !*** ./node_modules/lodash/_baseUnary.js ***!
@@ -7486,6 +7506,16 @@ eval("/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @
7486
7506
 
7487
7507
  /***/ }),
7488
7508
 
7509
+ /***/ "./node_modules/lodash/_castFunction.js":
7510
+ /*!**********************************************!*\
7511
+ !*** ./node_modules/lodash/_castFunction.js ***!
7512
+ \**********************************************/
7513
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7514
+
7515
+ eval("var identity = __webpack_require__(/*! ./identity */ \"./node_modules/lodash/identity.js\");\n\n/**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\nfunction castFunction(value) {\n return typeof value == 'function' ? value : identity;\n}\n\nmodule.exports = castFunction;\n\n\n//# sourceURL=webpack://BringgDashboardSDK/./node_modules/lodash/_castFunction.js?");
7516
+
7517
+ /***/ }),
7518
+
7489
7519
  /***/ "./node_modules/lodash/_castPath.js":
7490
7520
  /*!******************************************!*\
7491
7521
  !*** ./node_modules/lodash/_castPath.js ***!
@@ -8386,6 +8416,16 @@ eval("/** Used for built-in method references. */\nvar funcProto = Function.prot
8386
8416
 
8387
8417
  /***/ }),
8388
8418
 
8419
+ /***/ "./node_modules/lodash/_trimmedEndIndex.js":
8420
+ /*!*************************************************!*\
8421
+ !*** ./node_modules/lodash/_trimmedEndIndex.js ***!
8422
+ \*************************************************/
8423
+ /***/ ((module) => {
8424
+
8425
+ eval("/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n\n\n//# sourceURL=webpack://BringgDashboardSDK/./node_modules/lodash/_trimmedEndIndex.js?");
8426
+
8427
+ /***/ }),
8428
+
8389
8429
  /***/ "./node_modules/lodash/assignInWith.js":
8390
8430
  /*!*********************************************!*\
8391
8431
  !*** ./node_modules/lodash/assignInWith.js ***!
@@ -8406,6 +8446,16 @@ eval("var apply = __webpack_require__(/*! ./_apply */ \"./node_modules/lodash/_a
8406
8446
 
8407
8447
  /***/ }),
8408
8448
 
8449
+ /***/ "./node_modules/lodash/chunk.js":
8450
+ /*!**************************************!*\
8451
+ !*** ./node_modules/lodash/chunk.js ***!
8452
+ \**************************************/
8453
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8454
+
8455
+ eval("var baseSlice = __webpack_require__(/*! ./_baseSlice */ \"./node_modules/lodash/_baseSlice.js\"),\n isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ \"./node_modules/lodash/_isIterateeCall.js\"),\n toInteger = __webpack_require__(/*! ./toInteger */ \"./node_modules/lodash/toInteger.js\");\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil,\n nativeMax = Math.max;\n\n/**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\nfunction chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n}\n\nmodule.exports = chunk;\n\n\n//# sourceURL=webpack://BringgDashboardSDK/./node_modules/lodash/chunk.js?");
8456
+
8457
+ /***/ }),
8458
+
8409
8459
  /***/ "./node_modules/lodash/cloneDeep.js":
8410
8460
  /*!******************************************!*\
8411
8461
  !*** ./node_modules/lodash/cloneDeep.js ***!
@@ -8456,6 +8506,16 @@ eval("var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ \"./node_modul
8456
8506
 
8457
8507
  /***/ }),
8458
8508
 
8509
+ /***/ "./node_modules/lodash/forEach.js":
8510
+ /*!****************************************!*\
8511
+ !*** ./node_modules/lodash/forEach.js ***!
8512
+ \****************************************/
8513
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8514
+
8515
+ eval("var arrayEach = __webpack_require__(/*! ./_arrayEach */ \"./node_modules/lodash/_arrayEach.js\"),\n baseEach = __webpack_require__(/*! ./_baseEach */ \"./node_modules/lodash/_baseEach.js\"),\n castFunction = __webpack_require__(/*! ./_castFunction */ \"./node_modules/lodash/_castFunction.js\"),\n isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\");\n\n/**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\nfunction forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, castFunction(iteratee));\n}\n\nmodule.exports = forEach;\n\n\n//# sourceURL=webpack://BringgDashboardSDK/./node_modules/lodash/forEach.js?");
8516
+
8517
+ /***/ }),
8518
+
8459
8519
  /***/ "./node_modules/lodash/get.js":
8460
8520
  /*!************************************!*\
8461
8521
  !*** ./node_modules/lodash/get.js ***!
@@ -8676,6 +8736,16 @@ eval("var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ \"./node_m
8676
8736
 
8677
8737
  /***/ }),
8678
8738
 
8739
+ /***/ "./node_modules/lodash/last.js":
8740
+ /*!*************************************!*\
8741
+ !*** ./node_modules/lodash/last.js ***!
8742
+ \*************************************/
8743
+ /***/ ((module) => {
8744
+
8745
+ eval("/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n}\n\nmodule.exports = last;\n\n\n//# sourceURL=webpack://BringgDashboardSDK/./node_modules/lodash/last.js?");
8746
+
8747
+ /***/ }),
8748
+
8679
8749
  /***/ "./node_modules/lodash/lodash.js":
8680
8750
  /*!***************************************!*\
8681
8751
  !*** ./node_modules/lodash/lodash.js ***!
@@ -8756,6 +8826,36 @@ eval("var escape = __webpack_require__(/*! ./escape */ \"./node_modules/lodash/e
8756
8826
 
8757
8827
  /***/ }),
8758
8828
 
8829
+ /***/ "./node_modules/lodash/toFinite.js":
8830
+ /*!*****************************************!*\
8831
+ !*** ./node_modules/lodash/toFinite.js ***!
8832
+ \*****************************************/
8833
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8834
+
8835
+ eval("var toNumber = __webpack_require__(/*! ./toNumber */ \"./node_modules/lodash/toNumber.js\");\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_INTEGER = 1.7976931348623157e+308;\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n}\n\nmodule.exports = toFinite;\n\n\n//# sourceURL=webpack://BringgDashboardSDK/./node_modules/lodash/toFinite.js?");
8836
+
8837
+ /***/ }),
8838
+
8839
+ /***/ "./node_modules/lodash/toInteger.js":
8840
+ /*!******************************************!*\
8841
+ !*** ./node_modules/lodash/toInteger.js ***!
8842
+ \******************************************/
8843
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8844
+
8845
+ eval("var toFinite = __webpack_require__(/*! ./toFinite */ \"./node_modules/lodash/toFinite.js\");\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\nmodule.exports = toInteger;\n\n\n//# sourceURL=webpack://BringgDashboardSDK/./node_modules/lodash/toInteger.js?");
8846
+
8847
+ /***/ }),
8848
+
8849
+ /***/ "./node_modules/lodash/toNumber.js":
8850
+ /*!*****************************************!*\
8851
+ !*** ./node_modules/lodash/toNumber.js ***!
8852
+ \*****************************************/
8853
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8854
+
8855
+ eval("var baseTrim = __webpack_require__(/*! ./_baseTrim */ \"./node_modules/lodash/_baseTrim.js\"),\n isObject = __webpack_require__(/*! ./isObject */ \"./node_modules/lodash/isObject.js\"),\n isSymbol = __webpack_require__(/*! ./isSymbol */ \"./node_modules/lodash/isSymbol.js\");\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n\n\n//# sourceURL=webpack://BringgDashboardSDK/./node_modules/lodash/toNumber.js?");
8856
+
8857
+ /***/ }),
8858
+
8759
8859
  /***/ "./node_modules/lodash/toString.js":
8760
8860
  /*!*****************************************!*\
8761
8861
  !*** ./node_modules/lodash/toString.js ***!