@kedem/okdb 2.0.1 → 2.0.2

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/docs/index.md CHANGED
@@ -121,6 +121,7 @@ await okdb.close();
121
121
  - [HTTP Clustering](./http-cluster.md) — the CLI's N-capable-nodes cluster
122
122
  - [Process Registry](./process-registry.md) — root-wide process visibility and control
123
123
  - [Auth & Sync](./auth-and-sync.md) / [Auth Permissions](./auth-permissions.md) — tokens, OAuth, grants
124
+ - [Licensing](./licensing.md) — free tier, adding a license file, PIN activation
124
125
  - [Logging](./logging.md) — structured logs, retention
125
126
  - [Diagnostics](./diagnostics.md) — opt-in triage tooling (write-origin ring, fatal report, loop lag)
126
127
  - [Plugins](./plugins.md) — extending OKDB before open
@@ -0,0 +1,152 @@
1
+ # Licensing
2
+
3
+ OKDB runs without a license on a **free tier** that is enough to evaluate and build something
4
+ real. A license is a signed file from your vendor that unlocks additional features and raises
5
+ limits. Everything is managed from the CLI:
6
+
7
+ ```bash
8
+ okdb license [<blob|path|uuid|activation-token>] [--path <db-dir>]
9
+ ```
10
+
11
+ Licenses are stored **inside the database** (in the `~system` environment), so always point the
12
+ command at the same data directory your server runs with — via `--path`, the `OKDB_PATH`
13
+ environment variable, or the `path` key in `.kdbconfig`.
14
+
15
+ ---
16
+
17
+ ## Free tier
18
+
19
+ With no license stored, OKDB applies the free tier:
20
+
21
+ | Feature | Free tier | Feature | Free tier |
22
+ | ------- | --------- | ------------- | --------- |
23
+ | `fts` | ✓ | `sync` | ✗ |
24
+ | `views` | ✓ | `embeddings` | ✗ |
25
+ | `files` | ✓ | `engines` | ✗ |
26
+ | `mcp` | ✓ | `timeMachine` | ✗ |
27
+
28
+ | Limit | Free tier |
29
+ | ------------- | --------- |
30
+ | Environments | 2 |
31
+ | Types per env | 10 |
32
+ | Total writes | 1,000,000 |
33
+
34
+ Using a disabled feature throws `LICENSE_FEATURE_DISABLED`; crossing a limit throws
35
+ `LICENSE_LIMIT_EXCEEDED`. A license lists its own feature set and limits — anything the
36
+ vendor left unset is unlimited.
37
+
38
+ ---
39
+
40
+ ## Activating a license file
41
+
42
+ Your vendor sends you a `.license` file. The flow has two steps, because standard licenses are
43
+ **bound to one node**: the database generates a PIN unique to this node + license pair, and the
44
+ vendor answers with an activation token.
45
+
46
+ ### 1. Add the license file
47
+
48
+ ```bash
49
+ okdb license ./acme.license --path ./okdb-data
50
+ ```
51
+
52
+ The CLI reads the file, verifies the signature, stores the license, and prints a **PIN**:
53
+
54
+ ```
55
+ ✓ License added
56
+ licensee: Acme Corp
57
+ ...
58
+ PIN: AB3D-EF7H
59
+
60
+ Next step — activate the license:
61
+ 1. Send the PIN above (AB3DEF7H) to your license vendor.
62
+ 2. You will receive an activation token.
63
+ 3. Run: okdb license <activation-token>
64
+ ```
65
+
66
+ The PIN is derived from the node identity and the license — it contains no secrets and is safe
67
+ to send over email or chat.
68
+
69
+ You can also paste the license blob string directly instead of a file path — the CLI
70
+ auto-detects what it was given.
71
+
72
+ ### 2. Apply the activation token
73
+
74
+ ```bash
75
+ okdb license <activation-token>
76
+ # or, if the vendor sent it as a file:
77
+ okdb license ./acme-activation.txt
78
+ ```
79
+
80
+ ```
81
+ ✓ License activated
82
+ licensee: Acme Corp
83
+ ```
84
+
85
+ Done. A running server picks the change up on its periodic license recheck; restart it if you
86
+ want the new tier immediately.
87
+
88
+ ### Open licenses (POC / demo)
89
+
90
+ Some licenses are issued as **open**: not node-bound, maximum 6 months validity. These are
91
+ active immediately after step 1 — no PIN, no activation token. The server logs a warning
92
+ banner while an open license is active, as a reminder that it is for evaluation only.
93
+
94
+ ---
95
+
96
+ ## Managing licenses
97
+
98
+ ```bash
99
+ okdb license # list all stored licenses, current tier, and usage
100
+ okdb license <uuid|prefix> # details for one license (features, limits, status, usage)
101
+ okdb license remove <id> # remove a stored license
102
+ ```
103
+
104
+ The list shows each license's status:
105
+
106
+ | Status | Meaning |
107
+ | ------------ | -------------------------------------------------------------------------- |
108
+ | `active` | Verified and in effect (the first active license wins) |
109
+ | `pending` | Added but not yet activated — send the PIN to your vendor |
110
+ | `expired` | Past its expiry date; the node falls back to the next license or free tier |
111
+ | `wrong_node` | The activation belongs to a different node identity (see below) |
112
+ | `invalid` | The blob is corrupt or not signed by the key this build trusts |
113
+
114
+ `okdb serve` also prints a one-line license summary at startup (licensee and expiry, or the
115
+ current free-tier usage).
116
+
117
+ ---
118
+
119
+ ## Node identity, reset, and moving a database
120
+
121
+ The activation is bound to the node identity created when the database was first initialized.
122
+ Two consequences:
123
+
124
+ - **`okdb reset` preserves your license.** The reset command deliberately carries the node
125
+ identity and all stored licenses into the fresh database, so activation survives.
126
+ - **Deleting the data directory by hand does not.** A new directory means a new node identity;
127
+ previously activated licenses show `wrong_node` and need a re-activation from your vendor
128
+ (add the license again, send the new PIN).
129
+
130
+ The same applies to copying a license between machines: the blob can be added anywhere, but
131
+ each node needs its own activation.
132
+
133
+ ---
134
+
135
+ ## Expiry
136
+
137
+ The server rechecks licenses periodically. When the active license expires, the node logs a
138
+ warning, emits a `LICENSE_INVALID` event, and drops to the next valid license or the free tier
139
+ — by default it **keeps running** (`onLicenseExpired: 'log'`). Set the constructor option
140
+ `onLicenseExpired: 'shutdown'` (or `OKDB_LICENSE_EXPIRED_ACTION=shutdown`) to make the process
141
+ exit instead.
142
+
143
+ ---
144
+
145
+ ## Errors
146
+
147
+ | Code | When |
148
+ | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
149
+ | `LICENSE_INVALID` | Blob corrupt, duplicate, or signed by a key this build does not trust — the error includes the build's expected key fingerprint |
150
+ | `LICENSE_ACTIVATION_INVALID` | Token malformed, or no stored license matches it — add the license blob first |
151
+ | `LICENSE_FEATURE_DISABLED` | The current tier does not include the feature |
152
+ | `LICENSE_LIMIT_EXCEEDED` | An operation would cross a licensed limit |
@@ -38,6 +38,7 @@
38
38
  { "file": "process-registry.md", "label": "Process Registry" },
39
39
  { "file": "plugins.md", "label": "Plugins" },
40
40
  { "file": "processors.md", "label": "Processors (modes & registration)" },
41
+ { "file": "licensing.md", "label": "Licensing" },
41
42
  { "file": "logging.md", "label": "Logging" },
42
43
  { "file": "diagnostics.md", "label": "Diagnostics" },
43
44
  { "file": "migration.md", "label": "Migration" },
