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.3.0 to 6.3.1

9

CHANGELOG.md

@@ -5,2 +5,9 @@ # Changelog

### [6.3.1](https://github.com/krisk/Fuse/compare/v6.3.0...v6.3.1) (2020-06-24)
### Bug Fixes
* **logical:** scores in logical query operators are ignored ([e357229](https://github.com/krisk/Fuse/commit/e357229846fff585707903c93f556d1562fbabba)), closes [#449](https://github.com/krisk/Fuse/issues/449)
## [6.3.0](https://github.com/krisk/Fuse/compare/v6.2.1...v6.3.0) (2020-06-23)

@@ -11,3 +18,2 @@

* provide alternative array notation for nested paths ([938db2a](https://github.com/krisk/Fuse/commit/938db2aebb1a5b2d610cd8bb3258ff701baa46fb))
* provide alternative array notation for nested paths ([7077fbe](https://github.com/krisk/Fuse/commit/7077fbe5f40872f9555645dbad2e6729ca55a5d4)), closes [#432](https://github.com/krisk/Fuse/issues/432)

@@ -18,3 +24,2 @@

* remove unused import from index generation ([af7794e](https://github.com/krisk/Fuse/commit/af7794ee058ac8aabcb4ca35d3f6b00f22876848))
* **typescript:** add types for string and object together for the key property ([85fb211](https://github.com/krisk/Fuse/commit/85fb211a22bf5921ecefab9ecf3f8e2647f46b49))

@@ -21,0 +26,0 @@ * **typescript:** add typing for nested paths with array notation ([dfa4823](https://github.com/krisk/Fuse/commit/dfa48238f9a28600fd36677f958f43bb3cab4c03))

/**
* Fuse.js v6.3.0 - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v6.3.1 - Lightweight fuzzy-search (http://fusejs.io)
*

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

}
};
}; // Backwards compatibility (since path used to be a string)
deepGet(obj, path, 0);
deepGet(obj, isString(path) ? path.split('.') : path, 0);
return arr ? list : list[0];

@@ -1430,3 +1431,3 @@ }

Fuse.version = '6.3.0';
Fuse.version = '6.3.1';
Fuse.createIndex = createIndex;

@@ -1433,0 +1434,0 @@ Fuse.parseIndex = parseIndex;

/**
* Fuse.js v6.3.0 - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v6.3.1 - Lightweight fuzzy-search (http://fusejs.io)
*

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

deepGet(obj, path, 0);
// Backwards compatibility (since path used to be a string)
deepGet(obj, isString(path) ? path.split('.') : path, 0);

@@ -1202,3 +1203,3 @@ return arr ? list : list[0]

Fuse.version = '6.3.0';
Fuse.version = '6.3.1';
Fuse.createIndex = createIndex;

@@ -1205,0 +1206,0 @@ Fuse.parseIndex = parseIndex;

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

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

}
};
}; // Backwards compatibility (since path used to be a string)
deepGet(obj, path, 0);
deepGet(obj, isString(path) ? path.split('.') : path, 0);
return arr ? list : list[0];

@@ -1434,3 +1435,3 @@ }

Fuse.version = '6.3.0';
Fuse.version = '6.3.1';
Fuse.createIndex = createIndex;

@@ -1437,0 +1438,0 @@ Fuse.parseIndex = parseIndex;

/**
* Fuse.js v6.3.0 - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v6.3.1 - 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 c(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 c(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)?c(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 c(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 s(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._keyMap={};var i=0;n.forEach((function(e){var t=y(e);i+=t.weight,r._keys.push(t),r._keyMap[t.id]=t,i+=t.weight})),this._keys.forEach((function(e){e.weight/=i}))}return n(t,[{key:"get",value:function(e){return this._keyMap[e]}},{key:"keys",value:function(){return this._keys}},{key:"toJSON",value:function(){return JSON.stringify(this._keys)}}]),t}();function y(e){var t=null,n=null,r=null,i=1;if(h(e)||s(e))r=e,t=p(e),n=m(e);else{if(!v.call(e,"name"))throw new Error(function(e){return"Missing ".concat(e," property in key")}("name"));var o=e.name;if(r=o,v.call(e,"weight")&&(i=e.weight)<=0)throw new Error(function(e){return"Property 'weight' in key '".concat(e,"' must be a positive integer")}(o));t=p(o),n=m(o)}return{path:t,id:n,weight:i,src:r}}function p(e){return s(e)?e:e.split(".")}function m(e){return s(e)?e.join("."):e}var k=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,o){if(i[o]){var a=t[i[o]];if(!d(a))return;if(o===i.length-1&&(h(a)||u(a)))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)}(a));else if(s(a)){r=!0;for(var c=0,l=a.length;c<l;c+=1)e(a[c],i,o+1)}else i.length&&e(a,i,o+1)}else n.push(t)}(e,t,0),r?n:n[0]},ignoreLocation:!1,ignoreFieldNorm:!1}),M=/[^ ]+/g;function b(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=new Map;return{get:function(n){var r=n.match(M).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 x=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.getFn,i=void 0===r?k.getFn:r;e(this,t),this.norm=b(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=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,n){e._keysMap[t.id]=n}))}},{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:"getValueForItemAtKeyId",value:function(e,t){return e[this._keysMap[t]]}},{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.path);if(d(o))if(s(o))!function(){for(var e=[],t=[{nestedArrIndex:-1,value:o}];t.length;){var a=t.pop(),c=a.nestedArrIndex,u=a.value;if(d(u))if(h(u)&&!l(u)){var f={v:u,i:c,n:n.norm.get(u)};e.push(f)}else s(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 w(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?k.getFn:r,o=new x({getFn:i});return o.setKeys(e.map(y)),o.setSources(t),o.create(),o}function L(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.src),e.idx>-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function _(e,t){t.score=e.score}function O(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,c=void 0===a?0:a,s=t.distance,h=void 0===s?k.distance:s,u=t.ignoreLocation,d=void 0===u?k.ignoreLocation:u,l=r/e.length;if(d)return l;var f=Math.abs(c-o);return h?l+f/h:f?1:l}function S(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.minMatchCharLength,n=[],r=-1,i=-1,o=0,a=e.length;o<a;o+=1){var c=e[o];c&&-1===r?r=o:c||-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 A(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 E=function(){function t(n){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,a=void 0===o?k.location:o,c=i.threshold,s=void 0===c?k.threshold:c,h=i.distance,u=void 0===h?k.distance:h,d=i.includeMatches,l=void 0===d?k.includeMatches:d,f=i.findAllMatches,v=void 0===f?k.findAllMatches:f,g=i.minMatchCharLength,y=void 0===g?k.minMatchCharLength:g,p=i.isCaseSensitive,m=void 0===p?k.isCaseSensitive:p,M=i.ignoreLocation,b=void 0===M?k.ignoreLocation:M;if(e(this,t),this.options={location:a,threshold:s,distance:u,includeMatches:l,findAllMatches:v,minMatchCharLength:y,isCaseSensitive:m,ignoreLocation:b},this.pattern=m?n:n.toLowerCase(),this.chunks=[],this.pattern.length){var x=function(e,t){r.chunks.push({pattern:e,alphabet:A(e),startIndex:t})},w=this.pattern.length;if(w>32){for(var L=0,_=w%32,O=w-_;L<O;)x(this.pattern.substr(L,32),L),L+=32;if(_){var S=w-32;x(this.pattern.substr(S),S)}}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,c=o.location,s=o.distance,h=o.threshold,u=o.findAllMatches,d=o.minMatchCharLength,l=o.ignoreLocation,v=[],g=0,y=!1;this.chunks.forEach((function(t){var n=t.pattern,i=t.alphabet,o=t.startIndex,p=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?k.location:i,a=r.distance,c=void 0===a?k.distance:a,s=r.threshold,h=void 0===s?k.threshold:s,u=r.findAllMatches,d=void 0===u?k.findAllMatches:u,l=r.minMatchCharLength,v=void 0===l?k.minMatchCharLength:l,g=r.includeMatches,y=void 0===g?k.includeMatches:g,p=r.ignoreLocation,m=void 0===p?k.ignoreLocation:p;if(t.length>32)throw new Error(f(32));for(var M,b=t.length,x=e.length,w=Math.max(0,Math.min(o,x)),L=h,_=w,A=v>1||y,E=A?Array(x):[];(M=e.indexOf(t,_))>-1;){var I=O(t,{currentLocation:M,expectedLocation:w,distance:c,ignoreLocation:m});if(L=Math.min(I,L),_=M+b,A)for(var j=0;j<b;)E[M+j]=1,j+=1}_=-1;for(var F=[],C=1,P=b+x,N=1<<b-1,$=0;$<b;$+=1){for(var D=0,K=P;D<K;){var z=O(t,{errors:$,currentLocation:w+K,expectedLocation:w,distance:c,ignoreLocation:m});z<=L?D=K:P=K,K=Math.floor((P-D)/2+D)}P=K;var J=Math.max(1,w-K+1),R=d?x:Math.min(w+K,x)+b,T=Array(R+2);T[R+1]=(1<<$)-1;for(var q=R;q>=J;q-=1){var U=q-1,V=n[e.charAt(U)];if(A&&(E[U]=+!!V),T[q]=(T[q+1]<<1|1)&V,$&&(T[q]|=(F[q+1]|F[q])<<1|1|F[q+1]),T[q]&N&&(C=O(t,{errors:$,currentLocation:U,expectedLocation:w,distance:c,ignoreLocation:m}))<=L){if(L=C,(_=U)<=w)break;J=Math.max(1,2*w-_)}}var B=O(t,{errors:$+1,currentLocation:w,expectedLocation:w,distance:c,ignoreLocation:m});if(B>L)break;F=T}var G={isMatch:_>=0,score:Math.max(.001,C)};if(A){var H=S(E,v);H.length?y&&(G.indices=H):G.isMatch=!1}return G}(e,n,i,{location:c+o,distance:s,threshold:h,findAllMatches:u,minMatchCharLength:d,includeMatches:r,ignoreLocation:l}),m=p.isMatch,M=p.score,b=p.indices;m&&(y=!0),g+=M,m&&b&&(v=[].concat(a(v),a(b)))}));var p={isMatch:y,score:y?g/this.chunks.length:1};return y&&r&&(p.indices=v),p}}]),t}(),I=[];function j(e,t){for(var n=0,r=I.length;n<r;n+=1){var i=I[n];if(i.condition(e,t))return new i(e,t)}return new E(e,t)}var F=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({},k,{},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 x))throw new Error("Incorrect 'index' type");this._myIndex=t||w(this.options.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,c=i.shouldSort,s=i.sortFn,d=i.ignoreFieldNorm,l=h(e)?h(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return C(l,this._keyStore,{ignoreFieldNorm:d}),c&&l.sort(s),u(r)&&r>-1&&(l=l.slice(0,r)),P(l,this._docs,{includeMatches:o,includeScore:a})}},{key:"_searchStringList",value:function(e){var t=j(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),c=a.isMatch,s=a.score,h=a.indices;c&&r.push({item:n,idx:i,matches:[{score:s,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=j(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(d(r)){var s=[];i.forEach((function(e,i){s.push.apply(s,a(t._findMatches({key:e,value:r[i],searcher:n})))})),s.length&&c.push({idx:o,item:r,matches:s})}})),c}},{key:"_findMatches",value:function(e){var t=e.key,n=e.value,r=e.searcher;if(!d(n))return[];var i=[];if(s(n))n.forEach((function(e){var n=e.v,o=e.i,a=e.n;if(d(n)){var c=r.searchIn(n),s=c.isMatch,h=c.score,u=c.indices;s&&i.push({score:h,key:t,value:n,idx:o,norm:a,indices:u})}}));else{var o=n.v,a=n.n,c=r.searchIn(o),h=c.isMatch,u=c.score,l=c.indices;h&&i.push({score:u,key:t,value:o,norm:a,indices:l})}return i}}]),t}();function C(e,t,n){var r=n.ignoreFieldNorm,i=void 0===r?k.ignoreFieldNorm:r;e.forEach((function(e){var t=1;e.matches.forEach((function(e){var n=e.key,r=e.norm,o=e.score,a=n?n.weight:null;t*=Math.pow(0===o&&a?Number.EPSILON:o,(a||1)*(i?1:r))})),e.score=t}))}function P(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?k.includeMatches:r,o=n.includeScore,a=void 0===o?k.includeScore:o,c=[];return i&&c.push(L),a&&c.push(_),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return c.length&&c.forEach((function(t){t(e,r)})),r}))}return F.version="6.3.0",F.createIndex=w,F.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?k.getFn:n,i=e.keys,o=e.records,a=new x({getFn:r});return a.setKeys(i),a.setIndexRecords(o),a},F.config=k,F},"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 c(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 c(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)?c(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 c(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 s(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._keyMap={};var i=0;n.forEach((function(e){var t=y(e);i+=t.weight,r._keys.push(t),r._keyMap[t.id]=t,i+=t.weight})),this._keys.forEach((function(e){e.weight/=i}))}return n(t,[{key:"get",value:function(e){return this._keyMap[e]}},{key:"keys",value:function(){return this._keys}},{key:"toJSON",value:function(){return JSON.stringify(this._keys)}}]),t}();function y(e){var t=null,n=null,r=null,i=1;if(h(e)||s(e))r=e,t=p(e),n=m(e);else{if(!v.call(e,"name"))throw new Error(function(e){return"Missing ".concat(e," property in key")}("name"));var o=e.name;if(r=o,v.call(e,"weight")&&(i=e.weight)<=0)throw new Error(function(e){return"Property 'weight' in key '".concat(e,"' must be a positive integer")}(o));t=p(o),n=m(o)}return{path:t,id:n,weight:i,src:r}}function p(e){return s(e)?e:e.split(".")}function m(e){return s(e)?e.join("."):e}var k=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,o){if(i[o]){var a=t[i[o]];if(!d(a))return;if(o===i.length-1&&(h(a)||u(a)))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)}(a));else if(s(a)){r=!0;for(var c=0,l=a.length;c<l;c+=1)e(a[c],i,o+1)}else i.length&&e(a,i,o+1)}else n.push(t)}(e,h(t)?t.split("."):t,0),r?n:n[0]},ignoreLocation:!1,ignoreFieldNorm:!1}),M=/[^ ]+/g;function b(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=new Map;return{get:function(n){var r=n.match(M).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 x=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.getFn,i=void 0===r?k.getFn:r;e(this,t),this.norm=b(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=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,n){e._keysMap[t.id]=n}))}},{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:"getValueForItemAtKeyId",value:function(e,t){return e[this._keysMap[t]]}},{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.path);if(d(o))if(s(o))!function(){for(var e=[],t=[{nestedArrIndex:-1,value:o}];t.length;){var a=t.pop(),c=a.nestedArrIndex,u=a.value;if(d(u))if(h(u)&&!l(u)){var f={v:u,i:c,n:n.norm.get(u)};e.push(f)}else s(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 w(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?k.getFn:r,o=new x({getFn:i});return o.setKeys(e.map(y)),o.setSources(t),o.create(),o}function L(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.src),e.idx>-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function _(e,t){t.score=e.score}function O(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,c=void 0===a?0:a,s=t.distance,h=void 0===s?k.distance:s,u=t.ignoreLocation,d=void 0===u?k.ignoreLocation:u,l=r/e.length;if(d)return l;var f=Math.abs(c-o);return h?l+f/h:f?1:l}function S(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.minMatchCharLength,n=[],r=-1,i=-1,o=0,a=e.length;o<a;o+=1){var c=e[o];c&&-1===r?r=o:c||-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 A(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 E=function(){function t(n){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,a=void 0===o?k.location:o,c=i.threshold,s=void 0===c?k.threshold:c,h=i.distance,u=void 0===h?k.distance:h,d=i.includeMatches,l=void 0===d?k.includeMatches:d,f=i.findAllMatches,v=void 0===f?k.findAllMatches:f,g=i.minMatchCharLength,y=void 0===g?k.minMatchCharLength:g,p=i.isCaseSensitive,m=void 0===p?k.isCaseSensitive:p,M=i.ignoreLocation,b=void 0===M?k.ignoreLocation:M;if(e(this,t),this.options={location:a,threshold:s,distance:u,includeMatches:l,findAllMatches:v,minMatchCharLength:y,isCaseSensitive:m,ignoreLocation:b},this.pattern=m?n:n.toLowerCase(),this.chunks=[],this.pattern.length){var x=function(e,t){r.chunks.push({pattern:e,alphabet:A(e),startIndex:t})},w=this.pattern.length;if(w>32){for(var L=0,_=w%32,O=w-_;L<O;)x(this.pattern.substr(L,32),L),L+=32;if(_){var S=w-32;x(this.pattern.substr(S),S)}}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,c=o.location,s=o.distance,h=o.threshold,u=o.findAllMatches,d=o.minMatchCharLength,l=o.ignoreLocation,v=[],g=0,y=!1;this.chunks.forEach((function(t){var n=t.pattern,i=t.alphabet,o=t.startIndex,p=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?k.location:i,a=r.distance,c=void 0===a?k.distance:a,s=r.threshold,h=void 0===s?k.threshold:s,u=r.findAllMatches,d=void 0===u?k.findAllMatches:u,l=r.minMatchCharLength,v=void 0===l?k.minMatchCharLength:l,g=r.includeMatches,y=void 0===g?k.includeMatches:g,p=r.ignoreLocation,m=void 0===p?k.ignoreLocation:p;if(t.length>32)throw new Error(f(32));for(var M,b=t.length,x=e.length,w=Math.max(0,Math.min(o,x)),L=h,_=w,A=v>1||y,E=A?Array(x):[];(M=e.indexOf(t,_))>-1;){var I=O(t,{currentLocation:M,expectedLocation:w,distance:c,ignoreLocation:m});if(L=Math.min(I,L),_=M+b,A)for(var j=0;j<b;)E[M+j]=1,j+=1}_=-1;for(var F=[],C=1,P=b+x,N=1<<b-1,$=0;$<b;$+=1){for(var D=0,K=P;D<K;){var z=O(t,{errors:$,currentLocation:w+K,expectedLocation:w,distance:c,ignoreLocation:m});z<=L?D=K:P=K,K=Math.floor((P-D)/2+D)}P=K;var J=Math.max(1,w-K+1),R=d?x:Math.min(w+K,x)+b,T=Array(R+2);T[R+1]=(1<<$)-1;for(var q=R;q>=J;q-=1){var U=q-1,V=n[e.charAt(U)];if(A&&(E[U]=+!!V),T[q]=(T[q+1]<<1|1)&V,$&&(T[q]|=(F[q+1]|F[q])<<1|1|F[q+1]),T[q]&N&&(C=O(t,{errors:$,currentLocation:U,expectedLocation:w,distance:c,ignoreLocation:m}))<=L){if(L=C,(_=U)<=w)break;J=Math.max(1,2*w-_)}}var B=O(t,{errors:$+1,currentLocation:w,expectedLocation:w,distance:c,ignoreLocation:m});if(B>L)break;F=T}var G={isMatch:_>=0,score:Math.max(.001,C)};if(A){var H=S(E,v);H.length?y&&(G.indices=H):G.isMatch=!1}return G}(e,n,i,{location:c+o,distance:s,threshold:h,findAllMatches:u,minMatchCharLength:d,includeMatches:r,ignoreLocation:l}),m=p.isMatch,M=p.score,b=p.indices;m&&(y=!0),g+=M,m&&b&&(v=[].concat(a(v),a(b)))}));var p={isMatch:y,score:y?g/this.chunks.length:1};return y&&r&&(p.indices=v),p}}]),t}(),I=[];function j(e,t){for(var n=0,r=I.length;n<r;n+=1){var i=I[n];if(i.condition(e,t))return new i(e,t)}return new E(e,t)}var F=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({},k,{},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 x))throw new Error("Incorrect 'index' type");this._myIndex=t||w(this.options.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,c=i.shouldSort,s=i.sortFn,d=i.ignoreFieldNorm,l=h(e)?h(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return C(l,this._keyStore,{ignoreFieldNorm:d}),c&&l.sort(s),u(r)&&r>-1&&(l=l.slice(0,r)),P(l,this._docs,{includeMatches:o,includeScore:a})}},{key:"_searchStringList",value:function(e){var t=j(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),c=a.isMatch,s=a.score,h=a.indices;c&&r.push({item:n,idx:i,matches:[{score:s,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=j(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(d(r)){var s=[];i.forEach((function(e,i){s.push.apply(s,a(t._findMatches({key:e,value:r[i],searcher:n})))})),s.length&&c.push({idx:o,item:r,matches:s})}})),c}},{key:"_findMatches",value:function(e){var t=e.key,n=e.value,r=e.searcher;if(!d(n))return[];var i=[];if(s(n))n.forEach((function(e){var n=e.v,o=e.i,a=e.n;if(d(n)){var c=r.searchIn(n),s=c.isMatch,h=c.score,u=c.indices;s&&i.push({score:h,key:t,value:n,idx:o,norm:a,indices:u})}}));else{var o=n.v,a=n.n,c=r.searchIn(o),h=c.isMatch,u=c.score,l=c.indices;h&&i.push({score:u,key:t,value:o,norm:a,indices:l})}return i}}]),t}();function C(e,t,n){var r=n.ignoreFieldNorm,i=void 0===r?k.ignoreFieldNorm:r;e.forEach((function(e){var t=1;e.matches.forEach((function(e){var n=e.key,r=e.norm,o=e.score,a=n?n.weight:null;t*=Math.pow(0===o&&a?Number.EPSILON:o,(a||1)*(i?1:r))})),e.score=t}))}function P(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?k.includeMatches:r,o=n.includeScore,a=void 0===o?k.includeScore:o,c=[];return i&&c.push(L),a&&c.push(_),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return c.length&&c.forEach((function(t){t(e,r)})),r}))}return F.version="6.3.1",F.createIndex=w,F.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?k.getFn:n,i=e.keys,o=e.records,a=new x({getFn:r});return a.setKeys(i),a.setIndexRecords(o),a},F.config=k,F},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Fuse=t();
/**
* Fuse.js v6.3.0 - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v6.3.1 - Lightweight fuzzy-search (http://fusejs.io)
*

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

}
};
}; // Backwards compatibility (since path used to be a string)
deepGet(obj, path, 0);
deepGet(obj, isString(path) ? path.split('.') : path, 0);
return arr ? list : list[0];

@@ -1920,48 +1921,70 @@ }

var expression = parse(query, this.options);
var records = this._myIndex.records;
var resultMap = {};
var results = [];
var evaluateExpression = function evaluateExpression(node, item, idx) {
if (node.children) {
var operator = node.operator;
var res = [];
var evaluate = function evaluate(node, item, idx) {
if (!node.children) {
var keyId = node.keyId,
searcher = node.searcher;
for (var k = 0; k < node.children.length; k += 1) {
var child = node.children[k];
var matches = evaluateExpression(child, item, idx);
var matches = _this._findMatches({
key: _this._keyStore.get(keyId),
value: _this._myIndex.getValueForItemAtKeyId(item, keyId),
searcher: searcher
});
if (matches && matches.length) {
res.push({
idx: idx,
item: item,
matches: matches
});
if (matches && matches.length) {
return [{
idx: idx,
item: item,
matches: matches
}];
}
if (operator === LogicalOperator.OR) {
// Short-circuit
break;
return [];
}
/*eslint indent: [2, 2, {"SwitchCase": 1}]*/
switch (node.operator) {
case LogicalOperator.AND:
{
var res = [];
for (var i = 0, len = node.children.length; i < len; i += 1) {
var child = node.children[i];
var result = evaluate(child, item, idx);
if (result.length) {
res.push.apply(res, _toConsumableArray(result));
} else {
return [];
}
}
} else if (operator === LogicalOperator.AND) {
res.length = 0; // Short-circuit
break;
return res;
}
}
return res;
} else {
var keyId = node.keyId,
searcher = node.searcher;
case LogicalOperator.OR:
{
var _res = [];
var value = _this._myIndex.getValueForItemAtKeyId(item, keyId);
for (var _i = 0, _len = node.children.length; _i < _len; _i += 1) {
var _child = node.children[_i];
return _this._findMatches({
key: _this._keyStore.get(keyId),
value: value,
searcher: searcher
});
var _result = evaluate(_child, item, idx);
if (_result.length) {
_res.push.apply(_res, _toConsumableArray(_result));
break;
}
}
return _res;
}
}
};
var records = this._myIndex.records;
var resultMap = {};
var results = [];
records.forEach(function (_ref3) {

@@ -1972,3 +1995,3 @@ var item = _ref3.$,

if (isDefined(item)) {
var expResults = evaluateExpression(expression, item, idx);
var expResults = evaluate(expression, item, idx);

@@ -2146,3 +2169,3 @@ if (expResults.length) {

Fuse.version = '6.3.0';
Fuse.version = '6.3.1';
Fuse.createIndex = createIndex;

@@ -2149,0 +2172,0 @@ Fuse.parseIndex = parseIndex;

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

// Type definitions for Fuse.js v6.3.0
// Type definitions for Fuse.js v6.3.1
// TypeScript v3.9.5

@@ -115,3 +115,3 @@

obj: T,
path: string
path: string | string[]
) => ReadonlyArray<string> | string

@@ -235,7 +235,7 @@

export type FuseOptionKeyObject = {
name: string | [string]
name: string | string[]
weight: number
}
export type FuseOptionKey = FuseOptionKeyObject | string | [string]
export type FuseOptionKey = FuseOptionKeyObject | string | string[]

@@ -242,0 +242,0 @@ export interface IFuseOptions<T> {

/**
* Fuse.js v6.3.0 - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v6.3.1 - Lightweight fuzzy-search (http://fusejs.io)
*

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

deepGet(obj, path, 0);
// Backwards compatibility (since path used to be a string)
deepGet(obj, isString(path) ? path.split('.') : path, 0);

@@ -1497,49 +1498,62 @@ return arr ? list : list[0]

const records = this._myIndex.records;
const resultMap = {};
const results = [];
const evaluate = (node, item, idx) => {
if (!node.children) {
const { keyId, searcher } = node;
const evaluateExpression = (node, item, idx) => {
if (node.children) {
const operator = node.operator;
let res = [];
const matches = this._findMatches({
key: this._keyStore.get(keyId),
value: this._myIndex.getValueForItemAtKeyId(item, keyId),
searcher
});
for (let k = 0; k < node.children.length; k += 1) {
let child = node.children[k];
let matches = evaluateExpression(child, item, idx);
if (matches && matches.length) {
res.push({
if (matches && matches.length) {
return [
{
idx,
item,
matches
});
if (operator === LogicalOperator.OR) {
// Short-circuit
}
]
}
return []
}
/*eslint indent: [2, 2, {"SwitchCase": 1}]*/
switch (node.operator) {
case LogicalOperator.AND: {
const res = [];
for (let i = 0, len = node.children.length; i < len; i += 1) {
const child = node.children[i];
const result = evaluate(child, item, idx);
if (result.length) {
res.push(...result);
} else {
return []
}
}
return res
}
case LogicalOperator.OR: {
const res = [];
for (let i = 0, len = node.children.length; i < len; i += 1) {
const child = node.children[i];
const result = evaluate(child, item, idx);
if (result.length) {
res.push(...result);
break
}
} else if (operator === LogicalOperator.AND) {
res.length = 0;
// Short-circuit
break
}
return res
}
return res
} else {
const { keyId, searcher } = node;
const value = this._myIndex.getValueForItemAtKeyId(item, keyId);
return this._findMatches({
key: this._keyStore.get(keyId),
value,
searcher
})
}
};
const records = this._myIndex.records;
const resultMap = {};
const results = [];
records.forEach(({ $: item, i: idx }) => {
if (isDefined(item)) {
let expResults = evaluateExpression(expression, item, idx);
let expResults = evaluate(expression, item, idx);

@@ -1690,3 +1704,3 @@ if (expResults.length) {

Fuse.version = '6.3.0';
Fuse.version = '6.3.1';
Fuse.createIndex = createIndex;

@@ -1693,0 +1707,0 @@ Fuse.parseIndex = parseIndex;

/**
* Fuse.js v6.3.0 - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v6.3.1 - 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 r(t){return!t.trim().length}const i=Object.prototype.hasOwnProperty;class c{constructor(t){this._keys=[],this._keyMap={};let e=0;t.forEach(t=>{let s=o(t);e+=s.weight,this._keys.push(s),this._keyMap[s.id]=s,e+=s.weight}),this._keys.forEach(t=>{t.weight/=e})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function o(s){let n=null,r=null,c=null,o=1;if(e(s)||t(s))c=s,n=h(s),r=a(s);else{if(!i.call(s,"name"))throw new Error((t=>`Missing ${t} property in key`)("name"));const t=s.name;if(c=t,i.call(s,"weight")&&(o=s.weight,o<=0))throw new Error((t=>`Property 'weight' in key '${t}' must be a positive integer`)(t));n=h(t),r=a(t)}return{path:n,id:r,weight:o,src:c}}function h(e){return t(e)?e:e.split(".")}function a(e){return t(e)?e.join("."):e}var l={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(r,i){let c=[],o=!1;const h=(r,i,a)=>{if(i[a]){const l=r[i[a]];if(!n(l))return;if(a===i.length-1&&(e(l)||s(l)))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)}(l));else if(t(l)){o=!0;for(let t=0,e=l.length;t<e;t+=1)h(l[t],i,a+1)}else i.length&&h(l,i,a+1)}else c.push(r)};return h(r,i,0),o?c:c[0]},ignoreLocation:!1,ignoreFieldNorm:!1}};const u=/[^ ]+/g;class d{constructor({getFn:t=l.getFn}={}){this.norm=function(t=3){const e=new Map;return{get(s){const n=s.match(u).length;if(e.has(n))return e.get(n);const r=parseFloat((1/Math.sqrt(n)).toFixed(t));return e.set(n,r),r},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,this._keysMap={},t.forEach((t,e)=>{this._keysMap[t.id]=e})}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}getValueForItemAtKeyId(t,e){return t[this._keysMap[e]]}size(){return this.records.length}_addString(t,e){if(!n(t)||r(t))return;let s={v:t,i:e,n:this.norm.get(t)};this.records.push(s)}_addObject(s,i){let c={i:i,$:{}};this.keys.forEach((i,o)=>{let h=this.getFn(s,i.path);if(n(h))if(t(h)){let s=[];const i=[{nestedArrIndex:-1,value:h}];for(;i.length;){const{nestedArrIndex:c,value:o}=i.pop();if(n(o))if(e(o)&&!r(o)){let t={v:o,i:c,n:this.norm.get(o)};s.push(t)}else t(o)&&o.forEach((t,e)=>{i.push({nestedArrIndex:e,value:t})})}c.$[o]=s}else if(!r(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 g(t,e,{getFn:s=l.getFn}={}){const n=new d({getFn:s});return n.setKeys(t.map(o)),n.setSources(e),n.create(),n}function f(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:r}=t;let i={indices:s,value:r};t.key&&(i.key=t.key.src),t.idx>-1&&(i.refIndex=t.idx),e.matches.push(i)})}function p(t,e){e.score=t.score}function M(t,{errors:e=0,currentLocation:s=0,expectedLocation:n=0,distance:r=l.distance,ignoreLocation:i=l.ignoreLocation}={}){const c=e/t.length;if(i)return c;const o=Math.abs(n-s);return r?c+o/r:o?1:c}function m(t,e,s,{location:n=l.location,distance:r=l.distance,threshold:i=l.threshold,findAllMatches:c=l.findAllMatches,minMatchCharLength:o=l.minMatchCharLength,includeMatches:h=l.includeMatches,ignoreLocation:a=l.ignoreLocation}={}){if(e.length>32)throw new Error(`Pattern length exceeds max of ${32}.`);const u=e.length,d=t.length,g=Math.max(0,Math.min(n,d));let f=i,p=g;const m=o>1||h,y=m?Array(d):[];let x;for(;(x=t.indexOf(e,p))>-1;){let t=M(e,{currentLocation:x,expectedLocation:g,distance:r,ignoreLocation:a});if(f=Math.min(t,f),p=x+u,m){let t=0;for(;t<u;)y[x+t]=1,t+=1}}p=-1;let k=[],L=1,_=u+d;const v=1<<u-1;for(let n=0;n<u;n+=1){let i=0,o=_;for(;i<o;){M(e,{errors:n,currentLocation:g+o,expectedLocation:g,distance:r,ignoreLocation:a})<=f?i=o:_=o,o=Math.floor((_-i)/2+i)}_=o;let h=Math.max(1,g-o+1),l=c?d:Math.min(g+o,d)+u,x=Array(l+2);x[l+1]=(1<<n)-1;for(let i=l;i>=h;i-=1){let c=i-1,o=s[t.charAt(c)];if(m&&(y[c]=+!!o),x[i]=(x[i+1]<<1|1)&o,n&&(x[i]|=(k[i+1]|k[i])<<1|1|k[i+1]),x[i]&v&&(L=M(e,{errors:n,currentLocation:c,expectedLocation:g,distance:r,ignoreLocation:a}),L<=f)){if(f=L,p=c,p<=g)break;h=Math.max(1,2*g-p)}}if(M(e,{errors:n+1,currentLocation:g,expectedLocation:g,distance:r,ignoreLocation:a})>f)break;k=x}const S={isMatch:p>=0,score:Math.max(.001,L)};if(m){const t=function(t=[],e=l.minMatchCharLength){let s=[],n=-1,r=-1,i=0;for(let c=t.length;i<c;i+=1){let c=t[i];c&&-1===n?n=i:c||-1===n||(r=i-1,r-n+1>=e&&s.push([n,r]),n=-1)}return t[i-1]&&i-n>=e&&s.push([n,i-1]),s}(y,o);t.length?h&&(S.indices=t):S.isMatch=!1}return S}function y(t){let e={};for(let s=0,n=t.length;s<n;s+=1){const r=t.charAt(s);e[r]=(e[r]||0)|1<<n-s-1}return e}class x{constructor(t,{location:e=l.location,threshold:s=l.threshold,distance:n=l.distance,includeMatches:r=l.includeMatches,findAllMatches:i=l.findAllMatches,minMatchCharLength:c=l.minMatchCharLength,isCaseSensitive:o=l.isCaseSensitive,ignoreLocation:h=l.ignoreLocation}={}){if(this.options={location:e,threshold:s,distance:n,includeMatches:r,findAllMatches:i,minMatchCharLength:c,isCaseSensitive:o,ignoreLocation:h},this.pattern=o?t:t.toLowerCase(),this.chunks=[],!this.pattern.length)return;const a=(t,e)=>{this.chunks.push({pattern:t,alphabet:y(t),startIndex:e})},u=this.pattern.length;if(u>32){let t=0;const e=u%32,s=u-e;for(;t<s;)a(this.pattern.substr(t,32),t),t+=32;if(e){const t=u-32;a(this.pattern.substr(t),t)}}else a(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:r,threshold:i,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:f,score:p,indices:M}=m(t,e,d,{location:n+g,distance:r,threshold:i,findAllMatches:c,minMatchCharLength:o,includeMatches:s,ignoreLocation:h});f&&(u=!0),l+=p,f&&M&&(a=[...a,...M])});let d={isMatch:u,score:u?l/this.chunks.length:1};return u&&s&&(d.indices=a),d}}class k{constructor(t){this.pattern=t}static isMultiMatch(t){return L(t,this.multiRegex)}static isSingleMatch(t){return L(t,this.singleRegex)}search(){}}function L(t,e){const s=t.match(e);return s?s[1]:null}class _ extends k{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=[],r=this.pattern.length;for(;(e=t.indexOf(this.pattern,s))>-1;)s=e+r,n.push([e,s-1]);const i=!!n.length;return{isMatch:i,score:i?1:0,indices:n}}}class v extends k{constructor(t,{location:e=l.location,threshold:s=l.threshold,distance:n=l.distance,includeMatches:r=l.includeMatches,findAllMatches:i=l.findAllMatches,minMatchCharLength:c=l.minMatchCharLength,isCaseSensitive:o=l.isCaseSensitive}={}){super(t),this._bitapSearch=new x(t,{location:e,threshold:s,distance:n,includeMatches:r,findAllMatches:i,minMatchCharLength:c,isCaseSensitive:o})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}const S=[_,class extends k{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 k{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 k{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 k{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 k{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]}}},v],C=S.length,I=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/;const w=new Set([v.type,_.type]);class A{constructor(t,{isCaseSensitive:e=l.isCaseSensitive,includeMatches:s=l.includeMatches,minMatchCharLength:n=l.minMatchCharLength,findAllMatches:r=l.findAllMatches,location:i=l.location,threshold:c=l.threshold,distance:o=l.distance}={}){this.query=null,this.options={isCaseSensitive:e,includeMatches:s,minMatchCharLength:n,findAllMatches:r,location:i,threshold:c,distance:o},this.pattern=e?t:t.toLowerCase(),this.query=function(t,e={}){return t.split("|").map(t=>{let s=t.trim().split(I).filter(t=>t&&!!t.trim()),n=[];for(let t=0,r=s.length;t<r;t+=1){const r=s[t];let i=!1,c=-1;for(;!i&&++c<C;){const t=S[c];let s=t.isMultiMatch(r);s&&(n.push(new t(s,e)),i=!0)}if(!i)for(c=-1;++c<C;){const t=S[c];let s=t.isSingleMatch(r);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 r=0,i=[],c=0;for(let n=0,o=e.length;n<o;n+=1){const o=e[n];i.length=0,r=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,r=0,i.length=0;break}if(r+=1,c+=l,s){const t=n.constructor.type;w.has(t)?i=[...i,...a]:i.push(a)}}if(r){let t={isMatch:!0,score:c/r};return s&&(t.indices=i),t}}return{isMatch:!1,score:1}}}const $=[];function E(t,e){for(let s=0,n=$.length;s<n;s+=1){let n=$[s];if(n.condition(t,e))return new n(t,e)}return new x(t,e)}const b="$and",F="$or",R="$path",O="$val",j=t=>!(!t[b]&&!t[F]),N=t=>({[b]:Object.keys(t).map(e=>({[e]:t[e]}))});function z(s,n,{auto:r=!0}={}){const i=s=>{let c=Object.keys(s);const o=(t=>!!t[R])(s);if(!o&&c.length>1&&!j(s))return i(N(s));if((e=>!t(e)&&"object"==typeof e&&!j(e))(s)){const t=o?s[R]:c[0],i=o?s[O]:s[t];if(!e(i))throw new Error((t=>"Invalid value for key "+t)(t));const h={keyId:a(t),pattern:i};return r&&(h.searcher=E(i,n)),h}let h={children:[],operator:c[0]};return c.forEach(e=>{const n=s[e];t(n)&&n.forEach(t=>{h.children.push(i(t))})}),h};return j(s)||(s=N(s)),i(s)}class K{constructor(t,e={},s){this.options={...l,...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 d))throw new Error("Incorrect 'index' type");this._myIndex=e||g(this.options.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:r,includeScore:i,shouldSort:c,sortFn:o,ignoreFieldNorm:h}=this.options;let a=e(t)?e(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return function(t,e,{ignoreFieldNorm:s=l.ignoreFieldNorm}){t.forEach(t=>{let e=1;t.matches.forEach(({key:t,norm:n,score:r})=>{const i=t?t.weight:null;e*=Math.pow(0===r&&i?Number.EPSILON:r,(i||1)*(s?1:n))}),t.score=e})}(a,this._keyStore,{ignoreFieldNorm:h}),c&&a.sort(o),s(n)&&n>-1&&(a=a.slice(0,n)),function(t,e,{includeMatches:s=l.includeMatches,includeScore:n=l.includeScore}={}){const r=[];s&&r.push(f);n&&r.push(p);return t.map(t=>{const{idx:s}=t,n={item:e[s],refIndex:s};return r.length&&r.forEach(e=>{e(t,n)}),n})}(a,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(t){const e=E(t,this.options),{records:s}=this._myIndex,r=[];return s.forEach(({v:t,i:s,n:i})=>{if(!n(t))return;const{isMatch:c,score:o,indices:h}=e.searchIn(t);c&&r.push({item:t,idx:s,matches:[{score:o,value:t,norm:i,indices:h}]})}),r}_searchLogical(t){const e=z(t,this.options),s=this._myIndex.records,r={},i=[],c=(t,e,s)=>{if(t.children){const n=t.operator;let r=[];for(let i=0;i<t.children.length;i+=1){let o=t.children[i],h=c(o,e,s);if(h&&h.length){if(r.push({idx:s,item:e,matches:h}),n===F)break}else if(n===b){r.length=0;break}}return r}{const{keyId:s,searcher:n}=t,r=this._myIndex.getValueForItemAtKeyId(e,s);return this._findMatches({key:this._keyStore.get(s),value:r,searcher:n})}};return s.forEach(({$:t,i:s})=>{if(n(t)){let n=c(e,t,s);n.length&&(r[s]||(r[s]={idx:s,item:t,matches:[]},i.push(r[s])),n.forEach(({matches:t})=>{r[s].matches.push(...t)}))}}),i}_searchObjectList(t){const e=E(t,this.options),{keys:s,records:r}=this._myIndex,i=[];return r.forEach(({$:t,i:r})=>{if(!n(t))return;let c=[];s.forEach((s,n)=>{c.push(...this._findMatches({key:s,value:t[n],searcher:e}))}),c.length&&i.push({idx:r,item:t,matches:c})}),i}_findMatches({key:e,value:s,searcher:r}){if(!n(s))return[];let i=[];if(t(s))s.forEach(({v:t,i:s,n:c})=>{if(!n(t))return;const{isMatch:o,score:h,indices:a}=r.searchIn(t);o&&i.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}=r.searchIn(t);c&&i.push({score:o,key:e,value:t,norm:n,indices:h})}return i}}K.version="6.3.0",K.createIndex=g,K.parseIndex=function(t,{getFn:e=l.getFn}={}){const{keys:s,records:n}=t,r=new d({getFn:e});return r.setKeys(s),r.setIndexRecords(n),r},K.config=l,function(...t){$.push(...t)}(A);export default K;
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 r(t){return!t.trim().length}const i=Object.prototype.hasOwnProperty;class c{constructor(t){this._keys=[],this._keyMap={};let e=0;t.forEach(t=>{let s=o(t);e+=s.weight,this._keys.push(s),this._keyMap[s.id]=s,e+=s.weight}),this._keys.forEach(t=>{t.weight/=e})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function o(s){let n=null,r=null,c=null,o=1;if(e(s)||t(s))c=s,n=h(s),r=a(s);else{if(!i.call(s,"name"))throw new Error((t=>`Missing ${t} property in key`)("name"));const t=s.name;if(c=t,i.call(s,"weight")&&(o=s.weight,o<=0))throw new Error((t=>`Property 'weight' in key '${t}' must be a positive integer`)(t));n=h(t),r=a(t)}return{path:n,id:r,weight:o,src:c}}function h(e){return t(e)?e:e.split(".")}function a(e){return t(e)?e.join("."):e}var l={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(r,i){let c=[],o=!1;const h=(r,i,a)=>{if(i[a]){const l=r[i[a]];if(!n(l))return;if(a===i.length-1&&(e(l)||s(l)))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)}(l));else if(t(l)){o=!0;for(let t=0,e=l.length;t<e;t+=1)h(l[t],i,a+1)}else i.length&&h(l,i,a+1)}else c.push(r)};return h(r,e(i)?i.split("."):i,0),o?c:c[0]},ignoreLocation:!1,ignoreFieldNorm:!1}};const u=/[^ ]+/g;class d{constructor({getFn:t=l.getFn}={}){this.norm=function(t=3){const e=new Map;return{get(s){const n=s.match(u).length;if(e.has(n))return e.get(n);const r=parseFloat((1/Math.sqrt(n)).toFixed(t));return e.set(n,r),r},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,this._keysMap={},t.forEach((t,e)=>{this._keysMap[t.id]=e})}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}getValueForItemAtKeyId(t,e){return t[this._keysMap[e]]}size(){return this.records.length}_addString(t,e){if(!n(t)||r(t))return;let s={v:t,i:e,n:this.norm.get(t)};this.records.push(s)}_addObject(s,i){let c={i:i,$:{}};this.keys.forEach((i,o)=>{let h=this.getFn(s,i.path);if(n(h))if(t(h)){let s=[];const i=[{nestedArrIndex:-1,value:h}];for(;i.length;){const{nestedArrIndex:c,value:o}=i.pop();if(n(o))if(e(o)&&!r(o)){let t={v:o,i:c,n:this.norm.get(o)};s.push(t)}else t(o)&&o.forEach((t,e)=>{i.push({nestedArrIndex:e,value:t})})}c.$[o]=s}else if(!r(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 g(t,e,{getFn:s=l.getFn}={}){const n=new d({getFn:s});return n.setKeys(t.map(o)),n.setSources(e),n.create(),n}function f(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:r}=t;let i={indices:s,value:r};t.key&&(i.key=t.key.src),t.idx>-1&&(i.refIndex=t.idx),e.matches.push(i)})}function p(t,e){e.score=t.score}function M(t,{errors:e=0,currentLocation:s=0,expectedLocation:n=0,distance:r=l.distance,ignoreLocation:i=l.ignoreLocation}={}){const c=e/t.length;if(i)return c;const o=Math.abs(n-s);return r?c+o/r:o?1:c}function m(t,e,s,{location:n=l.location,distance:r=l.distance,threshold:i=l.threshold,findAllMatches:c=l.findAllMatches,minMatchCharLength:o=l.minMatchCharLength,includeMatches:h=l.includeMatches,ignoreLocation:a=l.ignoreLocation}={}){if(e.length>32)throw new Error(`Pattern length exceeds max of ${32}.`);const u=e.length,d=t.length,g=Math.max(0,Math.min(n,d));let f=i,p=g;const m=o>1||h,y=m?Array(d):[];let x;for(;(x=t.indexOf(e,p))>-1;){let t=M(e,{currentLocation:x,expectedLocation:g,distance:r,ignoreLocation:a});if(f=Math.min(t,f),p=x+u,m){let t=0;for(;t<u;)y[x+t]=1,t+=1}}p=-1;let L=[],k=1,_=u+d;const v=1<<u-1;for(let n=0;n<u;n+=1){let i=0,o=_;for(;i<o;){M(e,{errors:n,currentLocation:g+o,expectedLocation:g,distance:r,ignoreLocation:a})<=f?i=o:_=o,o=Math.floor((_-i)/2+i)}_=o;let h=Math.max(1,g-o+1),l=c?d:Math.min(g+o,d)+u,x=Array(l+2);x[l+1]=(1<<n)-1;for(let i=l;i>=h;i-=1){let c=i-1,o=s[t.charAt(c)];if(m&&(y[c]=+!!o),x[i]=(x[i+1]<<1|1)&o,n&&(x[i]|=(L[i+1]|L[i])<<1|1|L[i+1]),x[i]&v&&(k=M(e,{errors:n,currentLocation:c,expectedLocation:g,distance:r,ignoreLocation:a}),k<=f)){if(f=k,p=c,p<=g)break;h=Math.max(1,2*g-p)}}if(M(e,{errors:n+1,currentLocation:g,expectedLocation:g,distance:r,ignoreLocation:a})>f)break;L=x}const S={isMatch:p>=0,score:Math.max(.001,k)};if(m){const t=function(t=[],e=l.minMatchCharLength){let s=[],n=-1,r=-1,i=0;for(let c=t.length;i<c;i+=1){let c=t[i];c&&-1===n?n=i:c||-1===n||(r=i-1,r-n+1>=e&&s.push([n,r]),n=-1)}return t[i-1]&&i-n>=e&&s.push([n,i-1]),s}(y,o);t.length?h&&(S.indices=t):S.isMatch=!1}return S}function y(t){let e={};for(let s=0,n=t.length;s<n;s+=1){const r=t.charAt(s);e[r]=(e[r]||0)|1<<n-s-1}return e}class x{constructor(t,{location:e=l.location,threshold:s=l.threshold,distance:n=l.distance,includeMatches:r=l.includeMatches,findAllMatches:i=l.findAllMatches,minMatchCharLength:c=l.minMatchCharLength,isCaseSensitive:o=l.isCaseSensitive,ignoreLocation:h=l.ignoreLocation}={}){if(this.options={location:e,threshold:s,distance:n,includeMatches:r,findAllMatches:i,minMatchCharLength:c,isCaseSensitive:o,ignoreLocation:h},this.pattern=o?t:t.toLowerCase(),this.chunks=[],!this.pattern.length)return;const a=(t,e)=>{this.chunks.push({pattern:t,alphabet:y(t),startIndex:e})},u=this.pattern.length;if(u>32){let t=0;const e=u%32,s=u-e;for(;t<s;)a(this.pattern.substr(t,32),t),t+=32;if(e){const t=u-32;a(this.pattern.substr(t),t)}}else a(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:r,threshold:i,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:f,score:p,indices:M}=m(t,e,d,{location:n+g,distance:r,threshold:i,findAllMatches:c,minMatchCharLength:o,includeMatches:s,ignoreLocation:h});f&&(u=!0),l+=p,f&&M&&(a=[...a,...M])});let d={isMatch:u,score:u?l/this.chunks.length:1};return u&&s&&(d.indices=a),d}}class L{constructor(t){this.pattern=t}static isMultiMatch(t){return k(t,this.multiRegex)}static isSingleMatch(t){return k(t,this.singleRegex)}search(){}}function k(t,e){const s=t.match(e);return s?s[1]:null}class _ extends L{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=[],r=this.pattern.length;for(;(e=t.indexOf(this.pattern,s))>-1;)s=e+r,n.push([e,s-1]);const i=!!n.length;return{isMatch:i,score:i?1:0,indices:n}}}class v extends L{constructor(t,{location:e=l.location,threshold:s=l.threshold,distance:n=l.distance,includeMatches:r=l.includeMatches,findAllMatches:i=l.findAllMatches,minMatchCharLength:c=l.minMatchCharLength,isCaseSensitive:o=l.isCaseSensitive}={}){super(t),this._bitapSearch=new x(t,{location:e,threshold:s,distance:n,includeMatches:r,findAllMatches:i,minMatchCharLength:c,isCaseSensitive:o})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}const S=[_,class extends L{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 L{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 L{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 L{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 L{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]}}},v],C=S.length,I=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/;const w=new Set([v.type,_.type]);class A{constructor(t,{isCaseSensitive:e=l.isCaseSensitive,includeMatches:s=l.includeMatches,minMatchCharLength:n=l.minMatchCharLength,findAllMatches:r=l.findAllMatches,location:i=l.location,threshold:c=l.threshold,distance:o=l.distance}={}){this.query=null,this.options={isCaseSensitive:e,includeMatches:s,minMatchCharLength:n,findAllMatches:r,location:i,threshold:c,distance:o},this.pattern=e?t:t.toLowerCase(),this.query=function(t,e={}){return t.split("|").map(t=>{let s=t.trim().split(I).filter(t=>t&&!!t.trim()),n=[];for(let t=0,r=s.length;t<r;t+=1){const r=s[t];let i=!1,c=-1;for(;!i&&++c<C;){const t=S[c];let s=t.isMultiMatch(r);s&&(n.push(new t(s,e)),i=!0)}if(!i)for(c=-1;++c<C;){const t=S[c];let s=t.isSingleMatch(r);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 r=0,i=[],c=0;for(let n=0,o=e.length;n<o;n+=1){const o=e[n];i.length=0,r=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,r=0,i.length=0;break}if(r+=1,c+=l,s){const t=n.constructor.type;w.has(t)?i=[...i,...a]:i.push(a)}}if(r){let t={isMatch:!0,score:c/r};return s&&(t.indices=i),t}}return{isMatch:!1,score:1}}}const $=[];function E(t,e){for(let s=0,n=$.length;s<n;s+=1){let n=$[s];if(n.condition(t,e))return new n(t,e)}return new x(t,e)}const b="$and",F="$or",R="$path",O="$val",j=t=>!(!t[b]&&!t[F]),N=t=>({[b]:Object.keys(t).map(e=>({[e]:t[e]}))});function z(s,n,{auto:r=!0}={}){const i=s=>{let c=Object.keys(s);const o=(t=>!!t[R])(s);if(!o&&c.length>1&&!j(s))return i(N(s));if((e=>!t(e)&&"object"==typeof e&&!j(e))(s)){const t=o?s[R]:c[0],i=o?s[O]:s[t];if(!e(i))throw new Error((t=>"Invalid value for key "+t)(t));const h={keyId:a(t),pattern:i};return r&&(h.searcher=E(i,n)),h}let h={children:[],operator:c[0]};return c.forEach(e=>{const n=s[e];t(n)&&n.forEach(t=>{h.children.push(i(t))})}),h};return j(s)||(s=N(s)),i(s)}class K{constructor(t,e={},s){this.options={...l,...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 d))throw new Error("Incorrect 'index' type");this._myIndex=e||g(this.options.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:r,includeScore:i,shouldSort:c,sortFn:o,ignoreFieldNorm:h}=this.options;let a=e(t)?e(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return function(t,e,{ignoreFieldNorm:s=l.ignoreFieldNorm}){t.forEach(t=>{let e=1;t.matches.forEach(({key:t,norm:n,score:r})=>{const i=t?t.weight:null;e*=Math.pow(0===r&&i?Number.EPSILON:r,(i||1)*(s?1:n))}),t.score=e})}(a,this._keyStore,{ignoreFieldNorm:h}),c&&a.sort(o),s(n)&&n>-1&&(a=a.slice(0,n)),function(t,e,{includeMatches:s=l.includeMatches,includeScore:n=l.includeScore}={}){const r=[];s&&r.push(f);n&&r.push(p);return t.map(t=>{const{idx:s}=t,n={item:e[s],refIndex:s};return r.length&&r.forEach(e=>{e(t,n)}),n})}(a,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(t){const e=E(t,this.options),{records:s}=this._myIndex,r=[];return s.forEach(({v:t,i:s,n:i})=>{if(!n(t))return;const{isMatch:c,score:o,indices:h}=e.searchIn(t);c&&r.push({item:t,idx:s,matches:[{score:o,value:t,norm:i,indices:h}]})}),r}_searchLogical(t){const e=z(t,this.options),s=(t,e,n)=>{if(!t.children){const{keyId:s,searcher:r}=t,i=this._findMatches({key:this._keyStore.get(s),value:this._myIndex.getValueForItemAtKeyId(e,s),searcher:r});return i&&i.length?[{idx:n,item:e,matches:i}]:[]}switch(t.operator){case b:{const r=[];for(let i=0,c=t.children.length;i<c;i+=1){const c=t.children[i],o=s(c,e,n);if(!o.length)return[];r.push(...o)}return r}case F:{const r=[];for(let i=0,c=t.children.length;i<c;i+=1){const c=t.children[i],o=s(c,e,n);if(o.length){r.push(...o);break}}return r}}},r=this._myIndex.records,i={},c=[];return r.forEach(({$:t,i:r})=>{if(n(t)){let n=s(e,t,r);n.length&&(i[r]||(i[r]={idx:r,item:t,matches:[]},c.push(i[r])),n.forEach(({matches:t})=>{i[r].matches.push(...t)}))}}),c}_searchObjectList(t){const e=E(t,this.options),{keys:s,records:r}=this._myIndex,i=[];return r.forEach(({$:t,i:r})=>{if(!n(t))return;let c=[];s.forEach((s,n)=>{c.push(...this._findMatches({key:s,value:t[n],searcher:e}))}),c.length&&i.push({idx:r,item:t,matches:c})}),i}_findMatches({key:e,value:s,searcher:r}){if(!n(s))return[];let i=[];if(t(s))s.forEach(({v:t,i:s,n:c})=>{if(!n(t))return;const{isMatch:o,score:h,indices:a}=r.searchIn(t);o&&i.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}=r.searchIn(t);c&&i.push({score:o,key:e,value:t,norm:n,indices:h})}return i}}K.version="6.3.1",K.createIndex=g,K.parseIndex=function(t,{getFn:e=l.getFn}={}){const{keys:s,records:n}=t,r=new d({getFn:e});return r.setKeys(s),r.setIndexRecords(n),r},K.config=l,function(...t){$.push(...t)}(A);export default K;
/**
* Fuse.js v6.3.0 - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v6.3.1 - 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 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._keyMap={};var i=0;n.forEach((function(e){var t=S(e);i+=t.weight,r._keys.push(t),r._keyMap[t.id]=t,i+=t.weight})),this._keys.forEach((function(e){e.weight/=i}))}return r(e,[{key:"get",value:function(e){return this._keyMap[e]}},{key:"keys",value:function(){return this._keys}},{key:"toJSON",value:function(){return JSON.stringify(this._keys)}}]),e}();function S(e){var t=null,n=null,r=null,i=1;if(g(e)||v(e))r=e,t=_(e),n=w(e);else{if(!x.call(e,"name"))throw new Error(function(e){return"Missing ".concat(e," property in key")}("name"));var o=e.name;if(r=o,x.call(e,"weight")&&(i=e.weight)<=0)throw new Error(function(e){return"Property 'weight' in key '".concat(e,"' must be a positive integer")}(o));t=_(o),n=w(o)}return{path:t,id:n,weight:i,src:r}}function _(e){return v(e)?e:e.split(".")}function w(e){return v(e)?e.join("."):e}var L=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,o){if(i[o]){var c=t[i[o]];if(!p(c))return;if(o===i.length-1&&(g(c)||y(c)))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)}(c));else if(v(c)){r=!0;for(var a=0,s=c.length;a<s;a+=1)e(c[a],i,o+1)}else i.length&&e(c,i,o+1)}else n.push(t)}(e,t,0),r?n:n[0]},ignoreLocation:!1,ignoreFieldNorm:!1}),O=/[^ ]+/g;function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=new Map;return{get:function(n){var r=n.match(O).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 I=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.getFn,i=void 0===r?L.getFn:r;t(this,e),this.norm=A(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=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,n){e._keysMap[t.id]=n}))}},{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:"getValueForItemAtKeyId",value:function(e,t){return e[this._keysMap[t]]}},{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.path);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 C(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?L.getFn:r,o=new I({getFn:i});return o.setKeys(e.map(S)),o.setSources(t),o.create(),o}function j(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.src),e.idx>-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function E(e,t){t.score=e.score}function $(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?L.distance:s,h=t.ignoreLocation,f=void 0===h?L.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 F(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L.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 R(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 P=function(){function e(n){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,c=void 0===o?L.location:o,a=i.threshold,s=void 0===a?L.threshold:a,u=i.distance,h=void 0===u?L.distance:u,f=i.includeMatches,l=void 0===f?L.includeMatches:f,d=i.findAllMatches,v=void 0===d?L.findAllMatches:d,g=i.minMatchCharLength,y=void 0===g?L.minMatchCharLength:g,p=i.isCaseSensitive,m=void 0===p?L.isCaseSensitive:p,k=i.ignoreLocation,M=void 0===k?L.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:R(e),startIndex:t})},b=this.pattern.length;if(b>32){for(var S=0,_=b%32,w=b-_;S<w;)x(this.pattern.substr(S,32),S),S+=32;if(_){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?L.location:i,c=r.distance,a=void 0===c?L.distance:c,s=r.threshold,u=void 0===s?L.threshold:s,h=r.findAllMatches,f=void 0===h?L.findAllMatches:h,l=r.minMatchCharLength,d=void 0===l?L.minMatchCharLength:l,v=r.includeMatches,g=void 0===v?L.includeMatches:v,y=r.ignoreLocation,p=void 0===y?L.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)),S=u,_=b,w=d>1||g,O=w?Array(x):[];(m=e.indexOf(t,_))>-1;){var A=$(t,{currentLocation:m,expectedLocation:b,distance:a,ignoreLocation:p});if(S=Math.min(A,S),_=m+k,w)for(var I=0;I<k;)O[m+I]=1,I+=1}_=-1;for(var C=[],j=1,E=k+x,R=1<<k-1,P=0;P<k;P+=1){for(var N=0,D=E;N<D;){var z=$(t,{errors:P,currentLocation:b+D,expectedLocation:b,distance:a,ignoreLocation:p});z<=S?N=D:E=D,D=Math.floor((E-N)/2+N)}E=D;var K=Math.max(1,b-D+1),q=f?x:Math.min(b+D,x)+k,W=Array(q+2);W[q+1]=(1<<P)-1;for(var J=q;J>=K;J-=1){var T=J-1,V=n[e.charAt(T)];if(w&&(O[T]=+!!V),W[J]=(W[J+1]<<1|1)&V,P&&(W[J]|=(C[J+1]|C[J])<<1|1|C[J+1]),W[J]&R&&(j=$(t,{errors:P,currentLocation:T,expectedLocation:b,distance:a,ignoreLocation:p}))<=S){if(S=j,(_=T)<=b)break;K=Math.max(1,2*b-_)}}var U=$(t,{errors:P+1,currentLocation:b,expectedLocation:b,distance:a,ignoreLocation:p});if(U>S)break;C=W}var B={isMatch:_>=0,score:Math.max(.001,j)};if(w){var G=F(O,d);G.length?g&&(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=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}(),N=function(){function e(n){t(this,e),this.pattern=n}return r(e,[{key:"search",value:function(){}}],[{key:"isMultiMatch",value:function(e){return D(e,this.multiRegex)}},{key:"isSingleMatch",value:function(e){return D(e,this.singleRegex)}}]),e}();function D(e,t){var n=e.match(t);return n?n[1]:null}var 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){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}(N),K=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}(N),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.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}(N),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.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}(N),J=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}(N),T=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}(N),V=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?L.location:c,s=o.threshold,u=void 0===s?L.threshold:s,h=o.distance,f=void 0===h?L.distance:h,l=o.includeMatches,d=void 0===l?L.includeMatches:l,v=o.findAllMatches,g=void 0===v?L.findAllMatches:v,y=o.minMatchCharLength,p=void 0===y?L.minMatchCharLength:y,m=o.isCaseSensitive,k=void 0===m?L.isCaseSensitive:m;return t(this,i),(r=n.call(this,e))._bitapSearch=new P(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}(N),U=[z,q,W,T,J,K,V],B=U.length,G=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/;function H(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.split("|").map((function(e){for(var n=e.trim().split(G).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<B;){var u=U[s],h=u.isMultiMatch(c);h&&(r.push(new u(h,t)),a=!0)}if(!a)for(s=-1;++s<B;){var f=U[s],l=f.isSingleMatch(c);if(l){r.push(new f(l,t));break}}}return r}))}var Q=new Set([V.type,z.type]),X=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.isCaseSensitive,o=void 0===i?L.isCaseSensitive:i,c=r.includeMatches,a=void 0===c?L.includeMatches:c,s=r.minMatchCharLength,u=void 0===s?L.minMatchCharLength:s,h=r.findAllMatches,f=void 0===h?L.findAllMatches:h,l=r.location,d=void 0===l?L.location:l,v=r.threshold,g=void 0===v?L.threshold:v,y=r.distance,p=void 0===y?L.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=H(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;Q.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}(),Y=[];function Z(e,t){for(var n=0,r=Y.length;n<r;n+=1){var i=Y[n];if(i.condition(e,t))return new i(e,t)}return new P(e,t)}var ee="$and",te="$or",ne="$path",re="$val",ie=function(e){return!(!e[ee]&&!e[te])},oe=function(e){return!!e[ne]},ce=function(t){return!v(t)&&"object"===e(t)&&!ie(t)},ae=function(e){return i({},ee,Object.keys(e).map((function(t){return i({},t,e[t])})))},se=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({},L,{},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 I))throw new Error("Incorrect 'index' type");this._myIndex=t||C(this.options.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 ue(h,this._keyStore,{ignoreFieldNorm:u}),a&&h.sort(s),y(r)&&r>-1&&(h=h.slice(0,r)),he(h,this._docs,{includeMatches:o,includeScore:c})}},{key:"_searchStringList",value:function(e){var t=Z(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),o=oe(n);if(!o&&r.length>1&&!ie(n))return e(ae(n));if(ce(n)){var c=o?n[ne]:r[0],a=o?n[re]:n[c];if(!g(a))throw new Error(k(c));var s={keyId:w(c),pattern:a};return i&&(s.searcher=Z(a,t)),s}var u={children:[],operator:r[0]};return r.forEach((function(t){var r=n[t];v(r)&&r.forEach((function(t){u.children.push(e(t))}))})),u};return ie(e)||(e=ae(e)),o(e)}(e,this.options),r=this._myIndex.records,i={},o=[];return r.forEach((function(e){var r=e.$,c=e.i;if(p(r)){var a=function e(n,r,i){if(n.children){for(var o=n.operator,c=[],a=0;a<n.children.length;a+=1){var s=e(n.children[a],r,i);if(s&&s.length){if(c.push({idx:i,item:r,matches:s}),o===te)break}else if(o===ee){c.length=0;break}}return c}var u=n.keyId,h=n.searcher,f=t._myIndex.getValueForItemAtKeyId(r,u);return t._findMatches({key:t._keyStore.get(u),value:f,searcher:h})}(n,r,c);a.length&&(i[c]||(i[c]={idx:c,item:r,matches:[]},o.push(i[c])),a.forEach((function(e){var t,n=e.matches;(t=i[c].matches).push.apply(t,l(n))})))}})),o}},{key:"_searchObjectList",value:function(e){var t=this,n=Z(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 ue(e,t,n){var r=n.ignoreFieldNorm,i=void 0===r?L.ignoreFieldNorm:r;e.forEach((function(e){var t=1;e.matches.forEach((function(e){var n=e.key,r=e.norm,o=e.score,c=n?n.weight:null;t*=Math.pow(0===o&&c?Number.EPSILON:o,(c||1)*(i?1:r))})),e.score=t}))}function he(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?L.includeMatches:r,o=n.includeScore,c=void 0===o?L.includeScore:o,a=[];return i&&a.push(j),c&&a.push(E),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 se.version="6.3.0",se.createIndex=C,se.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?L.getFn:n,i=e.keys,o=e.records,c=new I({getFn:r});return c.setKeys(i),c.setIndexRecords(o),c},se.config=L,function(){Y.push.apply(Y,arguments)}(X),se},"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._keyMap={};var i=0;n.forEach((function(e){var t=S(e);i+=t.weight,r._keys.push(t),r._keyMap[t.id]=t,i+=t.weight})),this._keys.forEach((function(e){e.weight/=i}))}return r(e,[{key:"get",value:function(e){return this._keyMap[e]}},{key:"keys",value:function(){return this._keys}},{key:"toJSON",value:function(){return JSON.stringify(this._keys)}}]),e}();function S(e){var t=null,n=null,r=null,i=1;if(g(e)||v(e))r=e,t=_(e),n=w(e);else{if(!x.call(e,"name"))throw new Error(function(e){return"Missing ".concat(e," property in key")}("name"));var o=e.name;if(r=o,x.call(e,"weight")&&(i=e.weight)<=0)throw new Error(function(e){return"Property 'weight' in key '".concat(e,"' must be a positive integer")}(o));t=_(o),n=w(o)}return{path:t,id:n,weight:i,src:r}}function _(e){return v(e)?e:e.split(".")}function w(e){return v(e)?e.join("."):e}var L=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,o){if(i[o]){var c=t[i[o]];if(!p(c))return;if(o===i.length-1&&(g(c)||y(c)))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)}(c));else if(v(c)){r=!0;for(var a=0,s=c.length;a<s;a+=1)e(c[a],i,o+1)}else i.length&&e(c,i,o+1)}else n.push(t)}(e,g(t)?t.split("."):t,0),r?n:n[0]},ignoreLocation:!1,ignoreFieldNorm:!1}),O=/[^ ]+/g;function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=new Map;return{get:function(n){var r=n.match(O).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 I=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.getFn,i=void 0===r?L.getFn:r;t(this,e),this.norm=A(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=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,n){e._keysMap[t.id]=n}))}},{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:"getValueForItemAtKeyId",value:function(e,t){return e[this._keysMap[t]]}},{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.path);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 C(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?L.getFn:r,o=new I({getFn:i});return o.setKeys(e.map(S)),o.setSources(t),o.create(),o}function j(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.src),e.idx>-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function E(e,t){t.score=e.score}function $(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?L.distance:s,h=t.ignoreLocation,f=void 0===h?L.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 F(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L.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 R(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 P=function(){function e(n){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,c=void 0===o?L.location:o,a=i.threshold,s=void 0===a?L.threshold:a,u=i.distance,h=void 0===u?L.distance:u,f=i.includeMatches,l=void 0===f?L.includeMatches:f,d=i.findAllMatches,v=void 0===d?L.findAllMatches:d,g=i.minMatchCharLength,y=void 0===g?L.minMatchCharLength:g,p=i.isCaseSensitive,m=void 0===p?L.isCaseSensitive:p,k=i.ignoreLocation,M=void 0===k?L.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:R(e),startIndex:t})},b=this.pattern.length;if(b>32){for(var S=0,_=b%32,w=b-_;S<w;)x(this.pattern.substr(S,32),S),S+=32;if(_){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?L.location:i,c=r.distance,a=void 0===c?L.distance:c,s=r.threshold,u=void 0===s?L.threshold:s,h=r.findAllMatches,f=void 0===h?L.findAllMatches:h,l=r.minMatchCharLength,d=void 0===l?L.minMatchCharLength:l,v=r.includeMatches,g=void 0===v?L.includeMatches:v,y=r.ignoreLocation,p=void 0===y?L.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)),S=u,_=b,w=d>1||g,O=w?Array(x):[];(m=e.indexOf(t,_))>-1;){var A=$(t,{currentLocation:m,expectedLocation:b,distance:a,ignoreLocation:p});if(S=Math.min(A,S),_=m+k,w)for(var I=0;I<k;)O[m+I]=1,I+=1}_=-1;for(var C=[],j=1,E=k+x,R=1<<k-1,P=0;P<k;P+=1){for(var N=0,D=E;N<D;){var z=$(t,{errors:P,currentLocation:b+D,expectedLocation:b,distance:a,ignoreLocation:p});z<=S?N=D:E=D,D=Math.floor((E-N)/2+N)}E=D;var K=Math.max(1,b-D+1),q=f?x:Math.min(b+D,x)+k,W=Array(q+2);W[q+1]=(1<<P)-1;for(var J=q;J>=K;J-=1){var T=J-1,V=n[e.charAt(T)];if(w&&(O[T]=+!!V),W[J]=(W[J+1]<<1|1)&V,P&&(W[J]|=(C[J+1]|C[J])<<1|1|C[J+1]),W[J]&R&&(j=$(t,{errors:P,currentLocation:T,expectedLocation:b,distance:a,ignoreLocation:p}))<=S){if(S=j,(_=T)<=b)break;K=Math.max(1,2*b-_)}}var U=$(t,{errors:P+1,currentLocation:b,expectedLocation:b,distance:a,ignoreLocation:p});if(U>S)break;C=W}var B={isMatch:_>=0,score:Math.max(.001,j)};if(w){var G=F(O,d);G.length?g&&(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=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}(),N=function(){function e(n){t(this,e),this.pattern=n}return r(e,[{key:"search",value:function(){}}],[{key:"isMultiMatch",value:function(e){return D(e,this.multiRegex)}},{key:"isSingleMatch",value:function(e){return D(e,this.singleRegex)}}]),e}();function D(e,t){var n=e.match(t);return n?n[1]:null}var 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){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}(N),K=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}(N),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.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}(N),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.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}(N),J=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}(N),T=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}(N),V=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?L.location:c,s=o.threshold,u=void 0===s?L.threshold:s,h=o.distance,f=void 0===h?L.distance:h,l=o.includeMatches,d=void 0===l?L.includeMatches:l,v=o.findAllMatches,g=void 0===v?L.findAllMatches:v,y=o.minMatchCharLength,p=void 0===y?L.minMatchCharLength:y,m=o.isCaseSensitive,k=void 0===m?L.isCaseSensitive:m;return t(this,i),(r=n.call(this,e))._bitapSearch=new P(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}(N),U=[z,q,W,T,J,K,V],B=U.length,G=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/;function H(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.split("|").map((function(e){for(var n=e.trim().split(G).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<B;){var u=U[s],h=u.isMultiMatch(c);h&&(r.push(new u(h,t)),a=!0)}if(!a)for(s=-1;++s<B;){var f=U[s],l=f.isSingleMatch(c);if(l){r.push(new f(l,t));break}}}return r}))}var Q=new Set([V.type,z.type]),X=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.isCaseSensitive,o=void 0===i?L.isCaseSensitive:i,c=r.includeMatches,a=void 0===c?L.includeMatches:c,s=r.minMatchCharLength,u=void 0===s?L.minMatchCharLength:s,h=r.findAllMatches,f=void 0===h?L.findAllMatches:h,l=r.location,d=void 0===l?L.location:l,v=r.threshold,g=void 0===v?L.threshold:v,y=r.distance,p=void 0===y?L.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=H(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;Q.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}(),Y=[];function Z(e,t){for(var n=0,r=Y.length;n<r;n+=1){var i=Y[n];if(i.condition(e,t))return new i(e,t)}return new P(e,t)}var ee="$and",te="$or",ne="$path",re="$val",ie=function(e){return!(!e[ee]&&!e[te])},oe=function(e){return!!e[ne]},ce=function(t){return!v(t)&&"object"===e(t)&&!ie(t)},ae=function(e){return i({},ee,Object.keys(e).map((function(t){return i({},t,e[t])})))},se=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({},L,{},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 I))throw new Error("Incorrect 'index' type");this._myIndex=t||C(this.options.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 ue(h,this._keyStore,{ignoreFieldNorm:u}),a&&h.sort(s),y(r)&&r>-1&&(h=h.slice(0,r)),he(h,this._docs,{includeMatches:o,includeScore:c})}},{key:"_searchStringList",value:function(e){var t=Z(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),o=oe(n);if(!o&&r.length>1&&!ie(n))return e(ae(n));if(ce(n)){var c=o?n[ne]:r[0],a=o?n[re]:n[c];if(!g(a))throw new Error(k(c));var s={keyId:w(c),pattern:a};return i&&(s.searcher=Z(a,t)),s}var u={children:[],operator:r[0]};return r.forEach((function(t){var r=n[t];v(r)&&r.forEach((function(t){u.children.push(e(t))}))})),u};return ie(e)||(e=ae(e)),o(e)}(e,this.options),r=this._myIndex.records,i={},o=[];return r.forEach((function(e){var r=e.$,c=e.i;if(p(r)){var a=function e(n,r,i){if(!n.children){var o=n.keyId,c=n.searcher,a=t._findMatches({key:t._keyStore.get(o),value:t._myIndex.getValueForItemAtKeyId(r,o),searcher:c});return a&&a.length?[{idx:i,item:r,matches:a}]:[]}switch(n.operator){case ee:for(var s=[],u=0,h=n.children.length;u<h;u+=1){var f=e(n.children[u],r,i);if(!f.length)return[];s.push.apply(s,l(f))}return s;case te:for(var d=[],v=0,g=n.children.length;v<g;v+=1){var y=e(n.children[v],r,i);if(y.length){d.push.apply(d,l(y));break}}return d}}(n,r,c);a.length&&(i[c]||(i[c]={idx:c,item:r,matches:[]},o.push(i[c])),a.forEach((function(e){var t,n=e.matches;(t=i[c].matches).push.apply(t,l(n))})))}})),o}},{key:"_searchObjectList",value:function(e){var t=this,n=Z(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 ue(e,t,n){var r=n.ignoreFieldNorm,i=void 0===r?L.ignoreFieldNorm:r;e.forEach((function(e){var t=1;e.matches.forEach((function(e){var n=e.key,r=e.norm,o=e.score,c=n?n.weight:null;t*=Math.pow(0===o&&c?Number.EPSILON:o,(c||1)*(i?1:r))})),e.score=t}))}function he(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?L.includeMatches:r,o=n.includeScore,c=void 0===o?L.includeScore:o,a=[];return i&&a.push(j),c&&a.push(E),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 se.version="6.3.1",se.createIndex=C,se.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?L.getFn:n,i=e.keys,o=e.records,c=new I({getFn:r});return c.setKeys(i),c.setIndexRecords(o),c},se.config=L,function(){Y.push.apply(Y,arguments)}(X),se},"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.3.0",
"version": "6.3.1",
"description": "Lightweight fuzzy-search",

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

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

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