Socket
Socket
Sign inDemoInstall

fzf

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fzf - npm Package Compare versions

Comparing version 0.3.2 to 0.4.0-alpha.0

dist/extended.d.ts

2

dist/algo.d.ts

@@ -9,3 +9,3 @@ import { Slab } from "./slab";

export declare const SCORE_MATCH = 16, SCORE_GAP_START = -3, SCORE_GAP_EXTENTION = -1, BONUS_BOUNDARY: number, BONUS_NON_WORD: number, BONUS_CAMEL_123: number, BONUS_CONSECUTIVE: number, BONUS_FIRST_CHAR_MULTIPLIER = 2;
export declare type AlgoFn = (caseSensitive: boolean, normalize: boolean, forward: boolean, input: Rune[], pattern: Rune[], withPos: boolean, slab: Slab | null) => [Result, number[] | null];
export declare type AlgoFn = (caseSensitive: boolean, normalize: boolean, forward: boolean, input: Rune[], pattern: Rune[], withPos: boolean, slab: Slab | null) => [Result, Set<number> | null];
export declare const fuzzyMatchV2: AlgoFn;

@@ -12,0 +12,0 @@ export declare const fuzzyMatchV1: AlgoFn;

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

var t=Object.defineProperty,e=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,r=(e,o,n)=>o in e?t(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,i=(t,i)=>{for(var s in i||(i={}))o.call(i,s)&&r(t,s,i[s]);if(e)for(var s of e(i))n.call(i,s)&&r(t,s,i[s]);return t};const s={225:"a",259:"a",462:"a",226:"a",228:"a",551:"a",7841:"a",513:"a",224:"a",7843:"a",515:"a",257:"a",261:"a",7834:"a",229:"a",7681:"a",227:"a",867:"a",592:"a",7683:"b",7685:"b",595:"b",7687:"b",384:"b",387:"b",263:"c",269:"c",231:"c",265:"c",597:"c",267:"c",392:"c",572:"c",872:"c",663:"c",8580:"c",271:"d",7697:"d",7699:"d",545:"d",7691:"d",7693:"d",599:"d",7695:"d",273:"d",598:"d",396:"d",873:"d",233:"e",277:"e",283:"e",553:"e",7705:"e",234:"e",235:"e",279:"e",7865:"e",517:"e",232:"e",7867:"e",605:"e",519:"e",275:"e",281:"e",583:"e",7707:"e",7869:"e",868:"e",666:"e",606:"e",603:"e",600:"e",604:"e",477:"e",7432:"e",7711:"f",402:"f",501:"g",287:"g",487:"g",291:"g",285:"g",289:"g",608:"g",7713:"g",485:"g",609:"g",7723:"h",543:"h",7721:"h",293:"h",7719:"h",7715:"h",7717:"h",686:"h",614:"h",7830:"h",295:"h",874:"h",613:"h",8341:"h",237:"i",301:"i",464:"i",238:"i",239:"i",7883:"i",521:"i",236:"i",7881:"i",523:"i",299:"i",303:"i",616:"i",7725:"i",297:"i",869:"i",305:"i",7433:"i",7522:"i",8305:"i",496:"j",309:"j",669:"j",585:"j",607:"j",567:"j",7729:"k",489:"k",311:"k",7731:"k",409:"k",7733:"k",670:"k",8342:"k",314:"l",410:"l",620:"l",318:"l",316:"l",7741:"l",564:"l",7735:"l",7739:"l",320:"l",619:"l",621:"l",322:"l",8343:"l",7743:"m",7745:"m",7747:"m",625:"m",624:"m",875:"m",7455:"m",623:"m",8344:"m",324:"n",328:"n",326:"n",7755:"n",565:"n",7749:"n",7751:"n",505:"n",626:"n",7753:"n",414:"n",627:"n",241:"n",8345:"n",243:"o",335:"o",466:"o",244:"o",246:"o",559:"o",7885:"o",337:"o",525:"o",242:"o",7887:"o",417:"o",527:"o",333:"o",491:"o",248:"o",7443:"o",245:"o",870:"o",629:"o",7447:"o",596:"o",7441:"o",7442:"o",7446:"o",7765:"p",7767:"p",421:"p",8346:"p",587:"q",672:"q",341:"r",345:"r",343:"r",7769:"r",7771:"r",529:"r",638:"r",639:"r",635:"r",531:"r",7775:"r",636:"r",634:"r",589:"r",637:"r",876:"r",633:"r",7523:"r",347:"s",353:"s",351:"s",349:"s",537:"s",7777:"s",7835:"s",7779:"s",642:"s",575:"s",383:"s",223:"s",8347:"s",357:"t",355:"t",7793:"t",539:"t",566:"t",7831:"t",7787:"t",7789:"t",429:"t",7791:"t",427:"t",648:"t",359:"t",877:"t",647:"t",8348:"t",649:"u",250:"u",365:"u",468:"u",7799:"u",251:"u",7795:"u",252:"u",7909:"u",369:"u",533:"u",249:"u",7911:"u",432:"u",535:"u",363:"u",371:"u",367:"u",7797:"u",361:"u",871:"u",7453:"u",7454:"u",7524:"u",7807:"v",651:"v",7805:"v",878:"v",652:"v",7525:"v",7811:"w",373:"w",7813:"w",7815:"w",7817:"w",7809:"w",7832:"w",653:"w",7821:"x",7819:"x",879:"x",253:"y",375:"y",255:"y",7823:"y",7925:"y",7923:"y",7927:"y",436:"y",563:"y",7833:"y",591:"y",7929:"y",654:"y",378:"z",382:"z",7825:"z",657:"z",380:"z",7827:"z",549:"z",7829:"z",656:"z",438:"z",576:"z",593:"a",193:"A",194:"A",196:"A",192:"A",197:"A",570:"A",195:"A",7424:"A",385:"B",579:"B",665:"B",7427:"B",199:"C",571:"C",7428:"C",394:"D",393:"D",7429:"D",201:"E",202:"E",203:"E",200:"E",582:"E",400:"E",398:"E",7431:"E",403:"G",667:"G",610:"G",668:"H",205:"I",206:"I",207:"I",304:"I",204:"I",407:"I",618:"I",584:"J",7434:"J",7435:"K",573:"L",7436:"L",671:"L",412:"M",7437:"M",413:"N",544:"N",209:"N",628:"N",7438:"N",211:"O",212:"O",214:"O",210:"O",415:"O",216:"O",213:"O",390:"O",7439:"O",7440:"O",7448:"P",586:"Q",588:"R",640:"R",641:"R",7449:"R",7450:"R",574:"T",430:"T",7451:"T",580:"U",218:"U",219:"U",220:"U",217:"U",7452:"U",434:"V",581:"V",7456:"V",7457:"W",221:"Y",376:"Y",590:"Y",655:"Y",7458:"Z",["Ắ".codePointAt(0)]:"A",["Ấ".codePointAt(0)]:"A",["Ằ".codePointAt(0)]:"A",["Ầ".codePointAt(0)]:"A",["Ẳ".codePointAt(0)]:"A",["Ẩ".codePointAt(0)]:"A",["Ẵ".codePointAt(0)]:"A",["Ẫ".codePointAt(0)]:"A",["Ặ".codePointAt(0)]:"A",["Ậ".codePointAt(0)]:"A",["ắ".codePointAt(0)]:"a",["ấ".codePointAt(0)]:"a",["ằ".codePointAt(0)]:"a",["ầ".codePointAt(0)]:"a",["ẳ".codePointAt(0)]:"a",["ẩ".codePointAt(0)]:"a",["ẵ".codePointAt(0)]:"a",["ẫ".codePointAt(0)]:"a",["ặ".codePointAt(0)]:"a",["ậ".codePointAt(0)]:"a",["Ế".codePointAt(0)]:"E",["Ề".codePointAt(0)]:"E",["Ể".codePointAt(0)]:"E",["Ễ".codePointAt(0)]:"E",["Ệ".codePointAt(0)]:"E",["ế".codePointAt(0)]:"e",["ề".codePointAt(0)]:"e",["ể".codePointAt(0)]:"e",["ễ".codePointAt(0)]:"e",["ệ".codePointAt(0)]:"e",["Ố".codePointAt(0)]:"O",["Ớ".codePointAt(0)]:"O",["Ồ".codePointAt(0)]:"O",["Ờ".codePointAt(0)]:"O",["Ổ".codePointAt(0)]:"O",["Ở".codePointAt(0)]:"O",["Ỗ".codePointAt(0)]:"O",["Ỡ".codePointAt(0)]:"O",["Ộ".codePointAt(0)]:"O",["Ợ".codePointAt(0)]:"O",["ố".codePointAt(0)]:"o",["ớ".codePointAt(0)]:"o",["ồ".codePointAt(0)]:"o",["ờ".codePointAt(0)]:"o",["ổ".codePointAt(0)]:"o",["ở".codePointAt(0)]:"o",["ỗ".codePointAt(0)]:"o",["ỡ".codePointAt(0)]:"o",["ộ".codePointAt(0)]:"o",["ợ".codePointAt(0)]:"o",["Ứ".codePointAt(0)]:"U",["Ừ".codePointAt(0)]:"U",["Ử".codePointAt(0)]:"U",["Ữ".codePointAt(0)]:"U",["Ự".codePointAt(0)]:"U",["ứ".codePointAt(0)]:"u",["ừ".codePointAt(0)]:"u",["ử".codePointAt(0)]:"u",["ữ".codePointAt(0)]:"u",["ự".codePointAt(0)]:"u"};function c(t,e){return t>e?t:e}const a=t=>t.split("").map((t=>t.codePointAt(0))),u=" \f\n\r\t\v  \u2028\u2029   \ufeff".split("").map((t=>t.codePointAt(0)));for(let B=" ".codePointAt(0);B<=" ".codePointAt(0);B++)u.push(B);Object.freeze(u);const l="".codePointAt(0),d="A".codePointAt(0),A="Z".codePointAt(0),f="a".codePointAt(0),P="z".codePointAt(0),h="0".codePointAt(0),b="9".codePointAt(0);function y(t,e,o){return o?t:e-t-1}var g,m;function p(t,e){if(t){return new Array}return null}function O(t,e,o){if(null!==e&&e.i16.length>t+o){return[t+o,e.i16.subarray(t,t+o)]}return[t,new Int16Array(o)]}function w(t,e,o){if(null!==e&&e.i32.length>t+o){return[t+o,e.i32.subarray(t,t+o)]}return[t,new Int32Array(o)]}function v(t){return t>=f&&t<=P?1:t>=d&&t<=A?2:t>=h&&t<=b?4:0}function L(t){const e=String.fromCodePoint(t);return e!==e.toUpperCase()?1:e!==e.toLowerCase()?2:null!==e.match(/\p{Number}/gu)?4:null!==e.match(/\p{Letter}/gu)?3:0}function C(t){return t<=l?v(t):L(t)}function z(t,e){return 0===t&&0!==e?8:1===t&&2===e||4!==t&&4===e?7:0===e?8:0}function I(t){if(t<192||t>8580)return t;const e=s[t];return void 0!==e?e.codePointAt(0):t}function k(t,e,o,n){let r=t.slice(n),i=r.indexOf(o);if(0===i)return n;if(!e&&o>=f&&o<=P){i>0&&(r=r.slice(0,i));const t=r.indexOf(o-32);t>=0&&(i=t)}return i<0?-1:n+i}function E(t){for(const e of t)if(e>=128)return!1;return!0}function U(t,e,o){if(!E(t))return 0;if(!E(e))return-1;let n=0,r=0;for(let i=0;i<e.length;i++){if(r=k(t,o,e[i],r),r<0)return-1;0===i&&r>0&&(n=r-1),r++}return n}(m=g||(g={}))[m.NonWord=0]="NonWord",m[m.Lower=1]="Lower",m[m.Upper=2]="Upper",m[m.Letter=3]="Letter",m[m.Number=4]="Number";const j=(t,e,o,n,r,i,s)=>{if(0===r.length)return[{start:0,end:0,score:0},null];if(U(n,r,t)<0)return[{start:-1,end:-1,score:0},null];let a=0,u=-1,f=-1;const P=n.length,h=r.length;for(let c=0;c<P;c++){let i=n[y(c,P,o)];t||(i>=d&&i<=A?i+=32:i>l&&(i=String.fromCodePoint(i).toLowerCase().codePointAt(0))),e&&(i=I(i));if(i===r[y(a,h,o)]&&(u<0&&(u=c),a++,a===h)){f=c+1;break}}if(u>=0&&f>=0){a--;for(let e=f-1;e>=u;e--){let i=n[y(e,P,o)];t||(i>=d&&i<=A?i+=32:i>l&&(i=String.fromCodePoint(i).toLowerCase().codePointAt(0)));if(i===r[y(a,h,o)]&&(a--,a<0)){u=e;break}}if(!o){const t=u;u=P-f,f=P-t}const[s,b]=function(t,e,o,n,r,i,s){let a=0,u=0,f=!1,P=0,h=0;const b=p(s,n.length);let y=0;r>0&&(y=C(o[r-1]));for(let g=r;g<i;g++){let r=o[g];const i=C(r);if(t||(r>=d&&r<=A?r+=32:r>l&&(r=String.fromCodePoint(r).toLowerCase().codePointAt(0))),e&&(r=I(r)),r===n[a]){s&&(null==b||b.push(g)),u+=16;let t=z(y,i);0===P?h=t:(8===t&&(h=t),t=c(c(t,h),4)),u+=0===a?2*t:t,f=!1,P++,a++}else u+=f?-1:-3,f=!0,P=0,h=0;y=i}return[u,b]}(t,e,n,r,u,f,i);return[{start:u,end:f,score:s},b]}return[{start:-1,end:-1,score:0},null]};const N=(x=2048,{i16:new Int16Array(102400),i32:new Int32Array(x)});var x;const R={cache:!1,maxResultItems:1/0,selector:t=>t,casing:"smart-case",normalize:!1,sort:!0};class S{constructor(t,...e){this.cache={},this.find=t=>{let e=!1;switch(this.opts.casing){case"smart-case":t.toLowerCase()!==t&&(e=!0);break;case"case-sensitive":e=!0;break;case"case-insensitive":t=t.toLowerCase(),e=!1}if(this.opts.cache){const e=this.cache[t];if(void 0!==e)return e}const o=a(t);let n=this.runesList.map(((t,n)=>{const r=((t,e,o,n,r,i,s)=>{const a=r.length;if(0===a)return[{start:0,end:0,score:0},p(i)];const u=n.length;if(null!==s&&u*a>s.i16.length)return j(t,e,o,n,r,i);const d=U(n,r,t);if(d<0)return[{start:-1,end:-1,score:0},null];let A=0,f=0,P=null,h=null,b=null,y=null;[A,P]=O(A,s,u),[A,h]=O(A,s,u),[A,b]=O(A,s,u),[f,y]=w(f,s,a);const[,g]=w(f,s,u);for(let c=0;c<g.length;c++)g[c]=n[c];let m=0,C=0,k=0,E=0;const N=r[0];let x=r[0],R=0,S=0,B=!1,Y=g.subarray(d),D=P.subarray(d).subarray(0,Y.length),G=h.subarray(d).subarray(0,Y.length),M=b.subarray(d).subarray(0,Y.length);for(let[p,O]of Y.entries()){let n=null;O<=l?(n=v(O),t||2!==n||(O+=32)):(n=L(O),t||2!==n||(O=String.fromCodePoint(O).toLowerCase().codePointAt(0)),e&&(O=I(O))),Y[p]=O;const i=z(S,n);if(M[p]=i,S=n,O===x&&(k<a&&(y[k]=d+p,k++,x=r[Math.min(k,a-1)]),E=d+p),O===N){const t=16+2*i;if(D[p]=t,G[p]=1,1===a&&(o&&t>m||!o&&t>=m)&&(m=t,C=d+p,o&&8===i))break;B=!1}else D[p]=c(B?R+-1:R+-3,0),G[p]=0,B=!0;R=D[p]}if(k!==a)return[{start:-1,end:-1,score:0},null];if(1===a){const t={start:C,end:C+1,score:m};return i?[t,[C]]:[t,null]}const T=y[0],V=E-T+1;let W=null;[A,W]=O(A,s,V*a);{const t=P.subarray(T,E+1);for(const[e,o]of t.entries())W[e]=o}let[,q]=O(A,s,V*a);{const t=h.subarray(T,E+1);for(const[e,o]of t.entries())q[e]=o}const J=y.subarray(1),Z=r.slice(1).slice(0,J.length);for(const[l,p]of J.entries()){let t=!1;const e=Z[l],n=l+1,r=n*V,i=g.subarray(p,E+1),s=b.subarray(p).subarray(0,i.length),u=q.subarray(r+p-T).subarray(0,i.length),d=q.subarray(r+p-T-1-V).subarray(0,i.length),A=W.subarray(r+p-T).subarray(0,i.length),f=W.subarray(r+p-T-1-V).subarray(0,i.length),P=W.subarray(r+p-T-1).subarray(0,i.length);P[0]=0;for(const[l,h]of i.entries()){const r=l+p;let i=0,y=0,g=0;if(y=t?P[l]+-1:P[l]+-3,e===h){i=f[l]+16;let t=s[l];g=d[l]+1,8===t?g=1:g>1&&(t=c(t,c(4,b[r-g+1]))),i+t<y?(i+=s[l],g=0):i+=t}u[l]=g,t=i<y;const O=c(c(i,y),0);n===a-1&&(o&&O>m||!o&&O>=m)&&(m=O,C=r),A[l]=O}}const F=p(i);let H=T;if(i){let t=a-1;H=C;let e=!0;for(;;){const o=t*V,n=H-T,r=W[o+n];let i=0,s=0;if(t>0&&H>=y[t]&&(i=W[o-V+n-1]),H>y[t]&&(s=W[o+n-1]),r>i&&(r>s||r===s&&e)){if(F.push(H),0===t)break;t--}e=q[o+n]>1||o+V+n+1<q.length&&q[o+V+n+1]>0,H--}}return[{start:H,end:C+1,score:m},F]})(e,this.opts.normalize,!1,t,o,!0,N);return{item:this.items[n],result:r[0],positions:r[1]}})).filter((t=>0!==t.result.score));if(this.opts.sort){const t=(t,e)=>e.result.score-t.result.score;n.sort(t)}return Number.isFinite(this.opts.maxResultItems)&&(n=n.slice(0,this.opts.maxResultItems)),this.opts.cache&&(this.cache[t]=n),n},this.opts=i(i({},R),e[0]),this.items=t,this.runesList=t.map((t=>a(this.opts.selector(t))))}}export{S as Fzf};
const t={216:"O",223:"s",248:"o",273:"d",295:"h",305:"i",320:"l",322:"l",359:"t",383:"s",384:"b",385:"B",387:"b",390:"O",392:"c",393:"D",394:"D",396:"d",398:"E",400:"E",402:"f",403:"G",407:"I",409:"k",410:"l",412:"M",413:"N",414:"n",415:"O",421:"p",427:"t",429:"t",430:"T",434:"V",436:"y",438:"z",477:"e",485:"g",544:"N",545:"d",549:"z",564:"l",565:"n",566:"t",567:"j",570:"A",571:"C",572:"c",573:"L",574:"T",575:"s",576:"z",579:"B",580:"U",581:"V",582:"E",583:"e",584:"J",585:"j",586:"Q",587:"q",588:"R",589:"r",590:"Y",591:"y",592:"a",593:"a",595:"b",596:"o",597:"c",598:"d",599:"d",600:"e",603:"e",604:"e",605:"e",606:"e",607:"j",608:"g",609:"g",610:"G",613:"h",614:"h",616:"i",618:"I",619:"l",620:"l",621:"l",623:"m",624:"m",625:"m",626:"n",627:"n",628:"N",629:"o",633:"r",634:"r",635:"r",636:"r",637:"r",638:"r",639:"r",640:"R",641:"R",642:"s",647:"t",648:"t",649:"u",651:"v",652:"v",653:"w",654:"y",655:"Y",656:"z",657:"z",663:"c",665:"B",666:"e",667:"G",668:"H",669:"j",670:"k",671:"L",672:"q",686:"h",867:"a",868:"e",869:"i",870:"o",871:"u",872:"c",873:"d",874:"h",875:"m",876:"r",877:"t",878:"v",879:"x",7424:"A",7427:"B",7428:"C",7429:"D",7431:"E",7432:"e",7433:"i",7434:"J",7435:"K",7436:"L",7437:"M",7438:"N",7439:"O",7440:"O",7441:"o",7442:"o",7443:"o",7446:"o",7447:"o",7448:"P",7449:"R",7450:"R",7451:"T",7452:"U",7453:"u",7454:"u",7455:"m",7456:"V",7457:"W",7458:"Z",7522:"i",7523:"r",7524:"u",7525:"v",7834:"a",7835:"s",8305:"i",8341:"h",8342:"k",8343:"l",8344:"m",8345:"n",8346:"p",8347:"s",8348:"t",8580:"c"};for(let Q="̀".codePointAt(0);Q<="ͯ".codePointAt(0);++Q){const e=String.fromCodePoint(Q);for(const n of"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"){const r=(n+e).normalize().codePointAt(0);r>126&&(t[r]=n)}}const e={a:[7844,7863],e:[7870,7879],o:[7888,7907],u:[7912,7921]};for(const Q of Object.keys(e)){const n=Q.toUpperCase();for(let r=e[Q][0];r<=e[Q][1];++r)t[r]=r%2==0?n:Q}function n(e){if(e<192||e>8580)return e;const n=t[e];return void 0!==n?n.codePointAt(0):e}function r(t,e){return t>e?t:e}const o=t=>t.split("").map((t=>t.codePointAt(0))),s=t=>t.map((t=>String.fromCodePoint(t))).join(""),i=new Set(" \f\n\r\t\v  \u2028\u2029   \ufeff".split("").map((t=>t.codePointAt(0))));for(let Q=" ".codePointAt(0);Q<=" ".codePointAt(0);Q++)i.add(Q);const l=t=>i.has(t),c=t=>{let e=0;for(const n of t){if(!l(n))break;e++}return e},a=t=>{let e=0;for(let n=t.length-1;n>=0&&l(t[n]);n--)e++;return e},u="".codePointAt(0),f="A".codePointAt(0),h="Z".codePointAt(0),d="a".codePointAt(0),g="z".codePointAt(0),p="0".codePointAt(0),m="9".codePointAt(0);function b(t,e,n){return n?t:e-t-1}var y,P;function w(t){return t?new Set:null}function z(t,e,n){if(null!==e&&e.i16.length>t+n){return[t+n,e.i16.subarray(t,t+n)]}return[t,new Int16Array(n)]}function A(t,e,n){if(null!==e&&e.i32.length>t+n){return[t+n,e.i32.subarray(t,t+n)]}return[t,new Int32Array(n)]}function L(t){return t>=d&&t<=g?1:t>=f&&t<=h?2:t>=p&&t<=m?4:0}function S(t){const e=String.fromCodePoint(t);return e!==e.toUpperCase()?1:e!==e.toLowerCase()?2:null!==e.match(/\p{Number}/gu)?4:null!==e.match(/\p{Letter}/gu)?3:0}function C(t){return t<=u?L(t):S(t)}function v(t,e){return 0===t&&0!==e?8:1===t&&2===e||4!==t&&4===e?7:0===e?8:0}function k(t,e,n,r){let o=t.slice(r),s=o.indexOf(n);if(0===s)return r;if(!e&&n>=d&&n<=g){s>0&&(o=o.slice(0,s));const t=o.indexOf(n-32);t>=0&&(s=t)}return s<0?-1:r+s}function x(t){for(const e of t)if(e>=128)return!1;return!0}function E(t,e,n){if(!x(t))return 0;if(!x(e))return-1;let r=0,o=0;for(let s=0;s<e.length;s++){if(o=k(t,n,e[s],o),o<0)return-1;0===s&&o>0&&(r=o-1),o++}return r}(P=y||(y={}))[P.NonWord=0]="NonWord",P[P.Lower=1]="Lower",P[P.Upper=2]="Upper",P[P.Letter=3]="Letter",P[P.Number=4]="Number";const N=(t,e,o,s,i,l,c)=>{const a=i.length;if(0===a)return[{start:0,end:0,score:0},w(l)];const f=s.length;if(null!==c&&f*a>c.i16.length)return O(t,e,o,s,i,l);const h=E(s,i,t);if(h<0)return[{start:-1,end:-1,score:0},null];let d=0,g=0,p=null,m=null,b=null,y=null;[d,p]=z(d,c,f),[d,m]=z(d,c,f),[d,b]=z(d,c,f),[g,y]=A(g,c,a);const[,P]=A(g,c,f);for(let n=0;n<P.length;n++)P[n]=s[n];let C=0,k=0,x=0,N=0;const F=i[0];let R=i[0],W=0,j=0,I=!1,q=P.subarray(h),U=p.subarray(h).subarray(0,q.length),B=m.subarray(h).subarray(0,q.length),M=b.subarray(h).subarray(0,q.length);for(let[w,z]of q.entries()){let s=null;z<=u?(s=L(z),t||2!==s||(z+=32)):(s=S(z),t||2!==s||(z=String.fromCodePoint(z).toLowerCase().codePointAt(0)),e&&(z=n(z))),q[w]=z;const l=v(j,s);if(M[w]=l,j=s,z===R&&(x<a&&(y[x]=h+w,x++,R=i[Math.min(x,a-1)]),N=h+w),z===F){const t=16+2*l;if(U[w]=t,B[w]=1,1===a&&(o&&t>C||!o&&t>=C)&&(C=t,k=h+w,o&&8===l))break;I=!1}else U[w]=r(I?W+-1:W+-3,0),B[w]=0,I=!0;W=U[w]}if(x!==a)return[{start:-1,end:-1,score:0},null];if(1===a){const t={start:k,end:k+1,score:C};if(!l)return[t,null];const e=new Set;return e.add(k),[t,e]}const D=y[0],G=N-D+1;let T=null;[d,T]=z(d,c,G*a);{const t=p.subarray(D,N+1);for(const[e,n]of t.entries())T[e]=n}let[,V]=z(d,c,G*a);{const t=m.subarray(D,N+1);for(const[e,n]of t.entries())V[e]=n}const J=y.subarray(1),Y=i.slice(1).slice(0,J.length);for(const[n,u]of J.entries()){let t=!1;const e=Y[n],s=n+1,i=s*G,l=P.subarray(u,N+1),c=b.subarray(u).subarray(0,l.length),f=V.subarray(i+u-D).subarray(0,l.length),h=V.subarray(i+u-D-1-G).subarray(0,l.length),d=T.subarray(i+u-D).subarray(0,l.length),g=T.subarray(i+u-D-1-G).subarray(0,l.length),p=T.subarray(i+u-D-1).subarray(0,l.length);p[0]=0;for(const[n,m]of l.entries()){const i=n+u;let l=0,y=0,P=0;if(y=t?p[n]+-1:p[n]+-3,e===m){l=g[n]+16;let t=c[n];P=h[n]+1,8===t?P=1:P>1&&(t=r(t,r(4,b[i-P+1]))),l+t<y?(l+=c[n],P=0):l+=t}f[n]=P,t=l<y;const w=r(r(l,y),0);s===a-1&&(o&&w>C||!o&&w>=C)&&(C=w,k=i),d[n]=w}}const Z=w(l);let H=D;if(l&&null!==Z){let t=a-1;H=k;let e=!0;for(;;){const n=t*G,r=H-D,o=T[n+r];let s=0,i=0;if(t>0&&H>=y[t]&&(s=T[n-G+r-1]),H>y[t]&&(i=T[n+r-1]),o>s&&(o>i||o===i&&e)){if(Z.add(H),0===t)break;t--}e=V[n+r]>1||n+G+r+1<V.length&&V[n+G+r+1]>0,H--}}return[{start:H,end:k+1,score:C},Z]};function F(t,e,o,s,i,l,c){let a=0,d=0,g=!1,p=0,m=0;const b=w(c);let y=0;i>0&&(y=C(o[i-1]));for(let P=i;P<l;P++){let i=o[P];const l=C(i);if(t||(i>=f&&i<=h?i+=32:i>u&&(i=String.fromCodePoint(i).toLowerCase().codePointAt(0))),e&&(i=n(i)),i===s[a]){c&&null!==b&&b.add(P),d+=16;let t=v(y,l);0===p?m=t:(8===t&&(m=t),t=r(r(t,m),4)),d+=0===a?2*t:t,g=!1,p++,a++}else d+=g?-1:-3,g=!0,p=0,m=0;y=l}return[d,b]}const O=(t,e,r,o,s,i,l)=>{if(0===s.length)return[{start:0,end:0,score:0},null];if(E(o,s,t)<0)return[{start:-1,end:-1,score:0},null];let c=0,a=-1,d=-1;const g=o.length,p=s.length;for(let m=0;m<g;m++){let i=o[b(m,g,r)];t||(i>=f&&i<=h?i+=32:i>u&&(i=String.fromCodePoint(i).toLowerCase().codePointAt(0))),e&&(i=n(i));if(i===s[b(c,p,r)]&&(a<0&&(a=m),c++,c===p)){d=m+1;break}}if(a>=0&&d>=0){c--;for(let e=d-1;e>=a;e--){let n=o[b(e,g,r)];t||(n>=f&&n<=h?n+=32:n>u&&(n=String.fromCodePoint(n).toLowerCase().codePointAt(0)));if(n===s[b(c,p,r)]&&(c--,c<0)){a=e;break}}if(!r){const t=a;a=g-d,d=g-t}const[n,l]=F(t,e,o,s,a,d,i);return[{start:a,end:d,score:n},l]}return[{start:-1,end:-1,score:0},null]},R=(t,e,r,o,s,i,l)=>{if(0===s.length)return[{start:0,end:0,score:0},null];const c=o.length,a=s.length;if(c<a)return[{start:-1,end:-1,score:0},null];if(E(o,s,t)<0)return[{start:-1,end:-1,score:0},null];let d=0,g=-1,p=0,m=-1;for(let w=0;w<c;w++){const i=b(w,c,r);let l=o[i];t||(l>=f&&l<=h?l+=32:l>u&&(l=String.fromCodePoint(l).toLowerCase().codePointAt(0))),e&&(l=n(l));const z=b(d,a,r);if(s[z]===l){if(0===z&&(y=o,p=0===(P=i)?8:v(C(y[P-1]),C(y[P]))),d++,d===a){if(p>m&&(g=w,m=p),8===p)break;w-=d-1,d=0,p=0}}else w-=d,d=0,p=0}var y,P;if(g>=0){let n=0,i=0;r?(n=g-a+1,i=g+1):(n=c-(g+1),i=c-(g-a+1));const[l]=F(t,e,o,s,n,i,!1);return[{start:n,end:i,score:l},null]}return[{start:-1,end:-1,score:0},null]};const W=(j=2048,{i16:new Int16Array(102400),i32:new Int32Array(j)});var j,I,q;(q=I||(I={}))[q.Fuzzy=0]="Fuzzy",q[q.Exact=1]="Exact",q[q.Prefix=2]="Prefix",q[q.Suffix=3]="Suffix",q[q.Equal=4]="Equal";const U={0:N,1:R,2:(t,e,r,o,s,i,a)=>{if(0===s.length)return[{start:0,end:0,score:0},null];let u=0;if(l(s[0])||(u=c(o)),o.length-u<s.length)return[{start:-1,end:-1,score:0},null];for(const[l,c]of s.entries()){let r=o[u+l];if(t||(r=String.fromCodePoint(r).toLowerCase().codePointAt(0)),e&&(r=n(r)),r!==c)return[{start:-1,end:-1,score:0},null]}const f=s.length,[h]=F(t,e,o,s,u,u+f,!1);return[{start:u,end:u+f,score:h},null]},3:(t,e,r,o,s,i,c)=>{let u=o.length;if(0!==s.length&&l(s[s.length-1])||(u-=a(o)),0===s.length)return[{start:u,end:u,score:0},null];const f=u-s.length;if(f<0)return[{start:-1,end:-1,score:0},null];for(const[l,a]of s.entries()){let r=o[l+f];if(t||(r=String.fromCodePoint(r).toLowerCase().codePointAt(0)),e&&(r=n(r)),r!==a)return[{start:-1,end:-1,score:0},null]}const h=u-s.length,d=u,[g]=F(t,e,o,s,h,d,!1);return[{start:h,end:d,score:g},null]},4:(t,e,r,o,i,u,f)=>{const h=i.length;if(0===h)return[{start:-1,end:-1,score:0},null];let d=0;l(i[0])||(d=c(o));let g=0;if(l(i[h-1])||(g=a(o)),o.length-d-g!=h)return[{start:-1,end:-1,score:0},null];let p=!0;if(e){const e=o;for(const[r,o]of i.entries()){let s=e[d+r];if(t||(s=String.fromCodePoint(s).toLowerCase().codePointAt(0)),n(o)!==n(s)){p=!1;break}}}else{let e=s(o).substring(d,o.length-g);t||(e=e.toLowerCase()),p=e===s(i)}return p?[{start:d,end:d+h,score:24*h+8},null]:[{start:-1,end:-1,score:0},null]}};function B(t,e,r,i){let l=!0;{const t=(i=i.trimLeft()).trimRight();i=t.endsWith("\\")&&" "===i[t.length]?t+" ":t}let c=!1,a=[];a=function(t,e,r,i){const l=(i=i.replaceAll("\\ ","\t")).split(/ +/),c=[];let a=[],u=!1,f=!1;for(const h of l){let i=0,l=!1,d=h.replaceAll("\t"," ");const g=d.toLowerCase(),p="case-sensitive"===e||"smart-case"===e&&d!==g,m=r&&g===s(o(g).map(n));if(p||(d=g),t||(i=1),a.length>0&&!f&&"|"===d)u=!1,f=!0;else if(f=!1,d.startsWith("!")&&(l=!0,i=1,d=d.substring(1)),"$"!==d&&d.endsWith("$")&&(i=3,d=d.substring(0,d.length-1)),d.startsWith("'")?(i=t&&!l?1:0,d=d.substring(1)):d.startsWith("^")&&(i=3===i?4:2,d=d.substring(1)),d.length>0){u&&(c.push(a),a=[]);let t=o(d);m&&(t=t.map(n)),a.push({typ:i,inv:l,text:t,caseSensitive:p,normalize:m}),u=!0}}a.length>0&&c.push(a);return c}(t,e,r,i);t:for(const n of a)for(const[e,r]of n.entries())if(r.inv||(c=!0),(!l||e>0||r.inv||t&&0!==r.typ||!t&&1!==r.typ)&&(l=!1,c))break t;return{str:i,termSets:a,sortable:c,cacheable:l,fuzzy:t}}function M(t,e,n,r,o,s,i){for(const l of e){const[e,c]=t(n,r,o,l.text,s,!0,i);if(e.start>=0){const t=e.start+l.prefixLength,n=e.end+l.prefixLength;if(null!==c){const r=new Set;return c.forEach((t=>r.add(l.prefixLength+t))),[[t,n],e.score,r]}return[[t,n],e.score,c]}}return[[-1,-1],0,null]}function D(t,e,n,r){const o=[{text:t,prefixLength:0}],s=[];let i=0;const l=new Set;for(const c of e.termSets){let t=[0,0],e=0,a=!1;for(const s of c){let i=U[s.typ];s.typ===I.Fuzzy&&(i=n);const[c,u,f]=M(i,o,s.caseSensitive,s.normalize,r,s.text,W);if(c[0]>=0){if(s.inv)continue;if(t=c,e=u,a=!0,null!==f)f.forEach((t=>l.add(t)));else for(let t=c[0];t<c[1];++t)l.add(t);break}s.inv&&(t=[0,0],e=0,a=!0)}a&&(s.push(t),i+=e)}return{offsets:s,totalScore:i,allPos:l}}function G(t){const{queryRunes:e,caseSensitive:r}=((t,e,r)=>{let s=!1;switch(e){case"smart-case":t.toLowerCase()!==t&&(s=!0);break;case"case-sensitive":s=!0;break;case"case-insensitive":t=t.toLowerCase(),s=!1}let i=o(t);return r&&(i=i.map(n)),{queryRunes:i,caseSensitive:s}})(t,this.opts.casing,this.opts.normalize),s={};for(let n=0,o=this.runesList.length;n<o;++n){const t=this.runesList[n];if(e.length>t.length)continue;let[o,i]=this.algoFn(r,this.opts.normalize,this.opts.forward,t,e,!0,W);if(-1===o.start)continue;if(!1===this.opts.fuzzy){i=new Set;for(let t=o.start;t<o.end;++t)i.add(t)}const l=this.opts.sort?o.score:0;void 0===s[l]&&(s[l]=[]),s[l].push({item:this.items[n],...o,positions:null!=i?i:new Set})}return V(s,this.opts.limit)}function T(t){const e=B(Boolean(this.opts.fuzzy),this.opts.casing,this.opts.normalize,t),n={};for(const[r,o]of this.runesList.entries()){const t=D(o,e,this.algoFn,this.opts.forward);if(t.offsets.length!==e.termSets.length)continue;let s=-1,i=-1;t.allPos.size>0&&(s=Math.min(...t.allPos),i=Math.max(...t.allPos)+1);const l=this.opts.sort?t.totalScore:0;void 0===n[l]&&(n[l]=[]),n[l].push({score:t.totalScore,item:this.items[r],positions:t.allPos,start:s,end:i})}return V(n,this.opts.limit)}function V(t,e){const n=Object.keys(t).map((t=>parseInt(t,10))).sort(((t,e)=>e-t)),r=[];for(const o of n)if(r.push(...t[o]),r.length>=e)break;return r}const J={limit:1/0,selector:t=>t,casing:"smart-case",normalize:!0,fuzzy:"v2",match:G,tiebreakers:[],sort:!0,forward:!0};class Y{constructor(t,...e){switch(this.opts={...J,...e[0]},this.items=t,this.runesList=t.map((t=>o(this.opts.selector(t).normalize()))),this.algoFn=R,this.opts.fuzzy){case"v2":this.algoFn=N;break;case"v1":this.algoFn=O}}find(t){t=t.normalize();let e=[];if(e=this.opts.match.bind(this)(t),this.opts.sort)for(const n of this.opts.tiebreakers)e.sort(((t,e)=>t.score===e.score?n(t,e,this.opts):0));return Number.isFinite(this.opts.limit)&&e.splice(this.opts.limit),e}}function Z(t,e,n){return n.selector(t.item).length-n.selector(e.item).length}function H(t,e){return t.start-e.start}class K{constructor(t,...e){this.finder=new Y(t,...e),this.find=this.finder.find.bind(this.finder)}}export{K as Fzf,G as basicMatch,Z as byLengthAsc,H as byStartAsc,T as extendedMatch};

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

var __defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,e,o)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,__spreadValues=(t,e)=>{for(var o in e||(e={}))__hasOwnProp.call(e,o)&&__defNormalProp(t,o,e[o]);if(__getOwnPropSymbols)for(var o of __getOwnPropSymbols(e))__propIsEnum.call(e,o)&&__defNormalProp(t,o,e[o]);return t};!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).fzf={})}(this,(function(t){"use strict";const e={225:"a",259:"a",462:"a",226:"a",228:"a",551:"a",7841:"a",513:"a",224:"a",7843:"a",515:"a",257:"a",261:"a",7834:"a",229:"a",7681:"a",227:"a",867:"a",592:"a",7683:"b",7685:"b",595:"b",7687:"b",384:"b",387:"b",263:"c",269:"c",231:"c",265:"c",597:"c",267:"c",392:"c",572:"c",872:"c",663:"c",8580:"c",271:"d",7697:"d",7699:"d",545:"d",7691:"d",7693:"d",599:"d",7695:"d",273:"d",598:"d",396:"d",873:"d",233:"e",277:"e",283:"e",553:"e",7705:"e",234:"e",235:"e",279:"e",7865:"e",517:"e",232:"e",7867:"e",605:"e",519:"e",275:"e",281:"e",583:"e",7707:"e",7869:"e",868:"e",666:"e",606:"e",603:"e",600:"e",604:"e",477:"e",7432:"e",7711:"f",402:"f",501:"g",287:"g",487:"g",291:"g",285:"g",289:"g",608:"g",7713:"g",485:"g",609:"g",7723:"h",543:"h",7721:"h",293:"h",7719:"h",7715:"h",7717:"h",686:"h",614:"h",7830:"h",295:"h",874:"h",613:"h",8341:"h",237:"i",301:"i",464:"i",238:"i",239:"i",7883:"i",521:"i",236:"i",7881:"i",523:"i",299:"i",303:"i",616:"i",7725:"i",297:"i",869:"i",305:"i",7433:"i",7522:"i",8305:"i",496:"j",309:"j",669:"j",585:"j",607:"j",567:"j",7729:"k",489:"k",311:"k",7731:"k",409:"k",7733:"k",670:"k",8342:"k",314:"l",410:"l",620:"l",318:"l",316:"l",7741:"l",564:"l",7735:"l",7739:"l",320:"l",619:"l",621:"l",322:"l",8343:"l",7743:"m",7745:"m",7747:"m",625:"m",624:"m",875:"m",7455:"m",623:"m",8344:"m",324:"n",328:"n",326:"n",7755:"n",565:"n",7749:"n",7751:"n",505:"n",626:"n",7753:"n",414:"n",627:"n",241:"n",8345:"n",243:"o",335:"o",466:"o",244:"o",246:"o",559:"o",7885:"o",337:"o",525:"o",242:"o",7887:"o",417:"o",527:"o",333:"o",491:"o",248:"o",7443:"o",245:"o",870:"o",629:"o",7447:"o",596:"o",7441:"o",7442:"o",7446:"o",7765:"p",7767:"p",421:"p",8346:"p",587:"q",672:"q",341:"r",345:"r",343:"r",7769:"r",7771:"r",529:"r",638:"r",639:"r",635:"r",531:"r",7775:"r",636:"r",634:"r",589:"r",637:"r",876:"r",633:"r",7523:"r",347:"s",353:"s",351:"s",349:"s",537:"s",7777:"s",7835:"s",7779:"s",642:"s",575:"s",383:"s",223:"s",8347:"s",357:"t",355:"t",7793:"t",539:"t",566:"t",7831:"t",7787:"t",7789:"t",429:"t",7791:"t",427:"t",648:"t",359:"t",877:"t",647:"t",8348:"t",649:"u",250:"u",365:"u",468:"u",7799:"u",251:"u",7795:"u",252:"u",7909:"u",369:"u",533:"u",249:"u",7911:"u",432:"u",535:"u",363:"u",371:"u",367:"u",7797:"u",361:"u",871:"u",7453:"u",7454:"u",7524:"u",7807:"v",651:"v",7805:"v",878:"v",652:"v",7525:"v",7811:"w",373:"w",7813:"w",7815:"w",7817:"w",7809:"w",7832:"w",653:"w",7821:"x",7819:"x",879:"x",253:"y",375:"y",255:"y",7823:"y",7925:"y",7923:"y",7927:"y",436:"y",563:"y",7833:"y",591:"y",7929:"y",654:"y",378:"z",382:"z",7825:"z",657:"z",380:"z",7827:"z",549:"z",7829:"z",656:"z",438:"z",576:"z",593:"a",193:"A",194:"A",196:"A",192:"A",197:"A",570:"A",195:"A",7424:"A",385:"B",579:"B",665:"B",7427:"B",199:"C",571:"C",7428:"C",394:"D",393:"D",7429:"D",201:"E",202:"E",203:"E",200:"E",582:"E",400:"E",398:"E",7431:"E",403:"G",667:"G",610:"G",668:"H",205:"I",206:"I",207:"I",304:"I",204:"I",407:"I",618:"I",584:"J",7434:"J",7435:"K",573:"L",7436:"L",671:"L",412:"M",7437:"M",413:"N",544:"N",209:"N",628:"N",7438:"N",211:"O",212:"O",214:"O",210:"O",415:"O",216:"O",213:"O",390:"O",7439:"O",7440:"O",7448:"P",586:"Q",588:"R",640:"R",641:"R",7449:"R",7450:"R",574:"T",430:"T",7451:"T",580:"U",218:"U",219:"U",220:"U",217:"U",7452:"U",434:"V",581:"V",7456:"V",7457:"W",221:"Y",376:"Y",590:"Y",655:"Y",7458:"Z",["Ắ".codePointAt(0)]:"A",["Ấ".codePointAt(0)]:"A",["Ằ".codePointAt(0)]:"A",["Ầ".codePointAt(0)]:"A",["Ẳ".codePointAt(0)]:"A",["Ẩ".codePointAt(0)]:"A",["Ẵ".codePointAt(0)]:"A",["Ẫ".codePointAt(0)]:"A",["Ặ".codePointAt(0)]:"A",["Ậ".codePointAt(0)]:"A",["ắ".codePointAt(0)]:"a",["ấ".codePointAt(0)]:"a",["ằ".codePointAt(0)]:"a",["ầ".codePointAt(0)]:"a",["ẳ".codePointAt(0)]:"a",["ẩ".codePointAt(0)]:"a",["ẵ".codePointAt(0)]:"a",["ẫ".codePointAt(0)]:"a",["ặ".codePointAt(0)]:"a",["ậ".codePointAt(0)]:"a",["Ế".codePointAt(0)]:"E",["Ề".codePointAt(0)]:"E",["Ể".codePointAt(0)]:"E",["Ễ".codePointAt(0)]:"E",["Ệ".codePointAt(0)]:"E",["ế".codePointAt(0)]:"e",["ề".codePointAt(0)]:"e",["ể".codePointAt(0)]:"e",["ễ".codePointAt(0)]:"e",["ệ".codePointAt(0)]:"e",["Ố".codePointAt(0)]:"O",["Ớ".codePointAt(0)]:"O",["Ồ".codePointAt(0)]:"O",["Ờ".codePointAt(0)]:"O",["Ổ".codePointAt(0)]:"O",["Ở".codePointAt(0)]:"O",["Ỗ".codePointAt(0)]:"O",["Ỡ".codePointAt(0)]:"O",["Ộ".codePointAt(0)]:"O",["Ợ".codePointAt(0)]:"O",["ố".codePointAt(0)]:"o",["ớ".codePointAt(0)]:"o",["ồ".codePointAt(0)]:"o",["ờ".codePointAt(0)]:"o",["ổ".codePointAt(0)]:"o",["ở".codePointAt(0)]:"o",["ỗ".codePointAt(0)]:"o",["ỡ".codePointAt(0)]:"o",["ộ".codePointAt(0)]:"o",["ợ".codePointAt(0)]:"o",["Ứ".codePointAt(0)]:"U",["Ừ".codePointAt(0)]:"U",["Ử".codePointAt(0)]:"U",["Ữ".codePointAt(0)]:"U",["Ự".codePointAt(0)]:"U",["ứ".codePointAt(0)]:"u",["ừ".codePointAt(0)]:"u",["ử".codePointAt(0)]:"u",["ữ".codePointAt(0)]:"u",["ự".codePointAt(0)]:"u"};function o(t,e){return t>e?t:e}const n=t=>t.split("").map((t=>t.codePointAt(0))),r=" \f\n\r\t\v  \u2028\u2029   \ufeff".split("").map((t=>t.codePointAt(0)));for(let k=" ".codePointAt(0);k<=" ".codePointAt(0);k++)r.push(k);Object.freeze(r);const i="".codePointAt(0),s="A".codePointAt(0),c="Z".codePointAt(0),a="a".codePointAt(0),u="z".codePointAt(0),l="0".codePointAt(0),d="9".codePointAt(0);function f(t,e,o){return o?t:e-t-1}var A,P;function h(t,e){if(t){return new Array}return null}function p(t,e,o){if(null!==e&&e.i16.length>t+o){return[t+o,e.i16.subarray(t,t+o)]}return[t,new Int16Array(o)]}function b(t,e,o){if(null!==e&&e.i32.length>t+o){return[t+o,e.i32.subarray(t,t+o)]}return[t,new Int32Array(o)]}function y(t){return t>=a&&t<=u?1:t>=s&&t<=c?2:t>=l&&t<=d?4:0}function m(t){const e=String.fromCodePoint(t);return e!==e.toUpperCase()?1:e!==e.toLowerCase()?2:null!==e.match(/\p{Number}/gu)?4:null!==e.match(/\p{Letter}/gu)?3:0}function g(t){return t<=i?y(t):m(t)}function O(t,e){return 0===t&&0!==e?8:1===t&&2===e||4!==t&&4===e?7:0===e?8:0}function _(t){if(t<192||t>8580)return t;const o=e[t];return void 0!==o?o.codePointAt(0):t}function w(t,e,o,n){let r=t.slice(n),i=r.indexOf(o);if(0===i)return n;if(!e&&o>=a&&o<=u){i>0&&(r=r.slice(0,i));const t=r.indexOf(o-32);t>=0&&(i=t)}return i<0?-1:n+i}function v(t){for(const e of t)if(e>=128)return!1;return!0}function z(t,e,o){if(!v(t))return 0;if(!v(e))return-1;let n=0,r=0;for(let i=0;i<e.length;i++){if(r=w(t,o,e[i],r),r<0)return-1;0===i&&r>0&&(n=r-1),r++}return n}(P=A||(A={}))[P.NonWord=0]="NonWord",P[P.Lower=1]="Lower",P[P.Upper=2]="Upper",P[P.Letter=3]="Letter",P[P.Number=4]="Number";const I=(t,e,n,r,a,u,l)=>{if(0===a.length)return[{start:0,end:0,score:0},null];if(z(r,a,t)<0)return[{start:-1,end:-1,score:0},null];let d=0,A=-1,P=-1;const p=r.length,b=a.length;for(let o=0;o<p;o++){let u=r[f(o,p,n)];t||(u>=s&&u<=c?u+=32:u>i&&(u=String.fromCodePoint(u).toLowerCase().codePointAt(0))),e&&(u=_(u));if(u===a[f(d,b,n)]&&(A<0&&(A=o),d++,d===b)){P=o+1;break}}if(A>=0&&P>=0){d--;for(let e=P-1;e>=A;e--){let o=r[f(e,p,n)];t||(o>=s&&o<=c?o+=32:o>i&&(o=String.fromCodePoint(o).toLowerCase().codePointAt(0)));if(o===a[f(d,b,n)]&&(d--,d<0)){A=e;break}}if(!n){const t=A;A=p-P,P=p-t}const[l,y]=function(t,e,n,r,a,u,l){let d=0,f=0,A=!1,P=0,p=0;const b=h(l,r.length);let y=0;a>0&&(y=g(n[a-1]));for(let h=a;h<u;h++){let a=n[h];const u=g(a);if(t||(a>=s&&a<=c?a+=32:a>i&&(a=String.fromCodePoint(a).toLowerCase().codePointAt(0))),e&&(a=_(a)),a===r[d]){l&&(null==b||b.push(h)),f+=16;let t=O(y,u);0===P?p=t:(8===t&&(p=t),t=o(o(t,p),4)),f+=0===d?2*t:t,A=!1,P++,d++}else f+=A?-1:-3,A=!0,P=0,p=0;y=u}return[f,b]}(t,e,r,a,A,P,u);return[{start:A,end:P,score:l},y]}return[{start:-1,end:-1,score:0},null]};const L=(C=2048,{i16:new Int16Array(102400),i32:new Int32Array(C)});var C;const E={cache:!1,maxResultItems:1/0,selector:t=>t,casing:"smart-case",normalize:!1,sort:!0};t.Fzf=class{constructor(t,...e){this.cache={},this.find=t=>{let e=!1;switch(this.opts.casing){case"smart-case":t.toLowerCase()!==t&&(e=!0);break;case"case-sensitive":e=!0;break;case"case-insensitive":t=t.toLowerCase(),e=!1}if(this.opts.cache){const e=this.cache[t];if(void 0!==e)return e}const r=n(t);let s=this.runesList.map(((t,n)=>{const s=((t,e,n,r,s,c,a)=>{const u=s.length;if(0===u)return[{start:0,end:0,score:0},h(c)];const l=r.length;if(null!==a&&l*u>a.i16.length)return I(t,e,n,r,s,c);const d=z(r,s,t);if(d<0)return[{start:-1,end:-1,score:0},null];let f=0,A=0,P=null,g=null,w=null,v=null;[f,P]=p(f,a,l),[f,g]=p(f,a,l),[f,w]=p(f,a,l),[A,v]=b(A,a,u);const[,L]=b(A,a,l);for(let o=0;o<L.length;o++)L[o]=r[o];let C=0,E=0,k=0,N=0;const U=s[0];let j=s[0],x=0,S=0,R=!1,T=L.subarray(d),V=P.subarray(d).subarray(0,T.length),M=g.subarray(d).subarray(0,T.length),B=w.subarray(d).subarray(0,T.length);for(let[h,p]of T.entries()){let r=null;p<=i?(r=y(p),t||2!==r||(p+=32)):(r=m(p),t||2!==r||(p=String.fromCodePoint(p).toLowerCase().codePointAt(0)),e&&(p=_(p))),T[h]=p;const c=O(S,r);if(B[h]=c,S=r,p===j&&(k<u&&(v[k]=d+h,k++,j=s[Math.min(k,u-1)]),N=d+h),p===U){const t=16+2*c;if(V[h]=t,M[h]=1,1===u&&(n&&t>C||!n&&t>=C)&&(C=t,E=d+h,n&&8===c))break;R=!1}else V[h]=o(R?x+-1:x+-3,0),M[h]=0,R=!0;x=V[h]}if(k!==u)return[{start:-1,end:-1,score:0},null];if(1===u){const t={start:E,end:E+1,score:C};return c?[t,[E]]:[t,null]}const Y=v[0],D=N-Y+1;let G=null;[f,G]=p(f,a,D*u);{const t=P.subarray(Y,N+1);for(const[e,o]of t.entries())G[e]=o}let[,W]=p(f,a,D*u);{const t=g.subarray(Y,N+1);for(const[e,o]of t.entries())W[e]=o}const q=v.subarray(1),F=s.slice(1).slice(0,q.length);for(const[i,h]of q.entries()){let t=!1;const e=F[i],r=i+1,s=r*D,c=L.subarray(h,N+1),a=w.subarray(h).subarray(0,c.length),l=W.subarray(s+h-Y).subarray(0,c.length),d=W.subarray(s+h-Y-1-D).subarray(0,c.length),f=G.subarray(s+h-Y).subarray(0,c.length),A=G.subarray(s+h-Y-1-D).subarray(0,c.length),P=G.subarray(s+h-Y-1).subarray(0,c.length);P[0]=0;for(const[i,p]of c.entries()){const s=i+h;let c=0,b=0,y=0;if(b=t?P[i]+-1:P[i]+-3,e===p){c=A[i]+16;let t=a[i];y=d[i]+1,8===t?y=1:y>1&&(t=o(t,o(4,w[s-y+1]))),c+t<b?(c+=a[i],y=0):c+=t}l[i]=y,t=c<b;const m=o(o(c,b),0);r===u-1&&(n&&m>C||!n&&m>=C)&&(C=m,E=s),f[i]=m}}const J=h(c);let Z=Y;if(c){let t=u-1;Z=E;let e=!0;for(;;){const o=t*D,n=Z-Y,r=G[o+n];let i=0,s=0;if(t>0&&Z>=v[t]&&(i=G[o-D+n-1]),Z>v[t]&&(s=G[o+n-1]),r>i&&(r>s||r===s&&e)){if(J.push(Z),0===t)break;t--}e=W[o+n]>1||o+D+n+1<W.length&&W[o+D+n+1]>0,Z--}}return[{start:Z,end:E+1,score:C},J]})(e,this.opts.normalize,!1,t,r,!0,L);return{item:this.items[n],result:s[0],positions:s[1]}})).filter((t=>0!==t.result.score));if(this.opts.sort){const t=(t,e)=>e.result.score-t.result.score;s.sort(t)}return Number.isFinite(this.opts.maxResultItems)&&(s=s.slice(0,this.opts.maxResultItems)),this.opts.cache&&(this.cache[t]=s),s},this.opts=__spreadValues(__spreadValues({},E),e[0]),this.items=t,this.runesList=t.map((t=>n(this.opts.selector(t))))}},Object.defineProperty(t,"__esModule",{value:!0}),t[Symbol.toStringTag]="Module"}));
var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,e,r)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,__spreadValues=(t,e)=>{for(var r in e||(e={}))__hasOwnProp.call(e,r)&&__defNormalProp(t,r,e[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(e))__propIsEnum.call(e,r)&&__defNormalProp(t,r,e[r]);return t},__spreadProps=(t,e)=>__defProps(t,__getOwnPropDescs(e));!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).fzf={})}(this,(function(t){"use strict";const e={216:"O",223:"s",248:"o",273:"d",295:"h",305:"i",320:"l",322:"l",359:"t",383:"s",384:"b",385:"B",387:"b",390:"O",392:"c",393:"D",394:"D",396:"d",398:"E",400:"E",402:"f",403:"G",407:"I",409:"k",410:"l",412:"M",413:"N",414:"n",415:"O",421:"p",427:"t",429:"t",430:"T",434:"V",436:"y",438:"z",477:"e",485:"g",544:"N",545:"d",549:"z",564:"l",565:"n",566:"t",567:"j",570:"A",571:"C",572:"c",573:"L",574:"T",575:"s",576:"z",579:"B",580:"U",581:"V",582:"E",583:"e",584:"J",585:"j",586:"Q",587:"q",588:"R",589:"r",590:"Y",591:"y",592:"a",593:"a",595:"b",596:"o",597:"c",598:"d",599:"d",600:"e",603:"e",604:"e",605:"e",606:"e",607:"j",608:"g",609:"g",610:"G",613:"h",614:"h",616:"i",618:"I",619:"l",620:"l",621:"l",623:"m",624:"m",625:"m",626:"n",627:"n",628:"N",629:"o",633:"r",634:"r",635:"r",636:"r",637:"r",638:"r",639:"r",640:"R",641:"R",642:"s",647:"t",648:"t",649:"u",651:"v",652:"v",653:"w",654:"y",655:"Y",656:"z",657:"z",663:"c",665:"B",666:"e",667:"G",668:"H",669:"j",670:"k",671:"L",672:"q",686:"h",867:"a",868:"e",869:"i",870:"o",871:"u",872:"c",873:"d",874:"h",875:"m",876:"r",877:"t",878:"v",879:"x",7424:"A",7427:"B",7428:"C",7429:"D",7431:"E",7432:"e",7433:"i",7434:"J",7435:"K",7436:"L",7437:"M",7438:"N",7439:"O",7440:"O",7441:"o",7442:"o",7443:"o",7446:"o",7447:"o",7448:"P",7449:"R",7450:"R",7451:"T",7452:"U",7453:"u",7454:"u",7455:"m",7456:"V",7457:"W",7458:"Z",7522:"i",7523:"r",7524:"u",7525:"v",7834:"a",7835:"s",8305:"i",8341:"h",8342:"k",8343:"l",8344:"m",8345:"n",8346:"p",8347:"s",8348:"t",8580:"c"};for(let Z="̀".codePointAt(0);Z<="ͯ".codePointAt(0);++Z){const t=String.fromCodePoint(Z);for(const r of"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"){const n=(r+t).normalize().codePointAt(0);n>126&&(e[n]=r)}}const r={a:[7844,7863],e:[7870,7879],o:[7888,7907],u:[7912,7921]};for(const Z of Object.keys(r)){const t=Z.toUpperCase();for(let n=r[Z][0];n<=r[Z][1];++n)e[n]=n%2==0?t:Z}function n(t){if(t<192||t>8580)return t;const r=e[t];return void 0!==r?r.codePointAt(0):t}function o(t,e){return t>e?t:e}const s=t=>t.split("").map((t=>t.codePointAt(0))),i=t=>t.map((t=>String.fromCodePoint(t))).join(""),l=new Set(" \f\n\r\t\v  \u2028\u2029   \ufeff".split("").map((t=>t.codePointAt(0))));for(let Z=" ".codePointAt(0);Z<=" ".codePointAt(0);Z++)l.add(Z);const a=t=>l.has(t),c=t=>{let e=0;for(const r of t){if(!a(r))break;e++}return e},u=t=>{let e=0;for(let r=t.length-1;r>=0&&a(t[r]);r--)e++;return e},f="".codePointAt(0),h="A".codePointAt(0),d="Z".codePointAt(0),p="a".codePointAt(0),g="z".codePointAt(0),b="0".codePointAt(0),m="9".codePointAt(0);function y(t,e,r){return r?t:e-t-1}const P=16;var _,w;function S(t){return t?new Set:null}function z(t,e,r){if(null!==e&&e.i16.length>t+r){return[t+r,e.i16.subarray(t,t+r)]}return[t,new Int16Array(r)]}function A(t,e,r){if(null!==e&&e.i32.length>t+r){return[t+r,e.i32.subarray(t,t+r)]}return[t,new Int32Array(r)]}function v(t){return t>=p&&t<=g?1:t>=h&&t<=d?2:t>=b&&t<=m?4:0}function L(t){const e=String.fromCodePoint(t);return e!==e.toUpperCase()?1:e!==e.toLowerCase()?2:null!==e.match(/\p{Number}/gu)?4:null!==e.match(/\p{Letter}/gu)?3:0}function C(t){return t<=f?v(t):L(t)}function O(t,e){return 0===t&&0!==e?8:1===t&&2===e||4!==t&&4===e?7:0===e?8:0}function x(t,e,r,n){let o=t.slice(n),s=o.indexOf(r);if(0===s)return n;if(!e&&r>=p&&r<=g){s>0&&(o=o.slice(0,s));const t=o.indexOf(r-32);t>=0&&(s=t)}return s<0?-1:n+s}function k(t){for(const e of t)if(e>=128)return!1;return!0}function j(t,e,r){if(!k(t))return 0;if(!k(e))return-1;let n=0,o=0;for(let s=0;s<e.length;s++){if(o=x(t,r,e[s],o),o<0)return-1;0===s&&o>0&&(n=o-1),o++}return n}(w=_||(_={}))[w.NonWord=0]="NonWord",w[w.Lower=1]="Lower",w[w.Upper=2]="Upper",w[w.Letter=3]="Letter",w[w.Number=4]="Number";const E=(t,e,r,s,i,l,a)=>{const c=i.length;if(0===c)return[{start:0,end:0,score:0},S(l)];const u=s.length;if(null!==a&&u*c>a.i16.length)return F(t,e,r,s,i,l);const h=j(s,i,t);if(h<0)return[{start:-1,end:-1,score:0},null];let d=0,p=0,g=null,b=null,m=null,y=null;[d,g]=z(d,a,u),[d,b]=z(d,a,u),[d,m]=z(d,a,u),[p,y]=A(p,a,c);const[,_]=A(p,a,u);for(let n=0;n<_.length;n++)_[n]=s[n];let w=0,C=0,x=0,k=0;const E=i[0];let N=i[0],I=0,M=0,R=!1,W=_.subarray(h),V=g.subarray(h).subarray(0,W.length),q=b.subarray(h).subarray(0,W.length),D=m.subarray(h).subarray(0,W.length);for(let[S,z]of W.entries()){let s=null;z<=f?(s=v(z),t||2!==s||(z+=32)):(s=L(z),t||2!==s||(z=String.fromCodePoint(z).toLowerCase().codePointAt(0)),e&&(z=n(z))),W[S]=z;const l=O(M,s);if(D[S]=l,M=s,z===N&&(x<c&&(y[x]=h+S,x++,N=i[Math.min(x,c-1)]),k=h+S),z===E){const t=P+2*l;if(V[S]=t,q[S]=1,1===c&&(r&&t>w||!r&&t>=w)&&(w=t,C=h+S,r&&8===l))break;R=!1}else V[S]=o(R?I+-1:I+-3,0),q[S]=0,R=!0;I=V[S]}if(x!==c)return[{start:-1,end:-1,score:0},null];if(1===c){const t={start:C,end:C+1,score:w};if(!l)return[t,null];const e=new Set;return e.add(C),[t,e]}const T=y[0],U=k-T+1;let B=null;[d,B]=z(d,a,U*c);{const t=g.subarray(T,k+1);for(const[e,r]of t.entries())B[e]=r}let[,G]=z(d,a,U*c);{const t=b.subarray(T,k+1);for(const[e,r]of t.entries())G[e]=r}const J=y.subarray(1),Y=i.slice(1).slice(0,J.length);for(const[n,f]of J.entries()){let t=!1;const e=Y[n],s=n+1,i=s*U,l=_.subarray(f,k+1),a=m.subarray(f).subarray(0,l.length),u=G.subarray(i+f-T).subarray(0,l.length),h=G.subarray(i+f-T-1-U).subarray(0,l.length),d=B.subarray(i+f-T).subarray(0,l.length),p=B.subarray(i+f-T-1-U).subarray(0,l.length),g=B.subarray(i+f-T-1).subarray(0,l.length);g[0]=0;for(const[n,b]of l.entries()){const i=n+f;let l=0,y=0,_=0;if(y=t?g[n]+-1:g[n]+-3,e===b){l=p[n]+P;let t=a[n];_=h[n]+1,8===t?_=1:_>1&&(t=o(t,o(4,m[i-_+1]))),l+t<y?(l+=a[n],_=0):l+=t}u[n]=_,t=l<y;const S=o(o(l,y),0);s===c-1&&(r&&S>w||!r&&S>=w)&&(w=S,C=i),d[n]=S}}const Z=S(l);let H=T;if(l&&null!==Z){let t=c-1;H=C;let e=!0;for(;;){const r=t*U,n=H-T,o=B[r+n];let s=0,i=0;if(t>0&&H>=y[t]&&(s=B[r-U+n-1]),H>y[t]&&(i=B[r+n-1]),o>s&&(o>i||o===i&&e)){if(Z.add(H),0===t)break;t--}e=G[r+n]>1||r+U+n+1<G.length&&G[r+U+n+1]>0,H--}}return[{start:H,end:C+1,score:w},Z]};function N(t,e,r,s,i,l,a){let c=0,u=0,p=!1,g=0,b=0;const m=S(a);let y=0;i>0&&(y=C(r[i-1]));for(let _=i;_<l;_++){let i=r[_];const l=C(i);if(t||(i>=h&&i<=d?i+=32:i>f&&(i=String.fromCodePoint(i).toLowerCase().codePointAt(0))),e&&(i=n(i)),i===s[c]){a&&null!==m&&m.add(_),u+=P;let t=O(y,l);0===g?b=t:(8===t&&(b=t),t=o(o(t,b),4)),u+=0===c?2*t:t,p=!1,g++,c++}else u+=p?-1:-3,p=!0,g=0,b=0;y=l}return[u,m]}const F=(t,e,r,o,s,i,l)=>{if(0===s.length)return[{start:0,end:0,score:0},null];if(j(o,s,t)<0)return[{start:-1,end:-1,score:0},null];let a=0,c=-1,u=-1;const p=o.length,g=s.length;for(let b=0;b<p;b++){let i=o[y(b,p,r)];t||(i>=h&&i<=d?i+=32:i>f&&(i=String.fromCodePoint(i).toLowerCase().codePointAt(0))),e&&(i=n(i));if(i===s[y(a,g,r)]&&(c<0&&(c=b),a++,a===g)){u=b+1;break}}if(c>=0&&u>=0){a--;for(let e=u-1;e>=c;e--){let n=o[y(e,p,r)];t||(n>=h&&n<=d?n+=32:n>f&&(n=String.fromCodePoint(n).toLowerCase().codePointAt(0)));if(n===s[y(a,g,r)]&&(a--,a<0)){c=e;break}}if(!r){const t=c;c=p-u,u=p-t}const[n,l]=N(t,e,o,s,c,u,i);return[{start:c,end:u,score:n},l]}return[{start:-1,end:-1,score:0},null]},I=(t,e,r,o,s,i,l)=>{if(0===s.length)return[{start:0,end:0,score:0},null];const a=o.length,c=s.length;if(a<c)return[{start:-1,end:-1,score:0},null];if(j(o,s,t)<0)return[{start:-1,end:-1,score:0},null];let u=0,p=-1,g=0,b=-1;for(let _=0;_<a;_++){const i=y(_,a,r);let l=o[i];t||(l>=h&&l<=d?l+=32:l>f&&(l=String.fromCodePoint(l).toLowerCase().codePointAt(0))),e&&(l=n(l));const w=y(u,c,r);if(s[w]===l){if(0===w&&(m=o,g=0===(P=i)?8:O(C(m[P-1]),C(m[P]))),u++,u===c){if(g>b&&(p=_,b=g),8===g)break;_-=u-1,u=0,g=0}}else _-=u,u=0,g=0}var m,P;if(p>=0){let n=0,i=0;r?(n=p-c+1,i=p+1):(n=a-(p+1),i=a-(p-c+1));const[l]=N(t,e,o,s,n,i,!1);return[{start:n,end:i,score:l},null]}return[{start:-1,end:-1,score:0},null]};const M=(R=2048,{i16:new Int16Array(102400),i32:new Int32Array(R)});var R,W,V;(V=W||(W={}))[V.Fuzzy=0]="Fuzzy",V[V.Exact=1]="Exact",V[V.Prefix=2]="Prefix",V[V.Suffix=3]="Suffix",V[V.Equal=4]="Equal";const q={0:E,1:I,2:(t,e,r,o,s,i,l)=>{if(0===s.length)return[{start:0,end:0,score:0},null];let u=0;if(a(s[0])||(u=c(o)),o.length-u<s.length)return[{start:-1,end:-1,score:0},null];for(const[a,c]of s.entries()){let r=o[u+a];if(t||(r=String.fromCodePoint(r).toLowerCase().codePointAt(0)),e&&(r=n(r)),r!==c)return[{start:-1,end:-1,score:0},null]}const f=s.length,[h]=N(t,e,o,s,u,u+f,!1);return[{start:u,end:u+f,score:h},null]},3:(t,e,r,o,s,i,l)=>{let c=o.length;if(0!==s.length&&a(s[s.length-1])||(c-=u(o)),0===s.length)return[{start:c,end:c,score:0},null];const f=c-s.length;if(f<0)return[{start:-1,end:-1,score:0},null];for(const[a,u]of s.entries()){let r=o[a+f];if(t||(r=String.fromCodePoint(r).toLowerCase().codePointAt(0)),e&&(r=n(r)),r!==u)return[{start:-1,end:-1,score:0},null]}const h=c-s.length,d=c,[p]=N(t,e,o,s,h,d,!1);return[{start:h,end:d,score:p},null]},4:(t,e,r,o,s,l,f)=>{const h=s.length;if(0===h)return[{start:-1,end:-1,score:0},null];let d=0;a(s[0])||(d=c(o));let p=0;if(a(s[h-1])||(p=u(o)),o.length-d-p!=h)return[{start:-1,end:-1,score:0},null];let g=!0;if(e){const e=o;for(const[r,o]of s.entries()){let s=e[d+r];if(t||(s=String.fromCodePoint(s).toLowerCase().codePointAt(0)),n(o)!==n(s)){g=!1;break}}}else{let e=i(o).substring(d,o.length-p);t||(e=e.toLowerCase()),g=e===i(s)}return g?[{start:d,end:d+h,score:24*h+8},null]:[{start:-1,end:-1,score:0},null]}};function D(t,e,r,o){let l=!0;{const t=(o=o.trimLeft()).trimRight();o=t.endsWith("\\")&&" "===o[t.length]?t+" ":t}let a=!1,c=[];c=function(t,e,r,o){const l=(o=o.replaceAll("\\ ","\t")).split(/ +/),a=[];let c=[],u=!1,f=!1;for(const h of l){let o=0,l=!1,d=h.replaceAll("\t"," ");const p=d.toLowerCase(),g="case-sensitive"===e||"smart-case"===e&&d!==p,b=r&&p===i(s(p).map(n));if(g||(d=p),t||(o=1),c.length>0&&!f&&"|"===d)u=!1,f=!0;else if(f=!1,d.startsWith("!")&&(l=!0,o=1,d=d.substring(1)),"$"!==d&&d.endsWith("$")&&(o=3,d=d.substring(0,d.length-1)),d.startsWith("'")?(o=t&&!l?1:0,d=d.substring(1)):d.startsWith("^")&&(o=3===o?4:2,d=d.substring(1)),d.length>0){u&&(a.push(c),c=[]);let t=s(d);b&&(t=t.map(n)),c.push({typ:o,inv:l,text:t,caseSensitive:g,normalize:b}),u=!0}}c.length>0&&a.push(c);return a}(t,e,r,o);t:for(const n of c)for(const[e,r]of n.entries())if(r.inv||(a=!0),(!l||e>0||r.inv||t&&0!==r.typ||!t&&1!==r.typ)&&(l=!1,a))break t;return{str:o,termSets:c,sortable:a,cacheable:l,fuzzy:t}}function T(t,e,r,n,o,s,i){for(const l of e){const[e,a]=t(r,n,o,l.text,s,!0,i);if(e.start>=0){const t=e.start+l.prefixLength,r=e.end+l.prefixLength;if(null!==a){const n=new Set;return a.forEach((t=>n.add(l.prefixLength+t))),[[t,r],e.score,n]}return[[t,r],e.score,a]}}return[[-1,-1],0,null]}function U(t,e,r,n){const o=[{text:t,prefixLength:0}],s=[];let i=0;const l=new Set;for(const a of e.termSets){let t=[0,0],e=0,c=!1;for(const s of a){let i=q[s.typ];s.typ===W.Fuzzy&&(i=r);const[a,u,f]=T(i,o,s.caseSensitive,s.normalize,n,s.text,M);if(a[0]>=0){if(s.inv)continue;if(t=a,e=u,c=!0,null!==f)f.forEach((t=>l.add(t)));else for(let t=a[0];t<a[1];++t)l.add(t);break}s.inv&&(t=[0,0],e=0,c=!0)}c&&(s.push(t),i+=e)}return{offsets:s,totalScore:i,allPos:l}}function B(t){const{queryRunes:e,caseSensitive:r}=((t,e,r)=>{let o=!1;switch(e){case"smart-case":t.toLowerCase()!==t&&(o=!0);break;case"case-sensitive":o=!0;break;case"case-insensitive":t=t.toLowerCase(),o=!1}let i=s(t);return r&&(i=i.map(n)),{queryRunes:i,caseSensitive:o}})(t,this.opts.casing,this.opts.normalize),o={};for(let n=0,s=this.runesList.length;n<s;++n){const t=this.runesList[n];if(e.length>t.length)continue;let[s,i]=this.algoFn(r,this.opts.normalize,this.opts.forward,t,e,!0,M);if(-1===s.start)continue;if(!1===this.opts.fuzzy){i=new Set;for(let t=s.start;t<s.end;++t)i.add(t)}const l=this.opts.sort?s.score:0;void 0===o[l]&&(o[l]=[]),o[l].push(__spreadProps(__spreadValues({item:this.items[n]},s),{positions:null!=i?i:new Set}))}return G(o,this.opts.limit)}function G(t,e){const r=Object.keys(t).map((t=>parseInt(t,10))).sort(((t,e)=>e-t)),n=[];for(const o of r)if(n.push(...t[o]),n.length>=e)break;return n}const J={limit:1/0,selector:t=>t,casing:"smart-case",normalize:!0,fuzzy:"v2",match:B,tiebreakers:[],sort:!0,forward:!0};class Y{constructor(t,...e){switch(this.opts=__spreadValues(__spreadValues({},J),e[0]),this.items=t,this.runesList=t.map((t=>s(this.opts.selector(t).normalize()))),this.algoFn=I,this.opts.fuzzy){case"v2":this.algoFn=E;break;case"v1":this.algoFn=F}}find(t){t=t.normalize();let e=[];if(e=this.opts.match.bind(this)(t),this.opts.sort)for(const r of this.opts.tiebreakers)e.sort(((t,e)=>t.score===e.score?r(t,e,this.opts):0));return Number.isFinite(this.opts.limit)&&e.splice(this.opts.limit),e}}t.Fzf=class{constructor(t,...e){this.finder=new Y(t,...e),this.find=this.finder.find.bind(this.finder)}},t.basicMatch=B,t.byLengthAsc=function(t,e,r){return r.selector(t.item).length-r.selector(e.item).length},t.byStartAsc=function(t,e){return t.start-e.start},t.extendedMatch=function(t){const e=D(Boolean(this.opts.fuzzy),this.opts.casing,this.opts.normalize,t),r={};for(const[n,o]of this.runesList.entries()){const t=U(o,e,this.algoFn,this.opts.forward);if(t.offsets.length!==e.termSets.length)continue;let s=-1,i=-1;t.allPos.size>0&&(s=Math.min(...t.allPos),i=Math.max(...t.allPos)+1);const l=this.opts.sort?t.totalScore:0;void 0===r[l]&&(r[l]=[]),r[l].push({score:t.totalScore,item:this.items[n],positions:t.allPos,start:s,end:i})}return G(r,this.opts.limit)},Object.defineProperty(t,"__esModule",{value:!0}),t[Symbol.toStringTag]="Module"}));

