@bringg/dashboard-sdk 9.90.0 → 9.91.0-pre.1

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.
@@ -2668,7 +2668,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
2668
2668
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2669
2669
 
2670
2670
  "use strict";
2671
- 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 client_page_1 = __webpack_require__(/*! ../Core/Http/client-page */ \"./dist/Core/Http/client-page.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.90.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 var clientPage = (0, client_page_1.currentClientPage)();\n if (clientPage) {\n this.headers[client_page_1.CLIENT_PAGE_HEADER] = clientPage;\n }\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?");
2671
+ 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 client_page_1 = __webpack_require__(/*! ../Core/Http/client-page */ \"./dist/Core/Http/client-page.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.91.0-pre.1';\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 var clientPage = (0, client_page_1.currentClientPage)();\n if (clientPage) {\n this.headers[client_page_1.CLIENT_PAGE_HEADER] = clientPage;\n }\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?");
2672
2672
 
2673
2673
  /***/ }),
2674
2674
 
@@ -3075,7 +3075,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
3075
3075
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
3076
3076
 
3077
3077
  "use strict";
3078
- eval("\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 __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 __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.AVAILABLE_ATTRIBUTES_CACHE_TTL = void 0;\nvar light_data_store_1 = __importDefault(__webpack_require__(/*! ../Data/light-data-store */ \"./dist/Data/light-data-store.js\"));\nvar merge_mapper_1 = __webpack_require__(/*! ../Data/merge-mapper */ \"./dist/Data/merge-mapper.js\");\nvar data_store_1 = __importDefault(__webpack_require__(/*! ../data-store */ \"./dist/data-store.js\"));\nvar storable_data_service_1 = __importDefault(__webpack_require__(/*! ../storable-data-service */ \"./dist/storable-data-service.js\"));\nvar cached_item_1 = __webpack_require__(/*! ../utils/cached-item */ \"./dist/utils/cached-item.js\");\nvar task_managed_attributes_realtime_subscriptions_1 = __importDefault(__webpack_require__(/*! ./task-managed-attributes-realtime-subscriptions */ \"./dist/TaskManagedAttributes/task-managed-attributes-realtime-subscriptions.js\"));\nvar task_managed_attributes_service_1 = __importDefault(__webpack_require__(/*! ./task-managed-attributes-service */ \"./dist/TaskManagedAttributes/task-managed-attributes-service.js\"));\n// exported for testing only\nexports.AVAILABLE_ATTRIBUTES_CACHE_TTL = 1000 * 60 * 60; // 1 hour\nvar TaskManagedAttributesApi = /** @class */ (function () {\n function TaskManagedAttributesApi(session) {\n var _this = this;\n this.cachedAvailableAttributes = new cached_item_1.CachedItem({\n ttl: {\n ttlInMs: exports.AVAILABLE_ATTRIBUTES_CACHE_TTL\n }\n });\n this.dataStore = new data_store_1.default();\n var lightDataStore = new light_data_store_1.default();\n this.service = new task_managed_attributes_service_1.default(session);\n this.storableDataService = new storable_data_service_1.default(this.dataStore, function (managedAttribute) { return merge_mapper_1.mergeMapper.mergeIntoExisting(_this.dataStore, managedAttribute); }, [lightDataStore]);\n this.realtimeSubscriptions = new task_managed_attributes_realtime_subscriptions_1.default(session, this.dataStore, this.storableDataService);\n this.realtimeSubscriptions.updateStoreOnEvents();\n }\n TaskManagedAttributesApi.prototype.get = function (id) {\n return this.getByIds([id])[0];\n };\n TaskManagedAttributesApi.prototype.getByIds = function (ids) {\n return this.storableDataService.getFromStores(ids);\n };\n TaskManagedAttributesApi.prototype.getAll = function () {\n var attributes = this.cachedAvailableAttributes.get();\n return attributes;\n };\n TaskManagedAttributesApi.prototype.loadByIds = function (ids, commonOptions) {\n var _this = this;\n if (commonOptions === void 0) { commonOptions = { useCache: true }; }\n return this.storableDataService.loadMany('loadByIds', function (idsToLoad) { return __awaiter(_this, void 0, void 0, function () {\n var managedAttributes;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.service.loadByIds(idsToLoad, commonOptions)];\n case 1:\n managedAttributes = _a.sent();\n return [2 /*return*/, Object.entries(managedAttributes).map(function (_a) {\n var _b = __read(_a, 2), id = _b[0], managedAttribute = _b[1];\n managedAttribute.id = parseInt(id, 10);\n return managedAttribute;\n })];\n }\n });\n }); }, ids, commonOptions);\n };\n TaskManagedAttributesApi.prototype.getAvailableAttributes = function () {\n return __awaiter(this, void 0, void 0, function () {\n var attributes;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n attributes = this.cachedAvailableAttributes.get();\n if (!!attributes) return [3 /*break*/, 2];\n return [4 /*yield*/, this.service.getAvailableAttributes()];\n case 1:\n attributes = _a.sent();\n this.cachedAvailableAttributes.set(attributes);\n _a.label = 2;\n case 2: return [2 /*return*/, attributes];\n }\n });\n });\n };\n TaskManagedAttributesApi.prototype.onUpdate = function (callback) {\n return this.realtimeSubscriptions.onUpdate(callback);\n };\n TaskManagedAttributesApi.prototype.fetchAvailableAttributes = function (ids, commonOptions) {\n if (commonOptions === void 0) { commonOptions = { useCache: true }; }\n return __awaiter(this, void 0, void 0, function () {\n var attributes;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.loadByIds(ids, commonOptions)];\n case 1:\n _a.sent();\n return [4 /*yield*/, this.getAvailableAttributes()];\n case 2:\n attributes = _a.sent();\n return [2 /*return*/, attributes];\n }\n });\n });\n };\n TaskManagedAttributesApi.prototype.resetAllListeners = function () {\n this.realtimeSubscriptions.resetAllListeners();\n };\n return TaskManagedAttributesApi;\n}());\nexports[\"default\"] = TaskManagedAttributesApi;\n//# sourceMappingURL=task-managed-attributes-api.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/TaskManagedAttributes/task-managed-attributes-api.js?");
3078
+ eval("\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 __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 __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.AVAILABLE_ATTRIBUTES_CACHE_TTL = void 0;\nvar light_data_store_1 = __importDefault(__webpack_require__(/*! ../Data/light-data-store */ \"./dist/Data/light-data-store.js\"));\nvar merge_mapper_1 = __webpack_require__(/*! ../Data/merge-mapper */ \"./dist/Data/merge-mapper.js\");\nvar data_store_1 = __importDefault(__webpack_require__(/*! ../data-store */ \"./dist/data-store.js\"));\nvar storable_data_service_1 = __importDefault(__webpack_require__(/*! ../storable-data-service */ \"./dist/storable-data-service.js\"));\nvar cached_item_1 = __webpack_require__(/*! ../utils/cached-item */ \"./dist/utils/cached-item.js\");\nvar task_managed_attributes_realtime_subscriptions_1 = __importDefault(__webpack_require__(/*! ./task-managed-attributes-realtime-subscriptions */ \"./dist/TaskManagedAttributes/task-managed-attributes-realtime-subscriptions.js\"));\nvar task_managed_attributes_service_1 = __importDefault(__webpack_require__(/*! ./task-managed-attributes-service */ \"./dist/TaskManagedAttributes/task-managed-attributes-service.js\"));\n// exported for testing only\nexports.AVAILABLE_ATTRIBUTES_CACHE_TTL = 1000 * 60 * 60; // 1 hour\nvar TaskManagedAttributesApi = /** @class */ (function () {\n function TaskManagedAttributesApi(session) {\n var _this = this;\n this.cachedAvailableAttributes = new cached_item_1.CachedItem({\n ttl: {\n ttlInMs: exports.AVAILABLE_ATTRIBUTES_CACHE_TTL\n }\n });\n this.dataStore = new data_store_1.default();\n var lightDataStore = new light_data_store_1.default();\n this.service = new task_managed_attributes_service_1.default(session);\n this.storableDataService = new storable_data_service_1.default(this.dataStore, function (managedAttribute) { return merge_mapper_1.mergeMapper.mergeIntoExisting(_this.dataStore, managedAttribute); }, [lightDataStore]);\n this.realtimeSubscriptions = new task_managed_attributes_realtime_subscriptions_1.default(session, this.dataStore, this.storableDataService);\n this.realtimeSubscriptions.updateStoreOnEvents();\n }\n TaskManagedAttributesApi.prototype.get = function (id) {\n return this.getByIds([id])[0];\n };\n TaskManagedAttributesApi.prototype.getByIds = function (ids) {\n return this.storableDataService.getFromStores(ids);\n };\n TaskManagedAttributesApi.prototype.getAll = function () {\n var attributes = this.cachedAvailableAttributes.get();\n return attributes;\n };\n TaskManagedAttributesApi.prototype.loadByIds = function (ids, commonOptions) {\n var _this = this;\n if (commonOptions === void 0) { commonOptions = { useCache: true }; }\n return this.storableDataService.loadMany('loadByIds', function (idsToLoad) { return __awaiter(_this, void 0, void 0, function () {\n var managedAttributes;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.service.loadByIds(idsToLoad, commonOptions)];\n case 1:\n managedAttributes = _a.sent();\n return [2 /*return*/, Object.entries(managedAttributes).map(function (_a) {\n var _b = __read(_a, 2), id = _b[0], managedAttribute = _b[1];\n managedAttribute.id = parseInt(id, 10);\n return managedAttribute;\n })];\n }\n });\n }); }, ids, commonOptions);\n };\n TaskManagedAttributesApi.prototype.getAvailableAttributes = function () {\n return __awaiter(this, void 0, void 0, function () {\n var attributes;\n return __generator(this, function (_a) {\n attributes = this.cachedAvailableAttributes.get();\n if (attributes) {\n return [2 /*return*/, attributes];\n }\n if (!this.pendingAvailableAttributes) {\n this.pendingAvailableAttributes = this.requestAvailableAttributes();\n }\n return [2 /*return*/, this.pendingAvailableAttributes];\n });\n });\n };\n /**\n * The orders sharing this order's value for the merchant's family-key attribute, with the fields\n * the order page renders for each of them. Not cached: statuses and time windows change.\n *\n * @param taskId - the order whose family is requested\n * @returns `family: null` when the order belongs to no family\n * @throws BringgException with `statusCode` 409 when the service cannot resolve the family\n * @example\n * const { family } = await sdk.v2.taskManagedAttributes.getFamily(9750945);\n * const siblingIds = family?.members.map(member => member.task_id) ?? [];\n */\n TaskManagedAttributesApi.prototype.getFamily = function (taskId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.getFamily(taskId)];\n });\n });\n };\n TaskManagedAttributesApi.prototype.onUpdate = function (callback) {\n return this.realtimeSubscriptions.onUpdate(callback);\n };\n TaskManagedAttributesApi.prototype.fetchAvailableAttributes = function (ids, commonOptions) {\n if (commonOptions === void 0) { commonOptions = { useCache: true }; }\n return __awaiter(this, void 0, void 0, function () {\n var attributes;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.loadByIds(ids, commonOptions)];\n case 1:\n _a.sent();\n return [4 /*yield*/, this.getAvailableAttributes()];\n case 2:\n attributes = _a.sent();\n return [2 /*return*/, attributes];\n }\n });\n });\n };\n TaskManagedAttributesApi.prototype.resetAllListeners = function () {\n this.realtimeSubscriptions.resetAllListeners();\n };\n TaskManagedAttributesApi.prototype.requestAvailableAttributes = function () {\n return __awaiter(this, void 0, void 0, function () {\n var attributes;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, , 2, 3]);\n return [4 /*yield*/, this.service.getAvailableAttributes()];\n case 1:\n attributes = _a.sent();\n this.cachedAvailableAttributes.set(attributes);\n return [2 /*return*/, attributes];\n case 2:\n this.pendingAvailableAttributes = undefined;\n return [7 /*endfinally*/];\n case 3: return [2 /*return*/];\n }\n });\n });\n };\n return TaskManagedAttributesApi;\n}());\nexports[\"default\"] = TaskManagedAttributesApi;\n//# sourceMappingURL=task-managed-attributes-api.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/TaskManagedAttributes/task-managed-attributes-api.js?");
3079
3079
 
3080
3080
  /***/ }),
3081
3081
 
@@ -3097,7 +3097,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
3097
3097
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
3098
3098
 
3099
3099
  "use strict";
3100
- eval("\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 }));\nvar CrudService_1 = __importDefault(__webpack_require__(/*! ../Core/CrudService */ \"./dist/Core/CrudService.js\"));\nvar basePath = '/task-service/managed-attributes';\nvar TaskManagedAttributesService = /** @class */ (function () {\n function TaskManagedAttributesService(session) {\n this.service = new CrudService_1.default(session, 'managed-attributes', 'task-service');\n }\n TaskManagedAttributesService.prototype.loadByIds = function (ids, commonOptions) {\n if (commonOptions === void 0) { commonOptions = {}; }\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .post(basePath)\n .withPayload({\n task_ids: ids\n })\n .setException('failed to fetch managed attributes for requested tasks')\n .withCommonOptions(commonOptions)\n .invoke()];\n });\n });\n };\n TaskManagedAttributesService.prototype.getAvailableAttributes = function (commonOptions) {\n if (commonOptions === void 0) { commonOptions = {}; }\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .get(\"\".concat(basePath, \"/available\"))\n .setException('failed to fetch available managed attributes')\n .withCommonOptions(commonOptions)\n .invoke()];\n });\n });\n };\n return TaskManagedAttributesService;\n}());\nexports[\"default\"] = TaskManagedAttributesService;\n//# sourceMappingURL=task-managed-attributes-service.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/TaskManagedAttributes/task-managed-attributes-service.js?");
3100
+ eval("\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 }));\nvar CrudService_1 = __importDefault(__webpack_require__(/*! ../Core/CrudService */ \"./dist/Core/CrudService.js\"));\nvar basePath = '/task-service/managed-attributes';\nvar TaskManagedAttributesService = /** @class */ (function () {\n function TaskManagedAttributesService(session) {\n this.service = new CrudService_1.default(session, 'managed-attributes', 'task-service');\n }\n TaskManagedAttributesService.prototype.loadByIds = function (ids, commonOptions) {\n if (commonOptions === void 0) { commonOptions = {}; }\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .post(basePath)\n .withPayload({\n task_ids: ids\n })\n .setException('failed to fetch managed attributes for requested tasks')\n .withCommonOptions(commonOptions)\n .invoke()];\n });\n });\n };\n TaskManagedAttributesService.prototype.getAvailableAttributes = function (commonOptions) {\n if (commonOptions === void 0) { commonOptions = {}; }\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .get(\"\".concat(basePath, \"/available\"))\n .setException('failed to fetch available managed attributes')\n .withCommonOptions(commonOptions)\n .invoke()];\n });\n });\n };\n TaskManagedAttributesService.prototype.getFamily = function (taskId, commonOptions) {\n if (commonOptions === void 0) { commonOptions = {}; }\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.service.routeGenerator\n .get(\"\".concat(basePath, \"/family\"))\n .withQueryString({ task_id: taskId })\n .setException('failed to fetch the family of the task')\n .withCommonOptions(commonOptions)\n .invoke()];\n });\n });\n };\n return TaskManagedAttributesService;\n}());\nexports[\"default\"] = TaskManagedAttributesService;\n//# sourceMappingURL=task-managed-attributes-service.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./dist/TaskManagedAttributes/task-managed-attributes-service.js?");
3101
3101
 
