space-data-module-sdk 0.9.1 → 0.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.
@@ -2,9 +2,9 @@
2
2
  // Self-contained classic-script worker bundles, spawned from blob: URLs
3
3
  // (design A39). Rebuild after changing any file they bundle.
4
4
 
5
- /** src/host/wasiThreadBrowserWorker.mjs, sha256 5384b18df8f6fb338126bd1caee7a1f1e8c9587a8ecbafc71958f16d0d22aa92. */
6
- export const WASI_THREAD_POOL_WORKER_BUNDLE = "(()=>{var xo=Object.defineProperty;var Go=(e,t)=>{for(var s in t)xo(e,s,{get:t[s],enumerable:!0})};var Yo=new TextDecoder,ko=new TextEncoder,Te=\"$bin\";function qo(e){return e instanceof Uint8Array||e instanceof ArrayBuffer||ArrayBuffer.isView(e)}function Ko(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function Xt(e,t){if(e==null)return e??null;if(qo(e)){let s=t.length;return t.push(Ko(e)),{[Te]:s}}return e instanceof Date?e.toISOString():typeof e==\"bigint\"?e.toString():Array.isArray(e)?e.map(s=>Xt(s,t)):typeof e==\"object\"?Object.fromEntries(Object.entries(e).filter(([,s])=>s!==void 0).map(([s,i])=>[s,Xt(i,t)])):e}function yt(e,t){if(e==null)return e;if(Array.isArray(e))return e.map(s=>yt(s,t));if(typeof e==\"object\"){let s=Object.keys(e);if(s.length===1&&s[0]===Te){let i=e[Te];if(!Number.isInteger(i)||i<0||i>=t.length)throw new RangeError(`Hostcall envelope references missing binary segment ${i}.`);return t[i]}return Object.fromEntries(s.map(i=>[i,yt(e[i],t)]))}return e}function Oe(e,t=[]){let s=ko.encode(JSON.stringify(e??null)),i=4+s.length+4;for(let E of t)i+=4+E.length;let r=new Uint8Array(i),o=new DataView(r.buffer),a=0;o.setUint32(a,s.length,!0),a+=4,r.set(s,a),a+=s.length,o.setUint32(a,t.length,!0),a+=4;for(let E of t)o.setUint32(a,E.length,!0),a+=4,r.set(E,a),a+=E.length;return r}function Jt(e){if(!(e instanceof Uint8Array))throw new TypeError(\"Hostcall envelope must be a Uint8Array.\");if(e.length<8)throw new RangeError(\"Hostcall envelope is truncated.\");let t=new DataView(e.buffer,e.byteOffset,e.byteLength),s=0,i=t.getUint32(s,!0);if(s+=4,s+i+4>e.length)throw new RangeError(\"Hostcall envelope meta exceeds envelope bounds.\");let r=JSON.parse(Yo.decode(e.subarray(s,s+i)));s+=i;let o=t.getUint32(s,!0);s+=4;let a=[];for(let E=0;E<o;E+=1){if(s+4>e.length)throw new RangeError(\"Hostcall envelope segment table is truncated.\");let l=t.getUint32(s,!0);if(s+=4,s+l>e.length)throw new RangeError(\"Hostcall envelope segment exceeds envelope bounds.\");a.push(e.subarray(s,s+l)),s+=l}return{meta:r,segments:a}}function Oi(e){let{meta:t,segments:s}=Jt(e);return yt(t,s)}var te=new Int32Array(2),mi=new Float32Array(te.buffer),gi=new Float64Array(te.buffer),yi=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var ee;(function(e){e[e.UTF8_BYTES=1]=\"UTF8_BYTES\",e[e.UTF16_STRING=2]=\"UTF16_STRING\"})(ee||(ee={}));var dt=(e=>(e[e.Unchanged=0]=\"Unchanged\",e[e.Skipped=1]=\"Skipped\",e[e.Missing=2]=\"Missing\",e[e.Expired=3]=\"Expired\",e[e.Info=4]=\"Info\",e))(dt||{});var Nt=(e=>(e[e.Duplicates=0]=\"Duplicates\",e[e.None=1]=\"None\",e[e.Current=2]=\"Current\",e))(Nt||{});var Dt={};Go(Dt,{BodyRef:()=>se,BoolValue:()=>Xo,CacheKeyParams:()=>ya,ConfigEntry:()=>na,ContextParams:()=>Ef,CountValue:()=>ea,CronField:()=>Xa,CryptoParams:()=>Na,EnvVar:()=>cf,EpochStreamParams:()=>Ra,ExecParams:()=>hf,ExecResult:()=>uf,FsEntry:()=>af,FsParams:()=>of,FsStat:()=>ff,HasCapabilityParams:()=>ia,HttpParams:()=>oa,HttpResult:()=>aa,IpfsLink:()=>va,IpfsParams:()=>Ua,IpfsPin:()=>Ha,IpfsResult:()=>Pa,IpfsSwarmPeer:()=>Ba,KeyslotParams:()=>Da,MqttParams:()=>ef,MqttResult:()=>sf,NodeActivityEvent:()=>Za,NodeActivityParams:()=>$a,NodeBandwidthSample:()=>Wa,NodeStatusReport:()=>ja,NumberValue:()=>Jo,P2pLatestDataset:()=>Ka,P2pParams:()=>xa,P2pPeer:()=>Ya,P2pPeerValue:()=>ka,P2pPnmEntry:()=>qa,P2pSummary:()=>Ga,ProtocolParams:()=>Va,Provenance:()=>Ia,ProvenanceAttribute:()=>pa,PubsubParams:()=>Ma,PubsubSubscribed:()=>Fa,QuerySurfaceLimits:()=>ga,RandomBytesParams:()=>ra,SandboxQueryParams:()=>wa,SandboxQueryResult:()=>Ta,ScheduleParams:()=>za,SecretParams:()=>La,SecretResult:()=>Ca,SocketParams:()=>rf,SocketResult:()=>nf,SqlStreamParams:()=>Aa,StorageDeleteParams:()=>Ea,StorageExpireParams:()=>la,StorageExpireResult:()=>_a,StorageIngestParams:()=>da,StorageIngestResult:()=>Sa,StorageQueryParams:()=>fa,StorageWriteParams:()=>ca,StorageWriteResult:()=>ua,StoredRecordMeta:()=>ha,StreamResult:()=>ba,SurfaceColumn:()=>ma,SurfaceTable:()=>Oa,TextValue:()=>sa,TimeValue:()=>ta,TimersDelayParams:()=>Qa,WebsocketParams:()=>Ja,WebsocketResult:()=>tf});var Qo=Object.defineProperty,zo=(e,t,s)=>t in e?Qo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,n=(e,t,s)=>zo(e,typeof t!=\"symbol\"?t+\"\":t,s);function f(e,t,s){let i=Math.floor(s/8),r=1<<s%8;return(e.getUint8(t+i)&r)!==0}function h(e,t,s,i){let r=Math.floor(s/8),o=1<<s%8,a=e.getUint8(t+r);e.setUint8(t+r,i?a|o:a&~o)}function c(e,t,s){let i=Math.min(e.getUint8(t),s),r=new Uint8Array(e.buffer,e.byteOffset+t+1,i);return new TextDecoder().decode(r)}function u(e,t,s,i){let o=new TextEncoder().encode(i),a=Math.min(o.length,s);e.setUint8(t,a);let E=new Uint8Array(e.buffer,e.byteOffset+t+1,s);E.fill(0),E.set(o.subarray(0,a))}var me=class Ui{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Ui(t,s)}vALUE(){return this.view.getUint8(this.offset+0)!==0}setVALUE(t){this.view.setUint8(this.offset+0,t?1:0)}};n(me,\"SIZE\",1);n(me,\"ALIGN\",1);var Xo=me,ge=class Pi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Pi(t,s)}vALUE(){return this.view.getFloat64(this.offset+0,!0)}setVALUE(t){this.view.setFloat64(this.offset+0,t,!0)}};n(ge,\"SIZE\",8);n(ge,\"ALIGN\",8);var Jo=ge,ye=class vi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new vi(t,s)}uNIX_MS(){return this.view.getBigUint64(this.offset+0,!0)}setUNIX_MS(t){this.view.setBigUint64(this.offset+0,t,!0)}};n(ye,\"SIZE\",8);n(ye,\"ALIGN\",8);var ta=ye,Ne=class Hi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Hi(t,s)}vALUE(){return this.view.getBigUint64(this.offset+0,!0)}setVALUE(t){this.view.setBigUint64(this.offset+0,t,!0)}};n(Ne,\"SIZE\",8);n(Ne,\"ALIGN\",8);var ea=Ne,De=class Bi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Bi(t,s)}hasVALUE(){return f(this.view,this.offset,0)}setHasVALUE(t){h(this.view,this.offset,0,t)}vALUE(){return c(this.view,this.offset+1,255)}setVALUE(t){u(this.view,this.offset+1,255,t),this.setHasVALUE(!0)}};n(De,\"SIZE\",257);n(De,\"ALIGN\",1);var sa=De,Le=class Mi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Mi(t,s)}tOKEN(){return this.view.getBigUint64(this.offset+8,!0)}setTOKEN(t){this.view.setBigUint64(this.offset+8,t,!0)}sIZE(){return this.view.getBigUint64(this.offset+16,!0)}setSIZE(t){this.view.setBigUint64(this.offset+16,t,!0)}fRAMES(){return this.view.getBigInt64(this.offset+24,!0)}setFRAMES(t){this.view.setBigInt64(this.offset+24,t,!0)}hasFNV1A64(){return f(this.view,this.offset,0)}setHasFNV1A64(t){h(this.view,this.offset,0,t)}fNV1A64(){return c(this.view,this.offset+32,16)}setFNV1A64(t){u(this.view,this.offset+32,16,t),this.setHasFNV1A64(!0)}};n(Le,\"SIZE\",56);n(Le,\"ALIGN\",8);var se=Le,Ce=class Fi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Fi(t,s)}hasCAPABILITY(){return f(this.view,this.offset,0)}setHasCAPABILITY(t){h(this.view,this.offset,0,t)}cAPABILITY(){return c(this.view,this.offset+1,64)}setCAPABILITY(t){u(this.view,this.offset+1,64,t),this.setHasCAPABILITY(!0)}};n(Ce,\"SIZE\",66);n(Ce,\"ALIGN\",1);var ia=Ce,Ue=class Vi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Vi(t,s)}lENGTH(){return this.view.getUint32(this.offset+0,!0)}setLENGTH(t){this.view.setUint32(this.offset+0,t,!0)}};n(Ue,\"SIZE\",4);n(Ue,\"ALIGN\",4);var ra=Ue,Pe=class xi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new xi(t,s)}hasKEY(){return f(this.view,this.offset,0)}setHasKEY(t){h(this.view,this.offset,0,t)}kEY(){return c(this.view,this.offset+1,255)}setKEY(t){u(this.view,this.offset+1,255,t),this.setHasKEY(!0)}kIND(){return this.view.getUint8(this.offset+257)}setKIND(t){this.view.setUint8(this.offset+257,t)}hasSTRING_VALUE(){return f(this.view,this.offset,1)}setHasSTRING_VALUE(t){h(this.view,this.offset,1,t)}sTRING_VALUE(){return c(this.view,this.offset+258,255)}setSTRING_VALUE(t){u(this.view,this.offset+258,255,t),this.setHasSTRING_VALUE(!0)}nUMBER_VALUE(){return this.view.getFloat64(this.offset+520,!0)}setNUMBER_VALUE(t){this.view.setFloat64(this.offset+520,t,!0)}bOOL_VALUE(){return this.view.getUint8(this.offset+528)!==0}setBOOL_VALUE(t){this.view.setUint8(this.offset+528,t?1:0)}};n(Pe,\"SIZE\",536);n(Pe,\"ALIGN\",8);var na=Pe,ve=class Gi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Gi(t,s)}hasMETHOD(){return f(this.view,this.offset,0)}setHasMETHOD(t){h(this.view,this.offset,0,t)}mETHOD(){return c(this.view,this.offset+1,16)}setMETHOD(t){u(this.view,this.offset+1,16,t),this.setHasMETHOD(!0)}tIMEOUT_MS(){return this.view.getUint32(this.offset+20,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+20,t,!0)}mAX_BYTES(){return this.view.getBigUint64(this.offset+24,!0)}setMAX_BYTES(t){this.view.setBigUint64(this.offset+24,t,!0)}nO_REDIRECTS(){return this.view.getUint8(this.offset+32)!==0}setNO_REDIRECTS(t){this.view.setUint8(this.offset+32,t?1:0)}};n(ve,\"SIZE\",40);n(ve,\"ALIGN\",8);var oa=ve,He=class Yi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Yi(t,s)}sTATUS(){return this.view.getInt32(this.offset+0,!0)}setSTATUS(t){this.view.setInt32(this.offset+0,t,!0)}rETRIEVED_MS(){return this.view.getBigUint64(this.offset+8,!0)}setRETRIEVED_MS(t){this.view.setBigUint64(this.offset+8,t,!0)}};n(He,\"SIZE\",16);n(He,\"ALIGN\",8);var aa=He,Be=class ki{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new ki(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return c(this.view,this.offset+1,64)}setSCHEMA(t){u(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}hasDAY(){return f(this.view,this.offset,1)}setHasDAY(t){h(this.view,this.offset,1,t)}dAY(){return c(this.view,this.offset+66,16)}setDAY(t){u(this.view,this.offset+66,16,t),this.setHasDAY(!0)}hasENTITY_ID(){return f(this.view,this.offset,2)}setHasENTITY_ID(t){h(this.view,this.offset,2,t)}eNTITY_ID(){return c(this.view,this.offset+83,255)}setENTITY_ID(t){u(this.view,this.offset+83,255,t),this.setHasENTITY_ID(!0)}nORAD_CAT_ID(){return this.view.getUint32(this.offset+340,!0)}setNORAD_CAT_ID(t){this.view.setUint32(this.offset+340,t,!0)}lIMIT(){return this.view.getUint32(this.offset+344,!0)}setLIMIT(t){this.view.setUint32(this.offset+344,t,!0)}};n(Be,\"SIZE\",348);n(Be,\"ALIGN\",4);var fa=Be,Me=class qi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new qi(t,s)}hasCID(){return f(this.view,this.offset,0)}setHasCID(t){h(this.view,this.offset,0,t)}cID(){return c(this.view,this.offset+1,128)}setCID(t){u(this.view,this.offset+1,128,t),this.setHasCID(!0)}rOW_ID(){return this.view.getBigInt64(this.offset+136,!0)}setROW_ID(t){this.view.setBigInt64(this.offset+136,t,!0)}hasPEER_ID(){return f(this.view,this.offset,1)}setHasPEER_ID(t){h(this.view,this.offset,1,t)}pEER_ID(){return c(this.view,this.offset+144,128)}setPEER_ID(t){u(this.view,this.offset+144,128,t),this.setHasPEER_ID(!0)}tIMESTAMP_MS(){return this.view.getBigInt64(this.offset+280,!0)}setTIMESTAMP_MS(t){this.view.setBigInt64(this.offset+280,t,!0)}mATERIALIZED_MS(){return this.view.getBigInt64(this.offset+288,!0)}setMATERIALIZED_MS(t){this.view.setBigInt64(this.offset+288,t,!0)}lENGTH(){return this.view.getUint32(this.offset+296,!0)}setLENGTH(t){this.view.setUint32(this.offset+296,t,!0)}hasPROVIDER_ID(){return f(this.view,this.offset,2)}setHasPROVIDER_ID(t){h(this.view,this.offset,2,t)}pROVIDER_ID(){return c(this.view,this.offset+300,128)}setPROVIDER_ID(t){u(this.view,this.offset+300,128,t),this.setHasPROVIDER_ID(!0)}hasSOURCE_NAME(){return f(this.view,this.offset,3)}setHasSOURCE_NAME(t){h(this.view,this.offset,3,t)}sOURCE_NAME(){return c(this.view,this.offset+429,128)}setSOURCE_NAME(t){u(this.view,this.offset+429,128,t),this.setHasSOURCE_NAME(!0)}hasBATCH_ID(){return f(this.view,this.offset,4)}setHasBATCH_ID(t){h(this.view,this.offset,4,t)}bATCH_ID(){return c(this.view,this.offset+558,128)}setBATCH_ID(t){u(this.view,this.offset+558,128,t),this.setHasBATCH_ID(!0)}hasPRODUCER_PEER_ID(){return f(this.view,this.offset,5)}setHasPRODUCER_PEER_ID(t){h(this.view,this.offset,5,t)}pRODUCER_PEER_ID(){return c(this.view,this.offset+687,128)}setPRODUCER_PEER_ID(t){u(this.view,this.offset+687,128,t),this.setHasPRODUCER_PEER_ID(!0)}hasLICENSE(){return f(this.view,this.offset,6)}setHasLICENSE(t){h(this.view,this.offset,6,t)}lICENSE(){return c(this.view,this.offset+816,128)}setLICENSE(t){u(this.view,this.offset+816,128,t),this.setHasLICENSE(!0)}};n(Me,\"SIZE\",952);n(Me,\"ALIGN\",8);var ha=Me,Fe=class Ki{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Ki(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return c(this.view,this.offset+1,64)}setSCHEMA(t){u(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}};n(Fe,\"SIZE\",66);n(Fe,\"ALIGN\",1);var ca=Fe,Ve=class ji{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new ji(t,s)}hasCID(){return f(this.view,this.offset,0)}setHasCID(t){h(this.view,this.offset,0,t)}cID(){return c(this.view,this.offset+1,128)}setCID(t){u(this.view,this.offset+1,128,t),this.setHasCID(!0)}};n(Ve,\"SIZE\",130);n(Ve,\"ALIGN\",1);var ua=Ve,xe=class Wi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Wi(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return c(this.view,this.offset+1,64)}setSCHEMA(t){u(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}hasCID(){return f(this.view,this.offset,1)}setHasCID(t){h(this.view,this.offset,1,t)}cID(){return c(this.view,this.offset+66,128)}setCID(t){u(this.view,this.offset+66,128,t),this.setHasCID(!0)}};n(xe,\"SIZE\",195);n(xe,\"ALIGN\",1);var Ea=xe,Ge=class $i{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new $i(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return c(this.view,this.offset+1,64)}setSCHEMA(t){u(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}hasPROVIDER_ID(){return f(this.view,this.offset,1)}setHasPROVIDER_ID(t){h(this.view,this.offset,1,t)}pROVIDER_ID(){return c(this.view,this.offset+66,128)}setPROVIDER_ID(t){u(this.view,this.offset+66,128,t),this.setHasPROVIDER_ID(!0)}hasSOURCE_NAME(){return f(this.view,this.offset,2)}setHasSOURCE_NAME(t){h(this.view,this.offset,2,t)}sOURCE_NAME(){return c(this.view,this.offset+195,128)}setSOURCE_NAME(t){u(this.view,this.offset+195,128,t),this.setHasSOURCE_NAME(!0)}bEFORE_MS(){return this.view.getBigUint64(this.offset+328,!0)}setBEFORE_MS(t){this.view.setBigUint64(this.offset+328,t,!0)}bATCH(){return this.view.getUint32(this.offset+336,!0)}setBATCH(t){this.view.setUint32(this.offset+336,t,!0)}mAX_DELETES(){return this.view.getUint32(this.offset+340,!0)}setMAX_DELETES(t){this.view.setUint32(this.offset+340,t,!0)}};n(Ge,\"SIZE\",344);n(Ge,\"ALIGN\",8);var la=Ge,Ye=class Zi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Zi(t,s)}dELETED(){return this.view.getBigUint64(this.offset+0,!0)}setDELETED(t){this.view.setBigUint64(this.offset+0,t,!0)}mISSING(){return this.view.getBigUint64(this.offset+8,!0)}setMISSING(t){this.view.setBigUint64(this.offset+8,t,!0)}cAPPED(){return this.view.getUint8(this.offset+16)!==0}setCAPPED(t){this.view.setUint8(this.offset+16,t?1:0)}};n(Ye,\"SIZE\",24);n(Ye,\"ALIGN\",8);var _a=Ye,ke=class Qi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Qi(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return c(this.view,this.offset+2,64)}setSCHEMA(t){u(this.view,this.offset+2,64,t),this.setHasSCHEMA(!0)}hasPROVIDER_ID(){return f(this.view,this.offset,1)}setHasPROVIDER_ID(t){h(this.view,this.offset,1,t)}pROVIDER_ID(){return c(this.view,this.offset+67,128)}setPROVIDER_ID(t){u(this.view,this.offset+67,128,t),this.setHasPROVIDER_ID(!0)}hasSOURCE_NAME(){return f(this.view,this.offset,2)}setHasSOURCE_NAME(t){h(this.view,this.offset,2,t)}sOURCE_NAME(){return c(this.view,this.offset+196,128)}setSOURCE_NAME(t){u(this.view,this.offset+196,128,t),this.setHasSOURCE_NAME(!0)}hasBATCH_ID(){return f(this.view,this.offset,3)}setHasBATCH_ID(t){h(this.view,this.offset,3,t)}bATCH_ID(){return c(this.view,this.offset+325,128)}setBATCH_ID(t){u(this.view,this.offset+325,128,t),this.setHasBATCH_ID(!0)}hasSOURCE_URL(){return f(this.view,this.offset,4)}setHasSOURCE_URL(t){h(this.view,this.offset,4,t)}sOURCE_URL(){return c(this.view,this.offset+454,255)}setSOURCE_URL(t){u(this.view,this.offset+454,255,t),this.setHasSOURCE_URL(!0)}hasCONTENT_KEY_ID(){return f(this.view,this.offset,5)}setHasCONTENT_KEY_ID(t){h(this.view,this.offset,5,t)}cONTENT_KEY_ID(){return c(this.view,this.offset+710,128)}setCONTENT_KEY_ID(t){u(this.view,this.offset+710,128,t),this.setHasCONTENT_KEY_ID(!0)}hasSOURCE_PEER(){return f(this.view,this.offset,6)}setHasSOURCE_PEER(t){h(this.view,this.offset,6,t)}sOURCE_PEER(){return c(this.view,this.offset+839,128)}setSOURCE_PEER(t){u(this.view,this.offset+839,128,t),this.setHasSOURCE_PEER(!0)}hasLICENSE(){return f(this.view,this.offset,7)}setHasLICENSE(t){h(this.view,this.offset,7,t)}lICENSE(){return c(this.view,this.offset+968,128)}setLICENSE(t){u(this.view,this.offset+968,128,t),this.setHasLICENSE(!0)}hasLICENSE_URL(){return f(this.view,this.offset,8)}setHasLICENSE_URL(t){h(this.view,this.offset,8,t)}lICENSE_URL(){return c(this.view,this.offset+1097,255)}setLICENSE_URL(t){u(this.view,this.offset+1097,255,t),this.setHasLICENSE_URL(!0)}hasCITATION(){return f(this.view,this.offset,9)}setHasCITATION(t){h(this.view,this.offset,9,t)}cITATION(){return c(this.view,this.offset+1353,255)}setCITATION(t){u(this.view,this.offset+1353,255,t),this.setHasCITATION(!0)}sHARE_ALIKE(){return this.view.getUint8(this.offset+1609)!==0}setSHARE_ALIKE(t){this.view.setUint8(this.offset+1609,t?1:0)}rECONCILE(){return this.view.getUint8(this.offset+1610)}setRECONCILE(t){this.view.setUint8(this.offset+1610,t)}hasARCHIVE_SOURCE(){return f(this.view,this.offset,10)}setHasARCHIVE_SOURCE(t){h(this.view,this.offset,10,t)}aRCHIVE_SOURCE(){return c(this.view,this.offset+1611,128)}setARCHIVE_SOURCE(t){u(this.view,this.offset+1611,128,t),this.setHasARCHIVE_SOURCE(!0)}hasARCHIVE_NAME(){return f(this.view,this.offset,11)}setHasARCHIVE_NAME(t){h(this.view,this.offset,11,t)}aRCHIVE_NAME(){return c(this.view,this.offset+1740,255)}setARCHIVE_NAME(t){u(this.view,this.offset+1740,255,t),this.setHasARCHIVE_NAME(!0)}};n(ke,\"SIZE\",1996);n(ke,\"ALIGN\",1);var da=ke,qe=class zi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new zi(t,s)}hasSOURCE_URL(){return f(this.view,this.offset,0)}setHasSOURCE_URL(t){h(this.view,this.offset,0,t)}sOURCE_URL(){return c(this.view,this.offset+1,255)}setSOURCE_URL(t){u(this.view,this.offset+1,255,t),this.setHasSOURCE_URL(!0)}hTTP_STATUS(){return this.view.getInt32(this.offset+260,!0)}setHTTP_STATUS(t){this.view.setInt32(this.offset+260,t,!0)}hasETAG(){return f(this.view,this.offset,1)}setHasETAG(t){h(this.view,this.offset,1,t)}eTAG(){return c(this.view,this.offset+264,255)}setETAG(t){u(this.view,this.offset+264,255,t),this.setHasETAG(!0)}hasLAST_MODIFIED(){return f(this.view,this.offset,2)}setHasLAST_MODIFIED(t){h(this.view,this.offset,2,t)}lAST_MODIFIED(){return c(this.view,this.offset+520,64)}setLAST_MODIFIED(t){u(this.view,this.offset+520,64,t),this.setHasLAST_MODIFIED(!0)}hasCONTENT_TYPE(){return f(this.view,this.offset,3)}setHasCONTENT_TYPE(t){h(this.view,this.offset,3,t)}cONTENT_TYPE(){return c(this.view,this.offset+585,128)}setCONTENT_TYPE(t){u(this.view,this.offset+585,128,t),this.setHasCONTENT_TYPE(!0)}rETRIEVED_MS(){return this.view.getBigUint64(this.offset+720,!0)}setRETRIEVED_MS(t){this.view.setBigUint64(this.offset+720,t,!0)}hasPARSER(){return f(this.view,this.offset,4)}setHasPARSER(t){h(this.view,this.offset,4,t)}pARSER(){return c(this.view,this.offset+728,128)}setPARSER(t){u(this.view,this.offset+728,128,t),this.setHasPARSER(!0)}hasPARSER_VERSION(){return f(this.view,this.offset,5)}setHasPARSER_VERSION(t){h(this.view,this.offset,5,t)}pARSER_VERSION(){return c(this.view,this.offset+857,64)}setPARSER_VERSION(t){u(this.view,this.offset+857,64,t),this.setHasPARSER_VERSION(!0)}hasSOURCE_SHA256(){return f(this.view,this.offset,6)}setHasSOURCE_SHA256(t){h(this.view,this.offset,6,t)}sOURCE_SHA256(){return c(this.view,this.offset+922,64)}setSOURCE_SHA256(t){u(this.view,this.offset+922,64,t),this.setHasSOURCE_SHA256(!0)}hasNORMALIZED_SHA256(){return f(this.view,this.offset,7)}setHasNORMALIZED_SHA256(t){h(this.view,this.offset,7,t)}nORMALIZED_SHA256(){return c(this.view,this.offset+987,64)}setNORMALIZED_SHA256(t){u(this.view,this.offset+987,64,t),this.setHasNORMALIZED_SHA256(!0)}nORMALIZED_COUNT(){return this.view.getBigUint64(this.offset+1056,!0)}setNORMALIZED_COUNT(t){this.view.setBigUint64(this.offset+1056,t,!0)}fROM_CACHE(){return this.view.getUint8(this.offset+1064)!==0}setFROM_CACHE(t){this.view.setUint8(this.offset+1064,t?1:0)}};n(qe,\"SIZE\",1072);n(qe,\"ALIGN\",8);var Ia=qe,Ke=class Xi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Xi(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return c(this.view,this.offset+1,128)}setNAME(t){u(this.view,this.offset+1,128,t),this.setHasNAME(!0)}hasVALUE(){return f(this.view,this.offset,1)}setHasVALUE(t){h(this.view,this.offset,1,t)}vALUE(){return c(this.view,this.offset+130,255)}setVALUE(t){u(this.view,this.offset+130,255,t),this.setHasVALUE(!0)}};n(Ke,\"SIZE\",386);n(Ke,\"ALIGN\",1);var pa=Ke,je=class Ji{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Ji(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return c(this.view,this.offset+1,64)}setSCHEMA(t){u(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}hasBATCH_ID(){return f(this.view,this.offset,1)}setHasBATCH_ID(t){h(this.view,this.offset,1,t)}bATCH_ID(){return c(this.view,this.offset+66,128)}setBATCH_ID(t){u(this.view,this.offset+66,128,t),this.setHasBATCH_ID(!0)}iNSERTED(){return this.view.getBigUint64(this.offset+200,!0)}setINSERTED(t){this.view.setBigUint64(this.offset+200,t,!0)}rECONCILED_DUPLICATES(){return this.view.getBigUint64(this.offset+208,!0)}setRECONCILED_DUPLICATES(t){this.view.setBigUint64(this.offset+208,t,!0)}rECONCILED_OLD_BATCHES(){return this.view.getBigUint64(this.offset+216,!0)}setRECONCILED_OLD_BATCHES(t){this.view.setBigUint64(this.offset+216,t,!0)}hasARCHIVED(){return f(this.view,this.offset,2)}setHasARCHIVED(t){h(this.view,this.offset,2,t)}aRCHIVED(){return c(this.view,this.offset+224,255)}setARCHIVED(t){u(this.view,this.offset+224,255,t),this.setHasARCHIVED(!0)}hasPROVENANCE_FILE(){return f(this.view,this.offset,3)}setHasPROVENANCE_FILE(t){h(this.view,this.offset,3,t)}pROVENANCE_FILE(){return c(this.view,this.offset+480,255)}setPROVENANCE_FILE(t){u(this.view,this.offset+480,255,t),this.setHasPROVENANCE_FILE(!0)}};n(je,\"SIZE\",736);n(je,\"ALIGN\",8);var Sa=je,We=class tr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new tr(t,s)}dELIVER(){return this.view.getUint8(this.offset+0)}setDELIVER(t){this.view.setUint8(this.offset+0,t)}};n(We,\"SIZE\",1);n(We,\"ALIGN\",1);var Aa=We,$e=class er{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new er(t,s)}rOWS(){return this.view.getBigUint64(this.offset+8,!0)}setROWS(t){this.view.setBigUint64(this.offset+8,t,!0)}cOLUMNS(){return this.view.getUint32(this.offset+16,!0)}setCOLUMNS(t){this.view.setUint32(this.offset+16,t,!0)}hasREF(){return f(this.view,this.offset,0)}setHasREF(t){h(this.view,this.offset,0,t)}rEF(){return new se(this.buffer,this.offset+24)}};n($e,\"SIZE\",80);n($e,\"ALIGN\",8);var ba=$e,Ze=class sr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new sr(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return c(this.view,this.offset+1,64)}setSCHEMA(t){u(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}hasSOURCE(){return f(this.view,this.offset,1)}setHasSOURCE(t){h(this.view,this.offset,1,t)}sOURCE(){return c(this.view,this.offset+66,128)}setSOURCE(t){u(this.view,this.offset+66,128,t),this.setHasSOURCE(!0)}hasPROFILE(){return f(this.view,this.offset,2)}setHasPROFILE(t){h(this.view,this.offset,2,t)}pROFILE(){return c(this.view,this.offset+195,32)}setPROFILE(t){u(this.view,this.offset+195,32,t),this.setHasPROFILE(!0)}ePOCH(){return this.view.getFloat64(this.offset+232,!0)}setEPOCH(t){this.view.setFloat64(this.offset+232,t,!0)}lIMIT(){return this.view.getUint32(this.offset+240,!0)}setLIMIT(t){this.view.setUint32(this.offset+240,t,!0)}dELIVER(){return this.view.getUint8(this.offset+244)}setDELIVER(t){this.view.setUint8(this.offset+244,t)}};n(Ze,\"SIZE\",248);n(Ze,\"ALIGN\",8);var Ra=Ze,Qe=class ir{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new ir(t,s)}wANT(){return this.view.getUint8(this.offset+0)}setWANT(t){this.view.setUint8(this.offset+0,t)}dELIVER(){return this.view.getUint8(this.offset+1)}setDELIVER(t){this.view.setUint8(this.offset+1,t)}};n(Qe,\"SIZE\",2);n(Qe,\"ALIGN\",1);var wa=Qe,ze=class rr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new rr(t,s)}kIND(){return this.view.getUint8(this.offset+1)}setKIND(t){this.view.setUint8(this.offset+1,t)}rOWS(){return this.view.getBigUint64(this.offset+8,!0)}setROWS(t){this.view.setBigUint64(this.offset+8,t,!0)}cOLUMNS(){return this.view.getUint32(this.offset+16,!0)}setCOLUMNS(t){this.view.setUint32(this.offset+16,t,!0)}hasREF(){return f(this.view,this.offset,0)}setHasREF(t){h(this.view,this.offset,0,t)}rEF(){return new se(this.buffer,this.offset+24)}};n(ze,\"SIZE\",80);n(ze,\"ALIGN\",8);var Ta=ze,Xe=class nr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new nr(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return c(this.view,this.offset+1,128)}setNAME(t){u(this.view,this.offset+1,128,t),this.setHasNAME(!0)}hasKIND(){return f(this.view,this.offset,1)}setHasKIND(t){h(this.view,this.offset,1,t)}kIND(){return c(this.view,this.offset+130,16)}setKIND(t){u(this.view,this.offset+130,16,t),this.setHasKIND(!0)}hasSOURCE(){return f(this.view,this.offset,2)}setHasSOURCE(t){h(this.view,this.offset,2,t)}sOURCE(){return c(this.view,this.offset+147,128)}setSOURCE(t){u(this.view,this.offset+147,128,t),this.setHasSOURCE(!0)}rECORDS(){return this.view.getBigInt64(this.offset+280,!0)}setRECORDS(t){this.view.setBigInt64(this.offset+280,t,!0)}};n(Xe,\"SIZE\",288);n(Xe,\"ALIGN\",8);var Oa=Xe,Je=class or{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new or(t,s)}hasTABLE(){return f(this.view,this.offset,0)}setHasTABLE(t){h(this.view,this.offset,0,t)}tABLE(){return c(this.view,this.offset+1,128)}setTABLE(t){u(this.view,this.offset+1,128,t),this.setHasTABLE(!0)}hasNAME(){return f(this.view,this.offset,1)}setHasNAME(t){h(this.view,this.offset,1,t)}nAME(){return c(this.view,this.offset+130,128)}setNAME(t){u(this.view,this.offset+130,128,t),this.setHasNAME(!0)}pLACEHOLDER(){return this.view.getUint8(this.offset+259)!==0}setPLACEHOLDER(t){this.view.setUint8(this.offset+259,t?1:0)}};n(Je,\"SIZE\",260);n(Je,\"ALIGN\",1);var ma=Je,ts=class ar{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new ar(t,s)}tIMEOUT_MS(){return this.view.getUint32(this.offset+0,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+0,t,!0)}mAX_ROWS(){return this.view.getBigUint64(this.offset+8,!0)}setMAX_ROWS(t){this.view.setBigUint64(this.offset+8,t,!0)}mAX_BYTES(){return this.view.getBigUint64(this.offset+16,!0)}setMAX_BYTES(t){this.view.setBigUint64(this.offset+16,t,!0)}};n(ts,\"SIZE\",24);n(ts,\"ALIGN\",8);var ga=ts,es=class fr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new fr(t,s)}hasSCHEMA_NAME(){return f(this.view,this.offset,0)}setHasSCHEMA_NAME(t){h(this.view,this.offset,0,t)}sCHEMA_NAME(){return c(this.view,this.offset+1,64)}setSCHEMA_NAME(t){u(this.view,this.offset+1,64,t),this.setHasSCHEMA_NAME(!0)}hasSCHEMA_VERSION(){return f(this.view,this.offset,1)}setHasSCHEMA_VERSION(t){h(this.view,this.offset,1,t)}sCHEMA_VERSION(){return c(this.view,this.offset+66,32)}setSCHEMA_VERSION(t){u(this.view,this.offset+66,32,t),this.setHasSCHEMA_VERSION(!0)}hasFORMAT(){return f(this.view,this.offset,2)}setHasFORMAT(t){h(this.view,this.offset,2,t)}fORMAT(){return c(this.view,this.offset+99,32)}setFORMAT(t){u(this.view,this.offset+99,32,t),this.setHasFORMAT(!0)}hasPUBLISH_EVENT_KEY(){return f(this.view,this.offset,3)}setHasPUBLISH_EVENT_KEY(t){h(this.view,this.offset,3,t)}pUBLISH_EVENT_KEY(){return c(this.view,this.offset+132,128)}setPUBLISH_EVENT_KEY(t){u(this.view,this.offset+132,128,t),this.setHasPUBLISH_EVENT_KEY(!0)}};n(es,\"SIZE\",261);n(es,\"ALIGN\",1);var ya=es,ss=class hr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new hr(t,s)}aLGORITHM(){return this.view.getUint8(this.offset+0)}setALGORITHM(t){this.view.setUint8(this.offset+0,t)}lENGTH(){return this.view.getUint32(this.offset+4,!0)}setLENGTH(t){this.view.setUint32(this.offset+4,t,!0)}};n(ss,\"SIZE\",8);n(ss,\"ALIGN\",4);var Na=ss,is=class cr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new cr(t,s)}hasSLOT_ID(){return f(this.view,this.offset,0)}setHasSLOT_ID(t){h(this.view,this.offset,0,t)}sLOT_ID(){return c(this.view,this.offset+1,128)}setSLOT_ID(t){u(this.view,this.offset+1,128,t),this.setHasSLOT_ID(!0)}aLGORITHM(){return this.view.getUint8(this.offset+130)}setALGORITHM(t){this.view.setUint8(this.offset+130,t)}};n(is,\"SIZE\",131);n(is,\"ALIGN\",1);var Da=is,rs=class ur{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new ur(t,s)}hasID(){return f(this.view,this.offset,0)}setHasID(t){h(this.view,this.offset,0,t)}iD(){return c(this.view,this.offset+1,128)}setID(t){u(this.view,this.offset+1,128,t),this.setHasID(!0)}hasUSERNAME(){return f(this.view,this.offset,1)}setHasUSERNAME(t){h(this.view,this.offset,1,t)}uSERNAME(){return c(this.view,this.offset+130,255)}setUSERNAME(t){u(this.view,this.offset+130,255,t),this.setHasUSERNAME(!0)}};n(rs,\"SIZE\",386);n(rs,\"ALIGN\",1);var La=rs,ns=class Er{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Er(t,s)}hasID(){return f(this.view,this.offset,0)}setHasID(t){h(this.view,this.offset,0,t)}iD(){return c(this.view,this.offset+1,128)}setID(t){u(this.view,this.offset+1,128,t),this.setHasID(!0)}hasUSERNAME(){return f(this.view,this.offset,1)}setHasUSERNAME(t){h(this.view,this.offset,1,t)}uSERNAME(){return c(this.view,this.offset+130,255)}setUSERNAME(t){u(this.view,this.offset+130,255,t),this.setHasUSERNAME(!0)}cONFIGURED(){return this.view.getUint8(this.offset+386)!==0}setCONFIGURED(t){this.view.setUint8(this.offset+386,t?1:0)}hasUSERNAME_MASKED(){return f(this.view,this.offset,2)}setHasUSERNAME_MASKED(t){h(this.view,this.offset,2,t)}uSERNAME_MASKED(){return c(this.view,this.offset+387,255)}setUSERNAME_MASKED(t){u(this.view,this.offset+387,255,t),this.setHasUSERNAME_MASKED(!0)}uPDATED_MS(){return this.view.getBigUint64(this.offset+648,!0)}setUPDATED_MS(t){this.view.setBigUint64(this.offset+648,t,!0)}vERIFIED_MS(){return this.view.getBigUint64(this.offset+656,!0)}setVERIFIED_MS(t){this.view.setBigUint64(this.offset+656,t,!0)}};n(ns,\"SIZE\",664);n(ns,\"ALIGN\",8);var Ca=ns,os=class lr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new lr(t,s)}hasCID(){return f(this.view,this.offset,0)}setHasCID(t){h(this.view,this.offset,0,t)}cID(){return c(this.view,this.offset+1,128)}setCID(t){u(this.view,this.offset+1,128,t),this.setHasCID(!0)}hasNAME(){return f(this.view,this.offset,1)}setHasNAME(t){h(this.view,this.offset,1,t)}nAME(){return c(this.view,this.offset+130,255)}setNAME(t){u(this.view,this.offset+130,255,t),this.setHasNAME(!0)}hasTYPE(){return f(this.view,this.offset,2)}setHasTYPE(t){h(this.view,this.offset,2,t)}tYPE(){return c(this.view,this.offset+386,32)}setTYPE(t){u(this.view,this.offset+386,32,t),this.setHasTYPE(!0)}hasLIFETIME(){return f(this.view,this.offset,3)}setHasLIFETIME(t){h(this.view,this.offset,3,t)}lIFETIME(){return c(this.view,this.offset+419,32)}setLIFETIME(t){u(this.view,this.offset+419,32,t),this.setHasLIFETIME(!0)}hasTTL(){return f(this.view,this.offset,4)}setHasTTL(t){h(this.view,this.offset,4,t)}tTL(){return c(this.view,this.offset+452,32)}setTTL(t){u(this.view,this.offset+452,32,t),this.setHasTTL(!0)}nO_PIN(){return this.view.getUint8(this.offset+485)!==0}setNO_PIN(t){this.view.setUint8(this.offset+485,t?1:0)}};n(os,\"SIZE\",486);n(os,\"ALIGN\",1);var Ua=os,as=class _r{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new _r(t,s)}hasCID(){return f(this.view,this.offset,0)}setHasCID(t){h(this.view,this.offset,0,t)}cID(){return c(this.view,this.offset+1,128)}setCID(t){u(this.view,this.offset+1,128,t),this.setHasCID(!0)}hasNAME(){return f(this.view,this.offset,1)}setHasNAME(t){h(this.view,this.offset,1,t)}nAME(){return c(this.view,this.offset+130,255)}setNAME(t){u(this.view,this.offset+130,255,t),this.setHasNAME(!0)}hasVALUE(){return f(this.view,this.offset,2)}setHasVALUE(t){h(this.view,this.offset,2,t)}vALUE(){return c(this.view,this.offset+386,255)}setVALUE(t){u(this.view,this.offset+386,255,t),this.setHasVALUE(!0)}sIZE(){return this.view.getBigUint64(this.offset+648,!0)}setSIZE(t){this.view.setBigUint64(this.offset+648,t,!0)}hasAGENT_VERSION(){return f(this.view,this.offset,3)}setHasAGENT_VERSION(t){h(this.view,this.offset,3,t)}aGENT_VERSION(){return c(this.view,this.offset+656,128)}setAGENT_VERSION(t){u(this.view,this.offset+656,128,t),this.setHasAGENT_VERSION(!0)}hasPROTOCOL_VERSION(){return f(this.view,this.offset,4)}setHasPROTOCOL_VERSION(t){h(this.view,this.offset,4,t)}pROTOCOL_VERSION(){return c(this.view,this.offset+785,64)}setPROTOCOL_VERSION(t){u(this.view,this.offset+785,64,t),this.setHasPROTOCOL_VERSION(!0)}};n(as,\"SIZE\",856);n(as,\"ALIGN\",8);var Pa=as,fs=class dr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new dr(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return c(this.view,this.offset+1,255)}setNAME(t){u(this.view,this.offset+1,255,t),this.setHasNAME(!0)}hasCID(){return f(this.view,this.offset,1)}setHasCID(t){h(this.view,this.offset,1,t)}cID(){return c(this.view,this.offset+257,128)}setCID(t){u(this.view,this.offset+257,128,t),this.setHasCID(!0)}sIZE(){return this.view.getBigUint64(this.offset+392,!0)}setSIZE(t){this.view.setBigUint64(this.offset+392,t,!0)}tYPE(){return this.view.getInt32(this.offset+400,!0)}setTYPE(t){this.view.setInt32(this.offset+400,t,!0)}};n(fs,\"SIZE\",408);n(fs,\"ALIGN\",8);var va=fs,hs=class Ir{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Ir(t,s)}hasCID(){return f(this.view,this.offset,0)}setHasCID(t){h(this.view,this.offset,0,t)}cID(){return c(this.view,this.offset+1,128)}setCID(t){u(this.view,this.offset+1,128,t),this.setHasCID(!0)}hasTYPE(){return f(this.view,this.offset,1)}setHasTYPE(t){h(this.view,this.offset,1,t)}tYPE(){return c(this.view,this.offset+130,32)}setTYPE(t){u(this.view,this.offset+130,32,t),this.setHasTYPE(!0)}};n(hs,\"SIZE\",163);n(hs,\"ALIGN\",1);var Ha=hs,cs=class pr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new pr(t,s)}hasPEER_ID(){return f(this.view,this.offset,0)}setHasPEER_ID(t){h(this.view,this.offset,0,t)}pEER_ID(){return c(this.view,this.offset+1,128)}setPEER_ID(t){u(this.view,this.offset+1,128,t),this.setHasPEER_ID(!0)}hasADDRESS(){return f(this.view,this.offset,1)}setHasADDRESS(t){h(this.view,this.offset,1,t)}aDDRESS(){return c(this.view,this.offset+130,255)}setADDRESS(t){u(this.view,this.offset+130,255,t),this.setHasADDRESS(!0)}lATENCY_MS(){return this.view.getFloat64(this.offset+392,!0)}setLATENCY_MS(t){this.view.setFloat64(this.offset+392,t,!0)}};n(cs,\"SIZE\",400);n(cs,\"ALIGN\",8);var Ba=cs,us=class Sr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Sr(t,s)}hasTOPIC(){return f(this.view,this.offset,0)}setHasTOPIC(t){h(this.view,this.offset,0,t)}tOPIC(){return c(this.view,this.offset+1,255)}setTOPIC(t){u(this.view,this.offset+1,255,t),this.setHasTOPIC(!0)}};n(us,\"SIZE\",257);n(us,\"ALIGN\",1);var Ma=us,Es=class Ar{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Ar(t,s)}aLREADY(){return this.view.getUint8(this.offset+0)!==0}setALREADY(t){this.view.setUint8(this.offset+0,t?1:0)}};n(Es,\"SIZE\",1);n(Es,\"ALIGN\",1);var Fa=Es,ls=class br{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new br(t,s)}hasTARGET(){return f(this.view,this.offset,0)}setHasTARGET(t){h(this.view,this.offset,0,t)}tARGET(){return c(this.view,this.offset+1,255)}setTARGET(t){u(this.view,this.offset+1,255,t),this.setHasTARGET(!0)}hasPROTOCOL_ID(){return f(this.view,this.offset,1)}setHasPROTOCOL_ID(t){h(this.view,this.offset,1,t)}pROTOCOL_ID(){return c(this.view,this.offset+257,128)}setPROTOCOL_ID(t){u(this.view,this.offset+257,128,t),this.setHasPROTOCOL_ID(!0)}hasPEER_ID(){return f(this.view,this.offset,2)}setHasPEER_ID(t){h(this.view,this.offset,2,t)}pEER_ID(){return c(this.view,this.offset+386,128)}setPEER_ID(t){u(this.view,this.offset+386,128,t),this.setHasPEER_ID(!0)}tIMEOUT_MS(){return this.view.getUint32(this.offset+516,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+516,t,!0)}};n(ls,\"SIZE\",520);n(ls,\"ALIGN\",4);var Va=ls,_s=class Rr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Rr(t,s)}hasPEER_ID(){return f(this.view,this.offset,0)}setHasPEER_ID(t){h(this.view,this.offset,0,t)}pEER_ID(){return c(this.view,this.offset+1,128)}setPEER_ID(t){u(this.view,this.offset+1,128,t),this.setHasPEER_ID(!0)}lIMIT(){return this.view.getUint32(this.offset+132,!0)}setLIMIT(t){this.view.setUint32(this.offset+132,t,!0)}hasSTANDARD(){return f(this.view,this.offset,1)}setHasSTANDARD(t){h(this.view,this.offset,1,t)}sTANDARD(){return c(this.view,this.offset+136,16)}setSTANDARD(t){u(this.view,this.offset+136,16,t),this.setHasSTANDARD(!0)}dELIVER(){return this.view.getUint8(this.offset+153)}setDELIVER(t){this.view.setUint8(this.offset+153,t)}};n(_s,\"SIZE\",156);n(_s,\"ALIGN\",4);var xa=_s,ds=class wr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new wr(t,s)}hasSELF(){return f(this.view,this.offset,0)}setHasSELF(t){h(this.view,this.offset,0,t)}sELF(){return c(this.view,this.offset+1,128)}setSELF(t){u(this.view,this.offset+1,128,t),this.setHasSELF(!0)}hasPEER_ID(){return f(this.view,this.offset,1)}setHasPEER_ID(t){h(this.view,this.offset,1,t)}pEER_ID(){return c(this.view,this.offset+130,128)}setPEER_ID(t){u(this.view,this.offset+130,128,t),this.setHasPEER_ID(!0)}pUBLISHER_KEY_AVAILABLE(){return this.view.getUint8(this.offset+259)!==0}setPUBLISHER_KEY_AVAILABLE(t){this.view.setUint8(this.offset+259,t?1:0)}gOSSIP_ONLY_EXCLUDED(){return this.view.getUint32(this.offset+260,!0)}setGOSSIP_ONLY_EXCLUDED(t){this.view.setUint32(this.offset+260,t,!0)}};n(ds,\"SIZE\",264);n(ds,\"ALIGN\",4);var Ga=ds,Is=class Tr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Tr(t,s)}hasPEER_ID(){return f(this.view,this.offset,0)}setHasPEER_ID(t){h(this.view,this.offset,0,t)}pEER_ID(){return c(this.view,this.offset+1,128)}setPEER_ID(t){u(this.view,this.offset+1,128,t),this.setHasPEER_ID(!0)}cONNECTED(){return this.view.getUint8(this.offset+130)!==0}setCONNECTED(t){this.view.setUint8(this.offset+130,t?1:0)}sELF(){return this.view.getUint8(this.offset+131)!==0}setSELF(t){this.view.setUint8(this.offset+131,t?1:0)}ePM_INDEX(){return this.view.getInt32(this.offset+132,!0)}setEPM_INDEX(t){this.view.setInt32(this.offset+132,t,!0)}hasAGENT_VERSION(){return f(this.view,this.offset,1)}setHasAGENT_VERSION(t){h(this.view,this.offset,1,t)}aGENT_VERSION(){return c(this.view,this.offset+136,128)}setAGENT_VERSION(t){u(this.view,this.offset+136,128,t),this.setHasAGENT_VERSION(!0)}};n(Is,\"SIZE\",268);n(Is,\"ALIGN\",4);var Ya=Is,ps=class Or{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Or(t,s)}hasPEER_ID(){return f(this.view,this.offset,0)}setHasPEER_ID(t){h(this.view,this.offset,0,t)}pEER_ID(){return c(this.view,this.offset+1,128)}setPEER_ID(t){u(this.view,this.offset+1,128,t),this.setHasPEER_ID(!0)}hasVALUE(){return f(this.view,this.offset,1)}setHasVALUE(t){h(this.view,this.offset,1,t)}vALUE(){return c(this.view,this.offset+130,255)}setVALUE(t){u(this.view,this.offset+130,255,t),this.setHasVALUE(!0)}};n(ps,\"SIZE\",386);n(ps,\"ALIGN\",1);var ka=ps,Ss=class mr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new mr(t,s)}hasPEER_ID(){return f(this.view,this.offset,0)}setHasPEER_ID(t){h(this.view,this.offset,0,t)}pEER_ID(){return c(this.view,this.offset+2,128)}setPEER_ID(t){u(this.view,this.offset+2,128,t),this.setHasPEER_ID(!0)}hasPUBLISHER_PEER_ID(){return f(this.view,this.offset,1)}setHasPUBLISHER_PEER_ID(t){h(this.view,this.offset,1,t)}pUBLISHER_PEER_ID(){return c(this.view,this.offset+131,128)}setPUBLISHER_PEER_ID(t){u(this.view,this.offset+131,128,t),this.setHasPUBLISHER_PEER_ID(!0)}hasGOSSIP_PEER_ID(){return f(this.view,this.offset,2)}setHasGOSSIP_PEER_ID(t){h(this.view,this.offset,2,t)}gOSSIP_PEER_ID(){return c(this.view,this.offset+260,128)}setGOSSIP_PEER_ID(t){u(this.view,this.offset+260,128,t),this.setHasGOSSIP_PEER_ID(!0)}hasSTANDARD(){return f(this.view,this.offset,3)}setHasSTANDARD(t){h(this.view,this.offset,3,t)}sTANDARD(){return c(this.view,this.offset+389,16)}setSTANDARD(t){u(this.view,this.offset+389,16,t),this.setHasSTANDARD(!0)}hasSCHEMA(){return f(this.view,this.offset,4)}setHasSCHEMA(t){h(this.view,this.offset,4,t)}sCHEMA(){return c(this.view,this.offset+406,64)}setSCHEMA(t){u(this.view,this.offset+406,64,t),this.setHasSCHEMA(!0)}hasFILE_ID(){return f(this.view,this.offset,5)}setHasFILE_ID(t){h(this.view,this.offset,5,t)}fILE_ID(){return c(this.view,this.offset+471,255)}setFILE_ID(t){u(this.view,this.offset+471,255,t),this.setHasFILE_ID(!0)}hasFILE_NAME(){return f(this.view,this.offset,6)}setHasFILE_NAME(t){h(this.view,this.offset,6,t)}fILE_NAME(){return c(this.view,this.offset+727,255)}setFILE_NAME(t){u(this.view,this.offset+727,255,t),this.setHasFILE_NAME(!0)}hasCID(){return f(this.view,this.offset,7)}setHasCID(t){h(this.view,this.offset,7,t)}cID(){return c(this.view,this.offset+983,128)}setCID(t){u(this.view,this.offset+983,128,t),this.setHasCID(!0)}pUBLISH_MS(){return this.view.getBigUint64(this.offset+1112,!0)}setPUBLISH_MS(t){this.view.setBigUint64(this.offset+1112,t,!0)}hasSIGNATURE_TYPE(){return f(this.view,this.offset,8)}setHasSIGNATURE_TYPE(t){h(this.view,this.offset,8,t)}sIGNATURE_TYPE(){return c(this.view,this.offset+1120,32)}setSIGNATURE_TYPE(t){u(this.view,this.offset+1120,32,t),this.setHasSIGNATURE_TYPE(!0)}hasSIGNATURE_HEX(){return f(this.view,this.offset,9)}setHasSIGNATURE_HEX(t){h(this.view,this.offset,9,t)}sIGNATURE_HEX(){return c(this.view,this.offset+1153,255)}setSIGNATURE_HEX(t){u(this.view,this.offset+1153,255,t),this.setHasSIGNATURE_HEX(!0)}sIGNATURE_VERIFIED(){return this.view.getUint8(this.offset+1409)!==0}setSIGNATURE_VERIFIED(t){this.view.setUint8(this.offset+1409,t?1:0)}hasATTRIBUTION(){return f(this.view,this.offset,10)}setHasATTRIBUTION(t){h(this.view,this.offset,10,t)}aTTRIBUTION(){return c(this.view,this.offset+1410,16)}setATTRIBUTION(t){u(this.view,this.offset+1410,16,t),this.setHasATTRIBUTION(!0)}pNM_INDEX(){return this.view.getInt32(this.offset+1428,!0)}setPNM_INDEX(t){this.view.setInt32(this.offset+1428,t,!0)}hasPUBLISHER_KEY_HEX(){return f(this.view,this.offset,11)}setHasPUBLISHER_KEY_HEX(t){h(this.view,this.offset,11,t)}pUBLISHER_KEY_HEX(){return c(this.view,this.offset+1432,128)}setPUBLISHER_KEY_HEX(t){u(this.view,this.offset+1432,128,t),this.setHasPUBLISHER_KEY_HEX(!0)}hasPUBLISHER_KEY_SOURCE(){return f(this.view,this.offset,12)}setHasPUBLISHER_KEY_SOURCE(t){h(this.view,this.offset,12,t)}pUBLISHER_KEY_SOURCE(){return c(this.view,this.offset+1561,64)}setPUBLISHER_KEY_SOURCE(t){u(this.view,this.offset+1561,64,t),this.setHasPUBLISHER_KEY_SOURCE(!0)}};n(Ss,\"SIZE\",1632);n(Ss,\"ALIGN\",8);var qa=Ss,As=class gr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new gr(t,s)}kNOWN(){return this.view.getUint8(this.offset+2)!==0}setKNOWN(t){this.view.setUint8(this.offset+2,t?1:0)}hasREASON(){return f(this.view,this.offset,0)}setHasREASON(t){h(this.view,this.offset,0,t)}rEASON(){return c(this.view,this.offset+3,64)}setREASON(t){u(this.view,this.offset+3,64,t),this.setHasREASON(!0)}pINNED(){return this.view.getUint8(this.offset+68)!==0}setPINNED(t){this.view.setUint8(this.offset+68,t?1:0)}sELF(){return this.view.getUint8(this.offset+69)!==0}setSELF(t){this.view.setUint8(this.offset+69,t?1:0)}fRESH(){return this.view.getUint8(this.offset+70)!==0}setFRESH(t){this.view.setUint8(this.offset+70,t?1:0)}hasSTANDARD(){return f(this.view,this.offset,1)}setHasSTANDARD(t){h(this.view,this.offset,1,t)}sTANDARD(){return c(this.view,this.offset+71,16)}setSTANDARD(t){u(this.view,this.offset+71,16,t),this.setHasSTANDARD(!0)}hasSCHEMA(){return f(this.view,this.offset,2)}setHasSCHEMA(t){h(this.view,this.offset,2,t)}sCHEMA(){return c(this.view,this.offset+88,64)}setSCHEMA(t){u(this.view,this.offset+88,64,t),this.setHasSCHEMA(!0)}hasPNM_CID(){return f(this.view,this.offset,3)}setHasPNM_CID(t){h(this.view,this.offset,3,t)}pNM_CID(){return c(this.view,this.offset+153,128)}setPNM_CID(t){u(this.view,this.offset+153,128,t),this.setHasPNM_CID(!0)}hasPNM_FILE_ID(){return f(this.view,this.offset,4)}setHasPNM_FILE_ID(t){h(this.view,this.offset,4,t)}pNM_FILE_ID(){return c(this.view,this.offset+282,255)}setPNM_FILE_ID(t){u(this.view,this.offset+282,255,t),this.setHasPNM_FILE_ID(!0)}pNM_PUBLISH_MS(){return this.view.getBigUint64(this.offset+544,!0)}setPNM_PUBLISH_MS(t){this.view.setBigUint64(this.offset+544,t,!0)}pNM_SIGNATURE_VERIFIED(){return this.view.getUint8(this.offset+552)!==0}setPNM_SIGNATURE_VERIFIED(t){this.view.setUint8(this.offset+552,t?1:0)}hasPNM_ATTRIBUTION(){return f(this.view,this.offset,5)}setHasPNM_ATTRIBUTION(t){h(this.view,this.offset,5,t)}pNM_ATTRIBUTION(){return c(this.view,this.offset+553,16)}setPNM_ATTRIBUTION(t){u(this.view,this.offset+553,16,t),this.setHasPNM_ATTRIBUTION(!0)}hasBATCH_ID(){return f(this.view,this.offset,6)}setHasBATCH_ID(t){h(this.view,this.offset,6,t)}bATCH_ID(){return c(this.view,this.offset+570,128)}setBATCH_ID(t){u(this.view,this.offset+570,128,t),this.setHasBATCH_ID(!0)}hasPROVIDER_ID(){return f(this.view,this.offset,7)}setHasPROVIDER_ID(t){h(this.view,this.offset,7,t)}pROVIDER_ID(){return c(this.view,this.offset+699,128)}setPROVIDER_ID(t){u(this.view,this.offset+699,128,t),this.setHasPROVIDER_ID(!0)}hasSOURCE_NAME(){return f(this.view,this.offset,8)}setHasSOURCE_NAME(t){h(this.view,this.offset,8,t)}sOURCE_NAME(){return c(this.view,this.offset+828,128)}setSOURCE_NAME(t){u(this.view,this.offset+828,128,t),this.setHasSOURCE_NAME(!0)}rECORD_COUNT(){return this.view.getBigUint64(this.offset+960,!0)}setRECORD_COUNT(t){this.view.setBigUint64(this.offset+960,t,!0)}bYTE_COUNT(){return this.view.getBigUint64(this.offset+968,!0)}setBYTE_COUNT(t){this.view.setBigUint64(this.offset+968,t,!0)}pARTS(){return this.view.getUint32(this.offset+976,!0)}setPARTS(t){this.view.setUint32(this.offset+976,t,!0)}pUBLISHED_MS(){return this.view.getBigUint64(this.offset+984,!0)}setPUBLISHED_MS(t){this.view.setBigUint64(this.offset+984,t,!0)}hasETAG_FNV1A64(){return f(this.view,this.offset,9)}setHasETAG_FNV1A64(t){h(this.view,this.offset,9,t)}eTAG_FNV1A64(){return c(this.view,this.offset+992,16)}setETAG_FNV1A64(t){u(this.view,this.offset+992,16,t),this.setHasETAG_FNV1A64(!0)}hasREF(){return f(this.view,this.offset,10)}setHasREF(t){h(this.view,this.offset,10,t)}rEF(){return new se(this.buffer,this.offset+1016)}};n(As,\"SIZE\",1072);n(As,\"ALIGN\",8);var Ka=As,bs=class yr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new yr(t,s)}uPTIME_S(){return this.view.getBigUint64(this.offset+8,!0)}setUPTIME_S(t){this.view.setBigUint64(this.offset+8,t,!0)}sTARTED_MS(){return this.view.getBigUint64(this.offset+16,!0)}setSTARTED_MS(t){this.view.setBigUint64(this.offset+16,t,!0)}sTORE_TOTAL_BYTES(){return this.view.getBigUint64(this.offset+24,!0)}setSTORE_TOTAL_BYTES(t){this.view.setBigUint64(this.offset+24,t,!0)}sTORE_TOTAL_RECORDS(){return this.view.getBigUint64(this.offset+32,!0)}setSTORE_TOTAL_RECORDS(t){this.view.setBigUint64(this.offset+32,t,!0)}hasSTORAGE_PATH(){return f(this.view,this.offset,0)}setHasSTORAGE_PATH(t){h(this.view,this.offset,0,t)}sTORAGE_PATH(){return c(this.view,this.offset+40,255)}setSTORAGE_PATH(t){u(this.view,this.offset+40,255,t),this.setHasSTORAGE_PATH(!0)}hAS_DISK(){return this.view.getUint8(this.offset+296)!==0}setHAS_DISK(t){this.view.setUint8(this.offset+296,t?1:0)}dISK_CAPACITY_BYTES(){return this.view.getBigUint64(this.offset+304,!0)}setDISK_CAPACITY_BYTES(t){this.view.setBigUint64(this.offset+304,t,!0)}dISK_FREE_BYTES(){return this.view.getBigUint64(this.offset+312,!0)}setDISK_FREE_BYTES(t){this.view.setBigUint64(this.offset+312,t,!0)}dISK_AVAILABLE_BYTES(){return this.view.getBigUint64(this.offset+320,!0)}setDISK_AVAILABLE_BYTES(t){this.view.setBigUint64(this.offset+320,t,!0)}hasSERVICE_STATE(){return f(this.view,this.offset,1)}setHasSERVICE_STATE(t){h(this.view,this.offset,1,t)}sERVICE_STATE(){return c(this.view,this.offset+328,32)}setSERVICE_STATE(t){u(this.view,this.offset+328,32,t),this.setHasSERVICE_STATE(!0)}hasSERVICE_MODE(){return f(this.view,this.offset,2)}setHasSERVICE_MODE(t){h(this.view,this.offset,2,t)}sERVICE_MODE(){return c(this.view,this.offset+361,32)}setSERVICE_MODE(t){u(this.view,this.offset+361,32,t),this.setHasSERVICE_MODE(!0)}hAS_BANDWIDTH(){return this.view.getUint8(this.offset+394)!==0}setHAS_BANDWIDTH(t){this.view.setUint8(this.offset+394,t?1:0)}tOTAL_IN_BYTES(){return this.view.getBigUint64(this.offset+400,!0)}setTOTAL_IN_BYTES(t){this.view.setBigUint64(this.offset+400,t,!0)}tOTAL_OUT_BYTES(){return this.view.getBigUint64(this.offset+408,!0)}setTOTAL_OUT_BYTES(t){this.view.setBigUint64(this.offset+408,t,!0)}rATE_IN_BPS(){return this.view.getFloat64(this.offset+416,!0)}setRATE_IN_BPS(t){this.view.setFloat64(this.offset+416,t,!0)}rATE_OUT_BPS(){return this.view.getFloat64(this.offset+424,!0)}setRATE_OUT_BPS(t){this.view.setFloat64(this.offset+424,t,!0)}};n(bs,\"SIZE\",432);n(bs,\"ALIGN\",8);var ja=bs,Rs=class Nr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Nr(t,s)}tS_MS(){return this.view.getBigUint64(this.offset+0,!0)}setTS_MS(t){this.view.setBigUint64(this.offset+0,t,!0)}tOTAL_IN_BYTES(){return this.view.getBigUint64(this.offset+8,!0)}setTOTAL_IN_BYTES(t){this.view.setBigUint64(this.offset+8,t,!0)}tOTAL_OUT_BYTES(){return this.view.getBigUint64(this.offset+16,!0)}setTOTAL_OUT_BYTES(t){this.view.setBigUint64(this.offset+16,t,!0)}rATE_IN_BPS(){return this.view.getFloat64(this.offset+24,!0)}setRATE_IN_BPS(t){this.view.setFloat64(this.offset+24,t,!0)}rATE_OUT_BPS(){return this.view.getFloat64(this.offset+32,!0)}setRATE_OUT_BPS(t){this.view.setFloat64(this.offset+32,t,!0)}};n(Rs,\"SIZE\",40);n(Rs,\"ALIGN\",8);var Wa=Rs,ws=class Dr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Dr(t,s)}lIMIT(){return this.view.getUint32(this.offset+0,!0)}setLIMIT(t){this.view.setUint32(this.offset+0,t,!0)}};n(ws,\"SIZE\",4);n(ws,\"ALIGN\",4);var $a=ws,Ts=class Lr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Lr(t,s)}tS_MS(){return this.view.getBigUint64(this.offset+8,!0)}setTS_MS(t){this.view.setBigUint64(this.offset+8,t,!0)}hasKIND(){return f(this.view,this.offset,0)}setHasKIND(t){h(this.view,this.offset,0,t)}kIND(){return c(this.view,this.offset+16,32)}setKIND(t){u(this.view,this.offset+16,32,t),this.setHasKIND(!0)}hasDETAIL(){return f(this.view,this.offset,1)}setHasDETAIL(t){h(this.view,this.offset,1,t)}dETAIL(){return c(this.view,this.offset+49,255)}setDETAIL(t){u(this.view,this.offset+49,255,t),this.setHasDETAIL(!0)}hasPEER_ID(){return f(this.view,this.offset,2)}setHasPEER_ID(t){h(this.view,this.offset,2,t)}pEER_ID(){return c(this.view,this.offset+305,128)}setPEER_ID(t){u(this.view,this.offset+305,128,t),this.setHasPEER_ID(!0)}};n(Ts,\"SIZE\",440);n(Ts,\"ALIGN\",8);var Za=Ts,Os=class Cr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Cr(t,s)}mS(){return this.view.getUint32(this.offset+0,!0)}setMS(t){this.view.setUint32(this.offset+0,t,!0)}};n(Os,\"SIZE\",4);n(Os,\"ALIGN\",4);var Qa=Os,ms=class Ur{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Ur(t,s)}hasEXPRESSION(){return f(this.view,this.offset,0)}setHasEXPRESSION(t){h(this.view,this.offset,0,t)}eXPRESSION(){return c(this.view,this.offset+1,128)}setEXPRESSION(t){u(this.view,this.offset+1,128,t),this.setHasEXPRESSION(!0)}aT_MS(){return this.view.getBigUint64(this.offset+136,!0)}setAT_MS(t){this.view.setBigUint64(this.offset+136,t,!0)}};n(ms,\"SIZE\",144);n(ms,\"ALIGN\",8);var za=ms,gs=class Pr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Pr(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return c(this.view,this.offset+1,16)}setNAME(t){u(this.view,this.offset+1,16,t),this.setHasNAME(!0)}hasSOURCE(){return f(this.view,this.offset,1)}setHasSOURCE(t){h(this.view,this.offset,1,t)}sOURCE(){return c(this.view,this.offset+18,64)}setSOURCE(t){u(this.view,this.offset+18,64,t),this.setHasSOURCE(!0)}hAS_WILDCARD(){return this.view.getUint8(this.offset+83)!==0}setHAS_WILDCARD(t){this.view.setUint8(this.offset+83,t?1:0)}hasVALUES(){return f(this.view,this.offset,2)}setHasVALUES(t){h(this.view,this.offset,2,t)}vALUESLength(){return this.hasVALUES()?Math.min(this.view.getUint32(this.offset+84,!0),60):0}setVALUESLength(t){let s=Math.max(0,Math.min(t,60));this.view.setUint32(this.offset+84,s,!0),this.setHasVALUES(!0)}vALUESAt(t){return this.view.getInt32(this.offset+84+4+t*4,!0)}setVALUESAt(t,s){this.view.setInt32(this.offset+84+4+t*4,s,!0),this.setHasVALUES(!0)}};n(gs,\"SIZE\",328);n(gs,\"ALIGN\",4);var Xa=gs,ys=class vr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new vr(t,s)}tIMEOUT_MS(){return this.view.getUint32(this.offset+0,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+0,t,!0)}nO_RESPONSE(){return this.view.getUint8(this.offset+4)!==0}setNO_RESPONSE(t){this.view.setUint8(this.offset+4,t?1:0)}mESSAGE_IS_TEXT(){return this.view.getUint8(this.offset+5)!==0}setMESSAGE_IS_TEXT(t){this.view.setUint8(this.offset+5,t?1:0)}};n(ys,\"SIZE\",8);n(ys,\"ALIGN\",4);var Ja=ys,Ns=class Hr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Hr(t,s)}hasPROTOCOL(){return f(this.view,this.offset,0)}setHasPROTOCOL(t){h(this.view,this.offset,0,t)}pROTOCOL(){return c(this.view,this.offset+1,64)}setPROTOCOL(t){u(this.view,this.offset+1,64,t),this.setHasPROTOCOL(!0)}hasEXTENSIONS(){return f(this.view,this.offset,1)}setHasEXTENSIONS(t){h(this.view,this.offset,1,t)}eXTENSIONS(){return c(this.view,this.offset+66,255)}setEXTENSIONS(t){u(this.view,this.offset+66,255,t),this.setHasEXTENSIONS(!0)}cLOSE_CODE(){return this.view.getInt32(this.offset+324,!0)}setCLOSE_CODE(t){this.view.setInt32(this.offset+324,t,!0)}hasCLOSE_REASON(){return f(this.view,this.offset,2)}setHasCLOSE_REASON(t){h(this.view,this.offset,2,t)}cLOSE_REASON(){return c(this.view,this.offset+328,255)}setCLOSE_REASON(t){u(this.view,this.offset+328,255,t),this.setHasCLOSE_REASON(!0)}bODY_IS_TEXT(){return this.view.getUint8(this.offset+584)!==0}setBODY_IS_TEXT(t){this.view.setUint8(this.offset+584,t?1:0)}};n(Ns,\"SIZE\",588);n(Ns,\"ALIGN\",4);var tf=Ns,Ds=class Br{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Br(t,s)}hasHOST(){return f(this.view,this.offset,0)}setHasHOST(t){h(this.view,this.offset,0,t)}hOST(){return c(this.view,this.offset+1,255)}setHOST(t){u(this.view,this.offset+1,255,t),this.setHasHOST(!0)}pORT(){return this.view.getUint16(this.offset+258,!0)}setPORT(t){this.view.setUint16(this.offset+258,t,!0)}hasCLIENT_ID(){return f(this.view,this.offset,1)}setHasCLIENT_ID(t){h(this.view,this.offset,1,t)}cLIENT_ID(){return c(this.view,this.offset+260,128)}setCLIENT_ID(t){u(this.view,this.offset+260,128,t),this.setHasCLIENT_ID(!0)}hasTOPIC(){return f(this.view,this.offset,2)}setHasTOPIC(t){h(this.view,this.offset,2,t)}tOPIC(){return c(this.view,this.offset+389,255)}setTOPIC(t){u(this.view,this.offset+389,255,t),this.setHasTOPIC(!0)}hasUSERNAME(){return f(this.view,this.offset,3)}setHasUSERNAME(t){h(this.view,this.offset,3,t)}uSERNAME(){return c(this.view,this.offset+645,128)}setUSERNAME(t){u(this.view,this.offset+645,128,t),this.setHasUSERNAME(!0)}kEEP_ALIVE_S(){return this.view.getUint16(this.offset+774,!0)}setKEEP_ALIVE_S(t){this.view.setUint16(this.offset+774,t,!0)}tIMEOUT_MS(){return this.view.getUint32(this.offset+776,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+776,t,!0)}pACKET_ID(){return this.view.getUint16(this.offset+780,!0)}setPACKET_ID(t){this.view.setUint16(this.offset+780,t,!0)}};n(Ds,\"SIZE\",784);n(Ds,\"ALIGN\",4);var ef=Ds,Ls=class Mr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Mr(t,s)}hasHOST(){return f(this.view,this.offset,0)}setHasHOST(t){h(this.view,this.offset,0,t)}hOST(){return c(this.view,this.offset+1,255)}setHOST(t){u(this.view,this.offset+1,255,t),this.setHasHOST(!0)}pORT(){return this.view.getUint16(this.offset+258,!0)}setPORT(t){this.view.setUint16(this.offset+258,t,!0)}hasCLIENT_ID(){return f(this.view,this.offset,1)}setHasCLIENT_ID(t){h(this.view,this.offset,1,t)}cLIENT_ID(){return c(this.view,this.offset+260,128)}setCLIENT_ID(t){u(this.view,this.offset+260,128,t),this.setHasCLIENT_ID(!0)}hasTOPIC(){return f(this.view,this.offset,2)}setHasTOPIC(t){h(this.view,this.offset,2,t)}tOPIC(){return c(this.view,this.offset+389,255)}setTOPIC(t){u(this.view,this.offset+389,255,t),this.setHasTOPIC(!0)}pAYLOAD_BYTES(){return this.view.getBigUint64(this.offset+648,!0)}setPAYLOAD_BYTES(t){this.view.setBigUint64(this.offset+648,t,!0)}};n(Ls,\"SIZE\",656);n(Ls,\"ALIGN\",8);var sf=Ls,Cs=class Fr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Fr(t,s)}hasHOST(){return f(this.view,this.offset,0)}setHasHOST(t){h(this.view,this.offset,0,t)}hOST(){return c(this.view,this.offset+1,255)}setHOST(t){u(this.view,this.offset+1,255,t),this.setHasHOST(!0)}pORT(){return this.view.getUint16(this.offset+258,!0)}setPORT(t){this.view.setUint16(this.offset+258,t,!0)}tIMEOUT_MS(){return this.view.getUint32(this.offset+260,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+260,t,!0)}nO_RESPONSE(){return this.view.getUint8(this.offset+264)!==0}setNO_RESPONSE(t){this.view.setUint8(this.offset+264,t?1:0)}hasBIND_ADDRESS(){return f(this.view,this.offset,1)}setHasBIND_ADDRESS(t){h(this.view,this.offset,1,t)}bIND_ADDRESS(){return c(this.view,this.offset+265,64)}setBIND_ADDRESS(t){u(this.view,this.offset+265,64,t),this.setHasBIND_ADDRESS(!0)}bIND_PORT(){return this.view.getUint16(this.offset+330,!0)}setBIND_PORT(t){this.view.setUint16(this.offset+330,t,!0)}hasUDP_TYPE(){return f(this.view,this.offset,2)}setHasUDP_TYPE(t){h(this.view,this.offset,2,t)}uDP_TYPE(){return c(this.view,this.offset+332,8)}setUDP_TYPE(t){u(this.view,this.offset+332,8,t),this.setHasUDP_TYPE(!0)}aLLOW_UNAUTHORIZED(){return this.view.getUint8(this.offset+341)!==0}setALLOW_UNAUTHORIZED(t){this.view.setUint8(this.offset+341,t?1:0)}hasSERVER_NAME(){return f(this.view,this.offset,3)}setHasSERVER_NAME(t){h(this.view,this.offset,3,t)}sERVER_NAME(){return c(this.view,this.offset+342,255)}setSERVER_NAME(t){u(this.view,this.offset+342,255,t),this.setHasSERVER_NAME(!0)}};n(Cs,\"SIZE\",600);n(Cs,\"ALIGN\",4);var rf=Cs,Us=class Vr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Vr(t,s)}hasHOST(){return f(this.view,this.offset,0)}setHasHOST(t){h(this.view,this.offset,0,t)}hOST(){return c(this.view,this.offset+1,255)}setHOST(t){u(this.view,this.offset+1,255,t),this.setHasHOST(!0)}pORT(){return this.view.getUint16(this.offset+258,!0)}setPORT(t){this.view.setUint16(this.offset+258,t,!0)}hasLOCAL_ADDRESS(){return f(this.view,this.offset,1)}setHasLOCAL_ADDRESS(t){h(this.view,this.offset,1,t)}lOCAL_ADDRESS(){return c(this.view,this.offset+260,64)}setLOCAL_ADDRESS(t){u(this.view,this.offset+260,64,t),this.setHasLOCAL_ADDRESS(!0)}lOCAL_PORT(){return this.view.getUint16(this.offset+326,!0)}setLOCAL_PORT(t){this.view.setUint16(this.offset+326,t,!0)}hasREMOTE_ADDRESS(){return f(this.view,this.offset,2)}setHasREMOTE_ADDRESS(t){h(this.view,this.offset,2,t)}rEMOTE_ADDRESS(){return c(this.view,this.offset+328,64)}setREMOTE_ADDRESS(t){u(this.view,this.offset+328,64,t),this.setHasREMOTE_ADDRESS(!0)}rEMOTE_PORT(){return this.view.getUint16(this.offset+394,!0)}setREMOTE_PORT(t){this.view.setUint16(this.offset+394,t,!0)}aUTHORIZED(){return this.view.getUint8(this.offset+396)!==0}setAUTHORIZED(t){this.view.setUint8(this.offset+396,t?1:0)}hasAUTHORIZATION_ERROR(){return f(this.view,this.offset,3)}setHasAUTHORIZATION_ERROR(t){h(this.view,this.offset,3,t)}aUTHORIZATION_ERROR(){return c(this.view,this.offset+397,255)}setAUTHORIZATION_ERROR(t){u(this.view,this.offset+397,255,t),this.setHasAUTHORIZATION_ERROR(!0)}};n(Us,\"SIZE\",654);n(Us,\"ALIGN\",2);var nf=Us,Ps=class xr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new xr(t,s)}nOT_RECURSIVE(){return this.view.getUint8(this.offset+0)!==0}setNOT_RECURSIVE(t){this.view.setUint8(this.offset+0,t?1:0)}};n(Ps,\"SIZE\",1);n(Ps,\"ALIGN\",1);var of=Ps,vs=class Gr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Gr(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return c(this.view,this.offset+1,255)}setNAME(t){u(this.view,this.offset+1,255,t),this.setHasNAME(!0)}iS_FILE(){return this.view.getUint8(this.offset+257)!==0}setIS_FILE(t){this.view.setUint8(this.offset+257,t?1:0)}iS_DIRECTORY(){return this.view.getUint8(this.offset+258)!==0}setIS_DIRECTORY(t){this.view.setUint8(this.offset+258,t?1:0)}};n(vs,\"SIZE\",259);n(vs,\"ALIGN\",1);var af=vs,Hs=class Yr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Yr(t,s)}sIZE(){return this.view.getBigUint64(this.offset+0,!0)}setSIZE(t){this.view.setBigUint64(this.offset+0,t,!0)}iS_FILE(){return this.view.getUint8(this.offset+8)!==0}setIS_FILE(t){this.view.setUint8(this.offset+8,t?1:0)}iS_DIRECTORY(){return this.view.getUint8(this.offset+9)!==0}setIS_DIRECTORY(t){this.view.setUint8(this.offset+9,t?1:0)}cTIME_MS(){return this.view.getFloat64(this.offset+16,!0)}setCTIME_MS(t){this.view.setFloat64(this.offset+16,t,!0)}mTIME_MS(){return this.view.getFloat64(this.offset+24,!0)}setMTIME_MS(t){this.view.setFloat64(this.offset+24,t,!0)}};n(Hs,\"SIZE\",32);n(Hs,\"ALIGN\",8);var ff=Hs,Bs=class kr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new kr(t,s)}tIMEOUT_MS(){return this.view.getUint32(this.offset+0,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+0,t,!0)}};n(Bs,\"SIZE\",4);n(Bs,\"ALIGN\",4);var hf=Bs,Ms=class qr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new qr(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return c(this.view,this.offset+1,128)}setNAME(t){u(this.view,this.offset+1,128,t),this.setHasNAME(!0)}hasVALUE(){return f(this.view,this.offset,1)}setHasVALUE(t){h(this.view,this.offset,1,t)}vALUE(){return c(this.view,this.offset+130,255)}setVALUE(t){u(this.view,this.offset+130,255,t),this.setHasVALUE(!0)}};n(Ms,\"SIZE\",386);n(Ms,\"ALIGN\",1);var cf=Ms,Fs=class Kr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Kr(t,s)}eXIT_CODE(){return this.view.getInt32(this.offset+4,!0)}setEXIT_CODE(t){this.view.setInt32(this.offset+4,t,!0)}hasSIGNAL(){return f(this.view,this.offset,0)}setHasSIGNAL(t){h(this.view,this.offset,0,t)}sIGNAL(){return c(this.view,this.offset+8,16)}setSIGNAL(t){u(this.view,this.offset+8,16,t),this.setHasSIGNAL(!0)}};n(Fs,\"SIZE\",28);n(Fs,\"ALIGN\",4);var uf=Fs,Vs=class jr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new jr(t,s)}hasSCOPE(){return f(this.view,this.offset,0)}setHasSCOPE(t){h(this.view,this.offset,0,t)}sCOPE(){return c(this.view,this.offset+1,128)}setSCOPE(t){u(this.view,this.offset+1,128,t),this.setHasSCOPE(!0)}hasKEY(){return f(this.view,this.offset,1)}setHasKEY(t){h(this.view,this.offset,1,t)}kEY(){return c(this.view,this.offset+130,255)}setKEY(t){u(this.view,this.offset+130,255,t),this.setHasKEY(!0)}};n(Vs,\"SIZE\",386);n(Vs,\"ALIGN\",1);var Ef=Vs;var ot=new Int32Array(2),ie=new Float32Array(ot.buffer),re=new Float64Array(ot.buffer),Lt=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Ht;(function(e){e[e.UTF8_BYTES=1]=\"UTF8_BYTES\",e[e.UTF16_STRING=2]=\"UTF16_STRING\"})(Ht||(Ht={}));var at=class e{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new e(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return ot[0]=this.readInt32(t),ie[0]}readFloat64(t){return ot[Lt?0:1]=this.readInt32(t),ot[Lt?1:0]=this.readInt32(t+4),re[0]}writeInt8(t,s){this.bytes_[t]=s}writeUint8(t,s){this.bytes_[t]=s}writeInt16(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8}writeUint16(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8}writeInt32(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8,this.bytes_[t+2]=s>>16,this.bytes_[t+3]=s>>24}writeUint32(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8,this.bytes_[t+2]=s>>16,this.bytes_[t+3]=s>>24}writeInt64(t,s){this.writeInt32(t,Number(BigInt.asIntN(32,s))),this.writeInt32(t+4,Number(BigInt.asIntN(32,s>>BigInt(32))))}writeUint64(t,s){this.writeUint32(t,Number(BigInt.asUintN(32,s))),this.writeUint32(t+4,Number(BigInt.asUintN(32,s>>BigInt(32))))}writeFloat32(t,s){ie[0]=s,this.writeInt32(t,ot[0])}writeFloat64(t,s){re[0]=s,this.writeInt32(t,ot[Lt?0:1]),this.writeInt32(t+4,ot[Lt?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error(\"FlatBuffers: ByteBuffer is too short to contain an identifier.\");let t=\"\";for(let s=0;s<4;s++)t+=String.fromCharCode(this.readInt8(this.position_+4+s));return t}__offset(t,s){let i=t-this.readInt32(t);return s<this.readInt16(i)?this.readInt16(i+s):0}__union(t,s){return t.bb_pos=s+this.readInt32(s),t.bb=this,t}__string(t,s){t+=this.readInt32(t);let i=this.readInt32(t);t+=4;let r=this.bytes_.subarray(t,t+i);return s===Ht.UTF8_BYTES?r:this.text_decoder_.decode(r)}__union_with_string(t,s){return typeof t==\"string\"?this.__string(s):this.__union(t,s)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+4}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=4)throw new Error(\"FlatBuffers: file identifier must be length \"+4);for(let s=0;s<4;s++)if(t.charCodeAt(s)!=this.readInt8(this.position()+4+s))return!1;return!0}createScalarList(t,s){let i=[];for(let r=0;r<s;++r){let o=t(r);o!==null&&i.push(o)}return i}createObjList(t,s){let i=[];for(let r=0;r<s;++r){let o=t(r);o!==null&&i.push(o.unpack())}return i}};var Bt=class e{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let s;t?s=t:s=1024,this.bb=at.allocate(s),this.space=s}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,s){t>this.minalign&&(this.minalign=t);let i=~(this.bb.capacity()-this.space+s)+1&t-1;for(;this.space<i+t+s;){let r=this.bb.capacity();this.bb=e.growByteBuffer(this.bb),this.space+=this.bb.capacity()-r}this.pad(i)}pad(t){for(let s=0;s<t;s++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,s,i){(this.force_defaults||s!=i)&&(this.addInt8(s),this.slot(t))}addFieldInt16(t,s,i){(this.force_defaults||s!=i)&&(this.addInt16(s),this.slot(t))}addFieldInt32(t,s,i){(this.force_defaults||s!=i)&&(this.addInt32(s),this.slot(t))}addFieldInt64(t,s,i){(this.force_defaults||s!==i)&&(this.addInt64(s),this.slot(t))}addFieldFloat32(t,s,i){(this.force_defaults||s!=i)&&(this.addFloat32(s),this.slot(t))}addFieldFloat64(t,s,i){(this.force_defaults||s!=i)&&(this.addFloat64(s),this.slot(t))}addFieldOffset(t,s,i){(this.force_defaults||s!=i)&&(this.addOffset(s),this.slot(t))}addFieldStruct(t,s,i){s!=i&&(this.nested(s),this.slot(t))}nested(t){if(t!=this.offset())throw new TypeError(\"FlatBuffers: struct must be serialized inline.\")}notNested(){if(this.isNested)throw new TypeError(\"FlatBuffers: object serialization must not be nested.\")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){let s=t.capacity();if(s&3221225472)throw new Error(\"FlatBuffers: cannot grow buffer beyond 2 gigabytes.\");let i=s<<1,r=at.allocate(i);return r.setPosition(i-s),r.bytes().set(t.bytes(),i-s),r}addOffset(t){this.prep(4,0),this.writeInt32(this.offset()-t+4)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let s=0;s<t;s++)this.vtable[s]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error(\"FlatBuffers: endObject called without startObject\");this.addInt32(0);let t=this.offset(),s=this.vtable_in_use-1;for(;s>=0&&this.vtable[s]==0;s--);let i=s+1;for(;s>=0;s--)this.addInt16(this.vtable[s]!=0?t-this.vtable[s]:0);let r=2;this.addInt16(t-this.object_start);let o=(i+r)*2;this.addInt16(o);let a=0,E=this.space;t:for(s=0;s<this.vtables.length;s++){let l=this.bb.capacity()-this.vtables[s];if(o==this.bb.readInt16(l)){for(let _=2;_<o;_+=2)if(this.bb.readInt16(E+_)!=this.bb.readInt16(l+_))continue t;a=this.vtables[s];break}}return a?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,a-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,s,i){let r=i?4:0;if(s){let o=s;if(this.prep(this.minalign,8+r),o.length!=4)throw new TypeError(\"FlatBuffers: file identifier must be length \"+4);for(let a=3;a>=0;a--)this.writeInt8(o.charCodeAt(a))}this.prep(this.minalign,4+r),this.addOffset(t),r&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,s){this.finish(t,s,!0)}requiredField(t,s){let i=this.bb.capacity()-t,r=i-this.bb.readInt32(i);if(!(s<this.bb.readInt16(r)&&this.bb.readInt16(r+s)!=0))throw new TypeError(\"FlatBuffers: field \"+s+\" must be set\")}startVector(t,s,i){this.notNested(),this.vector_num_elems=s,this.prep(4,t*s),this.prep(i,t*s)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);let s=this.createString(t);return this.string_maps.set(t,s),s}createString(t){if(t==null)return 0;let s;return t instanceof Uint8Array?s=t:s=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,s.length,1),this.bb.setPosition(this.space-=s.length),this.bb.bytes().set(s,this.space),this.endVector()}createByteVector(t){return t==null?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())}createObjectOffset(t){return t===null?0:typeof t==\"string\"?this.createString(t):t.pack(this)}createObjectOffsetList(t){let s=[];for(let i=0;i<t.length;++i){let r=t[i];if(r!==null)s.push(this.createObjectOffset(r));else throw new TypeError(\"FlatBuffers: Argument for createObjectOffsetList cannot contain null.\")}return s}createStructOffsetList(t,s){return s(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}};var xs;(function(e){e[e.DIRECT=0]=\"DIRECT\",e[e.COMMAND=1]=\"COMMAND\"})(xs||(xs={}));var ft;(function(e){e[e.IMMUTABLE=0]=\"IMMUTABLE\",e[e.APPEND_ONLY=1]=\"APPEND_ONLY\",e[e.MUTABLE=2]=\"MUTABLE\"})(ft||(ft={}));var W;(function(e){e[e.BORROWED=0]=\"BORROWED\",e[e.PRODUCER_OWNED=1]=\"PRODUCER_OWNED\",e[e.HOST_OWNED=2]=\"HOST_OWNED\",e[e.SHARED=3]=\"SHARED\"})(W||(W={}));function $r(e){if(e==null)return{valid:!0,present:!1,bytes:[]};if(typeof e==\"string\"){let s=e.startsWith(\"0x\")?e.slice(2):e;if(s.length===0)return{valid:!0,present:!1,bytes:[]};if(s.length%2!==0||!/^[0-9a-fA-F]+$/.test(s))return{valid:!1,present:!0,bytes:[]};let i=[];for(let r=0;r<s.length;r+=2)i.push(Number.parseInt(s.slice(r,r+2),16));return{valid:!0,present:!0,bytes:i}}if(!Array.isArray(e)&&!(e instanceof Uint8Array))return{valid:!1,present:!0,bytes:[]};let t=Array.from(e);return t.length===0?{valid:!0,present:!1,bytes:[]}:t.some(s=>!Number.isInteger(s)||s<0||s>255)?{valid:!1,present:!0,bytes:[]}:{valid:!0,present:!0,bytes:t}}function Zr(e){let t=$r(e);return t.valid&&t.present?t.bytes:void 0}function Qr(e){return $r(e).valid}function _f(e){return Object.prototype.toString.call(e)}function df(e){if(!e||typeof e!=\"object\")return!1;let t=_f(e);return t===\"[object ArrayBuffer]\"||t===\"[object SharedArrayBuffer]\"}function J(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):df(e)?new Uint8Array(e):null}var q;(function(e){e[e.FLATBUFFER=0]=\"FLATBUFFER\",e[e.ALIGNED_BINARY=1]=\"ALIGNED_BINARY\"})(q||(q={}));var Ct=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsFlatBufferTypeRef(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFlatBufferTypeRef(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}SCHEMA_NAME(t){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.__string(this.bb_pos+s,t):null}FILE_IDENTIFIER(t){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.__string(this.bb_pos+s,t):null}SCHEMA_VERSION(t){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.__string(this.bb_pos+s,t):null}ROOT_TYPE(t){let s=this.bb.__offset(this.bb_pos,10);return s?this.bb.__string(this.bb_pos+s,t):null}SCHEMA_HASH(t){let s=this.bb.__offset(this.bb_pos,12);return s?this.bb.readUint8(this.bb.__vector(this.bb_pos+s)+t):0}schemaHashLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}schemaHashArray(){let t=this.bb.__offset(this.bb_pos,12);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}ACCEPTS_ANY_FLATBUFFER(){let t=this.bb.__offset(this.bb_pos,14);return t?!!this.bb.readInt8(this.bb_pos+t):!1}WIRE_FORMAT(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):q.FLATBUFFER}FIXED_STRING_LENGTH(){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.readUint16(this.bb_pos+t):0}BYTE_LENGTH(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readUint32(this.bb_pos+t):0}REQUIRED_ALIGNMENT(){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readUint16(this.bb_pos+t):0}static startFlatBufferTypeRef(t){t.startObject(10)}static addSchemaName(t,s){t.addFieldOffset(0,s,0)}static addFileIdentifier(t,s){t.addFieldOffset(1,s,0)}static addSchemaVersion(t,s){t.addFieldOffset(2,s,0)}static addRootType(t,s){t.addFieldOffset(3,s,0)}static addSchemaHash(t,s){t.addFieldOffset(4,s,0)}static createSchemaHashVector(t,s){t.startVector(1,s.length,1);for(let i=s.length-1;i>=0;i--)t.addInt8(s[i]);return t.endVector()}static startSchemaHashVector(t,s){t.startVector(1,s,1)}static addAcceptsAnyFlatbuffer(t,s){t.addFieldInt8(5,+s,0)}static addWireFormat(t,s){t.addFieldInt8(6,s,q.FLATBUFFER)}static addFixedStringLength(t,s){t.addFieldInt16(7,s,0)}static addByteLength(t,s){t.addFieldInt32(8,s,0)}static addRequiredAlignment(t,s){t.addFieldInt16(9,s,0)}static endFlatBufferTypeRef(t){return t.endObject()}static createFlatBufferTypeRef(t,s,i,r,o,a,E,l,_,p,O){return e.startFlatBufferTypeRef(t),e.addSchemaName(t,s),e.addFileIdentifier(t,i),e.addSchemaVersion(t,r),e.addRootType(t,o),e.addSchemaHash(t,a),e.addAcceptsAnyFlatbuffer(t,E),e.addWireFormat(t,l),e.addFixedStringLength(t,_),e.addByteLength(t,p),e.addRequiredAlignment(t,O),e.endFlatBufferTypeRef(t)}unpack(){return new Mt(this.SCHEMA_NAME(),this.FILE_IDENTIFIER(),this.SCHEMA_VERSION(),this.ROOT_TYPE(),this.bb.createScalarList(this.SCHEMA_HASH.bind(this),this.schemaHashLength()),this.ACCEPTS_ANY_FLATBUFFER(),this.WIRE_FORMAT(),this.FIXED_STRING_LENGTH(),this.BYTE_LENGTH(),this.REQUIRED_ALIGNMENT())}unpackTo(t){t.SCHEMA_NAME=this.SCHEMA_NAME(),t.FILE_IDENTIFIER=this.FILE_IDENTIFIER(),t.SCHEMA_VERSION=this.SCHEMA_VERSION(),t.ROOT_TYPE=this.ROOT_TYPE(),t.SCHEMA_HASH=this.bb.createScalarList(this.SCHEMA_HASH.bind(this),this.schemaHashLength()),t.ACCEPTS_ANY_FLATBUFFER=this.ACCEPTS_ANY_FLATBUFFER(),t.WIRE_FORMAT=this.WIRE_FORMAT(),t.FIXED_STRING_LENGTH=this.FIXED_STRING_LENGTH(),t.BYTE_LENGTH=this.BYTE_LENGTH(),t.REQUIRED_ALIGNMENT=this.REQUIRED_ALIGNMENT()}},Mt=class{constructor(t=null,s=null,i=null,r=null,o=[],a=!1,E=q.FLATBUFFER,l=0,_=0,p=0){this.SCHEMA_NAME=t,this.FILE_IDENTIFIER=s,this.SCHEMA_VERSION=i,this.ROOT_TYPE=r,this.SCHEMA_HASH=o,this.ACCEPTS_ANY_FLATBUFFER=a,this.WIRE_FORMAT=E,this.FIXED_STRING_LENGTH=l,this.BYTE_LENGTH=_,this.REQUIRED_ALIGNMENT=p}pack(t){let s=this.SCHEMA_NAME!==null?t.createString(this.SCHEMA_NAME):0,i=this.FILE_IDENTIFIER!==null?t.createString(this.FILE_IDENTIFIER):0,r=this.SCHEMA_VERSION!==null?t.createString(this.SCHEMA_VERSION):0,o=this.ROOT_TYPE!==null?t.createString(this.ROOT_TYPE):0,a=Ct.createSchemaHashVector(t,this.SCHEMA_HASH);return Ct.createFlatBufferTypeRef(t,s,i,r,o,a,this.ACCEPTS_ANY_FLATBUFFER,this.WIRE_FORMAT,this.FIXED_STRING_LENGTH,this.BYTE_LENGTH,this.REQUIRED_ALIGNMENT)}};var $;(function(e){e[e.IMMUTABLE=0]=\"IMMUTABLE\",e[e.SINGLE_WRITER_MUTABLE=1]=\"SINGLE_WRITER_MUTABLE\",e[e.APPEND_ONLY=2]=\"APPEND_ONLY\"})($||($={}));var Z;(function(e){e[e.HOST_OWNED=0]=\"HOST_OWNED\",e[e.PLUGIN_OWNED=1]=\"PLUGIN_OWNED\",e[e.TRANSFERRED=2]=\"TRANSFERRED\"})(Z||(Z={}));var x=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsTAB(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTAB(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static bufferHasIdentifier(t){return t.__has_identifier(\"$TAB\")}OFFSET(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb_pos+t):0}SIZE(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint32(this.bb_pos+t):0}ALIGNMENT(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint32(this.bb_pos+t):0}WIRE_FORMAT(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readUint8(this.bb_pos+t):q.FLATBUFFER}TYPE_REF(t){let s=this.bb.__offset(this.bb_pos,12);return s?(t||new Ct).__init(this.bb.__indirect(this.bb_pos+s),this.bb):null}MUTABILITY(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readUint8(this.bb_pos+t):$.IMMUTABLE}OWNERSHIP(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):Z.HOST_OWNED}FRAME_ID(){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.readUint64(this.bb_pos+t):BigInt(\"0\")}PORT_ID(t){let s=this.bb.__offset(this.bb_pos,20);return s?this.bb.__string(this.bb_pos+s,t):null}static startTAB(t){t.startObject(9)}static addOffset(t,s){t.addFieldInt32(0,s,0)}static addSize(t,s){t.addFieldInt32(1,s,0)}static addAlignment(t,s){t.addFieldInt32(2,s,0)}static addWireFormat(t,s){t.addFieldInt8(3,s,q.FLATBUFFER)}static addTypeRef(t,s){t.addFieldOffset(4,s,0)}static addMutability(t,s){t.addFieldInt8(5,s,$.IMMUTABLE)}static addOwnership(t,s){t.addFieldInt8(6,s,Z.HOST_OWNED)}static addFrameId(t,s){t.addFieldInt64(7,s,BigInt(\"0\"))}static addPortId(t,s){t.addFieldOffset(8,s,0)}static endTAB(t){return t.endObject()}static finishTABBuffer(t,s){t.finish(s,\"$TAB\")}static finishSizePrefixedTABBuffer(t,s){t.finish(s,\"$TAB\",!0)}unpack(){return new Ut(this.OFFSET(),this.SIZE(),this.ALIGNMENT(),this.WIRE_FORMAT(),this.TYPE_REF()!==null?this.TYPE_REF().unpack():null,this.MUTABILITY(),this.OWNERSHIP(),this.FRAME_ID(),this.PORT_ID())}unpackTo(t){t.OFFSET=this.OFFSET(),t.SIZE=this.SIZE(),t.ALIGNMENT=this.ALIGNMENT(),t.WIRE_FORMAT=this.WIRE_FORMAT(),t.TYPE_REF=this.TYPE_REF()!==null?this.TYPE_REF().unpack():null,t.MUTABILITY=this.MUTABILITY(),t.OWNERSHIP=this.OWNERSHIP(),t.FRAME_ID=this.FRAME_ID(),t.PORT_ID=this.PORT_ID()}},Ut=class{constructor(t=0,s=0,i=0,r=q.FLATBUFFER,o=null,a=$.IMMUTABLE,E=Z.HOST_OWNED,l=BigInt(\"0\"),_=null){this.OFFSET=t,this.SIZE=s,this.ALIGNMENT=i,this.WIRE_FORMAT=r,this.TYPE_REF=o,this.MUTABILITY=a,this.OWNERSHIP=E,this.FRAME_ID=l,this.PORT_ID=_}pack(t){let s=this.TYPE_REF!==null?this.TYPE_REF.pack(t):0,i=this.PORT_ID!==null?t.createString(this.PORT_ID):0;return x.startTAB(t),x.addOffset(t,this.OFFSET),x.addSize(t,this.SIZE),x.addAlignment(t,this.ALIGNMENT),x.addWireFormat(t,this.WIRE_FORMAT),x.addTypeRef(t,s),x.addMutability(t,this.MUTABILITY),x.addOwnership(t,this.OWNERSHIP),x.addFrameId(t,this.FRAME_ID),x.addPortId(t,i),x.endTAB(t)}};var It=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsPIVRequest(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsPIVRequest(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}METHOD_ID(t){let s=this.bb.__offset(this.bb_pos,4);return this.bb.__string(this.bb_pos+s,t)}INPUTS(t,s){let i=this.bb.__offset(this.bb_pos,6);return i?(s||new x).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}inputsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}PAYLOAD_ARENA(t){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.readUint8(this.bb.__vector(this.bb_pos+s)+t):0}payloadArenaLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}payloadArenaArray(){let t=this.bb.__offset(this.bb_pos,8);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}TRACE_ID(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readUint64(this.bb_pos+t):BigInt(\"0\")}OUTPUT_STREAM_CAP(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readUint32(this.bb_pos+t):0}static startPIVRequest(t){t.startObject(5)}static addMethodId(t,s){t.addFieldOffset(0,s,0)}static addInputs(t,s){t.addFieldOffset(1,s,0)}static createInputsVector(t,s){t.startVector(4,s.length,4);for(let i=s.length-1;i>=0;i--)t.addOffset(s[i]);return t.endVector()}static startInputsVector(t,s){t.startVector(4,s,4)}static addPayloadArena(t,s){t.addFieldOffset(2,s,0)}static createPayloadArenaVector(t,s){t.startVector(1,s.length,1);for(let i=s.length-1;i>=0;i--)t.addInt8(s[i]);return t.endVector()}static startPayloadArenaVector(t,s){t.startVector(1,s,1)}static addTraceId(t,s){t.addFieldInt64(3,s,BigInt(\"0\"))}static addOutputStreamCap(t,s){t.addFieldInt32(4,s,0)}static endPIVRequest(t){let s=t.endObject();return t.requiredField(s,4),s}static createPIVRequest(t,s,i,r,o,a){return e.startPIVRequest(t),e.addMethodId(t,s),e.addInputs(t,i),e.addPayloadArena(t,r),e.addTraceId(t,o),e.addOutputStreamCap(t,a),e.endPIVRequest(t)}unpack(){return new Gs(this.METHOD_ID(),this.bb.createObjList(this.INPUTS.bind(this),this.inputsLength()),this.bb.createScalarList(this.PAYLOAD_ARENA.bind(this),this.payloadArenaLength()),this.TRACE_ID(),this.OUTPUT_STREAM_CAP())}unpackTo(t){t.METHOD_ID=this.METHOD_ID(),t.INPUTS=this.bb.createObjList(this.INPUTS.bind(this),this.inputsLength()),t.PAYLOAD_ARENA=this.bb.createScalarList(this.PAYLOAD_ARENA.bind(this),this.payloadArenaLength()),t.TRACE_ID=this.TRACE_ID(),t.OUTPUT_STREAM_CAP=this.OUTPUT_STREAM_CAP()}},Gs=class{constructor(t=null,s=[],i=[],r=BigInt(\"0\"),o=0){this.METHOD_ID=t,this.INPUTS=s,this.PAYLOAD_ARENA=i,this.TRACE_ID=r,this.OUTPUT_STREAM_CAP=o}pack(t){let s=this.METHOD_ID!==null?t.createString(this.METHOD_ID):0,i=It.createInputsVector(t,t.createObjectOffsetList(this.INPUTS)),r=It.createPayloadArenaVector(t,this.PAYLOAD_ARENA);return It.createPIVRequest(t,s,i,r,this.TRACE_ID,this.OUTPUT_STREAM_CAP)}};var ht;(function(e){e[e.OK=0]=\"OK\",e[e.NOT_FOUND=1]=\"NOT_FOUND\",e[e.YIELDED=2]=\"YIELDED\",e[e.FAILED=3]=\"FAILED\"})(ht||(ht={}));var B=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsPIVResponse(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsPIVResponse(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}STATUS_CODE(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}STATUS(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):ht.OK}YIELDED(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}BACKLOG_REMAINING(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readUint32(this.bb_pos+t):0}OUTPUTS(t,s){let i=this.bb.__offset(this.bb_pos,12);return i?(s||new x).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}outputsLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}PAYLOAD_ARENA(t){let s=this.bb.__offset(this.bb_pos,14);return s?this.bb.readUint8(this.bb.__vector(this.bb_pos+s)+t):0}payloadArenaLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}payloadArenaArray(){let t=this.bb.__offset(this.bb_pos,14);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}ERROR_CODE(t){let s=this.bb.__offset(this.bb_pos,16);return s?this.bb.__string(this.bb_pos+s,t):null}ERROR_MESSAGE(t){let s=this.bb.__offset(this.bb_pos,18);return s?this.bb.__string(this.bb_pos+s,t):null}TRACE_ID(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readUint64(this.bb_pos+t):BigInt(\"0\")}static startPIVResponse(t){t.startObject(9)}static addStatusCode(t,s){t.addFieldInt32(0,s,0)}static addStatus(t,s){t.addFieldInt32(1,s,ht.OK)}static addYielded(t,s){t.addFieldInt8(2,+s,0)}static addBacklogRemaining(t,s){t.addFieldInt32(3,s,0)}static addOutputs(t,s){t.addFieldOffset(4,s,0)}static createOutputsVector(t,s){t.startVector(4,s.length,4);for(let i=s.length-1;i>=0;i--)t.addOffset(s[i]);return t.endVector()}static startOutputsVector(t,s){t.startVector(4,s,4)}static addPayloadArena(t,s){t.addFieldOffset(5,s,0)}static createPayloadArenaVector(t,s){t.startVector(1,s.length,1);for(let i=s.length-1;i>=0;i--)t.addInt8(s[i]);return t.endVector()}static startPayloadArenaVector(t,s){t.startVector(1,s,1)}static addErrorCode(t,s){t.addFieldOffset(6,s,0)}static addErrorMessage(t,s){t.addFieldOffset(7,s,0)}static addTraceId(t,s){t.addFieldInt64(8,s,BigInt(\"0\"))}static endPIVResponse(t){return t.endObject()}static createPIVResponse(t,s,i,r,o,a,E,l,_,p){return e.startPIVResponse(t),e.addStatusCode(t,s),e.addStatus(t,i),e.addYielded(t,r),e.addBacklogRemaining(t,o),e.addOutputs(t,a),e.addPayloadArena(t,E),e.addErrorCode(t,l),e.addErrorMessage(t,_),e.addTraceId(t,p),e.endPIVResponse(t)}unpack(){return new Ys(this.STATUS_CODE(),this.STATUS(),this.YIELDED(),this.BACKLOG_REMAINING(),this.bb.createObjList(this.OUTPUTS.bind(this),this.outputsLength()),this.bb.createScalarList(this.PAYLOAD_ARENA.bind(this),this.payloadArenaLength()),this.ERROR_CODE(),this.ERROR_MESSAGE(),this.TRACE_ID())}unpackTo(t){t.STATUS_CODE=this.STATUS_CODE(),t.STATUS=this.STATUS(),t.YIELDED=this.YIELDED(),t.BACKLOG_REMAINING=this.BACKLOG_REMAINING(),t.OUTPUTS=this.bb.createObjList(this.OUTPUTS.bind(this),this.outputsLength()),t.PAYLOAD_ARENA=this.bb.createScalarList(this.PAYLOAD_ARENA.bind(this),this.payloadArenaLength()),t.ERROR_CODE=this.ERROR_CODE(),t.ERROR_MESSAGE=this.ERROR_MESSAGE(),t.TRACE_ID=this.TRACE_ID()}},Ys=class{constructor(t=0,s=ht.OK,i=!1,r=0,o=[],a=[],E=null,l=null,_=BigInt(\"0\")){this.STATUS_CODE=t,this.STATUS=s,this.YIELDED=i,this.BACKLOG_REMAINING=r,this.OUTPUTS=o,this.PAYLOAD_ARENA=a,this.ERROR_CODE=E,this.ERROR_MESSAGE=l,this.TRACE_ID=_}pack(t){let s=B.createOutputsVector(t,t.createObjectOffsetList(this.OUTPUTS)),i=B.createPayloadArenaVector(t,this.PAYLOAD_ARENA),r=this.ERROR_CODE!==null?t.createString(this.ERROR_CODE):0,o=this.ERROR_MESSAGE!==null?t.createString(this.ERROR_MESSAGE):0;return B.createPIVResponse(t,this.STATUS_CODE,this.STATUS,this.YIELDED,this.BACKLOG_REMAINING,s,i,r,o,this.TRACE_ID)}};var j=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsPIV(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsPIV(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static bufferHasIdentifier(t){return t.__has_identifier(\"$PIV\")}REQUEST(t){let s=this.bb.__offset(this.bb_pos,4);return s?(t||new It).__init(this.bb.__indirect(this.bb_pos+s),this.bb):null}RESPONSE(t){let s=this.bb.__offset(this.bb_pos,6);return s?(t||new B).__init(this.bb.__indirect(this.bb_pos+s),this.bb):null}static startPIV(t){t.startObject(2)}static addRequest(t,s){t.addFieldOffset(0,s,0)}static addResponse(t,s){t.addFieldOffset(1,s,0)}static endPIV(t){return t.endObject()}static finishPIVBuffer(t,s){t.finish(s,\"$PIV\")}static finishSizePrefixedPIVBuffer(t,s){t.finish(s,\"$PIV\",!0)}unpack(){return new ks(this.REQUEST()!==null?this.REQUEST().unpack():null,this.RESPONSE()!==null?this.RESPONSE().unpack():null)}unpackTo(t){t.REQUEST=this.REQUEST()!==null?this.REQUEST().unpack():null,t.RESPONSE=this.RESPONSE()!==null?this.RESPONSE().unpack():null}},ks=class{constructor(t=null,s=null){this.REQUEST=t,this.RESPONSE=s}pack(t){let s=this.REQUEST!==null?this.REQUEST.pack(t):0,i=this.RESPONSE!==null?this.RESPONSE.pack(t):0;return j.startPIV(t),j.addRequest(t,s),j.addResponse(t,i),j.endPIV(t)}};var Vt=65535,it=4294967295,Xr=new WeakMap,If=new WeakMap,pf=new WeakMap;function Y(...e){return e.find(t=>t!=null)}function Q(e,t,s={}){let{defaultValue:i,minimum:r=0,maximum:o=Number.MAX_SAFE_INTEGER}=s;if(e==null||e===\"\"){if(i!==void 0)return i;throw new TypeError(`${t} is required.`)}let a;if(typeof e==\"bigint\"){if(e<BigInt(r)||e>BigInt(o))throw new RangeError(`${t} must be an integer between ${r} and ${o}.`);a=Number(e)}else a=typeof e==\"number\"?e:Number(e);if(!Number.isSafeInteger(a)||a<r||a>o)throw new RangeError(`${t} must be an integer between ${r} and ${o}.`);return a}function oe(e){return e>0&&Number.isInteger(Math.log2(e))}function js(e,t,s={}){let i=Q(e,t,{defaultValue:s.defaultValue,minimum:0,maximum:s.maximum??it});if(!oe(i))throw new RangeError(`${t} must be a positive power of two.`);return i}function Ws(e,t,s){if(e>it-t)throw new RangeError(`${s} offset + size exceeds the uint32 address range.`)}function $s(e,t,s){if(e.buffer!==t.buffer||e.byteOffset<t.byteOffset||e.byteOffset+e.byteLength>t.byteOffset+t.byteLength)throw new Error(`${s} is outside its arena lease.`)}function Zs(e){let t=Xr.get(e);if(!t)throw new TypeError(\"SDS PIV/TAB arena lease is invalid.\");return t}function Sf(e,t,s,i){let r=Zs(e);if(r.closed)throw new Error(`${i} arena lease is closed.`);if(t!==r.generation)throw new Error(`${i} has stale arena lease generation ${String(t)}; active generation is ${r.generation}.`);return s&&$s(s,r.arena,i),r}function Jr(e,t,s={}){let i=e?.arenaLease;if(!i){if(s.required===!0)throw new Error(`${t} requires a live arena lease.`);return null}let r=J(e.payload),o=Y(e.generation,e.arenaGeneration);return Sf(i,o,r,t)}function tn(e,t){let s=Jr(e,t);if(!s)return null;let i=on(e.ownership),r=nn(e.mutability);if(i===W.PRODUCER_OWNED||r!==ft.IMMUTABLE){let o=J(e.payload),a=Y(e.generation,e.arenaGeneration),E=pf.get(e);if(E&&i===W.SHARED&&E.lease===e.arenaLease&&E.generation===a&&E.payloadBuffer===o?.buffer&&E.payloadByteOffset===o?.byteOffset&&E.payloadByteLength===o?.byteLength&&E.frameId===ae(e)&&E.ownership===i&&E.mutability===r)return s;throw new Error(`${t} producer-owned or mutable cross-invocation alias requires explicit compatible transfer forwarding.`)}return s}function Af(e){if(e instanceof at)return e;let t=J(e);if(t)return new at(t);throw new TypeError(\"Expected ByteBuffer, Uint8Array, ArrayBufferView, or ArrayBuffer.\")}function qs(e,t=0){let s=Number(e??t);return Number.isFinite(s)?Math.max(0,Math.trunc(s)):t}function Pt(e,t=BigInt(0)){if(typeof e==\"bigint\")return e;if(typeof e==\"number\"&&Number.isFinite(e))return BigInt(Math.trunc(e));if(typeof e==\"string\"&&e.trim())try{return BigInt(e.trim())}catch{return t}return t}function Ft(e){let t=typeof e==\"string\"?e.trim().toLowerCase():\"\";if(e===1||t===\"aligned-binary\"||t===\"aligned_binary\"||t===\"alignedbinary\")return\"aligned-binary\";if(e==null||e===0||t===\"\"||t===\"flatbuffer\")return\"flatbuffer\";throw new TypeError(`Unsupported SDS PIV/TAB wire format: ${String(e)}.`)}function Qs(e){return Ft(e)===\"aligned-binary\"?q.ALIGNED_BINARY:q.FLATBUFFER}function en(e){if(e===q.ALIGNED_BINARY)return\"aligned-binary\";if(e===q.FLATBUFFER)return\"flatbuffer\";throw new TypeError(`Unsupported SDS PIV/TAB wire format value: ${e}.`)}function zs(e){if(e==null||e===ft.IMMUTABLE||e===\"immutable\"||e===\"IMMUTABLE\")return $.IMMUTABLE;if(e===ft.APPEND_ONLY||e===\"append-only\"||e===\"APPEND_ONLY\")return $.APPEND_ONLY;if(e===ft.MUTABLE||e===\"mutable\"||e===\"single-writer-mutable\"||e===\"SINGLE_WRITER_MUTABLE\")return $.SINGLE_WRITER_MUTABLE;throw new TypeError(`Unsupported SDS PIV/TAB mutability: ${String(e)}.`)}function sn(e){if(e===$.APPEND_ONLY)return ft.APPEND_ONLY;if(e===$.SINGLE_WRITER_MUTABLE)return ft.MUTABLE;if(e===$.IMMUTABLE)return ft.IMMUTABLE;throw new TypeError(`Unsupported SDS PIV/TAB mutability value: ${e}.`)}function Xs(e){if(e==null||e===W.BORROWED||e===W.HOST_OWNED||e===\"borrowed\"||e===\"BORROWED\"||e===\"host-owned\"||e===\"host_owned\"||e===\"HOST_OWNED\")return Z.HOST_OWNED;if(e===W.PRODUCER_OWNED||e===\"producer-owned\"||e===\"producer_owned\"||e===\"PRODUCER_OWNED\"||e===\"plugin-owned\"||e===\"plugin_owned\"||e===\"PLUGIN_OWNED\")return Z.PLUGIN_OWNED;if(e===W.SHARED||e===\"shared\"||e===\"SHARED\"||e===\"transferred\"||e===\"TRANSFERRED\")return Z.TRANSFERRED;throw new TypeError(`Unsupported SDS PIV/TAB ownership: ${String(e)}.`)}function rn(e){if(e===Z.PLUGIN_OWNED)return W.PRODUCER_OWNED;if(e===Z.TRANSFERRED)return W.SHARED;if(e===Z.HOST_OWNED)return W.HOST_OWNED;throw new TypeError(`Unsupported SDS PIV/TAB ownership value: ${e}.`)}function nn(e){return sn(zs(e))}function on(e){return rn(Xs(e))}function bf(e={},t=void 0){let s=Y(e.schemaHash,e.SCHEMA_HASH);if(!Qr(s))throw new TypeError(\"SDS PIV/TAB schemaHash must contain valid bytes or hex.\");let i=Ft(Y(e.wireFormat,e.WIRE_FORMAT,t));return new Mt(e.schemaName??e.SCHEMA_NAME??null,e.fileIdentifier??e.FILE_IDENTIFIER??null,e.schemaVersion??e.SCHEMA_VERSION??null,e.rootTypeName??e.rootType??e.ROOT_TYPE??null,Zr(s)??[],!!(e.acceptsAnyFlatbuffer??e.ACCEPTS_ANY_FLATBUFFER??!1),Qs(i),Q(Y(e.fixedStringLength,e.FIXED_STRING_LENGTH),\"SDS PIV/TAB fixedStringLength\",{defaultValue:0,maximum:Vt}),Q(Y(e.byteLength,e.BYTE_LENGTH),\"SDS PIV/TAB byteLength\",{defaultValue:0,maximum:it}),Q(Y(e.requiredAlignment,e.REQUIRED_ALIGNMENT),\"SDS PIV/TAB requiredAlignment\",{defaultValue:0,maximum:Vt}))}function an(e={}){let t=e.typeRef??e.allowedType??{},s=Y(e.wireFormat,e.WIRE_FORMAT),i=Y(t.wireFormat,t.WIRE_FORMAT),r=Ft(Y(i,s));if(i!==void 0&&s!==void 0&&Ft(i)!==Ft(s))throw new Error(\"SDS PIV/TAB frame and typeRef wire formats disagree.\");let o=bf(t,r);if(r===\"aligned-binary\")o.REQUIRED_ALIGNMENT=js(o.REQUIRED_ALIGNMENT,\"SDS PIV/TAB aligned type requiredAlignment\",{maximum:Vt}),o.BYTE_LENGTH=Q(o.BYTE_LENGTH,\"SDS PIV/TAB aligned type byteLength\",{minimum:0,maximum:it});else if(o.REQUIRED_ALIGNMENT>0&&!oe(o.REQUIRED_ALIGNMENT))throw new RangeError(\"SDS PIV/TAB type requiredAlignment must be a positive power of two when declared.\");return{typeRef:o,wireFormat:r}}function fn(e,t){let s=Y(e?.alignment,e?.ALIGNMENT),i=js(s,\"SDS PIV/TAB frame alignment\",{defaultValue:Math.max(bt,t||1)});if(i<t)throw new RangeError(`SDS PIV/TAB frame alignment ${i} is below required alignment ${t}.`);return i}function hn(e,t,s){if(e===\"aligned-binary\"&&t.BYTE_LENGTH>0&&s!==t.BYTE_LENGTH)throw new RangeError(`SDS PIV/TAB aligned payload size ${s} does not match declared byteLength ${t.BYTE_LENGTH}.`)}function ae(e={}){return e.frameId!==void 0&&e.frameId!==null?Pt(e.frameId):e.sequence!==void 0||e.endOfStream!==void 0||e.endOfStream===!0?Pt(e.sequence)<<BigInt(1)|(e.endOfStream===!0?BigInt(1):BigInt(0)):Pt(e.traceId)}function Rf(e){let t=Pt(e);return{sequence:t>>BigInt(1),endOfStream:(t&BigInt(1))===BigInt(1)}}function wf(e,t){if(t<=1)return e;let s=e%t;return s===0?e:e+t-s}function Ks(e){return Q(Y(e?.offset,e?.OFFSET),\"SDS PIV/TAB frame offset\",{defaultValue:0,maximum:it})}function cn(e){return Q(Y(e?.size,e?.SIZE),\"SDS PIV/TAB frame size\",{defaultValue:0,maximum:it})}function fe(e){return js(Y(e?.alignment,e?.ALIGNMENT),\"SDS PIV/TAB frame alignment\",{defaultValue:bt})}function Tf(e={},t){let s=J(e.payload??new Uint8Array)??new Uint8Array;tn(e,\"SDS PIV/TAB frame forwarding\");let{typeRef:i,wireFormat:r}=an(e),o=i.REQUIRED_ALIGNMENT,a=fn(e,o);hn(r,i,s.length);let E=wf(t,a);return Ws(E,s.length,\"SDS PIV/TAB frame\"),{payload:s,padding:E-t,buffer:new Ut(E,s.length,a,Qs(r),i,zs(e.mutability),Xs(e.ownership),ae(e),e.portId??null)}}var bt=8;function Of(e,t={}){let s=J(e);if(!s)throw new TypeError(\"createInvokeArenaLease requires Uint8Array-compatible arena bytes.\");let i={arena:s,generation:Q(t.generation,\"SDS PIV/TAB arena lease generation\",{defaultValue:1,maximum:it}),closed:!1},r={get arena(){return i.arena},get generation(){return i.generation},get closed(){return i.closed},advance(o=void 0){if(i.closed)throw new Error(\"SDS PIV/TAB arena lease is closed.\");if(i.generation>=it)throw new RangeError(\"SDS PIV/TAB arena lease generation exceeds the uint32 range.\");if(o!==void 0){let a=J(o);if(!a)throw new TypeError(\"SDS PIV/TAB arena lease advance requires Uint8Array-compatible bytes.\");i.arena=a}return i.generation+=1,i.generation},close(){i.closed=!0},createTransferToken(o,a={}){if(Jr(o,\"SDS PIV/TAB arena transfer\",{required:!0})!==i||o.arenaLease!==r)throw new Error(\"SDS PIV/TAB arena transfer frame belongs to a different lease.\");let l=on(a.ownership??\"transferred\");if(l!==W.SHARED)throw new Error(\"SDS PIV/TAB arena transfer ownership must be transferred/shared.\");let _=nn(a.mutability??o.mutability),p=J(o.payload),O=Object.freeze({});return If.set(O,{lease:r,generation:i.generation,payloadBuffer:p.buffer,payloadByteOffset:p.byteOffset,payloadByteLength:p.byteLength,frameId:ae(o),ownership:l,mutability:_,consumed:!1}),O}};return Xr.set(r,i),Object.freeze(r)}function mf(e,t,s){return e.startVector(1,t.length,s),e.bb.setPosition(e.space-=t.length),e.bb.bytes().set(t,e.space),e.endVector()}function zr(e){return e===\"request\"?\"PIV request\":\"PIV response\"}function gf(e,t,s,i=bt){if(e.byteOffset%bt!==0)throw new Error(`${zr(s)} buffer base is not ${bt}-byte aligned (byteOffset ${e.byteOffset}).`);if(t&&t.length>0&&t.byteOffset%i!==0)throw new Error(`${zr(s)} payload arena base is not ${i}-byte aligned (byteOffset ${t.byteOffset}).`)}function yf(e=[],t=Tf){let s=[],i=[],r=0,o=bt;for(let E of e){let l=t(E,r);r=Ks(l.buffer)+cn(l.buffer),o=Math.max(o,fe(l.buffer)),s.push(l.buffer),i.push(l)}let a=new Uint8Array(r);for(let E of i)a.set(E.payload,Ks(E.buffer));return{frames:s,arena:a,arenaAlignment:o}}function Nf(e={}){return e.offset!==void 0||e.OFFSET!==void 0}function Df(e={},t){let s=J(e.payload),i=tn(e,\"SDS PIV/TAB external frame forwarding\");i&&t&&$s(t,i.arena,\"SDS PIV/TAB external arena\");let{typeRef:r,wireFormat:o}=an(e),a=fn(e,r.REQUIRED_ALIGNMENT),E=Q(Y(e.offset,e.OFFSET),\"SDS PIV/TAB external arena frame offset\",{defaultValue:0,maximum:it});!Nf(e)&&s&&t&&s.buffer===t.buffer&&(E=s.byteOffset-t.byteOffset);let l=Q(Y(e.size,e.SIZE,e.byteLength,s?.byteLength),\"SDS PIV/TAB external arena frame size\",{defaultValue:0,maximum:it});if(Ws(E,l,\"SDS PIV/TAB external arena frame\"),hn(o,r,l),l>0&&t){if(E>t.length||l>t.length-E)throw new Error(\"SDS PIV external arena frame range exceeds externalArena.\");let _=t.byteOffset+E;if(a>1&&_%a!==0)throw new Error(`SDS PIV external arena frame \"${e.portId??\"\"}\" is misaligned: absolute offset ${_} violates alignment ${a}.`)}return new Ut(E,l,a,Qs(o),r,zs(e.mutability),Xs(e.ownership),ae(e),e.portId??null)}function Lf(e=[],t){let s=J(t);if(!s)throw new TypeError(\"SDS PIV external arena encoding requires externalArena bytes.\");let i=bt;return{frames:e.map(o=>{let a=Df(o,s);return i=Math.max(i,fe(a)),a}),arena:new Uint8Array,arenaAlignment:i,externalArena:s}}function Cf(e){if(!e)return null;let t=e.schemaHashArray?.()??new Uint8Array;return{schemaName:e.SCHEMA_NAME()??null,fileIdentifier:e.FILE_IDENTIFIER()??null,schemaVersion:e.SCHEMA_VERSION()??null,schemaHash:t.byteLength>0?new Uint8Array(t):void 0,acceptsAnyFlatbuffer:e.ACCEPTS_ANY_FLATBUFFER?.()===!0,wireFormat:en(e.WIRE_FORMAT()),rootTypeName:e.ROOT_TYPE()??null,fixedStringLength:Q(e.FIXED_STRING_LENGTH(),\"SDS PIV/TAB decoded fixedStringLength\",{defaultValue:0,maximum:Vt}),byteLength:Q(e.BYTE_LENGTH(),\"SDS PIV/TAB decoded byteLength\",{defaultValue:0,maximum:it}),requiredAlignment:Q(e.REQUIRED_ALIGNMENT(),\"SDS PIV/TAB decoded requiredAlignment\",{defaultValue:0,maximum:Vt})}}function Uf(e){let t=e.typeRef;if(t&&t.wireFormat!==e.wireFormat)throw new Error(\"SDS PIV/TAB frame and typeRef wire formats disagree.\");let s=t?.requiredAlignment??0;if(s>0&&!oe(s))throw new RangeError(\"SDS PIV/TAB decoded requiredAlignment must be a positive power of two.\");if(e.alignment<s)throw new RangeError(`SDS PIV/TAB frame alignment ${e.alignment} is below required alignment ${s}.`);if(e.wireFormat===\"aligned-binary\"){if(!t)throw new Error(\"SDS PIV/TAB aligned frame requires a typeRef.\");if(!oe(s))throw new RangeError(\"SDS PIV/TAB aligned type requiredAlignment must be a positive power of two.\");let i=Number(t.byteLength??0);if(i>0&&e.size!==i)throw new RangeError(`SDS PIV/TAB aligned payload size ${e.size} does not match declared byteLength ${i}.`)}}function Pf(e){if(!e)return null;let t=qs(e.OFFSET()),s=qs(e.SIZE()),i=fe({ALIGNMENT:e.ALIGNMENT()}),r=en(e.WIRE_FORMAT()),o=Pt(e.FRAME_ID()),a=Rf(o),E={typeRef:Cf(e.TYPE_REF()),portId:e.PORT_ID()??null,alignment:i,offset:t,size:s,ownership:rn(e.OWNERSHIP()),generation:0,mutability:sn(e.MUTABILITY()),frameId:o,traceId:o,streamId:0,sequence:a.sequence,endOfStream:a.endOfStream,wireFormat:r};return Uf(E),E}function vf(e,t){let s=[];for(let i=0;i<e;i++){let r=Pf(t(i));r&&s.push(r)}return s}function Hf(e,t={}){let s=J(t.externalArena),i=e.length>0?e:s??e;if(!t.arenaLease)return Of(i);let r=Zs(t.arenaLease);if(r.closed)throw new Error(\"SDS PIV/TAB decoded arena lease is closed.\");return $s(i,r.arena,\"SDS PIV/TAB decoded arena\"),t.arenaLease}function Bf(e=[],t,s={}){let i=J(s.externalArena),r=s.arenaLease,o=r?Zs(r).generation:void 0;return e.map(a=>{let E=Ks(a),l=cn(a),_=t.length>0?t:i,p=t.length>0?\"PAYLOAD_ARENA\":\"external arena\";if(Ws(E,l,\"SDS PIV/TAB decoded frame\"),l>0&&!_)throw new Error(\"SDS PIV external arena bytes are required when PAYLOAD_ARENA is empty.\");if(_&&(E>_.length||l>_.length-E))throw new Error(`SDS PIV TAB payload range exceeds ${p}.`);let O=fe(a);if(_&&O>1&&l>0){let w=_.byteOffset+E;if(w%O!==0)throw new Error(`SDS PIV TAB \"${a.portId??\"\"}\" payload is misaligned: absolute offset ${w} violates alignment ${O}.`)}let A=_?_.subarray(E,E+l):new Uint8Array;return{...a,payload:A,typeRef:a.typeRef??null,arenaLease:r,arenaGeneration:o,generation:o}})}function Mf(e,t){return t.map(s=>s.pack(e))}function un(e,t={}){let s=Af(e);if(!j.bufferHasIdentifier(s))throw new Error(\"SDS PIV invoke request buffer identifier mismatch.\");let r=j.getRootAsPIV(s).REQUEST();if(!r)throw new Error(\"SDS PIV invoke envelope does not contain a request.\");let o=r.payloadArenaArray()??new Uint8Array,a=vf(r.inputsLength(),_=>r.INPUTS(_)),E=Hf(o,t),l=Bf(a,o,{...t,arenaLease:E});return{methodId:r.METHOD_ID()??null,inputFrames:l,inputs:l,payloadArena:o,arenaLease:E,traceId:r.TRACE_ID()??BigInt(0),outputStreamCap:r.OUTPUT_STREAM_CAP()??0,envelope:\"PIV\"}}function Ff(e={}){return e.status!==void 0?e.status:e.yielded===!0?ht.YIELDED:Number(e.statusCode??0)!==0||e.errorCode?ht.FAILED:ht.OK}function Js(e={}){let t=Array.isArray(e.outputs)?e.outputs:e.outputFrames??[],{frames:s,arena:i,arenaAlignment:r}=e.externalArena!==void 0?Lf(t,e.externalArena):yf(t),o=new Bt(1024),a=e.errorCode!==null&&e.errorCode!==void 0?o.createString(String(e.errorCode)):0,E=e.errorMessage!==null&&e.errorMessage!==void 0?o.createString(String(e.errorMessage)):0,l=B.createOutputsVector(o,Mf(o,s)),_=mf(o,i,r);B.startPIVResponse(o),B.addStatusCode(o,Number(e.statusCode??0)),B.addStatus(o,Ff(e)),B.addYielded(o,e.yielded===!0),B.addBacklogRemaining(o,qs(e.backlogRemaining)),B.addOutputs(o,l),B.addPayloadArena(o,_),B.addErrorCode(o,a),B.addErrorMessage(o,E),B.addTraceId(o,Pt(e.traceId));let p=B.endPIVResponse(o);j.startPIV(o),j.addResponse(o,p),j.finishPIVBuffer(o,j.endPIV(o));let O=o.asUint8Array(),A=j.getRootAsPIV(new at(O));return gf(O,A.RESPONSE()?.payloadArenaArray(),\"response\",r),O}var En=Object.freeze({Inline:0,Ref:1}),hl=Object.freeze({String:0,Number:1,Bool:2}),ln=Object.freeze({Duplicates:0,None:1,Current:2}),he=Object.freeze({Stream:0,Rows:1,Auto:2}),cl=Object.freeze({Default:0,Ed25519:1,Secp256k1:2,Secp256k1Digest:3,X25519:4,Sha256:5,Sha512:6,Aes256Gcm:7,HkdfSha256:8});var Bl=Object.freeze({TimerTick:\"TICK\",HttpRequest:\"HREQ\",HttpResponse:\"HRSP\",ModuleConfig:\"MCFG\",IngestRequest:\"INGQ\",IngestResult:\"INGR\",FlowNotice:\"FNTC\"});function Vf(e){let t=e instanceof Uint8Array?e:new Uint8Array(e);return t.length<8?\"\":String.fromCharCode(t[4],t[5],t[6],t[7])}var xf=e=>e==null?\"\":String(e);var Gf={duplicates:Nt.Duplicates,none:Nt.None,current:Nt.Current},Ml=Object.fromEntries(Object.entries(Gf).map(([e,t])=>[t,e]));var Yf={unchanged:dt.Unchanged,skipped:dt.Skipped,missing:dt.Missing,expired:dt.Expired,info:dt.Info},Fl=Object.fromEntries(Object.entries(Yf).map(([e,t])=>[t,e]));var _n=\"HostOps.fbs\";function xt(e){let t=Dt[e];if(typeof t!=\"function\"||!t.SIZE)throw new Error(`hostcall: ${e} is not a HostOps record`);return t}var In=e=>e[0].toLowerCase()+e.slice(1);function kf(e){let t=Object.getOwnPropertyNames(e.prototype);return t.filter(s=>s.startsWith(\"set\")&&!s.startsWith(\"setHas\")&&!s.endsWith(\"Length\")&&!s.endsWith(\"At\")).map(s=>s.slice(3)).concat(t.filter(s=>s.startsWith(\"set\")&&s.endsWith(\"At\")&&!s.startsWith(\"setHas\")).map(s=>s.slice(3,-2)))}function ei(e,t,s,i){for(let[r,o]of Object.entries(s||{})){if(o==null)continue;let a=e.prototype,E=In(r);if(typeof a[`set${r}At`]==\"function\"){if(t[`set${r}Length`](o.length),o.forEach((l,_)=>t[`set${r}At`](_,l)),typeof a[`setHas${r}`]==\"function\"&&t[`setHas${r}`](!0),t[`${E}Length`]()!==o.length)throw new RangeError(`${i}.${r}: ${o.length} items exceed the record's bound`);continue}if(typeof a[`set${r}`]!=\"function\"){if(typeof a[E]==\"function\"&&typeof o==\"object\"){let l=t[E]();ei(l.constructor,l,o,`${i}.${r}`),typeof a[`setHas${r}`]==\"function\"&&t[`setHas${r}`](!0);continue}throw new Error(`${i}: no field ${r}`)}if(typeof a[`setHas${r}`]==\"function\"&&t[`setHas${r}`](!0),t[`set${r}`](typeof o==\"number\"&&typeof t[E]()==\"bigint\"?BigInt(o):o),typeof o==\"string\"&&t[E]()!==o)throw new RangeError(`${i}.${r}: \"${o.slice(0,40)}...\" exceeds the record's ${new TextEncoder().encode(t[E]()).length}-byte string`)}}function pn(e,t){let s={};for(let i of kf(e)){let r=In(i);if(typeof t[`has${i}`]==\"function\"&&!t[`has${i}`]()){s[i]=typeof t[`${r}Length`]==\"function\"?[]:null;continue}if(typeof t[`${r}Length`]==\"function\"){s[i]=Array.from({length:t[`${r}Length`]()},(o,a)=>t[`${r}At`](a));continue}s[i]=t[r]()}for(let i of Object.getOwnPropertyNames(e.prototype)){if(i.startsWith(\"has\")||i.startsWith(\"set\")||i===\"constructor\")continue;let r=i[0].toUpperCase()+i.slice(1);r in s||typeof e.prototype[`setHas${r}`]!=\"function\"||(s[r]=t[`has${r}`]()?pn(t[i]().constructor,t[i]()):null)}return s}function qf(e,t){let s=xt(e),i=new Uint8Array(s.SIZE);return ei(s,s.fromPointer(i.buffer,0),t,e),i}function Kf(e,t){let s=xt(e),i=new Uint8Array(s.SIZE*t.length);return t.forEach((r,o)=>ei(s,s.fromPointer(i.buffer,o*s.SIZE),r,`${e}[${o}]`)),i}function jf(e,t){let s={},i={},r={};for(let o of e||[]){let a=o.portId??o.PORT_ID,E=o.typeRef||{},l=E.rootType??E.rootTypeName??E.ROOT_TYPE??null,_=o.payload instanceof Uint8Array?o.payload:new Uint8Array(o.payload||[]);if((o.wireFormat??E.wireFormat)===\"aligned-binary\"&&l){let p=xt(l),O=_.slice();if(O.length%p.SIZE)throw new RangeError(`${t}: ${a} is ${O.length} bytes, not a whole number of ${l} (${p.SIZE})`);let A=Array.from({length:O.length/p.SIZE},(w,R)=>pn(p,p.fromPointer(O.buffer,R*p.SIZE)));Number(E.byteLength??0)>0?s[a]={type:l,value:A[0]??null}:i[a]={type:l,values:A}}else r[a]=_.slice()}return{records:s,lists:i,raw:r}}var Wf=e=>typeof e==\"string\"?new TextEncoder().encode(e):e instanceof Uint8Array?e:new Uint8Array(e);function $f(e,{record:t,recordPort:s,recordType:i,raw:r={},lists:o={}},a,E,l){let _=[];if(t!=null){if(!i)throw new Error(`${l}: takes no ${s} record`);let p=xt(i);_.push({portId:s,wireFormat:\"aligned-binary\",typeRef:{schemaName:_n,rootType:i,wireFormat:\"aligned-binary\",byteLength:p.SIZE,requiredAlignment:p.ALIGN},payload:qf(i,t)})}for(let[p,O]of Object.entries(o)){let A=E[p];if(!A)throw new Error(`${l}: no list port ${p}`);let w=xt(A);_.push({portId:p,wireFormat:\"aligned-binary\",typeRef:{schemaName:_n,rootType:A,wireFormat:\"aligned-binary\",byteLength:0,requiredAlignment:w.ALIGN},payload:Kf(A,O)})}for(let[p,O]of Object.entries(r)){if(!a.includes(p))throw new Error(`${l}: no raw port ${p}`);_.push({portId:p,payload:Wf(O)})}return _}function Sn(e){let t=un(e),s=t.methodId??\"\",{records:i,lists:r,raw:o}=jf(t.inputs,s),a=Gt[s];if(a&&i.params&&i.params.type!==a.params)throw new Error(`hostcall: ${s} takes ${a.params}, the frame carries ${i.params.type}`);return{op:s,params:i.params?.value??null,lists:Object.fromEntries(Object.entries(r).map(([E,l])=>[E,l.values])),raw:o}}var An=Object.freeze({null:0,bool:1,i64:2,f64:3,str:4,bytes:5}),Zf=Object.fromEntries(Object.entries(An).map(([e,t])=>[t,e]));function bn(e){let t=(e||[]).map(o=>{let a=o&&typeof o==\"object\"&&!(o instanceof Uint8Array)&&\"t\"in o?o:null,E=a?a.t:o==null?\"null\":typeof o==\"boolean\"?\"bool\":typeof o==\"bigint\"?\"i64\":typeof o==\"number\"?Number.isInteger(o)?\"i64\":\"f64\":typeof o==\"string\"?\"str\":o instanceof Uint8Array?\"bytes\":null,l=a?a.v:o,_;switch(E){case\"null\":_=new Uint8Array(0);break;case\"bool\":_=Uint8Array.of(l?1:0);break;case\"i64\":_=new Uint8Array(8),new DataView(_.buffer).setBigInt64(0,BigInt(l),!0);break;case\"f64\":_=new Uint8Array(8),new DataView(_.buffer).setFloat64(0,Number(l),!0);break;case\"str\":_=new TextEncoder().encode(String(l));break;case\"bytes\":_=l instanceof Uint8Array?l:new Uint8Array(l);break;default:throw new TypeError(`SQL value ${String(o)} has no FlatSQL parameter tag`)}return[An[E],_]}),s=new Uint8Array(t.reduce((o,[,a])=>o+5+a.length,0)),i=new DataView(s.buffer),r=0;for(let[o,a]of t)s[r]=o,i.setUint32(r+1,a.length,!0),s.set(a,r+5),r+=5+a.length;return s}function Rn(e){let t=e instanceof Uint8Array?e:new Uint8Array(e||[]),s=new DataView(t.buffer,t.byteOffset,t.byteLength),i=[],r=0;for(;r<t.length;){if(r+5>t.length)throw new RangeError(\"SQL values: truncated value header\");let o=t[r],a=s.getUint32(r+1,!0),E=r+5;if(E+a>t.length)throw new RangeError(\"SQL values: payload exceeds the buffer\");let l=Zf[o],_={null:0,bool:1,i64:8,f64:8}[l];if(l===void 0)throw new RangeError(`SQL values: unknown tag ${o}`);if(_!==void 0&&a!==_)throw new RangeError(`SQL values: a ${l} carries ${_} bytes, not ${a}`);let p=t.subarray(E,E+a);i.push({t:l,v:l===\"null\"?null:l===\"bool\"?p[0]!==0:l===\"i64\"?s.getBigInt64(E,!0):l===\"f64\"?s.getFloat64(E,!0):l===\"str\"?new TextDecoder().decode(p):p.slice()}),r=E+a}return i}var Qf=Object.freeze([\"unsupported\",\"not-authorized\",\"invalid-params\",\"failed\",\"refused\",\"sandbox\",\"timeout\",\"too-large\"]);function si(e){if(e?.ok){let s=Gt[e.op];if(!s)throw new Error(`hostcall: unknown operation ${e.op}`);let i=$f(s,{record:e.result,recordPort:\"result\",recordType:s.result,raw:e.raw,lists:e.lists},s.rawOut,s.listsOut,`${e.op} result`);return Js({statusCode:0,outputs:i})}let t=e?.error?.code??\"failed\";if(!Qf.includes(t))throw new Error(`hostcall: unknown error code ${t}`);return Js({statusCode:1,status:\"FAILED\",errorCode:t,errorMessage:xf(e?.error?.message)})}function wn(e){return Vf(e)===\"$PIV\"}var I=(e,t,s,i={})=>Object.freeze({params:e,result:t,capability:s,rawIn:Object.freeze(i.rawIn||[]),rawOut:Object.freeze(i.rawOut||[]),listsIn:Object.freeze(i.listsIn||{}),listsOut:Object.freeze(i.listsOut||{})}),zf=[\"data\",\"key\",\"private_key\",\"public_key\",\"signature\",\"nonce\",\"aad\",\"ikm\",\"salt\",\"info\",\"envelope\"],Xf=[\"data\",\"nonce\",\"private_key\",\"public_key\"],D=(e,t)=>I(\"CryptoParams\",e,t,{rawIn:zf,rawOut:Xf}),dn={rawOut:[\"stream\"]},ti={rawIn:[\"sql\",\"params\"]},Gt=Object.freeze({\"host.runtimeTarget\":I(null,null,null,{rawOut:[\"value\"]}),\"host.listCapabilities\":I(null,null,null,{listsOut:{items:\"TextValue\"}}),\"host.listSupportedCapabilities\":I(null,null,null,{listsOut:{items:\"TextValue\"}}),\"host.listOperations\":I(null,null,null,{listsOut:{items:\"TextValue\"}}),\"host.hasCapability\":I(\"HasCapabilityParams\",\"BoolValue\",null),\"clock.now\":I(null,\"TimeValue\",\"clock\"),\"clock.nowIso\":I(null,null,\"clock\",{rawOut:[\"value\"]}),\"clock.monotonicNow\":I(null,\"NumberValue\",\"clock\"),\"random.bytes\":I(\"RandomBytesParams\",null,\"random\",{rawOut:[\"data\"]}),\"node.publicKey\":I(null,null,null,{rawOut:[\"value\"]}),\"node.peerId\":I(null,null,null,{rawOut:[\"value\"]}),\"plugin.getConfig\":I(null,null,null,{listsOut:{entries:\"ConfigEntry\"}}),\"http.request\":I(\"HttpParams\",\"HttpResult\",\"http\",{rawIn:[\"url\",\"headers\",\"body\"],rawOut:[\"url\",\"headers\",\"body\"]}),\"websocket.exchange\":I(\"WebsocketParams\",\"WebsocketResult\",\"websocket\",{rawIn:[\"url\",\"protocols\",\"message\"],rawOut:[\"url\",\"body\"]}),\"mqtt.publish\":I(\"MqttParams\",\"MqttResult\",\"mqtt\",{rawIn:[\"payload\",\"password\"]}),\"mqtt.subscribeOnce\":I(\"MqttParams\",\"MqttResult\",\"mqtt\",{rawIn:[\"password\"],rawOut:[\"body\"]}),\"tcp.request\":I(\"SocketParams\",\"SocketResult\",\"tcp\",{rawIn:[\"data\"],rawOut:[\"body\"]}),\"udp.request\":I(\"SocketParams\",\"SocketResult\",\"udp\",{rawIn:[\"data\"],rawOut:[\"body\"]}),\"tls.request\":I(\"SocketParams\",\"SocketResult\",\"tls\",{rawIn:[\"data\",\"ca\",\"cert\",\"key\"],rawOut:[\"body\"]}),\"storage.query\":I(\"StorageQueryParams\",null,\"storage_query\",{listsOut:{records_meta:\"StoredRecordMeta\"},rawOut:[\"records\"]}),\"storage.write\":I(\"StorageWriteParams\",\"StorageWriteResult\",\"storage_write\",{rawIn:[\"data\"]}),\"storage.delete\":I(\"StorageDeleteParams\",null,\"storage_write\"),\"storage.expire\":I(\"StorageExpireParams\",\"StorageExpireResult\",\"storage_write\"),\"storage.ingest_with_source\":I(\"StorageIngestParams\",\"StorageIngestResult\",\"storage_ingest\",{rawIn:[\"records\",\"archive\"],listsIn:{provenance:\"Provenance\",provenance_attributes:\"ProvenanceAttribute\"}}),\"storage.flatsql_query_stream\":I(\"SqlStreamParams\",\"StreamResult\",\"storage_query\",{...ti,...dn}),\"storage.flatsql_epoch_stream\":I(\"EpochStreamParams\",\"StreamResult\",\"storage_query\",dn),\"storage.query_sandboxed\":I(\"SandboxQueryParams\",\"SandboxQueryResult\",\"storage_query\",{...ti,rawOut:[\"stream\",\"cells\"],listsOut:{columns:\"TextValue\"}}),\"storage.query_surface\":I(null,\"QuerySurfaceLimits\",\"storage_query\",{listsOut:{tables:\"SurfaceTable\",columns:\"SurfaceColumn\"}}),\"storage.flatsql_cache_key\":I(\"CacheKeyParams\",null,\"storage_query\",{...ti,listsIn:{projection:\"TextValue\"},rawOut:[\"value\"]}),\"crypto.hash\":D(null,\"crypto_hash\"),\"crypto.sign\":D(null,\"crypto_sign\"),\"crypto.verify\":D(\"BoolValue\",\"crypto_verify\"),\"crypto.encrypt\":D(null,\"crypto_encrypt\"),\"crypto.decrypt\":D(null,\"crypto_decrypt\"),\"crypto.key_agreement\":D(null,\"crypto_key_agreement\"),\"crypto.kdf\":D(null,\"crypto_kdf\"),\"crypto.generate_key\":D(null,\"crypto_sign\"),\"crypto.random\":D(null,\"crypto_hash\"),\"crypto.ed25519.publicKeyFromSeed\":D(null,\"crypto_sign\"),\"crypto.ed25519.sign\":D(null,\"crypto_sign\"),\"crypto.ed25519.verify\":D(\"BoolValue\",\"crypto_verify\"),\"crypto.secp256k1.publicKeyFromPrivate\":D(null,\"crypto_sign\"),\"crypto.secp256k1.sign\":D(null,\"crypto_sign\"),\"crypto.secp256k1.verify\":D(\"BoolValue\",\"crypto_verify\"),\"crypto.sha256\":D(null,\"crypto_hash\"),\"crypto.sha512\":D(null,\"crypto_hash\"),\"crypto.hkdf\":D(null,\"crypto_kdf\"),\"crypto.aesGcmEncrypt\":D(null,\"crypto_encrypt\"),\"crypto.aesGcmDecrypt\":D(null,\"crypto_decrypt\"),\"crypto.x25519.generateKeypair\":D(null,\"crypto_key_agreement\"),\"crypto.x25519.publicKey\":D(null,\"crypto_key_agreement\"),\"crypto.x25519.sharedSecret\":D(null,\"crypto_key_agreement\"),\"crypto.sealedBox.encryptForRecipient\":D(null,\"crypto_encrypt\"),\"crypto.sealedBox.decryptFromEnvelope\":D(null,\"crypto_decrypt\"),\"crypto.secp256k1.signDigest\":D(null,\"crypto_sign\"),\"crypto.secp256k1.verifyDigest\":D(\"BoolValue\",\"crypto_verify\"),\"keyslot.sign\":I(\"KeyslotParams\",null,\"wallet_sign\",{rawIn:[\"payload\"],rawOut:[\"data\"]}),\"keyslot.unwrap\":I(\"KeyslotParams\",null,\"wallet_sign\",{rawIn:[\"ephemeral_public_key\",\"nonce\",\"ciphertext\"],rawOut:[\"data\"]}),\"secrets.get\":I(\"SecretParams\",\"SecretResult\",\"secrets\",{rawOut:[\"secret\"]}),\"secrets.status\":I(\"SecretParams\",\"SecretResult\",\"secrets\"),\"secrets.put\":I(\"SecretParams\",\"SecretResult\",\"secrets\",{rawIn:[\"secret\"]}),\"secrets.clear\":I(\"SecretParams\",null,\"secrets\"),\"ipfs.add\":I(\"IpfsParams\",\"IpfsResult\",\"ipfs\",{rawIn:[\"data\"]}),\"ipfs.cat\":I(\"IpfsParams\",null,\"ipfs\",{rawOut:[\"data\"]}),\"ipfs.ls\":I(\"IpfsParams\",null,\"ipfs\",{listsOut:{links:\"IpfsLink\"}}),\"ipfs.pin_add\":I(\"IpfsParams\",null,\"ipfs\",{listsOut:{items:\"TextValue\"}}),\"ipfs.pin_rm\":I(\"IpfsParams\",null,\"ipfs\",{listsOut:{items:\"TextValue\"}}),\"ipfs.pin_ls\":I(\"IpfsParams\",null,\"ipfs\",{listsOut:{pins:\"IpfsPin\"}}),\"ipfs.dag_get\":I(\"IpfsParams\",null,\"ipfs\",{rawOut:[\"data\"]}),\"ipfs.name_resolve\":I(\"IpfsParams\",\"IpfsResult\",\"ipfs\"),\"ipfs.name_publish\":I(\"IpfsParams\",\"IpfsResult\",\"ipfs\"),\"ipfs.id\":I(null,\"IpfsResult\",\"ipfs\",{listsOut:{addresses:\"TextValue\"}}),\"ipfs.swarm_peers\":I(null,null,\"ipfs\",{listsOut:{peers:\"IpfsSwarmPeer\"}}),\"ipfs.pubsub_publish\":I(\"PubsubParams\",null,\"ipfs\",{rawIn:[\"data\"]}),\"pubsub.publish\":I(\"PubsubParams\",null,\"pubsub\",{rawIn:[\"data\"]}),\"pubsub.subscribe\":I(\"PubsubParams\",\"PubsubSubscribed\",\"pubsub\"),\"pubsub.unsubscribe\":I(\"PubsubParams\",null,\"pubsub\"),\"pubsub.list_topics\":I(null,null,\"pubsub\",{listsOut:{items:\"TextValue\"}}),\"protocol.request\":I(\"ProtocolParams\",null,\"protocol_dial\",{rawIn:[\"payload\"],rawOut:[\"data\"]}),\"protocol_dial.dial\":I(\"ProtocolParams\",null,\"protocol_dial\"),\"protocol_handle.register\":I(\"ProtocolParams\",null,\"protocol_handle\"),\"protocol_handle.unregister\":I(\"ProtocolParams\",null,\"protocol_handle\"),\"p2p.peers_snapshot\":I(\"P2pParams\",\"P2pSummary\",\"p2p_read\",{listsOut:{peers:\"P2pPeer\",peer_addresses:\"P2pPeerValue\",peer_standards:\"P2pPeerValue\"},rawOut:[\"records\"]}),\"p2p.standards_snapshot\":I(\"P2pParams\",null,\"p2p_read\",{listsOut:{entries:\"P2pPnmEntry\"},rawOut:[\"records\"]}),\"p2p.pnm_history\":I(\"P2pParams\",\"P2pSummary\",\"p2p_read\",{listsOut:{entries:\"P2pPnmEntry\"},rawOut:[\"records\"]}),\"p2p.latest_dataset\":I(\"P2pParams\",\"P2pLatestDataset\",\"p2p_read\",{rawOut:[\"stream\"]}),\"node_status_read.status\":I(null,\"NodeStatusReport\",\"node_status_read\",{listsOut:{bandwidth_history:\"NodeBandwidthSample\"}}),\"node_activity_read.activity\":I(\"NodeActivityParams\",null,\"node_activity_read\",{listsOut:{events:\"NodeActivityEvent\"}}),\"timers.delay\":I(\"TimersDelayParams\",null,\"timers\"),\"schedule.parse\":I(\"ScheduleParams\",null,\"schedule_cron\",{listsOut:{fields:\"CronField\"}}),\"schedule.matches\":I(\"ScheduleParams\",\"BoolValue\",\"schedule_cron\"),\"schedule.next\":I(\"ScheduleParams\",\"TimeValue\",\"schedule_cron\"),\"filesystem.resolvePath\":I(null,null,\"filesystem\",{rawIn:[\"path\"],rawOut:[\"path\"]}),\"filesystem.readFile\":I(null,null,\"filesystem\",{rawIn:[\"path\"],rawOut:[\"data\"]}),\"filesystem.writeFile\":I(null,null,\"filesystem\",{rawIn:[\"path\",\"data\"]}),\"filesystem.appendFile\":I(null,null,\"filesystem\",{rawIn:[\"path\",\"data\"]}),\"filesystem.deleteFile\":I(null,null,\"filesystem\",{rawIn:[\"path\"]}),\"filesystem.mkdir\":I(\"FsParams\",null,\"filesystem\",{rawIn:[\"path\"]}),\"filesystem.readdir\":I(null,null,\"filesystem\",{rawIn:[\"path\"],listsOut:{entries:\"FsEntry\"}}),\"filesystem.stat\":I(null,\"FsStat\",\"filesystem\",{rawIn:[\"path\"],rawOut:[\"path\"]}),\"filesystem.rename\":I(null,null,\"filesystem\",{rawIn:[\"path\",\"to_path\"]}),\"exec.execFile\":I(\"ExecParams\",\"ExecResult\",\"process_exec\",{rawIn:[\"file\",\"cwd\",\"input\"],listsIn:{args:\"TextValue\",env:\"EnvVar\"},rawOut:[\"stdout\",\"stderr\"]}),\"context.get\":I(\"ContextParams\",\"BoolValue\",\"context_read\",{rawOut:[\"value\"]}),\"context.listKeys\":I(\"ContextParams\",null,\"context_read\",{listsOut:{items:\"TextValue\"}}),\"context.listScopes\":I(null,null,\"context_read\",{listsOut:{items:\"TextValue\"}}),\"context.set\":I(\"ContextParams\",null,\"context_write\",{rawIn:[\"value\"]}),\"context.delete\":I(\"ContextParams\",\"BoolValue\",\"context_write\")});function Jf(e){if(!Number.isInteger(e)||e<0||e>255)throw new TypeError(\"Expected byte values in range 0..255.\")}function th(e){if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(Array.isArray(e))return e.forEach(Jf),Uint8Array.from(e);throw new TypeError(\"Expected Uint8Array, ArrayBuffer, ArrayBufferView, or byte array.\")}function On(e){return Buffer.from(th(e)).toString(\"base64\")}var Tn=256*1024*1024;function mn(e){let t=String(e??\"\").trim();if(t.length>Tn)throw new RangeError(`Base64 input exceeds ${Tn} character limit.`);return new Uint8Array(Buffer.from(t,\"base64\"))}var eh=new TextDecoder,le=new TextEncoder,C=e=>e===void 0?void 0:eh.decode(e),rt=e=>e==null?void 0:e instanceof Uint8Array?e:typeof e==\"string\"?le.encode(e):new Uint8Array(e),Yt=e=>(e||[]).map(t=>({VALUE:String(t)})),gn=e=>BigInt(Math.round(e instanceof Date?e.getTime():Number(e))),Un=e=>e.toLowerCase().replace(/_([a-z0-9])/g,(t,s)=>s.toUpperCase()),sh=e=>e.replace(/([a-z0-9])([A-Z])/g,\"$1_$2\").toUpperCase();function _e(e){let t={};for(let[s,i]of Object.entries(e||{}))i==null||i===\"\"||i===0||i===0n||i===!1||(t[Un(s)]=typeof i==\"bigint\"?Number(i):i);return t}function de(e,t){if(!e||!t||typeof t!=\"object\")return null;let s={};for(let[i,r]of Object.entries(t))r==null||r instanceof Uint8Array||typeof r==\"object\"||(s[sh(i)]=r);return ih(e,s)}function ih(e,t){let s=Dt[e]?.prototype;return s?Object.fromEntries(Object.entries(t).filter(([i])=>typeof s[`set${i}`]==\"function\")):t}function rh(e){if(!e)return;let t={};for(let s of C(e).split(/\\r?\\n/)){let i=s.indexOf(\":\");i>0&&(t[s.slice(0,i).trim()]=s.slice(i+1).trim())}return t}function nh(e){return e?(typeof e.entries==\"function\"&&!(e instanceof Map)&&!Array.isArray(e)?Array.from(e.entries()):e instanceof Map?Array.from(e):Object.entries(e)).map(([s,i])=>`${s}: ${Array.isArray(i)?i.join(\", \"):i}`).join(`\\r\n`):void 0}var ii=16;function oh(e){if(!e||e.length<ii)throw Object.assign(new Error(\"AES-GCM data is shorter than its 16-byte tag\"),{hostcallCode:\"invalid-params\"});return{ciphertext:e.subarray(0,e.length-ii),tag:e.subarray(e.length-ii)}}var ah=(e,t)=>{let s=new Uint8Array(e.length+t.length);return s.set(e,0),s.set(t,e.length),s},lt=(e,t=\"failed\")=>Object.assign(new Error(e),{hostcallCode:t}),y=e=>e==null?\"\":String(e);function ct(e){if(e==null||e===\"\")return;if(e instanceof Date)return BigInt(Number.isFinite(e.getTime())?e.getTime():0);if(typeof e==\"bigint\")return e;if(typeof e==\"number\")return BigInt(Number.isFinite(e)?Math.trunc(e):0);let t=Date.parse(String(e));return BigInt(Number.isFinite(t)?t:0)}var hi=(e,t)=>Object.keys(e).find(s=>e[s]===Number(t??0))??\"\",Et=e=>e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?new Uint8Array(e):void 0,yn=new Map;function fh(e){let t=yn.get(e);return t||yn.set(e,t=e.fromPointer(new ArrayBuffer(e.SIZE),0)),t}function hh(e){if(typeof e==\"bigint\")return e;if(typeof e==\"boolean\")return e?1n:0n;if(typeof e==\"string\"&&/^-?\\d+$/.test(e.trim()))return BigInt(e.trim());let t=Number(e);return BigInt(Number.isFinite(t)?Math.trunc(t):0)}function Pn(e,t){let s=fh(e),i=e.prototype,r={};for(let[o,a]of Object.entries(t||{})){if(a==null)continue;let E=o[0].toLowerCase()+o.slice(1);if(typeof i[`set${o}`]!=\"function\"){typeof i[E]==\"function\"&&typeof i[`setHas${o}`]==\"function\"&&typeof a==\"object\"&&(r[o]=Pn(s[E]().constructor,a));continue}let l=typeof s[E]();r[o]=l===\"bigint\"?hh(a):l===\"number\"?Number.isFinite(Number(a))?Number(a):0:l===\"boolean\"?a===!0||a===\"true\":String(a)}return r}var V=(e,t)=>Pn(Dt[e],t);function ce(e,t){let s={};for(let[i,r]of Object.entries(t||{}))[\"string\",\"number\",\"boolean\",\"bigint\"].includes(typeof r)&&(s[i.toUpperCase()]=r);return V(e,s)}function ut(e){let t={};for(let[s,i]of Object.entries(e||{}))i==null||i===\"\"||i===!1||i===0||i===0n||Array.isArray(i)&&i.length===0||(t[s.toLowerCase()]=typeof i==\"bigint\"?Number(i):i);return t}function ch(e){let t=new Uint8Array(e.reduce((r,o)=>r+4+o.length,0)),s=new DataView(t.buffer),i=0;for(let r of e)s.setUint32(i,r.length,!0),t.set(r,i+4),i+=4+r.length;return t}var Nn=2**53;function uh(e){if(!e.params)return;let t;try{t=Rn(e.params)}catch(s){throw lt(`params: ${s.message}`,\"invalid-params\")}return t.map(({t:s,v:i})=>s===\"null\"?{t:s}:s===\"i64\"?{t:s,v:i>BigInt(Nn)||i<-BigInt(Nn)?i.toString():Number(i)}:{t:s,v:i})}var Eh=e=>hi(En,e?.DELIVER)===\"Ref\"?\"ref\":void 0;function ci(e,t){delete e.deliver;let s=Eh(t);return s&&(e.deliver=s),e}function ri({params:e,raw:t}){let s={sql:C(t.sql)??\"\"},i=uh(t);return i&&(s.params=i),ci(s,e)}var vn=e=>({TOKEN:e.token,SIZE:e.size,FRAMES:e.frames??-1,FNV1A64:y(e.fnv1a64)});function ni(e,t=\"StreamResult\"){let s={ROWS:e?.rows??0,COLUMNS:e?.columns??0},i={raw:{}};return e?.ref&&typeof e.ref==\"object\"?s.REF=vn(e.ref):Et(e?.stream)&&(i.raw.stream=Et(e.stream)),i.result=V(t,s),i}function lh(e){if(e==null)return{t:\"null\"};if(typeof e==\"boolean\")return{t:\"bool\",v:e};if(typeof e==\"number\")return Number.isInteger(e)?{t:\"i64\",v:BigInt(e)}:{t:\"f64\",v:e};if(typeof e==\"string\")return{t:\"str\",v:e};throw lt(`storage.query_sandboxed: a cell is a ${Array.isArray(e)?\"list\":typeof e} (nested values are not SQL values)`)}function _h(e){let t=[],s=(i,r)=>{if(r!=null){if(Array.isArray(r)){r.forEach((o,a)=>s(`${i}.${a}`,o));return}if(typeof r==\"object\"&&!(r instanceof Date)){for(let o of Object.keys(r).sort())s(i?`${i}.${o}`:o,r[o]);return}if(typeof r==\"boolean\")t.push({KEY:i,KIND:2,BOOL_VALUE:r});else if(typeof r==\"string\")t.push({KEY:i,KIND:0,STRING_VALUE:r});else if(typeof r==\"number\"||typeof r==\"bigint\")t.push({KEY:i,KIND:1,NUMBER_VALUE:Number(r)});else throw lt(`plugin.getConfig: ${i} is a ${r instanceof Date?\"Date\":typeof r}`)}};s(\"\",e??{});for(let i of t)if(le.encode(i.KEY).length>255||le.encode(i.STRING_VALUE??\"\").length>255)throw lt(`plugin.getConfig: ${i.KEY} does not fit a ConfigEntry (255 bytes)`,\"too-large\");return t}function ue({params:e,raw:t}){let s={id:y(e?.ID)};return e?.USERNAME&&(s.username=e.USERNAME),t.secret&&(s.secret=C(t.secret)),s}function Dn(e){return{result:V(\"SecretResult\",{ID:y(e?.id),CONFIGURED:e?.configured===!0||e?.stored===!0,USERNAME_MASKED:y(e?.username_masked),UPDATED_MS:ct(e?.updated_at??e?.updatedAt)??0n,VERIFIED_MS:ct(e?.verified_at)??0n})}}function Ln(e){return t=>{if(t==null||t===\"\")throw lt(`node ${e} not available`);return{raw:{value:String(t)}}}}function Cn(e){return V(\"P2pPnmEntry\",{PEER_ID:e.peer_id,PUBLISHER_PEER_ID:e.publisher_peer_id,GOSSIP_PEER_ID:e.gossip_peer_id,STANDARD:e.standard,SCHEMA:e.schema,FILE_ID:e.file_id,FILE_NAME:e.file_name,CID:e.cid,PUBLISH_MS:ct(e.publish_timestamp??e.publish_ms),SIGNATURE_TYPE:e.signature_type,SIGNATURE_HEX:e.signature??e.signature_hex,SIGNATURE_VERIFIED:e.signature_verified,ATTRIBUTION:e.attribution,PNM_INDEX:e.pnm_index??-1,PUBLISHER_KEY_HEX:e.publisher_key??e.publisher_key_hex,PUBLISHER_KEY_SOURCE:e.publisher_key_source})}var oi=e=>Et(e?.records)?{records:Et(e.records)}:{},Ee=({params:e})=>ci(ut(e),e),Rt=e=>Array.isArray(e)?e.filter(t=>t&&typeof t==\"object\"):[],Hn={\"host.runtimeTarget\":{out:e=>({raw:{value:String(e)}})},\"host.listCapabilities\":{out:e=>({lists:{items:Yt(e)}})},\"host.listSupportedCapabilities\":{out:e=>({lists:{items:Yt(e)}})},\"host.listOperations\":{out:e=>({lists:{items:Yt(e)}})},\"host.hasCapability\":{in:({params:e})=>({capability:e?.CAPABILITY}),out:e=>({result:{VALUE:!!e}})},\"clock.now\":{out:e=>({result:{UNIX_MS:gn(e)}})},\"clock.nowIso\":{out:e=>({raw:{value:String(e)}})},\"clock.monotonicNow\":{out:e=>({result:{VALUE:Number(e)}})},\"random.bytes\":{in:({params:e})=>({length:e?.LENGTH||32}),out:e=>({raw:{data:rt(e)}})},\"timers.delay\":{in:({params:e})=>({ms:e?.MS??0}),out:()=>({})},\"schedule.parse\":{in:({params:e})=>({expression:e?.EXPRESSION}),out:e=>({lists:{fields:Object.entries(e||{}).filter(([,t])=>t&&typeof t==\"object\"&&Array.isArray(t.values)).map(([t,s])=>({NAME:t,SOURCE:String(s.source??\"\"),HAS_WILDCARD:!!s.hasWildcard,VALUES:s.values}))}})},\"schedule.matches\":{in:({params:e})=>({expression:e?.EXPRESSION,date:e?.AT_MS?new Date(Number(e.AT_MS)):new Date}),out:e=>({result:{VALUE:!!e}})},\"schedule.next\":{in:({params:e})=>({expression:e?.EXPRESSION,from:e?.AT_MS?new Date(Number(e.AT_MS)):new Date}),out:e=>({result:{UNIX_MS:gn(e)}})},\"http.request\":{in:({params:e,raw:t})=>({url:C(t.url),method:e?.METHOD||\"GET\",headers:rh(t.headers),body:t.body,timeoutMs:e?.TIMEOUT_MS||void 0,responseType:\"bytes\",redirect:e?.NO_REDIRECTS?\"manual\":\"follow\",maxBytes:e?.MAX_BYTES?Number(e.MAX_BYTES):void 0}),out:(e,{params:t})=>{let s=rt(e?.body)??new Uint8Array(0);if(t?.MAX_BYTES&&s.length>Number(t.MAX_BYTES))throw Object.assign(new Error(`HTTP body of ${s.length} bytes exceeds MAX_BYTES ${t.MAX_BYTES}`),{hostcallCode:\"too-large\"});return{result:{STATUS:e?.status??0,RETRIEVED_MS:BigInt(Date.now())},raw:{url:String(e?.url??\"\"),headers:nh(e?.headers)??\"\",body:s}}}},\"websocket.exchange\":{in:({params:e,raw:t})=>({url:C(t.url),protocols:t.protocols?C(t.protocols).split(\",\").map(s=>s.trim()).filter(Boolean):void 0,message:t.message===void 0?void 0:e?.MESSAGE_IS_TEXT?C(t.message):t.message,timeoutMs:e?.TIMEOUT_MS||void 0,expectResponse:!e?.NO_RESPONSE,responseType:\"bytes\"}),out:e=>({result:{PROTOCOL:e?.protocol??\"\",EXTENSIONS:e?.extensions??\"\",CLOSE_CODE:e?.closeCode??-1,CLOSE_REASON:e?.closeReason??\"\",BODY_IS_TEXT:typeof e?.body==\"string\"},raw:{url:String(e?.url??\"\"),...e?.body==null?{}:{body:rt(e.body)}}})},\"mqtt.publish\":{in:({params:e,raw:t})=>({..._e(e),keepAliveSeconds:e?.KEEP_ALIVE_S||void 0,payload:t.payload,password:C(t.password)}),out:e=>({result:de(\"MqttResult\",e)})},\"mqtt.subscribeOnce\":{in:({params:e,raw:t})=>({..._e(e),keepAliveSeconds:e?.KEEP_ALIVE_S||void 0,password:C(t.password),responseType:\"bytes\"}),out:e=>({result:de(\"MqttResult\",e),raw:e?.payload==null&&e?.body==null?{}:{body:rt(e.payload??e.body)}})},\"tcp.request\":fi(),\"udp.request\":fi(),\"tls.request\":fi(({raw:e})=>({ca:C(e.ca),cert:C(e.cert),key:C(e.key)})),\"filesystem.resolvePath\":{in:({raw:e})=>({path:C(e.path)}),out:e=>({raw:{path:String(e)}})},\"filesystem.readFile\":{in:({raw:e})=>({path:C(e.path)}),out:e=>({raw:{data:rt(e)}})},\"filesystem.writeFile\":{in:({raw:e})=>({path:C(e.path),value:e.data??new Uint8Array(0)}),out:()=>({})},\"filesystem.appendFile\":{in:({raw:e})=>({path:C(e.path),value:e.data??new Uint8Array(0)}),out:()=>({})},\"filesystem.deleteFile\":{in:({raw:e})=>({path:C(e.path)}),out:()=>({})},\"filesystem.mkdir\":{in:({params:e,raw:t})=>({path:C(t.path),recursive:!e?.NOT_RECURSIVE}),out:()=>({})},\"filesystem.readdir\":{in:({raw:e})=>({path:C(e.path)??\".\"}),out:e=>({lists:{entries:(e||[]).map(t=>({NAME:t.name,IS_FILE:!!t.isFile,IS_DIRECTORY:!!t.isDirectory}))}})},\"filesystem.stat\":{in:({raw:e})=>({path:C(e.path)}),out:e=>({result:{SIZE:BigInt(e?.size??0),IS_FILE:!!e?.isFile,IS_DIRECTORY:!!e?.isDirectory,CTIME_MS:Number(e?.ctimeMs??0),MTIME_MS:Number(e?.mtimeMs??0)},raw:{path:String(e?.path??\"\")}})},\"filesystem.rename\":{in:({raw:e})=>({fromPath:C(e.path),toPath:C(e.to_path)}),out:()=>({})},\"exec.execFile\":{in:({params:e,raw:t,lists:s})=>({file:C(t.file),args:(s.args||[]).map(i=>i.VALUE),cwd:C(t.cwd),input:t.input,env:s.env?Object.fromEntries(s.env.map(i=>[i.NAME,i.VALUE])):void 0,timeoutMs:e?.TIMEOUT_MS||void 0}),out:e=>({result:{EXIT_CODE:e?.exitCode??-1,SIGNAL:e?.signal??\"\"},raw:{stdout:rt(e?.stdout)??new Uint8Array(0),stderr:rt(e?.stderr)??new Uint8Array(0)}})},\"context.get\":{in:({params:e})=>({scope:e?.SCOPE,key:e?.KEY}),out:e=>({result:{VALUE:e!=null},raw:e==null?{}:{value:rt(e)}})},\"context.set\":{in:({params:e,raw:t})=>({scope:e?.SCOPE,key:e?.KEY,value:t.value??new Uint8Array(0)}),out:()=>({})},\"context.delete\":{in:({params:e})=>({scope:e?.SCOPE,key:e?.KEY}),out:e=>({result:{VALUE:!!e}})},\"context.listKeys\":{in:({params:e})=>({scope:e?.SCOPE}),out:e=>({lists:{items:Yt(e)}})},\"context.listScopes\":{out:e=>({lists:{items:Yt(e)}})},\"crypto.sha256\":{in:({raw:e})=>({value:e.data??new Uint8Array(0)}),out:tt},\"crypto.sha512\":{in:({raw:e})=>({value:e.data??new Uint8Array(0)}),out:tt},\"crypto.hkdf\":{in:({params:e,raw:t})=>({ikm:t.ikm,salt:t.salt??new Uint8Array(0),info:t.info,length:e?.LENGTH||32}),out:tt},\"crypto.aesGcmEncrypt\":{in:({raw:e})=>({key:e.key,plaintext:e.data??new Uint8Array(0),iv:e.nonce,aad:e.aad}),out:(e,{raw:t})=>({raw:{data:ah(e.ciphertext,e.tag),nonce:t.nonce}})},\"crypto.aesGcmDecrypt\":{in:({raw:e})=>({key:e.key,...oh(e.data),iv:e.nonce,aad:e.aad}),out:tt},\"crypto.x25519.generateKeypair\":{out:e=>({raw:{private_key:e.privateKey,public_key:e.publicKey}})},\"crypto.x25519.publicKey\":{in:({raw:e})=>({privateKey:e.private_key}),out:tt},\"crypto.x25519.sharedSecret\":{in:({raw:e})=>({privateKey:e.private_key,publicKey:e.public_key}),out:tt},\"crypto.sealedBox.encryptForRecipient\":{in:({raw:e})=>({plaintext:e.data??new Uint8Array(0),recipientPublicKey:e.public_key,context:e.info?C(e.info):void 0}),out:e=>({raw:{data:mn(e.protectedBlobBase64)}})},\"crypto.sealedBox.decryptFromEnvelope\":{in:({raw:e})=>({envelope:{protectedBlobBase64:On(e.envelope??e.data)},recipientPrivateKey:e.private_key}),out:tt},\"crypto.secp256k1.publicKeyFromPrivate\":{in:({raw:e})=>({privateKey:e.private_key}),out:tt},\"crypto.secp256k1.sign\":{in:({raw:e})=>({message:e.data,privateKey:e.private_key}),out:tt},\"crypto.secp256k1.verify\":{in:({raw:e})=>({message:e.data,signature:e.signature,publicKey:e.public_key}),out:ai},\"crypto.secp256k1.signDigest\":{in:({raw:e})=>({digest:e.data,privateKey:e.private_key}),out:tt},\"crypto.secp256k1.verifyDigest\":{in:({raw:e})=>({digest:e.data,signature:e.signature,publicKey:e.public_key}),out:ai},\"crypto.ed25519.publicKeyFromSeed\":{in:({raw:e})=>({seed:e.private_key}),out:tt},\"crypto.ed25519.sign\":{in:({raw:e})=>({message:e.data,seed:e.private_key}),out:tt},\"crypto.ed25519.verify\":{in:({raw:e})=>({message:e.data,signature:e.signature,publicKey:e.public_key}),out:ai},\"plugin.getConfig\":{in:()=>({}),out:e=>({lists:{entries:_h(e)}})},\"node.peerId\":{in:()=>({}),out:Ln(\"peer ID\")},\"node.publicKey\":{in:()=>({}),out:Ln(\"public key\")},\"secrets.get\":{in:ue,out:e=>({result:V(\"SecretResult\",{ID:y(e?.id),USERNAME:y(e?.username),CONFIGURED:!0}),raw:{secret:rt(e?.secret)??new Uint8Array(0)}})},\"secrets.status\":{in:ue,out:Dn},\"secrets.put\":{in:ue,out:Dn},\"secrets.clear\":{in:ue,out:()=>({})},\"storage.write\":{in:({params:e,raw:t})=>({...ut(e),data:t.data??new Uint8Array(0)}),out:e=>({result:V(\"StorageWriteResult\",{CID:y(e?.cid)})})},\"storage.query\":{in:({params:e})=>ut(e),out:e=>{let t=[],s=[];for(let i of Rt(Array.isArray(e)?e:e?.records)){let r=i.SourceTags||{},o=Et(i.Data)??new Uint8Array(0);s.push(o),t.push(V(\"StoredRecordMeta\",{CID:y(i.CID),ROW_ID:i.RowID??0,PEER_ID:y(i.PeerID),TIMESTAMP_MS:ct(i.Timestamp)??0n,MATERIALIZED_MS:ct(i.MaterializedAt)??0n,LENGTH:o.length,PROVIDER_ID:y(r.ProviderID),SOURCE_NAME:y(r.SourceName),BATCH_ID:y(r.BatchID),PRODUCER_PEER_ID:y(r.ProducerPeerID),LICENSE:y(r.License)}))}return{lists:{records_meta:t},raw:{records:ch(s)}}}},\"storage.delete\":{in:({params:e})=>ut(e),out:()=>({})},\"storage.expire\":{in:({params:e})=>ut(e),out:e=>({result:ce(\"StorageExpireResult\",e)})},\"storage.ingest_with_source\":{in:({params:e,raw:t,lists:s})=>{let i=ut(e);delete i.archive_source,delete i.archive_name,i.reconcile=hi(ln,e?.RECONCILE).toLowerCase(),t.records&&(i.records=t.records),t.archive&&(i.archive={source:y(e?.ARCHIVE_SOURCE),name:y(e?.ARCHIVE_NAME),raw:t.archive});let r=s.provenance?.[0],o=s.provenance_attributes;if(r||o?.length){let a={};o?.length&&(a.attributes=o.map(l=>({name:y(l.NAME),value:y(l.VALUE)})));for(let[l,_]of Object.entries(r||{}))a[l.toLowerCase()]=typeof _==\"bigint\"?Number(_):_??\"\";let E=Object.fromEntries(Object.keys(a).sort().map(l=>[l,a[l]]));i.provenance={source:y(e?.SOURCE_NAME),json:le.encode(JSON.stringify(E))}}return i},out:e=>{let t=ce(\"StorageIngestResult\",e);return e?.provenance&&(t.PROVENANCE_FILE=y(e.provenance)),{result:t}}},\"storage.flatsql_query_stream\":{in:ri,out:e=>ni(e)},\"storage.flatsql_epoch_stream\":{in:({params:e})=>ci(ut(e),e),out:e=>ni(e)},\"storage.query_sandboxed\":{in:e=>({...ri(e),want:hi(he,e.params?.WANT).toLowerCase()}),out:e=>{if(e?.kind!==\"rows\"){let o=ni(e,\"SandboxQueryResult\");return o.result.KIND=he.Stream,o}let t=typeof e.json==\"string\"?e.json:Et(e.json)?C(Et(e.json)):void 0;if(t===void 0)throw lt(\"storage.query_sandboxed: rows answer carries no rows\");let s;try{s=JSON.parse(t)}catch(o){throw lt(`storage.query_sandboxed: ${o.message}`)}if(!Array.isArray(s))throw lt(\"storage.query_sandboxed: rows are not a JSON array\");let i=s.length&&s[0]&&typeof s[0]==\"object\"?Object.keys(s[0]):[],r=[];for(let o of s){if(!o||typeof o!=\"object\"||Array.isArray(o))throw lt(\"storage.query_sandboxed: a row is not an object\");for(let a of Object.values(o))r.push(lh(a))}return{result:V(\"SandboxQueryResult\",{KIND:he.Rows,ROWS:s.length,COLUMNS:i.length}),lists:{columns:i.map(o=>({VALUE:o}))},raw:{cells:bn(r)}}}},\"storage.query_surface\":{in:()=>({}),out:e=>{let t=[],s=[];for(let r of Rt(e?.tables)){let o=y(r.name);t.push(V(\"SurfaceTable\",{NAME:o,KIND:y(r.kind),SOURCE:y(r.source),RECORDS:r.records??0}));for(let a of Array.isArray(r.columns)?r.columns:[])typeof a==\"string\"?s.push(V(\"SurfaceColumn\",{TABLE:o,NAME:a})):a&&typeof a==\"object\"&&s.push(V(\"SurfaceColumn\",{TABLE:o,NAME:y(a.name),PLACEHOLDER:a.placeholder===!0}))}let i=e?.caps&&typeof e.caps==\"object\"?e.caps:null;return{...i?{result:V(\"QuerySurfaceLimits\",{TIMEOUT_MS:i.timeout_ms??0,MAX_ROWS:i.max_rows??0,MAX_BYTES:i.max_bytes??0})}:{},lists:{tables:t,columns:s}}}},\"storage.flatsql_cache_key\":{in:e=>{let t={...ut(e.params),...ri(e)};return e.lists.projection&&(t.projection=e.lists.projection.map(s=>y(s.VALUE))),t},out:e=>({raw:{value:y(e?.key)}})},\"p2p.peers_snapshot\":{in:Ee,out:e=>{let t=[],s=[],i=[];for(let r of Rt(e?.peers)){t.push(V(\"P2pPeer\",{PEER_ID:y(r.peer_id),CONNECTED:r.connected===!0,SELF:r.self===!0,EPM_INDEX:r.epm_index??-1,AGENT_VERSION:r.agent_version}));for(let o of Array.isArray(r.addrs)?r.addrs:[])s.push(V(\"P2pPeerValue\",{PEER_ID:y(r.peer_id),VALUE:y(o)}));for(let o of Array.isArray(r.standards)?r.standards:[])i.push(V(\"P2pPeerValue\",{PEER_ID:y(r.peer_id),VALUE:y(o)}))}return{result:ce(\"P2pSummary\",e),lists:{peers:t,peer_addresses:s,peer_standards:i},raw:oi(e)}}},\"p2p.standards_snapshot\":{in:Ee,out:e=>({lists:{entries:Rt(e?.entries).map(Cn)},raw:oi(e)})},\"p2p.pnm_history\":{in:Ee,out:e=>({result:ce(\"P2pSummary\",e),lists:{entries:Rt(e?.entries).map(Cn)},raw:oi(e)})},\"p2p.latest_dataset\":{in:Ee,out:e=>{let t=e?.serving&&typeof e.serving==\"object\"?e.serving:{},s=(t.pnm&&typeof t.pnm==\"object\"?t.pnm:e?.pnm)||{};return{result:V(\"P2pLatestDataset\",{KNOWN:e?.known===!0,REASON:e?.reason,PINNED:e?.pinned,SELF:e?.self,FRESH:e?.fresh,STANDARD:e?.standard,SCHEMA:e?.schema,PNM_CID:s.CID??s.cid,PNM_FILE_ID:s.FILE_ID??s.file_id,PNM_PUBLISH_MS:ct(s.PUBLISH_TIMESTAMP??s.publish_timestamp),PNM_SIGNATURE_VERIFIED:s.signature_verified,PNM_ATTRIBUTION:s.attribution,BATCH_ID:t.batch_id,PROVIDER_ID:t.provider_id,SOURCE_NAME:t.source_name,RECORD_COUNT:t.record_count,BYTE_COUNT:t.byte_count,PARTS:t.parts,PUBLISHED_MS:ct(t.published_at),ETAG_FNV1A64:t.etag_fnv1a64,REF:t.ref&&typeof t.ref==\"object\"?vn(t.ref):void 0}),raw:Et(t.stream)?{stream:Et(t.stream)}:{}}}},\"node_status_read.status\":{in:()=>({}),out:e=>{let t=e?.store||{},s=e?.service||{},i={UPTIME_S:e?.uptime_seconds??0,STARTED_MS:ct(e?.started_at)??0n,STORE_TOTAL_BYTES:t.total_bytes??0,STORE_TOTAL_RECORDS:t.total_records??0,STORAGE_PATH:y(t.storage_path),SERVICE_STATE:y(s.state),SERVICE_MODE:y(s.mode)};e?.disk&&typeof e.disk==\"object\"&&Object.assign(i,{HAS_DISK:!0,DISK_CAPACITY_BYTES:e.disk.capacity_bytes??0,DISK_FREE_BYTES:e.disk.free_bytes??0,DISK_AVAILABLE_BYTES:e.disk.available_bytes??0});let r=[];if(e?.bandwidth&&typeof e.bandwidth==\"object\"){let o=e.bandwidth;Object.assign(i,{HAS_BANDWIDTH:!0,TOTAL_IN_BYTES:o.total_in_bytes??0,TOTAL_OUT_BYTES:o.total_out_bytes??0,RATE_IN_BPS:o.rate_in_bps??0,RATE_OUT_BPS:o.rate_out_bps??0});for(let a of Rt(o.history))r.push(V(\"NodeBandwidthSample\",{TS_MS:ct(a.ts)??0n,TOTAL_IN_BYTES:a.total_in_bytes??0,TOTAL_OUT_BYTES:a.total_out_bytes??0,RATE_IN_BPS:a.rate_in_bps??0,RATE_OUT_BPS:a.rate_out_bps??0}))}return{result:V(\"NodeStatusReport\",i),lists:{bandwidth_history:r}}}},\"node_activity_read.activity\":{in:({params:e})=>ut(e),out:e=>({lists:{events:Rt(e?.events).map(t=>V(\"NodeActivityEvent\",{TS_MS:ct(t.ts)??0n,KIND:y(t.kind),DETAIL:y(t.detail),PEER_ID:y(t.peer_id)}))}})}};function tt(e){return{raw:{data:rt(e)??new Uint8Array(0)}}}function ai(e){return{result:{VALUE:!!e}}}function fi(e=()=>({})){return{in:t=>{let{params:s,raw:i}=t,r=_e(s);return delete r.noResponse,delete r.allowUnauthorized,delete r.serverName,{...r,data:i.data,responseEncoding:\"bytes\",expectResponse:!s?.NO_RESPONSE,rejectUnauthorized:!s?.ALLOW_UNAUTHORIZED,servername:s?.SERVER_NAME||void 0,...e(t)}},out:t=>({result:de(\"SocketResult\",t),raw:t?.body==null?{}:{body:rt(t.body)}})}}function dh(e){let t=Hn[e.op];return t?.in?t.in(e):{..._e(e.params),...Object.fromEntries(Object.entries(e.raw).map(([s,i])=>[Un(s),i]))}}function Ih(e,t){let s=Hn[e.op];if(s?.out)return s.out(t,e);let i=Gt[e.op];return{result:i?.result?de(i.result,t):void 0}}function ph(e){if(e?.hostcallCode)return e.hostcallCode;let t=e?.name??e?.constructor?.name??\"\";return t===\"HostCapabilityError\"||t===\"BrowserHostCapabilityError\"||e?.code===\"host-capability-denied\"?\"not-authorized\":t===\"HostFilesystemScopeError\"?\"sandbox\":t===\"AbortError\"||t===\"TimeoutError\"||/timed out/i.test(e?.message??\"\")?\"timeout\":/^Unknown .* operation|not available in the synchronous hostcall ABI|does not implement/.test(e?.message??\"\")?\"unsupported\":/exceeds? the record/.test(e?.message??\"\")?\"too-large\":e instanceof RangeError||e instanceof TypeError?\"invalid-params\":\"failed\"}function Bn(e,t,{allowAsync:s=!1}={}){let i,r=a=>si({ok:!1,error:{code:ph(a),message:String(a?.message??a)}}),o=a=>{try{return si({ok:!0,op:i.op,...Ih(i,a)})}catch(E){return r(E)}};try{if(i=Sn(e),!Gt[i.op])throw Object.assign(new Error(`Unknown host operation \"${i.op}\".`),{hostcallCode:\"unsupported\"});let a=t(i.op,dh(i));if(a&&typeof a.then==\"function\"){if(!s)throw typeof a.catch==\"function\"&&a.catch(()=>{}),Object.assign(new Error(`Operation \"${i.op}\" is not available in the synchronous hostcall ABI.`),{hostcallCode:\"unsupported\"});return a.then(o,r)}return o(a)}catch(a){return a&&!a.hostcallCode&&i===void 0&&(a.hostcallCode=\"invalid-params\"),r(a)}}var Mn=Object.freeze({\"node.peerId\":{capability:null,adapter:\"node\",method:\"peerId\"},\"node.publicKey\":{capability:null,adapter:\"node\",method:\"publicKey\"},\"secrets.get\":{capability:\"secrets\",adapter:\"secrets\",method:\"get\"},\"secrets.status\":{capability:\"secrets\",adapter:\"secrets\",method:\"status\"},\"secrets.put\":{capability:\"secrets\",adapter:\"secrets\",method:\"put\"},\"secrets.clear\":{capability:\"secrets\",adapter:\"secrets\",method:\"clear\"},\"storage.write\":{capability:\"storage_write\",adapter:\"storage\",method:\"write\"},\"storage.query\":{capability:\"storage_query\",adapter:\"storage\",method:\"query\"},\"storage.delete\":{capability:\"storage_write\",adapter:\"storage\",method:\"delete\"},\"storage.expire\":{capability:\"storage_write\",adapter:\"storage\",method:\"expire\"},\"storage.ingest_with_source\":{capability:\"storage_ingest\",adapter:\"storage\",method:\"ingest_with_source\"},\"storage.flatsql_query_stream\":{capability:\"storage_query\",adapter:\"storage\",method:\"flatsql_query_stream\"},\"storage.flatsql_epoch_stream\":{capability:\"storage_query\",adapter:\"storage\",method:\"flatsql_epoch_stream\"},\"storage.query_sandboxed\":{capability:\"storage_query\",adapter:\"storage\",method:\"query_sandboxed\"},\"storage.query_surface\":{capability:\"storage_query\",adapter:\"storage\",method:\"query_surface\"},\"storage.flatsql_cache_key\":{capability:\"storage_query\",adapter:\"storage\",method:\"flatsql_cache_key\"},\"p2p.peers_snapshot\":{capability:\"p2p_read\",adapter:\"p2p\",method:\"peers_snapshot\"},\"p2p.standards_snapshot\":{capability:\"p2p_read\",adapter:\"p2p\",method:\"standards_snapshot\"},\"p2p.pnm_history\":{capability:\"p2p_read\",adapter:\"p2p\",method:\"pnm_history\"},\"p2p.latest_dataset\":{capability:\"p2p_read\",adapter:\"p2p\",method:\"latest_dataset\"},\"node_status_read.status\":{capability:\"node_status_read\",adapter:\"node\",method:\"status\"},\"node_activity_read.activity\":{capability:\"node_activity_read\",adapter:\"node\",method:\"activity\"}}),Wl=Object.freeze([...new Set(Object.values(Mn).map(e=>e.capability).filter(Boolean))]);var Sh=new TextDecoder,Ei=\"space_data_module_host\",wt=0,ui=1,Jl=Object.freeze([\"host.runtimeTarget\",\"host.listCapabilities\",\"host.listSupportedCapabilities\",\"host.listOperations\",\"host.hasCapability\",\"plugin.getConfig\",\"clock.now\",\"clock.monotonicNow\",\"clock.nowIso\",\"random.bytes\",\"schedule.parse\",\"schedule.matches\",\"schedule.next\",\"filesystem.resolvePath\"]);function Ah(e,t){let s=String(e??\"\").trim();if(!s)throw new TypeError(`${t} is required.`);return s}function xn(e){if(typeof e!=\"function\")throw new TypeError(\"getMemory must be a function returning WebAssembly.Memory.\");let t=e();if(!t||typeof t!=\"object\"||!(\"buffer\"in t))throw new TypeError(\"getMemory must return a WebAssembly.Memory-like object.\");let s=t.buffer;if(!(s instanceof ArrayBuffer||s instanceof SharedArrayBuffer))throw new TypeError(\"Hostcall memory buffer must be an ArrayBuffer or SharedArrayBuffer.\");return s}function Fn(e,t,s,i){if(!Number.isInteger(t)||t<0)throw new RangeError(`${i} pointer must be a non-negative integer.`);if(!Number.isInteger(s)||s<0)throw new RangeError(`${i} length must be a non-negative integer.`);let r=xn(e);if(t+s>r.byteLength)throw new RangeError(`${i} range exceeds guest memory bounds.`);return new Uint8Array(r,t,s)}function bh(e,t,s,i){if(!Number.isInteger(t)||t<0)throw new RangeError(\"Response pointer must be a non-negative integer.\");if(!Number.isInteger(i)||i<0)throw new RangeError(\"Response max length must be a non-negative integer.\");let r=s instanceof Uint8Array?s:new Uint8Array(s),o=xn(e),a=Math.min(r.length,i);if(t+a>o.byteLength)throw new RangeError(\"Response range exceeds guest memory bounds.\");return new Uint8Array(o,t,a).set(r.subarray(0,a)),a}function Rh(e){if(e.length===0)return null;let{meta:t,segments:s}=Jt(e);return yt(t,s)}function Vn(e,t=null){return{name:e?.name??\"Error\",message:e?.message??String(e),code:e?.code??null,operation:e?.operation??t,capability:e?.capability??null}}function wh(e){return e!==null&&typeof e==\"object\"&&typeof e.then==\"function\"}function Gn(e={}){let t=e.dispatch;if(typeof t!=\"function\")throw new TypeError(\"createHostcallBridge requires a dispatch function.\");let s=e.getMemory,i=Ah(e.moduleName??Ei,\"Hostcall import module name\"),r=Number.isInteger(e.maxRequestBytes)?e.maxRequestBytes:16*1024*1024,o=Number.isInteger(e.maxResponseBytes)?e.maxResponseBytes:64*1024*1024,a=wt,E={ok:!0,result:null},l=Oe(E,[]);function _(d,S){let b=[],g=Xt(S,b),m=Oe(g,b);if(m.length>o)throw new Error(`Hostcall response exceeds ${o} byte limit.`);a=d,E=S,l=m}function p(d,S,b,g){try{if(g>r)throw new Error(`Hostcall request exceeds ${r} byte limit.`);let m=Sh.decode(Fn(s,d,S,\"Operation\")),H=Fn(s,b,g,\"Payload\");if(wn(H)){let _t=Bn(H.slice(),t);if(_t.length>o)throw new Error(`Hostcall response exceeds ${o} byte limit.`);return a=wt,E=null,l=_t,wt}let K=Rh(H),M=t(m,K);if(wh(M))throw typeof M.catch==\"function\"&&M.catch(()=>{}),new Error(`Operation \"${m}\" returned a Promise. The synchronous hostcall ABI only supports synchronous operations.`);return _(wt,{ok:!0,result:M===void 0?null:M}),wt}catch(m){try{_(ui,{ok:!1,error:Vn(m)})}catch(H){_(ui,{ok:!1,error:Vn(H)})}return ui}}function O(){return l.length}function A(d,S){return bh(s,d,l,S)}function w(){return _(wt,{ok:!0,result:null}),wt}function R(){return a}return{moduleName:i,imports:{[i]:{call:p,response_len:O,read_response:A,clear_response:w,last_status_code:R}},getLastEnvelope(){return structuredClone(E)},getLastResponseBytes(){return new Uint8Array(l)},getLastResponseEnvelope(){let{meta:d,segments:S}=Jt(l);return yt(d,S)}}}var e_=Object.freeze({READ:1,WRITE:2,CREATE:4,EXCL:8,TRUNC:16,DELETE_ON_CLOSE:32,PROBE:64,UNLINK:128,CREATE_PARENTS:256,UNLINK_IF_UNUSED:512,OPEN_DEFERRED:1024}),s_=Object.freeze({OK:0,GENERIC:-1,NOENT:-2,ACCESS:-3,IO:-4,NOSPACE:-5,BADHANDLE:-6,BUSY:-7});var i_=Object.freeze([\"flatsql_io_open\",\"flatsql_io_read\",\"flatsql_io_write\",\"flatsql_io_truncate\",\"flatsql_io_sync\",\"flatsql_io_size\",\"flatsql_io_close\"]),Ie=4096;var r_=typeof TextDecoder==\"function\"?new TextDecoder(\"utf-8\",{fatal:!0}):null;function Yn(e){let t=2166136261;for(let s=0;s<e.length;s+=1)t^=e[s],t=Math.imul(t,16777619);return t>>>0}var Th=1330201683,Oh=1,mh=0,gh=1,yh=2,Nh=3,Dh=4,qn=5;var Lh=7;var Ch=9,Se=10,Uh=11;var Ph=13,zn=64,Kn=zn*4;var vh=1;var Hh=1,Bh=2,Mh=3,qt=32767,Kt=0,Xn=1,jn=2,Fh=3,Vh=4,xh=5,Gh=6,Yh=7,kh=8,qh=9,Wn=10,Jn=11,Kh=12,jh=13,Wh=8,to=9,li=128,_i=0,$h=1,Zh=2;var Qh=4,zh=0;var Xh=0,Jh=1,tc=1,kt=2,pe=3,ec=4,sc=5,ic=6,rc=7;var a_=64*1024;var $n=250,nc=20;function Zn(){return typeof performance<\"u\"&&performance.now?performance.now():Date.now()}function oc(e,t){return Math.ceil(e/t)*t}function eo(e){if(typeof SharedArrayBuffer!=\"function\"||!(e instanceof SharedArrayBuffer))throw new TypeError(\"The SAB I/O channel requires a SharedArrayBuffer (cross-origin isolation in browsers).\")}function ac(e){eo(e);let t=new Int32Array(e,0,zn);if(t[mh]!==Th||t[gh]!==Oh)throw new TypeError(\"Not a SAB I/O channel buffer (bad magic or version).\");let s=t[yh],i=t[Nh],r=t[Dh],o=t[Uh],a=oc(Kn+r*4,64),E=new Int32Array(e,Kn,r),l=[];for(let _=0;_<s;_+=1){let p=a+_*i;l.push({index:_,base:p,i32:new Int32Array(e,p,li/4),f64:new Float64Array(e,p,li/8),data:new Uint8Array(e,p+li,o)})}return{buffer:e,header:t,instances:E,slots:l,slotCount:s,slotBytes:i,dataBytes:o,maxInstances:r,channelId:t[Ph]}}function fc(e){return`sdm-sab-io-doorbell-${e}`}function hc(e,t){Atomics.add(e.header,qn,1),Atomics.notify(e.header,qn),Atomics.load(e.header,Lh)===vh&&t()?.postMessage(0)}function cc(e){let t=null;return{get(){return!t&&typeof BroadcastChannel==\"function\"&&(t=new BroadcastChannel(e)),t},close(){t?.close(),t=null}}}var uc=typeof TextEncoder==\"function\"?new TextEncoder:null;function Ec(){return(Math.random()*2147483646|0)+1}function lc(e,t){let s=(Atomics.add(e.header,Ch,1)>>>0)%e.slotCount;for(let i=0;i<e.slotCount;i+=1){let r=e.slots[(s+i)%e.slotCount];if(Atomics.compareExchange(r.i32,Kt,_i,$h)===_i)return Atomics.store(r.i32,Xn,t),r}return null}function Qn(e,t){Atomics.store(t.i32,Xn,0),Atomics.store(t.i32,Kt,_i),Atomics.add(e.header,Se,1),Atomics.notify(e.header,Se)}function _c(e,t,s){let i=e.i32;i[Vh]=t,i[xh]=s.instanceId??qt,i[Gh]=s.handle??-1,i[Yh]=s.flags??0,i[kh]=s.ptr??0,i[qh]=s.len??0,i[jh]=s.dataInSlot?Jh:Xh,i[Jn]=0,e.f64[Wh]=s.offset??0,e.f64[to]=0,s.path?(e.data.set(s.path,0),i[Wn]=s.path.length):i[Wn]=0}function dc(e){return Atomics.load(e.i32,Jn)}function so(e={}){eo(e.buffer);let t=ac(e.buffer),s=Number.isInteger(e.instanceId)?e.instanceId:qt;if(s!==qt&&(s<0||s>=t.maxInstances))throw new RangeError(`instanceId ${s} is outside 0..${t.maxInstances-1}.`);let i=typeof e.getMemory==\"function\"?e.getMemory:()=>null,r=Number.isFinite(e.spinMicros)?Math.max(0,e.spinMicros):nc,o=Ec(),a=cc(fc(t.channelId)),E=0;function l(){for(;;){let d=Atomics.load(t.header,Se),S=lc(t,o);if(S)return S;Atomics.wait(t.header,Se,d,$n)}}function _(d,S,b){let g=Atomics.load(d.i32,jn)+1|0||1;_c(d,S,b),Atomics.store(d.i32,Kh,zh),Atomics.store(d.i32,jn,g),Atomics.store(d.i32,Kt,Zh),hc(t,a.get);let m=r>0?Zn()+r/1e3:0;for(;;){let H=Atomics.load(d.i32,Kt);if(H===Qh&&Atomics.load(d.i32,Fh)===g)break;m>0&&Zn()<m||Atomics.wait(d.i32,Kt,H,$n)}return E+=1,{status:dc(d),result:d.f64[to]}}function p(d,S){let b=l();try{return _(b,d,S)}finally{Qn(t,b)}}function O(){return s!==qt&&Atomics.load(t.instances,s)===Hh}function A(){if(s===qt)return!1;let d=Atomics.load(t.instances,s);return d===Bh||d===Mh}function w(d,S,b,g){let m=0;for(;m<b.length;){let H=Math.min(t.dataBytes,b.length-m),K=l(),M;try{d===pe&&K.data.set(b.subarray(m,m+H),0),M=_(K,d,{instanceId:s,dataInSlot:!0,handle:S,ptr:0,len:H,offset:g+m}).status,d===kt&&M>0&&b.set(K.data.subarray(0,M),m)}finally{Qn(t,K)}if(M<0)return m>0&&d===kt?m:M;if(m+=M,M<H)break}return m}function R(d,S){let b=i(),g=b?.buffer??b;return!g||d<0||S<0||d+S>g.byteLength?null:new Uint8Array(g,d,S)}return{instanceId:s,get requests(){return E},open(d,S){let b=typeof d==\"string\"?uc.encode(d):d;return!(b instanceof Uint8Array)||b.length===0?-1:b.length>Math.min(t.dataBytes,Ie)?-1:p(tc,{instanceId:s,flags:S|0,path:b}).status},read(d,S,b,g){if(b===0)return 0;if(O())return p(kt,{instanceId:s,handle:d,ptr:S,len:b,offset:g}).status;let m=R(S,b);return m?w(kt,d,m,g):A()?-3:-1},write(d,S,b,g){if(b===0)return 0;if(O())return p(pe,{instanceId:s,handle:d,ptr:S,len:b,offset:g}).status;let m=R(S,b);return m?w(pe,d,m,g):A()?-3:-1},readInto(d,S,b){return S.length===0?0:w(kt,d,S,b)},writeFrom(d,S,b){return S.length===0?0:w(pe,d,S,b)},truncate(d,S){return p(ec,{instanceId:s,handle:d,offset:S}).status},sync(d){return p(sc,{instanceId:s,handle:d}).status},size(d){let{status:S,result:b}=p(ic,{instanceId:s,handle:d});return S<0?S:b},close(d){return p(rc,{instanceId:s,handle:d}).status},release(){a.close()}}}var Ic=typeof TextEncoder==\"function\"?new TextEncoder:null;function pc(e){let t=2166136261;for(let s=0;s<e.length;s+=1)t^=e[s],t=Math.imul(t,16777619);return t|0}var io=new WeakMap;function ro(e){let t=io.get(e);if(t)return t;let s=new Int32Array(e,0,16);if(s[0]!==1380795475||s[1]!==1)throw new TypeError(\"Not a SAB I/O mirror buffer.\");let i=s[2],r=s[3],o=s[4],a=64,E=a+i*32,l=E+i*o;return t={entries:i,entryBytes:r,maxPathBytes:o,i32:new Int32Array(e,a,i*32/4),f64:new Float64Array(e,a,i*32/8),paths:new Uint8Array(e,E,i*o),data:new Uint8Array(e,l,i*r)},io.set(e,t),t}function Sc(e){return typeof e==\"string\"?Ic.encode(e):e}function Ac(e,t,s){let i=t*8;if(Atomics.load(e.i32,i+3)!==s.length)return!1;let r=t*e.maxPathBytes;for(let o=0;o<s.length;o+=1)if(e.paths[r+o]!==s[o])return!1;return!0}function bc(e,t,s){let i=(s>>>0)%e.entries;for(let r=0;r<e.entries;r+=1){let o=i*8,a=Atomics.load(e.i32,o+0);if(a===0)return-1;if((a===2||a===3)&&Atomics.load(e.i32,o+2)===s&&Ac(e,i,t))return i;i=(i+1)%e.entries}return-1}function no(e,t){let s=ro(e),i=Sc(t);if(i.length>s.maxPathBytes)return-1;let r=bc(s,i,pc(i));return r<0?-1:Atomics.load(s.i32,r*(32/4)+0)===2?r:-1}function oo(e,t,s,i){let r=ro(e),o=t*(32/4),a=t*(32/8)+3,E=t*r.entryBytes;for(let l=0;l<64;l+=1){let _=Atomics.load(r.i32,o+1);if(_&1)continue;if(Atomics.load(r.i32,o+0)!==2)return-1;let p=r.f64[a],O=Atomics.load(r.i32,o+4),A;if(i>=p)A=0;else{let w=Math.min(s.length,p-i);i+w>O?A=-1:(s.set(r.data.subarray(E+i,E+i+w),0),A=w)}if(Atomics.load(r.i32,o+1)===_)return A}return-1}function ao(e=[\"/h.fsh\"]){let t=Array.from(e,String);return s=>{let i=String(s);for(let r of t)if(i.endsWith(r)||i===r.replace(/^\\//,\"\"))return!0;return!1}}var Rc=\"flatsql-io\",St=Object.freeze({open:1,read:2,write:3,truncate:4,sync:5,size:6,close:7,mirrorRead:8}),fo=24,ho=16777215;function di(){return typeof performance<\"u\"&&performance.now?performance.now()*1e3:Date.now()*1e3}function wc(e){if(!e?.buffer)return null;let t=new Int32Array(e.buffer,0,4),s=t[1],i=new Float64Array(e.buffer,16,s),r=new Uint8Array(e.buffer,16+s*8,s);return(o,a)=>{let E=Atomics.add(t,0,1);E<s&&(i[E]=di()-a,r[E]=o)}}function Tc(e,t,s){if(!e||s<=0||s>Ie||t<0)return null;let i=e.buffer??e;return t+s>i.byteLength?null:new Uint8Array(i,t,s).slice()}function Oc(e={}){let t=e.getMemory;if(typeof t!=\"function\")throw new TypeError(\"createFlatsqlIoImports requires getMemory().\");let s=Array.isArray(e.provider)?e.provider:[e.provider];if(s.length===0||s.some(A=>!A||typeof A.open!=\"function\"))throw new TypeError(\"createFlatsqlIoImports requires at least one provider.\");if(s.length>127)throw new RangeError(\"At most 127 providers can be routed.\");let i=s.length>1,r=wc(e.trace),o=e.mirror?.buffer??null,a=o?ao(e.mirror.suffixes??[\"/h.fsh\"]):null,E=new Map,l=new TextDecoder;function _(A){if(!i)return{provider:s[0],local:A};let w=A>>>fo,R=s[w];return R?{provider:R,local:A&ho}:null}function p(A,w,R){let d=r?di():0,S;try{S=R()}catch{S=w}return r&&r(A,d),S}return{env:{flatsql_io_open(A,w,R){return p(St.open,-1,()=>{let d=Tc(t(),A,w);if(!d)return-1;let S=i?Yn(d)%s.length:0,b=s[S].open(d,R|0);if(b<0)return b;if(i&&b>ho)return-4;let g=i?S<<fo|b:b;if(a){let m=l.decode(d);a(m)&&E.set(g,m)}return g})},flatsql_io_read(A,w,R,d){if(o&&E.has(A)){let S=r?di():0;try{let b=t(),g=b.buffer??b;if(w>=0&&R>=0&&w+R<=g.byteLength){let m=no(o,E.get(A));if(m>=0){let H=oo(o,m,new Uint8Array(g,w,R),d);if(H>=0)return r&&r(St.mirrorRead,S),H}}}catch{}}return p(St.read,-4,()=>{let S=_(A);return S?S.provider.read(S.local,w,R,d):-6})},flatsql_io_write(A,w,R,d){return p(St.write,-4,()=>{let S=_(A);return S?S.provider.write(S.local,w,R,d):-6})},flatsql_io_truncate(A,w){return p(St.truncate,-4,()=>{let R=_(A);return R?R.provider.truncate(R.local,w):-6})},flatsql_io_sync(A){return p(St.sync,-4,()=>{let w=_(A);return w?w.provider.sync(w.local):-6})},flatsql_io_size(A){return p(St.size,-4,()=>{let w=_(A);return w?w.provider.size(w.local):-6})},flatsql_io_close(A){return p(St.close,-4,()=>{E.delete(A);let w=_(A);return w?w.provider.close(w.local):-6})}}}}function mc(e,{getMemory:t}){let s=Array.isArray(e.channels)?e.channels:[e.channel??e.buffer];if(s.length===0||s.some(o=>!(o instanceof SharedArrayBuffer)))throw new TypeError(\"A flatsql-io descriptor needs channels: SharedArrayBuffer[].\");let i=s.map(o=>so({buffer:o,instanceId:e.instanceId,getMemory:t}));return{imports:Oc({getMemory:t,provider:i,mirror:e.mirror,trace:e.trace}),close(){for(let o of i)o.release()}}}function co(e,t){let s=[],i=[];for(let r of e??[]){let o;if(typeof r==\"function\")o=r(t);else if(r&&r.provider===Rc)o=mc(r,t);else if(r&&typeof r.factory==\"function\")o=r.factory({...t,config:r.config});else throw new TypeError(`Unresolvable extraImports entry ${JSON.stringify(r?.provider??r?.moduleUrl??typeof r)}; pass a factory function, a { provider: \"flatsql-io\" } descriptor, or (module workers) a { moduleUrl } descriptor.`);o&&o.imports&&typeof o.close==\"function\"?(s.push(o.imports),i.push(o.close)):o&&s.push(o)}return{fragments:s,close(){for(let r of i)try{r()}catch{}}}}function uo(e,t){for(let s of t)for(let[i,r]of Object.entries(s??{}))e[i]={...e[i]??{},...r};return e}var jt=0,gc=1,yc=2,lo=4,Ii=0,Eo=1;var Nc=0;var pi=lo*4,Dc=4*1024*1024;function Lc(e){if(typeof SharedArrayBuffer!=\"function\"||!(e instanceof SharedArrayBuffer))throw new TypeError(\"SAB hostcall channel requires a SharedArrayBuffer (cross-origin isolation in browsers).\")}function _o(e={}){if(typeof SharedArrayBuffer!=\"function\")throw new Error(\"SharedArrayBuffer is unavailable; the async hostcall bridge requires it (browsers additionally require cross-origin isolation: COOP+COEP).\");let t=Number.isInteger(e.maxResponseBytes)?e.maxResponseBytes:Dc;if(t<=0)throw new RangeError(\"maxResponseBytes must be a positive integer.\");return new SharedArrayBuffer(pi+t)}function Io(e={}){Lc(e.buffer);let t=e.postRequest;if(typeof t!=\"function\")throw new TypeError(\"createSabHostcallClientDispatch requires a postRequest function.\");let s=Number.isFinite(e.timeoutMs)&&e.timeoutMs>0?e.timeoutMs:12e4,i=new Int32Array(e.buffer,0,lo),r=e.buffer.byteLength-pi;return function(a,E=null){if(Atomics.store(i,jt,Eo),t({operation:a,params:E}),Atomics.wait(i,jt,Eo,s)===\"timed-out\")throw Atomics.store(i,jt,Ii),new Error(`Hostcall \"${a}\" timed out after ${s}ms waiting for the controlling thread.`);let _=Atomics.load(i,gc),p=Atomics.load(i,yc);if(p<0||p>r)throw Atomics.store(i,jt,Ii),new RangeError(`Hostcall \"${a}\" response length ${p} exceeds channel capacity ${r}.`);let O=new Uint8Array(p);O.set(new Uint8Array(e.buffer,pi,p)),Atomics.store(i,jt,Ii);let A=Oi(O);if(_!==Nc){let w=new Error(A?.message??`Hostcall \"${a}\" failed on the host thread.`);throw w.name=A?.name??\"Error\",w.code=A?.code??null,w.operation=A?.operation??a,w.capability=A?.capability??null,w}return A}}var Si=class extends Error{constructor(t){super(`WASI exit with code ${t}`),this.name=\"WasiExitError\",this.code=t}};function Cc(e,t,s,i){for(;;){let r=Atomics.load(e,t);if(s>i-r)return-1;if(Atomics.compareExchange(e,t,r,r+s)===r)return r}}function po(e={}){let t=e.processState,s=t?.args??e.args??[],i=t?.env??e.env??{},r=t?.input??new Uint8Array(e.stdinBytes??[]),o=e.logOutput===!0,a=e.performance??globalThis.performance??{now:()=>Date.now(),timeOrigin:0},E=e.crypto??globalThis.crypto??null,l=[],_=[],p=0,O=null;function A(T){O=T}function w(){return O}function R(){return new Uint8Array(O.buffer)}function d(){return new DataView(O.buffer)}let b=Object.entries(i).map(([T,N])=>`${T}=${N}`).map(T=>new TextEncoder().encode(T)),g=s.map(T=>new TextEncoder().encode(T));function m(T,N,U){let P;if(T===0)P=BigInt(Math.round((a.timeOrigin+a.now())*1e6));else if(T===1)P=BigInt(Math.round(a.now()*1e6));else return 28;return d().setBigUint64(U,P,!0),0}function H(T,N,U,P){if(T!==1&&T!==2)return 8;let L=T===1?l:_,G=0,Ot=d(),mt=R();for(let gt=0;gt<U;gt++){let zt=N+gt*8,At=Ot.getUint32(zt,!0),k=Ot.getUint32(zt+4,!0);if(t){let nt=T===1?t.stdout:t.stderr,Ti=Cc(t.control,T,k,nt.length);if(Ti<0)return 51;nt.set(mt.subarray(At,At+k),Ti)}else L.push(mt.slice(At,At+k));G+=k}return Ot.setUint32(P,G,!0),0}function K(T,N,U,P){if(T!==0)return d().setUint32(P,0,!0),8;let L=d(),G=R(),Ot=0;for(let mt=0;mt<U;mt+=1){let gt=N+mt*8,zt=L.getUint32(gt,!0),At=L.getUint32(gt+4,!0),k,nt;if(t)do k=Atomics.load(t.control,0),nt=Math.min(At,r.length-k);while(Atomics.compareExchange(t.control,0,k,k+nt)!==k);else k=p,nt=Math.min(At,r.length-k),p+=nt;if(nt===0){if(k>=r.length)break;continue}G.set(r.subarray(k,k+nt),zt),Ot+=nt}return L.setUint32(P,Ot,!0),0}function M(T){return T<=2?0:8}function _t(T,N,U,P){return T<=2?70:8}function No(T,N){if(T>2)return 8;let U=d();return U.setUint8(N,2),U.setUint16(N+2,0,!0),U.setBigUint64(N+8,0n,!0),U.setBigUint64(N+16,0n,!0),0}function Do(T,N){return T<=2?0:8}function Lo(T,N){return 8}function Co(T,N,U){return 8}function Uo(){return 8}function Po(T,N){let U=d();U.setUint32(T,b.length,!0);let P=0;for(let L of b)P+=L.length+1;return U.setUint32(N,P,!0),0}function vo(T,N){let U=d(),P=R(),L=N;for(let G=0;G<b.length;G++)U.setUint32(T+G*4,L,!0),P.set(b[G],L),L+=b[G].length,P[L]=0,L+=1;return 0}function Ho(T,N){let U=d();U.setUint32(T,g.length,!0);let P=0;for(let L of g)P+=L.length+1;return U.setUint32(N,P,!0),0}function Bo(T,N){let U=d(),P=R(),L=N;for(let G=0;G<g.length;G++)U.setUint32(T+G*4,L,!0),P.set(g[G],L),L+=g[G].length,P[L]=0,L+=1;return 0}function Mo(T,N){return E?.getRandomValues?(E.getRandomValues(R().subarray(T,T+N)),0):52}function Fo(T){throw t&&(Atomics.store(t.control,4,T),Atomics.store(t.control,3,1)),o&&wi(),new Si(T)}function Vo(){return 0}function wi(){if(l.length>0){let T=Qt(l);if(o){let N=new TextDecoder().decode(T);N&&console.log(N)}l.length=0}if(_.length>0){let T=Qt(_);if(o){let N=new TextDecoder().decode(T);N&&console.warn(N)}_.length=0}}function Qt(T){let N=0;for(let L of T)N+=L.length;let U=new Uint8Array(N),P=0;for(let L of T)U.set(L,P),P+=L.length;return U}return{imports:{wasi_snapshot_preview1:{clock_time_get:m,fd_write:H,fd_read:K,fd_close:M,fd_seek:_t,fd_fdstat_get:No,fd_fdstat_set_flags:Do,fd_prestat_get:Lo,fd_prestat_dir_name:Co,path_open:Uo,environ_sizes_get:Po,environ_get:vo,args_sizes_get:Ho,args_get:Bo,random_get:Mo,proc_exit:Fo,sched_yield:Vo}},setMemory:A,getMemory:w,flushOutput:wi,get stdout(){return t?t.stdout.slice(0,Atomics.load(t.control,1)):Qt(l)},get stderr(){return t?t.stderr.slice(0,Atomics.load(t.control,2)):Qt(_)}}}var Uc=\"sdm.thread-hostcall\";function Pc(e){return WebAssembly.Module.imports(e).some(t=>t.module===Ei)}function vc(e){if(!e||typeof e!=\"object\")throw new Error(\"A threaded guest that imports space_data_module_host requires an owning hostcall channel.\");let t=String(e.channelName??\"\").trim(),s=String(e.token??\"\").trim();if(!t||!s)throw new Error(\"The owning thread-hostcall channel name and token are required.\");if(typeof BroadcastChannel!=\"function\")throw new Error(\"BroadcastChannel is required for nested pthread hostcalls.\");let i=_o({maxResponseBytes:e.maxResponseBytes}),r=new BroadcastChannel(t),o=1;return{dispatch:Io({buffer:i,timeoutMs:e.timeoutMs,postRequest(E){r.postMessage({type:Uc,token:s,requestId:o++,buffer:i,...E})}}),close(){r.close()}}}function So({wasmModule:e,memory:t,hostcallChannel:s,processState:i,extraImports:r,workerIndex:o,tid:a,threadSpawn:E}={}){let l=po({processState:i});l.setMemory(t);let _=null,p=null,O={...l.imports,env:{memory:t},wasi:{\"thread-spawn\":typeof E==\"function\"?E:()=>-1}};if(Pc(e)){p=vc(s);let w=Gn({dispatch:p.dispatch,getMemory:()=>_?.exports?.memory??t});Object.assign(O,w.imports)}let A=co(r,{memory:t,getMemory:()=>_?.exports?.memory??t,workerIndex:o??null,tid:a??null});return uo(O,A.fragments),O.env.memory=t,{imports:O,instantiate(){return _=new WebAssembly.Instance(e,O),l.setMemory(_.exports.memory??t),_},close(){p?.close(),A.close()}}}async function Ao(e){let t=[];for(let s of e??[])if(s&&typeof s.moduleUrl==\"string\"){let r=(await import(s.moduleUrl))[s.exportName??\"default\"];if(typeof r!=\"function\")throw new TypeError(`extraImports module ${s.moduleUrl} exports no factory \"${s.exportName??\"default\"}\".`);t.push({factory:r,config:s.config??null})}else t.push(s);return t}var Hc=Object.freeze({PENDING:0,IDLE:1,CLAIMED:2,ASSIGNED:3,RUNNING:4,RETIRED:5}),{PENDING:T_,IDLE:Wt,CLAIMED:bo,ASSIGNED:$t,RUNNING:be,RETIRED:bi}=Hc,Re=0,Bc=1,Mc=2,Fc=3,Vc=4,Ae=5,xc=6,Gc=8,Yc=8,z=0,Ri=1,To=2,Ro=3,kc=4,wo=1,qc=536870911,Kc=2;var et=e=>Gc+Yc*e;function Ai(){return typeof performance<\"u\"&&typeof performance.now==\"function\"?performance.now():Date.now()}function we(e){Atomics.add(e,Re,1),Atomics.notify(e,Re)}function jc(e,t,s){Atomics.store(e,et(t)+z,s),Atomics.notify(e,et(t)+z),we(e)}function Oo(e,t){jc(e.control,t,bi)}function Wc(e,t,s){let{control:i}=e,r=et(t);for(;;){let o=Atomics.load(i,r+z);if(o!==$t&&o!==be||Atomics.load(i,r+Ri)!==s)return!1;if(Atomics.compareExchange(i,r+z,o,Wt)===o)return we(i),!0}}function $c(e,t){let{control:s}=e,i=et(t);return Atomics.compareExchange(s,i+z,$t,be)!==$t?null:{tid:Atomics.load(s,i+Ri),startArg:Atomics.load(s,i+To)}}function Zc(e,t){let{control:s}=e;Atomics.compareExchange(s,et(t)+z,be,Wt)===be&&we(s)}function mo(e,t,{runThread:s,osThreadId:i=0}){let{control:r}=e,o=et(t)+z;for(i&&Atomics.store(r,et(t)+kc,i);;){let a=Atomics.load(r,o);if(a===bi)return;if(a!==$t){Atomics.wait(r,o,a);continue}let E=$c(e,t);if(E){if(s(E.tid,E.startArg)===!1){Oo(e,t);return}Zc(e,t)}}}function go(e,{owner:t=!1,grow:s=null,dispatchMessage:i=null}={}){let{control:r,spawnWaitMs:o}=e,a=Atomics.load(r,xc),E=null,l=!0,_=R=>t||(Atomics.load(r,et(R)+Ro)&wo)===0,p=()=>{let R=Math.min(Atomics.load(r,Ae),a),d=0;for(let S=0;S<R;S+=1)if(_(S)){if(Atomics.compareExchange(r,et(S)+z,Wt,bo)===Wt)return{slot:S,live:d+1};Atomics.load(r,et(S)+z)!==bi&&(d+=1)}return{slot:-1,live:d}},O=()=>{for(;;){let R=Atomics.load(r,Ae);if(R>=a)return-1;if(Atomics.compareExchange(r,Ae,R,R+1)===R)return Atomics.store(r,et(R)+z,bo),R}},A=()=>{let R=O();if(R<0)return{slot:-1,reason:null};try{return s(R),{slot:R,reason:null}}catch{return Oo(e,R),{slot:-1,reason:\"worker-create-failed\"}}},w=()=>{let R=p();if(R.slot>=0)return{slot:R.slot,waited:!1,reason:null};let d=typeof s==\"function\",S=Ai(),b=S+(l?o:0),g=S+(l?Math.min(Kc,o):0),m=!1;for(;;){let H=Atomics.load(r,Re);if(R=p(),R.slot>=0)return{slot:R.slot,waited:m,reason:null};let K=d&&Math.min(Atomics.load(r,Ae),a)<a;if(K&&(R.live===0||Ai()>=g)){let _t=A();if(_t.slot>=0||_t.reason)return{..._t,waited:m};continue}if(R.live===0)return{slot:-1,waited:m,reason:\"pool-exhausted\"};if(H===E&&!K)return{slot:-1,waited:m,reason:\"pool-exhausted\"};let M=(K?g:b)-Ai();if(!K&&M<=0)return E=H,{slot:-1,waited:m,reason:\"pool-exhausted\"};if(M>0){try{Atomics.wait(r,Re,H,M)}catch{if(l=!1,!K)return{slot:-1,waited:m,reason:\"pool-exhausted\"};g=0;continue}m=!0}}};return R=>{let d=w();if(d.slot<0)return d.reason===\"pool-exhausted\"&&Atomics.add(r,Vc,1),{tid:-1,slot:-1,reason:d.reason};let{slot:S}=d,b=et(S),g=Atomics.add(r,Bc,1);if(g>qc)return Atomics.store(r,b+z,Wt),we(r),{tid:-1,slot:-1,reason:\"tid-exhausted\"};if(Atomics.store(r,b+Ri,g),Atomics.store(r,b+To,R|0),Atomics.store(r,b+z,$t),(Atomics.load(r,b+Ro)&wo)!==0)try{i(S,g,R)}catch{return Wc(e,S,g),{tid:-1,slot:-1,reason:\"dispatch-failed\"}}else Atomics.notify(r,b+z);return Atomics.add(r,Mc,1),d.waited&&Atomics.add(r,Fc,1),{tid:g,slot:S,reason:null}}}var Zt=null;function yo(e,t){try{return Zt.instantiate().exports.wasi_thread_start(e,t),!0}catch(s){return s&&s.name===\"WasiExitError\"?!0:(console.error(`[wasi-thread] guest thread ${e} trapped:`,s),self.postMessage({t:\"error\",tid:e,error:String(s?.message??s)}),!1)}}self.onmessage=async e=>{let t=e.data??{};if(t.t===\"probe\"){let s=t.pool??null;try{let i=await Ao(t.extraImports??[]),r=s?go(s):null;Zt=So({wasmModule:t.wasmModule,memory:t.memory,hostcallChannel:t.hostcallChannel??null,processState:t.processState,extraImports:i,workerIndex:t.workerIndex,threadSpawn:r?o=>r(o).tid:void 0}),Zt.instantiate(),self.postMessage({t:\"ready\",ok:!0,protocol:2})}catch(i){Zt?.close(),Zt=null,self.postMessage({t:\"ready\",ok:!1,error:String(i?.message??i)});return}s&&mo(s,t.slot,{runThread:yo});return}t.t===\"run\"&&(yo(t.tid,t.startArg),self.postMessage({t:\"exit\",tid:t.tid}))};})();\n";
7
- export const WASI_THREAD_POOL_WORKER_BUNDLE_SHA256 = "5384b18df8f6fb338126bd1caee7a1f1e8c9587a8ecbafc71958f16d0d22aa92";
5
+ /** src/host/wasiThreadBrowserWorker.mjs, sha256 095e4eea6018d3df2dd5b7dc2e9ad541885e2bce2391f635d462c5efb339629e. */
6
+ export const WASI_THREAD_POOL_WORKER_BUNDLE = "(()=>{var Jo=Object.defineProperty;var ta=(e,t)=>{for(var s in t)Jo(e,s,{get:t[s],enumerable:!0})};var ea=new TextDecoder,sa=new TextEncoder,Fe=\"$bin\";function ia(e){return e instanceof Uint8Array||e instanceof ArrayBuffer||ArrayBuffer.isView(e)}function ra(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function le(e,t){if(e==null)return e??null;if(ia(e)){let s=t.length;return t.push(ra(e)),{[Fe]:s}}return e instanceof Date?e.toISOString():typeof e==\"bigint\"?e.toString():Array.isArray(e)?e.map(s=>le(s,t)):typeof e==\"object\"?Object.fromEntries(Object.entries(e).filter(([,s])=>s!==void 0).map(([s,i])=>[s,le(i,t)])):e}function vt(e,t){if(e==null)return e;if(Array.isArray(e))return e.map(s=>vt(s,t));if(typeof e==\"object\"){let s=Object.keys(e);if(s.length===1&&s[0]===Fe){let i=e[Fe];if(!Number.isInteger(i)||i<0||i>=t.length)throw new RangeError(`Hostcall envelope references missing binary segment ${i}.`);return t[i]}return Object.fromEntries(s.map(i=>[i,vt(e[i],t)]))}return e}function Ve(e,t=[]){let s=sa.encode(JSON.stringify(e??null)),i=4+s.length+4;for(let E of t)i+=4+E.length;let r=new Uint8Array(i),o=new DataView(r.buffer),a=0;o.setUint32(a,s.length,!0),a+=4,r.set(s,a),a+=s.length,o.setUint32(a,t.length,!0),a+=4;for(let E of t)o.setUint32(a,E.length,!0),a+=4,r.set(E,a),a+=E.length;return r}function _e(e){if(!(e instanceof Uint8Array))throw new TypeError(\"Hostcall envelope must be a Uint8Array.\");if(e.length<8)throw new RangeError(\"Hostcall envelope is truncated.\");let t=new DataView(e.buffer,e.byteOffset,e.byteLength),s=0,i=t.getUint32(s,!0);if(s+=4,s+i+4>e.length)throw new RangeError(\"Hostcall envelope meta exceeds envelope bounds.\");let r=JSON.parse(ea.decode(e.subarray(s,s+i)));s+=i;let o=t.getUint32(s,!0);s+=4;let a=[];for(let E=0;E<o;E+=1){if(s+4>e.length)throw new RangeError(\"Hostcall envelope segment table is truncated.\");let l=t.getUint32(s,!0);if(s+=4,s+l>e.length)throw new RangeError(\"Hostcall envelope segment exceeds envelope bounds.\");a.push(e.subarray(s,s+l)),s+=l}return{meta:r,segments:a}}function Yi(e){let{meta:t,segments:s}=_e(e);return vt(t,s)}var ct=new Int32Array(2),de=new Float32Array(ct.buffer),Ie=new Float64Array(ct.buffer),Ht=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Kt;(function(e){e[e.UTF8_BYTES=1]=\"UTF8_BYTES\",e[e.UTF16_STRING=2]=\"UTF16_STRING\"})(Kt||(Kt={}));var gt=class e{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new e(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return ct[0]=this.readInt32(t),de[0]}readFloat64(t){return ct[Ht?0:1]=this.readInt32(t),ct[Ht?1:0]=this.readInt32(t+4),Ie[0]}writeInt8(t,s){this.bytes_[t]=s}writeUint8(t,s){this.bytes_[t]=s}writeInt16(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8}writeUint16(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8}writeInt32(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8,this.bytes_[t+2]=s>>16,this.bytes_[t+3]=s>>24}writeUint32(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8,this.bytes_[t+2]=s>>16,this.bytes_[t+3]=s>>24}writeInt64(t,s){this.writeInt32(t,Number(BigInt.asIntN(32,s))),this.writeInt32(t+4,Number(BigInt.asIntN(32,s>>BigInt(32))))}writeUint64(t,s){this.writeUint32(t,Number(BigInt.asUintN(32,s))),this.writeUint32(t+4,Number(BigInt.asUintN(32,s>>BigInt(32))))}writeFloat32(t,s){de[0]=s,this.writeInt32(t,ct[0])}writeFloat64(t,s){Ie[0]=s,this.writeInt32(t,ct[Ht?0:1]),this.writeInt32(t+4,ct[Ht?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error(\"FlatBuffers: ByteBuffer is too short to contain an identifier.\");let t=\"\";for(let s=0;s<4;s++)t+=String.fromCharCode(this.readInt8(this.position_+4+s));return t}__offset(t,s){let i=t-this.readInt32(t);return s<this.readInt16(i)?this.readInt16(i+s):0}__union(t,s){return t.bb_pos=s+this.readInt32(s),t.bb=this,t}__string(t,s){t+=this.readInt32(t);let i=this.readInt32(t);t+=4;let r=this.bytes_.subarray(t,t+i);return s===Kt.UTF8_BYTES?r:this.text_decoder_.decode(r)}__union_with_string(t,s){return typeof t==\"string\"?this.__string(s):this.__union(t,s)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+4}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=4)throw new Error(\"FlatBuffers: file identifier must be length \"+4);for(let s=0;s<4;s++)if(t.charCodeAt(s)!=this.readInt8(this.position()+4+s))return!1;return!0}createScalarList(t,s){let i=[];for(let r=0;r<s;++r){let o=t(r);o!==null&&i.push(o)}return i}createObjList(t,s){let i=[];for(let r=0;r<s;++r){let o=t(r);o!==null&&i.push(o.unpack())}return i}};var Wt=class e{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let s;t?s=t:s=1024,this.bb=gt.allocate(s),this.space=s}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,s){t>this.minalign&&(this.minalign=t);let i=~(this.bb.capacity()-this.space+s)+1&t-1;for(;this.space<i+t+s;){let r=this.bb.capacity();this.bb=e.growByteBuffer(this.bb),this.space+=this.bb.capacity()-r}this.pad(i)}pad(t){for(let s=0;s<t;s++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,s,i){(this.force_defaults||s!=i)&&(this.addInt8(s),this.slot(t))}addFieldInt16(t,s,i){(this.force_defaults||s!=i)&&(this.addInt16(s),this.slot(t))}addFieldInt32(t,s,i){(this.force_defaults||s!=i)&&(this.addInt32(s),this.slot(t))}addFieldInt64(t,s,i){(this.force_defaults||s!==i)&&(this.addInt64(s),this.slot(t))}addFieldFloat32(t,s,i){(this.force_defaults||s!=i)&&(this.addFloat32(s),this.slot(t))}addFieldFloat64(t,s,i){(this.force_defaults||s!=i)&&(this.addFloat64(s),this.slot(t))}addFieldOffset(t,s,i){(this.force_defaults||s!=i)&&(this.addOffset(s),this.slot(t))}addFieldStruct(t,s,i){s!=i&&(this.nested(s),this.slot(t))}nested(t){if(t!=this.offset())throw new TypeError(\"FlatBuffers: struct must be serialized inline.\")}notNested(){if(this.isNested)throw new TypeError(\"FlatBuffers: object serialization must not be nested.\")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){let s=t.capacity();if(s&3221225472)throw new Error(\"FlatBuffers: cannot grow buffer beyond 2 gigabytes.\");let i=s<<1,r=gt.allocate(i);return r.setPosition(i-s),r.bytes().set(t.bytes(),i-s),r}addOffset(t){this.prep(4,0),this.writeInt32(this.offset()-t+4)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let s=0;s<t;s++)this.vtable[s]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error(\"FlatBuffers: endObject called without startObject\");this.addInt32(0);let t=this.offset(),s=this.vtable_in_use-1;for(;s>=0&&this.vtable[s]==0;s--);let i=s+1;for(;s>=0;s--)this.addInt16(this.vtable[s]!=0?t-this.vtable[s]:0);let r=2;this.addInt16(t-this.object_start);let o=(i+r)*2;this.addInt16(o);let a=0,E=this.space;t:for(s=0;s<this.vtables.length;s++){let l=this.bb.capacity()-this.vtables[s];if(o==this.bb.readInt16(l)){for(let _=2;_<o;_+=2)if(this.bb.readInt16(E+_)!=this.bb.readInt16(l+_))continue t;a=this.vtables[s];break}}return a?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,a-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,s,i){let r=i?4:0;if(s){let o=s;if(this.prep(this.minalign,8+r),o.length!=4)throw new TypeError(\"FlatBuffers: file identifier must be length \"+4);for(let a=3;a>=0;a--)this.writeInt8(o.charCodeAt(a))}this.prep(this.minalign,4+r),this.addOffset(t),r&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,s){this.finish(t,s,!0)}requiredField(t,s){let i=this.bb.capacity()-t,r=i-this.bb.readInt32(i);if(!(s<this.bb.readInt16(r)&&this.bb.readInt16(r+s)!=0))throw new TypeError(\"FlatBuffers: field \"+s+\" must be set\")}startVector(t,s,i){this.notNested(),this.vector_num_elems=s,this.prep(4,t*s),this.prep(i,t*s)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);let s=this.createString(t);return this.string_maps.set(t,s),s}createString(t){if(t==null)return 0;let s;return t instanceof Uint8Array?s=t:s=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,s.length,1),this.bb.setPosition(this.space-=s.length),this.bb.bytes().set(s,this.space),this.endVector()}createByteVector(t){return t==null?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())}createObjectOffset(t){return t===null?0:typeof t==\"string\"?this.createString(t):t.pack(this)}createObjectOffsetList(t){let s=[];for(let i=0;i<t.length;++i){let r=t[i];if(r!==null)s.push(this.createObjectOffset(r));else throw new TypeError(\"FlatBuffers: Argument for createObjectOffsetList cannot contain null.\")}return s}createStructOffsetList(t,s){return s(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}};var na=Object.defineProperty,oa=(e,t,s)=>t in e?na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,xe=(e,t,s)=>oa(e,typeof t!=\"symbol\"?t+\"\":t,s),Bt=class e{constructor(){xe(this,\"bb\",null),xe(this,\"bb_pos\",0)}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsConfigTable(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsConfigTable(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}ENTRIES(t,s){let i=this.bb.__offset(this.bb_pos,4);return i?(s||new ut).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}entriesLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}static startConfigTable(t){t.startObject(1)}static addEntries(t,s){t.addFieldOffset(0,s,0)}static createEntriesVector(t,s){t.startVector(4,s.length,4);for(let i=s.length-1;i>=0;i--)t.addOffset(s[i]);return t.endVector()}static startEntriesVector(t,s){t.startVector(4,s,4)}static endConfigTable(t){return t.endObject()}static createConfigTable(t,s){return e.startConfigTable(t),e.addEntries(t,s),e.endConfigTable(t)}unpack(){return new Mt(this.bb.createObjList(this.ENTRIES.bind(this),this.entriesLength()))}unpackTo(t){t.ENTRIES=this.bb.createObjList(this.ENTRIES.bind(this),this.entriesLength())}},Mt=class{constructor(t=[]){xe(this,\"ENTRIES\",t)}pack(t){let s=Bt.createEntriesVector(t,t.createObjectOffsetList(this.ENTRIES));return Bt.createConfigTable(t,s)}};var W=(e=>(e[e.String=0]=\"String\",e[e.Number=1]=\"Number\",e[e.Bool=2]=\"Bool\",e[e.StringList=3]=\"StringList\",e[e.NumberList=4]=\"NumberList\",e[e.TableList=5]=\"TableList\",e))(W||{});var aa=Object.defineProperty,fa=(e,t,s)=>t in e?aa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Et=(e,t,s)=>fa(e,typeof t!=\"symbol\"?t+\"\":t,s),ut=class e{constructor(){Et(this,\"bb\",null),Et(this,\"bb_pos\",0)}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsConfigEntry(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsConfigEntry(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}KEY(t){let s=this.bb.__offset(this.bb_pos,4);return this.bb.__string(this.bb_pos+s,t)}KIND(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):W.String}STRING_VALUE(t){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.__string(this.bb_pos+s,t):null}NUMBER_VALUE(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat64(this.bb_pos+t):0}BOOL_VALUE(){let t=this.bb.__offset(this.bb_pos,12);return t?!!this.bb.readInt8(this.bb_pos+t):!1}STRINGS(t,s){let i=this.bb.__offset(this.bb_pos,14);return i?this.bb.__string(this.bb.__vector(this.bb_pos+i)+t*4,s):null}stringsLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}NUMBERS(t){let s=this.bb.__offset(this.bb_pos,16);return s?this.bb.readFloat64(this.bb.__vector(this.bb_pos+s)+t*8):0}numbersLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}numbersArray(){let t=this.bb.__offset(this.bb_pos,16);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}TABLES(t,s){let i=this.bb.__offset(this.bb_pos,18);return i?(s||new Bt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}tablesLength(){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}static startConfigEntry(t){t.startObject(8)}static addKey(t,s){t.addFieldOffset(0,s,0)}static addKind(t,s){t.addFieldInt8(1,s,W.String)}static addStringValue(t,s){t.addFieldOffset(2,s,0)}static addNumberValue(t,s){t.addFieldFloat64(3,s,0)}static addBoolValue(t,s){t.addFieldInt8(4,+s,0)}static addStrings(t,s){t.addFieldOffset(5,s,0)}static createStringsVector(t,s){t.startVector(4,s.length,4);for(let i=s.length-1;i>=0;i--)t.addOffset(s[i]);return t.endVector()}static startStringsVector(t,s){t.startVector(4,s,4)}static addNumbers(t,s){t.addFieldOffset(6,s,0)}static createNumbersVector(t,s){t.startVector(8,s.length,8);for(let i=s.length-1;i>=0;i--)t.addFloat64(s[i]);return t.endVector()}static startNumbersVector(t,s){t.startVector(8,s,8)}static addTables(t,s){t.addFieldOffset(7,s,0)}static createTablesVector(t,s){t.startVector(4,s.length,4);for(let i=s.length-1;i>=0;i--)t.addOffset(s[i]);return t.endVector()}static startTablesVector(t,s){t.startVector(4,s,4)}static endConfigEntry(t){let s=t.endObject();return t.requiredField(s,4),s}static createConfigEntry(t,s,i,r,o,a,E,l,_){return e.startConfigEntry(t),e.addKey(t,s),e.addKind(t,i),e.addStringValue(t,r),e.addNumberValue(t,o),e.addBoolValue(t,a),e.addStrings(t,E),e.addNumbers(t,l),e.addTables(t,_),e.endConfigEntry(t)}unpack(){return new $t(this.KEY(),this.KIND(),this.STRING_VALUE(),this.NUMBER_VALUE(),this.BOOL_VALUE(),this.bb.createScalarList(this.STRINGS.bind(this),this.stringsLength()),this.bb.createScalarList(this.NUMBERS.bind(this),this.numbersLength()),this.bb.createObjList(this.TABLES.bind(this),this.tablesLength()))}unpackTo(t){t.KEY=this.KEY(),t.KIND=this.KIND(),t.STRING_VALUE=this.STRING_VALUE(),t.NUMBER_VALUE=this.NUMBER_VALUE(),t.BOOL_VALUE=this.BOOL_VALUE(),t.STRINGS=this.bb.createScalarList(this.STRINGS.bind(this),this.stringsLength()),t.NUMBERS=this.bb.createScalarList(this.NUMBERS.bind(this),this.numbersLength()),t.TABLES=this.bb.createObjList(this.TABLES.bind(this),this.tablesLength())}},$t=class{constructor(t=null,s=W.String,i=null,r=0,o=!1,a=[],E=[],l=[]){Et(this,\"KEY\",t),Et(this,\"KIND\",s),Et(this,\"STRING_VALUE\",i),Et(this,\"NUMBER_VALUE\",r),Et(this,\"BOOL_VALUE\",o),Et(this,\"STRINGS\",a),Et(this,\"NUMBERS\",E),Et(this,\"TABLES\",l)}pack(t){let s=this.KEY!==null?t.createString(this.KEY):0,i=this.STRING_VALUE!==null?t.createString(this.STRING_VALUE):0,r=ut.createStringsVector(t,t.createObjectOffsetList(this.STRINGS)),o=ut.createNumbersVector(t,this.NUMBERS),a=ut.createTablesVector(t,t.createObjectOffsetList(this.TABLES));return ut.createConfigEntry(t,s,this.KIND,i,this.NUMBER_VALUE,this.BOOL_VALUE,r,o,a)}};var Rt=(e=>(e[e.Unchanged=0]=\"Unchanged\",e[e.Skipped=1]=\"Skipped\",e[e.Missing=2]=\"Missing\",e[e.Expired=3]=\"Expired\",e[e.Info=4]=\"Info\",e))(Rt||{});var Ft=(e=>(e[e.Duplicates=0]=\"Duplicates\",e[e.None=1]=\"None\",e[e.Current=2]=\"Current\",e))(Ft||{});var ha=Object.defineProperty,ca=(e,t,s)=>t in e?ha(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ge=(e,t,s)=>ca(e,typeof t!=\"symbol\"?t+\"\":t,s),Vt=class e{constructor(){Ge(this,\"bb\",null),Ge(this,\"bb_pos\",0)}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsModuleConfig(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsModuleConfig(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static bufferHasIdentifier(t){return t.__has_identifier(\"MCFG\")}ENTRIES(t,s){let i=this.bb.__offset(this.bb_pos,4);return i?(s||new ut).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}entriesLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}static startModuleConfig(t){t.startObject(1)}static addEntries(t,s){t.addFieldOffset(0,s,0)}static createEntriesVector(t,s){t.startVector(4,s.length,4);for(let i=s.length-1;i>=0;i--)t.addOffset(s[i]);return t.endVector()}static startEntriesVector(t,s){t.startVector(4,s,4)}static endModuleConfig(t){return t.endObject()}static finishModuleConfigBuffer(t,s){t.finish(s,\"MCFG\")}static finishSizePrefixedModuleConfigBuffer(t,s){t.finish(s,\"MCFG\",!0)}static createModuleConfig(t,s){return e.startModuleConfig(t),e.addEntries(t,s),e.endModuleConfig(t)}unpack(){return new Zt(this.bb.createObjList(this.ENTRIES.bind(this),this.entriesLength()))}unpackTo(t){t.ENTRIES=this.bb.createObjList(this.ENTRIES.bind(this),this.entriesLength())}},Zt=class{constructor(t=[]){Ge(this,\"ENTRIES\",t)}pack(t){let s=Vt.createEntriesVector(t,t.createObjectOffsetList(this.ENTRIES));return Vt.createModuleConfig(t,s)}};var xt={};ta(xt,{BodyRef:()=>Se,BoolValue:()=>la,CacheKeyParams:()=>Ga,ContextParams:()=>gf,CountValue:()=>Ia,CronField:()=>lf,CryptoParams:()=>Ya,EnvVar:()=>Of,EpochStreamParams:()=>Ha,ExecParams:()=>Tf,ExecResult:()=>mf,FsEntry:()=>Rf,FsParams:()=>bf,FsStat:()=>wf,HasCapabilityParams:()=>Sa,HttpParams:()=>ba,HttpResult:()=>Ra,IpfsLink:()=>$a,IpfsParams:()=>Ka,IpfsPin:()=>Za,IpfsResult:()=>Wa,IpfsSwarmPeer:()=>Qa,KeyslotParams:()=>ka,MqttParams:()=>If,MqttResult:()=>pf,NodeActivityEvent:()=>cf,NodeActivityParams:()=>hf,NodeBandwidthSample:()=>ff,NodeStatusReport:()=>af,NumberValue:()=>_a,P2pLatestDataset:()=>of,P2pParams:()=>tf,P2pPeer:()=>sf,P2pPeerValue:()=>rf,P2pPnmEntry:()=>nf,P2pSummary:()=>ef,ProtocolParams:()=>Ja,Provenance:()=>La,ProvenanceAttribute:()=>Ca,PubsubParams:()=>za,PubsubSubscribed:()=>Xa,QuerySurfaceLimits:()=>xa,RandomBytesParams:()=>Aa,SandboxQueryParams:()=>Ba,SandboxQueryResult:()=>Ma,ScheduleParams:()=>Ef,SecretParams:()=>qa,SecretResult:()=>ja,SocketParams:()=>Sf,SocketResult:()=>Af,SqlStreamParams:()=>Pa,StorageDeleteParams:()=>ga,StorageExpireParams:()=>ya,StorageExpireResult:()=>Na,StorageIngestParams:()=>Da,StorageIngestResult:()=>Ua,StorageQueryParams:()=>wa,StorageWriteParams:()=>Oa,StorageWriteResult:()=>ma,StoredRecordMeta:()=>Ta,StreamResult:()=>va,SurfaceColumn:()=>Va,SurfaceTable:()=>Fa,TextValue:()=>pa,TimeValue:()=>da,TimersDelayParams:()=>uf,WebsocketParams:()=>_f,WebsocketResult:()=>df});var ua=Object.defineProperty,Ea=(e,t,s)=>t in e?ua(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,n=(e,t,s)=>Ea(e,typeof t!=\"symbol\"?t+\"\":t,s);function f(e,t,s){let i=Math.floor(s/8),r=1<<s%8;return(e.getUint8(t+i)&r)!==0}function h(e,t,s,i){let r=Math.floor(s/8),o=1<<s%8,a=e.getUint8(t+r);e.setUint8(t+r,i?a|o:a&~o)}function c(e,t,s){let i=Math.min(e.getUint8(t),s),r=new Uint8Array(e.buffer,e.byteOffset+t+1,i);return new TextDecoder().decode(r)}function u(e,t,s,i){let o=new TextEncoder().encode(i),a=Math.min(o.length,s);e.setUint8(t,a);let E=new Uint8Array(e.buffer,e.byteOffset+t+1,s);E.fill(0),E.set(o.subarray(0,a))}var Ye=class qi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new qi(t,s)}vALUE(){return this.view.getUint8(this.offset+0)!==0}setVALUE(t){this.view.setUint8(this.offset+0,t?1:0)}};n(Ye,\"SIZE\",1);n(Ye,\"ALIGN\",1);var la=Ye,ke=class ji{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new ji(t,s)}vALUE(){return this.view.getFloat64(this.offset+0,!0)}setVALUE(t){this.view.setFloat64(this.offset+0,t,!0)}};n(ke,\"SIZE\",8);n(ke,\"ALIGN\",8);var _a=ke,qe=class Ki{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Ki(t,s)}uNIX_MS(){return this.view.getBigUint64(this.offset+0,!0)}setUNIX_MS(t){this.view.setBigUint64(this.offset+0,t,!0)}};n(qe,\"SIZE\",8);n(qe,\"ALIGN\",8);var da=qe,je=class Wi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Wi(t,s)}vALUE(){return this.view.getBigUint64(this.offset+0,!0)}setVALUE(t){this.view.setBigUint64(this.offset+0,t,!0)}};n(je,\"SIZE\",8);n(je,\"ALIGN\",8);var Ia=je,Ke=class $i{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new $i(t,s)}hasVALUE(){return f(this.view,this.offset,0)}setHasVALUE(t){h(this.view,this.offset,0,t)}vALUE(){return c(this.view,this.offset+1,255)}setVALUE(t){u(this.view,this.offset+1,255,t),this.setHasVALUE(!0)}};n(Ke,\"SIZE\",257);n(Ke,\"ALIGN\",1);var pa=Ke,We=class Zi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Zi(t,s)}tOKEN(){return this.view.getBigUint64(this.offset+8,!0)}setTOKEN(t){this.view.setBigUint64(this.offset+8,t,!0)}sIZE(){return this.view.getBigUint64(this.offset+16,!0)}setSIZE(t){this.view.setBigUint64(this.offset+16,t,!0)}fRAMES(){return this.view.getBigInt64(this.offset+24,!0)}setFRAMES(t){this.view.setBigInt64(this.offset+24,t,!0)}hasFNV1A64(){return f(this.view,this.offset,0)}setHasFNV1A64(t){h(this.view,this.offset,0,t)}fNV1A64(){return c(this.view,this.offset+32,16)}setFNV1A64(t){u(this.view,this.offset+32,16,t),this.setHasFNV1A64(!0)}};n(We,\"SIZE\",56);n(We,\"ALIGN\",8);var Se=We,$e=class Qi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Qi(t,s)}hasCAPABILITY(){return f(this.view,this.offset,0)}setHasCAPABILITY(t){h(this.view,this.offset,0,t)}cAPABILITY(){return c(this.view,this.offset+1,64)}setCAPABILITY(t){u(this.view,this.offset+1,64,t),this.setHasCAPABILITY(!0)}};n($e,\"SIZE\",66);n($e,\"ALIGN\",1);var Sa=$e,Ze=class zi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new zi(t,s)}lENGTH(){return this.view.getUint32(this.offset+0,!0)}setLENGTH(t){this.view.setUint32(this.offset+0,t,!0)}};n(Ze,\"SIZE\",4);n(Ze,\"ALIGN\",4);var Aa=Ze,Qe=class Xi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Xi(t,s)}hasMETHOD(){return f(this.view,this.offset,0)}setHasMETHOD(t){h(this.view,this.offset,0,t)}mETHOD(){return c(this.view,this.offset+1,16)}setMETHOD(t){u(this.view,this.offset+1,16,t),this.setHasMETHOD(!0)}tIMEOUT_MS(){return this.view.getUint32(this.offset+20,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+20,t,!0)}mAX_BYTES(){return this.view.getBigUint64(this.offset+24,!0)}setMAX_BYTES(t){this.view.setBigUint64(this.offset+24,t,!0)}nO_REDIRECTS(){return this.view.getUint8(this.offset+32)!==0}setNO_REDIRECTS(t){this.view.setUint8(this.offset+32,t?1:0)}};n(Qe,\"SIZE\",40);n(Qe,\"ALIGN\",8);var ba=Qe,ze=class Ji{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Ji(t,s)}sTATUS(){return this.view.getInt32(this.offset+0,!0)}setSTATUS(t){this.view.setInt32(this.offset+0,t,!0)}rETRIEVED_MS(){return this.view.getBigUint64(this.offset+8,!0)}setRETRIEVED_MS(t){this.view.setBigUint64(this.offset+8,t,!0)}};n(ze,\"SIZE\",16);n(ze,\"ALIGN\",8);var Ra=ze,Xe=class tr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new tr(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return c(this.view,this.offset+1,64)}setSCHEMA(t){u(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}hasDAY(){return f(this.view,this.offset,1)}setHasDAY(t){h(this.view,this.offset,1,t)}dAY(){return c(this.view,this.offset+66,16)}setDAY(t){u(this.view,this.offset+66,16,t),this.setHasDAY(!0)}hasENTITY_ID(){return f(this.view,this.offset,2)}setHasENTITY_ID(t){h(this.view,this.offset,2,t)}eNTITY_ID(){return c(this.view,this.offset+83,255)}setENTITY_ID(t){u(this.view,this.offset+83,255,t),this.setHasENTITY_ID(!0)}nORAD_CAT_ID(){return this.view.getUint32(this.offset+340,!0)}setNORAD_CAT_ID(t){this.view.setUint32(this.offset+340,t,!0)}lIMIT(){return this.view.getUint32(this.offset+344,!0)}setLIMIT(t){this.view.setUint32(this.offset+344,t,!0)}};n(Xe,\"SIZE\",348);n(Xe,\"ALIGN\",4);var wa=Xe,Je=class er{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new er(t,s)}hasCID(){return f(this.view,this.offset,0)}setHasCID(t){h(this.view,this.offset,0,t)}cID(){return c(this.view,this.offset+1,128)}setCID(t){u(this.view,this.offset+1,128,t),this.setHasCID(!0)}rOW_ID(){return this.view.getBigInt64(this.offset+136,!0)}setROW_ID(t){this.view.setBigInt64(this.offset+136,t,!0)}hasPEER_ID(){return f(this.view,this.offset,1)}setHasPEER_ID(t){h(this.view,this.offset,1,t)}pEER_ID(){return c(this.view,this.offset+144,128)}setPEER_ID(t){u(this.view,this.offset+144,128,t),this.setHasPEER_ID(!0)}tIMESTAMP_MS(){return this.view.getBigInt64(this.offset+280,!0)}setTIMESTAMP_MS(t){this.view.setBigInt64(this.offset+280,t,!0)}mATERIALIZED_MS(){return this.view.getBigInt64(this.offset+288,!0)}setMATERIALIZED_MS(t){this.view.setBigInt64(this.offset+288,t,!0)}lENGTH(){return this.view.getUint32(this.offset+296,!0)}setLENGTH(t){this.view.setUint32(this.offset+296,t,!0)}hasPROVIDER_ID(){return f(this.view,this.offset,2)}setHasPROVIDER_ID(t){h(this.view,this.offset,2,t)}pROVIDER_ID(){return c(this.view,this.offset+300,128)}setPROVIDER_ID(t){u(this.view,this.offset+300,128,t),this.setHasPROVIDER_ID(!0)}hasSOURCE_NAME(){return f(this.view,this.offset,3)}setHasSOURCE_NAME(t){h(this.view,this.offset,3,t)}sOURCE_NAME(){return c(this.view,this.offset+429,128)}setSOURCE_NAME(t){u(this.view,this.offset+429,128,t),this.setHasSOURCE_NAME(!0)}hasBATCH_ID(){return f(this.view,this.offset,4)}setHasBATCH_ID(t){h(this.view,this.offset,4,t)}bATCH_ID(){return c(this.view,this.offset+558,128)}setBATCH_ID(t){u(this.view,this.offset+558,128,t),this.setHasBATCH_ID(!0)}hasPRODUCER_PEER_ID(){return f(this.view,this.offset,5)}setHasPRODUCER_PEER_ID(t){h(this.view,this.offset,5,t)}pRODUCER_PEER_ID(){return c(this.view,this.offset+687,128)}setPRODUCER_PEER_ID(t){u(this.view,this.offset+687,128,t),this.setHasPRODUCER_PEER_ID(!0)}hasLICENSE(){return f(this.view,this.offset,6)}setHasLICENSE(t){h(this.view,this.offset,6,t)}lICENSE(){return c(this.view,this.offset+816,128)}setLICENSE(t){u(this.view,this.offset+816,128,t),this.setHasLICENSE(!0)}};n(Je,\"SIZE\",952);n(Je,\"ALIGN\",8);var Ta=Je,ts=class sr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new sr(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return c(this.view,this.offset+1,64)}setSCHEMA(t){u(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}};n(ts,\"SIZE\",66);n(ts,\"ALIGN\",1);var Oa=ts,es=class ir{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new ir(t,s)}hasCID(){return f(this.view,this.offset,0)}setHasCID(t){h(this.view,this.offset,0,t)}cID(){return c(this.view,this.offset+1,128)}setCID(t){u(this.view,this.offset+1,128,t),this.setHasCID(!0)}};n(es,\"SIZE\",130);n(es,\"ALIGN\",1);var ma=es,ss=class rr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new rr(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return c(this.view,this.offset+1,64)}setSCHEMA(t){u(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}hasCID(){return f(this.view,this.offset,1)}setHasCID(t){h(this.view,this.offset,1,t)}cID(){return c(this.view,this.offset+66,128)}setCID(t){u(this.view,this.offset+66,128,t),this.setHasCID(!0)}};n(ss,\"SIZE\",195);n(ss,\"ALIGN\",1);var ga=ss,is=class nr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new nr(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return c(this.view,this.offset+1,64)}setSCHEMA(t){u(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}hasPROVIDER_ID(){return f(this.view,this.offset,1)}setHasPROVIDER_ID(t){h(this.view,this.offset,1,t)}pROVIDER_ID(){return c(this.view,this.offset+66,128)}setPROVIDER_ID(t){u(this.view,this.offset+66,128,t),this.setHasPROVIDER_ID(!0)}hasSOURCE_NAME(){return f(this.view,this.offset,2)}setHasSOURCE_NAME(t){h(this.view,this.offset,2,t)}sOURCE_NAME(){return c(this.view,this.offset+195,128)}setSOURCE_NAME(t){u(this.view,this.offset+195,128,t),this.setHasSOURCE_NAME(!0)}bEFORE_MS(){return this.view.getBigUint64(this.offset+328,!0)}setBEFORE_MS(t){this.view.setBigUint64(this.offset+328,t,!0)}bATCH(){return this.view.getUint32(this.offset+336,!0)}setBATCH(t){this.view.setUint32(this.offset+336,t,!0)}mAX_DELETES(){return this.view.getUint32(this.offset+340,!0)}setMAX_DELETES(t){this.view.setUint32(this.offset+340,t,!0)}};n(is,\"SIZE\",344);n(is,\"ALIGN\",8);var ya=is,rs=class or{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new or(t,s)}dELETED(){return this.view.getBigUint64(this.offset+0,!0)}setDELETED(t){this.view.setBigUint64(this.offset+0,t,!0)}mISSING(){return this.view.getBigUint64(this.offset+8,!0)}setMISSING(t){this.view.setBigUint64(this.offset+8,t,!0)}cAPPED(){return this.view.getUint8(this.offset+16)!==0}setCAPPED(t){this.view.setUint8(this.offset+16,t?1:0)}};n(rs,\"SIZE\",24);n(rs,\"ALIGN\",8);var Na=rs,ns=class ar{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new ar(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return c(this.view,this.offset+2,64)}setSCHEMA(t){u(this.view,this.offset+2,64,t),this.setHasSCHEMA(!0)}hasPROVIDER_ID(){return f(this.view,this.offset,1)}setHasPROVIDER_ID(t){h(this.view,this.offset,1,t)}pROVIDER_ID(){return c(this.view,this.offset+67,128)}setPROVIDER_ID(t){u(this.view,this.offset+67,128,t),this.setHasPROVIDER_ID(!0)}hasSOURCE_NAME(){return f(this.view,this.offset,2)}setHasSOURCE_NAME(t){h(this.view,this.offset,2,t)}sOURCE_NAME(){return c(this.view,this.offset+196,128)}setSOURCE_NAME(t){u(this.view,this.offset+196,128,t),this.setHasSOURCE_NAME(!0)}hasBATCH_ID(){return f(this.view,this.offset,3)}setHasBATCH_ID(t){h(this.view,this.offset,3,t)}bATCH_ID(){return c(this.view,this.offset+325,128)}setBATCH_ID(t){u(this.view,this.offset+325,128,t),this.setHasBATCH_ID(!0)}hasSOURCE_URL(){return f(this.view,this.offset,4)}setHasSOURCE_URL(t){h(this.view,this.offset,4,t)}sOURCE_URL(){return c(this.view,this.offset+454,255)}setSOURCE_URL(t){u(this.view,this.offset+454,255,t),this.setHasSOURCE_URL(!0)}hasCONTENT_KEY_ID(){return f(this.view,this.offset,5)}setHasCONTENT_KEY_ID(t){h(this.view,this.offset,5,t)}cONTENT_KEY_ID(){return c(this.view,this.offset+710,128)}setCONTENT_KEY_ID(t){u(this.view,this.offset+710,128,t),this.setHasCONTENT_KEY_ID(!0)}hasSOURCE_PEER(){return f(this.view,this.offset,6)}setHasSOURCE_PEER(t){h(this.view,this.offset,6,t)}sOURCE_PEER(){return c(this.view,this.offset+839,128)}setSOURCE_PEER(t){u(this.view,this.offset+839,128,t),this.setHasSOURCE_PEER(!0)}hasLICENSE(){return f(this.view,this.offset,7)}setHasLICENSE(t){h(this.view,this.offset,7,t)}lICENSE(){return c(this.view,this.offset+968,128)}setLICENSE(t){u(this.view,this.offset+968,128,t),this.setHasLICENSE(!0)}hasLICENSE_URL(){return f(this.view,this.offset,8)}setHasLICENSE_URL(t){h(this.view,this.offset,8,t)}lICENSE_URL(){return c(this.view,this.offset+1097,255)}setLICENSE_URL(t){u(this.view,this.offset+1097,255,t),this.setHasLICENSE_URL(!0)}hasCITATION(){return f(this.view,this.offset,9)}setHasCITATION(t){h(this.view,this.offset,9,t)}cITATION(){return c(this.view,this.offset+1353,255)}setCITATION(t){u(this.view,this.offset+1353,255,t),this.setHasCITATION(!0)}sHARE_ALIKE(){return this.view.getUint8(this.offset+1609)!==0}setSHARE_ALIKE(t){this.view.setUint8(this.offset+1609,t?1:0)}rECONCILE(){return this.view.getUint8(this.offset+1610)}setRECONCILE(t){this.view.setUint8(this.offset+1610,t)}hasARCHIVE_SOURCE(){return f(this.view,this.offset,10)}setHasARCHIVE_SOURCE(t){h(this.view,this.offset,10,t)}aRCHIVE_SOURCE(){return c(this.view,this.offset+1611,128)}setARCHIVE_SOURCE(t){u(this.view,this.offset+1611,128,t),this.setHasARCHIVE_SOURCE(!0)}hasARCHIVE_NAME(){return f(this.view,this.offset,11)}setHasARCHIVE_NAME(t){h(this.view,this.offset,11,t)}aRCHIVE_NAME(){return c(this.view,this.offset+1740,255)}setARCHIVE_NAME(t){u(this.view,this.offset+1740,255,t),this.setHasARCHIVE_NAME(!0)}};n(ns,\"SIZE\",1996);n(ns,\"ALIGN\",1);var Da=ns,os=class fr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new fr(t,s)}hasSOURCE_URL(){return f(this.view,this.offset,0)}setHasSOURCE_URL(t){h(this.view,this.offset,0,t)}sOURCE_URL(){return c(this.view,this.offset+1,255)}setSOURCE_URL(t){u(this.view,this.offset+1,255,t),this.setHasSOURCE_URL(!0)}hTTP_STATUS(){return this.view.getInt32(this.offset+260,!0)}setHTTP_STATUS(t){this.view.setInt32(this.offset+260,t,!0)}hasETAG(){return f(this.view,this.offset,1)}setHasETAG(t){h(this.view,this.offset,1,t)}eTAG(){return c(this.view,this.offset+264,255)}setETAG(t){u(this.view,this.offset+264,255,t),this.setHasETAG(!0)}hasLAST_MODIFIED(){return f(this.view,this.offset,2)}setHasLAST_MODIFIED(t){h(this.view,this.offset,2,t)}lAST_MODIFIED(){return c(this.view,this.offset+520,64)}setLAST_MODIFIED(t){u(this.view,this.offset+520,64,t),this.setHasLAST_MODIFIED(!0)}hasCONTENT_TYPE(){return f(this.view,this.offset,3)}setHasCONTENT_TYPE(t){h(this.view,this.offset,3,t)}cONTENT_TYPE(){return c(this.view,this.offset+585,128)}setCONTENT_TYPE(t){u(this.view,this.offset+585,128,t),this.setHasCONTENT_TYPE(!0)}rETRIEVED_MS(){return this.view.getBigUint64(this.offset+720,!0)}setRETRIEVED_MS(t){this.view.setBigUint64(this.offset+720,t,!0)}hasPARSER(){return f(this.view,this.offset,4)}setHasPARSER(t){h(this.view,this.offset,4,t)}pARSER(){return c(this.view,this.offset+728,128)}setPARSER(t){u(this.view,this.offset+728,128,t),this.setHasPARSER(!0)}hasPARSER_VERSION(){return f(this.view,this.offset,5)}setHasPARSER_VERSION(t){h(this.view,this.offset,5,t)}pARSER_VERSION(){return c(this.view,this.offset+857,64)}setPARSER_VERSION(t){u(this.view,this.offset+857,64,t),this.setHasPARSER_VERSION(!0)}hasSOURCE_SHA256(){return f(this.view,this.offset,6)}setHasSOURCE_SHA256(t){h(this.view,this.offset,6,t)}sOURCE_SHA256(){return c(this.view,this.offset+922,64)}setSOURCE_SHA256(t){u(this.view,this.offset+922,64,t),this.setHasSOURCE_SHA256(!0)}hasNORMALIZED_SHA256(){return f(this.view,this.offset,7)}setHasNORMALIZED_SHA256(t){h(this.view,this.offset,7,t)}nORMALIZED_SHA256(){return c(this.view,this.offset+987,64)}setNORMALIZED_SHA256(t){u(this.view,this.offset+987,64,t),this.setHasNORMALIZED_SHA256(!0)}nORMALIZED_COUNT(){return this.view.getBigUint64(this.offset+1056,!0)}setNORMALIZED_COUNT(t){this.view.setBigUint64(this.offset+1056,t,!0)}fROM_CACHE(){return this.view.getUint8(this.offset+1064)!==0}setFROM_CACHE(t){this.view.setUint8(this.offset+1064,t?1:0)}};n(os,\"SIZE\",1072);n(os,\"ALIGN\",8);var La=os,as=class hr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new hr(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return c(this.view,this.offset+1,128)}setNAME(t){u(this.view,this.offset+1,128,t),this.setHasNAME(!0)}hasVALUE(){return f(this.view,this.offset,1)}setHasVALUE(t){h(this.view,this.offset,1,t)}vALUE(){return c(this.view,this.offset+130,255)}setVALUE(t){u(this.view,this.offset+130,255,t),this.setHasVALUE(!0)}};n(as,\"SIZE\",386);n(as,\"ALIGN\",1);var Ca=as,fs=class cr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new cr(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return c(this.view,this.offset+1,64)}setSCHEMA(t){u(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}hasBATCH_ID(){return f(this.view,this.offset,1)}setHasBATCH_ID(t){h(this.view,this.offset,1,t)}bATCH_ID(){return c(this.view,this.offset+66,128)}setBATCH_ID(t){u(this.view,this.offset+66,128,t),this.setHasBATCH_ID(!0)}iNSERTED(){return this.view.getBigUint64(this.offset+200,!0)}setINSERTED(t){this.view.setBigUint64(this.offset+200,t,!0)}rECONCILED_DUPLICATES(){return this.view.getBigUint64(this.offset+208,!0)}setRECONCILED_DUPLICATES(t){this.view.setBigUint64(this.offset+208,t,!0)}rECONCILED_OLD_BATCHES(){return this.view.getBigUint64(this.offset+216,!0)}setRECONCILED_OLD_BATCHES(t){this.view.setBigUint64(this.offset+216,t,!0)}hasARCHIVED(){return f(this.view,this.offset,2)}setHasARCHIVED(t){h(this.view,this.offset,2,t)}aRCHIVED(){return c(this.view,this.offset+224,255)}setARCHIVED(t){u(this.view,this.offset+224,255,t),this.setHasARCHIVED(!0)}hasPROVENANCE_FILE(){return f(this.view,this.offset,3)}setHasPROVENANCE_FILE(t){h(this.view,this.offset,3,t)}pROVENANCE_FILE(){return c(this.view,this.offset+480,255)}setPROVENANCE_FILE(t){u(this.view,this.offset+480,255,t),this.setHasPROVENANCE_FILE(!0)}};n(fs,\"SIZE\",736);n(fs,\"ALIGN\",8);var Ua=fs,hs=class ur{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new ur(t,s)}dELIVER(){return this.view.getUint8(this.offset+0)}setDELIVER(t){this.view.setUint8(this.offset+0,t)}};n(hs,\"SIZE\",1);n(hs,\"ALIGN\",1);var Pa=hs,cs=class Er{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Er(t,s)}rOWS(){return this.view.getBigUint64(this.offset+8,!0)}setROWS(t){this.view.setBigUint64(this.offset+8,t,!0)}cOLUMNS(){return this.view.getUint32(this.offset+16,!0)}setCOLUMNS(t){this.view.setUint32(this.offset+16,t,!0)}hasREF(){return f(this.view,this.offset,0)}setHasREF(t){h(this.view,this.offset,0,t)}rEF(){return new Se(this.buffer,this.offset+24)}};n(cs,\"SIZE\",80);n(cs,\"ALIGN\",8);var va=cs,us=class lr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new lr(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return c(this.view,this.offset+1,64)}setSCHEMA(t){u(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}hasSOURCE(){return f(this.view,this.offset,1)}setHasSOURCE(t){h(this.view,this.offset,1,t)}sOURCE(){return c(this.view,this.offset+66,128)}setSOURCE(t){u(this.view,this.offset+66,128,t),this.setHasSOURCE(!0)}hasPROFILE(){return f(this.view,this.offset,2)}setHasPROFILE(t){h(this.view,this.offset,2,t)}pROFILE(){return c(this.view,this.offset+195,32)}setPROFILE(t){u(this.view,this.offset+195,32,t),this.setHasPROFILE(!0)}ePOCH(){return this.view.getFloat64(this.offset+232,!0)}setEPOCH(t){this.view.setFloat64(this.offset+232,t,!0)}lIMIT(){return this.view.getUint32(this.offset+240,!0)}setLIMIT(t){this.view.setUint32(this.offset+240,t,!0)}dELIVER(){return this.view.getUint8(this.offset+244)}setDELIVER(t){this.view.setUint8(this.offset+244,t)}};n(us,\"SIZE\",248);n(us,\"ALIGN\",8);var Ha=us,Es=class _r{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new _r(t,s)}wANT(){return this.view.getUint8(this.offset+0)}setWANT(t){this.view.setUint8(this.offset+0,t)}dELIVER(){return this.view.getUint8(this.offset+1)}setDELIVER(t){this.view.setUint8(this.offset+1,t)}};n(Es,\"SIZE\",2);n(Es,\"ALIGN\",1);var Ba=Es,ls=class dr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new dr(t,s)}kIND(){return this.view.getUint8(this.offset+1)}setKIND(t){this.view.setUint8(this.offset+1,t)}rOWS(){return this.view.getBigUint64(this.offset+8,!0)}setROWS(t){this.view.setBigUint64(this.offset+8,t,!0)}cOLUMNS(){return this.view.getUint32(this.offset+16,!0)}setCOLUMNS(t){this.view.setUint32(this.offset+16,t,!0)}hasREF(){return f(this.view,this.offset,0)}setHasREF(t){h(this.view,this.offset,0,t)}rEF(){return new Se(this.buffer,this.offset+24)}};n(ls,\"SIZE\",80);n(ls,\"ALIGN\",8);var Ma=ls,_s=class Ir{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Ir(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return c(this.view,this.offset+1,128)}setNAME(t){u(this.view,this.offset+1,128,t),this.setHasNAME(!0)}hasKIND(){return f(this.view,this.offset,1)}setHasKIND(t){h(this.view,this.offset,1,t)}kIND(){return c(this.view,this.offset+130,16)}setKIND(t){u(this.view,this.offset+130,16,t),this.setHasKIND(!0)}hasSOURCE(){return f(this.view,this.offset,2)}setHasSOURCE(t){h(this.view,this.offset,2,t)}sOURCE(){return c(this.view,this.offset+147,128)}setSOURCE(t){u(this.view,this.offset+147,128,t),this.setHasSOURCE(!0)}rECORDS(){return this.view.getBigInt64(this.offset+280,!0)}setRECORDS(t){this.view.setBigInt64(this.offset+280,t,!0)}};n(_s,\"SIZE\",288);n(_s,\"ALIGN\",8);var Fa=_s,ds=class pr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new pr(t,s)}hasTABLE(){return f(this.view,this.offset,0)}setHasTABLE(t){h(this.view,this.offset,0,t)}tABLE(){return c(this.view,this.offset+1,128)}setTABLE(t){u(this.view,this.offset+1,128,t),this.setHasTABLE(!0)}hasNAME(){return f(this.view,this.offset,1)}setHasNAME(t){h(this.view,this.offset,1,t)}nAME(){return c(this.view,this.offset+130,128)}setNAME(t){u(this.view,this.offset+130,128,t),this.setHasNAME(!0)}pLACEHOLDER(){return this.view.getUint8(this.offset+259)!==0}setPLACEHOLDER(t){this.view.setUint8(this.offset+259,t?1:0)}};n(ds,\"SIZE\",260);n(ds,\"ALIGN\",1);var Va=ds,Is=class Sr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Sr(t,s)}tIMEOUT_MS(){return this.view.getUint32(this.offset+0,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+0,t,!0)}mAX_ROWS(){return this.view.getBigUint64(this.offset+8,!0)}setMAX_ROWS(t){this.view.setBigUint64(this.offset+8,t,!0)}mAX_BYTES(){return this.view.getBigUint64(this.offset+16,!0)}setMAX_BYTES(t){this.view.setBigUint64(this.offset+16,t,!0)}};n(Is,\"SIZE\",24);n(Is,\"ALIGN\",8);var xa=Is,ps=class Ar{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Ar(t,s)}hasSCHEMA_NAME(){return f(this.view,this.offset,0)}setHasSCHEMA_NAME(t){h(this.view,this.offset,0,t)}sCHEMA_NAME(){return c(this.view,this.offset+1,64)}setSCHEMA_NAME(t){u(this.view,this.offset+1,64,t),this.setHasSCHEMA_NAME(!0)}hasSCHEMA_VERSION(){return f(this.view,this.offset,1)}setHasSCHEMA_VERSION(t){h(this.view,this.offset,1,t)}sCHEMA_VERSION(){return c(this.view,this.offset+66,32)}setSCHEMA_VERSION(t){u(this.view,this.offset+66,32,t),this.setHasSCHEMA_VERSION(!0)}hasFORMAT(){return f(this.view,this.offset,2)}setHasFORMAT(t){h(this.view,this.offset,2,t)}fORMAT(){return c(this.view,this.offset+99,32)}setFORMAT(t){u(this.view,this.offset+99,32,t),this.setHasFORMAT(!0)}hasPUBLISH_EVENT_KEY(){return f(this.view,this.offset,3)}setHasPUBLISH_EVENT_KEY(t){h(this.view,this.offset,3,t)}pUBLISH_EVENT_KEY(){return c(this.view,this.offset+132,128)}setPUBLISH_EVENT_KEY(t){u(this.view,this.offset+132,128,t),this.setHasPUBLISH_EVENT_KEY(!0)}};n(ps,\"SIZE\",261);n(ps,\"ALIGN\",1);var Ga=ps,Ss=class br{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new br(t,s)}aLGORITHM(){return this.view.getUint8(this.offset+0)}setALGORITHM(t){this.view.setUint8(this.offset+0,t)}lENGTH(){return this.view.getUint32(this.offset+4,!0)}setLENGTH(t){this.view.setUint32(this.offset+4,t,!0)}};n(Ss,\"SIZE\",8);n(Ss,\"ALIGN\",4);var Ya=Ss,As=class Rr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Rr(t,s)}hasSLOT_ID(){return f(this.view,this.offset,0)}setHasSLOT_ID(t){h(this.view,this.offset,0,t)}sLOT_ID(){return c(this.view,this.offset+1,128)}setSLOT_ID(t){u(this.view,this.offset+1,128,t),this.setHasSLOT_ID(!0)}aLGORITHM(){return this.view.getUint8(this.offset+130)}setALGORITHM(t){this.view.setUint8(this.offset+130,t)}};n(As,\"SIZE\",131);n(As,\"ALIGN\",1);var ka=As,bs=class wr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new wr(t,s)}hasID(){return f(this.view,this.offset,0)}setHasID(t){h(this.view,this.offset,0,t)}iD(){return c(this.view,this.offset+1,128)}setID(t){u(this.view,this.offset+1,128,t),this.setHasID(!0)}hasUSERNAME(){return f(this.view,this.offset,1)}setHasUSERNAME(t){h(this.view,this.offset,1,t)}uSERNAME(){return c(this.view,this.offset+130,255)}setUSERNAME(t){u(this.view,this.offset+130,255,t),this.setHasUSERNAME(!0)}};n(bs,\"SIZE\",386);n(bs,\"ALIGN\",1);var qa=bs,Rs=class Tr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Tr(t,s)}hasID(){return f(this.view,this.offset,0)}setHasID(t){h(this.view,this.offset,0,t)}iD(){return c(this.view,this.offset+1,128)}setID(t){u(this.view,this.offset+1,128,t),this.setHasID(!0)}hasUSERNAME(){return f(this.view,this.offset,1)}setHasUSERNAME(t){h(this.view,this.offset,1,t)}uSERNAME(){return c(this.view,this.offset+130,255)}setUSERNAME(t){u(this.view,this.offset+130,255,t),this.setHasUSERNAME(!0)}cONFIGURED(){return this.view.getUint8(this.offset+386)!==0}setCONFIGURED(t){this.view.setUint8(this.offset+386,t?1:0)}hasUSERNAME_MASKED(){return f(this.view,this.offset,2)}setHasUSERNAME_MASKED(t){h(this.view,this.offset,2,t)}uSERNAME_MASKED(){return c(this.view,this.offset+387,255)}setUSERNAME_MASKED(t){u(this.view,this.offset+387,255,t),this.setHasUSERNAME_MASKED(!0)}uPDATED_MS(){return this.view.getBigUint64(this.offset+648,!0)}setUPDATED_MS(t){this.view.setBigUint64(this.offset+648,t,!0)}vERIFIED_MS(){return this.view.getBigUint64(this.offset+656,!0)}setVERIFIED_MS(t){this.view.setBigUint64(this.offset+656,t,!0)}};n(Rs,\"SIZE\",664);n(Rs,\"ALIGN\",8);var ja=Rs,ws=class Or{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Or(t,s)}hasCID(){return f(this.view,this.offset,0)}setHasCID(t){h(this.view,this.offset,0,t)}cID(){return c(this.view,this.offset+1,128)}setCID(t){u(this.view,this.offset+1,128,t),this.setHasCID(!0)}hasNAME(){return f(this.view,this.offset,1)}setHasNAME(t){h(this.view,this.offset,1,t)}nAME(){return c(this.view,this.offset+130,255)}setNAME(t){u(this.view,this.offset+130,255,t),this.setHasNAME(!0)}hasTYPE(){return f(this.view,this.offset,2)}setHasTYPE(t){h(this.view,this.offset,2,t)}tYPE(){return c(this.view,this.offset+386,32)}setTYPE(t){u(this.view,this.offset+386,32,t),this.setHasTYPE(!0)}hasLIFETIME(){return f(this.view,this.offset,3)}setHasLIFETIME(t){h(this.view,this.offset,3,t)}lIFETIME(){return c(this.view,this.offset+419,32)}setLIFETIME(t){u(this.view,this.offset+419,32,t),this.setHasLIFETIME(!0)}hasTTL(){return f(this.view,this.offset,4)}setHasTTL(t){h(this.view,this.offset,4,t)}tTL(){return c(this.view,this.offset+452,32)}setTTL(t){u(this.view,this.offset+452,32,t),this.setHasTTL(!0)}nO_PIN(){return this.view.getUint8(this.offset+485)!==0}setNO_PIN(t){this.view.setUint8(this.offset+485,t?1:0)}};n(ws,\"SIZE\",486);n(ws,\"ALIGN\",1);var Ka=ws,Ts=class mr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new mr(t,s)}hasCID(){return f(this.view,this.offset,0)}setHasCID(t){h(this.view,this.offset,0,t)}cID(){return c(this.view,this.offset+1,128)}setCID(t){u(this.view,this.offset+1,128,t),this.setHasCID(!0)}hasNAME(){return f(this.view,this.offset,1)}setHasNAME(t){h(this.view,this.offset,1,t)}nAME(){return c(this.view,this.offset+130,255)}setNAME(t){u(this.view,this.offset+130,255,t),this.setHasNAME(!0)}hasVALUE(){return f(this.view,this.offset,2)}setHasVALUE(t){h(this.view,this.offset,2,t)}vALUE(){return c(this.view,this.offset+386,255)}setVALUE(t){u(this.view,this.offset+386,255,t),this.setHasVALUE(!0)}sIZE(){return this.view.getBigUint64(this.offset+648,!0)}setSIZE(t){this.view.setBigUint64(this.offset+648,t,!0)}hasAGENT_VERSION(){return f(this.view,this.offset,3)}setHasAGENT_VERSION(t){h(this.view,this.offset,3,t)}aGENT_VERSION(){return c(this.view,this.offset+656,128)}setAGENT_VERSION(t){u(this.view,this.offset+656,128,t),this.setHasAGENT_VERSION(!0)}hasPROTOCOL_VERSION(){return f(this.view,this.offset,4)}setHasPROTOCOL_VERSION(t){h(this.view,this.offset,4,t)}pROTOCOL_VERSION(){return c(this.view,this.offset+785,64)}setPROTOCOL_VERSION(t){u(this.view,this.offset+785,64,t),this.setHasPROTOCOL_VERSION(!0)}};n(Ts,\"SIZE\",856);n(Ts,\"ALIGN\",8);var Wa=Ts,Os=class gr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new gr(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return c(this.view,this.offset+1,255)}setNAME(t){u(this.view,this.offset+1,255,t),this.setHasNAME(!0)}hasCID(){return f(this.view,this.offset,1)}setHasCID(t){h(this.view,this.offset,1,t)}cID(){return c(this.view,this.offset+257,128)}setCID(t){u(this.view,this.offset+257,128,t),this.setHasCID(!0)}sIZE(){return this.view.getBigUint64(this.offset+392,!0)}setSIZE(t){this.view.setBigUint64(this.offset+392,t,!0)}tYPE(){return this.view.getInt32(this.offset+400,!0)}setTYPE(t){this.view.setInt32(this.offset+400,t,!0)}};n(Os,\"SIZE\",408);n(Os,\"ALIGN\",8);var $a=Os,ms=class yr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new yr(t,s)}hasCID(){return f(this.view,this.offset,0)}setHasCID(t){h(this.view,this.offset,0,t)}cID(){return c(this.view,this.offset+1,128)}setCID(t){u(this.view,this.offset+1,128,t),this.setHasCID(!0)}hasTYPE(){return f(this.view,this.offset,1)}setHasTYPE(t){h(this.view,this.offset,1,t)}tYPE(){return c(this.view,this.offset+130,32)}setTYPE(t){u(this.view,this.offset+130,32,t),this.setHasTYPE(!0)}};n(ms,\"SIZE\",163);n(ms,\"ALIGN\",1);var Za=ms,gs=class Nr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Nr(t,s)}hasPEER_ID(){return f(this.view,this.offset,0)}setHasPEER_ID(t){h(this.view,this.offset,0,t)}pEER_ID(){return c(this.view,this.offset+1,128)}setPEER_ID(t){u(this.view,this.offset+1,128,t),this.setHasPEER_ID(!0)}hasADDRESS(){return f(this.view,this.offset,1)}setHasADDRESS(t){h(this.view,this.offset,1,t)}aDDRESS(){return c(this.view,this.offset+130,255)}setADDRESS(t){u(this.view,this.offset+130,255,t),this.setHasADDRESS(!0)}lATENCY_MS(){return this.view.getFloat64(this.offset+392,!0)}setLATENCY_MS(t){this.view.setFloat64(this.offset+392,t,!0)}};n(gs,\"SIZE\",400);n(gs,\"ALIGN\",8);var Qa=gs,ys=class Dr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Dr(t,s)}hasTOPIC(){return f(this.view,this.offset,0)}setHasTOPIC(t){h(this.view,this.offset,0,t)}tOPIC(){return c(this.view,this.offset+1,255)}setTOPIC(t){u(this.view,this.offset+1,255,t),this.setHasTOPIC(!0)}};n(ys,\"SIZE\",257);n(ys,\"ALIGN\",1);var za=ys,Ns=class Lr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Lr(t,s)}aLREADY(){return this.view.getUint8(this.offset+0)!==0}setALREADY(t){this.view.setUint8(this.offset+0,t?1:0)}};n(Ns,\"SIZE\",1);n(Ns,\"ALIGN\",1);var Xa=Ns,Ds=class Cr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Cr(t,s)}hasTARGET(){return f(this.view,this.offset,0)}setHasTARGET(t){h(this.view,this.offset,0,t)}tARGET(){return c(this.view,this.offset+1,255)}setTARGET(t){u(this.view,this.offset+1,255,t),this.setHasTARGET(!0)}hasPROTOCOL_ID(){return f(this.view,this.offset,1)}setHasPROTOCOL_ID(t){h(this.view,this.offset,1,t)}pROTOCOL_ID(){return c(this.view,this.offset+257,128)}setPROTOCOL_ID(t){u(this.view,this.offset+257,128,t),this.setHasPROTOCOL_ID(!0)}hasPEER_ID(){return f(this.view,this.offset,2)}setHasPEER_ID(t){h(this.view,this.offset,2,t)}pEER_ID(){return c(this.view,this.offset+386,128)}setPEER_ID(t){u(this.view,this.offset+386,128,t),this.setHasPEER_ID(!0)}tIMEOUT_MS(){return this.view.getUint32(this.offset+516,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+516,t,!0)}};n(Ds,\"SIZE\",520);n(Ds,\"ALIGN\",4);var Ja=Ds,Ls=class Ur{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Ur(t,s)}hasPEER_ID(){return f(this.view,this.offset,0)}setHasPEER_ID(t){h(this.view,this.offset,0,t)}pEER_ID(){return c(this.view,this.offset+1,128)}setPEER_ID(t){u(this.view,this.offset+1,128,t),this.setHasPEER_ID(!0)}lIMIT(){return this.view.getUint32(this.offset+132,!0)}setLIMIT(t){this.view.setUint32(this.offset+132,t,!0)}hasSTANDARD(){return f(this.view,this.offset,1)}setHasSTANDARD(t){h(this.view,this.offset,1,t)}sTANDARD(){return c(this.view,this.offset+136,16)}setSTANDARD(t){u(this.view,this.offset+136,16,t),this.setHasSTANDARD(!0)}dELIVER(){return this.view.getUint8(this.offset+153)}setDELIVER(t){this.view.setUint8(this.offset+153,t)}};n(Ls,\"SIZE\",156);n(Ls,\"ALIGN\",4);var tf=Ls,Cs=class Pr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Pr(t,s)}hasSELF(){return f(this.view,this.offset,0)}setHasSELF(t){h(this.view,this.offset,0,t)}sELF(){return c(this.view,this.offset+1,128)}setSELF(t){u(this.view,this.offset+1,128,t),this.setHasSELF(!0)}hasPEER_ID(){return f(this.view,this.offset,1)}setHasPEER_ID(t){h(this.view,this.offset,1,t)}pEER_ID(){return c(this.view,this.offset+130,128)}setPEER_ID(t){u(this.view,this.offset+130,128,t),this.setHasPEER_ID(!0)}pUBLISHER_KEY_AVAILABLE(){return this.view.getUint8(this.offset+259)!==0}setPUBLISHER_KEY_AVAILABLE(t){this.view.setUint8(this.offset+259,t?1:0)}gOSSIP_ONLY_EXCLUDED(){return this.view.getUint32(this.offset+260,!0)}setGOSSIP_ONLY_EXCLUDED(t){this.view.setUint32(this.offset+260,t,!0)}};n(Cs,\"SIZE\",264);n(Cs,\"ALIGN\",4);var ef=Cs,Us=class vr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new vr(t,s)}hasPEER_ID(){return f(this.view,this.offset,0)}setHasPEER_ID(t){h(this.view,this.offset,0,t)}pEER_ID(){return c(this.view,this.offset+1,128)}setPEER_ID(t){u(this.view,this.offset+1,128,t),this.setHasPEER_ID(!0)}cONNECTED(){return this.view.getUint8(this.offset+130)!==0}setCONNECTED(t){this.view.setUint8(this.offset+130,t?1:0)}sELF(){return this.view.getUint8(this.offset+131)!==0}setSELF(t){this.view.setUint8(this.offset+131,t?1:0)}ePM_INDEX(){return this.view.getInt32(this.offset+132,!0)}setEPM_INDEX(t){this.view.setInt32(this.offset+132,t,!0)}hasAGENT_VERSION(){return f(this.view,this.offset,1)}setHasAGENT_VERSION(t){h(this.view,this.offset,1,t)}aGENT_VERSION(){return c(this.view,this.offset+136,128)}setAGENT_VERSION(t){u(this.view,this.offset+136,128,t),this.setHasAGENT_VERSION(!0)}};n(Us,\"SIZE\",268);n(Us,\"ALIGN\",4);var sf=Us,Ps=class Hr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Hr(t,s)}hasPEER_ID(){return f(this.view,this.offset,0)}setHasPEER_ID(t){h(this.view,this.offset,0,t)}pEER_ID(){return c(this.view,this.offset+1,128)}setPEER_ID(t){u(this.view,this.offset+1,128,t),this.setHasPEER_ID(!0)}hasVALUE(){return f(this.view,this.offset,1)}setHasVALUE(t){h(this.view,this.offset,1,t)}vALUE(){return c(this.view,this.offset+130,255)}setVALUE(t){u(this.view,this.offset+130,255,t),this.setHasVALUE(!0)}};n(Ps,\"SIZE\",386);n(Ps,\"ALIGN\",1);var rf=Ps,vs=class Br{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Br(t,s)}hasPEER_ID(){return f(this.view,this.offset,0)}setHasPEER_ID(t){h(this.view,this.offset,0,t)}pEER_ID(){return c(this.view,this.offset+2,128)}setPEER_ID(t){u(this.view,this.offset+2,128,t),this.setHasPEER_ID(!0)}hasPUBLISHER_PEER_ID(){return f(this.view,this.offset,1)}setHasPUBLISHER_PEER_ID(t){h(this.view,this.offset,1,t)}pUBLISHER_PEER_ID(){return c(this.view,this.offset+131,128)}setPUBLISHER_PEER_ID(t){u(this.view,this.offset+131,128,t),this.setHasPUBLISHER_PEER_ID(!0)}hasGOSSIP_PEER_ID(){return f(this.view,this.offset,2)}setHasGOSSIP_PEER_ID(t){h(this.view,this.offset,2,t)}gOSSIP_PEER_ID(){return c(this.view,this.offset+260,128)}setGOSSIP_PEER_ID(t){u(this.view,this.offset+260,128,t),this.setHasGOSSIP_PEER_ID(!0)}hasSTANDARD(){return f(this.view,this.offset,3)}setHasSTANDARD(t){h(this.view,this.offset,3,t)}sTANDARD(){return c(this.view,this.offset+389,16)}setSTANDARD(t){u(this.view,this.offset+389,16,t),this.setHasSTANDARD(!0)}hasSCHEMA(){return f(this.view,this.offset,4)}setHasSCHEMA(t){h(this.view,this.offset,4,t)}sCHEMA(){return c(this.view,this.offset+406,64)}setSCHEMA(t){u(this.view,this.offset+406,64,t),this.setHasSCHEMA(!0)}hasFILE_ID(){return f(this.view,this.offset,5)}setHasFILE_ID(t){h(this.view,this.offset,5,t)}fILE_ID(){return c(this.view,this.offset+471,255)}setFILE_ID(t){u(this.view,this.offset+471,255,t),this.setHasFILE_ID(!0)}hasFILE_NAME(){return f(this.view,this.offset,6)}setHasFILE_NAME(t){h(this.view,this.offset,6,t)}fILE_NAME(){return c(this.view,this.offset+727,255)}setFILE_NAME(t){u(this.view,this.offset+727,255,t),this.setHasFILE_NAME(!0)}hasCID(){return f(this.view,this.offset,7)}setHasCID(t){h(this.view,this.offset,7,t)}cID(){return c(this.view,this.offset+983,128)}setCID(t){u(this.view,this.offset+983,128,t),this.setHasCID(!0)}pUBLISH_MS(){return this.view.getBigUint64(this.offset+1112,!0)}setPUBLISH_MS(t){this.view.setBigUint64(this.offset+1112,t,!0)}hasSIGNATURE_TYPE(){return f(this.view,this.offset,8)}setHasSIGNATURE_TYPE(t){h(this.view,this.offset,8,t)}sIGNATURE_TYPE(){return c(this.view,this.offset+1120,32)}setSIGNATURE_TYPE(t){u(this.view,this.offset+1120,32,t),this.setHasSIGNATURE_TYPE(!0)}hasSIGNATURE_HEX(){return f(this.view,this.offset,9)}setHasSIGNATURE_HEX(t){h(this.view,this.offset,9,t)}sIGNATURE_HEX(){return c(this.view,this.offset+1153,255)}setSIGNATURE_HEX(t){u(this.view,this.offset+1153,255,t),this.setHasSIGNATURE_HEX(!0)}sIGNATURE_VERIFIED(){return this.view.getUint8(this.offset+1409)!==0}setSIGNATURE_VERIFIED(t){this.view.setUint8(this.offset+1409,t?1:0)}hasATTRIBUTION(){return f(this.view,this.offset,10)}setHasATTRIBUTION(t){h(this.view,this.offset,10,t)}aTTRIBUTION(){return c(this.view,this.offset+1410,16)}setATTRIBUTION(t){u(this.view,this.offset+1410,16,t),this.setHasATTRIBUTION(!0)}pNM_INDEX(){return this.view.getInt32(this.offset+1428,!0)}setPNM_INDEX(t){this.view.setInt32(this.offset+1428,t,!0)}hasPUBLISHER_KEY_HEX(){return f(this.view,this.offset,11)}setHasPUBLISHER_KEY_HEX(t){h(this.view,this.offset,11,t)}pUBLISHER_KEY_HEX(){return c(this.view,this.offset+1432,128)}setPUBLISHER_KEY_HEX(t){u(this.view,this.offset+1432,128,t),this.setHasPUBLISHER_KEY_HEX(!0)}hasPUBLISHER_KEY_SOURCE(){return f(this.view,this.offset,12)}setHasPUBLISHER_KEY_SOURCE(t){h(this.view,this.offset,12,t)}pUBLISHER_KEY_SOURCE(){return c(this.view,this.offset+1561,64)}setPUBLISHER_KEY_SOURCE(t){u(this.view,this.offset+1561,64,t),this.setHasPUBLISHER_KEY_SOURCE(!0)}};n(vs,\"SIZE\",1632);n(vs,\"ALIGN\",8);var nf=vs,Hs=class Mr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Mr(t,s)}kNOWN(){return this.view.getUint8(this.offset+2)!==0}setKNOWN(t){this.view.setUint8(this.offset+2,t?1:0)}hasREASON(){return f(this.view,this.offset,0)}setHasREASON(t){h(this.view,this.offset,0,t)}rEASON(){return c(this.view,this.offset+3,64)}setREASON(t){u(this.view,this.offset+3,64,t),this.setHasREASON(!0)}pINNED(){return this.view.getUint8(this.offset+68)!==0}setPINNED(t){this.view.setUint8(this.offset+68,t?1:0)}sELF(){return this.view.getUint8(this.offset+69)!==0}setSELF(t){this.view.setUint8(this.offset+69,t?1:0)}fRESH(){return this.view.getUint8(this.offset+70)!==0}setFRESH(t){this.view.setUint8(this.offset+70,t?1:0)}hasSTANDARD(){return f(this.view,this.offset,1)}setHasSTANDARD(t){h(this.view,this.offset,1,t)}sTANDARD(){return c(this.view,this.offset+71,16)}setSTANDARD(t){u(this.view,this.offset+71,16,t),this.setHasSTANDARD(!0)}hasSCHEMA(){return f(this.view,this.offset,2)}setHasSCHEMA(t){h(this.view,this.offset,2,t)}sCHEMA(){return c(this.view,this.offset+88,64)}setSCHEMA(t){u(this.view,this.offset+88,64,t),this.setHasSCHEMA(!0)}hasPNM_CID(){return f(this.view,this.offset,3)}setHasPNM_CID(t){h(this.view,this.offset,3,t)}pNM_CID(){return c(this.view,this.offset+153,128)}setPNM_CID(t){u(this.view,this.offset+153,128,t),this.setHasPNM_CID(!0)}hasPNM_FILE_ID(){return f(this.view,this.offset,4)}setHasPNM_FILE_ID(t){h(this.view,this.offset,4,t)}pNM_FILE_ID(){return c(this.view,this.offset+282,255)}setPNM_FILE_ID(t){u(this.view,this.offset+282,255,t),this.setHasPNM_FILE_ID(!0)}pNM_PUBLISH_MS(){return this.view.getBigUint64(this.offset+544,!0)}setPNM_PUBLISH_MS(t){this.view.setBigUint64(this.offset+544,t,!0)}pNM_SIGNATURE_VERIFIED(){return this.view.getUint8(this.offset+552)!==0}setPNM_SIGNATURE_VERIFIED(t){this.view.setUint8(this.offset+552,t?1:0)}hasPNM_ATTRIBUTION(){return f(this.view,this.offset,5)}setHasPNM_ATTRIBUTION(t){h(this.view,this.offset,5,t)}pNM_ATTRIBUTION(){return c(this.view,this.offset+553,16)}setPNM_ATTRIBUTION(t){u(this.view,this.offset+553,16,t),this.setHasPNM_ATTRIBUTION(!0)}hasBATCH_ID(){return f(this.view,this.offset,6)}setHasBATCH_ID(t){h(this.view,this.offset,6,t)}bATCH_ID(){return c(this.view,this.offset+570,128)}setBATCH_ID(t){u(this.view,this.offset+570,128,t),this.setHasBATCH_ID(!0)}hasPROVIDER_ID(){return f(this.view,this.offset,7)}setHasPROVIDER_ID(t){h(this.view,this.offset,7,t)}pROVIDER_ID(){return c(this.view,this.offset+699,128)}setPROVIDER_ID(t){u(this.view,this.offset+699,128,t),this.setHasPROVIDER_ID(!0)}hasSOURCE_NAME(){return f(this.view,this.offset,8)}setHasSOURCE_NAME(t){h(this.view,this.offset,8,t)}sOURCE_NAME(){return c(this.view,this.offset+828,128)}setSOURCE_NAME(t){u(this.view,this.offset+828,128,t),this.setHasSOURCE_NAME(!0)}rECORD_COUNT(){return this.view.getBigUint64(this.offset+960,!0)}setRECORD_COUNT(t){this.view.setBigUint64(this.offset+960,t,!0)}bYTE_COUNT(){return this.view.getBigUint64(this.offset+968,!0)}setBYTE_COUNT(t){this.view.setBigUint64(this.offset+968,t,!0)}pARTS(){return this.view.getUint32(this.offset+976,!0)}setPARTS(t){this.view.setUint32(this.offset+976,t,!0)}pUBLISHED_MS(){return this.view.getBigUint64(this.offset+984,!0)}setPUBLISHED_MS(t){this.view.setBigUint64(this.offset+984,t,!0)}hasETAG_FNV1A64(){return f(this.view,this.offset,9)}setHasETAG_FNV1A64(t){h(this.view,this.offset,9,t)}eTAG_FNV1A64(){return c(this.view,this.offset+992,16)}setETAG_FNV1A64(t){u(this.view,this.offset+992,16,t),this.setHasETAG_FNV1A64(!0)}hasREF(){return f(this.view,this.offset,10)}setHasREF(t){h(this.view,this.offset,10,t)}rEF(){return new Se(this.buffer,this.offset+1016)}};n(Hs,\"SIZE\",1072);n(Hs,\"ALIGN\",8);var of=Hs,Bs=class Fr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Fr(t,s)}uPTIME_S(){return this.view.getBigUint64(this.offset+8,!0)}setUPTIME_S(t){this.view.setBigUint64(this.offset+8,t,!0)}sTARTED_MS(){return this.view.getBigUint64(this.offset+16,!0)}setSTARTED_MS(t){this.view.setBigUint64(this.offset+16,t,!0)}sTORE_TOTAL_BYTES(){return this.view.getBigUint64(this.offset+24,!0)}setSTORE_TOTAL_BYTES(t){this.view.setBigUint64(this.offset+24,t,!0)}sTORE_TOTAL_RECORDS(){return this.view.getBigUint64(this.offset+32,!0)}setSTORE_TOTAL_RECORDS(t){this.view.setBigUint64(this.offset+32,t,!0)}hasSTORAGE_PATH(){return f(this.view,this.offset,0)}setHasSTORAGE_PATH(t){h(this.view,this.offset,0,t)}sTORAGE_PATH(){return c(this.view,this.offset+40,255)}setSTORAGE_PATH(t){u(this.view,this.offset+40,255,t),this.setHasSTORAGE_PATH(!0)}hAS_DISK(){return this.view.getUint8(this.offset+296)!==0}setHAS_DISK(t){this.view.setUint8(this.offset+296,t?1:0)}dISK_CAPACITY_BYTES(){return this.view.getBigUint64(this.offset+304,!0)}setDISK_CAPACITY_BYTES(t){this.view.setBigUint64(this.offset+304,t,!0)}dISK_FREE_BYTES(){return this.view.getBigUint64(this.offset+312,!0)}setDISK_FREE_BYTES(t){this.view.setBigUint64(this.offset+312,t,!0)}dISK_AVAILABLE_BYTES(){return this.view.getBigUint64(this.offset+320,!0)}setDISK_AVAILABLE_BYTES(t){this.view.setBigUint64(this.offset+320,t,!0)}hasSERVICE_STATE(){return f(this.view,this.offset,1)}setHasSERVICE_STATE(t){h(this.view,this.offset,1,t)}sERVICE_STATE(){return c(this.view,this.offset+328,32)}setSERVICE_STATE(t){u(this.view,this.offset+328,32,t),this.setHasSERVICE_STATE(!0)}hasSERVICE_MODE(){return f(this.view,this.offset,2)}setHasSERVICE_MODE(t){h(this.view,this.offset,2,t)}sERVICE_MODE(){return c(this.view,this.offset+361,32)}setSERVICE_MODE(t){u(this.view,this.offset+361,32,t),this.setHasSERVICE_MODE(!0)}hAS_BANDWIDTH(){return this.view.getUint8(this.offset+394)!==0}setHAS_BANDWIDTH(t){this.view.setUint8(this.offset+394,t?1:0)}tOTAL_IN_BYTES(){return this.view.getBigUint64(this.offset+400,!0)}setTOTAL_IN_BYTES(t){this.view.setBigUint64(this.offset+400,t,!0)}tOTAL_OUT_BYTES(){return this.view.getBigUint64(this.offset+408,!0)}setTOTAL_OUT_BYTES(t){this.view.setBigUint64(this.offset+408,t,!0)}rATE_IN_BPS(){return this.view.getFloat64(this.offset+416,!0)}setRATE_IN_BPS(t){this.view.setFloat64(this.offset+416,t,!0)}rATE_OUT_BPS(){return this.view.getFloat64(this.offset+424,!0)}setRATE_OUT_BPS(t){this.view.setFloat64(this.offset+424,t,!0)}};n(Bs,\"SIZE\",432);n(Bs,\"ALIGN\",8);var af=Bs,Ms=class Vr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Vr(t,s)}tS_MS(){return this.view.getBigUint64(this.offset+0,!0)}setTS_MS(t){this.view.setBigUint64(this.offset+0,t,!0)}tOTAL_IN_BYTES(){return this.view.getBigUint64(this.offset+8,!0)}setTOTAL_IN_BYTES(t){this.view.setBigUint64(this.offset+8,t,!0)}tOTAL_OUT_BYTES(){return this.view.getBigUint64(this.offset+16,!0)}setTOTAL_OUT_BYTES(t){this.view.setBigUint64(this.offset+16,t,!0)}rATE_IN_BPS(){return this.view.getFloat64(this.offset+24,!0)}setRATE_IN_BPS(t){this.view.setFloat64(this.offset+24,t,!0)}rATE_OUT_BPS(){return this.view.getFloat64(this.offset+32,!0)}setRATE_OUT_BPS(t){this.view.setFloat64(this.offset+32,t,!0)}};n(Ms,\"SIZE\",40);n(Ms,\"ALIGN\",8);var ff=Ms,Fs=class xr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new xr(t,s)}lIMIT(){return this.view.getUint32(this.offset+0,!0)}setLIMIT(t){this.view.setUint32(this.offset+0,t,!0)}};n(Fs,\"SIZE\",4);n(Fs,\"ALIGN\",4);var hf=Fs,Vs=class Gr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Gr(t,s)}tS_MS(){return this.view.getBigUint64(this.offset+8,!0)}setTS_MS(t){this.view.setBigUint64(this.offset+8,t,!0)}hasKIND(){return f(this.view,this.offset,0)}setHasKIND(t){h(this.view,this.offset,0,t)}kIND(){return c(this.view,this.offset+16,32)}setKIND(t){u(this.view,this.offset+16,32,t),this.setHasKIND(!0)}hasDETAIL(){return f(this.view,this.offset,1)}setHasDETAIL(t){h(this.view,this.offset,1,t)}dETAIL(){return c(this.view,this.offset+49,255)}setDETAIL(t){u(this.view,this.offset+49,255,t),this.setHasDETAIL(!0)}hasPEER_ID(){return f(this.view,this.offset,2)}setHasPEER_ID(t){h(this.view,this.offset,2,t)}pEER_ID(){return c(this.view,this.offset+305,128)}setPEER_ID(t){u(this.view,this.offset+305,128,t),this.setHasPEER_ID(!0)}};n(Vs,\"SIZE\",440);n(Vs,\"ALIGN\",8);var cf=Vs,xs=class Yr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Yr(t,s)}mS(){return this.view.getUint32(this.offset+0,!0)}setMS(t){this.view.setUint32(this.offset+0,t,!0)}};n(xs,\"SIZE\",4);n(xs,\"ALIGN\",4);var uf=xs,Gs=class kr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new kr(t,s)}hasEXPRESSION(){return f(this.view,this.offset,0)}setHasEXPRESSION(t){h(this.view,this.offset,0,t)}eXPRESSION(){return c(this.view,this.offset+1,128)}setEXPRESSION(t){u(this.view,this.offset+1,128,t),this.setHasEXPRESSION(!0)}aT_MS(){return this.view.getBigUint64(this.offset+136,!0)}setAT_MS(t){this.view.setBigUint64(this.offset+136,t,!0)}};n(Gs,\"SIZE\",144);n(Gs,\"ALIGN\",8);var Ef=Gs,Ys=class qr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new qr(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return c(this.view,this.offset+1,16)}setNAME(t){u(this.view,this.offset+1,16,t),this.setHasNAME(!0)}hasSOURCE(){return f(this.view,this.offset,1)}setHasSOURCE(t){h(this.view,this.offset,1,t)}sOURCE(){return c(this.view,this.offset+18,64)}setSOURCE(t){u(this.view,this.offset+18,64,t),this.setHasSOURCE(!0)}hAS_WILDCARD(){return this.view.getUint8(this.offset+83)!==0}setHAS_WILDCARD(t){this.view.setUint8(this.offset+83,t?1:0)}hasVALUES(){return f(this.view,this.offset,2)}setHasVALUES(t){h(this.view,this.offset,2,t)}vALUESLength(){return this.hasVALUES()?Math.min(this.view.getUint32(this.offset+84,!0),60):0}setVALUESLength(t){let s=Math.max(0,Math.min(t,60));this.view.setUint32(this.offset+84,s,!0),this.setHasVALUES(!0)}vALUESAt(t){return this.view.getInt32(this.offset+84+4+t*4,!0)}setVALUESAt(t,s){this.view.setInt32(this.offset+84+4+t*4,s,!0),this.setHasVALUES(!0)}};n(Ys,\"SIZE\",328);n(Ys,\"ALIGN\",4);var lf=Ys,ks=class jr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new jr(t,s)}tIMEOUT_MS(){return this.view.getUint32(this.offset+0,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+0,t,!0)}nO_RESPONSE(){return this.view.getUint8(this.offset+4)!==0}setNO_RESPONSE(t){this.view.setUint8(this.offset+4,t?1:0)}mESSAGE_IS_TEXT(){return this.view.getUint8(this.offset+5)!==0}setMESSAGE_IS_TEXT(t){this.view.setUint8(this.offset+5,t?1:0)}};n(ks,\"SIZE\",8);n(ks,\"ALIGN\",4);var _f=ks,qs=class Kr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Kr(t,s)}hasPROTOCOL(){return f(this.view,this.offset,0)}setHasPROTOCOL(t){h(this.view,this.offset,0,t)}pROTOCOL(){return c(this.view,this.offset+1,64)}setPROTOCOL(t){u(this.view,this.offset+1,64,t),this.setHasPROTOCOL(!0)}hasEXTENSIONS(){return f(this.view,this.offset,1)}setHasEXTENSIONS(t){h(this.view,this.offset,1,t)}eXTENSIONS(){return c(this.view,this.offset+66,255)}setEXTENSIONS(t){u(this.view,this.offset+66,255,t),this.setHasEXTENSIONS(!0)}cLOSE_CODE(){return this.view.getInt32(this.offset+324,!0)}setCLOSE_CODE(t){this.view.setInt32(this.offset+324,t,!0)}hasCLOSE_REASON(){return f(this.view,this.offset,2)}setHasCLOSE_REASON(t){h(this.view,this.offset,2,t)}cLOSE_REASON(){return c(this.view,this.offset+328,255)}setCLOSE_REASON(t){u(this.view,this.offset+328,255,t),this.setHasCLOSE_REASON(!0)}bODY_IS_TEXT(){return this.view.getUint8(this.offset+584)!==0}setBODY_IS_TEXT(t){this.view.setUint8(this.offset+584,t?1:0)}};n(qs,\"SIZE\",588);n(qs,\"ALIGN\",4);var df=qs,js=class Wr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Wr(t,s)}hasHOST(){return f(this.view,this.offset,0)}setHasHOST(t){h(this.view,this.offset,0,t)}hOST(){return c(this.view,this.offset+1,255)}setHOST(t){u(this.view,this.offset+1,255,t),this.setHasHOST(!0)}pORT(){return this.view.getUint16(this.offset+258,!0)}setPORT(t){this.view.setUint16(this.offset+258,t,!0)}hasCLIENT_ID(){return f(this.view,this.offset,1)}setHasCLIENT_ID(t){h(this.view,this.offset,1,t)}cLIENT_ID(){return c(this.view,this.offset+260,128)}setCLIENT_ID(t){u(this.view,this.offset+260,128,t),this.setHasCLIENT_ID(!0)}hasTOPIC(){return f(this.view,this.offset,2)}setHasTOPIC(t){h(this.view,this.offset,2,t)}tOPIC(){return c(this.view,this.offset+389,255)}setTOPIC(t){u(this.view,this.offset+389,255,t),this.setHasTOPIC(!0)}hasUSERNAME(){return f(this.view,this.offset,3)}setHasUSERNAME(t){h(this.view,this.offset,3,t)}uSERNAME(){return c(this.view,this.offset+645,128)}setUSERNAME(t){u(this.view,this.offset+645,128,t),this.setHasUSERNAME(!0)}kEEP_ALIVE_S(){return this.view.getUint16(this.offset+774,!0)}setKEEP_ALIVE_S(t){this.view.setUint16(this.offset+774,t,!0)}tIMEOUT_MS(){return this.view.getUint32(this.offset+776,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+776,t,!0)}pACKET_ID(){return this.view.getUint16(this.offset+780,!0)}setPACKET_ID(t){this.view.setUint16(this.offset+780,t,!0)}};n(js,\"SIZE\",784);n(js,\"ALIGN\",4);var If=js,Ks=class $r{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new $r(t,s)}hasHOST(){return f(this.view,this.offset,0)}setHasHOST(t){h(this.view,this.offset,0,t)}hOST(){return c(this.view,this.offset+1,255)}setHOST(t){u(this.view,this.offset+1,255,t),this.setHasHOST(!0)}pORT(){return this.view.getUint16(this.offset+258,!0)}setPORT(t){this.view.setUint16(this.offset+258,t,!0)}hasCLIENT_ID(){return f(this.view,this.offset,1)}setHasCLIENT_ID(t){h(this.view,this.offset,1,t)}cLIENT_ID(){return c(this.view,this.offset+260,128)}setCLIENT_ID(t){u(this.view,this.offset+260,128,t),this.setHasCLIENT_ID(!0)}hasTOPIC(){return f(this.view,this.offset,2)}setHasTOPIC(t){h(this.view,this.offset,2,t)}tOPIC(){return c(this.view,this.offset+389,255)}setTOPIC(t){u(this.view,this.offset+389,255,t),this.setHasTOPIC(!0)}pAYLOAD_BYTES(){return this.view.getBigUint64(this.offset+648,!0)}setPAYLOAD_BYTES(t){this.view.setBigUint64(this.offset+648,t,!0)}};n(Ks,\"SIZE\",656);n(Ks,\"ALIGN\",8);var pf=Ks,Ws=class Zr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Zr(t,s)}hasHOST(){return f(this.view,this.offset,0)}setHasHOST(t){h(this.view,this.offset,0,t)}hOST(){return c(this.view,this.offset+1,255)}setHOST(t){u(this.view,this.offset+1,255,t),this.setHasHOST(!0)}pORT(){return this.view.getUint16(this.offset+258,!0)}setPORT(t){this.view.setUint16(this.offset+258,t,!0)}tIMEOUT_MS(){return this.view.getUint32(this.offset+260,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+260,t,!0)}nO_RESPONSE(){return this.view.getUint8(this.offset+264)!==0}setNO_RESPONSE(t){this.view.setUint8(this.offset+264,t?1:0)}hasBIND_ADDRESS(){return f(this.view,this.offset,1)}setHasBIND_ADDRESS(t){h(this.view,this.offset,1,t)}bIND_ADDRESS(){return c(this.view,this.offset+265,64)}setBIND_ADDRESS(t){u(this.view,this.offset+265,64,t),this.setHasBIND_ADDRESS(!0)}bIND_PORT(){return this.view.getUint16(this.offset+330,!0)}setBIND_PORT(t){this.view.setUint16(this.offset+330,t,!0)}hasUDP_TYPE(){return f(this.view,this.offset,2)}setHasUDP_TYPE(t){h(this.view,this.offset,2,t)}uDP_TYPE(){return c(this.view,this.offset+332,8)}setUDP_TYPE(t){u(this.view,this.offset+332,8,t),this.setHasUDP_TYPE(!0)}aLLOW_UNAUTHORIZED(){return this.view.getUint8(this.offset+341)!==0}setALLOW_UNAUTHORIZED(t){this.view.setUint8(this.offset+341,t?1:0)}hasSERVER_NAME(){return f(this.view,this.offset,3)}setHasSERVER_NAME(t){h(this.view,this.offset,3,t)}sERVER_NAME(){return c(this.view,this.offset+342,255)}setSERVER_NAME(t){u(this.view,this.offset+342,255,t),this.setHasSERVER_NAME(!0)}};n(Ws,\"SIZE\",600);n(Ws,\"ALIGN\",4);var Sf=Ws,$s=class Qr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Qr(t,s)}hasHOST(){return f(this.view,this.offset,0)}setHasHOST(t){h(this.view,this.offset,0,t)}hOST(){return c(this.view,this.offset+1,255)}setHOST(t){u(this.view,this.offset+1,255,t),this.setHasHOST(!0)}pORT(){return this.view.getUint16(this.offset+258,!0)}setPORT(t){this.view.setUint16(this.offset+258,t,!0)}hasLOCAL_ADDRESS(){return f(this.view,this.offset,1)}setHasLOCAL_ADDRESS(t){h(this.view,this.offset,1,t)}lOCAL_ADDRESS(){return c(this.view,this.offset+260,64)}setLOCAL_ADDRESS(t){u(this.view,this.offset+260,64,t),this.setHasLOCAL_ADDRESS(!0)}lOCAL_PORT(){return this.view.getUint16(this.offset+326,!0)}setLOCAL_PORT(t){this.view.setUint16(this.offset+326,t,!0)}hasREMOTE_ADDRESS(){return f(this.view,this.offset,2)}setHasREMOTE_ADDRESS(t){h(this.view,this.offset,2,t)}rEMOTE_ADDRESS(){return c(this.view,this.offset+328,64)}setREMOTE_ADDRESS(t){u(this.view,this.offset+328,64,t),this.setHasREMOTE_ADDRESS(!0)}rEMOTE_PORT(){return this.view.getUint16(this.offset+394,!0)}setREMOTE_PORT(t){this.view.setUint16(this.offset+394,t,!0)}aUTHORIZED(){return this.view.getUint8(this.offset+396)!==0}setAUTHORIZED(t){this.view.setUint8(this.offset+396,t?1:0)}hasAUTHORIZATION_ERROR(){return f(this.view,this.offset,3)}setHasAUTHORIZATION_ERROR(t){h(this.view,this.offset,3,t)}aUTHORIZATION_ERROR(){return c(this.view,this.offset+397,255)}setAUTHORIZATION_ERROR(t){u(this.view,this.offset+397,255,t),this.setHasAUTHORIZATION_ERROR(!0)}};n($s,\"SIZE\",654);n($s,\"ALIGN\",2);var Af=$s,Zs=class zr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new zr(t,s)}nOT_RECURSIVE(){return this.view.getUint8(this.offset+0)!==0}setNOT_RECURSIVE(t){this.view.setUint8(this.offset+0,t?1:0)}};n(Zs,\"SIZE\",1);n(Zs,\"ALIGN\",1);var bf=Zs,Qs=class Xr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Xr(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return c(this.view,this.offset+1,255)}setNAME(t){u(this.view,this.offset+1,255,t),this.setHasNAME(!0)}iS_FILE(){return this.view.getUint8(this.offset+257)!==0}setIS_FILE(t){this.view.setUint8(this.offset+257,t?1:0)}iS_DIRECTORY(){return this.view.getUint8(this.offset+258)!==0}setIS_DIRECTORY(t){this.view.setUint8(this.offset+258,t?1:0)}};n(Qs,\"SIZE\",259);n(Qs,\"ALIGN\",1);var Rf=Qs,zs=class Jr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Jr(t,s)}sIZE(){return this.view.getBigUint64(this.offset+0,!0)}setSIZE(t){this.view.setBigUint64(this.offset+0,t,!0)}iS_FILE(){return this.view.getUint8(this.offset+8)!==0}setIS_FILE(t){this.view.setUint8(this.offset+8,t?1:0)}iS_DIRECTORY(){return this.view.getUint8(this.offset+9)!==0}setIS_DIRECTORY(t){this.view.setUint8(this.offset+9,t?1:0)}cTIME_MS(){return this.view.getFloat64(this.offset+16,!0)}setCTIME_MS(t){this.view.setFloat64(this.offset+16,t,!0)}mTIME_MS(){return this.view.getFloat64(this.offset+24,!0)}setMTIME_MS(t){this.view.setFloat64(this.offset+24,t,!0)}};n(zs,\"SIZE\",32);n(zs,\"ALIGN\",8);var wf=zs,Xs=class tn{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new tn(t,s)}tIMEOUT_MS(){return this.view.getUint32(this.offset+0,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+0,t,!0)}};n(Xs,\"SIZE\",4);n(Xs,\"ALIGN\",4);var Tf=Xs,Js=class en{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new en(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return c(this.view,this.offset+1,128)}setNAME(t){u(this.view,this.offset+1,128,t),this.setHasNAME(!0)}hasVALUE(){return f(this.view,this.offset,1)}setHasVALUE(t){h(this.view,this.offset,1,t)}vALUE(){return c(this.view,this.offset+130,255)}setVALUE(t){u(this.view,this.offset+130,255,t),this.setHasVALUE(!0)}};n(Js,\"SIZE\",386);n(Js,\"ALIGN\",1);var Of=Js,ti=class sn{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new sn(t,s)}eXIT_CODE(){return this.view.getInt32(this.offset+4,!0)}setEXIT_CODE(t){this.view.setInt32(this.offset+4,t,!0)}hasSIGNAL(){return f(this.view,this.offset,0)}setHasSIGNAL(t){h(this.view,this.offset,0,t)}sIGNAL(){return c(this.view,this.offset+8,16)}setSIGNAL(t){u(this.view,this.offset+8,16,t),this.setHasSIGNAL(!0)}};n(ti,\"SIZE\",28);n(ti,\"ALIGN\",4);var mf=ti,ei=class rn{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new rn(t,s)}hasSCOPE(){return f(this.view,this.offset,0)}setHasSCOPE(t){h(this.view,this.offset,0,t)}sCOPE(){return c(this.view,this.offset+1,128)}setSCOPE(t){u(this.view,this.offset+1,128,t),this.setHasSCOPE(!0)}hasKEY(){return f(this.view,this.offset,1)}setHasKEY(t){h(this.view,this.offset,1,t)}kEY(){return c(this.view,this.offset+130,255)}setKEY(t){u(this.view,this.offset+130,255,t),this.setHasKEY(!0)}};n(ei,\"SIZE\",386);n(ei,\"ALIGN\",1);var gf=ei;var lt=new Int32Array(2),Ae=new Float32Array(lt.buffer),be=new Float64Array(lt.buffer),Gt=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Qt;(function(e){e[e.UTF8_BYTES=1]=\"UTF8_BYTES\",e[e.UTF16_STRING=2]=\"UTF16_STRING\"})(Qt||(Qt={}));var _t=class e{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new e(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return lt[0]=this.readInt32(t),Ae[0]}readFloat64(t){return lt[Gt?0:1]=this.readInt32(t),lt[Gt?1:0]=this.readInt32(t+4),be[0]}writeInt8(t,s){this.bytes_[t]=s}writeUint8(t,s){this.bytes_[t]=s}writeInt16(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8}writeUint16(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8}writeInt32(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8,this.bytes_[t+2]=s>>16,this.bytes_[t+3]=s>>24}writeUint32(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8,this.bytes_[t+2]=s>>16,this.bytes_[t+3]=s>>24}writeInt64(t,s){this.writeInt32(t,Number(BigInt.asIntN(32,s))),this.writeInt32(t+4,Number(BigInt.asIntN(32,s>>BigInt(32))))}writeUint64(t,s){this.writeUint32(t,Number(BigInt.asUintN(32,s))),this.writeUint32(t+4,Number(BigInt.asUintN(32,s>>BigInt(32))))}writeFloat32(t,s){Ae[0]=s,this.writeInt32(t,lt[0])}writeFloat64(t,s){be[0]=s,this.writeInt32(t,lt[Gt?0:1]),this.writeInt32(t+4,lt[Gt?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error(\"FlatBuffers: ByteBuffer is too short to contain an identifier.\");let t=\"\";for(let s=0;s<4;s++)t+=String.fromCharCode(this.readInt8(this.position_+4+s));return t}__offset(t,s){let i=t-this.readInt32(t);return s<this.readInt16(i)?this.readInt16(i+s):0}__union(t,s){return t.bb_pos=s+this.readInt32(s),t.bb=this,t}__string(t,s){t+=this.readInt32(t);let i=this.readInt32(t);t+=4;let r=this.bytes_.subarray(t,t+i);return s===Qt.UTF8_BYTES?r:this.text_decoder_.decode(r)}__union_with_string(t,s){return typeof t==\"string\"?this.__string(s):this.__union(t,s)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+4}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=4)throw new Error(\"FlatBuffers: file identifier must be length \"+4);for(let s=0;s<4;s++)if(t.charCodeAt(s)!=this.readInt8(this.position()+4+s))return!1;return!0}createScalarList(t,s){let i=[];for(let r=0;r<s;++r){let o=t(r);o!==null&&i.push(o)}return i}createObjList(t,s){let i=[];for(let r=0;r<s;++r){let o=t(r);o!==null&&i.push(o.unpack())}return i}};var zt=class e{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let s;t?s=t:s=1024,this.bb=_t.allocate(s),this.space=s}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,s){t>this.minalign&&(this.minalign=t);let i=~(this.bb.capacity()-this.space+s)+1&t-1;for(;this.space<i+t+s;){let r=this.bb.capacity();this.bb=e.growByteBuffer(this.bb),this.space+=this.bb.capacity()-r}this.pad(i)}pad(t){for(let s=0;s<t;s++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,s,i){(this.force_defaults||s!=i)&&(this.addInt8(s),this.slot(t))}addFieldInt16(t,s,i){(this.force_defaults||s!=i)&&(this.addInt16(s),this.slot(t))}addFieldInt32(t,s,i){(this.force_defaults||s!=i)&&(this.addInt32(s),this.slot(t))}addFieldInt64(t,s,i){(this.force_defaults||s!==i)&&(this.addInt64(s),this.slot(t))}addFieldFloat32(t,s,i){(this.force_defaults||s!=i)&&(this.addFloat32(s),this.slot(t))}addFieldFloat64(t,s,i){(this.force_defaults||s!=i)&&(this.addFloat64(s),this.slot(t))}addFieldOffset(t,s,i){(this.force_defaults||s!=i)&&(this.addOffset(s),this.slot(t))}addFieldStruct(t,s,i){s!=i&&(this.nested(s),this.slot(t))}nested(t){if(t!=this.offset())throw new TypeError(\"FlatBuffers: struct must be serialized inline.\")}notNested(){if(this.isNested)throw new TypeError(\"FlatBuffers: object serialization must not be nested.\")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){let s=t.capacity();if(s&3221225472)throw new Error(\"FlatBuffers: cannot grow buffer beyond 2 gigabytes.\");let i=s<<1,r=_t.allocate(i);return r.setPosition(i-s),r.bytes().set(t.bytes(),i-s),r}addOffset(t){this.prep(4,0),this.writeInt32(this.offset()-t+4)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let s=0;s<t;s++)this.vtable[s]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error(\"FlatBuffers: endObject called without startObject\");this.addInt32(0);let t=this.offset(),s=this.vtable_in_use-1;for(;s>=0&&this.vtable[s]==0;s--);let i=s+1;for(;s>=0;s--)this.addInt16(this.vtable[s]!=0?t-this.vtable[s]:0);let r=2;this.addInt16(t-this.object_start);let o=(i+r)*2;this.addInt16(o);let a=0,E=this.space;t:for(s=0;s<this.vtables.length;s++){let l=this.bb.capacity()-this.vtables[s];if(o==this.bb.readInt16(l)){for(let _=2;_<o;_+=2)if(this.bb.readInt16(E+_)!=this.bb.readInt16(l+_))continue t;a=this.vtables[s];break}}return a?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,a-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,s,i){let r=i?4:0;if(s){let o=s;if(this.prep(this.minalign,8+r),o.length!=4)throw new TypeError(\"FlatBuffers: file identifier must be length \"+4);for(let a=3;a>=0;a--)this.writeInt8(o.charCodeAt(a))}this.prep(this.minalign,4+r),this.addOffset(t),r&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,s){this.finish(t,s,!0)}requiredField(t,s){let i=this.bb.capacity()-t,r=i-this.bb.readInt32(i);if(!(s<this.bb.readInt16(r)&&this.bb.readInt16(r+s)!=0))throw new TypeError(\"FlatBuffers: field \"+s+\" must be set\")}startVector(t,s,i){this.notNested(),this.vector_num_elems=s,this.prep(4,t*s),this.prep(i,t*s)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);let s=this.createString(t);return this.string_maps.set(t,s),s}createString(t){if(t==null)return 0;let s;return t instanceof Uint8Array?s=t:s=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,s.length,1),this.bb.setPosition(this.space-=s.length),this.bb.bytes().set(s,this.space),this.endVector()}createByteVector(t){return t==null?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())}createObjectOffset(t){return t===null?0:typeof t==\"string\"?this.createString(t):t.pack(this)}createObjectOffsetList(t){let s=[];for(let i=0;i<t.length;++i){let r=t[i];if(r!==null)s.push(this.createObjectOffset(r));else throw new TypeError(\"FlatBuffers: Argument for createObjectOffsetList cannot contain null.\")}return s}createStructOffsetList(t,s){return s(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}};var si;(function(e){e[e.DIRECT=0]=\"DIRECT\",e[e.COMMAND=1]=\"COMMAND\"})(si||(si={}));var dt;(function(e){e[e.IMMUTABLE=0]=\"IMMUTABLE\",e[e.APPEND_ONLY=1]=\"APPEND_ONLY\",e[e.MUTABLE=2]=\"MUTABLE\"})(dt||(dt={}));var $;(function(e){e[e.BORROWED=0]=\"BORROWED\",e[e.PRODUCER_OWNED=1]=\"PRODUCER_OWNED\",e[e.HOST_OWNED=2]=\"HOST_OWNED\",e[e.SHARED=3]=\"SHARED\"})($||($={}));function on(e){if(e==null)return{valid:!0,present:!1,bytes:[]};if(typeof e==\"string\"){let s=e.startsWith(\"0x\")?e.slice(2):e;if(s.length===0)return{valid:!0,present:!1,bytes:[]};if(s.length%2!==0||!/^[0-9a-fA-F]+$/.test(s))return{valid:!1,present:!0,bytes:[]};let i=[];for(let r=0;r<s.length;r+=2)i.push(Number.parseInt(s.slice(r,r+2),16));return{valid:!0,present:!0,bytes:i}}if(!Array.isArray(e)&&!(e instanceof Uint8Array))return{valid:!1,present:!0,bytes:[]};let t=Array.from(e);return t.length===0?{valid:!0,present:!1,bytes:[]}:t.some(s=>!Number.isInteger(s)||s<0||s>255)?{valid:!1,present:!0,bytes:[]}:{valid:!0,present:!0,bytes:t}}function an(e){let t=on(e);return t.valid&&t.present?t.bytes:void 0}function fn(e){return on(e).valid}function Nf(e){return Object.prototype.toString.call(e)}function Df(e){if(!e||typeof e!=\"object\")return!1;let t=Nf(e);return t===\"[object ArrayBuffer]\"||t===\"[object SharedArrayBuffer]\"}function et(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Df(e)?new Uint8Array(e):null}var q;(function(e){e[e.FLATBUFFER=0]=\"FLATBUFFER\",e[e.ALIGNED_BINARY=1]=\"ALIGNED_BINARY\"})(q||(q={}));var Yt=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsFlatBufferTypeRef(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFlatBufferTypeRef(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}SCHEMA_NAME(t){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.__string(this.bb_pos+s,t):null}FILE_IDENTIFIER(t){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.__string(this.bb_pos+s,t):null}SCHEMA_VERSION(t){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.__string(this.bb_pos+s,t):null}ROOT_TYPE(t){let s=this.bb.__offset(this.bb_pos,10);return s?this.bb.__string(this.bb_pos+s,t):null}SCHEMA_HASH(t){let s=this.bb.__offset(this.bb_pos,12);return s?this.bb.readUint8(this.bb.__vector(this.bb_pos+s)+t):0}schemaHashLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}schemaHashArray(){let t=this.bb.__offset(this.bb_pos,12);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}ACCEPTS_ANY_FLATBUFFER(){let t=this.bb.__offset(this.bb_pos,14);return t?!!this.bb.readInt8(this.bb_pos+t):!1}WIRE_FORMAT(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):q.FLATBUFFER}FIXED_STRING_LENGTH(){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.readUint16(this.bb_pos+t):0}BYTE_LENGTH(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readUint32(this.bb_pos+t):0}REQUIRED_ALIGNMENT(){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readUint16(this.bb_pos+t):0}static startFlatBufferTypeRef(t){t.startObject(10)}static addSchemaName(t,s){t.addFieldOffset(0,s,0)}static addFileIdentifier(t,s){t.addFieldOffset(1,s,0)}static addSchemaVersion(t,s){t.addFieldOffset(2,s,0)}static addRootType(t,s){t.addFieldOffset(3,s,0)}static addSchemaHash(t,s){t.addFieldOffset(4,s,0)}static createSchemaHashVector(t,s){t.startVector(1,s.length,1);for(let i=s.length-1;i>=0;i--)t.addInt8(s[i]);return t.endVector()}static startSchemaHashVector(t,s){t.startVector(1,s,1)}static addAcceptsAnyFlatbuffer(t,s){t.addFieldInt8(5,+s,0)}static addWireFormat(t,s){t.addFieldInt8(6,s,q.FLATBUFFER)}static addFixedStringLength(t,s){t.addFieldInt16(7,s,0)}static addByteLength(t,s){t.addFieldInt32(8,s,0)}static addRequiredAlignment(t,s){t.addFieldInt16(9,s,0)}static endFlatBufferTypeRef(t){return t.endObject()}static createFlatBufferTypeRef(t,s,i,r,o,a,E,l,_,p,O){return e.startFlatBufferTypeRef(t),e.addSchemaName(t,s),e.addFileIdentifier(t,i),e.addSchemaVersion(t,r),e.addRootType(t,o),e.addSchemaHash(t,a),e.addAcceptsAnyFlatbuffer(t,E),e.addWireFormat(t,l),e.addFixedStringLength(t,_),e.addByteLength(t,p),e.addRequiredAlignment(t,O),e.endFlatBufferTypeRef(t)}unpack(){return new Xt(this.SCHEMA_NAME(),this.FILE_IDENTIFIER(),this.SCHEMA_VERSION(),this.ROOT_TYPE(),this.bb.createScalarList(this.SCHEMA_HASH.bind(this),this.schemaHashLength()),this.ACCEPTS_ANY_FLATBUFFER(),this.WIRE_FORMAT(),this.FIXED_STRING_LENGTH(),this.BYTE_LENGTH(),this.REQUIRED_ALIGNMENT())}unpackTo(t){t.SCHEMA_NAME=this.SCHEMA_NAME(),t.FILE_IDENTIFIER=this.FILE_IDENTIFIER(),t.SCHEMA_VERSION=this.SCHEMA_VERSION(),t.ROOT_TYPE=this.ROOT_TYPE(),t.SCHEMA_HASH=this.bb.createScalarList(this.SCHEMA_HASH.bind(this),this.schemaHashLength()),t.ACCEPTS_ANY_FLATBUFFER=this.ACCEPTS_ANY_FLATBUFFER(),t.WIRE_FORMAT=this.WIRE_FORMAT(),t.FIXED_STRING_LENGTH=this.FIXED_STRING_LENGTH(),t.BYTE_LENGTH=this.BYTE_LENGTH(),t.REQUIRED_ALIGNMENT=this.REQUIRED_ALIGNMENT()}},Xt=class{constructor(t=null,s=null,i=null,r=null,o=[],a=!1,E=q.FLATBUFFER,l=0,_=0,p=0){this.SCHEMA_NAME=t,this.FILE_IDENTIFIER=s,this.SCHEMA_VERSION=i,this.ROOT_TYPE=r,this.SCHEMA_HASH=o,this.ACCEPTS_ANY_FLATBUFFER=a,this.WIRE_FORMAT=E,this.FIXED_STRING_LENGTH=l,this.BYTE_LENGTH=_,this.REQUIRED_ALIGNMENT=p}pack(t){let s=this.SCHEMA_NAME!==null?t.createString(this.SCHEMA_NAME):0,i=this.FILE_IDENTIFIER!==null?t.createString(this.FILE_IDENTIFIER):0,r=this.SCHEMA_VERSION!==null?t.createString(this.SCHEMA_VERSION):0,o=this.ROOT_TYPE!==null?t.createString(this.ROOT_TYPE):0,a=Yt.createSchemaHashVector(t,this.SCHEMA_HASH);return Yt.createFlatBufferTypeRef(t,s,i,r,o,a,this.ACCEPTS_ANY_FLATBUFFER,this.WIRE_FORMAT,this.FIXED_STRING_LENGTH,this.BYTE_LENGTH,this.REQUIRED_ALIGNMENT)}};var Z;(function(e){e[e.IMMUTABLE=0]=\"IMMUTABLE\",e[e.SINGLE_WRITER_MUTABLE=1]=\"SINGLE_WRITER_MUTABLE\",e[e.APPEND_ONLY=2]=\"APPEND_ONLY\"})(Z||(Z={}));var Q;(function(e){e[e.HOST_OWNED=0]=\"HOST_OWNED\",e[e.PLUGIN_OWNED=1]=\"PLUGIN_OWNED\",e[e.TRANSFERRED=2]=\"TRANSFERRED\"})(Q||(Q={}));var x=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsTAB(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTAB(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static bufferHasIdentifier(t){return t.__has_identifier(\"$TAB\")}OFFSET(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb_pos+t):0}SIZE(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint32(this.bb_pos+t):0}ALIGNMENT(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint32(this.bb_pos+t):0}WIRE_FORMAT(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readUint8(this.bb_pos+t):q.FLATBUFFER}TYPE_REF(t){let s=this.bb.__offset(this.bb_pos,12);return s?(t||new Yt).__init(this.bb.__indirect(this.bb_pos+s),this.bb):null}MUTABILITY(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readUint8(this.bb_pos+t):Z.IMMUTABLE}OWNERSHIP(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):Q.HOST_OWNED}FRAME_ID(){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.readUint64(this.bb_pos+t):BigInt(\"0\")}PORT_ID(t){let s=this.bb.__offset(this.bb_pos,20);return s?this.bb.__string(this.bb_pos+s,t):null}static startTAB(t){t.startObject(9)}static addOffset(t,s){t.addFieldInt32(0,s,0)}static addSize(t,s){t.addFieldInt32(1,s,0)}static addAlignment(t,s){t.addFieldInt32(2,s,0)}static addWireFormat(t,s){t.addFieldInt8(3,s,q.FLATBUFFER)}static addTypeRef(t,s){t.addFieldOffset(4,s,0)}static addMutability(t,s){t.addFieldInt8(5,s,Z.IMMUTABLE)}static addOwnership(t,s){t.addFieldInt8(6,s,Q.HOST_OWNED)}static addFrameId(t,s){t.addFieldInt64(7,s,BigInt(\"0\"))}static addPortId(t,s){t.addFieldOffset(8,s,0)}static endTAB(t){return t.endObject()}static finishTABBuffer(t,s){t.finish(s,\"$TAB\")}static finishSizePrefixedTABBuffer(t,s){t.finish(s,\"$TAB\",!0)}unpack(){return new kt(this.OFFSET(),this.SIZE(),this.ALIGNMENT(),this.WIRE_FORMAT(),this.TYPE_REF()!==null?this.TYPE_REF().unpack():null,this.MUTABILITY(),this.OWNERSHIP(),this.FRAME_ID(),this.PORT_ID())}unpackTo(t){t.OFFSET=this.OFFSET(),t.SIZE=this.SIZE(),t.ALIGNMENT=this.ALIGNMENT(),t.WIRE_FORMAT=this.WIRE_FORMAT(),t.TYPE_REF=this.TYPE_REF()!==null?this.TYPE_REF().unpack():null,t.MUTABILITY=this.MUTABILITY(),t.OWNERSHIP=this.OWNERSHIP(),t.FRAME_ID=this.FRAME_ID(),t.PORT_ID=this.PORT_ID()}},kt=class{constructor(t=0,s=0,i=0,r=q.FLATBUFFER,o=null,a=Z.IMMUTABLE,E=Q.HOST_OWNED,l=BigInt(\"0\"),_=null){this.OFFSET=t,this.SIZE=s,this.ALIGNMENT=i,this.WIRE_FORMAT=r,this.TYPE_REF=o,this.MUTABILITY=a,this.OWNERSHIP=E,this.FRAME_ID=l,this.PORT_ID=_}pack(t){let s=this.TYPE_REF!==null?this.TYPE_REF.pack(t):0,i=this.PORT_ID!==null?t.createString(this.PORT_ID):0;return x.startTAB(t),x.addOffset(t,this.OFFSET),x.addSize(t,this.SIZE),x.addAlignment(t,this.ALIGNMENT),x.addWireFormat(t,this.WIRE_FORMAT),x.addTypeRef(t,s),x.addMutability(t,this.MUTABILITY),x.addOwnership(t,this.OWNERSHIP),x.addFrameId(t,this.FRAME_ID),x.addPortId(t,i),x.endTAB(t)}};var wt=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsPIVRequest(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsPIVRequest(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}METHOD_ID(t){let s=this.bb.__offset(this.bb_pos,4);return this.bb.__string(this.bb_pos+s,t)}INPUTS(t,s){let i=this.bb.__offset(this.bb_pos,6);return i?(s||new x).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}inputsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}PAYLOAD_ARENA(t){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.readUint8(this.bb.__vector(this.bb_pos+s)+t):0}payloadArenaLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}payloadArenaArray(){let t=this.bb.__offset(this.bb_pos,8);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}TRACE_ID(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readUint64(this.bb_pos+t):BigInt(\"0\")}OUTPUT_STREAM_CAP(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readUint32(this.bb_pos+t):0}static startPIVRequest(t){t.startObject(5)}static addMethodId(t,s){t.addFieldOffset(0,s,0)}static addInputs(t,s){t.addFieldOffset(1,s,0)}static createInputsVector(t,s){t.startVector(4,s.length,4);for(let i=s.length-1;i>=0;i--)t.addOffset(s[i]);return t.endVector()}static startInputsVector(t,s){t.startVector(4,s,4)}static addPayloadArena(t,s){t.addFieldOffset(2,s,0)}static createPayloadArenaVector(t,s){t.startVector(1,s.length,1);for(let i=s.length-1;i>=0;i--)t.addInt8(s[i]);return t.endVector()}static startPayloadArenaVector(t,s){t.startVector(1,s,1)}static addTraceId(t,s){t.addFieldInt64(3,s,BigInt(\"0\"))}static addOutputStreamCap(t,s){t.addFieldInt32(4,s,0)}static endPIVRequest(t){let s=t.endObject();return t.requiredField(s,4),s}static createPIVRequest(t,s,i,r,o,a){return e.startPIVRequest(t),e.addMethodId(t,s),e.addInputs(t,i),e.addPayloadArena(t,r),e.addTraceId(t,o),e.addOutputStreamCap(t,a),e.endPIVRequest(t)}unpack(){return new ii(this.METHOD_ID(),this.bb.createObjList(this.INPUTS.bind(this),this.inputsLength()),this.bb.createScalarList(this.PAYLOAD_ARENA.bind(this),this.payloadArenaLength()),this.TRACE_ID(),this.OUTPUT_STREAM_CAP())}unpackTo(t){t.METHOD_ID=this.METHOD_ID(),t.INPUTS=this.bb.createObjList(this.INPUTS.bind(this),this.inputsLength()),t.PAYLOAD_ARENA=this.bb.createScalarList(this.PAYLOAD_ARENA.bind(this),this.payloadArenaLength()),t.TRACE_ID=this.TRACE_ID(),t.OUTPUT_STREAM_CAP=this.OUTPUT_STREAM_CAP()}},ii=class{constructor(t=null,s=[],i=[],r=BigInt(\"0\"),o=0){this.METHOD_ID=t,this.INPUTS=s,this.PAYLOAD_ARENA=i,this.TRACE_ID=r,this.OUTPUT_STREAM_CAP=o}pack(t){let s=this.METHOD_ID!==null?t.createString(this.METHOD_ID):0,i=wt.createInputsVector(t,t.createObjectOffsetList(this.INPUTS)),r=wt.createPayloadArenaVector(t,this.PAYLOAD_ARENA);return wt.createPIVRequest(t,s,i,r,this.TRACE_ID,this.OUTPUT_STREAM_CAP)}};var It;(function(e){e[e.OK=0]=\"OK\",e[e.NOT_FOUND=1]=\"NOT_FOUND\",e[e.YIELDED=2]=\"YIELDED\",e[e.FAILED=3]=\"FAILED\"})(It||(It={}));var B=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsPIVResponse(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsPIVResponse(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}STATUS_CODE(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}STATUS(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):It.OK}YIELDED(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}BACKLOG_REMAINING(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readUint32(this.bb_pos+t):0}OUTPUTS(t,s){let i=this.bb.__offset(this.bb_pos,12);return i?(s||new x).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}outputsLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}PAYLOAD_ARENA(t){let s=this.bb.__offset(this.bb_pos,14);return s?this.bb.readUint8(this.bb.__vector(this.bb_pos+s)+t):0}payloadArenaLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}payloadArenaArray(){let t=this.bb.__offset(this.bb_pos,14);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}ERROR_CODE(t){let s=this.bb.__offset(this.bb_pos,16);return s?this.bb.__string(this.bb_pos+s,t):null}ERROR_MESSAGE(t){let s=this.bb.__offset(this.bb_pos,18);return s?this.bb.__string(this.bb_pos+s,t):null}TRACE_ID(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readUint64(this.bb_pos+t):BigInt(\"0\")}static startPIVResponse(t){t.startObject(9)}static addStatusCode(t,s){t.addFieldInt32(0,s,0)}static addStatus(t,s){t.addFieldInt32(1,s,It.OK)}static addYielded(t,s){t.addFieldInt8(2,+s,0)}static addBacklogRemaining(t,s){t.addFieldInt32(3,s,0)}static addOutputs(t,s){t.addFieldOffset(4,s,0)}static createOutputsVector(t,s){t.startVector(4,s.length,4);for(let i=s.length-1;i>=0;i--)t.addOffset(s[i]);return t.endVector()}static startOutputsVector(t,s){t.startVector(4,s,4)}static addPayloadArena(t,s){t.addFieldOffset(5,s,0)}static createPayloadArenaVector(t,s){t.startVector(1,s.length,1);for(let i=s.length-1;i>=0;i--)t.addInt8(s[i]);return t.endVector()}static startPayloadArenaVector(t,s){t.startVector(1,s,1)}static addErrorCode(t,s){t.addFieldOffset(6,s,0)}static addErrorMessage(t,s){t.addFieldOffset(7,s,0)}static addTraceId(t,s){t.addFieldInt64(8,s,BigInt(\"0\"))}static endPIVResponse(t){return t.endObject()}static createPIVResponse(t,s,i,r,o,a,E,l,_,p){return e.startPIVResponse(t),e.addStatusCode(t,s),e.addStatus(t,i),e.addYielded(t,r),e.addBacklogRemaining(t,o),e.addOutputs(t,a),e.addPayloadArena(t,E),e.addErrorCode(t,l),e.addErrorMessage(t,_),e.addTraceId(t,p),e.endPIVResponse(t)}unpack(){return new ri(this.STATUS_CODE(),this.STATUS(),this.YIELDED(),this.BACKLOG_REMAINING(),this.bb.createObjList(this.OUTPUTS.bind(this),this.outputsLength()),this.bb.createScalarList(this.PAYLOAD_ARENA.bind(this),this.payloadArenaLength()),this.ERROR_CODE(),this.ERROR_MESSAGE(),this.TRACE_ID())}unpackTo(t){t.STATUS_CODE=this.STATUS_CODE(),t.STATUS=this.STATUS(),t.YIELDED=this.YIELDED(),t.BACKLOG_REMAINING=this.BACKLOG_REMAINING(),t.OUTPUTS=this.bb.createObjList(this.OUTPUTS.bind(this),this.outputsLength()),t.PAYLOAD_ARENA=this.bb.createScalarList(this.PAYLOAD_ARENA.bind(this),this.payloadArenaLength()),t.ERROR_CODE=this.ERROR_CODE(),t.ERROR_MESSAGE=this.ERROR_MESSAGE(),t.TRACE_ID=this.TRACE_ID()}},ri=class{constructor(t=0,s=It.OK,i=!1,r=0,o=[],a=[],E=null,l=null,_=BigInt(\"0\")){this.STATUS_CODE=t,this.STATUS=s,this.YIELDED=i,this.BACKLOG_REMAINING=r,this.OUTPUTS=o,this.PAYLOAD_ARENA=a,this.ERROR_CODE=E,this.ERROR_MESSAGE=l,this.TRACE_ID=_}pack(t){let s=B.createOutputsVector(t,t.createObjectOffsetList(this.OUTPUTS)),i=B.createPayloadArenaVector(t,this.PAYLOAD_ARENA),r=this.ERROR_CODE!==null?t.createString(this.ERROR_CODE):0,o=this.ERROR_MESSAGE!==null?t.createString(this.ERROR_MESSAGE):0;return B.createPIVResponse(t,this.STATUS_CODE,this.STATUS,this.YIELDED,this.BACKLOG_REMAINING,s,i,r,o,this.TRACE_ID)}};var K=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsPIV(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsPIV(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static bufferHasIdentifier(t){return t.__has_identifier(\"$PIV\")}REQUEST(t){let s=this.bb.__offset(this.bb_pos,4);return s?(t||new wt).__init(this.bb.__indirect(this.bb_pos+s),this.bb):null}RESPONSE(t){let s=this.bb.__offset(this.bb_pos,6);return s?(t||new B).__init(this.bb.__indirect(this.bb_pos+s),this.bb):null}static startPIV(t){t.startObject(2)}static addRequest(t,s){t.addFieldOffset(0,s,0)}static addResponse(t,s){t.addFieldOffset(1,s,0)}static endPIV(t){return t.endObject()}static finishPIVBuffer(t,s){t.finish(s,\"$PIV\")}static finishSizePrefixedPIVBuffer(t,s){t.finish(s,\"$PIV\",!0)}unpack(){return new ni(this.REQUEST()!==null?this.REQUEST().unpack():null,this.RESPONSE()!==null?this.RESPONSE().unpack():null)}unpackTo(t){t.REQUEST=this.REQUEST()!==null?this.REQUEST().unpack():null,t.RESPONSE=this.RESPONSE()!==null?this.RESPONSE().unpack():null}},ni=class{constructor(t=null,s=null){this.REQUEST=t,this.RESPONSE=s}pack(t){let s=this.REQUEST!==null?this.REQUEST.pack(t):0,i=this.RESPONSE!==null?this.RESPONSE.pack(t):0;return K.startPIV(t),K.addRequest(t,s),K.addResponse(t,i),K.endPIV(t)}};var te=65535,ot=4294967295,cn=new WeakMap,Lf=new WeakMap,Cf=new WeakMap;function Y(...e){return e.find(t=>t!=null)}function z(e,t,s={}){let{defaultValue:i,minimum:r=0,maximum:o=Number.MAX_SAFE_INTEGER}=s;if(e==null||e===\"\"){if(i!==void 0)return i;throw new TypeError(`${t} is required.`)}let a;if(typeof e==\"bigint\"){if(e<BigInt(r)||e>BigInt(o))throw new RangeError(`${t} must be an integer between ${r} and ${o}.`);a=Number(e)}else a=typeof e==\"number\"?e:Number(e);if(!Number.isSafeInteger(a)||a<r||a>o)throw new RangeError(`${t} must be an integer between ${r} and ${o}.`);return a}function we(e){return e>0&&Number.isInteger(Math.log2(e))}function fi(e,t,s={}){let i=z(e,t,{defaultValue:s.defaultValue,minimum:0,maximum:s.maximum??ot});if(!we(i))throw new RangeError(`${t} must be a positive power of two.`);return i}function hi(e,t,s){if(e>ot-t)throw new RangeError(`${s} offset + size exceeds the uint32 address range.`)}function ci(e,t,s){if(e.buffer!==t.buffer||e.byteOffset<t.byteOffset||e.byteOffset+e.byteLength>t.byteOffset+t.byteLength)throw new Error(`${s} is outside its arena lease.`)}function ui(e){let t=cn.get(e);if(!t)throw new TypeError(\"SDS PIV/TAB arena lease is invalid.\");return t}function Uf(e,t,s,i){let r=ui(e);if(r.closed)throw new Error(`${i} arena lease is closed.`);if(t!==r.generation)throw new Error(`${i} has stale arena lease generation ${String(t)}; active generation is ${r.generation}.`);return s&&ci(s,r.arena,i),r}function un(e,t,s={}){let i=e?.arenaLease;if(!i){if(s.required===!0)throw new Error(`${t} requires a live arena lease.`);return null}let r=et(e.payload),o=Y(e.generation,e.arenaGeneration);return Uf(i,o,r,t)}function En(e,t){let s=un(e,t);if(!s)return null;let i=pn(e.ownership),r=In(e.mutability);if(i===$.PRODUCER_OWNED||r!==dt.IMMUTABLE){let o=et(e.payload),a=Y(e.generation,e.arenaGeneration),E=Cf.get(e);if(E&&i===$.SHARED&&E.lease===e.arenaLease&&E.generation===a&&E.payloadBuffer===o?.buffer&&E.payloadByteOffset===o?.byteOffset&&E.payloadByteLength===o?.byteLength&&E.frameId===Te(e)&&E.ownership===i&&E.mutability===r)return s;throw new Error(`${t} producer-owned or mutable cross-invocation alias requires explicit compatible transfer forwarding.`)}return s}function Pf(e){if(e instanceof _t)return e;let t=et(e);if(t)return new _t(t);throw new TypeError(\"Expected ByteBuffer, Uint8Array, ArrayBufferView, or ArrayBuffer.\")}function oi(e,t=0){let s=Number(e??t);return Number.isFinite(s)?Math.max(0,Math.trunc(s)):t}function qt(e,t=BigInt(0)){if(typeof e==\"bigint\")return e;if(typeof e==\"number\"&&Number.isFinite(e))return BigInt(Math.trunc(e));if(typeof e==\"string\"&&e.trim())try{return BigInt(e.trim())}catch{return t}return t}function Jt(e){let t=typeof e==\"string\"?e.trim().toLowerCase():\"\";if(e===1||t===\"aligned-binary\"||t===\"aligned_binary\"||t===\"alignedbinary\")return\"aligned-binary\";if(e==null||e===0||t===\"\"||t===\"flatbuffer\")return\"flatbuffer\";throw new TypeError(`Unsupported SDS PIV/TAB wire format: ${String(e)}.`)}function Ei(e){return Jt(e)===\"aligned-binary\"?q.ALIGNED_BINARY:q.FLATBUFFER}function ln(e){if(e===q.ALIGNED_BINARY)return\"aligned-binary\";if(e===q.FLATBUFFER)return\"flatbuffer\";throw new TypeError(`Unsupported SDS PIV/TAB wire format value: ${e}.`)}function li(e){if(e==null||e===dt.IMMUTABLE||e===\"immutable\"||e===\"IMMUTABLE\")return Z.IMMUTABLE;if(e===dt.APPEND_ONLY||e===\"append-only\"||e===\"APPEND_ONLY\")return Z.APPEND_ONLY;if(e===dt.MUTABLE||e===\"mutable\"||e===\"single-writer-mutable\"||e===\"SINGLE_WRITER_MUTABLE\")return Z.SINGLE_WRITER_MUTABLE;throw new TypeError(`Unsupported SDS PIV/TAB mutability: ${String(e)}.`)}function _n(e){if(e===Z.APPEND_ONLY)return dt.APPEND_ONLY;if(e===Z.SINGLE_WRITER_MUTABLE)return dt.MUTABLE;if(e===Z.IMMUTABLE)return dt.IMMUTABLE;throw new TypeError(`Unsupported SDS PIV/TAB mutability value: ${e}.`)}function _i(e){if(e==null||e===$.BORROWED||e===$.HOST_OWNED||e===\"borrowed\"||e===\"BORROWED\"||e===\"host-owned\"||e===\"host_owned\"||e===\"HOST_OWNED\")return Q.HOST_OWNED;if(e===$.PRODUCER_OWNED||e===\"producer-owned\"||e===\"producer_owned\"||e===\"PRODUCER_OWNED\"||e===\"plugin-owned\"||e===\"plugin_owned\"||e===\"PLUGIN_OWNED\")return Q.PLUGIN_OWNED;if(e===$.SHARED||e===\"shared\"||e===\"SHARED\"||e===\"transferred\"||e===\"TRANSFERRED\")return Q.TRANSFERRED;throw new TypeError(`Unsupported SDS PIV/TAB ownership: ${String(e)}.`)}function dn(e){if(e===Q.PLUGIN_OWNED)return $.PRODUCER_OWNED;if(e===Q.TRANSFERRED)return $.SHARED;if(e===Q.HOST_OWNED)return $.HOST_OWNED;throw new TypeError(`Unsupported SDS PIV/TAB ownership value: ${e}.`)}function In(e){return _n(li(e))}function pn(e){return dn(_i(e))}function vf(e={},t=void 0){let s=Y(e.schemaHash,e.SCHEMA_HASH);if(!fn(s))throw new TypeError(\"SDS PIV/TAB schemaHash must contain valid bytes or hex.\");let i=Jt(Y(e.wireFormat,e.WIRE_FORMAT,t));return new Xt(e.schemaName??e.SCHEMA_NAME??null,e.fileIdentifier??e.FILE_IDENTIFIER??null,e.schemaVersion??e.SCHEMA_VERSION??null,e.rootTypeName??e.rootType??e.ROOT_TYPE??null,an(s)??[],!!(e.acceptsAnyFlatbuffer??e.ACCEPTS_ANY_FLATBUFFER??!1),Ei(i),z(Y(e.fixedStringLength,e.FIXED_STRING_LENGTH),\"SDS PIV/TAB fixedStringLength\",{defaultValue:0,maximum:te}),z(Y(e.byteLength,e.BYTE_LENGTH),\"SDS PIV/TAB byteLength\",{defaultValue:0,maximum:ot}),z(Y(e.requiredAlignment,e.REQUIRED_ALIGNMENT),\"SDS PIV/TAB requiredAlignment\",{defaultValue:0,maximum:te}))}function Sn(e={}){let t=e.typeRef??e.allowedType??{},s=Y(e.wireFormat,e.WIRE_FORMAT),i=Y(t.wireFormat,t.WIRE_FORMAT),r=Jt(Y(i,s));if(i!==void 0&&s!==void 0&&Jt(i)!==Jt(s))throw new Error(\"SDS PIV/TAB frame and typeRef wire formats disagree.\");let o=vf(t,r);if(r===\"aligned-binary\")o.REQUIRED_ALIGNMENT=fi(o.REQUIRED_ALIGNMENT,\"SDS PIV/TAB aligned type requiredAlignment\",{maximum:te}),o.BYTE_LENGTH=z(o.BYTE_LENGTH,\"SDS PIV/TAB aligned type byteLength\",{minimum:0,maximum:ot});else if(o.REQUIRED_ALIGNMENT>0&&!we(o.REQUIRED_ALIGNMENT))throw new RangeError(\"SDS PIV/TAB type requiredAlignment must be a positive power of two when declared.\");return{typeRef:o,wireFormat:r}}function An(e,t){let s=Y(e?.alignment,e?.ALIGNMENT),i=fi(s,\"SDS PIV/TAB frame alignment\",{defaultValue:Math.max(yt,t||1)});if(i<t)throw new RangeError(`SDS PIV/TAB frame alignment ${i} is below required alignment ${t}.`);return i}function bn(e,t,s){if(e===\"aligned-binary\"&&t.BYTE_LENGTH>0&&s!==t.BYTE_LENGTH)throw new RangeError(`SDS PIV/TAB aligned payload size ${s} does not match declared byteLength ${t.BYTE_LENGTH}.`)}function Te(e={}){return e.frameId!==void 0&&e.frameId!==null?qt(e.frameId):e.sequence!==void 0||e.endOfStream!==void 0||e.endOfStream===!0?qt(e.sequence)<<BigInt(1)|(e.endOfStream===!0?BigInt(1):BigInt(0)):qt(e.traceId)}function Hf(e){let t=qt(e);return{sequence:t>>BigInt(1),endOfStream:(t&BigInt(1))===BigInt(1)}}function Bf(e,t){if(t<=1)return e;let s=e%t;return s===0?e:e+t-s}function ai(e){return z(Y(e?.offset,e?.OFFSET),\"SDS PIV/TAB frame offset\",{defaultValue:0,maximum:ot})}function Rn(e){return z(Y(e?.size,e?.SIZE),\"SDS PIV/TAB frame size\",{defaultValue:0,maximum:ot})}function Oe(e){return fi(Y(e?.alignment,e?.ALIGNMENT),\"SDS PIV/TAB frame alignment\",{defaultValue:yt})}function Mf(e={},t){let s=et(e.payload??new Uint8Array)??new Uint8Array;En(e,\"SDS PIV/TAB frame forwarding\");let{typeRef:i,wireFormat:r}=Sn(e),o=i.REQUIRED_ALIGNMENT,a=An(e,o);bn(r,i,s.length);let E=Bf(t,a);return hi(E,s.length,\"SDS PIV/TAB frame\"),{payload:s,padding:E-t,buffer:new kt(E,s.length,a,Ei(r),i,li(e.mutability),_i(e.ownership),Te(e),e.portId??null)}}var yt=8;function Ff(e,t={}){let s=et(e);if(!s)throw new TypeError(\"createInvokeArenaLease requires Uint8Array-compatible arena bytes.\");let i={arena:s,generation:z(t.generation,\"SDS PIV/TAB arena lease generation\",{defaultValue:1,maximum:ot}),closed:!1},r={get arena(){return i.arena},get generation(){return i.generation},get closed(){return i.closed},advance(o=void 0){if(i.closed)throw new Error(\"SDS PIV/TAB arena lease is closed.\");if(i.generation>=ot)throw new RangeError(\"SDS PIV/TAB arena lease generation exceeds the uint32 range.\");if(o!==void 0){let a=et(o);if(!a)throw new TypeError(\"SDS PIV/TAB arena lease advance requires Uint8Array-compatible bytes.\");i.arena=a}return i.generation+=1,i.generation},close(){i.closed=!0},createTransferToken(o,a={}){if(un(o,\"SDS PIV/TAB arena transfer\",{required:!0})!==i||o.arenaLease!==r)throw new Error(\"SDS PIV/TAB arena transfer frame belongs to a different lease.\");let l=pn(a.ownership??\"transferred\");if(l!==$.SHARED)throw new Error(\"SDS PIV/TAB arena transfer ownership must be transferred/shared.\");let _=In(a.mutability??o.mutability),p=et(o.payload),O=Object.freeze({});return Lf.set(O,{lease:r,generation:i.generation,payloadBuffer:p.buffer,payloadByteOffset:p.byteOffset,payloadByteLength:p.byteLength,frameId:Te(o),ownership:l,mutability:_,consumed:!1}),O}};return cn.set(r,i),Object.freeze(r)}function Vf(e,t,s){return e.startVector(1,t.length,s),e.bb.setPosition(e.space-=t.length),e.bb.bytes().set(t,e.space),e.endVector()}function hn(e){return e===\"request\"?\"PIV request\":\"PIV response\"}function xf(e,t,s,i=yt){if(e.byteOffset%yt!==0)throw new Error(`${hn(s)} buffer base is not ${yt}-byte aligned (byteOffset ${e.byteOffset}).`);if(t&&t.length>0&&t.byteOffset%i!==0)throw new Error(`${hn(s)} payload arena base is not ${i}-byte aligned (byteOffset ${t.byteOffset}).`)}function Gf(e=[],t=Mf){let s=[],i=[],r=0,o=yt;for(let E of e){let l=t(E,r);r=ai(l.buffer)+Rn(l.buffer),o=Math.max(o,Oe(l.buffer)),s.push(l.buffer),i.push(l)}let a=new Uint8Array(r);for(let E of i)a.set(E.payload,ai(E.buffer));return{frames:s,arena:a,arenaAlignment:o}}function Yf(e={}){return e.offset!==void 0||e.OFFSET!==void 0}function kf(e={},t){let s=et(e.payload),i=En(e,\"SDS PIV/TAB external frame forwarding\");i&&t&&ci(t,i.arena,\"SDS PIV/TAB external arena\");let{typeRef:r,wireFormat:o}=Sn(e),a=An(e,r.REQUIRED_ALIGNMENT),E=z(Y(e.offset,e.OFFSET),\"SDS PIV/TAB external arena frame offset\",{defaultValue:0,maximum:ot});!Yf(e)&&s&&t&&s.buffer===t.buffer&&(E=s.byteOffset-t.byteOffset);let l=z(Y(e.size,e.SIZE,e.byteLength,s?.byteLength),\"SDS PIV/TAB external arena frame size\",{defaultValue:0,maximum:ot});if(hi(E,l,\"SDS PIV/TAB external arena frame\"),bn(o,r,l),l>0&&t){if(E>t.length||l>t.length-E)throw new Error(\"SDS PIV external arena frame range exceeds externalArena.\");let _=t.byteOffset+E;if(a>1&&_%a!==0)throw new Error(`SDS PIV external arena frame \"${e.portId??\"\"}\" is misaligned: absolute offset ${_} violates alignment ${a}.`)}return new kt(E,l,a,Ei(o),r,li(e.mutability),_i(e.ownership),Te(e),e.portId??null)}function qf(e=[],t){let s=et(t);if(!s)throw new TypeError(\"SDS PIV external arena encoding requires externalArena bytes.\");let i=yt;return{frames:e.map(o=>{let a=kf(o,s);return i=Math.max(i,Oe(a)),a}),arena:new Uint8Array,arenaAlignment:i,externalArena:s}}function jf(e){if(!e)return null;let t=e.schemaHashArray?.()??new Uint8Array;return{schemaName:e.SCHEMA_NAME()??null,fileIdentifier:e.FILE_IDENTIFIER()??null,schemaVersion:e.SCHEMA_VERSION()??null,schemaHash:t.byteLength>0?new Uint8Array(t):void 0,acceptsAnyFlatbuffer:e.ACCEPTS_ANY_FLATBUFFER?.()===!0,wireFormat:ln(e.WIRE_FORMAT()),rootTypeName:e.ROOT_TYPE()??null,fixedStringLength:z(e.FIXED_STRING_LENGTH(),\"SDS PIV/TAB decoded fixedStringLength\",{defaultValue:0,maximum:te}),byteLength:z(e.BYTE_LENGTH(),\"SDS PIV/TAB decoded byteLength\",{defaultValue:0,maximum:ot}),requiredAlignment:z(e.REQUIRED_ALIGNMENT(),\"SDS PIV/TAB decoded requiredAlignment\",{defaultValue:0,maximum:te})}}function Kf(e){let t=e.typeRef;if(t&&t.wireFormat!==e.wireFormat)throw new Error(\"SDS PIV/TAB frame and typeRef wire formats disagree.\");let s=t?.requiredAlignment??0;if(s>0&&!we(s))throw new RangeError(\"SDS PIV/TAB decoded requiredAlignment must be a positive power of two.\");if(e.alignment<s)throw new RangeError(`SDS PIV/TAB frame alignment ${e.alignment} is below required alignment ${s}.`);if(e.wireFormat===\"aligned-binary\"){if(!t)throw new Error(\"SDS PIV/TAB aligned frame requires a typeRef.\");if(!we(s))throw new RangeError(\"SDS PIV/TAB aligned type requiredAlignment must be a positive power of two.\");let i=Number(t.byteLength??0);if(i>0&&e.size!==i)throw new RangeError(`SDS PIV/TAB aligned payload size ${e.size} does not match declared byteLength ${i}.`)}}function Wf(e){if(!e)return null;let t=oi(e.OFFSET()),s=oi(e.SIZE()),i=Oe({ALIGNMENT:e.ALIGNMENT()}),r=ln(e.WIRE_FORMAT()),o=qt(e.FRAME_ID()),a=Hf(o),E={typeRef:jf(e.TYPE_REF()),portId:e.PORT_ID()??null,alignment:i,offset:t,size:s,ownership:dn(e.OWNERSHIP()),generation:0,mutability:_n(e.MUTABILITY()),frameId:o,traceId:o,streamId:0,sequence:a.sequence,endOfStream:a.endOfStream,wireFormat:r};return Kf(E),E}function $f(e,t){let s=[];for(let i=0;i<e;i++){let r=Wf(t(i));r&&s.push(r)}return s}function Zf(e,t={}){let s=et(t.externalArena),i=e.length>0?e:s??e;if(!t.arenaLease)return Ff(i);let r=ui(t.arenaLease);if(r.closed)throw new Error(\"SDS PIV/TAB decoded arena lease is closed.\");return ci(i,r.arena,\"SDS PIV/TAB decoded arena\"),t.arenaLease}function Qf(e=[],t,s={}){let i=et(s.externalArena),r=s.arenaLease,o=r?ui(r).generation:void 0;return e.map(a=>{let E=ai(a),l=Rn(a),_=t.length>0?t:i,p=t.length>0?\"PAYLOAD_ARENA\":\"external arena\";if(hi(E,l,\"SDS PIV/TAB decoded frame\"),l>0&&!_)throw new Error(\"SDS PIV external arena bytes are required when PAYLOAD_ARENA is empty.\");if(_&&(E>_.length||l>_.length-E))throw new Error(`SDS PIV TAB payload range exceeds ${p}.`);let O=Oe(a);if(_&&O>1&&l>0){let w=_.byteOffset+E;if(w%O!==0)throw new Error(`SDS PIV TAB \"${a.portId??\"\"}\" payload is misaligned: absolute offset ${w} violates alignment ${O}.`)}let A=_?_.subarray(E,E+l):new Uint8Array;return{...a,payload:A,typeRef:a.typeRef??null,arenaLease:r,arenaGeneration:o,generation:o}})}function zf(e,t){return t.map(s=>s.pack(e))}function wn(e,t={}){let s=Pf(e);if(!K.bufferHasIdentifier(s))throw new Error(\"SDS PIV invoke request buffer identifier mismatch.\");let r=K.getRootAsPIV(s).REQUEST();if(!r)throw new Error(\"SDS PIV invoke envelope does not contain a request.\");let o=r.payloadArenaArray()??new Uint8Array,a=$f(r.inputsLength(),_=>r.INPUTS(_)),E=Zf(o,t),l=Qf(a,o,{...t,arenaLease:E});return{methodId:r.METHOD_ID()??null,inputFrames:l,inputs:l,payloadArena:o,arenaLease:E,traceId:r.TRACE_ID()??BigInt(0),outputStreamCap:r.OUTPUT_STREAM_CAP()??0,envelope:\"PIV\"}}function Xf(e={}){return e.status!==void 0?e.status:e.yielded===!0?It.YIELDED:Number(e.statusCode??0)!==0||e.errorCode?It.FAILED:It.OK}function di(e={}){let t=Array.isArray(e.outputs)?e.outputs:e.outputFrames??[],{frames:s,arena:i,arenaAlignment:r}=e.externalArena!==void 0?qf(t,e.externalArena):Gf(t),o=new zt(1024),a=e.errorCode!==null&&e.errorCode!==void 0?o.createString(String(e.errorCode)):0,E=e.errorMessage!==null&&e.errorMessage!==void 0?o.createString(String(e.errorMessage)):0,l=B.createOutputsVector(o,zf(o,s)),_=Vf(o,i,r);B.startPIVResponse(o),B.addStatusCode(o,Number(e.statusCode??0)),B.addStatus(o,Xf(e)),B.addYielded(o,e.yielded===!0),B.addBacklogRemaining(o,oi(e.backlogRemaining)),B.addOutputs(o,l),B.addPayloadArena(o,_),B.addErrorCode(o,a),B.addErrorMessage(o,E),B.addTraceId(o,qt(e.traceId));let p=B.endPIVResponse(o);K.startPIV(o),K.addResponse(o,p),K.finishPIVBuffer(o,K.endPIV(o));let O=o.asUint8Array(),A=K.getRootAsPIV(new _t(O));return xf(O,A.RESPONSE()?.payloadArenaArray(),\"response\",r),O}var Tn=Object.freeze({Inline:0,Ref:1}),On=Object.freeze({Duplicates:0,None:1,Current:2}),me=Object.freeze({Stream:0,Rows:1,Auto:2}),Ol=Object.freeze({Default:0,Ed25519:1,Secp256k1:2,Secp256k1Digest:3,X25519:4,Sha256:5,Sha512:6,Aes256Gcm:7,HkdfSha256:8});var Kl=Object.freeze({TimerTick:\"TICK\",HttpRequest:\"HREQ\",HttpResponse:\"HRSP\",ModuleConfig:\"MCFG\",IngestRequest:\"INGQ\",IngestResult:\"INGR\",FlowNotice:\"FNTC\"});function Jf(e){let t=e instanceof Uint8Array?e:new Uint8Array(e);return t.length<8?\"\":String.fromCharCode(t[4],t[5],t[6],t[7])}var th=e=>e==null?\"\":String(e);function eh(e,t){let s=new Wt(256);return t(s,e.pack(s)),s.asUint8Array().slice()}function sh(e,t){let s=new $t(String(e));if(typeof t==\"string\")s.KIND=W.String,s.STRING_VALUE=t;else if(typeof t==\"number\"||typeof t==\"bigint\")s.KIND=W.Number,s.NUMBER_VALUE=Number(t);else if(typeof t==\"boolean\")s.KIND=W.Bool,s.BOOL_VALUE=t;else if(Array.isArray(t))if(t.every(i=>typeof i==\"number\"))s.KIND=W.NumberList,s.NUMBERS=t.map(Number);else if(t.every(i=>i&&typeof i==\"object\"&&!Array.isArray(i)))s.KIND=W.TableList,s.TABLES=t.map(i=>new Mt(pi(i)));else if(t.every(i=>typeof i==\"string\"))s.KIND=W.StringList,s.STRINGS=t.slice();else throw new Error(`ModuleConfig: ${e} mixes value kinds`);else if(t&&typeof t==\"object\")s.KIND=W.TableList,s.TABLES=[new Mt(pi(t))];else throw new Error(`ModuleConfig: ${e} has no config value kind (${t===null?\"null\":typeof t})`);return s}var pi=e=>Object.keys(e||{}).filter(t=>e[t]!==void 0).sort().map(t=>sh(t,e[t]));function yn(e={}){return eh(new Zt(pi(e)),Vt.finishModuleConfigBuffer)}var ih={duplicates:Ft.Duplicates,none:Ft.None,current:Ft.Current},Wl=Object.fromEntries(Object.entries(ih).map(([e,t])=>[t,e]));var rh={unchanged:Rt.Unchanged,skipped:Rt.Skipped,missing:Rt.Missing,expired:Rt.Expired,info:Rt.Info},$l=Object.fromEntries(Object.entries(rh).map(([e,t])=>[t,e]));var mn=\"HostOps.fbs\";function ee(e){let t=xt[e];if(typeof t!=\"function\"||!t.SIZE)throw new Error(`hostcall: ${e} is not a HostOps record`);return t}var Nn=e=>e[0].toLowerCase()+e.slice(1);function nh(e){let t=Object.getOwnPropertyNames(e.prototype);return t.filter(s=>s.startsWith(\"set\")&&!s.startsWith(\"setHas\")&&!s.endsWith(\"Length\")&&!s.endsWith(\"At\")).map(s=>s.slice(3)).concat(t.filter(s=>s.startsWith(\"set\")&&s.endsWith(\"At\")&&!s.startsWith(\"setHas\")).map(s=>s.slice(3,-2)))}function Si(e,t,s,i){for(let[r,o]of Object.entries(s||{})){if(o==null)continue;let a=e.prototype,E=Nn(r);if(typeof a[`set${r}At`]==\"function\"){if(t[`set${r}Length`](o.length),o.forEach((l,_)=>t[`set${r}At`](_,l)),typeof a[`setHas${r}`]==\"function\"&&t[`setHas${r}`](!0),t[`${E}Length`]()!==o.length)throw new RangeError(`${i}.${r}: ${o.length} items exceed the record's bound`);continue}if(typeof a[`set${r}`]!=\"function\"){if(typeof a[E]==\"function\"&&typeof o==\"object\"){let l=t[E]();Si(l.constructor,l,o,`${i}.${r}`),typeof a[`setHas${r}`]==\"function\"&&t[`setHas${r}`](!0);continue}throw new Error(`${i}: no field ${r}`)}if(typeof a[`setHas${r}`]==\"function\"&&t[`setHas${r}`](!0),t[`set${r}`](typeof o==\"number\"&&typeof t[E]()==\"bigint\"?BigInt(o):o),typeof o==\"string\"&&t[E]()!==o)throw new RangeError(`${i}.${r}: \"${o.slice(0,40)}...\" exceeds the record's ${new TextEncoder().encode(t[E]()).length}-byte string`)}}function Dn(e,t){let s={};for(let i of nh(e)){let r=Nn(i);if(typeof t[`has${i}`]==\"function\"&&!t[`has${i}`]()){s[i]=typeof t[`${r}Length`]==\"function\"?[]:null;continue}if(typeof t[`${r}Length`]==\"function\"){s[i]=Array.from({length:t[`${r}Length`]()},(o,a)=>t[`${r}At`](a));continue}s[i]=t[r]()}for(let i of Object.getOwnPropertyNames(e.prototype)){if(i.startsWith(\"has\")||i.startsWith(\"set\")||i===\"constructor\")continue;let r=i[0].toUpperCase()+i.slice(1);r in s||typeof e.prototype[`setHas${r}`]!=\"function\"||(s[r]=t[`has${r}`]()?Dn(t[i]().constructor,t[i]()):null)}return s}function oh(e,t){let s=ee(e),i=new Uint8Array(s.SIZE);return Si(s,s.fromPointer(i.buffer,0),t,e),i}function ah(e,t){let s=ee(e),i=new Uint8Array(s.SIZE*t.length);return t.forEach((r,o)=>Si(s,s.fromPointer(i.buffer,o*s.SIZE),r,`${e}[${o}]`)),i}function fh(e,t){let s={},i={},r={};for(let o of e||[]){let a=o.portId??o.PORT_ID,E=o.typeRef||{},l=E.rootType??E.rootTypeName??E.ROOT_TYPE??null,_=o.payload instanceof Uint8Array?o.payload:new Uint8Array(o.payload||[]);if((o.wireFormat??E.wireFormat)===\"aligned-binary\"&&l){let p=ee(l),O=_.slice();if(O.length%p.SIZE)throw new RangeError(`${t}: ${a} is ${O.length} bytes, not a whole number of ${l} (${p.SIZE})`);let A=Array.from({length:O.length/p.SIZE},(w,R)=>Dn(p,p.fromPointer(O.buffer,R*p.SIZE)));Number(E.byteLength??0)>0?s[a]={type:l,value:A[0]??null}:i[a]={type:l,values:A}}else r[a]=_.slice()}return{records:s,lists:i,raw:r}}var hh=e=>typeof e==\"string\"?new TextEncoder().encode(e):e instanceof Uint8Array?e:new Uint8Array(e);function ch(e,{record:t,recordPort:s,recordType:i,raw:r={},lists:o={}},a,E,l){let _=[];if(t!=null){if(!i)throw new Error(`${l}: takes no ${s} record`);let p=ee(i);_.push({portId:s,wireFormat:\"aligned-binary\",typeRef:{schemaName:mn,rootType:i,wireFormat:\"aligned-binary\",byteLength:p.SIZE,requiredAlignment:p.ALIGN},payload:oh(i,t)})}for(let[p,O]of Object.entries(o)){let A=E[p];if(!A)throw new Error(`${l}: no list port ${p}`);let w=ee(A);_.push({portId:p,wireFormat:\"aligned-binary\",typeRef:{schemaName:mn,rootType:A,wireFormat:\"aligned-binary\",byteLength:0,requiredAlignment:w.ALIGN},payload:ah(A,O)})}for(let[p,O]of Object.entries(r)){if(!a.includes(p))throw new Error(`${l}: no raw port ${p}`);_.push({portId:p,payload:hh(O)})}return _}function Ln(e){let t=wn(e),s=t.methodId??\"\",{records:i,lists:r,raw:o}=fh(t.inputs,s),a=se[s];if(a&&i.params&&i.params.type!==a.params)throw new Error(`hostcall: ${s} takes ${a.params}, the frame carries ${i.params.type}`);return{op:s,params:i.params?.value??null,lists:Object.fromEntries(Object.entries(r).map(([E,l])=>[E,l.values])),raw:o}}var Cn=Object.freeze({null:0,bool:1,i64:2,f64:3,str:4,bytes:5}),uh=Object.fromEntries(Object.entries(Cn).map(([e,t])=>[t,e]));function Un(e){let t=(e||[]).map(o=>{let a=o&&typeof o==\"object\"&&!(o instanceof Uint8Array)&&\"t\"in o?o:null,E=a?a.t:o==null?\"null\":typeof o==\"boolean\"?\"bool\":typeof o==\"bigint\"?\"i64\":typeof o==\"number\"?Number.isInteger(o)?\"i64\":\"f64\":typeof o==\"string\"?\"str\":o instanceof Uint8Array?\"bytes\":null,l=a?a.v:o,_;switch(E){case\"null\":_=new Uint8Array(0);break;case\"bool\":_=Uint8Array.of(l?1:0);break;case\"i64\":_=new Uint8Array(8),new DataView(_.buffer).setBigInt64(0,BigInt(l),!0);break;case\"f64\":_=new Uint8Array(8),new DataView(_.buffer).setFloat64(0,Number(l),!0);break;case\"str\":_=new TextEncoder().encode(String(l));break;case\"bytes\":_=l instanceof Uint8Array?l:new Uint8Array(l);break;default:throw new TypeError(`SQL value ${String(o)} has no FlatSQL parameter tag`)}return[Cn[E],_]}),s=new Uint8Array(t.reduce((o,[,a])=>o+5+a.length,0)),i=new DataView(s.buffer),r=0;for(let[o,a]of t)s[r]=o,i.setUint32(r+1,a.length,!0),s.set(a,r+5),r+=5+a.length;return s}function Pn(e){let t=e instanceof Uint8Array?e:new Uint8Array(e||[]),s=new DataView(t.buffer,t.byteOffset,t.byteLength),i=[],r=0;for(;r<t.length;){if(r+5>t.length)throw new RangeError(\"SQL values: truncated value header\");let o=t[r],a=s.getUint32(r+1,!0),E=r+5;if(E+a>t.length)throw new RangeError(\"SQL values: payload exceeds the buffer\");let l=uh[o],_={null:0,bool:1,i64:8,f64:8}[l];if(l===void 0)throw new RangeError(`SQL values: unknown tag ${o}`);if(_!==void 0&&a!==_)throw new RangeError(`SQL values: a ${l} carries ${_} bytes, not ${a}`);let p=t.subarray(E,E+a);i.push({t:l,v:l===\"null\"?null:l===\"bool\"?p[0]!==0:l===\"i64\"?s.getBigInt64(E,!0):l===\"f64\"?s.getFloat64(E,!0):l===\"str\"?new TextDecoder().decode(p):p.slice()}),r=E+a}return i}var Eh=Object.freeze([\"unsupported\",\"not-authorized\",\"invalid-params\",\"failed\",\"refused\",\"sandbox\",\"timeout\",\"too-large\"]);function Ai(e){if(e?.ok){let s=se[e.op];if(!s)throw new Error(`hostcall: unknown operation ${e.op}`);let i=ch(s,{record:e.result,recordPort:\"result\",recordType:s.result,raw:e.raw,lists:e.lists},s.rawOut,s.listsOut,`${e.op} result`);return di({statusCode:0,outputs:i})}let t=e?.error?.code??\"failed\";if(!Eh.includes(t))throw new Error(`hostcall: unknown error code ${t}`);return di({statusCode:1,status:\"FAILED\",errorCode:t,errorMessage:th(e?.error?.message)})}function vn(e){return Jf(e)===\"$PIV\"}var I=(e,t,s,i={})=>Object.freeze({params:e,result:t,capability:s,rawIn:Object.freeze(i.rawIn||[]),rawOut:Object.freeze(i.rawOut||[]),listsIn:Object.freeze(i.listsIn||{}),listsOut:Object.freeze(i.listsOut||{})}),lh=[\"data\",\"key\",\"private_key\",\"public_key\",\"signature\",\"nonce\",\"aad\",\"ikm\",\"salt\",\"info\",\"envelope\"],_h=[\"data\",\"nonce\",\"private_key\",\"public_key\"],L=(e,t)=>I(\"CryptoParams\",e,t,{rawIn:lh,rawOut:_h}),gn={rawOut:[\"stream\"]},Ii={rawIn:[\"sql\",\"params\"]},se=Object.freeze({\"host.runtimeTarget\":I(null,null,null,{rawOut:[\"value\"]}),\"host.listCapabilities\":I(null,null,null,{listsOut:{items:\"TextValue\"}}),\"host.listSupportedCapabilities\":I(null,null,null,{listsOut:{items:\"TextValue\"}}),\"host.listOperations\":I(null,null,null,{listsOut:{items:\"TextValue\"}}),\"host.hasCapability\":I(\"HasCapabilityParams\",\"BoolValue\",null),\"clock.now\":I(null,\"TimeValue\",\"clock\"),\"clock.nowIso\":I(null,null,\"clock\",{rawOut:[\"value\"]}),\"clock.monotonicNow\":I(null,\"NumberValue\",\"clock\"),\"random.bytes\":I(\"RandomBytesParams\",null,\"random\",{rawOut:[\"data\"]}),\"node.publicKey\":I(null,null,null,{rawOut:[\"value\"]}),\"node.peerId\":I(null,null,null,{rawOut:[\"value\"]}),\"plugin.getConfig\":I(null,null,null,{rawOut:[\"config\"]}),\"http.request\":I(\"HttpParams\",\"HttpResult\",\"http\",{rawIn:[\"url\",\"headers\",\"body\"],rawOut:[\"url\",\"headers\",\"body\"]}),\"websocket.exchange\":I(\"WebsocketParams\",\"WebsocketResult\",\"websocket\",{rawIn:[\"url\",\"protocols\",\"message\"],rawOut:[\"url\",\"body\"]}),\"mqtt.publish\":I(\"MqttParams\",\"MqttResult\",\"mqtt\",{rawIn:[\"payload\",\"password\"]}),\"mqtt.subscribeOnce\":I(\"MqttParams\",\"MqttResult\",\"mqtt\",{rawIn:[\"password\"],rawOut:[\"body\"]}),\"tcp.request\":I(\"SocketParams\",\"SocketResult\",\"tcp\",{rawIn:[\"data\"],rawOut:[\"body\"]}),\"udp.request\":I(\"SocketParams\",\"SocketResult\",\"udp\",{rawIn:[\"data\"],rawOut:[\"body\"]}),\"tls.request\":I(\"SocketParams\",\"SocketResult\",\"tls\",{rawIn:[\"data\",\"ca\",\"cert\",\"key\"],rawOut:[\"body\"]}),\"storage.query\":I(\"StorageQueryParams\",null,\"storage_query\",{listsOut:{records_meta:\"StoredRecordMeta\"},rawOut:[\"records\"]}),\"storage.write\":I(\"StorageWriteParams\",\"StorageWriteResult\",\"storage_write\",{rawIn:[\"data\"]}),\"storage.delete\":I(\"StorageDeleteParams\",null,\"storage_write\"),\"storage.expire\":I(\"StorageExpireParams\",\"StorageExpireResult\",\"storage_write\"),\"storage.ingest_with_source\":I(\"StorageIngestParams\",\"StorageIngestResult\",\"storage_ingest\",{rawIn:[\"records\",\"archive\"],listsIn:{provenance:\"Provenance\",provenance_attributes:\"ProvenanceAttribute\"}}),\"storage.flatsql_query_stream\":I(\"SqlStreamParams\",\"StreamResult\",\"storage_query\",{...Ii,...gn}),\"storage.flatsql_epoch_stream\":I(\"EpochStreamParams\",\"StreamResult\",\"storage_query\",gn),\"storage.query_sandboxed\":I(\"SandboxQueryParams\",\"SandboxQueryResult\",\"storage_query\",{...Ii,rawOut:[\"stream\",\"cells\"],listsOut:{columns:\"TextValue\"}}),\"storage.query_surface\":I(null,\"QuerySurfaceLimits\",\"storage_query\",{listsOut:{tables:\"SurfaceTable\",columns:\"SurfaceColumn\"}}),\"storage.flatsql_cache_key\":I(\"CacheKeyParams\",null,\"storage_query\",{...Ii,listsIn:{projection:\"TextValue\"},rawOut:[\"value\"]}),\"crypto.hash\":L(null,\"crypto_hash\"),\"crypto.sign\":L(null,\"crypto_sign\"),\"crypto.verify\":L(\"BoolValue\",\"crypto_verify\"),\"crypto.encrypt\":L(null,\"crypto_encrypt\"),\"crypto.decrypt\":L(null,\"crypto_decrypt\"),\"crypto.key_agreement\":L(null,\"crypto_key_agreement\"),\"crypto.kdf\":L(null,\"crypto_kdf\"),\"crypto.generate_key\":L(null,\"crypto_sign\"),\"crypto.random\":L(null,\"crypto_hash\"),\"crypto.ed25519.publicKeyFromSeed\":L(null,\"crypto_sign\"),\"crypto.ed25519.sign\":L(null,\"crypto_sign\"),\"crypto.ed25519.verify\":L(\"BoolValue\",\"crypto_verify\"),\"crypto.secp256k1.publicKeyFromPrivate\":L(null,\"crypto_sign\"),\"crypto.secp256k1.sign\":L(null,\"crypto_sign\"),\"crypto.secp256k1.verify\":L(\"BoolValue\",\"crypto_verify\"),\"crypto.sha256\":L(null,\"crypto_hash\"),\"crypto.sha512\":L(null,\"crypto_hash\"),\"crypto.hkdf\":L(null,\"crypto_kdf\"),\"crypto.aesGcmEncrypt\":L(null,\"crypto_encrypt\"),\"crypto.aesGcmDecrypt\":L(null,\"crypto_decrypt\"),\"crypto.x25519.generateKeypair\":L(null,\"crypto_key_agreement\"),\"crypto.x25519.publicKey\":L(null,\"crypto_key_agreement\"),\"crypto.x25519.sharedSecret\":L(null,\"crypto_key_agreement\"),\"crypto.sealedBox.encryptForRecipient\":L(null,\"crypto_encrypt\"),\"crypto.sealedBox.decryptFromEnvelope\":L(null,\"crypto_decrypt\"),\"crypto.secp256k1.signDigest\":L(null,\"crypto_sign\"),\"crypto.secp256k1.verifyDigest\":L(\"BoolValue\",\"crypto_verify\"),\"keyslot.sign\":I(\"KeyslotParams\",null,\"wallet_sign\",{rawIn:[\"payload\"],rawOut:[\"data\"]}),\"keyslot.unwrap\":I(\"KeyslotParams\",null,\"wallet_sign\",{rawIn:[\"ephemeral_public_key\",\"nonce\",\"ciphertext\"],rawOut:[\"data\"]}),\"secrets.get\":I(\"SecretParams\",\"SecretResult\",\"secrets\",{rawOut:[\"secret\"]}),\"secrets.status\":I(\"SecretParams\",\"SecretResult\",\"secrets\"),\"secrets.put\":I(\"SecretParams\",\"SecretResult\",\"secrets\",{rawIn:[\"secret\"]}),\"secrets.clear\":I(\"SecretParams\",null,\"secrets\"),\"ipfs.add\":I(\"IpfsParams\",\"IpfsResult\",\"ipfs\",{rawIn:[\"data\"]}),\"ipfs.cat\":I(\"IpfsParams\",null,\"ipfs\",{rawOut:[\"data\"]}),\"ipfs.ls\":I(\"IpfsParams\",null,\"ipfs\",{listsOut:{links:\"IpfsLink\"}}),\"ipfs.pin_add\":I(\"IpfsParams\",null,\"ipfs\",{listsOut:{items:\"TextValue\"}}),\"ipfs.pin_rm\":I(\"IpfsParams\",null,\"ipfs\",{listsOut:{items:\"TextValue\"}}),\"ipfs.pin_ls\":I(\"IpfsParams\",null,\"ipfs\",{listsOut:{pins:\"IpfsPin\"}}),\"ipfs.dag_get\":I(\"IpfsParams\",null,\"ipfs\",{rawOut:[\"data\"]}),\"ipfs.name_resolve\":I(\"IpfsParams\",\"IpfsResult\",\"ipfs\"),\"ipfs.name_publish\":I(\"IpfsParams\",\"IpfsResult\",\"ipfs\"),\"ipfs.id\":I(null,\"IpfsResult\",\"ipfs\",{listsOut:{addresses:\"TextValue\"}}),\"ipfs.swarm_peers\":I(null,null,\"ipfs\",{listsOut:{peers:\"IpfsSwarmPeer\"}}),\"ipfs.pubsub_publish\":I(\"PubsubParams\",null,\"ipfs\",{rawIn:[\"data\"]}),\"pubsub.publish\":I(\"PubsubParams\",null,\"pubsub\",{rawIn:[\"data\"]}),\"pubsub.subscribe\":I(\"PubsubParams\",\"PubsubSubscribed\",\"pubsub\"),\"pubsub.unsubscribe\":I(\"PubsubParams\",null,\"pubsub\"),\"pubsub.list_topics\":I(null,null,\"pubsub\",{listsOut:{items:\"TextValue\"}}),\"protocol.request\":I(\"ProtocolParams\",null,\"protocol_dial\",{rawIn:[\"payload\"],rawOut:[\"data\"]}),\"protocol_dial.dial\":I(\"ProtocolParams\",null,\"protocol_dial\"),\"protocol_handle.register\":I(\"ProtocolParams\",null,\"protocol_handle\"),\"protocol_handle.unregister\":I(\"ProtocolParams\",null,\"protocol_handle\"),\"p2p.peers_snapshot\":I(\"P2pParams\",\"P2pSummary\",\"p2p_read\",{listsOut:{peers:\"P2pPeer\",peer_addresses:\"P2pPeerValue\",peer_standards:\"P2pPeerValue\"},rawOut:[\"records\"]}),\"p2p.standards_snapshot\":I(\"P2pParams\",null,\"p2p_read\",{listsOut:{entries:\"P2pPnmEntry\"},rawOut:[\"records\"]}),\"p2p.pnm_history\":I(\"P2pParams\",\"P2pSummary\",\"p2p_read\",{listsOut:{entries:\"P2pPnmEntry\"},rawOut:[\"records\"]}),\"p2p.latest_dataset\":I(\"P2pParams\",\"P2pLatestDataset\",\"p2p_read\",{rawOut:[\"stream\"]}),\"node_status_read.status\":I(null,\"NodeStatusReport\",\"node_status_read\",{listsOut:{bandwidth_history:\"NodeBandwidthSample\"}}),\"node_activity_read.activity\":I(\"NodeActivityParams\",null,\"node_activity_read\",{listsOut:{events:\"NodeActivityEvent\"}}),\"timers.delay\":I(\"TimersDelayParams\",null,\"timers\"),\"schedule.parse\":I(\"ScheduleParams\",null,\"schedule_cron\",{listsOut:{fields:\"CronField\"}}),\"schedule.matches\":I(\"ScheduleParams\",\"BoolValue\",\"schedule_cron\"),\"schedule.next\":I(\"ScheduleParams\",\"TimeValue\",\"schedule_cron\"),\"filesystem.resolvePath\":I(null,null,\"filesystem\",{rawIn:[\"path\"],rawOut:[\"path\"]}),\"filesystem.readFile\":I(null,null,\"filesystem\",{rawIn:[\"path\"],rawOut:[\"data\"]}),\"filesystem.writeFile\":I(null,null,\"filesystem\",{rawIn:[\"path\",\"data\"]}),\"filesystem.appendFile\":I(null,null,\"filesystem\",{rawIn:[\"path\",\"data\"]}),\"filesystem.deleteFile\":I(null,null,\"filesystem\",{rawIn:[\"path\"]}),\"filesystem.mkdir\":I(\"FsParams\",null,\"filesystem\",{rawIn:[\"path\"]}),\"filesystem.readdir\":I(null,null,\"filesystem\",{rawIn:[\"path\"],listsOut:{entries:\"FsEntry\"}}),\"filesystem.stat\":I(null,\"FsStat\",\"filesystem\",{rawIn:[\"path\"],rawOut:[\"path\"]}),\"filesystem.rename\":I(null,null,\"filesystem\",{rawIn:[\"path\",\"to_path\"]}),\"exec.execFile\":I(\"ExecParams\",\"ExecResult\",\"process_exec\",{rawIn:[\"file\",\"cwd\",\"input\"],listsIn:{args:\"TextValue\",env:\"EnvVar\"},rawOut:[\"stdout\",\"stderr\"]}),\"context.get\":I(\"ContextParams\",\"BoolValue\",\"context_read\",{rawOut:[\"value\"]}),\"context.listKeys\":I(\"ContextParams\",null,\"context_read\",{listsOut:{items:\"TextValue\"}}),\"context.listScopes\":I(null,null,\"context_read\",{listsOut:{items:\"TextValue\"}}),\"context.set\":I(\"ContextParams\",null,\"context_write\",{rawIn:[\"value\"]}),\"context.delete\":I(\"ContextParams\",\"BoolValue\",\"context_write\")});function dh(e){if(!Number.isInteger(e)||e<0||e>255)throw new TypeError(\"Expected byte values in range 0..255.\")}function Ih(e){if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(Array.isArray(e))return e.forEach(dh),Uint8Array.from(e);throw new TypeError(\"Expected Uint8Array, ArrayBuffer, ArrayBufferView, or byte array.\")}function Bn(e){return Buffer.from(Ih(e)).toString(\"base64\")}var Hn=256*1024*1024;function Mn(e){let t=String(e??\"\").trim();if(t.length>Hn)throw new RangeError(`Base64 input exceeds ${Hn} character limit.`);return new Uint8Array(Buffer.from(t,\"base64\"))}var ph=new TextDecoder,qn=new TextEncoder,U=e=>e===void 0?void 0:ph.decode(e),at=e=>e==null?void 0:e instanceof Uint8Array?e:typeof e==\"string\"?qn.encode(e):new Uint8Array(e),ie=e=>(e||[]).map(t=>({VALUE:String(t)})),Fn=e=>BigInt(Math.round(e instanceof Date?e.getTime():Number(e))),jn=e=>e.toLowerCase().replace(/_([a-z0-9])/g,(t,s)=>s.toUpperCase()),Sh=e=>e.replace(/([a-z0-9])([A-Z])/g,\"$1_$2\").toUpperCase();function De(e){let t={};for(let[s,i]of Object.entries(e||{}))i==null||i===\"\"||i===0||i===0n||i===!1||(t[jn(s)]=typeof i==\"bigint\"?Number(i):i);return t}function Le(e,t){if(!e||!t||typeof t!=\"object\")return null;let s={};for(let[i,r]of Object.entries(t))r==null||r instanceof Uint8Array||typeof r==\"object\"||(s[Sh(i)]=r);return Ah(e,s)}function Ah(e,t){let s=xt[e]?.prototype;return s?Object.fromEntries(Object.entries(t).filter(([i])=>typeof s[`set${i}`]==\"function\")):t}function bh(e){if(!e)return;let t={};for(let s of U(e).split(/\\r?\\n/)){let i=s.indexOf(\":\");i>0&&(t[s.slice(0,i).trim()]=s.slice(i+1).trim())}return t}function Rh(e){return e?(typeof e.entries==\"function\"&&!(e instanceof Map)&&!Array.isArray(e)?Array.from(e.entries()):e instanceof Map?Array.from(e):Object.entries(e)).map(([s,i])=>`${s}: ${Array.isArray(i)?i.join(\", \"):i}`).join(`\\r\n`):void 0}var bi=16;function wh(e){if(!e||e.length<bi)throw Object.assign(new Error(\"AES-GCM data is shorter than its 16-byte tag\"),{hostcallCode:\"invalid-params\"});return{ciphertext:e.subarray(0,e.length-bi),tag:e.subarray(e.length-bi)}}var Th=(e,t)=>{let s=new Uint8Array(e.length+t.length);return s.set(e,0),s.set(t,e.length),s},ft=(e,t=\"failed\")=>Object.assign(new Error(e),{hostcallCode:t}),y=e=>e==null?\"\":String(e);function pt(e){if(e==null||e===\"\")return;if(e instanceof Date)return BigInt(Number.isFinite(e.getTime())?e.getTime():0);if(typeof e==\"bigint\")return e;if(typeof e==\"number\")return BigInt(Number.isFinite(e)?Math.trunc(e):0);let t=Date.parse(String(e));return BigInt(Number.isFinite(t)?t:0)}var gi=(e,t)=>Object.keys(e).find(s=>e[s]===Number(t??0))??\"\",At=e=>e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?new Uint8Array(e):void 0,Vn=new Map;function Oh(e){let t=Vn.get(e);return t||Vn.set(e,t=e.fromPointer(new ArrayBuffer(e.SIZE),0)),t}function mh(e){if(typeof e==\"bigint\")return e;if(typeof e==\"boolean\")return e?1n:0n;if(typeof e==\"string\"&&/^-?\\d+$/.test(e.trim()))return BigInt(e.trim());let t=Number(e);return BigInt(Number.isFinite(t)?Math.trunc(t):0)}function Kn(e,t){let s=Oh(e),i=e.prototype,r={};for(let[o,a]of Object.entries(t||{})){if(a==null)continue;let E=o[0].toLowerCase()+o.slice(1);if(typeof i[`set${o}`]!=\"function\"){typeof i[E]==\"function\"&&typeof i[`setHas${o}`]==\"function\"&&typeof a==\"object\"&&(r[o]=Kn(s[E]().constructor,a));continue}let l=typeof s[E]();r[o]=l===\"bigint\"?mh(a):l===\"number\"?Number.isFinite(Number(a))?Number(a):0:l===\"boolean\"?a===!0||a===\"true\":String(a)}return r}var V=(e,t)=>Kn(xt[e],t);function ge(e,t){let s={};for(let[i,r]of Object.entries(t||{}))[\"string\",\"number\",\"boolean\",\"bigint\"].includes(typeof r)&&(s[i.toUpperCase()]=r);return V(e,s)}function St(e){let t={};for(let[s,i]of Object.entries(e||{}))i==null||i===\"\"||i===!1||i===0||i===0n||Array.isArray(i)&&i.length===0||(t[s.toLowerCase()]=typeof i==\"bigint\"?Number(i):i);return t}function gh(e){let t=new Uint8Array(e.reduce((r,o)=>r+4+o.length,0)),s=new DataView(t.buffer),i=0;for(let r of e)s.setUint32(i,r.length,!0),t.set(r,i+4),i+=4+r.length;return t}var xn=2**53;function yh(e){if(!e.params)return;let t;try{t=Pn(e.params)}catch(s){throw ft(`params: ${s.message}`,\"invalid-params\")}return t.map(({t:s,v:i})=>s===\"null\"?{t:s}:s===\"i64\"?{t:s,v:i>BigInt(xn)||i<-BigInt(xn)?i.toString():Number(i)}:{t:s,v:i})}var Nh=e=>gi(Tn,e?.DELIVER)===\"Ref\"?\"ref\":void 0;function Ni(e,t){delete e.deliver;let s=Nh(t);return s&&(e.deliver=s),e}function Ri({params:e,raw:t}){let s={sql:U(t.sql)??\"\"},i=yh(t);return i&&(s.params=i),Ni(s,e)}var Wn=e=>({TOKEN:e.token,SIZE:e.size,FRAMES:e.frames??-1,FNV1A64:y(e.fnv1a64)});function wi(e,t=\"StreamResult\"){let s={ROWS:e?.rows??0,COLUMNS:e?.columns??0},i={raw:{}};return e?.ref&&typeof e.ref==\"object\"?s.REF=Wn(e.ref):At(e?.stream)&&(i.raw.stream=At(e.stream)),i.result=V(t,s),i}function Dh(e){if(e==null)return{t:\"null\"};if(typeof e==\"boolean\")return{t:\"bool\",v:e};if(typeof e==\"number\")return Number.isInteger(e)?{t:\"i64\",v:BigInt(e)}:{t:\"f64\",v:e};if(typeof e==\"string\")return{t:\"str\",v:e};throw ft(`storage.query_sandboxed: a cell is a ${Array.isArray(e)?\"list\":typeof e} (nested values are not SQL values)`)}function yi(e,t){if(e!=null){if(typeof e==\"bigint\")return Number(e);if(Array.isArray(e))return e.filter(s=>s!=null).map((s,i)=>yi(s,`${t}.${i}`));if(typeof e==\"object\"){if(e instanceof Date||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)throw ft(`plugin.getConfig: ${t} is a ${e.constructor?.name??\"object\"}`);let s={};for(let i of Object.keys(e)){let r=yi(e[i],t?`${t}.${i}`:i);r!==void 0&&(s[i]=r)}return s}if(typeof e==\"string\"||typeof e==\"number\"||typeof e==\"boolean\")return e;throw ft(`plugin.getConfig: ${t} is a ${typeof e}`)}}function Lh(e){let t=yi(e??{},\"\")??{};if(Array.isArray(t)||typeof t!=\"object\")throw ft(\"plugin.getConfig: the config is not an object\");try{return yn(t)}catch(s){throw ft(`plugin.getConfig: ${s.message}`)}}function ye({params:e,raw:t}){let s={id:y(e?.ID)};return e?.USERNAME&&(s.username=e.USERNAME),t.secret&&(s.secret=U(t.secret)),s}function Gn(e){return{result:V(\"SecretResult\",{ID:y(e?.id),CONFIGURED:e?.configured===!0||e?.stored===!0,USERNAME_MASKED:y(e?.username_masked),UPDATED_MS:pt(e?.updated_at??e?.updatedAt)??0n,VERIFIED_MS:pt(e?.verified_at)??0n})}}function Yn(e){return t=>{if(t==null||t===\"\")throw ft(`node ${e} not available`);return{raw:{value:String(t)}}}}function kn(e){return V(\"P2pPnmEntry\",{PEER_ID:e.peer_id,PUBLISHER_PEER_ID:e.publisher_peer_id,GOSSIP_PEER_ID:e.gossip_peer_id,STANDARD:e.standard,SCHEMA:e.schema,FILE_ID:e.file_id,FILE_NAME:e.file_name,CID:e.cid,PUBLISH_MS:pt(e.publish_timestamp??e.publish_ms),SIGNATURE_TYPE:e.signature_type,SIGNATURE_HEX:e.signature??e.signature_hex,SIGNATURE_VERIFIED:e.signature_verified,ATTRIBUTION:e.attribution,PNM_INDEX:e.pnm_index??-1,PUBLISHER_KEY_HEX:e.publisher_key??e.publisher_key_hex,PUBLISHER_KEY_SOURCE:e.publisher_key_source})}var Ti=e=>At(e?.records)?{records:At(e.records)}:{},Ne=({params:e})=>Ni(St(e),e),Nt=e=>Array.isArray(e)?e.filter(t=>t&&typeof t==\"object\"):[],$n={\"host.runtimeTarget\":{out:e=>({raw:{value:String(e)}})},\"host.listCapabilities\":{out:e=>({lists:{items:ie(e)}})},\"host.listSupportedCapabilities\":{out:e=>({lists:{items:ie(e)}})},\"host.listOperations\":{out:e=>({lists:{items:ie(e)}})},\"host.hasCapability\":{in:({params:e})=>({capability:e?.CAPABILITY}),out:e=>({result:{VALUE:!!e}})},\"clock.now\":{out:e=>({result:{UNIX_MS:Fn(e)}})},\"clock.nowIso\":{out:e=>({raw:{value:String(e)}})},\"clock.monotonicNow\":{out:e=>({result:{VALUE:Number(e)}})},\"random.bytes\":{in:({params:e})=>({length:e?.LENGTH||32}),out:e=>({raw:{data:at(e)}})},\"timers.delay\":{in:({params:e})=>({ms:e?.MS??0}),out:()=>({})},\"schedule.parse\":{in:({params:e})=>({expression:e?.EXPRESSION}),out:e=>({lists:{fields:Object.entries(e||{}).filter(([,t])=>t&&typeof t==\"object\"&&Array.isArray(t.values)).map(([t,s])=>({NAME:t,SOURCE:String(s.source??\"\"),HAS_WILDCARD:!!s.hasWildcard,VALUES:s.values}))}})},\"schedule.matches\":{in:({params:e})=>({expression:e?.EXPRESSION,date:e?.AT_MS?new Date(Number(e.AT_MS)):new Date}),out:e=>({result:{VALUE:!!e}})},\"schedule.next\":{in:({params:e})=>({expression:e?.EXPRESSION,from:e?.AT_MS?new Date(Number(e.AT_MS)):new Date}),out:e=>({result:{UNIX_MS:Fn(e)}})},\"http.request\":{in:({params:e,raw:t})=>({url:U(t.url),method:e?.METHOD||\"GET\",headers:bh(t.headers),body:t.body,timeoutMs:e?.TIMEOUT_MS||void 0,responseType:\"bytes\",redirect:e?.NO_REDIRECTS?\"manual\":\"follow\",maxBytes:e?.MAX_BYTES?Number(e.MAX_BYTES):void 0}),out:(e,{params:t})=>{let s=at(e?.body)??new Uint8Array(0);if(t?.MAX_BYTES&&s.length>Number(t.MAX_BYTES))throw Object.assign(new Error(`HTTP body of ${s.length} bytes exceeds MAX_BYTES ${t.MAX_BYTES}`),{hostcallCode:\"too-large\"});return{result:{STATUS:e?.status??0,RETRIEVED_MS:BigInt(Date.now())},raw:{url:String(e?.url??\"\"),headers:Rh(e?.headers)??\"\",body:s}}}},\"websocket.exchange\":{in:({params:e,raw:t})=>({url:U(t.url),protocols:t.protocols?U(t.protocols).split(\",\").map(s=>s.trim()).filter(Boolean):void 0,message:t.message===void 0?void 0:e?.MESSAGE_IS_TEXT?U(t.message):t.message,timeoutMs:e?.TIMEOUT_MS||void 0,expectResponse:!e?.NO_RESPONSE,responseType:\"bytes\"}),out:e=>({result:{PROTOCOL:e?.protocol??\"\",EXTENSIONS:e?.extensions??\"\",CLOSE_CODE:e?.closeCode??-1,CLOSE_REASON:e?.closeReason??\"\",BODY_IS_TEXT:typeof e?.body==\"string\"},raw:{url:String(e?.url??\"\"),...e?.body==null?{}:{body:at(e.body)}}})},\"mqtt.publish\":{in:({params:e,raw:t})=>({...De(e),keepAliveSeconds:e?.KEEP_ALIVE_S||void 0,payload:t.payload,password:U(t.password)}),out:e=>({result:Le(\"MqttResult\",e)})},\"mqtt.subscribeOnce\":{in:({params:e,raw:t})=>({...De(e),keepAliveSeconds:e?.KEEP_ALIVE_S||void 0,password:U(t.password),responseType:\"bytes\"}),out:e=>({result:Le(\"MqttResult\",e),raw:e?.payload==null&&e?.body==null?{}:{body:at(e.payload??e.body)}})},\"tcp.request\":mi(),\"udp.request\":mi(),\"tls.request\":mi(({raw:e})=>({ca:U(e.ca),cert:U(e.cert),key:U(e.key)})),\"filesystem.resolvePath\":{in:({raw:e})=>({path:U(e.path)}),out:e=>({raw:{path:String(e)}})},\"filesystem.readFile\":{in:({raw:e})=>({path:U(e.path)}),out:e=>({raw:{data:at(e)}})},\"filesystem.writeFile\":{in:({raw:e})=>({path:U(e.path),value:e.data??new Uint8Array(0)}),out:()=>({})},\"filesystem.appendFile\":{in:({raw:e})=>({path:U(e.path),value:e.data??new Uint8Array(0)}),out:()=>({})},\"filesystem.deleteFile\":{in:({raw:e})=>({path:U(e.path)}),out:()=>({})},\"filesystem.mkdir\":{in:({params:e,raw:t})=>({path:U(t.path),recursive:!e?.NOT_RECURSIVE}),out:()=>({})},\"filesystem.readdir\":{in:({raw:e})=>({path:U(e.path)??\".\"}),out:e=>({lists:{entries:(e||[]).map(t=>({NAME:t.name,IS_FILE:!!t.isFile,IS_DIRECTORY:!!t.isDirectory}))}})},\"filesystem.stat\":{in:({raw:e})=>({path:U(e.path)}),out:e=>({result:{SIZE:BigInt(e?.size??0),IS_FILE:!!e?.isFile,IS_DIRECTORY:!!e?.isDirectory,CTIME_MS:Number(e?.ctimeMs??0),MTIME_MS:Number(e?.mtimeMs??0)},raw:{path:String(e?.path??\"\")}})},\"filesystem.rename\":{in:({raw:e})=>({fromPath:U(e.path),toPath:U(e.to_path)}),out:()=>({})},\"exec.execFile\":{in:({params:e,raw:t,lists:s})=>({file:U(t.file),args:(s.args||[]).map(i=>i.VALUE),cwd:U(t.cwd),input:t.input,env:s.env?Object.fromEntries(s.env.map(i=>[i.NAME,i.VALUE])):void 0,timeoutMs:e?.TIMEOUT_MS||void 0}),out:e=>({result:{EXIT_CODE:e?.exitCode??-1,SIGNAL:e?.signal??\"\"},raw:{stdout:at(e?.stdout)??new Uint8Array(0),stderr:at(e?.stderr)??new Uint8Array(0)}})},\"context.get\":{in:({params:e})=>({scope:e?.SCOPE,key:e?.KEY}),out:e=>({result:{VALUE:e!=null},raw:e==null?{}:{value:at(e)}})},\"context.set\":{in:({params:e,raw:t})=>({scope:e?.SCOPE,key:e?.KEY,value:t.value??new Uint8Array(0)}),out:()=>({})},\"context.delete\":{in:({params:e})=>({scope:e?.SCOPE,key:e?.KEY}),out:e=>({result:{VALUE:!!e}})},\"context.listKeys\":{in:({params:e})=>({scope:e?.SCOPE}),out:e=>({lists:{items:ie(e)}})},\"context.listScopes\":{out:e=>({lists:{items:ie(e)}})},\"crypto.sha256\":{in:({raw:e})=>({value:e.data??new Uint8Array(0)}),out:st},\"crypto.sha512\":{in:({raw:e})=>({value:e.data??new Uint8Array(0)}),out:st},\"crypto.hkdf\":{in:({params:e,raw:t})=>({ikm:t.ikm,salt:t.salt??new Uint8Array(0),info:t.info,length:e?.LENGTH||32}),out:st},\"crypto.aesGcmEncrypt\":{in:({raw:e})=>({key:e.key,plaintext:e.data??new Uint8Array(0),iv:e.nonce,aad:e.aad}),out:(e,{raw:t})=>({raw:{data:Th(e.ciphertext,e.tag),nonce:t.nonce}})},\"crypto.aesGcmDecrypt\":{in:({raw:e})=>({key:e.key,...wh(e.data),iv:e.nonce,aad:e.aad}),out:st},\"crypto.x25519.generateKeypair\":{out:e=>({raw:{private_key:e.privateKey,public_key:e.publicKey}})},\"crypto.x25519.publicKey\":{in:({raw:e})=>({privateKey:e.private_key}),out:st},\"crypto.x25519.sharedSecret\":{in:({raw:e})=>({privateKey:e.private_key,publicKey:e.public_key}),out:st},\"crypto.sealedBox.encryptForRecipient\":{in:({raw:e})=>({plaintext:e.data??new Uint8Array(0),recipientPublicKey:e.public_key,context:e.info?U(e.info):void 0}),out:e=>({raw:{data:Mn(e.protectedBlobBase64)}})},\"crypto.sealedBox.decryptFromEnvelope\":{in:({raw:e})=>({envelope:{protectedBlobBase64:Bn(e.envelope??e.data)},recipientPrivateKey:e.private_key}),out:st},\"crypto.secp256k1.publicKeyFromPrivate\":{in:({raw:e})=>({privateKey:e.private_key}),out:st},\"crypto.secp256k1.sign\":{in:({raw:e})=>({message:e.data,privateKey:e.private_key}),out:st},\"crypto.secp256k1.verify\":{in:({raw:e})=>({message:e.data,signature:e.signature,publicKey:e.public_key}),out:Oi},\"crypto.secp256k1.signDigest\":{in:({raw:e})=>({digest:e.data,privateKey:e.private_key}),out:st},\"crypto.secp256k1.verifyDigest\":{in:({raw:e})=>({digest:e.data,signature:e.signature,publicKey:e.public_key}),out:Oi},\"crypto.ed25519.publicKeyFromSeed\":{in:({raw:e})=>({seed:e.private_key}),out:st},\"crypto.ed25519.sign\":{in:({raw:e})=>({message:e.data,seed:e.private_key}),out:st},\"crypto.ed25519.verify\":{in:({raw:e})=>({message:e.data,signature:e.signature,publicKey:e.public_key}),out:Oi},\"plugin.getConfig\":{in:()=>({}),out:e=>({raw:{config:Lh(e)}})},\"node.peerId\":{in:()=>({}),out:Yn(\"peer ID\")},\"node.publicKey\":{in:()=>({}),out:Yn(\"public key\")},\"secrets.get\":{in:ye,out:e=>({result:V(\"SecretResult\",{ID:y(e?.id),USERNAME:y(e?.username),CONFIGURED:!0}),raw:{secret:at(e?.secret)??new Uint8Array(0)}})},\"secrets.status\":{in:ye,out:Gn},\"secrets.put\":{in:ye,out:Gn},\"secrets.clear\":{in:ye,out:()=>({})},\"storage.write\":{in:({params:e,raw:t})=>({...St(e),data:t.data??new Uint8Array(0)}),out:e=>({result:V(\"StorageWriteResult\",{CID:y(e?.cid)})})},\"storage.query\":{in:({params:e})=>St(e),out:e=>{let t=[],s=[];for(let i of Nt(Array.isArray(e)?e:e?.records)){let r=i.SourceTags||{},o=At(i.Data)??new Uint8Array(0);s.push(o),t.push(V(\"StoredRecordMeta\",{CID:y(i.CID),ROW_ID:i.RowID??0,PEER_ID:y(i.PeerID),TIMESTAMP_MS:pt(i.Timestamp)??0n,MATERIALIZED_MS:pt(i.MaterializedAt)??0n,LENGTH:o.length,PROVIDER_ID:y(r.ProviderID),SOURCE_NAME:y(r.SourceName),BATCH_ID:y(r.BatchID),PRODUCER_PEER_ID:y(r.ProducerPeerID),LICENSE:y(r.License)}))}return{lists:{records_meta:t},raw:{records:gh(s)}}}},\"storage.delete\":{in:({params:e})=>St(e),out:()=>({})},\"storage.expire\":{in:({params:e})=>St(e),out:e=>({result:ge(\"StorageExpireResult\",e)})},\"storage.ingest_with_source\":{in:({params:e,raw:t,lists:s})=>{let i=St(e);delete i.archive_source,delete i.archive_name,i.reconcile=gi(On,e?.RECONCILE).toLowerCase(),t.records&&(i.records=t.records),t.archive&&(i.archive={source:y(e?.ARCHIVE_SOURCE),name:y(e?.ARCHIVE_NAME),raw:t.archive});let r=s.provenance?.[0],o=s.provenance_attributes;if(r||o?.length){let a={};o?.length&&(a.attributes=o.map(l=>({name:y(l.NAME),value:y(l.VALUE)})));for(let[l,_]of Object.entries(r||{}))a[l.toLowerCase()]=typeof _==\"bigint\"?Number(_):_??\"\";let E=Object.fromEntries(Object.keys(a).sort().map(l=>[l,a[l]]));i.provenance={source:y(e?.SOURCE_NAME),json:qn.encode(JSON.stringify(E))}}return i},out:e=>{let t=ge(\"StorageIngestResult\",e);return e?.provenance&&(t.PROVENANCE_FILE=y(e.provenance)),{result:t}}},\"storage.flatsql_query_stream\":{in:Ri,out:e=>wi(e)},\"storage.flatsql_epoch_stream\":{in:({params:e})=>Ni(St(e),e),out:e=>wi(e)},\"storage.query_sandboxed\":{in:e=>({...Ri(e),want:gi(me,e.params?.WANT).toLowerCase()}),out:e=>{if(e?.kind!==\"rows\"){let o=wi(e,\"SandboxQueryResult\");return o.result.KIND=me.Stream,o}let t=typeof e.json==\"string\"?e.json:At(e.json)?U(At(e.json)):void 0;if(t===void 0)throw ft(\"storage.query_sandboxed: rows answer carries no rows\");let s;try{s=JSON.parse(t)}catch(o){throw ft(`storage.query_sandboxed: ${o.message}`)}if(!Array.isArray(s))throw ft(\"storage.query_sandboxed: rows are not a JSON array\");let i=s.length&&s[0]&&typeof s[0]==\"object\"?Object.keys(s[0]):[],r=[];for(let o of s){if(!o||typeof o!=\"object\"||Array.isArray(o))throw ft(\"storage.query_sandboxed: a row is not an object\");for(let a of Object.values(o))r.push(Dh(a))}return{result:V(\"SandboxQueryResult\",{KIND:me.Rows,ROWS:s.length,COLUMNS:i.length}),lists:{columns:i.map(o=>({VALUE:o}))},raw:{cells:Un(r)}}}},\"storage.query_surface\":{in:()=>({}),out:e=>{let t=[],s=[];for(let r of Nt(e?.tables)){let o=y(r.name);t.push(V(\"SurfaceTable\",{NAME:o,KIND:y(r.kind),SOURCE:y(r.source),RECORDS:r.records??0}));for(let a of Array.isArray(r.columns)?r.columns:[])typeof a==\"string\"?s.push(V(\"SurfaceColumn\",{TABLE:o,NAME:a})):a&&typeof a==\"object\"&&s.push(V(\"SurfaceColumn\",{TABLE:o,NAME:y(a.name),PLACEHOLDER:a.placeholder===!0}))}let i=e?.caps&&typeof e.caps==\"object\"?e.caps:null;return{...i?{result:V(\"QuerySurfaceLimits\",{TIMEOUT_MS:i.timeout_ms??0,MAX_ROWS:i.max_rows??0,MAX_BYTES:i.max_bytes??0})}:{},lists:{tables:t,columns:s}}}},\"storage.flatsql_cache_key\":{in:e=>{let t={...St(e.params),...Ri(e)};return e.lists.projection&&(t.projection=e.lists.projection.map(s=>y(s.VALUE))),t},out:e=>({raw:{value:y(e?.key)}})},\"p2p.peers_snapshot\":{in:Ne,out:e=>{let t=[],s=[],i=[];for(let r of Nt(e?.peers)){t.push(V(\"P2pPeer\",{PEER_ID:y(r.peer_id),CONNECTED:r.connected===!0,SELF:r.self===!0,EPM_INDEX:r.epm_index??-1,AGENT_VERSION:r.agent_version}));for(let o of Array.isArray(r.addrs)?r.addrs:[])s.push(V(\"P2pPeerValue\",{PEER_ID:y(r.peer_id),VALUE:y(o)}));for(let o of Array.isArray(r.standards)?r.standards:[])i.push(V(\"P2pPeerValue\",{PEER_ID:y(r.peer_id),VALUE:y(o)}))}return{result:ge(\"P2pSummary\",e),lists:{peers:t,peer_addresses:s,peer_standards:i},raw:Ti(e)}}},\"p2p.standards_snapshot\":{in:Ne,out:e=>({lists:{entries:Nt(e?.entries).map(kn)},raw:Ti(e)})},\"p2p.pnm_history\":{in:Ne,out:e=>({result:ge(\"P2pSummary\",e),lists:{entries:Nt(e?.entries).map(kn)},raw:Ti(e)})},\"p2p.latest_dataset\":{in:Ne,out:e=>{let t=e?.serving&&typeof e.serving==\"object\"?e.serving:{},s=(t.pnm&&typeof t.pnm==\"object\"?t.pnm:e?.pnm)||{};return{result:V(\"P2pLatestDataset\",{KNOWN:e?.known===!0,REASON:e?.reason,PINNED:e?.pinned,SELF:e?.self,FRESH:e?.fresh,STANDARD:e?.standard,SCHEMA:e?.schema,PNM_CID:s.CID??s.cid,PNM_FILE_ID:s.FILE_ID??s.file_id,PNM_PUBLISH_MS:pt(s.PUBLISH_TIMESTAMP??s.publish_timestamp),PNM_SIGNATURE_VERIFIED:s.signature_verified,PNM_ATTRIBUTION:s.attribution,BATCH_ID:t.batch_id,PROVIDER_ID:t.provider_id,SOURCE_NAME:t.source_name,RECORD_COUNT:t.record_count,BYTE_COUNT:t.byte_count,PARTS:t.parts,PUBLISHED_MS:pt(t.published_at),ETAG_FNV1A64:t.etag_fnv1a64,REF:t.ref&&typeof t.ref==\"object\"?Wn(t.ref):void 0}),raw:At(t.stream)?{stream:At(t.stream)}:{}}}},\"node_status_read.status\":{in:()=>({}),out:e=>{let t=e?.store||{},s=e?.service||{},i={UPTIME_S:e?.uptime_seconds??0,STARTED_MS:pt(e?.started_at)??0n,STORE_TOTAL_BYTES:t.total_bytes??0,STORE_TOTAL_RECORDS:t.total_records??0,STORAGE_PATH:y(t.storage_path),SERVICE_STATE:y(s.state),SERVICE_MODE:y(s.mode)};e?.disk&&typeof e.disk==\"object\"&&Object.assign(i,{HAS_DISK:!0,DISK_CAPACITY_BYTES:e.disk.capacity_bytes??0,DISK_FREE_BYTES:e.disk.free_bytes??0,DISK_AVAILABLE_BYTES:e.disk.available_bytes??0});let r=[];if(e?.bandwidth&&typeof e.bandwidth==\"object\"){let o=e.bandwidth;Object.assign(i,{HAS_BANDWIDTH:!0,TOTAL_IN_BYTES:o.total_in_bytes??0,TOTAL_OUT_BYTES:o.total_out_bytes??0,RATE_IN_BPS:o.rate_in_bps??0,RATE_OUT_BPS:o.rate_out_bps??0});for(let a of Nt(o.history))r.push(V(\"NodeBandwidthSample\",{TS_MS:pt(a.ts)??0n,TOTAL_IN_BYTES:a.total_in_bytes??0,TOTAL_OUT_BYTES:a.total_out_bytes??0,RATE_IN_BPS:a.rate_in_bps??0,RATE_OUT_BPS:a.rate_out_bps??0}))}return{result:V(\"NodeStatusReport\",i),lists:{bandwidth_history:r}}}},\"node_activity_read.activity\":{in:({params:e})=>St(e),out:e=>({lists:{events:Nt(e?.events).map(t=>V(\"NodeActivityEvent\",{TS_MS:pt(t.ts)??0n,KIND:y(t.kind),DETAIL:y(t.detail),PEER_ID:y(t.peer_id)}))}})}};function st(e){return{raw:{data:at(e)??new Uint8Array(0)}}}function Oi(e){return{result:{VALUE:!!e}}}function mi(e=()=>({})){return{in:t=>{let{params:s,raw:i}=t,r=De(s);return delete r.noResponse,delete r.allowUnauthorized,delete r.serverName,{...r,data:i.data,responseEncoding:\"bytes\",expectResponse:!s?.NO_RESPONSE,rejectUnauthorized:!s?.ALLOW_UNAUTHORIZED,servername:s?.SERVER_NAME||void 0,...e(t)}},out:t=>({result:Le(\"SocketResult\",t),raw:t?.body==null?{}:{body:at(t.body)}})}}function Ch(e){let t=$n[e.op];return t?.in?t.in(e):{...De(e.params),...Object.fromEntries(Object.entries(e.raw).map(([s,i])=>[jn(s),i]))}}function Uh(e,t){let s=$n[e.op];if(s?.out)return s.out(t,e);let i=se[e.op];return{result:i?.result?Le(i.result,t):void 0}}function Ph(e){if(e?.hostcallCode)return e.hostcallCode;let t=e?.name??e?.constructor?.name??\"\";return t===\"HostCapabilityError\"||t===\"BrowserHostCapabilityError\"||e?.code===\"host-capability-denied\"?\"not-authorized\":t===\"HostFilesystemScopeError\"?\"sandbox\":t===\"AbortError\"||t===\"TimeoutError\"||/timed out/i.test(e?.message??\"\")?\"timeout\":/^Unknown .* operation|not available in the synchronous hostcall ABI|does not implement/.test(e?.message??\"\")?\"unsupported\":/exceeds? the record/.test(e?.message??\"\")?\"too-large\":e instanceof RangeError||e instanceof TypeError?\"invalid-params\":\"failed\"}function Zn(e,t,{allowAsync:s=!1}={}){let i,r=a=>Ai({ok:!1,error:{code:Ph(a),message:String(a?.message??a)}}),o=a=>{try{return Ai({ok:!0,op:i.op,...Uh(i,a)})}catch(E){return r(E)}};try{if(i=Ln(e),!se[i.op])throw Object.assign(new Error(`Unknown host operation \"${i.op}\".`),{hostcallCode:\"unsupported\"});let a=t(i.op,Ch(i));if(a&&typeof a.then==\"function\"){if(!s)throw typeof a.catch==\"function\"&&a.catch(()=>{}),Object.assign(new Error(`Operation \"${i.op}\" is not available in the synchronous hostcall ABI.`),{hostcallCode:\"unsupported\"});return a.then(o,r)}return o(a)}catch(a){return a&&!a.hostcallCode&&i===void 0&&(a.hostcallCode=\"invalid-params\"),r(a)}}var Qn=Object.freeze({\"node.peerId\":{capability:null,adapter:\"node\",method:\"peerId\"},\"node.publicKey\":{capability:null,adapter:\"node\",method:\"publicKey\"},\"secrets.get\":{capability:\"secrets\",adapter:\"secrets\",method:\"get\"},\"secrets.status\":{capability:\"secrets\",adapter:\"secrets\",method:\"status\"},\"secrets.put\":{capability:\"secrets\",adapter:\"secrets\",method:\"put\"},\"secrets.clear\":{capability:\"secrets\",adapter:\"secrets\",method:\"clear\"},\"storage.write\":{capability:\"storage_write\",adapter:\"storage\",method:\"write\"},\"storage.query\":{capability:\"storage_query\",adapter:\"storage\",method:\"query\"},\"storage.delete\":{capability:\"storage_write\",adapter:\"storage\",method:\"delete\"},\"storage.expire\":{capability:\"storage_write\",adapter:\"storage\",method:\"expire\"},\"storage.ingest_with_source\":{capability:\"storage_ingest\",adapter:\"storage\",method:\"ingest_with_source\"},\"storage.flatsql_query_stream\":{capability:\"storage_query\",adapter:\"storage\",method:\"flatsql_query_stream\"},\"storage.flatsql_epoch_stream\":{capability:\"storage_query\",adapter:\"storage\",method:\"flatsql_epoch_stream\"},\"storage.query_sandboxed\":{capability:\"storage_query\",adapter:\"storage\",method:\"query_sandboxed\"},\"storage.query_surface\":{capability:\"storage_query\",adapter:\"storage\",method:\"query_surface\"},\"storage.flatsql_cache_key\":{capability:\"storage_query\",adapter:\"storage\",method:\"flatsql_cache_key\"},\"p2p.peers_snapshot\":{capability:\"p2p_read\",adapter:\"p2p\",method:\"peers_snapshot\"},\"p2p.standards_snapshot\":{capability:\"p2p_read\",adapter:\"p2p\",method:\"standards_snapshot\"},\"p2p.pnm_history\":{capability:\"p2p_read\",adapter:\"p2p\",method:\"pnm_history\"},\"p2p.latest_dataset\":{capability:\"p2p_read\",adapter:\"p2p\",method:\"latest_dataset\"},\"node_status_read.status\":{capability:\"node_status_read\",adapter:\"node\",method:\"status\"},\"node_activity_read.activity\":{capability:\"node_activity_read\",adapter:\"node\",method:\"activity\"}}),i_=Object.freeze([...new Set(Object.values(Qn).map(e=>e.capability).filter(Boolean))]);var vh=new TextDecoder,Li=\"space_data_module_host\",Dt=0,Di=1,h_=Object.freeze([\"host.runtimeTarget\",\"host.listCapabilities\",\"host.listSupportedCapabilities\",\"host.listOperations\",\"host.hasCapability\",\"plugin.getConfig\",\"clock.now\",\"clock.monotonicNow\",\"clock.nowIso\",\"random.bytes\",\"schedule.parse\",\"schedule.matches\",\"schedule.next\",\"filesystem.resolvePath\"]);function Hh(e,t){let s=String(e??\"\").trim();if(!s)throw new TypeError(`${t} is required.`);return s}function Jn(e){if(typeof e!=\"function\")throw new TypeError(\"getMemory must be a function returning WebAssembly.Memory.\");let t=e();if(!t||typeof t!=\"object\"||!(\"buffer\"in t))throw new TypeError(\"getMemory must return a WebAssembly.Memory-like object.\");let s=t.buffer;if(!(s instanceof ArrayBuffer||s instanceof SharedArrayBuffer))throw new TypeError(\"Hostcall memory buffer must be an ArrayBuffer or SharedArrayBuffer.\");return s}function zn(e,t,s,i){if(!Number.isInteger(t)||t<0)throw new RangeError(`${i} pointer must be a non-negative integer.`);if(!Number.isInteger(s)||s<0)throw new RangeError(`${i} length must be a non-negative integer.`);let r=Jn(e);if(t+s>r.byteLength)throw new RangeError(`${i} range exceeds guest memory bounds.`);return new Uint8Array(r,t,s)}function Bh(e,t,s,i){if(!Number.isInteger(t)||t<0)throw new RangeError(\"Response pointer must be a non-negative integer.\");if(!Number.isInteger(i)||i<0)throw new RangeError(\"Response max length must be a non-negative integer.\");let r=s instanceof Uint8Array?s:new Uint8Array(s),o=Jn(e),a=Math.min(r.length,i);if(t+a>o.byteLength)throw new RangeError(\"Response range exceeds guest memory bounds.\");return new Uint8Array(o,t,a).set(r.subarray(0,a)),a}function Mh(e){if(e.length===0)return null;let{meta:t,segments:s}=_e(e);return vt(t,s)}function Xn(e,t=null){return{name:e?.name??\"Error\",message:e?.message??String(e),code:e?.code??null,operation:e?.operation??t,capability:e?.capability??null}}function Fh(e){return e!==null&&typeof e==\"object\"&&typeof e.then==\"function\"}function to(e={}){let t=e.dispatch;if(typeof t!=\"function\")throw new TypeError(\"createHostcallBridge requires a dispatch function.\");let s=e.getMemory,i=Hh(e.moduleName??Li,\"Hostcall import module name\"),r=Number.isInteger(e.maxRequestBytes)?e.maxRequestBytes:16*1024*1024,o=Number.isInteger(e.maxResponseBytes)?e.maxResponseBytes:64*1024*1024,a=Dt,E={ok:!0,result:null},l=Ve(E,[]);function _(d,S){let b=[],g=le(S,b),m=Ve(g,b);if(m.length>o)throw new Error(`Hostcall response exceeds ${o} byte limit.`);a=d,E=S,l=m}function p(d,S,b,g){try{if(g>r)throw new Error(`Hostcall request exceeds ${r} byte limit.`);let m=vh.decode(zn(s,d,S,\"Operation\")),H=zn(s,b,g,\"Payload\");if(vn(H)){let bt=Zn(H.slice(),t);if(bt.length>o)throw new Error(`Hostcall response exceeds ${o} byte limit.`);return a=Dt,E=null,l=bt,Dt}let j=Mh(H),M=t(m,j);if(Fh(M))throw typeof M.catch==\"function\"&&M.catch(()=>{}),new Error(`Operation \"${m}\" returned a Promise. The synchronous hostcall ABI only supports synchronous operations.`);return _(Dt,{ok:!0,result:M===void 0?null:M}),Dt}catch(m){try{_(Di,{ok:!1,error:Xn(m)})}catch(H){_(Di,{ok:!1,error:Xn(H)})}return Di}}function O(){return l.length}function A(d,S){return Bh(s,d,l,S)}function w(){return _(Dt,{ok:!0,result:null}),Dt}function R(){return a}return{moduleName:i,imports:{[i]:{call:p,response_len:O,read_response:A,clear_response:w,last_status_code:R}},getLastEnvelope(){return structuredClone(E)},getLastResponseBytes(){return new Uint8Array(l)},getLastResponseEnvelope(){let{meta:d,segments:S}=_e(l);return vt(d,S)}}}var u_=Object.freeze({READ:1,WRITE:2,CREATE:4,EXCL:8,TRUNC:16,DELETE_ON_CLOSE:32,PROBE:64,UNLINK:128,CREATE_PARENTS:256,UNLINK_IF_UNUSED:512,OPEN_DEFERRED:1024}),E_=Object.freeze({OK:0,GENERIC:-1,NOENT:-2,ACCESS:-3,IO:-4,NOSPACE:-5,BADHANDLE:-6,BUSY:-7});var l_=Object.freeze([\"flatsql_io_open\",\"flatsql_io_read\",\"flatsql_io_write\",\"flatsql_io_truncate\",\"flatsql_io_sync\",\"flatsql_io_size\",\"flatsql_io_close\"]),Ce=4096;var __=typeof TextDecoder==\"function\"?new TextDecoder(\"utf-8\",{fatal:!0}):null;function eo(e){let t=2166136261;for(let s=0;s<e.length;s+=1)t^=e[s],t=Math.imul(t,16777619);return t>>>0}var Vh=1330201683,xh=1,Gh=0,Yh=1,kh=2,qh=3,jh=4,io=5;var Kh=7;var Wh=9,Pe=10,$h=11;var Zh=13,co=64,ro=co*4;var Qh=1;var zh=1,Xh=2,Jh=3,ne=32767,oe=0,uo=1,no=2,tc=3,ec=4,sc=5,ic=6,rc=7,nc=8,oc=9,oo=10,Eo=11,ac=12,fc=13,hc=8,lo=9,Ci=128,Ui=0,cc=1,uc=2;var Ec=4,lc=0;var _c=0,dc=1,Ic=1,re=2,Ue=3,pc=4,Sc=5,Ac=6,bc=7;var p_=64*1024;var ao=250,Rc=20;function fo(){return typeof performance<\"u\"&&performance.now?performance.now():Date.now()}function wc(e,t){return Math.ceil(e/t)*t}function _o(e){if(typeof SharedArrayBuffer!=\"function\"||!(e instanceof SharedArrayBuffer))throw new TypeError(\"The SAB I/O channel requires a SharedArrayBuffer (cross-origin isolation in browsers).\")}function Tc(e){_o(e);let t=new Int32Array(e,0,co);if(t[Gh]!==Vh||t[Yh]!==xh)throw new TypeError(\"Not a SAB I/O channel buffer (bad magic or version).\");let s=t[kh],i=t[qh],r=t[jh],o=t[$h],a=wc(ro+r*4,64),E=new Int32Array(e,ro,r),l=[];for(let _=0;_<s;_+=1){let p=a+_*i;l.push({index:_,base:p,i32:new Int32Array(e,p,Ci/4),f64:new Float64Array(e,p,Ci/8),data:new Uint8Array(e,p+Ci,o)})}return{buffer:e,header:t,instances:E,slots:l,slotCount:s,slotBytes:i,dataBytes:o,maxInstances:r,channelId:t[Zh]}}function Oc(e){return`sdm-sab-io-doorbell-${e}`}function mc(e,t){Atomics.add(e.header,io,1),Atomics.notify(e.header,io),Atomics.load(e.header,Kh)===Qh&&t()?.postMessage(0)}function gc(e){let t=null;return{get(){return!t&&typeof BroadcastChannel==\"function\"&&(t=new BroadcastChannel(e)),t},close(){t?.close(),t=null}}}var yc=typeof TextEncoder==\"function\"?new TextEncoder:null;function Nc(){return(Math.random()*2147483646|0)+1}function Dc(e,t){let s=(Atomics.add(e.header,Wh,1)>>>0)%e.slotCount;for(let i=0;i<e.slotCount;i+=1){let r=e.slots[(s+i)%e.slotCount];if(Atomics.compareExchange(r.i32,oe,Ui,cc)===Ui)return Atomics.store(r.i32,uo,t),r}return null}function ho(e,t){Atomics.store(t.i32,uo,0),Atomics.store(t.i32,oe,Ui),Atomics.add(e.header,Pe,1),Atomics.notify(e.header,Pe)}function Lc(e,t,s){let i=e.i32;i[ec]=t,i[sc]=s.instanceId??ne,i[ic]=s.handle??-1,i[rc]=s.flags??0,i[nc]=s.ptr??0,i[oc]=s.len??0,i[fc]=s.dataInSlot?dc:_c,i[Eo]=0,e.f64[hc]=s.offset??0,e.f64[lo]=0,s.path?(e.data.set(s.path,0),i[oo]=s.path.length):i[oo]=0}function Cc(e){return Atomics.load(e.i32,Eo)}function Io(e={}){_o(e.buffer);let t=Tc(e.buffer),s=Number.isInteger(e.instanceId)?e.instanceId:ne;if(s!==ne&&(s<0||s>=t.maxInstances))throw new RangeError(`instanceId ${s} is outside 0..${t.maxInstances-1}.`);let i=typeof e.getMemory==\"function\"?e.getMemory:()=>null,r=Number.isFinite(e.spinMicros)?Math.max(0,e.spinMicros):Rc,o=Nc(),a=gc(Oc(t.channelId)),E=0;function l(){for(;;){let d=Atomics.load(t.header,Pe),S=Dc(t,o);if(S)return S;Atomics.wait(t.header,Pe,d,ao)}}function _(d,S,b){let g=Atomics.load(d.i32,no)+1|0||1;Lc(d,S,b),Atomics.store(d.i32,ac,lc),Atomics.store(d.i32,no,g),Atomics.store(d.i32,oe,uc),mc(t,a.get);let m=r>0?fo()+r/1e3:0;for(;;){let H=Atomics.load(d.i32,oe);if(H===Ec&&Atomics.load(d.i32,tc)===g)break;m>0&&fo()<m||Atomics.wait(d.i32,oe,H,ao)}return E+=1,{status:Cc(d),result:d.f64[lo]}}function p(d,S){let b=l();try{return _(b,d,S)}finally{ho(t,b)}}function O(){return s!==ne&&Atomics.load(t.instances,s)===zh}function A(){if(s===ne)return!1;let d=Atomics.load(t.instances,s);return d===Xh||d===Jh}function w(d,S,b,g){let m=0;for(;m<b.length;){let H=Math.min(t.dataBytes,b.length-m),j=l(),M;try{d===Ue&&j.data.set(b.subarray(m,m+H),0),M=_(j,d,{instanceId:s,dataInSlot:!0,handle:S,ptr:0,len:H,offset:g+m}).status,d===re&&M>0&&b.set(j.data.subarray(0,M),m)}finally{ho(t,j)}if(M<0)return m>0&&d===re?m:M;if(m+=M,M<H)break}return m}function R(d,S){let b=i(),g=b?.buffer??b;return!g||d<0||S<0||d+S>g.byteLength?null:new Uint8Array(g,d,S)}return{instanceId:s,get requests(){return E},open(d,S){let b=typeof d==\"string\"?yc.encode(d):d;return!(b instanceof Uint8Array)||b.length===0?-1:b.length>Math.min(t.dataBytes,Ce)?-1:p(Ic,{instanceId:s,flags:S|0,path:b}).status},read(d,S,b,g){if(b===0)return 0;if(O())return p(re,{instanceId:s,handle:d,ptr:S,len:b,offset:g}).status;let m=R(S,b);return m?w(re,d,m,g):A()?-3:-1},write(d,S,b,g){if(b===0)return 0;if(O())return p(Ue,{instanceId:s,handle:d,ptr:S,len:b,offset:g}).status;let m=R(S,b);return m?w(Ue,d,m,g):A()?-3:-1},readInto(d,S,b){return S.length===0?0:w(re,d,S,b)},writeFrom(d,S,b){return S.length===0?0:w(Ue,d,S,b)},truncate(d,S){return p(pc,{instanceId:s,handle:d,offset:S}).status},sync(d){return p(Sc,{instanceId:s,handle:d}).status},size(d){let{status:S,result:b}=p(Ac,{instanceId:s,handle:d});return S<0?S:b},close(d){return p(bc,{instanceId:s,handle:d}).status},release(){a.close()}}}var Uc=typeof TextEncoder==\"function\"?new TextEncoder:null;function Pc(e){let t=2166136261;for(let s=0;s<e.length;s+=1)t^=e[s],t=Math.imul(t,16777619);return t|0}var po=new WeakMap;function So(e){let t=po.get(e);if(t)return t;let s=new Int32Array(e,0,16);if(s[0]!==1380795475||s[1]!==1)throw new TypeError(\"Not a SAB I/O mirror buffer.\");let i=s[2],r=s[3],o=s[4],a=64,E=a+i*32,l=E+i*o;return t={entries:i,entryBytes:r,maxPathBytes:o,i32:new Int32Array(e,a,i*32/4),f64:new Float64Array(e,a,i*32/8),paths:new Uint8Array(e,E,i*o),data:new Uint8Array(e,l,i*r)},po.set(e,t),t}function vc(e){return typeof e==\"string\"?Uc.encode(e):e}function Hc(e,t,s){let i=t*8;if(Atomics.load(e.i32,i+3)!==s.length)return!1;let r=t*e.maxPathBytes;for(let o=0;o<s.length;o+=1)if(e.paths[r+o]!==s[o])return!1;return!0}function Bc(e,t,s){let i=(s>>>0)%e.entries;for(let r=0;r<e.entries;r+=1){let o=i*8,a=Atomics.load(e.i32,o+0);if(a===0)return-1;if((a===2||a===3)&&Atomics.load(e.i32,o+2)===s&&Hc(e,i,t))return i;i=(i+1)%e.entries}return-1}function Ao(e,t){let s=So(e),i=vc(t);if(i.length>s.maxPathBytes)return-1;let r=Bc(s,i,Pc(i));return r<0?-1:Atomics.load(s.i32,r*(32/4)+0)===2?r:-1}function bo(e,t,s,i){let r=So(e),o=t*(32/4),a=t*(32/8)+3,E=t*r.entryBytes;for(let l=0;l<64;l+=1){let _=Atomics.load(r.i32,o+1);if(_&1)continue;if(Atomics.load(r.i32,o+0)!==2)return-1;let p=r.f64[a],O=Atomics.load(r.i32,o+4),A;if(i>=p)A=0;else{let w=Math.min(s.length,p-i);i+w>O?A=-1:(s.set(r.data.subarray(E+i,E+i+w),0),A=w)}if(Atomics.load(r.i32,o+1)===_)return A}return-1}function Ro(e=[\"/h.fsh\"]){let t=Array.from(e,String);return s=>{let i=String(s);for(let r of t)if(i.endsWith(r)||i===r.replace(/^\\//,\"\"))return!0;return!1}}var Mc=\"flatsql-io\",Ot=Object.freeze({open:1,read:2,write:3,truncate:4,sync:5,size:6,close:7,mirrorRead:8}),wo=24,To=16777215;function Pi(){return typeof performance<\"u\"&&performance.now?performance.now()*1e3:Date.now()*1e3}function Fc(e){if(!e?.buffer)return null;let t=new Int32Array(e.buffer,0,4),s=t[1],i=new Float64Array(e.buffer,16,s),r=new Uint8Array(e.buffer,16+s*8,s);return(o,a)=>{let E=Atomics.add(t,0,1);E<s&&(i[E]=Pi()-a,r[E]=o)}}function Vc(e,t,s){if(!e||s<=0||s>Ce||t<0)return null;let i=e.buffer??e;return t+s>i.byteLength?null:new Uint8Array(i,t,s).slice()}function xc(e={}){let t=e.getMemory;if(typeof t!=\"function\")throw new TypeError(\"createFlatsqlIoImports requires getMemory().\");let s=Array.isArray(e.provider)?e.provider:[e.provider];if(s.length===0||s.some(A=>!A||typeof A.open!=\"function\"))throw new TypeError(\"createFlatsqlIoImports requires at least one provider.\");if(s.length>127)throw new RangeError(\"At most 127 providers can be routed.\");let i=s.length>1,r=Fc(e.trace),o=e.mirror?.buffer??null,a=o?Ro(e.mirror.suffixes??[\"/h.fsh\"]):null,E=new Map,l=new TextDecoder;function _(A){if(!i)return{provider:s[0],local:A};let w=A>>>wo,R=s[w];return R?{provider:R,local:A&To}:null}function p(A,w,R){let d=r?Pi():0,S;try{S=R()}catch{S=w}return r&&r(A,d),S}return{env:{flatsql_io_open(A,w,R){return p(Ot.open,-1,()=>{let d=Vc(t(),A,w);if(!d)return-1;let S=i?eo(d)%s.length:0,b=s[S].open(d,R|0);if(b<0)return b;if(i&&b>To)return-4;let g=i?S<<wo|b:b;if(a){let m=l.decode(d);a(m)&&E.set(g,m)}return g})},flatsql_io_read(A,w,R,d){if(o&&E.has(A)){let S=r?Pi():0;try{let b=t(),g=b.buffer??b;if(w>=0&&R>=0&&w+R<=g.byteLength){let m=Ao(o,E.get(A));if(m>=0){let H=bo(o,m,new Uint8Array(g,w,R),d);if(H>=0)return r&&r(Ot.mirrorRead,S),H}}}catch{}}return p(Ot.read,-4,()=>{let S=_(A);return S?S.provider.read(S.local,w,R,d):-6})},flatsql_io_write(A,w,R,d){return p(Ot.write,-4,()=>{let S=_(A);return S?S.provider.write(S.local,w,R,d):-6})},flatsql_io_truncate(A,w){return p(Ot.truncate,-4,()=>{let R=_(A);return R?R.provider.truncate(R.local,w):-6})},flatsql_io_sync(A){return p(Ot.sync,-4,()=>{let w=_(A);return w?w.provider.sync(w.local):-6})},flatsql_io_size(A){return p(Ot.size,-4,()=>{let w=_(A);return w?w.provider.size(w.local):-6})},flatsql_io_close(A){return p(Ot.close,-4,()=>{E.delete(A);let w=_(A);return w?w.provider.close(w.local):-6})}}}}function Gc(e,{getMemory:t}){let s=Array.isArray(e.channels)?e.channels:[e.channel??e.buffer];if(s.length===0||s.some(o=>!(o instanceof SharedArrayBuffer)))throw new TypeError(\"A flatsql-io descriptor needs channels: SharedArrayBuffer[].\");let i=s.map(o=>Io({buffer:o,instanceId:e.instanceId,getMemory:t}));return{imports:xc({getMemory:t,provider:i,mirror:e.mirror,trace:e.trace}),close(){for(let o of i)o.release()}}}function Oo(e,t){let s=[],i=[];for(let r of e??[]){let o;if(typeof r==\"function\")o=r(t);else if(r&&r.provider===Mc)o=Gc(r,t);else if(r&&typeof r.factory==\"function\")o=r.factory({...t,config:r.config});else throw new TypeError(`Unresolvable extraImports entry ${JSON.stringify(r?.provider??r?.moduleUrl??typeof r)}; pass a factory function, a { provider: \"flatsql-io\" } descriptor, or (module workers) a { moduleUrl } descriptor.`);o&&o.imports&&typeof o.close==\"function\"?(s.push(o.imports),i.push(o.close)):o&&s.push(o)}return{fragments:s,close(){for(let r of i)try{r()}catch{}}}}function mo(e,t){for(let s of t)for(let[i,r]of Object.entries(s??{}))e[i]={...e[i]??{},...r};return e}var ae=0,Yc=1,kc=2,yo=4,vi=0,go=1;var qc=0;var Hi=yo*4,jc=4*1024*1024;function Kc(e){if(typeof SharedArrayBuffer!=\"function\"||!(e instanceof SharedArrayBuffer))throw new TypeError(\"SAB hostcall channel requires a SharedArrayBuffer (cross-origin isolation in browsers).\")}function No(e={}){if(typeof SharedArrayBuffer!=\"function\")throw new Error(\"SharedArrayBuffer is unavailable; the async hostcall bridge requires it (browsers additionally require cross-origin isolation: COOP+COEP).\");let t=Number.isInteger(e.maxResponseBytes)?e.maxResponseBytes:jc;if(t<=0)throw new RangeError(\"maxResponseBytes must be a positive integer.\");return new SharedArrayBuffer(Hi+t)}function Do(e={}){Kc(e.buffer);let t=e.postRequest;if(typeof t!=\"function\")throw new TypeError(\"createSabHostcallClientDispatch requires a postRequest function.\");let s=Number.isFinite(e.timeoutMs)&&e.timeoutMs>0?e.timeoutMs:12e4,i=new Int32Array(e.buffer,0,yo),r=e.buffer.byteLength-Hi;return function(a,E=null){if(Atomics.store(i,ae,go),t({operation:a,params:E}),Atomics.wait(i,ae,go,s)===\"timed-out\")throw Atomics.store(i,ae,vi),new Error(`Hostcall \"${a}\" timed out after ${s}ms waiting for the controlling thread.`);let _=Atomics.load(i,Yc),p=Atomics.load(i,kc);if(p<0||p>r)throw Atomics.store(i,ae,vi),new RangeError(`Hostcall \"${a}\" response length ${p} exceeds channel capacity ${r}.`);let O=new Uint8Array(p);O.set(new Uint8Array(e.buffer,Hi,p)),Atomics.store(i,ae,vi);let A=Yi(O);if(_!==qc){let w=new Error(A?.message??`Hostcall \"${a}\" failed on the host thread.`);throw w.name=A?.name??\"Error\",w.code=A?.code??null,w.operation=A?.operation??a,w.capability=A?.capability??null,w}return A}}var Bi=class extends Error{constructor(t){super(`WASI exit with code ${t}`),this.name=\"WasiExitError\",this.code=t}};function Wc(e,t,s,i){for(;;){let r=Atomics.load(e,t);if(s>i-r)return-1;if(Atomics.compareExchange(e,t,r,r+s)===r)return r}}function Lo(e={}){let t=e.processState,s=t?.args??e.args??[],i=t?.env??e.env??{},r=t?.input??new Uint8Array(e.stdinBytes??[]),o=e.logOutput===!0,a=e.performance??globalThis.performance??{now:()=>Date.now(),timeOrigin:0},E=e.crypto??globalThis.crypto??null,l=[],_=[],p=0,O=null;function A(T){O=T}function w(){return O}function R(){return new Uint8Array(O.buffer)}function d(){return new DataView(O.buffer)}let b=Object.entries(i).map(([T,N])=>`${T}=${N}`).map(T=>new TextEncoder().encode(T)),g=s.map(T=>new TextEncoder().encode(T));function m(T,N,P){let v;if(T===0)v=BigInt(Math.round((a.timeOrigin+a.now())*1e6));else if(T===1)v=BigInt(Math.round(a.now()*1e6));else return 28;return d().setBigUint64(P,v,!0),0}function H(T,N,P,v){if(T!==1&&T!==2)return 8;let C=T===1?l:_,G=0,Ct=d(),Ut=R();for(let Pt=0;Pt<P;Pt++){let Ee=N+Pt*8,mt=Ct.getUint32(Ee,!0),k=Ct.getUint32(Ee+4,!0);if(t){let ht=T===1?t.stdout:t.stderr,Gi=Wc(t.control,T,k,ht.length);if(Gi<0)return 51;ht.set(Ut.subarray(mt,mt+k),Gi)}else C.push(Ut.slice(mt,mt+k));G+=k}return Ct.setUint32(v,G,!0),0}function j(T,N,P,v){if(T!==0)return d().setUint32(v,0,!0),8;let C=d(),G=R(),Ct=0;for(let Ut=0;Ut<P;Ut+=1){let Pt=N+Ut*8,Ee=C.getUint32(Pt,!0),mt=C.getUint32(Pt+4,!0),k,ht;if(t)do k=Atomics.load(t.control,0),ht=Math.min(mt,r.length-k);while(Atomics.compareExchange(t.control,0,k,k+ht)!==k);else k=p,ht=Math.min(mt,r.length-k),p+=ht;if(ht===0){if(k>=r.length)break;continue}G.set(r.subarray(k,k+ht),Ee),Ct+=ht}return C.setUint32(v,Ct,!0),0}function M(T){return T<=2?0:8}function bt(T,N,P,v){return T<=2?70:8}function Go(T,N){if(T>2)return 8;let P=d();return P.setUint8(N,2),P.setUint16(N+2,0,!0),P.setBigUint64(N+8,0n,!0),P.setBigUint64(N+16,0n,!0),0}function Yo(T,N){return T<=2?0:8}function ko(T,N){return 8}function qo(T,N,P){return 8}function jo(){return 8}function Ko(T,N){let P=d();P.setUint32(T,b.length,!0);let v=0;for(let C of b)v+=C.length+1;return P.setUint32(N,v,!0),0}function Wo(T,N){let P=d(),v=R(),C=N;for(let G=0;G<b.length;G++)P.setUint32(T+G*4,C,!0),v.set(b[G],C),C+=b[G].length,v[C]=0,C+=1;return 0}function $o(T,N){let P=d();P.setUint32(T,g.length,!0);let v=0;for(let C of g)v+=C.length+1;return P.setUint32(N,v,!0),0}function Zo(T,N){let P=d(),v=R(),C=N;for(let G=0;G<g.length;G++)P.setUint32(T+G*4,C,!0),v.set(g[G],C),C+=g[G].length,v[C]=0,C+=1;return 0}function Qo(T,N){return E?.getRandomValues?(E.getRandomValues(R().subarray(T,T+N)),0):52}function zo(T){throw t&&(Atomics.store(t.control,4,T),Atomics.store(t.control,3,1)),o&&xi(),new Bi(T)}function Xo(){return 0}function xi(){if(l.length>0){let T=ue(l);if(o){let N=new TextDecoder().decode(T);N&&console.log(N)}l.length=0}if(_.length>0){let T=ue(_);if(o){let N=new TextDecoder().decode(T);N&&console.warn(N)}_.length=0}}function ue(T){let N=0;for(let C of T)N+=C.length;let P=new Uint8Array(N),v=0;for(let C of T)P.set(C,v),v+=C.length;return P}return{imports:{wasi_snapshot_preview1:{clock_time_get:m,fd_write:H,fd_read:j,fd_close:M,fd_seek:bt,fd_fdstat_get:Go,fd_fdstat_set_flags:Yo,fd_prestat_get:ko,fd_prestat_dir_name:qo,path_open:jo,environ_sizes_get:Ko,environ_get:Wo,args_sizes_get:$o,args_get:Zo,random_get:Qo,proc_exit:zo,sched_yield:Xo}},setMemory:A,getMemory:w,flushOutput:xi,get stdout(){return t?t.stdout.slice(0,Atomics.load(t.control,1)):ue(l)},get stderr(){return t?t.stderr.slice(0,Atomics.load(t.control,2)):ue(_)}}}var $c=\"sdm.thread-hostcall\";function Zc(e){return WebAssembly.Module.imports(e).some(t=>t.module===Li)}function Qc(e){if(!e||typeof e!=\"object\")throw new Error(\"A threaded guest that imports space_data_module_host requires an owning hostcall channel.\");let t=String(e.channelName??\"\").trim(),s=String(e.token??\"\").trim();if(!t||!s)throw new Error(\"The owning thread-hostcall channel name and token are required.\");if(typeof BroadcastChannel!=\"function\")throw new Error(\"BroadcastChannel is required for nested pthread hostcalls.\");let i=No({maxResponseBytes:e.maxResponseBytes}),r=new BroadcastChannel(t),o=1;return{dispatch:Do({buffer:i,timeoutMs:e.timeoutMs,postRequest(E){r.postMessage({type:$c,token:s,requestId:o++,buffer:i,...E})}}),close(){r.close()}}}function Co({wasmModule:e,memory:t,hostcallChannel:s,processState:i,extraImports:r,workerIndex:o,tid:a,threadSpawn:E}={}){let l=Lo({processState:i});l.setMemory(t);let _=null,p=null,O={...l.imports,env:{memory:t},wasi:{\"thread-spawn\":typeof E==\"function\"?E:()=>-1}};if(Zc(e)){p=Qc(s);let w=to({dispatch:p.dispatch,getMemory:()=>_?.exports?.memory??t});Object.assign(O,w.imports)}let A=Oo(r,{memory:t,getMemory:()=>_?.exports?.memory??t,workerIndex:o??null,tid:a??null});return mo(O,A.fragments),O.env.memory=t,{imports:O,instantiate(){return _=new WebAssembly.Instance(e,O),l.setMemory(_.exports.memory??t),_},close(){p?.close(),A.close()}}}async function Uo(e){let t=[];for(let s of e??[])if(s&&typeof s.moduleUrl==\"string\"){let r=(await import(s.moduleUrl))[s.exportName??\"default\"];if(typeof r!=\"function\")throw new TypeError(`extraImports module ${s.moduleUrl} exports no factory \"${s.exportName??\"default\"}\".`);t.push({factory:r,config:s.config??null})}else t.push(s);return t}var zc=Object.freeze({PENDING:0,IDLE:1,CLAIMED:2,ASSIGNED:3,RUNNING:4,RETIRED:5}),{PENDING:P_,IDLE:fe,CLAIMED:Po,ASSIGNED:he,RUNNING:He,RETIRED:Fi}=zc,Be=0,Xc=1,Jc=2,tu=3,eu=4,ve=5,su=6,iu=8,ru=8,X=0,Vi=1,Bo=2,vo=3,nu=4,Ho=1,ou=536870911,au=2;var it=e=>iu+ru*e;function Mi(){return typeof performance<\"u\"&&typeof performance.now==\"function\"?performance.now():Date.now()}function Me(e){Atomics.add(e,Be,1),Atomics.notify(e,Be)}function fu(e,t,s){Atomics.store(e,it(t)+X,s),Atomics.notify(e,it(t)+X),Me(e)}function Mo(e,t){fu(e.control,t,Fi)}function hu(e,t,s){let{control:i}=e,r=it(t);for(;;){let o=Atomics.load(i,r+X);if(o!==he&&o!==He||Atomics.load(i,r+Vi)!==s)return!1;if(Atomics.compareExchange(i,r+X,o,fe)===o)return Me(i),!0}}function cu(e,t){let{control:s}=e,i=it(t);return Atomics.compareExchange(s,i+X,he,He)!==he?null:{tid:Atomics.load(s,i+Vi),startArg:Atomics.load(s,i+Bo)}}function uu(e,t){let{control:s}=e;Atomics.compareExchange(s,it(t)+X,He,fe)===He&&Me(s)}function Fo(e,t,{runThread:s,osThreadId:i=0}){let{control:r}=e,o=it(t)+X;for(i&&Atomics.store(r,it(t)+nu,i);;){let a=Atomics.load(r,o);if(a===Fi)return;if(a!==he){Atomics.wait(r,o,a);continue}let E=cu(e,t);if(E){if(s(E.tid,E.startArg)===!1){Mo(e,t);return}uu(e,t)}}}function Vo(e,{owner:t=!1,grow:s=null,dispatchMessage:i=null}={}){let{control:r,spawnWaitMs:o}=e,a=Atomics.load(r,su),E=null,l=!0,_=R=>t||(Atomics.load(r,it(R)+vo)&Ho)===0,p=()=>{let R=Math.min(Atomics.load(r,ve),a),d=0;for(let S=0;S<R;S+=1)if(_(S)){if(Atomics.compareExchange(r,it(S)+X,fe,Po)===fe)return{slot:S,live:d+1};Atomics.load(r,it(S)+X)!==Fi&&(d+=1)}return{slot:-1,live:d}},O=()=>{for(;;){let R=Atomics.load(r,ve);if(R>=a)return-1;if(Atomics.compareExchange(r,ve,R,R+1)===R)return Atomics.store(r,it(R)+X,Po),R}},A=()=>{let R=O();if(R<0)return{slot:-1,reason:null};try{return s(R),{slot:R,reason:null}}catch{return Mo(e,R),{slot:-1,reason:\"worker-create-failed\"}}},w=()=>{let R=p();if(R.slot>=0)return{slot:R.slot,waited:!1,reason:null};let d=typeof s==\"function\",S=Mi(),b=S+(l?o:0),g=S+(l?Math.min(au,o):0),m=!1;for(;;){let H=Atomics.load(r,Be);if(R=p(),R.slot>=0)return{slot:R.slot,waited:m,reason:null};let j=d&&Math.min(Atomics.load(r,ve),a)<a;if(j&&(R.live===0||Mi()>=g)){let bt=A();if(bt.slot>=0||bt.reason)return{...bt,waited:m};continue}if(R.live===0)return{slot:-1,waited:m,reason:\"pool-exhausted\"};if(H===E&&!j)return{slot:-1,waited:m,reason:\"pool-exhausted\"};let M=(j?g:b)-Mi();if(!j&&M<=0)return E=H,{slot:-1,waited:m,reason:\"pool-exhausted\"};if(M>0){try{Atomics.wait(r,Be,H,M)}catch{if(l=!1,!j)return{slot:-1,waited:m,reason:\"pool-exhausted\"};g=0;continue}m=!0}}};return R=>{let d=w();if(d.slot<0)return d.reason===\"pool-exhausted\"&&Atomics.add(r,eu,1),{tid:-1,slot:-1,reason:d.reason};let{slot:S}=d,b=it(S),g=Atomics.add(r,Xc,1);if(g>ou)return Atomics.store(r,b+X,fe),Me(r),{tid:-1,slot:-1,reason:\"tid-exhausted\"};if(Atomics.store(r,b+Vi,g),Atomics.store(r,b+Bo,R|0),Atomics.store(r,b+X,he),(Atomics.load(r,b+vo)&Ho)!==0)try{i(S,g,R)}catch{return hu(e,S,g),{tid:-1,slot:-1,reason:\"dispatch-failed\"}}else Atomics.notify(r,b+X);return Atomics.add(r,Jc,1),d.waited&&Atomics.add(r,tu,1),{tid:g,slot:S,reason:null}}}var ce=null;function xo(e,t){try{return ce.instantiate().exports.wasi_thread_start(e,t),!0}catch(s){return s&&s.name===\"WasiExitError\"?!0:(console.error(`[wasi-thread] guest thread ${e} trapped:`,s),self.postMessage({t:\"error\",tid:e,error:String(s?.message??s)}),!1)}}self.onmessage=async e=>{let t=e.data??{};if(t.t===\"probe\"){let s=t.pool??null;try{let i=await Uo(t.extraImports??[]),r=s?Vo(s):null;ce=Co({wasmModule:t.wasmModule,memory:t.memory,hostcallChannel:t.hostcallChannel??null,processState:t.processState,extraImports:i,workerIndex:t.workerIndex,threadSpawn:r?o=>r(o).tid:void 0}),ce.instantiate(),self.postMessage({t:\"ready\",ok:!0,protocol:2})}catch(i){ce?.close(),ce=null,self.postMessage({t:\"ready\",ok:!1,error:String(i?.message??i)});return}s&&Fo(s,t.slot,{runThread:xo});return}t.t===\"run\"&&(xo(t.tid,t.startArg),self.postMessage({t:\"exit\",tid:t.tid}))};})();\n";
7
+ export const WASI_THREAD_POOL_WORKER_BUNDLE_SHA256 = "095e4eea6018d3df2dd5b7dc2e9ad541885e2bce2391f635d462c5efb339629e";
8
8
 
9
9
  /** src/host/opfsIoWorker.mjs, sha256 9b5cf50741217bd829e7f1ee4cbdbf3e6b6b8ecc20a700501adf0faf9ee429b1. */
10
10
  export const FLATSQL_IO_WORKER_BUNDLE = "(()=>{var Nn=Object.freeze({READ:1,WRITE:2,CREATE:4,EXCL:8,TRUNC:16,DELETE_ON_CLOSE:32,PROBE:64,UNLINK:128,CREATE_PARENTS:256,UNLINK_IF_UNUSED:512,OPEN_DEFERRED:1024}),Cn=Object.freeze({OK:0,GENERIC:-1,NOENT:-2,ACCESS:-3,IO:-4,NOSPACE:-5,BADHANDLE:-6,BUSY:-7});var Fn=Object.freeze([\"flatsql_io_open\",\"flatsql_io_read\",\"flatsql_io_write\",\"flatsql_io_truncate\",\"flatsql_io_sync\",\"flatsql_io_size\",\"flatsql_io_close\"]),Ye=4096;function vt(t,{during:n}={}){if(!t)return-1;let r=typeof t.code==\"string\"?t.code:null;if(r)switch(r){case\"ENOENT\":case\"ENOTDIR\":return-2;case\"EACCES\":case\"EPERM\":case\"EROFS\":return-3;case\"ENOSPC\":case\"EDQUOT\":return-5;case\"EBADF\":return-4;case\"EEXIST\":return-1;case\"EBUSY\":case\"ETXTBSY\":return-7;case\"ENAMETOOLONG\":case\"EINVAL\":return-1;default:return-4}switch(t.name){case\"NotFoundError\":return-2;case\"NoModificationAllowedError\":return-7;case\"InvalidStateError\":return n===\"open\"?-7:-6;case\"QuotaExceededError\":return-5;case\"TypeMismatchError\":case\"SecurityError\":case\"NotAllowedError\":return-3;case\"InvalidModificationError\":return-7;case\"TypeError\":case\"RangeError\":return-1;default:return-4}}var N=class extends Error{constructor(n,r){super(r??`flatsql_io status ${n}`),this.name=\"FlatsqlIoStatusError\",this.status=n}};function V(t,n){return t&&typeof t.status==\"number\"&&t.status<0?t.status:vt(t,n)}function oe(t){if(typeof t!=\"string\"||t.length===0||t.includes(\"\\0\"))return-1;let n=[];for(let r of t.split(\"/\"))if(!(r===\"\"||r===\".\")){if(r===\"..\")return-3;n.push(r)}return n.length===0?-1:n}var Ve=typeof TextDecoder==\"function\"?new TextDecoder(\"utf-8\",{fatal:!0}):null;function Ge(t){if(!Ve||t.length===0||t.length>Ye)return-1;let n=t.buffer instanceof ArrayBuffer?t:new Uint8Array(t);try{return Ve.decode(n)}catch{return-1}}var Vt=1330201683,Yt=1,Gt=0,qt=1,Wt=2,$t=3,Kt=4,H=5,Ie=6,We=7,$e=8;var Xt=11,Ke=12,zt=13,Xe=64,qe=Xe*4;var ze=1,Ze=2;var se=0,Oe=1,Je=0,ae=1,ie=2,ce=3,je=32767,G=0;var Zt=2,Jt=3,et=4,tt=5,nt=6,rt=7,ot=8,st=9,at=10,jt=11,en=12,it=13,ct=8,tn=9,de=128;var _e=2,_t=3,nn=4;var rn=1;var ft=1,pe=1,fe=2,he=3,Re=4,Te=5,me=6,Le=7;var Mn=64*1024;function on(t,n){return Math.ceil(t/n)*n}function sn(t){if(typeof SharedArrayBuffer!=\"function\"||!(t instanceof SharedArrayBuffer))throw new TypeError(\"The SAB I/O channel requires a SharedArrayBuffer (cross-origin isolation in browsers).\")}function lt(t){sn(t);let n=new Int32Array(t,0,Xe);if(n[Gt]!==Vt||n[qt]!==Yt)throw new TypeError(\"Not a SAB I/O channel buffer (bad magic or version).\");let r=n[Wt],s=n[$t],f=n[Kt],a=n[Xt],l=on(qe+f*4,64),L=new Int32Array(t,qe,f),S=[];for(let p=0;p<r;p+=1){let T=l+p*s;S.push({index:p,base:T,i32:new Int32Array(t,T,de/4),f64:new Float64Array(t,T,de/8),data:new Uint8Array(t,T+de,a)})}return{buffer:t,header:n,instances:L,slots:S,slotCount:r,slotBytes:s,dataBytes:a,maxInstances:f,channelId:n[zt]}}function ut(t){return`sdm-sab-io-doorbell-${t}`}function an(t){return`sdm-sab-io-done-${t}`}var Qn=typeof TextEncoder==\"function\"?new TextEncoder:null;var Y=null;function cn(t){return typeof BroadcastChannel!=\"function\"?null:((!Y||Y.id!==t.channelId)&&(Y?.channel.close(),Y={id:t.channelId,channel:new BroadcastChannel(an(t.channelId))}),Y.channel)}function Et(t,n,r,s=0){n.f64[tn]=s,Atomics.store(n.i32,jt,r|0),Atomics.store(n.i32,Jt,Atomics.load(n.i32,Zt)),Atomics.store(n.i32,G,nn),Atomics.notify(n.i32,G),Atomics.load(n.i32,en)===rn&&cn(t)?.postMessage(n.index)}var _n=typeof TextEncoder==\"function\"?new TextEncoder:null;function St(t){let n=2166136261;for(let r=0;r<t.length;r+=1)n^=t[r],n=Math.imul(n,16777619);return n|0}var At=new WeakMap;function ye(t){let n=At.get(t);if(n)return n;let r=new Int32Array(t,0,16);if(r[0]!==1380795475||r[1]!==1)throw new TypeError(\"Not a SAB I/O mirror buffer.\");let s=r[2],f=r[3],a=r[4],l=64,L=l+s*32,S=L+s*a;return n={entries:s,entryBytes:f,maxPathBytes:a,i32:new Int32Array(t,l,s*32/4),f64:new Float64Array(t,l,s*32/8),paths:new Uint8Array(t,L,s*a),data:new Uint8Array(t,S,s*f)},At.set(t,n),n}function dt(t){return ye(t).entryBytes}function It(t){return typeof t==\"string\"?_n.encode(t):t}function fn(t,n,r){let s=n*8;if(Atomics.load(t.i32,s+3)!==r.length)return!1;let f=n*t.maxPathBytes;for(let a=0;a<r.length;a+=1)if(t.paths[f+a]!==r[a])return!1;return!0}function Ot(t,n,r){let s=(r>>>0)%t.entries;for(let f=0;f<t.entries;f+=1){let a=s*8,l=Atomics.load(t.i32,a+0);if(l===0)return-1;if((l===2||l===3)&&Atomics.load(t.i32,a+2)===r&&fn(t,s,n))return s;s=(s+1)%t.entries}return-1}function ln(t,n,r){let s=(r>>>0)%t.entries;for(let f=0;f<t.entries;f+=1){let a=s*8;if(Atomics.compareExchange(t.i32,a+0,0,1)===0)return t.paths.set(n,s*t.maxPathBytes),Atomics.store(t.i32,a+3,n.length),Atomics.store(t.i32,a+2,r),Atomics.store(t.i32,a+4,0),t.f64[s*(32/8)+3]=0,Atomics.store(t.i32,a+0,3),s;s=(s+1)%t.entries}return-1}function W(t,n,r,s,{truncateTo:f}={}){let a=ye(t),l=It(n);if(l.length>a.maxPathBytes)return!1;let L=St(l),S=Ot(a,l,L);if(S<0&&(S=ln(a,l,L)),S<0)return!1;let p=S*(32/4),T=S*(32/8)+3,A=S*a.entryBytes,c=Atomics.load(a.i32,p+0)===2;Atomics.add(a.i32,p+1,1);let E=c?a.f64[T]:0,d=c?Atomics.load(a.i32,p+4):0;if(c||a.data.fill(0,A,A+a.entryBytes),s.length>0&&r<a.entryBytes){let m=Math.min(a.entryBytes,r+s.length);r>d&&a.data.fill(0,A+d,A+r),a.data.set(s.subarray(0,m-r),A+r)}return s.length>0&&(E=Math.max(E,r+s.length)),f!==void 0&&(f<d&&a.data.fill(0,A+f,A+d),E=f),d=Math.min(E,a.entryBytes),a.f64[T]=E,Atomics.store(a.i32,p+4,d),Atomics.store(a.i32,p+0,2),Atomics.add(a.i32,p+1,1),!0}function we(t,n){let r=ye(t),s=It(n);if(s.length>r.maxPathBytes)return;let f=Ot(r,s,St(s));if(f<0)return;let a=f*(32/4);Atomics.add(r.i32,a+1,1),Atomics.store(r.i32,a+0,3),Atomics.store(r.i32,a+4,0),r.f64[f*(32/8)+3]=0,Atomics.add(r.i32,a+1,1)}function pt(t=[\"/h.fsh\"]){let n=Array.from(t,String);return r=>{let s=String(r);for(let f of n)if(s.endsWith(f)||s===f.replace(/^\\//,\"\"))return!0;return!1}}var Ce=256*1024,dn=50,In=8,Tt=250,mt=16777215,R=0,xe=1,Lt=2;function le(){return typeof performance<\"u\"&&performance.now?performance.now():Date.now()}function On(){if(typeof MessageChannel==\"function\"){let t=new MessageChannel,n=[];return t.port1.onmessage=()=>n.shift()?.(),t.port1.unref?.(),t.port2.unref?.(),()=>new Promise(r=>{n.push(r),t.port2.postMessage(0)})}return()=>new Promise(t=>setTimeout(t,0))}function yt(t={}){let n=lt(t.buffer),r=t.backend;if(!r||typeof r.openFile!=\"function\")throw new TypeError(\"createFlatsqlIoServer requires a backend with openFile().\");let s=Number.isInteger(t.chunkBytes)&&t.chunkBytes>0?t.chunkBytes:Ce,f=t.doorbell??\"auto\",a=f===\"message\"||f===\"auto\"&&typeof Atomics.waitAsync!=\"function\"?Oe:se,l=t.mirror??null,L=Number.isFinite(t.spinMicros)?Math.max(0,t.spinMicros):dn,S=typeof t.onEvent==\"function\"?t.onEvent:null,p=On(),T=new Map,A=new Map,c=new Map,E=new Map,d=new Map,m=[],y=new Set,x=1,F=!1,g=null,D=null,U=null,J=null,j=!1,w={served:0,opens:0,deferredOpens:0,parked:0,chunks:0,busy:0,revoked:0,sharedViewsRejected:!1,maxReady:0};function v(e){if(S)try{S(e)}catch{}}function ee(){if(a===se)Atomics.add(n.header,H,1),Atomics.notify(n.header,H);else{let e=D;D=null,e?.()}}async function Ft(e){if(a===se){let o=Atomics.waitAsync(n.header,H,e,Tt);o.async&&await o.value;return}Atomics.load(n.header,H)===e&&await new Promise(o=>{let _=setTimeout(()=>{D===u&&(D=null),o()},Tt),u=()=>{clearTimeout(_),o()};D=u})}function Ae(e,o){let u=(d.get(e)??Promise.resolve()).then(o,o),i=u.then(()=>{},()=>{});return d.set(e,i),i.then(()=>{d.get(e)===i&&d.delete(e)}),u}function gt(){for(let e=0;e<mt;e+=1){let o=x;if(x=x>=mt?1:x+1,!c.has(o))return o}return-1}function te(e,o,_){let u=gt();if(u<0)return-1;let i=(_&2)!==0,O={id:u,entry:e,instanceId:o,canWrite:i,canRead:!i||(_&1)!==0};c.set(u,O),e.refs+=1,_&32&&(e.deleteOnClose=!0);let I=E.get(o);return I||(I=new Set,E.set(o,I)),I.add(u),u}function ne(e){if(!(e.refs>0||e.pins>0)){if(A.get(e.path)===e&&A.delete(e.path),e.file){try{e.file.close()}catch{}e.file=null}e.deleteOnClose&&e.openStatus===0&&Ae(e.path,async()=>{try{await r.remove(e.path,e.components)}catch{}l&&l.write!==!1&&we(l.buffer,e.path)})}}function De(e){c.delete(e.id)&&(E.get(e.instanceId)?.delete(e.id),e.entry.refs-=1,ne(e.entry))}function Dt(e){return e===je?ae:e<0||e>=n.maxInstances?-1:Atomics.load(n.instances,e)}function Se(e){let o=Dt(e);return o===ie||o===ce}function Me(e){let{slot:o,ptr:_,len:u}=e;if(u<0||_<0)return null;if(e.dataMode===ft)return _+u>o.data.length?null:o.data.subarray(_,_+u);let i=T.get(e.instanceId),O=i?.buffer??i;return!O||_+u>O.byteLength?null:new Uint8Array(O,_,u)}function Qe(e){return(!J||J.length<e)&&(J=new Uint8Array(Math.max(e,s))),J.subarray(0,e)}function Pe(e,o,_){if(!j)try{return e.read(o,{at:_})}catch(O){if(!(O instanceof TypeError)||!(o.buffer instanceof SharedArrayBuffer))throw O;j=!0,w.sharedViewsRejected=!0,v({type:\"shared-views-rejected\"})}let u=Qe(o.length),i=e.read(u,{at:_});return o.set(u.subarray(0,i),0),i}function Mt(e,o,_){if(!j)try{return e.write(o,{at:_})}catch(i){if(!(i instanceof TypeError)||!(o.buffer instanceof SharedArrayBuffer))throw i;j=!0,w.sharedViewsRejected=!0,v({type:\"shared-views-rejected\"})}let u=Qe(o.length);return u.set(o,0),e.write(u,{at:_})}function h(e,o,_=0){y.delete(e.slot.index),w.served+=1,Atomics.add(n.header,Ke,1),Et(n,e.slot,o,_)}function Qt(e){let o=e.i32;return{slot:e,op:o[et],instanceId:o[tt],handleId:o[nt],flags:o[rt],ptr:o[ot],len:o[st],dataMode:o[it],pathLen:o[at],offset:e.f64[ct],done:0,phase:0}}function He(){let e=0;for(let o of n.slots)y.has(o.index)||Atomics.load(o.i32,G)===_e&&Atomics.compareExchange(o.i32,G,_e,_t)===_e&&(y.add(o.index),m.push(Qt(o)),e+=1);return m.length>w.maxReady&&(w.maxReady=m.length),e}function Ue(){for(let e=0;e<n.maxInstances;e+=1){if(Atomics.load(n.instances,e)!==ie)continue;let o=E.get(e);if(o){for(let _ of Array.from(o)){let u=c.get(_);u&&De(u)}E.delete(e)}T.delete(e),w.revoked+=1,Atomics.store(n.instances,e,ce),Atomics.notify(n.instances,e),v({type:\"revoked\",instanceId:e})}}function re(e,o){return w.parked+=1,o.waiters.push(e),Lt}function ke(e,o,_){if(e.opening=null,e.openStatus=o,e.file=_??null,o===0&&l&&l.write!==!1&&l.match(e.path)&&e.file)try{let i=e.file.getSize(),O=new Uint8Array(Math.min(i,dt(l.buffer)));O.length>0&&Pe(e.file,O,0),W(l.buffer,e.path,0,O,{truncateTo:i})}catch{}let u=e.waiters;e.waiters=[];for(let i of u)i.op===pe&&i.phase===1&&i.entry===e&&(o<0?i.result=o:Se(i.instanceId)?i.result=-3:i.result=te(e,i.instanceId,i.flags),i.phase=2),m.push(i);o<0&&e.refs===0&&e.pins===0&&A.get(e.path)===e?A.delete(e.path):o===0&&e.refs===0&&e.pins===0&&ne(e),ee()}function be(e,o){w.opens+=1,e.opening=Ae(e.path,async()=>{try{let _=await r.openFile(e.path,e.components,o);ke(e,0,_)}catch(_){ke(e,V(_,{during:\"open\"}),null)}})}function Pt(e){if(e.phase===2)return h(e,e.result),R;if(Se(e.instanceId))return h(e,-3),R;if(e.path===void 0){let I=e.slot.data.slice(0,Math.max(0,e.pathLen)),Q=Ge(I);if(typeof Q!=\"string\")return h(e,Q),R;let P=oe(Q);if(!Array.isArray(P))return h(e,P),R;e.path=P.join(\"/\"),e.components=P}let{path:o,components:_,flags:u}=e,i=A.get(o);if(u&704)return i?.opening?re(e,i):u&64?i&&i.openStatus===0?(h(e,0),R):ve(e,async()=>await r.exists(o,_)?0:-2):i&&i.refs>0?(w.busy+=1,h(e,-7),R):(i&&i.pins>0&&(i.pins=0,ne(i)),ve(e,async()=>(await r.remove(o,_),l&&l.write!==!1&&we(l.buffer,o),0)));if(i){if(i.opening){if(u&1024){w.deferredOpens+=1;let I=te(i,e.instanceId,u);return h(e,I),R}return re(e,i)}if(i.openStatus===0){if(u&8)return h(e,-1),R;if(u&16&&u&2)try{i.file.truncate(0),l&&l.write!==!1&&l.match(o)&&W(l.buffer,o,0,new Uint8Array(0),{truncateTo:0})}catch(Q){return h(e,V(Q)),R}let I=te(i,e.instanceId,u);return h(e,I),R}A.get(o)===i&&A.delete(o)}let O={path:o,components:_,file:null,opening:null,openStatus:0,refs:0,pins:0,deleteOnClose:!1,waiters:[]};if(A.set(o,O),be(O,u),u&1024){w.deferredOpens+=1;let I=te(O,e.instanceId,u);return h(e,I),R}return e.phase=1,e.entry=O,re(e,O)}function ve(e,o){return e.phase=2,Ae(e.path,async()=>{try{e.result=await o()}catch(_){e.result=V(_)}m.push(e),ee()}),w.parked+=1,Lt}function Ht(e){if(Se(e.instanceId))return h(e,-3),R;let o=c.get(e.handleId);if(!o)return h(e,-6),R;let _=o.entry;if(_.opening)return re(e,_);if(e.op===Le)return De(o),h(e,0),R;if(_.openStatus<0||!_.file)return h(e,_.openStatus<0?_.openStatus:-6),R;let u=_.file;try{switch(e.op){case fe:{if(!o.canRead)return h(e,-4),R;let i=Me(e);if(!i)return h(e,-1),R;let O=Math.min(s,e.len-e.done),I=Pe(u,i.subarray(e.done,e.done+O),e.offset+e.done);return w.chunks+=1,e.done+=I,I<O||e.done>=e.len?(h(e,e.done),R):xe}case he:{if(!o.canWrite)return h(e,-4),R;let i=Me(e);if(!i)return h(e,-1),R;let O=Math.min(s,e.len-e.done),I=i.subarray(e.done,e.done+O),Q=e.offset+e.done,P=Mt(u,I,Q);return w.chunks+=1,l&&l.write!==!1&&l.match(_.path)&&W(l.buffer,_.path,Q,I.subarray(0,P)),e.done+=P,P<O||e.done>=e.len?(h(e,e.done),R):xe}case Re:return o.canWrite?(u.truncate(e.offset),l&&l.write!==!1&&l.match(_.path)&&W(l.buffer,_.path,0,new Uint8Array(0),{truncateTo:e.offset}),h(e,0),R):(h(e,-4),R);case Te:return u.flush(),h(e,0),R;case me:return h(e,0,u.getSize()),R;default:return h(e,-1),R}}catch(i){let O=V(i);return h(e,e.done>0&&e.op===fe?e.done:O),R}}function Ut(e){try{return e.op===pe?Pt(e):e.op===fe||e.op===he||e.op===Re||e.op===Te||e.op===me||e.op===Le?Ht(e):(h(e,-1),R)}catch(o){return v({type:\"step-error\",error:o}),h(e,-4),R}}function kt(){let e=le();for(;m.length>0;){let o=m.shift();if(Ut(o)===xe&&m.push(o),Ue(),He(),le()-e>In)return!1}return!0}async function bt(){for(Atomics.store(n.header,We,a),Atomics.add(n.header,$e,1),Atomics.store(n.header,Ie,ze);F;){let e=Atomics.load(n.header,H);Ue(),He();let o=kt();if(!F)break;if(!o||m.length>0){await p();continue}if(L>0){let _=le()+L/1e3;for(;le()<_&&Atomics.load(n.header,H)===e;);if(Atomics.load(n.header,H)!==e)continue}await Ft(e)}}return{doorbellMode:a,stats:w,start(){return F||(F=!0,a===Oe&&typeof BroadcastChannel==\"function\"&&(U=new BroadcastChannel(ut(n.channelId)),U.onmessage=()=>{let e=D;D=null,e?.()}),g=bt().catch(e=>{throw v({type:\"loop-error\",error:e}),e})),g},async stop(){F=!1,ee();try{await g}catch{}U?.close(),U=null;for(let e of A.values())try{e.file?.close()}catch{}A.clear(),c.clear(),E.clear(),Atomics.store(n.header,Ie,Ze)},attachMemory(e,o){if(!Number.isInteger(e)||e<0||e>=n.maxInstances)return!1;let _=Atomics.load(n.instances,e);return _===ie||_===ce?!1:(T.set(e,o),Atomics.store(n.instances,e,ae),!0)},detachMemory(e){T.delete(e),Atomics.load(n.instances,e)===ae&&Atomics.store(n.instances,e,Je)},async preopen(e,o=7){let _=await Promise.all(e.map(async u=>{let i=oe(String(u));if(!Array.isArray(i))return i;let O=i.join(\"/\"),I=A.get(O);return I||(I={path:O,components:i,file:null,opening:null,openStatus:0,refs:0,pins:0,deleteOnClose:!1,waiters:[]},A.set(O,I),be(I,o&-1025)),I.pins+=1,I.opening&&await I.opening,I.openStatus<0?(I.pins=Math.max(0,I.pins-1),I.openStatus):0}));return ee(),_},releasePreopen(e){for(let o of e){let _=oe(String(o));if(!Array.isArray(_))continue;let u=A.get(_.join(\"/\"));u&&u.pins>0&&(u.pins-=1,ne(u))}},inventory(){return{files:Array.from(A.values()).map(e=>({path:e.path,refs:e.refs,pins:e.pins,opening:!!e.opening,openStatus:e.openStatus})),handles:c.size}}}}var vn=263;var Fe=class{constructor(){this.bytes=new Uint8Array(0),this.length=0}ensureCapacity(n,r){if(n<=this.bytes.length)return;let s=Math.max(64,this.bytes.length);for(;s<n;)s*=2;r.reserve(s-this.bytes.length);let f=new Uint8Array(s);f.set(this.bytes.subarray(0,this.length)),this.bytes=f}};function wt(t={}){let n=Number.isFinite(t.maxBytes)?t.maxBytes:1/0,r=new Map,s=new Set([\"\"]),f=0,a={reserve(S){if(f+S>n)throw new N(-5,\"memory store budget exhausted\");f+=S},release(S){f=Math.max(0,f-S)}};function l(S){return S.slice(0,-1).join(\"/\")}function L(S){let p=!1,T=()=>{if(p){let c=new Error(\"handle closed\");throw c.name=\"InvalidStateError\",c}let A=r.get(S);if(!A){let c=new Error(\"file removed\");throw c.name=\"NotFoundError\",c}return A};return{read(A,{at:c=0}={}){let E=T();if(c>=E.length)return 0;let d=Math.min(A.length,E.length-c);return A.set(E.bytes.subarray(c,c+d),0),d},write(A,{at:c=0}={}){let E=T(),d=c+A.length;return E.ensureCapacity(d,a),c>E.length&&E.bytes.fill(0,E.length,c),E.bytes.set(A,c),d>E.length&&(E.length=d),A.length},truncate(A){let c=T();A>c.length&&(c.ensureCapacity(A,a),c.bytes.fill(0,c.length,A)),c.length=A},flush(){T()},getSize(){return T().length},close(){p=!0}}}return{kind:\"memory\",openFile(S,p,T){let A=l(p);if(!s.has(A)){if(!(T&256)||!(T&4))throw new N(-2,`no directory ${A}`);for(let E=1;E<p.length;E+=1)s.add(p.slice(0,E).join(\"/\"))}if(s.has(S))throw new N(-3,`${S} is a directory`);let c=r.get(S);if(c&&T&8)throw new N(-1,`${S} exists`);if(c)T&16&&(c.length=0);else{if(!(T&4))throw new N(-2,`no file ${S}`);c=new Fe,r.set(S,c)}return L(S)},exists(S){return r.has(S)||s.has(S)},remove(S){let p=r.get(S);if(!p)throw new N(-2,`no file ${S}`);a.release(p.bytes.length),r.delete(S)},reset(){r.clear(),s.clear(),s.add(\"\"),f=0},usage(){return{files:r.size,allocatedBytes:f}},list(){return Array.from(r.keys()).sort()}}}var Ee=\"readwrite-unsafe\";function hn(t){let n=new Error(t);return n.name=\"NotFoundError\",n}function Bt(t){return new Promise(n=>setTimeout(n,t))}async function Rn(t,n=\".sdm-mode-probe\"){let r=null,s=null;try{let f=await t.getFileHandle(n,{create:!0});return r=await f.createSyncAccessHandle({mode:Ee}),r.mode!==Ee?{supported:!1,detail:\"mode option ignored\"}:(s=await f.createSyncAccessHandle({mode:Ee}),{supported:!0,detail:\"two readwrite-unsafe handles\"})}catch(f){return{supported:!1,detail:`${f?.name??\"Error\"}: ${f?.message??f}`}}finally{try{s?.close()}catch{}try{r?.close()}catch{}try{await t.removeEntry(n)}catch{}}}async function Tn(t,n=\".sdm-view-probe\"){let r=null;try{r=await(await t.getFileHandle(n,{create:!0})).createSyncAccessHandle();let f=new Uint8Array(new SharedArrayBuffer(16));f.fill(90);let a=r.write(f,{at:0}),l=new Uint8Array(new SharedArrayBuffer(16)),L=r.read(l,{at:0});return a===16&&L===16&&l[15]===90}catch{return!1}finally{try{r?.close()}catch{}try{await t.removeEntry(n)}catch{}}}function xt(t={}){let n=t.root??null,r=!1,s=null,f=t.handleMode??\"auto\",a=typeof t.openDelayMs==\"function\"?t.openDelayMs:null,l=new Map,L={attempts:Math.max(0,t.busyRetry?.attempts??0),baseMs:Math.max(1,t.busyRetry?.baseMs??10)};async function S(c){for(let E=0;;E+=1)try{return r?await c.createSyncAccessHandle({mode:Ee}):await c.createSyncAccessHandle()}catch(d){if(!(d?.name===\"NoModificationAllowedError\"||d?.name===\"InvalidStateError\")||E>=L.attempts)throw d;await Bt(L.baseMs*2**Math.min(E,8))}}async function p(){if(!n){if(typeof navigator>\"u\"||!navigator.storage?.getDirectory)throw new N(-1,\"OPFS is unavailable here\");if(n=await navigator.storage.getDirectory(),t.rootDirectory)for(let E of String(t.rootDirectory).split(\"/\").filter(Boolean))n=await n.getDirectoryHandle(E,{create:!0})}let c=await Rn(n);if(s=await Tn(n),f===\"shared\"&&!c.supported)throw new N(-1,`shared OPFS handle modes are unsupported here (${c.detail})`);return r=f!==\"exclusive\"&&c.supported,l.set(\"\",n),{sharedModes:r,sharedModesDetail:c.detail,sharedViews:s}}async function T(c,E){let d=c.join(\"/\"),m=l.get(d);if(m)return m;let y=n,x=\"\";for(let F of c){x=x?`${x}/${F}`:F;let g=l.get(x);if(g){y=g;continue}y=await y.getDirectoryHandle(F,{create:E}),l.set(x,y)}return y}async function A(c,E){try{return await c.getFileHandle(E)}catch(d){if(d?.name===\"NotFoundError\")return null;throw d}}return{kind:\"opfs\",init:p,get sharedModes(){return r},get sharedViews(){return s},async openFile(c,E,d){if(n||await p(),a){let U=a(c);U>0&&await Bt(U)}let m=(d&4)!==0,y=m&&(d&256)!==0,x=await T(E.slice(0,-1),y),F=E[E.length-1],g=null;if(d&8&&await A(x,F))throw new N(-1,`${c} exists`);g=await x.getFileHandle(F,{create:m});let D=await S(g);return d&16&&D.truncate(0),D},async exists(c,E){n||await p();let d;try{d=await T(E.slice(0,-1),!1)}catch(y){if(y?.name===\"NotFoundError\"||y?.name===\"TypeMismatchError\")return!1;throw y}let m=E[E.length-1];if(await A(d,m))return!0;try{return await d.getDirectoryHandle(m),!0}catch{return!1}},async remove(c,E){n||await p();let d;try{d=await T(E.slice(0,-1),!1)}catch(m){throw m?.name===\"TypeMismatchError\"?hn(c):m}await d.removeEntry(E[E.length-1])},async clear(){n||await p();for await(let c of n.keys())await n.removeEntry(c,{recursive:!0});l.clear(),l.set(\"\",n)}}}var Nt=\"node:\";var mn=typeof process<\"u\"&&!!process.release&&process.release.name===\"node\",B=null,M=null,Z=null;function Ln({name:t,ifAvailable:n=!1}){return typeof navigator>\"u\"||!navigator.locks?Promise.reject(new Error(\"Web Locks are unavailable in this context\")):new Promise((r,s)=>{navigator.locks.request(t,{mode:\"exclusive\",ifAvailable:n},f=>{if(!f){r(!1);return}return r(!0),new Promise(a=>{Z=a})}).catch(s)})}function ge(t){return`${t?.name??\"Error\"}: ${t?.message??String(t)}`}function yn(t){if(!t||!t.pattern||!(t.ms>0))return;let n=new RegExp(t.pattern);return r=>n.test(r)?t.ms:0}async function wn(t,n){let r=t.role===\"reader\"?\"reader\":\"writer\";if(t.lock?.name&&!await Ln(t.lock)){let l=new Error(`the store lock ${t.lock.name} is held by another context`);throw l.name=\"LockUnavailableError\",l}t.backend===\"memory\"?M=wt({maxBytes:t.memoryMaxBytes}):M=xt({rootDirectory:t.rootDirectory,handleMode:t.handleMode??\"auto\",openDelayMs:yn(t.openDelay),busyRetry:t.busyRetry??void 0});let s={backend:M.kind,role:r,lock:t.lock?.name??null};M.init&&Object.assign(s,await M.init());let f=t.mirror?.buffer?{buffer:t.mirror.buffer,match:pt(t.mirror.suffixes??[\"/h.fsh\"]),write:t.mirror.write??r===\"writer\"}:null;return B=yt({buffer:t.buffer,backend:M,chunkBytes:t.chunkBytes??Ce,doorbell:t.doorbell??\"auto\",mirror:f,onEvent(a){(a.type===\"loop-error\"||a.type===\"step-error\")&&n({t:\"event\",event:{type:a.type,error:ge(a.error)}})}}),s.doorbellMode=B.doorbellMode===1?\"message\":\"atomics\",B.start().catch(a=>{setTimeout(()=>{throw a},0)}),s}async function Ct(t,n){switch(t?.t){case\"init\":try{let r=await wn(t,n);n({t:\"ready\",ok:!0,info:r})}catch(r){Z?.(),Z=null,n({t:\"ready\",ok:!1,error:ge(r),lockUnavailable:r?.name===\"LockUnavailableError\"})}return;case\"attach\":n({t:\"attached\",instanceId:t.instanceId,ok:!!B?.attachMemory(t.instanceId,t.memory)});return;case\"detach\":B?.detachMemory(t.instanceId);return;case\"preopen\":{let r=B?await B.preopen(t.paths??[],t.flags):[];n({t:\"preopened\",id:t.id,statuses:r});return}case\"release-preopen\":B?.releasePreopen(t.paths??[]);return;case\"stats\":n({t:\"stats\",id:t.id,stats:B?{...B.stats}:null,inventory:B?B.inventory():null,usage:M?.usage?M.usage():null});return;case\"reset\":M?.reset?.(),n({t:\"reset\",id:t.id});return;case\"clear\":try{await M?.clear?.(),n({t:\"cleared\",id:t.id,ok:!0})}catch(r){n({t:\"cleared\",id:t.id,ok:!1,error:ge(r)})}return;case\"stop\":await B?.stop(),B=null,Z?.(),Z=null,n({t:\"stopped\",id:t.id});return;default:}}function Bn(){let t=n=>self.postMessage(n);self.onmessage=n=>{Ct(n.data,t)}}async function xn(){let t=Nt+\"worker_threads\",{parentPort:n}=await import(t);if(!n)return;let r=s=>n.postMessage(s);n.on(\"message\",s=>{Ct(s,r)})}mn?xn():typeof self<\"u\"&&typeof self.postMessage==\"function\"&&typeof window>\"u\"&&Bn();})();\n";