/** * Fuse.js v7.2.0 - Lightweight fuzzy-search (http://fusejs.io) * * Copyright (c) 2026 Kiro Risk (http://kiro.me) * All Rights Reserved. Apache Software License 2.0 * * http://www.apache.org/licenses/LICENSE-2.0 */ var e,t;e=this,t=function(){"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(t){for(var r=1;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:{},r=t.getFn,i=void 0===r?M.getFn:r,u=t.fieldNormWeight,o=void 0===u?M.fieldNormWeight:u;n(this,e),this.norm=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,r=new Map,n=Math.pow(10,t);return{get:function(t){var i=t.match(_).length;if(r.has(i))return r.get(i);var u=1/Math.pow(i,.5*e),o=parseFloat(Math.round(u*n)/n);return r.set(i,o),o},clear:function(){r.clear()}}}(o,3),this.getFn=i,this.isCreated=!1,this.setIndexRecords()}return u(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,r){e._keysMap[t.id]=r}))}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,d(this.docs[0])?this.docs.forEach((function(t,r){e._addString(t,r)})):this.docs.forEach((function(t,r){e._addObject(t,r)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();d(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,r=this.size();t=0;t-=1)this.records.splice(e[t],1);for(var r=0,n=this.records.length;r2&&void 0!==arguments[2]?arguments[2]:{},n=r.getFn,i=void 0===n?M.getFn:n,u=r.fieldNormWeight,o=void 0===u?M.fieldNormWeight:u,s=new w({getFn:i,fieldNormWeight:o});return s.setKeys(e.map(B)),s.setSources(t),s.create(),s}var x=32;function O(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=n.location,u=void 0===i?M.location:i,o=n.distance,s=void 0===o?M.distance:o,a=n.threshold,c=void 0===a?M.threshold:a,h=n.findAllMatches,l=void 0===h?M.findAllMatches:h,f=n.minMatchCharLength,d=void 0===f?M.minMatchCharLength:f,v=n.includeMatches,g=void 0===v?M.includeMatches:v,p=n.ignoreLocation,y=void 0===p?M.ignoreLocation:p;if(t.length>x)throw new Error("Pattern length exceeds max of ".concat(x,"."));for(var A,m=t.length,C=e.length,F=Math.max(0,Math.min(u,C)),E=c,B=F,D=function(e,t){var r=e/m;if(y)return r;var n=Math.abs(F-t);return s?r+n/s:n?1:r},b=d>1||g,k=b?Array(C):[];(A=e.indexOf(t,B))>-1;){var _=D(0,A);if(E=Math.min(_,E),B=A+m,b)for(var w=0;w=W;$-=1){var K=$-1,U=r[e[K]];if(b&&(k[K]=+!!U),T[$]=(T[$+1]<<1|1)&U,I&&(T[$]|=(S[$+1]|S[$])<<1|1|S[$+1]),T[$]&N&&(O=D(I,K))<=E){if(E=O,(B=K)<=F)break;W=Math.max(1,2*F-B)}}if(D(I+1,F)>E)break;S=T}var J={isMatch:B>=0,score:Math.max(.001,O)};if(b){var Q=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:M.minMatchCharLength,r=[],n=-1,i=-1,u=0,o=e.length;u=t&&r.push([n,i]),n=-1)}return e[u-1]&&u-n>=t&&r.push([n,u-1]),r}(k,d);Q.length?g&&(J.indices=Q):J.isMatch=!1}return J}function j(e){for(var t={},r=0,n=e.length;r1&&void 0!==arguments[1]?arguments[1]:{},u=i.location,o=void 0===u?M.location:u,s=i.threshold,a=void 0===s?M.threshold:s,c=i.distance,h=void 0===c?M.distance:c,l=i.includeMatches,f=void 0===l?M.includeMatches:l,d=i.findAllMatches,v=void 0===d?M.findAllMatches:d,g=i.minMatchCharLength,p=void 0===g?M.minMatchCharLength:g,y=i.isCaseSensitive,A=void 0===y?M.isCaseSensitive:y,m=i.ignoreDiacritics,C=void 0===m?M.ignoreDiacritics:m,F=i.ignoreLocation,E=void 0===F?M.ignoreLocation:F;if(n(this,e),this.options={location:o,threshold:a,distance:h,includeMatches:f,findAllMatches:v,minMatchCharLength:p,isCaseSensitive:A,ignoreDiacritics:C,ignoreLocation:E},t=A?t:t.toLowerCase(),t=C?N(t):t,this.pattern=t,this.chunks=[],this.pattern.length){var B=function(e,t){r.chunks.push({pattern:e,alphabet:j(e),startIndex:t})},D=this.pattern.length;if(D>x){for(var b=0,k=D%x,_=D-k;b<_;)B(this.pattern.substr(b,x),b),b+=x;if(k){var w=D-x;B(this.pattern.substr(w),w)}}else B(this.pattern,0)}}return u(e,[{key:"searchIn",value:function(e){var t=this.options,r=t.isCaseSensitive,n=t.ignoreDiacritics,i=t.includeMatches;if(e=r?e:e.toLowerCase(),e=n?N(e):e,this.pattern===e){var u={isMatch:!0,score:0};return i&&(u.indices=[[0,e.length-1]]),u}var o=this.options,a=o.location,c=o.distance,h=o.threshold,l=o.findAllMatches,f=o.minMatchCharLength,d=o.ignoreLocation,v=[],g=0,p=!1;this.chunks.forEach((function(t){var r=t.pattern,n=t.alphabet,u=t.startIndex,o=O(e,r,n,{location:a+u,distance:c,threshold:h,findAllMatches:l,minMatchCharLength:f,includeMatches:i,ignoreLocation:d}),y=o.isMatch,A=o.score,m=o.indices;y&&(p=!0),g+=A,y&&m&&v.push.apply(v,s(m))}));var y={isMatch:p,score:p?g/this.chunks.length:1};return p&&i&&(y.indices=function(e){if(e.length<=1)return e;e.sort((function(e,t){return e[0]-t[0]||e[1]-t[1]}));for(var t=[e[0]],r=1,n=e.length;r0;){var r=e-1>>1;if(t[e].score<=t[r].score)break;var n=t[e];t[e]=t[r],t[r]=n,e=r}}},{key:"_sinkDown",value:function(e){var t=this.heap,r=t.length,n=e;do{var i=2*(e=n)+1,u=2*e+2;if(it[n].score&&(n=i),ut[n].score&&(n=u),n!==e){var o=t[e];t[e]=t[n],t[n]=o}}while(n!==e)}}]),e}();function z(e,t){var r=e.matches;t.matches=[],p(r)&&r.forEach((function(e){if(p(e.indices)&&e.indices.length){var r={indices:e.indices,value:e.value};e.key&&(r.key=e.key.src),e.idx>-1&&(r.refIndex=e.idx),t.matches.push(r)}}))}function T(e,t){t.score=e.score}var $=function(){function e(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=arguments.length>2?arguments[2]:void 0;if(n(this,e),this.options=t(t({},M),i),this.options.useExtendedSearch)throw new Error("Extended search is not available");this._keyStore=new E(this.options.keys),this.setCollection(r,u),this._lastQuery=null,this._lastSearcher=null}return u(e,[{key:"_getSearcher",value:function(e){if(this._lastQuery===e)return this._lastSearcher;var t=function(e,t){for(var r=0,n=L.length;r0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],r=[],n=0,i=this._docs.length;n=0;u-=1)this._docs.splice(r[u],1);this._myIndex.removeAll(r)}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,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).limit,n=void 0===r?-1:r,i=this.options,u=i.includeMatches,o=i.includeScore,s=i.shouldSort,a=i.sortFn,c=i.ignoreFieldNorm;if(v(n)&&n>0&&d(e)){var h=new W(n);d(this._docs[0])?this._searchStringList(e,{heap:h,ignoreFieldNorm:c}):this._searchObjectList(e,{heap:h,ignoreFieldNorm:c}),t=h.extractSorted(a)}else(function(e,t){var r=t.ignoreFieldNorm,n=void 0===r?M.ignoreFieldNorm:r;e.forEach((function(e){P(e,{ignoreFieldNorm:n})}))})(t=d(e)?d(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),{ignoreFieldNorm:c}),s&&t.sort(a),v(n)&&n>-1&&(t=t.slice(0,n));return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.includeMatches,i=void 0===n?M.includeMatches:n,u=r.includeScore,o=void 0===u?M.includeScore:u,s=[];return i&&s.push(z),o&&s.push(T),e.map((function(e){var r=e.idx,n={item:t[r],refIndex:r};return s.length&&s.forEach((function(t){t(e,n)})),n}))}(t,this._docs,{includeMatches:u,includeScore:o})}},{key:"_searchStringList",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.heap,n=t.ignoreFieldNorm,i=this._getSearcher(e),u=this._myIndex.records,o=r?null:[];return u.forEach((function(e){var t=e.v,u=e.i,s=e.n;if(p(t)){var a=i.searchIn(t),c=a.isMatch,h=a.score,l=a.indices;if(c){var f={item:t,idx:u,matches:[{score:h,value:t,norm:s,indices:l}]};r?(P(f,{ignoreFieldNorm:n}),r.shouldInsert(f.score)&&r.insert(f)):o.push(f)}}})),o}},{key:"_searchLogical",value:function(e){throw new Error("Logical search is not available")}},{key:"_searchObjectList",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.heap,i=r.ignoreFieldNorm,u=this._getSearcher(e),o=this._myIndex,a=o.keys,c=o.records,h=n?null:[];return c.forEach((function(e){var r=e.$,o=e.i;if(p(r)){var c=[];if(a.forEach((function(e,n){c.push.apply(c,s(t._findMatches({key:e,value:r[n],searcher:u})))})),c.length){var l={idx:o,item:r,matches:c};n?(P(l,{ignoreFieldNorm:i}),n.shouldInsert(l.score)&&n.insert(l)):h.push(l)}}})),h}},{key:"_findMatches",value:function(e){var t=e.key,r=e.value,n=e.searcher;if(!p(r))return[];var i=[];if(h(r))r.forEach((function(e){var r=e.v,u=e.i,o=e.n;if(p(r)){var s=n.searchIn(r),a=s.isMatch,c=s.score,h=s.indices;a&&i.push({score:c,key:t,value:r,idx:u,norm:o,indices:h})}}));else{var u=r.v,o=r.n,s=n.searchIn(u),a=s.isMatch,c=s.score,l=s.indices;a&&i.push({score:c,key:t,value:u,norm:o,indices:l})}return i}}]),e}();return $.version="7.2.0",$.createIndex=S,$.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.getFn,n=void 0===r?M.getFn:r,i=t.fieldNormWeight,u=void 0===i?M.fieldNormWeight:i,o=e.keys,s=e.records,a=new w({getFn:n,fieldNormWeight:u});return a.setKeys(o),a.setIndexRecords(s),a},$.config=M,$.use=function(){for(var e=arguments.length,t=new Array(e),r=0;r