
fitnesse.resources.bootstrap-plus.js.fuse.min.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fitnesse-bootstrap-plus-theme
Show all versions of fitnesse-bootstrap-plus-theme
Makes FitNesse more user friendly
The newest version!
/**
* Fuse.js v5.1.0 - Lightweight fuzzy-search (http://fusejs.io)
*
* Copyright (c) 2020 Kiro Risk (http://kiro.me)
* All Rights Reserved. Apache Software License 2.0
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
var t,e;t=this,e=function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var r=0;r32)throw new Error("Pattern length exceeds max of ".concat(32,"."));this.pattern=f?r:r.toLowerCase(),this.patternAlphabet=function(t){for(var e={},r=t.length,n=0;n=P;F-=1){var z=F-1,q=r[t.charAt(z)];if(q&&(x[z]=1),E[F]=(E[F+1]<<1|1)&q,0!==C&&(E[F]|=(S[F+1]|S[F])<<1|1|S[F+1]),E[F]&L&&(I=o(e,{errors:C,currentLocation:z,expectedLocation:k,distance:h}))<=M){if(M=I,(b=z)<=k)break;P=Math.max(1,2*k-b)}}if(o(e,{errors:C+1,currentLocation:k,expectedLocation:k,distance:h})>M)break;S=E}var D={isMatch:b>=0,score:I||.001};return g&&(D.matchedIndices=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=[],n=-1,i=-1,s=0,o=t.length;s=e&&r.push([n,i]),n=-1)}return t[s-1]&&s-n>=e&&r.push([n,s-1]),r}(x,d)),D}(t,this.pattern,this.patternAlphabet,{location:a,distance:h,threshold:c,findAllMatches:u,minMatchCharLength:f,includeMatches:n})}}]),e}(),h=function(t){return t.substr(1)},c=function(t){return"'"==t.charAt(0)},u=function(t,e){var r=h(t);return{isMatch:e.indexOf(r)>-1,score:0}},f=function(t){return t.substr(1)},l=function(t){return"!"==t.charAt(0)},v=function(t,e){var r=f(t);return{isMatch:-1===e.indexOf(r),score:0}},d=function(t){return t.substr(1)},p=function(t){return"^"==t.charAt(0)},g=function(t,e){var r=d(t);return{isMatch:e.startsWith(r),score:0}},y=function(t){return t.substr(2)},m=function(t){return"!"==t.charAt(0)&&"^"==t.charAt(1)},k=function(t,e){var r=y(t);return{isMatch:!e.startsWith(r),score:0}},M=function(t){return t.substr(0,t.length-1)},b=function(t){return"$"==t.charAt(t.length-1)},x=function(t,e){var r=M(t);return{isMatch:e.endsWith(r),score:0}},_=function(t){return t.substring(1,t.length-1)},w=function(t){return"!"==t.charAt(0)&&"$"==t.charAt(t.length-1)},O=function(t,e){var r=_(t);return{isMatch:!e.endsWith(r),score:0}},S=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)},I=function(t){return"string"==typeof t},A=function(t){return"number"==typeof t},L=function(t){return null!=t},C=function(){function e(r,n){t(this,e);var i=n.isCaseSensitive;this.query=null,this.options=n,this._fuzzyCache={},I(r)&&r.trim().length>0&&(this.pattern=i?r:r.toLowerCase(),this.query=function(t){return t.split("|").map((function(t){return t.trim().split(/ +/g)}))}(this.pattern))}return r(e,[{key:"searchIn",value:function(t){var e=this.query;if(!this.query)return{isMatch:!1,score:1};var r=t.$;r=this.options.isCaseSensitive?r:r.toLowerCase();for(var n=!1,i=0,s=e.length;i1&&void 0!==arguments[1]?arguments[1]:{threshold:.6};t(this,e),this.options=n,this.patternNgram=j(r,{sort:!0})}return r(e,[{key:"searchIn",value:function(t){var e=t.ng;e||(e=j(t.$,{sort:!0}),t.ng=e);var r,n,i,s=(r=this.patternNgram,i=function(t,e){for(var r=[],n=0,i=0;no||(n+=1),i+=1)}return r}(r,n).length/i.length),o=s2&&void 0!==arguments[2]?arguments[2]:{},n=r.getFn,i=void 0===n?P:n,s=r.ngrams,o=void 0!==s&&s,a=[];if(I(e[0]))for(var h=0,c=e.length;h=1)throw new Error('"weight" property in key must be in the range of (0, 1)');this._keys[h]={weight:c},s+=c}for(var u=0;u-1&&(o.refIndex=s.idx),e.matches.push(o)}}}function z(t,e){e.score=t.score}var q=s({},{isCaseSensitive:!1,findAllMatches:!1,includeMatches:!1,includeScore:!1,keys:[],minMatchCharLength:1,shouldSort:!0,sortFn:function(t,e){return t.score-e.score}},{},{location:0,threshold:.6,distance:100},{},{useExtendedSearch:!1,getFn:P}),D=function(){function e(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:q,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t(this,e),this.options=s({},q,{},n),this.options.isCaseSensitive=n.caseSensitive,delete this.options.caseSensitive,this._processKeys(this.options.keys),this.setCollection(r,i)}return r(e,[{key:"setCollection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.list=t,this.listIsStringArray=I(t[0]),e?this.setIndex(e):this.setIndex(this._createIndex())}},{key:"setIndex",value:function(t){this._indexedList=t}},{key:"_processKeys",value:function(t){this._keyStore=new E(t)}},{key:"_createIndex",value:function(){return N(this._keyStore.keys(),this.list,{getFn:this.options.getFn})}},{key:"search",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{limit:!1},r=this.options,n=r.useExtendedSearch,i=r.shouldSort,s=null;s=n?new C(t,this.options):t.length>32?new $(t,this.options):new a(t,this.options);var o=this._searchUsing(s);return this._computeScore(o),i&&this._sort(o),e.limit&&A(e.limit)&&(o=o.slice(0,e.limit)),this._format(o)}},{key:"_searchUsing",value:function(t){var e=this._indexedList,r=[],n=this.options.includeMatches;if(this.listIsStringArray)for(var i=0,s=e.length;i-1?u:1,l=0===h.score&&u>-1?Number.EPSILON:h.score;o*=Math.pow(l,f)}n.score=o}}},{key:"_sort",value:function(t){t.sort(this.options.sortFn)}},{key:"_format",value:function(t){var e=[],r=this.options,n=r.includeMatches,i=r.includeScore,s=[];n&&s.push(F),i&&s.push(z);for(var o=0,a=t.length;o
© 2015 - 2025 Weber Informatics LLC | Privacy Policy