Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@meilisearch/instant-meilisearch

Package Overview
Dependencies
Maintainers
5
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@meilisearch/instant-meilisearch - npm Package Compare versions

Comparing version 0.18.0 to 0.18.1

2

dist/instant-meilisearch.cjs.js

@@ -1019,3 +1019,3 @@ 'use strict';

var PACKAGE_VERSION = '0.18.0';
var PACKAGE_VERSION = '0.18.1';

@@ -1022,0 +1022,0 @@ var constructClientAgents = function (clientAgents) {

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("meilisearch");function e(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}})),e.default=t,Object.freeze(e)}var r=e(t),n=function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)};function i(t,e,r,n){return new(r||(r=Promise))((function(i,a){function o(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,u)}c((n=n.apply(t,e||[])).next())}))}function a(t,e){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(c){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=e.call(t,o)}catch(t){u=[6,t],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}function o(t){return"object"==typeof t&&!Array.isArray(t)&&null!==t}"function"==typeof SuppressedError&&SuppressedError;var u=/([\\"])/g;function c(t){return t.replace(u,"\\$1")}function s(t){var e=c(t),r=e.indexOf(":"),n=e.slice(0,r),i=e.slice(r+1);return'"'.concat(n,'"="').concat(i,'"')}function l(t){var e=function(){var e=t.match(/^([^<!>:=]*)([<!>:=]+)(.*)$/);if(e){var r=e.slice(1),n=r[0],i=r[1],a=r[2],o=(i.match(/^([<!>]?=|<|>|:){1}(.*)/)||["",""]).slice(1);return[n,o[0],o[1]+a]}return[t,"",""]}(),r=e[0],n=e[1],i=e[2],a=c(r);return'"'.concat(a.trim(),'"').concat(":"===n?" ":n).concat(i.trim())}function d(t,e){return"string"==typeof e?t(e):e.map((function(e){return"string"==typeof e?t(e):e.map((function(e){return t(e)}))}))}function f(t){return"string"==typeof t?[t]:t}function h(t,e,r){return function(t,e,r){var n=f(e),i=f(r),a=[];return void 0!==t&&a.push(t),void 0!==n&&a.push.apply(a,n),void 0!==i&&a.push.apply(a,i),a}(t,void 0!==e?d(l,e):e,void 0!==r?d(s,r):r)}function g(t){var e=t.query,r=t.indexUid,n=t.facets,i=t.attributesToSnippet,a=t.snippetEllipsisText,o=t.filters,u=t.numericFilters,c=t.facetFilters,s=t.attributesToRetrieve,l=t.attributesToHighlight,d=t.highlightPreTag,f=t.highlightPostTag,g=t.placeholderSearch,p=t.pagination,v=t.sort,y=t.restrictSearchableAttributes,m=t.meiliSearchParams,b={indexUid:r},P=h(o,u,c);return{getParams:function(){return b},addQuery:function(){b.q=e},addFacets:function(){var t=n;void 0!==t&&(b.facets="string"==typeof t?[t]:t)},addAttributesToCrop:function(){var t,e=null!==(t=null==m?void 0:m.attributesToCrop)&&void 0!==t?t:i;void 0!==e&&(b.attributesToCrop=e)},addCropLength:function(){var t=null==m?void 0:m.cropLength;void 0!==t&&(b.cropLength=t)},addCropMarker:function(){var t,e=null!==(t=null==m?void 0:m.cropMarker)&&void 0!==t?t:a;void 0!==e&&(b.cropMarker=e)},addFilters:function(){P.length&&(b.filter=P)},addAttributesToRetrieve:function(){var t,e=null!==(t=null==m?void 0:m.attributesToRetrieve)&&void 0!==t?t:s;void 0!==e&&(b.attributesToRetrieve=e)},addAttributesToHighlight:function(){var t,e;b.attributesToHighlight=null!==(e=null!==(t=null==m?void 0:m.attributesToHighlight)&&void 0!==t?t:l)&&void 0!==e?e:["*"]},addPreTag:function(){var t,e;b.highlightPreTag=null!==(e=null!==(t=null==m?void 0:m.highlightPreTag)&&void 0!==t?t:d)&&void 0!==e?e:"__ais-highlight__"},addPostTag:function(){var t,e;b.highlightPostTag=null!==(e=null!==(t=null==m?void 0:m.highlightPostTag)&&void 0!==t?t:f)&&void 0!==e?e:"__/ais-highlight__"},addPagination:function(){var t=function(t,e,r){return!!(r||e||t&&0!==t.length)}(P,e,g);if(p.finite){var r=function(t,e){var r=t.page,n=t.hitsPerPage;return e?{hitsPerPage:n,page:r+1}:{hitsPerPage:0,page:r+1}}(p,t),n=r.hitsPerPage,i=r.page;b.hitsPerPage=n,b.page=i}else{var a=function(t,e){var r=t.page,n=t.hitsPerPage;return e?{limit:n+1,offset:r*n}:{limit:0,offset:0}}(p,t),o=a.limit,u=a.offset;b.limit=o,b.offset=u}},addSort:function(){(null==v?void 0:v.length)&&(b.sort=Array.isArray(v)?v:[v])},addGeoSearchFilter:function(){var e=function(t){var e,r,n,i=t.insideBoundingBox,a=t.aroundLatLng,o=t.aroundRadius,u=t.minimumAroundRadius;if(a){var c=a.split(",").map((function(t){return Number.parseFloat(t).toFixed(5)}));e=[g=c[0],p=c[1]]}if(null==o&&null==u||("all"===o?console.warn("instant-meilisearch is not compatible with the `all` value on the aroundRadius parameter"):r=null!=o?o:u),i&&"string"==typeof i){var s=i.split(",").map((function(t){return parseFloat(t)})),l=s[0],d=s[1],f=s[2],h=s[3];n="_geoBoundingBox([".concat(l,", ").concat(d,"], [").concat(f,", ").concat(h,"])")}else if(null!=e&&null!=r){var g=e[0],p=e[1];n="_geoRadius(".concat(g,", ").concat(p,", ").concat(r,")")}return n}({insideBoundingBox:t.insideBoundingBox,aroundLatLng:t.aroundLatLng,aroundRadius:t.aroundRadius,minimumAroundRadius:t.minimumAroundRadius});void 0!==e&&(Array.isArray(b.filter)?b.filter.unshift(e):b.filter=[e])},addShowMatchesPosition:function(){var t=null==m?void 0:m.showMatchesPosition;void 0!==t&&(b.showMatchesPosition=t)},addMatchingStrategy:function(){var t=null==m?void 0:m.matchingStrategy;void 0!==t&&(b.matchingStrategy=t)},addShowRankingScore:function(){var t=null==m?void 0:m.showRankingScore;void 0!==t&&(b.showRankingScore=t)},addAttributesToSearchOn:function(){var t=void 0!==(null==m?void 0:m.attributesToSearchOn)?m.attributesToSearchOn:y;void 0!==t&&(b.attributesToSearchOn=t)},addHybridSearch:function(){var t=null==m?void 0:m.hybrid;void 0!==t&&(b.hybrid=t)}}}function p(t){var e=g(t);return e.addQuery(),e.addFacets(),e.addAttributesToCrop(),e.addCropLength(),e.addCropMarker(),e.addFilters(),e.addAttributesToRetrieve(),e.addAttributesToHighlight(),e.addPreTag(),e.addPostTag(),e.addPagination(),e.addSort(),e.addGeoSearchFilter(),e.addShowMatchesPosition(),e.addMatchingStrategy(),e.addShowRankingScore(),e.addAttributesToSearchOn(),e.addHybridSearch(),e.getParams()}function v(t){return"string"==typeof t?t:void 0===t?JSON.stringify(null):JSON.stringify(t)}function y(t){return Array.isArray(t)?t.map((function(t){return y(t)})):o(t)?Object.keys(t).reduce((function(e,r){return e[r]=y(t[r]),e}),{}):{value:v(t)}}function m(t){if(!t)return{};var e=y(t);return{_highlightResult:e,_snippetResult:e}}function b(t,e){var r=t.hits,n=t.pagination.hitsPerPage,i=e.finitePagination,a=e.primaryKey;!i&&r.length>n&&r.splice(r.length-1,1);var o=r.map((function(t){if(Object.keys(t).length>0){var e=t._formatted;t._matchesPosition;var r=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r}(t,["_formatted","_matchesPosition"]),n=Object.assign(r,m(e));return a&&(n.objectID=t[a]),n}return t}));return o=function(t){for(var e,r=0;r<t.length;r++){var n="".concat(r+1e6*Math.random());t[r]._geo&&(t[r]._geoloc=t[r]._geo,t[r].objectID=n),(null===(e=t[r]._formatted)||void 0===e?void 0:e._geo)&&(t[r]._formatted._geoloc=t[r]._formatted._geo,t[r]._formatted.objectID=n)}return t}(o),o}function P(t){return Object.keys(t).reduce((function(e,r){return e[r]=n(n({},t[r]),{avg:0,sum:0}),e}),{})}function S(t,e,r){var n=t.map((function(t){return function(t,e,r){var n=t.processingTimeMs,i=t.query,a=t.indexUid,o=t.facetDistribution,u=void 0===o?{}:o,c=t.facetStats,s=void 0===c?{}:c,l=Object.keys(u),d=function(t,e){var r=e.hitsPerPage,n=e.page,i=function(t,e){if(null!=t.totalPages)return t.totalPages;if(0===e)return 0;var r=t.limit,n=void 0===r?20:r,i=t.offset;return(void 0===i?0:i)/e+1+(t.hits.length>=n?1:0)}(t,r);return{page:n,nbPages:i,hitsPerPage:r}}(t,t.pagination),f=d.hitsPerPage,h=d.page,g=d.nbPages,p=b(t,r),v=function(t){var e=t.hitsPerPage,r=void 0===e?0:e,n=t.totalPages,i=void 0===n?0:n,a=t.estimatedTotalHits,o=t.totalHits;return null!=a?a:null!=o?o:r*i}(t),y=function(t,e,r,n){return t?function(t,e,r){for(var n=function(t){return t?"string"==typeof t?[t]:t:[]}(t),i={},a=0,o=n;a<o.length;a++){var u=o[a];for(var c in e[u])i[u]||(i[u]=r[u]||{}),i[u][c]?i[u][c]=r[u][c]:i[u][c]=0}return i}(e,r,n=n||{}):n}(r.keepZeroFacets,l,e,u);return{index:a,hitsPerPage:f,page:h,facets:y,nbPages:g,nbHits:v,processingTimeMS:n,query:i,hits:p,params:"",exhaustiveNbHits:!1,facets_stats:P(s)}}(t,e[t.indexUid],r)}));return{results:n}}function x(t){if(!t)return[];for(var e,r=/[^:]+:(?:asc|desc)/g,n=[];null!==(e=r.exec(t));)n.push(e[0]);return n.map((function(t){return t.replace(/^,+|,+$/,"")}))}function w(t,e,r){return{hitsPerPage:void 0===e?20:e,page:r||0,finite:!!t}}function T(t){var e=t.indexOf(":");return-1===e?{indexUid:t,sortBy:""}:{indexUid:t.substring(0,e),sortBy:t.substring(e+1)}}function O(t,e){var r=t.query,i=t.indexName,a=t.params,o=T(i),u=o.indexUid,c=o.sortBy,s=w(e.finitePagination,null==a?void 0:a.hitsPerPage,null==a?void 0:a.page);return n(n(n(n({},e),{query:r}),a),{sort:x(c),indexUid:u,pagination:s,placeholderSearch:!1!==e.placeholderSearch,keepZeroFacets:!!e.keepZeroFacets})}function _(t){void 0===t&&(t={});var e=t;return{getEntry:function(t){if(e[t])try{return JSON.parse(e[t])}catch(t){return}},formatKey:function(t){return t.reduce((function(t,e){return t+JSON.stringify(e)}),"")},setEntry:function(t,r){e[t]=JSON.stringify(r)},clearCache:function(){e={}}}}function k(t){var e=g(n(n({},t),{placeholderSearch:!0,query:""}));return e.addFacets(),e.addPagination(),e.getParams()}function j(t,e,r){return i(this,void 0,void 0,(function(){var n,i,o,u,c,s;return a(this,(function(a){switch(a.label){case 0:return l="indexUid",d=[],n=function(t){return!d.includes(t[l])&&(d.push(t[l]),!0)},i=e.filter(n).filter((function(t){var e=t.indexUid;return!Object.keys(r).includes(e)})),0===i.length?[2,r]:[4,t.multiSearch(i,[])];case 1:for(o=a.sent(),u=0,c=o;u<c.length;u++)s=c[u],r[s.indexUid]=s.facetDistribution||{};return[2,r]}var l,d}))}))}exports.meilisearch=r,exports.instantMeiliSearch=function(e,r,u){void 0===r&&(r=""),void 0===u&&(u={}),function(t,e,r){var n=r.requestConfig,i=r.httpClient;if("string"!=typeof t)throw new TypeError("Provided hostUrl value (1st parameter) is not a string, expected string");if("string"!=typeof e&&"function"!=typeof e)throw new TypeError("Provided apiKey value (2nd parameter) is not a string or a function, expected string or function");if(void 0!==n&&!o(n))throw new TypeError("Provided requestConfig should be an object");if(i&&"function"!=typeof i)throw new TypeError("Provided custom httpClient should be a function")}(e,r,u);var c={host:e,apiKey:r=function(t){if("function"==typeof t){var e=t();if("string"!=typeof e)throw new TypeError("Provided apiKey function (2nd parameter) did not return a string, expected string");return e}return t}(r),clientAgents:function(t){void 0===t&&(t=[]);var e="Meilisearch instant-meilisearch (v".concat("0.18.0",")");return t.concat(e)}(u.clientAgents)};void 0!==u.httpClient&&(c.httpClient=u.httpClient),void 0!==u.requestConfig&&(c.requestConfig=u.requestConfig);var s,l,d,f=new t.MeiliSearch(c),h=_(),g=(s=f,l=h,{multiSearch:function(t,e){return i(this,void 0,void 0,(function(){var r,i,o,u;return a(this,(function(a){switch(a.label){case 0:return r=l.formatKey([t]),(i=l.getEntry(r))?[2,i]:[4,s.multiSearch({queries:t})];case 1:return o=a.sent(),u=o.results.map((function(t,r){return n(n({},t),{pagination:e[r]||{}})})),l.setEntry(r,u),[2,u]}}))}))}}),v={},y=(d=u,n(n({},{placeholderSearch:!0,keepZeroFacets:!1,clientAgents:[],finitePagination:!1}),d));return{meiliSearchInstance:f,setMeiliSearchParams:function(t){var e=u.meiliSearchParams;u.meiliSearchParams=void 0===e?t:n(n({},e),t)},searchClient:{clearCache:function(){return h.clearCache()},search:function(t){return i(this,void 0,void 0,(function(){var e,r,i,o,c,s,l,d,f,h,m;return a(this,(function(a){switch(a.label){case 0:for(a.trys.push([0,3,,4]),e=[],r=[],i=[],o=0,c=t;o<c.length;o++)s=c[o],l=O(s,u),d=p(l),e.push(d),f=k(l),i.push(f),r.push(l.pagination);return[4,j(g,i,v)];case 1:return v=a.sent(),[4,g.multiSearch(e,r)];case 2:return h=a.sent(),v=function(t,e){for(var r=0,i=e;r<i.length;r++){var a=i[r];t[a.indexUid]=n(n({},a.facetDistribution||{}),t[a.indexUid]||{})}return t}(v,h),[2,S(h,v,y)];case 3:throw m=a.sent(),console.error(m),new Error(m);case 4:return[2]}}))}))},searchForFacetValues:function(t){return i(this,void 0,void 0,(function(){var e,r,i,o,c,s,l,d,h,g;return a(this,(function(a){switch(a.label){case 0:e=[],r=0,i=t,a.label=1;case 1:return r<i.length?(o=i[r],c=function(t,e){var r=T(t.indexName),i=r.indexUid,a=r.sortBy,o=t.params,u=w(e.finitePagination,null==o?void 0:o.hitsPerPage,null==o?void 0:o.page);return n(n(n({},e),o),{sort:x(a),indexUid:i,pagination:u,placeholderSearch:!1!==e.placeholderSearch,keepZeroFacets:!!e.keepZeroFacets})}(o,u),s=p(c),delete(l=n(n({},s),{facetQuery:o.params.facetQuery,facetName:o.params.facetName})).indexUid,[4,f.index(c.indexUid).searchForFacetValues(l)]):[3,4];case 2:d=a.sent(),h=d.facetHits.map((function(t){return n(n({},t),{highlighted:t.value})})),g={facetHits:h,exhaustiveFacetsCount:!1,processingTimeMS:d.processingTimeMs},e.push(g),a.label=3;case 3:return r++,[3,1];case 4:return[2,e]}}))}))}}}};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("meilisearch");function e(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}})),e.default=t,Object.freeze(e)}var r=e(t),n=function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)};function i(t,e,r,n){return new(r||(r=Promise))((function(i,a){function o(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,u)}c((n=n.apply(t,e||[])).next())}))}function a(t,e){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(c){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=e.call(t,o)}catch(t){u=[6,t],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}function o(t){return"object"==typeof t&&!Array.isArray(t)&&null!==t}"function"==typeof SuppressedError&&SuppressedError;var u=/([\\"])/g;function c(t){return t.replace(u,"\\$1")}function s(t){var e=c(t),r=e.indexOf(":"),n=e.slice(0,r),i=e.slice(r+1);return'"'.concat(n,'"="').concat(i,'"')}function l(t){var e=function(){var e=t.match(/^([^<!>:=]*)([<!>:=]+)(.*)$/);if(e){var r=e.slice(1),n=r[0],i=r[1],a=r[2],o=(i.match(/^([<!>]?=|<|>|:){1}(.*)/)||["",""]).slice(1);return[n,o[0],o[1]+a]}return[t,"",""]}(),r=e[0],n=e[1],i=e[2],a=c(r);return'"'.concat(a.trim(),'"').concat(":"===n?" ":n).concat(i.trim())}function d(t,e){return"string"==typeof e?t(e):e.map((function(e){return"string"==typeof e?t(e):e.map((function(e){return t(e)}))}))}function f(t){return"string"==typeof t?[t]:t}function h(t,e,r){return function(t,e,r){var n=f(e),i=f(r),a=[];return void 0!==t&&a.push(t),void 0!==n&&a.push.apply(a,n),void 0!==i&&a.push.apply(a,i),a}(t,void 0!==e?d(l,e):e,void 0!==r?d(s,r):r)}function g(t){var e=t.query,r=t.indexUid,n=t.facets,i=t.attributesToSnippet,a=t.snippetEllipsisText,o=t.filters,u=t.numericFilters,c=t.facetFilters,s=t.attributesToRetrieve,l=t.attributesToHighlight,d=t.highlightPreTag,f=t.highlightPostTag,g=t.placeholderSearch,p=t.pagination,v=t.sort,y=t.restrictSearchableAttributes,m=t.meiliSearchParams,b={indexUid:r},P=h(o,u,c);return{getParams:function(){return b},addQuery:function(){b.q=e},addFacets:function(){var t=n;void 0!==t&&(b.facets="string"==typeof t?[t]:t)},addAttributesToCrop:function(){var t,e=null!==(t=null==m?void 0:m.attributesToCrop)&&void 0!==t?t:i;void 0!==e&&(b.attributesToCrop=e)},addCropLength:function(){var t=null==m?void 0:m.cropLength;void 0!==t&&(b.cropLength=t)},addCropMarker:function(){var t,e=null!==(t=null==m?void 0:m.cropMarker)&&void 0!==t?t:a;void 0!==e&&(b.cropMarker=e)},addFilters:function(){P.length&&(b.filter=P)},addAttributesToRetrieve:function(){var t,e=null!==(t=null==m?void 0:m.attributesToRetrieve)&&void 0!==t?t:s;void 0!==e&&(b.attributesToRetrieve=e)},addAttributesToHighlight:function(){var t,e;b.attributesToHighlight=null!==(e=null!==(t=null==m?void 0:m.attributesToHighlight)&&void 0!==t?t:l)&&void 0!==e?e:["*"]},addPreTag:function(){var t,e;b.highlightPreTag=null!==(e=null!==(t=null==m?void 0:m.highlightPreTag)&&void 0!==t?t:d)&&void 0!==e?e:"__ais-highlight__"},addPostTag:function(){var t,e;b.highlightPostTag=null!==(e=null!==(t=null==m?void 0:m.highlightPostTag)&&void 0!==t?t:f)&&void 0!==e?e:"__/ais-highlight__"},addPagination:function(){var t=function(t,e,r){return!!(r||e||t&&0!==t.length)}(P,e,g);if(p.finite){var r=function(t,e){var r=t.page,n=t.hitsPerPage;return e?{hitsPerPage:n,page:r+1}:{hitsPerPage:0,page:r+1}}(p,t),n=r.hitsPerPage,i=r.page;b.hitsPerPage=n,b.page=i}else{var a=function(t,e){var r=t.page,n=t.hitsPerPage;return e?{limit:n+1,offset:r*n}:{limit:0,offset:0}}(p,t),o=a.limit,u=a.offset;b.limit=o,b.offset=u}},addSort:function(){(null==v?void 0:v.length)&&(b.sort=Array.isArray(v)?v:[v])},addGeoSearchFilter:function(){var e=function(t){var e,r,n,i=t.insideBoundingBox,a=t.aroundLatLng,o=t.aroundRadius,u=t.minimumAroundRadius;if(a){var c=a.split(",").map((function(t){return Number.parseFloat(t).toFixed(5)}));e=[g=c[0],p=c[1]]}if(null==o&&null==u||("all"===o?console.warn("instant-meilisearch is not compatible with the `all` value on the aroundRadius parameter"):r=null!=o?o:u),i&&"string"==typeof i){var s=i.split(",").map((function(t){return parseFloat(t)})),l=s[0],d=s[1],f=s[2],h=s[3];n="_geoBoundingBox([".concat(l,", ").concat(d,"], [").concat(f,", ").concat(h,"])")}else if(null!=e&&null!=r){var g=e[0],p=e[1];n="_geoRadius(".concat(g,", ").concat(p,", ").concat(r,")")}return n}({insideBoundingBox:t.insideBoundingBox,aroundLatLng:t.aroundLatLng,aroundRadius:t.aroundRadius,minimumAroundRadius:t.minimumAroundRadius});void 0!==e&&(Array.isArray(b.filter)?b.filter.unshift(e):b.filter=[e])},addShowMatchesPosition:function(){var t=null==m?void 0:m.showMatchesPosition;void 0!==t&&(b.showMatchesPosition=t)},addMatchingStrategy:function(){var t=null==m?void 0:m.matchingStrategy;void 0!==t&&(b.matchingStrategy=t)},addShowRankingScore:function(){var t=null==m?void 0:m.showRankingScore;void 0!==t&&(b.showRankingScore=t)},addAttributesToSearchOn:function(){var t=void 0!==(null==m?void 0:m.attributesToSearchOn)?m.attributesToSearchOn:y;void 0!==t&&(b.attributesToSearchOn=t)},addHybridSearch:function(){var t=null==m?void 0:m.hybrid;void 0!==t&&(b.hybrid=t)}}}function p(t){var e=g(t);return e.addQuery(),e.addFacets(),e.addAttributesToCrop(),e.addCropLength(),e.addCropMarker(),e.addFilters(),e.addAttributesToRetrieve(),e.addAttributesToHighlight(),e.addPreTag(),e.addPostTag(),e.addPagination(),e.addSort(),e.addGeoSearchFilter(),e.addShowMatchesPosition(),e.addMatchingStrategy(),e.addShowRankingScore(),e.addAttributesToSearchOn(),e.addHybridSearch(),e.getParams()}function v(t){return"string"==typeof t?t:void 0===t?JSON.stringify(null):JSON.stringify(t)}function y(t){return Array.isArray(t)?t.map((function(t){return y(t)})):o(t)?Object.keys(t).reduce((function(e,r){return e[r]=y(t[r]),e}),{}):{value:v(t)}}function m(t){if(!t)return{};var e=y(t);return{_highlightResult:e,_snippetResult:e}}function b(t,e){var r=t.hits,n=t.pagination.hitsPerPage,i=e.finitePagination,a=e.primaryKey;!i&&r.length>n&&r.splice(r.length-1,1);var o=r.map((function(t){if(Object.keys(t).length>0){var e=t._formatted;t._matchesPosition;var r=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r}(t,["_formatted","_matchesPosition"]),n=Object.assign(r,m(e));return a&&(n.objectID=t[a]),n}return t}));return o=function(t){for(var e,r=0;r<t.length;r++){var n="".concat(r+1e6*Math.random());t[r]._geo&&(t[r]._geoloc=t[r]._geo,t[r].objectID=n),(null===(e=t[r]._formatted)||void 0===e?void 0:e._geo)&&(t[r]._formatted._geoloc=t[r]._formatted._geo,t[r]._formatted.objectID=n)}return t}(o),o}function P(t){return Object.keys(t).reduce((function(e,r){return e[r]=n(n({},t[r]),{avg:0,sum:0}),e}),{})}function S(t,e,r){var n=t.map((function(t){return function(t,e,r){var n=t.processingTimeMs,i=t.query,a=t.indexUid,o=t.facetDistribution,u=void 0===o?{}:o,c=t.facetStats,s=void 0===c?{}:c,l=Object.keys(u),d=function(t,e){var r=e.hitsPerPage,n=e.page,i=function(t,e){if(null!=t.totalPages)return t.totalPages;if(0===e)return 0;var r=t.limit,n=void 0===r?20:r,i=t.offset;return(void 0===i?0:i)/e+1+(t.hits.length>=n?1:0)}(t,r);return{page:n,nbPages:i,hitsPerPage:r}}(t,t.pagination),f=d.hitsPerPage,h=d.page,g=d.nbPages,p=b(t,r),v=function(t){var e=t.hitsPerPage,r=void 0===e?0:e,n=t.totalPages,i=void 0===n?0:n,a=t.estimatedTotalHits,o=t.totalHits;return null!=a?a:null!=o?o:r*i}(t),y=function(t,e,r,n){return t?function(t,e,r){for(var n=function(t){return t?"string"==typeof t?[t]:t:[]}(t),i={},a=0,o=n;a<o.length;a++){var u=o[a];for(var c in e[u])i[u]||(i[u]=r[u]||{}),i[u][c]?i[u][c]=r[u][c]:i[u][c]=0}return i}(e,r,n=n||{}):n}(r.keepZeroFacets,l,e,u);return{index:a,hitsPerPage:f,page:h,facets:y,nbPages:g,nbHits:v,processingTimeMS:n,query:i,hits:p,params:"",exhaustiveNbHits:!1,facets_stats:P(s)}}(t,e[t.indexUid],r)}));return{results:n}}function x(t){if(!t)return[];for(var e,r=/[^:]+:(?:asc|desc)/g,n=[];null!==(e=r.exec(t));)n.push(e[0]);return n.map((function(t){return t.replace(/^,+|,+$/,"")}))}function w(t,e,r){return{hitsPerPage:void 0===e?20:e,page:r||0,finite:!!t}}function T(t){var e=t.indexOf(":");return-1===e?{indexUid:t,sortBy:""}:{indexUid:t.substring(0,e),sortBy:t.substring(e+1)}}function O(t,e){var r=t.query,i=t.indexName,a=t.params,o=T(i),u=o.indexUid,c=o.sortBy,s=w(e.finitePagination,null==a?void 0:a.hitsPerPage,null==a?void 0:a.page);return n(n(n(n({},e),{query:r}),a),{sort:x(c),indexUid:u,pagination:s,placeholderSearch:!1!==e.placeholderSearch,keepZeroFacets:!!e.keepZeroFacets})}function _(t){void 0===t&&(t={});var e=t;return{getEntry:function(t){if(e[t])try{return JSON.parse(e[t])}catch(t){return}},formatKey:function(t){return t.reduce((function(t,e){return t+JSON.stringify(e)}),"")},setEntry:function(t,r){e[t]=JSON.stringify(r)},clearCache:function(){e={}}}}function k(t){var e=g(n(n({},t),{placeholderSearch:!0,query:""}));return e.addFacets(),e.addPagination(),e.getParams()}function j(t,e,r){return i(this,void 0,void 0,(function(){var n,i,o,u,c,s;return a(this,(function(a){switch(a.label){case 0:return l="indexUid",d=[],n=function(t){return!d.includes(t[l])&&(d.push(t[l]),!0)},i=e.filter(n).filter((function(t){var e=t.indexUid;return!Object.keys(r).includes(e)})),0===i.length?[2,r]:[4,t.multiSearch(i,[])];case 1:for(o=a.sent(),u=0,c=o;u<c.length;u++)s=c[u],r[s.indexUid]=s.facetDistribution||{};return[2,r]}var l,d}))}))}exports.meilisearch=r,exports.instantMeiliSearch=function(e,r,u){void 0===r&&(r=""),void 0===u&&(u={}),function(t,e,r){var n=r.requestConfig,i=r.httpClient;if("string"!=typeof t)throw new TypeError("Provided hostUrl value (1st parameter) is not a string, expected string");if("string"!=typeof e&&"function"!=typeof e)throw new TypeError("Provided apiKey value (2nd parameter) is not a string or a function, expected string or function");if(void 0!==n&&!o(n))throw new TypeError("Provided requestConfig should be an object");if(i&&"function"!=typeof i)throw new TypeError("Provided custom httpClient should be a function")}(e,r,u);var c={host:e,apiKey:r=function(t){if("function"==typeof t){var e=t();if("string"!=typeof e)throw new TypeError("Provided apiKey function (2nd parameter) did not return a string, expected string");return e}return t}(r),clientAgents:function(t){void 0===t&&(t=[]);var e="Meilisearch instant-meilisearch (v".concat("0.18.1",")");return t.concat(e)}(u.clientAgents)};void 0!==u.httpClient&&(c.httpClient=u.httpClient),void 0!==u.requestConfig&&(c.requestConfig=u.requestConfig);var s,l,d,f=new t.MeiliSearch(c),h=_(),g=(s=f,l=h,{multiSearch:function(t,e){return i(this,void 0,void 0,(function(){var r,i,o,u;return a(this,(function(a){switch(a.label){case 0:return r=l.formatKey([t]),(i=l.getEntry(r))?[2,i]:[4,s.multiSearch({queries:t})];case 1:return o=a.sent(),u=o.results.map((function(t,r){return n(n({},t),{pagination:e[r]||{}})})),l.setEntry(r,u),[2,u]}}))}))}}),v={},y=(d=u,n(n({},{placeholderSearch:!0,keepZeroFacets:!1,clientAgents:[],finitePagination:!1}),d));return{meiliSearchInstance:f,setMeiliSearchParams:function(t){var e=u.meiliSearchParams;u.meiliSearchParams=void 0===e?t:n(n({},e),t)},searchClient:{clearCache:function(){return h.clearCache()},search:function(t){return i(this,void 0,void 0,(function(){var e,r,i,o,c,s,l,d,f,h,m;return a(this,(function(a){switch(a.label){case 0:for(a.trys.push([0,3,,4]),e=[],r=[],i=[],o=0,c=t;o<c.length;o++)s=c[o],l=O(s,u),d=p(l),e.push(d),f=k(l),i.push(f),r.push(l.pagination);return[4,j(g,i,v)];case 1:return v=a.sent(),[4,g.multiSearch(e,r)];case 2:return h=a.sent(),v=function(t,e){for(var r=0,i=e;r<i.length;r++){var a=i[r];t[a.indexUid]=n(n({},a.facetDistribution||{}),t[a.indexUid]||{})}return t}(v,h),[2,S(h,v,y)];case 3:throw m=a.sent(),console.error(m),new Error(m);case 4:return[2]}}))}))},searchForFacetValues:function(t){return i(this,void 0,void 0,(function(){var e,r,i,o,c,s,l,d,h,g;return a(this,(function(a){switch(a.label){case 0:e=[],r=0,i=t,a.label=1;case 1:return r<i.length?(o=i[r],c=function(t,e){var r=T(t.indexName),i=r.indexUid,a=r.sortBy,o=t.params,u=w(e.finitePagination,null==o?void 0:o.hitsPerPage,null==o?void 0:o.page);return n(n(n({},e),o),{sort:x(a),indexUid:i,pagination:u,placeholderSearch:!1!==e.placeholderSearch,keepZeroFacets:!!e.keepZeroFacets})}(o,u),s=p(c),delete(l=n(n({},s),{facetQuery:o.params.facetQuery,facetName:o.params.facetName})).indexUid,[4,f.index(c.indexUid).searchForFacetValues(l)]):[3,4];case 2:d=a.sent(),h=d.facetHits.map((function(t){return n(n({},t),{highlighted:t.value})})),g={facetHits:h,exhaustiveFacetsCount:!1,processingTimeMS:d.processingTimeMs},e.push(g),a.label=3;case 3:return r++,[3,1];case 4:return[2,e]}}))}))}}}};
//# sourceMappingURL=instant-meilisearch.cjs.min.js.map

