homelab/services/parts-inventory/api/node_modules/fuse.js/dist/fuse.basic.min.mjs
Dan V deb6c38d7b chore: commit homelab setup — deployment, services, orchestration, skill
- Add .gitignore: exclude compiled binaries, build artifacts, and Helm
  values files containing real secrets (authentik, prometheus)
- Add all Kubernetes deployment manifests (deployment/)
- Add services source code: ha-sync, device-inventory, games-console,
  paperclip, parts-inventory
- Add Ansible orchestration: playbooks, roles, inventory, cloud-init
- Add hardware specs, execution plans, scripts, HOMELAB.md
- Add skills/homelab/SKILL.md + skills/install.sh to preserve Copilot skill
- Remove previously-tracked inventory-cli binary from git index

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-09 08:10:32 +02:00

9 lines
No EOL
14 KiB
JavaScript

/**
* 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
*/
function e(e){return Array.isArray?Array.isArray(e):"[object Array]"===c(e)}const t=1/0;function u(e){return null==e?"":function(e){if("string"==typeof e)return e;let u=e+"";return"0"==u&&1/e==-t?"-0":u}(e)}function s(e){return"string"==typeof e}function i(e){return"number"==typeof e}function n(e){return!0===e||!1===e||function(e){return function(e){return"object"==typeof e}(e)&&null!==e}(e)&&"[object Boolean]"==c(e)}function r(e){return null!=e}function o(e){return!e.trim().length}function c(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const h=e=>`Missing ${e} property in key`,a=e=>`Property 'weight' in key '${e}' must be a positive integer`,l=Object.prototype.hasOwnProperty;class d{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((e=>{let u=A(e);this._keys.push(u),this._keyMap[u.id]=u,t+=u.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function A(t){let u=null,i=null,n=null,r=1,o=null;if(s(t)||e(t))n=t,u=f(t),i=g(t);else{if(!l.call(t,"name"))throw new Error(h("name"));const e=t.name;if(n=e,l.call(t,"weight")&&(r=t.weight,r<=0))throw new Error(a(e));u=f(e),i=g(e),o=t.getFn}return{path:u,id:i,weight:r,src:n,getFn:o}}function f(t){return e(t)?t:t.split(".")}function g(t){return e(t)?t.join("."):t}var C={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,...{useExtendedSearch:!1,getFn:function(t,o){let c=[],h=!1;const a=(t,o,l,d)=>{if(r(t))if(o[l]){const A=t[o[l]];if(!r(A))return;if(l===o.length-1&&(s(A)||i(A)||n(A)))c.push(void 0!==d?{v:u(A),i:d}:u(A));else if(e(A)){h=!0;for(let e=0,t=A.length;e<t;e+=1)a(A[e],o,l+1,e)}else o.length&&a(A,o,l+1,d)}else c.push(void 0!==d?{v:t,i:d}:t)};return a(t,s(o)?o.split("."):o,0),h?c:c[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const F=/[^ ]+/g;class p{constructor({getFn:e=C.getFn,fieldNormWeight:t=C.fieldNormWeight}={}){this.norm=function(e=1,t=3){const u=new Map,s=Math.pow(10,t);return{get(t){const i=t.match(F).length;if(u.has(i))return u.get(i);const n=1/Math.pow(i,.5*e),r=parseFloat(Math.round(n*s)/s);return u.set(i,r),r},clear(){u.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach(((e,t)=>{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,s(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const t=this.size();s(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,u=this.size();t<u;t+=1)this.records[t].i-=1}removeAll(e){for(let t=e.length-1;t>=0;t-=1)this.records.splice(e[t],1);for(let e=0,t=this.records.length;e<t;e+=1)this.records[e].i=e}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!r(e)||o(e))return;let u={v:e,i:t,n:this.norm.get(e)};this.records.push(u)}_addObject(t,u){let i={i:u,$:{}};this.keys.forEach(((u,n)=>{let c=u.getFn?u.getFn(t):this.getFn(t,u.path);if(r(c))if(e(c)){let e=[];for(let t=0,u=c.length;t<u;t+=1){const u=c[t];if(r(u))if(s(u)){if(!o(u)){let s={v:u,i:t,n:this.norm.get(u)};e.push(s)}}else if(s(u.v)&&!o(u.v)){let t={v:u.v,i:u.i,n:this.norm.get(u.v)};e.push(t)}}i.$[n]=e}else if(s(c)&&!o(c)){let e={v:c,n:this.norm.get(c)};i.$[n]=e}})),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function m(e,t,{getFn:u=C.getFn,fieldNormWeight:s=C.fieldNormWeight}={}){const i=new p({getFn:u,fieldNormWeight:s});return i.setKeys(e.map(A)),i.setSources(t),i.create(),i}const E=32;function B(e,t,u,{location:s=C.location,distance:i=C.distance,threshold:n=C.threshold,findAllMatches:r=C.findAllMatches,minMatchCharLength:o=C.minMatchCharLength,includeMatches:c=C.includeMatches,ignoreLocation:h=C.ignoreLocation}={}){if(t.length>E)throw new Error(`Pattern length exceeds max of ${E}.`);const a=t.length,l=e.length,d=Math.max(0,Math.min(s,l));let A=n,f=d;const g=(e,t)=>{const u=e/a;if(h)return u;const s=Math.abs(d-t);return i?u+s/i:s?1:u},F=o>1||c,p=F?Array(l):[];let m;for(;(m=e.indexOf(t,f))>-1;){let e=g(0,m);if(A=Math.min(e,A),f=m+a,F){let e=0;for(;e<a;)p[m+e]=1,e+=1}}f=-1;let B=[],D=1,y=a+l;const M=1<<a-1;for(let t=0;t<a;t+=1){let s=0,i=y;for(;s<i;){g(t,d+i)<=A?s=i:y=i,i=Math.floor((y-s)/2+s)}y=i;let n=Math.max(1,d-i+1),o=r?l:Math.min(d+i,l)+a,c=Array(o+2);c[o+1]=(1<<t)-1;for(let s=o;s>=n;s-=1){let i=s-1,r=u[e[i]];if(F&&(p[i]=+!!r),c[s]=(c[s+1]<<1|1)&r,t&&(c[s]|=(B[s+1]|B[s])<<1|1|B[s+1]),c[s]&M&&(D=g(t,i),D<=A)){if(A=D,f=i,f<=d)break;n=Math.max(1,2*d-f)}}if(g(t+1,d)>A)break;B=c}const _={isMatch:f>=0,score:Math.max(.001,D)};if(F){const e=function(e=[],t=C.minMatchCharLength){let u=[],s=-1,i=-1,n=0;for(let r=e.length;n<r;n+=1){let r=e[n];r&&-1===s?s=n:r||-1===s||(i=n-1,i-s+1>=t&&u.push([s,i]),s=-1)}return e[n-1]&&n-s>=t&&u.push([s,n-1]),u}(p,o);e.length?c&&(_.indices=e):_.isMatch=!1}return _}function D(e){let t={};for(let u=0,s=e.length;u<s;u+=1){const i=e.charAt(u);t[i]=(t[i]||0)|1<<s-u-1}return t}const y=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e;class M{constructor(e,{location:t=C.location,threshold:u=C.threshold,distance:s=C.distance,includeMatches:i=C.includeMatches,findAllMatches:n=C.findAllMatches,minMatchCharLength:r=C.minMatchCharLength,isCaseSensitive:o=C.isCaseSensitive,ignoreDiacritics:c=C.ignoreDiacritics,ignoreLocation:h=C.ignoreLocation}={}){if(this.options={location:t,threshold:u,distance:s,includeMatches:i,findAllMatches:n,minMatchCharLength:r,isCaseSensitive:o,ignoreDiacritics:c,ignoreLocation:h},e=o?e:e.toLowerCase(),e=c?y(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const a=(e,t)=>{this.chunks.push({pattern:e,alphabet:D(e),startIndex:t})},l=this.pattern.length;if(l>E){let e=0;const t=l%E,u=l-t;for(;e<u;)a(this.pattern.substr(e,E),e),e+=E;if(t){const e=l-E;a(this.pattern.substr(e),e)}}else a(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:u,includeMatches:s}=this.options;if(e=t?e:e.toLowerCase(),e=u?y(e):e,this.pattern===e){let t={isMatch:!0,score:0};return s&&(t.indices=[[0,e.length-1]]),t}const{location:i,distance:n,threshold:r,findAllMatches:o,minMatchCharLength:c,ignoreLocation:h}=this.options;let a=[],l=0,d=!1;this.chunks.forEach((({pattern:t,alphabet:u,startIndex:A})=>{const{isMatch:f,score:g,indices:C}=B(e,t,u,{location:i+A,distance:n,threshold:r,findAllMatches:o,minMatchCharLength:c,includeMatches:s,ignoreLocation:h});f&&(d=!0),l+=g,f&&C&&a.push(...C)}));let A={isMatch:d,score:d?l/this.chunks.length:1};return d&&s&&(A.indices=function(e){if(e.length<=1)return e;e.sort(((e,t)=>e[0]-t[0]||e[1]-t[1]));const t=[e[0]];for(let u=1,s=e.length;u<s;u+=1){const s=t[t.length-1],i=e[u];i[0]<=s[1]+1?s[1]=Math.max(s[1],i[1]):t.push(i)}return t}(a)),A}}const _=[];function k(e,{ignoreFieldNorm:t=C.ignoreFieldNorm}){let u=1;e.matches.forEach((({key:e,norm:s,score:i})=>{const n=e?e.weight:null;u*=Math.pow(0===i&&n?Number.EPSILON:i,(n||1)*(t?1:s))})),e.score=u}class x{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){const t=this.heap;for(;e>0;){const u=e-1>>1;if(t[e].score<=t[u].score)break;const s=t[e];t[e]=t[u],t[u]=s,e=u}}_sinkDown(e){const t=this.heap,u=t.length;let s=e;do{const i=2*(e=s)+1,n=2*e+2;if(i<u&&t[i].score>t[s].score&&(s=i),n<u&&t[n].score>t[s].score&&(s=n),s!==e){const u=t[e];t[e]=t[s],t[s]=u}}while(s!==e)}}function v(e,t){const u=e.matches;t.matches=[],r(u)&&u.forEach((e=>{if(!r(e.indices)||!e.indices.length)return;const{indices:u,value:s}=e;let i={indices:u,value:s};e.key&&(i.key=e.key.src),e.idx>-1&&(i.refIndex=e.idx),t.matches.push(i)}))}function S(e,t){t.score=e.score}class w{constructor(e,t={},u){if(this.options={...C,...t},this.options.useExtendedSearch)throw new Error("Extended search is not available");this._keyStore=new d(this.options.keys),this.setCollection(e,u),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const t=function(e,t){for(let u=0,s=_.length;u<s;u+=1){let s=_[u];if(s.condition(e,t))return new s(e,t)}return new M(e,t)}(e,this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof p))throw new Error("Incorrect 'index' type");this._myIndex=t||m(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){r(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=(()=>!1)){const t=[],u=[];for(let s=0,i=this._docs.length;s<i;s+=1)e(this._docs[s],s)&&(t.push(this._docs[s]),u.push(s));if(u.length){for(let e=u.length-1;e>=0;e-=1)this._docs.splice(u[e],1);this._myIndex.removeAll(u)}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){const{includeMatches:u,includeScore:n,shouldSort:r,sortFn:o,ignoreFieldNorm:c}=this.options;let h;if(i(t)&&t>0&&s(e)){const u=new x(t);s(this._docs[0])?this._searchStringList(e,{heap:u,ignoreFieldNorm:c}):this._searchObjectList(e,{heap:u,ignoreFieldNorm:c}),h=u.extractSorted(o)}else h=s(e)?s(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),function(e,{ignoreFieldNorm:t=C.ignoreFieldNorm}){e.forEach((e=>{k(e,{ignoreFieldNorm:t})}))}(h,{ignoreFieldNorm:c}),r&&h.sort(o),i(t)&&t>-1&&(h=h.slice(0,t));return function(e,t,{includeMatches:u=C.includeMatches,includeScore:s=C.includeScore}={}){const i=[];return u&&i.push(v),s&&i.push(S),e.map((e=>{const{idx:u}=e,s={item:t[u],refIndex:u};return i.length&&i.forEach((t=>{t(e,s)})),s}))}(h,this._docs,{includeMatches:u,includeScore:n})}_searchStringList(e,{heap:t,ignoreFieldNorm:u}={}){const s=this._getSearcher(e),{records:i}=this._myIndex,n=t?null:[];return i.forEach((({v:e,i:i,n:o})=>{if(!r(e))return;const{isMatch:c,score:h,indices:a}=s.searchIn(e);if(c){const s={item:e,idx:i,matches:[{score:h,value:e,norm:o,indices:a}]};t?(k(s,{ignoreFieldNorm:u}),t.shouldInsert(s.score)&&t.insert(s)):n.push(s)}})),n}_searchLogical(e){throw new Error("Logical search is not available")}_searchObjectList(e,{heap:t,ignoreFieldNorm:u}={}){const s=this._getSearcher(e),{keys:i,records:n}=this._myIndex,o=t?null:[];return n.forEach((({$:e,i:n})=>{if(!r(e))return;let c=[];if(i.forEach(((t,u)=>{c.push(...this._findMatches({key:t,value:e[u],searcher:s}))})),c.length){const s={idx:n,item:e,matches:c};t?(k(s,{ignoreFieldNorm:u}),t.shouldInsert(s.score)&&t.insert(s)):o.push(s)}})),o}_findMatches({key:t,value:u,searcher:s}){if(!r(u))return[];let i=[];if(e(u))u.forEach((({v:e,i:u,n:n})=>{if(!r(e))return;const{isMatch:o,score:c,indices:h}=s.searchIn(e);o&&i.push({score:c,key:t,value:e,idx:u,norm:n,indices:h})}));else{const{v:e,n:n}=u,{isMatch:r,score:o,indices:c}=s.searchIn(e);r&&i.push({score:o,key:t,value:e,norm:n,indices:c})}return i}}w.version="7.2.0",w.createIndex=m,w.parseIndex=function(e,{getFn:t=C.getFn,fieldNormWeight:u=C.fieldNormWeight}={}){const{keys:s,records:i}=e,n=new p({getFn:t,fieldNormWeight:u});return n.setKeys(s),n.setIndexRecords(i),n},w.config=C,w.use=function(...e){e.forEach((e=>function(...e){_.push(...e)}(e)))};export{w as default};