@kedem/okdb 1.8.18 → 1.9.1
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/bin/okdb.js +1 -1
- package/docs/change-log.md +16 -16
- package/docs/embeddings.md +1 -1
- package/docs/functions.md +26 -25
- package/docs/http-cluster.md +157 -0
- package/docs/index.md +1 -0
- package/docs/manifest.json +5 -1
- package/docs/process-registry.md +185 -0
- package/docs/processors.md +61 -65
- package/docs/queue.md +23 -13
- package/docs/subscriptions.md +230 -0
- package/docs/worker-fleet.md +139 -0
- package/okdb-functions-runner-child.js +1 -1
- package/okdb-functions-sandbox-worker.js +1 -0
- package/okdb-http-worker-child.js +1 -0
- package/okdb-queue-load-handler.js +1 -0
- package/okdb-queue-spawn-child.js +1 -1
- package/okdb-views-bootstrap-worker.js +1 -1
- package/okdb-worker-child.js +1 -0
- package/okdb.js +1 -1
- package/package.json +1 -1
- package/public/sections/db/parts/db-overview.ok.js +1 -1
- package/public/sections/embeddings/parts/pipeline-create-panel.ok.js +1 -1
- package/public/sections/queue/parts/queue-jobs.ok.js +1 -1
- package/public/sections/system/index.ok.html +1 -1
- package/public/sections/system/modals/data-ops-modal.ok.js +1 -1
- package/public/sections/system/parts/system-process-panel.ok.js +1 -0
- package/public/sections/system/parts/system-processing-panel.ok.js +1 -0
- package/public/sections/system/parts/system-runtime-overview.ok.js +1 -0
- package/public/sections/system/parts/system-workers-panel.ok.js +1 -0
- package/types/environment.d.ts +21 -4
- package/types/features/embeddings.d.ts +11 -2
- package/types/features/queue.d.ts +27 -5
- package/types/features/views.d.ts +10 -10
- package/types/index.d.ts +54 -6
- package/types/options.d.ts +12 -0
- package/okdb-fts-handler.js +0 -1
- package/okdb-processor-worker.js +0 -1
- package/public/sections/processors/index.ok.html +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';function _0x450a(){const _0x4e5602=['item:create','lag','info','_onTick','emit','cluster-wide','node:perf_hooks','reset','SYSTEM_POKE','system:stopped','env:removed','cluster','compaction','system:drain','killable','clearThreadStats','type','ITEM_CREATE','setupPrimary','dropIndex','keys','_handlePoke','map','node','attach','kill','push','license:added','enabled','delete','nodesView','listenAddr','error','indexOf','type:drop','startedAt','embedded','\x20worker\x20slot=','async','(worst\x20','cursorKey','selfKey','license:activated','halted','detachConsole','INDEX_RESET','_timer','process','_statusEnv','heapTotal','ttl:clear','_openEnvLazy','online','_maybePublish','host','data','state','claimGated','addSupervisedChild','_buckets','processKey','_clusterOrphanWatch','[okdb-cluster]\x20worker\x20pid=','okdb-http-worker-child.js','mode','note','_lastCpuAt','removeSync','_isReader','replace','_nodeDb','_ensureDesired','_caps','system:type_drop','threads','_listenAddr','running','external','http','slice','[okdb-cluster]\x20slot=','dropType','waiting','enable','close','add','toFixed','_draining','_drain','_processingPolicy','11361pyqYFm','instanceId',')\x20exited\x20','expiresAt','ITEM_REMOVE','_scheduleFlush','maxMs','startsWith','registerType','isActive','has','listNodes','_drainOne','_lastPublishAt','ms\x20busy=','_supervisorKey','processor:paused','cluster:','_groupByProcess','txn:end','_threadStats','_dedupeKey','round','ms\x20max=','item:update','log','rows=','reap','txn:rollback','processor:ready','./okdb','stopped','respawnTimer','bus:poke','dropSchema','--test','some','workers',');\x20','FTS_RESET','_kind','_log','getDesired','getProcess','version','ttl:expired','system:ready','putNode','processor:retry','\x20stays\x20down\x20on\x20boot\x20(durable\x20decommission)','bus:type_drop','force','epoch','ms\x20p99=','processor','created','index:ready','1ofN:','send','assign','kind','put','write','4863960sAxTmT','mean','openDB','execArgv','setOwnMeta','setDesired','SIGKILL','cpuPct','_startAdmission','_children','~processes:desired','unref','none','getChanges','schema:drop','_putRowAsync','ms/','attachFeed','system:poke','_startedAt','disconnect','win32','start','_getType','object','supervisorKey','meta','_quantum','hasDesired','isDead','getClock','function','_onProcEvent','\x20forked\x20','find','_rowKey','--inspect','dropFts','true','maxExtra','worker','[okdb-cluster]\x20recommissioned\x20worker\x20slot=','prototype','cpuUsage','\x20worker(s)\x20still\x20serving','_handleInProcess','msg','view:progress','loop-lag\x20','all','_clusterOnMessage','platform','getRange','role','system:bus_state_change','\x20worker(s)\x20remaining','_seen','processors','join','_pending','slot','from','_lastCpuPct','ITEM_UPDATE','_activateProcesses','updateSupervisedChildStats','system','number','_dedupeMax','inst:','stats','entries','cli','_clusterWorkerAttached','_flushTimer','processes','workersConfigured','_baselines','decommission','fromEntries','__okdbSlot','instances','env','[okdb-cluster]\x20change-feed\x20init\x20failed:\x20','_desired','(code=','_flushDebounce','_buildProcessingFacet','warn','clear','cpus','lifecycle','\x20(durable\x20desired-state)','8009631FOmwmq','INDEX_PROGRESS','_nodeDead','ingest','fts:reset','INDEX_REGISTERED','_report','then','randomUUID','_onPoke','change','hasOwnProperty','ephemeral','catch','\x20(slot=','passive','filter','processorsView','_admissionStarted','http\x20worker\x20child\x20failed:\x20','index:registered','[okdb-cluster]\x20','\x20ipc\x20error:\x20','_buildChildRow','3449768xUsskN','okdb','size','hard-killed','default','hostname','ttl:set','_ownMeta','code','SYSTEM_PROC','connected','_nodeDbFor','_cursors','clusterStatusView','8070472AbBZYI','_markSeen','includes','okdb-http-worker-child:\x20rootPath\x20and\x20port\x20required','onWindow','reduce','transactionSync','offWindow','single','fanout','FTS_DROP','message','_hbTimer','_adminRelay','string','events','1442DBAoIE','length','exports','fts:registered','nodeKey','stop','~processes:cmd','building','license:removed','CHANGEFEED_QUANTUM','sort','_envs','resetFts','creating','removeNode','label','percentile','pushEphemeral','system:proc','values','crypto','publishOwnRow','get','user','rss','count','next','startHeartbeat','unique:violation_resolved','fts:drop','starting','options','env:opened','pid','_selfKey','_instanceId','__okdbCluster','rowKey','now','deaths','fn-runner','remove','listen','uptime','_isWriter','dead','ppid','processor:error','_onStop','[okdb-cluster]\x20primary\x20pid=','REMOVE','_admissionTimer','VIEW_PROGRESS','_started','min','publishChildRow','_lastCpuUsage','resetting','isWorker','ready','1561704IfPNXu','hasType','lastClock','processor:progress','_publishNow','_rootDb','_onItem','exit','_nodeDbCache','__esModule','2PZnJfg','node/','entry','node:events','primary','queue-worker','processing','SYSTEM_STOPPED','max','heapUsed','http-server','claims','registerIndex','started','16326VRjXuy','path','set','_processStartedAt','ref:violation','dedupeMax','memoryUsage','\x20in\x20','off','isPrimary','bus:drain','status','stringify','_lastCpuWindowMs','listDesired','_buildOwnRow','once','flushDebounce','_cmd','stderr','_windowCbs','isConnected','--print','caps','[okdb-cluster]\x20respawning\x20worker\x20slot=','children','consecutiveFailures'];_0x450a=function(){return _0x4e5602;};return _0x450a();}const _0xd218e=_0x2a26;(function(_0x24f12e,_0x4ba9a8){const _0x77583e=_0x2a26,_0x2ebfd4=_0x24f12e();while(!![]){try{const _0x15718f=-parseInt(_0x77583e(0x13a))/0x1+parseInt(_0x77583e(0xb7))/0x2*(-parseInt(_0x77583e(0xad))/0x3)+parseInt(_0x77583e(0x1ee))/0x4+parseInt(_0x77583e(0x179))/0x5+-parseInt(_0x77583e(0xc5))/0x6*(parseInt(_0x77583e(0x71))/0x7)+-parseInt(_0x77583e(0x1fc))/0x8+parseInt(_0x77583e(0x1d6))/0x9;if(_0x15718f===_0x4ba9a8)break;else _0x2ebfd4['push'](_0x2ebfd4['shift']());}catch(_0x4368a0){_0x2ebfd4['push'](_0x2ebfd4['shift']());}}}(_0x450a,0x98539));var require$$0$3=require(_0xd218e(0x158)),require$$1=require('cluster'),require$$1$1=require(_0xd218e(0xc6)),require$$0$1=require('os'),require$$2=require(_0xd218e(0x85)),require$$0=require(_0xd218e(0xe6)),require$$0$2=require(_0xd218e(0xba));function getDefaultExportFromCjs(_0x4f71ad){const _0x2c009f=_0xd218e;return _0x4f71ad&&_0x4f71ad[_0x2c009f(0xb6)]&&Object[_0x2c009f(0x1a3)][_0x2c009f(0x1e1)]['call'](_0x4f71ad,_0x2c009f(0x1f2))?_0x4f71ad[_0x2c009f(0x1f2)]:_0x4f71ad;}var okdbHttpWorkerChild$1={},okdbEnums,hasRequiredOkdbEnums;function requireOkdbEnums(){const _0xf39004=_0xd218e;if(hasRequiredOkdbEnums)return okdbEnums;hasRequiredOkdbEnums=0x1;const _0x8d4a1f={'PUT':_0xf39004(0x177),'REMOVE':_0xf39004(0x9a),'INDEX_DROP':_0xf39004(0xf3),'INDEX_REGISTER':_0xf39004(0xc3),'INDEX_RESET':'resetIndex','TYPE_REGISTER':'registerType','TYPE_DROP':_0xf39004(0x131),'FTS_REGISTER':'registerFts','FTS_DROP':_0xf39004(0x19e),'FTS_RESET':_0xf39004(0x7d),'SCHEMA_SET':'setSchema','SCHEMA_DROP':_0xf39004(0x15c),'TTL_SET':'setTtl','TTL_CLEAR':'clearTtl'},_0x2bfade={'SYSTEM_READY':_0xf39004(0x168),'SYSTEM_STOPPED':_0xf39004(0xe9),'SYSTEM_CLOCK_CHANGE':'system:clock_change','SYSTEM_POKE':_0xf39004(0x18b),'SYSTEM_DRAIN':_0xf39004(0xed),'SYSTEM_TYPE_DROP':_0xf39004(0x129),'SYSTEM_PROC':_0xf39004(0x83),'SYSTEM_BUS_STATE_CHANGE':_0xf39004(0x1af),'ITEM_CREATE':_0xf39004(0xe0),'ITEM_UPDATE':_0xf39004(0x152),'ITEM_REMOVE':'item:remove','INDEX_RESET':'index:reset','INDEX_READY':_0xf39004(0x172),'INDEX_PROGRESS':'index:progress','VIEW_PROGRESS':_0xf39004(0x1a8),'INDEX_DROP':'index:drop','INDEX_REGISTERED':_0xf39004(0x1ea),'FTS_REGISTERED':_0xf39004(0x74),'FTS_DROP':_0xf39004(0x8e),'FTS_RESET':_0xf39004(0x1da),'SCHEMA_SET':'schema:set','SCHEMA_DROP':_0xf39004(0x187),'UNIQUE_VIOLATION':'unique:violation','UNIQUE_VIOLATION_RESOLVED':_0xf39004(0x8d),'REF_VIOLATION':_0xf39004(0xc9),'REF_VIOLATION_RESOLVED':'ref:violation_resolved','SYNC_APPLY':'sync:apply','TXN_START':'txn:start','TXN_END':_0xf39004(0x14d),'TXN_ROLLBACK':_0xf39004(0x156),'TYPE_REGISTERED':'type:registered','TYPE_DROP':_0xf39004(0x102),'ENV_OPENED':_0xf39004(0x91),'ENV_REMOVED':_0xf39004(0xea),'TTL_EXPIRED':_0xf39004(0x167),'TTL_SET':_0xf39004(0x1f4),'TTL_CLEAR':_0xf39004(0x112),'LICENSE_INVALID':'license:invalid','LICENSE_ADDED':_0xf39004(0xfb),'LICENSE_ACTIVATED':_0xf39004(0x10a),'LICENSE_REMOVED':_0xf39004(0x79)},_0x48de69={'CREATING':_0xf39004(0x7e),'RESETTING':_0xf39004(0xaa),'READY':'ready','DROPPING':'dropping','WAITING':_0xf39004(0x132)},_0x5bc8cb={'CREATED':_0xf39004(0x171),'STARTING':_0xf39004(0x8f),'STARTED':_0xf39004(0xc4),'STOPPING':'stopping','STOPPED':_0xf39004(0x159)},_0x41f384={'CREATING':_0xf39004(0x7e),'READY':_0xf39004(0xac),'HALTED':_0xf39004(0x10b),'STOPPED':_0xf39004(0x159),'RESETTING':_0xf39004(0xaa)},_0x217e66=Object['freeze']({'POKE':_0xf39004(0x15b),'DRAIN':_0xf39004(0xcf),'TYPE_DROP':_0xf39004(0x16c),'PROC':'bus:proc'});return okdbEnums={'BUS_EVENTS':_0x217e66,'CHANGE_ACTIONS':_0x8d4a1f,'EVENTS':_0x2bfade,'INDEX_STATE':_0x48de69,'OKDB_STATE':_0x5bc8cb,'VIEW_STATE':_0x41f384},okdbEnums;}function _0x2a26(_0x2f541e,_0x3fff5b){_0x2f541e=_0x2f541e-0x6c;const _0x450af0=_0x450a();let _0x2a26c2=_0x450af0[_0x2f541e];return _0x2a26c2;}var okdbLoopMonitor,hasRequiredOkdbLoopMonitor;function requireOkdbLoopMonitor(){const _0x44306f=_0xd218e;if(hasRequiredOkdbLoopMonitor)return okdbLoopMonitor;hasRequiredOkdbLoopMonitor=0x1;const {monitorEventLoopDelay:_0x1b30d5,performance:_0x278c64}=require$$0,_0x2c370e=process.env.OKDB_LOOP_LAG==='1'||process.env.OKDB_LOOP_LAG===_0x44306f(0x19f),_0x4aa748=Number(process.env.OKDB_LOOP_LAG_MS)||0x7d0,_0x43ac7d=process.env.OKDB_LOOP_LAG_ALL==='1',_0x57e28a=Number(process.env.OKDB_LOOP_LAG_MIN_MS)||0x64;class _0x4fd049{constructor(){const _0x11a8b7=_0x44306f;this[_0x11a8b7(0xfc)]=_0x2c370e,this[_0x11a8b7(0x11b)]=new Map(),this['_h']=null,this['_timer']=null,this[_0x11a8b7(0xa6)]=![],this['_log']=(_0x432295,_0x3e6498)=>process[_0x11a8b7(0xd8)][_0x11a8b7(0x178)](_0x432295+(_0x3e6498?'\x20'+JSON[_0x11a8b7(0xd1)](_0x3e6498):'')+'\x0a');}['now'](){const _0x198022=_0x44306f;return _0x278c64[_0x198022(0x97)]();}['setLogger'](_0x1d7a52){const _0x5966a6=_0x44306f;if(typeof _0x1d7a52===_0x5966a6(0x198))this['_log']=_0x1d7a52;}[_0x44306f(0x121)](_0x2ac104,_0x576cd6,_0x48b014){const _0x31b470=_0x44306f;if(!this[_0x31b470(0xfc)])return;let _0x269a01=this[_0x31b470(0x11b)][_0x31b470(0x87)](_0x2ac104);!_0x269a01&&(_0x269a01={'ms':0x0,'count':0x0,'maxMs':0x0,'maxExtra':''},this[_0x31b470(0x11b)][_0x31b470(0xc7)](_0x2ac104,_0x269a01)),_0x269a01['ms']+=_0x576cd6,_0x269a01[_0x31b470(0x8a)]+=0x1,_0x576cd6>_0x269a01[_0x31b470(0x140)]&&(_0x269a01[_0x31b470(0x140)]=_0x576cd6,_0x269a01[_0x31b470(0x1a0)]=_0x48b014||'');}[_0x44306f(0x18f)](_0x1f6419){const _0x530c7b=_0x44306f;if(!this[_0x530c7b(0xfc)]||this[_0x530c7b(0xa6)])return;this[_0x530c7b(0xa6)]=!![];if(_0x1f6419)this[_0x530c7b(0x163)]=_0x1f6419;this['_h']=_0x1b30d5({'resolution':0xa}),this['_h'][_0x530c7b(0x133)](),this['_timer']=setInterval(()=>this[_0x530c7b(0x1dc)](),_0x4aa748);if(this[_0x530c7b(0x10e)][_0x530c7b(0x184)])this[_0x530c7b(0x10e)][_0x530c7b(0x184)]();}[_0x44306f(0x200)](_0x202813){const _0x531d18=_0x44306f;if(!this[_0x531d18(0xd9)])this[_0x531d18(0xd9)]=new Set();this[_0x531d18(0xd9)][_0x531d18(0x135)](_0x202813);if(!this[_0x531d18(0xa6)])this[_0x531d18(0x181)]();}[_0x44306f(0x203)](_0x4e261b){const _0xaabb6d=_0x44306f;this[_0xaabb6d(0xd9)]?.[_0xaabb6d(0xfd)](_0x4e261b);}[_0x44306f(0x181)](){const _0x188743=_0x44306f;if(this[_0x188743(0x1e8)])return;this[_0x188743(0x1e8)]=!![];!this['_h']&&(this['_h']=_0x1b30d5({'resolution':0xa}),this['_h'][_0x188743(0x133)]());const _0x56131e=_0x4aa748;this[_0x188743(0xa4)]=setInterval(()=>{const _0x40dccd=_0x188743,_0x4706f5=this['_h'];if(!_0x4706f5)return;const _0x375208=_0x4706f5[_0x40dccd(0x81)](0x63)/0xf4240,_0x3895b4=_0x4706f5[_0x40dccd(0xbf)]/0xf4240,_0x5c5882=_0x4706f5[_0x40dccd(0x17a)]/0xf4240;_0x4706f5[_0x40dccd(0xe7)]();if(this[_0x40dccd(0xd9)])for(const _0x219a98 of this[_0x40dccd(0xd9)]){try{_0x219a98({'p99Ms':_0x375208,'maxMs':_0x3895b4,'meanMs':_0x5c5882,'reportMs':_0x56131e});}catch{}}},_0x56131e);if(this[_0x188743(0xa4)][_0x188743(0x184)])this[_0x188743(0xa4)][_0x188743(0x184)]();}[_0x44306f(0x1dc)](){const _0x38c619=_0x44306f,_0x90b8fc=this['_h'],_0x5b64b1=_0x90b8fc[_0x38c619(0xbf)]/0xf4240,_0x4cac7e=_0x90b8fc[_0x38c619(0x81)](0x63)/0xf4240,_0xe009a0=_0x90b8fc[_0x38c619(0x17a)]/0xf4240;_0x90b8fc[_0x38c619(0xe7)]();const _0x40dadb=[...this[_0x38c619(0x11b)][_0x38c619(0x1c0)]()][_0x38c619(0xf6)](([_0x36816f,_0x5c642d])=>({'label':_0x36816f,..._0x5c642d}))[_0x38c619(0x7b)]((_0x283190,_0x47edf3)=>_0x47edf3['ms']-_0x283190['ms'])[_0x38c619(0x12f)](0x0,0x8);this[_0x38c619(0x11b)]['clear']();const _0x3a562b=_0x40dadb[_0x38c619(0x201)]((_0x8912e4,_0x23b4f2)=>_0x8912e4+_0x23b4f2['ms'],0x0),_0x1159ac=_0x40dadb['map'](_0x2db17e=>_0x2db17e[_0x38c619(0x80)]+'='+_0x2db17e['ms'][_0x38c619(0x136)](0x0)+_0x38c619(0x189)+_0x2db17e[_0x38c619(0x8a)]+(_0x2db17e[_0x38c619(0x140)]>0x5?_0x38c619(0x107)+_0x2db17e[_0x38c619(0x140)][_0x38c619(0x136)](0x0)+'ms'+(_0x2db17e[_0x38c619(0x1a0)]?'\x20'+_0x2db17e[_0x38c619(0x1a0)]:'')+')':''));(_0x43ac7d||_0x5b64b1>=_0x57e28a)&&this[_0x38c619(0x163)](_0x38c619(0x1a9)+_0x4aa748+_0x38c619(0x151)+_0x5b64b1[_0x38c619(0x136)](0x0)+_0x38c619(0x16f)+_0x4cac7e[_0x38c619(0x136)](0x0)+'ms\x20mean='+_0xe009a0[_0x38c619(0x136)](0x0)+_0x38c619(0x148)+_0x3a562b[_0x38c619(0x136)](0x0)+'ms'+(_0x1159ac['length']?'\x20│\x20'+_0x1159ac[_0x38c619(0x1b3)]('\x20\x20'):''),{'feature':'loop-lag'});if(this[_0x38c619(0xd9)])for(const _0x1a3576 of this[_0x38c619(0xd9)]){try{_0x1a3576({'p99Ms':_0x4cac7e,'maxMs':_0x5b64b1,'meanMs':_0xe009a0,'reportMs':_0x4aa748});}catch{}}}[_0x44306f(0x76)](){const _0x1f3783=_0x44306f;if(this[_0x1f3783(0x10e)])clearInterval(this[_0x1f3783(0x10e)]);if(this['_h'])this['_h']['disable']();this[_0x1f3783(0x10e)]=null,this['_h']=null,this['_started']=![];}}const _0x322320=new _0x4fd049();if(_0x322320[_0x44306f(0xfc)])_0x322320[_0x44306f(0x18f)]();return okdbLoopMonitor={'LOOP':_0x322320},okdbLoopMonitor;}var okdbProcessRegistry,hasRequiredOkdbProcessRegistry;function requireOkdbProcessRegistry(){const _0x47c38b=_0xd218e;if(hasRequiredOkdbProcessRegistry)return okdbProcessRegistry;hasRequiredOkdbProcessRegistry=0x1;const _0x3672e0=require$$0$1,_0xd83097=require$$1,_0x5ed5d4=require$$2,{LOOP:_0xfcc22e}=requireOkdbLoopMonitor(),_0xefbd20='~processes',_0x26e5eb=_0x47c38b(0xf7),_0x49321f=_0x47c38b(0x183),_0x6a7cb=_0x47c38b(0x77),_0x517179=(_0x3703db,_0x3730f1)=>_0x3703db+':'+_0x3730f1,_0x963705=(_0x3f8c16,_0x183a0e)=>_0x3f8c16+'::'+_0x183a0e,_0x428f06=(_0x2bcc98,_0x385c62)=>_0x2bcc98+'/'+_0x385c62,_0x5956c8=(_0x201b59,_0x2c7592)=>_0x201b59+'#'+_0x2c7592,_0x4d2e79=_0x29ad42=>{const _0x4da394=_0x47c38b;if(_0x29ad42?.['processKey'])return _0x29ad42[_0x4da394(0x11c)];const _0x31f413=_0x29ad42?.[_0x4da394(0x75)];return typeof _0x31f413==='string'&&_0x31f413['includes']('#')?_0x31f413[_0x4da394(0x12f)](0x0,_0x31f413[_0x4da394(0x101)]('#')):_0x31f413;},_0x4377c1=Number(process.env.OKDB_WORKERS_HEARTBEAT_MS)||0x2710,_0x4f01d3=Number(process.env.OKDB_WORKERS_PUBLISH_MS)||0x3e8,_0x5d09ef=_0x4377c1*0x3,_0x2476f0=[_0x47c38b(0xb0),_0x47c38b(0x157),_0x47c38b(0x16a),'processor:error'];let _0x1e53f7=null;function _0x2783c8(){const _0x1a5342=_0x47c38b;if(_0x1e53f7==null)_0x1e53f7=Math[_0x1a5342(0x150)]((Date[_0x1a5342(0x97)]()-process[_0x1a5342(0x9c)]()*0x3e8)/0x3e8)*0x3e8;return _0x1e53f7;}function _0x26335a(_0x2441a5){const _0x2dd181=_0x47c38b;if(process.env.OKDB_PROCESS_KILL===_0x2dd181(0xcd))return![];if(_0x2441a5?.['options']?.[_0x2dd181(0x1c4)]&&typeof _0x2441a5[_0x2dd181(0x90)][_0x2dd181(0x1c4)]===_0x2dd181(0x191)&&_0x2441a5[_0x2dd181(0x90)][_0x2dd181(0x1c4)][_0x2dd181(0xf9)]===![])return![];return!![];}function _0x4515a4(_0x32614a,_0x4c282a){const _0x230a22=_0x47c38b,_0x2e1d0d=!!_0x4c282a?.['asyncProcessors'];switch(_0x32614a){case'primary':return{'controllable':_0x2e1d0d,'decommissionable':![],'killable':!![],'killConfirm':_0x230a22(0xe5)};case _0x230a22(0x1c1):case'standalone':return{'controllable':_0x2e1d0d,'decommissionable':![],'killable':!![],'killConfirm':'confirm'};case _0x230a22(0x104):return{'controllable':![],'decommissionable':![],'killable':![]};case'http-server':case _0x230a22(0xbc):case _0x230a22(0x99):case'worker':return{'controllable':![],'decommissionable':!![],'killable':!![],'killConfirm':_0x230a22(0x16d)};default:return{'controllable':![],'decommissionable':![],'killable':![]};}}class _0x4c042f{constructor(_0x4b4e44){const _0x140f96=_0x47c38b;this['okdb']=_0x4b4e44,this[_0x140f96(0x110)]=null,this[_0x140f96(0x1cd)]=null,this['_cmd']=null,this['_isWriter']=![],this[_0x140f96(0x124)]=![],this[_0x140f96(0xc8)]=_0x2783c8(),this[_0x140f96(0x93)]=_0x517179(process[_0x140f96(0x92)],this[_0x140f96(0xc8)]),this['_instanceId']=_0x5ed5d4[_0x140f96(0x1de)]()[_0x140f96(0x12f)](0x0,0x8),this[_0x140f96(0x19c)]=_0x5956c8(this['_selfKey'],this['_instanceId']),this[_0x140f96(0x18c)]=Date['now'](),this[_0x140f96(0x162)]=null,this[_0x140f96(0x149)]=null,this['_listenAddr']=null,this[_0x140f96(0x6d)]=null,this['_onProcEvent']=null,this[_0x140f96(0xe3)]=null,this[_0x140f96(0x147)]=0x0,this[_0x140f96(0x1f5)]={},this[_0x140f96(0x182)]=new Map(),this[_0x140f96(0xa9)]=process['cpuUsage'](),this[_0x140f96(0x122)]=Date['now'](),this[_0x140f96(0x1b7)]=0x0,this['_threadStats']=new Map();}get[_0x47c38b(0x109)](){return this['_selfKey'];}get[_0x47c38b(0x96)](){const _0x2ea83d=_0x47c38b;return this[_0x2ea83d(0x19c)];}['_caps'](_0x49c815,_0x38f9ad){const _0x1fd6bb=_0x47c38b,_0x28dac9=_0x4515a4(_0x49c815,_0x38f9ad);if(_0x28dac9[_0x1fd6bb(0xee)]&&!_0x26335a(this[_0x1fd6bb(0x1ef)]))return{..._0x28dac9,'killable':![],'killConfirm':undefined};return _0x28dac9;}[_0x47c38b(0x143)](){const _0x5ec628=_0x47c38b;return!!this[_0x5ec628(0x110)];}[_0x47c38b(0x17d)](_0x299439){const _0x46cf0c=_0x47c38b;Object[_0x46cf0c(0x175)](this[_0x46cf0c(0x1f5)],_0x299439||{});}['noteListenAddr'](_0xe73c5c){const _0x65afdd=_0x47c38b;if(_0xe73c5c)this[_0x65afdd(0x12b)]=_0xe73c5c;}['register'](_0x200def={}){const _0x5900cc=_0x47c38b;return this['okdb'][_0x5900cc(0x1b9)](_0x200def);}['processingStatusView'](){const _0x5249e6=_0x47c38b;let _0x4bef9e=null;const _0x1f4f90={};for(const _0x5bb6e7 of this['listNodes']()){const _0x4073fa=_0x5bb6e7[_0x5249e6(0xbd)];if(!_0x4073fa)continue;if(_0x4bef9e==null)_0x4bef9e=_0x4073fa['policy'];for(const _0x5717c1 of _0x4073fa['processors']||[]){if(![_0x5249e6(0x204),_0x5249e6(0x205),_0x5249e6(0x1a1),_0x5249e6(0x106)][_0x5249e6(0x1fe)](_0x5717c1[_0x5249e6(0x120)]))continue;const _0x2c61d0=_0x5717c1[_0x5249e6(0x1cb)]||_0x5249e6(0x1f2);(_0x1f4f90[_0x2c61d0]||=[])['push']({'type':_0x5717c1['type'],'mode':_0x5717c1[_0x5249e6(0x120)],'state':_0x5717c1[_0x5249e6(0x118)],'lastClock':_0x5717c1[_0x5249e6(0xaf)],'headClock':_0x5717c1['headClock'],'lag':_0x5717c1[_0x5249e6(0xe1)]});}}return{'envs':_0x1f4f90,'policy':_0x4bef9e,'source':_0x5249e6(0x15f)};}[_0x47c38b(0x1e7)](){const _0x2607fe=_0x47c38b,_0x1d627f=_0x24daed=>{const _0x2f9395=_0x2a26;if(_0x24daed['state']===_0x2f9395(0x114)||_0x24daed[_0x2f9395(0x118)]===_0x2f9395(0x78)||_0x24daed[_0x2f9395(0x118)]===_0x2f9395(0x100))return 0x3;if(_0x24daed[_0x2f9395(0x119)])return 0x1;return 0x2;},_0x2cd6f2=new Map();for(const _0x481e8a of this[_0x2607fe(0x145)]()){for(const _0x3f65fe of _0x481e8a['processing']?.[_0x2607fe(0x1b2)]||[]){const _0x526ad0={..._0x3f65fe,'owner':{'pid':_0x481e8a[_0x2607fe(0x92)]??null,'kind':_0x481e8a[_0x2607fe(0x176)]??null,'host':_0x481e8a[_0x2607fe(0x116)]??null}},_0x4374f1=_0x3f65fe['mode']===_0x2607fe(0x204)?_0x2607fe(0x173)+(_0x3f65fe[_0x2607fe(0x1cb)]??'')+'::'+(_0x3f65fe[_0x2607fe(0x108)]??_0x3f65fe[_0x2607fe(0xf0)]??_0x3f65fe['id']):_0x2607fe(0x1be)+(_0x481e8a['nodeKey']??_0x481e8a[_0x2607fe(0x11c)]??'')+'::'+(_0x3f65fe[_0x2607fe(0x1cb)]??'')+'::'+_0x3f65fe['id'],_0x1ba718=_0x2cd6f2[_0x2607fe(0x87)](_0x4374f1);if(!_0x1ba718||_0x1d627f(_0x526ad0)>_0x1d627f(_0x1ba718))_0x2cd6f2['set'](_0x4374f1,_0x526ad0);}}return[..._0x2cd6f2[_0x2607fe(0x84)]()];}[_0x47c38b(0x1fb)](){const _0x266d9f=_0x47c38b,_0x2d6c42=Date[_0x266d9f(0x97)](),_0x434ce6=this[_0x266d9f(0x145)](),_0xb04907=_0x296baa=>Math[_0x266d9f(0xbf)](0x0,Math['round']((_0x2d6c42-(_0x296baa[_0x266d9f(0x103)]||_0x2d6c42))/0x3e8)),_0x3125fe=_0x434ce6[_0x266d9f(0x19b)](_0x431e5a=>_0x431e5a[_0x266d9f(0x176)]===_0x266d9f(0xbb)),_0x3fdde9=_0x434ce6[_0x266d9f(0x1e6)](_0x2ff8bb=>_0x2ff8bb[_0x266d9f(0x176)]==='http-server');if(_0x3125fe||_0x3fdde9['length'])return{'primary':_0x3125fe?{'pid':_0x3125fe[_0x266d9f(0x92)],'uptime':_0xb04907(_0x3125fe)}:null,'workers':_0x3fdde9['map'](_0x546841=>({'pid':_0x546841['pid'],'uptime':_0xb04907(_0x546841)})),'workersConfigured':_0x3125fe?.[_0x266d9f(0x193)]?.[_0x266d9f(0x1c5)]??_0x3fdde9[_0x266d9f(0x72)],'mode':_0x266d9f(0xeb)};const _0xab0da9=_0x434ce6[_0x266d9f(0x19b)](_0x3309e9=>_0x3309e9['kind']===_0x266d9f(0x1c1)||_0x3309e9[_0x266d9f(0x176)]==='standalone'||_0x3309e9[_0x266d9f(0x176)]===_0x266d9f(0x104)),_0x3eff9e=_0xab0da9?{'pid':_0xab0da9['pid'],'uptime':_0xb04907(_0xab0da9)}:{'pid':process[_0x266d9f(0x92)],'uptime':Math['max'](0x0,Math[_0x266d9f(0x150)](process[_0x266d9f(0x9c)]()))};return{'primary':_0x3eff9e,'workers':[_0x3eff9e],'workersConfigured':0x1,'mode':_0x266d9f(0x204)};}[_0x47c38b(0xfe)](){return this['_groupByProcess']();}['treeView'](){const _0x79947e=_0x47c38b,_0x13222e=new Map();for(const _0x2f0f10 of this[_0x79947e(0x14c)]())_0x13222e[_0x79947e(0xc7)](_0x2f0f10[_0x79947e(0x11c)],{..._0x2f0f10,'children':[]});const _0x2e99f9=[];for(const _0x5a186b of _0x13222e['values']()){const _0x5b7e9e=_0x5a186b[_0x79947e(0x192)]?_0x13222e['get'](_0x5a186b[_0x79947e(0x192)]):null;if(_0x5b7e9e&&_0x5b7e9e!==_0x5a186b)_0x5b7e9e['children'][_0x79947e(0xfa)](_0x5a186b);else _0x2e99f9[_0x79947e(0xfa)](_0x5a186b);}const _0xb004e7=(_0x5026ca,_0x320ff9)=>_0x5026ca[_0x79947e(0x176)]===_0x320ff9[_0x79947e(0x176)]?(_0x5026ca[_0x79947e(0x92)]||0x0)-(_0x320ff9['pid']||0x0):(_0x5026ca[_0x79947e(0x176)]??'')<(_0x320ff9['kind']??'')?-0x1:0x1,_0x8cd863=_0x2df2c6=>{const _0x33c9e4=_0x79947e;_0x2df2c6[_0x33c9e4(0x7b)](_0xb004e7);for(const _0x4988e6 of _0x2df2c6)if(_0x4988e6[_0x33c9e4(0xde)][_0x33c9e4(0x72)])_0x8cd863(_0x4988e6[_0x33c9e4(0xde)]);};return _0x8cd863(_0x2e99f9),_0x2e99f9;}[_0x47c38b(0x165)](_0x39361f){const _0x3e9bcf=_0x47c38b;return this['_groupByProcess']()[_0x3e9bcf(0x19b)](_0x33449f=>_0x33449f['processKey']===_0x39361f)??null;}[_0x47c38b(0x14c)](_0x1276bc=Date[_0x47c38b(0x97)]()){const _0x4e230a=_0x47c38b,_0x22f667=new Map();for(const _0x599cca of this[_0x4e230a(0x145)]()){const _0x4643a1=_0x4d2e79(_0x599cca);let _0x362619=_0x22f667[_0x4e230a(0x87)](_0x4643a1);!_0x362619&&(_0x362619={'processKey':_0x4643a1,'nodeKey':_0x4643a1,'pid':_0x599cca[_0x4e230a(0x92)],'ppid':_0x599cca['ppid']??null,'host':_0x599cca[_0x4e230a(0x116)]??null,'kind':_0x599cca[_0x4e230a(0x176)],'role':null,'supervisorKey':_0x599cca['supervisorKey']??null,'slot':_0x599cca[_0x4e230a(0x1b5)]??null,'slotKey':_0x599cca['slotKey']??null,'caps':_0x599cca[_0x4e230a(0xdc)]??null,'lifecycle':_0x599cca[_0x4e230a(0x1d4)]??null,'uptime':Math[_0x4e230a(0xbf)](0x0,Math[_0x4e230a(0x150)]((_0x1276bc-(_0x599cca[_0x4e230a(0x103)]||_0x1276bc))/0x3e8)),'startedAt':_0x599cca['startedAt']??null,'meta':_0x599cca[_0x4e230a(0x193)]??null,'listenAddr':null,'processing':null,'stats':null,'instances':[]},_0x22f667['set'](_0x4643a1,_0x362619));_0x362619[_0x4e230a(0x1ca)][_0x4e230a(0xfa)]({'instanceId':_0x599cca[_0x4e230a(0x13b)]??null,'role':_0x599cca[_0x4e230a(0x1ae)]??null,'listenAddr':_0x599cca['listenAddr']??null,'lifecycle':_0x599cca[_0x4e230a(0x1d4)]??null,'processing':_0x599cca['processing']??null});if(!_0x362619[_0x4e230a(0x1ae)]&&_0x599cca[_0x4e230a(0x1ae)])_0x362619[_0x4e230a(0x1ae)]=_0x599cca[_0x4e230a(0x1ae)];if(!_0x362619[_0x4e230a(0xff)]&&_0x599cca[_0x4e230a(0xff)])_0x362619[_0x4e230a(0xff)]=_0x599cca[_0x4e230a(0xff)];if(!_0x362619[_0x4e230a(0xbd)]&&_0x599cca[_0x4e230a(0xbd)])_0x362619['processing']=_0x599cca['processing'];if(_0x362619['caps']==null&&_0x599cca[_0x4e230a(0xdc)])_0x362619['caps']=_0x599cca['caps'];if(_0x599cca[_0x4e230a(0x1bf)]&&(!_0x362619[_0x4e230a(0x1bf)]||(_0x599cca['stats']['at']??0x0)>(_0x362619[_0x4e230a(0x1bf)]['at']??0x0)))_0x362619[_0x4e230a(0x1bf)]=_0x599cca['stats'];}return[..._0x22f667[_0x4e230a(0x84)]()];}['runtimeProcessesView'](){const _0x494803=_0x47c38b,_0x20e446=[],_0x22df2b={'rss':0x0,'heapUsed':0x0,'processes':0x0};for(const _0x4a8b59 of this[_0x494803(0x14c)]()){_0x20e446[_0x494803(0xfa)]({'processKey':_0x4a8b59['processKey'],'kind':_0x4a8b59['kind'],'pid':_0x4a8b59[_0x494803(0x92)],'supervisorKey':_0x4a8b59['supervisorKey'],'meta':_0x4a8b59[_0x494803(0x193)]??null,'uptime':_0x4a8b59['uptime'],'stats':_0x4a8b59[_0x494803(0x1bf)]??null}),_0x22df2b[_0x494803(0x1c4)]++,_0x4a8b59[_0x494803(0x1bf)]&&(_0x22df2b[_0x494803(0x89)]+=_0x4a8b59['stats'][_0x494803(0x89)]||0x0,_0x22df2b[_0x494803(0xc0)]+=(_0x4a8b59[_0x494803(0x1bf)][_0x494803(0xc0)]||0x0)+(_0x4a8b59['stats'][_0x494803(0x12a)]?.[_0x494803(0xc0)]||0x0));}return{'totals':_0x22df2b,'nodes':_0x20e446};}async['open']({writer:writer=![],reader:reader=![],kind:kind=null,supervisorKey:supervisorKey=null,listenAddr:listenAddr=null}={}){const _0x1d0688=_0x47c38b;this[_0x1d0688(0x9d)]=this[_0x1d0688(0x9d)]||!!writer,this[_0x1d0688(0x124)]=this[_0x1d0688(0x124)]||!!reader,this[_0x1d0688(0x162)]=kind||this[_0x1d0688(0x162)]||(_0xd83097[_0x1d0688(0xab)]?_0x1d0688(0xc1):'cli'),this[_0x1d0688(0x149)]=supervisorKey??this[_0x1d0688(0x149)],this[_0x1d0688(0x12b)]=listenAddr??this[_0x1d0688(0x12b)],this['_ensureDesired']();if(!writer&&!reader)return null;if(!this['_statusEnv']){const _0x2cbb37=await this[_0x1d0688(0x1ef)]['createEnvironment'](_0xefbd20,{'sync':![],'durability':'fast'});if(!_0x2cbb37[_0x1d0688(0xae)](_0x26e5eb))await _0x2cbb37[_0x1d0688(0x142)](_0x26e5eb);this[_0x1d0688(0x110)]=_0x2cbb37;}return this[_0x1d0688(0x110)];}[_0x47c38b(0x126)](){const _0x21cb52=_0x47c38b;return this[_0x21cb52(0x1f9)]!==this[_0x21cb52(0x110)]&&(this[_0x21cb52(0x1f9)]=this[_0x21cb52(0x110)],this[_0x21cb52(0xb5)]=this[_0x21cb52(0x110)][_0x21cb52(0x190)](_0x26e5eb)[_0x21cb52(0x117)]),this[_0x21cb52(0xb5)];}[_0x47c38b(0x188)](_0x161fcc){const _0x1d35a4=_0x47c38b,_0x221391=this[_0x1d35a4(0x126)]()[_0x1d35a4(0x177)](_0x161fcc['nodeKey'],_0x161fcc,0x1);if(_0x221391&&typeof _0x221391['then']==='function')_0x221391[_0x1d35a4(0x1dd)](undefined,()=>{});return _0x221391;}['_removeRowAsync'](_0x2db9bb){const _0x73dc7a=_0x47c38b,_0x8acc4c=this[_0x73dc7a(0x126)]()[_0x73dc7a(0x9a)](_0x2db9bb);if(_0x8acc4c&&typeof _0x8acc4c['then']===_0x73dc7a(0x198))_0x8acc4c[_0x73dc7a(0x1dd)](undefined,()=>{});return _0x8acc4c;}async[_0x47c38b(0x169)](_0x15bdf3){const _0x14dd30=_0x47c38b;if(!this['_statusEnv']||!this['_isWriter']||!_0x15bdf3?.[_0x14dd30(0x75)])return;return this[_0x14dd30(0x188)](_0x15bdf3);}async[_0x47c38b(0x7f)](_0x3c1d34){const _0x370a79=_0x47c38b;if(!this[_0x370a79(0x110)]||!this['_isWriter']||!_0x3c1d34)return;const _0x1a8005=_0x3c1d34[_0x370a79(0x1fe)]('#'),_0x25bde2=[];for(const {key:_0x239e50}of this[_0x370a79(0x110)][_0x370a79(0x1ad)](_0x26e5eb)){if(_0x239e50===_0x3c1d34||!_0x1a8005&&typeof _0x239e50===_0x370a79(0x6f)&&_0x239e50[_0x370a79(0x141)](_0x3c1d34+'#'))_0x25bde2[_0x370a79(0xfa)](_0x239e50);}return Promise[_0x370a79(0x1aa)](_0x25bde2['map'](_0x18c510=>this['_removeRowAsync'](_0x18c510)));}[_0x47c38b(0x1d8)](_0x2fba69){const _0x4d9853=_0x47c38b;if(typeof _0x2fba69?.['pid']!=='number')return![];if(_0x2fba69[_0x4d9853(0x116)]!==_0x3672e0[_0x4d9853(0x1f3)]())return![];if(_0x2fba69[_0x4d9853(0x92)]===process['pid'])return![];try{return process[_0x4d9853(0xf9)](_0x2fba69[_0x4d9853(0x92)],0x0),![];}catch(_0x217e3f){return _0x217e3f[_0x4d9853(0x1f6)]==='ESRCH';}}[_0x47c38b(0x145)](){const _0x290be9=_0x47c38b;if(!this[_0x290be9(0x110)])return[];const _0x345404=Date[_0x290be9(0x97)](),_0x149edd=[];for(const {value:_0x3c2e57}of this[_0x290be9(0x110)][_0x290be9(0x1ad)](_0x26e5eb)){if(_0x3c2e57&&(_0x3c2e57['expiresAt']==null||_0x3c2e57['expiresAt']>=_0x345404)&&!this[_0x290be9(0x1d8)](_0x3c2e57))_0x149edd[_0x290be9(0xfa)](_0x3c2e57);}return _0x149edd;}['reap'](_0x1d01a7=0x0){const _0x2ab4f6=_0x47c38b;if(!this[_0x2ab4f6(0x110)]||!this[_0x2ab4f6(0x9d)])return;const _0x2c8658=Date['now']()-_0x1d01a7,_0x3327de=new Set(),_0x18490f=[];for(const {key:_0x27c394,value:_0x43856d}of this[_0x2ab4f6(0x110)][_0x2ab4f6(0x1ad)](_0x26e5eb)){if(_0x43856d&&(_0x43856d[_0x2ab4f6(0x13d)]!=null&&_0x43856d['expiresAt']<_0x2c8658||this[_0x2ab4f6(0x1d8)](_0x43856d)))_0x18490f[_0x2ab4f6(0xfa)](_0x27c394);else _0x3327de[_0x2ab4f6(0x135)](_0x4d2e79(_0x43856d)??_0x27c394);}for(const _0x5af27b of _0x18490f)this['_removeRowAsync'](_0x5af27b);if(this[_0x2ab4f6(0x127)]())for(const {key:_0x3a2498}of this[_0x2ab4f6(0xd3)]('node')){if(!_0x3327de['has'](_0x3a2498))this[_0x2ab4f6(0x1cd)][_0x2ab4f6(0x123)](_0x2ab4f6(0xb8)+_0x3a2498);}}[_0x47c38b(0x8c)](_0x2a96ba=null){const _0x933580=_0x47c38b;if(this[_0x933580(0x6d)]||!this[_0x933580(0x9d)]||!this[_0x933580(0x110)])return;this['_onTick']=_0x2a96ba,this[_0x933580(0x199)]=()=>this['_maybePublish']();for(const _0x4f1581 of _0x2476f0)this[_0x933580(0x1ef)][_0x933580(0x70)]['on'](_0x4f1581,this[_0x933580(0x199)]);this[_0x933580(0xb1)]();const _0x29b92c=Number(process.env.OKDB_WORKERS_HEARTBEAT_MS)||_0x4377c1;this[_0x933580(0x6d)]=setInterval(()=>{const _0xe9a515=_0x933580;if(this['_onTick'])try{this[_0xe9a515(0xe3)]();}catch{}this[_0xe9a515(0xb1)](),this[_0xe9a515(0x155)]();},_0x29b92c);if(this['_hbTimer']['unref'])this[_0x933580(0x6d)][_0x933580(0x184)]();}[_0x47c38b(0x115)](){const _0x97281a=_0x47c38b;if(!this[_0x97281a(0x9d)]||!this['_statusEnv'])return;if(Date[_0x97281a(0x97)]()-this[_0x97281a(0x147)]<_0x4f01d3)return;this['_publishNow']();}[_0x47c38b(0xb1)](){const _0x32fb9a=_0x47c38b;if(!this[_0x32fb9a(0x9d)]||!this['_statusEnv'])return;this[_0x32fb9a(0x147)]=Date[_0x32fb9a(0x97)]();try{const _0x19738d=[this[_0x32fb9a(0xd4)]()];for(const _0x39ca80 of this[_0x32fb9a(0x182)][_0x32fb9a(0x84)]())_0x19738d[_0x32fb9a(0xfa)](this[_0x32fb9a(0x1ed)](_0x39ca80));const _0x3ac06d=_0xfcc22e[_0x32fb9a(0xfc)]?_0xfcc22e[_0x32fb9a(0x97)]():0x0,_0x5516df=Promise[_0x32fb9a(0x1aa)](_0x19738d[_0x32fb9a(0xf6)](_0x4981bc=>this[_0x32fb9a(0x188)](_0x4981bc)))['catch'](()=>{});if(_0xfcc22e[_0x32fb9a(0xfc)])_0xfcc22e[_0x32fb9a(0x121)]('registry-publish',_0xfcc22e[_0x32fb9a(0x97)]()-_0x3ac06d,_0x32fb9a(0x154)+_0x19738d[_0x32fb9a(0x72)]);return _0x5516df;}catch{}}async['stopHeartbeat'](){const _0x2afc6e=_0x47c38b;if(this[_0x2afc6e(0x199)]){for(const _0x56a2ee of _0x2476f0){try{this[_0x2afc6e(0x1ef)]['events'][_0x2afc6e(0xcd)](_0x56a2ee,this['_onProcEvent']);}catch{}}this[_0x2afc6e(0x199)]=null;}this['_hbTimer']&&(clearInterval(this[_0x2afc6e(0x6d)]),this[_0x2afc6e(0x6d)]=null);try{if(this['_statusEnv']&&this[_0x2afc6e(0x9d)])await this[_0x2afc6e(0x7f)](this[_0x2afc6e(0x19c)]);}catch{}}async['deregisterSelf'](){const _0x197660=_0x47c38b;if(!this['_statusEnv']||!this[_0x197660(0x9d)])return;try{await this['removeNode'](this[_0x197660(0x19c)]);}catch{}try{const _0x13eae9=[];for(const {value:_0x31ef8e}of this['_statusEnv'][_0x197660(0x1ad)](_0x26e5eb)){if(_0x31ef8e?.[_0x197660(0x9f)]===process[_0x197660(0x92)]&&_0x31ef8e[_0x197660(0x75)])_0x13eae9['push'](_0x31ef8e['nodeKey']);}for(const _0x602cc1 of _0x13eae9){try{await this[_0x197660(0x7f)](_0x602cc1);}catch{}}}catch{}}async[_0x47c38b(0x86)](){const _0x51da07=_0x47c38b;return this['putNode'](this[_0x51da07(0xd4)]());}async[_0x47c38b(0xa8)](_0x5c29a3){const _0x198f17=_0x47c38b;if(!this['_statusEnv']||!this[_0x198f17(0x9d)])return;return this[_0x198f17(0x169)](this['_buildChildRow'](_0x5c29a3));}[_0x47c38b(0x1ed)]({pid:_0x3c2f20,startedAt:_0x2ccdb5,kind:_0x4b3977,supervisorKey:_0x3fbc52,slot:slot=null,slotKey:slotKey=null,role:role={},listenAddr:listenAddr=null,processing:processing=null,lifecycle:lifecycle='running',meta:meta=null,stats:stats=null}){const _0x3120b0=_0x47c38b,_0x50cdd0=Date['now'](),_0x3c6880=_0x517179(_0x3c2f20,_0x2ccdb5);return{'nodeKey':_0x5956c8(_0x3c6880,'0'),'processKey':_0x3c6880,'instanceId':'0','pid':_0x3c2f20,'startedAt':_0x2ccdb5,'ppid':process[_0x3120b0(0x92)],'host':_0x3672e0['hostname'](),'supervisorKey':_0x3fbc52,'slot':slot,'slotKey':slotKey,'kind':_0x4b3977,'role':role,'listenAddr':listenAddr,'heartbeatAt':_0x50cdd0,'expiresAt':_0x50cdd0+_0x5d09ef,'caps':this[_0x3120b0(0x128)](_0x4b3977,role),'lifecycle':{'state':lifecycle,'desiredVersionApplied':null},'processing':processing,'meta':meta,'stats':stats};}async[_0x47c38b(0x11a)](_0x5ab9db){const _0xec42fc=_0x47c38b;if(!_0x5ab9db?.[_0xec42fc(0x92)])return null;const _0x15c8d9=_0x517179(_0x5ab9db['pid'],_0x5ab9db[_0xec42fc(0x103)]);this[_0xec42fc(0x182)]['set'](_0x15c8d9,{..._0x5ab9db,'supervisorKey':_0x5ab9db[_0xec42fc(0x192)]??this[_0xec42fc(0x93)]});if(this[_0xec42fc(0x9d)])await this[_0xec42fc(0xa8)](this[_0xec42fc(0x182)][_0xec42fc(0x87)](_0x15c8d9))[_0xec42fc(0x1e3)]?.(()=>{});return _0x15c8d9;}['removeSupervisedChild'](_0x707e4d){const _0x3a888a=_0x47c38b;if(!_0x707e4d)return;return this[_0x3a888a(0x182)][_0x3a888a(0xfd)](_0x707e4d),this['removeNode'](_0x707e4d);}['_sampleOwnStats'](){const _0x533648=_0x47c38b,_0x3c26ee=Date[_0x533648(0x97)](),_0x498cf7=process['cpuUsage'](),_0x254d95=(_0x3c26ee-this[_0x533648(0x122)])*0x3e8;if(_0x254d95>=0x3d090){const _0x49765b=_0x498cf7['user']-this['_lastCpuUsage'][_0x533648(0x88)]+(_0x498cf7['system']-this['_lastCpuUsage'][_0x533648(0x1bb)]),_0x140a81=_0x3672e0[_0x533648(0x1d3)]()['length']||0x1;this[_0x533648(0x1b7)]=Math['min'](0x64,Math[_0x533648(0x150)](_0x49765b/(_0x254d95*_0x140a81)*0x64)),this[_0x533648(0xd2)]=Math[_0x533648(0x150)](_0x254d95/0x3e8),this[_0x533648(0xa9)]=_0x498cf7,this['_lastCpuAt']=_0x3c26ee;}const _0x45b196=process[_0x533648(0xcb)]();let _0xb54366=null;if(this[_0x533648(0x14e)][_0x533648(0x1f0)]>0x0){let _0x340f58=0x0;for(const _0x5f500d of this[_0x533648(0x14e)]['values']())_0x340f58+=_0x5f500d[_0x533648(0xc0)]||0x0;_0xb54366={'count':this['_threadStats']['size'],'heapUsed':_0x340f58};}return{'rss':_0x45b196[_0x533648(0x89)],'heapUsed':_0x45b196['heapUsed'],'heapTotal':_0x45b196[_0x533648(0x111)],'external':_0x45b196['external'],'cpuPct':this['_lastCpuPct'],'cpuWindowMs':this[_0x533648(0xd2)]??null,'threads':_0xb54366,'at':_0x3c26ee};}['reportThreadStats'](_0x4da82f,_0x3355be){const _0x2c20af=_0x47c38b;if(!_0x4da82f||!_0x3355be)return;this[_0x2c20af(0x14e)][_0x2c20af(0xc7)](_0x4da82f,_0x3355be);}[_0x47c38b(0xef)](_0x162fe3){const _0x4bffa8=_0x47c38b;this[_0x4bffa8(0x14e)][_0x4bffa8(0xfd)](_0x162fe3);}[_0x47c38b(0x1ba)](_0x29bfb8,_0xa25091,_0x1c28c5=undefined){const _0x374f14=_0x47c38b,_0x188753=this['_children'][_0x374f14(0x87)](_0x29bfb8);if(!_0x188753||!_0xa25091)return;if(_0x1c28c5!==undefined)_0x188753[_0x374f14(0xbd)]=_0x1c28c5;_0x188753[_0x374f14(0x1bf)]={'rss':_0xa25091[_0x374f14(0x89)]??null,'heapUsed':_0xa25091[_0x374f14(0xc0)]??null,'heapTotal':_0xa25091[_0x374f14(0x111)]??null,'external':_0xa25091[_0x374f14(0x12d)]??null,'cpuPct':_0xa25091[_0x374f14(0x180)]??null,'cpuWindowMs':_0xa25091['cpuWindowMs']??null,'threads':_0xa25091[_0x374f14(0x12a)]??null,'claims':_0xa25091[_0x374f14(0xc2)]??null,'envsOpen':_0xa25091['envsOpen']??null,'at':Date[_0x374f14(0x97)]()};}[_0x47c38b(0xd4)](){const _0x133164=_0x47c38b,_0x191c5f=Date['now'](),_0x1bdd6e=this['okdb']['_role']||{},_0x458e8d=this[_0x133164(0x162)]||'cli';return{'nodeKey':this[_0x133164(0x19c)],'processKey':this[_0x133164(0x93)],'instanceId':this[_0x133164(0x94)],'pid':process[_0x133164(0x92)],'startedAt':this[_0x133164(0xc8)],'instanceStartedAt':this[_0x133164(0x18c)],'ppid':typeof process[_0x133164(0x9f)]===_0x133164(0x1bc)?process[_0x133164(0x9f)]:null,'host':_0x3672e0[_0x133164(0x1f3)](),'supervisorKey':this['_supervisorKey']??null,'kind':_0x458e8d,'role':{'engines':!!_0x1bdd6e['engines'],'asyncProcessors':!!_0x1bdd6e['asyncProcessors'],'compaction':_0x1bdd6e[_0x133164(0xec)],'http':_0x1bdd6e[_0x133164(0x12e)]},'listenAddr':this[_0x133164(0x12b)]??null,'heartbeatAt':_0x191c5f,'expiresAt':_0x191c5f+_0x5d09ef,'caps':this[_0x133164(0x128)](_0x458e8d,_0x1bdd6e),'lifecycle':{'state':_0x133164(0x12c),'desiredVersionApplied':null},'meta':{...this[_0x133164(0x1f5)]},'processing':_0x1bdd6e['asyncProcessors']?this[_0x133164(0x1d0)]():null,'stats':this['_sampleOwnStats']()};}[_0x47c38b(0x1d0)](){const _0x33529c=_0x47c38b,_0x10ae39=[];try{for(const [_0x2070a0,_0x977fa1]of this[_0x33529c(0x1ef)][_0x33529c(0x7c)]){if(_0x2070a0[_0x33529c(0x141)]('~'))continue;for(const _0x2335d8 of _0x977fa1[_0x33529c(0x170)]['tierList']())_0x10ae39['push']({..._0x2335d8,'env':_0x2070a0});}}catch{}return{'policy':this[_0x33529c(0x1ef)][_0x33529c(0x139)]??null,'processors':_0x10ae39};}[_0x47c38b(0x127)](){const _0x16b6f9=_0x47c38b;if(this[_0x16b6f9(0x1cd)])return!![];const _0x3e8549=this[_0x16b6f9(0x1ef)][_0x16b6f9(0xb2)];if(!_0x3e8549)return![];return this['_desired']=_0x3e8549['openDB'](_0x49321f,{'dupSort':![]}),this[_0x16b6f9(0xd7)]=_0x3e8549[_0x16b6f9(0x17b)](_0x6a7cb,{'dupSort':![]}),!![];}[_0x47c38b(0x195)](){return!!this['_desired'];}[_0x47c38b(0x164)](_0x4404a4,_0x543d99){const _0x1bce73=_0x47c38b;if(!this['_ensureDesired']())return null;return this[_0x1bce73(0x1cd)][_0x1bce73(0x87)](_0x4404a4+'/'+_0x543d99)??null;}[_0x47c38b(0x17e)](_0x2f3a03,_0x462d94,_0x56dd0c){const _0x2d076a=_0x47c38b;if(!this[_0x2d076a(0x127)]())return null;const _0x45ceac=_0x2f3a03+'/'+_0x462d94;let _0x3377b9;return this[_0x2d076a(0x1cd)][_0x2d076a(0x202)](()=>{const _0x229c30=_0x2d076a,_0x490d4e=this['_desired'][_0x229c30(0x87)](_0x45ceac)||{'version':0x0};_0x3377b9=(_0x490d4e[_0x229c30(0x166)]||0x0)+0x1,this['_desired']['put'](_0x45ceac,{..._0x490d4e,..._0x56dd0c,'version':_0x3377b9,'updatedAt':Date[_0x229c30(0x97)]()});}),_0x3377b9;}[_0x47c38b(0xd3)](_0x478873){const _0x1ad4cc=_0x47c38b;if(!this[_0x1ad4cc(0x127)]())return[];const _0x41f2b6=_0x478873+'/',_0x4f6f7b=[];for(const {key:_0x6d78cb,value:_0x157cfb}of this[_0x1ad4cc(0x1cd)][_0x1ad4cc(0x1ad)]({'start':_0x41f2b6,'end':_0x41f2b6+'ÿ'})){if(typeof _0x6d78cb!==_0x1ad4cc(0x6f)||!_0x6d78cb[_0x1ad4cc(0x141)](_0x41f2b6))break;_0x4f6f7b[_0x1ad4cc(0xfa)]({'key':_0x6d78cb[_0x1ad4cc(0x12f)](_0x41f2b6[_0x1ad4cc(0x72)]),'value':_0x157cfb});}return _0x4f6f7b;}['getCmd'](_0x5e46d9){const _0x2038c6=_0x47c38b;if(!this[_0x2038c6(0x127)]())return null;return this['_cmd'][_0x2038c6(0x87)](_0x5e46d9)??null;}['bumpCmd'](_0x522415,_0x187ea1,_0x8d57b3={}){const _0x55d891=_0x47c38b;if(!this[_0x55d891(0x127)]())return null;let _0x589bd8;return this['_cmd'][_0x55d891(0x202)](()=>{const _0x20071d=_0x55d891,_0x52c356=this[_0x20071d(0xd7)][_0x20071d(0x87)](_0x522415)||{'epoch':0x0};_0x589bd8=(_0x52c356[_0x20071d(0x16e)]||0x0)+0x1,this[_0x20071d(0xd7)][_0x20071d(0x177)](_0x522415,{..._0x52c356,..._0x8d57b3,'cmd':_0x187ea1,'epoch':_0x589bd8,'updatedAt':Date['now']()});}),_0x589bd8;}}return okdbProcessRegistry={'OKDBProcessRegistry':_0x4c042f,'nodeKey':_0x517179,'logicalKey':_0x963705,'slotKey':_0x428f06,'PROCESS_ENV':_0xefbd20,'NODE_TYPE':_0x26e5eb},okdbProcessRegistry;}var okdbChangefeed,hasRequiredOkdbChangefeed;function requireOkdbChangefeed(){const _0x103ff7=_0xd218e;if(hasRequiredOkdbChangefeed)return okdbChangefeed;hasRequiredOkdbChangefeed=0x1;const _0x3e6d75=require$$0$2,{EVENTS:_0x36ec68,CHANGE_ACTIONS:_0x3bb655}=requireOkdbEnums(),{LOOP:_0xc36c4f}=requireOkdbLoopMonitor(),_0x521d39=Number(process.env.OKDB_CHANGEFEED_QUANTUM)||0x3e8,_0x2cac48=0x5,_0xbefe9d=0x2710;class _0x2c4bbf extends _0x3e6d75{constructor(_0x1c8bdb,_0x405bce={}){const _0x2c5edb=_0x2a26;super(),this[_0x2c5edb(0x1ef)]=_0x1c8bdb,this[_0x2c5edb(0x194)]=_0x405bce['quantum']??_0x521d39,this['_flushDebounce']=_0x405bce[_0x2c5edb(0xd6)]??_0x2cac48,this[_0x2c5edb(0x1bd)]=_0x405bce[_0x2c5edb(0xca)]??_0xbefe9d,this[_0x2c5edb(0xa6)]=![],this[_0x2c5edb(0x1fa)]=new Map(),this[_0x2c5edb(0x1c6)]=new Map(),this[_0x2c5edb(0x1b4)]=new Map(),this[_0x2c5edb(0x1c3)]=null,this[_0x2c5edb(0x137)]=![],this[_0x2c5edb(0x1b1)]=new Set(),this['_onItem']=_0x71a3db=>this[_0x2c5edb(0x1a6)](_0x71a3db),this[_0x2c5edb(0x1df)]=_0x520bb8=>this['_handlePoke'](_0x520bb8),this[_0x2c5edb(0xa1)]=()=>this[_0x2c5edb(0x76)]();}[_0x103ff7(0x18f)](){const _0x134ca4=_0x103ff7;if(this[_0x134ca4(0xa6)])return;this[_0x134ca4(0xa6)]=!![];for(const [_0x26998e,_0x5d7878]of this[_0x134ca4(0x1ef)][_0x134ca4(0x7c)]){if(_0x26998e[_0x134ca4(0x141)]('~'))continue;try{this[_0x134ca4(0x1c6)][_0x134ca4(0xc7)](_0x26998e,_0x5d7878[_0x134ca4(0x197)]()||0x0);}catch{}}const {events:_0x58441b}=this['okdb'];_0x58441b['on'](_0x36ec68[_0x134ca4(0xf1)],this['_onItem']),_0x58441b['on'](_0x36ec68['ITEM_UPDATE'],this[_0x134ca4(0xb3)]),_0x58441b['on'](_0x36ec68['ITEM_REMOVE'],this['_onItem']),_0x58441b['on'](_0x36ec68[_0x134ca4(0xe8)],this[_0x134ca4(0x1df)]),_0x58441b[_0x134ca4(0xd5)](_0x36ec68[_0x134ca4(0xbe)],this[_0x134ca4(0xa1)]);}[_0x103ff7(0x76)](){const _0x52e3cf=_0x103ff7;if(!this[_0x52e3cf(0xa6)])return;this[_0x52e3cf(0xa6)]=![];const {events:_0x70d1d7}=this['okdb'];_0x70d1d7['off'](_0x36ec68[_0x52e3cf(0xf1)],this['_onItem']),_0x70d1d7['off'](_0x36ec68[_0x52e3cf(0x1b8)],this[_0x52e3cf(0xb3)]),_0x70d1d7[_0x52e3cf(0xcd)](_0x36ec68[_0x52e3cf(0x13e)],this[_0x52e3cf(0xb3)]),_0x70d1d7[_0x52e3cf(0xcd)](_0x36ec68[_0x52e3cf(0xe8)],this[_0x52e3cf(0x1df)]);try{_0x70d1d7[_0x52e3cf(0xcd)](_0x36ec68[_0x52e3cf(0xbe)],this[_0x52e3cf(0xa1)]);}catch{}this['_flushTimer']&&(clearTimeout(this[_0x52e3cf(0x1c3)]),this[_0x52e3cf(0x1c3)]=null),this[_0x52e3cf(0x1b4)][_0x52e3cf(0x1d2)](),this[_0x52e3cf(0x1fa)][_0x52e3cf(0x1d2)](),this[_0x52e3cf(0x1c6)][_0x52e3cf(0x1d2)](),this[_0x52e3cf(0x1b1)][_0x52e3cf(0x1d2)]();}[_0x103ff7(0x14f)](_0x356f96,_0x5bd46a,_0x581234,_0x29d5bb){return _0x356f96+'\x00'+_0x5bd46a+'\x00'+_0x581234+'\x00'+_0x29d5bb;}['_markSeen'](_0x4d35f4,_0x1e2623,_0x1473aa,_0x469a26){const _0x449722=_0x103ff7,_0x178017=this[_0x449722(0x14f)](_0x4d35f4,_0x1e2623,_0x1473aa,_0x469a26);if(this[_0x449722(0x1b1)][_0x449722(0x144)](_0x178017))return![];this[_0x449722(0x1b1)][_0x449722(0x135)](_0x178017);if(this[_0x449722(0x1b1)][_0x449722(0x1f0)]>this[_0x449722(0x1bd)]){const _0x3f8ad0=this[_0x449722(0x1b1)]['values']()[_0x449722(0x8b)]()['value'];this[_0x449722(0x1b1)][_0x449722(0xfd)](_0x3f8ad0);}return!![];}['_handleInProcess'](_0xda90fa){const _0x45acfc=_0x103ff7;if(!this[_0x45acfc(0xa6)]||!_0xda90fa)return;const {env:_0x487ca1,type:_0x1f6b29,key:_0x52c8d4,clock:_0x24a5d9,origin:_0x5b7194,action:_0x3caf93,newValue:_0xe4a94d,oldValue:_0x7d686b}=_0xda90fa;if(_0x487ca1==null||_0x1f6b29==null||_0x52c8d4==null)return;if(typeof _0x487ca1===_0x45acfc(0x6f)&&_0x487ca1[_0x45acfc(0x141)]('~'))return;if(typeof _0x1f6b29===_0x45acfc(0x6f)&&_0x1f6b29[_0x45acfc(0x141)]('~'))return;if(!this['_markSeen'](_0x487ca1,_0x1f6b29,_0x52c8d4,_0x24a5d9))return;const _0x344882=_0x3caf93===_0x3bb655['REMOVE']?_0x45acfc(0x9a):'put';this['emit'](_0x45acfc(0x1e0),{'env':_0x487ca1,'type':_0x1f6b29,'key':_0x52c8d4,'op':_0x344882,'clock':_0x24a5d9,'origin':_0x5b7194,'value':_0x344882==='remove'?null:_0xe4a94d,'prevValue':_0x7d686b});}[_0x103ff7(0xf5)](_0x864ca5){const _0xb82147=_0x103ff7;if(!this[_0xb82147(0xa6)])return;if(!_0x864ca5||typeof _0x864ca5[_0xb82147(0x1cb)]!=='string'||typeof _0x864ca5[_0xb82147(0xf0)]!==_0xb82147(0x6f))return;const {env:_0x9986ae,type:_0x48bb38}=_0x864ca5;if(_0x9986ae[_0xb82147(0x141)]('~')||_0x48bb38[_0xb82147(0x141)]('~'))return;this['_pending'][_0xb82147(0xc7)](_0x9986ae+'\x00'+_0x48bb38,{'env':_0x9986ae,'type':_0x48bb38}),this[_0xb82147(0x13f)]();}['_scheduleFlush'](){const _0x37e312=_0x103ff7;if(this['_flushTimer'])return;const _0x3347ca=()=>{const _0x5bd558=_0x2a26;this[_0x5bd558(0x1c3)]=null,this[_0x5bd558(0x138)]()['catch'](()=>{});};this[_0x37e312(0x1c3)]=setTimeout(_0x3347ca,this[_0x37e312(0x1cf)]>0x0?this['_flushDebounce']:0x0);}async['_drain'](){const _0x29f9e7=_0x103ff7;if(this[_0x29f9e7(0x137)]){this[_0x29f9e7(0x13f)]();return;}this[_0x29f9e7(0x137)]=!![];try{const _0x8ca108=[...this['_pending']['values']()];this[_0x29f9e7(0x1b4)][_0x29f9e7(0x1d2)]();let _0x1f9d15=![];for(const {env:_0x312255,type:_0x1bd1a5}of _0x8ca108){try{const _0x5298f7=await this[_0x29f9e7(0x146)](_0x312255,_0x1bd1a5);if(_0x5298f7)_0x1f9d15=!![];}catch{this[_0x29f9e7(0x1b4)][_0x29f9e7(0xc7)](_0x312255+'\x00'+_0x1bd1a5,{'env':_0x312255,'type':_0x1bd1a5}),_0x1f9d15=!![];}}if(_0x1f9d15||this[_0x29f9e7(0x1b4)][_0x29f9e7(0x1f0)]>0x0)this[_0x29f9e7(0x13f)]();}finally{this[_0x29f9e7(0x137)]=![];}}async[_0x103ff7(0x146)](_0x16fc39,_0x358c6e){const _0x1d6792=_0x103ff7,_0x5a6ade=await this[_0x1d6792(0x1ef)][_0x1d6792(0x113)](_0x16fc39),_0x8d9111=_0x16fc39+'\x00'+_0x358c6e;!this['_cursors'][_0x1d6792(0x144)](_0x8d9111)&&(!this['_baselines']['has'](_0x16fc39)&&this[_0x1d6792(0x1c6)][_0x1d6792(0xc7)](_0x16fc39,_0x5a6ade[_0x1d6792(0x197)]()||0x0),this[_0x1d6792(0x1fa)][_0x1d6792(0xc7)](_0x8d9111,this[_0x1d6792(0x1c6)][_0x1d6792(0x87)](_0x16fc39)));const _0x3f7394=this[_0x1d6792(0x1fa)][_0x1d6792(0x87)](_0x8d9111),_0x4081e0=_0x5a6ade[_0x1d6792(0x197)](_0x358c6e)||0x0;if(_0x4081e0<=_0x3f7394)return![];const _0x3c08b3=_0x3f7394+this[_0x1d6792(0x194)],_0x37f589=Math[_0x1d6792(0xa7)](_0x4081e0,_0x3c08b3),_0x4055b5=_0xc36c4f[_0x1d6792(0xfc)]?_0xc36c4f[_0x1d6792(0x97)]():0x0,_0x3a5169=Array[_0x1d6792(0x1b6)](_0x5a6ade[_0x1d6792(0x186)](_0x358c6e,_0x3f7394+0x1,_0x37f589));let _0xc9c2b0=_0x3f7394;for(const _0x42905c of _0x3a5169){const {clock:_0x565e22,key:_0x5854d2,action:_0x83de37,origin:_0x4978dd}=_0x42905c;if(_0x565e22>_0xc9c2b0)_0xc9c2b0=_0x565e22;if(_0x5854d2==null)continue;if(!this[_0x1d6792(0x1fd)](_0x16fc39,_0x358c6e,_0x5854d2,_0x565e22))continue;let _0x43a3ef,_0x150f76;if(_0x83de37===_0x3bb655[_0x1d6792(0xa3)])_0x43a3ef=_0x1d6792(0x9a),_0x150f76=null;else{const _0xa1ffe5=_0x5a6ade[_0x1d6792(0x87)](_0x358c6e,_0x5854d2);_0xa1ffe5==null?(_0x43a3ef=_0x1d6792(0x9a),_0x150f76=null):(_0x43a3ef=_0x1d6792(0x177),_0x150f76=_0xa1ffe5);}this[_0x1d6792(0xe4)](_0x1d6792(0x1e0),{'env':_0x16fc39,'type':_0x358c6e,'key':_0x5854d2,'op':_0x43a3ef,'clock':_0x565e22,'origin':_0x4978dd,'value':_0x150f76});}if(_0xc36c4f[_0x1d6792(0xfc)])_0xc36c4f[_0x1d6792(0x121)]('feed:'+_0x16fc39+':'+_0x358c6e,_0xc36c4f[_0x1d6792(0x97)]()-_0x4055b5,'n='+_0x3a5169[_0x1d6792(0x72)]);return this[_0x1d6792(0x1fa)]['set'](_0x8d9111,Math[_0x1d6792(0xbf)](_0xc9c2b0,_0x37f589)),_0x5a6ade['getClock'](_0x358c6e)>_0x37f589;}[_0x103ff7(0xd0)](){const _0x16050e=_0x103ff7;return{'started':this[_0x16050e(0xa6)],'quantum':this[_0x16050e(0x194)],'flushDebounce':this[_0x16050e(0x1cf)],'cursors':Object[_0x16050e(0x1c8)]([...this['_cursors']['entries']()][_0x16050e(0xf6)](([_0x1b31f9,_0x61f63a])=>[_0x1b31f9[_0x16050e(0x125)]('\x00',':'),_0x61f63a])),'pending':this['_pending'][_0x16050e(0x1f0)],'seen':this[_0x16050e(0x1b1)][_0x16050e(0x1f0)]};}}return _0x2c4bbf[_0x103ff7(0x7a)]=_0x521d39,okdbChangefeed={'OKDBChangefeed':_0x2c4bbf},okdbChangefeed;}var okdbCluster,hasRequiredOkdbCluster;function requireOkdbCluster(){const _0x3350ab=_0xd218e;if(hasRequiredOkdbCluster)return okdbCluster;hasRequiredOkdbCluster=0x1;const _0x57edd3=require$$1,_0x183e5e=require$$1$1,{EVENTS:_0x94bf1f}=requireOkdbEnums(),_0x3f9272=require$$0$1,{slotKey:_0x1e30be}=requireOkdbProcessRegistry(),_0x52a75f=0xfa,_0x538d4e=0xfa0,_0xc5a1d6=0x5,_0x465c74=0x2710,_0x501452=0xbb8,_0x28d8bc=0x7d0,_0x2e49aa=_0x3350ab(0x95),_0x394b29=_0x3350ab(0x1e2),_0x53c861=_0x3350ab(0x153),_0x132dfd=_0x3350ab(0x1bf),_0x29a64f=[_0x94bf1f[_0x3350ab(0xa5)],_0x94bf1f['FTS_REGISTERED'],_0x94bf1f[_0x3350ab(0x206)],_0x94bf1f[_0x3350ab(0x161)],_0x94bf1f[_0x3350ab(0x1d7)],_0x94bf1f['INDEX_READY'],_0x94bf1f[_0x3350ab(0x10d)],_0x94bf1f[_0x3350ab(0x1db)],_0x3350ab(0x157),_0x3350ab(0xb0),_0x3350ab(0xa0),_0x3350ab(0x14a),'processor:resumed',_0x3350ab(0x16a)],_0x304581=Number(process.env.OKDB_CLUSTER_STATUS_MS)||0x7d0;function _0x3a93d7({workers:_0x52d995,makeOkdb:_0x22323b,port:_0x253710,primaryOkdb:_0x2cbd1e,childEntry:childEntry=![],workerEnv:workerEnv=null}={}){const _0x520e44=_0x3350ab;if(_0x57edd3[_0x520e44(0xce)])return childEntry&&_0x57edd3[_0x520e44(0xf2)]({'exec':_0x183e5e[_0x520e44(0x1b3)](__dirname,_0x520e44(0x11f)),'args':[],'execArgv':((()=>{const _0x4b435d=_0x520e44,_0x319faf=[];for(let _0x34eb63=0x0;_0x34eb63<process['execArgv'][_0x4b435d(0x72)];_0x34eb63++){const _0x2ab9d9=process[_0x4b435d(0x17c)][_0x34eb63];if(_0x2ab9d9[_0x4b435d(0x141)](_0x4b435d(0x15d))||_0x2ab9d9[_0x4b435d(0x141)]('--watch')||_0x2ab9d9['startsWith'](_0x4b435d(0x19d)))continue;if(_0x2ab9d9==='-e'||_0x2ab9d9==='--eval'||_0x2ab9d9==='-p'||_0x2ab9d9===_0x4b435d(0xdb)){_0x34eb63++;continue;}_0x319faf['push'](_0x2ab9d9);}return _0x319faf;})())}),_0x22b516({'workers':_0x52d995,'port':_0x253710,'primaryOkdb':_0x2cbd1e,'workerEnv':workerEnv});return _0x3d4b6b({'makeOkdb':_0x22323b,'port':_0x253710});}function _0x22b516({workers:_0x583833,port:_0x57dd5c,primaryOkdb:_0x12fafb,workerEnv:_0x35b218}){const _0x3367f9=_0x3350ab,_0x26bb95=new Map(),_0xafaab8=new Map();let _0x5f2193=![];const _0x86974=_0x512ac3=>_0x512ac3?.[_0x3367f9(0x1c9)],_0x56b52a=_0x1c9b4c=>{const _0x4038eb=_0x3367f9,_0x2fde8c=_0x57edd3['fork']({...process.env,..._0x35b218||{},'OKDB_CLUSTER_SLOT':String(_0x1c9b4c)});return _0x2fde8c[_0x4038eb(0x1c9)]=_0x1c9b4c,_0x26bb95[_0x4038eb(0xc7)](_0x2fde8c[_0x4038eb(0x10f)]['pid'],{'worker':_0x2fde8c,'startedAt':Date[_0x4038eb(0x97)](),'slot':_0x1c9b4c}),_0x2fde8c['on'](_0x4038eb(0x100),_0x2ec2fd=>{const _0x5a05bd=_0x4038eb;console['log'](_0x5a05bd(0x11e)+_0x2fde8c[_0x5a05bd(0x10f)][_0x5a05bd(0x92)]+_0x5a05bd(0x1ec)+(_0x2ec2fd?.['message']??_0x2ec2fd));}),_0x2fde8c['on'](_0x4038eb(0x114),()=>_0x1b7b01()),_0x2fde8c;},_0x15f4a5=_0x29a7ba=>{const _0xa14b9d=_0x3367f9;for(const {worker:_0x3e933f}of _0x26bb95[_0xa14b9d(0x84)]()){if(_0x3e933f[_0xa14b9d(0x196)]()||!_0x3e933f[_0xa14b9d(0xda)]())continue;try{_0x3e933f[_0xa14b9d(0x174)](_0x29a7ba);}catch{}}};_0x12fafb?.[_0x3367f9(0x1b9)]?.({'kind':_0x3367f9(0xbb),'listenAddr':':'+_0x57dd5c})[_0x3367f9(0x1e3)](()=>{}),_0x12fafb?.['processes']?.['setOwnMeta']?.({'workersConfigured':_0x583833});const _0x2e7784={'engines':![],'asyncProcessors':![],'compaction':_0x3367f9(0x1e5),'http':!![]},_0x1b7b01=()=>{const _0x453904=_0x3367f9,_0xf6607=_0x12fafb?.[_0x453904(0x1c4)];if(!_0xf6607||!_0xf6607[_0x453904(0x9d)])return;const _0x1d94a2=_0xf6607['selfKey'];for(const {worker:_0x5384af,startedAt:_0xc380aa,slot:_0x569562,stats:_0x7570b2}of _0x26bb95[_0x453904(0x84)]()){if(_0x5384af[_0x453904(0x196)]())continue;const _0x176d49=_0xf6607[_0x453904(0x195)]?.()&&_0xf6607['getDesired']('slot',_0x3721ae(_0x569562))?.[_0x453904(0x1c7)]===!![];_0xf6607[_0x453904(0xa8)]({'pid':_0x5384af['process'][_0x453904(0x92)],'startedAt':_0xc380aa,'kind':_0x453904(0xc1),'supervisorKey':_0x1d94a2,'slot':_0x569562,'slotKey':_0x3721ae(_0x569562),'role':_0x2e7784,'listenAddr':':'+_0x57dd5c,'lifecycle':_0x176d49?'decommissioning':_0x453904(0x12c),'stats':_0x7570b2??null})['catch'](()=>{});}},_0x3721ae=_0x990350=>_0x1e30be(_0x3367f9(0x14b)+_0x57dd5c,_0x990350),_0x1dec19=_0x2febb4=>{const _0x56e8cd=_0x3367f9,_0x2dfb5e=_0x12fafb?.[_0x56e8cd(0x1c4)];if(!_0x2dfb5e?.[_0x56e8cd(0x195)]?.())return![];return _0x2dfb5e[_0x56e8cd(0x164)]('slot',_0x3721ae(_0x2febb4))?.['decommission']===!![];};for(let _0x23a4eb=0x0;_0x23a4eb<_0x583833;_0x23a4eb++){const _0x57f13a=_0x1dec19(_0x23a4eb);_0xafaab8['set'](_0x23a4eb,{'deaths':[],'consecutiveFailures':0x0,'dead':_0x57f13a,'respawnTimer':null}),_0x57f13a?console['log'](_0x3367f9(0x130)+_0x23a4eb+_0x3367f9(0x16b)):_0x56b52a(_0x23a4eb);}const _0xa7141a=()=>{const _0x3b21cf=_0x3367f9,_0x274f5b=_0x12fafb?.[_0x3b21cf(0x1c4)];if(!_0x274f5b?.[_0x3b21cf(0x9d)]||!_0x274f5b['hasDesired']?.())return;for(const [_0x15b99b,_0x3dd6e0]of _0xafaab8[_0x3b21cf(0x1c0)]()){const _0x2fa57c=_0x274f5b[_0x3b21cf(0x164)](_0x3b21cf(0x1b5),_0x3721ae(_0x15b99b)),_0x116120=_0x2fa57c?.[_0x3b21cf(0x1c7)]===!![],_0x3b16f5=_0x2fa57c?.[_0x3b21cf(0xf9)]===!![];if(_0x116120&&!_0x3dd6e0['dead']){_0x3dd6e0['dead']=!![];_0x3dd6e0['respawnTimer']&&(clearTimeout(_0x3dd6e0[_0x3b21cf(0x15a)]),_0x3dd6e0[_0x3b21cf(0x15a)]=null);for(const {worker:_0x378154}of _0x26bb95['values']()){if(_0x86974(_0x378154)!==_0x15b99b||_0x378154[_0x3b21cf(0x196)]())continue;try{if(_0x3b16f5)_0x378154[_0x3b21cf(0x10f)]['kill'](_0x3b21cf(0x17f));else _0x378154[_0x3b21cf(0xda)]()&&_0x378154[_0x3b21cf(0x18d)]();}catch{}}console[_0x3b21cf(0x153)](_0x3b21cf(0x1eb)+(_0x3b16f5?_0x3b21cf(0x1f1):'decommissioned')+_0x3b21cf(0x105)+_0x15b99b+_0x3b21cf(0x1d5));}else{if(!_0x116120&&_0x3dd6e0['dead']&&_0x2fa57c){_0x3dd6e0[_0x3b21cf(0x9e)]=![],_0x3dd6e0[_0x3b21cf(0x98)]=[],_0x3dd6e0[_0x3b21cf(0xdf)]=0x0;const _0x5c73f4=[..._0x26bb95['values']()][_0x3b21cf(0x15e)](({worker:_0x56ec88})=>_0x86974(_0x56ec88)===_0x15b99b&&!_0x56ec88['isDead']());!_0x5c73f4&&!_0x5f2193&&(_0x56b52a(_0x15b99b),console['log'](_0x3b21cf(0x1a2)+_0x15b99b));}}}},_0x45e583=()=>{try{_0xa7141a();}catch{}};_0x12fafb?.['events']?.['on']?.(_0x94bf1f['SYSTEM_PROC'],_0x45e583);const _0x14753e=[];if(_0x12fafb?.[_0x3367f9(0x70)]?.['on'])for(const _0x505b34 of _0x29a64f){const _0x57a114=_0x2b8eb1=>{_0x15f4a5({[_0x2e49aa]:_0x394b29,'event':_0x505b34,'data':_0x2b8eb1??{}});};_0x12fafb[_0x3367f9(0x70)]['on'](_0x505b34,_0x57a114),_0x14753e[_0x3367f9(0xfa)]({'event':_0x505b34,'handler':_0x57a114});}const _0xb99a6d=setInterval(()=>{_0xa7141a(),_0x1b7b01();},_0x304581);_0xb99a6d['unref']?.();const _0x17c037=(_0x4058a1,_0x7ad87c)=>{const _0x46781a=_0x3367f9;if(!_0x7ad87c||typeof _0x7ad87c!==_0x46781a(0x191)||_0x7ad87c[_0x2e49aa]!==_0x53c861)return;if(!_0x12fafb?.[_0x46781a(0x153)]?.[_0x46781a(0x1d9)])return;const _0x2b7e62=_0x7ad87c[_0x46781a(0xb9)]||{};_0x12fafb['log'][_0x46781a(0x1d9)]({..._0x2b7e62,'msg':'[w'+_0x7ad87c[_0x46781a(0x1b5)]+']\x20'+(_0x2b7e62[_0x46781a(0x1a7)]??''),'meta':{..._0x2b7e62['meta']||{},'worker':_0x7ad87c[_0x46781a(0x1b5)],'workerPid':_0x7ad87c['pid']}});};_0x57edd3['on'](_0x3367f9(0x6c),_0x17c037);const _0x5ed5d8=(_0x200b20,_0x3d486d)=>{const _0x55d242=_0x3367f9;if(!_0x3d486d||typeof _0x3d486d!=='object'||_0x3d486d[_0x2e49aa]!==_0x132dfd)return;const _0x45e51e=_0x26bb95[_0x55d242(0x87)](_0x200b20[_0x55d242(0x10f)]['pid']);if(_0x45e51e)_0x45e51e[_0x55d242(0x1bf)]={..._0x3d486d['stats'],'at':Date[_0x55d242(0x97)]()};};_0x57edd3['on']('message',_0x5ed5d8),_0x57edd3['on'](_0x3367f9(0xb4),(_0x6cf6ec,_0x2e3a7a,_0x44959c)=>{const _0x1bca9f=_0x3367f9,_0xc0f7b2=_0x6cf6ec[_0x1bca9f(0x10f)][_0x1bca9f(0x92)],_0x2bf8bd=_0x86974(_0x6cf6ec),_0x3e7e8d=_0x26bb95[_0x1bca9f(0x87)](_0xc0f7b2);if(_0x3e7e8d&&_0x12fafb?.[_0x1bca9f(0x1c4)])_0x12fafb[_0x1bca9f(0x1c4)][_0x1bca9f(0x7f)](_0xc0f7b2+':'+_0x3e7e8d[_0x1bca9f(0x103)])[_0x1bca9f(0x1e3)](()=>{});_0x26bb95[_0x1bca9f(0xfd)](_0xc0f7b2),console['log'](_0x1bca9f(0x11e)+_0xc0f7b2+_0x1bca9f(0x1e4)+(_0x2bf8bd??'?')+_0x1bca9f(0x13c)+(_0x1bca9f(0x1ce)+_0x2e3a7a+',\x20signal='+(_0x44959c??_0x1bca9f(0x185))+_0x1bca9f(0x160)+_0x26bb95[_0x1bca9f(0x1f0)]+_0x1bca9f(0x1b0))),_0x1b7b01();if(_0x5f2193||_0x2bf8bd==null)return;const _0x5056b8=_0xafaab8[_0x1bca9f(0x87)](_0x2bf8bd);if(!_0x5056b8||_0x5056b8[_0x1bca9f(0x9e)])return;const _0x2b336f=Date[_0x1bca9f(0x97)]();_0x5056b8[_0x1bca9f(0x98)][_0x1bca9f(0xfa)](_0x2b336f),_0x5056b8[_0x1bca9f(0x98)]=_0x5056b8[_0x1bca9f(0x98)]['filter'](_0x37828c=>_0x2b336f-_0x37828c<=_0x465c74);if(_0x5056b8[_0x1bca9f(0x98)]['length']>=_0xc5a1d6){_0x5056b8['dead']=!![],console['error']('[okdb-cluster]\x20CRASH-LOOP:\x20worker\x20slot='+_0x2bf8bd+'\x20died\x20'+_0x5056b8[_0x1bca9f(0x98)][_0x1bca9f(0x72)]+'\x20times\x20in\x20'+(_0x465c74+'ms\x20—\x20giving\x20up\x20on\x20this\x20slot;\x20'+_0x26bb95[_0x1bca9f(0x1f0)]+_0x1bca9f(0x1a5)));return;}_0x5056b8[_0x1bca9f(0xdf)]++;const _0x462e80=Math['min'](_0x538d4e,_0x52a75f*0x2**(_0x5056b8['consecutiveFailures']-0x1));console['log'](_0x1bca9f(0xdd)+_0x2bf8bd+_0x1bca9f(0xcc)+_0x462e80+'ms\x20(attempt\x20'+_0x5056b8['consecutiveFailures']+')'),_0x5056b8[_0x1bca9f(0x15a)]=setTimeout(()=>{const _0x21d817=_0x1bca9f;_0x5056b8[_0x21d817(0x15a)]=null;if(_0x5f2193||_0x5056b8['dead'])return;const _0x14fefa=_0x56b52a(_0x2bf8bd);_0x14fefa[_0x21d817(0xd5)]('listening',()=>{const _0x3c0010=_0x21d817;if(_0xafaab8[_0x3c0010(0x87)](_0x2bf8bd)===_0x5056b8)_0x5056b8[_0x3c0010(0xdf)]=0x0;});},_0x462e80),_0x5056b8[_0x1bca9f(0x15a)][_0x1bca9f(0x184)]?.();});const _0x4a95ac=[..._0x26bb95[_0x3367f9(0xf4)]()];console[_0x3367f9(0x153)](_0x3367f9(0xa2)+process[_0x3367f9(0x92)]+_0x3367f9(0x19a)+_0x583833+'\x20HTTP\x20server(s)\x20on\x20port\x20'+_0x57dd5c+':\x20'+('['+_0x4a95ac[_0x3367f9(0x1b3)](',\x20')+']'));const _0x4c6907={'_isClusterController':!![],'port':_0x57dd5c,'primaryOkdb':_0x12fafb??null,'status'(){const _0x37c1c6=_0x3367f9;return{'clustered':!![],'primaryPid':process[_0x37c1c6(0x92)],'port':_0x57dd5c,'primaryRole':_0x12fafb?.[_0x37c1c6(0x1ae)]??null,'processorPid':_0x12fafb?process[_0x37c1c6(0x92)]:null,'workers':[..._0x26bb95[_0x37c1c6(0x84)]()]['map'](({worker:_0x268984})=>({'pid':_0x268984[_0x37c1c6(0x10f)]['pid'],'id':_0x268984['id'],'dead':_0x268984[_0x37c1c6(0x196)]()}))};},async 'close'(){const _0x5c11d2=_0x3367f9;_0x5f2193=!![];for(const _0x251011 of _0xafaab8[_0x5c11d2(0x84)]()){_0x251011[_0x5c11d2(0x9e)]=!![],_0x251011['respawnTimer']&&(clearTimeout(_0x251011[_0x5c11d2(0x15a)]),_0x251011[_0x5c11d2(0x15a)]=null);}clearInterval(_0xb99a6d),_0x57edd3[_0x5c11d2(0xcd)](_0x5c11d2(0x6c),_0x17c037),_0x57edd3['off']('message',_0x5ed5d8),_0x12fafb?.['events']?.[_0x5c11d2(0xcd)]?.(_0x94bf1f[_0x5c11d2(0x1f7)],_0x45e583);if(_0x12fafb?.['events']?.[_0x5c11d2(0xcd)])for(const {event:_0x543b3e,handler:_0x2bfbc3}of _0x14753e){try{_0x12fafb[_0x5c11d2(0x70)]['off'](_0x543b3e,_0x2bfbc3);}catch{}}_0x14753e[_0x5c11d2(0x72)]=0x0;const _0x1ba58b=[..._0x26bb95[_0x5c11d2(0x84)]()][_0x5c11d2(0xf6)](({worker:_0x3094a3})=>_0x3094a3);if(_0x1ba58b['length']===0x0)return;await Promise['all'](_0x1ba58b['map'](_0x161554=>new Promise(_0x8d09da=>{const _0x233f3d=_0x5c11d2;if(_0x161554['isDead']()){_0x8d09da();return;}let _0x2e4f12=![];const _0x101722=()=>{if(_0x2e4f12)return;_0x2e4f12=!![];if(_0x369221)clearTimeout(_0x369221);_0x8d09da();};_0x161554[_0x233f3d(0xd5)](_0x233f3d(0xb4),_0x101722);const _0x369221=setTimeout(()=>{const _0x135373=_0x233f3d;try{_0x161554[_0x135373(0x10f)][_0x135373(0xf9)]();}catch{}},_0x501452+0x1f4);_0x369221[_0x233f3d(0x184)]?.();try{_0x161554[_0x233f3d(0x18d)]();}catch{try{_0x161554[_0x233f3d(0x10f)][_0x233f3d(0xf9)]();}catch{}}})));}};return _0x4c6907;}async function _0x3d4b6b({makeOkdb:_0x416416,port:_0x2a7988}){const _0x27ca0b=_0x3350ab,_0x51a19d=await _0x416416();return _0x306a93(_0x51a19d),_0x51a19d[_0x27ca0b(0x12e)][_0x27ca0b(0x9b)](_0x2a7988);}function _0x306a93(_0x325778){const _0x5e2ea4=_0x3350ab;if(!_0x325778||_0x325778[_0x5e2ea4(0x1c2)])return;_0x325778[_0x5e2ea4(0x1c2)]=!![];try{const {OKDBChangefeed:_0x933c4f}=requireOkdbChangefeed(),_0x4720c=_0x325778[_0x5e2ea4(0x6e)];if(_0x4720c&&typeof _0x4720c[_0x5e2ea4(0x18a)]===_0x5e2ea4(0x198)){const _0x56dc02=new _0x933c4f(_0x325778);_0x56dc02['start'](),_0x4720c[_0x5e2ea4(0x18a)](_0x56dc02),_0x325778['_changefeed']=_0x56dc02;}}catch(_0x834aa9){_0x325778[_0x5e2ea4(0x153)]?.[_0x5e2ea4(0x1d1)]?.(_0x5e2ea4(0x1cc)+(_0x834aa9?.[_0x5e2ea4(0x6c)]??_0x834aa9),{'feature':_0x5e2ea4(0xeb)});}const _0x298b49=_0x48f5a4=>{const _0x332f86=_0x5e2ea4;if(!_0x48f5a4||typeof _0x48f5a4!==_0x332f86(0x191)||_0x48f5a4[_0x2e49aa]==null)return;if(_0x48f5a4[_0x2e49aa]===_0x394b29)try{_0x325778[_0x332f86(0x6e)]?.[_0x332f86(0x82)]?.(_0x48f5a4['event'],_0x48f5a4[_0x332f86(0x117)]);}catch{}};process['on'](_0x5e2ea4(0x6c),_0x298b49),_0x325778[_0x5e2ea4(0x1ab)]=_0x298b49;{let _0x185d8d=process[_0x5e2ea4(0x1a4)](),_0x1575c0=Date['now']();const _0x5bdbaa=()=>{const _0x15a7ba=_0x5e2ea4;if(typeof process[_0x15a7ba(0x174)]!=='function'||!process[_0x15a7ba(0x1f8)])return;const _0x145cf7=Date[_0x15a7ba(0x97)](),_0x193fce=process[_0x15a7ba(0x1a4)](),_0x341887=(_0x145cf7-_0x1575c0)*0x3e8,_0x546480=_0x193fce[_0x15a7ba(0x88)]-_0x185d8d['user']+(_0x193fce[_0x15a7ba(0x1bb)]-_0x185d8d[_0x15a7ba(0x1bb)]),_0x55351c=_0x341887>0x0?Math['min'](0x64,Math['round'](_0x546480/(_0x341887*(_0x3f9272[_0x15a7ba(0x1d3)]()[_0x15a7ba(0x72)]||0x1))*0x64)):0x0;_0x185d8d=_0x193fce,_0x1575c0=_0x145cf7;const _0x15de6c=process[_0x15a7ba(0xcb)]();try{process[_0x15a7ba(0x174)]({[_0x2e49aa]:_0x132dfd,'stats':{'rss':_0x15de6c['rss'],'heapUsed':_0x15de6c[_0x15a7ba(0xc0)],'heapTotal':_0x15de6c[_0x15a7ba(0x111)],'external':_0x15de6c[_0x15a7ba(0x12d)],'cpuPct':_0x55351c,'cpuWindowMs':Math[_0x15a7ba(0x150)](_0x341887/0x3e8)||null}});}catch{}},_0x2ebd16=Math['max'](0x3e8,Number(process.env.OKDB_STATS_INTERVAL_MS)||0x1388),_0x3233c7=setInterval(_0x5bdbaa,_0x2ebd16);_0x3233c7[_0x5e2ea4(0x184)]?.(),_0x5bdbaa();}let _0x5e5e0f=![];const _0x249b07=async _0x47683d=>{const _0x320a32=_0x5e2ea4;if(_0x5e5e0f)return;_0x5e5e0f=!![];const _0x2a1d6a=setTimeout(()=>process[_0x320a32(0xb4)](_0x47683d),_0x501452);_0x2a1d6a['unref']?.();try{await _0x325778[_0x320a32(0x134)]?.();}catch{}process[_0x320a32(0xb4)](_0x47683d);};process['on'](_0x5e2ea4(0x18d),()=>_0x249b07(0x0));if(process[_0x5e2ea4(0x1ac)]!==_0x5e2ea4(0x18e)){const _0x52ee73=setInterval(()=>{const _0x5f55e8=_0x5e2ea4;if(process[_0x5f55e8(0x9f)]===0x1)_0x249b07(0x0);},_0x28d8bc);_0x52ee73['unref']?.(),_0x325778[_0x5e2ea4(0x11d)]=_0x52ee73;}}return okdbCluster={'runClustered':_0x3a93d7,'attachWorkerCluster':_0x306a93},okdbCluster;}var hasRequiredOkdbHttpWorkerChild;function requireOkdbHttpWorkerChild(){const _0x59aa1f=_0xd218e;if(hasRequiredOkdbHttpWorkerChild)return okdbHttpWorkerChild$1;hasRequiredOkdbHttpWorkerChild=0x1;const _0x3501d6=require$$0$3,{attachWorkerCluster:_0x319402}=requireOkdbCluster();async function _0x30d62e(){const _0x3e8f9b=_0x2a26,_0x29e3c5=process.env.OKDB_HTTP_CHILD;if(!_0x29e3c5)throw new Error('okdb-http-worker-child:\x20OKDB_HTTP_CHILD\x20env\x20config\x20missing');const {rootPath:_0x37e54e,port:_0x197b45,options:options={},logLevel:logLevel=_0x3e8f9b(0xe2)}=JSON['parse'](_0x29e3c5);if(!_0x37e54e||!_0x197b45)throw new Error(_0x3e8f9b(0x1ff));const _0x3f47cb=new _0x3501d6(_0x37e54e,{...options,'engines':![],'asyncProcessors':![],'compaction':_0x3e8f9b(0x1e5),'bus':!![]});_0x3f47cb[_0x3e8f9b(0x153)][_0x3e8f9b(0x10c)]?.();const _0x53f897=process.env.OKDB_CLUSTER_SLOT??'?',_0x4bd66a={'debug':0x0,'info':0x1,'warn':0x2,'error':0x3},_0x26951f=_0x4bd66a[logLevel]??_0x4bd66a['info'];_0x3f47cb[_0x3e8f9b(0x153)][_0x3e8f9b(0xf8)](_0x19b940=>{const _0x4b1fe4=_0x3e8f9b;if((_0x4bd66a[_0x19b940['level']]??0x1)<_0x26951f)return;try{process[_0x4b1fe4(0x174)]?.({'__okdbCluster':_0x4b1fe4(0x153),'slot':_0x53f897,'pid':process[_0x4b1fe4(0x92)],'entry':_0x19b940});}catch{}}),await _0x3f47cb['open'](),_0x319402(_0x3f47cb),await _0x3f47cb[_0x3e8f9b(0x12e)]['listen'](_0x197b45);}return _0x30d62e()[_0x59aa1f(0x1e3)](_0xb59547=>{const _0x2a20e5=_0x59aa1f;try{process[_0x2a20e5(0x174)]?.({'__okdbCluster':_0x2a20e5(0x153),'slot':process.env.OKDB_CLUSTER_SLOT??'?','pid':process[_0x2a20e5(0x92)],'entry':{'level':_0x2a20e5(0x100),'msg':_0x2a20e5(0x1e9)+(_0xb59547?.[_0x2a20e5(0x6c)]??_0xb59547)}});}catch{}process[_0x2a20e5(0xb4)](0x1);}),okdbHttpWorkerChild$1;}var okdbHttpWorkerChildExports=requireOkdbHttpWorkerChild(),okdbHttpWorkerChild=getDefaultExportFromCjs(okdbHttpWorkerChildExports);module[_0xd218e(0x73)]=okdbHttpWorkerChild;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function loadHandler(e,o){const n=require(e);if(o&&"default"!==o){const e=n?.[o];if("function"!=typeof e)throw new Error(`Spawned queue worker export not found or not a function: ${o}`);return e}if("function"==typeof n)return n;if("function"==typeof n?.default)return n.default;throw new Error("Spawned queue worker module must export a function or default function")}module.exports={loadHandler:loadHandler};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const path=require("node:path"),OKDB=require(path.join(__dirname,"okdb.js"));let db=null,worker=null,stopping=!1;function send(e){try{"function"==typeof process.send&&process.send(e)}catch{}}async function gracefulShutdown(e){if(stopping)return;stopping=!0;const
|
|
1
|
+
"use strict";const path=require("node:path"),OKDB=require(path.join(__dirname,"okdb.js"));let db=null,worker=null,stopping=!1;function send(e){try{"function"==typeof process.send&&process.send(e)}catch{}}async function gracefulShutdown(e){if(stopping)return;stopping=!0;const s=setTimeout(()=>process.exit(e),3e3);"function"==typeof s.unref&&s.unref();try{await(worker?.stop?.())}catch{}try{await(db?.close?.())}catch{}process.exit(e)}function startStatsReporter(e){const s=require("node:os");let t=process.cpuUsage(),n=Date.now();const r=()=>{const r=Date.now(),o=process.cpuUsage(),a=1e3*(r-n),c=o.user-t.user+(o.system-t.system),p=a>0?Math.min(100,Math.round(c/(a*(s.cpus().length||1))*100)):0;t=o,n=r;const u=process.memoryUsage();e({type:"stats",stats:{rss:u.rss,heapUsed:u.heapUsed,heapTotal:u.heapTotal,external:u.external,cpuPct:p,cpuWindowMs:Math.round(a/1e3)||null}})},o=Math.max(1e3,Number(process.env.OKDB_STATS_INTERVAL_MS)||5e3),a=setInterval(r,o);a.unref&&a.unref(),r()}const{loadHandler:loadHandler}=require("./okdb-queue-load-handler.js");async function main(){const e=process.env.OKDB_QUEUE_DB_PATH,s=process.env.OKDB_QUEUE_ENV_NAME||"default",t=process.env.OKDB_QUEUE_TYPE,n=process.env.OKDB_QUEUE_MODULE,r=process.env.OKDB_QUEUE_EXPORT||"default",o=JSON.parse(process.env.OKDB_QUEUE_WORKER_OPTIONS||"{}");if(!e)throw new Error("Missing OKDB_QUEUE_DB_PATH");if(!t)throw new Error("Missing OKDB_QUEUE_TYPE");if(!n)throw new Error("Missing OKDB_QUEUE_MODULE");process.on("disconnect",()=>gracefulShutdown(0));const a=setInterval(()=>{1===process.ppid&&gracefulShutdown(0)},2e3);"function"==typeof a.unref&&a.unref(),db=new OKDB(e,{runtimeDeclarations:!1,compaction:"passive",engines:!1,asyncProcessors:!1,http:!1,envs:[s]}),await db.open();const c=db.env(s);if(!c?.queue)throw new Error(`Queue environment not available: ${s}`);const p=loadHandler(n,r);worker=c.queue.process(t,p,o),process.on("message",e=>{e&&"object"==typeof e&&"stop"===e.type&&gracefulShutdown(0)}),process.on("SIGINT",()=>gracefulShutdown(0)),process.on("SIGTERM",()=>gracefulShutdown(0)),send({type:"ready",pid:process.pid,envName:s,queueType:t}),startStatsReporter(send)}main().catch(async e=>{send({type:"error",error:{message:e?.message||String(e),stack:e?.stack||null,code:e?.code||null}});try{await(worker?.stop?.())}catch{}try{await(db?.close?.())}catch{}process.exit(1)});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const _0xc249a0=_0x46a5;(function(_0x20a04a,_0x4d55be){const _0x56f397=_0x46a5,_0x32eed1=_0x20a04a();while(!![]){try{const _0x5ac2f6=parseInt(_0x56f397(0x140))/0x1+parseInt(_0x56f397(0x15a))/0x2*(parseInt(_0x56f397(0x150))/0x3)+parseInt(_0x56f397(0x156))/0x4*(-parseInt(_0x56f397(0x168))/0x5)+-parseInt(_0x56f397(0x16b))/0x6+parseInt(_0x56f397(0x130))/0x7+-parseInt(_0x56f397(0x14b))/0x8*(-parseInt(_0x56f397(0x12b))/0x9)+-parseInt(_0x56f397(0x136))/0xa;if(_0x5ac2f6===_0x4d55be)break;else _0x32eed1['push'](_0x32eed1['shift']());}catch(_0x5fcf91){_0x32eed1['push'](_0x32eed1['shift']());}}}(_0x3c9d,0x6864a));var require$$0=require(_0xc249a0(0x131)),require$$1=require(_0xc249a0(0x13c));function getDefaultExportFromCjs(_0x38b93d){const _0xed41ab=_0xc249a0;return _0x38b93d&&_0x38b93d[_0xed41ab(0x127)]&&Object['prototype'][_0xed41ab(0x13b)][_0xed41ab(0x15e)](_0x38b93d,_0xed41ab(0x133))?_0x38b93d[_0xed41ab(0x133)]:_0x38b93d;}function _0x46a5(_0x3f0b22,_0x138fa1){_0x3f0b22=_0x3f0b22-0x11b;const _0x3c9d5a=_0x3c9d();let _0x46a52a=_0x3c9d5a[_0x3f0b22];return _0x46a52a;}var okdbViewsBootstrapWorker$1={},okdbEnums,hasRequiredOkdbEnums;function requireOkdbEnums(){const _0x491feb=_0xc249a0;if(hasRequiredOkdbEnums)return okdbEnums;hasRequiredOkdbEnums=0x1;const _0x308de4={'PUT':_0x491feb(0x15f),'REMOVE':_0x491feb(0x125),'INDEX_DROP':_0x491feb(0x13a),'INDEX_REGISTER':_0x491feb(0x152),'INDEX_RESET':_0x491feb(0x147),'TYPE_REGISTER':_0x491feb(0x155),'TYPE_DROP':_0x491feb(0x122),'FTS_REGISTER':'registerFts','FTS_DROP':'dropFts','FTS_RESET':_0x491feb(0x132),'SCHEMA_SET':_0x491feb(0x11c),'SCHEMA_DROP':_0x491feb(0x12c),'TTL_SET':_0x491feb(0x135),'TTL_CLEAR':_0x491feb(0x123)},_0x3eec1a={'SYSTEM_READY':_0x491feb(0x11b),'SYSTEM_STOPPED':_0x491feb(0x146),'SYSTEM_CLOCK_CHANGE':_0x491feb(0x145),'SYSTEM_POKE':_0x491feb(0x15b),'SYSTEM_DRAIN':_0x491feb(0x141),'SYSTEM_TYPE_DROP':_0x491feb(0x13f),'SYSTEM_PROC':_0x491feb(0x148),'SYSTEM_BUS_STATE_CHANGE':'system:bus_state_change','ITEM_CREATE':'item:create','ITEM_UPDATE':_0x491feb(0x128),'ITEM_REMOVE':_0x491feb(0x160),'INDEX_RESET':_0x491feb(0x14f),'INDEX_READY':_0x491feb(0x161),'INDEX_PROGRESS':_0x491feb(0x121),'VIEW_PROGRESS':_0x491feb(0x11d),'INDEX_DROP':'index:drop','INDEX_REGISTERED':'index:registered','FTS_REGISTERED':'fts:registered','FTS_DROP':_0x491feb(0x15d),'FTS_RESET':'fts:reset','SCHEMA_SET':_0x491feb(0x158),'SCHEMA_DROP':_0x491feb(0x139),'UNIQUE_VIOLATION':_0x491feb(0x12f),'UNIQUE_VIOLATION_RESOLVED':_0x491feb(0x143),'REF_VIOLATION':_0x491feb(0x16c),'REF_VIOLATION_RESOLVED':_0x491feb(0x149),'SYNC_APPLY':_0x491feb(0x164),'TXN_START':'txn:start','TXN_END':_0x491feb(0x15c),'TXN_ROLLBACK':_0x491feb(0x11e),'TYPE_REGISTERED':_0x491feb(0x13e),'TYPE_DROP':_0x491feb(0x14d),'ENV_OPENED':_0x491feb(0x138),'ENV_REMOVED':_0x491feb(0x167),'TTL_EXPIRED':'ttl:expired','TTL_SET':'ttl:set','TTL_CLEAR':_0x491feb(0x134),'LICENSE_INVALID':_0x491feb(0x169),'LICENSE_ADDED':_0x491feb(0x120),'LICENSE_ACTIVATED':_0x491feb(0x166),'LICENSE_REMOVED':_0x491feb(0x162)},_0x1a780a={'CREATING':_0x491feb(0x13d),'RESETTING':_0x491feb(0x159),'READY':'ready','DROPPING':'dropping','WAITING':'waiting'},_0x4cf705={'CREATED':_0x491feb(0x142),'STARTING':_0x491feb(0x12d),'STARTED':_0x491feb(0x163),'STOPPING':_0x491feb(0x144),'STOPPED':_0x491feb(0x16a)},_0x11b14a={'CREATING':_0x491feb(0x13d),'READY':'ready','HALTED':_0x491feb(0x137),'STOPPED':_0x491feb(0x16a),'RESETTING':'resetting'},_0x21c933=Object[_0x491feb(0x12e)]({'POKE':_0x491feb(0x14e),'DRAIN':_0x491feb(0x11f),'TYPE_DROP':'bus:type_drop','PROC':_0x491feb(0x126)});return okdbEnums={'BUS_EVENTS':_0x21c933,'CHANGE_ACTIONS':_0x308de4,'EVENTS':_0x3eec1a,'INDEX_STATE':_0x1a780a,'OKDB_STATE':_0x4cf705,'VIEW_STATE':_0x11b14a},okdbEnums;}var hasRequiredOkdbViewsBootstrapWorker;function requireOkdbViewsBootstrapWorker(){const _0x2cfb6e=_0xc249a0;if(hasRequiredOkdbViewsBootstrapWorker)return okdbViewsBootstrapWorker$1;hasRequiredOkdbViewsBootstrapWorker=0x1;const {parentPort:_0x4f5b0d,workerData:_0x5d6dd4}=require$$0,_0x283a47=require$$1,{EVENTS:_0x5aef2b}=requireOkdbEnums();async function _0x3ac427(){const _0x590d0c=_0x46a5,{rootPath:_0x947af6,envName:_0x34b57c,viewName:_0x3525e4,definition:_0x134598}=_0x5d6dd4,_0x8e27bb=new _0x283a47(_0x947af6,{'admin':![],'mcp':![],'http':![],'timeMachine':![],'engines':![],'asyncProcessors':![],'compaction':_0x590d0c(0x165),'_skipBootRuntime':!![]});await _0x8e27bb['open']();const _0x2d4326=_0x8e27bb[_0x590d0c(0x124)](_0x34b57c);_0x2d4326[_0x590d0c(0x157)]['on'](_0x5aef2b['VIEW_PROGRESS'],_0x16f747=>{if(_0x16f747?.['name']!==_0x3525e4)return;try{_0x4f5b0d['postMessage']({'type':'progress','event':_0x16f747});}catch{}}),_0x2d4326[_0x590d0c(0x14c)]['_activateViewStorage'](_0x3525e4,_0x134598),await _0x2d4326[_0x590d0c(0x14c)]['_runBootstrapScanPhases'](_0x3525e4,_0x134598),_0x4f5b0d[_0x590d0c(0x153)]({'type':'done'}),await _0x8e27bb['close'](),process[_0x590d0c(0x129)](0x0);}return _0x3ac427()[_0x2cfb6e(0x154)](_0x1f4623=>{const _0x49aa30=_0x2cfb6e;try{_0x4f5b0d[_0x49aa30(0x153)]({'type':_0x49aa30(0x151),'error':_0x1f4623['message']??String(_0x1f4623),'stack':_0x1f4623[_0x49aa30(0x12a)]});}catch{}process[_0x49aa30(0x129)](0x1);}),okdbViewsBootstrapWorker$1;}function _0x3c9d(){const _0x2040ec=['remove','bus:proc','__esModule','item:update','exit','stack','126QptZLx','dropSchema','starting','freeze','unique:violation','2779693pxJqqw','worker_threads','resetFts','default','ttl:clear','setTtl','9673670ooVvqn','halted','env:opened','schema:drop','dropIndex','hasOwnProperty','./okdb','creating','type:registered','system:type_drop','724749FcJUaQ','system:drain','created','unique:violation_resolved','stopping','system:clock_change','system:stopped','resetIndex','system:proc','ref:violation_resolved','exports','440808ZLHKYt','views','type:drop','bus:poke','index:reset','159711DBVIBD','error','registerIndex','postMessage','catch','registerType','1492uwpXAP','events','schema:set','resetting','22HVozXm','system:poke','txn:end','fts:drop','call','put','item:remove','index:ready','license:removed','started','sync:apply','passive','license:activated','env:removed','5585AZZqFu','license:invalid','stopped','4003602PsCctL','ref:violation','system:ready','setSchema','view:progress','txn:rollback','bus:drain','license:added','index:progress','dropType','clearTtl','env'];_0x3c9d=function(){return _0x2040ec;};return _0x3c9d();}var okdbViewsBootstrapWorkerExports=requireOkdbViewsBootstrapWorker(),okdbViewsBootstrapWorker=getDefaultExportFromCjs(okdbViewsBootstrapWorkerExports);module[_0xc249a0(0x14a)]=okdbViewsBootstrapWorker;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const _0x275d88=_0x3fcd;(function(_0x489f47,_0x158e35){const _0x28483a=_0x3fcd,_0xdf56c4=_0x489f47();while(!![]){try{const _0x279877=parseInt(_0x28483a(0x254))/0x1*(-parseInt(_0x28483a(0x26d))/0x2)+-parseInt(_0x28483a(0x1cf))/0x3*(-parseInt(_0x28483a(0x1ca))/0x4)+parseInt(_0x28483a(0x211))/0x5*(-parseInt(_0x28483a(0x18b))/0x6)+parseInt(_0x28483a(0x2bb))/0x7*(parseInt(_0x28483a(0x1f8))/0x8)+-parseInt(_0x28483a(0x24e))/0x9*(-parseInt(_0x28483a(0x1ef))/0xa)+-parseInt(_0x28483a(0x1e1))/0xb*(-parseInt(_0x28483a(0x223))/0xc)+-parseInt(_0x28483a(0x2ae))/0xd*(-parseInt(_0x28483a(0x24a))/0xe);if(_0x279877===_0x158e35)break;else _0xdf56c4['push'](_0xdf56c4['shift']());}catch(_0x16a59b){_0xdf56c4['push'](_0xdf56c4['shift']());}}}(_0x33bb,0x9f5ed));function _0x3fcd(_0x1ab090,_0xb6640f){_0x1ab090=_0x1ab090-0x189;const _0x33bb37=_0x33bb();let _0x3fcd38=_0x33bb37[_0x1ab090];return _0x3fcd38;}var require$$0$1=require('path'),require$$1$1=require('os'),require$$0=require(_0x275d88(0x1a9)),require$$1=require(_0x275d88(0x27c));function getDefaultExportFromCjs(_0x912fa){const _0x2d597c=_0x275d88;return _0x912fa&&_0x912fa[_0x2d597c(0x239)]&&Object['prototype'][_0x2d597c(0x1b8)]['call'](_0x912fa,_0x2d597c(0x1f5))?_0x912fa[_0x2d597c(0x1f5)]:_0x912fa;}function commonjsRequire(_0x2353d9){const _0x4640ee=_0x275d88;throw new Error(_0x4640ee(0x21b)+_0x2353d9+'\x22.\x20Please\x20configure\x20the\x20dynamicRequireTargets\x20or/and\x20ignoreDynamicRequires\x20option\x20of\x20@rollup/plugin-commonjs\x20appropriately\x20for\x20this\x20require\x20call\x20to\x20work.');}var okdbWorkerChild$1={},okdbEnums,hasRequiredOkdbEnums;function requireOkdbEnums(){const _0x396ce2=_0x275d88;if(hasRequiredOkdbEnums)return okdbEnums;hasRequiredOkdbEnums=0x1;const _0x14b7d3={'PUT':_0x396ce2(0x274),'REMOVE':'remove','INDEX_DROP':'dropIndex','INDEX_REGISTER':_0x396ce2(0x1e2),'INDEX_RESET':_0x396ce2(0x1bb),'TYPE_REGISTER':_0x396ce2(0x195),'TYPE_DROP':_0x396ce2(0x289),'FTS_REGISTER':'registerFts','FTS_DROP':_0x396ce2(0x1b5),'FTS_RESET':'resetFts','SCHEMA_SET':_0x396ce2(0x1df),'SCHEMA_DROP':_0x396ce2(0x1a3),'TTL_SET':_0x396ce2(0x1d7),'TTL_CLEAR':_0x396ce2(0x1de)},_0x3cc775={'SYSTEM_READY':_0x396ce2(0x1d9),'SYSTEM_STOPPED':_0x396ce2(0x2b1),'SYSTEM_CLOCK_CHANGE':_0x396ce2(0x1eb),'SYSTEM_POKE':_0x396ce2(0x1ea),'SYSTEM_DRAIN':_0x396ce2(0x287),'SYSTEM_TYPE_DROP':_0x396ce2(0x25c),'SYSTEM_PROC':_0x396ce2(0x266),'SYSTEM_BUS_STATE_CHANGE':'system:bus_state_change','ITEM_CREATE':_0x396ce2(0x272),'ITEM_UPDATE':_0x396ce2(0x18a),'ITEM_REMOVE':_0x396ce2(0x232),'INDEX_RESET':_0x396ce2(0x1e3),'INDEX_READY':_0x396ce2(0x27d),'INDEX_PROGRESS':_0x396ce2(0x297),'VIEW_PROGRESS':_0x396ce2(0x21f),'INDEX_DROP':'index:drop','INDEX_REGISTERED':_0x396ce2(0x21c),'FTS_REGISTERED':_0x396ce2(0x1f6),'FTS_DROP':_0x396ce2(0x1b3),'FTS_RESET':_0x396ce2(0x224),'SCHEMA_SET':_0x396ce2(0x276),'SCHEMA_DROP':_0x396ce2(0x1d1),'UNIQUE_VIOLATION':_0x396ce2(0x1c0),'UNIQUE_VIOLATION_RESOLVED':_0x396ce2(0x256),'REF_VIOLATION':_0x396ce2(0x2bf),'REF_VIOLATION_RESOLVED':_0x396ce2(0x1e4),'SYNC_APPLY':_0x396ce2(0x20d),'TXN_START':'txn:start','TXN_END':_0x396ce2(0x1ba),'TXN_ROLLBACK':_0x396ce2(0x1b9),'TYPE_REGISTERED':_0x396ce2(0x19c),'TYPE_DROP':'type:drop','ENV_OPENED':_0x396ce2(0x194),'ENV_REMOVED':_0x396ce2(0x207),'TTL_EXPIRED':_0x396ce2(0x290),'TTL_SET':'ttl:set','TTL_CLEAR':_0x396ce2(0x18e),'LICENSE_INVALID':_0x396ce2(0x1a1),'LICENSE_ADDED':_0x396ce2(0x1cd),'LICENSE_ACTIVATED':_0x396ce2(0x216),'LICENSE_REMOVED':_0x396ce2(0x1e5)},_0x3bc718={'CREATING':_0x396ce2(0x197),'RESETTING':_0x396ce2(0x2be),'READY':_0x396ce2(0x1c6),'DROPPING':_0x396ce2(0x275),'WAITING':'waiting'},_0x4b6744={'CREATED':'created','STARTING':_0x396ce2(0x201),'STARTED':_0x396ce2(0x1fb),'STOPPING':_0x396ce2(0x22e),'STOPPED':_0x396ce2(0x2b2)},_0x2fd3aa={'CREATING':_0x396ce2(0x197),'READY':_0x396ce2(0x1c6),'HALTED':_0x396ce2(0x1dd),'STOPPED':_0x396ce2(0x2b2),'RESETTING':'resetting'},_0x35b09f=Object[_0x396ce2(0x2ad)]({'POKE':_0x396ce2(0x24d),'DRAIN':_0x396ce2(0x2bd),'TYPE_DROP':'bus:type_drop','PROC':'bus:proc'});return okdbEnums={'BUS_EVENTS':_0x35b09f,'CHANGE_ACTIONS':_0x14b7d3,'EVENTS':_0x3cc775,'INDEX_STATE':_0x3bc718,'OKDB_STATE':_0x4b6744,'VIEW_STATE':_0x2fd3aa},okdbEnums;}var okdbLoopMonitor,hasRequiredOkdbLoopMonitor;function requireOkdbLoopMonitor(){const _0x4bcbd1=_0x275d88;if(hasRequiredOkdbLoopMonitor)return okdbLoopMonitor;hasRequiredOkdbLoopMonitor=0x1;const {monitorEventLoopDelay:_0x149e5e,performance:_0x4ce206}=require$$0,_0x558c9e=process.env.OKDB_LOOP_LAG==='1'||process.env.OKDB_LOOP_LAG==='true',_0xe778a=Number(process.env.OKDB_LOOP_LAG_MS)||0x7d0,_0x2ee5db=process.env.OKDB_LOOP_LAG_ALL==='1',_0x1093dd=Number(process.env.OKDB_LOOP_LAG_MIN_MS)||0x64;class _0x3bf88c{constructor(){const _0x5a21c9=_0x3fcd;this[_0x5a21c9(0x1c4)]=_0x558c9e,this[_0x5a21c9(0x244)]=new Map(),this['_h']=null,this['_timer']=null,this[_0x5a21c9(0x1d2)]=![],this[_0x5a21c9(0x29c)]=(_0x440692,_0x38a57f)=>process[_0x5a21c9(0x1bd)][_0x5a21c9(0x231)](_0x440692+(_0x38a57f?'\x20'+JSON[_0x5a21c9(0x2ba)](_0x38a57f):'')+'\x0a');}[_0x4bcbd1(0x247)](){const _0x4de07e=_0x4bcbd1;return _0x4ce206[_0x4de07e(0x247)]();}[_0x4bcbd1(0x273)](_0x59f649){if(typeof _0x59f649==='function')this['_log']=_0x59f649;}[_0x4bcbd1(0x200)](_0x53fa29,_0x1103af,_0x2abfa1){const _0x41509b=_0x4bcbd1;if(!this[_0x41509b(0x1c4)])return;let _0x3f4f55=this[_0x41509b(0x244)][_0x41509b(0x23b)](_0x53fa29);!_0x3f4f55&&(_0x3f4f55={'ms':0x0,'count':0x0,'maxMs':0x0,'maxExtra':''},this[_0x41509b(0x244)][_0x41509b(0x1be)](_0x53fa29,_0x3f4f55)),_0x3f4f55['ms']+=_0x1103af,_0x3f4f55[_0x41509b(0x2b8)]+=0x1,_0x1103af>_0x3f4f55[_0x41509b(0x1bc)]&&(_0x3f4f55[_0x41509b(0x1bc)]=_0x1103af,_0x3f4f55[_0x41509b(0x1dc)]=_0x2abfa1||'');}[_0x4bcbd1(0x26a)](_0x1f510c){const _0x42897e=_0x4bcbd1;if(!this[_0x42897e(0x1c4)]||this[_0x42897e(0x1d2)])return;this[_0x42897e(0x1d2)]=!![];if(_0x1f510c)this[_0x42897e(0x29c)]=_0x1f510c;this['_h']=_0x149e5e({'resolution':0xa}),this['_h'][_0x42897e(0x1b6)](),this[_0x42897e(0x2a2)]=setInterval(()=>this['_report'](),_0xe778a);if(this[_0x42897e(0x2a2)]['unref'])this[_0x42897e(0x2a2)][_0x42897e(0x2b6)]();}[_0x4bcbd1(0x1fe)](_0x468879){const _0x50b488=_0x4bcbd1;if(!this[_0x50b488(0x240)])this['_windowCbs']=new Set();this['_windowCbs']['add'](_0x468879);if(!this['_started'])this[_0x50b488(0x1d8)]();}[_0x4bcbd1(0x1a0)](_0x1b79f8){const _0x5e6ac4=_0x4bcbd1;this[_0x5e6ac4(0x240)]?.[_0x5e6ac4(0x27e)](_0x1b79f8);}[_0x4bcbd1(0x1d8)](){const _0x4480eb=_0x4bcbd1;if(this['_admissionStarted'])return;this['_admissionStarted']=!![];!this['_h']&&(this['_h']=_0x149e5e({'resolution':0xa}),this['_h'][_0x4480eb(0x1b6)]());const _0x2302d2=_0xe778a;this['_admissionTimer']=setInterval(()=>{const _0x23031e=_0x4480eb,_0x54c704=this['_h'];if(!_0x54c704)return;const _0x4171b7=_0x54c704[_0x23031e(0x2a6)](0x63)/0xf4240,_0x3eb897=_0x54c704[_0x23031e(0x270)]/0xf4240,_0x3f34f0=_0x54c704[_0x23031e(0x191)]/0xf4240;_0x54c704[_0x23031e(0x1b1)]();if(this[_0x23031e(0x240)])for(const _0xaf5786 of this['_windowCbs']){try{_0xaf5786({'p99Ms':_0x4171b7,'maxMs':_0x3eb897,'meanMs':_0x3f34f0,'reportMs':_0x2302d2});}catch{}}},_0x2302d2);if(this['_admissionTimer'][_0x4480eb(0x2b6)])this['_admissionTimer'][_0x4480eb(0x2b6)]();}['_report'](){const _0x6685c9=_0x4bcbd1,_0x2c29d9=this['_h'],_0x39a60f=_0x2c29d9[_0x6685c9(0x270)]/0xf4240,_0x4d5bc2=_0x2c29d9[_0x6685c9(0x2a6)](0x63)/0xf4240,_0x2feb16=_0x2c29d9[_0x6685c9(0x191)]/0xf4240;_0x2c29d9[_0x6685c9(0x1b1)]();const _0xd759ef=[...this[_0x6685c9(0x244)][_0x6685c9(0x1aa)]()]['map'](([_0x235a2d,_0x4ad099])=>({'label':_0x235a2d,..._0x4ad099}))[_0x6685c9(0x1fa)]((_0x545d3d,_0x5de3ee)=>_0x5de3ee['ms']-_0x545d3d['ms'])[_0x6685c9(0x25d)](0x0,0x8);this[_0x6685c9(0x244)]['clear']();const _0x37dd3e=_0xd759ef[_0x6685c9(0x269)]((_0x41b9c1,_0x187c51)=>_0x41b9c1+_0x187c51['ms'],0x0),_0x3d0542=_0xd759ef[_0x6685c9(0x1a6)](_0x4bfdbe=>_0x4bfdbe[_0x6685c9(0x192)]+'='+_0x4bfdbe['ms'][_0x6685c9(0x26f)](0x0)+_0x6685c9(0x1c5)+_0x4bfdbe[_0x6685c9(0x2b8)]+(_0x4bfdbe[_0x6685c9(0x1bc)]>0x5?_0x6685c9(0x1af)+_0x4bfdbe[_0x6685c9(0x1bc)][_0x6685c9(0x26f)](0x0)+'ms'+(_0x4bfdbe[_0x6685c9(0x1dc)]?'\x20'+_0x4bfdbe[_0x6685c9(0x1dc)]:'')+')':''));(_0x2ee5db||_0x39a60f>=_0x1093dd)&&this[_0x6685c9(0x29c)](_0x6685c9(0x29a)+_0xe778a+_0x6685c9(0x250)+_0x39a60f['toFixed'](0x0)+_0x6685c9(0x292)+_0x4d5bc2['toFixed'](0x0)+_0x6685c9(0x222)+_0x2feb16[_0x6685c9(0x26f)](0x0)+_0x6685c9(0x1c9)+_0x37dd3e[_0x6685c9(0x26f)](0x0)+'ms'+(_0x3d0542[_0x6685c9(0x23e)]?'\x20│\x20'+_0x3d0542[_0x6685c9(0x271)]('\x20\x20'):''),{'feature':_0x6685c9(0x28f)});if(this[_0x6685c9(0x240)])for(const _0x43af05 of this[_0x6685c9(0x240)]){try{_0x43af05({'p99Ms':_0x4d5bc2,'maxMs':_0x39a60f,'meanMs':_0x2feb16,'reportMs':_0xe778a});}catch{}}}[_0x4bcbd1(0x1d6)](){const _0x2bd108=_0x4bcbd1;if(this[_0x2bd108(0x2a2)])clearInterval(this['_timer']);if(this['_h'])this['_h'][_0x2bd108(0x1e9)]();this['_timer']=null,this['_h']=null,this['_started']=![];}}const _0x4cfd09=new _0x3bf88c();if(_0x4cfd09[_0x4bcbd1(0x1c4)])_0x4cfd09[_0x4bcbd1(0x26a)]();return okdbLoopMonitor={'LOOP':_0x4cfd09},okdbLoopMonitor;}function _0x33bb(){const _0x2fc3d8=['loop-lag\x20','resolve','_log','queue\x20definition\x20SKIPPED:\x20','recycle','~views','detachConsole','env-removed\x20evict\x20FAILED\x20for\x20','_timer','_tiers','error','string','percentile','modulePath','main','_dropTier','close','rootPath','sandbox-','freeze','611ziiULa','random','exit','system:stopped','stopped','env','requestedAt','size','unref','add','count','ms\x20(+','stringify','3395zwTdIP','terminate','bus:drain','resetting','ref:violation','attach','logs','sandbox\x20host\x20stopped','_rootDb','item:update','1025112yzfIru','onEmit','putSync','ttl:clear','_lockHandle','system','mean','label','pending','env:opened','registerType','reject','creating','remove','_runBootstrapScanPhases','version','_terminateTier','type:registered','includes','transactionSync','win32','offWindow','license:invalid','log','dropSchema','object','envName','map','removeSync','view','node:perf_hooks','entries','getRange','FUNCTION_OOM','entry','user','(worst\x20','unhandledRejection','reset','cursorKey','fts:drop','state','dropFts','enable','inflight','hasOwnProperty','txn:rollback','txn:end','resetIndex','maxMs','stderr','set','tick','unique:violation','resume','_stopped','claimRoutedBootstrap','enabled','ms/','ready','run','ms\x20grace)\x20—\x20sandbox\x20terminated','ms\x20busy=','3880732ONaDoW','claimedBy','detail','license:added','_maybeIdle','3IGrUTF','queue.process\x20threw:\x20','schema:drop','_started','control','has','queue','stop','setTtl','_startAdmission','system:ready','clear','env-removed\x20hint:\x20force-evicting\x20','maxExtra','halted','clearTtl','setSchema','cancelled','11xfMfbZ','registerIndex','index:reset','ref:violation_resolved','license:removed','_drainHandler','core','send','disable','system:poke','system:clock_change','stdout','type','options','450BxWjdS','_closeSharedEnvs','cpuUsage','exports','FUNCTION_CANCELLED','postMessage','default','fts:registered','stats','8632qKpsCe','open','sort','started','cancel','timeoutMs','onWindow','worker\x20OKDB\x20open\x20failed:\x20','note','starting','external','rss','SYSTEM_PROC','_tierFor','defaultMemoryMb','env:removed','then','heapTotal','pid','Spawned\x20queue\x20worker\x20export\x20not\x20found\x20or\x20not\x20a\x20function:\x20','openEnv','sync:apply','requestId','runId','worker:\x20no\x20init\x20message\x20received','30HVOOmD','warn','maxConcurrency','ppid','key','license:activated','queue-worker','MB\x20heap\x20cap)','handler\x20module\x20failed\x20to\x20load:\x20','processor','Could\x20not\x20dynamically\x20require\x20\x22','index:registered','SYSTEM_DRAIN','platform','view:progress','function\x20exceeded\x20','openDB','ms\x20mean=','3625788cCJKqe','fts:reset','inFlightCount','viewName','rejectReady','claimAndRunWorkerBootstrap','graceMs','views','okdb.js','events','startsWith','stopping','function\x20sandbox\x20out\x20of\x20memory\x20(tier\x20','isHeld','write','item:remove','function','_envs','sandbox\x20terminated\x20for\x20a\x20sibling\x20job\x20—\x20retryable','result','idleTimer','fn-sandbox:','__esModule','~proc:bootstrap-index','get','round','watchdog','length','worker','_windowCbs','blocks','passive','memoryUsage','_buckets','env\x20has\x20no\x20queue\x20feature\x20attached','_onMessage','now','\x20evicted','values','588judiWh','bootstrap','tierList','bus:poke','164862tgVJNt','Spawned\x20queue\x20worker\x20module\x20must\x20export\x20a\x20function\x20or\x20default\x20function','ms\x20max=','disconnect','catch','FUNCTION_SANDBOX_EXIT','2JAGoED','scope','unique:violation_resolved','function\x20cancelled\x20—\x20did\x20not\x20unwind\x20within\x20grace;\x20sandbox\x20terminated','_failTier','ERR_WORKER_OUT_OF_MEMORY','FUNCTION_FAILED','~fn:requests','system:type_drop','slice','code','_bareOpen','stopAll','off','lastError','\x20(resident=','env-removed','fts','system:proc','clearThreadStats','onThreadStats','reduce','start','unhandledRejection:\x20','active','944038BpOhtZ','reportThreadStats','toFixed','max','join','item:create','setLogger','put','dropping','schema:set','keys','SYSTEM_POKE','processes','finally','listDesired','worker_threads','index:ready','delete','cost','idleMs','fatal','init','message','push','wedged','_viewState','system:drain','exportName','dropType','SandboxHost:\x20rootPath\x20required','name','running','_ensureTier','process','loop-lag','ttl:expired','inFlight','ms\x20p99=','queueType','heapUsed','_processorStops','split','index:progress','level','heavy'];_0x33bb=function(){return _0x2fc3d8;};return _0x33bb();}var okdbIntakeGate,hasRequiredOkdbIntakeGate;function requireOkdbIntakeGate(){if(hasRequiredOkdbIntakeGate)return okdbIntakeGate;hasRequiredOkdbIntakeGate=0x1;const _0x3337fe=0x2,_0x1eea73=0x2,_0x415017=0x2;function _0x59293d({gateMs:_0x281b90}){let _0x24ae0e=0x0,_0x8431b=0x0,_0x1873e5=0x0;return{'level':()=>_0x24ae0e,'blocks'(_0x50c3ce){const _0x4fd271=_0x3fcd;if(_0x50c3ce==='control')return![];if(_0x24ae0e>=0x2)return!![];if(_0x24ae0e>=0x1&&_0x50c3ce===_0x4fd271(0x299))return!![];return![];},'onWindow'(_0x10fa56){if(_0x10fa56>_0x281b90){_0x8431b++,_0x1873e5=0x0;if(_0x8431b>=_0x3337fe&&_0x24ae0e<_0x415017)return _0x24ae0e++,_0x8431b=0x0,{'changed':!![],'level':_0x24ae0e};}else{if(_0x10fa56<_0x281b90/0x2){_0x1873e5++,_0x8431b=0x0;if(_0x1873e5>=_0x1eea73&&_0x24ae0e>0x0)return _0x24ae0e--,_0x1873e5=0x0,{'changed':!![],'level':_0x24ae0e};}else _0x8431b=0x0,_0x1873e5=0x0;}return{'changed':![],'level':_0x24ae0e};}};}return okdbIntakeGate={'createIntakeGate':_0x59293d},okdbIntakeGate;}var okdbQueueLoadHandler,hasRequiredOkdbQueueLoadHandler;function requireOkdbQueueLoadHandler(){if(hasRequiredOkdbQueueLoadHandler)return okdbQueueLoadHandler;hasRequiredOkdbQueueLoadHandler=0x1;function _0x9b1cd9(_0x219665,_0x30ab2f){const _0x9372a9=_0x3fcd,_0x1f8644=commonjsRequire(_0x219665);if(_0x30ab2f&&_0x30ab2f!==_0x9372a9(0x1f5)){const _0xc9346=_0x1f8644?.[_0x30ab2f];if(typeof _0xc9346!=='function')throw new Error(_0x9372a9(0x20b)+_0x30ab2f);return _0xc9346;}if(typeof _0x1f8644===_0x9372a9(0x233))return _0x1f8644;if(typeof _0x1f8644?.[_0x9372a9(0x1f5)]===_0x9372a9(0x233))return _0x1f8644[_0x9372a9(0x1f5)];throw new Error(_0x9372a9(0x24f));}return okdbQueueLoadHandler={'loadHandler':_0x9b1cd9},okdbQueueLoadHandler;}var okdbFunctionsSandboxHost,hasRequiredOkdbFunctionsSandboxHost;function requireOkdbFunctionsSandboxHost(){const _0x2f3b32=_0x275d88;if(hasRequiredOkdbFunctionsSandboxHost)return okdbFunctionsSandboxHost;hasRequiredOkdbFunctionsSandboxHost=0x1;const _0x549994=require$$0$1,{Worker:_0x5aa049}=require$$1,_0x55000f=_0x549994[_0x2f3b32(0x271)](__dirname,'okdb-functions-sandbox-worker.js'),_0x374141=0x100,_0x54e465=0x3e8;function _0x14900d(_0x3c8ffe,_0x425476){const _0x3a5b30=_0x2f3b32,_0x7be452=new Error(_0x3c8ffe);return _0x7be452[_0x3a5b30(0x25e)]=_0x425476,_0x7be452;}class _0x34bbf2{constructor({rootPath:_0x426c15,memoryMb:_0x13c2f1,maxConcurrency:_0x1e7a57,idleMs:_0x45e585,graceMs:_0xc73f9b,onThreadStats:_0xf245ea,log:_0x2998c8}={}){const _0x130c48=_0x2f3b32;if(!_0x426c15)throw new Error(_0x130c48(0x28a));this[_0x130c48(0x2ab)]=_0x426c15,this[_0x130c48(0x206)]=Math[_0x130c48(0x270)](0x20,Math['floor'](_0x13c2f1??_0x374141)),this[_0x130c48(0x213)]=Math[_0x130c48(0x270)](0x1,Number(process.env.OKDB_FN_SANDBOX_CONCURRENCY)||_0x1e7a57||0x4),this['idleMs']=Math['max'](0x3e8,Number(process.env.OKDB_FN_SANDBOX_IDLE_MS)||_0x45e585||0x7530),this['graceMs']=Math['max'](0x64,Number(process.env.OKDB_FN_SANDBOX_GRACE_MS)||_0xc73f9b||0x5dc),this[_0x130c48(0x268)]=_0xf245ea??null,this[_0x130c48(0x1a2)]=_0x2998c8??null,this[_0x130c48(0x2a3)]=new Map(),this[_0x130c48(0x1c2)]=![];}[_0x2f3b32(0x225)](){const _0x200d0a=_0x2f3b32;let _0x4dc506=0x0;for(const _0x279ff0 of this[_0x200d0a(0x2a3)]['values']())_0x4dc506+=_0x279ff0[_0x200d0a(0x1b7)][_0x200d0a(0x2b5)];return _0x4dc506;}['_tierFor'](){const _0x4fa5c7=_0x2f3b32;return this[_0x4fa5c7(0x206)];}[_0x2f3b32(0x28d)](_0xdc0173){const _0x511c8d=_0x2f3b32;let _0x41c4f9=this[_0x511c8d(0x2a3)][_0x511c8d(0x23b)](_0xdc0173);if(_0x41c4f9)return _0x41c4f9;const _0xe18d5b=new _0x5aa049(_0x55000f,{'workerData':{'rootPath':this[_0x511c8d(0x2ab)]},'stdout':!![],'stderr':!![]});_0xe18d5b[_0x511c8d(0x1ec)]?.[_0x511c8d(0x1c1)](),_0xe18d5b['stderr']?.[_0x511c8d(0x1c1)](),_0xe18d5b[_0x511c8d(0x2b6)]?.();let _0x66cba4;const _0x46a4f1=new Promise((_0x5522aa,_0x4c8aae)=>{const _0xe64233=_0x511c8d,_0x1063e2=(_0x596b15,_0x424ded)=>{const _0x57e77b=_0x3fcd;_0x41c4f9['readySettled']=!![],_0xe18d5b['off'](_0x57e77b(0x283),_0x469b9c),_0x596b15(_0x424ded);},_0x469b9c=_0x18497d=>{const _0x5bdab4=_0x3fcd;if(_0x18497d?.[_0x5bdab4(0x1ed)]===_0x5bdab4(0x1c6))_0x1063e2(_0x5522aa);else{if(_0x18497d?.[_0x5bdab4(0x1ed)]===_0x5bdab4(0x281))_0x1063e2(_0x4c8aae,_0x14900d(_0x18497d[_0x5bdab4(0x2a4)]?.[_0x5bdab4(0x283)]??'sandbox\x20failed\x20to\x20boot',_0x5bdab4(0x253)));}};_0x66cba4=_0x3ed5ad=>_0x1063e2(_0x4c8aae,_0x3ed5ad),_0xe18d5b['on'](_0xe64233(0x283),_0x469b9c);});return _0x41c4f9={'worker':_0xe18d5b,'inflight':new Map(),'idleTimer':null,'readySettled':![],'rejectReady':_0x66cba4,'ready':_0x46a4f1},_0x41c4f9[_0x511c8d(0x1c6)][_0x511c8d(0x252)](()=>{}),this[_0x511c8d(0x2a3)][_0x511c8d(0x1be)](_0xdc0173,_0x41c4f9),_0xe18d5b['on'](_0x511c8d(0x283),_0x4889f2=>this[_0x511c8d(0x246)](_0xdc0173,_0x41c4f9,_0x4889f2)),_0xe18d5b['on']('error',_0x38eb05=>{const _0x381e9b=_0x511c8d,_0x410771=_0x38eb05?.[_0x381e9b(0x25e)]===_0x381e9b(0x259);this[_0x381e9b(0x258)](_0xdc0173,_0x41c4f9,_0x410771?_0x14900d(_0x381e9b(0x22f)+_0xdc0173+_0x381e9b(0x218),_0x381e9b(0x1ac)):_0x14900d('function\x20sandbox\x20error:\x20'+(_0x38eb05?.[_0x381e9b(0x283)]??_0x38eb05),_0x381e9b(0x253)));}),_0xe18d5b['on'](_0x511c8d(0x2b0),_0x4d974b=>{const _0x4d6fe9=_0x511c8d;this[_0x4d6fe9(0x258)](_0xdc0173,_0x41c4f9,_0x14900d('function\x20sandbox\x20exited\x20(code\x20'+_0x4d974b+')',_0x4d6fe9(0x253)));}),_0x41c4f9;}[_0x2f3b32(0x246)](_0x163362,_0x48d7bf,_0x5c42cb){const _0x9e561b=_0x2f3b32;if(!_0x5c42cb||typeof _0x5c42cb!==_0x9e561b(0x1a4))return;if(_0x5c42cb[_0x9e561b(0x1ed)]==='stats'){this[_0x9e561b(0x268)]?.(_0x9e561b(0x238)+_0x163362,{'heapUsed':_0x5c42cb[_0x9e561b(0x294)]??0x0});return;}const _0x5dfcd6=_0x5c42cb[_0x9e561b(0x20e)]!=null?_0x48d7bf[_0x9e561b(0x1b7)][_0x9e561b(0x23b)](_0x5c42cb[_0x9e561b(0x20e)]):null;if(!_0x5dfcd6)return;if(_0x5c42cb[_0x9e561b(0x1ed)]===_0x9e561b(0x1a2)){_0x5dfcd6[_0x9e561b(0x2c1)][_0x9e561b(0x284)](_0x5c42cb[_0x9e561b(0x1ad)]);return;}if(_0x5c42cb[_0x9e561b(0x1ed)]===_0x9e561b(0x236)||_0x5c42cb[_0x9e561b(0x1ed)]===_0x9e561b(0x2a4))_0x48d7bf[_0x9e561b(0x1b7)][_0x9e561b(0x27e)](_0x5c42cb['requestId']),clearTimeout(_0x5dfcd6[_0x9e561b(0x23d)]),_0x5dfcd6[_0x9e561b(0x29b)]({'message':_0x5c42cb,'logs':_0x5dfcd6[_0x9e561b(0x2c1)]}),this[_0x9e561b(0x1ce)](_0x163362,_0x48d7bf);else _0x5dfcd6['onEmit']&&_0x5dfcd6[_0x9e561b(0x18c)](_0x5c42cb);}async[_0x2f3b32(0x1c7)](_0x60b654,{onEmit:_0x116a66}={}){const _0x43fb1a=_0x2f3b32;if(this[_0x43fb1a(0x1c2)])throw _0x14900d(_0x43fb1a(0x2c2),'FUNCTION_SANDBOX_EXIT');const _0x234855=this[_0x43fb1a(0x205)](_0x60b654),_0x5f479c=this[_0x43fb1a(0x28d)](_0x234855);return _0x5f479c['idleTimer']&&(clearTimeout(_0x5f479c[_0x43fb1a(0x237)]),_0x5f479c[_0x43fb1a(0x237)]=null),await _0x5f479c[_0x43fb1a(0x1c6)],new Promise((_0x4e25ad,_0x5c2df7)=>{const _0x2dfc8f=_0x43fb1a,_0x2de8ce=Math[_0x2dfc8f(0x270)](0x1,_0x60b654['runtime']?.[_0x2dfc8f(0x1fd)]??_0x54e465),_0x453308={'resolve':_0x4e25ad,'reject':_0x5c2df7,'logs':[],'onEmit':_0x116a66??null,'cancelled':![],'watchdog':setTimeout(()=>{const _0x4d2376=_0x2dfc8f;this[_0x4d2376(0x19b)](_0x234855,_0x5f479c,_0x60b654['requestId'],_0x14900d(_0x4d2376(0x220)+_0x2de8ce+_0x4d2376(0x2b9)+this[_0x4d2376(0x229)]+_0x4d2376(0x1c8),_0x453308[_0x4d2376(0x1e0)]?'FUNCTION_CANCELLED':'FUNCTION_TIMEOUT'));},_0x2de8ce+this[_0x2dfc8f(0x229)])};if(_0x453308[_0x2dfc8f(0x23d)][_0x2dfc8f(0x2b6)])_0x453308['watchdog'][_0x2dfc8f(0x2b6)]();_0x5f479c['inflight'][_0x2dfc8f(0x1be)](_0x60b654[_0x2dfc8f(0x20e)],_0x453308),_0x5f479c['worker'][_0x2dfc8f(0x1f4)]({'type':_0x2dfc8f(0x1c7),'job':_0x60b654});});}[_0x2f3b32(0x1fc)](_0x4052b5){const _0x405b83=_0x2f3b32;for(const [_0xe69efe,_0x25cfe9]of this['_tiers']){const _0x4c5de2=_0x25cfe9[_0x405b83(0x1b7)][_0x405b83(0x23b)](_0x4052b5);if(!_0x4c5de2)continue;if(_0x4c5de2[_0x405b83(0x1e0)])return!![];_0x4c5de2['cancelled']=!![],_0x25cfe9[_0x405b83(0x23f)][_0x405b83(0x1f4)]({'type':'cancel','requestId':_0x4052b5}),clearTimeout(_0x4c5de2[_0x405b83(0x23d)]),_0x4c5de2[_0x405b83(0x23d)]=setTimeout(()=>{const _0x2f6fe8=_0x405b83;this[_0x2f6fe8(0x19b)](_0xe69efe,_0x25cfe9,_0x4052b5,_0x14900d(_0x2f6fe8(0x257),_0x2f6fe8(0x1f3)));},this[_0x405b83(0x229)]);if(_0x4c5de2['watchdog'][_0x405b83(0x2b6)])_0x4c5de2[_0x405b83(0x23d)][_0x405b83(0x2b6)]();return!![];}return![];}[_0x2f3b32(0x19b)](_0xe85e34,_0x49852e,_0x54bb10,_0x8ca10b){const _0x56be72=_0x2f3b32;for(const [_0x830f91,_0x44e8dd]of _0x49852e['inflight']){clearTimeout(_0x44e8dd['watchdog']),_0x44e8dd[_0x56be72(0x196)](_0x830f91===_0x54bb10?_0x8ca10b:_0x14900d(_0x56be72(0x235),_0x56be72(0x253)));}_0x49852e[_0x56be72(0x1b7)][_0x56be72(0x1da)](),this[_0x56be72(0x2a9)](_0xe85e34,_0x49852e);}[_0x2f3b32(0x258)](_0x20a137,_0x1062ef,_0x1e362e){const _0x5ac98f=_0x2f3b32;if(this['_tiers'][_0x5ac98f(0x23b)](_0x20a137)!==_0x1062ef)return;if(!_0x1062ef['readySettled'])_0x1062ef[_0x5ac98f(0x227)]?.(_0x1e362e);for(const [,_0x4fd045]of _0x1062ef[_0x5ac98f(0x1b7)]){clearTimeout(_0x4fd045[_0x5ac98f(0x23d)]),_0x4fd045[_0x5ac98f(0x196)](_0x1e362e);}_0x1062ef[_0x5ac98f(0x1b7)][_0x5ac98f(0x1da)](),this['_dropTier'](_0x20a137,_0x1062ef);}['_dropTier'](_0x41d4ab,_0xd491fa){const _0x28ce67=_0x2f3b32;if(this[_0x28ce67(0x2a3)]['get'](_0x41d4ab)===_0xd491fa)this['_tiers']['delete'](_0x41d4ab);if(_0xd491fa[_0x28ce67(0x237)])clearTimeout(_0xd491fa['idleTimer']);this[_0x28ce67(0x268)]?.('fn-sandbox:'+_0x41d4ab,null),_0xd491fa['worker'][_0x28ce67(0x2bc)]()[_0x28ce67(0x252)](()=>{});}[_0x2f3b32(0x1ce)](_0x593ef4,_0x16ca37){const _0x5a1d92=_0x2f3b32;if(_0x16ca37[_0x5a1d92(0x1b7)][_0x5a1d92(0x2b5)]>0x0||_0x16ca37[_0x5a1d92(0x237)])return;_0x16ca37['idleTimer']=setTimeout(()=>this[_0x5a1d92(0x2a9)](_0x593ef4,_0x16ca37),this[_0x5a1d92(0x280)]);if(_0x16ca37[_0x5a1d92(0x237)][_0x5a1d92(0x2b6)])_0x16ca37[_0x5a1d92(0x237)]['unref']();}[_0x2f3b32(0x29e)](){const _0x4bb180=_0x2f3b32;for(const [_0x26ede3,_0x453947]of[...this[_0x4bb180(0x2a3)]]){this[_0x4bb180(0x258)](_0x26ede3,_0x453947,_0x14900d('sandbox\x20recycled',_0x4bb180(0x253)));}}async[_0x2f3b32(0x1d6)](){const _0x5efd41=_0x2f3b32;this[_0x5efd41(0x1c2)]=!![],this[_0x5efd41(0x29e)]();}}return okdbFunctionsSandboxHost={'SandboxHost':_0x34bbf2,'SANDBOX_ENTRY':_0x55000f},okdbFunctionsSandboxHost;}var hasRequiredOkdbWorkerChild;function requireOkdbWorkerChild(){const _0x328e3b=_0x275d88;if(hasRequiredOkdbWorkerChild)return okdbWorkerChild$1;hasRequiredOkdbWorkerChild=0x1;const _0x16a176=require$$0$1;function _0x34a535(_0x34a0eb){const _0x23554d=_0x3fcd;try{if(typeof process[_0x23554d(0x1e8)]===_0x23554d(0x233))process[_0x23554d(0x1e8)](_0x34a0eb);}catch{}}let _0x3e9c98=![],_0x1f69bb=null;async function _0x1bd3b1(_0x288f2c,_0x4ae721){const _0x316c79=_0x3fcd;if(_0x3e9c98)return;_0x3e9c98=!![];try{await _0x1f69bb?.['stop']?.();}catch{}const _0x15853a=setTimeout(()=>process[_0x316c79(0x2b0)](_0x288f2c),0xbb8);if(typeof _0x15853a['unref']===_0x316c79(0x233))_0x15853a['unref']();try{await _0x4ae721?.[_0x316c79(0x2aa)]?.();}catch{}process['exit'](_0x288f2c);}function _0x453185(_0x425760,_0x43723c,_0x22f8b8=null){const _0x247b67=_0x3fcd,_0x361de3=require$$1$1;let _0x3d3007=process[_0x247b67(0x1f1)](),_0x3c97be=Date[_0x247b67(0x247)]();const _0x4f60ba=()=>{const _0x45fd38=_0x247b67;try{const _0x259c19=[];for(const [_0x3ce171,_0x49de41]of _0x43723c[_0x45fd38(0x234)]){if(_0x3ce171[_0x45fd38(0x22d)]('~'))continue;for(const _0x52a1fd of _0x49de41[_0x45fd38(0x21a)][_0x45fd38(0x24c)]())_0x259c19[_0x45fd38(0x284)]({..._0x52a1fd,'env':_0x3ce171});}return _0x259c19['length']>0x0?{'processors':_0x259c19}:null;}catch{return null;}},_0x4f43da=()=>{const _0xde47=_0x247b67;if(_0x3e9c98)return;const _0x128f15=Date[_0xde47(0x247)](),_0x51cb2d=process[_0xde47(0x1f1)](),_0x1c148f=(_0x128f15-_0x3c97be)*0x3e8,_0x23d73c=_0x51cb2d[_0xde47(0x1ae)]-_0x3d3007[_0xde47(0x1ae)]+(_0x51cb2d[_0xde47(0x190)]-_0x3d3007[_0xde47(0x190)]),_0x5035c3=_0x1c148f>0x0?Math['min'](0x64,Math[_0xde47(0x23c)](_0x23d73c/(_0x1c148f*(_0x361de3['cpus']()[_0xde47(0x23e)]||0x1))*0x64)):0x0;_0x3d3007=_0x51cb2d,_0x3c97be=_0x128f15;const _0x4d7b35=process[_0xde47(0x243)]();_0x425760({'type':_0xde47(0x1f7),'stats':{'rss':_0x4d7b35[_0xde47(0x203)],'heapUsed':_0x4d7b35[_0xde47(0x294)],'heapTotal':_0x4d7b35[_0xde47(0x209)],'external':_0x4d7b35[_0xde47(0x202)],'cpuPct':_0x5035c3,'cpuWindowMs':Math[_0xde47(0x23c)](_0x1c148f/0x3e8)||null,..._0x22f8b8?.()??{}},'processing':_0x4f60ba()});},_0x509020=Math['max'](0x3e8,Number(process.env.OKDB_STATS_INTERVAL_MS)||0x1388),_0x277efe=setInterval(_0x4f43da,_0x509020);if(typeof _0x277efe[_0x247b67(0x2b6)]===_0x247b67(0x233))_0x277efe[_0x247b67(0x2b6)]();}process['on'](_0x328e3b(0x1b0),_0x3a0915=>{const _0x258ca0=_0x328e3b;_0x34a535({'type':_0x258ca0(0x212),'msg':_0x258ca0(0x26b)+(_0x3a0915?.[_0x258ca0(0x283)]??_0x3a0915)});});async function _0x13d282(){const _0x55f329=_0x328e3b,_0x2fd1d5=await new Promise((_0x3644b0,_0xbdb00a)=>{const _0x500fcf=_0x3fcd,_0x2b3ddb=_0xf98c32=>{const _0x5ef6c6=_0x3fcd;_0xf98c32?.[_0x5ef6c6(0x1ed)]===_0x5ef6c6(0x282)&&(process[_0x5ef6c6(0x261)](_0x5ef6c6(0x283),_0x2b3ddb),_0x3644b0(_0xf98c32));};process['on'](_0x500fcf(0x283),_0x2b3ddb);const _0x1459c1=setTimeout(()=>{const _0x1705ea=_0x500fcf;process[_0x1705ea(0x261)](_0x1705ea(0x283),_0x2b3ddb),_0xbdb00a(new Error(_0x1705ea(0x210)));},0x2710);if(typeof _0x1459c1['unref']===_0x500fcf(0x233))_0x1459c1[_0x500fcf(0x2b6)]();}),{rootPath:_0xa5a48f,slot:_0x2d9485,supervisorKey:_0x5f96e2}=_0x2fd1d5,_0x5ecd13=commonjsRequire(_0x16a176[_0x55f329(0x271)](__dirname,'..',_0x55f329(0x22b))),{EVENTS:_0x2e5d86}=requireOkdbEnums(),_0x167555=new _0x5ecd13(_0xa5a48f,{'engines':![],'http':![],'asyncProcessors':!![],'compaction':_0x55f329(0x242),'envs':_0x55f329(0x1e7),'auth':{'open':!![]},'processing':_0x55f329(0x2a8)});{const _0x5abf06={'debug':0x0,'info':0x1,'warn':0x2,'error':0x3},_0x160a78=_0x5abf06[process.env.OKDB_WORKERS_LOG_LEVEL]??_0x5abf06[_0x55f329(0x212)];_0x167555[_0x55f329(0x1a2)][_0x55f329(0x2a0)]?.(),_0x167555['log'][_0x55f329(0x2c0)](_0x24a3a1=>{const _0x522a5e=_0x55f329;if((_0x5abf06[_0x24a3a1[_0x522a5e(0x298)]]??0x1)<_0x160a78)return;_0x34a535({'type':_0x522a5e(0x1a2),'entry':_0x24a3a1});});}try{await _0x167555[_0x55f329(0x1f9)]();}catch(_0x183785){_0x34a535({'type':_0x55f329(0x2a4),'error':_0x55f329(0x1ff)+_0x183785['message']}),process[_0x55f329(0x2b0)](0x1);return;}const _0x3a529e=Math[_0x55f329(0x270)](0x4,Number(process.env.OKDB_WORKERS_ENV_CACHE)||0x40),_0x5787bb=new Map(),_0x403685=new Set();function _0x2570e2(_0x3260bb){const _0x31f7b3=_0x55f329;try{for(const _0xe89462 of _0x3260bb[_0x31f7b3(0x21a)]?.['_registrations']?.[_0x31f7b3(0x249)]()??[]){if(_0xe89462[_0x31f7b3(0x18f)]?.[_0x31f7b3(0x230)]?.())return!![];}}catch{}return![];}function _0x197315(_0x12f9cb,_0x414506){const _0x2124bb=_0x55f329;if(_0x403685[_0x2124bb(0x1d4)](_0x12f9cb))return!![];if(_0x2570e2(_0x414506))return!![];for(const [,_0x45d4c7]of _0x411e51){if(_0x45d4c7?.[_0x2124bb(0x1a5)]===_0x12f9cb)return!![];}return![];}async function _0x302423(_0x4784b1,_0x5c2965){const _0xe49c65=_0x55f329;for(const _0x3120b9 of[..._0x167555['fts'][_0xe49c65(0x295)]?.[_0xe49c65(0x277)]?.()??[]]){if(!_0x3120b9[_0xe49c65(0x22d)](_0x4784b1+':'))continue;const _0x27c9d2=_0x167555[_0xe49c65(0x265)][_0xe49c65(0x295)][_0xe49c65(0x23b)](_0x3120b9);_0x167555[_0xe49c65(0x265)][_0xe49c65(0x295)][_0xe49c65(0x27e)](_0x3120b9);try{await _0x27c9d2?.();}catch{}}try{await _0x5c2965[_0xe49c65(0x21a)]?.[_0xe49c65(0x260)]?.();}catch{}}async function _0x11b83b(_0x450b99){const _0x26fdb8=_0x55f329,_0x3584f8=_0x5787bb['get'](_0x450b99);if(!_0x3584f8)return;_0x5787bb['delete'](_0x450b99),await _0x302423(_0x450b99,_0x3584f8);try{await _0x3584f8['timeMachine']?.[_0x26fdb8(0x1d6)]?.();}catch{}try{await _0x167555['fts'][_0x26fdb8(0x1f0)]?.(_0x450b99);}catch{}_0x167555[_0x26fdb8(0x234)][_0x26fdb8(0x27e)](_0x450b99);try{await _0x3584f8[_0x26fdb8(0x2aa)]();}catch{}}async function _0x3c9051(_0x202526){const _0x5aad65=_0x55f329;if(_0x5787bb[_0x5aad65(0x1d4)](_0x202526)){const _0xd2ed13=_0x5787bb[_0x5aad65(0x23b)](_0x202526);return _0x5787bb['delete'](_0x202526),_0x5787bb[_0x5aad65(0x1be)](_0x202526,_0xd2ed13),_0xd2ed13;}const _0x10b868=_0x167555[_0x5aad65(0x234)][_0x5aad65(0x23b)](_0x202526);if(_0x10b868&&!_0x10b868[_0x5aad65(0x25f)])return _0x10b868;if(_0x5787bb['size']>=_0x3a529e)for(const [_0x53f91d,_0x5e73d7]of _0x5787bb){if(!_0x197315(_0x53f91d,_0x5e73d7)){await _0x11b83b(_0x53f91d);break;}}const _0x4e88bd=await _0x167555[_0x5aad65(0x20c)](_0x202526);return _0x5787bb['set'](_0x202526,_0x4e88bd),_0x4e88bd;}_0x167555['events']['on'](_0x2e5d86[_0x55f329(0x21d)],()=>{const _0x4aadc3=_0x55f329;(async()=>{for(const [_0x30bfd3,_0x35d438]of[..._0x5787bb]){if(!_0x197315(_0x30bfd3,_0x35d438))await _0x11b83b(_0x30bfd3);}})()[_0x4aadc3(0x252)](()=>{});});const _0xc54753=setInterval(()=>{const _0x29e4e2=_0x55f329;if(_0x3e9c98)return;for(const [,_0x520fb6]of _0x167555['_envs']){try{_0x520fb6[_0x29e4e2(0x1e6)]?.();}catch{}}},0xc8);if(typeof _0xc54753['unref']===_0x55f329(0x233))_0xc54753['unref']();process['on'](_0x55f329(0x251),()=>_0x1bd3b1(0x0,_0x167555));if(process[_0x55f329(0x21e)]!==_0x55f329(0x19f)){const _0x40e029=setInterval(()=>{const _0xf10a34=_0x55f329;if(process[_0xf10a34(0x214)]===0x1)_0x1bd3b1(0x0,_0x167555);},0x7d0);if(typeof _0x40e029['unref']===_0x55f329(0x233))_0x40e029[_0x55f329(0x2b6)]();}process['on']('message',_0x18a5c6=>{const _0xc4b97b=_0x55f329;if(_0x18a5c6?.['type']===_0xc4b97b(0x1d6))_0x1bd3b1(0x0,_0x167555);});const {LOOP:_0x39b1b8}=requireOkdbLoopMonitor(),{createIntakeGate:_0x4422a4}=requireOkdbIntakeGate(),_0x224253=Number(process.env.OKDB_WORKERS_MAX_LEASES)||0x20,_0xdd52e9=Number(process.env.OKDB_WORKERS_LAG_GATE_MS)||0xc8,_0x4b384e=Number(process.env.OKDB_WORKERS_WEDGE_MS)||0x7530,_0x1c225e=_0x4422a4({'gateMs':_0xdd52e9});_0x39b1b8[_0x55f329(0x1fe)](({p99Ms:_0x5c7406,maxMs:_0x592db2})=>{const _0x330d83=_0x55f329;_0x592db2>_0x4b384e&&_0x34a535({'type':_0x330d83(0x285),'maxMs':_0x592db2});const {changed:_0x31110d,level:_0x4d4d4f}=_0x1c225e[_0x330d83(0x1fe)](_0x5c7406);if(_0x31110d)_0x34a535({'type':'intake','level':_0x4d4d4f,'p99Ms':_0x5c7406});});const {loadHandler:_0x10d862}=requireOkdbQueueLoadHandler(),_0x411e51=new Map();let _0x3898c9=![],_0x12e641={'defsSeen':-0x1,'lastError':null,'at':0x0};const _0x33cd9f=new Set(),_0x2ab6df=(_0x4abdca,_0x94832e)=>{const _0x226d08=_0x55f329,_0x585676=_0x4abdca+'::'+_0x94832e;if(_0x33cd9f[_0x226d08(0x1d4)](_0x585676))return;_0x33cd9f[_0x226d08(0x2b7)](_0x585676),_0x34a535({'type':'warn','msg':_0x226d08(0x29d)+_0x4abdca+'\x20—\x20'+_0x94832e});},_0x29990d={'name':'queue','cost':_0x55f329(0x1d3),'inFlight':()=>_0x411e51['size'],'detail':()=>({'consumers':[..._0x411e51['keys']()],'tick':_0x12e641}),async 'tick'(){const _0x368aee=_0x55f329;if(_0x3898c9||_0x3e9c98)return;_0x3898c9=!![];try{const _0x3eef53=_0x167555[_0x368aee(0x279)][_0x368aee(0x27b)]?.('queue-worker')??[];_0x12e641={'defsSeen':_0x3eef53['length'],'lastError':null,'at':Date[_0x368aee(0x247)]()};const _0x28cf6a=new Set();for(const {key:_0xdc3b05,value:_0x357cff}of _0x3eef53){if(!_0x357cff||_0x357cff[_0x368aee(0x26c)]===![])continue;_0x28cf6a[_0x368aee(0x2b7)](_0xdc3b05);const _0x4edfed=_0x411e51[_0x368aee(0x23b)](_0xdc3b05);if(_0x4edfed){if(_0x4edfed['version']===_0x357cff[_0x368aee(0x19a)])continue;_0x411e51[_0x368aee(0x27e)](_0xdc3b05);try{await _0x4edfed[_0x368aee(0x23f)]?.['stop']?.();}catch{}}const _0x3cc472=_0x357cff[_0x368aee(0x1a5)]??_0xdc3b05['split']('::')[0x0];let _0x47e9f7;try{_0x47e9f7=await _0x3c9051(_0x3cc472);}catch(_0xe13fda){_0x2ab6df(_0xdc3b05,'env\x20open\x20failed:\x20'+_0xe13fda?.[_0x368aee(0x283)]);continue;}if(!_0x47e9f7?.[_0x368aee(0x1d5)]){_0x2ab6df(_0xdc3b05,_0x368aee(0x245));continue;}let _0x4e1d98;try{_0x4e1d98=_0x10d862(_0x357cff[_0x368aee(0x2a7)],_0x357cff[_0x368aee(0x288)]);}catch(_0x5f1b72){_0x2ab6df(_0xdc3b05,_0x368aee(0x219)+_0x5f1b72?.[_0x368aee(0x283)]);continue;}let _0x575df7;try{_0x575df7=_0x47e9f7['queue'][_0x368aee(0x28e)](_0x357cff[_0x368aee(0x293)]??_0xdc3b05[_0x368aee(0x296)]('::')[0x1],_0x4e1d98,_0x357cff[_0x368aee(0x1ee)]??{});}catch(_0x3d9b4f){_0x2ab6df(_0xdc3b05,_0x368aee(0x1d0)+_0x3d9b4f?.[_0x368aee(0x283)]);continue;}_0x411e51['set'](_0xdc3b05,{'worker':_0x575df7,'version':_0x357cff['version'],'envName':_0x3cc472});}for(const [_0x58661f,_0x291bfd]of[..._0x411e51]){if(!_0x28cf6a['has'](_0x58661f)){_0x411e51[_0x368aee(0x27e)](_0x58661f),_0x34a535({'type':_0x368aee(0x212),'msg':'queue\x20consumer\x20stopped\x20(def\x20deregistered):\x20'+_0x58661f});try{await _0x291bfd['worker']?.[_0x368aee(0x1d6)]?.();}catch{}}}}catch(_0x40731b){_0x12e641[_0x368aee(0x262)]=_0x40731b?.[_0x368aee(0x283)]??String(_0x40731b);throw _0x40731b;}finally{_0x3898c9=![];}}};let _0x4afc6e;{const {SandboxHost:_0x41943f}=requireOkdbFunctionsSandboxHost(),_0x554414=_0x167555[_0x55f329(0x189)][_0x55f329(0x221)](_0x55f329(0x25b),{'dupSort':![]}),_0x2e3d7b=_0x167555[_0x55f329(0x189)][_0x55f329(0x221)]('~fn:responses',{'dupSort':![]}),_0x3efdfd=Number(process.env.OKDB_FN_STALE_MS)||0xea60,_0x94eec6=new _0x41943f({'rootPath':_0xa5a48f,'log':_0x167555[_0x55f329(0x1a2)],'onThreadStats':(_0x40010a,_0x1910c4)=>{const _0x116555=_0x55f329;if(_0x1910c4)_0x167555[_0x116555(0x279)]?.[_0x116555(0x26e)]?.(_0x40010a,_0x1910c4);else _0x167555[_0x116555(0x279)]?.[_0x116555(0x267)]?.(_0x40010a);}});_0x1f69bb=_0x94eec6;const _0x48053d=new Set(),_0x30df13=(_0x296918,_0x2a3f12)=>{const _0x8b82c1=_0x55f329,_0x3ba75d=_0x554414[_0x8b82c1(0x23b)](_0x296918);if(!_0x3ba75d||_0x3ba75d[_0x8b82c1(0x1b4)]===_0x8b82c1(0x1e0)){try{_0x554414[_0x8b82c1(0x1a7)](_0x296918);}catch{}return;}_0x2e3d7b[_0x8b82c1(0x18d)](_0x296918,_0x2a3f12);try{_0x554414[_0x8b82c1(0x1a7)](_0x296918);}catch{}},_0xd78ba0=(_0x286b50,_0x3902e7)=>{const _0x2eef95=_0x55f329;_0x48053d[_0x2eef95(0x2b7)](_0x286b50),_0x94eec6[_0x2eef95(0x1c7)]({..._0x3902e7,'requestId':_0x286b50})[_0x2eef95(0x208)](({message:_0x20d744,logs:_0x1b02eb})=>_0x30df13(_0x286b50,{'message':_0x20d744,'logs':_0x1b02eb}))[_0x2eef95(0x252)](_0x1e55c3=>{const _0x1cee6a=_0x2eef95;if(_0x1e55c3?.[_0x1cee6a(0x25e)]===_0x1cee6a(0x253)){try{const _0x112595=_0x554414['get'](_0x286b50);_0x112595&&_0x112595['state']===_0x1cee6a(0x28c)&&_0x112595[_0x1cee6a(0x1cb)]===process[_0x1cee6a(0x20a)]&&_0x554414[_0x1cee6a(0x18d)](_0x286b50,{..._0x112595,'state':_0x1cee6a(0x193),'requestedAt':Date[_0x1cee6a(0x247)]()});}catch{}return;}_0x30df13(_0x286b50,{'message':{'type':'error','requestId':_0x286b50,'runId':_0x3902e7[_0x1cee6a(0x20f)],'error':{'message':_0x1e55c3?.[_0x1cee6a(0x283)]??String(_0x1e55c3),'code':_0x1e55c3?.['code']??_0x1cee6a(0x25a)},'meta':{'runnerId':_0x1cee6a(0x2ac)+process[_0x1cee6a(0x20a)]}},'logs':[]});})[_0x2eef95(0x27a)](()=>_0x48053d['delete'](_0x286b50));};_0x4afc6e={'name':'fn','cost':_0x55f329(0x1d3),'inFlight':()=>_0x94eec6[_0x55f329(0x225)](),async 'tick'(){const _0x1c9875=_0x55f329;if(_0x3e9c98)return;for(const _0x2eec94 of[..._0x48053d]){const _0x18b740=_0x554414[_0x1c9875(0x23b)](_0x2eec94);if(!_0x18b740||_0x18b740[_0x1c9875(0x1b4)]===_0x1c9875(0x1e0))_0x94eec6[_0x1c9875(0x1fc)](_0x2eec94);}for(const {key:_0x430aa6,value:_0x1ec4bc}of _0x554414[_0x1c9875(0x1ab)]({})){if(_0x3e9c98)break;if(_0x94eec6[_0x1c9875(0x225)]()>=_0x94eec6[_0x1c9875(0x213)])break;if(!_0x1ec4bc||_0x1ec4bc['state']!==_0x1c9875(0x193))continue;if(_0x1ec4bc[_0x1c9875(0x2b4)]&&Date['now']()-_0x1ec4bc[_0x1c9875(0x2b4)]>_0x3efdfd){try{_0x554414['transactionSync'](()=>{const _0x488210=_0x1c9875,_0x1b20fe=_0x554414[_0x488210(0x23b)](_0x430aa6);if(_0x1b20fe?.[_0x488210(0x1b4)]==='pending'&&_0x1b20fe[_0x488210(0x2b4)]&&Date[_0x488210(0x247)]()-_0x1b20fe[_0x488210(0x2b4)]>_0x3efdfd)_0x554414[_0x488210(0x198)](_0x430aa6);});}catch{}continue;}let _0xbe859d=![];_0x554414[_0x1c9875(0x19e)](()=>{const _0x2b2b85=_0x1c9875,_0x435736=_0x554414[_0x2b2b85(0x23b)](_0x430aa6);_0x435736?.[_0x2b2b85(0x1b4)]==='pending'&&(_0x554414[_0x2b2b85(0x274)](_0x430aa6,{..._0x435736,'state':_0x2b2b85(0x28c),'claimedBy':process[_0x2b2b85(0x20a)],'claimedAt':Date['now']()}),_0xbe859d=!![]);});if(!_0xbe859d)continue;_0xd78ba0(_0x430aa6,_0x1ec4bc);}}};}let _0x3a39ca=0x0;const _0x73b1eb=_0x167555[_0x55f329(0x189)][_0x55f329(0x221)](_0x55f329(0x23a),{'dupSort':![]}),_0x223a2a={'name':'bootstrap','cost':'heavy','inFlight':()=>_0x3a39ca,async 'tick'(){const _0xfea844=_0x55f329;if(_0x3e9c98||_0x3a39ca>=0x1)return;const _0x585288=[];try{for(const {key:_0x1ab1de,value:_0x22a249}of _0x73b1eb[_0xfea844(0x1ab)]({})){if(typeof _0x1ab1de===_0xfea844(0x2a5)&&_0x22a249?.[_0xfea844(0x2b3)]&&!_0x22a249[_0xfea844(0x2b3)]['startsWith']('~'))_0x585288['push'](_0x22a249);}}catch{}for(const _0x40a84c of _0x585288){if(_0x3e9c98||_0x3a39ca>=0x1)return;let _0x16b9c9;try{_0x16b9c9=await _0x3c9051(_0x40a84c['env']);}catch{continue;}if(_0x40a84c['kind']===_0xfea844(0x1a8)&&_0x40a84c[_0xfea844(0x226)]){const _0x34ce60=_0x16b9c9['get']?.(_0xfea844(0x29f),_0x40a84c[_0xfea844(0x226)]);if(!_0x34ce60)continue;let _0x2bf69b=![];_0x403685['add'](_0x40a84c[_0xfea844(0x2b3)]);const _0x4803de=_0x16b9c9[_0xfea844(0x21a)][_0xfea844(0x1c3)]({'rowKey':'bootstrap:'+_0x40a84c['cursorKey'],'cursorKey':_0x40a84c[_0xfea844(0x1b2)]},async()=>{const _0x4c7126=_0xfea844;!_0x16b9c9[_0x4c7126(0x22a)][_0x4c7126(0x286)][_0x4c7126(0x1d4)](_0x40a84c[_0x4c7126(0x226)])&&_0x16b9c9[_0x4c7126(0x22a)]['_activateViewStorage'](_0x40a84c['viewName'],_0x34ce60),await _0x16b9c9['views'][_0x4c7126(0x199)](_0x40a84c[_0x4c7126(0x226)],_0x34ce60);},{'onClaimed':()=>{_0x2bf69b=!![],_0x3a39ca++;}})[_0xfea844(0x252)](()=>{})[_0xfea844(0x27a)](()=>{const _0x13d807=_0xfea844;if(_0x2bf69b)_0x3a39ca--;_0x403685[_0x13d807(0x27e)](_0x40a84c[_0x13d807(0x2b3)]);});if(_0x2bf69b)return;await _0x4803de;continue;}try{await _0x167555[_0xfea844(0x265)]['process']({'envs':[_0x40a84c['env']],'types':_0x40a84c[_0xfea844(0x1ed)]?[_0x40a84c['type']]:'*'});}catch{continue;}let _0x2333a5=[];try{_0x2333a5=_0x16b9c9[_0xfea844(0x21a)]['listWorkerBootstrapJobs']();}catch{}for(const _0xba152c of _0x2333a5){if(_0x3e9c98||_0x3a39ca>=0x1)return;let _0x4895f6=![];_0x403685['add'](_0x40a84c[_0xfea844(0x2b3)]);const _0x2fb4aa=_0x16b9c9[_0xfea844(0x21a)][_0xfea844(0x228)](_0xba152c,{'onClaimed':()=>{_0x4895f6=!![],_0x3a39ca++;}})['catch'](()=>{})[_0xfea844(0x27a)](()=>{const _0x771d48=_0xfea844;if(_0x4895f6)_0x3a39ca--;_0x403685['delete'](_0x40a84c[_0x771d48(0x2b3)]);});if(_0x4895f6)return;await _0x2fb4aa;}}}},_0x476855=Math[_0x55f329(0x270)](0x1,Number(process.env.OKDB_WORKERS_PROBE_PER_TICK)||0x2),_0x584e9b=Math[_0x55f329(0x270)](0x1,Number(process.env.OKDB_WORKERS_PROBE_GRACE_TICKS)||0x3);let _0x29031=Math['floor'](Math[_0x55f329(0x2af)]()*0x1000);const _0x50a762=new Set(),_0x3d7808=new Map(),_0x2ac78d=Math['max'](0x3e8,Number(process.env.OKDB_WORKERS_PROBE_COOLDOWN_MS)||0x7530),_0x17b345=new Map(),_0x4c458a={'name':_0x55f329(0x265),'cost':'light','inFlight':()=>{let _0x371735=0x0;for(const [,_0x4662c3]of _0x5787bb)if(_0x2570e2(_0x4662c3))_0x371735++;return _0x371735;},async 'tick'(){const _0x2b8dca=_0x55f329;if(_0x3e9c98)return;const _0x20a37c=_0x167555[_0x2b8dca(0x265)]['listFtsEnvs']();if(_0x20a37c['length']===0x0)return;const _0x590d09=new Map();for(const _0x152827 of _0x20a37c){if(!_0x590d09[_0x2b8dca(0x1d4)](_0x152827['env']))_0x590d09[_0x2b8dca(0x1be)](_0x152827['env'],[]);_0x590d09[_0x2b8dca(0x23b)](_0x152827['env'])['push'](_0x152827[_0x2b8dca(0x1ed)]);}const _0x2e3e5b=[..._0x590d09['keys']()],_0x213292=Date[_0x2b8dca(0x247)](),_0x19b3d0=[];for(const _0x59e433 of _0x50a762){_0x590d09[_0x2b8dca(0x1d4)](_0x59e433)&&!_0x19b3d0[_0x2b8dca(0x19d)](_0x59e433)&&(_0x17b345[_0x2b8dca(0x27e)](_0x59e433),_0x19b3d0[_0x2b8dca(0x284)](_0x59e433));}_0x50a762[_0x2b8dca(0x1da)]();for(let _0x3a27a3=0x0;_0x19b3d0['length']<_0x476855&&_0x3a27a3<_0x2e3e5b['length'];_0x3a27a3++){const _0x2ff9b0=_0x2e3e5b[(_0x29031+_0x3a27a3)%_0x2e3e5b[_0x2b8dca(0x23e)]];if(_0x19b3d0[_0x2b8dca(0x19d)](_0x2ff9b0))continue;if((_0x17b345[_0x2b8dca(0x23b)](_0x2ff9b0)??0x0)>_0x213292)continue;_0x19b3d0[_0x2b8dca(0x284)](_0x2ff9b0);}_0x29031=(_0x29031+_0x476855)%Math[_0x2b8dca(0x270)](0x1,_0x2e3e5b[_0x2b8dca(0x23e)]);for(const _0x251aef of _0x19b3d0){if(_0x3e9c98)return;try{await _0x3c9051(_0x251aef),await _0x167555['fts'][_0x2b8dca(0x28e)]({'envs':[_0x251aef],'types':_0x590d09[_0x2b8dca(0x23b)](_0x251aef)});}catch{}}for(const [_0x507d42,_0x4f14d9]of[..._0x5787bb]){if(_0x197315(_0x507d42,_0x4f14d9)){_0x3d7808[_0x2b8dca(0x27e)](_0x507d42);continue;}const _0x29f2cf=(_0x3d7808[_0x2b8dca(0x23b)](_0x507d42)??0x0)+0x1;_0x29f2cf>=_0x584e9b?(_0x3d7808['delete'](_0x507d42),_0x17b345['set'](_0x507d42,Date[_0x2b8dca(0x247)]()+_0x2ac78d),await _0x11b83b(_0x507d42)):_0x3d7808[_0x2b8dca(0x1be)](_0x507d42,_0x29f2cf);}}};_0x167555[_0x55f329(0x22c)]['on'](_0x2e5d86[_0x55f329(0x278)],_0x53ffd8=>{const _0x29d2c4=_0x55f329,_0x3f12de=_0x53ffd8?.[_0x29d2c4(0x2b3)];if(typeof _0x3f12de===_0x29d2c4(0x2a5)&&_0x3f12de&&!_0x3f12de[_0x29d2c4(0x22d)]('~'))_0x50a762[_0x29d2c4(0x2b7)](_0x3f12de);});const _0x4b9a98=Math[_0x55f329(0x270)](0x64,Number(process.env.OKDB_WORKERS_CLAIM_TICK_MS)||0x3e8),_0x4c3c8f=[_0x4afc6e,_0x29990d,_0x223a2a,_0x4c458a],_0x45c69d=[_0x29990d,_0x223a2a,_0x4c458a];let _0x13f7f2=0x0;const _0x41f70b=_0x147e50=>{const _0x32fdc9=_0x55f329;if(_0x3e9c98||_0x1c225e[_0x32fdc9(0x241)](_0x147e50[_0x32fdc9(0x27f)]))return;_0x147e50[_0x32fdc9(0x1bf)]()[_0x32fdc9(0x252)](()=>{});},_0x2a64d7=setInterval(()=>{const _0x1b76af=_0x55f329;_0x41f70b(_0x4afc6e);for(let _0x222613=0x0;_0x222613<_0x45c69d[_0x1b76af(0x23e)];_0x222613++){_0x41f70b(_0x45c69d[(_0x13f7f2+_0x222613)%_0x45c69d[_0x1b76af(0x23e)]]);}_0x13f7f2=(_0x13f7f2+0x1)%_0x45c69d[_0x1b76af(0x23e)];},_0x4b9a98);if(typeof _0x2a64d7['unref']===_0x55f329(0x233))_0x2a64d7[_0x55f329(0x2b6)]();_0x167555[_0x55f329(0x22c)]['on'](_0x2e5d86[_0x55f329(0x204)],_0x3c82ea=>{const _0x22e0e3=_0x55f329;if(_0x3c82ea?.[_0x22e0e3(0x255)]==='fn')_0x41f70b(_0x4afc6e);else{if(_0x3c82ea?.[_0x22e0e3(0x255)]===_0x22e0e3(0x24b))_0x41f70b(_0x223a2a);else{if(_0x3c82ea?.[_0x22e0e3(0x255)]===_0x22e0e3(0x217))_0x41f70b(_0x29990d);else{if(_0x3c82ea?.[_0x22e0e3(0x255)]===_0x22e0e3(0x264)&&typeof _0x3c82ea[_0x22e0e3(0x215)]===_0x22e0e3(0x2a5)){const _0x5d28f2=_0x3c82ea[_0x22e0e3(0x215)];_0x34a535({'type':'warn','msg':_0x22e0e3(0x1db)+_0x5d28f2+_0x22e0e3(0x263)+_0x5787bb['has'](_0x5d28f2)+')'}),(async()=>{const _0x5a3ce0=_0x22e0e3;for(const [_0x545092,_0x4029a7]of[..._0x411e51]){if(_0x4029a7?.[_0x5a3ce0(0x1a5)]!==_0x5d28f2)continue;_0x411e51[_0x5a3ce0(0x27e)](_0x545092);try{await _0x4029a7[_0x5a3ce0(0x23f)]?.[_0x5a3ce0(0x1d6)]?.();}catch{}}_0x403685[_0x5a3ce0(0x27e)](_0x5d28f2),_0x50a762[_0x5a3ce0(0x27e)](_0x5d28f2),_0x17b345[_0x5a3ce0(0x1be)](_0x5d28f2,Date[_0x5a3ce0(0x247)]()+0x1d4c0),await _0x11b83b(_0x5d28f2),_0x34a535({'type':_0x5a3ce0(0x212),'msg':'env-removed:\x20'+_0x5d28f2+_0x5a3ce0(0x248)});})()['catch'](_0x29553f=>{const _0x209cbe=_0x22e0e3;_0x34a535({'type':_0x209cbe(0x212),'msg':_0x209cbe(0x2a1)+_0x5d28f2+':\x20'+_0x29553f?.['message']});});}}}}});for(const _0x44c68d of _0x4c3c8f)_0x41f70b(_0x44c68d);_0x453185(_0x34a535,_0x167555,()=>({'claims':_0x4c3c8f[_0x55f329(0x1a6)](_0x1acfd1=>({'name':_0x1acfd1[_0x55f329(0x28b)],'inFlight':_0x1acfd1[_0x55f329(0x291)](),'gated':_0x1c225e[_0x55f329(0x241)](_0x1acfd1[_0x55f329(0x27f)]),..._0x1acfd1[_0x55f329(0x1cc)]?{'detail':_0x1acfd1[_0x55f329(0x1cc)]()}:{}})),'envsOpen':_0x167555[_0x55f329(0x234)]['size']})),_0x34a535({'type':_0x55f329(0x1c6),'pid':process[_0x55f329(0x20a)],'slot':_0x2d9485,'supervisorKey':_0x5f96e2,'maxLeases':_0x224253});}return _0x13d282()[_0x328e3b(0x252)](_0x3f43b6=>{const _0x197eb8=_0x328e3b;_0x34a535({'type':_0x197eb8(0x2a4),'error':_0x3f43b6[_0x197eb8(0x283)]}),process[_0x197eb8(0x2b0)](0x1);}),okdbWorkerChild$1;}var okdbWorkerChildExports=requireOkdbWorkerChild(),okdbWorkerChild=getDefaultExportFromCjs(okdbWorkerChildExports);module[_0x275d88(0x1f2)]=okdbWorkerChild;
|