@@ -1 +1 @@
1
- 'use strict';const _0x2c7ed1=_0x1d78;(function(_0x3eee2e,_0x4f51de){const _0x530d47=_0x1d78,_0x9fdc32=_0x3eee2e();while(!![]){try{const _0x38d9ab=parseInt(_0x530d47(0x1d9))/0x1+-parseInt(_0x530d47(0x11e))/0x2*(parseInt(_0x530d47(0x1ad))/0x3)+parseInt(_0x530d47(0x11d))/0x4+parseInt(_0x530d47(0x27d))/0x5*(-parseInt(_0x530d47(0x153))/0x6)+-parseInt(_0x530d47(0x146))/0x7+-parseInt(_0x530d47(0x163))/0x8*(-parseInt(_0x530d47(0x239))/0x9)+parseInt(_0x530d47(0x1c3))/0xa;if(_0x38d9ab===_0x4f51de)break;else _0x9fdc32['push'](_0x9fdc32['shift']());}catch(_0x28cbe9){_0x9fdc32['push'](_0x9fdc32['shift']());}}}(_0x4abc,0x1ed5a));var require$$0$3=require(_0x2c7ed1(0x226)),require$$2=require('v8'),require$$0=require('node:vm'),require$$0$2=require(_0x2c7ed1(0x230)),require$$0$1=require('node:perf_hooks'),require$$6=require(_0x2c7ed1(0x265));function getDefaultExportFromCjs(_0x467fd4){const _0x4491fb=_0x2c7ed1;return _0x467fd4&&_0x467fd4[_0x4491fb(0x1e4)]&&Object[_0x4491fb(0x12f)][_0x4491fb(0x168)][_0x4491fb(0x241)](_0x467fd4,'default')?_0x467fd4[_0x4491fb(0x184)]:_0x467fd4;}var okdbFunctionsSandboxWorker$1={},okdbFatalReport,hasRequiredOkdbFatalReport;function requireOkdbFatalReport(){if(hasRequiredOkdbFatalReport)return okdbFatalReport;hasRequiredOkdbFatalReport=0x1;function _0x386208(_0x46ded0){const _0x2d6dc6=_0x1d78;if(process.env.OKDB_FATAL_REPORT!=='1')return;try{if(!process[_0x2d6dc6(0x25f)])return;process[_0x2d6dc6(0x25f)][_0x2d6dc6(0x1f7)]=!![];try{if(_0x2d6dc6(0x111)in process[_0x2d6dc6(0x25f)])process[_0x2d6dc6(0x25f)][_0x2d6dc6(0x111)]=process.env.OKDB_FATAL_REPORT_ENV!=='1';}catch{}if(process[_0x2d6dc6(0x260)]!==_0x2d6dc6(0x1e6))try{process[_0x2d6dc6(0x25f)][_0x2d6dc6(0x1df)]=!![];if(typeof process[_0x2d6dc6(0x25f)][_0x2d6dc6(0x122)]===_0x2d6dc6(0x24a))process[_0x2d6dc6(0x25f)][_0x2d6dc6(0x122)]='SIGSEGV';}catch{}if(process.env.OKDB_REPORT_DIR)try{require('fs')[_0x2d6dc6(0x1ff)](process.env.OKDB_REPORT_DIR,{'recursive':!![]}),process['report'][_0x2d6dc6(0x261)]=process.env.OKDB_REPORT_DIR;}catch{}try{process['report'][_0x2d6dc6(0x195)]='';}catch{}if(_0x46ded0)process.env.OKDB_REPORT_TAG=String(_0x46ded0);}catch{}}return okdbFatalReport={'enableFatalReport':_0x386208},okdbFatalReport;}var okdbFunctionsSandbox,hasRequiredOkdbFunctionsSandbox;function requireOkdbFunctionsSandbox(){if(hasRequiredOkdbFunctionsSandbox)return okdbFunctionsSandbox;hasRequiredOkdbFunctionsSandbox=0x1;const _0x3a8693=require$$0;function _0x55c56c(_0x104d68){const _0x1374f6=_0x104d68==='*',_0x4a9fcf=_0x1374f6?null:new Set(Array['isArray'](_0x104d68)?_0x104d68:[]);return function _0x4587f4(_0x27ad7,_0x49577f){const _0x34042e=_0x1d78;if(!_0x1374f6){let _0x130228;try{const _0x5be7f3=new URL(typeof _0x27ad7===_0x34042e(0x24a)?_0x27ad7:_0x27ad7?.[_0x34042e(0x12b)]??String(_0x27ad7));_0x130228=_0x5be7f3[_0x34042e(0x152)];}catch{const _0x454118=new Error(_0x34042e(0x1bb));return _0x454118[_0x34042e(0x205)]='FETCH_NOT_ALLOWED',Promise[_0x34042e(0x1ba)](_0x454118);}if(!_0x4a9fcf['has'](_0x130228)){const _0x1dabcf=new Error(_0x4a9fcf[_0x34042e(0x132)]===0x0?_0x34042e(0x26e):_0x34042e(0x24f)+_0x130228+_0x34042e(0x1ac));return _0x1dabcf[_0x34042e(0x205)]='FETCH_NOT_ALLOWED',Promise['reject'](_0x1dabcf);}}return fetch(_0x27ad7,_0x49577f);};}function _0x191e46(_0x19bc13={}){const _0x283992=_0x1d78,_0xed964b=_0x19bc13[_0x283992(0x201)]!==![],_0x406565=_0x19bc13[_0x283992(0x1cb)]??[],_0x384a6c={'Date':Date,'Math':Math,'JSON':JSON,'Array':Array,'Object':Object,'String':String,'Number':Number,'Boolean':Boolean,'Map':Map,'Set':Set,'Promise':Promise,'URL':URL,'URLSearchParams':URLSearchParams,'TextEncoder':TextEncoder,'TextDecoder':TextDecoder,'AbortController':AbortController,'AbortSignal':AbortSignal,'setTimeout':setTimeout,'clearTimeout':clearTimeout,'setInterval':setInterval,'clearInterval':clearInterval,'queueMicrotask':queueMicrotask,'structuredClone':structuredClone,'crypto':globalThis[_0x283992(0x227)]};return _0xed964b&&typeof fetch===_0x283992(0x249)&&(_0x384a6c[_0x283992(0x179)]=_0x55c56c(_0x406565)),_0x384a6c[_0x283992(0x128)]=_0x384a6c,_0x384a6c;}function _0x321dc5(_0x244443,_0x2d03d8={}){const _0x3a0773=_0x1d78,_0x3a784d=_0x191e46(_0x2d03d8),_0x5817d9=_0x3a8693[_0x3a0773(0x20c)](_0x3a784d,{'name':'okdb-function-sandbox','codeGeneration':{'strings':![],'wasm':![]}});let _0x4f25e3;try{_0x4f25e3=new _0x3a8693[(_0x3a0773(0x220))]('('+_0x244443+')',{'filename':_0x2d03d8[_0x3a0773(0x195)]??_0x3a0773(0x224)});}catch(_0x554b9b){const _0x425f06=new Error(_0x554b9b?.[_0x3a0773(0x165)]||_0x3a0773(0x244));_0x425f06[_0x3a0773(0x205)]=_0x3a0773(0x248),_0x425f06[_0x3a0773(0x19f)]=_0x554b9b;throw _0x425f06;}let _0x230836;try{_0x230836=_0x4f25e3[_0x3a0773(0x25d)](_0x5817d9,{'timeout':_0x2d03d8[_0x3a0773(0x1a7)]??0x64});}catch(_0x3d04de){const _0x413b5e=new Error(_0x3d04de?.[_0x3a0773(0x165)]||_0x3a0773(0x1c9));_0x413b5e['code']=_0x3a0773(0x248),_0x413b5e[_0x3a0773(0x19f)]=_0x3d04de;throw _0x413b5e;}if(typeof _0x230836!==_0x3a0773(0x249)){const _0x3046b3=new Error(_0x3a0773(0x256));_0x3046b3[_0x3a0773(0x205)]=_0x3a0773(0x218);throw _0x3046b3;}return _0x230836;}return okdbFunctionsSandbox={'createSandboxGlobals':_0x191e46,'compileFunctionExpression':_0x321dc5,'_buildRestrictedFetch':_0x55c56c},okdbFunctionsSandbox;}function _0x4abc(){const _0x523218=['upload','win32','_undoHooks','disable','query','license:invalid','sourceEnv','type:drop','\x20does\x20not\x20exist','env:removed','getTTL','txn:rollback','envName','remove','openEnv','stringify','loop-lag','system:env_release','reportOnFatalError','ref:violation','sync:apply','captureStackTrace','cancel','_admissionTimer','timeout','length','mkdirSync','result','allowFetch','txn:start','OKDBError','percentile','code','txn\x20ops\x20must\x20be\x20an\x20array','getIndex','getChanges','OKDBUniqueConstraintError','applyOps','requestedAt','createContext','cron','getByPrefix','requestId','getJob','stop','Type\x20\x27','index:ready','byIndex','fts:registered','emit','rollback','FUNCTION_SCRIPT_INVALID_SHAPE','license:added','onUndo','txn-commit','cursorKey','type:registered','functionName','bucket','Script','runtime','getClock','start','okdb-function.js','_closeReadTransaction','worker_threads','crypto','sourceType','TXN_ROLLBACK','getBucket','TXN_INVALID_ACTION','failures','INVALID_PRIMARY_KEY','geoQuery','\x20document(s)\x20reference\x20it\x20with\x20onDelete:restrict','uuid','pid','files','index:registered','registerIndex','stderr','FOREIGN_KEY_VIOLATION','warn','Index\x20\x27','1038591vFHdvy','fatal','createWriteFacade','OKDBForeignKeyDeleteError','fts:reset','removeJob','close','ms/','call','dropIndex','addBucket','Function\x20script\x20failed\x20to\x20compile','txnId','view:progress','materializerContext','FUNCTION_SCRIPT_COMPILE_FAILED','function','string','commit','envPath','_windowCbs','actions','fetch\x20blocked:\x20hostname\x20\x22','_timer','_buckets','delete','name','createEnvironment','readTransaction','Function\x20script\x20must\x20evaluate\x20to\x20a\x20callable\x20function','Cannot\x20set\x20enforce\x20schema\x20on\x20','_doHooks','setTTL','patch','Invalid\x20primary\x20key\x20type:\x20','creating','runInContext','timeoutMs','report','platform','directory','OKDBTypeAlreadyRegisteredError','getMany','isArray','./okdb','system:stopped','fieldPath','OKDBNotFoundError','priority','set','runId','Unknown\x20custom\x20function\x20error','Version\x20mismatch\x20for\x20','fetch\x20is\x20not\x20allowed\x20in\x20this\x20function\x20sandbox\x20(no\x20allowedFetchDomains\x20configured)','maxExtra','_admissionStarted','TXN_CLOSED','now','bind','schema:drop','processor','OKDBAlreadyExistsError','clearTTL','TXN_INVALID_OPS','VERSION_MISMATCH','ms\x20p99=','\x22\x20on\x20\x22','targetType','35DiidKg','job','getKeys','registerType','any','ready','item:create','reset','ttl:clear','excludeEnv','_closed','hasType','OKDBIndexNotRegisteredError','info','bus:env_release','index:progress','Transaction\x20already\x20closed','Unknown\x20OKDB\x20transaction\x20error','get','Invalid\x20index\x20key\x20type\x20for\x20\x27','INDEX_ALREADY_REGISTERED','595540YOFJQW','214iYLiIT','\x20references\x20',':\x20expected\x20','TXN_ERROR','signal','run','map','system:type_drop','env','registerFts','globalThis','write','okdb','url','abort','freeze','used_heap_size','prototype','clearTtl','ensureType','size','postMessage','OKDBIndexHasConsumersError','\x27,\x20cannot\x20map\x20to\x20\x27','unique:violation','getCount','started','bus:poke','Cannot\x20delete\x20','~system','key','INDEX_NOT_REGISTERED','updateJob','job_heartbeat','dropType','ttl:set','_report','exports','dryRun','entries','1545208VqqoKY','has','\x20documents\x20fail\x20validation','resetIndex','args','(worst\x20','ttl','\x27\x20on\x20type\x20\x27','useReadTransaction','push','txn','payload','hostname','49926Jvlzel','sweepExpiredTTL','sandbox-','create','.\x20Primary\x20keys\x20must\x20be\x20string\x20or\x20number.\x20Got:\x20','\x20which\x20does\x20not\x20exist','log','getIndexStatus','\x27\x20already\x20registered','transaction\x20commit\x20failed','Unique\x20constraint\x20violated\x20on\x20','put','OKDBSchemaValidationError','clearDefaultTTL','references','action','16sXsqdX',':\x20key\x20[','message','cancelled\x20by\x20caller','enqueue','hasOwnProperty','system:drain','getByPath','OKDBTypeNotRegisteredError','TYPE_NOT_REGISTERED','ms\x20busy=','errors','enable','bus:drain','actionCount','\x27\x20is\x20already\x20registered','SCHEMA_VALIDATION_FAILED','INVALID_VALUE','OKDBForeignKeyError','getRange','_envs','fts:drop','fetch','tries','starting','unref','resetFts','hasIndex','claimId','maxMs','stream','setTtl','range','default','OKDBVersionMismatchError','targetEnv','system:ready','transaction','ref:violation_resolved','options','ttl:expired','getValues','_writer','ms\x20max=','.okdb-function.js','type','enabled','update','INVALID_INDEX_KEY','events','filename','ttlStats','materializer','queue','license:removed','FOREIGN_KEY_DELETE_RESTRICTED','getEntry','setDefaultTTL','INDEX_HAS_CONSUMERS','_startAdmission','cause','script','schema:set','jobContext','tags','_assertOpen','resetting','sourceKey','compileTimeoutMs','NOT_FOUND','Unknown\x20transaction\x20action:\x20','_log','kind','\x22\x20is\x20not\x20in\x20the\x20allowedFetchDomains\x20list','6444JOKcBy','targetKey','created','item:remove','dryRunActions','index:reset','listBuckets',',\x20got\x20','details','\x27\x20doesn\x27t\x20exist','UNIQUE_CONSTRAINT','debug','object','reject','fetch\x20blocked:\x20invalid\x20URL','mode','processorContext','error','toFixed','_started','engineKey','stack','1390400UIJEjX','version','stopping','keys','sdk','exit','Function\x20script\x20failed\x20to\x20initialize','unsafe','allowedFetchDomains','list','item:update','join','\x20already\x20exists','OKDBInvalidValueError','max','nativeCode','system:bus_state_change','OKDBSchemaCollectionError','hash','unique:violation_resolved','global','txn:end','116402XJqcMg','listTTL','Index\x20\x22',']\x20already\x20maps\x20to\x20\x27','stopped','count','reportOnSignal','TYPE_ALREADY_REGISTERED','value','add','OKDBInvalidPrimaryKeyError','__esModule'];_0x4abc=function(){return _0x523218;};return _0x4abc();}var okdbFunctionsIpc,hasRequiredOkdbFunctionsIpc;function requireOkdbFunctionsIpc(){if(hasRequiredOkdbFunctionsIpc)return okdbFunctionsIpc;hasRequiredOkdbFunctionsIpc=0x1;function _0x530694(_0x24702e){const _0x5f2b1d=_0x1d78;if(!_0x24702e)return null;return{'message':_0x24702e[_0x5f2b1d(0x165)]||String(_0x24702e),'stack':_0x24702e[_0x5f2b1d(0x1c2)]||null,'code':_0x24702e[_0x5f2b1d(0x205)]||null,'details':_0x24702e[_0x5f2b1d(0x1b5)]||null};}function _0x575957(_0x509c46){const _0x20ca9e=_0x1d78;if(!_0x509c46)return new Error(_0x20ca9e(0x26c));const _0x5e552f=new Error(_0x509c46[_0x20ca9e(0x165)]||String(_0x509c46));if(_0x509c46[_0x20ca9e(0x1c2)])_0x5e552f[_0x20ca9e(0x1c2)]=_0x509c46['stack'];if(_0x509c46[_0x20ca9e(0x205)])_0x5e552f['code']=_0x509c46[_0x20ca9e(0x205)];if(_0x509c46[_0x20ca9e(0x1b5)])_0x5e552f['details']=_0x509c46[_0x20ca9e(0x1b5)];return _0x5e552f;}return okdbFunctionsIpc={'serializeError':_0x530694,'deserializeError':_0x575957},okdbFunctionsIpc;}var okdbEnums,hasRequiredOkdbEnums;function _0x1d78(_0x4ae8c9,_0x22df4f){_0x4ae8c9=_0x4ae8c9-0x111;const _0x4abc94=_0x4abc();let _0x1d7808=_0x4abc94[_0x4ae8c9];return _0x1d7808;}function requireOkdbEnums(){const _0x339720=_0x2c7ed1;if(hasRequiredOkdbEnums)return okdbEnums;hasRequiredOkdbEnums=0x1;const _0x93ffe3={'PUT':_0x339720(0x15e),'REMOVE':_0x339720(0x1f2),'INDEX_DROP':_0x339720(0x242),'INDEX_REGISTER':'registerIndex','INDEX_RESET':_0x339720(0x149),'TYPE_REGISTER':_0x339720(0x280),'TYPE_DROP':_0x339720(0x140),'FTS_REGISTER':_0x339720(0x127),'FTS_DROP':'dropFts','FTS_RESET':_0x339720(0x17d),'SCHEMA_SET':'setSchema','SCHEMA_DROP':'dropSchema','TTL_SET':_0x339720(0x182),'TTL_CLEAR':_0x339720(0x130)},_0x2d2c22={'SYSTEM_READY':_0x339720(0x187),'SYSTEM_STOPPED':_0x339720(0x266),'SYSTEM_CLOCK_CHANGE':'system:clock_change','SYSTEM_POKE':'system:poke','SYSTEM_DRAIN':_0x339720(0x169),'SYSTEM_TYPE_DROP':_0x339720(0x125),'SYSTEM_PROC':'system:proc','SYSTEM_BUS_STATE_CHANGE':_0x339720(0x1d3),'ITEM_CREATE':_0x339720(0x283),'ITEM_UPDATE':_0x339720(0x1cd),'ITEM_REMOVE':_0x339720(0x1b0),'INDEX_RESET':_0x339720(0x1b2),'INDEX_READY':_0x339720(0x213),'INDEX_PROGRESS':_0x339720(0x117),'VIEW_PROGRESS':_0x339720(0x246),'INDEX_DROP':'index:drop','INDEX_REGISTERED':_0x339720(0x233),'FTS_REGISTERED':_0x339720(0x215),'FTS_DROP':_0x339720(0x178),'FTS_RESET':_0x339720(0x23d),'SCHEMA_SET':_0x339720(0x1a1),'SCHEMA_DROP':_0x339720(0x274),'UNIQUE_VIOLATION':_0x339720(0x136),'UNIQUE_VIOLATION_RESOLVED':_0x339720(0x1d6),'REF_VIOLATION':_0x339720(0x1f8),'REF_VIOLATION_RESOLVED':_0x339720(0x189),'SYNC_APPLY':_0x339720(0x1f9),'TXN_START':_0x339720(0x202),'TXN_END':_0x339720(0x1d8),'TXN_ROLLBACK':_0x339720(0x1f0),'TYPE_REGISTERED':_0x339720(0x21d),'TYPE_DROP':_0x339720(0x1ec),'ENV_OPENED':'env:opened','ENV_REMOVED':_0x339720(0x1ee),'SYSTEM_ENV_RELEASE':_0x339720(0x1f6),'TTL_EXPIRED':_0x339720(0x18b),'TTL_SET':_0x339720(0x141),'TTL_CLEAR':_0x339720(0x285),'LICENSE_INVALID':_0x339720(0x1ea),'LICENSE_ADDED':_0x339720(0x219),'LICENSE_ACTIVATED':'license:activated','LICENSE_REMOVED':_0x339720(0x199)},_0x28f175={'CREATING':_0x339720(0x25c),'RESETTING':'resetting','READY':_0x339720(0x282),'DROPPING':'dropping','WAITING':'waiting'},_0x168272={'CREATED':_0x339720(0x1af),'STARTING':_0x339720(0x17b),'STARTED':_0x339720(0x138),'STOPPING':_0x339720(0x1c5),'STOPPED':'stopped'},_0x2105c0={'CREATING':'creating','READY':'ready','HALTED':'halted','STOPPED':_0x339720(0x1dd),'RESETTING':_0x339720(0x1a5)},_0x48638e=Object[_0x339720(0x12d)]({'POKE':_0x339720(0x139),'DRAIN':_0x339720(0x170),'TYPE_DROP':'bus:type_drop','PROC':'bus:proc','ENV_RELEASE':_0x339720(0x116)});return okdbEnums={'BUS_EVENTS':_0x48638e,'CHANGE_ACTIONS':_0x93ffe3,'EVENTS':_0x2d2c22,'INDEX_STATE':_0x28f175,'OKDB_STATE':_0x168272,'VIEW_STATE':_0x2105c0},okdbEnums;}var okdbError,hasRequiredOkdbError;function requireOkdbError(){if(hasRequiredOkdbError)return okdbError;hasRequiredOkdbError=0x1;class _0x39f2f6 extends Error{constructor(_0x5e68fe,_0x1948b9,_0x20267b={}){const _0x5d7ff0=_0x1d78;super(_0x5e68fe),this[_0x5d7ff0(0x253)]=_0x5d7ff0(0x203),this['code']=_0x1948b9,this[_0x5d7ff0(0x1b5)]=_0x20267b,_0x20267b[_0x5d7ff0(0x19f)]&&(this[_0x5d7ff0(0x19f)]=_0x20267b['cause']),Error[_0x5d7ff0(0x1fa)](this,this['constructor']);}}class _0xf4f53f extends _0x39f2f6{constructor(_0x3a3e87,_0x42a4d1,_0x4c43ed,_0x45bd53){const _0xff10a7=_0x1d78;super(_0xff10a7(0x26d)+_0x3a3e87+'@'+_0x42a4d1+_0xff10a7(0x120)+_0x4c43ed+_0xff10a7(0x1b4)+_0x45bd53,_0xff10a7(0x279),{'type':_0x3a3e87,'key':_0x42a4d1,'expectedVersion':_0x4c43ed,'actualVersion':_0x45bd53}),this['name']=_0xff10a7(0x185);}}class _0x5a4d1b extends _0x39f2f6{constructor(_0x10599b,_0x1508da){const _0x464d5f=_0x1d78;super(_0x10599b+'@'+_0x1508da+_0x464d5f(0x1ed),_0x464d5f(0x1a8),{'type':_0x10599b,'key':_0x1508da}),this[_0x464d5f(0x253)]=_0x464d5f(0x268);}}class _0x21969f extends _0x39f2f6{constructor(_0x56e2ee,_0x5aaf3f){const _0x27dc60=_0x1d78;super(_0x56e2ee+'@'+_0x5aaf3f+_0x27dc60(0x1cf),'ALREADY_EXISTS',{'type':_0x56e2ee,'key':_0x5aaf3f}),this[_0x27dc60(0x253)]=_0x27dc60(0x276);}}class _0x5d8a16 extends _0x39f2f6{constructor(_0x8ff56,_0x7d24c6){const _0x37d0dd=_0x1d78,_0x57d37d=typeof _0x7d24c6;super(_0x37d0dd(0x11b)+_0x8ff56+'\x27:\x20'+_0x57d37d+'.\x20Only\x20primitives,\x20null,\x20Buffers,\x20and\x20arrays\x20are\x20allowed.\x20Got:\x20'+_0x7d24c6,_0x37d0dd(0x193),{'index':_0x8ff56,'key':_0x7d24c6,'keyType':_0x57d37d}),this[_0x37d0dd(0x253)]='OKDBInvalidIndexKeyError';}}class _0x45f366 extends _0x39f2f6{constructor(_0x3afd21){const _0x3b6bd1=_0x1d78,_0x3d8027=typeof _0x3afd21;super(_0x3b6bd1(0x25b)+_0x3d8027+_0x3b6bd1(0x157)+_0x3afd21,_0x3b6bd1(0x22d),{'key':_0x3afd21,'keyType':_0x3d8027}),this[_0x3b6bd1(0x253)]=_0x3b6bd1(0x1e3);}}class _0x5c8bf4 extends _0x39f2f6{constructor(_0x4eff27){const _0x99a9b8=_0x1d78;super(_0x99a9b8(0x212)+_0x4eff27+'\x27\x20doesn\x27t\x20exist',_0x99a9b8(0x16c),{'type':_0x4eff27}),this['name']=_0x99a9b8(0x16b);}}class _0x54f48d extends _0x39f2f6{constructor(_0x2f8736){const _0x2b5aad=_0x1d78;super(_0x2b5aad(0x212)+_0x2f8736+_0x2b5aad(0x15b),_0x2b5aad(0x1e0),{'type':_0x2f8736}),this['name']=_0x2b5aad(0x262);}}class _0x3e4bab extends _0x39f2f6{constructor(_0x4d194b,_0x508d08){const _0x24c128=_0x1d78;super('Index\x20\x27'+_0x508d08+_0x24c128(0x14d)+_0x4d194b+_0x24c128(0x1b6),_0x24c128(0x13d),{'type':_0x4d194b,'index':_0x508d08}),this[_0x24c128(0x253)]=_0x24c128(0x114);}}class _0x34082d extends _0x39f2f6{constructor(_0xff10e3,_0x59f3a0){const _0x53afc6=_0x1d78;super(_0x53afc6(0x238)+_0x59f3a0+_0x53afc6(0x14d)+_0xff10e3+_0x53afc6(0x172),_0x53afc6(0x11c),{'type':_0xff10e3,'index':_0x59f3a0}),this[_0x53afc6(0x253)]='OKDBIndexAlreadyRegisteredError';}}class _0x402536 extends _0x39f2f6{constructor(_0x2ca024,_0x5edaca={}){const _0x16adc9=_0x1d78;super(_0x2ca024,_0x16adc9(0x174),_0x5edaca),this[_0x16adc9(0x253)]=_0x16adc9(0x1d0);}}class _0xb4bee8 extends _0x39f2f6{constructor(_0x23bf62,_0x14698e,_0x455edb,_0x38d2bb,_0x11f3af){const _0x5ea66e=_0x1d78;super(_0x5ea66e(0x15d)+_0x23bf62+'@'+_0x14698e+_0x5ea66e(0x164)+_0x455edb+_0x5ea66e(0x1dc)+_0x38d2bb+_0x5ea66e(0x135)+_0x11f3af+'\x27',_0x5ea66e(0x1b7),{'type':_0x23bf62,'index':_0x14698e,'indexKey':_0x455edb,'existingKey':_0x38d2bb,'conflictingKey':_0x11f3af}),this[_0x5ea66e(0x253)]=_0x5ea66e(0x209);}}class _0x170891 extends _0x39f2f6{constructor(_0xf18f88,_0x522450,_0x50ff62){const _0x4a365d=_0x1d78;super('Schema\x20validation\x20failed\x20for\x20'+_0xf18f88+'@'+_0x522450,_0x4a365d(0x173),{'type':_0xf18f88,'key':_0x522450,'errors':_0x50ff62}),this[_0x4a365d(0x253)]=_0x4a365d(0x15f),this[_0x4a365d(0x190)]=_0xf18f88,this[_0x4a365d(0x13c)]=_0x522450,this[_0x4a365d(0x16e)]=_0x50ff62;}}class _0x2e07d5 extends _0x39f2f6{constructor(_0x1a4fb1,_0x3f0d8d){const _0x364362=_0x1d78;super(_0x364362(0x257)+_0x1a4fb1+':\x20'+_0x3f0d8d[_0x364362(0x1fe)]+_0x364362(0x148),'SCHEMA_COLLECTION_INVALID',{'type':_0x1a4fb1,'failures':_0x3f0d8d}),this[_0x364362(0x253)]=_0x364362(0x1d4),this[_0x364362(0x190)]=_0x1a4fb1,this[_0x364362(0x22c)]=_0x3f0d8d;}}class _0xe89c8d extends _0x39f2f6{constructor(_0x9de961,_0x42730b,_0x11b8e0,_0x225b0b,_0x49b5b1){const _0x26cbcb=_0x1d78;super('Foreign\x20key\x20violation:\x20'+_0x9de961+'@'+_0x42730b+'.'+_0x11b8e0+_0x26cbcb(0x11f)+_0x225b0b+'@'+_0x49b5b1+_0x26cbcb(0x158),_0x26cbcb(0x236),{'sourceType':_0x9de961,'sourceKey':_0x42730b,'fieldPath':_0x11b8e0,'targetType':_0x225b0b,'targetKey':_0x49b5b1}),this[_0x26cbcb(0x253)]=_0x26cbcb(0x175),this[_0x26cbcb(0x228)]=_0x9de961,this[_0x26cbcb(0x1a6)]=_0x42730b,this[_0x26cbcb(0x267)]=_0x11b8e0,this[_0x26cbcb(0x27c)]=_0x225b0b,this[_0x26cbcb(0x1ae)]=_0x49b5b1;}}class _0x4ab416 extends _0x39f2f6{constructor(_0x445acf,_0x3936a8,_0x32d82a){const _0xbe077=_0x1d78;super(_0xbe077(0x13a)+_0x445acf+'@'+_0x3936a8+':\x20'+_0x32d82a[_0xbe077(0x1fe)]+_0xbe077(0x22f),_0xbe077(0x19a),{'targetType':_0x445acf,'targetKey':_0x3936a8,'references':_0x32d82a}),this['name']=_0xbe077(0x23c),this[_0xbe077(0x27c)]=_0x445acf,this[_0xbe077(0x1ae)]=_0x3936a8,this[_0xbe077(0x161)]=_0x32d82a;}}class _0x1f0dba extends _0x39f2f6{constructor(_0x1cbb54,_0x5e69ae,_0x4c8646){const _0x120e0f=_0x1d78;super(_0x120e0f(0x1db)+_0x5e69ae+_0x120e0f(0x27b)+_0x1cbb54+'\x22\x20is\x20used\x20by:\x20'+_0x4c8646[_0x120e0f(0x124)](_0x2d4809=>_0x2d4809[_0x120e0f(0x1ab)]+':'+_0x2d4809[_0x120e0f(0x253)])[_0x120e0f(0x1ce)](',\x20'),_0x120e0f(0x19d),{'type':_0x1cbb54,'index':_0x5e69ae,'usedBy':_0x4c8646}),this[_0x120e0f(0x253)]=_0x120e0f(0x134);}}return okdbError={'OKDBError':_0x39f2f6,'OKDBVersionMismatchError':_0xf4f53f,'OKDBNotFoundError':_0x5a4d1b,'OKDBAlreadyExistsError':_0x21969f,'OKDBInvalidIndexKeyError':_0x5d8a16,'OKDBInvalidPrimaryKeyError':_0x45f366,'OKDBTypeNotRegisteredError':_0x5c8bf4,'OKDBTypeAlreadyRegisteredError':_0x54f48d,'OKDBIndexNotRegisteredError':_0x3e4bab,'OKDBIndexAlreadyRegisteredError':_0x34082d,'OKDBInvalidValueError':_0x402536,'OKDBUniqueConstraintError':_0xb4bee8,'OKDBSchemaValidationError':_0x170891,'OKDBSchemaCollectionError':_0x2e07d5,'OKDBForeignKeyError':_0xe89c8d,'OKDBForeignKeyDeleteError':_0x4ab416,'OKDBIndexHasConsumersError':_0x1f0dba},okdbError;}var okdbLoopMonitor,hasRequiredOkdbLoopMonitor;function requireOkdbLoopMonitor(){const _0x48a41b=_0x2c7ed1;if(hasRequiredOkdbLoopMonitor)return okdbLoopMonitor;hasRequiredOkdbLoopMonitor=0x1;const {monitorEventLoopDelay:_0x18ff31,performance:_0x1c8110}=require$$0$1,_0x4c1507=process.env.OKDB_LOOP_LAG==='1'||process.env.OKDB_LOOP_LAG==='true',_0x3f0c0c=Number(process.env.OKDB_LOOP_LAG_MS)||0x7d0,_0x4d0428=process.env.OKDB_LOOP_LAG_ALL==='1',_0x139a8e=Number(process.env.OKDB_LOOP_LAG_MIN_MS)||0x64;class _0x1e7ecc{constructor(){const _0x1d1a35=_0x1d78;this[_0x1d1a35(0x191)]=_0x4c1507,this[_0x1d1a35(0x251)]=new Map(),this['_h']=null,this['_timer']=null,this[_0x1d1a35(0x1c0)]=![],this[_0x1d1a35(0x1aa)]=(_0x5687f8,_0x1f0337)=>process[_0x1d1a35(0x235)][_0x1d1a35(0x129)](_0x5687f8+(_0x1f0337?'\x20'+JSON[_0x1d1a35(0x1f4)](_0x1f0337):'')+'\x0a');}[_0x48a41b(0x272)](){const _0x9ecaae=_0x48a41b;return _0x1c8110[_0x9ecaae(0x272)]();}['setLogger'](_0x574fa9){const _0x23747b=_0x48a41b;if(typeof _0x574fa9===_0x23747b(0x249))this[_0x23747b(0x1aa)]=_0x574fa9;}['note'](_0x1da940,_0x3c64f3,_0x14d537){const _0xaa92a9=_0x48a41b;if(!this['enabled'])return;let _0x40b21d=this['_buckets'][_0xaa92a9(0x11a)](_0x1da940);!_0x40b21d&&(_0x40b21d={'ms':0x0,'count':0x0,'maxMs':0x0,'maxExtra':''},this[_0xaa92a9(0x251)][_0xaa92a9(0x26a)](_0x1da940,_0x40b21d)),_0x40b21d['ms']+=_0x3c64f3,_0x40b21d[_0xaa92a9(0x1de)]+=0x1,_0x3c64f3>_0x40b21d[_0xaa92a9(0x180)]&&(_0x40b21d[_0xaa92a9(0x180)]=_0x3c64f3,_0x40b21d['maxExtra']=_0x14d537||'');}[_0x48a41b(0x223)](_0x3f716e){const _0x248850=_0x48a41b;if(!this[_0x248850(0x191)]||this[_0x248850(0x1c0)])return;this[_0x248850(0x1c0)]=!![];if(_0x3f716e)this[_0x248850(0x1aa)]=_0x3f716e;this['_h']=_0x18ff31({'resolution':0xa}),this['_h'][_0x248850(0x16f)](),this[_0x248850(0x250)]=setInterval(()=>this[_0x248850(0x142)](),_0x3f0c0c);if(this[_0x248850(0x250)][_0x248850(0x17c)])this['_timer'][_0x248850(0x17c)]();}['onWindow'](_0x74520e){const _0x23a95d=_0x48a41b;if(!this[_0x23a95d(0x24d)])this[_0x23a95d(0x24d)]=new Set();this['_windowCbs'][_0x23a95d(0x1e2)](_0x74520e);if(!this[_0x23a95d(0x1c0)])this[_0x23a95d(0x19e)]();}['offWindow'](_0x224161){const _0x147e45=_0x48a41b;this[_0x147e45(0x24d)]?.[_0x147e45(0x252)](_0x224161);}[_0x48a41b(0x19e)](){const _0xc4e63d=_0x48a41b;if(this[_0xc4e63d(0x270)])return;this[_0xc4e63d(0x270)]=!![];!this['_h']&&(this['_h']=_0x18ff31({'resolution':0xa}),this['_h'][_0xc4e63d(0x16f)]());const _0x18a0c9=_0x3f0c0c;this['_admissionTimer']=setInterval(()=>{const _0x10f18c=_0xc4e63d,_0x143fde=this['_h'];if(!_0x143fde)return;const _0x22d062=_0x143fde[_0x10f18c(0x204)](0x63)/0xf4240,_0x2fb06d=_0x143fde[_0x10f18c(0x1d1)]/0xf4240,_0x4ed8bf=_0x143fde['mean']/0xf4240;_0x143fde[_0x10f18c(0x284)]();if(this['_windowCbs'])for(const _0x4cc5a5 of this[_0x10f18c(0x24d)]){try{_0x4cc5a5({'p99Ms':_0x22d062,'maxMs':_0x2fb06d,'meanMs':_0x4ed8bf,'reportMs':_0x18a0c9});}catch{}}},_0x18a0c9);if(this['_admissionTimer']['unref'])this[_0xc4e63d(0x1fc)][_0xc4e63d(0x17c)]();}[_0x48a41b(0x142)](){const _0xf11dcb=_0x48a41b,_0xec383d=this['_h'],_0x240563=_0xec383d[_0xf11dcb(0x1d1)]/0xf4240,_0x5a506e=_0xec383d[_0xf11dcb(0x204)](0x63)/0xf4240,_0x56dbff=_0xec383d['mean']/0xf4240;_0xec383d[_0xf11dcb(0x284)]();const _0x5ee03a=[...this[_0xf11dcb(0x251)][_0xf11dcb(0x145)]()][_0xf11dcb(0x124)](([_0x3b9102,_0x4c8839])=>({'label':_0x3b9102,..._0x4c8839}))['sort']((_0x1a6fc8,_0x1261b7)=>_0x1261b7['ms']-_0x1a6fc8['ms'])['slice'](0x0,0x8);this['_buckets']['clear']();const _0x325456=_0x5ee03a['reduce']((_0x5d0c9d,_0x26db10)=>_0x5d0c9d+_0x26db10['ms'],0x0),_0x5c2ecf=_0x5ee03a['map'](_0x4e8a88=>_0x4e8a88['label']+'='+_0x4e8a88['ms']['toFixed'](0x0)+_0xf11dcb(0x240)+_0x4e8a88[_0xf11dcb(0x1de)]+(_0x4e8a88[_0xf11dcb(0x180)]>0x5?_0xf11dcb(0x14b)+_0x4e8a88[_0xf11dcb(0x180)][_0xf11dcb(0x1bf)](0x0)+'ms'+(_0x4e8a88[_0xf11dcb(0x26f)]?'\x20'+_0x4e8a88[_0xf11dcb(0x26f)]:'')+')':''));(_0x4d0428||_0x240563>=_0x139a8e)&&this[_0xf11dcb(0x1aa)]('loop-lag\x20'+_0x3f0c0c+_0xf11dcb(0x18e)+_0x240563['toFixed'](0x0)+_0xf11dcb(0x27a)+_0x5a506e['toFixed'](0x0)+'ms\x20mean='+_0x56dbff[_0xf11dcb(0x1bf)](0x0)+_0xf11dcb(0x16d)+_0x325456['toFixed'](0x0)+'ms'+(_0x5c2ecf[_0xf11dcb(0x1fe)]?'\x20│\x20'+_0x5c2ecf[_0xf11dcb(0x1ce)]('\x20\x20'):''),{'feature':_0xf11dcb(0x1f5)});if(this['_windowCbs'])for(const _0x6d87f2 of this[_0xf11dcb(0x24d)]){try{_0x6d87f2({'p99Ms':_0x5a506e,'maxMs':_0x240563,'meanMs':_0x56dbff,'reportMs':_0x3f0c0c});}catch{}}}[_0x48a41b(0x211)](){const _0x30adab=_0x48a41b;if(this[_0x30adab(0x250)])clearInterval(this[_0x30adab(0x250)]);if(this['_h'])this['_h'][_0x30adab(0x1e8)]();this[_0x30adab(0x250)]=null,this['_h']=null,this[_0x30adab(0x1c0)]=![];}}const _0x19e934=new _0x1e7ecc();if(_0x19e934['enabled'])_0x19e934[_0x48a41b(0x223)]();return okdbLoopMonitor={'LOOP':_0x19e934},okdbLoopMonitor;}var okdbTransaction,hasRequiredOkdbTransaction;function requireOkdbTransaction(){const _0x4e74ee=_0x2c7ed1;if(hasRequiredOkdbTransaction)return okdbTransaction;hasRequiredOkdbTransaction=0x1;const _0x3867c1=require$$0$2,{EVENTS:_0x5847d6}=requireOkdbEnums(),{OKDBError:_0x132856}=requireOkdbError(),{LOOP:_0x1629df}=requireOkdbLoopMonitor();function _0x1a1f2b(_0x2b2884){const _0x364be0=_0x1d78;return _0x2b2884[_0x364be0(0x124)](_0x83093a=>{const _0x3238d9=_0x364be0,[_0x2823b4,_0x29b1ac]=_0x83093a[_0x3238d9(0x14a)]||[];return{'action':_0x83093a[_0x3238d9(0x162)],'type':_0x2823b4,'key':_0x29b1ac};});}class _0x5af86d{[_0x4e74ee(0x12a)];[_0x4e74ee(0x24e)]=[];[_0x4e74ee(0x258)]=[];[_0x4e74ee(0x1e7)]=[];constructor(_0x42b6e1,_0x24c386={'useReadTransaction':![]}){const _0x5b55ac=_0x4e74ee;this['okdb']=_0x42b6e1,this[_0x5b55ac(0x18a)]=_0x24c386,this['id']=_0x3867c1['v4'](),this['readTransaction']=this[_0x5b55ac(0x18a)][_0x5b55ac(0x14e)]?this[_0x5b55ac(0x12a)]['db'][_0x5b55ac(0x14e)]():null,this['_closed']=![];}['onDo'](_0xc0ec4d){const _0x420fd6=_0x4e74ee;this['_doHooks'][_0x420fd6(0x14f)](_0xc0ec4d);}[_0x4e74ee(0x21a)](_0x15709f){const _0x44089f=_0x4e74ee;this[_0x44089f(0x1e7)]['push'](_0x15709f);}[_0x4e74ee(0x225)](){const _0x34e6f6=_0x4e74ee;if(!this['readTransaction'])return;try{this['readTransaction']['done']();}catch(_0x49b4b8){}this[_0x34e6f6(0x255)]=null;}[_0x4e74ee(0x1a4)](){const _0xd758b3=_0x4e74ee;if(this[_0xd758b3(0x112)])throw new _0x132856(_0xd758b3(0x118),_0xd758b3(0x271));}['get'](_0xf0c2a7,_0x4a47c6){return this['_assertOpen'](),this['okdb']['get'](_0xf0c2a7,_0x4a47c6,{'transaction':this['readTransaction']});}['getEntry'](_0x1c064b,_0x2aff47){const _0x415bd6=_0x4e74ee;return this[_0x415bd6(0x1a4)](),this[_0x415bd6(0x12a)][_0x415bd6(0x19b)](_0x1c064b,_0x2aff47,{'transaction':this[_0x415bd6(0x255)]});}[_0x4e74ee(0x263)](_0x3b30b0,_0x59b35d){const _0x179192=_0x4e74ee;return this[_0x179192(0x1a4)](),this[_0x179192(0x12a)][_0x179192(0x263)](_0x3b30b0,_0x59b35d,{'transaction':this[_0x179192(0x255)]});}[_0x4e74ee(0x176)](_0x36da6e,_0x391a34={}){const _0x5a09b6=_0x4e74ee;return this[_0x5a09b6(0x1a4)](),this[_0x5a09b6(0x12a)]['getRange'](_0x36da6e,{'transaction':this[_0x5a09b6(0x255)],..._0x391a34});}[_0x4e74ee(0x18c)](_0x5cde8d,_0x278a8d={}){return this['_assertOpen'](),this['okdb']['getValues'](_0x5cde8d,{'transaction':this['readTransaction'],..._0x278a8d});}['getKeys'](_0x5d6c8e,_0x2d6510={}){const _0x2546d9=_0x4e74ee;return this[_0x2546d9(0x1a4)](),this[_0x2546d9(0x12a)][_0x2546d9(0x27f)](_0x5d6c8e,{'transaction':this[_0x2546d9(0x255)],..._0x2d6510});}['byIndex'](_0x56e5b4,_0x899db,_0x3a0a9d={}){const _0xa85fc=_0x4e74ee;return this[_0xa85fc(0x1a4)](),this[_0xa85fc(0x12a)][_0xa85fc(0x214)](_0x56e5b4,_0x899db,{'transaction':this['readTransaction'],..._0x3a0a9d});}['query'](_0x1e78e8,_0x2d253f,_0x2a5afb={}){const _0x19a498=_0x4e74ee;return this['_assertOpen'](),this[_0x19a498(0x12a)][_0x19a498(0x1e9)](_0x1e78e8,_0x2d253f,{'transaction':this['readTransaction'],..._0x2a5afb});}['getClock'](_0x2831bb=null){const _0x158b5e=_0x4e74ee;return this[_0x158b5e(0x1a4)](),this['okdb'][_0x158b5e(0x222)](_0x2831bb,{'transaction':this[_0x158b5e(0x255)]});}['getCount'](_0x4f06c6){const _0x2361e6=_0x4e74ee;return this[_0x2361e6(0x1a4)](),this[_0x2361e6(0x12a)][_0x2361e6(0x137)](_0x4f06c6,{'transaction':this[_0x2361e6(0x255)]});}['put'](_0x2553c0,_0x203a68,_0x21e04f,{ifVersion:ifVersion=null,version:version=null,timestamp:timestamp=Date[_0x4e74ee(0x272)](),origin:origin=null,ttl:ttl=null}={}){const _0x57b2cd=_0x4e74ee;this['actions'][_0x57b2cd(0x14f)]({'action':_0x57b2cd(0x15e),'args':[_0x2553c0,_0x203a68,_0x21e04f,{'ifVersion':ifVersion,'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x4e74ee(0x192)](_0x26f080,_0x3da62c,_0x2769a1,{ifVersion:ifVersion=null,version:version=null,timestamp:timestamp=Date[_0x4e74ee(0x272)](),origin:origin=null,ttl:ttl=null}={}){const _0x28e300=_0x4e74ee;this[_0x28e300(0x24e)][_0x28e300(0x14f)]({'action':_0x28e300(0x192),'args':[_0x26f080,_0x3da62c,_0x2769a1,{'ifVersion':ifVersion,'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x4e74ee(0x25a)](_0x3e7474,_0x2a69ec,_0x18fcf4,{ifVersion:ifVersion=null,timestamp:timestamp=Date[_0x4e74ee(0x272)](),origin:origin=null,ttl:ttl=null}={}){const _0x2a7d56=_0x4e74ee;this[_0x2a7d56(0x24e)][_0x2a7d56(0x14f)]({'action':'patch','args':[_0x3e7474,_0x2a69ec,_0x18fcf4,{'ifVersion':ifVersion,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x4e74ee(0x156)](_0x4365d3,_0x20f457,_0x2d4544,{version:version=null,timestamp:timestamp=Date[_0x4e74ee(0x272)](),origin:origin=null,ttl:ttl=null}={}){const _0x3cce91=_0x4e74ee;this[_0x3cce91(0x24e)][_0x3cce91(0x14f)]({'action':_0x3cce91(0x156),'args':[_0x4365d3,_0x20f457,_0x2d4544,{'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x4e74ee(0x1f2)](_0x32ac7e,_0x2ff8dc,{ifVersion:ifVersion=null,timestamp:timestamp=Date['now'](),origin:origin=null}={}){const _0x2e4d4c=_0x4e74ee;this['actions'][_0x2e4d4c(0x14f)]({'action':_0x2e4d4c(0x1f2),'args':[_0x32ac7e,_0x2ff8dc,{'ifVersion':ifVersion,'timestamp':timestamp,'origin':origin}]});}['setTTL'](_0x513263,_0x559ce9,_0x4b7cfb){const _0x1364e6=_0x4e74ee;this['actions']['push']({'action':_0x1364e6(0x259),'args':[_0x513263,_0x559ce9,_0x4b7cfb]});}[_0x4e74ee(0x277)](_0x49df12,_0x5aa32b){const _0x57a898=_0x4e74ee;this[_0x57a898(0x24e)][_0x57a898(0x14f)]({'action':'clearTTL','args':[_0x49df12,_0x5aa32b]});}['rollback'](){const _0x2e41f9=_0x4e74ee;if(this[_0x2e41f9(0x112)])return;for(const _0x2c5d93 of this[_0x2e41f9(0x1e7)]){try{_0x2c5d93();}catch{}}this[_0x2e41f9(0x12a)][_0x2e41f9(0x194)][_0x2e41f9(0x216)](_0x5847d6[_0x2e41f9(0x229)],{'id':this['id']}),this[_0x2e41f9(0x24e)]=[],this[_0x2e41f9(0x225)](),this[_0x2e41f9(0x112)]=!![];}async[_0x4e74ee(0x24b)](){const _0x1621df=_0x4e74ee;if(this[_0x1621df(0x112)])throw new Error(_0x1621df(0x118));const _0x5ac287={'id':this['id'],'timestamp':Date[_0x1621df(0x272)](),'actions':this[_0x1621df(0x24e)]};this['okdb'][_0x1621df(0x194)][_0x1621df(0x216)](_0x5847d6['TXN_START'],_0x5ac287);try{const _0x59433e=_0x1629df[_0x1621df(0x191)]?_0x1629df[_0x1621df(0x272)]():0x0;await this[_0x1621df(0x12a)][_0x1621df(0x18d)][_0x1621df(0x188)](()=>{const _0x4deefb=_0x1621df;for(const _0x522b39 of this[_0x4deefb(0x24e)]){const _0xbed48e=this[_0x4deefb(0x12a)]['_'+_0x522b39[_0x4deefb(0x162)]];if(typeof _0xbed48e!==_0x4deefb(0x249))throw new Error(_0x4deefb(0x1a9)+_0x522b39[_0x4deefb(0x162)]);_0xbed48e['call'](this['okdb'],this,..._0x522b39['args']);}}),_0x1629df[_0x1621df(0x191)]&&_0x1629df['note'](_0x1621df(0x21b),_0x1629df[_0x1621df(0x272)]()-_0x59433e,(this[_0x1621df(0x12a)][_0x1621df(0x253)]??'?')+'\x20actions='+this[_0x1621df(0x24e)][_0x1621df(0x1fe)]);}catch(_0x2eb9c2){for(const _0x2f3ac6 of this[_0x1621df(0x1e7)]){try{_0x2f3ac6();}catch{}}this['_closeReadTransaction'](),this['_closed']=!![];if(_0x2eb9c2 instanceof _0x132856)throw _0x2eb9c2;const _0x243692={'cause':_0x2eb9c2,'env':this[_0x1621df(0x12a)]?.[_0x1621df(0x253)],'envPath':this[_0x1621df(0x12a)]?.['path'],'pid':process['pid'],'txnId':this['id'],'actionCount':this[_0x1621df(0x24e)]['length'],'actions':_0x1a1f2b(this[_0x1621df(0x24e)]),'nativeCode':_0x2eb9c2?.[_0x1621df(0x205)],'nativeName':_0x2eb9c2?.['name']};try{this[_0x1621df(0x12a)]?.[_0x1621df(0x159)]?.[_0x1621df(0x1be)]?.(_0x1621df(0x15c),{'env':_0x243692[_0x1621df(0x126)],'envPath':_0x243692[_0x1621df(0x24c)],'pid':_0x243692[_0x1621df(0x231)],'txnId':_0x243692[_0x1621df(0x245)],'actionCount':_0x243692[_0x1621df(0x171)],'actions':_0x243692['actions'],'nativeCode':_0x243692[_0x1621df(0x1d2)],'error':_0x2eb9c2?.[_0x1621df(0x165)],'stack':_0x2eb9c2?.[_0x1621df(0x1c2)]});}catch{}throw new _0x132856(_0x2eb9c2?.[_0x1621df(0x165)]||_0x1621df(0x119),_0x1621df(0x121),_0x243692);}this['okdb']['events'][_0x1621df(0x216)](_0x5847d6['TXN_END'],_0x5ac287);for(const _0xeed0e7 of this['_doHooks']){try{await _0xeed0e7();}catch{}}this[_0x1621df(0x24e)]=[],this['_closeReadTransaction'](),this[_0x1621df(0x112)]=!![];}static[_0x4e74ee(0x23b)](_0x5793d4){const _0x1f3aa9=_0x4e74ee;return Object[_0x1f3aa9(0x12d)]({'id':_0x5793d4['id'],'put':_0x5793d4[_0x1f3aa9(0x15e)][_0x1f3aa9(0x273)](_0x5793d4),'update':_0x5793d4['update'][_0x1f3aa9(0x273)](_0x5793d4),'patch':_0x5793d4[_0x1f3aa9(0x25a)][_0x1f3aa9(0x273)](_0x5793d4),'create':_0x5793d4['create'][_0x1f3aa9(0x273)](_0x5793d4),'remove':_0x5793d4[_0x1f3aa9(0x1f2)][_0x1f3aa9(0x273)](_0x5793d4),'setTTL':_0x5793d4[_0x1f3aa9(0x259)]['bind'](_0x5793d4),'clearTTL':_0x5793d4[_0x1f3aa9(0x277)]['bind'](_0x5793d4),'commit':_0x5793d4['commit'][_0x1f3aa9(0x273)](_0x5793d4),'rollback':_0x5793d4[_0x1f3aa9(0x217)][_0x1f3aa9(0x273)](_0x5793d4),'get':_0x5793d4['get'][_0x1f3aa9(0x273)](_0x5793d4),'getEntry':_0x5793d4[_0x1f3aa9(0x19b)][_0x1f3aa9(0x273)](_0x5793d4),'getMany':_0x5793d4['getMany'][_0x1f3aa9(0x273)](_0x5793d4),'getRange':_0x5793d4[_0x1f3aa9(0x176)][_0x1f3aa9(0x273)](_0x5793d4),'getValues':_0x5793d4[_0x1f3aa9(0x18c)]['bind'](_0x5793d4),'getKeys':_0x5793d4[_0x1f3aa9(0x27f)]['bind'](_0x5793d4),'byIndex':_0x5793d4[_0x1f3aa9(0x214)][_0x1f3aa9(0x273)](_0x5793d4),'query':_0x5793d4[_0x1f3aa9(0x1e9)][_0x1f3aa9(0x273)](_0x5793d4),'getClock':_0x5793d4['getClock'][_0x1f3aa9(0x273)](_0x5793d4),'getCount':_0x5793d4[_0x1f3aa9(0x137)][_0x1f3aa9(0x273)](_0x5793d4),'read':_0x5793d4,'raw':_0x5793d4});}static[_0x4e74ee(0x20a)](_0x1aea79,_0x205523=[]){const _0x5a23fd=_0x4e74ee;if(!Array[_0x5a23fd(0x264)](_0x205523))throw new _0x132856(_0x5a23fd(0x206),_0x5a23fd(0x278));for(const _0xe055b1 of _0x205523){if(Array[_0x5a23fd(0x264)](_0xe055b1)){const [_0x564264,..._0x5c9ca2]=_0xe055b1;if(typeof _0x1aea79[_0x564264]!==_0x5a23fd(0x249))throw new _0x132856(_0x5a23fd(0x1a9)+_0x564264,_0x5a23fd(0x22b),{'action':_0x564264});_0x1aea79[_0x564264](..._0x5c9ca2);continue;}if(!_0xe055b1||typeof _0xe055b1!==_0x5a23fd(0x1b9))throw new _0x132856('txn\x20op\x20must\x20be\x20an\x20object\x20or\x20tuple','TXN_INVALID_OP');const {action:_0x2cfa35}=_0xe055b1;if(typeof _0x2cfa35!==_0x5a23fd(0x24a)||typeof _0x1aea79[_0x2cfa35]!==_0x5a23fd(0x249))throw new _0x132856(_0x5a23fd(0x1a9)+_0x2cfa35,_0x5a23fd(0x22b),{'action':_0x2cfa35});switch(_0x2cfa35){case _0x5a23fd(0x15e):case _0x5a23fd(0x192):case _0x5a23fd(0x156):_0x1aea79[_0x2cfa35](_0xe055b1[_0x5a23fd(0x190)],_0xe055b1['key'],_0xe055b1[_0x5a23fd(0x1e1)],{..._0xe055b1['options'],'ttl':_0xe055b1[_0x5a23fd(0x14c)]??_0xe055b1[_0x5a23fd(0x18a)]?.[_0x5a23fd(0x14c)]??null});break;case _0x5a23fd(0x25a):_0x1aea79[_0x5a23fd(0x25a)](_0xe055b1['type'],_0xe055b1['key'],_0xe055b1['patch'],{..._0xe055b1[_0x5a23fd(0x18a)],'ttl':_0xe055b1[_0x5a23fd(0x14c)]??_0xe055b1[_0x5a23fd(0x18a)]?.[_0x5a23fd(0x14c)]??null});break;case _0x5a23fd(0x1f2):_0x1aea79[_0x5a23fd(0x1f2)](_0xe055b1[_0x5a23fd(0x190)],_0xe055b1[_0x5a23fd(0x13c)],_0xe055b1[_0x5a23fd(0x18a)]||{});break;case _0x5a23fd(0x259):_0x1aea79[_0x5a23fd(0x259)](_0xe055b1[_0x5a23fd(0x190)],_0xe055b1['key'],_0xe055b1['ttl']);break;case _0x5a23fd(0x277):_0x1aea79[_0x5a23fd(0x277)](_0xe055b1[_0x5a23fd(0x190)],_0xe055b1[_0x5a23fd(0x13c)]);break;default:throw new _0x132856('Unsupported\x20transaction\x20action:\x20'+_0x2cfa35,'TXN_INVALID_ACTION',{'action':_0x2cfa35});}}}static async[_0x4e74ee(0x123)](_0x40e062,_0xd82436,_0x53743a={}){const _0x47bd8b=_0x4e74ee,_0x6e3a4e=new _0x5af86d(_0x40e062,_0x53743a),_0x3c7670=_0x5af86d[_0x47bd8b(0x23b)](_0x6e3a4e);try{typeof _0xd82436===_0x47bd8b(0x249)?await _0xd82436(_0x3c7670):_0x5af86d[_0x47bd8b(0x20a)](_0x6e3a4e,_0xd82436||[]);const _0x59e642=_0x6e3a4e[_0x47bd8b(0x24e)][_0x47bd8b(0x1fe)];return await _0x6e3a4e['commit'](),{'id':_0x6e3a4e['id'],'actions':_0x59e642};}catch(_0x55d563){try{_0x6e3a4e[_0x47bd8b(0x217)]();}catch(_0x115d7c){}throw _0x55d563;}}}return okdbTransaction=_0x5af86d,okdbTransaction;}var okdbFunctionsFacades,hasRequiredOkdbFunctionsFacades;function requireOkdbFunctionsFacades(){if(hasRequiredOkdbFunctionsFacades)return okdbFunctionsFacades;hasRequiredOkdbFunctionsFacades=0x1;const _0x5becbd=requireOkdbTransaction();function _0x1d3b81(_0xfa17ee){const _0x1d742c=_0x1d78;return{'transaction':typeof _0xfa17ee['transaction']===_0x1d742c(0x249)?_0xfa17ee[_0x1d742c(0x188)][_0x1d742c(0x273)](_0xfa17ee):_0x18e772=>new _0x5becbd(_0xfa17ee,_0x18e772),'txn':typeof _0xfa17ee[_0x1d742c(0x150)]==='function'?_0xfa17ee[_0x1d742c(0x150)][_0x1d742c(0x273)](_0xfa17ee):(_0x2eba82,_0x303916)=>_0x5becbd[_0x1d742c(0x123)](_0xfa17ee,_0x2eba82,_0x303916)};}function _0x57f11e(_0x192db8){const _0xce997=_0x1d78;return{'name':_0x192db8[_0xce997(0x253)],..._0x1d3b81(_0x192db8),'put':_0x192db8[_0xce997(0x15e)][_0xce997(0x273)](_0x192db8),'update':_0x192db8[_0xce997(0x192)][_0xce997(0x273)](_0x192db8),'patch':_0x192db8[_0xce997(0x25a)][_0xce997(0x273)](_0x192db8),'create':_0x192db8['create'][_0xce997(0x273)](_0x192db8),'remove':_0x192db8[_0xce997(0x1f2)][_0xce997(0x273)](_0x192db8),'get':_0x192db8['get'][_0xce997(0x273)](_0x192db8),'getMany':_0x192db8[_0xce997(0x263)][_0xce997(0x273)](_0x192db8),'getEntry':_0x192db8[_0xce997(0x19b)][_0xce997(0x273)](_0x192db8),'getRange':_0x192db8[_0xce997(0x176)][_0xce997(0x273)](_0x192db8),'getValues':_0x192db8[_0xce997(0x18c)][_0xce997(0x273)](_0x192db8),'getKeys':_0x192db8[_0xce997(0x27f)][_0xce997(0x273)](_0x192db8),'getCount':_0x192db8[_0xce997(0x137)][_0xce997(0x273)](_0x192db8),'getByPrefix':_0x192db8[_0xce997(0x20e)][_0xce997(0x273)](_0x192db8),'getIndex':_0x192db8[_0xce997(0x207)][_0xce997(0x273)](_0x192db8),'byIndex':_0x192db8[_0xce997(0x214)][_0xce997(0x273)](_0x192db8),'query':_0x192db8[_0xce997(0x1e9)][_0xce997(0x273)](_0x192db8),'geoQuery':_0x192db8[_0xce997(0x22e)]['bind'](_0x192db8),'ftsQuery':_0x192db8['ftsQuery']['bind'](_0x192db8),'setTTL':_0x192db8['setTTL'][_0xce997(0x273)](_0x192db8),'getTTL':_0x192db8['getTTL'][_0xce997(0x273)](_0x192db8),'clearTTL':_0x192db8['clearTTL'][_0xce997(0x273)](_0x192db8),'sweepExpiredTTL':_0x192db8[_0xce997(0x154)][_0xce997(0x273)](_0x192db8),'listTTL':_0x192db8[_0xce997(0x1da)][_0xce997(0x273)](_0x192db8),'ttlStats':_0x192db8[_0xce997(0x196)][_0xce997(0x273)](_0x192db8),'setDefaultTTL':_0x192db8[_0xce997(0x19c)][_0xce997(0x273)](_0x192db8),'getDefaultTTL':_0x192db8['getDefaultTTL'][_0xce997(0x273)](_0x192db8),'clearDefaultTTL':_0x192db8['clearDefaultTTL'][_0xce997(0x273)](_0x192db8),'registerType':_0x192db8[_0xce997(0x280)]['bind'](_0x192db8),'ensureType':_0x192db8[_0xce997(0x131)][_0xce997(0x273)](_0x192db8),'hasType':_0x192db8['hasType'][_0xce997(0x273)](_0x192db8),'dropType':_0x192db8['dropType'][_0xce997(0x273)](_0x192db8),'registerIndex':_0x192db8['registerIndex'][_0xce997(0x273)](_0x192db8),'hasIndex':_0x192db8[_0xce997(0x17e)][_0xce997(0x273)](_0x192db8),'dropIndex':_0x192db8[_0xce997(0x242)][_0xce997(0x273)](_0x192db8),'resetIndex':_0x192db8['resetIndex']['bind'](_0x192db8),'indexReady':_0x192db8['indexReady'][_0xce997(0x273)](_0x192db8),'getIndexStatus':_0x192db8[_0xce997(0x15a)][_0xce997(0x273)](_0x192db8),'getClock':_0x192db8['getClock'][_0xce997(0x273)](_0x192db8),'getChanges':_0x192db8[_0xce997(0x208)][_0xce997(0x273)](_0x192db8),'count':_0x192db8[_0xce997(0x1de)][_0xce997(0x273)](_0x192db8),'range':_0x192db8[_0xce997(0x183)][_0xce997(0x273)](_0x192db8),'now':_0x192db8[_0xce997(0x272)][_0xce997(0x273)](_0x192db8)};}function _0x51ba7a(_0x33c266){const _0x124d2c=_0x1d78;if(!_0x33c266)return null;const _0x4e9815={};for(const _0x218e8c of[_0x124d2c(0x167),_0x124d2c(0x210),'list',_0x124d2c(0x13e),_0x124d2c(0x23e),_0x124d2c(0x243),_0x124d2c(0x22a),_0x124d2c(0x1b3)]){if(typeof _0x33c266[_0x218e8c]===_0x124d2c(0x249))_0x4e9815[_0x218e8c]=_0x33c266[_0x218e8c][_0x124d2c(0x273)](_0x33c266);}return Object[_0x124d2c(0x1c6)](_0x4e9815)[_0x124d2c(0x1fe)]?_0x4e9815:null;}function _0x5b6ebb(_0x485023){const _0x1b25f9=_0x1d78;if(!_0x485023)return null;const _0x564a5b={};for(const _0x1de119 of[_0x1b25f9(0x1e5),'stream',_0x1b25f9(0x1f2),'get',_0x1b25f9(0x1cc),_0x1b25f9(0x16a)]){if(typeof _0x485023[_0x1de119]===_0x1b25f9(0x249))_0x564a5b[_0x1de119]=_0x485023[_0x1de119][_0x1b25f9(0x273)](_0x485023);}return Object[_0x1b25f9(0x1c6)](_0x564a5b)['length']?_0x564a5b:null;}function _0x2b1153(_0x401e9f){const _0x4486f3=_0x1d78;return{'env':_0x401e9f[_0x4486f3(0x126)][_0x4486f3(0x273)](_0x401e9f),'createEnvironment':_0x401e9f[_0x4486f3(0x254)][_0x4486f3(0x273)](_0x401e9f),'removeEnvironment':_0x401e9f['removeEnvironment'][_0x4486f3(0x273)](_0x401e9f),'info':_0x401e9f[_0x4486f3(0x115)],..._0x1d3b81(_0x401e9f),'put':_0x401e9f[_0x4486f3(0x15e)][_0x4486f3(0x273)](_0x401e9f),'update':_0x401e9f[_0x4486f3(0x192)][_0x4486f3(0x273)](_0x401e9f),'patch':_0x401e9f[_0x4486f3(0x25a)][_0x4486f3(0x273)](_0x401e9f),'create':_0x401e9f['create'][_0x4486f3(0x273)](_0x401e9f),'remove':_0x401e9f[_0x4486f3(0x1f2)][_0x4486f3(0x273)](_0x401e9f),'get':_0x401e9f['get']['bind'](_0x401e9f),'getMany':_0x401e9f[_0x4486f3(0x263)]['bind'](_0x401e9f),'getEntry':_0x401e9f[_0x4486f3(0x19b)]['bind'](_0x401e9f),'getRange':_0x401e9f['getRange'][_0x4486f3(0x273)](_0x401e9f),'getValues':_0x401e9f[_0x4486f3(0x18c)][_0x4486f3(0x273)](_0x401e9f),'getKeys':_0x401e9f['getKeys'][_0x4486f3(0x273)](_0x401e9f),'getCount':_0x401e9f['getCount'][_0x4486f3(0x273)](_0x401e9f),'getByPrefix':_0x401e9f[_0x4486f3(0x20e)][_0x4486f3(0x273)](_0x401e9f),'getIndex':_0x401e9f[_0x4486f3(0x207)][_0x4486f3(0x273)](_0x401e9f),'byIndex':_0x401e9f[_0x4486f3(0x214)][_0x4486f3(0x273)](_0x401e9f),'query':_0x401e9f[_0x4486f3(0x1e9)]['bind'](_0x401e9f),'setTTL':_0x401e9f[_0x4486f3(0x259)][_0x4486f3(0x273)](_0x401e9f),'getTTL':_0x401e9f[_0x4486f3(0x1ef)][_0x4486f3(0x273)](_0x401e9f),'clearTTL':_0x401e9f[_0x4486f3(0x277)][_0x4486f3(0x273)](_0x401e9f),'sweepExpiredTTL':_0x401e9f['sweepExpiredTTL'][_0x4486f3(0x273)](_0x401e9f),'listTTL':_0x401e9f[_0x4486f3(0x1da)]['bind'](_0x401e9f),'ttlStats':_0x401e9f[_0x4486f3(0x196)][_0x4486f3(0x273)](_0x401e9f),'setDefaultTTL':_0x401e9f[_0x4486f3(0x19c)][_0x4486f3(0x273)](_0x401e9f),'getDefaultTTL':_0x401e9f['getDefaultTTL'][_0x4486f3(0x273)](_0x401e9f),'clearDefaultTTL':_0x401e9f[_0x4486f3(0x160)]['bind'](_0x401e9f),'ensureType':_0x401e9f[_0x4486f3(0x131)][_0x4486f3(0x273)](_0x401e9f),'registerType':_0x401e9f[_0x4486f3(0x280)][_0x4486f3(0x273)](_0x401e9f),'hasType':_0x401e9f[_0x4486f3(0x113)][_0x4486f3(0x273)](_0x401e9f),'dropType':_0x401e9f['dropType'][_0x4486f3(0x273)](_0x401e9f),'registerIndex':_0x401e9f[_0x4486f3(0x234)][_0x4486f3(0x273)](_0x401e9f),'hasIndex':_0x401e9f['hasIndex']['bind'](_0x401e9f),'dropIndex':_0x401e9f[_0x4486f3(0x242)][_0x4486f3(0x273)](_0x401e9f),'resetIndex':_0x401e9f[_0x4486f3(0x149)][_0x4486f3(0x273)](_0x401e9f),'indexReady':_0x401e9f['indexReady'][_0x4486f3(0x273)](_0x401e9f),'getIndexStatus':_0x401e9f[_0x4486f3(0x15a)]['bind'](_0x401e9f),'getClock':_0x401e9f[_0x4486f3(0x222)][_0x4486f3(0x273)](_0x401e9f),'getChanges':_0x401e9f[_0x4486f3(0x208)][_0x4486f3(0x273)](_0x401e9f),'queue':_0x401e9f[_0x4486f3(0x198)],'files':_0x401e9f[_0x4486f3(0x232)]};}return okdbFunctionsFacades={'createEnvFacade':_0x57f11e,'createQueueFacade':_0x51ba7a,'createFilesFacade':_0x5b6ebb,'createGlobalFacade':_0x2b1153},okdbFunctionsFacades;}var okdbFunctionsDryrun,hasRequiredOkdbFunctionsDryrun;function requireOkdbFunctionsDryrun(){const _0x10f12a=_0x2c7ed1;if(hasRequiredOkdbFunctionsDryrun)return okdbFunctionsDryrun;hasRequiredOkdbFunctionsDryrun=0x1;const _0x5db320=new Set([_0x10f12a(0x15e),_0x10f12a(0x25a),_0x10f12a(0x156),_0x10f12a(0x1f2),_0x10f12a(0x192),'setTTL',_0x10f12a(0x277),_0x10f12a(0x154),'setDefaultTTL',_0x10f12a(0x160),'dropType',_0x10f12a(0x242),'resetIndex']),_0x4b3aa6=new Set([_0x10f12a(0x167),'updateJob','removeJob',_0x10f12a(0x243)]),_0x157b0e=new Set([_0x10f12a(0x1e5),'remove']);function _0x39345f(_0x7ded98,_0x301a25){const _0x202e01=_0x10f12a;if(_0x7ded98===_0x202e01(0x126)||_0x7ded98===_0x202e01(0x1d7))return _0x5db320[_0x202e01(0x147)](_0x301a25);if(_0x7ded98===_0x202e01(0x198))return _0x4b3aa6[_0x202e01(0x147)](_0x301a25);if(_0x7ded98===_0x202e01(0x232))return _0x157b0e[_0x202e01(0x147)](_0x301a25);return![];}function _0x1121fb(_0x1082fb,_0x48d1df,_0x5bf8e4,_0x40c9da){if(!_0x1082fb)return _0x1082fb;return new Proxy(_0x1082fb,{'get'(_0x3b69ce,_0x180492,_0x355444){const _0x3275ca=_0x1d78,_0x173e87=Reflect[_0x3275ca(0x11a)](_0x3b69ce,_0x180492,_0x355444);if(typeof _0x173e87!=='function')return _0x173e87;if(!_0x39345f(_0x48d1df,_0x180492))return _0x173e87[_0x3275ca(0x273)](_0x3b69ce);return function(..._0x386015){const _0x187581=_0x3275ca;return _0x40c9da[_0x187581(0x14f)]({'scope':_0x48d1df,'method':_0x180492,'envName':_0x5bf8e4,'args':_0x386015}),null;};}});}function _0xec4e49(_0x4eaf20,_0x2a25e4,_0x536702,_0x2ab3ea){const _0x20eca4={};for(const _0x2b288f of _0x536702){_0x20eca4[_0x2b288f]=(..._0x5ed6eb)=>{const _0x2bc846=_0x1d78;return _0x39345f(_0x4eaf20,_0x2b288f)&&_0x2ab3ea[_0x2bc846(0x14f)]({'scope':_0x4eaf20,'method':_0x2b288f,'envName':_0x2a25e4,'args':_0x5ed6eb}),null;};}return _0x20eca4;}return okdbFunctionsDryrun={'isWriteMethod':_0x39345f,'wrapForDryRun':_0x1121fb,'syntheticDryRunFacade':_0xec4e49,'ENV_WRITE_METHODS':_0x5db320,'QUEUE_WRITE_METHODS':_0x4b3aa6,'FILES_WRITE_METHODS':_0x157b0e},okdbFunctionsDryrun;}var okdbFunctionsContext,hasRequiredOkdbFunctionsContext;function requireOkdbFunctionsContext(){const _0x57f005=_0x2c7ed1;if(hasRequiredOkdbFunctionsContext)return okdbFunctionsContext;hasRequiredOkdbFunctionsContext=0x1;const {createEnvFacade:_0x56dd3f,createQueueFacade:_0x57a025,createFilesFacade:_0x1e11c8,createGlobalFacade:_0x9f9b67}=requireOkdbFunctionsFacades(),{wrapForDryRun:_0x50b498,syntheticDryRunFacade:_0x41975c}=requireOkdbFunctionsDryrun(),_0xa63a88=[_0x57f005(0x167),_0x57f005(0x210),_0x57f005(0x1cc),_0x57f005(0x13e),_0x57f005(0x23e),_0x57f005(0x243),'getBucket','listBuckets'],_0x4a41b2=[_0x57f005(0x1e5),_0x57f005(0x181),_0x57f005(0x1f2),_0x57f005(0x11a),_0x57f005(0x1cc),_0x57f005(0x16a)];function _0x39aaa6(_0x72be09,_0x3a1fd9){const _0x59d782=_0x57f005,_0xa7e6bc=(_0x1e1f30,_0x4f0bd0,_0xddfbf6)=>_0x3a1fd9({'type':_0x59d782(0x159),'requestId':_0x72be09[_0x59d782(0x20f)],'runId':_0x72be09[_0x59d782(0x26b)],'entry':{'level':_0x1e1f30,'msg':_0x4f0bd0,'context':_0xddfbf6,'ts':Date[_0x59d782(0x272)]()}}),_0xd02866=(_0x380dc7,_0x76e738)=>_0xa7e6bc('info',_0x380dc7,_0x76e738);return _0xd02866['info']=(_0x5b1d5a,_0x3234ba)=>_0xa7e6bc('info',_0x5b1d5a,_0x3234ba),_0xd02866['warn']=(_0x40fbde,_0x14607a)=>_0xa7e6bc(_0x59d782(0x237),_0x40fbde,_0x14607a),_0xd02866[_0x59d782(0x1be)]=(_0x3cbce1,_0x30e138)=>_0xa7e6bc(_0x59d782(0x1be),_0x3cbce1,_0x30e138),_0xd02866['debug']=(_0xe5209c,_0x29b0d2)=>_0xa7e6bc(_0x59d782(0x1b8),_0xe5209c,_0x29b0d2),_0xd02866;}function _0x307a7e(_0x43764a,_0x1ab009,_0xc2e409){const _0x3ff36a=_0x57f005;if(!_0x43764a)return null;return{'id':_0x43764a['id']??null,'type':_0x43764a['type']??null,'tries':_0x43764a[_0x3ff36a(0x17a)]??null,'created':_0x43764a[_0x3ff36a(0x1af)]??null,'tags':_0x43764a[_0x3ff36a(0x1a3)]??null,'priority':_0x43764a[_0x3ff36a(0x269)]??null,'bucket':_0x43764a[_0x3ff36a(0x21f)]??null,'cron':_0x43764a[_0x3ff36a(0x20d)]??null,'heartbeat'(){const _0x16e0ff=_0x3ff36a;_0xc2e409({'type':_0x16e0ff(0x13f),'requestId':_0x1ab009[_0x16e0ff(0x20f)],'runId':_0x1ab009['runId'],'jobId':_0x43764a['id'],'claimId':_0x43764a[_0x16e0ff(0x17f)]});},'markProgress'(_0x4f795d){const _0x1163c3=_0x3ff36a;_0xc2e409({'type':'job_progress','requestId':_0x1ab009[_0x1163c3(0x20f)],'runId':_0x1ab009['runId'],'jobId':_0x43764a['id'],'claimId':_0x43764a['claimId'],'message':_0x4f795d});}};}function _0xc1553d(_0x40b263){const _0x15ca97=_0x57f005;if(!_0x40b263)return null;return{'mode':_0x40b263[_0x15ca97(0x1bc)]??null,'sourceType':_0x40b263['sourceType']??null,'sourceEnv':_0x40b263[_0x15ca97(0x1eb)]??null,'processor':_0x40b263[_0x15ca97(0x275)]??null,'engineKey':_0x40b263[_0x15ca97(0x1c1)]??null,'cursorKey':_0x40b263[_0x15ca97(0x21c)]??null};}function _0x448c58(_0x205e46){const _0x1f0edf=_0x57f005;if(!_0x205e46)return null;return{'mode':_0x205e46[_0x1f0edf(0x1bc)]??null,'sourceType':_0x205e46[_0x1f0edf(0x228)]??null,'targetType':_0x205e46[_0x1f0edf(0x27c)]??null,'sourceEnv':_0x205e46[_0x1f0edf(0x1eb)]??null,'targetEnv':_0x205e46[_0x1f0edf(0x186)]??null,'engineKey':_0x205e46['engineKey']??null,'cursorKey':_0x205e46[_0x1f0edf(0x21c)]??null};}function _0xb0ed37(_0x4c6876,_0x49b3df,_0x3595ee,_0x21daf9=null,_0x395e47=null){const _0x1fc518=_0x57f005,_0x13b805={'runId':_0x49b3df[_0x1fc518(0x26b)],'scope':_0x1fc518(0x126),'env':_0x49b3df['envName']??null,'functionName':_0x49b3df[_0x1fc518(0x21e)],'trigger':_0x49b3df[_0x1fc518(0x115)]?.['trigger']??_0x1fc518(0x1c7),'requestedAt':_0x49b3df[_0x1fc518(0x115)]?.[_0x1fc518(0x20b)]??Date[_0x1fc518(0x272)]()},_0x2ccaef=_0x39aaa6(_0x49b3df,_0x3595ee),_0x474063=AbortSignal[_0x1fc518(0x1fd)](Math[_0x1fc518(0x1d1)](0x1,_0x49b3df['runtime']?.[_0x1fc518(0x25e)]??0x3e8)),_0x1351e7=_0x395e47?AbortSignal[_0x1fc518(0x281)]([_0x474063,_0x395e47]):_0x474063,_0x26edd1=_0x4c6876[_0x1fc518(0x126)](_0x49b3df[_0x1fc518(0x1f1)]),_0x599aea=_0x21daf9?_0x50b498(_0x26edd1,_0x1fc518(0x126),_0x49b3df[_0x1fc518(0x1f1)],_0x21daf9):_0x26edd1,_0x4824e0=_0x21daf9?_0x26edd1['queue']?_0x50b498(_0x26edd1[_0x1fc518(0x198)],_0x1fc518(0x198),_0x49b3df[_0x1fc518(0x1f1)],_0x21daf9):_0x41975c(_0x1fc518(0x198),_0x49b3df[_0x1fc518(0x1f1)],_0xa63a88,_0x21daf9):_0x26edd1[_0x1fc518(0x198)],_0x24867a=_0x21daf9?_0x26edd1[_0x1fc518(0x232)]?_0x50b498(_0x26edd1['files'],_0x1fc518(0x232),_0x49b3df[_0x1fc518(0x1f1)],_0x21daf9):_0x41975c(_0x1fc518(0x232),_0x49b3df['envName'],_0x4a41b2,_0x21daf9):_0x26edd1['files'],_0x33523a=_0x56dd3f(_0x599aea),_0x34278f=_0x57a025(_0x4824e0),_0x5ba357=_0x1e11c8(_0x24867a);if(_0x34278f)_0x33523a['queue']=_0x34278f;if(_0x5ba357)_0x33523a[_0x1fc518(0x232)]=_0x5ba357;const _0x28fc92={'payload':_0x49b3df[_0x1fc518(0x151)]??null,'info':_0x13b805,'signal':_0x1351e7,'log':_0x2ccaef,'env':_0x33523a},_0x3c88e8=_0x307a7e(_0x49b3df[_0x1fc518(0x1a2)],_0x49b3df,_0x3595ee);if(_0x3c88e8)_0x28fc92[_0x1fc518(0x27e)]=_0x3c88e8;const _0x337eca=_0xc1553d(_0x49b3df[_0x1fc518(0x1bd)]);if(_0x337eca)_0x28fc92[_0x1fc518(0x275)]=_0x337eca;const _0x1778eb=_0x448c58(_0x49b3df[_0x1fc518(0x247)]);if(_0x1778eb)_0x28fc92[_0x1fc518(0x197)]=_0x1778eb;if(_0x49b3df[_0x1fc518(0x1ca)]){const _0x5d5915=_0x21daf9?_0x50b498(_0x4c6876,_0x1fc518(0x1d7),null,_0x21daf9):_0x4c6876;_0x28fc92['okdb']=_0x9f9b67(_0x5d5915);}return _0x28fc92;}return okdbFunctionsContext={'createExecutionContext':_0xb0ed37,'createScriptLogger':_0x39aaa6},okdbFunctionsContext;}var hasRequiredOkdbFunctionsSandboxWorker;function requireOkdbFunctionsSandboxWorker(){if(hasRequiredOkdbFunctionsSandboxWorker)return okdbFunctionsSandboxWorker$1;hasRequiredOkdbFunctionsSandboxWorker=0x1;const {parentPort:_0x1ff91d,workerData:_0x277fa3}=require$$0$3;requireOkdbFatalReport()['enableFatalReport']('sandbox');const _0x3d4e1d=require$$2,{compileFunctionExpression:_0xd50e6d}=requireOkdbFunctionsSandbox(),{serializeError:_0x4143c5}=requireOkdbFunctionsIpc(),{createExecutionContext:_0x452ae8}=requireOkdbFunctionsContext(),_0x56df09=require$$6;let _0x28c902=null,_0x627b10=![];const _0xcd5326=new Map(),_0x17147e=new Map();function _0x210992(_0x4f816a){const _0xb3f235=_0x1d78;try{_0x1ff91d[_0xb3f235(0x133)](_0x4f816a);}catch{}}function _0x412a24(_0x53b8b7){const _0x4d1476=_0x1d78,_0x453685=(_0x53b8b7['envName']||_0x4d1476(0x13b))+':'+_0x53b8b7[_0x4d1476(0x21e)]+':'+_0x53b8b7[_0x4d1476(0x1c4)]+':'+_0x53b8b7[_0x4d1476(0x1d5)];let _0x4d7522=_0xcd5326[_0x4d1476(0x11a)](_0x453685);return!_0x4d7522&&(_0x4d7522=_0xd50e6d(_0x53b8b7[_0x4d1476(0x1a0)],{'allowFetch':_0x53b8b7[_0x4d1476(0x221)]?.[_0x4d1476(0x201)]!==![],'allowedFetchDomains':_0x53b8b7[_0x4d1476(0x221)]?.[_0x4d1476(0x1cb)],'filename':_0x53b8b7[_0x4d1476(0x21e)]+_0x4d1476(0x18f)}),_0xcd5326[_0x4d1476(0x26a)](_0x453685,_0x4d7522)),_0x4d7522;}async function _0xf45c9a(_0x4da3bd){const _0x39db9b=_0x1d78,_0x371674=Date[_0x39db9b(0x272)](),_0x3faeef=new AbortController();_0x17147e[_0x39db9b(0x26a)](_0x4da3bd[_0x39db9b(0x20f)],_0x3faeef);try{const _0x2c6f6c=_0x412a24(_0x4da3bd);if(_0x4da3bd[_0x39db9b(0x1f1)])await _0x28c902[_0x39db9b(0x1f3)](_0x4da3bd[_0x39db9b(0x1f1)]);const _0x482f04=_0x4da3bd[_0x39db9b(0x144)]?[]:null,_0x1f3990=_0x452ae8(_0x28c902,_0x4da3bd,_0x210992,_0x482f04,_0x3faeef[_0x39db9b(0x122)]),_0x5f0a62=await _0x2c6f6c(_0x1f3990),_0x26d604={'type':_0x39db9b(0x200),'requestId':_0x4da3bd[_0x39db9b(0x20f)],'runId':_0x4da3bd[_0x39db9b(0x26b)],'result':_0x5f0a62,'meta':{'runnerId':'sandbox-'+process[_0x39db9b(0x231)],'startedAt':_0x371674,'finishedAt':Date[_0x39db9b(0x272)](),'durationMs':Date[_0x39db9b(0x272)]()-_0x371674}};if(_0x482f04)_0x26d604[_0x39db9b(0x1b1)]=_0x482f04;_0x210992(_0x26d604);}catch(_0x10d338){_0x210992({'type':_0x39db9b(0x1be),'requestId':_0x4da3bd[_0x39db9b(0x20f)],'runId':_0x4da3bd['runId'],'error':_0x4143c5(_0x10d338),'meta':{'runnerId':_0x39db9b(0x155)+process[_0x39db9b(0x231)],'startedAt':_0x371674,'finishedAt':Date[_0x39db9b(0x272)](),'durationMs':Date['now']()-_0x371674}});}finally{_0x17147e['delete'](_0x4da3bd[_0x39db9b(0x20f)]);}}async function _0x41caea(){const _0x5d6d0b=_0x1d78;if(_0x627b10)return;_0x627b10=!![];try{await _0x28c902?.[_0x5d6d0b(0x23f)]?.();}catch{}process[_0x5d6d0b(0x1c8)](0x0);}async function _0x311c64(){const _0x3c4b70=_0x1d78,{rootPath:_0x571df4}=_0x277fa3??{};if(!_0x571df4)throw new Error('sandbox\x20worker:\x20rootPath\x20missing\x20from\x20workerData');_0x28c902=new _0x56df09(_0x571df4,{'engines':![],'processors':![],'compaction':![],'http':![],'auth':{'open':!![]},'processes':![]}),await _0x28c902['open']();const _0x4e2763=setInterval(()=>{const _0x37c98b=_0x1d78;if(_0x627b10)return;for(const [,_0x39782b]of _0x28c902[_0x37c98b(0x177)]){try{_0x39782b['_drainHandler']?.();}catch{}}},0xc8);if(typeof _0x4e2763['unref']===_0x3c4b70(0x249))_0x4e2763['unref']();_0x1ff91d['on']('message',_0x28f1f9=>{const _0x4a45e1=_0x3c4b70;if(!_0x28f1f9||typeof _0x28f1f9!==_0x4a45e1(0x1b9))return;if(_0x28f1f9[_0x4a45e1(0x190)]===_0x4a45e1(0x211))return void _0x41caea();if(_0x28f1f9[_0x4a45e1(0x190)]===_0x4a45e1(0x1fb)){_0x17147e['get'](_0x28f1f9[_0x4a45e1(0x20f)])?.[_0x4a45e1(0x12c)](new Error(_0x4a45e1(0x166)));return;}_0x28f1f9[_0x4a45e1(0x190)]==='run'&&void _0xf45c9a(_0x28f1f9['job']);});const _0x57b213=Math[_0x3c4b70(0x1d1)](0x3e8,Number(process.env.OKDB_STATS_INTERVAL_MS)||0x1388),_0x324603=setInterval(()=>{const _0x2649cb=_0x3c4b70;try{_0x210992({'type':'stats','heapUsed':_0x3d4e1d['getHeapStatistics']()[_0x2649cb(0x12e)]});}catch{}},_0x57b213);if(typeof _0x324603[_0x3c4b70(0x17c)]===_0x3c4b70(0x249))_0x324603[_0x3c4b70(0x17c)]();_0x210992({'type':'ready'});}return _0x311c64()['catch'](_0x437f2b=>{const _0x4e91d1=_0x1d78;_0x210992({'type':_0x4e91d1(0x23a),'error':_0x4143c5(_0x437f2b)}),process[_0x4e91d1(0x1c8)](0x1);}),okdbFunctionsSandboxWorker$1;}var okdbFunctionsSandboxWorkerExports=requireOkdbFunctionsSandboxWorker(),okdbFunctionsSandboxWorker=getDefaultExportFromCjs(okdbFunctionsSandboxWorkerExports);module[_0x2c7ed1(0x143)]=okdbFunctionsSandboxWorker;
1
+ 'use strict';const _0x54ea2d=_0x6ed6;(function(_0x5e145a,_0x557da4){const _0x38ebaa=_0x6ed6,_0x417988=_0x5e145a();while(!![]){try{const _0x387875=-parseInt(_0x38ebaa(0x26d))/0x1+parseInt(_0x38ebaa(0x249))/0x2*(-parseInt(_0x38ebaa(0x1df))/0x3)+-parseInt(_0x38ebaa(0x14d))/0x4+parseInt(_0x38ebaa(0x124))/0x5+parseInt(_0x38ebaa(0x1bd))/0x6*(parseInt(_0x38ebaa(0x23b))/0x7)+-parseInt(_0x38ebaa(0x24f))/0x8*(-parseInt(_0x38ebaa(0xfd))/0x9)+parseInt(_0x38ebaa(0x187))/0xa;if(_0x387875===_0x557da4)break;else _0x417988['push'](_0x417988['shift']());}catch(_0x102f6a){_0x417988['push'](_0x417988['shift']());}}}(_0x45d1,0x37723));var require$$0$3=require('worker_threads'),require$$2=require('v8'),require$$0=require('node:vm'),require$$0$2=require(_0x54ea2d(0x1f3)),require$$0$1=require(_0x54ea2d(0x1c0)),require$$6=require('./okdb');function getDefaultExportFromCjs(_0x5cbe80){const _0x4e8b65=_0x54ea2d;return _0x5cbe80&&_0x5cbe80[_0x4e8b65(0x177)]&&Object[_0x4e8b65(0x1dd)][_0x4e8b65(0x11b)][_0x4e8b65(0x161)](_0x5cbe80,_0x4e8b65(0x1b7))?_0x5cbe80['default']:_0x5cbe80;}var okdbFunctionsSandboxWorker$1={},okdbFatalReport,hasRequiredOkdbFatalReport;function requireOkdbFatalReport(){if(hasRequiredOkdbFatalReport)return okdbFatalReport;hasRequiredOkdbFatalReport=0x1;function _0x5a730a(_0x1a6bd9){const _0x3a9d5b=_0x6ed6;if(process.env.OKDB_FATAL_REPORT!=='1')return;try{if(!process[_0x3a9d5b(0x24d)])return;process[_0x3a9d5b(0x24d)]['reportOnFatalError']=!![];try{if(_0x3a9d5b(0x233)in process[_0x3a9d5b(0x24d)])process[_0x3a9d5b(0x24d)][_0x3a9d5b(0x233)]=process.env.OKDB_FATAL_REPORT_ENV!=='1';}catch{}if(process['platform']!==_0x3a9d5b(0x141))try{process['report'][_0x3a9d5b(0x16c)]=!![];if(typeof process['report'][_0x3a9d5b(0x116)]===_0x3a9d5b(0x1b2))process[_0x3a9d5b(0x24d)][_0x3a9d5b(0x116)]='SIGSEGV';}catch{}if(process.env.OKDB_REPORT_DIR)try{require('fs')[_0x3a9d5b(0x24a)](process.env.OKDB_REPORT_DIR,{'recursive':!![]}),process[_0x3a9d5b(0x24d)][_0x3a9d5b(0x1f9)]=process.env.OKDB_REPORT_DIR;}catch{}try{process[_0x3a9d5b(0x24d)][_0x3a9d5b(0x17f)]='';}catch{}if(_0x1a6bd9)process.env.OKDB_REPORT_TAG=String(_0x1a6bd9);}catch{}}return okdbFatalReport={'enableFatalReport':_0x5a730a},okdbFatalReport;}var okdbFunctionsSandbox,hasRequiredOkdbFunctionsSandbox;function requireOkdbFunctionsSandbox(){if(hasRequiredOkdbFunctionsSandbox)return okdbFunctionsSandbox;hasRequiredOkdbFunctionsSandbox=0x1;const _0x385737=require$$0;function _0x183028(_0x17957f){const _0x34d404=_0x6ed6,_0x3ce6e6=_0x17957f==='*',_0x225865=_0x3ce6e6?null:new Set(Array[_0x34d404(0x1a9)](_0x17957f)?_0x17957f:[]);return function _0x5c40ba(_0xb559c7,_0xbf4e19){const _0x144a27=_0x34d404;if(!_0x3ce6e6){let _0x19d6b2;try{const _0x47c1af=new URL(typeof _0xb559c7===_0x144a27(0x1b2)?_0xb559c7:_0xb559c7?.[_0x144a27(0x156)]??String(_0xb559c7));_0x19d6b2=_0x47c1af[_0x144a27(0x178)];}catch{const _0x4ce109=new Error('fetch\x20blocked:\x20invalid\x20URL');return _0x4ce109[_0x144a27(0x13b)]=_0x144a27(0x250),Promise[_0x144a27(0x1a4)](_0x4ce109);}if(!_0x225865[_0x144a27(0x11e)](_0x19d6b2)){const _0x7aa476=new Error(_0x225865[_0x144a27(0x11f)]===0x0?'fetch\x20is\x20not\x20allowed\x20in\x20this\x20function\x20sandbox\x20(no\x20allowedFetchDomains\x20configured)':_0x144a27(0x14e)+_0x19d6b2+_0x144a27(0x17c));return _0x7aa476[_0x144a27(0x13b)]=_0x144a27(0x250),Promise[_0x144a27(0x1a4)](_0x7aa476);}}return fetch(_0xb559c7,_0xbf4e19);};}function _0x65ba28(_0x4ca32b={}){const _0x2ffad9=_0x6ed6,_0x4860c8=_0x4ca32b['allowFetch']!==![],_0x3ba6a9=_0x4ca32b[_0x2ffad9(0x189)]??[],_0x2dd841={'Date':Date,'Math':Math,'JSON':JSON,'Array':Array,'Object':Object,'String':String,'Number':Number,'Boolean':Boolean,'Map':Map,'Set':Set,'Promise':Promise,'URL':URL,'URLSearchParams':URLSearchParams,'TextEncoder':TextEncoder,'TextDecoder':TextDecoder,'AbortController':AbortController,'AbortSignal':AbortSignal,'setTimeout':setTimeout,'clearTimeout':clearTimeout,'setInterval':setInterval,'clearInterval':clearInterval,'queueMicrotask':queueMicrotask,'structuredClone':structuredClone,'crypto':globalThis[_0x2ffad9(0x23a)]};return _0x4860c8&&typeof fetch===_0x2ffad9(0x1eb)&&(_0x2dd841['fetch']=_0x183028(_0x3ba6a9)),_0x2dd841[_0x2ffad9(0x265)]=_0x2dd841,_0x2dd841;}function _0xa25978(_0x34cb70,_0x263e3b={}){const _0x32062e=_0x6ed6,_0x4deba1=_0x65ba28(_0x263e3b),_0xaa947b=_0x385737[_0x32062e(0x1be)](_0x4deba1,{'name':'okdb-function-sandbox','codeGeneration':{'strings':![],'wasm':![]}});let _0x41f034;try{_0x41f034=new _0x385737[(_0x32062e(0x209))]('('+_0x34cb70+')',{'filename':_0x263e3b[_0x32062e(0x17f)]??'okdb-function.js'});}catch(_0x3f052a){const _0x2baf0c=new Error(_0x3f052a?.['message']||_0x32062e(0x180));_0x2baf0c[_0x32062e(0x13b)]=_0x32062e(0x223),_0x2baf0c[_0x32062e(0x102)]=_0x3f052a;throw _0x2baf0c;}let _0x438eb7;try{_0x438eb7=_0x41f034[_0x32062e(0x1ea)](_0xaa947b,{'timeout':_0x263e3b[_0x32062e(0x174)]??0x64});}catch(_0x5ca1f9){const _0x16ca05=new Error(_0x5ca1f9?.[_0x32062e(0x11c)]||_0x32062e(0x217));_0x16ca05[_0x32062e(0x13b)]=_0x32062e(0x223),_0x16ca05[_0x32062e(0x102)]=_0x5ca1f9;throw _0x16ca05;}if(typeof _0x438eb7!==_0x32062e(0x1eb)){const _0x157a78=new Error(_0x32062e(0x22a));_0x157a78[_0x32062e(0x13b)]='FUNCTION_SCRIPT_INVALID_SHAPE';throw _0x157a78;}return _0x438eb7;}return okdbFunctionsSandbox={'createSandboxGlobals':_0x65ba28,'compileFunctionExpression':_0xa25978,'_buildRestrictedFetch':_0x183028},okdbFunctionsSandbox;}var okdbFunctionsIpc,hasRequiredOkdbFunctionsIpc;function requireOkdbFunctionsIpc(){if(hasRequiredOkdbFunctionsIpc)return okdbFunctionsIpc;hasRequiredOkdbFunctionsIpc=0x1;function _0x57f488(_0x33ab1b){const _0x4c7132=_0x6ed6;if(!_0x33ab1b)return null;return{'message':_0x33ab1b[_0x4c7132(0x11c)]||String(_0x33ab1b),'stack':_0x33ab1b['stack']||null,'code':_0x33ab1b['code']||null,'details':_0x33ab1b[_0x4c7132(0x200)]||null};}function _0x30a3b7(_0x4a6b48){const _0x39365e=_0x6ed6;if(!_0x4a6b48)return new Error(_0x39365e(0x1c1));const _0x1523c8=new Error(_0x4a6b48['message']||String(_0x4a6b48));if(_0x4a6b48[_0x39365e(0x244)])_0x1523c8[_0x39365e(0x244)]=_0x4a6b48[_0x39365e(0x244)];if(_0x4a6b48[_0x39365e(0x13b)])_0x1523c8[_0x39365e(0x13b)]=_0x4a6b48[_0x39365e(0x13b)];if(_0x4a6b48['details'])_0x1523c8[_0x39365e(0x200)]=_0x4a6b48['details'];return _0x1523c8;}return okdbFunctionsIpc={'serializeError':_0x57f488,'deserializeError':_0x30a3b7},okdbFunctionsIpc;}var okdbEnums,hasRequiredOkdbEnums;function requireOkdbEnums(){const _0x3f3412=_0x54ea2d;if(hasRequiredOkdbEnums)return okdbEnums;hasRequiredOkdbEnums=0x1;const _0x1ace0d={'PUT':_0x3f3412(0x143),'REMOVE':'remove','INDEX_DROP':_0x3f3412(0x1d4),'INDEX_REGISTER':_0x3f3412(0x186),'INDEX_RESET':_0x3f3412(0x221),'TYPE_REGISTER':_0x3f3412(0x133),'TYPE_DROP':'dropType','FTS_REGISTER':_0x3f3412(0x1c3),'FTS_DROP':_0x3f3412(0x151),'FTS_RESET':'resetFts','SCHEMA_SET':'setSchema','SCHEMA_DROP':_0x3f3412(0x165),'TTL_SET':_0x3f3412(0x104),'TTL_CLEAR':_0x3f3412(0x26a)},_0x29534b={'SYSTEM_READY':_0x3f3412(0x140),'SYSTEM_STOPPED':_0x3f3412(0x183),'SYSTEM_CLOCK_CHANGE':_0x3f3412(0x170),'SYSTEM_POKE':_0x3f3412(0x225),'SYSTEM_DRAIN':_0x3f3412(0x10e),'SYSTEM_TYPE_DROP':_0x3f3412(0x126),'SYSTEM_PROC':'system:proc','SYSTEM_BUS_STATE_CHANGE':_0x3f3412(0x19b),'ITEM_CREATE':'item:create','ITEM_UPDATE':_0x3f3412(0x18a),'ITEM_REMOVE':_0x3f3412(0x168),'INDEX_RESET':'index:reset','INDEX_READY':_0x3f3412(0x128),'INDEX_PROGRESS':'index:progress','VIEW_PROGRESS':_0x3f3412(0x1cd),'INDEX_DROP':_0x3f3412(0x14f),'INDEX_REGISTERED':_0x3f3412(0x115),'FTS_REGISTERED':'fts:registered','FTS_DROP':_0x3f3412(0x149),'FTS_RESET':_0x3f3412(0x208),'SCHEMA_SET':_0x3f3412(0x1e2),'SCHEMA_DROP':_0x3f3412(0x18f),'UNIQUE_VIOLATION':_0x3f3412(0x114),'UNIQUE_VIOLATION_RESOLVED':_0x3f3412(0x153),'REF_VIOLATION':'ref:violation','REF_VIOLATION_RESOLVED':_0x3f3412(0x1d0),'SYNC_APPLY':'sync:apply','TXN_START':_0x3f3412(0x20a),'TXN_END':_0x3f3412(0x243),'TXN_ROLLBACK':_0x3f3412(0x19f),'TYPE_REGISTERED':_0x3f3412(0x13e),'TYPE_DROP':'type:drop','ENV_OPENED':'env:opened','ENV_REMOVED':_0x3f3412(0x1ac),'SYSTEM_ENV_RELEASE':_0x3f3412(0x24e),'TTL_EXPIRED':_0x3f3412(0x1f5),'TTL_SET':_0x3f3412(0x13f),'TTL_CLEAR':_0x3f3412(0x163),'LICENSE_INVALID':'license:invalid','LICENSE_ADDED':'license:added','LICENSE_ACTIVATED':_0x3f3412(0x152),'LICENSE_REMOVED':_0x3f3412(0x1f1)},_0x52bbf5={'CREATING':_0x3f3412(0x1fc),'RESETTING':_0x3f3412(0x10d),'READY':'ready','DROPPING':_0x3f3412(0x238),'WAITING':'waiting'},_0x1d3776={'CREATED':'created','STARTING':_0x3f3412(0x1dc),'STARTED':_0x3f3412(0x24c),'STOPPING':'stopping','STOPPED':_0x3f3412(0x1d6)},_0x43f14c={'CREATING':_0x3f3412(0x1fc),'READY':_0x3f3412(0x119),'HALTED':_0x3f3412(0x162),'STOPPED':_0x3f3412(0x1d6),'RESETTING':_0x3f3412(0x10d)},_0x19c73f=Object['freeze']({'POKE':_0x3f3412(0x1b0),'DRAIN':_0x3f3412(0x21b),'TYPE_DROP':_0x3f3412(0x22f),'PROC':'bus:proc','ENV_RELEASE':_0x3f3412(0x23f)});return okdbEnums={'BUS_EVENTS':_0x19c73f,'CHANGE_ACTIONS':_0x1ace0d,'EVENTS':_0x29534b,'INDEX_STATE':_0x52bbf5,'OKDB_STATE':_0x1d3776,'VIEW_STATE':_0x43f14c},okdbEnums;}var okdbError,hasRequiredOkdbError;function requireOkdbError(){if(hasRequiredOkdbError)return okdbError;hasRequiredOkdbError=0x1;class _0x5dcd6d extends Error{constructor(_0x451b5d,_0x2577f8,_0x33c9e4={}){const _0x1a163d=_0x6ed6;super(_0x451b5d),this[_0x1a163d(0x182)]=_0x1a163d(0x267),this[_0x1a163d(0x13b)]=_0x2577f8,this[_0x1a163d(0x200)]=_0x33c9e4,_0x33c9e4[_0x1a163d(0x102)]&&(this[_0x1a163d(0x102)]=_0x33c9e4['cause']),Error[_0x1a163d(0x262)](this,this[_0x1a163d(0x219)]);}}class _0x136227 extends _0x5dcd6d{constructor(_0x279945,_0x2666b,_0x2b0868,_0x48e99c){const _0x4c0254=_0x6ed6;super(_0x4c0254(0x1c4)+_0x279945+'@'+_0x2666b+_0x4c0254(0x239)+_0x2b0868+_0x4c0254(0x164)+_0x48e99c,_0x4c0254(0x16e),{'type':_0x279945,'key':_0x2666b,'expectedVersion':_0x2b0868,'actualVersion':_0x48e99c}),this[_0x4c0254(0x182)]=_0x4c0254(0x15e);}}class _0x35f36c extends _0x5dcd6d{constructor(_0x4f911b,_0x474a29){const _0x581f5a=_0x6ed6;super(_0x4f911b+'@'+_0x474a29+_0x581f5a(0x246),_0x581f5a(0x235),{'type':_0x4f911b,'key':_0x474a29}),this['name']=_0x581f5a(0x122);}}class _0x3df170 extends _0x5dcd6d{constructor(_0x4838f,_0xf62c05){const _0x39dcd5=_0x6ed6;super(_0x4838f+'@'+_0xf62c05+_0x39dcd5(0x16d),'ALREADY_EXISTS',{'type':_0x4838f,'key':_0xf62c05}),this[_0x39dcd5(0x182)]=_0x39dcd5(0x1c6);}}class _0x27e580 extends _0x5dcd6d{constructor(_0x38df45,_0x1dad3b){const _0x36d77e=_0x6ed6,_0x1b2b49=typeof _0x1dad3b;super(_0x36d77e(0x1bf)+_0x38df45+'\x27:\x20'+_0x1b2b49+_0x36d77e(0x147)+_0x1dad3b,'INVALID_INDEX_KEY',{'index':_0x38df45,'key':_0x1dad3b,'keyType':_0x1b2b49}),this[_0x36d77e(0x182)]=_0x36d77e(0x1ca);}}class _0x59ebff extends _0x5dcd6d{constructor(_0x932514){const _0x880349=_0x6ed6,_0x44d4bb=typeof _0x932514;super(_0x880349(0x18d)+_0x44d4bb+_0x880349(0x1c5)+_0x932514,_0x880349(0x254),{'key':_0x932514,'keyType':_0x44d4bb}),this['name']=_0x880349(0x25c);}}class _0x3e6c6c extends _0x5dcd6d{constructor(_0x413708){const _0x5e3288=_0x6ed6;super(_0x5e3288(0x181)+_0x413708+_0x5e3288(0x107),_0x5e3288(0x270),{'type':_0x413708}),this[_0x5e3288(0x182)]=_0x5e3288(0x15f);}}class _0x1da3c3 extends _0x5dcd6d{constructor(_0x5de99e){const _0x248cfa=_0x6ed6;super('Type\x20\x27'+_0x5de99e+_0x248cfa(0x137),_0x248cfa(0x11a),{'type':_0x5de99e}),this[_0x248cfa(0x182)]=_0x248cfa(0x195);}}class _0x421c79 extends _0x5dcd6d{constructor(_0x18e45a,_0x55e76d){const _0xe11ee7=_0x6ed6;super(_0xe11ee7(0x1bc)+_0x55e76d+_0xe11ee7(0x253)+_0x18e45a+_0xe11ee7(0x107),_0xe11ee7(0x25f),{'type':_0x18e45a,'index':_0x55e76d}),this['name']=_0xe11ee7(0x226);}}class _0xc2f87c extends _0x5dcd6d{constructor(_0x75e745,_0x2759d0){const _0x1029a9=_0x6ed6;super(_0x1029a9(0x1bc)+_0x2759d0+_0x1029a9(0x253)+_0x75e745+_0x1029a9(0x20c),_0x1029a9(0x13c),{'type':_0x75e745,'index':_0x2759d0}),this[_0x1029a9(0x182)]='OKDBIndexAlreadyRegisteredError';}}class _0x11d51b extends _0x5dcd6d{constructor(_0x4cd6f8,_0x46743a={}){const _0x377621=_0x6ed6;super(_0x4cd6f8,'INVALID_VALUE',_0x46743a),this[_0x377621(0x182)]=_0x377621(0x188);}}class _0x31148b extends _0x5dcd6d{constructor(_0x99cdde,_0x300529,_0x238689,_0x5a70be,_0x194d2a){const _0x21f6da=_0x6ed6;super('Unique\x20constraint\x20violated\x20on\x20'+_0x99cdde+'@'+_0x300529+_0x21f6da(0x20d)+_0x238689+_0x21f6da(0x132)+_0x5a70be+_0x21f6da(0x175)+_0x194d2a+'\x27','UNIQUE_CONSTRAINT',{'type':_0x99cdde,'index':_0x300529,'indexKey':_0x238689,'existingKey':_0x5a70be,'conflictingKey':_0x194d2a}),this['name']='OKDBUniqueConstraintError';}}class _0xe7f881 extends _0x5dcd6d{constructor(_0x3b83ad,_0x22cd8c,_0x27af6f){const _0xa8c1f3=_0x6ed6;super(_0xa8c1f3(0x12a)+_0x3b83ad+'@'+_0x22cd8c,'SCHEMA_VALIDATION_FAILED',{'type':_0x3b83ad,'key':_0x22cd8c,'errors':_0x27af6f}),this[_0xa8c1f3(0x182)]=_0xa8c1f3(0x131),this['type']=_0x3b83ad,this[_0xa8c1f3(0x146)]=_0x22cd8c,this[_0xa8c1f3(0x245)]=_0x27af6f;}}class _0x14b219 extends _0x5dcd6d{constructor(_0x445c43,_0x61f81d){const _0x1e9c13=_0x6ed6;super(_0x1e9c13(0x1b8)+_0x445c43+':\x20'+_0x61f81d['length']+_0x1e9c13(0x1c2),_0x1e9c13(0x204),{'type':_0x445c43,'failures':_0x61f81d}),this[_0x1e9c13(0x182)]=_0x1e9c13(0xfc),this[_0x1e9c13(0x23d)]=_0x445c43,this[_0x1e9c13(0x228)]=_0x61f81d;}}class _0x475342 extends _0x5dcd6d{constructor(_0x27e728,_0x226115,_0x2be0bf,_0x263db9,_0x90b168){const _0x60c515=_0x6ed6;super(_0x60c515(0x171)+_0x27e728+'@'+_0x226115+'.'+_0x2be0bf+_0x60c515(0x218)+_0x263db9+'@'+_0x90b168+_0x60c515(0x19e),'FOREIGN_KEY_VIOLATION',{'sourceType':_0x27e728,'sourceKey':_0x226115,'fieldPath':_0x2be0bf,'targetType':_0x263db9,'targetKey':_0x90b168}),this['name']=_0x60c515(0x18b),this[_0x60c515(0x106)]=_0x27e728,this['sourceKey']=_0x226115,this[_0x60c515(0x1e4)]=_0x2be0bf,this[_0x60c515(0x1de)]=_0x263db9,this[_0x60c515(0x1a7)]=_0x90b168;}}class _0x388163 extends _0x5dcd6d{constructor(_0x5db22b,_0x5721f0,_0xc48045){const _0x268cca=_0x6ed6;super(_0x268cca(0x136)+_0x5db22b+'@'+_0x5721f0+':\x20'+_0xc48045[_0x268cca(0x1b9)]+_0x268cca(0x1f6),_0x268cca(0x10c),{'targetType':_0x5db22b,'targetKey':_0x5721f0,'references':_0xc48045}),this[_0x268cca(0x182)]=_0x268cca(0x13d),this[_0x268cca(0x1de)]=_0x5db22b,this[_0x268cca(0x1a7)]=_0x5721f0,this[_0x268cca(0x1aa)]=_0xc48045;}}class _0x5b03d9 extends _0x5dcd6d{constructor(_0x4adf0a,_0x751e9a,_0x171994){const _0x50da8a=_0x6ed6;super(_0x50da8a(0x1e9)+_0x751e9a+_0x50da8a(0x111)+_0x4adf0a+_0x50da8a(0x198)+_0x171994[_0x50da8a(0x269)](_0x475ab9=>_0x475ab9[_0x50da8a(0x1b5)]+':'+_0x475ab9[_0x50da8a(0x182)])['join'](',\x20'),_0x50da8a(0x271),{'type':_0x4adf0a,'index':_0x751e9a,'usedBy':_0x171994}),this[_0x50da8a(0x182)]=_0x50da8a(0x216);}}return okdbError={'OKDBError':_0x5dcd6d,'OKDBVersionMismatchError':_0x136227,'OKDBNotFoundError':_0x35f36c,'OKDBAlreadyExistsError':_0x3df170,'OKDBInvalidIndexKeyError':_0x27e580,'OKDBInvalidPrimaryKeyError':_0x59ebff,'OKDBTypeNotRegisteredError':_0x3e6c6c,'OKDBTypeAlreadyRegisteredError':_0x1da3c3,'OKDBIndexNotRegisteredError':_0x421c79,'OKDBIndexAlreadyRegisteredError':_0xc2f87c,'OKDBInvalidValueError':_0x11d51b,'OKDBUniqueConstraintError':_0x31148b,'OKDBSchemaValidationError':_0xe7f881,'OKDBSchemaCollectionError':_0x14b219,'OKDBForeignKeyError':_0x475342,'OKDBForeignKeyDeleteError':_0x388163,'OKDBIndexHasConsumersError':_0x5b03d9},okdbError;}var okdbLoopMonitor,hasRequiredOkdbLoopMonitor;function requireOkdbLoopMonitor(){const _0x21db07=_0x54ea2d;if(hasRequiredOkdbLoopMonitor)return okdbLoopMonitor;hasRequiredOkdbLoopMonitor=0x1;const {monitorEventLoopDelay:_0x32a842,performance:_0x47ee04}=require$$0$1,_0x550dbe=process.env.OKDB_LOOP_LAG==='1'||process.env.OKDB_LOOP_LAG===_0x21db07(0x121),_0xbf02ff=Number(process.env.OKDB_LOOP_LAG_MS)||0x7d0,_0x5ab1de=process.env.OKDB_LOOP_LAG_ALL==='1',_0x2acc55=Number(process.env.OKDB_LOOP_LAG_MIN_MS)||0x64;class _0x2d21b4{constructor(){const _0x918fb6=_0x21db07;this[_0x918fb6(0x199)]=_0x550dbe,this['_buckets']=new Map(),this['_h']=null,this['_timer']=null,this['_started']=![],this[_0x918fb6(0x193)]=(_0x54d7c7,_0xaa28bb)=>process[_0x918fb6(0x14c)]['write'](_0x54d7c7+(_0xaa28bb?'\x20'+JSON[_0x918fb6(0x1ef)](_0xaa28bb):'')+'\x0a');}[_0x21db07(0x247)](){const _0x131a1f=_0x21db07;return _0x47ee04[_0x131a1f(0x247)]();}['setLogger'](_0xf454c6){const _0x286b00=_0x21db07;if(typeof _0xf454c6===_0x286b00(0x1eb))this[_0x286b00(0x193)]=_0xf454c6;}[_0x21db07(0x236)](_0x19612c,_0x24ae99,_0x157f82){const _0x2a46a2=_0x21db07;if(!this[_0x2a46a2(0x199)])return;let _0x39800=this[_0x2a46a2(0x100)]['get'](_0x19612c);!_0x39800&&(_0x39800={'ms':0x0,'count':0x0,'maxMs':0x0,'maxExtra':''},this[_0x2a46a2(0x100)][_0x2a46a2(0x1d1)](_0x19612c,_0x39800)),_0x39800['ms']+=_0x24ae99,_0x39800['count']+=0x1,_0x24ae99>_0x39800[_0x2a46a2(0x255)]&&(_0x39800[_0x2a46a2(0x255)]=_0x24ae99,_0x39800[_0x2a46a2(0x251)]=_0x157f82||'');}[_0x21db07(0x1af)](_0x336a06){const _0x58e199=_0x21db07;if(!this[_0x58e199(0x199)]||this[_0x58e199(0x1ae)])return;this[_0x58e199(0x1ae)]=!![];if(_0x336a06)this['_log']=_0x336a06;this['_h']=_0x32a842({'resolution':0xa}),this['_h'][_0x58e199(0x157)](),this[_0x58e199(0x18e)]=setInterval(()=>this['_report'](),_0xbf02ff);if(this[_0x58e199(0x18e)][_0x58e199(0x135)])this[_0x58e199(0x18e)][_0x58e199(0x135)]();}['onWindow'](_0x57845b){const _0x4a3c8c=_0x21db07;if(!this[_0x4a3c8c(0x256)])this['_windowCbs']=new Set();this[_0x4a3c8c(0x256)]['add'](_0x57845b);if(!this['_started'])this[_0x4a3c8c(0x213)]();}['offWindow'](_0x18bacf){const _0x9283a1=_0x21db07;this[_0x9283a1(0x256)]?.[_0x9283a1(0x222)](_0x18bacf);}[_0x21db07(0x213)](){const _0x4244e3=_0x21db07;if(this['_admissionStarted'])return;this[_0x4244e3(0x1cf)]=!![];!this['_h']&&(this['_h']=_0x32a842({'resolution':0xa}),this['_h'][_0x4244e3(0x157)]());const _0x1d9715=_0xbf02ff;this['_admissionTimer']=setInterval(()=>{const _0x54b685=_0x4244e3,_0x248ddd=this['_h'];if(!_0x248ddd)return;const _0x294527=_0x248ddd[_0x54b685(0x26e)](0x63)/0xf4240,_0xbffa07=_0x248ddd['max']/0xf4240,_0x2821d7=_0x248ddd[_0x54b685(0x103)]/0xf4240;_0x248ddd['reset']();if(this[_0x54b685(0x256)])for(const _0x4f8103 of this[_0x54b685(0x256)]){try{_0x4f8103({'p99Ms':_0x294527,'maxMs':_0xbffa07,'meanMs':_0x2821d7,'reportMs':_0x1d9715});}catch{}}},_0x1d9715);if(this[_0x4244e3(0x1e0)][_0x4244e3(0x135)])this[_0x4244e3(0x1e0)][_0x4244e3(0x135)]();}[_0x21db07(0x12e)](){const _0x326a7d=_0x21db07,_0x1575b4=this['_h'],_0x468d60=_0x1575b4[_0x326a7d(0x190)]/0xf4240,_0xc5b43a=_0x1575b4[_0x326a7d(0x26e)](0x63)/0xf4240,_0x2592a5=_0x1575b4['mean']/0xf4240;_0x1575b4[_0x326a7d(0x125)]();const _0x27431c=[...this[_0x326a7d(0x100)][_0x326a7d(0x113)]()][_0x326a7d(0x269)](([_0x4ace47,_0x449122])=>({'label':_0x4ace47,..._0x449122}))[_0x326a7d(0x1e7)]((_0xef51fd,_0x41bb6a)=>_0x41bb6a['ms']-_0xef51fd['ms'])[_0x326a7d(0x194)](0x0,0x8);this[_0x326a7d(0x100)][_0x326a7d(0x211)]();const _0x15a2ad=_0x27431c[_0x326a7d(0x1e8)]((_0xa6815f,_0x48c103)=>_0xa6815f+_0x48c103['ms'],0x0),_0x34ccb0=_0x27431c['map'](_0x27fef1=>_0x27fef1[_0x326a7d(0x1cb)]+'='+_0x27fef1['ms']['toFixed'](0x0)+'ms/'+_0x27fef1['count']+(_0x27fef1[_0x326a7d(0x255)]>0x5?_0x326a7d(0x1ec)+_0x27fef1['maxMs'][_0x326a7d(0x134)](0x0)+'ms'+(_0x27fef1[_0x326a7d(0x251)]?'\x20'+_0x27fef1[_0x326a7d(0x251)]:'')+')':''));(_0x5ab1de||_0x468d60>=_0x2acc55)&&this[_0x326a7d(0x193)](_0x326a7d(0x229)+_0xbf02ff+_0x326a7d(0x1a1)+_0x468d60[_0x326a7d(0x134)](0x0)+_0x326a7d(0x1a8)+_0xc5b43a[_0x326a7d(0x134)](0x0)+_0x326a7d(0x17d)+_0x2592a5[_0x326a7d(0x134)](0x0)+_0x326a7d(0x154)+_0x15a2ad[_0x326a7d(0x134)](0x0)+'ms'+(_0x34ccb0['length']?'\x20│\x20'+_0x34ccb0[_0x326a7d(0x179)]('\x20\x20'):''),{'feature':'loop-lag'});if(this[_0x326a7d(0x256)])for(const _0x362332 of this[_0x326a7d(0x256)]){try{_0x362332({'p99Ms':_0xc5b43a,'maxMs':_0x468d60,'meanMs':_0x2592a5,'reportMs':_0xbf02ff});}catch{}}}['stop'](){const _0x1ae947=_0x21db07;if(this['_timer'])clearInterval(this[_0x1ae947(0x18e)]);if(this['_h'])this['_h'][_0x1ae947(0x248)]();this[_0x1ae947(0x18e)]=null,this['_h']=null,this[_0x1ae947(0x1ae)]=![];}}const _0x27680e=new _0x2d21b4();if(_0x27680e[_0x21db07(0x199)])_0x27680e[_0x21db07(0x1af)]();return okdbLoopMonitor={'LOOP':_0x27680e},okdbLoopMonitor;}var okdbTransaction,hasRequiredOkdbTransaction;function requireOkdbTransaction(){const _0x2d87c9=_0x54ea2d;if(hasRequiredOkdbTransaction)return okdbTransaction;hasRequiredOkdbTransaction=0x1;const _0x1414ab=require$$0$2,{EVENTS:_0x2124da}=requireOkdbEnums(),{OKDBError:_0x1dadee}=requireOkdbError(),{LOOP:_0x21b661}=requireOkdbLoopMonitor();function _0x2ba046(_0x2e1acc){return _0x2e1acc['map'](_0x10e0ee=>{const _0x1ac4f4=_0x6ed6,[_0x2afa7a,_0x32ce49]=_0x10e0ee[_0x1ac4f4(0x19a)]||[];return{'action':_0x10e0ee[_0x1ac4f4(0x22c)],'type':_0x2afa7a,'key':_0x32ce49};});}class _0x5246d8{[_0x2d87c9(0x1f2)];[_0x2d87c9(0x261)]=[];['_doHooks']=[];[_0x2d87c9(0x230)]=[];constructor(_0x584f27,_0x5463a2={'useReadTransaction':![]}){const _0x35b886=_0x2d87c9;this[_0x35b886(0x1f2)]=_0x584f27,this['options']=_0x5463a2,this['id']=_0x1414ab['v4'](),this[_0x35b886(0x26c)]=this[_0x35b886(0x11d)]['useReadTransaction']?this['okdb']['db'][_0x35b886(0x220)]():null,this[_0x35b886(0x24b)]=![];}[_0x2d87c9(0x1c7)](_0x148967){const _0x26e4da=_0x2d87c9;this[_0x26e4da(0x21a)]['push'](_0x148967);}['onUndo'](_0x556480){const _0x3025e2=_0x2d87c9;this[_0x3025e2(0x230)]['push'](_0x556480);}['_closeReadTransaction'](){const _0x292f4b=_0x2d87c9;if(!this[_0x292f4b(0x26c)])return;try{this[_0x292f4b(0x26c)][_0x292f4b(0x1c9)]();}catch(_0x52d85e){}this['readTransaction']=null;}['_assertOpen'](){const _0x2b28e7=_0x2d87c9;if(this[_0x2b28e7(0x24b)])throw new _0x1dadee('Transaction\x20already\x20closed','TXN_CLOSED');}['get'](_0x349fd3,_0x5c23f0){const _0x26871d=_0x2d87c9;return this[_0x26871d(0x259)](),this['okdb'][_0x26871d(0x1f7)](_0x349fd3,_0x5c23f0,{'transaction':this[_0x26871d(0x26c)]});}[_0x2d87c9(0x12d)](_0x5a194b,_0x5f0ad4){const _0x38ef80=_0x2d87c9;return this['_assertOpen'](),this['okdb'][_0x38ef80(0x12d)](_0x5a194b,_0x5f0ad4,{'transaction':this[_0x38ef80(0x26c)]});}[_0x2d87c9(0x1e5)](_0x28442a,_0x51bf5f){const _0x33ccab=_0x2d87c9;return this[_0x33ccab(0x259)](),this[_0x33ccab(0x1f2)][_0x33ccab(0x1e5)](_0x28442a,_0x51bf5f,{'transaction':this['readTransaction']});}[_0x2d87c9(0x167)](_0x34f516,_0x126c37={}){const _0x321849=_0x2d87c9;return this[_0x321849(0x259)](),this[_0x321849(0x1f2)][_0x321849(0x167)](_0x34f516,{'transaction':this[_0x321849(0x26c)],..._0x126c37});}[_0x2d87c9(0x129)](_0x154839,_0x4519b1={}){const _0x5072ee=_0x2d87c9;return this[_0x5072ee(0x259)](),this['okdb'][_0x5072ee(0x129)](_0x154839,{'transaction':this[_0x5072ee(0x26c)],..._0x4519b1});}[_0x2d87c9(0x105)](_0x4efcc2,_0x4b62d5={}){const _0x1d4562=_0x2d87c9;return this[_0x1d4562(0x259)](),this[_0x1d4562(0x1f2)]['getKeys'](_0x4efcc2,{'transaction':this['readTransaction'],..._0x4b62d5});}['byIndex'](_0x137393,_0x2e4d60,_0x4731fa={}){const _0x181cc4=_0x2d87c9;return this[_0x181cc4(0x259)](),this[_0x181cc4(0x1f2)][_0x181cc4(0x1a5)](_0x137393,_0x2e4d60,{'transaction':this['readTransaction'],..._0x4731fa});}[_0x2d87c9(0x1b1)](_0x20b676,_0x2aee7c,_0x1ccc28={}){const _0x389ac7=_0x2d87c9;return this[_0x389ac7(0x259)](),this['okdb'][_0x389ac7(0x1b1)](_0x20b676,_0x2aee7c,{'transaction':this[_0x389ac7(0x26c)],..._0x1ccc28});}[_0x2d87c9(0x1e1)](_0x1bbee1=null){const _0x1f0dc6=_0x2d87c9;return this[_0x1f0dc6(0x259)](),this[_0x1f0dc6(0x1f2)][_0x1f0dc6(0x1e1)](_0x1bbee1,{'transaction':this[_0x1f0dc6(0x26c)]});}[_0x2d87c9(0x22e)](_0x32899e){const _0x83637c=_0x2d87c9;return this[_0x83637c(0x259)](),this['okdb'][_0x83637c(0x22e)](_0x32899e,{'transaction':this[_0x83637c(0x26c)]});}[_0x2d87c9(0x143)](_0x702c24,_0x32eeed,_0x5eaa51,{ifVersion:ifVersion=null,version:version=null,timestamp:timestamp=Date[_0x2d87c9(0x247)](),origin:origin=null,ttl:ttl=null}={}){const _0x250ea9=_0x2d87c9;this[_0x250ea9(0x261)][_0x250ea9(0x1e3)]({'action':_0x250ea9(0x143),'args':[_0x702c24,_0x32eeed,_0x5eaa51,{'ifVersion':ifVersion,'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x2d87c9(0x23c)](_0xb72c5d,_0x234514,_0x1faad2,{ifVersion:ifVersion=null,version:version=null,timestamp:timestamp=Date['now'](),origin:origin=null,ttl:ttl=null}={}){const _0x55e8a3=_0x2d87c9;this[_0x55e8a3(0x261)][_0x55e8a3(0x1e3)]({'action':_0x55e8a3(0x23c),'args':[_0xb72c5d,_0x234514,_0x1faad2,{'ifVersion':ifVersion,'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x2d87c9(0x1f8)](_0x331219,_0x23fdd5,_0x22c6c4,{ifVersion:ifVersion=null,timestamp:timestamp=Date[_0x2d87c9(0x247)](),origin:origin=null,ttl:ttl=null}={}){const _0x1c89dd=_0x2d87c9;this['actions']['push']({'action':_0x1c89dd(0x1f8),'args':[_0x331219,_0x23fdd5,_0x22c6c4,{'ifVersion':ifVersion,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x2d87c9(0x197)](_0x4853a7,_0xdabda3,_0x6b2a27,{version:version=null,timestamp:timestamp=Date[_0x2d87c9(0x247)](),origin:origin=null,ttl:ttl=null}={}){const _0x3888f9=_0x2d87c9;this[_0x3888f9(0x261)]['push']({'action':_0x3888f9(0x197),'args':[_0x4853a7,_0xdabda3,_0x6b2a27,{'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x2d87c9(0x196)](_0x4cd30f,_0x334fcb,{ifVersion:ifVersion=null,timestamp:timestamp=Date[_0x2d87c9(0x247)](),origin:origin=null}={}){const _0x5a73aa=_0x2d87c9;this[_0x5a73aa(0x261)][_0x5a73aa(0x1e3)]({'action':'remove','args':[_0x4cd30f,_0x334fcb,{'ifVersion':ifVersion,'timestamp':timestamp,'origin':origin}]});}[_0x2d87c9(0x15d)](_0x5179f3,_0x3c8416,_0x171f58){const _0x26bb45=_0x2d87c9;this[_0x26bb45(0x261)][_0x26bb45(0x1e3)]({'action':_0x26bb45(0x15d),'args':[_0x5179f3,_0x3c8416,_0x171f58]});}[_0x2d87c9(0x1a2)](_0x109bc2,_0x3c7e42){const _0x18af92=_0x2d87c9;this['actions'][_0x18af92(0x1e3)]({'action':'clearTTL','args':[_0x109bc2,_0x3c7e42]});}[_0x2d87c9(0x25b)](){const _0x1c76d5=_0x2d87c9;if(this[_0x1c76d5(0x24b)])return;for(const _0x1ad866 of this[_0x1c76d5(0x230)]){try{_0x1ad866();}catch{}}this[_0x1c76d5(0x1f2)][_0x1c76d5(0x1ff)][_0x1c76d5(0x169)](_0x2124da[_0x1c76d5(0x176)],{'id':this['id']}),this[_0x1c76d5(0x261)]=[],this[_0x1c76d5(0x15b)](),this[_0x1c76d5(0x24b)]=!![];}async['commit'](){const _0x421867=_0x2d87c9;if(this[_0x421867(0x24b)])throw new Error('Transaction\x20already\x20closed');const _0x18e84b={'id':this['id'],'timestamp':Date[_0x421867(0x247)](),'actions':this[_0x421867(0x261)]};this[_0x421867(0x1f2)][_0x421867(0x1ff)][_0x421867(0x169)](_0x2124da[_0x421867(0x231)],_0x18e84b);try{const _0x571620=_0x21b661[_0x421867(0x199)]?_0x21b661[_0x421867(0x247)]():0x0;await this[_0x421867(0x1f2)][_0x421867(0x1d2)][_0x421867(0x212)](()=>{const _0x37a26f=_0x421867;for(const _0x24bf37 of this[_0x37a26f(0x261)]){const _0x1db174=this['okdb']['_'+_0x24bf37[_0x37a26f(0x22c)]];if(typeof _0x1db174!=='function')throw new Error(_0x37a26f(0x1d5)+_0x24bf37['action']);_0x1db174[_0x37a26f(0x161)](this['okdb'],this,..._0x24bf37[_0x37a26f(0x19a)]);}}),_0x21b661['enabled']&&_0x21b661[_0x421867(0x236)](_0x421867(0x155),_0x21b661[_0x421867(0x247)]()-_0x571620,(this['okdb']['name']??'?')+_0x421867(0x22d)+this['actions'][_0x421867(0x1b9)]);}catch(_0x19e797){for(const _0x4741cd of this[_0x421867(0x230)]){try{_0x4741cd();}catch{}}this[_0x421867(0x15b)](),this[_0x421867(0x24b)]=!![];if(_0x19e797 instanceof _0x1dadee)throw _0x19e797;const _0x5cb1a2={'cause':_0x19e797,'env':this['okdb']?.[_0x421867(0x182)],'envPath':this['okdb']?.[_0x421867(0x110)],'pid':process[_0x421867(0x1ba)],'txnId':this['id'],'actionCount':this[_0x421867(0x261)][_0x421867(0x1b9)],'actions':_0x2ba046(this[_0x421867(0x261)]),'nativeCode':_0x19e797?.[_0x421867(0x13b)],'nativeName':_0x19e797?.[_0x421867(0x182)]};try{this[_0x421867(0x1f2)]?.[_0x421867(0x1b6)]?.['error']?.(_0x421867(0x20f),{'env':_0x5cb1a2[_0x421867(0x1ad)],'envPath':_0x5cb1a2['envPath'],'pid':_0x5cb1a2[_0x421867(0x1ba)],'txnId':_0x5cb1a2[_0x421867(0x210)],'actionCount':_0x5cb1a2['actionCount'],'actions':_0x5cb1a2[_0x421867(0x261)],'nativeCode':_0x5cb1a2['nativeCode'],'error':_0x19e797?.[_0x421867(0x11c)],'stack':_0x19e797?.[_0x421867(0x244)]});}catch{}throw new _0x1dadee(_0x19e797?.[_0x421867(0x11c)]||_0x421867(0x10a),_0x421867(0x118),_0x5cb1a2);}this['okdb'][_0x421867(0x1ff)][_0x421867(0x169)](_0x2124da[_0x421867(0x127)],_0x18e84b);for(const _0x5907b8 of this[_0x421867(0x21a)]){try{await _0x5907b8();}catch{}}this[_0x421867(0x261)]=[],this['_closeReadTransaction'](),this[_0x421867(0x24b)]=!![];}static[_0x2d87c9(0x139)](_0x1bf83a){const _0x4dcd33=_0x2d87c9;return Object[_0x4dcd33(0x1fd)]({'id':_0x1bf83a['id'],'put':_0x1bf83a[_0x4dcd33(0x143)][_0x4dcd33(0x214)](_0x1bf83a),'update':_0x1bf83a[_0x4dcd33(0x23c)][_0x4dcd33(0x214)](_0x1bf83a),'patch':_0x1bf83a[_0x4dcd33(0x1f8)][_0x4dcd33(0x214)](_0x1bf83a),'create':_0x1bf83a[_0x4dcd33(0x197)]['bind'](_0x1bf83a),'remove':_0x1bf83a[_0x4dcd33(0x196)][_0x4dcd33(0x214)](_0x1bf83a),'setTTL':_0x1bf83a[_0x4dcd33(0x15d)][_0x4dcd33(0x214)](_0x1bf83a),'clearTTL':_0x1bf83a[_0x4dcd33(0x1a2)][_0x4dcd33(0x214)](_0x1bf83a),'commit':_0x1bf83a[_0x4dcd33(0x16f)][_0x4dcd33(0x214)](_0x1bf83a),'rollback':_0x1bf83a['rollback']['bind'](_0x1bf83a),'get':_0x1bf83a[_0x4dcd33(0x1f7)][_0x4dcd33(0x214)](_0x1bf83a),'getEntry':_0x1bf83a[_0x4dcd33(0x12d)][_0x4dcd33(0x214)](_0x1bf83a),'getMany':_0x1bf83a[_0x4dcd33(0x1e5)][_0x4dcd33(0x214)](_0x1bf83a),'getRange':_0x1bf83a['getRange'][_0x4dcd33(0x214)](_0x1bf83a),'getValues':_0x1bf83a[_0x4dcd33(0x129)]['bind'](_0x1bf83a),'getKeys':_0x1bf83a[_0x4dcd33(0x105)][_0x4dcd33(0x214)](_0x1bf83a),'byIndex':_0x1bf83a[_0x4dcd33(0x1a5)][_0x4dcd33(0x214)](_0x1bf83a),'query':_0x1bf83a[_0x4dcd33(0x1b1)]['bind'](_0x1bf83a),'getClock':_0x1bf83a[_0x4dcd33(0x1e1)][_0x4dcd33(0x214)](_0x1bf83a),'getCount':_0x1bf83a[_0x4dcd33(0x22e)][_0x4dcd33(0x214)](_0x1bf83a),'read':_0x1bf83a,'raw':_0x1bf83a});}static[_0x2d87c9(0x158)](_0x56abc2,_0x5cc960=[]){const _0x29fada=_0x2d87c9;if(!Array[_0x29fada(0x1a9)](_0x5cc960))throw new _0x1dadee('txn\x20ops\x20must\x20be\x20an\x20array',_0x29fada(0x242));for(const _0x2841b0 of _0x5cc960){if(Array[_0x29fada(0x1a9)](_0x2841b0)){const [_0xdf7e9b,..._0x36298c]=_0x2841b0;if(typeof _0x56abc2[_0xdf7e9b]!==_0x29fada(0x1eb))throw new _0x1dadee(_0x29fada(0x1d5)+_0xdf7e9b,_0x29fada(0x1fe),{'action':_0xdf7e9b});_0x56abc2[_0xdf7e9b](..._0x36298c);continue;}if(!_0x2841b0||typeof _0x2841b0!=='object')throw new _0x1dadee(_0x29fada(0x252),_0x29fada(0x12f));const {action:_0x1d0df3}=_0x2841b0;if(typeof _0x1d0df3!=='string'||typeof _0x56abc2[_0x1d0df3]!==_0x29fada(0x1eb))throw new _0x1dadee(_0x29fada(0x1d5)+_0x1d0df3,'TXN_INVALID_ACTION',{'action':_0x1d0df3});switch(_0x1d0df3){case _0x29fada(0x143):case _0x29fada(0x23c):case _0x29fada(0x197):_0x56abc2[_0x1d0df3](_0x2841b0[_0x29fada(0x23d)],_0x2841b0['key'],_0x2841b0['value'],{..._0x2841b0['options'],'ttl':_0x2841b0[_0x29fada(0x1ab)]??_0x2841b0['options']?.[_0x29fada(0x1ab)]??null});break;case _0x29fada(0x1f8):_0x56abc2[_0x29fada(0x1f8)](_0x2841b0[_0x29fada(0x23d)],_0x2841b0[_0x29fada(0x146)],_0x2841b0[_0x29fada(0x1f8)],{..._0x2841b0['options'],'ttl':_0x2841b0[_0x29fada(0x1ab)]??_0x2841b0[_0x29fada(0x11d)]?.[_0x29fada(0x1ab)]??null});break;case'remove':_0x56abc2[_0x29fada(0x196)](_0x2841b0[_0x29fada(0x23d)],_0x2841b0[_0x29fada(0x146)],_0x2841b0[_0x29fada(0x11d)]||{});break;case'setTTL':_0x56abc2[_0x29fada(0x15d)](_0x2841b0[_0x29fada(0x23d)],_0x2841b0[_0x29fada(0x146)],_0x2841b0[_0x29fada(0x1ab)]);break;case'clearTTL':_0x56abc2[_0x29fada(0x1a2)](_0x2841b0[_0x29fada(0x23d)],_0x2841b0['key']);break;default:throw new _0x1dadee(_0x29fada(0x145)+_0x1d0df3,_0x29fada(0x1fe),{'action':_0x1d0df3});}}}static async[_0x2d87c9(0x1ed)](_0x1db1ce,_0x3ff1b5,_0x1a1b16={}){const _0x103a8e=_0x2d87c9,_0x30f4e8=new _0x5246d8(_0x1db1ce,_0x1a1b16),_0x3e38e1=_0x5246d8['createWriteFacade'](_0x30f4e8);try{typeof _0x3ff1b5==='function'?await _0x3ff1b5(_0x3e38e1):_0x5246d8[_0x103a8e(0x158)](_0x30f4e8,_0x3ff1b5||[]);const _0xdc2b5b=_0x30f4e8[_0x103a8e(0x261)][_0x103a8e(0x1b9)];return await _0x30f4e8[_0x103a8e(0x16f)](),{'id':_0x30f4e8['id'],'actions':_0xdc2b5b};}catch(_0x276b9f){try{_0x30f4e8[_0x103a8e(0x25b)]();}catch(_0x90a05d){}throw _0x276b9f;}}}return okdbTransaction=_0x5246d8,okdbTransaction;}var okdbFunctionsFacades,hasRequiredOkdbFunctionsFacades;function requireOkdbFunctionsFacades(){if(hasRequiredOkdbFunctionsFacades)return okdbFunctionsFacades;hasRequiredOkdbFunctionsFacades=0x1;const _0x4d424b=requireOkdbTransaction();function _0x1ab661(_0x289651){const _0x261e1d=_0x6ed6;return{'transaction':typeof _0x289651[_0x261e1d(0x212)]===_0x261e1d(0x1eb)?_0x289651[_0x261e1d(0x212)][_0x261e1d(0x214)](_0x289651):_0x1e930b=>new _0x4d424b(_0x289651,_0x1e930b),'txn':typeof _0x289651[_0x261e1d(0x1db)]===_0x261e1d(0x1eb)?_0x289651['txn']['bind'](_0x289651):(_0x4b6d08,_0x4a1a5d)=>_0x4d424b[_0x261e1d(0x1ed)](_0x289651,_0x4b6d08,_0x4a1a5d)};}function _0x59a442(_0xbb5c15){const _0x3f0a45=_0x6ed6;return{'name':_0xbb5c15[_0x3f0a45(0x182)],..._0x1ab661(_0xbb5c15),'put':_0xbb5c15['put'][_0x3f0a45(0x214)](_0xbb5c15),'update':_0xbb5c15[_0x3f0a45(0x23c)]['bind'](_0xbb5c15),'patch':_0xbb5c15['patch'][_0x3f0a45(0x214)](_0xbb5c15),'create':_0xbb5c15[_0x3f0a45(0x197)][_0x3f0a45(0x214)](_0xbb5c15),'remove':_0xbb5c15[_0x3f0a45(0x196)][_0x3f0a45(0x214)](_0xbb5c15),'get':_0xbb5c15['get'][_0x3f0a45(0x214)](_0xbb5c15),'getMany':_0xbb5c15[_0x3f0a45(0x1e5)]['bind'](_0xbb5c15),'getEntry':_0xbb5c15[_0x3f0a45(0x12d)][_0x3f0a45(0x214)](_0xbb5c15),'getRange':_0xbb5c15['getRange'][_0x3f0a45(0x214)](_0xbb5c15),'getValues':_0xbb5c15[_0x3f0a45(0x129)][_0x3f0a45(0x214)](_0xbb5c15),'getKeys':_0xbb5c15[_0x3f0a45(0x105)][_0x3f0a45(0x214)](_0xbb5c15),'getCount':_0xbb5c15['getCount'][_0x3f0a45(0x214)](_0xbb5c15),'getByPrefix':_0xbb5c15['getByPrefix'][_0x3f0a45(0x214)](_0xbb5c15),'getIndex':_0xbb5c15[_0x3f0a45(0x26f)][_0x3f0a45(0x214)](_0xbb5c15),'byIndex':_0xbb5c15[_0x3f0a45(0x1a5)][_0x3f0a45(0x214)](_0xbb5c15),'query':_0xbb5c15[_0x3f0a45(0x1b1)][_0x3f0a45(0x214)](_0xbb5c15),'geoQuery':_0xbb5c15[_0x3f0a45(0x20b)][_0x3f0a45(0x214)](_0xbb5c15),'ftsQuery':_0xbb5c15['ftsQuery']['bind'](_0xbb5c15),'setTTL':_0xbb5c15[_0x3f0a45(0x15d)][_0x3f0a45(0x214)](_0xbb5c15),'getTTL':_0xbb5c15[_0x3f0a45(0x14b)][_0x3f0a45(0x214)](_0xbb5c15),'clearTTL':_0xbb5c15['clearTTL']['bind'](_0xbb5c15),'sweepExpiredTTL':_0xbb5c15[_0x3f0a45(0x142)][_0x3f0a45(0x214)](_0xbb5c15),'listTTL':_0xbb5c15['listTTL'][_0x3f0a45(0x214)](_0xbb5c15),'ttlStats':_0xbb5c15[_0x3f0a45(0x260)][_0x3f0a45(0x214)](_0xbb5c15),'setDefaultTTL':_0xbb5c15[_0x3f0a45(0x240)]['bind'](_0xbb5c15),'getDefaultTTL':_0xbb5c15[_0x3f0a45(0x264)]['bind'](_0xbb5c15),'clearDefaultTTL':_0xbb5c15['clearDefaultTTL']['bind'](_0xbb5c15),'registerType':_0xbb5c15['registerType']['bind'](_0xbb5c15),'ensureType':_0xbb5c15[_0x3f0a45(0x144)][_0x3f0a45(0x214)](_0xbb5c15),'hasType':_0xbb5c15[_0x3f0a45(0x227)][_0x3f0a45(0x214)](_0xbb5c15),'dropType':_0xbb5c15[_0x3f0a45(0x263)][_0x3f0a45(0x214)](_0xbb5c15),'registerIndex':_0xbb5c15[_0x3f0a45(0x186)][_0x3f0a45(0x214)](_0xbb5c15),'hasIndex':_0xbb5c15[_0x3f0a45(0x184)][_0x3f0a45(0x214)](_0xbb5c15),'dropIndex':_0xbb5c15[_0x3f0a45(0x1d4)][_0x3f0a45(0x214)](_0xbb5c15),'resetIndex':_0xbb5c15[_0x3f0a45(0x221)]['bind'](_0xbb5c15),'indexReady':_0xbb5c15[_0x3f0a45(0x1fa)][_0x3f0a45(0x214)](_0xbb5c15),'getIndexStatus':_0xbb5c15[_0x3f0a45(0x192)]['bind'](_0xbb5c15),'getClock':_0xbb5c15[_0x3f0a45(0x1e1)][_0x3f0a45(0x214)](_0xbb5c15),'getChanges':_0xbb5c15[_0x3f0a45(0x21d)]['bind'](_0xbb5c15),'count':_0xbb5c15[_0x3f0a45(0x202)][_0x3f0a45(0x214)](_0xbb5c15),'range':_0xbb5c15[_0x3f0a45(0x13a)][_0x3f0a45(0x214)](_0xbb5c15),'now':_0xbb5c15[_0x3f0a45(0x247)][_0x3f0a45(0x214)](_0xbb5c15)};}function _0x58d2a1(_0x487a31){const _0xa3f4a8=_0x6ed6;if(!_0x487a31)return null;const _0x79c829={};for(const _0x4646d8 of[_0xa3f4a8(0x1e6),'getJob',_0xa3f4a8(0x1f0),_0xa3f4a8(0x258),_0xa3f4a8(0x1bb),_0xa3f4a8(0x160),'getBucket',_0xa3f4a8(0x19c)]){if(typeof _0x487a31[_0x4646d8]===_0xa3f4a8(0x1eb))_0x79c829[_0x4646d8]=_0x487a31[_0x4646d8][_0xa3f4a8(0x214)](_0x487a31);}return Object[_0xa3f4a8(0x23e)](_0x79c829)[_0xa3f4a8(0x1b9)]?_0x79c829:null;}function _0x184245(_0xaad94d){const _0x2e60cb=_0x6ed6;if(!_0xaad94d)return null;const _0x2d5cd0={};for(const _0x1d39f4 of[_0x2e60cb(0x15c),'stream','remove',_0x2e60cb(0x1f7),_0x2e60cb(0x1f0),_0x2e60cb(0x203)]){if(typeof _0xaad94d[_0x1d39f4]===_0x2e60cb(0x1eb))_0x2d5cd0[_0x1d39f4]=_0xaad94d[_0x1d39f4][_0x2e60cb(0x214)](_0xaad94d);}return Object['keys'](_0x2d5cd0)[_0x2e60cb(0x1b9)]?_0x2d5cd0:null;}function _0x38b828(_0x3663cb){const _0x4a8b35=_0x6ed6;return{'env':_0x3663cb[_0x4a8b35(0x1ad)][_0x4a8b35(0x214)](_0x3663cb),'createEnvironment':_0x3663cb[_0x4a8b35(0x101)][_0x4a8b35(0x214)](_0x3663cb),'removeEnvironment':_0x3663cb[_0x4a8b35(0x117)][_0x4a8b35(0x214)](_0x3663cb),'info':_0x3663cb[_0x4a8b35(0x172)],..._0x1ab661(_0x3663cb),'put':_0x3663cb[_0x4a8b35(0x143)][_0x4a8b35(0x214)](_0x3663cb),'update':_0x3663cb[_0x4a8b35(0x23c)][_0x4a8b35(0x214)](_0x3663cb),'patch':_0x3663cb['patch'][_0x4a8b35(0x214)](_0x3663cb),'create':_0x3663cb[_0x4a8b35(0x197)][_0x4a8b35(0x214)](_0x3663cb),'remove':_0x3663cb[_0x4a8b35(0x196)][_0x4a8b35(0x214)](_0x3663cb),'get':_0x3663cb[_0x4a8b35(0x1f7)][_0x4a8b35(0x214)](_0x3663cb),'getMany':_0x3663cb[_0x4a8b35(0x1e5)][_0x4a8b35(0x214)](_0x3663cb),'getEntry':_0x3663cb[_0x4a8b35(0x12d)][_0x4a8b35(0x214)](_0x3663cb),'getRange':_0x3663cb[_0x4a8b35(0x167)][_0x4a8b35(0x214)](_0x3663cb),'getValues':_0x3663cb[_0x4a8b35(0x129)][_0x4a8b35(0x214)](_0x3663cb),'getKeys':_0x3663cb[_0x4a8b35(0x105)][_0x4a8b35(0x214)](_0x3663cb),'getCount':_0x3663cb[_0x4a8b35(0x22e)][_0x4a8b35(0x214)](_0x3663cb),'getByPrefix':_0x3663cb[_0x4a8b35(0x25e)]['bind'](_0x3663cb),'getIndex':_0x3663cb[_0x4a8b35(0x26f)][_0x4a8b35(0x214)](_0x3663cb),'byIndex':_0x3663cb[_0x4a8b35(0x1a5)][_0x4a8b35(0x214)](_0x3663cb),'query':_0x3663cb[_0x4a8b35(0x1b1)][_0x4a8b35(0x214)](_0x3663cb),'setTTL':_0x3663cb[_0x4a8b35(0x15d)][_0x4a8b35(0x214)](_0x3663cb),'getTTL':_0x3663cb['getTTL'][_0x4a8b35(0x214)](_0x3663cb),'clearTTL':_0x3663cb[_0x4a8b35(0x1a2)][_0x4a8b35(0x214)](_0x3663cb),'sweepExpiredTTL':_0x3663cb[_0x4a8b35(0x142)][_0x4a8b35(0x214)](_0x3663cb),'listTTL':_0x3663cb['listTTL']['bind'](_0x3663cb),'ttlStats':_0x3663cb['ttlStats'][_0x4a8b35(0x214)](_0x3663cb),'setDefaultTTL':_0x3663cb[_0x4a8b35(0x240)][_0x4a8b35(0x214)](_0x3663cb),'getDefaultTTL':_0x3663cb[_0x4a8b35(0x264)][_0x4a8b35(0x214)](_0x3663cb),'clearDefaultTTL':_0x3663cb[_0x4a8b35(0x16a)][_0x4a8b35(0x214)](_0x3663cb),'ensureType':_0x3663cb['ensureType'][_0x4a8b35(0x214)](_0x3663cb),'registerType':_0x3663cb[_0x4a8b35(0x133)][_0x4a8b35(0x214)](_0x3663cb),'hasType':_0x3663cb[_0x4a8b35(0x227)][_0x4a8b35(0x214)](_0x3663cb),'dropType':_0x3663cb[_0x4a8b35(0x263)][_0x4a8b35(0x214)](_0x3663cb),'registerIndex':_0x3663cb[_0x4a8b35(0x186)][_0x4a8b35(0x214)](_0x3663cb),'hasIndex':_0x3663cb[_0x4a8b35(0x184)][_0x4a8b35(0x214)](_0x3663cb),'dropIndex':_0x3663cb[_0x4a8b35(0x1d4)]['bind'](_0x3663cb),'resetIndex':_0x3663cb[_0x4a8b35(0x221)]['bind'](_0x3663cb),'indexReady':_0x3663cb[_0x4a8b35(0x1fa)][_0x4a8b35(0x214)](_0x3663cb),'getIndexStatus':_0x3663cb[_0x4a8b35(0x192)]['bind'](_0x3663cb),'getClock':_0x3663cb['getClock'][_0x4a8b35(0x214)](_0x3663cb),'getChanges':_0x3663cb['getChanges'][_0x4a8b35(0x214)](_0x3663cb),'queue':_0x3663cb[_0x4a8b35(0x234)],'files':_0x3663cb['files']};}return okdbFunctionsFacades={'createEnvFacade':_0x59a442,'createQueueFacade':_0x58d2a1,'createFilesFacade':_0x184245,'createGlobalFacade':_0x38b828},okdbFunctionsFacades;}var okdbFunctionsDryrun,hasRequiredOkdbFunctionsDryrun;function requireOkdbFunctionsDryrun(){const _0x11ff97=_0x54ea2d;if(hasRequiredOkdbFunctionsDryrun)return okdbFunctionsDryrun;hasRequiredOkdbFunctionsDryrun=0x1;const _0x1d3c55=new Set([_0x11ff97(0x143),_0x11ff97(0x1f8),_0x11ff97(0x197),_0x11ff97(0x196),'update',_0x11ff97(0x15d),'clearTTL',_0x11ff97(0x142),'setDefaultTTL','clearDefaultTTL',_0x11ff97(0x263),_0x11ff97(0x1d4),'resetIndex']),_0x379de6=new Set(['enqueue','updateJob',_0x11ff97(0x1bb),_0x11ff97(0x160)]),_0x3bf67e=new Set([_0x11ff97(0x15c),_0x11ff97(0x196)]);function _0x5d2add(_0x48e94a,_0x1930bf){const _0x261b89=_0x11ff97;if(_0x48e94a===_0x261b89(0x1ad)||_0x48e94a===_0x261b89(0x1da))return _0x1d3c55[_0x261b89(0x11e)](_0x1930bf);if(_0x48e94a===_0x261b89(0x234))return _0x379de6[_0x261b89(0x11e)](_0x1930bf);if(_0x48e94a===_0x261b89(0x120))return _0x3bf67e[_0x261b89(0x11e)](_0x1930bf);return![];}function _0x4e01aa(_0x5ede3c,_0x8339a7,_0x3542c5,_0x4791a2){if(!_0x5ede3c)return _0x5ede3c;return new Proxy(_0x5ede3c,{'get'(_0x121b8f,_0x20429c,_0x327e93){const _0x393951=_0x6ed6,_0x254f68=Reflect[_0x393951(0x1f7)](_0x121b8f,_0x20429c,_0x327e93);if(typeof _0x254f68!=='function')return _0x254f68;if(!_0x5d2add(_0x8339a7,_0x20429c))return _0x254f68[_0x393951(0x214)](_0x121b8f);return function(..._0x26846e){const _0x6c927=_0x393951;return _0x4791a2[_0x6c927(0x1e3)]({'scope':_0x8339a7,'method':_0x20429c,'envName':_0x3542c5,'args':_0x26846e}),null;};}});}function _0x2f8658(_0x278fff,_0x19e5d8,_0x585608,_0x281ad3){const _0x23ddb5={};for(const _0x53f40e of _0x585608){_0x23ddb5[_0x53f40e]=(..._0x653d08)=>{const _0x539d76=_0x6ed6;return _0x5d2add(_0x278fff,_0x53f40e)&&_0x281ad3[_0x539d76(0x1e3)]({'scope':_0x278fff,'method':_0x53f40e,'envName':_0x19e5d8,'args':_0x653d08}),null;};}return _0x23ddb5;}return okdbFunctionsDryrun={'isWriteMethod':_0x5d2add,'wrapForDryRun':_0x4e01aa,'syntheticDryRunFacade':_0x2f8658,'ENV_WRITE_METHODS':_0x1d3c55,'QUEUE_WRITE_METHODS':_0x379de6,'FILES_WRITE_METHODS':_0x3bf67e},okdbFunctionsDryrun;}var okdbFunctionsContext,hasRequiredOkdbFunctionsContext;function _0x6ed6(_0x3556eb,_0x371026){_0x3556eb=_0x3556eb-0xfc;const _0x45d124=_0x45d1();let _0x6ed6c4=_0x45d124[_0x3556eb];return _0x6ed6c4;}function requireOkdbFunctionsContext(){const _0x13e457=_0x54ea2d;if(hasRequiredOkdbFunctionsContext)return okdbFunctionsContext;hasRequiredOkdbFunctionsContext=0x1;const {createEnvFacade:_0x126299,createQueueFacade:_0x5c041a,createFilesFacade:_0x389e40,createGlobalFacade:_0x323a0f}=requireOkdbFunctionsFacades(),{wrapForDryRun:_0x8b91d4,syntheticDryRunFacade:_0x569e49}=requireOkdbFunctionsDryrun(),_0x657d32=[_0x13e457(0x1e6),_0x13e457(0x17e),_0x13e457(0x1f0),_0x13e457(0x258),_0x13e457(0x1bb),_0x13e457(0x160),_0x13e457(0x1b4),_0x13e457(0x19c)],_0x7d0972=['upload',_0x13e457(0x1c8),_0x13e457(0x196),'get',_0x13e457(0x1f0),'getByPath'];function _0x3e3572(_0x3f5e2c,_0x3dc4eb){const _0x4f7b13=_0x13e457,_0x19a899=(_0x27741b,_0x4349dd,_0x1ee8eb)=>_0x3dc4eb({'type':_0x4f7b13(0x1b6),'requestId':_0x3f5e2c[_0x4f7b13(0x1f4)],'runId':_0x3f5e2c[_0x4f7b13(0x18c)],'entry':{'level':_0x27741b,'msg':_0x4349dd,'context':_0x1ee8eb,'ts':Date[_0x4f7b13(0x247)]()}}),_0x37a069=(_0x10f1db,_0x4e5baa)=>_0x19a899('info',_0x10f1db,_0x4e5baa);return _0x37a069[_0x4f7b13(0x172)]=(_0x47454c,_0x4d7cbb)=>_0x19a899(_0x4f7b13(0x172),_0x47454c,_0x4d7cbb),_0x37a069[_0x4f7b13(0x150)]=(_0x1adba0,_0x1ded5d)=>_0x19a899(_0x4f7b13(0x150),_0x1adba0,_0x1ded5d),_0x37a069[_0x4f7b13(0x130)]=(_0x24a279,_0x4152cd)=>_0x19a899(_0x4f7b13(0x130),_0x24a279,_0x4152cd),_0x37a069[_0x4f7b13(0x191)]=(_0xe8eb04,_0x1fcc45)=>_0x19a899('debug',_0xe8eb04,_0x1fcc45),_0x37a069;}function _0x250cf6(_0x2ca7e3,_0x195b97,_0x594654){const _0x18f8fc=_0x13e457;if(!_0x2ca7e3)return null;return{'id':_0x2ca7e3['id']??null,'type':_0x2ca7e3[_0x18f8fc(0x23d)]??null,'tries':_0x2ca7e3[_0x18f8fc(0x268)]??null,'created':_0x2ca7e3['created']??null,'tags':_0x2ca7e3[_0x18f8fc(0x21c)]??null,'priority':_0x2ca7e3[_0x18f8fc(0x159)]??null,'bucket':_0x2ca7e3[_0x18f8fc(0x14a)]??null,'cron':_0x2ca7e3[_0x18f8fc(0x112)]??null,'heartbeat'(){const _0x29f8dd=_0x18f8fc;_0x594654({'type':_0x29f8dd(0x12c),'requestId':_0x195b97[_0x29f8dd(0x1f4)],'runId':_0x195b97['runId'],'jobId':_0x2ca7e3['id'],'claimId':_0x2ca7e3[_0x29f8dd(0x215)]});},'markProgress'(_0x20cb19){const _0x3cc49c=_0x18f8fc;_0x594654({'type':_0x3cc49c(0x206),'requestId':_0x195b97['requestId'],'runId':_0x195b97[_0x3cc49c(0x18c)],'jobId':_0x2ca7e3['id'],'claimId':_0x2ca7e3[_0x3cc49c(0x215)],'message':_0x20cb19});}};}function _0x45d8d2(_0x2b2aca){const _0x5dd1f5=_0x13e457;if(!_0x2b2aca)return null;return{'mode':_0x2b2aca[_0x5dd1f5(0x17b)]??null,'sourceType':_0x2b2aca['sourceType']??null,'sourceEnv':_0x2b2aca[_0x5dd1f5(0x10f)]??null,'processor':_0x2b2aca[_0x5dd1f5(0x15a)]??null,'engineKey':_0x2b2aca[_0x5dd1f5(0x1fb)]??null,'cursorKey':_0x2b2aca['cursorKey']??null};}function _0x3dfe03(_0x143077){const _0x33751f=_0x13e457;if(!_0x143077)return null;return{'mode':_0x143077[_0x33751f(0x17b)]??null,'sourceType':_0x143077[_0x33751f(0x106)]??null,'targetType':_0x143077['targetType']??null,'sourceEnv':_0x143077[_0x33751f(0x10f)]??null,'targetEnv':_0x143077[_0x33751f(0x241)]??null,'engineKey':_0x143077[_0x33751f(0x1fb)]??null,'cursorKey':_0x143077['cursorKey']??null};}function _0x2255fb(_0x5895b4,_0x3c1f5b,_0x56d651,_0x22948e=null,_0x2a50f7=null){const _0x24afa9=_0x13e457,_0x3661f0={'runId':_0x3c1f5b[_0x24afa9(0x18c)],'scope':_0x24afa9(0x1ad),'env':_0x3c1f5b[_0x24afa9(0x1d3)]??null,'functionName':_0x3c1f5b[_0x24afa9(0x25d)],'trigger':_0x3c1f5b[_0x24afa9(0x172)]?.[_0x24afa9(0x237)]??'sdk','requestedAt':_0x3c1f5b[_0x24afa9(0x172)]?.[_0x24afa9(0x12b)]??Date[_0x24afa9(0x247)]()},_0x3f10f0=_0x3e3572(_0x3c1f5b,_0x56d651),_0xc950b3=AbortSignal[_0x24afa9(0x1a0)](Math['max'](0x1,_0x3c1f5b[_0x24afa9(0x148)]?.[_0x24afa9(0x205)]??0x3e8)),_0x3be2cb=_0x2a50f7?AbortSignal[_0x24afa9(0x173)]([_0xc950b3,_0x2a50f7]):_0xc950b3,_0x432f34=_0x5895b4[_0x24afa9(0x1ad)](_0x3c1f5b[_0x24afa9(0x1d3)]),_0x9480b3=_0x22948e?_0x8b91d4(_0x432f34,_0x24afa9(0x1ad),_0x3c1f5b[_0x24afa9(0x1d3)],_0x22948e):_0x432f34,_0x5a43a2=_0x22948e?_0x432f34[_0x24afa9(0x234)]?_0x8b91d4(_0x432f34['queue'],_0x24afa9(0x234),_0x3c1f5b[_0x24afa9(0x1d3)],_0x22948e):_0x569e49(_0x24afa9(0x234),_0x3c1f5b[_0x24afa9(0x1d3)],_0x657d32,_0x22948e):_0x432f34['queue'],_0xf37eab=_0x22948e?_0x432f34['files']?_0x8b91d4(_0x432f34[_0x24afa9(0x120)],_0x24afa9(0x120),_0x3c1f5b[_0x24afa9(0x1d3)],_0x22948e):_0x569e49('files',_0x3c1f5b['envName'],_0x7d0972,_0x22948e):_0x432f34[_0x24afa9(0x120)],_0x138540=_0x126299(_0x9480b3),_0x9595fc=_0x5c041a(_0x5a43a2),_0x3f184a=_0x389e40(_0xf37eab);if(_0x9595fc)_0x138540['queue']=_0x9595fc;if(_0x3f184a)_0x138540[_0x24afa9(0x120)]=_0x3f184a;const _0xe98c0c={'payload':_0x3c1f5b[_0x24afa9(0x1a3)]??null,'info':_0x3661f0,'signal':_0x3be2cb,'log':_0x3f10f0,'env':_0x138540},_0x1c2cfa=_0x250cf6(_0x3c1f5b[_0x24afa9(0x1a6)],_0x3c1f5b,_0x56d651);if(_0x1c2cfa)_0xe98c0c[_0x24afa9(0x166)]=_0x1c2cfa;const _0x3c7de4=_0x45d8d2(_0x3c1f5b[_0x24afa9(0x1d7)]);if(_0x3c7de4)_0xe98c0c[_0x24afa9(0x15a)]=_0x3c7de4;const _0xe90a4f=_0x3dfe03(_0x3c1f5b['materializerContext']);if(_0xe90a4f)_0xe98c0c[_0x24afa9(0x138)]=_0xe90a4f;if(_0x3c1f5b[_0x24afa9(0x123)]){const _0x123e7a=_0x22948e?_0x8b91d4(_0x5895b4,'global',null,_0x22948e):_0x5895b4;_0xe98c0c[_0x24afa9(0x1f2)]=_0x323a0f(_0x123e7a);}return _0xe98c0c;}return okdbFunctionsContext={'createExecutionContext':_0x2255fb,'createScriptLogger':_0x3e3572},okdbFunctionsContext;}var hasRequiredOkdbFunctionsSandboxWorker;function requireOkdbFunctionsSandboxWorker(){const _0x34de0f=_0x54ea2d;if(hasRequiredOkdbFunctionsSandboxWorker)return okdbFunctionsSandboxWorker$1;hasRequiredOkdbFunctionsSandboxWorker=0x1;const {parentPort:_0x5befed,workerData:_0x14a10a}=require$$0$3;requireOkdbFatalReport()['enableFatalReport'](_0x34de0f(0xff));const _0x48d286=require$$2,{compileFunctionExpression:_0x274e9f}=requireOkdbFunctionsSandbox(),{serializeError:_0x568766}=requireOkdbFunctionsIpc(),{createExecutionContext:_0x42128f}=requireOkdbFunctionsContext(),_0x40fa96=require$$6;let _0xdc825b=null,_0x557d37=![];const _0x1061ca=new Map(),_0x48097c=new Map();function _0x330825(_0x19038c){const _0x2b49c7=_0x34de0f;try{_0x5befed[_0x2b49c7(0x10b)](_0x19038c);}catch{}}function _0x182931(_0x486119){const _0x5475cc=_0x34de0f,_0x1643bf=(_0x486119[_0x5475cc(0x1d3)]||_0x5475cc(0x1d9))+':'+_0x486119[_0x5475cc(0x25d)]+':'+_0x486119[_0x5475cc(0x1d8)]+':'+_0x486119[_0x5475cc(0x16b)];let _0x552f3f=_0x1061ca[_0x5475cc(0x1f7)](_0x1643bf);return!_0x552f3f&&(_0x552f3f=_0x274e9f(_0x486119[_0x5475cc(0x21e)],{'allowFetch':_0x486119['runtime']?.[_0x5475cc(0xfe)]!==![],'allowedFetchDomains':_0x486119['runtime']?.[_0x5475cc(0x189)],'filename':_0x486119[_0x5475cc(0x25d)]+_0x5475cc(0x232)}),_0x1061ca[_0x5475cc(0x1d1)](_0x1643bf,_0x552f3f)),_0x552f3f;}async function _0x4ba7e8(_0x272e68){const _0x1c0ae3=_0x34de0f,_0x5b8a3d=Date[_0x1c0ae3(0x247)](),_0x8b7aeb=new AbortController();_0x48097c['set'](_0x272e68[_0x1c0ae3(0x1f4)],_0x8b7aeb);try{const _0x5a1402=_0x182931(_0x272e68);if(_0x272e68[_0x1c0ae3(0x1d3)])await _0xdc825b[_0x1c0ae3(0x21f)](_0x272e68[_0x1c0ae3(0x1d3)]);const _0x476b6b=_0x272e68['dryRun']?[]:null,_0x380968=_0x42128f(_0xdc825b,_0x272e68,_0x330825,_0x476b6b,_0x8b7aeb[_0x1c0ae3(0x116)]),_0x21fd06=await _0x5a1402(_0x380968),_0x5abe31={'type':_0x1c0ae3(0x266),'requestId':_0x272e68[_0x1c0ae3(0x1f4)],'runId':_0x272e68[_0x1c0ae3(0x18c)],'result':_0x21fd06,'meta':{'runnerId':_0x1c0ae3(0x26b)+process[_0x1c0ae3(0x1ba)],'startedAt':_0x5b8a3d,'finishedAt':Date[_0x1c0ae3(0x247)](),'durationMs':Date[_0x1c0ae3(0x247)]()-_0x5b8a3d}};if(_0x476b6b)_0x5abe31[_0x1c0ae3(0x224)]=_0x476b6b;_0x330825(_0x5abe31);}catch(_0x4f2a17){_0x330825({'type':'error','requestId':_0x272e68[_0x1c0ae3(0x1f4)],'runId':_0x272e68[_0x1c0ae3(0x18c)],'error':_0x568766(_0x4f2a17),'meta':{'runnerId':'sandbox-'+process['pid'],'startedAt':_0x5b8a3d,'finishedAt':Date[_0x1c0ae3(0x247)](),'durationMs':Date[_0x1c0ae3(0x247)]()-_0x5b8a3d}});}finally{_0x48097c[_0x1c0ae3(0x222)](_0x272e68[_0x1c0ae3(0x1f4)]);}}async function _0xdfb500(){const _0x5d7ce7=_0x34de0f;if(_0x557d37)return;_0x557d37=!![];try{await _0xdc825b?.[_0x5d7ce7(0x108)]?.();}catch{}process['exit'](0x0);}async function _0x47fa87(){const _0x4ce655=_0x34de0f,{rootPath:_0x1dab8a}=_0x14a10a??{};if(!_0x1dab8a)throw new Error(_0x4ce655(0x1b3));_0xdc825b=new _0x40fa96(_0x1dab8a,{'engines':![],'processors':![],'compaction':![],'http':![],'auth':{'open':!![]},'processes':![]}),await _0xdc825b[_0x4ce655(0x22b)]();const _0x432ed4=setInterval(()=>{const _0x369fd2=_0x4ce655;if(_0x557d37)return;for(const [,_0x4e0836]of _0xdc825b[_0x369fd2(0x257)]){try{_0x4e0836[_0x369fd2(0x1ce)]?.();}catch{}}},0xc8);if(typeof _0x432ed4[_0x4ce655(0x135)]===_0x4ce655(0x1eb))_0x432ed4['unref']();_0x5befed['on'](_0x4ce655(0x11c),_0x395678=>{const _0x51f2ca=_0x4ce655;if(!_0x395678||typeof _0x395678!=='object')return;if(_0x395678[_0x51f2ca(0x23d)]===_0x51f2ca(0x1cc))return void _0xdfb500();if(_0x395678[_0x51f2ca(0x23d)]==='cancel'){_0x48097c[_0x51f2ca(0x1f7)](_0x395678[_0x51f2ca(0x1f4)])?.[_0x51f2ca(0x1ee)](new Error(_0x51f2ca(0x20e)));return;}_0x395678['type']===_0x51f2ca(0x1ed)&&void _0x4ba7e8(_0x395678[_0x51f2ca(0x166)]);});const _0x29f7ac=Math[_0x4ce655(0x190)](0x3e8,Number(process.env.OKDB_STATS_INTERVAL_MS)||0x1388),_0xf9d9e6=setInterval(()=>{const _0x2a3428=_0x4ce655;try{_0x330825({'type':_0x2a3428(0x19d),'heapUsed':_0x48d286[_0x2a3428(0x109)]()[_0x2a3428(0x201)]});}catch{}},_0x29f7ac);if(typeof _0xf9d9e6[_0x4ce655(0x135)]==='function')_0xf9d9e6[_0x4ce655(0x135)]();_0x330825({'type':_0x4ce655(0x119)});}return _0x47fa87()[_0x34de0f(0x207)](_0x59d366=>{const _0x1a0b4f=_0x34de0f;_0x330825({'type':_0x1a0b4f(0x17a),'error':_0x568766(_0x59d366)}),process[_0x1a0b4f(0x185)](0x1);}),okdbFunctionsSandboxWorker$1;}var okdbFunctionsSandboxWorkerExports=requireOkdbFunctionsSandboxWorker(),okdbFunctionsSandboxWorker=getDefaultExportFromCjs(okdbFunctionsSandboxWorkerExports);module[_0x54ea2d(0x25a)]=okdbFunctionsSandboxWorker;function _0x45d1(){const _0x267aca=['transaction\x20commit\x20failed','txnId','clear','transaction','_startAdmission','bind','claimId','OKDBIndexHasConsumersError','Function\x20script\x20failed\x20to\x20initialize','\x20references\x20','constructor','_doHooks','bus:drain','tags','getChanges','script','openEnv','useReadTransaction','resetIndex','delete','FUNCTION_SCRIPT_COMPILE_FAILED','dryRunActions','system:poke','OKDBIndexNotRegisteredError','hasType','failures','loop-lag\x20','Function\x20script\x20must\x20evaluate\x20to\x20a\x20callable\x20function','open','action','\x20actions=','getCount','bus:type_drop','_undoHooks','TXN_START','.okdb-function.js','excludeEnv','queue','NOT_FOUND','note','trigger','dropping',':\x20expected\x20','crypto','7vdbBpx','update','type','keys','bus:env_release','setDefaultTTL','targetEnv','TXN_INVALID_OPS','txn:end','stack','errors','\x20does\x20not\x20exist','now','disable','835724HJTsyI','mkdirSync','_closed','started','report','system:env_release','152oiKxSE','FETCH_NOT_ALLOWED','maxExtra','txn\x20op\x20must\x20be\x20an\x20object\x20or\x20tuple','\x27\x20on\x20type\x20\x27','INVALID_PRIMARY_KEY','maxMs','_windowCbs','_envs','updateJob','_assertOpen','exports','rollback','OKDBInvalidPrimaryKeyError','functionName','getByPrefix','INDEX_NOT_REGISTERED','ttlStats','actions','captureStackTrace','dropType','getDefaultTTL','globalThis','result','OKDBError','tries','map','clearTtl','sandbox-','readTransaction','203553ugLxyK','percentile','getIndex','TYPE_NOT_REGISTERED','INDEX_HAS_CONSUMERS','OKDBSchemaCollectionError','67662zaqOjn','allowFetch','sandbox','_buckets','createEnvironment','cause','mean','setTtl','getKeys','sourceType','\x27\x20doesn\x27t\x20exist','close','getHeapStatistics','Unknown\x20OKDB\x20transaction\x20error','postMessage','FOREIGN_KEY_DELETE_RESTRICTED','resetting','system:drain','sourceEnv','path','\x22\x20on\x20\x22','cron','entries','unique:violation','index:registered','signal','removeEnvironment','TXN_ERROR','ready','TYPE_ALREADY_REGISTERED','hasOwnProperty','message','options','has','size','files','true','OKDBNotFoundError','unsafe','644830dKGqyN','reset','system:type_drop','TXN_END','index:ready','getValues','Schema\x20validation\x20failed\x20for\x20','requestedAt','job_heartbeat','getEntry','_report','TXN_INVALID_OP','error','OKDBSchemaValidationError',']\x20already\x20maps\x20to\x20\x27','registerType','toFixed','unref','Cannot\x20delete\x20','\x27\x20already\x20registered','materializer','createWriteFacade','range','code','INDEX_ALREADY_REGISTERED','OKDBForeignKeyDeleteError','type:registered','ttl:set','system:ready','win32','sweepExpiredTTL','put','ensureType','Unsupported\x20transaction\x20action:\x20','key','.\x20Only\x20primitives,\x20null,\x20Buffers,\x20and\x20arrays\x20are\x20allowed.\x20Got:\x20','runtime','fts:drop','bucket','getTTL','stderr','629464IewzxB','fetch\x20blocked:\x20hostname\x20\x22','index:drop','warn','dropFts','license:activated','unique:violation_resolved','ms\x20busy=','txn-commit','url','enable','applyOps','priority','processor','_closeReadTransaction','upload','setTTL','OKDBVersionMismatchError','OKDBTypeNotRegisteredError','addBucket','call','halted','ttl:clear',',\x20got\x20','dropSchema','job','getRange','item:remove','emit','clearDefaultTTL','hash','reportOnSignal','\x20already\x20exists','VERSION_MISMATCH','commit','system:clock_change','Foreign\x20key\x20violation:\x20','info','any','compileTimeoutMs','\x27,\x20cannot\x20map\x20to\x20\x27','TXN_ROLLBACK','__esModule','hostname','join','fatal','mode','\x22\x20is\x20not\x20in\x20the\x20allowedFetchDomains\x20list','ms\x20mean=','getJob','filename','Function\x20script\x20failed\x20to\x20compile','Type\x20\x27','name','system:stopped','hasIndex','exit','registerIndex','6024840JaDVKt','OKDBInvalidValueError','allowedFetchDomains','item:update','OKDBForeignKeyError','runId','Invalid\x20primary\x20key\x20type:\x20','_timer','schema:drop','max','debug','getIndexStatus','_log','slice','OKDBTypeAlreadyRegisteredError','remove','create','\x22\x20is\x20used\x20by:\x20','enabled','args','system:bus_state_change','listBuckets','stats','\x20which\x20does\x20not\x20exist','txn:rollback','timeout','ms\x20max=','clearTTL','payload','reject','byIndex','jobContext','targetKey','ms\x20p99=','isArray','references','ttl','env:removed','env','_started','start','bus:poke','query','string','sandbox\x20worker:\x20rootPath\x20missing\x20from\x20workerData','getBucket','kind','log','default','Cannot\x20set\x20enforce\x20schema\x20on\x20','length','pid','removeJob','Index\x20\x27','789576NlbYzN','createContext','Invalid\x20index\x20key\x20type\x20for\x20\x27','node:perf_hooks','Unknown\x20custom\x20function\x20error','\x20documents\x20fail\x20validation','registerFts','Version\x20mismatch\x20for\x20','.\x20Primary\x20keys\x20must\x20be\x20string\x20or\x20number.\x20Got:\x20','OKDBAlreadyExistsError','onDo','stream','done','OKDBInvalidIndexKeyError','label','stop','view:progress','_drainHandler','_admissionStarted','ref:violation_resolved','set','_writer','envName','dropIndex','Unknown\x20transaction\x20action:\x20','stopped','processorContext','version','~system','global','txn','starting','prototype','targetType','3dXzdwW','_admissionTimer','getClock','schema:set','push','fieldPath','getMany','enqueue','sort','reduce','Index\x20\x22','runInContext','function','(worst\x20','run','abort','stringify','list','license:removed','okdb','uuid','requestId','ttl:expired','\x20document(s)\x20reference\x20it\x20with\x20onDelete:restrict','get','patch','directory','indexReady','engineKey','creating','freeze','TXN_INVALID_ACTION','events','details','used_heap_size','count','getByPath','SCHEMA_COLLECTION_INVALID','timeoutMs','job_progress','catch','fts:reset','Script','txn:start','geoQuery','\x27\x20is\x20already\x20registered',':\x20key\x20[','cancelled\x20by\x20caller'];_0x45d1=function(){return _0x267aca;};return _0x45d1();}