@@ -1,56 +0,14 @@

import type { Result } from "./algo";
interface Options<U> {
/**
* Cache the results for the queries that you'll make.
*
* @defaultValue false
*/
cache: boolean;
/**
* If `maxResultItems` is 32, top 32 items that matches your query will be returned.
* By default all matched items are returned.
*
* @defaultValue Infinity
*/
maxResultItems: number;
/**
* For each item in the list, target a specific property of the item to search for.
*/
selector: (v: U) => string;
/**
* Defines what type of case sensitive search you want.
*
* @defaultValue "smart-case"
*/
casing: "smart-case" | "case-sensitive" | "case-insensitive";
/**
* If true, FZF will try to remove diacritics from list items.
* This is useful if the list contains items with diacritics but
* you want to query with plain A-Z letters.
*
* @example
* Zoë → Zoe
* blessèd → blessed
*
* @defaultValue false
*/
normalize: boolean;
sort: boolean;
}
export interface FzfResultItem<U = string> {
item: U;
result: Result;
positions: number[] | null;
}
declare type OptionsTuple<U> = U extends string ? [options?: Partial<Options<U>>] : [options: Partial<Options<U>> & {
import { Finder } from "./finder";
import type { ArrayElement, OptionsTuple, OptsToUse } from "./finder";
import type { Options } from "./types";
export type { Tiebreaker, FzfResultItem } from "./types";
export * from "./matchers";
export * from "./tiebreakers";
export declare type FzfOptions<U = string> = U extends string ? OptsToUse<U> : OptsToUse<U> & {
selector: Options<U>["selector"];
}];
export declare class Fzf<U> {
private runesList;
private items;
private readonly opts;
private cache;
constructor(list: U[], ...optionsTuple: OptionsTuple<U>);
find: (query: string) => FzfResultItem<U>[];
};
export declare class Fzf<L extends any[]> {
private finder;
find: Finder<L>["find"];
constructor(list: L, ...optionsTuple: OptionsTuple<ArrayElement<L>>);
}
export {};

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

export declare const normalized: Record<number, string>;
import { Rune } from "./runes";
export declare function normalizeRune(rune: Rune): Rune;

@@ -5,5 +5,2 @@ export interface Slab {

}
export declare const SLAB_16_SIZE: number;
export declare const SLAB_32_SIZE = 2048;
export declare function makeSlab(size16: number, size32: number): Slab;
export declare const slab: Slab;
{
"===== INFO =====": "",
"name": "fzf",
"version": "0.3.2",
"version": "0.4.0-alpha.0",
"description": "Do fuzzy matching using FZF algorithm in JavaScript",

@@ -24,9 +24,13 @@ "license": "BSD-3-Clause",

"scripts": {
"prepack": "node scripts/prepack.cjs",
"postpack": "node scripts/postpack.cjs",
"dev": "vite -c vite-for-docs.config.ts",
"build": "npm run build:modules && npm run build:types",
"build:modules": "tsc && vite build",
"build:modules": "tsc && vite build && vite build -c vite-legacy.config.ts",
"build:types": "tsc -p tsconfig-to-build-types.json --outDir dist",
"build:only-docs": "tsc && vite build -c vite-for-docs.config.ts",
"build:docs": "npm run fill-with-old-docs && npm run build:only-docs",
"test": "jest src",
"test": "jest",
"test:watch": "jest --watch -o",
"test:cov": "jest --coverage",
"fill-with-old-docs": "node scripts/fill-with-old-docs.js"

@@ -51,3 +55,3 @@ },

"devDependencies": {
"@mdx-js/mdx": "^2.0.0-next.9",
"@mdx-js/mdx": "^1.6.22",
"@mdx-js/react": "^1.6.22",

@@ -73,5 +77,7 @@ "@tailwindcss/typography": "^0.4.1",

"react-dom": "^17.0.0",
"react-git-info": "^2.0.0",
"react-router": "^6.0.0-beta.0",
"react-router-dom": "^6.0.0-beta.0",
"shelljs": "^0.8.4",
"string.prototype.replaceall": "^1.0.5",
"tailwindcss": "^2.2.4",

@@ -83,3 +89,4 @@ "ts-jest": "^27.0.3",

"vite-plugin-mdx": "^3.5.6"
}
},
"type": "module"
}
# FZF for JavaScript (Preview)
[![Tests](https://github.com/ajitid/fzf-for-js/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/ajitid/fzf-for-js/actions/workflows/main.yml)
[![Tests](https://github.com/ajitid/fzf-for-js/actions/workflows/main.yml/badge.svg?branch=dev)](https://github.com/ajitid/fzf-for-js/actions/workflows/main.yml)
[![Docs deployment status](https://img.shields.io/netlify/e4324b0d-d5b2-4139-a688-e58f32a5af6b?label=Docs&logo=netlify)](https://app.netlify.com/sites/fzf/deploys)

@@ -5,0 +5,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc