/** * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io) * * Copyright (c) 2022 Kiro Risk (http://kiro.me) * All Rights Reserved. Apache Software License 2.0 * * http://www.apache.org/licenses/LICENSE-2.0 */vare,t;e=this,t=function(){"use strict";functione(e,t){varn=Object.keys(e);if(Object.getOwnPropertySymbols){varr=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){returnObject.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}returnn}functiont(t){for(varn=1;n<arguments.length;n++){varr=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){c(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}returnt}functionn(e){returnn="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(e){returntypeofe}:function(e){returne&&"function"==typeofSymbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeofe},n(e)}functionr(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}functioni(e,t){for(varn=0;n<t.length;n++){varr=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"inr&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}functiono(e,t,n){returnt&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}functionc(e,t,n){returntine?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}functiona(e,t){if("function"!=typeoft&&null!==t)thrownewTypeError("Super expression must either be null or a function");Object.defineProperty(e,"prototype",{value:Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),writable:!1}),t&&u(e,t)}functions(e){returns=Object.setPrototypeOf?Object.getPrototypeOf:function(e){returne.__proto__||Object.getPrototypeOf(e)},s(e)}functionu(e,t){returnu=Object.setPrototypeOf||function(e,t){returne.__proto__=t,e},u(e,t)}functionh(e,t){if(t&&("object"==typeoft||"function"==typeoft))returnt;if(void0!==t)thrownewTypeError("Derived constructors may only return object or undefined");returnfunction(e){if(void0===e)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");returne}(e)}functionl(e){vart=function(){if("undefined"==typeofReflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeofProxy)return!0;try{returnBoolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();returnfunction(){varn,r=s(e);if(t){vari=s(this).constructor;n=Reflect.construct(r,arguments,i)}elsen=r.apply(this,arguments);returnh(this,n)}}functionf(e){returnfunction(e){if(Array.isArray(e))returnd(e)}(e)||function(e){if("undefined"!=typeofSymbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])returnArray.from(e)}(e)||function(e,t){if(e){if("string"==typeofe)returnd(e,t);varn=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):void0}}(e)||function(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}functiond(e,t){(null==t||t>e.length)&&(t=e.length);for(varn=0,r=newArray(t);n<t;n++)r[n]=e[n];returnr}functionv(e){returnArray.isArray?Array.isArray(e):"[object Array]"===b(e)}functiong(e){return"string"==typeofe}functiony(e){return"number"==typeofe}functionp(e){return!0===e||!1===e||function(e){returnm(e)&&null!==e}(e)&&"[object Boolean]"==b(e)}functionm(e){return"object"===n(e)}functionk(e){returnnull!=e}functionM(e){return!e.trim().length}functionb(e){returnnull==e?void0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}varx=function(e){return"Invalid value for key ".concat(e)},w=function(e){return"Pattern length exceeds max of ".concat(e,".")},L=Object.prototype.hasOwnProperty,S=function(){functione(t){varn=this;r(this,e),this._keys=[],this._keyMap={};vari=0;t.forEach((function(e){vart=_(e);i+=t.weight,n._keys.push(t),n._keyMap[t.id]=t,i+=t.weight})),this._keys.forEach((function(e){e.weight/=i}))}returno(e,[{key:"get",value:function(e){returnthis._keyMap[e]}},{key:"keys",value:function(){returnthis._keys}},{key:"toJSON",value:function(){returnJSON.stringify(this._keys)}}]),e}();function_(e){vart=null,n=null,r=null,i=1,o=null;if(g(e)||v(e))r=e,t=O(e),n=j(e);else{if(!L.call(e,"name"))thrownewError(function(e){return"Missing ".concat(e," property in key")}("name"));varc=e.name;if(r=c,L.call(e,"weight")&&(i=e.weight)<=0)thrownewError(function(e){return"Property 'weight' in key '".concat(e,"' must be a positive integer")}(c));t=O(c),n=j(c),o=e.getFn}return{path:t,id:n,weight:i,src:r,getFn:o}}functionO(e){returnv(e)?e:e.split(".")}functionj(e){returnv(e)?e.join("."):e}varA={useExtendedSearch:!1,getFn:function(e,t){varn=[],r=!1;returnfunctione(t,i,o){if(k(t))if(i[o]){varc=t[i[o]];if(!k(c))return;if(o===i.length-1&&(g(c)||y(c)||p(c)))n.push(function(e){returnnull==e?"":function(e){if("string"==typeofe)returne;vart=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(c));elseif(v(c)){r=!0;for(vara=0,s=c.length;a<s;a+=1)e(c[a],i,o+1)}elsei.length&&e(c,i,o+1)}elsen.push(t)}(e,g(t)?t.split("."):t,0),r?n:n[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},I=t(t(t(t({},{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:function(e,t){returne.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}),A),C=/[^]+/g;functionE(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void0!==arguments[1]?arguments[1]:3,n=newMap,r=Math.pow(10,t);return{get:function(t){vari=t.match(C).length;if(n.has(i))returnn.get(i);varo=1/Math.pow(i,.5*e),c=parseFloat(Math.round(o*r)/r);returnn.set(i,c),c},clear:function(){n.clear()}}}var$=function(){functione(){vart=arguments.length>0&&void0!==arguments[0]?arguments[0]:{},n=t.getFn,i=void0===n?I.getFn:n,o=t.fieldNormWeight,c=void0===o?I.fieldNormWeight:o;r(this,e),this.norm=E(c,3),this.getFn=i,this.isCreated=!1,this.setIndexRecords()}returno(e,[{key:"setSources",value:function(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){vare=this,t=arguments.length>0&&void0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,n){e._keysMap[t.id]=n}))}},{key:"create",value:function(){vare=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){vart=this.size();g(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(vart=e,n=this.size();t<n;t+=1)this.records[t].i-=1}},{key:"getValueForItemAtKeyId",value:function(e,t){returne[this._keysMap[t]]}},{key:"size",value:function(){returnthis.records.length}},{key:"_addString",value:function(e,t){if(k(e)&&!M(e)){varn={v:e,i:t,n:this.norm.get(e)};this.records.push(n)}}},{key:"_addObject",value:function(e,t){varn=this,r={i:t,$:{}};this.keys.forEach((function(t,i){varo=t.getFn?t.getFn(e):n.getFn(e,t.path);if(k(o))if(v(o))!function(){for(vare=[],t=[{nestedArrIndex:-1,value:o}];t.length;){varc=t.pop(),a=c.nestedArrIndex,s=c.value;if(k(s))if(g(s)&&!M(s)){varu={v:s,i:a,n:n.norm.get(s)};e.push(u)}elsev(s)&&s.forEach((function(e,n){t.push({nestedArrIndex:n,value:e})}))}r.$[i]=e}();elseif(g(o)&&!M(o)){varc={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}();functionF(e,t){varn=arguments.length>2&&void0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void0===r?I.getFn:r,o=n.fieldNormWeight,c=void0===o?I.fieldNormWeight:o,a=new$({getFn:i,fieldNormWeight:c});returna.setKeys(e.map(_)),a.setSources(t),a.create(),a}functionR(e){vart=arguments.length>1&&void0!==arguments[1]?arguments[1]:{},n=t.errors,r=void0===n?0:n,i=t.currentLocation,o=void0===i?0:i,c=t.expectedLocation,a=void0===c?0:c,s=t.distance,u=void0===s?I.distance:s,h=t.ignoreLocation,l=void0===h?I.ignoreLocation:h,f=r/e.length;if(l)returnf;vard=Math.abs(a-o);returnu?f+d/u:d?1:f}functionN(){for(vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void0!==arguments[1]?arguments[1]:I.minMatchCharLength,n=[],r=-1,i=-1,o=0,c=e.length;o<c;o+=1){vara=e[o];a&&-1===r?r=o:a||-1===r||((i=o-1)-r+1>=t&&n.push([r,i]),r=-1)}returne[o-1]&&o-r>=t&&n.push([r,o-1]),n}varP=32;functionW(e){for(vart={},n=0,r=e.length;n<r;n+=1){vari=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}returnt}varT=function(){functione(t){varn=this,i=arguments.length>1&&void0!==arguments[1]?arguments[1]:{},o=i.location,c=void0===o?I.location:o,a=i.threshold,s=void0===a?I.threshold:a,u=i.distance,h=void0===u?I.distance:u,l=i.includeMatches,f=void0===l?I.includeMatches:l,d=i.findAllMatches,v=void0===d?I.findAllMatches:d,g=i.minMatchCharLength,y=void0===g?I.minMatchCharLength:g,p=i.isCaseSensitive,m=void0===p?I.isCaseSensitive:p,k=i.ignoreLocation,M=void0===k?I.ignoreLocation:k;if(r(this,e),this.options={location:c,threshold:s,distance:h,includeMatches:f,findAllMatches:v,minMatchCharLength:y,isCaseSensitive:m,ignoreLocation:M},this.pattern=m?t:t.toLowerCase(),this.chunks=[],this.pattern.length){varb=function(e,t){n.chunks.push({pattern:e,alphabet:W(e),startIndex:t})},x=this.pattern.length;if(x>P){for(varw=0,L=x%P,S=x-L;w<S;)b(this.pattern.substr(w,P),w),w+=P;if(L){var_=x-P;b(this.pattern.substr(_),_)}}elseb(this.pattern,0)}}returno(e,[{key:"searchIn",value:function(e){vart=this.options,n=t.isCaseSensitive,r=t.includeMatches;if(n||(e=e.toLowerCase()),this.pattern===e){vari={isMatch:!0,score:0};returnr&&(i.indices=[[0,e.length-1]]),i}varo=this.options,c=o.location,a=o.distance,s=o.threshold,u=o.findAllMatches,h=o.minMatchCharLength,l=o.ignoreLocation,d=[],v=0,g=!1;this.chunks.forEach((function(t){varn=t.pattern,i=t.alphabet,o=t.startIndex,y=function(e,t,n){varr=arguments.length>3&&void0!==arguments[3]?arguments[3]:{},i=r.location,o=void0===i?I.location:i,c=r.distance,a=void0===c?I.distance:c,s=r.threshold,u=void0===s?I.threshold:s,h=r.findAllMatches,l=void0===h?I.findAllMatches:h,f=r.minMatchCharLength,d=void0===f?I.minMatchCharLength:f,v=r.includeMatches,g=void0===v?I.includeMatches:v,y=r.ignoreLocation,p=void0===y?I.ignoreLocation:y;if(t.length>P)thrownewError(w(P));for(varm,k=t.length,M=e.length,b=Math.max(0,Math.min(o,M)),x=u,L=b,S=d>1||g,_=S?Array(M):[];(m=e.indexOf(t,L))>-1;){varO=R(t,{currentLocation:m,expectedLocation:b,distance:a,ignoreLocation:p});if(x=Math.min(O,x),L=m+k,S)for(varj=0;j<k;)_[m+j]=1,j+=1}L=-1;for(varA=[],C=1,E=k+M,$=1<<k-1,F=0;F<k;F+=1){for(varW=0,T=E;W<T;)R(t,{errors:F,currentLocation:b+T,expectedLocation:b,distance:a,ignoreLocation:p})<=x?W=T:E=T,T=Math.floor((E-W)/2+W);E=T;varz=Math.max(1,b-T+1),D=l?M:Math.min(b+T,M)+k,K=Array(D+2);K[D+1]=(1<<F)-1;for(varq=D;q>=z;q-=1){varB=q-1,J=n[e.charAt(B)];if(S&&(_[B]=+!!J),K[q]=(K[q+1]<<1|1)&J,F&&(K[q]|=(A[q+1]|A[q])<<1|1|A[q+1]),K[q]&$&&(C=R(t,{errors:F,currentLocation:B,expectedLocation:b,distance:a,ignoreLocation:p}))<=x){if(x=C,(L=B)<=b)break;z=Math.max(1,2*b-L)}}if(R(t,{errors:F+1,currentLocation:b,expectedLocation:b,distance:a,ignoreLocation:p})>x)break;A=K}varU={isMatch:L>=0,score:Math.max(.001,C)};if(S){varV=N(_,d);V.length?g&&(U.indices=V):U.isMatch=!1}returnU}(e,n,i,{location:c+o,distance:a,threshold:s,findAllMatches:u,minMatchCharLength:h,includeMatches:r,ignoreLocation:l}),p=y.isMatch,m=y.score,k=y.indices;p&&(g=!0),v+=m,p&&k&&(d=[].concat(f(d),f(k)))}));vary={isMatch:g,score:g?v/this.chunks.length:1};returng&&r&&(y.indices=d),y}}]),e}(),z=function(){functione(t){r(this,e),this.pattern=t}returno(e,[{key:"search",value:function(){}}],[{key:"isMultiMatch",value:function(e){returnD(e,this.multiRegex)}},{key:"isSingleMatch",value:function(e){returnD(e,this.singleRegex)}}]),e}();functionD(e,t){varn=e.match(t);returnn?n[1]:null}varK=function(e){a(n,e);vart=l(n);functionn(e){returnr(this,n),t.call(this,e)}returno(n,[{key:"search",value:function(e){vart=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"exact"}},{key:"multiRegex",get:function(){return/^="(.*)"$/}},{key:"singleRegex",get:function(){return/^=(.*)$/}}]),n}(z),q=function(e){a(n,e);vart=l(n);functionn(e){returnr(this,n),t.call(this,e)}returno(n,[{key:"search",value:function(e){vart=-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/^!(.*)$/}}]),n}(z),B=function(e){a(n,e);vart=l(n);functionn(e){returnr(this,n),t.call(this,e)}returno(n,[{key:"search",value:function(e){vart=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/^\^(.*)$/}}]),n}(z),J=function(e){a(n,e);vart=l(n);functionn(e){returnr(this,n),t.call(this,e)}returno(n,[{key:"search",value:function(e){vart=!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/^!\^(.*)$/}}]),n}(z),U=function(e){a(n,e);vart=l(n);functionn(e){returnr(this,n),t.call(this,e)}returno(n,[{key:"search",value:function(e){vart=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/^(.*)\$$/}}]),n}(z),V=function(e){a(n,e);vart=l(n);functionn(e){returnr(this,n),t.call(this,e)}returno(n,[{key:"search",value:function(e){vart=!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/^!(.*)\$$/}}]),n}(z),G=function(e){a(n,e);vart=l(n);functionn(e){vari,o=arguments.length>1&&void0!==arguments[1]?arguments[1]:{},c=o.location,a=void0===c?I.location:c,s=o.threshold,u=void0===s?I.threshold:s,h=o.distance,l=void0===h?I.distance:h,f=o.includeMatches,d=void0===f?I.includeMatches:f,v=o.findAllMatches,g=void0===v?I.findAllMatches:v,y=o.minMatchCharLength,p=void0===y?I.minMatchCharLength:y,m=o.isCaseSensitive,k=void0===m?I.isCaseSensitive:m,M=o.ignoreLocation,b=void0===M?I.ignoreLocation:M;returnr(this,n),(i=t.call(this,e))._bitapSearch=newT(e,{location:a,threshold:u,distance:l,includeMatches:d,findAllMatches:g,minMatchCharLength:p,isCaseSensitive:k,ignoreLocation:b}),i}returno(n,[{key:"search",value:function(e){returnthis._bitapSearch.searchIn(e)}}],[{key:"type",get:function(){return"fuzzy"}},{key:"multiRegex",get:function(){return/^"(.*)"$/}},{key:"singleRegex",get:function(){return/^(.*)$/}}]),n}(z),H=function(e){a(n,e);vart=l(n);functionn(e){returnr(this,n),t.call(this,e)}returno(n,[{key:"search",value:function(e){for(vart,n=0,r=[],i=this.pattern.length;(t=e.indexOf(this.pattern,n))>-1;)n=t+i,r.push([t,n-1]);varo=!!r.length;return{isMatch:o,score:o?0:1,indices:r}}}],[{key:"type",get:function(){return"include"}},{key:"multiRegex",get:function(){return/^'"(.*)"$/}},{key:"singleRegex",get:function(){return/^'(.*)$/}}]),n}(z),Q=[K,H,B,J,V,U,q,G],X=Q.length,Y=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;functionZ(e){vart=arguments.length>1&&void0!==arguments[1]?arguments[1]:{};returne.split("|").map((function(e){for(varn=e.trim().split(Y).filter((function(e){returne&&!!e.trim()})),r=[],i=0,o=n.length;i<o;i+=1){for(varc=n[i],a=!1,s=-1;!a&&++s<X;){varu=Q[s],h=u.isMultiMatch(c);h&&(r.push(newu(h,t)),a=!0)}if(!a)for(s=-1;++s<X;){varl=Q[s],f=l.isSingleMatch(c);if(f){r.push(newl(f,t));break}}}returnr}))}varee=newSet([G.type,H.type]),te=function(){functione(t){varn=arguments.length>1&&void0!==arguments[1]?arguments[1]:{},i=n.isCaseSensitive,o=void0===i?I.isCaseSensitive:i,c=n.includeMatches,a=void0===c?I.includeMatches:c,s=n.minMatchCharLength,u=void0===s?I.minMatchCharLength:s,h=n.ignoreLocation,l=void0===h?I.ignoreLocation:h,f=n.findAllMatches,d=void0===f?I.findAllMatches:f,v=n.location,g=void0===v?I.location:v,y=n.threshold,p=void0===y?I.threshold:y,m=n.distance,k=void0===m?I.distance:m;r(this,e),this.query=null,this.options={isCaseSensitive:o,includeMatches:a,minMatchCharLength:u,findAllMatches:d,ignoreLocation:l,location:g,threshold:p,distance:k},this.pattern=o?t:t.toLowerCase(),this.query=Z(this.pattern,this.options)}returno(e,[{key:"searchIn",value:function(e){vart=this.query;if(!t)return{isMatch:!1,score:1};varn=this.options,r=n.includeMatches;e=n.isCaseSensitive?e:e.toLowerCase();for(vari=0,o=[],c=0,a=0,s=t.length;a<s;a+=1){varu=t[a];o.length=0,i=0;for(varh=0,l=u.length;h<l;h+=1){vard=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){varm=d.constructor.type;ee.has(m)?o=[].concat(f(o),f(y)):o.push(y)}}if(i){vark={isMatch:!0,score:c/i};returnr&&(k.indices=o),k}}return{isMatch:!1,score:1}}}],[{key:"condition",value:function(e,t){returnt.useExtendedSearch}}]),e}(),ne=[];functionre(e,t){for(varn=0,r=ne.length;n<r;n+=1){vari=ne[n];if(i.condition(e,t))returnnewi(e,t)}returnnewT(e,t)}varie="$and",oe="$or",ce="$path",ae="$val",se=function(e){return!(!e[ie]&&!e[oe])},ue=function(e){return!!e[ce]},he=function(e){return!v(e)&&m(e)&&!se(e)},le=function(e){returnc({},ie,Object.keys(e).map((function(t){returnc({},t,e[t])})))};functionfe(e,t){varn=t.ignoreFieldNorm,r=void0===n?I.ignoreFieldNorm:n;e.forEach((function(e){vart=1;e.matches.forEach((function(e){varn=e.key,i=e.norm,o=e.score,c=n?n.weight:null;t*=Math.pow(0===o&&c?Number.EPSILON:o,(c||1)*(r?1:i))})),e.score=t}))}functionde(e,t){varn=e.matches;t.matches=[],k(n)&&n.forEach((function(e){if(k(e.indices)&&e.indices.length){varn={indices:e.indices,value:e.value};e.key&&(n.key=e.key.src),e.idx>-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}functionve(e,t){t.score=e.score}functionge(e,t){varn=arguments.length>2&&void0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void0===r?I.includeMatches:r,o=n.includeScore,c=void0===o?I.includeScore:o,a=[];returni&&a.push(de),c&&a.push(ve),e.map((function(e){varn=e.idx,r={item:t[n],refIndex:n};returna.length&&a.forEach((function(t){t(e,r)})),r}))}varye=function(){functione(n){vari=arguments.length>1&&void0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void0;r(this,e),this.options=t(t({},I),i),this.options.useExtendedSearch,this._keyStore=newS(this.options.keys),this.setCollection(n,o)}returno(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(tinstanceof$))thrownewError("Incorrect 'index' type");this._myIndex=t||F(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}},{key:"add",value:function(e){k(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:function(){return!1},t=[],n=0,r=this._docs.length;n<r;n+=1){vari=this._docs[n];e(i,n)&&(this.removeAt(n),n-=1,r-=1,t.push(i))}returnt}},{key:"removeAt",value:function(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}},{key:"getIndex",value:function(){returnthis._myIndex}},{key:"search",value:function(e){vart=arguments.length>1&&void0!==arguments[1]?arguments[1]:{},n=t.limit,r=void0===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);returnfe(h,{ignoreFieldNorm:u}),a&&h.sort(s),y(r)&&r>-1&&(h=h.slice(0,r)),ge(h,this._docs,{includeMatches:o,includeScore:c})}},{key:"_searchStringList",value:function(e){vart=re(e,this.options),n=this._myIndex.records,r=[];returnn.forEach((function(e){varn=e.v,i=e.i,o=e.n;if(k(n)){varc=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){vart=this,n=function(e,t){varn=(arguments.length>2&&void0!==arguments[2]?arguments[2]:{}).auto,r=void0===n||n,i=functione(n){vari=Object.keys(n),o=ue(n);if(!o&&i.length>1&&!se(n))returne(le(n));if(he(n)){varc=o?n[ce]:i[0],a=o?n[ae]:n[c];if(!g(a))thrownewError(x(c));vars={keyId:j(c),pattern:a};returnr&&(s.searcher=re(a,t)),s}varu={children:[],operator:i[0]};returni.forEach((function(t){varr=n[t];v(r)&&r.forEach((function(t){u.children.push(e(t))}))})),u};returnse(e)||(e=le(e)),i(e)}(e,this.options),r=functione(n,r,i){if(!n.children){varo=n.keyId,c=n.searcher,a=t._findMatches({key:t._keyStore.get(o),value:t._myIndex.getValueForItemAtKeyId(r,o),searcher:c});returna&&a.length?[{idx:i,item:r,matches:a}]:[]}for(vars=[],u=0,h=n.children.length;u<h;u+=1){varl=e(n.children[u],r,i);if(l.length)s.push.apply(s,f(l));elseif(n.operator===ie)return[]}returns},i=this._myIndex.records,o={},c=[];returni.forEach((function(e){vart=e.$,i=e.i;if(k(t)){vara=r(n,t,i);a.length&&(o[i]||(o[i]={idx:i,item:t,matches:[]},c.push(o[i])),a.forEach((function(e){vart,n=e.matches;(t=o[i].matches).push.apply(t,f(n))})))}})),c}},{key:"_searchObjectList",value:function(e){vart=this,n=re(e,this.options),r=this._myIndex,i=r.keys,o=r.records,c=[];returno.forEach((function(e){varr=e.$,o=e.i;if(k(r)){vara=[];i.forEach((function(e,i){a.push.apply(a,f(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){vart=e.key,n=e.value,r=e.searcher;if(!k(n))return[];vari=[];if(v(n))n.forEach((function(e){varn=e.v,o=e.i,c=e.n;if(k(n)){vara=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{varo=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})}returni}}]),e}();returnye.version="6.6.2",ye.createIndex=F,ye.parseIndex=function(e){vart=arguments.length>1&&void0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void0===n?I.getFn:n,i=t.fieldNormWeight,o=void0===i?I.fieldNormWeight:i,c=e.keys,a=e.records,s=new$({getFn:r,fieldNormWeight:o});returns.setKeys(c),s.setIndexRecords(a),s},ye.config=I,function(){ne.push.apply(ne,arguments)}(te),ye},"object"==typeofexports&&"undefined"!=typeofmodule?module.exports=t():"function"==typeofdefine&&define.amd?define(t):(e="undefined"!=typeofglobalThis?globalThis:e||self).Fuse=t();