@kedem/okdb 2.7.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,27 +1,40 @@
1
1
  {
2
2
  "name": "@kedem/okdb",
3
- "version": "2.7.0",
3
+ "version": "3.0.0",
4
4
  "description": "A fast, type-oriented database — strong consistency and rich indexing at the core, with sync, vector embeddings, full-text search, and AI tooling built in. Designed for the AI era.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "engines": {
7
7
  "node": ">=18"
8
8
  },
9
- "main": "okdb.js",
9
+ "main": "index.js",
10
10
  "types": "./types/index.d.ts",
11
11
  "bin": {
12
- "okdb": "./bin/okdb.js"
13
- },
14
- "scripts": {
15
- "start": "node bin/okdb.js"
12
+ "okdb": "./bin/okdb"
16
13
  },
14
+ "os": [
15
+ "linux"
16
+ ],
17
+ "cpu": [
18
+ "x64"
19
+ ],
20
+ "files": [
21
+ "index.js",
22
+ "okdb-native.js",
23
+ "native-loader.js",
24
+ "native-loader.d.ts",
25
+ "bin/okdb",
26
+ "native/",
27
+ "public/",
28
+ "docs/",
29
+ "types/",
30
+ "keys/",
31
+ "README.md",
32
+ "LICENSE",
33
+ "CHANGELOG.md",
34
+ "banner.jpg"
35
+ ],
17
36
  "dependencies": {
18
- "croner": "^10.0.1",
19
- "hnswlib-node": "^3.0.0",
20
- "lmdb": "^3.5.1",
21
- "roaring": "^2.7.0",
22
- "shmbuf": "^0.1.0",
23
- "sift": "^17.1.3",
24
- "usearch": "^2.25.1",
25
- "uuid": "^11.0.3"
37
+ "msgpackr": "^1.12.1",
38
+ "sift": "^17.1.3"
26
39
  }
27
40
  }