3102
3102
  /***/ }),
3103
3103
 
@@ -3911,7 +3911,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n//#
3911
3911
  /***/ ((__unused_webpack_module, exports) => {
3912
3912
 
3913
3913
  "use strict";
3914
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ChartKind = exports.ToolName = void 0;\n/**\n * The tools whose arguments the client renders itself. Nothing executes them -\n * the call IS the payload - so a client parses the arguments off the call and\n * draws from them.\n */\nvar ToolName;\n(function (ToolName) {\n ToolName[\"CreateVisualization\"] = \"create_visualization\";\n ToolName[\"SuggestFollowupQuestions\"] = \"suggest_followup_questions\";\n})(ToolName || (exports.ToolName = ToolName = {}));\nvar ChartKind;\n(function (ChartKind) {\n ChartKind[\"Bar\"] = \"bar\";\n ChartKind[\"Line\"] = \"line\";\n ChartKind[\"Pie\"] = \"pie\";\n ChartKind[\"Area\"] = \"area\";\n ChartKind[\"Scatter\"] = \"scatter\";\n ChartKind[\"StackedBar\"] = \"stacked_bar\";\n})(ChartKind || (exports.ChartKind = ChartKind = {}));\n//# sourceMappingURL=tool_calls.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./node_modules/@bringg/common-utils/lib/agent_chat/analyst/tool_calls.js?");
3914
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ChartKind = exports.ToolName = void 0;\n/**\n * The tools whose arguments the client renders itself. Nothing executes them -\n * the call IS the payload - so a client parses the arguments off the call and\n * draws from them.\n */\nvar ToolName;\n(function (ToolName) {\n ToolName[\"CreateVisualization\"] = \"create_visualization\";\n ToolName[\"SuggestFollowupQuestions\"] = \"suggest_followup_questions\";\n ToolName[\"ExplainCalculation\"] = \"explain_calculation\";\n})(ToolName || (exports.ToolName = ToolName = {}));\nvar ChartKind;\n(function (ChartKind) {\n ChartKind[\"Bar\"] = \"bar\";\n /** `bar` turned on its side, for long category names or more categories than fit across the width. */\n ChartKind[\"HorizontalBar\"] = \"horizontal_bar\";\n /** One bar per category split into its series, for parts of a whole — `bar` puts them side by side instead. */\n ChartKind[\"StackedBar\"] = \"stacked_bar\";\n ChartKind[\"Line\"] = \"line\";\n /** A line with the space under it filled, for when the size of the total matters and not only its direction. */\n ChartKind[\"Area\"] = \"area\";\n ChartKind[\"Pie\"] = \"pie\";\n /** A pie with its center cut out, for when that center should carry the total. */\n ChartKind[\"Doughnut\"] = \"doughnut\";\n ChartKind[\"Scatter\"] = \"scatter\";\n /** A closed loop per series over the same measures, for comparing a few series across many measures at once. */\n ChartKind[\"Radar\"] = \"radar\";\n})(ChartKind || (exports.ChartKind = ChartKind = {}));\n//# sourceMappingURL=tool_calls.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./node_modules/@bringg/common-utils/lib/agent_chat/analyst/tool_calls.js?");
3915
3915
 
3916
3916
  /***/ }),
3917
3917
 
@@ -4043,7 +4043,7 @@ eval("\nvar __assign = (this && this.__assign) || function () {\n __assign =
4043
4043
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
4044
4044
 
4045
4045
  "use strict";
4046
- 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 __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.calculateLoadAggregations = calculateLoadAggregations;\nexports.calculateTasksMaxLoad = calculateTasksMaxLoad;\nvar types_1 = __webpack_require__(/*! @bringg/types */ \"./node_modules/@bringg/types/index.js\");\nvar cloneDeep_1 = __importDefault(__webpack_require__(/*! lodash/cloneDeep */ \"./node_modules/lodash/cloneDeep.js\"));\nvar groupBy_1 = __importDefault(__webpack_require__(/*! lodash/groupBy */ \"./node_modules/lodash/groupBy.js\"));\nvar isNil_1 = __importDefault(__webpack_require__(/*! lodash/isNil */ \"./node_modules/lodash/isNil.js\"));\nvar pick_1 = __importDefault(__webpack_require__(/*! lodash/pick */ \"./node_modules/lodash/pick.js\"));\nvar hierarchy_actions_1 = __webpack_require__(/*! ../task_inventories/hierarchy_actions */ \"./node_modules/@bringg/common-utils/lib/task_inventories/hierarchy_actions.js\");\nvar with_custom_status_1 = __webpack_require__(/*! ../task_inventories/with_custom_status */ \"./node_modules/@bringg/common-utils/lib/task_inventories/with_custom_status.js\");\nvar utils_1 = __webpack_require__(/*! ../utils */ \"./node_modules/@bringg/common-utils/lib/utils/index.js\");\nvar aggregation_types_1 = __webpack_require__(/*! ./aggregation_types */ \"./node_modules/@bringg/common-utils/lib/aggregators/aggregation_types.js\");\nvar task_inventories_load_aggregator_1 = __webpack_require__(/*! ./task_inventories_load_aggregator */ \"./node_modules/@bringg/common-utils/lib/aggregators/task_inventories_load_aggregator.js\");\nfunction sortTasks(tasks, tieBreakById) {\n // Tie-break on id only where cluster identity depends on task adjacency: callers fetch tasks\n // unordered, and every other path has to keep the caller's order for tied priorities\n return __spreadArray([], tasks, true).sort(function (a, b) { return a.priority - b.priority || (tieBreakById ? a.id - b.id : 0); });\n}\nfunction getTaskInventoriesFromTasks(tasks) {\n return tasks.flatMap(function (task, taskIndex) {\n var taskStatus = task.status;\n var clonedTaskInventories = (0, cloneDeep_1.default)(task.task_inventories || []);\n var nestedTaskInventories = (0, hierarchy_actions_1.buildTaskInventoriesHierarchy)(clonedTaskInventories);\n var taskInventoriesByWaypoint = (0, groupBy_1.default)(nestedTaskInventories, 'way_point_id');\n return __spreadArray([], (task.way_points || []), true).sort(function (a, b) { return a.position - b.position; })\n .flatMap(function (wayPoint) {\n var taskInventories = taskInventoriesByWaypoint[wayPoint.id] || [];\n return taskInventories\n .map(function (taskInventory) {\n var status;\n if (taskStatus === types_1.TaskStatus.Done ||\n (taskInventory.pending && !(0, isNil_1.default)(wayPoint.checkout_time))) {\n status = with_custom_status_1.TaskInventoryStatus.DONE;\n }\n else if (taskStatus === types_1.TaskStatus.Cancelled) {\n status = with_custom_status_1.TaskInventoryStatus.CANCELLED;\n }\n else {\n status = with_custom_status_1.TaskInventoryStatus.INCOMPLETED;\n }\n return __assign(__assign({ customerId: wayPoint.customer_id, taskIndex: taskIndex }, taskInventory), { status: status });\n })\n .sort(function (a, b) { return +a.pending - +b.pending; });\n });\n });\n}\nfunction subTree(taskInventory) {\n return __spreadArray([taskInventory], (taskInventory.inventories || []).flatMap(subTree), true);\n}\nfunction resolveMatchingFields(taskInventories, uniqueInventoryFields) {\n if (uniqueInventoryFields === null || uniqueInventoryFields === void 0 ? void 0 : uniqueInventoryFields.length) {\n return uniqueInventoryFields;\n }\n // Mirrors the starting-load fallback, which runs on the flattened rows, so both sides pair a\n // drop-off with the same pickup\n return taskInventories.flatMap(subTree).some(function (taskInventory) { return taskInventory.inventory_id; }) ? ['inventory_id'] : [];\n}\nfunction getTaskInventoriesOrderedByCustomers(taskInventories, splitClusters, uniqueInventoryFields, logger) {\n var clusterPosition = {};\n var clusterLastTaskIndex = {};\n var customerVisit = {};\n var taskInventoryToClusterPosition = {};\n var pickupPosition = {};\n var matchingFields = splitClusters ? resolveMatchingFields(taskInventories, uniqueInventoryFields) : [];\n if (logger) {\n var fieldsToPick_1 = ['id', 'task_id', 'way_point_id', 'customerId', 'pending'];\n logger('Sorted task inventories by customer', {\n task_inventories: taskInventories.map(function (ti) { return (0, pick_1.default)(ti, fieldsToPick_1); })\n });\n }\n var getVisitKey = function (_a) {\n var customerId = _a.customerId, taskIndex = _a.taskIndex, pending = _a.pending;\n var visit = customerVisit[customerId] || 0;\n var visitKey = \"\".concat(customerId, \":\").concat(visit);\n var lastTaskIndex = clusterLastTaskIndex[visitKey];\n var extendsVisit = (0, isNil_1.default)(lastTaskIndex) || taskIndex <= lastTaskIndex + 1;\n if (extendsVisit) {\n // A visit opens at its first stop, whatever its leg; after that only a load moves the\n // run forward. A drop-off back at the store is a return, so it must not let a later\n // pickup there stack onto the earlier load\n if (pending || (0, isNil_1.default)(lastTaskIndex)) {\n clusterLastTaskIndex[visitKey] = taskIndex;\n }\n return visitKey;\n }\n // Only a pickup opens a new visit. Deliveries to the same customer twice stay one cluster,\n // otherwise splitting them apart would raise the peak above what the vehicle ever carries\n if (!pending) {\n return visitKey;\n }\n // A stop elsewhere between two loads ends the cluster: the vehicle unloads in between,\n // so the second load must not stack onto the first one's\n var nextVisitKey = \"\".concat(customerId, \":\").concat(visit + 1);\n customerVisit[customerId] = visit + 1;\n clusterLastTaskIndex[nextVisitKey] = taskIndex;\n return nextVisitKey;\n };\n var positionAfterOwnPickup = function (taskInventory, position) {\n // The row can be a package parent carrying no key of its own, while the walk pairs its\n // children, so the whole subtree has to answer for where the row may sit\n var hashes = subTree(taskInventory)\n .map(function (row) { return (0, utils_1.generateHash)(row, matchingFields, false); })\n .filter(function (hash) { return !(0, isNil_1.default)(hash); });\n if (taskInventory.pending) {\n hashes.forEach(function (hash) {\n var _a;\n pickupPosition[hash] = Math.max((_a = pickupPosition[hash]) !== null && _a !== void 0 ? _a : position, position);\n });\n return position;\n }\n // Consolidating a drop-off must not pull it in front of its own pickup: the walk would\n // spend inventory it has not loaded yet and that deficit hides a later peak\n return hashes.reduce(function (latest, hash) { return ((0, isNil_1.default)(pickupPosition[hash]) ? latest : Math.max(latest, pickupPosition[hash])); }, position);\n };\n return taskInventories\n .map(function (taskInventory, index) {\n var clusterKey = splitClusters ? getVisitKey(taskInventory) : taskInventory.customerId;\n if ((0, isNil_1.default)(clusterPosition[clusterKey])) {\n clusterPosition[clusterKey] = index;\n }\n var position = clusterPosition[clusterKey];\n taskInventoryToClusterPosition[taskInventory.id] = splitClusters\n ? positionAfterOwnPickup(taskInventory, position)\n : position;\n return taskInventory;\n })\n .sort(function (x, y) { return taskInventoryToClusterPosition[x.id] - taskInventoryToClusterPosition[y.id]; });\n}\nfunction calculateLoadAggregations(aggregationTypes, _a) {\n var items = _a.items, field = _a.field, ignoreQuantity = _a.ignoreQuantity, isClusterMode = _a.isClusterMode, splitClustersBySequence = _a.splitClustersBySequence, uniqueInventoryFields = _a.uniqueInventoryFields, logger = _a.logger;\n var splitClusters = Boolean(isClusterMode && splitClustersBySequence);\n var sortedTasks = sortTasks(items, splitClusters);\n var plannedOrder = getTaskInventoriesFromTasks(sortedTasks);\n var taskInventories = isClusterMode\n ? getTaskInventoriesOrderedByCustomers(plannedOrder, splitClusters, uniqueInventoryFields, logger)\n : plannedOrder;\n if (logger) {\n var fieldsToPick_2 = [\n 'id',\n 'pending',\n field,\n 'original_quantity',\n 'task_id',\n 'way_point_id',\n 'inventory_id'\n ].concat(uniqueInventoryFields || []);\n logger(\"Prepared task inventories list before \".concat(field, \" load calculation when cluster mode is \").concat(isClusterMode, \" and split by sequence is \").concat(splitClusters), { task_inventories: taskInventories.map(function (ti) { return (0, pick_1.default)(ti, fieldsToPick_2); }) });\n }\n return (0, task_inventories_load_aggregator_1.calculateAggregations)(aggregationTypes, {\n items: taskInventories,\n field: field,\n ignoreQuantity: ignoreQuantity,\n uniqueInventoryFields: uniqueInventoryFields\n });\n}\nfunction calculateTasksMaxLoad(_a) {\n var items = _a.items, field = _a.field, ignoreQuantity = _a.ignoreQuantity, isClusterMode = _a.isClusterMode, splitClustersBySequence = _a.splitClustersBySequence, uniqueInventoryFields = _a.uniqueInventoryFields;\n var aggregationType = aggregation_types_1.AggregationTypes.MAX_LOAD;\n return calculateLoadAggregations([aggregationType], {\n items: items,\n field: field,\n ignoreQuantity: ignoreQuantity,\n isClusterMode: isClusterMode,\n splitClustersBySequence: splitClustersBySequence,\n uniqueInventoryFields: uniqueInventoryFields\n })[aggregationType];\n}\n//# sourceMappingURL=tasks_load_aggregators.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./node_modules/@bringg/common-utils/lib/aggregators/tasks_load_aggregators.js?");
4046
+ 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 __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.calculateLoadAggregations = calculateLoadAggregations;\nexports.calculateTasksMaxLoad = calculateTasksMaxLoad;\nvar types_1 = __webpack_require__(/*! @bringg/types */ \"./node_modules/@bringg/types/index.js\");\nvar cloneDeep_1 = __importDefault(__webpack_require__(/*! lodash/cloneDeep */ \"./node_modules/lodash/cloneDeep.js\"));\nvar groupBy_1 = __importDefault(__webpack_require__(/*! lodash/groupBy */ \"./node_modules/lodash/groupBy.js\"));\nvar isNil_1 = __importDefault(__webpack_require__(/*! lodash/isNil */ \"./node_modules/lodash/isNil.js\"));\nvar pick_1 = __importDefault(__webpack_require__(/*! lodash/pick */ \"./node_modules/lodash/pick.js\"));\nvar hierarchy_actions_1 = __webpack_require__(/*! ../task_inventories/hierarchy_actions */ \"./node_modules/@bringg/common-utils/lib/task_inventories/hierarchy_actions.js\");\nvar with_custom_status_1 = __webpack_require__(/*! ../task_inventories/with_custom_status */ \"./node_modules/@bringg/common-utils/lib/task_inventories/with_custom_status.js\");\nvar utils_1 = __webpack_require__(/*! ../utils */ \"./node_modules/@bringg/common-utils/lib/utils/index.js\");\nvar aggregation_types_1 = __webpack_require__(/*! ./aggregation_types */ \"./node_modules/@bringg/common-utils/lib/aggregators/aggregation_types.js\");\nvar task_inventories_load_aggregator_1 = __webpack_require__(/*! ./task_inventories_load_aggregator */ \"./node_modules/@bringg/common-utils/lib/aggregators/task_inventories_load_aggregator.js\");\nfunction sortTasks(tasks, tieBreakById) {\n // Tie-break on id only where cluster identity depends on task adjacency: callers fetch tasks\n // unordered, and every other path has to keep the caller's order for tied priorities. A missing\n // priority defaults to 0 because subtracting undefined yields NaN and costs the total order\n return __spreadArray([], tasks, true).sort(function (a, b) { var _a, _b; return ((_a = a.priority) !== null && _a !== void 0 ? _a : 0) - ((_b = b.priority) !== null && _b !== void 0 ? _b : 0) || (tieBreakById ? a.id - b.id : 0); });\n}\n// An order added to a sequenced route arrives as a pickup task and a drop-off task, so two stops\n// is the most that can sit unsequenced at the tail before their own order starts deciding the walk\nvar MAX_UNSEQUENCED_TAIL = 2;\nfunction hasAssignedSequence(task) {\n return !(0, isNil_1.default)(task.priority) && task.priority !== task.id;\n}\n// Hagmonia defaults a missing priority to the task id, so a non-null priority is not evidence of a\n// route order. Ids dwarf sequence ordinals, so a couple of defaults sort past every assigned one\n// and stay a known tail; anything else puts the walk back on creation order, which reports less\n// than the vehicle carries\nfunction hasRouteSequence(tasks) {\n var lastAssigned = -Infinity;\n var firstDefaulted = Infinity;\n var unsequenced = 0;\n for (var _i = 0, tasks_1 = tasks; _i < tasks_1.length; _i++) {\n var task = tasks_1[_i];\n if (hasAssignedSequence(task)) {\n lastAssigned = Math.max(lastAssigned, task.priority);\n }\n else if ((0, isNil_1.default)(task.priority)) {\n // A null priority has no place in the sort at all, so it cannot be trusted to sort last\n return false;\n }\n else {\n unsequenced += 1;\n firstDefaulted = Math.min(firstDefaulted, task.priority);\n }\n }\n return lastAssigned > -Infinity && unsequenced <= MAX_UNSEQUENCED_TAIL && firstDefaulted > lastAssigned;\n}\nfunction getTaskInventoriesFromTasks(tasks) {\n return tasks.flatMap(function (task, taskIndex) {\n var taskStatus = task.status;\n var clonedTaskInventories = (0, cloneDeep_1.default)(task.task_inventories || []);\n var nestedTaskInventories = (0, hierarchy_actions_1.buildTaskInventoriesHierarchy)(clonedTaskInventories);\n var taskInventoriesByWaypoint = (0, groupBy_1.default)(nestedTaskInventories, 'way_point_id');\n return __spreadArray([], (task.way_points || []), true).sort(function (a, b) { return a.position - b.position; })\n .flatMap(function (wayPoint) {\n var taskInventories = taskInventoriesByWaypoint[wayPoint.id] || [];\n return taskInventories\n .map(function (taskInventory) {\n var status;\n if (taskStatus === types_1.TaskStatus.Done ||\n (taskInventory.pending && !(0, isNil_1.default)(wayPoint.checkout_time))) {\n status = with_custom_status_1.TaskInventoryStatus.DONE;\n }\n else if (taskStatus === types_1.TaskStatus.Cancelled) {\n status = with_custom_status_1.TaskInventoryStatus.CANCELLED;\n }\n else {\n status = with_custom_status_1.TaskInventoryStatus.INCOMPLETED;\n }\n return __assign(__assign({ customerId: wayPoint.customer_id, taskIndex: taskIndex }, taskInventory), { status: status });\n })\n .sort(function (a, b) { return +a.pending - +b.pending; });\n });\n });\n}\nfunction subTree(taskInventory) {\n return __spreadArray([taskInventory], (taskInventory.inventories || []).flatMap(subTree), true);\n}\nfunction resolveMatchingFields(taskInventories, uniqueInventoryFields) {\n if (uniqueInventoryFields === null || uniqueInventoryFields === void 0 ? void 0 : uniqueInventoryFields.length) {\n return uniqueInventoryFields;\n }\n // Mirrors the starting-load fallback, which runs on the flattened rows, so both sides pair a\n // drop-off with the same pickup\n return taskInventories.flatMap(subTree).some(function (taskInventory) { return taskInventory.inventory_id; }) ? ['inventory_id'] : [];\n}\nfunction getTaskInventoriesOrderedByCustomers(taskInventories, splitClusters, uniqueInventoryFields, logger) {\n var clusterPosition = {};\n var clusterLastTaskIndex = {};\n var customerVisit = {};\n var taskInventoryToClusterPosition = {};\n var pickupPosition = {};\n var matchingFields = splitClusters ? resolveMatchingFields(taskInventories, uniqueInventoryFields) : [];\n if (logger) {\n var fieldsToPick_1 = ['id', 'task_id', 'way_point_id', 'customerId', 'pending'];\n logger('Sorted task inventories by customer', {\n task_inventories: taskInventories.map(function (ti) { return (0, pick_1.default)(ti, fieldsToPick_1); })\n });\n }\n var getVisitKey = function (_a) {\n var customerId = _a.customerId, taskIndex = _a.taskIndex, pending = _a.pending;\n var visit = customerVisit[customerId] || 0;\n var visitKey = \"\".concat(customerId, \":\").concat(visit);\n var lastTaskIndex = clusterLastTaskIndex[visitKey];\n var extendsVisit = (0, isNil_1.default)(lastTaskIndex) || taskIndex <= lastTaskIndex + 1;\n if (extendsVisit) {\n // A visit opens at its first stop, whatever its leg; after that only a load moves the\n // run forward. A drop-off back at the store is a return, so it must not let a later\n // pickup there stack onto the earlier load\n if (pending || (0, isNil_1.default)(lastTaskIndex)) {\n clusterLastTaskIndex[visitKey] = taskIndex;\n }\n return visitKey;\n }\n // A row past the visit's last load opens a new visit: the vehicle may have left in between,\n // and walking the row with the earlier visit would load or unload it somewhere else\n var nextVisitKey = \"\".concat(customerId, \":\").concat(visit + 1);\n customerVisit[customerId] = visit + 1;\n clusterLastTaskIndex[nextVisitKey] = taskIndex;\n return nextVisitKey;\n };\n var positionAfterOwnPickup = function (taskInventory, position) {\n // The row can be a package parent carrying no key of its own, while the walk pairs its\n // children, so the whole subtree has to answer for where the row may sit\n var hashes = subTree(taskInventory)\n .map(function (row) { return (0, utils_1.generateHash)(row, matchingFields, false); })\n .filter(function (hash) { return !(0, isNil_1.default)(hash); });\n if (taskInventory.pending) {\n hashes.forEach(function (hash) {\n var _a;\n pickupPosition[hash] = Math.max((_a = pickupPosition[hash]) !== null && _a !== void 0 ? _a : position, position);\n });\n return position;\n }\n // Consolidating a drop-off must not pull it in front of its own pickup: the walk would\n // spend inventory it has not loaded yet and that deficit hides a later peak\n return hashes.reduce(function (latest, hash) { return ((0, isNil_1.default)(pickupPosition[hash]) ? latest : Math.max(latest, pickupPosition[hash])); }, position);\n };\n return taskInventories\n .map(function (taskInventory, index) {\n var clusterKey = splitClusters ? getVisitKey(taskInventory) : taskInventory.customerId;\n if ((0, isNil_1.default)(clusterPosition[clusterKey])) {\n clusterPosition[clusterKey] = index;\n }\n var position = clusterPosition[clusterKey];\n taskInventoryToClusterPosition[taskInventory.id] = splitClusters\n ? positionAfterOwnPickup(taskInventory, position)\n : position;\n return taskInventory;\n })\n .sort(function (x, y) { return taskInventoryToClusterPosition[x.id] - taskInventoryToClusterPosition[y.id]; });\n}\nfunction calculateLoadAggregations(aggregationTypes, _a) {\n var items = _a.items, field = _a.field, ignoreQuantity = _a.ignoreQuantity, isClusterMode = _a.isClusterMode, splitClustersBySequence = _a.splitClustersBySequence, uniqueInventoryFields = _a.uniqueInventoryFields, logger = _a.logger;\n var splitRequested = Boolean(isClusterMode && splitClustersBySequence);\n var splitClusters = splitRequested && hasRouteSequence(items);\n if (logger && splitRequested && !splitClusters) {\n var taskIds = items.filter(function (task) { return !hasAssignedSequence(task); }).map(function (task) { return task.id; });\n if (taskIds.length) {\n logger('Split by sequence declined because these tasks have no assigned sequence', {\n task_ids: taskIds\n });\n }\n }\n // The tie-break follows the request, not the guard: dropping it on the fallback would leave the\n // order to the caller's fetch and make the reported load differ between two identical requests\n var sortedTasks = sortTasks(items, splitRequested);\n var plannedOrder = getTaskInventoriesFromTasks(sortedTasks);\n var taskInventories = isClusterMode\n ? getTaskInventoriesOrderedByCustomers(plannedOrder, splitClusters, uniqueInventoryFields, logger)\n : plannedOrder;\n if (logger) {\n var fieldsToPick_2 = [\n 'id',\n 'pending',\n field,\n 'original_quantity',\n 'task_id',\n 'way_point_id',\n 'inventory_id'\n ].concat(uniqueInventoryFields || []);\n logger(\"Prepared task inventories list before \".concat(field, \" load calculation when cluster mode is \").concat(isClusterMode, \" and split by sequence is \").concat(splitClusters), { task_inventories: taskInventories.map(function (ti) { return (0, pick_1.default)(ti, fieldsToPick_2); }) });\n }\n return (0, task_inventories_load_aggregator_1.calculateAggregations)(aggregationTypes, {\n items: taskInventories,\n field: field,\n ignoreQuantity: ignoreQuantity,\n uniqueInventoryFields: uniqueInventoryFields\n });\n}\nfunction calculateTasksMaxLoad(_a) {\n var items = _a.items, field = _a.field, ignoreQuantity = _a.ignoreQuantity, isClusterMode = _a.isClusterMode, splitClustersBySequence = _a.splitClustersBySequence, uniqueInventoryFields = _a.uniqueInventoryFields, logger = _a.logger;\n var aggregationType = aggregation_types_1.AggregationTypes.MAX_LOAD;\n return calculateLoadAggregations([aggregationType], {\n items: items,\n field: field,\n ignoreQuantity: ignoreQuantity,\n isClusterMode: isClusterMode,\n splitClustersBySequence: splitClustersBySequence,\n uniqueInventoryFields: uniqueInventoryFields,\n logger: logger\n })[aggregationType];\n}\n//# sourceMappingURL=tasks_load_aggregators.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./node_modules/@bringg/common-utils/lib/aggregators/tasks_load_aggregators.js?");
4047
4047
 
4048
4048
  /***/ }),
4049
4049
 
@@ -4296,7 +4296,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
4296
4296
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
4297
4297
 
4298
4298
  "use strict";
4299
- eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n__exportStar(__webpack_require__(/*! ./date_utils */ \"./node_modules/@bringg/common-utils/lib/utils/date_utils.js\"), exports);\n__exportStar(__webpack_require__(/*! ./hash_generator */ \"./node_modules/@bringg/common-utils/lib/utils/hash_generator.js\"), exports);\n__exportStar(__webpack_require__(/*! ./string-template */ \"./node_modules/@bringg/common-utils/lib/utils/string-template.js\"), exports);\n__exportStar(__webpack_require__(/*! ./task_utils */ \"./node_modules/@bringg/common-utils/lib/utils/task_utils.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./node_modules/@bringg/common-utils/lib/utils/index.js?");
4299
+ eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n__exportStar(__webpack_require__(/*! ./date_utils */ \"./node_modules/@bringg/common-utils/lib/utils/date_utils.js\"), exports);\n__exportStar(__webpack_require__(/*! ./hash_generator */ \"./node_modules/@bringg/common-utils/lib/utils/hash_generator.js\"), exports);\n__exportStar(__webpack_require__(/*! ./string-template */ \"./node_modules/@bringg/common-utils/lib/utils/string-template.js\"), exports);\n__exportStar(__webpack_require__(/*! ./task_utils */ \"./node_modules/@bringg/common-utils/lib/utils/task_utils.js\"), exports);\n__exportStar(__webpack_require__(/*! ./url_utils */ \"./node_modules/@bringg/common-utils/lib/utils/url_utils.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./node_modules/@bringg/common-utils/lib/utils/index.js?");
4300
4300
 
4301
4301
  /***/ }),
4302
4302
 
@@ -4322,6 +4322,17 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
4322
4322
 
4323
4323
  /***/ }),
4324
4324
 
4325
+ /***/ "./node_modules/@bringg/common-utils/lib/utils/url_utils.js":
4326
+ /*!******************************************************************!*\
4327
+ !*** ./node_modules/@bringg/common-utils/lib/utils/url_utils.js ***!
4328
+ \******************************************************************/
4329
+ /***/ ((__unused_webpack_module, exports) => {
4330
+
4331
+ "use strict";
4332
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.normalizeUrl = normalizeUrl;\nexports.isValidPublicUrl = isValidPublicUrl;\n// A DNS label: 1-63 chars, alphanumeric at both ends, hyphens only in between.\n// The optional group is what allows a 1-char label while still forbidding a\n// trailing hyphen, and {0,61} caps the label at 63 (1 + 61 + 1).\nvar LABEL_REGEX = '[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?';\n// Same shape, but the TLD must begin with a letter. That also rejects every\n// IPv4 literal, since a dotted quad's final label is numeric.\nvar TLD_REGEX = '[a-z](?:[a-z0-9-]{0,61}[a-z0-9])?';\n// Two or more labels, 253 chars max overall. Safe against a lowercased,\n// punycoded hostname only -- run URL.parse first, never raw input.\nvar HOSTNAME_REGEX = new RegExp(\"^(?=.{1,253}$)(?:\".concat(LABEL_REGEX, \"\\\\.)+\").concat(TLD_REGEX, \"$\"));\nvar IPV4 = /^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/;\n// IANA special-purpose IPv4 ranges: never valid as a public destination.\n// Ordered as in the registry; the CIDR sizes are the whole point, so the\n// /10, /12 and /15 entries are the ones worth having tests around.\n/* eslint-disable @typescript-eslint/no-magic-numbers */\nvar RESERVED_V4 = [\n ['0.0.0.0', 8], // \"this network\"\n ['10.0.0.0', 8], // private\n ['100.64.0.0', 10], // carrier-grade NAT\n ['127.0.0.0', 8], // loopback\n ['169.254.0.0', 16], // link-local, incl. cloud metadata\n ['172.16.0.0', 12], // private\n ['192.0.0.0', 24], // IETF protocol assignments\n ['192.0.2.0', 24], // TEST-NET-1\n ['192.88.99.0', 24], // 6to4 relay anycast (deprecated)\n ['192.168.0.0', 16], // private\n ['198.18.0.0', 15], // benchmarking\n ['198.51.100.0', 24], // TEST-NET-2\n ['203.0.113.0', 24], // TEST-NET-3\n ['224.0.0.0', 4], // multicast\n ['240.0.0.0', 4] // reserved, incl. 255.255.255.255 broadcast\n];\n/* eslint-enable @typescript-eslint/no-magic-numbers */\nfunction normalizeUrl(value) {\n var _a, _b;\n return (_b = (_a = parseUrl(value)) === null || _a === void 0 ? void 0 : _a.href) !== null && _b !== void 0 ? _b : value;\n}\n/**\n * NOTE: there is another `isUrl` validation missaligned with this one in bringg-frontend/libs/features/sendbird-chat/src/components/channel-conversation/components/message-content/utils.ts\n * Considering it's very different and will produce a lot of false-positves, I didn't align it here; still worth being recorded\n * Known gaps:\n * nonexistent TLD: 'http://example.invalid'\n * reserved TLD: 'http://foo.test'\n */\nfunction isValidPublicUrl(value) {\n var url = parseUrl(value);\n if (!url) {\n return false;\n }\n if (url.protocol !== 'https:' && url.protocol !== 'http:') {\n return false;\n }\n // credential-stuffing vector\n if (url.username || url.password) {\n return false;\n }\n if (IPV4.test(url.hostname)) {\n return isPublicIPv4(url.hostname);\n }\n return HOSTNAME_REGEX.test(url.hostname);\n}\nvar IPV4_OCTET_MAX = 255;\nvar IPV4_OCTET_RADIX = 256;\nvar IPV4_BIT_WIDTH = 32;\nvar IPV4_ALL_ONES = 0xffffffff;\nvar RESERVED_V4_MASKED = RESERVED_V4.map(function (_a) {\n var base = _a[0], bits = _a[1];\n var mask = (IPV4_ALL_ONES << (IPV4_BIT_WIDTH - bits)) >>> 0;\n return [(toUint32(base) & mask) >>> 0, mask];\n});\nfunction parseUrl(value) {\n try {\n return new URL(value);\n }\n catch (_a) {\n return null;\n }\n}\n// Only ever called with a hostname URL.parse produced, so the dotted quad is\n// already canonical -- 0x7f.1, 2130706433 and 0177.0.0.1 all arrive as 127.0.0.1\nfunction isPublicIPv4(hostname) {\n var octets = hostname.split('.');\n if (octets.some(function (o) { return Number(o) > IPV4_OCTET_MAX; })) {\n return false;\n }\n var n = toUint32(hostname);\n return !RESERVED_V4_MASKED.some(function (_a) {\n var base = _a[0], mask = _a[1];\n return (n & mask) >>> 0 === base;\n });\n}\nfunction toUint32(quad) {\n return quad.split('.').reduce(function (acc, oct) { return acc * IPV4_OCTET_RADIX + Number(oct); }, 0);\n}\n//# sourceMappingURL=url_utils.js.map\n\n//# sourceURL=webpack://BringgDashboardSDK/./node_modules/@bringg/common-utils/lib/utils/url_utils.js?");
4333
+
4334
+ /***/ }),
4335
+
4325
4336
  /***/ "./node_modules/@bringg/types/index.js":
4326
4337
  /*!*********************************************!*\
4327
4338
  !*** ./node_modules/@bringg/types/index.js ***!