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

fuse.js

Package Overview
Dependencies
Maintainers
1
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fuse.js - npm Package Compare versions

Comparing version 6.2.0-beta.1 to 6.2.0

26

dist/fuse.basic.common.js
/**
* Fuse.js v6.2.0-beta.1 - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v6.2.0 - Lightweight fuzzy-search (http://fusejs.io)
*

@@ -343,6 +343,3 @@ * Copyright (c) 2020 Kiro Risk (http://kiro.me)

// More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm
ignoreFieldNorm: false,
// When `true`, if the search query is empty, return the whole list instead
// of an empty array.
matchEmptyQuery: false
ignoreFieldNorm: false
};

@@ -555,3 +552,4 @@ var Config = _objectSpread2({}, BasicOptions, {}, MatchOptions, {}, FuzzyOptions, {}, AdvancedOptions);

});
myIndex.setKeys(keys);
var keyStore = new KeyStore(keys);
myIndex.setKeys(keyStore.keys());
myIndex.setSources(docs);

@@ -1188,15 +1186,3 @@ myIndex.create();

sortFn = _this$options.sortFn,
ignoreFieldNorm = _this$options.ignoreFieldNorm,
matchEmptyQuery = _this$options.matchEmptyQuery;
if (matchEmptyQuery && (!isDefined(query) || isBlank(query))) {
return this._docs.map(function (doc, idx) {
return {
item: doc,
score: 1,
refIndex: idx
};
});
}
ignoreFieldNorm = _this$options.ignoreFieldNorm;
var results = isString(query) ? isString(this._docs[0]) ? this._searchStringList(query) : this._searchObjectList(query) : this._searchLogical(query);

@@ -1412,3 +1398,3 @@ computeScore$1(results, this._keyStore, {

Fuse.version = '6.2.0-beta.1';
Fuse.version = '6.2.0';
Fuse.createIndex = createIndex;

@@ -1415,0 +1401,0 @@ Fuse.parseIndex = parseIndex;

/**
* Fuse.js v6.2.0-beta.1 - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v6.2.0 - Lightweight fuzzy-search (http://fusejs.io)
*

@@ -221,6 +221,3 @@ * Copyright (c) 2020 Kiro Risk (http://kiro.me)

// More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm
ignoreFieldNorm: false,
// When `true`, if the search query is empty, return the whole list instead
// of an empty array.
matchEmptyQuery: false
ignoreFieldNorm: false
};

@@ -396,4 +393,5 @@

function createIndex(keys, docs, { getFn = Config.getFn } = {}) {
let myIndex = new FuseIndex({ getFn });
myIndex.setKeys(keys);
const myIndex = new FuseIndex({ getFn });
const keyStore = new KeyStore(keys);
myIndex.setKeys(keyStore.keys());
myIndex.setSources(docs);

@@ -406,3 +404,3 @@ myIndex.create();

const { keys, records } = data;
let myIndex = new FuseIndex({ getFn });
const myIndex = new FuseIndex({ getFn });
myIndex.setKeys(keys);

@@ -992,14 +990,5 @@ myIndex.setIndexRecords(records);

sortFn,
ignoreFieldNorm,
matchEmptyQuery
ignoreFieldNorm
} = this.options;
if (matchEmptyQuery && (!isDefined(query) || isBlank(query))) {
return this._docs.map((doc, idx) => ({
item: doc,
score: 1,
refIndex: idx
}))
}
let results = isString(query)

@@ -1186,3 +1175,3 @@ ? isString(this._docs[0])

Fuse.version = '6.2.0-beta.1';
Fuse.version = '6.2.0';
Fuse.createIndex = createIndex;

@@ -1189,0 +1178,0 @@ Fuse.parseIndex = parseIndex;

/**
* Fuse.js v6.2.0-beta.1 - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v6.2.0 - Lightweight fuzzy-search (http://fusejs.io)
*

@@ -9,2 +9,2 @@ * Copyright (c) 2020 Kiro Risk (http://kiro.me)

*/
function e(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}function t(e){return"string"==typeof e}function s(e){return"number"==typeof e}function n(e){return null!=e}function i(e){return!e.trim().length}const r=Object.prototype.hasOwnProperty;class o{constructor(e){this._keys={},this._keyNames=[];let s=0;e.forEach(e=>{let n,i=1;if(t(e))n=e;else{if(!r.call(e,"name"))throw new Error(`Missing ${"name"} property in key`);if(n=e.name,r.call(e,"weight")&&(i=e.weight,i<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(n))}this._keyNames.push(n),this._keys[n]={weight:i},s+=i}),this._keyNames.forEach(e=>{this._keys[e].weight/=s})}get(e,t){return this._keys[e]&&this._keys[e][t]}keys(){return this._keyNames}toJSON(){return JSON.stringify(this._keys)}}var c={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,...{useExtendedSearch:!1,getFn:function(i,r){let o=[],c=!1;const h=(i,r)=>{if(r){const a=r.indexOf(".");let l=r,d=null;-1!==a&&(l=r.slice(0,a),d=r.slice(a+1));const u=i[l];if(!n(u))return;if(d||!t(u)&&!s(u))if(e(u)){c=!0;for(let e=0,t=u.length;e<t;e+=1)h(u[e],d)}else d&&h(u,d);else o.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(u))}else o.push(i)};return h(i,r),c?o:o[0]},ignoreLocation:!1,ignoreFieldNorm:!1,matchEmptyQuery:!1}};const h=/[^ ]+/g;class a{constructor({getFn:e=c.getFn}={}){this.norm=function(e=3){const t=new Map;return{get(s){const n=s.match(h).length;if(t.has(n))return t.get(n);const i=parseFloat((1/Math.sqrt(n)).toFixed(e));return t.set(n,i),i},clear(){t.clear()}}}(3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,t(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){const s=this.size();t(e)?this._addString(e,s):this._addObject(e,s)}removeAt(e){this.records.splice(e,1);for(let t=e,s=this.size();t<s;t+=1)this.records[t].i-=1}size(){return this.records.length}_addString(e,t){if(!n(e)||i(e))return;let s={v:e,i:t,n:this.norm.get(e)};this.records.push(s)}_addObject(s,r){let o={i:r,$:{}};this.keys.forEach((r,c)=>{let h=this.getFn(s,r);if(n(h))if(e(h)){let s=[];const r=[{nestedArrIndex:-1,value:h}];for(;r.length;){const{nestedArrIndex:o,value:c}=r.pop();if(n(c))if(t(c)&&!i(c)){let e={v:c,i:o,n:this.norm.get(c)};s.push(e)}else e(c)&&c.forEach((e,t)=>{r.push({nestedArrIndex:t,value:e})})}o.$[c]=s}else if(!i(h)){let e={v:h,n:this.norm.get(h)};o.$[c]=e}}),this.records.push(o)}toJSON(){return{keys:this.keys,records:this.records}}}function l(e,t,{getFn:s=c.getFn}={}){let n=new a({getFn:s});return n.setKeys(e),n.setSources(t),n.create(),n}function d(e,t){const s=e.matches;t.matches=[],n(s)&&s.forEach(e=>{if(!n(e.indices)||!e.indices.length)return;const{indices:s,value:i}=e;let r={indices:s,value:i};e.key&&(r.key=e.key),e.idx>-1&&(r.refIndex=e.idx),t.matches.push(r)})}function u(e,t){t.score=e.score}function f(e,{errors:t=0,currentLocation:s=0,expectedLocation:n=0,distance:i=c.distance,ignoreLocation:r=c.ignoreLocation}={}){const o=t/e.length;if(r)return o;const h=Math.abs(n-s);return i?o+h/i:h?1:o}function g(e,t,s,{location:n=c.location,distance:i=c.distance,threshold:r=c.threshold,findAllMatches:o=c.findAllMatches,minMatchCharLength:h=c.minMatchCharLength,includeMatches:a=c.includeMatches,ignoreLocation:l=c.ignoreLocation}={}){if(t.length>32)throw new Error(`Pattern length exceeds max of ${32}.`);const d=t.length,u=e.length,g=Math.max(0,Math.min(n,u));let p=r,m=g;const y=h>1||a,M=y?Array(u):[];let x;for(;(x=e.indexOf(t,m))>-1;){let e=f(t,{currentLocation:x,expectedLocation:g,distance:i,ignoreLocation:l});if(p=Math.min(e,p),m=x+d,y){let e=0;for(;e<d;)M[x+e]=1,e+=1}}m=-1;let L=[],_=1,k=d+u;const v=1<<d-1;for(let n=0;n<d;n+=1){let r=0,c=k;for(;r<c;){f(t,{errors:n,currentLocation:g+c,expectedLocation:g,distance:i,ignoreLocation:l})<=p?r=c:k=c,c=Math.floor((k-r)/2+r)}k=c;let h=Math.max(1,g-c+1),a=o?u:Math.min(g+c,u)+d,x=Array(a+2);x[a+1]=(1<<n)-1;for(let r=a;r>=h;r-=1){let o=r-1,c=s[e.charAt(o)];if(y&&(M[o]=+!!c),x[r]=(x[r+1]<<1|1)&c,n&&(x[r]|=(L[r+1]|L[r])<<1|1|L[r+1]),x[r]&v&&(_=f(t,{errors:n,currentLocation:o,expectedLocation:g,distance:i,ignoreLocation:l}),_<=p)){if(p=_,m=o,m<=g)break;h=Math.max(1,2*g-m)}}if(f(t,{errors:n+1,currentLocation:g,expectedLocation:g,distance:i,ignoreLocation:l})>p)break;L=x}const S={isMatch:m>=0,score:Math.max(.001,_)};if(y){const e=function(e=[],t=c.minMatchCharLength){let s=[],n=-1,i=-1,r=0;for(let o=e.length;r<o;r+=1){let o=e[r];o&&-1===n?n=r:o||-1===n||(i=r-1,i-n+1>=t&&s.push([n,i]),n=-1)}return e[r-1]&&r-n>=t&&s.push([n,r-1]),s}(M,h);e.length?a&&(S.indices=e):S.isMatch=!1}return S}function p(e){let t={};for(let s=0,n=e.length;s<n;s+=1){const i=e.charAt(s);t[i]=(t[i]||0)|1<<n-s-1}return t}class m{constructor(e,{location:t=c.location,threshold:s=c.threshold,distance:n=c.distance,includeMatches:i=c.includeMatches,findAllMatches:r=c.findAllMatches,minMatchCharLength:o=c.minMatchCharLength,isCaseSensitive:h=c.isCaseSensitive,ignoreLocation:a=c.ignoreLocation}={}){if(this.options={location:t,threshold:s,distance:n,includeMatches:i,findAllMatches:r,minMatchCharLength:o,isCaseSensitive:h,ignoreLocation:a},this.pattern=h?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const l=(e,t)=>{this.chunks.push({pattern:e,alphabet:p(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0;const t=d%32,s=d-t;for(;e<s;)l(this.pattern.substr(e,32),e),e+=32;if(t){const e=d-32;l(this.pattern.substr(e),e)}}else l(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,includeMatches:s}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let t={isMatch:!0,score:0};return s&&(t.indices=[[0,e.length-1]]),t}const{location:n,distance:i,threshold:r,findAllMatches:o,minMatchCharLength:c,ignoreLocation:h}=this.options;let a=[],l=0,d=!1;this.chunks.forEach(({pattern:t,alphabet:u,startIndex:f})=>{const{isMatch:p,score:m,indices:y}=g(e,t,u,{location:n+f,distance:i,threshold:r,findAllMatches:o,minMatchCharLength:c,includeMatches:s,ignoreLocation:h});p&&(d=!0),l+=m,p&&y&&(a=[...a,...y])});let u={isMatch:d,score:d?l/this.chunks.length:1};return d&&s&&(u.indices=a),u}}const y=[];function M(e,t){for(let s=0,n=y.length;s<n;s+=1){let n=y[s];if(n.condition(e,t))return new n(e,t)}return new m(e,t)}class x{constructor(e,t={},s){if(this.options={...c,...t},this.options.useExtendedSearch)throw new Error("Extended search is not available");this._keyStore=new o(this.options.keys),this.setCollection(e,s)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof a))throw new Error("Incorrect 'index' type");this._myIndex=t||l(this._keyStore.keys(),this._docs,{getFn:this.options.getFn})}add(e){n(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=(()=>!1)){const t=[];for(let s=0,n=this._docs.length;s<n;s+=1){const n=this._docs[s];e(n,s)&&(this.removeAt(s),s-=1,t.push(n))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:r=-1}={}){const{includeMatches:o,includeScore:h,shouldSort:a,sortFn:l,ignoreFieldNorm:f,matchEmptyQuery:g}=this.options;if(g&&(!n(e)||i(e)))return this._docs.map((e,t)=>({item:e,score:1,refIndex:t}));let p=t(e)?t(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return function(e,t,{ignoreFieldNorm:s=c.ignoreFieldNorm}){e.forEach(e=>{let n=1;e.matches.forEach(({key:e,norm:i,score:r})=>{const o=t.get(e,"weight");n*=Math.pow(0===r&&o?Number.EPSILON:r,(o||1)*(s?1:i))}),e.score=n})}(p,this._keyStore,{ignoreFieldNorm:f}),a&&p.sort(l),s(r)&&r>-1&&(p=p.slice(0,r)),function(e,t,{includeMatches:s=c.includeMatches,includeScore:n=c.includeScore}={}){const i=[];s&&i.push(d);n&&i.push(u);return e.map(e=>{const{idx:s}=e,n={item:t[s],refIndex:s};return i.length&&i.forEach(t=>{t(e,n)}),n})}(p,this._docs,{includeMatches:o,includeScore:h})}_searchStringList(e){const t=M(e,this.options),{records:s}=this._myIndex,i=[];return s.forEach(({v:e,i:s,n:r})=>{if(!n(e))return;const{isMatch:o,score:c,indices:h}=t.searchIn(e);o&&i.push({item:e,idx:s,matches:[{score:c,value:e,norm:r,indices:h}]})}),i}_searchLogical(e){throw new Error("Logical search is not available")}_searchObjectList(e){const t=M(e,this.options),{keys:s,records:i}=this._myIndex,r=[];return i.forEach(({$:e,i:i})=>{if(!n(e))return;let o=[];s.forEach((s,n)=>{o.push(...this._findMatches({key:s,value:e[n],searcher:t}))}),o.length&&r.push({idx:i,item:e,matches:o})}),r}_findMatches({key:t,value:s,searcher:i}){if(!n(s))return[];let r=[];if(e(s))s.forEach(({v:e,i:s,n:o})=>{if(!n(e))return;const{isMatch:c,score:h,indices:a}=i.searchIn(e);c&&r.push({score:h,key:t,value:e,idx:s,norm:o,indices:a})});else{const{v:e,n:n}=s,{isMatch:o,score:c,indices:h}=i.searchIn(e);o&&r.push({score:c,key:t,value:e,norm:n,indices:h})}return r}}x.version="6.2.0-beta.1",x.createIndex=l,x.parseIndex=function(e,{getFn:t=c.getFn}={}){const{keys:s,records:n}=e;let i=new a({getFn:t});return i.setKeys(s),i.setIndexRecords(n),i},x.config=c;export default x;
function e(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}function t(e){return"string"==typeof e}function s(e){return"number"==typeof e}function n(e){return null!=e}function i(e){return!e.trim().length}const r=Object.prototype.hasOwnProperty;class o{constructor(e){this._keys={},this._keyNames=[];let s=0;e.forEach(e=>{let n,i=1;if(t(e))n=e;else{if(!r.call(e,"name"))throw new Error(`Missing ${"name"} property in key`);if(n=e.name,r.call(e,"weight")&&(i=e.weight,i<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(n))}this._keyNames.push(n),this._keys[n]={weight:i},s+=i}),this._keyNames.forEach(e=>{this._keys[e].weight/=s})}get(e,t){return this._keys[e]&&this._keys[e][t]}keys(){return this._keyNames}toJSON(){return JSON.stringify(this._keys)}}var c={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,...{useExtendedSearch:!1,getFn:function(i,r){let o=[],c=!1;const h=(i,r)=>{if(r){const a=r.indexOf(".");let l=r,d=null;-1!==a&&(l=r.slice(0,a),d=r.slice(a+1));const u=i[l];if(!n(u))return;if(d||!t(u)&&!s(u))if(e(u)){c=!0;for(let e=0,t=u.length;e<t;e+=1)h(u[e],d)}else d&&h(u,d);else o.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(u))}else o.push(i)};return h(i,r),c?o:o[0]},ignoreLocation:!1,ignoreFieldNorm:!1}};const h=/[^ ]+/g;class a{constructor({getFn:e=c.getFn}={}){this.norm=function(e=3){const t=new Map;return{get(s){const n=s.match(h).length;if(t.has(n))return t.get(n);const i=parseFloat((1/Math.sqrt(n)).toFixed(e));return t.set(n,i),i},clear(){t.clear()}}}(3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,t(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){const s=this.size();t(e)?this._addString(e,s):this._addObject(e,s)}removeAt(e){this.records.splice(e,1);for(let t=e,s=this.size();t<s;t+=1)this.records[t].i-=1}size(){return this.records.length}_addString(e,t){if(!n(e)||i(e))return;let s={v:e,i:t,n:this.norm.get(e)};this.records.push(s)}_addObject(s,r){let o={i:r,$:{}};this.keys.forEach((r,c)=>{let h=this.getFn(s,r);if(n(h))if(e(h)){let s=[];const r=[{nestedArrIndex:-1,value:h}];for(;r.length;){const{nestedArrIndex:o,value:c}=r.pop();if(n(c))if(t(c)&&!i(c)){let e={v:c,i:o,n:this.norm.get(c)};s.push(e)}else e(c)&&c.forEach((e,t)=>{r.push({nestedArrIndex:t,value:e})})}o.$[c]=s}else if(!i(h)){let e={v:h,n:this.norm.get(h)};o.$[c]=e}}),this.records.push(o)}toJSON(){return{keys:this.keys,records:this.records}}}function l(e,t,{getFn:s=c.getFn}={}){const n=new a({getFn:s}),i=new o(e);return n.setKeys(i.keys()),n.setSources(t),n.create(),n}function d(e,t){const s=e.matches;t.matches=[],n(s)&&s.forEach(e=>{if(!n(e.indices)||!e.indices.length)return;const{indices:s,value:i}=e;let r={indices:s,value:i};e.key&&(r.key=e.key),e.idx>-1&&(r.refIndex=e.idx),t.matches.push(r)})}function u(e,t){t.score=e.score}function f(e,{errors:t=0,currentLocation:s=0,expectedLocation:n=0,distance:i=c.distance,ignoreLocation:r=c.ignoreLocation}={}){const o=t/e.length;if(r)return o;const h=Math.abs(n-s);return i?o+h/i:h?1:o}function g(e,t,s,{location:n=c.location,distance:i=c.distance,threshold:r=c.threshold,findAllMatches:o=c.findAllMatches,minMatchCharLength:h=c.minMatchCharLength,includeMatches:a=c.includeMatches,ignoreLocation:l=c.ignoreLocation}={}){if(t.length>32)throw new Error(`Pattern length exceeds max of ${32}.`);const d=t.length,u=e.length,g=Math.max(0,Math.min(n,u));let p=r,m=g;const y=h>1||a,M=y?Array(u):[];let x;for(;(x=e.indexOf(t,m))>-1;){let e=f(t,{currentLocation:x,expectedLocation:g,distance:i,ignoreLocation:l});if(p=Math.min(e,p),m=x+d,y){let e=0;for(;e<d;)M[x+e]=1,e+=1}}m=-1;let L=[],_=1,k=d+u;const v=1<<d-1;for(let n=0;n<d;n+=1){let r=0,c=k;for(;r<c;){f(t,{errors:n,currentLocation:g+c,expectedLocation:g,distance:i,ignoreLocation:l})<=p?r=c:k=c,c=Math.floor((k-r)/2+r)}k=c;let h=Math.max(1,g-c+1),a=o?u:Math.min(g+c,u)+d,x=Array(a+2);x[a+1]=(1<<n)-1;for(let r=a;r>=h;r-=1){let o=r-1,c=s[e.charAt(o)];if(y&&(M[o]=+!!c),x[r]=(x[r+1]<<1|1)&c,n&&(x[r]|=(L[r+1]|L[r])<<1|1|L[r+1]),x[r]&v&&(_=f(t,{errors:n,currentLocation:o,expectedLocation:g,distance:i,ignoreLocation:l}),_<=p)){if(p=_,m=o,m<=g)break;h=Math.max(1,2*g-m)}}if(f(t,{errors:n+1,currentLocation:g,expectedLocation:g,distance:i,ignoreLocation:l})>p)break;L=x}const w={isMatch:m>=0,score:Math.max(.001,_)};if(y){const e=function(e=[],t=c.minMatchCharLength){let s=[],n=-1,i=-1,r=0;for(let o=e.length;r<o;r+=1){let o=e[r];o&&-1===n?n=r:o||-1===n||(i=r-1,i-n+1>=t&&s.push([n,i]),n=-1)}return e[r-1]&&r-n>=t&&s.push([n,r-1]),s}(M,h);e.length?a&&(w.indices=e):w.isMatch=!1}return w}function p(e){let t={};for(let s=0,n=e.length;s<n;s+=1){const i=e.charAt(s);t[i]=(t[i]||0)|1<<n-s-1}return t}class m{constructor(e,{location:t=c.location,threshold:s=c.threshold,distance:n=c.distance,includeMatches:i=c.includeMatches,findAllMatches:r=c.findAllMatches,minMatchCharLength:o=c.minMatchCharLength,isCaseSensitive:h=c.isCaseSensitive,ignoreLocation:a=c.ignoreLocation}={}){if(this.options={location:t,threshold:s,distance:n,includeMatches:i,findAllMatches:r,minMatchCharLength:o,isCaseSensitive:h,ignoreLocation:a},this.pattern=h?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const l=(e,t)=>{this.chunks.push({pattern:e,alphabet:p(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0;const t=d%32,s=d-t;for(;e<s;)l(this.pattern.substr(e,32),e),e+=32;if(t){const e=d-32;l(this.pattern.substr(e),e)}}else l(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,includeMatches:s}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let t={isMatch:!0,score:0};return s&&(t.indices=[[0,e.length-1]]),t}const{location:n,distance:i,threshold:r,findAllMatches:o,minMatchCharLength:c,ignoreLocation:h}=this.options;let a=[],l=0,d=!1;this.chunks.forEach(({pattern:t,alphabet:u,startIndex:f})=>{const{isMatch:p,score:m,indices:y}=g(e,t,u,{location:n+f,distance:i,threshold:r,findAllMatches:o,minMatchCharLength:c,includeMatches:s,ignoreLocation:h});p&&(d=!0),l+=m,p&&y&&(a=[...a,...y])});let u={isMatch:d,score:d?l/this.chunks.length:1};return d&&s&&(u.indices=a),u}}const y=[];function M(e,t){for(let s=0,n=y.length;s<n;s+=1){let n=y[s];if(n.condition(e,t))return new n(e,t)}return new m(e,t)}class x{constructor(e,t={},s){if(this.options={...c,...t},this.options.useExtendedSearch)throw new Error("Extended search is not available");this._keyStore=new o(this.options.keys),this.setCollection(e,s)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof a))throw new Error("Incorrect 'index' type");this._myIndex=t||l(this._keyStore.keys(),this._docs,{getFn:this.options.getFn})}add(e){n(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=(()=>!1)){const t=[];for(let s=0,n=this._docs.length;s<n;s+=1){const n=this._docs[s];e(n,s)&&(this.removeAt(s),s-=1,t.push(n))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:n=-1}={}){const{includeMatches:i,includeScore:r,shouldSort:o,sortFn:h,ignoreFieldNorm:a}=this.options;let l=t(e)?t(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return function(e,t,{ignoreFieldNorm:s=c.ignoreFieldNorm}){e.forEach(e=>{let n=1;e.matches.forEach(({key:e,norm:i,score:r})=>{const o=t.get(e,"weight");n*=Math.pow(0===r&&o?Number.EPSILON:r,(o||1)*(s?1:i))}),e.score=n})}(l,this._keyStore,{ignoreFieldNorm:a}),o&&l.sort(h),s(n)&&n>-1&&(l=l.slice(0,n)),function(e,t,{includeMatches:s=c.includeMatches,includeScore:n=c.includeScore}={}){const i=[];s&&i.push(d);n&&i.push(u);return e.map(e=>{const{idx:s}=e,n={item:t[s],refIndex:s};return i.length&&i.forEach(t=>{t(e,n)}),n})}(l,this._docs,{includeMatches:i,includeScore:r})}_searchStringList(e){const t=M(e,this.options),{records:s}=this._myIndex,i=[];return s.forEach(({v:e,i:s,n:r})=>{if(!n(e))return;const{isMatch:o,score:c,indices:h}=t.searchIn(e);o&&i.push({item:e,idx:s,matches:[{score:c,value:e,norm:r,indices:h}]})}),i}_searchLogical(e){throw new Error("Logical search is not available")}_searchObjectList(e){const t=M(e,this.options),{keys:s,records:i}=this._myIndex,r=[];return i.forEach(({$:e,i:i})=>{if(!n(e))return;let o=[];s.forEach((s,n)=>{o.push(...this._findMatches({key:s,value:e[n],searcher:t}))}),o.length&&r.push({idx:i,item:e,matches:o})}),r}_findMatches({key:t,value:s,searcher:i}){if(!n(s))return[];let r=[];if(e(s))s.forEach(({v:e,i:s,n:o})=>{if(!n(e))return;const{isMatch:c,score:h,indices:a}=i.searchIn(e);c&&r.push({score:h,key:t,value:e,idx:s,norm:o,indices:a})});else{const{v:e,n:n}=s,{isMatch:o,score:c,indices:h}=i.searchIn(e);o&&r.push({score:c,key:t,value:e,norm:n,indices:h})}return r}}x.version="6.2.0",x.createIndex=l,x.parseIndex=function(e,{getFn:t=c.getFn}={}){const{keys:s,records:n}=e,i=new a({getFn:t});return i.setKeys(s),i.setIndexRecords(n),i},x.config=c;export default x;
/**
* Fuse.js v6.2.0-beta.1 - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v6.2.0 - Lightweight fuzzy-search (http://fusejs.io)
*

@@ -347,6 +347,3 @@ * Copyright (c) 2020 Kiro Risk (http://kiro.me)

// More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm
ignoreFieldNorm: false,
// When `true`, if the search query is empty, return the whole list instead
// of an empty array.
matchEmptyQuery: false
ignoreFieldNorm: false
};

@@ -559,3 +556,4 @@ var Config = _objectSpread2({}, BasicOptions, {}, MatchOptions, {}, FuzzyOptions, {}, AdvancedOptions);

});
myIndex.setKeys(keys);
var keyStore = new KeyStore(keys);
myIndex.setKeys(keyStore.keys());
myIndex.setSources(docs);

@@ -1192,15 +1190,3 @@ myIndex.create();

sortFn = _this$options.sortFn,
ignoreFieldNorm = _this$options.ignoreFieldNorm,
matchEmptyQuery = _this$options.matchEmptyQuery;
if (matchEmptyQuery && (!isDefined(query) || isBlank(query))) {
return this._docs.map(function (doc, idx) {
return {
item: doc,
score: 1,
refIndex: idx
};
});
}
ignoreFieldNorm = _this$options.ignoreFieldNorm;
var results = isString(query) ? isString(this._docs[0]) ? this._searchStringList(query) : this._searchObjectList(query) : this._searchLogical(query);

@@ -1416,3 +1402,3 @@ computeScore$1(results, this._keyStore, {

Fuse.version = '6.2.0-beta.1';
Fuse.version = '6.2.0';
Fuse.createIndex = createIndex;

@@ -1419,0 +1405,0 @@ Fuse.parseIndex = parseIndex;

/**
* Fuse.js v6.2.0-beta.1 - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v6.2.0 - Lightweight fuzzy-search (http://fusejs.io)
*

@@ -9,2 +9,2 @@ * Copyright (c) 2020 Kiro Risk (http://kiro.me)

*/
var e,t;e=this,t=function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}function h(e){return"string"==typeof e}function u(e){return"number"==typeof e}function d(e){return null!=e}function f(e){return!e.trim().length}var l=function(e){return"Pattern length exceeds max of ".concat(e,".")},v=Object.prototype.hasOwnProperty,g=function(){function t(n){var r=this;e(this,t),this._keys={},this._keyNames=[];var i=0;n.forEach((function(e){var t,n=1;if(h(e))t=e;else{if(!v.call(e,"name"))throw new Error("Missing ".concat("name"," property in key"));if(t=e.name,v.call(e,"weight")&&(n=e.weight)<=0)throw new Error(function(e){return"Property 'weight' in key '".concat(e,"' must be a positive integer")}(t))}r._keyNames.push(t),r._keys[t]={weight:n},i+=n})),this._keyNames.forEach((function(e){r._keys[e].weight/=i}))}return n(t,[{key:"get",value:function(e,t){return this._keys[e]&&this._keys[e][t]}},{key:"keys",value:function(){return this._keyNames}},{key:"toJSON",value:function(){return JSON.stringify(this._keys)}}]),t}(),y=o({},{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:function(e,t){return e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1}},{},{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},{},{location:0,threshold:.6,distance:100},{},{useExtendedSearch:!1,getFn:function(e,t){var n=[],r=!1;return function e(t,i){if(i){var o=i.indexOf("."),a=i,s=null;-1!==o&&(a=i.slice(0,o),s=i.slice(o+1));var f=t[a];if(!d(f))return;if(s||!h(f)&&!u(f))if(c(f)){r=!0;for(var l=0,v=f.length;l<v;l+=1)e(f[l],s)}else s&&e(f,s);else n.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(f))}else n.push(t)}(e,t),r?n:n[0]},ignoreLocation:!1,ignoreFieldNorm:!1,matchEmptyQuery:!1}),p=/[^ ]+/g;function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=new Map;return{get:function(n){var r=n.match(p).length;if(t.has(r))return t.get(r);var i=parseFloat((1/Math.sqrt(r)).toFixed(e));return t.set(r,i),i},clear:function(){t.clear()}}}var k=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.getFn,i=void 0===r?y.getFn:r;e(this,t),this.norm=m(3),this.getFn=i,this.isCreated=!1,this.setIndexRecords()}return n(t,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=e}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,h(this.docs[0])?this.docs.forEach((function(t,n){e._addString(t,n)})):this.docs.forEach((function(t,n){e._addObject(t,n)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();h(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t<n;t+=1)this.records[t].i-=1}},{key:"size",value:function(){return this.records.length}},{key:"_addString",value:function(e,t){if(d(e)&&!f(e)){var n={v:e,i:t,n:this.norm.get(e)};this.records.push(n)}}},{key:"_addObject",value:function(e,t){var n=this,r={i:t,$:{}};this.keys.forEach((function(t,i){var o=n.getFn(e,t);if(d(o))if(c(o))!function(){for(var e=[],t=[{nestedArrIndex:-1,value:o}];t.length;){var a=t.pop(),s=a.nestedArrIndex,u=a.value;if(d(u))if(h(u)&&!f(u)){var l={v:u,i:s,n:n.norm.get(u)};e.push(l)}else c(u)&&u.forEach((function(e,n){t.push({nestedArrIndex:n,value:e})}))}r.$[i]=e}();else if(!f(o)){var a={v:o,n:n.norm.get(o)};r.$[i]=a}})),this.records.push(r)}},{key:"toJSON",value:function(){return{keys:this.keys,records:this.records}}}]),t}();function b(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?y.getFn:r,o=new k({getFn:i});return o.setKeys(e),o.setSources(t),o.create(),o}function M(e,t){var n=e.matches;t.matches=[],d(n)&&n.forEach((function(e){if(d(e.indices)&&e.indices.length){var n={indices:e.indices,value:e.value};e.key&&(n.key=e.key),e.idx>-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function x(e,t){t.score=e.score}function L(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.errors,r=void 0===n?0:n,i=t.currentLocation,o=void 0===i?0:i,a=t.expectedLocation,s=void 0===a?0:a,c=t.distance,h=void 0===c?y.distance:c,u=t.ignoreLocation,d=void 0===u?y.ignoreLocation:u,f=r/e.length;if(d)return f;var l=Math.abs(s-o);return h?f+l/h:l?1:f}function _(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y.minMatchCharLength,n=[],r=-1,i=-1,o=0,a=e.length;o<a;o+=1){var s=e[o];s&&-1===r?r=o:s||-1===r||((i=o-1)-r+1>=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}function w(e){for(var t={},n=0,r=e.length;n<r;n+=1){var i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}var O=function(){function t(n){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,a=void 0===o?y.location:o,s=i.threshold,c=void 0===s?y.threshold:s,h=i.distance,u=void 0===h?y.distance:h,d=i.includeMatches,f=void 0===d?y.includeMatches:d,l=i.findAllMatches,v=void 0===l?y.findAllMatches:l,g=i.minMatchCharLength,p=void 0===g?y.minMatchCharLength:g,m=i.isCaseSensitive,k=void 0===m?y.isCaseSensitive:m,b=i.ignoreLocation,M=void 0===b?y.ignoreLocation:b;if(e(this,t),this.options={location:a,threshold:c,distance:u,includeMatches:f,findAllMatches:v,minMatchCharLength:p,isCaseSensitive:k,ignoreLocation:M},this.pattern=k?n:n.toLowerCase(),this.chunks=[],this.pattern.length){var x=function(e,t){r.chunks.push({pattern:e,alphabet:w(e),startIndex:t})},L=this.pattern.length;if(L>32){for(var _=0,O=L%32,S=L-O;_<S;)x(this.pattern.substr(_,32),_),_+=32;if(O){var A=L-32;x(this.pattern.substr(A),A)}}else x(this.pattern,0)}}return n(t,[{key:"searchIn",value:function(e){var t=this.options,n=t.isCaseSensitive,r=t.includeMatches;if(n||(e=e.toLowerCase()),this.pattern===e){var i={isMatch:!0,score:0};return r&&(i.indices=[[0,e.length-1]]),i}var o=this.options,s=o.location,c=o.distance,h=o.threshold,u=o.findAllMatches,d=o.minMatchCharLength,f=o.ignoreLocation,v=[],g=0,p=!1;this.chunks.forEach((function(t){var n=t.pattern,i=t.alphabet,o=t.startIndex,m=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?y.location:i,a=r.distance,s=void 0===a?y.distance:a,c=r.threshold,h=void 0===c?y.threshold:c,u=r.findAllMatches,d=void 0===u?y.findAllMatches:u,f=r.minMatchCharLength,v=void 0===f?y.minMatchCharLength:f,g=r.includeMatches,p=void 0===g?y.includeMatches:g,m=r.ignoreLocation,k=void 0===m?y.ignoreLocation:m;if(t.length>32)throw new Error(l(32));for(var b,M=t.length,x=e.length,w=Math.max(0,Math.min(o,x)),O=h,S=w,A=v>1||p,E=A?Array(x):[];(b=e.indexOf(t,S))>-1;){var I=L(t,{currentLocation:b,expectedLocation:w,distance:s,ignoreLocation:k});if(O=Math.min(I,O),S=b+M,A)for(var j=0;j<M;)E[b+j]=1,j+=1}S=-1;for(var C=[],F=1,N=M+x,P=1<<M-1,$=0;$<M;$+=1){for(var D=0,z=N;D<z;){var J=L(t,{errors:$,currentLocation:w+z,expectedLocation:w,distance:s,ignoreLocation:k});J<=O?D=z:N=z,z=Math.floor((N-D)/2+D)}N=z;var K=Math.max(1,w-z+1),R=d?x:Math.min(w+z,x)+M,Q=Array(R+2);Q[R+1]=(1<<$)-1;for(var T=R;T>=K;T-=1){var q=T-1,U=n[e.charAt(q)];if(A&&(E[q]=+!!U),Q[T]=(Q[T+1]<<1|1)&U,$&&(Q[T]|=(C[T+1]|C[T])<<1|1|C[T+1]),Q[T]&P&&(F=L(t,{errors:$,currentLocation:q,expectedLocation:w,distance:s,ignoreLocation:k}))<=O){if(O=F,(S=q)<=w)break;K=Math.max(1,2*w-S)}}var B=L(t,{errors:$+1,currentLocation:w,expectedLocation:w,distance:s,ignoreLocation:k});if(B>O)break;C=Q}var G={isMatch:S>=0,score:Math.max(.001,F)};if(A){var H=_(E,v);H.length?p&&(G.indices=H):G.isMatch=!1}return G}(e,n,i,{location:s+o,distance:c,threshold:h,findAllMatches:u,minMatchCharLength:d,includeMatches:r,ignoreLocation:f}),k=m.isMatch,b=m.score,M=m.indices;k&&(p=!0),g+=b,k&&M&&(v=[].concat(a(v),a(M)))}));var m={isMatch:p,score:p?g/this.chunks.length:1};return p&&r&&(m.indices=v),m}}]),t}(),S=[];function A(e,t){for(var n=0,r=S.length;n<r;n+=1){var i=S[n];if(i.condition(e,t))return new i(e,t)}return new O(e,t)}var E=function(){function t(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;if(e(this,t),this.options=o({},y,{},r),this.options.useExtendedSearch)throw new Error("Extended search is not available");this._keyStore=new g(this.options.keys),this.setCollection(n,i)}return n(t,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof k))throw new Error("Incorrect 'index' type");this._myIndex=t||b(this._keyStore.keys(),this._docs,{getFn:this.options.getFn})}},{key:"add",value:function(e){d(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],n=0,r=this._docs.length;n<r;n+=1){var i=this._docs[n];e(i,n)&&(this.removeAt(n),n-=1,t.push(i))}return t}},{key:"removeAt",value:function(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}},{key:"getIndex",value:function(){return this._myIndex}},{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?-1:n,i=this.options,o=i.includeMatches,a=i.includeScore,s=i.shouldSort,c=i.sortFn,l=i.ignoreFieldNorm,v=i.matchEmptyQuery;if(v&&(!d(e)||f(e)))return this._docs.map((function(e,t){return{item:e,score:1,refIndex:t}}));var g=h(e)?h(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return I(g,this._keyStore,{ignoreFieldNorm:l}),s&&g.sort(c),u(r)&&r>-1&&(g=g.slice(0,r)),j(g,this._docs,{includeMatches:o,includeScore:a})}},{key:"_searchStringList",value:function(e){var t=A(e,this.options),n=this._myIndex.records,r=[];return n.forEach((function(e){var n=e.v,i=e.i,o=e.n;if(d(n)){var a=t.searchIn(n),s=a.isMatch,c=a.score,h=a.indices;s&&r.push({item:n,idx:i,matches:[{score:c,value:n,norm:o,indices:h}]})}})),r}},{key:"_searchLogical",value:function(e){throw new Error("Logical search is not available")}},{key:"_searchObjectList",value:function(e){var t=this,n=A(e,this.options),r=this._myIndex,i=r.keys,o=r.records,s=[];return o.forEach((function(e){var r=e.$,o=e.i;if(d(r)){var c=[];i.forEach((function(e,i){c.push.apply(c,a(t._findMatches({key:e,value:r[i],searcher:n})))})),c.length&&s.push({idx:o,item:r,matches:c})}})),s}},{key:"_findMatches",value:function(e){var t=e.key,n=e.value,r=e.searcher;if(!d(n))return[];var i=[];if(c(n))n.forEach((function(e){var n=e.v,o=e.i,a=e.n;if(d(n)){var s=r.searchIn(n),c=s.isMatch,h=s.score,u=s.indices;c&&i.push({score:h,key:t,value:n,idx:o,norm:a,indices:u})}}));else{var o=n.v,a=n.n,s=r.searchIn(o),h=s.isMatch,u=s.score,f=s.indices;h&&i.push({score:u,key:t,value:o,norm:a,indices:f})}return i}}]),t}();function I(e,t,n){var r=n.ignoreFieldNorm,i=void 0===r?y.ignoreFieldNorm:r;e.forEach((function(e){var n=1;e.matches.forEach((function(e){var r=e.key,o=e.norm,a=e.score,s=t.get(r,"weight");n*=Math.pow(0===a&&s?Number.EPSILON:a,(s||1)*(i?1:o))})),e.score=n}))}function j(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?y.includeMatches:r,o=n.includeScore,a=void 0===o?y.includeScore:o,s=[];return i&&s.push(M),a&&s.push(x),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return s.length&&s.forEach((function(t){t(e,r)})),r}))}return E.version="6.2.0-beta.1",E.createIndex=b,E.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?y.getFn:n,i=e.keys,o=e.records,a=new k({getFn:r});return a.setKeys(i),a.setIndexRecords(o),a},E.config=y,E},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Fuse=t();
var e,t;e=this,t=function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}function h(e){return"string"==typeof e}function u(e){return"number"==typeof e}function d(e){return null!=e}function l(e){return!e.trim().length}var f=function(e){return"Pattern length exceeds max of ".concat(e,".")},v=Object.prototype.hasOwnProperty,g=function(){function t(n){var r=this;e(this,t),this._keys={},this._keyNames=[];var i=0;n.forEach((function(e){var t,n=1;if(h(e))t=e;else{if(!v.call(e,"name"))throw new Error("Missing ".concat("name"," property in key"));if(t=e.name,v.call(e,"weight")&&(n=e.weight)<=0)throw new Error(function(e){return"Property 'weight' in key '".concat(e,"' must be a positive integer")}(t))}r._keyNames.push(t),r._keys[t]={weight:n},i+=n})),this._keyNames.forEach((function(e){r._keys[e].weight/=i}))}return n(t,[{key:"get",value:function(e,t){return this._keys[e]&&this._keys[e][t]}},{key:"keys",value:function(){return this._keyNames}},{key:"toJSON",value:function(){return JSON.stringify(this._keys)}}]),t}(),y=o({},{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:function(e,t){return e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1}},{},{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},{},{location:0,threshold:.6,distance:100},{},{useExtendedSearch:!1,getFn:function(e,t){var n=[],r=!1;return function e(t,i){if(i){var o=i.indexOf("."),a=i,s=null;-1!==o&&(a=i.slice(0,o),s=i.slice(o+1));var l=t[a];if(!d(l))return;if(s||!h(l)&&!u(l))if(c(l)){r=!0;for(var f=0,v=l.length;f<v;f+=1)e(l[f],s)}else s&&e(l,s);else n.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(l))}else n.push(t)}(e,t),r?n:n[0]},ignoreLocation:!1,ignoreFieldNorm:!1}),p=/[^ ]+/g;function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=new Map;return{get:function(n){var r=n.match(p).length;if(t.has(r))return t.get(r);var i=parseFloat((1/Math.sqrt(r)).toFixed(e));return t.set(r,i),i},clear:function(){t.clear()}}}var k=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.getFn,i=void 0===r?y.getFn:r;e(this,t),this.norm=m(3),this.getFn=i,this.isCreated=!1,this.setIndexRecords()}return n(t,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=e}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,h(this.docs[0])?this.docs.forEach((function(t,n){e._addString(t,n)})):this.docs.forEach((function(t,n){e._addObject(t,n)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();h(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t<n;t+=1)this.records[t].i-=1}},{key:"size",value:function(){return this.records.length}},{key:"_addString",value:function(e,t){if(d(e)&&!l(e)){var n={v:e,i:t,n:this.norm.get(e)};this.records.push(n)}}},{key:"_addObject",value:function(e,t){var n=this,r={i:t,$:{}};this.keys.forEach((function(t,i){var o=n.getFn(e,t);if(d(o))if(c(o))!function(){for(var e=[],t=[{nestedArrIndex:-1,value:o}];t.length;){var a=t.pop(),s=a.nestedArrIndex,u=a.value;if(d(u))if(h(u)&&!l(u)){var f={v:u,i:s,n:n.norm.get(u)};e.push(f)}else c(u)&&u.forEach((function(e,n){t.push({nestedArrIndex:n,value:e})}))}r.$[i]=e}();else if(!l(o)){var a={v:o,n:n.norm.get(o)};r.$[i]=a}})),this.records.push(r)}},{key:"toJSON",value:function(){return{keys:this.keys,records:this.records}}}]),t}();function b(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?y.getFn:r,o=new k({getFn:i}),a=new g(e);return o.setKeys(a.keys()),o.setSources(t),o.create(),o}function M(e,t){var n=e.matches;t.matches=[],d(n)&&n.forEach((function(e){if(d(e.indices)&&e.indices.length){var n={indices:e.indices,value:e.value};e.key&&(n.key=e.key),e.idx>-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function x(e,t){t.score=e.score}function L(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.errors,r=void 0===n?0:n,i=t.currentLocation,o=void 0===i?0:i,a=t.expectedLocation,s=void 0===a?0:a,c=t.distance,h=void 0===c?y.distance:c,u=t.ignoreLocation,d=void 0===u?y.ignoreLocation:u,l=r/e.length;if(d)return l;var f=Math.abs(s-o);return h?l+f/h:f?1:l}function w(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y.minMatchCharLength,n=[],r=-1,i=-1,o=0,a=e.length;o<a;o+=1){var s=e[o];s&&-1===r?r=o:s||-1===r||((i=o-1)-r+1>=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}function _(e){for(var t={},n=0,r=e.length;n<r;n+=1){var i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}var O=function(){function t(n){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,a=void 0===o?y.location:o,s=i.threshold,c=void 0===s?y.threshold:s,h=i.distance,u=void 0===h?y.distance:h,d=i.includeMatches,l=void 0===d?y.includeMatches:d,f=i.findAllMatches,v=void 0===f?y.findAllMatches:f,g=i.minMatchCharLength,p=void 0===g?y.minMatchCharLength:g,m=i.isCaseSensitive,k=void 0===m?y.isCaseSensitive:m,b=i.ignoreLocation,M=void 0===b?y.ignoreLocation:b;if(e(this,t),this.options={location:a,threshold:c,distance:u,includeMatches:l,findAllMatches:v,minMatchCharLength:p,isCaseSensitive:k,ignoreLocation:M},this.pattern=k?n:n.toLowerCase(),this.chunks=[],this.pattern.length){var x=function(e,t){r.chunks.push({pattern:e,alphabet:_(e),startIndex:t})},L=this.pattern.length;if(L>32){for(var w=0,O=L%32,S=L-O;w<S;)x(this.pattern.substr(w,32),w),w+=32;if(O){var A=L-32;x(this.pattern.substr(A),A)}}else x(this.pattern,0)}}return n(t,[{key:"searchIn",value:function(e){var t=this.options,n=t.isCaseSensitive,r=t.includeMatches;if(n||(e=e.toLowerCase()),this.pattern===e){var i={isMatch:!0,score:0};return r&&(i.indices=[[0,e.length-1]]),i}var o=this.options,s=o.location,c=o.distance,h=o.threshold,u=o.findAllMatches,d=o.minMatchCharLength,l=o.ignoreLocation,v=[],g=0,p=!1;this.chunks.forEach((function(t){var n=t.pattern,i=t.alphabet,o=t.startIndex,m=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?y.location:i,a=r.distance,s=void 0===a?y.distance:a,c=r.threshold,h=void 0===c?y.threshold:c,u=r.findAllMatches,d=void 0===u?y.findAllMatches:u,l=r.minMatchCharLength,v=void 0===l?y.minMatchCharLength:l,g=r.includeMatches,p=void 0===g?y.includeMatches:g,m=r.ignoreLocation,k=void 0===m?y.ignoreLocation:m;if(t.length>32)throw new Error(f(32));for(var b,M=t.length,x=e.length,_=Math.max(0,Math.min(o,x)),O=h,S=_,A=v>1||p,E=A?Array(x):[];(b=e.indexOf(t,S))>-1;){var I=L(t,{currentLocation:b,expectedLocation:_,distance:s,ignoreLocation:k});if(O=Math.min(I,O),S=b+M,A)for(var j=0;j<M;)E[b+j]=1,j+=1}S=-1;for(var C=[],F=1,N=M+x,P=1<<M-1,$=0;$<M;$+=1){for(var D=0,z=N;D<z;){var J=L(t,{errors:$,currentLocation:_+z,expectedLocation:_,distance:s,ignoreLocation:k});J<=O?D=z:N=z,z=Math.floor((N-D)/2+D)}N=z;var K=Math.max(1,_-z+1),R=d?x:Math.min(_+z,x)+M,T=Array(R+2);T[R+1]=(1<<$)-1;for(var q=R;q>=K;q-=1){var U=q-1,B=n[e.charAt(U)];if(A&&(E[U]=+!!B),T[q]=(T[q+1]<<1|1)&B,$&&(T[q]|=(C[q+1]|C[q])<<1|1|C[q+1]),T[q]&P&&(F=L(t,{errors:$,currentLocation:U,expectedLocation:_,distance:s,ignoreLocation:k}))<=O){if(O=F,(S=U)<=_)break;K=Math.max(1,2*_-S)}}var G=L(t,{errors:$+1,currentLocation:_,expectedLocation:_,distance:s,ignoreLocation:k});if(G>O)break;C=T}var H={isMatch:S>=0,score:Math.max(.001,F)};if(A){var Q=w(E,v);Q.length?p&&(H.indices=Q):H.isMatch=!1}return H}(e,n,i,{location:s+o,distance:c,threshold:h,findAllMatches:u,minMatchCharLength:d,includeMatches:r,ignoreLocation:l}),k=m.isMatch,b=m.score,M=m.indices;k&&(p=!0),g+=b,k&&M&&(v=[].concat(a(v),a(M)))}));var m={isMatch:p,score:p?g/this.chunks.length:1};return p&&r&&(m.indices=v),m}}]),t}(),S=[];function A(e,t){for(var n=0,r=S.length;n<r;n+=1){var i=S[n];if(i.condition(e,t))return new i(e,t)}return new O(e,t)}var E=function(){function t(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;if(e(this,t),this.options=o({},y,{},r),this.options.useExtendedSearch)throw new Error("Extended search is not available");this._keyStore=new g(this.options.keys),this.setCollection(n,i)}return n(t,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof k))throw new Error("Incorrect 'index' type");this._myIndex=t||b(this._keyStore.keys(),this._docs,{getFn:this.options.getFn})}},{key:"add",value:function(e){d(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],n=0,r=this._docs.length;n<r;n+=1){var i=this._docs[n];e(i,n)&&(this.removeAt(n),n-=1,t.push(i))}return t}},{key:"removeAt",value:function(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}},{key:"getIndex",value:function(){return this._myIndex}},{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?-1:n,i=this.options,o=i.includeMatches,a=i.includeScore,s=i.shouldSort,c=i.sortFn,d=i.ignoreFieldNorm,l=h(e)?h(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return I(l,this._keyStore,{ignoreFieldNorm:d}),s&&l.sort(c),u(r)&&r>-1&&(l=l.slice(0,r)),j(l,this._docs,{includeMatches:o,includeScore:a})}},{key:"_searchStringList",value:function(e){var t=A(e,this.options),n=this._myIndex.records,r=[];return n.forEach((function(e){var n=e.v,i=e.i,o=e.n;if(d(n)){var a=t.searchIn(n),s=a.isMatch,c=a.score,h=a.indices;s&&r.push({item:n,idx:i,matches:[{score:c,value:n,norm:o,indices:h}]})}})),r}},{key:"_searchLogical",value:function(e){throw new Error("Logical search is not available")}},{key:"_searchObjectList",value:function(e){var t=this,n=A(e,this.options),r=this._myIndex,i=r.keys,o=r.records,s=[];return o.forEach((function(e){var r=e.$,o=e.i;if(d(r)){var c=[];i.forEach((function(e,i){c.push.apply(c,a(t._findMatches({key:e,value:r[i],searcher:n})))})),c.length&&s.push({idx:o,item:r,matches:c})}})),s}},{key:"_findMatches",value:function(e){var t=e.key,n=e.value,r=e.searcher;if(!d(n))return[];var i=[];if(c(n))n.forEach((function(e){var n=e.v,o=e.i,a=e.n;if(d(n)){var s=r.searchIn(n),c=s.isMatch,h=s.score,u=s.indices;c&&i.push({score:h,key:t,value:n,idx:o,norm:a,indices:u})}}));else{var o=n.v,a=n.n,s=r.searchIn(o),h=s.isMatch,u=s.score,l=s.indices;h&&i.push({score:u,key:t,value:o,norm:a,indices:l})}return i}}]),t}();function I(e,t,n){var r=n.ignoreFieldNorm,i=void 0===r?y.ignoreFieldNorm:r;e.forEach((function(e){var n=1;e.matches.forEach((function(e){var r=e.key,o=e.norm,a=e.score,s=t.get(r,"weight");n*=Math.pow(0===a&&s?Number.EPSILON:a,(s||1)*(i?1:o))})),e.score=n}))}function j(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?y.includeMatches:r,o=n.includeScore,a=void 0===o?y.includeScore:o,s=[];return i&&s.push(M),a&&s.push(x),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return s.length&&s.forEach((function(t){t(e,r)})),r}))}return E.version="6.2.0",E.createIndex=b,E.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?y.getFn:n,i=e.keys,o=e.records,a=new k({getFn:r});return a.setKeys(i),a.setIndexRecords(o),a},E.config=y,E},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Fuse=t();
/**
* Fuse.js v6.2.0-beta.1 - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v6.2.0 - Lightweight fuzzy-search (http://fusejs.io)
*

@@ -421,6 +421,3 @@ * Copyright (c) 2020 Kiro Risk (http://kiro.me)

// More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm
ignoreFieldNorm: false,
// When `true`, if the search query is empty, return the whole list instead
// of an empty array.
matchEmptyQuery: false
ignoreFieldNorm: false
};

@@ -633,3 +630,4 @@ var Config = _objectSpread2({}, BasicOptions, {}, MatchOptions, {}, FuzzyOptions, {}, AdvancedOptions);

});
myIndex.setKeys(keys);
var keyStore = new KeyStore(keys);
myIndex.setKeys(keyStore.keys());
myIndex.setSources(docs);

@@ -1828,15 +1826,3 @@ myIndex.create();

sortFn = _this$options.sortFn,
ignoreFieldNorm = _this$options.ignoreFieldNorm,
matchEmptyQuery = _this$options.matchEmptyQuery;
if (matchEmptyQuery && (!isDefined(query) || isBlank(query))) {
return this._docs.map(function (doc, idx) {
return {
item: doc,
score: 1,
refIndex: idx
};
});
}
ignoreFieldNorm = _this$options.ignoreFieldNorm;
var results = isString(query) ? isString(this._docs[0]) ? this._searchStringList(query) : this._searchObjectList(query) : this._searchLogical(query);

@@ -2124,3 +2110,3 @@ computeScore$1(results, this._keyStore, {

Fuse.version = '6.2.0-beta.1';
Fuse.version = '6.2.0';
Fuse.createIndex = createIndex;

@@ -2127,0 +2113,0 @@ Fuse.parseIndex = parseIndex;

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

// Type definitions for Fuse.js v6.2.0-beta.1
// Type definitions for Fuse.js v6.2.0
// TypeScript v3.9.5

@@ -3,0 +3,0 @@

/**
* Fuse.js v6.2.0-beta.1 - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v6.2.0 - Lightweight fuzzy-search (http://fusejs.io)
*

@@ -219,6 +219,3 @@ * Copyright (c) 2020 Kiro Risk (http://kiro.me)

// More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm
ignoreFieldNorm: false,
// When `true`, if the search query is empty, return the whole list instead
// of an empty array.
matchEmptyQuery: false
ignoreFieldNorm: false
};

@@ -394,4 +391,5 @@

function createIndex(keys, docs, { getFn = Config.getFn } = {}) {
let myIndex = new FuseIndex({ getFn });
myIndex.setKeys(keys);
const myIndex = new FuseIndex({ getFn });
const keyStore = new KeyStore(keys);
myIndex.setKeys(keyStore.keys());
myIndex.setSources(docs);

@@ -404,3 +402,3 @@ myIndex.create();

const { keys, records } = data;
let myIndex = new FuseIndex({ getFn });
const myIndex = new FuseIndex({ getFn });
myIndex.setKeys(keys);

@@ -1417,14 +1415,5 @@ myIndex.setIndexRecords(records);

sortFn,
ignoreFieldNorm,
matchEmptyQuery
ignoreFieldNorm
} = this.options;
if (matchEmptyQuery && (!isDefined(query) || isBlank(query))) {
return this._docs.map((doc, idx) => ({
item: doc,
score: 1,
refIndex: idx
}))
}
let results = isString(query)

@@ -1669,3 +1658,3 @@ ? isString(this._docs[0])

Fuse.version = '6.2.0-beta.1';
Fuse.version = '6.2.0';
Fuse.createIndex = createIndex;

@@ -1672,0 +1661,0 @@ Fuse.parseIndex = parseIndex;

/**
* Fuse.js v6.2.0-beta.1 - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v6.2.0 - Lightweight fuzzy-search (http://fusejs.io)
*

@@ -9,2 +9,2 @@ * Copyright (c) 2020 Kiro Risk (http://kiro.me)

*/
function t(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function e(t){return"string"==typeof t}function s(t){return"number"==typeof t}function n(t){return null!=t}function i(t){return!t.trim().length}const r=Object.prototype.hasOwnProperty;class c{constructor(t){this._keys={},this._keyNames=[];let s=0;t.forEach(t=>{let n,i=1;if(e(t))n=t;else{if(!r.call(t,"name"))throw new Error(`Missing ${"name"} property in key`);if(n=t.name,r.call(t,"weight")&&(i=t.weight,i<=0))throw new Error((t=>`Property 'weight' in key '${t}' must be a positive integer`)(n))}this._keyNames.push(n),this._keys[n]={weight:i},s+=i}),this._keyNames.forEach(t=>{this._keys[t].weight/=s})}get(t,e){return this._keys[t]&&this._keys[t][e]}keys(){return this._keyNames}toJSON(){return JSON.stringify(this._keys)}}var o={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,...{useExtendedSearch:!1,getFn:function(i,r){let c=[],o=!1;const h=(i,r)=>{if(r){const a=r.indexOf(".");let l=r,u=null;-1!==a&&(l=r.slice(0,a),u=r.slice(a+1));const d=i[l];if(!n(d))return;if(u||!e(d)&&!s(d))if(t(d)){o=!0;for(let t=0,e=d.length;t<e;t+=1)h(d[t],u)}else u&&h(d,u);else c.push(function(t){return null==t?"":function(t){if("string"==typeof t)return t;let e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(t)}(d))}else c.push(i)};return h(i,r),o?c:c[0]},ignoreLocation:!1,ignoreFieldNorm:!1,matchEmptyQuery:!1}};const h=/[^ ]+/g;class a{constructor({getFn:t=o.getFn}={}){this.norm=function(t=3){const e=new Map;return{get(s){const n=s.match(h).length;if(e.has(n))return e.get(n);const i=parseFloat((1/Math.sqrt(n)).toFixed(t));return e.set(n,i),i},clear(){e.clear()}}}(3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,e(this.docs[0])?this.docs.forEach((t,e)=>{this._addString(t,e)}):this.docs.forEach((t,e)=>{this._addObject(t,e)}),this.norm.clear())}add(t){const s=this.size();e(t)?this._addString(t,s):this._addObject(t,s)}removeAt(t){this.records.splice(t,1);for(let e=t,s=this.size();e<s;e+=1)this.records[e].i-=1}size(){return this.records.length}_addString(t,e){if(!n(t)||i(t))return;let s={v:t,i:e,n:this.norm.get(t)};this.records.push(s)}_addObject(s,r){let c={i:r,$:{}};this.keys.forEach((r,o)=>{let h=this.getFn(s,r);if(n(h))if(t(h)){let s=[];const r=[{nestedArrIndex:-1,value:h}];for(;r.length;){const{nestedArrIndex:c,value:o}=r.pop();if(n(o))if(e(o)&&!i(o)){let t={v:o,i:c,n:this.norm.get(o)};s.push(t)}else t(o)&&o.forEach((t,e)=>{r.push({nestedArrIndex:e,value:t})})}c.$[o]=s}else if(!i(h)){let t={v:h,n:this.norm.get(h)};c.$[o]=t}}),this.records.push(c)}toJSON(){return{keys:this.keys,records:this.records}}}function l(t,e,{getFn:s=o.getFn}={}){let n=new a({getFn:s});return n.setKeys(t),n.setSources(e),n.create(),n}function u(t,e){const s=t.matches;e.matches=[],n(s)&&s.forEach(t=>{if(!n(t.indices)||!t.indices.length)return;const{indices:s,value:i}=t;let r={indices:s,value:i};t.key&&(r.key=t.key),t.idx>-1&&(r.refIndex=t.idx),e.matches.push(r)})}function d(t,e){e.score=t.score}function g(t,{errors:e=0,currentLocation:s=0,expectedLocation:n=0,distance:i=o.distance,ignoreLocation:r=o.ignoreLocation}={}){const c=e/t.length;if(r)return c;const h=Math.abs(n-s);return i?c+h/i:h?1:c}function f(t,e,s,{location:n=o.location,distance:i=o.distance,threshold:r=o.threshold,findAllMatches:c=o.findAllMatches,minMatchCharLength:h=o.minMatchCharLength,includeMatches:a=o.includeMatches,ignoreLocation:l=o.ignoreLocation}={}){if(e.length>32)throw new Error(`Pattern length exceeds max of ${32}.`);const u=e.length,d=t.length,f=Math.max(0,Math.min(n,d));let p=r,m=f;const M=h>1||a,x=M?Array(d):[];let y;for(;(y=t.indexOf(e,m))>-1;){let t=g(e,{currentLocation:y,expectedLocation:f,distance:i,ignoreLocation:l});if(p=Math.min(t,p),m=y+u,M){let t=0;for(;t<u;)x[y+t]=1,t+=1}}m=-1;let k=[],L=1,_=u+d;const v=1<<u-1;for(let n=0;n<u;n+=1){let r=0,o=_;for(;r<o;){g(e,{errors:n,currentLocation:f+o,expectedLocation:f,distance:i,ignoreLocation:l})<=p?r=o:_=o,o=Math.floor((_-r)/2+r)}_=o;let h=Math.max(1,f-o+1),a=c?d:Math.min(f+o,d)+u,y=Array(a+2);y[a+1]=(1<<n)-1;for(let r=a;r>=h;r-=1){let c=r-1,o=s[t.charAt(c)];if(M&&(x[c]=+!!o),y[r]=(y[r+1]<<1|1)&o,n&&(y[r]|=(k[r+1]|k[r])<<1|1|k[r+1]),y[r]&v&&(L=g(e,{errors:n,currentLocation:c,expectedLocation:f,distance:i,ignoreLocation:l}),L<=p)){if(p=L,m=c,m<=f)break;h=Math.max(1,2*f-m)}}if(g(e,{errors:n+1,currentLocation:f,expectedLocation:f,distance:i,ignoreLocation:l})>p)break;k=y}const S={isMatch:m>=0,score:Math.max(.001,L)};if(M){const t=function(t=[],e=o.minMatchCharLength){let s=[],n=-1,i=-1,r=0;for(let c=t.length;r<c;r+=1){let c=t[r];c&&-1===n?n=r:c||-1===n||(i=r-1,i-n+1>=e&&s.push([n,i]),n=-1)}return t[r-1]&&r-n>=e&&s.push([n,r-1]),s}(x,h);t.length?a&&(S.indices=t):S.isMatch=!1}return S}function p(t){let e={};for(let s=0,n=t.length;s<n;s+=1){const i=t.charAt(s);e[i]=(e[i]||0)|1<<n-s-1}return e}class m{constructor(t,{location:e=o.location,threshold:s=o.threshold,distance:n=o.distance,includeMatches:i=o.includeMatches,findAllMatches:r=o.findAllMatches,minMatchCharLength:c=o.minMatchCharLength,isCaseSensitive:h=o.isCaseSensitive,ignoreLocation:a=o.ignoreLocation}={}){if(this.options={location:e,threshold:s,distance:n,includeMatches:i,findAllMatches:r,minMatchCharLength:c,isCaseSensitive:h,ignoreLocation:a},this.pattern=h?t:t.toLowerCase(),this.chunks=[],!this.pattern.length)return;const l=(t,e)=>{this.chunks.push({pattern:t,alphabet:p(t),startIndex:e})},u=this.pattern.length;if(u>32){let t=0;const e=u%32,s=u-e;for(;t<s;)l(this.pattern.substr(t,32),t),t+=32;if(e){const t=u-32;l(this.pattern.substr(t),t)}}else l(this.pattern,0)}searchIn(t){const{isCaseSensitive:e,includeMatches:s}=this.options;if(e||(t=t.toLowerCase()),this.pattern===t){let e={isMatch:!0,score:0};return s&&(e.indices=[[0,t.length-1]]),e}const{location:n,distance:i,threshold:r,findAllMatches:c,minMatchCharLength:o,ignoreLocation:h}=this.options;let a=[],l=0,u=!1;this.chunks.forEach(({pattern:e,alphabet:d,startIndex:g})=>{const{isMatch:p,score:m,indices:M}=f(t,e,d,{location:n+g,distance:i,threshold:r,findAllMatches:c,minMatchCharLength:o,includeMatches:s,ignoreLocation:h});p&&(u=!0),l+=m,p&&M&&(a=[...a,...M])});let d={isMatch:u,score:u?l/this.chunks.length:1};return u&&s&&(d.indices=a),d}}class M{constructor(t){this.pattern=t}static isMultiMatch(t){return x(t,this.multiRegex)}static isSingleMatch(t){return x(t,this.singleRegex)}search(){}}function x(t,e){const s=t.match(e);return s?s[1]:null}class y extends M{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e,s=0;const n=[],i=this.pattern.length;for(;(e=t.indexOf(this.pattern,s))>-1;)s=e+i,n.push([e,s-1]);const r=!!n.length;return{isMatch:r,score:r?1:0,indices:n}}}class k extends M{constructor(t,{location:e=o.location,threshold:s=o.threshold,distance:n=o.distance,includeMatches:i=o.includeMatches,findAllMatches:r=o.findAllMatches,minMatchCharLength:c=o.minMatchCharLength,isCaseSensitive:h=o.isCaseSensitive}={}){super(t),this._bitapSearch=new m(t,{location:e,threshold:s,distance:n,includeMatches:i,findAllMatches:r,minMatchCharLength:c,isCaseSensitive:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}const L=[y,class extends M{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},class extends M{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends M{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends M{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}},class extends M{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const e=-1===t.indexOf(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},k],_=L.length,v=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/;const S=new Set([k.type,y.type]);class C{constructor(t,{isCaseSensitive:e=o.isCaseSensitive,includeMatches:s=o.includeMatches,minMatchCharLength:n=o.minMatchCharLength,findAllMatches:i=o.findAllMatches,location:r=o.location,threshold:c=o.threshold,distance:h=o.distance}={}){this.query=null,this.options={isCaseSensitive:e,includeMatches:s,minMatchCharLength:n,findAllMatches:i,location:r,threshold:c,distance:h},this.pattern=e?t:t.toLowerCase(),this.query=function(t,e={}){return t.split("|").map(t=>{let s=t.trim().split(v).filter(t=>t&&!!t.trim()),n=[];for(let t=0,i=s.length;t<i;t+=1){const i=s[t];let r=!1,c=-1;for(;!r&&++c<_;){const t=L[c];let s=t.isMultiMatch(i);s&&(n.push(new t(s,e)),r=!0)}if(!r)for(c=-1;++c<_;){const t=L[c];let s=t.isSingleMatch(i);if(s){n.push(new t(s,e));break}}}return n})}(this.pattern,this.options)}static condition(t,e){return e.useExtendedSearch}searchIn(t){const e=this.query;if(!e)return{isMatch:!1,score:1};const{includeMatches:s,isCaseSensitive:n}=this.options;t=n?t:t.toLowerCase();let i=0,r=[],c=0;for(let n=0,o=e.length;n<o;n+=1){const o=e[n];r.length=0,i=0;for(let e=0,n=o.length;e<n;e+=1){const n=o[e],{isMatch:h,indices:a,score:l}=n.search(t);if(!h){c=0,i=0,r.length=0;break}if(i+=1,c+=l,s){const t=n.constructor.type;S.has(t)?r=[...r,...a]:r.push(a)}}if(i){let t={isMatch:!0,score:c/i};return s&&(t.indices=r),t}}return{isMatch:!1,score:1}}}const w=[];function A(t,e){for(let s=0,n=w.length;s<n;s+=1){let n=w[s];if(n.condition(t,e))return new n(t,e)}return new m(t,e)}const E="$and",I="$or",$=t=>!(!t[E]&&!t[I]),b=t=>({[E]:Object.keys(t).map(e=>({[e]:t[e]}))});function F(s,n,{auto:i=!0}={}){const r=s=>{let c=Object.keys(s);if(c.length>1&&!$(s))return r(b(s));let o=c[0];if((e=>!t(e)&&"object"==typeof e&&!$(e))(s)){const t=s[o];if(!e(t))throw new Error((t=>"Invalid value for key "+t)(o));const r={key:o,pattern:t};return i&&(r.searcher=A(t,n)),r}let h={children:[],operator:o};return c.forEach(e=>{const n=s[e];t(n)&&n.forEach(t=>{h.children.push(r(t))})}),h};return $(s)||(s=b(s)),r(s)}class O{constructor(t,e={},s){this.options={...o,...e},this.options.useExtendedSearch,this._keyStore=new c(this.options.keys),this.setCollection(t,s)}setCollection(t,e){if(this._docs=t,e&&!(e instanceof a))throw new Error("Incorrect 'index' type");this._myIndex=e||l(this._keyStore.keys(),this._docs,{getFn:this.options.getFn})}add(t){n(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=(()=>!1)){const e=[];for(let s=0,n=this._docs.length;s<n;s+=1){const n=this._docs[s];t(n,s)&&(this.removeAt(s),s-=1,e.push(n))}return e}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:r=-1}={}){const{includeMatches:c,includeScore:h,shouldSort:a,sortFn:l,ignoreFieldNorm:g,matchEmptyQuery:f}=this.options;if(f&&(!n(t)||i(t)))return this._docs.map((t,e)=>({item:t,score:1,refIndex:e}));let p=e(t)?e(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return function(t,e,{ignoreFieldNorm:s=o.ignoreFieldNorm}){t.forEach(t=>{let n=1;t.matches.forEach(({key:t,norm:i,score:r})=>{const c=e.get(t,"weight");n*=Math.pow(0===r&&c?Number.EPSILON:r,(c||1)*(s?1:i))}),t.score=n})}(p,this._keyStore,{ignoreFieldNorm:g}),a&&p.sort(l),s(r)&&r>-1&&(p=p.slice(0,r)),function(t,e,{includeMatches:s=o.includeMatches,includeScore:n=o.includeScore}={}){const i=[];s&&i.push(u);n&&i.push(d);return t.map(t=>{const{idx:s}=t,n={item:e[s],refIndex:s};return i.length&&i.forEach(e=>{e(t,n)}),n})}(p,this._docs,{includeMatches:c,includeScore:h})}_searchStringList(t){const e=A(t,this.options),{records:s}=this._myIndex,i=[];return s.forEach(({v:t,i:s,n:r})=>{if(!n(t))return;const{isMatch:c,score:o,indices:h}=e.searchIn(t);c&&i.push({item:t,idx:s,matches:[{score:o,value:t,norm:r,indices:h}]})}),i}_searchLogical(t){const e=F(t,this.options),{keys:s,records:i}=this._myIndex,r={},c=[],o=(t,e,n)=>{if(!t.children){const{key:n,searcher:i}=t,r=e[s.indexOf(n)];return this._findMatches({key:n,value:r,searcher:i})}{const s=t.operator;let i=[];for(let r=0;r<t.children.length;r+=1){let c=t.children[r],h=o(c,e,n);if(h&&h.length){if(i.push({idx:n,item:e,matches:h}),s===I)break}else if(s===E){i.length=0;break}}i.length&&(r[n]||(r[n]={idx:n,item:e,matches:[]},c.push(r[n])),i.forEach(({matches:t})=>{r[n].matches.push(...t)}))}};return i.forEach(({$:t,i:s})=>{n(t)&&o(e,t,s)}),c}_searchObjectList(t){const e=A(t,this.options),{keys:s,records:i}=this._myIndex,r=[];return i.forEach(({$:t,i:i})=>{if(!n(t))return;let c=[];s.forEach((s,n)=>{c.push(...this._findMatches({key:s,value:t[n],searcher:e}))}),c.length&&r.push({idx:i,item:t,matches:c})}),r}_findMatches({key:e,value:s,searcher:i}){if(!n(s))return[];let r=[];if(t(s))s.forEach(({v:t,i:s,n:c})=>{if(!n(t))return;const{isMatch:o,score:h,indices:a}=i.searchIn(t);o&&r.push({score:h,key:e,value:t,idx:s,norm:c,indices:a})});else{const{v:t,n:n}=s,{isMatch:c,score:o,indices:h}=i.searchIn(t);c&&r.push({score:o,key:e,value:t,norm:n,indices:h})}return r}}O.version="6.2.0-beta.1",O.createIndex=l,O.parseIndex=function(t,{getFn:e=o.getFn}={}){const{keys:s,records:n}=t;let i=new a({getFn:e});return i.setKeys(s),i.setIndexRecords(n),i},O.config=o,function(...t){w.push(...t)}(C);export default O;
function t(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function e(t){return"string"==typeof t}function s(t){return"number"==typeof t}function n(t){return null!=t}function i(t){return!t.trim().length}const r=Object.prototype.hasOwnProperty;class c{constructor(t){this._keys={},this._keyNames=[];let s=0;t.forEach(t=>{let n,i=1;if(e(t))n=t;else{if(!r.call(t,"name"))throw new Error(`Missing ${"name"} property in key`);if(n=t.name,r.call(t,"weight")&&(i=t.weight,i<=0))throw new Error((t=>`Property 'weight' in key '${t}' must be a positive integer`)(n))}this._keyNames.push(n),this._keys[n]={weight:i},s+=i}),this._keyNames.forEach(t=>{this._keys[t].weight/=s})}get(t,e){return this._keys[t]&&this._keys[t][e]}keys(){return this._keyNames}toJSON(){return JSON.stringify(this._keys)}}var o={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,...{useExtendedSearch:!1,getFn:function(i,r){let c=[],o=!1;const h=(i,r)=>{if(r){const a=r.indexOf(".");let l=r,u=null;-1!==a&&(l=r.slice(0,a),u=r.slice(a+1));const d=i[l];if(!n(d))return;if(u||!e(d)&&!s(d))if(t(d)){o=!0;for(let t=0,e=d.length;t<e;t+=1)h(d[t],u)}else u&&h(d,u);else c.push(function(t){return null==t?"":function(t){if("string"==typeof t)return t;let e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(t)}(d))}else c.push(i)};return h(i,r),o?c:c[0]},ignoreLocation:!1,ignoreFieldNorm:!1}};const h=/[^ ]+/g;class a{constructor({getFn:t=o.getFn}={}){this.norm=function(t=3){const e=new Map;return{get(s){const n=s.match(h).length;if(e.has(n))return e.get(n);const i=parseFloat((1/Math.sqrt(n)).toFixed(t));return e.set(n,i),i},clear(){e.clear()}}}(3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,e(this.docs[0])?this.docs.forEach((t,e)=>{this._addString(t,e)}):this.docs.forEach((t,e)=>{this._addObject(t,e)}),this.norm.clear())}add(t){const s=this.size();e(t)?this._addString(t,s):this._addObject(t,s)}removeAt(t){this.records.splice(t,1);for(let e=t,s=this.size();e<s;e+=1)this.records[e].i-=1}size(){return this.records.length}_addString(t,e){if(!n(t)||i(t))return;let s={v:t,i:e,n:this.norm.get(t)};this.records.push(s)}_addObject(s,r){let c={i:r,$:{}};this.keys.forEach((r,o)=>{let h=this.getFn(s,r);if(n(h))if(t(h)){let s=[];const r=[{nestedArrIndex:-1,value:h}];for(;r.length;){const{nestedArrIndex:c,value:o}=r.pop();if(n(o))if(e(o)&&!i(o)){let t={v:o,i:c,n:this.norm.get(o)};s.push(t)}else t(o)&&o.forEach((t,e)=>{r.push({nestedArrIndex:e,value:t})})}c.$[o]=s}else if(!i(h)){let t={v:h,n:this.norm.get(h)};c.$[o]=t}}),this.records.push(c)}toJSON(){return{keys:this.keys,records:this.records}}}function l(t,e,{getFn:s=o.getFn}={}){const n=new a({getFn:s}),i=new c(t);return n.setKeys(i.keys()),n.setSources(e),n.create(),n}function u(t,e){const s=t.matches;e.matches=[],n(s)&&s.forEach(t=>{if(!n(t.indices)||!t.indices.length)return;const{indices:s,value:i}=t;let r={indices:s,value:i};t.key&&(r.key=t.key),t.idx>-1&&(r.refIndex=t.idx),e.matches.push(r)})}function d(t,e){e.score=t.score}function g(t,{errors:e=0,currentLocation:s=0,expectedLocation:n=0,distance:i=o.distance,ignoreLocation:r=o.ignoreLocation}={}){const c=e/t.length;if(r)return c;const h=Math.abs(n-s);return i?c+h/i:h?1:c}function f(t,e,s,{location:n=o.location,distance:i=o.distance,threshold:r=o.threshold,findAllMatches:c=o.findAllMatches,minMatchCharLength:h=o.minMatchCharLength,includeMatches:a=o.includeMatches,ignoreLocation:l=o.ignoreLocation}={}){if(e.length>32)throw new Error(`Pattern length exceeds max of ${32}.`);const u=e.length,d=t.length,f=Math.max(0,Math.min(n,d));let p=r,m=f;const M=h>1||a,x=M?Array(d):[];let y;for(;(y=t.indexOf(e,m))>-1;){let t=g(e,{currentLocation:y,expectedLocation:f,distance:i,ignoreLocation:l});if(p=Math.min(t,p),m=y+u,M){let t=0;for(;t<u;)x[y+t]=1,t+=1}}m=-1;let k=[],L=1,_=u+d;const v=1<<u-1;for(let n=0;n<u;n+=1){let r=0,o=_;for(;r<o;){g(e,{errors:n,currentLocation:f+o,expectedLocation:f,distance:i,ignoreLocation:l})<=p?r=o:_=o,o=Math.floor((_-r)/2+r)}_=o;let h=Math.max(1,f-o+1),a=c?d:Math.min(f+o,d)+u,y=Array(a+2);y[a+1]=(1<<n)-1;for(let r=a;r>=h;r-=1){let c=r-1,o=s[t.charAt(c)];if(M&&(x[c]=+!!o),y[r]=(y[r+1]<<1|1)&o,n&&(y[r]|=(k[r+1]|k[r])<<1|1|k[r+1]),y[r]&v&&(L=g(e,{errors:n,currentLocation:c,expectedLocation:f,distance:i,ignoreLocation:l}),L<=p)){if(p=L,m=c,m<=f)break;h=Math.max(1,2*f-m)}}if(g(e,{errors:n+1,currentLocation:f,expectedLocation:f,distance:i,ignoreLocation:l})>p)break;k=y}const S={isMatch:m>=0,score:Math.max(.001,L)};if(M){const t=function(t=[],e=o.minMatchCharLength){let s=[],n=-1,i=-1,r=0;for(let c=t.length;r<c;r+=1){let c=t[r];c&&-1===n?n=r:c||-1===n||(i=r-1,i-n+1>=e&&s.push([n,i]),n=-1)}return t[r-1]&&r-n>=e&&s.push([n,r-1]),s}(x,h);t.length?a&&(S.indices=t):S.isMatch=!1}return S}function p(t){let e={};for(let s=0,n=t.length;s<n;s+=1){const i=t.charAt(s);e[i]=(e[i]||0)|1<<n-s-1}return e}class m{constructor(t,{location:e=o.location,threshold:s=o.threshold,distance:n=o.distance,includeMatches:i=o.includeMatches,findAllMatches:r=o.findAllMatches,minMatchCharLength:c=o.minMatchCharLength,isCaseSensitive:h=o.isCaseSensitive,ignoreLocation:a=o.ignoreLocation}={}){if(this.options={location:e,threshold:s,distance:n,includeMatches:i,findAllMatches:r,minMatchCharLength:c,isCaseSensitive:h,ignoreLocation:a},this.pattern=h?t:t.toLowerCase(),this.chunks=[],!this.pattern.length)return;const l=(t,e)=>{this.chunks.push({pattern:t,alphabet:p(t),startIndex:e})},u=this.pattern.length;if(u>32){let t=0;const e=u%32,s=u-e;for(;t<s;)l(this.pattern.substr(t,32),t),t+=32;if(e){const t=u-32;l(this.pattern.substr(t),t)}}else l(this.pattern,0)}searchIn(t){const{isCaseSensitive:e,includeMatches:s}=this.options;if(e||(t=t.toLowerCase()),this.pattern===t){let e={isMatch:!0,score:0};return s&&(e.indices=[[0,t.length-1]]),e}const{location:n,distance:i,threshold:r,findAllMatches:c,minMatchCharLength:o,ignoreLocation:h}=this.options;let a=[],l=0,u=!1;this.chunks.forEach(({pattern:e,alphabet:d,startIndex:g})=>{const{isMatch:p,score:m,indices:M}=f(t,e,d,{location:n+g,distance:i,threshold:r,findAllMatches:c,minMatchCharLength:o,includeMatches:s,ignoreLocation:h});p&&(u=!0),l+=m,p&&M&&(a=[...a,...M])});let d={isMatch:u,score:u?l/this.chunks.length:1};return u&&s&&(d.indices=a),d}}class M{constructor(t){this.pattern=t}static isMultiMatch(t){return x(t,this.multiRegex)}static isSingleMatch(t){return x(t,this.singleRegex)}search(){}}function x(t,e){const s=t.match(e);return s?s[1]:null}class y extends M{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e,s=0;const n=[],i=this.pattern.length;for(;(e=t.indexOf(this.pattern,s))>-1;)s=e+i,n.push([e,s-1]);const r=!!n.length;return{isMatch:r,score:r?1:0,indices:n}}}class k extends M{constructor(t,{location:e=o.location,threshold:s=o.threshold,distance:n=o.distance,includeMatches:i=o.includeMatches,findAllMatches:r=o.findAllMatches,minMatchCharLength:c=o.minMatchCharLength,isCaseSensitive:h=o.isCaseSensitive}={}){super(t),this._bitapSearch=new m(t,{location:e,threshold:s,distance:n,includeMatches:i,findAllMatches:r,minMatchCharLength:c,isCaseSensitive:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}const L=[y,class extends M{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},class extends M{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends M{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends M{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}},class extends M{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const e=-1===t.indexOf(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},k],_=L.length,v=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/;const S=new Set([k.type,y.type]);class C{constructor(t,{isCaseSensitive:e=o.isCaseSensitive,includeMatches:s=o.includeMatches,minMatchCharLength:n=o.minMatchCharLength,findAllMatches:i=o.findAllMatches,location:r=o.location,threshold:c=o.threshold,distance:h=o.distance}={}){this.query=null,this.options={isCaseSensitive:e,includeMatches:s,minMatchCharLength:n,findAllMatches:i,location:r,threshold:c,distance:h},this.pattern=e?t:t.toLowerCase(),this.query=function(t,e={}){return t.split("|").map(t=>{let s=t.trim().split(v).filter(t=>t&&!!t.trim()),n=[];for(let t=0,i=s.length;t<i;t+=1){const i=s[t];let r=!1,c=-1;for(;!r&&++c<_;){const t=L[c];let s=t.isMultiMatch(i);s&&(n.push(new t(s,e)),r=!0)}if(!r)for(c=-1;++c<_;){const t=L[c];let s=t.isSingleMatch(i);if(s){n.push(new t(s,e));break}}}return n})}(this.pattern,this.options)}static condition(t,e){return e.useExtendedSearch}searchIn(t){const e=this.query;if(!e)return{isMatch:!1,score:1};const{includeMatches:s,isCaseSensitive:n}=this.options;t=n?t:t.toLowerCase();let i=0,r=[],c=0;for(let n=0,o=e.length;n<o;n+=1){const o=e[n];r.length=0,i=0;for(let e=0,n=o.length;e<n;e+=1){const n=o[e],{isMatch:h,indices:a,score:l}=n.search(t);if(!h){c=0,i=0,r.length=0;break}if(i+=1,c+=l,s){const t=n.constructor.type;S.has(t)?r=[...r,...a]:r.push(a)}}if(i){let t={isMatch:!0,score:c/i};return s&&(t.indices=r),t}}return{isMatch:!1,score:1}}}const w=[];function A(t,e){for(let s=0,n=w.length;s<n;s+=1){let n=w[s];if(n.condition(t,e))return new n(t,e)}return new m(t,e)}const I="$and",$="$or",E=t=>!(!t[I]&&!t[$]),b=t=>({[I]:Object.keys(t).map(e=>({[e]:t[e]}))});function F(s,n,{auto:i=!0}={}){const r=s=>{let c=Object.keys(s);if(c.length>1&&!E(s))return r(b(s));let o=c[0];if((e=>!t(e)&&"object"==typeof e&&!E(e))(s)){const t=s[o];if(!e(t))throw new Error((t=>"Invalid value for key "+t)(o));const r={key:o,pattern:t};return i&&(r.searcher=A(t,n)),r}let h={children:[],operator:o};return c.forEach(e=>{const n=s[e];t(n)&&n.forEach(t=>{h.children.push(r(t))})}),h};return E(s)||(s=b(s)),r(s)}class O{constructor(t,e={},s){this.options={...o,...e},this.options.useExtendedSearch,this._keyStore=new c(this.options.keys),this.setCollection(t,s)}setCollection(t,e){if(this._docs=t,e&&!(e instanceof a))throw new Error("Incorrect 'index' type");this._myIndex=e||l(this._keyStore.keys(),this._docs,{getFn:this.options.getFn})}add(t){n(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=(()=>!1)){const e=[];for(let s=0,n=this._docs.length;s<n;s+=1){const n=this._docs[s];t(n,s)&&(this.removeAt(s),s-=1,e.push(n))}return e}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:n=-1}={}){const{includeMatches:i,includeScore:r,shouldSort:c,sortFn:h,ignoreFieldNorm:a}=this.options;let l=e(t)?e(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return function(t,e,{ignoreFieldNorm:s=o.ignoreFieldNorm}){t.forEach(t=>{let n=1;t.matches.forEach(({key:t,norm:i,score:r})=>{const c=e.get(t,"weight");n*=Math.pow(0===r&&c?Number.EPSILON:r,(c||1)*(s?1:i))}),t.score=n})}(l,this._keyStore,{ignoreFieldNorm:a}),c&&l.sort(h),s(n)&&n>-1&&(l=l.slice(0,n)),function(t,e,{includeMatches:s=o.includeMatches,includeScore:n=o.includeScore}={}){const i=[];s&&i.push(u);n&&i.push(d);return t.map(t=>{const{idx:s}=t,n={item:e[s],refIndex:s};return i.length&&i.forEach(e=>{e(t,n)}),n})}(l,this._docs,{includeMatches:i,includeScore:r})}_searchStringList(t){const e=A(t,this.options),{records:s}=this._myIndex,i=[];return s.forEach(({v:t,i:s,n:r})=>{if(!n(t))return;const{isMatch:c,score:o,indices:h}=e.searchIn(t);c&&i.push({item:t,idx:s,matches:[{score:o,value:t,norm:r,indices:h}]})}),i}_searchLogical(t){const e=F(t,this.options),{keys:s,records:i}=this._myIndex,r={},c=[],o=(t,e,n)=>{if(!t.children){const{key:n,searcher:i}=t,r=e[s.indexOf(n)];return this._findMatches({key:n,value:r,searcher:i})}{const s=t.operator;let i=[];for(let r=0;r<t.children.length;r+=1){let c=t.children[r],h=o(c,e,n);if(h&&h.length){if(i.push({idx:n,item:e,matches:h}),s===$)break}else if(s===I){i.length=0;break}}i.length&&(r[n]||(r[n]={idx:n,item:e,matches:[]},c.push(r[n])),i.forEach(({matches:t})=>{r[n].matches.push(...t)}))}};return i.forEach(({$:t,i:s})=>{n(t)&&o(e,t,s)}),c}_searchObjectList(t){const e=A(t,this.options),{keys:s,records:i}=this._myIndex,r=[];return i.forEach(({$:t,i:i})=>{if(!n(t))return;let c=[];s.forEach((s,n)=>{c.push(...this._findMatches({key:s,value:t[n],searcher:e}))}),c.length&&r.push({idx:i,item:t,matches:c})}),r}_findMatches({key:e,value:s,searcher:i}){if(!n(s))return[];let r=[];if(t(s))s.forEach(({v:t,i:s,n:c})=>{if(!n(t))return;const{isMatch:o,score:h,indices:a}=i.searchIn(t);o&&r.push({score:h,key:e,value:t,idx:s,norm:c,indices:a})});else{const{v:t,n:n}=s,{isMatch:c,score:o,indices:h}=i.searchIn(t);c&&r.push({score:o,key:e,value:t,norm:n,indices:h})}return r}}O.version="6.2.0",O.createIndex=l,O.parseIndex=function(t,{getFn:e=o.getFn}={}){const{keys:s,records:n}=t,i=new a({getFn:e});return i.setKeys(s),i.setIndexRecords(n),i},O.config=o,function(...t){w.push(...t)}(C);export default O;
/**
* Fuse.js v6.2.0-beta.1 - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v6.2.0 - Lightweight fuzzy-search (http://fusejs.io)
*

@@ -425,6 +425,3 @@ * Copyright (c) 2020 Kiro Risk (http://kiro.me)

// More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm
ignoreFieldNorm: false,
// When `true`, if the search query is empty, return the whole list instead
// of an empty array.
matchEmptyQuery: false
ignoreFieldNorm: false
};

@@ -637,3 +634,4 @@ var Config = _objectSpread2({}, BasicOptions, {}, MatchOptions, {}, FuzzyOptions, {}, AdvancedOptions);

});
myIndex.setKeys(keys);
var keyStore = new KeyStore(keys);
myIndex.setKeys(keyStore.keys());
myIndex.setSources(docs);

@@ -1832,15 +1830,3 @@ myIndex.create();

sortFn = _this$options.sortFn,
ignoreFieldNorm = _this$options.ignoreFieldNorm,
matchEmptyQuery = _this$options.matchEmptyQuery;
if (matchEmptyQuery && (!isDefined(query) || isBlank(query))) {
return this._docs.map(function (doc, idx) {
return {
item: doc,
score: 1,
refIndex: idx
};
});
}
ignoreFieldNorm = _this$options.ignoreFieldNorm;
var results = isString(query) ? isString(this._docs[0]) ? this._searchStringList(query) : this._searchObjectList(query) : this._searchLogical(query);

@@ -2128,3 +2114,3 @@ computeScore$1(results, this._keyStore, {

Fuse.version = '6.2.0-beta.1';
Fuse.version = '6.2.0';
Fuse.createIndex = createIndex;

@@ -2131,0 +2117,0 @@ Fuse.parseIndex = parseIndex;

/**
* Fuse.js v6.2.0-beta.1 - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v6.2.0 - Lightweight fuzzy-search (http://fusejs.io)
*

@@ -9,2 +9,2 @@ * Copyright (c) 2020 Kiro Risk (http://kiro.me)

*/
var e,t;e=this,t=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return h(this,n)}}function l(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}function y(e){return"string"==typeof e}function g(e){return"number"==typeof e}function p(e){return null!=e}function m(e){return!e.trim().length}var k=function(e){return"Invalid value for key ".concat(e)},M=function(e){return"Pattern length exceeds max of ".concat(e,".")},x=Object.prototype.hasOwnProperty,b=function(){function e(n){var r=this;t(this,e),this._keys={},this._keyNames=[];var i=0;n.forEach((function(e){var t,n=1;if(y(e))t=e;else{if(!x.call(e,"name"))throw new Error("Missing ".concat("name"," property in key"));if(t=e.name,x.call(e,"weight")&&(n=e.weight)<=0)throw new Error(function(e){return"Property 'weight' in key '".concat(e,"' must be a positive integer")}(t))}r._keyNames.push(t),r._keys[t]={weight:n},i+=n})),this._keyNames.forEach((function(e){r._keys[e].weight/=i}))}return r(e,[{key:"get",value:function(e,t){return this._keys[e]&&this._keys[e][t]}},{key:"keys",value:function(){return this._keyNames}},{key:"toJSON",value:function(){return JSON.stringify(this._keys)}}]),e}(),S=c({},{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:function(e,t){return e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1}},{},{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},{},{location:0,threshold:.6,distance:100},{},{useExtendedSearch:!1,getFn:function(e,t){var n=[],r=!1;return function e(t,i){if(i){var o=i.indexOf("."),c=i,a=null;-1!==o&&(c=i.slice(0,o),a=i.slice(o+1));var s=t[c];if(!p(s))return;if(a||!y(s)&&!g(s))if(v(s)){r=!0;for(var u=0,h=s.length;u<h;u+=1)e(s[u],a)}else a&&e(s,a);else n.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(s))}else n.push(t)}(e,t),r?n:n[0]},ignoreLocation:!1,ignoreFieldNorm:!1,matchEmptyQuery:!1}),_=/[^ ]+/g;function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=new Map;return{get:function(n){var r=n.match(_).length;if(t.has(r))return t.get(r);var i=parseFloat((1/Math.sqrt(r)).toFixed(e));return t.set(r,i),i},clear:function(){t.clear()}}}var L=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.getFn,i=void 0===r?S.getFn:r;t(this,e),this.norm=w(3),this.getFn=i,this.isCreated=!1,this.setIndexRecords()}return r(e,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=e}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,y(this.docs[0])?this.docs.forEach((function(t,n){e._addString(t,n)})):this.docs.forEach((function(t,n){e._addObject(t,n)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();y(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t<n;t+=1)this.records[t].i-=1}},{key:"size",value:function(){return this.records.length}},{key:"_addString",value:function(e,t){if(p(e)&&!m(e)){var n={v:e,i:t,n:this.norm.get(e)};this.records.push(n)}}},{key:"_addObject",value:function(e,t){var n=this,r={i:t,$:{}};this.keys.forEach((function(t,i){var o=n.getFn(e,t);if(p(o))if(v(o))!function(){for(var e=[],t=[{nestedArrIndex:-1,value:o}];t.length;){var c=t.pop(),a=c.nestedArrIndex,s=c.value;if(p(s))if(y(s)&&!m(s)){var u={v:s,i:a,n:n.norm.get(s)};e.push(u)}else v(s)&&s.forEach((function(e,n){t.push({nestedArrIndex:n,value:e})}))}r.$[i]=e}();else if(!m(o)){var c={v:o,n:n.norm.get(o)};r.$[i]=c}})),this.records.push(r)}},{key:"toJSON",value:function(){return{keys:this.keys,records:this.records}}}]),e}();function O(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?S.getFn:r,o=new L({getFn:i});return o.setKeys(e),o.setSources(t),o.create(),o}function C(e,t){var n=e.matches;t.matches=[],p(n)&&n.forEach((function(e){if(p(e.indices)&&e.indices.length){var n={indices:e.indices,value:e.value};e.key&&(n.key=e.key),e.idx>-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function A(e,t){t.score=e.score}function E(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.errors,r=void 0===n?0:n,i=t.currentLocation,o=void 0===i?0:i,c=t.expectedLocation,a=void 0===c?0:c,s=t.distance,u=void 0===s?S.distance:s,h=t.ignoreLocation,f=void 0===h?S.ignoreLocation:h,l=r/e.length;if(f)return l;var d=Math.abs(a-o);return u?l+d/u:d?1:l}function j(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:S.minMatchCharLength,n=[],r=-1,i=-1,o=0,c=e.length;o<c;o+=1){var a=e[o];a&&-1===r?r=o:a||-1===r||((i=o-1)-r+1>=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}function I(e){for(var t={},n=0,r=e.length;n<r;n+=1){var i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}var $=function(){function e(n){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,c=void 0===o?S.location:o,a=i.threshold,s=void 0===a?S.threshold:a,u=i.distance,h=void 0===u?S.distance:u,f=i.includeMatches,l=void 0===f?S.includeMatches:f,d=i.findAllMatches,v=void 0===d?S.findAllMatches:d,y=i.minMatchCharLength,g=void 0===y?S.minMatchCharLength:y,p=i.isCaseSensitive,m=void 0===p?S.isCaseSensitive:p,k=i.ignoreLocation,M=void 0===k?S.ignoreLocation:k;if(t(this,e),this.options={location:c,threshold:s,distance:h,includeMatches:l,findAllMatches:v,minMatchCharLength:g,isCaseSensitive:m,ignoreLocation:M},this.pattern=m?n:n.toLowerCase(),this.chunks=[],this.pattern.length){var x=function(e,t){r.chunks.push({pattern:e,alphabet:I(e),startIndex:t})},b=this.pattern.length;if(b>32){for(var _=0,w=b%32,L=b-w;_<L;)x(this.pattern.substr(_,32),_),_+=32;if(w){var O=b-32;x(this.pattern.substr(O),O)}}else x(this.pattern,0)}}return r(e,[{key:"searchIn",value:function(e){var t=this.options,n=t.isCaseSensitive,r=t.includeMatches;if(n||(e=e.toLowerCase()),this.pattern===e){var i={isMatch:!0,score:0};return r&&(i.indices=[[0,e.length-1]]),i}var o=this.options,c=o.location,a=o.distance,s=o.threshold,u=o.findAllMatches,h=o.minMatchCharLength,f=o.ignoreLocation,d=[],v=0,y=!1;this.chunks.forEach((function(t){var n=t.pattern,i=t.alphabet,o=t.startIndex,g=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?S.location:i,c=r.distance,a=void 0===c?S.distance:c,s=r.threshold,u=void 0===s?S.threshold:s,h=r.findAllMatches,f=void 0===h?S.findAllMatches:h,l=r.minMatchCharLength,d=void 0===l?S.minMatchCharLength:l,v=r.includeMatches,y=void 0===v?S.includeMatches:v,g=r.ignoreLocation,p=void 0===g?S.ignoreLocation:g;if(t.length>32)throw new Error(M(32));for(var m,k=t.length,x=e.length,b=Math.max(0,Math.min(o,x)),_=u,w=b,L=d>1||y,O=L?Array(x):[];(m=e.indexOf(t,w))>-1;){var C=E(t,{currentLocation:m,expectedLocation:b,distance:a,ignoreLocation:p});if(_=Math.min(C,_),w=m+k,L)for(var A=0;A<k;)O[m+A]=1,A+=1}w=-1;for(var I=[],$=1,R=k+x,F=1<<k-1,P=0;P<k;P+=1){for(var N=0,D=R;N<D;){var z=E(t,{errors:P,currentLocation:b+D,expectedLocation:b,distance:a,ignoreLocation:p});z<=_?N=D:R=D,D=Math.floor((R-N)/2+N)}R=D;var q=Math.max(1,b-D+1),W=f?x:Math.min(b+D,x)+k,J=Array(W+2);J[W+1]=(1<<P)-1;for(var K=W;K>=q;K-=1){var T=K-1,Q=n[e.charAt(T)];if(L&&(O[T]=+!!Q),J[K]=(J[K+1]<<1|1)&Q,P&&(J[K]|=(I[K+1]|I[K])<<1|1|I[K+1]),J[K]&F&&($=E(t,{errors:P,currentLocation:T,expectedLocation:b,distance:a,ignoreLocation:p}))<=_){if(_=$,(w=T)<=b)break;q=Math.max(1,2*b-w)}}var U=E(t,{errors:P+1,currentLocation:b,expectedLocation:b,distance:a,ignoreLocation:p});if(U>_)break;I=J}var B={isMatch:w>=0,score:Math.max(.001,$)};if(L){var G=j(O,d);G.length?y&&(B.indices=G):B.isMatch=!1}return B}(e,n,i,{location:c+o,distance:a,threshold:s,findAllMatches:u,minMatchCharLength:h,includeMatches:r,ignoreLocation:f}),p=g.isMatch,m=g.score,k=g.indices;p&&(y=!0),v+=m,p&&k&&(d=[].concat(l(d),l(k)))}));var g={isMatch:y,score:y?v/this.chunks.length:1};return y&&r&&(g.indices=d),g}}]),e}(),R=function(){function e(n){t(this,e),this.pattern=n}return r(e,[{key:"search",value:function(){}}],[{key:"isMultiMatch",value:function(e){return F(e,this.multiRegex)}},{key:"isSingleMatch",value:function(e){return F(e,this.singleRegex)}}]),e}();function F(e,t){var n=e.match(t);return n?n[1]:null}var P=function(e){a(i,e);var n=f(i);function i(e){return t(this,i),n.call(this,e)}return r(i,[{key:"search",value:function(e){for(var t,n=0,r=[],i=this.pattern.length;(t=e.indexOf(this.pattern,n))>-1;)n=t+i,r.push([t,n-1]);var o=!!r.length;return{isMatch:o,score:o?1:0,indices:r}}}],[{key:"type",get:function(){return"exact"}},{key:"multiRegex",get:function(){return/^'"(.*)"$/}},{key:"singleRegex",get:function(){return/^'(.*)$/}}]),i}(R),N=function(e){a(i,e);var n=f(i);function i(e){return t(this,i),n.call(this,e)}return r(i,[{key:"search",value:function(e){var t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"$/}},{key:"singleRegex",get:function(){return/^!(.*)$/}}]),i}(R),D=function(e){a(i,e);var n=f(i);function i(e){return t(this,i),n.call(this,e)}return r(i,[{key:"search",value:function(e){var t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"prefix-exact"}},{key:"multiRegex",get:function(){return/^\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^\^(.*)$/}}]),i}(R),z=function(e){a(i,e);var n=f(i);function i(e){return t(this,i),n.call(this,e)}return r(i,[{key:"search",value:function(e){var t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-prefix-exact"}},{key:"multiRegex",get:function(){return/^!\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^!\^(.*)$/}}]),i}(R),q=function(e){a(i,e);var n=f(i);function i(e){return t(this,i),n.call(this,e)}return r(i,[{key:"search",value:function(e){var t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}],[{key:"type",get:function(){return"suffix-exact"}},{key:"multiRegex",get:function(){return/^"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^(.*)\$$/}}]),i}(R),W=function(e){a(i,e);var n=f(i);function i(e){return t(this,i),n.call(this,e)}return r(i,[{key:"search",value:function(e){var t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-suffix-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^!(.*)\$$/}}]),i}(R),J=function(e){a(i,e);var n=f(i);function i(e){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=o.location,a=void 0===c?S.location:c,s=o.threshold,u=void 0===s?S.threshold:s,h=o.distance,f=void 0===h?S.distance:h,l=o.includeMatches,d=void 0===l?S.includeMatches:l,v=o.findAllMatches,y=void 0===v?S.findAllMatches:v,g=o.minMatchCharLength,p=void 0===g?S.minMatchCharLength:g,m=o.isCaseSensitive,k=void 0===m?S.isCaseSensitive:m;return t(this,i),(r=n.call(this,e))._bitapSearch=new $(e,{location:a,threshold:u,distance:f,includeMatches:d,findAllMatches:y,minMatchCharLength:p,isCaseSensitive:k}),r}return r(i,[{key:"search",value:function(e){return this._bitapSearch.searchIn(e)}}],[{key:"type",get:function(){return"fuzzy"}},{key:"multiRegex",get:function(){return/^"(.*)"$/}},{key:"singleRegex",get:function(){return/^(.*)$/}}]),i}(R),K=[P,D,z,W,q,N,J],T=K.length,Q=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/;function U(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.split("|").map((function(e){for(var n=e.trim().split(Q).filter((function(e){return e&&!!e.trim()})),r=[],i=0,o=n.length;i<o;i+=1){for(var c=n[i],a=!1,s=-1;!a&&++s<T;){var u=K[s],h=u.isMultiMatch(c);h&&(r.push(new u(h,t)),a=!0)}if(!a)for(s=-1;++s<T;){var f=K[s],l=f.isSingleMatch(c);if(l){r.push(new f(l,t));break}}}return r}))}var B=new Set([J.type,P.type]),G=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.isCaseSensitive,o=void 0===i?S.isCaseSensitive:i,c=r.includeMatches,a=void 0===c?S.includeMatches:c,s=r.minMatchCharLength,u=void 0===s?S.minMatchCharLength:s,h=r.findAllMatches,f=void 0===h?S.findAllMatches:h,l=r.location,d=void 0===l?S.location:l,v=r.threshold,y=void 0===v?S.threshold:v,g=r.distance,p=void 0===g?S.distance:g;t(this,e),this.query=null,this.options={isCaseSensitive:o,includeMatches:a,minMatchCharLength:u,findAllMatches:f,location:d,threshold:y,distance:p},this.pattern=o?n:n.toLowerCase(),this.query=U(this.pattern,this.options)}return r(e,[{key:"searchIn",value:function(e){var t=this.query;if(!t)return{isMatch:!1,score:1};var n=this.options,r=n.includeMatches;e=n.isCaseSensitive?e:e.toLowerCase();for(var i=0,o=[],c=0,a=0,s=t.length;a<s;a+=1){var u=t[a];o.length=0,i=0;for(var h=0,f=u.length;h<f;h+=1){var d=u[h],v=d.search(e),y=v.isMatch,g=v.indices,p=v.score;if(!y){c=0,i=0,o.length=0;break}if(i+=1,c+=p,r){var m=d.constructor.type;B.has(m)?o=[].concat(l(o),l(g)):o.push(g)}}if(i){var k={isMatch:!0,score:c/i};return r&&(k.indices=o),k}}return{isMatch:!1,score:1}}}],[{key:"condition",value:function(e,t){return t.useExtendedSearch}}]),e}(),H=[];function V(e,t){for(var n=0,r=H.length;n<r;n+=1){var i=H[n];if(i.condition(e,t))return new i(e,t)}return new $(e,t)}var X="$and",Y="$or",Z=function(e){return!(!e[X]&&!e[Y])},ee=function(t){return!v(t)&&"object"===e(t)&&!Z(t)},te=function(e){return i({},X,Object.keys(e).map((function(t){return i({},t,e[t])})))},ne=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;t(this,e),this.options=c({},S,{},r),this.options.useExtendedSearch,this._keyStore=new b(this.options.keys),this.setCollection(n,i)}return r(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof L))throw new Error("Incorrect 'index' type");this._myIndex=t||O(this._keyStore.keys(),this._docs,{getFn:this.options.getFn})}},{key:"add",value:function(e){p(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],n=0,r=this._docs.length;n<r;n+=1){var i=this._docs[n];e(i,n)&&(this.removeAt(n),n-=1,t.push(i))}return t}},{key:"removeAt",value:function(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}},{key:"getIndex",value:function(){return this._myIndex}},{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?-1:n,i=this.options,o=i.includeMatches,c=i.includeScore,a=i.shouldSort,s=i.sortFn,u=i.ignoreFieldNorm,h=i.matchEmptyQuery;if(h&&(!p(e)||m(e)))return this._docs.map((function(e,t){return{item:e,score:1,refIndex:t}}));var f=y(e)?y(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return re(f,this._keyStore,{ignoreFieldNorm:u}),a&&f.sort(s),g(r)&&r>-1&&(f=f.slice(0,r)),ie(f,this._docs,{includeMatches:o,includeScore:c})}},{key:"_searchStringList",value:function(e){var t=V(e,this.options),n=this._myIndex.records,r=[];return n.forEach((function(e){var n=e.v,i=e.i,o=e.n;if(p(n)){var c=t.searchIn(n),a=c.isMatch,s=c.score,u=c.indices;a&&r.push({item:n,idx:i,matches:[{score:s,value:n,norm:o,indices:u}]})}})),r}},{key:"_searchLogical",value:function(e){var t=this,n=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.auto,i=void 0===r||r,o=function e(n){var r=Object.keys(n);if(r.length>1&&!Z(n))return e(te(n));var o=r[0];if(ee(n)){var c=n[o];if(!y(c))throw new Error(k(o));var a={key:o,pattern:c};return i&&(a.searcher=V(c,t)),a}var s={children:[],operator:o};return r.forEach((function(t){var r=n[t];v(r)&&r.forEach((function(t){s.children.push(e(t))}))})),s};return Z(e)||(e=te(e)),o(e)}(e,this.options),r=this._myIndex,i=r.keys,o=r.records,c={},a=[];return o.forEach((function(e){var r=e.$,o=e.i;p(r)&&function e(n,r,o){if(!n.children){var s=n.key,u=n.searcher,h=r[i.indexOf(s)];return t._findMatches({key:s,value:h,searcher:u})}for(var f=n.operator,d=[],v=0;v<n.children.length;v+=1){var y=e(n.children[v],r,o);if(y&&y.length){if(d.push({idx:o,item:r,matches:y}),f===Y)break}else if(f===X){d.length=0;break}}d.length&&(c[o]||(c[o]={idx:o,item:r,matches:[]},a.push(c[o])),d.forEach((function(e){var t,n=e.matches;(t=c[o].matches).push.apply(t,l(n))})))}(n,r,o)})),a}},{key:"_searchObjectList",value:function(e){var t=this,n=V(e,this.options),r=this._myIndex,i=r.keys,o=r.records,c=[];return o.forEach((function(e){var r=e.$,o=e.i;if(p(r)){var a=[];i.forEach((function(e,i){a.push.apply(a,l(t._findMatches({key:e,value:r[i],searcher:n})))})),a.length&&c.push({idx:o,item:r,matches:a})}})),c}},{key:"_findMatches",value:function(e){var t=e.key,n=e.value,r=e.searcher;if(!p(n))return[];var i=[];if(v(n))n.forEach((function(e){var n=e.v,o=e.i,c=e.n;if(p(n)){var a=r.searchIn(n),s=a.isMatch,u=a.score,h=a.indices;s&&i.push({score:u,key:t,value:n,idx:o,norm:c,indices:h})}}));else{var o=n.v,c=n.n,a=r.searchIn(o),s=a.isMatch,u=a.score,h=a.indices;s&&i.push({score:u,key:t,value:o,norm:c,indices:h})}return i}}]),e}();function re(e,t,n){var r=n.ignoreFieldNorm,i=void 0===r?S.ignoreFieldNorm:r;e.forEach((function(e){var n=1;e.matches.forEach((function(e){var r=e.key,o=e.norm,c=e.score,a=t.get(r,"weight");n*=Math.pow(0===c&&a?Number.EPSILON:c,(a||1)*(i?1:o))})),e.score=n}))}function ie(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?S.includeMatches:r,o=n.includeScore,c=void 0===o?S.includeScore:o,a=[];return i&&a.push(C),c&&a.push(A),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return a.length&&a.forEach((function(t){t(e,r)})),r}))}return ne.version="6.2.0-beta.1",ne.createIndex=O,ne.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?S.getFn:n,i=e.keys,o=e.records,c=new L({getFn:r});return c.setKeys(i),c.setIndexRecords(o),c},ne.config=S,function(){H.push.apply(H,arguments)}(G),ne},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Fuse=t();
var e,t;e=this,t=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return h(this,n)}}function l(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}function g(e){return"string"==typeof e}function y(e){return"number"==typeof e}function p(e){return null!=e}function m(e){return!e.trim().length}var k=function(e){return"Invalid value for key ".concat(e)},M=function(e){return"Pattern length exceeds max of ".concat(e,".")},x=Object.prototype.hasOwnProperty,b=function(){function e(n){var r=this;t(this,e),this._keys={},this._keyNames=[];var i=0;n.forEach((function(e){var t,n=1;if(g(e))t=e;else{if(!x.call(e,"name"))throw new Error("Missing ".concat("name"," property in key"));if(t=e.name,x.call(e,"weight")&&(n=e.weight)<=0)throw new Error(function(e){return"Property 'weight' in key '".concat(e,"' must be a positive integer")}(t))}r._keyNames.push(t),r._keys[t]={weight:n},i+=n})),this._keyNames.forEach((function(e){r._keys[e].weight/=i}))}return r(e,[{key:"get",value:function(e,t){return this._keys[e]&&this._keys[e][t]}},{key:"keys",value:function(){return this._keyNames}},{key:"toJSON",value:function(){return JSON.stringify(this._keys)}}]),e}(),S=c({},{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:function(e,t){return e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1}},{},{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},{},{location:0,threshold:.6,distance:100},{},{useExtendedSearch:!1,getFn:function(e,t){var n=[],r=!1;return function e(t,i){if(i){var o=i.indexOf("."),c=i,a=null;-1!==o&&(c=i.slice(0,o),a=i.slice(o+1));var s=t[c];if(!p(s))return;if(a||!g(s)&&!y(s))if(v(s)){r=!0;for(var u=0,h=s.length;u<h;u+=1)e(s[u],a)}else a&&e(s,a);else n.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(s))}else n.push(t)}(e,t),r?n:n[0]},ignoreLocation:!1,ignoreFieldNorm:!1}),_=/[^ ]+/g;function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=new Map;return{get:function(n){var r=n.match(_).length;if(t.has(r))return t.get(r);var i=parseFloat((1/Math.sqrt(r)).toFixed(e));return t.set(r,i),i},clear:function(){t.clear()}}}var L=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.getFn,i=void 0===r?S.getFn:r;t(this,e),this.norm=w(3),this.getFn=i,this.isCreated=!1,this.setIndexRecords()}return r(e,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=e}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,g(this.docs[0])?this.docs.forEach((function(t,n){e._addString(t,n)})):this.docs.forEach((function(t,n){e._addObject(t,n)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();g(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t<n;t+=1)this.records[t].i-=1}},{key:"size",value:function(){return this.records.length}},{key:"_addString",value:function(e,t){if(p(e)&&!m(e)){var n={v:e,i:t,n:this.norm.get(e)};this.records.push(n)}}},{key:"_addObject",value:function(e,t){var n=this,r={i:t,$:{}};this.keys.forEach((function(t,i){var o=n.getFn(e,t);if(p(o))if(v(o))!function(){for(var e=[],t=[{nestedArrIndex:-1,value:o}];t.length;){var c=t.pop(),a=c.nestedArrIndex,s=c.value;if(p(s))if(g(s)&&!m(s)){var u={v:s,i:a,n:n.norm.get(s)};e.push(u)}else v(s)&&s.forEach((function(e,n){t.push({nestedArrIndex:n,value:e})}))}r.$[i]=e}();else if(!m(o)){var c={v:o,n:n.norm.get(o)};r.$[i]=c}})),this.records.push(r)}},{key:"toJSON",value:function(){return{keys:this.keys,records:this.records}}}]),e}();function O(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?S.getFn:r,o=new L({getFn:i}),c=new b(e);return o.setKeys(c.keys()),o.setSources(t),o.create(),o}function C(e,t){var n=e.matches;t.matches=[],p(n)&&n.forEach((function(e){if(p(e.indices)&&e.indices.length){var n={indices:e.indices,value:e.value};e.key&&(n.key=e.key),e.idx>-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function A(e,t){t.score=e.score}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.errors,r=void 0===n?0:n,i=t.currentLocation,o=void 0===i?0:i,c=t.expectedLocation,a=void 0===c?0:c,s=t.distance,u=void 0===s?S.distance:s,h=t.ignoreLocation,f=void 0===h?S.ignoreLocation:h,l=r/e.length;if(f)return l;var d=Math.abs(a-o);return u?l+d/u:d?1:l}function E(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:S.minMatchCharLength,n=[],r=-1,i=-1,o=0,c=e.length;o<c;o+=1){var a=e[o];a&&-1===r?r=o:a||-1===r||((i=o-1)-r+1>=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}function I(e){for(var t={},n=0,r=e.length;n<r;n+=1){var i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}var $=function(){function e(n){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,c=void 0===o?S.location:o,a=i.threshold,s=void 0===a?S.threshold:a,u=i.distance,h=void 0===u?S.distance:u,f=i.includeMatches,l=void 0===f?S.includeMatches:f,d=i.findAllMatches,v=void 0===d?S.findAllMatches:d,g=i.minMatchCharLength,y=void 0===g?S.minMatchCharLength:g,p=i.isCaseSensitive,m=void 0===p?S.isCaseSensitive:p,k=i.ignoreLocation,M=void 0===k?S.ignoreLocation:k;if(t(this,e),this.options={location:c,threshold:s,distance:h,includeMatches:l,findAllMatches:v,minMatchCharLength:y,isCaseSensitive:m,ignoreLocation:M},this.pattern=m?n:n.toLowerCase(),this.chunks=[],this.pattern.length){var x=function(e,t){r.chunks.push({pattern:e,alphabet:I(e),startIndex:t})},b=this.pattern.length;if(b>32){for(var _=0,w=b%32,L=b-w;_<L;)x(this.pattern.substr(_,32),_),_+=32;if(w){var O=b-32;x(this.pattern.substr(O),O)}}else x(this.pattern,0)}}return r(e,[{key:"searchIn",value:function(e){var t=this.options,n=t.isCaseSensitive,r=t.includeMatches;if(n||(e=e.toLowerCase()),this.pattern===e){var i={isMatch:!0,score:0};return r&&(i.indices=[[0,e.length-1]]),i}var o=this.options,c=o.location,a=o.distance,s=o.threshold,u=o.findAllMatches,h=o.minMatchCharLength,f=o.ignoreLocation,d=[],v=0,g=!1;this.chunks.forEach((function(t){var n=t.pattern,i=t.alphabet,o=t.startIndex,y=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?S.location:i,c=r.distance,a=void 0===c?S.distance:c,s=r.threshold,u=void 0===s?S.threshold:s,h=r.findAllMatches,f=void 0===h?S.findAllMatches:h,l=r.minMatchCharLength,d=void 0===l?S.minMatchCharLength:l,v=r.includeMatches,g=void 0===v?S.includeMatches:v,y=r.ignoreLocation,p=void 0===y?S.ignoreLocation:y;if(t.length>32)throw new Error(M(32));for(var m,k=t.length,x=e.length,b=Math.max(0,Math.min(o,x)),_=u,w=b,L=d>1||g,O=L?Array(x):[];(m=e.indexOf(t,w))>-1;){var C=j(t,{currentLocation:m,expectedLocation:b,distance:a,ignoreLocation:p});if(_=Math.min(C,_),w=m+k,L)for(var A=0;A<k;)O[m+A]=1,A+=1}w=-1;for(var I=[],$=1,R=k+x,F=1<<k-1,P=0;P<k;P+=1){for(var N=0,D=R;N<D;){var z=j(t,{errors:P,currentLocation:b+D,expectedLocation:b,distance:a,ignoreLocation:p});z<=_?N=D:R=D,D=Math.floor((R-N)/2+N)}R=D;var q=Math.max(1,b-D+1),W=f?x:Math.min(b+D,x)+k,J=Array(W+2);J[W+1]=(1<<P)-1;for(var K=W;K>=q;K-=1){var T=K-1,U=n[e.charAt(T)];if(L&&(O[T]=+!!U),J[K]=(J[K+1]<<1|1)&U,P&&(J[K]|=(I[K+1]|I[K])<<1|1|I[K+1]),J[K]&F&&($=j(t,{errors:P,currentLocation:T,expectedLocation:b,distance:a,ignoreLocation:p}))<=_){if(_=$,(w=T)<=b)break;q=Math.max(1,2*b-w)}}var B=j(t,{errors:P+1,currentLocation:b,expectedLocation:b,distance:a,ignoreLocation:p});if(B>_)break;I=J}var G={isMatch:w>=0,score:Math.max(.001,$)};if(L){var H=E(O,d);H.length?g&&(G.indices=H):G.isMatch=!1}return G}(e,n,i,{location:c+o,distance:a,threshold:s,findAllMatches:u,minMatchCharLength:h,includeMatches:r,ignoreLocation:f}),p=y.isMatch,m=y.score,k=y.indices;p&&(g=!0),v+=m,p&&k&&(d=[].concat(l(d),l(k)))}));var y={isMatch:g,score:g?v/this.chunks.length:1};return g&&r&&(y.indices=d),y}}]),e}(),R=function(){function e(n){t(this,e),this.pattern=n}return r(e,[{key:"search",value:function(){}}],[{key:"isMultiMatch",value:function(e){return F(e,this.multiRegex)}},{key:"isSingleMatch",value:function(e){return F(e,this.singleRegex)}}]),e}();function F(e,t){var n=e.match(t);return n?n[1]:null}var P=function(e){a(i,e);var n=f(i);function i(e){return t(this,i),n.call(this,e)}return r(i,[{key:"search",value:function(e){for(var t,n=0,r=[],i=this.pattern.length;(t=e.indexOf(this.pattern,n))>-1;)n=t+i,r.push([t,n-1]);var o=!!r.length;return{isMatch:o,score:o?1:0,indices:r}}}],[{key:"type",get:function(){return"exact"}},{key:"multiRegex",get:function(){return/^'"(.*)"$/}},{key:"singleRegex",get:function(){return/^'(.*)$/}}]),i}(R),N=function(e){a(i,e);var n=f(i);function i(e){return t(this,i),n.call(this,e)}return r(i,[{key:"search",value:function(e){var t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"$/}},{key:"singleRegex",get:function(){return/^!(.*)$/}}]),i}(R),D=function(e){a(i,e);var n=f(i);function i(e){return t(this,i),n.call(this,e)}return r(i,[{key:"search",value:function(e){var t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"prefix-exact"}},{key:"multiRegex",get:function(){return/^\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^\^(.*)$/}}]),i}(R),z=function(e){a(i,e);var n=f(i);function i(e){return t(this,i),n.call(this,e)}return r(i,[{key:"search",value:function(e){var t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-prefix-exact"}},{key:"multiRegex",get:function(){return/^!\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^!\^(.*)$/}}]),i}(R),q=function(e){a(i,e);var n=f(i);function i(e){return t(this,i),n.call(this,e)}return r(i,[{key:"search",value:function(e){var t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}],[{key:"type",get:function(){return"suffix-exact"}},{key:"multiRegex",get:function(){return/^"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^(.*)\$$/}}]),i}(R),W=function(e){a(i,e);var n=f(i);function i(e){return t(this,i),n.call(this,e)}return r(i,[{key:"search",value:function(e){var t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-suffix-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^!(.*)\$$/}}]),i}(R),J=function(e){a(i,e);var n=f(i);function i(e){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=o.location,a=void 0===c?S.location:c,s=o.threshold,u=void 0===s?S.threshold:s,h=o.distance,f=void 0===h?S.distance:h,l=o.includeMatches,d=void 0===l?S.includeMatches:l,v=o.findAllMatches,g=void 0===v?S.findAllMatches:v,y=o.minMatchCharLength,p=void 0===y?S.minMatchCharLength:y,m=o.isCaseSensitive,k=void 0===m?S.isCaseSensitive:m;return t(this,i),(r=n.call(this,e))._bitapSearch=new $(e,{location:a,threshold:u,distance:f,includeMatches:d,findAllMatches:g,minMatchCharLength:p,isCaseSensitive:k}),r}return r(i,[{key:"search",value:function(e){return this._bitapSearch.searchIn(e)}}],[{key:"type",get:function(){return"fuzzy"}},{key:"multiRegex",get:function(){return/^"(.*)"$/}},{key:"singleRegex",get:function(){return/^(.*)$/}}]),i}(R),K=[P,D,z,W,q,N,J],T=K.length,U=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/;function B(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.split("|").map((function(e){for(var n=e.trim().split(U).filter((function(e){return e&&!!e.trim()})),r=[],i=0,o=n.length;i<o;i+=1){for(var c=n[i],a=!1,s=-1;!a&&++s<T;){var u=K[s],h=u.isMultiMatch(c);h&&(r.push(new u(h,t)),a=!0)}if(!a)for(s=-1;++s<T;){var f=K[s],l=f.isSingleMatch(c);if(l){r.push(new f(l,t));break}}}return r}))}var G=new Set([J.type,P.type]),H=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.isCaseSensitive,o=void 0===i?S.isCaseSensitive:i,c=r.includeMatches,a=void 0===c?S.includeMatches:c,s=r.minMatchCharLength,u=void 0===s?S.minMatchCharLength:s,h=r.findAllMatches,f=void 0===h?S.findAllMatches:h,l=r.location,d=void 0===l?S.location:l,v=r.threshold,g=void 0===v?S.threshold:v,y=r.distance,p=void 0===y?S.distance:y;t(this,e),this.query=null,this.options={isCaseSensitive:o,includeMatches:a,minMatchCharLength:u,findAllMatches:f,location:d,threshold:g,distance:p},this.pattern=o?n:n.toLowerCase(),this.query=B(this.pattern,this.options)}return r(e,[{key:"searchIn",value:function(e){var t=this.query;if(!t)return{isMatch:!1,score:1};var n=this.options,r=n.includeMatches;e=n.isCaseSensitive?e:e.toLowerCase();for(var i=0,o=[],c=0,a=0,s=t.length;a<s;a+=1){var u=t[a];o.length=0,i=0;for(var h=0,f=u.length;h<f;h+=1){var d=u[h],v=d.search(e),g=v.isMatch,y=v.indices,p=v.score;if(!g){c=0,i=0,o.length=0;break}if(i+=1,c+=p,r){var m=d.constructor.type;G.has(m)?o=[].concat(l(o),l(y)):o.push(y)}}if(i){var k={isMatch:!0,score:c/i};return r&&(k.indices=o),k}}return{isMatch:!1,score:1}}}],[{key:"condition",value:function(e,t){return t.useExtendedSearch}}]),e}(),Q=[];function V(e,t){for(var n=0,r=Q.length;n<r;n+=1){var i=Q[n];if(i.condition(e,t))return new i(e,t)}return new $(e,t)}var X="$and",Y="$or",Z=function(e){return!(!e[X]&&!e[Y])},ee=function(t){return!v(t)&&"object"===e(t)&&!Z(t)},te=function(e){return i({},X,Object.keys(e).map((function(t){return i({},t,e[t])})))},ne=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;t(this,e),this.options=c({},S,{},r),this.options.useExtendedSearch,this._keyStore=new b(this.options.keys),this.setCollection(n,i)}return r(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof L))throw new Error("Incorrect 'index' type");this._myIndex=t||O(this._keyStore.keys(),this._docs,{getFn:this.options.getFn})}},{key:"add",value:function(e){p(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],n=0,r=this._docs.length;n<r;n+=1){var i=this._docs[n];e(i,n)&&(this.removeAt(n),n-=1,t.push(i))}return t}},{key:"removeAt",value:function(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}},{key:"getIndex",value:function(){return this._myIndex}},{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?-1:n,i=this.options,o=i.includeMatches,c=i.includeScore,a=i.shouldSort,s=i.sortFn,u=i.ignoreFieldNorm,h=g(e)?g(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return re(h,this._keyStore,{ignoreFieldNorm:u}),a&&h.sort(s),y(r)&&r>-1&&(h=h.slice(0,r)),ie(h,this._docs,{includeMatches:o,includeScore:c})}},{key:"_searchStringList",value:function(e){var t=V(e,this.options),n=this._myIndex.records,r=[];return n.forEach((function(e){var n=e.v,i=e.i,o=e.n;if(p(n)){var c=t.searchIn(n),a=c.isMatch,s=c.score,u=c.indices;a&&r.push({item:n,idx:i,matches:[{score:s,value:n,norm:o,indices:u}]})}})),r}},{key:"_searchLogical",value:function(e){var t=this,n=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.auto,i=void 0===r||r,o=function e(n){var r=Object.keys(n);if(r.length>1&&!Z(n))return e(te(n));var o=r[0];if(ee(n)){var c=n[o];if(!g(c))throw new Error(k(o));var a={key:o,pattern:c};return i&&(a.searcher=V(c,t)),a}var s={children:[],operator:o};return r.forEach((function(t){var r=n[t];v(r)&&r.forEach((function(t){s.children.push(e(t))}))})),s};return Z(e)||(e=te(e)),o(e)}(e,this.options),r=this._myIndex,i=r.keys,o=r.records,c={},a=[];return o.forEach((function(e){var r=e.$,o=e.i;p(r)&&function e(n,r,o){if(!n.children){var s=n.key,u=n.searcher,h=r[i.indexOf(s)];return t._findMatches({key:s,value:h,searcher:u})}for(var f=n.operator,d=[],v=0;v<n.children.length;v+=1){var g=e(n.children[v],r,o);if(g&&g.length){if(d.push({idx:o,item:r,matches:g}),f===Y)break}else if(f===X){d.length=0;break}}d.length&&(c[o]||(c[o]={idx:o,item:r,matches:[]},a.push(c[o])),d.forEach((function(e){var t,n=e.matches;(t=c[o].matches).push.apply(t,l(n))})))}(n,r,o)})),a}},{key:"_searchObjectList",value:function(e){var t=this,n=V(e,this.options),r=this._myIndex,i=r.keys,o=r.records,c=[];return o.forEach((function(e){var r=e.$,o=e.i;if(p(r)){var a=[];i.forEach((function(e,i){a.push.apply(a,l(t._findMatches({key:e,value:r[i],searcher:n})))})),a.length&&c.push({idx:o,item:r,matches:a})}})),c}},{key:"_findMatches",value:function(e){var t=e.key,n=e.value,r=e.searcher;if(!p(n))return[];var i=[];if(v(n))n.forEach((function(e){var n=e.v,o=e.i,c=e.n;if(p(n)){var a=r.searchIn(n),s=a.isMatch,u=a.score,h=a.indices;s&&i.push({score:u,key:t,value:n,idx:o,norm:c,indices:h})}}));else{var o=n.v,c=n.n,a=r.searchIn(o),s=a.isMatch,u=a.score,h=a.indices;s&&i.push({score:u,key:t,value:o,norm:c,indices:h})}return i}}]),e}();function re(e,t,n){var r=n.ignoreFieldNorm,i=void 0===r?S.ignoreFieldNorm:r;e.forEach((function(e){var n=1;e.matches.forEach((function(e){var r=e.key,o=e.norm,c=e.score,a=t.get(r,"weight");n*=Math.pow(0===c&&a?Number.EPSILON:c,(a||1)*(i?1:o))})),e.score=n}))}function ie(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?S.includeMatches:r,o=n.includeScore,c=void 0===o?S.includeScore:o,a=[];return i&&a.push(C),c&&a.push(A),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return a.length&&a.forEach((function(t){t(e,r)})),r}))}return ne.version="6.2.0",ne.createIndex=O,ne.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?S.getFn:n,i=e.keys,o=e.records,c=new L({getFn:r});return c.setKeys(i),c.setIndexRecords(o),c},ne.config=S,function(){Q.push.apply(Q,arguments)}(H),ne},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Fuse=t();

@@ -16,3 +16,3 @@ {

],
"version": "6.2.0-beta.1",
"version": "6.2.0",
"description": "Lightweight fuzzy-search",

@@ -19,0 +19,0 @@ "license": "Apache-2.0",

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