diff --git a/dist/apisearch.js b/dist/apisearch.js index bafba0b..62b802d 100644 --- a/dist/apisearch.js +++ b/dist/apisearch.js @@ -522,7 +522,7 @@ Axios.prototype.request = function request(config) { }, arguments[1]); } - config = utils.merge(defaults, this.defaults, { method: 'get' }, config); + config = utils.merge(defaults, {method: 'get'}, this.defaults, config); config.method = config.method.toLowerCase(); // Hook up interceptors middleware @@ -939,6 +939,10 @@ var defaults = { return data; }], + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ timeout: 0, xsrfCookieName: 'XSRF-TOKEN', @@ -1093,9 +1097,7 @@ module.exports = function buildURL(url, params, paramsSerializer) { if (utils.isArray(val)) { key = key + '[]'; - } - - if (!utils.isArray(val)) { + } else { val = [val]; } @@ -4671,6 +4673,18 @@ var Item = /** @class */ (function () { Item.prototype.composeUUID = function () { return this.uuid.composedUUID(); }; + /** + * Get path by field. + * + * @param field + * + * @returns {string} + */ + Item.getPathByField = function (field) { + return (["id", "type"].indexOf(field) > -1) + ? "uuid." + field + : "indexed_metadata." + field; + }; return Item; }()); exports.Item = Item; @@ -5269,18 +5283,6 @@ var Filter = /** @class */ (function () { } return Filter.create(array.field, array.values, array.application_type, array.filter_type, array.filter_terms); }; - /** - * Get path by field. - * - * @param field - * - * @returns {string} - */ - Filter.getFilterPathByField = function (field) { - return (["id", "type"].indexOf(field) > -1) - ? "uuid." + field - : "indexed_metadata." + field; - }; return Filter; }()); exports.Filter = Filter; @@ -5301,6 +5303,7 @@ exports.__esModule = true; var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); var Coordinate_1 = __webpack_require__(/*! ../Model/Coordinate */ "./src/Model/Coordinate.ts"); var ItemUUID_1 = __webpack_require__(/*! ../Model/ItemUUID */ "./src/Model/ItemUUID.ts"); +var Item_1 = __webpack_require__(/*! ../Model/Item */ "./src/Model/Item.ts"); var User_1 = __webpack_require__(/*! ../Model/User */ "./src/Model/User.ts"); var Aggregation_1 = __webpack_require__(/*! ./Aggregation */ "./src/Query/Aggregation.ts"); var Filter_1 = __webpack_require__(/*! ./Filter */ "./src/Query/Filter.ts"); @@ -5308,7 +5311,7 @@ var Filter_2 = __webpack_require__(/*! ./Filter */ "./src/Query/Filter.ts"); var Aggregation_2 = __webpack_require__(/*! ./Aggregation */ "./src/Query/Aggregation.ts"); var InvalidFormatError_1 = __webpack_require__(/*! ../Error/InvalidFormatError */ "./src/Error/InvalidFormatError.ts"); var Filter_3 = __webpack_require__(/*! ./Filter */ "./src/Query/Filter.ts"); -var ScoreStrategy_1 = __webpack_require__(/*! ./ScoreStrategy */ "./src/Query/ScoreStrategy.ts"); +var ScoreStrategies_1 = __webpack_require__(/*! ./ScoreStrategies */ "./src/Query/ScoreStrategies.ts"); var SortBy_1 = __webpack_require__(/*! ./SortBy */ "./src/Query/SortBy.ts"); /** * Query constants @@ -5333,6 +5336,10 @@ var Query = /** @class */ (function () { this.filters = {}; this.itemsPromoted = []; this.aggregations = {}; + this.resultsEnabled = true; + this.aggregationsEnabled = true; + this.suggestionsEnabled = false; + this.highlightsEnabled = false; this.filterFields = []; this.minScore = exports.NO_MIN_SCORE; this.sortByInstance = SortBy_1.SortBy.create(); @@ -5442,7 +5449,7 @@ var Query = /** @class */ (function () { */ Query.prototype.filterUniverseByTypes = function (values) { var _a; - var fieldPath = Filter_1.Filter.getFilterPathByField("type"); + var fieldPath = Item_1.Item.getPathByField("type"); if (values.length > 0) { this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a["type"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a)); } @@ -5464,7 +5471,7 @@ var Query = /** @class */ (function () { if (aggregate === void 0) { aggregate = true; } if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; } var _a, _b; - var fieldPath = Filter_1.Filter.getFilterPathByField("type"); + var fieldPath = Item_1.Item.getPathByField("type"); if (values.length > 0) { this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a["type"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a)); } @@ -5485,7 +5492,7 @@ var Query = /** @class */ (function () { */ Query.prototype.filterUniverseByIds = function (values) { var _a; - var fieldPath = Filter_1.Filter.getFilterPathByField("id"); + var fieldPath = Item_1.Item.getPathByField("id"); if (values.length > 0) { this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a["id"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a)); } @@ -5503,7 +5510,7 @@ var Query = /** @class */ (function () { */ Query.prototype.filterByIds = function (values) { var _a; - var fieldPath = Filter_1.Filter.getFilterPathByField("id"); + var fieldPath = Item_1.Item.getPathByField("id"); if (values.length > 0) { this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a["id"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a)); } @@ -5524,7 +5531,7 @@ var Query = /** @class */ (function () { Query.prototype.filterUniverseBy = function (field, values, applicationType) { if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; } var _a; - var fieldPath = Filter_1.Filter.getFilterPathByField(field); + var fieldPath = Item_1.Item.getPathByField(field); if (values.length > 0) { this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[field] = Filter_1.Filter.create(fieldPath, values, applicationType, Filter_2.FILTER_TYPE_FIELD), _a)); } @@ -5550,7 +5557,7 @@ var Query = /** @class */ (function () { if (aggregate === void 0) { aggregate = true; } if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; } var _a; - var fieldPath = Filter_1.Filter.getFilterPathByField(field); + var fieldPath = Item_1.Item.getPathByField(field); if (values.length > 0) { this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[filterName] = Filter_1.Filter.create(fieldPath, values, applicationType, Filter_2.FILTER_TYPE_FIELD), _a)); } @@ -5576,7 +5583,7 @@ var Query = /** @class */ (function () { if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; } if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; } var _a; - var fieldPath = Filter_1.Filter.getFilterPathByField(field); + var fieldPath = Item_1.Item.getPathByField(field); if (values.length > 0) { this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[field] = Filter_1.Filter.create(fieldPath, values, applicationType, rangeType), _a)); } @@ -5618,7 +5625,7 @@ var Query = /** @class */ (function () { if (aggregate === void 0) { aggregate = true; } if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; } var _a; - var fieldPath = Filter_1.Filter.getFilterPathByField(field); + var fieldPath = Item_1.Item.getPathByField(field); if (values.length !== 0) { this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[filterName] = Filter_1.Filter.create(fieldPath, values, applicationType, rangeType), _a)); } @@ -5712,7 +5719,7 @@ var Query = /** @class */ (function () { if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; } if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; } var _a; - this.aggregations = tslib_1.__assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Filter_1.Filter.getFilterPathByField(field), applicationType, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort, limit), _a)); + this.aggregations = tslib_1.__assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Item_1.Item.getPathByField(field), applicationType, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort, limit), _a)); return this; }; /** @@ -5736,7 +5743,7 @@ var Query = /** @class */ (function () { if (options.length === 0) { return this; } - this.aggregations = tslib_1.__assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Filter_1.Filter.getFilterPathByField(field), applicationType, rangeType, options, aggregationSort, limit), _a)); + this.aggregations = tslib_1.__assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Item_1.Item.getPathByField(field), applicationType, rangeType, options, aggregationSort, limit), _a)); return this; }; /** @@ -5835,7 +5842,7 @@ var Query = /** @class */ (function () { * @return {Filter|null} */ Query.prototype.getFilterByField = function (fieldName) { - var fieldPath = Filter_1.Filter.getFilterPathByField(fieldName); + var fieldPath = Item_1.Item.getPathByField(fieldName); for (var i in this.filters) { if (this.filters[i].getField() == fieldPath) { return this.filters[i]; @@ -6043,20 +6050,20 @@ var Query = /** @class */ (function () { return this; }; /** - * Get score strategy + * Get score strategies * - * @return {ScoreStrategy} + * @return {ScoreStrategies} */ - Query.prototype.getScoreStrategy = function () { - return this.scoreStrategy; + Query.prototype.getScoreStrategies = function () { + return this.scoreStrategies; }; /** - * Set score strategy + * Set score strategies * - * @param scoreStrategy + * @param scoreStrategies */ - Query.prototype.setScoreStrategy = function (scoreStrategy) { - this.scoreStrategy = scoreStrategy; + Query.prototype.setScoreStrategies = function (scoreStrategies) { + this.scoreStrategies = scoreStrategies; return this; }; /** @@ -6232,12 +6239,12 @@ var Query = /** @class */ (function () { array.filter_fields = this.filterFields; } /** - * Score strategy + * Score strategies */ - if (this.scoreStrategy instanceof ScoreStrategy_1.ScoreStrategy) { - var scoreStrategyAsArray = this.scoreStrategy.toArray(); - if (Object.keys(scoreStrategyAsArray).length > 0) { - array.score_strategy = scoreStrategyAsArray; + if (this.scoreStrategies instanceof ScoreStrategies_1.ScoreStrategies) { + var scoreStrategiesAsArray = this.scoreStrategies.toArray(); + if (Object.keys(scoreStrategiesAsArray).length > 0) { + array.score_strategies = scoreStrategiesAsArray; } } if (this.fuzziness !== null) { @@ -6359,8 +6366,8 @@ var Query = /** @class */ (function () { query.filterFields = array.filter_fields instanceof Array ? array.filter_fields : []; - query.scoreStrategy = array.score_strategy instanceof Object - ? ScoreStrategy_1.ScoreStrategy.createFromArray(array.score_stategy) + query.scoreStrategies = array.score_strategies instanceof Object + ? ScoreStrategies_1.ScoreStrategies.createFromArray(array.score_strategies) : null; query.user = array.user instanceof Object ? User_1.User.createFromArray(array.user) @@ -6456,6 +6463,117 @@ var Range = /** @class */ (function () { exports.Range = Range; +/***/ }), + +/***/ "./src/Query/ScoreStrategies.ts": +/*!**************************************!*\ + !*** ./src/Query/ScoreStrategies.ts ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +exports.__esModule = true; +var ScoreStrategy_1 = __webpack_require__(/*! ./ScoreStrategy */ "./src/Query/ScoreStrategy.ts"); +/** + * ScoreStrategies constants + */ +exports.MULTIPLY = 'multiply'; +exports.SUM = 'sum'; +exports.AVG = 'avg'; +exports.MAX = 'max'; +exports.MIN = 'min'; +/** + * ScoreStrategies + */ +var ScoreStrategies = /** @class */ (function () { + function ScoreStrategies() { + this.scoreStrategies = []; + } + /** + * Create empty + * + * @param scoreMode + * + * @return {ScoreStrategies} + */ + ScoreStrategies.createEmpty = function (scoreMode) { + if (scoreMode === void 0) { scoreMode = exports.SUM; } + var scoreStrategies = new ScoreStrategies; + scoreStrategies.scoreMode = scoreMode; + return scoreStrategies; + }; + /** + * Add score strategy + * + * @param scoreStrategy + * + * @return {ScoreStrategies} + */ + ScoreStrategies.prototype.addScoreStrategy = function (scoreStrategy) { + this.scoreStrategies.push(scoreStrategy); + return this; + }; + /** + * Get score strategies + * + * @return {ScoreStrategy[]} + */ + ScoreStrategies.prototype.getScoreStrategies = function () { + return this.scoreStrategies; + }; + /** + * Get score mode + * + * @return {string} + */ + ScoreStrategies.prototype.getScoreMode = function () { + return this.scoreMode; + }; + /** + * To array + * + * @return {{ + * score_mode: string, + * score_strategies: any + * }} + */ + ScoreStrategies.prototype.toArray = function () { + var scoreStrategiesAsArray = []; + for (var i in this.scoreStrategies) { + scoreStrategiesAsArray.push(this.scoreStrategies[i].toArray()); + } + return { + score_mode: this.scoreMode, + score_strategies: scoreStrategiesAsArray + }; + }; + /** + * Create from array + * + * @param array + * + * @return {ScoreStrategies} + */ + ScoreStrategies.createFromArray = function (array) { + array = JSON.parse(JSON.stringify(array)); + var scoreStrategies = (typeof array.score_mode != "undefined") + ? ScoreStrategies.createEmpty(array.score_mode) + : ScoreStrategies.createEmpty(); + scoreStrategies.scoreStrategies = []; + for (var i in array.score_strategies) { + scoreStrategies + .scoreStrategies + .push(ScoreStrategy_1.ScoreStrategy.createFromArray(array.score_strategies[i])); + } + return scoreStrategies; + }; + return ScoreStrategies; +}()); +exports.ScoreStrategies = ScoreStrategies; + + /***/ }), /***/ "./src/Query/ScoreStrategy.ts": @@ -6468,35 +6586,84 @@ exports.Range = Range; "use strict"; exports.__esModule = true; +var Item_1 = __webpack_require__(/*! ../Model/Item */ "./src/Model/Item.ts"); +var Filter_1 = __webpack_require__(/*! ./Filter */ "./src/Query/Filter.ts"); /** - * Aggregation constants + * ScoreStrategy constants */ -exports.SCORE_STRATEGY_DEFAULT = 0; -exports.SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD = 1; -exports.SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION = 2; +exports.DEFAULT_TYPE = 'default'; +exports.DEFAULT_WEIGHT = 1.0; +exports.BOOSTING_FIELD_VALUE = 'field_value'; +exports.CUSTOM_FUNCTION = 'custom_function'; +exports.DECAY = 'decay'; +exports.DECAY_LINEAR = 'linear'; +exports.DECAY_EXP = 'exp'; +exports.DECAY_GAUSS = 'gauss'; +exports.MODIFIER_NONE = 'none'; +exports.MODIFIER_SQRT = 'sqrt'; +exports.MODIFIER_LOG = 'log'; +exports.MODIFIER_LN = 'ln'; +exports.MODIFIER_SQUARE = 'square'; +exports.SCORE_MODE_NONE = 'none'; +exports.SCORE_MODE_SUM = 'sum'; +exports.SCORE_MODE_AVG = 'avg'; +exports.SCORE_MODE_MAX = 'max'; +exports.SCORE_MODE_MIN = 'min'; +exports.DEFAULT_MISSING = 1.0; +exports.DEFAULT_FACTOR = 1.0; /** * ScoreStrategy */ var ScoreStrategy = /** @class */ (function () { function ScoreStrategy() { - this.type = exports.SCORE_STRATEGY_DEFAULT; - this.innerFunction = null; + this.type = exports.DEFAULT_TYPE; + this.filter = null; + this.weight = exports.DEFAULT_WEIGHT; + this.scoreMode = exports.SCORE_MODE_AVG; + this.configuration = {}; } /** * Get type * - * @returns {number} + * @returns {string} */ ScoreStrategy.prototype.getType = function () { return this.type; }; /** - * Get function + * Get configuration value * * @returns {string} */ - ScoreStrategy.prototype.getFunction = function () { - return this.innerFunction; + ScoreStrategy.prototype.getConfigurationValue = function (element) { + if (typeof this.configuration[element] == "undefined") { + return null; + } + return this.configuration[element]; + }; + /** + * Get weight. + * + * @return {number} + */ + ScoreStrategy.prototype.getWeight = function () { + return this.weight; + }; + /** + * Get score mode. + * + * @return {string} + */ + ScoreStrategy.prototype.getScoreMode = function () { + return this.scoreMode; + }; + /** + * Get filter. + * + * @return {Filter} + */ + ScoreStrategy.prototype.getFilter = function () { + return this.filter; }; /** * Create default @@ -6507,36 +6674,125 @@ var ScoreStrategy = /** @class */ (function () { return new ScoreStrategy(); }; /** - * Create relevance boosting + * Create field boosting + * + * @param field + * @param factor + * @param missing + * @param modifier + * @param weight + * @param filter + * @param scoreMode + * + * @return {ScoreStrategy} + */ + ScoreStrategy.createFieldBoosting = function (field, factor, missing, modifier, weight, filter, scoreMode) { + if (factor === void 0) { factor = exports.DEFAULT_FACTOR; } + if (missing === void 0) { missing = exports.DEFAULT_MISSING; } + if (modifier === void 0) { modifier = exports.MODIFIER_NONE; } + if (weight === void 0) { weight = exports.DEFAULT_WEIGHT; } + if (filter === void 0) { filter = null; } + if (scoreMode === void 0) { scoreMode = exports.SCORE_MODE_AVG; } + var scoreStrategy = ScoreStrategy.createDefault(); + scoreStrategy.type = exports.BOOSTING_FIELD_VALUE; + scoreStrategy.configuration['field'] = field; + scoreStrategy.configuration['factor'] = factor; + scoreStrategy.configuration['missing'] = missing; + scoreStrategy.configuration['modifier'] = modifier; + scoreStrategy.weight = weight; + scoreStrategy.filter = ScoreStrategy.fixFilterFieldPath(filter); + scoreStrategy.scoreMode = scoreMode; + return scoreStrategy; + }; + /** + * Create custom function + * + * @param func + * @param weight + * @param filter + * @param scoreMode * * @return {ScoreStrategy} */ - ScoreStrategy.createRelevanceBoosting = function () { + ScoreStrategy.createCustomFunction = function (func, weight, filter, scoreMode) { + if (weight === void 0) { weight = exports.DEFAULT_WEIGHT; } + if (filter === void 0) { filter = null; } + if (scoreMode === void 0) { scoreMode = exports.SCORE_MODE_AVG; } var scoreStrategy = ScoreStrategy.createDefault(); - scoreStrategy.type = exports.SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD; + scoreStrategy.type = exports.CUSTOM_FUNCTION; + scoreStrategy.configuration['function'] = func; + scoreStrategy.weight = weight; + scoreStrategy.filter = ScoreStrategy.fixFilterFieldPath(filter); + scoreStrategy.scoreMode = scoreMode; return scoreStrategy; }; /** - * Create relevance boosting + * Create decay function * - * @param innerFunction + * @param type + * @param field + * @param origin + * @param scale + * @param offset + * @param decay + * @param weight + * @param filter + * @param scoreMode * * @return {ScoreStrategy} */ - ScoreStrategy.createCustomFunction = function (innerFunction) { + ScoreStrategy.createDecayFunction = function (type, field, origin, scale, offset, decay, weight, filter, scoreMode) { + if (weight === void 0) { weight = exports.DEFAULT_WEIGHT; } + if (filter === void 0) { filter = null; } + if (scoreMode === void 0) { scoreMode = exports.SCORE_MODE_AVG; } var scoreStrategy = ScoreStrategy.createDefault(); - scoreStrategy.type = exports.SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION; - scoreStrategy.innerFunction = innerFunction; + scoreStrategy.type = exports.DECAY; + scoreStrategy.configuration['type'] = type; + scoreStrategy.configuration['field'] = field; + scoreStrategy.configuration['origin'] = origin; + scoreStrategy.configuration['scale'] = scale; + scoreStrategy.configuration['offset'] = offset; + scoreStrategy.configuration['decay'] = decay; + scoreStrategy.weight = weight; + scoreStrategy.filter = ScoreStrategy.fixFilterFieldPath(filter); + scoreStrategy.scoreMode = scoreMode; return scoreStrategy; }; /** + * Fix filter path. + * + * @param filter * - * @return {{type: number, function: string}} + * @return {Filter} + */ + ScoreStrategy.fixFilterFieldPath = function (filter) { + if (filter == null) { + return filter; + } + var filterAsArray = filter.toArray(); + filterAsArray['field'] = Item_1.Item.getPathByField(filterAsArray['field']); + return Filter_1.Filter.createFromArray(filterAsArray); + }; + /** + * To array + * + * @return {{ + * type: string, + * configuration: any, + * weight: number, + * score_mode: string, + * filter: any + * }} */ ScoreStrategy.prototype.toArray = function () { return { type: this.type, - "function": this.innerFunction + configuration: this.configuration, + weight: this.weight, + score_mode: this.scoreMode, + filter: this.filter instanceof Filter_1.Filter + ? this.filter.toArray() + : null }; }; /** @@ -6549,14 +6805,21 @@ var ScoreStrategy = /** @class */ (function () { ScoreStrategy.createFromArray = function (array) { array = JSON.parse(JSON.stringify(array)); var scoreStrategy = ScoreStrategy.createDefault(); - if (typeof array.type == "undefined") { - array.type = exports.SCORE_STRATEGY_DEFAULT; + if (typeof array.type != "undefined") { + scoreStrategy.type = array.type; } - if (typeof array["function"] == "undefined") { - array.innerFunction = null; + if (typeof array.configuration != "undefined") { + scoreStrategy.configuration = array.configuration; + } + if (typeof array.weight != "undefined") { + scoreStrategy.weight = array.weight; + } + if (typeof array.score_mode != "undefined") { + scoreStrategy.scoreMode = array.score_mode; + } + if (typeof array.filter === 'object' && array.filter !== null) { + scoreStrategy.filter = Filter_1.Filter.createFromArray(array.filter); } - scoreStrategy.type = array.type; - scoreStrategy.innerFunction = array["function"]; return scoreStrategy; }; return ScoreStrategy; @@ -6576,6 +6839,7 @@ exports.ScoreStrategy = ScoreStrategy; "use strict"; exports.__esModule = true; +var Item_1 = __webpack_require__(/*! ../Model/Item */ "./src/Model/Item.ts"); /** export * Sort by constants */ @@ -6742,7 +7006,7 @@ var SortBy = /** @class */ (function () { */ SortBy.prototype.byNestedFieldAndFilter = function (field, order, filter, mode) { if (mode === void 0) { mode = exports.SORT_BY_MODE_AVG; } - var fieldPath = Filter_1.Filter.getFilterPathByField(filter.getField()); + var fieldPath = Item_1.Item.getPathByField(filter.getField()); var filterAsArray = filter.toArray(); filterAsArray.field = fieldPath; filter = Filter_1.Filter.createFromArray(filterAsArray); @@ -8341,6 +8605,7 @@ tslib_1.__exportStar(__webpack_require__(/*! ./Query/Aggregation */ "./src/Query tslib_1.__exportStar(__webpack_require__(/*! ./Query/Filter */ "./src/Query/Filter.ts"), exports); tslib_1.__exportStar(__webpack_require__(/*! ./Query/Query */ "./src/Query/Query.ts"), exports); tslib_1.__exportStar(__webpack_require__(/*! ./Query/Range */ "./src/Query/Range.ts"), exports); +tslib_1.__exportStar(__webpack_require__(/*! ./Query/ScoreStrategies */ "./src/Query/ScoreStrategies.ts"), exports); tslib_1.__exportStar(__webpack_require__(/*! ./Query/ScoreStrategy */ "./src/Query/ScoreStrategy.ts"), exports); tslib_1.__exportStar(__webpack_require__(/*! ./Query/SortBy */ "./src/Query/SortBy.ts"), exports); tslib_1.__exportStar(__webpack_require__(/*! ./Repository/HttpRepository */ "./src/Repository/HttpRepository.ts"), exports); diff --git a/dist/apisearch.js.map b/dist/apisearch.js.map index 17d631d..46d943a 100644 --- a/dist/apisearch.js.map +++ b/dist/apisearch.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://apisearch/webpack/universalModuleDefinition","webpack://apisearch/webpack/bootstrap","webpack://apisearch/./node_modules/axios/index.js","webpack://apisearch/./node_modules/axios/lib/adapters/xhr.js","webpack://apisearch/./node_modules/axios/lib/axios.js","webpack://apisearch/./node_modules/axios/lib/cancel/Cancel.js","webpack://apisearch/./node_modules/axios/lib/cancel/CancelToken.js","webpack://apisearch/./node_modules/axios/lib/cancel/isCancel.js","webpack://apisearch/./node_modules/axios/lib/core/Axios.js","webpack://apisearch/./node_modules/axios/lib/core/InterceptorManager.js","webpack://apisearch/./node_modules/axios/lib/core/createError.js","webpack://apisearch/./node_modules/axios/lib/core/dispatchRequest.js","webpack://apisearch/./node_modules/axios/lib/core/enhanceError.js","webpack://apisearch/./node_modules/axios/lib/core/settle.js","webpack://apisearch/./node_modules/axios/lib/core/transformData.js","webpack://apisearch/./node_modules/axios/lib/defaults.js","webpack://apisearch/./node_modules/axios/lib/helpers/bind.js","webpack://apisearch/./node_modules/axios/lib/helpers/btoa.js","webpack://apisearch/./node_modules/axios/lib/helpers/buildURL.js","webpack://apisearch/./node_modules/axios/lib/helpers/combineURLs.js","webpack://apisearch/./node_modules/axios/lib/helpers/cookies.js","webpack://apisearch/./node_modules/axios/lib/helpers/isAbsoluteURL.js","webpack://apisearch/./node_modules/axios/lib/helpers/isURLSameOrigin.js","webpack://apisearch/./node_modules/axios/lib/helpers/normalizeHeaderName.js","webpack://apisearch/./node_modules/axios/lib/helpers/parseHeaders.js","webpack://apisearch/./node_modules/axios/lib/helpers/spread.js","webpack://apisearch/./node_modules/axios/lib/utils.js","webpack://apisearch/./node_modules/is-buffer/index.js","webpack://apisearch/./node_modules/process/browser.js","webpack://apisearch/./node_modules/tslib/tslib.es6.js","webpack://apisearch/./src/Apisearch.ts","webpack://apisearch/./src/Cache/InMemoryCache.ts","webpack://apisearch/./src/Cache/NoCache.ts","webpack://apisearch/./src/Config/Config.ts","webpack://apisearch/./src/Config/Synonym.ts","webpack://apisearch/./src/Error/ConnectionError.ts","webpack://apisearch/./src/Error/ErrorWithMessage.ts","webpack://apisearch/./src/Error/EventError.ts","webpack://apisearch/./src/Error/ForbiddenError.ts","webpack://apisearch/./src/Error/InvalidFormatError.ts","webpack://apisearch/./src/Error/InvalidTokenError.ts","webpack://apisearch/./src/Error/ResourceExistsError.ts","webpack://apisearch/./src/Error/ResourceNotAvailableError.ts","webpack://apisearch/./src/Error/UnsupportedContentTypeError.ts","webpack://apisearch/./src/Geo/LocationRange.ts","webpack://apisearch/./src/Http/AxiosClient.ts","webpack://apisearch/./src/Http/Client.ts","webpack://apisearch/./src/Http/HttpClient.ts","webpack://apisearch/./src/Http/Response.ts","webpack://apisearch/./src/Http/Retry.ts","webpack://apisearch/./src/Http/RetryMap.ts","webpack://apisearch/./src/Model/AppUUID.ts","webpack://apisearch/./src/Model/Changes.ts","webpack://apisearch/./src/Model/Coordinate.ts","webpack://apisearch/./src/Model/Index.ts","webpack://apisearch/./src/Model/IndexUUID.ts","webpack://apisearch/./src/Model/Item.ts","webpack://apisearch/./src/Model/ItemUUID.ts","webpack://apisearch/./src/Model/Metadata.ts","webpack://apisearch/./src/Model/User.ts","webpack://apisearch/./src/Query/Aggregation.ts","webpack://apisearch/./src/Query/Filter.ts","webpack://apisearch/./src/Query/Query.ts","webpack://apisearch/./src/Query/Range.ts","webpack://apisearch/./src/Query/ScoreStrategy.ts","webpack://apisearch/./src/Query/SortBy.ts","webpack://apisearch/./src/Repository/HttpRepository.ts","webpack://apisearch/./src/Repository/Repository.ts","webpack://apisearch/./src/Result/Counter.ts","webpack://apisearch/./src/Result/Result.ts","webpack://apisearch/./src/Result/ResultAggregation.ts","webpack://apisearch/./src/Result/ResultAggregations.ts","webpack://apisearch/./src/Transformer/Transformer.ts","webpack://apisearch/./src/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;AClFA,iBAAiB,mBAAO,CAAC,sDAAa,E;;;;;;;;;;;;ACAzB;;AAEb,YAAY,mBAAO,CAAC,qDAAY;AAChC,aAAa,mBAAO,CAAC,iEAAkB;AACvC,eAAe,mBAAO,CAAC,2EAAuB;AAC9C,mBAAmB,mBAAO,CAAC,mFAA2B;AACtD,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D,kBAAkB,mBAAO,CAAC,yEAAqB;AAC/C,yFAAyF,mBAAO,CAAC,mEAAmB;;AAEpH;AACA;AACA;AACA;;AAEA;AACA,4CAA4C;AAC5C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ,aAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAoB,mBAAO,CAAC,yEAAsB;;AAElD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAA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ACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA,iDAAiD,gBAAgB;AACjE;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;;;;;;;;;;;;;AC9Ea;;AAEb,YAAY,mBAAO,CAAC,qDAAY;;AAEhC;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;;;;;;;;;;;;ACnDa;;AAEb,mBAAmB,mBAAO,CAAC,qEAAgB;;AAE3C;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;;AAEb,YAAY,mBAAO,CAAC,qDAAY;AAChC,oBAAoB,mBAAO,CAAC,uEAAiB;AAC7C,eAAe,mBAAO,CAAC,uEAAoB;AAC3C,eAAe,mBAAO,CAAC,yDAAa;AACpC,oBAAoB,mBAAO,CAAC,qFAA4B;AACxD,kBAAkB,mBAAO,CAAC,iFAA0B;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B;AAC/B,uCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;;;;;;;;;;;;ACrFa;;AAEb;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACpBa;;AAEb,kBAAkB,mBAAO,CAAC,mEAAe;;AAEzC;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzBa;;AAEb,YAAY,mBAAO,CAAC,qDAAY;;AAEhC;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,MAAM;AACjB,WAAW,eAAe;AAC1B,aAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACnBA,+CAAa;;AAEb,YAAY,mBAAO,CAAC,kDAAS;AAC7B,0BAA0B,mBAAO,CAAC,8FAA+B;;AAEjE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,mBAAO,CAAC,gEAAgB;AACtC,GAAG;AACH;AACA,cAAc,mBAAO,CAAC,iEAAiB;AACvC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,OAAO,YAAY;AACnB;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA,CAAC;;AAED;;;;;;;;;;;;;;AC3Fa;;AAEb;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACVa;;AAEb;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACnCa;;AAEb,YAAY,mBAAO,CAAC,qDAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACnEa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb,YAAY,mBAAO,CAAC,qDAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,wCAAwC;AACxC,OAAO;;AAEP;AACA,0DAA0D,wBAAwB;AAClF;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,gCAAgC;AAChC,6BAA6B,aAAa,EAAE;AAC5C;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb,YAAY,mBAAO,CAAC,qDAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACnEa;;AAEb,YAAY,mBAAO,CAAC,mDAAU;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACXa;;AAEb,YAAY,mBAAO,CAAC,qDAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,eAAe;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,WAAW,SAAS;AACpB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1Ba;;AAEb,WAAW,mBAAO,CAAC,gEAAgB;AACnC,eAAe,mBAAO,CAAC,oDAAW;;AAElC;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mCAAmC,OAAO;AAC1C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS;AAC5C,2BAA2B;AAC3B;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9SA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACpBA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qCAAqC;;AAErC;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA,4BAA4B,UAAU;;;;;;;;;;;;;ACvLtC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA,+DAA+D;AAC/D;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;;AAEO;AACP;AACA,mBAAmB,sBAAsB;AACzC;AACA;;AAEO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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,8BAA8B,mCAAmC;AACjE,8BAA8B,mCAAmC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,8BAA8B,mCAAmC;AACjE,8BAA8B,mCAAmC;AACjE;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC3Ia;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,wCAAwC,sBAAsB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACxDa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC7Ca;AACb;AACA,gBAAgB,mBAAO,CAAC,0CAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD,iDAAiD,gCAAgC;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,0BAA0B,EAAE;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,mDAAmD,EAAE;AACnI;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC7Ea;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AChEa;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,yBAAyB,mBAAO,CAAC,2DAAoB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACtBa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AChBa;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,yBAAyB,mBAAO,CAAC,2DAAoB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACtBa;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,yBAAyB,mBAAO,CAAC,2DAAoB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC9Ca;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,yBAAyB,mBAAO,CAAC,2DAAoB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,0FAA0F,GAAG,EAAE,KAAK;AACpG;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACtJa;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,yBAAyB,mBAAO,CAAC,2DAAoB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC3Ca;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,yBAAyB,mBAAO,CAAC,2DAAoB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC9Ca;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,yBAAyB,mBAAO,CAAC,2DAAoB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC9Da;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,yBAAyB,mBAAO,CAAC,2DAAoB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC9Ba;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,mBAAmB,mBAAO,CAAC,sDAAqB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,cAAc,uBAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC1Ma;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,cAAc,mBAAO,CAAC,4CAAO;AAC7B,eAAe,mBAAO,CAAC,sCAAU;AACjC,iBAAiB,mBAAO,CAAC,0CAAY;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oCAAoC,iBAAiB;AACrD,8BAA8B,WAAW;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sGAAsG;AACtG;AACA;AACA;AACA;AACA;AACA,gEAAgE,6BAA6B,EAAE;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACjHa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AChCa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACVa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AClCa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACnEa;AACb;AACA,cAAc,mBAAO,CAAC,oCAAS;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,6CAA6C,EAAE;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACnDa;AACb;AACA,2BAA2B,mBAAO,CAAC,sEAA6B;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACnEa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,2BAA2B;AACzD;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC1Ha;AACb;AACA,2BAA2B,mBAAO,CAAC,sEAA6B;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC/Da;AACb;AACA,2BAA2B,mBAAO,CAAC,sEAA6B;AAChE,kBAAkB,mBAAO,CAAC,6CAAa;AACvC,gBAAgB,mBAAO,CAAC,yCAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,cAAc;AAC5C,kCAAkC,cAAc;AAChD,8BAA8B,cAAc;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AClGa;AACb;AACA,2BAA2B,mBAAO,CAAC,sEAA6B;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACnEa;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,2BAA2B,mBAAO,CAAC,sEAA6B;AAChE,mBAAmB,mBAAO,CAAC,+CAAc;AACzC,iBAAiB,mBAAO,CAAC,2CAAY;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,kCAAkC,eAAe;AACjD,yCAAyC,sBAAsB;AAC/D,4CAA4C,yBAAyB;AACrE,+CAA+C,4BAA4B;AAC3E,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,kCAAkC,eAAe;AACjD,yCAAyC,sBAAsB;AAC/D,4CAA4C,yBAAyB;AACrE,+CAA+C,4BAA4B;AAC3E,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yLAAyL,wEAAwE,mFAAmF;AACpV,uHAAuH,wEAAwE,mFAAmF;AAClR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACxXa;AACb;AACA,2BAA2B,mBAAO,CAAC,sEAA6B;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC/Ea;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC9Da;AACb;AACA,2BAA2B,mBAAO,CAAC,sEAA6B;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,iBAAiB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACpEa;AACb;AACA,eAAe,mBAAO,CAAC,uCAAU;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,kCAAkC,eAAe;AACjD,8BAA8B,+CAA+C;AAC7E,+BAA+B,sCAAsC;AACrE;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC3Ka;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,qCAAqC,kBAAkB;AACvD;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACrKa;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,mBAAmB,mBAAO,CAAC,sDAAqB;AAChD,iBAAiB,mBAAO,CAAC,kDAAmB;AAC5C,aAAa,mBAAO,CAAC,0CAAe;AACpC,oBAAoB,mBAAO,CAAC,iDAAe;AAC3C,eAAe,mBAAO,CAAC,uCAAU;AACjC,eAAe,mBAAO,CAAC,uCAAU;AACjC,oBAAoB,mBAAO,CAAC,iDAAe;AAC3C,2BAA2B,mBAAO,CAAC,sEAA6B;AAChE,eAAe,mBAAO,CAAC,uCAAU;AACjC,sBAAsB,mBAAO,CAAC,qDAAiB;AAC/C,eAAe,mBAAO,CAAC,uCAAU;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,8BAA8B,mCAAmC;AACjE,8BAA8B,mCAAmC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,8BAA8B,mCAAmC;AACjE,8BAA8B,mCAAmC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,sDAAsD,gCAAgC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,mCAAmC,kBAAkB;AACrD,yCAAyC,gEAAgE;AACzG;AACA;AACA;AACA,8CAA8C,wBAAwB;AACtE;AACA;AACA;AACA;AACA;AACA,mDAAmD,6BAA6B;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,sDAAsD,gCAAgC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,8CAA8C,wBAAwB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF;AACA;AACA;AACA,sDAAsD,gCAAgC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF,mCAAmC,kBAAkB;AACrD,yCAAyC,gEAAgE;AACzG;AACA;AACA;AACA,8CAA8C,wBAAwB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF,mCAAmC,wCAAwC;AAC3E;AACA;AACA;AACA,sDAAsD,gCAAgC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF,mCAAmC,wCAAwC;AAC3E,mCAAmC,kBAAkB;AACrD,yCAAyC,gEAAgE;AACzG;AACA;AACA;AACA,8CAA8C,wBAAwB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF,mCAAmC,kBAAkB;AACrD,yCAAyC,gEAAgE;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,kDAAkD,gCAAgC;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gEAAgE;AACzG,+BAA+B,4CAA4C;AAC3E;AACA,+CAA+C,6BAA6B;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,mCAAmC,wCAAwC;AAC3E,yCAAyC,gEAAgE;AACzG,+BAA+B,4CAA4C;AAC3E;AACA;AACA;AACA;AACA,+CAA+C,6BAA6B;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gEAAgE;AACzG,+BAA+B,4CAA4C;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA,0CAA0C,wBAAwB,gFAAgF,4BAA4B,EAAE;AAChL;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACjjCa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACvEa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC/Fa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mBAAO,CAAC,sDAAqB;AAChD,eAAe,mBAAO,CAAC,uCAAU;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,8BAA8B,iCAAiC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,8BAA8B,iCAAiC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D;AAC7D;AACA;AACA;AACA,oEAAoE;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA,0DAA0D;AAC1D;AACA,qEAAqE;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA,yDAAyD;AACzD;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AChTa;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,wBAAwB,mBAAO,CAAC,gEAA0B;AAC1D,2BAA2B,mBAAO,CAAC,sEAA6B;AAChE,0BAA0B,mBAAO,CAAC,oEAA4B;AAC9D,4BAA4B,mBAAO,CAAC,wEAA8B;AAClE,kCAAkC,mBAAO,CAAC,oFAAoC;AAC9E,aAAa,mBAAO,CAAC,0CAAe;AACpC,iBAAiB,mBAAO,CAAC,kDAAmB;AAC5C,eAAe,mBAAO,CAAC,gDAAkB;AACzC,mBAAmB,mBAAO,CAAC,oDAAc;AACzC,cAAc,mBAAO,CAAC,4CAAgB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6FAA6F;AAC7F;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F;AAC/F;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,IAAI;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gGAAgG;AAChG;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E;AAC3E;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mGAAmG,IAAI;AACvG;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uGAAuG,IAAI;AAC3G;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iGAAiG,IAAI;AACrG;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,IAAI;AACjF;AACA;AACA;AACA,qEAAqE,gBAAgB;AACrF;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iGAAiG;AACjG;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACtXa;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,qBAAqB;AACrB;AACA,qBAAqB;AACrB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACxHa;AACb;AACA,iBAAiB,mBAAO,CAAC,kDAAmB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACtIa;AACb;AACA,aAAa,mBAAO,CAAC,0CAAe;AACpC,cAAc,mBAAO,CAAC,4CAAgB;AACtC,2BAA2B,mBAAO,CAAC,gEAAsB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,2CAA2C,EAAE;AAC/F;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,uBAAuB,EAAE;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,iDAAiD,EAAE;AACzG;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACvOa;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,eAAe,mBAAO,CAAC,8CAAiB;AACxC,gBAAgB,mBAAO,CAAC,0CAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACxOa;AACb;AACA,0BAA0B,mBAAO,CAAC,8DAAqB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACxGa;AACb;AACA,aAAa,mBAAO,CAAC,0CAAe;AACpC,iBAAiB,mBAAO,CAAC,kDAAmB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AO,CAAC,iDAAkB;AAC/C,qBAAqB,mBAAO,CAAC,yCAAc;AAC3C,qBAAqB,mBAAO,CAAC,uDAAqB;AAClD,qBAAqB,mBAAO,CAAC,6CAAgB;AAC7C,qBAAqB,mBAAO,CAAC,2CAAe;AAC5C,qBAAqB,mBAAO,CAAC,2CAAe;AAC5C,qBAAqB,mBAAO,CAAC,2DAAuB;AACpD,qBAAqB,mBAAO,CAAC,6CAAgB;AAC7C,qBAAqB,mBAAO,CAAC,uEAA6B;AAC1D,qBAAqB,mBAAO,CAAC,+DAAyB;AACtD,qBAAqB,mBAAO,CAAC,qEAA4B;AACzD,qBAAqB,mBAAO,CAAC,uEAA6B;AAC1D,qBAAqB,mBAAO,CAAC,iDAAkB;AAC/C,qBAAqB,mBAAO,CAAC,+CAAiB;AAC9C,qBAAqB,mBAAO,CAAC,mEAA2B","file":"apisearch.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"apisearch\"] = factory();\n\telse\n\t\troot[\"apisearch\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.ts\");\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildURL = require('./../helpers/buildURL');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar btoa = (typeof window !== 'undefined' && window.btoa && window.btoa.bind(window)) || require('./../helpers/btoa');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n var loadEvent = 'onreadystatechange';\n var xDomain = false;\n\n // For IE 8/9 CORS support\n // Only supports POST and GET calls and doesn't returns the response headers.\n // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.\n if (process.env.NODE_ENV !== 'test' &&\n typeof window !== 'undefined' &&\n window.XDomainRequest && !('withCredentials' in request) &&\n !isURLSameOrigin(config.url)) {\n request = new window.XDomainRequest();\n loadEvent = 'onload';\n xDomain = true;\n request.onprogress = function handleProgress() {};\n request.ontimeout = function handleTimeout() {};\n }\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request[loadEvent] = function handleLoad() {\n if (!request || (request.readyState !== 4 && !xDomain)) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n // IE sends 1223 instead of 204 (https://github.com/axios/axios/issues/201)\n status: request.status === 1223 ? 204 : request.status,\n statusText: request.status === 1223 ? 'No Content' : request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = require('./../helpers/cookies');\n\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(utils.merge(defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar defaults = require('./../defaults');\nvar utils = require('./../utils');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = utils.merge({\n url: arguments[0]\n }, arguments[1]);\n }\n\n config = utils.merge(defaults, this.defaults, { method: 'get' }, config);\n config.method = config.method.toLowerCase();\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar isAbsoluteURL = require('./../helpers/isAbsoluteURL');\nvar combineURLs = require('./../helpers/combineURLs');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Support baseURL config\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers || {}\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n error.request = request;\n error.response = response;\n return error;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n // Note: status is not exposed by XDomainRequest\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\n// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js\n\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\nfunction E() {\n this.message = 'String contains an invalid character';\n}\nE.prototype = new Error;\nE.prototype.code = 5;\nE.prototype.name = 'InvalidCharacterError';\n\nfunction btoa(input) {\n var str = String(input);\n var output = '';\n for (\n // initialize result and counter\n var block, charCode, idx = 0, map = chars;\n // if the next str index does not exist:\n // change the mapping table to \"=\"\n // check if d has no fractional digits\n str.charAt(idx | 0) || (map = '=', idx % 1);\n // \"8 - idx % 1 * 8\" generates the sequence 2, 4, 6, 8\n output += map.charAt(63 & block >> 8 - idx % 1 * 8)\n ) {\n charCode = str.charCodeAt(idx += 3 / 4);\n if (charCode > 0xFF) {\n throw new E();\n }\n block = block << 8 | charCode;\n }\n return output;\n}\n\nmodule.exports = btoa;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n }\n\n if (!utils.isArray(val)) {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\nvar isBuffer = require('is-buffer');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim\n};\n","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\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;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar NoCache_1 = require(\"./Cache/NoCache\");\nvar AxiosClient_1 = require(\"./Http/AxiosClient\");\nvar RetryMap_1 = require(\"./Http/RetryMap\");\nvar Query_1 = require(\"./Query/Query\");\nvar Query_2 = require(\"./Query/Query\");\nvar Query_3 = require(\"./Query/Query\");\nvar SortBy_1 = require(\"./Query/SortBy\");\nvar HttpRepository_1 = require(\"./Repository/HttpRepository\");\nvar Result_1 = require(\"./Result/Result\");\nvar ResultAggregations_1 = require(\"./Result/ResultAggregations\");\nvar Transformer_1 = require(\"./Transformer/Transformer\");\n/**\n * Apisearch class\n */\nvar Apisearch = /** @class */ (function () {\n function Apisearch() {\n }\n /**\n * Constructor\n *\n * @param config\n *\n * @return {HttpRepository}\n */\n Apisearch.createRepository = function (config) {\n Apisearch.ensureRepositoryConfigIsValid(config);\n config.options = tslib_1.__assign({ api_version: \"v1\", cache: new NoCache_1.NoCache(), timeout: 5000, override_queries: true }, config.options);\n /**\n * Client\n */\n var httpClient = typeof config.options.http_client !== \"undefined\"\n ? config.options.http_client\n : new AxiosClient_1.AxiosClient(config.options.endpoint, config.options.api_version, config.options.timeout, new RetryMap_1.RetryMap(), config.options.override_queries, config.options.cache);\n return new HttpRepository_1.HttpRepository(httpClient, config.app_id, config.index_id, config.token, new Transformer_1.Transformer());\n };\n /**\n * Ensure the Repository configuration is valid\n *\n * @param config\n */\n Apisearch.ensureRepositoryConfigIsValid = function (config) {\n Apisearch.ensureIsDefined(config.app_id, \"app_id\");\n Apisearch.ensureIsDefined(config.index_id, \"index_id\");\n Apisearch.ensureIsDefined(config.token, \"token\");\n Apisearch.ensureIsDefined(config.options.endpoint, \"options.endpoint\");\n };\n /**\n * Ensure the value is not undefined\n *\n * @param param\n * @param name\n */\n Apisearch.ensureIsDefined = function (param, name) {\n if (typeof param === \"undefined\") {\n throw new TypeError(name + \" parameter must be defined.\");\n }\n };\n /**\n * Created located\n *\n * @param coordinate\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Apisearch.createQueryLocated = function (coordinate, queryText, page, size) {\n if (page === void 0) { page = Query_1.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = Query_2.QUERY_DEFAULT_SIZE; }\n return Query_3.Query.createLocated(coordinate, queryText, page, size);\n };\n /**\n * Create\n *\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Apisearch.createQuery = function (queryText, page, size) {\n if (page === void 0) { page = Query_1.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = Query_2.QUERY_DEFAULT_SIZE; }\n return Query_3.Query.create(queryText, page, size);\n };\n /**\n * Create match all\n *\n * @return {Query}\n */\n Apisearch.createQueryMatchAll = function () {\n return Query_3.Query.createMatchAll();\n };\n /**\n * Create by UUID\n *\n * @param uuid\n *\n * @return {Query}\n */\n Apisearch.createQueryByUUID = function (uuid) {\n return Query_3.Query.createByUUID(uuid);\n };\n /**\n * Create by UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Apisearch.createQueryByUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n return Query_3.Query.createByUUIDs.apply(Query_3.Query, uuids);\n };\n /**\n * Create empty result\n *\n * @return {Result}\n */\n Apisearch.createEmptyResult = function () {\n return Result_1.Result.create(Apisearch.createQueryMatchAll(), 0, 0, new ResultAggregations_1.ResultAggregations(0), [], []);\n };\n /**\n * Create empty sortby\n *\n * @return {SortBy}\n */\n Apisearch.createEmptySortBy = function () {\n return SortBy_1.SortBy.create();\n };\n return Apisearch;\n}());\nexports[\"default\"] = Apisearch;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\n/**\n * Cache class\n */\nvar InMemoryCache = /** @class */ (function () {\n /**\n * Constructor\n */\n function InMemoryCache() {\n this.cache = {};\n this.size = 0;\n this.cache = {};\n this.size = 0;\n }\n /**\n * Set cache element\n *\n * @param key\n * @param value\n *\n * @returns {void}\n */\n InMemoryCache.prototype.set = function (key, value) {\n var _a;\n this.cache = tslib_1.__assign({}, this.cache, (_a = {}, _a[key] = value, _a));\n this.size = this.size + 1;\n };\n /**\n * Get element from cache\n *\n * @param key\n *\n * @returns {any}\n */\n InMemoryCache.prototype.get = function (key) {\n return this.cache[key];\n };\n /**\n * Deletes element from cache\n *\n * @param key\n */\n InMemoryCache.prototype.del = function (key) {\n delete this.cache[key];\n };\n /**\n * Clear cache\n */\n InMemoryCache.prototype.clear = function () {\n this.cache = {};\n this.size = 0;\n };\n return InMemoryCache;\n}());\nexports.InMemoryCache = InMemoryCache;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Cache class\n */\nvar NoCache = /** @class */ (function () {\n function NoCache() {\n }\n /**\n * Set cache element\n *\n * @param key\n * @param value\n *\n * @returns {void}\n */\n NoCache.prototype.set = function (key, value) {\n // Empty\n };\n /**\n * Get element from cache\n *\n * @param key\n *\n * @returns {any}\n */\n NoCache.prototype.get = function (key) {\n return undefined;\n };\n /**\n * Deletes element from cache\n *\n * @param key\n */\n NoCache.prototype.del = function (key) {\n // Empty\n };\n /**\n * Clear cache\n */\n NoCache.prototype.clear = function () {\n // Empty\n };\n return NoCache;\n}());\nexports.NoCache = NoCache;\n","\"use strict\";\nexports.__esModule = true;\nvar Synonym_1 = require(\"./Synonym\");\n/**\n * Result class\n */\nvar Config = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param language\n * @param storeSearchableMetadata\n */\n function Config(language, storeSearchableMetadata) {\n if (language === void 0) { language = null; }\n if (storeSearchableMetadata === void 0) { storeSearchableMetadata = true; }\n this.synonyms = [];\n this.language = language;\n this.storeSearchableMetadata = storeSearchableMetadata;\n }\n /**\n * Get language\n *\n * @return {string}\n */\n Config.prototype.getLanguage = function () {\n return this.language;\n };\n /**\n * Should searchable metadata be stored\n *\n * @return {boolean}\n */\n Config.prototype.shouldSearchableMetadataBeStored = function () {\n return this.storeSearchableMetadata;\n };\n /**\n * Add synonym\n *\n * @param synonym\n */\n Config.prototype.addSynonym = function (synonym) {\n this.synonyms.push(synonym);\n };\n /**\n * Get synonyms\n *\n * @return {Synonym[]}\n */\n Config.prototype.getSynonyms = function () {\n return this.synonyms;\n };\n /**\n * to array\n */\n Config.prototype.toArray = function () {\n return {\n language: this.language,\n store_searchable_metadata: this.storeSearchableMetadata,\n synonyms: this.synonyms.map(function (synonym) { return synonym.toArray(); })\n };\n };\n /**\n * Create from array\n */\n Config.createFromArray = function (array) {\n var immutableConfig = new Config(array.language ? array.language : null, typeof array.store_searchable_metadata == \"boolean\"\n ? array.store_searchable_metadata\n : true);\n if (array.synonyms instanceof Array &&\n array.synonyms.length > 0) {\n immutableConfig.synonyms = array.synonyms.map(function (synonym) { return Synonym_1.Synonym.createFromArray(synonym); });\n }\n return immutableConfig;\n };\n return Config;\n}());\nexports.Config = Config;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Result class\n */\nvar Synonym = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param words\n */\n function Synonym(words) {\n this.words = words;\n }\n /**\n * get words\n *\n * @return {string[]}\n */\n Synonym.prototype.getWords = function () {\n return this.words;\n };\n /**\n * Create by words\n *\n * @param words\n *\n * @return {Synonym}\n */\n Synonym.createbyWords = function (words) {\n return new Synonym(words);\n };\n /**\n * To array\n *\n * @return {{words: string[]}}\n */\n Synonym.prototype.toArray = function () {\n return {\n words: this.words\n };\n };\n /**\n * create from array\n *\n * @param array\n *\n * @returns {Synonym}\n */\n Synonym.createFromArray = function (array) {\n return new Synonym(array.words instanceof Object\n ? array.words\n : []);\n };\n /**\n * Expand\n *\n * @returns {string}\n */\n Synonym.prototype.expand = function () {\n return this.words.join(\",\");\n };\n return Synonym;\n}());\nexports.Synonym = Synonym;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Connection error\n */\nvar ConnectionError = /** @class */ (function (_super) {\n tslib_1.__extends(ConnectionError, _super);\n function ConnectionError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ConnectionError.getTransportableHTTPError = function () {\n return 500;\n };\n return ConnectionError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ConnectionError = ConnectionError;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * ConnectError\n */\nvar ErrorWithMessage = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param message\n */\n function ErrorWithMessage(message) {\n this.message = message;\n }\n return ErrorWithMessage;\n}());\nexports.ErrorWithMessage = ErrorWithMessage;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * EventError\n */\nvar EventError = /** @class */ (function (_super) {\n tslib_1.__extends(EventError, _super);\n function EventError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n EventError.throwEndpointNotAvailable = function () {\n return new EventError(\"Endpoint not available\");\n };\n return EventError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.EventError = EventError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Forbidden Error\n */\nvar ForbiddenError = /** @class */ (function (_super) {\n tslib_1.__extends(ForbiddenError, _super);\n function ForbiddenError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ForbiddenError.getTransportableHTTPError = function () {\n return 403;\n };\n /**\n * App id is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createAppIdIsRequiredException = function () {\n return new ForbiddenError(\"AppId query parameter MUST be defined with a valid value\");\n };\n /**\n * Index id is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createIndexIsRequiredException = function () {\n return new ForbiddenError(\"Index query parameter MUST be defined with a valid value\");\n };\n /**\n * Token is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createTokenIsRequiredException = function () {\n return new ForbiddenError(\"Token query parameter MUST be defined with a valid value\");\n };\n return ForbiddenError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ForbiddenError = ForbiddenError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Class InvalidFormatError\n */\nvar InvalidFormatError = /** @class */ (function (_super) {\n tslib_1.__extends(InvalidFormatError, _super);\n function InvalidFormatError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n InvalidFormatError.getTransportableHTTPError = function () {\n return 400;\n };\n /**\n * Item representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.itemRepresentationNotValid = function () {\n return new InvalidFormatError(\"Item representation not valid. Expecting Item array serialized but found malformed data\");\n };\n /**\n * Item UUID representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.itemUUIDRepresentationNotValid = function () {\n return new InvalidFormatError(\"Item UUID representation not valid. Expecting UUID array serialized but found malformed data\");\n };\n /**\n * Create Composed UUID bad format.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.composedItemUUIDNotValid = function () {\n return new InvalidFormatError(\"A composed UUID should always follow this format: {id}~{type}.\");\n };\n /**\n * Create Query sorted by distance without coordinate.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.querySortedByDistanceWithoutCoordinate = function () {\n return new InvalidFormatError(\"In order to be able to sort by coordinates, you need to create a Query by using Query::createLocated() instead of Query::create()\");\n };\n /**\n * Query representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.queryFormatNotValid = function () {\n return new InvalidFormatError(\"Query Format not valid. Expecting a Query serialized but found malformed data\");\n };\n /**\n * Coordinate representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.coordinateFormatNotValid = function () {\n return new InvalidFormatError(\"A Coordinate should always contain a lat (Latitude) and a lon (Longitude)\");\n };\n /**\n * Config representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.configFormatNotValid = function () {\n return new InvalidFormatError(\"Config Format not valid. Expecting a Config serialized but found malformed data\");\n };\n /**\n * Token representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.tokenFormatNotValid = function () {\n return new InvalidFormatError(\"Token Format not valid. Expecting a Token serialized but found malformed data\");\n };\n /**\n * Index format not valid.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.indexFormatNotValid = function () {\n return new InvalidFormatError('Index Format not valid. Expecting an Index serialized but found malformed data');\n };\n /**\n * IndexUUI format not valid.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.indexUUIDFormatNotValid = function () {\n return new InvalidFormatError('IndexUUID Format not valid. Expecting an IndexUUID serialized but found malformed data');\n };\n /**\n * App format not valid.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.appUUIDFormatNotValid = function () {\n return new InvalidFormatError('AppUUID Format not valid. Expecting an AppUUID serialized but found malformed data');\n };\n /**\n * Campaign representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.campaignFormatNotValid = function () {\n return new InvalidFormatError(\"Campaign Format not valid. Expecting a Campaign serialized but found malformed data\");\n };\n /**\n * Changes representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.changesFormatNotValid = function () {\n return new InvalidFormatError(\"Changes Format not valid. Expecting a Changes serialized but found malformed data\");\n };\n /**\n * Boost clause representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.boostClauseFormatNotValid = function () {\n return new InvalidFormatError(\"Boost clause Format not valid. Expecting a Boost clause serialized but found malformed data\");\n };\n /**\n * token uuid representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.tokenUUIDFormatNotValid = function () {\n return new InvalidFormatError(\"Token UUID Format not valid. Expecting a TokenUUID serialized but found malformed data\");\n };\n /**\n * User representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.userFormatNotValid = function () {\n return new InvalidFormatError(\"User Format not valid. Expecting a User serialized but found malformed data\");\n };\n return InvalidFormatError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.InvalidFormatError = InvalidFormatError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Invalid token error\n */\nvar InvalidTokenError = /** @class */ (function (_super) {\n tslib_1.__extends(InvalidTokenError, _super);\n function InvalidTokenError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n InvalidTokenError.getTransportableHTTPError = function () {\n return 401;\n };\n /**\n * Invalid token permissions\n *\n * @param tokenReference\n *\n * @return {InvalidTokenError}\n */\n InvalidTokenError.createInvalidTokenPermissions = function (tokenReference) {\n return new InvalidTokenError(\"Token \" + tokenReference + \"not valid\");\n };\n /**\n * Invalid token permissions\n *\n * @param tokenReference\n * @param maxHitsPerQuery\n *\n * @return {InvalidTokenError}\n */\n InvalidTokenError.createInvalidTokenMaxHitsPerQuery = function (tokenReference, maxHitsPerQuery) {\n return new InvalidTokenError(\"Token \" + tokenReference + \"not valid. Max \" + maxHitsPerQuery + \" hits allowed\");\n };\n return InvalidTokenError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.InvalidTokenError = InvalidTokenError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Resource exists error\n */\nvar ResourceExistsError = /** @class */ (function (_super) {\n tslib_1.__extends(ResourceExistsError, _super);\n function ResourceExistsError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ResourceExistsError.getTransportableHTTPError = function () {\n return 409;\n };\n /**\n * Index not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.indexAvailable = function () {\n return new ResourceExistsError(\"Index exists and cannot be created again\");\n };\n /**\n * Events not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.eventsIndexAvailable = function () {\n return new ResourceExistsError(\"Events index exists and cannot be created again\");\n };\n /**\n * Logs not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.logsIndexAvailable = function () {\n return new ResourceExistsError(\"Logs index exists and cannot be created again\");\n };\n return ResourceExistsError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ResourceExistsError = ResourceExistsError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Resource not available error\n */\nvar ResourceNotAvailableError = /** @class */ (function (_super) {\n tslib_1.__extends(ResourceNotAvailableError, _super);\n function ResourceNotAvailableError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ResourceNotAvailableError.getTransportableHTTPError = function () {\n return 404;\n };\n /**\n * Index not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.indexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Index not available - \" + resourceId);\n };\n /**\n * Events not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.eventsIndexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Events not available - \" + resourceId);\n };\n /**\n * Logs not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.logsIndexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Logs not available - \" + resourceId);\n };\n /**\n * Engine not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.engineNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Engine not available - \" + resourceId);\n };\n return ResourceNotAvailableError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ResourceNotAvailableError = ResourceNotAvailableError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Unsupported content type error\n */\nvar UnsupportedContentTypeError = /** @class */ (function (_super) {\n tslib_1.__extends(UnsupportedContentTypeError, _super);\n function UnsupportedContentTypeError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n UnsupportedContentTypeError.getTransportableHTTPError = function () {\n return 415;\n };\n /**\n * Unsupported content type\n *\n * @return {InvalidFormatError}\n */\n UnsupportedContentTypeError.createUnsupportedContentTypeException = function () {\n return new UnsupportedContentTypeError(\"This content type is not accepted. Please use application/json\");\n };\n return UnsupportedContentTypeError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.UnsupportedContentTypeError = UnsupportedContentTypeError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar Coordinate_1 = require(\"../Model/Coordinate\");\n/**\n * Abstract Location Range class\n */\nvar LocationRange = /** @class */ (function () {\n function LocationRange() {\n }\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n LocationRange.fromFilterObject = function (object) {\n throw TypeError(\"Method not valid\");\n };\n /**\n * to array\n */\n LocationRange.prototype.toArray = function () {\n return {\n type: this.getName(),\n data: this.toFilterObject()\n };\n };\n /**\n * Create from array\n *\n * @param array\n */\n LocationRange.createFromArray = function (array) {\n if (array.type == \"CoordinateAndDistance\") {\n return CoordinateAndDistance.fromFilterObject(array.data);\n }\n if (array.type == \"Polygon\") {\n return Polygon.fromFilterObject(array.data);\n }\n if (array.type == \"Square\") {\n return Square.fromFilterObject(array.data);\n }\n };\n return LocationRange;\n}());\nexports.LocationRange = LocationRange;\n/**\n * CoordinateAndDistance\n */\nvar CoordinateAndDistance = /** @class */ (function (_super) {\n tslib_1.__extends(CoordinateAndDistance, _super);\n /**\n * Constructor\n *\n * @param coordinate\n * @param distance\n */\n function CoordinateAndDistance(coordinate, distance) {\n var _this = _super.call(this) || this;\n _this.coordinate = coordinate;\n _this.distance = distance;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{}}}\n */\n CoordinateAndDistance.prototype.toFilterObject = function () {\n return {\n coordinate: this.coordinate.toArray(),\n distance: this.distance\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n CoordinateAndDistance.prototype.getName = function () {\n return \"CoordinateAndDistance\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n CoordinateAndDistance.fromFilterObject = function (object) {\n return new CoordinateAndDistance(Coordinate_1.Coordinate.createFromArray(object.coordinate), object.distance);\n };\n return CoordinateAndDistance;\n}(LocationRange));\nexports.CoordinateAndDistance = CoordinateAndDistance;\n/**\n * Polygon\n */\nvar Polygon = /** @class */ (function (_super) {\n tslib_1.__extends(Polygon, _super);\n /**\n * Constructor\n *\n * @param coordinates\n */\n function Polygon(coordinates) {\n var _this = _super.call(this) || this;\n if (coordinates.length < 3) {\n throw new Error(\"A polygon needs more than two coordinates.\");\n }\n _this.coordinates = coordinates;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{coordinates: {lat:number, lon:number}[]}}\n */\n Polygon.prototype.toFilterObject = function () {\n var coordinates = [];\n for (var i in this.coordinates) {\n coordinates.push(this.coordinates[i].toArray());\n }\n return {\n coordinates: coordinates\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n Polygon.prototype.getName = function () {\n return \"Polygon\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {Polygon}\n */\n Polygon.fromFilterObject = function (object) {\n var coordinates = [];\n for (var i in object.coordinates) {\n coordinates.push(Coordinate_1.Coordinate.createFromArray(object.coordinates[i]));\n }\n return new Polygon(coordinates);\n };\n return Polygon;\n}(LocationRange));\nexports.Polygon = Polygon;\n/**\n * Square\n */\nvar Square = /** @class */ (function (_super) {\n tslib_1.__extends(Square, _super);\n /**\n * Constructor\n *\n * @param topLeftCoordinate\n * @param bottomRightCoordinate\n */\n function Square(topLeftCoordinate, bottomRightCoordinate) {\n var _this = _super.call(this) || this;\n _this.topLeftCoordinate = topLeftCoordinate;\n _this.bottomRightCoordinate = bottomRightCoordinate;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{}}}\n */\n Square.prototype.toFilterObject = function () {\n return {\n top_left: this.topLeftCoordinate.toArray(),\n bottom_right: this.bottomRightCoordinate.toArray()\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n Square.prototype.getName = function () {\n return \"Square\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n Square.fromFilterObject = function (object) {\n return new Square(Coordinate_1.Coordinate.createFromArray(object.top_left), Coordinate_1.Coordinate.createFromArray(object.bottom_right));\n };\n return Square;\n}(LocationRange));\nexports.Square = Square;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar axios_1 = require(\"axios\");\nvar Client_1 = require(\"./Client\");\nvar Response_1 = require(\"./Response\");\n/**\n * AxiosClient\n */\nvar AxiosClient = /** @class */ (function (_super) {\n tslib_1.__extends(AxiosClient, _super);\n /**\n * Constructor\n *\n * @param host\n * @param version\n * @param timeout\n * @param retryMap\n * @param overrideQueries\n * @param cache\n */\n function AxiosClient(host, version, timeout, retryMap, overrideQueries, cache) {\n var _this = _super.call(this, version, retryMap) || this;\n _this.host = host;\n _this.timeout = timeout;\n _this.cache = cache;\n _this.overrideQueries = overrideQueries;\n _this.cancelToken = {};\n return _this;\n }\n /**\n * Get\n *\n * @param url\n * @param method\n * @param credentials\n * @param parameters\n * @param data\n *\n * @return {Promise}\n */\n AxiosClient.prototype.get = function (url, method, credentials, parameters, data) {\n if (parameters === void 0) { parameters = {}; }\n if (data === void 0) { data = {}; }\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n var that;\n var _this = this;\n return tslib_1.__generator(this, function (_a) {\n that = this;\n url = url.replace(/^\\/*|\\/*$/g, \"\");\n url = \"/\" + (this.version + \"/\" + url).replace(/^\\/*|\\/*$/g, \"\");\n method = method.toLowerCase();\n if (\"get\" === method &&\n this.overrideQueries) {\n this.abort(url);\n }\n return [2 /*return*/, new Promise(function (resolve, reject) {\n var headers = \"get\" == method\n ? {}\n : {\n \"Content-Encoding\": \"gzip\",\n \"Content-Type\": \"application/json\"\n };\n var axiosRequestConfig = {\n url: url + \"?\" + Client_1.Client.objectToUrlParameters(tslib_1.__assign({}, credentials, parameters)),\n data: data,\n headers: headers,\n method: method,\n baseURL: that.host.replace(/\\/*$/g, \"\"),\n timeout: that.timeout,\n transformRequest: [function (data) { return JSON.stringify(data); }]\n };\n if (typeof _this.cancelToken[url] != 'undefined') {\n axiosRequestConfig.cancelToken = _this.cancelToken[url].token;\n }\n axios_1[\"default\"]\n .request(axiosRequestConfig)\n .then(function (axiosResponse) {\n var response = new Response_1.Response(axiosResponse.status, axiosResponse.data);\n return resolve(response);\n })[\"catch\"](function (error) {\n if (error.response === undefined) {\n return;\n }\n var response = new Response_1.Response(error.response.status, error.response.data);\n return reject(response);\n });\n })];\n });\n });\n };\n /**\n * Abort current request\n * And regenerate the cancellation token\n *\n * @param url\n */\n AxiosClient.prototype.abort = function (url) {\n if (typeof this.cancelToken[url] != 'undefined') {\n this.cancelToken[url].cancel();\n }\n this.generateCancelToken(url);\n };\n /**\n * Generate a new cancellation token for a query\n *\n * @param url\n */\n AxiosClient.prototype.generateCancelToken = function (url) {\n this.cancelToken[url] = axios_1[\"default\"].CancelToken.source();\n };\n return AxiosClient;\n}(Client_1.Client));\nexports.AxiosClient = AxiosClient;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Client\n */\nvar Client = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param version\n * @param retryMap\n */\n function Client(version, retryMap) {\n this.retryMap = retryMap;\n this.version = version.replace(/^\\/*|\\/*$/g, \"\");\n }\n /**\n * Build an url parameters array by an object\n *\n * @param params\n *\n * @returns {string}\n */\n Client.objectToUrlParameters = function (params) {\n var builtParams = [];\n for (var i in params) {\n builtParams.push(i + \"=\" + params[i]);\n }\n return builtParams.join(\"&\");\n };\n return Client;\n}());\nexports.Client = Client;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Http class\n */\nvar HttpClient = /** @class */ (function () {\n function HttpClient() {\n }\n return HttpClient;\n}());\nexports.HttpClient = HttpClient;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Response\n */\nvar Response = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param code\n * @param body\n */\n function Response(code, body) {\n this.code = code;\n this.body = body;\n }\n /**\n * Get code\n *\n * @return {number}\n */\n Response.prototype.getCode = function () {\n return this.code;\n };\n /**\n * Get body\n *\n * @return {any}\n */\n Response.prototype.getBody = function () {\n return this.body;\n };\n return Response;\n}());\nexports.Response = Response;\n","\"use strict\";\nexports.__esModule = true;\nexports.DEFAULT_MICROSECONDS_BETWEEN_RETRIES = 1000;\n/**\n * Http class\n */\nvar Retry = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param url\n * @param method\n * @param retries\n * @param microsecondsBetweenRetries\n */\n function Retry(url, method, retries, microsecondsBetweenRetries) {\n this.url = url;\n this.method = method;\n this.retries = retries;\n this.microsecondsBetweenRetries = microsecondsBetweenRetries;\n }\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Retry}\n */\n Retry.createFromArray = function (array) {\n return new Retry(array.url ? array.url : \"*\", array.method ? array.method : \"*\", array.retries ? array.retries : 0, array.microseconds_between_retries\n ? array.microseconds_between_retries\n : exports.DEFAULT_MICROSECONDS_BETWEEN_RETRIES);\n };\n /**\n * Get url\n *\n * @return {string}\n */\n Retry.prototype.getUrl = function () {\n return this.url;\n };\n /**\n * Get method\n *\n * @return {string}\n */\n Retry.prototype.getMethod = function () {\n return this.method;\n };\n /**\n * Ge retries\n *\n * @return {number}\n */\n Retry.prototype.getRetries = function () {\n return this.retries;\n };\n /**\n * Get microseconds between retries\n *\n * @return {number}\n */\n Retry.prototype.getMicrosecondsBetweenRetries = function () {\n return this.microsecondsBetweenRetries;\n };\n return Retry;\n}());\nexports.Retry = Retry;\n","\"use strict\";\nexports.__esModule = true;\nvar Retry_1 = require(\"./Retry\");\n/**\n * Http class\n */\nvar RetryMap = /** @class */ (function () {\n function RetryMap() {\n this.retries = {};\n }\n /**\n * Add retry\n *\n * @param retry\n */\n RetryMap.prototype.addRetry = function (retry) {\n this.retries[retry.getUrl() + \"~~\" + retry.getMethod()] = retry;\n };\n /**\n * Create from array\n */\n RetryMap.createFromArray = function (array) {\n var retryMap = new RetryMap();\n retryMap.retries = array.map(function (retry) { return Retry_1.Retry.createFromArray(retry); });\n return retryMap;\n };\n /**\n * Get retry\n *\n * @param url\n * @param method\n *\n * @returns {Retry}\n */\n RetryMap.prototype.getRetry = function (url, method) {\n if (this.retries[url + \"~~\" + method] instanceof Retry_1.Retry) {\n return this.retries[url + \"~~\" + method];\n }\n if (this.retries[\"*~~\" + method] instanceof Retry_1.Retry) {\n return this.retries[\"*~~\" + method];\n }\n if (this.retries[url + \"~~*\"] instanceof Retry_1.Retry) {\n return this.retries[url + \"~~*\"];\n }\n if (this.retries[\"*~~*\"] instanceof Retry_1.Retry) {\n return this.retries[\"*~~*\"];\n }\n return null;\n };\n return RetryMap;\n}());\nexports.RetryMap = RetryMap;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * AppUUID class\n */\nvar AppUUID = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param id\n */\n function AppUUID(id) {\n if (id.indexOf('_') >= 0) {\n throw InvalidFormatError_1.InvalidFormatError.appUUIDFormatNotValid();\n }\n this.id = id;\n }\n /**\n * Create by id\n *\n * @param id\n *\n * @returns {ItemUUID}\n */\n AppUUID.createById = function (id) {\n return new AppUUID(id);\n };\n /**\n * Return id\n *\n * @returns {string}\n */\n AppUUID.prototype.getId = function () {\n return this.id;\n };\n /**\n * To array\n *\n * @returns {{id: *, type: *}}\n */\n AppUUID.prototype.toArray = function () {\n return {\n id: this.id\n };\n };\n /**\n * Create from array\n *\n * @param array {{id:string, type:string}}\n *\n * @return {ItemUUID}\n */\n AppUUID.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new AppUUID(array.id);\n };\n /**\n * Compose unique id\n *\n * @returns {string}\n */\n AppUUID.prototype.composedUUID = function () {\n return this.id;\n };\n return AppUUID;\n}());\nexports.AppUUID = AppUUID;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * filter constants\n */\nexports.TYPE_VALUE = 1;\nexports.TYPE_LITERAL = 4;\nexports.TYPE_ARRAY_ELEMENT_UPDATE = 8;\nexports.TYPE_ARRAY_ELEMENT_ADD = 16;\nexports.TYPE_ARRAY_ELEMENT_DELETE = 32;\nexports.TYPE_ARRAY_EXPECTS_ELEMENT = 24;\nexports.TYPE_ARRAY = 56;\n/**\n * Changes Type cast\n * @param Changes\n */\nvar Changes = /** @class */ (function () {\n function Changes() {\n /**\n * Changes\n *\n * @type {Array}\n */\n this.changes = [];\n }\n /**\n * Add new change\n *\n * @param field\n * @param value\n * @param type\n */\n Changes.prototype.addChange = function (field, value, type) {\n if (type === void 0) { type = exports.TYPE_VALUE; }\n this.changes.push({\n field: field,\n type: type,\n value: value\n });\n };\n /**\n * Update element from list\n *\n * @param field\n * @param condition\n * @param value\n * @param type\n */\n Changes.prototype.updateElementFromList = function (field, condition, value, type) {\n this.changes.push({\n field: field,\n type: type | exports.TYPE_ARRAY_ELEMENT_UPDATE,\n condition: condition,\n value: value\n });\n };\n /**\n * Add element in list\n *\n * @param field\n * @param value\n * @param type\n */\n Changes.prototype.addElementInList = function (field, value, type) {\n this.changes.push({\n field: field,\n type: type | exports.TYPE_ARRAY_ELEMENT_ADD,\n value: value\n });\n };\n /**\n * Delete element from list\n *\n * @param field\n * @param condition\n */\n Changes.prototype.deleteElementFromList = function (field, condition) {\n this.changes.push({\n field: field,\n type: exports.TYPE_ARRAY_ELEMENT_DELETE,\n condition: condition\n });\n };\n /**\n * Get changes\n *\n * @returns {[]}\n */\n Changes.prototype.getChanges = function () {\n return this.changes;\n };\n /**\n * Create\n *\n * @returns {Changes}\n */\n Changes.create = function () {\n return new Changes();\n };\n /**\n * To array\n *\n * @returns {[]}\n */\n Changes.prototype.toArray = function () {\n return JSON.parse(JSON.stringify(this.changes));\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Changes}\n */\n Changes.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var changes = Changes.create();\n changes.changes = array;\n return changes;\n };\n return Changes;\n}());\nexports.Changes = Changes;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * Coordinate Type cast\n * @param coordinate\n */\nvar Coordinate = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param {number} lat\n * @param {number} lon\n */\n function Coordinate(lat, lon) {\n this.lat = lat;\n this.lon = lon;\n }\n /**\n * Get latitude\n *\n * @return float\n */\n Coordinate.prototype.getLatitude = function () {\n return this.lat;\n };\n /**\n * Get longitude\n *\n * @return float\n */\n Coordinate.prototype.getLongitude = function () {\n return this.lon;\n };\n /**\n * To array\n *\n * @return {{lat: number, lon: number}}\n */\n Coordinate.prototype.toArray = function () {\n return {\n lat: this.lat,\n lon: this.lon\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return Coordinate\n *\n * @throws InvalidFormatError\n */\n Coordinate.createFromArray = function (array) {\n if (typeof array.lat == \"undefined\" ||\n typeof array.lon == \"undefined\") {\n throw InvalidFormatError_1.InvalidFormatError.coordinateFormatNotValid();\n }\n return new Coordinate(array.lat, array.lon);\n };\n return Coordinate;\n}());\nexports.Coordinate = Coordinate;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar IndexUUID_1 = require(\"./IndexUUID\");\nvar AppUUID_1 = require(\"./AppUUID\");\n/**\n * Index class\n */\nvar Index = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param uuid\n * @param appUUID\n * @param isOK\n * @param docCount\n * @param size\n */\n function Index(uuid, appUUID, isOK, docCount, size) {\n if (isOK === void 0) { isOK = false; }\n if (docCount === void 0) { docCount = 0; }\n if (size === void 0) { size = '0kb'; }\n this.uuid = uuid;\n this.appUUID = appUUID;\n this.isOK = isOK;\n this.docCount = docCount;\n this.size = size;\n }\n /**\n * Get uuid\n *\n * @return {IndexUUID}\n */\n Index.prototype.getUUID = function () {\n return this.uuid;\n };\n /**\n * Get app id\n *\n * @return {AppUUID}\n */\n Index.prototype.getAppUUID = function () {\n return this.appUUID;\n };\n /**\n * Index is OK\n *\n * @return {boolean}\n */\n Index.prototype.isOk = function () {\n return this.isOK;\n };\n /**\n * Get doc count\n *\n * @return {number}\n */\n Index.prototype.getDocCount = function () {\n return this.docCount;\n };\n /**\n * get size\n *\n * @return {string}\n */\n Index.prototype.getSize = function () {\n return this.size;\n };\n /**\n * To array\n *\n * @returns {{id: string, attributes: {}}}\n */\n Index.prototype.toArray = function () {\n return {\n uuid: this.uuid.toArray(),\n app_id: this.appUUID.toArray(),\n is_ok: this.isOK,\n doc_count: this.docCount,\n size: this.size\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return User\n */\n Index.createFromArray = function (array) {\n if (typeof array.uuid == \"undefined\" ||\n typeof array.app_id == \"undefined\") {\n throw InvalidFormatError_1.InvalidFormatError.indexFormatNotValid();\n }\n return new Index(IndexUUID_1.IndexUUID.createFromArray(array.uuid), AppUUID_1.AppUUID.createFromArray(array.app_id), (typeof array.is_ok == \"undefined\" ? false : array.is_ok), (typeof array.doc_count == \"undefined\" ? 0 : array.doc_count), (typeof array.size == \"undefined\" ? '0kb' : array.size));\n };\n return Index;\n}());\nexports.Index = Index;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * IndexUUID class\n */\nvar IndexUUID = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param id\n */\n function IndexUUID(id) {\n if (id.indexOf('_') >= 0) {\n throw InvalidFormatError_1.InvalidFormatError.indexUUIDFormatNotValid();\n }\n this.id = id;\n }\n /**\n * Create by id\n *\n * @param id\n *\n * @returns {ItemUUID}\n */\n IndexUUID.createById = function (id) {\n return new IndexUUID(id);\n };\n /**\n * Return id\n *\n * @returns {string}\n */\n IndexUUID.prototype.getId = function () {\n return this.id;\n };\n /**\n * To array\n *\n * @returns {{id: *, type: *}}\n */\n IndexUUID.prototype.toArray = function () {\n return {\n id: this.id\n };\n };\n /**\n * Create from array\n *\n * @param array {{id:string, type:string}}\n *\n * @return {ItemUUID}\n */\n IndexUUID.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new IndexUUID(array.id);\n };\n /**\n * Compose unique id\n *\n * @returns {string}\n */\n IndexUUID.prototype.composedUUID = function () {\n return this.id;\n };\n return IndexUUID;\n}());\nexports.IndexUUID = IndexUUID;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar Coordinate_1 = require(\"./Coordinate\");\nvar ItemUUID_1 = require(\"./ItemUUID\");\n/**\n * Item class\n */\nvar Item = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param uuid\n * @param coordinate\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n */\n function Item(uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n this.metadata = {};\n this.indexedMetadata = {};\n this.searchableMetadata = {};\n this.exactMatchingMetadata = [];\n this.suggest = [];\n this.highlights = {};\n this.promoted = false;\n this.uuid = uuid;\n this.coordinate = coordinate;\n this.metadata = metadata;\n this.indexedMetadata = indexedMetadata;\n this.searchableMetadata = searchableMetadata;\n this.exactMatchingMetadata = exactMatchingMetadata;\n this.suggest = suggest;\n }\n /**\n * Create new Item\n *\n * @param uuid\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n * @returns {Item}\n */\n Item.create = function (uuid, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n if (metadata === void 0) { metadata = {}; }\n if (indexedMetadata === void 0) { indexedMetadata = {}; }\n if (searchableMetadata === void 0) { searchableMetadata = {}; }\n if (exactMatchingMetadata === void 0) { exactMatchingMetadata = []; }\n if (suggest === void 0) { suggest = []; }\n return new Item(uuid, null, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest);\n };\n /**\n * Create new located Item\n *\n * @param uuid\n * @param coordinate\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n * @returns {Item}\n */\n Item.createLocated = function (uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n if (metadata === void 0) { metadata = {}; }\n if (indexedMetadata === void 0) { indexedMetadata = {}; }\n if (searchableMetadata === void 0) { searchableMetadata = {}; }\n if (exactMatchingMetadata === void 0) { exactMatchingMetadata = []; }\n if (suggest === void 0) { suggest = []; }\n return new Item(uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest);\n };\n /**\n * Get uuid\n *\n * @returns ItemUUID\n */\n Item.prototype.getUUID = function () {\n return this.uuid;\n };\n /**\n * Get id\n *\n * @returns string\n */\n Item.prototype.getId = function () {\n return this.uuid.getId();\n };\n /**\n * Get type\n *\n * @returns string\n */\n Item.prototype.getType = function () {\n return this.uuid.getType();\n };\n /**\n * Get coordinate\n *\n * @returns Coordinate|null\n */\n Item.prototype.getCoordinate = function () {\n return this.coordinate;\n };\n /**\n * Get distance\n *\n * @returns int\n */\n Item.prototype.getDistance = function () {\n return this.distance;\n };\n /**\n * Get metadata\n *\n * @returns Array\n */\n Item.prototype.getMetadata = function () {\n return this.metadata;\n };\n /**\n * Set metadata\n *\n * @param metadata\n */\n Item.prototype.setMetadata = function (metadata) {\n this.metadata = metadata;\n };\n /**\n * Add metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addMetadata = function (key, value) {\n this.metadata[key] = value;\n };\n /**\n * Get indexed metadata\n *\n * @returns Array\n */\n Item.prototype.getIndexedMetadata = function () {\n return this.indexedMetadata;\n };\n /**\n * Set indexed metadata\n *\n * @param indexedMetadata\n */\n Item.prototype.setIndexedMetadata = function (indexedMetadata) {\n this.indexedMetadata = indexedMetadata;\n };\n /**\n * Add indexed metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addIndexedMetadata = function (key, value) {\n this.indexedMetadata[key] = value;\n };\n /**\n * Get searchable metadata\n *\n * @returns Array\n */\n Item.prototype.getSearchableMetadata = function () {\n return this.searchableMetadata;\n };\n /**\n * Set searchable metadata\n *\n * @param searchableMetadata\n */\n Item.prototype.setSearchableMetadata = function (searchableMetadata) {\n this.searchableMetadata = searchableMetadata;\n };\n /**\n * Add searchable metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addSearchableMetadata = function (key, value) {\n this.searchableMetadata[key] = value;\n };\n /**\n * Get exactMatching metadata\n *\n * @returns Array\n */\n Item.prototype.getExactMatchingMetadata = function () {\n return this.exactMatchingMetadata;\n };\n /**\n * Set exactMatching metadata\n *\n * @param exactMatchingMetadata\n */\n Item.prototype.setExactMatchingMetadata = function (exactMatchingMetadata) {\n this.exactMatchingMetadata = exactMatchingMetadata;\n };\n /**\n * Add exactMatching metadata\n *\n * @param value\n */\n Item.prototype.addExactMatchingMetadata = function (value) {\n this.exactMatchingMetadata.push(value);\n };\n /**\n * Get all metadata\n *\n * @returns {{}}\n */\n Item.prototype.getAllMetadata = function () {\n return tslib_1.__assign({}, this.metadata, this.indexedMetadata);\n };\n /**\n * Get\n *\n * @param key\n *\n * @returns mixed|null\n */\n Item.prototype.get = function (key) {\n var allMetadata = this.getAllMetadata();\n return (typeof allMetadata[key] != \"undefined\")\n ? allMetadata[key]\n : null;\n };\n /**\n * Get suggest\n *\n * @returns Array\n */\n Item.prototype.getSuggest = function () {\n return this.suggest;\n };\n /**\n * Get highlights\n *\n * @returns Array\n */\n Item.prototype.getHighlights = function () {\n return this.highlights;\n };\n /**\n * Get highlight\n *\n * @param key\n *\n * @return string|null\n */\n Item.prototype.getHighlight = function (key) {\n return (typeof this.highlights[key] != \"undefined\")\n ? this.highlights[key]\n : null;\n };\n /**\n * Is promoted\n *\n * @returns boolean\n */\n Item.prototype.isPromoted = function () {\n return this.promoted;\n };\n /**\n * Set score\n *\n * @param score\n *\n * @return {Item}\n */\n Item.prototype.setScore = function (score) {\n this.score = score;\n return this;\n };\n /**\n * Get score\n *\n * @return {number}\n */\n Item.prototype.getScore = function () {\n return this.score;\n };\n /**\n * To array\n */\n Item.prototype.toArray = function () {\n var itemAsArray = {\n uuid: this.uuid.toArray()\n };\n if (this.coordinate instanceof Coordinate_1.Coordinate) {\n itemAsArray.coordinate = this.coordinate.toArray();\n }\n if (Object.keys(this.metadata).length > 0) {\n itemAsArray.metadata = this.metadata;\n }\n if (Object.keys(this.indexedMetadata).length > 0) {\n itemAsArray.indexed_metadata = this.indexedMetadata;\n }\n if (Object.keys(this.searchableMetadata).length > 0) {\n itemAsArray.searchable_metadata = this.searchableMetadata;\n }\n if (this.exactMatchingMetadata.length > 0) {\n itemAsArray.exact_matching_metadata = this.exactMatchingMetadata;\n }\n if (this.suggest.length > 0) {\n itemAsArray.suggest = this.suggest;\n }\n if (Object.keys(this.highlights).length > 0) {\n itemAsArray.highlights = this.highlights;\n }\n if (this.isPromoted()) {\n itemAsArray.is_promoted = true;\n }\n if (typeof this.distance != \"undefined\") {\n itemAsArray.distance = this.distance;\n }\n if (typeof this.score != \"undefined\") {\n itemAsArray.score = this.score;\n }\n return itemAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n */\n Item.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.uuid != \"object\") {\n throw InvalidFormatError_1.InvalidFormatError.itemUUIDRepresentationNotValid();\n }\n if (typeof array.coordinate != \"undefined\" &&\n typeof array.coordinate != \"object\") {\n throw InvalidFormatError_1.InvalidFormatError.coordinateFormatNotValid();\n }\n var item = (typeof array.coordinate == \"object\" &&\n array.coordinate != null)\n ? Item.createLocated(ItemUUID_1.ItemUUID.createFromArray(array.uuid), Coordinate_1.Coordinate.createFromArray(array.coordinate), ((typeof array.metadata == \"undefined\") ? {} : array.metadata), ((typeof array.indexed_metadata == \"undefined\") ? {} : array.indexed_metadata), ((typeof array.searchable_metadata == \"undefined\") ? {} : array.searchable_metadata), ((typeof array.exact_matching_metadata == \"undefined\") ? [] : array.exact_matching_metadata), ((typeof array.suggest == \"undefined\") ? [] : array.suggest))\n : Item.create(ItemUUID_1.ItemUUID.createFromArray(array.uuid), ((typeof array.metadata == \"undefined\") ? {} : array.metadata), ((typeof array.indexed_metadata == \"undefined\") ? {} : array.indexed_metadata), ((typeof array.searchable_metadata == \"undefined\") ? {} : array.searchable_metadata), ((typeof array.exact_matching_metadata == \"undefined\") ? [] : array.exact_matching_metadata), ((typeof array.suggest == \"undefined\") ? [] : array.suggest));\n if (typeof array.distance != \"undefined\" &&\n array.distance != null) {\n item.distance = array.distance;\n }\n if (typeof array.highlights == \"object\" &&\n array.distance != null) {\n item.highlights = array.highlights;\n }\n if (typeof array.is_promoted != \"undefined\" &&\n array.is_promoted != null) {\n item.promoted = array.is_promoted;\n }\n if (typeof array.score != \"undefined\" &&\n array.score != null) {\n item.score = array.score;\n }\n return item;\n };\n /**\n * Compose uuid\n *\n * @returns string\n */\n Item.prototype.composeUUID = function () {\n return this.uuid.composedUUID();\n };\n return Item;\n}());\nexports.Item = Item;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * ItemUUID class\n */\nvar ItemUUID = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param id\n * @param type\n */\n function ItemUUID(id, type) {\n this.id = id;\n this.type = type;\n }\n /**\n * Create composed UUID\n *\n * @param composedUUID\n *\n * @returns {ItemUUID}\n */\n ItemUUID.createByComposedUUID = function (composedUUID) {\n var parts = composedUUID.split(\"~\");\n if (2 != parts.length) {\n throw InvalidFormatError_1.InvalidFormatError.composedItemUUIDNotValid();\n }\n return new ItemUUID(parts[0], parts[1]);\n };\n /**\n * Return id\n *\n * @returns {string}\n */\n ItemUUID.prototype.getId = function () {\n return this.id;\n };\n /**\n * Get type\n *\n * @returns {string}\n */\n ItemUUID.prototype.getType = function () {\n return this.type;\n };\n /**\n * To array\n *\n * @returns {{id: *, type: *}}\n */\n ItemUUID.prototype.toArray = function () {\n return {\n id: this.id,\n type: this.type\n };\n };\n /**\n * Create from array\n *\n * @param array {{id:string, type:string}}\n *\n * @return {ItemUUID}\n */\n ItemUUID.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new ItemUUID(array.id, array.type);\n };\n /**\n * Compose unique id\n *\n * @returns {string}\n */\n ItemUUID.prototype.composedUUID = function () {\n return this.id + \"~\" + this.type;\n };\n return ItemUUID;\n}());\nexports.ItemUUID = ItemUUID;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * User class\n */\nvar Metadata = /** @class */ (function () {\n function Metadata() {\n }\n /**\n * To metadata\n *\n * @param array:{}\n *\n * @returns {string}\n */\n Metadata.toMetadata = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var parts = [];\n for (var key in array) {\n parts.push(key + \"##\" + array[key]);\n }\n return parts.join(\"~~\");\n };\n /**\n * From metadata\n *\n * @param metadata\n *\n * @return {{}}\n */\n Metadata.fromMetadata = function (metadata) {\n var values = {};\n var splittedParts = metadata.split(\"~~\");\n var iterator = 0;\n var size = 0;\n var lastElement = null;\n for (var key in splittedParts) {\n var part = splittedParts[key];\n var parts = part.split(\"##\");\n if (parts.length > 1) {\n lastElement = parts[1];\n values[parts[0]] = lastElement;\n }\n else {\n lastElement = part;\n values[iterator++] = lastElement;\n }\n size++;\n }\n if (size == 1) {\n values = {\n id: lastElement,\n name: lastElement\n };\n }\n if (typeof values.id == \"undefined\") {\n return null;\n }\n return values;\n };\n return Metadata;\n}());\nexports.Metadata = Metadata;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * User class\n */\nvar User = /** @class */ (function () {\n /**\n * Construct\n *\n * @param id string\n * @param attributes Array\n */\n function User(id, attributes) {\n if (attributes === void 0) { attributes = {}; }\n this.id = id;\n this.attributes = attributes;\n }\n /**\n * Return the user id\n *\n * @return {string}\n */\n User.prototype.getId = function () {\n return this.id;\n };\n /**\n * Return array\n *\n * @returns {{}}\n */\n User.prototype.getAttributes = function () {\n return this.attributes;\n };\n /**\n * To array\n *\n * @returns {{id: string, attributes: {}}}\n */\n User.prototype.toArray = function () {\n var array = {\n id: this.id\n };\n if (Object.keys(this.attributes).length > 0) {\n array.attributes = this.attributes;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return User\n */\n User.createFromArray = function (array) {\n if (array == null ||\n typeof array.id == \"undefined\" ||\n array.id == null) {\n throw InvalidFormatError_1.InvalidFormatError.userFormatNotValid();\n }\n var attributes = typeof array.attributes === typeof {}\n ? array.attributes\n : {};\n return new User(array.id, attributes);\n };\n return User;\n}());\nexports.User = User;\n","\"use strict\";\nexports.__esModule = true;\nvar Filter_1 = require(\"./Filter\");\n/**\n * Aggregation constants\n */\nexports.AGGREGATION_SORT_BY_COUNT_ASC = [\"_count\", \"asc\"];\nexports.AGGREGATION_SORT_BY_COUNT_DESC = [\"_count\", \"desc\"];\nexports.AGGREGATION_SORT_BY_NAME_ASC = [\"_term\", \"asc\"];\nexports.AGGREGATION_SORT_BY_NAME_DESC = [\"_term\", \"desc\"];\nexports.AGGREGATION_NO_LIMIT = 0;\n/**\n * Aggregation class\n */\nvar Aggregation = /** @class */ (function () {\n /**\n * Construct\n *\n * @param name\n * @param field\n * @param applicationType\n * @param filterType\n * @param subgroup\n * @param sort\n * @param limit\n */\n function Aggregation(name, field, applicationType, filterType, subgroup, sort, limit) {\n this.subgroup = [];\n this.name = name;\n this.field = field;\n this.applicationType = applicationType;\n this.filterType = filterType;\n this.subgroup = subgroup;\n this.sort = sort;\n this.limit = limit;\n }\n /**\n * Get name\n *\n * @returns {string}\n */\n Aggregation.prototype.getName = function () {\n return this.name;\n };\n /**\n * Get field\n *\n * @returns {string}\n */\n Aggregation.prototype.getField = function () {\n return this.field;\n };\n /**\n * getApplicationType\n *\n * @returns {number}\n */\n Aggregation.prototype.getApplicationType = function () {\n return this.applicationType;\n };\n /**\n * Get filter type\n *\n * @return {string}\n */\n Aggregation.prototype.getFilterType = function () {\n return this.filterType;\n };\n /**\n * Get subgroup\n *\n * @return {[]}\n */\n Aggregation.prototype.getSubgroup = function () {\n return this.subgroup;\n };\n /**\n * Get sort\n *\n * @return {[]}\n */\n Aggregation.prototype.getSort = function () {\n return this.sort;\n };\n /**\n * Get limit\n *\n * @return {number}\n */\n Aggregation.prototype.getLimit = function () {\n return this.limit;\n };\n /**\n * Create\n *\n * @param name\n * @param field\n * @param applicationType\n * @param filterType\n * @param subgroup\n * @param sort\n * @param limit\n *\n * @returns {Aggregation}\n */\n Aggregation.create = function (name, field, applicationType, filterType, subgroup, sort, limit) {\n if (subgroup === void 0) { subgroup = []; }\n if (sort === void 0) { sort = exports.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = exports.AGGREGATION_NO_LIMIT; }\n return new Aggregation(name, field, applicationType, filterType, subgroup, sort, limit);\n };\n /**\n * To array\n *\n * @returns {Array}\n */\n Aggregation.prototype.toArray = function () {\n var aggregationAsArray = {\n name: this.name\n };\n if (this.field != \"uuid.type\") {\n aggregationAsArray.field = this.field;\n }\n if (this.applicationType != Filter_1.FILTER_AT_LEAST_ONE) {\n aggregationAsArray.application_type = this.applicationType;\n }\n if (this.filterType != Filter_1.FILTER_TYPE_FIELD) {\n aggregationAsArray.filter_type = this.filterType;\n }\n if (this.subgroup.length > 0) {\n aggregationAsArray.subgroup = this.subgroup;\n }\n if (JSON.stringify(this.sort) !== JSON.stringify(exports.AGGREGATION_SORT_BY_COUNT_DESC)) {\n aggregationAsArray.sort = this.sort;\n }\n if (this.limit != exports.AGGREGATION_NO_LIMIT) {\n aggregationAsArray.limit = this.limit;\n }\n return aggregationAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Aggregation}\n */\n Aggregation.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.field == \"undefined\") {\n array.field = \"uuid.type\";\n }\n if (typeof array.application_type == \"undefined\") {\n array.application_type = Filter_1.FILTER_AT_LEAST_ONE;\n }\n if (typeof array.filter_type == \"undefined\") {\n array.filter_type = Filter_1.FILTER_TYPE_FIELD;\n }\n if (typeof array.subgroup == \"undefined\") {\n array.subgroup = [];\n }\n if (typeof array.sort == \"undefined\") {\n array.sort = exports.AGGREGATION_SORT_BY_COUNT_DESC;\n }\n if (typeof array.limit == \"undefined\") {\n array.limit = exports.AGGREGATION_NO_LIMIT;\n }\n return Aggregation.create(array.name, array.field, array.application_type, array.filter_type, array.subgroup, array.sort, array.limit);\n };\n return Aggregation;\n}());\nexports.Aggregation = Aggregation;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * filter constants\n */\nexports.FILTER_MUST_ALL = 4;\nexports.FILTER_MUST_ALL_WITH_LEVELS = 5;\nexports.FILTER_AT_LEAST_ONE = 8;\nexports.FILTER_EXCLUDE = 16;\nexports.FILTER_PROMOTE = 32;\nexports.FILTER_TYPE_FIELD = \"field\";\nexports.FILTER_TYPE_RANGE = \"range\";\nexports.FILTER_TYPE_DATE_RANGE = \"date_range\";\nexports.FILTER_TYPE_GEO = \"geo\";\nexports.FILTER_TYPE_QUERY = \"query\";\n/**\n * Filter class\n */\nvar Filter = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param field\n * @param values\n * @param applicationType\n * @param filterType\n * @param filterTerms\n */\n function Filter(field, values, applicationType, filterType, filterTerms) {\n this.field = field;\n this.values = values;\n this.applicationType = applicationType;\n this.filterType = filterType;\n this.filterTerms = filterTerms;\n }\n /**\n * Get field\n *\n * @returns {string}\n */\n Filter.prototype.getField = function () {\n return this.field;\n };\n /**\n * Get values\n *\n * @returns {any}\n */\n Filter.prototype.getValues = function () {\n return this.values;\n };\n /**\n * Has value\n *\n * @param value\n *\n * @returns {boolean}\n */\n Filter.prototype.hasValue = function (value) {\n return typeof this.values[value] == \"undefined\";\n };\n /**\n * getApplicationType\n *\n * @returns {number}\n */\n Filter.prototype.getApplicationType = function () {\n return this.applicationType;\n };\n /**\n * Get filter type\n *\n * @return {string}\n */\n Filter.prototype.getFilterType = function () {\n return this.filterType;\n };\n /**\n * Get filter type\n *\n * @return {{}}\n */\n Filter.prototype.getFilterTerms = function () {\n return this.filterTerms;\n };\n /**\n * Create\n *\n * @param field\n * @param values\n * @param applicationType\n * @param filterType\n * @param filterTerms\n *\n * @return {Filter}\n */\n Filter.create = function (field, values, applicationType, filterType, filterTerms) {\n if (filterTerms === void 0) { filterTerms = []; }\n return new Filter(field, values, applicationType, filterType, filterTerms);\n };\n /**\n * To array\n *\n * @returns {Array}\n */\n Filter.prototype.toArray = function () {\n var filterAsArray = {};\n if (this.field != \"uuid.type\") {\n filterAsArray.field = this.field;\n }\n if (this.values.length > 0 ||\n Object.keys(this.values).length > 0) {\n filterAsArray.values = this.values;\n }\n if (this.applicationType != exports.FILTER_AT_LEAST_ONE) {\n filterAsArray.application_type = this.applicationType;\n }\n if (this.filterType != exports.FILTER_TYPE_FIELD) {\n filterAsArray.filter_type = this.filterType;\n }\n if (this.filterTerms.length > 0) {\n filterAsArray.filter_terms = this.filterTerms;\n }\n return filterAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Filter}\n */\n Filter.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.field == \"undefined\") {\n array.field = \"uuid.type\";\n }\n if (typeof array.values == \"undefined\") {\n array.values = [];\n }\n if (typeof array.application_type == \"undefined\") {\n array.application_type = exports.FILTER_AT_LEAST_ONE;\n }\n if (typeof array.filter_type == \"undefined\") {\n array.filter_type = exports.FILTER_TYPE_FIELD;\n }\n if (typeof array.filter_terms == \"undefined\") {\n array.filter_terms = [];\n }\n return Filter.create(array.field, array.values, array.application_type, array.filter_type, array.filter_terms);\n };\n /**\n * Get path by field.\n *\n * @param field\n *\n * @returns {string}\n */\n Filter.getFilterPathByField = function (field) {\n return ([\"id\", \"type\"].indexOf(field) > -1)\n ? \"uuid.\" + field\n : \"indexed_metadata.\" + field;\n };\n return Filter;\n}());\nexports.Filter = Filter;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar Coordinate_1 = require(\"../Model/Coordinate\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\nvar User_1 = require(\"../Model/User\");\nvar Aggregation_1 = require(\"./Aggregation\");\nvar Filter_1 = require(\"./Filter\");\nvar Filter_2 = require(\"./Filter\");\nvar Aggregation_2 = require(\"./Aggregation\");\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar Filter_3 = require(\"./Filter\");\nvar ScoreStrategy_1 = require(\"./ScoreStrategy\");\nvar SortBy_1 = require(\"./SortBy\");\n/**\n * Query constants\n */\nexports.QUERY_DEFAULT_FROM = 0;\nexports.QUERY_DEFAULT_PAGE = 1;\nexports.QUERY_DEFAULT_SIZE = 10;\nexports.QUERY_INFINITE_SIZE = 1000;\nexports.NO_MIN_SCORE = 0.0;\n/**\n * Query class\n */\nvar Query = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param queryText\n */\n function Query(queryText) {\n this.fields = [];\n this.universeFilters = {};\n this.filters = {};\n this.itemsPromoted = [];\n this.aggregations = {};\n this.filterFields = [];\n this.minScore = exports.NO_MIN_SCORE;\n this.sortByInstance = SortBy_1.SortBy.create();\n this.filters._query = Filter_1.Filter.create(\"\", [queryText], 0, Filter_3.FILTER_TYPE_QUERY);\n }\n /**\n * Created located\n *\n * @param coordinate\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Query.createLocated = function (coordinate, queryText, page, size) {\n if (page === void 0) { page = exports.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = exports.QUERY_DEFAULT_SIZE; }\n var query = Query.create(queryText, page, size);\n query.coordinate = coordinate;\n return query;\n };\n /**\n * Create\n *\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Query.create = function (queryText, page, size) {\n if (page === void 0) { page = exports.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = exports.QUERY_DEFAULT_SIZE; }\n page = Math.max(1, page);\n var query = new Query(queryText);\n query.from = (page - 1) * size;\n query.size = size;\n query.page = page;\n return query;\n };\n /**\n * Create match all\n *\n * @return {Query}\n */\n Query.createMatchAll = function () {\n return Query.create(\"\", exports.QUERY_DEFAULT_PAGE, exports.QUERY_DEFAULT_SIZE);\n };\n /**\n * Create by UUID\n *\n * @param uuid\n *\n * @return {Query}\n */\n Query.createByUUID = function (uuid) {\n return Query.createByUUIDs(uuid);\n };\n /**\n * Create by UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.createByUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n var ids = [];\n for (var i in uuids) {\n ids.push(uuids[i].composedUUID());\n }\n var query = Query.create(\"\", exports.QUERY_DEFAULT_PAGE, ids.length)\n .disableAggregations()\n .disableSuggestions();\n query.filters._id = Filter_1.Filter.create(\"_id\", ids, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD);\n return query;\n };\n /**\n * set fields\n *\n * @param fields\n *\n * @return {Query}\n */\n Query.prototype.setFields = function (fields) {\n this.fields = fields;\n return this;\n };\n /**\n * get fields\n *\n * @return {string[]}\n */\n Query.prototype.getFields = function () {\n return this.fields;\n };\n /**\n * Filter universe by types\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByTypes = function (values) {\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"type\");\n if (values.length > 0) {\n this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[\"type\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters.type;\n }\n return this;\n };\n /**\n * Filter by types\n *\n * @param values\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByTypes = function (values, aggregate, aggregationSort) {\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a, _b;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"type\");\n if (values.length > 0) {\n this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[\"type\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters.type;\n }\n if (aggregate) {\n this.aggregations = tslib_1.__assign({}, this.aggregations, (_b = {}, _b[\"type\"] = Aggregation_1.Aggregation.create(\"type\", fieldPath, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort), _b));\n }\n return this;\n };\n /**\n * Filter universe by ids\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByIds = function (values) {\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"id\");\n if (values.length > 0) {\n this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[\"id\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters.id;\n }\n return this;\n };\n /**\n * Filter by ids\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterByIds = function (values) {\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"id\");\n if (values.length > 0) {\n this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[\"id\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters.id;\n }\n return this;\n };\n /**\n * Filter universe by\n *\n * @param field\n * @param values\n * @param applicationType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseBy = function (field, values, applicationType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length > 0) {\n this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[field] = Filter_1.Filter.create(fieldPath, values, applicationType, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters[field];\n }\n return this;\n };\n /**\n * Filter by\n *\n * @param filterName\n * @param field\n * @param values\n * @param applicationType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterBy = function (filterName, field, values, applicationType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length > 0) {\n this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[filterName] = Filter_1.Filter.create(fieldPath, values, applicationType, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters[filterName];\n }\n if (aggregate) {\n this.aggregateBy(filterName, field, applicationType, aggregationSort);\n }\n return this;\n };\n /**\n * Filter universe by range\n *\n * @param field\n * @param values\n * @param applicationType\n * @param rangeType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByRange = function (field, values, applicationType, rangeType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length > 0) {\n this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[field] = Filter_1.Filter.create(fieldPath, values, applicationType, rangeType), _a));\n }\n else {\n delete this.universeFilters[field];\n }\n return this;\n };\n /**\n * Filter universe by date range\n *\n * @param field\n * @param values\n * @param applicationType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByDateRange = function (field, values, applicationType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n return this.filterUniverseByRange(field, values, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE);\n };\n /**\n * Filter by range\n *\n * @param filterName\n * @param field\n * @param options\n * @param values\n * @param applicationType\n * @param rangeType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByRange = function (filterName, field, options, values, applicationType, rangeType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length !== 0) {\n this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[filterName] = Filter_1.Filter.create(fieldPath, values, applicationType, rangeType), _a));\n }\n else {\n delete this.filters[filterName];\n }\n if (aggregate) {\n this.aggregateByRange(filterName, fieldPath, options, applicationType, rangeType, aggregationSort);\n }\n return this;\n };\n /**\n * Filter by date range\n *\n * @param filterName\n * @param field\n * @param options\n * @param values\n * @param applicationType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByDateRange = function (filterName, field, options, values, applicationType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n return this.filterByRange(filterName, field, options, values, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE, aggregate, aggregationSort);\n };\n /**\n * Filter universe by location\n *\n * @param locationRange\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByLocation = function (locationRange) {\n var _a;\n this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[\"coordinate\"] = Filter_1.Filter.create(\"coordinate\", locationRange.toArray(), Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_GEO), _a));\n return this;\n };\n /**\n * Set filter fields\n *\n * @param filterFields\n *\n * @return {Query}\n */\n Query.prototype.setFilterFields = function (filterFields) {\n this.filterFields = filterFields;\n return this;\n };\n /**\n * Get filter fields\n *\n * @return {string[]}\n */\n Query.prototype.getFilterFields = function () {\n return this.filterFields;\n };\n /**\n * Sort by\n *\n * @param sortBy\n *\n * @return {Query}\n */\n Query.prototype.sortBy = function (sortBy) {\n if (sortBy.isSortedByGeoDistance()) {\n if (!(this.coordinate instanceof Coordinate_1.Coordinate)) {\n throw InvalidFormatError_1.InvalidFormatError.querySortedByDistanceWithoutCoordinate();\n }\n sortBy.setCoordinate(this.coordinate);\n }\n this.sortByInstance = sortBy;\n return this;\n };\n /**\n * Aggregate by\n *\n * @param filterName\n * @param field\n * @param applicationType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateBy = function (filterName, field, applicationType, aggregationSort, limit) {\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n var _a;\n this.aggregations = tslib_1.__assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Filter_1.Filter.getFilterPathByField(field), applicationType, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort, limit), _a));\n return this;\n };\n /**\n * Aggregate by range\n *\n * @param filterName\n * @param field\n * @param options\n * @param applicationType\n * @param rangeType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateByRange = function (filterName, field, options, applicationType, rangeType, aggregationSort, limit) {\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n var _a;\n if (options.length === 0) {\n return this;\n }\n this.aggregations = tslib_1.__assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Filter_1.Filter.getFilterPathByField(field), applicationType, rangeType, options, aggregationSort, limit), _a));\n return this;\n };\n /**\n * Aggregate by date range\n *\n * @param filterName\n * @param field\n * @param options\n * @param applicationType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateByDateRange = function (filterName, field, options, applicationType, aggregationSort, limit) {\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n return this.aggregateByRange(filterName, field, options, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE, aggregationSort, limit);\n };\n /**\n * Get aggregations\n *\n * @return {{}}\n */\n Query.prototype.getAggregations = function () {\n return this.aggregations;\n };\n /**\n * Get aggregation by name\n *\n * @param aggregationName\n *\n * @return {Aggregation|null}\n */\n Query.prototype.getAggregation = function (aggregationName) {\n return this.aggregations[aggregationName] instanceof Aggregation_1.Aggregation\n ? this.aggregations[aggregationName]\n : null;\n };\n /**\n * Get query text\n *\n * @return {string}\n */\n Query.prototype.getQueryText = function () {\n var filter = this.filters._query;\n return filter instanceof Filter_1.Filter\n ? filter.getValues()[0]\n : \"\";\n };\n /**\n * Get universe filters\n *\n * @return {{}}\n */\n Query.prototype.getUniverseFilters = function () {\n return this.universeFilters;\n };\n /**\n * Get universe filter by name\n *\n * @param filterName\n *\n * @return {Filter|null}\n */\n Query.prototype.getUniverseFilter = function (filterName) {\n return this.universeFilters[filterName] instanceof Filter_1.Filter\n ? this.universeFilters[filterName]\n : null;\n };\n /**\n * Get filters\n *\n * @return {{}}\n */\n Query.prototype.getFilters = function () {\n return this.filters;\n };\n /**\n * Get filter by name\n *\n * @param filterName\n *\n * @return {Filter|null}\n */\n Query.prototype.getFilter = function (filterName) {\n return this.filters[filterName] instanceof Filter_1.Filter\n ? this.filters[filterName]\n : null;\n };\n /**\n * Get filter by field\n *\n * @param fieldName\n *\n * @return {Filter|null}\n */\n Query.prototype.getFilterByField = function (fieldName) {\n var fieldPath = Filter_1.Filter.getFilterPathByField(fieldName);\n for (var i in this.filters) {\n if (this.filters[i].getField() == fieldPath) {\n return this.filters[i];\n }\n }\n return null;\n };\n /**\n * Get sort by\n *\n * @return {SortBy}\n */\n Query.prototype.getSortBy = function () {\n return this.sortByInstance;\n };\n /**\n * Get from\n *\n * @return {number}\n */\n Query.prototype.getFrom = function () {\n return this.from;\n };\n /**\n * Get size\n *\n * @return {number}\n */\n Query.prototype.getSize = function () {\n return this.size;\n };\n /**\n * Get page\n *\n * @return {number}\n */\n Query.prototype.getPage = function () {\n return this.page;\n };\n /**\n * Enable results\n *\n * @return {Query}\n */\n Query.prototype.enableResults = function () {\n this.resultsEnabled = true;\n return this;\n };\n /**\n * Disable results\n *\n * @return {Query}\n */\n Query.prototype.disableResults = function () {\n this.resultsEnabled = false;\n return this;\n };\n /**\n * Are results enabled\n *\n * @return {boolean}\n */\n Query.prototype.areResultsEnabled = function () {\n return this.resultsEnabled;\n };\n /**\n * Enable aggregations\n *\n * @return {Query}\n */\n Query.prototype.enableAggregations = function () {\n this.aggregationsEnabled = true;\n return this;\n };\n /**\n * Disable aggregations\n *\n * @return {Query}\n */\n Query.prototype.disableAggregations = function () {\n this.aggregationsEnabled = false;\n return this;\n };\n /**\n * Are aggregations enabled\n *\n * @return {boolean}\n */\n Query.prototype.areAggregationsEnabled = function () {\n return this.aggregationsEnabled;\n };\n /**\n * Enable suggestions\n *\n * @return {Query}\n */\n Query.prototype.enableSuggestions = function () {\n this.suggestionsEnabled = true;\n return this;\n };\n /**\n * Disable suggestions\n *\n * @return {Query}\n */\n Query.prototype.disableSuggestions = function () {\n this.suggestionsEnabled = false;\n return this;\n };\n /**\n * Are suggestions enabled\n *\n * @return {boolean}\n */\n Query.prototype.areSuggestionsEnabled = function () {\n return this.suggestionsEnabled;\n };\n /**\n * Enable highlights\n *\n * @return {Query}\n */\n Query.prototype.enableHighlights = function () {\n this.highlightsEnabled = true;\n return this;\n };\n /**\n * Disable highlights\n *\n * @return {Query}\n */\n Query.prototype.disableHighlights = function () {\n this.highlightsEnabled = false;\n return this;\n };\n /**\n * Are highlights enabled\n *\n * @return {boolean}\n */\n Query.prototype.areHighlightsEnabled = function () {\n return this.highlightsEnabled;\n };\n /**\n * Promote uuid\n *\n * @param itemUUID\n *\n * @return {Query}\n */\n Query.prototype.promoteUUID = function (itemUUID) {\n this\n .itemsPromoted\n .push(itemUUID);\n return this;\n };\n /**\n * Promote UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.prototype.promoteUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n this.itemsPromoted = uuids;\n return this;\n };\n /**\n * Get promoted UUIDs\n *\n * @return {ItemUUID[]}\n */\n Query.prototype.getItemsPromoted = function () {\n return this.itemsPromoted;\n };\n /**\n * Exclude id\n *\n * @param itemUUID\n *\n * @return {Query}\n */\n Query.prototype.excludeUUID = function (itemUUID) {\n this.excludeUUIDs(itemUUID);\n return this;\n };\n /**\n * Exclude UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.prototype.excludeUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n var _a;\n this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[\"excluded_ids\"] = Filter_1.Filter.create(\"_id\", uuids.map(function (uuid) { return uuid.composedUUID(); }), Filter_2.FILTER_EXCLUDE, Filter_2.FILTER_TYPE_FIELD), _a));\n return this;\n };\n /**\n * Get score strategy\n *\n * @return {ScoreStrategy}\n */\n Query.prototype.getScoreStrategy = function () {\n return this.scoreStrategy;\n };\n /**\n * Set score strategy\n *\n * @param scoreStrategy\n */\n Query.prototype.setScoreStrategy = function (scoreStrategy) {\n this.scoreStrategy = scoreStrategy;\n return this;\n };\n /**\n * Get fuzziness\n *\n * @return any\n */\n Query.prototype.getFuzziness = function () {\n return this.fuzziness;\n };\n /**\n * Set fuzziness\n *\n * @param fuzziness\n *\n * @return {Query}\n */\n Query.prototype.setFuzziness = function (fuzziness) {\n this.fuzziness = fuzziness;\n return this;\n };\n /**\n * Set auto fuzziness\n *\n * @return {Query}\n */\n Query.prototype.setAutoFuzziness = function () {\n this.fuzziness = 'AUTO';\n return this;\n };\n /**\n * Get min score\n *\n * @return any\n */\n Query.prototype.getMinScore = function () {\n return this.minScore;\n };\n /**\n * Set min score\n *\n * @param minScore\n *\n * @return {Query}\n */\n Query.prototype.setMinScore = function (minScore) {\n this.minScore = minScore;\n return this;\n };\n /**\n * By user\n *\n * @param user\n *\n * @return {Query}\n */\n Query.prototype.byUser = function (user) {\n this.user = user;\n return this;\n };\n /**\n * By anyone\n *\n * @return {null}\n */\n Query.prototype.anonymously = function () {\n this.user = null;\n return null;\n };\n /**\n * Get user\n *\n * @return {User}\n */\n Query.prototype.getUser = function () {\n return this.user;\n };\n /**\n * To array\n *\n * @return {any}\n */\n Query.prototype.toArray = function () {\n var array = {};\n if (this.getQueryText() !== \"\") {\n array.q = this.getQueryText();\n }\n if (this.coordinate instanceof Coordinate_1.Coordinate) {\n array.coordinate = this.coordinate.toArray();\n }\n /**\n * Fields\n */\n if (this.fields instanceof Array &&\n this.fields.length > 0) {\n array.fields = this.fields;\n }\n /**\n * Universe Filters\n */\n if (Object.keys(this.universeFilters).length) {\n array.universe_filters = {};\n for (var i in this.universeFilters) {\n var universeFilter = this.universeFilters[i];\n array.universe_filters[i] = universeFilter.toArray();\n }\n }\n /**\n * Filters\n */\n if (this.filters instanceof Object &&\n Object.keys(this.filters).length) {\n array.filters = {};\n for (var i in this.filters) {\n var filter = this.filters[i];\n if (filter.getFilterType() !== Filter_3.FILTER_TYPE_QUERY) {\n array.filters[i] = filter.toArray();\n }\n }\n }\n /**\n * Aggregations\n */\n if (this.aggregations instanceof Object &&\n Object.keys(this.aggregations).length) {\n array.aggregations = {};\n for (var i in this.aggregations) {\n var aggregation = this.aggregations[i];\n array.aggregations[i] = aggregation.toArray();\n }\n }\n /**\n * Sort\n */\n var sort = this.sortByInstance.toArray();\n if (Object.keys(sort).length) {\n array.sort = sort;\n }\n /**\n * Page\n */\n var page = this.page;\n if (page !== exports.QUERY_DEFAULT_PAGE) {\n array.page = page;\n }\n /**\n * Size\n */\n var size = this.size;\n if (size !== exports.QUERY_DEFAULT_SIZE) {\n array.size = size;\n }\n /**\n * Booleans\n */\n if (this.resultsEnabled === false) {\n array.results_enabled = false;\n }\n if (this.suggestionsEnabled === true) {\n array.suggestions_enabled = true;\n }\n if (this.highlightsEnabled === true) {\n array.highlights_enabled = true;\n }\n if (this.aggregationsEnabled === false) {\n array.aggregations_enabled = false;\n }\n /**\n * Filter fields\n */\n if (this.filterFields instanceof Array &&\n this.filterFields.length > 0) {\n array.filter_fields = this.filterFields;\n }\n /**\n * Score strategy\n */\n if (this.scoreStrategy instanceof ScoreStrategy_1.ScoreStrategy) {\n var scoreStrategyAsArray = this.scoreStrategy.toArray();\n if (Object.keys(scoreStrategyAsArray).length > 0) {\n array.score_strategy = scoreStrategyAsArray;\n }\n }\n if (this.fuzziness !== null) {\n array.fuzziness = this.fuzziness;\n }\n /**\n * Min score\n */\n var minScore = this.minScore;\n if (minScore !== exports.NO_MIN_SCORE) {\n array.min_score = minScore;\n }\n /**\n * User\n */\n if (this.user instanceof User_1.User) {\n var userAsArray = this.user.toArray();\n if (Object.keys(userAsArray).length > 0) {\n array.user = userAsArray;\n }\n }\n /**\n * items promoted\n */\n if (this.itemsPromoted.length > 0) {\n array.items_promoted = [];\n for (var i in this.itemsPromoted) {\n array\n .items_promoted\n .push(this.itemsPromoted[i].toArray());\n }\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Query}\n */\n Query.createFromArray = function (array) {\n var query = array.coordinate instanceof Object\n ? Query.createLocated(Coordinate_1.Coordinate.createFromArray(array.coordinate), array.q ? array.q : \"\", array.page ? array.page : exports.QUERY_DEFAULT_PAGE, array.size ? array.size : exports.QUERY_DEFAULT_SIZE)\n : Query.create(array.q ? array.q : \"\", array.page ? array.page : exports.QUERY_DEFAULT_PAGE, array.size ? array.size : exports.QUERY_DEFAULT_SIZE);\n /**\n * Fields\n */\n query.fields = array.fields instanceof Array\n ? array.fields\n : [];\n /**\n * Aggregations\n */\n var aggregationsAsArray = typeof array.aggregations === typeof {}\n ? array.aggregations\n : {};\n for (var i in aggregationsAsArray) {\n query.aggregations[i] = Aggregation_1.Aggregation.createFromArray(aggregationsAsArray[i]);\n }\n /**\n * Sort\n */\n var sortAsArray = typeof array.sort === typeof {}\n ? array.sort\n : {};\n if (Object.keys(sortAsArray).length > 0) {\n query.sortByInstance = SortBy_1.SortBy.createFromArray(sortAsArray);\n }\n /**\n * Filters\n */\n var filtersAsArray = typeof array.filters === typeof {}\n ? array.filters\n : {};\n for (var i in filtersAsArray) {\n query.filters[i] = Filter_1.Filter.createFromArray(filtersAsArray[i]);\n }\n /**\n * Universe Filters\n */\n var universeFiltersAsArray = typeof array.universe_filters === typeof {}\n ? array.universe_filters\n : {};\n for (var i in universeFiltersAsArray) {\n query.universeFilters[i] = Filter_1.Filter.createFromArray(universeFiltersAsArray[i]);\n }\n /**\n * Booleans\n */\n query.resultsEnabled = typeof array.results_enabled === \"boolean\"\n ? array.results_enabled\n : true;\n query.suggestionsEnabled = typeof array.suggestions_enabled === \"boolean\"\n ? array.suggestions_enabled\n : false;\n query.aggregationsEnabled = typeof array.aggregations_enabled === \"boolean\"\n ? array.aggregations_enabled\n : true;\n query.highlightsEnabled = typeof array.highlights_enabled === \"boolean\"\n ? array.highlights_enabled\n : false;\n query.fuzziness = array.fuzziness;\n query.minScore = array.min_score ? array.min_score : exports.NO_MIN_SCORE;\n /**\n * Items promoted\n */\n var itemsPromotedAsArray = typeof array.items_promoted === typeof {}\n ? array.items_promoted\n : {};\n for (var i in itemsPromotedAsArray) {\n query\n .itemsPromoted\n .push(ItemUUID_1.ItemUUID.createFromArray(itemsPromotedAsArray[i]));\n }\n /**\n * Filter fields\n */\n query.filterFields = array.filter_fields instanceof Array\n ? array.filter_fields\n : [];\n query.scoreStrategy = array.score_strategy instanceof Object\n ? ScoreStrategy_1.ScoreStrategy.createFromArray(array.score_stategy)\n : null;\n query.user = array.user instanceof Object\n ? User_1.User.createFromArray(array.user)\n : null;\n return query;\n };\n return Query;\n}());\nexports.Query = Query;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Aggregation constants\n */\nexports.RANGE_ZERO = 0;\nexports.RANGE_INFINITE = -1;\nexports.RANGE_SEPARATOR = \"..\";\n/**\n * Filter class\n */\nvar Range = /** @class */ (function () {\n function Range() {\n }\n /**\n * Strong to array\n *\n * @param string\n *\n * @returns {[number, number]}\n */\n Range.stringToArray = function (string) {\n var parts = string.split(exports.RANGE_SEPARATOR);\n var from = parts[0];\n var to = parts[1];\n var finalFrom = exports.RANGE_ZERO;\n var finalTo = exports.RANGE_INFINITE;\n if (from != \"\") {\n finalFrom = parseInt(from);\n }\n if (to != \"\") {\n finalTo = parseInt(to);\n }\n return [finalFrom, finalTo];\n };\n /**\n * Array to string\n *\n * @param values\n *\n * @return {string}\n */\n Range.arrayToString = function (values) {\n var finalValues = [\"\", \"\"];\n if (values[0] != exports.RANGE_ZERO) {\n finalValues[0] = String(values[0]);\n }\n if (values[1] != exports.RANGE_INFINITE) {\n finalValues[1] = String(values[1]);\n }\n return finalValues.join(exports.RANGE_SEPARATOR);\n };\n /**\n * Create ranges\n *\n * @param from\n * @param to\n * @param incremental\n */\n Range.createRanges = function (from, to, incremental) {\n var ranges = [];\n var nextTo;\n while (from < to) {\n nextTo = from + incremental;\n ranges.push(from + exports.RANGE_SEPARATOR + nextTo);\n from = nextTo;\n }\n return ranges;\n };\n return Range;\n}());\nexports.Range = Range;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Aggregation constants\n */\nexports.SCORE_STRATEGY_DEFAULT = 0;\nexports.SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD = 1;\nexports.SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION = 2;\n/**\n * ScoreStrategy\n */\nvar ScoreStrategy = /** @class */ (function () {\n function ScoreStrategy() {\n this.type = exports.SCORE_STRATEGY_DEFAULT;\n this.innerFunction = null;\n }\n /**\n * Get type\n *\n * @returns {number}\n */\n ScoreStrategy.prototype.getType = function () {\n return this.type;\n };\n /**\n * Get function\n *\n * @returns {string}\n */\n ScoreStrategy.prototype.getFunction = function () {\n return this.innerFunction;\n };\n /**\n * Create default\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createDefault = function () {\n return new ScoreStrategy();\n };\n /**\n * Create relevance boosting\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createRelevanceBoosting = function () {\n var scoreStrategy = ScoreStrategy.createDefault();\n scoreStrategy.type = exports.SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD;\n return scoreStrategy;\n };\n /**\n * Create relevance boosting\n *\n * @param innerFunction\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createCustomFunction = function (innerFunction) {\n var scoreStrategy = ScoreStrategy.createDefault();\n scoreStrategy.type = exports.SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION;\n scoreStrategy.innerFunction = innerFunction;\n return scoreStrategy;\n };\n /**\n *\n * @return {{type: number, function: string}}\n */\n ScoreStrategy.prototype.toArray = function () {\n return {\n type: this.type,\n \"function\": this.innerFunction\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var scoreStrategy = ScoreStrategy.createDefault();\n if (typeof array.type == \"undefined\") {\n array.type = exports.SCORE_STRATEGY_DEFAULT;\n }\n if (typeof array[\"function\"] == \"undefined\") {\n array.innerFunction = null;\n }\n scoreStrategy.type = array.type;\n scoreStrategy.innerFunction = array[\"function\"];\n return scoreStrategy;\n };\n return ScoreStrategy;\n}());\nexports.ScoreStrategy = ScoreStrategy;\n","\"use strict\";\nexports.__esModule = true;\n/**\n export * Sort by constants\n */\nexports.SORT_BY_TYPE_FIELD = 1;\nexports.SORT_BY_TYPE_NESTED = 2;\nexports.SORT_BY_ASC = \"asc\";\nexports.SORT_BY_DESC = \"desc\";\nexports.SORT_BY_MODE_AVG = \"avg\";\nexports.SORT_BY_MODE_SUM = \"sum\";\nexports.SORT_BY_MODE_MIN = \"min\";\nexports.SORT_BY_MODE_MAX = \"max\";\nexports.SORT_BY_MODE_MEDIAN = \"median\";\nexports.SORT_BY_SCORE = {\n _score: {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_RANDOM = {\n random: {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_AL_TUN_TUN = exports.SORT_BY_RANDOM;\nexports.SORT_BY_ID_ASC = {\n \"uuid.id\": {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_ID_DESC = {\n \"uuid.id\": {\n order: exports.SORT_BY_DESC\n }\n};\nexports.SORT_BY_TYPE_ASC = {\n \"uuid.type\": {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_TYPE_DESC = {\n \"uuid.type\": {\n order: exports.SORT_BY_DESC\n }\n};\nexports.SORT_BY_LOCATION_KM_ASC = {\n _geo_distance: {\n order: exports.SORT_BY_ASC,\n unit: \"km\"\n }\n};\nexports.SORT_BY_LOCATION_MI_ASC = {\n _geo_distance: {\n order: exports.SORT_BY_DESC,\n unit: \"mi\"\n }\n};\nvar Coordinate_1 = require(\"../Model/Coordinate\");\nvar Filter_1 = require(\"./Filter\");\n/**\n * ScoreStrategy\n */\nvar SortBy = /** @class */ (function () {\n function SortBy() {\n this.sortsBy = [];\n }\n /**\n * Create\n *\n * @return {SortBy}\n */\n SortBy.create = function () {\n return new SortBy;\n };\n /**\n * Sort By fields values\n *\n * @param shortSortByElements\n *\n * @return {SortBy}\n */\n SortBy.byFieldsValues = function (shortSortByElements) {\n var sortBy = SortBy.create();\n for (var key in shortSortByElements) {\n sortBy.byFieldValue(key, shortSortByElements[key]);\n }\n return sortBy;\n };\n /**\n * All\n *\n * @return {Array}\n */\n SortBy.prototype.all = function () {\n return this.sortsBy.length > 0\n ? this.sortsBy\n : [exports.SORT_BY_SCORE];\n };\n /**\n * Sort by value\n *\n * @param value\n *\n * @return {SortBy}\n */\n SortBy.prototype.byValue = function (value) {\n if (exports.SORT_BY_SCORE != value &&\n exports.SORT_BY_RANDOM != value) {\n if (typeof value.type == \"undefined\") {\n value.type = exports.SORT_BY_TYPE_FIELD;\n }\n }\n if (exports.SORT_BY_SCORE != value) {\n this.sortsBy.push(value);\n }\n return this;\n };\n /**\n * Sort by field value\n *\n * @param field\n * @param order\n *\n * @return {SortBy}\n */\n SortBy.prototype.byFieldValue = function (field, order) {\n var object = {\n type: exports.SORT_BY_TYPE_FIELD\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Sort by nested field\n *\n * @param field\n * @param order\n * @param mode\n *\n * @return {SortBy}\n */\n SortBy.prototype.byNestedField = function (field, order, mode) {\n if (mode === void 0) { mode = exports.SORT_BY_MODE_AVG; }\n var object = {\n type: exports.SORT_BY_TYPE_NESTED,\n mode: mode\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Sort by nested field and filter\n *\n * @param field\n * @param order\n * @param filter\n * @param mode\n *\n * @return {SortBy}\n */\n SortBy.prototype.byNestedFieldAndFilter = function (field, order, filter, mode) {\n if (mode === void 0) { mode = exports.SORT_BY_MODE_AVG; }\n var fieldPath = Filter_1.Filter.getFilterPathByField(filter.getField());\n var filterAsArray = filter.toArray();\n filterAsArray.field = fieldPath;\n filter = Filter_1.Filter.createFromArray(filterAsArray);\n var object = {\n type: exports.SORT_BY_TYPE_NESTED,\n mode: mode,\n filter: filter\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Is sorted by geo distance\n *\n * @return {boolean}\n */\n SortBy.prototype.isSortedByGeoDistance = function () {\n for (var i in this.sortsBy) {\n if (typeof this.sortsBy[i]._geo_distance === typeof {}) {\n return true;\n }\n }\n return false;\n };\n /**\n * Set coordinate\n *\n * @param coordinate\n *\n * @return {SortBy}\n */\n SortBy.prototype.setCoordinate = function (coordinate) {\n for (var i in this.sortsBy) {\n if (typeof this.sortsBy[i]._geo_distance === typeof {}) {\n this.sortsBy[i]._geo_distance.coordinate = coordinate;\n }\n }\n return this;\n };\n /**\n * Has random sort\n *\n * @return {boolean}\n */\n SortBy.prototype.hasRandomSort = function () {\n for (var i in this.sortsBy) {\n if (JSON.stringify(this.sortsBy[i]) === JSON.stringify(exports.SORT_BY_RANDOM)) {\n return true;\n }\n }\n return false;\n };\n /**\n * To array\n *\n * @return {[]}\n */\n SortBy.prototype.toArray = function () {\n var copySortBy = this.copy();\n var sortsByAsArray = copySortBy.sortsBy;\n for (var i in sortsByAsArray) {\n if (sortsByAsArray[i].type == exports.SORT_BY_TYPE_FIELD) {\n delete sortsByAsArray[i].type;\n }\n if (typeof sortsByAsArray[i].filter === typeof {} &&\n sortsByAsArray[i].filter != null) {\n sortsByAsArray[i].filter = sortsByAsArray[i].filter.toArray();\n }\n if (typeof sortsByAsArray[i]._geo_distance === typeof {} &&\n sortsByAsArray[i]._geo_distance !== null &&\n sortsByAsArray[i]._geo_distance.coordinate instanceof Coordinate_1.Coordinate) {\n sortsByAsArray[i]._geo_distance.coordinate = sortsByAsArray[i]._geo_distance.coordinate.toArray();\n }\n }\n return sortsByAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {SortBy}\n */\n SortBy.createFromArray = function (array) {\n var innerArray = JSON.parse(JSON.stringify(array));\n var sortBy = SortBy.create();\n for (var i in innerArray) {\n var element = innerArray[i];\n if (JSON.stringify(element) !== JSON.stringify(exports.SORT_BY_RANDOM) &&\n JSON.stringify(element) !== JSON.stringify(exports.SORT_BY_SCORE)) {\n if (typeof element.type == \"undefined\") {\n element.type = exports.SORT_BY_TYPE_FIELD;\n }\n }\n if (typeof element.filter === typeof {} &&\n element.filter != null) {\n element.filter = Filter_1.Filter.createFromArray(element.filter);\n }\n if (typeof element._geo_distance === typeof {} &&\n element._geo_distance != null &&\n typeof element._geo_distance.coordinate === typeof {}) {\n element._geo_distance.coordinate = Coordinate_1.Coordinate.createFromArray(element._geo_distance.coordinate);\n }\n sortBy.sortsBy.push(element);\n }\n return sortBy;\n };\n /**\n * Make a copy of this\n *\n * @returns {SortBy}\n */\n SortBy.prototype.copy = function () {\n var newSortBy = SortBy.create();\n for (var i in this.sortsBy) {\n var sortBy = this.sortsBy[i];\n var sortByAsArray = JSON.parse(JSON.stringify(sortBy));\n if (typeof sortBy.filter === typeof {} &&\n sortBy.filter != null) {\n sortByAsArray.filter = Filter_1.Filter.createFromArray(sortBy.filter.toArray());\n }\n if (typeof sortBy._geo_distance === typeof {} &&\n sortBy._geo_distance != null &&\n typeof sortBy._geo_distance.coordinate == typeof {}) {\n sortByAsArray._geo_distance.coordinate = Coordinate_1.Coordinate.createFromArray(sortBy._geo_distance.coordinate.toArray());\n }\n newSortBy.sortsBy.push(sortByAsArray);\n }\n return newSortBy;\n };\n return SortBy;\n}());\nexports.SortBy = SortBy;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ConnectionError_1 = require(\"../Error/ConnectionError\");\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar InvalidTokenError_1 = require(\"../Error/InvalidTokenError\");\nvar ResourceExistsError_1 = require(\"../Error/ResourceExistsError\");\nvar ResourceNotAvailableError_1 = require(\"../Error/ResourceNotAvailableError\");\nvar Item_1 = require(\"../Model/Item\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\nvar Result_1 = require(\"../Result/Result\");\nvar Repository_1 = require(\"./Repository\");\nvar Index_1 = require(\"../Model/Index\");\n/**\n * Aggregation class\n */\nvar HttpRepository = /** @class */ (function (_super) {\n tslib_1.__extends(HttpRepository, _super);\n /**\n * Constructor\n *\n * @param httpClient\n * @param appId\n * @param indexId\n * @param token\n * @param transformer\n */\n function HttpRepository(httpClient, appId, indexId, token, transformer) {\n var _this = _super.call(this, appId, indexId, token) || this;\n _this.httpClient = httpClient;\n _this.transformer = transformer;\n return _this;\n }\n /**\n * Get transformer\n *\n * @return {Transformer}\n */\n HttpRepository.prototype.getTransformer = function () {\n return this.transformer;\n };\n /**\n * Generate item document by a simple object.\n *\n * @param object\n */\n HttpRepository.prototype.addObject = function (object) {\n var item = this\n .transformer\n .toItem(object);\n if (item instanceof Item_1.Item) {\n this.addItem(item);\n }\n };\n /**\n * Delete item document by uuid.\n *\n * @param object\n */\n HttpRepository.prototype.deleteObject = function (object) {\n var itemUUID = this\n .transformer\n .toItemUUID(object);\n if (itemUUID instanceof ItemUUID_1.ItemUUID) {\n this.deleteItem(itemUUID);\n }\n };\n /**\n * Flush update items\n *\n * @param itemsToUpdate\n *\n * @return {Promise}\n */\n HttpRepository.prototype.flushUpdateItems = function (itemsToUpdate) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n if (itemsToUpdate.length === 0) {\n return [2 /*return*/];\n }\n return [2 /*return*/, this\n .httpClient\n .get(\"/items\", \"post\", this.getCredentialsWithIndex(this.indexId), {}, {\n items: itemsToUpdate.map(function (item) {\n return item.toArray();\n })\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n })];\n });\n });\n };\n /**\n * Flush delete items\n *\n * @param itemsToDelete\n *\n * @return {Promise}\n */\n HttpRepository.prototype.flushDeleteItems = function (itemsToDelete) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n if (itemsToDelete.length === 0) {\n return [2 /*return*/];\n }\n return [2 /*return*/, this\n .httpClient\n .get(\"/items\", \"delete\", this.getCredentialsWithIndex(this.indexId), {}, {\n items: itemsToDelete.map(function (itemUUID) {\n return itemUUID.toArray();\n })\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n })];\n });\n });\n };\n /**\n * Query\n *\n * @param query\n *\n * @return {Promise}\n */\n HttpRepository.prototype.query = function (query) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n var that;\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n that = this;\n return [4 /*yield*/, this\n .httpClient\n .get(\"/\", \"get\", this.getCredentialsWithIndex(this.indexId), {\n query: JSON.stringify(query.toArray())\n }, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n var result = Result_1.Result.createFromArray(response.getBody());\n return Result_1.Result.create(result.getQuery(), result.getTotalItems(), result.getTotalHits(), result.getAggregations(), result.getSuggests(), that\n .transformer\n .fromItems(result.getItems()));\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update items\n *\n * @param query\n * @param changes\n *\n * @return {Promise}\n */\n HttpRepository.prototype.updateItems = function (query, changes) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/items\", \"put\", this.getCredentialsWithIndex(this.indexId), {}, {\n query: query.toArray(),\n changes: changes.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create index\n *\n * @param indexUUID\n * @param config\n *\n * @return {Promise}\n */\n HttpRepository.prototype.createIndex = function (indexUUID, config) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"put\", this.getCredentials(), {}, {\n index: indexUUID.toArray(),\n config: config.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete index\n *\n * @param indexUUID\n *\n * @return {Promise}\n */\n HttpRepository.prototype.deleteIndex = function (indexUUID) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"delete\", this.getCredentialsWithIndex(this.indexId), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Reset index\n *\n * @param indexUUID\n *\n * @return {Promise}\n */\n HttpRepository.prototype.resetIndex = function (indexUUID) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index/reset\", \"post\", this.getCredentialsWithIndex(this.indexId), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Check index\n *\n * @param indexUUID\n *\n * @return {Promise}\n */\n HttpRepository.prototype.checkIndex = function (indexUUID) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"head\", this.getCredentialsWithIndex(this.indexId), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return response.getCode() === 200;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Check index\n *\n * @return {Promise}\n */\n HttpRepository.prototype.getIndices = function () {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/indices\", \"get\", this.getCredentials(), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n var result = [];\n for (var _i = 0, _a = response.getBody(); _i < _a.length; _i++) {\n var indexAsArray = _a[_i];\n result.push(Index_1.Index.createFromArray(indexAsArray));\n }\n return result;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Configure index\n *\n * @param indexUUID\n * @param config\n *\n * @return {Promise}\n */\n HttpRepository.prototype.configureIndex = function (indexUUID, config) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"post\", this.getCredentialsWithIndex(this.indexId), {}, {\n config: config.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get query values\n *\n * @returns any\n */\n HttpRepository.prototype.getCredentials = function () {\n return {\n app_id: this.appId,\n token: this.token\n };\n };\n /**\n * Get query values\n *\n * @param indexComposedUUID\n *\n * @returns any\n */\n HttpRepository.prototype.getCredentialsWithIndex = function (indexComposedUUID) {\n return {\n app_id: this.appId,\n index: indexComposedUUID,\n token: this.token\n };\n };\n /**\n * throw error if needed\n *\n * @param response\n */\n HttpRepository.throwTransportableExceptionIfNeeded = function (response) {\n if (typeof response.getCode() == \"undefined\") {\n return;\n }\n switch (response.getCode()) {\n case ResourceNotAvailableError_1.ResourceNotAvailableError.getTransportableHTTPError():\n throw new ResourceNotAvailableError_1.ResourceNotAvailableError(response.getBody().message);\n case InvalidTokenError_1.InvalidTokenError.getTransportableHTTPError():\n throw new InvalidTokenError_1.InvalidTokenError(response.getBody().message);\n case InvalidFormatError_1.InvalidFormatError.getTransportableHTTPError():\n throw new InvalidFormatError_1.InvalidFormatError(response.getBody().message);\n case ResourceExistsError_1.ResourceExistsError.getTransportableHTTPError():\n throw new ResourceExistsError_1.ResourceExistsError(response.getBody().message);\n case ConnectionError_1.ConnectionError.getTransportableHTTPError():\n throw new ConnectionError_1.ConnectionError(response.getBody().message);\n }\n };\n return HttpRepository;\n}(Repository_1.Repository));\nexports.HttpRepository = HttpRepository;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\n/**\n * Aggregation class\n */\nvar Repository = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param appId\n * @param indexId\n * @param token\n */\n function Repository(appId, indexId, token) {\n this.itemsToUpdate = [];\n this.itemsToDelete = [];\n this.appId = appId;\n this.indexId = indexId;\n this.token = token;\n }\n /**\n * Reset cached elements\n */\n Repository.prototype.resetCachedElements = function () {\n this.itemsToUpdate = [];\n this.itemsToDelete = [];\n };\n /**\n * Add element\n *\n * @param item\n */\n Repository.prototype.addItem = function (item) {\n this.itemsToUpdate.push(item);\n };\n /**\n * Add elements\n *\n * @param items\n */\n Repository.prototype.addItems = function (items) {\n for (var i in items) {\n this.addItem(items[i]);\n }\n };\n /**\n * Delete item\n *\n * @param itemUUID\n */\n Repository.prototype.deleteItem = function (itemUUID) {\n this.itemsToDelete.push(itemUUID);\n };\n /**\n * Delete items\n *\n * @param itemsUUID\n */\n Repository.prototype.deleteItems = function (itemsUUID) {\n for (var i in itemsUUID) {\n this.deleteItem(itemsUUID[i]);\n }\n };\n /**\n * flush\n *\n * @param bulkNumber\n * @param skipIfLess\n *\n * @return {Promise}\n */\n Repository.prototype.flush = function (bulkNumber, skipIfLess) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n var _this = this;\n return tslib_1.__generator(this, function (_a) {\n if (!bulkNumber) {\n bulkNumber = 500;\n }\n if (!skipIfLess) {\n skipIfLess = false;\n }\n if (skipIfLess &&\n this.itemsToUpdate.length < bulkNumber) {\n return [2 /*return*/];\n }\n return [2 /*return*/, Promise.all(Repository\n .chunkArray(this.itemsToUpdate, bulkNumber)\n .map(function (arrayOfItems) {\n return _this.flushUpdateItems(arrayOfItems);\n })\n .concat(Repository\n .chunkArray(this.itemsToDelete, bulkNumber)\n .map(function (arrayOfItemsUUID) {\n return _this.flushDeleteItems(arrayOfItemsUUID);\n }))).then(function (_) {\n _this.resetCachedElements();\n })[\"catch\"](function (_) {\n _this.resetCachedElements();\n })];\n });\n });\n };\n /**\n * Make chunks of n elements\n *\n * @param array\n * @param chunk\n *\n * @return any[]\n */\n Repository.chunkArray = function (array, chunk) {\n var arrayChunked = [];\n for (var i = 0, j = array.length; i < j; i += chunk) {\n arrayChunked.push(array.slice(i, i + chunk));\n }\n return arrayChunked;\n };\n return Repository;\n}());\nexports.Repository = Repository;\n","\"use strict\";\nexports.__esModule = true;\nvar Metadata_1 = require(\"../Model/Metadata\");\n/**\n * Aggregation class\n */\nvar Counter = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param values\n * @param used\n * @param n\n */\n function Counter(values, used, n) {\n this.values = values;\n this.used = used;\n this.n = n;\n }\n /**\n * Get id\n *\n * @return {string|null}\n */\n Counter.prototype.getId = function () {\n return typeof this.values.id == \"string\"\n ? this.values.id\n : null;\n };\n /**\n * Get name\n *\n * @return {string|null}\n */\n Counter.prototype.getName = function () {\n return typeof this.values.name == \"string\"\n ? this.values.name\n : null;\n };\n /**\n * Get slug\n *\n * @return {string|null}\n */\n Counter.prototype.getSlug = function () {\n return typeof this.values.slug == \"string\"\n ? this.values.slug\n : null;\n };\n /**\n * Get level\n *\n * @return {number}\n */\n Counter.prototype.getLevel = function () {\n return typeof this.values.level == \"number\"\n ? this.values.level\n : 0;\n };\n /**\n * Get values\n *\n * @returns {{}}\n */\n Counter.prototype.getValues = function () {\n return this.values;\n };\n /**\n * Is used\n *\n * @returns {boolean}\n */\n Counter.prototype.isUsed = function () {\n return this.used;\n };\n /**\n * Get N\n *\n * @returns {number}\n */\n Counter.prototype.getN = function () {\n return this.n;\n };\n /**\n * Create by active elements\n *\n * @param name\n * @param n\n * @param activeElements\n */\n Counter.createByActiveElements = function (name, n, activeElements) {\n var values = Metadata_1.Metadata.fromMetadata(name);\n if (values == null) {\n return null;\n }\n var i = activeElements.length;\n var inActiveElements = false;\n while (i--) {\n if (activeElements[i] == values.id) {\n inActiveElements = true;\n }\n }\n return new Counter(values, inActiveElements, n);\n };\n /**\n * To array\n *\n * @return {{}}\n */\n Counter.prototype.toArray = function () {\n var values = {\n values: this.values,\n n: this.n\n };\n if (this.used === true) {\n values.used = true;\n }\n return values;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Counter}\n */\n Counter.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new Counter(array.values, (typeof array.used == \"boolean\")\n ? array.used\n : false, array.n);\n };\n return Counter;\n}());\nexports.Counter = Counter;\n","\"use strict\";\nexports.__esModule = true;\nvar Item_1 = require(\"../Model/Item\");\nvar Query_1 = require(\"../Query/Query\");\nvar ResultAggregations_1 = require(\"./ResultAggregations\");\n/**\n * Result class\n */\nvar Result = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param query\n * @param totalItems\n * @param totalHits\n */\n function Result(query, totalItems, totalHits) {\n this.items = [];\n this.suggests = [];\n this.query = query;\n this.totalItems = totalItems;\n this.totalHits = totalHits;\n }\n /**\n * Create\n *\n * @param query\n * @param totalItems\n * @param totalHits\n * @param aggregations\n * @param suggests\n * @param items\n *\n * @returns {Result}\n */\n Result.create = function (query, totalItems, totalHits, aggregations, suggests, items) {\n var result = new Result(query, totalItems, totalHits);\n result.aggregations = aggregations;\n result.suggests = suggests;\n result.items = items;\n return result;\n };\n /**\n * Add item\n *\n * @param item\n */\n Result.prototype.addItem = function (item) {\n this.items.push(item);\n };\n /**\n * Get items\n *\n * @return {Item[]}\n */\n Result.prototype.getItems = function () {\n return this.items;\n };\n /**\n * Get items grouped by types\n *\n * @return {any[]}\n */\n Result.prototype.getItemsGroupedByTypes = function () {\n if (this.itemsGroupedByTypeCache instanceof Object &&\n Object.keys(this.itemsGroupedByTypeCache).length > 0) {\n return this.itemsGroupedByTypeCache;\n }\n var itemsGroupedByTypes = {};\n for (var i in this.items) {\n var item = this.items[i];\n if (!(itemsGroupedByTypes[item.getType()] instanceof Array)) {\n itemsGroupedByTypes[item.getType()] = [];\n }\n itemsGroupedByTypes[item.getType()].push(item);\n }\n this.itemsGroupedByTypeCache = itemsGroupedByTypes;\n return itemsGroupedByTypes;\n };\n /**\n * Get items by type\n *\n * @param type\n *\n * @return {Array}\n */\n Result.prototype.getItemsByType = function (type) {\n var itemsGroupedByTypes = this.getItemsGroupedByTypes();\n return itemsGroupedByTypes[type] == null\n ? []\n : itemsGroupedByTypes[type];\n };\n /**\n * Get items by types\n *\n * @param types\n */\n Result.prototype.getItemsByTypes = function (types) {\n return this.items.filter(function (item) { return types.indexOf(item.getType()) >= 0; });\n };\n /**\n * Get first item\n *\n * @return {Item}\n */\n Result.prototype.getFirstItem = function () {\n return this.items.length > 0\n ? this.items[0]\n : null;\n };\n /**\n * Set aggregations\n *\n * @param aggregations\n */\n Result.prototype.setAggregations = function (aggregations) {\n this.aggregations = aggregations;\n };\n /**\n * Get aggregations\n *\n * @return {ResultAggregations}\n */\n Result.prototype.getAggregations = function () {\n return this.aggregations instanceof ResultAggregations_1.ResultAggregations\n ? this.aggregations\n : null;\n };\n /**\n * Get aggregation\n *\n * @param name\n *\n * @return {null}\n */\n Result.prototype.getAggregation = function (name) {\n return this.aggregations == null\n ? null\n : this.aggregations.getAggregation(name);\n };\n /**\n * Has no empty aggregation\n *\n * @param name\n *\n * @return {boolean}\n */\n Result.prototype.hasNotEmptyAggregation = function (name) {\n return this.aggregations == null\n ? false\n : this.aggregations.hasNotEmptyAggregation(name);\n };\n /**\n * Add suggest\n *\n * @param suggest\n */\n Result.prototype.addSuggest = function (suggest) {\n this.suggests.push(suggest);\n };\n /**\n * Get suggests\n *\n * @return {string[]}\n */\n Result.prototype.getSuggests = function () {\n return this.suggests;\n };\n /**\n * Get query\n *\n * @return {Query}\n */\n Result.prototype.getQuery = function () {\n return this.query;\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n Result.prototype.getTotalItems = function () {\n return this.totalItems;\n };\n /**\n * Get total hits\n *\n * @return {number}\n */\n Result.prototype.getTotalHits = function () {\n return this.totalHits;\n };\n /**\n * to array\n *\n * @return {{query: any, total_items: number, total_hits: number, items:any[], aggregations: any, suggests: string[]}}\n */\n Result.prototype.toArray = function () {\n return {\n query: this.query.toArray(),\n total_items: this.totalItems,\n total_hits: this.totalHits,\n items: this.items.map(function (item) { return item.toArray(); }),\n aggregations: this.aggregations == null\n ? null\n : this.aggregations.toArray(),\n suggests: this.suggests\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Result}\n */\n Result.createFromArray = function (array) {\n return Result.create(Query_1.Query.createFromArray(array.query), array.total_items\n ? array.total_items\n : 0, array.total_hits\n ? array.total_hits\n : 0, array.aggregations instanceof Object\n ? ResultAggregations_1.ResultAggregations.createFromArray(array.aggregations)\n : null, array.suggests\n ? array.suggests\n : null, array.items instanceof Array\n ? array.items.map(function (itemAsArray) { return Item_1.Item.createFromArray(itemAsArray); })\n : []);\n };\n return Result;\n}());\nexports.Result = Result;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar Filter_1 = require(\"../Query/Filter\");\nvar Counter_1 = require(\"./Counter\");\n/**\n * ResultAggregation class\n */\nvar ResultAggregation = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param name\n * @param applicationType\n * @param totalElements\n * @param activeElements\n */\n function ResultAggregation(name, applicationType, totalElements, activeElements) {\n this.counters = {};\n this.highestActiveElement = 0;\n this.name = name;\n this.applicationType = applicationType;\n this.totalElements = totalElements;\n this.activeElements = {};\n for (var i in activeElements) {\n var activeElement = activeElements[i];\n this.activeElements[activeElement] = activeElement;\n }\n }\n /**\n * Add counter\n *\n * @param name\n * @param counter\n */\n ResultAggregation.prototype.addCounter = function (name, counter) {\n if (counter == 0) {\n return;\n }\n var counterInstance = Counter_1.Counter.createByActiveElements(name, counter, Object.keys(this.activeElements));\n if (!(counterInstance instanceof Counter_1.Counter)) {\n return;\n }\n if ((this.applicationType & Filter_1.FILTER_MUST_ALL_WITH_LEVELS) &&\n (this.applicationType & ~Filter_1.FILTER_MUST_ALL) &&\n counterInstance.isUsed()) {\n this.activeElements[counterInstance.getId()] = counterInstance;\n this.highestActiveElement = Math.max(counterInstance.getLevel(), this.highestActiveElement);\n return;\n }\n this.counters[counterInstance.getId()] = counterInstance;\n };\n /**\n * Get name\n *\n * @return {string}\n */\n ResultAggregation.prototype.getName = function () {\n return this.name;\n };\n /**\n * Get counter\n *\n * @return {any}\n */\n ResultAggregation.prototype.getCounters = function () {\n return this.counters;\n };\n /**\n * Return if the aggregation belongs to a filter.\n *\n * @return {boolean}\n */\n ResultAggregation.prototype.isFilter = function () {\n return (this.applicationType & Filter_1.FILTER_MUST_ALL) > 0;\n };\n /**\n * Aggregation has levels.\n *\n * @return {boolean}\n */\n ResultAggregation.prototype.hasLevels = function () {\n return (this.applicationType & Filter_1.FILTER_MUST_ALL_WITH_LEVELS) > 0;\n };\n /**\n * Get counter by name\n *\n * @param name\n *\n * @return {null}\n */\n ResultAggregation.prototype.getCounter = function (name) {\n return this.counters[name] instanceof Counter_1.Counter\n ? this.counters[name]\n : null;\n };\n /**\n * Get all elements\n *\n * @return {{}}\n */\n ResultAggregation.prototype.getAllElements = function () {\n return tslib_1.__assign({}, this.activeElements, this.counters);\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n ResultAggregation.prototype.getTotalElements = function () {\n return this.totalElements;\n };\n /**\n * Get active elements\n *\n * @return {any}\n */\n ResultAggregation.prototype.getActiveElements = function () {\n if (Object.keys(this.activeElements).length === 0) {\n return {};\n }\n if (this.applicationType === Filter_1.FILTER_MUST_ALL_WITH_LEVELS) {\n var value = null;\n for (var i in this.activeElements) {\n var activeElement = this.activeElements[i];\n if (!(activeElement instanceof Counter_1.Counter)) {\n continue;\n }\n if (value == null) {\n value = activeElement;\n }\n value = value.getLevel() > activeElement.getLevel()\n ? value\n : activeElement;\n }\n return value instanceof Counter_1.Counter\n ? { 0: value }\n : null;\n }\n return this.activeElements;\n };\n /**\n * Clean results by level and remove all levels higher than the lowest.\n */\n ResultAggregation.prototype.cleanCountersByLevel = function () {\n for (var i in this.counters) {\n var counter = this.counters[i];\n if (counter.getLevel() !== this.highestActiveElement + 1) {\n delete this.counters[i];\n }\n }\n };\n /**\n * Is empty\n *\n * @returns {boolean}\n */\n ResultAggregation.prototype.isEmpty = function () {\n return Object.keys(this.activeElements).length == 0 &&\n Object.keys(this.counters).length == 0;\n };\n /**\n * To array\n *\n * @return {any}\n */\n ResultAggregation.prototype.toArray = function () {\n var array = {\n name: this.name,\n counters: [],\n active_elements: []\n };\n for (var i in this.counters) {\n array.counters.push(this.counters[i].toArray());\n }\n if (this.applicationType !== Filter_1.FILTER_AT_LEAST_ONE) {\n array.application_type = this.applicationType;\n }\n if (this.totalElements > 0) {\n array.total_elements = this.totalElements;\n }\n for (var i in this.activeElements) {\n var activeElement = this.activeElements[i];\n array.active_elements.push(activeElement instanceof Counter_1.Counter\n ? activeElement.toArray()\n : activeElement);\n }\n if (this.highestActiveElement > 0) {\n array.highest_active_level = this.highestActiveElement;\n }\n if (array.counters.length === 0) {\n delete array.counters;\n }\n if (array.active_elements.length === 0) {\n delete array.active_elements;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n */\n ResultAggregation.createFromArray = function (array) {\n var activeElements = [];\n var activeElementsAsArray = array.active_elements;\n activeElementsAsArray = typeof activeElementsAsArray === typeof []\n ? activeElementsAsArray\n : [];\n for (var i in activeElementsAsArray) {\n var activeElementAsArray = activeElementsAsArray[i];\n activeElements.push(typeof activeElementAsArray === typeof {}\n ? Counter_1.Counter.createFromArray(activeElementAsArray)\n : activeElementAsArray);\n }\n var aggregation = new ResultAggregation(array.name, parseInt(array.application_type ? array.application_type : Filter_1.FILTER_AT_LEAST_ONE), parseInt(array.total_elements ? array.total_elements : 0), []);\n aggregation.activeElements = activeElements;\n var countersAsArray = typeof array.counters === typeof []\n ? array.counters\n : [];\n for (var i in countersAsArray) {\n var counterAsArray = countersAsArray[i];\n var counter = Counter_1.Counter.createFromArray(counterAsArray);\n aggregation.counters[counter.getId()] = counter;\n }\n aggregation.highestActiveElement = typeof array.highest_active_level === \"number\"\n ? array.highest_active_level\n : 0;\n return aggregation;\n };\n return ResultAggregation;\n}());\nexports.ResultAggregation = ResultAggregation;\n","\"use strict\";\nexports.__esModule = true;\nvar ResultAggregation_1 = require(\"./ResultAggregation\");\n/**\n * ResultAggregation class\n */\nvar ResultAggregations = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param totalElements\n */\n function ResultAggregations(totalElements) {\n this.aggregations = {};\n this.totalElements = totalElements;\n }\n /**\n * Add aggregation\n *\n * @param name\n * @param aggregation\n */\n ResultAggregations.prototype.addAggregation = function (name, aggregation) {\n this.aggregations[name] = aggregation;\n };\n /**\n * Get aggregations\n *\n * @returns {{}}\n */\n ResultAggregations.prototype.getAggregations = function () {\n return this.aggregations;\n };\n /**\n * Get aggregation\n *\n * @param name\n *\n * @returns {Aggregation|null}\n */\n ResultAggregations.prototype.getAggregation = function (name) {\n return this.aggregations[name] instanceof ResultAggregation_1.ResultAggregation\n ? this.aggregations[name]\n : null;\n };\n /**\n * Has not empty aggregation\n *\n * @param name\n *\n * @returns {boolean}\n */\n ResultAggregations.prototype.hasNotEmptyAggregation = function (name) {\n var aggregation = this.getAggregation(name);\n return (aggregation instanceof ResultAggregation_1.ResultAggregation) &&\n (!aggregation.isEmpty());\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n ResultAggregations.prototype.getTotalElements = function () {\n return this.totalElements;\n };\n /**\n * To array\n *\n * @return {{total_elements?: number, aggregations?: {}}}\n */\n ResultAggregations.prototype.toArray = function () {\n var aggregationCollection = {};\n for (var i in this.aggregations) {\n aggregationCollection[i] = this.aggregations[i].toArray();\n }\n var array = {};\n if (this.totalElements > 0) {\n array.total_elements = this.totalElements;\n }\n if (Object.keys(aggregationCollection).length > 0) {\n array.aggregations = aggregationCollection;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {ResultAggregations}\n */\n ResultAggregations.createFromArray = function (array) {\n var aggregations = new ResultAggregations(typeof array.total_elements === \"number\"\n ? array.total_elements\n : 0);\n if (typeof array.aggregations === typeof {}) {\n for (var i in array.aggregations) {\n aggregations.addAggregation(i, ResultAggregation_1.ResultAggregation.createFromArray(array.aggregations[i]));\n }\n }\n return aggregations;\n };\n return ResultAggregations;\n}());\nexports.ResultAggregations = ResultAggregations;\n","\"use strict\";\nexports.__esModule = true;\nvar Item_1 = require(\"../Model/Item\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\n/**\n * Transformer\n */\nvar Transformer = /** @class */ (function () {\n function Transformer() {\n this.readTransformers = [];\n this.writeTransformers = [];\n }\n /**\n * Add read transformer\n *\n * @param readTransformer\n */\n Transformer.prototype.addReadTransformer = function (readTransformer) {\n this\n .readTransformers\n .push(readTransformer);\n };\n /**\n * Add write transformer\n *\n * @param writeTransformer\n */\n Transformer.prototype.addWriteTransformer = function (writeTransformer) {\n this\n .writeTransformers\n .push(writeTransformer);\n };\n /**\n * Items to objects\n *\n * @param items\n *\n * @returns {any[]}\n */\n Transformer.prototype.fromItems = function (items) {\n var objects = [];\n for (var i in items) {\n objects.push(this.fromItem(items[i]));\n }\n return objects;\n };\n /**\n * Item to object\n *\n * @param item\n *\n * @returns {any}\n */\n Transformer.prototype.fromItem = function (item) {\n for (var i in this.readTransformers) {\n var transformer = this.readTransformers[i];\n if (transformer.isValidItem(item)) {\n return transformer.fromItem(item);\n }\n }\n return item;\n };\n /**\n * Objects to items\n *\n * @param objects\n *\n * @returns {Item[]}\n */\n Transformer.prototype.toItems = function (objects) {\n var items = [];\n for (var i in objects) {\n var item = this.toItem(objects[i]);\n if (item instanceof Item_1.Item) {\n items.push(item);\n }\n }\n return items;\n };\n /**\n * Object to item\n *\n * @param object\n *\n * @returns {any}\n */\n Transformer.prototype.toItem = function (object) {\n for (var i in this.writeTransformers) {\n var transformer = this.writeTransformers[i];\n if (transformer.isValidObject(object)) {\n return transformer.toItem(object);\n }\n }\n return object;\n };\n /**\n * Objects to items\n *\n * @param objects\n *\n * @returns {ItemUUID[]}\n */\n Transformer.prototype.toItemUUIDs = function (objects) {\n var itemUUIDs = [];\n for (var i in objects) {\n var itemUUID = this.toItemUUID(objects[i]);\n if (itemUUID instanceof ItemUUID_1.ItemUUID) {\n itemUUIDs.push(itemUUID);\n }\n }\n return itemUUIDs;\n };\n /**\n * Object to item\n *\n * @param object\n *\n * @returns {any}\n */\n Transformer.prototype.toItemUUID = function (object) {\n for (var i in this.writeTransformers) {\n var transformer = this.writeTransformers[i];\n if (transformer.isValidObject(object)) {\n return transformer.toItemUUID(object);\n }\n }\n return object;\n };\n return Transformer;\n}());\nexports.Transformer = Transformer;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar Apisearch_1 = require(\"./Apisearch\");\nexports[\"default\"] = Apisearch_1[\"default\"];\ntslib_1.__exportStar(require(\"./Cache/InMemoryCache\"), exports);\ntslib_1.__exportStar(require(\"./Config/Config\"), exports);\ntslib_1.__exportStar(require(\"./Config/Synonym\"), exports);\ntslib_1.__exportStar(require(\"./Error/ConnectionError\"), exports);\ntslib_1.__exportStar(require(\"./Error/ErrorWithMessage\"), exports);\ntslib_1.__exportStar(require(\"./Error/EventError\"), exports);\ntslib_1.__exportStar(require(\"./Error/ForbiddenError\"), exports);\ntslib_1.__exportStar(require(\"./Error/InvalidFormatError\"), exports);\ntslib_1.__exportStar(require(\"./Error/InvalidTokenError\"), exports);\ntslib_1.__exportStar(require(\"./Error/ResourceExistsError\"), exports);\ntslib_1.__exportStar(require(\"./Error/ResourceNotAvailableError\"), exports);\ntslib_1.__exportStar(require(\"./Error/UnsupportedContentTypeError\"), exports);\ntslib_1.__exportStar(require(\"./Geo/LocationRange\"), exports);\ntslib_1.__exportStar(require(\"./Http/AxiosClient\"), exports);\ntslib_1.__exportStar(require(\"./Http/Client\"), exports);\ntslib_1.__exportStar(require(\"./Http/HttpClient\"), exports);\ntslib_1.__exportStar(require(\"./Http/Response\"), exports);\ntslib_1.__exportStar(require(\"./Http/Retry\"), exports);\ntslib_1.__exportStar(require(\"./Http/RetryMap\"), exports);\ntslib_1.__exportStar(require(\"./Model/Changes\"), exports);\ntslib_1.__exportStar(require(\"./Model/Coordinate\"), exports);\ntslib_1.__exportStar(require(\"./Model/Item\"), exports);\ntslib_1.__exportStar(require(\"./Model/ItemUUID\"), exports);\ntslib_1.__exportStar(require(\"./Model/Metadata\"), exports);\ntslib_1.__exportStar(require(\"./Model/User\"), exports);\ntslib_1.__exportStar(require(\"./Query/Aggregation\"), exports);\ntslib_1.__exportStar(require(\"./Query/Filter\"), exports);\ntslib_1.__exportStar(require(\"./Query/Query\"), exports);\ntslib_1.__exportStar(require(\"./Query/Range\"), exports);\ntslib_1.__exportStar(require(\"./Query/ScoreStrategy\"), exports);\ntslib_1.__exportStar(require(\"./Query/SortBy\"), exports);\ntslib_1.__exportStar(require(\"./Repository/HttpRepository\"), exports);\ntslib_1.__exportStar(require(\"./Repository/Repository\"), exports);\ntslib_1.__exportStar(require(\"./Result/ResultAggregation\"), exports);\ntslib_1.__exportStar(require(\"./Result/ResultAggregations\"), exports);\ntslib_1.__exportStar(require(\"./Result/Counter\"), exports);\ntslib_1.__exportStar(require(\"./Result/Result\"), exports);\ntslib_1.__exportStar(require(\"./Transformer/Transformer\"), exports);\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://apisearch/webpack/universalModuleDefinition","webpack://apisearch/webpack/bootstrap","webpack://apisearch/./node_modules/axios/index.js","webpack://apisearch/./node_modules/axios/lib/adapters/xhr.js","webpack://apisearch/./node_modules/axios/lib/axios.js","webpack://apisearch/./node_modules/axios/lib/cancel/Cancel.js","webpack://apisearch/./node_modules/axios/lib/cancel/CancelToken.js","webpack://apisearch/./node_modules/axios/lib/cancel/isCancel.js","webpack://apisearch/./node_modules/axios/lib/core/Axios.js","webpack://apisearch/./node_modules/axios/lib/core/InterceptorManager.js","webpack://apisearch/./node_modules/axios/lib/core/createError.js","webpack://apisearch/./node_modules/axios/lib/core/dispatchRequest.js","webpack://apisearch/./node_modules/axios/lib/core/enhanceError.js","webpack://apisearch/./node_modules/axios/lib/core/settle.js","webpack://apisearch/./node_modules/axios/lib/core/transformData.js","webpack://apisearch/./node_modules/axios/lib/defaults.js","webpack://apisearch/./node_modules/axios/lib/helpers/bind.js","webpack://apisearch/./node_modules/axios/lib/helpers/btoa.js","webpack://apisearch/./node_modules/axios/lib/helpers/buildURL.js","webpack://apisearch/./node_modules/axios/lib/helpers/combineURLs.js","webpack://apisearch/./node_modules/axios/lib/helpers/cookies.js","webpack://apisearch/./node_modules/axios/lib/helpers/isAbsoluteURL.js","webpack://apisearch/./node_modules/axios/lib/helpers/isURLSameOrigin.js","webpack://apisearch/./node_modules/axios/lib/helpers/normalizeHeaderName.js","webpack://apisearch/./node_modules/axios/lib/helpers/parseHeaders.js","webpack://apisearch/./node_modules/axios/lib/helpers/spread.js","webpack://apisearch/./node_modules/axios/lib/utils.js","webpack://apisearch/./node_modules/is-buffer/index.js","webpack://apisearch/./node_modules/process/browser.js","webpack://apisearch/./node_modules/tslib/tslib.es6.js","webpack://apisearch/./src/Apisearch.ts","webpack://apisearch/./src/Cache/InMemoryCache.ts","webpack://apisearch/./src/Cache/NoCache.ts","webpack://apisearch/./src/Config/Config.ts","webpack://apisearch/./src/Config/Synonym.ts","webpack://apisearch/./src/Error/ConnectionError.ts","webpack://apisearch/./src/Error/ErrorWithMessage.ts","webpack://apisearch/./src/Error/EventError.ts","webpack://apisearch/./src/Error/ForbiddenError.ts","webpack://apisearch/./src/Error/InvalidFormatError.ts","webpack://apisearch/./src/Error/InvalidTokenError.ts","webpack://apisearch/./src/Error/ResourceExistsError.ts","webpack://apisearch/./src/Error/ResourceNotAvailableError.ts","webpack://apisearch/./src/Error/UnsupportedContentTypeError.ts","webpack://apisearch/./src/Geo/LocationRange.ts","webpack://apisearch/./src/Http/AxiosClient.ts","webpack://apisearch/./src/Http/Client.ts","webpack://apisearch/./src/Http/HttpClient.ts","webpack://apisearch/./src/Http/Response.ts","webpack://apisearch/./src/Http/Retry.ts","webpack://apisearch/./src/Http/RetryMap.ts","webpack://apisearch/./src/Model/AppUUID.ts","webpack://apisearch/./src/Model/Changes.ts","webpack://apisearch/./src/Model/Coordinate.ts","webpack://apisearch/./src/Model/Index.ts","webpack://apisearch/./src/Model/IndexUUID.ts","webpack://apisearch/./src/Model/Item.ts","webpack://apisearch/./src/Model/ItemUUID.ts","webpack://apisearch/./src/Model/Metadata.ts","webpack://apisearch/./src/Model/User.ts","webpack://apisearch/./src/Query/Aggregation.ts","webpack://apisearch/./src/Query/Filter.ts","webpack://apisearch/./src/Query/Query.ts","webpack://apisearch/./src/Query/Range.ts","webpack://apisearch/./src/Query/ScoreStrategies.ts","webpack://apisearch/./src/Query/ScoreStrategy.ts","webpack://apisearch/./src/Query/SortBy.ts","webpack://apisearch/./src/Repository/HttpRepository.ts","webpack://apisearch/./src/Repository/Repository.ts","webpack://apisearch/./src/Result/Counter.ts","webpack://apisearch/./src/Result/Result.ts","webpack://apisearch/./src/Result/ResultAggregation.ts","webpack://apisearch/./src/Result/ResultAggregations.ts","webpack://apisearch/./src/Transformer/Transformer.ts","webpack://apisearch/./src/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;AClFA,iBAAiB,mBAAO,CAAC,sDAAa,E;;;;;;;;;;;;ACAzB;;AAEb,YAAY,mBAAO,CAAC,qDAAY;AAChC,aAAa,mBAAO,CAAC,iEAAkB;AACvC,eAAe,mBAAO,CAAC,2EAAuB;AAC9C,mBAAmB,mBAAO,CAAC,mFAA2B;AACtD,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D,kBAAkB,mBAAO,CAAC,yEAAqB;AAC/C,yFAAyF,mBAAO,CAAC,mEAAmB;;AAEpH;AACA;AACA;AACA;;AAEA;AACA,4CAA4C;AAC5C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ,aAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAoB,mBAAO,CAAC,yEAAsB;;AAElD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACnLa;;AAEb,YAAY,mBAAO,CAAC,kDAAS;AAC7B,WAAW,mBAAO,CAAC,gEAAgB;AACnC,YAAY,mBAAO,CAAC,4DAAc;AAClC,eAAe,mBAAO,CAAC,wDAAY;;AAEnC;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,eAAe,mBAAO,CAAC,kEAAiB;AACxC,oBAAoB,mBAAO,CAAC,4EAAsB;AAClD,iBAAiB,mBAAO,CAAC,sEAAmB;;AAE5C;AACA;AACA;AACA;AACA,eAAe,mBAAO,CAAC,oEAAkB;;AAEzC;;AAEA;AACA;;;;;;;;;;;;;ACnDa;;AAEb;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;;AClBa;;AAEb,aAAa,mBAAO,CAAC,2DAAU;;AAE/B;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACxDa;;AAEb;AACA;AACA;;;;;;;;;;;;;ACJa;;AAEb,eAAe,mBAAO,CAAC,2DAAe;AACtC,YAAY,mBAAO,CAAC,qDAAY;AAChC,yBAAyB,mBAAO,CAAC,iFAAsB;AACvD,sBAAsB,mBAAO,CAAC,2EAAmB;;AAEjD;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA,kCAAkC,cAAc;AAChD;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;;;;;;;;;;;;;AC9Ea;;AAEb,YAAY,mBAAO,CAAC,qDAAY;;AAEhC;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;;;;;;;;;;;;ACnDa;;AAEb,mBAAmB,mBAAO,CAAC,qEAAgB;;AAE3C;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;;AAEb,YAAY,mBAAO,CAAC,qDAAY;AAChC,oBAAoB,mBAAO,CAAC,uEAAiB;AAC7C,eAAe,mBAAO,CAAC,uEAAoB;AAC3C,eAAe,mBAAO,CAAC,yDAAa;AACpC,oBAAoB,mBAAO,CAAC,qFAA4B;AACxD,kBAAkB,mBAAO,CAAC,iFAA0B;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B;AAC/B,uCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;;;;;;;;;;;;ACrFa;;AAEb;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACpBa;;AAEb,kBAAkB,mBAAO,CAAC,mEAAe;;AAEzC;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzBa;;AAEb,YAAY,mBAAO,CAAC,qDAAY;;AAEhC;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,MAAM;AACjB,WAAW,eAAe;AAC1B,aAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACnBA,+CAAa;;AAEb,YAAY,mBAAO,CAAC,kDAAS;AAC7B,0BAA0B,mBAAO,CAAC,8FAA+B;;AAEjE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,mBAAO,CAAC,gEAAgB;AACtC,GAAG;AACH;AACA,cAAc,mBAAO,CAAC,iEAAiB;AACvC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,OAAO,YAAY;AACnB;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA,CAAC;;AAED;;;;;;;;;;;;;;AC/Fa;;AAEb;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACVa;;AAEb;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACnCa;;AAEb,YAAY,mBAAO,CAAC,qDAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACjEa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb,YAAY,mBAAO,CAAC,qDAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,wCAAwC;AACxC,OAAO;;AAEP;AACA,0DAA0D,wBAAwB;AAClF;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,gCAAgC;AAChC,6BAA6B,aAAa,EAAE;AAC5C;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb,YAAY,mBAAO,CAAC,qDAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACnEa;;AAEb,YAAY,mBAAO,CAAC,mDAAU;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACXa;;AAEb,YAAY,mBAAO,CAAC,qDAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,eAAe;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,WAAW,SAAS;AACpB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1Ba;;AAEb,WAAW,mBAAO,CAAC,gEAAgB;AACnC,eAAe,mBAAO,CAAC,oDAAW;;AAElC;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mCAAmC,OAAO;AAC1C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS;AAC5C,2BAA2B;AAC3B;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9SA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACpBA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qCAAqC;;AAErC;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA,4BAA4B,UAAU;;;;;;;;;;;;;ACvLtC;AAAA;AAAA;AAAA;AAAA;AAA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gB;AACvC,uBAAuB,mBAAO,CAAC,uEAA6B;AAC5D,eAAe,mBAAO,CAAC,+CAAiB;AACxC,2BAA2B,mBAAO,CAAC,uEAA6B;AAChE,oBAAoB,mBAAO,CAAC,mEAA2B;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,2CAA2C,2FAA2F;AACtI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,8BAA8B,mCAAmC;AACjE,8BAA8B,mCAAmC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,8BAA8B,mCAAmC;AACjE,8BAA8B,mCAAmC;AACjE;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC3Ia;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,wCAAwC,sBAAsB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACxDa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC7Ca;AACb;AACA,gBAAgB,mBAAO,CAAC,0CAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD,iDAAiD,gCAAgC;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,0BAA0B,EAAE;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,mDAAmD,EAAE;AACnI;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC7Ea;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AChEa;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,yBAAyB,mBAAO,CAAC,2DAAoB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACtBa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AChBa;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,yBAAyB,mBAAO,CAAC,2DAAoB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACtBa;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,yBAAyB,mBAAO,CAAC,2DAAoB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC9Ca;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,yBAAyB,mBAAO,CAAC,2DAAoB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,0FAA0F,GAAG,EAAE,KAAK;AACpG;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACtJa;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,yBAAyB,mBAAO,CAAC,2DAAoB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC3Ca;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,yBAAyB,mBAAO,CAAC,2DAAoB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC9Ca;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,yBAAyB,mBAAO,CAAC,2DAAoB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC9Da;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,yBAAyB,mBAAO,CAAC,2DAAoB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC9Ba;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,mBAAmB,mBAAO,CAAC,sDAAqB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,cAAc,uBAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC1Ma;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,cAAc,mBAAO,CAAC,4CAAO;AAC7B,eAAe,mBAAO,CAAC,sCAAU;AACjC,iBAAiB,mBAAO,CAAC,0CAAY;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oCAAoC,iBAAiB;AACrD,8BAA8B,WAAW;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sGAAsG;AACtG;AACA;AACA;AACA;AACA;AACA,gEAAgE,6BAA6B,EAAE;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACjHa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AChCa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACVa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AClCa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACnEa;AACb;AACA,cAAc,mBAAO,CAAC,oCAAS;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,6CAA6C,EAAE;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACnDa;AACb;AACA,2BAA2B,mBAAO,CAAC,sEAA6B;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACnEa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,2BAA2B;AACzD;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC1Ha;AACb;AACA,2BAA2B,mBAAO,CAAC,sEAA6B;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC/Da;AACb;AACA,2BAA2B,mBAAO,CAAC,sEAA6B;AAChE,kBAAkB,mBAAO,CAAC,6CAAa;AACvC,gBAAgB,mBAAO,CAAC,yCAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,cAAc;AAC5C,kCAAkC,cAAc;AAChD,8BAA8B,cAAc;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AClGa;AACb;AACA,2BAA2B,mBAAO,CAAC,sEAA6B;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACnEa;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,2BAA2B,mBAAO,CAAC,sEAA6B;AAChE,mBAAmB,mBAAO,CAAC,+CAAc;AACzC,iBAAiB,mBAAO,CAAC,2CAAY;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,kCAAkC,eAAe;AACjD,yCAAyC,sBAAsB;AAC/D,4CAA4C,yBAAyB;AACrE,+CAA+C,4BAA4B;AAC3E,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,kCAAkC,eAAe;AACjD,yCAAyC,sBAAsB;AAC/D,4CAA4C,yBAAyB;AACrE,+CAA+C,4BAA4B;AAC3E,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yLAAyL,wEAAwE,mFAAmF;AACpV,uHAAuH,wEAAwE,mFAAmF;AAClR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACpYa;AACb;AACA,2BAA2B,mBAAO,CAAC,sEAA6B;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC/Ea;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC9Da;AACb;AACA,2BAA2B,mBAAO,CAAC,sEAA6B;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,iBAAiB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACpEa;AACb;AACA,eAAe,mBAAO,CAAC,uCAAU;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,kCAAkC,eAAe;AACjD,8BAA8B,+CAA+C;AAC7E,+BAA+B,sCAAsC;AACrE;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC3Ka;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,qCAAqC,kBAAkB;AACvD;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACzJa;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,mBAAmB,mBAAO,CAAC,sDAAqB;AAChD,iBAAiB,mBAAO,CAAC,kDAAmB;AAC5C,aAAa,mBAAO,CAAC,0CAAe;AACpC,aAAa,mBAAO,CAAC,0CAAe;AACpC,oBAAoB,mBAAO,CAAC,iDAAe;AAC3C,eAAe,mBAAO,CAAC,uCAAU;AACjC,eAAe,mBAAO,CAAC,uCAAU;AACjC,oBAAoB,mBAAO,CAAC,iDAAe;AAC3C,2BAA2B,mBAAO,CAAC,sEAA6B;AAChE,eAAe,mBAAO,CAAC,uCAAU;AACjC,wBAAwB,mBAAO,CAAC,yDAAmB;AACnD,eAAe,mBAAO,CAAC,uCAAU;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,8BAA8B,mCAAmC;AACjE,8BAA8B,mCAAmC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,8BAA8B,mCAAmC;AACjE,8BAA8B,mCAAmC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,sDAAsD,gCAAgC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,mCAAmC,kBAAkB;AACrD,yCAAyC,gEAAgE;AACzG;AACA;AACA;AACA,8CAA8C,wBAAwB;AACtE;AACA;AACA;AACA;AACA;AACA,mDAAmD,6BAA6B;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,sDAAsD,gCAAgC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,8CAA8C,wBAAwB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF;AACA;AACA;AACA,sDAAsD,gCAAgC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF,mCAAmC,kBAAkB;AACrD,yCAAyC,gEAAgE;AACzG;AACA;AACA;AACA,8CAA8C,wBAAwB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF,mCAAmC,wCAAwC;AAC3E;AACA;AACA;AACA,sDAAsD,gCAAgC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF,mCAAmC,wCAAwC;AAC3E,mCAAmC,kBAAkB;AACrD,yCAAyC,gEAAgE;AACzG;AACA;AACA;AACA,8CAA8C,wBAAwB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF,mCAAmC,kBAAkB;AACrD,yCAAyC,gEAAgE;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,kDAAkD,gCAAgC;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gEAAgE;AACzG,+BAA+B,4CAA4C;AAC3E;AACA,+CAA+C,6BAA6B;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,mCAAmC,wCAAwC;AAC3E,yCAAyC,gEAAgE;AACzG,+BAA+B,4CAA4C;AAC3E;AACA;AACA;AACA;AACA,+CAA+C,6BAA6B;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gEAAgE;AACzG,+BAA+B,4CAA4C;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA,0CAA0C,wBAAwB,gFAAgF,4BAA4B,EAAE;AAChL;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACtjCa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACvEa;AACb;AACA,sBAAsB,mBAAO,CAAC,qDAAiB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,mCAAmC,yBAAyB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AClGa;AACb;AACA,aAAa,mBAAO,CAAC,0CAAe;AACpC,eAAe,mBAAO,CAAC,uCAAU;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,gCAAgC,iCAAiC;AACjE,iCAAiC,mCAAmC;AACpE,kCAAkC,kCAAkC;AACpE,gCAAgC,iCAAiC;AACjE,gCAAgC,eAAe;AAC/C,mCAAmC,oCAAoC;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,gCAAgC,iCAAiC;AACjE,gCAAgC,eAAe;AAC/C,mCAAmC,oCAAoC;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,gCAAgC,iCAAiC;AACjE,gCAAgC,eAAe;AAC/C,mCAAmC,oCAAoC;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AChPa;AACb;AACA,aAAa,mBAAO,CAAC,0CAAe;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mBAAO,CAAC,sDAAqB;AAChD,eAAe,mBAAO,CAAC,uCAAU;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,8BAA8B,iCAAiC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,8BAA8B,iCAAiC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D;AAC7D;AACA;AACA;AACA,oEAAoE;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA,0DAA0D;AAC1D;AACA,qEAAqE;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA,yDAAyD;AACzD;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACjTa;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,wBAAwB,mBAAO,CAAC,gEAA0B;AAC1D,2BAA2B,mBAAO,CAAC,sEAA6B;AAChE,0BAA0B,mBAAO,CAAC,oEAA4B;AAC9D,4BAA4B,mBAAO,CAAC,wEAA8B;AAClE,kCAAkC,mBAAO,CAAC,oFAAoC;AAC9E,aAAa,mBAAO,CAAC,0CAAe;AACpC,iBAAiB,mBAAO,CAAC,kDAAmB;AAC5C,eAAe,mBAAO,CAAC,gDAAkB;AACzC,mBAAmB,mBAAO,CAAC,oDAAc;AACzC,cAAc,mBAAO,CAAC,4CAAgB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6FAA6F;AAC7F;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F;AAC/F;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,IAAI;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gGAAgG;AAChG;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E;AAC3E;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mGAAmG,IAAI;AACvG;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uGAAuG,IAAI;AAC3G;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iGAAiG,IAAI;AACrG;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,IAAI;AACjF;AACA;AACA;AACA,qEAAqE,gBAAgB;AACrF;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iGAAiG;AACjG;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACtXa;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,qBAAqB;AACrB;AACA,qBAAqB;AACrB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACxHa;AACb;AACA,iBAAiB,mBAAO,CAAC,kDAAmB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACtIa;AACb;AACA,aAAa,mBAAO,CAAC,0CAAe;AACpC,cAAc,mBAAO,CAAC,4CAAgB;AACtC,2BAA2B,mBAAO,CAAC,gEAAsB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,2CAA2C,EAAE;AAC/F;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,uBAAuB,EAAE;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,iDAAiD,EAAE;AACzG;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACvOa;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,eAAe,mBAAO,CAAC,8CAAiB;AACxC,gBAAgB,mBAAO,CAAC,0CAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACxOa;AACb;AACA,0BAA0B,mBAAO,CAAC,8DAAqB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACxGa;AACb;AACA,aAAa,mBAAO,CAAC,0CAAe;AACpC,iBAAiB,mBAAO,CAAC,kDAAmB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AClIa;AACb;AACA,cAAc,mBAAO,CAAC,gDAAO;AAC7B,kBAAkB,mBAAO,CAAC,uCAAa;AACvC;AACA,qBAAqB,mBAAO,CAAC,2DAAuB;AACpD,qBAAqB,mBAAO,CAAC,+CAAiB;AAC9C,qBAAqB,mBAAO,CAAC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AO,CAAC,iDAAkB;AAC/C,qBAAqB,mBAAO,CAAC,+CAAiB;AAC9C,qBAAqB,mBAAO,CAAC,mEAA2B","file":"apisearch.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"apisearch\"] = factory();\n\telse\n\t\troot[\"apisearch\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.ts\");\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildURL = require('./../helpers/buildURL');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar btoa = (typeof window !== 'undefined' && window.btoa && window.btoa.bind(window)) || require('./../helpers/btoa');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n var loadEvent = 'onreadystatechange';\n var xDomain = false;\n\n // For IE 8/9 CORS support\n // Only supports POST and GET calls and doesn't returns the response headers.\n // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.\n if (process.env.NODE_ENV !== 'test' &&\n typeof window !== 'undefined' &&\n window.XDomainRequest && !('withCredentials' in request) &&\n !isURLSameOrigin(config.url)) {\n request = new window.XDomainRequest();\n loadEvent = 'onload';\n xDomain = true;\n request.onprogress = function handleProgress() {};\n request.ontimeout = function handleTimeout() {};\n }\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request[loadEvent] = function handleLoad() {\n if (!request || (request.readyState !== 4 && !xDomain)) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n // IE sends 1223 instead of 204 (https://github.com/axios/axios/issues/201)\n status: request.status === 1223 ? 204 : request.status,\n statusText: request.status === 1223 ? 'No Content' : request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = require('./../helpers/cookies');\n\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(utils.merge(defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar defaults = require('./../defaults');\nvar utils = require('./../utils');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = utils.merge({\n url: arguments[0]\n }, arguments[1]);\n }\n\n config = utils.merge(defaults, {method: 'get'}, this.defaults, config);\n config.method = config.method.toLowerCase();\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar isAbsoluteURL = require('./../helpers/isAbsoluteURL');\nvar combineURLs = require('./../helpers/combineURLs');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Support baseURL config\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers || {}\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n error.request = request;\n error.response = response;\n return error;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n // Note: status is not exposed by XDomainRequest\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\n// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js\n\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\nfunction E() {\n this.message = 'String contains an invalid character';\n}\nE.prototype = new Error;\nE.prototype.code = 5;\nE.prototype.name = 'InvalidCharacterError';\n\nfunction btoa(input) {\n var str = String(input);\n var output = '';\n for (\n // initialize result and counter\n var block, charCode, idx = 0, map = chars;\n // if the next str index does not exist:\n // change the mapping table to \"=\"\n // check if d has no fractional digits\n str.charAt(idx | 0) || (map = '=', idx % 1);\n // \"8 - idx % 1 * 8\" generates the sequence 2, 4, 6, 8\n output += map.charAt(63 & block >> 8 - idx % 1 * 8)\n ) {\n charCode = str.charCodeAt(idx += 3 / 4);\n if (charCode > 0xFF) {\n throw new E();\n }\n block = block << 8 | charCode;\n }\n return output;\n}\n\nmodule.exports = btoa;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\nvar isBuffer = require('is-buffer');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim\n};\n","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\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;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar NoCache_1 = require(\"./Cache/NoCache\");\nvar AxiosClient_1 = require(\"./Http/AxiosClient\");\nvar RetryMap_1 = require(\"./Http/RetryMap\");\nvar Query_1 = require(\"./Query/Query\");\nvar Query_2 = require(\"./Query/Query\");\nvar Query_3 = require(\"./Query/Query\");\nvar SortBy_1 = require(\"./Query/SortBy\");\nvar HttpRepository_1 = require(\"./Repository/HttpRepository\");\nvar Result_1 = require(\"./Result/Result\");\nvar ResultAggregations_1 = require(\"./Result/ResultAggregations\");\nvar Transformer_1 = require(\"./Transformer/Transformer\");\n/**\n * Apisearch class\n */\nvar Apisearch = /** @class */ (function () {\n function Apisearch() {\n }\n /**\n * Constructor\n *\n * @param config\n *\n * @return {HttpRepository}\n */\n Apisearch.createRepository = function (config) {\n Apisearch.ensureRepositoryConfigIsValid(config);\n config.options = tslib_1.__assign({ api_version: \"v1\", cache: new NoCache_1.NoCache(), timeout: 5000, override_queries: true }, config.options);\n /**\n * Client\n */\n var httpClient = typeof config.options.http_client !== \"undefined\"\n ? config.options.http_client\n : new AxiosClient_1.AxiosClient(config.options.endpoint, config.options.api_version, config.options.timeout, new RetryMap_1.RetryMap(), config.options.override_queries, config.options.cache);\n return new HttpRepository_1.HttpRepository(httpClient, config.app_id, config.index_id, config.token, new Transformer_1.Transformer());\n };\n /**\n * Ensure the Repository configuration is valid\n *\n * @param config\n */\n Apisearch.ensureRepositoryConfigIsValid = function (config) {\n Apisearch.ensureIsDefined(config.app_id, \"app_id\");\n Apisearch.ensureIsDefined(config.index_id, \"index_id\");\n Apisearch.ensureIsDefined(config.token, \"token\");\n Apisearch.ensureIsDefined(config.options.endpoint, \"options.endpoint\");\n };\n /**\n * Ensure the value is not undefined\n *\n * @param param\n * @param name\n */\n Apisearch.ensureIsDefined = function (param, name) {\n if (typeof param === \"undefined\") {\n throw new TypeError(name + \" parameter must be defined.\");\n }\n };\n /**\n * Created located\n *\n * @param coordinate\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Apisearch.createQueryLocated = function (coordinate, queryText, page, size) {\n if (page === void 0) { page = Query_1.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = Query_2.QUERY_DEFAULT_SIZE; }\n return Query_3.Query.createLocated(coordinate, queryText, page, size);\n };\n /**\n * Create\n *\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Apisearch.createQuery = function (queryText, page, size) {\n if (page === void 0) { page = Query_1.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = Query_2.QUERY_DEFAULT_SIZE; }\n return Query_3.Query.create(queryText, page, size);\n };\n /**\n * Create match all\n *\n * @return {Query}\n */\n Apisearch.createQueryMatchAll = function () {\n return Query_3.Query.createMatchAll();\n };\n /**\n * Create by UUID\n *\n * @param uuid\n *\n * @return {Query}\n */\n Apisearch.createQueryByUUID = function (uuid) {\n return Query_3.Query.createByUUID(uuid);\n };\n /**\n * Create by UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Apisearch.createQueryByUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n return Query_3.Query.createByUUIDs.apply(Query_3.Query, uuids);\n };\n /**\n * Create empty result\n *\n * @return {Result}\n */\n Apisearch.createEmptyResult = function () {\n return Result_1.Result.create(Apisearch.createQueryMatchAll(), 0, 0, new ResultAggregations_1.ResultAggregations(0), [], []);\n };\n /**\n * Create empty sortby\n *\n * @return {SortBy}\n */\n Apisearch.createEmptySortBy = function () {\n return SortBy_1.SortBy.create();\n };\n return Apisearch;\n}());\nexports[\"default\"] = Apisearch;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\n/**\n * Cache class\n */\nvar InMemoryCache = /** @class */ (function () {\n /**\n * Constructor\n */\n function InMemoryCache() {\n this.cache = {};\n this.size = 0;\n this.cache = {};\n this.size = 0;\n }\n /**\n * Set cache element\n *\n * @param key\n * @param value\n *\n * @returns {void}\n */\n InMemoryCache.prototype.set = function (key, value) {\n var _a;\n this.cache = tslib_1.__assign({}, this.cache, (_a = {}, _a[key] = value, _a));\n this.size = this.size + 1;\n };\n /**\n * Get element from cache\n *\n * @param key\n *\n * @returns {any}\n */\n InMemoryCache.prototype.get = function (key) {\n return this.cache[key];\n };\n /**\n * Deletes element from cache\n *\n * @param key\n */\n InMemoryCache.prototype.del = function (key) {\n delete this.cache[key];\n };\n /**\n * Clear cache\n */\n InMemoryCache.prototype.clear = function () {\n this.cache = {};\n this.size = 0;\n };\n return InMemoryCache;\n}());\nexports.InMemoryCache = InMemoryCache;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Cache class\n */\nvar NoCache = /** @class */ (function () {\n function NoCache() {\n }\n /**\n * Set cache element\n *\n * @param key\n * @param value\n *\n * @returns {void}\n */\n NoCache.prototype.set = function (key, value) {\n // Empty\n };\n /**\n * Get element from cache\n *\n * @param key\n *\n * @returns {any}\n */\n NoCache.prototype.get = function (key) {\n return undefined;\n };\n /**\n * Deletes element from cache\n *\n * @param key\n */\n NoCache.prototype.del = function (key) {\n // Empty\n };\n /**\n * Clear cache\n */\n NoCache.prototype.clear = function () {\n // Empty\n };\n return NoCache;\n}());\nexports.NoCache = NoCache;\n","\"use strict\";\nexports.__esModule = true;\nvar Synonym_1 = require(\"./Synonym\");\n/**\n * Result class\n */\nvar Config = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param language\n * @param storeSearchableMetadata\n */\n function Config(language, storeSearchableMetadata) {\n if (language === void 0) { language = null; }\n if (storeSearchableMetadata === void 0) { storeSearchableMetadata = true; }\n this.synonyms = [];\n this.language = language;\n this.storeSearchableMetadata = storeSearchableMetadata;\n }\n /**\n * Get language\n *\n * @return {string}\n */\n Config.prototype.getLanguage = function () {\n return this.language;\n };\n /**\n * Should searchable metadata be stored\n *\n * @return {boolean}\n */\n Config.prototype.shouldSearchableMetadataBeStored = function () {\n return this.storeSearchableMetadata;\n };\n /**\n * Add synonym\n *\n * @param synonym\n */\n Config.prototype.addSynonym = function (synonym) {\n this.synonyms.push(synonym);\n };\n /**\n * Get synonyms\n *\n * @return {Synonym[]}\n */\n Config.prototype.getSynonyms = function () {\n return this.synonyms;\n };\n /**\n * to array\n */\n Config.prototype.toArray = function () {\n return {\n language: this.language,\n store_searchable_metadata: this.storeSearchableMetadata,\n synonyms: this.synonyms.map(function (synonym) { return synonym.toArray(); })\n };\n };\n /**\n * Create from array\n */\n Config.createFromArray = function (array) {\n var immutableConfig = new Config(array.language ? array.language : null, typeof array.store_searchable_metadata == \"boolean\"\n ? array.store_searchable_metadata\n : true);\n if (array.synonyms instanceof Array &&\n array.synonyms.length > 0) {\n immutableConfig.synonyms = array.synonyms.map(function (synonym) { return Synonym_1.Synonym.createFromArray(synonym); });\n }\n return immutableConfig;\n };\n return Config;\n}());\nexports.Config = Config;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Result class\n */\nvar Synonym = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param words\n */\n function Synonym(words) {\n this.words = words;\n }\n /**\n * get words\n *\n * @return {string[]}\n */\n Synonym.prototype.getWords = function () {\n return this.words;\n };\n /**\n * Create by words\n *\n * @param words\n *\n * @return {Synonym}\n */\n Synonym.createbyWords = function (words) {\n return new Synonym(words);\n };\n /**\n * To array\n *\n * @return {{words: string[]}}\n */\n Synonym.prototype.toArray = function () {\n return {\n words: this.words\n };\n };\n /**\n * create from array\n *\n * @param array\n *\n * @returns {Synonym}\n */\n Synonym.createFromArray = function (array) {\n return new Synonym(array.words instanceof Object\n ? array.words\n : []);\n };\n /**\n * Expand\n *\n * @returns {string}\n */\n Synonym.prototype.expand = function () {\n return this.words.join(\",\");\n };\n return Synonym;\n}());\nexports.Synonym = Synonym;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Connection error\n */\nvar ConnectionError = /** @class */ (function (_super) {\n tslib_1.__extends(ConnectionError, _super);\n function ConnectionError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ConnectionError.getTransportableHTTPError = function () {\n return 500;\n };\n return ConnectionError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ConnectionError = ConnectionError;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * ConnectError\n */\nvar ErrorWithMessage = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param message\n */\n function ErrorWithMessage(message) {\n this.message = message;\n }\n return ErrorWithMessage;\n}());\nexports.ErrorWithMessage = ErrorWithMessage;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * EventError\n */\nvar EventError = /** @class */ (function (_super) {\n tslib_1.__extends(EventError, _super);\n function EventError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n EventError.throwEndpointNotAvailable = function () {\n return new EventError(\"Endpoint not available\");\n };\n return EventError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.EventError = EventError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Forbidden Error\n */\nvar ForbiddenError = /** @class */ (function (_super) {\n tslib_1.__extends(ForbiddenError, _super);\n function ForbiddenError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ForbiddenError.getTransportableHTTPError = function () {\n return 403;\n };\n /**\n * App id is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createAppIdIsRequiredException = function () {\n return new ForbiddenError(\"AppId query parameter MUST be defined with a valid value\");\n };\n /**\n * Index id is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createIndexIsRequiredException = function () {\n return new ForbiddenError(\"Index query parameter MUST be defined with a valid value\");\n };\n /**\n * Token is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createTokenIsRequiredException = function () {\n return new ForbiddenError(\"Token query parameter MUST be defined with a valid value\");\n };\n return ForbiddenError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ForbiddenError = ForbiddenError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Class InvalidFormatError\n */\nvar InvalidFormatError = /** @class */ (function (_super) {\n tslib_1.__extends(InvalidFormatError, _super);\n function InvalidFormatError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n InvalidFormatError.getTransportableHTTPError = function () {\n return 400;\n };\n /**\n * Item representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.itemRepresentationNotValid = function () {\n return new InvalidFormatError(\"Item representation not valid. Expecting Item array serialized but found malformed data\");\n };\n /**\n * Item UUID representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.itemUUIDRepresentationNotValid = function () {\n return new InvalidFormatError(\"Item UUID representation not valid. Expecting UUID array serialized but found malformed data\");\n };\n /**\n * Create Composed UUID bad format.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.composedItemUUIDNotValid = function () {\n return new InvalidFormatError(\"A composed UUID should always follow this format: {id}~{type}.\");\n };\n /**\n * Create Query sorted by distance without coordinate.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.querySortedByDistanceWithoutCoordinate = function () {\n return new InvalidFormatError(\"In order to be able to sort by coordinates, you need to create a Query by using Query::createLocated() instead of Query::create()\");\n };\n /**\n * Query representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.queryFormatNotValid = function () {\n return new InvalidFormatError(\"Query Format not valid. Expecting a Query serialized but found malformed data\");\n };\n /**\n * Coordinate representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.coordinateFormatNotValid = function () {\n return new InvalidFormatError(\"A Coordinate should always contain a lat (Latitude) and a lon (Longitude)\");\n };\n /**\n * Config representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.configFormatNotValid = function () {\n return new InvalidFormatError(\"Config Format not valid. Expecting a Config serialized but found malformed data\");\n };\n /**\n * Token representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.tokenFormatNotValid = function () {\n return new InvalidFormatError(\"Token Format not valid. Expecting a Token serialized but found malformed data\");\n };\n /**\n * Index format not valid.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.indexFormatNotValid = function () {\n return new InvalidFormatError('Index Format not valid. Expecting an Index serialized but found malformed data');\n };\n /**\n * IndexUUI format not valid.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.indexUUIDFormatNotValid = function () {\n return new InvalidFormatError('IndexUUID Format not valid. Expecting an IndexUUID serialized but found malformed data');\n };\n /**\n * App format not valid.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.appUUIDFormatNotValid = function () {\n return new InvalidFormatError('AppUUID Format not valid. Expecting an AppUUID serialized but found malformed data');\n };\n /**\n * Campaign representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.campaignFormatNotValid = function () {\n return new InvalidFormatError(\"Campaign Format not valid. Expecting a Campaign serialized but found malformed data\");\n };\n /**\n * Changes representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.changesFormatNotValid = function () {\n return new InvalidFormatError(\"Changes Format not valid. Expecting a Changes serialized but found malformed data\");\n };\n /**\n * Boost clause representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.boostClauseFormatNotValid = function () {\n return new InvalidFormatError(\"Boost clause Format not valid. Expecting a Boost clause serialized but found malformed data\");\n };\n /**\n * token uuid representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.tokenUUIDFormatNotValid = function () {\n return new InvalidFormatError(\"Token UUID Format not valid. Expecting a TokenUUID serialized but found malformed data\");\n };\n /**\n * User representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.userFormatNotValid = function () {\n return new InvalidFormatError(\"User Format not valid. Expecting a User serialized but found malformed data\");\n };\n return InvalidFormatError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.InvalidFormatError = InvalidFormatError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Invalid token error\n */\nvar InvalidTokenError = /** @class */ (function (_super) {\n tslib_1.__extends(InvalidTokenError, _super);\n function InvalidTokenError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n InvalidTokenError.getTransportableHTTPError = function () {\n return 401;\n };\n /**\n * Invalid token permissions\n *\n * @param tokenReference\n *\n * @return {InvalidTokenError}\n */\n InvalidTokenError.createInvalidTokenPermissions = function (tokenReference) {\n return new InvalidTokenError(\"Token \" + tokenReference + \"not valid\");\n };\n /**\n * Invalid token permissions\n *\n * @param tokenReference\n * @param maxHitsPerQuery\n *\n * @return {InvalidTokenError}\n */\n InvalidTokenError.createInvalidTokenMaxHitsPerQuery = function (tokenReference, maxHitsPerQuery) {\n return new InvalidTokenError(\"Token \" + tokenReference + \"not valid. Max \" + maxHitsPerQuery + \" hits allowed\");\n };\n return InvalidTokenError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.InvalidTokenError = InvalidTokenError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Resource exists error\n */\nvar ResourceExistsError = /** @class */ (function (_super) {\n tslib_1.__extends(ResourceExistsError, _super);\n function ResourceExistsError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ResourceExistsError.getTransportableHTTPError = function () {\n return 409;\n };\n /**\n * Index not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.indexAvailable = function () {\n return new ResourceExistsError(\"Index exists and cannot be created again\");\n };\n /**\n * Events not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.eventsIndexAvailable = function () {\n return new ResourceExistsError(\"Events index exists and cannot be created again\");\n };\n /**\n * Logs not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.logsIndexAvailable = function () {\n return new ResourceExistsError(\"Logs index exists and cannot be created again\");\n };\n return ResourceExistsError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ResourceExistsError = ResourceExistsError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Resource not available error\n */\nvar ResourceNotAvailableError = /** @class */ (function (_super) {\n tslib_1.__extends(ResourceNotAvailableError, _super);\n function ResourceNotAvailableError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ResourceNotAvailableError.getTransportableHTTPError = function () {\n return 404;\n };\n /**\n * Index not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.indexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Index not available - \" + resourceId);\n };\n /**\n * Events not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.eventsIndexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Events not available - \" + resourceId);\n };\n /**\n * Logs not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.logsIndexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Logs not available - \" + resourceId);\n };\n /**\n * Engine not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.engineNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Engine not available - \" + resourceId);\n };\n return ResourceNotAvailableError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ResourceNotAvailableError = ResourceNotAvailableError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Unsupported content type error\n */\nvar UnsupportedContentTypeError = /** @class */ (function (_super) {\n tslib_1.__extends(UnsupportedContentTypeError, _super);\n function UnsupportedContentTypeError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n UnsupportedContentTypeError.getTransportableHTTPError = function () {\n return 415;\n };\n /**\n * Unsupported content type\n *\n * @return {InvalidFormatError}\n */\n UnsupportedContentTypeError.createUnsupportedContentTypeException = function () {\n return new UnsupportedContentTypeError(\"This content type is not accepted. Please use application/json\");\n };\n return UnsupportedContentTypeError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.UnsupportedContentTypeError = UnsupportedContentTypeError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar Coordinate_1 = require(\"../Model/Coordinate\");\n/**\n * Abstract Location Range class\n */\nvar LocationRange = /** @class */ (function () {\n function LocationRange() {\n }\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n LocationRange.fromFilterObject = function (object) {\n throw TypeError(\"Method not valid\");\n };\n /**\n * to array\n */\n LocationRange.prototype.toArray = function () {\n return {\n type: this.getName(),\n data: this.toFilterObject()\n };\n };\n /**\n * Create from array\n *\n * @param array\n */\n LocationRange.createFromArray = function (array) {\n if (array.type == \"CoordinateAndDistance\") {\n return CoordinateAndDistance.fromFilterObject(array.data);\n }\n if (array.type == \"Polygon\") {\n return Polygon.fromFilterObject(array.data);\n }\n if (array.type == \"Square\") {\n return Square.fromFilterObject(array.data);\n }\n };\n return LocationRange;\n}());\nexports.LocationRange = LocationRange;\n/**\n * CoordinateAndDistance\n */\nvar CoordinateAndDistance = /** @class */ (function (_super) {\n tslib_1.__extends(CoordinateAndDistance, _super);\n /**\n * Constructor\n *\n * @param coordinate\n * @param distance\n */\n function CoordinateAndDistance(coordinate, distance) {\n var _this = _super.call(this) || this;\n _this.coordinate = coordinate;\n _this.distance = distance;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{}}}\n */\n CoordinateAndDistance.prototype.toFilterObject = function () {\n return {\n coordinate: this.coordinate.toArray(),\n distance: this.distance\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n CoordinateAndDistance.prototype.getName = function () {\n return \"CoordinateAndDistance\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n CoordinateAndDistance.fromFilterObject = function (object) {\n return new CoordinateAndDistance(Coordinate_1.Coordinate.createFromArray(object.coordinate), object.distance);\n };\n return CoordinateAndDistance;\n}(LocationRange));\nexports.CoordinateAndDistance = CoordinateAndDistance;\n/**\n * Polygon\n */\nvar Polygon = /** @class */ (function (_super) {\n tslib_1.__extends(Polygon, _super);\n /**\n * Constructor\n *\n * @param coordinates\n */\n function Polygon(coordinates) {\n var _this = _super.call(this) || this;\n if (coordinates.length < 3) {\n throw new Error(\"A polygon needs more than two coordinates.\");\n }\n _this.coordinates = coordinates;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{coordinates: {lat:number, lon:number}[]}}\n */\n Polygon.prototype.toFilterObject = function () {\n var coordinates = [];\n for (var i in this.coordinates) {\n coordinates.push(this.coordinates[i].toArray());\n }\n return {\n coordinates: coordinates\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n Polygon.prototype.getName = function () {\n return \"Polygon\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {Polygon}\n */\n Polygon.fromFilterObject = function (object) {\n var coordinates = [];\n for (var i in object.coordinates) {\n coordinates.push(Coordinate_1.Coordinate.createFromArray(object.coordinates[i]));\n }\n return new Polygon(coordinates);\n };\n return Polygon;\n}(LocationRange));\nexports.Polygon = Polygon;\n/**\n * Square\n */\nvar Square = /** @class */ (function (_super) {\n tslib_1.__extends(Square, _super);\n /**\n * Constructor\n *\n * @param topLeftCoordinate\n * @param bottomRightCoordinate\n */\n function Square(topLeftCoordinate, bottomRightCoordinate) {\n var _this = _super.call(this) || this;\n _this.topLeftCoordinate = topLeftCoordinate;\n _this.bottomRightCoordinate = bottomRightCoordinate;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{}}}\n */\n Square.prototype.toFilterObject = function () {\n return {\n top_left: this.topLeftCoordinate.toArray(),\n bottom_right: this.bottomRightCoordinate.toArray()\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n Square.prototype.getName = function () {\n return \"Square\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n Square.fromFilterObject = function (object) {\n return new Square(Coordinate_1.Coordinate.createFromArray(object.top_left), Coordinate_1.Coordinate.createFromArray(object.bottom_right));\n };\n return Square;\n}(LocationRange));\nexports.Square = Square;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar axios_1 = require(\"axios\");\nvar Client_1 = require(\"./Client\");\nvar Response_1 = require(\"./Response\");\n/**\n * AxiosClient\n */\nvar AxiosClient = /** @class */ (function (_super) {\n tslib_1.__extends(AxiosClient, _super);\n /**\n * Constructor\n *\n * @param host\n * @param version\n * @param timeout\n * @param retryMap\n * @param overrideQueries\n * @param cache\n */\n function AxiosClient(host, version, timeout, retryMap, overrideQueries, cache) {\n var _this = _super.call(this, version, retryMap) || this;\n _this.host = host;\n _this.timeout = timeout;\n _this.cache = cache;\n _this.overrideQueries = overrideQueries;\n _this.cancelToken = {};\n return _this;\n }\n /**\n * Get\n *\n * @param url\n * @param method\n * @param credentials\n * @param parameters\n * @param data\n *\n * @return {Promise}\n */\n AxiosClient.prototype.get = function (url, method, credentials, parameters, data) {\n if (parameters === void 0) { parameters = {}; }\n if (data === void 0) { data = {}; }\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n var that;\n var _this = this;\n return tslib_1.__generator(this, function (_a) {\n that = this;\n url = url.replace(/^\\/*|\\/*$/g, \"\");\n url = \"/\" + (this.version + \"/\" + url).replace(/^\\/*|\\/*$/g, \"\");\n method = method.toLowerCase();\n if (\"get\" === method &&\n this.overrideQueries) {\n this.abort(url);\n }\n return [2 /*return*/, new Promise(function (resolve, reject) {\n var headers = \"get\" == method\n ? {}\n : {\n \"Content-Encoding\": \"gzip\",\n \"Content-Type\": \"application/json\"\n };\n var axiosRequestConfig = {\n url: url + \"?\" + Client_1.Client.objectToUrlParameters(tslib_1.__assign({}, credentials, parameters)),\n data: data,\n headers: headers,\n method: method,\n baseURL: that.host.replace(/\\/*$/g, \"\"),\n timeout: that.timeout,\n transformRequest: [function (data) { return JSON.stringify(data); }]\n };\n if (typeof _this.cancelToken[url] != 'undefined') {\n axiosRequestConfig.cancelToken = _this.cancelToken[url].token;\n }\n axios_1[\"default\"]\n .request(axiosRequestConfig)\n .then(function (axiosResponse) {\n var response = new Response_1.Response(axiosResponse.status, axiosResponse.data);\n return resolve(response);\n })[\"catch\"](function (error) {\n if (error.response === undefined) {\n return;\n }\n var response = new Response_1.Response(error.response.status, error.response.data);\n return reject(response);\n });\n })];\n });\n });\n };\n /**\n * Abort current request\n * And regenerate the cancellation token\n *\n * @param url\n */\n AxiosClient.prototype.abort = function (url) {\n if (typeof this.cancelToken[url] != 'undefined') {\n this.cancelToken[url].cancel();\n }\n this.generateCancelToken(url);\n };\n /**\n * Generate a new cancellation token for a query\n *\n * @param url\n */\n AxiosClient.prototype.generateCancelToken = function (url) {\n this.cancelToken[url] = axios_1[\"default\"].CancelToken.source();\n };\n return AxiosClient;\n}(Client_1.Client));\nexports.AxiosClient = AxiosClient;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Client\n */\nvar Client = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param version\n * @param retryMap\n */\n function Client(version, retryMap) {\n this.retryMap = retryMap;\n this.version = version.replace(/^\\/*|\\/*$/g, \"\");\n }\n /**\n * Build an url parameters array by an object\n *\n * @param params\n *\n * @returns {string}\n */\n Client.objectToUrlParameters = function (params) {\n var builtParams = [];\n for (var i in params) {\n builtParams.push(i + \"=\" + params[i]);\n }\n return builtParams.join(\"&\");\n };\n return Client;\n}());\nexports.Client = Client;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Http class\n */\nvar HttpClient = /** @class */ (function () {\n function HttpClient() {\n }\n return HttpClient;\n}());\nexports.HttpClient = HttpClient;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Response\n */\nvar Response = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param code\n * @param body\n */\n function Response(code, body) {\n this.code = code;\n this.body = body;\n }\n /**\n * Get code\n *\n * @return {number}\n */\n Response.prototype.getCode = function () {\n return this.code;\n };\n /**\n * Get body\n *\n * @return {any}\n */\n Response.prototype.getBody = function () {\n return this.body;\n };\n return Response;\n}());\nexports.Response = Response;\n","\"use strict\";\nexports.__esModule = true;\nexports.DEFAULT_MICROSECONDS_BETWEEN_RETRIES = 1000;\n/**\n * Http class\n */\nvar Retry = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param url\n * @param method\n * @param retries\n * @param microsecondsBetweenRetries\n */\n function Retry(url, method, retries, microsecondsBetweenRetries) {\n this.url = url;\n this.method = method;\n this.retries = retries;\n this.microsecondsBetweenRetries = microsecondsBetweenRetries;\n }\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Retry}\n */\n Retry.createFromArray = function (array) {\n return new Retry(array.url ? array.url : \"*\", array.method ? array.method : \"*\", array.retries ? array.retries : 0, array.microseconds_between_retries\n ? array.microseconds_between_retries\n : exports.DEFAULT_MICROSECONDS_BETWEEN_RETRIES);\n };\n /**\n * Get url\n *\n * @return {string}\n */\n Retry.prototype.getUrl = function () {\n return this.url;\n };\n /**\n * Get method\n *\n * @return {string}\n */\n Retry.prototype.getMethod = function () {\n return this.method;\n };\n /**\n * Ge retries\n *\n * @return {number}\n */\n Retry.prototype.getRetries = function () {\n return this.retries;\n };\n /**\n * Get microseconds between retries\n *\n * @return {number}\n */\n Retry.prototype.getMicrosecondsBetweenRetries = function () {\n return this.microsecondsBetweenRetries;\n };\n return Retry;\n}());\nexports.Retry = Retry;\n","\"use strict\";\nexports.__esModule = true;\nvar Retry_1 = require(\"./Retry\");\n/**\n * Http class\n */\nvar RetryMap = /** @class */ (function () {\n function RetryMap() {\n this.retries = {};\n }\n /**\n * Add retry\n *\n * @param retry\n */\n RetryMap.prototype.addRetry = function (retry) {\n this.retries[retry.getUrl() + \"~~\" + retry.getMethod()] = retry;\n };\n /**\n * Create from array\n */\n RetryMap.createFromArray = function (array) {\n var retryMap = new RetryMap();\n retryMap.retries = array.map(function (retry) { return Retry_1.Retry.createFromArray(retry); });\n return retryMap;\n };\n /**\n * Get retry\n *\n * @param url\n * @param method\n *\n * @returns {Retry}\n */\n RetryMap.prototype.getRetry = function (url, method) {\n if (this.retries[url + \"~~\" + method] instanceof Retry_1.Retry) {\n return this.retries[url + \"~~\" + method];\n }\n if (this.retries[\"*~~\" + method] instanceof Retry_1.Retry) {\n return this.retries[\"*~~\" + method];\n }\n if (this.retries[url + \"~~*\"] instanceof Retry_1.Retry) {\n return this.retries[url + \"~~*\"];\n }\n if (this.retries[\"*~~*\"] instanceof Retry_1.Retry) {\n return this.retries[\"*~~*\"];\n }\n return null;\n };\n return RetryMap;\n}());\nexports.RetryMap = RetryMap;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * AppUUID class\n */\nvar AppUUID = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param id\n */\n function AppUUID(id) {\n if (id.indexOf('_') >= 0) {\n throw InvalidFormatError_1.InvalidFormatError.appUUIDFormatNotValid();\n }\n this.id = id;\n }\n /**\n * Create by id\n *\n * @param id\n *\n * @returns {ItemUUID}\n */\n AppUUID.createById = function (id) {\n return new AppUUID(id);\n };\n /**\n * Return id\n *\n * @returns {string}\n */\n AppUUID.prototype.getId = function () {\n return this.id;\n };\n /**\n * To array\n *\n * @returns {{id: *, type: *}}\n */\n AppUUID.prototype.toArray = function () {\n return {\n id: this.id\n };\n };\n /**\n * Create from array\n *\n * @param array {{id:string, type:string}}\n *\n * @return {ItemUUID}\n */\n AppUUID.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new AppUUID(array.id);\n };\n /**\n * Compose unique id\n *\n * @returns {string}\n */\n AppUUID.prototype.composedUUID = function () {\n return this.id;\n };\n return AppUUID;\n}());\nexports.AppUUID = AppUUID;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * filter constants\n */\nexports.TYPE_VALUE = 1;\nexports.TYPE_LITERAL = 4;\nexports.TYPE_ARRAY_ELEMENT_UPDATE = 8;\nexports.TYPE_ARRAY_ELEMENT_ADD = 16;\nexports.TYPE_ARRAY_ELEMENT_DELETE = 32;\nexports.TYPE_ARRAY_EXPECTS_ELEMENT = 24;\nexports.TYPE_ARRAY = 56;\n/**\n * Changes Type cast\n * @param Changes\n */\nvar Changes = /** @class */ (function () {\n function Changes() {\n /**\n * Changes\n *\n * @type {Array}\n */\n this.changes = [];\n }\n /**\n * Add new change\n *\n * @param field\n * @param value\n * @param type\n */\n Changes.prototype.addChange = function (field, value, type) {\n if (type === void 0) { type = exports.TYPE_VALUE; }\n this.changes.push({\n field: field,\n type: type,\n value: value\n });\n };\n /**\n * Update element from list\n *\n * @param field\n * @param condition\n * @param value\n * @param type\n */\n Changes.prototype.updateElementFromList = function (field, condition, value, type) {\n this.changes.push({\n field: field,\n type: type | exports.TYPE_ARRAY_ELEMENT_UPDATE,\n condition: condition,\n value: value\n });\n };\n /**\n * Add element in list\n *\n * @param field\n * @param value\n * @param type\n */\n Changes.prototype.addElementInList = function (field, value, type) {\n this.changes.push({\n field: field,\n type: type | exports.TYPE_ARRAY_ELEMENT_ADD,\n value: value\n });\n };\n /**\n * Delete element from list\n *\n * @param field\n * @param condition\n */\n Changes.prototype.deleteElementFromList = function (field, condition) {\n this.changes.push({\n field: field,\n type: exports.TYPE_ARRAY_ELEMENT_DELETE,\n condition: condition\n });\n };\n /**\n * Get changes\n *\n * @returns {[]}\n */\n Changes.prototype.getChanges = function () {\n return this.changes;\n };\n /**\n * Create\n *\n * @returns {Changes}\n */\n Changes.create = function () {\n return new Changes();\n };\n /**\n * To array\n *\n * @returns {[]}\n */\n Changes.prototype.toArray = function () {\n return JSON.parse(JSON.stringify(this.changes));\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Changes}\n */\n Changes.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var changes = Changes.create();\n changes.changes = array;\n return changes;\n };\n return Changes;\n}());\nexports.Changes = Changes;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * Coordinate Type cast\n * @param coordinate\n */\nvar Coordinate = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param {number} lat\n * @param {number} lon\n */\n function Coordinate(lat, lon) {\n this.lat = lat;\n this.lon = lon;\n }\n /**\n * Get latitude\n *\n * @return float\n */\n Coordinate.prototype.getLatitude = function () {\n return this.lat;\n };\n /**\n * Get longitude\n *\n * @return float\n */\n Coordinate.prototype.getLongitude = function () {\n return this.lon;\n };\n /**\n * To array\n *\n * @return {{lat: number, lon: number}}\n */\n Coordinate.prototype.toArray = function () {\n return {\n lat: this.lat,\n lon: this.lon\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return Coordinate\n *\n * @throws InvalidFormatError\n */\n Coordinate.createFromArray = function (array) {\n if (typeof array.lat == \"undefined\" ||\n typeof array.lon == \"undefined\") {\n throw InvalidFormatError_1.InvalidFormatError.coordinateFormatNotValid();\n }\n return new Coordinate(array.lat, array.lon);\n };\n return Coordinate;\n}());\nexports.Coordinate = Coordinate;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar IndexUUID_1 = require(\"./IndexUUID\");\nvar AppUUID_1 = require(\"./AppUUID\");\n/**\n * Index class\n */\nvar Index = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param uuid\n * @param appUUID\n * @param isOK\n * @param docCount\n * @param size\n */\n function Index(uuid, appUUID, isOK, docCount, size) {\n if (isOK === void 0) { isOK = false; }\n if (docCount === void 0) { docCount = 0; }\n if (size === void 0) { size = '0kb'; }\n this.uuid = uuid;\n this.appUUID = appUUID;\n this.isOK = isOK;\n this.docCount = docCount;\n this.size = size;\n }\n /**\n * Get uuid\n *\n * @return {IndexUUID}\n */\n Index.prototype.getUUID = function () {\n return this.uuid;\n };\n /**\n * Get app id\n *\n * @return {AppUUID}\n */\n Index.prototype.getAppUUID = function () {\n return this.appUUID;\n };\n /**\n * Index is OK\n *\n * @return {boolean}\n */\n Index.prototype.isOk = function () {\n return this.isOK;\n };\n /**\n * Get doc count\n *\n * @return {number}\n */\n Index.prototype.getDocCount = function () {\n return this.docCount;\n };\n /**\n * get size\n *\n * @return {string}\n */\n Index.prototype.getSize = function () {\n return this.size;\n };\n /**\n * To array\n *\n * @returns {{id: string, attributes: {}}}\n */\n Index.prototype.toArray = function () {\n return {\n uuid: this.uuid.toArray(),\n app_id: this.appUUID.toArray(),\n is_ok: this.isOK,\n doc_count: this.docCount,\n size: this.size\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return User\n */\n Index.createFromArray = function (array) {\n if (typeof array.uuid == \"undefined\" ||\n typeof array.app_id == \"undefined\") {\n throw InvalidFormatError_1.InvalidFormatError.indexFormatNotValid();\n }\n return new Index(IndexUUID_1.IndexUUID.createFromArray(array.uuid), AppUUID_1.AppUUID.createFromArray(array.app_id), (typeof array.is_ok == \"undefined\" ? false : array.is_ok), (typeof array.doc_count == \"undefined\" ? 0 : array.doc_count), (typeof array.size == \"undefined\" ? '0kb' : array.size));\n };\n return Index;\n}());\nexports.Index = Index;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * IndexUUID class\n */\nvar IndexUUID = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param id\n */\n function IndexUUID(id) {\n if (id.indexOf('_') >= 0) {\n throw InvalidFormatError_1.InvalidFormatError.indexUUIDFormatNotValid();\n }\n this.id = id;\n }\n /**\n * Create by id\n *\n * @param id\n *\n * @returns {ItemUUID}\n */\n IndexUUID.createById = function (id) {\n return new IndexUUID(id);\n };\n /**\n * Return id\n *\n * @returns {string}\n */\n IndexUUID.prototype.getId = function () {\n return this.id;\n };\n /**\n * To array\n *\n * @returns {{id: *, type: *}}\n */\n IndexUUID.prototype.toArray = function () {\n return {\n id: this.id\n };\n };\n /**\n * Create from array\n *\n * @param array {{id:string, type:string}}\n *\n * @return {ItemUUID}\n */\n IndexUUID.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new IndexUUID(array.id);\n };\n /**\n * Compose unique id\n *\n * @returns {string}\n */\n IndexUUID.prototype.composedUUID = function () {\n return this.id;\n };\n return IndexUUID;\n}());\nexports.IndexUUID = IndexUUID;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar Coordinate_1 = require(\"./Coordinate\");\nvar ItemUUID_1 = require(\"./ItemUUID\");\n/**\n * Item class\n */\nvar Item = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param uuid\n * @param coordinate\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n */\n function Item(uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n this.metadata = {};\n this.indexedMetadata = {};\n this.searchableMetadata = {};\n this.exactMatchingMetadata = [];\n this.suggest = [];\n this.highlights = {};\n this.promoted = false;\n this.uuid = uuid;\n this.coordinate = coordinate;\n this.metadata = metadata;\n this.indexedMetadata = indexedMetadata;\n this.searchableMetadata = searchableMetadata;\n this.exactMatchingMetadata = exactMatchingMetadata;\n this.suggest = suggest;\n }\n /**\n * Create new Item\n *\n * @param uuid\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n * @returns {Item}\n */\n Item.create = function (uuid, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n if (metadata === void 0) { metadata = {}; }\n if (indexedMetadata === void 0) { indexedMetadata = {}; }\n if (searchableMetadata === void 0) { searchableMetadata = {}; }\n if (exactMatchingMetadata === void 0) { exactMatchingMetadata = []; }\n if (suggest === void 0) { suggest = []; }\n return new Item(uuid, null, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest);\n };\n /**\n * Create new located Item\n *\n * @param uuid\n * @param coordinate\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n * @returns {Item}\n */\n Item.createLocated = function (uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n if (metadata === void 0) { metadata = {}; }\n if (indexedMetadata === void 0) { indexedMetadata = {}; }\n if (searchableMetadata === void 0) { searchableMetadata = {}; }\n if (exactMatchingMetadata === void 0) { exactMatchingMetadata = []; }\n if (suggest === void 0) { suggest = []; }\n return new Item(uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest);\n };\n /**\n * Get uuid\n *\n * @returns ItemUUID\n */\n Item.prototype.getUUID = function () {\n return this.uuid;\n };\n /**\n * Get id\n *\n * @returns string\n */\n Item.prototype.getId = function () {\n return this.uuid.getId();\n };\n /**\n * Get type\n *\n * @returns string\n */\n Item.prototype.getType = function () {\n return this.uuid.getType();\n };\n /**\n * Get coordinate\n *\n * @returns Coordinate|null\n */\n Item.prototype.getCoordinate = function () {\n return this.coordinate;\n };\n /**\n * Get distance\n *\n * @returns int\n */\n Item.prototype.getDistance = function () {\n return this.distance;\n };\n /**\n * Get metadata\n *\n * @returns Array\n */\n Item.prototype.getMetadata = function () {\n return this.metadata;\n };\n /**\n * Set metadata\n *\n * @param metadata\n */\n Item.prototype.setMetadata = function (metadata) {\n this.metadata = metadata;\n };\n /**\n * Add metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addMetadata = function (key, value) {\n this.metadata[key] = value;\n };\n /**\n * Get indexed metadata\n *\n * @returns Array\n */\n Item.prototype.getIndexedMetadata = function () {\n return this.indexedMetadata;\n };\n /**\n * Set indexed metadata\n *\n * @param indexedMetadata\n */\n Item.prototype.setIndexedMetadata = function (indexedMetadata) {\n this.indexedMetadata = indexedMetadata;\n };\n /**\n * Add indexed metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addIndexedMetadata = function (key, value) {\n this.indexedMetadata[key] = value;\n };\n /**\n * Get searchable metadata\n *\n * @returns Array\n */\n Item.prototype.getSearchableMetadata = function () {\n return this.searchableMetadata;\n };\n /**\n * Set searchable metadata\n *\n * @param searchableMetadata\n */\n Item.prototype.setSearchableMetadata = function (searchableMetadata) {\n this.searchableMetadata = searchableMetadata;\n };\n /**\n * Add searchable metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addSearchableMetadata = function (key, value) {\n this.searchableMetadata[key] = value;\n };\n /**\n * Get exactMatching metadata\n *\n * @returns Array\n */\n Item.prototype.getExactMatchingMetadata = function () {\n return this.exactMatchingMetadata;\n };\n /**\n * Set exactMatching metadata\n *\n * @param exactMatchingMetadata\n */\n Item.prototype.setExactMatchingMetadata = function (exactMatchingMetadata) {\n this.exactMatchingMetadata = exactMatchingMetadata;\n };\n /**\n * Add exactMatching metadata\n *\n * @param value\n */\n Item.prototype.addExactMatchingMetadata = function (value) {\n this.exactMatchingMetadata.push(value);\n };\n /**\n * Get all metadata\n *\n * @returns {{}}\n */\n Item.prototype.getAllMetadata = function () {\n return tslib_1.__assign({}, this.metadata, this.indexedMetadata);\n };\n /**\n * Get\n *\n * @param key\n *\n * @returns mixed|null\n */\n Item.prototype.get = function (key) {\n var allMetadata = this.getAllMetadata();\n return (typeof allMetadata[key] != \"undefined\")\n ? allMetadata[key]\n : null;\n };\n /**\n * Get suggest\n *\n * @returns Array\n */\n Item.prototype.getSuggest = function () {\n return this.suggest;\n };\n /**\n * Get highlights\n *\n * @returns Array\n */\n Item.prototype.getHighlights = function () {\n return this.highlights;\n };\n /**\n * Get highlight\n *\n * @param key\n *\n * @return string|null\n */\n Item.prototype.getHighlight = function (key) {\n return (typeof this.highlights[key] != \"undefined\")\n ? this.highlights[key]\n : null;\n };\n /**\n * Is promoted\n *\n * @returns boolean\n */\n Item.prototype.isPromoted = function () {\n return this.promoted;\n };\n /**\n * Set score\n *\n * @param score\n *\n * @return {Item}\n */\n Item.prototype.setScore = function (score) {\n this.score = score;\n return this;\n };\n /**\n * Get score\n *\n * @return {number}\n */\n Item.prototype.getScore = function () {\n return this.score;\n };\n /**\n * To array\n */\n Item.prototype.toArray = function () {\n var itemAsArray = {\n uuid: this.uuid.toArray()\n };\n if (this.coordinate instanceof Coordinate_1.Coordinate) {\n itemAsArray.coordinate = this.coordinate.toArray();\n }\n if (Object.keys(this.metadata).length > 0) {\n itemAsArray.metadata = this.metadata;\n }\n if (Object.keys(this.indexedMetadata).length > 0) {\n itemAsArray.indexed_metadata = this.indexedMetadata;\n }\n if (Object.keys(this.searchableMetadata).length > 0) {\n itemAsArray.searchable_metadata = this.searchableMetadata;\n }\n if (this.exactMatchingMetadata.length > 0) {\n itemAsArray.exact_matching_metadata = this.exactMatchingMetadata;\n }\n if (this.suggest.length > 0) {\n itemAsArray.suggest = this.suggest;\n }\n if (Object.keys(this.highlights).length > 0) {\n itemAsArray.highlights = this.highlights;\n }\n if (this.isPromoted()) {\n itemAsArray.is_promoted = true;\n }\n if (typeof this.distance != \"undefined\") {\n itemAsArray.distance = this.distance;\n }\n if (typeof this.score != \"undefined\") {\n itemAsArray.score = this.score;\n }\n return itemAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n */\n Item.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.uuid != \"object\") {\n throw InvalidFormatError_1.InvalidFormatError.itemUUIDRepresentationNotValid();\n }\n if (typeof array.coordinate != \"undefined\" &&\n typeof array.coordinate != \"object\") {\n throw InvalidFormatError_1.InvalidFormatError.coordinateFormatNotValid();\n }\n var item = (typeof array.coordinate == \"object\" &&\n array.coordinate != null)\n ? Item.createLocated(ItemUUID_1.ItemUUID.createFromArray(array.uuid), Coordinate_1.Coordinate.createFromArray(array.coordinate), ((typeof array.metadata == \"undefined\") ? {} : array.metadata), ((typeof array.indexed_metadata == \"undefined\") ? {} : array.indexed_metadata), ((typeof array.searchable_metadata == \"undefined\") ? {} : array.searchable_metadata), ((typeof array.exact_matching_metadata == \"undefined\") ? [] : array.exact_matching_metadata), ((typeof array.suggest == \"undefined\") ? [] : array.suggest))\n : Item.create(ItemUUID_1.ItemUUID.createFromArray(array.uuid), ((typeof array.metadata == \"undefined\") ? {} : array.metadata), ((typeof array.indexed_metadata == \"undefined\") ? {} : array.indexed_metadata), ((typeof array.searchable_metadata == \"undefined\") ? {} : array.searchable_metadata), ((typeof array.exact_matching_metadata == \"undefined\") ? [] : array.exact_matching_metadata), ((typeof array.suggest == \"undefined\") ? [] : array.suggest));\n if (typeof array.distance != \"undefined\" &&\n array.distance != null) {\n item.distance = array.distance;\n }\n if (typeof array.highlights == \"object\" &&\n array.distance != null) {\n item.highlights = array.highlights;\n }\n if (typeof array.is_promoted != \"undefined\" &&\n array.is_promoted != null) {\n item.promoted = array.is_promoted;\n }\n if (typeof array.score != \"undefined\" &&\n array.score != null) {\n item.score = array.score;\n }\n return item;\n };\n /**\n * Compose uuid\n *\n * @returns string\n */\n Item.prototype.composeUUID = function () {\n return this.uuid.composedUUID();\n };\n /**\n * Get path by field.\n *\n * @param field\n *\n * @returns {string}\n */\n Item.getPathByField = function (field) {\n return ([\"id\", \"type\"].indexOf(field) > -1)\n ? \"uuid.\" + field\n : \"indexed_metadata.\" + field;\n };\n return Item;\n}());\nexports.Item = Item;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * ItemUUID class\n */\nvar ItemUUID = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param id\n * @param type\n */\n function ItemUUID(id, type) {\n this.id = id;\n this.type = type;\n }\n /**\n * Create composed UUID\n *\n * @param composedUUID\n *\n * @returns {ItemUUID}\n */\n ItemUUID.createByComposedUUID = function (composedUUID) {\n var parts = composedUUID.split(\"~\");\n if (2 != parts.length) {\n throw InvalidFormatError_1.InvalidFormatError.composedItemUUIDNotValid();\n }\n return new ItemUUID(parts[0], parts[1]);\n };\n /**\n * Return id\n *\n * @returns {string}\n */\n ItemUUID.prototype.getId = function () {\n return this.id;\n };\n /**\n * Get type\n *\n * @returns {string}\n */\n ItemUUID.prototype.getType = function () {\n return this.type;\n };\n /**\n * To array\n *\n * @returns {{id: *, type: *}}\n */\n ItemUUID.prototype.toArray = function () {\n return {\n id: this.id,\n type: this.type\n };\n };\n /**\n * Create from array\n *\n * @param array {{id:string, type:string}}\n *\n * @return {ItemUUID}\n */\n ItemUUID.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new ItemUUID(array.id, array.type);\n };\n /**\n * Compose unique id\n *\n * @returns {string}\n */\n ItemUUID.prototype.composedUUID = function () {\n return this.id + \"~\" + this.type;\n };\n return ItemUUID;\n}());\nexports.ItemUUID = ItemUUID;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * User class\n */\nvar Metadata = /** @class */ (function () {\n function Metadata() {\n }\n /**\n * To metadata\n *\n * @param array:{}\n *\n * @returns {string}\n */\n Metadata.toMetadata = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var parts = [];\n for (var key in array) {\n parts.push(key + \"##\" + array[key]);\n }\n return parts.join(\"~~\");\n };\n /**\n * From metadata\n *\n * @param metadata\n *\n * @return {{}}\n */\n Metadata.fromMetadata = function (metadata) {\n var values = {};\n var splittedParts = metadata.split(\"~~\");\n var iterator = 0;\n var size = 0;\n var lastElement = null;\n for (var key in splittedParts) {\n var part = splittedParts[key];\n var parts = part.split(\"##\");\n if (parts.length > 1) {\n lastElement = parts[1];\n values[parts[0]] = lastElement;\n }\n else {\n lastElement = part;\n values[iterator++] = lastElement;\n }\n size++;\n }\n if (size == 1) {\n values = {\n id: lastElement,\n name: lastElement\n };\n }\n if (typeof values.id == \"undefined\") {\n return null;\n }\n return values;\n };\n return Metadata;\n}());\nexports.Metadata = Metadata;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * User class\n */\nvar User = /** @class */ (function () {\n /**\n * Construct\n *\n * @param id string\n * @param attributes Array\n */\n function User(id, attributes) {\n if (attributes === void 0) { attributes = {}; }\n this.id = id;\n this.attributes = attributes;\n }\n /**\n * Return the user id\n *\n * @return {string}\n */\n User.prototype.getId = function () {\n return this.id;\n };\n /**\n * Return array\n *\n * @returns {{}}\n */\n User.prototype.getAttributes = function () {\n return this.attributes;\n };\n /**\n * To array\n *\n * @returns {{id: string, attributes: {}}}\n */\n User.prototype.toArray = function () {\n var array = {\n id: this.id\n };\n if (Object.keys(this.attributes).length > 0) {\n array.attributes = this.attributes;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return User\n */\n User.createFromArray = function (array) {\n if (array == null ||\n typeof array.id == \"undefined\" ||\n array.id == null) {\n throw InvalidFormatError_1.InvalidFormatError.userFormatNotValid();\n }\n var attributes = typeof array.attributes === typeof {}\n ? array.attributes\n : {};\n return new User(array.id, attributes);\n };\n return User;\n}());\nexports.User = User;\n","\"use strict\";\nexports.__esModule = true;\nvar Filter_1 = require(\"./Filter\");\n/**\n * Aggregation constants\n */\nexports.AGGREGATION_SORT_BY_COUNT_ASC = [\"_count\", \"asc\"];\nexports.AGGREGATION_SORT_BY_COUNT_DESC = [\"_count\", \"desc\"];\nexports.AGGREGATION_SORT_BY_NAME_ASC = [\"_term\", \"asc\"];\nexports.AGGREGATION_SORT_BY_NAME_DESC = [\"_term\", \"desc\"];\nexports.AGGREGATION_NO_LIMIT = 0;\n/**\n * Aggregation class\n */\nvar Aggregation = /** @class */ (function () {\n /**\n * Construct\n *\n * @param name\n * @param field\n * @param applicationType\n * @param filterType\n * @param subgroup\n * @param sort\n * @param limit\n */\n function Aggregation(name, field, applicationType, filterType, subgroup, sort, limit) {\n this.subgroup = [];\n this.name = name;\n this.field = field;\n this.applicationType = applicationType;\n this.filterType = filterType;\n this.subgroup = subgroup;\n this.sort = sort;\n this.limit = limit;\n }\n /**\n * Get name\n *\n * @returns {string}\n */\n Aggregation.prototype.getName = function () {\n return this.name;\n };\n /**\n * Get field\n *\n * @returns {string}\n */\n Aggregation.prototype.getField = function () {\n return this.field;\n };\n /**\n * getApplicationType\n *\n * @returns {number}\n */\n Aggregation.prototype.getApplicationType = function () {\n return this.applicationType;\n };\n /**\n * Get filter type\n *\n * @return {string}\n */\n Aggregation.prototype.getFilterType = function () {\n return this.filterType;\n };\n /**\n * Get subgroup\n *\n * @return {[]}\n */\n Aggregation.prototype.getSubgroup = function () {\n return this.subgroup;\n };\n /**\n * Get sort\n *\n * @return {[]}\n */\n Aggregation.prototype.getSort = function () {\n return this.sort;\n };\n /**\n * Get limit\n *\n * @return {number}\n */\n Aggregation.prototype.getLimit = function () {\n return this.limit;\n };\n /**\n * Create\n *\n * @param name\n * @param field\n * @param applicationType\n * @param filterType\n * @param subgroup\n * @param sort\n * @param limit\n *\n * @returns {Aggregation}\n */\n Aggregation.create = function (name, field, applicationType, filterType, subgroup, sort, limit) {\n if (subgroup === void 0) { subgroup = []; }\n if (sort === void 0) { sort = exports.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = exports.AGGREGATION_NO_LIMIT; }\n return new Aggregation(name, field, applicationType, filterType, subgroup, sort, limit);\n };\n /**\n * To array\n *\n * @returns {Array}\n */\n Aggregation.prototype.toArray = function () {\n var aggregationAsArray = {\n name: this.name\n };\n if (this.field != \"uuid.type\") {\n aggregationAsArray.field = this.field;\n }\n if (this.applicationType != Filter_1.FILTER_AT_LEAST_ONE) {\n aggregationAsArray.application_type = this.applicationType;\n }\n if (this.filterType != Filter_1.FILTER_TYPE_FIELD) {\n aggregationAsArray.filter_type = this.filterType;\n }\n if (this.subgroup.length > 0) {\n aggregationAsArray.subgroup = this.subgroup;\n }\n if (JSON.stringify(this.sort) !== JSON.stringify(exports.AGGREGATION_SORT_BY_COUNT_DESC)) {\n aggregationAsArray.sort = this.sort;\n }\n if (this.limit != exports.AGGREGATION_NO_LIMIT) {\n aggregationAsArray.limit = this.limit;\n }\n return aggregationAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Aggregation}\n */\n Aggregation.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.field == \"undefined\") {\n array.field = \"uuid.type\";\n }\n if (typeof array.application_type == \"undefined\") {\n array.application_type = Filter_1.FILTER_AT_LEAST_ONE;\n }\n if (typeof array.filter_type == \"undefined\") {\n array.filter_type = Filter_1.FILTER_TYPE_FIELD;\n }\n if (typeof array.subgroup == \"undefined\") {\n array.subgroup = [];\n }\n if (typeof array.sort == \"undefined\") {\n array.sort = exports.AGGREGATION_SORT_BY_COUNT_DESC;\n }\n if (typeof array.limit == \"undefined\") {\n array.limit = exports.AGGREGATION_NO_LIMIT;\n }\n return Aggregation.create(array.name, array.field, array.application_type, array.filter_type, array.subgroup, array.sort, array.limit);\n };\n return Aggregation;\n}());\nexports.Aggregation = Aggregation;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * filter constants\n */\nexports.FILTER_MUST_ALL = 4;\nexports.FILTER_MUST_ALL_WITH_LEVELS = 5;\nexports.FILTER_AT_LEAST_ONE = 8;\nexports.FILTER_EXCLUDE = 16;\nexports.FILTER_PROMOTE = 32;\nexports.FILTER_TYPE_FIELD = \"field\";\nexports.FILTER_TYPE_RANGE = \"range\";\nexports.FILTER_TYPE_DATE_RANGE = \"date_range\";\nexports.FILTER_TYPE_GEO = \"geo\";\nexports.FILTER_TYPE_QUERY = \"query\";\n/**\n * Filter class\n */\nvar Filter = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param field\n * @param values\n * @param applicationType\n * @param filterType\n * @param filterTerms\n */\n function Filter(field, values, applicationType, filterType, filterTerms) {\n this.field = field;\n this.values = values;\n this.applicationType = applicationType;\n this.filterType = filterType;\n this.filterTerms = filterTerms;\n }\n /**\n * Get field\n *\n * @returns {string}\n */\n Filter.prototype.getField = function () {\n return this.field;\n };\n /**\n * Get values\n *\n * @returns {any}\n */\n Filter.prototype.getValues = function () {\n return this.values;\n };\n /**\n * Has value\n *\n * @param value\n *\n * @returns {boolean}\n */\n Filter.prototype.hasValue = function (value) {\n return typeof this.values[value] == \"undefined\";\n };\n /**\n * getApplicationType\n *\n * @returns {number}\n */\n Filter.prototype.getApplicationType = function () {\n return this.applicationType;\n };\n /**\n * Get filter type\n *\n * @return {string}\n */\n Filter.prototype.getFilterType = function () {\n return this.filterType;\n };\n /**\n * Get filter type\n *\n * @return {{}}\n */\n Filter.prototype.getFilterTerms = function () {\n return this.filterTerms;\n };\n /**\n * Create\n *\n * @param field\n * @param values\n * @param applicationType\n * @param filterType\n * @param filterTerms\n *\n * @return {Filter}\n */\n Filter.create = function (field, values, applicationType, filterType, filterTerms) {\n if (filterTerms === void 0) { filterTerms = []; }\n return new Filter(field, values, applicationType, filterType, filterTerms);\n };\n /**\n * To array\n *\n * @returns {Array}\n */\n Filter.prototype.toArray = function () {\n var filterAsArray = {};\n if (this.field != \"uuid.type\") {\n filterAsArray.field = this.field;\n }\n if (this.values.length > 0 ||\n Object.keys(this.values).length > 0) {\n filterAsArray.values = this.values;\n }\n if (this.applicationType != exports.FILTER_AT_LEAST_ONE) {\n filterAsArray.application_type = this.applicationType;\n }\n if (this.filterType != exports.FILTER_TYPE_FIELD) {\n filterAsArray.filter_type = this.filterType;\n }\n if (this.filterTerms.length > 0) {\n filterAsArray.filter_terms = this.filterTerms;\n }\n return filterAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Filter}\n */\n Filter.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.field == \"undefined\") {\n array.field = \"uuid.type\";\n }\n if (typeof array.values == \"undefined\") {\n array.values = [];\n }\n if (typeof array.application_type == \"undefined\") {\n array.application_type = exports.FILTER_AT_LEAST_ONE;\n }\n if (typeof array.filter_type == \"undefined\") {\n array.filter_type = exports.FILTER_TYPE_FIELD;\n }\n if (typeof array.filter_terms == \"undefined\") {\n array.filter_terms = [];\n }\n return Filter.create(array.field, array.values, array.application_type, array.filter_type, array.filter_terms);\n };\n return Filter;\n}());\nexports.Filter = Filter;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar Coordinate_1 = require(\"../Model/Coordinate\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\nvar Item_1 = require(\"../Model/Item\");\nvar User_1 = require(\"../Model/User\");\nvar Aggregation_1 = require(\"./Aggregation\");\nvar Filter_1 = require(\"./Filter\");\nvar Filter_2 = require(\"./Filter\");\nvar Aggregation_2 = require(\"./Aggregation\");\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar Filter_3 = require(\"./Filter\");\nvar ScoreStrategies_1 = require(\"./ScoreStrategies\");\nvar SortBy_1 = require(\"./SortBy\");\n/**\n * Query constants\n */\nexports.QUERY_DEFAULT_FROM = 0;\nexports.QUERY_DEFAULT_PAGE = 1;\nexports.QUERY_DEFAULT_SIZE = 10;\nexports.QUERY_INFINITE_SIZE = 1000;\nexports.NO_MIN_SCORE = 0.0;\n/**\n * Query class\n */\nvar Query = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param queryText\n */\n function Query(queryText) {\n this.fields = [];\n this.universeFilters = {};\n this.filters = {};\n this.itemsPromoted = [];\n this.aggregations = {};\n this.resultsEnabled = true;\n this.aggregationsEnabled = true;\n this.suggestionsEnabled = false;\n this.highlightsEnabled = false;\n this.filterFields = [];\n this.minScore = exports.NO_MIN_SCORE;\n this.sortByInstance = SortBy_1.SortBy.create();\n this.filters._query = Filter_1.Filter.create(\"\", [queryText], 0, Filter_3.FILTER_TYPE_QUERY);\n }\n /**\n * Created located\n *\n * @param coordinate\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Query.createLocated = function (coordinate, queryText, page, size) {\n if (page === void 0) { page = exports.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = exports.QUERY_DEFAULT_SIZE; }\n var query = Query.create(queryText, page, size);\n query.coordinate = coordinate;\n return query;\n };\n /**\n * Create\n *\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Query.create = function (queryText, page, size) {\n if (page === void 0) { page = exports.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = exports.QUERY_DEFAULT_SIZE; }\n page = Math.max(1, page);\n var query = new Query(queryText);\n query.from = (page - 1) * size;\n query.size = size;\n query.page = page;\n return query;\n };\n /**\n * Create match all\n *\n * @return {Query}\n */\n Query.createMatchAll = function () {\n return Query.create(\"\", exports.QUERY_DEFAULT_PAGE, exports.QUERY_DEFAULT_SIZE);\n };\n /**\n * Create by UUID\n *\n * @param uuid\n *\n * @return {Query}\n */\n Query.createByUUID = function (uuid) {\n return Query.createByUUIDs(uuid);\n };\n /**\n * Create by UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.createByUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n var ids = [];\n for (var i in uuids) {\n ids.push(uuids[i].composedUUID());\n }\n var query = Query.create(\"\", exports.QUERY_DEFAULT_PAGE, ids.length)\n .disableAggregations()\n .disableSuggestions();\n query.filters._id = Filter_1.Filter.create(\"_id\", ids, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD);\n return query;\n };\n /**\n * set fields\n *\n * @param fields\n *\n * @return {Query}\n */\n Query.prototype.setFields = function (fields) {\n this.fields = fields;\n return this;\n };\n /**\n * get fields\n *\n * @return {string[]}\n */\n Query.prototype.getFields = function () {\n return this.fields;\n };\n /**\n * Filter universe by types\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByTypes = function (values) {\n var _a;\n var fieldPath = Item_1.Item.getPathByField(\"type\");\n if (values.length > 0) {\n this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[\"type\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters.type;\n }\n return this;\n };\n /**\n * Filter by types\n *\n * @param values\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByTypes = function (values, aggregate, aggregationSort) {\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a, _b;\n var fieldPath = Item_1.Item.getPathByField(\"type\");\n if (values.length > 0) {\n this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[\"type\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters.type;\n }\n if (aggregate) {\n this.aggregations = tslib_1.__assign({}, this.aggregations, (_b = {}, _b[\"type\"] = Aggregation_1.Aggregation.create(\"type\", fieldPath, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort), _b));\n }\n return this;\n };\n /**\n * Filter universe by ids\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByIds = function (values) {\n var _a;\n var fieldPath = Item_1.Item.getPathByField(\"id\");\n if (values.length > 0) {\n this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[\"id\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters.id;\n }\n return this;\n };\n /**\n * Filter by ids\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterByIds = function (values) {\n var _a;\n var fieldPath = Item_1.Item.getPathByField(\"id\");\n if (values.length > 0) {\n this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[\"id\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters.id;\n }\n return this;\n };\n /**\n * Filter universe by\n *\n * @param field\n * @param values\n * @param applicationType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseBy = function (field, values, applicationType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n var _a;\n var fieldPath = Item_1.Item.getPathByField(field);\n if (values.length > 0) {\n this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[field] = Filter_1.Filter.create(fieldPath, values, applicationType, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters[field];\n }\n return this;\n };\n /**\n * Filter by\n *\n * @param filterName\n * @param field\n * @param values\n * @param applicationType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterBy = function (filterName, field, values, applicationType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a;\n var fieldPath = Item_1.Item.getPathByField(field);\n if (values.length > 0) {\n this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[filterName] = Filter_1.Filter.create(fieldPath, values, applicationType, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters[filterName];\n }\n if (aggregate) {\n this.aggregateBy(filterName, field, applicationType, aggregationSort);\n }\n return this;\n };\n /**\n * Filter universe by range\n *\n * @param field\n * @param values\n * @param applicationType\n * @param rangeType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByRange = function (field, values, applicationType, rangeType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n var _a;\n var fieldPath = Item_1.Item.getPathByField(field);\n if (values.length > 0) {\n this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[field] = Filter_1.Filter.create(fieldPath, values, applicationType, rangeType), _a));\n }\n else {\n delete this.universeFilters[field];\n }\n return this;\n };\n /**\n * Filter universe by date range\n *\n * @param field\n * @param values\n * @param applicationType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByDateRange = function (field, values, applicationType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n return this.filterUniverseByRange(field, values, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE);\n };\n /**\n * Filter by range\n *\n * @param filterName\n * @param field\n * @param options\n * @param values\n * @param applicationType\n * @param rangeType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByRange = function (filterName, field, options, values, applicationType, rangeType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a;\n var fieldPath = Item_1.Item.getPathByField(field);\n if (values.length !== 0) {\n this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[filterName] = Filter_1.Filter.create(fieldPath, values, applicationType, rangeType), _a));\n }\n else {\n delete this.filters[filterName];\n }\n if (aggregate) {\n this.aggregateByRange(filterName, fieldPath, options, applicationType, rangeType, aggregationSort);\n }\n return this;\n };\n /**\n * Filter by date range\n *\n * @param filterName\n * @param field\n * @param options\n * @param values\n * @param applicationType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByDateRange = function (filterName, field, options, values, applicationType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n return this.filterByRange(filterName, field, options, values, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE, aggregate, aggregationSort);\n };\n /**\n * Filter universe by location\n *\n * @param locationRange\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByLocation = function (locationRange) {\n var _a;\n this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[\"coordinate\"] = Filter_1.Filter.create(\"coordinate\", locationRange.toArray(), Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_GEO), _a));\n return this;\n };\n /**\n * Set filter fields\n *\n * @param filterFields\n *\n * @return {Query}\n */\n Query.prototype.setFilterFields = function (filterFields) {\n this.filterFields = filterFields;\n return this;\n };\n /**\n * Get filter fields\n *\n * @return {string[]}\n */\n Query.prototype.getFilterFields = function () {\n return this.filterFields;\n };\n /**\n * Sort by\n *\n * @param sortBy\n *\n * @return {Query}\n */\n Query.prototype.sortBy = function (sortBy) {\n if (sortBy.isSortedByGeoDistance()) {\n if (!(this.coordinate instanceof Coordinate_1.Coordinate)) {\n throw InvalidFormatError_1.InvalidFormatError.querySortedByDistanceWithoutCoordinate();\n }\n sortBy.setCoordinate(this.coordinate);\n }\n this.sortByInstance = sortBy;\n return this;\n };\n /**\n * Aggregate by\n *\n * @param filterName\n * @param field\n * @param applicationType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateBy = function (filterName, field, applicationType, aggregationSort, limit) {\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n var _a;\n this.aggregations = tslib_1.__assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Item_1.Item.getPathByField(field), applicationType, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort, limit), _a));\n return this;\n };\n /**\n * Aggregate by range\n *\n * @param filterName\n * @param field\n * @param options\n * @param applicationType\n * @param rangeType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateByRange = function (filterName, field, options, applicationType, rangeType, aggregationSort, limit) {\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n var _a;\n if (options.length === 0) {\n return this;\n }\n this.aggregations = tslib_1.__assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Item_1.Item.getPathByField(field), applicationType, rangeType, options, aggregationSort, limit), _a));\n return this;\n };\n /**\n * Aggregate by date range\n *\n * @param filterName\n * @param field\n * @param options\n * @param applicationType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateByDateRange = function (filterName, field, options, applicationType, aggregationSort, limit) {\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n return this.aggregateByRange(filterName, field, options, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE, aggregationSort, limit);\n };\n /**\n * Get aggregations\n *\n * @return {{}}\n */\n Query.prototype.getAggregations = function () {\n return this.aggregations;\n };\n /**\n * Get aggregation by name\n *\n * @param aggregationName\n *\n * @return {Aggregation|null}\n */\n Query.prototype.getAggregation = function (aggregationName) {\n return this.aggregations[aggregationName] instanceof Aggregation_1.Aggregation\n ? this.aggregations[aggregationName]\n : null;\n };\n /**\n * Get query text\n *\n * @return {string}\n */\n Query.prototype.getQueryText = function () {\n var filter = this.filters._query;\n return filter instanceof Filter_1.Filter\n ? filter.getValues()[0]\n : \"\";\n };\n /**\n * Get universe filters\n *\n * @return {{}}\n */\n Query.prototype.getUniverseFilters = function () {\n return this.universeFilters;\n };\n /**\n * Get universe filter by name\n *\n * @param filterName\n *\n * @return {Filter|null}\n */\n Query.prototype.getUniverseFilter = function (filterName) {\n return this.universeFilters[filterName] instanceof Filter_1.Filter\n ? this.universeFilters[filterName]\n : null;\n };\n /**\n * Get filters\n *\n * @return {{}}\n */\n Query.prototype.getFilters = function () {\n return this.filters;\n };\n /**\n * Get filter by name\n *\n * @param filterName\n *\n * @return {Filter|null}\n */\n Query.prototype.getFilter = function (filterName) {\n return this.filters[filterName] instanceof Filter_1.Filter\n ? this.filters[filterName]\n : null;\n };\n /**\n * Get filter by field\n *\n * @param fieldName\n *\n * @return {Filter|null}\n */\n Query.prototype.getFilterByField = function (fieldName) {\n var fieldPath = Item_1.Item.getPathByField(fieldName);\n for (var i in this.filters) {\n if (this.filters[i].getField() == fieldPath) {\n return this.filters[i];\n }\n }\n return null;\n };\n /**\n * Get sort by\n *\n * @return {SortBy}\n */\n Query.prototype.getSortBy = function () {\n return this.sortByInstance;\n };\n /**\n * Get from\n *\n * @return {number}\n */\n Query.prototype.getFrom = function () {\n return this.from;\n };\n /**\n * Get size\n *\n * @return {number}\n */\n Query.prototype.getSize = function () {\n return this.size;\n };\n /**\n * Get page\n *\n * @return {number}\n */\n Query.prototype.getPage = function () {\n return this.page;\n };\n /**\n * Enable results\n *\n * @return {Query}\n */\n Query.prototype.enableResults = function () {\n this.resultsEnabled = true;\n return this;\n };\n /**\n * Disable results\n *\n * @return {Query}\n */\n Query.prototype.disableResults = function () {\n this.resultsEnabled = false;\n return this;\n };\n /**\n * Are results enabled\n *\n * @return {boolean}\n */\n Query.prototype.areResultsEnabled = function () {\n return this.resultsEnabled;\n };\n /**\n * Enable aggregations\n *\n * @return {Query}\n */\n Query.prototype.enableAggregations = function () {\n this.aggregationsEnabled = true;\n return this;\n };\n /**\n * Disable aggregations\n *\n * @return {Query}\n */\n Query.prototype.disableAggregations = function () {\n this.aggregationsEnabled = false;\n return this;\n };\n /**\n * Are aggregations enabled\n *\n * @return {boolean}\n */\n Query.prototype.areAggregationsEnabled = function () {\n return this.aggregationsEnabled;\n };\n /**\n * Enable suggestions\n *\n * @return {Query}\n */\n Query.prototype.enableSuggestions = function () {\n this.suggestionsEnabled = true;\n return this;\n };\n /**\n * Disable suggestions\n *\n * @return {Query}\n */\n Query.prototype.disableSuggestions = function () {\n this.suggestionsEnabled = false;\n return this;\n };\n /**\n * Are suggestions enabled\n *\n * @return {boolean}\n */\n Query.prototype.areSuggestionsEnabled = function () {\n return this.suggestionsEnabled;\n };\n /**\n * Enable highlights\n *\n * @return {Query}\n */\n Query.prototype.enableHighlights = function () {\n this.highlightsEnabled = true;\n return this;\n };\n /**\n * Disable highlights\n *\n * @return {Query}\n */\n Query.prototype.disableHighlights = function () {\n this.highlightsEnabled = false;\n return this;\n };\n /**\n * Are highlights enabled\n *\n * @return {boolean}\n */\n Query.prototype.areHighlightsEnabled = function () {\n return this.highlightsEnabled;\n };\n /**\n * Promote uuid\n *\n * @param itemUUID\n *\n * @return {Query}\n */\n Query.prototype.promoteUUID = function (itemUUID) {\n this\n .itemsPromoted\n .push(itemUUID);\n return this;\n };\n /**\n * Promote UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.prototype.promoteUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n this.itemsPromoted = uuids;\n return this;\n };\n /**\n * Get promoted UUIDs\n *\n * @return {ItemUUID[]}\n */\n Query.prototype.getItemsPromoted = function () {\n return this.itemsPromoted;\n };\n /**\n * Exclude id\n *\n * @param itemUUID\n *\n * @return {Query}\n */\n Query.prototype.excludeUUID = function (itemUUID) {\n this.excludeUUIDs(itemUUID);\n return this;\n };\n /**\n * Exclude UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.prototype.excludeUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n var _a;\n this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[\"excluded_ids\"] = Filter_1.Filter.create(\"_id\", uuids.map(function (uuid) { return uuid.composedUUID(); }), Filter_2.FILTER_EXCLUDE, Filter_2.FILTER_TYPE_FIELD), _a));\n return this;\n };\n /**\n * Get score strategies\n *\n * @return {ScoreStrategies}\n */\n Query.prototype.getScoreStrategies = function () {\n return this.scoreStrategies;\n };\n /**\n * Set score strategies\n *\n * @param scoreStrategies\n */\n Query.prototype.setScoreStrategies = function (scoreStrategies) {\n this.scoreStrategies = scoreStrategies;\n return this;\n };\n /**\n * Get fuzziness\n *\n * @return any\n */\n Query.prototype.getFuzziness = function () {\n return this.fuzziness;\n };\n /**\n * Set fuzziness\n *\n * @param fuzziness\n *\n * @return {Query}\n */\n Query.prototype.setFuzziness = function (fuzziness) {\n this.fuzziness = fuzziness;\n return this;\n };\n /**\n * Set auto fuzziness\n *\n * @return {Query}\n */\n Query.prototype.setAutoFuzziness = function () {\n this.fuzziness = 'AUTO';\n return this;\n };\n /**\n * Get min score\n *\n * @return any\n */\n Query.prototype.getMinScore = function () {\n return this.minScore;\n };\n /**\n * Set min score\n *\n * @param minScore\n *\n * @return {Query}\n */\n Query.prototype.setMinScore = function (minScore) {\n this.minScore = minScore;\n return this;\n };\n /**\n * By user\n *\n * @param user\n *\n * @return {Query}\n */\n Query.prototype.byUser = function (user) {\n this.user = user;\n return this;\n };\n /**\n * By anyone\n *\n * @return {null}\n */\n Query.prototype.anonymously = function () {\n this.user = null;\n return null;\n };\n /**\n * Get user\n *\n * @return {User}\n */\n Query.prototype.getUser = function () {\n return this.user;\n };\n /**\n * To array\n *\n * @return {any}\n */\n Query.prototype.toArray = function () {\n var array = {};\n if (this.getQueryText() !== \"\") {\n array.q = this.getQueryText();\n }\n if (this.coordinate instanceof Coordinate_1.Coordinate) {\n array.coordinate = this.coordinate.toArray();\n }\n /**\n * Fields\n */\n if (this.fields instanceof Array &&\n this.fields.length > 0) {\n array.fields = this.fields;\n }\n /**\n * Universe Filters\n */\n if (Object.keys(this.universeFilters).length) {\n array.universe_filters = {};\n for (var i in this.universeFilters) {\n var universeFilter = this.universeFilters[i];\n array.universe_filters[i] = universeFilter.toArray();\n }\n }\n /**\n * Filters\n */\n if (this.filters instanceof Object &&\n Object.keys(this.filters).length) {\n array.filters = {};\n for (var i in this.filters) {\n var filter = this.filters[i];\n if (filter.getFilterType() !== Filter_3.FILTER_TYPE_QUERY) {\n array.filters[i] = filter.toArray();\n }\n }\n }\n /**\n * Aggregations\n */\n if (this.aggregations instanceof Object &&\n Object.keys(this.aggregations).length) {\n array.aggregations = {};\n for (var i in this.aggregations) {\n var aggregation = this.aggregations[i];\n array.aggregations[i] = aggregation.toArray();\n }\n }\n /**\n * Sort\n */\n var sort = this.sortByInstance.toArray();\n if (Object.keys(sort).length) {\n array.sort = sort;\n }\n /**\n * Page\n */\n var page = this.page;\n if (page !== exports.QUERY_DEFAULT_PAGE) {\n array.page = page;\n }\n /**\n * Size\n */\n var size = this.size;\n if (size !== exports.QUERY_DEFAULT_SIZE) {\n array.size = size;\n }\n /**\n * Booleans\n */\n if (this.resultsEnabled === false) {\n array.results_enabled = false;\n }\n if (this.suggestionsEnabled === true) {\n array.suggestions_enabled = true;\n }\n if (this.highlightsEnabled === true) {\n array.highlights_enabled = true;\n }\n if (this.aggregationsEnabled === false) {\n array.aggregations_enabled = false;\n }\n /**\n * Filter fields\n */\n if (this.filterFields instanceof Array &&\n this.filterFields.length > 0) {\n array.filter_fields = this.filterFields;\n }\n /**\n * Score strategies\n */\n if (this.scoreStrategies instanceof ScoreStrategies_1.ScoreStrategies) {\n var scoreStrategiesAsArray = this.scoreStrategies.toArray();\n if (Object.keys(scoreStrategiesAsArray).length > 0) {\n array.score_strategies = scoreStrategiesAsArray;\n }\n }\n if (this.fuzziness !== null) {\n array.fuzziness = this.fuzziness;\n }\n /**\n * Min score\n */\n var minScore = this.minScore;\n if (minScore !== exports.NO_MIN_SCORE) {\n array.min_score = minScore;\n }\n /**\n * User\n */\n if (this.user instanceof User_1.User) {\n var userAsArray = this.user.toArray();\n if (Object.keys(userAsArray).length > 0) {\n array.user = userAsArray;\n }\n }\n /**\n * items promoted\n */\n if (this.itemsPromoted.length > 0) {\n array.items_promoted = [];\n for (var i in this.itemsPromoted) {\n array\n .items_promoted\n .push(this.itemsPromoted[i].toArray());\n }\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Query}\n */\n Query.createFromArray = function (array) {\n var query = array.coordinate instanceof Object\n ? Query.createLocated(Coordinate_1.Coordinate.createFromArray(array.coordinate), array.q ? array.q : \"\", array.page ? array.page : exports.QUERY_DEFAULT_PAGE, array.size ? array.size : exports.QUERY_DEFAULT_SIZE)\n : Query.create(array.q ? array.q : \"\", array.page ? array.page : exports.QUERY_DEFAULT_PAGE, array.size ? array.size : exports.QUERY_DEFAULT_SIZE);\n /**\n * Fields\n */\n query.fields = array.fields instanceof Array\n ? array.fields\n : [];\n /**\n * Aggregations\n */\n var aggregationsAsArray = typeof array.aggregations === typeof {}\n ? array.aggregations\n : {};\n for (var i in aggregationsAsArray) {\n query.aggregations[i] = Aggregation_1.Aggregation.createFromArray(aggregationsAsArray[i]);\n }\n /**\n * Sort\n */\n var sortAsArray = typeof array.sort === typeof {}\n ? array.sort\n : {};\n if (Object.keys(sortAsArray).length > 0) {\n query.sortByInstance = SortBy_1.SortBy.createFromArray(sortAsArray);\n }\n /**\n * Filters\n */\n var filtersAsArray = typeof array.filters === typeof {}\n ? array.filters\n : {};\n for (var i in filtersAsArray) {\n query.filters[i] = Filter_1.Filter.createFromArray(filtersAsArray[i]);\n }\n /**\n * Universe Filters\n */\n var universeFiltersAsArray = typeof array.universe_filters === typeof {}\n ? array.universe_filters\n : {};\n for (var i in universeFiltersAsArray) {\n query.universeFilters[i] = Filter_1.Filter.createFromArray(universeFiltersAsArray[i]);\n }\n /**\n * Booleans\n */\n query.resultsEnabled = typeof array.results_enabled === \"boolean\"\n ? array.results_enabled\n : true;\n query.suggestionsEnabled = typeof array.suggestions_enabled === \"boolean\"\n ? array.suggestions_enabled\n : false;\n query.aggregationsEnabled = typeof array.aggregations_enabled === \"boolean\"\n ? array.aggregations_enabled\n : true;\n query.highlightsEnabled = typeof array.highlights_enabled === \"boolean\"\n ? array.highlights_enabled\n : false;\n query.fuzziness = array.fuzziness;\n query.minScore = array.min_score ? array.min_score : exports.NO_MIN_SCORE;\n /**\n * Items promoted\n */\n var itemsPromotedAsArray = typeof array.items_promoted === typeof {}\n ? array.items_promoted\n : {};\n for (var i in itemsPromotedAsArray) {\n query\n .itemsPromoted\n .push(ItemUUID_1.ItemUUID.createFromArray(itemsPromotedAsArray[i]));\n }\n /**\n * Filter fields\n */\n query.filterFields = array.filter_fields instanceof Array\n ? array.filter_fields\n : [];\n query.scoreStrategies = array.score_strategies instanceof Object\n ? ScoreStrategies_1.ScoreStrategies.createFromArray(array.score_strategies)\n : null;\n query.user = array.user instanceof Object\n ? User_1.User.createFromArray(array.user)\n : null;\n return query;\n };\n return Query;\n}());\nexports.Query = Query;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Aggregation constants\n */\nexports.RANGE_ZERO = 0;\nexports.RANGE_INFINITE = -1;\nexports.RANGE_SEPARATOR = \"..\";\n/**\n * Filter class\n */\nvar Range = /** @class */ (function () {\n function Range() {\n }\n /**\n * Strong to array\n *\n * @param string\n *\n * @returns {[number, number]}\n */\n Range.stringToArray = function (string) {\n var parts = string.split(exports.RANGE_SEPARATOR);\n var from = parts[0];\n var to = parts[1];\n var finalFrom = exports.RANGE_ZERO;\n var finalTo = exports.RANGE_INFINITE;\n if (from != \"\") {\n finalFrom = parseInt(from);\n }\n if (to != \"\") {\n finalTo = parseInt(to);\n }\n return [finalFrom, finalTo];\n };\n /**\n * Array to string\n *\n * @param values\n *\n * @return {string}\n */\n Range.arrayToString = function (values) {\n var finalValues = [\"\", \"\"];\n if (values[0] != exports.RANGE_ZERO) {\n finalValues[0] = String(values[0]);\n }\n if (values[1] != exports.RANGE_INFINITE) {\n finalValues[1] = String(values[1]);\n }\n return finalValues.join(exports.RANGE_SEPARATOR);\n };\n /**\n * Create ranges\n *\n * @param from\n * @param to\n * @param incremental\n */\n Range.createRanges = function (from, to, incremental) {\n var ranges = [];\n var nextTo;\n while (from < to) {\n nextTo = from + incremental;\n ranges.push(from + exports.RANGE_SEPARATOR + nextTo);\n from = nextTo;\n }\n return ranges;\n };\n return Range;\n}());\nexports.Range = Range;\n","\"use strict\";\nexports.__esModule = true;\nvar ScoreStrategy_1 = require(\"./ScoreStrategy\");\n/**\n * ScoreStrategies constants\n */\nexports.MULTIPLY = 'multiply';\nexports.SUM = 'sum';\nexports.AVG = 'avg';\nexports.MAX = 'max';\nexports.MIN = 'min';\n/**\n * ScoreStrategies\n */\nvar ScoreStrategies = /** @class */ (function () {\n function ScoreStrategies() {\n this.scoreStrategies = [];\n }\n /**\n * Create empty\n *\n * @param scoreMode\n *\n * @return {ScoreStrategies}\n */\n ScoreStrategies.createEmpty = function (scoreMode) {\n if (scoreMode === void 0) { scoreMode = exports.SUM; }\n var scoreStrategies = new ScoreStrategies;\n scoreStrategies.scoreMode = scoreMode;\n return scoreStrategies;\n };\n /**\n * Add score strategy\n *\n * @param scoreStrategy\n *\n * @return {ScoreStrategies}\n */\n ScoreStrategies.prototype.addScoreStrategy = function (scoreStrategy) {\n this.scoreStrategies.push(scoreStrategy);\n return this;\n };\n /**\n * Get score strategies\n *\n * @return {ScoreStrategy[]}\n */\n ScoreStrategies.prototype.getScoreStrategies = function () {\n return this.scoreStrategies;\n };\n /**\n * Get score mode\n *\n * @return {string}\n */\n ScoreStrategies.prototype.getScoreMode = function () {\n return this.scoreMode;\n };\n /**\n * To array\n *\n * @return {{\n * score_mode: string,\n * score_strategies: any\n * }}\n */\n ScoreStrategies.prototype.toArray = function () {\n var scoreStrategiesAsArray = [];\n for (var i in this.scoreStrategies) {\n scoreStrategiesAsArray.push(this.scoreStrategies[i].toArray());\n }\n return {\n score_mode: this.scoreMode,\n score_strategies: scoreStrategiesAsArray\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {ScoreStrategies}\n */\n ScoreStrategies.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var scoreStrategies = (typeof array.score_mode != \"undefined\")\n ? ScoreStrategies.createEmpty(array.score_mode)\n : ScoreStrategies.createEmpty();\n scoreStrategies.scoreStrategies = [];\n for (var i in array.score_strategies) {\n scoreStrategies\n .scoreStrategies\n .push(ScoreStrategy_1.ScoreStrategy.createFromArray(array.score_strategies[i]));\n }\n return scoreStrategies;\n };\n return ScoreStrategies;\n}());\nexports.ScoreStrategies = ScoreStrategies;\n","\"use strict\";\nexports.__esModule = true;\nvar Item_1 = require(\"../Model/Item\");\nvar Filter_1 = require(\"./Filter\");\n/**\n * ScoreStrategy constants\n */\nexports.DEFAULT_TYPE = 'default';\nexports.DEFAULT_WEIGHT = 1.0;\nexports.BOOSTING_FIELD_VALUE = 'field_value';\nexports.CUSTOM_FUNCTION = 'custom_function';\nexports.DECAY = 'decay';\nexports.DECAY_LINEAR = 'linear';\nexports.DECAY_EXP = 'exp';\nexports.DECAY_GAUSS = 'gauss';\nexports.MODIFIER_NONE = 'none';\nexports.MODIFIER_SQRT = 'sqrt';\nexports.MODIFIER_LOG = 'log';\nexports.MODIFIER_LN = 'ln';\nexports.MODIFIER_SQUARE = 'square';\nexports.SCORE_MODE_NONE = 'none';\nexports.SCORE_MODE_SUM = 'sum';\nexports.SCORE_MODE_AVG = 'avg';\nexports.SCORE_MODE_MAX = 'max';\nexports.SCORE_MODE_MIN = 'min';\nexports.DEFAULT_MISSING = 1.0;\nexports.DEFAULT_FACTOR = 1.0;\n/**\n * ScoreStrategy\n */\nvar ScoreStrategy = /** @class */ (function () {\n function ScoreStrategy() {\n this.type = exports.DEFAULT_TYPE;\n this.filter = null;\n this.weight = exports.DEFAULT_WEIGHT;\n this.scoreMode = exports.SCORE_MODE_AVG;\n this.configuration = {};\n }\n /**\n * Get type\n *\n * @returns {string}\n */\n ScoreStrategy.prototype.getType = function () {\n return this.type;\n };\n /**\n * Get configuration value\n *\n * @returns {string}\n */\n ScoreStrategy.prototype.getConfigurationValue = function (element) {\n if (typeof this.configuration[element] == \"undefined\") {\n return null;\n }\n return this.configuration[element];\n };\n /**\n * Get weight.\n *\n * @return {number}\n */\n ScoreStrategy.prototype.getWeight = function () {\n return this.weight;\n };\n /**\n * Get score mode.\n *\n * @return {string}\n */\n ScoreStrategy.prototype.getScoreMode = function () {\n return this.scoreMode;\n };\n /**\n * Get filter.\n *\n * @return {Filter}\n */\n ScoreStrategy.prototype.getFilter = function () {\n return this.filter;\n };\n /**\n * Create default\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createDefault = function () {\n return new ScoreStrategy();\n };\n /**\n * Create field boosting\n *\n * @param field\n * @param factor\n * @param missing\n * @param modifier\n * @param weight\n * @param filter\n * @param scoreMode\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createFieldBoosting = function (field, factor, missing, modifier, weight, filter, scoreMode) {\n if (factor === void 0) { factor = exports.DEFAULT_FACTOR; }\n if (missing === void 0) { missing = exports.DEFAULT_MISSING; }\n if (modifier === void 0) { modifier = exports.MODIFIER_NONE; }\n if (weight === void 0) { weight = exports.DEFAULT_WEIGHT; }\n if (filter === void 0) { filter = null; }\n if (scoreMode === void 0) { scoreMode = exports.SCORE_MODE_AVG; }\n var scoreStrategy = ScoreStrategy.createDefault();\n scoreStrategy.type = exports.BOOSTING_FIELD_VALUE;\n scoreStrategy.configuration['field'] = field;\n scoreStrategy.configuration['factor'] = factor;\n scoreStrategy.configuration['missing'] = missing;\n scoreStrategy.configuration['modifier'] = modifier;\n scoreStrategy.weight = weight;\n scoreStrategy.filter = ScoreStrategy.fixFilterFieldPath(filter);\n scoreStrategy.scoreMode = scoreMode;\n return scoreStrategy;\n };\n /**\n * Create custom function\n *\n * @param func\n * @param weight\n * @param filter\n * @param scoreMode\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createCustomFunction = function (func, weight, filter, scoreMode) {\n if (weight === void 0) { weight = exports.DEFAULT_WEIGHT; }\n if (filter === void 0) { filter = null; }\n if (scoreMode === void 0) { scoreMode = exports.SCORE_MODE_AVG; }\n var scoreStrategy = ScoreStrategy.createDefault();\n scoreStrategy.type = exports.CUSTOM_FUNCTION;\n scoreStrategy.configuration['function'] = func;\n scoreStrategy.weight = weight;\n scoreStrategy.filter = ScoreStrategy.fixFilterFieldPath(filter);\n scoreStrategy.scoreMode = scoreMode;\n return scoreStrategy;\n };\n /**\n * Create decay function\n *\n * @param type\n * @param field\n * @param origin\n * @param scale\n * @param offset\n * @param decay\n * @param weight\n * @param filter\n * @param scoreMode\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createDecayFunction = function (type, field, origin, scale, offset, decay, weight, filter, scoreMode) {\n if (weight === void 0) { weight = exports.DEFAULT_WEIGHT; }\n if (filter === void 0) { filter = null; }\n if (scoreMode === void 0) { scoreMode = exports.SCORE_MODE_AVG; }\n var scoreStrategy = ScoreStrategy.createDefault();\n scoreStrategy.type = exports.DECAY;\n scoreStrategy.configuration['type'] = type;\n scoreStrategy.configuration['field'] = field;\n scoreStrategy.configuration['origin'] = origin;\n scoreStrategy.configuration['scale'] = scale;\n scoreStrategy.configuration['offset'] = offset;\n scoreStrategy.configuration['decay'] = decay;\n scoreStrategy.weight = weight;\n scoreStrategy.filter = ScoreStrategy.fixFilterFieldPath(filter);\n scoreStrategy.scoreMode = scoreMode;\n return scoreStrategy;\n };\n /**\n * Fix filter path.\n *\n * @param filter\n *\n * @return {Filter}\n */\n ScoreStrategy.fixFilterFieldPath = function (filter) {\n if (filter == null) {\n return filter;\n }\n var filterAsArray = filter.toArray();\n filterAsArray['field'] = Item_1.Item.getPathByField(filterAsArray['field']);\n return Filter_1.Filter.createFromArray(filterAsArray);\n };\n /**\n * To array\n *\n * @return {{\n * type: string,\n * configuration: any,\n * weight: number,\n * score_mode: string,\n * filter: any\n * }}\n */\n ScoreStrategy.prototype.toArray = function () {\n return {\n type: this.type,\n configuration: this.configuration,\n weight: this.weight,\n score_mode: this.scoreMode,\n filter: this.filter instanceof Filter_1.Filter\n ? this.filter.toArray()\n : null\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var scoreStrategy = ScoreStrategy.createDefault();\n if (typeof array.type != \"undefined\") {\n scoreStrategy.type = array.type;\n }\n if (typeof array.configuration != \"undefined\") {\n scoreStrategy.configuration = array.configuration;\n }\n if (typeof array.weight != \"undefined\") {\n scoreStrategy.weight = array.weight;\n }\n if (typeof array.score_mode != \"undefined\") {\n scoreStrategy.scoreMode = array.score_mode;\n }\n if (typeof array.filter === 'object' && array.filter !== null) {\n scoreStrategy.filter = Filter_1.Filter.createFromArray(array.filter);\n }\n return scoreStrategy;\n };\n return ScoreStrategy;\n}());\nexports.ScoreStrategy = ScoreStrategy;\n","\"use strict\";\nexports.__esModule = true;\nvar Item_1 = require(\"../Model/Item\");\n/**\n export * Sort by constants\n */\nexports.SORT_BY_TYPE_FIELD = 1;\nexports.SORT_BY_TYPE_NESTED = 2;\nexports.SORT_BY_ASC = \"asc\";\nexports.SORT_BY_DESC = \"desc\";\nexports.SORT_BY_MODE_AVG = \"avg\";\nexports.SORT_BY_MODE_SUM = \"sum\";\nexports.SORT_BY_MODE_MIN = \"min\";\nexports.SORT_BY_MODE_MAX = \"max\";\nexports.SORT_BY_MODE_MEDIAN = \"median\";\nexports.SORT_BY_SCORE = {\n _score: {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_RANDOM = {\n random: {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_AL_TUN_TUN = exports.SORT_BY_RANDOM;\nexports.SORT_BY_ID_ASC = {\n \"uuid.id\": {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_ID_DESC = {\n \"uuid.id\": {\n order: exports.SORT_BY_DESC\n }\n};\nexports.SORT_BY_TYPE_ASC = {\n \"uuid.type\": {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_TYPE_DESC = {\n \"uuid.type\": {\n order: exports.SORT_BY_DESC\n }\n};\nexports.SORT_BY_LOCATION_KM_ASC = {\n _geo_distance: {\n order: exports.SORT_BY_ASC,\n unit: \"km\"\n }\n};\nexports.SORT_BY_LOCATION_MI_ASC = {\n _geo_distance: {\n order: exports.SORT_BY_DESC,\n unit: \"mi\"\n }\n};\nvar Coordinate_1 = require(\"../Model/Coordinate\");\nvar Filter_1 = require(\"./Filter\");\n/**\n * ScoreStrategy\n */\nvar SortBy = /** @class */ (function () {\n function SortBy() {\n this.sortsBy = [];\n }\n /**\n * Create\n *\n * @return {SortBy}\n */\n SortBy.create = function () {\n return new SortBy;\n };\n /**\n * Sort By fields values\n *\n * @param shortSortByElements\n *\n * @return {SortBy}\n */\n SortBy.byFieldsValues = function (shortSortByElements) {\n var sortBy = SortBy.create();\n for (var key in shortSortByElements) {\n sortBy.byFieldValue(key, shortSortByElements[key]);\n }\n return sortBy;\n };\n /**\n * All\n *\n * @return {Array}\n */\n SortBy.prototype.all = function () {\n return this.sortsBy.length > 0\n ? this.sortsBy\n : [exports.SORT_BY_SCORE];\n };\n /**\n * Sort by value\n *\n * @param value\n *\n * @return {SortBy}\n */\n SortBy.prototype.byValue = function (value) {\n if (exports.SORT_BY_SCORE != value &&\n exports.SORT_BY_RANDOM != value) {\n if (typeof value.type == \"undefined\") {\n value.type = exports.SORT_BY_TYPE_FIELD;\n }\n }\n if (exports.SORT_BY_SCORE != value) {\n this.sortsBy.push(value);\n }\n return this;\n };\n /**\n * Sort by field value\n *\n * @param field\n * @param order\n *\n * @return {SortBy}\n */\n SortBy.prototype.byFieldValue = function (field, order) {\n var object = {\n type: exports.SORT_BY_TYPE_FIELD\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Sort by nested field\n *\n * @param field\n * @param order\n * @param mode\n *\n * @return {SortBy}\n */\n SortBy.prototype.byNestedField = function (field, order, mode) {\n if (mode === void 0) { mode = exports.SORT_BY_MODE_AVG; }\n var object = {\n type: exports.SORT_BY_TYPE_NESTED,\n mode: mode\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Sort by nested field and filter\n *\n * @param field\n * @param order\n * @param filter\n * @param mode\n *\n * @return {SortBy}\n */\n SortBy.prototype.byNestedFieldAndFilter = function (field, order, filter, mode) {\n if (mode === void 0) { mode = exports.SORT_BY_MODE_AVG; }\n var fieldPath = Item_1.Item.getPathByField(filter.getField());\n var filterAsArray = filter.toArray();\n filterAsArray.field = fieldPath;\n filter = Filter_1.Filter.createFromArray(filterAsArray);\n var object = {\n type: exports.SORT_BY_TYPE_NESTED,\n mode: mode,\n filter: filter\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Is sorted by geo distance\n *\n * @return {boolean}\n */\n SortBy.prototype.isSortedByGeoDistance = function () {\n for (var i in this.sortsBy) {\n if (typeof this.sortsBy[i]._geo_distance === typeof {}) {\n return true;\n }\n }\n return false;\n };\n /**\n * Set coordinate\n *\n * @param coordinate\n *\n * @return {SortBy}\n */\n SortBy.prototype.setCoordinate = function (coordinate) {\n for (var i in this.sortsBy) {\n if (typeof this.sortsBy[i]._geo_distance === typeof {}) {\n this.sortsBy[i]._geo_distance.coordinate = coordinate;\n }\n }\n return this;\n };\n /**\n * Has random sort\n *\n * @return {boolean}\n */\n SortBy.prototype.hasRandomSort = function () {\n for (var i in this.sortsBy) {\n if (JSON.stringify(this.sortsBy[i]) === JSON.stringify(exports.SORT_BY_RANDOM)) {\n return true;\n }\n }\n return false;\n };\n /**\n * To array\n *\n * @return {[]}\n */\n SortBy.prototype.toArray = function () {\n var copySortBy = this.copy();\n var sortsByAsArray = copySortBy.sortsBy;\n for (var i in sortsByAsArray) {\n if (sortsByAsArray[i].type == exports.SORT_BY_TYPE_FIELD) {\n delete sortsByAsArray[i].type;\n }\n if (typeof sortsByAsArray[i].filter === typeof {} &&\n sortsByAsArray[i].filter != null) {\n sortsByAsArray[i].filter = sortsByAsArray[i].filter.toArray();\n }\n if (typeof sortsByAsArray[i]._geo_distance === typeof {} &&\n sortsByAsArray[i]._geo_distance !== null &&\n sortsByAsArray[i]._geo_distance.coordinate instanceof Coordinate_1.Coordinate) {\n sortsByAsArray[i]._geo_distance.coordinate = sortsByAsArray[i]._geo_distance.coordinate.toArray();\n }\n }\n return sortsByAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {SortBy}\n */\n SortBy.createFromArray = function (array) {\n var innerArray = JSON.parse(JSON.stringify(array));\n var sortBy = SortBy.create();\n for (var i in innerArray) {\n var element = innerArray[i];\n if (JSON.stringify(element) !== JSON.stringify(exports.SORT_BY_RANDOM) &&\n JSON.stringify(element) !== JSON.stringify(exports.SORT_BY_SCORE)) {\n if (typeof element.type == \"undefined\") {\n element.type = exports.SORT_BY_TYPE_FIELD;\n }\n }\n if (typeof element.filter === typeof {} &&\n element.filter != null) {\n element.filter = Filter_1.Filter.createFromArray(element.filter);\n }\n if (typeof element._geo_distance === typeof {} &&\n element._geo_distance != null &&\n typeof element._geo_distance.coordinate === typeof {}) {\n element._geo_distance.coordinate = Coordinate_1.Coordinate.createFromArray(element._geo_distance.coordinate);\n }\n sortBy.sortsBy.push(element);\n }\n return sortBy;\n };\n /**\n * Make a copy of this\n *\n * @returns {SortBy}\n */\n SortBy.prototype.copy = function () {\n var newSortBy = SortBy.create();\n for (var i in this.sortsBy) {\n var sortBy = this.sortsBy[i];\n var sortByAsArray = JSON.parse(JSON.stringify(sortBy));\n if (typeof sortBy.filter === typeof {} &&\n sortBy.filter != null) {\n sortByAsArray.filter = Filter_1.Filter.createFromArray(sortBy.filter.toArray());\n }\n if (typeof sortBy._geo_distance === typeof {} &&\n sortBy._geo_distance != null &&\n typeof sortBy._geo_distance.coordinate == typeof {}) {\n sortByAsArray._geo_distance.coordinate = Coordinate_1.Coordinate.createFromArray(sortBy._geo_distance.coordinate.toArray());\n }\n newSortBy.sortsBy.push(sortByAsArray);\n }\n return newSortBy;\n };\n return SortBy;\n}());\nexports.SortBy = SortBy;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ConnectionError_1 = require(\"../Error/ConnectionError\");\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar InvalidTokenError_1 = require(\"../Error/InvalidTokenError\");\nvar ResourceExistsError_1 = require(\"../Error/ResourceExistsError\");\nvar ResourceNotAvailableError_1 = require(\"../Error/ResourceNotAvailableError\");\nvar Item_1 = require(\"../Model/Item\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\nvar Result_1 = require(\"../Result/Result\");\nvar Repository_1 = require(\"./Repository\");\nvar Index_1 = require(\"../Model/Index\");\n/**\n * Aggregation class\n */\nvar HttpRepository = /** @class */ (function (_super) {\n tslib_1.__extends(HttpRepository, _super);\n /**\n * Constructor\n *\n * @param httpClient\n * @param appId\n * @param indexId\n * @param token\n * @param transformer\n */\n function HttpRepository(httpClient, appId, indexId, token, transformer) {\n var _this = _super.call(this, appId, indexId, token) || this;\n _this.httpClient = httpClient;\n _this.transformer = transformer;\n return _this;\n }\n /**\n * Get transformer\n *\n * @return {Transformer}\n */\n HttpRepository.prototype.getTransformer = function () {\n return this.transformer;\n };\n /**\n * Generate item document by a simple object.\n *\n * @param object\n */\n HttpRepository.prototype.addObject = function (object) {\n var item = this\n .transformer\n .toItem(object);\n if (item instanceof Item_1.Item) {\n this.addItem(item);\n }\n };\n /**\n * Delete item document by uuid.\n *\n * @param object\n */\n HttpRepository.prototype.deleteObject = function (object) {\n var itemUUID = this\n .transformer\n .toItemUUID(object);\n if (itemUUID instanceof ItemUUID_1.ItemUUID) {\n this.deleteItem(itemUUID);\n }\n };\n /**\n * Flush update items\n *\n * @param itemsToUpdate\n *\n * @return {Promise}\n */\n HttpRepository.prototype.flushUpdateItems = function (itemsToUpdate) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n if (itemsToUpdate.length === 0) {\n return [2 /*return*/];\n }\n return [2 /*return*/, this\n .httpClient\n .get(\"/items\", \"post\", this.getCredentialsWithIndex(this.indexId), {}, {\n items: itemsToUpdate.map(function (item) {\n return item.toArray();\n })\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n })];\n });\n });\n };\n /**\n * Flush delete items\n *\n * @param itemsToDelete\n *\n * @return {Promise}\n */\n HttpRepository.prototype.flushDeleteItems = function (itemsToDelete) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n if (itemsToDelete.length === 0) {\n return [2 /*return*/];\n }\n return [2 /*return*/, this\n .httpClient\n .get(\"/items\", \"delete\", this.getCredentialsWithIndex(this.indexId), {}, {\n items: itemsToDelete.map(function (itemUUID) {\n return itemUUID.toArray();\n })\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n })];\n });\n });\n };\n /**\n * Query\n *\n * @param query\n *\n * @return {Promise}\n */\n HttpRepository.prototype.query = function (query) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n var that;\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n that = this;\n return [4 /*yield*/, this\n .httpClient\n .get(\"/\", \"get\", this.getCredentialsWithIndex(this.indexId), {\n query: JSON.stringify(query.toArray())\n }, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n var result = Result_1.Result.createFromArray(response.getBody());\n return Result_1.Result.create(result.getQuery(), result.getTotalItems(), result.getTotalHits(), result.getAggregations(), result.getSuggests(), that\n .transformer\n .fromItems(result.getItems()));\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update items\n *\n * @param query\n * @param changes\n *\n * @return {Promise}\n */\n HttpRepository.prototype.updateItems = function (query, changes) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/items\", \"put\", this.getCredentialsWithIndex(this.indexId), {}, {\n query: query.toArray(),\n changes: changes.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create index\n *\n * @param indexUUID\n * @param config\n *\n * @return {Promise}\n */\n HttpRepository.prototype.createIndex = function (indexUUID, config) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"put\", this.getCredentials(), {}, {\n index: indexUUID.toArray(),\n config: config.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete index\n *\n * @param indexUUID\n *\n * @return {Promise}\n */\n HttpRepository.prototype.deleteIndex = function (indexUUID) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"delete\", this.getCredentialsWithIndex(this.indexId), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Reset index\n *\n * @param indexUUID\n *\n * @return {Promise}\n */\n HttpRepository.prototype.resetIndex = function (indexUUID) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index/reset\", \"post\", this.getCredentialsWithIndex(this.indexId), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Check index\n *\n * @param indexUUID\n *\n * @return {Promise}\n */\n HttpRepository.prototype.checkIndex = function (indexUUID) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"head\", this.getCredentialsWithIndex(this.indexId), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return response.getCode() === 200;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Check index\n *\n * @return {Promise}\n */\n HttpRepository.prototype.getIndices = function () {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/indices\", \"get\", this.getCredentials(), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n var result = [];\n for (var _i = 0, _a = response.getBody(); _i < _a.length; _i++) {\n var indexAsArray = _a[_i];\n result.push(Index_1.Index.createFromArray(indexAsArray));\n }\n return result;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Configure index\n *\n * @param indexUUID\n * @param config\n *\n * @return {Promise}\n */\n HttpRepository.prototype.configureIndex = function (indexUUID, config) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"post\", this.getCredentialsWithIndex(this.indexId), {}, {\n config: config.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get query values\n *\n * @returns any\n */\n HttpRepository.prototype.getCredentials = function () {\n return {\n app_id: this.appId,\n token: this.token\n };\n };\n /**\n * Get query values\n *\n * @param indexComposedUUID\n *\n * @returns any\n */\n HttpRepository.prototype.getCredentialsWithIndex = function (indexComposedUUID) {\n return {\n app_id: this.appId,\n index: indexComposedUUID,\n token: this.token\n };\n };\n /**\n * throw error if needed\n *\n * @param response\n */\n HttpRepository.throwTransportableExceptionIfNeeded = function (response) {\n if (typeof response.getCode() == \"undefined\") {\n return;\n }\n switch (response.getCode()) {\n case ResourceNotAvailableError_1.ResourceNotAvailableError.getTransportableHTTPError():\n throw new ResourceNotAvailableError_1.ResourceNotAvailableError(response.getBody().message);\n case InvalidTokenError_1.InvalidTokenError.getTransportableHTTPError():\n throw new InvalidTokenError_1.InvalidTokenError(response.getBody().message);\n case InvalidFormatError_1.InvalidFormatError.getTransportableHTTPError():\n throw new InvalidFormatError_1.InvalidFormatError(response.getBody().message);\n case ResourceExistsError_1.ResourceExistsError.getTransportableHTTPError():\n throw new ResourceExistsError_1.ResourceExistsError(response.getBody().message);\n case ConnectionError_1.ConnectionError.getTransportableHTTPError():\n throw new ConnectionError_1.ConnectionError(response.getBody().message);\n }\n };\n return HttpRepository;\n}(Repository_1.Repository));\nexports.HttpRepository = HttpRepository;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\n/**\n * Aggregation class\n */\nvar Repository = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param appId\n * @param indexId\n * @param token\n */\n function Repository(appId, indexId, token) {\n this.itemsToUpdate = [];\n this.itemsToDelete = [];\n this.appId = appId;\n this.indexId = indexId;\n this.token = token;\n }\n /**\n * Reset cached elements\n */\n Repository.prototype.resetCachedElements = function () {\n this.itemsToUpdate = [];\n this.itemsToDelete = [];\n };\n /**\n * Add element\n *\n * @param item\n */\n Repository.prototype.addItem = function (item) {\n this.itemsToUpdate.push(item);\n };\n /**\n * Add elements\n *\n * @param items\n */\n Repository.prototype.addItems = function (items) {\n for (var i in items) {\n this.addItem(items[i]);\n }\n };\n /**\n * Delete item\n *\n * @param itemUUID\n */\n Repository.prototype.deleteItem = function (itemUUID) {\n this.itemsToDelete.push(itemUUID);\n };\n /**\n * Delete items\n *\n * @param itemsUUID\n */\n Repository.prototype.deleteItems = function (itemsUUID) {\n for (var i in itemsUUID) {\n this.deleteItem(itemsUUID[i]);\n }\n };\n /**\n * flush\n *\n * @param bulkNumber\n * @param skipIfLess\n *\n * @return {Promise}\n */\n Repository.prototype.flush = function (bulkNumber, skipIfLess) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n var _this = this;\n return tslib_1.__generator(this, function (_a) {\n if (!bulkNumber) {\n bulkNumber = 500;\n }\n if (!skipIfLess) {\n skipIfLess = false;\n }\n if (skipIfLess &&\n this.itemsToUpdate.length < bulkNumber) {\n return [2 /*return*/];\n }\n return [2 /*return*/, Promise.all(Repository\n .chunkArray(this.itemsToUpdate, bulkNumber)\n .map(function (arrayOfItems) {\n return _this.flushUpdateItems(arrayOfItems);\n })\n .concat(Repository\n .chunkArray(this.itemsToDelete, bulkNumber)\n .map(function (arrayOfItemsUUID) {\n return _this.flushDeleteItems(arrayOfItemsUUID);\n }))).then(function (_) {\n _this.resetCachedElements();\n })[\"catch\"](function (_) {\n _this.resetCachedElements();\n })];\n });\n });\n };\n /**\n * Make chunks of n elements\n *\n * @param array\n * @param chunk\n *\n * @return any[]\n */\n Repository.chunkArray = function (array, chunk) {\n var arrayChunked = [];\n for (var i = 0, j = array.length; i < j; i += chunk) {\n arrayChunked.push(array.slice(i, i + chunk));\n }\n return arrayChunked;\n };\n return Repository;\n}());\nexports.Repository = Repository;\n","\"use strict\";\nexports.__esModule = true;\nvar Metadata_1 = require(\"../Model/Metadata\");\n/**\n * Aggregation class\n */\nvar Counter = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param values\n * @param used\n * @param n\n */\n function Counter(values, used, n) {\n this.values = values;\n this.used = used;\n this.n = n;\n }\n /**\n * Get id\n *\n * @return {string|null}\n */\n Counter.prototype.getId = function () {\n return typeof this.values.id == \"string\"\n ? this.values.id\n : null;\n };\n /**\n * Get name\n *\n * @return {string|null}\n */\n Counter.prototype.getName = function () {\n return typeof this.values.name == \"string\"\n ? this.values.name\n : null;\n };\n /**\n * Get slug\n *\n * @return {string|null}\n */\n Counter.prototype.getSlug = function () {\n return typeof this.values.slug == \"string\"\n ? this.values.slug\n : null;\n };\n /**\n * Get level\n *\n * @return {number}\n */\n Counter.prototype.getLevel = function () {\n return typeof this.values.level == \"number\"\n ? this.values.level\n : 0;\n };\n /**\n * Get values\n *\n * @returns {{}}\n */\n Counter.prototype.getValues = function () {\n return this.values;\n };\n /**\n * Is used\n *\n * @returns {boolean}\n */\n Counter.prototype.isUsed = function () {\n return this.used;\n };\n /**\n * Get N\n *\n * @returns {number}\n */\n Counter.prototype.getN = function () {\n return this.n;\n };\n /**\n * Create by active elements\n *\n * @param name\n * @param n\n * @param activeElements\n */\n Counter.createByActiveElements = function (name, n, activeElements) {\n var values = Metadata_1.Metadata.fromMetadata(name);\n if (values == null) {\n return null;\n }\n var i = activeElements.length;\n var inActiveElements = false;\n while (i--) {\n if (activeElements[i] == values.id) {\n inActiveElements = true;\n }\n }\n return new Counter(values, inActiveElements, n);\n };\n /**\n * To array\n *\n * @return {{}}\n */\n Counter.prototype.toArray = function () {\n var values = {\n values: this.values,\n n: this.n\n };\n if (this.used === true) {\n values.used = true;\n }\n return values;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Counter}\n */\n Counter.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new Counter(array.values, (typeof array.used == \"boolean\")\n ? array.used\n : false, array.n);\n };\n return Counter;\n}());\nexports.Counter = Counter;\n","\"use strict\";\nexports.__esModule = true;\nvar Item_1 = require(\"../Model/Item\");\nvar Query_1 = require(\"../Query/Query\");\nvar ResultAggregations_1 = require(\"./ResultAggregations\");\n/**\n * Result class\n */\nvar Result = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param query\n * @param totalItems\n * @param totalHits\n */\n function Result(query, totalItems, totalHits) {\n this.items = [];\n this.suggests = [];\n this.query = query;\n this.totalItems = totalItems;\n this.totalHits = totalHits;\n }\n /**\n * Create\n *\n * @param query\n * @param totalItems\n * @param totalHits\n * @param aggregations\n * @param suggests\n * @param items\n *\n * @returns {Result}\n */\n Result.create = function (query, totalItems, totalHits, aggregations, suggests, items) {\n var result = new Result(query, totalItems, totalHits);\n result.aggregations = aggregations;\n result.suggests = suggests;\n result.items = items;\n return result;\n };\n /**\n * Add item\n *\n * @param item\n */\n Result.prototype.addItem = function (item) {\n this.items.push(item);\n };\n /**\n * Get items\n *\n * @return {Item[]}\n */\n Result.prototype.getItems = function () {\n return this.items;\n };\n /**\n * Get items grouped by types\n *\n * @return {any[]}\n */\n Result.prototype.getItemsGroupedByTypes = function () {\n if (this.itemsGroupedByTypeCache instanceof Object &&\n Object.keys(this.itemsGroupedByTypeCache).length > 0) {\n return this.itemsGroupedByTypeCache;\n }\n var itemsGroupedByTypes = {};\n for (var i in this.items) {\n var item = this.items[i];\n if (!(itemsGroupedByTypes[item.getType()] instanceof Array)) {\n itemsGroupedByTypes[item.getType()] = [];\n }\n itemsGroupedByTypes[item.getType()].push(item);\n }\n this.itemsGroupedByTypeCache = itemsGroupedByTypes;\n return itemsGroupedByTypes;\n };\n /**\n * Get items by type\n *\n * @param type\n *\n * @return {Array}\n */\n Result.prototype.getItemsByType = function (type) {\n var itemsGroupedByTypes = this.getItemsGroupedByTypes();\n return itemsGroupedByTypes[type] == null\n ? []\n : itemsGroupedByTypes[type];\n };\n /**\n * Get items by types\n *\n * @param types\n */\n Result.prototype.getItemsByTypes = function (types) {\n return this.items.filter(function (item) { return types.indexOf(item.getType()) >= 0; });\n };\n /**\n * Get first item\n *\n * @return {Item}\n */\n Result.prototype.getFirstItem = function () {\n return this.items.length > 0\n ? this.items[0]\n : null;\n };\n /**\n * Set aggregations\n *\n * @param aggregations\n */\n Result.prototype.setAggregations = function (aggregations) {\n this.aggregations = aggregations;\n };\n /**\n * Get aggregations\n *\n * @return {ResultAggregations}\n */\n Result.prototype.getAggregations = function () {\n return this.aggregations instanceof ResultAggregations_1.ResultAggregations\n ? this.aggregations\n : null;\n };\n /**\n * Get aggregation\n *\n * @param name\n *\n * @return {null}\n */\n Result.prototype.getAggregation = function (name) {\n return this.aggregations == null\n ? null\n : this.aggregations.getAggregation(name);\n };\n /**\n * Has no empty aggregation\n *\n * @param name\n *\n * @return {boolean}\n */\n Result.prototype.hasNotEmptyAggregation = function (name) {\n return this.aggregations == null\n ? false\n : this.aggregations.hasNotEmptyAggregation(name);\n };\n /**\n * Add suggest\n *\n * @param suggest\n */\n Result.prototype.addSuggest = function (suggest) {\n this.suggests.push(suggest);\n };\n /**\n * Get suggests\n *\n * @return {string[]}\n */\n Result.prototype.getSuggests = function () {\n return this.suggests;\n };\n /**\n * Get query\n *\n * @return {Query}\n */\n Result.prototype.getQuery = function () {\n return this.query;\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n Result.prototype.getTotalItems = function () {\n return this.totalItems;\n };\n /**\n * Get total hits\n *\n * @return {number}\n */\n Result.prototype.getTotalHits = function () {\n return this.totalHits;\n };\n /**\n * to array\n *\n * @return {{query: any, total_items: number, total_hits: number, items:any[], aggregations: any, suggests: string[]}}\n */\n Result.prototype.toArray = function () {\n return {\n query: this.query.toArray(),\n total_items: this.totalItems,\n total_hits: this.totalHits,\n items: this.items.map(function (item) { return item.toArray(); }),\n aggregations: this.aggregations == null\n ? null\n : this.aggregations.toArray(),\n suggests: this.suggests\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Result}\n */\n Result.createFromArray = function (array) {\n return Result.create(Query_1.Query.createFromArray(array.query), array.total_items\n ? array.total_items\n : 0, array.total_hits\n ? array.total_hits\n : 0, array.aggregations instanceof Object\n ? ResultAggregations_1.ResultAggregations.createFromArray(array.aggregations)\n : null, array.suggests\n ? array.suggests\n : null, array.items instanceof Array\n ? array.items.map(function (itemAsArray) { return Item_1.Item.createFromArray(itemAsArray); })\n : []);\n };\n return Result;\n}());\nexports.Result = Result;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar Filter_1 = require(\"../Query/Filter\");\nvar Counter_1 = require(\"./Counter\");\n/**\n * ResultAggregation class\n */\nvar ResultAggregation = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param name\n * @param applicationType\n * @param totalElements\n * @param activeElements\n */\n function ResultAggregation(name, applicationType, totalElements, activeElements) {\n this.counters = {};\n this.highestActiveElement = 0;\n this.name = name;\n this.applicationType = applicationType;\n this.totalElements = totalElements;\n this.activeElements = {};\n for (var i in activeElements) {\n var activeElement = activeElements[i];\n this.activeElements[activeElement] = activeElement;\n }\n }\n /**\n * Add counter\n *\n * @param name\n * @param counter\n */\n ResultAggregation.prototype.addCounter = function (name, counter) {\n if (counter == 0) {\n return;\n }\n var counterInstance = Counter_1.Counter.createByActiveElements(name, counter, Object.keys(this.activeElements));\n if (!(counterInstance instanceof Counter_1.Counter)) {\n return;\n }\n if ((this.applicationType & Filter_1.FILTER_MUST_ALL_WITH_LEVELS) &&\n (this.applicationType & ~Filter_1.FILTER_MUST_ALL) &&\n counterInstance.isUsed()) {\n this.activeElements[counterInstance.getId()] = counterInstance;\n this.highestActiveElement = Math.max(counterInstance.getLevel(), this.highestActiveElement);\n return;\n }\n this.counters[counterInstance.getId()] = counterInstance;\n };\n /**\n * Get name\n *\n * @return {string}\n */\n ResultAggregation.prototype.getName = function () {\n return this.name;\n };\n /**\n * Get counter\n *\n * @return {any}\n */\n ResultAggregation.prototype.getCounters = function () {\n return this.counters;\n };\n /**\n * Return if the aggregation belongs to a filter.\n *\n * @return {boolean}\n */\n ResultAggregation.prototype.isFilter = function () {\n return (this.applicationType & Filter_1.FILTER_MUST_ALL) > 0;\n };\n /**\n * Aggregation has levels.\n *\n * @return {boolean}\n */\n ResultAggregation.prototype.hasLevels = function () {\n return (this.applicationType & Filter_1.FILTER_MUST_ALL_WITH_LEVELS) > 0;\n };\n /**\n * Get counter by name\n *\n * @param name\n *\n * @return {null}\n */\n ResultAggregation.prototype.getCounter = function (name) {\n return this.counters[name] instanceof Counter_1.Counter\n ? this.counters[name]\n : null;\n };\n /**\n * Get all elements\n *\n * @return {{}}\n */\n ResultAggregation.prototype.getAllElements = function () {\n return tslib_1.__assign({}, this.activeElements, this.counters);\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n ResultAggregation.prototype.getTotalElements = function () {\n return this.totalElements;\n };\n /**\n * Get active elements\n *\n * @return {any}\n */\n ResultAggregation.prototype.getActiveElements = function () {\n if (Object.keys(this.activeElements).length === 0) {\n return {};\n }\n if (this.applicationType === Filter_1.FILTER_MUST_ALL_WITH_LEVELS) {\n var value = null;\n for (var i in this.activeElements) {\n var activeElement = this.activeElements[i];\n if (!(activeElement instanceof Counter_1.Counter)) {\n continue;\n }\n if (value == null) {\n value = activeElement;\n }\n value = value.getLevel() > activeElement.getLevel()\n ? value\n : activeElement;\n }\n return value instanceof Counter_1.Counter\n ? { 0: value }\n : null;\n }\n return this.activeElements;\n };\n /**\n * Clean results by level and remove all levels higher than the lowest.\n */\n ResultAggregation.prototype.cleanCountersByLevel = function () {\n for (var i in this.counters) {\n var counter = this.counters[i];\n if (counter.getLevel() !== this.highestActiveElement + 1) {\n delete this.counters[i];\n }\n }\n };\n /**\n * Is empty\n *\n * @returns {boolean}\n */\n ResultAggregation.prototype.isEmpty = function () {\n return Object.keys(this.activeElements).length == 0 &&\n Object.keys(this.counters).length == 0;\n };\n /**\n * To array\n *\n * @return {any}\n */\n ResultAggregation.prototype.toArray = function () {\n var array = {\n name: this.name,\n counters: [],\n active_elements: []\n };\n for (var i in this.counters) {\n array.counters.push(this.counters[i].toArray());\n }\n if (this.applicationType !== Filter_1.FILTER_AT_LEAST_ONE) {\n array.application_type = this.applicationType;\n }\n if (this.totalElements > 0) {\n array.total_elements = this.totalElements;\n }\n for (var i in this.activeElements) {\n var activeElement = this.activeElements[i];\n array.active_elements.push(activeElement instanceof Counter_1.Counter\n ? activeElement.toArray()\n : activeElement);\n }\n if (this.highestActiveElement > 0) {\n array.highest_active_level = this.highestActiveElement;\n }\n if (array.counters.length === 0) {\n delete array.counters;\n }\n if (array.active_elements.length === 0) {\n delete array.active_elements;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n */\n ResultAggregation.createFromArray = function (array) {\n var activeElements = [];\n var activeElementsAsArray = array.active_elements;\n activeElementsAsArray = typeof activeElementsAsArray === typeof []\n ? activeElementsAsArray\n : [];\n for (var i in activeElementsAsArray) {\n var activeElementAsArray = activeElementsAsArray[i];\n activeElements.push(typeof activeElementAsArray === typeof {}\n ? Counter_1.Counter.createFromArray(activeElementAsArray)\n : activeElementAsArray);\n }\n var aggregation = new ResultAggregation(array.name, parseInt(array.application_type ? array.application_type : Filter_1.FILTER_AT_LEAST_ONE), parseInt(array.total_elements ? array.total_elements : 0), []);\n aggregation.activeElements = activeElements;\n var countersAsArray = typeof array.counters === typeof []\n ? array.counters\n : [];\n for (var i in countersAsArray) {\n var counterAsArray = countersAsArray[i];\n var counter = Counter_1.Counter.createFromArray(counterAsArray);\n aggregation.counters[counter.getId()] = counter;\n }\n aggregation.highestActiveElement = typeof array.highest_active_level === \"number\"\n ? array.highest_active_level\n : 0;\n return aggregation;\n };\n return ResultAggregation;\n}());\nexports.ResultAggregation = ResultAggregation;\n","\"use strict\";\nexports.__esModule = true;\nvar ResultAggregation_1 = require(\"./ResultAggregation\");\n/**\n * ResultAggregation class\n */\nvar ResultAggregations = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param totalElements\n */\n function ResultAggregations(totalElements) {\n this.aggregations = {};\n this.totalElements = totalElements;\n }\n /**\n * Add aggregation\n *\n * @param name\n * @param aggregation\n */\n ResultAggregations.prototype.addAggregation = function (name, aggregation) {\n this.aggregations[name] = aggregation;\n };\n /**\n * Get aggregations\n *\n * @returns {{}}\n */\n ResultAggregations.prototype.getAggregations = function () {\n return this.aggregations;\n };\n /**\n * Get aggregation\n *\n * @param name\n *\n * @returns {Aggregation|null}\n */\n ResultAggregations.prototype.getAggregation = function (name) {\n return this.aggregations[name] instanceof ResultAggregation_1.ResultAggregation\n ? this.aggregations[name]\n : null;\n };\n /**\n * Has not empty aggregation\n *\n * @param name\n *\n * @returns {boolean}\n */\n ResultAggregations.prototype.hasNotEmptyAggregation = function (name) {\n var aggregation = this.getAggregation(name);\n return (aggregation instanceof ResultAggregation_1.ResultAggregation) &&\n (!aggregation.isEmpty());\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n ResultAggregations.prototype.getTotalElements = function () {\n return this.totalElements;\n };\n /**\n * To array\n *\n * @return {{total_elements?: number, aggregations?: {}}}\n */\n ResultAggregations.prototype.toArray = function () {\n var aggregationCollection = {};\n for (var i in this.aggregations) {\n aggregationCollection[i] = this.aggregations[i].toArray();\n }\n var array = {};\n if (this.totalElements > 0) {\n array.total_elements = this.totalElements;\n }\n if (Object.keys(aggregationCollection).length > 0) {\n array.aggregations = aggregationCollection;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {ResultAggregations}\n */\n ResultAggregations.createFromArray = function (array) {\n var aggregations = new ResultAggregations(typeof array.total_elements === \"number\"\n ? array.total_elements\n : 0);\n if (typeof array.aggregations === typeof {}) {\n for (var i in array.aggregations) {\n aggregations.addAggregation(i, ResultAggregation_1.ResultAggregation.createFromArray(array.aggregations[i]));\n }\n }\n return aggregations;\n };\n return ResultAggregations;\n}());\nexports.ResultAggregations = ResultAggregations;\n","\"use strict\";\nexports.__esModule = true;\nvar Item_1 = require(\"../Model/Item\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\n/**\n * Transformer\n */\nvar Transformer = /** @class */ (function () {\n function Transformer() {\n this.readTransformers = [];\n this.writeTransformers = [];\n }\n /**\n * Add read transformer\n *\n * @param readTransformer\n */\n Transformer.prototype.addReadTransformer = function (readTransformer) {\n this\n .readTransformers\n .push(readTransformer);\n };\n /**\n * Add write transformer\n *\n * @param writeTransformer\n */\n Transformer.prototype.addWriteTransformer = function (writeTransformer) {\n this\n .writeTransformers\n .push(writeTransformer);\n };\n /**\n * Items to objects\n *\n * @param items\n *\n * @returns {any[]}\n */\n Transformer.prototype.fromItems = function (items) {\n var objects = [];\n for (var i in items) {\n objects.push(this.fromItem(items[i]));\n }\n return objects;\n };\n /**\n * Item to object\n *\n * @param item\n *\n * @returns {any}\n */\n Transformer.prototype.fromItem = function (item) {\n for (var i in this.readTransformers) {\n var transformer = this.readTransformers[i];\n if (transformer.isValidItem(item)) {\n return transformer.fromItem(item);\n }\n }\n return item;\n };\n /**\n * Objects to items\n *\n * @param objects\n *\n * @returns {Item[]}\n */\n Transformer.prototype.toItems = function (objects) {\n var items = [];\n for (var i in objects) {\n var item = this.toItem(objects[i]);\n if (item instanceof Item_1.Item) {\n items.push(item);\n }\n }\n return items;\n };\n /**\n * Object to item\n *\n * @param object\n *\n * @returns {any}\n */\n Transformer.prototype.toItem = function (object) {\n for (var i in this.writeTransformers) {\n var transformer = this.writeTransformers[i];\n if (transformer.isValidObject(object)) {\n return transformer.toItem(object);\n }\n }\n return object;\n };\n /**\n * Objects to items\n *\n * @param objects\n *\n * @returns {ItemUUID[]}\n */\n Transformer.prototype.toItemUUIDs = function (objects) {\n var itemUUIDs = [];\n for (var i in objects) {\n var itemUUID = this.toItemUUID(objects[i]);\n if (itemUUID instanceof ItemUUID_1.ItemUUID) {\n itemUUIDs.push(itemUUID);\n }\n }\n return itemUUIDs;\n };\n /**\n * Object to item\n *\n * @param object\n *\n * @returns {any}\n */\n Transformer.prototype.toItemUUID = function (object) {\n for (var i in this.writeTransformers) {\n var transformer = this.writeTransformers[i];\n if (transformer.isValidObject(object)) {\n return transformer.toItemUUID(object);\n }\n }\n return object;\n };\n return Transformer;\n}());\nexports.Transformer = Transformer;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar Apisearch_1 = require(\"./Apisearch\");\nexports[\"default\"] = Apisearch_1[\"default\"];\ntslib_1.__exportStar(require(\"./Cache/InMemoryCache\"), exports);\ntslib_1.__exportStar(require(\"./Config/Config\"), exports);\ntslib_1.__exportStar(require(\"./Config/Synonym\"), exports);\ntslib_1.__exportStar(require(\"./Error/ConnectionError\"), exports);\ntslib_1.__exportStar(require(\"./Error/ErrorWithMessage\"), exports);\ntslib_1.__exportStar(require(\"./Error/EventError\"), exports);\ntslib_1.__exportStar(require(\"./Error/ForbiddenError\"), exports);\ntslib_1.__exportStar(require(\"./Error/InvalidFormatError\"), exports);\ntslib_1.__exportStar(require(\"./Error/InvalidTokenError\"), exports);\ntslib_1.__exportStar(require(\"./Error/ResourceExistsError\"), exports);\ntslib_1.__exportStar(require(\"./Error/ResourceNotAvailableError\"), exports);\ntslib_1.__exportStar(require(\"./Error/UnsupportedContentTypeError\"), exports);\ntslib_1.__exportStar(require(\"./Geo/LocationRange\"), exports);\ntslib_1.__exportStar(require(\"./Http/AxiosClient\"), exports);\ntslib_1.__exportStar(require(\"./Http/Client\"), exports);\ntslib_1.__exportStar(require(\"./Http/HttpClient\"), exports);\ntslib_1.__exportStar(require(\"./Http/Response\"), exports);\ntslib_1.__exportStar(require(\"./Http/Retry\"), exports);\ntslib_1.__exportStar(require(\"./Http/RetryMap\"), exports);\ntslib_1.__exportStar(require(\"./Model/Changes\"), exports);\ntslib_1.__exportStar(require(\"./Model/Coordinate\"), exports);\ntslib_1.__exportStar(require(\"./Model/Item\"), exports);\ntslib_1.__exportStar(require(\"./Model/ItemUUID\"), exports);\ntslib_1.__exportStar(require(\"./Model/Metadata\"), exports);\ntslib_1.__exportStar(require(\"./Model/User\"), exports);\ntslib_1.__exportStar(require(\"./Query/Aggregation\"), exports);\ntslib_1.__exportStar(require(\"./Query/Filter\"), exports);\ntslib_1.__exportStar(require(\"./Query/Query\"), exports);\ntslib_1.__exportStar(require(\"./Query/Range\"), exports);\ntslib_1.__exportStar(require(\"./Query/ScoreStrategies\"), exports);\ntslib_1.__exportStar(require(\"./Query/ScoreStrategy\"), exports);\ntslib_1.__exportStar(require(\"./Query/SortBy\"), exports);\ntslib_1.__exportStar(require(\"./Repository/HttpRepository\"), exports);\ntslib_1.__exportStar(require(\"./Repository/Repository\"), exports);\ntslib_1.__exportStar(require(\"./Result/ResultAggregation\"), exports);\ntslib_1.__exportStar(require(\"./Result/ResultAggregations\"), exports);\ntslib_1.__exportStar(require(\"./Result/Counter\"), exports);\ntslib_1.__exportStar(require(\"./Result/Result\"), exports);\ntslib_1.__exportStar(require(\"./Transformer/Transformer\"), exports);\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/apisearch.min.js b/dist/apisearch.min.js index e78212c..1a2a376 100644 --- a/dist/apisearch.min.js +++ b/dist/apisearch.min.js @@ -1,4 +1,4 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.apisearch=e():t.apisearch=e()}(window,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=37)}([function(t,e,r){"use strict";r.r(e),r.d(e,"__extends",function(){return o}),r.d(e,"__assign",function(){return i}),r.d(e,"__rest",function(){return s}),r.d(e,"__decorate",function(){return a}),r.d(e,"__param",function(){return u}),r.d(e,"__metadata",function(){return c}),r.d(e,"__awaiter",function(){return f}),r.d(e,"__generator",function(){return l}),r.d(e,"__exportStar",function(){return p}),r.d(e,"__values",function(){return d}),r.d(e,"__read",function(){return h}),r.d(e,"__spread",function(){return y}),r.d(e,"__await",function(){return g}),r.d(e,"__asyncGenerator",function(){return _}),r.d(e,"__asyncDelegator",function(){return m}),r.d(e,"__asyncValues",function(){return v}),r.d(e,"__makeTemplateObject",function(){return E}),r.d(e,"__importStar",function(){return T}),r.d(e,"__importDefault",function(){return A}); +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.apisearch=e():t.apisearch=e()}(window,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=38)}([function(t,e,r){"use strict";r.r(e),r.d(e,"__extends",function(){return o}),r.d(e,"__assign",function(){return i}),r.d(e,"__rest",function(){return s}),r.d(e,"__decorate",function(){return a}),r.d(e,"__param",function(){return u}),r.d(e,"__metadata",function(){return c}),r.d(e,"__awaiter",function(){return f}),r.d(e,"__generator",function(){return l}),r.d(e,"__exportStar",function(){return d}),r.d(e,"__values",function(){return p}),r.d(e,"__read",function(){return h}),r.d(e,"__spread",function(){return g}),r.d(e,"__await",function(){return y}),r.d(e,"__asyncGenerator",function(){return _}),r.d(e,"__asyncDelegator",function(){return m}),r.d(e,"__asyncValues",function(){return v}),r.d(e,"__makeTemplateObject",function(){return E}),r.d(e,"__importStar",function(){return T}),r.d(e,"__importDefault",function(){return A}); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use @@ -13,12 +13,12 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function o(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var i=function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function u(t,e){return function(r,n){e(r,n,t)}}function c(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function f(t,e,r,n){return new(r||(r=Promise))(function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){t.done?o(t.value):new r(function(e){e(t.value)}).then(s,a)}u((n=n.apply(t,e||[])).next())})}function l(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function h(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function y(){for(var t=[],e=0;e1||a(t,e)})})}function a(t,e){try{!function(t){t.value instanceof g?Promise.resolve(t.value.v).then(u,c):f(i[0][2],t)}(o[t](e))}catch(t){f(i[0][3],t)}}function u(t){a("next",t)}function c(t){a("throw",t)}function f(t,e){t(e),i.shift(),i.length&&a(i[0][0],i[0][1])}}function m(t){var e,r;return e={},n("next"),n("throw",function(t){throw t}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(n,o){e[n]=t[n]?function(e){return(r=!r)?{value:g(t[n](e)),done:"return"===n}:o?o(e):e}:o}}function v(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=d(t),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=t[r]&&function(e){return new Promise(function(n,o){(function(t,e,r,n){Promise.resolve(n).then(function(e){t({value:e,done:r})},e)})(n,o,(e=t[r](e)).done,e.value)})}}}function E(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function T(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function A(t){return t&&t.__esModule?t:{default:t}}},function(t,e,r){"use strict";var n=r(15),o=r(42),i=Object.prototype.toString;function s(t){return"[object Array]"===i.call(t)}function a(t){return null!==t&&"object"==typeof t}function u(t){return"[object Function]"===i.call(t)}function c(t,e){if(null!==t&&void 0!==t)if("object"!=typeof t&&(t=[t]),s(t))for(var r=0,n=t.length;r0||Object.keys(this.values).length>0)&&(t.values=this.values),this.applicationType!=e.FILTER_AT_LEAST_ONE&&(t.application_type=this.applicationType),this.filterType!=e.FILTER_TYPE_FIELD&&(t.filter_type=this.filterType),this.filterTerms.length>0&&(t.filter_terms=this.filterTerms),t},t.createFromArray=function(r){return void 0===(r=JSON.parse(JSON.stringify(r))).field&&(r.field="uuid.type"),void 0===r.values&&(r.values=[]),void 0===r.application_type&&(r.application_type=e.FILTER_AT_LEAST_ONE),void 0===r.filter_type&&(r.filter_type=e.FILTER_TYPE_FIELD),void 0===r.filter_terms&&(r.filter_terms=[]),t.create(r.field,r.values,r.application_type,r.filter_type,r.filter_terms)},t.getFilterPathByField=function(t){return["id","type"].indexOf(t)>-1?"uuid."+t:"indexed_metadata."+t},t}();e.Filter=n},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),o=r(6),i=r(7),s=r(24),a=r(10),u=r(4),c=r(4),f=r(10),l=r(2),p=r(4),d=r(25),h=r(11);e.QUERY_DEFAULT_FROM=0,e.QUERY_DEFAULT_PAGE=1,e.QUERY_DEFAULT_SIZE=10,e.QUERY_INFINITE_SIZE=1e3,e.NO_MIN_SCORE=0;var y=function(){function t(t){this.fields=[],this.universeFilters={},this.filters={},this.itemsPromoted=[],this.aggregations={},this.filterFields=[],this.minScore=e.NO_MIN_SCORE,this.sortByInstance=h.SortBy.create(),this.filters._query=u.Filter.create("",[t],0,p.FILTER_TYPE_QUERY)}return t.createLocated=function(r,n,o,i){void 0===o&&(o=e.QUERY_DEFAULT_PAGE),void 0===i&&(i=e.QUERY_DEFAULT_SIZE);var s=t.create(n,o,i);return s.coordinate=r,s},t.create=function(r,n,o){void 0===n&&(n=e.QUERY_DEFAULT_PAGE),void 0===o&&(o=e.QUERY_DEFAULT_SIZE),n=Math.max(1,n);var i=new t(r);return i.from=(n-1)*o,i.size=o,i.page=n,i},t.createMatchAll=function(){return t.create("",e.QUERY_DEFAULT_PAGE,e.QUERY_DEFAULT_SIZE)},t.createByUUID=function(e){return t.createByUUIDs(e)},t.createByUUIDs=function(){for(var r=[],n=0;n0?this.universeFilters=n.__assign({},this.universeFilters,((e={}).type=u.Filter.create(r,t,c.FILTER_AT_LEAST_ONE,c.FILTER_TYPE_FIELD),e)):delete this.universeFilters.type,this},t.prototype.filterByTypes=function(t,e,r){var o,i;void 0===e&&(e=!0),void 0===r&&(r=f.AGGREGATION_SORT_BY_COUNT_DESC);var s=u.Filter.getFilterPathByField("type");return t.length>0?this.filters=n.__assign({},this.filters,((o={}).type=u.Filter.create(s,t,c.FILTER_AT_LEAST_ONE,c.FILTER_TYPE_FIELD),o)):delete this.filters.type,e&&(this.aggregations=n.__assign({},this.aggregations,((i={}).type=a.Aggregation.create("type",s,c.FILTER_AT_LEAST_ONE,c.FILTER_TYPE_FIELD,[],r),i))),this},t.prototype.filterUniverseByIds=function(t){var e,r=u.Filter.getFilterPathByField("id");return t.length>0?this.universeFilters=n.__assign({},this.universeFilters,((e={}).id=u.Filter.create(r,t,c.FILTER_AT_LEAST_ONE,c.FILTER_TYPE_FIELD),e)):delete this.universeFilters.id,this},t.prototype.filterByIds=function(t){var e,r=u.Filter.getFilterPathByField("id");return t.length>0?this.filters=n.__assign({},this.filters,((e={}).id=u.Filter.create(r,t,c.FILTER_AT_LEAST_ONE,c.FILTER_TYPE_FIELD),e)):delete this.filters.id,this},t.prototype.filterUniverseBy=function(t,e,r){var o;void 0===r&&(r=c.FILTER_AT_LEAST_ONE);var i=u.Filter.getFilterPathByField(t);return e.length>0?this.universeFilters=n.__assign({},this.universeFilters,((o={})[t]=u.Filter.create(i,e,r,c.FILTER_TYPE_FIELD),o)):delete this.universeFilters[t],this},t.prototype.filterBy=function(t,e,r,o,i,s){var a;void 0===o&&(o=c.FILTER_AT_LEAST_ONE),void 0===i&&(i=!0),void 0===s&&(s=f.AGGREGATION_SORT_BY_COUNT_DESC);var l=u.Filter.getFilterPathByField(e);return r.length>0?this.filters=n.__assign({},this.filters,((a={})[t]=u.Filter.create(l,r,o,c.FILTER_TYPE_FIELD),a)):delete this.filters[t],i&&this.aggregateBy(t,e,o,s),this},t.prototype.filterUniverseByRange=function(t,e,r,o){var i;void 0===r&&(r=c.FILTER_AT_LEAST_ONE),void 0===o&&(o=c.FILTER_TYPE_RANGE);var s=u.Filter.getFilterPathByField(t);return e.length>0?this.universeFilters=n.__assign({},this.universeFilters,((i={})[t]=u.Filter.create(s,e,r,o),i)):delete this.universeFilters[t],this},t.prototype.filterUniverseByDateRange=function(t,e,r){return void 0===r&&(r=c.FILTER_AT_LEAST_ONE),this.filterUniverseByRange(t,e,r,c.FILTER_TYPE_DATE_RANGE)},t.prototype.filterByRange=function(t,e,r,o,i,s,a,l){var p;void 0===i&&(i=c.FILTER_AT_LEAST_ONE),void 0===s&&(s=c.FILTER_TYPE_RANGE),void 0===a&&(a=!0),void 0===l&&(l=f.AGGREGATION_SORT_BY_COUNT_DESC);var d=u.Filter.getFilterPathByField(e);return 0!==o.length?this.filters=n.__assign({},this.filters,((p={})[t]=u.Filter.create(d,o,i,s),p)):delete this.filters[t],a&&this.aggregateByRange(t,d,r,i,s,l),this},t.prototype.filterByDateRange=function(t,e,r,n,o,i,s){return void 0===o&&(o=c.FILTER_AT_LEAST_ONE),void 0===i&&(i=!0),void 0===s&&(s=f.AGGREGATION_SORT_BY_COUNT_DESC),this.filterByRange(t,e,r,n,o,c.FILTER_TYPE_DATE_RANGE,i,s)},t.prototype.filterUniverseByLocation=function(t){var e;return this.universeFilters=n.__assign({},this.universeFilters,((e={}).coordinate=u.Filter.create("coordinate",t.toArray(),c.FILTER_AT_LEAST_ONE,c.FILTER_TYPE_GEO),e)),this},t.prototype.setFilterFields=function(t){return this.filterFields=t,this},t.prototype.getFilterFields=function(){return this.filterFields},t.prototype.sortBy=function(t){if(t.isSortedByGeoDistance()){if(!(this.coordinate instanceof o.Coordinate))throw l.InvalidFormatError.querySortedByDistanceWithoutCoordinate();t.setCoordinate(this.coordinate)}return this.sortByInstance=t,this},t.prototype.aggregateBy=function(t,e,r,o,i){var s;return void 0===o&&(o=f.AGGREGATION_SORT_BY_COUNT_DESC),void 0===i&&(i=f.AGGREGATION_NO_LIMIT),this.aggregations=n.__assign({},this.aggregations,((s={})[t]=a.Aggregation.create(t,u.Filter.getFilterPathByField(e),r,c.FILTER_TYPE_FIELD,[],o,i),s)),this},t.prototype.aggregateByRange=function(t,e,r,o,i,s,l){var p;return void 0===i&&(i=c.FILTER_TYPE_RANGE),void 0===s&&(s=f.AGGREGATION_SORT_BY_COUNT_DESC),void 0===l&&(l=f.AGGREGATION_NO_LIMIT),0===r.length?this:(this.aggregations=n.__assign({},this.aggregations,((p={})[t]=a.Aggregation.create(t,u.Filter.getFilterPathByField(e),o,i,r,s,l),p)),this)},t.prototype.aggregateByDateRange=function(t,e,r,n,o,i){return void 0===o&&(o=f.AGGREGATION_SORT_BY_COUNT_DESC),void 0===i&&(i=f.AGGREGATION_NO_LIMIT),this.aggregateByRange(t,e,r,n,c.FILTER_TYPE_DATE_RANGE,o,i)},t.prototype.getAggregations=function(){return this.aggregations},t.prototype.getAggregation=function(t){return this.aggregations[t]instanceof a.Aggregation?this.aggregations[t]:null},t.prototype.getQueryText=function(){var t=this.filters._query;return t instanceof u.Filter?t.getValues()[0]:""},t.prototype.getUniverseFilters=function(){return this.universeFilters},t.prototype.getUniverseFilter=function(t){return this.universeFilters[t]instanceof u.Filter?this.universeFilters[t]:null},t.prototype.getFilters=function(){return this.filters},t.prototype.getFilter=function(t){return this.filters[t]instanceof u.Filter?this.filters[t]:null},t.prototype.getFilterByField=function(t){var e=u.Filter.getFilterPathByField(t);for(var r in this.filters)if(this.filters[r].getField()==e)return this.filters[r];return null},t.prototype.getSortBy=function(){return this.sortByInstance},t.prototype.getFrom=function(){return this.from},t.prototype.getSize=function(){return this.size},t.prototype.getPage=function(){return this.page},t.prototype.enableResults=function(){return this.resultsEnabled=!0,this},t.prototype.disableResults=function(){return this.resultsEnabled=!1,this},t.prototype.areResultsEnabled=function(){return this.resultsEnabled},t.prototype.enableAggregations=function(){return this.aggregationsEnabled=!0,this},t.prototype.disableAggregations=function(){return this.aggregationsEnabled=!1,this},t.prototype.areAggregationsEnabled=function(){return this.aggregationsEnabled},t.prototype.enableSuggestions=function(){return this.suggestionsEnabled=!0,this},t.prototype.disableSuggestions=function(){return this.suggestionsEnabled=!1,this},t.prototype.areSuggestionsEnabled=function(){return this.suggestionsEnabled},t.prototype.enableHighlights=function(){return this.highlightsEnabled=!0,this},t.prototype.disableHighlights=function(){return this.highlightsEnabled=!1,this},t.prototype.areHighlightsEnabled=function(){return this.highlightsEnabled},t.prototype.promoteUUID=function(t){return this.itemsPromoted.push(t),this},t.prototype.promoteUUIDs=function(){for(var t=[],e=0;e0&&(t.fields=this.fields),Object.keys(this.universeFilters).length)for(var r in t.universe_filters={},this.universeFilters){var n=this.universeFilters[r];t.universe_filters[r]=n.toArray()}if(this.filters instanceof Object&&Object.keys(this.filters).length)for(var r in t.filters={},this.filters){var i=this.filters[r];i.getFilterType()!==p.FILTER_TYPE_QUERY&&(t.filters[r]=i.toArray())}if(this.aggregations instanceof Object&&Object.keys(this.aggregations).length)for(var r in t.aggregations={},this.aggregations){var a=this.aggregations[r];t.aggregations[r]=a.toArray()}var u=this.sortByInstance.toArray();Object.keys(u).length&&(t.sort=u);var c=this.page;c!==e.QUERY_DEFAULT_PAGE&&(t.page=c);var f=this.size;if(f!==e.QUERY_DEFAULT_SIZE&&(t.size=f),!1===this.resultsEnabled&&(t.results_enabled=!1),!0===this.suggestionsEnabled&&(t.suggestions_enabled=!0),!0===this.highlightsEnabled&&(t.highlights_enabled=!0),!1===this.aggregationsEnabled&&(t.aggregations_enabled=!1),this.filterFields instanceof Array&&this.filterFields.length>0&&(t.filter_fields=this.filterFields),this.scoreStrategy instanceof d.ScoreStrategy){var l=this.scoreStrategy.toArray();Object.keys(l).length>0&&(t.score_strategy=l)}null!==this.fuzziness&&(t.fuzziness=this.fuzziness);var h=this.minScore;if(h!==e.NO_MIN_SCORE&&(t.min_score=h),this.user instanceof s.User){var y=this.user.toArray();Object.keys(y).length>0&&(t.user=y)}if(this.itemsPromoted.length>0)for(var r in t.items_promoted=[],this.itemsPromoted)t.items_promoted.push(this.itemsPromoted[r].toArray());return t},t.createFromArray=function(r){var n=r.coordinate instanceof Object?t.createLocated(o.Coordinate.createFromArray(r.coordinate),r.q?r.q:"",r.page?r.page:e.QUERY_DEFAULT_PAGE,r.size?r.size:e.QUERY_DEFAULT_SIZE):t.create(r.q?r.q:"",r.page?r.page:e.QUERY_DEFAULT_PAGE,r.size?r.size:e.QUERY_DEFAULT_SIZE);n.fields=r.fields instanceof Array?r.fields:[];var c=typeof r.aggregations==typeof{}?r.aggregations:{};for(var f in c)n.aggregations[f]=a.Aggregation.createFromArray(c[f]);var l=typeof r.sort==typeof{}?r.sort:{};Object.keys(l).length>0&&(n.sortByInstance=h.SortBy.createFromArray(l));var p=typeof r.filters==typeof{}?r.filters:{};for(var f in p)n.filters[f]=u.Filter.createFromArray(p[f]);var y=typeof r.universe_filters==typeof{}?r.universe_filters:{};for(var f in y)n.universeFilters[f]=u.Filter.createFromArray(y[f]);n.resultsEnabled="boolean"!=typeof r.results_enabled||r.results_enabled,n.suggestionsEnabled="boolean"==typeof r.suggestions_enabled&&r.suggestions_enabled,n.aggregationsEnabled="boolean"!=typeof r.aggregations_enabled||r.aggregations_enabled,n.highlightsEnabled="boolean"==typeof r.highlights_enabled&&r.highlights_enabled,n.fuzziness=r.fuzziness,n.minScore=r.min_score?r.min_score:e.NO_MIN_SCORE;var g=typeof r.items_promoted==typeof{}?r.items_promoted:{};for(var f in g)n.itemsPromoted.push(i.ItemUUID.createFromArray(g[f]));return n.filterFields=r.filter_fields instanceof Array?r.filter_fields:[],n.scoreStrategy=r.score_strategy instanceof Object?d.ScoreStrategy.createFromArray(r.score_stategy):null,n.user=r.user instanceof Object?s.User.createFromArray(r.user):null,n},t}();e.Query=y},function(t,e,r){"use strict";e.__esModule=!0;var n=r(2),o=function(){function t(t,e){this.lat=t,this.lon=e}return t.prototype.getLatitude=function(){return this.lat},t.prototype.getLongitude=function(){return this.lon},t.prototype.toArray=function(){return{lat:this.lat,lon:this.lon}},t.createFromArray=function(e){if(void 0===e.lat||void 0===e.lon)throw n.InvalidFormatError.coordinateFormatNotValid();return new t(e.lat,e.lon)},t}();e.Coordinate=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(2),o=function(){function t(t,e){this.id=t,this.type=e}return t.createByComposedUUID=function(e){var r=e.split("~");if(2!=r.length)throw n.InvalidFormatError.composedItemUUIDNotValid();return new t(r[0],r[1])},t.prototype.getId=function(){return this.id},t.prototype.getType=function(){return this.type},t.prototype.toArray=function(){return{id:this.id,type:this.type}},t.createFromArray=function(e){return new t((e=JSON.parse(JSON.stringify(e))).id,e.type)},t.prototype.composedUUID=function(){return this.id+"~"+this.type},t}();e.ItemUUID=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),o=r(2),i=r(6),s=r(7),a=function(){function t(t,e,r,n,o,i,s){this.metadata={},this.indexedMetadata={},this.searchableMetadata={},this.exactMatchingMetadata=[],this.suggest=[],this.highlights={},this.promoted=!1,this.uuid=t,this.coordinate=e,this.metadata=r,this.indexedMetadata=n,this.searchableMetadata=o,this.exactMatchingMetadata=i,this.suggest=s}return t.create=function(e,r,n,o,i,s){return void 0===r&&(r={}),void 0===n&&(n={}),void 0===o&&(o={}),void 0===i&&(i=[]),void 0===s&&(s=[]),new t(e,null,r,n,o,i,s)},t.createLocated=function(e,r,n,o,i,s,a){return void 0===n&&(n={}),void 0===o&&(o={}),void 0===i&&(i={}),void 0===s&&(s=[]),void 0===a&&(a=[]),new t(e,r,n,o,i,s,a)},t.prototype.getUUID=function(){return this.uuid},t.prototype.getId=function(){return this.uuid.getId()},t.prototype.getType=function(){return this.uuid.getType()},t.prototype.getCoordinate=function(){return this.coordinate},t.prototype.getDistance=function(){return this.distance},t.prototype.getMetadata=function(){return this.metadata},t.prototype.setMetadata=function(t){this.metadata=t},t.prototype.addMetadata=function(t,e){this.metadata[t]=e},t.prototype.getIndexedMetadata=function(){return this.indexedMetadata},t.prototype.setIndexedMetadata=function(t){this.indexedMetadata=t},t.prototype.addIndexedMetadata=function(t,e){this.indexedMetadata[t]=e},t.prototype.getSearchableMetadata=function(){return this.searchableMetadata},t.prototype.setSearchableMetadata=function(t){this.searchableMetadata=t},t.prototype.addSearchableMetadata=function(t,e){this.searchableMetadata[t]=e},t.prototype.getExactMatchingMetadata=function(){return this.exactMatchingMetadata},t.prototype.setExactMatchingMetadata=function(t){this.exactMatchingMetadata=t},t.prototype.addExactMatchingMetadata=function(t){this.exactMatchingMetadata.push(t)},t.prototype.getAllMetadata=function(){return n.__assign({},this.metadata,this.indexedMetadata)},t.prototype.get=function(t){var e=this.getAllMetadata();return void 0!==e[t]?e[t]:null},t.prototype.getSuggest=function(){return this.suggest},t.prototype.getHighlights=function(){return this.highlights},t.prototype.getHighlight=function(t){return void 0!==this.highlights[t]?this.highlights[t]:null},t.prototype.isPromoted=function(){return this.promoted},t.prototype.setScore=function(t){return this.score=t,this},t.prototype.getScore=function(){return this.score},t.prototype.toArray=function(){var t={uuid:this.uuid.toArray()};return this.coordinate instanceof i.Coordinate&&(t.coordinate=this.coordinate.toArray()),Object.keys(this.metadata).length>0&&(t.metadata=this.metadata),Object.keys(this.indexedMetadata).length>0&&(t.indexed_metadata=this.indexedMetadata),Object.keys(this.searchableMetadata).length>0&&(t.searchable_metadata=this.searchableMetadata),this.exactMatchingMetadata.length>0&&(t.exact_matching_metadata=this.exactMatchingMetadata),this.suggest.length>0&&(t.suggest=this.suggest),Object.keys(this.highlights).length>0&&(t.highlights=this.highlights),this.isPromoted()&&(t.is_promoted=!0),void 0!==this.distance&&(t.distance=this.distance),void 0!==this.score&&(t.score=this.score),t},t.createFromArray=function(e){if("object"!=typeof(e=JSON.parse(JSON.stringify(e))).uuid)throw o.InvalidFormatError.itemUUIDRepresentationNotValid();if(void 0!==e.coordinate&&"object"!=typeof e.coordinate)throw o.InvalidFormatError.coordinateFormatNotValid();var r="object"==typeof e.coordinate&&null!=e.coordinate?t.createLocated(s.ItemUUID.createFromArray(e.uuid),i.Coordinate.createFromArray(e.coordinate),void 0===e.metadata?{}:e.metadata,void 0===e.indexed_metadata?{}:e.indexed_metadata,void 0===e.searchable_metadata?{}:e.searchable_metadata,void 0===e.exact_matching_metadata?[]:e.exact_matching_metadata,void 0===e.suggest?[]:e.suggest):t.create(s.ItemUUID.createFromArray(e.uuid),void 0===e.metadata?{}:e.metadata,void 0===e.indexed_metadata?{}:e.indexed_metadata,void 0===e.searchable_metadata?{}:e.searchable_metadata,void 0===e.exact_matching_metadata?[]:e.exact_matching_metadata,void 0===e.suggest?[]:e.suggest);return void 0!==e.distance&&null!=e.distance&&(r.distance=e.distance),"object"==typeof e.highlights&&null!=e.distance&&(r.highlights=e.highlights),void 0!==e.is_promoted&&null!=e.is_promoted&&(r.promoted=e.is_promoted),void 0!==e.score&&null!=e.score&&(r.score=e.score),r},t.prototype.composeUUID=function(){return this.uuid.composedUUID()},t}();e.Item=a},function(t,e,r){"use strict";(function(e){var n=r(1),o=r(45),i={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!n.isUndefined(t)&&n.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var a={adapter:function(){var t;return"undefined"!=typeof XMLHttpRequest?t=r(16):void 0!==e&&(t=r(16)),t}(),transformRequest:[function(t,e){return o(e,"Content-Type"),n.isFormData(t)||n.isArrayBuffer(t)||n.isBuffer(t)||n.isStream(t)||n.isFile(t)||n.isBlob(t)?t:n.isArrayBufferView(t)?t.buffer:n.isURLSearchParams(t)?(s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):n.isObject(t)?(s(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],function(t){a.headers[t]={}}),n.forEach(["post","put","patch"],function(t){a.headers[t]=n.merge(i)}),t.exports=a}).call(this,r(44))},function(t,e,r){"use strict";e.__esModule=!0;var n=r(4);e.AGGREGATION_SORT_BY_COUNT_ASC=["_count","asc"],e.AGGREGATION_SORT_BY_COUNT_DESC=["_count","desc"],e.AGGREGATION_SORT_BY_NAME_ASC=["_term","asc"],e.AGGREGATION_SORT_BY_NAME_DESC=["_term","desc"],e.AGGREGATION_NO_LIMIT=0;var o=function(){function t(t,e,r,n,o,i,s){this.subgroup=[],this.name=t,this.field=e,this.applicationType=r,this.filterType=n,this.subgroup=o,this.sort=i,this.limit=s}return t.prototype.getName=function(){return this.name},t.prototype.getField=function(){return this.field},t.prototype.getApplicationType=function(){return this.applicationType},t.prototype.getFilterType=function(){return this.filterType},t.prototype.getSubgroup=function(){return this.subgroup},t.prototype.getSort=function(){return this.sort},t.prototype.getLimit=function(){return this.limit},t.create=function(r,n,o,i,s,a,u){return void 0===s&&(s=[]),void 0===a&&(a=e.AGGREGATION_SORT_BY_COUNT_DESC),void 0===u&&(u=e.AGGREGATION_NO_LIMIT),new t(r,n,o,i,s,a,u)},t.prototype.toArray=function(){var t={name:this.name};return"uuid.type"!=this.field&&(t.field=this.field),this.applicationType!=n.FILTER_AT_LEAST_ONE&&(t.application_type=this.applicationType),this.filterType!=n.FILTER_TYPE_FIELD&&(t.filter_type=this.filterType),this.subgroup.length>0&&(t.subgroup=this.subgroup),JSON.stringify(this.sort)!==JSON.stringify(e.AGGREGATION_SORT_BY_COUNT_DESC)&&(t.sort=this.sort),this.limit!=e.AGGREGATION_NO_LIMIT&&(t.limit=this.limit),t},t.createFromArray=function(r){return void 0===(r=JSON.parse(JSON.stringify(r))).field&&(r.field="uuid.type"),void 0===r.application_type&&(r.application_type=n.FILTER_AT_LEAST_ONE),void 0===r.filter_type&&(r.filter_type=n.FILTER_TYPE_FIELD),void 0===r.subgroup&&(r.subgroup=[]),void 0===r.sort&&(r.sort=e.AGGREGATION_SORT_BY_COUNT_DESC),void 0===r.limit&&(r.limit=e.AGGREGATION_NO_LIMIT),t.create(r.name,r.field,r.application_type,r.filter_type,r.subgroup,r.sort,r.limit)},t}();e.Aggregation=o},function(t,e,r){"use strict";e.__esModule=!0,e.SORT_BY_TYPE_FIELD=1,e.SORT_BY_TYPE_NESTED=2,e.SORT_BY_ASC="asc",e.SORT_BY_DESC="desc",e.SORT_BY_MODE_AVG="avg",e.SORT_BY_MODE_SUM="sum",e.SORT_BY_MODE_MIN="min",e.SORT_BY_MODE_MAX="max",e.SORT_BY_MODE_MEDIAN="median",e.SORT_BY_SCORE={_score:{order:e.SORT_BY_ASC}},e.SORT_BY_RANDOM={random:{order:e.SORT_BY_ASC}},e.SORT_BY_AL_TUN_TUN=e.SORT_BY_RANDOM,e.SORT_BY_ID_ASC={"uuid.id":{order:e.SORT_BY_ASC}},e.SORT_BY_ID_DESC={"uuid.id":{order:e.SORT_BY_DESC}},e.SORT_BY_TYPE_ASC={"uuid.type":{order:e.SORT_BY_ASC}},e.SORT_BY_TYPE_DESC={"uuid.type":{order:e.SORT_BY_DESC}},e.SORT_BY_LOCATION_KM_ASC={_geo_distance:{order:e.SORT_BY_ASC,unit:"km"}},e.SORT_BY_LOCATION_MI_ASC={_geo_distance:{order:e.SORT_BY_DESC,unit:"mi"}};var n=r(6),o=r(4),i=function(){function t(){this.sortsBy=[]}return t.create=function(){return new t},t.byFieldsValues=function(e){var r=t.create();for(var n in e)r.byFieldValue(n,e[n]);return r},t.prototype.all=function(){return this.sortsBy.length>0?this.sortsBy:[e.SORT_BY_SCORE]},t.prototype.byValue=function(t){return e.SORT_BY_SCORE!=t&&e.SORT_BY_RANDOM!=t&&void 0===t.type&&(t.type=e.SORT_BY_TYPE_FIELD),e.SORT_BY_SCORE!=t&&this.sortsBy.push(t),this},t.prototype.byFieldValue=function(t,r){var n={type:e.SORT_BY_TYPE_FIELD};return n["indexed_metadata."+t]={order:r},this.sortsBy.push(n),this},t.prototype.byNestedField=function(t,r,n){void 0===n&&(n=e.SORT_BY_MODE_AVG);var o={type:e.SORT_BY_TYPE_NESTED,mode:n};return o["indexed_metadata."+t]={order:r},this.sortsBy.push(o),this},t.prototype.byNestedFieldAndFilter=function(t,r,n,i){void 0===i&&(i=e.SORT_BY_MODE_AVG);var s=o.Filter.getFilterPathByField(n.getField()),a=n.toArray();a.field=s,n=o.Filter.createFromArray(a);var u={type:e.SORT_BY_TYPE_NESTED,mode:i,filter:n};return u["indexed_metadata."+t]={order:r},this.sortsBy.push(u),this},t.prototype.isSortedByGeoDistance=function(){for(var t in this.sortsBy)if(typeof this.sortsBy[t]._geo_distance==typeof{})return!0;return!1},t.prototype.setCoordinate=function(t){for(var e in this.sortsBy)typeof this.sortsBy[e]._geo_distance==typeof{}&&(this.sortsBy[e]._geo_distance.coordinate=t);return this},t.prototype.hasRandomSort=function(){for(var t in this.sortsBy)if(JSON.stringify(this.sortsBy[t])===JSON.stringify(e.SORT_BY_RANDOM))return!0;return!1},t.prototype.toArray=function(){var t=this.copy().sortsBy;for(var r in t)t[r].type==e.SORT_BY_TYPE_FIELD&&delete t[r].type,typeof t[r].filter==typeof{}&&null!=t[r].filter&&(t[r].filter=t[r].filter.toArray()),typeof t[r]._geo_distance==typeof{}&&null!==t[r]._geo_distance&&t[r]._geo_distance.coordinate instanceof n.Coordinate&&(t[r]._geo_distance.coordinate=t[r]._geo_distance.coordinate.toArray());return t},t.createFromArray=function(r){var i=JSON.parse(JSON.stringify(r)),s=t.create();for(var a in i){var u=i[a];JSON.stringify(u)!==JSON.stringify(e.SORT_BY_RANDOM)&&JSON.stringify(u)!==JSON.stringify(e.SORT_BY_SCORE)&&void 0===u.type&&(u.type=e.SORT_BY_TYPE_FIELD),typeof u.filter==typeof{}&&null!=u.filter&&(u.filter=o.Filter.createFromArray(u.filter)),typeof u._geo_distance==typeof{}&&null!=u._geo_distance&&typeof u._geo_distance.coordinate==typeof{}&&(u._geo_distance.coordinate=n.Coordinate.createFromArray(u._geo_distance.coordinate)),s.sortsBy.push(u)}return s},t.prototype.copy=function(){var e=t.create();for(var r in this.sortsBy){var i=this.sortsBy[r],s=JSON.parse(JSON.stringify(i));typeof i.filter==typeof{}&&null!=i.filter&&(s.filter=o.Filter.createFromArray(i.filter.toArray())),typeof i._geo_distance==typeof{}&&null!=i._geo_distance&&typeof i._geo_distance.coordinate==typeof{}&&(s._geo_distance.coordinate=n.Coordinate.createFromArray(i._geo_distance.coordinate.toArray())),e.sortsBy.push(s)}return e},t}();e.SortBy=i},function(t,e,r){"use strict";e.__esModule=!0;var n=r(8),o=r(5),i=r(13),s=function(){function t(t,e,r){this.items=[],this.suggests=[],this.query=t,this.totalItems=e,this.totalHits=r}return t.create=function(e,r,n,o,i,s){var a=new t(e,r,n);return a.aggregations=o,a.suggests=i,a.items=s,a},t.prototype.addItem=function(t){this.items.push(t)},t.prototype.getItems=function(){return this.items},t.prototype.getItemsGroupedByTypes=function(){if(this.itemsGroupedByTypeCache instanceof Object&&Object.keys(this.itemsGroupedByTypeCache).length>0)return this.itemsGroupedByTypeCache;var t={};for(var e in this.items){var r=this.items[e];t[r.getType()]instanceof Array||(t[r.getType()]=[]),t[r.getType()].push(r)}return this.itemsGroupedByTypeCache=t,t},t.prototype.getItemsByType=function(t){var e=this.getItemsGroupedByTypes();return null==e[t]?[]:e[t]},t.prototype.getItemsByTypes=function(t){return this.items.filter(function(e){return t.indexOf(e.getType())>=0})},t.prototype.getFirstItem=function(){return this.items.length>0?this.items[0]:null},t.prototype.setAggregations=function(t){this.aggregations=t},t.prototype.getAggregations=function(){return this.aggregations instanceof i.ResultAggregations?this.aggregations:null},t.prototype.getAggregation=function(t){return null==this.aggregations?null:this.aggregations.getAggregation(t)},t.prototype.hasNotEmptyAggregation=function(t){return null!=this.aggregations&&this.aggregations.hasNotEmptyAggregation(t)},t.prototype.addSuggest=function(t){this.suggests.push(t)},t.prototype.getSuggests=function(){return this.suggests},t.prototype.getQuery=function(){return this.query},t.prototype.getTotalItems=function(){return this.totalItems},t.prototype.getTotalHits=function(){return this.totalHits},t.prototype.toArray=function(){return{query:this.query.toArray(),total_items:this.totalItems,total_hits:this.totalHits,items:this.items.map(function(t){return t.toArray()}),aggregations:null==this.aggregations?null:this.aggregations.toArray(),suggests:this.suggests}},t.createFromArray=function(e){return t.create(o.Query.createFromArray(e.query),e.total_items?e.total_items:0,e.total_hits?e.total_hits:0,e.aggregations instanceof Object?i.ResultAggregations.createFromArray(e.aggregations):null,e.suggests?e.suggests:null,e.items instanceof Array?e.items.map(function(t){return n.Item.createFromArray(t)}):[])},t}();e.Result=s},function(t,e,r){"use strict";e.__esModule=!0;var n=r(31),o=function(){function t(t){this.aggregations={},this.totalElements=t}return t.prototype.addAggregation=function(t,e){this.aggregations[t]=e},t.prototype.getAggregations=function(){return this.aggregations},t.prototype.getAggregation=function(t){return this.aggregations[t]instanceof n.ResultAggregation?this.aggregations[t]:null},t.prototype.hasNotEmptyAggregation=function(t){var e=this.getAggregation(t);return e instanceof n.ResultAggregation&&!e.isEmpty()},t.prototype.getTotalElements=function(){return this.totalElements},t.prototype.toArray=function(){var t={};for(var e in this.aggregations)t[e]=this.aggregations[e].toArray();var r={};return this.totalElements>0&&(r.total_elements=this.totalElements),Object.keys(t).length>0&&(r.aggregations=t),r},t.createFromArray=function(e){var r=new t("number"==typeof e.total_elements?e.total_elements:0);if(typeof e.aggregations==typeof{})for(var o in e.aggregations)r.addAggregation(o,n.ResultAggregation.createFromArray(e.aggregations[o]));return r},t}();e.ResultAggregations=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),o=r(40),i=r(20),s=r(21),a=function(t){function e(e,r,n,o,i,s){var a=t.call(this,r,o)||this;return a.host=e,a.timeout=n,a.cache=s,a.overrideQueries=i,a.cancelToken={},a}return n.__extends(e,t),e.prototype.get=function(t,e,r,a,u){return void 0===a&&(a={}),void 0===u&&(u={}),n.__awaiter(this,void 0,void 0,function(){var c,f=this;return n.__generator(this,function(l){return c=this,t=t.replace(/^\/*|\/*$/g,""),t="/"+(this.version+"/"+t).replace(/^\/*|\/*$/g,""),"get"===(e=e.toLowerCase())&&this.overrideQueries&&this.abort(t),[2,new Promise(function(l,p){var d="get"==e?{}:{"Content-Encoding":"gzip","Content-Type":"application/json"},h={url:t+"?"+i.Client.objectToUrlParameters(n.__assign({},r,a)),data:u,headers:d,method:e,baseURL:c.host.replace(/\/*$/g,""),timeout:c.timeout,transformRequest:[function(t){return JSON.stringify(t)}]};void 0!==f.cancelToken[t]&&(h.cancelToken=f.cancelToken[t].token),o.default.request(h).then(function(t){var e=new s.Response(t.status,t.data);return l(e)}).catch(function(t){if(void 0!==t.response){var e=new s.Response(t.response.status,t.response.data);return p(e)}})})]})})},e.prototype.abort=function(t){void 0!==this.cancelToken[t]&&this.cancelToken[t].cancel(),this.generateCancelToken(t)},e.prototype.generateCancelToken=function(t){this.cancelToken[t]=o.default.CancelToken.source()},e}(i.Client);e.AxiosClient=a},function(t,e,r){"use strict";t.exports=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n0&&(t.attributes=this.attributes),t},t.createFromArray=function(e){if(null==e||void 0===e.id||null==e.id)throw n.InvalidFormatError.userFormatNotValid();var r=typeof e.attributes==typeof{}?e.attributes:{};return new t(e.id,r)},t}();e.User=o},function(t,e,r){"use strict";e.__esModule=!0,e.SCORE_STRATEGY_DEFAULT=0,e.SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD=1,e.SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION=2;var n=function(){function t(){this.type=e.SCORE_STRATEGY_DEFAULT,this.innerFunction=null}return t.prototype.getType=function(){return this.type},t.prototype.getFunction=function(){return this.innerFunction},t.createDefault=function(){return new t},t.createRelevanceBoosting=function(){var r=t.createDefault();return r.type=e.SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD,r},t.createCustomFunction=function(r){var n=t.createDefault();return n.type=e.SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION,n.innerFunction=r,n},t.prototype.toArray=function(){return{type:this.type,function:this.innerFunction}},t.createFromArray=function(r){r=JSON.parse(JSON.stringify(r));var n=t.createDefault();return void 0===r.type&&(r.type=e.SCORE_STRATEGY_DEFAULT),void 0===r.function&&(r.innerFunction=null),n.type=r.type,n.innerFunction=r.function,n},t}();e.ScoreStrategy=n},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),o=r(27),i=r(2),s=r(28),a=r(29),u=r(30),c=r(8),f=r(7),l=r(12),p=r(34),d=r(60),h=function(t){function e(e,r,n,o,i){var s=t.call(this,r,n,o)||this;return s.httpClient=e,s.transformer=i,s}return n.__extends(e,t),e.prototype.getTransformer=function(){return this.transformer},e.prototype.addObject=function(t){var e=this.transformer.toItem(t);e instanceof c.Item&&this.addItem(e)},e.prototype.deleteObject=function(t){var e=this.transformer.toItemUUID(t);e instanceof f.ItemUUID&&this.deleteItem(e)},e.prototype.flushUpdateItems=function(t){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(r){return 0===t.length?[2]:[2,this.httpClient.get("/items","post",this.getCredentialsWithIndex(this.indexId),{},{items:t.map(function(t){return t.toArray()})}).then(function(t){e.throwTransportableExceptionIfNeeded(t)})]})})},e.prototype.flushDeleteItems=function(t){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(r){return 0===t.length?[2]:[2,this.httpClient.get("/items","delete",this.getCredentialsWithIndex(this.indexId),{},{items:t.map(function(t){return t.toArray()})}).then(function(t){e.throwTransportableExceptionIfNeeded(t)})]})})},e.prototype.query=function(t){return n.__awaiter(this,void 0,void 0,function(){var r;return n.__generator(this,function(n){switch(n.label){case 0:return r=this,[4,this.httpClient.get("/","get",this.getCredentialsWithIndex(this.indexId),{query:JSON.stringify(t.toArray())},{}).then(function(t){e.throwTransportableExceptionIfNeeded(t);var n=l.Result.createFromArray(t.getBody());return l.Result.create(n.getQuery(),n.getTotalItems(),n.getTotalHits(),n.getAggregations(),n.getSuggests(),r.transformer.fromItems(n.getItems()))})];case 1:return[2,n.sent()]}})})},e.prototype.updateItems=function(t,r){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(n){switch(n.label){case 0:return[4,this.httpClient.get("/items","put",this.getCredentialsWithIndex(this.indexId),{},{query:t.toArray(),changes:r.toArray()}).then(function(t){e.throwTransportableExceptionIfNeeded(t)})];case 1:return[2,n.sent()]}})})},e.prototype.createIndex=function(t,r){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(n){switch(n.label){case 0:return[4,this.httpClient.get("/index","put",this.getCredentials(),{},{index:t.toArray(),config:r.toArray()}).then(function(t){e.throwTransportableExceptionIfNeeded(t)})];case 1:return[2,n.sent()]}})})},e.prototype.deleteIndex=function(t){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(t){switch(t.label){case 0:return[4,this.httpClient.get("/index","delete",this.getCredentialsWithIndex(this.indexId),{},{}).then(function(t){e.throwTransportableExceptionIfNeeded(t)})];case 1:return[2,t.sent()]}})})},e.prototype.resetIndex=function(t){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(t){switch(t.label){case 0:return[4,this.httpClient.get("/index/reset","post",this.getCredentialsWithIndex(this.indexId),{},{}).then(function(t){e.throwTransportableExceptionIfNeeded(t)})];case 1:return[2,t.sent()]}})})},e.prototype.checkIndex=function(t){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(t){switch(t.label){case 0:return[4,this.httpClient.get("/index","head",this.getCredentialsWithIndex(this.indexId),{},{}).then(function(t){return e.throwTransportableExceptionIfNeeded(t),200===t.getCode()})];case 1:return[2,t.sent()]}})})},e.prototype.getIndices=function(){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(t){switch(t.label){case 0:return[4,this.httpClient.get("/indices","get",this.getCredentials(),{},{}).then(function(t){e.throwTransportableExceptionIfNeeded(t);for(var r=[],n=0,o=t.getBody();n0},t.prototype.hasLevels=function(){return(this.applicationType&o.FILTER_MUST_ALL_WITH_LEVELS)>0},t.prototype.getCounter=function(t){return this.counters[t]instanceof i.Counter?this.counters[t]:null},t.prototype.getAllElements=function(){return n.__assign({},this.activeElements,this.counters)},t.prototype.getTotalElements=function(){return this.totalElements},t.prototype.getActiveElements=function(){if(0===Object.keys(this.activeElements).length)return{};if(this.applicationType===o.FILTER_MUST_ALL_WITH_LEVELS){var t=null;for(var e in this.activeElements){var r=this.activeElements[e];r instanceof i.Counter&&(null==t&&(t=r),t=t.getLevel()>r.getLevel()?t:r)}return t instanceof i.Counter?{0:t}:null}return this.activeElements},t.prototype.cleanCountersByLevel=function(){for(var t in this.counters){this.counters[t].getLevel()!==this.highestActiveElement+1&&delete this.counters[t]}},t.prototype.isEmpty=function(){return 0==Object.keys(this.activeElements).length&&0==Object.keys(this.counters).length},t.prototype.toArray=function(){var t={name:this.name,counters:[],active_elements:[]};for(var e in this.counters)t.counters.push(this.counters[e].toArray());for(var e in this.applicationType!==o.FILTER_AT_LEAST_ONE&&(t.application_type=this.applicationType),this.totalElements>0&&(t.total_elements=this.totalElements),this.activeElements){var r=this.activeElements[e];t.active_elements.push(r instanceof i.Counter?r.toArray():r)}return this.highestActiveElement>0&&(t.highest_active_level=this.highestActiveElement),0===t.counters.length&&delete t.counters,0===t.active_elements.length&&delete t.active_elements,t},t.createFromArray=function(e){var r=[],n=e.active_elements;for(var s in n=typeof n==typeof[]?n:[]){var a=n[s];r.push(typeof a==typeof{}?i.Counter.createFromArray(a):a)}var u=new t(e.name,parseInt(e.application_type?e.application_type:o.FILTER_AT_LEAST_ONE),parseInt(e.total_elements?e.total_elements:0),[]);u.activeElements=r;var c=typeof e.counters==typeof[]?e.counters:[];for(var s in c){var f=c[s],l=i.Counter.createFromArray(f);u.counters[l.getId()]=l}return u.highestActiveElement="number"==typeof e.highest_active_level?e.highest_active_level:0,u},t}();e.ResultAggregation=s},function(t,e,r){"use strict";e.__esModule=!0;var n=r(33),o=function(){function t(t,e,r){this.values=t,this.used=e,this.n=r}return t.prototype.getId=function(){return"string"==typeof this.values.id?this.values.id:null},t.prototype.getName=function(){return"string"==typeof this.values.name?this.values.name:null},t.prototype.getSlug=function(){return"string"==typeof this.values.slug?this.values.slug:null},t.prototype.getLevel=function(){return"number"==typeof this.values.level?this.values.level:0},t.prototype.getValues=function(){return this.values},t.prototype.isUsed=function(){return this.used},t.prototype.getN=function(){return this.n},t.createByActiveElements=function(e,r,o){var i=n.Metadata.fromMetadata(e);if(null==i)return null;for(var s=o.length,a=!1;s--;)o[s]==i.id&&(a=!0);return new t(i,a,r)},t.prototype.toArray=function(){var t={values:this.values,n:this.n};return!0===this.used&&(t.used=!0),t},t.createFromArray=function(e){return new t((e=JSON.parse(JSON.stringify(e))).values,"boolean"==typeof e.used&&e.used,e.n)},t}();e.Counter=o},function(t,e,r){"use strict";e.__esModule=!0;var n=function(){function t(){}return t.toMetadata=function(t){t=JSON.parse(JSON.stringify(t));var e=[];for(var r in t)e.push(r+"##"+t[r]);return e.join("~~")},t.fromMetadata=function(t){var e={},r=t.split("~~"),n=0,o=0,i=null;for(var s in r){var a=r[s],u=a.split("##");u.length>1?(i=u[1],e[u[0]]=i):(i=a,e[n++]=i),o++}return 1==o&&(e={id:i,name:i}),void 0===e.id?null:e},t}();e.Metadata=n},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),o=function(){function t(t,e,r){this.itemsToUpdate=[],this.itemsToDelete=[],this.appId=t,this.indexId=e,this.token=r}return t.prototype.resetCachedElements=function(){this.itemsToUpdate=[],this.itemsToDelete=[]},t.prototype.addItem=function(t){this.itemsToUpdate.push(t)},t.prototype.addItems=function(t){for(var e in t)this.addItem(t[e])},t.prototype.deleteItem=function(t){this.itemsToDelete.push(t)},t.prototype.deleteItems=function(t){for(var e in t)this.deleteItem(t[e])},t.prototype.flush=function(e,r){return n.__awaiter(this,void 0,void 0,function(){var o=this;return n.__generator(this,function(n){return e||(e=500),r||(r=!1),r&&this.itemsToUpdate.length=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function u(t,e){return function(r,n){e(r,n,t)}}function c(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function f(t,e,r,n){return new(r||(r=Promise))(function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){t.done?o(t.value):new r(function(e){e(t.value)}).then(s,a)}u((n=n.apply(t,e||[])).next())})}function l(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function h(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function g(){for(var t=[],e=0;e1||a(t,e)})})}function a(t,e){try{!function(t){t.value instanceof y?Promise.resolve(t.value.v).then(u,c):f(i[0][2],t)}(o[t](e))}catch(t){f(i[0][3],t)}}function u(t){a("next",t)}function c(t){a("throw",t)}function f(t,e){t(e),i.shift(),i.length&&a(i[0][0],i[0][1])}}function m(t){var e,r;return e={},n("next"),n("throw",function(t){throw t}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(n,o){e[n]=t[n]?function(e){return(r=!r)?{value:y(t[n](e)),done:"return"===n}:o?o(e):e}:o}}function v(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=p(t),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=t[r]&&function(e){return new Promise(function(n,o){(function(t,e,r,n){Promise.resolve(n).then(function(e){t({value:e,done:r})},e)})(n,o,(e=t[r](e)).done,e.value)})}}}function E(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function T(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function A(t){return t&&t.__esModule?t:{default:t}}},function(t,e,r){"use strict";var n=r(15),o=r(43),i=Object.prototype.toString;function s(t){return"[object Array]"===i.call(t)}function a(t){return null!==t&&"object"==typeof t}function u(t){return"[object Function]"===i.call(t)}function c(t,e){if(null!==t&&void 0!==t)if("object"!=typeof t&&(t=[t]),s(t))for(var r=0,n=t.length;r0||Object.keys(this.values).length>0)&&(t.values=this.values),this.applicationType!=e.FILTER_AT_LEAST_ONE&&(t.application_type=this.applicationType),this.filterType!=e.FILTER_TYPE_FIELD&&(t.filter_type=this.filterType),this.filterTerms.length>0&&(t.filter_terms=this.filterTerms),t},t.createFromArray=function(r){return void 0===(r=JSON.parse(JSON.stringify(r))).field&&(r.field="uuid.type"),void 0===r.values&&(r.values=[]),void 0===r.application_type&&(r.application_type=e.FILTER_AT_LEAST_ONE),void 0===r.filter_type&&(r.filter_type=e.FILTER_TYPE_FIELD),void 0===r.filter_terms&&(r.filter_terms=[]),t.create(r.field,r.values,r.application_type,r.filter_type,r.filter_terms)},t}();e.Filter=n},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),o=r(2),i=r(7),s=r(8),a=function(){function t(t,e,r,n,o,i,s){this.metadata={},this.indexedMetadata={},this.searchableMetadata={},this.exactMatchingMetadata=[],this.suggest=[],this.highlights={},this.promoted=!1,this.uuid=t,this.coordinate=e,this.metadata=r,this.indexedMetadata=n,this.searchableMetadata=o,this.exactMatchingMetadata=i,this.suggest=s}return t.create=function(e,r,n,o,i,s){return void 0===r&&(r={}),void 0===n&&(n={}),void 0===o&&(o={}),void 0===i&&(i=[]),void 0===s&&(s=[]),new t(e,null,r,n,o,i,s)},t.createLocated=function(e,r,n,o,i,s,a){return void 0===n&&(n={}),void 0===o&&(o={}),void 0===i&&(i={}),void 0===s&&(s=[]),void 0===a&&(a=[]),new t(e,r,n,o,i,s,a)},t.prototype.getUUID=function(){return this.uuid},t.prototype.getId=function(){return this.uuid.getId()},t.prototype.getType=function(){return this.uuid.getType()},t.prototype.getCoordinate=function(){return this.coordinate},t.prototype.getDistance=function(){return this.distance},t.prototype.getMetadata=function(){return this.metadata},t.prototype.setMetadata=function(t){this.metadata=t},t.prototype.addMetadata=function(t,e){this.metadata[t]=e},t.prototype.getIndexedMetadata=function(){return this.indexedMetadata},t.prototype.setIndexedMetadata=function(t){this.indexedMetadata=t},t.prototype.addIndexedMetadata=function(t,e){this.indexedMetadata[t]=e},t.prototype.getSearchableMetadata=function(){return this.searchableMetadata},t.prototype.setSearchableMetadata=function(t){this.searchableMetadata=t},t.prototype.addSearchableMetadata=function(t,e){this.searchableMetadata[t]=e},t.prototype.getExactMatchingMetadata=function(){return this.exactMatchingMetadata},t.prototype.setExactMatchingMetadata=function(t){this.exactMatchingMetadata=t},t.prototype.addExactMatchingMetadata=function(t){this.exactMatchingMetadata.push(t)},t.prototype.getAllMetadata=function(){return n.__assign({},this.metadata,this.indexedMetadata)},t.prototype.get=function(t){var e=this.getAllMetadata();return void 0!==e[t]?e[t]:null},t.prototype.getSuggest=function(){return this.suggest},t.prototype.getHighlights=function(){return this.highlights},t.prototype.getHighlight=function(t){return void 0!==this.highlights[t]?this.highlights[t]:null},t.prototype.isPromoted=function(){return this.promoted},t.prototype.setScore=function(t){return this.score=t,this},t.prototype.getScore=function(){return this.score},t.prototype.toArray=function(){var t={uuid:this.uuid.toArray()};return this.coordinate instanceof i.Coordinate&&(t.coordinate=this.coordinate.toArray()),Object.keys(this.metadata).length>0&&(t.metadata=this.metadata),Object.keys(this.indexedMetadata).length>0&&(t.indexed_metadata=this.indexedMetadata),Object.keys(this.searchableMetadata).length>0&&(t.searchable_metadata=this.searchableMetadata),this.exactMatchingMetadata.length>0&&(t.exact_matching_metadata=this.exactMatchingMetadata),this.suggest.length>0&&(t.suggest=this.suggest),Object.keys(this.highlights).length>0&&(t.highlights=this.highlights),this.isPromoted()&&(t.is_promoted=!0),void 0!==this.distance&&(t.distance=this.distance),void 0!==this.score&&(t.score=this.score),t},t.createFromArray=function(e){if("object"!=typeof(e=JSON.parse(JSON.stringify(e))).uuid)throw o.InvalidFormatError.itemUUIDRepresentationNotValid();if(void 0!==e.coordinate&&"object"!=typeof e.coordinate)throw o.InvalidFormatError.coordinateFormatNotValid();var r="object"==typeof e.coordinate&&null!=e.coordinate?t.createLocated(s.ItemUUID.createFromArray(e.uuid),i.Coordinate.createFromArray(e.coordinate),void 0===e.metadata?{}:e.metadata,void 0===e.indexed_metadata?{}:e.indexed_metadata,void 0===e.searchable_metadata?{}:e.searchable_metadata,void 0===e.exact_matching_metadata?[]:e.exact_matching_metadata,void 0===e.suggest?[]:e.suggest):t.create(s.ItemUUID.createFromArray(e.uuid),void 0===e.metadata?{}:e.metadata,void 0===e.indexed_metadata?{}:e.indexed_metadata,void 0===e.searchable_metadata?{}:e.searchable_metadata,void 0===e.exact_matching_metadata?[]:e.exact_matching_metadata,void 0===e.suggest?[]:e.suggest);return void 0!==e.distance&&null!=e.distance&&(r.distance=e.distance),"object"==typeof e.highlights&&null!=e.distance&&(r.highlights=e.highlights),void 0!==e.is_promoted&&null!=e.is_promoted&&(r.promoted=e.is_promoted),void 0!==e.score&&null!=e.score&&(r.score=e.score),r},t.prototype.composeUUID=function(){return this.uuid.composedUUID()},t.getPathByField=function(t){return["id","type"].indexOf(t)>-1?"uuid."+t:"indexed_metadata."+t},t}();e.Item=a},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),o=r(7),i=r(8),s=r(5),a=r(24),u=r(10),c=r(4),f=r(4),l=r(10),d=r(2),p=r(4),h=r(25),g=r(11);e.QUERY_DEFAULT_FROM=0,e.QUERY_DEFAULT_PAGE=1,e.QUERY_DEFAULT_SIZE=10,e.QUERY_INFINITE_SIZE=1e3,e.NO_MIN_SCORE=0;var y=function(){function t(t){this.fields=[],this.universeFilters={},this.filters={},this.itemsPromoted=[],this.aggregations={},this.resultsEnabled=!0,this.aggregationsEnabled=!0,this.suggestionsEnabled=!1,this.highlightsEnabled=!1,this.filterFields=[],this.minScore=e.NO_MIN_SCORE,this.sortByInstance=g.SortBy.create(),this.filters._query=c.Filter.create("",[t],0,p.FILTER_TYPE_QUERY)}return t.createLocated=function(r,n,o,i){void 0===o&&(o=e.QUERY_DEFAULT_PAGE),void 0===i&&(i=e.QUERY_DEFAULT_SIZE);var s=t.create(n,o,i);return s.coordinate=r,s},t.create=function(r,n,o){void 0===n&&(n=e.QUERY_DEFAULT_PAGE),void 0===o&&(o=e.QUERY_DEFAULT_SIZE),n=Math.max(1,n);var i=new t(r);return i.from=(n-1)*o,i.size=o,i.page=n,i},t.createMatchAll=function(){return t.create("",e.QUERY_DEFAULT_PAGE,e.QUERY_DEFAULT_SIZE)},t.createByUUID=function(e){return t.createByUUIDs(e)},t.createByUUIDs=function(){for(var r=[],n=0;n0?this.universeFilters=n.__assign({},this.universeFilters,((e={}).type=c.Filter.create(r,t,f.FILTER_AT_LEAST_ONE,f.FILTER_TYPE_FIELD),e)):delete this.universeFilters.type,this},t.prototype.filterByTypes=function(t,e,r){var o,i;void 0===e&&(e=!0),void 0===r&&(r=l.AGGREGATION_SORT_BY_COUNT_DESC);var a=s.Item.getPathByField("type");return t.length>0?this.filters=n.__assign({},this.filters,((o={}).type=c.Filter.create(a,t,f.FILTER_AT_LEAST_ONE,f.FILTER_TYPE_FIELD),o)):delete this.filters.type,e&&(this.aggregations=n.__assign({},this.aggregations,((i={}).type=u.Aggregation.create("type",a,f.FILTER_AT_LEAST_ONE,f.FILTER_TYPE_FIELD,[],r),i))),this},t.prototype.filterUniverseByIds=function(t){var e,r=s.Item.getPathByField("id");return t.length>0?this.universeFilters=n.__assign({},this.universeFilters,((e={}).id=c.Filter.create(r,t,f.FILTER_AT_LEAST_ONE,f.FILTER_TYPE_FIELD),e)):delete this.universeFilters.id,this},t.prototype.filterByIds=function(t){var e,r=s.Item.getPathByField("id");return t.length>0?this.filters=n.__assign({},this.filters,((e={}).id=c.Filter.create(r,t,f.FILTER_AT_LEAST_ONE,f.FILTER_TYPE_FIELD),e)):delete this.filters.id,this},t.prototype.filterUniverseBy=function(t,e,r){var o;void 0===r&&(r=f.FILTER_AT_LEAST_ONE);var i=s.Item.getPathByField(t);return e.length>0?this.universeFilters=n.__assign({},this.universeFilters,((o={})[t]=c.Filter.create(i,e,r,f.FILTER_TYPE_FIELD),o)):delete this.universeFilters[t],this},t.prototype.filterBy=function(t,e,r,o,i,a){var u;void 0===o&&(o=f.FILTER_AT_LEAST_ONE),void 0===i&&(i=!0),void 0===a&&(a=l.AGGREGATION_SORT_BY_COUNT_DESC);var d=s.Item.getPathByField(e);return r.length>0?this.filters=n.__assign({},this.filters,((u={})[t]=c.Filter.create(d,r,o,f.FILTER_TYPE_FIELD),u)):delete this.filters[t],i&&this.aggregateBy(t,e,o,a),this},t.prototype.filterUniverseByRange=function(t,e,r,o){var i;void 0===r&&(r=f.FILTER_AT_LEAST_ONE),void 0===o&&(o=f.FILTER_TYPE_RANGE);var a=s.Item.getPathByField(t);return e.length>0?this.universeFilters=n.__assign({},this.universeFilters,((i={})[t]=c.Filter.create(a,e,r,o),i)):delete this.universeFilters[t],this},t.prototype.filterUniverseByDateRange=function(t,e,r){return void 0===r&&(r=f.FILTER_AT_LEAST_ONE),this.filterUniverseByRange(t,e,r,f.FILTER_TYPE_DATE_RANGE)},t.prototype.filterByRange=function(t,e,r,o,i,a,u,d){var p;void 0===i&&(i=f.FILTER_AT_LEAST_ONE),void 0===a&&(a=f.FILTER_TYPE_RANGE),void 0===u&&(u=!0),void 0===d&&(d=l.AGGREGATION_SORT_BY_COUNT_DESC);var h=s.Item.getPathByField(e);return 0!==o.length?this.filters=n.__assign({},this.filters,((p={})[t]=c.Filter.create(h,o,i,a),p)):delete this.filters[t],u&&this.aggregateByRange(t,h,r,i,a,d),this},t.prototype.filterByDateRange=function(t,e,r,n,o,i,s){return void 0===o&&(o=f.FILTER_AT_LEAST_ONE),void 0===i&&(i=!0),void 0===s&&(s=l.AGGREGATION_SORT_BY_COUNT_DESC),this.filterByRange(t,e,r,n,o,f.FILTER_TYPE_DATE_RANGE,i,s)},t.prototype.filterUniverseByLocation=function(t){var e;return this.universeFilters=n.__assign({},this.universeFilters,((e={}).coordinate=c.Filter.create("coordinate",t.toArray(),f.FILTER_AT_LEAST_ONE,f.FILTER_TYPE_GEO),e)),this},t.prototype.setFilterFields=function(t){return this.filterFields=t,this},t.prototype.getFilterFields=function(){return this.filterFields},t.prototype.sortBy=function(t){if(t.isSortedByGeoDistance()){if(!(this.coordinate instanceof o.Coordinate))throw d.InvalidFormatError.querySortedByDistanceWithoutCoordinate();t.setCoordinate(this.coordinate)}return this.sortByInstance=t,this},t.prototype.aggregateBy=function(t,e,r,o,i){var a;return void 0===o&&(o=l.AGGREGATION_SORT_BY_COUNT_DESC),void 0===i&&(i=l.AGGREGATION_NO_LIMIT),this.aggregations=n.__assign({},this.aggregations,((a={})[t]=u.Aggregation.create(t,s.Item.getPathByField(e),r,f.FILTER_TYPE_FIELD,[],o,i),a)),this},t.prototype.aggregateByRange=function(t,e,r,o,i,a,c){var d;return void 0===i&&(i=f.FILTER_TYPE_RANGE),void 0===a&&(a=l.AGGREGATION_SORT_BY_COUNT_DESC),void 0===c&&(c=l.AGGREGATION_NO_LIMIT),0===r.length?this:(this.aggregations=n.__assign({},this.aggregations,((d={})[t]=u.Aggregation.create(t,s.Item.getPathByField(e),o,i,r,a,c),d)),this)},t.prototype.aggregateByDateRange=function(t,e,r,n,o,i){return void 0===o&&(o=l.AGGREGATION_SORT_BY_COUNT_DESC),void 0===i&&(i=l.AGGREGATION_NO_LIMIT),this.aggregateByRange(t,e,r,n,f.FILTER_TYPE_DATE_RANGE,o,i)},t.prototype.getAggregations=function(){return this.aggregations},t.prototype.getAggregation=function(t){return this.aggregations[t]instanceof u.Aggregation?this.aggregations[t]:null},t.prototype.getQueryText=function(){var t=this.filters._query;return t instanceof c.Filter?t.getValues()[0]:""},t.prototype.getUniverseFilters=function(){return this.universeFilters},t.prototype.getUniverseFilter=function(t){return this.universeFilters[t]instanceof c.Filter?this.universeFilters[t]:null},t.prototype.getFilters=function(){return this.filters},t.prototype.getFilter=function(t){return this.filters[t]instanceof c.Filter?this.filters[t]:null},t.prototype.getFilterByField=function(t){var e=s.Item.getPathByField(t);for(var r in this.filters)if(this.filters[r].getField()==e)return this.filters[r];return null},t.prototype.getSortBy=function(){return this.sortByInstance},t.prototype.getFrom=function(){return this.from},t.prototype.getSize=function(){return this.size},t.prototype.getPage=function(){return this.page},t.prototype.enableResults=function(){return this.resultsEnabled=!0,this},t.prototype.disableResults=function(){return this.resultsEnabled=!1,this},t.prototype.areResultsEnabled=function(){return this.resultsEnabled},t.prototype.enableAggregations=function(){return this.aggregationsEnabled=!0,this},t.prototype.disableAggregations=function(){return this.aggregationsEnabled=!1,this},t.prototype.areAggregationsEnabled=function(){return this.aggregationsEnabled},t.prototype.enableSuggestions=function(){return this.suggestionsEnabled=!0,this},t.prototype.disableSuggestions=function(){return this.suggestionsEnabled=!1,this},t.prototype.areSuggestionsEnabled=function(){return this.suggestionsEnabled},t.prototype.enableHighlights=function(){return this.highlightsEnabled=!0,this},t.prototype.disableHighlights=function(){return this.highlightsEnabled=!1,this},t.prototype.areHighlightsEnabled=function(){return this.highlightsEnabled},t.prototype.promoteUUID=function(t){return this.itemsPromoted.push(t),this},t.prototype.promoteUUIDs=function(){for(var t=[],e=0;e0&&(t.fields=this.fields),Object.keys(this.universeFilters).length)for(var r in t.universe_filters={},this.universeFilters){var n=this.universeFilters[r];t.universe_filters[r]=n.toArray()}if(this.filters instanceof Object&&Object.keys(this.filters).length)for(var r in t.filters={},this.filters){var i=this.filters[r];i.getFilterType()!==p.FILTER_TYPE_QUERY&&(t.filters[r]=i.toArray())}if(this.aggregations instanceof Object&&Object.keys(this.aggregations).length)for(var r in t.aggregations={},this.aggregations){var s=this.aggregations[r];t.aggregations[r]=s.toArray()}var u=this.sortByInstance.toArray();Object.keys(u).length&&(t.sort=u);var c=this.page;c!==e.QUERY_DEFAULT_PAGE&&(t.page=c);var f=this.size;if(f!==e.QUERY_DEFAULT_SIZE&&(t.size=f),!1===this.resultsEnabled&&(t.results_enabled=!1),!0===this.suggestionsEnabled&&(t.suggestions_enabled=!0),!0===this.highlightsEnabled&&(t.highlights_enabled=!0),!1===this.aggregationsEnabled&&(t.aggregations_enabled=!1),this.filterFields instanceof Array&&this.filterFields.length>0&&(t.filter_fields=this.filterFields),this.scoreStrategies instanceof h.ScoreStrategies){var l=this.scoreStrategies.toArray();Object.keys(l).length>0&&(t.score_strategies=l)}null!==this.fuzziness&&(t.fuzziness=this.fuzziness);var d=this.minScore;if(d!==e.NO_MIN_SCORE&&(t.min_score=d),this.user instanceof a.User){var g=this.user.toArray();Object.keys(g).length>0&&(t.user=g)}if(this.itemsPromoted.length>0)for(var r in t.items_promoted=[],this.itemsPromoted)t.items_promoted.push(this.itemsPromoted[r].toArray());return t},t.createFromArray=function(r){var n=r.coordinate instanceof Object?t.createLocated(o.Coordinate.createFromArray(r.coordinate),r.q?r.q:"",r.page?r.page:e.QUERY_DEFAULT_PAGE,r.size?r.size:e.QUERY_DEFAULT_SIZE):t.create(r.q?r.q:"",r.page?r.page:e.QUERY_DEFAULT_PAGE,r.size?r.size:e.QUERY_DEFAULT_SIZE);n.fields=r.fields instanceof Array?r.fields:[];var s=typeof r.aggregations==typeof{}?r.aggregations:{};for(var f in s)n.aggregations[f]=u.Aggregation.createFromArray(s[f]);var l=typeof r.sort==typeof{}?r.sort:{};Object.keys(l).length>0&&(n.sortByInstance=g.SortBy.createFromArray(l));var d=typeof r.filters==typeof{}?r.filters:{};for(var f in d)n.filters[f]=c.Filter.createFromArray(d[f]);var p=typeof r.universe_filters==typeof{}?r.universe_filters:{};for(var f in p)n.universeFilters[f]=c.Filter.createFromArray(p[f]);n.resultsEnabled="boolean"!=typeof r.results_enabled||r.results_enabled,n.suggestionsEnabled="boolean"==typeof r.suggestions_enabled&&r.suggestions_enabled,n.aggregationsEnabled="boolean"!=typeof r.aggregations_enabled||r.aggregations_enabled,n.highlightsEnabled="boolean"==typeof r.highlights_enabled&&r.highlights_enabled,n.fuzziness=r.fuzziness,n.minScore=r.min_score?r.min_score:e.NO_MIN_SCORE;var y=typeof r.items_promoted==typeof{}?r.items_promoted:{};for(var f in y)n.itemsPromoted.push(i.ItemUUID.createFromArray(y[f]));return n.filterFields=r.filter_fields instanceof Array?r.filter_fields:[],n.scoreStrategies=r.score_strategies instanceof Object?h.ScoreStrategies.createFromArray(r.score_strategies):null,n.user=r.user instanceof Object?a.User.createFromArray(r.user):null,n},t}();e.Query=y},function(t,e,r){"use strict";e.__esModule=!0;var n=r(2),o=function(){function t(t,e){this.lat=t,this.lon=e}return t.prototype.getLatitude=function(){return this.lat},t.prototype.getLongitude=function(){return this.lon},t.prototype.toArray=function(){return{lat:this.lat,lon:this.lon}},t.createFromArray=function(e){if(void 0===e.lat||void 0===e.lon)throw n.InvalidFormatError.coordinateFormatNotValid();return new t(e.lat,e.lon)},t}();e.Coordinate=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(2),o=function(){function t(t,e){this.id=t,this.type=e}return t.createByComposedUUID=function(e){var r=e.split("~");if(2!=r.length)throw n.InvalidFormatError.composedItemUUIDNotValid();return new t(r[0],r[1])},t.prototype.getId=function(){return this.id},t.prototype.getType=function(){return this.type},t.prototype.toArray=function(){return{id:this.id,type:this.type}},t.createFromArray=function(e){return new t((e=JSON.parse(JSON.stringify(e))).id,e.type)},t.prototype.composedUUID=function(){return this.id+"~"+this.type},t}();e.ItemUUID=o},function(t,e,r){"use strict";(function(e){var n=r(1),o=r(46),i={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!n.isUndefined(t)&&n.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var a={adapter:function(){var t;return"undefined"!=typeof XMLHttpRequest?t=r(16):void 0!==e&&(t=r(16)),t}(),transformRequest:[function(t,e){return o(e,"Content-Type"),n.isFormData(t)||n.isArrayBuffer(t)||n.isBuffer(t)||n.isStream(t)||n.isFile(t)||n.isBlob(t)?t:n.isArrayBufferView(t)?t.buffer:n.isURLSearchParams(t)?(s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):n.isObject(t)?(s(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],function(t){a.headers[t]={}}),n.forEach(["post","put","patch"],function(t){a.headers[t]=n.merge(i)}),t.exports=a}).call(this,r(45))},function(t,e,r){"use strict";e.__esModule=!0;var n=r(4);e.AGGREGATION_SORT_BY_COUNT_ASC=["_count","asc"],e.AGGREGATION_SORT_BY_COUNT_DESC=["_count","desc"],e.AGGREGATION_SORT_BY_NAME_ASC=["_term","asc"],e.AGGREGATION_SORT_BY_NAME_DESC=["_term","desc"],e.AGGREGATION_NO_LIMIT=0;var o=function(){function t(t,e,r,n,o,i,s){this.subgroup=[],this.name=t,this.field=e,this.applicationType=r,this.filterType=n,this.subgroup=o,this.sort=i,this.limit=s}return t.prototype.getName=function(){return this.name},t.prototype.getField=function(){return this.field},t.prototype.getApplicationType=function(){return this.applicationType},t.prototype.getFilterType=function(){return this.filterType},t.prototype.getSubgroup=function(){return this.subgroup},t.prototype.getSort=function(){return this.sort},t.prototype.getLimit=function(){return this.limit},t.create=function(r,n,o,i,s,a,u){return void 0===s&&(s=[]),void 0===a&&(a=e.AGGREGATION_SORT_BY_COUNT_DESC),void 0===u&&(u=e.AGGREGATION_NO_LIMIT),new t(r,n,o,i,s,a,u)},t.prototype.toArray=function(){var t={name:this.name};return"uuid.type"!=this.field&&(t.field=this.field),this.applicationType!=n.FILTER_AT_LEAST_ONE&&(t.application_type=this.applicationType),this.filterType!=n.FILTER_TYPE_FIELD&&(t.filter_type=this.filterType),this.subgroup.length>0&&(t.subgroup=this.subgroup),JSON.stringify(this.sort)!==JSON.stringify(e.AGGREGATION_SORT_BY_COUNT_DESC)&&(t.sort=this.sort),this.limit!=e.AGGREGATION_NO_LIMIT&&(t.limit=this.limit),t},t.createFromArray=function(r){return void 0===(r=JSON.parse(JSON.stringify(r))).field&&(r.field="uuid.type"),void 0===r.application_type&&(r.application_type=n.FILTER_AT_LEAST_ONE),void 0===r.filter_type&&(r.filter_type=n.FILTER_TYPE_FIELD),void 0===r.subgroup&&(r.subgroup=[]),void 0===r.sort&&(r.sort=e.AGGREGATION_SORT_BY_COUNT_DESC),void 0===r.limit&&(r.limit=e.AGGREGATION_NO_LIMIT),t.create(r.name,r.field,r.application_type,r.filter_type,r.subgroup,r.sort,r.limit)},t}();e.Aggregation=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(5);e.SORT_BY_TYPE_FIELD=1,e.SORT_BY_TYPE_NESTED=2,e.SORT_BY_ASC="asc",e.SORT_BY_DESC="desc",e.SORT_BY_MODE_AVG="avg",e.SORT_BY_MODE_SUM="sum",e.SORT_BY_MODE_MIN="min",e.SORT_BY_MODE_MAX="max",e.SORT_BY_MODE_MEDIAN="median",e.SORT_BY_SCORE={_score:{order:e.SORT_BY_ASC}},e.SORT_BY_RANDOM={random:{order:e.SORT_BY_ASC}},e.SORT_BY_AL_TUN_TUN=e.SORT_BY_RANDOM,e.SORT_BY_ID_ASC={"uuid.id":{order:e.SORT_BY_ASC}},e.SORT_BY_ID_DESC={"uuid.id":{order:e.SORT_BY_DESC}},e.SORT_BY_TYPE_ASC={"uuid.type":{order:e.SORT_BY_ASC}},e.SORT_BY_TYPE_DESC={"uuid.type":{order:e.SORT_BY_DESC}},e.SORT_BY_LOCATION_KM_ASC={_geo_distance:{order:e.SORT_BY_ASC,unit:"km"}},e.SORT_BY_LOCATION_MI_ASC={_geo_distance:{order:e.SORT_BY_DESC,unit:"mi"}};var o=r(7),i=r(4),s=function(){function t(){this.sortsBy=[]}return t.create=function(){return new t},t.byFieldsValues=function(e){var r=t.create();for(var n in e)r.byFieldValue(n,e[n]);return r},t.prototype.all=function(){return this.sortsBy.length>0?this.sortsBy:[e.SORT_BY_SCORE]},t.prototype.byValue=function(t){return e.SORT_BY_SCORE!=t&&e.SORT_BY_RANDOM!=t&&void 0===t.type&&(t.type=e.SORT_BY_TYPE_FIELD),e.SORT_BY_SCORE!=t&&this.sortsBy.push(t),this},t.prototype.byFieldValue=function(t,r){var n={type:e.SORT_BY_TYPE_FIELD};return n["indexed_metadata."+t]={order:r},this.sortsBy.push(n),this},t.prototype.byNestedField=function(t,r,n){void 0===n&&(n=e.SORT_BY_MODE_AVG);var o={type:e.SORT_BY_TYPE_NESTED,mode:n};return o["indexed_metadata."+t]={order:r},this.sortsBy.push(o),this},t.prototype.byNestedFieldAndFilter=function(t,r,o,s){void 0===s&&(s=e.SORT_BY_MODE_AVG);var a=n.Item.getPathByField(o.getField()),u=o.toArray();u.field=a,o=i.Filter.createFromArray(u);var c={type:e.SORT_BY_TYPE_NESTED,mode:s,filter:o};return c["indexed_metadata."+t]={order:r},this.sortsBy.push(c),this},t.prototype.isSortedByGeoDistance=function(){for(var t in this.sortsBy)if(typeof this.sortsBy[t]._geo_distance==typeof{})return!0;return!1},t.prototype.setCoordinate=function(t){for(var e in this.sortsBy)typeof this.sortsBy[e]._geo_distance==typeof{}&&(this.sortsBy[e]._geo_distance.coordinate=t);return this},t.prototype.hasRandomSort=function(){for(var t in this.sortsBy)if(JSON.stringify(this.sortsBy[t])===JSON.stringify(e.SORT_BY_RANDOM))return!0;return!1},t.prototype.toArray=function(){var t=this.copy().sortsBy;for(var r in t)t[r].type==e.SORT_BY_TYPE_FIELD&&delete t[r].type,typeof t[r].filter==typeof{}&&null!=t[r].filter&&(t[r].filter=t[r].filter.toArray()),typeof t[r]._geo_distance==typeof{}&&null!==t[r]._geo_distance&&t[r]._geo_distance.coordinate instanceof o.Coordinate&&(t[r]._geo_distance.coordinate=t[r]._geo_distance.coordinate.toArray());return t},t.createFromArray=function(r){var n=JSON.parse(JSON.stringify(r)),s=t.create();for(var a in n){var u=n[a];JSON.stringify(u)!==JSON.stringify(e.SORT_BY_RANDOM)&&JSON.stringify(u)!==JSON.stringify(e.SORT_BY_SCORE)&&void 0===u.type&&(u.type=e.SORT_BY_TYPE_FIELD),typeof u.filter==typeof{}&&null!=u.filter&&(u.filter=i.Filter.createFromArray(u.filter)),typeof u._geo_distance==typeof{}&&null!=u._geo_distance&&typeof u._geo_distance.coordinate==typeof{}&&(u._geo_distance.coordinate=o.Coordinate.createFromArray(u._geo_distance.coordinate)),s.sortsBy.push(u)}return s},t.prototype.copy=function(){var e=t.create();for(var r in this.sortsBy){var n=this.sortsBy[r],s=JSON.parse(JSON.stringify(n));typeof n.filter==typeof{}&&null!=n.filter&&(s.filter=i.Filter.createFromArray(n.filter.toArray())),typeof n._geo_distance==typeof{}&&null!=n._geo_distance&&typeof n._geo_distance.coordinate==typeof{}&&(s._geo_distance.coordinate=o.Coordinate.createFromArray(n._geo_distance.coordinate.toArray())),e.sortsBy.push(s)}return e},t}();e.SortBy=s},function(t,e,r){"use strict";e.__esModule=!0;var n=r(5),o=r(6),i=r(13),s=function(){function t(t,e,r){this.items=[],this.suggests=[],this.query=t,this.totalItems=e,this.totalHits=r}return t.create=function(e,r,n,o,i,s){var a=new t(e,r,n);return a.aggregations=o,a.suggests=i,a.items=s,a},t.prototype.addItem=function(t){this.items.push(t)},t.prototype.getItems=function(){return this.items},t.prototype.getItemsGroupedByTypes=function(){if(this.itemsGroupedByTypeCache instanceof Object&&Object.keys(this.itemsGroupedByTypeCache).length>0)return this.itemsGroupedByTypeCache;var t={};for(var e in this.items){var r=this.items[e];t[r.getType()]instanceof Array||(t[r.getType()]=[]),t[r.getType()].push(r)}return this.itemsGroupedByTypeCache=t,t},t.prototype.getItemsByType=function(t){var e=this.getItemsGroupedByTypes();return null==e[t]?[]:e[t]},t.prototype.getItemsByTypes=function(t){return this.items.filter(function(e){return t.indexOf(e.getType())>=0})},t.prototype.getFirstItem=function(){return this.items.length>0?this.items[0]:null},t.prototype.setAggregations=function(t){this.aggregations=t},t.prototype.getAggregations=function(){return this.aggregations instanceof i.ResultAggregations?this.aggregations:null},t.prototype.getAggregation=function(t){return null==this.aggregations?null:this.aggregations.getAggregation(t)},t.prototype.hasNotEmptyAggregation=function(t){return null!=this.aggregations&&this.aggregations.hasNotEmptyAggregation(t)},t.prototype.addSuggest=function(t){this.suggests.push(t)},t.prototype.getSuggests=function(){return this.suggests},t.prototype.getQuery=function(){return this.query},t.prototype.getTotalItems=function(){return this.totalItems},t.prototype.getTotalHits=function(){return this.totalHits},t.prototype.toArray=function(){return{query:this.query.toArray(),total_items:this.totalItems,total_hits:this.totalHits,items:this.items.map(function(t){return t.toArray()}),aggregations:null==this.aggregations?null:this.aggregations.toArray(),suggests:this.suggests}},t.createFromArray=function(e){return t.create(o.Query.createFromArray(e.query),e.total_items?e.total_items:0,e.total_hits?e.total_hits:0,e.aggregations instanceof Object?i.ResultAggregations.createFromArray(e.aggregations):null,e.suggests?e.suggests:null,e.items instanceof Array?e.items.map(function(t){return n.Item.createFromArray(t)}):[])},t}();e.Result=s},function(t,e,r){"use strict";e.__esModule=!0;var n=r(32),o=function(){function t(t){this.aggregations={},this.totalElements=t}return t.prototype.addAggregation=function(t,e){this.aggregations[t]=e},t.prototype.getAggregations=function(){return this.aggregations},t.prototype.getAggregation=function(t){return this.aggregations[t]instanceof n.ResultAggregation?this.aggregations[t]:null},t.prototype.hasNotEmptyAggregation=function(t){var e=this.getAggregation(t);return e instanceof n.ResultAggregation&&!e.isEmpty()},t.prototype.getTotalElements=function(){return this.totalElements},t.prototype.toArray=function(){var t={};for(var e in this.aggregations)t[e]=this.aggregations[e].toArray();var r={};return this.totalElements>0&&(r.total_elements=this.totalElements),Object.keys(t).length>0&&(r.aggregations=t),r},t.createFromArray=function(e){var r=new t("number"==typeof e.total_elements?e.total_elements:0);if(typeof e.aggregations==typeof{})for(var o in e.aggregations)r.addAggregation(o,n.ResultAggregation.createFromArray(e.aggregations[o]));return r},t}();e.ResultAggregations=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),o=r(41),i=r(20),s=r(21),a=function(t){function e(e,r,n,o,i,s){var a=t.call(this,r,o)||this;return a.host=e,a.timeout=n,a.cache=s,a.overrideQueries=i,a.cancelToken={},a}return n.__extends(e,t),e.prototype.get=function(t,e,r,a,u){return void 0===a&&(a={}),void 0===u&&(u={}),n.__awaiter(this,void 0,void 0,function(){var c,f=this;return n.__generator(this,function(l){return c=this,t=t.replace(/^\/*|\/*$/g,""),t="/"+(this.version+"/"+t).replace(/^\/*|\/*$/g,""),"get"===(e=e.toLowerCase())&&this.overrideQueries&&this.abort(t),[2,new Promise(function(l,d){var p="get"==e?{}:{"Content-Encoding":"gzip","Content-Type":"application/json"},h={url:t+"?"+i.Client.objectToUrlParameters(n.__assign({},r,a)),data:u,headers:p,method:e,baseURL:c.host.replace(/\/*$/g,""),timeout:c.timeout,transformRequest:[function(t){return JSON.stringify(t)}]};void 0!==f.cancelToken[t]&&(h.cancelToken=f.cancelToken[t].token),o.default.request(h).then(function(t){var e=new s.Response(t.status,t.data);return l(e)}).catch(function(t){if(void 0!==t.response){var e=new s.Response(t.response.status,t.response.data);return d(e)}})})]})})},e.prototype.abort=function(t){void 0!==this.cancelToken[t]&&this.cancelToken[t].cancel(),this.generateCancelToken(t)},e.prototype.generateCancelToken=function(t){this.cancelToken[t]=o.default.CancelToken.source()},e}(i.Client);e.AxiosClient=a},function(t,e,r){"use strict";t.exports=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n0&&(t.attributes=this.attributes),t},t.createFromArray=function(e){if(null==e||void 0===e.id||null==e.id)throw n.InvalidFormatError.userFormatNotValid();var r=typeof e.attributes==typeof{}?e.attributes:{};return new t(e.id,r)},t}();e.User=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(26);e.MULTIPLY="multiply",e.SUM="sum",e.AVG="avg",e.MAX="max",e.MIN="min";var o=function(){function t(){this.scoreStrategies=[]}return t.createEmpty=function(r){void 0===r&&(r=e.SUM);var n=new t;return n.scoreMode=r,n},t.prototype.addScoreStrategy=function(t){return this.scoreStrategies.push(t),this},t.prototype.getScoreStrategies=function(){return this.scoreStrategies},t.prototype.getScoreMode=function(){return this.scoreMode},t.prototype.toArray=function(){var t=[];for(var e in this.scoreStrategies)t.push(this.scoreStrategies[e].toArray());return{score_mode:this.scoreMode,score_strategies:t}},t.createFromArray=function(e){var r=void 0!==(e=JSON.parse(JSON.stringify(e))).score_mode?t.createEmpty(e.score_mode):t.createEmpty();for(var o in r.scoreStrategies=[],e.score_strategies)r.scoreStrategies.push(n.ScoreStrategy.createFromArray(e.score_strategies[o]));return r},t}();e.ScoreStrategies=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(5),o=r(4);e.DEFAULT_TYPE="default",e.DEFAULT_WEIGHT=1,e.BOOSTING_FIELD_VALUE="field_value",e.CUSTOM_FUNCTION="custom_function",e.DECAY="decay",e.DECAY_LINEAR="linear",e.DECAY_EXP="exp",e.DECAY_GAUSS="gauss",e.MODIFIER_NONE="none",e.MODIFIER_SQRT="sqrt",e.MODIFIER_LOG="log",e.MODIFIER_LN="ln",e.MODIFIER_SQUARE="square",e.SCORE_MODE_NONE="none",e.SCORE_MODE_SUM="sum",e.SCORE_MODE_AVG="avg",e.SCORE_MODE_MAX="max",e.SCORE_MODE_MIN="min",e.DEFAULT_MISSING=1,e.DEFAULT_FACTOR=1;var i=function(){function t(){this.type=e.DEFAULT_TYPE,this.filter=null,this.weight=e.DEFAULT_WEIGHT,this.scoreMode=e.SCORE_MODE_AVG,this.configuration={}}return t.prototype.getType=function(){return this.type},t.prototype.getConfigurationValue=function(t){return void 0===this.configuration[t]?null:this.configuration[t]},t.prototype.getWeight=function(){return this.weight},t.prototype.getScoreMode=function(){return this.scoreMode},t.prototype.getFilter=function(){return this.filter},t.createDefault=function(){return new t},t.createFieldBoosting=function(r,n,o,i,s,a,u){void 0===n&&(n=e.DEFAULT_FACTOR),void 0===o&&(o=e.DEFAULT_MISSING),void 0===i&&(i=e.MODIFIER_NONE),void 0===s&&(s=e.DEFAULT_WEIGHT),void 0===a&&(a=null),void 0===u&&(u=e.SCORE_MODE_AVG);var c=t.createDefault();return c.type=e.BOOSTING_FIELD_VALUE,c.configuration.field=r,c.configuration.factor=n,c.configuration.missing=o,c.configuration.modifier=i,c.weight=s,c.filter=t.fixFilterFieldPath(a),c.scoreMode=u,c},t.createCustomFunction=function(r,n,o,i){void 0===n&&(n=e.DEFAULT_WEIGHT),void 0===o&&(o=null),void 0===i&&(i=e.SCORE_MODE_AVG);var s=t.createDefault();return s.type=e.CUSTOM_FUNCTION,s.configuration.function=r,s.weight=n,s.filter=t.fixFilterFieldPath(o),s.scoreMode=i,s},t.createDecayFunction=function(r,n,o,i,s,a,u,c,f){void 0===u&&(u=e.DEFAULT_WEIGHT),void 0===c&&(c=null),void 0===f&&(f=e.SCORE_MODE_AVG);var l=t.createDefault();return l.type=e.DECAY,l.configuration.type=r,l.configuration.field=n,l.configuration.origin=o,l.configuration.scale=i,l.configuration.offset=s,l.configuration.decay=a,l.weight=u,l.filter=t.fixFilterFieldPath(c),l.scoreMode=f,l},t.fixFilterFieldPath=function(t){if(null==t)return t;var e=t.toArray();return e.field=n.Item.getPathByField(e.field),o.Filter.createFromArray(e)},t.prototype.toArray=function(){return{type:this.type,configuration:this.configuration,weight:this.weight,score_mode:this.scoreMode,filter:this.filter instanceof o.Filter?this.filter.toArray():null}},t.createFromArray=function(e){e=JSON.parse(JSON.stringify(e));var r=t.createDefault();return void 0!==e.type&&(r.type=e.type),void 0!==e.configuration&&(r.configuration=e.configuration),void 0!==e.weight&&(r.weight=e.weight),void 0!==e.score_mode&&(r.scoreMode=e.score_mode),"object"==typeof e.filter&&null!==e.filter&&(r.filter=o.Filter.createFromArray(e.filter)),r},t}();e.ScoreStrategy=i},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),o=r(28),i=r(2),s=r(29),a=r(30),u=r(31),c=r(5),f=r(8),l=r(12),d=r(35),p=r(61),h=function(t){function e(e,r,n,o,i){var s=t.call(this,r,n,o)||this;return s.httpClient=e,s.transformer=i,s}return n.__extends(e,t),e.prototype.getTransformer=function(){return this.transformer},e.prototype.addObject=function(t){var e=this.transformer.toItem(t);e instanceof c.Item&&this.addItem(e)},e.prototype.deleteObject=function(t){var e=this.transformer.toItemUUID(t);e instanceof f.ItemUUID&&this.deleteItem(e)},e.prototype.flushUpdateItems=function(t){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(r){return 0===t.length?[2]:[2,this.httpClient.get("/items","post",this.getCredentialsWithIndex(this.indexId),{},{items:t.map(function(t){return t.toArray()})}).then(function(t){e.throwTransportableExceptionIfNeeded(t)})]})})},e.prototype.flushDeleteItems=function(t){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(r){return 0===t.length?[2]:[2,this.httpClient.get("/items","delete",this.getCredentialsWithIndex(this.indexId),{},{items:t.map(function(t){return t.toArray()})}).then(function(t){e.throwTransportableExceptionIfNeeded(t)})]})})},e.prototype.query=function(t){return n.__awaiter(this,void 0,void 0,function(){var r;return n.__generator(this,function(n){switch(n.label){case 0:return r=this,[4,this.httpClient.get("/","get",this.getCredentialsWithIndex(this.indexId),{query:JSON.stringify(t.toArray())},{}).then(function(t){e.throwTransportableExceptionIfNeeded(t);var n=l.Result.createFromArray(t.getBody());return l.Result.create(n.getQuery(),n.getTotalItems(),n.getTotalHits(),n.getAggregations(),n.getSuggests(),r.transformer.fromItems(n.getItems()))})];case 1:return[2,n.sent()]}})})},e.prototype.updateItems=function(t,r){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(n){switch(n.label){case 0:return[4,this.httpClient.get("/items","put",this.getCredentialsWithIndex(this.indexId),{},{query:t.toArray(),changes:r.toArray()}).then(function(t){e.throwTransportableExceptionIfNeeded(t)})];case 1:return[2,n.sent()]}})})},e.prototype.createIndex=function(t,r){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(n){switch(n.label){case 0:return[4,this.httpClient.get("/index","put",this.getCredentials(),{},{index:t.toArray(),config:r.toArray()}).then(function(t){e.throwTransportableExceptionIfNeeded(t)})];case 1:return[2,n.sent()]}})})},e.prototype.deleteIndex=function(t){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(t){switch(t.label){case 0:return[4,this.httpClient.get("/index","delete",this.getCredentialsWithIndex(this.indexId),{},{}).then(function(t){e.throwTransportableExceptionIfNeeded(t)})];case 1:return[2,t.sent()]}})})},e.prototype.resetIndex=function(t){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(t){switch(t.label){case 0:return[4,this.httpClient.get("/index/reset","post",this.getCredentialsWithIndex(this.indexId),{},{}).then(function(t){e.throwTransportableExceptionIfNeeded(t)})];case 1:return[2,t.sent()]}})})},e.prototype.checkIndex=function(t){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(t){switch(t.label){case 0:return[4,this.httpClient.get("/index","head",this.getCredentialsWithIndex(this.indexId),{},{}).then(function(t){return e.throwTransportableExceptionIfNeeded(t),200===t.getCode()})];case 1:return[2,t.sent()]}})})},e.prototype.getIndices=function(){return n.__awaiter(this,void 0,void 0,function(){return n.__generator(this,function(t){switch(t.label){case 0:return[4,this.httpClient.get("/indices","get",this.getCredentials(),{},{}).then(function(t){e.throwTransportableExceptionIfNeeded(t);for(var r=[],n=0,o=t.getBody();n0},t.prototype.hasLevels=function(){return(this.applicationType&o.FILTER_MUST_ALL_WITH_LEVELS)>0},t.prototype.getCounter=function(t){return this.counters[t]instanceof i.Counter?this.counters[t]:null},t.prototype.getAllElements=function(){return n.__assign({},this.activeElements,this.counters)},t.prototype.getTotalElements=function(){return this.totalElements},t.prototype.getActiveElements=function(){if(0===Object.keys(this.activeElements).length)return{};if(this.applicationType===o.FILTER_MUST_ALL_WITH_LEVELS){var t=null;for(var e in this.activeElements){var r=this.activeElements[e];r instanceof i.Counter&&(null==t&&(t=r),t=t.getLevel()>r.getLevel()?t:r)}return t instanceof i.Counter?{0:t}:null}return this.activeElements},t.prototype.cleanCountersByLevel=function(){for(var t in this.counters){this.counters[t].getLevel()!==this.highestActiveElement+1&&delete this.counters[t]}},t.prototype.isEmpty=function(){return 0==Object.keys(this.activeElements).length&&0==Object.keys(this.counters).length},t.prototype.toArray=function(){var t={name:this.name,counters:[],active_elements:[]};for(var e in this.counters)t.counters.push(this.counters[e].toArray());for(var e in this.applicationType!==o.FILTER_AT_LEAST_ONE&&(t.application_type=this.applicationType),this.totalElements>0&&(t.total_elements=this.totalElements),this.activeElements){var r=this.activeElements[e];t.active_elements.push(r instanceof i.Counter?r.toArray():r)}return this.highestActiveElement>0&&(t.highest_active_level=this.highestActiveElement),0===t.counters.length&&delete t.counters,0===t.active_elements.length&&delete t.active_elements,t},t.createFromArray=function(e){var r=[],n=e.active_elements;for(var s in n=typeof n==typeof[]?n:[]){var a=n[s];r.push(typeof a==typeof{}?i.Counter.createFromArray(a):a)}var u=new t(e.name,parseInt(e.application_type?e.application_type:o.FILTER_AT_LEAST_ONE),parseInt(e.total_elements?e.total_elements:0),[]);u.activeElements=r;var c=typeof e.counters==typeof[]?e.counters:[];for(var s in c){var f=c[s],l=i.Counter.createFromArray(f);u.counters[l.getId()]=l}return u.highestActiveElement="number"==typeof e.highest_active_level?e.highest_active_level:0,u},t}();e.ResultAggregation=s},function(t,e,r){"use strict";e.__esModule=!0;var n=r(34),o=function(){function t(t,e,r){this.values=t,this.used=e,this.n=r}return t.prototype.getId=function(){return"string"==typeof this.values.id?this.values.id:null},t.prototype.getName=function(){return"string"==typeof this.values.name?this.values.name:null},t.prototype.getSlug=function(){return"string"==typeof this.values.slug?this.values.slug:null},t.prototype.getLevel=function(){return"number"==typeof this.values.level?this.values.level:0},t.prototype.getValues=function(){return this.values},t.prototype.isUsed=function(){return this.used},t.prototype.getN=function(){return this.n},t.createByActiveElements=function(e,r,o){var i=n.Metadata.fromMetadata(e);if(null==i)return null;for(var s=o.length,a=!1;s--;)o[s]==i.id&&(a=!0);return new t(i,a,r)},t.prototype.toArray=function(){var t={values:this.values,n:this.n};return!0===this.used&&(t.used=!0),t},t.createFromArray=function(e){return new t((e=JSON.parse(JSON.stringify(e))).values,"boolean"==typeof e.used&&e.used,e.n)},t}();e.Counter=o},function(t,e,r){"use strict";e.__esModule=!0;var n=function(){function t(){}return t.toMetadata=function(t){t=JSON.parse(JSON.stringify(t));var e=[];for(var r in t)e.push(r+"##"+t[r]);return e.join("~~")},t.fromMetadata=function(t){var e={},r=t.split("~~"),n=0,o=0,i=null;for(var s in r){var a=r[s],u=a.split("##");u.length>1?(i=u[1],e[u[0]]=i):(i=a,e[n++]=i),o++}return 1==o&&(e={id:i,name:i}),void 0===e.id?null:e},t}();e.Metadata=n},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),o=function(){function t(t,e,r){this.itemsToUpdate=[],this.itemsToDelete=[],this.appId=t,this.indexId=e,this.token=r}return t.prototype.resetCachedElements=function(){this.itemsToUpdate=[],this.itemsToDelete=[]},t.prototype.addItem=function(t){this.itemsToUpdate.push(t)},t.prototype.addItems=function(t){for(var e in t)this.addItem(t[e])},t.prototype.deleteItem=function(t){this.itemsToDelete.push(t)},t.prototype.deleteItems=function(t){for(var e in t)this.deleteItem(t[e])},t.prototype.flush=function(e,r){return n.__awaiter(this,void 0,void 0,function(){var o=this;return n.__generator(this,function(n){return e||(e=500),r||(r=!1),r&&this.itemsToUpdate.length * @license MIT */ -t.exports=function(t){return null!=t&&(r(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&r(t.slice(0,0))}(t)||!!t._isBuffer)}},function(t,e,r){"use strict";var n=r(9),o=r(1),i=r(53),s=r(54);function a(t){this.defaults=t,this.interceptors={request:new i,response:new i}}a.prototype.request=function(t){"string"==typeof t&&(t=o.merge({url:arguments[0]},arguments[1])),(t=o.merge(n,this.defaults,{method:"get"},t)).method=t.method.toLowerCase();var e=[s,void 0],r=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)r=r.then(e.shift(),e.shift());return r},o.forEach(["delete","get","head","options"],function(t){a.prototype[t]=function(e,r){return this.request(o.merge(r||{},{method:t,url:e}))}}),o.forEach(["post","put","patch"],function(t){a.prototype[t]=function(e,r,n){return this.request(o.merge(n||{},{method:t,url:e,data:r}))}}),t.exports=a},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var u,c=[],f=!1,l=-1;function p(){f&&u&&(f=!1,u.length?c=u.concat(c):l=-1,c.length&&d())}function d(){if(!f){var t=a(p);f=!0;for(var e=c.length;e;){for(u=c,c=[];++l1)for(var r=1;r=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}}),s):s}},function(t,e,r){"use strict";var n=r(1);t.exports=n.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=o(window.location.href),function(e){var r=n.isString(e)?o(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0}},function(t,e,r){"use strict";var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function o(){this.message="String contains an invalid character"}o.prototype=new Error,o.prototype.code=5,o.prototype.name="InvalidCharacterError",t.exports=function(t){for(var e,r,i=String(t),s="",a=0,u=n;i.charAt(0|a)||(u="=",a%1);s+=u.charAt(63&e>>8-a%1*8)){if((r=i.charCodeAt(a+=.75))>255)throw new o;e=e<<8|r}return s}},function(t,e,r){"use strict";var n=r(1);t.exports=n.isStandardBrowserEnv()?{write:function(t,e,r,o,i,s){var a=[];a.push(t+"="+encodeURIComponent(e)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(o)&&a.push("path="+o),n.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,r){"use strict";var n=r(1);function o(){this.handlers=[]}o.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},o.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},o.prototype.forEach=function(t){n.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=o},function(t,e,r){"use strict";var n=r(1),o=r(55),i=r(18),s=r(9),a=r(56),u=r(57);function c(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return c(t),t.baseURL&&!a(t.url)&&(t.url=u(t.baseURL,t.url)),t.headers=t.headers||{},t.data=o(t.data,t.headers,t.transformRequest),t.headers=n.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),n.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||s.adapter)(t).then(function(e){return c(t),e.data=o(e.data,e.headers,t.transformResponse),e},function(e){return i(e)||(c(t),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(t,e,r){"use strict";var n=r(1);t.exports=function(t,e,r){return n.forEach(r,function(r){t=r(t,e)}),t}},function(t,e,r){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,r){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,r){"use strict";var n=r(19);function o(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(t){e=t});var r=this;t(function(t){r.reason||(r.reason=new n(t),e(r.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var t;return{token:new o(function(e){t=e}),cancel:t}},t.exports=o},function(t,e,r){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,r){"use strict";e.__esModule=!0;var n=r(2),o=r(61),i=r(62),s=function(){function t(t,e,r,n,o){void 0===r&&(r=!1),void 0===n&&(n=0),void 0===o&&(o="0kb"),this.uuid=t,this.appUUID=e,this.isOK=r,this.docCount=n,this.size=o}return t.prototype.getUUID=function(){return this.uuid},t.prototype.getAppUUID=function(){return this.appUUID},t.prototype.isOk=function(){return this.isOK},t.prototype.getDocCount=function(){return this.docCount},t.prototype.getSize=function(){return this.size},t.prototype.toArray=function(){return{uuid:this.uuid.toArray(),app_id:this.appUUID.toArray(),is_ok:this.isOK,doc_count:this.docCount,size:this.size}},t.createFromArray=function(e){if(void 0===e.uuid||void 0===e.app_id)throw n.InvalidFormatError.indexFormatNotValid();return new t(o.IndexUUID.createFromArray(e.uuid),i.AppUUID.createFromArray(e.app_id),void 0!==e.is_ok&&e.is_ok,void 0===e.doc_count?0:e.doc_count,void 0===e.size?"0kb":e.size)},t}();e.Index=s},function(t,e,r){"use strict";e.__esModule=!0;var n=r(2),o=function(){function t(t){if(t.indexOf("_")>=0)throw n.InvalidFormatError.indexUUIDFormatNotValid();this.id=t}return t.createById=function(e){return new t(e)},t.prototype.getId=function(){return this.id},t.prototype.toArray=function(){return{id:this.id}},t.createFromArray=function(e){return new t((e=JSON.parse(JSON.stringify(e))).id)},t.prototype.composedUUID=function(){return this.id},t}();e.IndexUUID=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(2),o=function(){function t(t){if(t.indexOf("_")>=0)throw n.InvalidFormatError.appUUIDFormatNotValid();this.id=t}return t.createById=function(e){return new t(e)},t.prototype.getId=function(){return this.id},t.prototype.toArray=function(){return{id:this.id}},t.createFromArray=function(e){return new t((e=JSON.parse(JSON.stringify(e))).id)},t.prototype.composedUUID=function(){return this.id},t}();e.AppUUID=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),o=function(){function t(){this.cache={},this.size=0,this.cache={},this.size=0}return t.prototype.set=function(t,e){var r;this.cache=n.__assign({},this.cache,((r={})[t]=e,r)),this.size=this.size+1},t.prototype.get=function(t){return this.cache[t]},t.prototype.del=function(t){delete this.cache[t]},t.prototype.clear=function(){this.cache={},this.size=0},t}();e.InMemoryCache=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(36),o=function(){function t(t,e){void 0===t&&(t=null),void 0===e&&(e=!0),this.synonyms=[],this.language=t,this.storeSearchableMetadata=e}return t.prototype.getLanguage=function(){return this.language},t.prototype.shouldSearchableMetadataBeStored=function(){return this.storeSearchableMetadata},t.prototype.addSynonym=function(t){this.synonyms.push(t)},t.prototype.getSynonyms=function(){return this.synonyms},t.prototype.toArray=function(){return{language:this.language,store_searchable_metadata:this.storeSearchableMetadata,synonyms:this.synonyms.map(function(t){return t.toArray()})}},t.createFromArray=function(e){var r=new t(e.language?e.language:null,"boolean"!=typeof e.store_searchable_metadata||e.store_searchable_metadata);return e.synonyms instanceof Array&&e.synonyms.length>0&&(r.synonyms=e.synonyms.map(function(t){return n.Synonym.createFromArray(t)})),r},t}();e.Config=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.throwEndpointNotAvailable=function(){return new e("Endpoint not available")},e}(r(3).ErrorWithMessage);e.EventError=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.getTransportableHTTPError=function(){return 403},e.createAppIdIsRequiredException=function(){return new e("AppId query parameter MUST be defined with a valid value")},e.createIndexIsRequiredException=function(){return new e("Index query parameter MUST be defined with a valid value")},e.createTokenIsRequiredException=function(){return new e("Token query parameter MUST be defined with a valid value")},e}(r(3).ErrorWithMessage);e.ForbiddenError=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.getTransportableHTTPError=function(){return 415},e.createUnsupportedContentTypeException=function(){return new e("This content type is not accepted. Please use application/json")},e}(r(3).ErrorWithMessage);e.UnsupportedContentTypeError=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),o=r(6),i=function(){function t(){}return t.fromFilterObject=function(t){throw TypeError("Method not valid")},t.prototype.toArray=function(){return{type:this.getName(),data:this.toFilterObject()}},t.createFromArray=function(t){return"CoordinateAndDistance"==t.type?s.fromFilterObject(t.data):"Polygon"==t.type?a.fromFilterObject(t.data):"Square"==t.type?u.fromFilterObject(t.data):void 0},t}();e.LocationRange=i;var s=function(t){function e(e,r){var n=t.call(this)||this;return n.coordinate=e,n.distance=r,n}return n.__extends(e,t),e.prototype.toFilterObject=function(){return{coordinate:this.coordinate.toArray(),distance:this.distance}},e.prototype.getName=function(){return"CoordinateAndDistance"},e.fromFilterObject=function(t){return new e(o.Coordinate.createFromArray(t.coordinate),t.distance)},e}(i);e.CoordinateAndDistance=s;var a=function(t){function e(e){var r=t.call(this)||this;if(e.length<3)throw new Error("A polygon needs more than two coordinates.");return r.coordinates=e,r}return n.__extends(e,t),e.prototype.toFilterObject=function(){var t=[];for(var e in this.coordinates)t.push(this.coordinates[e].toArray());return{coordinates:t}},e.prototype.getName=function(){return"Polygon"},e.fromFilterObject=function(t){var r=[];for(var n in t.coordinates)r.push(o.Coordinate.createFromArray(t.coordinates[n]));return new e(r)},e}(i);e.Polygon=a;var u=function(t){function e(e,r){var n=t.call(this)||this;return n.topLeftCoordinate=e,n.bottomRightCoordinate=r,n}return n.__extends(e,t),e.prototype.toFilterObject=function(){return{top_left:this.topLeftCoordinate.toArray(),bottom_right:this.bottomRightCoordinate.toArray()}},e.prototype.getName=function(){return"Square"},e.fromFilterObject=function(t){return new e(o.Coordinate.createFromArray(t.top_left),o.Coordinate.createFromArray(t.bottom_right))},e}(i);e.Square=u},function(t,e,r){"use strict";e.__esModule=!0;var n=function(){return function(){}}();e.HttpClient=n},function(t,e,r){"use strict";e.__esModule=!0,e.TYPE_VALUE=1,e.TYPE_LITERAL=4,e.TYPE_ARRAY_ELEMENT_UPDATE=8,e.TYPE_ARRAY_ELEMENT_ADD=16,e.TYPE_ARRAY_ELEMENT_DELETE=32,e.TYPE_ARRAY_EXPECTS_ELEMENT=24,e.TYPE_ARRAY=56;var n=function(){function t(){this.changes=[]}return t.prototype.addChange=function(t,r,n){void 0===n&&(n=e.TYPE_VALUE),this.changes.push({field:t,type:n,value:r})},t.prototype.updateElementFromList=function(t,r,n,o){this.changes.push({field:t,type:o|e.TYPE_ARRAY_ELEMENT_UPDATE,condition:r,value:n})},t.prototype.addElementInList=function(t,r,n){this.changes.push({field:t,type:n|e.TYPE_ARRAY_ELEMENT_ADD,value:r})},t.prototype.deleteElementFromList=function(t,r){this.changes.push({field:t,type:e.TYPE_ARRAY_ELEMENT_DELETE,condition:r})},t.prototype.getChanges=function(){return this.changes},t.create=function(){return new t},t.prototype.toArray=function(){return JSON.parse(JSON.stringify(this.changes))},t.createFromArray=function(e){e=JSON.parse(JSON.stringify(e));var r=t.create();return r.changes=e,r},t}();e.Changes=n},function(t,e,r){"use strict";e.__esModule=!0,e.RANGE_ZERO=0,e.RANGE_INFINITE=-1,e.RANGE_SEPARATOR="..";var n=function(){function t(){}return t.stringToArray=function(t){var r=t.split(e.RANGE_SEPARATOR),n=r[0],o=r[1],i=e.RANGE_ZERO,s=e.RANGE_INFINITE;return""!=n&&(i=parseInt(n)),""!=o&&(s=parseInt(o)),[i,s]},t.arrayToString=function(t){var r=["",""];return t[0]!=e.RANGE_ZERO&&(r[0]=String(t[0])),t[1]!=e.RANGE_INFINITE&&(r[1]=String(t[1])),r.join(e.RANGE_SEPARATOR)},t.createRanges=function(t,r,n){for(var o,i=[];t1)for(var r=1;r=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}}),s):s}},function(t,e,r){"use strict";var n=r(1);t.exports=n.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=o(window.location.href),function(e){var r=n.isString(e)?o(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0}},function(t,e,r){"use strict";var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function o(){this.message="String contains an invalid character"}o.prototype=new Error,o.prototype.code=5,o.prototype.name="InvalidCharacterError",t.exports=function(t){for(var e,r,i=String(t),s="",a=0,u=n;i.charAt(0|a)||(u="=",a%1);s+=u.charAt(63&e>>8-a%1*8)){if((r=i.charCodeAt(a+=.75))>255)throw new o;e=e<<8|r}return s}},function(t,e,r){"use strict";var n=r(1);t.exports=n.isStandardBrowserEnv()?{write:function(t,e,r,o,i,s){var a=[];a.push(t+"="+encodeURIComponent(e)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(o)&&a.push("path="+o),n.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,r){"use strict";var n=r(1);function o(){this.handlers=[]}o.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},o.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},o.prototype.forEach=function(t){n.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=o},function(t,e,r){"use strict";var n=r(1),o=r(56),i=r(18),s=r(9),a=r(57),u=r(58);function c(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return c(t),t.baseURL&&!a(t.url)&&(t.url=u(t.baseURL,t.url)),t.headers=t.headers||{},t.data=o(t.data,t.headers,t.transformRequest),t.headers=n.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),n.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||s.adapter)(t).then(function(e){return c(t),e.data=o(e.data,e.headers,t.transformResponse),e},function(e){return i(e)||(c(t),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(t,e,r){"use strict";var n=r(1);t.exports=function(t,e,r){return n.forEach(r,function(r){t=r(t,e)}),t}},function(t,e,r){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,r){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,r){"use strict";var n=r(19);function o(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(t){e=t});var r=this;t(function(t){r.reason||(r.reason=new n(t),e(r.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var t;return{token:new o(function(e){t=e}),cancel:t}},t.exports=o},function(t,e,r){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,r){"use strict";e.__esModule=!0;var n=r(2),o=r(62),i=r(63),s=function(){function t(t,e,r,n,o){void 0===r&&(r=!1),void 0===n&&(n=0),void 0===o&&(o="0kb"),this.uuid=t,this.appUUID=e,this.isOK=r,this.docCount=n,this.size=o}return t.prototype.getUUID=function(){return this.uuid},t.prototype.getAppUUID=function(){return this.appUUID},t.prototype.isOk=function(){return this.isOK},t.prototype.getDocCount=function(){return this.docCount},t.prototype.getSize=function(){return this.size},t.prototype.toArray=function(){return{uuid:this.uuid.toArray(),app_id:this.appUUID.toArray(),is_ok:this.isOK,doc_count:this.docCount,size:this.size}},t.createFromArray=function(e){if(void 0===e.uuid||void 0===e.app_id)throw n.InvalidFormatError.indexFormatNotValid();return new t(o.IndexUUID.createFromArray(e.uuid),i.AppUUID.createFromArray(e.app_id),void 0!==e.is_ok&&e.is_ok,void 0===e.doc_count?0:e.doc_count,void 0===e.size?"0kb":e.size)},t}();e.Index=s},function(t,e,r){"use strict";e.__esModule=!0;var n=r(2),o=function(){function t(t){if(t.indexOf("_")>=0)throw n.InvalidFormatError.indexUUIDFormatNotValid();this.id=t}return t.createById=function(e){return new t(e)},t.prototype.getId=function(){return this.id},t.prototype.toArray=function(){return{id:this.id}},t.createFromArray=function(e){return new t((e=JSON.parse(JSON.stringify(e))).id)},t.prototype.composedUUID=function(){return this.id},t}();e.IndexUUID=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(2),o=function(){function t(t){if(t.indexOf("_")>=0)throw n.InvalidFormatError.appUUIDFormatNotValid();this.id=t}return t.createById=function(e){return new t(e)},t.prototype.getId=function(){return this.id},t.prototype.toArray=function(){return{id:this.id}},t.createFromArray=function(e){return new t((e=JSON.parse(JSON.stringify(e))).id)},t.prototype.composedUUID=function(){return this.id},t}();e.AppUUID=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),o=function(){function t(){this.cache={},this.size=0,this.cache={},this.size=0}return t.prototype.set=function(t,e){var r;this.cache=n.__assign({},this.cache,((r={})[t]=e,r)),this.size=this.size+1},t.prototype.get=function(t){return this.cache[t]},t.prototype.del=function(t){delete this.cache[t]},t.prototype.clear=function(){this.cache={},this.size=0},t}();e.InMemoryCache=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(37),o=function(){function t(t,e){void 0===t&&(t=null),void 0===e&&(e=!0),this.synonyms=[],this.language=t,this.storeSearchableMetadata=e}return t.prototype.getLanguage=function(){return this.language},t.prototype.shouldSearchableMetadataBeStored=function(){return this.storeSearchableMetadata},t.prototype.addSynonym=function(t){this.synonyms.push(t)},t.prototype.getSynonyms=function(){return this.synonyms},t.prototype.toArray=function(){return{language:this.language,store_searchable_metadata:this.storeSearchableMetadata,synonyms:this.synonyms.map(function(t){return t.toArray()})}},t.createFromArray=function(e){var r=new t(e.language?e.language:null,"boolean"!=typeof e.store_searchable_metadata||e.store_searchable_metadata);return e.synonyms instanceof Array&&e.synonyms.length>0&&(r.synonyms=e.synonyms.map(function(t){return n.Synonym.createFromArray(t)})),r},t}();e.Config=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.throwEndpointNotAvailable=function(){return new e("Endpoint not available")},e}(r(3).ErrorWithMessage);e.EventError=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.getTransportableHTTPError=function(){return 403},e.createAppIdIsRequiredException=function(){return new e("AppId query parameter MUST be defined with a valid value")},e.createIndexIsRequiredException=function(){return new e("Index query parameter MUST be defined with a valid value")},e.createTokenIsRequiredException=function(){return new e("Token query parameter MUST be defined with a valid value")},e}(r(3).ErrorWithMessage);e.ForbiddenError=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.getTransportableHTTPError=function(){return 415},e.createUnsupportedContentTypeException=function(){return new e("This content type is not accepted. Please use application/json")},e}(r(3).ErrorWithMessage);e.UnsupportedContentTypeError=o},function(t,e,r){"use strict";e.__esModule=!0;var n=r(0),o=r(7),i=function(){function t(){}return t.fromFilterObject=function(t){throw TypeError("Method not valid")},t.prototype.toArray=function(){return{type:this.getName(),data:this.toFilterObject()}},t.createFromArray=function(t){return"CoordinateAndDistance"==t.type?s.fromFilterObject(t.data):"Polygon"==t.type?a.fromFilterObject(t.data):"Square"==t.type?u.fromFilterObject(t.data):void 0},t}();e.LocationRange=i;var s=function(t){function e(e,r){var n=t.call(this)||this;return n.coordinate=e,n.distance=r,n}return n.__extends(e,t),e.prototype.toFilterObject=function(){return{coordinate:this.coordinate.toArray(),distance:this.distance}},e.prototype.getName=function(){return"CoordinateAndDistance"},e.fromFilterObject=function(t){return new e(o.Coordinate.createFromArray(t.coordinate),t.distance)},e}(i);e.CoordinateAndDistance=s;var a=function(t){function e(e){var r=t.call(this)||this;if(e.length<3)throw new Error("A polygon needs more than two coordinates.");return r.coordinates=e,r}return n.__extends(e,t),e.prototype.toFilterObject=function(){var t=[];for(var e in this.coordinates)t.push(this.coordinates[e].toArray());return{coordinates:t}},e.prototype.getName=function(){return"Polygon"},e.fromFilterObject=function(t){var r=[];for(var n in t.coordinates)r.push(o.Coordinate.createFromArray(t.coordinates[n]));return new e(r)},e}(i);e.Polygon=a;var u=function(t){function e(e,r){var n=t.call(this)||this;return n.topLeftCoordinate=e,n.bottomRightCoordinate=r,n}return n.__extends(e,t),e.prototype.toFilterObject=function(){return{top_left:this.topLeftCoordinate.toArray(),bottom_right:this.bottomRightCoordinate.toArray()}},e.prototype.getName=function(){return"Square"},e.fromFilterObject=function(t){return new e(o.Coordinate.createFromArray(t.top_left),o.Coordinate.createFromArray(t.bottom_right))},e}(i);e.Square=u},function(t,e,r){"use strict";e.__esModule=!0;var n=function(){return function(){}}();e.HttpClient=n},function(t,e,r){"use strict";e.__esModule=!0,e.TYPE_VALUE=1,e.TYPE_LITERAL=4,e.TYPE_ARRAY_ELEMENT_UPDATE=8,e.TYPE_ARRAY_ELEMENT_ADD=16,e.TYPE_ARRAY_ELEMENT_DELETE=32,e.TYPE_ARRAY_EXPECTS_ELEMENT=24,e.TYPE_ARRAY=56;var n=function(){function t(){this.changes=[]}return t.prototype.addChange=function(t,r,n){void 0===n&&(n=e.TYPE_VALUE),this.changes.push({field:t,type:n,value:r})},t.prototype.updateElementFromList=function(t,r,n,o){this.changes.push({field:t,type:o|e.TYPE_ARRAY_ELEMENT_UPDATE,condition:r,value:n})},t.prototype.addElementInList=function(t,r,n){this.changes.push({field:t,type:n|e.TYPE_ARRAY_ELEMENT_ADD,value:r})},t.prototype.deleteElementFromList=function(t,r){this.changes.push({field:t,type:e.TYPE_ARRAY_ELEMENT_DELETE,condition:r})},t.prototype.getChanges=function(){return this.changes},t.create=function(){return new t},t.prototype.toArray=function(){return JSON.parse(JSON.stringify(this.changes))},t.createFromArray=function(e){e=JSON.parse(JSON.stringify(e));var r=t.create();return r.changes=e,r},t}();e.Changes=n},function(t,e,r){"use strict";e.__esModule=!0,e.RANGE_ZERO=0,e.RANGE_INFINITE=-1,e.RANGE_SEPARATOR="..";var n=function(){function t(){}return t.stringToArray=function(t){var r=t.split(e.RANGE_SEPARATOR),n=r[0],o=r[1],i=e.RANGE_ZERO,s=e.RANGE_INFINITE;return""!=n&&(i=parseInt(n)),""!=o&&(s=parseInt(o)),[i,s]},t.arrayToString=function(t){var r=["",""];return t[0]!=e.RANGE_ZERO&&(r[0]=String(t[0])),t[1]!=e.RANGE_INFINITE&&(r[1]=String(t[1])),r.join(e.RANGE_SEPARATOR)},t.createRanges=function(t,r,n){for(var o,i=[];t= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\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;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","'use strict';\n\nvar bind = require('./helpers/bind');\nvar isBuffer = require('is-buffer');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim\n};\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Class InvalidFormatError\n */\nvar InvalidFormatError = /** @class */ (function (_super) {\n tslib_1.__extends(InvalidFormatError, _super);\n function InvalidFormatError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n InvalidFormatError.getTransportableHTTPError = function () {\n return 400;\n };\n /**\n * Item representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.itemRepresentationNotValid = function () {\n return new InvalidFormatError(\"Item representation not valid. Expecting Item array serialized but found malformed data\");\n };\n /**\n * Item UUID representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.itemUUIDRepresentationNotValid = function () {\n return new InvalidFormatError(\"Item UUID representation not valid. Expecting UUID array serialized but found malformed data\");\n };\n /**\n * Create Composed UUID bad format.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.composedItemUUIDNotValid = function () {\n return new InvalidFormatError(\"A composed UUID should always follow this format: {id}~{type}.\");\n };\n /**\n * Create Query sorted by distance without coordinate.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.querySortedByDistanceWithoutCoordinate = function () {\n return new InvalidFormatError(\"In order to be able to sort by coordinates, you need to create a Query by using Query::createLocated() instead of Query::create()\");\n };\n /**\n * Query representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.queryFormatNotValid = function () {\n return new InvalidFormatError(\"Query Format not valid. Expecting a Query serialized but found malformed data\");\n };\n /**\n * Coordinate representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.coordinateFormatNotValid = function () {\n return new InvalidFormatError(\"A Coordinate should always contain a lat (Latitude) and a lon (Longitude)\");\n };\n /**\n * Config representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.configFormatNotValid = function () {\n return new InvalidFormatError(\"Config Format not valid. Expecting a Config serialized but found malformed data\");\n };\n /**\n * Token representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.tokenFormatNotValid = function () {\n return new InvalidFormatError(\"Token Format not valid. Expecting a Token serialized but found malformed data\");\n };\n /**\n * Index format not valid.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.indexFormatNotValid = function () {\n return new InvalidFormatError('Index Format not valid. Expecting an Index serialized but found malformed data');\n };\n /**\n * IndexUUI format not valid.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.indexUUIDFormatNotValid = function () {\n return new InvalidFormatError('IndexUUID Format not valid. Expecting an IndexUUID serialized but found malformed data');\n };\n /**\n * App format not valid.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.appUUIDFormatNotValid = function () {\n return new InvalidFormatError('AppUUID Format not valid. Expecting an AppUUID serialized but found malformed data');\n };\n /**\n * Campaign representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.campaignFormatNotValid = function () {\n return new InvalidFormatError(\"Campaign Format not valid. Expecting a Campaign serialized but found malformed data\");\n };\n /**\n * Changes representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.changesFormatNotValid = function () {\n return new InvalidFormatError(\"Changes Format not valid. Expecting a Changes serialized but found malformed data\");\n };\n /**\n * Boost clause representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.boostClauseFormatNotValid = function () {\n return new InvalidFormatError(\"Boost clause Format not valid. Expecting a Boost clause serialized but found malformed data\");\n };\n /**\n * token uuid representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.tokenUUIDFormatNotValid = function () {\n return new InvalidFormatError(\"Token UUID Format not valid. Expecting a TokenUUID serialized but found malformed data\");\n };\n /**\n * User representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.userFormatNotValid = function () {\n return new InvalidFormatError(\"User Format not valid. Expecting a User serialized but found malformed data\");\n };\n return InvalidFormatError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.InvalidFormatError = InvalidFormatError;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * ConnectError\n */\nvar ErrorWithMessage = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param message\n */\n function ErrorWithMessage(message) {\n this.message = message;\n }\n return ErrorWithMessage;\n}());\nexports.ErrorWithMessage = ErrorWithMessage;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * filter constants\n */\nexports.FILTER_MUST_ALL = 4;\nexports.FILTER_MUST_ALL_WITH_LEVELS = 5;\nexports.FILTER_AT_LEAST_ONE = 8;\nexports.FILTER_EXCLUDE = 16;\nexports.FILTER_PROMOTE = 32;\nexports.FILTER_TYPE_FIELD = \"field\";\nexports.FILTER_TYPE_RANGE = \"range\";\nexports.FILTER_TYPE_DATE_RANGE = \"date_range\";\nexports.FILTER_TYPE_GEO = \"geo\";\nexports.FILTER_TYPE_QUERY = \"query\";\n/**\n * Filter class\n */\nvar Filter = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param field\n * @param values\n * @param applicationType\n * @param filterType\n * @param filterTerms\n */\n function Filter(field, values, applicationType, filterType, filterTerms) {\n this.field = field;\n this.values = values;\n this.applicationType = applicationType;\n this.filterType = filterType;\n this.filterTerms = filterTerms;\n }\n /**\n * Get field\n *\n * @returns {string}\n */\n Filter.prototype.getField = function () {\n return this.field;\n };\n /**\n * Get values\n *\n * @returns {any}\n */\n Filter.prototype.getValues = function () {\n return this.values;\n };\n /**\n * Has value\n *\n * @param value\n *\n * @returns {boolean}\n */\n Filter.prototype.hasValue = function (value) {\n return typeof this.values[value] == \"undefined\";\n };\n /**\n * getApplicationType\n *\n * @returns {number}\n */\n Filter.prototype.getApplicationType = function () {\n return this.applicationType;\n };\n /**\n * Get filter type\n *\n * @return {string}\n */\n Filter.prototype.getFilterType = function () {\n return this.filterType;\n };\n /**\n * Get filter type\n *\n * @return {{}}\n */\n Filter.prototype.getFilterTerms = function () {\n return this.filterTerms;\n };\n /**\n * Create\n *\n * @param field\n * @param values\n * @param applicationType\n * @param filterType\n * @param filterTerms\n *\n * @return {Filter}\n */\n Filter.create = function (field, values, applicationType, filterType, filterTerms) {\n if (filterTerms === void 0) { filterTerms = []; }\n return new Filter(field, values, applicationType, filterType, filterTerms);\n };\n /**\n * To array\n *\n * @returns {Array}\n */\n Filter.prototype.toArray = function () {\n var filterAsArray = {};\n if (this.field != \"uuid.type\") {\n filterAsArray.field = this.field;\n }\n if (this.values.length > 0 ||\n Object.keys(this.values).length > 0) {\n filterAsArray.values = this.values;\n }\n if (this.applicationType != exports.FILTER_AT_LEAST_ONE) {\n filterAsArray.application_type = this.applicationType;\n }\n if (this.filterType != exports.FILTER_TYPE_FIELD) {\n filterAsArray.filter_type = this.filterType;\n }\n if (this.filterTerms.length > 0) {\n filterAsArray.filter_terms = this.filterTerms;\n }\n return filterAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Filter}\n */\n Filter.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.field == \"undefined\") {\n array.field = \"uuid.type\";\n }\n if (typeof array.values == \"undefined\") {\n array.values = [];\n }\n if (typeof array.application_type == \"undefined\") {\n array.application_type = exports.FILTER_AT_LEAST_ONE;\n }\n if (typeof array.filter_type == \"undefined\") {\n array.filter_type = exports.FILTER_TYPE_FIELD;\n }\n if (typeof array.filter_terms == \"undefined\") {\n array.filter_terms = [];\n }\n return Filter.create(array.field, array.values, array.application_type, array.filter_type, array.filter_terms);\n };\n /**\n * Get path by field.\n *\n * @param field\n *\n * @returns {string}\n */\n Filter.getFilterPathByField = function (field) {\n return ([\"id\", \"type\"].indexOf(field) > -1)\n ? \"uuid.\" + field\n : \"indexed_metadata.\" + field;\n };\n return Filter;\n}());\nexports.Filter = Filter;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar Coordinate_1 = require(\"../Model/Coordinate\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\nvar User_1 = require(\"../Model/User\");\nvar Aggregation_1 = require(\"./Aggregation\");\nvar Filter_1 = require(\"./Filter\");\nvar Filter_2 = require(\"./Filter\");\nvar Aggregation_2 = require(\"./Aggregation\");\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar Filter_3 = require(\"./Filter\");\nvar ScoreStrategy_1 = require(\"./ScoreStrategy\");\nvar SortBy_1 = require(\"./SortBy\");\n/**\n * Query constants\n */\nexports.QUERY_DEFAULT_FROM = 0;\nexports.QUERY_DEFAULT_PAGE = 1;\nexports.QUERY_DEFAULT_SIZE = 10;\nexports.QUERY_INFINITE_SIZE = 1000;\nexports.NO_MIN_SCORE = 0.0;\n/**\n * Query class\n */\nvar Query = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param queryText\n */\n function Query(queryText) {\n this.fields = [];\n this.universeFilters = {};\n this.filters = {};\n this.itemsPromoted = [];\n this.aggregations = {};\n this.filterFields = [];\n this.minScore = exports.NO_MIN_SCORE;\n this.sortByInstance = SortBy_1.SortBy.create();\n this.filters._query = Filter_1.Filter.create(\"\", [queryText], 0, Filter_3.FILTER_TYPE_QUERY);\n }\n /**\n * Created located\n *\n * @param coordinate\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Query.createLocated = function (coordinate, queryText, page, size) {\n if (page === void 0) { page = exports.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = exports.QUERY_DEFAULT_SIZE; }\n var query = Query.create(queryText, page, size);\n query.coordinate = coordinate;\n return query;\n };\n /**\n * Create\n *\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Query.create = function (queryText, page, size) {\n if (page === void 0) { page = exports.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = exports.QUERY_DEFAULT_SIZE; }\n page = Math.max(1, page);\n var query = new Query(queryText);\n query.from = (page - 1) * size;\n query.size = size;\n query.page = page;\n return query;\n };\n /**\n * Create match all\n *\n * @return {Query}\n */\n Query.createMatchAll = function () {\n return Query.create(\"\", exports.QUERY_DEFAULT_PAGE, exports.QUERY_DEFAULT_SIZE);\n };\n /**\n * Create by UUID\n *\n * @param uuid\n *\n * @return {Query}\n */\n Query.createByUUID = function (uuid) {\n return Query.createByUUIDs(uuid);\n };\n /**\n * Create by UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.createByUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n var ids = [];\n for (var i in uuids) {\n ids.push(uuids[i].composedUUID());\n }\n var query = Query.create(\"\", exports.QUERY_DEFAULT_PAGE, ids.length)\n .disableAggregations()\n .disableSuggestions();\n query.filters._id = Filter_1.Filter.create(\"_id\", ids, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD);\n return query;\n };\n /**\n * set fields\n *\n * @param fields\n *\n * @return {Query}\n */\n Query.prototype.setFields = function (fields) {\n this.fields = fields;\n return this;\n };\n /**\n * get fields\n *\n * @return {string[]}\n */\n Query.prototype.getFields = function () {\n return this.fields;\n };\n /**\n * Filter universe by types\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByTypes = function (values) {\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"type\");\n if (values.length > 0) {\n this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[\"type\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters.type;\n }\n return this;\n };\n /**\n * Filter by types\n *\n * @param values\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByTypes = function (values, aggregate, aggregationSort) {\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a, _b;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"type\");\n if (values.length > 0) {\n this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[\"type\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters.type;\n }\n if (aggregate) {\n this.aggregations = tslib_1.__assign({}, this.aggregations, (_b = {}, _b[\"type\"] = Aggregation_1.Aggregation.create(\"type\", fieldPath, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort), _b));\n }\n return this;\n };\n /**\n * Filter universe by ids\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByIds = function (values) {\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"id\");\n if (values.length > 0) {\n this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[\"id\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters.id;\n }\n return this;\n };\n /**\n * Filter by ids\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterByIds = function (values) {\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"id\");\n if (values.length > 0) {\n this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[\"id\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters.id;\n }\n return this;\n };\n /**\n * Filter universe by\n *\n * @param field\n * @param values\n * @param applicationType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseBy = function (field, values, applicationType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length > 0) {\n this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[field] = Filter_1.Filter.create(fieldPath, values, applicationType, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters[field];\n }\n return this;\n };\n /**\n * Filter by\n *\n * @param filterName\n * @param field\n * @param values\n * @param applicationType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterBy = function (filterName, field, values, applicationType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length > 0) {\n this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[filterName] = Filter_1.Filter.create(fieldPath, values, applicationType, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters[filterName];\n }\n if (aggregate) {\n this.aggregateBy(filterName, field, applicationType, aggregationSort);\n }\n return this;\n };\n /**\n * Filter universe by range\n *\n * @param field\n * @param values\n * @param applicationType\n * @param rangeType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByRange = function (field, values, applicationType, rangeType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length > 0) {\n this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[field] = Filter_1.Filter.create(fieldPath, values, applicationType, rangeType), _a));\n }\n else {\n delete this.universeFilters[field];\n }\n return this;\n };\n /**\n * Filter universe by date range\n *\n * @param field\n * @param values\n * @param applicationType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByDateRange = function (field, values, applicationType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n return this.filterUniverseByRange(field, values, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE);\n };\n /**\n * Filter by range\n *\n * @param filterName\n * @param field\n * @param options\n * @param values\n * @param applicationType\n * @param rangeType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByRange = function (filterName, field, options, values, applicationType, rangeType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length !== 0) {\n this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[filterName] = Filter_1.Filter.create(fieldPath, values, applicationType, rangeType), _a));\n }\n else {\n delete this.filters[filterName];\n }\n if (aggregate) {\n this.aggregateByRange(filterName, fieldPath, options, applicationType, rangeType, aggregationSort);\n }\n return this;\n };\n /**\n * Filter by date range\n *\n * @param filterName\n * @param field\n * @param options\n * @param values\n * @param applicationType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByDateRange = function (filterName, field, options, values, applicationType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n return this.filterByRange(filterName, field, options, values, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE, aggregate, aggregationSort);\n };\n /**\n * Filter universe by location\n *\n * @param locationRange\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByLocation = function (locationRange) {\n var _a;\n this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[\"coordinate\"] = Filter_1.Filter.create(\"coordinate\", locationRange.toArray(), Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_GEO), _a));\n return this;\n };\n /**\n * Set filter fields\n *\n * @param filterFields\n *\n * @return {Query}\n */\n Query.prototype.setFilterFields = function (filterFields) {\n this.filterFields = filterFields;\n return this;\n };\n /**\n * Get filter fields\n *\n * @return {string[]}\n */\n Query.prototype.getFilterFields = function () {\n return this.filterFields;\n };\n /**\n * Sort by\n *\n * @param sortBy\n *\n * @return {Query}\n */\n Query.prototype.sortBy = function (sortBy) {\n if (sortBy.isSortedByGeoDistance()) {\n if (!(this.coordinate instanceof Coordinate_1.Coordinate)) {\n throw InvalidFormatError_1.InvalidFormatError.querySortedByDistanceWithoutCoordinate();\n }\n sortBy.setCoordinate(this.coordinate);\n }\n this.sortByInstance = sortBy;\n return this;\n };\n /**\n * Aggregate by\n *\n * @param filterName\n * @param field\n * @param applicationType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateBy = function (filterName, field, applicationType, aggregationSort, limit) {\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n var _a;\n this.aggregations = tslib_1.__assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Filter_1.Filter.getFilterPathByField(field), applicationType, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort, limit), _a));\n return this;\n };\n /**\n * Aggregate by range\n *\n * @param filterName\n * @param field\n * @param options\n * @param applicationType\n * @param rangeType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateByRange = function (filterName, field, options, applicationType, rangeType, aggregationSort, limit) {\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n var _a;\n if (options.length === 0) {\n return this;\n }\n this.aggregations = tslib_1.__assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Filter_1.Filter.getFilterPathByField(field), applicationType, rangeType, options, aggregationSort, limit), _a));\n return this;\n };\n /**\n * Aggregate by date range\n *\n * @param filterName\n * @param field\n * @param options\n * @param applicationType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateByDateRange = function (filterName, field, options, applicationType, aggregationSort, limit) {\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n return this.aggregateByRange(filterName, field, options, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE, aggregationSort, limit);\n };\n /**\n * Get aggregations\n *\n * @return {{}}\n */\n Query.prototype.getAggregations = function () {\n return this.aggregations;\n };\n /**\n * Get aggregation by name\n *\n * @param aggregationName\n *\n * @return {Aggregation|null}\n */\n Query.prototype.getAggregation = function (aggregationName) {\n return this.aggregations[aggregationName] instanceof Aggregation_1.Aggregation\n ? this.aggregations[aggregationName]\n : null;\n };\n /**\n * Get query text\n *\n * @return {string}\n */\n Query.prototype.getQueryText = function () {\n var filter = this.filters._query;\n return filter instanceof Filter_1.Filter\n ? filter.getValues()[0]\n : \"\";\n };\n /**\n * Get universe filters\n *\n * @return {{}}\n */\n Query.prototype.getUniverseFilters = function () {\n return this.universeFilters;\n };\n /**\n * Get universe filter by name\n *\n * @param filterName\n *\n * @return {Filter|null}\n */\n Query.prototype.getUniverseFilter = function (filterName) {\n return this.universeFilters[filterName] instanceof Filter_1.Filter\n ? this.universeFilters[filterName]\n : null;\n };\n /**\n * Get filters\n *\n * @return {{}}\n */\n Query.prototype.getFilters = function () {\n return this.filters;\n };\n /**\n * Get filter by name\n *\n * @param filterName\n *\n * @return {Filter|null}\n */\n Query.prototype.getFilter = function (filterName) {\n return this.filters[filterName] instanceof Filter_1.Filter\n ? this.filters[filterName]\n : null;\n };\n /**\n * Get filter by field\n *\n * @param fieldName\n *\n * @return {Filter|null}\n */\n Query.prototype.getFilterByField = function (fieldName) {\n var fieldPath = Filter_1.Filter.getFilterPathByField(fieldName);\n for (var i in this.filters) {\n if (this.filters[i].getField() == fieldPath) {\n return this.filters[i];\n }\n }\n return null;\n };\n /**\n * Get sort by\n *\n * @return {SortBy}\n */\n Query.prototype.getSortBy = function () {\n return this.sortByInstance;\n };\n /**\n * Get from\n *\n * @return {number}\n */\n Query.prototype.getFrom = function () {\n return this.from;\n };\n /**\n * Get size\n *\n * @return {number}\n */\n Query.prototype.getSize = function () {\n return this.size;\n };\n /**\n * Get page\n *\n * @return {number}\n */\n Query.prototype.getPage = function () {\n return this.page;\n };\n /**\n * Enable results\n *\n * @return {Query}\n */\n Query.prototype.enableResults = function () {\n this.resultsEnabled = true;\n return this;\n };\n /**\n * Disable results\n *\n * @return {Query}\n */\n Query.prototype.disableResults = function () {\n this.resultsEnabled = false;\n return this;\n };\n /**\n * Are results enabled\n *\n * @return {boolean}\n */\n Query.prototype.areResultsEnabled = function () {\n return this.resultsEnabled;\n };\n /**\n * Enable aggregations\n *\n * @return {Query}\n */\n Query.prototype.enableAggregations = function () {\n this.aggregationsEnabled = true;\n return this;\n };\n /**\n * Disable aggregations\n *\n * @return {Query}\n */\n Query.prototype.disableAggregations = function () {\n this.aggregationsEnabled = false;\n return this;\n };\n /**\n * Are aggregations enabled\n *\n * @return {boolean}\n */\n Query.prototype.areAggregationsEnabled = function () {\n return this.aggregationsEnabled;\n };\n /**\n * Enable suggestions\n *\n * @return {Query}\n */\n Query.prototype.enableSuggestions = function () {\n this.suggestionsEnabled = true;\n return this;\n };\n /**\n * Disable suggestions\n *\n * @return {Query}\n */\n Query.prototype.disableSuggestions = function () {\n this.suggestionsEnabled = false;\n return this;\n };\n /**\n * Are suggestions enabled\n *\n * @return {boolean}\n */\n Query.prototype.areSuggestionsEnabled = function () {\n return this.suggestionsEnabled;\n };\n /**\n * Enable highlights\n *\n * @return {Query}\n */\n Query.prototype.enableHighlights = function () {\n this.highlightsEnabled = true;\n return this;\n };\n /**\n * Disable highlights\n *\n * @return {Query}\n */\n Query.prototype.disableHighlights = function () {\n this.highlightsEnabled = false;\n return this;\n };\n /**\n * Are highlights enabled\n *\n * @return {boolean}\n */\n Query.prototype.areHighlightsEnabled = function () {\n return this.highlightsEnabled;\n };\n /**\n * Promote uuid\n *\n * @param itemUUID\n *\n * @return {Query}\n */\n Query.prototype.promoteUUID = function (itemUUID) {\n this\n .itemsPromoted\n .push(itemUUID);\n return this;\n };\n /**\n * Promote UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.prototype.promoteUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n this.itemsPromoted = uuids;\n return this;\n };\n /**\n * Get promoted UUIDs\n *\n * @return {ItemUUID[]}\n */\n Query.prototype.getItemsPromoted = function () {\n return this.itemsPromoted;\n };\n /**\n * Exclude id\n *\n * @param itemUUID\n *\n * @return {Query}\n */\n Query.prototype.excludeUUID = function (itemUUID) {\n this.excludeUUIDs(itemUUID);\n return this;\n };\n /**\n * Exclude UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.prototype.excludeUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n var _a;\n this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[\"excluded_ids\"] = Filter_1.Filter.create(\"_id\", uuids.map(function (uuid) { return uuid.composedUUID(); }), Filter_2.FILTER_EXCLUDE, Filter_2.FILTER_TYPE_FIELD), _a));\n return this;\n };\n /**\n * Get score strategy\n *\n * @return {ScoreStrategy}\n */\n Query.prototype.getScoreStrategy = function () {\n return this.scoreStrategy;\n };\n /**\n * Set score strategy\n *\n * @param scoreStrategy\n */\n Query.prototype.setScoreStrategy = function (scoreStrategy) {\n this.scoreStrategy = scoreStrategy;\n return this;\n };\n /**\n * Get fuzziness\n *\n * @return any\n */\n Query.prototype.getFuzziness = function () {\n return this.fuzziness;\n };\n /**\n * Set fuzziness\n *\n * @param fuzziness\n *\n * @return {Query}\n */\n Query.prototype.setFuzziness = function (fuzziness) {\n this.fuzziness = fuzziness;\n return this;\n };\n /**\n * Set auto fuzziness\n *\n * @return {Query}\n */\n Query.prototype.setAutoFuzziness = function () {\n this.fuzziness = 'AUTO';\n return this;\n };\n /**\n * Get min score\n *\n * @return any\n */\n Query.prototype.getMinScore = function () {\n return this.minScore;\n };\n /**\n * Set min score\n *\n * @param minScore\n *\n * @return {Query}\n */\n Query.prototype.setMinScore = function (minScore) {\n this.minScore = minScore;\n return this;\n };\n /**\n * By user\n *\n * @param user\n *\n * @return {Query}\n */\n Query.prototype.byUser = function (user) {\n this.user = user;\n return this;\n };\n /**\n * By anyone\n *\n * @return {null}\n */\n Query.prototype.anonymously = function () {\n this.user = null;\n return null;\n };\n /**\n * Get user\n *\n * @return {User}\n */\n Query.prototype.getUser = function () {\n return this.user;\n };\n /**\n * To array\n *\n * @return {any}\n */\n Query.prototype.toArray = function () {\n var array = {};\n if (this.getQueryText() !== \"\") {\n array.q = this.getQueryText();\n }\n if (this.coordinate instanceof Coordinate_1.Coordinate) {\n array.coordinate = this.coordinate.toArray();\n }\n /**\n * Fields\n */\n if (this.fields instanceof Array &&\n this.fields.length > 0) {\n array.fields = this.fields;\n }\n /**\n * Universe Filters\n */\n if (Object.keys(this.universeFilters).length) {\n array.universe_filters = {};\n for (var i in this.universeFilters) {\n var universeFilter = this.universeFilters[i];\n array.universe_filters[i] = universeFilter.toArray();\n }\n }\n /**\n * Filters\n */\n if (this.filters instanceof Object &&\n Object.keys(this.filters).length) {\n array.filters = {};\n for (var i in this.filters) {\n var filter = this.filters[i];\n if (filter.getFilterType() !== Filter_3.FILTER_TYPE_QUERY) {\n array.filters[i] = filter.toArray();\n }\n }\n }\n /**\n * Aggregations\n */\n if (this.aggregations instanceof Object &&\n Object.keys(this.aggregations).length) {\n array.aggregations = {};\n for (var i in this.aggregations) {\n var aggregation = this.aggregations[i];\n array.aggregations[i] = aggregation.toArray();\n }\n }\n /**\n * Sort\n */\n var sort = this.sortByInstance.toArray();\n if (Object.keys(sort).length) {\n array.sort = sort;\n }\n /**\n * Page\n */\n var page = this.page;\n if (page !== exports.QUERY_DEFAULT_PAGE) {\n array.page = page;\n }\n /**\n * Size\n */\n var size = this.size;\n if (size !== exports.QUERY_DEFAULT_SIZE) {\n array.size = size;\n }\n /**\n * Booleans\n */\n if (this.resultsEnabled === false) {\n array.results_enabled = false;\n }\n if (this.suggestionsEnabled === true) {\n array.suggestions_enabled = true;\n }\n if (this.highlightsEnabled === true) {\n array.highlights_enabled = true;\n }\n if (this.aggregationsEnabled === false) {\n array.aggregations_enabled = false;\n }\n /**\n * Filter fields\n */\n if (this.filterFields instanceof Array &&\n this.filterFields.length > 0) {\n array.filter_fields = this.filterFields;\n }\n /**\n * Score strategy\n */\n if (this.scoreStrategy instanceof ScoreStrategy_1.ScoreStrategy) {\n var scoreStrategyAsArray = this.scoreStrategy.toArray();\n if (Object.keys(scoreStrategyAsArray).length > 0) {\n array.score_strategy = scoreStrategyAsArray;\n }\n }\n if (this.fuzziness !== null) {\n array.fuzziness = this.fuzziness;\n }\n /**\n * Min score\n */\n var minScore = this.minScore;\n if (minScore !== exports.NO_MIN_SCORE) {\n array.min_score = minScore;\n }\n /**\n * User\n */\n if (this.user instanceof User_1.User) {\n var userAsArray = this.user.toArray();\n if (Object.keys(userAsArray).length > 0) {\n array.user = userAsArray;\n }\n }\n /**\n * items promoted\n */\n if (this.itemsPromoted.length > 0) {\n array.items_promoted = [];\n for (var i in this.itemsPromoted) {\n array\n .items_promoted\n .push(this.itemsPromoted[i].toArray());\n }\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Query}\n */\n Query.createFromArray = function (array) {\n var query = array.coordinate instanceof Object\n ? Query.createLocated(Coordinate_1.Coordinate.createFromArray(array.coordinate), array.q ? array.q : \"\", array.page ? array.page : exports.QUERY_DEFAULT_PAGE, array.size ? array.size : exports.QUERY_DEFAULT_SIZE)\n : Query.create(array.q ? array.q : \"\", array.page ? array.page : exports.QUERY_DEFAULT_PAGE, array.size ? array.size : exports.QUERY_DEFAULT_SIZE);\n /**\n * Fields\n */\n query.fields = array.fields instanceof Array\n ? array.fields\n : [];\n /**\n * Aggregations\n */\n var aggregationsAsArray = typeof array.aggregations === typeof {}\n ? array.aggregations\n : {};\n for (var i in aggregationsAsArray) {\n query.aggregations[i] = Aggregation_1.Aggregation.createFromArray(aggregationsAsArray[i]);\n }\n /**\n * Sort\n */\n var sortAsArray = typeof array.sort === typeof {}\n ? array.sort\n : {};\n if (Object.keys(sortAsArray).length > 0) {\n query.sortByInstance = SortBy_1.SortBy.createFromArray(sortAsArray);\n }\n /**\n * Filters\n */\n var filtersAsArray = typeof array.filters === typeof {}\n ? array.filters\n : {};\n for (var i in filtersAsArray) {\n query.filters[i] = Filter_1.Filter.createFromArray(filtersAsArray[i]);\n }\n /**\n * Universe Filters\n */\n var universeFiltersAsArray = typeof array.universe_filters === typeof {}\n ? array.universe_filters\n : {};\n for (var i in universeFiltersAsArray) {\n query.universeFilters[i] = Filter_1.Filter.createFromArray(universeFiltersAsArray[i]);\n }\n /**\n * Booleans\n */\n query.resultsEnabled = typeof array.results_enabled === \"boolean\"\n ? array.results_enabled\n : true;\n query.suggestionsEnabled = typeof array.suggestions_enabled === \"boolean\"\n ? array.suggestions_enabled\n : false;\n query.aggregationsEnabled = typeof array.aggregations_enabled === \"boolean\"\n ? array.aggregations_enabled\n : true;\n query.highlightsEnabled = typeof array.highlights_enabled === \"boolean\"\n ? array.highlights_enabled\n : false;\n query.fuzziness = array.fuzziness;\n query.minScore = array.min_score ? array.min_score : exports.NO_MIN_SCORE;\n /**\n * Items promoted\n */\n var itemsPromotedAsArray = typeof array.items_promoted === typeof {}\n ? array.items_promoted\n : {};\n for (var i in itemsPromotedAsArray) {\n query\n .itemsPromoted\n .push(ItemUUID_1.ItemUUID.createFromArray(itemsPromotedAsArray[i]));\n }\n /**\n * Filter fields\n */\n query.filterFields = array.filter_fields instanceof Array\n ? array.filter_fields\n : [];\n query.scoreStrategy = array.score_strategy instanceof Object\n ? ScoreStrategy_1.ScoreStrategy.createFromArray(array.score_stategy)\n : null;\n query.user = array.user instanceof Object\n ? User_1.User.createFromArray(array.user)\n : null;\n return query;\n };\n return Query;\n}());\nexports.Query = Query;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * Coordinate Type cast\n * @param coordinate\n */\nvar Coordinate = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param {number} lat\n * @param {number} lon\n */\n function Coordinate(lat, lon) {\n this.lat = lat;\n this.lon = lon;\n }\n /**\n * Get latitude\n *\n * @return float\n */\n Coordinate.prototype.getLatitude = function () {\n return this.lat;\n };\n /**\n * Get longitude\n *\n * @return float\n */\n Coordinate.prototype.getLongitude = function () {\n return this.lon;\n };\n /**\n * To array\n *\n * @return {{lat: number, lon: number}}\n */\n Coordinate.prototype.toArray = function () {\n return {\n lat: this.lat,\n lon: this.lon\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return Coordinate\n *\n * @throws InvalidFormatError\n */\n Coordinate.createFromArray = function (array) {\n if (typeof array.lat == \"undefined\" ||\n typeof array.lon == \"undefined\") {\n throw InvalidFormatError_1.InvalidFormatError.coordinateFormatNotValid();\n }\n return new Coordinate(array.lat, array.lon);\n };\n return Coordinate;\n}());\nexports.Coordinate = Coordinate;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * ItemUUID class\n */\nvar ItemUUID = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param id\n * @param type\n */\n function ItemUUID(id, type) {\n this.id = id;\n this.type = type;\n }\n /**\n * Create composed UUID\n *\n * @param composedUUID\n *\n * @returns {ItemUUID}\n */\n ItemUUID.createByComposedUUID = function (composedUUID) {\n var parts = composedUUID.split(\"~\");\n if (2 != parts.length) {\n throw InvalidFormatError_1.InvalidFormatError.composedItemUUIDNotValid();\n }\n return new ItemUUID(parts[0], parts[1]);\n };\n /**\n * Return id\n *\n * @returns {string}\n */\n ItemUUID.prototype.getId = function () {\n return this.id;\n };\n /**\n * Get type\n *\n * @returns {string}\n */\n ItemUUID.prototype.getType = function () {\n return this.type;\n };\n /**\n * To array\n *\n * @returns {{id: *, type: *}}\n */\n ItemUUID.prototype.toArray = function () {\n return {\n id: this.id,\n type: this.type\n };\n };\n /**\n * Create from array\n *\n * @param array {{id:string, type:string}}\n *\n * @return {ItemUUID}\n */\n ItemUUID.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new ItemUUID(array.id, array.type);\n };\n /**\n * Compose unique id\n *\n * @returns {string}\n */\n ItemUUID.prototype.composedUUID = function () {\n return this.id + \"~\" + this.type;\n };\n return ItemUUID;\n}());\nexports.ItemUUID = ItemUUID;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar Coordinate_1 = require(\"./Coordinate\");\nvar ItemUUID_1 = require(\"./ItemUUID\");\n/**\n * Item class\n */\nvar Item = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param uuid\n * @param coordinate\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n */\n function Item(uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n this.metadata = {};\n this.indexedMetadata = {};\n this.searchableMetadata = {};\n this.exactMatchingMetadata = [];\n this.suggest = [];\n this.highlights = {};\n this.promoted = false;\n this.uuid = uuid;\n this.coordinate = coordinate;\n this.metadata = metadata;\n this.indexedMetadata = indexedMetadata;\n this.searchableMetadata = searchableMetadata;\n this.exactMatchingMetadata = exactMatchingMetadata;\n this.suggest = suggest;\n }\n /**\n * Create new Item\n *\n * @param uuid\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n * @returns {Item}\n */\n Item.create = function (uuid, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n if (metadata === void 0) { metadata = {}; }\n if (indexedMetadata === void 0) { indexedMetadata = {}; }\n if (searchableMetadata === void 0) { searchableMetadata = {}; }\n if (exactMatchingMetadata === void 0) { exactMatchingMetadata = []; }\n if (suggest === void 0) { suggest = []; }\n return new Item(uuid, null, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest);\n };\n /**\n * Create new located Item\n *\n * @param uuid\n * @param coordinate\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n * @returns {Item}\n */\n Item.createLocated = function (uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n if (metadata === void 0) { metadata = {}; }\n if (indexedMetadata === void 0) { indexedMetadata = {}; }\n if (searchableMetadata === void 0) { searchableMetadata = {}; }\n if (exactMatchingMetadata === void 0) { exactMatchingMetadata = []; }\n if (suggest === void 0) { suggest = []; }\n return new Item(uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest);\n };\n /**\n * Get uuid\n *\n * @returns ItemUUID\n */\n Item.prototype.getUUID = function () {\n return this.uuid;\n };\n /**\n * Get id\n *\n * @returns string\n */\n Item.prototype.getId = function () {\n return this.uuid.getId();\n };\n /**\n * Get type\n *\n * @returns string\n */\n Item.prototype.getType = function () {\n return this.uuid.getType();\n };\n /**\n * Get coordinate\n *\n * @returns Coordinate|null\n */\n Item.prototype.getCoordinate = function () {\n return this.coordinate;\n };\n /**\n * Get distance\n *\n * @returns int\n */\n Item.prototype.getDistance = function () {\n return this.distance;\n };\n /**\n * Get metadata\n *\n * @returns Array\n */\n Item.prototype.getMetadata = function () {\n return this.metadata;\n };\n /**\n * Set metadata\n *\n * @param metadata\n */\n Item.prototype.setMetadata = function (metadata) {\n this.metadata = metadata;\n };\n /**\n * Add metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addMetadata = function (key, value) {\n this.metadata[key] = value;\n };\n /**\n * Get indexed metadata\n *\n * @returns Array\n */\n Item.prototype.getIndexedMetadata = function () {\n return this.indexedMetadata;\n };\n /**\n * Set indexed metadata\n *\n * @param indexedMetadata\n */\n Item.prototype.setIndexedMetadata = function (indexedMetadata) {\n this.indexedMetadata = indexedMetadata;\n };\n /**\n * Add indexed metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addIndexedMetadata = function (key, value) {\n this.indexedMetadata[key] = value;\n };\n /**\n * Get searchable metadata\n *\n * @returns Array\n */\n Item.prototype.getSearchableMetadata = function () {\n return this.searchableMetadata;\n };\n /**\n * Set searchable metadata\n *\n * @param searchableMetadata\n */\n Item.prototype.setSearchableMetadata = function (searchableMetadata) {\n this.searchableMetadata = searchableMetadata;\n };\n /**\n * Add searchable metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addSearchableMetadata = function (key, value) {\n this.searchableMetadata[key] = value;\n };\n /**\n * Get exactMatching metadata\n *\n * @returns Array\n */\n Item.prototype.getExactMatchingMetadata = function () {\n return this.exactMatchingMetadata;\n };\n /**\n * Set exactMatching metadata\n *\n * @param exactMatchingMetadata\n */\n Item.prototype.setExactMatchingMetadata = function (exactMatchingMetadata) {\n this.exactMatchingMetadata = exactMatchingMetadata;\n };\n /**\n * Add exactMatching metadata\n *\n * @param value\n */\n Item.prototype.addExactMatchingMetadata = function (value) {\n this.exactMatchingMetadata.push(value);\n };\n /**\n * Get all metadata\n *\n * @returns {{}}\n */\n Item.prototype.getAllMetadata = function () {\n return tslib_1.__assign({}, this.metadata, this.indexedMetadata);\n };\n /**\n * Get\n *\n * @param key\n *\n * @returns mixed|null\n */\n Item.prototype.get = function (key) {\n var allMetadata = this.getAllMetadata();\n return (typeof allMetadata[key] != \"undefined\")\n ? allMetadata[key]\n : null;\n };\n /**\n * Get suggest\n *\n * @returns Array\n */\n Item.prototype.getSuggest = function () {\n return this.suggest;\n };\n /**\n * Get highlights\n *\n * @returns Array\n */\n Item.prototype.getHighlights = function () {\n return this.highlights;\n };\n /**\n * Get highlight\n *\n * @param key\n *\n * @return string|null\n */\n Item.prototype.getHighlight = function (key) {\n return (typeof this.highlights[key] != \"undefined\")\n ? this.highlights[key]\n : null;\n };\n /**\n * Is promoted\n *\n * @returns boolean\n */\n Item.prototype.isPromoted = function () {\n return this.promoted;\n };\n /**\n * Set score\n *\n * @param score\n *\n * @return {Item}\n */\n Item.prototype.setScore = function (score) {\n this.score = score;\n return this;\n };\n /**\n * Get score\n *\n * @return {number}\n */\n Item.prototype.getScore = function () {\n return this.score;\n };\n /**\n * To array\n */\n Item.prototype.toArray = function () {\n var itemAsArray = {\n uuid: this.uuid.toArray()\n };\n if (this.coordinate instanceof Coordinate_1.Coordinate) {\n itemAsArray.coordinate = this.coordinate.toArray();\n }\n if (Object.keys(this.metadata).length > 0) {\n itemAsArray.metadata = this.metadata;\n }\n if (Object.keys(this.indexedMetadata).length > 0) {\n itemAsArray.indexed_metadata = this.indexedMetadata;\n }\n if (Object.keys(this.searchableMetadata).length > 0) {\n itemAsArray.searchable_metadata = this.searchableMetadata;\n }\n if (this.exactMatchingMetadata.length > 0) {\n itemAsArray.exact_matching_metadata = this.exactMatchingMetadata;\n }\n if (this.suggest.length > 0) {\n itemAsArray.suggest = this.suggest;\n }\n if (Object.keys(this.highlights).length > 0) {\n itemAsArray.highlights = this.highlights;\n }\n if (this.isPromoted()) {\n itemAsArray.is_promoted = true;\n }\n if (typeof this.distance != \"undefined\") {\n itemAsArray.distance = this.distance;\n }\n if (typeof this.score != \"undefined\") {\n itemAsArray.score = this.score;\n }\n return itemAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n */\n Item.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.uuid != \"object\") {\n throw InvalidFormatError_1.InvalidFormatError.itemUUIDRepresentationNotValid();\n }\n if (typeof array.coordinate != \"undefined\" &&\n typeof array.coordinate != \"object\") {\n throw InvalidFormatError_1.InvalidFormatError.coordinateFormatNotValid();\n }\n var item = (typeof array.coordinate == \"object\" &&\n array.coordinate != null)\n ? Item.createLocated(ItemUUID_1.ItemUUID.createFromArray(array.uuid), Coordinate_1.Coordinate.createFromArray(array.coordinate), ((typeof array.metadata == \"undefined\") ? {} : array.metadata), ((typeof array.indexed_metadata == \"undefined\") ? {} : array.indexed_metadata), ((typeof array.searchable_metadata == \"undefined\") ? {} : array.searchable_metadata), ((typeof array.exact_matching_metadata == \"undefined\") ? [] : array.exact_matching_metadata), ((typeof array.suggest == \"undefined\") ? [] : array.suggest))\n : Item.create(ItemUUID_1.ItemUUID.createFromArray(array.uuid), ((typeof array.metadata == \"undefined\") ? {} : array.metadata), ((typeof array.indexed_metadata == \"undefined\") ? {} : array.indexed_metadata), ((typeof array.searchable_metadata == \"undefined\") ? {} : array.searchable_metadata), ((typeof array.exact_matching_metadata == \"undefined\") ? [] : array.exact_matching_metadata), ((typeof array.suggest == \"undefined\") ? [] : array.suggest));\n if (typeof array.distance != \"undefined\" &&\n array.distance != null) {\n item.distance = array.distance;\n }\n if (typeof array.highlights == \"object\" &&\n array.distance != null) {\n item.highlights = array.highlights;\n }\n if (typeof array.is_promoted != \"undefined\" &&\n array.is_promoted != null) {\n item.promoted = array.is_promoted;\n }\n if (typeof array.score != \"undefined\" &&\n array.score != null) {\n item.score = array.score;\n }\n return item;\n };\n /**\n * Compose uuid\n *\n * @returns string\n */\n Item.prototype.composeUUID = function () {\n return this.uuid.composedUUID();\n };\n return Item;\n}());\nexports.Item = Item;\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","\"use strict\";\nexports.__esModule = true;\nvar Filter_1 = require(\"./Filter\");\n/**\n * Aggregation constants\n */\nexports.AGGREGATION_SORT_BY_COUNT_ASC = [\"_count\", \"asc\"];\nexports.AGGREGATION_SORT_BY_COUNT_DESC = [\"_count\", \"desc\"];\nexports.AGGREGATION_SORT_BY_NAME_ASC = [\"_term\", \"asc\"];\nexports.AGGREGATION_SORT_BY_NAME_DESC = [\"_term\", \"desc\"];\nexports.AGGREGATION_NO_LIMIT = 0;\n/**\n * Aggregation class\n */\nvar Aggregation = /** @class */ (function () {\n /**\n * Construct\n *\n * @param name\n * @param field\n * @param applicationType\n * @param filterType\n * @param subgroup\n * @param sort\n * @param limit\n */\n function Aggregation(name, field, applicationType, filterType, subgroup, sort, limit) {\n this.subgroup = [];\n this.name = name;\n this.field = field;\n this.applicationType = applicationType;\n this.filterType = filterType;\n this.subgroup = subgroup;\n this.sort = sort;\n this.limit = limit;\n }\n /**\n * Get name\n *\n * @returns {string}\n */\n Aggregation.prototype.getName = function () {\n return this.name;\n };\n /**\n * Get field\n *\n * @returns {string}\n */\n Aggregation.prototype.getField = function () {\n return this.field;\n };\n /**\n * getApplicationType\n *\n * @returns {number}\n */\n Aggregation.prototype.getApplicationType = function () {\n return this.applicationType;\n };\n /**\n * Get filter type\n *\n * @return {string}\n */\n Aggregation.prototype.getFilterType = function () {\n return this.filterType;\n };\n /**\n * Get subgroup\n *\n * @return {[]}\n */\n Aggregation.prototype.getSubgroup = function () {\n return this.subgroup;\n };\n /**\n * Get sort\n *\n * @return {[]}\n */\n Aggregation.prototype.getSort = function () {\n return this.sort;\n };\n /**\n * Get limit\n *\n * @return {number}\n */\n Aggregation.prototype.getLimit = function () {\n return this.limit;\n };\n /**\n * Create\n *\n * @param name\n * @param field\n * @param applicationType\n * @param filterType\n * @param subgroup\n * @param sort\n * @param limit\n *\n * @returns {Aggregation}\n */\n Aggregation.create = function (name, field, applicationType, filterType, subgroup, sort, limit) {\n if (subgroup === void 0) { subgroup = []; }\n if (sort === void 0) { sort = exports.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = exports.AGGREGATION_NO_LIMIT; }\n return new Aggregation(name, field, applicationType, filterType, subgroup, sort, limit);\n };\n /**\n * To array\n *\n * @returns {Array}\n */\n Aggregation.prototype.toArray = function () {\n var aggregationAsArray = {\n name: this.name\n };\n if (this.field != \"uuid.type\") {\n aggregationAsArray.field = this.field;\n }\n if (this.applicationType != Filter_1.FILTER_AT_LEAST_ONE) {\n aggregationAsArray.application_type = this.applicationType;\n }\n if (this.filterType != Filter_1.FILTER_TYPE_FIELD) {\n aggregationAsArray.filter_type = this.filterType;\n }\n if (this.subgroup.length > 0) {\n aggregationAsArray.subgroup = this.subgroup;\n }\n if (JSON.stringify(this.sort) !== JSON.stringify(exports.AGGREGATION_SORT_BY_COUNT_DESC)) {\n aggregationAsArray.sort = this.sort;\n }\n if (this.limit != exports.AGGREGATION_NO_LIMIT) {\n aggregationAsArray.limit = this.limit;\n }\n return aggregationAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Aggregation}\n */\n Aggregation.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.field == \"undefined\") {\n array.field = \"uuid.type\";\n }\n if (typeof array.application_type == \"undefined\") {\n array.application_type = Filter_1.FILTER_AT_LEAST_ONE;\n }\n if (typeof array.filter_type == \"undefined\") {\n array.filter_type = Filter_1.FILTER_TYPE_FIELD;\n }\n if (typeof array.subgroup == \"undefined\") {\n array.subgroup = [];\n }\n if (typeof array.sort == \"undefined\") {\n array.sort = exports.AGGREGATION_SORT_BY_COUNT_DESC;\n }\n if (typeof array.limit == \"undefined\") {\n array.limit = exports.AGGREGATION_NO_LIMIT;\n }\n return Aggregation.create(array.name, array.field, array.application_type, array.filter_type, array.subgroup, array.sort, array.limit);\n };\n return Aggregation;\n}());\nexports.Aggregation = Aggregation;\n","\"use strict\";\nexports.__esModule = true;\n/**\n export * Sort by constants\n */\nexports.SORT_BY_TYPE_FIELD = 1;\nexports.SORT_BY_TYPE_NESTED = 2;\nexports.SORT_BY_ASC = \"asc\";\nexports.SORT_BY_DESC = \"desc\";\nexports.SORT_BY_MODE_AVG = \"avg\";\nexports.SORT_BY_MODE_SUM = \"sum\";\nexports.SORT_BY_MODE_MIN = \"min\";\nexports.SORT_BY_MODE_MAX = \"max\";\nexports.SORT_BY_MODE_MEDIAN = \"median\";\nexports.SORT_BY_SCORE = {\n _score: {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_RANDOM = {\n random: {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_AL_TUN_TUN = exports.SORT_BY_RANDOM;\nexports.SORT_BY_ID_ASC = {\n \"uuid.id\": {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_ID_DESC = {\n \"uuid.id\": {\n order: exports.SORT_BY_DESC\n }\n};\nexports.SORT_BY_TYPE_ASC = {\n \"uuid.type\": {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_TYPE_DESC = {\n \"uuid.type\": {\n order: exports.SORT_BY_DESC\n }\n};\nexports.SORT_BY_LOCATION_KM_ASC = {\n _geo_distance: {\n order: exports.SORT_BY_ASC,\n unit: \"km\"\n }\n};\nexports.SORT_BY_LOCATION_MI_ASC = {\n _geo_distance: {\n order: exports.SORT_BY_DESC,\n unit: \"mi\"\n }\n};\nvar Coordinate_1 = require(\"../Model/Coordinate\");\nvar Filter_1 = require(\"./Filter\");\n/**\n * ScoreStrategy\n */\nvar SortBy = /** @class */ (function () {\n function SortBy() {\n this.sortsBy = [];\n }\n /**\n * Create\n *\n * @return {SortBy}\n */\n SortBy.create = function () {\n return new SortBy;\n };\n /**\n * Sort By fields values\n *\n * @param shortSortByElements\n *\n * @return {SortBy}\n */\n SortBy.byFieldsValues = function (shortSortByElements) {\n var sortBy = SortBy.create();\n for (var key in shortSortByElements) {\n sortBy.byFieldValue(key, shortSortByElements[key]);\n }\n return sortBy;\n };\n /**\n * All\n *\n * @return {Array}\n */\n SortBy.prototype.all = function () {\n return this.sortsBy.length > 0\n ? this.sortsBy\n : [exports.SORT_BY_SCORE];\n };\n /**\n * Sort by value\n *\n * @param value\n *\n * @return {SortBy}\n */\n SortBy.prototype.byValue = function (value) {\n if (exports.SORT_BY_SCORE != value &&\n exports.SORT_BY_RANDOM != value) {\n if (typeof value.type == \"undefined\") {\n value.type = exports.SORT_BY_TYPE_FIELD;\n }\n }\n if (exports.SORT_BY_SCORE != value) {\n this.sortsBy.push(value);\n }\n return this;\n };\n /**\n * Sort by field value\n *\n * @param field\n * @param order\n *\n * @return {SortBy}\n */\n SortBy.prototype.byFieldValue = function (field, order) {\n var object = {\n type: exports.SORT_BY_TYPE_FIELD\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Sort by nested field\n *\n * @param field\n * @param order\n * @param mode\n *\n * @return {SortBy}\n */\n SortBy.prototype.byNestedField = function (field, order, mode) {\n if (mode === void 0) { mode = exports.SORT_BY_MODE_AVG; }\n var object = {\n type: exports.SORT_BY_TYPE_NESTED,\n mode: mode\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Sort by nested field and filter\n *\n * @param field\n * @param order\n * @param filter\n * @param mode\n *\n * @return {SortBy}\n */\n SortBy.prototype.byNestedFieldAndFilter = function (field, order, filter, mode) {\n if (mode === void 0) { mode = exports.SORT_BY_MODE_AVG; }\n var fieldPath = Filter_1.Filter.getFilterPathByField(filter.getField());\n var filterAsArray = filter.toArray();\n filterAsArray.field = fieldPath;\n filter = Filter_1.Filter.createFromArray(filterAsArray);\n var object = {\n type: exports.SORT_BY_TYPE_NESTED,\n mode: mode,\n filter: filter\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Is sorted by geo distance\n *\n * @return {boolean}\n */\n SortBy.prototype.isSortedByGeoDistance = function () {\n for (var i in this.sortsBy) {\n if (typeof this.sortsBy[i]._geo_distance === typeof {}) {\n return true;\n }\n }\n return false;\n };\n /**\n * Set coordinate\n *\n * @param coordinate\n *\n * @return {SortBy}\n */\n SortBy.prototype.setCoordinate = function (coordinate) {\n for (var i in this.sortsBy) {\n if (typeof this.sortsBy[i]._geo_distance === typeof {}) {\n this.sortsBy[i]._geo_distance.coordinate = coordinate;\n }\n }\n return this;\n };\n /**\n * Has random sort\n *\n * @return {boolean}\n */\n SortBy.prototype.hasRandomSort = function () {\n for (var i in this.sortsBy) {\n if (JSON.stringify(this.sortsBy[i]) === JSON.stringify(exports.SORT_BY_RANDOM)) {\n return true;\n }\n }\n return false;\n };\n /**\n * To array\n *\n * @return {[]}\n */\n SortBy.prototype.toArray = function () {\n var copySortBy = this.copy();\n var sortsByAsArray = copySortBy.sortsBy;\n for (var i in sortsByAsArray) {\n if (sortsByAsArray[i].type == exports.SORT_BY_TYPE_FIELD) {\n delete sortsByAsArray[i].type;\n }\n if (typeof sortsByAsArray[i].filter === typeof {} &&\n sortsByAsArray[i].filter != null) {\n sortsByAsArray[i].filter = sortsByAsArray[i].filter.toArray();\n }\n if (typeof sortsByAsArray[i]._geo_distance === typeof {} &&\n sortsByAsArray[i]._geo_distance !== null &&\n sortsByAsArray[i]._geo_distance.coordinate instanceof Coordinate_1.Coordinate) {\n sortsByAsArray[i]._geo_distance.coordinate = sortsByAsArray[i]._geo_distance.coordinate.toArray();\n }\n }\n return sortsByAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {SortBy}\n */\n SortBy.createFromArray = function (array) {\n var innerArray = JSON.parse(JSON.stringify(array));\n var sortBy = SortBy.create();\n for (var i in innerArray) {\n var element = innerArray[i];\n if (JSON.stringify(element) !== JSON.stringify(exports.SORT_BY_RANDOM) &&\n JSON.stringify(element) !== JSON.stringify(exports.SORT_BY_SCORE)) {\n if (typeof element.type == \"undefined\") {\n element.type = exports.SORT_BY_TYPE_FIELD;\n }\n }\n if (typeof element.filter === typeof {} &&\n element.filter != null) {\n element.filter = Filter_1.Filter.createFromArray(element.filter);\n }\n if (typeof element._geo_distance === typeof {} &&\n element._geo_distance != null &&\n typeof element._geo_distance.coordinate === typeof {}) {\n element._geo_distance.coordinate = Coordinate_1.Coordinate.createFromArray(element._geo_distance.coordinate);\n }\n sortBy.sortsBy.push(element);\n }\n return sortBy;\n };\n /**\n * Make a copy of this\n *\n * @returns {SortBy}\n */\n SortBy.prototype.copy = function () {\n var newSortBy = SortBy.create();\n for (var i in this.sortsBy) {\n var sortBy = this.sortsBy[i];\n var sortByAsArray = JSON.parse(JSON.stringify(sortBy));\n if (typeof sortBy.filter === typeof {} &&\n sortBy.filter != null) {\n sortByAsArray.filter = Filter_1.Filter.createFromArray(sortBy.filter.toArray());\n }\n if (typeof sortBy._geo_distance === typeof {} &&\n sortBy._geo_distance != null &&\n typeof sortBy._geo_distance.coordinate == typeof {}) {\n sortByAsArray._geo_distance.coordinate = Coordinate_1.Coordinate.createFromArray(sortBy._geo_distance.coordinate.toArray());\n }\n newSortBy.sortsBy.push(sortByAsArray);\n }\n return newSortBy;\n };\n return SortBy;\n}());\nexports.SortBy = SortBy;\n","\"use strict\";\nexports.__esModule = true;\nvar Item_1 = require(\"../Model/Item\");\nvar Query_1 = require(\"../Query/Query\");\nvar ResultAggregations_1 = require(\"./ResultAggregations\");\n/**\n * Result class\n */\nvar Result = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param query\n * @param totalItems\n * @param totalHits\n */\n function Result(query, totalItems, totalHits) {\n this.items = [];\n this.suggests = [];\n this.query = query;\n this.totalItems = totalItems;\n this.totalHits = totalHits;\n }\n /**\n * Create\n *\n * @param query\n * @param totalItems\n * @param totalHits\n * @param aggregations\n * @param suggests\n * @param items\n *\n * @returns {Result}\n */\n Result.create = function (query, totalItems, totalHits, aggregations, suggests, items) {\n var result = new Result(query, totalItems, totalHits);\n result.aggregations = aggregations;\n result.suggests = suggests;\n result.items = items;\n return result;\n };\n /**\n * Add item\n *\n * @param item\n */\n Result.prototype.addItem = function (item) {\n this.items.push(item);\n };\n /**\n * Get items\n *\n * @return {Item[]}\n */\n Result.prototype.getItems = function () {\n return this.items;\n };\n /**\n * Get items grouped by types\n *\n * @return {any[]}\n */\n Result.prototype.getItemsGroupedByTypes = function () {\n if (this.itemsGroupedByTypeCache instanceof Object &&\n Object.keys(this.itemsGroupedByTypeCache).length > 0) {\n return this.itemsGroupedByTypeCache;\n }\n var itemsGroupedByTypes = {};\n for (var i in this.items) {\n var item = this.items[i];\n if (!(itemsGroupedByTypes[item.getType()] instanceof Array)) {\n itemsGroupedByTypes[item.getType()] = [];\n }\n itemsGroupedByTypes[item.getType()].push(item);\n }\n this.itemsGroupedByTypeCache = itemsGroupedByTypes;\n return itemsGroupedByTypes;\n };\n /**\n * Get items by type\n *\n * @param type\n *\n * @return {Array}\n */\n Result.prototype.getItemsByType = function (type) {\n var itemsGroupedByTypes = this.getItemsGroupedByTypes();\n return itemsGroupedByTypes[type] == null\n ? []\n : itemsGroupedByTypes[type];\n };\n /**\n * Get items by types\n *\n * @param types\n */\n Result.prototype.getItemsByTypes = function (types) {\n return this.items.filter(function (item) { return types.indexOf(item.getType()) >= 0; });\n };\n /**\n * Get first item\n *\n * @return {Item}\n */\n Result.prototype.getFirstItem = function () {\n return this.items.length > 0\n ? this.items[0]\n : null;\n };\n /**\n * Set aggregations\n *\n * @param aggregations\n */\n Result.prototype.setAggregations = function (aggregations) {\n this.aggregations = aggregations;\n };\n /**\n * Get aggregations\n *\n * @return {ResultAggregations}\n */\n Result.prototype.getAggregations = function () {\n return this.aggregations instanceof ResultAggregations_1.ResultAggregations\n ? this.aggregations\n : null;\n };\n /**\n * Get aggregation\n *\n * @param name\n *\n * @return {null}\n */\n Result.prototype.getAggregation = function (name) {\n return this.aggregations == null\n ? null\n : this.aggregations.getAggregation(name);\n };\n /**\n * Has no empty aggregation\n *\n * @param name\n *\n * @return {boolean}\n */\n Result.prototype.hasNotEmptyAggregation = function (name) {\n return this.aggregations == null\n ? false\n : this.aggregations.hasNotEmptyAggregation(name);\n };\n /**\n * Add suggest\n *\n * @param suggest\n */\n Result.prototype.addSuggest = function (suggest) {\n this.suggests.push(suggest);\n };\n /**\n * Get suggests\n *\n * @return {string[]}\n */\n Result.prototype.getSuggests = function () {\n return this.suggests;\n };\n /**\n * Get query\n *\n * @return {Query}\n */\n Result.prototype.getQuery = function () {\n return this.query;\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n Result.prototype.getTotalItems = function () {\n return this.totalItems;\n };\n /**\n * Get total hits\n *\n * @return {number}\n */\n Result.prototype.getTotalHits = function () {\n return this.totalHits;\n };\n /**\n * to array\n *\n * @return {{query: any, total_items: number, total_hits: number, items:any[], aggregations: any, suggests: string[]}}\n */\n Result.prototype.toArray = function () {\n return {\n query: this.query.toArray(),\n total_items: this.totalItems,\n total_hits: this.totalHits,\n items: this.items.map(function (item) { return item.toArray(); }),\n aggregations: this.aggregations == null\n ? null\n : this.aggregations.toArray(),\n suggests: this.suggests\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Result}\n */\n Result.createFromArray = function (array) {\n return Result.create(Query_1.Query.createFromArray(array.query), array.total_items\n ? array.total_items\n : 0, array.total_hits\n ? array.total_hits\n : 0, array.aggregations instanceof Object\n ? ResultAggregations_1.ResultAggregations.createFromArray(array.aggregations)\n : null, array.suggests\n ? array.suggests\n : null, array.items instanceof Array\n ? array.items.map(function (itemAsArray) { return Item_1.Item.createFromArray(itemAsArray); })\n : []);\n };\n return Result;\n}());\nexports.Result = Result;\n","\"use strict\";\nexports.__esModule = true;\nvar ResultAggregation_1 = require(\"./ResultAggregation\");\n/**\n * ResultAggregation class\n */\nvar ResultAggregations = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param totalElements\n */\n function ResultAggregations(totalElements) {\n this.aggregations = {};\n this.totalElements = totalElements;\n }\n /**\n * Add aggregation\n *\n * @param name\n * @param aggregation\n */\n ResultAggregations.prototype.addAggregation = function (name, aggregation) {\n this.aggregations[name] = aggregation;\n };\n /**\n * Get aggregations\n *\n * @returns {{}}\n */\n ResultAggregations.prototype.getAggregations = function () {\n return this.aggregations;\n };\n /**\n * Get aggregation\n *\n * @param name\n *\n * @returns {Aggregation|null}\n */\n ResultAggregations.prototype.getAggregation = function (name) {\n return this.aggregations[name] instanceof ResultAggregation_1.ResultAggregation\n ? this.aggregations[name]\n : null;\n };\n /**\n * Has not empty aggregation\n *\n * @param name\n *\n * @returns {boolean}\n */\n ResultAggregations.prototype.hasNotEmptyAggregation = function (name) {\n var aggregation = this.getAggregation(name);\n return (aggregation instanceof ResultAggregation_1.ResultAggregation) &&\n (!aggregation.isEmpty());\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n ResultAggregations.prototype.getTotalElements = function () {\n return this.totalElements;\n };\n /**\n * To array\n *\n * @return {{total_elements?: number, aggregations?: {}}}\n */\n ResultAggregations.prototype.toArray = function () {\n var aggregationCollection = {};\n for (var i in this.aggregations) {\n aggregationCollection[i] = this.aggregations[i].toArray();\n }\n var array = {};\n if (this.totalElements > 0) {\n array.total_elements = this.totalElements;\n }\n if (Object.keys(aggregationCollection).length > 0) {\n array.aggregations = aggregationCollection;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {ResultAggregations}\n */\n ResultAggregations.createFromArray = function (array) {\n var aggregations = new ResultAggregations(typeof array.total_elements === \"number\"\n ? array.total_elements\n : 0);\n if (typeof array.aggregations === typeof {}) {\n for (var i in array.aggregations) {\n aggregations.addAggregation(i, ResultAggregation_1.ResultAggregation.createFromArray(array.aggregations[i]));\n }\n }\n return aggregations;\n };\n return ResultAggregations;\n}());\nexports.ResultAggregations = ResultAggregations;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar axios_1 = require(\"axios\");\nvar Client_1 = require(\"./Client\");\nvar Response_1 = require(\"./Response\");\n/**\n * AxiosClient\n */\nvar AxiosClient = /** @class */ (function (_super) {\n tslib_1.__extends(AxiosClient, _super);\n /**\n * Constructor\n *\n * @param host\n * @param version\n * @param timeout\n * @param retryMap\n * @param overrideQueries\n * @param cache\n */\n function AxiosClient(host, version, timeout, retryMap, overrideQueries, cache) {\n var _this = _super.call(this, version, retryMap) || this;\n _this.host = host;\n _this.timeout = timeout;\n _this.cache = cache;\n _this.overrideQueries = overrideQueries;\n _this.cancelToken = {};\n return _this;\n }\n /**\n * Get\n *\n * @param url\n * @param method\n * @param credentials\n * @param parameters\n * @param data\n *\n * @return {Promise}\n */\n AxiosClient.prototype.get = function (url, method, credentials, parameters, data) {\n if (parameters === void 0) { parameters = {}; }\n if (data === void 0) { data = {}; }\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n var that;\n var _this = this;\n return tslib_1.__generator(this, function (_a) {\n that = this;\n url = url.replace(/^\\/*|\\/*$/g, \"\");\n url = \"/\" + (this.version + \"/\" + url).replace(/^\\/*|\\/*$/g, \"\");\n method = method.toLowerCase();\n if (\"get\" === method &&\n this.overrideQueries) {\n this.abort(url);\n }\n return [2 /*return*/, new Promise(function (resolve, reject) {\n var headers = \"get\" == method\n ? {}\n : {\n \"Content-Encoding\": \"gzip\",\n \"Content-Type\": \"application/json\"\n };\n var axiosRequestConfig = {\n url: url + \"?\" + Client_1.Client.objectToUrlParameters(tslib_1.__assign({}, credentials, parameters)),\n data: data,\n headers: headers,\n method: method,\n baseURL: that.host.replace(/\\/*$/g, \"\"),\n timeout: that.timeout,\n transformRequest: [function (data) { return JSON.stringify(data); }]\n };\n if (typeof _this.cancelToken[url] != 'undefined') {\n axiosRequestConfig.cancelToken = _this.cancelToken[url].token;\n }\n axios_1[\"default\"]\n .request(axiosRequestConfig)\n .then(function (axiosResponse) {\n var response = new Response_1.Response(axiosResponse.status, axiosResponse.data);\n return resolve(response);\n })[\"catch\"](function (error) {\n if (error.response === undefined) {\n return;\n }\n var response = new Response_1.Response(error.response.status, error.response.data);\n return reject(response);\n });\n })];\n });\n });\n };\n /**\n * Abort current request\n * And regenerate the cancellation token\n *\n * @param url\n */\n AxiosClient.prototype.abort = function (url) {\n if (typeof this.cancelToken[url] != 'undefined') {\n this.cancelToken[url].cancel();\n }\n this.generateCancelToken(url);\n };\n /**\n * Generate a new cancellation token for a query\n *\n * @param url\n */\n AxiosClient.prototype.generateCancelToken = function (url) {\n this.cancelToken[url] = axios_1[\"default\"].CancelToken.source();\n };\n return AxiosClient;\n}(Client_1.Client));\nexports.AxiosClient = AxiosClient;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildURL = require('./../helpers/buildURL');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar btoa = (typeof window !== 'undefined' && window.btoa && window.btoa.bind(window)) || require('./../helpers/btoa');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n var loadEvent = 'onreadystatechange';\n var xDomain = false;\n\n // For IE 8/9 CORS support\n // Only supports POST and GET calls and doesn't returns the response headers.\n // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.\n if (process.env.NODE_ENV !== 'test' &&\n typeof window !== 'undefined' &&\n window.XDomainRequest && !('withCredentials' in request) &&\n !isURLSameOrigin(config.url)) {\n request = new window.XDomainRequest();\n loadEvent = 'onload';\n xDomain = true;\n request.onprogress = function handleProgress() {};\n request.ontimeout = function handleTimeout() {};\n }\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request[loadEvent] = function handleLoad() {\n if (!request || (request.readyState !== 4 && !xDomain)) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n // IE sends 1223 instead of 204 (https://github.com/axios/axios/issues/201)\n status: request.status === 1223 ? 204 : request.status,\n statusText: request.status === 1223 ? 'No Content' : request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = require('./../helpers/cookies');\n\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Client\n */\nvar Client = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param version\n * @param retryMap\n */\n function Client(version, retryMap) {\n this.retryMap = retryMap;\n this.version = version.replace(/^\\/*|\\/*$/g, \"\");\n }\n /**\n * Build an url parameters array by an object\n *\n * @param params\n *\n * @returns {string}\n */\n Client.objectToUrlParameters = function (params) {\n var builtParams = [];\n for (var i in params) {\n builtParams.push(i + \"=\" + params[i]);\n }\n return builtParams.join(\"&\");\n };\n return Client;\n}());\nexports.Client = Client;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Response\n */\nvar Response = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param code\n * @param body\n */\n function Response(code, body) {\n this.code = code;\n this.body = body;\n }\n /**\n * Get code\n *\n * @return {number}\n */\n Response.prototype.getCode = function () {\n return this.code;\n };\n /**\n * Get body\n *\n * @return {any}\n */\n Response.prototype.getBody = function () {\n return this.body;\n };\n return Response;\n}());\nexports.Response = Response;\n","\"use strict\";\nexports.__esModule = true;\nvar Retry_1 = require(\"./Retry\");\n/**\n * Http class\n */\nvar RetryMap = /** @class */ (function () {\n function RetryMap() {\n this.retries = {};\n }\n /**\n * Add retry\n *\n * @param retry\n */\n RetryMap.prototype.addRetry = function (retry) {\n this.retries[retry.getUrl() + \"~~\" + retry.getMethod()] = retry;\n };\n /**\n * Create from array\n */\n RetryMap.createFromArray = function (array) {\n var retryMap = new RetryMap();\n retryMap.retries = array.map(function (retry) { return Retry_1.Retry.createFromArray(retry); });\n return retryMap;\n };\n /**\n * Get retry\n *\n * @param url\n * @param method\n *\n * @returns {Retry}\n */\n RetryMap.prototype.getRetry = function (url, method) {\n if (this.retries[url + \"~~\" + method] instanceof Retry_1.Retry) {\n return this.retries[url + \"~~\" + method];\n }\n if (this.retries[\"*~~\" + method] instanceof Retry_1.Retry) {\n return this.retries[\"*~~\" + method];\n }\n if (this.retries[url + \"~~*\"] instanceof Retry_1.Retry) {\n return this.retries[url + \"~~*\"];\n }\n if (this.retries[\"*~~*\"] instanceof Retry_1.Retry) {\n return this.retries[\"*~~*\"];\n }\n return null;\n };\n return RetryMap;\n}());\nexports.RetryMap = RetryMap;\n","\"use strict\";\nexports.__esModule = true;\nexports.DEFAULT_MICROSECONDS_BETWEEN_RETRIES = 1000;\n/**\n * Http class\n */\nvar Retry = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param url\n * @param method\n * @param retries\n * @param microsecondsBetweenRetries\n */\n function Retry(url, method, retries, microsecondsBetweenRetries) {\n this.url = url;\n this.method = method;\n this.retries = retries;\n this.microsecondsBetweenRetries = microsecondsBetweenRetries;\n }\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Retry}\n */\n Retry.createFromArray = function (array) {\n return new Retry(array.url ? array.url : \"*\", array.method ? array.method : \"*\", array.retries ? array.retries : 0, array.microseconds_between_retries\n ? array.microseconds_between_retries\n : exports.DEFAULT_MICROSECONDS_BETWEEN_RETRIES);\n };\n /**\n * Get url\n *\n * @return {string}\n */\n Retry.prototype.getUrl = function () {\n return this.url;\n };\n /**\n * Get method\n *\n * @return {string}\n */\n Retry.prototype.getMethod = function () {\n return this.method;\n };\n /**\n * Ge retries\n *\n * @return {number}\n */\n Retry.prototype.getRetries = function () {\n return this.retries;\n };\n /**\n * Get microseconds between retries\n *\n * @return {number}\n */\n Retry.prototype.getMicrosecondsBetweenRetries = function () {\n return this.microsecondsBetweenRetries;\n };\n return Retry;\n}());\nexports.Retry = Retry;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * User class\n */\nvar User = /** @class */ (function () {\n /**\n * Construct\n *\n * @param id string\n * @param attributes Array\n */\n function User(id, attributes) {\n if (attributes === void 0) { attributes = {}; }\n this.id = id;\n this.attributes = attributes;\n }\n /**\n * Return the user id\n *\n * @return {string}\n */\n User.prototype.getId = function () {\n return this.id;\n };\n /**\n * Return array\n *\n * @returns {{}}\n */\n User.prototype.getAttributes = function () {\n return this.attributes;\n };\n /**\n * To array\n *\n * @returns {{id: string, attributes: {}}}\n */\n User.prototype.toArray = function () {\n var array = {\n id: this.id\n };\n if (Object.keys(this.attributes).length > 0) {\n array.attributes = this.attributes;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return User\n */\n User.createFromArray = function (array) {\n if (array == null ||\n typeof array.id == \"undefined\" ||\n array.id == null) {\n throw InvalidFormatError_1.InvalidFormatError.userFormatNotValid();\n }\n var attributes = typeof array.attributes === typeof {}\n ? array.attributes\n : {};\n return new User(array.id, attributes);\n };\n return User;\n}());\nexports.User = User;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Aggregation constants\n */\nexports.SCORE_STRATEGY_DEFAULT = 0;\nexports.SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD = 1;\nexports.SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION = 2;\n/**\n * ScoreStrategy\n */\nvar ScoreStrategy = /** @class */ (function () {\n function ScoreStrategy() {\n this.type = exports.SCORE_STRATEGY_DEFAULT;\n this.innerFunction = null;\n }\n /**\n * Get type\n *\n * @returns {number}\n */\n ScoreStrategy.prototype.getType = function () {\n return this.type;\n };\n /**\n * Get function\n *\n * @returns {string}\n */\n ScoreStrategy.prototype.getFunction = function () {\n return this.innerFunction;\n };\n /**\n * Create default\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createDefault = function () {\n return new ScoreStrategy();\n };\n /**\n * Create relevance boosting\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createRelevanceBoosting = function () {\n var scoreStrategy = ScoreStrategy.createDefault();\n scoreStrategy.type = exports.SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD;\n return scoreStrategy;\n };\n /**\n * Create relevance boosting\n *\n * @param innerFunction\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createCustomFunction = function (innerFunction) {\n var scoreStrategy = ScoreStrategy.createDefault();\n scoreStrategy.type = exports.SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION;\n scoreStrategy.innerFunction = innerFunction;\n return scoreStrategy;\n };\n /**\n *\n * @return {{type: number, function: string}}\n */\n ScoreStrategy.prototype.toArray = function () {\n return {\n type: this.type,\n \"function\": this.innerFunction\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var scoreStrategy = ScoreStrategy.createDefault();\n if (typeof array.type == \"undefined\") {\n array.type = exports.SCORE_STRATEGY_DEFAULT;\n }\n if (typeof array[\"function\"] == \"undefined\") {\n array.innerFunction = null;\n }\n scoreStrategy.type = array.type;\n scoreStrategy.innerFunction = array[\"function\"];\n return scoreStrategy;\n };\n return ScoreStrategy;\n}());\nexports.ScoreStrategy = ScoreStrategy;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ConnectionError_1 = require(\"../Error/ConnectionError\");\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar InvalidTokenError_1 = require(\"../Error/InvalidTokenError\");\nvar ResourceExistsError_1 = require(\"../Error/ResourceExistsError\");\nvar ResourceNotAvailableError_1 = require(\"../Error/ResourceNotAvailableError\");\nvar Item_1 = require(\"../Model/Item\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\nvar Result_1 = require(\"../Result/Result\");\nvar Repository_1 = require(\"./Repository\");\nvar Index_1 = require(\"../Model/Index\");\n/**\n * Aggregation class\n */\nvar HttpRepository = /** @class */ (function (_super) {\n tslib_1.__extends(HttpRepository, _super);\n /**\n * Constructor\n *\n * @param httpClient\n * @param appId\n * @param indexId\n * @param token\n * @param transformer\n */\n function HttpRepository(httpClient, appId, indexId, token, transformer) {\n var _this = _super.call(this, appId, indexId, token) || this;\n _this.httpClient = httpClient;\n _this.transformer = transformer;\n return _this;\n }\n /**\n * Get transformer\n *\n * @return {Transformer}\n */\n HttpRepository.prototype.getTransformer = function () {\n return this.transformer;\n };\n /**\n * Generate item document by a simple object.\n *\n * @param object\n */\n HttpRepository.prototype.addObject = function (object) {\n var item = this\n .transformer\n .toItem(object);\n if (item instanceof Item_1.Item) {\n this.addItem(item);\n }\n };\n /**\n * Delete item document by uuid.\n *\n * @param object\n */\n HttpRepository.prototype.deleteObject = function (object) {\n var itemUUID = this\n .transformer\n .toItemUUID(object);\n if (itemUUID instanceof ItemUUID_1.ItemUUID) {\n this.deleteItem(itemUUID);\n }\n };\n /**\n * Flush update items\n *\n * @param itemsToUpdate\n *\n * @return {Promise}\n */\n HttpRepository.prototype.flushUpdateItems = function (itemsToUpdate) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n if (itemsToUpdate.length === 0) {\n return [2 /*return*/];\n }\n return [2 /*return*/, this\n .httpClient\n .get(\"/items\", \"post\", this.getCredentialsWithIndex(this.indexId), {}, {\n items: itemsToUpdate.map(function (item) {\n return item.toArray();\n })\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n })];\n });\n });\n };\n /**\n * Flush delete items\n *\n * @param itemsToDelete\n *\n * @return {Promise}\n */\n HttpRepository.prototype.flushDeleteItems = function (itemsToDelete) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n if (itemsToDelete.length === 0) {\n return [2 /*return*/];\n }\n return [2 /*return*/, this\n .httpClient\n .get(\"/items\", \"delete\", this.getCredentialsWithIndex(this.indexId), {}, {\n items: itemsToDelete.map(function (itemUUID) {\n return itemUUID.toArray();\n })\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n })];\n });\n });\n };\n /**\n * Query\n *\n * @param query\n *\n * @return {Promise}\n */\n HttpRepository.prototype.query = function (query) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n var that;\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n that = this;\n return [4 /*yield*/, this\n .httpClient\n .get(\"/\", \"get\", this.getCredentialsWithIndex(this.indexId), {\n query: JSON.stringify(query.toArray())\n }, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n var result = Result_1.Result.createFromArray(response.getBody());\n return Result_1.Result.create(result.getQuery(), result.getTotalItems(), result.getTotalHits(), result.getAggregations(), result.getSuggests(), that\n .transformer\n .fromItems(result.getItems()));\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update items\n *\n * @param query\n * @param changes\n *\n * @return {Promise}\n */\n HttpRepository.prototype.updateItems = function (query, changes) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/items\", \"put\", this.getCredentialsWithIndex(this.indexId), {}, {\n query: query.toArray(),\n changes: changes.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create index\n *\n * @param indexUUID\n * @param config\n *\n * @return {Promise}\n */\n HttpRepository.prototype.createIndex = function (indexUUID, config) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"put\", this.getCredentials(), {}, {\n index: indexUUID.toArray(),\n config: config.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete index\n *\n * @param indexUUID\n *\n * @return {Promise}\n */\n HttpRepository.prototype.deleteIndex = function (indexUUID) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"delete\", this.getCredentialsWithIndex(this.indexId), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Reset index\n *\n * @param indexUUID\n *\n * @return {Promise}\n */\n HttpRepository.prototype.resetIndex = function (indexUUID) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index/reset\", \"post\", this.getCredentialsWithIndex(this.indexId), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Check index\n *\n * @param indexUUID\n *\n * @return {Promise}\n */\n HttpRepository.prototype.checkIndex = function (indexUUID) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"head\", this.getCredentialsWithIndex(this.indexId), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return response.getCode() === 200;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Check index\n *\n * @return {Promise}\n */\n HttpRepository.prototype.getIndices = function () {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/indices\", \"get\", this.getCredentials(), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n var result = [];\n for (var _i = 0, _a = response.getBody(); _i < _a.length; _i++) {\n var indexAsArray = _a[_i];\n result.push(Index_1.Index.createFromArray(indexAsArray));\n }\n return result;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Configure index\n *\n * @param indexUUID\n * @param config\n *\n * @return {Promise}\n */\n HttpRepository.prototype.configureIndex = function (indexUUID, config) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"post\", this.getCredentialsWithIndex(this.indexId), {}, {\n config: config.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get query values\n *\n * @returns any\n */\n HttpRepository.prototype.getCredentials = function () {\n return {\n app_id: this.appId,\n token: this.token\n };\n };\n /**\n * Get query values\n *\n * @param indexComposedUUID\n *\n * @returns any\n */\n HttpRepository.prototype.getCredentialsWithIndex = function (indexComposedUUID) {\n return {\n app_id: this.appId,\n index: indexComposedUUID,\n token: this.token\n };\n };\n /**\n * throw error if needed\n *\n * @param response\n */\n HttpRepository.throwTransportableExceptionIfNeeded = function (response) {\n if (typeof response.getCode() == \"undefined\") {\n return;\n }\n switch (response.getCode()) {\n case ResourceNotAvailableError_1.ResourceNotAvailableError.getTransportableHTTPError():\n throw new ResourceNotAvailableError_1.ResourceNotAvailableError(response.getBody().message);\n case InvalidTokenError_1.InvalidTokenError.getTransportableHTTPError():\n throw new InvalidTokenError_1.InvalidTokenError(response.getBody().message);\n case InvalidFormatError_1.InvalidFormatError.getTransportableHTTPError():\n throw new InvalidFormatError_1.InvalidFormatError(response.getBody().message);\n case ResourceExistsError_1.ResourceExistsError.getTransportableHTTPError():\n throw new ResourceExistsError_1.ResourceExistsError(response.getBody().message);\n case ConnectionError_1.ConnectionError.getTransportableHTTPError():\n throw new ConnectionError_1.ConnectionError(response.getBody().message);\n }\n };\n return HttpRepository;\n}(Repository_1.Repository));\nexports.HttpRepository = HttpRepository;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Connection error\n */\nvar ConnectionError = /** @class */ (function (_super) {\n tslib_1.__extends(ConnectionError, _super);\n function ConnectionError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ConnectionError.getTransportableHTTPError = function () {\n return 500;\n };\n return ConnectionError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ConnectionError = ConnectionError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Invalid token error\n */\nvar InvalidTokenError = /** @class */ (function (_super) {\n tslib_1.__extends(InvalidTokenError, _super);\n function InvalidTokenError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n InvalidTokenError.getTransportableHTTPError = function () {\n return 401;\n };\n /**\n * Invalid token permissions\n *\n * @param tokenReference\n *\n * @return {InvalidTokenError}\n */\n InvalidTokenError.createInvalidTokenPermissions = function (tokenReference) {\n return new InvalidTokenError(\"Token \" + tokenReference + \"not valid\");\n };\n /**\n * Invalid token permissions\n *\n * @param tokenReference\n * @param maxHitsPerQuery\n *\n * @return {InvalidTokenError}\n */\n InvalidTokenError.createInvalidTokenMaxHitsPerQuery = function (tokenReference, maxHitsPerQuery) {\n return new InvalidTokenError(\"Token \" + tokenReference + \"not valid. Max \" + maxHitsPerQuery + \" hits allowed\");\n };\n return InvalidTokenError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.InvalidTokenError = InvalidTokenError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Resource exists error\n */\nvar ResourceExistsError = /** @class */ (function (_super) {\n tslib_1.__extends(ResourceExistsError, _super);\n function ResourceExistsError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ResourceExistsError.getTransportableHTTPError = function () {\n return 409;\n };\n /**\n * Index not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.indexAvailable = function () {\n return new ResourceExistsError(\"Index exists and cannot be created again\");\n };\n /**\n * Events not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.eventsIndexAvailable = function () {\n return new ResourceExistsError(\"Events index exists and cannot be created again\");\n };\n /**\n * Logs not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.logsIndexAvailable = function () {\n return new ResourceExistsError(\"Logs index exists and cannot be created again\");\n };\n return ResourceExistsError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ResourceExistsError = ResourceExistsError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Resource not available error\n */\nvar ResourceNotAvailableError = /** @class */ (function (_super) {\n tslib_1.__extends(ResourceNotAvailableError, _super);\n function ResourceNotAvailableError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ResourceNotAvailableError.getTransportableHTTPError = function () {\n return 404;\n };\n /**\n * Index not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.indexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Index not available - \" + resourceId);\n };\n /**\n * Events not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.eventsIndexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Events not available - \" + resourceId);\n };\n /**\n * Logs not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.logsIndexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Logs not available - \" + resourceId);\n };\n /**\n * Engine not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.engineNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Engine not available - \" + resourceId);\n };\n return ResourceNotAvailableError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ResourceNotAvailableError = ResourceNotAvailableError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar Filter_1 = require(\"../Query/Filter\");\nvar Counter_1 = require(\"./Counter\");\n/**\n * ResultAggregation class\n */\nvar ResultAggregation = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param name\n * @param applicationType\n * @param totalElements\n * @param activeElements\n */\n function ResultAggregation(name, applicationType, totalElements, activeElements) {\n this.counters = {};\n this.highestActiveElement = 0;\n this.name = name;\n this.applicationType = applicationType;\n this.totalElements = totalElements;\n this.activeElements = {};\n for (var i in activeElements) {\n var activeElement = activeElements[i];\n this.activeElements[activeElement] = activeElement;\n }\n }\n /**\n * Add counter\n *\n * @param name\n * @param counter\n */\n ResultAggregation.prototype.addCounter = function (name, counter) {\n if (counter == 0) {\n return;\n }\n var counterInstance = Counter_1.Counter.createByActiveElements(name, counter, Object.keys(this.activeElements));\n if (!(counterInstance instanceof Counter_1.Counter)) {\n return;\n }\n if ((this.applicationType & Filter_1.FILTER_MUST_ALL_WITH_LEVELS) &&\n (this.applicationType & ~Filter_1.FILTER_MUST_ALL) &&\n counterInstance.isUsed()) {\n this.activeElements[counterInstance.getId()] = counterInstance;\n this.highestActiveElement = Math.max(counterInstance.getLevel(), this.highestActiveElement);\n return;\n }\n this.counters[counterInstance.getId()] = counterInstance;\n };\n /**\n * Get name\n *\n * @return {string}\n */\n ResultAggregation.prototype.getName = function () {\n return this.name;\n };\n /**\n * Get counter\n *\n * @return {any}\n */\n ResultAggregation.prototype.getCounters = function () {\n return this.counters;\n };\n /**\n * Return if the aggregation belongs to a filter.\n *\n * @return {boolean}\n */\n ResultAggregation.prototype.isFilter = function () {\n return (this.applicationType & Filter_1.FILTER_MUST_ALL) > 0;\n };\n /**\n * Aggregation has levels.\n *\n * @return {boolean}\n */\n ResultAggregation.prototype.hasLevels = function () {\n return (this.applicationType & Filter_1.FILTER_MUST_ALL_WITH_LEVELS) > 0;\n };\n /**\n * Get counter by name\n *\n * @param name\n *\n * @return {null}\n */\n ResultAggregation.prototype.getCounter = function (name) {\n return this.counters[name] instanceof Counter_1.Counter\n ? this.counters[name]\n : null;\n };\n /**\n * Get all elements\n *\n * @return {{}}\n */\n ResultAggregation.prototype.getAllElements = function () {\n return tslib_1.__assign({}, this.activeElements, this.counters);\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n ResultAggregation.prototype.getTotalElements = function () {\n return this.totalElements;\n };\n /**\n * Get active elements\n *\n * @return {any}\n */\n ResultAggregation.prototype.getActiveElements = function () {\n if (Object.keys(this.activeElements).length === 0) {\n return {};\n }\n if (this.applicationType === Filter_1.FILTER_MUST_ALL_WITH_LEVELS) {\n var value = null;\n for (var i in this.activeElements) {\n var activeElement = this.activeElements[i];\n if (!(activeElement instanceof Counter_1.Counter)) {\n continue;\n }\n if (value == null) {\n value = activeElement;\n }\n value = value.getLevel() > activeElement.getLevel()\n ? value\n : activeElement;\n }\n return value instanceof Counter_1.Counter\n ? { 0: value }\n : null;\n }\n return this.activeElements;\n };\n /**\n * Clean results by level and remove all levels higher than the lowest.\n */\n ResultAggregation.prototype.cleanCountersByLevel = function () {\n for (var i in this.counters) {\n var counter = this.counters[i];\n if (counter.getLevel() !== this.highestActiveElement + 1) {\n delete this.counters[i];\n }\n }\n };\n /**\n * Is empty\n *\n * @returns {boolean}\n */\n ResultAggregation.prototype.isEmpty = function () {\n return Object.keys(this.activeElements).length == 0 &&\n Object.keys(this.counters).length == 0;\n };\n /**\n * To array\n *\n * @return {any}\n */\n ResultAggregation.prototype.toArray = function () {\n var array = {\n name: this.name,\n counters: [],\n active_elements: []\n };\n for (var i in this.counters) {\n array.counters.push(this.counters[i].toArray());\n }\n if (this.applicationType !== Filter_1.FILTER_AT_LEAST_ONE) {\n array.application_type = this.applicationType;\n }\n if (this.totalElements > 0) {\n array.total_elements = this.totalElements;\n }\n for (var i in this.activeElements) {\n var activeElement = this.activeElements[i];\n array.active_elements.push(activeElement instanceof Counter_1.Counter\n ? activeElement.toArray()\n : activeElement);\n }\n if (this.highestActiveElement > 0) {\n array.highest_active_level = this.highestActiveElement;\n }\n if (array.counters.length === 0) {\n delete array.counters;\n }\n if (array.active_elements.length === 0) {\n delete array.active_elements;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n */\n ResultAggregation.createFromArray = function (array) {\n var activeElements = [];\n var activeElementsAsArray = array.active_elements;\n activeElementsAsArray = typeof activeElementsAsArray === typeof []\n ? activeElementsAsArray\n : [];\n for (var i in activeElementsAsArray) {\n var activeElementAsArray = activeElementsAsArray[i];\n activeElements.push(typeof activeElementAsArray === typeof {}\n ? Counter_1.Counter.createFromArray(activeElementAsArray)\n : activeElementAsArray);\n }\n var aggregation = new ResultAggregation(array.name, parseInt(array.application_type ? array.application_type : Filter_1.FILTER_AT_LEAST_ONE), parseInt(array.total_elements ? array.total_elements : 0), []);\n aggregation.activeElements = activeElements;\n var countersAsArray = typeof array.counters === typeof []\n ? array.counters\n : [];\n for (var i in countersAsArray) {\n var counterAsArray = countersAsArray[i];\n var counter = Counter_1.Counter.createFromArray(counterAsArray);\n aggregation.counters[counter.getId()] = counter;\n }\n aggregation.highestActiveElement = typeof array.highest_active_level === \"number\"\n ? array.highest_active_level\n : 0;\n return aggregation;\n };\n return ResultAggregation;\n}());\nexports.ResultAggregation = ResultAggregation;\n","\"use strict\";\nexports.__esModule = true;\nvar Metadata_1 = require(\"../Model/Metadata\");\n/**\n * Aggregation class\n */\nvar Counter = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param values\n * @param used\n * @param n\n */\n function Counter(values, used, n) {\n this.values = values;\n this.used = used;\n this.n = n;\n }\n /**\n * Get id\n *\n * @return {string|null}\n */\n Counter.prototype.getId = function () {\n return typeof this.values.id == \"string\"\n ? this.values.id\n : null;\n };\n /**\n * Get name\n *\n * @return {string|null}\n */\n Counter.prototype.getName = function () {\n return typeof this.values.name == \"string\"\n ? this.values.name\n : null;\n };\n /**\n * Get slug\n *\n * @return {string|null}\n */\n Counter.prototype.getSlug = function () {\n return typeof this.values.slug == \"string\"\n ? this.values.slug\n : null;\n };\n /**\n * Get level\n *\n * @return {number}\n */\n Counter.prototype.getLevel = function () {\n return typeof this.values.level == \"number\"\n ? this.values.level\n : 0;\n };\n /**\n * Get values\n *\n * @returns {{}}\n */\n Counter.prototype.getValues = function () {\n return this.values;\n };\n /**\n * Is used\n *\n * @returns {boolean}\n */\n Counter.prototype.isUsed = function () {\n return this.used;\n };\n /**\n * Get N\n *\n * @returns {number}\n */\n Counter.prototype.getN = function () {\n return this.n;\n };\n /**\n * Create by active elements\n *\n * @param name\n * @param n\n * @param activeElements\n */\n Counter.createByActiveElements = function (name, n, activeElements) {\n var values = Metadata_1.Metadata.fromMetadata(name);\n if (values == null) {\n return null;\n }\n var i = activeElements.length;\n var inActiveElements = false;\n while (i--) {\n if (activeElements[i] == values.id) {\n inActiveElements = true;\n }\n }\n return new Counter(values, inActiveElements, n);\n };\n /**\n * To array\n *\n * @return {{}}\n */\n Counter.prototype.toArray = function () {\n var values = {\n values: this.values,\n n: this.n\n };\n if (this.used === true) {\n values.used = true;\n }\n return values;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Counter}\n */\n Counter.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new Counter(array.values, (typeof array.used == \"boolean\")\n ? array.used\n : false, array.n);\n };\n return Counter;\n}());\nexports.Counter = Counter;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * User class\n */\nvar Metadata = /** @class */ (function () {\n function Metadata() {\n }\n /**\n * To metadata\n *\n * @param array:{}\n *\n * @returns {string}\n */\n Metadata.toMetadata = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var parts = [];\n for (var key in array) {\n parts.push(key + \"##\" + array[key]);\n }\n return parts.join(\"~~\");\n };\n /**\n * From metadata\n *\n * @param metadata\n *\n * @return {{}}\n */\n Metadata.fromMetadata = function (metadata) {\n var values = {};\n var splittedParts = metadata.split(\"~~\");\n var iterator = 0;\n var size = 0;\n var lastElement = null;\n for (var key in splittedParts) {\n var part = splittedParts[key];\n var parts = part.split(\"##\");\n if (parts.length > 1) {\n lastElement = parts[1];\n values[parts[0]] = lastElement;\n }\n else {\n lastElement = part;\n values[iterator++] = lastElement;\n }\n size++;\n }\n if (size == 1) {\n values = {\n id: lastElement,\n name: lastElement\n };\n }\n if (typeof values.id == \"undefined\") {\n return null;\n }\n return values;\n };\n return Metadata;\n}());\nexports.Metadata = Metadata;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\n/**\n * Aggregation class\n */\nvar Repository = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param appId\n * @param indexId\n * @param token\n */\n function Repository(appId, indexId, token) {\n this.itemsToUpdate = [];\n this.itemsToDelete = [];\n this.appId = appId;\n this.indexId = indexId;\n this.token = token;\n }\n /**\n * Reset cached elements\n */\n Repository.prototype.resetCachedElements = function () {\n this.itemsToUpdate = [];\n this.itemsToDelete = [];\n };\n /**\n * Add element\n *\n * @param item\n */\n Repository.prototype.addItem = function (item) {\n this.itemsToUpdate.push(item);\n };\n /**\n * Add elements\n *\n * @param items\n */\n Repository.prototype.addItems = function (items) {\n for (var i in items) {\n this.addItem(items[i]);\n }\n };\n /**\n * Delete item\n *\n * @param itemUUID\n */\n Repository.prototype.deleteItem = function (itemUUID) {\n this.itemsToDelete.push(itemUUID);\n };\n /**\n * Delete items\n *\n * @param itemsUUID\n */\n Repository.prototype.deleteItems = function (itemsUUID) {\n for (var i in itemsUUID) {\n this.deleteItem(itemsUUID[i]);\n }\n };\n /**\n * flush\n *\n * @param bulkNumber\n * @param skipIfLess\n *\n * @return {Promise}\n */\n Repository.prototype.flush = function (bulkNumber, skipIfLess) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n var _this = this;\n return tslib_1.__generator(this, function (_a) {\n if (!bulkNumber) {\n bulkNumber = 500;\n }\n if (!skipIfLess) {\n skipIfLess = false;\n }\n if (skipIfLess &&\n this.itemsToUpdate.length < bulkNumber) {\n return [2 /*return*/];\n }\n return [2 /*return*/, Promise.all(Repository\n .chunkArray(this.itemsToUpdate, bulkNumber)\n .map(function (arrayOfItems) {\n return _this.flushUpdateItems(arrayOfItems);\n })\n .concat(Repository\n .chunkArray(this.itemsToDelete, bulkNumber)\n .map(function (arrayOfItemsUUID) {\n return _this.flushDeleteItems(arrayOfItemsUUID);\n }))).then(function (_) {\n _this.resetCachedElements();\n })[\"catch\"](function (_) {\n _this.resetCachedElements();\n })];\n });\n });\n };\n /**\n * Make chunks of n elements\n *\n * @param array\n * @param chunk\n *\n * @return any[]\n */\n Repository.chunkArray = function (array, chunk) {\n var arrayChunked = [];\n for (var i = 0, j = array.length; i < j; i += chunk) {\n arrayChunked.push(array.slice(i, i + chunk));\n }\n return arrayChunked;\n };\n return Repository;\n}());\nexports.Repository = Repository;\n","\"use strict\";\nexports.__esModule = true;\nvar Item_1 = require(\"../Model/Item\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\n/**\n * Transformer\n */\nvar Transformer = /** @class */ (function () {\n function Transformer() {\n this.readTransformers = [];\n this.writeTransformers = [];\n }\n /**\n * Add read transformer\n *\n * @param readTransformer\n */\n Transformer.prototype.addReadTransformer = function (readTransformer) {\n this\n .readTransformers\n .push(readTransformer);\n };\n /**\n * Add write transformer\n *\n * @param writeTransformer\n */\n Transformer.prototype.addWriteTransformer = function (writeTransformer) {\n this\n .writeTransformers\n .push(writeTransformer);\n };\n /**\n * Items to objects\n *\n * @param items\n *\n * @returns {any[]}\n */\n Transformer.prototype.fromItems = function (items) {\n var objects = [];\n for (var i in items) {\n objects.push(this.fromItem(items[i]));\n }\n return objects;\n };\n /**\n * Item to object\n *\n * @param item\n *\n * @returns {any}\n */\n Transformer.prototype.fromItem = function (item) {\n for (var i in this.readTransformers) {\n var transformer = this.readTransformers[i];\n if (transformer.isValidItem(item)) {\n return transformer.fromItem(item);\n }\n }\n return item;\n };\n /**\n * Objects to items\n *\n * @param objects\n *\n * @returns {Item[]}\n */\n Transformer.prototype.toItems = function (objects) {\n var items = [];\n for (var i in objects) {\n var item = this.toItem(objects[i]);\n if (item instanceof Item_1.Item) {\n items.push(item);\n }\n }\n return items;\n };\n /**\n * Object to item\n *\n * @param object\n *\n * @returns {any}\n */\n Transformer.prototype.toItem = function (object) {\n for (var i in this.writeTransformers) {\n var transformer = this.writeTransformers[i];\n if (transformer.isValidObject(object)) {\n return transformer.toItem(object);\n }\n }\n return object;\n };\n /**\n * Objects to items\n *\n * @param objects\n *\n * @returns {ItemUUID[]}\n */\n Transformer.prototype.toItemUUIDs = function (objects) {\n var itemUUIDs = [];\n for (var i in objects) {\n var itemUUID = this.toItemUUID(objects[i]);\n if (itemUUID instanceof ItemUUID_1.ItemUUID) {\n itemUUIDs.push(itemUUID);\n }\n }\n return itemUUIDs;\n };\n /**\n * Object to item\n *\n * @param object\n *\n * @returns {any}\n */\n Transformer.prototype.toItemUUID = function (object) {\n for (var i in this.writeTransformers) {\n var transformer = this.writeTransformers[i];\n if (transformer.isValidObject(object)) {\n return transformer.toItemUUID(object);\n }\n }\n return object;\n };\n return Transformer;\n}());\nexports.Transformer = Transformer;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Result class\n */\nvar Synonym = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param words\n */\n function Synonym(words) {\n this.words = words;\n }\n /**\n * get words\n *\n * @return {string[]}\n */\n Synonym.prototype.getWords = function () {\n return this.words;\n };\n /**\n * Create by words\n *\n * @param words\n *\n * @return {Synonym}\n */\n Synonym.createbyWords = function (words) {\n return new Synonym(words);\n };\n /**\n * To array\n *\n * @return {{words: string[]}}\n */\n Synonym.prototype.toArray = function () {\n return {\n words: this.words\n };\n };\n /**\n * create from array\n *\n * @param array\n *\n * @returns {Synonym}\n */\n Synonym.createFromArray = function (array) {\n return new Synonym(array.words instanceof Object\n ? array.words\n : []);\n };\n /**\n * Expand\n *\n * @returns {string}\n */\n Synonym.prototype.expand = function () {\n return this.words.join(\",\");\n };\n return Synonym;\n}());\nexports.Synonym = Synonym;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar Apisearch_1 = require(\"./Apisearch\");\nexports[\"default\"] = Apisearch_1[\"default\"];\ntslib_1.__exportStar(require(\"./Cache/InMemoryCache\"), exports);\ntslib_1.__exportStar(require(\"./Config/Config\"), exports);\ntslib_1.__exportStar(require(\"./Config/Synonym\"), exports);\ntslib_1.__exportStar(require(\"./Error/ConnectionError\"), exports);\ntslib_1.__exportStar(require(\"./Error/ErrorWithMessage\"), exports);\ntslib_1.__exportStar(require(\"./Error/EventError\"), exports);\ntslib_1.__exportStar(require(\"./Error/ForbiddenError\"), exports);\ntslib_1.__exportStar(require(\"./Error/InvalidFormatError\"), exports);\ntslib_1.__exportStar(require(\"./Error/InvalidTokenError\"), exports);\ntslib_1.__exportStar(require(\"./Error/ResourceExistsError\"), exports);\ntslib_1.__exportStar(require(\"./Error/ResourceNotAvailableError\"), exports);\ntslib_1.__exportStar(require(\"./Error/UnsupportedContentTypeError\"), exports);\ntslib_1.__exportStar(require(\"./Geo/LocationRange\"), exports);\ntslib_1.__exportStar(require(\"./Http/AxiosClient\"), exports);\ntslib_1.__exportStar(require(\"./Http/Client\"), exports);\ntslib_1.__exportStar(require(\"./Http/HttpClient\"), exports);\ntslib_1.__exportStar(require(\"./Http/Response\"), exports);\ntslib_1.__exportStar(require(\"./Http/Retry\"), exports);\ntslib_1.__exportStar(require(\"./Http/RetryMap\"), exports);\ntslib_1.__exportStar(require(\"./Model/Changes\"), exports);\ntslib_1.__exportStar(require(\"./Model/Coordinate\"), exports);\ntslib_1.__exportStar(require(\"./Model/Item\"), exports);\ntslib_1.__exportStar(require(\"./Model/ItemUUID\"), exports);\ntslib_1.__exportStar(require(\"./Model/Metadata\"), exports);\ntslib_1.__exportStar(require(\"./Model/User\"), exports);\ntslib_1.__exportStar(require(\"./Query/Aggregation\"), exports);\ntslib_1.__exportStar(require(\"./Query/Filter\"), exports);\ntslib_1.__exportStar(require(\"./Query/Query\"), exports);\ntslib_1.__exportStar(require(\"./Query/Range\"), exports);\ntslib_1.__exportStar(require(\"./Query/ScoreStrategy\"), exports);\ntslib_1.__exportStar(require(\"./Query/SortBy\"), exports);\ntslib_1.__exportStar(require(\"./Repository/HttpRepository\"), exports);\ntslib_1.__exportStar(require(\"./Repository/Repository\"), exports);\ntslib_1.__exportStar(require(\"./Result/ResultAggregation\"), exports);\ntslib_1.__exportStar(require(\"./Result/ResultAggregations\"), exports);\ntslib_1.__exportStar(require(\"./Result/Counter\"), exports);\ntslib_1.__exportStar(require(\"./Result/Result\"), exports);\ntslib_1.__exportStar(require(\"./Transformer/Transformer\"), exports);\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar NoCache_1 = require(\"./Cache/NoCache\");\nvar AxiosClient_1 = require(\"./Http/AxiosClient\");\nvar RetryMap_1 = require(\"./Http/RetryMap\");\nvar Query_1 = require(\"./Query/Query\");\nvar Query_2 = require(\"./Query/Query\");\nvar Query_3 = require(\"./Query/Query\");\nvar SortBy_1 = require(\"./Query/SortBy\");\nvar HttpRepository_1 = require(\"./Repository/HttpRepository\");\nvar Result_1 = require(\"./Result/Result\");\nvar ResultAggregations_1 = require(\"./Result/ResultAggregations\");\nvar Transformer_1 = require(\"./Transformer/Transformer\");\n/**\n * Apisearch class\n */\nvar Apisearch = /** @class */ (function () {\n function Apisearch() {\n }\n /**\n * Constructor\n *\n * @param config\n *\n * @return {HttpRepository}\n */\n Apisearch.createRepository = function (config) {\n Apisearch.ensureRepositoryConfigIsValid(config);\n config.options = tslib_1.__assign({ api_version: \"v1\", cache: new NoCache_1.NoCache(), timeout: 5000, override_queries: true }, config.options);\n /**\n * Client\n */\n var httpClient = typeof config.options.http_client !== \"undefined\"\n ? config.options.http_client\n : new AxiosClient_1.AxiosClient(config.options.endpoint, config.options.api_version, config.options.timeout, new RetryMap_1.RetryMap(), config.options.override_queries, config.options.cache);\n return new HttpRepository_1.HttpRepository(httpClient, config.app_id, config.index_id, config.token, new Transformer_1.Transformer());\n };\n /**\n * Ensure the Repository configuration is valid\n *\n * @param config\n */\n Apisearch.ensureRepositoryConfigIsValid = function (config) {\n Apisearch.ensureIsDefined(config.app_id, \"app_id\");\n Apisearch.ensureIsDefined(config.index_id, \"index_id\");\n Apisearch.ensureIsDefined(config.token, \"token\");\n Apisearch.ensureIsDefined(config.options.endpoint, \"options.endpoint\");\n };\n /**\n * Ensure the value is not undefined\n *\n * @param param\n * @param name\n */\n Apisearch.ensureIsDefined = function (param, name) {\n if (typeof param === \"undefined\") {\n throw new TypeError(name + \" parameter must be defined.\");\n }\n };\n /**\n * Created located\n *\n * @param coordinate\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Apisearch.createQueryLocated = function (coordinate, queryText, page, size) {\n if (page === void 0) { page = Query_1.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = Query_2.QUERY_DEFAULT_SIZE; }\n return Query_3.Query.createLocated(coordinate, queryText, page, size);\n };\n /**\n * Create\n *\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Apisearch.createQuery = function (queryText, page, size) {\n if (page === void 0) { page = Query_1.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = Query_2.QUERY_DEFAULT_SIZE; }\n return Query_3.Query.create(queryText, page, size);\n };\n /**\n * Create match all\n *\n * @return {Query}\n */\n Apisearch.createQueryMatchAll = function () {\n return Query_3.Query.createMatchAll();\n };\n /**\n * Create by UUID\n *\n * @param uuid\n *\n * @return {Query}\n */\n Apisearch.createQueryByUUID = function (uuid) {\n return Query_3.Query.createByUUID(uuid);\n };\n /**\n * Create by UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Apisearch.createQueryByUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n return Query_3.Query.createByUUIDs.apply(Query_3.Query, uuids);\n };\n /**\n * Create empty result\n *\n * @return {Result}\n */\n Apisearch.createEmptyResult = function () {\n return Result_1.Result.create(Apisearch.createQueryMatchAll(), 0, 0, new ResultAggregations_1.ResultAggregations(0), [], []);\n };\n /**\n * Create empty sortby\n *\n * @return {SortBy}\n */\n Apisearch.createEmptySortBy = function () {\n return SortBy_1.SortBy.create();\n };\n return Apisearch;\n}());\nexports[\"default\"] = Apisearch;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Cache class\n */\nvar NoCache = /** @class */ (function () {\n function NoCache() {\n }\n /**\n * Set cache element\n *\n * @param key\n * @param value\n *\n * @returns {void}\n */\n NoCache.prototype.set = function (key, value) {\n // Empty\n };\n /**\n * Get element from cache\n *\n * @param key\n *\n * @returns {any}\n */\n NoCache.prototype.get = function (key) {\n return undefined;\n };\n /**\n * Deletes element from cache\n *\n * @param key\n */\n NoCache.prototype.del = function (key) {\n // Empty\n };\n /**\n * Clear cache\n */\n NoCache.prototype.clear = function () {\n // Empty\n };\n return NoCache;\n}());\nexports.NoCache = NoCache;\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(utils.merge(defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","'use strict';\n\nvar defaults = require('./../defaults');\nvar utils = require('./../utils');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = utils.merge({\n url: arguments[0]\n }, arguments[1]);\n }\n\n config = utils.merge(defaults, this.defaults, { method: 'get' }, config);\n config.method = config.method.toLowerCase();\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n // Note: status is not exposed by XDomainRequest\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n error.request = request;\n error.response = response;\n return error;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n }\n\n if (!utils.isArray(val)) {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\n// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js\n\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\nfunction E() {\n this.message = 'String contains an invalid character';\n}\nE.prototype = new Error;\nE.prototype.code = 5;\nE.prototype.name = 'InvalidCharacterError';\n\nfunction btoa(input) {\n var str = String(input);\n var output = '';\n for (\n // initialize result and counter\n var block, charCode, idx = 0, map = chars;\n // if the next str index does not exist:\n // change the mapping table to \"=\"\n // check if d has no fractional digits\n str.charAt(idx | 0) || (map = '=', idx % 1);\n // \"8 - idx % 1 * 8\" generates the sequence 2, 4, 6, 8\n output += map.charAt(63 & block >> 8 - idx % 1 * 8)\n ) {\n charCode = str.charCodeAt(idx += 3 / 4);\n if (charCode > 0xFF) {\n throw new E();\n }\n block = block << 8 | charCode;\n }\n return output;\n}\n\nmodule.exports = btoa;\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar isAbsoluteURL = require('./../helpers/isAbsoluteURL');\nvar combineURLs = require('./../helpers/combineURLs');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Support baseURL config\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers || {}\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar IndexUUID_1 = require(\"./IndexUUID\");\nvar AppUUID_1 = require(\"./AppUUID\");\n/**\n * Index class\n */\nvar Index = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param uuid\n * @param appUUID\n * @param isOK\n * @param docCount\n * @param size\n */\n function Index(uuid, appUUID, isOK, docCount, size) {\n if (isOK === void 0) { isOK = false; }\n if (docCount === void 0) { docCount = 0; }\n if (size === void 0) { size = '0kb'; }\n this.uuid = uuid;\n this.appUUID = appUUID;\n this.isOK = isOK;\n this.docCount = docCount;\n this.size = size;\n }\n /**\n * Get uuid\n *\n * @return {IndexUUID}\n */\n Index.prototype.getUUID = function () {\n return this.uuid;\n };\n /**\n * Get app id\n *\n * @return {AppUUID}\n */\n Index.prototype.getAppUUID = function () {\n return this.appUUID;\n };\n /**\n * Index is OK\n *\n * @return {boolean}\n */\n Index.prototype.isOk = function () {\n return this.isOK;\n };\n /**\n * Get doc count\n *\n * @return {number}\n */\n Index.prototype.getDocCount = function () {\n return this.docCount;\n };\n /**\n * get size\n *\n * @return {string}\n */\n Index.prototype.getSize = function () {\n return this.size;\n };\n /**\n * To array\n *\n * @returns {{id: string, attributes: {}}}\n */\n Index.prototype.toArray = function () {\n return {\n uuid: this.uuid.toArray(),\n app_id: this.appUUID.toArray(),\n is_ok: this.isOK,\n doc_count: this.docCount,\n size: this.size\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return User\n */\n Index.createFromArray = function (array) {\n if (typeof array.uuid == \"undefined\" ||\n typeof array.app_id == \"undefined\") {\n throw InvalidFormatError_1.InvalidFormatError.indexFormatNotValid();\n }\n return new Index(IndexUUID_1.IndexUUID.createFromArray(array.uuid), AppUUID_1.AppUUID.createFromArray(array.app_id), (typeof array.is_ok == \"undefined\" ? false : array.is_ok), (typeof array.doc_count == \"undefined\" ? 0 : array.doc_count), (typeof array.size == \"undefined\" ? '0kb' : array.size));\n };\n return Index;\n}());\nexports.Index = Index;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * IndexUUID class\n */\nvar IndexUUID = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param id\n */\n function IndexUUID(id) {\n if (id.indexOf('_') >= 0) {\n throw InvalidFormatError_1.InvalidFormatError.indexUUIDFormatNotValid();\n }\n this.id = id;\n }\n /**\n * Create by id\n *\n * @param id\n *\n * @returns {ItemUUID}\n */\n IndexUUID.createById = function (id) {\n return new IndexUUID(id);\n };\n /**\n * Return id\n *\n * @returns {string}\n */\n IndexUUID.prototype.getId = function () {\n return this.id;\n };\n /**\n * To array\n *\n * @returns {{id: *, type: *}}\n */\n IndexUUID.prototype.toArray = function () {\n return {\n id: this.id\n };\n };\n /**\n * Create from array\n *\n * @param array {{id:string, type:string}}\n *\n * @return {ItemUUID}\n */\n IndexUUID.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new IndexUUID(array.id);\n };\n /**\n * Compose unique id\n *\n * @returns {string}\n */\n IndexUUID.prototype.composedUUID = function () {\n return this.id;\n };\n return IndexUUID;\n}());\nexports.IndexUUID = IndexUUID;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * AppUUID class\n */\nvar AppUUID = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param id\n */\n function AppUUID(id) {\n if (id.indexOf('_') >= 0) {\n throw InvalidFormatError_1.InvalidFormatError.appUUIDFormatNotValid();\n }\n this.id = id;\n }\n /**\n * Create by id\n *\n * @param id\n *\n * @returns {ItemUUID}\n */\n AppUUID.createById = function (id) {\n return new AppUUID(id);\n };\n /**\n * Return id\n *\n * @returns {string}\n */\n AppUUID.prototype.getId = function () {\n return this.id;\n };\n /**\n * To array\n *\n * @returns {{id: *, type: *}}\n */\n AppUUID.prototype.toArray = function () {\n return {\n id: this.id\n };\n };\n /**\n * Create from array\n *\n * @param array {{id:string, type:string}}\n *\n * @return {ItemUUID}\n */\n AppUUID.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new AppUUID(array.id);\n };\n /**\n * Compose unique id\n *\n * @returns {string}\n */\n AppUUID.prototype.composedUUID = function () {\n return this.id;\n };\n return AppUUID;\n}());\nexports.AppUUID = AppUUID;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\n/**\n * Cache class\n */\nvar InMemoryCache = /** @class */ (function () {\n /**\n * Constructor\n */\n function InMemoryCache() {\n this.cache = {};\n this.size = 0;\n this.cache = {};\n this.size = 0;\n }\n /**\n * Set cache element\n *\n * @param key\n * @param value\n *\n * @returns {void}\n */\n InMemoryCache.prototype.set = function (key, value) {\n var _a;\n this.cache = tslib_1.__assign({}, this.cache, (_a = {}, _a[key] = value, _a));\n this.size = this.size + 1;\n };\n /**\n * Get element from cache\n *\n * @param key\n *\n * @returns {any}\n */\n InMemoryCache.prototype.get = function (key) {\n return this.cache[key];\n };\n /**\n * Deletes element from cache\n *\n * @param key\n */\n InMemoryCache.prototype.del = function (key) {\n delete this.cache[key];\n };\n /**\n * Clear cache\n */\n InMemoryCache.prototype.clear = function () {\n this.cache = {};\n this.size = 0;\n };\n return InMemoryCache;\n}());\nexports.InMemoryCache = InMemoryCache;\n","\"use strict\";\nexports.__esModule = true;\nvar Synonym_1 = require(\"./Synonym\");\n/**\n * Result class\n */\nvar Config = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param language\n * @param storeSearchableMetadata\n */\n function Config(language, storeSearchableMetadata) {\n if (language === void 0) { language = null; }\n if (storeSearchableMetadata === void 0) { storeSearchableMetadata = true; }\n this.synonyms = [];\n this.language = language;\n this.storeSearchableMetadata = storeSearchableMetadata;\n }\n /**\n * Get language\n *\n * @return {string}\n */\n Config.prototype.getLanguage = function () {\n return this.language;\n };\n /**\n * Should searchable metadata be stored\n *\n * @return {boolean}\n */\n Config.prototype.shouldSearchableMetadataBeStored = function () {\n return this.storeSearchableMetadata;\n };\n /**\n * Add synonym\n *\n * @param synonym\n */\n Config.prototype.addSynonym = function (synonym) {\n this.synonyms.push(synonym);\n };\n /**\n * Get synonyms\n *\n * @return {Synonym[]}\n */\n Config.prototype.getSynonyms = function () {\n return this.synonyms;\n };\n /**\n * to array\n */\n Config.prototype.toArray = function () {\n return {\n language: this.language,\n store_searchable_metadata: this.storeSearchableMetadata,\n synonyms: this.synonyms.map(function (synonym) { return synonym.toArray(); })\n };\n };\n /**\n * Create from array\n */\n Config.createFromArray = function (array) {\n var immutableConfig = new Config(array.language ? array.language : null, typeof array.store_searchable_metadata == \"boolean\"\n ? array.store_searchable_metadata\n : true);\n if (array.synonyms instanceof Array &&\n array.synonyms.length > 0) {\n immutableConfig.synonyms = array.synonyms.map(function (synonym) { return Synonym_1.Synonym.createFromArray(synonym); });\n }\n return immutableConfig;\n };\n return Config;\n}());\nexports.Config = Config;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * EventError\n */\nvar EventError = /** @class */ (function (_super) {\n tslib_1.__extends(EventError, _super);\n function EventError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n EventError.throwEndpointNotAvailable = function () {\n return new EventError(\"Endpoint not available\");\n };\n return EventError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.EventError = EventError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Forbidden Error\n */\nvar ForbiddenError = /** @class */ (function (_super) {\n tslib_1.__extends(ForbiddenError, _super);\n function ForbiddenError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ForbiddenError.getTransportableHTTPError = function () {\n return 403;\n };\n /**\n * App id is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createAppIdIsRequiredException = function () {\n return new ForbiddenError(\"AppId query parameter MUST be defined with a valid value\");\n };\n /**\n * Index id is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createIndexIsRequiredException = function () {\n return new ForbiddenError(\"Index query parameter MUST be defined with a valid value\");\n };\n /**\n * Token is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createTokenIsRequiredException = function () {\n return new ForbiddenError(\"Token query parameter MUST be defined with a valid value\");\n };\n return ForbiddenError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ForbiddenError = ForbiddenError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Unsupported content type error\n */\nvar UnsupportedContentTypeError = /** @class */ (function (_super) {\n tslib_1.__extends(UnsupportedContentTypeError, _super);\n function UnsupportedContentTypeError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n UnsupportedContentTypeError.getTransportableHTTPError = function () {\n return 415;\n };\n /**\n * Unsupported content type\n *\n * @return {InvalidFormatError}\n */\n UnsupportedContentTypeError.createUnsupportedContentTypeException = function () {\n return new UnsupportedContentTypeError(\"This content type is not accepted. Please use application/json\");\n };\n return UnsupportedContentTypeError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.UnsupportedContentTypeError = UnsupportedContentTypeError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar Coordinate_1 = require(\"../Model/Coordinate\");\n/**\n * Abstract Location Range class\n */\nvar LocationRange = /** @class */ (function () {\n function LocationRange() {\n }\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n LocationRange.fromFilterObject = function (object) {\n throw TypeError(\"Method not valid\");\n };\n /**\n * to array\n */\n LocationRange.prototype.toArray = function () {\n return {\n type: this.getName(),\n data: this.toFilterObject()\n };\n };\n /**\n * Create from array\n *\n * @param array\n */\n LocationRange.createFromArray = function (array) {\n if (array.type == \"CoordinateAndDistance\") {\n return CoordinateAndDistance.fromFilterObject(array.data);\n }\n if (array.type == \"Polygon\") {\n return Polygon.fromFilterObject(array.data);\n }\n if (array.type == \"Square\") {\n return Square.fromFilterObject(array.data);\n }\n };\n return LocationRange;\n}());\nexports.LocationRange = LocationRange;\n/**\n * CoordinateAndDistance\n */\nvar CoordinateAndDistance = /** @class */ (function (_super) {\n tslib_1.__extends(CoordinateAndDistance, _super);\n /**\n * Constructor\n *\n * @param coordinate\n * @param distance\n */\n function CoordinateAndDistance(coordinate, distance) {\n var _this = _super.call(this) || this;\n _this.coordinate = coordinate;\n _this.distance = distance;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{}}}\n */\n CoordinateAndDistance.prototype.toFilterObject = function () {\n return {\n coordinate: this.coordinate.toArray(),\n distance: this.distance\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n CoordinateAndDistance.prototype.getName = function () {\n return \"CoordinateAndDistance\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n CoordinateAndDistance.fromFilterObject = function (object) {\n return new CoordinateAndDistance(Coordinate_1.Coordinate.createFromArray(object.coordinate), object.distance);\n };\n return CoordinateAndDistance;\n}(LocationRange));\nexports.CoordinateAndDistance = CoordinateAndDistance;\n/**\n * Polygon\n */\nvar Polygon = /** @class */ (function (_super) {\n tslib_1.__extends(Polygon, _super);\n /**\n * Constructor\n *\n * @param coordinates\n */\n function Polygon(coordinates) {\n var _this = _super.call(this) || this;\n if (coordinates.length < 3) {\n throw new Error(\"A polygon needs more than two coordinates.\");\n }\n _this.coordinates = coordinates;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{coordinates: {lat:number, lon:number}[]}}\n */\n Polygon.prototype.toFilterObject = function () {\n var coordinates = [];\n for (var i in this.coordinates) {\n coordinates.push(this.coordinates[i].toArray());\n }\n return {\n coordinates: coordinates\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n Polygon.prototype.getName = function () {\n return \"Polygon\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {Polygon}\n */\n Polygon.fromFilterObject = function (object) {\n var coordinates = [];\n for (var i in object.coordinates) {\n coordinates.push(Coordinate_1.Coordinate.createFromArray(object.coordinates[i]));\n }\n return new Polygon(coordinates);\n };\n return Polygon;\n}(LocationRange));\nexports.Polygon = Polygon;\n/**\n * Square\n */\nvar Square = /** @class */ (function (_super) {\n tslib_1.__extends(Square, _super);\n /**\n * Constructor\n *\n * @param topLeftCoordinate\n * @param bottomRightCoordinate\n */\n function Square(topLeftCoordinate, bottomRightCoordinate) {\n var _this = _super.call(this) || this;\n _this.topLeftCoordinate = topLeftCoordinate;\n _this.bottomRightCoordinate = bottomRightCoordinate;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{}}}\n */\n Square.prototype.toFilterObject = function () {\n return {\n top_left: this.topLeftCoordinate.toArray(),\n bottom_right: this.bottomRightCoordinate.toArray()\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n Square.prototype.getName = function () {\n return \"Square\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n Square.fromFilterObject = function (object) {\n return new Square(Coordinate_1.Coordinate.createFromArray(object.top_left), Coordinate_1.Coordinate.createFromArray(object.bottom_right));\n };\n return Square;\n}(LocationRange));\nexports.Square = Square;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Http class\n */\nvar HttpClient = /** @class */ (function () {\n function HttpClient() {\n }\n return HttpClient;\n}());\nexports.HttpClient = HttpClient;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * filter constants\n */\nexports.TYPE_VALUE = 1;\nexports.TYPE_LITERAL = 4;\nexports.TYPE_ARRAY_ELEMENT_UPDATE = 8;\nexports.TYPE_ARRAY_ELEMENT_ADD = 16;\nexports.TYPE_ARRAY_ELEMENT_DELETE = 32;\nexports.TYPE_ARRAY_EXPECTS_ELEMENT = 24;\nexports.TYPE_ARRAY = 56;\n/**\n * Changes Type cast\n * @param Changes\n */\nvar Changes = /** @class */ (function () {\n function Changes() {\n /**\n * Changes\n *\n * @type {Array}\n */\n this.changes = [];\n }\n /**\n * Add new change\n *\n * @param field\n * @param value\n * @param type\n */\n Changes.prototype.addChange = function (field, value, type) {\n if (type === void 0) { type = exports.TYPE_VALUE; }\n this.changes.push({\n field: field,\n type: type,\n value: value\n });\n };\n /**\n * Update element from list\n *\n * @param field\n * @param condition\n * @param value\n * @param type\n */\n Changes.prototype.updateElementFromList = function (field, condition, value, type) {\n this.changes.push({\n field: field,\n type: type | exports.TYPE_ARRAY_ELEMENT_UPDATE,\n condition: condition,\n value: value\n });\n };\n /**\n * Add element in list\n *\n * @param field\n * @param value\n * @param type\n */\n Changes.prototype.addElementInList = function (field, value, type) {\n this.changes.push({\n field: field,\n type: type | exports.TYPE_ARRAY_ELEMENT_ADD,\n value: value\n });\n };\n /**\n * Delete element from list\n *\n * @param field\n * @param condition\n */\n Changes.prototype.deleteElementFromList = function (field, condition) {\n this.changes.push({\n field: field,\n type: exports.TYPE_ARRAY_ELEMENT_DELETE,\n condition: condition\n });\n };\n /**\n * Get changes\n *\n * @returns {[]}\n */\n Changes.prototype.getChanges = function () {\n return this.changes;\n };\n /**\n * Create\n *\n * @returns {Changes}\n */\n Changes.create = function () {\n return new Changes();\n };\n /**\n * To array\n *\n * @returns {[]}\n */\n Changes.prototype.toArray = function () {\n return JSON.parse(JSON.stringify(this.changes));\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Changes}\n */\n Changes.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var changes = Changes.create();\n changes.changes = array;\n return changes;\n };\n return Changes;\n}());\nexports.Changes = Changes;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Aggregation constants\n */\nexports.RANGE_ZERO = 0;\nexports.RANGE_INFINITE = -1;\nexports.RANGE_SEPARATOR = \"..\";\n/**\n * Filter class\n */\nvar Range = /** @class */ (function () {\n function Range() {\n }\n /**\n * Strong to array\n *\n * @param string\n *\n * @returns {[number, number]}\n */\n Range.stringToArray = function (string) {\n var parts = string.split(exports.RANGE_SEPARATOR);\n var from = parts[0];\n var to = parts[1];\n var finalFrom = exports.RANGE_ZERO;\n var finalTo = exports.RANGE_INFINITE;\n if (from != \"\") {\n finalFrom = parseInt(from);\n }\n if (to != \"\") {\n finalTo = parseInt(to);\n }\n return [finalFrom, finalTo];\n };\n /**\n * Array to string\n *\n * @param values\n *\n * @return {string}\n */\n Range.arrayToString = function (values) {\n var finalValues = [\"\", \"\"];\n if (values[0] != exports.RANGE_ZERO) {\n finalValues[0] = String(values[0]);\n }\n if (values[1] != exports.RANGE_INFINITE) {\n finalValues[1] = String(values[1]);\n }\n return finalValues.join(exports.RANGE_SEPARATOR);\n };\n /**\n * Create ranges\n *\n * @param from\n * @param to\n * @param incremental\n */\n Range.createRanges = function (from, to, incremental) {\n var ranges = [];\n var nextTo;\n while (from < to) {\n nextTo = from + incremental;\n ranges.push(from + exports.RANGE_SEPARATOR + nextTo);\n from = nextTo;\n }\n return ranges;\n };\n return Range;\n}());\nexports.Range = Range;\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://apisearch/webpack/universalModuleDefinition","webpack://apisearch/webpack/bootstrap","webpack://apisearch/./node_modules/tslib/tslib.es6.js","webpack://apisearch/./node_modules/axios/lib/utils.js","webpack://apisearch/./src/Error/InvalidFormatError.ts","webpack://apisearch/./src/Error/ErrorWithMessage.ts","webpack://apisearch/./src/Query/Filter.ts","webpack://apisearch/./src/Model/Item.ts","webpack://apisearch/./src/Query/Query.ts","webpack://apisearch/./src/Model/Coordinate.ts","webpack://apisearch/./src/Model/ItemUUID.ts","webpack://apisearch/./node_modules/axios/lib/defaults.js","webpack://apisearch/./src/Query/Aggregation.ts","webpack://apisearch/./src/Query/SortBy.ts","webpack://apisearch/./src/Result/Result.ts","webpack://apisearch/./src/Result/ResultAggregations.ts","webpack://apisearch/./src/Http/AxiosClient.ts","webpack://apisearch/./node_modules/axios/lib/helpers/bind.js","webpack://apisearch/./node_modules/axios/lib/adapters/xhr.js","webpack://apisearch/./node_modules/axios/lib/core/createError.js","webpack://apisearch/./node_modules/axios/lib/cancel/isCancel.js","webpack://apisearch/./node_modules/axios/lib/cancel/Cancel.js","webpack://apisearch/./src/Http/Client.ts","webpack://apisearch/./src/Http/Response.ts","webpack://apisearch/./src/Http/RetryMap.ts","webpack://apisearch/./src/Http/Retry.ts","webpack://apisearch/./src/Model/User.ts","webpack://apisearch/./src/Query/ScoreStrategies.ts","webpack://apisearch/./src/Query/ScoreStrategy.ts","webpack://apisearch/./src/Repository/HttpRepository.ts","webpack://apisearch/./src/Error/ConnectionError.ts","webpack://apisearch/./src/Error/InvalidTokenError.ts","webpack://apisearch/./src/Error/ResourceExistsError.ts","webpack://apisearch/./src/Error/ResourceNotAvailableError.ts","webpack://apisearch/./src/Result/ResultAggregation.ts","webpack://apisearch/./src/Result/Counter.ts","webpack://apisearch/./src/Model/Metadata.ts","webpack://apisearch/./src/Repository/Repository.ts","webpack://apisearch/./src/Transformer/Transformer.ts","webpack://apisearch/./src/Config/Synonym.ts","webpack://apisearch/./src/index.ts","webpack://apisearch/./src/Apisearch.ts","webpack://apisearch/./src/Cache/NoCache.ts","webpack://apisearch/./node_modules/axios/index.js","webpack://apisearch/./node_modules/axios/lib/axios.js","webpack://apisearch/./node_modules/is-buffer/index.js","webpack://apisearch/./node_modules/axios/lib/core/Axios.js","webpack://apisearch/./node_modules/process/browser.js","webpack://apisearch/./node_modules/axios/lib/helpers/normalizeHeaderName.js","webpack://apisearch/./node_modules/axios/lib/core/settle.js","webpack://apisearch/./node_modules/axios/lib/core/enhanceError.js","webpack://apisearch/./node_modules/axios/lib/helpers/buildURL.js","webpack://apisearch/./node_modules/axios/lib/helpers/parseHeaders.js","webpack://apisearch/./node_modules/axios/lib/helpers/isURLSameOrigin.js","webpack://apisearch/./node_modules/axios/lib/helpers/btoa.js","webpack://apisearch/./node_modules/axios/lib/helpers/cookies.js","webpack://apisearch/./node_modules/axios/lib/core/InterceptorManager.js","webpack://apisearch/./node_modules/axios/lib/core/dispatchRequest.js","webpack://apisearch/./node_modules/axios/lib/core/transformData.js","webpack://apisearch/./node_modules/axios/lib/helpers/isAbsoluteURL.js","webpack://apisearch/./node_modules/axios/lib/helpers/combineURLs.js","webpack://apisearch/./node_modules/axios/lib/cancel/CancelToken.js","webpack://apisearch/./node_modules/axios/lib/helpers/spread.js","webpack://apisearch/./src/Model/Index.ts","webpack://apisearch/./src/Model/IndexUUID.ts","webpack://apisearch/./src/Model/AppUUID.ts","webpack://apisearch/./src/Cache/InMemoryCache.ts","webpack://apisearch/./src/Config/Config.ts","webpack://apisearch/./src/Error/EventError.ts","webpack://apisearch/./src/Error/ForbiddenError.ts","webpack://apisearch/./src/Error/UnsupportedContentTypeError.ts","webpack://apisearch/./src/Geo/LocationRange.ts","webpack://apisearch/./src/Http/HttpClient.ts","webpack://apisearch/./src/Model/Changes.ts","webpack://apisearch/./src/Query/Range.ts"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","__webpack_exports__","__extends","__assign","__rest","__decorate","__param","__metadata","__awaiter","__generator","__exportStar","__values","__read","__spread","__await","__asyncGenerator","__asyncDelegator","__asyncValues","__makeTemplateObject","__importStar","__importDefault","extendStatics","b","setPrototypeOf","__proto__","Array","__","this","constructor","assign","arguments","length","apply","e","indexOf","getOwnPropertySymbols","decorators","target","desc","getOwnPropertyDescriptor","Reflect","decorate","paramIndex","decorator","metadataKey","metadataValue","metadata","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","rejected","result","done","then","body","f","y","g","_","label","sent","trys","ops","verb","throw","return","iterator","v","op","TypeError","pop","push","ar","error","concat","asyncIterator","q","a","resume","fulfill","settle","shift","cooked","raw","mod","k","default","isBuffer","toString","isArray","val","isObject","isFunction","forEach","obj","fn","isArrayBuffer","isFormData","FormData","isArrayBufferView","ArrayBuffer","isView","buffer","isString","isNumber","isUndefined","isDate","isFile","isBlob","isStream","pipe","isURLSearchParams","URLSearchParams","isStandardBrowserEnv","navigator","product","document","merge","assignValue","extend","trim","str","replace","tslib_1","InvalidFormatError","_super","getTransportableHTTPError","itemRepresentationNotValid","itemUUIDRepresentationNotValid","composedItemUUIDNotValid","querySortedByDistanceWithoutCoordinate","queryFormatNotValid","coordinateFormatNotValid","configFormatNotValid","tokenFormatNotValid","indexFormatNotValid","indexUUIDFormatNotValid","appUUIDFormatNotValid","campaignFormatNotValid","changesFormatNotValid","boostClauseFormatNotValid","tokenUUIDFormatNotValid","userFormatNotValid","ErrorWithMessage","message","FILTER_MUST_ALL","FILTER_MUST_ALL_WITH_LEVELS","FILTER_AT_LEAST_ONE","FILTER_EXCLUDE","FILTER_PROMOTE","FILTER_TYPE_FIELD","FILTER_TYPE_RANGE","FILTER_TYPE_DATE_RANGE","FILTER_TYPE_GEO","FILTER_TYPE_QUERY","Filter","field","values","applicationType","filterType","filterTerms","getField","getValues","hasValue","getApplicationType","getFilterType","getFilterTerms","toArray","filterAsArray","keys","application_type","filter_type","filter_terms","createFromArray","array","JSON","parse","stringify","InvalidFormatError_1","Coordinate_1","ItemUUID_1","Item","uuid","coordinate","indexedMetadata","searchableMetadata","exactMatchingMetadata","suggest","highlights","promoted","createLocated","getUUID","getId","getType","getCoordinate","getDistance","distance","getMetadata","setMetadata","addMetadata","getIndexedMetadata","setIndexedMetadata","addIndexedMetadata","getSearchableMetadata","setSearchableMetadata","addSearchableMetadata","getExactMatchingMetadata","setExactMatchingMetadata","addExactMatchingMetadata","getAllMetadata","allMetadata","getSuggest","getHighlights","getHighlight","isPromoted","setScore","score","getScore","itemAsArray","Coordinate","indexed_metadata","searchable_metadata","exact_matching_metadata","is_promoted","item","ItemUUID","composeUUID","composedUUID","getPathByField","Item_1","User_1","Aggregation_1","Filter_1","Filter_2","Aggregation_2","Filter_3","ScoreStrategies_1","SortBy_1","QUERY_DEFAULT_FROM","QUERY_DEFAULT_PAGE","QUERY_DEFAULT_SIZE","QUERY_INFINITE_SIZE","NO_MIN_SCORE","Query","queryText","fields","universeFilters","filters","itemsPromoted","aggregations","resultsEnabled","aggregationsEnabled","suggestionsEnabled","highlightsEnabled","filterFields","minScore","sortByInstance","SortBy","_query","page","size","query","Math","max","from","createMatchAll","createByUUID","createByUUIDs","uuids","_i","ids","disableAggregations","disableSuggestions","_id","setFields","getFields","filterUniverseByTypes","_a","fieldPath","type","filterByTypes","aggregate","aggregationSort","_b","AGGREGATION_SORT_BY_COUNT_DESC","Aggregation","filterUniverseByIds","id","filterByIds","filterUniverseBy","filterBy","filterName","aggregateBy","filterUniverseByRange","rangeType","filterUniverseByDateRange","filterByRange","options","aggregateByRange","filterByDateRange","filterUniverseByLocation","locationRange","setFilterFields","getFilterFields","sortBy","isSortedByGeoDistance","setCoordinate","limit","AGGREGATION_NO_LIMIT","aggregateByDateRange","getAggregations","getAggregation","aggregationName","getQueryText","filter","getUniverseFilters","getUniverseFilter","getFilters","getFilter","getFilterByField","fieldName","getSortBy","getFrom","getSize","getPage","enableResults","disableResults","areResultsEnabled","enableAggregations","areAggregationsEnabled","enableSuggestions","areSuggestionsEnabled","enableHighlights","disableHighlights","areHighlightsEnabled","promoteUUID","itemUUID","promoteUUIDs","getItemsPromoted","excludeUUID","excludeUUIDs","map","getScoreStrategies","scoreStrategies","setScoreStrategies","getFuzziness","fuzziness","setFuzziness","setAutoFuzziness","getMinScore","setMinScore","byUser","user","anonymously","getUser","universe_filters","universeFilter","aggregation","sort","results_enabled","suggestions_enabled","highlights_enabled","aggregations_enabled","filter_fields","ScoreStrategies","scoreStrategiesAsArray","score_strategies","min_score","User","userAsArray","items_promoted","aggregationsAsArray","sortAsArray","filtersAsArray","universeFiltersAsArray","itemsPromotedAsArray","lat","lon","getLatitude","getLongitude","createByComposedUUID","parts","split","process","utils","normalizeHeaderName","DEFAULT_CONTENT_TYPE","Content-Type","setContentTypeIfUnset","headers","defaults","adapter","XMLHttpRequest","getDefaultAdapter","transformRequest","data","transformResponse","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","validateStatus","status","common","Accept","method","AGGREGATION_SORT_BY_COUNT_ASC","AGGREGATION_SORT_BY_NAME_ASC","AGGREGATION_SORT_BY_NAME_DESC","subgroup","getName","getSubgroup","getSort","getLimit","aggregationAsArray","SORT_BY_TYPE_FIELD","SORT_BY_TYPE_NESTED","SORT_BY_ASC","SORT_BY_DESC","SORT_BY_MODE_AVG","SORT_BY_MODE_SUM","SORT_BY_MODE_MIN","SORT_BY_MODE_MAX","SORT_BY_MODE_MEDIAN","SORT_BY_SCORE","_score","order","SORT_BY_RANDOM","random","SORT_BY_AL_TUN_TUN","SORT_BY_ID_ASC","uuid.id","SORT_BY_ID_DESC","SORT_BY_TYPE_ASC","uuid.type","SORT_BY_TYPE_DESC","SORT_BY_LOCATION_KM_ASC","_geo_distance","unit","SORT_BY_LOCATION_MI_ASC","sortsBy","byFieldsValues","shortSortByElements","byFieldValue","all","byValue","byNestedField","byNestedFieldAndFilter","hasRandomSort","sortsByAsArray","copy","innerArray","element","newSortBy","sortByAsArray","Query_1","ResultAggregations_1","Result","totalItems","totalHits","items","suggests","addItem","getItems","getItemsGroupedByTypes","itemsGroupedByTypeCache","itemsGroupedByTypes","getItemsByType","getItemsByTypes","types","getFirstItem","setAggregations","ResultAggregations","hasNotEmptyAggregation","addSuggest","getSuggests","getQuery","getTotalItems","getTotalHits","total_items","total_hits","ResultAggregation_1","totalElements","addAggregation","ResultAggregation","isEmpty","getTotalElements","aggregationCollection","total_elements","axios_1","Client_1","Response_1","AxiosClient","host","version","retryMap","overrideQueries","cache","_this","cancelToken","url","credentials","parameters","that","toLowerCase","abort","Content-Encoding","axiosRequestConfig","Client","objectToUrlParameters","baseURL","token","request","axiosResponse","response","Response","undefined","cancel","generateCancelToken","CancelToken","source","args","buildURL","parseHeaders","isURLSameOrigin","createError","btoa","config","requestData","requestHeaders","loadEvent","xDomain","XDomainRequest","onprogress","ontimeout","auth","username","password","Authorization","open","toUpperCase","params","paramsSerializer","readyState","responseURL","responseHeaders","getAllResponseHeaders","responseType","responseText","statusText","onerror","cookies","xsrfValue","withCredentials","read","setRequestHeader","onDownloadProgress","addEventListener","onUploadProgress","upload","promise","send","enhanceError","code","Error","__CANCEL__","Cancel","builtParams","join","getCode","getBody","Retry_1","RetryMap","retries","addRetry","retry","getUrl","getMethod","Retry","getRetry","DEFAULT_MICROSECONDS_BETWEEN_RETRIES","microsecondsBetweenRetries","microseconds_between_retries","getRetries","getMicrosecondsBetweenRetries","attributes","getAttributes","ScoreStrategy_1","MULTIPLY","SUM","AVG","MAX","MIN","createEmpty","scoreMode","addScoreStrategy","scoreStrategy","getScoreMode","score_mode","ScoreStrategy","DEFAULT_TYPE","DEFAULT_WEIGHT","BOOSTING_FIELD_VALUE","CUSTOM_FUNCTION","DECAY","DECAY_LINEAR","DECAY_EXP","DECAY_GAUSS","MODIFIER_NONE","MODIFIER_SQRT","MODIFIER_LOG","MODIFIER_LN","MODIFIER_SQUARE","SCORE_MODE_NONE","SCORE_MODE_SUM","SCORE_MODE_AVG","SCORE_MODE_MAX","SCORE_MODE_MIN","DEFAULT_MISSING","DEFAULT_FACTOR","weight","configuration","getConfigurationValue","getWeight","createDefault","createFieldBoosting","factor","missing","modifier","fixFilterFieldPath","createCustomFunction","func","createDecayFunction","origin","scale","offset","decay","ConnectionError_1","InvalidTokenError_1","ResourceExistsError_1","ResourceNotAvailableError_1","Result_1","Repository_1","Index_1","HttpRepository","httpClient","appId","indexId","transformer","getTransformer","addObject","toItem","deleteObject","toItemUUID","deleteItem","flushUpdateItems","itemsToUpdate","getCredentialsWithIndex","throwTransportableExceptionIfNeeded","flushDeleteItems","itemsToDelete","fromItems","updateItems","changes","createIndex","indexUUID","getCredentials","index","deleteIndex","resetIndex","checkIndex","getIndices","indexAsArray","Index","configureIndex","app_id","indexComposedUUID","ResourceNotAvailableError","InvalidTokenError","ResourceExistsError","ConnectionError","Repository","createInvalidTokenPermissions","tokenReference","createInvalidTokenMaxHitsPerQuery","maxHitsPerQuery","indexAvailable","eventsIndexAvailable","logsIndexAvailable","indexNotAvailable","resourceId","eventsIndexNotAvailable","logsIndexNotAvailable","engineNotAvailable","Counter_1","activeElements","counters","highestActiveElement","activeElement","addCounter","counter","counterInstance","Counter","createByActiveElements","isUsed","getLevel","getCounters","isFilter","hasLevels","getCounter","getAllElements","getActiveElements","0","cleanCountersByLevel","active_elements","highest_active_level","activeElementsAsArray","activeElementAsArray","parseInt","countersAsArray","counterAsArray","Metadata_1","used","getSlug","slug","level","getN","Metadata","fromMetadata","inActiveElements","toMetadata","splittedParts","lastElement","part","resetCachedElements","addItems","deleteItems","itemsUUID","flush","bulkNumber","skipIfLess","chunkArray","arrayOfItems","arrayOfItemsUUID","chunk","arrayChunked","j","slice","Transformer","readTransformers","writeTransformers","addReadTransformer","readTransformer","addWriteTransformer","writeTransformer","objects","fromItem","isValidItem","toItems","isValidObject","toItemUUIDs","itemUUIDs","Synonym","words","getWords","createbyWords","expand","Apisearch_1","NoCache_1","AxiosClient_1","RetryMap_1","Query_2","Query_3","HttpRepository_1","Transformer_1","Apisearch","createRepository","ensureRepositoryConfigIsValid","api_version","NoCache","override_queries","http_client","endpoint","index_id","ensureIsDefined","param","createQueryLocated","createQuery","createQueryMatchAll","createQueryByUUID","createQueryByUUIDs","createEmptyResult","createEmptySortBy","set","del","clear","Axios","createInstance","defaultConfig","context","instance","axios","instanceConfig","isCancel","promises","spread","readFloatLE","isSlowBuffer","_isBuffer","InterceptorManager","dispatchRequest","interceptors","chain","interceptor","unshift","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","fun","setTimeout","clearTimeout","currentQueue","queue","draining","queueIndex","cleanUpNextTick","drainQueue","len","run","marker","runClearTimeout","noop","nextTick","title","browser","env","argv","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","normalizedName","encode","encodeURIComponent","serializedParams","toISOString","ignoreDuplicateOf","parsed","line","substr","originURL","msie","test","userAgent","urlParsingNode","createElement","resolveURL","href","setAttribute","protocol","search","hash","hostname","port","pathname","charAt","location","requestURL","chars","E","input","block","charCode","String","output","idx","charCodeAt","write","expires","path","domain","secure","cookie","Date","toGMTString","match","RegExp","decodeURIComponent","remove","now","handlers","use","eject","h","transformData","isAbsoluteURL","combineURLs","throwIfCancellationRequested","throwIfRequested","reason","fns","relativeURL","executor","resolvePromise","callback","arr","IndexUUID_1","AppUUID_1","appUUID","isOK","docCount","getAppUUID","isOk","getDocCount","is_ok","doc_count","IndexUUID","AppUUID","createById","InMemoryCache","Synonym_1","Config","language","storeSearchableMetadata","synonyms","getLanguage","shouldSearchableMetadataBeStored","addSynonym","synonym","getSynonyms","store_searchable_metadata","immutableConfig","EventError","throwEndpointNotAvailable","ForbiddenError","createAppIdIsRequiredException","createIndexIsRequiredException","createTokenIsRequiredException","UnsupportedContentTypeError","createUnsupportedContentTypeException","LocationRange","fromFilterObject","toFilterObject","CoordinateAndDistance","Polygon","Square","coordinates","topLeftCoordinate","bottomRightCoordinate","top_left","bottom_right","HttpClient","TYPE_VALUE","TYPE_LITERAL","TYPE_ARRAY_ELEMENT_UPDATE","TYPE_ARRAY_ELEMENT_ADD","TYPE_ARRAY_ELEMENT_DELETE","TYPE_ARRAY_EXPECTS_ELEMENT","TYPE_ARRAY","Changes","addChange","updateElementFromList","condition","addElementInList","deleteElementFromList","getChanges","RANGE_ZERO","RANGE_INFINITE","RANGE_SEPARATOR","Range","stringToArray","string","to","finalFrom","finalTo","arrayToString","finalValues","createRanges","incremental","nextTo","ranges"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,UAAAH,GACA,iBAAAC,QACAA,QAAA,UAAAD,IAEAD,EAAA,UAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,IACAC,EAAAD,EACAE,GAAA,EACAT,YAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAQ,GAAA,EAGAR,EAAAD,QA0DA,OArDAM,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CV,EAAAgB,EAAA,SAAAtB,GACA,oBAAAuB,eAAAC,aACAN,OAAAC,eAAAnB,EAAAuB,OAAAC,aAAwDC,MAAA,WAExDP,OAAAC,eAAAnB,EAAA,cAAiDyB,OAAA,KAQjDnB,EAAAoB,EAAA,SAAAD,EAAAE,GAEA,GADA,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79B,OAAA,WACA,WAAA69B,GAOAA,EAAAv9B,UAAAiL,QAAA,WACA,OAAAQ,KAAAC,MAAAD,KAAAE,UAAA7J,KAAAmoB,WASAsT,EAAAhyB,gBAAA,SAAAC,GACAA,EAAAC,KAAAC,MAAAD,KAAAE,UAAAH,IACA,IAAAye,EAAAsT,EAAA79B,SAEA,OADAuqB,UAAAze,EACAye,GAEAsT,EAxGA,GA0GA3/B,EAAA2/B,wCCzHA3/B,EAAA4B,YAAA,EAIA5B,EAAAkgC,WAAA,EACAlgC,EAAAmgC,gBAAA,EACAngC,EAAAogC,gBAAA,KAIA,IAAAC,EAAA,WACA,SAAAA,KAyDA,OAhDAA,EAAAC,cAAA,SAAAC,GACA,IAAA5lB,EAAA4lB,EAAA3lB,MAAA5a,EAAAogC,iBACA9sB,EAAAqH,EAAA,GACA6lB,EAAA7lB,EAAA,GACA8lB,EAAAzgC,EAAAkgC,WACAQ,EAAA1gC,EAAAmgC,eAOA,MANA,IAAA7sB,IACAmtB,EAAA7Q,SAAAtc,IAEA,IAAAktB,IACAE,EAAA9Q,SAAA4Q,KAEAC,EAAAC,IASAL,EAAAM,cAAA,SAAAh0B,GACA,IAAAi0B,GAAA,OAOA,OANAj0B,EAAA,IAAA3M,EAAAkgC,aACAU,EAAA,GAAAvG,OAAA1tB,EAAA,KAEAA,EAAA,IAAA3M,EAAAmgC,iBACAS,EAAA,GAAAvG,OAAA1tB,EAAA,KAEAi0B,EAAAta,KAAAtmB,EAAAogC,kBASAC,EAAAQ,aAAA,SAAAvtB,EAAAktB,EAAAM,GAGA,IAFA,IACAC,EADAC,KAEA1tB,EAAAktB,GACAO,EAAAztB,EAAAwtB,EACAE,EAAA35B,KAAAiM,EAAAtT,EAAAogC,gBAAAW,GACAztB,EAAAytB,EAEA,OAAAC,GAEAX,EA1DA,GA4DArgC,EAAAqgC","file":"apisearch.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"apisearch\"] = factory();\n\telse\n\t\troot[\"apisearch\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 38);\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\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;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","'use strict';\n\nvar bind = require('./helpers/bind');\nvar isBuffer = require('is-buffer');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim\n};\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Class InvalidFormatError\n */\nvar InvalidFormatError = /** @class */ (function (_super) {\n tslib_1.__extends(InvalidFormatError, _super);\n function InvalidFormatError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n InvalidFormatError.getTransportableHTTPError = function () {\n return 400;\n };\n /**\n * Item representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.itemRepresentationNotValid = function () {\n return new InvalidFormatError(\"Item representation not valid. Expecting Item array serialized but found malformed data\");\n };\n /**\n * Item UUID representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.itemUUIDRepresentationNotValid = function () {\n return new InvalidFormatError(\"Item UUID representation not valid. Expecting UUID array serialized but found malformed data\");\n };\n /**\n * Create Composed UUID bad format.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.composedItemUUIDNotValid = function () {\n return new InvalidFormatError(\"A composed UUID should always follow this format: {id}~{type}.\");\n };\n /**\n * Create Query sorted by distance without coordinate.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.querySortedByDistanceWithoutCoordinate = function () {\n return new InvalidFormatError(\"In order to be able to sort by coordinates, you need to create a Query by using Query::createLocated() instead of Query::create()\");\n };\n /**\n * Query representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.queryFormatNotValid = function () {\n return new InvalidFormatError(\"Query Format not valid. Expecting a Query serialized but found malformed data\");\n };\n /**\n * Coordinate representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.coordinateFormatNotValid = function () {\n return new InvalidFormatError(\"A Coordinate should always contain a lat (Latitude) and a lon (Longitude)\");\n };\n /**\n * Config representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.configFormatNotValid = function () {\n return new InvalidFormatError(\"Config Format not valid. Expecting a Config serialized but found malformed data\");\n };\n /**\n * Token representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.tokenFormatNotValid = function () {\n return new InvalidFormatError(\"Token Format not valid. Expecting a Token serialized but found malformed data\");\n };\n /**\n * Index format not valid.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.indexFormatNotValid = function () {\n return new InvalidFormatError('Index Format not valid. Expecting an Index serialized but found malformed data');\n };\n /**\n * IndexUUI format not valid.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.indexUUIDFormatNotValid = function () {\n return new InvalidFormatError('IndexUUID Format not valid. Expecting an IndexUUID serialized but found malformed data');\n };\n /**\n * App format not valid.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.appUUIDFormatNotValid = function () {\n return new InvalidFormatError('AppUUID Format not valid. Expecting an AppUUID serialized but found malformed data');\n };\n /**\n * Campaign representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.campaignFormatNotValid = function () {\n return new InvalidFormatError(\"Campaign Format not valid. Expecting a Campaign serialized but found malformed data\");\n };\n /**\n * Changes representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.changesFormatNotValid = function () {\n return new InvalidFormatError(\"Changes Format not valid. Expecting a Changes serialized but found malformed data\");\n };\n /**\n * Boost clause representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.boostClauseFormatNotValid = function () {\n return new InvalidFormatError(\"Boost clause Format not valid. Expecting a Boost clause serialized but found malformed data\");\n };\n /**\n * token uuid representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.tokenUUIDFormatNotValid = function () {\n return new InvalidFormatError(\"Token UUID Format not valid. Expecting a TokenUUID serialized but found malformed data\");\n };\n /**\n * User representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.userFormatNotValid = function () {\n return new InvalidFormatError(\"User Format not valid. Expecting a User serialized but found malformed data\");\n };\n return InvalidFormatError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.InvalidFormatError = InvalidFormatError;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * ConnectError\n */\nvar ErrorWithMessage = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param message\n */\n function ErrorWithMessage(message) {\n this.message = message;\n }\n return ErrorWithMessage;\n}());\nexports.ErrorWithMessage = ErrorWithMessage;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * filter constants\n */\nexports.FILTER_MUST_ALL = 4;\nexports.FILTER_MUST_ALL_WITH_LEVELS = 5;\nexports.FILTER_AT_LEAST_ONE = 8;\nexports.FILTER_EXCLUDE = 16;\nexports.FILTER_PROMOTE = 32;\nexports.FILTER_TYPE_FIELD = \"field\";\nexports.FILTER_TYPE_RANGE = \"range\";\nexports.FILTER_TYPE_DATE_RANGE = \"date_range\";\nexports.FILTER_TYPE_GEO = \"geo\";\nexports.FILTER_TYPE_QUERY = \"query\";\n/**\n * Filter class\n */\nvar Filter = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param field\n * @param values\n * @param applicationType\n * @param filterType\n * @param filterTerms\n */\n function Filter(field, values, applicationType, filterType, filterTerms) {\n this.field = field;\n this.values = values;\n this.applicationType = applicationType;\n this.filterType = filterType;\n this.filterTerms = filterTerms;\n }\n /**\n * Get field\n *\n * @returns {string}\n */\n Filter.prototype.getField = function () {\n return this.field;\n };\n /**\n * Get values\n *\n * @returns {any}\n */\n Filter.prototype.getValues = function () {\n return this.values;\n };\n /**\n * Has value\n *\n * @param value\n *\n * @returns {boolean}\n */\n Filter.prototype.hasValue = function (value) {\n return typeof this.values[value] == \"undefined\";\n };\n /**\n * getApplicationType\n *\n * @returns {number}\n */\n Filter.prototype.getApplicationType = function () {\n return this.applicationType;\n };\n /**\n * Get filter type\n *\n * @return {string}\n */\n Filter.prototype.getFilterType = function () {\n return this.filterType;\n };\n /**\n * Get filter type\n *\n * @return {{}}\n */\n Filter.prototype.getFilterTerms = function () {\n return this.filterTerms;\n };\n /**\n * Create\n *\n * @param field\n * @param values\n * @param applicationType\n * @param filterType\n * @param filterTerms\n *\n * @return {Filter}\n */\n Filter.create = function (field, values, applicationType, filterType, filterTerms) {\n if (filterTerms === void 0) { filterTerms = []; }\n return new Filter(field, values, applicationType, filterType, filterTerms);\n };\n /**\n * To array\n *\n * @returns {Array}\n */\n Filter.prototype.toArray = function () {\n var filterAsArray = {};\n if (this.field != \"uuid.type\") {\n filterAsArray.field = this.field;\n }\n if (this.values.length > 0 ||\n Object.keys(this.values).length > 0) {\n filterAsArray.values = this.values;\n }\n if (this.applicationType != exports.FILTER_AT_LEAST_ONE) {\n filterAsArray.application_type = this.applicationType;\n }\n if (this.filterType != exports.FILTER_TYPE_FIELD) {\n filterAsArray.filter_type = this.filterType;\n }\n if (this.filterTerms.length > 0) {\n filterAsArray.filter_terms = this.filterTerms;\n }\n return filterAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Filter}\n */\n Filter.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.field == \"undefined\") {\n array.field = \"uuid.type\";\n }\n if (typeof array.values == \"undefined\") {\n array.values = [];\n }\n if (typeof array.application_type == \"undefined\") {\n array.application_type = exports.FILTER_AT_LEAST_ONE;\n }\n if (typeof array.filter_type == \"undefined\") {\n array.filter_type = exports.FILTER_TYPE_FIELD;\n }\n if (typeof array.filter_terms == \"undefined\") {\n array.filter_terms = [];\n }\n return Filter.create(array.field, array.values, array.application_type, array.filter_type, array.filter_terms);\n };\n return Filter;\n}());\nexports.Filter = Filter;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar Coordinate_1 = require(\"./Coordinate\");\nvar ItemUUID_1 = require(\"./ItemUUID\");\n/**\n * Item class\n */\nvar Item = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param uuid\n * @param coordinate\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n */\n function Item(uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n this.metadata = {};\n this.indexedMetadata = {};\n this.searchableMetadata = {};\n this.exactMatchingMetadata = [];\n this.suggest = [];\n this.highlights = {};\n this.promoted = false;\n this.uuid = uuid;\n this.coordinate = coordinate;\n this.metadata = metadata;\n this.indexedMetadata = indexedMetadata;\n this.searchableMetadata = searchableMetadata;\n this.exactMatchingMetadata = exactMatchingMetadata;\n this.suggest = suggest;\n }\n /**\n * Create new Item\n *\n * @param uuid\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n * @returns {Item}\n */\n Item.create = function (uuid, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n if (metadata === void 0) { metadata = {}; }\n if (indexedMetadata === void 0) { indexedMetadata = {}; }\n if (searchableMetadata === void 0) { searchableMetadata = {}; }\n if (exactMatchingMetadata === void 0) { exactMatchingMetadata = []; }\n if (suggest === void 0) { suggest = []; }\n return new Item(uuid, null, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest);\n };\n /**\n * Create new located Item\n *\n * @param uuid\n * @param coordinate\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n * @returns {Item}\n */\n Item.createLocated = function (uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n if (metadata === void 0) { metadata = {}; }\n if (indexedMetadata === void 0) { indexedMetadata = {}; }\n if (searchableMetadata === void 0) { searchableMetadata = {}; }\n if (exactMatchingMetadata === void 0) { exactMatchingMetadata = []; }\n if (suggest === void 0) { suggest = []; }\n return new Item(uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest);\n };\n /**\n * Get uuid\n *\n * @returns ItemUUID\n */\n Item.prototype.getUUID = function () {\n return this.uuid;\n };\n /**\n * Get id\n *\n * @returns string\n */\n Item.prototype.getId = function () {\n return this.uuid.getId();\n };\n /**\n * Get type\n *\n * @returns string\n */\n Item.prototype.getType = function () {\n return this.uuid.getType();\n };\n /**\n * Get coordinate\n *\n * @returns Coordinate|null\n */\n Item.prototype.getCoordinate = function () {\n return this.coordinate;\n };\n /**\n * Get distance\n *\n * @returns int\n */\n Item.prototype.getDistance = function () {\n return this.distance;\n };\n /**\n * Get metadata\n *\n * @returns Array\n */\n Item.prototype.getMetadata = function () {\n return this.metadata;\n };\n /**\n * Set metadata\n *\n * @param metadata\n */\n Item.prototype.setMetadata = function (metadata) {\n this.metadata = metadata;\n };\n /**\n * Add metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addMetadata = function (key, value) {\n this.metadata[key] = value;\n };\n /**\n * Get indexed metadata\n *\n * @returns Array\n */\n Item.prototype.getIndexedMetadata = function () {\n return this.indexedMetadata;\n };\n /**\n * Set indexed metadata\n *\n * @param indexedMetadata\n */\n Item.prototype.setIndexedMetadata = function (indexedMetadata) {\n this.indexedMetadata = indexedMetadata;\n };\n /**\n * Add indexed metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addIndexedMetadata = function (key, value) {\n this.indexedMetadata[key] = value;\n };\n /**\n * Get searchable metadata\n *\n * @returns Array\n */\n Item.prototype.getSearchableMetadata = function () {\n return this.searchableMetadata;\n };\n /**\n * Set searchable metadata\n *\n * @param searchableMetadata\n */\n Item.prototype.setSearchableMetadata = function (searchableMetadata) {\n this.searchableMetadata = searchableMetadata;\n };\n /**\n * Add searchable metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addSearchableMetadata = function (key, value) {\n this.searchableMetadata[key] = value;\n };\n /**\n * Get exactMatching metadata\n *\n * @returns Array\n */\n Item.prototype.getExactMatchingMetadata = function () {\n return this.exactMatchingMetadata;\n };\n /**\n * Set exactMatching metadata\n *\n * @param exactMatchingMetadata\n */\n Item.prototype.setExactMatchingMetadata = function (exactMatchingMetadata) {\n this.exactMatchingMetadata = exactMatchingMetadata;\n };\n /**\n * Add exactMatching metadata\n *\n * @param value\n */\n Item.prototype.addExactMatchingMetadata = function (value) {\n this.exactMatchingMetadata.push(value);\n };\n /**\n * Get all metadata\n *\n * @returns {{}}\n */\n Item.prototype.getAllMetadata = function () {\n return tslib_1.__assign({}, this.metadata, this.indexedMetadata);\n };\n /**\n * Get\n *\n * @param key\n *\n * @returns mixed|null\n */\n Item.prototype.get = function (key) {\n var allMetadata = this.getAllMetadata();\n return (typeof allMetadata[key] != \"undefined\")\n ? allMetadata[key]\n : null;\n };\n /**\n * Get suggest\n *\n * @returns Array\n */\n Item.prototype.getSuggest = function () {\n return this.suggest;\n };\n /**\n * Get highlights\n *\n * @returns Array\n */\n Item.prototype.getHighlights = function () {\n return this.highlights;\n };\n /**\n * Get highlight\n *\n * @param key\n *\n * @return string|null\n */\n Item.prototype.getHighlight = function (key) {\n return (typeof this.highlights[key] != \"undefined\")\n ? this.highlights[key]\n : null;\n };\n /**\n * Is promoted\n *\n * @returns boolean\n */\n Item.prototype.isPromoted = function () {\n return this.promoted;\n };\n /**\n * Set score\n *\n * @param score\n *\n * @return {Item}\n */\n Item.prototype.setScore = function (score) {\n this.score = score;\n return this;\n };\n /**\n * Get score\n *\n * @return {number}\n */\n Item.prototype.getScore = function () {\n return this.score;\n };\n /**\n * To array\n */\n Item.prototype.toArray = function () {\n var itemAsArray = {\n uuid: this.uuid.toArray()\n };\n if (this.coordinate instanceof Coordinate_1.Coordinate) {\n itemAsArray.coordinate = this.coordinate.toArray();\n }\n if (Object.keys(this.metadata).length > 0) {\n itemAsArray.metadata = this.metadata;\n }\n if (Object.keys(this.indexedMetadata).length > 0) {\n itemAsArray.indexed_metadata = this.indexedMetadata;\n }\n if (Object.keys(this.searchableMetadata).length > 0) {\n itemAsArray.searchable_metadata = this.searchableMetadata;\n }\n if (this.exactMatchingMetadata.length > 0) {\n itemAsArray.exact_matching_metadata = this.exactMatchingMetadata;\n }\n if (this.suggest.length > 0) {\n itemAsArray.suggest = this.suggest;\n }\n if (Object.keys(this.highlights).length > 0) {\n itemAsArray.highlights = this.highlights;\n }\n if (this.isPromoted()) {\n itemAsArray.is_promoted = true;\n }\n if (typeof this.distance != \"undefined\") {\n itemAsArray.distance = this.distance;\n }\n if (typeof this.score != \"undefined\") {\n itemAsArray.score = this.score;\n }\n return itemAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n */\n Item.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.uuid != \"object\") {\n throw InvalidFormatError_1.InvalidFormatError.itemUUIDRepresentationNotValid();\n }\n if (typeof array.coordinate != \"undefined\" &&\n typeof array.coordinate != \"object\") {\n throw InvalidFormatError_1.InvalidFormatError.coordinateFormatNotValid();\n }\n var item = (typeof array.coordinate == \"object\" &&\n array.coordinate != null)\n ? Item.createLocated(ItemUUID_1.ItemUUID.createFromArray(array.uuid), Coordinate_1.Coordinate.createFromArray(array.coordinate), ((typeof array.metadata == \"undefined\") ? {} : array.metadata), ((typeof array.indexed_metadata == \"undefined\") ? {} : array.indexed_metadata), ((typeof array.searchable_metadata == \"undefined\") ? {} : array.searchable_metadata), ((typeof array.exact_matching_metadata == \"undefined\") ? [] : array.exact_matching_metadata), ((typeof array.suggest == \"undefined\") ? [] : array.suggest))\n : Item.create(ItemUUID_1.ItemUUID.createFromArray(array.uuid), ((typeof array.metadata == \"undefined\") ? {} : array.metadata), ((typeof array.indexed_metadata == \"undefined\") ? {} : array.indexed_metadata), ((typeof array.searchable_metadata == \"undefined\") ? {} : array.searchable_metadata), ((typeof array.exact_matching_metadata == \"undefined\") ? [] : array.exact_matching_metadata), ((typeof array.suggest == \"undefined\") ? [] : array.suggest));\n if (typeof array.distance != \"undefined\" &&\n array.distance != null) {\n item.distance = array.distance;\n }\n if (typeof array.highlights == \"object\" &&\n array.distance != null) {\n item.highlights = array.highlights;\n }\n if (typeof array.is_promoted != \"undefined\" &&\n array.is_promoted != null) {\n item.promoted = array.is_promoted;\n }\n if (typeof array.score != \"undefined\" &&\n array.score != null) {\n item.score = array.score;\n }\n return item;\n };\n /**\n * Compose uuid\n *\n * @returns string\n */\n Item.prototype.composeUUID = function () {\n return this.uuid.composedUUID();\n };\n /**\n * Get path by field.\n *\n * @param field\n *\n * @returns {string}\n */\n Item.getPathByField = function (field) {\n return ([\"id\", \"type\"].indexOf(field) > -1)\n ? \"uuid.\" + field\n : \"indexed_metadata.\" + field;\n };\n return Item;\n}());\nexports.Item = Item;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar Coordinate_1 = require(\"../Model/Coordinate\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\nvar Item_1 = require(\"../Model/Item\");\nvar User_1 = require(\"../Model/User\");\nvar Aggregation_1 = require(\"./Aggregation\");\nvar Filter_1 = require(\"./Filter\");\nvar Filter_2 = require(\"./Filter\");\nvar Aggregation_2 = require(\"./Aggregation\");\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar Filter_3 = require(\"./Filter\");\nvar ScoreStrategies_1 = require(\"./ScoreStrategies\");\nvar SortBy_1 = require(\"./SortBy\");\n/**\n * Query constants\n */\nexports.QUERY_DEFAULT_FROM = 0;\nexports.QUERY_DEFAULT_PAGE = 1;\nexports.QUERY_DEFAULT_SIZE = 10;\nexports.QUERY_INFINITE_SIZE = 1000;\nexports.NO_MIN_SCORE = 0.0;\n/**\n * Query class\n */\nvar Query = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param queryText\n */\n function Query(queryText) {\n this.fields = [];\n this.universeFilters = {};\n this.filters = {};\n this.itemsPromoted = [];\n this.aggregations = {};\n this.resultsEnabled = true;\n this.aggregationsEnabled = true;\n this.suggestionsEnabled = false;\n this.highlightsEnabled = false;\n this.filterFields = [];\n this.minScore = exports.NO_MIN_SCORE;\n this.sortByInstance = SortBy_1.SortBy.create();\n this.filters._query = Filter_1.Filter.create(\"\", [queryText], 0, Filter_3.FILTER_TYPE_QUERY);\n }\n /**\n * Created located\n *\n * @param coordinate\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Query.createLocated = function (coordinate, queryText, page, size) {\n if (page === void 0) { page = exports.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = exports.QUERY_DEFAULT_SIZE; }\n var query = Query.create(queryText, page, size);\n query.coordinate = coordinate;\n return query;\n };\n /**\n * Create\n *\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Query.create = function (queryText, page, size) {\n if (page === void 0) { page = exports.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = exports.QUERY_DEFAULT_SIZE; }\n page = Math.max(1, page);\n var query = new Query(queryText);\n query.from = (page - 1) * size;\n query.size = size;\n query.page = page;\n return query;\n };\n /**\n * Create match all\n *\n * @return {Query}\n */\n Query.createMatchAll = function () {\n return Query.create(\"\", exports.QUERY_DEFAULT_PAGE, exports.QUERY_DEFAULT_SIZE);\n };\n /**\n * Create by UUID\n *\n * @param uuid\n *\n * @return {Query}\n */\n Query.createByUUID = function (uuid) {\n return Query.createByUUIDs(uuid);\n };\n /**\n * Create by UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.createByUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n var ids = [];\n for (var i in uuids) {\n ids.push(uuids[i].composedUUID());\n }\n var query = Query.create(\"\", exports.QUERY_DEFAULT_PAGE, ids.length)\n .disableAggregations()\n .disableSuggestions();\n query.filters._id = Filter_1.Filter.create(\"_id\", ids, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD);\n return query;\n };\n /**\n * set fields\n *\n * @param fields\n *\n * @return {Query}\n */\n Query.prototype.setFields = function (fields) {\n this.fields = fields;\n return this;\n };\n /**\n * get fields\n *\n * @return {string[]}\n */\n Query.prototype.getFields = function () {\n return this.fields;\n };\n /**\n * Filter universe by types\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByTypes = function (values) {\n var _a;\n var fieldPath = Item_1.Item.getPathByField(\"type\");\n if (values.length > 0) {\n this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[\"type\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters.type;\n }\n return this;\n };\n /**\n * Filter by types\n *\n * @param values\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByTypes = function (values, aggregate, aggregationSort) {\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a, _b;\n var fieldPath = Item_1.Item.getPathByField(\"type\");\n if (values.length > 0) {\n this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[\"type\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters.type;\n }\n if (aggregate) {\n this.aggregations = tslib_1.__assign({}, this.aggregations, (_b = {}, _b[\"type\"] = Aggregation_1.Aggregation.create(\"type\", fieldPath, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort), _b));\n }\n return this;\n };\n /**\n * Filter universe by ids\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByIds = function (values) {\n var _a;\n var fieldPath = Item_1.Item.getPathByField(\"id\");\n if (values.length > 0) {\n this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[\"id\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters.id;\n }\n return this;\n };\n /**\n * Filter by ids\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterByIds = function (values) {\n var _a;\n var fieldPath = Item_1.Item.getPathByField(\"id\");\n if (values.length > 0) {\n this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[\"id\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters.id;\n }\n return this;\n };\n /**\n * Filter universe by\n *\n * @param field\n * @param values\n * @param applicationType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseBy = function (field, values, applicationType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n var _a;\n var fieldPath = Item_1.Item.getPathByField(field);\n if (values.length > 0) {\n this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[field] = Filter_1.Filter.create(fieldPath, values, applicationType, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters[field];\n }\n return this;\n };\n /**\n * Filter by\n *\n * @param filterName\n * @param field\n * @param values\n * @param applicationType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterBy = function (filterName, field, values, applicationType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a;\n var fieldPath = Item_1.Item.getPathByField(field);\n if (values.length > 0) {\n this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[filterName] = Filter_1.Filter.create(fieldPath, values, applicationType, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters[filterName];\n }\n if (aggregate) {\n this.aggregateBy(filterName, field, applicationType, aggregationSort);\n }\n return this;\n };\n /**\n * Filter universe by range\n *\n * @param field\n * @param values\n * @param applicationType\n * @param rangeType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByRange = function (field, values, applicationType, rangeType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n var _a;\n var fieldPath = Item_1.Item.getPathByField(field);\n if (values.length > 0) {\n this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[field] = Filter_1.Filter.create(fieldPath, values, applicationType, rangeType), _a));\n }\n else {\n delete this.universeFilters[field];\n }\n return this;\n };\n /**\n * Filter universe by date range\n *\n * @param field\n * @param values\n * @param applicationType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByDateRange = function (field, values, applicationType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n return this.filterUniverseByRange(field, values, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE);\n };\n /**\n * Filter by range\n *\n * @param filterName\n * @param field\n * @param options\n * @param values\n * @param applicationType\n * @param rangeType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByRange = function (filterName, field, options, values, applicationType, rangeType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a;\n var fieldPath = Item_1.Item.getPathByField(field);\n if (values.length !== 0) {\n this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[filterName] = Filter_1.Filter.create(fieldPath, values, applicationType, rangeType), _a));\n }\n else {\n delete this.filters[filterName];\n }\n if (aggregate) {\n this.aggregateByRange(filterName, fieldPath, options, applicationType, rangeType, aggregationSort);\n }\n return this;\n };\n /**\n * Filter by date range\n *\n * @param filterName\n * @param field\n * @param options\n * @param values\n * @param applicationType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByDateRange = function (filterName, field, options, values, applicationType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n return this.filterByRange(filterName, field, options, values, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE, aggregate, aggregationSort);\n };\n /**\n * Filter universe by location\n *\n * @param locationRange\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByLocation = function (locationRange) {\n var _a;\n this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[\"coordinate\"] = Filter_1.Filter.create(\"coordinate\", locationRange.toArray(), Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_GEO), _a));\n return this;\n };\n /**\n * Set filter fields\n *\n * @param filterFields\n *\n * @return {Query}\n */\n Query.prototype.setFilterFields = function (filterFields) {\n this.filterFields = filterFields;\n return this;\n };\n /**\n * Get filter fields\n *\n * @return {string[]}\n */\n Query.prototype.getFilterFields = function () {\n return this.filterFields;\n };\n /**\n * Sort by\n *\n * @param sortBy\n *\n * @return {Query}\n */\n Query.prototype.sortBy = function (sortBy) {\n if (sortBy.isSortedByGeoDistance()) {\n if (!(this.coordinate instanceof Coordinate_1.Coordinate)) {\n throw InvalidFormatError_1.InvalidFormatError.querySortedByDistanceWithoutCoordinate();\n }\n sortBy.setCoordinate(this.coordinate);\n }\n this.sortByInstance = sortBy;\n return this;\n };\n /**\n * Aggregate by\n *\n * @param filterName\n * @param field\n * @param applicationType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateBy = function (filterName, field, applicationType, aggregationSort, limit) {\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n var _a;\n this.aggregations = tslib_1.__assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Item_1.Item.getPathByField(field), applicationType, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort, limit), _a));\n return this;\n };\n /**\n * Aggregate by range\n *\n * @param filterName\n * @param field\n * @param options\n * @param applicationType\n * @param rangeType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateByRange = function (filterName, field, options, applicationType, rangeType, aggregationSort, limit) {\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n var _a;\n if (options.length === 0) {\n return this;\n }\n this.aggregations = tslib_1.__assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Item_1.Item.getPathByField(field), applicationType, rangeType, options, aggregationSort, limit), _a));\n return this;\n };\n /**\n * Aggregate by date range\n *\n * @param filterName\n * @param field\n * @param options\n * @param applicationType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateByDateRange = function (filterName, field, options, applicationType, aggregationSort, limit) {\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n return this.aggregateByRange(filterName, field, options, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE, aggregationSort, limit);\n };\n /**\n * Get aggregations\n *\n * @return {{}}\n */\n Query.prototype.getAggregations = function () {\n return this.aggregations;\n };\n /**\n * Get aggregation by name\n *\n * @param aggregationName\n *\n * @return {Aggregation|null}\n */\n Query.prototype.getAggregation = function (aggregationName) {\n return this.aggregations[aggregationName] instanceof Aggregation_1.Aggregation\n ? this.aggregations[aggregationName]\n : null;\n };\n /**\n * Get query text\n *\n * @return {string}\n */\n Query.prototype.getQueryText = function () {\n var filter = this.filters._query;\n return filter instanceof Filter_1.Filter\n ? filter.getValues()[0]\n : \"\";\n };\n /**\n * Get universe filters\n *\n * @return {{}}\n */\n Query.prototype.getUniverseFilters = function () {\n return this.universeFilters;\n };\n /**\n * Get universe filter by name\n *\n * @param filterName\n *\n * @return {Filter|null}\n */\n Query.prototype.getUniverseFilter = function (filterName) {\n return this.universeFilters[filterName] instanceof Filter_1.Filter\n ? this.universeFilters[filterName]\n : null;\n };\n /**\n * Get filters\n *\n * @return {{}}\n */\n Query.prototype.getFilters = function () {\n return this.filters;\n };\n /**\n * Get filter by name\n *\n * @param filterName\n *\n * @return {Filter|null}\n */\n Query.prototype.getFilter = function (filterName) {\n return this.filters[filterName] instanceof Filter_1.Filter\n ? this.filters[filterName]\n : null;\n };\n /**\n * Get filter by field\n *\n * @param fieldName\n *\n * @return {Filter|null}\n */\n Query.prototype.getFilterByField = function (fieldName) {\n var fieldPath = Item_1.Item.getPathByField(fieldName);\n for (var i in this.filters) {\n if (this.filters[i].getField() == fieldPath) {\n return this.filters[i];\n }\n }\n return null;\n };\n /**\n * Get sort by\n *\n * @return {SortBy}\n */\n Query.prototype.getSortBy = function () {\n return this.sortByInstance;\n };\n /**\n * Get from\n *\n * @return {number}\n */\n Query.prototype.getFrom = function () {\n return this.from;\n };\n /**\n * Get size\n *\n * @return {number}\n */\n Query.prototype.getSize = function () {\n return this.size;\n };\n /**\n * Get page\n *\n * @return {number}\n */\n Query.prototype.getPage = function () {\n return this.page;\n };\n /**\n * Enable results\n *\n * @return {Query}\n */\n Query.prototype.enableResults = function () {\n this.resultsEnabled = true;\n return this;\n };\n /**\n * Disable results\n *\n * @return {Query}\n */\n Query.prototype.disableResults = function () {\n this.resultsEnabled = false;\n return this;\n };\n /**\n * Are results enabled\n *\n * @return {boolean}\n */\n Query.prototype.areResultsEnabled = function () {\n return this.resultsEnabled;\n };\n /**\n * Enable aggregations\n *\n * @return {Query}\n */\n Query.prototype.enableAggregations = function () {\n this.aggregationsEnabled = true;\n return this;\n };\n /**\n * Disable aggregations\n *\n * @return {Query}\n */\n Query.prototype.disableAggregations = function () {\n this.aggregationsEnabled = false;\n return this;\n };\n /**\n * Are aggregations enabled\n *\n * @return {boolean}\n */\n Query.prototype.areAggregationsEnabled = function () {\n return this.aggregationsEnabled;\n };\n /**\n * Enable suggestions\n *\n * @return {Query}\n */\n Query.prototype.enableSuggestions = function () {\n this.suggestionsEnabled = true;\n return this;\n };\n /**\n * Disable suggestions\n *\n * @return {Query}\n */\n Query.prototype.disableSuggestions = function () {\n this.suggestionsEnabled = false;\n return this;\n };\n /**\n * Are suggestions enabled\n *\n * @return {boolean}\n */\n Query.prototype.areSuggestionsEnabled = function () {\n return this.suggestionsEnabled;\n };\n /**\n * Enable highlights\n *\n * @return {Query}\n */\n Query.prototype.enableHighlights = function () {\n this.highlightsEnabled = true;\n return this;\n };\n /**\n * Disable highlights\n *\n * @return {Query}\n */\n Query.prototype.disableHighlights = function () {\n this.highlightsEnabled = false;\n return this;\n };\n /**\n * Are highlights enabled\n *\n * @return {boolean}\n */\n Query.prototype.areHighlightsEnabled = function () {\n return this.highlightsEnabled;\n };\n /**\n * Promote uuid\n *\n * @param itemUUID\n *\n * @return {Query}\n */\n Query.prototype.promoteUUID = function (itemUUID) {\n this\n .itemsPromoted\n .push(itemUUID);\n return this;\n };\n /**\n * Promote UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.prototype.promoteUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n this.itemsPromoted = uuids;\n return this;\n };\n /**\n * Get promoted UUIDs\n *\n * @return {ItemUUID[]}\n */\n Query.prototype.getItemsPromoted = function () {\n return this.itemsPromoted;\n };\n /**\n * Exclude id\n *\n * @param itemUUID\n *\n * @return {Query}\n */\n Query.prototype.excludeUUID = function (itemUUID) {\n this.excludeUUIDs(itemUUID);\n return this;\n };\n /**\n * Exclude UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.prototype.excludeUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n var _a;\n this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[\"excluded_ids\"] = Filter_1.Filter.create(\"_id\", uuids.map(function (uuid) { return uuid.composedUUID(); }), Filter_2.FILTER_EXCLUDE, Filter_2.FILTER_TYPE_FIELD), _a));\n return this;\n };\n /**\n * Get score strategies\n *\n * @return {ScoreStrategies}\n */\n Query.prototype.getScoreStrategies = function () {\n return this.scoreStrategies;\n };\n /**\n * Set score strategies\n *\n * @param scoreStrategies\n */\n Query.prototype.setScoreStrategies = function (scoreStrategies) {\n this.scoreStrategies = scoreStrategies;\n return this;\n };\n /**\n * Get fuzziness\n *\n * @return any\n */\n Query.prototype.getFuzziness = function () {\n return this.fuzziness;\n };\n /**\n * Set fuzziness\n *\n * @param fuzziness\n *\n * @return {Query}\n */\n Query.prototype.setFuzziness = function (fuzziness) {\n this.fuzziness = fuzziness;\n return this;\n };\n /**\n * Set auto fuzziness\n *\n * @return {Query}\n */\n Query.prototype.setAutoFuzziness = function () {\n this.fuzziness = 'AUTO';\n return this;\n };\n /**\n * Get min score\n *\n * @return any\n */\n Query.prototype.getMinScore = function () {\n return this.minScore;\n };\n /**\n * Set min score\n *\n * @param minScore\n *\n * @return {Query}\n */\n Query.prototype.setMinScore = function (minScore) {\n this.minScore = minScore;\n return this;\n };\n /**\n * By user\n *\n * @param user\n *\n * @return {Query}\n */\n Query.prototype.byUser = function (user) {\n this.user = user;\n return this;\n };\n /**\n * By anyone\n *\n * @return {null}\n */\n Query.prototype.anonymously = function () {\n this.user = null;\n return null;\n };\n /**\n * Get user\n *\n * @return {User}\n */\n Query.prototype.getUser = function () {\n return this.user;\n };\n /**\n * To array\n *\n * @return {any}\n */\n Query.prototype.toArray = function () {\n var array = {};\n if (this.getQueryText() !== \"\") {\n array.q = this.getQueryText();\n }\n if (this.coordinate instanceof Coordinate_1.Coordinate) {\n array.coordinate = this.coordinate.toArray();\n }\n /**\n * Fields\n */\n if (this.fields instanceof Array &&\n this.fields.length > 0) {\n array.fields = this.fields;\n }\n /**\n * Universe Filters\n */\n if (Object.keys(this.universeFilters).length) {\n array.universe_filters = {};\n for (var i in this.universeFilters) {\n var universeFilter = this.universeFilters[i];\n array.universe_filters[i] = universeFilter.toArray();\n }\n }\n /**\n * Filters\n */\n if (this.filters instanceof Object &&\n Object.keys(this.filters).length) {\n array.filters = {};\n for (var i in this.filters) {\n var filter = this.filters[i];\n if (filter.getFilterType() !== Filter_3.FILTER_TYPE_QUERY) {\n array.filters[i] = filter.toArray();\n }\n }\n }\n /**\n * Aggregations\n */\n if (this.aggregations instanceof Object &&\n Object.keys(this.aggregations).length) {\n array.aggregations = {};\n for (var i in this.aggregations) {\n var aggregation = this.aggregations[i];\n array.aggregations[i] = aggregation.toArray();\n }\n }\n /**\n * Sort\n */\n var sort = this.sortByInstance.toArray();\n if (Object.keys(sort).length) {\n array.sort = sort;\n }\n /**\n * Page\n */\n var page = this.page;\n if (page !== exports.QUERY_DEFAULT_PAGE) {\n array.page = page;\n }\n /**\n * Size\n */\n var size = this.size;\n if (size !== exports.QUERY_DEFAULT_SIZE) {\n array.size = size;\n }\n /**\n * Booleans\n */\n if (this.resultsEnabled === false) {\n array.results_enabled = false;\n }\n if (this.suggestionsEnabled === true) {\n array.suggestions_enabled = true;\n }\n if (this.highlightsEnabled === true) {\n array.highlights_enabled = true;\n }\n if (this.aggregationsEnabled === false) {\n array.aggregations_enabled = false;\n }\n /**\n * Filter fields\n */\n if (this.filterFields instanceof Array &&\n this.filterFields.length > 0) {\n array.filter_fields = this.filterFields;\n }\n /**\n * Score strategies\n */\n if (this.scoreStrategies instanceof ScoreStrategies_1.ScoreStrategies) {\n var scoreStrategiesAsArray = this.scoreStrategies.toArray();\n if (Object.keys(scoreStrategiesAsArray).length > 0) {\n array.score_strategies = scoreStrategiesAsArray;\n }\n }\n if (this.fuzziness !== null) {\n array.fuzziness = this.fuzziness;\n }\n /**\n * Min score\n */\n var minScore = this.minScore;\n if (minScore !== exports.NO_MIN_SCORE) {\n array.min_score = minScore;\n }\n /**\n * User\n */\n if (this.user instanceof User_1.User) {\n var userAsArray = this.user.toArray();\n if (Object.keys(userAsArray).length > 0) {\n array.user = userAsArray;\n }\n }\n /**\n * items promoted\n */\n if (this.itemsPromoted.length > 0) {\n array.items_promoted = [];\n for (var i in this.itemsPromoted) {\n array\n .items_promoted\n .push(this.itemsPromoted[i].toArray());\n }\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Query}\n */\n Query.createFromArray = function (array) {\n var query = array.coordinate instanceof Object\n ? Query.createLocated(Coordinate_1.Coordinate.createFromArray(array.coordinate), array.q ? array.q : \"\", array.page ? array.page : exports.QUERY_DEFAULT_PAGE, array.size ? array.size : exports.QUERY_DEFAULT_SIZE)\n : Query.create(array.q ? array.q : \"\", array.page ? array.page : exports.QUERY_DEFAULT_PAGE, array.size ? array.size : exports.QUERY_DEFAULT_SIZE);\n /**\n * Fields\n */\n query.fields = array.fields instanceof Array\n ? array.fields\n : [];\n /**\n * Aggregations\n */\n var aggregationsAsArray = typeof array.aggregations === typeof {}\n ? array.aggregations\n : {};\n for (var i in aggregationsAsArray) {\n query.aggregations[i] = Aggregation_1.Aggregation.createFromArray(aggregationsAsArray[i]);\n }\n /**\n * Sort\n */\n var sortAsArray = typeof array.sort === typeof {}\n ? array.sort\n : {};\n if (Object.keys(sortAsArray).length > 0) {\n query.sortByInstance = SortBy_1.SortBy.createFromArray(sortAsArray);\n }\n /**\n * Filters\n */\n var filtersAsArray = typeof array.filters === typeof {}\n ? array.filters\n : {};\n for (var i in filtersAsArray) {\n query.filters[i] = Filter_1.Filter.createFromArray(filtersAsArray[i]);\n }\n /**\n * Universe Filters\n */\n var universeFiltersAsArray = typeof array.universe_filters === typeof {}\n ? array.universe_filters\n : {};\n for (var i in universeFiltersAsArray) {\n query.universeFilters[i] = Filter_1.Filter.createFromArray(universeFiltersAsArray[i]);\n }\n /**\n * Booleans\n */\n query.resultsEnabled = typeof array.results_enabled === \"boolean\"\n ? array.results_enabled\n : true;\n query.suggestionsEnabled = typeof array.suggestions_enabled === \"boolean\"\n ? array.suggestions_enabled\n : false;\n query.aggregationsEnabled = typeof array.aggregations_enabled === \"boolean\"\n ? array.aggregations_enabled\n : true;\n query.highlightsEnabled = typeof array.highlights_enabled === \"boolean\"\n ? array.highlights_enabled\n : false;\n query.fuzziness = array.fuzziness;\n query.minScore = array.min_score ? array.min_score : exports.NO_MIN_SCORE;\n /**\n * Items promoted\n */\n var itemsPromotedAsArray = typeof array.items_promoted === typeof {}\n ? array.items_promoted\n : {};\n for (var i in itemsPromotedAsArray) {\n query\n .itemsPromoted\n .push(ItemUUID_1.ItemUUID.createFromArray(itemsPromotedAsArray[i]));\n }\n /**\n * Filter fields\n */\n query.filterFields = array.filter_fields instanceof Array\n ? array.filter_fields\n : [];\n query.scoreStrategies = array.score_strategies instanceof Object\n ? ScoreStrategies_1.ScoreStrategies.createFromArray(array.score_strategies)\n : null;\n query.user = array.user instanceof Object\n ? User_1.User.createFromArray(array.user)\n : null;\n return query;\n };\n return Query;\n}());\nexports.Query = Query;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * Coordinate Type cast\n * @param coordinate\n */\nvar Coordinate = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param {number} lat\n * @param {number} lon\n */\n function Coordinate(lat, lon) {\n this.lat = lat;\n this.lon = lon;\n }\n /**\n * Get latitude\n *\n * @return float\n */\n Coordinate.prototype.getLatitude = function () {\n return this.lat;\n };\n /**\n * Get longitude\n *\n * @return float\n */\n Coordinate.prototype.getLongitude = function () {\n return this.lon;\n };\n /**\n * To array\n *\n * @return {{lat: number, lon: number}}\n */\n Coordinate.prototype.toArray = function () {\n return {\n lat: this.lat,\n lon: this.lon\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return Coordinate\n *\n * @throws InvalidFormatError\n */\n Coordinate.createFromArray = function (array) {\n if (typeof array.lat == \"undefined\" ||\n typeof array.lon == \"undefined\") {\n throw InvalidFormatError_1.InvalidFormatError.coordinateFormatNotValid();\n }\n return new Coordinate(array.lat, array.lon);\n };\n return Coordinate;\n}());\nexports.Coordinate = Coordinate;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * ItemUUID class\n */\nvar ItemUUID = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param id\n * @param type\n */\n function ItemUUID(id, type) {\n this.id = id;\n this.type = type;\n }\n /**\n * Create composed UUID\n *\n * @param composedUUID\n *\n * @returns {ItemUUID}\n */\n ItemUUID.createByComposedUUID = function (composedUUID) {\n var parts = composedUUID.split(\"~\");\n if (2 != parts.length) {\n throw InvalidFormatError_1.InvalidFormatError.composedItemUUIDNotValid();\n }\n return new ItemUUID(parts[0], parts[1]);\n };\n /**\n * Return id\n *\n * @returns {string}\n */\n ItemUUID.prototype.getId = function () {\n return this.id;\n };\n /**\n * Get type\n *\n * @returns {string}\n */\n ItemUUID.prototype.getType = function () {\n return this.type;\n };\n /**\n * To array\n *\n * @returns {{id: *, type: *}}\n */\n ItemUUID.prototype.toArray = function () {\n return {\n id: this.id,\n type: this.type\n };\n };\n /**\n * Create from array\n *\n * @param array {{id:string, type:string}}\n *\n * @return {ItemUUID}\n */\n ItemUUID.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new ItemUUID(array.id, array.type);\n };\n /**\n * Compose unique id\n *\n * @returns {string}\n */\n ItemUUID.prototype.composedUUID = function () {\n return this.id + \"~\" + this.type;\n };\n return ItemUUID;\n}());\nexports.ItemUUID = ItemUUID;\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","\"use strict\";\nexports.__esModule = true;\nvar Filter_1 = require(\"./Filter\");\n/**\n * Aggregation constants\n */\nexports.AGGREGATION_SORT_BY_COUNT_ASC = [\"_count\", \"asc\"];\nexports.AGGREGATION_SORT_BY_COUNT_DESC = [\"_count\", \"desc\"];\nexports.AGGREGATION_SORT_BY_NAME_ASC = [\"_term\", \"asc\"];\nexports.AGGREGATION_SORT_BY_NAME_DESC = [\"_term\", \"desc\"];\nexports.AGGREGATION_NO_LIMIT = 0;\n/**\n * Aggregation class\n */\nvar Aggregation = /** @class */ (function () {\n /**\n * Construct\n *\n * @param name\n * @param field\n * @param applicationType\n * @param filterType\n * @param subgroup\n * @param sort\n * @param limit\n */\n function Aggregation(name, field, applicationType, filterType, subgroup, sort, limit) {\n this.subgroup = [];\n this.name = name;\n this.field = field;\n this.applicationType = applicationType;\n this.filterType = filterType;\n this.subgroup = subgroup;\n this.sort = sort;\n this.limit = limit;\n }\n /**\n * Get name\n *\n * @returns {string}\n */\n Aggregation.prototype.getName = function () {\n return this.name;\n };\n /**\n * Get field\n *\n * @returns {string}\n */\n Aggregation.prototype.getField = function () {\n return this.field;\n };\n /**\n * getApplicationType\n *\n * @returns {number}\n */\n Aggregation.prototype.getApplicationType = function () {\n return this.applicationType;\n };\n /**\n * Get filter type\n *\n * @return {string}\n */\n Aggregation.prototype.getFilterType = function () {\n return this.filterType;\n };\n /**\n * Get subgroup\n *\n * @return {[]}\n */\n Aggregation.prototype.getSubgroup = function () {\n return this.subgroup;\n };\n /**\n * Get sort\n *\n * @return {[]}\n */\n Aggregation.prototype.getSort = function () {\n return this.sort;\n };\n /**\n * Get limit\n *\n * @return {number}\n */\n Aggregation.prototype.getLimit = function () {\n return this.limit;\n };\n /**\n * Create\n *\n * @param name\n * @param field\n * @param applicationType\n * @param filterType\n * @param subgroup\n * @param sort\n * @param limit\n *\n * @returns {Aggregation}\n */\n Aggregation.create = function (name, field, applicationType, filterType, subgroup, sort, limit) {\n if (subgroup === void 0) { subgroup = []; }\n if (sort === void 0) { sort = exports.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = exports.AGGREGATION_NO_LIMIT; }\n return new Aggregation(name, field, applicationType, filterType, subgroup, sort, limit);\n };\n /**\n * To array\n *\n * @returns {Array}\n */\n Aggregation.prototype.toArray = function () {\n var aggregationAsArray = {\n name: this.name\n };\n if (this.field != \"uuid.type\") {\n aggregationAsArray.field = this.field;\n }\n if (this.applicationType != Filter_1.FILTER_AT_LEAST_ONE) {\n aggregationAsArray.application_type = this.applicationType;\n }\n if (this.filterType != Filter_1.FILTER_TYPE_FIELD) {\n aggregationAsArray.filter_type = this.filterType;\n }\n if (this.subgroup.length > 0) {\n aggregationAsArray.subgroup = this.subgroup;\n }\n if (JSON.stringify(this.sort) !== JSON.stringify(exports.AGGREGATION_SORT_BY_COUNT_DESC)) {\n aggregationAsArray.sort = this.sort;\n }\n if (this.limit != exports.AGGREGATION_NO_LIMIT) {\n aggregationAsArray.limit = this.limit;\n }\n return aggregationAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Aggregation}\n */\n Aggregation.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.field == \"undefined\") {\n array.field = \"uuid.type\";\n }\n if (typeof array.application_type == \"undefined\") {\n array.application_type = Filter_1.FILTER_AT_LEAST_ONE;\n }\n if (typeof array.filter_type == \"undefined\") {\n array.filter_type = Filter_1.FILTER_TYPE_FIELD;\n }\n if (typeof array.subgroup == \"undefined\") {\n array.subgroup = [];\n }\n if (typeof array.sort == \"undefined\") {\n array.sort = exports.AGGREGATION_SORT_BY_COUNT_DESC;\n }\n if (typeof array.limit == \"undefined\") {\n array.limit = exports.AGGREGATION_NO_LIMIT;\n }\n return Aggregation.create(array.name, array.field, array.application_type, array.filter_type, array.subgroup, array.sort, array.limit);\n };\n return Aggregation;\n}());\nexports.Aggregation = Aggregation;\n","\"use strict\";\nexports.__esModule = true;\nvar Item_1 = require(\"../Model/Item\");\n/**\n export * Sort by constants\n */\nexports.SORT_BY_TYPE_FIELD = 1;\nexports.SORT_BY_TYPE_NESTED = 2;\nexports.SORT_BY_ASC = \"asc\";\nexports.SORT_BY_DESC = \"desc\";\nexports.SORT_BY_MODE_AVG = \"avg\";\nexports.SORT_BY_MODE_SUM = \"sum\";\nexports.SORT_BY_MODE_MIN = \"min\";\nexports.SORT_BY_MODE_MAX = \"max\";\nexports.SORT_BY_MODE_MEDIAN = \"median\";\nexports.SORT_BY_SCORE = {\n _score: {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_RANDOM = {\n random: {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_AL_TUN_TUN = exports.SORT_BY_RANDOM;\nexports.SORT_BY_ID_ASC = {\n \"uuid.id\": {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_ID_DESC = {\n \"uuid.id\": {\n order: exports.SORT_BY_DESC\n }\n};\nexports.SORT_BY_TYPE_ASC = {\n \"uuid.type\": {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_TYPE_DESC = {\n \"uuid.type\": {\n order: exports.SORT_BY_DESC\n }\n};\nexports.SORT_BY_LOCATION_KM_ASC = {\n _geo_distance: {\n order: exports.SORT_BY_ASC,\n unit: \"km\"\n }\n};\nexports.SORT_BY_LOCATION_MI_ASC = {\n _geo_distance: {\n order: exports.SORT_BY_DESC,\n unit: \"mi\"\n }\n};\nvar Coordinate_1 = require(\"../Model/Coordinate\");\nvar Filter_1 = require(\"./Filter\");\n/**\n * ScoreStrategy\n */\nvar SortBy = /** @class */ (function () {\n function SortBy() {\n this.sortsBy = [];\n }\n /**\n * Create\n *\n * @return {SortBy}\n */\n SortBy.create = function () {\n return new SortBy;\n };\n /**\n * Sort By fields values\n *\n * @param shortSortByElements\n *\n * @return {SortBy}\n */\n SortBy.byFieldsValues = function (shortSortByElements) {\n var sortBy = SortBy.create();\n for (var key in shortSortByElements) {\n sortBy.byFieldValue(key, shortSortByElements[key]);\n }\n return sortBy;\n };\n /**\n * All\n *\n * @return {Array}\n */\n SortBy.prototype.all = function () {\n return this.sortsBy.length > 0\n ? this.sortsBy\n : [exports.SORT_BY_SCORE];\n };\n /**\n * Sort by value\n *\n * @param value\n *\n * @return {SortBy}\n */\n SortBy.prototype.byValue = function (value) {\n if (exports.SORT_BY_SCORE != value &&\n exports.SORT_BY_RANDOM != value) {\n if (typeof value.type == \"undefined\") {\n value.type = exports.SORT_BY_TYPE_FIELD;\n }\n }\n if (exports.SORT_BY_SCORE != value) {\n this.sortsBy.push(value);\n }\n return this;\n };\n /**\n * Sort by field value\n *\n * @param field\n * @param order\n *\n * @return {SortBy}\n */\n SortBy.prototype.byFieldValue = function (field, order) {\n var object = {\n type: exports.SORT_BY_TYPE_FIELD\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Sort by nested field\n *\n * @param field\n * @param order\n * @param mode\n *\n * @return {SortBy}\n */\n SortBy.prototype.byNestedField = function (field, order, mode) {\n if (mode === void 0) { mode = exports.SORT_BY_MODE_AVG; }\n var object = {\n type: exports.SORT_BY_TYPE_NESTED,\n mode: mode\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Sort by nested field and filter\n *\n * @param field\n * @param order\n * @param filter\n * @param mode\n *\n * @return {SortBy}\n */\n SortBy.prototype.byNestedFieldAndFilter = function (field, order, filter, mode) {\n if (mode === void 0) { mode = exports.SORT_BY_MODE_AVG; }\n var fieldPath = Item_1.Item.getPathByField(filter.getField());\n var filterAsArray = filter.toArray();\n filterAsArray.field = fieldPath;\n filter = Filter_1.Filter.createFromArray(filterAsArray);\n var object = {\n type: exports.SORT_BY_TYPE_NESTED,\n mode: mode,\n filter: filter\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Is sorted by geo distance\n *\n * @return {boolean}\n */\n SortBy.prototype.isSortedByGeoDistance = function () {\n for (var i in this.sortsBy) {\n if (typeof this.sortsBy[i]._geo_distance === typeof {}) {\n return true;\n }\n }\n return false;\n };\n /**\n * Set coordinate\n *\n * @param coordinate\n *\n * @return {SortBy}\n */\n SortBy.prototype.setCoordinate = function (coordinate) {\n for (var i in this.sortsBy) {\n if (typeof this.sortsBy[i]._geo_distance === typeof {}) {\n this.sortsBy[i]._geo_distance.coordinate = coordinate;\n }\n }\n return this;\n };\n /**\n * Has random sort\n *\n * @return {boolean}\n */\n SortBy.prototype.hasRandomSort = function () {\n for (var i in this.sortsBy) {\n if (JSON.stringify(this.sortsBy[i]) === JSON.stringify(exports.SORT_BY_RANDOM)) {\n return true;\n }\n }\n return false;\n };\n /**\n * To array\n *\n * @return {[]}\n */\n SortBy.prototype.toArray = function () {\n var copySortBy = this.copy();\n var sortsByAsArray = copySortBy.sortsBy;\n for (var i in sortsByAsArray) {\n if (sortsByAsArray[i].type == exports.SORT_BY_TYPE_FIELD) {\n delete sortsByAsArray[i].type;\n }\n if (typeof sortsByAsArray[i].filter === typeof {} &&\n sortsByAsArray[i].filter != null) {\n sortsByAsArray[i].filter = sortsByAsArray[i].filter.toArray();\n }\n if (typeof sortsByAsArray[i]._geo_distance === typeof {} &&\n sortsByAsArray[i]._geo_distance !== null &&\n sortsByAsArray[i]._geo_distance.coordinate instanceof Coordinate_1.Coordinate) {\n sortsByAsArray[i]._geo_distance.coordinate = sortsByAsArray[i]._geo_distance.coordinate.toArray();\n }\n }\n return sortsByAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {SortBy}\n */\n SortBy.createFromArray = function (array) {\n var innerArray = JSON.parse(JSON.stringify(array));\n var sortBy = SortBy.create();\n for (var i in innerArray) {\n var element = innerArray[i];\n if (JSON.stringify(element) !== JSON.stringify(exports.SORT_BY_RANDOM) &&\n JSON.stringify(element) !== JSON.stringify(exports.SORT_BY_SCORE)) {\n if (typeof element.type == \"undefined\") {\n element.type = exports.SORT_BY_TYPE_FIELD;\n }\n }\n if (typeof element.filter === typeof {} &&\n element.filter != null) {\n element.filter = Filter_1.Filter.createFromArray(element.filter);\n }\n if (typeof element._geo_distance === typeof {} &&\n element._geo_distance != null &&\n typeof element._geo_distance.coordinate === typeof {}) {\n element._geo_distance.coordinate = Coordinate_1.Coordinate.createFromArray(element._geo_distance.coordinate);\n }\n sortBy.sortsBy.push(element);\n }\n return sortBy;\n };\n /**\n * Make a copy of this\n *\n * @returns {SortBy}\n */\n SortBy.prototype.copy = function () {\n var newSortBy = SortBy.create();\n for (var i in this.sortsBy) {\n var sortBy = this.sortsBy[i];\n var sortByAsArray = JSON.parse(JSON.stringify(sortBy));\n if (typeof sortBy.filter === typeof {} &&\n sortBy.filter != null) {\n sortByAsArray.filter = Filter_1.Filter.createFromArray(sortBy.filter.toArray());\n }\n if (typeof sortBy._geo_distance === typeof {} &&\n sortBy._geo_distance != null &&\n typeof sortBy._geo_distance.coordinate == typeof {}) {\n sortByAsArray._geo_distance.coordinate = Coordinate_1.Coordinate.createFromArray(sortBy._geo_distance.coordinate.toArray());\n }\n newSortBy.sortsBy.push(sortByAsArray);\n }\n return newSortBy;\n };\n return SortBy;\n}());\nexports.SortBy = SortBy;\n","\"use strict\";\nexports.__esModule = true;\nvar Item_1 = require(\"../Model/Item\");\nvar Query_1 = require(\"../Query/Query\");\nvar ResultAggregations_1 = require(\"./ResultAggregations\");\n/**\n * Result class\n */\nvar Result = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param query\n * @param totalItems\n * @param totalHits\n */\n function Result(query, totalItems, totalHits) {\n this.items = [];\n this.suggests = [];\n this.query = query;\n this.totalItems = totalItems;\n this.totalHits = totalHits;\n }\n /**\n * Create\n *\n * @param query\n * @param totalItems\n * @param totalHits\n * @param aggregations\n * @param suggests\n * @param items\n *\n * @returns {Result}\n */\n Result.create = function (query, totalItems, totalHits, aggregations, suggests, items) {\n var result = new Result(query, totalItems, totalHits);\n result.aggregations = aggregations;\n result.suggests = suggests;\n result.items = items;\n return result;\n };\n /**\n * Add item\n *\n * @param item\n */\n Result.prototype.addItem = function (item) {\n this.items.push(item);\n };\n /**\n * Get items\n *\n * @return {Item[]}\n */\n Result.prototype.getItems = function () {\n return this.items;\n };\n /**\n * Get items grouped by types\n *\n * @return {any[]}\n */\n Result.prototype.getItemsGroupedByTypes = function () {\n if (this.itemsGroupedByTypeCache instanceof Object &&\n Object.keys(this.itemsGroupedByTypeCache).length > 0) {\n return this.itemsGroupedByTypeCache;\n }\n var itemsGroupedByTypes = {};\n for (var i in this.items) {\n var item = this.items[i];\n if (!(itemsGroupedByTypes[item.getType()] instanceof Array)) {\n itemsGroupedByTypes[item.getType()] = [];\n }\n itemsGroupedByTypes[item.getType()].push(item);\n }\n this.itemsGroupedByTypeCache = itemsGroupedByTypes;\n return itemsGroupedByTypes;\n };\n /**\n * Get items by type\n *\n * @param type\n *\n * @return {Array}\n */\n Result.prototype.getItemsByType = function (type) {\n var itemsGroupedByTypes = this.getItemsGroupedByTypes();\n return itemsGroupedByTypes[type] == null\n ? []\n : itemsGroupedByTypes[type];\n };\n /**\n * Get items by types\n *\n * @param types\n */\n Result.prototype.getItemsByTypes = function (types) {\n return this.items.filter(function (item) { return types.indexOf(item.getType()) >= 0; });\n };\n /**\n * Get first item\n *\n * @return {Item}\n */\n Result.prototype.getFirstItem = function () {\n return this.items.length > 0\n ? this.items[0]\n : null;\n };\n /**\n * Set aggregations\n *\n * @param aggregations\n */\n Result.prototype.setAggregations = function (aggregations) {\n this.aggregations = aggregations;\n };\n /**\n * Get aggregations\n *\n * @return {ResultAggregations}\n */\n Result.prototype.getAggregations = function () {\n return this.aggregations instanceof ResultAggregations_1.ResultAggregations\n ? this.aggregations\n : null;\n };\n /**\n * Get aggregation\n *\n * @param name\n *\n * @return {null}\n */\n Result.prototype.getAggregation = function (name) {\n return this.aggregations == null\n ? null\n : this.aggregations.getAggregation(name);\n };\n /**\n * Has no empty aggregation\n *\n * @param name\n *\n * @return {boolean}\n */\n Result.prototype.hasNotEmptyAggregation = function (name) {\n return this.aggregations == null\n ? false\n : this.aggregations.hasNotEmptyAggregation(name);\n };\n /**\n * Add suggest\n *\n * @param suggest\n */\n Result.prototype.addSuggest = function (suggest) {\n this.suggests.push(suggest);\n };\n /**\n * Get suggests\n *\n * @return {string[]}\n */\n Result.prototype.getSuggests = function () {\n return this.suggests;\n };\n /**\n * Get query\n *\n * @return {Query}\n */\n Result.prototype.getQuery = function () {\n return this.query;\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n Result.prototype.getTotalItems = function () {\n return this.totalItems;\n };\n /**\n * Get total hits\n *\n * @return {number}\n */\n Result.prototype.getTotalHits = function () {\n return this.totalHits;\n };\n /**\n * to array\n *\n * @return {{query: any, total_items: number, total_hits: number, items:any[], aggregations: any, suggests: string[]}}\n */\n Result.prototype.toArray = function () {\n return {\n query: this.query.toArray(),\n total_items: this.totalItems,\n total_hits: this.totalHits,\n items: this.items.map(function (item) { return item.toArray(); }),\n aggregations: this.aggregations == null\n ? null\n : this.aggregations.toArray(),\n suggests: this.suggests\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Result}\n */\n Result.createFromArray = function (array) {\n return Result.create(Query_1.Query.createFromArray(array.query), array.total_items\n ? array.total_items\n : 0, array.total_hits\n ? array.total_hits\n : 0, array.aggregations instanceof Object\n ? ResultAggregations_1.ResultAggregations.createFromArray(array.aggregations)\n : null, array.suggests\n ? array.suggests\n : null, array.items instanceof Array\n ? array.items.map(function (itemAsArray) { return Item_1.Item.createFromArray(itemAsArray); })\n : []);\n };\n return Result;\n}());\nexports.Result = Result;\n","\"use strict\";\nexports.__esModule = true;\nvar ResultAggregation_1 = require(\"./ResultAggregation\");\n/**\n * ResultAggregation class\n */\nvar ResultAggregations = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param totalElements\n */\n function ResultAggregations(totalElements) {\n this.aggregations = {};\n this.totalElements = totalElements;\n }\n /**\n * Add aggregation\n *\n * @param name\n * @param aggregation\n */\n ResultAggregations.prototype.addAggregation = function (name, aggregation) {\n this.aggregations[name] = aggregation;\n };\n /**\n * Get aggregations\n *\n * @returns {{}}\n */\n ResultAggregations.prototype.getAggregations = function () {\n return this.aggregations;\n };\n /**\n * Get aggregation\n *\n * @param name\n *\n * @returns {Aggregation|null}\n */\n ResultAggregations.prototype.getAggregation = function (name) {\n return this.aggregations[name] instanceof ResultAggregation_1.ResultAggregation\n ? this.aggregations[name]\n : null;\n };\n /**\n * Has not empty aggregation\n *\n * @param name\n *\n * @returns {boolean}\n */\n ResultAggregations.prototype.hasNotEmptyAggregation = function (name) {\n var aggregation = this.getAggregation(name);\n return (aggregation instanceof ResultAggregation_1.ResultAggregation) &&\n (!aggregation.isEmpty());\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n ResultAggregations.prototype.getTotalElements = function () {\n return this.totalElements;\n };\n /**\n * To array\n *\n * @return {{total_elements?: number, aggregations?: {}}}\n */\n ResultAggregations.prototype.toArray = function () {\n var aggregationCollection = {};\n for (var i in this.aggregations) {\n aggregationCollection[i] = this.aggregations[i].toArray();\n }\n var array = {};\n if (this.totalElements > 0) {\n array.total_elements = this.totalElements;\n }\n if (Object.keys(aggregationCollection).length > 0) {\n array.aggregations = aggregationCollection;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {ResultAggregations}\n */\n ResultAggregations.createFromArray = function (array) {\n var aggregations = new ResultAggregations(typeof array.total_elements === \"number\"\n ? array.total_elements\n : 0);\n if (typeof array.aggregations === typeof {}) {\n for (var i in array.aggregations) {\n aggregations.addAggregation(i, ResultAggregation_1.ResultAggregation.createFromArray(array.aggregations[i]));\n }\n }\n return aggregations;\n };\n return ResultAggregations;\n}());\nexports.ResultAggregations = ResultAggregations;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar axios_1 = require(\"axios\");\nvar Client_1 = require(\"./Client\");\nvar Response_1 = require(\"./Response\");\n/**\n * AxiosClient\n */\nvar AxiosClient = /** @class */ (function (_super) {\n tslib_1.__extends(AxiosClient, _super);\n /**\n * Constructor\n *\n * @param host\n * @param version\n * @param timeout\n * @param retryMap\n * @param overrideQueries\n * @param cache\n */\n function AxiosClient(host, version, timeout, retryMap, overrideQueries, cache) {\n var _this = _super.call(this, version, retryMap) || this;\n _this.host = host;\n _this.timeout = timeout;\n _this.cache = cache;\n _this.overrideQueries = overrideQueries;\n _this.cancelToken = {};\n return _this;\n }\n /**\n * Get\n *\n * @param url\n * @param method\n * @param credentials\n * @param parameters\n * @param data\n *\n * @return {Promise}\n */\n AxiosClient.prototype.get = function (url, method, credentials, parameters, data) {\n if (parameters === void 0) { parameters = {}; }\n if (data === void 0) { data = {}; }\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n var that;\n var _this = this;\n return tslib_1.__generator(this, function (_a) {\n that = this;\n url = url.replace(/^\\/*|\\/*$/g, \"\");\n url = \"/\" + (this.version + \"/\" + url).replace(/^\\/*|\\/*$/g, \"\");\n method = method.toLowerCase();\n if (\"get\" === method &&\n this.overrideQueries) {\n this.abort(url);\n }\n return [2 /*return*/, new Promise(function (resolve, reject) {\n var headers = \"get\" == method\n ? {}\n : {\n \"Content-Encoding\": \"gzip\",\n \"Content-Type\": \"application/json\"\n };\n var axiosRequestConfig = {\n url: url + \"?\" + Client_1.Client.objectToUrlParameters(tslib_1.__assign({}, credentials, parameters)),\n data: data,\n headers: headers,\n method: method,\n baseURL: that.host.replace(/\\/*$/g, \"\"),\n timeout: that.timeout,\n transformRequest: [function (data) { return JSON.stringify(data); }]\n };\n if (typeof _this.cancelToken[url] != 'undefined') {\n axiosRequestConfig.cancelToken = _this.cancelToken[url].token;\n }\n axios_1[\"default\"]\n .request(axiosRequestConfig)\n .then(function (axiosResponse) {\n var response = new Response_1.Response(axiosResponse.status, axiosResponse.data);\n return resolve(response);\n })[\"catch\"](function (error) {\n if (error.response === undefined) {\n return;\n }\n var response = new Response_1.Response(error.response.status, error.response.data);\n return reject(response);\n });\n })];\n });\n });\n };\n /**\n * Abort current request\n * And regenerate the cancellation token\n *\n * @param url\n */\n AxiosClient.prototype.abort = function (url) {\n if (typeof this.cancelToken[url] != 'undefined') {\n this.cancelToken[url].cancel();\n }\n this.generateCancelToken(url);\n };\n /**\n * Generate a new cancellation token for a query\n *\n * @param url\n */\n AxiosClient.prototype.generateCancelToken = function (url) {\n this.cancelToken[url] = axios_1[\"default\"].CancelToken.source();\n };\n return AxiosClient;\n}(Client_1.Client));\nexports.AxiosClient = AxiosClient;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildURL = require('./../helpers/buildURL');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar btoa = (typeof window !== 'undefined' && window.btoa && window.btoa.bind(window)) || require('./../helpers/btoa');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n var loadEvent = 'onreadystatechange';\n var xDomain = false;\n\n // For IE 8/9 CORS support\n // Only supports POST and GET calls and doesn't returns the response headers.\n // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.\n if (process.env.NODE_ENV !== 'test' &&\n typeof window !== 'undefined' &&\n window.XDomainRequest && !('withCredentials' in request) &&\n !isURLSameOrigin(config.url)) {\n request = new window.XDomainRequest();\n loadEvent = 'onload';\n xDomain = true;\n request.onprogress = function handleProgress() {};\n request.ontimeout = function handleTimeout() {};\n }\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request[loadEvent] = function handleLoad() {\n if (!request || (request.readyState !== 4 && !xDomain)) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n // IE sends 1223 instead of 204 (https://github.com/axios/axios/issues/201)\n status: request.status === 1223 ? 204 : request.status,\n statusText: request.status === 1223 ? 'No Content' : request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = require('./../helpers/cookies');\n\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Client\n */\nvar Client = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param version\n * @param retryMap\n */\n function Client(version, retryMap) {\n this.retryMap = retryMap;\n this.version = version.replace(/^\\/*|\\/*$/g, \"\");\n }\n /**\n * Build an url parameters array by an object\n *\n * @param params\n *\n * @returns {string}\n */\n Client.objectToUrlParameters = function (params) {\n var builtParams = [];\n for (var i in params) {\n builtParams.push(i + \"=\" + params[i]);\n }\n return builtParams.join(\"&\");\n };\n return Client;\n}());\nexports.Client = Client;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Response\n */\nvar Response = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param code\n * @param body\n */\n function Response(code, body) {\n this.code = code;\n this.body = body;\n }\n /**\n * Get code\n *\n * @return {number}\n */\n Response.prototype.getCode = function () {\n return this.code;\n };\n /**\n * Get body\n *\n * @return {any}\n */\n Response.prototype.getBody = function () {\n return this.body;\n };\n return Response;\n}());\nexports.Response = Response;\n","\"use strict\";\nexports.__esModule = true;\nvar Retry_1 = require(\"./Retry\");\n/**\n * Http class\n */\nvar RetryMap = /** @class */ (function () {\n function RetryMap() {\n this.retries = {};\n }\n /**\n * Add retry\n *\n * @param retry\n */\n RetryMap.prototype.addRetry = function (retry) {\n this.retries[retry.getUrl() + \"~~\" + retry.getMethod()] = retry;\n };\n /**\n * Create from array\n */\n RetryMap.createFromArray = function (array) {\n var retryMap = new RetryMap();\n retryMap.retries = array.map(function (retry) { return Retry_1.Retry.createFromArray(retry); });\n return retryMap;\n };\n /**\n * Get retry\n *\n * @param url\n * @param method\n *\n * @returns {Retry}\n */\n RetryMap.prototype.getRetry = function (url, method) {\n if (this.retries[url + \"~~\" + method] instanceof Retry_1.Retry) {\n return this.retries[url + \"~~\" + method];\n }\n if (this.retries[\"*~~\" + method] instanceof Retry_1.Retry) {\n return this.retries[\"*~~\" + method];\n }\n if (this.retries[url + \"~~*\"] instanceof Retry_1.Retry) {\n return this.retries[url + \"~~*\"];\n }\n if (this.retries[\"*~~*\"] instanceof Retry_1.Retry) {\n return this.retries[\"*~~*\"];\n }\n return null;\n };\n return RetryMap;\n}());\nexports.RetryMap = RetryMap;\n","\"use strict\";\nexports.__esModule = true;\nexports.DEFAULT_MICROSECONDS_BETWEEN_RETRIES = 1000;\n/**\n * Http class\n */\nvar Retry = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param url\n * @param method\n * @param retries\n * @param microsecondsBetweenRetries\n */\n function Retry(url, method, retries, microsecondsBetweenRetries) {\n this.url = url;\n this.method = method;\n this.retries = retries;\n this.microsecondsBetweenRetries = microsecondsBetweenRetries;\n }\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Retry}\n */\n Retry.createFromArray = function (array) {\n return new Retry(array.url ? array.url : \"*\", array.method ? array.method : \"*\", array.retries ? array.retries : 0, array.microseconds_between_retries\n ? array.microseconds_between_retries\n : exports.DEFAULT_MICROSECONDS_BETWEEN_RETRIES);\n };\n /**\n * Get url\n *\n * @return {string}\n */\n Retry.prototype.getUrl = function () {\n return this.url;\n };\n /**\n * Get method\n *\n * @return {string}\n */\n Retry.prototype.getMethod = function () {\n return this.method;\n };\n /**\n * Ge retries\n *\n * @return {number}\n */\n Retry.prototype.getRetries = function () {\n return this.retries;\n };\n /**\n * Get microseconds between retries\n *\n * @return {number}\n */\n Retry.prototype.getMicrosecondsBetweenRetries = function () {\n return this.microsecondsBetweenRetries;\n };\n return Retry;\n}());\nexports.Retry = Retry;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * User class\n */\nvar User = /** @class */ (function () {\n /**\n * Construct\n *\n * @param id string\n * @param attributes Array\n */\n function User(id, attributes) {\n if (attributes === void 0) { attributes = {}; }\n this.id = id;\n this.attributes = attributes;\n }\n /**\n * Return the user id\n *\n * @return {string}\n */\n User.prototype.getId = function () {\n return this.id;\n };\n /**\n * Return array\n *\n * @returns {{}}\n */\n User.prototype.getAttributes = function () {\n return this.attributes;\n };\n /**\n * To array\n *\n * @returns {{id: string, attributes: {}}}\n */\n User.prototype.toArray = function () {\n var array = {\n id: this.id\n };\n if (Object.keys(this.attributes).length > 0) {\n array.attributes = this.attributes;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return User\n */\n User.createFromArray = function (array) {\n if (array == null ||\n typeof array.id == \"undefined\" ||\n array.id == null) {\n throw InvalidFormatError_1.InvalidFormatError.userFormatNotValid();\n }\n var attributes = typeof array.attributes === typeof {}\n ? array.attributes\n : {};\n return new User(array.id, attributes);\n };\n return User;\n}());\nexports.User = User;\n","\"use strict\";\nexports.__esModule = true;\nvar ScoreStrategy_1 = require(\"./ScoreStrategy\");\n/**\n * ScoreStrategies constants\n */\nexports.MULTIPLY = 'multiply';\nexports.SUM = 'sum';\nexports.AVG = 'avg';\nexports.MAX = 'max';\nexports.MIN = 'min';\n/**\n * ScoreStrategies\n */\nvar ScoreStrategies = /** @class */ (function () {\n function ScoreStrategies() {\n this.scoreStrategies = [];\n }\n /**\n * Create empty\n *\n * @param scoreMode\n *\n * @return {ScoreStrategies}\n */\n ScoreStrategies.createEmpty = function (scoreMode) {\n if (scoreMode === void 0) { scoreMode = exports.SUM; }\n var scoreStrategies = new ScoreStrategies;\n scoreStrategies.scoreMode = scoreMode;\n return scoreStrategies;\n };\n /**\n * Add score strategy\n *\n * @param scoreStrategy\n *\n * @return {ScoreStrategies}\n */\n ScoreStrategies.prototype.addScoreStrategy = function (scoreStrategy) {\n this.scoreStrategies.push(scoreStrategy);\n return this;\n };\n /**\n * Get score strategies\n *\n * @return {ScoreStrategy[]}\n */\n ScoreStrategies.prototype.getScoreStrategies = function () {\n return this.scoreStrategies;\n };\n /**\n * Get score mode\n *\n * @return {string}\n */\n ScoreStrategies.prototype.getScoreMode = function () {\n return this.scoreMode;\n };\n /**\n * To array\n *\n * @return {{\n * score_mode: string,\n * score_strategies: any\n * }}\n */\n ScoreStrategies.prototype.toArray = function () {\n var scoreStrategiesAsArray = [];\n for (var i in this.scoreStrategies) {\n scoreStrategiesAsArray.push(this.scoreStrategies[i].toArray());\n }\n return {\n score_mode: this.scoreMode,\n score_strategies: scoreStrategiesAsArray\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {ScoreStrategies}\n */\n ScoreStrategies.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var scoreStrategies = (typeof array.score_mode != \"undefined\")\n ? ScoreStrategies.createEmpty(array.score_mode)\n : ScoreStrategies.createEmpty();\n scoreStrategies.scoreStrategies = [];\n for (var i in array.score_strategies) {\n scoreStrategies\n .scoreStrategies\n .push(ScoreStrategy_1.ScoreStrategy.createFromArray(array.score_strategies[i]));\n }\n return scoreStrategies;\n };\n return ScoreStrategies;\n}());\nexports.ScoreStrategies = ScoreStrategies;\n","\"use strict\";\nexports.__esModule = true;\nvar Item_1 = require(\"../Model/Item\");\nvar Filter_1 = require(\"./Filter\");\n/**\n * ScoreStrategy constants\n */\nexports.DEFAULT_TYPE = 'default';\nexports.DEFAULT_WEIGHT = 1.0;\nexports.BOOSTING_FIELD_VALUE = 'field_value';\nexports.CUSTOM_FUNCTION = 'custom_function';\nexports.DECAY = 'decay';\nexports.DECAY_LINEAR = 'linear';\nexports.DECAY_EXP = 'exp';\nexports.DECAY_GAUSS = 'gauss';\nexports.MODIFIER_NONE = 'none';\nexports.MODIFIER_SQRT = 'sqrt';\nexports.MODIFIER_LOG = 'log';\nexports.MODIFIER_LN = 'ln';\nexports.MODIFIER_SQUARE = 'square';\nexports.SCORE_MODE_NONE = 'none';\nexports.SCORE_MODE_SUM = 'sum';\nexports.SCORE_MODE_AVG = 'avg';\nexports.SCORE_MODE_MAX = 'max';\nexports.SCORE_MODE_MIN = 'min';\nexports.DEFAULT_MISSING = 1.0;\nexports.DEFAULT_FACTOR = 1.0;\n/**\n * ScoreStrategy\n */\nvar ScoreStrategy = /** @class */ (function () {\n function ScoreStrategy() {\n this.type = exports.DEFAULT_TYPE;\n this.filter = null;\n this.weight = exports.DEFAULT_WEIGHT;\n this.scoreMode = exports.SCORE_MODE_AVG;\n this.configuration = {};\n }\n /**\n * Get type\n *\n * @returns {string}\n */\n ScoreStrategy.prototype.getType = function () {\n return this.type;\n };\n /**\n * Get configuration value\n *\n * @returns {string}\n */\n ScoreStrategy.prototype.getConfigurationValue = function (element) {\n if (typeof this.configuration[element] == \"undefined\") {\n return null;\n }\n return this.configuration[element];\n };\n /**\n * Get weight.\n *\n * @return {number}\n */\n ScoreStrategy.prototype.getWeight = function () {\n return this.weight;\n };\n /**\n * Get score mode.\n *\n * @return {string}\n */\n ScoreStrategy.prototype.getScoreMode = function () {\n return this.scoreMode;\n };\n /**\n * Get filter.\n *\n * @return {Filter}\n */\n ScoreStrategy.prototype.getFilter = function () {\n return this.filter;\n };\n /**\n * Create default\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createDefault = function () {\n return new ScoreStrategy();\n };\n /**\n * Create field boosting\n *\n * @param field\n * @param factor\n * @param missing\n * @param modifier\n * @param weight\n * @param filter\n * @param scoreMode\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createFieldBoosting = function (field, factor, missing, modifier, weight, filter, scoreMode) {\n if (factor === void 0) { factor = exports.DEFAULT_FACTOR; }\n if (missing === void 0) { missing = exports.DEFAULT_MISSING; }\n if (modifier === void 0) { modifier = exports.MODIFIER_NONE; }\n if (weight === void 0) { weight = exports.DEFAULT_WEIGHT; }\n if (filter === void 0) { filter = null; }\n if (scoreMode === void 0) { scoreMode = exports.SCORE_MODE_AVG; }\n var scoreStrategy = ScoreStrategy.createDefault();\n scoreStrategy.type = exports.BOOSTING_FIELD_VALUE;\n scoreStrategy.configuration['field'] = field;\n scoreStrategy.configuration['factor'] = factor;\n scoreStrategy.configuration['missing'] = missing;\n scoreStrategy.configuration['modifier'] = modifier;\n scoreStrategy.weight = weight;\n scoreStrategy.filter = ScoreStrategy.fixFilterFieldPath(filter);\n scoreStrategy.scoreMode = scoreMode;\n return scoreStrategy;\n };\n /**\n * Create custom function\n *\n * @param func\n * @param weight\n * @param filter\n * @param scoreMode\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createCustomFunction = function (func, weight, filter, scoreMode) {\n if (weight === void 0) { weight = exports.DEFAULT_WEIGHT; }\n if (filter === void 0) { filter = null; }\n if (scoreMode === void 0) { scoreMode = exports.SCORE_MODE_AVG; }\n var scoreStrategy = ScoreStrategy.createDefault();\n scoreStrategy.type = exports.CUSTOM_FUNCTION;\n scoreStrategy.configuration['function'] = func;\n scoreStrategy.weight = weight;\n scoreStrategy.filter = ScoreStrategy.fixFilterFieldPath(filter);\n scoreStrategy.scoreMode = scoreMode;\n return scoreStrategy;\n };\n /**\n * Create decay function\n *\n * @param type\n * @param field\n * @param origin\n * @param scale\n * @param offset\n * @param decay\n * @param weight\n * @param filter\n * @param scoreMode\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createDecayFunction = function (type, field, origin, scale, offset, decay, weight, filter, scoreMode) {\n if (weight === void 0) { weight = exports.DEFAULT_WEIGHT; }\n if (filter === void 0) { filter = null; }\n if (scoreMode === void 0) { scoreMode = exports.SCORE_MODE_AVG; }\n var scoreStrategy = ScoreStrategy.createDefault();\n scoreStrategy.type = exports.DECAY;\n scoreStrategy.configuration['type'] = type;\n scoreStrategy.configuration['field'] = field;\n scoreStrategy.configuration['origin'] = origin;\n scoreStrategy.configuration['scale'] = scale;\n scoreStrategy.configuration['offset'] = offset;\n scoreStrategy.configuration['decay'] = decay;\n scoreStrategy.weight = weight;\n scoreStrategy.filter = ScoreStrategy.fixFilterFieldPath(filter);\n scoreStrategy.scoreMode = scoreMode;\n return scoreStrategy;\n };\n /**\n * Fix filter path.\n *\n * @param filter\n *\n * @return {Filter}\n */\n ScoreStrategy.fixFilterFieldPath = function (filter) {\n if (filter == null) {\n return filter;\n }\n var filterAsArray = filter.toArray();\n filterAsArray['field'] = Item_1.Item.getPathByField(filterAsArray['field']);\n return Filter_1.Filter.createFromArray(filterAsArray);\n };\n /**\n * To array\n *\n * @return {{\n * type: string,\n * configuration: any,\n * weight: number,\n * score_mode: string,\n * filter: any\n * }}\n */\n ScoreStrategy.prototype.toArray = function () {\n return {\n type: this.type,\n configuration: this.configuration,\n weight: this.weight,\n score_mode: this.scoreMode,\n filter: this.filter instanceof Filter_1.Filter\n ? this.filter.toArray()\n : null\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var scoreStrategy = ScoreStrategy.createDefault();\n if (typeof array.type != \"undefined\") {\n scoreStrategy.type = array.type;\n }\n if (typeof array.configuration != \"undefined\") {\n scoreStrategy.configuration = array.configuration;\n }\n if (typeof array.weight != \"undefined\") {\n scoreStrategy.weight = array.weight;\n }\n if (typeof array.score_mode != \"undefined\") {\n scoreStrategy.scoreMode = array.score_mode;\n }\n if (typeof array.filter === 'object' && array.filter !== null) {\n scoreStrategy.filter = Filter_1.Filter.createFromArray(array.filter);\n }\n return scoreStrategy;\n };\n return ScoreStrategy;\n}());\nexports.ScoreStrategy = ScoreStrategy;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ConnectionError_1 = require(\"../Error/ConnectionError\");\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar InvalidTokenError_1 = require(\"../Error/InvalidTokenError\");\nvar ResourceExistsError_1 = require(\"../Error/ResourceExistsError\");\nvar ResourceNotAvailableError_1 = require(\"../Error/ResourceNotAvailableError\");\nvar Item_1 = require(\"../Model/Item\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\nvar Result_1 = require(\"../Result/Result\");\nvar Repository_1 = require(\"./Repository\");\nvar Index_1 = require(\"../Model/Index\");\n/**\n * Aggregation class\n */\nvar HttpRepository = /** @class */ (function (_super) {\n tslib_1.__extends(HttpRepository, _super);\n /**\n * Constructor\n *\n * @param httpClient\n * @param appId\n * @param indexId\n * @param token\n * @param transformer\n */\n function HttpRepository(httpClient, appId, indexId, token, transformer) {\n var _this = _super.call(this, appId, indexId, token) || this;\n _this.httpClient = httpClient;\n _this.transformer = transformer;\n return _this;\n }\n /**\n * Get transformer\n *\n * @return {Transformer}\n */\n HttpRepository.prototype.getTransformer = function () {\n return this.transformer;\n };\n /**\n * Generate item document by a simple object.\n *\n * @param object\n */\n HttpRepository.prototype.addObject = function (object) {\n var item = this\n .transformer\n .toItem(object);\n if (item instanceof Item_1.Item) {\n this.addItem(item);\n }\n };\n /**\n * Delete item document by uuid.\n *\n * @param object\n */\n HttpRepository.prototype.deleteObject = function (object) {\n var itemUUID = this\n .transformer\n .toItemUUID(object);\n if (itemUUID instanceof ItemUUID_1.ItemUUID) {\n this.deleteItem(itemUUID);\n }\n };\n /**\n * Flush update items\n *\n * @param itemsToUpdate\n *\n * @return {Promise}\n */\n HttpRepository.prototype.flushUpdateItems = function (itemsToUpdate) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n if (itemsToUpdate.length === 0) {\n return [2 /*return*/];\n }\n return [2 /*return*/, this\n .httpClient\n .get(\"/items\", \"post\", this.getCredentialsWithIndex(this.indexId), {}, {\n items: itemsToUpdate.map(function (item) {\n return item.toArray();\n })\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n })];\n });\n });\n };\n /**\n * Flush delete items\n *\n * @param itemsToDelete\n *\n * @return {Promise}\n */\n HttpRepository.prototype.flushDeleteItems = function (itemsToDelete) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n if (itemsToDelete.length === 0) {\n return [2 /*return*/];\n }\n return [2 /*return*/, this\n .httpClient\n .get(\"/items\", \"delete\", this.getCredentialsWithIndex(this.indexId), {}, {\n items: itemsToDelete.map(function (itemUUID) {\n return itemUUID.toArray();\n })\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n })];\n });\n });\n };\n /**\n * Query\n *\n * @param query\n *\n * @return {Promise}\n */\n HttpRepository.prototype.query = function (query) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n var that;\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n that = this;\n return [4 /*yield*/, this\n .httpClient\n .get(\"/\", \"get\", this.getCredentialsWithIndex(this.indexId), {\n query: JSON.stringify(query.toArray())\n }, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n var result = Result_1.Result.createFromArray(response.getBody());\n return Result_1.Result.create(result.getQuery(), result.getTotalItems(), result.getTotalHits(), result.getAggregations(), result.getSuggests(), that\n .transformer\n .fromItems(result.getItems()));\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update items\n *\n * @param query\n * @param changes\n *\n * @return {Promise}\n */\n HttpRepository.prototype.updateItems = function (query, changes) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/items\", \"put\", this.getCredentialsWithIndex(this.indexId), {}, {\n query: query.toArray(),\n changes: changes.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create index\n *\n * @param indexUUID\n * @param config\n *\n * @return {Promise}\n */\n HttpRepository.prototype.createIndex = function (indexUUID, config) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"put\", this.getCredentials(), {}, {\n index: indexUUID.toArray(),\n config: config.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete index\n *\n * @param indexUUID\n *\n * @return {Promise}\n */\n HttpRepository.prototype.deleteIndex = function (indexUUID) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"delete\", this.getCredentialsWithIndex(this.indexId), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Reset index\n *\n * @param indexUUID\n *\n * @return {Promise}\n */\n HttpRepository.prototype.resetIndex = function (indexUUID) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index/reset\", \"post\", this.getCredentialsWithIndex(this.indexId), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Check index\n *\n * @param indexUUID\n *\n * @return {Promise}\n */\n HttpRepository.prototype.checkIndex = function (indexUUID) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"head\", this.getCredentialsWithIndex(this.indexId), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return response.getCode() === 200;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Check index\n *\n * @return {Promise}\n */\n HttpRepository.prototype.getIndices = function () {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/indices\", \"get\", this.getCredentials(), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n var result = [];\n for (var _i = 0, _a = response.getBody(); _i < _a.length; _i++) {\n var indexAsArray = _a[_i];\n result.push(Index_1.Index.createFromArray(indexAsArray));\n }\n return result;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Configure index\n *\n * @param indexUUID\n * @param config\n *\n * @return {Promise}\n */\n HttpRepository.prototype.configureIndex = function (indexUUID, config) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"post\", this.getCredentialsWithIndex(this.indexId), {}, {\n config: config.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get query values\n *\n * @returns any\n */\n HttpRepository.prototype.getCredentials = function () {\n return {\n app_id: this.appId,\n token: this.token\n };\n };\n /**\n * Get query values\n *\n * @param indexComposedUUID\n *\n * @returns any\n */\n HttpRepository.prototype.getCredentialsWithIndex = function (indexComposedUUID) {\n return {\n app_id: this.appId,\n index: indexComposedUUID,\n token: this.token\n };\n };\n /**\n * throw error if needed\n *\n * @param response\n */\n HttpRepository.throwTransportableExceptionIfNeeded = function (response) {\n if (typeof response.getCode() == \"undefined\") {\n return;\n }\n switch (response.getCode()) {\n case ResourceNotAvailableError_1.ResourceNotAvailableError.getTransportableHTTPError():\n throw new ResourceNotAvailableError_1.ResourceNotAvailableError(response.getBody().message);\n case InvalidTokenError_1.InvalidTokenError.getTransportableHTTPError():\n throw new InvalidTokenError_1.InvalidTokenError(response.getBody().message);\n case InvalidFormatError_1.InvalidFormatError.getTransportableHTTPError():\n throw new InvalidFormatError_1.InvalidFormatError(response.getBody().message);\n case ResourceExistsError_1.ResourceExistsError.getTransportableHTTPError():\n throw new ResourceExistsError_1.ResourceExistsError(response.getBody().message);\n case ConnectionError_1.ConnectionError.getTransportableHTTPError():\n throw new ConnectionError_1.ConnectionError(response.getBody().message);\n }\n };\n return HttpRepository;\n}(Repository_1.Repository));\nexports.HttpRepository = HttpRepository;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Connection error\n */\nvar ConnectionError = /** @class */ (function (_super) {\n tslib_1.__extends(ConnectionError, _super);\n function ConnectionError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ConnectionError.getTransportableHTTPError = function () {\n return 500;\n };\n return ConnectionError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ConnectionError = ConnectionError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Invalid token error\n */\nvar InvalidTokenError = /** @class */ (function (_super) {\n tslib_1.__extends(InvalidTokenError, _super);\n function InvalidTokenError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n InvalidTokenError.getTransportableHTTPError = function () {\n return 401;\n };\n /**\n * Invalid token permissions\n *\n * @param tokenReference\n *\n * @return {InvalidTokenError}\n */\n InvalidTokenError.createInvalidTokenPermissions = function (tokenReference) {\n return new InvalidTokenError(\"Token \" + tokenReference + \"not valid\");\n };\n /**\n * Invalid token permissions\n *\n * @param tokenReference\n * @param maxHitsPerQuery\n *\n * @return {InvalidTokenError}\n */\n InvalidTokenError.createInvalidTokenMaxHitsPerQuery = function (tokenReference, maxHitsPerQuery) {\n return new InvalidTokenError(\"Token \" + tokenReference + \"not valid. Max \" + maxHitsPerQuery + \" hits allowed\");\n };\n return InvalidTokenError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.InvalidTokenError = InvalidTokenError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Resource exists error\n */\nvar ResourceExistsError = /** @class */ (function (_super) {\n tslib_1.__extends(ResourceExistsError, _super);\n function ResourceExistsError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ResourceExistsError.getTransportableHTTPError = function () {\n return 409;\n };\n /**\n * Index not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.indexAvailable = function () {\n return new ResourceExistsError(\"Index exists and cannot be created again\");\n };\n /**\n * Events not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.eventsIndexAvailable = function () {\n return new ResourceExistsError(\"Events index exists and cannot be created again\");\n };\n /**\n * Logs not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.logsIndexAvailable = function () {\n return new ResourceExistsError(\"Logs index exists and cannot be created again\");\n };\n return ResourceExistsError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ResourceExistsError = ResourceExistsError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Resource not available error\n */\nvar ResourceNotAvailableError = /** @class */ (function (_super) {\n tslib_1.__extends(ResourceNotAvailableError, _super);\n function ResourceNotAvailableError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ResourceNotAvailableError.getTransportableHTTPError = function () {\n return 404;\n };\n /**\n * Index not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.indexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Index not available - \" + resourceId);\n };\n /**\n * Events not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.eventsIndexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Events not available - \" + resourceId);\n };\n /**\n * Logs not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.logsIndexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Logs not available - \" + resourceId);\n };\n /**\n * Engine not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.engineNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Engine not available - \" + resourceId);\n };\n return ResourceNotAvailableError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ResourceNotAvailableError = ResourceNotAvailableError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar Filter_1 = require(\"../Query/Filter\");\nvar Counter_1 = require(\"./Counter\");\n/**\n * ResultAggregation class\n */\nvar ResultAggregation = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param name\n * @param applicationType\n * @param totalElements\n * @param activeElements\n */\n function ResultAggregation(name, applicationType, totalElements, activeElements) {\n this.counters = {};\n this.highestActiveElement = 0;\n this.name = name;\n this.applicationType = applicationType;\n this.totalElements = totalElements;\n this.activeElements = {};\n for (var i in activeElements) {\n var activeElement = activeElements[i];\n this.activeElements[activeElement] = activeElement;\n }\n }\n /**\n * Add counter\n *\n * @param name\n * @param counter\n */\n ResultAggregation.prototype.addCounter = function (name, counter) {\n if (counter == 0) {\n return;\n }\n var counterInstance = Counter_1.Counter.createByActiveElements(name, counter, Object.keys(this.activeElements));\n if (!(counterInstance instanceof Counter_1.Counter)) {\n return;\n }\n if ((this.applicationType & Filter_1.FILTER_MUST_ALL_WITH_LEVELS) &&\n (this.applicationType & ~Filter_1.FILTER_MUST_ALL) &&\n counterInstance.isUsed()) {\n this.activeElements[counterInstance.getId()] = counterInstance;\n this.highestActiveElement = Math.max(counterInstance.getLevel(), this.highestActiveElement);\n return;\n }\n this.counters[counterInstance.getId()] = counterInstance;\n };\n /**\n * Get name\n *\n * @return {string}\n */\n ResultAggregation.prototype.getName = function () {\n return this.name;\n };\n /**\n * Get counter\n *\n * @return {any}\n */\n ResultAggregation.prototype.getCounters = function () {\n return this.counters;\n };\n /**\n * Return if the aggregation belongs to a filter.\n *\n * @return {boolean}\n */\n ResultAggregation.prototype.isFilter = function () {\n return (this.applicationType & Filter_1.FILTER_MUST_ALL) > 0;\n };\n /**\n * Aggregation has levels.\n *\n * @return {boolean}\n */\n ResultAggregation.prototype.hasLevels = function () {\n return (this.applicationType & Filter_1.FILTER_MUST_ALL_WITH_LEVELS) > 0;\n };\n /**\n * Get counter by name\n *\n * @param name\n *\n * @return {null}\n */\n ResultAggregation.prototype.getCounter = function (name) {\n return this.counters[name] instanceof Counter_1.Counter\n ? this.counters[name]\n : null;\n };\n /**\n * Get all elements\n *\n * @return {{}}\n */\n ResultAggregation.prototype.getAllElements = function () {\n return tslib_1.__assign({}, this.activeElements, this.counters);\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n ResultAggregation.prototype.getTotalElements = function () {\n return this.totalElements;\n };\n /**\n * Get active elements\n *\n * @return {any}\n */\n ResultAggregation.prototype.getActiveElements = function () {\n if (Object.keys(this.activeElements).length === 0) {\n return {};\n }\n if (this.applicationType === Filter_1.FILTER_MUST_ALL_WITH_LEVELS) {\n var value = null;\n for (var i in this.activeElements) {\n var activeElement = this.activeElements[i];\n if (!(activeElement instanceof Counter_1.Counter)) {\n continue;\n }\n if (value == null) {\n value = activeElement;\n }\n value = value.getLevel() > activeElement.getLevel()\n ? value\n : activeElement;\n }\n return value instanceof Counter_1.Counter\n ? { 0: value }\n : null;\n }\n return this.activeElements;\n };\n /**\n * Clean results by level and remove all levels higher than the lowest.\n */\n ResultAggregation.prototype.cleanCountersByLevel = function () {\n for (var i in this.counters) {\n var counter = this.counters[i];\n if (counter.getLevel() !== this.highestActiveElement + 1) {\n delete this.counters[i];\n }\n }\n };\n /**\n * Is empty\n *\n * @returns {boolean}\n */\n ResultAggregation.prototype.isEmpty = function () {\n return Object.keys(this.activeElements).length == 0 &&\n Object.keys(this.counters).length == 0;\n };\n /**\n * To array\n *\n * @return {any}\n */\n ResultAggregation.prototype.toArray = function () {\n var array = {\n name: this.name,\n counters: [],\n active_elements: []\n };\n for (var i in this.counters) {\n array.counters.push(this.counters[i].toArray());\n }\n if (this.applicationType !== Filter_1.FILTER_AT_LEAST_ONE) {\n array.application_type = this.applicationType;\n }\n if (this.totalElements > 0) {\n array.total_elements = this.totalElements;\n }\n for (var i in this.activeElements) {\n var activeElement = this.activeElements[i];\n array.active_elements.push(activeElement instanceof Counter_1.Counter\n ? activeElement.toArray()\n : activeElement);\n }\n if (this.highestActiveElement > 0) {\n array.highest_active_level = this.highestActiveElement;\n }\n if (array.counters.length === 0) {\n delete array.counters;\n }\n if (array.active_elements.length === 0) {\n delete array.active_elements;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n */\n ResultAggregation.createFromArray = function (array) {\n var activeElements = [];\n var activeElementsAsArray = array.active_elements;\n activeElementsAsArray = typeof activeElementsAsArray === typeof []\n ? activeElementsAsArray\n : [];\n for (var i in activeElementsAsArray) {\n var activeElementAsArray = activeElementsAsArray[i];\n activeElements.push(typeof activeElementAsArray === typeof {}\n ? Counter_1.Counter.createFromArray(activeElementAsArray)\n : activeElementAsArray);\n }\n var aggregation = new ResultAggregation(array.name, parseInt(array.application_type ? array.application_type : Filter_1.FILTER_AT_LEAST_ONE), parseInt(array.total_elements ? array.total_elements : 0), []);\n aggregation.activeElements = activeElements;\n var countersAsArray = typeof array.counters === typeof []\n ? array.counters\n : [];\n for (var i in countersAsArray) {\n var counterAsArray = countersAsArray[i];\n var counter = Counter_1.Counter.createFromArray(counterAsArray);\n aggregation.counters[counter.getId()] = counter;\n }\n aggregation.highestActiveElement = typeof array.highest_active_level === \"number\"\n ? array.highest_active_level\n : 0;\n return aggregation;\n };\n return ResultAggregation;\n}());\nexports.ResultAggregation = ResultAggregation;\n","\"use strict\";\nexports.__esModule = true;\nvar Metadata_1 = require(\"../Model/Metadata\");\n/**\n * Aggregation class\n */\nvar Counter = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param values\n * @param used\n * @param n\n */\n function Counter(values, used, n) {\n this.values = values;\n this.used = used;\n this.n = n;\n }\n /**\n * Get id\n *\n * @return {string|null}\n */\n Counter.prototype.getId = function () {\n return typeof this.values.id == \"string\"\n ? this.values.id\n : null;\n };\n /**\n * Get name\n *\n * @return {string|null}\n */\n Counter.prototype.getName = function () {\n return typeof this.values.name == \"string\"\n ? this.values.name\n : null;\n };\n /**\n * Get slug\n *\n * @return {string|null}\n */\n Counter.prototype.getSlug = function () {\n return typeof this.values.slug == \"string\"\n ? this.values.slug\n : null;\n };\n /**\n * Get level\n *\n * @return {number}\n */\n Counter.prototype.getLevel = function () {\n return typeof this.values.level == \"number\"\n ? this.values.level\n : 0;\n };\n /**\n * Get values\n *\n * @returns {{}}\n */\n Counter.prototype.getValues = function () {\n return this.values;\n };\n /**\n * Is used\n *\n * @returns {boolean}\n */\n Counter.prototype.isUsed = function () {\n return this.used;\n };\n /**\n * Get N\n *\n * @returns {number}\n */\n Counter.prototype.getN = function () {\n return this.n;\n };\n /**\n * Create by active elements\n *\n * @param name\n * @param n\n * @param activeElements\n */\n Counter.createByActiveElements = function (name, n, activeElements) {\n var values = Metadata_1.Metadata.fromMetadata(name);\n if (values == null) {\n return null;\n }\n var i = activeElements.length;\n var inActiveElements = false;\n while (i--) {\n if (activeElements[i] == values.id) {\n inActiveElements = true;\n }\n }\n return new Counter(values, inActiveElements, n);\n };\n /**\n * To array\n *\n * @return {{}}\n */\n Counter.prototype.toArray = function () {\n var values = {\n values: this.values,\n n: this.n\n };\n if (this.used === true) {\n values.used = true;\n }\n return values;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Counter}\n */\n Counter.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new Counter(array.values, (typeof array.used == \"boolean\")\n ? array.used\n : false, array.n);\n };\n return Counter;\n}());\nexports.Counter = Counter;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * User class\n */\nvar Metadata = /** @class */ (function () {\n function Metadata() {\n }\n /**\n * To metadata\n *\n * @param array:{}\n *\n * @returns {string}\n */\n Metadata.toMetadata = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var parts = [];\n for (var key in array) {\n parts.push(key + \"##\" + array[key]);\n }\n return parts.join(\"~~\");\n };\n /**\n * From metadata\n *\n * @param metadata\n *\n * @return {{}}\n */\n Metadata.fromMetadata = function (metadata) {\n var values = {};\n var splittedParts = metadata.split(\"~~\");\n var iterator = 0;\n var size = 0;\n var lastElement = null;\n for (var key in splittedParts) {\n var part = splittedParts[key];\n var parts = part.split(\"##\");\n if (parts.length > 1) {\n lastElement = parts[1];\n values[parts[0]] = lastElement;\n }\n else {\n lastElement = part;\n values[iterator++] = lastElement;\n }\n size++;\n }\n if (size == 1) {\n values = {\n id: lastElement,\n name: lastElement\n };\n }\n if (typeof values.id == \"undefined\") {\n return null;\n }\n return values;\n };\n return Metadata;\n}());\nexports.Metadata = Metadata;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\n/**\n * Aggregation class\n */\nvar Repository = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param appId\n * @param indexId\n * @param token\n */\n function Repository(appId, indexId, token) {\n this.itemsToUpdate = [];\n this.itemsToDelete = [];\n this.appId = appId;\n this.indexId = indexId;\n this.token = token;\n }\n /**\n * Reset cached elements\n */\n Repository.prototype.resetCachedElements = function () {\n this.itemsToUpdate = [];\n this.itemsToDelete = [];\n };\n /**\n * Add element\n *\n * @param item\n */\n Repository.prototype.addItem = function (item) {\n this.itemsToUpdate.push(item);\n };\n /**\n * Add elements\n *\n * @param items\n */\n Repository.prototype.addItems = function (items) {\n for (var i in items) {\n this.addItem(items[i]);\n }\n };\n /**\n * Delete item\n *\n * @param itemUUID\n */\n Repository.prototype.deleteItem = function (itemUUID) {\n this.itemsToDelete.push(itemUUID);\n };\n /**\n * Delete items\n *\n * @param itemsUUID\n */\n Repository.prototype.deleteItems = function (itemsUUID) {\n for (var i in itemsUUID) {\n this.deleteItem(itemsUUID[i]);\n }\n };\n /**\n * flush\n *\n * @param bulkNumber\n * @param skipIfLess\n *\n * @return {Promise}\n */\n Repository.prototype.flush = function (bulkNumber, skipIfLess) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n var _this = this;\n return tslib_1.__generator(this, function (_a) {\n if (!bulkNumber) {\n bulkNumber = 500;\n }\n if (!skipIfLess) {\n skipIfLess = false;\n }\n if (skipIfLess &&\n this.itemsToUpdate.length < bulkNumber) {\n return [2 /*return*/];\n }\n return [2 /*return*/, Promise.all(Repository\n .chunkArray(this.itemsToUpdate, bulkNumber)\n .map(function (arrayOfItems) {\n return _this.flushUpdateItems(arrayOfItems);\n })\n .concat(Repository\n .chunkArray(this.itemsToDelete, bulkNumber)\n .map(function (arrayOfItemsUUID) {\n return _this.flushDeleteItems(arrayOfItemsUUID);\n }))).then(function (_) {\n _this.resetCachedElements();\n })[\"catch\"](function (_) {\n _this.resetCachedElements();\n })];\n });\n });\n };\n /**\n * Make chunks of n elements\n *\n * @param array\n * @param chunk\n *\n * @return any[]\n */\n Repository.chunkArray = function (array, chunk) {\n var arrayChunked = [];\n for (var i = 0, j = array.length; i < j; i += chunk) {\n arrayChunked.push(array.slice(i, i + chunk));\n }\n return arrayChunked;\n };\n return Repository;\n}());\nexports.Repository = Repository;\n","\"use strict\";\nexports.__esModule = true;\nvar Item_1 = require(\"../Model/Item\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\n/**\n * Transformer\n */\nvar Transformer = /** @class */ (function () {\n function Transformer() {\n this.readTransformers = [];\n this.writeTransformers = [];\n }\n /**\n * Add read transformer\n *\n * @param readTransformer\n */\n Transformer.prototype.addReadTransformer = function (readTransformer) {\n this\n .readTransformers\n .push(readTransformer);\n };\n /**\n * Add write transformer\n *\n * @param writeTransformer\n */\n Transformer.prototype.addWriteTransformer = function (writeTransformer) {\n this\n .writeTransformers\n .push(writeTransformer);\n };\n /**\n * Items to objects\n *\n * @param items\n *\n * @returns {any[]}\n */\n Transformer.prototype.fromItems = function (items) {\n var objects = [];\n for (var i in items) {\n objects.push(this.fromItem(items[i]));\n }\n return objects;\n };\n /**\n * Item to object\n *\n * @param item\n *\n * @returns {any}\n */\n Transformer.prototype.fromItem = function (item) {\n for (var i in this.readTransformers) {\n var transformer = this.readTransformers[i];\n if (transformer.isValidItem(item)) {\n return transformer.fromItem(item);\n }\n }\n return item;\n };\n /**\n * Objects to items\n *\n * @param objects\n *\n * @returns {Item[]}\n */\n Transformer.prototype.toItems = function (objects) {\n var items = [];\n for (var i in objects) {\n var item = this.toItem(objects[i]);\n if (item instanceof Item_1.Item) {\n items.push(item);\n }\n }\n return items;\n };\n /**\n * Object to item\n *\n * @param object\n *\n * @returns {any}\n */\n Transformer.prototype.toItem = function (object) {\n for (var i in this.writeTransformers) {\n var transformer = this.writeTransformers[i];\n if (transformer.isValidObject(object)) {\n return transformer.toItem(object);\n }\n }\n return object;\n };\n /**\n * Objects to items\n *\n * @param objects\n *\n * @returns {ItemUUID[]}\n */\n Transformer.prototype.toItemUUIDs = function (objects) {\n var itemUUIDs = [];\n for (var i in objects) {\n var itemUUID = this.toItemUUID(objects[i]);\n if (itemUUID instanceof ItemUUID_1.ItemUUID) {\n itemUUIDs.push(itemUUID);\n }\n }\n return itemUUIDs;\n };\n /**\n * Object to item\n *\n * @param object\n *\n * @returns {any}\n */\n Transformer.prototype.toItemUUID = function (object) {\n for (var i in this.writeTransformers) {\n var transformer = this.writeTransformers[i];\n if (transformer.isValidObject(object)) {\n return transformer.toItemUUID(object);\n }\n }\n return object;\n };\n return Transformer;\n}());\nexports.Transformer = Transformer;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Result class\n */\nvar Synonym = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param words\n */\n function Synonym(words) {\n this.words = words;\n }\n /**\n * get words\n *\n * @return {string[]}\n */\n Synonym.prototype.getWords = function () {\n return this.words;\n };\n /**\n * Create by words\n *\n * @param words\n *\n * @return {Synonym}\n */\n Synonym.createbyWords = function (words) {\n return new Synonym(words);\n };\n /**\n * To array\n *\n * @return {{words: string[]}}\n */\n Synonym.prototype.toArray = function () {\n return {\n words: this.words\n };\n };\n /**\n * create from array\n *\n * @param array\n *\n * @returns {Synonym}\n */\n Synonym.createFromArray = function (array) {\n return new Synonym(array.words instanceof Object\n ? array.words\n : []);\n };\n /**\n * Expand\n *\n * @returns {string}\n */\n Synonym.prototype.expand = function () {\n return this.words.join(\",\");\n };\n return Synonym;\n}());\nexports.Synonym = Synonym;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar Apisearch_1 = require(\"./Apisearch\");\nexports[\"default\"] = Apisearch_1[\"default\"];\ntslib_1.__exportStar(require(\"./Cache/InMemoryCache\"), exports);\ntslib_1.__exportStar(require(\"./Config/Config\"), exports);\ntslib_1.__exportStar(require(\"./Config/Synonym\"), exports);\ntslib_1.__exportStar(require(\"./Error/ConnectionError\"), exports);\ntslib_1.__exportStar(require(\"./Error/ErrorWithMessage\"), exports);\ntslib_1.__exportStar(require(\"./Error/EventError\"), exports);\ntslib_1.__exportStar(require(\"./Error/ForbiddenError\"), exports);\ntslib_1.__exportStar(require(\"./Error/InvalidFormatError\"), exports);\ntslib_1.__exportStar(require(\"./Error/InvalidTokenError\"), exports);\ntslib_1.__exportStar(require(\"./Error/ResourceExistsError\"), exports);\ntslib_1.__exportStar(require(\"./Error/ResourceNotAvailableError\"), exports);\ntslib_1.__exportStar(require(\"./Error/UnsupportedContentTypeError\"), exports);\ntslib_1.__exportStar(require(\"./Geo/LocationRange\"), exports);\ntslib_1.__exportStar(require(\"./Http/AxiosClient\"), exports);\ntslib_1.__exportStar(require(\"./Http/Client\"), exports);\ntslib_1.__exportStar(require(\"./Http/HttpClient\"), exports);\ntslib_1.__exportStar(require(\"./Http/Response\"), exports);\ntslib_1.__exportStar(require(\"./Http/Retry\"), exports);\ntslib_1.__exportStar(require(\"./Http/RetryMap\"), exports);\ntslib_1.__exportStar(require(\"./Model/Changes\"), exports);\ntslib_1.__exportStar(require(\"./Model/Coordinate\"), exports);\ntslib_1.__exportStar(require(\"./Model/Item\"), exports);\ntslib_1.__exportStar(require(\"./Model/ItemUUID\"), exports);\ntslib_1.__exportStar(require(\"./Model/Metadata\"), exports);\ntslib_1.__exportStar(require(\"./Model/User\"), exports);\ntslib_1.__exportStar(require(\"./Query/Aggregation\"), exports);\ntslib_1.__exportStar(require(\"./Query/Filter\"), exports);\ntslib_1.__exportStar(require(\"./Query/Query\"), exports);\ntslib_1.__exportStar(require(\"./Query/Range\"), exports);\ntslib_1.__exportStar(require(\"./Query/ScoreStrategies\"), exports);\ntslib_1.__exportStar(require(\"./Query/ScoreStrategy\"), exports);\ntslib_1.__exportStar(require(\"./Query/SortBy\"), exports);\ntslib_1.__exportStar(require(\"./Repository/HttpRepository\"), exports);\ntslib_1.__exportStar(require(\"./Repository/Repository\"), exports);\ntslib_1.__exportStar(require(\"./Result/ResultAggregation\"), exports);\ntslib_1.__exportStar(require(\"./Result/ResultAggregations\"), exports);\ntslib_1.__exportStar(require(\"./Result/Counter\"), exports);\ntslib_1.__exportStar(require(\"./Result/Result\"), exports);\ntslib_1.__exportStar(require(\"./Transformer/Transformer\"), exports);\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar NoCache_1 = require(\"./Cache/NoCache\");\nvar AxiosClient_1 = require(\"./Http/AxiosClient\");\nvar RetryMap_1 = require(\"./Http/RetryMap\");\nvar Query_1 = require(\"./Query/Query\");\nvar Query_2 = require(\"./Query/Query\");\nvar Query_3 = require(\"./Query/Query\");\nvar SortBy_1 = require(\"./Query/SortBy\");\nvar HttpRepository_1 = require(\"./Repository/HttpRepository\");\nvar Result_1 = require(\"./Result/Result\");\nvar ResultAggregations_1 = require(\"./Result/ResultAggregations\");\nvar Transformer_1 = require(\"./Transformer/Transformer\");\n/**\n * Apisearch class\n */\nvar Apisearch = /** @class */ (function () {\n function Apisearch() {\n }\n /**\n * Constructor\n *\n * @param config\n *\n * @return {HttpRepository}\n */\n Apisearch.createRepository = function (config) {\n Apisearch.ensureRepositoryConfigIsValid(config);\n config.options = tslib_1.__assign({ api_version: \"v1\", cache: new NoCache_1.NoCache(), timeout: 5000, override_queries: true }, config.options);\n /**\n * Client\n */\n var httpClient = typeof config.options.http_client !== \"undefined\"\n ? config.options.http_client\n : new AxiosClient_1.AxiosClient(config.options.endpoint, config.options.api_version, config.options.timeout, new RetryMap_1.RetryMap(), config.options.override_queries, config.options.cache);\n return new HttpRepository_1.HttpRepository(httpClient, config.app_id, config.index_id, config.token, new Transformer_1.Transformer());\n };\n /**\n * Ensure the Repository configuration is valid\n *\n * @param config\n */\n Apisearch.ensureRepositoryConfigIsValid = function (config) {\n Apisearch.ensureIsDefined(config.app_id, \"app_id\");\n Apisearch.ensureIsDefined(config.index_id, \"index_id\");\n Apisearch.ensureIsDefined(config.token, \"token\");\n Apisearch.ensureIsDefined(config.options.endpoint, \"options.endpoint\");\n };\n /**\n * Ensure the value is not undefined\n *\n * @param param\n * @param name\n */\n Apisearch.ensureIsDefined = function (param, name) {\n if (typeof param === \"undefined\") {\n throw new TypeError(name + \" parameter must be defined.\");\n }\n };\n /**\n * Created located\n *\n * @param coordinate\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Apisearch.createQueryLocated = function (coordinate, queryText, page, size) {\n if (page === void 0) { page = Query_1.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = Query_2.QUERY_DEFAULT_SIZE; }\n return Query_3.Query.createLocated(coordinate, queryText, page, size);\n };\n /**\n * Create\n *\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Apisearch.createQuery = function (queryText, page, size) {\n if (page === void 0) { page = Query_1.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = Query_2.QUERY_DEFAULT_SIZE; }\n return Query_3.Query.create(queryText, page, size);\n };\n /**\n * Create match all\n *\n * @return {Query}\n */\n Apisearch.createQueryMatchAll = function () {\n return Query_3.Query.createMatchAll();\n };\n /**\n * Create by UUID\n *\n * @param uuid\n *\n * @return {Query}\n */\n Apisearch.createQueryByUUID = function (uuid) {\n return Query_3.Query.createByUUID(uuid);\n };\n /**\n * Create by UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Apisearch.createQueryByUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n return Query_3.Query.createByUUIDs.apply(Query_3.Query, uuids);\n };\n /**\n * Create empty result\n *\n * @return {Result}\n */\n Apisearch.createEmptyResult = function () {\n return Result_1.Result.create(Apisearch.createQueryMatchAll(), 0, 0, new ResultAggregations_1.ResultAggregations(0), [], []);\n };\n /**\n * Create empty sortby\n *\n * @return {SortBy}\n */\n Apisearch.createEmptySortBy = function () {\n return SortBy_1.SortBy.create();\n };\n return Apisearch;\n}());\nexports[\"default\"] = Apisearch;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Cache class\n */\nvar NoCache = /** @class */ (function () {\n function NoCache() {\n }\n /**\n * Set cache element\n *\n * @param key\n * @param value\n *\n * @returns {void}\n */\n NoCache.prototype.set = function (key, value) {\n // Empty\n };\n /**\n * Get element from cache\n *\n * @param key\n *\n * @returns {any}\n */\n NoCache.prototype.get = function (key) {\n return undefined;\n };\n /**\n * Deletes element from cache\n *\n * @param key\n */\n NoCache.prototype.del = function (key) {\n // Empty\n };\n /**\n * Clear cache\n */\n NoCache.prototype.clear = function () {\n // Empty\n };\n return NoCache;\n}());\nexports.NoCache = NoCache;\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(utils.merge(defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","'use strict';\n\nvar defaults = require('./../defaults');\nvar utils = require('./../utils');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = utils.merge({\n url: arguments[0]\n }, arguments[1]);\n }\n\n config = utils.merge(defaults, {method: 'get'}, this.defaults, config);\n config.method = config.method.toLowerCase();\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n // Note: status is not exposed by XDomainRequest\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n error.request = request;\n error.response = response;\n return error;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\n// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js\n\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\nfunction E() {\n this.message = 'String contains an invalid character';\n}\nE.prototype = new Error;\nE.prototype.code = 5;\nE.prototype.name = 'InvalidCharacterError';\n\nfunction btoa(input) {\n var str = String(input);\n var output = '';\n for (\n // initialize result and counter\n var block, charCode, idx = 0, map = chars;\n // if the next str index does not exist:\n // change the mapping table to \"=\"\n // check if d has no fractional digits\n str.charAt(idx | 0) || (map = '=', idx % 1);\n // \"8 - idx % 1 * 8\" generates the sequence 2, 4, 6, 8\n output += map.charAt(63 & block >> 8 - idx % 1 * 8)\n ) {\n charCode = str.charCodeAt(idx += 3 / 4);\n if (charCode > 0xFF) {\n throw new E();\n }\n block = block << 8 | charCode;\n }\n return output;\n}\n\nmodule.exports = btoa;\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar isAbsoluteURL = require('./../helpers/isAbsoluteURL');\nvar combineURLs = require('./../helpers/combineURLs');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Support baseURL config\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers || {}\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar IndexUUID_1 = require(\"./IndexUUID\");\nvar AppUUID_1 = require(\"./AppUUID\");\n/**\n * Index class\n */\nvar Index = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param uuid\n * @param appUUID\n * @param isOK\n * @param docCount\n * @param size\n */\n function Index(uuid, appUUID, isOK, docCount, size) {\n if (isOK === void 0) { isOK = false; }\n if (docCount === void 0) { docCount = 0; }\n if (size === void 0) { size = '0kb'; }\n this.uuid = uuid;\n this.appUUID = appUUID;\n this.isOK = isOK;\n this.docCount = docCount;\n this.size = size;\n }\n /**\n * Get uuid\n *\n * @return {IndexUUID}\n */\n Index.prototype.getUUID = function () {\n return this.uuid;\n };\n /**\n * Get app id\n *\n * @return {AppUUID}\n */\n Index.prototype.getAppUUID = function () {\n return this.appUUID;\n };\n /**\n * Index is OK\n *\n * @return {boolean}\n */\n Index.prototype.isOk = function () {\n return this.isOK;\n };\n /**\n * Get doc count\n *\n * @return {number}\n */\n Index.prototype.getDocCount = function () {\n return this.docCount;\n };\n /**\n * get size\n *\n * @return {string}\n */\n Index.prototype.getSize = function () {\n return this.size;\n };\n /**\n * To array\n *\n * @returns {{id: string, attributes: {}}}\n */\n Index.prototype.toArray = function () {\n return {\n uuid: this.uuid.toArray(),\n app_id: this.appUUID.toArray(),\n is_ok: this.isOK,\n doc_count: this.docCount,\n size: this.size\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return User\n */\n Index.createFromArray = function (array) {\n if (typeof array.uuid == \"undefined\" ||\n typeof array.app_id == \"undefined\") {\n throw InvalidFormatError_1.InvalidFormatError.indexFormatNotValid();\n }\n return new Index(IndexUUID_1.IndexUUID.createFromArray(array.uuid), AppUUID_1.AppUUID.createFromArray(array.app_id), (typeof array.is_ok == \"undefined\" ? false : array.is_ok), (typeof array.doc_count == \"undefined\" ? 0 : array.doc_count), (typeof array.size == \"undefined\" ? '0kb' : array.size));\n };\n return Index;\n}());\nexports.Index = Index;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * IndexUUID class\n */\nvar IndexUUID = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param id\n */\n function IndexUUID(id) {\n if (id.indexOf('_') >= 0) {\n throw InvalidFormatError_1.InvalidFormatError.indexUUIDFormatNotValid();\n }\n this.id = id;\n }\n /**\n * Create by id\n *\n * @param id\n *\n * @returns {ItemUUID}\n */\n IndexUUID.createById = function (id) {\n return new IndexUUID(id);\n };\n /**\n * Return id\n *\n * @returns {string}\n */\n IndexUUID.prototype.getId = function () {\n return this.id;\n };\n /**\n * To array\n *\n * @returns {{id: *, type: *}}\n */\n IndexUUID.prototype.toArray = function () {\n return {\n id: this.id\n };\n };\n /**\n * Create from array\n *\n * @param array {{id:string, type:string}}\n *\n * @return {ItemUUID}\n */\n IndexUUID.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new IndexUUID(array.id);\n };\n /**\n * Compose unique id\n *\n * @returns {string}\n */\n IndexUUID.prototype.composedUUID = function () {\n return this.id;\n };\n return IndexUUID;\n}());\nexports.IndexUUID = IndexUUID;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * AppUUID class\n */\nvar AppUUID = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param id\n */\n function AppUUID(id) {\n if (id.indexOf('_') >= 0) {\n throw InvalidFormatError_1.InvalidFormatError.appUUIDFormatNotValid();\n }\n this.id = id;\n }\n /**\n * Create by id\n *\n * @param id\n *\n * @returns {ItemUUID}\n */\n AppUUID.createById = function (id) {\n return new AppUUID(id);\n };\n /**\n * Return id\n *\n * @returns {string}\n */\n AppUUID.prototype.getId = function () {\n return this.id;\n };\n /**\n * To array\n *\n * @returns {{id: *, type: *}}\n */\n AppUUID.prototype.toArray = function () {\n return {\n id: this.id\n };\n };\n /**\n * Create from array\n *\n * @param array {{id:string, type:string}}\n *\n * @return {ItemUUID}\n */\n AppUUID.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new AppUUID(array.id);\n };\n /**\n * Compose unique id\n *\n * @returns {string}\n */\n AppUUID.prototype.composedUUID = function () {\n return this.id;\n };\n return AppUUID;\n}());\nexports.AppUUID = AppUUID;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\n/**\n * Cache class\n */\nvar InMemoryCache = /** @class */ (function () {\n /**\n * Constructor\n */\n function InMemoryCache() {\n this.cache = {};\n this.size = 0;\n this.cache = {};\n this.size = 0;\n }\n /**\n * Set cache element\n *\n * @param key\n * @param value\n *\n * @returns {void}\n */\n InMemoryCache.prototype.set = function (key, value) {\n var _a;\n this.cache = tslib_1.__assign({}, this.cache, (_a = {}, _a[key] = value, _a));\n this.size = this.size + 1;\n };\n /**\n * Get element from cache\n *\n * @param key\n *\n * @returns {any}\n */\n InMemoryCache.prototype.get = function (key) {\n return this.cache[key];\n };\n /**\n * Deletes element from cache\n *\n * @param key\n */\n InMemoryCache.prototype.del = function (key) {\n delete this.cache[key];\n };\n /**\n * Clear cache\n */\n InMemoryCache.prototype.clear = function () {\n this.cache = {};\n this.size = 0;\n };\n return InMemoryCache;\n}());\nexports.InMemoryCache = InMemoryCache;\n","\"use strict\";\nexports.__esModule = true;\nvar Synonym_1 = require(\"./Synonym\");\n/**\n * Result class\n */\nvar Config = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param language\n * @param storeSearchableMetadata\n */\n function Config(language, storeSearchableMetadata) {\n if (language === void 0) { language = null; }\n if (storeSearchableMetadata === void 0) { storeSearchableMetadata = true; }\n this.synonyms = [];\n this.language = language;\n this.storeSearchableMetadata = storeSearchableMetadata;\n }\n /**\n * Get language\n *\n * @return {string}\n */\n Config.prototype.getLanguage = function () {\n return this.language;\n };\n /**\n * Should searchable metadata be stored\n *\n * @return {boolean}\n */\n Config.prototype.shouldSearchableMetadataBeStored = function () {\n return this.storeSearchableMetadata;\n };\n /**\n * Add synonym\n *\n * @param synonym\n */\n Config.prototype.addSynonym = function (synonym) {\n this.synonyms.push(synonym);\n };\n /**\n * Get synonyms\n *\n * @return {Synonym[]}\n */\n Config.prototype.getSynonyms = function () {\n return this.synonyms;\n };\n /**\n * to array\n */\n Config.prototype.toArray = function () {\n return {\n language: this.language,\n store_searchable_metadata: this.storeSearchableMetadata,\n synonyms: this.synonyms.map(function (synonym) { return synonym.toArray(); })\n };\n };\n /**\n * Create from array\n */\n Config.createFromArray = function (array) {\n var immutableConfig = new Config(array.language ? array.language : null, typeof array.store_searchable_metadata == \"boolean\"\n ? array.store_searchable_metadata\n : true);\n if (array.synonyms instanceof Array &&\n array.synonyms.length > 0) {\n immutableConfig.synonyms = array.synonyms.map(function (synonym) { return Synonym_1.Synonym.createFromArray(synonym); });\n }\n return immutableConfig;\n };\n return Config;\n}());\nexports.Config = Config;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * EventError\n */\nvar EventError = /** @class */ (function (_super) {\n tslib_1.__extends(EventError, _super);\n function EventError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n EventError.throwEndpointNotAvailable = function () {\n return new EventError(\"Endpoint not available\");\n };\n return EventError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.EventError = EventError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Forbidden Error\n */\nvar ForbiddenError = /** @class */ (function (_super) {\n tslib_1.__extends(ForbiddenError, _super);\n function ForbiddenError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ForbiddenError.getTransportableHTTPError = function () {\n return 403;\n };\n /**\n * App id is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createAppIdIsRequiredException = function () {\n return new ForbiddenError(\"AppId query parameter MUST be defined with a valid value\");\n };\n /**\n * Index id is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createIndexIsRequiredException = function () {\n return new ForbiddenError(\"Index query parameter MUST be defined with a valid value\");\n };\n /**\n * Token is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createTokenIsRequiredException = function () {\n return new ForbiddenError(\"Token query parameter MUST be defined with a valid value\");\n };\n return ForbiddenError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ForbiddenError = ForbiddenError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Unsupported content type error\n */\nvar UnsupportedContentTypeError = /** @class */ (function (_super) {\n tslib_1.__extends(UnsupportedContentTypeError, _super);\n function UnsupportedContentTypeError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n UnsupportedContentTypeError.getTransportableHTTPError = function () {\n return 415;\n };\n /**\n * Unsupported content type\n *\n * @return {InvalidFormatError}\n */\n UnsupportedContentTypeError.createUnsupportedContentTypeException = function () {\n return new UnsupportedContentTypeError(\"This content type is not accepted. Please use application/json\");\n };\n return UnsupportedContentTypeError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.UnsupportedContentTypeError = UnsupportedContentTypeError;\n","\"use strict\";\nexports.__esModule = true;\nvar tslib_1 = require(\"tslib\");\nvar Coordinate_1 = require(\"../Model/Coordinate\");\n/**\n * Abstract Location Range class\n */\nvar LocationRange = /** @class */ (function () {\n function LocationRange() {\n }\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n LocationRange.fromFilterObject = function (object) {\n throw TypeError(\"Method not valid\");\n };\n /**\n * to array\n */\n LocationRange.prototype.toArray = function () {\n return {\n type: this.getName(),\n data: this.toFilterObject()\n };\n };\n /**\n * Create from array\n *\n * @param array\n */\n LocationRange.createFromArray = function (array) {\n if (array.type == \"CoordinateAndDistance\") {\n return CoordinateAndDistance.fromFilterObject(array.data);\n }\n if (array.type == \"Polygon\") {\n return Polygon.fromFilterObject(array.data);\n }\n if (array.type == \"Square\") {\n return Square.fromFilterObject(array.data);\n }\n };\n return LocationRange;\n}());\nexports.LocationRange = LocationRange;\n/**\n * CoordinateAndDistance\n */\nvar CoordinateAndDistance = /** @class */ (function (_super) {\n tslib_1.__extends(CoordinateAndDistance, _super);\n /**\n * Constructor\n *\n * @param coordinate\n * @param distance\n */\n function CoordinateAndDistance(coordinate, distance) {\n var _this = _super.call(this) || this;\n _this.coordinate = coordinate;\n _this.distance = distance;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{}}}\n */\n CoordinateAndDistance.prototype.toFilterObject = function () {\n return {\n coordinate: this.coordinate.toArray(),\n distance: this.distance\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n CoordinateAndDistance.prototype.getName = function () {\n return \"CoordinateAndDistance\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n CoordinateAndDistance.fromFilterObject = function (object) {\n return new CoordinateAndDistance(Coordinate_1.Coordinate.createFromArray(object.coordinate), object.distance);\n };\n return CoordinateAndDistance;\n}(LocationRange));\nexports.CoordinateAndDistance = CoordinateAndDistance;\n/**\n * Polygon\n */\nvar Polygon = /** @class */ (function (_super) {\n tslib_1.__extends(Polygon, _super);\n /**\n * Constructor\n *\n * @param coordinates\n */\n function Polygon(coordinates) {\n var _this = _super.call(this) || this;\n if (coordinates.length < 3) {\n throw new Error(\"A polygon needs more than two coordinates.\");\n }\n _this.coordinates = coordinates;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{coordinates: {lat:number, lon:number}[]}}\n */\n Polygon.prototype.toFilterObject = function () {\n var coordinates = [];\n for (var i in this.coordinates) {\n coordinates.push(this.coordinates[i].toArray());\n }\n return {\n coordinates: coordinates\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n Polygon.prototype.getName = function () {\n return \"Polygon\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {Polygon}\n */\n Polygon.fromFilterObject = function (object) {\n var coordinates = [];\n for (var i in object.coordinates) {\n coordinates.push(Coordinate_1.Coordinate.createFromArray(object.coordinates[i]));\n }\n return new Polygon(coordinates);\n };\n return Polygon;\n}(LocationRange));\nexports.Polygon = Polygon;\n/**\n * Square\n */\nvar Square = /** @class */ (function (_super) {\n tslib_1.__extends(Square, _super);\n /**\n * Constructor\n *\n * @param topLeftCoordinate\n * @param bottomRightCoordinate\n */\n function Square(topLeftCoordinate, bottomRightCoordinate) {\n var _this = _super.call(this) || this;\n _this.topLeftCoordinate = topLeftCoordinate;\n _this.bottomRightCoordinate = bottomRightCoordinate;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{}}}\n */\n Square.prototype.toFilterObject = function () {\n return {\n top_left: this.topLeftCoordinate.toArray(),\n bottom_right: this.bottomRightCoordinate.toArray()\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n Square.prototype.getName = function () {\n return \"Square\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n Square.fromFilterObject = function (object) {\n return new Square(Coordinate_1.Coordinate.createFromArray(object.top_left), Coordinate_1.Coordinate.createFromArray(object.bottom_right));\n };\n return Square;\n}(LocationRange));\nexports.Square = Square;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Http class\n */\nvar HttpClient = /** @class */ (function () {\n function HttpClient() {\n }\n return HttpClient;\n}());\nexports.HttpClient = HttpClient;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * filter constants\n */\nexports.TYPE_VALUE = 1;\nexports.TYPE_LITERAL = 4;\nexports.TYPE_ARRAY_ELEMENT_UPDATE = 8;\nexports.TYPE_ARRAY_ELEMENT_ADD = 16;\nexports.TYPE_ARRAY_ELEMENT_DELETE = 32;\nexports.TYPE_ARRAY_EXPECTS_ELEMENT = 24;\nexports.TYPE_ARRAY = 56;\n/**\n * Changes Type cast\n * @param Changes\n */\nvar Changes = /** @class */ (function () {\n function Changes() {\n /**\n * Changes\n *\n * @type {Array}\n */\n this.changes = [];\n }\n /**\n * Add new change\n *\n * @param field\n * @param value\n * @param type\n */\n Changes.prototype.addChange = function (field, value, type) {\n if (type === void 0) { type = exports.TYPE_VALUE; }\n this.changes.push({\n field: field,\n type: type,\n value: value\n });\n };\n /**\n * Update element from list\n *\n * @param field\n * @param condition\n * @param value\n * @param type\n */\n Changes.prototype.updateElementFromList = function (field, condition, value, type) {\n this.changes.push({\n field: field,\n type: type | exports.TYPE_ARRAY_ELEMENT_UPDATE,\n condition: condition,\n value: value\n });\n };\n /**\n * Add element in list\n *\n * @param field\n * @param value\n * @param type\n */\n Changes.prototype.addElementInList = function (field, value, type) {\n this.changes.push({\n field: field,\n type: type | exports.TYPE_ARRAY_ELEMENT_ADD,\n value: value\n });\n };\n /**\n * Delete element from list\n *\n * @param field\n * @param condition\n */\n Changes.prototype.deleteElementFromList = function (field, condition) {\n this.changes.push({\n field: field,\n type: exports.TYPE_ARRAY_ELEMENT_DELETE,\n condition: condition\n });\n };\n /**\n * Get changes\n *\n * @returns {[]}\n */\n Changes.prototype.getChanges = function () {\n return this.changes;\n };\n /**\n * Create\n *\n * @returns {Changes}\n */\n Changes.create = function () {\n return new Changes();\n };\n /**\n * To array\n *\n * @returns {[]}\n */\n Changes.prototype.toArray = function () {\n return JSON.parse(JSON.stringify(this.changes));\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Changes}\n */\n Changes.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var changes = Changes.create();\n changes.changes = array;\n return changes;\n };\n return Changes;\n}());\nexports.Changes = Changes;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Aggregation constants\n */\nexports.RANGE_ZERO = 0;\nexports.RANGE_INFINITE = -1;\nexports.RANGE_SEPARATOR = \"..\";\n/**\n * Filter class\n */\nvar Range = /** @class */ (function () {\n function Range() {\n }\n /**\n * Strong to array\n *\n * @param string\n *\n * @returns {[number, number]}\n */\n Range.stringToArray = function (string) {\n var parts = string.split(exports.RANGE_SEPARATOR);\n var from = parts[0];\n var to = parts[1];\n var finalFrom = exports.RANGE_ZERO;\n var finalTo = exports.RANGE_INFINITE;\n if (from != \"\") {\n finalFrom = parseInt(from);\n }\n if (to != \"\") {\n finalTo = parseInt(to);\n }\n return [finalFrom, finalTo];\n };\n /**\n * Array to string\n *\n * @param values\n *\n * @return {string}\n */\n Range.arrayToString = function (values) {\n var finalValues = [\"\", \"\"];\n if (values[0] != exports.RANGE_ZERO) {\n finalValues[0] = String(values[0]);\n }\n if (values[1] != exports.RANGE_INFINITE) {\n finalValues[1] = String(values[1]);\n }\n return finalValues.join(exports.RANGE_SEPARATOR);\n };\n /**\n * Create ranges\n *\n * @param from\n * @param to\n * @param incremental\n */\n Range.createRanges = function (from, to, incremental) {\n var ranges = [];\n var nextTo;\n while (from < to) {\n nextTo = from + incremental;\n ranges.push(from + exports.RANGE_SEPARATOR + nextTo);\n from = nextTo;\n }\n return ranges;\n };\n return Range;\n}());\nexports.Range = Range;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/lib/Model/Item.d.ts b/lib/Model/Item.d.ts index 05c9d6b..8742882 100644 --- a/lib/Model/Item.d.ts +++ b/lib/Model/Item.d.ts @@ -239,4 +239,12 @@ export declare class Item { * @returns string */ composeUUID(): string; + /** + * Get path by field. + * + * @param field + * + * @returns {string} + */ + static getPathByField(field: string): string; } diff --git a/lib/Model/Item.js b/lib/Model/Item.js index 6aa47c5..8592937 100644 --- a/lib/Model/Item.js +++ b/lib/Model/Item.js @@ -372,6 +372,18 @@ var Item = /** @class */ (function () { Item.prototype.composeUUID = function () { return this.uuid.composedUUID(); }; + /** + * Get path by field. + * + * @param field + * + * @returns {string} + */ + Item.getPathByField = function (field) { + return (["id", "type"].indexOf(field) > -1) + ? "uuid." + field + : "indexed_metadata." + field; + }; return Item; }()); exports.Item = Item; diff --git a/lib/Query/Filter.d.ts b/lib/Query/Filter.d.ts index 404b249..d79356c 100644 --- a/lib/Query/Filter.d.ts +++ b/lib/Query/Filter.d.ts @@ -94,12 +94,4 @@ export declare class Filter { * @returns {Filter} */ static createFromArray(array: any): Filter; - /** - * Get path by field. - * - * @param field - * - * @returns {string} - */ - static getFilterPathByField(field: string): string; } diff --git a/lib/Query/Filter.js b/lib/Query/Filter.js index 4141920..0a49dff 100644 --- a/lib/Query/Filter.js +++ b/lib/Query/Filter.js @@ -149,18 +149,6 @@ var Filter = /** @class */ (function () { } return Filter.create(array.field, array.values, array.application_type, array.filter_type, array.filter_terms); }; - /** - * Get path by field. - * - * @param field - * - * @returns {string} - */ - Filter.getFilterPathByField = function (field) { - return (["id", "type"].indexOf(field) > -1) - ? "uuid." + field - : "indexed_metadata." + field; - }; return Filter; }()); exports.Filter = Filter; diff --git a/lib/Query/Query.d.ts b/lib/Query/Query.d.ts index 548263a..60ed480 100644 --- a/lib/Query/Query.d.ts +++ b/lib/Query/Query.d.ts @@ -4,7 +4,7 @@ import { ItemUUID } from "../Model/ItemUUID"; import { User } from "../Model/User"; import { Aggregation } from "./Aggregation"; import { Filter } from "./Filter"; -import { ScoreStrategy } from "./ScoreStrategy"; +import { ScoreStrategies } from "./ScoreStrategies"; import { SortBy } from "./SortBy"; /** * Query constants @@ -33,7 +33,7 @@ export declare class Query { private suggestionsEnabled; private highlightsEnabled; private filterFields; - private scoreStrategy; + private scoreStrategies; private fuzziness; private minScore; private user; @@ -467,17 +467,17 @@ export declare class Query { */ excludeUUIDs(...uuids: ItemUUID[]): Query; /** - * Get score strategy + * Get score strategies * - * @return {ScoreStrategy} + * @return {ScoreStrategies} */ - getScoreStrategy(): ScoreStrategy; + getScoreStrategies(): ScoreStrategies; /** - * Set score strategy + * Set score strategies * - * @param scoreStrategy + * @param scoreStrategies */ - setScoreStrategy(scoreStrategy: ScoreStrategy): Query; + setScoreStrategies(scoreStrategies: ScoreStrategies): Query; /** * Get fuzziness * diff --git a/lib/Query/Query.js b/lib/Query/Query.js index 06fd31b..fc41817 100644 --- a/lib/Query/Query.js +++ b/lib/Query/Query.js @@ -3,6 +3,7 @@ exports.__esModule = true; var tslib_1 = require("tslib"); var Coordinate_1 = require("../Model/Coordinate"); var ItemUUID_1 = require("../Model/ItemUUID"); +var Item_1 = require("../Model/Item"); var User_1 = require("../Model/User"); var Aggregation_1 = require("./Aggregation"); var Filter_1 = require("./Filter"); @@ -10,7 +11,7 @@ var Filter_2 = require("./Filter"); var Aggregation_2 = require("./Aggregation"); var InvalidFormatError_1 = require("../Error/InvalidFormatError"); var Filter_3 = require("./Filter"); -var ScoreStrategy_1 = require("./ScoreStrategy"); +var ScoreStrategies_1 = require("./ScoreStrategies"); var SortBy_1 = require("./SortBy"); /** * Query constants @@ -35,6 +36,10 @@ var Query = /** @class */ (function () { this.filters = {}; this.itemsPromoted = []; this.aggregations = {}; + this.resultsEnabled = true; + this.aggregationsEnabled = true; + this.suggestionsEnabled = false; + this.highlightsEnabled = false; this.filterFields = []; this.minScore = exports.NO_MIN_SCORE; this.sortByInstance = SortBy_1.SortBy.create(); @@ -144,7 +149,7 @@ var Query = /** @class */ (function () { */ Query.prototype.filterUniverseByTypes = function (values) { var _a; - var fieldPath = Filter_1.Filter.getFilterPathByField("type"); + var fieldPath = Item_1.Item.getPathByField("type"); if (values.length > 0) { this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a["type"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a)); } @@ -166,7 +171,7 @@ var Query = /** @class */ (function () { if (aggregate === void 0) { aggregate = true; } if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; } var _a, _b; - var fieldPath = Filter_1.Filter.getFilterPathByField("type"); + var fieldPath = Item_1.Item.getPathByField("type"); if (values.length > 0) { this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a["type"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a)); } @@ -187,7 +192,7 @@ var Query = /** @class */ (function () { */ Query.prototype.filterUniverseByIds = function (values) { var _a; - var fieldPath = Filter_1.Filter.getFilterPathByField("id"); + var fieldPath = Item_1.Item.getPathByField("id"); if (values.length > 0) { this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a["id"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a)); } @@ -205,7 +210,7 @@ var Query = /** @class */ (function () { */ Query.prototype.filterByIds = function (values) { var _a; - var fieldPath = Filter_1.Filter.getFilterPathByField("id"); + var fieldPath = Item_1.Item.getPathByField("id"); if (values.length > 0) { this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a["id"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a)); } @@ -226,7 +231,7 @@ var Query = /** @class */ (function () { Query.prototype.filterUniverseBy = function (field, values, applicationType) { if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; } var _a; - var fieldPath = Filter_1.Filter.getFilterPathByField(field); + var fieldPath = Item_1.Item.getPathByField(field); if (values.length > 0) { this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[field] = Filter_1.Filter.create(fieldPath, values, applicationType, Filter_2.FILTER_TYPE_FIELD), _a)); } @@ -252,7 +257,7 @@ var Query = /** @class */ (function () { if (aggregate === void 0) { aggregate = true; } if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; } var _a; - var fieldPath = Filter_1.Filter.getFilterPathByField(field); + var fieldPath = Item_1.Item.getPathByField(field); if (values.length > 0) { this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[filterName] = Filter_1.Filter.create(fieldPath, values, applicationType, Filter_2.FILTER_TYPE_FIELD), _a)); } @@ -278,7 +283,7 @@ var Query = /** @class */ (function () { if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; } if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; } var _a; - var fieldPath = Filter_1.Filter.getFilterPathByField(field); + var fieldPath = Item_1.Item.getPathByField(field); if (values.length > 0) { this.universeFilters = tslib_1.__assign({}, this.universeFilters, (_a = {}, _a[field] = Filter_1.Filter.create(fieldPath, values, applicationType, rangeType), _a)); } @@ -320,7 +325,7 @@ var Query = /** @class */ (function () { if (aggregate === void 0) { aggregate = true; } if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; } var _a; - var fieldPath = Filter_1.Filter.getFilterPathByField(field); + var fieldPath = Item_1.Item.getPathByField(field); if (values.length !== 0) { this.filters = tslib_1.__assign({}, this.filters, (_a = {}, _a[filterName] = Filter_1.Filter.create(fieldPath, values, applicationType, rangeType), _a)); } @@ -414,7 +419,7 @@ var Query = /** @class */ (function () { if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; } if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; } var _a; - this.aggregations = tslib_1.__assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Filter_1.Filter.getFilterPathByField(field), applicationType, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort, limit), _a)); + this.aggregations = tslib_1.__assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Item_1.Item.getPathByField(field), applicationType, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort, limit), _a)); return this; }; /** @@ -438,7 +443,7 @@ var Query = /** @class */ (function () { if (options.length === 0) { return this; } - this.aggregations = tslib_1.__assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Filter_1.Filter.getFilterPathByField(field), applicationType, rangeType, options, aggregationSort, limit), _a)); + this.aggregations = tslib_1.__assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Item_1.Item.getPathByField(field), applicationType, rangeType, options, aggregationSort, limit), _a)); return this; }; /** @@ -537,7 +542,7 @@ var Query = /** @class */ (function () { * @return {Filter|null} */ Query.prototype.getFilterByField = function (fieldName) { - var fieldPath = Filter_1.Filter.getFilterPathByField(fieldName); + var fieldPath = Item_1.Item.getPathByField(fieldName); for (var i in this.filters) { if (this.filters[i].getField() == fieldPath) { return this.filters[i]; @@ -745,20 +750,20 @@ var Query = /** @class */ (function () { return this; }; /** - * Get score strategy + * Get score strategies * - * @return {ScoreStrategy} + * @return {ScoreStrategies} */ - Query.prototype.getScoreStrategy = function () { - return this.scoreStrategy; + Query.prototype.getScoreStrategies = function () { + return this.scoreStrategies; }; /** - * Set score strategy + * Set score strategies * - * @param scoreStrategy + * @param scoreStrategies */ - Query.prototype.setScoreStrategy = function (scoreStrategy) { - this.scoreStrategy = scoreStrategy; + Query.prototype.setScoreStrategies = function (scoreStrategies) { + this.scoreStrategies = scoreStrategies; return this; }; /** @@ -934,12 +939,12 @@ var Query = /** @class */ (function () { array.filter_fields = this.filterFields; } /** - * Score strategy + * Score strategies */ - if (this.scoreStrategy instanceof ScoreStrategy_1.ScoreStrategy) { - var scoreStrategyAsArray = this.scoreStrategy.toArray(); - if (Object.keys(scoreStrategyAsArray).length > 0) { - array.score_strategy = scoreStrategyAsArray; + if (this.scoreStrategies instanceof ScoreStrategies_1.ScoreStrategies) { + var scoreStrategiesAsArray = this.scoreStrategies.toArray(); + if (Object.keys(scoreStrategiesAsArray).length > 0) { + array.score_strategies = scoreStrategiesAsArray; } } if (this.fuzziness !== null) { @@ -1061,8 +1066,8 @@ var Query = /** @class */ (function () { query.filterFields = array.filter_fields instanceof Array ? array.filter_fields : []; - query.scoreStrategy = array.score_strategy instanceof Object - ? ScoreStrategy_1.ScoreStrategy.createFromArray(array.score_stategy) + query.scoreStrategies = array.score_strategies instanceof Object + ? ScoreStrategies_1.ScoreStrategies.createFromArray(array.score_strategies) : null; query.user = array.user instanceof Object ? User_1.User.createFromArray(array.user) diff --git a/lib/Query/ScoreStrategies.d.ts b/lib/Query/ScoreStrategies.d.ts new file mode 100644 index 0000000..6667062 --- /dev/null +++ b/lib/Query/ScoreStrategies.d.ts @@ -0,0 +1,64 @@ +import { ScoreStrategy } from "./ScoreStrategy"; +/** + * ScoreStrategies constants + */ +export declare const MULTIPLY = "multiply"; +export declare const SUM = "sum"; +export declare const AVG = "avg"; +export declare const MAX = "max"; +export declare const MIN = "min"; +/** + * ScoreStrategies + */ +export declare class ScoreStrategies { + private scoreStrategies; + private scoreMode; + /** + * Create empty + * + * @param scoreMode + * + * @return {ScoreStrategies} + */ + static createEmpty(scoreMode?: string): ScoreStrategies; + /** + * Add score strategy + * + * @param scoreStrategy + * + * @return {ScoreStrategies} + */ + addScoreStrategy(scoreStrategy: ScoreStrategy): ScoreStrategies; + /** + * Get score strategies + * + * @return {ScoreStrategy[]} + */ + getScoreStrategies(): ScoreStrategy[]; + /** + * Get score mode + * + * @return {string} + */ + getScoreMode(): string; + /** + * To array + * + * @return {{ + * score_mode: string, + * score_strategies: any + * }} + */ + toArray(): { + score_mode: string; + score_strategies: any; + }; + /** + * Create from array + * + * @param array + * + * @return {ScoreStrategies} + */ + static createFromArray(array: any): ScoreStrategies; +} diff --git a/lib/Query/ScoreStrategies.js b/lib/Query/ScoreStrategies.js new file mode 100644 index 0000000..0d49cdc --- /dev/null +++ b/lib/Query/ScoreStrategies.js @@ -0,0 +1,99 @@ +"use strict"; +exports.__esModule = true; +var ScoreStrategy_1 = require("./ScoreStrategy"); +/** + * ScoreStrategies constants + */ +exports.MULTIPLY = 'multiply'; +exports.SUM = 'sum'; +exports.AVG = 'avg'; +exports.MAX = 'max'; +exports.MIN = 'min'; +/** + * ScoreStrategies + */ +var ScoreStrategies = /** @class */ (function () { + function ScoreStrategies() { + this.scoreStrategies = []; + } + /** + * Create empty + * + * @param scoreMode + * + * @return {ScoreStrategies} + */ + ScoreStrategies.createEmpty = function (scoreMode) { + if (scoreMode === void 0) { scoreMode = exports.SUM; } + var scoreStrategies = new ScoreStrategies; + scoreStrategies.scoreMode = scoreMode; + return scoreStrategies; + }; + /** + * Add score strategy + * + * @param scoreStrategy + * + * @return {ScoreStrategies} + */ + ScoreStrategies.prototype.addScoreStrategy = function (scoreStrategy) { + this.scoreStrategies.push(scoreStrategy); + return this; + }; + /** + * Get score strategies + * + * @return {ScoreStrategy[]} + */ + ScoreStrategies.prototype.getScoreStrategies = function () { + return this.scoreStrategies; + }; + /** + * Get score mode + * + * @return {string} + */ + ScoreStrategies.prototype.getScoreMode = function () { + return this.scoreMode; + }; + /** + * To array + * + * @return {{ + * score_mode: string, + * score_strategies: any + * }} + */ + ScoreStrategies.prototype.toArray = function () { + var scoreStrategiesAsArray = []; + for (var i in this.scoreStrategies) { + scoreStrategiesAsArray.push(this.scoreStrategies[i].toArray()); + } + return { + score_mode: this.scoreMode, + score_strategies: scoreStrategiesAsArray + }; + }; + /** + * Create from array + * + * @param array + * + * @return {ScoreStrategies} + */ + ScoreStrategies.createFromArray = function (array) { + array = JSON.parse(JSON.stringify(array)); + var scoreStrategies = (typeof array.score_mode != "undefined") + ? ScoreStrategies.createEmpty(array.score_mode) + : ScoreStrategies.createEmpty(); + scoreStrategies.scoreStrategies = []; + for (var i in array.score_strategies) { + scoreStrategies + .scoreStrategies + .push(ScoreStrategy_1.ScoreStrategy.createFromArray(array.score_strategies[i])); + } + return scoreStrategies; + }; + return ScoreStrategies; +}()); +exports.ScoreStrategies = ScoreStrategies; diff --git a/lib/Query/ScoreStrategy.d.ts b/lib/Query/ScoreStrategy.d.ts index 2499a42..d54d9bd 100644 --- a/lib/Query/ScoreStrategy.d.ts +++ b/lib/Query/ScoreStrategy.d.ts @@ -1,27 +1,66 @@ +import { Filter } from "./Filter"; /** - * Aggregation constants + * ScoreStrategy constants */ -export declare const SCORE_STRATEGY_DEFAULT = 0; -export declare const SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD = 1; -export declare const SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION = 2; +export declare const DEFAULT_TYPE = "default"; +export declare const DEFAULT_WEIGHT = 1; +export declare const BOOSTING_FIELD_VALUE = "field_value"; +export declare const CUSTOM_FUNCTION = "custom_function"; +export declare const DECAY = "decay"; +export declare const DECAY_LINEAR = "linear"; +export declare const DECAY_EXP = "exp"; +export declare const DECAY_GAUSS = "gauss"; +export declare const MODIFIER_NONE = "none"; +export declare const MODIFIER_SQRT = "sqrt"; +export declare const MODIFIER_LOG = "log"; +export declare const MODIFIER_LN = "ln"; +export declare const MODIFIER_SQUARE = "square"; +export declare const SCORE_MODE_NONE = "none"; +export declare const SCORE_MODE_SUM = "sum"; +export declare const SCORE_MODE_AVG = "avg"; +export declare const SCORE_MODE_MAX = "max"; +export declare const SCORE_MODE_MIN = "min"; +export declare const DEFAULT_MISSING = 1; +export declare const DEFAULT_FACTOR = 1; /** * ScoreStrategy */ export declare class ScoreStrategy { private type; - private innerFunction; + private filter; + private weight; + private scoreMode; + private configuration; /** * Get type * - * @returns {number} + * @returns {string} */ - getType(): number; + getType(): string; /** - * Get function + * Get configuration value * * @returns {string} */ - getFunction(): string; + getConfigurationValue(element: string): any; + /** + * Get weight. + * + * @return {number} + */ + getWeight(): number; + /** + * Get score mode. + * + * @return {string} + */ + getScoreMode(): string; + /** + * Get filter. + * + * @return {Filter} + */ + getFilter(): Filter; /** * Create default * @@ -29,26 +68,71 @@ export declare class ScoreStrategy { */ static createDefault(): ScoreStrategy; /** - * Create relevance boosting + * Create field boosting + * + * @param field + * @param factor + * @param missing + * @param modifier + * @param weight + * @param filter + * @param scoreMode + * + * @return {ScoreStrategy} + */ + static createFieldBoosting(field: string, factor?: number, missing?: number, modifier?: string, weight?: number, filter?: Filter, scoreMode?: string): ScoreStrategy; + /** + * Create custom function + * + * @param func + * @param weight + * @param filter + * @param scoreMode * * @return {ScoreStrategy} */ - static createRelevanceBoosting(): ScoreStrategy; + static createCustomFunction(func: string, weight?: number, filter?: Filter, scoreMode?: string): ScoreStrategy; /** - * Create relevance boosting + * Create decay function * - * @param innerFunction + * @param type + * @param field + * @param origin + * @param scale + * @param offset + * @param decay + * @param weight + * @param filter + * @param scoreMode * * @return {ScoreStrategy} */ - static createCustomFunction(innerFunction: any): ScoreStrategy; + static createDecayFunction(type: string, field: string, origin: string, scale: string, offset: string, decay: number, weight?: number, filter?: Filter, scoreMode?: string): ScoreStrategy; + /** + * Fix filter path. + * + * @param filter + * + * @return {Filter} + */ + private static fixFilterFieldPath; /** + * To array * - * @return {{type: number, function: string}} + * @return {{ + * type: string, + * configuration: any, + * weight: number, + * score_mode: string, + * filter: any + * }} */ toArray(): { - "type": number; - "function": string; + type: string; + configuration: any; + weight: number; + score_mode: string; + filter: any; }; /** * Create from array diff --git a/lib/Query/ScoreStrategy.js b/lib/Query/ScoreStrategy.js index 53136d6..fceae41 100644 --- a/lib/Query/ScoreStrategy.js +++ b/lib/Query/ScoreStrategy.js @@ -1,34 +1,83 @@ "use strict"; exports.__esModule = true; +var Item_1 = require("../Model/Item"); +var Filter_1 = require("./Filter"); /** - * Aggregation constants + * ScoreStrategy constants */ -exports.SCORE_STRATEGY_DEFAULT = 0; -exports.SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD = 1; -exports.SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION = 2; +exports.DEFAULT_TYPE = 'default'; +exports.DEFAULT_WEIGHT = 1.0; +exports.BOOSTING_FIELD_VALUE = 'field_value'; +exports.CUSTOM_FUNCTION = 'custom_function'; +exports.DECAY = 'decay'; +exports.DECAY_LINEAR = 'linear'; +exports.DECAY_EXP = 'exp'; +exports.DECAY_GAUSS = 'gauss'; +exports.MODIFIER_NONE = 'none'; +exports.MODIFIER_SQRT = 'sqrt'; +exports.MODIFIER_LOG = 'log'; +exports.MODIFIER_LN = 'ln'; +exports.MODIFIER_SQUARE = 'square'; +exports.SCORE_MODE_NONE = 'none'; +exports.SCORE_MODE_SUM = 'sum'; +exports.SCORE_MODE_AVG = 'avg'; +exports.SCORE_MODE_MAX = 'max'; +exports.SCORE_MODE_MIN = 'min'; +exports.DEFAULT_MISSING = 1.0; +exports.DEFAULT_FACTOR = 1.0; /** * ScoreStrategy */ var ScoreStrategy = /** @class */ (function () { function ScoreStrategy() { - this.type = exports.SCORE_STRATEGY_DEFAULT; - this.innerFunction = null; + this.type = exports.DEFAULT_TYPE; + this.filter = null; + this.weight = exports.DEFAULT_WEIGHT; + this.scoreMode = exports.SCORE_MODE_AVG; + this.configuration = {}; } /** * Get type * - * @returns {number} + * @returns {string} */ ScoreStrategy.prototype.getType = function () { return this.type; }; /** - * Get function + * Get configuration value * * @returns {string} */ - ScoreStrategy.prototype.getFunction = function () { - return this.innerFunction; + ScoreStrategy.prototype.getConfigurationValue = function (element) { + if (typeof this.configuration[element] == "undefined") { + return null; + } + return this.configuration[element]; + }; + /** + * Get weight. + * + * @return {number} + */ + ScoreStrategy.prototype.getWeight = function () { + return this.weight; + }; + /** + * Get score mode. + * + * @return {string} + */ + ScoreStrategy.prototype.getScoreMode = function () { + return this.scoreMode; + }; + /** + * Get filter. + * + * @return {Filter} + */ + ScoreStrategy.prototype.getFilter = function () { + return this.filter; }; /** * Create default @@ -39,36 +88,125 @@ var ScoreStrategy = /** @class */ (function () { return new ScoreStrategy(); }; /** - * Create relevance boosting + * Create field boosting + * + * @param field + * @param factor + * @param missing + * @param modifier + * @param weight + * @param filter + * @param scoreMode + * + * @return {ScoreStrategy} + */ + ScoreStrategy.createFieldBoosting = function (field, factor, missing, modifier, weight, filter, scoreMode) { + if (factor === void 0) { factor = exports.DEFAULT_FACTOR; } + if (missing === void 0) { missing = exports.DEFAULT_MISSING; } + if (modifier === void 0) { modifier = exports.MODIFIER_NONE; } + if (weight === void 0) { weight = exports.DEFAULT_WEIGHT; } + if (filter === void 0) { filter = null; } + if (scoreMode === void 0) { scoreMode = exports.SCORE_MODE_AVG; } + var scoreStrategy = ScoreStrategy.createDefault(); + scoreStrategy.type = exports.BOOSTING_FIELD_VALUE; + scoreStrategy.configuration['field'] = field; + scoreStrategy.configuration['factor'] = factor; + scoreStrategy.configuration['missing'] = missing; + scoreStrategy.configuration['modifier'] = modifier; + scoreStrategy.weight = weight; + scoreStrategy.filter = ScoreStrategy.fixFilterFieldPath(filter); + scoreStrategy.scoreMode = scoreMode; + return scoreStrategy; + }; + /** + * Create custom function + * + * @param func + * @param weight + * @param filter + * @param scoreMode * * @return {ScoreStrategy} */ - ScoreStrategy.createRelevanceBoosting = function () { + ScoreStrategy.createCustomFunction = function (func, weight, filter, scoreMode) { + if (weight === void 0) { weight = exports.DEFAULT_WEIGHT; } + if (filter === void 0) { filter = null; } + if (scoreMode === void 0) { scoreMode = exports.SCORE_MODE_AVG; } var scoreStrategy = ScoreStrategy.createDefault(); - scoreStrategy.type = exports.SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD; + scoreStrategy.type = exports.CUSTOM_FUNCTION; + scoreStrategy.configuration['function'] = func; + scoreStrategy.weight = weight; + scoreStrategy.filter = ScoreStrategy.fixFilterFieldPath(filter); + scoreStrategy.scoreMode = scoreMode; return scoreStrategy; }; /** - * Create relevance boosting + * Create decay function * - * @param innerFunction + * @param type + * @param field + * @param origin + * @param scale + * @param offset + * @param decay + * @param weight + * @param filter + * @param scoreMode * * @return {ScoreStrategy} */ - ScoreStrategy.createCustomFunction = function (innerFunction) { + ScoreStrategy.createDecayFunction = function (type, field, origin, scale, offset, decay, weight, filter, scoreMode) { + if (weight === void 0) { weight = exports.DEFAULT_WEIGHT; } + if (filter === void 0) { filter = null; } + if (scoreMode === void 0) { scoreMode = exports.SCORE_MODE_AVG; } var scoreStrategy = ScoreStrategy.createDefault(); - scoreStrategy.type = exports.SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION; - scoreStrategy.innerFunction = innerFunction; + scoreStrategy.type = exports.DECAY; + scoreStrategy.configuration['type'] = type; + scoreStrategy.configuration['field'] = field; + scoreStrategy.configuration['origin'] = origin; + scoreStrategy.configuration['scale'] = scale; + scoreStrategy.configuration['offset'] = offset; + scoreStrategy.configuration['decay'] = decay; + scoreStrategy.weight = weight; + scoreStrategy.filter = ScoreStrategy.fixFilterFieldPath(filter); + scoreStrategy.scoreMode = scoreMode; return scoreStrategy; }; /** + * Fix filter path. + * + * @param filter + * + * @return {Filter} + */ + ScoreStrategy.fixFilterFieldPath = function (filter) { + if (filter == null) { + return filter; + } + var filterAsArray = filter.toArray(); + filterAsArray['field'] = Item_1.Item.getPathByField(filterAsArray['field']); + return Filter_1.Filter.createFromArray(filterAsArray); + }; + /** + * To array * - * @return {{type: number, function: string}} + * @return {{ + * type: string, + * configuration: any, + * weight: number, + * score_mode: string, + * filter: any + * }} */ ScoreStrategy.prototype.toArray = function () { return { type: this.type, - "function": this.innerFunction + configuration: this.configuration, + weight: this.weight, + score_mode: this.scoreMode, + filter: this.filter instanceof Filter_1.Filter + ? this.filter.toArray() + : null }; }; /** @@ -81,14 +219,21 @@ var ScoreStrategy = /** @class */ (function () { ScoreStrategy.createFromArray = function (array) { array = JSON.parse(JSON.stringify(array)); var scoreStrategy = ScoreStrategy.createDefault(); - if (typeof array.type == "undefined") { - array.type = exports.SCORE_STRATEGY_DEFAULT; + if (typeof array.type != "undefined") { + scoreStrategy.type = array.type; + } + if (typeof array.configuration != "undefined") { + scoreStrategy.configuration = array.configuration; + } + if (typeof array.weight != "undefined") { + scoreStrategy.weight = array.weight; + } + if (typeof array.score_mode != "undefined") { + scoreStrategy.scoreMode = array.score_mode; } - if (typeof array["function"] == "undefined") { - array.innerFunction = null; + if (typeof array.filter === 'object' && array.filter !== null) { + scoreStrategy.filter = Filter_1.Filter.createFromArray(array.filter); } - scoreStrategy.type = array.type; - scoreStrategy.innerFunction = array["function"]; return scoreStrategy; }; return ScoreStrategy; diff --git a/lib/Query/SortBy.js b/lib/Query/SortBy.js index a5481bb..e1c79b6 100644 --- a/lib/Query/SortBy.js +++ b/lib/Query/SortBy.js @@ -1,5 +1,6 @@ "use strict"; exports.__esModule = true; +var Item_1 = require("../Model/Item"); /** export * Sort by constants */ @@ -166,7 +167,7 @@ var SortBy = /** @class */ (function () { */ SortBy.prototype.byNestedFieldAndFilter = function (field, order, filter, mode) { if (mode === void 0) { mode = exports.SORT_BY_MODE_AVG; } - var fieldPath = Filter_1.Filter.getFilterPathByField(filter.getField()); + var fieldPath = Item_1.Item.getPathByField(filter.getField()); var filterAsArray = filter.toArray(); filterAsArray.field = fieldPath; filter = Filter_1.Filter.createFromArray(filterAsArray); diff --git a/lib/index.d.ts b/lib/index.d.ts index 66d72df..8e3d912 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -30,6 +30,7 @@ export * from "./Query/Aggregation"; export * from "./Query/Filter"; export * from "./Query/Query"; export * from "./Query/Range"; +export * from "./Query/ScoreStrategies"; export * from "./Query/ScoreStrategy"; export * from "./Query/SortBy"; export * from "./Repository/HttpRepository"; diff --git a/lib/index.js b/lib/index.js index 856a8c7..8246814 100644 --- a/lib/index.js +++ b/lib/index.js @@ -32,6 +32,7 @@ tslib_1.__exportStar(require("./Query/Aggregation"), exports); tslib_1.__exportStar(require("./Query/Filter"), exports); tslib_1.__exportStar(require("./Query/Query"), exports); tslib_1.__exportStar(require("./Query/Range"), exports); +tslib_1.__exportStar(require("./Query/ScoreStrategies"), exports); tslib_1.__exportStar(require("./Query/ScoreStrategy"), exports); tslib_1.__exportStar(require("./Query/SortBy"), exports); tslib_1.__exportStar(require("./Repository/HttpRepository"), exports); diff --git a/package-lock.json b/package-lock.json index a37e2e7..69e44aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "apisearch", - "version": "0.2.12", + "version": "0.2.14", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -452,11 +452,11 @@ "dev": true }, "axios": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.17.1.tgz", - "integrity": "sha1-LY4+XQvb1zJ/kbyBT1xXZg+Bgk0=", + "version": "0.18.0", + "resolved": "http://registry.npmjs.org/axios/-/axios-0.18.0.tgz", + "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", "requires": { - "follow-redirects": "^1.2.5", + "follow-redirects": "^1.3.0", "is-buffer": "^1.1.5" } }, @@ -1591,11 +1591,11 @@ } }, "follow-redirects": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.3.0.tgz", - "integrity": "sha1-9oSHH8EW0uMp/aVe9naH9Pq8kFw=", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.6.0.tgz", + "integrity": "sha512-4Oh4eI3S9OueVV41AgJ1oLjpaJUhbJ7JDGOMhe0AFqoSejl5Q2nn3eGglAzRUKVKZE8jG5MNn66TjCJMAnpsWA==", "requires": { - "debug": "^3.1.0" + "debug": "=3.1.0" }, "dependencies": { "debug": { diff --git a/package.json b/package.json index 59cacc6..bbc694e 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,6 @@ "webpack-merge": "^4.1.4" }, "dependencies": { - "axios": "^0.17.1" + "axios": "^0.18.0" } } diff --git a/src/Model/Item.ts b/src/Model/Item.ts index 33f0bb8..8e1d9a4 100644 --- a/src/Model/Item.ts +++ b/src/Model/Item.ts @@ -502,4 +502,18 @@ export class Item { public composeUUID(): string { return this.uuid.composedUUID(); } + + /** + * Get path by field. + * + * @param field + * + * @returns {string} + */ + public static getPathByField(field: string): string { + return (["id", "type"].indexOf(field) > -1) + ? `uuid.${field}` + : `indexed_metadata.${field}` + ; + } } diff --git a/src/Query/Filter.ts b/src/Query/Filter.ts index 94d33e7..e91c66b 100644 --- a/src/Query/Filter.ts +++ b/src/Query/Filter.ts @@ -197,18 +197,4 @@ export class Filter { array.filter_terms, ); } - - /** - * Get path by field. - * - * @param field - * - * @returns {string} - */ - public static getFilterPathByField(field: string): string { - return (["id", "type"].indexOf(field) > -1) - ? `uuid.${field}` - : `indexed_metadata.${field}` - ; - } } diff --git a/src/Query/Query.ts b/src/Query/Query.ts index 6f4adae..9f780a0 100644 --- a/src/Query/Query.ts +++ b/src/Query/Query.ts @@ -1,6 +1,7 @@ import {LocationRange} from "../Geo/LocationRange"; import {Coordinate} from "../Model/Coordinate"; import {ItemUUID} from "../Model/ItemUUID"; +import {Item} from "../Model/Item"; import {User} from "../Model/User"; import {Aggregation} from "./Aggregation"; import {Filter} from "./Filter"; @@ -21,7 +22,7 @@ import { import {InvalidFormatError} from "../Error/InvalidFormatError"; import {FILTER_TYPE_QUERY} from "./Filter"; -import {ScoreStrategy} from "./ScoreStrategy"; +import {ScoreStrategies} from "./ScoreStrategies"; import {SortBy} from "./SortBy"; /** @@ -48,12 +49,12 @@ export class Query { private page: number; private from: number; private size: number; - private resultsEnabled: boolean; - private aggregationsEnabled: boolean; - private suggestionsEnabled: boolean; - private highlightsEnabled: boolean; + private resultsEnabled: boolean = true; + private aggregationsEnabled: boolean = true; + private suggestionsEnabled: boolean = false; + private highlightsEnabled: boolean = false; private filterFields: string[] = []; - private scoreStrategy: ScoreStrategy; + private scoreStrategies: ScoreStrategies; private fuzziness: any; private minScore: number = NO_MIN_SCORE; private user: User; @@ -200,7 +201,7 @@ export class Query { * @return {Query} */ public filterUniverseByTypes(values: any[]): Query { - const fieldPath = Filter.getFilterPathByField("type"); + const fieldPath = Item.getPathByField("type"); if (values.length > 0) { this.universeFilters = { ...this.universeFilters, @@ -230,7 +231,7 @@ export class Query { public filterByTypes(values: any[], aggregate: boolean = true, aggregationSort: string[] = AGGREGATION_SORT_BY_COUNT_DESC): Query { - const fieldPath = Filter.getFilterPathByField("type"); + const fieldPath = Item.getPathByField("type"); if (values.length > 0) { this.filters = { ...this.filters, @@ -270,7 +271,7 @@ export class Query { * @return {Query} */ public filterUniverseByIds(values: any[]): Query { - const fieldPath = Filter.getFilterPathByField("id"); + const fieldPath = Item.getPathByField("id"); if (values.length > 0) { this.universeFilters = { ...this.universeFilters, @@ -296,7 +297,7 @@ export class Query { * @return {Query} */ public filterByIds(values: any[]): Query { - const fieldPath = Filter.getFilterPathByField("id"); + const fieldPath = Item.getPathByField("id"); if (values.length > 0) { this.filters = { ...this.filters, @@ -326,7 +327,7 @@ export class Query { public filterUniverseBy(field: string, values: any[], applicationType: number = FILTER_AT_LEAST_ONE): Query { - const fieldPath = Filter.getFilterPathByField(field); + const fieldPath = Item.getPathByField(field); if (values.length > 0) { this.universeFilters = { ...this.universeFilters, @@ -362,7 +363,7 @@ export class Query { applicationType: number = FILTER_AT_LEAST_ONE, aggregate: boolean = true, aggregationSort: string[] = AGGREGATION_SORT_BY_COUNT_DESC): Query { - const fieldPath = Filter.getFilterPathByField(field); + const fieldPath = Item.getPathByField(field); if (values.length > 0) { this.filters = { ...this.filters, @@ -403,7 +404,7 @@ export class Query { values: any[], applicationType: number = FILTER_AT_LEAST_ONE, rangeType: string = FILTER_TYPE_RANGE): Query { - const fieldPath = Filter.getFilterPathByField(field); + const fieldPath = Item.getPathByField(field); if (values.length > 0) { this.universeFilters = { ...this.universeFilters, @@ -463,7 +464,7 @@ export class Query { rangeType: string = FILTER_TYPE_RANGE, aggregate: boolean = true, aggregationSort: string[] = AGGREGATION_SORT_BY_COUNT_DESC): Query { - const fieldPath = Filter.getFilterPathByField(field); + const fieldPath = Item.getPathByField(field); if (values.length !== 0) { this.filters = { ...this.filters, @@ -609,7 +610,7 @@ export class Query { ...this.aggregations, [filterName]: Aggregation.create( filterName, - Filter.getFilterPathByField(field), + Item.getPathByField(field), applicationType, FILTER_TYPE_FIELD, [], @@ -649,7 +650,7 @@ export class Query { ...this.aggregations, [filterName]: Aggregation.create( filterName, - Filter.getFilterPathByField(field), + Item.getPathByField(field), applicationType, rangeType, options, @@ -776,7 +777,7 @@ export class Query { * @return {Filter|null} */ public getFilterByField(fieldName: string): Filter { - const fieldPath = Filter.getFilterPathByField(fieldName); + const fieldPath = Item.getPathByField(fieldName); for (const i in this.filters) { if (this.filters[i].getField() == fieldPath) { return this.filters[i]; @@ -1018,21 +1019,21 @@ export class Query { } /** - * Get score strategy + * Get score strategies * - * @return {ScoreStrategy} + * @return {ScoreStrategies} */ - public getScoreStrategy(): ScoreStrategy { - return this.scoreStrategy; + public getScoreStrategies(): ScoreStrategies { + return this.scoreStrategies; } /** - * Set score strategy + * Set score strategies * - * @param scoreStrategy + * @param scoreStrategies */ - public setScoreStrategy(scoreStrategy: ScoreStrategy): Query { - this.scoreStrategy = scoreStrategy; + public setScoreStrategies(scoreStrategies: ScoreStrategies): Query { + this.scoreStrategies = scoreStrategies; return this; } @@ -1246,12 +1247,12 @@ export class Query { } /** - * Score strategy + * Score strategies */ - if (this.scoreStrategy instanceof ScoreStrategy) { - const scoreStrategyAsArray = this.scoreStrategy.toArray(); - if (Object.keys(scoreStrategyAsArray).length > 0) { - array.score_strategy = scoreStrategyAsArray; + if (this.scoreStrategies instanceof ScoreStrategies) { + const scoreStrategiesAsArray = this.scoreStrategies.toArray(); + if (Object.keys(scoreStrategiesAsArray).length > 0) { + array.score_strategies = scoreStrategiesAsArray; } } @@ -1406,8 +1407,8 @@ export class Query { ? array.filter_fields : []; - query.scoreStrategy = array.score_strategy instanceof Object - ? ScoreStrategy.createFromArray(array.score_stategy) + query.scoreStrategies = array.score_strategies instanceof Object + ? ScoreStrategies.createFromArray(array.score_strategies) : null; query.user = array.user instanceof Object diff --git a/src/Query/ScoreStrategies.ts b/src/Query/ScoreStrategies.ts new file mode 100644 index 0000000..3174fba --- /dev/null +++ b/src/Query/ScoreStrategies.ts @@ -0,0 +1,109 @@ +import {ScoreStrategy} from "./ScoreStrategy"; +/** + * ScoreStrategies constants + */ +export const MULTIPLY = 'multiply'; +export const SUM = 'sum'; +export const AVG = 'avg'; +export const MAX = 'max'; +export const MIN = 'min'; + +/** + * ScoreStrategies + */ +export class ScoreStrategies { + + private scoreStrategies: ScoreStrategy[] = []; + private scoreMode : string; + + /** + * Create empty + * + * @param scoreMode + * + * @return {ScoreStrategies} + */ + public static createEmpty(scoreMode: string = SUM) : ScoreStrategies { + let scoreStrategies = new ScoreStrategies; + scoreStrategies.scoreMode = scoreMode; + + return scoreStrategies; + } + + /** + * Add score strategy + * + * @param scoreStrategy + * + * @return {ScoreStrategies} + */ + public addScoreStrategy(scoreStrategy: ScoreStrategy) : ScoreStrategies { + this.scoreStrategies.push(scoreStrategy); + + return this; + } + + /** + * Get score strategies + * + * @return {ScoreStrategy[]} + */ + public getScoreStrategies() : ScoreStrategy[] { + return this.scoreStrategies; + } + + /** + * Get score mode + * + * @return {string} + */ + public getScoreMode() : string { + return this.scoreMode; + } + + /** + * To array + * + * @return {{ + * score_mode: string, + * score_strategies: any + * }} + */ + public toArray(): { + score_mode: string, + score_strategies: any + } { + let scoreStrategiesAsArray = []; + for (const i in this.scoreStrategies) { + scoreStrategiesAsArray.push(this.scoreStrategies[i].toArray()); + } + + return { + score_mode: this.scoreMode, + score_strategies: scoreStrategiesAsArray + }; + } + + /** + * Create from array + * + * @param array + * + * @return {ScoreStrategies} + */ + public static createFromArray(array: any): ScoreStrategies { + array = JSON.parse(JSON.stringify(array)); + const scoreStrategies = (typeof array.score_mode != "undefined") + ? ScoreStrategies.createEmpty(array.score_mode) + : ScoreStrategies.createEmpty(); + + scoreStrategies.scoreStrategies = []; + for (const i in array.score_strategies) { + scoreStrategies + .scoreStrategies + .push(ScoreStrategy.createFromArray(array.score_strategies[i])); + } + + return scoreStrategies; + } +} diff --git a/src/Query/ScoreStrategy.ts b/src/Query/ScoreStrategy.ts index 25dc295..a299752 100644 --- a/src/Query/ScoreStrategy.ts +++ b/src/Query/ScoreStrategy.ts @@ -1,34 +1,91 @@ +import {Item} from "../Model/Item"; +import {Filter} from "./Filter"; + /** - * Aggregation constants + * ScoreStrategy constants */ -export const SCORE_STRATEGY_DEFAULT = 0; -export const SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD = 1; -export const SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION = 2; +export const DEFAULT_TYPE = 'default'; +export const DEFAULT_WEIGHT = 1.0; +export const BOOSTING_FIELD_VALUE = 'field_value'; +export const CUSTOM_FUNCTION = 'custom_function'; +export const DECAY = 'decay'; +export const DECAY_LINEAR = 'linear'; +export const DECAY_EXP = 'exp'; +export const DECAY_GAUSS = 'gauss'; +export const MODIFIER_NONE = 'none'; +export const MODIFIER_SQRT = 'sqrt'; +export const MODIFIER_LOG = 'log'; +export const MODIFIER_LN = 'ln'; +export const MODIFIER_SQUARE = 'square'; +export const SCORE_MODE_NONE = 'none'; +export const SCORE_MODE_SUM = 'sum'; +export const SCORE_MODE_AVG = 'avg'; +export const SCORE_MODE_MAX = 'max'; +export const SCORE_MODE_MIN = 'min'; +export const DEFAULT_MISSING = 1.0; +export const DEFAULT_FACTOR = 1.0; /** * ScoreStrategy */ export class ScoreStrategy { - private type: number = SCORE_STRATEGY_DEFAULT; - private innerFunction: string = null; + private type = DEFAULT_TYPE; + private filter: Filter = null; + private weight = DEFAULT_WEIGHT; + private scoreMode = SCORE_MODE_AVG; + private configuration = {}; /** * Get type * - * @returns {number} + * @returns {string} */ - public getType(): number { + public getType(): string { return this.type; } /** - * Get function + * Get configuration value * * @returns {string} */ - public getFunction(): string { - return this.innerFunction; + public getConfigurationValue(element: string){ + if (typeof this.configuration[element] == "undefined") { + return null; + } + + return this.configuration[element]; + } + + /** + * Get weight. + * + * @return {number} + */ + public getWeight(): number + { + return this.weight; + } + + /** + * Get score mode. + * + * @return {string} + */ + public getScoreMode(): string + { + return this.scoreMode; + } + + /** + * Get filter. + * + * @return {Filter} + */ + public getFilter(): Filter + { + return this.filter; } /** @@ -41,40 +98,152 @@ export class ScoreStrategy { } /** - * Create relevance boosting + * Create field boosting + * + * @param field + * @param factor + * @param missing + * @param modifier + * @param weight + * @param filter + * @param scoreMode * * @return {ScoreStrategy} */ - public static createRelevanceBoosting(): ScoreStrategy { - const scoreStrategy = ScoreStrategy.createDefault(); - scoreStrategy.type = SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD; + public static createFieldBoosting( + field: string, + factor: number = DEFAULT_FACTOR, + missing: number = DEFAULT_MISSING, + modifier: string = MODIFIER_NONE, + weight: number = DEFAULT_WEIGHT, + filter: Filter = null, + scoreMode: string = SCORE_MODE_AVG + ) : ScoreStrategy { + let scoreStrategy = ScoreStrategy.createDefault(); + scoreStrategy.type = BOOSTING_FIELD_VALUE; + scoreStrategy.configuration['field'] = field; + scoreStrategy.configuration['factor'] = factor; + scoreStrategy.configuration['missing'] = missing; + scoreStrategy.configuration['modifier'] = modifier; + scoreStrategy.weight = weight; + scoreStrategy.filter = ScoreStrategy.fixFilterFieldPath(filter); + scoreStrategy.scoreMode = scoreMode; return scoreStrategy; } /** - * Create relevance boosting + * Create custom function * - * @param innerFunction + * @param func + * @param weight + * @param filter + * @param scoreMode * * @return {ScoreStrategy} */ - public static createCustomFunction(innerFunction): ScoreStrategy { - const scoreStrategy = ScoreStrategy.createDefault(); - scoreStrategy.type = SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION; - scoreStrategy.innerFunction = innerFunction; + public static createCustomFunction( + func: string, + weight: number = DEFAULT_WEIGHT, + filter: Filter = null, + scoreMode: string = SCORE_MODE_AVG + ) : ScoreStrategy { + let scoreStrategy = ScoreStrategy.createDefault(); + scoreStrategy.type = CUSTOM_FUNCTION; + scoreStrategy.configuration['function'] = func; + scoreStrategy.weight = weight; + scoreStrategy.filter = ScoreStrategy.fixFilterFieldPath(filter); + scoreStrategy.scoreMode = scoreMode; return scoreStrategy; } /** + * Create decay function * - * @return {{type: number, function: string}} + * @param type + * @param field + * @param origin + * @param scale + * @param offset + * @param decay + * @param weight + * @param filter + * @param scoreMode + * + * @return {ScoreStrategy} + */ + public static createDecayFunction( + type: string, + field: string, + origin: string, + scale: string, + offset: string, + decay: number, + weight: number = DEFAULT_WEIGHT, + filter: Filter = null, + scoreMode: string = SCORE_MODE_AVG + ) : ScoreStrategy { + let scoreStrategy = ScoreStrategy.createDefault(); + scoreStrategy.type = DECAY; + scoreStrategy.configuration['type'] = type; + scoreStrategy.configuration['field'] = field; + scoreStrategy.configuration['origin'] = origin; + scoreStrategy.configuration['scale'] = scale; + scoreStrategy.configuration['offset'] = offset; + scoreStrategy.configuration['decay'] = decay; + scoreStrategy.weight = weight; + scoreStrategy.filter = ScoreStrategy.fixFilterFieldPath(filter); + scoreStrategy.scoreMode = scoreMode; + + return scoreStrategy; + } + + /** + * Fix filter path. + * + * @param filter + * + * @return {Filter} + */ + private static fixFilterFieldPath(filter: Filter): Filter + { + if (filter == null) { + return filter; + } + + let filterAsArray = filter.toArray(); + filterAsArray['field'] = Item.getPathByField(filterAsArray['field']); + + return Filter.createFromArray(filterAsArray); + } + + /** + * To array + * + * @return {{ + * type: string, + * configuration: any, + * weight: number, + * score_mode: string, + * filter: any + * }} */ - public toArray(): {"type": number, "function": string} { + public toArray(): { + type: string, + configuration: any, + weight: number, + score_mode: string, + filter: any + } { return { type: this.type, - function: this.innerFunction, + configuration: this.configuration, + weight: this.weight, + score_mode: this.scoreMode, + filter: this.filter instanceof Filter + ? this.filter.toArray() + : null }; } @@ -88,15 +257,21 @@ export class ScoreStrategy { public static createFromArray(array: any): ScoreStrategy { array = JSON.parse(JSON.stringify(array)); const scoreStrategy = ScoreStrategy.createDefault(); - if (typeof array.type == "undefined") { - array.type = SCORE_STRATEGY_DEFAULT; + if (typeof array.type != "undefined") { + scoreStrategy.type = array.type; } - if (typeof array.function == "undefined") { - array.innerFunction = null; + if (typeof array.configuration != "undefined") { + scoreStrategy.configuration = array.configuration; + } + if (typeof array.weight != "undefined") { + scoreStrategy.weight = array.weight; + } + if (typeof array.score_mode != "undefined") { + scoreStrategy.scoreMode = array.score_mode; + } + if (typeof array.filter === 'object' && array.filter !== null) { + scoreStrategy.filter = Filter.createFromArray(array.filter); } - - scoreStrategy.type = array.type; - scoreStrategy.innerFunction = array.function; return scoreStrategy; } diff --git a/src/Query/SortBy.ts b/src/Query/SortBy.ts index f037647..53dc23d 100644 --- a/src/Query/SortBy.ts +++ b/src/Query/SortBy.ts @@ -1,3 +1,4 @@ +import {Item} from "../Model/Item"; /** export * Sort by constants */ @@ -184,7 +185,7 @@ export class SortBy { order: string, filter: Filter, mode: string = SORT_BY_MODE_AVG): SortBy { - const fieldPath = Filter.getFilterPathByField(filter.getField()); + const fieldPath = Item.getPathByField(filter.getField()); const filterAsArray = filter.toArray(); filterAsArray.field = fieldPath; filter = Filter.createFromArray(filterAsArray); diff --git a/src/index.ts b/src/index.ts index a847403..70ee77d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -36,6 +36,7 @@ export * from "./Query/Aggregation"; export * from "./Query/Filter"; export * from "./Query/Query"; export * from "./Query/Range"; +export * from "./Query/ScoreStrategies"; export * from "./Query/ScoreStrategy"; export * from "./Query/SortBy"; diff --git a/test/Apisearch.test.ts b/test/Apisearch.test.ts index 88fbb53..e6df16b 100644 --- a/test/Apisearch.test.ts +++ b/test/Apisearch.test.ts @@ -18,7 +18,7 @@ describe('Apisearch', () => { "index_id": 'bbbb', "token": 'cccc', "options": { - "endpoint": 'http://blabla', + "endpoint": 'http://localhost:8100', "http_client": client, } }); diff --git a/test/Functional/Apisearch/ConfigureIndex.test.ts b/test/Functional/Apisearch/ConfigureIndex.test.ts index 2e3cf95..aebc5ca 100644 --- a/test/Functional/Apisearch/ConfigureIndex.test.ts +++ b/test/Functional/Apisearch/ConfigureIndex.test.ts @@ -13,19 +13,22 @@ import {Synonym} from "../../../src/Config/Synonym"; describe('Configure Index', () => { let repository = Apisearch.createRepository( { - 'app_id': 'test-ts-app-id', - 'index_id': 'test-ts-index-id', + 'app_id': '789437438test', + 'index_id': 'default', 'token': '0e4d75ba-c640-44c1-a745-06ee51db4e93', 'options': { - 'endpoint': 'http://127.0.0.1:8999', + 'endpoint': 'http://127.0.0.1:8201', } } ); - const indexUUID = IndexUUID.createById('test-ts-index-id'); + const indexUUID = IndexUUID.createById('default'); it('should configure properly the index', async () => { - await repository.deleteIndex(indexUUID); + try { + await repository.deleteIndex(indexUUID); + } catch(e) {} + await repository.createIndex(indexUUID, Config.createFromArray({})); repository.addItem(Item.create( ItemUUID.createByComposedUUID('1~item'), @@ -54,7 +57,7 @@ describe('Configure Index', () => { await repository .query(Query.create('feliciano')) .then(result => { - expect(result.getTotalHits()).to.be.equal(0); + expect(result.getTotalHits()).to.be.equal(1); }); repository.addItem(Item.create( diff --git a/test/Functional/Apisearch/ListIndices.test.ts b/test/Functional/Apisearch/ListIndices.test.ts index 93a4a4d..04741d6 100644 --- a/test/Functional/Apisearch/ListIndices.test.ts +++ b/test/Functional/Apisearch/ListIndices.test.ts @@ -11,19 +11,22 @@ import {Config} from "../../../src/Config/Config"; describe('List Indices', () => { let repository = Apisearch.createRepository( { - 'app_id': 'test-ts-app-id', - 'index_id': 'test-ts-index-id', + 'app_id': '789437438test', + 'index_id': 'default', 'token': '0e4d75ba-c640-44c1-a745-06ee51db4e93', 'options': { - 'endpoint': 'http://127.0.0.1:8999', + 'endpoint': 'http://127.0.0.1:8201', } } ); - const indexUUID = IndexUUID.createById('test-ts-index-id'); + const indexUUID = IndexUUID.createById('default'); it('should create properly an item and make a query', async () => { - await repository.deleteIndex(indexUUID); + try { + await repository.deleteIndex(indexUUID); + } catch(e) {} + await repository.createIndex(indexUUID, Config.createFromArray({})); repository.addItem(Item.create(ItemUUID.createByComposedUUID('1~item'))); repository.addItem(Item.create(ItemUUID.createByComposedUUID('2~item'))); @@ -38,8 +41,8 @@ describe('List Indices', () => { await repository.getIndices() .then(indices => { expect(indices.length).to.be.equal(1); - expect(indices[0].getUUID().composedUUID()).to.be.equal('test-ts-index-id'); - expect(indices[0].getAppUUID().composedUUID()).to.be.equal('test-ts-app-id'); + expect(indices[0].getUUID().composedUUID()).to.be.equal('default'); + expect(indices[0].getAppUUID().composedUUID()).to.be.equal('789437438test'); expect(indices[0].getDocCount()).to.be.equal(5); }); }); diff --git a/test/Functional/Apisearch/Query.test.ts b/test/Functional/Apisearch/Query.test.ts index 66acac5..78d7d8b 100644 --- a/test/Functional/Apisearch/Query.test.ts +++ b/test/Functional/Apisearch/Query.test.ts @@ -13,19 +13,22 @@ import {Config} from "../../../src/Config/Config"; describe('Apisearch', () => { let repository = Apisearch.createRepository( { - 'app_id': 'test-ts-app-id', - 'index_id': 'test-ts-index-id', + 'app_id': '789437438test', + 'index_id': 'default', 'token': '0e4d75ba-c640-44c1-a745-06ee51db4e93', 'options': { - 'endpoint': 'http://127.0.0.1:8999', + 'endpoint': 'http://127.0.0.1:8201', } } ); - const indexUUID = IndexUUID.createById('test-ts-index-id'); + const indexUUID = IndexUUID.createById('default'); it('should properly make a query', async () => { - await repository.deleteIndex(indexUUID); + try { + await repository.deleteIndex(indexUUID); + } catch(e) {} + await repository.createIndex(indexUUID, Config.createFromArray({})); await repository .query(Query.createMatchAll()) diff --git a/test/Query/Query.test.ts b/test/Query/Query.test.ts index ff5c7de..4379a6b 100644 --- a/test/Query/Query.test.ts +++ b/test/Query/Query.test.ts @@ -10,12 +10,27 @@ import {Coordinate} from "../../src/Model/Coordinate"; import {QUERY_DEFAULT_PAGE, QUERY_DEFAULT_SIZE} from '../../src/Query/Query'; import {FILTER_AT_LEAST_ONE, FILTER_MUST_ALL} from "../../src/Query/Filter"; +import {ScoreStrategies} from "../../src/Query/ScoreStrategies"; /** * Query object tests */ describe('Query()', () => { + describe('Test defaults', () => { + let query = Query.create(''); + it('should have default values', () => { + expect(query.getFields()).to.be.deep.equals([]); + expect(query.areSuggestionsEnabled()).to.be.false; + expect(query.areAggregationsEnabled()).to.be.true; + expect(query.getQueryText()).to.be.equals(''); + expect(query.getPage()).to.be.equals(QUERY_DEFAULT_PAGE); + expect(query.getSize()).to.be.equals(QUERY_DEFAULT_SIZE); + expect(query.getScoreStrategies()).to.be.undefined; + expect(query.getUser()).to.be.undefined; + expect(query.getMinScore()).to.be.equals(NO_MIN_SCORE); + }); + }); describe('-> filterBy...()', () => { let query = Query.create( @@ -486,4 +501,12 @@ describe('Query()', () => { }).getMinScore()).to.be.deep.equals(4.5); }); }); + + describe('-> Test score strategy', () => { + it('should work properly', () => { + let query = Query.createMatchAll().setScoreStrategies(ScoreStrategies.createEmpty()); + query = Query.createFromArray(JSON.parse(JSON.stringify(query.toArray()))); + expect(query.getScoreStrategies()).to.be.instanceof(ScoreStrategies); + }); + }); }); diff --git a/test/Query/ScoreStrategies.test.ts b/test/Query/ScoreStrategies.test.ts new file mode 100644 index 0000000..0dcc731 --- /dev/null +++ b/test/Query/ScoreStrategies.test.ts @@ -0,0 +1,29 @@ +import { expect } from 'chai'; +import { + ScoreStrategies, + AVG, + SUM +} from "../../src/Query/ScoreStrategies"; +import {ScoreStrategy} from "../../src/Query/ScoreStrategy"; + +describe('Query/', () => { + describe('ScoreStrategies', () => { + describe('.createEmpty()', () => { + let scoreStrategies = ScoreStrategies.createEmpty(); + it('Should work properly', () => { + expect(scoreStrategies.getScoreMode()).to.be.equal(SUM); + expect(scoreStrategies.getScoreStrategies()).to.be.deep.equal([]); + }); + }); + describe('with ScoreStrategy instances', () => { + let scoreStrategies = ScoreStrategies.createEmpty(AVG); + scoreStrategies.addScoreStrategy(ScoreStrategy.createDefault()); + scoreStrategies.addScoreStrategy(ScoreStrategy.createDefault()); + scoreStrategies.addScoreStrategy(ScoreStrategy.createDefault()); + it('Should work properly', () => { + expect(scoreStrategies.getScoreMode()).to.be.equal(AVG); + expect(scoreStrategies.getScoreStrategies().length).to.be.equal(3); + }); + }); + }); +}); diff --git a/test/Query/ScoreStrategy.test.ts b/test/Query/ScoreStrategy.test.ts index af23ef7..e969080 100644 --- a/test/Query/ScoreStrategy.test.ts +++ b/test/Query/ScoreStrategy.test.ts @@ -1,49 +1,262 @@ import { expect } from 'chai'; -import {ScoreStrategy} from "../../src/Query/ScoreStrategy"; import { - SCORE_STRATEGY_DEFAULT, - SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD, - SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION -} from '../../src/Query/ScoreStrategy'; + ScoreStrategy, DEFAULT_TYPE, + SCORE_MODE_AVG, BOOSTING_FIELD_VALUE, DEFAULT_FACTOR, DEFAULT_MISSING, + MODIFIER_NONE, DEFAULT_WEIGHT, MODIFIER_LN, SCORE_MODE_MIN, CUSTOM_FUNCTION, + DECAY_GAUSS, DECAY, SCORE_MODE_SUM +} from "../../src/Query/ScoreStrategy"; +import {Filter} from "../../src/Query/Filter"; describe('Query/', () => { describe('ScoreStrategy', () => { describe('.createDefault()', () => { let scoreStrategy = ScoreStrategy.createDefault(); it('Should work properly', () => { - expect(scoreStrategy.getType()).to.be.equal(SCORE_STRATEGY_DEFAULT); - expect(scoreStrategy.getFunction()).to.be.equal(null); + expect(scoreStrategy.getType()).to.be.equal(DEFAULT_TYPE); + expect(scoreStrategy.getFilter()).to.be.equal(null); + expect(scoreStrategy.getScoreMode()).to.be.equal(SCORE_MODE_AVG); }); }); - describe('.createRelevanceBoosting()', () => { - let scoreStrategy = ScoreStrategy.createRelevanceBoosting(); + describe('.createDefault() with HTTP Transport', () => { + let scoreStrategy = ScoreStrategy.createDefault(); + scoreStrategy = ScoreStrategy.createFromArray(JSON.parse(JSON.stringify(scoreStrategy.toArray()))); + it('Should work properly', () => { + expect(scoreStrategy.getType()).to.be.equal(DEFAULT_TYPE); + expect(scoreStrategy.getFilter()).to.be.equal(null); + expect(scoreStrategy.getScoreMode()).to.be.equal(SCORE_MODE_AVG); + }); + }); + + describe('.createFieldBoosting() with default', () => { + let scoreStrategy = ScoreStrategy.createFieldBoosting('relevance'); + it('Should work properly', () => { + expect(scoreStrategy.getType()).to.be.equal(BOOSTING_FIELD_VALUE); + expect(scoreStrategy.getConfigurationValue('field')).to.be.equal('relevance'); + expect(scoreStrategy.getConfigurationValue('factor')).to.be.equal(DEFAULT_FACTOR); + expect(scoreStrategy.getConfigurationValue('missing')).to.be.equal(DEFAULT_MISSING); + expect(scoreStrategy.getConfigurationValue('modifier')).to.be.equal(MODIFIER_NONE); + expect(scoreStrategy.getWeight()).to.be.equal(DEFAULT_WEIGHT); + expect(scoreStrategy.getFilter()).to.be.equal(null); + expect(scoreStrategy.getScoreMode()).to.be.equal(SCORE_MODE_AVG); + }); + }); + + describe('.createFieldBoosting() with default and HTTP Transport', () => { + let scoreStrategy = ScoreStrategy.createFieldBoosting('relevance'); + scoreStrategy = ScoreStrategy.createFromArray(JSON.parse(JSON.stringify(scoreStrategy.toArray()))); + it('Should work properly', () => { + expect(scoreStrategy.getType()).to.be.equal(BOOSTING_FIELD_VALUE); + expect(scoreStrategy.getConfigurationValue('field')).to.be.equal('relevance'); + expect(scoreStrategy.getConfigurationValue('factor')).to.be.equal(DEFAULT_FACTOR); + expect(scoreStrategy.getConfigurationValue('missing')).to.be.equal(DEFAULT_MISSING); + expect(scoreStrategy.getConfigurationValue('modifier')).to.be.equal(MODIFIER_NONE); + expect(scoreStrategy.getWeight()).to.be.equal(DEFAULT_WEIGHT); + expect(scoreStrategy.getFilter()).to.be.equal(null); + expect(scoreStrategy.getScoreMode()).to.be.equal(SCORE_MODE_AVG); + }); + }); + + describe('.createFieldBoosting()', () => { + let scoreStrategy = ScoreStrategy.createFieldBoosting( + 'relevance', + 1.0, + 2.0, + MODIFIER_LN, + 4.00, + Filter.create('x', [], 0, ''), + SCORE_MODE_MIN + ); + it('Should work properly', () => { - expect(scoreStrategy.getType()).to.be.equal(SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD); - expect(scoreStrategy.getFunction()).to.be.equal(null); + expect(scoreStrategy.getConfigurationValue('factor')).to.be.equal(1.0); + expect(scoreStrategy.getConfigurationValue('missing')).to.be.equal(2.0); + expect(scoreStrategy.getConfigurationValue('modifier')).to.be.equal(MODIFIER_LN); + expect(scoreStrategy.getWeight()).to.be.equal(4.0); + expect(scoreStrategy.getFilter()).to.be.instanceof(Filter); + expect(scoreStrategy.getScoreMode()).to.be.equal(SCORE_MODE_MIN); }); }); - describe('.createRelevanceBoosting()', () => { - let innerFunction = 'xxx'; - let scoreStrategy = ScoreStrategy.createCustomFunction(innerFunction); + describe('.createFieldBoosting() with HTTP Transport', () => { + let scoreStrategy = ScoreStrategy.createFieldBoosting( + 'relevance', + 1.0, + 2.0, + MODIFIER_LN, + 4.00, + Filter.create('x', [], 0, ''), + SCORE_MODE_MIN + ); + scoreStrategy = ScoreStrategy.createFromArray(JSON.parse(JSON.stringify(scoreStrategy.toArray()))); + + it('Should work properly', () => { + expect(scoreStrategy.getConfigurationValue('factor')).to.be.equal(1.0); + expect(scoreStrategy.getConfigurationValue('missing')).to.be.equal(2.0); + expect(scoreStrategy.getConfigurationValue('modifier')).to.be.equal(MODIFIER_LN); + expect(scoreStrategy.getWeight()).to.be.equal(4.0); + expect(scoreStrategy.getFilter()).to.be.instanceof(Filter); + expect(scoreStrategy.getScoreMode()).to.be.equal(SCORE_MODE_MIN); + }); + }); + + describe('.createCustomFunction() with default', () => { + let scoreStrategy = ScoreStrategy.createCustomFunction('xxx'); + it('Should work properly', () => { - expect(scoreStrategy.getType()).to.be.equal(SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION); - expect(scoreStrategy.getFunction()).to.be.equal(innerFunction); + expect(scoreStrategy.getType()).to.be.equal(CUSTOM_FUNCTION); + expect(scoreStrategy.getConfigurationValue('function')).to.be.equal('xxx'); + expect(scoreStrategy.getWeight()).to.be.equal(DEFAULT_WEIGHT); + expect(scoreStrategy.getFilter()).to.be.equal(null); + expect(scoreStrategy.getScoreMode()).to.be.equal(SCORE_MODE_AVG); }); }); - describe('.toArray() & .createFromArray()', () => { - let innerFunction = 'xxx'; - let array = { - 'type': SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION, - 'function': innerFunction - }; - let scoreStrategy = ScoreStrategy.createFromArray(array); + describe('.createCustomFunction() with default and HTTP Transport', () => { + let scoreStrategy = ScoreStrategy.createCustomFunction('xxx'); + scoreStrategy = ScoreStrategy.createFromArray(JSON.parse(JSON.stringify(scoreStrategy.toArray()))); + + it('Should work properly', () => { + expect(scoreStrategy.getType()).to.be.equal(CUSTOM_FUNCTION); + expect(scoreStrategy.getConfigurationValue('function')).to.be.equal('xxx'); + expect(scoreStrategy.getWeight()).to.be.equal(DEFAULT_WEIGHT); + expect(scoreStrategy.getFilter()).to.be.equal(null); + expect(scoreStrategy.getScoreMode()).to.be.equal(SCORE_MODE_AVG); + }); + }); + + describe('.createCustomFunction()', () => { + let scoreStrategy = ScoreStrategy.createCustomFunction( + 'xxx', + 2.34, + Filter.create('x', [], 0, ''), + SCORE_MODE_MIN + ); + + it('Should work properly', () => { + expect(scoreStrategy.getType()).to.be.equal(CUSTOM_FUNCTION); + expect(scoreStrategy.getConfigurationValue('function')).to.be.equal('xxx'); + expect(scoreStrategy.getWeight()).to.be.equal(2.34); + expect(scoreStrategy.getFilter()).to.be.instanceof(Filter); + expect(scoreStrategy.getScoreMode()).to.be.equal(SCORE_MODE_MIN); + }); + }); + + describe('.createCustomFunction() with HTTP Transport', () => { + let scoreStrategy = ScoreStrategy.createCustomFunction( + 'xxx', + 2.34, + Filter.create('x', [], 0, ''), + SCORE_MODE_MIN + ); + scoreStrategy = ScoreStrategy.createFromArray(JSON.parse(JSON.stringify(scoreStrategy.toArray()))); + + it('Should work properly', () => { + expect(scoreStrategy.getType()).to.be.equal(CUSTOM_FUNCTION); + expect(scoreStrategy.getConfigurationValue('function')).to.be.equal('xxx'); + expect(scoreStrategy.getWeight()).to.be.equal(2.34); + expect(scoreStrategy.getFilter()).to.be.instanceof(Filter); + expect(scoreStrategy.getScoreMode()).to.be.equal(SCORE_MODE_MIN); + }); + }); + + describe('.createDecayFunction() with default', () => { + let scoreStrategy = ScoreStrategy.createDecayFunction( + DECAY_GAUSS, + 'field1', + '1m', + 'scale', + '10', + 1.0 + ); + + it('Should work properly', () => { + expect(scoreStrategy.getType()).to.be.equal(DECAY); + expect(scoreStrategy.getWeight()).to.be.equal(DEFAULT_WEIGHT); + expect(scoreStrategy.getFilter()).to.be.equal(null); + expect(scoreStrategy.getScoreMode()).to.be.equal(SCORE_MODE_AVG); + expect(scoreStrategy.getConfigurationValue('field')).to.be.equal('field1'); + expect(scoreStrategy.getConfigurationValue('origin')).to.be.equal('1m'); + expect(scoreStrategy.getConfigurationValue('scale')).to.be.equal('scale'); + expect(scoreStrategy.getConfigurationValue('offset')).to.be.equal('10'); + expect(scoreStrategy.getConfigurationValue('decay')).to.be.equal(1.0); + }); + }); + + describe('.createDecayFunction() with default and HTTP Transport', () => { + let scoreStrategy = ScoreStrategy.createDecayFunction( + DECAY_GAUSS, + 'field1', + '1m', + 'scale', + '10', + 1.0 + ); + scoreStrategy = ScoreStrategy.createFromArray(JSON.parse(JSON.stringify(scoreStrategy.toArray()))); + + it('Should work properly', () => { + expect(scoreStrategy.getType()).to.be.equal(DECAY); + expect(scoreStrategy.getWeight()).to.be.equal(DEFAULT_WEIGHT); + expect(scoreStrategy.getFilter()).to.be.equal(null); + expect(scoreStrategy.getScoreMode()).to.be.equal(SCORE_MODE_AVG); + expect(scoreStrategy.getConfigurationValue('field')).to.be.equal('field1'); + expect(scoreStrategy.getConfigurationValue('origin')).to.be.equal('1m'); + expect(scoreStrategy.getConfigurationValue('scale')).to.be.equal('scale'); + expect(scoreStrategy.getConfigurationValue('offset')).to.be.equal('10'); + expect(scoreStrategy.getConfigurationValue('decay')).to.be.equal(1.0); + }); + }); + + describe('.createDecayFunction()', () => { + let scoreStrategy = ScoreStrategy.createDecayFunction( + DECAY_GAUSS, + 'field1', + '1m', + 'scale', + '10', + 1.0, + 5.50, + Filter.create('x', [], 0, ''), + SCORE_MODE_SUM + ); + + it('Should work properly', () => { + expect(scoreStrategy.getType()).to.be.equal(DECAY); + expect(scoreStrategy.getConfigurationValue('field')).to.be.equal('field1'); + expect(scoreStrategy.getConfigurationValue('origin')).to.be.equal('1m'); + expect(scoreStrategy.getConfigurationValue('scale')).to.be.equal('scale'); + expect(scoreStrategy.getConfigurationValue('offset')).to.be.equal('10'); + expect(scoreStrategy.getConfigurationValue('decay')).to.be.equal(1.0); + expect(scoreStrategy.getWeight()).to.be.equal(5.50); + expect(scoreStrategy.getFilter()).to.be.instanceof(Filter); + expect(scoreStrategy.getScoreMode()).to.be.equal(SCORE_MODE_SUM); + }); + }); + + describe('.createDecayFunction() with HTTP Transport', () => { + let scoreStrategy = ScoreStrategy.createDecayFunction( + DECAY_GAUSS, + 'field1', + '1m', + 'scale', + '10', + 1.0, + 5.50, + Filter.create('x', [], 0, ''), + SCORE_MODE_SUM + ); + scoreStrategy = ScoreStrategy.createFromArray(JSON.parse(JSON.stringify(scoreStrategy.toArray()))); + it('Should work properly', () => { - expect(scoreStrategy.getType()).to.be.equal(SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION); - expect(scoreStrategy.getFunction()).to.be.equal(innerFunction); - expect(scoreStrategy.toArray()).to.be.deep.equal(array); + expect(scoreStrategy.getType()).to.be.equal(DECAY); + expect(scoreStrategy.getConfigurationValue('field')).to.be.equal('field1'); + expect(scoreStrategy.getConfigurationValue('origin')).to.be.equal('1m'); + expect(scoreStrategy.getConfigurationValue('scale')).to.be.equal('scale'); + expect(scoreStrategy.getConfigurationValue('offset')).to.be.equal('10'); + expect(scoreStrategy.getConfigurationValue('decay')).to.be.equal(1.0); + expect(scoreStrategy.getWeight()).to.be.equal(5.50); + expect(scoreStrategy.getFilter()).to.be.instanceof(Filter); + expect(scoreStrategy.getScoreMode()).to.be.equal(SCORE_MODE_SUM); }); }); });