(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8386],{86393:function(t,e,n){!function(t){"use strict";var e={TASK_SUCCEEDED:"succeeded",TASK_PROCESSING:"processing",TASK_FAILED:"failed",TASK_ENQUEUED:"enqueued",TASK_CANCELED:"canceled"},r={INDEX_CREATION_FAILED:"index_creation_failed",MISSING_INDEX_UID:"missing_index_uid",INDEX_ALREADY_EXISTS:"index_already_exists",INDEX_NOT_FOUND:"index_not_found",INVALID_INDEX_UID:"invalid_index_uid",INDEX_NOT_ACCESSIBLE:"index_not_accessible",INVALID_INDEX_OFFSET:"invalid_index_offset",INVALID_INDEX_LIMIT:"invalid_index_limit",INVALID_STATE:"invalid_state",PRIMARY_KEY_INFERENCE_FAILED:"primary_key_inference_failed",INDEX_PRIMARY_KEY_ALREADY_EXISTS:"index_primary_key_already_exists",INVALID_INDEX_PRIMARY_KEY:"invalid_index_primary_key",DOCUMENTS_FIELDS_LIMIT_REACHED:"document_fields_limit_reached",MISSING_DOCUMENT_ID:"missing_document_id",INVALID_DOCUMENT_ID:"invalid_document_id",INVALID_CONTENT_TYPE:"invalid_content_type",MISSING_CONTENT_TYPE:"missing_content_type",INVALID_DOCUMENT_FIELDS:"invalid_document_fields",INVALID_DOCUMENT_LIMIT:"invalid_document_limit",INVALID_DOCUMENT_OFFSET:"invalid_document_offset",INVALID_DOCUMENT_FILTER:"invalid_document_filter",MISSING_DOCUMENT_FILTER:"missing_document_filter",INVALID_DOCUMENT_VECTORS_FIELD:"invalid_document_vectors_field",PAYLOAD_TOO_LARGE:"payload_too_large",MISSING_PAYLOAD:"missing_payload",MALFORMED_PAYLOAD:"malformed_payload",NO_SPACE_LEFT_ON_DEVICE:"no_space_left_on_device",INVALID_STORE_FILE:"invalid_store_file",INVALID_RANKING_RULES:"missing_document_id",INVALID_REQUEST:"invalid_request",INVALID_DOCUMENT_GEO_FIELD:"invalid_document_geo_field",INVALID_SEARCH_Q:"invalid_search_q",INVALID_SEARCH_OFFSET:"invalid_search_offset",INVALID_SEARCH_LIMIT:"invalid_search_limit",INVALID_SEARCH_PAGE:"invalid_search_page",INVALID_SEARCH_HITS_PER_PAGE:"invalid_search_hits_per_page",INVALID_SEARCH_ATTRIBUTES_TO_RETRIEVE:"invalid_search_attributes_to_retrieve",INVALID_SEARCH_ATTRIBUTES_TO_CROP:"invalid_search_attributes_to_crop",INVALID_SEARCH_CROP_LENGTH:"invalid_search_crop_length",INVALID_SEARCH_ATTRIBUTES_TO_HIGHLIGHT:"invalid_search_attributes_to_highlight",INVALID_SEARCH_SHOW_MATCHES_POSITION:"invalid_search_show_matches_position",INVALID_SEARCH_FILTER:"invalid_search_filter",INVALID_SEARCH_SORT:"invalid_search_sort",INVALID_SEARCH_FACETS:"invalid_search_facets",INVALID_SEARCH_HIGHLIGHT_PRE_TAG:"invalid_search_highlight_pre_tag",INVALID_SEARCH_HIGHLIGHT_POST_TAG:"invalid_search_highlight_post_tag",INVALID_SEARCH_CROP_MARKER:"invalid_search_crop_marker",INVALID_SEARCH_MATCHING_STRATEGY:"invalid_search_matching_strategy",INVALID_SEARCH_VECTOR:"invalid_search_vector",INVALID_SEARCH_ATTRIBUTES_TO_SEARCH_ON:"invalid_search_attributes_to_search_on",BAD_REQUEST:"bad_request",DOCUMENT_NOT_FOUND:"document_not_found",INTERNAL:"internal",INVALID_API_KEY:"invalid_api_key",INVALID_API_KEY_DESCRIPTION:"invalid_api_key_description",INVALID_API_KEY_ACTIONS:"invalid_api_key_actions",INVALID_API_KEY_INDEXES:"invalid_api_key_indexes",INVALID_API_KEY_EXPIRES_AT:"invalid_api_key_expires_at",API_KEY_NOT_FOUND:"api_key_not_found",IMMUTABLE_API_KEY_UID:"immutable_api_key_uid",IMMUTABLE_API_KEY_ACTIONS:"immutable_api_key_actions",IMMUTABLE_API_KEY_INDEXES:"immutable_api_key_indexes",IMMUTABLE_API_KEY_EXPIRES_AT:"immutable_api_key_expires_at",IMMUTABLE_API_KEY_CREATED_AT:"immutable_api_key_created_at",IMMUTABLE_API_KEY_UPDATED_AT:"immutable_api_key_updated_at",MISSING_AUTHORIZATION_HEADER:"missing_authorization_header",UNRETRIEVABLE_DOCUMENT:"unretrievable_document",MAX_DATABASE_SIZE_LIMIT_REACHED:"database_size_limit_reached",TASK_NOT_FOUND:"task_not_found",DUMP_PROCESS_FAILED:"dump_process_failed",DUMP_NOT_FOUND:"dump_not_found",INVALID_SWAP_DUPLICATE_INDEX_FOUND:"invalid_swap_duplicate_index_found",INVALID_SWAP_INDEXES:"invalid_swap_indexes",MISSING_SWAP_INDEXES:"missing_swap_indexes",MISSING_MASTER_KEY:"missing_master_key",INVALID_TASK_TYPES:"invalid_task_types",INVALID_TASK_UIDS:"invalid_task_uids",INVALID_TASK_STATUSES:"invalid_task_statuses",INVALID_TASK_LIMIT:"invalid_task_limit",INVALID_TASK_FROM:"invalid_task_from",INVALID_TASK_CANCELED_BY:"invalid_task_canceled_by",MISSING_TASK_FILTERS:"missing_task_filters",TOO_MANY_OPEN_FILES:"too_many_open_files",IO_ERROR:"io_error",INVALID_TASK_INDEX_UIDS:"invalid_task_index_uids",IMMUTABLE_INDEX_UID:"immutable_index_uid",IMMUTABLE_INDEX_CREATED_AT:"immutable_index_created_at",IMMUTABLE_INDEX_UPDATED_AT:"immutable_index_updated_at",INVALID_SETTINGS_DISPLAYED_ATTRIBUTES:"invalid_settings_displayed_attributes",INVALID_SETTINGS_SEARCHABLE_ATTRIBUTES:"invalid_settings_searchable_attributes",INVALID_SETTINGS_FILTERABLE_ATTRIBUTES:"invalid_settings_filterable_attributes",INVALID_SETTINGS_SORTABLE_ATTRIBUTES:"invalid_settings_sortable_attributes",INVALID_SETTINGS_RANKING_RULES:"invalid_settings_ranking_rules",INVALID_SETTINGS_STOP_WORDS:"invalid_settings_stop_words",INVALID_SETTINGS_SYNONYMS:"invalid_settings_synonyms",INVALID_SETTINGS_DISTINCT_ATTRIBUTE:"invalid_settings_distinct_attribute",INVALID_SETTINGS_TYPO_TOLERANCE:"invalid_settings_typo_tolerance",INVALID_SETTINGS_FACETING:"invalid_settings_faceting",INVALID_SETTINGS_PAGINATION:"invalid_settings_pagination",INVALID_SETTINGS_SEARCH_CUTOFF_MS:"invalid_settings_search_cutoff_ms",INVALID_SETTINGS_LOCALIZED_ATTRIBUTES:"invalid_settings_localized_attributes",INVALID_TASK_BEFORE_ENQUEUED_AT:"invalid_task_before_enqueued_at",INVALID_TASK_AFTER_ENQUEUED_AT:"invalid_task_after_enqueued_at",INVALID_TASK_BEFORE_STARTED_AT:"invalid_task_before_started_at",INVALID_TASK_AFTER_STARTED_AT:"invalid_task_after_started_at",INVALID_TASK_BEFORE_FINISHED_AT:"invalid_task_before_finished_at",INVALID_TASK_AFTER_FINISHED_AT:"invalid_task_after_finished_at",MISSING_API_KEY_ACTIONS:"missing_api_key_actions",MISSING_API_KEY_INDEXES:"missing_api_key_indexes",MISSING_API_KEY_EXPIRES_AT:"missing_api_key_expires_at",INVALID_API_KEY_LIMIT:"invalid_api_key_limit",INVALID_API_KEY_OFFSET:"invalid_api_key_offset",INVALID_FACET_SEARCH_FACET_NAME:"invalid_facet_search_facet_name",MISSING_FACET_SEARCH_FACET_NAME:"missing_facet_search_facet_name",INVALID_FACET_SEARCH_FACET_QUERY:"invalid_facet_search_facet_query",INVALID_SEARCH_RANKING_SCORE_THRESHOLD:"invalid_search_ranking_score_threshold",INVALID_SIMILAR_RANKING_SCORE_THRESHOLD:"invalid_similar_ranking_score_threshold"};function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function i(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach(function(e){l(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function a(){a=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,s=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",o=i.toStringTag||"@@toStringTag";function p(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(t){p=function(t,e,n){return t[e]=n}}function h(e,n,r,i){var a,u,c=Object.create((n&&n.prototype instanceof y?n:y).prototype);return s(c,"_invoke",{value:(a=new S(i||[]),u=d,function(n,s){if(u===l)throw Error("Generator is already running");if(u===v){if("throw"===n)throw s;return{value:t,done:!0}}for(a.method=n,a.arg=s;;){var i=a.delegate;if(i){var c=function e(n,r){var s=r.method,i=n.iterator[s];if(i===t)return r.delegate=null,"throw"===s&&n.iterator.return&&(r.method="return",r.arg=t,e(n,r),"throw"===r.method)||"return"!==s&&(r.method="throw",r.arg=TypeError("The iterator does not provide a '"+s+"' method")),_;var a=f(i,n.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,_;var u=a.arg;return u?u.done?(r[n.resultName]=u.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,_):u:(r.method="throw",r.arg=TypeError("iterator result is not an object"),r.delegate=null,_)}(i,a);if(c){if(c===_)continue;return c}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(u===d)throw u=v,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);u=l;var o=f(e,r,a);if("normal"===o.type){if(u=a.done?v:"suspendedYield",o.arg===_)continue;return{value:o.arg,done:a.done}}"throw"===o.type&&(u=v,a.method="throw",a.arg=o.arg)}})}),c}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var d="suspendedStart",l="executing",v="completed",_={};function y(){}function w(){}function x(){}var m={};p(m,u,function(){return this});var k=Object.getPrototypeOf,A=k&&k(k(D([])));A&&A!==n&&r.call(A,u)&&(m=A);var g=x.prototype=y.prototype=Object.create(m);function I(t){["next","throw","return"].forEach(function(e){p(t,e,function(t){return this._invoke(e,t)})})}function b(t,e){var n;s(this,"_invoke",{value:function(s,i){function a(){return new e(function(n,a){!function n(s,i,a,u){var c=f(t[s],t,i);if("throw"!==c.type){var o=c.arg,p=o.value;return p&&"object"==typeof p&&r.call(p,"__await")?e.resolve(p.__await).then(function(t){n("next",t,a,u)},function(t){n("throw",t,a,u)}):e.resolve(p).then(function(t){o.value=t,a(o)},function(t){return n("throw",t,a,u)})}u(c.arg)}(s,i,n,a)})}return n=n?n.then(a,a):a()}})}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function D(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var s=-1,i=function n(){for(;++s<e.length;)if(r.call(e,s))return n.value=e[s],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw TypeError(typeof e+" is not iterable")}return w.prototype=x,s(g,"constructor",{value:x,configurable:!0}),s(x,"constructor",{value:w,configurable:!0}),w.displayName=p(x,o,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,p(t,o,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},I(b.prototype),p(b.prototype,c,function(){return this}),e.AsyncIterator=b,e.async=function(t,n,r,s,i){void 0===i&&(i=Promise);var a=new b(h(t,n,r,s),i);return e.isGeneratorFunction(n)?a:a.next().then(function(t){return t.done?t.value:a.next()})},I(g),p(g,o,"Generator"),p(g,u,function(){return this}),p(g,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=D,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function s(r,s){return u.type="throw",u.arg=e,n.next=r,s&&(n.method="next",n.arg=t),!!s}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return s("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),o=r.call(a,"finallyLoc");if(c&&o){if(this.prev<a.catchLoc)return s(a.catchLoc,!0);if(this.prev<a.finallyLoc)return s(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return s(a.catchLoc,!0)}else{if(!o)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return s(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var s=this.tryEntries[n];if(s.tryLoc<=this.prev&&r.call(s,"finallyLoc")&&this.prev<s.finallyLoc){var i=s;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,_):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),_},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),_}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var s=r.arg;T(n)}return s}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:D(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),_}},e}function u(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e,n,r,s,i,a){try{var u=t[i](a),c=u.value}catch(t){n(t);return}u.done?e(c):Promise.resolve(c).then(r,s)}function p(t){return function(){var e=this,n=arguments;return new Promise(function(r,s){var i=t.apply(e,n);function a(t){o(i,r,s,a,u,"next",t)}function u(t){o(i,r,s,a,u,"throw",t)}a(void 0)})}}function h(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}function f(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u(r.key),r)}}function d(t,e,n){return e&&f(t.prototype,e),n&&f(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(t,e,n){return(e=u(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function v(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y(t,e)}function _(t){return(_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function y(t,e){return(y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function w(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function x(t,e,n){return(x=w()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var s=new(Function.bind.apply(t,r));return n&&y(s,n.prototype),s}).apply(null,arguments)}function m(t){var e="function"==typeof Map?new Map:void 0;return(m=function(t){if(null===t||!function(t){try{return -1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return x(t,arguments,_(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),y(n,t)})(t)}function k(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function A(t){var e=w();return function(){var n,r=_(t);if(e){var s=_(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return k(t)}(this,n)}}function g(t,e){if(t){if("string"==typeof t)return I(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return I(t,e)}}function I(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var b=function(t){v(n,t);var e=A(n);function n(){var t;h(this,n);for(var r=arguments.length,s=Array(r),i=0;i<r;i++)s[i]=arguments[i];return l(k(t=e.call.apply(e,[this].concat(s))),"name","MeiliSearchError"),t}return d(n)}(m(Error)),E=function(t){v(n,t);var e=A(n);function n(t,r){var s,i;return h(this,n),l(k(i=e.call(this,null!==(s=null==r?void 0:r.message)&&void 0!==s?s:"".concat(t.status,": ").concat(t.statusText))),"name","MeiliSearchApiError"),l(k(i),"cause",void 0),l(k(i),"response",void 0),i.response=t,void 0!==r&&(i.cause=r),i}return d(n)}(b),T=function(t){v(n,t);var e=A(n);function n(t,r){var s;return h(this,n),l(k(s=e.call(this,"Request to ".concat(t," has failed"),{cause:r})),"name","MeiliSearchRequestError"),s}return d(n)}(b),S=function(t){v(n,t);var e=A(n);function n(t){var r;return h(this,n),l(k(r=e.call(this,t)),"name","MeiliSearchTimeOutError"),r}return d(n)}(b);function D(t,e){return"".concat(t,"\nHint: It might not be working because maybe you're not up to date with the Meilisearch version that ").concat(e," call requires.")}function R(t){return Object.entries(t).reduce(function(t,e){var n=function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,s,i,a,u=[],c=!0,o=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){o=!0,s=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(o)throw s}}return u}}(e,2)||g(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],s=n[1];return void 0!==s&&(t[r]=s),t},{})}function N(){return(N=p(a().mark(function t(e){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new Promise(function(t){return setTimeout(t,e)});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}))).apply(this,arguments)}function O(t){return Object.keys(t).reduce(function(e,n){var r=t[n];return void 0===r?e:Array.isArray(r)?i(i({},e),{},l({},n,r.join(","))):r instanceof Date?i(i({},e),{},l({},n,r.toISOString())):i(i({},e),{},l({},n,r))},{})}var L=function(){var t,e,r,s,u,c,o;function f(t){h(this,f),l(this,"headers",void 0),l(this,"url",void 0),l(this,"requestConfig",void 0),l(this,"httpClient",void 0),l(this,"requestTimeout",void 0),this.headers=function(t){var e,n,r="X-Meilisearch-Client",s="Meilisearch JavaScript (v".concat("0.42.0",")"),i="Authorization",a=function(t){if(Array.isArray(t))return t.reduce(function(t,e){return t[e[0]]=e[1],t},{});if(!("has"in t))return Object.assign({},t);var e={};return t.forEach(function(t,n){return e[n]=t}),e}(null!==(e=null===(n=t.requestConfig)||void 0===n?void 0:n.headers)&&void 0!==e?e:{});if(t.apiKey&&!a[i]&&(a[i]="Bearer ".concat(t.apiKey)),a["Content-Type"]||(a["Content-Type"]="application/json"),t.clientAgents&&Array.isArray(t.clientAgents)){var u=t.clientAgents.concat(s);a[r]=u.join(" ; ")}else if(t.clientAgents&&!Array.isArray(t.clientAgents))throw new b('Meilisearch: The header "'.concat(r,'" should be an array of string(s).\n'));else a[r]=s;return a}(t),this.requestConfig=t.requestConfig,this.httpClient=t.httpClient,this.requestTimeout=t.timeout;try{var e=function(t){try{var e,n;return(n=t=(e=t).startsWith("https://")||e.startsWith("http://")?e:"http://".concat(e)).endsWith("/")||(n+="/"),t=n}catch(t){throw new b("The provided host is not valid.")}}(t.host);this.url=new URL(e)}catch(t){throw new b("The provided host is not valid.")}}return d(f,[{key:"request",value:(t=p(a().mark(function t(e){var r,s,u,c,o,p,h,f,d,l,v,_,y,w;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return s=e.method,u=e.url,c=e.params,o=e.body,h=void 0===(p=e.config)?{}:p,"undefined"==typeof fetch&&n(81124),f=new URL(u,this.url),c&&(d=new URLSearchParams,Object.keys(c).filter(function(t){return null!==c[t]}).map(function(t){return d.set(t,c[t])}),f.search=d.toString()),null!==(r=h.headers)&&void 0!==r&&r["Content-Type"]||(o=JSON.stringify(o)),l=i(i({},this.headers),h.headers),v=this.fetchWithTimeout(f.toString(),i(i(i({},h),this.requestConfig),{},{method:s,body:o,headers:l}),this.requestTimeout),t.next=9,v.catch(function(t){throw new T(f.toString(),t)});case 9:if(_=t.sent,!(void 0!==this.httpClient)){t.next=12;break}return t.abrupt("return",_);case 12:return t.next=14,_.text();case 14:if(w=""===(y=t.sent)?void 0:JSON.parse(y),_.ok){t.next=18;break}throw new E(_,w);case 18:return t.abrupt("return",w);case 19:case"end":return t.stop()}},t,this)})),function(e){return t.apply(this,arguments)})},{key:"fetchWithTimeout",value:(e=p(a().mark(function t(e,n,r){var s=this;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(t,i){var a,u=[(s.httpClient?s.httpClient:fetch)(e,n)];if(r){var c=new Promise(function(t,e){a=setTimeout(function(){e(Error("Error: Request Timed Out"))},r)});u.push(c)}Promise.race(u).then(t).catch(i).finally(function(){clearTimeout(a)})}));case 1:case"end":return t.stop()}},t)})),function(t,n,r){return e.apply(this,arguments)})},{key:"get",value:(r=p(a().mark(function t(e,n,r){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.request({method:"GET",url:e,params:n,config:r});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t,this)})),function(t,e,n){return r.apply(this,arguments)})},{key:"post",value:(s=p(a().mark(function t(e,n,r,s){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.request({method:"POST",url:e,body:n,params:r,config:s});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t,this)})),function(t,e,n,r){return s.apply(this,arguments)})},{key:"put",value:(u=p(a().mark(function t(e,n,r,s){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.request({method:"PUT",url:e,body:n,params:r,config:s});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t,this)})),function(t,e,n,r){return u.apply(this,arguments)})},{key:"patch",value:(c=p(a().mark(function t(e,n,r,s){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.request({method:"PATCH",url:e,body:n,params:r,config:s});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t,this)})),function(t,e,n,r){return c.apply(this,arguments)})},{key:"delete",value:(o=p(a().mark(function t(e,n,r,s){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.request({method:"DELETE",url:e,body:n,params:r,config:s});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t,this)})),function(t,e,n,r){return o.apply(this,arguments)})}]),f}(),q=d(function t(e){h(this,t),l(this,"taskUid",void 0),l(this,"indexUid",void 0),l(this,"status",void 0),l(this,"type",void 0),l(this,"enqueuedAt",void 0),this.taskUid=e.taskUid,this.indexUid=e.indexUid,this.status=e.status,this.type=e.type,this.enqueuedAt=new Date(e.enqueuedAt)}),C=d(function t(e){h(this,t),l(this,"indexUid",void 0),l(this,"status",void 0),l(this,"type",void 0),l(this,"uid",void 0),l(this,"canceledBy",void 0),l(this,"details",void 0),l(this,"error",void 0),l(this,"duration",void 0),l(this,"startedAt",void 0),l(this,"enqueuedAt",void 0),l(this,"finishedAt",void 0),this.indexUid=e.indexUid,this.status=e.status,this.type=e.type,this.uid=e.uid,this.details=e.details,this.canceledBy=e.canceledBy,this.error=e.error,this.duration=e.duration,this.startedAt=new Date(e.startedAt),this.enqueuedAt=new Date(e.enqueuedAt),this.finishedAt=new Date(e.finishedAt)}),M=function(){var t,n,r,s,u,c;function o(t){h(this,o),l(this,"httpRequest",void 0),this.httpRequest=new L(t)}return d(o,[{key:"getTask",value:(t=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="tasks/".concat(e),t.next=3,this.httpRequest.get(n);case 3:return r=t.sent,t.abrupt("return",new C(r));case 5:case"end":return t.stop()}},t,this)})),function(e){return t.apply(this,arguments)})},{key:"getTasks",value:(n=p(a().mark(function t(){var e,n,r=arguments;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=4,this.httpRequest.get("tasks",O(e));case 4:return n=t.sent,t.abrupt("return",i(i({},n),{},{results:n.results.map(function(t){return new C(t)})}));case 6:case"end":return t.stop()}},t,this)})),function(){return n.apply(this,arguments)})},{key:"waitForTask",value:(r=p(a().mark(function t(n){var r,s,i,u,c,o,p,h=arguments;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:i=void 0===(s=(r=h.length>1&&void 0!==h[1]?h[1]:{}).timeOutMs)?5e3:s,c=void 0===(u=r.intervalMs)?50:u,o=Date.now();case 2:if(!(Date.now()-o<i)){t.next=12;break}return t.next=5,this.getTask(n);case 5:if(p=t.sent,[e.TASK_ENQUEUED,e.TASK_PROCESSING].includes(p.status)){t.next=8;break}return t.abrupt("return",p);case 8:return t.next=10,function(t){return N.apply(this,arguments)}(c);case 10:t.next=2;break;case 12:throw new S("timeout of ".concat(i,"ms has exceeded on process ").concat(n," when waiting a task to be resolved."));case 13:case"end":return t.stop()}},t,this)})),function(t){return r.apply(this,arguments)})},{key:"waitForTasks",value:(s=p(a().mark(function t(e){var n,r,s,i,u,c,o,p,h,f,d=arguments;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:s=void 0===(r=(n=d.length>1&&void 0!==d[1]?d[1]:{}).timeOutMs)?5e3:r,u=void 0===(i=n.intervalMs)?50:i,c=[],o=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=g(t))){n&&(t=n);var r=0,s=function(){};return{s:s,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(e),t.prev=3,o.s();case 5:if((p=o.n()).done){t.next=13;break}return h=p.value,t.next=9,this.waitForTask(h,{timeOutMs:s,intervalMs:u});case 9:f=t.sent,c.push(f);case 11:t.next=5;break;case 13:t.next=18;break;case 15:t.prev=15,t.t0=t.catch(3),o.e(t.t0);case 18:return t.prev=18,o.f(),t.finish(18);case 21:return t.abrupt("return",c);case 22:case"end":return t.stop()}},t,this,[[3,15,18,21]])})),function(t){return s.apply(this,arguments)})},{key:"cancelTasks",value:(u=p(a().mark(function t(){var e,n,r=arguments;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=4,this.httpRequest.post("tasks/cancel",{},O(e));case 4:return n=t.sent,t.abrupt("return",new q(n));case 6:case"end":return t.stop()}},t,this)})),function(){return u.apply(this,arguments)})},{key:"deleteTasks",value:(c=p(a().mark(function t(){var e,n,r=arguments;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=4,this.httpRequest.delete("tasks",{},O(e));case 4:return n=t.sent,t.abrupt("return",new q(n));case 6:case"end":return t.stop()}},t,this)})),function(){return c.apply(this,arguments)})}]),o}(),P=function(){var t,e,n,r,s,u,o,f,v,_,y,w,x,m,k,A,g,I,S,N,O,C,P,U,F,V,j,K,G,H,Y,B,X,W,z,Q,J,Z,$,tt,te,tn,tr,ts,ti,ta,tu,tc,to,tp,th,tf,td,tl,tv,t_,ty,tw,tx,tm,tk,tA,tg,tI,tb,tE,tT,tS,tD,tR,tN,tO,tL,tq,tC,tM,tP,tU,tF,tV,tj,tK,tG,tH;function tY(t,e,n){h(this,tY),l(this,"uid",void 0),l(this,"primaryKey",void 0),l(this,"createdAt",void 0),l(this,"updatedAt",void 0),l(this,"httpRequest",void 0),l(this,"tasks",void 0),this.uid=e,this.primaryKey=n,this.httpRequest=new L(t),this.tasks=new M(t)}return d(tY,[{key:"search",value:(t=p(a().mark(function t(e,n,r){var s;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return s="indexes/".concat(this.uid,"/search"),t.next=3,this.httpRequest.post(s,R(i({q:e},n)),void 0,r);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(e,n,r){return t.apply(this,arguments)})},{key:"searchGet",value:(e=p(a().mark(function t(e,n,r){var s,u,c,o,p,h,f,d,l,v;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return d="indexes/".concat(this.uid,"/search"),l=function(t){if("string"==typeof t)return t;if(Array.isArray(t))throw new b("The filter query parameter should be in string format when using searchGet")},v=i(i({q:e},n),{},{filter:l(null==n?void 0:n.filter),sort:null==n?void 0:null===(s=n.sort)||void 0===s?void 0:s.join(","),facets:null==n?void 0:null===(u=n.facets)||void 0===u?void 0:u.join(","),attributesToRetrieve:null==n?void 0:null===(c=n.attributesToRetrieve)||void 0===c?void 0:c.join(","),attributesToCrop:null==n?void 0:null===(o=n.attributesToCrop)||void 0===o?void 0:o.join(","),attributesToHighlight:null==n?void 0:null===(p=n.attributesToHighlight)||void 0===p?void 0:p.join(","),vector:null==n?void 0:null===(h=n.vector)||void 0===h?void 0:h.join(","),attributesToSearchOn:null==n?void 0:null===(f=n.attributesToSearchOn)||void 0===f?void 0:f.join(",")}),t.next=5,this.httpRequest.get(d,R(v),r);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}},t,this)})),function(t,n,r){return e.apply(this,arguments)})},{key:"searchForFacetValues",value:(n=p(a().mark(function t(e,n){var r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r="indexes/".concat(this.uid,"/facet-search"),t.next=3,this.httpRequest.post(r,R(e),void 0,n);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(t,e){return n.apply(this,arguments)})},{key:"searchSimilarDocuments",value:(r=p(a().mark(function t(e){var n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/similar"),t.next=3,this.httpRequest.post(n,R(e),void 0);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(t){return r.apply(this,arguments)})},{key:"getRawInfo",value:(s=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid),t.next=3,this.httpRequest.get(e);case 3:return n=t.sent,this.primaryKey=n.primaryKey,this.updatedAt=new Date(n.updatedAt),this.createdAt=new Date(n.createdAt),t.abrupt("return",n);case 8:case"end":return t.stop()}},t,this)})),function(){return s.apply(this,arguments)})},{key:"fetchInfo",value:(u=p(a().mark(function t(){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getRawInfo();case 2:return t.abrupt("return",this);case 3:case"end":return t.stop()}},t,this)})),function(){return u.apply(this,arguments)})},{key:"fetchPrimaryKey",value:(o=p(a().mark(function t(){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getRawInfo();case 2:return this.primaryKey=t.sent.primaryKey,t.abrupt("return",this.primaryKey);case 4:case"end":return t.stop()}},t,this)})),function(){return o.apply(this,arguments)})},{key:"update",value:(f=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid),t.next=3,this.httpRequest.patch(n,e);case 3:return(r=t.sent).enqueuedAt=new Date(r.enqueuedAt),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)})),function(t){return f.apply(this,arguments)})},{key:"delete",value:(v=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid),t.next=3,this.httpRequest.delete(e);case 3:return n=t.sent,t.abrupt("return",new q(n));case 5:case"end":return t.stop()}},t,this)})),function(){return v.apply(this,arguments)})},{key:"getTasks",value:(_=p(a().mark(function t(){var e,n=arguments;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},t.next=3,this.tasks.getTasks(i(i({},e),{},{indexUids:[this.uid]}));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return _.apply(this,arguments)})},{key:"getTask",value:(y=p(a().mark(function t(e){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.tasks.getTask(e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t,this)})),function(t){return y.apply(this,arguments)})},{key:"waitForTasks",value:(w=p(a().mark(function t(e){var n,r,s,i,u,c=arguments;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return s=void 0===(r=(n=c.length>1&&void 0!==c[1]?c[1]:{}).timeOutMs)?5e3:r,u=void 0===(i=n.intervalMs)?50:i,t.next=3,this.tasks.waitForTasks(e,{timeOutMs:s,intervalMs:u});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(t){return w.apply(this,arguments)})},{key:"waitForTask",value:(x=p(a().mark(function t(e){var n,r,s,i,u,c=arguments;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return s=void 0===(r=(n=c.length>1&&void 0!==c[1]?c[1]:{}).timeOutMs)?5e3:r,u=void 0===(i=n.intervalMs)?50:i,t.next=3,this.tasks.waitForTask(e,{timeOutMs:s,intervalMs:u});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(t){return x.apply(this,arguments)})},{key:"getStats",value:(m=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/stats"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return m.apply(this,arguments)})},{key:"getDocuments",value:(k=p(a().mark(function t(){var e,n,r,s,u,c,o,p=arguments;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(void 0!==(e=R(e=p.length>0&&void 0!==p[0]?p[0]:{})).filter)){t.next=16;break}return t.prev=3,n="indexes/".concat(this.uid,"/documents/fetch"),t.next=7,this.httpRequest.post(n,e);case 7:case 20:return t.abrupt("return",t.sent);case 10:throw t.prev=10,t.t0=t.catch(3),t.t0 instanceof T?t.t0.message=D(t.t0.message,"getDocuments"):t.t0 instanceof E&&(t.t0.message=D(t.t0.message,"getDocuments")),t.t0;case 14:t.next=21;break;case 16:return c="indexes/".concat(this.uid,"/documents"),o=Array.isArray(null===(r=e)||void 0===r?void 0:r.fields)?{fields:null===(s=e)||void 0===s?void 0:null===(u=s.fields)||void 0===u?void 0:u.join(",")}:{},t.next=20,this.httpRequest.get(c,i(i({},e),o));case 21:case"end":return t.stop()}},t,this,[[3,10]])})),function(){return k.apply(this,arguments)})},{key:"getDocument",value:(A=p(a().mark(function t(e,n){var r,s;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r="indexes/".concat(this.uid,"/documents/").concat(e),s=function(){if(Array.isArray(null==n?void 0:n.fields)){var t;return null==n?void 0:null===(t=n.fields)||void 0===t?void 0:t.join(",")}}(),t.next=4,this.httpRequest.get(r,R(i(i({},n),{},{fields:s})));case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}},t,this)})),function(t,e){return A.apply(this,arguments)})},{key:"addDocuments",value:(g=p(a().mark(function t(e,n){var r,s;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r="indexes/".concat(this.uid,"/documents"),t.next=3,this.httpRequest.post(r,e,n);case 3:return s=t.sent,t.abrupt("return",new q(s));case 5:case"end":return t.stop()}},t,this)})),function(t,e){return g.apply(this,arguments)})},{key:"addDocumentsFromString",value:(I=p(a().mark(function t(e,n,r){var s,i;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return s="indexes/".concat(this.uid,"/documents"),t.next=3,this.httpRequest.post(s,e,r,{headers:{"Content-Type":n}});case 3:return i=t.sent,t.abrupt("return",new q(i));case 5:case"end":return t.stop()}},t,this)})),function(t,e,n){return I.apply(this,arguments)})},{key:"addDocumentsInBatches",value:(S=p(a().mark(function t(e){var n,r,s,i,u=arguments;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n=u.length>1&&void 0!==u[1]?u[1]:1e3,r=u.length>2?u[2]:void 0,s=[],i=0;case 4:if(!(i<e.length)){t.next=13;break}return t.t0=s,t.next=8,this.addDocuments(e.slice(i,i+n),r);case 8:t.t1=t.sent,t.t0.push.call(t.t0,t.t1);case 10:i+=n,t.next=4;break;case 13:return t.abrupt("return",s);case 14:case"end":return t.stop()}},t,this)})),function(t){return S.apply(this,arguments)})},{key:"updateDocuments",value:(N=p(a().mark(function t(e,n){var r,s;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r="indexes/".concat(this.uid,"/documents"),t.next=3,this.httpRequest.put(r,e,n);case 3:return s=t.sent,t.abrupt("return",new q(s));case 5:case"end":return t.stop()}},t,this)})),function(t,e){return N.apply(this,arguments)})},{key:"updateDocumentsInBatches",value:(O=p(a().mark(function t(e){var n,r,s,i,u=arguments;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n=u.length>1&&void 0!==u[1]?u[1]:1e3,r=u.length>2?u[2]:void 0,s=[],i=0;case 4:if(!(i<e.length)){t.next=13;break}return t.t0=s,t.next=8,this.updateDocuments(e.slice(i,i+n),r);case 8:t.t1=t.sent,t.t0.push.call(t.t0,t.t1);case 10:i+=n,t.next=4;break;case 13:return t.abrupt("return",s);case 14:case"end":return t.stop()}},t,this)})),function(t){return O.apply(this,arguments)})},{key:"updateDocumentsFromString",value:(C=p(a().mark(function t(e,n,r){var s,i;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return s="indexes/".concat(this.uid,"/documents"),t.next=3,this.httpRequest.put(s,e,r,{headers:{"Content-Type":n}});case 3:return i=t.sent,t.abrupt("return",new q(i));case 5:case"end":return t.stop()}},t,this)})),function(t,e,n){return C.apply(this,arguments)})},{key:"deleteDocument",value:(P=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/documents/").concat(e),t.next=3,this.httpRequest.delete(n);case 3:return(r=t.sent).enqueuedAt=new Date(r.enqueuedAt),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)})),function(t){return P.apply(this,arguments)})},{key:"deleteDocuments",value:(U=p(a().mark(function t(e){var n,r,s,i;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=(n=!Array.isArray(e)&&"object"===c(e))?"documents/delete":"documents/delete-batch",s="indexes/".concat(this.uid,"/").concat(r),t.prev=3,t.next=6,this.httpRequest.post(s,e);case 6:return i=t.sent,t.abrupt("return",new q(i));case 10:throw t.prev=10,t.t0=t.catch(3),t.t0 instanceof T&&n?t.t0.message=D(t.t0.message,"deleteDocuments"):t.t0 instanceof E&&(t.t0.message=D(t.t0.message,"deleteDocuments")),t.t0;case 14:case"end":return t.stop()}},t,this,[[3,10]])})),function(t){return U.apply(this,arguments)})},{key:"deleteAllDocuments",value:(F=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/documents"),t.next=3,this.httpRequest.delete(e);case 3:return(n=t.sent).enqueuedAt=new Date(n.enqueuedAt),t.abrupt("return",n);case 6:case"end":return t.stop()}},t,this)})),function(){return F.apply(this,arguments)})},{key:"updateDocumentsByFunction",value:(V=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/documents/edit"),t.next=3,this.httpRequest.post(n,e);case 3:return r=t.sent,t.abrupt("return",new q(r));case 5:case"end":return t.stop()}},t,this)})),function(t){return V.apply(this,arguments)})},{key:"getSettings",value:(j=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return j.apply(this,arguments)})},{key:"updateSettings",value:(K=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/settings"),t.next=3,this.httpRequest.patch(n,e);case 3:return(r=t.sent).enqueued=new Date(r.enqueuedAt),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)})),function(t){return K.apply(this,arguments)})},{key:"resetSettings",value:(G=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings"),t.next=3,this.httpRequest.delete(e);case 3:return(n=t.sent).enqueuedAt=new Date(n.enqueuedAt),t.abrupt("return",n);case 6:case"end":return t.stop()}},t,this)})),function(){return G.apply(this,arguments)})},{key:"getPagination",value:(H=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/pagination"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return H.apply(this,arguments)})},{key:"updatePagination",value:(Y=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/settings/pagination"),t.next=3,this.httpRequest.patch(n,e);case 3:return r=t.sent,t.abrupt("return",new q(r));case 5:case"end":return t.stop()}},t,this)})),function(t){return Y.apply(this,arguments)})},{key:"resetPagination",value:(B=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/pagination"),t.next=3,this.httpRequest.delete(e);case 3:return n=t.sent,t.abrupt("return",new q(n));case 5:case"end":return t.stop()}},t,this)})),function(){return B.apply(this,arguments)})},{key:"getSynonyms",value:(X=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/synonyms"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return X.apply(this,arguments)})},{key:"updateSynonyms",value:(W=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/settings/synonyms"),t.next=3,this.httpRequest.put(n,e);case 3:return r=t.sent,t.abrupt("return",new q(r));case 5:case"end":return t.stop()}},t,this)})),function(t){return W.apply(this,arguments)})},{key:"resetSynonyms",value:(z=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/synonyms"),t.next=3,this.httpRequest.delete(e);case 3:return(n=t.sent).enqueuedAt=new Date(n.enqueuedAt),t.abrupt("return",n);case 6:case"end":return t.stop()}},t,this)})),function(){return z.apply(this,arguments)})},{key:"getStopWords",value:(Q=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/stop-words"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return Q.apply(this,arguments)})},{key:"updateStopWords",value:(J=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/settings/stop-words"),t.next=3,this.httpRequest.put(n,e);case 3:return r=t.sent,t.abrupt("return",new q(r));case 5:case"end":return t.stop()}},t,this)})),function(t){return J.apply(this,arguments)})},{key:"resetStopWords",value:(Z=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/stop-words"),t.next=3,this.httpRequest.delete(e);case 3:return(n=t.sent).enqueuedAt=new Date(n.enqueuedAt),t.abrupt("return",n);case 6:case"end":return t.stop()}},t,this)})),function(){return Z.apply(this,arguments)})},{key:"getRankingRules",value:($=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/ranking-rules"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return $.apply(this,arguments)})},{key:"updateRankingRules",value:(tt=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/settings/ranking-rules"),t.next=3,this.httpRequest.put(n,e);case 3:return r=t.sent,t.abrupt("return",new q(r));case 5:case"end":return t.stop()}},t,this)})),function(t){return tt.apply(this,arguments)})},{key:"resetRankingRules",value:(te=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/ranking-rules"),t.next=3,this.httpRequest.delete(e);case 3:return(n=t.sent).enqueuedAt=new Date(n.enqueuedAt),t.abrupt("return",n);case 6:case"end":return t.stop()}},t,this)})),function(){return te.apply(this,arguments)})},{key:"getDistinctAttribute",value:(tn=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/distinct-attribute"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return tn.apply(this,arguments)})},{key:"updateDistinctAttribute",value:(tr=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/settings/distinct-attribute"),t.next=3,this.httpRequest.put(n,e);case 3:return r=t.sent,t.abrupt("return",new q(r));case 5:case"end":return t.stop()}},t,this)})),function(t){return tr.apply(this,arguments)})},{key:"resetDistinctAttribute",value:(ts=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/distinct-attribute"),t.next=3,this.httpRequest.delete(e);case 3:return(n=t.sent).enqueuedAt=new Date(n.enqueuedAt),t.abrupt("return",n);case 6:case"end":return t.stop()}},t,this)})),function(){return ts.apply(this,arguments)})},{key:"getFilterableAttributes",value:(ti=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/filterable-attributes"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return ti.apply(this,arguments)})},{key:"updateFilterableAttributes",value:(ta=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/settings/filterable-attributes"),t.next=3,this.httpRequest.put(n,e);case 3:return r=t.sent,t.abrupt("return",new q(r));case 5:case"end":return t.stop()}},t,this)})),function(t){return ta.apply(this,arguments)})},{key:"resetFilterableAttributes",value:(tu=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/filterable-attributes"),t.next=3,this.httpRequest.delete(e);case 3:return(n=t.sent).enqueuedAt=new Date(n.enqueuedAt),t.abrupt("return",n);case 6:case"end":return t.stop()}},t,this)})),function(){return tu.apply(this,arguments)})},{key:"getSortableAttributes",value:(tc=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/sortable-attributes"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return tc.apply(this,arguments)})},{key:"updateSortableAttributes",value:(to=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/settings/sortable-attributes"),t.next=3,this.httpRequest.put(n,e);case 3:return r=t.sent,t.abrupt("return",new q(r));case 5:case"end":return t.stop()}},t,this)})),function(t){return to.apply(this,arguments)})},{key:"resetSortableAttributes",value:(tp=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/sortable-attributes"),t.next=3,this.httpRequest.delete(e);case 3:return(n=t.sent).enqueuedAt=new Date(n.enqueuedAt),t.abrupt("return",n);case 6:case"end":return t.stop()}},t,this)})),function(){return tp.apply(this,arguments)})},{key:"getSearchableAttributes",value:(th=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/searchable-attributes"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return th.apply(this,arguments)})},{key:"updateSearchableAttributes",value:(tf=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/settings/searchable-attributes"),t.next=3,this.httpRequest.put(n,e);case 3:return r=t.sent,t.abrupt("return",new q(r));case 5:case"end":return t.stop()}},t,this)})),function(t){return tf.apply(this,arguments)})},{key:"resetSearchableAttributes",value:(td=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/searchable-attributes"),t.next=3,this.httpRequest.delete(e);case 3:return(n=t.sent).enqueuedAt=new Date(n.enqueuedAt),t.abrupt("return",n);case 6:case"end":return t.stop()}},t,this)})),function(){return td.apply(this,arguments)})},{key:"getDisplayedAttributes",value:(tl=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/displayed-attributes"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return tl.apply(this,arguments)})},{key:"updateDisplayedAttributes",value:(tv=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/settings/displayed-attributes"),t.next=3,this.httpRequest.put(n,e);case 3:return r=t.sent,t.abrupt("return",new q(r));case 5:case"end":return t.stop()}},t,this)})),function(t){return tv.apply(this,arguments)})},{key:"resetDisplayedAttributes",value:(t_=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/displayed-attributes"),t.next=3,this.httpRequest.delete(e);case 3:return(n=t.sent).enqueuedAt=new Date(n.enqueuedAt),t.abrupt("return",n);case 6:case"end":return t.stop()}},t,this)})),function(){return t_.apply(this,arguments)})},{key:"getTypoTolerance",value:(ty=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/typo-tolerance"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return ty.apply(this,arguments)})},{key:"updateTypoTolerance",value:(tw=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/settings/typo-tolerance"),t.next=3,this.httpRequest.patch(n,e);case 3:return(r=t.sent).enqueuedAt=new Date(r.enqueuedAt),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)})),function(t){return tw.apply(this,arguments)})},{key:"resetTypoTolerance",value:(tx=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/typo-tolerance"),t.next=3,this.httpRequest.delete(e);case 3:return(n=t.sent).enqueuedAt=new Date(n.enqueuedAt),t.abrupt("return",n);case 6:case"end":return t.stop()}},t,this)})),function(){return tx.apply(this,arguments)})},{key:"getFaceting",value:(tm=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/faceting"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return tm.apply(this,arguments)})},{key:"updateFaceting",value:(tk=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/settings/faceting"),t.next=3,this.httpRequest.patch(n,e);case 3:return r=t.sent,t.abrupt("return",new q(r));case 5:case"end":return t.stop()}},t,this)})),function(t){return tk.apply(this,arguments)})},{key:"resetFaceting",value:(tA=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/faceting"),t.next=3,this.httpRequest.delete(e);case 3:return n=t.sent,t.abrupt("return",new q(n));case 5:case"end":return t.stop()}},t,this)})),function(){return tA.apply(this,arguments)})},{key:"getSeparatorTokens",value:(tg=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/separator-tokens"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return tg.apply(this,arguments)})},{key:"updateSeparatorTokens",value:(tI=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/settings/separator-tokens"),t.next=3,this.httpRequest.put(n,e);case 3:return r=t.sent,t.abrupt("return",new q(r));case 5:case"end":return t.stop()}},t,this)})),function(t){return tI.apply(this,arguments)})},{key:"resetSeparatorTokens",value:(tb=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/separator-tokens"),t.next=3,this.httpRequest.delete(e);case 3:return(n=t.sent).enqueuedAt=new Date(n.enqueuedAt),t.abrupt("return",n);case 6:case"end":return t.stop()}},t,this)})),function(){return tb.apply(this,arguments)})},{key:"getNonSeparatorTokens",value:(tE=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/non-separator-tokens"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return tE.apply(this,arguments)})},{key:"updateNonSeparatorTokens",value:(tT=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/settings/non-separator-tokens"),t.next=3,this.httpRequest.put(n,e);case 3:return r=t.sent,t.abrupt("return",new q(r));case 5:case"end":return t.stop()}},t,this)})),function(t){return tT.apply(this,arguments)})},{key:"resetNonSeparatorTokens",value:(tS=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/non-separator-tokens"),t.next=3,this.httpRequest.delete(e);case 3:return(n=t.sent).enqueuedAt=new Date(n.enqueuedAt),t.abrupt("return",n);case 6:case"end":return t.stop()}},t,this)})),function(){return tS.apply(this,arguments)})},{key:"getDictionary",value:(tD=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/dictionary"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return tD.apply(this,arguments)})},{key:"updateDictionary",value:(tR=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/settings/dictionary"),t.next=3,this.httpRequest.put(n,e);case 3:return r=t.sent,t.abrupt("return",new q(r));case 5:case"end":return t.stop()}},t,this)})),function(t){return tR.apply(this,arguments)})},{key:"resetDictionary",value:(tN=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/dictionary"),t.next=3,this.httpRequest.delete(e);case 3:return(n=t.sent).enqueuedAt=new Date(n.enqueuedAt),t.abrupt("return",n);case 6:case"end":return t.stop()}},t,this)})),function(){return tN.apply(this,arguments)})},{key:"getProximityPrecision",value:(tO=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/proximity-precision"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return tO.apply(this,arguments)})},{key:"updateProximityPrecision",value:(tL=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/settings/proximity-precision"),t.next=3,this.httpRequest.put(n,e);case 3:return r=t.sent,t.abrupt("return",new q(r));case 5:case"end":return t.stop()}},t,this)})),function(t){return tL.apply(this,arguments)})},{key:"resetProximityPrecision",value:(tq=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/proximity-precision"),t.next=3,this.httpRequest.delete(e);case 3:return(n=t.sent).enqueuedAt=new Date(n.enqueuedAt),t.abrupt("return",n);case 6:case"end":return t.stop()}},t,this)})),function(){return tq.apply(this,arguments)})},{key:"getEmbedders",value:(tC=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/embedders"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return tC.apply(this,arguments)})},{key:"updateEmbedders",value:(tM=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/settings/embedders"),t.next=3,this.httpRequest.patch(n,e);case 3:return r=t.sent,t.abrupt("return",new q(r));case 5:case"end":return t.stop()}},t,this)})),function(t){return tM.apply(this,arguments)})},{key:"resetEmbedders",value:(tP=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/embedders"),t.next=3,this.httpRequest.delete(e);case 3:return(n=t.sent).enqueuedAt=new Date(n.enqueuedAt),t.abrupt("return",n);case 6:case"end":return t.stop()}},t,this)})),function(){return tP.apply(this,arguments)})},{key:"getSearchCutoffMs",value:(tU=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/search-cutoff-ms"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return tU.apply(this,arguments)})},{key:"updateSearchCutoffMs",value:(tF=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/settings/search-cutoff-ms"),t.next=3,this.httpRequest.put(n,e);case 3:return r=t.sent,t.abrupt("return",new q(r));case 5:case"end":return t.stop()}},t,this)})),function(t){return tF.apply(this,arguments)})},{key:"resetSearchCutoffMs",value:(tV=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/search-cutoff-ms"),t.next=3,this.httpRequest.delete(e);case 3:return n=t.sent,t.abrupt("return",new q(n));case 5:case"end":return t.stop()}},t,this)})),function(){return tV.apply(this,arguments)})},{key:"getLocalizedAttributes",value:(tj=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/localized-attributes"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return tj.apply(this,arguments)})},{key:"updateLocalizedAttributes",value:(tK=p(a().mark(function t(e){var n,r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="indexes/".concat(this.uid,"/settings/localized-attributes"),t.next=3,this.httpRequest.put(n,e);case 3:return r=t.sent,t.abrupt("return",new q(r));case 5:case"end":return t.stop()}},t,this)})),function(t){return tK.apply(this,arguments)})},{key:"resetLocalizedAttributes",value:(tG=p(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/localized-attributes"),t.next=3,this.httpRequest.delete(e);case 3:return n=t.sent,t.abrupt("return",new q(n));case 5:case"end":return t.stop()}},t,this)})),function(){return tG.apply(this,arguments)})}],[{key:"create",value:(tH=p(a().mark(function t(e){var n,r,s,u=arguments;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=u.length>1&&void 0!==u[1]?u[1]:{},r=new L(u.length>2?u[2]:void 0),t.next=6,r.post("indexes",i(i({},n),{},{uid:e}));case 6:return s=t.sent,t.abrupt("return",new q(s));case 8:case"end":return t.stop()}},t)})),function(t){return tH.apply(this,arguments)})}]),tY}(),U=function(t){v(n,t);var e=A(n);function n(t){return h(this,n),e.call(this,t)}return d(n)}(function(){var t,e,n,s,u,c,o,f,v,_,y,w,x,m,k,A,g,I,b,E,T,S,D,R,N,O,C;function U(t){h(this,U),l(this,"config",void 0),l(this,"httpRequest",void 0),l(this,"tasks",void 0),this.config=t,this.httpRequest=new L(t),this.tasks=new M(t)}return d(U,[{key:"index",value:function(t){return new P(this.config,t)}},{key:"getIndex",value:(t=p(a().mark(function t(e){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new P(this.config,e).fetchInfo());case 1:case"end":return t.stop()}},t,this)})),function(e){return t.apply(this,arguments)})},{key:"getRawIndex",value:(e=p(a().mark(function t(e){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new P(this.config,e).getRawInfo());case 1:case"end":return t.stop()}},t,this)})),function(t){return e.apply(this,arguments)})},{key:"getIndexes",value:(n=p(a().mark(function t(){var e,n,r,s=this,u=arguments;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=u.length>0&&void 0!==u[0]?u[0]:{},t.next=3,this.getRawIndexes(e);case 3:return r=(n=t.sent).results.map(function(t){return new P(s.config,t.uid,t.primaryKey)}),t.abrupt("return",i(i({},n),{},{results:r}));case 6:case"end":return t.stop()}},t,this)})),function(){return n.apply(this,arguments)})},{key:"getRawIndexes",value:(s=p(a().mark(function t(){var e,n=arguments;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},t.next=4,this.httpRequest.get("indexes",e);case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}},t,this)})),function(){return s.apply(this,arguments)})},{key:"createIndex",value:(u=p(a().mark(function t(e){var n,r=arguments;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},t.next=3,P.create(e,n,this.config);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(t){return u.apply(this,arguments)})},{key:"updateIndex",value:(c=p(a().mark(function t(e){var n,r=arguments;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},t.next=3,new P(this.config,e).update(n);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(t){return c.apply(this,arguments)})},{key:"deleteIndex",value:(o=p(a().mark(function t(e){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new P(this.config,e).delete();case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t,this)})),function(t){return o.apply(this,arguments)})},{key:"deleteIndexIfExists",value:(f=p(a().mark(function t(e){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.deleteIndex(e);case 3:return t.abrupt("return",!0);case 6:if(t.prev=6,t.t0=t.catch(0),t.t0.code!==r.INDEX_NOT_FOUND){t.next=10;break}return t.abrupt("return",!1);case 10:throw t.t0;case 11:case"end":return t.stop()}},t,this,[[0,6]])})),function(t){return f.apply(this,arguments)})},{key:"swapIndexes",value:(v=p(a().mark(function t(e){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=3,this.httpRequest.post("/swap-indexes",e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(t){return v.apply(this,arguments)})},{key:"multiSearch",value:(_=p(a().mark(function t(e,n){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=3,this.httpRequest.post("multi-search",e,void 0,n);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(t,e){return _.apply(this,arguments)})},{key:"getTasks",value:(y=p(a().mark(function t(){var e,n=arguments;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},t.next=3,this.tasks.getTasks(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return y.apply(this,arguments)})},{key:"getTask",value:(w=p(a().mark(function t(e){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.tasks.getTask(e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t,this)})),function(t){return w.apply(this,arguments)})},{key:"waitForTasks",value:(x=p(a().mark(function t(e){var n,r,s,i,u,c=arguments;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return s=void 0===(r=(n=c.length>1&&void 0!==c[1]?c[1]:{}).timeOutMs)?5e3:r,u=void 0===(i=n.intervalMs)?50:i,t.next=3,this.tasks.waitForTasks(e,{timeOutMs:s,intervalMs:u});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(t){return x.apply(this,arguments)})},{key:"waitForTask",value:(m=p(a().mark(function t(e){var n,r,s,i,u,c=arguments;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return s=void 0===(r=(n=c.length>1&&void 0!==c[1]?c[1]:{}).timeOutMs)?5e3:r,u=void 0===(i=n.intervalMs)?50:i,t.next=3,this.tasks.waitForTask(e,{timeOutMs:s,intervalMs:u});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(t){return m.apply(this,arguments)})},{key:"cancelTasks",value:(k=p(a().mark(function t(e){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.tasks.cancelTasks(e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t,this)})),function(t){return k.apply(this,arguments)})},{key:"deleteTasks",value:(A=p(a().mark(function t(){var e,n=arguments;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},t.next=3,this.tasks.deleteTasks(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return A.apply(this,arguments)})},{key:"getKeys",value:(g=p(a().mark(function t(){var e,n,r=arguments;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=4,this.httpRequest.get("keys",e);case 4:return(n=t.sent).results=n.results.map(function(t){return i(i({},t),{},{createdAt:new Date(t.createdAt),updatedAt:new Date(t.updatedAt)})}),t.abrupt("return",n);case 7:case"end":return t.stop()}},t,this)})),function(){return g.apply(this,arguments)})},{key:"getKey",value:(I=p(a().mark(function t(e){var n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="keys/".concat(e),t.next=3,this.httpRequest.get(n);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(t){return I.apply(this,arguments)})},{key:"createKey",value:(b=p(a().mark(function t(e){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=3,this.httpRequest.post("keys",e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(t){return b.apply(this,arguments)})},{key:"updateKey",value:(E=p(a().mark(function t(e,n){var r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r="keys/".concat(e),t.next=3,this.httpRequest.patch(r,n);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(t,e){return E.apply(this,arguments)})},{key:"deleteKey",value:(T=p(a().mark(function t(e){var n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="keys/".concat(e),t.next=3,this.httpRequest.delete(n);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(t){return T.apply(this,arguments)})},{key:"health",value:(S=p(a().mark(function t(){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=3,this.httpRequest.get("health");case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return S.apply(this,arguments)})},{key:"isHealthy",value:(D=p(a().mark(function t(){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=4,this.httpRequest.get("health");case 4:return t.abrupt("return",!0);case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",!1);case 10:case"end":return t.stop()}},t,this,[[0,7]])})),function(){return D.apply(this,arguments)})},{key:"getStats",value:(R=p(a().mark(function t(){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=3,this.httpRequest.get("stats");case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return R.apply(this,arguments)})},{key:"getVersion",value:(N=p(a().mark(function t(){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=3,this.httpRequest.get("version");case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)})),function(){return N.apply(this,arguments)})},{key:"createDump",value:(O=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=3,this.httpRequest.post("dumps");case 3:return e=t.sent,t.abrupt("return",new q(e));case 5:case"end":return t.stop()}},t,this)})),function(){return O.apply(this,arguments)})},{key:"createSnapshot",value:(C=p(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=3,this.httpRequest.post("snapshots");case 3:return e=t.sent,t.abrupt("return",new q(e));case 5:case"end":return t.stop()}},t,this)})),function(){return C.apply(this,arguments)})},{key:"generateTenantToken",value:function(t,e,n){var r=Error();return r.message="Meilisearch: failed to generate a tenant token. Generation of a token only works in a node environment \n ".concat(r.stack,"."),Promise.reject(r)}}]),U}());t.ContentTypeEnum={JSON:"application/json",CSV:"text/csv",NDJSON:"application/x-ndjson"},t.ErrorStatusCode=r,t.Index=P,t.MatchingStrategies={ALL:"all",LAST:"last",FREQUENCY:"frequency"},t.MeiliSearch=U,t.MeiliSearchApiError=E,t.MeiliSearchError=b,t.MeiliSearchRequestError=T,t.MeiliSearchTimeOutError=S,t.Meilisearch=U,t.TaskStatus=e,t.TaskTypes={DOCUMENTS_ADDITION_OR_UPDATE:"documentAdditionOrUpdate",DOCUMENT_DELETION:"documentDeletion",DUMP_CREATION:"dumpCreation",INDEX_CREATION:"indexCreation",INDEX_DELETION:"indexDeletion",INDEXES_SWAP:"indexSwap",INDEX_UPDATE:"indexUpdate",SETTINGS_UPDATE:"settingsUpdate",SNAPSHOT_CREATION:"snapshotCreation",TASK_CANCELATION:"taskCancelation",TASK_DELETION:"taskDeletion"},t.default=U,t.versionErrorHintMessage=D,Object.defineProperty(t,"__esModule",{value:!0})}(e)}}]);