@kedem/okdb 1.9.0 → 1.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/okdb-worker-child.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function _0x4002(_0xa29594,_0x97f351){_0xa29594=_0xa29594-0x7f;const _0x2a3d18=_0x2a3d();let _0x4002a=_0x2a3d18[_0xa29594];return _0x4002a;}const _0x52b696=_0x4002;(function(_0x481912,_0x13796c){const _0x1db266=_0x4002,_0x2fa0e2=_0x481912();while(!![]){try{const _0x66484c=-parseInt(_0x1db266(0x199))/0x1+-parseInt(_0x1db266(0x15e))/0x2*(parseInt(_0x1db266(0x130))/0x3)+-parseInt(_0x1db266(0x128))/0x4+parseInt(_0x1db266(0xa9))/0x5+parseInt(_0x1db266(0x13b))/0x6+parseInt(_0x1db266(0x13e))/0x7*(parseInt(_0x1db266(0x10a))/0x8)+-parseInt(_0x1db266(0x15d))/0x9;if(_0x66484c===_0x13796c)break;else _0x2fa0e2['push'](_0x2fa0e2['shift']());}catch(_0x4d188e){_0x2fa0e2['push'](_0x2fa0e2['shift']());}}}(_0x2a3d,0xa40a4));var require$$0$1=require('path'),require$$1$1=require('os'),require$$0=require(_0x52b696(0x158)),require$$1=require('worker_threads');function getDefaultExportFromCjs(_0x2a93ad){const _0x46812f=_0x52b696;return _0x2a93ad&&_0x2a93ad[_0x46812f(0xf5)]&&Object[_0x46812f(0xed)]['hasOwnProperty'][_0x46812f(0xe7)](_0x2a93ad,'default')?_0x2a93ad[_0x46812f(0xb2)]:_0x2a93ad;}function _0x2a3d(){const _0x5b31f4=['env-removed:\x20','_runBootstrapScanPhases','logs','worker','unique:violation_resolved','object','_activateViewStorage','started','_buckets','queueType','intake','string','_drainHandler','requestedAt','watchdog','763928rBStzy','toFixed','queue','envName','scope','runId','heapTotal','warn','system:clock_change','isHeld','_log','exit','\x20—\x20','pid','detachConsole','\x20(resident=','finally','processes','has','_bareOpen','fts:registered','maxConcurrency','sandbox-','values','_admissionStarted','tick','function\x20sandbox\x20exited\x20(code\x20','setTtl','stopped','onWindow','1514704TqHIck','schema:set','views','\x20evicted','state','freeze','reportThreadStats','main','1011YiGhvi','env:removed','queue.process\x20threw:\x20','inflight','keys','tierList','rootPath','idleTimer','index:reset','openDB','halted','6487284FKeJGu','dropType','requestId','7HIKDyy','size','user','clearTtl','startsWith','platform','_maybeIdle','~fn:responses','recycle','_ensureTier','bus:type_drop','heavy','onThreadStats','sync:apply','FUNCTION_OOM','_rootDb','fn-sandbox:','system','add','catch','listWorkerBootstrapJobs','ms/','system:drain','created','processor','terminate','node:perf_hooks','_envs','defaultMemoryMb','length','system:type_drop','4881222qTrgYx','1790nMOewm','disable','_processorStops','control','(worst\x20','get','item:update','fts:reset','transactionSync','message','timeMachine','maxExtra','map','_stopped','FUNCTION_CANCELLED','inFlightCount','round','set','unhandledRejection:\x20','delete','~proc:bootstrap-index','dropping','sandbox\x20failed\x20to\x20boot','txn:rollback','ttl:set','putSync','_startAdmission','running','listDesired','cost','name','stderr','ttl:clear','stopping','_terminateTier','bootstrap:','wedged','init','fts:drop','ms\x20grace)\x20—\x20sandbox\x20terminated','clear','cancel','okdb-functions-sandbox-worker.js','_viewState','view:progress','system:bus_state_change','setSchema','cursorKey','queue\x20consumer\x20stopped\x20(def\x20deregistered):\x20','blocks','cancelled','worker\x20OKDB\x20open\x20failed:\x20','push','options','type','slice','kind','ttl:expired','ERR_WORKER_OUT_OF_MEMORY','120804kWXCcy','stats','close','ms\x20mean=','_admissionTimer','version','env-removed\x20evict\x20FAILED\x20for\x20','idleMs','key','readySettled','graceMs','openEnv','ms\x20max=','env-removed','postMessage','random','reduce','env','enable','function\x20sandbox\x20error:\x20','item:remove','index:drop','_tierFor','min','run','FUNCTION_TIMEOUT','resetting','active','~views','function','split','stopAll','onEmit','license:activated','lastError','sandbox\x20recycled','system:proc','unref','runtime','function\x20cancelled\x20—\x20did\x20not\x20unwind\x20within\x20grace;\x20sandbox\x20terminated','remove','_tiers','_started','mean','bus:drain','includes','_closeSharedEnvs','loop-lag\x20','max','timeoutMs','reject','unique:violation','queue-worker','function\x20sandbox\x20out\x20of\x20memory\x20(tier\x20','4193280ceWPCJ','detail','events','claimAndRunWorkerBootstrap','code','ready','Spawned\x20queue\x20worker\x20export\x20not\x20found\x20or\x20not\x20a\x20function:\x20','_windowCbs','_timer','default','passive','rejectReady','cpuUsage','listFtsEnvs','off','env:opened','send','percentile','_failTier','system:poke','fts','registerFts','viewName','waiting','label','maxMs','start','external','getRange','system:ready','FUNCTION_FAILED','_lockHandle','Could\x20not\x20dynamically\x20require\x20\x22','_dropTier','type:drop','stringify','starting','process','_onMessage','worker:\x20no\x20init\x20message\x20received','reset','setLogger','entries','enabled','join','result','log','count','index:registered','license:invalid','heapUsed','write','dropSchema','then','unhandledRejection','ms\x20(+','sandbox\x20terminated\x20for\x20a\x20sibling\x20job\x20—\x20retryable','ms\x20p99=','FUNCTION_SANDBOX_EXIT','ref:violation_resolved','_registrations','_report','call','SYSTEM_POKE','put','floor','error','function\x20exceeded\x20','prototype','true','bus:poke','env\x20open\x20failed:\x20','txn:end','now','removeSync','stop','__esModule','okdb.js','note','resume','pending','open'];_0x2a3d=function(){return _0x5b31f4;};return _0x2a3d();}function commonjsRequire(_0x208165){const _0x54d4c0=_0x52b696;throw new Error(_0x54d4c0(0xc9)+_0x208165+'\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 _0x4b58f7=_0x52b696;if(hasRequiredOkdbEnums)return okdbEnums;hasRequiredOkdbEnums=0x1;const _0x4f2174={'PUT':_0x4b58f7(0xe9),'REMOVE':_0x4b58f7(0x9b),'INDEX_DROP':'dropIndex','INDEX_REGISTER':'registerIndex','INDEX_RESET':'resetIndex','TYPE_REGISTER':'registerType','TYPE_DROP':_0x4b58f7(0x13c),'FTS_REGISTER':_0x4b58f7(0xbe),'FTS_DROP':'dropFts','FTS_RESET':'resetFts','SCHEMA_SET':_0x4b58f7(0x18c),'SCHEMA_DROP':_0x4b58f7(0xdd),'TTL_SET':_0x4b58f7(0x125),'TTL_CLEAR':_0x4b58f7(0x141)},_0x1f8cfd={'SYSTEM_READY':_0x4b58f7(0xc6),'SYSTEM_STOPPED':'system:stopped','SYSTEM_CLOCK_CHANGE':_0x4b58f7(0x112),'SYSTEM_POKE':_0x4b58f7(0xbc),'SYSTEM_DRAIN':_0x4b58f7(0x154),'SYSTEM_TYPE_DROP':_0x4b58f7(0x15c),'SYSTEM_PROC':_0x4b58f7(0x97),'SYSTEM_BUS_STATE_CHANGE':_0x4b58f7(0x18b),'ITEM_CREATE':'item:create','ITEM_UPDATE':_0x4b58f7(0x164),'ITEM_REMOVE':_0x4b58f7(0x87),'INDEX_RESET':_0x4b58f7(0x138),'INDEX_READY':'index:ready','INDEX_PROGRESS':'index:progress','VIEW_PROGRESS':_0x4b58f7(0x18a),'INDEX_DROP':_0x4b58f7(0x88),'INDEX_REGISTERED':_0x4b58f7(0xd9),'FTS_REGISTERED':_0x4b58f7(0x11e),'FTS_DROP':_0x4b58f7(0x184),'FTS_RESET':_0x4b58f7(0x165),'SCHEMA_SET':_0x4b58f7(0x129),'SCHEMA_DROP':'schema:drop','UNIQUE_VIOLATION':_0x4b58f7(0xa6),'UNIQUE_VIOLATION_RESOLVED':_0x4b58f7(0xff),'REF_VIOLATION':'ref:violation','REF_VIOLATION_RESOLVED':_0x4b58f7(0xe4),'SYNC_APPLY':_0x4b58f7(0x14b),'TXN_START':'txn:start','TXN_END':_0x4b58f7(0xf1),'TXN_ROLLBACK':_0x4b58f7(0x175),'TYPE_REGISTERED':'type:registered','TYPE_DROP':_0x4b58f7(0xcb),'ENV_OPENED':_0x4b58f7(0xb8),'ENV_REMOVED':_0x4b58f7(0x131),'TTL_EXPIRED':_0x4b58f7(0x197),'TTL_SET':_0x4b58f7(0x176),'TTL_CLEAR':_0x4b58f7(0x17e),'LICENSE_INVALID':_0x4b58f7(0xda),'LICENSE_ADDED':'license:added','LICENSE_ACTIVATED':_0x4b58f7(0x94),'LICENSE_REMOVED':'license:removed'},_0x5d4484={'CREATING':'creating','RESETTING':_0x4b58f7(0x8d),'READY':_0x4b58f7(0xae),'DROPPING':_0x4b58f7(0x173),'WAITING':_0x4b58f7(0xc0)},_0x28ec46={'CREATED':_0x4b58f7(0x155),'STARTING':_0x4b58f7(0xcd),'STARTED':_0x4b58f7(0x102),'STOPPING':_0x4b58f7(0x17f),'STOPPED':_0x4b58f7(0x126)},_0x54043c={'CREATING':'creating','READY':'ready','HALTED':_0x4b58f7(0x13a),'STOPPED':_0x4b58f7(0x126),'RESETTING':_0x4b58f7(0x8d)},_0x16c269=Object[_0x4b58f7(0x12d)]({'POKE':_0x4b58f7(0xef),'DRAIN':_0x4b58f7(0x9f),'TYPE_DROP':_0x4b58f7(0x148),'PROC':'bus:proc'});return okdbEnums={'BUS_EVENTS':_0x16c269,'CHANGE_ACTIONS':_0x4f2174,'EVENTS':_0x1f8cfd,'INDEX_STATE':_0x5d4484,'OKDB_STATE':_0x28ec46,'VIEW_STATE':_0x54043c},okdbEnums;}var okdbLoopMonitor,hasRequiredOkdbLoopMonitor;function requireOkdbLoopMonitor(){const _0x2d886a=_0x52b696;if(hasRequiredOkdbLoopMonitor)return okdbLoopMonitor;hasRequiredOkdbLoopMonitor=0x1;const {monitorEventLoopDelay:_0x3dc00c,performance:_0x4d37fe}=require$$0,_0x5cc0c4=process.env.OKDB_LOOP_LAG==='1'||process.env.OKDB_LOOP_LAG===_0x2d886a(0xee),_0x2f29a1=Number(process.env.OKDB_LOOP_LAG_MS)||0x7d0,_0x304b00=process.env.OKDB_LOOP_LAG_ALL==='1',_0x1b1b0c=Number(process.env.OKDB_LOOP_LAG_MIN_MS)||0x64;class _0x562504{constructor(){const _0x247928=_0x2d886a;this['enabled']=_0x5cc0c4,this[_0x247928(0x103)]=new Map(),this['_h']=null,this[_0x247928(0xb1)]=null,this[_0x247928(0x9d)]=![],this[_0x247928(0x114)]=(_0x1f22d9,_0xb9da2f)=>process[_0x247928(0x17d)][_0x247928(0xdc)](_0x1f22d9+(_0xb9da2f?'\x20'+JSON[_0x247928(0xcc)](_0xb9da2f):'')+'\x0a');}[_0x2d886a(0xf2)](){const _0x425d21=_0x2d886a;return _0x4d37fe[_0x425d21(0xf2)]();}[_0x2d886a(0xd2)](_0x2ae468){const _0x3c3b61=_0x2d886a;if(typeof _0x2ae468==='function')this[_0x3c3b61(0x114)]=_0x2ae468;}[_0x2d886a(0xf7)](_0x580a72,_0x1a40b9,_0x290392){const _0x285419=_0x2d886a;if(!this[_0x285419(0xd4)])return;let _0x2bbe23=this[_0x285419(0x103)][_0x285419(0x163)](_0x580a72);!_0x2bbe23&&(_0x2bbe23={'ms':0x0,'count':0x0,'maxMs':0x0,'maxExtra':''},this['_buckets'][_0x285419(0x16f)](_0x580a72,_0x2bbe23)),_0x2bbe23['ms']+=_0x1a40b9,_0x2bbe23['count']+=0x1,_0x1a40b9>_0x2bbe23['maxMs']&&(_0x2bbe23[_0x285419(0xc2)]=_0x1a40b9,_0x2bbe23[_0x285419(0x169)]=_0x290392||'');}[_0x2d886a(0xc3)](_0x5637d9){const _0x59aa73=_0x2d886a;if(!this['enabled']||this[_0x59aa73(0x9d)])return;this['_started']=!![];if(_0x5637d9)this[_0x59aa73(0x114)]=_0x5637d9;this['_h']=_0x3dc00c({'resolution':0xa}),this['_h'][_0x59aa73(0x85)](),this[_0x59aa73(0xb1)]=setInterval(()=>this[_0x59aa73(0xe6)](),_0x2f29a1);if(this['_timer']['unref'])this[_0x59aa73(0xb1)]['unref']();}[_0x2d886a(0x127)](_0x197f86){const _0x487e5d=_0x2d886a;if(!this['_windowCbs'])this[_0x487e5d(0xb0)]=new Set();this[_0x487e5d(0xb0)][_0x487e5d(0x150)](_0x197f86);if(!this[_0x487e5d(0x9d)])this[_0x487e5d(0x178)]();}['offWindow'](_0x25d9c5){const _0x5e784c=_0x2d886a;this[_0x5e784c(0xb0)]?.['delete'](_0x25d9c5);}[_0x2d886a(0x178)](){const _0xceaec9=_0x2d886a;if(this[_0xceaec9(0x122)])return;this[_0xceaec9(0x122)]=!![];!this['_h']&&(this['_h']=_0x3dc00c({'resolution':0xa}),this['_h']['enable']());const _0x323c50=_0x2f29a1;this[_0xceaec9(0x19d)]=setInterval(()=>{const _0x159a38=_0xceaec9,_0x839112=this['_h'];if(!_0x839112)return;const _0x418710=_0x839112[_0x159a38(0xba)](0x63)/0xf4240,_0xca8476=_0x839112['max']/0xf4240,_0x41c913=_0x839112[_0x159a38(0x9e)]/0xf4240;_0x839112[_0x159a38(0xd1)]();if(this[_0x159a38(0xb0)])for(const _0x3495c4 of this['_windowCbs']){try{_0x3495c4({'p99Ms':_0x418710,'maxMs':_0xca8476,'meanMs':_0x41c913,'reportMs':_0x323c50});}catch{}}},_0x323c50);if(this[_0xceaec9(0x19d)]['unref'])this[_0xceaec9(0x19d)][_0xceaec9(0x98)]();}[_0x2d886a(0xe6)](){const _0x4364f5=_0x2d886a,_0x568c9e=this['_h'],_0x5b5bc7=_0x568c9e[_0x4364f5(0xa3)]/0xf4240,_0x39a924=_0x568c9e[_0x4364f5(0xba)](0x63)/0xf4240,_0x393e75=_0x568c9e[_0x4364f5(0x9e)]/0xf4240;_0x568c9e[_0x4364f5(0xd1)]();const _0x257667=[...this['_buckets'][_0x4364f5(0xd3)]()]['map'](([_0x2bd166,_0x3911e2])=>({'label':_0x2bd166,..._0x3911e2}))['sort']((_0x3fc62b,_0x4ae9b6)=>_0x4ae9b6['ms']-_0x3fc62b['ms'])[_0x4364f5(0x195)](0x0,0x8);this['_buckets'][_0x4364f5(0x186)]();const _0x46f55a=_0x257667[_0x4364f5(0x83)]((_0x3737b2,_0x1854d1)=>_0x3737b2+_0x1854d1['ms'],0x0),_0x290ff1=_0x257667['map'](_0xf2b42b=>_0xf2b42b[_0x4364f5(0xc1)]+'='+_0xf2b42b['ms'][_0x4364f5(0x10b)](0x0)+_0x4364f5(0x153)+_0xf2b42b[_0x4364f5(0xd8)]+(_0xf2b42b[_0x4364f5(0xc2)]>0x5?_0x4364f5(0x162)+_0xf2b42b[_0x4364f5(0xc2)][_0x4364f5(0x10b)](0x0)+'ms'+(_0xf2b42b[_0x4364f5(0x169)]?'\x20'+_0xf2b42b['maxExtra']:'')+')':''));(_0x304b00||_0x5b5bc7>=_0x1b1b0c)&&this[_0x4364f5(0x114)](_0x4364f5(0xa2)+_0x2f29a1+_0x4364f5(0x7f)+_0x5b5bc7['toFixed'](0x0)+_0x4364f5(0xe2)+_0x39a924[_0x4364f5(0x10b)](0x0)+_0x4364f5(0x19c)+_0x393e75[_0x4364f5(0x10b)](0x0)+'ms\x20busy='+_0x46f55a['toFixed'](0x0)+'ms'+(_0x290ff1['length']?'\x20│\x20'+_0x290ff1[_0x4364f5(0xd5)]('\x20\x20'):''),{'feature':'loop-lag'});if(this[_0x4364f5(0xb0)])for(const _0x52fe21 of this[_0x4364f5(0xb0)]){try{_0x52fe21({'p99Ms':_0x39a924,'maxMs':_0x5b5bc7,'meanMs':_0x393e75,'reportMs':_0x2f29a1});}catch{}}}['stop'](){const _0x570435=_0x2d886a;if(this[_0x570435(0xb1)])clearInterval(this[_0x570435(0xb1)]);if(this['_h'])this['_h'][_0x570435(0x15f)]();this[_0x570435(0xb1)]=null,this['_h']=null,this[_0x570435(0x9d)]=![];}}const _0x8869c9=new _0x562504();if(_0x8869c9[_0x2d886a(0xd4)])_0x8869c9['start']();return okdbLoopMonitor={'LOOP':_0x8869c9},okdbLoopMonitor;}var okdbIntakeGate,hasRequiredOkdbIntakeGate;function requireOkdbIntakeGate(){if(hasRequiredOkdbIntakeGate)return okdbIntakeGate;hasRequiredOkdbIntakeGate=0x1;const _0x3993f3=0x2,_0x22cdd0=0x2,_0x4fde5f=0x2;function _0x3bd779({gateMs:_0x31e9b1}){let _0x3ed52f=0x0,_0x3230cb=0x0,_0xf57267=0x0;return{'level':()=>_0x3ed52f,'blocks'(_0x545fd9){const _0x178a09=_0x4002;if(_0x545fd9==='control')return![];if(_0x3ed52f>=0x2)return!![];if(_0x3ed52f>=0x1&&_0x545fd9===_0x178a09(0x149))return!![];return![];},'onWindow'(_0x8f2a85){if(_0x8f2a85>_0x31e9b1){_0x3230cb++,_0xf57267=0x0;if(_0x3230cb>=_0x3993f3&&_0x3ed52f<_0x4fde5f)return _0x3ed52f++,_0x3230cb=0x0,{'changed':!![],'level':_0x3ed52f};}else{if(_0x8f2a85<_0x31e9b1/0x2){_0xf57267++,_0x3230cb=0x0;if(_0xf57267>=_0x22cdd0&&_0x3ed52f>0x0)return _0x3ed52f--,_0xf57267=0x0,{'changed':!![],'level':_0x3ed52f};}else _0x3230cb=0x0,_0xf57267=0x0;}return{'changed':![],'level':_0x3ed52f};}};}return okdbIntakeGate={'createIntakeGate':_0x3bd779},okdbIntakeGate;}var okdbQueueLoadHandler,hasRequiredOkdbQueueLoadHandler;function requireOkdbQueueLoadHandler(){if(hasRequiredOkdbQueueLoadHandler)return okdbQueueLoadHandler;hasRequiredOkdbQueueLoadHandler=0x1;function _0x1611dd(_0x1dc46d,_0x339dfb){const _0x44c647=_0x4002,_0x437871=commonjsRequire(_0x1dc46d);if(_0x339dfb&&_0x339dfb!==_0x44c647(0xb2)){const _0x4bb4d9=_0x437871?.[_0x339dfb];if(typeof _0x4bb4d9!=='function')throw new Error(_0x44c647(0xaf)+_0x339dfb);return _0x4bb4d9;}if(typeof _0x437871===_0x44c647(0x90))return _0x437871;if(typeof _0x437871?.[_0x44c647(0xb2)]==='function')return _0x437871['default'];throw new Error('Spawned\x20queue\x20worker\x20module\x20must\x20export\x20a\x20function\x20or\x20default\x20function');}return okdbQueueLoadHandler={'loadHandler':_0x1611dd},okdbQueueLoadHandler;}var okdbFunctionsSandboxHost,hasRequiredOkdbFunctionsSandboxHost;function requireOkdbFunctionsSandboxHost(){const _0x3170bf=_0x52b696;if(hasRequiredOkdbFunctionsSandboxHost)return okdbFunctionsSandboxHost;hasRequiredOkdbFunctionsSandboxHost=0x1;const _0x3378d7=require$$0$1,{Worker:_0x3f1ac7}=require$$1,_0x5c84e1=_0x3378d7[_0x3170bf(0xd5)](__dirname,_0x3170bf(0x188)),_0x8c222e=0x100,_0x28db90=0x3e8;function _0x2a7b6b(_0x10b66f,_0x331d28){const _0x27fb3e=_0x3170bf,_0x5ac1a3=new Error(_0x10b66f);return _0x5ac1a3[_0x27fb3e(0xad)]=_0x331d28,_0x5ac1a3;}class _0x3e07fb{constructor({rootPath:_0x2c7ac5,memoryMb:_0x1ea3d9,maxConcurrency:_0x18b914,idleMs:_0x2993fb,graceMs:_0x4ec610,onThreadStats:_0x21bc95,log:_0x4bf6df}={}){const _0x5416e9=_0x3170bf;if(!_0x2c7ac5)throw new Error('SandboxHost:\x20rootPath\x20required');this[_0x5416e9(0x136)]=_0x2c7ac5,this[_0x5416e9(0x15a)]=Math[_0x5416e9(0xa3)](0x20,Math[_0x5416e9(0xea)](_0x1ea3d9??_0x8c222e)),this[_0x5416e9(0x11f)]=Math['max'](0x1,Number(process.env.OKDB_FN_SANDBOX_CONCURRENCY)||_0x18b914||0x4),this[_0x5416e9(0x1a0)]=Math['max'](0x3e8,Number(process.env.OKDB_FN_SANDBOX_IDLE_MS)||_0x2993fb||0x7530),this[_0x5416e9(0x1a3)]=Math['max'](0x64,Number(process.env.OKDB_FN_SANDBOX_GRACE_MS)||_0x4ec610||0x5dc),this['onThreadStats']=_0x21bc95??null,this[_0x5416e9(0xd7)]=_0x4bf6df??null,this[_0x5416e9(0x9c)]=new Map(),this[_0x5416e9(0x16b)]=![];}[_0x3170bf(0x16d)](){const _0x4f78f9=_0x3170bf;let _0x53c04a=0x0;for(const _0x3349b0 of this['_tiers'][_0x4f78f9(0x121)]())_0x53c04a+=_0x3349b0[_0x4f78f9(0x133)][_0x4f78f9(0x13f)];return _0x53c04a;}[_0x3170bf(0x89)](){const _0x3428a2=_0x3170bf;return this[_0x3428a2(0x15a)];}[_0x3170bf(0x147)](_0xdc7293){const _0xc093d1=_0x3170bf;let _0x1f0c60=this['_tiers'][_0xc093d1(0x163)](_0xdc7293);if(_0x1f0c60)return _0x1f0c60;const _0x548bb8=new _0x3f1ac7(_0x5c84e1,{'workerData':{'rootPath':this[_0xc093d1(0x136)]},'stdout':!![],'stderr':!![]});_0x548bb8['stdout']?.[_0xc093d1(0xf8)](),_0x548bb8['stderr']?.[_0xc093d1(0xf8)](),_0x548bb8[_0xc093d1(0x98)]?.();let _0x1ad06c;const _0x3bb704=new Promise((_0x33a59c,_0x13c92f)=>{const _0x3cb4d1=(_0x2e17cd,_0x3b60d3)=>{const _0x4b3ef3=_0x4002;_0x1f0c60[_0x4b3ef3(0x1a2)]=!![],_0x548bb8[_0x4b3ef3(0xb7)](_0x4b3ef3(0x167),_0x59f7d6),_0x2e17cd(_0x3b60d3);},_0x59f7d6=_0x32ded3=>{const _0x5abefd=_0x4002;if(_0x32ded3?.[_0x5abefd(0x194)]===_0x5abefd(0xae))_0x3cb4d1(_0x33a59c);else{if(_0x32ded3?.[_0x5abefd(0x194)]==='fatal')_0x3cb4d1(_0x13c92f,_0x2a7b6b(_0x32ded3[_0x5abefd(0xeb)]?.[_0x5abefd(0x167)]??_0x5abefd(0x174),_0x5abefd(0xe3)));}};_0x1ad06c=_0x266ecb=>_0x3cb4d1(_0x13c92f,_0x266ecb),_0x548bb8['on']('message',_0x59f7d6);});return _0x1f0c60={'worker':_0x548bb8,'inflight':new Map(),'idleTimer':null,'readySettled':![],'rejectReady':_0x1ad06c,'ready':_0x3bb704},_0x1f0c60[_0xc093d1(0xae)][_0xc093d1(0x151)](()=>{}),this[_0xc093d1(0x9c)]['set'](_0xdc7293,_0x1f0c60),_0x548bb8['on']('message',_0x217e30=>this[_0xc093d1(0xcf)](_0xdc7293,_0x1f0c60,_0x217e30)),_0x548bb8['on']('error',_0x5675ef=>{const _0x429cdc=_0xc093d1,_0x30a632=_0x5675ef?.['code']===_0x429cdc(0x198);this[_0x429cdc(0xbb)](_0xdc7293,_0x1f0c60,_0x30a632?_0x2a7b6b(_0x429cdc(0xa8)+_0xdc7293+'MB\x20heap\x20cap)',_0x429cdc(0x14c)):_0x2a7b6b(_0x429cdc(0x86)+(_0x5675ef?.[_0x429cdc(0x167)]??_0x5675ef),_0x429cdc(0xe3)));}),_0x548bb8['on']('exit',_0x1c3d53=>{const _0x5bbea5=_0xc093d1;this['_failTier'](_0xdc7293,_0x1f0c60,_0x2a7b6b(_0x5bbea5(0x124)+_0x1c3d53+')',_0x5bbea5(0xe3)));}),_0x1f0c60;}['_onMessage'](_0x414bac,_0x1f6028,_0x1c9a61){const _0x23a719=_0x3170bf;if(!_0x1c9a61||typeof _0x1c9a61!==_0x23a719(0x100))return;if(_0x1c9a61['type']==='stats'){this[_0x23a719(0x14a)]?.(_0x23a719(0x14e)+_0x414bac,{'heapUsed':_0x1c9a61[_0x23a719(0xdb)]??0x0});return;}const _0x1fc451=_0x1c9a61[_0x23a719(0x13d)]!=null?_0x1f6028['inflight'][_0x23a719(0x163)](_0x1c9a61['requestId']):null;if(!_0x1fc451)return;if(_0x1c9a61[_0x23a719(0x194)]===_0x23a719(0xd7)){_0x1fc451['logs'][_0x23a719(0x192)](_0x1c9a61['entry']);return;}if(_0x1c9a61[_0x23a719(0x194)]===_0x23a719(0xd6)||_0x1c9a61[_0x23a719(0x194)]===_0x23a719(0xeb))_0x1f6028[_0x23a719(0x133)][_0x23a719(0x171)](_0x1c9a61['requestId']),clearTimeout(_0x1fc451['watchdog']),_0x1fc451['resolve']({'message':_0x1c9a61,'logs':_0x1fc451[_0x23a719(0xfd)]}),this[_0x23a719(0x144)](_0x414bac,_0x1f6028);else _0x1fc451[_0x23a719(0x93)]&&_0x1fc451[_0x23a719(0x93)](_0x1c9a61);}async['run'](_0x5849fb,{onEmit:_0x22fb7d}={}){const _0x1d3e0f=_0x3170bf;if(this['_stopped'])throw _0x2a7b6b('sandbox\x20host\x20stopped',_0x1d3e0f(0xe3));const _0x591a2b=this[_0x1d3e0f(0x89)](_0x5849fb),_0x5a98f0=this[_0x1d3e0f(0x147)](_0x591a2b);return _0x5a98f0[_0x1d3e0f(0x137)]&&(clearTimeout(_0x5a98f0[_0x1d3e0f(0x137)]),_0x5a98f0[_0x1d3e0f(0x137)]=null),await _0x5a98f0[_0x1d3e0f(0xae)],new Promise((_0x4c2eaf,_0x20ba99)=>{const _0x2938fa=_0x1d3e0f,_0x5ce528=Math['max'](0x1,_0x5849fb[_0x2938fa(0x99)]?.[_0x2938fa(0xa4)]??_0x28db90),_0x57070e={'resolve':_0x4c2eaf,'reject':_0x20ba99,'logs':[],'onEmit':_0x22fb7d??null,'cancelled':![],'watchdog':setTimeout(()=>{const _0x4faed4=_0x2938fa;this['_terminateTier'](_0x591a2b,_0x5a98f0,_0x5849fb['requestId'],_0x2a7b6b(_0x4faed4(0xec)+_0x5ce528+_0x4faed4(0xe0)+this[_0x4faed4(0x1a3)]+_0x4faed4(0x185),_0x57070e[_0x4faed4(0x190)]?_0x4faed4(0x16c):_0x4faed4(0x8c)));},_0x5ce528+this[_0x2938fa(0x1a3)])};if(_0x57070e[_0x2938fa(0x109)][_0x2938fa(0x98)])_0x57070e[_0x2938fa(0x109)]['unref']();_0x5a98f0['inflight'][_0x2938fa(0x16f)](_0x5849fb[_0x2938fa(0x13d)],_0x57070e),_0x5a98f0['worker'][_0x2938fa(0x81)]({'type':_0x2938fa(0x8b),'job':_0x5849fb});});}[_0x3170bf(0x187)](_0x4c9a4b){const _0x12db06=_0x3170bf;for(const [_0xd3d97e,_0x2df8b6]of this['_tiers']){const _0x38b985=_0x2df8b6[_0x12db06(0x133)]['get'](_0x4c9a4b);if(!_0x38b985)continue;if(_0x38b985[_0x12db06(0x190)])return!![];_0x38b985[_0x12db06(0x190)]=!![],_0x2df8b6[_0x12db06(0xfe)][_0x12db06(0x81)]({'type':_0x12db06(0x187),'requestId':_0x4c9a4b}),clearTimeout(_0x38b985[_0x12db06(0x109)]),_0x38b985[_0x12db06(0x109)]=setTimeout(()=>{const _0xd71e87=_0x12db06;this[_0xd71e87(0x180)](_0xd3d97e,_0x2df8b6,_0x4c9a4b,_0x2a7b6b(_0xd71e87(0x9a),'FUNCTION_CANCELLED'));},this[_0x12db06(0x1a3)]);if(_0x38b985[_0x12db06(0x109)]['unref'])_0x38b985[_0x12db06(0x109)]['unref']();return!![];}return![];}[_0x3170bf(0x180)](_0x59ecf0,_0x50d709,_0x293196,_0x35c24f){const _0x2a1534=_0x3170bf;for(const [_0x330824,_0x318de2]of _0x50d709['inflight']){clearTimeout(_0x318de2[_0x2a1534(0x109)]),_0x318de2[_0x2a1534(0xa5)](_0x330824===_0x293196?_0x35c24f:_0x2a7b6b(_0x2a1534(0xe1),_0x2a1534(0xe3)));}_0x50d709['inflight'][_0x2a1534(0x186)](),this[_0x2a1534(0xca)](_0x59ecf0,_0x50d709);}['_failTier'](_0x12ed5e,_0x34a7be,_0x4686f6){const _0x366550=_0x3170bf;if(this[_0x366550(0x9c)][_0x366550(0x163)](_0x12ed5e)!==_0x34a7be)return;if(!_0x34a7be[_0x366550(0x1a2)])_0x34a7be[_0x366550(0xb4)]?.(_0x4686f6);for(const [,_0x223b72]of _0x34a7be[_0x366550(0x133)]){clearTimeout(_0x223b72[_0x366550(0x109)]),_0x223b72[_0x366550(0xa5)](_0x4686f6);}_0x34a7be[_0x366550(0x133)][_0x366550(0x186)](),this[_0x366550(0xca)](_0x12ed5e,_0x34a7be);}[_0x3170bf(0xca)](_0x473628,_0x18652d){const _0x42bd64=_0x3170bf;if(this[_0x42bd64(0x9c)][_0x42bd64(0x163)](_0x473628)===_0x18652d)this[_0x42bd64(0x9c)][_0x42bd64(0x171)](_0x473628);if(_0x18652d[_0x42bd64(0x137)])clearTimeout(_0x18652d[_0x42bd64(0x137)]);this[_0x42bd64(0x14a)]?.(_0x42bd64(0x14e)+_0x473628,null),_0x18652d[_0x42bd64(0xfe)][_0x42bd64(0x157)]()[_0x42bd64(0x151)](()=>{});}['_maybeIdle'](_0x380fe2,_0x4b488f){const _0xe8397=_0x3170bf;if(_0x4b488f[_0xe8397(0x133)][_0xe8397(0x13f)]>0x0||_0x4b488f[_0xe8397(0x137)])return;_0x4b488f[_0xe8397(0x137)]=setTimeout(()=>this['_dropTier'](_0x380fe2,_0x4b488f),this[_0xe8397(0x1a0)]);if(_0x4b488f['idleTimer'][_0xe8397(0x98)])_0x4b488f['idleTimer'][_0xe8397(0x98)]();}['recycle'](){const _0x339dc4=_0x3170bf;for(const [_0x173f15,_0x3b08ed]of[...this['_tiers']]){this[_0x339dc4(0xbb)](_0x173f15,_0x3b08ed,_0x2a7b6b(_0x339dc4(0x96),_0x339dc4(0xe3)));}}async[_0x3170bf(0xf4)](){const _0x220157=_0x3170bf;this[_0x220157(0x16b)]=!![],this[_0x220157(0x146)]();}}return okdbFunctionsSandboxHost={'SandboxHost':_0x3e07fb,'SANDBOX_ENTRY':_0x5c84e1},okdbFunctionsSandboxHost;}var hasRequiredOkdbWorkerChild;function requireOkdbWorkerChild(){const _0x9b6073=_0x52b696;if(hasRequiredOkdbWorkerChild)return okdbWorkerChild$1;hasRequiredOkdbWorkerChild=0x1;const _0x136738=require$$0$1;function _0xbea9c6(_0x42b0e3){const _0x238ff7=_0x4002;try{if(typeof process['send']===_0x238ff7(0x90))process[_0x238ff7(0xb9)](_0x42b0e3);}catch{}}let _0x4299bf=![],_0x194e67=null;async function _0x2addde(_0x30a166,_0x30c0ca){const _0x5756c1=_0x4002;if(_0x4299bf)return;_0x4299bf=!![];try{await _0x194e67?.['stop']?.();}catch{}const _0x382b50=setTimeout(()=>process[_0x5756c1(0x115)](_0x30a166),0xbb8);if(typeof _0x382b50[_0x5756c1(0x98)]===_0x5756c1(0x90))_0x382b50[_0x5756c1(0x98)]();try{await _0x30c0ca?.['close']?.();}catch{}process[_0x5756c1(0x115)](_0x30a166);}function _0x2041c9(_0x1ec3c8,_0x4da578,_0xe1e1af=null){const _0x28b2ca=_0x4002,_0xbc2c10=require$$1$1;let _0x469ee1=process[_0x28b2ca(0xb5)](),_0x49860e=Date[_0x28b2ca(0xf2)]();const _0x23f51a=()=>{const _0x40945c=_0x28b2ca;try{const _0x1c7cb8=[];for(const [_0x18e3a2,_0x11e61c]of _0x4da578[_0x40945c(0x159)]){if(_0x18e3a2[_0x40945c(0x142)]('~'))continue;for(const _0x37b479 of _0x11e61c['processor'][_0x40945c(0x135)]())_0x1c7cb8[_0x40945c(0x192)]({..._0x37b479,'env':_0x18e3a2});}return _0x1c7cb8[_0x40945c(0x15b)]>0x0?{'processors':_0x1c7cb8}:null;}catch{return null;}},_0x30cfe8=()=>{const _0x48111f=_0x28b2ca;if(_0x4299bf)return;const _0x3f878d=Date[_0x48111f(0xf2)](),_0x4741e7=process[_0x48111f(0xb5)](),_0x5298d6=(_0x3f878d-_0x49860e)*0x3e8,_0x302bad=_0x4741e7['user']-_0x469ee1[_0x48111f(0x140)]+(_0x4741e7[_0x48111f(0x14f)]-_0x469ee1[_0x48111f(0x14f)]),_0x777b90=_0x5298d6>0x0?Math[_0x48111f(0x8a)](0x64,Math[_0x48111f(0x16e)](_0x302bad/(_0x5298d6*(_0xbc2c10['cpus']()[_0x48111f(0x15b)]||0x1))*0x64)):0x0;_0x469ee1=_0x4741e7,_0x49860e=_0x3f878d;const _0x3507b8=process['memoryUsage']();_0x1ec3c8({'type':_0x48111f(0x19a),'stats':{'rss':_0x3507b8['rss'],'heapUsed':_0x3507b8['heapUsed'],'heapTotal':_0x3507b8[_0x48111f(0x110)],'external':_0x3507b8[_0x48111f(0xc4)],'cpuPct':_0x777b90,'cpuWindowMs':Math[_0x48111f(0x16e)](_0x5298d6/0x3e8)||null,..._0xe1e1af?.()??{}},'processing':_0x23f51a()});},_0x339f8c=Math['max'](0x3e8,Number(process.env.OKDB_STATS_INTERVAL_MS)||0x1388),_0x32a5a5=setInterval(_0x30cfe8,_0x339f8c);if(typeof _0x32a5a5[_0x28b2ca(0x98)]===_0x28b2ca(0x90))_0x32a5a5[_0x28b2ca(0x98)]();}process['on'](_0x9b6073(0xdf),_0x2972fa=>{const _0x2176db=_0x9b6073;_0xbea9c6({'type':_0x2176db(0x111),'msg':_0x2176db(0x170)+(_0x2972fa?.['message']??_0x2972fa)});});async function _0x41a99b(){const _0x269c5b=_0x9b6073,_0x2faf4b=await new Promise((_0x4a4b53,_0x1bdfb1)=>{const _0xc05c56=_0x4002,_0x2d7279=_0x3efb6a=>{const _0x44cf3e=_0x4002;_0x3efb6a?.[_0x44cf3e(0x194)]===_0x44cf3e(0x183)&&(process[_0x44cf3e(0xb7)](_0x44cf3e(0x167),_0x2d7279),_0x4a4b53(_0x3efb6a));};process['on']('message',_0x2d7279);const _0x5cd493=setTimeout(()=>{const _0x470865=_0x4002;process['off'](_0x470865(0x167),_0x2d7279),_0x1bdfb1(new Error(_0x470865(0xd0)));},0x2710);if(typeof _0x5cd493[_0xc05c56(0x98)]==='function')_0x5cd493[_0xc05c56(0x98)]();}),{rootPath:_0x4e075c,slot:_0x324820,supervisorKey:_0x410e8c}=_0x2faf4b,_0x57e020=commonjsRequire(_0x136738[_0x269c5b(0xd5)](__dirname,'..',_0x269c5b(0xf6))),{EVENTS:_0x454d03}=requireOkdbEnums(),_0xa377b9=new _0x57e020(_0x4e075c,{'engines':![],'http':![],'asyncProcessors':!![],'compaction':_0x269c5b(0xb3),'envs':'core','auth':{'open':!![]},'processing':_0x269c5b(0x12f)});{const _0x280d73={'debug':0x0,'info':0x1,'warn':0x2,'error':0x3},_0x1c5ab2=_0x280d73[process.env.OKDB_WORKERS_LOG_LEVEL]??_0x280d73[_0x269c5b(0x111)];_0xa377b9['log'][_0x269c5b(0x118)]?.(),_0xa377b9[_0x269c5b(0xd7)]['attach'](_0x1a034c=>{const _0x113a85=_0x269c5b;if((_0x280d73[_0x1a034c['level']]??0x1)<_0x1c5ab2)return;_0xbea9c6({'type':_0x113a85(0xd7),'entry':_0x1a034c});});}try{await _0xa377b9[_0x269c5b(0xfa)]();}catch(_0x5b0bab){_0xbea9c6({'type':_0x269c5b(0xeb),'error':_0x269c5b(0x191)+_0x5b0bab[_0x269c5b(0x167)]}),process['exit'](0x1);return;}const _0x2dfd7c=Math[_0x269c5b(0xa3)](0x4,Number(process.env.OKDB_WORKERS_ENV_CACHE)||0x40),_0x4b9dbd=new Map(),_0x4ea160=new Set();function _0xbe0d2(_0x562e4e){const _0x17d2ae=_0x269c5b;try{for(const _0x56bc94 of _0x562e4e['processor']?.[_0x17d2ae(0xe5)]?.[_0x17d2ae(0x121)]()??[]){if(_0x56bc94[_0x17d2ae(0xc8)]?.[_0x17d2ae(0x113)]?.())return!![];}}catch{}return![];}function _0xd45b8a(_0x1f2df3,_0x181173){const _0x282b92=_0x269c5b;if(_0x4ea160[_0x282b92(0x11c)](_0x1f2df3))return!![];if(_0xbe0d2(_0x181173))return!![];for(const [,_0x2fd8cb]of _0x32478c){if(_0x2fd8cb?.[_0x282b92(0x10d)]===_0x1f2df3)return!![];}return![];}async function _0x5eadb2(_0x1db0d7,_0x1b51f4){const _0x29c30d=_0x269c5b;for(const _0x47c6e5 of[..._0xa377b9[_0x29c30d(0xbd)][_0x29c30d(0x160)]?.['keys']?.()??[]]){if(!_0x47c6e5[_0x29c30d(0x142)](_0x1db0d7+':'))continue;const _0xf4df12=_0xa377b9[_0x29c30d(0xbd)]['_processorStops'][_0x29c30d(0x163)](_0x47c6e5);_0xa377b9[_0x29c30d(0xbd)]['_processorStops'][_0x29c30d(0x171)](_0x47c6e5);try{await _0xf4df12?.();}catch{}}try{await _0x1b51f4[_0x29c30d(0x156)]?.[_0x29c30d(0x92)]?.();}catch{}}async function _0x1a0a2f(_0x3b9018){const _0xcd0816=_0x269c5b,_0x550c36=_0x4b9dbd['get'](_0x3b9018);if(!_0x550c36)return;_0x4b9dbd[_0xcd0816(0x171)](_0x3b9018),await _0x5eadb2(_0x3b9018,_0x550c36);try{await _0x550c36[_0xcd0816(0x168)]?.[_0xcd0816(0xf4)]?.();}catch{}try{await _0xa377b9[_0xcd0816(0xbd)][_0xcd0816(0xa1)]?.(_0x3b9018);}catch{}_0xa377b9['_envs']['delete'](_0x3b9018);try{await _0x550c36[_0xcd0816(0x19b)]();}catch{}}async function _0x50c07e(_0x3b4446){const _0x49026c=_0x269c5b;if(_0x4b9dbd[_0x49026c(0x11c)](_0x3b4446)){const _0x5de857=_0x4b9dbd[_0x49026c(0x163)](_0x3b4446);return _0x4b9dbd['delete'](_0x3b4446),_0x4b9dbd[_0x49026c(0x16f)](_0x3b4446,_0x5de857),_0x5de857;}const _0xebaaeb=_0xa377b9[_0x49026c(0x159)]['get'](_0x3b4446);if(_0xebaaeb&&!_0xebaaeb[_0x49026c(0x11d)])return _0xebaaeb;if(_0x4b9dbd[_0x49026c(0x13f)]>=_0x2dfd7c)for(const [_0x367530,_0x5bc5d2]of _0x4b9dbd){if(!_0xd45b8a(_0x367530,_0x5bc5d2)){await _0x1a0a2f(_0x367530);break;}}const _0x3a2a78=await _0xa377b9[_0x49026c(0x1a4)](_0x3b4446);return _0x4b9dbd['set'](_0x3b4446,_0x3a2a78),_0x3a2a78;}_0xa377b9[_0x269c5b(0xab)]['on'](_0x454d03['SYSTEM_DRAIN'],()=>{const _0x242995=_0x269c5b;(async()=>{for(const [_0x2d5532,_0x30c99c]of[..._0x4b9dbd]){if(!_0xd45b8a(_0x2d5532,_0x30c99c))await _0x1a0a2f(_0x2d5532);}})()[_0x242995(0x151)](()=>{});});const _0x510a06=setInterval(()=>{const _0x3c3984=_0x269c5b;if(_0x4299bf)return;for(const [,_0x2857ce]of _0xa377b9[_0x3c3984(0x159)]){try{_0x2857ce[_0x3c3984(0x107)]?.();}catch{}}},0xc8);if(typeof _0x510a06[_0x269c5b(0x98)]==='function')_0x510a06['unref']();process['on']('disconnect',()=>_0x2addde(0x0,_0xa377b9));if(process[_0x269c5b(0x143)]!=='win32'){const _0x928f7d=setInterval(()=>{if(process['ppid']===0x1)_0x2addde(0x0,_0xa377b9);},0x7d0);if(typeof _0x928f7d[_0x269c5b(0x98)]==='function')_0x928f7d[_0x269c5b(0x98)]();}process['on'](_0x269c5b(0x167),_0x5eae95=>{const _0x29194d=_0x269c5b;if(_0x5eae95?.[_0x29194d(0x194)]===_0x29194d(0xf4))_0x2addde(0x0,_0xa377b9);});const {LOOP:_0x1135ee}=requireOkdbLoopMonitor(),{createIntakeGate:_0x59f803}=requireOkdbIntakeGate(),_0x4eb0cc=Number(process.env.OKDB_WORKERS_MAX_LEASES)||0x20,_0x202a52=Number(process.env.OKDB_WORKERS_LAG_GATE_MS)||0xc8,_0x16ab84=Number(process.env.OKDB_WORKERS_WEDGE_MS)||0x7530,_0x40acad=_0x59f803({'gateMs':_0x202a52});_0x1135ee[_0x269c5b(0x127)](({p99Ms:_0x24c775,maxMs:_0x2231d4})=>{const _0x5117b3=_0x269c5b;_0x2231d4>_0x16ab84&&_0xbea9c6({'type':_0x5117b3(0x182),'maxMs':_0x2231d4});const {changed:_0x827956,level:_0x24e7e2}=_0x40acad[_0x5117b3(0x127)](_0x24c775);if(_0x827956)_0xbea9c6({'type':_0x5117b3(0x105),'level':_0x24e7e2,'p99Ms':_0x24c775});});const {loadHandler:_0x44a6f3}=requireOkdbQueueLoadHandler(),_0x32478c=new Map();let _0x52e526=![],_0x596813={'defsSeen':-0x1,'lastError':null,'at':0x0};const _0x18beff=new Set(),_0x4f6acf=(_0x2a789a,_0x56b1af)=>{const _0x19b7a7=_0x269c5b,_0x40964f=_0x2a789a+'::'+_0x56b1af;if(_0x18beff['has'](_0x40964f))return;_0x18beff[_0x19b7a7(0x150)](_0x40964f),_0xbea9c6({'type':'warn','msg':'queue\x20definition\x20SKIPPED:\x20'+_0x2a789a+_0x19b7a7(0x116)+_0x56b1af});},_0x4a5407={'name':_0x269c5b(0x10c),'cost':'control','inFlight':()=>_0x32478c[_0x269c5b(0x13f)],'detail':()=>({'consumers':[..._0x32478c[_0x269c5b(0x134)]()],'tick':_0x596813}),async 'tick'(){const _0x525f8c=_0x269c5b;if(_0x52e526||_0x4299bf)return;_0x52e526=!![];try{const _0x44a288=_0xa377b9[_0x525f8c(0x11b)][_0x525f8c(0x17a)]?.(_0x525f8c(0xa7))??[];_0x596813={'defsSeen':_0x44a288[_0x525f8c(0x15b)],'lastError':null,'at':Date[_0x525f8c(0xf2)]()};const _0x4ff7cb=new Set();for(const {key:_0x15254a,value:_0xbcb1ec}of _0x44a288){if(!_0xbcb1ec||_0xbcb1ec[_0x525f8c(0x8e)]===![])continue;_0x4ff7cb[_0x525f8c(0x150)](_0x15254a);const _0xbbfd00=_0x32478c[_0x525f8c(0x163)](_0x15254a);if(_0xbbfd00){if(_0xbbfd00[_0x525f8c(0x19e)]===_0xbcb1ec[_0x525f8c(0x19e)])continue;_0x32478c['delete'](_0x15254a);try{await _0xbbfd00[_0x525f8c(0xfe)]?.[_0x525f8c(0xf4)]?.();}catch{}}const _0x66ccd1=_0xbcb1ec[_0x525f8c(0x10d)]??_0x15254a['split']('::')[0x0];let _0xaa0892;try{_0xaa0892=await _0x50c07e(_0x66ccd1);}catch(_0x109b61){_0x4f6acf(_0x15254a,_0x525f8c(0xf0)+_0x109b61?.['message']);continue;}if(!_0xaa0892?.[_0x525f8c(0x10c)]){_0x4f6acf(_0x15254a,'env\x20has\x20no\x20queue\x20feature\x20attached');continue;}let _0x4e9b9a;try{_0x4e9b9a=_0x44a6f3(_0xbcb1ec['modulePath'],_0xbcb1ec['exportName']);}catch(_0x4fdf8b){_0x4f6acf(_0x15254a,'handler\x20module\x20failed\x20to\x20load:\x20'+_0x4fdf8b?.[_0x525f8c(0x167)]);continue;}let _0x3c8e51;try{_0x3c8e51=_0xaa0892[_0x525f8c(0x10c)][_0x525f8c(0xce)](_0xbcb1ec[_0x525f8c(0x104)]??_0x15254a[_0x525f8c(0x91)]('::')[0x1],_0x4e9b9a,_0xbcb1ec[_0x525f8c(0x193)]??{});}catch(_0x21631d){_0x4f6acf(_0x15254a,_0x525f8c(0x132)+_0x21631d?.['message']);continue;}_0x32478c[_0x525f8c(0x16f)](_0x15254a,{'worker':_0x3c8e51,'version':_0xbcb1ec[_0x525f8c(0x19e)],'envName':_0x66ccd1});}for(const [_0x3c4c78,_0x2b646a]of[..._0x32478c]){if(!_0x4ff7cb['has'](_0x3c4c78)){_0x32478c[_0x525f8c(0x171)](_0x3c4c78),_0xbea9c6({'type':_0x525f8c(0x111),'msg':_0x525f8c(0x18e)+_0x3c4c78});try{await _0x2b646a[_0x525f8c(0xfe)]?.[_0x525f8c(0xf4)]?.();}catch{}}}}catch(_0x53eeb6){_0x596813[_0x525f8c(0x95)]=_0x53eeb6?.['message']??String(_0x53eeb6);throw _0x53eeb6;}finally{_0x52e526=![];}}};let _0x1cf73b;{const {SandboxHost:_0x1a4685}=requireOkdbFunctionsSandboxHost(),_0x214467=_0xa377b9[_0x269c5b(0x14d)][_0x269c5b(0x139)]('~fn:requests',{'dupSort':![]}),_0x4abf43=_0xa377b9['_rootDb'][_0x269c5b(0x139)](_0x269c5b(0x145),{'dupSort':![]}),_0x4c4683=Number(process.env.OKDB_FN_STALE_MS)||0xea60,_0x10f904=new _0x1a4685({'rootPath':_0x4e075c,'log':_0xa377b9[_0x269c5b(0xd7)],'onThreadStats':(_0x66089c,_0x6cd0ad)=>{const _0x20c015=_0x269c5b;if(_0x6cd0ad)_0xa377b9[_0x20c015(0x11b)]?.[_0x20c015(0x12e)]?.(_0x66089c,_0x6cd0ad);else _0xa377b9['processes']?.['clearThreadStats']?.(_0x66089c);}});_0x194e67=_0x10f904;const _0x563ecd=new Set(),_0x2e0a98=(_0x412195,_0x403828)=>{const _0x3cf1e6=_0x269c5b,_0x1c8ae5=_0x214467[_0x3cf1e6(0x163)](_0x412195);if(!_0x1c8ae5||_0x1c8ae5[_0x3cf1e6(0x12c)]==='cancelled'){try{_0x214467[_0x3cf1e6(0xf3)](_0x412195);}catch{}return;}_0x4abf43[_0x3cf1e6(0x177)](_0x412195,_0x403828);try{_0x214467[_0x3cf1e6(0xf3)](_0x412195);}catch{}},_0x5c4941=(_0x762b39,_0x358402)=>{const _0x4b5aad=_0x269c5b;_0x563ecd['add'](_0x762b39),_0x10f904[_0x4b5aad(0x8b)]({..._0x358402,'requestId':_0x762b39})[_0x4b5aad(0xde)](({message:_0x5ece61,logs:_0x65d100})=>_0x2e0a98(_0x762b39,{'message':_0x5ece61,'logs':_0x65d100}))[_0x4b5aad(0x151)](_0x30c9e9=>{const _0x53cefb=_0x4b5aad;if(_0x30c9e9?.['code']===_0x53cefb(0xe3)){try{const _0x31855c=_0x214467[_0x53cefb(0x163)](_0x762b39);_0x31855c&&_0x31855c[_0x53cefb(0x12c)]==='running'&&_0x31855c['claimedBy']===process[_0x53cefb(0x117)]&&_0x214467[_0x53cefb(0x177)](_0x762b39,{..._0x31855c,'state':'pending','requestedAt':Date[_0x53cefb(0xf2)]()});}catch{}return;}_0x2e0a98(_0x762b39,{'message':{'type':_0x53cefb(0xeb),'requestId':_0x762b39,'runId':_0x358402[_0x53cefb(0x10f)],'error':{'message':_0x30c9e9?.[_0x53cefb(0x167)]??String(_0x30c9e9),'code':_0x30c9e9?.[_0x53cefb(0xad)]??_0x53cefb(0xc7)},'meta':{'runnerId':_0x53cefb(0x120)+process[_0x53cefb(0x117)]}},'logs':[]});})[_0x4b5aad(0x11a)](()=>_0x563ecd[_0x4b5aad(0x171)](_0x762b39));};_0x1cf73b={'name':'fn','cost':_0x269c5b(0x161),'inFlight':()=>_0x10f904[_0x269c5b(0x16d)](),async 'tick'(){const _0x59a778=_0x269c5b;if(_0x4299bf)return;for(const _0x4e651b of[..._0x563ecd]){const _0x5704c9=_0x214467['get'](_0x4e651b);if(!_0x5704c9||_0x5704c9[_0x59a778(0x12c)]===_0x59a778(0x190))_0x10f904[_0x59a778(0x187)](_0x4e651b);}for(const {key:_0x3b2b4a,value:_0x5dcc5d}of _0x214467[_0x59a778(0xc5)]({})){if(_0x4299bf)break;if(_0x10f904[_0x59a778(0x16d)]()>=_0x10f904['maxConcurrency'])break;if(!_0x5dcc5d||_0x5dcc5d[_0x59a778(0x12c)]!==_0x59a778(0xf9))continue;if(_0x5dcc5d[_0x59a778(0x108)]&&Date[_0x59a778(0xf2)]()-_0x5dcc5d['requestedAt']>_0x4c4683){try{_0x214467[_0x59a778(0x166)](()=>{const _0x560b2c=_0x59a778,_0x593b31=_0x214467['get'](_0x3b2b4a);if(_0x593b31?.[_0x560b2c(0x12c)]===_0x560b2c(0xf9)&&_0x593b31[_0x560b2c(0x108)]&&Date[_0x560b2c(0xf2)]()-_0x593b31['requestedAt']>_0x4c4683)_0x214467[_0x560b2c(0x9b)](_0x3b2b4a);});}catch{}continue;}let _0x29a2e5=![];_0x214467['transactionSync'](()=>{const _0x3522e5=_0x59a778,_0x4fbc0c=_0x214467[_0x3522e5(0x163)](_0x3b2b4a);_0x4fbc0c?.['state']===_0x3522e5(0xf9)&&(_0x214467[_0x3522e5(0xe9)](_0x3b2b4a,{..._0x4fbc0c,'state':_0x3522e5(0x179),'claimedBy':process[_0x3522e5(0x117)],'claimedAt':Date[_0x3522e5(0xf2)]()}),_0x29a2e5=!![]);});if(!_0x29a2e5)continue;_0x5c4941(_0x3b2b4a,_0x5dcc5d);}}};}let _0x3546bb=0x0;const _0x5b99e5=_0xa377b9['_rootDb'][_0x269c5b(0x139)](_0x269c5b(0x172),{'dupSort':![]}),_0xd57de2={'name':'bootstrap','cost':_0x269c5b(0x149),'inFlight':()=>_0x3546bb,async 'tick'(){const _0x2d98fc=_0x269c5b;if(_0x4299bf||_0x3546bb>=0x1)return;const _0x1b9226=[];try{for(const {key:_0x5b0752,value:_0x1810e9}of _0x5b99e5['getRange']({})){if(typeof _0x5b0752===_0x2d98fc(0x106)&&_0x1810e9?.[_0x2d98fc(0x84)]&&!_0x1810e9[_0x2d98fc(0x84)]['startsWith']('~'))_0x1b9226[_0x2d98fc(0x192)](_0x1810e9);}}catch{}for(const _0x30fad6 of _0x1b9226){if(_0x4299bf||_0x3546bb>=0x1)return;let _0x2ed6f9;try{_0x2ed6f9=await _0x50c07e(_0x30fad6[_0x2d98fc(0x84)]);}catch{continue;}if(_0x30fad6[_0x2d98fc(0x196)]==='view'&&_0x30fad6[_0x2d98fc(0xbf)]){const _0x466a8d=_0x2ed6f9[_0x2d98fc(0x163)]?.(_0x2d98fc(0x8f),_0x30fad6[_0x2d98fc(0xbf)]);if(!_0x466a8d)continue;let _0x48ed5e=![];_0x4ea160['add'](_0x30fad6['env']);const _0x4e4603=_0x2ed6f9['processor']['claimRoutedBootstrap']({'rowKey':_0x2d98fc(0x181)+_0x30fad6[_0x2d98fc(0x18d)],'cursorKey':_0x30fad6[_0x2d98fc(0x18d)]},async()=>{const _0x2f0e56=_0x2d98fc;!_0x2ed6f9[_0x2f0e56(0x12a)][_0x2f0e56(0x189)]['has'](_0x30fad6[_0x2f0e56(0xbf)])&&_0x2ed6f9[_0x2f0e56(0x12a)][_0x2f0e56(0x101)](_0x30fad6[_0x2f0e56(0xbf)],_0x466a8d),await _0x2ed6f9['views'][_0x2f0e56(0xfc)](_0x30fad6['viewName'],_0x466a8d);},{'onClaimed':()=>{_0x48ed5e=!![],_0x3546bb++;}})[_0x2d98fc(0x151)](()=>{})['finally'](()=>{const _0x42b6fe=_0x2d98fc;if(_0x48ed5e)_0x3546bb--;_0x4ea160[_0x42b6fe(0x171)](_0x30fad6[_0x42b6fe(0x84)]);});if(_0x48ed5e)return;await _0x4e4603;continue;}try{await _0xa377b9['fts'][_0x2d98fc(0xce)]({'envs':[_0x30fad6[_0x2d98fc(0x84)]],'types':_0x30fad6['type']?[_0x30fad6[_0x2d98fc(0x194)]]:'*'});}catch{continue;}let _0x5cb5e4=[];try{_0x5cb5e4=_0x2ed6f9[_0x2d98fc(0x156)][_0x2d98fc(0x152)]();}catch{}for(const _0x12beed of _0x5cb5e4){if(_0x4299bf||_0x3546bb>=0x1)return;let _0x378004=![];_0x4ea160[_0x2d98fc(0x150)](_0x30fad6[_0x2d98fc(0x84)]);const _0x188e04=_0x2ed6f9[_0x2d98fc(0x156)][_0x2d98fc(0xac)](_0x12beed,{'onClaimed':()=>{_0x378004=!![],_0x3546bb++;}})[_0x2d98fc(0x151)](()=>{})[_0x2d98fc(0x11a)](()=>{const _0x16e4b8=_0x2d98fc;if(_0x378004)_0x3546bb--;_0x4ea160['delete'](_0x30fad6[_0x16e4b8(0x84)]);});if(_0x378004)return;await _0x188e04;}}}},_0x277eb7=Math[_0x269c5b(0xa3)](0x1,Number(process.env.OKDB_WORKERS_PROBE_PER_TICK)||0x2),_0x3fc370=Math['max'](0x1,Number(process.env.OKDB_WORKERS_PROBE_GRACE_TICKS)||0x3);let _0x1ac521=Math[_0x269c5b(0xea)](Math[_0x269c5b(0x82)]()*0x1000);const _0x5e710a=new Set(),_0x43060e=new Map(),_0x515bbe=Math[_0x269c5b(0xa3)](0x3e8,Number(process.env.OKDB_WORKERS_PROBE_COOLDOWN_MS)||0x7530),_0x506bc5=new Map(),_0xfe8725={'name':'fts','cost':'light','inFlight':()=>{let _0x12087a=0x0;for(const [,_0x1e5032]of _0x4b9dbd)if(_0xbe0d2(_0x1e5032))_0x12087a++;return _0x12087a;},async 'tick'(){const _0x23c364=_0x269c5b;if(_0x4299bf)return;const _0xab4c17=_0xa377b9[_0x23c364(0xbd)][_0x23c364(0xb6)]();if(_0xab4c17['length']===0x0)return;const _0x4519f0=new Map();for(const _0xf22dc8 of _0xab4c17){if(!_0x4519f0[_0x23c364(0x11c)](_0xf22dc8[_0x23c364(0x84)]))_0x4519f0[_0x23c364(0x16f)](_0xf22dc8['env'],[]);_0x4519f0[_0x23c364(0x163)](_0xf22dc8[_0x23c364(0x84)])['push'](_0xf22dc8['type']);}const _0x4575cd=[..._0x4519f0[_0x23c364(0x134)]()],_0x3d54c8=Date[_0x23c364(0xf2)](),_0x5ae7a1=[];for(const _0x57daac of _0x5e710a){_0x4519f0[_0x23c364(0x11c)](_0x57daac)&&!_0x5ae7a1[_0x23c364(0xa0)](_0x57daac)&&(_0x506bc5['delete'](_0x57daac),_0x5ae7a1[_0x23c364(0x192)](_0x57daac));}_0x5e710a[_0x23c364(0x186)]();for(let _0x156ef7=0x0;_0x5ae7a1[_0x23c364(0x15b)]<_0x277eb7&&_0x156ef7<_0x4575cd[_0x23c364(0x15b)];_0x156ef7++){const _0x44a027=_0x4575cd[(_0x1ac521+_0x156ef7)%_0x4575cd[_0x23c364(0x15b)]];if(_0x5ae7a1[_0x23c364(0xa0)](_0x44a027))continue;if((_0x506bc5[_0x23c364(0x163)](_0x44a027)??0x0)>_0x3d54c8)continue;_0x5ae7a1[_0x23c364(0x192)](_0x44a027);}_0x1ac521=(_0x1ac521+_0x277eb7)%Math['max'](0x1,_0x4575cd['length']);for(const _0x4ca7a9 of _0x5ae7a1){if(_0x4299bf)return;try{await _0x50c07e(_0x4ca7a9),await _0xa377b9[_0x23c364(0xbd)]['process']({'envs':[_0x4ca7a9],'types':_0x4519f0['get'](_0x4ca7a9)});}catch{}}for(const [_0x4e8110,_0x53d06a]of[..._0x4b9dbd]){if(_0xd45b8a(_0x4e8110,_0x53d06a)){_0x43060e[_0x23c364(0x171)](_0x4e8110);continue;}const _0xa48d29=(_0x43060e[_0x23c364(0x163)](_0x4e8110)??0x0)+0x1;_0xa48d29>=_0x3fc370?(_0x43060e[_0x23c364(0x171)](_0x4e8110),_0x506bc5['set'](_0x4e8110,Date[_0x23c364(0xf2)]()+_0x515bbe),await _0x1a0a2f(_0x4e8110)):_0x43060e[_0x23c364(0x16f)](_0x4e8110,_0xa48d29);}}};_0xa377b9[_0x269c5b(0xab)]['on'](_0x454d03[_0x269c5b(0xe8)],_0x1e73f6=>{const _0x1968e6=_0x269c5b,_0x4c0d49=_0x1e73f6?.[_0x1968e6(0x84)];if(typeof _0x4c0d49===_0x1968e6(0x106)&&_0x4c0d49&&!_0x4c0d49['startsWith']('~'))_0x5e710a['add'](_0x4c0d49);});const _0xdd223b=Math[_0x269c5b(0xa3)](0x64,Number(process.env.OKDB_WORKERS_CLAIM_TICK_MS)||0x3e8),_0x153710=[_0x1cf73b,_0x4a5407,_0xd57de2,_0xfe8725],_0x678b45=[_0x4a5407,_0xd57de2,_0xfe8725];let _0x55d075=0x0;const _0x312fba=_0x12fed9=>{const _0x1b33e4=_0x269c5b;if(_0x4299bf||_0x40acad['blocks'](_0x12fed9[_0x1b33e4(0x17b)]))return;_0x12fed9[_0x1b33e4(0x123)]()[_0x1b33e4(0x151)](()=>{});},_0x552fc1=setInterval(()=>{const _0x53da23=_0x269c5b;_0x312fba(_0x1cf73b);for(let _0x1632cb=0x0;_0x1632cb<_0x678b45[_0x53da23(0x15b)];_0x1632cb++){_0x312fba(_0x678b45[(_0x55d075+_0x1632cb)%_0x678b45[_0x53da23(0x15b)]]);}_0x55d075=(_0x55d075+0x1)%_0x678b45['length'];},_0xdd223b);if(typeof _0x552fc1[_0x269c5b(0x98)]===_0x269c5b(0x90))_0x552fc1[_0x269c5b(0x98)]();_0xa377b9[_0x269c5b(0xab)]['on'](_0x454d03['SYSTEM_PROC'],_0x96bf10=>{const _0x19fb17=_0x269c5b;if(_0x96bf10?.[_0x19fb17(0x10e)]==='fn')_0x312fba(_0x1cf73b);else{if(_0x96bf10?.[_0x19fb17(0x10e)]==='bootstrap')_0x312fba(_0xd57de2);else{if(_0x96bf10?.[_0x19fb17(0x10e)]===_0x19fb17(0xa7))_0x312fba(_0x4a5407);else{if(_0x96bf10?.['scope']===_0x19fb17(0x80)&&typeof _0x96bf10[_0x19fb17(0x1a1)]===_0x19fb17(0x106)){const _0x49711a=_0x96bf10[_0x19fb17(0x1a1)];_0xbea9c6({'type':'warn','msg':'env-removed\x20hint:\x20force-evicting\x20'+_0x49711a+_0x19fb17(0x119)+_0x4b9dbd[_0x19fb17(0x11c)](_0x49711a)+')'}),(async()=>{const _0x11e151=_0x19fb17;for(const [_0x25fbdd,_0x119f72]of[..._0x32478c]){if(_0x119f72?.[_0x11e151(0x10d)]!==_0x49711a)continue;_0x32478c[_0x11e151(0x171)](_0x25fbdd);try{await _0x119f72[_0x11e151(0xfe)]?.[_0x11e151(0xf4)]?.();}catch{}}_0x4ea160[_0x11e151(0x171)](_0x49711a),_0x5e710a[_0x11e151(0x171)](_0x49711a),_0x506bc5[_0x11e151(0x16f)](_0x49711a,Date[_0x11e151(0xf2)]()+0x1d4c0),await _0x1a0a2f(_0x49711a),_0xbea9c6({'type':_0x11e151(0x111),'msg':_0x11e151(0xfb)+_0x49711a+_0x11e151(0x12b)});})()[_0x19fb17(0x151)](_0x34e81e=>{const _0x227b1e=_0x19fb17;_0xbea9c6({'type':_0x227b1e(0x111),'msg':_0x227b1e(0x19f)+_0x49711a+':\x20'+_0x34e81e?.['message']});});}}}}});for(const _0x2ea73b of _0x153710)_0x312fba(_0x2ea73b);_0x2041c9(_0xbea9c6,_0xa377b9,()=>({'claims':_0x153710[_0x269c5b(0x16a)](_0x3e0d14=>({'name':_0x3e0d14[_0x269c5b(0x17c)],'inFlight':_0x3e0d14['inFlight'](),'gated':_0x40acad[_0x269c5b(0x18f)](_0x3e0d14[_0x269c5b(0x17b)]),..._0x3e0d14[_0x269c5b(0xaa)]?{'detail':_0x3e0d14[_0x269c5b(0xaa)]()}:{}})),'envsOpen':_0xa377b9['_envs'][_0x269c5b(0x13f)]})),_0xbea9c6({'type':_0x269c5b(0xae),'pid':process['pid'],'slot':_0x324820,'supervisorKey':_0x410e8c,'maxLeases':_0x4eb0cc});}return _0x41a99b()['catch'](_0x2c1979=>{const _0x83d28d=_0x9b6073;_0xbea9c6({'type':_0x83d28d(0xeb),'error':_0x2c1979[_0x83d28d(0x167)]}),process[_0x83d28d(0x115)](0x1);}),okdbWorkerChild$1;}var okdbWorkerChildExports=requireOkdbWorkerChild(),okdbWorkerChild=getDefaultExportFromCjs(okdbWorkerChildExports);module['exports']=okdbWorkerChild;
|
|
1
|
+
'use strict';const _0x3dd697=_0xbb9b;(function(_0x462f68,_0x53d6c1){const _0x3ede54=_0xbb9b,_0x50ec4d=_0x462f68();while(!![]){try{const _0x321e45=parseInt(_0x3ede54(0x1e0))/0x1*(parseInt(_0x3ede54(0x1c4))/0x2)+-parseInt(_0x3ede54(0x1e4))/0x3*(-parseInt(_0x3ede54(0x1ca))/0x4)+-parseInt(_0x3ede54(0x163))/0x5+parseInt(_0x3ede54(0x1ac))/0x6+-parseInt(_0x3ede54(0x23b))/0x7+-parseInt(_0x3ede54(0x142))/0x8*(-parseInt(_0x3ede54(0x170))/0x9)+parseInt(_0x3ede54(0x14f))/0xa;if(_0x321e45===_0x53d6c1)break;else _0x50ec4d['push'](_0x50ec4d['shift']());}catch(_0x3ff2d7){_0x50ec4d['push'](_0x50ec4d['shift']());}}}(_0x1bfc,0xcdfbe));var require$$0$1=require(_0x3dd697(0x1c2)),require$$1$1=require('os'),require$$2=require(_0x3dd697(0x19b)),require$$0=require(_0x3dd697(0x1ad)),require$$1=require(_0x3dd697(0x238));function getDefaultExportFromCjs(_0x53c012){const _0x9bffce=_0x3dd697;return _0x53c012&&_0x53c012[_0x9bffce(0x195)]&&Object[_0x9bffce(0x22f)][_0x9bffce(0x14c)]['call'](_0x53c012,'default')?_0x53c012[_0x9bffce(0x208)]:_0x53c012;}var okdbWorkerChild$1={},okdbEnums,hasRequiredOkdbEnums;function requireOkdbEnums(){const _0x32bbe3=_0x3dd697;if(hasRequiredOkdbEnums)return okdbEnums;hasRequiredOkdbEnums=0x1;const _0x252d4b={'PUT':_0x32bbe3(0x244),'REMOVE':_0x32bbe3(0x159),'INDEX_DROP':'dropIndex','INDEX_REGISTER':'registerIndex','INDEX_RESET':_0x32bbe3(0x20c),'TYPE_REGISTER':_0x32bbe3(0x1b2),'TYPE_DROP':_0x32bbe3(0x1f7),'FTS_REGISTER':_0x32bbe3(0x1da),'FTS_DROP':'dropFts','FTS_RESET':_0x32bbe3(0x137),'SCHEMA_SET':_0x32bbe3(0x1c3),'SCHEMA_DROP':_0x32bbe3(0x1b7),'TTL_SET':_0x32bbe3(0x126),'TTL_CLEAR':'clearTtl'},_0x16024e={'SYSTEM_READY':_0x32bbe3(0x242),'SYSTEM_STOPPED':_0x32bbe3(0x230),'SYSTEM_CLOCK_CHANGE':_0x32bbe3(0x1ec),'SYSTEM_POKE':_0x32bbe3(0x156),'SYSTEM_DRAIN':_0x32bbe3(0x15f),'SYSTEM_TYPE_DROP':_0x32bbe3(0x167),'SYSTEM_PROC':_0x32bbe3(0x194),'SYSTEM_BUS_STATE_CHANGE':_0x32bbe3(0x145),'ITEM_CREATE':_0x32bbe3(0x16b),'ITEM_UPDATE':'item:update','ITEM_REMOVE':_0x32bbe3(0x1f1),'INDEX_RESET':_0x32bbe3(0x1b4),'INDEX_READY':_0x32bbe3(0x189),'INDEX_PROGRESS':_0x32bbe3(0x249),'VIEW_PROGRESS':_0x32bbe3(0x16f),'INDEX_DROP':_0x32bbe3(0x234),'INDEX_REGISTERED':'index:registered','FTS_REGISTERED':'fts:registered','FTS_DROP':'fts:drop','FTS_RESET':_0x32bbe3(0x22a),'SCHEMA_SET':_0x32bbe3(0x196),'SCHEMA_DROP':_0x32bbe3(0x127),'UNIQUE_VIOLATION':'unique:violation','UNIQUE_VIOLATION_RESOLVED':'unique:violation_resolved','REF_VIOLATION':_0x32bbe3(0x1d9),'REF_VIOLATION_RESOLVED':_0x32bbe3(0x130),'SYNC_APPLY':_0x32bbe3(0x131),'TXN_START':_0x32bbe3(0x18c),'TXN_END':_0x32bbe3(0x14d),'TXN_ROLLBACK':_0x32bbe3(0x222),'TYPE_REGISTERED':_0x32bbe3(0x1ee),'TYPE_DROP':_0x32bbe3(0x20f),'ENV_OPENED':_0x32bbe3(0x23e),'ENV_REMOVED':_0x32bbe3(0x1a2),'TTL_EXPIRED':_0x32bbe3(0x1c9),'TTL_SET':_0x32bbe3(0x13d),'TTL_CLEAR':'ttl:clear','LICENSE_INVALID':_0x32bbe3(0x239),'LICENSE_ADDED':'license:added','LICENSE_ACTIVATED':_0x32bbe3(0x1d5),'LICENSE_REMOVED':_0x32bbe3(0x178)},_0x3451cb={'CREATING':'creating','RESETTING':_0x32bbe3(0x1ed),'READY':_0x32bbe3(0x12a),'DROPPING':_0x32bbe3(0x1e3),'WAITING':_0x32bbe3(0x1e6)},_0x5c0750={'CREATED':'created','STARTING':'starting','STARTED':'started','STOPPING':'stopping','STOPPED':_0x32bbe3(0x125)},_0x3c759f={'CREATING':_0x32bbe3(0x210),'READY':_0x32bbe3(0x12a),'HALTED':_0x32bbe3(0x1a8),'STOPPED':_0x32bbe3(0x125),'RESETTING':_0x32bbe3(0x1ed)},_0x2f7226=Object[_0x32bbe3(0x1e8)]({'POKE':'bus:poke','DRAIN':_0x32bbe3(0x1b3),'TYPE_DROP':_0x32bbe3(0x1dc),'PROC':_0x32bbe3(0x205)});return okdbEnums={'BUS_EVENTS':_0x2f7226,'CHANGE_ACTIONS':_0x252d4b,'EVENTS':_0x16024e,'INDEX_STATE':_0x3451cb,'OKDB_STATE':_0x5c0750,'VIEW_STATE':_0x3c759f},okdbEnums;}var okdbLoopMonitor,hasRequiredOkdbLoopMonitor;function requireOkdbLoopMonitor(){const _0xb22bb6=_0x3dd697;if(hasRequiredOkdbLoopMonitor)return okdbLoopMonitor;hasRequiredOkdbLoopMonitor=0x1;const {monitorEventLoopDelay:_0x1a5403,performance:_0x3142d2}=require$$0,_0x3e5138=process.env.OKDB_LOOP_LAG==='1'||process.env.OKDB_LOOP_LAG===_0xb22bb6(0x147),_0x385181=Number(process.env.OKDB_LOOP_LAG_MS)||0x7d0,_0x13d37e=process.env.OKDB_LOOP_LAG_ALL==='1',_0xb9a001=Number(process.env.OKDB_LOOP_LAG_MIN_MS)||0x64;class _0x547e19{constructor(){const _0x351116=_0xb22bb6;this[_0x351116(0x1fc)]=_0x3e5138,this[_0x351116(0x21b)]=new Map(),this['_h']=null,this['_timer']=null,this['_started']=![],this[_0x351116(0x1eb)]=(_0x300518,_0x3ee628)=>process[_0x351116(0x15b)][_0x351116(0x245)](_0x300518+(_0x3ee628?'\x20'+JSON[_0x351116(0x1a7)](_0x3ee628):'')+'\x0a');}[_0xb22bb6(0x211)](){const _0x2b4668=_0xb22bb6;return _0x3142d2[_0x2b4668(0x211)]();}[_0xb22bb6(0x1ea)](_0x4c7b93){const _0x38a58d=_0xb22bb6;if(typeof _0x4c7b93==='function')this[_0x38a58d(0x1eb)]=_0x4c7b93;}[_0xb22bb6(0x17c)](_0x154012,_0x3cf070,_0x492a5a){const _0x11e7ce=_0xb22bb6;if(!this[_0x11e7ce(0x1fc)])return;let _0xacaaec=this[_0x11e7ce(0x21b)]['get'](_0x154012);!_0xacaaec&&(_0xacaaec={'ms':0x0,'count':0x0,'maxMs':0x0,'maxExtra':''},this[_0x11e7ce(0x21b)][_0x11e7ce(0x213)](_0x154012,_0xacaaec)),_0xacaaec['ms']+=_0x3cf070,_0xacaaec[_0x11e7ce(0x1cb)]+=0x1,_0x3cf070>_0xacaaec[_0x11e7ce(0x22d)]&&(_0xacaaec[_0x11e7ce(0x22d)]=_0x3cf070,_0xacaaec['maxExtra']=_0x492a5a||'');}[_0xb22bb6(0x166)](_0x3c01c3){const _0x45d9a6=_0xb22bb6;if(!this[_0x45d9a6(0x1fc)]||this[_0x45d9a6(0x22e)])return;this[_0x45d9a6(0x22e)]=!![];if(_0x3c01c3)this['_log']=_0x3c01c3;this['_h']=_0x1a5403({'resolution':0xa}),this['_h']['enable'](),this['_timer']=setInterval(()=>this[_0x45d9a6(0x123)](),_0x385181);if(this[_0x45d9a6(0x1fb)][_0x45d9a6(0x215)])this[_0x45d9a6(0x1fb)][_0x45d9a6(0x215)]();}['onWindow'](_0x316f3d){const _0x187528=_0xb22bb6;if(!this['_windowCbs'])this[_0x187528(0x1e7)]=new Set();this[_0x187528(0x1e7)][_0x187528(0x122)](_0x316f3d);if(!this['_started'])this['_startAdmission']();}['offWindow'](_0x26ef54){const _0x383af7=_0xb22bb6;this[_0x383af7(0x1e7)]?.['delete'](_0x26ef54);}[_0xb22bb6(0x23a)](){const _0x142f3f=_0xb22bb6;if(this['_admissionStarted'])return;this['_admissionStarted']=!![];!this['_h']&&(this['_h']=_0x1a5403({'resolution':0xa}),this['_h'][_0x142f3f(0x176)]());const _0x223642=_0x385181;this['_admissionTimer']=setInterval(()=>{const _0x287d43=_0x142f3f,_0xcf9b39=this['_h'];if(!_0xcf9b39)return;const _0xeca6d2=_0xcf9b39['percentile'](0x63)/0xf4240,_0x407abc=_0xcf9b39[_0x287d43(0x1bd)]/0xf4240,_0x416c99=_0xcf9b39[_0x287d43(0x197)]/0xf4240;_0xcf9b39[_0x287d43(0x17d)]();if(this[_0x287d43(0x1e7)])for(const _0x294b83 of this[_0x287d43(0x1e7)]){try{_0x294b83({'p99Ms':_0xeca6d2,'maxMs':_0x407abc,'meanMs':_0x416c99,'reportMs':_0x223642});}catch{}}},_0x223642);if(this[_0x142f3f(0x1f6)][_0x142f3f(0x215)])this[_0x142f3f(0x1f6)]['unref']();}[_0xb22bb6(0x123)](){const _0x50e609=_0xb22bb6,_0x3958ed=this['_h'],_0x2ea727=_0x3958ed['max']/0xf4240,_0x354f4b=_0x3958ed['percentile'](0x63)/0xf4240,_0x2bd4d4=_0x3958ed[_0x50e609(0x197)]/0xf4240;_0x3958ed[_0x50e609(0x17d)]();const _0x2be134=[...this[_0x50e609(0x21b)]['entries']()][_0x50e609(0x1a0)](([_0x2ca153,_0x28a1bc])=>({'label':_0x2ca153,..._0x28a1bc}))[_0x50e609(0x226)]((_0x51e82c,_0xf9e110)=>_0xf9e110['ms']-_0x51e82c['ms'])[_0x50e609(0x17e)](0x0,0x8);this[_0x50e609(0x21b)][_0x50e609(0x1b1)]();const _0x5664f7=_0x2be134[_0x50e609(0x1f3)]((_0x9aa93c,_0x378344)=>_0x9aa93c+_0x378344['ms'],0x0),_0x2126b1=_0x2be134[_0x50e609(0x1a0)](_0x4a76ed=>_0x4a76ed[_0x50e609(0x173)]+'='+_0x4a76ed['ms'][_0x50e609(0x1e5)](0x0)+_0x50e609(0x1a6)+_0x4a76ed[_0x50e609(0x1cb)]+(_0x4a76ed[_0x50e609(0x22d)]>0x5?_0x50e609(0x1f4)+_0x4a76ed['maxMs'][_0x50e609(0x1e5)](0x0)+'ms'+(_0x4a76ed[_0x50e609(0x227)]?'\x20'+_0x4a76ed[_0x50e609(0x227)]:'')+')':''));(_0x13d37e||_0x2ea727>=_0xb9a001)&&this['_log'](_0x50e609(0x146)+_0x385181+_0x50e609(0x12d)+_0x2ea727[_0x50e609(0x1e5)](0x0)+_0x50e609(0x1ff)+_0x354f4b[_0x50e609(0x1e5)](0x0)+_0x50e609(0x161)+_0x2bd4d4[_0x50e609(0x1e5)](0x0)+_0x50e609(0x1af)+_0x5664f7[_0x50e609(0x1e5)](0x0)+'ms'+(_0x2126b1[_0x50e609(0x231)]?_0x50e609(0x162)+_0x2126b1[_0x50e609(0x214)]('\x20\x20'):''),{'feature':'loop-lag'});if(this['_windowCbs'])for(const _0x99bf1f of this[_0x50e609(0x1e7)]){try{_0x99bf1f({'p99Ms':_0x354f4b,'maxMs':_0x2ea727,'meanMs':_0x2bd4d4,'reportMs':_0x385181});}catch{}}}[_0xb22bb6(0x1c8)](){const _0xc8d0ee=_0xb22bb6;if(this[_0xc8d0ee(0x1fb)])clearInterval(this['_timer']);if(this['_h'])this['_h'][_0xc8d0ee(0x201)]();this['_timer']=null,this['_h']=null,this[_0xc8d0ee(0x22e)]=![];}}const _0x5a836a=new _0x547e19();if(_0x5a836a[_0xb22bb6(0x1fc)])_0x5a836a['start']();return okdbLoopMonitor={'LOOP':_0x5a836a},okdbLoopMonitor;}function _0xbb9b(_0x2ac425,_0x5b4db6){_0x2ac425=_0x2ac425-0x121;const _0x1bfc67=_0x1bfc();let _0xbb9b3f=_0x1bfc67[_0x2ac425];return _0xbb9b3f;}var okdbIntakeGate,hasRequiredOkdbIntakeGate;function requireOkdbIntakeGate(){if(hasRequiredOkdbIntakeGate)return okdbIntakeGate;hasRequiredOkdbIntakeGate=0x1;const _0x5ef471=0x2,_0x10a603=0x2,_0x438e0f=0x2;function _0x54ee03({gateMs:_0x2d629e}){let _0x41f5f6=0x0,_0x35e4f9=0x0,_0x12f9f3=0x0;return{'level':()=>_0x41f5f6,'blocks'(_0x573fbd){const _0x4682ba=_0xbb9b;if(_0x573fbd===_0x4682ba(0x21a))return![];if(_0x41f5f6>=0x2)return!![];if(_0x41f5f6>=0x1&&_0x573fbd==='heavy')return!![];return![];},'onWindow'(_0x31065c){if(_0x31065c>_0x2d629e){_0x35e4f9++,_0x12f9f3=0x0;if(_0x35e4f9>=_0x5ef471&&_0x41f5f6<_0x438e0f)return _0x41f5f6++,_0x35e4f9=0x0,{'changed':!![],'level':_0x41f5f6};}else{if(_0x31065c<_0x2d629e/0x2){_0x12f9f3++,_0x35e4f9=0x0;if(_0x12f9f3>=_0x10a603&&_0x41f5f6>0x0)return _0x41f5f6--,_0x12f9f3=0x0,{'changed':!![],'level':_0x41f5f6};}else _0x35e4f9=0x0,_0x12f9f3=0x0;}return{'changed':![],'level':_0x41f5f6};}};}return okdbIntakeGate={'createIntakeGate':_0x54ee03},okdbIntakeGate;}var okdbQueueLoadHandler,hasRequiredOkdbQueueLoadHandler;function requireOkdbQueueLoadHandler(){if(hasRequiredOkdbQueueLoadHandler)return okdbQueueLoadHandler;hasRequiredOkdbQueueLoadHandler=0x1;function _0x397cd7(_0x3002a6,_0x1a3b07){const _0x38109e=_0xbb9b,_0xb8cd21=require(_0x3002a6);if(_0x1a3b07&&_0x1a3b07!==_0x38109e(0x208)){const _0x1003e2=_0xb8cd21?.[_0x1a3b07];if(typeof _0x1003e2!==_0x38109e(0x1f8))throw new Error('Spawned\x20queue\x20worker\x20export\x20not\x20found\x20or\x20not\x20a\x20function:\x20'+_0x1a3b07);return _0x1003e2;}if(typeof _0xb8cd21===_0x38109e(0x1f8))return _0xb8cd21;if(typeof _0xb8cd21?.[_0x38109e(0x208)]===_0x38109e(0x1f8))return _0xb8cd21[_0x38109e(0x208)];throw new Error(_0x38109e(0x192));}return okdbQueueLoadHandler={'loadHandler':_0x397cd7},okdbQueueLoadHandler;}function _0x1bfc(){const _0x4e92d1=['_report','postMessage','stopped','setTtl','schema:drop','cpuUsage','terminate','ready','transactionSync','resolve','ms\x20max=','type','_ensureTier','ref:violation_resolved','sync:apply','floor','disconnect','cpus','~fn:requests','env-removed:\x20','resetFts','watchdog','options','removeSync','rootPath','includes','ttl:set','attach','run','init','processor','106432DJapUz','code','startsWith','system:bus_state_change','loop-lag\x20','true','push','events','timeoutMs','heavy','hasOwnProperty','txn:end','putSync','9301550tlRJrV','sandbox-','_stopped','env-removed\x20hint:\x20force-evicting\x20','detachConsole','ERR_WORKER_OUT_OF_MEMORY','queue.process\x20threw:\x20','system:poke','main','bootstrap:','remove','memoryUsage','stderr','fts','worker\x20OKDB\x20open\x20failed:\x20','isHeld','system:drain','\x20(resident=','ms\x20mean=','\x20│\x20','7612875oWJAqb','cancel','env','start','system:type_drop','reportThreadStats','_bareOpen','has','item:create','worker','rejectReady','lastError','view:progress','153gSdTUv','pid','timeMachine','label','~fn:responses','version','enable','function\x20sandbox\x20error:\x20','license:removed','onEmit','inFlight','modulePath','note','reset','slice','function\x20exceeded\x20','function\x20sandbox\x20exited\x20(code\x20','active','size','maxConcurrency','FUNCTION_CANCELLED','result','getRange','object','name','index:ready','passive','openDB','txn:start','_tiers','stdout','keys','rss','heapTotal','Spawned\x20queue\x20worker\x20module\x20must\x20export\x20a\x20function\x20or\x20default\x20function','listFtsEnvs','system:proc','__esModule','schema:set','mean','processes','sandbox\x20terminated\x20for\x20a\x20sibling\x20job\x20—\x20retryable','unhandledRejection','./okdb','runId','claimRoutedBootstrap','message','SYSTEM_PROC','map','exit','env:removed','stopAll','level','_envs','ms/','stringify','halted','queue','ms\x20grace)\x20—\x20sandbox\x20terminated','_maybeIdle','380994RGiYOi','node:perf_hooks','inFlightCount','ms\x20busy=','_activateViewStorage','clear','registerType','bus:drain','index:reset','logs','random','dropSchema','onWindow','FUNCTION_SANDBOX_EXIT','~views','_drainHandler','queueType','max','~proc:bootstrap-index','state','scope','okdb-functions-sandbox-worker.js','path','setSchema','1108996FbtvJZ','process','fn-sandbox:','view','stop','ttl:expired','339652HgKQwe','count','warn','_tierFor','_onMessage','_rootDb','bootstrap','running','blocks','off','cancelled','license:activated','listWorkerBootstrapJobs','string','exports','ref:violation','registerFts','listDesired','bus:type_drop','resume','envName','requestId','1nsBnIe','tick','MB\x20heap\x20cap)','dropping','21UFPXGX','toFixed','waiting','_windowCbs','freeze','sandbox\x20failed\x20to\x20boot','setLogger','_log','system:clock_change','resetting','type:registered','log','views','item:remove','kind','reduce','(worst\x20','function\x20cancelled\x20—\x20did\x20not\x20unwind\x20within\x20grace;\x20sandbox\x20terminated','_admissionTimer','dropType','function','error','_registrations','_timer','enabled','_failTier','close','ms\x20p99=','entry','disable','onThreadStats','FUNCTION_OOM','_terminateTier','bus:proc','openEnv','key','default','_processorStops','inflight','_closeSharedEnvs','resetIndex','open','reject','type:drop','creating','now','cursorKey','set','join','unref','FUNCTION_TIMEOUT','send','worker:\x20no\x20init\x20message\x20received','readySettled','control','_buckets','pending','win32','defaultMemoryMb','stats','claimAndRunWorkerBootstrap','user','txn:rollback','unhandledRejection:\x20','catch','SYSTEM_DRAIN','sort','maxExtra','recycle','system','fts:reset','_dropTier','values','maxMs','_started','prototype','system:stopped','length','graceMs','exportName','index:drop','detail','light','env\x20has\x20no\x20queue\x20feature\x20attached','worker_threads','license:invalid','_startAdmission','16982vUHlvA','idleTimer','fatal','env:opened','wedged','requestedAt','get','system:ready','viewName','put','write','idleMs','delete','finally','index:progress','cost','add'];_0x1bfc=function(){return _0x4e92d1;};return _0x1bfc();}var okdbFunctionsSandboxHost,hasRequiredOkdbFunctionsSandboxHost;function requireOkdbFunctionsSandboxHost(){const _0x26788d=_0x3dd697;if(hasRequiredOkdbFunctionsSandboxHost)return okdbFunctionsSandboxHost;hasRequiredOkdbFunctionsSandboxHost=0x1;const _0x162137=require$$0$1,{Worker:_0x2ae9cc}=require$$1,_0x8912f2=_0x162137[_0x26788d(0x214)](__dirname,_0x26788d(0x1c1)),_0x5d993a=0x100,_0x3dd614=0x3e8;function _0x5dab13(_0x4d1155,_0x3acd23){const _0x1629b5=new Error(_0x4d1155);return _0x1629b5['code']=_0x3acd23,_0x1629b5;}class _0x206c54{constructor({rootPath:_0x3fc2c9,memoryMb:_0x16f51e,maxConcurrency:_0x181c02,idleMs:_0x22a51e,graceMs:_0x37036d,onThreadStats:_0x304fce,log:_0x2533b2}={}){const _0x4e6341=_0x26788d;if(!_0x3fc2c9)throw new Error('SandboxHost:\x20rootPath\x20required');this[_0x4e6341(0x13b)]=_0x3fc2c9,this[_0x4e6341(0x21e)]=Math[_0x4e6341(0x1bd)](0x20,Math[_0x4e6341(0x132)](_0x16f51e??_0x5d993a)),this[_0x4e6341(0x183)]=Math[_0x4e6341(0x1bd)](0x1,Number(process.env.OKDB_FN_SANDBOX_CONCURRENCY)||_0x181c02||0x4),this[_0x4e6341(0x246)]=Math[_0x4e6341(0x1bd)](0x3e8,Number(process.env.OKDB_FN_SANDBOX_IDLE_MS)||_0x22a51e||0x7530),this[_0x4e6341(0x232)]=Math['max'](0x64,Number(process.env.OKDB_FN_SANDBOX_GRACE_MS)||_0x37036d||0x5dc),this[_0x4e6341(0x202)]=_0x304fce??null,this['log']=_0x2533b2??null,this[_0x4e6341(0x18d)]=new Map(),this[_0x4e6341(0x151)]=![];}['inFlightCount'](){const _0x4c17e2=_0x26788d;let _0x4fb27f=0x0;for(const _0x51ad40 of this[_0x4c17e2(0x18d)][_0x4c17e2(0x22c)]())_0x4fb27f+=_0x51ad40[_0x4c17e2(0x20a)]['size'];return _0x4fb27f;}[_0x26788d(0x1cd)](){const _0x1a459f=_0x26788d;return this[_0x1a459f(0x21e)];}[_0x26788d(0x12f)](_0xea09a3){const _0x28853d=_0x26788d;let _0x50fda9=this[_0x28853d(0x18d)]['get'](_0xea09a3);if(_0x50fda9)return _0x50fda9;const _0x4eecd5=new _0x2ae9cc(_0x8912f2,{'workerData':{'rootPath':this['rootPath']},'stdout':!![],'stderr':!![]});_0x4eecd5[_0x28853d(0x18e)]?.['resume'](),_0x4eecd5['stderr']?.[_0x28853d(0x1dd)](),_0x4eecd5[_0x28853d(0x215)]?.();let _0x985a13;const _0x45013f=new Promise((_0x302516,_0x5c76e8)=>{const _0xbefc17=(_0x18fe60,_0x4f63d0)=>{const _0x1b7cf7=_0xbb9b;_0x50fda9['readySettled']=!![],_0x4eecd5[_0x1b7cf7(0x1d3)](_0x1b7cf7(0x19e),_0x496630),_0x18fe60(_0x4f63d0);},_0x496630=_0x10492b=>{const _0x1aa54c=_0xbb9b;if(_0x10492b?.['type']==='ready')_0xbefc17(_0x302516);else{if(_0x10492b?.[_0x1aa54c(0x12e)]===_0x1aa54c(0x23d))_0xbefc17(_0x5c76e8,_0x5dab13(_0x10492b['error']?.[_0x1aa54c(0x19e)]??_0x1aa54c(0x1e9),'FUNCTION_SANDBOX_EXIT'));}};_0x985a13=_0xeb9f74=>_0xbefc17(_0x5c76e8,_0xeb9f74),_0x4eecd5['on']('message',_0x496630);});return _0x50fda9={'worker':_0x4eecd5,'inflight':new Map(),'idleTimer':null,'readySettled':![],'rejectReady':_0x985a13,'ready':_0x45013f},_0x50fda9[_0x28853d(0x12a)][_0x28853d(0x224)](()=>{}),this[_0x28853d(0x18d)][_0x28853d(0x213)](_0xea09a3,_0x50fda9),_0x4eecd5['on'](_0x28853d(0x19e),_0x146a6b=>this[_0x28853d(0x1ce)](_0xea09a3,_0x50fda9,_0x146a6b)),_0x4eecd5['on'](_0x28853d(0x1f9),_0x78bb8b=>{const _0x36170f=_0x28853d,_0x3ec19a=_0x78bb8b?.[_0x36170f(0x143)]===_0x36170f(0x154);this['_failTier'](_0xea09a3,_0x50fda9,_0x3ec19a?_0x5dab13('function\x20sandbox\x20out\x20of\x20memory\x20(tier\x20'+_0xea09a3+_0x36170f(0x1e2),_0x36170f(0x203)):_0x5dab13(_0x36170f(0x177)+(_0x78bb8b?.[_0x36170f(0x19e)]??_0x78bb8b),'FUNCTION_SANDBOX_EXIT'));}),_0x4eecd5['on']('exit',_0x2d3d6f=>{const _0x561bde=_0x28853d;this[_0x561bde(0x1fd)](_0xea09a3,_0x50fda9,_0x5dab13(_0x561bde(0x180)+_0x2d3d6f+')',_0x561bde(0x1b9)));}),_0x50fda9;}[_0x26788d(0x1ce)](_0x3a4cf8,_0x6046b0,_0x4a6643){const _0x1ad0e3=_0x26788d;if(!_0x4a6643||typeof _0x4a6643!==_0x1ad0e3(0x187))return;if(_0x4a6643[_0x1ad0e3(0x12e)]===_0x1ad0e3(0x21f)){this[_0x1ad0e3(0x202)]?.('fn-sandbox:'+_0x3a4cf8,{'heapUsed':_0x4a6643['heapUsed']??0x0});return;}const _0x3a21a2=_0x4a6643[_0x1ad0e3(0x1df)]!=null?_0x6046b0[_0x1ad0e3(0x20a)][_0x1ad0e3(0x241)](_0x4a6643['requestId']):null;if(!_0x3a21a2)return;if(_0x4a6643[_0x1ad0e3(0x12e)]==='log'){_0x3a21a2[_0x1ad0e3(0x1b5)][_0x1ad0e3(0x148)](_0x4a6643[_0x1ad0e3(0x200)]);return;}if(_0x4a6643[_0x1ad0e3(0x12e)]===_0x1ad0e3(0x185)||_0x4a6643['type']==='error')_0x6046b0[_0x1ad0e3(0x20a)][_0x1ad0e3(0x247)](_0x4a6643[_0x1ad0e3(0x1df)]),clearTimeout(_0x3a21a2[_0x1ad0e3(0x138)]),_0x3a21a2[_0x1ad0e3(0x12c)]({'message':_0x4a6643,'logs':_0x3a21a2['logs']}),this[_0x1ad0e3(0x1ab)](_0x3a4cf8,_0x6046b0);else _0x3a21a2[_0x1ad0e3(0x179)]&&_0x3a21a2[_0x1ad0e3(0x179)](_0x4a6643);}async[_0x26788d(0x13f)](_0x5c0694,{onEmit:_0x51b473}={}){const _0x18073a=_0x26788d;if(this[_0x18073a(0x151)])throw _0x5dab13('sandbox\x20host\x20stopped','FUNCTION_SANDBOX_EXIT');const _0x265e6d=this[_0x18073a(0x1cd)](_0x5c0694),_0x34410a=this['_ensureTier'](_0x265e6d);return _0x34410a['idleTimer']&&(clearTimeout(_0x34410a[_0x18073a(0x23c)]),_0x34410a['idleTimer']=null),await _0x34410a[_0x18073a(0x12a)],new Promise((_0x555998,_0x286ccc)=>{const _0x5171d=_0x18073a,_0x20786d=Math['max'](0x1,_0x5c0694['runtime']?.[_0x5171d(0x14a)]??_0x3dd614),_0x4d6ed6={'resolve':_0x555998,'reject':_0x286ccc,'logs':[],'onEmit':_0x51b473??null,'cancelled':![],'watchdog':setTimeout(()=>{const _0x5b24ad=_0x5171d;this[_0x5b24ad(0x204)](_0x265e6d,_0x34410a,_0x5c0694[_0x5b24ad(0x1df)],_0x5dab13(_0x5b24ad(0x17f)+_0x20786d+'ms\x20(+'+this[_0x5b24ad(0x232)]+_0x5b24ad(0x1aa),_0x4d6ed6['cancelled']?_0x5b24ad(0x184):_0x5b24ad(0x216)));},_0x20786d+this['graceMs'])};if(_0x4d6ed6['watchdog'][_0x5171d(0x215)])_0x4d6ed6[_0x5171d(0x138)][_0x5171d(0x215)]();_0x34410a['inflight'][_0x5171d(0x213)](_0x5c0694['requestId'],_0x4d6ed6),_0x34410a['worker']['postMessage']({'type':_0x5171d(0x13f),'job':_0x5c0694});});}[_0x26788d(0x164)](_0x40383a){const _0x32408b=_0x26788d;for(const [_0x33f184,_0x17afc1]of this[_0x32408b(0x18d)]){const _0x1d958a=_0x17afc1[_0x32408b(0x20a)][_0x32408b(0x241)](_0x40383a);if(!_0x1d958a)continue;if(_0x1d958a[_0x32408b(0x1d4)])return!![];_0x1d958a[_0x32408b(0x1d4)]=!![],_0x17afc1['worker'][_0x32408b(0x124)]({'type':'cancel','requestId':_0x40383a}),clearTimeout(_0x1d958a[_0x32408b(0x138)]),_0x1d958a[_0x32408b(0x138)]=setTimeout(()=>{const _0x20c769=_0x32408b;this[_0x20c769(0x204)](_0x33f184,_0x17afc1,_0x40383a,_0x5dab13(_0x20c769(0x1f5),_0x20c769(0x184)));},this[_0x32408b(0x232)]);if(_0x1d958a[_0x32408b(0x138)][_0x32408b(0x215)])_0x1d958a['watchdog'][_0x32408b(0x215)]();return!![];}return![];}[_0x26788d(0x204)](_0x393477,_0x38d5a5,_0x1682dd,_0x361c6e){const _0x36de1f=_0x26788d;for(const [_0x13bf8d,_0x55428d]of _0x38d5a5[_0x36de1f(0x20a)]){clearTimeout(_0x55428d[_0x36de1f(0x138)]),_0x55428d[_0x36de1f(0x20e)](_0x13bf8d===_0x1682dd?_0x361c6e:_0x5dab13(_0x36de1f(0x199),'FUNCTION_SANDBOX_EXIT'));}_0x38d5a5['inflight'][_0x36de1f(0x1b1)](),this[_0x36de1f(0x22b)](_0x393477,_0x38d5a5);}['_failTier'](_0x3b642e,_0x33897f,_0x3d9066){const _0x28be88=_0x26788d;if(this[_0x28be88(0x18d)][_0x28be88(0x241)](_0x3b642e)!==_0x33897f)return;if(!_0x33897f[_0x28be88(0x219)])_0x33897f[_0x28be88(0x16d)]?.(_0x3d9066);for(const [,_0x15b964]of _0x33897f['inflight']){clearTimeout(_0x15b964[_0x28be88(0x138)]),_0x15b964[_0x28be88(0x20e)](_0x3d9066);}_0x33897f['inflight'][_0x28be88(0x1b1)](),this[_0x28be88(0x22b)](_0x3b642e,_0x33897f);}[_0x26788d(0x22b)](_0x1de627,_0x48b9b9){const _0x204b06=_0x26788d;if(this[_0x204b06(0x18d)][_0x204b06(0x241)](_0x1de627)===_0x48b9b9)this[_0x204b06(0x18d)][_0x204b06(0x247)](_0x1de627);if(_0x48b9b9[_0x204b06(0x23c)])clearTimeout(_0x48b9b9['idleTimer']);this['onThreadStats']?.(_0x204b06(0x1c6)+_0x1de627,null),_0x48b9b9[_0x204b06(0x16c)][_0x204b06(0x129)]()[_0x204b06(0x224)](()=>{});}['_maybeIdle'](_0xc42402,_0x5f3632){const _0x28393b=_0x26788d;if(_0x5f3632[_0x28393b(0x20a)]['size']>0x0||_0x5f3632['idleTimer'])return;_0x5f3632['idleTimer']=setTimeout(()=>this['_dropTier'](_0xc42402,_0x5f3632),this['idleMs']);if(_0x5f3632[_0x28393b(0x23c)]['unref'])_0x5f3632['idleTimer'][_0x28393b(0x215)]();}[_0x26788d(0x228)](){const _0x445313=_0x26788d;for(const [_0x9c6360,_0x4ab4c6]of[...this[_0x445313(0x18d)]]){this['_failTier'](_0x9c6360,_0x4ab4c6,_0x5dab13('sandbox\x20recycled',_0x445313(0x1b9)));}}async['stop'](){const _0x294a3d=_0x26788d;this[_0x294a3d(0x151)]=!![],this[_0x294a3d(0x228)]();}}return okdbFunctionsSandboxHost={'SandboxHost':_0x206c54,'SANDBOX_ENTRY':_0x8912f2},okdbFunctionsSandboxHost;}var hasRequiredOkdbWorkerChild;function requireOkdbWorkerChild(){const _0x13db72=_0x3dd697;if(hasRequiredOkdbWorkerChild)return okdbWorkerChild$1;hasRequiredOkdbWorkerChild=0x1;function _0x371951(_0x333aa6){const _0x45c173=_0xbb9b;try{if(typeof process[_0x45c173(0x217)]==='function')process[_0x45c173(0x217)](_0x333aa6);}catch{}}let _0x326095=![],_0x63a3bc=null;async function _0xab29fc(_0x1234fd,_0x4f9c9a){const _0x3efe96=_0xbb9b;if(_0x326095)return;_0x326095=!![];try{await _0x63a3bc?.[_0x3efe96(0x1c8)]?.();}catch{}const _0x5c47b8=setTimeout(()=>process['exit'](_0x1234fd),0xbb8);if(typeof _0x5c47b8[_0x3efe96(0x215)]===_0x3efe96(0x1f8))_0x5c47b8[_0x3efe96(0x215)]();try{await _0x4f9c9a?.['close']?.();}catch{}process[_0x3efe96(0x1a1)](_0x1234fd);}function _0x3f6f66(_0x15ca52,_0x31c564,_0x2bff8f=null){const _0x3c8c10=_0xbb9b,_0x2cc3a4=require$$1$1;let _0x7f0a45=process[_0x3c8c10(0x128)](),_0x516350=Date[_0x3c8c10(0x211)]();const _0x23de46=()=>{const _0x705359=_0x3c8c10;try{const _0x504eb4=[];for(const [_0x123792,_0x29218b]of _0x31c564['_envs']){if(_0x123792['startsWith']('~'))continue;for(const _0x209ffe of _0x29218b[_0x705359(0x141)]['tierList']())_0x504eb4[_0x705359(0x148)]({..._0x209ffe,'env':_0x123792});}return _0x504eb4[_0x705359(0x231)]>0x0?{'processors':_0x504eb4}:null;}catch{return null;}},_0x182258=()=>{const _0x1ff842=_0x3c8c10;if(_0x326095)return;const _0x27c1a7=Date[_0x1ff842(0x211)](),_0x12ffe4=process['cpuUsage'](),_0x89811f=(_0x27c1a7-_0x516350)*0x3e8,_0x13d0c6=_0x12ffe4[_0x1ff842(0x221)]-_0x7f0a45[_0x1ff842(0x221)]+(_0x12ffe4[_0x1ff842(0x229)]-_0x7f0a45[_0x1ff842(0x229)]),_0xf3f318=_0x89811f>0x0?Math['min'](0x64,Math['round'](_0x13d0c6/(_0x89811f*(_0x2cc3a4[_0x1ff842(0x134)]()[_0x1ff842(0x231)]||0x1))*0x64)):0x0;_0x7f0a45=_0x12ffe4,_0x516350=_0x27c1a7;const _0x521370=process[_0x1ff842(0x15a)]();_0x15ca52({'type':_0x1ff842(0x21f),'stats':{'rss':_0x521370[_0x1ff842(0x190)],'heapUsed':_0x521370['heapUsed'],'heapTotal':_0x521370[_0x1ff842(0x191)],'external':_0x521370['external'],'cpuPct':_0xf3f318,'cpuWindowMs':Math['round'](_0x89811f/0x3e8)||null,..._0x2bff8f?.()??{}},'processing':_0x23de46()});},_0x36e883=Math['max'](0x3e8,Number(process.env.OKDB_STATS_INTERVAL_MS)||0x1388),_0x4034e7=setInterval(_0x182258,_0x36e883);if(typeof _0x4034e7[_0x3c8c10(0x215)]===_0x3c8c10(0x1f8))_0x4034e7[_0x3c8c10(0x215)]();}process['on'](_0x13db72(0x19a),_0x1d066a=>{const _0x38a906=_0x13db72;_0x371951({'type':_0x38a906(0x1cc),'msg':_0x38a906(0x223)+(_0x1d066a?.[_0x38a906(0x19e)]??_0x1d066a)});});async function _0x22c997(){const _0x8b422a=_0x13db72,_0x45e73b=await new Promise((_0x17617d,_0x93d0ee)=>{const _0x3d2777=_0xbb9b,_0x59f97d=_0xf30f97=>{const _0x4002ff=_0xbb9b;_0xf30f97?.[_0x4002ff(0x12e)]===_0x4002ff(0x140)&&(process[_0x4002ff(0x1d3)](_0x4002ff(0x19e),_0x59f97d),_0x17617d(_0xf30f97));};process['on'](_0x3d2777(0x19e),_0x59f97d);const _0x5961a3=setTimeout(()=>{const _0x20f6ab=_0x3d2777;process[_0x20f6ab(0x1d3)]('message',_0x59f97d),_0x93d0ee(new Error(_0x20f6ab(0x218)));},0x2710);if(typeof _0x5961a3['unref']===_0x3d2777(0x1f8))_0x5961a3[_0x3d2777(0x215)]();}),{rootPath:_0x1858ae,slot:_0x38a43b,supervisorKey:_0xd3a9da}=_0x45e73b,_0x455a6f=require$$2,{EVENTS:_0x3708eb}=requireOkdbEnums(),_0x480f23=new _0x455a6f(_0x1858ae,{'engines':![],'http':![],'asyncProcessors':!![],'compaction':_0x8b422a(0x18a),'envs':'core','auth':{'open':!![]},'processing':_0x8b422a(0x157)});{const _0x464739={'debug':0x0,'info':0x1,'warn':0x2,'error':0x3},_0x57bad3=_0x464739[process.env.OKDB_WORKERS_LOG_LEVEL]??_0x464739[_0x8b422a(0x1cc)];_0x480f23['log'][_0x8b422a(0x153)]?.(),_0x480f23[_0x8b422a(0x1ef)][_0x8b422a(0x13e)](_0x2b4851=>{const _0x482d0f=_0x8b422a;if((_0x464739[_0x2b4851[_0x482d0f(0x1a4)]]??0x1)<_0x57bad3)return;_0x371951({'type':_0x482d0f(0x1ef),'entry':_0x2b4851});});}try{await _0x480f23[_0x8b422a(0x20d)]();}catch(_0x10fa97){_0x371951({'type':_0x8b422a(0x1f9),'error':_0x8b422a(0x15d)+_0x10fa97[_0x8b422a(0x19e)]}),process[_0x8b422a(0x1a1)](0x1);return;}const _0x441ff0=Math[_0x8b422a(0x1bd)](0x4,Number(process.env.OKDB_WORKERS_ENV_CACHE)||0x40),_0x3e8222=new Map(),_0x31047a=new Set();function _0x331b36(_0x239d64){const _0x24f95e=_0x8b422a;try{for(const _0x122831 of _0x239d64[_0x24f95e(0x141)]?.[_0x24f95e(0x1fa)]?.[_0x24f95e(0x22c)]()??[]){if(_0x122831['_lockHandle']?.[_0x24f95e(0x15e)]?.())return!![];}}catch{}return![];}function _0x27fab4(_0x4d089a,_0x233ecd){const _0x842340=_0x8b422a;if(_0x31047a[_0x842340(0x16a)](_0x4d089a))return!![];if(_0x331b36(_0x233ecd))return!![];for(const [,_0x5f3dbe]of _0xf6d3a7){if(_0x5f3dbe?.[_0x842340(0x1de)]===_0x4d089a)return!![];}return![];}async function _0x5683d8(_0xb1d74f,_0x43852e){const _0x3ae08c=_0x8b422a;for(const _0x50a34f of[..._0x480f23['fts']['_processorStops']?.[_0x3ae08c(0x18f)]?.()??[]]){if(!_0x50a34f[_0x3ae08c(0x144)](_0xb1d74f+':'))continue;const _0x34bdbf=_0x480f23[_0x3ae08c(0x15c)][_0x3ae08c(0x209)]['get'](_0x50a34f);_0x480f23[_0x3ae08c(0x15c)]['_processorStops'][_0x3ae08c(0x247)](_0x50a34f);try{await _0x34bdbf?.();}catch{}}try{await _0x43852e['processor']?.[_0x3ae08c(0x1a3)]?.();}catch{}}async function _0x1e51d0(_0x4daa84){const _0x22a4fe=_0x8b422a,_0x166939=_0x3e8222[_0x22a4fe(0x241)](_0x4daa84);if(!_0x166939)return;_0x3e8222['delete'](_0x4daa84),await _0x5683d8(_0x4daa84,_0x166939);try{await _0x166939[_0x22a4fe(0x172)]?.[_0x22a4fe(0x1c8)]?.();}catch{}try{await _0x480f23['fts'][_0x22a4fe(0x20b)]?.(_0x4daa84);}catch{}_0x480f23[_0x22a4fe(0x1a5)][_0x22a4fe(0x247)](_0x4daa84);try{await _0x166939[_0x22a4fe(0x1fe)]();}catch{}}async function _0x1ca187(_0x25af30){const _0x131a9f=_0x8b422a;if(_0x3e8222[_0x131a9f(0x16a)](_0x25af30)){const _0x1ff6d4=_0x3e8222[_0x131a9f(0x241)](_0x25af30);return _0x3e8222[_0x131a9f(0x247)](_0x25af30),_0x3e8222[_0x131a9f(0x213)](_0x25af30,_0x1ff6d4),_0x1ff6d4;}const _0x3993df=_0x480f23[_0x131a9f(0x1a5)]['get'](_0x25af30);if(_0x3993df&&!_0x3993df[_0x131a9f(0x169)])return _0x3993df;if(_0x3e8222['size']>=_0x441ff0)for(const [_0x54c9bd,_0x20fbd0]of _0x3e8222){if(!_0x27fab4(_0x54c9bd,_0x20fbd0)){await _0x1e51d0(_0x54c9bd);break;}}const _0x4983e8=await _0x480f23[_0x131a9f(0x206)](_0x25af30);return _0x3e8222['set'](_0x25af30,_0x4983e8),_0x4983e8;}_0x480f23[_0x8b422a(0x149)]['on'](_0x3708eb[_0x8b422a(0x225)],()=>{const _0x3e725e=_0x8b422a;(async()=>{for(const [_0x17bf26,_0x3ba9cd]of[..._0x3e8222]){if(!_0x27fab4(_0x17bf26,_0x3ba9cd))await _0x1e51d0(_0x17bf26);}})()[_0x3e725e(0x224)](()=>{});});const _0x57b270=setInterval(()=>{const _0x53286e=_0x8b422a;if(_0x326095)return;for(const [,_0x5c3e6a]of _0x480f23[_0x53286e(0x1a5)]){try{_0x5c3e6a[_0x53286e(0x1bb)]?.();}catch{}}},0xc8);if(typeof _0x57b270['unref']===_0x8b422a(0x1f8))_0x57b270[_0x8b422a(0x215)]();process['on'](_0x8b422a(0x133),()=>_0xab29fc(0x0,_0x480f23));if(process['platform']!==_0x8b422a(0x21d)){const _0x287d63=setInterval(()=>{if(process['ppid']===0x1)_0xab29fc(0x0,_0x480f23);},0x7d0);if(typeof _0x287d63[_0x8b422a(0x215)]==='function')_0x287d63[_0x8b422a(0x215)]();}process['on']('message',_0x1f49d5=>{const _0x5977af=_0x8b422a;if(_0x1f49d5?.[_0x5977af(0x12e)]===_0x5977af(0x1c8))_0xab29fc(0x0,_0x480f23);});const {LOOP:_0x59463e}=requireOkdbLoopMonitor(),{createIntakeGate:_0x27d662}=requireOkdbIntakeGate(),_0x17c621=Number(process.env.OKDB_WORKERS_MAX_LEASES)||0x20,_0x304ab4=Number(process.env.OKDB_WORKERS_LAG_GATE_MS)||0xc8,_0xd5278c=Number(process.env.OKDB_WORKERS_WEDGE_MS)||0x7530,_0x4e5700=_0x27d662({'gateMs':_0x304ab4});_0x59463e['onWindow'](({p99Ms:_0x2ea87d,maxMs:_0xac85bc})=>{const _0x56137c=_0x8b422a;_0xac85bc>_0xd5278c&&_0x371951({'type':_0x56137c(0x23f),'maxMs':_0xac85bc});const {changed:_0x5ceeb3,level:_0x42b753}=_0x4e5700[_0x56137c(0x1b8)](_0x2ea87d);if(_0x5ceeb3)_0x371951({'type':'intake','level':_0x42b753,'p99Ms':_0x2ea87d});});const {loadHandler:_0x3fcef8}=requireOkdbQueueLoadHandler(),_0xf6d3a7=new Map();let _0xbc6b12=![],_0x431bc2={'defsSeen':-0x1,'lastError':null,'at':0x0};const _0x1822ac=new Set(),_0x48f8c7=(_0x582db5,_0x51329e)=>{const _0x5e6b6e=_0x582db5+'::'+_0x51329e;if(_0x1822ac['has'](_0x5e6b6e))return;_0x1822ac['add'](_0x5e6b6e),_0x371951({'type':'warn','msg':'queue\x20definition\x20SKIPPED:\x20'+_0x582db5+'\x20—\x20'+_0x51329e});},_0x32bf68={'name':'queue','cost':_0x8b422a(0x21a),'inFlight':()=>_0xf6d3a7[_0x8b422a(0x182)],'detail':()=>({'consumers':[..._0xf6d3a7['keys']()],'tick':_0x431bc2}),async 'tick'(){const _0x2057be=_0x8b422a;if(_0xbc6b12||_0x326095)return;_0xbc6b12=!![];try{const _0x1fb703=_0x480f23[_0x2057be(0x198)][_0x2057be(0x1db)]?.('queue-worker')??[];_0x431bc2={'defsSeen':_0x1fb703[_0x2057be(0x231)],'lastError':null,'at':Date[_0x2057be(0x211)]()};const _0x35a7cb=new Set();for(const {key:_0x1bc34,value:_0x48137d}of _0x1fb703){if(!_0x48137d||_0x48137d[_0x2057be(0x181)]===![])continue;_0x35a7cb[_0x2057be(0x122)](_0x1bc34);const _0x3d0a88=_0xf6d3a7['get'](_0x1bc34);if(_0x3d0a88){if(_0x3d0a88[_0x2057be(0x175)]===_0x48137d[_0x2057be(0x175)])continue;_0xf6d3a7[_0x2057be(0x247)](_0x1bc34);try{await _0x3d0a88[_0x2057be(0x16c)]?.[_0x2057be(0x1c8)]?.();}catch{}}const _0x112678=_0x48137d[_0x2057be(0x1de)]??_0x1bc34['split']('::')[0x0];let _0x262554;try{_0x262554=await _0x1ca187(_0x112678);}catch(_0xcc4e2){_0x48f8c7(_0x1bc34,'env\x20open\x20failed:\x20'+_0xcc4e2?.[_0x2057be(0x19e)]);continue;}if(!_0x262554?.['queue']){_0x48f8c7(_0x1bc34,_0x2057be(0x237));continue;}let _0x1f2ffe;try{_0x1f2ffe=_0x3fcef8(_0x48137d[_0x2057be(0x17b)],_0x48137d[_0x2057be(0x233)]);}catch(_0x1ca625){_0x48f8c7(_0x1bc34,'handler\x20module\x20failed\x20to\x20load:\x20'+_0x1ca625?.['message']);continue;}let _0x42f293;try{_0x42f293=_0x262554[_0x2057be(0x1a9)]['process'](_0x48137d[_0x2057be(0x1bc)]??_0x1bc34['split']('::')[0x1],_0x1f2ffe,_0x48137d[_0x2057be(0x139)]??{});}catch(_0xeb59fb){_0x48f8c7(_0x1bc34,_0x2057be(0x155)+_0xeb59fb?.[_0x2057be(0x19e)]);continue;}_0xf6d3a7[_0x2057be(0x213)](_0x1bc34,{'worker':_0x42f293,'version':_0x48137d[_0x2057be(0x175)],'envName':_0x112678});}for(const [_0x132856,_0x18c52e]of[..._0xf6d3a7]){if(!_0x35a7cb[_0x2057be(0x16a)](_0x132856)){_0xf6d3a7['delete'](_0x132856),_0x371951({'type':'warn','msg':'queue\x20consumer\x20stopped\x20(def\x20deregistered):\x20'+_0x132856});try{await _0x18c52e[_0x2057be(0x16c)]?.[_0x2057be(0x1c8)]?.();}catch{}}}}catch(_0x32bab1){_0x431bc2[_0x2057be(0x16e)]=_0x32bab1?.[_0x2057be(0x19e)]??String(_0x32bab1);throw _0x32bab1;}finally{_0xbc6b12=![];}}};let _0x1f6c0a;{const {SandboxHost:_0x3ec52b}=requireOkdbFunctionsSandboxHost(),_0x170ae8=_0x480f23['_rootDb'][_0x8b422a(0x18b)](_0x8b422a(0x135),{'dupSort':![]}),_0x2234fe=_0x480f23['_rootDb'][_0x8b422a(0x18b)](_0x8b422a(0x174),{'dupSort':![]}),_0x3b9047=Number(process.env.OKDB_FN_STALE_MS)||0xea60,_0x2d1d3f=new _0x3ec52b({'rootPath':_0x1858ae,'log':_0x480f23[_0x8b422a(0x1ef)],'onThreadStats':(_0x43a1ba,_0x45bf73)=>{const _0x59e928=_0x8b422a;if(_0x45bf73)_0x480f23[_0x59e928(0x198)]?.[_0x59e928(0x168)]?.(_0x43a1ba,_0x45bf73);else _0x480f23['processes']?.['clearThreadStats']?.(_0x43a1ba);}});_0x63a3bc=_0x2d1d3f;const _0x314305=new Set(),_0x4bd58a=(_0x5bee96,_0x428ba4)=>{const _0x380ae6=_0x8b422a,_0x11ce06=_0x170ae8['get'](_0x5bee96);if(!_0x11ce06||_0x11ce06[_0x380ae6(0x1bf)]===_0x380ae6(0x1d4)){try{_0x170ae8[_0x380ae6(0x13a)](_0x5bee96);}catch{}return;}_0x2234fe[_0x380ae6(0x14e)](_0x5bee96,_0x428ba4);try{_0x170ae8[_0x380ae6(0x13a)](_0x5bee96);}catch{}},_0xd9060d=(_0x537d82,_0x32dcf3)=>{const _0x5b9067=_0x8b422a;_0x314305['add'](_0x537d82),_0x2d1d3f[_0x5b9067(0x13f)]({..._0x32dcf3,'requestId':_0x537d82})['then'](({message:_0xabfce5,logs:_0x57d8e7})=>_0x4bd58a(_0x537d82,{'message':_0xabfce5,'logs':_0x57d8e7}))['catch'](_0x43c68f=>{const _0x4682ab=_0x5b9067;if(_0x43c68f?.[_0x4682ab(0x143)]===_0x4682ab(0x1b9)){try{const _0x1f5498=_0x170ae8[_0x4682ab(0x241)](_0x537d82);_0x1f5498&&_0x1f5498[_0x4682ab(0x1bf)]===_0x4682ab(0x1d1)&&_0x1f5498['claimedBy']===process['pid']&&_0x170ae8[_0x4682ab(0x14e)](_0x537d82,{..._0x1f5498,'state':_0x4682ab(0x21c),'requestedAt':Date[_0x4682ab(0x211)]()});}catch{}return;}_0x4bd58a(_0x537d82,{'message':{'type':_0x4682ab(0x1f9),'requestId':_0x537d82,'runId':_0x32dcf3[_0x4682ab(0x19c)],'error':{'message':_0x43c68f?.['message']??String(_0x43c68f),'code':_0x43c68f?.[_0x4682ab(0x143)]??'FUNCTION_FAILED'},'meta':{'runnerId':_0x4682ab(0x150)+process[_0x4682ab(0x171)]}},'logs':[]});})[_0x5b9067(0x248)](()=>_0x314305['delete'](_0x537d82));};_0x1f6c0a={'name':'fn','cost':_0x8b422a(0x21a),'inFlight':()=>_0x2d1d3f[_0x8b422a(0x1ae)](),async 'tick'(){const _0x293b8a=_0x8b422a;if(_0x326095)return;for(const _0xc79043 of[..._0x314305]){const _0x20183f=_0x170ae8[_0x293b8a(0x241)](_0xc79043);if(!_0x20183f||_0x20183f[_0x293b8a(0x1bf)]==='cancelled')_0x2d1d3f[_0x293b8a(0x164)](_0xc79043);}for(const {key:_0x42ba8c,value:_0x9f8417}of _0x170ae8[_0x293b8a(0x186)]({})){if(_0x326095)break;if(_0x2d1d3f[_0x293b8a(0x1ae)]()>=_0x2d1d3f['maxConcurrency'])break;if(!_0x9f8417||_0x9f8417['state']!=='pending')continue;if(_0x9f8417['requestedAt']&&Date[_0x293b8a(0x211)]()-_0x9f8417['requestedAt']>_0x3b9047){try{_0x170ae8[_0x293b8a(0x12b)](()=>{const _0x5bd825=_0x293b8a,_0x426d13=_0x170ae8[_0x5bd825(0x241)](_0x42ba8c);if(_0x426d13?.[_0x5bd825(0x1bf)]===_0x5bd825(0x21c)&&_0x426d13['requestedAt']&&Date['now']()-_0x426d13[_0x5bd825(0x240)]>_0x3b9047)_0x170ae8[_0x5bd825(0x159)](_0x42ba8c);});}catch{}continue;}let _0x480d7a=![];_0x170ae8[_0x293b8a(0x12b)](()=>{const _0x3b944b=_0x293b8a,_0x442add=_0x170ae8['get'](_0x42ba8c);_0x442add?.['state']===_0x3b944b(0x21c)&&(_0x170ae8[_0x3b944b(0x244)](_0x42ba8c,{..._0x442add,'state':_0x3b944b(0x1d1),'claimedBy':process[_0x3b944b(0x171)],'claimedAt':Date[_0x3b944b(0x211)]()}),_0x480d7a=!![]);});if(!_0x480d7a)continue;_0xd9060d(_0x42ba8c,_0x9f8417);}}};}let _0x842468=0x0;const _0x29031a=_0x480f23[_0x8b422a(0x1cf)][_0x8b422a(0x18b)](_0x8b422a(0x1be),{'dupSort':![]}),_0x378ba9={'name':_0x8b422a(0x1d0),'cost':_0x8b422a(0x14b),'inFlight':()=>_0x842468,async 'tick'(){const _0x4cfcef=_0x8b422a;if(_0x326095||_0x842468>=0x1)return;const _0x1751f3=[];try{for(const {key:_0x33995d,value:_0xfeca0a}of _0x29031a['getRange']({})){if(typeof _0x33995d===_0x4cfcef(0x1d7)&&_0xfeca0a?.[_0x4cfcef(0x165)]&&!_0xfeca0a[_0x4cfcef(0x165)][_0x4cfcef(0x144)]('~'))_0x1751f3[_0x4cfcef(0x148)](_0xfeca0a);}}catch{}for(const _0x2ac3ae of _0x1751f3){if(_0x326095||_0x842468>=0x1)return;let _0x269bac;try{_0x269bac=await _0x1ca187(_0x2ac3ae[_0x4cfcef(0x165)]);}catch{continue;}if(_0x2ac3ae[_0x4cfcef(0x1f2)]===_0x4cfcef(0x1c7)&&_0x2ac3ae[_0x4cfcef(0x243)]){const _0x10463f=_0x269bac[_0x4cfcef(0x241)]?.(_0x4cfcef(0x1ba),_0x2ac3ae[_0x4cfcef(0x243)]);if(!_0x10463f)continue;let _0x3ab835=![];_0x31047a['add'](_0x2ac3ae[_0x4cfcef(0x165)]);const _0x3b495c=_0x269bac[_0x4cfcef(0x141)][_0x4cfcef(0x19d)]({'rowKey':_0x4cfcef(0x158)+_0x2ac3ae[_0x4cfcef(0x212)],'cursorKey':_0x2ac3ae[_0x4cfcef(0x212)]},async()=>{const _0xc9b0a=_0x4cfcef;!_0x269bac[_0xc9b0a(0x1f0)]['_viewState'][_0xc9b0a(0x16a)](_0x2ac3ae['viewName'])&&_0x269bac[_0xc9b0a(0x1f0)][_0xc9b0a(0x1b0)](_0x2ac3ae['viewName'],_0x10463f),await _0x269bac[_0xc9b0a(0x1f0)]['_runBootstrapScanPhases'](_0x2ac3ae[_0xc9b0a(0x243)],_0x10463f);},{'onClaimed':()=>{_0x3ab835=!![],_0x842468++;}})[_0x4cfcef(0x224)](()=>{})[_0x4cfcef(0x248)](()=>{const _0x1b2085=_0x4cfcef;if(_0x3ab835)_0x842468--;_0x31047a[_0x1b2085(0x247)](_0x2ac3ae[_0x1b2085(0x165)]);});if(_0x3ab835)return;await _0x3b495c;continue;}try{await _0x480f23['fts'][_0x4cfcef(0x1c5)]({'envs':[_0x2ac3ae[_0x4cfcef(0x165)]],'types':_0x2ac3ae[_0x4cfcef(0x12e)]?[_0x2ac3ae[_0x4cfcef(0x12e)]]:'*'});}catch{continue;}let _0x4cd685=[];try{_0x4cd685=_0x269bac['processor'][_0x4cfcef(0x1d6)]();}catch{}for(const _0x15e630 of _0x4cd685){if(_0x326095||_0x842468>=0x1)return;let _0x4e5d3e=![];_0x31047a[_0x4cfcef(0x122)](_0x2ac3ae[_0x4cfcef(0x165)]);const _0x2b14b3=_0x269bac[_0x4cfcef(0x141)][_0x4cfcef(0x220)](_0x15e630,{'onClaimed':()=>{_0x4e5d3e=!![],_0x842468++;}})[_0x4cfcef(0x224)](()=>{})['finally'](()=>{const _0x331926=_0x4cfcef;if(_0x4e5d3e)_0x842468--;_0x31047a[_0x331926(0x247)](_0x2ac3ae[_0x331926(0x165)]);});if(_0x4e5d3e)return;await _0x2b14b3;}}}},_0x2ca7fb=Math['max'](0x1,Number(process.env.OKDB_WORKERS_PROBE_PER_TICK)||0x2),_0x1f7b43=Math[_0x8b422a(0x1bd)](0x1,Number(process.env.OKDB_WORKERS_PROBE_GRACE_TICKS)||0x3);let _0xb0f855=Math[_0x8b422a(0x132)](Math[_0x8b422a(0x1b6)]()*0x1000);const _0x25a6e6=new Set(),_0xbec8dc=new Map(),_0x10a230=Math[_0x8b422a(0x1bd)](0x3e8,Number(process.env.OKDB_WORKERS_PROBE_COOLDOWN_MS)||0x7530),_0x351c2a=new Map(),_0x3b5370={'name':'fts','cost':_0x8b422a(0x236),'inFlight':()=>{let _0x5a7189=0x0;for(const [,_0x30ce24]of _0x3e8222)if(_0x331b36(_0x30ce24))_0x5a7189++;return _0x5a7189;},async 'tick'(){const _0x11a4d0=_0x8b422a;if(_0x326095)return;const _0x27b22b=_0x480f23[_0x11a4d0(0x15c)][_0x11a4d0(0x193)]();if(_0x27b22b[_0x11a4d0(0x231)]===0x0)return;const _0xe2c460=new Map();for(const _0x5cbb61 of _0x27b22b){if(!_0xe2c460[_0x11a4d0(0x16a)](_0x5cbb61['env']))_0xe2c460['set'](_0x5cbb61['env'],[]);_0xe2c460[_0x11a4d0(0x241)](_0x5cbb61[_0x11a4d0(0x165)])[_0x11a4d0(0x148)](_0x5cbb61[_0x11a4d0(0x12e)]);}const _0x92ec4c=[..._0xe2c460[_0x11a4d0(0x18f)]()],_0x5e5414=Date[_0x11a4d0(0x211)](),_0x3902c6=[];for(const _0xd621d0 of _0x25a6e6){_0xe2c460[_0x11a4d0(0x16a)](_0xd621d0)&&!_0x3902c6[_0x11a4d0(0x13c)](_0xd621d0)&&(_0x351c2a['delete'](_0xd621d0),_0x3902c6[_0x11a4d0(0x148)](_0xd621d0));}_0x25a6e6[_0x11a4d0(0x1b1)]();for(let _0xf14ca2=0x0;_0x3902c6[_0x11a4d0(0x231)]<_0x2ca7fb&&_0xf14ca2<_0x92ec4c[_0x11a4d0(0x231)];_0xf14ca2++){const _0x3c1e82=_0x92ec4c[(_0xb0f855+_0xf14ca2)%_0x92ec4c[_0x11a4d0(0x231)]];if(_0x3902c6['includes'](_0x3c1e82))continue;if((_0x351c2a[_0x11a4d0(0x241)](_0x3c1e82)??0x0)>_0x5e5414)continue;_0x3902c6[_0x11a4d0(0x148)](_0x3c1e82);}_0xb0f855=(_0xb0f855+_0x2ca7fb)%Math['max'](0x1,_0x92ec4c[_0x11a4d0(0x231)]);for(const _0x2fba8a of _0x3902c6){if(_0x326095)return;try{await _0x1ca187(_0x2fba8a),await _0x480f23[_0x11a4d0(0x15c)][_0x11a4d0(0x1c5)]({'envs':[_0x2fba8a],'types':_0xe2c460['get'](_0x2fba8a)});}catch{}}for(const [_0x21ee13,_0x57bf22]of[..._0x3e8222]){if(_0x27fab4(_0x21ee13,_0x57bf22)){_0xbec8dc[_0x11a4d0(0x247)](_0x21ee13);continue;}const _0x48f5f1=(_0xbec8dc[_0x11a4d0(0x241)](_0x21ee13)??0x0)+0x1;_0x48f5f1>=_0x1f7b43?(_0xbec8dc[_0x11a4d0(0x247)](_0x21ee13),_0x351c2a[_0x11a4d0(0x213)](_0x21ee13,Date['now']()+_0x10a230),await _0x1e51d0(_0x21ee13)):_0xbec8dc['set'](_0x21ee13,_0x48f5f1);}}};_0x480f23[_0x8b422a(0x149)]['on'](_0x3708eb['SYSTEM_POKE'],_0xc4d1e7=>{const _0x2ac09d=_0x8b422a,_0x3b611e=_0xc4d1e7?.[_0x2ac09d(0x165)];if(typeof _0x3b611e===_0x2ac09d(0x1d7)&&_0x3b611e&&!_0x3b611e['startsWith']('~'))_0x25a6e6['add'](_0x3b611e);});const _0x154ec9=Math[_0x8b422a(0x1bd)](0x64,Number(process.env.OKDB_WORKERS_CLAIM_TICK_MS)||0x3e8),_0xe26bc3=[_0x1f6c0a,_0x32bf68,_0x378ba9,_0x3b5370],_0x4c763a=[_0x32bf68,_0x378ba9,_0x3b5370];let _0x5bbb2a=0x0;const _0x5ba21e=_0x22b93a=>{const _0xee6ce3=_0x8b422a;if(_0x326095||_0x4e5700[_0xee6ce3(0x1d2)](_0x22b93a[_0xee6ce3(0x121)]))return;_0x22b93a[_0xee6ce3(0x1e1)]()['catch'](()=>{});},_0x4d4b6d=setInterval(()=>{const _0x95124f=_0x8b422a;_0x5ba21e(_0x1f6c0a);for(let _0x39eb1f=0x0;_0x39eb1f<_0x4c763a[_0x95124f(0x231)];_0x39eb1f++){_0x5ba21e(_0x4c763a[(_0x5bbb2a+_0x39eb1f)%_0x4c763a['length']]);}_0x5bbb2a=(_0x5bbb2a+0x1)%_0x4c763a[_0x95124f(0x231)];},_0x154ec9);if(typeof _0x4d4b6d[_0x8b422a(0x215)]==='function')_0x4d4b6d[_0x8b422a(0x215)]();_0x480f23[_0x8b422a(0x149)]['on'](_0x3708eb[_0x8b422a(0x19f)],_0x21249b=>{const _0x7530b=_0x8b422a;if(_0x21249b?.[_0x7530b(0x1c0)]==='fn')_0x5ba21e(_0x1f6c0a);else{if(_0x21249b?.[_0x7530b(0x1c0)]===_0x7530b(0x1d0))_0x5ba21e(_0x378ba9);else{if(_0x21249b?.[_0x7530b(0x1c0)]==='queue-worker')_0x5ba21e(_0x32bf68);else{if(_0x21249b?.['scope']==='env-removed'&&typeof _0x21249b[_0x7530b(0x207)]===_0x7530b(0x1d7)){const _0x2b3f4a=_0x21249b[_0x7530b(0x207)];_0x371951({'type':_0x7530b(0x1cc),'msg':_0x7530b(0x152)+_0x2b3f4a+_0x7530b(0x160)+_0x3e8222[_0x7530b(0x16a)](_0x2b3f4a)+')'}),(async()=>{const _0x2175c0=_0x7530b;for(const [_0x54d1a7,_0x2d94d7]of[..._0xf6d3a7]){if(_0x2d94d7?.['envName']!==_0x2b3f4a)continue;_0xf6d3a7[_0x2175c0(0x247)](_0x54d1a7);try{await _0x2d94d7['worker']?.['stop']?.();}catch{}}_0x31047a[_0x2175c0(0x247)](_0x2b3f4a),_0x25a6e6['delete'](_0x2b3f4a),_0x351c2a[_0x2175c0(0x213)](_0x2b3f4a,Date[_0x2175c0(0x211)]()+0x1d4c0),await _0x1e51d0(_0x2b3f4a),_0x371951({'type':_0x2175c0(0x1cc),'msg':_0x2175c0(0x136)+_0x2b3f4a+'\x20evicted'});})()[_0x7530b(0x224)](_0x245967=>{const _0x56d32f=_0x7530b;_0x371951({'type':_0x56d32f(0x1cc),'msg':'env-removed\x20evict\x20FAILED\x20for\x20'+_0x2b3f4a+':\x20'+_0x245967?.[_0x56d32f(0x19e)]});});}}}}});for(const _0x435d83 of _0xe26bc3)_0x5ba21e(_0x435d83);_0x3f6f66(_0x371951,_0x480f23,()=>({'claims':_0xe26bc3[_0x8b422a(0x1a0)](_0x3cff9f=>({'name':_0x3cff9f[_0x8b422a(0x188)],'inFlight':_0x3cff9f[_0x8b422a(0x17a)](),'gated':_0x4e5700[_0x8b422a(0x1d2)](_0x3cff9f[_0x8b422a(0x121)]),..._0x3cff9f[_0x8b422a(0x235)]?{'detail':_0x3cff9f[_0x8b422a(0x235)]()}:{}})),'envsOpen':_0x480f23[_0x8b422a(0x1a5)]['size']})),_0x371951({'type':_0x8b422a(0x12a),'pid':process['pid'],'slot':_0x38a43b,'supervisorKey':_0xd3a9da,'maxLeases':_0x17c621});}return _0x22c997()[_0x13db72(0x224)](_0x51e199=>{const _0x2c2fb5=_0x13db72;_0x371951({'type':'error','error':_0x51e199[_0x2c2fb5(0x19e)]}),process[_0x2c2fb5(0x1a1)](0x1);}),okdbWorkerChild$1;}var okdbWorkerChildExports=requireOkdbWorkerChild(),okdbWorkerChild=getDefaultExportFromCjs(okdbWorkerChildExports);module[_0x3dd697(0x1d8)]=okdbWorkerChild;
|