space-data-module-sdk 0.9.2 → 0.9.4

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 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";
5
+ /** src/host/wasiThreadBrowserWorker.mjs, sha256 e79008823adb86edb2e5591380d2343eaeeb71f040dc358e3339e78541a7741d. */
6
+ export const WASI_THREAD_POOL_WORKER_BUNDLE = "(()=>{var na=Object.defineProperty;var oa=(e,t)=>{for(var s in t)na(e,s,{get:t[s],enumerable:!0})};var aa=new TextDecoder,fa=new TextEncoder,ke=\"$bin\";function ha(e){return e instanceof Uint8Array||e instanceof ArrayBuffer||ArrayBuffer.isView(e)}function ca(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function de(e,t){if(e==null)return e??null;if(ha(e)){let s=t.length;return t.push(ca(e)),{[ke]:s}}return e instanceof Date?e.toISOString():typeof e==\"bigint\"?e.toString():Array.isArray(e)?e.map(s=>de(s,t)):typeof e==\"object\"?Object.fromEntries(Object.entries(e).filter(([,s])=>s!==void 0).map(([s,i])=>[s,de(i,t)])):e}function Ht(e,t){if(e==null)return e;if(Array.isArray(e))return e.map(s=>Ht(s,t));if(typeof e==\"object\"){let s=Object.keys(e);if(s.length===1&&s[0]===ke){let i=e[ke];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,Ht(e[i],t)]))}return e}function Ye(e,t=[]){let s=fa.encode(JSON.stringify(e??null)),i=4+s.length+4;for(let l of t)i+=4+l.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 l of t)o.setUint32(a,l.length,!0),a+=4,r.set(l,a),a+=l.length;return r}function pe(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(aa.decode(e.subarray(s,s+i)));s+=i;let o=t.getUint32(s,!0);s+=4;let a=[];for(let l=0;l<o;l+=1){if(s+4>e.length)throw new RangeError(\"Hostcall envelope segment table is truncated.\");let E=t.getUint32(s,!0);if(s+=4,s+E>e.length)throw new RangeError(\"Hostcall envelope segment exceeds envelope bounds.\");a.push(e.subarray(s,s+E)),s+=E}return{meta:r,segments:a}}function Zi(e){let{meta:t,segments:s}=pe(e);return Ht(t,s)}var lt=new Int32Array(2),Ie=new Float32Array(lt.buffer),Se=new Float64Array(lt.buffer),vt=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Wt;(function(e){e[e.UTF8_BYTES=1]=\"UTF8_BYTES\",e[e.UTF16_STRING=2]=\"UTF16_STRING\"})(Wt||(Wt={}));var yt=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),Ie[0]}readFloat64(t){return lt[vt?0:1]=this.readInt32(t),lt[vt?1:0]=this.readInt32(t+4),Se[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,lt[0])}writeFloat64(t,s){Se[0]=s,this.writeInt32(t,lt[vt?0:1]),this.writeInt32(t+4,lt[vt?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===Wt.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 $t=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=yt.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=yt.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,l=this.space;t:for(s=0;s<this.vtables.length;s++){let E=this.bb.capacity()-this.vtables[s];if(o==this.bb.readInt16(E)){for(let _=2;_<o;_+=2)if(this.bb.readInt16(l+_)!=this.bb.readInt16(E+_))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 ua=Object.defineProperty,la=(e,t,s)=>t in e?ua(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,qe=(e,t,s)=>la(e,typeof t!=\"symbol\"?t+\"\":t,s),Mt=class e{constructor(){qe(this,\"bb\",null),qe(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 Et).__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 Bt(this.bb.createObjList(this.ENTRIES.bind(this),this.entriesLength()))}unpackTo(t){t.ENTRIES=this.bb.createObjList(this.ENTRIES.bind(this),this.entriesLength())}},Bt=class{constructor(t=[]){qe(this,\"ENTRIES\",t)}pack(t){let s=Mt.createEntriesVector(t,t.createObjectOffsetList(this.ENTRIES));return Mt.createConfigTable(t,s)}};var $=(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))($||{});var Ea=Object.defineProperty,_a=(e,t,s)=>t in e?Ea(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,_t=(e,t,s)=>_a(e,typeof t!=\"symbol\"?t+\"\":t,s),Et=class e{constructor(){_t(this,\"bb\",null),_t(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):$.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 Mt).__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,$.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,l,E,_){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,l),e.addNumbers(t,E),e.addTables(t,_),e.endConfigEntry(t)}unpack(){return new Zt(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())}},Zt=class{constructor(t=null,s=$.String,i=null,r=0,o=!1,a=[],l=[],E=[]){_t(this,\"KEY\",t),_t(this,\"KIND\",s),_t(this,\"STRING_VALUE\",i),_t(this,\"NUMBER_VALUE\",r),_t(this,\"BOOL_VALUE\",o),_t(this,\"STRINGS\",a),_t(this,\"NUMBERS\",l),_t(this,\"TABLES\",E)}pack(t){let s=this.KEY!==null?t.createString(this.KEY):0,i=this.STRING_VALUE!==null?t.createString(this.STRING_VALUE):0,r=Et.createStringsVector(t,t.createObjectOffsetList(this.STRINGS)),o=Et.createNumbersVector(t,this.NUMBERS),a=Et.createTablesVector(t,t.createObjectOffsetList(this.TABLES));return Et.createConfigEntry(t,s,this.KIND,i,this.NUMBER_VALUE,this.BOOL_VALUE,r,o,a)}};var wt=(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))(wt||{});var Ft=(e=>(e[e.Duplicates=0]=\"Duplicates\",e[e.None=1]=\"None\",e[e.Current=2]=\"Current\",e))(Ft||{});var da=Object.defineProperty,pa=(e,t,s)=>t in e?da(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,je=(e,t,s)=>pa(e,typeof t!=\"symbol\"?t+\"\":t,s),Vt=class e{constructor(){je(this,\"bb\",null),je(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 Et).__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 Qt(this.bb.createObjList(this.ENTRIES.bind(this),this.entriesLength()))}unpackTo(t){t.ENTRIES=this.bb.createObjList(this.ENTRIES.bind(this),this.entriesLength())}},Qt=class{constructor(t=[]){je(this,\"ENTRIES\",t)}pack(t){let s=Vt.createEntriesVector(t,t.createObjectOffsetList(this.ENTRIES));return Vt.createModuleConfig(t,s)}};var xt={};oa(xt,{BodyRef:()=>be,BoolValue:()=>Aa,CacheKeyParams:()=>Wa,ContextParams:()=>Pf,CountValue:()=>wa,CronField:()=>Af,CryptoParams:()=>$a,EnvVar:()=>Lf,EpochStreamParams:()=>Ga,ExecParams:()=>Df,ExecResult:()=>Cf,FsEntry:()=>yf,FsParams:()=>gf,FsStat:()=>Nf,HasCapabilityParams:()=>Oa,HttpParams:()=>ga,HttpResult:()=>ya,IpfsLink:()=>tf,IpfsParams:()=>Xa,IpfsPin:()=>ef,IpfsResult:()=>Ja,IpfsSwarmPeer:()=>sf,KeyslotParams:()=>Za,MqttParams:()=>wf,MqttResult:()=>Tf,NodeActivityEvent:()=>pf,NodeActivityParams:()=>df,NodeBandwidthSample:()=>_f,NodeStatusReport:()=>Ef,NumberValue:()=>ba,P2pLatestDataset:()=>lf,P2pParams:()=>af,P2pPeer:()=>hf,P2pPeerValue:()=>cf,P2pPnmEntry:()=>uf,P2pSummary:()=>ff,ProtocolParams:()=>of,Provenance:()=>Ma,ProvenanceAttribute:()=>Ba,PubsubParams:()=>rf,PubsubSubscribed:()=>nf,QuerySurfaceLimits:()=>Ka,RandomBytesParams:()=>ma,SandboxQueryParams:()=>ka,SandboxQueryResult:()=>Ya,ScheduleParams:()=>Sf,SecretParams:()=>Qa,SecretResult:()=>za,SocketParams:()=>Of,SocketResult:()=>mf,SqlStreamParams:()=>Va,StorageDeleteParams:()=>Pa,StorageExpireParams:()=>Ua,StorageExpireResult:()=>Ha,StorageIngestParams:()=>va,StorageIngestResult:()=>Fa,StorageQueryParams:()=>Na,StorageWriteParams:()=>La,StorageWriteResult:()=>Ca,StoredRecordMeta:()=>Da,StreamResult:()=>xa,SurfaceColumn:()=>ja,SurfaceTable:()=>qa,TextValue:()=>Ta,TimeValue:()=>Ra,TimersDelayParams:()=>If,WebsocketParams:()=>bf,WebsocketResult:()=>Rf});var Ia=Object.defineProperty,Sa=(e,t,s)=>t in e?Ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,n=(e,t,s)=>Sa(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 l=new Uint8Array(e.buffer,e.byteOffset+t+1,s);l.fill(0),l.set(o.subarray(0,a))}var Ke=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)}vALUE(){return this.view.getUint8(this.offset+0)!==0}setVALUE(t){this.view.setUint8(this.offset+0,t?1:0)}};n(Ke,\"SIZE\",1);n(Ke,\"ALIGN\",1);var Aa=Ke,We=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)}vALUE(){return this.view.getFloat64(this.offset+0,!0)}setVALUE(t){this.view.setFloat64(this.offset+0,t,!0)}};n(We,\"SIZE\",8);n(We,\"ALIGN\",8);var ba=We,$e=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)}uNIX_MS(){return this.view.getBigUint64(this.offset+0,!0)}setUNIX_MS(t){this.view.setBigUint64(this.offset+0,t,!0)}};n($e,\"SIZE\",8);n($e,\"ALIGN\",8);var Ra=$e,Ze=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)}vALUE(){return this.view.getBigUint64(this.offset+0,!0)}setVALUE(t){this.view.setBigUint64(this.offset+0,t,!0)}};n(Ze,\"SIZE\",8);n(Ze,\"ALIGN\",8);var wa=Ze,Qe=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)}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(Qe,\"SIZE\",257);n(Qe,\"ALIGN\",1);var Ta=Qe,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)}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(ze,\"SIZE\",56);n(ze,\"ALIGN\",8);var be=ze,Xe=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)}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(Xe,\"SIZE\",66);n(Xe,\"ALIGN\",1);var Oa=Xe,Je=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)}lENGTH(){return this.view.getUint32(this.offset+0,!0)}setLENGTH(t){this.view.setUint32(this.offset+0,t,!0)}};n(Je,\"SIZE\",4);n(Je,\"ALIGN\",4);var ma=Je,ts=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)}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(ts,\"SIZE\",40);n(ts,\"ALIGN\",8);var ga=ts,es=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)}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(es,\"SIZE\",16);n(es,\"ALIGN\",8);var ya=es,ss=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+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(ss,\"SIZE\",348);n(ss,\"ALIGN\",4);var Na=ss,is=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)}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(is,\"SIZE\",952);n(is,\"ALIGN\",8);var Da=is,rs=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)}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(rs,\"SIZE\",66);n(rs,\"ALIGN\",1);var La=rs,ns=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)}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(ns,\"SIZE\",130);n(ns,\"ALIGN\",1);var Ca=ns,os=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)}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(os,\"SIZE\",195);n(os,\"ALIGN\",1);var Pa=os,as=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)}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(as,\"SIZE\",344);n(as,\"ALIGN\",8);var Ua=as,fs=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)}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(fs,\"SIZE\",24);n(fs,\"ALIGN\",8);var Ha=fs,hs=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)}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(hs,\"SIZE\",1996);n(hs,\"ALIGN\",1);var va=hs,cs=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)}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(cs,\"SIZE\",1072);n(cs,\"ALIGN\",8);var Ma=cs,us=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,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(us,\"SIZE\",386);n(us,\"ALIGN\",1);var Ba=us,ls=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)}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(ls,\"SIZE\",736);n(ls,\"ALIGN\",8);var Fa=ls,Es=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)}dELIVER(){return this.view.getUint8(this.offset+0)}setDELIVER(t){this.view.setUint8(this.offset+0,t)}};n(Es,\"SIZE\",1);n(Es,\"ALIGN\",1);var Va=Es,_s=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)}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 be(this.buffer,this.offset+24)}};n(_s,\"SIZE\",80);n(_s,\"ALIGN\",8);var xa=_s,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)}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(ds,\"SIZE\",248);n(ds,\"ALIGN\",8);var Ga=ds,ps=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)}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(ps,\"SIZE\",2);n(ps,\"ALIGN\",1);var ka=ps,Is=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)}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 be(this.buffer,this.offset+24)}};n(Is,\"SIZE\",80);n(Is,\"ALIGN\",8);var Ya=Is,Ss=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)}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(Ss,\"SIZE\",288);n(Ss,\"ALIGN\",8);var qa=Ss,As=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(As,\"SIZE\",260);n(As,\"ALIGN\",1);var ja=As,bs=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)}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(bs,\"SIZE\",24);n(bs,\"ALIGN\",8);var Ka=bs,Rs=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)}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(Rs,\"SIZE\",261);n(Rs,\"ALIGN\",1);var Wa=Rs,ws=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)}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(ws,\"SIZE\",8);n(ws,\"ALIGN\",4);var $a=ws,Ts=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)}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(Ts,\"SIZE\",131);n(Ts,\"ALIGN\",1);var Za=Ts,Os=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)}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(Os,\"SIZE\",386);n(Os,\"ALIGN\",1);var Qa=Os,ms=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)}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(ms,\"SIZE\",664);n(ms,\"ALIGN\",8);var za=ms,gs=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)}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(gs,\"SIZE\",486);n(gs,\"ALIGN\",1);var Xa=gs,ys=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)}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(ys,\"SIZE\",856);n(ys,\"ALIGN\",8);var Ja=ys,Ns=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)}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(Ns,\"SIZE\",408);n(Ns,\"ALIGN\",8);var tf=Ns,Ds=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)}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(Ds,\"SIZE\",163);n(Ds,\"ALIGN\",1);var ef=Ds,Ls=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)}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(Ls,\"SIZE\",400);n(Ls,\"ALIGN\",8);var sf=Ls,Cs=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)}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(Cs,\"SIZE\",257);n(Cs,\"ALIGN\",1);var rf=Cs,Ps=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)}aLREADY(){return this.view.getUint8(this.offset+0)!==0}setALREADY(t){this.view.setUint8(this.offset+0,t?1:0)}};n(Ps,\"SIZE\",1);n(Ps,\"ALIGN\",1);var nf=Ps,Us=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)}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(Us,\"SIZE\",520);n(Us,\"ALIGN\",4);var of=Us,Hs=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)}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(Hs,\"SIZE\",156);n(Hs,\"ALIGN\",4);var af=Hs,vs=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)}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(vs,\"SIZE\",264);n(vs,\"ALIGN\",4);var ff=vs,Ms=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)}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(Ms,\"SIZE\",268);n(Ms,\"ALIGN\",4);var hf=Ms,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)}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(Bs,\"SIZE\",386);n(Bs,\"ALIGN\",1);var cf=Bs,Fs=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)}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(Fs,\"SIZE\",1632);n(Fs,\"ALIGN\",8);var uf=Fs,Vs=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)}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 be(this.buffer,this.offset+1016)}};n(Vs,\"SIZE\",1072);n(Vs,\"ALIGN\",8);var lf=Vs,xs=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)}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(xs,\"SIZE\",432);n(xs,\"ALIGN\",8);var Ef=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)}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(Gs,\"SIZE\",40);n(Gs,\"ALIGN\",8);var _f=Gs,ks=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)}lIMIT(){return this.view.getUint32(this.offset+0,!0)}setLIMIT(t){this.view.setUint32(this.offset+0,t,!0)}};n(ks,\"SIZE\",4);n(ks,\"ALIGN\",4);var df=ks,Ys=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)}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(Ys,\"SIZE\",440);n(Ys,\"ALIGN\",8);var pf=Ys,qs=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)}mS(){return this.view.getUint32(this.offset+0,!0)}setMS(t){this.view.setUint32(this.offset+0,t,!0)}};n(qs,\"SIZE\",4);n(qs,\"ALIGN\",4);var If=qs,js=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)}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(js,\"SIZE\",144);n(js,\"ALIGN\",8);var Sf=js,Ks=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)}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(Ks,\"SIZE\",328);n(Ks,\"ALIGN\",4);var Af=Ks,Ws=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)}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(Ws,\"SIZE\",8);n(Ws,\"ALIGN\",4);var bf=Ws,$s=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)}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($s,\"SIZE\",588);n($s,\"ALIGN\",4);var Rf=$s,Zs=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)}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(Zs,\"SIZE\",784);n(Zs,\"ALIGN\",4);var wf=Zs,Qs=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)}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(Qs,\"SIZE\",656);n(Qs,\"ALIGN\",8);var Tf=Qs,zs=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)}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(zs,\"SIZE\",600);n(zs,\"ALIGN\",4);var Of=zs,Xs=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)}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(Xs,\"SIZE\",654);n(Xs,\"ALIGN\",2);var mf=Xs,Js=class nn{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 nn(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(Js,\"SIZE\",1);n(Js,\"ALIGN\",1);var gf=Js,ti=class on{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 on(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(ti,\"SIZE\",259);n(ti,\"ALIGN\",1);var yf=ti,ei=class an{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 an(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(ei,\"SIZE\",32);n(ei,\"ALIGN\",8);var Nf=ei,si=class fn{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 fn(t,s)}tIMEOUT_MS(){return this.view.getUint32(this.offset+0,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+0,t,!0)}};n(si,\"SIZE\",4);n(si,\"ALIGN\",4);var Df=si,ii=class hn{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 hn(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(ii,\"SIZE\",386);n(ii,\"ALIGN\",1);var Lf=ii,ri=class cn{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 cn(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(ri,\"SIZE\",28);n(ri,\"ALIGN\",4);var Cf=ri,ni=class un{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 un(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(ni,\"SIZE\",386);n(ni,\"ALIGN\",1);var Pf=ni;var dt=new Int32Array(2),Re=new Float32Array(dt.buffer),we=new Float64Array(dt.buffer),Gt=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var zt;(function(e){e[e.UTF8_BYTES=1]=\"UTF8_BYTES\",e[e.UTF16_STRING=2]=\"UTF16_STRING\"})(zt||(zt={}));var pt=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 dt[0]=this.readInt32(t),Re[0]}readFloat64(t){return dt[Gt?0:1]=this.readInt32(t),dt[Gt?1:0]=this.readInt32(t+4),we[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){Re[0]=s,this.writeInt32(t,dt[0])}writeFloat64(t,s){we[0]=s,this.writeInt32(t,dt[Gt?0:1]),this.writeInt32(t+4,dt[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===zt.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 Xt=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=pt.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=pt.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,l=this.space;t:for(s=0;s<this.vtables.length;s++){let E=this.bb.capacity()-this.vtables[s];if(o==this.bb.readInt16(E)){for(let _=2;_<o;_+=2)if(this.bb.readInt16(l+_)!=this.bb.readInt16(E+_))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 oi;(function(e){e[e.DIRECT=0]=\"DIRECT\",e[e.COMMAND=1]=\"COMMAND\"})(oi||(oi={}));var It;(function(e){e[e.IMMUTABLE=0]=\"IMMUTABLE\",e[e.APPEND_ONLY=1]=\"APPEND_ONLY\",e[e.MUTABLE=2]=\"MUTABLE\"})(It||(It={}));var Z;(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\"})(Z||(Z={}));function En(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 _n(e){let t=En(e);return t.valid&&t.present?t.bytes:void 0}function dn(e){return En(e).valid}function Hf(e){return Object.prototype.toString.call(e)}function vf(e){if(!e||typeof e!=\"object\")return!1;let t=Hf(e);return t===\"[object ArrayBuffer]\"||t===\"[object SharedArrayBuffer]\"}function st(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):vf(e)?new Uint8Array(e):null}var j;(function(e){e[e.FLATBUFFER=0]=\"FLATBUFFER\",e[e.ALIGNED_BINARY=1]=\"ALIGNED_BINARY\"})(j||(j={}));var kt=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):j.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,j.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,l,E,_,I,m){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,l),e.addWireFormat(t,E),e.addFixedStringLength(t,_),e.addByteLength(t,I),e.addRequiredAlignment(t,m),e.endFlatBufferTypeRef(t)}unpack(){return new Jt(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()}},Jt=class{constructor(t=null,s=null,i=null,r=null,o=[],a=!1,l=j.FLATBUFFER,E=0,_=0,I=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=l,this.FIXED_STRING_LENGTH=E,this.BYTE_LENGTH=_,this.REQUIRED_ALIGNMENT=I}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=kt.createSchemaHashVector(t,this.SCHEMA_HASH);return kt.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 Q;(function(e){e[e.IMMUTABLE=0]=\"IMMUTABLE\",e[e.SINGLE_WRITER_MUTABLE=1]=\"SINGLE_WRITER_MUTABLE\",e[e.APPEND_ONLY=2]=\"APPEND_ONLY\"})(Q||(Q={}));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):j.FLATBUFFER}TYPE_REF(t){let s=this.bb.__offset(this.bb_pos,12);return s?(t||new kt).__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):Q.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,j.FLATBUFFER)}static addTypeRef(t,s){t.addFieldOffset(4,s,0)}static addMutability(t,s){t.addFieldInt8(5,s,Q.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 Yt(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()}},Yt=class{constructor(t=0,s=0,i=0,r=j.FLATBUFFER,o=null,a=Q.IMMUTABLE,l=z.HOST_OWNED,E=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=l,this.FRAME_ID=E,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 Tt=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 ai(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()}},ai=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=Tt.createInputsVector(t,t.createObjectOffsetList(this.INPUTS)),r=Tt.createPayloadArenaVector(t,this.PAYLOAD_ARENA);return Tt.createPIVRequest(t,s,i,r,this.TRACE_ID,this.OUTPUT_STREAM_CAP)}};var St;(function(e){e[e.OK=0]=\"OK\",e[e.NOT_FOUND=1]=\"NOT_FOUND\",e[e.YIELDED=2]=\"YIELDED\",e[e.FAILED=3]=\"FAILED\"})(St||(St={}));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):St.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,St.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,l,E,_,I){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,l),e.addErrorCode(t,E),e.addErrorMessage(t,_),e.addTraceId(t,I),e.endPIVResponse(t)}unpack(){return new fi(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()}},fi=class{constructor(t=0,s=St.OK,i=!1,r=0,o=[],a=[],l=null,E=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=l,this.ERROR_MESSAGE=E,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 W=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 Tt).__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 hi(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}},hi=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 W.startPIV(t),W.addRequest(t,s),W.addResponse(t,i),W.endPIV(t)}};var ee=65535,ht=4294967295,In=new WeakMap,Mf=new WeakMap,Bf=new WeakMap;function Y(...e){return e.find(t=>t!=null)}function X(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 li(e,t,s={}){let i=X(e,t,{defaultValue:s.defaultValue,minimum:0,maximum:s.maximum??ht});if(!Oe(i))throw new RangeError(`${t} must be a positive power of two.`);return i}function Ei(e,t,s){if(e>ht-t)throw new RangeError(`${s} offset + size exceeds the uint32 address range.`)}function _i(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 di(e){let t=In.get(e);if(!t)throw new TypeError(\"SDS PIV/TAB arena lease is invalid.\");return t}function Ff(e,t,s,i){let r=di(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&&_i(s,r.arena,i),r}function Sn(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=st(e.payload),o=Y(e.generation,e.arenaGeneration);return Ff(i,o,r,t)}function An(e,t){let s=Sn(e,t);if(!s)return null;let i=On(e.ownership),r=Tn(e.mutability);if(i===Z.PRODUCER_OWNED||r!==It.IMMUTABLE){let o=st(e.payload),a=Y(e.generation,e.arenaGeneration),l=Bf.get(e);if(l&&i===Z.SHARED&&l.lease===e.arenaLease&&l.generation===a&&l.payloadBuffer===o?.buffer&&l.payloadByteOffset===o?.byteOffset&&l.payloadByteLength===o?.byteLength&&l.frameId===me(e)&&l.ownership===i&&l.mutability===r)return s;throw new Error(`${t} producer-owned or mutable cross-invocation alias requires explicit compatible transfer forwarding.`)}return s}function Vf(e){if(e instanceof pt)return e;let t=st(e);if(t)return new pt(t);throw new TypeError(\"Expected ByteBuffer, Uint8Array, ArrayBufferView, or ArrayBuffer.\")}function ci(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 te(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 pi(e){return te(e)===\"aligned-binary\"?j.ALIGNED_BINARY:j.FLATBUFFER}function bn(e){if(e===j.ALIGNED_BINARY)return\"aligned-binary\";if(e===j.FLATBUFFER)return\"flatbuffer\";throw new TypeError(`Unsupported SDS PIV/TAB wire format value: ${e}.`)}function Ii(e){if(e==null||e===It.IMMUTABLE||e===\"immutable\"||e===\"IMMUTABLE\")return Q.IMMUTABLE;if(e===It.APPEND_ONLY||e===\"append-only\"||e===\"APPEND_ONLY\")return Q.APPEND_ONLY;if(e===It.MUTABLE||e===\"mutable\"||e===\"single-writer-mutable\"||e===\"SINGLE_WRITER_MUTABLE\")return Q.SINGLE_WRITER_MUTABLE;throw new TypeError(`Unsupported SDS PIV/TAB mutability: ${String(e)}.`)}function Rn(e){if(e===Q.APPEND_ONLY)return It.APPEND_ONLY;if(e===Q.SINGLE_WRITER_MUTABLE)return It.MUTABLE;if(e===Q.IMMUTABLE)return It.IMMUTABLE;throw new TypeError(`Unsupported SDS PIV/TAB mutability value: ${e}.`)}function Si(e){if(e==null||e===Z.BORROWED||e===Z.HOST_OWNED||e===\"borrowed\"||e===\"BORROWED\"||e===\"host-owned\"||e===\"host_owned\"||e===\"HOST_OWNED\")return z.HOST_OWNED;if(e===Z.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===Z.SHARED||e===\"shared\"||e===\"SHARED\"||e===\"transferred\"||e===\"TRANSFERRED\")return z.TRANSFERRED;throw new TypeError(`Unsupported SDS PIV/TAB ownership: ${String(e)}.`)}function wn(e){if(e===z.PLUGIN_OWNED)return Z.PRODUCER_OWNED;if(e===z.TRANSFERRED)return Z.SHARED;if(e===z.HOST_OWNED)return Z.HOST_OWNED;throw new TypeError(`Unsupported SDS PIV/TAB ownership value: ${e}.`)}function Tn(e){return Rn(Ii(e))}function On(e){return wn(Si(e))}function xf(e={},t=void 0){let s=Y(e.schemaHash,e.SCHEMA_HASH);if(!dn(s))throw new TypeError(\"SDS PIV/TAB schemaHash must contain valid bytes or hex.\");let i=te(Y(e.wireFormat,e.WIRE_FORMAT,t));return new Jt(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,_n(s)??[],!!(e.acceptsAnyFlatbuffer??e.ACCEPTS_ANY_FLATBUFFER??!1),pi(i),X(Y(e.fixedStringLength,e.FIXED_STRING_LENGTH),\"SDS PIV/TAB fixedStringLength\",{defaultValue:0,maximum:ee}),X(Y(e.byteLength,e.BYTE_LENGTH),\"SDS PIV/TAB byteLength\",{defaultValue:0,maximum:ht}),X(Y(e.requiredAlignment,e.REQUIRED_ALIGNMENT),\"SDS PIV/TAB requiredAlignment\",{defaultValue:0,maximum:ee}))}function mn(e={}){let t=e.typeRef??e.allowedType??{},s=Y(e.wireFormat,e.WIRE_FORMAT),i=Y(t.wireFormat,t.WIRE_FORMAT),r=te(Y(i,s));if(i!==void 0&&s!==void 0&&te(i)!==te(s))throw new Error(\"SDS PIV/TAB frame and typeRef wire formats disagree.\");let o=xf(t,r);if(r===\"aligned-binary\")o.REQUIRED_ALIGNMENT=li(o.REQUIRED_ALIGNMENT,\"SDS PIV/TAB aligned type requiredAlignment\",{maximum:ee}),o.BYTE_LENGTH=X(o.BYTE_LENGTH,\"SDS PIV/TAB aligned type byteLength\",{minimum:0,maximum:ht});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 gn(e,t){let s=Y(e?.alignment,e?.ALIGNMENT),i=li(s,\"SDS PIV/TAB frame alignment\",{defaultValue:Math.max(Nt,t||1)});if(i<t)throw new RangeError(`SDS PIV/TAB frame alignment ${i} is below required alignment ${t}.`);return i}function yn(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 me(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 Gf(e){let t=qt(e);return{sequence:t>>BigInt(1),endOfStream:(t&BigInt(1))===BigInt(1)}}function kf(e,t){if(t<=1)return e;let s=e%t;return s===0?e:e+t-s}function ui(e){return X(Y(e?.offset,e?.OFFSET),\"SDS PIV/TAB frame offset\",{defaultValue:0,maximum:ht})}function Nn(e){return X(Y(e?.size,e?.SIZE),\"SDS PIV/TAB frame size\",{defaultValue:0,maximum:ht})}function ge(e){return li(Y(e?.alignment,e?.ALIGNMENT),\"SDS PIV/TAB frame alignment\",{defaultValue:Nt})}function Yf(e={},t){let s=st(e.payload??new Uint8Array)??new Uint8Array;An(e,\"SDS PIV/TAB frame forwarding\");let{typeRef:i,wireFormat:r}=mn(e),o=i.REQUIRED_ALIGNMENT,a=gn(e,o);yn(r,i,s.length);let l=kf(t,a);return Ei(l,s.length,\"SDS PIV/TAB frame\"),{payload:s,padding:l-t,buffer:new Yt(l,s.length,a,pi(r),i,Ii(e.mutability),Si(e.ownership),me(e),e.portId??null)}}var Nt=8;function qf(e,t={}){let s=st(e);if(!s)throw new TypeError(\"createInvokeArenaLease requires Uint8Array-compatible arena bytes.\");let i={arena:s,generation:X(t.generation,\"SDS PIV/TAB arena lease generation\",{defaultValue:1,maximum:ht}),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>=ht)throw new RangeError(\"SDS PIV/TAB arena lease generation exceeds the uint32 range.\");if(o!==void 0){let a=st(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(Sn(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 E=On(a.ownership??\"transferred\");if(E!==Z.SHARED)throw new Error(\"SDS PIV/TAB arena transfer ownership must be transferred/shared.\");let _=Tn(a.mutability??o.mutability),I=st(o.payload),m=Object.freeze({});return Mf.set(m,{lease:r,generation:i.generation,payloadBuffer:I.buffer,payloadByteOffset:I.byteOffset,payloadByteLength:I.byteLength,frameId:me(o),ownership:E,mutability:_,consumed:!1}),m}};return In.set(r,i),Object.freeze(r)}function jf(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 pn(e){return e===\"request\"?\"PIV request\":\"PIV response\"}function Kf(e,t,s,i=Nt){if(e.byteOffset%Nt!==0)throw new Error(`${pn(s)} buffer base is not ${Nt}-byte aligned (byteOffset ${e.byteOffset}).`);if(t&&t.length>0&&t.byteOffset%i!==0)throw new Error(`${pn(s)} payload arena base is not ${i}-byte aligned (byteOffset ${t.byteOffset}).`)}function Wf(e=[],t=Yf){let s=[],i=[],r=0,o=Nt;for(let l of e){let E=t(l,r);r=ui(E.buffer)+Nn(E.buffer),o=Math.max(o,ge(E.buffer)),s.push(E.buffer),i.push(E)}let a=new Uint8Array(r);for(let l of i)a.set(l.payload,ui(l.buffer));return{frames:s,arena:a,arenaAlignment:o}}function $f(e={}){return e.offset!==void 0||e.OFFSET!==void 0}function Zf(e={},t){let s=st(e.payload),i=An(e,\"SDS PIV/TAB external frame forwarding\");i&&t&&_i(t,i.arena,\"SDS PIV/TAB external arena\");let{typeRef:r,wireFormat:o}=mn(e),a=gn(e,r.REQUIRED_ALIGNMENT),l=X(Y(e.offset,e.OFFSET),\"SDS PIV/TAB external arena frame offset\",{defaultValue:0,maximum:ht});!$f(e)&&s&&t&&s.buffer===t.buffer&&(l=s.byteOffset-t.byteOffset);let E=X(Y(e.size,e.SIZE,e.byteLength,s?.byteLength),\"SDS PIV/TAB external arena frame size\",{defaultValue:0,maximum:ht});if(Ei(l,E,\"SDS PIV/TAB external arena frame\"),yn(o,r,E),E>0&&t){if(l>t.length||E>t.length-l)throw new Error(\"SDS PIV external arena frame range exceeds externalArena.\");let _=t.byteOffset+l;if(a>1&&_%a!==0)throw new Error(`SDS PIV external arena frame \"${e.portId??\"\"}\" is misaligned: absolute offset ${_} violates alignment ${a}.`)}return new Yt(l,E,a,pi(o),r,Ii(e.mutability),Si(e.ownership),me(e),e.portId??null)}function Qf(e=[],t){let s=st(t);if(!s)throw new TypeError(\"SDS PIV external arena encoding requires externalArena bytes.\");let i=Nt;return{frames:e.map(o=>{let a=Zf(o,s);return i=Math.max(i,ge(a)),a}),arena:new Uint8Array,arenaAlignment:i,externalArena:s}}function zf(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:bn(e.WIRE_FORMAT()),rootTypeName:e.ROOT_TYPE()??null,fixedStringLength:X(e.FIXED_STRING_LENGTH(),\"SDS PIV/TAB decoded fixedStringLength\",{defaultValue:0,maximum:ee}),byteLength:X(e.BYTE_LENGTH(),\"SDS PIV/TAB decoded byteLength\",{defaultValue:0,maximum:ht}),requiredAlignment:X(e.REQUIRED_ALIGNMENT(),\"SDS PIV/TAB decoded requiredAlignment\",{defaultValue:0,maximum:ee})}}function Xf(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 Jf(e){if(!e)return null;let t=ci(e.OFFSET()),s=ci(e.SIZE()),i=ge({ALIGNMENT:e.ALIGNMENT()}),r=bn(e.WIRE_FORMAT()),o=qt(e.FRAME_ID()),a=Gf(o),l={typeRef:zf(e.TYPE_REF()),portId:e.PORT_ID()??null,alignment:i,offset:t,size:s,ownership:wn(e.OWNERSHIP()),generation:0,mutability:Rn(e.MUTABILITY()),frameId:o,traceId:o,streamId:0,sequence:a.sequence,endOfStream:a.endOfStream,wireFormat:r};return Xf(l),l}function th(e,t){let s=[];for(let i=0;i<e;i++){let r=Jf(t(i));r&&s.push(r)}return s}function eh(e,t={}){let s=st(t.externalArena),i=e.length>0?e:s??e;if(!t.arenaLease)return qf(i);let r=di(t.arenaLease);if(r.closed)throw new Error(\"SDS PIV/TAB decoded arena lease is closed.\");return _i(i,r.arena,\"SDS PIV/TAB decoded arena\"),t.arenaLease}function sh(e=[],t,s={}){let i=st(s.externalArena),r=s.arenaLease,o=r?di(r).generation:void 0;return e.map(a=>{let l=ui(a),E=Nn(a),_=t.length>0?t:i,I=t.length>0?\"PAYLOAD_ARENA\":\"external arena\";if(Ei(l,E,\"SDS PIV/TAB decoded frame\"),E>0&&!_)throw new Error(\"SDS PIV external arena bytes are required when PAYLOAD_ARENA is empty.\");if(_&&(l>_.length||E>_.length-l))throw new Error(`SDS PIV TAB payload range exceeds ${I}.`);let m=ge(a);if(_&&m>1&&E>0){let T=_.byteOffset+l;if(T%m!==0)throw new Error(`SDS PIV TAB \"${a.portId??\"\"}\" payload is misaligned: absolute offset ${T} violates alignment ${m}.`)}let A=_?_.subarray(l,l+E):new Uint8Array;return{...a,payload:A,typeRef:a.typeRef??null,arenaLease:r,arenaGeneration:o,generation:o}})}function ih(e,t){return t.map(s=>s.pack(e))}function Dn(e,t={}){let s=Vf(e);if(!W.bufferHasIdentifier(s))throw new Error(\"SDS PIV invoke request buffer identifier mismatch.\");let r=W.getRootAsPIV(s).REQUEST();if(!r)throw new Error(\"SDS PIV invoke envelope does not contain a request.\");let o=r.payloadArenaArray()??new Uint8Array,a=th(r.inputsLength(),_=>r.INPUTS(_)),l=eh(o,t),E=sh(a,o,{...t,arenaLease:l});return{methodId:r.METHOD_ID()??null,inputFrames:E,inputs:E,payloadArena:o,arenaLease:l,traceId:r.TRACE_ID()??BigInt(0),outputStreamCap:r.OUTPUT_STREAM_CAP()??0,envelope:\"PIV\"}}function rh(e={}){return e.status!==void 0?e.status:e.yielded===!0?St.YIELDED:Number(e.statusCode??0)!==0||e.errorCode?St.FAILED:St.OK}function Ai(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):Wf(t),o=new Xt(1024),a=e.errorCode!==null&&e.errorCode!==void 0?o.createString(String(e.errorCode)):0,l=e.errorMessage!==null&&e.errorMessage!==void 0?o.createString(String(e.errorMessage)):0,E=B.createOutputsVector(o,ih(o,s)),_=jf(o,i,r);B.startPIVResponse(o),B.addStatusCode(o,Number(e.statusCode??0)),B.addStatus(o,rh(e)),B.addYielded(o,e.yielded===!0),B.addBacklogRemaining(o,ci(e.backlogRemaining)),B.addOutputs(o,E),B.addPayloadArena(o,_),B.addErrorCode(o,a),B.addErrorMessage(o,l),B.addTraceId(o,qt(e.traceId));let I=B.endPIVResponse(o);W.startPIV(o),W.addResponse(o,I),W.finishPIVBuffer(o,W.endPIV(o));let m=o.asUint8Array(),A=W.getRootAsPIV(new pt(m));return Kf(m,A.RESPONSE()?.payloadArenaArray(),\"response\",r),m}var Ln=Object.freeze({Inline:0,Ref:1}),Cn=Object.freeze({Duplicates:0,None:1,Current:2}),ye=Object.freeze({Stream:0,Rows:1,Auto:2}),Pn=Object.freeze({Default:0,Ed25519:1,Secp256k1:2,Secp256k1Digest:3,X25519:4,Sha256:5,Sha512:6,Aes256Gcm:7,HkdfSha256:8});var i_=Object.freeze({TimerTick:\"TICK\",HttpRequest:\"HREQ\",HttpResponse:\"HRSP\",ModuleConfig:\"MCFG\",IngestRequest:\"INGQ\",IngestResult:\"INGR\",FlowNotice:\"FNTC\"});function nh(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 oh=e=>e==null?\"\":String(e);function ah(e,t){let s=new $t(256);return t(s,e.pack(s)),s.asUint8Array().slice()}function fh(e,t){let s=new Zt(String(e));if(typeof t==\"string\")s.KIND=$.String,s.STRING_VALUE=t;else if(typeof t==\"number\"||typeof t==\"bigint\")s.KIND=$.Number,s.NUMBER_VALUE=Number(t);else if(typeof t==\"boolean\")s.KIND=$.Bool,s.BOOL_VALUE=t;else if(Array.isArray(t))if(t.every(i=>typeof i==\"number\"))s.KIND=$.NumberList,s.NUMBERS=t.map(Number);else if(t.every(i=>i&&typeof i==\"object\"&&!Array.isArray(i)))s.KIND=$.TableList,s.TABLES=t.map(i=>new Bt(Ri(i)));else if(t.every(i=>typeof i==\"string\"))s.KIND=$.StringList,s.STRINGS=t.slice();else throw new Error(`ModuleConfig: ${e} mixes value kinds`);else if(t&&typeof t==\"object\")s.KIND=$.TableList,s.TABLES=[new Bt(Ri(t))];else throw new Error(`ModuleConfig: ${e} has no config value kind (${t===null?\"null\":typeof t})`);return s}var Ri=e=>Object.keys(e||{}).filter(t=>e[t]!==void 0&&e[t]!==null).sort().map(t=>fh(t,e[t]));function vn(e={}){return ah(new Qt(Ri(e)),Vt.finishModuleConfigBuffer)}var hh={duplicates:Ft.Duplicates,none:Ft.None,current:Ft.Current},r_=Object.fromEntries(Object.entries(hh).map(([e,t])=>[t,e]));var ch={unchanged:wt.Unchanged,skipped:wt.Skipped,missing:wt.Missing,expired:wt.Expired,info:wt.Info},n_=Object.fromEntries(Object.entries(ch).map(([e,t])=>[t,e]));var Un=\"HostOps.fbs\";function se(e){let t=xt[e];if(typeof t!=\"function\"||!t.SIZE)throw new Error(`hostcall: ${e} is not a HostOps record`);return t}var Mn=e=>e[0].toLowerCase()+e.slice(1);function uh(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 wi(e,t,s,i){for(let[r,o]of Object.entries(s||{})){if(o==null)continue;let a=e.prototype,l=Mn(r);if(typeof a[`set${r}At`]==\"function\"){if(t[`set${r}Length`](o.length),o.forEach((E,_)=>t[`set${r}At`](_,E)),typeof a[`setHas${r}`]==\"function\"&&t[`setHas${r}`](!0),t[`${l}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[l]==\"function\"&&typeof o==\"object\"){let E=t[l]();wi(E.constructor,E,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[l]()==\"bigint\"?BigInt(o):o),typeof o==\"string\"&&t[l]()!==o)throw new RangeError(`${i}.${r}: \"${o.slice(0,40)}...\" exceeds the record's ${new TextEncoder().encode(t[l]()).length}-byte string`)}}function Bn(e,t){let s={};for(let i of uh(e)){let r=Mn(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}`]()?Bn(t[i]().constructor,t[i]()):null)}return s}function lh(e,t){let s=se(e),i=new Uint8Array(s.SIZE);return wi(s,s.fromPointer(i.buffer,0),t,e),i}function Eh(e,t){let s=se(e),i=new Uint8Array(s.SIZE*t.length);return t.forEach((r,o)=>wi(s,s.fromPointer(i.buffer,o*s.SIZE),r,`${e}[${o}]`)),i}function _h(e,t){let s={},i={},r={};for(let o of e||[]){let a=o.portId??o.PORT_ID,l=o.typeRef||{},E=l.rootType??l.rootTypeName??l.ROOT_TYPE??null,_=o.payload instanceof Uint8Array?o.payload:new Uint8Array(o.payload||[]);if((o.wireFormat??l.wireFormat)===\"aligned-binary\"&&E){let I=se(E),m=_.slice();if(m.length%I.SIZE)throw new RangeError(`${t}: ${a} is ${m.length} bytes, not a whole number of ${E} (${I.SIZE})`);let A=Array.from({length:m.length/I.SIZE},(T,w)=>Bn(I,I.fromPointer(m.buffer,w*I.SIZE)));Number(l.byteLength??0)>0?s[a]={type:E,value:A[0]??null}:i[a]={type:E,values:A}}else r[a]=_.slice()}return{records:s,lists:i,raw:r}}var dh=e=>typeof e==\"string\"?new TextEncoder().encode(e):e instanceof Uint8Array?e:new Uint8Array(e);function ph(e,{record:t,recordPort:s,recordType:i,raw:r={},lists:o={}},a,l,E){let _=[];if(t!=null){if(!i)throw new Error(`${E}: takes no ${s} record`);let I=se(i);_.push({portId:s,wireFormat:\"aligned-binary\",typeRef:{schemaName:Un,rootType:i,wireFormat:\"aligned-binary\",byteLength:I.SIZE,requiredAlignment:I.ALIGN},payload:lh(i,t)})}for(let[I,m]of Object.entries(o)){let A=l[I];if(!A)throw new Error(`${E}: no list port ${I}`);let T=se(A);_.push({portId:I,wireFormat:\"aligned-binary\",typeRef:{schemaName:Un,rootType:A,wireFormat:\"aligned-binary\",byteLength:0,requiredAlignment:T.ALIGN},payload:Eh(A,m)})}for(let[I,m]of Object.entries(r)){if(!a.includes(I))throw new Error(`${E}: no raw port ${I}`);_.push({portId:I,payload:dh(m)})}return _}function Fn(e){let t=Dn(e),s=t.methodId??\"\",{records:i,lists:r,raw:o}=_h(t.inputs,s),a=ie[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(([l,E])=>[l,E.values])),raw:o}}var Vn=Object.freeze({null:0,bool:1,i64:2,f64:3,str:4,bytes:5}),Ih=Object.fromEntries(Object.entries(Vn).map(([e,t])=>[t,e]));function xn(e){let t=(e||[]).map(o=>{let a=o&&typeof o==\"object\"&&!(o instanceof Uint8Array)&&\"t\"in o?o:null,l=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,E=a?a.v:o,_;switch(l){case\"null\":_=new Uint8Array(0);break;case\"bool\":_=Uint8Array.of(E?1:0);break;case\"i64\":_=new Uint8Array(8),new DataView(_.buffer).setBigInt64(0,BigInt(E),!0);break;case\"f64\":_=new Uint8Array(8),new DataView(_.buffer).setFloat64(0,Number(E),!0);break;case\"str\":_=new TextEncoder().encode(String(E));break;case\"bytes\":_=E instanceof Uint8Array?E:new Uint8Array(E);break;default:throw new TypeError(`SQL value ${String(o)} has no FlatSQL parameter tag`)}return[Vn[l],_]}),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 Gn(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),l=r+5;if(l+a>t.length)throw new RangeError(\"SQL values: payload exceeds the buffer\");let E=Ih[o],_={null:0,bool:1,i64:8,f64:8}[E];if(E===void 0)throw new RangeError(`SQL values: unknown tag ${o}`);if(_!==void 0&&a!==_)throw new RangeError(`SQL values: a ${E} carries ${_} bytes, not ${a}`);let I=t.subarray(l,l+a);i.push({t:E,v:E===\"null\"?null:E===\"bool\"?I[0]!==0:E===\"i64\"?s.getBigInt64(l,!0):E===\"f64\"?s.getFloat64(l,!0):E===\"str\"?new TextDecoder().decode(I):I.slice()}),r=l+a}return i}var Sh=Object.freeze([\"unsupported\",\"not-authorized\",\"invalid-params\",\"failed\",\"refused\",\"sandbox\",\"timeout\",\"too-large\"]);function Ti(e){if(e?.ok){let s=ie[e.op];if(!s)throw new Error(`hostcall: unknown operation ${e.op}`);let i=ph(s,{record:e.result,recordPort:\"result\",recordType:s.result,raw:e.raw,lists:e.lists},s.rawOut,s.listsOut,`${e.op} result`);return Ai({statusCode:0,outputs:i})}let t=e?.error?.code??\"failed\";if(!Sh.includes(t))throw new Error(`hostcall: unknown error code ${t}`);return Ai({statusCode:1,status:\"FAILED\",errorCode:t,errorMessage:oh(e?.error?.message)})}function kn(e){return nh(e)===\"$PIV\"}var p=(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||{})}),Ah=[\"data\",\"key\",\"private_key\",\"public_key\",\"signature\",\"nonce\",\"aad\",\"ikm\",\"salt\",\"info\",\"envelope\"],bh=[\"data\",\"nonce\",\"private_key\",\"public_key\"],L=(e,t)=>p(\"CryptoParams\",e,t,{rawIn:Ah,rawOut:bh}),Hn={rawOut:[\"stream\"]},bi={rawIn:[\"sql\",\"params\"]},ie=Object.freeze({\"host.runtimeTarget\":p(null,null,null,{rawOut:[\"value\"]}),\"host.listCapabilities\":p(null,null,null,{listsOut:{items:\"TextValue\"}}),\"host.listSupportedCapabilities\":p(null,null,null,{listsOut:{items:\"TextValue\"}}),\"host.listOperations\":p(null,null,null,{listsOut:{items:\"TextValue\"}}),\"host.hasCapability\":p(\"HasCapabilityParams\",\"BoolValue\",null),\"clock.now\":p(null,\"TimeValue\",\"clock\"),\"clock.nowIso\":p(null,null,\"clock\",{rawOut:[\"value\"]}),\"clock.monotonicNow\":p(null,\"NumberValue\",\"clock\"),\"random.bytes\":p(\"RandomBytesParams\",null,\"random\",{rawOut:[\"data\"]}),\"node.publicKey\":p(null,null,null,{rawOut:[\"value\"]}),\"node.peerId\":p(null,null,null,{rawOut:[\"value\"]}),\"plugin.getConfig\":p(null,null,null,{rawOut:[\"config\"]}),\"http.request\":p(\"HttpParams\",\"HttpResult\",\"http\",{rawIn:[\"url\",\"headers\",\"body\"],rawOut:[\"url\",\"headers\",\"body\"]}),\"websocket.exchange\":p(\"WebsocketParams\",\"WebsocketResult\",\"websocket\",{rawIn:[\"url\",\"protocols\",\"message\"],rawOut:[\"url\",\"body\"]}),\"mqtt.publish\":p(\"MqttParams\",\"MqttResult\",\"mqtt\",{rawIn:[\"payload\",\"password\"]}),\"mqtt.subscribeOnce\":p(\"MqttParams\",\"MqttResult\",\"mqtt\",{rawIn:[\"password\"],rawOut:[\"body\"]}),\"tcp.request\":p(\"SocketParams\",\"SocketResult\",\"tcp\",{rawIn:[\"data\"],rawOut:[\"body\"]}),\"udp.request\":p(\"SocketParams\",\"SocketResult\",\"udp\",{rawIn:[\"data\"],rawOut:[\"body\"]}),\"tls.request\":p(\"SocketParams\",\"SocketResult\",\"tls\",{rawIn:[\"data\",\"ca\",\"cert\",\"key\"],rawOut:[\"body\"]}),\"storage.query\":p(\"StorageQueryParams\",null,\"storage_query\",{listsOut:{records_meta:\"StoredRecordMeta\"},rawOut:[\"records\"]}),\"storage.write\":p(\"StorageWriteParams\",\"StorageWriteResult\",\"storage_write\",{rawIn:[\"data\"]}),\"storage.delete\":p(\"StorageDeleteParams\",null,\"storage_write\"),\"storage.expire\":p(\"StorageExpireParams\",\"StorageExpireResult\",\"storage_write\"),\"storage.ingest_with_source\":p(\"StorageIngestParams\",\"StorageIngestResult\",\"storage_ingest\",{rawIn:[\"records\",\"archive\"],listsIn:{provenance:\"Provenance\",provenance_attributes:\"ProvenanceAttribute\"}}),\"storage.flatsql_query_stream\":p(\"SqlStreamParams\",\"StreamResult\",\"storage_query\",{...bi,...Hn}),\"storage.flatsql_epoch_stream\":p(\"EpochStreamParams\",\"StreamResult\",\"storage_query\",Hn),\"storage.query_sandboxed\":p(\"SandboxQueryParams\",\"SandboxQueryResult\",\"storage_query\",{...bi,rawOut:[\"stream\",\"cells\"],listsOut:{columns:\"TextValue\"}}),\"storage.query_surface\":p(null,\"QuerySurfaceLimits\",\"storage_query\",{listsOut:{tables:\"SurfaceTable\",columns:\"SurfaceColumn\"}}),\"storage.flatsql_cache_key\":p(\"CacheKeyParams\",null,\"storage_query\",{...bi,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\":p(\"KeyslotParams\",null,\"wallet_sign\",{rawIn:[\"payload\"],rawOut:[\"data\"]}),\"keyslot.unwrap\":p(\"KeyslotParams\",null,\"wallet_sign\",{rawIn:[\"ephemeral_public_key\",\"nonce\",\"ciphertext\"],rawOut:[\"data\"]}),\"secrets.get\":p(\"SecretParams\",\"SecretResult\",\"secrets\",{rawOut:[\"secret\"]}),\"secrets.status\":p(\"SecretParams\",\"SecretResult\",\"secrets\"),\"secrets.put\":p(\"SecretParams\",\"SecretResult\",\"secrets\",{rawIn:[\"secret\"]}),\"secrets.clear\":p(\"SecretParams\",null,\"secrets\"),\"ipfs.add\":p(\"IpfsParams\",\"IpfsResult\",\"ipfs\",{rawIn:[\"data\"]}),\"ipfs.cat\":p(\"IpfsParams\",null,\"ipfs\",{rawOut:[\"data\"]}),\"ipfs.ls\":p(\"IpfsParams\",null,\"ipfs\",{listsOut:{links:\"IpfsLink\"}}),\"ipfs.pin_add\":p(\"IpfsParams\",null,\"ipfs\",{listsOut:{items:\"TextValue\"}}),\"ipfs.pin_rm\":p(\"IpfsParams\",null,\"ipfs\",{listsOut:{items:\"TextValue\"}}),\"ipfs.pin_ls\":p(\"IpfsParams\",null,\"ipfs\",{listsOut:{pins:\"IpfsPin\"}}),\"ipfs.dag_get\":p(\"IpfsParams\",null,\"ipfs\",{rawOut:[\"data\"]}),\"ipfs.name_resolve\":p(\"IpfsParams\",\"IpfsResult\",\"ipfs\"),\"ipfs.name_publish\":p(\"IpfsParams\",\"IpfsResult\",\"ipfs\"),\"ipfs.id\":p(null,\"IpfsResult\",\"ipfs\",{listsOut:{addresses:\"TextValue\"}}),\"ipfs.swarm_peers\":p(null,null,\"ipfs\",{listsOut:{peers:\"IpfsSwarmPeer\"}}),\"ipfs.pubsub_publish\":p(\"PubsubParams\",null,\"ipfs\",{rawIn:[\"data\"]}),\"pubsub.publish\":p(\"PubsubParams\",null,\"pubsub\",{rawIn:[\"data\"]}),\"pubsub.subscribe\":p(\"PubsubParams\",\"PubsubSubscribed\",\"pubsub\"),\"pubsub.unsubscribe\":p(\"PubsubParams\",null,\"pubsub\"),\"pubsub.list_topics\":p(null,null,\"pubsub\",{listsOut:{items:\"TextValue\"}}),\"protocol.request\":p(\"ProtocolParams\",null,\"protocol_dial\",{rawIn:[\"payload\"],rawOut:[\"data\"]}),\"protocol_dial.dial\":p(\"ProtocolParams\",null,\"protocol_dial\"),\"protocol_handle.register\":p(\"ProtocolParams\",null,\"protocol_handle\"),\"protocol_handle.unregister\":p(\"ProtocolParams\",null,\"protocol_handle\"),\"p2p.peers_snapshot\":p(\"P2pParams\",\"P2pSummary\",\"p2p_read\",{listsOut:{peers:\"P2pPeer\",peer_addresses:\"P2pPeerValue\",peer_standards:\"P2pPeerValue\"},rawOut:[\"records\"]}),\"p2p.standards_snapshot\":p(\"P2pParams\",null,\"p2p_read\",{listsOut:{entries:\"P2pPnmEntry\"},rawOut:[\"records\"]}),\"p2p.pnm_history\":p(\"P2pParams\",\"P2pSummary\",\"p2p_read\",{listsOut:{entries:\"P2pPnmEntry\"},rawOut:[\"records\"]}),\"p2p.latest_dataset\":p(\"P2pParams\",\"P2pLatestDataset\",\"p2p_read\",{rawOut:[\"stream\"]}),\"node_status_read.status\":p(null,\"NodeStatusReport\",\"node_status_read\",{listsOut:{bandwidth_history:\"NodeBandwidthSample\"}}),\"node_activity_read.activity\":p(\"NodeActivityParams\",null,\"node_activity_read\",{listsOut:{events:\"NodeActivityEvent\"}}),\"timers.delay\":p(\"TimersDelayParams\",null,\"timers\"),\"schedule.parse\":p(\"ScheduleParams\",null,\"schedule_cron\",{listsOut:{fields:\"CronField\"}}),\"schedule.matches\":p(\"ScheduleParams\",\"BoolValue\",\"schedule_cron\"),\"schedule.next\":p(\"ScheduleParams\",\"TimeValue\",\"schedule_cron\"),\"filesystem.resolvePath\":p(null,null,\"filesystem\",{rawIn:[\"path\"],rawOut:[\"path\"]}),\"filesystem.readFile\":p(null,null,\"filesystem\",{rawIn:[\"path\"],rawOut:[\"data\"]}),\"filesystem.writeFile\":p(null,null,\"filesystem\",{rawIn:[\"path\",\"data\"]}),\"filesystem.appendFile\":p(null,null,\"filesystem\",{rawIn:[\"path\",\"data\"]}),\"filesystem.deleteFile\":p(null,null,\"filesystem\",{rawIn:[\"path\"]}),\"filesystem.mkdir\":p(\"FsParams\",null,\"filesystem\",{rawIn:[\"path\"]}),\"filesystem.readdir\":p(null,null,\"filesystem\",{rawIn:[\"path\"],listsOut:{entries:\"FsEntry\"}}),\"filesystem.stat\":p(null,\"FsStat\",\"filesystem\",{rawIn:[\"path\"],rawOut:[\"path\"]}),\"filesystem.rename\":p(null,null,\"filesystem\",{rawIn:[\"path\",\"to_path\"]}),\"exec.execFile\":p(\"ExecParams\",\"ExecResult\",\"process_exec\",{rawIn:[\"file\",\"cwd\",\"input\"],listsIn:{args:\"TextValue\",env:\"EnvVar\"},rawOut:[\"stdout\",\"stderr\"]}),\"context.get\":p(\"ContextParams\",\"BoolValue\",\"context_read\",{rawOut:[\"value\"]}),\"context.listKeys\":p(\"ContextParams\",null,\"context_read\",{listsOut:{items:\"TextValue\"}}),\"context.listScopes\":p(null,null,\"context_read\",{listsOut:{items:\"TextValue\"}}),\"context.set\":p(\"ContextParams\",null,\"context_write\",{rawIn:[\"value\"]}),\"context.delete\":p(\"ContextParams\",\"BoolValue\",\"context_write\")});function Rh(e){if(!Number.isInteger(e)||e<0||e>255)throw new TypeError(\"Expected byte values in range 0..255.\")}function wh(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(Rh),Uint8Array.from(e);throw new TypeError(\"Expected Uint8Array, ArrayBuffer, ArrayBufferView, or byte array.\")}function Oi(e){return Buffer.from(wh(e)).toString(\"base64\")}var Yn=256*1024*1024;function mi(e){let t=String(e??\"\").trim();if(t.length>Yn)throw new RangeError(`Base64 input exceeds ${Yn} character limit.`);return new Uint8Array(Buffer.from(t,\"base64\"))}var Th=new TextDecoder,Ui=new TextEncoder,P=e=>e===void 0?void 0:Th.decode(e),ct=e=>e==null?void 0:e instanceof Uint8Array?e:typeof e==\"string\"?Ui.encode(e):new Uint8Array(e),re=e=>(e||[]).map(t=>({VALUE:String(t)})),qn=e=>BigInt(Math.round(e instanceof Date?e.getTime():Number(e))),zn=e=>e.toLowerCase().replace(/_([a-z0-9])/g,(t,s)=>s.toUpperCase()),Oh=e=>e.replace(/([a-z0-9])([A-Z])/g,\"$1_$2\").toUpperCase();function Ue(e){let t={};for(let[s,i]of Object.entries(e||{}))i==null||i===\"\"||i===0||i===0n||i===!1||(t[zn(s)]=typeof i==\"bigint\"?Number(i):i);return t}function He(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[Oh(i)]=r);return mh(e,s)}function mh(e,t){let s=xt[e]?.prototype;return s?Object.fromEntries(Object.entries(t).filter(([i])=>typeof s[`set${i}`]==\"function\")):t}function gh(e){if(!e)return;let t={};for(let s of P(e).split(/\\r?\\n/)){let i=s.indexOf(\":\");i>0&&(t[s.slice(0,i).trim()]=s.slice(i+1).trim())}return t}function yh(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 gi=16;function Nh(e){if(!e||e.length<gi)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-gi),tag:e.subarray(e.length-gi)}}var Dh=(e,t)=>{let s=new Uint8Array(e.length+t.length);return s.set(e,0),s.set(t,e.length),s},nt=(e,t=\"failed\")=>Object.assign(new Error(e),{hostcallCode:t}),R=e=>e==null?\"\":String(e);function bt(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 Pe=(e,t)=>Object.keys(e).find(s=>e[s]===Number(t??0))??\"\",rt=e=>e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?new Uint8Array(e):void 0,jn=new Map;function Lh(e){let t=jn.get(e);return t||jn.set(e,t=e.fromPointer(new ArrayBuffer(e.SIZE),0)),t}function Ch(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 Xn(e,t){let s=Lh(e),i=e.prototype,r={};for(let[o,a]of Object.entries(t||{})){if(a==null)continue;let l=o[0].toLowerCase()+o.slice(1);if(typeof i[`set${o}`]!=\"function\"){typeof i[l]==\"function\"&&typeof i[`setHas${o}`]==\"function\"&&typeof a==\"object\"&&(r[o]=Xn(s[l]().constructor,a));continue}let E=typeof s[l]();r[o]=E===\"bigint\"?Ch(a):E===\"number\"?Number.isFinite(Number(a))?Number(a):0:E===\"boolean\"?a===!0||a===\"true\":String(a)}return r}var H=(e,t)=>Xn(xt[e],t);function Ne(e,t){let s={};for(let[i,r]of Object.entries(t||{}))[\"string\",\"number\",\"boolean\",\"bigint\"].includes(typeof r)&&(s[i.toUpperCase()]=r);return H(e,s)}function G(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 Ph(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 Kn=2**53;function Uh(e){if(!e.params)return;let t;try{t=Gn(e.params)}catch(s){throw nt(`params: ${s.message}`,\"invalid-params\")}return t.map(({t:s,v:i})=>s===\"null\"?{t:s}:s===\"i64\"?{t:s,v:i>BigInt(Kn)||i<-BigInt(Kn)?i.toString():Number(i)}:{t:s,v:i})}var Hh=e=>Pe(Ln,e?.DELIVER)===\"Ref\"?\"ref\":void 0;function vi(e,t){delete e.deliver;let s=Hh(t);return s&&(e.deliver=s),e}function yi({params:e,raw:t}){let s={sql:P(t.sql)??\"\"},i=Uh(t);return i&&(s.params=i),vi(s,e)}var Jn=e=>({TOKEN:e.token,SIZE:e.size,FRAMES:e.frames??-1,FNV1A64:R(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=Jn(e.ref):rt(e?.stream)&&(i.raw.stream=rt(e.stream)),i.result=H(t,s),i}function vh(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 nt(`storage.query_sandboxed: a cell is a ${Array.isArray(e)?\"list\":typeof e} (nested values are not SQL values)`)}function Hi(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)=>Hi(s,`${t}.${i}`));if(typeof e==\"object\"){if(e instanceof Date||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)throw nt(`plugin.getConfig: ${t} is a ${e.constructor?.name??\"object\"}`);let s={};for(let i of Object.keys(e)){let r=Hi(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 nt(`plugin.getConfig: ${t} is a ${typeof e}`)}}function Mh(e){let t=Hi(e??{},\"\")??{};if(Array.isArray(t)||typeof t!=\"object\")throw nt(\"plugin.getConfig: the config is not an object\");try{return vn(t)}catch(s){throw nt(`plugin.getConfig: ${s.message}`)}}function De({params:e,raw:t}){let s={id:R(e?.ID)};return e?.USERNAME&&(s.username=e.USERNAME),t.secret&&(s.secret=P(t.secret)),s}function Wn(e){return{result:H(\"SecretResult\",{ID:R(e?.id),CONFIGURED:e?.configured===!0||e?.stored===!0,USERNAME_MASKED:R(e?.username_masked),UPDATED_MS:bt(e?.updated_at??e?.updatedAt)??0n,VERIFIED_MS:bt(e?.verified_at)??0n})}}function $n(e){return t=>{if(t==null||t===\"\")throw nt(`node ${e} not available`);return{raw:{value:String(t)}}}}function Zn(e){return H(\"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:bt(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 Di=e=>rt(e?.records)?{records:rt(e.records)}:{},Bh={Default:\"\",Ed25519:\"ed25519\",Secp256k1:\"secp256k1\",X25519:\"x25519\",Sha256:\"sha256\",Sha512:\"sha512\",Aes256Gcm:\"aes-256-gcm\",HkdfSha256:\"hkdf-sha256\"},Fh=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;function Vh(e){let t=rt(e);if(t)return t;let s=typeof e==\"string\"?e:e&&typeof e==\"object\"&&e.__type===\"bytes\"?R(e.base64):void 0;if(!(s===void 0||!Fh.test(s)))return mi(s)}function Le(e,t){return(s,{op:i})=>{let r=t===void 0?s:s&&typeof s==\"object\"&&!rt(s)?s[t]:void 0,o=Vh(r);if(!o)throw nt(`${i}: the host answered no ${t??\"bytes\"}`);return{raw:{[e]:o}}}}function jt(e,t,s,i){return s[i]!==void 0&&(e[t]=Oi(s[i])),e}var Qn=e=>{let t=Number(e);return Number.isFinite(t)?Math.trunc(t):0},Li=e=>t=>({lists:{items:(Array.isArray(t?.[e])?t[e]:[]).map(R).sort().map(s=>({VALUE:s}))}}),xh={ns:1e-6,us:.001,µs:.001,μs:.001,ms:1,s:1e3,m:6e4,h:36e5};function Gh(e){let t=R(e);if(t===\"0\")return 0;let s=/^([-+]?)((?:(?:\\d+\\.?\\d*|\\.\\d+)(?:ns|us|µs|μs|ms|s|m|h))+)$/.exec(t);if(!s)return 0;let i=0;for(let[,r,o]of s[2].matchAll(/(\\d+\\.?\\d*|\\.\\d+)(ns|us|µs|μs|ms|s|m|h)/g))i+=Number(r)*xh[o];return s[1]===\"-\"?-i:i}function kh(e){let t=s=>Array.isArray(s)?s.map(t):s&&typeof s==\"object\"?Object.fromEntries(Object.keys(s).sort().map(i=>[i,t(s[i])])):s;return JSON.stringify(t(e)??null).replace(/[<>&\\u2028\\u2029]/g,s=>`\\\\u${s.charCodeAt(0).toString(16).padStart(4,\"0\")}`)}var ne=e=>e&&typeof e==\"object\"&&!Array.isArray(e)?e:{},Ce=({params:e})=>vi(G(e),e),At=e=>Array.isArray(e)?e.filter(t=>t&&typeof t==\"object\"):[],to={\"host.runtimeTarget\":{out:e=>({raw:{value:String(e)}})},\"host.listCapabilities\":{out:e=>({lists:{items:re(e)}})},\"host.listSupportedCapabilities\":{out:e=>({lists:{items:re(e)}})},\"host.listOperations\":{out:e=>({lists:{items:re(e)}})},\"host.hasCapability\":{in:({params:e})=>({capability:e?.CAPABILITY}),out:e=>({result:{VALUE:!!e}})},\"clock.now\":{out:e=>({result:{UNIX_MS:qn(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:ct(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:qn(e)}})},\"http.request\":{in:({params:e,raw:t})=>({url:P(t.url),method:e?.METHOD||\"GET\",headers:gh(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=ct(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:yh(e?.headers)??\"\",body:s}}}},\"websocket.exchange\":{in:({params:e,raw:t})=>({url:P(t.url),protocols:t.protocols?P(t.protocols).split(\",\").map(s=>s.trim()).filter(Boolean):void 0,message:t.message===void 0?void 0:e?.MESSAGE_IS_TEXT?P(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:ct(e.body)}}})},\"mqtt.publish\":{in:({params:e,raw:t})=>({...Ue(e),keepAliveSeconds:e?.KEEP_ALIVE_S||void 0,payload:t.payload,password:P(t.password)}),out:e=>({result:He(\"MqttResult\",e)})},\"mqtt.subscribeOnce\":{in:({params:e,raw:t})=>({...Ue(e),keepAliveSeconds:e?.KEEP_ALIVE_S||void 0,password:P(t.password),responseType:\"bytes\"}),out:e=>({result:He(\"MqttResult\",e),raw:e?.payload==null&&e?.body==null?{}:{body:ct(e.payload??e.body)}})},\"tcp.request\":Pi(),\"udp.request\":Pi(),\"tls.request\":Pi(({raw:e})=>({ca:P(e.ca),cert:P(e.cert),key:P(e.key)})),\"filesystem.resolvePath\":{in:({raw:e})=>({path:P(e.path)}),out:e=>({raw:{path:String(e)}})},\"filesystem.readFile\":{in:({raw:e})=>({path:P(e.path)}),out:e=>({raw:{data:ct(e)}})},\"filesystem.writeFile\":{in:({raw:e})=>({path:P(e.path),value:e.data??new Uint8Array(0)}),out:()=>({})},\"filesystem.appendFile\":{in:({raw:e})=>({path:P(e.path),value:e.data??new Uint8Array(0)}),out:()=>({})},\"filesystem.deleteFile\":{in:({raw:e})=>({path:P(e.path)}),out:()=>({})},\"filesystem.mkdir\":{in:({params:e,raw:t})=>({path:P(t.path),recursive:!e?.NOT_RECURSIVE}),out:()=>({})},\"filesystem.readdir\":{in:({raw:e})=>({path:P(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:P(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:P(e.path),toPath:P(e.to_path)}),out:()=>({})},\"exec.execFile\":{in:({params:e,raw:t,lists:s})=>({file:P(t.file),args:(s.args||[]).map(i=>i.VALUE),cwd:P(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:ct(e?.stdout)??new Uint8Array(0),stderr:ct(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:ct(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:re(e)}})},\"context.listScopes\":{out:e=>({lists:{items:re(e)}})},\"crypto.sha256\":{in:({raw:e})=>({value:e.data??new Uint8Array(0)}),out:it},\"crypto.sha512\":{in:({raw:e})=>({value:e.data??new Uint8Array(0)}),out:it},\"crypto.hkdf\":{in:({params:e,raw:t})=>({ikm:t.ikm,salt:t.salt??new Uint8Array(0),info:t.info,length:e?.LENGTH||32}),out:it},\"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:Dh(e.ciphertext,e.tag),nonce:t.nonce}})},\"crypto.aesGcmDecrypt\":{in:({raw:e})=>({key:e.key,...Nh(e.data),iv:e.nonce,aad:e.aad}),out:it},\"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:it},\"crypto.x25519.sharedSecret\":{in:({raw:e})=>({privateKey:e.private_key,publicKey:e.public_key}),out:it},\"crypto.sealedBox.encryptForRecipient\":{in:({raw:e})=>({plaintext:e.data??new Uint8Array(0),recipientPublicKey:e.public_key,context:e.info?P(e.info):void 0}),out:e=>({raw:{data:mi(e.protectedBlobBase64)}})},\"crypto.sealedBox.decryptFromEnvelope\":{in:({raw:e})=>({envelope:{protectedBlobBase64:Oi(e.envelope??e.data)},recipientPrivateKey:e.private_key}),out:it},\"crypto.secp256k1.publicKeyFromPrivate\":{in:({raw:e})=>({privateKey:e.private_key}),out:it},\"crypto.secp256k1.sign\":{in:({raw:e})=>({message:e.data,privateKey:e.private_key}),out:it},\"crypto.secp256k1.verify\":{in:({raw:e})=>({message:e.data,signature:e.signature,publicKey:e.public_key}),out:Ci},\"crypto.secp256k1.signDigest\":{in:({raw:e})=>({digest:e.data,privateKey:e.private_key}),out:it},\"crypto.secp256k1.verifyDigest\":{in:({raw:e})=>({digest:e.data,signature:e.signature,publicKey:e.public_key}),out:Ci},\"crypto.ed25519.publicKeyFromSeed\":{in:({raw:e})=>({seed:e.private_key}),out:it},\"crypto.ed25519.sign\":{in:({raw:e})=>({message:e.data,seed:e.private_key}),out:it},\"crypto.ed25519.verify\":{in:({raw:e})=>({message:e.data,signature:e.signature,publicKey:e.public_key}),out:Ci},\"plugin.getConfig\":{in:()=>({}),out:e=>({raw:{config:Mh(e)}})},\"node.peerId\":{in:()=>({}),out:$n(\"peer ID\")},\"node.publicKey\":{in:()=>({}),out:$n(\"public key\")},\"secrets.get\":{in:De,out:e=>({result:H(\"SecretResult\",{ID:R(e?.id),USERNAME:R(e?.username),CONFIGURED:!0}),raw:{secret:ct(e?.secret)??new Uint8Array(0)}})},\"secrets.status\":{in:De,out:Wn},\"secrets.put\":{in:De,out:Wn},\"secrets.clear\":{in:De,out:()=>({})},\"storage.write\":{in:({params:e,raw:t})=>({...G(e),data:t.data??new Uint8Array(0)}),out:e=>({result:H(\"StorageWriteResult\",{CID:R(e?.cid)})})},\"storage.query\":{in:({params:e})=>G(e),out:e=>{let t=[],s=[];for(let i of At(Array.isArray(e)?e:e?.records)){let r=i.SourceTags||{},o=rt(i.Data)??new Uint8Array(0);s.push(o),t.push(H(\"StoredRecordMeta\",{CID:R(i.CID),ROW_ID:i.RowID??0,PEER_ID:R(i.PeerID),TIMESTAMP_MS:bt(i.Timestamp)??0n,MATERIALIZED_MS:bt(i.MaterializedAt)??0n,LENGTH:o.length,PROVIDER_ID:R(r.ProviderID),SOURCE_NAME:R(r.SourceName),BATCH_ID:R(r.BatchID),PRODUCER_PEER_ID:R(r.ProducerPeerID),LICENSE:R(r.License)}))}return{lists:{records_meta:t},raw:{records:Ph(s)}}}},\"storage.delete\":{in:({params:e})=>G(e),out:()=>({})},\"storage.expire\":{in:({params:e})=>G(e),out:e=>({result:Ne(\"StorageExpireResult\",e)})},\"storage.ingest_with_source\":{in:({params:e,raw:t,lists:s})=>{let i=G(e);delete i.archive_source,delete i.archive_name,i.reconcile=Pe(Cn,e?.RECONCILE).toLowerCase(),t.records&&(i.records=t.records),t.archive&&(i.archive={source:R(e?.ARCHIVE_SOURCE),name:R(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(E=>({name:R(E.NAME),value:R(E.VALUE)})));for(let[E,_]of Object.entries(r||{}))a[E.toLowerCase()]=typeof _==\"bigint\"?Number(_):_??\"\";let l=Object.fromEntries(Object.keys(a).sort().map(E=>[E,a[E]]));i.provenance={source:R(e?.SOURCE_NAME),json:Ui.encode(JSON.stringify(l))}}return i},out:e=>{let t=Ne(\"StorageIngestResult\",e);return e?.provenance&&(t.PROVENANCE_FILE=R(e.provenance)),{result:t}}},\"storage.flatsql_query_stream\":{in:yi,out:e=>Ni(e)},\"storage.flatsql_epoch_stream\":{in:({params:e})=>vi(G(e),e),out:e=>Ni(e)},\"storage.query_sandboxed\":{in:e=>({...yi(e),want:Pe(ye,e.params?.WANT).toLowerCase()}),out:e=>{if(e?.kind!==\"rows\"){let o=Ni(e,\"SandboxQueryResult\");return o.result.KIND=ye.Stream,o}let t=typeof e.json==\"string\"?e.json:rt(e.json)?P(rt(e.json)):void 0;if(t===void 0)throw nt(\"storage.query_sandboxed: rows answer carries no rows\");let s;try{s=JSON.parse(t)}catch(o){throw nt(`storage.query_sandboxed: ${o.message}`)}if(!Array.isArray(s))throw nt(\"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 nt(\"storage.query_sandboxed: a row is not an object\");for(let a of Object.values(o))r.push(vh(a))}return{result:H(\"SandboxQueryResult\",{KIND:ye.Rows,ROWS:s.length,COLUMNS:i.length}),lists:{columns:i.map(o=>({VALUE:o}))},raw:{cells:xn(r)}}}},\"storage.query_surface\":{in:()=>({}),out:e=>{let t=[],s=[];for(let r of At(e?.tables)){let o=R(r.name);t.push(H(\"SurfaceTable\",{NAME:o,KIND:R(r.kind),SOURCE:R(r.source),RECORDS:r.records??0}));for(let a of Array.isArray(r.columns)?r.columns:[])typeof a==\"string\"?s.push(H(\"SurfaceColumn\",{TABLE:o,NAME:a})):a&&typeof a==\"object\"&&s.push(H(\"SurfaceColumn\",{TABLE:o,NAME:R(a.name),PLACEHOLDER:a.placeholder===!0}))}let i=e?.caps&&typeof e.caps==\"object\"?e.caps:null;return{...i?{result:H(\"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={...G(e.params),...yi(e)};return e.lists.projection&&(t.projection=e.lists.projection.map(s=>R(s.VALUE))),t},out:e=>({raw:{value:R(e?.key)}})},\"p2p.peers_snapshot\":{in:Ce,out:e=>{let t=[],s=[],i=[];for(let r of At(e?.peers)){t.push(H(\"P2pPeer\",{PEER_ID:R(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(H(\"P2pPeerValue\",{PEER_ID:R(r.peer_id),VALUE:R(o)}));for(let o of Array.isArray(r.standards)?r.standards:[])i.push(H(\"P2pPeerValue\",{PEER_ID:R(r.peer_id),VALUE:R(o)}))}return{result:Ne(\"P2pSummary\",e),lists:{peers:t,peer_addresses:s,peer_standards:i},raw:Di(e)}}},\"p2p.standards_snapshot\":{in:Ce,out:e=>({lists:{entries:At(e?.entries).map(Zn)},raw:Di(e)})},\"p2p.pnm_history\":{in:Ce,out:e=>({result:Ne(\"P2pSummary\",e),lists:{entries:At(e?.entries).map(Zn)},raw:Di(e)})},\"p2p.latest_dataset\":{in:Ce,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:H(\"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:bt(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:bt(t.published_at),ETAG_FNV1A64:t.etag_fnv1a64,REF:t.ref&&typeof t.ref==\"object\"?Jn(t.ref):void 0}),raw:rt(t.stream)?{stream:rt(t.stream)}:{}}}},\"keyslot.sign\":{in:({params:e,raw:t})=>{let s={slotId:R(e?.SLOT_ID)},i=Bh[Pe(Pn,e?.ALGORITHM)];return i&&(s.algorithm=i),jt(s,\"payload\",t,\"payload\")},out:Le(\"data\",\"signature\")},\"keyslot.unwrap\":{in:({params:e,raw:t})=>{let s={slotId:R(e?.SLOT_ID)};return jt(s,\"ephemeralPublicKey\",t,\"ephemeral_public_key\"),jt(s,\"nonce\",t,\"nonce\"),jt(s,\"ciphertext\",t,\"ciphertext\")},out:Le(\"data\",\"plaintext\")},\"protocol.request\":{in:({params:e,raw:t})=>{let s={target:R(e?.TARGET),protocolId:R(e?.PROTOCOL_ID)};return Number(e?.TIMEOUT_MS)>0&&(s.timeoutMs=Number(e.TIMEOUT_MS)),jt(s,\"payloadBase64\",t,\"payload\")},out:Le(\"data\")},\"pubsub.list_topics\":{in:()=>({}),out:Li(\"topics\")},\"ipfs.cat\":{in:({params:e})=>G(e),out:Le(\"data\")},\"ipfs.dag_get\":{in:({params:e})=>G(e),out:e=>({raw:{data:rt(e)??Ui.encode(kh(e))}})},\"ipfs.ls\":{in:({params:e})=>G(e),out:e=>({lists:{links:At(ne(e).Objects).flatMap(t=>At(t.Links)).map(t=>H(\"IpfsLink\",{NAME:R(t.Name),CID:R(t.Hash),SIZE:Qn(t.Size),TYPE:Qn(t.Type)}))}})},\"ipfs.pin_add\":{in:({params:e})=>G(e),out:Li(\"Pins\")},\"ipfs.pin_rm\":{in:({params:e})=>G(e),out:Li(\"Pins\")},\"ipfs.pin_ls\":{in:({params:e})=>G(e),out:e=>{let t=ne(ne(e).Keys);return{lists:{pins:Object.keys(t).sort().map(s=>H(\"IpfsPin\",{CID:s,TYPE:R(ne(t[s]).Type)}))}}}},\"ipfs.name_resolve\":{in:({params:e})=>G(e),out:e=>({result:H(\"IpfsResult\",{VALUE:R(e?.Path)})})},\"ipfs.name_publish\":{in:({params:e})=>G(e),out:e=>({result:H(\"IpfsResult\",{NAME:R(e?.Name),VALUE:R(e?.Value)})})},\"ipfs.id\":{in:()=>({}),out:e=>({result:H(\"IpfsResult\",{NAME:R(e?.ID),VALUE:R(e?.PublicKey),AGENT_VERSION:R(e?.AgentVersion),PROTOCOL_VERSION:R(e?.ProtocolVersion)}),lists:{addresses:(Array.isArray(e?.Addresses)?e.Addresses:[]).map(t=>({VALUE:R(t)}))}})},\"ipfs.swarm_peers\":{in:()=>({}),out:e=>({lists:{peers:At(ne(e).Peers).map(t=>H(\"IpfsSwarmPeer\",{PEER_ID:R(t.Peer),ADDRESS:R(t.Addr),LATENCY_MS:Gh(t.Latency)}))}})},\"ipfs.pubsub_publish\":{in:({params:e,raw:t})=>jt({topic:R(e?.TOPIC)},\"base64\",t,\"data\"),out:()=>({})},\"node_status_read.status\":{in:()=>({}),out:e=>{let t=e?.store||{},s=e?.service||{},i={UPTIME_S:e?.uptime_seconds??0,STARTED_MS:bt(e?.started_at)??0n,STORE_TOTAL_BYTES:t.total_bytes??0,STORE_TOTAL_RECORDS:t.total_records??0,STORAGE_PATH:R(t.storage_path),SERVICE_STATE:R(s.state),SERVICE_MODE:R(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 At(o.history))r.push(H(\"NodeBandwidthSample\",{TS_MS:bt(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:H(\"NodeStatusReport\",i),lists:{bandwidth_history:r}}}},\"node_activity_read.activity\":{in:({params:e})=>G(e),out:e=>({lists:{events:At(e?.events).map(t=>H(\"NodeActivityEvent\",{TS_MS:bt(t.ts)??0n,KIND:R(t.kind),DETAIL:R(t.detail),PEER_ID:R(t.peer_id)}))}})}};function it(e){return{raw:{data:ct(e)??new Uint8Array(0)}}}function Ci(e){return{result:{VALUE:!!e}}}function Pi(e=()=>({})){return{in:t=>{let{params:s,raw:i}=t,r=Ue(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:He(\"SocketResult\",t),raw:t?.body==null?{}:{body:ct(t.body)}})}}function Yh(e){let t=to[e.op];return t?.in?t.in(e):{...Ue(e.params),...Object.fromEntries(Object.entries(e.raw).map(([s,i])=>[zn(s),i]))}}function qh(e,t){let s=to[e.op];if(s?.out)return s.out(t,e);let i=ie[e.op];return{result:i?.result?He(i.result,t):void 0}}function jh(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 eo(e,t,{allowAsync:s=!1}={}){let i,r=a=>Ti({ok:!1,error:{code:jh(a),message:String(a?.message??a)}}),o=a=>{try{return Ti({ok:!0,op:i.op,...qh(i,a)})}catch(l){return r(l)}};try{if(i=Fn(e),!ie[i.op])throw Object.assign(new Error(`Unknown host operation \"${i.op}\".`),{hostcallCode:\"unsupported\"});let a=t(i.op,Yh(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 so=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\"}}),__=Object.freeze([\"ipfs.ls\",\"ipfs.pin_add\",\"ipfs.pin_rm\",\"ipfs.pin_ls\",\"ipfs.dag_get\",\"ipfs.id\",\"ipfs.swarm_peers\",\"ipfs.name_resolve\",\"ipfs.name_publish\",\"ipfs.pubsub_publish\"]),d_=Object.freeze([...new Set(Object.values(so).map(e=>e.capability).filter(Boolean))]);var Kh=new TextDecoder,Bi=\"space_data_module_host\",Dt=0,Mi=1,R_=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 Wh(e,t){let s=String(e??\"\").trim();if(!s)throw new TypeError(`${t} is required.`);return s}function no(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 io(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=no(e);if(t+s>r.byteLength)throw new RangeError(`${i} range exceeds guest memory bounds.`);return new Uint8Array(r,t,s)}function $h(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=no(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 Zh(e){if(e.length===0)return null;let{meta:t,segments:s}=pe(e);return Ht(t,s)}function ro(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 Qh(e){return e!==null&&typeof e==\"object\"&&typeof e.then==\"function\"}function oo(e={}){let t=e.dispatch;if(typeof t!=\"function\")throw new TypeError(\"createHostcallBridge requires a dispatch function.\");let s=e.getMemory,i=Wh(e.moduleName??Bi,\"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,l={ok:!0,result:null},E=Ye(l,[]);function _(d,S){let b=[],y=de(S,b),g=Ye(y,b);if(g.length>o)throw new Error(`Hostcall response exceeds ${o} byte limit.`);a=d,l=S,E=g}function I(d,S,b,y){try{if(y>r)throw new Error(`Hostcall request exceeds ${r} byte limit.`);let g=Kh.decode(io(s,d,S,\"Operation\")),M=io(s,b,y,\"Payload\");if(kn(M)){let Rt=eo(M.slice(),t);if(Rt.length>o)throw new Error(`Hostcall response exceeds ${o} byte limit.`);return a=Dt,l=null,E=Rt,Dt}let K=Zh(M),F=t(g,K);if(Qh(F))throw typeof F.catch==\"function\"&&F.catch(()=>{}),new Error(`Operation \"${g}\" returned a Promise. The synchronous hostcall ABI only supports synchronous operations.`);return _(Dt,{ok:!0,result:F===void 0?null:F}),Dt}catch(g){try{_(Mi,{ok:!1,error:ro(g)})}catch(M){_(Mi,{ok:!1,error:ro(M)})}return Mi}}function m(){return E.length}function A(d,S){return $h(s,d,E,S)}function T(){return _(Dt,{ok:!0,result:null}),Dt}function w(){return a}return{moduleName:i,imports:{[i]:{call:I,response_len:m,read_response:A,clear_response:T,last_status_code:w}},getLastEnvelope(){return structuredClone(l)},getLastResponseBytes(){return new Uint8Array(E)},getLastResponseEnvelope(){let{meta:d,segments:S}=pe(E);return Ht(d,S)}}}var T_=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}),O_=Object.freeze({OK:0,GENERIC:-1,NOENT:-2,ACCESS:-3,IO:-4,NOSPACE:-5,BADHANDLE:-6,BUSY:-7});var m_=Object.freeze([\"flatsql_io_open\",\"flatsql_io_read\",\"flatsql_io_write\",\"flatsql_io_truncate\",\"flatsql_io_sync\",\"flatsql_io_size\",\"flatsql_io_close\"]),ve=4096;var g_=typeof TextDecoder==\"function\"?new TextDecoder(\"utf-8\",{fatal:!0}):null;function ao(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 zh=1330201683,Xh=1,Jh=0,tc=1,ec=2,sc=3,ic=4,ho=5;var rc=7;var nc=9,Be=10,oc=11;var ac=13,Io=64,co=Io*4;var fc=1;var hc=1,cc=2,uc=3,ae=32767,fe=0,So=1,uo=2,lc=3,Ec=4,_c=5,dc=6,pc=7,Ic=8,Sc=9,lo=10,Ao=11,Ac=12,bc=13,Rc=8,bo=9,Fi=128,Vi=0,wc=1,Tc=2;var Oc=4,mc=0;var gc=0,yc=1,Nc=1,oe=2,Me=3,Dc=4,Lc=5,Cc=6,Pc=7;var D_=64*1024;var Eo=250,Uc=20;function _o(){return typeof performance<\"u\"&&performance.now?performance.now():Date.now()}function Hc(e,t){return Math.ceil(e/t)*t}function Ro(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 vc(e){Ro(e);let t=new Int32Array(e,0,Io);if(t[Jh]!==zh||t[tc]!==Xh)throw new TypeError(\"Not a SAB I/O channel buffer (bad magic or version).\");let s=t[ec],i=t[sc],r=t[ic],o=t[oc],a=Hc(co+r*4,64),l=new Int32Array(e,co,r),E=[];for(let _=0;_<s;_+=1){let I=a+_*i;E.push({index:_,base:I,i32:new Int32Array(e,I,Fi/4),f64:new Float64Array(e,I,Fi/8),data:new Uint8Array(e,I+Fi,o)})}return{buffer:e,header:t,instances:l,slots:E,slotCount:s,slotBytes:i,dataBytes:o,maxInstances:r,channelId:t[ac]}}function Mc(e){return`sdm-sab-io-doorbell-${e}`}function Bc(e,t){Atomics.add(e.header,ho,1),Atomics.notify(e.header,ho),Atomics.load(e.header,rc)===fc&&t()?.postMessage(0)}function Fc(e){let t=null;return{get(){return!t&&typeof BroadcastChannel==\"function\"&&(t=new BroadcastChannel(e)),t},close(){t?.close(),t=null}}}var Vc=typeof TextEncoder==\"function\"?new TextEncoder:null;function xc(){return(Math.random()*2147483646|0)+1}function Gc(e,t){let s=(Atomics.add(e.header,nc,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,fe,Vi,wc)===Vi)return Atomics.store(r.i32,So,t),r}return null}function po(e,t){Atomics.store(t.i32,So,0),Atomics.store(t.i32,fe,Vi),Atomics.add(e.header,Be,1),Atomics.notify(e.header,Be)}function kc(e,t,s){let i=e.i32;i[Ec]=t,i[_c]=s.instanceId??ae,i[dc]=s.handle??-1,i[pc]=s.flags??0,i[Ic]=s.ptr??0,i[Sc]=s.len??0,i[bc]=s.dataInSlot?yc:gc,i[Ao]=0,e.f64[Rc]=s.offset??0,e.f64[bo]=0,s.path?(e.data.set(s.path,0),i[lo]=s.path.length):i[lo]=0}function Yc(e){return Atomics.load(e.i32,Ao)}function wo(e={}){Ro(e.buffer);let t=vc(e.buffer),s=Number.isInteger(e.instanceId)?e.instanceId:ae;if(s!==ae&&(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):Uc,o=xc(),a=Fc(Mc(t.channelId)),l=0;function E(){for(;;){let d=Atomics.load(t.header,Be),S=Gc(t,o);if(S)return S;Atomics.wait(t.header,Be,d,Eo)}}function _(d,S,b){let y=Atomics.load(d.i32,uo)+1|0||1;kc(d,S,b),Atomics.store(d.i32,Ac,mc),Atomics.store(d.i32,uo,y),Atomics.store(d.i32,fe,Tc),Bc(t,a.get);let g=r>0?_o()+r/1e3:0;for(;;){let M=Atomics.load(d.i32,fe);if(M===Oc&&Atomics.load(d.i32,lc)===y)break;g>0&&_o()<g||Atomics.wait(d.i32,fe,M,Eo)}return l+=1,{status:Yc(d),result:d.f64[bo]}}function I(d,S){let b=E();try{return _(b,d,S)}finally{po(t,b)}}function m(){return s!==ae&&Atomics.load(t.instances,s)===hc}function A(){if(s===ae)return!1;let d=Atomics.load(t.instances,s);return d===cc||d===uc}function T(d,S,b,y){let g=0;for(;g<b.length;){let M=Math.min(t.dataBytes,b.length-g),K=E(),F;try{d===Me&&K.data.set(b.subarray(g,g+M),0),F=_(K,d,{instanceId:s,dataInSlot:!0,handle:S,ptr:0,len:M,offset:y+g}).status,d===oe&&F>0&&b.set(K.data.subarray(0,F),g)}finally{po(t,K)}if(F<0)return g>0&&d===oe?g:F;if(g+=F,F<M)break}return g}function w(d,S){let b=i(),y=b?.buffer??b;return!y||d<0||S<0||d+S>y.byteLength?null:new Uint8Array(y,d,S)}return{instanceId:s,get requests(){return l},open(d,S){let b=typeof d==\"string\"?Vc.encode(d):d;return!(b instanceof Uint8Array)||b.length===0?-1:b.length>Math.min(t.dataBytes,ve)?-1:I(Nc,{instanceId:s,flags:S|0,path:b}).status},read(d,S,b,y){if(b===0)return 0;if(m())return I(oe,{instanceId:s,handle:d,ptr:S,len:b,offset:y}).status;let g=w(S,b);return g?T(oe,d,g,y):A()?-3:-1},write(d,S,b,y){if(b===0)return 0;if(m())return I(Me,{instanceId:s,handle:d,ptr:S,len:b,offset:y}).status;let g=w(S,b);return g?T(Me,d,g,y):A()?-3:-1},readInto(d,S,b){return S.length===0?0:T(oe,d,S,b)},writeFrom(d,S,b){return S.length===0?0:T(Me,d,S,b)},truncate(d,S){return I(Dc,{instanceId:s,handle:d,offset:S}).status},sync(d){return I(Lc,{instanceId:s,handle:d}).status},size(d){let{status:S,result:b}=I(Cc,{instanceId:s,handle:d});return S<0?S:b},close(d){return I(Pc,{instanceId:s,handle:d}).status},release(){a.close()}}}var qc=typeof TextEncoder==\"function\"?new TextEncoder:null;function jc(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 To=new WeakMap;function Oo(e){let t=To.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,l=a+i*32,E=l+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,l,i*o),data:new Uint8Array(e,E,i*r)},To.set(e,t),t}function Kc(e){return typeof e==\"string\"?qc.encode(e):e}function Wc(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 $c(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&&Wc(e,i,t))return i;i=(i+1)%e.entries}return-1}function mo(e,t){let s=Oo(e),i=Kc(t);if(i.length>s.maxPathBytes)return-1;let r=$c(s,i,jc(i));return r<0?-1:Atomics.load(s.i32,r*(32/4)+0)===2?r:-1}function go(e,t,s,i){let r=Oo(e),o=t*(32/4),a=t*(32/8)+3,l=t*r.entryBytes;for(let E=0;E<64;E+=1){let _=Atomics.load(r.i32,o+1);if(_&1)continue;if(Atomics.load(r.i32,o+0)!==2)return-1;let I=r.f64[a],m=Atomics.load(r.i32,o+4),A;if(i>=I)A=0;else{let T=Math.min(s.length,I-i);i+T>m?A=-1:(s.set(r.data.subarray(l+i,l+i+T),0),A=T)}if(Atomics.load(r.i32,o+1)===_)return A}return-1}function yo(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 Zc=\"flatsql-io\",mt=Object.freeze({open:1,read:2,write:3,truncate:4,sync:5,size:6,close:7,mirrorRead:8}),No=24,Do=16777215;function xi(){return typeof performance<\"u\"&&performance.now?performance.now()*1e3:Date.now()*1e3}function Qc(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 l=Atomics.add(t,0,1);l<s&&(i[l]=xi()-a,r[l]=o)}}function zc(e,t,s){if(!e||s<=0||s>ve||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=Qc(e.trace),o=e.mirror?.buffer??null,a=o?yo(e.mirror.suffixes??[\"/h.fsh\"]):null,l=new Map,E=new TextDecoder;function _(A){if(!i)return{provider:s[0],local:A};let T=A>>>No,w=s[T];return w?{provider:w,local:A&Do}:null}function I(A,T,w){let d=r?xi():0,S;try{S=w()}catch{S=T}return r&&r(A,d),S}return{env:{flatsql_io_open(A,T,w){return I(mt.open,-1,()=>{let d=zc(t(),A,T);if(!d)return-1;let S=i?ao(d)%s.length:0,b=s[S].open(d,w|0);if(b<0)return b;if(i&&b>Do)return-4;let y=i?S<<No|b:b;if(a){let g=E.decode(d);a(g)&&l.set(y,g)}return y})},flatsql_io_read(A,T,w,d){if(o&&l.has(A)){let S=r?xi():0;try{let b=t(),y=b.buffer??b;if(T>=0&&w>=0&&T+w<=y.byteLength){let g=mo(o,l.get(A));if(g>=0){let M=go(o,g,new Uint8Array(y,T,w),d);if(M>=0)return r&&r(mt.mirrorRead,S),M}}}catch{}}return I(mt.read,-4,()=>{let S=_(A);return S?S.provider.read(S.local,T,w,d):-6})},flatsql_io_write(A,T,w,d){return I(mt.write,-4,()=>{let S=_(A);return S?S.provider.write(S.local,T,w,d):-6})},flatsql_io_truncate(A,T){return I(mt.truncate,-4,()=>{let w=_(A);return w?w.provider.truncate(w.local,T):-6})},flatsql_io_sync(A){return I(mt.sync,-4,()=>{let T=_(A);return T?T.provider.sync(T.local):-6})},flatsql_io_size(A){return I(mt.size,-4,()=>{let T=_(A);return T?T.provider.size(T.local):-6})},flatsql_io_close(A){return I(mt.close,-4,()=>{l.delete(A);let T=_(A);return T?T.provider.close(T.local):-6})}}}}function Jc(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=>wo({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 Lo(e,t){let s=[],i=[];for(let r of e??[]){let o;if(typeof r==\"function\")o=r(t);else if(r&&r.provider===Zc)o=Jc(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 Co(e,t){for(let s of t)for(let[i,r]of Object.entries(s??{}))e[i]={...e[i]??{},...r};return e}var he=0,tu=1,eu=2,Uo=4,Gi=0,Po=1;var su=0;var ki=Uo*4,iu=4*1024*1024;function ru(e){if(typeof SharedArrayBuffer!=\"function\"||!(e instanceof SharedArrayBuffer))throw new TypeError(\"SAB hostcall channel requires a SharedArrayBuffer (cross-origin isolation in browsers).\")}function Ho(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:iu;if(t<=0)throw new RangeError(\"maxResponseBytes must be a positive integer.\");return new SharedArrayBuffer(ki+t)}function vo(e={}){ru(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,Uo),r=e.buffer.byteLength-ki;return function(a,l=null){if(Atomics.store(i,he,Po),t({operation:a,params:l}),Atomics.wait(i,he,Po,s)===\"timed-out\")throw Atomics.store(i,he,Gi),new Error(`Hostcall \"${a}\" timed out after ${s}ms waiting for the controlling thread.`);let _=Atomics.load(i,tu),I=Atomics.load(i,eu);if(I<0||I>r)throw Atomics.store(i,he,Gi),new RangeError(`Hostcall \"${a}\" response length ${I} exceeds channel capacity ${r}.`);let m=new Uint8Array(I);m.set(new Uint8Array(e.buffer,ki,I)),Atomics.store(i,he,Gi);let A=Zi(m);if(_!==su){let T=new Error(A?.message??`Hostcall \"${a}\" failed on the host thread.`);throw T.name=A?.name??\"Error\",T.code=A?.code??null,T.operation=A?.operation??a,T.capability=A?.capability??null,T}return A}}var Yi=class extends Error{constructor(t){super(`WASI exit with code ${t}`),this.name=\"WasiExitError\",this.code=t}};function nu(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 Mo(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},l=e.crypto??globalThis.crypto??null,E=[],_=[],I=0,m=null;function A(O){m=O}function T(){return m}function w(){return new Uint8Array(m.buffer)}function d(){return new DataView(m.buffer)}let b=Object.entries(i).map(([O,N])=>`${O}=${N}`).map(O=>new TextEncoder().encode(O)),y=s.map(O=>new TextEncoder().encode(O));function g(O,N,U){let v;if(O===0)v=BigInt(Math.round((a.timeOrigin+a.now())*1e6));else if(O===1)v=BigInt(Math.round(a.now()*1e6));else return 28;return d().setBigUint64(U,v,!0),0}function M(O,N,U,v){if(O!==1&&O!==2)return 8;let C=O===1?E:_,k=0,Ct=d(),Pt=w();for(let Ut=0;Ut<U;Ut++){let _e=N+Ut*8,gt=Ct.getUint32(_e,!0),q=Ct.getUint32(_e+4,!0);if(t){let ut=O===1?t.stdout:t.stderr,$i=nu(t.control,O,q,ut.length);if($i<0)return 51;ut.set(Pt.subarray(gt,gt+q),$i)}else C.push(Pt.slice(gt,gt+q));k+=q}return Ct.setUint32(v,k,!0),0}function K(O,N,U,v){if(O!==0)return d().setUint32(v,0,!0),8;let C=d(),k=w(),Ct=0;for(let Pt=0;Pt<U;Pt+=1){let Ut=N+Pt*8,_e=C.getUint32(Ut,!0),gt=C.getUint32(Ut+4,!0),q,ut;if(t)do q=Atomics.load(t.control,0),ut=Math.min(gt,r.length-q);while(Atomics.compareExchange(t.control,0,q,q+ut)!==q);else q=I,ut=Math.min(gt,r.length-q),I+=ut;if(ut===0){if(q>=r.length)break;continue}k.set(r.subarray(q,q+ut),_e),Ct+=ut}return C.setUint32(v,Ct,!0),0}function F(O){return O<=2?0:8}function Rt(O,N,U,v){return O<=2?70:8}function Wo(O,N){if(O>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 $o(O,N){return O<=2?0:8}function Zo(O,N){return 8}function Qo(O,N,U){return 8}function zo(){return 8}function Xo(O,N){let U=d();U.setUint32(O,b.length,!0);let v=0;for(let C of b)v+=C.length+1;return U.setUint32(N,v,!0),0}function Jo(O,N){let U=d(),v=w(),C=N;for(let k=0;k<b.length;k++)U.setUint32(O+k*4,C,!0),v.set(b[k],C),C+=b[k].length,v[C]=0,C+=1;return 0}function ta(O,N){let U=d();U.setUint32(O,y.length,!0);let v=0;for(let C of y)v+=C.length+1;return U.setUint32(N,v,!0),0}function ea(O,N){let U=d(),v=w(),C=N;for(let k=0;k<y.length;k++)U.setUint32(O+k*4,C,!0),v.set(y[k],C),C+=y[k].length,v[C]=0,C+=1;return 0}function sa(O,N){return l?.getRandomValues?(l.getRandomValues(w().subarray(O,O+N)),0):52}function ia(O){throw t&&(Atomics.store(t.control,4,O),Atomics.store(t.control,3,1)),o&&Wi(),new Yi(O)}function ra(){return 0}function Wi(){if(E.length>0){let O=Ee(E);if(o){let N=new TextDecoder().decode(O);N&&console.log(N)}E.length=0}if(_.length>0){let O=Ee(_);if(o){let N=new TextDecoder().decode(O);N&&console.warn(N)}_.length=0}}function Ee(O){let N=0;for(let C of O)N+=C.length;let U=new Uint8Array(N),v=0;for(let C of O)U.set(C,v),v+=C.length;return U}return{imports:{wasi_snapshot_preview1:{clock_time_get:g,fd_write:M,fd_read:K,fd_close:F,fd_seek:Rt,fd_fdstat_get:Wo,fd_fdstat_set_flags:$o,fd_prestat_get:Zo,fd_prestat_dir_name:Qo,path_open:zo,environ_sizes_get:Xo,environ_get:Jo,args_sizes_get:ta,args_get:ea,random_get:sa,proc_exit:ia,sched_yield:ra}},setMemory:A,getMemory:T,flushOutput:Wi,get stdout(){return t?t.stdout.slice(0,Atomics.load(t.control,1)):Ee(E)},get stderr(){return t?t.stderr.slice(0,Atomics.load(t.control,2)):Ee(_)}}}var ou=\"sdm.thread-hostcall\";function au(e){return WebAssembly.Module.imports(e).some(t=>t.module===Bi)}function fu(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=Ho({maxResponseBytes:e.maxResponseBytes}),r=new BroadcastChannel(t),o=1;return{dispatch:vo({buffer:i,timeoutMs:e.timeoutMs,postRequest(l){r.postMessage({type:ou,token:s,requestId:o++,buffer:i,...l})}}),close(){r.close()}}}function Bo({wasmModule:e,memory:t,hostcallChannel:s,processState:i,extraImports:r,workerIndex:o,tid:a,threadSpawn:l}={}){let E=Mo({processState:i});E.setMemory(t);let _=null,I=null,m={...E.imports,env:{memory:t},wasi:{\"thread-spawn\":typeof l==\"function\"?l:()=>-1}};if(au(e)){I=fu(s);let T=oo({dispatch:I.dispatch,getMemory:()=>_?.exports?.memory??t});Object.assign(m,T.imports)}let A=Lo(r,{memory:t,getMemory:()=>_?.exports?.memory??t,workerIndex:o??null,tid:a??null});return Co(m,A.fragments),m.env.memory=t,{imports:m,instantiate(){return _=new WebAssembly.Instance(e,m),E.setMemory(_.exports.memory??t),_},close(){I?.close(),A.close()}}}async function Fo(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 hu=Object.freeze({PENDING:0,IDLE:1,CLAIMED:2,ASSIGNED:3,RUNNING:4,RETIRED:5}),{PENDING:j_,IDLE:ce,CLAIMED:Vo,ASSIGNED:ue,RUNNING:Ve,RETIRED:ji}=hu,xe=0,cu=1,uu=2,lu=3,Eu=4,Fe=5,_u=6,du=8,pu=8,J=0,Ki=1,ko=2,xo=3,Iu=4,Go=1,Su=536870911,Au=2;var ot=e=>du+pu*e;function qi(){return typeof performance<\"u\"&&typeof performance.now==\"function\"?performance.now():Date.now()}function Ge(e){Atomics.add(e,xe,1),Atomics.notify(e,xe)}function bu(e,t,s){Atomics.store(e,ot(t)+J,s),Atomics.notify(e,ot(t)+J),Ge(e)}function Yo(e,t){bu(e.control,t,ji)}function Ru(e,t,s){let{control:i}=e,r=ot(t);for(;;){let o=Atomics.load(i,r+J);if(o!==ue&&o!==Ve||Atomics.load(i,r+Ki)!==s)return!1;if(Atomics.compareExchange(i,r+J,o,ce)===o)return Ge(i),!0}}function wu(e,t){let{control:s}=e,i=ot(t);return Atomics.compareExchange(s,i+J,ue,Ve)!==ue?null:{tid:Atomics.load(s,i+Ki),startArg:Atomics.load(s,i+ko)}}function Tu(e,t){let{control:s}=e;Atomics.compareExchange(s,ot(t)+J,Ve,ce)===Ve&&Ge(s)}function qo(e,t,{runThread:s,osThreadId:i=0}){let{control:r}=e,o=ot(t)+J;for(i&&Atomics.store(r,ot(t)+Iu,i);;){let a=Atomics.load(r,o);if(a===ji)return;if(a!==ue){Atomics.wait(r,o,a);continue}let l=wu(e,t);if(l){if(s(l.tid,l.startArg)===!1){Yo(e,t);return}Tu(e,t)}}}function jo(e,{owner:t=!1,grow:s=null,dispatchMessage:i=null}={}){let{control:r,spawnWaitMs:o}=e,a=Atomics.load(r,_u),l=null,E=!0,_=w=>t||(Atomics.load(r,ot(w)+xo)&Go)===0,I=()=>{let w=Math.min(Atomics.load(r,Fe),a),d=0;for(let S=0;S<w;S+=1)if(_(S)){if(Atomics.compareExchange(r,ot(S)+J,ce,Vo)===ce)return{slot:S,live:d+1};Atomics.load(r,ot(S)+J)!==ji&&(d+=1)}return{slot:-1,live:d}},m=()=>{for(;;){let w=Atomics.load(r,Fe);if(w>=a)return-1;if(Atomics.compareExchange(r,Fe,w,w+1)===w)return Atomics.store(r,ot(w)+J,Vo),w}},A=()=>{let w=m();if(w<0)return{slot:-1,reason:null};try{return s(w),{slot:w,reason:null}}catch{return Yo(e,w),{slot:-1,reason:\"worker-create-failed\"}}},T=()=>{let w=I();if(w.slot>=0)return{slot:w.slot,waited:!1,reason:null};let d=typeof s==\"function\",S=qi(),b=S+(E?o:0),y=S+(E?Math.min(Au,o):0),g=!1;for(;;){let M=Atomics.load(r,xe);if(w=I(),w.slot>=0)return{slot:w.slot,waited:g,reason:null};let K=d&&Math.min(Atomics.load(r,Fe),a)<a;if(K&&(w.live===0||qi()>=y)){let Rt=A();if(Rt.slot>=0||Rt.reason)return{...Rt,waited:g};continue}if(w.live===0)return{slot:-1,waited:g,reason:\"pool-exhausted\"};if(M===l&&!K)return{slot:-1,waited:g,reason:\"pool-exhausted\"};let F=(K?y:b)-qi();if(!K&&F<=0)return l=M,{slot:-1,waited:g,reason:\"pool-exhausted\"};if(F>0){try{Atomics.wait(r,xe,M,F)}catch{if(E=!1,!K)return{slot:-1,waited:g,reason:\"pool-exhausted\"};y=0;continue}g=!0}}};return w=>{let d=T();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=ot(S),y=Atomics.add(r,cu,1);if(y>Su)return Atomics.store(r,b+J,ce),Ge(r),{tid:-1,slot:-1,reason:\"tid-exhausted\"};if(Atomics.store(r,b+Ki,y),Atomics.store(r,b+ko,w|0),Atomics.store(r,b+J,ue),(Atomics.load(r,b+xo)&Go)!==0)try{i(S,y,w)}catch{return Ru(e,S,y),{tid:-1,slot:-1,reason:\"dispatch-failed\"}}else Atomics.notify(r,b+J);return Atomics.add(r,uu,1),d.waited&&Atomics.add(r,lu,1),{tid:y,slot:S,reason:null}}}var le=null;function Ko(e,t){try{return le.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 Fo(t.extraImports??[]),r=s?jo(s):null;le=Bo({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}),le.instantiate(),self.postMessage({t:\"ready\",ok:!0,protocol:2})}catch(i){le?.close(),le=null,self.postMessage({t:\"ready\",ok:!1,error:String(i?.message??i)});return}s&&qo(s,t.slot,{runThread:Ko});return}t.t===\"run\"&&(Ko(t.tid,t.startArg),self.postMessage({t:\"exit\",tid:t.tid}))};})();\n";
7
+ export const WASI_THREAD_POOL_WORKER_BUNDLE_SHA256 = "e79008823adb86edb2e5591380d2343eaeeb71f040dc358e3339e78541a7741d";
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";