@@ -995,3 +995,3 @@ import { MeiliSearch } from 'meilisearch';

var PACKAGE_VERSION = '0.18.0';
var PACKAGE_VERSION = '0.18.1';

@@ -998,0 +998,0 @@ var constructClientAgents = function (clientAgents) {

@@ -1,2 +0,2 @@

import{MeiliSearch as t}from"meilisearch";import*as e from"meilisearch";export{e as meilisearch};var r=function(){return r=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};function n(t,e,r,n){return new(r||(r=Promise))((function(i,a){function o(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,u)}c((n=n.apply(t,e||[])).next())}))}function i(t,e){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(c){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=e.call(t,o)}catch(t){u=[6,t],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}function a(t){return"object"==typeof t&&!Array.isArray(t)&&null!==t}"function"==typeof SuppressedError&&SuppressedError;var o=/([\\"])/g;function u(t){return t.replace(o,"\\$1")}function c(t){var e=u(t),r=e.indexOf(":"),n=e.slice(0,r),i=e.slice(r+1);return'"'.concat(n,'"="').concat(i,'"')}function s(t){var e=function(){var e=t.match(/^([^<!>:=]*)([<!>:=]+)(.*)$/);if(e){var r=e.slice(1),n=r[0],i=r[1],a=r[2],o=(i.match(/^([<!>]?=|<|>|:){1}(.*)/)||["",""]).slice(1);return[n,o[0],o[1]+a]}return[t,"",""]}(),r=e[0],n=e[1],i=e[2],a=u(r);return'"'.concat(a.trim(),'"').concat(":"===n?" ":n).concat(i.trim())}function l(t,e){return"string"==typeof e?t(e):e.map((function(e){return"string"==typeof e?t(e):e.map((function(e){return t(e)}))}))}function d(t){return"string"==typeof t?[t]:t}function f(t,e,r){return function(t,e,r){var n=d(e),i=d(r),a=[];return void 0!==t&&a.push(t),void 0!==n&&a.push.apply(a,n),void 0!==i&&a.push.apply(a,i),a}(t,void 0!==e?l(s,e):e,void 0!==r?l(c,r):r)}function h(t){var e=t.query,r=t.indexUid,n=t.facets,i=t.attributesToSnippet,a=t.snippetEllipsisText,o=t.filters,u=t.numericFilters,c=t.facetFilters,s=t.attributesToRetrieve,l=t.attributesToHighlight,d=t.highlightPreTag,h=t.highlightPostTag,g=t.placeholderSearch,p=t.pagination,v=t.sort,y=t.restrictSearchableAttributes,m=t.meiliSearchParams,b={indexUid:r},P=f(o,u,c);return{getParams:function(){return b},addQuery:function(){b.q=e},addFacets:function(){var t=n;void 0!==t&&(b.facets="string"==typeof t?[t]:t)},addAttributesToCrop:function(){var t,e=null!==(t=null==m?void 0:m.attributesToCrop)&&void 0!==t?t:i;void 0!==e&&(b.attributesToCrop=e)},addCropLength:function(){var t=null==m?void 0:m.cropLength;void 0!==t&&(b.cropLength=t)},addCropMarker:function(){var t,e=null!==(t=null==m?void 0:m.cropMarker)&&void 0!==t?t:a;void 0!==e&&(b.cropMarker=e)},addFilters:function(){P.length&&(b.filter=P)},addAttributesToRetrieve:function(){var t,e=null!==(t=null==m?void 0:m.attributesToRetrieve)&&void 0!==t?t:s;void 0!==e&&(b.attributesToRetrieve=e)},addAttributesToHighlight:function(){var t,e;b.attributesToHighlight=null!==(e=null!==(t=null==m?void 0:m.attributesToHighlight)&&void 0!==t?t:l)&&void 0!==e?e:["*"]},addPreTag:function(){var t,e;b.highlightPreTag=null!==(e=null!==(t=null==m?void 0:m.highlightPreTag)&&void 0!==t?t:d)&&void 0!==e?e:"__ais-highlight__"},addPostTag:function(){var t,e;b.highlightPostTag=null!==(e=null!==(t=null==m?void 0:m.highlightPostTag)&&void 0!==t?t:h)&&void 0!==e?e:"__/ais-highlight__"},addPagination:function(){var t=function(t,e,r){return!!(r||e||t&&0!==t.length)}(P,e,g);if(p.finite){var r=function(t,e){var r=t.page,n=t.hitsPerPage;return e?{hitsPerPage:n,page:r+1}:{hitsPerPage:0,page:r+1}}(p,t),n=r.hitsPerPage,i=r.page;b.hitsPerPage=n,b.page=i}else{var a=function(t,e){var r=t.page,n=t.hitsPerPage;return e?{limit:n+1,offset:r*n}:{limit:0,offset:0}}(p,t),o=a.limit,u=a.offset;b.limit=o,b.offset=u}},addSort:function(){(null==v?void 0:v.length)&&(b.sort=Array.isArray(v)?v:[v])},addGeoSearchFilter:function(){var e=function(t){var e,r,n,i=t.insideBoundingBox,a=t.aroundLatLng,o=t.aroundRadius,u=t.minimumAroundRadius;if(a){var c=a.split(",").map((function(t){return Number.parseFloat(t).toFixed(5)}));e=[g=c[0],p=c[1]]}if(null==o&&null==u||("all"===o?console.warn("instant-meilisearch is not compatible with the `all` value on the aroundRadius parameter"):r=null!=o?o:u),i&&"string"==typeof i){var s=i.split(",").map((function(t){return parseFloat(t)})),l=s[0],d=s[1],f=s[2],h=s[3];n="_geoBoundingBox([".concat(l,", ").concat(d,"], [").concat(f,", ").concat(h,"])")}else if(null!=e&&null!=r){var g=e[0],p=e[1];n="_geoRadius(".concat(g,", ").concat(p,", ").concat(r,")")}return n}({insideBoundingBox:t.insideBoundingBox,aroundLatLng:t.aroundLatLng,aroundRadius:t.aroundRadius,minimumAroundRadius:t.minimumAroundRadius});void 0!==e&&(Array.isArray(b.filter)?b.filter.unshift(e):b.filter=[e])},addShowMatchesPosition:function(){var t=null==m?void 0:m.showMatchesPosition;void 0!==t&&(b.showMatchesPosition=t)},addMatchingStrategy:function(){var t=null==m?void 0:m.matchingStrategy;void 0!==t&&(b.matchingStrategy=t)},addShowRankingScore:function(){var t=null==m?void 0:m.showRankingScore;void 0!==t&&(b.showRankingScore=t)},addAttributesToSearchOn:function(){var t=void 0!==(null==m?void 0:m.attributesToSearchOn)?m.attributesToSearchOn:y;void 0!==t&&(b.attributesToSearchOn=t)},addHybridSearch:function(){var t=null==m?void 0:m.hybrid;void 0!==t&&(b.hybrid=t)}}}function g(t){var e=h(t);return e.addQuery(),e.addFacets(),e.addAttributesToCrop(),e.addCropLength(),e.addCropMarker(),e.addFilters(),e.addAttributesToRetrieve(),e.addAttributesToHighlight(),e.addPreTag(),e.addPostTag(),e.addPagination(),e.addSort(),e.addGeoSearchFilter(),e.addShowMatchesPosition(),e.addMatchingStrategy(),e.addShowRankingScore(),e.addAttributesToSearchOn(),e.addHybridSearch(),e.getParams()}function p(t){return"string"==typeof t?t:void 0===t?JSON.stringify(null):JSON.stringify(t)}function v(t){return Array.isArray(t)?t.map((function(t){return v(t)})):a(t)?Object.keys(t).reduce((function(e,r){return e[r]=v(t[r]),e}),{}):{value:p(t)}}function y(t){if(!t)return{};var e=v(t);return{_highlightResult:e,_snippetResult:e}}function m(t,e){var r=t.hits,n=t.pagination.hitsPerPage,i=e.finitePagination,a=e.primaryKey;!i&&r.length>n&&r.splice(r.length-1,1);var o=r.map((function(t){if(Object.keys(t).length>0){var e=t._formatted;t._matchesPosition;var r=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r}(t,["_formatted","_matchesPosition"]),n=Object.assign(r,y(e));return a&&(n.objectID=t[a]),n}return t}));return o=function(t){for(var e,r=0;r<t.length;r++){var n="".concat(r+1e6*Math.random());t[r]._geo&&(t[r]._geoloc=t[r]._geo,t[r].objectID=n),(null===(e=t[r]._formatted)||void 0===e?void 0:e._geo)&&(t[r]._formatted._geoloc=t[r]._formatted._geo,t[r]._formatted.objectID=n)}return t}(o),o}function b(t){return Object.keys(t).reduce((function(e,n){return e[n]=r(r({},t[n]),{avg:0,sum:0}),e}),{})}function P(t,e,r){var n=t.map((function(t){return function(t,e,r){var n=t.processingTimeMs,i=t.query,a=t.indexUid,o=t.facetDistribution,u=void 0===o?{}:o,c=t.facetStats,s=void 0===c?{}:c,l=Object.keys(u),d=function(t,e){var r=e.hitsPerPage,n=e.page,i=function(t,e){if(null!=t.totalPages)return t.totalPages;if(0===e)return 0;var r=t.limit,n=void 0===r?20:r,i=t.offset;return(void 0===i?0:i)/e+1+(t.hits.length>=n?1:0)}(t,r);return{page:n,nbPages:i,hitsPerPage:r}}(t,t.pagination),f=d.hitsPerPage,h=d.page,g=d.nbPages,p=m(t,r),v=function(t){var e=t.hitsPerPage,r=void 0===e?0:e,n=t.totalPages,i=void 0===n?0:n,a=t.estimatedTotalHits,o=t.totalHits;return null!=a?a:null!=o?o:r*i}(t),y=function(t,e,r,n){return t?function(t,e,r){for(var n=function(t){return t?"string"==typeof t?[t]:t:[]}(t),i={},a=0,o=n;a<o.length;a++){var u=o[a];for(var c in e[u])i[u]||(i[u]=r[u]||{}),i[u][c]?i[u][c]=r[u][c]:i[u][c]=0}return i}(e,r,n=n||{}):n}(r.keepZeroFacets,l,e,u);return{index:a,hitsPerPage:f,page:h,facets:y,nbPages:g,nbHits:v,processingTimeMS:n,query:i,hits:p,params:"",exhaustiveNbHits:!1,facets_stats:b(s)}}(t,e[t.indexUid],r)}));return{results:n}}function S(t){if(!t)return[];for(var e,r=/[^:]+:(?:asc|desc)/g,n=[];null!==(e=r.exec(t));)n.push(e[0]);return n.map((function(t){return t.replace(/^,+|,+$/,"")}))}function x(t,e,r){return{hitsPerPage:void 0===e?20:e,page:r||0,finite:!!t}}function T(t){var e=t.indexOf(":");return-1===e?{indexUid:t,sortBy:""}:{indexUid:t.substring(0,e),sortBy:t.substring(e+1)}}function w(t,e){var n=t.query,i=t.indexName,a=t.params,o=T(i),u=o.indexUid,c=o.sortBy,s=x(e.finitePagination,null==a?void 0:a.hitsPerPage,null==a?void 0:a.page);return r(r(r(r({},e),{query:n}),a),{sort:S(c),indexUid:u,pagination:s,placeholderSearch:!1!==e.placeholderSearch,keepZeroFacets:!!e.keepZeroFacets})}function O(t){void 0===t&&(t={});var e=t;return{getEntry:function(t){if(e[t])try{return JSON.parse(e[t])}catch(t){return}},formatKey:function(t){return t.reduce((function(t,e){return t+JSON.stringify(e)}),"")},setEntry:function(t,r){e[t]=JSON.stringify(r)},clearCache:function(){e={}}}}function _(t){var e=h(r(r({},t),{placeholderSearch:!0,query:""}));return e.addFacets(),e.addPagination(),e.getParams()}function k(t,e,r){return n(this,void 0,void 0,(function(){var n,a,o,u,c,s;return i(this,(function(i){switch(i.label){case 0:return l="indexUid",d=[],n=function(t){return!d.includes(t[l])&&(d.push(t[l]),!0)},a=e.filter(n).filter((function(t){var e=t.indexUid;return!Object.keys(r).includes(e)})),0===a.length?[2,r]:[4,t.multiSearch(a,[])];case 1:for(o=i.sent(),u=0,c=o;u<c.length;u++)s=c[u],r[s.indexUid]=s.facetDistribution||{};return[2,r]}var l,d}))}))}function A(e,o,u){void 0===o&&(o=""),void 0===u&&(u={}),function(t,e,r){var n=r.requestConfig,i=r.httpClient;if("string"!=typeof t)throw new TypeError("Provided hostUrl value (1st parameter) is not a string, expected string");if("string"!=typeof e&&"function"!=typeof e)throw new TypeError("Provided apiKey value (2nd parameter) is not a string or a function, expected string or function");if(void 0!==n&&!a(n))throw new TypeError("Provided requestConfig should be an object");if(i&&"function"!=typeof i)throw new TypeError("Provided custom httpClient should be a function")}(e,o,u);var c={host:e,apiKey:o=function(t){if("function"==typeof t){var e=t();if("string"!=typeof e)throw new TypeError("Provided apiKey function (2nd parameter) did not return a string, expected string");return e}return t}(o),clientAgents:function(t){void 0===t&&(t=[]);var e="Meilisearch instant-meilisearch (v".concat("0.18.0",")");return t.concat(e)}(u.clientAgents)};void 0!==u.httpClient&&(c.httpClient=u.httpClient),void 0!==u.requestConfig&&(c.requestConfig=u.requestConfig);var s,l,d,f=new t(c),h=O(),p=(s=f,l=h,{multiSearch:function(t,e){return n(this,void 0,void 0,(function(){var n,a,o,u;return i(this,(function(i){switch(i.label){case 0:return n=l.formatKey([t]),(a=l.getEntry(n))?[2,a]:[4,s.multiSearch({queries:t})];case 1:return o=i.sent(),u=o.results.map((function(t,n){return r(r({},t),{pagination:e[n]||{}})})),l.setEntry(n,u),[2,u]}}))}))}}),v={},y=(d=u,r(r({},{placeholderSearch:!0,keepZeroFacets:!1,clientAgents:[],finitePagination:!1}),d));return{meiliSearchInstance:f,setMeiliSearchParams:function(t){var e=u.meiliSearchParams;u.meiliSearchParams=void 0===e?t:r(r({},e),t)},searchClient:{clearCache:function(){return h.clearCache()},search:function(t){return n(this,void 0,void 0,(function(){var e,n,a,o,c,s,l,d,f,h,m;return i(this,(function(i){switch(i.label){case 0:for(i.trys.push([0,3,,4]),e=[],n=[],a=[],o=0,c=t;o<c.length;o++)s=c[o],l=w(s,u),d=g(l),e.push(d),f=_(l),a.push(f),n.push(l.pagination);return[4,k(p,a,v)];case 1:return v=i.sent(),[4,p.multiSearch(e,n)];case 2:return h=i.sent(),v=function(t,e){for(var n=0,i=e;n<i.length;n++){var a=i[n];t[a.indexUid]=r(r({},a.facetDistribution||{}),t[a.indexUid]||{})}return t}(v,h),[2,P(h,v,y)];case 3:throw m=i.sent(),console.error(m),new Error(m);case 4:return[2]}}))}))},searchForFacetValues:function(t){return n(this,void 0,void 0,(function(){var e,n,a,o,c,s,l,d,h,p;return i(this,(function(i){switch(i.label){case 0:e=[],n=0,a=t,i.label=1;case 1:return n<a.length?(o=a[n],c=function(t,e){var n=T(t.indexName),i=n.indexUid,a=n.sortBy,o=t.params,u=x(e.finitePagination,null==o?void 0:o.hitsPerPage,null==o?void 0:o.page);return r(r(r({},e),o),{sort:S(a),indexUid:i,pagination:u,placeholderSearch:!1!==e.placeholderSearch,keepZeroFacets:!!e.keepZeroFacets})}(o,u),s=g(c),delete(l=r(r({},s),{facetQuery:o.params.facetQuery,facetName:o.params.facetName})).indexUid,[4,f.index(c.indexUid).searchForFacetValues(l)]):[3,4];case 2:d=i.sent(),h=d.facetHits.map((function(t){return r(r({},t),{highlighted:t.value})})),p={facetHits:h,exhaustiveFacetsCount:!1,processingTimeMS:d.processingTimeMs},e.push(p),i.label=3;case 3:return n++,[3,1];case 4:return[2,e]}}))}))}}}}export{A as instantMeiliSearch};
import{MeiliSearch as t}from"meilisearch";import*as e from"meilisearch";export{e as meilisearch};var r=function(){return r=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};function n(t,e,r,n){return new(r||(r=Promise))((function(i,a){function o(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,u)}c((n=n.apply(t,e||[])).next())}))}function i(t,e){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(c){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=e.call(t,o)}catch(t){u=[6,t],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}function a(t){return"object"==typeof t&&!Array.isArray(t)&&null!==t}"function"==typeof SuppressedError&&SuppressedError;var o=/([\\"])/g;function u(t){return t.replace(o,"\\$1")}function c(t){var e=u(t),r=e.indexOf(":"),n=e.slice(0,r),i=e.slice(r+1);return'"'.concat(n,'"="').concat(i,'"')}function s(t){var e=function(){var e=t.match(/^([^<!>:=]*)([<!>:=]+)(.*)$/);if(e){var r=e.slice(1),n=r[0],i=r[1],a=r[2],o=(i.match(/^([<!>]?=|<|>|:){1}(.*)/)||["",""]).slice(1);return[n,o[0],o[1]+a]}return[t,"",""]}(),r=e[0],n=e[1],i=e[2],a=u(r);return'"'.concat(a.trim(),'"').concat(":"===n?" ":n).concat(i.trim())}function l(t,e){return"string"==typeof e?t(e):e.map((function(e){return"string"==typeof e?t(e):e.map((function(e){return t(e)}))}))}function d(t){return"string"==typeof t?[t]:t}function f(t,e,r){return function(t,e,r){var n=d(e),i=d(r),a=[];return void 0!==t&&a.push(t),void 0!==n&&a.push.apply(a,n),void 0!==i&&a.push.apply(a,i),a}(t,void 0!==e?l(s,e):e,void 0!==r?l(c,r):r)}function h(t){var e=t.query,r=t.indexUid,n=t.facets,i=t.attributesToSnippet,a=t.snippetEllipsisText,o=t.filters,u=t.numericFilters,c=t.facetFilters,s=t.attributesToRetrieve,l=t.attributesToHighlight,d=t.highlightPreTag,h=t.highlightPostTag,g=t.placeholderSearch,p=t.pagination,v=t.sort,y=t.restrictSearchableAttributes,m=t.meiliSearchParams,b={indexUid:r},P=f(o,u,c);return{getParams:function(){return b},addQuery:function(){b.q=e},addFacets:function(){var t=n;void 0!==t&&(b.facets="string"==typeof t?[t]:t)},addAttributesToCrop:function(){var t,e=null!==(t=null==m?void 0:m.attributesToCrop)&&void 0!==t?t:i;void 0!==e&&(b.attributesToCrop=e)},addCropLength:function(){var t=null==m?void 0:m.cropLength;void 0!==t&&(b.cropLength=t)},addCropMarker:function(){var t,e=null!==(t=null==m?void 0:m.cropMarker)&&void 0!==t?t:a;void 0!==e&&(b.cropMarker=e)},addFilters:function(){P.length&&(b.filter=P)},addAttributesToRetrieve:function(){var t,e=null!==(t=null==m?void 0:m.attributesToRetrieve)&&void 0!==t?t:s;void 0!==e&&(b.attributesToRetrieve=e)},addAttributesToHighlight:function(){var t,e;b.attributesToHighlight=null!==(e=null!==(t=null==m?void 0:m.attributesToHighlight)&&void 0!==t?t:l)&&void 0!==e?e:["*"]},addPreTag:function(){var t,e;b.highlightPreTag=null!==(e=null!==(t=null==m?void 0:m.highlightPreTag)&&void 0!==t?t:d)&&void 0!==e?e:"__ais-highlight__"},addPostTag:function(){var t,e;b.highlightPostTag=null!==(e=null!==(t=null==m?void 0:m.highlightPostTag)&&void 0!==t?t:h)&&void 0!==e?e:"__/ais-highlight__"},addPagination:function(){var t=function(t,e,r){return!!(r||e||t&&0!==t.length)}(P,e,g);if(p.finite){var r=function(t,e){var r=t.page,n=t.hitsPerPage;return e?{hitsPerPage:n,page:r+1}:{hitsPerPage:0,page:r+1}}(p,t),n=r.hitsPerPage,i=r.page;b.hitsPerPage=n,b.page=i}else{var a=function(t,e){var r=t.page,n=t.hitsPerPage;return e?{limit:n+1,offset:r*n}:{limit:0,offset:0}}(p,t),o=a.limit,u=a.offset;b.limit=o,b.offset=u}},addSort:function(){(null==v?void 0:v.length)&&(b.sort=Array.isArray(v)?v:[v])},addGeoSearchFilter:function(){var e=function(t){var e,r,n,i=t.insideBoundingBox,a=t.aroundLatLng,o=t.aroundRadius,u=t.minimumAroundRadius;if(a){var c=a.split(",").map((function(t){return Number.parseFloat(t).toFixed(5)}));e=[g=c[0],p=c[1]]}if(null==o&&null==u||("all"===o?console.warn("instant-meilisearch is not compatible with the `all` value on the aroundRadius parameter"):r=null!=o?o:u),i&&"string"==typeof i){var s=i.split(",").map((function(t){return parseFloat(t)})),l=s[0],d=s[1],f=s[2],h=s[3];n="_geoBoundingBox([".concat(l,", ").concat(d,"], [").concat(f,", ").concat(h,"])")}else if(null!=e&&null!=r){var g=e[0],p=e[1];n="_geoRadius(".concat(g,", ").concat(p,", ").concat(r,")")}return n}({insideBoundingBox:t.insideBoundingBox,aroundLatLng:t.aroundLatLng,aroundRadius:t.aroundRadius,minimumAroundRadius:t.minimumAroundRadius});void 0!==e&&(Array.isArray(b.filter)?b.filter.unshift(e):b.filter=[e])},addShowMatchesPosition:function(){var t=null==m?void 0:m.showMatchesPosition;void 0!==t&&(b.showMatchesPosition=t)},addMatchingStrategy:function(){var t=null==m?void 0:m.matchingStrategy;void 0!==t&&(b.matchingStrategy=t)},addShowRankingScore:function(){var t=null==m?void 0:m.showRankingScore;void 0!==t&&(b.showRankingScore=t)},addAttributesToSearchOn:function(){var t=void 0!==(null==m?void 0:m.attributesToSearchOn)?m.attributesToSearchOn:y;void 0!==t&&(b.attributesToSearchOn=t)},addHybridSearch:function(){var t=null==m?void 0:m.hybrid;void 0!==t&&(b.hybrid=t)}}}function g(t){var e=h(t);return e.addQuery(),e.addFacets(),e.addAttributesToCrop(),e.addCropLength(),e.addCropMarker(),e.addFilters(),e.addAttributesToRetrieve(),e.addAttributesToHighlight(),e.addPreTag(),e.addPostTag(),e.addPagination(),e.addSort(),e.addGeoSearchFilter(),e.addShowMatchesPosition(),e.addMatchingStrategy(),e.addShowRankingScore(),e.addAttributesToSearchOn(),e.addHybridSearch(),e.getParams()}function p(t){return"string"==typeof t?t:void 0===t?JSON.stringify(null):JSON.stringify(t)}function v(t){return Array.isArray(t)?t.map((function(t){return v(t)})):a(t)?Object.keys(t).reduce((function(e,r){return e[r]=v(t[r]),e}),{}):{value:p(t)}}function y(t){if(!t)return{};var e=v(t);return{_highlightResult:e,_snippetResult:e}}function m(t,e){var r=t.hits,n=t.pagination.hitsPerPage,i=e.finitePagination,a=e.primaryKey;!i&&r.length>n&&r.splice(r.length-1,1);var o=r.map((function(t){if(Object.keys(t).length>0){var e=t._formatted;t._matchesPosition;var r=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r}(t,["_formatted","_matchesPosition"]),n=Object.assign(r,y(e));return a&&(n.objectID=t[a]),n}return t}));return o=function(t){for(var e,r=0;r<t.length;r++){var n="".concat(r+1e6*Math.random());t[r]._geo&&(t[r]._geoloc=t[r]._geo,t[r].objectID=n),(null===(e=t[r]._formatted)||void 0===e?void 0:e._geo)&&(t[r]._formatted._geoloc=t[r]._formatted._geo,t[r]._formatted.objectID=n)}return t}(o),o}function b(t){return Object.keys(t).reduce((function(e,n){return e[n]=r(r({},t[n]),{avg:0,sum:0}),e}),{})}function P(t,e,r){var n=t.map((function(t){return function(t,e,r){var n=t.processingTimeMs,i=t.query,a=t.indexUid,o=t.facetDistribution,u=void 0===o?{}:o,c=t.facetStats,s=void 0===c?{}:c,l=Object.keys(u),d=function(t,e){var r=e.hitsPerPage,n=e.page,i=function(t,e){if(null!=t.totalPages)return t.totalPages;if(0===e)return 0;var r=t.limit,n=void 0===r?20:r,i=t.offset;return(void 0===i?0:i)/e+1+(t.hits.length>=n?1:0)}(t,r);return{page:n,nbPages:i,hitsPerPage:r}}(t,t.pagination),f=d.hitsPerPage,h=d.page,g=d.nbPages,p=m(t,r),v=function(t){var e=t.hitsPerPage,r=void 0===e?0:e,n=t.totalPages,i=void 0===n?0:n,a=t.estimatedTotalHits,o=t.totalHits;return null!=a?a:null!=o?o:r*i}(t),y=function(t,e,r,n){return t?function(t,e,r){for(var n=function(t){return t?"string"==typeof t?[t]:t:[]}(t),i={},a=0,o=n;a<o.length;a++){var u=o[a];for(var c in e[u])i[u]||(i[u]=r[u]||{}),i[u][c]?i[u][c]=r[u][c]:i[u][c]=0}return i}(e,r,n=n||{}):n}(r.keepZeroFacets,l,e,u);return{index:a,hitsPerPage:f,page:h,facets:y,nbPages:g,nbHits:v,processingTimeMS:n,query:i,hits:p,params:"",exhaustiveNbHits:!1,facets_stats:b(s)}}(t,e[t.indexUid],r)}));return{results:n}}function S(t){if(!t)return[];for(var e,r=/[^:]+:(?:asc|desc)/g,n=[];null!==(e=r.exec(t));)n.push(e[0]);return n.map((function(t){return t.replace(/^,+|,+$/,"")}))}function x(t,e,r){return{hitsPerPage:void 0===e?20:e,page:r||0,finite:!!t}}function T(t){var e=t.indexOf(":");return-1===e?{indexUid:t,sortBy:""}:{indexUid:t.substring(0,e),sortBy:t.substring(e+1)}}function w(t,e){var n=t.query,i=t.indexName,a=t.params,o=T(i),u=o.indexUid,c=o.sortBy,s=x(e.finitePagination,null==a?void 0:a.hitsPerPage,null==a?void 0:a.page);return r(r(r(r({},e),{query:n}),a),{sort:S(c),indexUid:u,pagination:s,placeholderSearch:!1!==e.placeholderSearch,keepZeroFacets:!!e.keepZeroFacets})}function O(t){void 0===t&&(t={});var e=t;return{getEntry:function(t){if(e[t])try{return JSON.parse(e[t])}catch(t){return}},formatKey:function(t){return t.reduce((function(t,e){return t+JSON.stringify(e)}),"")},setEntry:function(t,r){e[t]=JSON.stringify(r)},clearCache:function(){e={}}}}function _(t){var e=h(r(r({},t),{placeholderSearch:!0,query:""}));return e.addFacets(),e.addPagination(),e.getParams()}function k(t,e,r){return n(this,void 0,void 0,(function(){var n,a,o,u,c,s;return i(this,(function(i){switch(i.label){case 0:return l="indexUid",d=[],n=function(t){return!d.includes(t[l])&&(d.push(t[l]),!0)},a=e.filter(n).filter((function(t){var e=t.indexUid;return!Object.keys(r).includes(e)})),0===a.length?[2,r]:[4,t.multiSearch(a,[])];case 1:for(o=i.sent(),u=0,c=o;u<c.length;u++)s=c[u],r[s.indexUid]=s.facetDistribution||{};return[2,r]}var l,d}))}))}function A(e,o,u){void 0===o&&(o=""),void 0===u&&(u={}),function(t,e,r){var n=r.requestConfig,i=r.httpClient;if("string"!=typeof t)throw new TypeError("Provided hostUrl value (1st parameter) is not a string, expected string");if("string"!=typeof e&&"function"!=typeof e)throw new TypeError("Provided apiKey value (2nd parameter) is not a string or a function, expected string or function");if(void 0!==n&&!a(n))throw new TypeError("Provided requestConfig should be an object");if(i&&"function"!=typeof i)throw new TypeError("Provided custom httpClient should be a function")}(e,o,u);var c={host:e,apiKey:o=function(t){if("function"==typeof t){var e=t();if("string"!=typeof e)throw new TypeError("Provided apiKey function (2nd parameter) did not return a string, expected string");return e}return t}(o),clientAgents:function(t){void 0===t&&(t=[]);var e="Meilisearch instant-meilisearch (v".concat("0.18.1",")");return t.concat(e)}(u.clientAgents)};void 0!==u.httpClient&&(c.httpClient=u.httpClient),void 0!==u.requestConfig&&(c.requestConfig=u.requestConfig);var s,l,d,f=new t(c),h=O(),p=(s=f,l=h,{multiSearch:function(t,e){return n(this,void 0,void 0,(function(){var n,a,o,u;return i(this,(function(i){switch(i.label){case 0:return n=l.formatKey([t]),(a=l.getEntry(n))?[2,a]:[4,s.multiSearch({queries:t})];case 1:return o=i.sent(),u=o.results.map((function(t,n){return r(r({},t),{pagination:e[n]||{}})})),l.setEntry(n,u),[2,u]}}))}))}}),v={},y=(d=u,r(r({},{placeholderSearch:!0,keepZeroFacets:!1,clientAgents:[],finitePagination:!1}),d));return{meiliSearchInstance:f,setMeiliSearchParams:function(t){var e=u.meiliSearchParams;u.meiliSearchParams=void 0===e?t:r(r({},e),t)},searchClient:{clearCache:function(){return h.clearCache()},search:function(t){return n(this,void 0,void 0,(function(){var e,n,a,o,c,s,l,d,f,h,m;return i(this,(function(i){switch(i.label){case 0:for(i.trys.push([0,3,,4]),e=[],n=[],a=[],o=0,c=t;o<c.length;o++)s=c[o],l=w(s,u),d=g(l),e.push(d),f=_(l),a.push(f),n.push(l.pagination);return[4,k(p,a,v)];case 1:return v=i.sent(),[4,p.multiSearch(e,n)];case 2:return h=i.sent(),v=function(t,e){for(var n=0,i=e;n<i.length;n++){var a=i[n];t[a.indexUid]=r(r({},a.facetDistribution||{}),t[a.indexUid]||{})}return t}(v,h),[2,P(h,v,y)];case 3:throw m=i.sent(),console.error(m),new Error(m);case 4:return[2]}}))}))},searchForFacetValues:function(t){return n(this,void 0,void 0,(function(){var e,n,a,o,c,s,l,d,h,p;return i(this,(function(i){switch(i.label){case 0:e=[],n=0,a=t,i.label=1;case 1:return n<a.length?(o=a[n],c=function(t,e){var n=T(t.indexName),i=n.indexUid,a=n.sortBy,o=t.params,u=x(e.finitePagination,null==o?void 0:o.hitsPerPage,null==o?void 0:o.page);return r(r(r({},e),o),{sort:S(a),indexUid:i,pagination:u,placeholderSearch:!1!==e.placeholderSearch,keepZeroFacets:!!e.keepZeroFacets})}(o,u),s=g(c),delete(l=r(r({},s),{facetQuery:o.params.facetQuery,facetName:o.params.facetName})).indexUid,[4,f.index(c.indexUid).searchForFacetValues(l)]):[3,4];case 2:d=i.sent(),h=d.facetHits.map((function(t){return r(r({},t),{highlighted:t.value})})),p={facetHits:h,exhaustiveFacetsCount:!1,processingTimeMS:d.processingTimeMs},e.push(p),i.label=3;case 3:return n++,[3,1];case 4:return[2,e]}}))}))}}}}export{A as instantMeiliSearch};
//# sourceMappingURL=instant-meilisearch.esm.min.js.map

@@ -1,2 +0,2 @@

export declare const PACKAGE_VERSION = "0.18.0";
export declare const PACKAGE_VERSION = "0.18.1";
//# sourceMappingURL=package-version.d.ts.map
{
"name": "@meilisearch/instant-meilisearch",
"version": "0.18.0",
"version": "0.18.1",
"private": false,

@@ -53,3 +53,3 @@ "description": "The search client to use Meilisearch with InstantSearch.",

"dependencies": {
"meilisearch": "^0.39.0"
"meilisearch": "^0.40.0"
},

@@ -56,0 +56,0 @@ "devDependencies": {

@@ -1,1 +0,1 @@

export const PACKAGE_VERSION = '0.18.0'
export const PACKAGE_VERSION = '0.18.1'

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc