@kedem/okdb 2.3.3 → 2.3.5

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/CHANGELOG.md CHANGED
@@ -4,6 +4,82 @@ All notable changes to `@kedem/okdb` are documented here. Format loosely follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.0.0/); versions follow [SemVer](https://semver.org/).
5
5
  Dates are release dates.
6
6
 
7
+ ## [2.3.5] - 2026-09-24
8
+
9
+ ### Fixed
10
+
11
+ - **A blob still referenced by a `~files` record could be deleted.** Two concurrent overwrites of
12
+ one file id (two `upload()`s in one transaction, or in parallel) both released the previous
13
+ blob; when those bytes were shared with another record (dedup), they were unlinked under it and
14
+ its reads returned 404. Releasing a blob — `remove()`, overwrite, `gcOrphanedBlobs()` — now
15
+ re-checks live `~files` references across every registered env before deleting, keeps the bytes
16
+ when any exist (or when an unopened env makes it unknowable), and repairs the ref count.
17
+ - **Two uploads of the same id in the same millisecond shared one temp file** (interleaved bytes
18
+ or `ENOENT` on rename).
19
+ - **`gcOrphanedBlobs()` could delete a blob an upload was still landing** (a transaction upload's
20
+ blob is on disk before its record commits). It now skips 0-ref blobs modified within `minAgeMs`
21
+ (default 10 minutes; `gcOrphanedBlobs({ minAgeMs })`), and a dedup upload refreshes the reused
22
+ blob's mtime.
23
+
24
+ ## [2.3.4] - 2026-09-24
25
+
26
+ ### Added
27
+
28
+ - **Searchable file contents: `files.indexContent({ field, maxBytes })`.** Declares `~files.<field>`
29
+ a resolved field backed by a built-in resolver (blob → extractor → text), installed in every
30
+ process automatically, so FTS and embeddings over `~files` need no per-process app code.
31
+ Text-like mimes are extracted out of the box; `files.registerExtractor(match, fn)` adds others
32
+ (mime, wildcard or predicate; no parsers are bundled). A blob missing on the indexing node is
33
+ pulled from sync peers first, else fails retryably with `FILE_BLOB_MISSING`. Also
34
+ `files.get(id)` / `files.read(id)`, and `files.read` / `files.listPath` in functions.
35
+ - **Inline file preview: `GET /api/files/:id?inline=1`.** Passive media (non-SVG images, audio,
36
+ video, PDF) keep their type; everything else is served as `text/plain`, always with `nosniff`
37
+ and a sandboxing CSP. Single `Range` requests are honoured (206 / 416).
38
+ - **Admin → Files:** a preview pane (text/JSON, images, SVG, PDF, audio/video), a path filter, and
39
+ content search over the `~files` FTS index.
40
+ - **The CLI honours the role flags from its config file.** Top-level `processors`, `engines` and
41
+ `compaction` booleans in `.kdbconfig` (or `--config`) are passed to `new OKDB(path, opts)` with
42
+ the constructor's names, defaults and semantics, for the single-process node and every cluster
43
+ worker — so a passive serving node can run from `bin/okdb`. They were silently ignored before.
44
+ A non-boolean value is a startup error.
45
+ - **`db.http.listen(port, { host })` binds the API to chosen addresses.** `host` is a string or an
46
+ array (one server per address, sharing one request handler); default unchanged (all
47
+ interfaces). With an array, `listen()` returns the first address's `http.Server`; all of them are
48
+ on `db.http.servers` and `db.http.close()` closes them all. The process registry's `listenAddr`
49
+ shows the bound host(s). The CLI reads `http.host` from its config file (single-process and
50
+ every cluster worker). The documented `listen(port, '0.0.0.0')` form now actually binds that
51
+ host (a string is shorthand for `{ host }`); before, the argument was ignored.
52
+
53
+ ### Fixed
54
+
55
+ - **Overwriting a file id releases the old blob.** `files.upload()` under an existing id with
56
+ different bytes leaked the previous blob's reference (it was never deleted); same bytes no
57
+ longer double-count.
58
+ - **Downloads of files with non-Latin-1 names no longer fail** (`ERR_INVALID_CHAR`):
59
+ `content-disposition` carries an ASCII fallback plus RFC 6266 `filename*`.
60
+ - **Blob pulls from sync peers found no peers**: they looked up `~sync_nodes` in the default env
61
+ instead of `~system`. The fetch now has a timeout.
62
+ - **Admin → Files: switching folders reloads the file list.**
63
+ - **`docs/auth-permissions.md`: the cluster-peer token recipe needs `sync:read` too** — `join()`
64
+ reads `/api/sync/info` first.
65
+ - **`docs/auth-and-sync.md` describes the real auth and sync-peer model.** Dropped the `auth.admin`,
66
+ `auth.tokens`, `api.tokens` and `auth.mode` config okdb never reads; tokens live in `~tokens`, and
67
+ peers join once with a token or name + password, then sync with Ed25519-signed requests.
68
+ - **A process missing an app registration holds embedding work instead of failing it.** A
69
+ full-role process that lacked the pipeline's custom preparer (`registerPreparer`) or chunk
70
+ strategy (`registerChunkStrategy`), or whose embedder engine was not running (e.g. its
71
+ `registerEmbedderFactory` factory is registered only in another process), marked every doc it
72
+ picked up `failed` for good — measured: with a second such process on the store, 21 of 40 docs
73
+ ended failed and stayed failed after the owner restarted. It now holds them exactly like a
74
+ missing resolved-field resolver: the doc stays `pending`, the inline drain is held (and yields
75
+ its lease to a peer that wants it), a queue job is re-queued without using a try, and
76
+ `indexer.stats().waiting` reports `{ reason: 'REGISTRATION_MISSING', kind, name }` or
77
+ `{ reason: 'EMBEDDER_NOT_RUNNING' }` with a warning in the log. The work completes once the
78
+ registration arrives in that process (registering a preparer/strategy or starting the embedder
79
+ kicks the held drain) or a process that has it picks it up. A misspelled built-in name holds
80
+ too; the message lists the built-ins. Docs already marked `failed` this way by earlier versions
81
+ are not revisited automatically — run `indexer.retryFailed()` once.
82
+
7
83
  ## [2.3.3] - 2026-09-24
8
84
 
9
85
  ### Fixed
@@ -1 +1 @@
1
- 'use strict';function _0x2796(){const _0xb675a1=['usearch\x20algorithm\x20requires\x20dir\x20for\x20snapshot\x20storage','WRITER.LOCK','key','published','MetricKind','USEARCH_BINDINGS_UNAVAILABLE','warn','efConstruction','hnswlib-node','Original\x20error:\x20','push','reject','token','add','catch','readIndexSync','dir','HierarchicalNSW','min','has','keyToFp','listSnapshotIds','readCurrentClock','prototype','queryVec','from','78PedzFR','state','Install\x20compatible\x20bindings\x20or\x20use\x20algorithm\x20\x22flat\x22\x20instead.\x20','now','size','added','hasOwnProperty','nextLabel','trunc','manifestVersion','versions','keyForLabel','6OwdHGz','readdirSync','[SnapshotStore]','view','snapshotEveryChanges','repeat','hnsw','writeIndexSync','L2sq','startsWith','_tmp-','clear','SnapshotStore\x20requires\x20dir','set','HNSW\x20algorithm\x20unavailable:\x20the\x20native\x20\x22hnswlib-node\x22\x20bindings\x20could\x20not\x20be\x20loaded\x20','hnsw\x20algorithm\x20requires\x20dir\x20for\x20snapshot\x20storage','filter','snapshot\x20id\x20required','byteOffset','entries','loadFrom','snapshotTo','reset','writer','delete','getCurrentCount','opts','vector','reader','snapshotsDir','resizeIndex','29817JErKlu','remove','cause','prune','writeFileSync','closeSync','labelForExisting','labels','memoryUsage','vectors','hasRows','lockPath','dims','buffer','heartbeatIntervalMs','map','unlinkSync','score','keepSnapshots','__esModule','error','slice','readFileSync','arch','labels.json','keys','removed','call','index','worker_threads','tmpMaxAgeMs','readCurrentId','Cos','rebuild','ready','isInteger','tombstone','metric','writerLockMaxAgeMs','SNAPSHOT.LOCK','hostname','1190BJqJfL','number','statSync','\x20on\x20','get','7wSaIFB','viewRefreshMs','resolve','distances','name','cosine','mkdirSync','46080rDeTmS','randomBytes','hex','EEXIST','sort','changed','ceil','hasFingerprints','2717364vXvfvY','Unknown\x20algorithm:\x20\x22','mtimeMs','initIndex',').\x20','index.hnsw','parse','length','trim','imul','usearch\x20algorithm\x20requires\x20dims\x20>\x200','usearch','stop','setFingerprint','fetchAllResult','labelForEphemeral','1259535yzQKvY','isFree','This\x20is\x20risky\x20on\x20slow\x20disks\x20or\x20overloaded\x20machines.\x20Consider\x20increasing\x20staleLockMaxAgeMs\x20if\x20this\x20happens\x20frequently.','keyToLabel','platform','acquire','host','stringify','cleanupTmpDirs','7455984YUTzjZ','setEf','unreadable','sqrt','max','log','.tmp-','efSearch','3307096TIwYet','expansionAdd','fingerprintOf','for\x20Node\x20','default','version','flat','crypto','renameSync','info','publishSnapshot','path','stale','rmSync','candidateClock\x20must\x20be\x20finite\x20>=\x200','ScalarKind','Breaking\x20stale\x20snapshot\x20lock\x20(age:\x20','.tmp','expansionSearch','code','node','snapshotMaxLagMs','lock_busy','Unknown\x20op:\x20\x22','toString','_snapshotPaths','22032714OyfKer','F32','state.json','clock','join','hnsw\x20algorithm\x20requires\x20dims\x20>\x200','postMessage','HNSW_BINDINGS_UNAVAILABLE','count','utf8','then','connectivity','getMaxElements','load','pid','finally','labelToKey','maxElements','_tombstoneCount','latestSnapshotId','isDirectory','loadSnapshot','CURRENT','isFinite','unref','markDelete','message','search','sync','_snapshotDir','growFactor'];_0x2796=function(){return _0xb675a1;};return _0x2796();}const _0x2d7520=_0x3b7a;(function(_0x32c205,_0x32daa7){const _0x1014e4=_0x3b7a,_0x37f58e=_0x32c205();while(!![]){try{const _0x4b52b2=-parseInt(_0x1014e4(0x19c))/0x1*(parseInt(_0x1014e4(0x171))/0x2)+parseInt(_0x1014e4(0x1d9))/0x3+-parseInt(_0x1014e4(0x1fa))/0x4+parseInt(_0x1014e4(0x1e9))/0x5*(-parseInt(_0x1014e4(0x17d))/0x6)+parseInt(_0x1014e4(0x1ca))/0x7*(parseInt(_0x1014e4(0x1f2))/0x8)+parseInt(_0x1014e4(0x1d1))/0x9*(-parseInt(_0x1014e4(0x1c5))/0xa)+parseInt(_0x1014e4(0x138))/0xb;if(_0x4b52b2===_0x32daa7)break;else _0x37f58e['push'](_0x37f58e['shift']());}catch(_0x2e115a){_0x37f58e['push'](_0x37f58e['shift']());}}}(_0x2796,0xf1af0));var require$$0$1=require(_0x2d7520(0x1b9)),require$$0=require('fs'),require$$1=require(_0x2d7520(0x129)),require$$2=require('os'),require$$3=require(_0x2d7520(0x125));function getDefaultExportFromCjs(_0x48b6e1){const _0x2fa4bc=_0x2d7520;return _0x48b6e1&&_0x48b6e1[_0x2fa4bc(0x1af)]&&Object[_0x2fa4bc(0x16e)][_0x2fa4bc(0x177)][_0x2fa4bc(0x1b7)](_0x48b6e1,_0x2fa4bc(0x122))?_0x48b6e1[_0x2fa4bc(0x122)]:_0x48b6e1;}var algorithmWorkerThread$1={},snapshotStore,hasRequiredSnapshotStore;function requireSnapshotStore(){const _0x302aee=_0x2d7520;if(hasRequiredSnapshotStore)return snapshotStore;hasRequiredSnapshotStore=0x1;const _0x3a1d7a=require$$0,_0x4cca24=require$$1,_0x4216e3=require$$2,_0x59c3d9=require$$3;function _0x3cc0ea(){const _0x325987=_0x3b7a;return Date[_0x325987(0x174)]();}function _0x497c11(_0xb90b7){try{return _0x3a1d7a['existsSync'](_0xb90b7);}catch{return![];}}function _0x57aa1c(_0x12b190){const _0x244f4d=_0x3b7a;try{return _0x3a1d7a['readFileSync'](_0x12b190,_0x244f4d(0x141));}catch{return null;}}function _0x5d5390(_0x55dd7a,_0x1af4e4){const _0x359afa=_0x3b7a,_0x344981=_0x55dd7a+_0x359afa(0x1f8)+_0x59c3d9[_0x359afa(0x1d2)](0x6)[_0x359afa(0x136)](_0x359afa(0x1d3));_0x3a1d7a[_0x359afa(0x1a0)](_0x344981,_0x1af4e4),_0x3a1d7a['renameSync'](_0x344981,_0x55dd7a);}function _0x596b85(_0x27cc1f,_0xe39a65=0x10){const _0x113b91=_0x3b7a,_0x39fd82=String(Math[_0x113b91(0x1f6)](0x0,Math['trunc'](_0x27cc1f||0x0)));return _0x39fd82['length']>=_0xe39a65?_0x39fd82:'0'[_0x113b91(0x182)](_0xe39a65-_0x39fd82[_0x113b91(0x1e0)])+_0x39fd82;}return snapshotStore=class _0xc71019{constructor({dir:_0x361cc5,keepSnapshots:keepSnapshots=0x3,log:log=null}={}){const _0x2976b1=_0x3b7a;if(!_0x361cc5)throw new Error(_0x2976b1(0x189));this[_0x2976b1(0x167)]=_0x361cc5,this[_0x2976b1(0x19a)]=_0x4cca24['join'](_0x361cc5,'snapshots'),this['currentPath']=_0x4cca24[_0x2976b1(0x13c)](_0x361cc5,_0x2976b1(0x14e)),this[_0x2976b1(0x1a7)]=_0x4cca24[_0x2976b1(0x13c)](_0x361cc5,_0x2976b1(0x1c3)),this[_0x2976b1(0x1ae)]=keepSnapshots,this[_0x2976b1(0x1f7)]=log,_0x3a1d7a[_0x2976b1(0x1d0)](this[_0x2976b1(0x167)],{'recursive':!![]}),_0x3a1d7a[_0x2976b1(0x1d0)](this[_0x2976b1(0x19a)],{'recursive':!![]});}[_0x302aee(0x155)](_0xdf708c){const _0x28f875=_0x302aee;return _0x4cca24[_0x28f875(0x13c)](this[_0x28f875(0x19a)],_0xdf708c);}[_0x302aee(0x137)](_0x32674e){const _0x38d97e=_0x302aee,_0x3ad731=this['_snapshotDir'](_0x32674e);return{'dir':_0x3ad731,'index':_0x4cca24[_0x38d97e(0x13c)](_0x3ad731,_0x38d97e(0x1de)),'labels':_0x4cca24[_0x38d97e(0x13c)](_0x3ad731,_0x38d97e(0x1b4)),'state':_0x4cca24[_0x38d97e(0x13c)](_0x3ad731,_0x38d97e(0x13a))};}[_0x302aee(0x1bb)](){const _0x29ecb2=_0x302aee;if(!_0x497c11(this['currentPath']))return null;const _0x50a526=_0x57aa1c(this['currentPath']);if(!_0x50a526)return null;const _0x5d90c1=String(_0x50a526)[_0x29ecb2(0x1e1)]();return _0x5d90c1||null;}['readCurrentClock'](){const _0x3282a4=_0x302aee,_0x353f4f=this['readCurrentId']();if(!_0x353f4f)return 0x0;const _0x1b0688=Number(_0x353f4f);return Number[_0x3282a4(0x14f)](_0x1b0688)?_0x1b0688:0x0;}[_0x302aee(0x16c)](){const _0xc91c3d=_0x302aee;try{return _0x3a1d7a[_0xc91c3d(0x17e)](this[_0xc91c3d(0x19a)],{'withFileTypes':!![]})[_0xc91c3d(0x18d)](_0x32128c=>_0x32128c[_0xc91c3d(0x14c)]())[_0xc91c3d(0x1ab)](_0x2d70e0=>_0x2d70e0[_0xc91c3d(0x1ce)])[_0xc91c3d(0x18d)](_0x39046a=>!_0x39046a[_0xc91c3d(0x186)](_0xc91c3d(0x1f8)))[_0xc91c3d(0x18d)](_0x68343b=>!_0x68343b['startsWith'](_0xc91c3d(0x187)))[_0xc91c3d(0x1d5)]();}catch{return[];}}['latestSnapshotId'](){const _0x10830c=_0x302aee,_0x1f3d4=this[_0x10830c(0x1bb)]();if(_0x1f3d4)return _0x1f3d4;const _0x5baa6b=this[_0x10830c(0x16c)]();if(!_0x5baa6b[_0x10830c(0x1e0)])return null;return _0x5baa6b[_0x5baa6b[_0x10830c(0x1e0)]-0x1];}[_0x302aee(0x1f1)]({maxAgeMs:maxAgeMs=0x6*0x36ee80}={}){const _0x5e59bb=_0x302aee;let _0x30b128;try{_0x30b128=_0x3a1d7a[_0x5e59bb(0x17e)](this['snapshotsDir'],{'withFileTypes':!![]});}catch{return;}const _0x257d15=_0x3cc0ea()-maxAgeMs;for(const _0x156f15 of _0x30b128){if(!_0x156f15[_0x5e59bb(0x14c)]())continue;const _0x3a7e38=_0x156f15[_0x5e59bb(0x1ce)];if(!_0x3a7e38[_0x5e59bb(0x186)](_0x5e59bb(0x1f8))&&!_0x3a7e38['startsWith'](_0x5e59bb(0x187)))continue;const _0x4123e5=_0x4cca24[_0x5e59bb(0x13c)](this[_0x5e59bb(0x19a)],_0x3a7e38);try{const _0x294e6d=_0x3a1d7a[_0x5e59bb(0x1c7)](_0x4123e5);if(_0x294e6d[_0x5e59bb(0x1db)]>_0x257d15)continue;}catch{}try{_0x3a1d7a[_0x5e59bb(0x12b)](_0x4123e5,{'recursive':!![],'force':!![]});}catch{}}}['prune']({keep:keep=null}={}){const _0x58250e=_0x302aee,_0x597f4c=Math[_0x58250e(0x1f6)](0x1,Math[_0x58250e(0x179)](keep??this[_0x58250e(0x1ae)]??0x3)),_0x57b969=this[_0x58250e(0x16c)]();if(_0x57b969[_0x58250e(0x1e0)]<=_0x597f4c)return;const _0x9f0ffd=this['readCurrentId'](),_0x4b49e9=_0x57b969[_0x58250e(0x1b1)](0x0,Math[_0x58250e(0x1f6)](0x0,_0x57b969[_0x58250e(0x1e0)]-_0x597f4c));for(const _0x438f3e of _0x4b49e9){if(_0x9f0ffd&&_0x438f3e===_0x9f0ffd)continue;const _0x540b8b=this['_snapshotDir'](_0x438f3e);try{_0x3a1d7a[_0x58250e(0x12b)](_0x540b8b,{'recursive':!![],'force':!![]});}catch{}}}async[_0x302aee(0x14d)](_0x218a19,_0x2c8d1d){const _0x22032d=_0x302aee;if(!_0x218a19)throw new Error(_0x22032d(0x18e));const _0x50c708=this[_0x22032d(0x137)](_0x218a19);if(!_0x497c11(_0x50c708[_0x22032d(0x1b8)])||!_0x497c11(_0x50c708[_0x22032d(0x1a3)])||!_0x497c11(_0x50c708['state']))throw new Error('snapshot\x20incomplete:\x20'+_0x218a19);const _0x4004a2=await _0x2c8d1d(_0x50c708);return _0x4004a2||{};}async['publishSnapshot'](_0x5110c0,_0xd8ee3c,{keep:keep=null,lockTimeoutMs:lockTimeoutMs=0x0,staleLockMaxAgeMs:staleLockMaxAgeMs=0xea60}={}){const _0x1fa840=_0x302aee,_0x13ccdf=Number(_0x5110c0);if(!Number[_0x1fa840(0x14f)](_0x13ccdf)||_0x13ccdf<0x0)throw new Error(_0x1fa840(0x12c));const _0x28c77b=_0x596b85(_0x13ccdf),_0xc3ec3b=this[_0x1fa840(0x155)](_0x28c77b),_0x35f64c=_0x4cca24['join'](this[_0x1fa840(0x19a)],_0x1fa840(0x1f8)+_0x28c77b+'-'+_0x59c3d9[_0x1fa840(0x1d2)](0x6)[_0x1fa840(0x136)](_0x1fa840(0x1d3)));_0x3a1d7a['mkdirSync'](_0x35f64c,{'recursive':!![]});const _0xfbc3e3={'dir':_0x35f64c,'index':_0x4cca24[_0x1fa840(0x13c)](_0x35f64c,'index.hnsw'),'labels':_0x4cca24[_0x1fa840(0x13c)](_0x35f64c,'labels.json'),'state':_0x4cca24[_0x1fa840(0x13c)](_0x35f64c,_0x1fa840(0x13a))};await _0xd8ee3c(_0xfbc3e3,{'id':_0x28c77b,'clock':_0x13ccdf});const _0x56d99f=JSON[_0x1fa840(0x1f0)]({'pid':process[_0x1fa840(0x146)],'host':_0x4216e3[_0x1fa840(0x1c4)](),'at':_0x3cc0ea()}),_0x2db2a7=_0x3cc0ea();let _0xe534d0=null;const _0x287173=()=>{const _0x3dec11=_0x1fa840;try{const _0x44d414=JSON[_0x3dec11(0x1df)](_0x3a1d7a[_0x3dec11(0x1b2)](this['lockPath'],_0x3dec11(0x141)));if(_0x44d414['at']&&_0x3cc0ea()-_0x44d414['at']>staleLockMaxAgeMs){const _0x1a567d=_0x3cc0ea()-_0x44d414['at'],_0x13d1a6=_0x3dec11(0x12e)+Math['round'](_0x1a567d/0x3e8)+'s,\x20pid:\x20'+_0x44d414[_0x3dec11(0x146)]+',\x20host:\x20'+_0x44d414[_0x3dec11(0x1ef)]+_0x3dec11(0x1dd)+_0x3dec11(0x1eb);this[_0x3dec11(0x1f7)]?.[_0x3dec11(0x15d)]?this[_0x3dec11(0x1f7)][_0x3dec11(0x15d)](_0x13d1a6):console['warn'](_0x3dec11(0x17f),_0x13d1a6);try{_0x3a1d7a['unlinkSync'](this[_0x3dec11(0x1a7)]);}catch{}return!![];}}catch{try{_0x3a1d7a[_0x3dec11(0x1ac)](this['lockPath']);}catch{}}return![];},_0x599225=()=>{const _0x114e62=_0x1fa840;try{return _0xe534d0=_0x3a1d7a['openSync'](this[_0x114e62(0x1a7)],'wx'),_0x3a1d7a[_0x114e62(0x1a0)](_0xe534d0,_0x56d99f),!![];}catch(_0x1e6dfc){if(_0x1e6dfc&&_0x1e6dfc['code']===_0x114e62(0x1d4))return![];throw _0x1e6dfc;}};if(!_0x599225()){_0x287173(),_0x599225();if(_0xe534d0==null&&lockTimeoutMs>0x0)while(_0x3cc0ea()-_0x2db2a7<lockTimeoutMs){await new Promise(_0x3d43a1=>setTimeout(_0x3d43a1,0x19));if(_0x599225())break;_0x287173();}}if(_0xe534d0==null){try{_0x3a1d7a[_0x1fa840(0x12b)](_0x35f64c,{'recursive':!![],'force':!![]});}catch{}return{'published':![],'reason':_0x1fa840(0x134)};}try{const _0x5187b6=this['readCurrentClock']();if(_0x13ccdf<=_0x5187b6){try{_0x3a1d7a[_0x1fa840(0x12b)](_0x35f64c,{'recursive':!![],'force':!![]});}catch{}return{'published':![],'reason':_0x1fa840(0x12a),'currentClock':_0x5187b6};}if(!_0x497c11(_0xc3ec3b))_0x3a1d7a['renameSync'](_0x35f64c,_0xc3ec3b);else try{_0x3a1d7a['rmSync'](_0x35f64c,{'recursive':!![],'force':!![]});}catch{}return _0x5d5390(this['currentPath'],_0x28c77b+'\x0a'),this[_0x1fa840(0x19f)]({'keep':keep}),{'published':!![],'currentClock':_0x13ccdf};}finally{try{_0x3a1d7a[_0x1fa840(0x1a1)](_0xe534d0);}catch{}try{_0x3a1d7a[_0x1fa840(0x1ac)](this[_0x1fa840(0x1a7)]);}catch{}}}},snapshotStore;}var labelMap,hasRequiredLabelMap;function requireLabelMap(){const _0x343f48=_0x2d7520;if(hasRequiredLabelMap)return labelMap;hasRequiredLabelMap=0x1;const _0x1f6de5=require$$0;class _0x280409{constructor(){const _0x1b4152=_0x3b7a;this[_0x1b4152(0x1ec)]=new Map(),this['labelToKey']=new Map(),this[_0x1b4152(0x178)]=0x0,this['_tombstoneCount']=0x0,this[_0x1b4152(0x16b)]=new Map(),this['hasFingerprints']=!![];}async[_0x343f48(0x193)](){const _0x2bbbc2=_0x343f48;this[_0x2bbbc2(0x1ec)]=new Map(),this[_0x2bbbc2(0x148)]=new Map(),this[_0x2bbbc2(0x16b)]=new Map(),this[_0x2bbbc2(0x1d8)]=!![],this[_0x2bbbc2(0x178)]=0x0,this[_0x2bbbc2(0x14a)]=0x0;}async[_0x343f48(0x191)](_0xa677ff){const _0x6b9ef3=_0x343f48;if(!_0xa677ff||!_0x1f6de5['existsSync'](_0xa677ff))return await this['reset'](),!![];let _0x19af96;try{_0x19af96=_0x1f6de5[_0x6b9ef3(0x1b2)](_0xa677ff,_0x6b9ef3(0x141));}catch{return await this[_0x6b9ef3(0x193)](),!![];}let _0x8137c0;try{_0x8137c0=JSON[_0x6b9ef3(0x1df)](_0x19af96);}catch{return await this[_0x6b9ef3(0x193)](),!![];}const _0x2b47f5=Array['isArray'](_0x8137c0?.[_0x6b9ef3(0x190)])?_0x8137c0[_0x6b9ef3(0x190)]:[],_0x553c98=Number[_0x6b9ef3(0x1bf)](_0x8137c0?.[_0x6b9ef3(0x178)])?_0x8137c0[_0x6b9ef3(0x178)]:0x0,_0xe23bf1=new Map(),_0x3d9d29=new Map(),_0x47234e=new Map(),_0x2d6e7d=_0x8137c0?.[_0x6b9ef3(0x123)]>=0x2;let _0x37b755=-0x1;for(const _0x4cfd71 of _0x2b47f5){if(!Array['isArray'](_0x4cfd71)||_0x4cfd71[_0x6b9ef3(0x1e0)]<0x2)continue;const _0x4821ac=Number(_0x4cfd71[0x0]),_0x45a787=String(_0x4cfd71[0x1]??'');if(!Number[_0x6b9ef3(0x1bf)](_0x4821ac)||_0x4821ac<0x0)continue;if(!_0x45a787)continue;_0xe23bf1[_0x6b9ef3(0x18a)](_0x45a787,_0x4821ac),_0x3d9d29[_0x6b9ef3(0x18a)](_0x4821ac,_0x45a787);if(_0x2d6e7d&&typeof _0x4cfd71[0x2]===_0x6b9ef3(0x1c6))_0x47234e[_0x6b9ef3(0x18a)](_0x45a787,_0x4cfd71[0x2]);if(_0x4821ac>_0x37b755)_0x37b755=_0x4821ac;}return this[_0x6b9ef3(0x1ec)]=_0xe23bf1,this[_0x6b9ef3(0x148)]=_0x3d9d29,this[_0x6b9ef3(0x16b)]=_0x47234e,this['hasFingerprints']=_0x2d6e7d,this[_0x6b9ef3(0x178)]=Math[_0x6b9ef3(0x1f6)](_0x553c98,_0x37b755+0x1,0x0),this[_0x6b9ef3(0x14a)]=0x0,!![];}[_0x343f48(0x1a2)](_0x5f3698){const _0x6b67ca=_0x343f48;return this[_0x6b67ca(0x1ec)][_0x6b67ca(0x1c9)](_0x5f3698);}['labelForEphemeral'](_0x328306){const _0x1d1cec=_0x343f48;let _0x30c065=this[_0x1d1cec(0x1ec)]['get'](_0x328306);if(_0x30c065!==undefined)return _0x30c065;return _0x30c065=this[_0x1d1cec(0x178)]++,this[_0x1d1cec(0x1ec)][_0x1d1cec(0x18a)](_0x328306,_0x30c065),this[_0x1d1cec(0x148)][_0x1d1cec(0x18a)](_0x30c065,_0x328306),_0x30c065;}[_0x343f48(0x1e6)](_0x3ee1a7,_0x1a5a69){const _0x21f279=_0x343f48;if(_0x1a5a69==null)this[_0x21f279(0x16b)]['delete'](_0x3ee1a7);else this[_0x21f279(0x16b)][_0x21f279(0x18a)](_0x3ee1a7,_0x1a5a69);}[_0x343f48(0x1fc)](_0x48bafd){const _0x709436=_0x343f48;return this[_0x709436(0x16b)]['get'](_0x48bafd);}[_0x343f48(0x1b5)](){return this['keyToLabel']['keys']();}[_0x343f48(0x1c0)](_0x23837b){const _0x22c04c=_0x343f48,_0x344bcf=this[_0x22c04c(0x1ec)]['get'](_0x23837b);if(_0x344bcf===undefined)return;this['keyToFp']['delete'](_0x23837b),this[_0x22c04c(0x1ec)][_0x22c04c(0x195)](_0x23837b),this[_0x22c04c(0x148)][_0x22c04c(0x195)](_0x344bcf),this[_0x22c04c(0x14a)]++;}[_0x343f48(0x17c)](_0xb22bee){const _0x161918=_0x343f48;return this[_0x161918(0x148)][_0x161918(0x1c9)](_0xb22bee)??null;}[_0x343f48(0x175)](){const _0x6a8303=_0x343f48;return this[_0x6a8303(0x1ec)][_0x6a8303(0x175)];}['tombstoneCount'](){const _0xea8b4a=_0x343f48;return this[_0xea8b4a(0x14a)];}async[_0x343f48(0x192)](_0x4661c4){const _0x54d090=_0x343f48,_0x402a84=_0x4661c4+_0x54d090(0x12f),_0x50efcb=[];for(const [_0x5154d6,_0x529603]of this[_0x54d090(0x148)][_0x54d090(0x190)]()){const _0x25543b=this['keyToFp'][_0x54d090(0x1c9)](_0x529603);_0x50efcb[_0x54d090(0x161)](_0x25543b==null?[_0x5154d6,_0x529603]:[_0x5154d6,_0x529603,_0x25543b]);}_0x50efcb[_0x54d090(0x1d5)]((_0x4a08ef,_0x3fe522)=>_0x4a08ef[0x0]-_0x3fe522[0x0]);const _0x1edd7e={'version':0x2,'nextLabel':this['nextLabel'],'entries':_0x50efcb};_0x1f6de5['writeFileSync'](_0x402a84,JSON[_0x54d090(0x1f0)](_0x1edd7e)),_0x1f6de5[_0x54d090(0x126)](_0x402a84,_0x4661c4);}}return labelMap=_0x280409,labelMap;}var indexConvergence,hasRequiredIndexConvergence;function requireIndexConvergence(){if(hasRequiredIndexConvergence)return indexConvergence;hasRequiredIndexConvergence=0x1;function _0x7517a2(_0x40db98){const _0x1d464a=_0x3b7a,_0x3986e6=new Uint32Array(_0x40db98[_0x1d464a(0x1a9)],_0x40db98[_0x1d464a(0x18f)],_0x40db98['length']);let _0x28076f=0x811c9dc5,_0xf6c068=0x9747b28c;for(let _0xec47e8=0x0;_0xec47e8<_0x3986e6[_0x1d464a(0x1e0)];_0xec47e8++){const _0x559735=_0x3986e6[_0xec47e8];_0x28076f=Math[_0x1d464a(0x1e2)](_0x28076f^_0x559735,0x1000193)>>>0x0;let _0x5a7d4b=Math[_0x1d464a(0x1e2)](_0x559735,0xcc9e2d51);_0x5a7d4b=_0x5a7d4b<<0xf|_0x5a7d4b>>>0x11,_0xf6c068=Math[_0x1d464a(0x1e2)](_0xf6c068^Math[_0x1d464a(0x1e2)](_0x5a7d4b,0x1b873593),0x5)+0xe6546b64,_0xf6c068>>>=0x0;}return _0xf6c068=Math[_0x1d464a(0x1e2)](_0xf6c068^_0xf6c068>>>0x10,0x85ebca6b)>>>0x0,(_0x28076f>>>0x0)*0x100000+(_0xf6c068&0xfffff);}function _0x7ec065(_0xf5c61d,_0x1c56c0,_0x53ddf2,{upsert:_0x48ace7,remove:_0x23b5b8}){const _0x2847f3=_0x3b7a,_0x83e91f=new Set();let _0x4ac256=0x0,_0x69d7b3=0x0,_0x2e33ed=0x0;for(const {key:_0x5a82f5,vector:_0x5539d6}of _0x1c56c0){if(!(_0x5539d6 instanceof Float32Array)||_0x5539d6[_0x2847f3(0x1e0)]!==_0x53ddf2)continue;_0x83e91f[_0x2847f3(0x164)](_0x5a82f5);const _0x2f2eb7=_0x7517a2(_0x5539d6),_0x302127=_0xf5c61d[_0x2847f3(0x1a2)](_0x5a82f5)!==undefined;if(_0x302127&&_0xf5c61d['fingerprintOf'](_0x5a82f5)===_0x2f2eb7)continue;_0x48ace7(_0x5a82f5,_0x5539d6,_0x2f2eb7);if(_0x302127)_0x69d7b3++;else _0x4ac256++;}for(const _0x40ed73 of[..._0xf5c61d[_0x2847f3(0x1b5)]()]){if(_0x83e91f[_0x2847f3(0x16a)](_0x40ed73))continue;_0x23b5b8(_0x40ed73),_0x2e33ed++;}return{'added':_0x4ac256,'changed':_0x69d7b3,'removed':_0x2e33ed};}return indexConvergence={'fingerprint':_0x7517a2,'reconcileIndex':_0x7ec065},indexConvergence;}var hnsw,hasRequiredHnsw;function requireHnsw(){if(hasRequiredHnsw)return hnsw;hasRequiredHnsw=0x1;const _0x3861f9=requireSnapshotStore(),_0x2389fe=requireLabelMap(),{fingerprint:_0x26d219,reconcileIndex:_0x259bec}=requireIndexConvergence(),_0x235f15=0x1;let _0x464552=null;function _0x2e710b(){const _0x32e2a5=_0x3b7a;if(_0x464552)return _0x464552;try{return _0x464552=require(_0x32e2a5(0x15f)),_0x464552;}catch(_0x4a1124){const _0x496243=new Error(_0x32e2a5(0x18b)+('for\x20Node\x20'+process[_0x32e2a5(0x17b)][_0x32e2a5(0x132)]+_0x32e2a5(0x1c8)+process[_0x32e2a5(0x1ed)]+'/'+process[_0x32e2a5(0x1b3)]+'.\x20')+_0x32e2a5(0x173)+(_0x32e2a5(0x160)+(_0x4a1124?.[_0x32e2a5(0x152)]||String(_0x4a1124))));_0x496243[_0x32e2a5(0x131)]=_0x32e2a5(0x13f),_0x496243[_0x32e2a5(0x19e)]=_0x4a1124;throw _0x496243;}}return hnsw=function _0x43fb6a(_0x411353={},{dims:_0x306740,dir:_0x4c8091}){const _0x1c6874=_0x3b7a,_0x5a381c=_0x2e710b();if(!_0x306740||_0x306740<=0x0)throw new Error(_0x1c6874(0x13d));if(!_0x4c8091)throw new Error(_0x1c6874(0x18c));const _0x338170={'metric':_0x411353[_0x1c6874(0x1c1)]??_0x1c6874(0x1cf),'M':_0x411353['M']??0x10,'efConstruction':_0x411353['efConstruction']??0xc8,'efSearch':_0x411353[_0x1c6874(0x1f9)]??0x40,'maxElements':_0x411353[_0x1c6874(0x149)]??0x400,'growFactor':_0x411353[_0x1c6874(0x156)]??0x2,'snapshotEveryChanges':_0x411353[_0x1c6874(0x181)]??0xc350,'keepSnapshots':_0x411353[_0x1c6874(0x1ae)]??0x2,'tmpMaxAgeMs':_0x411353[_0x1c6874(0x1ba)]??0x6*0x36ee80},_0x597b7f=new _0x3861f9({'dir':_0x4c8091,'keepSnapshots':_0x338170['keepSnapshots']}),_0x23d149=new _0x2389fe();let _0x33b82e=null,_0x26a31a=0x0,_0x513576=null,_0x505697=Promise[_0x1c6874(0x1cc)]();const _0x470420=_0x418ffe=>{const _0x53874a=_0x1c6874,_0x4f194b=_0x505697['then'](_0x418ffe);return _0x505697=_0x4f194b[_0x53874a(0x165)](()=>{}),_0x4f194b;};async function _0x4dffb8(_0x30cbd7){const _0x134bdb=_0x1c6874;await _0x23d149[_0x134bdb(0x193)](),_0x30cbd7=_0x30cbd7??[];const _0x30551e=Math[_0x134bdb(0x1f6)](_0x338170['maxElements'],Math[_0x134bdb(0x1d7)](_0x30cbd7[_0x134bdb(0x1e0)]*(_0x338170['growFactor']||1.2)),0x1);_0x33b82e=new _0x5a381c['HierarchicalNSW'](_0x338170['metric'],_0x306740),_0x33b82e[_0x134bdb(0x1dc)]({'maxElements':_0x30551e,'efConstruction':_0x338170[_0x134bdb(0x15e)],'M':_0x338170['M']});for(const {key:_0x52deaf,vector:_0x27e393}of _0x30cbd7){if(!(_0x27e393 instanceof Float32Array)||_0x27e393['length']!==_0x306740)continue;_0x5c8063(_0x52deaf,_0x27e393);}_0x33b82e[_0x134bdb(0x1f3)](_0x338170[_0x134bdb(0x1f9)]),_0x26a31a=0x0;}async function _0x2f12e2(_0x23c676){return _0x4dffb8(_0x23c676?await _0x23c676():[]);}function _0x21f690(){const _0x37926f=_0x1c6874;if(_0x33b82e[_0x37926f(0x196)]()<_0x33b82e[_0x37926f(0x144)]())return;const _0x5f0578=Math['ceil'](_0x33b82e['getMaxElements']()*(_0x338170[_0x37926f(0x156)]||0x2));_0x33b82e[_0x37926f(0x19b)](_0x5f0578),_0x338170[_0x37926f(0x149)]=_0x5f0578;}function _0x5c8063(_0x5e8c99,_0x1df3e8,_0x181706){const _0x333440=_0x1c6874,_0x32937e=_0x23d149['labelForEphemeral'](_0x5e8c99);try{_0x33b82e[_0x333440(0x151)](_0x32937e);}catch{}_0x21f690(),_0x33b82e['addPoint'](Array['from'](_0x1df3e8),_0x32937e),_0x23d149['setFingerprint'](_0x5e8c99,_0x181706??_0x26d219(_0x1df3e8));}function _0xfadb88(_0x5aa320){const _0x2a546e=_0x1c6874,_0x29faeb=_0x23d149[_0x2a546e(0x1a2)](_0x5aa320);if(_0x29faeb===undefined)return![];try{_0x33b82e[_0x2a546e(0x151)](_0x29faeb);}catch{}return _0x23d149[_0x2a546e(0x1c0)](_0x5aa320),!![];}function _0x3b261e(){return Math['max'](Date['now'](),_0x597b7f['readCurrentClock']()+0x1);}async function _0x4e7edf(_0x393bfd){const _0x2abcf7=_0x1c6874;if(!_0x33b82e||!_0x393bfd)return![];const _0x329b00=await _0x597b7f['publishSnapshot'](_0x393bfd,async _0x59014c=>{const _0x52babf=_0x3b7a;_0x33b82e[_0x52babf(0x184)](_0x59014c['index']),await _0x23d149[_0x52babf(0x192)](_0x59014c['labels']);const _0x5c1b3d=require$$0;_0x5c1b3d[_0x52babf(0x1a0)](_0x59014c[_0x52babf(0x172)],JSON[_0x52babf(0x1f0)]({'manifestVersion':_0x235f15,'dims':_0x306740,'metric':_0x338170[_0x52babf(0x1c1)],'clock':_0x393bfd,'snapshotAt':Date[_0x52babf(0x174)]()},null,0x2));},{'keep':_0x338170['keepSnapshots']});if(_0x329b00?.['published'])_0x26a31a=0x0;return _0x329b00?.[_0x2abcf7(0x15a)]??![];}async function _0x5b085e(){const _0x2585a5=_0x1c6874,_0x27ff64=_0x597b7f['readCurrentId']()||_0x597b7f[_0x2585a5(0x14b)]();if(!_0x27ff64)return null;let _0x243bc1,_0x3ec26b=![];return await _0x597b7f[_0x2585a5(0x14d)](_0x27ff64,async _0x1c05b9=>{const _0x7ca507=_0x2585a5,_0x1fa02a=require$$0;_0x243bc1=JSON[_0x7ca507(0x1df)](_0x1fa02a[_0x7ca507(0x1b2)](_0x1c05b9[_0x7ca507(0x172)],_0x7ca507(0x141)));if(_0x243bc1[_0x7ca507(0x17a)]!==_0x235f15||_0x243bc1[_0x7ca507(0x1a8)]!==_0x306740||_0x243bc1[_0x7ca507(0x1c1)]!==_0x338170[_0x7ca507(0x1c1)]){_0x243bc1=null;return;}await _0x23d149[_0x7ca507(0x191)](_0x1c05b9[_0x7ca507(0x1a3)]),_0x33b82e=new _0x5a381c[(_0x7ca507(0x168))](_0x338170[_0x7ca507(0x1c1)],_0x306740),_0x33b82e[_0x7ca507(0x166)](_0x1c05b9[_0x7ca507(0x1b8)]),_0x33b82e[_0x7ca507(0x1f3)](_0x338170[_0x7ca507(0x1f9)]),_0x3ec26b=!![];}),_0x3ec26b?_0x243bc1?.[_0x2585a5(0x13b)]??0x0:null;}return{async 'load'(_0x51719e){return _0x470420(async()=>{const _0x45fa80=_0x3b7a;_0x597b7f['cleanupTmpDirs']({'maxAgeMs':_0x338170[_0x45fa80(0x1ba)]}),_0x513576=_0x51719e??null;const _0x506fdb=await _0x5b085e(),_0x13c2b0=_0x51719e?await _0x51719e():null;if(_0x506fdb!=null){if(_0x13c2b0){if(!_0x23d149[_0x45fa80(0x1d8)])return await _0x4dffb8(_0x13c2b0),null;const _0x5adc97=_0x259bec(_0x23d149,_0x13c2b0,_0x306740,{'upsert':_0x5c8063,'remove':_0xfadb88});_0x26a31a+=_0x5adc97['added']+_0x5adc97['changed']+_0x5adc97[_0x45fa80(0x1b6)];}return _0x506fdb;}return await _0x4dffb8(_0x13c2b0),null;});},async 'add'(_0x3e460b,_0x1d9cd9,_0x245fbf){return _0x470420(async()=>{const _0x543d5f=_0x3b7a;if(!_0x33b82e)return;const _0xc9d8c3=_0x1d9cd9 instanceof Float32Array?_0x1d9cd9:new Float32Array(_0x1d9cd9),_0x5a1ff6=_0x26d219(_0xc9d8c3);if(_0x23d149[_0x543d5f(0x1fc)](_0x3e460b)===_0x5a1ff6)return;_0x5c8063(_0x3e460b,_0xc9d8c3,_0x5a1ff6),_0x26a31a++,_0x26a31a>=_0x338170[_0x543d5f(0x181)]&&await _0x4e7edf(_0x3b261e());});},async 'remove'(_0xc63d1){return _0x470420(async()=>{if(!_0x33b82e)return;if(_0xfadb88(_0xc63d1))_0x26a31a++;});},'search'(_0x46baf2,{limit:limit=0xa,efSearch:_0x13fe46}={}){const _0x21c5ba=_0x1c6874;if(!_0x33b82e)return[];if(Number['isInteger'](_0x13fe46))_0x33b82e[_0x21c5ba(0x1f3)](_0x13fe46);const _0x475d9a=Math[_0x21c5ba(0x169)](limit,_0x33b82e[_0x21c5ba(0x196)]()||0x1),{neighbors:_0x1c558c,distances:_0x63fb39}=_0x33b82e['searchKnn'](Array[_0x21c5ba(0x170)](_0x46baf2),_0x475d9a),_0xe33b91=[];for(let _0x22e5b5=0x0;_0x22e5b5<_0x1c558c['length'];_0x22e5b5++){const _0x243abd=_0x23d149['keyForLabel'](_0x1c558c[_0x22e5b5]);if(!_0x243abd)continue;const _0x533589=_0x338170[_0x21c5ba(0x1c1)]===_0x21c5ba(0x1cf)?Math[_0x21c5ba(0x1f6)](0x0,0x1-_0x63fb39[_0x22e5b5]):0x1/(0x1+_0x63fb39[_0x22e5b5]);_0xe33b91['push']({'key':_0x243abd,'score':_0x533589});}return _0xe33b91;},async 'snapshot'(_0xed07ea){return _0x470420(()=>_0x4e7edf(_0xed07ea??_0x3b261e()));},async 'rebuild'(_0x6ff0d7){return _0x470420(()=>{if(_0x6ff0d7!=null)_0x513576=_0x6ff0d7;return _0x2f12e2(_0x6ff0d7??_0x513576);});},async 'stop'(){const _0x519547=_0x1c6874;return _0x470420(()=>_0x26a31a>0x0||!_0x597b7f[_0x519547(0x1bb)]()?_0x4e7edf(_0x3b261e()):![]);},'count'(){const _0x287a2c=_0x1c6874;return _0x23d149[_0x287a2c(0x175)]();},'info'(){const _0x10a549=_0x1c6874;return{'algorithm':_0x10a549(0x183),'metric':_0x338170[_0x10a549(0x1c1)],'M':_0x338170['M'],'efConstruction':_0x338170[_0x10a549(0x15e)],'efSearch':_0x338170['efSearch'],'maxElements':_0x33b82e?.['getMaxElements']()??_0x338170[_0x10a549(0x149)],'count':_0x23d149[_0x10a549(0x175)](),'changesSince':_0x26a31a,'snapshotDir':_0x4c8091,'latestSnapshot':_0x597b7f[_0x10a549(0x1bb)]()??null};}};},hnsw;}var flat,hasRequiredFlat;function requireFlat(){if(hasRequiredFlat)return flat;hasRequiredFlat=0x1,flat=function _0x3b8fd4(_0x1719f4={}){const _0x4c7748=new Map();return{async 'load'(_0x1ccfa0){const _0xd9c3c0=_0x3b7a;_0x4c7748[_0xd9c3c0(0x188)]();if(_0x1ccfa0)for(const {key:_0x41f6b7,vector:_0x54007a}of await _0x1ccfa0()){_0x4c7748[_0xd9c3c0(0x18a)](_0x41f6b7,_0x54007a);}},async 'add'(_0x373644,_0x3cd71d,_0x2931fc){const _0x1a5b51=_0x3b7a;_0x4c7748[_0x1a5b51(0x18a)](_0x373644,_0x3cd71d);},async 'remove'(_0x16e853){const _0x4bcd85=_0x3b7a;_0x4c7748[_0x4bcd85(0x195)](_0x16e853);},'search'(_0x277960,{limit:limit=0xa,threshold:threshold=0x0}={}){const _0x13ae0f=_0x3b7a,_0x188670=[];for(const [_0x265978,_0x3fe8ad]of _0x4c7748){const _0x204a17=_0x2622ae(_0x277960,_0x3fe8ad);if(_0x204a17>=threshold)_0x188670['push']({'key':_0x265978,'score':_0x204a17});}return _0x188670[_0x13ae0f(0x1d5)]((_0x4ed360,_0x116e0d)=>_0x116e0d[_0x13ae0f(0x1ad)]-_0x4ed360[_0x13ae0f(0x1ad)]),_0x188670[_0x13ae0f(0x1b1)](0x0,limit);},async 'snapshot'(){return![];},async 'rebuild'(_0x5f08b8){await this['load'](_0x5f08b8);},async 'stop'(){},'count'(){const _0x35bc16=_0x3b7a;return _0x4c7748[_0x35bc16(0x175)];},'info'(){const _0x485aee=_0x3b7a;return{'algorithm':_0x485aee(0x124),'count':_0x4c7748[_0x485aee(0x175)]};}};};function _0x2622ae(_0x16ce2f,_0x217994){const _0xd4bf65=_0x3b7a;let _0x289639=0x0,_0xd09fb0=0x0,_0x1a615a=0x0;for(let _0xc1f89c=0x0;_0xc1f89c<_0x16ce2f[_0xd4bf65(0x1e0)];_0xc1f89c++){_0x289639+=_0x16ce2f[_0xc1f89c]*_0x217994[_0xc1f89c],_0xd09fb0+=_0x16ce2f[_0xc1f89c]*_0x16ce2f[_0xc1f89c],_0x1a615a+=_0x217994[_0xc1f89c]*_0x217994[_0xc1f89c];}const _0x4ee72c=Math['sqrt'](_0xd09fb0)*Math[_0xd4bf65(0x1f5)](_0x1a615a);return _0x4ee72c===0x0?0x0:_0x289639/_0x4ee72c;}return flat;}var writerLock,hasRequiredWriterLock;function _0x3b7a(_0x4e8a32,_0x341b50){_0x4e8a32=_0x4e8a32-0x121;const _0x27967f=_0x2796();let _0x3b7a2b=_0x27967f[_0x4e8a32];return _0x3b7a2b;}function requireWriterLock(){if(hasRequiredWriterLock)return writerLock;hasRequiredWriterLock=0x1;const _0x4c9979=require$$0,_0xab8532=require$$1,_0x1a06c4=require$$3;return writerLock=function _0x58f464(_0x494e22,{maxAgeMs:maxAgeMs=0x3a98,heartbeatMs:heartbeatMs=0x1388,onLost:onLost=null}={}){const _0xc61720=_0x3b7a,_0x5df197=_0xab8532[_0xc61720(0x13c)](_0x494e22,_0xc61720(0x158)),_0x405111=_0x1a06c4[_0xc61720(0x1d2)](0x8)[_0xc61720(0x136)](_0xc61720(0x1d3));let _0x4fcfd6=![],_0x18b818=null;const _0x1b71e7=()=>JSON[_0xc61720(0x1f0)]({'pid':process['pid'],'token':_0x405111,'at':Date['now']()});function _0x53539b(){const _0x15cf6f=_0xc61720;try{return JSON[_0x15cf6f(0x1df)](_0x4c9979[_0x15cf6f(0x1b2)](_0x5df197,_0x15cf6f(0x141)));}catch(_0x2755ea){return _0x2755ea?.['code']==='ENOENT'?null:{'unreadable':!![]};}}function _0x4d0530(){const _0x4a9fed=_0xc61720;try{const _0x3e3ffc=_0x4c9979['openSync'](_0x5df197,'wx');try{_0x4c9979['writeFileSync'](_0x3e3ffc,_0x1b71e7());}finally{_0x4c9979[_0x4a9fed(0x1a1)](_0x3e3ffc);}return!![];}catch(_0x53b568){if(_0x53b568?.[_0x4a9fed(0x131)]==='EEXIST')return![];throw _0x53b568;}}function _0x3cf160(_0x22e9d6){if(!_0x22e9d6)return!![];if(_0x22e9d6['unreadable'])return!![];return Date['now']()-(_0x22e9d6['at']??0x0)>=maxAgeMs;}function _0x30c36a(){if(_0x18b818)clearInterval(_0x18b818);_0x18b818=null;}function _0x2202e6(){const _0x23fdda=_0xc61720;_0x30c36a(),_0x18b818=setInterval(()=>{const _0x3c1392=_0x3b7a,_0xb41201=_0x53539b();if(_0xb41201&&!_0xb41201[_0x3c1392(0x1f4)]&&_0xb41201[_0x3c1392(0x163)]!==_0x405111){_0x4fcfd6=![],_0x30c36a();try{onLost?.();}catch{}return;}try{_0x4c9979[_0x3c1392(0x1a0)](_0x5df197,_0x1b71e7());}catch{}},heartbeatMs),_0x18b818[_0x23fdda(0x150)]?.();}function _0x1c4839(){const _0x4e34ed=_0xc61720,_0x4af8de=_0x53539b();return!!_0x4af8de&&_0x4af8de[_0x4e34ed(0x163)]===_0x405111;}return{'path':_0x5df197,'token':_0x405111,'acquire'(){const _0x5e8248=_0x53539b();if(_0x5e8248&&_0x5e8248['token']===_0x405111){_0x4fcfd6=!![];if(!_0x18b818)_0x2202e6();return!![];}let _0x256800=_0x4d0530();if(!_0x256800&&_0x3cf160(_0x53539b())){try{_0x4c9979['unlinkSync'](_0x5df197);}catch{}_0x256800=_0x4d0530();}if(_0x256800&&!_0x1c4839())_0x256800=![];_0x4fcfd6=_0x256800;if(_0x256800)_0x2202e6();return _0x256800;},'held'(){return _0x4fcfd6;},'isFree'(){const _0x46c5cd=_0xc61720,_0x3a084c=_0x53539b();if(_0x3a084c&&_0x3a084c[_0x46c5cd(0x163)]===_0x405111)return![];return _0x3cf160(_0x3a084c);},'release'(){_0x30c36a();if(!_0x4fcfd6)return;_0x4fcfd6=![];if(_0x1c4839())try{_0x4c9979['unlinkSync'](_0x5df197);}catch{}}};},writerLock;}var usearch,hasRequiredUsearch;function requireUsearch(){if(hasRequiredUsearch)return usearch;hasRequiredUsearch=0x1;const _0x537f62=require$$0,_0x3bc4d0=requireSnapshotStore(),_0x87a1ee=requireLabelMap(),_0x198c82=requireWriterLock(),{fingerprint:_0xe6b816,reconcileIndex:_0x330383}=requireIndexConvergence(),_0x76bce1=0x1;let _0x312e0e=null;function _0x5787ae(){const _0x220efc=_0x3b7a;if(_0x312e0e)return _0x312e0e;try{return _0x312e0e=require(_0x220efc(0x1e4)),_0x312e0e;}catch(_0x295a4f){const _0x4dd9fd=new Error('usearch\x20algorithm\x20unavailable:\x20the\x20native\x20\x22usearch\x22\x20bindings\x20could\x20not\x20be\x20loaded\x20'+(_0x220efc(0x121)+process[_0x220efc(0x17b)][_0x220efc(0x132)]+_0x220efc(0x1c8)+process[_0x220efc(0x1ed)]+'/'+process[_0x220efc(0x1b3)]+'.\x20')+'Install\x20compatible\x20bindings\x20or\x20use\x20algorithm\x20\x22flat\x22/\x22hnsw\x22\x20instead.\x20'+(_0x220efc(0x160)+(_0x295a4f?.[_0x220efc(0x152)]||String(_0x295a4f))));_0x4dd9fd[_0x220efc(0x131)]=_0x220efc(0x15c),_0x4dd9fd['cause']=_0x295a4f;throw _0x4dd9fd;}}function _0x23f049(_0x3e2673,_0x43197a){const _0x2751f6=_0x3b7a;switch(_0x3e2673){case _0x2751f6(0x1cf):return _0x43197a[_0x2751f6(0x15b)]['Cos'];case'l2':return _0x43197a['MetricKind'][_0x2751f6(0x185)];case'ip':return _0x43197a[_0x2751f6(0x15b)]['IP'];default:return _0x43197a[_0x2751f6(0x15b)][_0x2751f6(0x1bc)];}}return usearch=function _0x2d8694(_0x9feea8={},{dims:_0x486b74,dir:_0x4f24e9,fetchAll:fetchAll=null,onChange:onChange=null}={}){const _0x53fa46=_0x3b7a,_0x27032a=_0x5787ae();if(!_0x486b74||_0x486b74<=0x0)throw new Error(_0x53fa46(0x1e3));if(!_0x4f24e9)throw new Error(_0x53fa46(0x157));const _0x1c1484={'metric':_0x9feea8[_0x53fa46(0x1c1)]??_0x53fa46(0x1cf),'connectivity':_0x9feea8[_0x53fa46(0x143)]??0x10,'expansionAdd':_0x9feea8[_0x53fa46(0x1fb)]??0x80,'expansionSearch':_0x9feea8['expansionSearch']??0x40,'snapshotEveryChanges':_0x9feea8[_0x53fa46(0x181)]??0xc350,'snapshotMaxLagMs':_0x9feea8[_0x53fa46(0x133)]??0x2710,'keepSnapshots':_0x9feea8[_0x53fa46(0x1ae)]??0x2,'tmpMaxAgeMs':_0x9feea8[_0x53fa46(0x1ba)]??0x6*0x36ee80,'heartbeatIntervalMs':_0x9feea8[_0x53fa46(0x1aa)]??0x1388,'writerLockMaxAgeMs':_0x9feea8[_0x53fa46(0x1c2)]??0x3a98,'viewRefreshMs':_0x9feea8[_0x53fa46(0x1cb)]??0x3e8},_0x2d2127=new _0x3bc4d0({'dir':_0x4f24e9,'keepSnapshots':_0x1c1484[_0x53fa46(0x1ae)]}),_0x518c8d=_0x198c82(_0x4f24e9,{'maxAgeMs':_0x1c1484[_0x53fa46(0x1c2)],'heartbeatMs':_0x1c1484[_0x53fa46(0x1aa)],'onLost':()=>{const _0x4260bf=_0x53fa46;_0x4ca809(_0x15cbab)[_0x4260bf(0x165)](()=>{});}});let _0x42e893=new _0x87a1ee(),_0x215c73=null,_0x36e97c=0x0,_0x16b451=null,_0x45a9d7=![],_0x3122ad=![],_0x2d2f9c=null,_0x196c81=0x0,_0x4c4965=null,_0x13eec5=0x0,_0x5c3942=![],_0x1a62d9=Promise[_0x53fa46(0x1cc)]();const _0x4ca809=_0x1847bd=>{const _0x4daf4e=_0x53fa46,_0xe0a699=_0x1a62d9[_0x4daf4e(0x142)](_0x1847bd);return _0x1a62d9=_0xe0a699['catch'](()=>{}),_0xe0a699;},_0x4efd42=()=>{try{onChange?.();}catch{}};function _0x4ab8b9(){const _0x252f62=_0x53fa46;return new _0x27032a['Index']({'dimensions':_0x486b74,'metric':_0x23f049(_0x1c1484['metric'],_0x27032a),'quantization':_0x27032a[_0x252f62(0x12d)][_0x252f62(0x139)],'connectivity':_0x1c1484[_0x252f62(0x143)],'expansion_add':_0x1c1484[_0x252f62(0x1fb)],'expansion_search':_0x1c1484[_0x252f62(0x130)],'multi':![]});}function _0x35312d(_0x58665b){return _0x58665b instanceof Float32Array?_0x58665b:new Float32Array(_0x58665b);}function _0x5c1751(){const _0x66a8a8=_0x53fa46;if(fetchAll)return fetchAll();if(_0x16b451)return _0x16b451();return Promise[_0x66a8a8(0x1cc)](null);}function _0xe2b793(_0x1c2077,_0x42adb1,_0x2fd543){const _0x46d9df=_0x53fa46,_0x5bcf65=_0x42e893[_0x46d9df(0x1a2)](_0x1c2077);if(_0x5bcf65!==undefined)try{_0x215c73[_0x46d9df(0x19d)](BigInt(_0x5bcf65));}catch{}const _0x39a909=_0x42e893[_0x46d9df(0x1e8)](_0x1c2077);_0x215c73[_0x46d9df(0x164)](BigInt(_0x39a909),_0x42adb1),_0x42e893[_0x46d9df(0x1e6)](_0x1c2077,_0x2fd543??_0xe6b816(_0x42adb1));}function _0x109561(_0x116473){const _0x27d3a7=_0x53fa46,_0x5f00e9=_0x42e893[_0x27d3a7(0x1a2)](_0x116473);if(_0x5f00e9===undefined)return![];try{_0x215c73[_0x27d3a7(0x19d)](BigInt(_0x5f00e9));}catch{}return _0x42e893['tombstone'](_0x116473),!![];}function _0x4413d3(_0x2b6025){const _0xcc845d=_0x53fa46;_0x42e893=new _0x87a1ee(),_0x215c73=_0x4ab8b9();for(const {key:_0x54ae2e,vector:_0x38e2df}of _0x2b6025??[]){if(!(_0x38e2df instanceof Float32Array)||_0x38e2df[_0xcc845d(0x1e0)]!==_0x486b74)continue;_0xe2b793(_0x54ae2e,_0x38e2df);}_0x36e97c=0x0;}function _0x2c916e(){const _0x5e686c=_0x53fa46;return Math[_0x5e686c(0x1f6)](Date['now'](),_0x2d2127[_0x5e686c(0x16d)]()+0x1);}function _0x191928(){if(_0x2d2f9c)clearTimeout(_0x2d2f9c);_0x2d2f9c=null;}function _0x2b1ac2(){const _0x2834c5=_0x53fa46;if(!_0x1c1484['snapshotMaxLagMs']||_0x2d2f9c||!_0x3122ad||_0x36e97c<=0x0)return;const _0xcd887d=Math['max'](_0x1c1484[_0x2834c5(0x133)],0xa*_0x196c81);_0x2d2f9c=setTimeout(()=>{const _0x39ee5e=_0x2834c5;_0x2d2f9c=null,_0x4ca809(async()=>{if(_0x3122ad&&_0x36e97c>0x0)await _0x233827();_0x2b1ac2(),_0x4efd42();})[_0x39ee5e(0x165)](()=>{});},_0xcd887d),_0x2d2f9c[_0x2834c5(0x150)]?.();}async function _0x233827(_0x3aa331){const _0x4cede3=_0x53fa46;if(!_0x215c73)return![];const _0x3fb2cc=_0x3aa331??_0x2c916e(),_0x1c97e6=Date[_0x4cede3(0x174)](),_0x222a3a=await _0x2d2127[_0x4cede3(0x128)](_0x3fb2cc,async _0x2256df=>{const _0x5c57d0=_0x4cede3;_0x215c73['save'](_0x2256df['index']),await _0x42e893['snapshotTo'](_0x2256df[_0x5c57d0(0x1a3)]),_0x537f62['writeFileSync'](_0x2256df[_0x5c57d0(0x172)],JSON[_0x5c57d0(0x1f0)]({'manifestVersion':_0x76bce1,'algorithm':_0x5c57d0(0x1e4),'dims':_0x486b74,'metric':_0x1c1484[_0x5c57d0(0x1c1)],'clock':_0x3fb2cc,'snapshotAt':Date[_0x5c57d0(0x174)]()},null,0x2));},{'keep':_0x1c1484['keepSnapshots']});return _0x196c81=Date[_0x4cede3(0x174)]()-_0x1c97e6,_0x222a3a?.[_0x4cede3(0x15a)]&&(_0x36e97c=0x0,_0x191928()),_0x222a3a?.[_0x4cede3(0x15a)]??![];}function _0x38e48a(){const _0x42fabd=_0x53fa46;_0x36e97c++;if(_0x36e97c>=_0x1c1484[_0x42fabd(0x181)])return _0x233827();return _0x2b1ac2(),null;}async function _0xccae2f(){const _0x3099a3=_0x53fa46,_0x419039=_0x2d2127[_0x3099a3(0x1bb)]()||_0x2d2127[_0x3099a3(0x14b)]();if(!_0x419039)return null;let _0x1be271,_0x5c5a15=![];try{await _0x2d2127[_0x3099a3(0x14d)](_0x419039,async _0x3c8ce0=>{const _0x343cd9=_0x3099a3;_0x1be271=JSON['parse'](_0x537f62['readFileSync'](_0x3c8ce0[_0x343cd9(0x172)],'utf8'));if(_0x1be271[_0x343cd9(0x17a)]!==_0x76bce1||_0x1be271['algorithm']!==_0x343cd9(0x1e4)||_0x1be271[_0x343cd9(0x1a8)]!==_0x486b74||_0x1be271[_0x343cd9(0x1c1)]!==_0x1c1484[_0x343cd9(0x1c1)]){_0x1be271=null;return;}const _0x3c7702=new _0x87a1ee();await _0x3c7702[_0x343cd9(0x191)](_0x3c8ce0[_0x343cd9(0x1a3)]);const _0x8ceb3b=_0x4ab8b9();_0x8ceb3b['load'](_0x3c8ce0[_0x343cd9(0x1b8)]),_0x42e893=_0x3c7702,_0x215c73=_0x8ceb3b,_0x5c5a15=!![];});}catch{return null;}return _0x5c5a15?_0x1be271?.['clock']??0x0:null;}async function _0x40d42f(_0x1f0de5){const _0x336fc8=_0x53fa46;_0x4c4965=null;const _0x3b0df2=await _0xccae2f();if(_0x3b0df2!=null){_0x36e97c=0x0;if(_0x1f0de5){if(!_0x42e893[_0x336fc8(0x1d8)])return _0x4413d3(_0x1f0de5),await _0x233827(),null;const _0x479eab=_0x330383(_0x42e893,_0x1f0de5,_0x486b74,{'upsert':_0xe2b793,'remove':_0x109561}),_0x3ab961=_0x479eab[_0x336fc8(0x176)]+_0x479eab[_0x336fc8(0x1d6)]+_0x479eab['removed'];_0x3ab961>0x0&&(_0x36e97c+=_0x3ab961,await _0x233827());}return _0x3b0df2;}_0x4413d3(_0x1f0de5??[]);if(_0x215c73['size']()>0x0)await _0x233827();return null;}async function _0x32f846(){_0x3122ad=!![],await _0x40d42f(await _0x5c1751());}async function _0x15cbab(){const _0x3a10c0=_0x53fa46;if(!_0x3122ad)return;_0x3122ad=![],_0x191928(),_0x36e97c=0x0;const _0x2ab60f=_0x2d2127[_0x3a10c0(0x1bb)]()||_0x2d2127[_0x3a10c0(0x14b)]();await _0x590cfd(_0x2ab60f),_0x4efd42();}async function _0x590cfd(_0x463893){const _0x249654=_0x53fa46;if(!_0x463893)return![];let _0x20c331=![];try{await _0x2d2127[_0x249654(0x14d)](_0x463893,async _0x11daf5=>{const _0x112bd1=_0x249654,_0x6cd542=JSON['parse'](_0x537f62[_0x112bd1(0x1b2)](_0x11daf5[_0x112bd1(0x172)],_0x112bd1(0x141)));if(_0x6cd542[_0x112bd1(0x17a)]!==_0x76bce1||_0x6cd542['algorithm']!=='usearch'||_0x6cd542[_0x112bd1(0x1a8)]!==_0x486b74||_0x6cd542[_0x112bd1(0x1c1)]!==_0x1c1484[_0x112bd1(0x1c1)])return;const _0x3672de=new _0x87a1ee();await _0x3672de[_0x112bd1(0x191)](_0x11daf5['labels']);const _0x5918d3=_0x4ab8b9();_0x5918d3[_0x112bd1(0x180)](_0x11daf5[_0x112bd1(0x1b8)]),_0x215c73=_0x5918d3,_0x42e893=_0x3672de,_0x4c4965=_0x463893,_0x20c331=!![];});}catch{}return _0x20c331;}function _0x5ae799(){const _0x1470a2=_0x53fa46,_0x31f653=Date[_0x1470a2(0x174)]();if(_0x31f653-_0x13eec5<_0x1c1484[_0x1470a2(0x1cb)])return;_0x13eec5=_0x31f653;if(_0x5c3942)return;if(_0x518c8d[_0x1470a2(0x1ea)]()){_0x5c3942=!![],_0x4ca809(async()=>{!_0x3122ad&&_0x45a9d7&&_0x518c8d['acquire']()&&(await _0x32f846(),_0x4efd42());})[_0x1470a2(0x165)](()=>{})[_0x1470a2(0x147)](()=>{_0x5c3942=![];});return;}const _0x376de9=_0x2d2127[_0x1470a2(0x1bb)]()||_0x2d2127[_0x1470a2(0x14b)]();if(!_0x376de9||_0x376de9===_0x4c4965)return;_0x5c3942=!![],_0x4ca809(async()=>{if(!_0x3122ad&&await _0x590cfd(_0x376de9))_0x4efd42();})[_0x1470a2(0x165)](()=>{})[_0x1470a2(0x147)](()=>{_0x5c3942=![];});}return{async 'load'(_0x1b7191){return _0x4ca809(async()=>{const _0x3ad04e=_0x3b7a;_0x2d2127[_0x3ad04e(0x1f1)]({'maxAgeMs':_0x1c1484['tmpMaxAgeMs']}),_0x16b451=_0x1b7191??null,_0x3122ad=_0x518c8d[_0x3ad04e(0x1ee)]();let _0xd43fa5=null;if(_0x3122ad)_0xd43fa5=await _0x40d42f(_0x1b7191?await _0x1b7191():null);else{const _0x253c1b=_0x2d2127[_0x3ad04e(0x1bb)]()||_0x2d2127[_0x3ad04e(0x14b)]();await _0x590cfd(_0x253c1b);}return _0x45a9d7=!![],_0xd43fa5;});},async 'add'(_0x13c5df,_0x14d73f,_0x22b24f){return _0x4ca809(async()=>{const _0x3e5bc7=_0x3b7a;if(!_0x45a9d7)return;const _0x3cb691=_0x35312d(_0x14d73f);if(!_0x3122ad){if(!_0x518c8d[_0x3e5bc7(0x1ee)]())return;await _0x32f846();}if(!_0x215c73)return;const _0x577def=_0xe6b816(_0x3cb691);if(_0x42e893['fingerprintOf'](_0x13c5df)===_0x577def)return;_0xe2b793(_0x13c5df,_0x3cb691,_0x577def),await _0x38e48a();});},async 'remove'(_0x2710a2){return _0x4ca809(async()=>{const _0x4d80be=_0x3b7a;if(!_0x45a9d7)return;if(!_0x3122ad){if(!_0x518c8d[_0x4d80be(0x1ee)]())return;await _0x32f846();}if(!_0x215c73)return;if(_0x109561(_0x2710a2))await _0x38e48a();});},'search'(_0x32e96f,{limit:limit=0xa}={}){const _0x119de3=_0x53fa46;if(!_0x3122ad&&_0x45a9d7)_0x5ae799();if(!_0x215c73)return[];const _0x49dd77=_0x215c73[_0x119de3(0x175)]();if(_0x49dd77===0x0)return[];const _0x303d28=Math[_0x119de3(0x169)](limit,_0x49dd77),_0x86e203=_0x215c73['search'](_0x35312d(_0x32e96f),_0x303d28,0x0),_0x3bca28=[],_0x30421b=_0x86e203[_0x119de3(0x1b5)],_0x224f72=_0x86e203[_0x119de3(0x1cd)];for(let _0x1c7d83=0x0;_0x1c7d83<_0x30421b['length'];_0x1c7d83++){const _0x19fd97=_0x30421b[_0x1c7d83];if(_0x19fd97===0xffffffffffffffffn)continue;const _0x95a3f5=Number(_0x19fd97),_0x45a3e9=_0x42e893[_0x119de3(0x17c)](_0x95a3f5);if(!_0x45a3e9)continue;const _0x1259e4=_0x224f72[_0x1c7d83];let _0x55a6c3;if(_0x1c1484[_0x119de3(0x1c1)]===_0x119de3(0x1cf))_0x55a6c3=Math[_0x119de3(0x1f6)](0x0,0x1-_0x1259e4);else{if(_0x1c1484[_0x119de3(0x1c1)]==='ip')_0x55a6c3=-_0x1259e4;else _0x55a6c3=0x1/(0x1+_0x1259e4);}_0x3bca28[_0x119de3(0x161)]({'key':_0x45a3e9,'score':_0x55a6c3});}return _0x3bca28;},async 'snapshot'(_0x4aea80){return _0x4ca809(()=>_0x3122ad?_0x233827(_0x4aea80??undefined):![]);},async 'rebuild'(_0x5d80fd){return _0x4ca809(async()=>{if(_0x5d80fd!=null)_0x16b451=_0x5d80fd;if(!_0x3122ad){if(!_0x518c8d['acquire']())return;_0x3122ad=!![];}const _0x439674=_0x5d80fd?await _0x5d80fd():await _0x5c1751();_0x4413d3(_0x439674??[]),_0x45a9d7=!![],await _0x233827();});},async 'stop'(){return _0x4ca809(async()=>{_0x191928();if(_0x3122ad){if(_0x36e97c>0x0||!_0x2d2127['readCurrentId']())await _0x233827();_0x518c8d['release']();}_0x3122ad=![],_0x45a9d7=![];});},'count'(){return _0x42e893['size']();},'info'(){const _0x3f3d8e=_0x53fa46;return{'algorithm':_0x3f3d8e(0x1e4),'role':_0x3122ad?_0x3f3d8e(0x194):_0x3f3d8e(0x199),'metric':_0x1c1484[_0x3f3d8e(0x1c1)],'connectivity':_0x1c1484[_0x3f3d8e(0x143)],'expansionAdd':_0x1c1484[_0x3f3d8e(0x1fb)],'expansionSearch':_0x1c1484[_0x3f3d8e(0x130)],'snapshotEveryChanges':_0x1c1484['snapshotEveryChanges'],'snapshotMaxLagMs':_0x1c1484[_0x3f3d8e(0x133)],'count':_0x42e893[_0x3f3d8e(0x175)](),'size':_0x215c73?.[_0x3f3d8e(0x175)]?.()??0x0,'capacity':_0x215c73?.['capacity']?.()??0x0,'changesSince':_0x3122ad?_0x36e97c:null,'viewedSnapshot':_0x4c4965??null,'snapshotDir':_0x4f24e9,'latestSnapshot':_0x2d2127[_0x3f3d8e(0x1bb)]()??null};}};},usearch;}var hasRequiredAlgorithmWorkerThread;function requireAlgorithmWorkerThread(){const _0x2bc72f=_0x2d7520;if(hasRequiredAlgorithmWorkerThread)return algorithmWorkerThread$1;hasRequiredAlgorithmWorkerThread=0x1;const {parentPort:_0x84704,workerData:_0xb46431}=require$$0$1,{algorithmName:_0x20c697,algorithmConfig:_0x104c4a,dims:_0x25aa9f,dir:_0x356614}=_0xb46431;let _0x285972=0x1;const _0x7c02ae=new Map();function _0x106602(){const _0xc8858a=_0x285972++;return new Promise((_0x3bedc0,_0x454ffd)=>{const _0x4d537c=_0x3b7a;_0x7c02ae[_0x4d537c(0x18a)](_0xc8858a,{'resolve':_0x3bedc0,'reject':_0x454ffd}),_0x84704['postMessage']({'op':'fetchAll','fid':_0xc8858a});});}const _0x491c62={'dims':_0x25aa9f,'dir':_0x356614,'fetchAll':_0x106602,'onChange':()=>_0x387960()};let _0x600e70;if(_0x20c697===_0x2bc72f(0x183))_0x600e70=requireHnsw()(_0x104c4a,_0x491c62);else{if(_0x20c697===_0x2bc72f(0x124))_0x600e70=requireFlat()(_0x104c4a,_0x491c62);else{if(_0x20c697===_0x2bc72f(0x1e4))_0x600e70=requireUsearch()(_0x104c4a,_0x491c62);else throw new Error(_0x2bc72f(0x1da)+_0x20c697+'\x22');}}function _0x387960(){const _0x13d165=_0x2bc72f;try{_0x84704['postMessage']({'op':_0x13d165(0x154),'count':_0x600e70[_0x13d165(0x140)](),'info':_0x600e70[_0x13d165(0x127)](),'memory':process[_0x13d165(0x1a4)]()});}catch{}}function _0x81b102(_0x2dd0c2){const _0x1fe71a=_0x2bc72f;return(_0x2dd0c2||[])[_0x1fe71a(0x1ab)](_0x4c352f=>({'key':_0x4c352f['key'],'vector':_0x4c352f[_0x1fe71a(0x198)]instanceof Float32Array?_0x4c352f[_0x1fe71a(0x198)]:new Float32Array(_0x4c352f[_0x1fe71a(0x198)])}));}return _0x84704['on'](_0x2bc72f(0x152),async _0x4a5734=>{const _0x407617=_0x2bc72f;if(_0x4a5734['op']===_0x407617(0x1e7)){const _0x45888a=_0x7c02ae[_0x407617(0x1c9)](_0x4a5734['fid']);if(!_0x45888a)return;_0x7c02ae[_0x407617(0x195)](_0x4a5734['fid']);if(_0x4a5734[_0x407617(0x1b0)])_0x45888a[_0x407617(0x162)](new Error(_0x4a5734['error']));else _0x45888a['resolve'](_0x81b102(_0x4a5734['vectors']));return;}const {id:_0x3f2b63,op:_0x3830a4,args:_0x37fc02}=_0x4a5734;try{let _0x4606c5;switch(_0x3830a4){case _0x407617(0x145):{_0x4606c5=await _0x600e70[_0x407617(0x145)](_0x37fc02[_0x407617(0x1a6)]?_0x106602:null),_0x387960();break;}case _0x407617(0x164):{const _0x57b38b=_0x37fc02[_0x407617(0x198)]instanceof Float32Array?_0x37fc02['vector']:new Float32Array(_0x37fc02[_0x407617(0x198)]);await _0x600e70[_0x407617(0x164)](_0x37fc02[_0x407617(0x159)],_0x57b38b,_0x37fc02[_0x407617(0x13b)]??undefined),_0x387960(),_0x4606c5=null;break;}case _0x407617(0x19d):{await _0x600e70[_0x407617(0x19d)](_0x37fc02[_0x407617(0x159)]),_0x387960(),_0x4606c5=null;break;}case _0x407617(0x153):{const _0x563045=_0x37fc02[_0x407617(0x16f)]instanceof Float32Array?_0x37fc02[_0x407617(0x16f)]:new Float32Array(_0x37fc02['queryVec']);_0x4606c5=_0x600e70[_0x407617(0x153)](_0x563045,_0x37fc02[_0x407617(0x197)]||{});break;}case'snapshot':{_0x4606c5=await _0x600e70['snapshot'](_0x37fc02[_0x407617(0x13b)]),_0x387960();break;}case _0x407617(0x1bd):{const _0x574f89=_0x81b102(_0x37fc02[_0x407617(0x1a5)]);await _0x600e70['rebuild'](async()=>_0x574f89),_0x387960(),_0x4606c5=null;break;}case _0x407617(0x1e5):{await _0x600e70[_0x407617(0x1e5)](),_0x387960(),_0x4606c5=null;break;}case _0x407617(0x140):{_0x4606c5=_0x600e70[_0x407617(0x140)]();break;}case _0x407617(0x127):{_0x4606c5=_0x600e70[_0x407617(0x127)]();break;}default:throw new Error(_0x407617(0x135)+_0x3830a4+'\x22');}_0x84704[_0x407617(0x13e)]({'id':_0x3f2b63,'result':_0x4606c5});}catch(_0x2aee9d){_0x84704[_0x407617(0x13e)]({'id':_0x3f2b63,'error':{'message':_0x2aee9d?.[_0x407617(0x152)]||String(_0x2aee9d),'code':_0x2aee9d?.[_0x407617(0x131)]}});}}),_0x84704[_0x2bc72f(0x13e)]({'op':_0x2bc72f(0x1be)}),algorithmWorkerThread$1;}var algorithmWorkerThreadExports=requireAlgorithmWorkerThread(),algorithmWorkerThread=getDefaultExportFromCjs(algorithmWorkerThreadExports);module['exports']=algorithmWorkerThread;
1
+ 'use strict';const _0x4eed99=_0x156b;(function(_0x3aca52,_0x565bdb){const _0x104523=_0x156b,_0x37c1ee=_0x3aca52();while(!![]){try{const _0x52ec28=parseInt(_0x104523(0x18f))/0x1+-parseInt(_0x104523(0x12e))/0x2*(parseInt(_0x104523(0x1a1))/0x3)+parseInt(_0x104523(0x17f))/0x4+-parseInt(_0x104523(0x142))/0x5+parseInt(_0x104523(0x152))/0x6+parseInt(_0x104523(0x1a0))/0x7+-parseInt(_0x104523(0x1b4))/0x8;if(_0x52ec28===_0x565bdb)break;else _0x37c1ee['push'](_0x37c1ee['shift']());}catch(_0x1a430e){_0x37c1ee['push'](_0x37c1ee['shift']());}}}(_0x4b1e,0x346f9));function _0x156b(_0x2c722d,_0x2f1491){_0x2c722d=_0x2c722d-0x118;const _0x4b1e1a=_0x4b1e();let _0x156b37=_0x4b1e1a[_0x2c722d];return _0x156b37;}var require$$0$1=require('worker_threads'),require$$0=require('fs'),require$$1=require(_0x4eed99(0x15f)),require$$2=require('os'),require$$3=require(_0x4eed99(0x120));function getDefaultExportFromCjs(_0xc52e7d){const _0x52faf1=_0x4eed99;return _0xc52e7d&&_0xc52e7d['__esModule']&&Object[_0x52faf1(0x19f)][_0x52faf1(0x1da)][_0x52faf1(0x134)](_0xc52e7d,_0x52faf1(0x1e0))?_0xc52e7d[_0x52faf1(0x1e0)]:_0xc52e7d;}var algorithmWorkerThread$1={},snapshotStore,hasRequiredSnapshotStore;function requireSnapshotStore(){const _0x4020b7=_0x4eed99;if(hasRequiredSnapshotStore)return snapshotStore;hasRequiredSnapshotStore=0x1;const _0x56eede=require$$0,_0x259e3f=require$$1,_0x15f925=require$$2,_0x4bd6c1=require$$3;function _0x1e2ba0(){const _0x56c592=_0x156b;return Date[_0x56c592(0x1e4)]();}function _0xa93444(_0x46c81a){try{return _0x56eede['existsSync'](_0x46c81a);}catch{return![];}}function _0x526347(_0x414d6c){const _0x43b958=_0x156b;try{return _0x56eede[_0x43b958(0x14a)](_0x414d6c,_0x43b958(0x189));}catch{return null;}}function _0x21dc53(_0x17898f,_0x63a31f){const _0x5a9c21=_0x156b,_0x52052e=_0x17898f+_0x5a9c21(0x149)+_0x4bd6c1[_0x5a9c21(0x1a2)](0x6)[_0x5a9c21(0x1e8)]('hex');_0x56eede[_0x5a9c21(0x1ea)](_0x52052e,_0x63a31f),_0x56eede[_0x5a9c21(0x18d)](_0x52052e,_0x17898f);}function _0x16ced2(_0x4f4ec0,_0x2b6c6d=0x10){const _0x3d02aa=_0x156b,_0x3ce5e6=String(Math[_0x3d02aa(0x1c3)](0x0,Math['trunc'](_0x4f4ec0||0x0)));return _0x3ce5e6[_0x3d02aa(0x11e)]>=_0x2b6c6d?_0x3ce5e6:'0'[_0x3d02aa(0x199)](_0x2b6c6d-_0x3ce5e6[_0x3d02aa(0x11e)])+_0x3ce5e6;}return snapshotStore=class _0x24cd90{constructor({dir:_0x2c7c30,keepSnapshots:keepSnapshots=0x3,log:log=null}={}){const _0x4b0f48=_0x156b;if(!_0x2c7c30)throw new Error(_0x4b0f48(0x185));this[_0x4b0f48(0x1b9)]=_0x2c7c30,this[_0x4b0f48(0x16f)]=_0x259e3f[_0x4b0f48(0x1b6)](_0x2c7c30,_0x4b0f48(0x1aa)),this['currentPath']=_0x259e3f['join'](_0x2c7c30,_0x4b0f48(0x14e)),this[_0x4b0f48(0x197)]=_0x259e3f[_0x4b0f48(0x1b6)](_0x2c7c30,_0x4b0f48(0x184)),this[_0x4b0f48(0x1d3)]=keepSnapshots,this[_0x4b0f48(0x13a)]=log,_0x56eede[_0x4b0f48(0x163)](this[_0x4b0f48(0x1b9)],{'recursive':!![]}),_0x56eede[_0x4b0f48(0x163)](this[_0x4b0f48(0x16f)],{'recursive':!![]});}[_0x4020b7(0x1d5)](_0x53b925){const _0x19987b=_0x4020b7;return _0x259e3f[_0x19987b(0x1b6)](this[_0x19987b(0x16f)],_0x53b925);}[_0x4020b7(0x17b)](_0x193c6b){const _0x5e1337=_0x4020b7,_0xa1b2c8=this[_0x5e1337(0x1d5)](_0x193c6b);return{'dir':_0xa1b2c8,'index':_0x259e3f['join'](_0xa1b2c8,_0x5e1337(0x1cd)),'labels':_0x259e3f[_0x5e1337(0x1b6)](_0xa1b2c8,_0x5e1337(0x153)),'state':_0x259e3f['join'](_0xa1b2c8,_0x5e1337(0x15d))};}[_0x4020b7(0x1d2)](){const _0x2c1d1d=_0x4020b7;if(!_0xa93444(this['currentPath']))return null;const _0x5a69cb=_0x526347(this[_0x2c1d1d(0x124)]);if(!_0x5a69cb)return null;const _0x41bb6c=String(_0x5a69cb)['trim']();return _0x41bb6c||null;}[_0x4020b7(0x1a8)](){const _0x108607=_0x4020b7,_0x7a4293=this[_0x108607(0x1d2)]();if(!_0x7a4293)return 0x0;const _0x68a7e=Number(_0x7a4293);return Number[_0x108607(0x1bc)](_0x68a7e)?_0x68a7e:0x0;}[_0x4020b7(0x187)](){const _0x1c4912=_0x4020b7;try{return _0x56eede[_0x1c4912(0x1ce)](this['snapshotsDir'],{'withFileTypes':!![]})[_0x1c4912(0x1df)](_0x29b5e3=>_0x29b5e3[_0x1c4912(0x144)]())[_0x1c4912(0x1ca)](_0x449695=>_0x449695[_0x1c4912(0x12d)])[_0x1c4912(0x1df)](_0x3dbfb6=>!_0x3dbfb6['startsWith']('.tmp-'))[_0x1c4912(0x1df)](_0x4e8395=>!_0x4e8395[_0x1c4912(0x133)](_0x1c4912(0x164)))[_0x1c4912(0x1c5)]();}catch{return[];}}[_0x4020b7(0x1ab)](){const _0x448031=_0x4020b7,_0x48eba3=this[_0x448031(0x1d2)]();if(_0x48eba3)return _0x48eba3;const _0x41762c=this[_0x448031(0x187)]();if(!_0x41762c[_0x448031(0x11e)])return null;return _0x41762c[_0x41762c[_0x448031(0x11e)]-0x1];}[_0x4020b7(0x175)]({maxAgeMs:maxAgeMs=0x6*0x36ee80}={}){const _0x1f45b7=_0x4020b7;let _0x46df4c;try{_0x46df4c=_0x56eede[_0x1f45b7(0x1ce)](this[_0x1f45b7(0x16f)],{'withFileTypes':!![]});}catch{return;}const _0x25f4f3=_0x1e2ba0()-maxAgeMs;for(const _0x47cf67 of _0x46df4c){if(!_0x47cf67[_0x1f45b7(0x144)]())continue;const _0x5351e0=_0x47cf67[_0x1f45b7(0x12d)];if(!_0x5351e0['startsWith'](_0x1f45b7(0x149))&&!_0x5351e0[_0x1f45b7(0x133)](_0x1f45b7(0x164)))continue;const _0x52624b=_0x259e3f[_0x1f45b7(0x1b6)](this[_0x1f45b7(0x16f)],_0x5351e0);try{const _0x1d9452=_0x56eede[_0x1f45b7(0x194)](_0x52624b);if(_0x1d9452[_0x1f45b7(0x1e1)]>_0x25f4f3)continue;}catch{}try{_0x56eede[_0x1f45b7(0x1be)](_0x52624b,{'recursive':!![],'force':!![]});}catch{}}}[_0x4020b7(0x135)]({keep:keep=null}={}){const _0xa6b7a7=_0x4020b7,_0x45b2be=Math['max'](0x1,Math[_0xa6b7a7(0x129)](keep??this['keepSnapshots']??0x3)),_0x13b561=this['listSnapshotIds']();if(_0x13b561[_0xa6b7a7(0x11e)]<=_0x45b2be)return;const _0x17ef9f=this[_0xa6b7a7(0x1d2)](),_0x112979=_0x13b561[_0xa6b7a7(0x130)](0x0,Math[_0xa6b7a7(0x1c3)](0x0,_0x13b561[_0xa6b7a7(0x11e)]-_0x45b2be));for(const _0x41904f of _0x112979){if(_0x17ef9f&&_0x41904f===_0x17ef9f)continue;const _0x42e24b=this[_0xa6b7a7(0x1d5)](_0x41904f);try{_0x56eede[_0xa6b7a7(0x1be)](_0x42e24b,{'recursive':!![],'force':!![]});}catch{}}}async['loadSnapshot'](_0x938190,_0x435ce7){const _0x59fc93=_0x4020b7;if(!_0x938190)throw new Error(_0x59fc93(0x1a3));const _0x27ce09=this[_0x59fc93(0x17b)](_0x938190);if(!_0xa93444(_0x27ce09[_0x59fc93(0x11c)])||!_0xa93444(_0x27ce09[_0x59fc93(0x17a)])||!_0xa93444(_0x27ce09[_0x59fc93(0x148)]))throw new Error(_0x59fc93(0x1d6)+_0x938190);const _0x149115=await _0x435ce7(_0x27ce09);return _0x149115||{};}async[_0x4020b7(0x140)](_0x2d8463,_0x97e323,{keep:keep=null,lockTimeoutMs:lockTimeoutMs=0x0,staleLockMaxAgeMs:staleLockMaxAgeMs=0xea60}={}){const _0x20fada=_0x4020b7,_0x12e688=Number(_0x2d8463);if(!Number['isFinite'](_0x12e688)||_0x12e688<0x0)throw new Error(_0x20fada(0x195));const _0x2d9fd7=_0x16ced2(_0x12e688),_0xb5192a=this[_0x20fada(0x1d5)](_0x2d9fd7),_0x1b93ae=_0x259e3f[_0x20fada(0x1b6)](this[_0x20fada(0x16f)],_0x20fada(0x149)+_0x2d9fd7+'-'+_0x4bd6c1[_0x20fada(0x1a2)](0x6)['toString']('hex'));_0x56eede['mkdirSync'](_0x1b93ae,{'recursive':!![]});const _0x264896={'dir':_0x1b93ae,'index':_0x259e3f[_0x20fada(0x1b6)](_0x1b93ae,_0x20fada(0x1cd)),'labels':_0x259e3f[_0x20fada(0x1b6)](_0x1b93ae,'labels.json'),'state':_0x259e3f['join'](_0x1b93ae,'state.json')};await _0x97e323(_0x264896,{'id':_0x2d9fd7,'clock':_0x12e688});const _0x107998=JSON[_0x20fada(0x14d)]({'pid':process[_0x20fada(0x181)],'host':_0x15f925[_0x20fada(0x188)](),'at':_0x1e2ba0()}),_0x22a089=_0x1e2ba0();let _0x4960a9=null;const _0xcfcd9e=()=>{const _0x39bf2d=_0x20fada;try{const _0xf47285=JSON[_0x39bf2d(0x1f3)](_0x56eede[_0x39bf2d(0x14a)](this[_0x39bf2d(0x197)],_0x39bf2d(0x189)));if(_0xf47285['at']&&_0x1e2ba0()-_0xf47285['at']>staleLockMaxAgeMs){const _0x317da3=_0x1e2ba0()-_0xf47285['at'],_0x10ae19=_0x39bf2d(0x1b3)+Math[_0x39bf2d(0x1b0)](_0x317da3/0x3e8)+_0x39bf2d(0x1bb)+_0xf47285['pid']+_0x39bf2d(0x145)+_0xf47285[_0x39bf2d(0x168)]+_0x39bf2d(0x143)+_0x39bf2d(0x1c2);this[_0x39bf2d(0x13a)]?.[_0x39bf2d(0x13c)]?this[_0x39bf2d(0x13a)][_0x39bf2d(0x13c)](_0x10ae19):console['warn'](_0x39bf2d(0x18a),_0x10ae19);try{_0x56eede[_0x39bf2d(0x118)](this[_0x39bf2d(0x197)]);}catch{}return!![];}}catch{try{_0x56eede[_0x39bf2d(0x118)](this[_0x39bf2d(0x197)]);}catch{}}return![];},_0x1c96f2=()=>{const _0x3b775c=_0x20fada;try{return _0x4960a9=_0x56eede[_0x3b775c(0x1cf)](this[_0x3b775c(0x197)],'wx'),_0x56eede[_0x3b775c(0x1ea)](_0x4960a9,_0x107998),!![];}catch(_0x2555b1){if(_0x2555b1&&_0x2555b1[_0x3b775c(0x1ad)]===_0x3b775c(0x17c))return![];throw _0x2555b1;}};if(!_0x1c96f2()){_0xcfcd9e(),_0x1c96f2();if(_0x4960a9==null&&lockTimeoutMs>0x0)while(_0x1e2ba0()-_0x22a089<lockTimeoutMs){await new Promise(_0xbf33a7=>setTimeout(_0xbf33a7,0x19));if(_0x1c96f2())break;_0xcfcd9e();}}if(_0x4960a9==null){try{_0x56eede['rmSync'](_0x1b93ae,{'recursive':!![],'force':!![]});}catch{}return{'published':![],'reason':_0x20fada(0x125)};}try{const _0x1a2cf4=this[_0x20fada(0x1a8)]();if(_0x12e688<=_0x1a2cf4){try{_0x56eede[_0x20fada(0x1be)](_0x1b93ae,{'recursive':!![],'force':!![]});}catch{}return{'published':![],'reason':'stale','currentClock':_0x1a2cf4};}if(!_0xa93444(_0xb5192a))_0x56eede[_0x20fada(0x18d)](_0x1b93ae,_0xb5192a);else try{_0x56eede[_0x20fada(0x1be)](_0x1b93ae,{'recursive':!![],'force':!![]});}catch{}return _0x21dc53(this[_0x20fada(0x124)],_0x2d9fd7+'\x0a'),this[_0x20fada(0x135)]({'keep':keep}),{'published':!![],'currentClock':_0x12e688};}finally{try{_0x56eede['closeSync'](_0x4960a9);}catch{}try{_0x56eede[_0x20fada(0x118)](this[_0x20fada(0x197)]);}catch{}}}},snapshotStore;}var labelMap,hasRequiredLabelMap;function requireLabelMap(){const _0x2544a9=_0x4eed99;if(hasRequiredLabelMap)return labelMap;hasRequiredLabelMap=0x1;const _0x53a33d=require$$0;class _0xdfb5ab{constructor(){const _0x20a0c6=_0x156b;this['keyToLabel']=new Map(),this[_0x20a0c6(0x128)]=new Map(),this['nextLabel']=0x0,this['_tombstoneCount']=0x0,this['keyToFp']=new Map(),this[_0x20a0c6(0x1c4)]=!![];}async[_0x2544a9(0x160)](){const _0x105e61=_0x2544a9;this['keyToLabel']=new Map(),this[_0x105e61(0x128)]=new Map(),this['keyToFp']=new Map(),this['hasFingerprints']=!![],this[_0x105e61(0x1d4)]=0x0,this[_0x105e61(0x1d9)]=0x0;}async['loadFrom'](_0x4e969c){const _0x332247=_0x2544a9;if(!_0x4e969c||!_0x53a33d[_0x332247(0x1ec)](_0x4e969c))return await this[_0x332247(0x160)](),!![];let _0x4ea9b4;try{_0x4ea9b4=_0x53a33d['readFileSync'](_0x4e969c,'utf8');}catch{return await this[_0x332247(0x160)](),!![];}let _0x460b7f;try{_0x460b7f=JSON[_0x332247(0x1f3)](_0x4ea9b4);}catch{return await this[_0x332247(0x160)](),!![];}const _0xd058c2=Array['isArray'](_0x460b7f?.['entries'])?_0x460b7f[_0x332247(0x166)]:[],_0x45899e=Number[_0x332247(0x174)](_0x460b7f?.[_0x332247(0x1d4)])?_0x460b7f[_0x332247(0x1d4)]:0x0,_0x5cd9b=new Map(),_0x49ec94=new Map(),_0x4fc454=new Map(),_0x3e1f7e=_0x460b7f?.['version']>=0x2;let _0xa45346=-0x1;for(const _0xcdbc58 of _0xd058c2){if(!Array[_0x332247(0x158)](_0xcdbc58)||_0xcdbc58[_0x332247(0x11e)]<0x2)continue;const _0x58b28f=Number(_0xcdbc58[0x0]),_0x574130=String(_0xcdbc58[0x1]??'');if(!Number[_0x332247(0x174)](_0x58b28f)||_0x58b28f<0x0)continue;if(!_0x574130)continue;_0x5cd9b[_0x332247(0x169)](_0x574130,_0x58b28f),_0x49ec94['set'](_0x58b28f,_0x574130);if(_0x3e1f7e&&typeof _0xcdbc58[0x2]==='number')_0x4fc454[_0x332247(0x169)](_0x574130,_0xcdbc58[0x2]);if(_0x58b28f>_0xa45346)_0xa45346=_0x58b28f;}return this[_0x332247(0x146)]=_0x5cd9b,this['labelToKey']=_0x49ec94,this[_0x332247(0x155)]=_0x4fc454,this[_0x332247(0x1c4)]=_0x3e1f7e,this[_0x332247(0x1d4)]=Math[_0x332247(0x1c3)](_0x45899e,_0xa45346+0x1,0x0),this['_tombstoneCount']=0x0,!![];}[_0x2544a9(0x19a)](_0x43cf55){const _0x4ad0c4=_0x2544a9;return this[_0x4ad0c4(0x146)]['get'](_0x43cf55);}[_0x2544a9(0x147)](_0x4cafa9){const _0x36b8da=_0x2544a9;let _0x562532=this['keyToLabel'][_0x36b8da(0x1b5)](_0x4cafa9);if(_0x562532!==undefined)return _0x562532;return _0x562532=this[_0x36b8da(0x1d4)]++,this['keyToLabel'][_0x36b8da(0x169)](_0x4cafa9,_0x562532),this[_0x36b8da(0x128)][_0x36b8da(0x169)](_0x562532,_0x4cafa9),_0x562532;}[_0x2544a9(0x176)](_0x3238f7,_0x3ef4a5){const _0x28d49c=_0x2544a9;if(_0x3ef4a5==null)this['keyToFp'][_0x28d49c(0x170)](_0x3238f7);else this[_0x28d49c(0x155)][_0x28d49c(0x169)](_0x3238f7,_0x3ef4a5);}[_0x2544a9(0x138)](_0x2c31b9){const _0x404007=_0x2544a9;return this[_0x404007(0x155)][_0x404007(0x1b5)](_0x2c31b9);}[_0x2544a9(0x161)](){const _0x391ed6=_0x2544a9;return this[_0x391ed6(0x146)][_0x391ed6(0x161)]();}[_0x2544a9(0x198)](_0x8a119f){const _0x276aed=_0x2544a9,_0x4f1668=this[_0x276aed(0x146)][_0x276aed(0x1b5)](_0x8a119f);if(_0x4f1668===undefined)return;this[_0x276aed(0x155)][_0x276aed(0x170)](_0x8a119f),this[_0x276aed(0x146)]['delete'](_0x8a119f),this['labelToKey'][_0x276aed(0x170)](_0x4f1668),this[_0x276aed(0x1d9)]++;}[_0x2544a9(0x13e)](_0x2e114b){const _0x1dd9dd=_0x2544a9;return this[_0x1dd9dd(0x128)][_0x1dd9dd(0x1b5)](_0x2e114b)??null;}[_0x2544a9(0x131)](){const _0x31b34a=_0x2544a9;return this[_0x31b34a(0x146)][_0x31b34a(0x131)];}[_0x2544a9(0x1a4)](){const _0x305644=_0x2544a9;return this[_0x305644(0x1d9)];}async[_0x2544a9(0x15b)](_0x5d24f7){const _0x55e3db=_0x2544a9,_0x197f60=_0x5d24f7+_0x55e3db(0x11d),_0x506261=[];for(const [_0x4c49ec,_0x50287b]of this['labelToKey']['entries']()){const _0x366d40=this[_0x55e3db(0x155)]['get'](_0x50287b);_0x506261['push'](_0x366d40==null?[_0x4c49ec,_0x50287b]:[_0x4c49ec,_0x50287b,_0x366d40]);}_0x506261[_0x55e3db(0x1c5)]((_0x2a920b,_0x329b1e)=>_0x2a920b[0x0]-_0x329b1e[0x0]);const _0x1d7507={'version':0x2,'nextLabel':this[_0x55e3db(0x1d4)],'entries':_0x506261};_0x53a33d['writeFileSync'](_0x197f60,JSON[_0x55e3db(0x14d)](_0x1d7507)),_0x53a33d[_0x55e3db(0x18d)](_0x197f60,_0x5d24f7);}}return labelMap=_0xdfb5ab,labelMap;}function _0x4b1e(){const _0x233a92=['efConstruction','MetricKind','setEf','index','.tmp','length','cosine','crypto','arch','vectors','ready','currentPath','lock_busy','tmpMaxAgeMs','algorithm','labelToKey','trunc','maxElements','key','heartbeatIntervalMs','name','5314bDhUyA','clock','slice','size','removed','startsWith','call','prune','metric','getMaxElements','fingerprintOf','unref','log','connectivity','warn','F32','keyForLabel','ENOENT','publishSnapshot','Index','507555ygBQot',').\x20','isDirectory',',\x20host:\x20','keyToLabel','labelForEphemeral','state','.tmp-','readFileSync','loadSnapshot','score','stringify','CURRENT','message','finally','resolve','958470WhPOLp','labels.json','distances','keyToFp','markDelete','stop','isArray','expansionSearch','vector','snapshotTo','buffer','state.json','remove','path','reset','keys','\x20on\x20','mkdirSync','_tmp-','info','entries','writer','host','set','load','writeIndexSync','rebuild','search','searchKnn','snapshotsDir','delete','hnsw','usearch\x20algorithm\x20requires\x20dims\x20>\x200','min','isInteger','cleanupTmpDirs','setFingerprint','closeSync','count','viewRefreshMs','labels','_snapshotPaths','EEXIST','hnswlib-node','reader','1297008xicmEZ','loadFrom','pid','isFree','L2sq','SNAPSHOT.LOCK','SnapshotStore\x20requires\x20dir','HierarchicalNSW','listSnapshotIds','hostname','utf8','[SnapshotStore]','token','hnsw\x20algorithm\x20requires\x20dir\x20for\x20snapshot\x20storage','renameSync','opts','37530kDNaEL','HNSW\x20algorithm\x20unavailable:\x20the\x20native\x20\x22hnswlib-node\x22\x20bindings\x20could\x20not\x20be\x20loaded\x20','expansionAdd','platform','efSearch','statSync','candidateClock\x20must\x20be\x20finite\x20>=\x200','unreadable','lockPath','tombstone','repeat','labelForExisting','changed','view','resizeIndex','error','prototype','2401525iOPtXv','57eTwSck','randomBytes','snapshot\x20id\x20required','tombstoneCount','initIndex','usearch\x20algorithm\x20requires\x20dir\x20for\x20snapshot\x20storage','acquire','readCurrentClock','hex','snapshots','latestSnapshotId','getCurrentCount','code','from','flat','round','add','versions','Breaking\x20stale\x20snapshot\x20lock\x20(age:\x20','3982648CCDGNY','get','join','snapshotMaxLagMs','growFactor','dir','usearch','s,\x20pid:\x20','isFinite','HNSW_BINDINGS_UNAVAILABLE','rmSync','Original\x20error:\x20','Unknown\x20op:\x20\x22','manifestVersion','This\x20is\x20risky\x20on\x20slow\x20disks\x20or\x20overloaded\x20machines.\x20Consider\x20increasing\x20staleLockMaxAgeMs\x20if\x20this\x20happens\x20frequently.','max','hasFingerprints','sort','hnsw\x20algorithm\x20requires\x20dims\x20>\x200','cause','catch','fid','map','writerLockMaxAgeMs','readIndexSync','index.hnsw','readdirSync','openSync','fetchAll','Cos','readCurrentId','keepSnapshots','nextLabel','_snapshotDir','snapshot\x20incomplete:\x20','node','for\x20Node\x20','_tombstoneCount','hasOwnProperty','ceil','memoryUsage','USEARCH_BINDINGS_UNAVAILABLE','byteOffset','filter','default','mtimeMs','snapshotEveryChanges','reject','now','sync','snapshot','published','toString','postMessage','writeFileSync','then','existsSync','dims','has','fetchAllResult','WRITER.LOCK','save','imul','parse','push','Install\x20compatible\x20bindings\x20or\x20use\x20algorithm\x20\x22flat\x22\x20instead.\x20','unlinkSync'];_0x4b1e=function(){return _0x233a92;};return _0x4b1e();}var indexConvergence,hasRequiredIndexConvergence;function requireIndexConvergence(){if(hasRequiredIndexConvergence)return indexConvergence;hasRequiredIndexConvergence=0x1;function _0x3de669(_0x3f4c9c){const _0x34f329=_0x156b,_0x1dc662=new Uint32Array(_0x3f4c9c[_0x34f329(0x15c)],_0x3f4c9c[_0x34f329(0x1de)],_0x3f4c9c['length']);let _0x343d0f=0x811c9dc5,_0x38ba16=0x9747b28c;for(let _0x31950f=0x0;_0x31950f<_0x1dc662['length'];_0x31950f++){const _0xb8917f=_0x1dc662[_0x31950f];_0x343d0f=Math[_0x34f329(0x1f2)](_0x343d0f^_0xb8917f,0x1000193)>>>0x0;let _0x58d4e5=Math[_0x34f329(0x1f2)](_0xb8917f,0xcc9e2d51);_0x58d4e5=_0x58d4e5<<0xf|_0x58d4e5>>>0x11,_0x38ba16=Math[_0x34f329(0x1f2)](_0x38ba16^Math[_0x34f329(0x1f2)](_0x58d4e5,0x1b873593),0x5)+0xe6546b64,_0x38ba16>>>=0x0;}return _0x38ba16=Math[_0x34f329(0x1f2)](_0x38ba16^_0x38ba16>>>0x10,0x85ebca6b)>>>0x0,(_0x343d0f>>>0x0)*0x100000+(_0x38ba16&0xfffff);}function _0x4129c1(_0x525ca3,_0xdc3f9b,_0x588d34,{upsert:_0x41c910,remove:_0x365cf7}){const _0x482919=_0x156b,_0x12e8ce=new Set();let _0x48b490=0x0,_0x4ee804=0x0,_0x7b38d8=0x0;for(const {key:_0x5439f7,vector:_0x5e80a9}of _0xdc3f9b){if(!(_0x5e80a9 instanceof Float32Array)||_0x5e80a9[_0x482919(0x11e)]!==_0x588d34)continue;_0x12e8ce[_0x482919(0x1b1)](_0x5439f7);const _0x4a9adf=_0x3de669(_0x5e80a9),_0x562dd4=_0x525ca3[_0x482919(0x19a)](_0x5439f7)!==undefined;if(_0x562dd4&&_0x525ca3[_0x482919(0x138)](_0x5439f7)===_0x4a9adf)continue;_0x41c910(_0x5439f7,_0x5e80a9,_0x4a9adf);if(_0x562dd4)_0x4ee804++;else _0x48b490++;}for(const _0x412d5f of[..._0x525ca3[_0x482919(0x161)]()]){if(_0x12e8ce[_0x482919(0x1ee)](_0x412d5f))continue;_0x365cf7(_0x412d5f),_0x7b38d8++;}return{'added':_0x48b490,'changed':_0x4ee804,'removed':_0x7b38d8};}return indexConvergence={'fingerprint':_0x3de669,'reconcileIndex':_0x4129c1},indexConvergence;}var hnsw,hasRequiredHnsw;function requireHnsw(){if(hasRequiredHnsw)return hnsw;hasRequiredHnsw=0x1;const _0x557ce7=requireSnapshotStore(),_0x43dd87=requireLabelMap(),{fingerprint:_0x329d56,reconcileIndex:_0x38d4fd}=requireIndexConvergence(),_0x1f9987=0x1;let _0x415250=null;function _0x30ac40(){const _0x122b2b=_0x156b;if(_0x415250)return _0x415250;try{return _0x415250=require(_0x122b2b(0x17d)),_0x415250;}catch(_0x270acf){const _0x3c4a01=new Error(_0x122b2b(0x190)+(_0x122b2b(0x1d8)+process[_0x122b2b(0x1b2)]['node']+_0x122b2b(0x162)+process['platform']+'/'+process[_0x122b2b(0x121)]+'.\x20')+_0x122b2b(0x1f5)+(_0x122b2b(0x1bf)+(_0x270acf?.[_0x122b2b(0x14f)]||String(_0x270acf))));_0x3c4a01['code']=_0x122b2b(0x1bd),_0x3c4a01[_0x122b2b(0x1c7)]=_0x270acf;throw _0x3c4a01;}}return hnsw=function _0x247a32(_0x37a652={},{dims:_0x3e90b3,dir:_0xfe8058}){const _0xa10ee0=_0x156b,_0x181b13=_0x30ac40();if(!_0x3e90b3||_0x3e90b3<=0x0)throw new Error(_0xa10ee0(0x1c6));if(!_0xfe8058)throw new Error(_0xa10ee0(0x18c));const _0x16728d={'metric':_0x37a652[_0xa10ee0(0x136)]??_0xa10ee0(0x11f),'M':_0x37a652['M']??0x10,'efConstruction':_0x37a652[_0xa10ee0(0x119)]??0xc8,'efSearch':_0x37a652[_0xa10ee0(0x193)]??0x40,'maxElements':_0x37a652[_0xa10ee0(0x12a)]??0x400,'growFactor':_0x37a652[_0xa10ee0(0x1b8)]??0x2,'snapshotEveryChanges':_0x37a652['snapshotEveryChanges']??0xc350,'keepSnapshots':_0x37a652[_0xa10ee0(0x1d3)]??0x2,'tmpMaxAgeMs':_0x37a652['tmpMaxAgeMs']??0x6*0x36ee80},_0x105736=new _0x557ce7({'dir':_0xfe8058,'keepSnapshots':_0x16728d['keepSnapshots']}),_0x4766aa=new _0x43dd87();let _0x266b0b=null,_0x30b9cc=0x0,_0x150668=null,_0x5cae69=Promise[_0xa10ee0(0x151)]();const _0x302383=_0x101f9f=>{const _0x57350c=_0xa10ee0,_0x2760b6=_0x5cae69[_0x57350c(0x1eb)](_0x101f9f);return _0x5cae69=_0x2760b6[_0x57350c(0x1c8)](()=>{}),_0x2760b6;};async function _0x1be4a8(_0x9a4bee){const _0x437e5b=_0xa10ee0;await _0x4766aa[_0x437e5b(0x160)](),_0x9a4bee=_0x9a4bee??[];const _0xcf2fe=Math[_0x437e5b(0x1c3)](_0x16728d['maxElements'],Math[_0x437e5b(0x1db)](_0x9a4bee[_0x437e5b(0x11e)]*(_0x16728d[_0x437e5b(0x1b8)]||1.2)),0x1);_0x266b0b=new _0x181b13[(_0x437e5b(0x186))](_0x16728d[_0x437e5b(0x136)],_0x3e90b3),_0x266b0b[_0x437e5b(0x1a5)]({'maxElements':_0xcf2fe,'efConstruction':_0x16728d[_0x437e5b(0x119)],'M':_0x16728d['M']});for(const {key:_0x59b0dd,vector:_0x9878a1}of _0x9a4bee){if(!(_0x9878a1 instanceof Float32Array)||_0x9878a1[_0x437e5b(0x11e)]!==_0x3e90b3)continue;_0x5f1939(_0x59b0dd,_0x9878a1);}_0x266b0b[_0x437e5b(0x11b)](_0x16728d[_0x437e5b(0x193)]),_0x30b9cc=0x0;}async function _0x168d1e(_0xc62517){return _0x1be4a8(_0xc62517?await _0xc62517():[]);}function _0x3bbc20(){const _0x4f7e17=_0xa10ee0;if(_0x266b0b[_0x4f7e17(0x1ac)]()<_0x266b0b[_0x4f7e17(0x137)]())return;const _0x469e10=Math[_0x4f7e17(0x1db)](_0x266b0b[_0x4f7e17(0x137)]()*(_0x16728d['growFactor']||0x2));_0x266b0b[_0x4f7e17(0x19d)](_0x469e10),_0x16728d[_0x4f7e17(0x12a)]=_0x469e10;}function _0x5f1939(_0xa25205,_0x583ec7,_0x4d4ebc){const _0x4b0f64=_0xa10ee0,_0x5c442e=_0x4766aa[_0x4b0f64(0x147)](_0xa25205);try{_0x266b0b[_0x4b0f64(0x156)](_0x5c442e);}catch{}_0x3bbc20(),_0x266b0b['addPoint'](Array[_0x4b0f64(0x1ae)](_0x583ec7),_0x5c442e),_0x4766aa[_0x4b0f64(0x176)](_0xa25205,_0x4d4ebc??_0x329d56(_0x583ec7));}function _0x55edb7(_0x4081c8){const _0x2b727e=_0xa10ee0,_0x272f42=_0x4766aa[_0x2b727e(0x19a)](_0x4081c8);if(_0x272f42===undefined)return![];try{_0x266b0b[_0x2b727e(0x156)](_0x272f42);}catch{}return _0x4766aa[_0x2b727e(0x198)](_0x4081c8),!![];}function _0x463721(){const _0x4de843=_0xa10ee0;return Math['max'](Date['now'](),_0x105736[_0x4de843(0x1a8)]()+0x1);}async function _0x10a3f5(_0x505ea0){const _0x2ca20e=_0xa10ee0;if(!_0x266b0b||!_0x505ea0)return![];const _0x108d10=await _0x105736[_0x2ca20e(0x140)](_0x505ea0,async _0x2f8c83=>{const _0x55945a=_0x2ca20e;_0x266b0b[_0x55945a(0x16b)](_0x2f8c83['index']),await _0x4766aa[_0x55945a(0x15b)](_0x2f8c83[_0x55945a(0x17a)]);const _0x3db385=require$$0;_0x3db385['writeFileSync'](_0x2f8c83[_0x55945a(0x148)],JSON['stringify']({'manifestVersion':_0x1f9987,'dims':_0x3e90b3,'metric':_0x16728d['metric'],'clock':_0x505ea0,'snapshotAt':Date[_0x55945a(0x1e4)]()},null,0x2));},{'keep':_0x16728d[_0x2ca20e(0x1d3)]});if(_0x108d10?.['published'])_0x30b9cc=0x0;return _0x108d10?.['published']??![];}async function _0xa2fdee(){const _0x58d274=_0xa10ee0,_0x544af0=_0x105736[_0x58d274(0x1d2)]()||_0x105736[_0x58d274(0x1ab)]();if(!_0x544af0)return null;let _0x4be05b,_0x41ea3d=![];return await _0x105736[_0x58d274(0x14b)](_0x544af0,async _0x3dfc77=>{const _0x16a860=_0x58d274,_0x1c15d4=require$$0;_0x4be05b=JSON[_0x16a860(0x1f3)](_0x1c15d4[_0x16a860(0x14a)](_0x3dfc77['state'],_0x16a860(0x189)));if(_0x4be05b[_0x16a860(0x1c1)]!==_0x1f9987||_0x4be05b[_0x16a860(0x1ed)]!==_0x3e90b3||_0x4be05b['metric']!==_0x16728d[_0x16a860(0x136)]){_0x4be05b=null;return;}await _0x4766aa['loadFrom'](_0x3dfc77[_0x16a860(0x17a)]),_0x266b0b=new _0x181b13[(_0x16a860(0x186))](_0x16728d[_0x16a860(0x136)],_0x3e90b3),_0x266b0b[_0x16a860(0x1cc)](_0x3dfc77[_0x16a860(0x11c)]),_0x266b0b['setEf'](_0x16728d[_0x16a860(0x193)]),_0x41ea3d=!![];}),_0x41ea3d?_0x4be05b?.['clock']??0x0:null;}return{async 'load'(_0x2eda64){return _0x302383(async()=>{const _0x2d3aad=_0x156b;_0x105736[_0x2d3aad(0x175)]({'maxAgeMs':_0x16728d[_0x2d3aad(0x126)]}),_0x150668=_0x2eda64??null;const _0x3f7fe9=await _0xa2fdee(),_0x6fa7b9=_0x2eda64?await _0x2eda64():null;if(_0x3f7fe9!=null){if(_0x6fa7b9){if(!_0x4766aa[_0x2d3aad(0x1c4)])return await _0x1be4a8(_0x6fa7b9),null;const _0x2cdce0=_0x38d4fd(_0x4766aa,_0x6fa7b9,_0x3e90b3,{'upsert':_0x5f1939,'remove':_0x55edb7});_0x30b9cc+=_0x2cdce0['added']+_0x2cdce0[_0x2d3aad(0x19b)]+_0x2cdce0[_0x2d3aad(0x132)];}return _0x3f7fe9;}return await _0x1be4a8(_0x6fa7b9),null;});},async 'add'(_0x4f7061,_0x176856,_0x1e5646){return _0x302383(async()=>{const _0x36d670=_0x156b;if(!_0x266b0b)return;const _0x2bf4ff=_0x176856 instanceof Float32Array?_0x176856:new Float32Array(_0x176856),_0x53ceda=_0x329d56(_0x2bf4ff);if(_0x4766aa[_0x36d670(0x138)](_0x4f7061)===_0x53ceda)return;_0x5f1939(_0x4f7061,_0x2bf4ff,_0x53ceda),_0x30b9cc++,_0x30b9cc>=_0x16728d[_0x36d670(0x1e2)]&&await _0x10a3f5(_0x463721());});},async 'remove'(_0x18e845){return _0x302383(async()=>{if(!_0x266b0b)return;if(_0x55edb7(_0x18e845))_0x30b9cc++;});},'search'(_0x340c98,{limit:limit=0xa,efSearch:_0x52cebc}={}){const _0x52377f=_0xa10ee0;if(!_0x266b0b)return[];if(Number['isInteger'](_0x52cebc))_0x266b0b[_0x52377f(0x11b)](_0x52cebc);const _0x3782ae=Math[_0x52377f(0x173)](limit,_0x266b0b[_0x52377f(0x1ac)]()||0x1),{neighbors:_0xa000dc,distances:_0xf3dffb}=_0x266b0b[_0x52377f(0x16e)](Array[_0x52377f(0x1ae)](_0x340c98),_0x3782ae),_0xc01819=[];for(let _0x4e05a7=0x0;_0x4e05a7<_0xa000dc['length'];_0x4e05a7++){const _0xf45872=_0x4766aa['keyForLabel'](_0xa000dc[_0x4e05a7]);if(!_0xf45872)continue;const _0x188ff9=_0x16728d[_0x52377f(0x136)]==='cosine'?Math[_0x52377f(0x1c3)](0x0,0x1-_0xf3dffb[_0x4e05a7]):0x1/(0x1+_0xf3dffb[_0x4e05a7]);_0xc01819[_0x52377f(0x1f4)]({'key':_0xf45872,'score':_0x188ff9});}return _0xc01819;},async 'snapshot'(_0x59f1b0){return _0x302383(()=>_0x10a3f5(_0x59f1b0??_0x463721()));},async 'rebuild'(_0x1c3383){return _0x302383(()=>{if(_0x1c3383!=null)_0x150668=_0x1c3383;return _0x168d1e(_0x1c3383??_0x150668);});},async 'stop'(){const _0x14df8c=_0xa10ee0;return _0x302383(()=>_0x30b9cc>0x0||!_0x105736[_0x14df8c(0x1d2)]()?_0x10a3f5(_0x463721()):![]);},'count'(){const _0x323144=_0xa10ee0;return _0x4766aa[_0x323144(0x131)]();},'info'(){const _0x3a444e=_0xa10ee0;return{'algorithm':_0x3a444e(0x171),'metric':_0x16728d[_0x3a444e(0x136)],'M':_0x16728d['M'],'efConstruction':_0x16728d[_0x3a444e(0x119)],'efSearch':_0x16728d[_0x3a444e(0x193)],'maxElements':_0x266b0b?.['getMaxElements']()??_0x16728d[_0x3a444e(0x12a)],'count':_0x4766aa['size'](),'changesSince':_0x30b9cc,'snapshotDir':_0xfe8058,'latestSnapshot':_0x105736['readCurrentId']()??null};}};},hnsw;}var flat,hasRequiredFlat;function requireFlat(){if(hasRequiredFlat)return flat;hasRequiredFlat=0x1,flat=function _0x9fa58e(_0x1c5a29={}){const _0x533777=new Map();return{async 'load'(_0x2fe6b0){_0x533777['clear']();if(_0x2fe6b0)for(const {key:_0x4200e0,vector:_0x522e40}of await _0x2fe6b0()){_0x533777['set'](_0x4200e0,_0x522e40);}},async 'add'(_0x3e14b6,_0x444ad3,_0x12d38c){_0x533777['set'](_0x3e14b6,_0x444ad3);},async 'remove'(_0x19f893){const _0x8a6f1d=_0x156b;_0x533777[_0x8a6f1d(0x170)](_0x19f893);},'search'(_0x4f84e2,{limit:limit=0xa,threshold:threshold=0x0}={}){const _0x5c60da=_0x156b,_0x43c414=[];for(const [_0x455012,_0xd0a36c]of _0x533777){const _0x43eb25=_0x3581a3(_0x4f84e2,_0xd0a36c);if(_0x43eb25>=threshold)_0x43c414[_0x5c60da(0x1f4)]({'key':_0x455012,'score':_0x43eb25});}return _0x43c414[_0x5c60da(0x1c5)]((_0x3c7ca0,_0x23cde0)=>_0x23cde0['score']-_0x3c7ca0[_0x5c60da(0x14c)]),_0x43c414['slice'](0x0,limit);},async 'snapshot'(){return![];},async 'rebuild'(_0x163b53){const _0x19df8d=_0x156b;await this[_0x19df8d(0x16a)](_0x163b53);},async 'stop'(){},'count'(){const _0x4fb166=_0x156b;return _0x533777[_0x4fb166(0x131)];},'info'(){const _0x3bf44b=_0x156b;return{'algorithm':_0x3bf44b(0x1af),'count':_0x533777[_0x3bf44b(0x131)]};}};};function _0x3581a3(_0x356103,_0x53c180){const _0x12ecf2=_0x156b;let _0x47fa94=0x0,_0x816fe7=0x0,_0x1ff549=0x0;for(let _0x94fef1=0x0;_0x94fef1<_0x356103[_0x12ecf2(0x11e)];_0x94fef1++){_0x47fa94+=_0x356103[_0x94fef1]*_0x53c180[_0x94fef1],_0x816fe7+=_0x356103[_0x94fef1]*_0x356103[_0x94fef1],_0x1ff549+=_0x53c180[_0x94fef1]*_0x53c180[_0x94fef1];}const _0x1ca317=Math['sqrt'](_0x816fe7)*Math['sqrt'](_0x1ff549);return _0x1ca317===0x0?0x0:_0x47fa94/_0x1ca317;}return flat;}var writerLock,hasRequiredWriterLock;function requireWriterLock(){if(hasRequiredWriterLock)return writerLock;hasRequiredWriterLock=0x1;const _0xf32dc6=require$$0,_0x137cdf=require$$1,_0x16db22=require$$3;return writerLock=function _0x2a9b94(_0x1a6edc,{maxAgeMs:maxAgeMs=0x3a98,heartbeatMs:heartbeatMs=0x1388,onLost:onLost=null}={}){const _0x134f38=_0x156b,_0x5ebf0b=_0x137cdf['join'](_0x1a6edc,_0x134f38(0x1f0)),_0x45b3a4=_0x16db22[_0x134f38(0x1a2)](0x8)[_0x134f38(0x1e8)](_0x134f38(0x1a9));let _0x5b5f3c=![],_0x23a7c0=null;const _0x4b0d6b=()=>JSON[_0x134f38(0x14d)]({'pid':process[_0x134f38(0x181)],'token':_0x45b3a4,'at':Date[_0x134f38(0x1e4)]()});function _0x1c46f1(){const _0x1c7ab3=_0x134f38;try{return JSON[_0x1c7ab3(0x1f3)](_0xf32dc6[_0x1c7ab3(0x14a)](_0x5ebf0b,'utf8'));}catch(_0x53c9a6){return _0x53c9a6?.[_0x1c7ab3(0x1ad)]===_0x1c7ab3(0x13f)?null:{'unreadable':!![]};}}function _0x3786cb(){const _0x538221=_0x134f38;try{const _0xd9d1e4=_0xf32dc6[_0x538221(0x1cf)](_0x5ebf0b,'wx');try{_0xf32dc6['writeFileSync'](_0xd9d1e4,_0x4b0d6b());}finally{_0xf32dc6[_0x538221(0x177)](_0xd9d1e4);}return!![];}catch(_0x1558d3){if(_0x1558d3?.['code']===_0x538221(0x17c))return![];throw _0x1558d3;}}function _0x11e651(_0x2bc38a){const _0x502635=_0x134f38;if(!_0x2bc38a)return!![];if(_0x2bc38a[_0x502635(0x196)])return!![];return Date['now']()-(_0x2bc38a['at']??0x0)>=maxAgeMs;}function _0x39530c(){if(_0x23a7c0)clearInterval(_0x23a7c0);_0x23a7c0=null;}function _0x225ce0(){const _0xcdd14c=_0x134f38;_0x39530c(),_0x23a7c0=setInterval(()=>{const _0xe2823b=_0x156b,_0xf6bc48=_0x1c46f1();if(_0xf6bc48&&!_0xf6bc48[_0xe2823b(0x196)]&&_0xf6bc48[_0xe2823b(0x18b)]!==_0x45b3a4){_0x5b5f3c=![],_0x39530c();try{onLost?.();}catch{}return;}try{_0xf32dc6[_0xe2823b(0x1ea)](_0x5ebf0b,_0x4b0d6b());}catch{}},heartbeatMs),_0x23a7c0[_0xcdd14c(0x139)]?.();}function _0x434772(){const _0x48470e=_0x134f38,_0x1f8490=_0x1c46f1();return!!_0x1f8490&&_0x1f8490[_0x48470e(0x18b)]===_0x45b3a4;}return{'path':_0x5ebf0b,'token':_0x45b3a4,'acquire'(){const _0x3d4247=_0x1c46f1();if(_0x3d4247&&_0x3d4247['token']===_0x45b3a4){_0x5b5f3c=!![];if(!_0x23a7c0)_0x225ce0();return!![];}let _0x2cc1bb=_0x3786cb();if(!_0x2cc1bb&&_0x11e651(_0x1c46f1())){try{_0xf32dc6['unlinkSync'](_0x5ebf0b);}catch{}_0x2cc1bb=_0x3786cb();}if(_0x2cc1bb&&!_0x434772())_0x2cc1bb=![];_0x5b5f3c=_0x2cc1bb;if(_0x2cc1bb)_0x225ce0();return _0x2cc1bb;},'held'(){return _0x5b5f3c;},'isFree'(){const _0x38d87d=_0x1c46f1();if(_0x38d87d&&_0x38d87d['token']===_0x45b3a4)return![];return _0x11e651(_0x38d87d);},'release'(){const _0x538484=_0x134f38;_0x39530c();if(!_0x5b5f3c)return;_0x5b5f3c=![];if(_0x434772())try{_0xf32dc6[_0x538484(0x118)](_0x5ebf0b);}catch{}}};},writerLock;}var usearch,hasRequiredUsearch;function requireUsearch(){if(hasRequiredUsearch)return usearch;hasRequiredUsearch=0x1;const _0x58403e=require$$0,_0xee6ad7=requireSnapshotStore(),_0x96f7f6=requireLabelMap(),_0x3aa322=requireWriterLock(),{fingerprint:_0x38e09f,reconcileIndex:_0x5cf85f}=requireIndexConvergence(),_0xdff0d2=0x1;let _0x3711e9=null;function _0x2d3a0f(){const _0x5d7618=_0x156b;if(_0x3711e9)return _0x3711e9;try{return _0x3711e9=require(_0x5d7618(0x1ba)),_0x3711e9;}catch(_0x39bc3f){const _0x50c60d=new Error('usearch\x20algorithm\x20unavailable:\x20the\x20native\x20\x22usearch\x22\x20bindings\x20could\x20not\x20be\x20loaded\x20'+('for\x20Node\x20'+process[_0x5d7618(0x1b2)][_0x5d7618(0x1d7)]+_0x5d7618(0x162)+process[_0x5d7618(0x192)]+'/'+process[_0x5d7618(0x121)]+'.\x20')+'Install\x20compatible\x20bindings\x20or\x20use\x20algorithm\x20\x22flat\x22/\x22hnsw\x22\x20instead.\x20'+(_0x5d7618(0x1bf)+(_0x39bc3f?.['message']||String(_0x39bc3f))));_0x50c60d[_0x5d7618(0x1ad)]=_0x5d7618(0x1dd),_0x50c60d[_0x5d7618(0x1c7)]=_0x39bc3f;throw _0x50c60d;}}function _0x46f24c(_0x506908,_0x5a5a95){const _0x5dc3bd=_0x156b;switch(_0x506908){case'cosine':return _0x5a5a95[_0x5dc3bd(0x11a)]['Cos'];case'l2':return _0x5a5a95[_0x5dc3bd(0x11a)][_0x5dc3bd(0x183)];case'ip':return _0x5a5a95[_0x5dc3bd(0x11a)]['IP'];default:return _0x5a5a95['MetricKind'][_0x5dc3bd(0x1d1)];}}return usearch=function _0x23fa8d(_0xc61c51={},{dims:_0x153dce,dir:_0x554b58,fetchAll:fetchAll=null,onChange:onChange=null}={}){const _0x27c1eb=_0x156b,_0x405abf=_0x2d3a0f();if(!_0x153dce||_0x153dce<=0x0)throw new Error(_0x27c1eb(0x172));if(!_0x554b58)throw new Error(_0x27c1eb(0x1a6));const _0x358215={'metric':_0xc61c51['metric']??_0x27c1eb(0x11f),'connectivity':_0xc61c51[_0x27c1eb(0x13b)]??0x10,'expansionAdd':_0xc61c51[_0x27c1eb(0x191)]??0x80,'expansionSearch':_0xc61c51[_0x27c1eb(0x159)]??0x40,'snapshotEveryChanges':_0xc61c51[_0x27c1eb(0x1e2)]??0xc350,'snapshotMaxLagMs':_0xc61c51[_0x27c1eb(0x1b7)]??0x2710,'keepSnapshots':_0xc61c51['keepSnapshots']??0x2,'tmpMaxAgeMs':_0xc61c51[_0x27c1eb(0x126)]??0x6*0x36ee80,'heartbeatIntervalMs':_0xc61c51['heartbeatIntervalMs']??0x1388,'writerLockMaxAgeMs':_0xc61c51[_0x27c1eb(0x1cb)]??0x3a98,'viewRefreshMs':_0xc61c51['viewRefreshMs']??0x3e8},_0x5b50d2=new _0xee6ad7({'dir':_0x554b58,'keepSnapshots':_0x358215[_0x27c1eb(0x1d3)]}),_0x1666ce=_0x3aa322(_0x554b58,{'maxAgeMs':_0x358215['writerLockMaxAgeMs'],'heartbeatMs':_0x358215[_0x27c1eb(0x12c)],'onLost':()=>{const _0x2768b1=_0x27c1eb;_0x471fe3(_0x41867d)[_0x2768b1(0x1c8)](()=>{});}});let _0x14b643=new _0x96f7f6(),_0xf17d5b=null,_0x20bc86=0x0,_0x5b87a4=null,_0x397f57=![],_0x4fa648=![],_0x520412=null,_0x5d4741=0x0,_0x491fdd=null,_0x481b8b=0x0,_0x27fdcd=![],_0x16a231=Promise[_0x27c1eb(0x151)]();const _0x471fe3=_0x37a63b=>{const _0x1f0f37=_0x27c1eb,_0x1a441b=_0x16a231[_0x1f0f37(0x1eb)](_0x37a63b);return _0x16a231=_0x1a441b[_0x1f0f37(0x1c8)](()=>{}),_0x1a441b;},_0x4ad40f=()=>{try{onChange?.();}catch{}};function _0x45488c(){const _0x2a175d=_0x27c1eb;return new _0x405abf[(_0x2a175d(0x141))]({'dimensions':_0x153dce,'metric':_0x46f24c(_0x358215['metric'],_0x405abf),'quantization':_0x405abf['ScalarKind'][_0x2a175d(0x13d)],'connectivity':_0x358215[_0x2a175d(0x13b)],'expansion_add':_0x358215[_0x2a175d(0x191)],'expansion_search':_0x358215['expansionSearch'],'multi':![]});}function _0x34b098(_0x7f8ba){return _0x7f8ba instanceof Float32Array?_0x7f8ba:new Float32Array(_0x7f8ba);}function _0x1bc00f(){const _0x3866d8=_0x27c1eb;if(fetchAll)return fetchAll();if(_0x5b87a4)return _0x5b87a4();return Promise[_0x3866d8(0x151)](null);}function _0x5adb56(_0x5bfc80,_0xc60c28,_0x389c99){const _0x52acd5=_0x27c1eb,_0xe82613=_0x14b643[_0x52acd5(0x19a)](_0x5bfc80);if(_0xe82613!==undefined)try{_0xf17d5b[_0x52acd5(0x15e)](BigInt(_0xe82613));}catch{}const _0x3ab509=_0x14b643[_0x52acd5(0x147)](_0x5bfc80);_0xf17d5b[_0x52acd5(0x1b1)](BigInt(_0x3ab509),_0xc60c28),_0x14b643['setFingerprint'](_0x5bfc80,_0x389c99??_0x38e09f(_0xc60c28));}function _0x29d0d0(_0x2d34e4){const _0xad8c97=_0x27c1eb,_0x3fed10=_0x14b643[_0xad8c97(0x19a)](_0x2d34e4);if(_0x3fed10===undefined)return![];try{_0xf17d5b['remove'](BigInt(_0x3fed10));}catch{}return _0x14b643[_0xad8c97(0x198)](_0x2d34e4),!![];}function _0x268286(_0x572afa){const _0x4b1523=_0x27c1eb;_0x14b643=new _0x96f7f6(),_0xf17d5b=_0x45488c();for(const {key:_0xb90229,vector:_0x459d95}of _0x572afa??[]){if(!(_0x459d95 instanceof Float32Array)||_0x459d95[_0x4b1523(0x11e)]!==_0x153dce)continue;_0x5adb56(_0xb90229,_0x459d95);}_0x20bc86=0x0;}function _0x2398a1(){const _0x402fc4=_0x27c1eb;return Math[_0x402fc4(0x1c3)](Date[_0x402fc4(0x1e4)](),_0x5b50d2[_0x402fc4(0x1a8)]()+0x1);}function _0x508d2a(){if(_0x520412)clearTimeout(_0x520412);_0x520412=null;}function _0x83b289(){const _0x32a813=_0x27c1eb;if(!_0x358215['snapshotMaxLagMs']||_0x520412||!_0x4fa648||_0x20bc86<=0x0)return;const _0x2239ef=Math[_0x32a813(0x1c3)](_0x358215['snapshotMaxLagMs'],0xa*_0x5d4741);_0x520412=setTimeout(()=>{_0x520412=null,_0x471fe3(async()=>{if(_0x4fa648&&_0x20bc86>0x0)await _0x20e1ec();_0x83b289(),_0x4ad40f();})['catch'](()=>{});},_0x2239ef),_0x520412[_0x32a813(0x139)]?.();}async function _0x20e1ec(_0x122da2){const _0x22e516=_0x27c1eb;if(!_0xf17d5b)return![];const _0x525b66=_0x122da2??_0x2398a1(),_0x21ae1d=Date[_0x22e516(0x1e4)](),_0x8d9b2c=await _0x5b50d2['publishSnapshot'](_0x525b66,async _0x27afeb=>{const _0xbab5a6=_0x22e516;_0xf17d5b[_0xbab5a6(0x1f1)](_0x27afeb['index']),await _0x14b643[_0xbab5a6(0x15b)](_0x27afeb[_0xbab5a6(0x17a)]),_0x58403e['writeFileSync'](_0x27afeb[_0xbab5a6(0x148)],JSON[_0xbab5a6(0x14d)]({'manifestVersion':_0xdff0d2,'algorithm':_0xbab5a6(0x1ba),'dims':_0x153dce,'metric':_0x358215[_0xbab5a6(0x136)],'clock':_0x525b66,'snapshotAt':Date['now']()},null,0x2));},{'keep':_0x358215['keepSnapshots']});return _0x5d4741=Date[_0x22e516(0x1e4)]()-_0x21ae1d,_0x8d9b2c?.[_0x22e516(0x1e7)]&&(_0x20bc86=0x0,_0x508d2a()),_0x8d9b2c?.[_0x22e516(0x1e7)]??![];}function _0x4f3774(){const _0x491a77=_0x27c1eb;_0x20bc86++;if(_0x20bc86>=_0x358215[_0x491a77(0x1e2)])return _0x20e1ec();return _0x83b289(),null;}async function _0x24eb54(){const _0x465b91=_0x27c1eb,_0x2b894c=_0x5b50d2[_0x465b91(0x1d2)]()||_0x5b50d2[_0x465b91(0x1ab)]();if(!_0x2b894c)return null;let _0xf6986c,_0x5b8834=![];try{await _0x5b50d2[_0x465b91(0x14b)](_0x2b894c,async _0xff4950=>{const _0x1312c5=_0x465b91;_0xf6986c=JSON[_0x1312c5(0x1f3)](_0x58403e[_0x1312c5(0x14a)](_0xff4950[_0x1312c5(0x148)],_0x1312c5(0x189)));if(_0xf6986c['manifestVersion']!==_0xdff0d2||_0xf6986c[_0x1312c5(0x127)]!==_0x1312c5(0x1ba)||_0xf6986c['dims']!==_0x153dce||_0xf6986c['metric']!==_0x358215[_0x1312c5(0x136)]){_0xf6986c=null;return;}const _0xcec90f=new _0x96f7f6();await _0xcec90f[_0x1312c5(0x180)](_0xff4950['labels']);const _0x2671c8=_0x45488c();_0x2671c8[_0x1312c5(0x16a)](_0xff4950[_0x1312c5(0x11c)]),_0x14b643=_0xcec90f,_0xf17d5b=_0x2671c8,_0x5b8834=!![];});}catch{return null;}return _0x5b8834?_0xf6986c?.[_0x465b91(0x12f)]??0x0:null;}async function _0x57372c(_0x1044bd){const _0x91151b=_0x27c1eb;_0x491fdd=null;const _0x3580af=await _0x24eb54();if(_0x3580af!=null){_0x20bc86=0x0;if(_0x1044bd){if(!_0x14b643[_0x91151b(0x1c4)])return _0x268286(_0x1044bd),await _0x20e1ec(),null;const _0x5b34bd=_0x5cf85f(_0x14b643,_0x1044bd,_0x153dce,{'upsert':_0x5adb56,'remove':_0x29d0d0}),_0x334587=_0x5b34bd['added']+_0x5b34bd[_0x91151b(0x19b)]+_0x5b34bd[_0x91151b(0x132)];_0x334587>0x0&&(_0x20bc86+=_0x334587,await _0x20e1ec());}return _0x3580af;}_0x268286(_0x1044bd??[]);if(_0xf17d5b[_0x91151b(0x131)]()>0x0)await _0x20e1ec();return null;}async function _0x5846d1(){_0x4fa648=!![],await _0x57372c(await _0x1bc00f());}async function _0x41867d(){const _0x2c0f21=_0x27c1eb;if(!_0x4fa648)return;_0x4fa648=![],_0x508d2a(),_0x20bc86=0x0;const _0x316a31=_0x5b50d2[_0x2c0f21(0x1d2)]()||_0x5b50d2[_0x2c0f21(0x1ab)]();await _0x17656b(_0x316a31),_0x4ad40f();}async function _0x17656b(_0x2ca50b){const _0x59fecb=_0x27c1eb;if(!_0x2ca50b)return![];let _0x7b7400=![];try{await _0x5b50d2[_0x59fecb(0x14b)](_0x2ca50b,async _0x4e9e2a=>{const _0x57778b=_0x59fecb,_0x511c81=JSON[_0x57778b(0x1f3)](_0x58403e[_0x57778b(0x14a)](_0x4e9e2a['state'],_0x57778b(0x189)));if(_0x511c81['manifestVersion']!==_0xdff0d2||_0x511c81[_0x57778b(0x127)]!=='usearch'||_0x511c81['dims']!==_0x153dce||_0x511c81[_0x57778b(0x136)]!==_0x358215['metric'])return;const _0x28a28e=new _0x96f7f6();await _0x28a28e['loadFrom'](_0x4e9e2a[_0x57778b(0x17a)]);const _0x13b4d0=_0x45488c();_0x13b4d0[_0x57778b(0x19c)](_0x4e9e2a[_0x57778b(0x11c)]),_0xf17d5b=_0x13b4d0,_0x14b643=_0x28a28e,_0x491fdd=_0x2ca50b,_0x7b7400=!![];});}catch{}return _0x7b7400;}function _0x38bcbe(){const _0x45e84a=_0x27c1eb,_0x4615d0=Date[_0x45e84a(0x1e4)]();if(_0x4615d0-_0x481b8b<_0x358215[_0x45e84a(0x179)])return;_0x481b8b=_0x4615d0;if(_0x27fdcd)return;if(_0x1666ce[_0x45e84a(0x182)]()){_0x27fdcd=!![],_0x471fe3(async()=>{!_0x4fa648&&_0x397f57&&_0x1666ce['acquire']()&&(await _0x5846d1(),_0x4ad40f());})[_0x45e84a(0x1c8)](()=>{})['finally'](()=>{_0x27fdcd=![];});return;}const _0x391d15=_0x5b50d2['readCurrentId']()||_0x5b50d2[_0x45e84a(0x1ab)]();if(!_0x391d15||_0x391d15===_0x491fdd)return;_0x27fdcd=!![],_0x471fe3(async()=>{if(!_0x4fa648&&await _0x17656b(_0x391d15))_0x4ad40f();})[_0x45e84a(0x1c8)](()=>{})[_0x45e84a(0x150)](()=>{_0x27fdcd=![];});}return{async 'load'(_0xf7d3dc){return _0x471fe3(async()=>{const _0x2082e2=_0x156b;_0x5b50d2[_0x2082e2(0x175)]({'maxAgeMs':_0x358215[_0x2082e2(0x126)]}),_0x5b87a4=_0xf7d3dc??null,_0x4fa648=_0x1666ce[_0x2082e2(0x1a7)]();let _0x17b765=null;if(_0x4fa648)_0x17b765=await _0x57372c(_0xf7d3dc?await _0xf7d3dc():null);else{const _0xe20a0e=_0x5b50d2['readCurrentId']()||_0x5b50d2[_0x2082e2(0x1ab)]();await _0x17656b(_0xe20a0e);}return _0x397f57=!![],_0x17b765;});},async 'add'(_0x301167,_0x264b06,_0xc7954d){return _0x471fe3(async()=>{const _0x54f977=_0x156b;if(!_0x397f57)return;const _0x39b4ab=_0x34b098(_0x264b06);if(!_0x4fa648){if(!_0x1666ce['acquire']())return;await _0x5846d1();}if(!_0xf17d5b)return;const _0x420cc6=_0x38e09f(_0x39b4ab);if(_0x14b643[_0x54f977(0x138)](_0x301167)===_0x420cc6)return;_0x5adb56(_0x301167,_0x39b4ab,_0x420cc6),await _0x4f3774();});},async 'remove'(_0x4097de){return _0x471fe3(async()=>{const _0x2e505d=_0x156b;if(!_0x397f57)return;if(!_0x4fa648){if(!_0x1666ce[_0x2e505d(0x1a7)]())return;await _0x5846d1();}if(!_0xf17d5b)return;if(_0x29d0d0(_0x4097de))await _0x4f3774();});},'search'(_0x3239be,{limit:limit=0xa}={}){const _0xe7db22=_0x27c1eb;if(!_0x4fa648&&_0x397f57)_0x38bcbe();if(!_0xf17d5b)return[];const _0x218d65=_0xf17d5b[_0xe7db22(0x131)]();if(_0x218d65===0x0)return[];const _0x499d31=Math[_0xe7db22(0x173)](limit,_0x218d65),_0x65abaa=_0xf17d5b[_0xe7db22(0x16d)](_0x34b098(_0x3239be),_0x499d31,0x0),_0x21adcf=[],_0x536eb5=_0x65abaa['keys'],_0x404a05=_0x65abaa[_0xe7db22(0x154)];for(let _0x3074e1=0x0;_0x3074e1<_0x536eb5[_0xe7db22(0x11e)];_0x3074e1++){const _0xc58b7a=_0x536eb5[_0x3074e1];if(_0xc58b7a===0xffffffffffffffffn)continue;const _0x859320=Number(_0xc58b7a),_0x25c627=_0x14b643[_0xe7db22(0x13e)](_0x859320);if(!_0x25c627)continue;const _0x1c68d3=_0x404a05[_0x3074e1];let _0x41cb2c;if(_0x358215['metric']===_0xe7db22(0x11f))_0x41cb2c=Math[_0xe7db22(0x1c3)](0x0,0x1-_0x1c68d3);else{if(_0x358215[_0xe7db22(0x136)]==='ip')_0x41cb2c=-_0x1c68d3;else _0x41cb2c=0x1/(0x1+_0x1c68d3);}_0x21adcf[_0xe7db22(0x1f4)]({'key':_0x25c627,'score':_0x41cb2c});}return _0x21adcf;},async 'snapshot'(_0x29a533){return _0x471fe3(()=>_0x4fa648?_0x20e1ec(_0x29a533??undefined):![]);},async 'rebuild'(_0x52c50c){return _0x471fe3(async()=>{const _0x474a94=_0x156b;if(_0x52c50c!=null)_0x5b87a4=_0x52c50c;if(!_0x4fa648){if(!_0x1666ce[_0x474a94(0x1a7)]())return;_0x4fa648=!![];}const _0x145c13=_0x52c50c?await _0x52c50c():await _0x1bc00f();_0x268286(_0x145c13??[]),_0x397f57=!![],await _0x20e1ec();});},async 'stop'(){return _0x471fe3(async()=>{const _0x2e582d=_0x156b;_0x508d2a();if(_0x4fa648){if(_0x20bc86>0x0||!_0x5b50d2[_0x2e582d(0x1d2)]())await _0x20e1ec();_0x1666ce['release']();}_0x4fa648=![],_0x397f57=![];});},'count'(){return _0x14b643['size']();},'info'(){const _0x48b874=_0x27c1eb;return{'algorithm':_0x48b874(0x1ba),'role':_0x4fa648?_0x48b874(0x167):_0x48b874(0x17e),'metric':_0x358215[_0x48b874(0x136)],'connectivity':_0x358215[_0x48b874(0x13b)],'expansionAdd':_0x358215[_0x48b874(0x191)],'expansionSearch':_0x358215[_0x48b874(0x159)],'snapshotEveryChanges':_0x358215[_0x48b874(0x1e2)],'snapshotMaxLagMs':_0x358215['snapshotMaxLagMs'],'count':_0x14b643[_0x48b874(0x131)](),'size':_0xf17d5b?.[_0x48b874(0x131)]?.()??0x0,'capacity':_0xf17d5b?.['capacity']?.()??0x0,'changesSince':_0x4fa648?_0x20bc86:null,'viewedSnapshot':_0x491fdd??null,'snapshotDir':_0x554b58,'latestSnapshot':_0x5b50d2[_0x48b874(0x1d2)]()??null};}};},usearch;}var hasRequiredAlgorithmWorkerThread;function requireAlgorithmWorkerThread(){const _0x2fa091=_0x4eed99;if(hasRequiredAlgorithmWorkerThread)return algorithmWorkerThread$1;hasRequiredAlgorithmWorkerThread=0x1;const {parentPort:_0x184aff,workerData:_0x3ab348}=require$$0$1,{algorithmName:_0x278f83,algorithmConfig:_0x16a9df,dims:_0x19959b,dir:_0x74caf8}=_0x3ab348;let _0x44f1f0=0x1;const _0x142207=new Map();function _0x2fbfc3(){const _0x1b3806=_0x44f1f0++;return new Promise((_0x22171c,_0x2d6a65)=>{const _0x5b8478=_0x156b;_0x142207[_0x5b8478(0x169)](_0x1b3806,{'resolve':_0x22171c,'reject':_0x2d6a65}),_0x184aff[_0x5b8478(0x1e9)]({'op':_0x5b8478(0x1d0),'fid':_0x1b3806});});}const _0x1e6feb={'dims':_0x19959b,'dir':_0x74caf8,'fetchAll':_0x2fbfc3,'onChange':()=>_0x2390ba()};let _0x19d43f;if(_0x278f83===_0x2fa091(0x171))_0x19d43f=requireHnsw()(_0x16a9df,_0x1e6feb);else{if(_0x278f83===_0x2fa091(0x1af))_0x19d43f=requireFlat()(_0x16a9df,_0x1e6feb);else{if(_0x278f83===_0x2fa091(0x1ba))_0x19d43f=requireUsearch()(_0x16a9df,_0x1e6feb);else throw new Error('Unknown\x20algorithm:\x20\x22'+_0x278f83+'\x22');}}function _0x2390ba(){const _0x2e2e32=_0x2fa091;try{_0x184aff['postMessage']({'op':_0x2e2e32(0x1e5),'count':_0x19d43f[_0x2e2e32(0x178)](),'info':_0x19d43f[_0x2e2e32(0x165)](),'memory':process[_0x2e2e32(0x1dc)]()});}catch{}}function _0x14fb2b(_0x3a6846){const _0xdd410b=_0x2fa091;return(_0x3a6846||[])['map'](_0x27b979=>({'key':_0x27b979['key'],'vector':_0x27b979['vector']instanceof Float32Array?_0x27b979[_0xdd410b(0x15a)]:new Float32Array(_0x27b979[_0xdd410b(0x15a)])}));}return _0x184aff['on']('message',async _0x419bab=>{const _0x38a59c=_0x2fa091;if(_0x419bab['op']===_0x38a59c(0x1ef)){const _0x2d7b06=_0x142207[_0x38a59c(0x1b5)](_0x419bab[_0x38a59c(0x1c9)]);if(!_0x2d7b06)return;_0x142207[_0x38a59c(0x170)](_0x419bab[_0x38a59c(0x1c9)]);if(_0x419bab[_0x38a59c(0x19e)])_0x2d7b06[_0x38a59c(0x1e3)](new Error(_0x419bab['error']));else _0x2d7b06[_0x38a59c(0x151)](_0x14fb2b(_0x419bab[_0x38a59c(0x122)]));return;}const {id:_0x2414df,op:_0x455166,args:_0x11f6d1}=_0x419bab;try{let _0x59c231;switch(_0x455166){case'load':{_0x59c231=await _0x19d43f[_0x38a59c(0x16a)](_0x11f6d1['hasRows']?_0x2fbfc3:null),_0x2390ba();break;}case _0x38a59c(0x1b1):{const _0xf16e41=_0x11f6d1[_0x38a59c(0x15a)]instanceof Float32Array?_0x11f6d1[_0x38a59c(0x15a)]:new Float32Array(_0x11f6d1['vector']);await _0x19d43f[_0x38a59c(0x1b1)](_0x11f6d1['key'],_0xf16e41,_0x11f6d1['clock']??undefined),_0x2390ba(),_0x59c231=null;break;}case _0x38a59c(0x15e):{await _0x19d43f[_0x38a59c(0x15e)](_0x11f6d1[_0x38a59c(0x12b)]),_0x2390ba(),_0x59c231=null;break;}case _0x38a59c(0x16d):{const _0x3037b5=_0x11f6d1['queryVec']instanceof Float32Array?_0x11f6d1['queryVec']:new Float32Array(_0x11f6d1['queryVec']);_0x59c231=_0x19d43f['search'](_0x3037b5,_0x11f6d1[_0x38a59c(0x18e)]||{});break;}case _0x38a59c(0x1e6):{_0x59c231=await _0x19d43f[_0x38a59c(0x1e6)](_0x11f6d1['clock']),_0x2390ba();break;}case'rebuild':{const _0x5be3d4=_0x14fb2b(_0x11f6d1[_0x38a59c(0x122)]);await _0x19d43f[_0x38a59c(0x16c)](async()=>_0x5be3d4),_0x2390ba(),_0x59c231=null;break;}case _0x38a59c(0x157):{await _0x19d43f[_0x38a59c(0x157)](),_0x2390ba(),_0x59c231=null;break;}case _0x38a59c(0x178):{_0x59c231=_0x19d43f[_0x38a59c(0x178)]();break;}case _0x38a59c(0x165):{_0x59c231=_0x19d43f[_0x38a59c(0x165)]();break;}default:throw new Error(_0x38a59c(0x1c0)+_0x455166+'\x22');}_0x184aff['postMessage']({'id':_0x2414df,'result':_0x59c231});}catch(_0x5647e7){_0x184aff[_0x38a59c(0x1e9)]({'id':_0x2414df,'error':{'message':_0x5647e7?.['message']||String(_0x5647e7),'code':_0x5647e7?.[_0x38a59c(0x1ad)]}});}}),_0x184aff[_0x2fa091(0x1e9)]({'op':_0x2fa091(0x123)}),algorithmWorkerThread$1;}var algorithmWorkerThreadExports=requireAlgorithmWorkerThread(),algorithmWorkerThread=getDefaultExportFromCjs(algorithmWorkerThreadExports);module['exports']=algorithmWorkerThread;