@@ -1 +0,0 @@
1
- 'use strict';const _0x5daec5=_0x2974;(function(_0x1f53be,_0x310354){const _0x235ece=_0x2974,_0x231ebd=_0x1f53be();while(!![]){try{const _0x4394d4=-parseInt(_0x235ece(0x152))/0x1*(parseInt(_0x235ece(0x138))/0x2)+parseInt(_0x235ece(0x149))/0x3+-parseInt(_0x235ece(0x16d))/0x4*(parseInt(_0x235ece(0x148))/0x5)+-parseInt(_0x235ece(0x188))/0x6*(-parseInt(_0x235ece(0x108))/0x7)+-parseInt(_0x235ece(0x147))/0x8+parseInt(_0x235ece(0x183))/0x9+-parseInt(_0x235ece(0xef))/0xa*(-parseInt(_0x235ece(0x192))/0xb);if(_0x4394d4===_0x310354)break;else _0x231ebd['push'](_0x231ebd['shift']());}catch(_0x36c11e){_0x231ebd['push'](_0x231ebd['shift']());}}}(_0x33aa,0xb0d9c));function _0x33aa(){const _0x2f8306=['reader','snapshotEveryChanges','delete','hex','stale','Breaking\x20stale\x20snapshot\x20lock\x20(age:\x20','lock_busy','resizeIndex','openSync','snapshotMaxLagMs','number','acquire','score','efSearch','readIndexSync','buffer',').\x20','prototype','path','ceil','1586165klgsyi','.tmp-','L2sq','count','now','candidateClock\x20must\x20be\x20finite\x20>=\x200','_snapshotDir','fid','exports','message','Install\x20compatible\x20bindings\x20or\x20use\x20algorithm\x20\x22flat\x22/\x22hnsw\x22\x20instead.\x20','tombstone','info','readCurrentClock','ready','max','parse','snapshot','prune','dir','cleanupTmpDirs','fingerprintOf','isArray','nextLabel','connectivity','snapshotsDir','memoryUsage','queryVec','imul','getCurrentCount','writerLockMaxAgeMs','expansionAdd','WRITER.LOCK','tmpMaxAgeMs','keyForLabel','from','HNSW\x20algorithm\x20unavailable:\x20the\x20native\x20\x22hnswlib-node\x22\x20bindings\x20could\x20not\x20be\x20loaded\x20','changed','distances','join','labels','add','byteOffset','trim','rmSync','hnsw','snapshots','markDelete','1435160vJFYUT','mtimeMs','snapshotTo','keyToLabel','lockPath','sort','removed','loadSnapshot','filter','platform','min','fetchAll','finally','Unknown\x20op:\x20\x22','setFingerprint','6542448rObuwR','41155uYNIqz','131166LdxYZB','.tmp','growFactor','EEXIST','search','capacity','readFileSync','set','loadFrom','2BAFEFX','Original\x20error:\x20','readdirSync','isDirectory','latestSnapshotId','cause','opts','labelToKey','log','publishSnapshot','clock','default','dims','map','slice','warn','published','mkdirSync','fetchAllResult','keys','Install\x20compatible\x20bindings\x20or\x20use\x20algorithm\x20\x22flat\x22\x20instead.\x20','keyToFp','getMaxElements','vectors','cosine','length','renameSync','556dOduEe','state','index','for\x20Node\x20','vector','has','hasFingerprints','hnsw\x20algorithm\x20requires\x20dir\x20for\x20snapshot\x20storage','ENOENT','code',',\x20host:\x20','repeat','usearch\x20algorithm\x20unavailable:\x20the\x20native\x20\x22usearch\x22\x20bindings\x20could\x20not\x20be\x20loaded\x20','node','usearch','keepSnapshots','versions','resolve','key','setEf','get','labelForEphemeral','2450970VLoLRY','error','pid','catch','HierarchicalNSW','6qKeRvz','s,\x20pid:\x20','utf8','isInteger','worker_threads','arch','push','token','crypto','save','9841722bngsCs','listSnapshotIds','Cos','name','postMessage','CURRENT','clear','startsWith','maxElements','_tombstoneCount','then','remove','stop','stringify','_snapshotPaths','[SnapshotStore]','Unknown\x20algorithm:\x20\x22','writeFileSync','unlinkSync','labels.json','sqrt','flat','writer','addPoint','ScalarKind','USEARCH_BINDINGS_UNAVAILABLE','readCurrentId','heartbeatIntervalMs','state.json','closeSync','\x20on\x20','isFinite','usearch\x20algorithm\x20requires\x20dims\x20>\x200','round','added','randomBytes','reset','usearch\x20algorithm\x20requires\x20dir\x20for\x20snapshot\x20storage','algorithm','This\x20is\x20risky\x20on\x20slow\x20disks\x20or\x20overloaded\x20machines.\x20Consider\x20increasing\x20staleLockMaxAgeMs\x20if\x20this\x20happens\x20frequently.','initIndex','MetricKind','hnsw\x20algorithm\x20requires\x20dims\x20>\x200','unref','expansionSearch','unreadable','manifestVersion','size','toString','Index','version','view','currentPath','entries','viewRefreshMs','labelForExisting','efConstruction','trunc','sync','load','metric','40hClCSd','rebuild','SNAPSHOT.LOCK','call','_tmp-'];_0x33aa=function(){return _0x2f8306;};return _0x33aa();}var require$$0$1=require(_0x5daec5(0x18c)),require$$0=require('fs'),require$$1=require(_0x5daec5(0x106)),require$$2=require('os'),require$$3=require(_0x5daec5(0x190));function getDefaultExportFromCjs(_0x4e7727){const _0x84723c=_0x5daec5;return _0x4e7727&&_0x4e7727['__esModule']&&Object[_0x84723c(0x105)]['hasOwnProperty'][_0x84723c(0xf2)](_0x4e7727,_0x84723c(0x15d))?_0x4e7727[_0x84723c(0x15d)]:_0x4e7727;}var algorithmWorkerThread$1={},snapshotStore,hasRequiredSnapshotStore;function requireSnapshotStore(){const _0x550890=_0x5daec5;if(hasRequiredSnapshotStore)return snapshotStore;hasRequiredSnapshotStore=0x1;const _0x3e1b45=require$$0,_0x1fba66=require$$1,_0x271cd1=require$$2,_0x21cf16=require$$3;function _0x3a3eb0(){return Date['now']();}function _0x5f1e2a(_0x539a4a){try{return _0x3e1b45['existsSync'](_0x539a4a);}catch{return![];}}function _0x502d77(_0x513d95){const _0x375c11=_0x2974;try{return _0x3e1b45[_0x375c11(0x14f)](_0x513d95,'utf8');}catch{return null;}}function _0x3fc1bd(_0x5e4487,_0x15eae5){const _0x20ec40=_0x2974,_0x4229e6=_0x5e4487+'.tmp-'+_0x21cf16[_0x20ec40(0x1b5)](0x6)[_0x20ec40(0xe2)](_0x20ec40(0xf7));_0x3e1b45[_0x20ec40(0x1a3)](_0x4229e6,_0x15eae5),_0x3e1b45[_0x20ec40(0x16c)](_0x4229e6,_0x5e4487);}function _0x37dd65(_0x53255b,_0x2d68a8=0x10){const _0x20fb68=_0x2974,_0x4548f9=String(Math[_0x20fb68(0x117)](0x0,Math['trunc'](_0x53255b||0x0)));return _0x4548f9['length']>=_0x2d68a8?_0x4548f9:'0'[_0x20fb68(0x178)](_0x2d68a8-_0x4548f9[_0x20fb68(0x16b)])+_0x4548f9;}return snapshotStore=class _0x17cf59{constructor({dir:_0x4d79b5,keepSnapshots:keepSnapshots=0x3,log:log=null}={}){const _0x2024a1=_0x2974;if(!_0x4d79b5)throw new Error('SnapshotStore\x20requires\x20dir');this[_0x2024a1(0x11b)]=_0x4d79b5,this['snapshotsDir']=_0x1fba66[_0x2024a1(0x12f)](_0x4d79b5,_0x2024a1(0x136)),this[_0x2024a1(0xe6)]=_0x1fba66[_0x2024a1(0x12f)](_0x4d79b5,_0x2024a1(0x197)),this[_0x2024a1(0x13c)]=_0x1fba66[_0x2024a1(0x12f)](_0x4d79b5,_0x2024a1(0xf1)),this[_0x2024a1(0x17c)]=keepSnapshots,this['log']=log,_0x3e1b45[_0x2024a1(0x163)](this['dir'],{'recursive':!![]}),_0x3e1b45['mkdirSync'](this[_0x2024a1(0x121)],{'recursive':!![]});}[_0x550890(0x10e)](_0x5d8778){const _0x15ec89=_0x550890;return _0x1fba66[_0x15ec89(0x12f)](this[_0x15ec89(0x121)],_0x5d8778);}[_0x550890(0x1a0)](_0x496b90){const _0xe43bdb=_0x550890,_0x5696bc=this[_0xe43bdb(0x10e)](_0x496b90);return{'dir':_0x5696bc,'index':_0x1fba66['join'](_0x5696bc,'index.hnsw'),'labels':_0x1fba66[_0xe43bdb(0x12f)](_0x5696bc,_0xe43bdb(0x1a5)),'state':_0x1fba66[_0xe43bdb(0x12f)](_0x5696bc,'state.json')};}[_0x550890(0x1ac)](){const _0x5445af=_0x550890;if(!_0x5f1e2a(this['currentPath']))return null;const _0x226442=_0x502d77(this[_0x5445af(0xe6)]);if(!_0x226442)return null;const _0x489bac=String(_0x226442)[_0x5445af(0x133)]();return _0x489bac||null;}[_0x550890(0x115)](){const _0xfdc53c=_0x550890,_0xe7e42f=this['readCurrentId']();if(!_0xe7e42f)return 0x0;const _0x53f244=Number(_0xe7e42f);return Number[_0xfdc53c(0x1b1)](_0x53f244)?_0x53f244:0x0;}[_0x550890(0x193)](){const _0x4c541c=_0x550890;try{return _0x3e1b45[_0x4c541c(0x154)](this[_0x4c541c(0x121)],{'withFileTypes':!![]})[_0x4c541c(0x140)](_0x27e6d7=>_0x27e6d7[_0x4c541c(0x155)]())[_0x4c541c(0x15f)](_0x48adc5=>_0x48adc5[_0x4c541c(0x195)])[_0x4c541c(0x140)](_0x31f62b=>!_0x31f62b[_0x4c541c(0x199)](_0x4c541c(0x109)))[_0x4c541c(0x140)](_0x4554ff=>!_0x4554ff[_0x4c541c(0x199)](_0x4c541c(0xf3)))[_0x4c541c(0x13d)]();}catch{return[];}}[_0x550890(0x156)](){const _0x515968=_0x550890,_0x27716d=this[_0x515968(0x1ac)]();if(_0x27716d)return _0x27716d;const _0x4af4d1=this[_0x515968(0x193)]();if(!_0x4af4d1[_0x515968(0x16b)])return null;return _0x4af4d1[_0x4af4d1[_0x515968(0x16b)]-0x1];}['cleanupTmpDirs']({maxAgeMs:maxAgeMs=0x6*0x36ee80}={}){const _0x4a16cd=_0x550890;let _0x12a4a0;try{_0x12a4a0=_0x3e1b45[_0x4a16cd(0x154)](this[_0x4a16cd(0x121)],{'withFileTypes':!![]});}catch{return;}const _0x104bfc=_0x3a3eb0()-maxAgeMs;for(const _0x26d3c9 of _0x12a4a0){if(!_0x26d3c9[_0x4a16cd(0x155)]())continue;const _0x36e548=_0x26d3c9[_0x4a16cd(0x195)];if(!_0x36e548[_0x4a16cd(0x199)](_0x4a16cd(0x109))&&!_0x36e548[_0x4a16cd(0x199)]('_tmp-'))continue;const _0xe588a=_0x1fba66[_0x4a16cd(0x12f)](this['snapshotsDir'],_0x36e548);try{const _0x56df35=_0x3e1b45['statSync'](_0xe588a);if(_0x56df35[_0x4a16cd(0x139)]>_0x104bfc)continue;}catch{}try{_0x3e1b45[_0x4a16cd(0x134)](_0xe588a,{'recursive':!![],'force':!![]});}catch{}}}[_0x550890(0x11a)]({keep:keep=null}={}){const _0x1a4b0a=_0x550890,_0x32b6b1=Math[_0x1a4b0a(0x117)](0x1,Math[_0x1a4b0a(0xeb)](keep??this[_0x1a4b0a(0x17c)]??0x3)),_0x543a0f=this[_0x1a4b0a(0x193)]();if(_0x543a0f['length']<=_0x32b6b1)return;const _0x335698=this[_0x1a4b0a(0x1ac)](),_0x17b4c6=_0x543a0f[_0x1a4b0a(0x160)](0x0,Math['max'](0x0,_0x543a0f[_0x1a4b0a(0x16b)]-_0x32b6b1));for(const _0x5af7ef of _0x17b4c6){if(_0x335698&&_0x5af7ef===_0x335698)continue;const _0x3b00cb=this[_0x1a4b0a(0x10e)](_0x5af7ef);try{_0x3e1b45[_0x1a4b0a(0x134)](_0x3b00cb,{'recursive':!![],'force':!![]});}catch{}}}async[_0x550890(0x13f)](_0x1fd355,_0x39b4a6){const _0xe26c33=_0x550890;if(!_0x1fd355)throw new Error('snapshot\x20id\x20required');const _0x2d2f50=this[_0xe26c33(0x1a0)](_0x1fd355);if(!_0x5f1e2a(_0x2d2f50[_0xe26c33(0x16f)])||!_0x5f1e2a(_0x2d2f50[_0xe26c33(0x130)])||!_0x5f1e2a(_0x2d2f50['state']))throw new Error('snapshot\x20incomplete:\x20'+_0x1fd355);const _0x410cbc=await _0x39b4a6(_0x2d2f50);return _0x410cbc||{};}async[_0x550890(0x15b)](_0x10d9dd,_0x1d9074,{keep:keep=null,lockTimeoutMs:lockTimeoutMs=0x0,staleLockMaxAgeMs:staleLockMaxAgeMs=0xea60}={}){const _0x2505fd=_0x550890,_0x3487e9=Number(_0x10d9dd);if(!Number[_0x2505fd(0x1b1)](_0x3487e9)||_0x3487e9<0x0)throw new Error(_0x2505fd(0x10d));const _0x2b07b0=_0x37dd65(_0x3487e9),_0x2d501e=this['_snapshotDir'](_0x2b07b0),_0x253c56=_0x1fba66[_0x2505fd(0x12f)](this[_0x2505fd(0x121)],_0x2505fd(0x109)+_0x2b07b0+'-'+_0x21cf16[_0x2505fd(0x1b5)](0x6)[_0x2505fd(0xe2)](_0x2505fd(0xf7)));_0x3e1b45[_0x2505fd(0x163)](_0x253c56,{'recursive':!![]});const _0x25d10b={'dir':_0x253c56,'index':_0x1fba66[_0x2505fd(0x12f)](_0x253c56,'index.hnsw'),'labels':_0x1fba66['join'](_0x253c56,_0x2505fd(0x1a5)),'state':_0x1fba66[_0x2505fd(0x12f)](_0x253c56,_0x2505fd(0x1ae))};await _0x1d9074(_0x25d10b,{'id':_0x2b07b0,'clock':_0x3487e9});const _0x3a7897=JSON[_0x2505fd(0x19f)]({'pid':process[_0x2505fd(0x185)],'host':_0x271cd1['hostname'](),'at':_0x3a3eb0()}),_0x266c93=_0x3a3eb0();let _0x438938=null;const _0x2f970e=()=>{const _0x1a18d2=_0x2505fd;try{const _0x101a7a=JSON[_0x1a18d2(0x118)](_0x3e1b45[_0x1a18d2(0x14f)](this[_0x1a18d2(0x13c)],_0x1a18d2(0x18a)));if(_0x101a7a['at']&&_0x3a3eb0()-_0x101a7a['at']>staleLockMaxAgeMs){const _0x54ec98=_0x3a3eb0()-_0x101a7a['at'],_0x28b599=_0x1a18d2(0xf9)+Math[_0x1a18d2(0x1b3)](_0x54ec98/0x3e8)+_0x1a18d2(0x189)+_0x101a7a[_0x1a18d2(0x185)]+_0x1a18d2(0x177)+_0x101a7a['host']+_0x1a18d2(0x104)+_0x1a18d2(0xd9);this[_0x1a18d2(0x15a)]?.[_0x1a18d2(0x161)]?this[_0x1a18d2(0x15a)]['warn'](_0x28b599):console[_0x1a18d2(0x161)](_0x1a18d2(0x1a1),_0x28b599);try{_0x3e1b45[_0x1a18d2(0x1a4)](this['lockPath']);}catch{}return!![];}}catch{try{_0x3e1b45[_0x1a18d2(0x1a4)](this['lockPath']);}catch{}}return![];},_0x5232ad=()=>{const _0x1dc581=_0x2505fd;try{return _0x438938=_0x3e1b45[_0x1dc581(0xfc)](this[_0x1dc581(0x13c)],'wx'),_0x3e1b45['writeFileSync'](_0x438938,_0x3a7897),!![];}catch(_0xe34107){if(_0xe34107&&_0xe34107[_0x1dc581(0x176)]===_0x1dc581(0x14c))return![];throw _0xe34107;}};if(!_0x5232ad()){_0x2f970e(),_0x5232ad();if(_0x438938==null&&lockTimeoutMs>0x0)while(_0x3a3eb0()-_0x266c93<lockTimeoutMs){await new Promise(_0x5c7740=>setTimeout(_0x5c7740,0x19));if(_0x5232ad())break;_0x2f970e();}}if(_0x438938==null){try{_0x3e1b45[_0x2505fd(0x134)](_0x253c56,{'recursive':!![],'force':!![]});}catch{}return{'published':![],'reason':_0x2505fd(0xfa)};}try{const _0x34ad91=this['readCurrentClock']();if(_0x3487e9<=_0x34ad91){try{_0x3e1b45[_0x2505fd(0x134)](_0x253c56,{'recursive':!![],'force':!![]});}catch{}return{'published':![],'reason':_0x2505fd(0xf8),'currentClock':_0x34ad91};}if(!_0x5f1e2a(_0x2d501e))_0x3e1b45[_0x2505fd(0x16c)](_0x253c56,_0x2d501e);else try{_0x3e1b45[_0x2505fd(0x134)](_0x253c56,{'recursive':!![],'force':!![]});}catch{}return _0x3fc1bd(this['currentPath'],_0x2b07b0+'\x0a'),this[_0x2505fd(0x11a)]({'keep':keep}),{'published':!![],'currentClock':_0x3487e9};}finally{try{_0x3e1b45['closeSync'](_0x438938);}catch{}try{_0x3e1b45['unlinkSync'](this[_0x2505fd(0x13c)]);}catch{}}}},snapshotStore;}var labelMap,hasRequiredLabelMap;function requireLabelMap(){const _0x870146=_0x5daec5;if(hasRequiredLabelMap)return labelMap;hasRequiredLabelMap=0x1;const _0x5b8a37=require$$0;class _0x17198b{constructor(){const _0x58ef67=_0x2974;this[_0x58ef67(0x13b)]=new Map(),this[_0x58ef67(0x159)]=new Map(),this['nextLabel']=0x0,this[_0x58ef67(0x19b)]=0x0,this['keyToFp']=new Map(),this['hasFingerprints']=!![];}async[_0x870146(0x1b6)](){const _0x34f3bb=_0x870146;this['keyToLabel']=new Map(),this[_0x34f3bb(0x159)]=new Map(),this['keyToFp']=new Map(),this[_0x34f3bb(0x173)]=!![],this['nextLabel']=0x0,this[_0x34f3bb(0x19b)]=0x0;}async[_0x870146(0x151)](_0x2eab52){const _0x274122=_0x870146;if(!_0x2eab52||!_0x5b8a37['existsSync'](_0x2eab52))return await this[_0x274122(0x1b6)](),!![];let _0x45f013;try{_0x45f013=_0x5b8a37[_0x274122(0x14f)](_0x2eab52,_0x274122(0x18a));}catch{return await this[_0x274122(0x1b6)](),!![];}let _0x5c9986;try{_0x5c9986=JSON[_0x274122(0x118)](_0x45f013);}catch{return await this[_0x274122(0x1b6)](),!![];}const _0x38cde7=Array[_0x274122(0x11e)](_0x5c9986?.[_0x274122(0xe7)])?_0x5c9986[_0x274122(0xe7)]:[],_0x35835a=Number[_0x274122(0x18b)](_0x5c9986?.['nextLabel'])?_0x5c9986[_0x274122(0x11f)]:0x0,_0x1b6162=new Map(),_0x341dbc=new Map(),_0x27dbe1=new Map(),_0x5b1f92=_0x5c9986?.[_0x274122(0xe4)]>=0x2;let _0x410bbd=-0x1;for(const _0x2c778c of _0x38cde7){if(!Array[_0x274122(0x11e)](_0x2c778c)||_0x2c778c[_0x274122(0x16b)]<0x2)continue;const _0x29e679=Number(_0x2c778c[0x0]),_0x201d79=String(_0x2c778c[0x1]??'');if(!Number[_0x274122(0x18b)](_0x29e679)||_0x29e679<0x0)continue;if(!_0x201d79)continue;_0x1b6162[_0x274122(0x150)](_0x201d79,_0x29e679),_0x341dbc[_0x274122(0x150)](_0x29e679,_0x201d79);if(_0x5b1f92&&typeof _0x2c778c[0x2]===_0x274122(0xfe))_0x27dbe1[_0x274122(0x150)](_0x201d79,_0x2c778c[0x2]);if(_0x29e679>_0x410bbd)_0x410bbd=_0x29e679;}return this[_0x274122(0x13b)]=_0x1b6162,this['labelToKey']=_0x341dbc,this['keyToFp']=_0x27dbe1,this[_0x274122(0x173)]=_0x5b1f92,this['nextLabel']=Math['max'](_0x35835a,_0x410bbd+0x1,0x0),this[_0x274122(0x19b)]=0x0,!![];}[_0x870146(0xe9)](_0x506461){return this['keyToLabel']['get'](_0x506461);}[_0x870146(0x182)](_0x94a4f9){const _0x2101a=_0x870146;let _0xe0e778=this[_0x2101a(0x13b)]['get'](_0x94a4f9);if(_0xe0e778!==undefined)return _0xe0e778;return _0xe0e778=this[_0x2101a(0x11f)]++,this[_0x2101a(0x13b)][_0x2101a(0x150)](_0x94a4f9,_0xe0e778),this[_0x2101a(0x159)]['set'](_0xe0e778,_0x94a4f9),_0xe0e778;}[_0x870146(0x146)](_0x11d1b0,_0x89324){const _0x376391=_0x870146;if(_0x89324==null)this[_0x376391(0x167)][_0x376391(0xf6)](_0x11d1b0);else this[_0x376391(0x167)][_0x376391(0x150)](_0x11d1b0,_0x89324);}[_0x870146(0x11d)](_0x34b277){const _0x116076=_0x870146;return this[_0x116076(0x167)][_0x116076(0x181)](_0x34b277);}['keys'](){const _0x1c02e1=_0x870146;return this[_0x1c02e1(0x13b)][_0x1c02e1(0x165)]();}[_0x870146(0x113)](_0x47a565){const _0x24b942=_0x870146,_0xb9d924=this['keyToLabel']['get'](_0x47a565);if(_0xb9d924===undefined)return;this[_0x24b942(0x167)][_0x24b942(0xf6)](_0x47a565),this[_0x24b942(0x13b)][_0x24b942(0xf6)](_0x47a565),this['labelToKey'][_0x24b942(0xf6)](_0xb9d924),this['_tombstoneCount']++;}[_0x870146(0x12a)](_0x22973e){const _0x4d6c2f=_0x870146;return this[_0x4d6c2f(0x159)][_0x4d6c2f(0x181)](_0x22973e)??null;}[_0x870146(0xe1)](){const _0x3f8e69=_0x870146;return this['keyToLabel'][_0x3f8e69(0xe1)];}['tombstoneCount'](){const _0x39105d=_0x870146;return this[_0x39105d(0x19b)];}async[_0x870146(0x13a)](_0x1c6774){const _0x43baed=_0x870146,_0x5c15ee=_0x1c6774+_0x43baed(0x14a),_0x195402=[];for(const [_0x39ee40,_0x23f945]of this[_0x43baed(0x159)]['entries']()){const _0x52f191=this[_0x43baed(0x167)][_0x43baed(0x181)](_0x23f945);_0x195402[_0x43baed(0x18e)](_0x52f191==null?[_0x39ee40,_0x23f945]:[_0x39ee40,_0x23f945,_0x52f191]);}_0x195402[_0x43baed(0x13d)]((_0x48f449,_0x532ff4)=>_0x48f449[0x0]-_0x532ff4[0x0]);const _0x50e63c={'version':0x2,'nextLabel':this['nextLabel'],'entries':_0x195402};_0x5b8a37['writeFileSync'](_0x5c15ee,JSON[_0x43baed(0x19f)](_0x50e63c)),_0x5b8a37[_0x43baed(0x16c)](_0x5c15ee,_0x1c6774);}}return labelMap=_0x17198b,labelMap;}var indexConvergence,hasRequiredIndexConvergence;function _0x2974(_0x46cd69,_0x5e75f2){_0x46cd69=_0x46cd69-0xd7;const _0x33aaf8=_0x33aa();let _0x2974fa=_0x33aaf8[_0x46cd69];return _0x2974fa;}function requireIndexConvergence(){if(hasRequiredIndexConvergence)return indexConvergence;hasRequiredIndexConvergence=0x1;function _0x57342e(_0x2caaaf){const _0x4b7ffd=_0x2974,_0xdabd99=new Uint32Array(_0x2caaaf[_0x4b7ffd(0x103)],_0x2caaaf[_0x4b7ffd(0x132)],_0x2caaaf[_0x4b7ffd(0x16b)]);let _0x1b6edb=0x811c9dc5,_0x568fe8=0x9747b28c;for(let _0x5d1d58=0x0;_0x5d1d58<_0xdabd99[_0x4b7ffd(0x16b)];_0x5d1d58++){const _0x50324f=_0xdabd99[_0x5d1d58];_0x1b6edb=Math[_0x4b7ffd(0x124)](_0x1b6edb^_0x50324f,0x1000193)>>>0x0;let _0x21f3a0=Math[_0x4b7ffd(0x124)](_0x50324f,0xcc9e2d51);_0x21f3a0=_0x21f3a0<<0xf|_0x21f3a0>>>0x11,_0x568fe8=Math['imul'](_0x568fe8^Math[_0x4b7ffd(0x124)](_0x21f3a0,0x1b873593),0x5)+0xe6546b64,_0x568fe8>>>=0x0;}return _0x568fe8=Math[_0x4b7ffd(0x124)](_0x568fe8^_0x568fe8>>>0x10,0x85ebca6b)>>>0x0,(_0x1b6edb>>>0x0)*0x100000+(_0x568fe8&0xfffff);}function _0x2d1b11(_0x1ba946,_0x39d02e,_0x2d7877,{upsert:_0x2a2cc9,remove:_0x58b15b}){const _0x2cec0d=_0x2974,_0xadbfc5=new Set();let _0x2c7b7b=0x0,_0x4c8340=0x0,_0x5278f2=0x0;for(const {key:_0x5e94c3,vector:_0x2f8b0a}of _0x39d02e){if(!(_0x2f8b0a instanceof Float32Array)||_0x2f8b0a['length']!==_0x2d7877)continue;_0xadbfc5[_0x2cec0d(0x131)](_0x5e94c3);const _0x53eb38=_0x57342e(_0x2f8b0a),_0x1f6f2b=_0x1ba946[_0x2cec0d(0xe9)](_0x5e94c3)!==undefined;if(_0x1f6f2b&&_0x1ba946[_0x2cec0d(0x11d)](_0x5e94c3)===_0x53eb38)continue;_0x2a2cc9(_0x5e94c3,_0x2f8b0a,_0x53eb38);if(_0x1f6f2b)_0x4c8340++;else _0x2c7b7b++;}for(const _0x9a73dd of[..._0x1ba946[_0x2cec0d(0x165)]()]){if(_0xadbfc5[_0x2cec0d(0x172)](_0x9a73dd))continue;_0x58b15b(_0x9a73dd),_0x5278f2++;}return{'added':_0x2c7b7b,'changed':_0x4c8340,'removed':_0x5278f2};}return indexConvergence={'fingerprint':_0x57342e,'reconcileIndex':_0x2d1b11},indexConvergence;}var hnsw,hasRequiredHnsw;function requireHnsw(){if(hasRequiredHnsw)return hnsw;hasRequiredHnsw=0x1;const _0x3baeeb=requireSnapshotStore(),_0x64cb63=requireLabelMap(),{fingerprint:_0xeafc1b,reconcileIndex:_0x13d4fb}=requireIndexConvergence(),_0x283e66=0x1;let _0x389be1=null;function _0x25100a(){const _0x3b283a=_0x2974;if(_0x389be1)return _0x389be1;try{return _0x389be1=require('hnswlib-node'),_0x389be1;}catch(_0x324560){const _0x9a19af=new Error(_0x3b283a(0x12c)+(_0x3b283a(0x170)+process[_0x3b283a(0x17d)][_0x3b283a(0x17a)]+_0x3b283a(0x1b0)+process[_0x3b283a(0x141)]+'/'+process[_0x3b283a(0x18d)]+'.\x20')+_0x3b283a(0x166)+(_0x3b283a(0x153)+(_0x324560?.[_0x3b283a(0x111)]||String(_0x324560))));_0x9a19af['code']='HNSW_BINDINGS_UNAVAILABLE',_0x9a19af[_0x3b283a(0x157)]=_0x324560;throw _0x9a19af;}}return hnsw=function _0x568bb8(_0xea29ff={},{dims:_0x1a01be,dir:_0x2767a0}){const _0x4ef598=_0x2974,_0x16974e=_0x25100a();if(!_0x1a01be||_0x1a01be<=0x0)throw new Error(_0x4ef598(0xdc));if(!_0x2767a0)throw new Error(_0x4ef598(0x174));const _0xbfaf8e={'metric':_0xea29ff[_0x4ef598(0xee)]??'cosine','M':_0xea29ff['M']??0x10,'efConstruction':_0xea29ff[_0x4ef598(0xea)]??0xc8,'efSearch':_0xea29ff[_0x4ef598(0x101)]??0x40,'maxElements':_0xea29ff[_0x4ef598(0x19a)]??0x400,'growFactor':_0xea29ff[_0x4ef598(0x14b)]??0x2,'snapshotEveryChanges':_0xea29ff[_0x4ef598(0xf5)]??0xc350,'keepSnapshots':_0xea29ff[_0x4ef598(0x17c)]??0x2,'tmpMaxAgeMs':_0xea29ff[_0x4ef598(0x129)]??0x6*0x36ee80},_0x3c8c13=new _0x3baeeb({'dir':_0x2767a0,'keepSnapshots':_0xbfaf8e[_0x4ef598(0x17c)]}),_0x49d806=new _0x64cb63();let _0x4c3368=null,_0x8d3554=0x0,_0xc6741d=null,_0x5f5af5=Promise['resolve']();const _0x2a9478=_0x33b643=>{const _0x421960=_0x4ef598,_0x2052a6=_0x5f5af5['then'](_0x33b643);return _0x5f5af5=_0x2052a6[_0x421960(0x186)](()=>{}),_0x2052a6;};async function _0x44c261(_0xfdc232){const _0x341200=_0x4ef598;await _0x49d806[_0x341200(0x1b6)](),_0xfdc232=_0xfdc232??[];const _0x14abd2=Math['max'](_0xbfaf8e[_0x341200(0x19a)],Math['ceil'](_0xfdc232['length']*(_0xbfaf8e[_0x341200(0x14b)]||1.2)),0x1);_0x4c3368=new _0x16974e[(_0x341200(0x187))](_0xbfaf8e[_0x341200(0xee)],_0x1a01be),_0x4c3368[_0x341200(0xda)]({'maxElements':_0x14abd2,'efConstruction':_0xbfaf8e['efConstruction'],'M':_0xbfaf8e['M']});for(const {key:_0x38228c,vector:_0x2b742c}of _0xfdc232){if(!(_0x2b742c instanceof Float32Array)||_0x2b742c['length']!==_0x1a01be)continue;_0x4c6eaa(_0x38228c,_0x2b742c);}_0x4c3368[_0x341200(0x180)](_0xbfaf8e[_0x341200(0x101)]),_0x8d3554=0x0;}async function _0xb120bb(_0x259055){return _0x44c261(_0x259055?await _0x259055():[]);}function _0x4c2435(){const _0x2d2092=_0x4ef598;if(_0x4c3368[_0x2d2092(0x125)]()<_0x4c3368[_0x2d2092(0x168)]())return;const _0x5bd8de=Math[_0x2d2092(0x107)](_0x4c3368[_0x2d2092(0x168)]()*(_0xbfaf8e['growFactor']||0x2));_0x4c3368[_0x2d2092(0xfb)](_0x5bd8de),_0xbfaf8e['maxElements']=_0x5bd8de;}function _0x4c6eaa(_0xba48e0,_0x463eb5,_0x2eedad){const _0x5de62d=_0x4ef598,_0x37ad07=_0x49d806['labelForEphemeral'](_0xba48e0);try{_0x4c3368[_0x5de62d(0x137)](_0x37ad07);}catch{}_0x4c2435(),_0x4c3368[_0x5de62d(0x1a9)](Array[_0x5de62d(0x12b)](_0x463eb5),_0x37ad07),_0x49d806[_0x5de62d(0x146)](_0xba48e0,_0x2eedad??_0xeafc1b(_0x463eb5));}function _0x52816a(_0xcc2671){const _0x5742e6=_0x4ef598,_0xdabe95=_0x49d806[_0x5742e6(0xe9)](_0xcc2671);if(_0xdabe95===undefined)return![];try{_0x4c3368[_0x5742e6(0x137)](_0xdabe95);}catch{}return _0x49d806[_0x5742e6(0x113)](_0xcc2671),!![];}function _0x4a26dd(){const _0x477bd2=_0x4ef598;return Math[_0x477bd2(0x117)](Date[_0x477bd2(0x10c)](),_0x3c8c13[_0x477bd2(0x115)]()+0x1);}async function _0x57fd3f(_0x222af5){const _0xbe2e4d=_0x4ef598;if(!_0x4c3368||!_0x222af5)return![];const _0x5e08ef=await _0x3c8c13[_0xbe2e4d(0x15b)](_0x222af5,async _0x4ea3f2=>{const _0x41ae1d=_0xbe2e4d;_0x4c3368['writeIndexSync'](_0x4ea3f2[_0x41ae1d(0x16f)]),await _0x49d806['snapshotTo'](_0x4ea3f2[_0x41ae1d(0x130)]);const _0x34cb58=require$$0;_0x34cb58[_0x41ae1d(0x1a3)](_0x4ea3f2[_0x41ae1d(0x16e)],JSON['stringify']({'manifestVersion':_0x283e66,'dims':_0x1a01be,'metric':_0xbfaf8e[_0x41ae1d(0xee)],'clock':_0x222af5,'snapshotAt':Date[_0x41ae1d(0x10c)]()},null,0x2));},{'keep':_0xbfaf8e[_0xbe2e4d(0x17c)]});if(_0x5e08ef?.[_0xbe2e4d(0x162)])_0x8d3554=0x0;return _0x5e08ef?.['published']??![];}async function _0x2204ce(){const _0x1875bc=_0x4ef598,_0x52e45c=_0x3c8c13['readCurrentId']()||_0x3c8c13[_0x1875bc(0x156)]();if(!_0x52e45c)return null;let _0x15b925,_0x2fe5=![];return await _0x3c8c13[_0x1875bc(0x13f)](_0x52e45c,async _0x5d9123=>{const _0x17ee7e=_0x1875bc,_0x5ca186=require$$0;_0x15b925=JSON[_0x17ee7e(0x118)](_0x5ca186[_0x17ee7e(0x14f)](_0x5d9123['state'],'utf8'));if(_0x15b925[_0x17ee7e(0xe0)]!==_0x283e66||_0x15b925[_0x17ee7e(0x15e)]!==_0x1a01be||_0x15b925[_0x17ee7e(0xee)]!==_0xbfaf8e['metric']){_0x15b925=null;return;}await _0x49d806[_0x17ee7e(0x151)](_0x5d9123['labels']),_0x4c3368=new _0x16974e[(_0x17ee7e(0x187))](_0xbfaf8e[_0x17ee7e(0xee)],_0x1a01be),_0x4c3368[_0x17ee7e(0x102)](_0x5d9123['index']),_0x4c3368[_0x17ee7e(0x180)](_0xbfaf8e[_0x17ee7e(0x101)]),_0x2fe5=!![];}),_0x2fe5?_0x15b925?.['clock']??0x0:null;}return{async 'load'(_0x33c9c0){return _0x2a9478(async()=>{const _0x4161ad=_0x2974;_0x3c8c13[_0x4161ad(0x11c)]({'maxAgeMs':_0xbfaf8e['tmpMaxAgeMs']}),_0xc6741d=_0x33c9c0??null;const _0x196592=await _0x2204ce(),_0x182872=_0x33c9c0?await _0x33c9c0():null;if(_0x196592!=null){if(_0x182872){if(!_0x49d806[_0x4161ad(0x173)])return await _0x44c261(_0x182872),null;const _0x35c9ad=_0x13d4fb(_0x49d806,_0x182872,_0x1a01be,{'upsert':_0x4c6eaa,'remove':_0x52816a});_0x8d3554+=_0x35c9ad[_0x4161ad(0x1b4)]+_0x35c9ad[_0x4161ad(0x12d)]+_0x35c9ad[_0x4161ad(0x13e)];}return _0x196592;}return await _0x44c261(_0x182872),null;});},async 'add'(_0x922a7e,_0x5bb971,_0x8215ca){return _0x2a9478(async()=>{const _0x23b9b2=_0x2974;if(!_0x4c3368)return;const _0x53031b=_0x5bb971 instanceof Float32Array?_0x5bb971:new Float32Array(_0x5bb971),_0x1734f2=_0xeafc1b(_0x53031b);if(_0x49d806['fingerprintOf'](_0x922a7e)===_0x1734f2)return;_0x4c6eaa(_0x922a7e,_0x53031b,_0x1734f2),_0x8d3554++,_0x8d3554>=_0xbfaf8e[_0x23b9b2(0xf5)]&&await _0x57fd3f(_0x4a26dd());});},async 'remove'(_0x34db06){return _0x2a9478(async()=>{if(!_0x4c3368)return;if(_0x52816a(_0x34db06))_0x8d3554++;});},'search'(_0x48ca68,{limit:limit=0xa,efSearch:_0x33c4cc}={}){const _0x5c0e0f=_0x4ef598;if(!_0x4c3368)return[];if(Number[_0x5c0e0f(0x18b)](_0x33c4cc))_0x4c3368['setEf'](_0x33c4cc);const _0x41c4d7=Math['min'](limit,_0x4c3368[_0x5c0e0f(0x125)]()||0x1),{neighbors:_0xfd7ff0,distances:_0x14f9ae}=_0x4c3368['searchKnn'](Array['from'](_0x48ca68),_0x41c4d7),_0x4f1dcb=[];for(let _0x2bf9b3=0x0;_0x2bf9b3<_0xfd7ff0[_0x5c0e0f(0x16b)];_0x2bf9b3++){const _0xfd8389=_0x49d806[_0x5c0e0f(0x12a)](_0xfd7ff0[_0x2bf9b3]);if(!_0xfd8389)continue;const _0x12e931=_0xbfaf8e['metric']===_0x5c0e0f(0x16a)?Math['max'](0x0,0x1-_0x14f9ae[_0x2bf9b3]):0x1/(0x1+_0x14f9ae[_0x2bf9b3]);_0x4f1dcb['push']({'key':_0xfd8389,'score':_0x12e931});}return _0x4f1dcb;},async 'snapshot'(_0x4d7ef1){return _0x2a9478(()=>_0x57fd3f(_0x4d7ef1??_0x4a26dd()));},async 'rebuild'(_0x530fc8){return _0x2a9478(()=>{if(_0x530fc8!=null)_0xc6741d=_0x530fc8;return _0xb120bb(_0x530fc8??_0xc6741d);});},async 'stop'(){const _0x42cae4=_0x4ef598;return _0x2a9478(()=>_0x8d3554>0x0||!_0x3c8c13[_0x42cae4(0x1ac)]()?_0x57fd3f(_0x4a26dd()):![]);},'count'(){const _0x416471=_0x4ef598;return _0x49d806[_0x416471(0xe1)]();},'info'(){const _0x56f030=_0x4ef598;return{'algorithm':_0x56f030(0x135),'metric':_0xbfaf8e[_0x56f030(0xee)],'M':_0xbfaf8e['M'],'efConstruction':_0xbfaf8e[_0x56f030(0xea)],'efSearch':_0xbfaf8e[_0x56f030(0x101)],'maxElements':_0x4c3368?.[_0x56f030(0x168)]()??_0xbfaf8e[_0x56f030(0x19a)],'count':_0x49d806[_0x56f030(0xe1)](),'changesSince':_0x8d3554,'snapshotDir':_0x2767a0,'latestSnapshot':_0x3c8c13['readCurrentId']()??null};}};},hnsw;}var flat,hasRequiredFlat;function requireFlat(){if(hasRequiredFlat)return flat;hasRequiredFlat=0x1,flat=function _0x2b1f48(_0xb73a0a={}){const _0x39a050=new Map();return{async 'load'(_0x22f62c){const _0x2637c4=_0x2974;_0x39a050[_0x2637c4(0x198)]();if(_0x22f62c)for(const {key:_0x4d48e6,vector:_0x58d532}of await _0x22f62c()){_0x39a050['set'](_0x4d48e6,_0x58d532);}},async 'add'(_0x5c39d3,_0x4847d7,_0x3dfc92){_0x39a050['set'](_0x5c39d3,_0x4847d7);},async 'remove'(_0x4080f5){const _0x5b5542=_0x2974;_0x39a050[_0x5b5542(0xf6)](_0x4080f5);},'search'(_0x48b546,{limit:limit=0xa,threshold:threshold=0x0}={}){const _0x55eb9e=_0x2974,_0x2450ab=[];for(const [_0x53517c,_0xdec5d7]of _0x39a050){const _0x19c562=_0x35201a(_0x48b546,_0xdec5d7);if(_0x19c562>=threshold)_0x2450ab['push']({'key':_0x53517c,'score':_0x19c562});}return _0x2450ab[_0x55eb9e(0x13d)]((_0x8874ac,_0x374f25)=>_0x374f25['score']-_0x8874ac[_0x55eb9e(0x100)]),_0x2450ab[_0x55eb9e(0x160)](0x0,limit);},async 'snapshot'(){return![];},async 'rebuild'(_0x2790be){const _0x323eb4=_0x2974;await this[_0x323eb4(0xed)](_0x2790be);},async 'stop'(){},'count'(){return _0x39a050['size'];},'info'(){const _0x4c7a7c=_0x2974;return{'algorithm':_0x4c7a7c(0x1a7),'count':_0x39a050['size']};}};};function _0x35201a(_0x3a6542,_0x3202f1){const _0x21e59d=_0x2974;let _0x29a01f=0x0,_0x4995e0=0x0,_0x5b3d23=0x0;for(let _0x4cd2bd=0x0;_0x4cd2bd<_0x3a6542[_0x21e59d(0x16b)];_0x4cd2bd++){_0x29a01f+=_0x3a6542[_0x4cd2bd]*_0x3202f1[_0x4cd2bd],_0x4995e0+=_0x3a6542[_0x4cd2bd]*_0x3a6542[_0x4cd2bd],_0x5b3d23+=_0x3202f1[_0x4cd2bd]*_0x3202f1[_0x4cd2bd];}const _0x5a854a=Math[_0x21e59d(0x1a6)](_0x4995e0)*Math[_0x21e59d(0x1a6)](_0x5b3d23);return _0x5a854a===0x0?0x0:_0x29a01f/_0x5a854a;}return flat;}var okdbTimers,hasRequiredOkdbTimers;function requireOkdbTimers(){if(hasRequiredOkdbTimers)return okdbTimers;hasRequiredOkdbTimers=0x1;const _0x5bba48=0x2**0x1f-0x1;function _0x163ce2(_0x28bbca){if(!(_0x28bbca>0x0))return 0x0;return _0x28bbca>_0x5bba48?_0x5bba48:_0x28bbca;}function _0x33d3d6(_0x3ca00d){return _0x3ca00d===Infinity;}return okdbTimers={'MAX_TIMER_DELAY':_0x5bba48,'clampTimerDelay':_0x163ce2,'isNeverDelay':_0x33d3d6},okdbTimers;}var writerLock,hasRequiredWriterLock;function requireWriterLock(){if(hasRequiredWriterLock)return writerLock;hasRequiredWriterLock=0x1;const _0x26cf4a=require$$0,{clampTimerDelay:_0x51cac1}=requireOkdbTimers(),_0x48c3e7=require$$1,_0x1dcb64=require$$3;return writerLock=function _0x5830c1(_0x485dbf,{maxAgeMs:maxAgeMs=0x3a98,heartbeatMs:heartbeatMs=0x1388,onLost:onLost=null}={}){const _0x135c9b=_0x2974,_0x3c06c9=_0x48c3e7['join'](_0x485dbf,_0x135c9b(0x128)),_0x5d8e7d=_0x1dcb64[_0x135c9b(0x1b5)](0x8)['toString']('hex');let _0x59d76b=![],_0x19ed1f=null;const _0x13db9e=()=>JSON['stringify']({'pid':process[_0x135c9b(0x185)],'token':_0x5d8e7d,'at':Date[_0x135c9b(0x10c)]()});function _0x328231(){const _0x34143d=_0x135c9b;try{return JSON[_0x34143d(0x118)](_0x26cf4a['readFileSync'](_0x3c06c9,'utf8'));}catch(_0x5011fa){return _0x5011fa?.[_0x34143d(0x176)]===_0x34143d(0x175)?null:{'unreadable':!![]};}}function _0x470119(){const _0x3741e6=_0x135c9b;try{const _0x12bedd=_0x26cf4a['openSync'](_0x3c06c9,'wx');try{_0x26cf4a['writeFileSync'](_0x12bedd,_0x13db9e());}finally{_0x26cf4a[_0x3741e6(0x1af)](_0x12bedd);}return!![];}catch(_0x319e6e){if(_0x319e6e?.['code']===_0x3741e6(0x14c))return![];throw _0x319e6e;}}function _0x5d2cf1(_0x3c2bf8){const _0x4a179b=_0x135c9b;if(!_0x3c2bf8)return!![];if(_0x3c2bf8[_0x4a179b(0xdf)])return!![];return Date[_0x4a179b(0x10c)]()-(_0x3c2bf8['at']??0x0)>=maxAgeMs;}function _0x323664(){if(_0x19ed1f)clearInterval(_0x19ed1f);_0x19ed1f=null;}function _0x296b05(){const _0x4b330d=_0x135c9b;_0x323664(),_0x19ed1f=setInterval(()=>{const _0x560967=_0x2974,_0x5ec179=_0x328231();if(_0x5ec179&&!_0x5ec179[_0x560967(0xdf)]&&_0x5ec179[_0x560967(0x18f)]!==_0x5d8e7d){_0x59d76b=![],_0x323664();try{onLost?.();}catch{}return;}try{_0x26cf4a[_0x560967(0x1a3)](_0x3c06c9,_0x13db9e());}catch{}},_0x51cac1(heartbeatMs)),_0x19ed1f[_0x4b330d(0xdd)]?.();}function _0x340102(){const _0x3bd305=_0x135c9b,_0x5b81ce=_0x328231();return!!_0x5b81ce&&_0x5b81ce[_0x3bd305(0x18f)]===_0x5d8e7d;}return{'path':_0x3c06c9,'token':_0x5d8e7d,'acquire'(){const _0xcedabf=_0x135c9b,_0x14fa82=_0x328231();if(_0x14fa82&&_0x14fa82[_0xcedabf(0x18f)]===_0x5d8e7d){_0x59d76b=!![];if(!_0x19ed1f)_0x296b05();return!![];}let _0x1ddc85=_0x470119();if(!_0x1ddc85&&_0x5d2cf1(_0x328231())){try{_0x26cf4a['unlinkSync'](_0x3c06c9);}catch{}_0x1ddc85=_0x470119();}if(_0x1ddc85&&!_0x340102())_0x1ddc85=![];_0x59d76b=_0x1ddc85;if(_0x1ddc85)_0x296b05();return _0x1ddc85;},'held'(){return _0x59d76b;},'isFree'(){const _0x5ad660=_0x135c9b,_0x449fcf=_0x328231();if(_0x449fcf&&_0x449fcf[_0x5ad660(0x18f)]===_0x5d8e7d)return![];return _0x5d2cf1(_0x449fcf);},'release'(){const _0x46a18a=_0x135c9b;_0x323664();if(!_0x59d76b)return;_0x59d76b=![];if(_0x340102())try{_0x26cf4a[_0x46a18a(0x1a4)](_0x3c06c9);}catch{}}};},writerLock;}var usearch,hasRequiredUsearch;function requireUsearch(){if(hasRequiredUsearch)return usearch;hasRequiredUsearch=0x1;const _0x2307a7=require$$0,{clampTimerDelay:_0x20c5ce,isNeverDelay:_0x307751}=requireOkdbTimers(),_0x6baf45=requireSnapshotStore(),_0x3b4c4c=requireLabelMap(),_0x489107=requireWriterLock(),{fingerprint:_0x5ae507,reconcileIndex:_0xe0f2af}=requireIndexConvergence(),_0x44da32=0x1;let _0x38ef80=null;function _0x5f429c(){const _0x3580b1=_0x2974;if(_0x38ef80)return _0x38ef80;try{return _0x38ef80=require(_0x3580b1(0x17b)),_0x38ef80;}catch(_0x5c60c9){const _0x1dbd0c=new Error(_0x3580b1(0x179)+(_0x3580b1(0x170)+process[_0x3580b1(0x17d)][_0x3580b1(0x17a)]+_0x3580b1(0x1b0)+process[_0x3580b1(0x141)]+'/'+process[_0x3580b1(0x18d)]+'.\x20')+_0x3580b1(0x112)+(_0x3580b1(0x153)+(_0x5c60c9?.[_0x3580b1(0x111)]||String(_0x5c60c9))));_0x1dbd0c[_0x3580b1(0x176)]=_0x3580b1(0x1ab),_0x1dbd0c[_0x3580b1(0x157)]=_0x5c60c9;throw _0x1dbd0c;}}function _0x36a102(_0x3a210d,_0x4655c8){const _0x80d02=_0x2974;switch(_0x3a210d){case _0x80d02(0x16a):return _0x4655c8[_0x80d02(0xdb)]['Cos'];case'l2':return _0x4655c8[_0x80d02(0xdb)][_0x80d02(0x10a)];case'ip':return _0x4655c8['MetricKind']['IP'];default:return _0x4655c8[_0x80d02(0xdb)][_0x80d02(0x194)];}}return usearch=function _0x4cfa17(_0x2648bf={},{dims:_0xf45727,dir:_0x37f291,fetchAll:fetchAll=null,onChange:onChange=null}={}){const _0x11bdc9=_0x2974,_0x13f47e=_0x5f429c();if(!_0xf45727||_0xf45727<=0x0)throw new Error(_0x11bdc9(0x1b2));if(!_0x37f291)throw new Error(_0x11bdc9(0xd7));const _0xbe52d2={'metric':_0x2648bf['metric']??_0x11bdc9(0x16a),'connectivity':_0x2648bf[_0x11bdc9(0x120)]??0x10,'expansionAdd':_0x2648bf[_0x11bdc9(0x127)]??0x80,'expansionSearch':_0x2648bf[_0x11bdc9(0xde)]??0x40,'snapshotEveryChanges':_0x2648bf['snapshotEveryChanges']??0xc350,'snapshotMaxLagMs':_0x2648bf['snapshotMaxLagMs']??0x2710,'keepSnapshots':_0x2648bf[_0x11bdc9(0x17c)]??0x2,'tmpMaxAgeMs':_0x2648bf[_0x11bdc9(0x129)]??0x6*0x36ee80,'heartbeatIntervalMs':_0x2648bf[_0x11bdc9(0x1ad)]??0x1388,'writerLockMaxAgeMs':_0x2648bf[_0x11bdc9(0x126)]??0x3a98,'viewRefreshMs':_0x2648bf[_0x11bdc9(0xe8)]??0x3e8},_0x3db754=new _0x6baf45({'dir':_0x37f291,'keepSnapshots':_0xbe52d2[_0x11bdc9(0x17c)]}),_0x176b82=_0x489107(_0x37f291,{'maxAgeMs':_0xbe52d2['writerLockMaxAgeMs'],'heartbeatMs':_0xbe52d2[_0x11bdc9(0x1ad)],'onLost':()=>{_0x35c03f(_0x15fddf)['catch'](()=>{});}});let _0x4948fc=new _0x3b4c4c(),_0x4236a9=null,_0x4d2619=0x0,_0x104908=null,_0x204056=![],_0x5b6348=![],_0x187935=null,_0x2aac2b=0x0,_0x1cbde3=null,_0x50bf7d=0x0,_0x1e7206=![],_0x346b1a=Promise[_0x11bdc9(0x17e)]();const _0x35c03f=_0x315045=>{const _0x402695=_0x11bdc9,_0x8b8595=_0x346b1a[_0x402695(0x19c)](_0x315045);return _0x346b1a=_0x8b8595[_0x402695(0x186)](()=>{}),_0x8b8595;},_0x27ecef=()=>{try{onChange?.();}catch{}};function _0x201576(){const _0x771b49=_0x11bdc9;return new _0x13f47e[(_0x771b49(0xe3))]({'dimensions':_0xf45727,'metric':_0x36a102(_0xbe52d2['metric'],_0x13f47e),'quantization':_0x13f47e[_0x771b49(0x1aa)]['F32'],'connectivity':_0xbe52d2[_0x771b49(0x120)],'expansion_add':_0xbe52d2[_0x771b49(0x127)],'expansion_search':_0xbe52d2[_0x771b49(0xde)],'multi':![]});}function _0x184e62(_0x576d1c){return _0x576d1c instanceof Float32Array?_0x576d1c:new Float32Array(_0x576d1c);}function _0x441dc2(){const _0x531c31=_0x11bdc9;if(fetchAll)return fetchAll();if(_0x104908)return _0x104908();return Promise[_0x531c31(0x17e)](null);}function _0x23d919(_0x377426,_0x364c8d,_0x46c1b9){const _0x1c7d00=_0x11bdc9,_0x21e1a9=_0x4948fc['labelForExisting'](_0x377426);if(_0x21e1a9!==undefined)try{_0x4236a9[_0x1c7d00(0x19d)](BigInt(_0x21e1a9));}catch{}const _0x56b3f9=_0x4948fc[_0x1c7d00(0x182)](_0x377426);_0x4236a9['add'](BigInt(_0x56b3f9),_0x364c8d),_0x4948fc[_0x1c7d00(0x146)](_0x377426,_0x46c1b9??_0x5ae507(_0x364c8d));}function _0x30ec60(_0x311362){const _0xb37a28=_0x11bdc9,_0x3a654c=_0x4948fc[_0xb37a28(0xe9)](_0x311362);if(_0x3a654c===undefined)return![];try{_0x4236a9[_0xb37a28(0x19d)](BigInt(_0x3a654c));}catch{}return _0x4948fc[_0xb37a28(0x113)](_0x311362),!![];}function _0x34f650(_0x144abd){_0x4948fc=new _0x3b4c4c(),_0x4236a9=_0x201576();for(const {key:_0x2fc7a7,vector:_0x246131}of _0x144abd??[]){if(!(_0x246131 instanceof Float32Array)||_0x246131['length']!==_0xf45727)continue;_0x23d919(_0x2fc7a7,_0x246131);}_0x4d2619=0x0;}function _0x2e3bc6(){const _0x4e863b=_0x11bdc9;return Math[_0x4e863b(0x117)](Date[_0x4e863b(0x10c)](),_0x3db754[_0x4e863b(0x115)]()+0x1);}function _0x37a678(){if(_0x187935)clearTimeout(_0x187935);_0x187935=null;}function _0x33d352(){const _0x6fbdd4=_0x11bdc9;if(!_0xbe52d2['snapshotMaxLagMs']||_0x307751(_0xbe52d2[_0x6fbdd4(0xfd)])||_0x187935||!_0x5b6348||_0x4d2619<=0x0)return;const _0x1004ae=_0x20c5ce(Math[_0x6fbdd4(0x117)](_0xbe52d2[_0x6fbdd4(0xfd)],0xa*_0x2aac2b));_0x187935=setTimeout(()=>{const _0x581b63=_0x6fbdd4;_0x187935=null,_0x35c03f(async()=>{if(_0x5b6348&&_0x4d2619>0x0)await _0x369797();_0x33d352(),_0x27ecef();})[_0x581b63(0x186)](()=>{});},_0x1004ae),_0x187935['unref']?.();}async function _0x369797(_0x53804c){const _0x58cec9=_0x11bdc9;if(!_0x4236a9)return![];const _0x3eb051=_0x53804c??_0x2e3bc6(),_0x807603=Date[_0x58cec9(0x10c)](),_0x2839df=await _0x3db754[_0x58cec9(0x15b)](_0x3eb051,async _0x4acf0d=>{const _0x50eb1e=_0x58cec9;_0x4236a9[_0x50eb1e(0x191)](_0x4acf0d[_0x50eb1e(0x16f)]),await _0x4948fc[_0x50eb1e(0x13a)](_0x4acf0d[_0x50eb1e(0x130)]),_0x2307a7[_0x50eb1e(0x1a3)](_0x4acf0d[_0x50eb1e(0x16e)],JSON[_0x50eb1e(0x19f)]({'manifestVersion':_0x44da32,'algorithm':_0x50eb1e(0x17b),'dims':_0xf45727,'metric':_0xbe52d2['metric'],'clock':_0x3eb051,'snapshotAt':Date[_0x50eb1e(0x10c)]()},null,0x2));},{'keep':_0xbe52d2[_0x58cec9(0x17c)]});return _0x2aac2b=Date['now']()-_0x807603,_0x2839df?.[_0x58cec9(0x162)]&&(_0x4d2619=0x0,_0x37a678()),_0x2839df?.['published']??![];}function _0x5420f7(){const _0x5db545=_0x11bdc9;_0x4d2619++;if(_0x4d2619>=_0xbe52d2[_0x5db545(0xf5)])return _0x369797();return _0x33d352(),null;}async function _0x10552d(){const _0x34ef47=_0x11bdc9,_0x4994b0=_0x3db754[_0x34ef47(0x1ac)]()||_0x3db754['latestSnapshotId']();if(!_0x4994b0)return null;let _0x2869b7,_0x250ffe=![];try{await _0x3db754[_0x34ef47(0x13f)](_0x4994b0,async _0x48d657=>{const _0x316886=_0x34ef47;_0x2869b7=JSON[_0x316886(0x118)](_0x2307a7['readFileSync'](_0x48d657[_0x316886(0x16e)],'utf8'));if(_0x2869b7[_0x316886(0xe0)]!==_0x44da32||_0x2869b7['algorithm']!==_0x316886(0x17b)||_0x2869b7[_0x316886(0x15e)]!==_0xf45727||_0x2869b7['metric']!==_0xbe52d2['metric']){_0x2869b7=null;return;}const _0x3eb038=new _0x3b4c4c();await _0x3eb038[_0x316886(0x151)](_0x48d657[_0x316886(0x130)]);const _0x13e048=_0x201576();_0x13e048[_0x316886(0xed)](_0x48d657[_0x316886(0x16f)]),_0x4948fc=_0x3eb038,_0x4236a9=_0x13e048,_0x250ffe=!![];});}catch{return null;}return _0x250ffe?_0x2869b7?.[_0x34ef47(0x15c)]??0x0:null;}async function _0x152dcb(_0x27d8b6){const _0x5d6bd3=_0x11bdc9;_0x1cbde3=null;const _0x44a540=await _0x10552d();if(_0x44a540!=null){_0x4d2619=0x0;if(_0x27d8b6){if(!_0x4948fc[_0x5d6bd3(0x173)])return _0x34f650(_0x27d8b6),await _0x369797(),null;const _0x18be35=_0xe0f2af(_0x4948fc,_0x27d8b6,_0xf45727,{'upsert':_0x23d919,'remove':_0x30ec60}),_0x3d932d=_0x18be35[_0x5d6bd3(0x1b4)]+_0x18be35[_0x5d6bd3(0x12d)]+_0x18be35[_0x5d6bd3(0x13e)];_0x3d932d>0x0&&(_0x4d2619+=_0x3d932d,await _0x369797());}return _0x44a540;}_0x34f650(_0x27d8b6??[]);if(_0x4236a9[_0x5d6bd3(0xe1)]()>0x0)await _0x369797();return null;}async function _0x12c70d(){_0x5b6348=!![],await _0x152dcb(await _0x441dc2());}async function _0x15fddf(){const _0x1e977d=_0x11bdc9;if(!_0x5b6348)return;_0x5b6348=![],_0x37a678(),_0x4d2619=0x0;const _0xa866dc=_0x3db754[_0x1e977d(0x1ac)]()||_0x3db754[_0x1e977d(0x156)]();await _0x46df83(_0xa866dc),_0x27ecef();}async function _0x46df83(_0x32c393){if(!_0x32c393)return![];let _0x1892f9=![];try{await _0x3db754['loadSnapshot'](_0x32c393,async _0x4afa31=>{const _0x544034=_0x2974,_0x23f9af=JSON[_0x544034(0x118)](_0x2307a7['readFileSync'](_0x4afa31[_0x544034(0x16e)],'utf8'));if(_0x23f9af[_0x544034(0xe0)]!==_0x44da32||_0x23f9af[_0x544034(0xd8)]!==_0x544034(0x17b)||_0x23f9af[_0x544034(0x15e)]!==_0xf45727||_0x23f9af[_0x544034(0xee)]!==_0xbe52d2[_0x544034(0xee)])return;const _0x16d38b=new _0x3b4c4c();await _0x16d38b[_0x544034(0x151)](_0x4afa31[_0x544034(0x130)]);const _0x1b837f=_0x201576();_0x1b837f[_0x544034(0xe5)](_0x4afa31[_0x544034(0x16f)]),_0x4236a9=_0x1b837f,_0x4948fc=_0x16d38b,_0x1cbde3=_0x32c393,_0x1892f9=!![];});}catch{}return _0x1892f9;}function _0x50e3db(){const _0x2e694d=_0x11bdc9,_0x513d37=Date['now']();if(_0x513d37-_0x50bf7d<_0xbe52d2[_0x2e694d(0xe8)])return;_0x50bf7d=_0x513d37;if(_0x1e7206)return;if(_0x176b82['isFree']()){_0x1e7206=!![],_0x35c03f(async()=>{const _0x425333=_0x2e694d;!_0x5b6348&&_0x204056&&_0x176b82[_0x425333(0xff)]()&&(await _0x12c70d(),_0x27ecef());})[_0x2e694d(0x186)](()=>{})[_0x2e694d(0x144)](()=>{_0x1e7206=![];});return;}const _0x298efa=_0x3db754[_0x2e694d(0x1ac)]()||_0x3db754[_0x2e694d(0x156)]();if(!_0x298efa||_0x298efa===_0x1cbde3)return;_0x1e7206=!![],_0x35c03f(async()=>{if(!_0x5b6348&&await _0x46df83(_0x298efa))_0x27ecef();})[_0x2e694d(0x186)](()=>{})['finally'](()=>{_0x1e7206=![];});}return{async 'load'(_0x387c4a){return _0x35c03f(async()=>{const _0x44ec72=_0x2974;_0x3db754[_0x44ec72(0x11c)]({'maxAgeMs':_0xbe52d2['tmpMaxAgeMs']}),_0x104908=_0x387c4a??null,_0x5b6348=_0x176b82[_0x44ec72(0xff)]();let _0x209217=null;if(_0x5b6348)_0x209217=await _0x152dcb(_0x387c4a?await _0x387c4a():null);else{const _0x5683fd=_0x3db754[_0x44ec72(0x1ac)]()||_0x3db754[_0x44ec72(0x156)]();await _0x46df83(_0x5683fd);}return _0x204056=!![],_0x209217;});},async 'add'(_0x4b7f24,_0x3ce23a,_0x44e04a){return _0x35c03f(async()=>{const _0x269f72=_0x2974;if(!_0x204056)return;const _0x2ef6a6=_0x184e62(_0x3ce23a);if(!_0x5b6348){if(!_0x176b82[_0x269f72(0xff)]())return;await _0x12c70d();}if(!_0x4236a9)return;const _0x3b80ab=_0x5ae507(_0x2ef6a6);if(_0x4948fc[_0x269f72(0x11d)](_0x4b7f24)===_0x3b80ab)return;_0x23d919(_0x4b7f24,_0x2ef6a6,_0x3b80ab),await _0x5420f7();});},async 'remove'(_0x3af847){return _0x35c03f(async()=>{const _0x1f87ab=_0x2974;if(!_0x204056)return;if(!_0x5b6348){if(!_0x176b82[_0x1f87ab(0xff)]())return;await _0x12c70d();}if(!_0x4236a9)return;if(_0x30ec60(_0x3af847))await _0x5420f7();});},'search'(_0x37d94a,{limit:limit=0xa}={}){const _0xce69e5=_0x11bdc9;if(!_0x5b6348&&_0x204056)_0x50e3db();if(!_0x4236a9)return[];const _0x2c0ba9=_0x4236a9[_0xce69e5(0xe1)]();if(_0x2c0ba9===0x0)return[];const _0x4fa9ce=Math[_0xce69e5(0x142)](limit,_0x2c0ba9),_0x410935=_0x4236a9[_0xce69e5(0x14d)](_0x184e62(_0x37d94a),_0x4fa9ce,0x0),_0x4199f9=[],_0x1a5c15=_0x410935['keys'],_0x5c44ae=_0x410935[_0xce69e5(0x12e)];for(let _0x257804=0x0;_0x257804<_0x1a5c15[_0xce69e5(0x16b)];_0x257804++){const _0x34b1e0=_0x1a5c15[_0x257804];if(_0x34b1e0===0xffffffffffffffffn)continue;const _0x31e7ee=Number(_0x34b1e0),_0x312ca2=_0x4948fc[_0xce69e5(0x12a)](_0x31e7ee);if(!_0x312ca2)continue;const _0x23088=_0x5c44ae[_0x257804];let _0x542150;if(_0xbe52d2[_0xce69e5(0xee)]===_0xce69e5(0x16a))_0x542150=Math[_0xce69e5(0x117)](0x0,0x1-_0x23088);else{if(_0xbe52d2[_0xce69e5(0xee)]==='ip')_0x542150=-_0x23088;else _0x542150=0x1/(0x1+_0x23088);}_0x4199f9[_0xce69e5(0x18e)]({'key':_0x312ca2,'score':_0x542150});}return _0x4199f9;},async 'snapshot'(_0x4a4073){return _0x35c03f(()=>_0x5b6348?_0x369797(_0x4a4073??undefined):![]);},async 'rebuild'(_0x5a0fc6){return _0x35c03f(async()=>{const _0x3d0f65=_0x2974;if(_0x5a0fc6!=null)_0x104908=_0x5a0fc6;if(!_0x5b6348){if(!_0x176b82[_0x3d0f65(0xff)]())return;_0x5b6348=!![];}const _0x470570=_0x5a0fc6?await _0x5a0fc6():await _0x441dc2();_0x34f650(_0x470570??[]),_0x204056=!![],await _0x369797();});},async 'stop'(){return _0x35c03f(async()=>{const _0x2e448b=_0x2974;_0x37a678();if(_0x5b6348){if(_0x4d2619>0x0||!_0x3db754[_0x2e448b(0x1ac)]())await _0x369797();_0x176b82['release']();}_0x5b6348=![],_0x204056=![];});},'count'(){return _0x4948fc['size']();},'info'(){const _0x488c87=_0x11bdc9;return{'algorithm':_0x488c87(0x17b),'role':_0x5b6348?_0x488c87(0x1a8):_0x488c87(0xf4),'metric':_0xbe52d2[_0x488c87(0xee)],'connectivity':_0xbe52d2[_0x488c87(0x120)],'expansionAdd':_0xbe52d2[_0x488c87(0x127)],'expansionSearch':_0xbe52d2['expansionSearch'],'snapshotEveryChanges':_0xbe52d2[_0x488c87(0xf5)],'snapshotMaxLagMs':_0xbe52d2[_0x488c87(0xfd)],'count':_0x4948fc[_0x488c87(0xe1)](),'size':_0x4236a9?.[_0x488c87(0xe1)]?.()??0x0,'capacity':_0x4236a9?.[_0x488c87(0x14e)]?.()??0x0,'changesSince':_0x5b6348?_0x4d2619:null,'viewedSnapshot':_0x1cbde3??null,'snapshotDir':_0x37f291,'latestSnapshot':_0x3db754[_0x488c87(0x1ac)]()??null};}};},usearch;}var hasRequiredAlgorithmWorkerThread;function requireAlgorithmWorkerThread(){const _0x3a3454=_0x5daec5;if(hasRequiredAlgorithmWorkerThread)return algorithmWorkerThread$1;hasRequiredAlgorithmWorkerThread=0x1;const {parentPort:_0x246e07,workerData:_0x5d1bad}=require$$0$1,{algorithmName:_0x326060,algorithmConfig:_0x2999df,dims:_0x22f5c3,dir:_0x119514}=_0x5d1bad;let _0x4864f8=0x1;const _0x430432=new Map();function _0x5e630b(){const _0x13626e=_0x4864f8++;return new Promise((_0x4c452f,_0x47231a)=>{const _0x35dc78=_0x2974;_0x430432[_0x35dc78(0x150)](_0x13626e,{'resolve':_0x4c452f,'reject':_0x47231a}),_0x246e07[_0x35dc78(0x196)]({'op':_0x35dc78(0x143),'fid':_0x13626e});});}const _0x50ded3={'dims':_0x22f5c3,'dir':_0x119514,'fetchAll':_0x5e630b,'onChange':()=>_0xeaa247()};let _0x28ab8c;if(_0x326060===_0x3a3454(0x135))_0x28ab8c=requireHnsw()(_0x2999df,_0x50ded3);else{if(_0x326060==='flat')_0x28ab8c=requireFlat()(_0x2999df,_0x50ded3);else{if(_0x326060==='usearch')_0x28ab8c=requireUsearch()(_0x2999df,_0x50ded3);else throw new Error(_0x3a3454(0x1a2)+_0x326060+'\x22');}}function _0xeaa247(){const _0xab292a=_0x3a3454;try{_0x246e07['postMessage']({'op':_0xab292a(0xec),'count':_0x28ab8c[_0xab292a(0x10b)](),'info':_0x28ab8c[_0xab292a(0x114)](),'memory':process[_0xab292a(0x122)]()});}catch{}}function _0x4776f3(_0x51ab9c){const _0x397261=_0x3a3454;return(_0x51ab9c||[])['map'](_0x3f67c9=>({'key':_0x3f67c9[_0x397261(0x17f)],'vector':_0x3f67c9['vector']instanceof Float32Array?_0x3f67c9[_0x397261(0x171)]:new Float32Array(_0x3f67c9['vector'])}));}return _0x246e07['on']('message',async _0x281007=>{const _0x4d697d=_0x3a3454;if(_0x281007['op']===_0x4d697d(0x164)){const _0x217bba=_0x430432[_0x4d697d(0x181)](_0x281007['fid']);if(!_0x217bba)return;_0x430432[_0x4d697d(0xf6)](_0x281007[_0x4d697d(0x10f)]);if(_0x281007['error'])_0x217bba['reject'](new Error(_0x281007[_0x4d697d(0x184)]));else _0x217bba[_0x4d697d(0x17e)](_0x4776f3(_0x281007[_0x4d697d(0x169)]));return;}const {id:_0x799321,op:_0x8e5f1e,args:_0x2c65b9}=_0x281007;try{let _0x42aabd;switch(_0x8e5f1e){case _0x4d697d(0xed):{_0x42aabd=await _0x28ab8c[_0x4d697d(0xed)](_0x2c65b9['hasRows']?_0x5e630b:null),_0xeaa247();break;}case _0x4d697d(0x131):{const _0x191032=_0x2c65b9[_0x4d697d(0x171)]instanceof Float32Array?_0x2c65b9[_0x4d697d(0x171)]:new Float32Array(_0x2c65b9[_0x4d697d(0x171)]);await _0x28ab8c[_0x4d697d(0x131)](_0x2c65b9[_0x4d697d(0x17f)],_0x191032,_0x2c65b9[_0x4d697d(0x15c)]??undefined),_0xeaa247(),_0x42aabd=null;break;}case'remove':{await _0x28ab8c[_0x4d697d(0x19d)](_0x2c65b9[_0x4d697d(0x17f)]),_0xeaa247(),_0x42aabd=null;break;}case _0x4d697d(0x14d):{const _0x4ee84a=_0x2c65b9[_0x4d697d(0x123)]instanceof Float32Array?_0x2c65b9[_0x4d697d(0x123)]:new Float32Array(_0x2c65b9['queryVec']);_0x42aabd=_0x28ab8c[_0x4d697d(0x14d)](_0x4ee84a,_0x2c65b9[_0x4d697d(0x158)]||{});break;}case _0x4d697d(0x119):{_0x42aabd=await _0x28ab8c[_0x4d697d(0x119)](_0x2c65b9[_0x4d697d(0x15c)]),_0xeaa247();break;}case _0x4d697d(0xf0):{const _0x2983f0=_0x4776f3(_0x2c65b9[_0x4d697d(0x169)]);await _0x28ab8c[_0x4d697d(0xf0)](async()=>_0x2983f0),_0xeaa247(),_0x42aabd=null;break;}case _0x4d697d(0x19e):{await _0x28ab8c['stop'](),_0xeaa247(),_0x42aabd=null;break;}case _0x4d697d(0x10b):{_0x42aabd=_0x28ab8c[_0x4d697d(0x10b)]();break;}case _0x4d697d(0x114):{_0x42aabd=_0x28ab8c[_0x4d697d(0x114)]();break;}default:throw new Error(_0x4d697d(0x145)+_0x8e5f1e+'\x22');}_0x246e07[_0x4d697d(0x196)]({'id':_0x799321,'result':_0x42aabd});}catch(_0x19ddc6){_0x246e07['postMessage']({'id':_0x799321,'error':{'message':_0x19ddc6?.[_0x4d697d(0x111)]||String(_0x19ddc6),'code':_0x19ddc6?.['code']}});}}),_0x246e07[_0x3a3454(0x196)]({'op':_0x3a3454(0x116)}),algorithmWorkerThread$1;}var algorithmWorkerThreadExports=requireAlgorithmWorkerThread(),algorithmWorkerThread=getDefaultExportFromCjs(algorithmWorkerThreadExports);module[_0x5daec5(0x110)]=algorithmWorkerThread;