@kedem/okdb 2.5.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +82 -0
- package/algorithm-worker-thread.js +1 -1
- package/bin/okdb.js +1 -1
- package/docs/auth-permissions.md +31 -5
- package/okdb-functions-sandbox-worker.js +1 -1
- package/okdb-http-worker-child.js +1 -1
- package/okdb-views-bootstrap-worker.js +1 -1
- package/okdb.js +1 -1
- package/package.json +1 -1
- package/public/admin-app.js +1 -1
- package/public/components/schema-edit-modal.ok.js +1 -0
- package/public/core/db/db-section.ok.html +1 -0
- package/public/core/db/modals/add-item-modal.ok.js +1 -0
- package/public/core/db/modals/create-fts-modal.ok.js +1 -0
- package/public/core/db/modals/create-index-modal.ok.js +1 -0
- package/public/core/db/parts/db-overview.ok.js +1 -0
- package/public/core/db/parts/edit-row.ok.js +1 -0
- package/public/core/db/parts/type-changelog.ok.js +1 -0
- package/public/core/db/parts/type-data-tab.ok.js +1 -0
- package/public/core/db/parts/type-list.ok.js +1 -0
- package/public/core/db/parts/type-manage-tab.ok.js +1 -0
- package/public/core/db/parts/type-schema-tab.ok.js +1 -0
- package/public/core/db/parts/type-viewer.ok.js +1 -0
- package/public/core/db/type-ops.js +1 -0
- package/public/core/docs/docs-page.ok.html +1 -0
- package/public/core/license/license-panel.ok.js +1 -0
- package/public/core/system/parts/system-log.ok.js +1 -0
- package/public/core/system/parts/system-processing-panel.ok.js +1 -0
- package/public/core/system/parts/system-storage-panel.ok.js +1 -0
- package/public/core/system/system-events-page.ok.js +1 -0
- package/public/core/system/system-logs-page.ok.js +1 -0
- package/public/core/system/system-overview-page.ok.html +1 -0
- package/public/core/system/system-runtime-page.ok.js +1 -0
- package/public/core/system/system-section.ok.html +1 -0
- package/public/features/api/api-panel.ok.js +1 -0
- package/public/features/api/index.js +1 -0
- package/public/features/auth/auth-panel.ok.js +1 -0
- package/public/features/auth/index.js +1 -0
- package/public/features/files/files-section.ok.html +1 -0
- package/public/features/files/index.js +1 -0
- package/public/features/files/parts/files-file-list.ok.js +1 -0
- package/public/features/files/parts/files-path-browser.ok.js +1 -0
- package/public/features/files/parts/files-preview.ok.js +1 -0
- package/public/features/files/parts/files-upload-panel.ok.js +1 -0
- package/public/features/functions/exports.js +1 -0
- package/public/features/functions/functions-section.ok.html +1 -0
- package/public/features/functions/functions-store.js +1 -0
- package/public/features/functions/index.js +1 -0
- package/public/features/functions/modals/function-modal.ok.js +1 -0
- package/public/features/functions/parts/function-detail.ok.js +1 -0
- package/public/features/functions/parts/function-logs.ok.js +1 -0
- package/public/features/functions/parts/function-runner.ok.js +1 -0
- package/public/features/pipelines/engine-ui-utils.js +1 -0
- package/public/features/pipelines/exports.js +1 -0
- package/public/features/pipelines/index.js +1 -0
- package/public/features/pipelines/modals/create-pipeline-modal.ok.js +1 -0
- package/public/features/pipelines/modals/edit-pipeline-modal.ok.js +1 -0
- package/public/features/pipelines/modals/engine-modal.ok.js +1 -0
- package/public/features/pipelines/parts/embed-create-panel.ok.js +1 -0
- package/public/features/pipelines/parts/embed-embedder-panel.ok.js +1 -0
- package/public/features/pipelines/parts/embed-indexer-panel.ok.js +1 -0
- package/public/features/pipelines/parts/embed-search-panel.ok.js +1 -0
- package/public/features/pipelines/parts/embed-worker-panel.ok.js +1 -0
- package/public/features/pipelines/parts/embeddings-engine-panel.ok.js +1 -0
- package/public/features/pipelines/parts/engine-declaration-editor.ok.js +1 -0
- package/public/features/pipelines/parts/engines-overview.ok.js +1 -0
- package/public/features/pipelines/parts/generic-engine-panel.ok.js +1 -0
- package/public/features/pipelines/parts/pipeline-create-panel.ok.js +1 -0
- package/public/features/pipelines/parts/pipeline-flow-strip.ok.js +1 -0
- package/public/features/pipelines/parts/type-pipelines-tab.ok.js +1 -0
- package/public/features/pipelines/pipelines-section.ok.html +1 -0
- package/public/features/queue/index.js +1 -0
- package/public/features/queue/modals/create-bucket-modal.ok.js +1 -0
- package/public/features/queue/modals/edit-bucket-modal.ok.js +1 -0
- package/public/features/queue/modals/edit-job-modal.ok.js +1 -0
- package/public/features/queue/modals/enqueue-job-modal.ok.js +1 -0
- package/public/features/queue/modals/job-type-modal.ok.js +1 -0
- package/public/features/queue/parts/job-log-panel.ok.js +1 -0
- package/public/features/queue/parts/queue-buckets.ok.js +1 -0
- package/public/features/queue/parts/queue-job-types.ok.js +1 -0
- package/public/features/queue/parts/queue-jobs.ok.js +1 -0
- package/public/features/queue/parts/queue-types.ok.js +1 -0
- package/public/features/queue/parts/queue-workers.ok.js +1 -0
- package/public/features/queue/queue-section.ok.html +1 -0
- package/public/features/sync/index.js +1 -0
- package/public/features/sync/sync-panel.ok.js +1 -0
- package/public/features/views/index.js +1 -0
- package/public/features/views/modals/create-view-modal.ok.js +1 -0
- package/public/features/views/parts/views-list.ok.js +1 -0
- package/public/features/views/parts/views-overview.ok.js +1 -0
- package/public/features/views/views-section.ok.html +1 -0
- package/public/features/views/views-store.js +1 -0
- package/public/index.html +9 -3
- package/public/modules/ok.js +1 -1
- package/public/shell/admin-shell.ok.html +3 -0
- package/public/shell/core-manifest.js +1 -0
- package/public/shell/shell-piece.ok.js +1 -0
- package/public/shell/shell-section-host.ok.js +1 -0
- package/public/shell/shell-section.ok.js +1 -0
- package/public/shell/shell-store.js +1 -0
- package/public/stores/auth-store.js +1 -1
- package/public/stores/okdb-store.js +1 -1
- package/public/stores/storage-store.js +1 -0
- package/public/styles.css +1 -1
- package/public/vendor/okjs/ok.esm.min.js +1 -1
- package/public/vendor/okjs/toolkit/components/ok-chart.ok.js +1 -1
- package/public/vendor/okjs/toolkit/components/ok-doc-viewer.ok.js +1 -1
- package/public/vendor/okjs/toolkit/components/ok-marked.ok.js +1 -1
- package/public/vendor/okjs/toolkit/components/ok-monaco.ok.js +1 -1
- package/public/components/admin-route-host.ok.js +0 -1
- package/public/components/field.html +0 -158
- package/public/layouts/_default.ok.html +0 -3
- package/public/sections/api/index.ok.html +0 -1
- package/public/sections/auth/index.ok.html +0 -1
- package/public/sections/auth/modals/perm-info-popover.ok.js +0 -1
- package/public/sections/db/index.ok.html +0 -1
- package/public/sections/db/modals/add-item-modal.ok.js +0 -1
- package/public/sections/db/modals/create-fts-modal.ok.js +0 -1
- package/public/sections/db/modals/create-index-modal.ok.js +0 -1
- package/public/sections/db/modals/create-pipeline-modal.ok.js +0 -1
- package/public/sections/db/modals/schema-edit-modal.ok.js +0 -1
- package/public/sections/db/parts/db-overview.ok.js +0 -1
- package/public/sections/db/parts/edit-row.ok.js +0 -1
- package/public/sections/db/parts/type-changelog.ok.js +0 -1
- package/public/sections/db/parts/type-list.ok.js +0 -1
- package/public/sections/db/parts/type-pipelines-tab.ok.js +0 -1
- package/public/sections/db/parts/type-schema-tab.ok.js +0 -1
- package/public/sections/db/parts/type-viewer.ok.js +0 -1
- package/public/sections/db/parts/type-violations-tab.ok.js +0 -1
- package/public/sections/docs/index.ok.html +0 -1
- package/public/sections/embeddings/index.ok.html +0 -1
- package/public/sections/embeddings/modals/edit-pipeline-modal.ok.js +0 -1
- package/public/sections/embeddings/parts/embed-create-panel.ok.js +0 -1
- package/public/sections/embeddings/parts/embed-embedder-panel.ok.js +0 -1
- package/public/sections/embeddings/parts/embed-engine-declaration-editor.ok.js +0 -1
- package/public/sections/embeddings/parts/embed-engine-list.ok.js +0 -1
- package/public/sections/embeddings/parts/embed-indexer-panel.ok.js +0 -1
- package/public/sections/embeddings/parts/embed-lifecycle-bar.ok.js +0 -1
- package/public/sections/embeddings/parts/embed-overview.ok.js +0 -1
- package/public/sections/embeddings/parts/embed-search-panel.ok.js +0 -1
- package/public/sections/embeddings/parts/embed-worker-panel.ok.js +0 -1
- package/public/sections/embeddings/parts/embeddings-engine-panel.ok.js +0 -1
- package/public/sections/embeddings/parts/engines-overview.ok.js +0 -1
- package/public/sections/embeddings/parts/pipeline-create-panel.ok.js +0 -1
- package/public/sections/embeddings/parts/pipeline-flow-strip.ok.js +0 -1
- package/public/sections/engines/engine-ui-utils.js +0 -1
- package/public/sections/engines/index.ok.html +0 -1
- package/public/sections/engines/modals/engine-modal.ok.js +0 -1
- package/public/sections/engines/parts/engine-declaration-editor.ok.js +0 -1
- package/public/sections/engines/parts/generic-engine-panel.ok.js +0 -1
- package/public/sections/files/index.ok.html +0 -1
- package/public/sections/files/parts/files-collection-list.ok.js +0 -1
- package/public/sections/files/parts/files-collection-panel.ok.js +0 -1
- package/public/sections/files/parts/files-file-list.ok.js +0 -1
- package/public/sections/files/parts/files-path-browser.ok.js +0 -1
- package/public/sections/files/parts/files-preview.ok.js +0 -1
- package/public/sections/files/parts/files-upload-panel.ok.js +0 -1
- package/public/sections/functions/index.ok.html +0 -1
- package/public/sections/functions/modals/function-modal.ok.js +0 -1
- package/public/sections/functions/parts/function-detail.ok.js +0 -1
- package/public/sections/functions/parts/function-logs.ok.js +0 -1
- package/public/sections/functions/parts/function-runner.ok.js +0 -1
- package/public/sections/license/index.ok.html +0 -1
- package/public/sections/license/parts/license-panel.ok.js +0 -1
- package/public/sections/queue/index.ok.html +0 -1
- package/public/sections/queue/modals/create-bucket-modal.ok.js +0 -1
- package/public/sections/queue/modals/edit-bucket-modal.ok.js +0 -1
- package/public/sections/queue/modals/edit-job-modal.ok.js +0 -1
- package/public/sections/queue/modals/enqueue-job-modal.ok.js +0 -1
- package/public/sections/queue/modals/job-type-modal.ok.js +0 -1
- package/public/sections/queue/parts/job-log-panel.ok.js +0 -1
- package/public/sections/queue/parts/ok-job-form.ok.js +0 -1
- package/public/sections/queue/parts/queue-buckets.ok.js +0 -1
- package/public/sections/queue/parts/queue-job-types.ok.js +0 -1
- package/public/sections/queue/parts/queue-jobs.ok.js +0 -1
- package/public/sections/queue/parts/queue-types.ok.js +0 -1
- package/public/sections/queue/parts/queue-workers.ok.js +0 -1
- package/public/sections/sync/index.ok.html +0 -5
- package/public/sections/sync/parts/sync-node-detail.ok.js +0 -1
- package/public/sections/system/index.ok.html +0 -1
- package/public/sections/system/parts/system-api-panel.ok.js +0 -1
- package/public/sections/system/parts/system-auth-panel.ok.js +0 -1
- package/public/sections/system/parts/system-log.ok.js +0 -1
- package/public/sections/system/parts/system-processing-panel.ok.js +0 -1
- package/public/sections/system/parts/system-status.ok.js +0 -1
- package/public/sections/system/parts/system-storage-panel.ok.js +0 -1
- package/public/sections/system/parts/system-sync-panel.ok.js +0 -1
- package/public/sections/views/index.ok.html +0 -1
- package/public/sections/views/modals/create-view-modal.ok.js +0 -1
- package/public/sections/views/parts/views-list.ok.js +0 -1
- package/public/sections/views/parts/views-overview.ok.js +0 -1
- package/public/stores/functions-store.js +0 -1
- /package/public/{sections → core}/db/parts/tm-timeline.ok.js +0 -0
- /package/public/{util → core/db}/sift-schema.js +0 -0
- /package/public/{view-models → core/db}/type-query-vm.js +0 -0
- /package/public/{sections → core}/system/modals/data-ops-modal.ok.js +0 -0
- /package/public/{sections → core}/system/parts/system-locks-panel.ok.js +0 -0
- /package/public/{sections → core}/system/parts/system-log-history.ok.js +0 -0
- /package/public/{sections → core}/system/parts/system-process-panel.ok.js +0 -0
- /package/public/{sections → core}/system/parts/system-runtime-overview.ok.js +0 -0
- /package/public/{sections → features}/api/parts/api-endpoint.ok.js +0 -0
- /package/public/{sections → features}/auth/modals/create-token-modal.ok.js +0 -0
- /package/public/{sections → features}/auth/modals/edit-token-modal.ok.js +0 -0
- /package/public/{sections → features}/auth/parts/token-detail.ok.js +0 -0
- /package/public/{sections → features}/auth/parts/token-list.ok.js +0 -0
- /package/public/{sections → features}/files/parts/files-blob-status.ok.js +0 -0
- /package/public/{sections → features}/files/parts/files-overview.ok.js +0 -0
- /package/public/{sections → features}/functions/parts/functions-list.ok.js +0 -0
- /package/public/{sections/engines → features/pipelines}/engine-panel-shared-style.js +0 -0
- /package/public/{sections/embeddings → features/pipelines}/modals/register-model-modal.ok.js +0 -0
- /package/public/{sections/embeddings → features/pipelines}/modals/replace-embedder-modal.ok.js +0 -0
- /package/public/{sections/embeddings → features/pipelines}/parts/embed-model-catalog.ok.js +0 -0
- /package/public/{sections/engines → features/pipelines}/parts/engine-lifecycle-actions.ok.js +0 -0
- /package/public/{sections/engines → features/pipelines}/parts/engine-panel-shell.ok.js +0 -0
- /package/public/{sections/engines → features/pipelines}/parts/engine-resource-card.ok.js +0 -0
- /package/public/{sections/engines → features/pipelines}/parts/engine-row-item.ok.js +0 -0
- /package/public/{sections/embeddings → features/pipelines}/parts/pipeline-try-search.ok.js +0 -0
- /package/public/{sections → features}/queue/parts/code-panel.ok.js +0 -0
- /package/public/{sections → features}/sync/modals/connect-peer-modal.ok.js +0 -0
- /package/public/{sections → features}/sync/parts/sync-retention.ok.js +0 -0
- /package/public/{sections → features}/sync/parts/sync-topology.ok.js +0 -0
- /package/public/{sections → features}/views/parts/view-detail.ok.js +0 -0
- /package/public/{sections/db → shell}/modals/create-env-modal.ok.js +0 -0
- /package/public/{sections/db → shell}/modals/demo-env-modal.ok.js +0 -0
- /package/public/{sections/db → shell}/modals/remove-env-modal.ok.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,88 @@ 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.6.0] - 2026-09-28
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- **Admin UI rebuilt as a shell with feature-contributed sections** (`design/admin-shell.md`). The
|
|
12
|
+
chrome (env picker, nav, notices, live/security pills) mounts once and sections swap inside it —
|
|
13
|
+
switching sections no longer tears the page down or flashes a full-page "Loading…". Each feature
|
|
14
|
+
ships its own UI under `src/features/<f>/admin/` (a manifest contributing nav sections, DB
|
|
15
|
+
type-viewer tabs and System pages); the server lists them, UI-agnostically, at
|
|
16
|
+
`GET /admin/api/features` (licence + permissions per feature). Nav items, DB tabs and System pages
|
|
17
|
+
go through one gate: a feature without a licence shows **locked** with "Requires a license with …",
|
|
18
|
+
one the token may not see shows locked with the permission it needs, and opening it by URL shows the
|
|
19
|
+
reason instead of loading it. Views is now gated on `views:read` like every other section.
|
|
20
|
+
- `#/api`, `#/auth`, `#/sync`, `#/license`, `#/docs` (and `/docs`) open the matching System page;
|
|
21
|
+
`#/processes`, `#/processing` open the Runtime page's Processes / Processors tab.
|
|
22
|
+
- Admin: the License page hides/disables Add, Activate and Remove for tokens without
|
|
23
|
+
`system:write`, matching the server-side gate.
|
|
24
|
+
- Admin: the DB overview's Time Machine card now needs `schema:read` to load at all (no 403 in
|
|
25
|
+
the console without it) and disables Enable/Disable All and per-type Enable/Disable without
|
|
26
|
+
`schema:write`, matching the server-side gate.
|
|
27
|
+
|
|
28
|
+
### Security
|
|
29
|
+
|
|
30
|
+
- **Time-machine routes checked no permission.** The `/api/env/:env/time-machine…` routes declared
|
|
31
|
+
no access, so any authenticated token — one holding only `env:read`, or a grant for another env —
|
|
32
|
+
could read every document's field-level history (`…/:type/:key/history`, `…/at/:clock`,
|
|
33
|
+
`…/changes`) and enable, disable or drop tracking. They now need `data:read` for history, state
|
|
34
|
+
and diffs, `schema:read` for status (`/time-machine`, `/types`, `/types/:type`, `/status`) and
|
|
35
|
+
`schema:write` to enable/disable/drop/flush (incl. the deprecated `POST`/`DELETE …/enable`); all
|
|
36
|
+
are env-scoped, so per-env grants and the protected `~` env gate apply.
|
|
37
|
+
- **Any authenticated token could manage licences or join the node to a cluster.**
|
|
38
|
+
`GET /admin/license/status` now needs `system:read`; `POST /admin/license`,
|
|
39
|
+
`POST /admin/license/:id/activate` and `DELETE /admin/license/:id` need `system:write`;
|
|
40
|
+
`POST /admin/setup/join` (joining starts replicating this node's data) needs `sync:write`.
|
|
41
|
+
First-run setup in open/bootstrap mode is unaffected.
|
|
42
|
+
- A route-table test (`tests/auth-routes-have-permissions.test.js`) now fails for any route that
|
|
43
|
+
declares no permission unless it is allow-listed as public / authenticated-only with a reason,
|
|
44
|
+
and for any `:env` route with an env-scoped permission that lacks `scope: 'env'`.
|
|
45
|
+
- **`/api/env/:env/engines…` (12 routes) skipped the protected `~` env gate.** They declared
|
|
46
|
+
`system:*` without `scope: 'env'`, so a token holding `system:write` alone — no
|
|
47
|
+
`protected:write` — could create, patch, delete, restart, pause/resume/retry/reset-cursor or
|
|
48
|
+
rebuild an engine directly in `~system` (or any other `~` env), unlike every other route that
|
|
49
|
+
touches a `~` env. They now declare `scope: 'env'`, like the `ttl` routes already did.
|
|
50
|
+
- `tests/auth-routes-have-permissions.test.js`'s `:env`-scope check no longer exempts
|
|
51
|
+
`system:*`/`auth:*`/`sync:*` permissions from needing `scope: 'env'` — that blanket exemption
|
|
52
|
+
is what let the engines routes above go unnoticed. The rule is now uniform (every `:env` route
|
|
53
|
+
with a permission declares the scope), with `ENV_SCOPE_EXCEPTIONS` reserved for genuine
|
|
54
|
+
one-offs, and a new test locks in `~system` engines needing `protected:*`.
|
|
55
|
+
|
|
56
|
+
### Fixed
|
|
57
|
+
|
|
58
|
+
- **Per-env grants were refused on the embeddings type-pipeline routes.** The 19
|
|
59
|
+
`/api/env/:env/type/:type/pipelines…` routes (list/create, stop/start/restart/delete, stats,
|
|
60
|
+
flush, query/nearest, snapshot/rebuild, docs and their markDone/markFail/markDelete/retry,
|
|
61
|
+
retry-failed) did not declare their env scope, so a per-env grant got 403 there. They now honour
|
|
62
|
+
per-env grants and the protected `~` env gate, like their `/api/env/:env/pipelines…` siblings.
|
|
63
|
+
- **Per-env grants were refused on the schema, violation and pipeline routes.**
|
|
64
|
+
`/api/env/:env/type/:type/schema`, `/api/env/:env/violations[/:type]`,
|
|
65
|
+
`/api/env/:env/type/:type/violations/:key`, `/api/env/:env/ref-violations[/:type]` and
|
|
66
|
+
`/api/env/:env/pipelines…` did not declare their env scope, so a token whose `schema:read` (or
|
|
67
|
+
`schema:write`) was granted for one env got 403 there (the admin DB section's Schema tab and
|
|
68
|
+
violation badges failed for such tokens). They now honour per-env grants — and, like the other env
|
|
69
|
+
routes, the protected `~` env gate.
|
|
70
|
+
- Admin: links inside the admin (`#/…`) reloaded the whole page (`<base href>` made them point at
|
|
71
|
+
another document); they now navigate in place. After login the admin returns to the page you
|
|
72
|
+
opened.
|
|
73
|
+
- Admin: a deep link with `?env=` loaded the default env first; the URL's env is now selected before
|
|
74
|
+
anything loads. DB keeps `?type=` across env switches when the new env has that type.
|
|
75
|
+
- Admin: duplicate requests removed — Views loaded its list and every view's meta/definition twice,
|
|
76
|
+
`/api/system/storage` was fetched by the version badge and again by each overview (now once,
|
|
77
|
+
shared), `/admin/login/config` twice at boot, a function was loaded two or three times when opened
|
|
78
|
+
and the function list twice after create; DB entry and deep links make each call once.
|
|
79
|
+
- Admin: tokens without `system:read` no longer get 403s from the storage badge, the event stream or
|
|
80
|
+
DB's system-wide cards; the TTL and schema buttons check the permissions their routes require.
|
|
81
|
+
- Admin: a newly created view now opens; the Pipelines "↗ Type" button opens the type in DB; Files
|
|
82
|
+
honours `?collection=`; Auth's `?token=` deep link works again; queue job types show before their
|
|
83
|
+
first job; the queue job-type schema editor no longer requests `/admin/undefined/types`; System
|
|
84
|
+
works with no env selected; System → Overview's 10 s refresh stops when you leave it and its
|
|
85
|
+
styles no longer leak into DB and Pipelines.
|
|
86
|
+
- Admin static files: path containment is separator-aware (a sibling directory whose name starts
|
|
87
|
+
with the served directory's name could be read).
|
|
88
|
+
|
|
7
89
|
## [2.5.0] - 2026-09-28
|
|
8
90
|
|
|
9
91
|
### Added
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const _0x591ed2=_0x50b8;(function(_0xd8bed7,_0x1156b2){const _0x3276d0=_0x50b8,_0x45bedf=_0xd8bed7();while(!![]){try{const _0x24db1b=parseInt(_0x3276d0(0x25c))/0x1*(parseInt(_0x3276d0(0x296))/0x2)+-parseInt(_0x3276d0(0x269))/0x3*(-parseInt(_0x3276d0(0x289))/0x4)+-parseInt(_0x3276d0(0x1f0))/0x5+parseInt(_0x3276d0(0x23c))/0x6*(parseInt(_0x3276d0(0x248))/0x7)+parseInt(_0x3276d0(0x28b))/0x8*(parseInt(_0x3276d0(0x240))/0x9)+-parseInt(_0x3276d0(0x203))/0xa*(-parseInt(_0x3276d0(0x29f))/0xb)+parseInt(_0x3276d0(0x28a))/0xc*(-parseInt(_0x3276d0(0x224))/0xd);if(_0x24db1b===_0x1156b2)break;else _0x45bedf['push'](_0x45bedf['shift']());}catch(_0x49cbe4){_0x45bedf['push'](_0x45bedf['shift']());}}}(_0x414d,0x98ea6));var require$$0$1=require('worker_threads'),require$$0=require('fs'),require$$1=require(_0x591ed2(0x279)),require$$2=require('os'),require$$3=require(_0x591ed2(0x1ed));function getDefaultExportFromCjs(_0x2c2cee){const _0x2ba976=_0x591ed2;return _0x2c2cee&&_0x2c2cee[_0x2ba976(0x23a)]&&Object['prototype']['hasOwnProperty']['call'](_0x2c2cee,_0x2ba976(0x242))?_0x2c2cee[_0x2ba976(0x242)]:_0x2c2cee;}var algorithmWorkerThread$1={},snapshotStore,hasRequiredSnapshotStore;function requireSnapshotStore(){const _0x4219bf=_0x591ed2;if(hasRequiredSnapshotStore)return snapshotStore;hasRequiredSnapshotStore=0x1;const _0x5b79ed=require$$0,_0x3ac559=require$$1,_0x28fe05=require$$2,_0xa6e0a4=require$$3;function _0x1dd6b0(){const _0x1eb075=_0x50b8;return Date[_0x1eb075(0x20b)]();}function _0x231d4a(_0x5c4808){const _0x79ba30=_0x50b8;try{return _0x5b79ed[_0x79ba30(0x25f)](_0x5c4808);}catch{return![];}}function _0x3f6acd(_0x1608aa){const _0x985920=_0x50b8;try{return _0x5b79ed[_0x985920(0x1e2)](_0x1608aa,_0x985920(0x21e));}catch{return null;}}function _0x1cc405(_0x2f71c2,_0x1b23db){const _0x3ddb21=_0x50b8,_0x25d72e=_0x2f71c2+_0x3ddb21(0x2a7)+_0xa6e0a4['randomBytes'](0x6)[_0x3ddb21(0x1ff)]('hex');_0x5b79ed[_0x3ddb21(0x21b)](_0x25d72e,_0x1b23db),_0x5b79ed[_0x3ddb21(0x27d)](_0x25d72e,_0x2f71c2);}function _0x13c78f(_0x599921,_0x1c64e2=0x10){const _0xa846f=_0x50b8,_0x120618=String(Math[_0xa846f(0x251)](0x0,Math[_0xa846f(0x24e)](_0x599921||0x0)));return _0x120618[_0xa846f(0x295)]>=_0x1c64e2?_0x120618:'0'[_0xa846f(0x1e8)](_0x1c64e2-_0x120618[_0xa846f(0x295)])+_0x120618;}return snapshotStore=class _0x10dcec{constructor({dir:_0x1ef318,keepSnapshots:keepSnapshots=0x3,log:log=null}={}){const _0x34c42c=_0x50b8;if(!_0x1ef318)throw new Error('SnapshotStore\x20requires\x20dir');this[_0x34c42c(0x270)]=_0x1ef318,this[_0x34c42c(0x266)]=_0x3ac559['join'](_0x1ef318,'snapshots'),this[_0x34c42c(0x28e)]=_0x3ac559[_0x34c42c(0x200)](_0x1ef318,_0x34c42c(0x2a1)),this[_0x34c42c(0x204)]=_0x3ac559[_0x34c42c(0x200)](_0x1ef318,_0x34c42c(0x2ac)),this[_0x34c42c(0x229)]=keepSnapshots,this[_0x34c42c(0x286)]=log,_0x5b79ed[_0x34c42c(0x262)](this[_0x34c42c(0x270)],{'recursive':!![]}),_0x5b79ed[_0x34c42c(0x262)](this[_0x34c42c(0x266)],{'recursive':!![]});}[_0x4219bf(0x1fc)](_0x42d5e9){const _0x5885f5=_0x4219bf;return _0x3ac559[_0x5885f5(0x200)](this[_0x5885f5(0x266)],_0x42d5e9);}[_0x4219bf(0x298)](_0x488ea9){const _0x52e686=_0x4219bf,_0x5d632f=this['_snapshotDir'](_0x488ea9);return{'dir':_0x5d632f,'index':_0x3ac559['join'](_0x5d632f,_0x52e686(0x28c)),'labels':_0x3ac559[_0x52e686(0x200)](_0x5d632f,_0x52e686(0x268)),'state':_0x3ac559['join'](_0x5d632f,_0x52e686(0x201))};}[_0x4219bf(0x2ad)](){const _0x627a1e=_0x4219bf;if(!_0x231d4a(this[_0x627a1e(0x28e)]))return null;const _0x33632d=_0x3f6acd(this[_0x627a1e(0x28e)]);if(!_0x33632d)return null;const _0x2fba3a=String(_0x33632d)[_0x627a1e(0x25b)]();return _0x2fba3a||null;}[_0x4219bf(0x1fa)](){const _0x37f2eb=_0x4219bf,_0x24f395=this[_0x37f2eb(0x2ad)]();if(!_0x24f395)return 0x0;const _0x440bb4=Number(_0x24f395);return Number[_0x37f2eb(0x257)](_0x440bb4)?_0x440bb4:0x0;}[_0x4219bf(0x213)](){const _0x44c281=_0x4219bf;try{return _0x5b79ed[_0x44c281(0x21c)](this['snapshotsDir'],{'withFileTypes':!![]})[_0x44c281(0x2ab)](_0x3c5ea5=>_0x3c5ea5['isDirectory']())['map'](_0x940c3b=>_0x940c3b[_0x44c281(0x23d)])[_0x44c281(0x2ab)](_0x5a6a5e=>!_0x5a6a5e[_0x44c281(0x22b)](_0x44c281(0x2a7)))['filter'](_0x558be5=>!_0x558be5[_0x44c281(0x22b)]('_tmp-'))[_0x44c281(0x226)]();}catch{return[];}}[_0x4219bf(0x2a9)](){const _0x4821d7=_0x4219bf,_0x95b033=this[_0x4821d7(0x2ad)]();if(_0x95b033)return _0x95b033;const _0x5ad5c3=this['listSnapshotIds']();if(!_0x5ad5c3[_0x4821d7(0x295)])return null;return _0x5ad5c3[_0x5ad5c3[_0x4821d7(0x295)]-0x1];}[_0x4219bf(0x265)]({maxAgeMs:maxAgeMs=0x6*0x36ee80}={}){const _0xb5ad91=_0x4219bf;let _0x19feaa;try{_0x19feaa=_0x5b79ed[_0xb5ad91(0x21c)](this[_0xb5ad91(0x266)],{'withFileTypes':!![]});}catch{return;}const _0xd3f62f=_0x1dd6b0()-maxAgeMs;for(const _0x41d8c4 of _0x19feaa){if(!_0x41d8c4['isDirectory']())continue;const _0x301dda=_0x41d8c4[_0xb5ad91(0x23d)];if(!_0x301dda['startsWith']('.tmp-')&&!_0x301dda[_0xb5ad91(0x22b)](_0xb5ad91(0x23f)))continue;const _0x5d0da5=_0x3ac559['join'](this[_0xb5ad91(0x266)],_0x301dda);try{const _0x165138=_0x5b79ed['statSync'](_0x5d0da5);if(_0x165138[_0xb5ad91(0x23e)]>_0xd3f62f)continue;}catch{}try{_0x5b79ed[_0xb5ad91(0x280)](_0x5d0da5,{'recursive':!![],'force':!![]});}catch{}}}[_0x4219bf(0x250)]({keep:keep=null}={}){const _0x42fa8f=_0x4219bf,_0x5cc530=Math[_0x42fa8f(0x251)](0x1,Math[_0x42fa8f(0x24e)](keep??this['keepSnapshots']??0x3)),_0x267878=this[_0x42fa8f(0x213)]();if(_0x267878['length']<=_0x5cc530)return;const _0x1eb236=this[_0x42fa8f(0x2ad)](),_0x1cf8ab=_0x267878[_0x42fa8f(0x283)](0x0,Math[_0x42fa8f(0x251)](0x0,_0x267878[_0x42fa8f(0x295)]-_0x5cc530));for(const _0x11b65d of _0x1cf8ab){if(_0x1eb236&&_0x11b65d===_0x1eb236)continue;const _0x11f2e6=this[_0x42fa8f(0x1fc)](_0x11b65d);try{_0x5b79ed[_0x42fa8f(0x280)](_0x11f2e6,{'recursive':!![],'force':!![]});}catch{}}}async[_0x4219bf(0x27c)](_0x1e51e4,_0x46bf57){const _0x4d329d=_0x4219bf;if(!_0x1e51e4)throw new Error(_0x4d329d(0x22c));const _0x845c27=this[_0x4d329d(0x298)](_0x1e51e4);if(!_0x231d4a(_0x845c27[_0x4d329d(0x254)])||!_0x231d4a(_0x845c27['labels'])||!_0x231d4a(_0x845c27[_0x4d329d(0x221)]))throw new Error(_0x4d329d(0x244)+_0x1e51e4);const _0x28d433=await _0x46bf57(_0x845c27);return _0x28d433||{};}async[_0x4219bf(0x272)](_0x1f7ffb,_0x9c1593,{keep:keep=null,lockTimeoutMs:lockTimeoutMs=0x0,staleLockMaxAgeMs:staleLockMaxAgeMs=0xea60}={}){const _0x41a103=_0x4219bf,_0x3960aa=Number(_0x1f7ffb);if(!Number['isFinite'](_0x3960aa)||_0x3960aa<0x0)throw new Error(_0x41a103(0x2a8));const _0x9ecb27=_0x13c78f(_0x3960aa),_0x4275ad=this[_0x41a103(0x1fc)](_0x9ecb27),_0x5afa14=_0x3ac559[_0x41a103(0x200)](this[_0x41a103(0x266)],_0x41a103(0x2a7)+_0x9ecb27+'-'+_0xa6e0a4[_0x41a103(0x263)](0x6)[_0x41a103(0x1ff)](_0x41a103(0x1ee)));_0x5b79ed[_0x41a103(0x262)](_0x5afa14,{'recursive':!![]});const _0x504996={'dir':_0x5afa14,'index':_0x3ac559['join'](_0x5afa14,_0x41a103(0x28c)),'labels':_0x3ac559[_0x41a103(0x200)](_0x5afa14,_0x41a103(0x268)),'state':_0x3ac559[_0x41a103(0x200)](_0x5afa14,_0x41a103(0x201))};await _0x9c1593(_0x504996,{'id':_0x9ecb27,'clock':_0x3960aa});const _0x368c42=JSON[_0x41a103(0x24d)]({'pid':process['pid'],'host':_0x28fe05[_0x41a103(0x253)](),'at':_0x1dd6b0()}),_0x2d08fc=_0x1dd6b0();let _0x522fd0=null;const _0x488086=()=>{const _0x17c29a=_0x41a103;try{const _0x27cc4a=JSON[_0x17c29a(0x217)](_0x5b79ed[_0x17c29a(0x1e2)](this[_0x17c29a(0x204)],_0x17c29a(0x21e)));if(_0x27cc4a['at']&&_0x1dd6b0()-_0x27cc4a['at']>staleLockMaxAgeMs){const _0x245ddc=_0x1dd6b0()-_0x27cc4a['at'],_0x44a08d=_0x17c29a(0x2b1)+Math[_0x17c29a(0x20e)](_0x245ddc/0x3e8)+'s,\x20pid:\x20'+_0x27cc4a[_0x17c29a(0x26e)]+_0x17c29a(0x2a4)+_0x27cc4a[_0x17c29a(0x1e5)]+_0x17c29a(0x2af)+_0x17c29a(0x27a);this[_0x17c29a(0x286)]?.['warn']?this['log']['warn'](_0x44a08d):console[_0x17c29a(0x1ef)](_0x17c29a(0x222),_0x44a08d);try{_0x5b79ed[_0x17c29a(0x1e1)](this[_0x17c29a(0x204)]);}catch{}return!![];}}catch{try{_0x5b79ed[_0x17c29a(0x1e1)](this[_0x17c29a(0x204)]);}catch{}}return![];},_0x36d95f=()=>{const _0x25e020=_0x41a103;try{return _0x522fd0=_0x5b79ed[_0x25e020(0x29b)](this['lockPath'],'wx'),_0x5b79ed[_0x25e020(0x21b)](_0x522fd0,_0x368c42),!![];}catch(_0x34064d){if(_0x34064d&&_0x34064d[_0x25e020(0x1f6)]==='EEXIST')return![];throw _0x34064d;}};if(!_0x36d95f()){_0x488086(),_0x36d95f();if(_0x522fd0==null&&lockTimeoutMs>0x0)while(_0x1dd6b0()-_0x2d08fc<lockTimeoutMs){await new Promise(_0x4c8288=>setTimeout(_0x4c8288,0x19));if(_0x36d95f())break;_0x488086();}}if(_0x522fd0==null){try{_0x5b79ed[_0x41a103(0x280)](_0x5afa14,{'recursive':!![],'force':!![]});}catch{}return{'published':![],'reason':'lock_busy'};}try{const _0x440cb8=this[_0x41a103(0x1fa)]();if(_0x3960aa<=_0x440cb8){try{_0x5b79ed[_0x41a103(0x280)](_0x5afa14,{'recursive':!![],'force':!![]});}catch{}return{'published':![],'reason':'stale','currentClock':_0x440cb8};}if(!_0x231d4a(_0x4275ad))_0x5b79ed[_0x41a103(0x27d)](_0x5afa14,_0x4275ad);else try{_0x5b79ed['rmSync'](_0x5afa14,{'recursive':!![],'force':!![]});}catch{}return _0x1cc405(this[_0x41a103(0x28e)],_0x9ecb27+'\x0a'),this[_0x41a103(0x250)]({'keep':keep}),{'published':!![],'currentClock':_0x3960aa};}finally{try{_0x5b79ed['closeSync'](_0x522fd0);}catch{}try{_0x5b79ed[_0x41a103(0x1e1)](this[_0x41a103(0x204)]);}catch{}}}},snapshotStore;}var labelMap,hasRequiredLabelMap;function requireLabelMap(){const _0x4941de=_0x591ed2;if(hasRequiredLabelMap)return labelMap;hasRequiredLabelMap=0x1;const _0x5276d1=require$$0;class _0x456752{constructor(){const _0x4f93fb=_0x50b8;this[_0x4f93fb(0x22f)]=new Map(),this['labelToKey']=new Map(),this[_0x4f93fb(0x2b3)]=0x0,this[_0x4f93fb(0x233)]=0x0,this['keyToFp']=new Map(),this[_0x4f93fb(0x223)]=!![];}async[_0x4941de(0x20c)](){const _0xae16a6=_0x4941de;this[_0xae16a6(0x22f)]=new Map(),this['labelToKey']=new Map(),this[_0xae16a6(0x239)]=new Map(),this[_0xae16a6(0x223)]=!![],this[_0xae16a6(0x2b3)]=0x0,this[_0xae16a6(0x233)]=0x0;}async['loadFrom'](_0x1b8690){const _0x488398=_0x4941de;if(!_0x1b8690||!_0x5276d1[_0x488398(0x25f)](_0x1b8690))return await this[_0x488398(0x20c)](),!![];let _0xddb22e;try{_0xddb22e=_0x5276d1[_0x488398(0x1e2)](_0x1b8690,_0x488398(0x21e));}catch{return await this[_0x488398(0x20c)](),!![];}let _0x42a9fc;try{_0x42a9fc=JSON['parse'](_0xddb22e);}catch{return await this['reset'](),!![];}const _0x2bddc6=Array['isArray'](_0x42a9fc?.[_0x488398(0x22d)])?_0x42a9fc[_0x488398(0x22d)]:[],_0x2721ab=Number['isInteger'](_0x42a9fc?.[_0x488398(0x2b3)])?_0x42a9fc[_0x488398(0x2b3)]:0x0,_0x31129e=new Map(),_0x2c99e4=new Map(),_0x294603=new Map(),_0x45c2a9=_0x42a9fc?.['version']>=0x2;let _0x941949=-0x1;for(const _0x56f217 of _0x2bddc6){if(!Array[_0x488398(0x1eb)](_0x56f217)||_0x56f217[_0x488398(0x295)]<0x2)continue;const _0x33e7db=Number(_0x56f217[0x0]),_0x41e181=String(_0x56f217[0x1]??'');if(!Number['isInteger'](_0x33e7db)||_0x33e7db<0x0)continue;if(!_0x41e181)continue;_0x31129e[_0x488398(0x24c)](_0x41e181,_0x33e7db),_0x2c99e4['set'](_0x33e7db,_0x41e181);if(_0x45c2a9&&typeof _0x56f217[0x2]===_0x488398(0x249))_0x294603['set'](_0x41e181,_0x56f217[0x2]);if(_0x33e7db>_0x941949)_0x941949=_0x33e7db;}return this['keyToLabel']=_0x31129e,this[_0x488398(0x252)]=_0x2c99e4,this[_0x488398(0x239)]=_0x294603,this[_0x488398(0x223)]=_0x45c2a9,this[_0x488398(0x2b3)]=Math['max'](_0x2721ab,_0x941949+0x1,0x0),this['_tombstoneCount']=0x0,!![];}[_0x4941de(0x22a)](_0xd45a50){const _0x55099a=_0x4941de;return this[_0x55099a(0x22f)][_0x55099a(0x245)](_0xd45a50);}[_0x4941de(0x1f7)](_0x3fa8f2){const _0x48c21c=_0x4941de;let _0x310aaa=this[_0x48c21c(0x22f)][_0x48c21c(0x245)](_0x3fa8f2);if(_0x310aaa!==undefined)return _0x310aaa;return _0x310aaa=this[_0x48c21c(0x2b3)]++,this[_0x48c21c(0x22f)][_0x48c21c(0x24c)](_0x3fa8f2,_0x310aaa),this[_0x48c21c(0x252)][_0x48c21c(0x24c)](_0x310aaa,_0x3fa8f2),_0x310aaa;}[_0x4941de(0x2b0)](_0x9481b6,_0x5a59e8){const _0x1f09fb=_0x4941de;if(_0x5a59e8==null)this['keyToFp'][_0x1f09fb(0x1ea)](_0x9481b6);else this[_0x1f09fb(0x239)][_0x1f09fb(0x24c)](_0x9481b6,_0x5a59e8);}['fingerprintOf'](_0x2f50f1){const _0x315938=_0x4941de;return this[_0x315938(0x239)]['get'](_0x2f50f1);}[_0x4941de(0x23b)](){const _0x42bb2e=_0x4941de;return this['keyToLabel'][_0x42bb2e(0x23b)]();}['tombstone'](_0x3e580b){const _0x219895=_0x4941de,_0xf1908b=this['keyToLabel'][_0x219895(0x245)](_0x3e580b);if(_0xf1908b===undefined)return;this[_0x219895(0x239)][_0x219895(0x1ea)](_0x3e580b),this['keyToLabel'][_0x219895(0x1ea)](_0x3e580b),this[_0x219895(0x252)]['delete'](_0xf1908b),this[_0x219895(0x233)]++;}[_0x4941de(0x1f5)](_0x3de0e9){const _0x4089d8=_0x4941de;return this[_0x4089d8(0x252)]['get'](_0x3de0e9)??null;}[_0x4941de(0x25e)](){const _0x295344=_0x4941de;return this[_0x295344(0x22f)][_0x295344(0x25e)];}['tombstoneCount'](){return this['_tombstoneCount'];}async['snapshotTo'](_0x558950){const _0x46a81d=_0x4941de,_0x5b0dde=_0x558950+_0x46a81d(0x243),_0x4abc5e=[];for(const [_0x3eec80,_0x59d533]of this['labelToKey'][_0x46a81d(0x22d)]()){const _0x559c27=this['keyToFp'][_0x46a81d(0x245)](_0x59d533);_0x4abc5e['push'](_0x559c27==null?[_0x3eec80,_0x59d533]:[_0x3eec80,_0x59d533,_0x559c27]);}_0x4abc5e[_0x46a81d(0x226)]((_0x499b21,_0x53725f)=>_0x499b21[0x0]-_0x53725f[0x0]);const _0x934722={'version':0x2,'nextLabel':this[_0x46a81d(0x2b3)],'entries':_0x4abc5e};_0x5276d1['writeFileSync'](_0x5b0dde,JSON[_0x46a81d(0x24d)](_0x934722)),_0x5276d1[_0x46a81d(0x27d)](_0x5b0dde,_0x558950);}}return labelMap=_0x456752,labelMap;}var indexConvergence,hasRequiredIndexConvergence;function requireIndexConvergence(){if(hasRequiredIndexConvergence)return indexConvergence;hasRequiredIndexConvergence=0x1;function _0x579d3c(_0x2c4e01){const _0x135aac=_0x50b8,_0x1992f4=new Uint32Array(_0x2c4e01[_0x135aac(0x1e3)],_0x2c4e01[_0x135aac(0x1e6)],_0x2c4e01[_0x135aac(0x295)]);let _0x1ff7bf=0x811c9dc5,_0x142cfa=0x9747b28c;for(let _0x1b0ca6=0x0;_0x1b0ca6<_0x1992f4[_0x135aac(0x295)];_0x1b0ca6++){const _0x58b5d1=_0x1992f4[_0x1b0ca6];_0x1ff7bf=Math['imul'](_0x1ff7bf^_0x58b5d1,0x1000193)>>>0x0;let _0x51b280=Math[_0x135aac(0x264)](_0x58b5d1,0xcc9e2d51);_0x51b280=_0x51b280<<0xf|_0x51b280>>>0x11,_0x142cfa=Math[_0x135aac(0x264)](_0x142cfa^Math[_0x135aac(0x264)](_0x51b280,0x1b873593),0x5)+0xe6546b64,_0x142cfa>>>=0x0;}return _0x142cfa=Math[_0x135aac(0x264)](_0x142cfa^_0x142cfa>>>0x10,0x85ebca6b)>>>0x0,(_0x1ff7bf>>>0x0)*0x100000+(_0x142cfa&0xfffff);}function _0xb1b5c5(_0x4bdeaf,_0x2d6455,_0x61f798,{upsert:_0x57d0c9,remove:_0x400d9f}){const _0x1b32e7=_0x50b8,_0x12f3ba=new Set();let _0x2bb2e0=0x0,_0x2627f9=0x0,_0x5c57dc=0x0;for(const {key:_0x2b4ace,vector:_0x81c7bf}of _0x2d6455){if(!(_0x81c7bf instanceof Float32Array)||_0x81c7bf['length']!==_0x61f798)continue;_0x12f3ba[_0x1b32e7(0x281)](_0x2b4ace);const _0x29eb8b=_0x579d3c(_0x81c7bf),_0x488ba5=_0x4bdeaf['labelForExisting'](_0x2b4ace)!==undefined;if(_0x488ba5&&_0x4bdeaf['fingerprintOf'](_0x2b4ace)===_0x29eb8b)continue;_0x57d0c9(_0x2b4ace,_0x81c7bf,_0x29eb8b);if(_0x488ba5)_0x2627f9++;else _0x2bb2e0++;}for(const _0x4e17a4 of[..._0x4bdeaf['keys']()]){if(_0x12f3ba[_0x1b32e7(0x1ec)](_0x4e17a4))continue;_0x400d9f(_0x4e17a4),_0x5c57dc++;}return{'added':_0x2bb2e0,'changed':_0x2627f9,'removed':_0x5c57dc};}return indexConvergence={'fingerprint':_0x579d3c,'reconcileIndex':_0xb1b5c5},indexConvergence;}function _0x414d(){const _0x5b9c6b=['error','filter','SNAPSHOT.LOCK','readCurrentId','writeIndexSync',').\x20','setFingerprint','Breaking\x20stale\x20snapshot\x20lock\x20(age:\x20','resizeIndex','nextLabel','ceil','ScalarKind','platform','changed','isFree','reject','Install\x20compatible\x20bindings\x20or\x20use\x20algorithm\x20\x22flat\x22/\x22hnsw\x22\x20instead.\x20','unreadable','unlinkSync','readFileSync','buffer','usearch\x20algorithm\x20unavailable:\x20the\x20native\x20\x22usearch\x22\x20bindings\x20could\x20not\x20be\x20loaded\x20','host','byteOffset','then','repeat','memoryUsage','delete','isArray','has','crypto','hex','warn','4034235NlMwiu','fid','rebuild','efSearch','manifestVersion','keyForLabel','code','labelForEphemeral','efConstruction','getMaxElements','readCurrentClock','hnsw\x20algorithm\x20requires\x20dir\x20for\x20snapshot\x20storage','_snapshotDir','count','usearch\x20algorithm\x20requires\x20dims\x20>\x200','toString','join','state.json','tombstone','10070luNPIP','lockPath','metric','HNSW_BINDINGS_UNAVAILABLE','capacity','usearch\x20algorithm\x20requires\x20dir\x20for\x20snapshot\x20storage','vector','exports','now','reset','stop','round','postMessage','message','key','info','listSnapshotIds','writerLockMaxAgeMs','fingerprintOf','Index','parse','loadFrom','snapshotMaxLagMs','fetchAll','writeFileSync','readdirSync','F32','utf8','token','usearch','state','[SnapshotStore]','hasFingerprints','46215jccTNO','expansionSearch','sort','cause','hnsw\x20algorithm\x20requires\x20dims\x20>\x200','keepSnapshots','labelForExisting','startsWith','snapshot\x20id\x20required','entries','search','keyToLabel','reader','distances','Original\x20error:\x20','_tombstoneCount','sync','searchKnn','HNSW\x20algorithm\x20unavailable:\x20the\x20native\x20\x22hnswlib-node\x22\x20bindings\x20could\x20not\x20be\x20loaded\x20','growFactor','release','keyToFp','__esModule','keys','457842FUxJPu','name','mtimeMs','_tmp-','2556ZeTfOe','sqrt','default','.tmp','snapshot\x20incomplete:\x20','get','hnsw','hnswlib-node','7EIrdLL','number','load','vectors','set','stringify','trunc','removed','prune','max','labelToKey','hostname','index','node','score','isFinite','MetricKind','ENOENT','maxElements','trim','491CGDwDK','viewRefreshMs','size','existsSync','catch','unref','mkdirSync','randomBytes','imul','cleanupTmpDirs','snapshotsDir','flat','labels.json','2793117jpFhar','readIndexSync','HierarchicalNSW','acquire','dims','pid','heartbeatIntervalMs','dir','writer','publishSnapshot','snapshot','markDelete','connectivity','queryVec','cosine','closeSync','path','This\x20is\x20risky\x20on\x20slow\x20disks\x20or\x20overloaded\x20machines.\x20Consider\x20increasing\x20staleLockMaxAgeMs\x20if\x20this\x20happens\x20frequently.','remove','loadSnapshot','renameSync','labels','isInteger','rmSync','add','snapshotTo','slice','from','\x20on\x20','log','hasRows','tmpMaxAgeMs','4jiTQke','4716sCiBYW','4288uTsrnr','index.hnsw','setEf','currentPath','Install\x20compatible\x20bindings\x20or\x20use\x20algorithm\x20\x22flat\x22\x20instead.\x20','ready','L2sq','fetchAllResult','clear','USEARCH_BINDINGS_UNAVAILABLE','length','2478GWdLVq','clock','_snapshotPaths','expansionAdd','finally','openSync','resolve','arch','push','11605tpnhxw','save','CURRENT','snapshotEveryChanges','published',',\x20host:\x20','versions','Cos','.tmp-','candidateClock\x20must\x20be\x20finite\x20>=\x200','latestSnapshotId'];_0x414d=function(){return _0x5b9c6b;};return _0x414d();}var hnsw,hasRequiredHnsw;function requireHnsw(){if(hasRequiredHnsw)return hnsw;hasRequiredHnsw=0x1;const _0x4f6e78=requireSnapshotStore(),_0x3579aa=requireLabelMap(),{fingerprint:_0x4edf74,reconcileIndex:_0x572340}=requireIndexConvergence(),_0x15f4fe=0x1;let _0x7e80ad=null;function _0x468691(){const _0x41f0df=_0x50b8;if(_0x7e80ad)return _0x7e80ad;try{return _0x7e80ad=require(_0x41f0df(0x247)),_0x7e80ad;}catch(_0x511198){const _0x2dc947=new Error(_0x41f0df(0x236)+('for\x20Node\x20'+process[_0x41f0df(0x2a5)][_0x41f0df(0x255)]+_0x41f0df(0x285)+process[_0x41f0df(0x1db)]+'/'+process[_0x41f0df(0x29d)]+'.\x20')+_0x41f0df(0x28f)+(_0x41f0df(0x232)+(_0x511198?.['message']||String(_0x511198))));_0x2dc947[_0x41f0df(0x1f6)]=_0x41f0df(0x206),_0x2dc947[_0x41f0df(0x227)]=_0x511198;throw _0x2dc947;}}return hnsw=function _0xfd0508(_0x1ec33d={},{dims:_0x288671,dir:_0x5a53d7}){const _0x3bfa97=_0x50b8,_0x21833b=_0x468691();if(!_0x288671||_0x288671<=0x0)throw new Error(_0x3bfa97(0x228));if(!_0x5a53d7)throw new Error(_0x3bfa97(0x1fb));const _0x509141={'metric':_0x1ec33d['metric']??'cosine','M':_0x1ec33d['M']??0x10,'efConstruction':_0x1ec33d[_0x3bfa97(0x1f8)]??0xc8,'efSearch':_0x1ec33d[_0x3bfa97(0x1f3)]??0x40,'maxElements':_0x1ec33d['maxElements']??0x400,'growFactor':_0x1ec33d['growFactor']??0x2,'snapshotEveryChanges':_0x1ec33d['snapshotEveryChanges']??0xc350,'keepSnapshots':_0x1ec33d[_0x3bfa97(0x229)]??0x2,'tmpMaxAgeMs':_0x1ec33d[_0x3bfa97(0x288)]??0x6*0x36ee80},_0x417cf4=new _0x4f6e78({'dir':_0x5a53d7,'keepSnapshots':_0x509141[_0x3bfa97(0x229)]}),_0x3a3c31=new _0x3579aa();let _0x39f3fe=null,_0x2c8029=0x0,_0x205e9e=null,_0x35cc52=Promise[_0x3bfa97(0x29c)]();const _0x14e6d0=_0x4a5e0c=>{const _0x2d9d70=_0x3bfa97,_0x172077=_0x35cc52[_0x2d9d70(0x1e7)](_0x4a5e0c);return _0x35cc52=_0x172077[_0x2d9d70(0x260)](()=>{}),_0x172077;};async function _0x2e5242(_0x295103){const _0x50299f=_0x3bfa97;await _0x3a3c31[_0x50299f(0x20c)](),_0x295103=_0x295103??[];const _0x32d82e=Math[_0x50299f(0x251)](_0x509141[_0x50299f(0x25a)],Math['ceil'](_0x295103['length']*(_0x509141['growFactor']||1.2)),0x1);_0x39f3fe=new _0x21833b[(_0x50299f(0x26b))](_0x509141[_0x50299f(0x205)],_0x288671),_0x39f3fe['initIndex']({'maxElements':_0x32d82e,'efConstruction':_0x509141[_0x50299f(0x1f8)],'M':_0x509141['M']});for(const {key:_0x4824b2,vector:_0x1fe8d1}of _0x295103){if(!(_0x1fe8d1 instanceof Float32Array)||_0x1fe8d1[_0x50299f(0x295)]!==_0x288671)continue;_0x4379c1(_0x4824b2,_0x1fe8d1);}_0x39f3fe[_0x50299f(0x28d)](_0x509141[_0x50299f(0x1f3)]),_0x2c8029=0x0;}async function _0x4dcc76(_0x4ca356){return _0x2e5242(_0x4ca356?await _0x4ca356():[]);}function _0xd7aab1(){const _0x31b8e7=_0x3bfa97;if(_0x39f3fe['getCurrentCount']()<_0x39f3fe[_0x31b8e7(0x1f9)]())return;const _0x166d11=Math[_0x31b8e7(0x2b4)](_0x39f3fe[_0x31b8e7(0x1f9)]()*(_0x509141[_0x31b8e7(0x237)]||0x2));_0x39f3fe[_0x31b8e7(0x2b2)](_0x166d11),_0x509141[_0x31b8e7(0x25a)]=_0x166d11;}function _0x4379c1(_0x534d29,_0x4ebb3b,_0x42bda3){const _0x421ebc=_0x3bfa97,_0x186861=_0x3a3c31[_0x421ebc(0x1f7)](_0x534d29);try{_0x39f3fe[_0x421ebc(0x274)](_0x186861);}catch{}_0xd7aab1(),_0x39f3fe['addPoint'](Array[_0x421ebc(0x284)](_0x4ebb3b),_0x186861),_0x3a3c31[_0x421ebc(0x2b0)](_0x534d29,_0x42bda3??_0x4edf74(_0x4ebb3b));}function _0x309d9f(_0x4fe483){const _0x5624ec=_0x3bfa97,_0x3431c4=_0x3a3c31[_0x5624ec(0x22a)](_0x4fe483);if(_0x3431c4===undefined)return![];try{_0x39f3fe[_0x5624ec(0x274)](_0x3431c4);}catch{}return _0x3a3c31[_0x5624ec(0x202)](_0x4fe483),!![];}function _0xf83da(){const _0x1a9718=_0x3bfa97;return Math[_0x1a9718(0x251)](Date[_0x1a9718(0x20b)](),_0x417cf4[_0x1a9718(0x1fa)]()+0x1);}async function _0x574d9b(_0x4022a7){const _0x535c93=_0x3bfa97;if(!_0x39f3fe||!_0x4022a7)return![];const _0x3f8e33=await _0x417cf4['publishSnapshot'](_0x4022a7,async _0x56043a=>{const _0x41975b=_0x50b8;_0x39f3fe[_0x41975b(0x2ae)](_0x56043a[_0x41975b(0x254)]),await _0x3a3c31[_0x41975b(0x282)](_0x56043a[_0x41975b(0x27e)]);const _0x36b13d=require$$0;_0x36b13d['writeFileSync'](_0x56043a[_0x41975b(0x221)],JSON[_0x41975b(0x24d)]({'manifestVersion':_0x15f4fe,'dims':_0x288671,'metric':_0x509141[_0x41975b(0x205)],'clock':_0x4022a7,'snapshotAt':Date[_0x41975b(0x20b)]()},null,0x2));},{'keep':_0x509141[_0x535c93(0x229)]});if(_0x3f8e33?.[_0x535c93(0x2a3)])_0x2c8029=0x0;return _0x3f8e33?.[_0x535c93(0x2a3)]??![];}async function _0x1fbffc(){const _0x4b7338=_0x3bfa97,_0x51f152=_0x417cf4['readCurrentId']()||_0x417cf4[_0x4b7338(0x2a9)]();if(!_0x51f152)return null;let _0x58327d,_0x3c48cc=![];return await _0x417cf4[_0x4b7338(0x27c)](_0x51f152,async _0x250bc8=>{const _0x418b98=_0x4b7338,_0x3f598b=require$$0;_0x58327d=JSON[_0x418b98(0x217)](_0x3f598b['readFileSync'](_0x250bc8[_0x418b98(0x221)],_0x418b98(0x21e)));if(_0x58327d[_0x418b98(0x1f4)]!==_0x15f4fe||_0x58327d['dims']!==_0x288671||_0x58327d[_0x418b98(0x205)]!==_0x509141[_0x418b98(0x205)]){_0x58327d=null;return;}await _0x3a3c31[_0x418b98(0x218)](_0x250bc8[_0x418b98(0x27e)]),_0x39f3fe=new _0x21833b[(_0x418b98(0x26b))](_0x509141[_0x418b98(0x205)],_0x288671),_0x39f3fe[_0x418b98(0x26a)](_0x250bc8['index']),_0x39f3fe[_0x418b98(0x28d)](_0x509141[_0x418b98(0x1f3)]),_0x3c48cc=!![];}),_0x3c48cc?_0x58327d?.[_0x4b7338(0x297)]??0x0:null;}return{async 'load'(_0x24f3b2){return _0x14e6d0(async()=>{const _0x1bd7fc=_0x50b8;_0x417cf4['cleanupTmpDirs']({'maxAgeMs':_0x509141[_0x1bd7fc(0x288)]}),_0x205e9e=_0x24f3b2??null;const _0x388b32=await _0x1fbffc(),_0x34e4e9=_0x24f3b2?await _0x24f3b2():null;if(_0x388b32!=null){if(_0x34e4e9){if(!_0x3a3c31[_0x1bd7fc(0x223)])return await _0x2e5242(_0x34e4e9),null;const _0x110683=_0x572340(_0x3a3c31,_0x34e4e9,_0x288671,{'upsert':_0x4379c1,'remove':_0x309d9f});_0x2c8029+=_0x110683['added']+_0x110683[_0x1bd7fc(0x1dc)]+_0x110683['removed'];}return _0x388b32;}return await _0x2e5242(_0x34e4e9),null;});},async 'add'(_0x4b28b0,_0x5025e4,_0x117951){return _0x14e6d0(async()=>{if(!_0x39f3fe)return;const _0x1b2ebd=_0x5025e4 instanceof Float32Array?_0x5025e4:new Float32Array(_0x5025e4),_0x809c6e=_0x4edf74(_0x1b2ebd);if(_0x3a3c31['fingerprintOf'](_0x4b28b0)===_0x809c6e)return;_0x4379c1(_0x4b28b0,_0x1b2ebd,_0x809c6e),_0x2c8029++,_0x2c8029>=_0x509141['snapshotEveryChanges']&&await _0x574d9b(_0xf83da());});},async 'remove'(_0x26be97){return _0x14e6d0(async()=>{if(!_0x39f3fe)return;if(_0x309d9f(_0x26be97))_0x2c8029++;});},'search'(_0x502aae,{limit:limit=0xa,efSearch:_0xec151f}={}){const _0x37dd84=_0x3bfa97;if(!_0x39f3fe)return[];if(Number[_0x37dd84(0x27f)](_0xec151f))_0x39f3fe[_0x37dd84(0x28d)](_0xec151f);const _0x4c33c2=Math['min'](limit,_0x39f3fe['getCurrentCount']()||0x1),{neighbors:_0x3850a4,distances:_0x3b7f45}=_0x39f3fe[_0x37dd84(0x235)](Array[_0x37dd84(0x284)](_0x502aae),_0x4c33c2),_0x4dfde3=[];for(let _0x1c043a=0x0;_0x1c043a<_0x3850a4['length'];_0x1c043a++){const _0x1175ef=_0x3a3c31[_0x37dd84(0x1f5)](_0x3850a4[_0x1c043a]);if(!_0x1175ef)continue;const _0x331b32=_0x509141[_0x37dd84(0x205)]===_0x37dd84(0x277)?Math[_0x37dd84(0x251)](0x0,0x1-_0x3b7f45[_0x1c043a]):0x1/(0x1+_0x3b7f45[_0x1c043a]);_0x4dfde3[_0x37dd84(0x29e)]({'key':_0x1175ef,'score':_0x331b32});}return _0x4dfde3;},async 'snapshot'(_0x37c56c){return _0x14e6d0(()=>_0x574d9b(_0x37c56c??_0xf83da()));},async 'rebuild'(_0x3ec4b7){return _0x14e6d0(()=>{if(_0x3ec4b7!=null)_0x205e9e=_0x3ec4b7;return _0x4dcc76(_0x3ec4b7??_0x205e9e);});},async 'stop'(){const _0x465c58=_0x3bfa97;return _0x14e6d0(()=>_0x2c8029>0x0||!_0x417cf4[_0x465c58(0x2ad)]()?_0x574d9b(_0xf83da()):![]);},'count'(){const _0x3fef7b=_0x3bfa97;return _0x3a3c31[_0x3fef7b(0x25e)]();},'info'(){const _0x5afe99=_0x3bfa97;return{'algorithm':_0x5afe99(0x246),'metric':_0x509141[_0x5afe99(0x205)],'M':_0x509141['M'],'efConstruction':_0x509141[_0x5afe99(0x1f8)],'efSearch':_0x509141[_0x5afe99(0x1f3)],'maxElements':_0x39f3fe?.[_0x5afe99(0x1f9)]()??_0x509141[_0x5afe99(0x25a)],'count':_0x3a3c31[_0x5afe99(0x25e)](),'changesSince':_0x2c8029,'snapshotDir':_0x5a53d7,'latestSnapshot':_0x417cf4[_0x5afe99(0x2ad)]()??null};}};},hnsw;}var flat,hasRequiredFlat;function requireFlat(){if(hasRequiredFlat)return flat;hasRequiredFlat=0x1,flat=function _0x3b336a(_0x10fbe2={}){const _0x42b571=new Map();return{async 'load'(_0x392d14){const _0xe2b6c8=_0x50b8;_0x42b571[_0xe2b6c8(0x293)]();if(_0x392d14)for(const {key:_0x1b3c77,vector:_0x110d38}of await _0x392d14()){_0x42b571[_0xe2b6c8(0x24c)](_0x1b3c77,_0x110d38);}},async 'add'(_0x1d6e58,_0x4d818b,_0x6f74f2){const _0x29c8b9=_0x50b8;_0x42b571[_0x29c8b9(0x24c)](_0x1d6e58,_0x4d818b);},async 'remove'(_0x2728b4){_0x42b571['delete'](_0x2728b4);},'search'(_0x2b03b5,{limit:limit=0xa,threshold:threshold=0x0}={}){const _0x5d221a=_0x50b8,_0x312d02=[];for(const [_0x1d5313,_0x64008b]of _0x42b571){const _0x2252a7=_0x38cc90(_0x2b03b5,_0x64008b);if(_0x2252a7>=threshold)_0x312d02[_0x5d221a(0x29e)]({'key':_0x1d5313,'score':_0x2252a7});}return _0x312d02[_0x5d221a(0x226)]((_0x45e002,_0x4149d6)=>_0x4149d6['score']-_0x45e002[_0x5d221a(0x256)]),_0x312d02[_0x5d221a(0x283)](0x0,limit);},async 'snapshot'(){return![];},async 'rebuild'(_0x3921ca){const _0xda79ad=_0x50b8;await this[_0xda79ad(0x24a)](_0x3921ca);},async 'stop'(){},'count'(){return _0x42b571['size'];},'info'(){return{'algorithm':'flat','count':_0x42b571['size']};}};};function _0x38cc90(_0x385f9f,_0x56b118){const _0x2ac5c0=_0x50b8;let _0x345996=0x0,_0x57162d=0x0,_0x1786bc=0x0;for(let _0x5b1846=0x0;_0x5b1846<_0x385f9f['length'];_0x5b1846++){_0x345996+=_0x385f9f[_0x5b1846]*_0x56b118[_0x5b1846],_0x57162d+=_0x385f9f[_0x5b1846]*_0x385f9f[_0x5b1846],_0x1786bc+=_0x56b118[_0x5b1846]*_0x56b118[_0x5b1846];}const _0x58d09e=Math['sqrt'](_0x57162d)*Math[_0x2ac5c0(0x241)](_0x1786bc);return _0x58d09e===0x0?0x0:_0x345996/_0x58d09e;}return flat;}var writerLock,hasRequiredWriterLock;function requireWriterLock(){if(hasRequiredWriterLock)return writerLock;hasRequiredWriterLock=0x1;const _0x2a68c0=require$$0,_0x3b7ab4=require$$1,_0x2726d6=require$$3;return writerLock=function _0xf94222(_0x1c92f5,{maxAgeMs:maxAgeMs=0x3a98,heartbeatMs:heartbeatMs=0x1388,onLost:onLost=null}={}){const _0x3f839c=_0x50b8,_0x118596=_0x3b7ab4[_0x3f839c(0x200)](_0x1c92f5,'WRITER.LOCK'),_0x41431e=_0x2726d6['randomBytes'](0x8)['toString'](_0x3f839c(0x1ee));let _0x2015bf=![],_0x1d5fab=null;const _0x4efd33=()=>JSON[_0x3f839c(0x24d)]({'pid':process[_0x3f839c(0x26e)],'token':_0x41431e,'at':Date[_0x3f839c(0x20b)]()});function _0x3b2504(){const _0x149887=_0x3f839c;try{return JSON[_0x149887(0x217)](_0x2a68c0[_0x149887(0x1e2)](_0x118596,_0x149887(0x21e)));}catch(_0x49fcc1){return _0x49fcc1?.[_0x149887(0x1f6)]===_0x149887(0x259)?null:{'unreadable':!![]};}}function _0x23d7ca(){const _0x2a9a7d=_0x3f839c;try{const _0x41516e=_0x2a68c0[_0x2a9a7d(0x29b)](_0x118596,'wx');try{_0x2a68c0[_0x2a9a7d(0x21b)](_0x41516e,_0x4efd33());}finally{_0x2a68c0[_0x2a9a7d(0x278)](_0x41516e);}return!![];}catch(_0x7a2202){if(_0x7a2202?.[_0x2a9a7d(0x1f6)]==='EEXIST')return![];throw _0x7a2202;}}function _0x77a0e6(_0x2742ae){const _0x58a09b=_0x3f839c;if(!_0x2742ae)return!![];if(_0x2742ae[_0x58a09b(0x1e0)])return!![];return Date[_0x58a09b(0x20b)]()-(_0x2742ae['at']??0x0)>=maxAgeMs;}function _0x33c37b(){if(_0x1d5fab)clearInterval(_0x1d5fab);_0x1d5fab=null;}function _0x572b56(){const _0x47237f=_0x3f839c;_0x33c37b(),_0x1d5fab=setInterval(()=>{const _0x36cf76=_0x50b8,_0x4010de=_0x3b2504();if(_0x4010de&&!_0x4010de[_0x36cf76(0x1e0)]&&_0x4010de[_0x36cf76(0x21f)]!==_0x41431e){_0x2015bf=![],_0x33c37b();try{onLost?.();}catch{}return;}try{_0x2a68c0[_0x36cf76(0x21b)](_0x118596,_0x4efd33());}catch{}},heartbeatMs),_0x1d5fab[_0x47237f(0x261)]?.();}function _0x265332(){const _0x17ac6a=_0x3f839c,_0x2019d4=_0x3b2504();return!!_0x2019d4&&_0x2019d4[_0x17ac6a(0x21f)]===_0x41431e;}return{'path':_0x118596,'token':_0x41431e,'acquire'(){const _0x20c007=_0x3b2504();if(_0x20c007&&_0x20c007['token']===_0x41431e){_0x2015bf=!![];if(!_0x1d5fab)_0x572b56();return!![];}let _0x452c1a=_0x23d7ca();if(!_0x452c1a&&_0x77a0e6(_0x3b2504())){try{_0x2a68c0['unlinkSync'](_0x118596);}catch{}_0x452c1a=_0x23d7ca();}if(_0x452c1a&&!_0x265332())_0x452c1a=![];_0x2015bf=_0x452c1a;if(_0x452c1a)_0x572b56();return _0x452c1a;},'held'(){return _0x2015bf;},'isFree'(){const _0x2d864b=_0x3f839c,_0x25eb35=_0x3b2504();if(_0x25eb35&&_0x25eb35[_0x2d864b(0x21f)]===_0x41431e)return![];return _0x77a0e6(_0x25eb35);},'release'(){const _0x3c1940=_0x3f839c;_0x33c37b();if(!_0x2015bf)return;_0x2015bf=![];if(_0x265332())try{_0x2a68c0[_0x3c1940(0x1e1)](_0x118596);}catch{}}};},writerLock;}var usearch,hasRequiredUsearch;function requireUsearch(){if(hasRequiredUsearch)return usearch;hasRequiredUsearch=0x1;const _0x3374ff=require$$0,_0x218df2=requireSnapshotStore(),_0x32f9d5=requireLabelMap(),_0x5ed3e1=requireWriterLock(),{fingerprint:_0x266e98,reconcileIndex:_0x1ba238}=requireIndexConvergence(),_0xe956c9=0x1;let _0x29f4b3=null;function _0x2d8a48(){const _0x17cc12=_0x50b8;if(_0x29f4b3)return _0x29f4b3;try{return _0x29f4b3=require(_0x17cc12(0x220)),_0x29f4b3;}catch(_0x40e2d9){const _0x2d9e43=new Error(_0x17cc12(0x1e4)+('for\x20Node\x20'+process[_0x17cc12(0x2a5)][_0x17cc12(0x255)]+'\x20on\x20'+process[_0x17cc12(0x1db)]+'/'+process[_0x17cc12(0x29d)]+'.\x20')+_0x17cc12(0x1df)+(_0x17cc12(0x232)+(_0x40e2d9?.['message']||String(_0x40e2d9))));_0x2d9e43[_0x17cc12(0x1f6)]=_0x17cc12(0x294),_0x2d9e43[_0x17cc12(0x227)]=_0x40e2d9;throw _0x2d9e43;}}function _0x17ca5a(_0x23ff3d,_0xf1efda){const _0xe90921=_0x50b8;switch(_0x23ff3d){case _0xe90921(0x277):return _0xf1efda[_0xe90921(0x258)][_0xe90921(0x2a6)];case'l2':return _0xf1efda['MetricKind'][_0xe90921(0x291)];case'ip':return _0xf1efda[_0xe90921(0x258)]['IP'];default:return _0xf1efda[_0xe90921(0x258)][_0xe90921(0x2a6)];}}return usearch=function _0x259933(_0x2e053c={},{dims:_0x3a6dc1,dir:_0x98f1ee,fetchAll:fetchAll=null,onChange:onChange=null}={}){const _0x5db65d=_0x50b8,_0x39e59f=_0x2d8a48();if(!_0x3a6dc1||_0x3a6dc1<=0x0)throw new Error(_0x5db65d(0x1fe));if(!_0x98f1ee)throw new Error(_0x5db65d(0x208));const _0x540ae0={'metric':_0x2e053c[_0x5db65d(0x205)]??_0x5db65d(0x277),'connectivity':_0x2e053c[_0x5db65d(0x275)]??0x10,'expansionAdd':_0x2e053c[_0x5db65d(0x299)]??0x80,'expansionSearch':_0x2e053c['expansionSearch']??0x40,'snapshotEveryChanges':_0x2e053c[_0x5db65d(0x2a2)]??0xc350,'snapshotMaxLagMs':_0x2e053c[_0x5db65d(0x219)]??0x2710,'keepSnapshots':_0x2e053c[_0x5db65d(0x229)]??0x2,'tmpMaxAgeMs':_0x2e053c[_0x5db65d(0x288)]??0x6*0x36ee80,'heartbeatIntervalMs':_0x2e053c['heartbeatIntervalMs']??0x1388,'writerLockMaxAgeMs':_0x2e053c['writerLockMaxAgeMs']??0x3a98,'viewRefreshMs':_0x2e053c['viewRefreshMs']??0x3e8},_0x5e4936=new _0x218df2({'dir':_0x98f1ee,'keepSnapshots':_0x540ae0['keepSnapshots']}),_0x35fd2a=_0x5ed3e1(_0x98f1ee,{'maxAgeMs':_0x540ae0[_0x5db65d(0x214)],'heartbeatMs':_0x540ae0[_0x5db65d(0x26f)],'onLost':()=>{const _0x3aacbc=_0x5db65d;_0x230451(_0x13dc07)[_0x3aacbc(0x260)](()=>{});}});let _0x20d05c=new _0x32f9d5(),_0x34c785=null,_0xbf36eb=0x0,_0x2e3056=null,_0x2a9c7f=![],_0xfcee39=![],_0x529504=null,_0x2f5881=0x0,_0x51ae7c=null,_0x30b9d1=0x0,_0x525ea5=![],_0x305720=Promise[_0x5db65d(0x29c)]();const _0x230451=_0x4cbe0d=>{const _0x1a7c6b=_0x5db65d,_0x52e17d=_0x305720[_0x1a7c6b(0x1e7)](_0x4cbe0d);return _0x305720=_0x52e17d[_0x1a7c6b(0x260)](()=>{}),_0x52e17d;},_0x794152=()=>{try{onChange?.();}catch{}};function _0x15b766(){const _0xf73a94=_0x5db65d;return new _0x39e59f[(_0xf73a94(0x216))]({'dimensions':_0x3a6dc1,'metric':_0x17ca5a(_0x540ae0[_0xf73a94(0x205)],_0x39e59f),'quantization':_0x39e59f[_0xf73a94(0x2b5)][_0xf73a94(0x21d)],'connectivity':_0x540ae0[_0xf73a94(0x275)],'expansion_add':_0x540ae0[_0xf73a94(0x299)],'expansion_search':_0x540ae0[_0xf73a94(0x225)],'multi':![]});}function _0x5e4767(_0x575a53){return _0x575a53 instanceof Float32Array?_0x575a53:new Float32Array(_0x575a53);}function _0x258b26(){const _0x399fcb=_0x5db65d;if(fetchAll)return fetchAll();if(_0x2e3056)return _0x2e3056();return Promise[_0x399fcb(0x29c)](null);}function _0x349ed9(_0x58fc92,_0x5dba45,_0x400494){const _0xc59a0b=_0x5db65d,_0x1de454=_0x20d05c[_0xc59a0b(0x22a)](_0x58fc92);if(_0x1de454!==undefined)try{_0x34c785['remove'](BigInt(_0x1de454));}catch{}const _0x5ec3be=_0x20d05c[_0xc59a0b(0x1f7)](_0x58fc92);_0x34c785['add'](BigInt(_0x5ec3be),_0x5dba45),_0x20d05c[_0xc59a0b(0x2b0)](_0x58fc92,_0x400494??_0x266e98(_0x5dba45));}function _0x5da14f(_0x219fc2){const _0x1c0ddf=_0x5db65d,_0x517c51=_0x20d05c[_0x1c0ddf(0x22a)](_0x219fc2);if(_0x517c51===undefined)return![];try{_0x34c785['remove'](BigInt(_0x517c51));}catch{}return _0x20d05c[_0x1c0ddf(0x202)](_0x219fc2),!![];}function _0x2f5bf1(_0x48cf49){const _0x126689=_0x5db65d;_0x20d05c=new _0x32f9d5(),_0x34c785=_0x15b766();for(const {key:_0x12852d,vector:_0x1c1a44}of _0x48cf49??[]){if(!(_0x1c1a44 instanceof Float32Array)||_0x1c1a44[_0x126689(0x295)]!==_0x3a6dc1)continue;_0x349ed9(_0x12852d,_0x1c1a44);}_0xbf36eb=0x0;}function _0x477824(){const _0xe2a356=_0x5db65d;return Math[_0xe2a356(0x251)](Date[_0xe2a356(0x20b)](),_0x5e4936[_0xe2a356(0x1fa)]()+0x1);}function _0x3e1b9b(){if(_0x529504)clearTimeout(_0x529504);_0x529504=null;}function _0x2ec900(){const _0x5e18ee=_0x5db65d;if(!_0x540ae0[_0x5e18ee(0x219)]||_0x529504||!_0xfcee39||_0xbf36eb<=0x0)return;const _0x380258=Math[_0x5e18ee(0x251)](_0x540ae0[_0x5e18ee(0x219)],0xa*_0x2f5881);_0x529504=setTimeout(()=>{const _0x45826e=_0x5e18ee;_0x529504=null,_0x230451(async()=>{if(_0xfcee39&&_0xbf36eb>0x0)await _0x384486();_0x2ec900(),_0x794152();})[_0x45826e(0x260)](()=>{});},_0x380258),_0x529504['unref']?.();}async function _0x384486(_0x48bd16){const _0x14127b=_0x5db65d;if(!_0x34c785)return![];const _0x5d1a8c=_0x48bd16??_0x477824(),_0x382589=Date[_0x14127b(0x20b)](),_0x1bd733=await _0x5e4936[_0x14127b(0x272)](_0x5d1a8c,async _0x41334c=>{const _0x58381b=_0x14127b;_0x34c785[_0x58381b(0x2a0)](_0x41334c['index']),await _0x20d05c[_0x58381b(0x282)](_0x41334c['labels']),_0x3374ff[_0x58381b(0x21b)](_0x41334c[_0x58381b(0x221)],JSON[_0x58381b(0x24d)]({'manifestVersion':_0xe956c9,'algorithm':_0x58381b(0x220),'dims':_0x3a6dc1,'metric':_0x540ae0[_0x58381b(0x205)],'clock':_0x5d1a8c,'snapshotAt':Date[_0x58381b(0x20b)]()},null,0x2));},{'keep':_0x540ae0[_0x14127b(0x229)]});return _0x2f5881=Date[_0x14127b(0x20b)]()-_0x382589,_0x1bd733?.[_0x14127b(0x2a3)]&&(_0xbf36eb=0x0,_0x3e1b9b()),_0x1bd733?.['published']??![];}function _0x1dcac8(){const _0x1eb0f9=_0x5db65d;_0xbf36eb++;if(_0xbf36eb>=_0x540ae0[_0x1eb0f9(0x2a2)])return _0x384486();return _0x2ec900(),null;}async function _0x279073(){const _0x53da4a=_0x5db65d,_0x23dcd7=_0x5e4936[_0x53da4a(0x2ad)]()||_0x5e4936[_0x53da4a(0x2a9)]();if(!_0x23dcd7)return null;let _0x1e7e76,_0x553e46=![];try{await _0x5e4936[_0x53da4a(0x27c)](_0x23dcd7,async _0x561183=>{const _0x3c923b=_0x53da4a;_0x1e7e76=JSON[_0x3c923b(0x217)](_0x3374ff[_0x3c923b(0x1e2)](_0x561183[_0x3c923b(0x221)],_0x3c923b(0x21e)));if(_0x1e7e76[_0x3c923b(0x1f4)]!==_0xe956c9||_0x1e7e76['algorithm']!=='usearch'||_0x1e7e76[_0x3c923b(0x26d)]!==_0x3a6dc1||_0x1e7e76[_0x3c923b(0x205)]!==_0x540ae0[_0x3c923b(0x205)]){_0x1e7e76=null;return;}const _0x50b230=new _0x32f9d5();await _0x50b230[_0x3c923b(0x218)](_0x561183[_0x3c923b(0x27e)]);const _0x214991=_0x15b766();_0x214991['load'](_0x561183[_0x3c923b(0x254)]),_0x20d05c=_0x50b230,_0x34c785=_0x214991,_0x553e46=!![];});}catch{return null;}return _0x553e46?_0x1e7e76?.[_0x53da4a(0x297)]??0x0:null;}async function _0x28f28e(_0x365c6b){const _0x487d4a=_0x5db65d;_0x51ae7c=null;const _0x356345=await _0x279073();if(_0x356345!=null){_0xbf36eb=0x0;if(_0x365c6b){if(!_0x20d05c[_0x487d4a(0x223)])return _0x2f5bf1(_0x365c6b),await _0x384486(),null;const _0x596ab3=_0x1ba238(_0x20d05c,_0x365c6b,_0x3a6dc1,{'upsert':_0x349ed9,'remove':_0x5da14f}),_0x123c95=_0x596ab3['added']+_0x596ab3[_0x487d4a(0x1dc)]+_0x596ab3[_0x487d4a(0x24f)];_0x123c95>0x0&&(_0xbf36eb+=_0x123c95,await _0x384486());}return _0x356345;}_0x2f5bf1(_0x365c6b??[]);if(_0x34c785[_0x487d4a(0x25e)]()>0x0)await _0x384486();return null;}async function _0x70d99a(){_0xfcee39=!![],await _0x28f28e(await _0x258b26());}async function _0x13dc07(){const _0x2fb72a=_0x5db65d;if(!_0xfcee39)return;_0xfcee39=![],_0x3e1b9b(),_0xbf36eb=0x0;const _0x50b6bf=_0x5e4936[_0x2fb72a(0x2ad)]()||_0x5e4936[_0x2fb72a(0x2a9)]();await _0xd64041(_0x50b6bf),_0x794152();}async function _0xd64041(_0x206c9a){const _0x36dad6=_0x5db65d;if(!_0x206c9a)return![];let _0x1aa3c2=![];try{await _0x5e4936[_0x36dad6(0x27c)](_0x206c9a,async _0x5dd8ab=>{const _0x372c4f=_0x36dad6,_0x3c0168=JSON[_0x372c4f(0x217)](_0x3374ff['readFileSync'](_0x5dd8ab[_0x372c4f(0x221)],'utf8'));if(_0x3c0168[_0x372c4f(0x1f4)]!==_0xe956c9||_0x3c0168['algorithm']!=='usearch'||_0x3c0168['dims']!==_0x3a6dc1||_0x3c0168[_0x372c4f(0x205)]!==_0x540ae0['metric'])return;const _0x190185=new _0x32f9d5();await _0x190185['loadFrom'](_0x5dd8ab[_0x372c4f(0x27e)]);const _0xc822f=_0x15b766();_0xc822f['view'](_0x5dd8ab['index']),_0x34c785=_0xc822f,_0x20d05c=_0x190185,_0x51ae7c=_0x206c9a,_0x1aa3c2=!![];});}catch{}return _0x1aa3c2;}function _0x5aedb2(){const _0x79dc06=_0x5db65d,_0x275ced=Date[_0x79dc06(0x20b)]();if(_0x275ced-_0x30b9d1<_0x540ae0[_0x79dc06(0x25d)])return;_0x30b9d1=_0x275ced;if(_0x525ea5)return;if(_0x35fd2a[_0x79dc06(0x1dd)]()){_0x525ea5=!![],_0x230451(async()=>{!_0xfcee39&&_0x2a9c7f&&_0x35fd2a['acquire']()&&(await _0x70d99a(),_0x794152());})[_0x79dc06(0x260)](()=>{})[_0x79dc06(0x29a)](()=>{_0x525ea5=![];});return;}const _0x3c286c=_0x5e4936[_0x79dc06(0x2ad)]()||_0x5e4936[_0x79dc06(0x2a9)]();if(!_0x3c286c||_0x3c286c===_0x51ae7c)return;_0x525ea5=!![],_0x230451(async()=>{if(!_0xfcee39&&await _0xd64041(_0x3c286c))_0x794152();})[_0x79dc06(0x260)](()=>{})[_0x79dc06(0x29a)](()=>{_0x525ea5=![];});}return{async 'load'(_0x36da0a){return _0x230451(async()=>{const _0x38575=_0x50b8;_0x5e4936['cleanupTmpDirs']({'maxAgeMs':_0x540ae0[_0x38575(0x288)]}),_0x2e3056=_0x36da0a??null,_0xfcee39=_0x35fd2a[_0x38575(0x26c)]();let _0x433127=null;if(_0xfcee39)_0x433127=await _0x28f28e(_0x36da0a?await _0x36da0a():null);else{const _0x25ef16=_0x5e4936[_0x38575(0x2ad)]()||_0x5e4936[_0x38575(0x2a9)]();await _0xd64041(_0x25ef16);}return _0x2a9c7f=!![],_0x433127;});},async 'add'(_0x2c611f,_0x1ebacc,_0x15eb7a){return _0x230451(async()=>{const _0x5b4ae9=_0x50b8;if(!_0x2a9c7f)return;const _0x29de08=_0x5e4767(_0x1ebacc);if(!_0xfcee39){if(!_0x35fd2a['acquire']())return;await _0x70d99a();}if(!_0x34c785)return;const _0x387283=_0x266e98(_0x29de08);if(_0x20d05c[_0x5b4ae9(0x215)](_0x2c611f)===_0x387283)return;_0x349ed9(_0x2c611f,_0x29de08,_0x387283),await _0x1dcac8();});},async 'remove'(_0x584824){return _0x230451(async()=>{const _0x4896be=_0x50b8;if(!_0x2a9c7f)return;if(!_0xfcee39){if(!_0x35fd2a[_0x4896be(0x26c)]())return;await _0x70d99a();}if(!_0x34c785)return;if(_0x5da14f(_0x584824))await _0x1dcac8();});},'search'(_0x38c315,{limit:limit=0xa}={}){const _0x59893e=_0x5db65d;if(!_0xfcee39&&_0x2a9c7f)_0x5aedb2();if(!_0x34c785)return[];const _0x1f52fc=_0x34c785['size']();if(_0x1f52fc===0x0)return[];const _0x411bb0=Math['min'](limit,_0x1f52fc),_0x57c396=_0x34c785[_0x59893e(0x22e)](_0x5e4767(_0x38c315),_0x411bb0,0x0),_0x9c1ab8=[],_0x14e148=_0x57c396[_0x59893e(0x23b)],_0xe61382=_0x57c396[_0x59893e(0x231)];for(let _0x1b7135=0x0;_0x1b7135<_0x14e148['length'];_0x1b7135++){const _0x3da41f=_0x14e148[_0x1b7135];if(_0x3da41f===0xffffffffffffffffn)continue;const _0x59f833=Number(_0x3da41f),_0x36aa6f=_0x20d05c[_0x59893e(0x1f5)](_0x59f833);if(!_0x36aa6f)continue;const _0x48909c=_0xe61382[_0x1b7135];let _0x489390;if(_0x540ae0[_0x59893e(0x205)]===_0x59893e(0x277))_0x489390=Math[_0x59893e(0x251)](0x0,0x1-_0x48909c);else{if(_0x540ae0[_0x59893e(0x205)]==='ip')_0x489390=-_0x48909c;else _0x489390=0x1/(0x1+_0x48909c);}_0x9c1ab8['push']({'key':_0x36aa6f,'score':_0x489390});}return _0x9c1ab8;},async 'snapshot'(_0x404407){return _0x230451(()=>_0xfcee39?_0x384486(_0x404407??undefined):![]);},async 'rebuild'(_0x53e364){return _0x230451(async()=>{const _0x3c8253=_0x50b8;if(_0x53e364!=null)_0x2e3056=_0x53e364;if(!_0xfcee39){if(!_0x35fd2a[_0x3c8253(0x26c)]())return;_0xfcee39=!![];}const _0x3ee31d=_0x53e364?await _0x53e364():await _0x258b26();_0x2f5bf1(_0x3ee31d??[]),_0x2a9c7f=!![],await _0x384486();});},async 'stop'(){return _0x230451(async()=>{const _0x288d26=_0x50b8;_0x3e1b9b();if(_0xfcee39){if(_0xbf36eb>0x0||!_0x5e4936['readCurrentId']())await _0x384486();_0x35fd2a[_0x288d26(0x238)]();}_0xfcee39=![],_0x2a9c7f=![];});},'count'(){const _0x509572=_0x5db65d;return _0x20d05c[_0x509572(0x25e)]();},'info'(){const _0x112a60=_0x5db65d;return{'algorithm':_0x112a60(0x220),'role':_0xfcee39?_0x112a60(0x271):_0x112a60(0x230),'metric':_0x540ae0[_0x112a60(0x205)],'connectivity':_0x540ae0['connectivity'],'expansionAdd':_0x540ae0[_0x112a60(0x299)],'expansionSearch':_0x540ae0['expansionSearch'],'snapshotEveryChanges':_0x540ae0[_0x112a60(0x2a2)],'snapshotMaxLagMs':_0x540ae0[_0x112a60(0x219)],'count':_0x20d05c[_0x112a60(0x25e)](),'size':_0x34c785?.[_0x112a60(0x25e)]?.()??0x0,'capacity':_0x34c785?.[_0x112a60(0x207)]?.()??0x0,'changesSince':_0xfcee39?_0xbf36eb:null,'viewedSnapshot':_0x51ae7c??null,'snapshotDir':_0x98f1ee,'latestSnapshot':_0x5e4936[_0x112a60(0x2ad)]()??null};}};},usearch;}var hasRequiredAlgorithmWorkerThread;function requireAlgorithmWorkerThread(){const _0x20025b=_0x591ed2;if(hasRequiredAlgorithmWorkerThread)return algorithmWorkerThread$1;hasRequiredAlgorithmWorkerThread=0x1;const {parentPort:_0x3069b3,workerData:_0x4a649a}=require$$0$1,{algorithmName:_0x3cbdb1,algorithmConfig:_0x275e15,dims:_0x43d43e,dir:_0x4a60a1}=_0x4a649a;let _0x148ab0=0x1;const _0x2b3dc8=new Map();function _0x1d325c(){const _0x368f81=_0x148ab0++;return new Promise((_0xca5c49,_0x1fd646)=>{const _0x38f228=_0x50b8;_0x2b3dc8[_0x38f228(0x24c)](_0x368f81,{'resolve':_0xca5c49,'reject':_0x1fd646}),_0x3069b3['postMessage']({'op':_0x38f228(0x21a),'fid':_0x368f81});});}const _0x1583a7={'dims':_0x43d43e,'dir':_0x4a60a1,'fetchAll':_0x1d325c,'onChange':()=>_0x4a7d3e()};let _0x4519ab;if(_0x3cbdb1===_0x20025b(0x246))_0x4519ab=requireHnsw()(_0x275e15,_0x1583a7);else{if(_0x3cbdb1===_0x20025b(0x267))_0x4519ab=requireFlat()(_0x275e15,_0x1583a7);else{if(_0x3cbdb1===_0x20025b(0x220))_0x4519ab=requireUsearch()(_0x275e15,_0x1583a7);else throw new Error('Unknown\x20algorithm:\x20\x22'+_0x3cbdb1+'\x22');}}function _0x4a7d3e(){const _0x48bad7=_0x20025b;try{_0x3069b3['postMessage']({'op':_0x48bad7(0x234),'count':_0x4519ab[_0x48bad7(0x1fd)](),'info':_0x4519ab[_0x48bad7(0x212)](),'memory':process[_0x48bad7(0x1e9)]()});}catch{}}function _0x6abc85(_0x1cf28f){const _0x181738=_0x20025b;return(_0x1cf28f||[])['map'](_0x57f732=>({'key':_0x57f732[_0x181738(0x211)],'vector':_0x57f732['vector']instanceof Float32Array?_0x57f732['vector']:new Float32Array(_0x57f732[_0x181738(0x209)])}));}return _0x3069b3['on'](_0x20025b(0x210),async _0x2fb4db=>{const _0x57db9c=_0x20025b;if(_0x2fb4db['op']===_0x57db9c(0x292)){const _0x4fb94b=_0x2b3dc8[_0x57db9c(0x245)](_0x2fb4db[_0x57db9c(0x1f1)]);if(!_0x4fb94b)return;_0x2b3dc8[_0x57db9c(0x1ea)](_0x2fb4db[_0x57db9c(0x1f1)]);if(_0x2fb4db[_0x57db9c(0x2aa)])_0x4fb94b[_0x57db9c(0x1de)](new Error(_0x2fb4db[_0x57db9c(0x2aa)]));else _0x4fb94b['resolve'](_0x6abc85(_0x2fb4db[_0x57db9c(0x24b)]));return;}const {id:_0x27d5ec,op:_0x53e2bd,args:_0x551960}=_0x2fb4db;try{let _0x47c907;switch(_0x53e2bd){case _0x57db9c(0x24a):{_0x47c907=await _0x4519ab[_0x57db9c(0x24a)](_0x551960[_0x57db9c(0x287)]?_0x1d325c:null),_0x4a7d3e();break;}case _0x57db9c(0x281):{const _0x5e1123=_0x551960[_0x57db9c(0x209)]instanceof Float32Array?_0x551960[_0x57db9c(0x209)]:new Float32Array(_0x551960[_0x57db9c(0x209)]);await _0x4519ab[_0x57db9c(0x281)](_0x551960[_0x57db9c(0x211)],_0x5e1123,_0x551960['clock']??undefined),_0x4a7d3e(),_0x47c907=null;break;}case'remove':{await _0x4519ab[_0x57db9c(0x27b)](_0x551960[_0x57db9c(0x211)]),_0x4a7d3e(),_0x47c907=null;break;}case'search':{const _0xb6fc90=_0x551960[_0x57db9c(0x276)]instanceof Float32Array?_0x551960[_0x57db9c(0x276)]:new Float32Array(_0x551960['queryVec']);_0x47c907=_0x4519ab[_0x57db9c(0x22e)](_0xb6fc90,_0x551960['opts']||{});break;}case _0x57db9c(0x273):{_0x47c907=await _0x4519ab[_0x57db9c(0x273)](_0x551960[_0x57db9c(0x297)]),_0x4a7d3e();break;}case _0x57db9c(0x1f2):{const _0xd9692f=_0x6abc85(_0x551960[_0x57db9c(0x24b)]);await _0x4519ab[_0x57db9c(0x1f2)](async()=>_0xd9692f),_0x4a7d3e(),_0x47c907=null;break;}case _0x57db9c(0x20d):{await _0x4519ab['stop'](),_0x4a7d3e(),_0x47c907=null;break;}case _0x57db9c(0x1fd):{_0x47c907=_0x4519ab[_0x57db9c(0x1fd)]();break;}case _0x57db9c(0x212):{_0x47c907=_0x4519ab[_0x57db9c(0x212)]();break;}default:throw new Error('Unknown\x20op:\x20\x22'+_0x53e2bd+'\x22');}_0x3069b3[_0x57db9c(0x20f)]({'id':_0x27d5ec,'result':_0x47c907});}catch(_0x1a9e64){_0x3069b3['postMessage']({'id':_0x27d5ec,'error':{'message':_0x1a9e64?.[_0x57db9c(0x210)]||String(_0x1a9e64),'code':_0x1a9e64?.['code']}});}}),_0x3069b3[_0x20025b(0x20f)]({'op':_0x20025b(0x290)}),algorithmWorkerThread$1;}function _0x50b8(_0x4252fb,_0x45b4cf){_0x4252fb=_0x4252fb-0x1db;const _0x414d6c=_0x414d();let _0x50b861=_0x414d6c[_0x4252fb];return _0x50b861;}var algorithmWorkerThreadExports=requireAlgorithmWorkerThread(),algorithmWorkerThread=getDefaultExportFromCjs(algorithmWorkerThreadExports);module[_0x591ed2(0x20a)]=algorithmWorkerThread;
|
|
1
|
+
'use strict';const _0x411a8a=_0x3360;(function(_0x5d24de,_0x2e375b){const _0x43bc65=_0x3360,_0x51d1cc=_0x5d24de();while(!![]){try{const _0x505d6d=-parseInt(_0x43bc65(0x15b))/0x1+parseInt(_0x43bc65(0x1e1))/0x2+-parseInt(_0x43bc65(0x1c9))/0x3*(parseInt(_0x43bc65(0x174))/0x4)+-parseInt(_0x43bc65(0x18d))/0x5+-parseInt(_0x43bc65(0x14c))/0x6*(parseInt(_0x43bc65(0x204))/0x7)+parseInt(_0x43bc65(0x179))/0x8*(-parseInt(_0x43bc65(0x210))/0x9)+-parseInt(_0x43bc65(0x19f))/0xa*(-parseInt(_0x43bc65(0x1f2))/0xb);if(_0x505d6d===_0x2e375b)break;else _0x51d1cc['push'](_0x51d1cc['shift']());}catch(_0x148a38){_0x51d1cc['push'](_0x51d1cc['shift']());}}}(_0xf898,0x3f4c9));var require$$0$1=require(_0x411a8a(0x206)),require$$0=require('fs'),require$$1=require(_0x411a8a(0x13a)),require$$2=require('os'),require$$3=require('crypto');function getDefaultExportFromCjs(_0xb9f058){const _0x26fe23=_0x411a8a;return _0xb9f058&&_0xb9f058['__esModule']&&Object[_0x26fe23(0x155)][_0x26fe23(0x140)]['call'](_0xb9f058,_0x26fe23(0x144))?_0xb9f058['default']:_0xb9f058;}var algorithmWorkerThread$1={},snapshotStore,hasRequiredSnapshotStore;function requireSnapshotStore(){const _0x3f9bb8=_0x411a8a;if(hasRequiredSnapshotStore)return snapshotStore;hasRequiredSnapshotStore=0x1;const _0x4c53a2=require$$0,_0x4be99c=require$$1,_0x47663e=require$$2,_0x5b3eef=require$$3;function _0x314cff(){const _0x3a921a=_0x3360;return Date[_0x3a921a(0x1d3)]();}function _0x1c7671(_0x5dd966){const _0x1406fd=_0x3360;try{return _0x4c53a2[_0x1406fd(0x16f)](_0x5dd966);}catch{return![];}}function _0x227608(_0xaff088){const _0x5b4627=_0x3360;try{return _0x4c53a2['readFileSync'](_0xaff088,_0x5b4627(0x1d1));}catch{return null;}}function _0x2b7fea(_0x7ee79a,_0x433d43){const _0x3d1615=_0x3360,_0x4d408b=_0x7ee79a+_0x3d1615(0x167)+_0x5b3eef[_0x3d1615(0x156)](0x6)[_0x3d1615(0x177)]('hex');_0x4c53a2['writeFileSync'](_0x4d408b,_0x433d43),_0x4c53a2['renameSync'](_0x4d408b,_0x7ee79a);}function _0x23a340(_0x58b888,_0x311861=0x10){const _0xdb6f3f=_0x3360,_0x54deaf=String(Math[_0xdb6f3f(0x1fd)](0x0,Math[_0xdb6f3f(0x190)](_0x58b888||0x0)));return _0x54deaf[_0xdb6f3f(0x13e)]>=_0x311861?_0x54deaf:'0'[_0xdb6f3f(0x1c5)](_0x311861-_0x54deaf[_0xdb6f3f(0x13e)])+_0x54deaf;}return snapshotStore=class _0x98bed1{constructor({dir:_0x25d246,keepSnapshots:keepSnapshots=0x3,log:log=null}={}){const _0x56c459=_0x3360;if(!_0x25d246)throw new Error(_0x56c459(0x152));this[_0x56c459(0x1b2)]=_0x25d246,this[_0x56c459(0x1b6)]=_0x4be99c['join'](_0x25d246,_0x56c459(0x203)),this['currentPath']=_0x4be99c[_0x56c459(0x1fc)](_0x25d246,'CURRENT'),this[_0x56c459(0x176)]=_0x4be99c['join'](_0x25d246,'SNAPSHOT.LOCK'),this[_0x56c459(0x1b1)]=keepSnapshots,this['log']=log,_0x4c53a2['mkdirSync'](this['dir'],{'recursive':!![]}),_0x4c53a2['mkdirSync'](this[_0x56c459(0x1b6)],{'recursive':!![]});}[_0x3f9bb8(0x146)](_0x3c7e59){const _0x3bf1d5=_0x3f9bb8;return _0x4be99c[_0x3bf1d5(0x1fc)](this[_0x3bf1d5(0x1b6)],_0x3c7e59);}[_0x3f9bb8(0x185)](_0x2ec8a0){const _0x44f4f7=_0x3f9bb8,_0x225a9f=this[_0x44f4f7(0x146)](_0x2ec8a0);return{'dir':_0x225a9f,'index':_0x4be99c[_0x44f4f7(0x1fc)](_0x225a9f,_0x44f4f7(0x19c)),'labels':_0x4be99c[_0x44f4f7(0x1fc)](_0x225a9f,_0x44f4f7(0x18f)),'state':_0x4be99c[_0x44f4f7(0x1fc)](_0x225a9f,_0x44f4f7(0x195))};}[_0x3f9bb8(0x169)](){const _0x11ffd1=_0x3f9bb8;if(!_0x1c7671(this['currentPath']))return null;const _0x2dce65=_0x227608(this['currentPath']);if(!_0x2dce65)return null;const _0x34a23a=String(_0x2dce65)[_0x11ffd1(0x172)]();return _0x34a23a||null;}[_0x3f9bb8(0x1f7)](){const _0x2be7df=_0x3f9bb8,_0x401c68=this[_0x2be7df(0x169)]();if(!_0x401c68)return 0x0;const _0x324b01=Number(_0x401c68);return Number[_0x2be7df(0x137)](_0x324b01)?_0x324b01:0x0;}[_0x3f9bb8(0x1f0)](){const _0x26b299=_0x3f9bb8;try{return _0x4c53a2['readdirSync'](this['snapshotsDir'],{'withFileTypes':!![]})[_0x26b299(0x1bd)](_0x352391=>_0x352391[_0x26b299(0x1b7)]())['map'](_0xc97598=>_0xc97598[_0x26b299(0x187)])[_0x26b299(0x1bd)](_0x6b8892=>!_0x6b8892[_0x26b299(0x20d)](_0x26b299(0x167)))[_0x26b299(0x1bd)](_0x4958b5=>!_0x4958b5[_0x26b299(0x20d)]('_tmp-'))[_0x26b299(0x1e8)]();}catch{return[];}}['latestSnapshotId'](){const _0x2b45d6=_0x3f9bb8,_0x68c4c1=this[_0x2b45d6(0x169)]();if(_0x68c4c1)return _0x68c4c1;const _0x28ea46=this['listSnapshotIds']();if(!_0x28ea46[_0x2b45d6(0x13e)])return null;return _0x28ea46[_0x28ea46[_0x2b45d6(0x13e)]-0x1];}[_0x3f9bb8(0x18a)]({maxAgeMs:maxAgeMs=0x6*0x36ee80}={}){const _0x26d7e2=_0x3f9bb8;let _0x5b952b;try{_0x5b952b=_0x4c53a2[_0x26d7e2(0x178)](this['snapshotsDir'],{'withFileTypes':!![]});}catch{return;}const _0x5dcf2b=_0x314cff()-maxAgeMs;for(const _0x20107d of _0x5b952b){if(!_0x20107d[_0x26d7e2(0x1b7)]())continue;const _0x15f42e=_0x20107d['name'];if(!_0x15f42e[_0x26d7e2(0x20d)](_0x26d7e2(0x167))&&!_0x15f42e['startsWith']('_tmp-'))continue;const _0xec5ba0=_0x4be99c['join'](this[_0x26d7e2(0x1b6)],_0x15f42e);try{const _0xee369e=_0x4c53a2[_0x26d7e2(0x1d6)](_0xec5ba0);if(_0xee369e[_0x26d7e2(0x188)]>_0x5dcf2b)continue;}catch{}try{_0x4c53a2[_0x26d7e2(0x19a)](_0xec5ba0,{'recursive':!![],'force':!![]});}catch{}}}[_0x3f9bb8(0x19e)]({keep:keep=null}={}){const _0xca7d=_0x3f9bb8,_0x38c5bd=Math[_0xca7d(0x1fd)](0x1,Math[_0xca7d(0x190)](keep??this[_0xca7d(0x1b1)]??0x3)),_0xb78c83=this[_0xca7d(0x1f0)]();if(_0xb78c83[_0xca7d(0x13e)]<=_0x38c5bd)return;const _0x497e83=this[_0xca7d(0x169)](),_0x5dc50e=_0xb78c83['slice'](0x0,Math[_0xca7d(0x1fd)](0x0,_0xb78c83[_0xca7d(0x13e)]-_0x38c5bd));for(const _0x5d284f of _0x5dc50e){if(_0x497e83&&_0x5d284f===_0x497e83)continue;const _0x459e89=this[_0xca7d(0x146)](_0x5d284f);try{_0x4c53a2[_0xca7d(0x19a)](_0x459e89,{'recursive':!![],'force':!![]});}catch{}}}async[_0x3f9bb8(0x196)](_0x4b42d7,_0x1a75b1){const _0x281b5a=_0x3f9bb8;if(!_0x4b42d7)throw new Error('snapshot\x20id\x20required');const _0x2928c2=this[_0x281b5a(0x185)](_0x4b42d7);if(!_0x1c7671(_0x2928c2[_0x281b5a(0x20f)])||!_0x1c7671(_0x2928c2[_0x281b5a(0x1aa)])||!_0x1c7671(_0x2928c2['state']))throw new Error(_0x281b5a(0x139)+_0x4b42d7);const _0x5d10b5=await _0x1a75b1(_0x2928c2);return _0x5d10b5||{};}async[_0x3f9bb8(0x17b)](_0x50b311,_0x2f7e5e,{keep:keep=null,lockTimeoutMs:lockTimeoutMs=0x0,staleLockMaxAgeMs:staleLockMaxAgeMs=0xea60}={}){const _0xf8598f=_0x3f9bb8,_0x3cfa61=Number(_0x50b311);if(!Number['isFinite'](_0x3cfa61)||_0x3cfa61<0x0)throw new Error('candidateClock\x20must\x20be\x20finite\x20>=\x200');const _0x51bf80=_0x23a340(_0x3cfa61),_0xa056f=this[_0xf8598f(0x146)](_0x51bf80),_0x5db989=_0x4be99c[_0xf8598f(0x1fc)](this[_0xf8598f(0x1b6)],'.tmp-'+_0x51bf80+'-'+_0x5b3eef[_0xf8598f(0x156)](0x6)[_0xf8598f(0x177)](_0xf8598f(0x16e)));_0x4c53a2['mkdirSync'](_0x5db989,{'recursive':!![]});const _0x9f9f37={'dir':_0x5db989,'index':_0x4be99c[_0xf8598f(0x1fc)](_0x5db989,_0xf8598f(0x19c)),'labels':_0x4be99c[_0xf8598f(0x1fc)](_0x5db989,_0xf8598f(0x18f)),'state':_0x4be99c[_0xf8598f(0x1fc)](_0x5db989,_0xf8598f(0x195))};await _0x2f7e5e(_0x9f9f37,{'id':_0x51bf80,'clock':_0x3cfa61});const _0x5d3161=JSON[_0xf8598f(0x1c1)]({'pid':process[_0xf8598f(0x16d)],'host':_0x47663e[_0xf8598f(0x1e2)](),'at':_0x314cff()}),_0x37e36c=_0x314cff();let _0x43f168=null;const _0x393aa4=()=>{const _0x236cd9=_0xf8598f;try{const _0x4640ce=JSON[_0x236cd9(0x1a5)](_0x4c53a2[_0x236cd9(0x15a)](this[_0x236cd9(0x176)],_0x236cd9(0x1d1)));if(_0x4640ce['at']&&_0x314cff()-_0x4640ce['at']>staleLockMaxAgeMs){const _0x8603cd=_0x314cff()-_0x4640ce['at'],_0xa5adc2=_0x236cd9(0x1ca)+Math[_0x236cd9(0x1df)](_0x8603cd/0x3e8)+'s,\x20pid:\x20'+_0x4640ce[_0x236cd9(0x16d)]+',\x20host:\x20'+_0x4640ce[_0x236cd9(0x1b9)]+_0x236cd9(0x183)+_0x236cd9(0x197);this[_0x236cd9(0x200)]?.['warn']?this[_0x236cd9(0x200)][_0x236cd9(0x15c)](_0xa5adc2):console[_0x236cd9(0x15c)](_0x236cd9(0x1f1),_0xa5adc2);try{_0x4c53a2[_0x236cd9(0x211)](this[_0x236cd9(0x176)]);}catch{}return!![];}}catch{try{_0x4c53a2[_0x236cd9(0x211)](this['lockPath']);}catch{}}return![];},_0x5a7777=()=>{const _0x3bae38=_0xf8598f;try{return _0x43f168=_0x4c53a2[_0x3bae38(0x205)](this[_0x3bae38(0x176)],'wx'),_0x4c53a2[_0x3bae38(0x1a2)](_0x43f168,_0x5d3161),!![];}catch(_0xa4407b){if(_0xa4407b&&_0xa4407b[_0x3bae38(0x1a8)]===_0x3bae38(0x173))return![];throw _0xa4407b;}};if(!_0x5a7777()){_0x393aa4(),_0x5a7777();if(_0x43f168==null&&lockTimeoutMs>0x0)while(_0x314cff()-_0x37e36c<lockTimeoutMs){await new Promise(_0xd326bb=>setTimeout(_0xd326bb,0x19));if(_0x5a7777())break;_0x393aa4();}}if(_0x43f168==null){try{_0x4c53a2[_0xf8598f(0x19a)](_0x5db989,{'recursive':!![],'force':!![]});}catch{}return{'published':![],'reason':_0xf8598f(0x1a6)};}try{const _0x39d4e8=this['readCurrentClock']();if(_0x3cfa61<=_0x39d4e8){try{_0x4c53a2['rmSync'](_0x5db989,{'recursive':!![],'force':!![]});}catch{}return{'published':![],'reason':_0xf8598f(0x16b),'currentClock':_0x39d4e8};}if(!_0x1c7671(_0xa056f))_0x4c53a2['renameSync'](_0x5db989,_0xa056f);else try{_0x4c53a2[_0xf8598f(0x19a)](_0x5db989,{'recursive':!![],'force':!![]});}catch{}return _0x2b7fea(this[_0xf8598f(0x1a0)],_0x51bf80+'\x0a'),this[_0xf8598f(0x19e)]({'keep':keep}),{'published':!![],'currentClock':_0x3cfa61};}finally{try{_0x4c53a2[_0xf8598f(0x1c6)](_0x43f168);}catch{}try{_0x4c53a2['unlinkSync'](this[_0xf8598f(0x176)]);}catch{}}}},snapshotStore;}var labelMap,hasRequiredLabelMap;function requireLabelMap(){const _0x59ee78=_0x411a8a;if(hasRequiredLabelMap)return labelMap;hasRequiredLabelMap=0x1;const _0x457479=require$$0;class _0x566074{constructor(){const _0x2389ff=_0x3360;this[_0x2389ff(0x1d5)]=new Map(),this[_0x2389ff(0x1c2)]=new Map(),this[_0x2389ff(0x1ce)]=0x0,this[_0x2389ff(0x1ab)]=0x0,this[_0x2389ff(0x208)]=new Map(),this[_0x2389ff(0x1ed)]=!![];}async[_0x59ee78(0x158)](){const _0x1cbafd=_0x59ee78;this['keyToLabel']=new Map(),this['labelToKey']=new Map(),this[_0x1cbafd(0x208)]=new Map(),this[_0x1cbafd(0x1ed)]=!![],this[_0x1cbafd(0x1ce)]=0x0,this[_0x1cbafd(0x1ab)]=0x0;}async[_0x59ee78(0x1bc)](_0x53bca9){const _0x2dc9fd=_0x59ee78;if(!_0x53bca9||!_0x457479[_0x2dc9fd(0x16f)](_0x53bca9))return await this[_0x2dc9fd(0x158)](),!![];let _0x252971;try{_0x252971=_0x457479['readFileSync'](_0x53bca9,_0x2dc9fd(0x1d1));}catch{return await this['reset'](),!![];}let _0x28e232;try{_0x28e232=JSON[_0x2dc9fd(0x1a5)](_0x252971);}catch{return await this[_0x2dc9fd(0x158)](),!![];}const _0x596a25=Array[_0x2dc9fd(0x15e)](_0x28e232?.[_0x2dc9fd(0x1f8)])?_0x28e232[_0x2dc9fd(0x1f8)]:[],_0x4d37ae=Number[_0x2dc9fd(0x1cd)](_0x28e232?.[_0x2dc9fd(0x1ce)])?_0x28e232[_0x2dc9fd(0x1ce)]:0x0,_0x33ba0b=new Map(),_0x5cdb6c=new Map(),_0x1c67ec=new Map(),_0x2e692b=_0x28e232?.[_0x2dc9fd(0x1ff)]>=0x2;let _0x2fb4a1=-0x1;for(const _0x365f9c of _0x596a25){if(!Array['isArray'](_0x365f9c)||_0x365f9c[_0x2dc9fd(0x13e)]<0x2)continue;const _0x3bab59=Number(_0x365f9c[0x0]),_0x35060b=String(_0x365f9c[0x1]??'');if(!Number[_0x2dc9fd(0x1cd)](_0x3bab59)||_0x3bab59<0x0)continue;if(!_0x35060b)continue;_0x33ba0b[_0x2dc9fd(0x192)](_0x35060b,_0x3bab59),_0x5cdb6c[_0x2dc9fd(0x192)](_0x3bab59,_0x35060b);if(_0x2e692b&&typeof _0x365f9c[0x2]===_0x2dc9fd(0x1e5))_0x1c67ec['set'](_0x35060b,_0x365f9c[0x2]);if(_0x3bab59>_0x2fb4a1)_0x2fb4a1=_0x3bab59;}return this[_0x2dc9fd(0x1d5)]=_0x33ba0b,this[_0x2dc9fd(0x1c2)]=_0x5cdb6c,this[_0x2dc9fd(0x208)]=_0x1c67ec,this['hasFingerprints']=_0x2e692b,this[_0x2dc9fd(0x1ce)]=Math[_0x2dc9fd(0x1fd)](_0x4d37ae,_0x2fb4a1+0x1,0x0),this['_tombstoneCount']=0x0,!![];}[_0x59ee78(0x1e7)](_0x3a44d5){const _0x19f545=_0x59ee78;return this[_0x19f545(0x1d5)]['get'](_0x3a44d5);}[_0x59ee78(0x17a)](_0x495a32){const _0x321245=_0x59ee78;let _0x374793=this[_0x321245(0x1d5)][_0x321245(0x1de)](_0x495a32);if(_0x374793!==undefined)return _0x374793;return _0x374793=this[_0x321245(0x1ce)]++,this[_0x321245(0x1d5)][_0x321245(0x192)](_0x495a32,_0x374793),this[_0x321245(0x1c2)][_0x321245(0x192)](_0x374793,_0x495a32),_0x374793;}[_0x59ee78(0x141)](_0x521bd0,_0x43e25a){const _0x3dba14=_0x59ee78;if(_0x43e25a==null)this[_0x3dba14(0x208)][_0x3dba14(0x1fa)](_0x521bd0);else this[_0x3dba14(0x208)]['set'](_0x521bd0,_0x43e25a);}['fingerprintOf'](_0x17d5de){const _0x1e3c66=_0x59ee78;return this['keyToFp'][_0x1e3c66(0x1de)](_0x17d5de);}[_0x59ee78(0x1f6)](){const _0x2b8dfb=_0x59ee78;return this['keyToLabel'][_0x2b8dfb(0x1f6)]();}[_0x59ee78(0x19d)](_0x419344){const _0x521e03=_0x59ee78,_0x40390b=this['keyToLabel'][_0x521e03(0x1de)](_0x419344);if(_0x40390b===undefined)return;this[_0x521e03(0x208)][_0x521e03(0x1fa)](_0x419344),this['keyToLabel'][_0x521e03(0x1fa)](_0x419344),this[_0x521e03(0x1c2)][_0x521e03(0x1fa)](_0x40390b),this[_0x521e03(0x1ab)]++;}[_0x59ee78(0x15f)](_0x4e6d15){const _0xc14b9d=_0x59ee78;return this[_0xc14b9d(0x1c2)][_0xc14b9d(0x1de)](_0x4e6d15)??null;}[_0x59ee78(0x1d7)](){const _0x1fa7cf=_0x59ee78;return this[_0x1fa7cf(0x1d5)][_0x1fa7cf(0x1d7)];}[_0x59ee78(0x1ba)](){const _0x418319=_0x59ee78;return this[_0x418319(0x1ab)];}async[_0x59ee78(0x1d9)](_0xb8a06f){const _0x29e7bb=_0x59ee78,_0x1fcb26=_0xb8a06f+_0x29e7bb(0x14e),_0x26edd2=[];for(const [_0x4efbe0,_0x2368d4]of this['labelToKey'][_0x29e7bb(0x1f8)]()){const _0x2beef3=this[_0x29e7bb(0x208)][_0x29e7bb(0x1de)](_0x2368d4);_0x26edd2[_0x29e7bb(0x1db)](_0x2beef3==null?[_0x4efbe0,_0x2368d4]:[_0x4efbe0,_0x2368d4,_0x2beef3]);}_0x26edd2[_0x29e7bb(0x1e8)]((_0x32e39d,_0x3934a0)=>_0x32e39d[0x0]-_0x3934a0[0x0]);const _0xdab971={'version':0x2,'nextLabel':this[_0x29e7bb(0x1ce)],'entries':_0x26edd2};_0x457479['writeFileSync'](_0x1fcb26,JSON['stringify'](_0xdab971)),_0x457479['renameSync'](_0x1fcb26,_0xb8a06f);}}return labelMap=_0x566074,labelMap;}var indexConvergence,hasRequiredIndexConvergence;function requireIndexConvergence(){if(hasRequiredIndexConvergence)return indexConvergence;hasRequiredIndexConvergence=0x1;function _0x45875b(_0x19d9e5){const _0x4cdda8=_0x3360,_0x4bd3c3=new Uint32Array(_0x19d9e5[_0x4cdda8(0x160)],_0x19d9e5[_0x4cdda8(0x193)],_0x19d9e5[_0x4cdda8(0x13e)]);let _0xb16848=0x811c9dc5,_0x3b7b77=0x9747b28c;for(let _0x255208=0x0;_0x255208<_0x4bd3c3['length'];_0x255208++){const _0xf00792=_0x4bd3c3[_0x255208];_0xb16848=Math[_0x4cdda8(0x1c4)](_0xb16848^_0xf00792,0x1000193)>>>0x0;let _0x32a963=Math['imul'](_0xf00792,0xcc9e2d51);_0x32a963=_0x32a963<<0xf|_0x32a963>>>0x11,_0x3b7b77=Math[_0x4cdda8(0x1c4)](_0x3b7b77^Math[_0x4cdda8(0x1c4)](_0x32a963,0x1b873593),0x5)+0xe6546b64,_0x3b7b77>>>=0x0;}return _0x3b7b77=Math['imul'](_0x3b7b77^_0x3b7b77>>>0x10,0x85ebca6b)>>>0x0,(_0xb16848>>>0x0)*0x100000+(_0x3b7b77&0xfffff);}function _0x1cf236(_0x1ee843,_0x4d7168,_0x2c24c4,{upsert:_0x3866ca,remove:_0x80d818}){const _0x439a2e=_0x3360,_0x461013=new Set();let _0x1201e8=0x0,_0x33a711=0x0,_0x4b6d0f=0x0;for(const {key:_0x3a90fd,vector:_0x336ec7}of _0x4d7168){if(!(_0x336ec7 instanceof Float32Array)||_0x336ec7['length']!==_0x2c24c4)continue;_0x461013[_0x439a2e(0x166)](_0x3a90fd);const _0x5570b7=_0x45875b(_0x336ec7),_0xdcba40=_0x1ee843[_0x439a2e(0x1e7)](_0x3a90fd)!==undefined;if(_0xdcba40&&_0x1ee843[_0x439a2e(0x1d2)](_0x3a90fd)===_0x5570b7)continue;_0x3866ca(_0x3a90fd,_0x336ec7,_0x5570b7);if(_0xdcba40)_0x33a711++;else _0x1201e8++;}for(const _0x149a8d of[..._0x1ee843[_0x439a2e(0x1f6)]()]){if(_0x461013['has'](_0x149a8d))continue;_0x80d818(_0x149a8d),_0x4b6d0f++;}return{'added':_0x1201e8,'changed':_0x33a711,'removed':_0x4b6d0f};}return indexConvergence={'fingerprint':_0x45875b,'reconcileIndex':_0x1cf236},indexConvergence;}var hnsw,hasRequiredHnsw;function requireHnsw(){if(hasRequiredHnsw)return hnsw;hasRequiredHnsw=0x1;const _0x54f145=requireSnapshotStore(),_0x485af6=requireLabelMap(),{fingerprint:_0x2de35c,reconcileIndex:_0x5e77f0}=requireIndexConvergence(),_0x2d5043=0x1;let _0x35cf99=null;function _0x417f74(){const _0x4b9297=_0x3360;if(_0x35cf99)return _0x35cf99;try{return _0x35cf99=require(_0x4b9297(0x165)),_0x35cf99;}catch(_0x3984a8){const _0x4c8792=new Error(_0x4b9297(0x207)+('for\x20Node\x20'+process[_0x4b9297(0x154)][_0x4b9297(0x1ef)]+_0x4b9297(0x18b)+process[_0x4b9297(0x171)]+'/'+process[_0x4b9297(0x17f)]+'.\x20')+'Install\x20compatible\x20bindings\x20or\x20use\x20algorithm\x20\x22flat\x22\x20instead.\x20'+(_0x4b9297(0x209)+(_0x3984a8?.[_0x4b9297(0x194)]||String(_0x3984a8))));_0x4c8792[_0x4b9297(0x1a8)]=_0x4b9297(0x150),_0x4c8792['cause']=_0x3984a8;throw _0x4c8792;}}return hnsw=function _0x37105b(_0x504cb7={},{dims:_0x234f83,dir:_0x3d57de}){const _0x3e2d51=_0x3360,_0x15eb2f=_0x417f74();if(!_0x234f83||_0x234f83<=0x0)throw new Error(_0x3e2d51(0x191));if(!_0x3d57de)throw new Error(_0x3e2d51(0x16a));const _0x12439f={'metric':_0x504cb7[_0x3e2d51(0x1bb)]??_0x3e2d51(0x164),'M':_0x504cb7['M']??0x10,'efConstruction':_0x504cb7[_0x3e2d51(0x17c)]??0xc8,'efSearch':_0x504cb7[_0x3e2d51(0x189)]??0x40,'maxElements':_0x504cb7[_0x3e2d51(0x199)]??0x400,'growFactor':_0x504cb7[_0x3e2d51(0x1a7)]??0x2,'snapshotEveryChanges':_0x504cb7[_0x3e2d51(0x16c)]??0xc350,'keepSnapshots':_0x504cb7[_0x3e2d51(0x1b1)]??0x2,'tmpMaxAgeMs':_0x504cb7[_0x3e2d51(0x14b)]??0x6*0x36ee80},_0x5af97f=new _0x54f145({'dir':_0x3d57de,'keepSnapshots':_0x12439f[_0x3e2d51(0x1b1)]}),_0x4ae3f8=new _0x485af6();let _0x4d2f6f=null,_0x2aad23=0x0,_0x3f94fe=null,_0x3443fb=Promise[_0x3e2d51(0x15d)]();const _0x29d3ee=_0x4c3d30=>{const _0x1b7dac=_0x3e2d51,_0xca8759=_0x3443fb[_0x1b7dac(0x182)](_0x4c3d30);return _0x3443fb=_0xca8759[_0x1b7dac(0x1e3)](()=>{}),_0xca8759;};async function _0x4aa06a(_0x9c3c31){const _0x3a9bf0=_0x3e2d51;await _0x4ae3f8[_0x3a9bf0(0x158)](),_0x9c3c31=_0x9c3c31??[];const _0x2fbec9=Math[_0x3a9bf0(0x1fd)](_0x12439f[_0x3a9bf0(0x199)],Math[_0x3a9bf0(0x1b4)](_0x9c3c31[_0x3a9bf0(0x13e)]*(_0x12439f[_0x3a9bf0(0x1a7)]||1.2)),0x1);_0x4d2f6f=new _0x15eb2f[(_0x3a9bf0(0x20e))](_0x12439f[_0x3a9bf0(0x1bb)],_0x234f83),_0x4d2f6f[_0x3a9bf0(0x212)]({'maxElements':_0x2fbec9,'efConstruction':_0x12439f[_0x3a9bf0(0x17c)],'M':_0x12439f['M']});for(const {key:_0x614cd7,vector:_0x51b01c}of _0x9c3c31){if(!(_0x51b01c instanceof Float32Array)||_0x51b01c[_0x3a9bf0(0x13e)]!==_0x234f83)continue;_0x48794c(_0x614cd7,_0x51b01c);}_0x4d2f6f['setEf'](_0x12439f[_0x3a9bf0(0x189)]),_0x2aad23=0x0;}async function _0x3b1929(_0x5d2d03){return _0x4aa06a(_0x5d2d03?await _0x5d2d03():[]);}function _0x2fe010(){const _0x3fc628=_0x3e2d51;if(_0x4d2f6f[_0x3fc628(0x1a9)]()<_0x4d2f6f[_0x3fc628(0x201)]())return;const _0x2a1f2b=Math[_0x3fc628(0x1b4)](_0x4d2f6f[_0x3fc628(0x201)]()*(_0x12439f[_0x3fc628(0x1a7)]||0x2));_0x4d2f6f[_0x3fc628(0x175)](_0x2a1f2b),_0x12439f[_0x3fc628(0x199)]=_0x2a1f2b;}function _0x48794c(_0x46eea8,_0x2a2574,_0x45e167){const _0x2311d5=_0x3e2d51,_0x68ac10=_0x4ae3f8['labelForEphemeral'](_0x46eea8);try{_0x4d2f6f[_0x2311d5(0x1ac)](_0x68ac10);}catch{}_0x2fe010(),_0x4d2f6f[_0x2311d5(0x1ae)](Array[_0x2311d5(0x159)](_0x2a2574),_0x68ac10),_0x4ae3f8[_0x2311d5(0x141)](_0x46eea8,_0x45e167??_0x2de35c(_0x2a2574));}function _0x3632c3(_0x589f94){const _0x5b1cac=_0x3e2d51,_0x23ffb7=_0x4ae3f8[_0x5b1cac(0x1e7)](_0x589f94);if(_0x23ffb7===undefined)return![];try{_0x4d2f6f[_0x5b1cac(0x1ac)](_0x23ffb7);}catch{}return _0x4ae3f8[_0x5b1cac(0x19d)](_0x589f94),!![];}function _0x1364c1(){const _0x5ac049=_0x3e2d51;return Math[_0x5ac049(0x1fd)](Date[_0x5ac049(0x1d3)](),_0x5af97f[_0x5ac049(0x1f7)]()+0x1);}async function _0x32caba(_0x1e5788){const _0x2135e3=_0x3e2d51;if(!_0x4d2f6f||!_0x1e5788)return![];const _0x208883=await _0x5af97f[_0x2135e3(0x17b)](_0x1e5788,async _0x1cb882=>{const _0x5a8e65=_0x2135e3;_0x4d2f6f[_0x5a8e65(0x13c)](_0x1cb882['index']),await _0x4ae3f8[_0x5a8e65(0x1d9)](_0x1cb882[_0x5a8e65(0x1aa)]);const _0x445bc5=require$$0;_0x445bc5[_0x5a8e65(0x1a2)](_0x1cb882[_0x5a8e65(0x180)],JSON[_0x5a8e65(0x1c1)]({'manifestVersion':_0x2d5043,'dims':_0x234f83,'metric':_0x12439f[_0x5a8e65(0x1bb)],'clock':_0x1e5788,'snapshotAt':Date[_0x5a8e65(0x1d3)]()},null,0x2));},{'keep':_0x12439f['keepSnapshots']});if(_0x208883?.[_0x2135e3(0x170)])_0x2aad23=0x0;return _0x208883?.[_0x2135e3(0x170)]??![];}async function _0x265c82(){const _0x1efb6b=_0x3e2d51,_0x1e1aa2=_0x5af97f[_0x1efb6b(0x169)]()||_0x5af97f[_0x1efb6b(0x1a1)]();if(!_0x1e1aa2)return null;let _0x1111dc,_0x2e3f84=![];return await _0x5af97f[_0x1efb6b(0x196)](_0x1e1aa2,async _0x1c8968=>{const _0x4f1ec1=_0x1efb6b,_0x56b1ce=require$$0;_0x1111dc=JSON[_0x4f1ec1(0x1a5)](_0x56b1ce['readFileSync'](_0x1c8968[_0x4f1ec1(0x180)],_0x4f1ec1(0x1d1)));if(_0x1111dc[_0x4f1ec1(0x14a)]!==_0x2d5043||_0x1111dc['dims']!==_0x234f83||_0x1111dc[_0x4f1ec1(0x1bb)]!==_0x12439f[_0x4f1ec1(0x1bb)]){_0x1111dc=null;return;}await _0x4ae3f8['loadFrom'](_0x1c8968['labels']),_0x4d2f6f=new _0x15eb2f[(_0x4f1ec1(0x20e))](_0x12439f[_0x4f1ec1(0x1bb)],_0x234f83),_0x4d2f6f[_0x4f1ec1(0x13d)](_0x1c8968[_0x4f1ec1(0x20f)]),_0x4d2f6f[_0x4f1ec1(0x147)](_0x12439f[_0x4f1ec1(0x189)]),_0x2e3f84=!![];}),_0x2e3f84?_0x1111dc?.[_0x1efb6b(0x149)]??0x0:null;}return{async 'load'(_0x384906){return _0x29d3ee(async()=>{const _0x6a0cb2=_0x3360;_0x5af97f[_0x6a0cb2(0x18a)]({'maxAgeMs':_0x12439f[_0x6a0cb2(0x14b)]}),_0x3f94fe=_0x384906??null;const _0x129666=await _0x265c82(),_0x10e57d=_0x384906?await _0x384906():null;if(_0x129666!=null){if(_0x10e57d){if(!_0x4ae3f8[_0x6a0cb2(0x1ed)])return await _0x4aa06a(_0x10e57d),null;const _0x3318f3=_0x5e77f0(_0x4ae3f8,_0x10e57d,_0x234f83,{'upsert':_0x48794c,'remove':_0x3632c3});_0x2aad23+=_0x3318f3['added']+_0x3318f3[_0x6a0cb2(0x18c)]+_0x3318f3[_0x6a0cb2(0x1e4)];}return _0x129666;}return await _0x4aa06a(_0x10e57d),null;});},async 'add'(_0x3bb990,_0x35ba64,_0x465b42){return _0x29d3ee(async()=>{const _0x543a82=_0x3360;if(!_0x4d2f6f)return;const _0x426abf=_0x35ba64 instanceof Float32Array?_0x35ba64:new Float32Array(_0x35ba64),_0x127152=_0x2de35c(_0x426abf);if(_0x4ae3f8[_0x543a82(0x1d2)](_0x3bb990)===_0x127152)return;_0x48794c(_0x3bb990,_0x426abf,_0x127152),_0x2aad23++,_0x2aad23>=_0x12439f[_0x543a82(0x16c)]&&await _0x32caba(_0x1364c1());});},async 'remove'(_0x3f5987){return _0x29d3ee(async()=>{if(!_0x4d2f6f)return;if(_0x3632c3(_0x3f5987))_0x2aad23++;});},'search'(_0x2490d1,{limit:limit=0xa,efSearch:_0x1f1d12}={}){const _0x1c0788=_0x3e2d51;if(!_0x4d2f6f)return[];if(Number[_0x1c0788(0x1cd)](_0x1f1d12))_0x4d2f6f[_0x1c0788(0x147)](_0x1f1d12);const _0x5dd90f=Math[_0x1c0788(0x1be)](limit,_0x4d2f6f[_0x1c0788(0x1a9)]()||0x1),{neighbors:_0x59af5c,distances:_0x117a06}=_0x4d2f6f['searchKnn'](Array['from'](_0x2490d1),_0x5dd90f),_0x2c6a55=[];for(let _0x1d2947=0x0;_0x1d2947<_0x59af5c['length'];_0x1d2947++){const _0x1e228e=_0x4ae3f8['keyForLabel'](_0x59af5c[_0x1d2947]);if(!_0x1e228e)continue;const _0x2f27a4=_0x12439f[_0x1c0788(0x1bb)]==='cosine'?Math[_0x1c0788(0x1fd)](0x0,0x1-_0x117a06[_0x1d2947]):0x1/(0x1+_0x117a06[_0x1d2947]);_0x2c6a55[_0x1c0788(0x1db)]({'key':_0x1e228e,'score':_0x2f27a4});}return _0x2c6a55;},async 'snapshot'(_0x535015){return _0x29d3ee(()=>_0x32caba(_0x535015??_0x1364c1()));},async 'rebuild'(_0x2216aa){return _0x29d3ee(()=>{if(_0x2216aa!=null)_0x3f94fe=_0x2216aa;return _0x3b1929(_0x2216aa??_0x3f94fe);});},async 'stop'(){return _0x29d3ee(()=>_0x2aad23>0x0||!_0x5af97f['readCurrentId']()?_0x32caba(_0x1364c1()):![]);},'count'(){const _0x183791=_0x3e2d51;return _0x4ae3f8[_0x183791(0x1d7)]();},'info'(){const _0x1c1c62=_0x3e2d51;return{'algorithm':_0x1c1c62(0x161),'metric':_0x12439f['metric'],'M':_0x12439f['M'],'efConstruction':_0x12439f[_0x1c1c62(0x17c)],'efSearch':_0x12439f['efSearch'],'maxElements':_0x4d2f6f?.[_0x1c1c62(0x201)]()??_0x12439f[_0x1c1c62(0x199)],'count':_0x4ae3f8[_0x1c1c62(0x1d7)](),'changesSince':_0x2aad23,'snapshotDir':_0x3d57de,'latestSnapshot':_0x5af97f[_0x1c1c62(0x169)]()??null};}};},hnsw;}var flat,hasRequiredFlat;function requireFlat(){if(hasRequiredFlat)return flat;hasRequiredFlat=0x1,flat=function _0x513a18(_0x4ef6b0={}){const _0x52a722=new Map();return{async 'load'(_0x508d61){const _0x10f2e4=_0x3360;_0x52a722[_0x10f2e4(0x1f4)]();if(_0x508d61)for(const {key:_0x1b8429,vector:_0x2bc3d9}of await _0x508d61()){_0x52a722[_0x10f2e4(0x192)](_0x1b8429,_0x2bc3d9);}},async 'add'(_0x3bb4f9,_0xd25fee,_0x15f88b){_0x52a722['set'](_0x3bb4f9,_0xd25fee);},async 'remove'(_0x429e2a){const _0x3a979f=_0x3360;_0x52a722[_0x3a979f(0x1fa)](_0x429e2a);},'search'(_0x3e9127,{limit:limit=0xa,threshold:threshold=0x0}={}){const _0x2c3f6d=_0x3360,_0x32b0a0=[];for(const [_0x20ea7d,_0x2b0218]of _0x52a722){const _0x4ace62=_0x3b3f81(_0x3e9127,_0x2b0218);if(_0x4ace62>=threshold)_0x32b0a0[_0x2c3f6d(0x1db)]({'key':_0x20ea7d,'score':_0x4ace62});}return _0x32b0a0[_0x2c3f6d(0x1e8)]((_0x5a390e,_0x413499)=>_0x413499[_0x2c3f6d(0x1b0)]-_0x5a390e[_0x2c3f6d(0x1b0)]),_0x32b0a0[_0x2c3f6d(0x184)](0x0,limit);},async 'snapshot'(){return![];},async 'rebuild'(_0x5b6a08){await this['load'](_0x5b6a08);},async 'stop'(){},'count'(){const _0x4fa636=_0x3360;return _0x52a722[_0x4fa636(0x1d7)];},'info'(){const _0x326fb5=_0x3360;return{'algorithm':'flat','count':_0x52a722[_0x326fb5(0x1d7)]};}};};function _0x3b3f81(_0xc33ad6,_0x32c139){const _0x4074d3=_0x3360;let _0x4fe58f=0x0,_0x57ba46=0x0,_0x4cde42=0x0;for(let _0x57199e=0x0;_0x57199e<_0xc33ad6[_0x4074d3(0x13e)];_0x57199e++){_0x4fe58f+=_0xc33ad6[_0x57199e]*_0x32c139[_0x57199e],_0x57ba46+=_0xc33ad6[_0x57199e]*_0xc33ad6[_0x57199e],_0x4cde42+=_0x32c139[_0x57199e]*_0x32c139[_0x57199e];}const _0x3548bf=Math[_0x4074d3(0x168)](_0x57ba46)*Math['sqrt'](_0x4cde42);return _0x3548bf===0x0?0x0:_0x4fe58f/_0x3548bf;}return flat;}var writerLock,hasRequiredWriterLock;function requireWriterLock(){if(hasRequiredWriterLock)return writerLock;hasRequiredWriterLock=0x1;const _0x21b32d=require$$0,_0x1eba11=require$$1,_0x42d6fb=require$$3;return writerLock=function _0x26572c(_0x191b84,{maxAgeMs:maxAgeMs=0x3a98,heartbeatMs:heartbeatMs=0x1388,onLost:onLost=null}={}){const _0x58495a=_0x3360,_0x5b46a4=_0x1eba11['join'](_0x191b84,_0x58495a(0x1bf)),_0x202fb8=_0x42d6fb[_0x58495a(0x156)](0x8)[_0x58495a(0x177)](_0x58495a(0x16e));let _0x23738d=![],_0x333818=null;const _0x35c5df=()=>JSON[_0x58495a(0x1c1)]({'pid':process[_0x58495a(0x16d)],'token':_0x202fb8,'at':Date[_0x58495a(0x1d3)]()});function _0x276e6c(){const _0x39ad31=_0x58495a;try{return JSON[_0x39ad31(0x1a5)](_0x21b32d['readFileSync'](_0x5b46a4,'utf8'));}catch(_0x1fa527){return _0x1fa527?.[_0x39ad31(0x1a8)]===_0x39ad31(0x1a3)?null:{'unreadable':!![]};}}function _0x24b572(){const _0x13a988=_0x58495a;try{const _0x443b59=_0x21b32d['openSync'](_0x5b46a4,'wx');try{_0x21b32d['writeFileSync'](_0x443b59,_0x35c5df());}finally{_0x21b32d[_0x13a988(0x1c6)](_0x443b59);}return!![];}catch(_0x151c10){if(_0x151c10?.[_0x13a988(0x1a8)]===_0x13a988(0x173))return![];throw _0x151c10;}}function _0x19f3d9(_0x41771f){const _0x59c296=_0x58495a;if(!_0x41771f)return!![];if(_0x41771f[_0x59c296(0x1c3)])return!![];return Date[_0x59c296(0x1d3)]()-(_0x41771f['at']??0x0)>=maxAgeMs;}function _0x5936fe(){if(_0x333818)clearInterval(_0x333818);_0x333818=null;}function _0x24a783(){_0x5936fe(),_0x333818=setInterval(()=>{const _0x3ed6d7=_0x3360,_0x2c37d3=_0x276e6c();if(_0x2c37d3&&!_0x2c37d3['unreadable']&&_0x2c37d3[_0x3ed6d7(0x1f3)]!==_0x202fb8){_0x23738d=![],_0x5936fe();try{onLost?.();}catch{}return;}try{_0x21b32d[_0x3ed6d7(0x1a2)](_0x5b46a4,_0x35c5df());}catch{}},heartbeatMs),_0x333818['unref']?.();}function _0x378c0a(){const _0x47c563=_0x58495a,_0x1950fc=_0x276e6c();return!!_0x1950fc&&_0x1950fc[_0x47c563(0x1f3)]===_0x202fb8;}return{'path':_0x5b46a4,'token':_0x202fb8,'acquire'(){const _0x1471e1=_0x58495a,_0x323493=_0x276e6c();if(_0x323493&&_0x323493[_0x1471e1(0x1f3)]===_0x202fb8){_0x23738d=!![];if(!_0x333818)_0x24a783();return!![];}let _0x11c64c=_0x24b572();if(!_0x11c64c&&_0x19f3d9(_0x276e6c())){try{_0x21b32d[_0x1471e1(0x211)](_0x5b46a4);}catch{}_0x11c64c=_0x24b572();}if(_0x11c64c&&!_0x378c0a())_0x11c64c=![];_0x23738d=_0x11c64c;if(_0x11c64c)_0x24a783();return _0x11c64c;},'held'(){return _0x23738d;},'isFree'(){const _0x395dfb=_0x58495a,_0xd2d633=_0x276e6c();if(_0xd2d633&&_0xd2d633[_0x395dfb(0x1f3)]===_0x202fb8)return![];return _0x19f3d9(_0xd2d633);},'release'(){const _0x2d49c2=_0x58495a;_0x5936fe();if(!_0x23738d)return;_0x23738d=![];if(_0x378c0a())try{_0x21b32d[_0x2d49c2(0x211)](_0x5b46a4);}catch{}}};},writerLock;}var usearch,hasRequiredUsearch;function requireUsearch(){if(hasRequiredUsearch)return usearch;hasRequiredUsearch=0x1;const _0x34fdf8=require$$0,_0x4da061=requireSnapshotStore(),_0x1b8eaf=requireLabelMap(),_0x477a91=requireWriterLock(),{fingerprint:_0x600b9d,reconcileIndex:_0x551732}=requireIndexConvergence(),_0x55cb33=0x1;let _0x89b0e1=null;function _0x3a5d57(){const _0x636f8b=_0x3360;if(_0x89b0e1)return _0x89b0e1;try{return _0x89b0e1=require(_0x636f8b(0x1ea)),_0x89b0e1;}catch(_0x21157c){const _0x3142f4=new Error(_0x636f8b(0x1ad)+(_0x636f8b(0x14f)+process[_0x636f8b(0x154)][_0x636f8b(0x1ef)]+_0x636f8b(0x18b)+process[_0x636f8b(0x171)]+'/'+process[_0x636f8b(0x17f)]+'.\x20')+_0x636f8b(0x1cc)+(_0x636f8b(0x209)+(_0x21157c?.['message']||String(_0x21157c))));_0x3142f4['code']=_0x636f8b(0x157),_0x3142f4[_0x636f8b(0x1d0)]=_0x21157c;throw _0x3142f4;}}function _0x53ac1f(_0x189d98,_0x26118d){const _0x86ade4=_0x3360;switch(_0x189d98){case _0x86ade4(0x164):return _0x26118d[_0x86ade4(0x1c7)][_0x86ade4(0x181)];case'l2':return _0x26118d[_0x86ade4(0x1c7)][_0x86ade4(0x1dc)];case'ip':return _0x26118d['MetricKind']['IP'];default:return _0x26118d[_0x86ade4(0x1c7)][_0x86ade4(0x181)];}}return usearch=function _0x5a8de2(_0x185273={},{dims:_0x353d90,dir:_0x148319,fetchAll:fetchAll=null,onChange:onChange=null}={}){const _0x4eac58=_0x3360,_0x32c73c=_0x3a5d57();if(!_0x353d90||_0x353d90<=0x0)throw new Error(_0x4eac58(0x1c0));if(!_0x148319)throw new Error(_0x4eac58(0x1b5));const _0x3d096e={'metric':_0x185273[_0x4eac58(0x1bb)]??'cosine','connectivity':_0x185273[_0x4eac58(0x18e)]??0x10,'expansionAdd':_0x185273[_0x4eac58(0x142)]??0x80,'expansionSearch':_0x185273['expansionSearch']??0x40,'snapshotEveryChanges':_0x185273[_0x4eac58(0x16c)]??0xc350,'snapshotMaxLagMs':_0x185273[_0x4eac58(0x1da)]??0x2710,'keepSnapshots':_0x185273[_0x4eac58(0x1b1)]??0x2,'tmpMaxAgeMs':_0x185273[_0x4eac58(0x14b)]??0x6*0x36ee80,'heartbeatIntervalMs':_0x185273[_0x4eac58(0x1b8)]??0x1388,'writerLockMaxAgeMs':_0x185273[_0x4eac58(0x1d8)]??0x3a98,'viewRefreshMs':_0x185273['viewRefreshMs']??0x3e8},_0x2265b5=new _0x4da061({'dir':_0x148319,'keepSnapshots':_0x3d096e[_0x4eac58(0x1b1)]}),_0x4c44c7=_0x477a91(_0x148319,{'maxAgeMs':_0x3d096e[_0x4eac58(0x1d8)],'heartbeatMs':_0x3d096e[_0x4eac58(0x1b8)],'onLost':()=>{const _0x27b79d=_0x4eac58;_0x152239(_0x350547)[_0x27b79d(0x1e3)](()=>{});}});let _0x2c882b=new _0x1b8eaf(),_0x1589ee=null,_0x10dc8b=0x0,_0x232238=null,_0x30625d=![],_0x4fa1ff=![],_0xf59148=null,_0x1b3ef5=0x0,_0x1ee4d9=null,_0x26a863=0x0,_0x16d624=![],_0x2cab22=Promise[_0x4eac58(0x15d)]();const _0x152239=_0x141c3c=>{const _0x276faa=_0x4eac58,_0x55b6ca=_0x2cab22[_0x276faa(0x182)](_0x141c3c);return _0x2cab22=_0x55b6ca['catch'](()=>{}),_0x55b6ca;},_0x344d08=()=>{try{onChange?.();}catch{}};function _0x16ad58(){const _0x5965fd=_0x4eac58;return new _0x32c73c[(_0x5965fd(0x145))]({'dimensions':_0x353d90,'metric':_0x53ac1f(_0x3d096e['metric'],_0x32c73c),'quantization':_0x32c73c['ScalarKind'][_0x5965fd(0x14d)],'connectivity':_0x3d096e[_0x5965fd(0x18e)],'expansion_add':_0x3d096e[_0x5965fd(0x142)],'expansion_search':_0x3d096e['expansionSearch'],'multi':![]});}function _0x506f22(_0x568469){return _0x568469 instanceof Float32Array?_0x568469:new Float32Array(_0x568469);}function _0x4e2215(){const _0x29caf8=_0x4eac58;if(fetchAll)return fetchAll();if(_0x232238)return _0x232238();return Promise[_0x29caf8(0x15d)](null);}function _0x1538ce(_0x569297,_0x11b077,_0x39015e){const _0x386ae4=_0x4eac58,_0x5d7af9=_0x2c882b['labelForExisting'](_0x569297);if(_0x5d7af9!==undefined)try{_0x1589ee[_0x386ae4(0x198)](BigInt(_0x5d7af9));}catch{}const _0x454b5a=_0x2c882b[_0x386ae4(0x17a)](_0x569297);_0x1589ee['add'](BigInt(_0x454b5a),_0x11b077),_0x2c882b[_0x386ae4(0x141)](_0x569297,_0x39015e??_0x600b9d(_0x11b077));}function _0x7bdc90(_0x309fdd){const _0xe8ab7d=_0x4eac58,_0x12199a=_0x2c882b[_0xe8ab7d(0x1e7)](_0x309fdd);if(_0x12199a===undefined)return![];try{_0x1589ee[_0xe8ab7d(0x198)](BigInt(_0x12199a));}catch{}return _0x2c882b[_0xe8ab7d(0x19d)](_0x309fdd),!![];}function _0x203455(_0x5b7955){const _0x4f0b8d=_0x4eac58;_0x2c882b=new _0x1b8eaf(),_0x1589ee=_0x16ad58();for(const {key:_0x3e1259,vector:_0x59723a}of _0x5b7955??[]){if(!(_0x59723a instanceof Float32Array)||_0x59723a[_0x4f0b8d(0x13e)]!==_0x353d90)continue;_0x1538ce(_0x3e1259,_0x59723a);}_0x10dc8b=0x0;}function _0x14cd4d(){const _0x493f91=_0x4eac58;return Math[_0x493f91(0x1fd)](Date[_0x493f91(0x1d3)](),_0x2265b5[_0x493f91(0x1f7)]()+0x1);}function _0xf41a60(){if(_0xf59148)clearTimeout(_0xf59148);_0xf59148=null;}function _0x4a5cf0(){const _0x2dce64=_0x4eac58;if(!_0x3d096e[_0x2dce64(0x1da)]||_0xf59148||!_0x4fa1ff||_0x10dc8b<=0x0)return;const _0x39b302=Math[_0x2dce64(0x1fd)](_0x3d096e['snapshotMaxLagMs'],0xa*_0x1b3ef5);_0xf59148=setTimeout(()=>{const _0x572119=_0x2dce64;_0xf59148=null,_0x152239(async()=>{if(_0x4fa1ff&&_0x10dc8b>0x0)await _0x59cb25();_0x4a5cf0(),_0x344d08();})[_0x572119(0x1e3)](()=>{});},_0x39b302),_0xf59148['unref']?.();}async function _0x59cb25(_0x399e9d){const _0x3cff7f=_0x4eac58;if(!_0x1589ee)return![];const _0x1f589b=_0x399e9d??_0x14cd4d(),_0x223fbc=Date[_0x3cff7f(0x1d3)](),_0x5d8800=await _0x2265b5[_0x3cff7f(0x17b)](_0x1f589b,async _0x2952bf=>{const _0x4155e0=_0x3cff7f;_0x1589ee['save'](_0x2952bf[_0x4155e0(0x20f)]),await _0x2c882b[_0x4155e0(0x1d9)](_0x2952bf[_0x4155e0(0x1aa)]),_0x34fdf8[_0x4155e0(0x1a2)](_0x2952bf[_0x4155e0(0x180)],JSON[_0x4155e0(0x1c1)]({'manifestVersion':_0x55cb33,'algorithm':_0x4155e0(0x1ea),'dims':_0x353d90,'metric':_0x3d096e[_0x4155e0(0x1bb)],'clock':_0x1f589b,'snapshotAt':Date[_0x4155e0(0x1d3)]()},null,0x2));},{'keep':_0x3d096e[_0x3cff7f(0x1b1)]});return _0x1b3ef5=Date[_0x3cff7f(0x1d3)]()-_0x223fbc,_0x5d8800?.[_0x3cff7f(0x170)]&&(_0x10dc8b=0x0,_0xf41a60()),_0x5d8800?.['published']??![];}function _0x506b5d(){const _0x3eacd1=_0x4eac58;_0x10dc8b++;if(_0x10dc8b>=_0x3d096e[_0x3eacd1(0x16c)])return _0x59cb25();return _0x4a5cf0(),null;}async function _0xaf012b(){const _0x19bc92=_0x4eac58,_0x474862=_0x2265b5[_0x19bc92(0x169)]()||_0x2265b5[_0x19bc92(0x1a1)]();if(!_0x474862)return null;let _0x18c8e6,_0x5b1e51=![];try{await _0x2265b5['loadSnapshot'](_0x474862,async _0x2ebb0e=>{const _0x51c970=_0x19bc92;_0x18c8e6=JSON[_0x51c970(0x1a5)](_0x34fdf8[_0x51c970(0x15a)](_0x2ebb0e[_0x51c970(0x180)],_0x51c970(0x1d1)));if(_0x18c8e6[_0x51c970(0x14a)]!==_0x55cb33||_0x18c8e6['algorithm']!==_0x51c970(0x1ea)||_0x18c8e6['dims']!==_0x353d90||_0x18c8e6[_0x51c970(0x1bb)]!==_0x3d096e[_0x51c970(0x1bb)]){_0x18c8e6=null;return;}const _0x23bf68=new _0x1b8eaf();await _0x23bf68[_0x51c970(0x1bc)](_0x2ebb0e[_0x51c970(0x1aa)]);const _0x31d84e=_0x16ad58();_0x31d84e['load'](_0x2ebb0e[_0x51c970(0x20f)]),_0x2c882b=_0x23bf68,_0x1589ee=_0x31d84e,_0x5b1e51=!![];});}catch{return null;}return _0x5b1e51?_0x18c8e6?.[_0x19bc92(0x149)]??0x0:null;}async function _0x373334(_0x1b7fa9){const _0x253fbb=_0x4eac58;_0x1ee4d9=null;const _0x3b2aad=await _0xaf012b();if(_0x3b2aad!=null){_0x10dc8b=0x0;if(_0x1b7fa9){if(!_0x2c882b[_0x253fbb(0x1ed)])return _0x203455(_0x1b7fa9),await _0x59cb25(),null;const _0x120d1d=_0x551732(_0x2c882b,_0x1b7fa9,_0x353d90,{'upsert':_0x1538ce,'remove':_0x7bdc90}),_0x539008=_0x120d1d[_0x253fbb(0x148)]+_0x120d1d['changed']+_0x120d1d['removed'];_0x539008>0x0&&(_0x10dc8b+=_0x539008,await _0x59cb25());}return _0x3b2aad;}_0x203455(_0x1b7fa9??[]);if(_0x1589ee[_0x253fbb(0x1d7)]()>0x0)await _0x59cb25();return null;}async function _0x491f0c(){_0x4fa1ff=!![],await _0x373334(await _0x4e2215());}async function _0x350547(){const _0x7d666=_0x4eac58;if(!_0x4fa1ff)return;_0x4fa1ff=![],_0xf41a60(),_0x10dc8b=0x0;const _0x328d32=_0x2265b5['readCurrentId']()||_0x2265b5[_0x7d666(0x1a1)]();await _0x2f108f(_0x328d32),_0x344d08();}async function _0x2f108f(_0x500516){const _0x2b5eff=_0x4eac58;if(!_0x500516)return![];let _0xd86ef0=![];try{await _0x2265b5[_0x2b5eff(0x196)](_0x500516,async _0x5ae4db=>{const _0x3dd516=_0x2b5eff,_0x5621af=JSON[_0x3dd516(0x1a5)](_0x34fdf8['readFileSync'](_0x5ae4db[_0x3dd516(0x180)],_0x3dd516(0x1d1)));if(_0x5621af[_0x3dd516(0x14a)]!==_0x55cb33||_0x5621af[_0x3dd516(0x1cb)]!=='usearch'||_0x5621af[_0x3dd516(0x1dd)]!==_0x353d90||_0x5621af[_0x3dd516(0x1bb)]!==_0x3d096e[_0x3dd516(0x1bb)])return;const _0x4a8c02=new _0x1b8eaf();await _0x4a8c02['loadFrom'](_0x5ae4db[_0x3dd516(0x1aa)]);const _0x586b7d=_0x16ad58();_0x586b7d[_0x3dd516(0x1f5)](_0x5ae4db[_0x3dd516(0x20f)]),_0x1589ee=_0x586b7d,_0x2c882b=_0x4a8c02,_0x1ee4d9=_0x500516,_0xd86ef0=!![];});}catch{}return _0xd86ef0;}function _0x45a2e2(){const _0x90d16f=_0x4eac58,_0x4a5c77=Date[_0x90d16f(0x1d3)]();if(_0x4a5c77-_0x26a863<_0x3d096e[_0x90d16f(0x143)])return;_0x26a863=_0x4a5c77;if(_0x16d624)return;if(_0x4c44c7[_0x90d16f(0x1cf)]()){_0x16d624=!![],_0x152239(async()=>{const _0x5d96ec=_0x90d16f;!_0x4fa1ff&&_0x30625d&&_0x4c44c7[_0x5d96ec(0x1e0)]()&&(await _0x491f0c(),_0x344d08());})['catch'](()=>{})[_0x90d16f(0x20c)](()=>{_0x16d624=![];});return;}const _0x567491=_0x2265b5['readCurrentId']()||_0x2265b5[_0x90d16f(0x1a1)]();if(!_0x567491||_0x567491===_0x1ee4d9)return;_0x16d624=!![],_0x152239(async()=>{if(!_0x4fa1ff&&await _0x2f108f(_0x567491))_0x344d08();})[_0x90d16f(0x1e3)](()=>{})[_0x90d16f(0x20c)](()=>{_0x16d624=![];});}return{async 'load'(_0x2ba566){return _0x152239(async()=>{const _0x2adb2a=_0x3360;_0x2265b5['cleanupTmpDirs']({'maxAgeMs':_0x3d096e[_0x2adb2a(0x14b)]}),_0x232238=_0x2ba566??null,_0x4fa1ff=_0x4c44c7[_0x2adb2a(0x1e0)]();let _0x5097bc=null;if(_0x4fa1ff)_0x5097bc=await _0x373334(_0x2ba566?await _0x2ba566():null);else{const _0xbb28b=_0x2265b5['readCurrentId']()||_0x2265b5[_0x2adb2a(0x1a1)]();await _0x2f108f(_0xbb28b);}return _0x30625d=!![],_0x5097bc;});},async 'add'(_0x4b31de,_0x41fa76,_0x17c45c){return _0x152239(async()=>{const _0x1641a9=_0x3360;if(!_0x30625d)return;const _0x10e6b3=_0x506f22(_0x41fa76);if(!_0x4fa1ff){if(!_0x4c44c7[_0x1641a9(0x1e0)]())return;await _0x491f0c();}if(!_0x1589ee)return;const _0x1656f8=_0x600b9d(_0x10e6b3);if(_0x2c882b[_0x1641a9(0x1d2)](_0x4b31de)===_0x1656f8)return;_0x1538ce(_0x4b31de,_0x10e6b3,_0x1656f8),await _0x506b5d();});},async 'remove'(_0xd0521){return _0x152239(async()=>{const _0x40630a=_0x3360;if(!_0x30625d)return;if(!_0x4fa1ff){if(!_0x4c44c7[_0x40630a(0x1e0)]())return;await _0x491f0c();}if(!_0x1589ee)return;if(_0x7bdc90(_0xd0521))await _0x506b5d();});},'search'(_0x308c9b,{limit:limit=0xa}={}){const _0x46d4e1=_0x4eac58;if(!_0x4fa1ff&&_0x30625d)_0x45a2e2();if(!_0x1589ee)return[];const _0x1c0d6a=_0x1589ee[_0x46d4e1(0x1d7)]();if(_0x1c0d6a===0x0)return[];const _0x15bf2d=Math[_0x46d4e1(0x1be)](limit,_0x1c0d6a),_0x4625f9=_0x1589ee[_0x46d4e1(0x186)](_0x506f22(_0x308c9b),_0x15bf2d,0x0),_0x2c6acf=[],_0x5ccebc=_0x4625f9[_0x46d4e1(0x1f6)],_0xc370e2=_0x4625f9[_0x46d4e1(0x1ec)];for(let _0x2f613a=0x0;_0x2f613a<_0x5ccebc[_0x46d4e1(0x13e)];_0x2f613a++){const _0x32b79e=_0x5ccebc[_0x2f613a];if(_0x32b79e===0xffffffffffffffffn)continue;const _0x2452d0=Number(_0x32b79e),_0x1df56e=_0x2c882b[_0x46d4e1(0x15f)](_0x2452d0);if(!_0x1df56e)continue;const _0x397e38=_0xc370e2[_0x2f613a];let _0x2fdbeb;if(_0x3d096e[_0x46d4e1(0x1bb)]===_0x46d4e1(0x164))_0x2fdbeb=Math[_0x46d4e1(0x1fd)](0x0,0x1-_0x397e38);else{if(_0x3d096e[_0x46d4e1(0x1bb)]==='ip')_0x2fdbeb=-_0x397e38;else _0x2fdbeb=0x1/(0x1+_0x397e38);}_0x2c6acf['push']({'key':_0x1df56e,'score':_0x2fdbeb});}return _0x2c6acf;},async 'snapshot'(_0x1bc1c9){return _0x152239(()=>_0x4fa1ff?_0x59cb25(_0x1bc1c9??undefined):![]);},async 'rebuild'(_0x3fd021){return _0x152239(async()=>{if(_0x3fd021!=null)_0x232238=_0x3fd021;if(!_0x4fa1ff){if(!_0x4c44c7['acquire']())return;_0x4fa1ff=!![];}const _0x1d7ac2=_0x3fd021?await _0x3fd021():await _0x4e2215();_0x203455(_0x1d7ac2??[]),_0x30625d=!![],await _0x59cb25();});},async 'stop'(){return _0x152239(async()=>{const _0x2b6c8c=_0x3360;_0xf41a60();if(_0x4fa1ff){if(_0x10dc8b>0x0||!_0x2265b5[_0x2b6c8c(0x169)]())await _0x59cb25();_0x4c44c7['release']();}_0x4fa1ff=![],_0x30625d=![];});},'count'(){const _0x4f8c4c=_0x4eac58;return _0x2c882b[_0x4f8c4c(0x1d7)]();},'info'(){const _0x50d4d1=_0x4eac58;return{'algorithm':_0x50d4d1(0x1ea),'role':_0x4fa1ff?_0x50d4d1(0x1fe):_0x50d4d1(0x151),'metric':_0x3d096e['metric'],'connectivity':_0x3d096e[_0x50d4d1(0x18e)],'expansionAdd':_0x3d096e[_0x50d4d1(0x142)],'expansionSearch':_0x3d096e[_0x50d4d1(0x1a4)],'snapshotEveryChanges':_0x3d096e[_0x50d4d1(0x16c)],'snapshotMaxLagMs':_0x3d096e[_0x50d4d1(0x1da)],'count':_0x2c882b[_0x50d4d1(0x1d7)](),'size':_0x1589ee?.['size']?.()??0x0,'capacity':_0x1589ee?.[_0x50d4d1(0x17e)]?.()??0x0,'changesSince':_0x4fa1ff?_0x10dc8b:null,'viewedSnapshot':_0x1ee4d9??null,'snapshotDir':_0x148319,'latestSnapshot':_0x2265b5['readCurrentId']()??null};}};},usearch;}function _0x3360(_0x507d4c,_0x4efcc0){_0x507d4c=_0x507d4c-0x137;const _0xf898a6=_0xf898();let _0x336086=_0xf898a6[_0x507d4c];return _0x336086;}var hasRequiredAlgorithmWorkerThread;function _0xf898(){const _0x31d5a2=['state','Cos','then',').\x20','slice','_snapshotPaths','search','name','mtimeMs','efSearch','cleanupTmpDirs','\x20on\x20','changed','343425OUhjUb','connectivity','labels.json','trunc','hnsw\x20algorithm\x20requires\x20dims\x20>\x200','set','byteOffset','message','state.json','loadSnapshot','This\x20is\x20risky\x20on\x20slow\x20disks\x20or\x20overloaded\x20machines.\x20Consider\x20increasing\x20staleLockMaxAgeMs\x20if\x20this\x20happens\x20frequently.','remove','maxElements','rmSync','fetchAll','index.hnsw','tombstone','prune','130yzmpmq','currentPath','latestSnapshotId','writeFileSync','ENOENT','expansionSearch','parse','lock_busy','growFactor','code','getCurrentCount','labels','_tombstoneCount','markDelete','usearch\x20algorithm\x20unavailable:\x20the\x20native\x20\x22usearch\x22\x20bindings\x20could\x20not\x20be\x20loaded\x20','addPoint','info','score','keepSnapshots','dir','hasRows','ceil','usearch\x20algorithm\x20requires\x20dir\x20for\x20snapshot\x20storage','snapshotsDir','isDirectory','heartbeatIntervalMs','host','tombstoneCount','metric','loadFrom','filter','min','WRITER.LOCK','usearch\x20algorithm\x20requires\x20dims\x20>\x200','stringify','labelToKey','unreadable','imul','repeat','closeSync','MetricKind','sync','14307jWvVMa','Breaking\x20stale\x20snapshot\x20lock\x20(age:\x20','algorithm','Install\x20compatible\x20bindings\x20or\x20use\x20algorithm\x20\x22flat\x22/\x22hnsw\x22\x20instead.\x20','isInteger','nextLabel','isFree','cause','utf8','fingerprintOf','now','opts','keyToLabel','statSync','size','writerLockMaxAgeMs','snapshotTo','snapshotMaxLagMs','push','L2sq','dims','get','round','acquire','199972QJUfql','hostname','catch','removed','number','snapshot','labelForExisting','sort','stop','usearch','map','distances','hasFingerprints','memoryUsage','node','listSnapshotIds','[SnapshotStore]','1329691SCCBHz','token','clear','view','keys','readCurrentClock','entries','key','delete','vector','join','max','writer','version','log','getMaxElements','error','snapshots','2114hBOaMP','openSync','worker_threads','HNSW\x20algorithm\x20unavailable:\x20the\x20native\x20\x22hnswlib-node\x22\x20bindings\x20could\x20not\x20be\x20loaded\x20','keyToFp','Original\x20error:\x20','postMessage','rebuild','finally','startsWith','HierarchicalNSW','index','299457guVLyq','unlinkSync','initIndex','isFinite','vectors','snapshot\x20incomplete:\x20','path','count','writeIndexSync','readIndexSync','length','fid','hasOwnProperty','setFingerprint','expansionAdd','viewRefreshMs','default','Index','_snapshotDir','setEf','added','clock','manifestVersion','tmpMaxAgeMs','4314REZsKz','F32','.tmp','for\x20Node\x20','HNSW_BINDINGS_UNAVAILABLE','reader','SnapshotStore\x20requires\x20dir','fetchAllResult','versions','prototype','randomBytes','USEARCH_BINDINGS_UNAVAILABLE','reset','from','readFileSync','321592UbeCpQ','warn','resolve','isArray','keyForLabel','buffer','hnsw','queryVec','load','cosine','hnswlib-node','add','.tmp-','sqrt','readCurrentId','hnsw\x20algorithm\x20requires\x20dir\x20for\x20snapshot\x20storage','stale','snapshotEveryChanges','pid','hex','existsSync','published','platform','trim','EEXIST','368xjBbaS','resizeIndex','lockPath','toString','readdirSync','88ZvsHIg','labelForEphemeral','publishSnapshot','efConstruction','exports','capacity','arch'];_0xf898=function(){return _0x31d5a2;};return _0xf898();}function requireAlgorithmWorkerThread(){const _0x5a9244=_0x411a8a;if(hasRequiredAlgorithmWorkerThread)return algorithmWorkerThread$1;hasRequiredAlgorithmWorkerThread=0x1;const {parentPort:_0x39657c,workerData:_0x2e9a2c}=require$$0$1,{algorithmName:_0x4d9990,algorithmConfig:_0x5d2978,dims:_0x47ab32,dir:_0x367ab9}=_0x2e9a2c;let _0x23ebfc=0x1;const _0x3dbc45=new Map();function _0x30f8ee(){const _0x4ca2da=_0x23ebfc++;return new Promise((_0x45cfd0,_0x2aa460)=>{const _0x5362fb=_0x3360;_0x3dbc45['set'](_0x4ca2da,{'resolve':_0x45cfd0,'reject':_0x2aa460}),_0x39657c[_0x5362fb(0x20a)]({'op':_0x5362fb(0x19b),'fid':_0x4ca2da});});}const _0x1e5994={'dims':_0x47ab32,'dir':_0x367ab9,'fetchAll':_0x30f8ee,'onChange':()=>_0x394040()};let _0x58ede8;if(_0x4d9990==='hnsw')_0x58ede8=requireHnsw()(_0x5d2978,_0x1e5994);else{if(_0x4d9990==='flat')_0x58ede8=requireFlat()(_0x5d2978,_0x1e5994);else{if(_0x4d9990==='usearch')_0x58ede8=requireUsearch()(_0x5d2978,_0x1e5994);else throw new Error('Unknown\x20algorithm:\x20\x22'+_0x4d9990+'\x22');}}function _0x394040(){const _0x2f47eb=_0x3360;try{_0x39657c[_0x2f47eb(0x20a)]({'op':_0x2f47eb(0x1c8),'count':_0x58ede8['count'](),'info':_0x58ede8['info'](),'memory':process[_0x2f47eb(0x1ee)]()});}catch{}}function _0x53cb3d(_0x2f8988){const _0x47e6a0=_0x3360;return(_0x2f8988||[])[_0x47e6a0(0x1eb)](_0x5c4ba4=>({'key':_0x5c4ba4[_0x47e6a0(0x1f9)],'vector':_0x5c4ba4[_0x47e6a0(0x1fb)]instanceof Float32Array?_0x5c4ba4[_0x47e6a0(0x1fb)]:new Float32Array(_0x5c4ba4[_0x47e6a0(0x1fb)])}));}return _0x39657c['on'](_0x5a9244(0x194),async _0x652f4b=>{const _0x4637a0=_0x5a9244;if(_0x652f4b['op']===_0x4637a0(0x153)){const _0x26d255=_0x3dbc45[_0x4637a0(0x1de)](_0x652f4b[_0x4637a0(0x13f)]);if(!_0x26d255)return;_0x3dbc45[_0x4637a0(0x1fa)](_0x652f4b[_0x4637a0(0x13f)]);if(_0x652f4b['error'])_0x26d255['reject'](new Error(_0x652f4b[_0x4637a0(0x202)]));else _0x26d255[_0x4637a0(0x15d)](_0x53cb3d(_0x652f4b[_0x4637a0(0x138)]));return;}const {id:_0x3f5885,op:_0x588d31,args:_0x354909}=_0x652f4b;try{let _0x16369b;switch(_0x588d31){case _0x4637a0(0x163):{_0x16369b=await _0x58ede8[_0x4637a0(0x163)](_0x354909[_0x4637a0(0x1b3)]?_0x30f8ee:null),_0x394040();break;}case _0x4637a0(0x166):{const _0x48cec9=_0x354909[_0x4637a0(0x1fb)]instanceof Float32Array?_0x354909['vector']:new Float32Array(_0x354909['vector']);await _0x58ede8[_0x4637a0(0x166)](_0x354909[_0x4637a0(0x1f9)],_0x48cec9,_0x354909[_0x4637a0(0x149)]??undefined),_0x394040(),_0x16369b=null;break;}case _0x4637a0(0x198):{await _0x58ede8[_0x4637a0(0x198)](_0x354909[_0x4637a0(0x1f9)]),_0x394040(),_0x16369b=null;break;}case'search':{const _0x14087a=_0x354909[_0x4637a0(0x162)]instanceof Float32Array?_0x354909[_0x4637a0(0x162)]:new Float32Array(_0x354909['queryVec']);_0x16369b=_0x58ede8[_0x4637a0(0x186)](_0x14087a,_0x354909[_0x4637a0(0x1d4)]||{});break;}case _0x4637a0(0x1e6):{_0x16369b=await _0x58ede8['snapshot'](_0x354909[_0x4637a0(0x149)]),_0x394040();break;}case'rebuild':{const _0x4ec9e3=_0x53cb3d(_0x354909[_0x4637a0(0x138)]);await _0x58ede8[_0x4637a0(0x20b)](async()=>_0x4ec9e3),_0x394040(),_0x16369b=null;break;}case _0x4637a0(0x1e9):{await _0x58ede8[_0x4637a0(0x1e9)](),_0x394040(),_0x16369b=null;break;}case'count':{_0x16369b=_0x58ede8[_0x4637a0(0x13b)]();break;}case _0x4637a0(0x1af):{_0x16369b=_0x58ede8[_0x4637a0(0x1af)]();break;}default:throw new Error('Unknown\x20op:\x20\x22'+_0x588d31+'\x22');}_0x39657c[_0x4637a0(0x20a)]({'id':_0x3f5885,'result':_0x16369b});}catch(_0x307a2d){_0x39657c[_0x4637a0(0x20a)]({'id':_0x3f5885,'error':{'message':_0x307a2d?.[_0x4637a0(0x194)]||String(_0x307a2d),'code':_0x307a2d?.[_0x4637a0(0x1a8)]}});}}),_0x39657c[_0x5a9244(0x20a)]({'op':'ready'}),algorithmWorkerThread$1;}var algorithmWorkerThreadExports=requireAlgorithmWorkerThread(),algorithmWorkerThread=getDefaultExportFromCjs(algorithmWorkerThreadExports);module[_0x411a8a(0x17d)]=algorithmWorkerThread;
|