@synnaxlabs/x 0.40.0 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +33 -33
- package/dist/binary.cjs +1 -1
- package/dist/binary.js +2 -2
- package/dist/bounds-BQo7rvs9.cjs +1 -0
- package/dist/{bounds-azUOoVVR.js → bounds-Bn5_l4Z3.js} +84 -86
- package/dist/bounds.cjs +1 -1
- package/dist/bounds.js +1 -1
- package/dist/box-0YrQibkB.cjs +1 -0
- package/dist/box-Cc8IzcNo.js +205 -0
- package/dist/box.cjs +1 -1
- package/dist/box.js +1 -1
- package/dist/compare.cjs +1 -1
- package/dist/compare.js +1 -1
- package/dist/deep.cjs +1 -1
- package/dist/deep.js +66 -69
- package/dist/{dimensions-PWy5QZoM.cjs → dimensions-D2QGoNXO.cjs} +1 -1
- package/dist/dimensions.cjs +1 -1
- package/dist/{external-CvWr1nhS.cjs → external-DWQITF5_.cjs} +1 -1
- package/dist/index-BywOGO8U.js +1074 -0
- package/dist/index-CYYjI7Uf.cjs +1 -0
- package/dist/index-C_6NXBlg.cjs +3 -0
- package/dist/{index-BVC_8Cg9.js → index-QGplUHuy.js} +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +736 -240
- package/dist/location-BGl5Ddds.cjs +1 -0
- package/dist/{location-BuYbIFHD.js → location-C3aeu046.js} +16 -12
- package/dist/location.cjs +1 -1
- package/dist/location.js +1 -1
- package/dist/{position-DTrNGtrm.cjs → position-Cai5-wi1.cjs} +1 -1
- package/dist/{position-DemzGvAY.js → position-DIglP1l2.js} +2 -2
- package/dist/position.cjs +1 -1
- package/dist/position.js +1 -1
- package/dist/record.js +3 -1
- package/dist/{scale-DpJM6__6.cjs → scale-BtZINJ-A.cjs} +1 -1
- package/dist/{scale-C0EllH-1.js → scale-DfJe9755.js} +4 -4
- package/dist/scale.cjs +1 -1
- package/dist/scale.js +1 -1
- package/dist/{series-CXnO-P0V.js → series-B9JERcqi.js} +541 -474
- package/dist/series-DqJ6f97G.cjs +11 -0
- package/dist/spatial.cjs +1 -1
- package/dist/spatial.js +6 -6
- package/dist/src/binary/{encoder.d.ts → codec.d.ts} +14 -8
- package/dist/src/binary/codec.d.ts.map +1 -0
- package/dist/src/binary/codec.spec.d.ts +2 -0
- package/dist/src/binary/codec.spec.d.ts.map +1 -0
- package/dist/src/binary/index.d.ts +1 -1
- package/dist/src/binary/index.d.ts.map +1 -1
- package/dist/src/breaker/breaker.d.ts +14 -21
- package/dist/src/breaker/breaker.d.ts.map +1 -1
- package/dist/src/change/change.d.ts +5 -18
- package/dist/src/change/change.d.ts.map +1 -1
- package/dist/src/color/color.d.ts +126 -0
- package/dist/src/color/color.d.ts.map +1 -0
- package/dist/src/color/color.spec.d.ts +2 -0
- package/dist/src/color/color.spec.d.ts.map +1 -0
- package/dist/src/color/external.d.ts +5 -0
- package/dist/src/color/external.d.ts.map +1 -0
- package/dist/src/color/gradient.d.ts +18 -0
- package/dist/src/color/gradient.d.ts.map +1 -0
- package/dist/src/color/index.d.ts +2 -0
- package/dist/src/color/index.d.ts.map +1 -0
- package/dist/src/color/palette.d.ts +19 -0
- package/dist/src/color/palette.d.ts.map +1 -0
- package/dist/src/color/transformColorsToHex.d.ts +6 -0
- package/dist/src/color/transformColorsToHex.d.ts.map +1 -0
- package/dist/src/control/control.d.ts +69 -74
- package/dist/src/control/control.d.ts.map +1 -1
- package/dist/src/deep/merge.d.ts +1 -1
- package/dist/src/deep/merge.d.ts.map +1 -1
- package/dist/src/errors/errors.d.ts +127 -7
- package/dist/src/errors/errors.d.ts.map +1 -1
- package/dist/src/errors/errors.spec.d.ts +2 -0
- package/dist/src/errors/errors.spec.d.ts.map +1 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/jsonrpc/jsonrpc.d.ts +10 -7
- package/dist/src/jsonrpc/jsonrpc.d.ts.map +1 -1
- package/dist/src/kv/types.d.ts +1 -7
- package/dist/src/kv/types.d.ts.map +1 -1
- package/dist/src/math/external.d.ts +3 -0
- package/dist/src/math/external.d.ts.map +1 -0
- package/dist/src/math/index.d.ts +1 -1
- package/dist/src/math/index.d.ts.map +1 -1
- package/dist/src/math/round.d.ts +40 -0
- package/dist/src/math/round.d.ts.map +1 -0
- package/dist/src/math/round.spec.d.ts +2 -0
- package/dist/src/math/round.spec.d.ts.map +1 -0
- package/dist/src/migrate/migrate.d.ts +1 -1
- package/dist/src/notation/index.d.ts +2 -0
- package/dist/src/notation/index.d.ts.map +1 -0
- package/dist/src/notation/notation.d.ts +37 -0
- package/dist/src/notation/notation.d.ts.map +1 -0
- package/dist/src/notation/notation.spec.d.ts +2 -0
- package/dist/src/notation/notation.spec.d.ts.map +1 -0
- package/dist/src/record.d.ts +2 -1
- package/dist/src/record.d.ts.map +1 -1
- package/dist/src/replace.d.ts +2 -0
- package/dist/src/replace.d.ts.map +1 -0
- package/dist/src/runtime/os.d.ts +9 -1
- package/dist/src/runtime/os.d.ts.map +1 -1
- package/dist/src/singleton/define.d.ts +9 -0
- package/dist/src/singleton/define.d.ts.map +1 -0
- package/dist/src/singleton/define.spec.d.ts +2 -0
- package/dist/src/singleton/define.spec.d.ts.map +1 -0
- package/dist/src/singleton/index.d.ts +2 -0
- package/dist/src/singleton/index.d.ts.map +1 -0
- package/dist/src/spatial/base.d.ts +74 -70
- package/dist/src/spatial/base.d.ts.map +1 -1
- package/dist/src/spatial/box/box.d.ts +22 -76
- package/dist/src/spatial/box/box.d.ts.map +1 -1
- package/dist/src/spatial/dimensions/dimensions.d.ts +5 -29
- package/dist/src/spatial/dimensions/dimensions.d.ts.map +1 -1
- package/dist/src/spatial/direction/direction.d.ts +9 -1
- package/dist/src/spatial/direction/direction.d.ts.map +1 -1
- package/dist/src/spatial/location/location.d.ts +45 -24
- package/dist/src/spatial/location/location.d.ts.map +1 -1
- package/dist/src/spatial/scale/scale.d.ts +12 -120
- package/dist/src/spatial/scale/scale.d.ts.map +1 -1
- package/dist/src/spatial/xy/xy.d.ts +15 -29
- package/dist/src/spatial/xy/xy.d.ts.map +1 -1
- package/dist/src/sync/index.d.ts +2 -0
- package/dist/src/sync/index.d.ts.map +1 -0
- package/dist/src/sync/mutex.d.ts +8 -0
- package/dist/src/sync/mutex.d.ts.map +1 -0
- package/dist/src/telem/gl.d.ts +4 -1
- package/dist/src/telem/gl.d.ts.map +1 -1
- package/dist/src/telem/series.d.ts +46 -125
- package/dist/src/telem/series.d.ts.map +1 -1
- package/dist/src/telem/telem.d.ts +102 -85
- package/dist/src/telem/telem.d.ts.map +1 -1
- package/dist/src/toArray.d.ts +1 -1
- package/dist/src/toArray.d.ts.map +1 -1
- package/dist/src/zod/util.d.ts.map +1 -1
- package/dist/telem.cjs +1 -1
- package/dist/telem.js +1 -1
- package/dist/toArray.cjs +1 -1
- package/dist/toArray.js +1 -1
- package/dist/{xy-DyQSETQZ.cjs → xy-B7065J2S.cjs} +1 -1
- package/dist/{xy-DHBO1dG_.js → xy-D_LqxaGt.js} +8 -4
- package/dist/xy.cjs +1 -1
- package/dist/xy.js +1 -1
- package/dist/zod.cjs +1 -1
- package/package.json +11 -8
- package/src/binary/codec.spec.ts +370 -0
- package/src/binary/{encoder.ts → codec.ts} +55 -11
- package/src/binary/index.ts +1 -1
- package/src/breaker/breaker.spec.ts +16 -25
- package/src/breaker/breaker.ts +36 -19
- package/src/color/color.spec.ts +673 -0
- package/src/color/color.ts +317 -0
- package/src/color/external.ts +13 -0
- package/src/color/gradient.ts +78 -0
- package/src/color/index.ts +10 -0
- package/src/color/palette.ts +28 -0
- package/src/color/transformColorsToHex.ts +30 -0
- package/src/control/control.ts +30 -22
- package/src/deep/merge.ts +2 -8
- package/src/errors/errors.spec.ts +152 -0
- package/src/errors/errors.ts +225 -10
- package/src/index.ts +5 -0
- package/src/jsonrpc/jsonrpc.ts +12 -8
- package/src/math/external.ts +11 -0
- package/src/math/index.ts +1 -1
- package/src/math/round.spec.ts +81 -0
- package/src/math/round.ts +68 -0
- package/src/migrate/migrate.ts +2 -2
- package/src/notation/index.ts +10 -0
- package/src/notation/notation.spec.ts +88 -0
- package/src/notation/notation.ts +61 -0
- package/src/primitive.ts +1 -1
- package/src/record.ts +5 -1
- package/src/replace.ts +1 -0
- package/src/singleton/define.spec.ts +93 -0
- package/src/singleton/define.ts +27 -0
- package/src/singleton/index.ts +10 -0
- package/src/spatial/box/box.spec.ts +3 -3
- package/src/spatial/box/box.ts +8 -0
- package/src/spatial/location/location.ts +4 -4
- package/src/spatial/position/position.spec.ts +10 -10
- package/src/spatial/xy/xy.spec.ts +8 -0
- package/src/spatial/xy/xy.ts +14 -0
- package/src/sync/index.ts +1 -0
- package/src/sync/mutex.ts +16 -0
- package/src/telem/series.spec.ts +71 -0
- package/src/telem/series.ts +69 -46
- package/src/telem/telem.spec.ts +151 -10
- package/src/telem/telem.ts +134 -73
- package/src/toArray.ts +2 -2
- package/src/zod/util.spec.ts +17 -1
- package/src/zod/util.ts +4 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/bounds-Dwq6ZFHm.cjs +0 -1
- package/dist/box-Bzya27QS.cjs +0 -1
- package/dist/box-DrsrRNSe.js +0 -201
- package/dist/index-BG3Scw3G.cjs +0 -1
- package/dist/index-C3QzbIwt.js +0 -101
- package/dist/index-CnclyYpG.cjs +0 -3
- package/dist/location-BgpQ3rN2.cjs +0 -1
- package/dist/series-BgoCtU71.cjs +0 -11
- package/dist/src/binary/encoder.d.ts.map +0 -1
- package/dist/src/binary/encoder.spec.d.ts +0 -2
- package/dist/src/binary/encoder.spec.d.ts.map +0 -1
- package/src/binary/encoder.spec.ts +0 -174
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const m=require("./index-udOjA9d-.cjs"),l=e=>e!=null&&typeof e=="object"&&"toString"in e,T=e=>{if(l(e))return(e==null?void 0:e.toString().length)===0;switch(typeof e){case"string":return e.length===0;case"number":return e===0;case"bigint":return e===0n;case"boolean":return!e;case"undefined":return!0;case"object":return!0}},g=(e,t=!1)=>{const o=l(e)?"stringer":typeof e;let r;switch(o){case"string":r=(n,s)=>n.localeCompare(s);break;case"stringer":r=(n,s)=>n.toString().localeCompare(s.toString());break;case"number":r=(n,s)=>Number(n)-Number(s);break;case"bigint":r=(n,s)=>BigInt(n)-BigInt(s)>0n?1:-1;break;case"boolean":r=(n,s)=>Number(n)-Number(s);break;case"undefined":r=()=>0;break;default:return console.warn(`sortFunc: unknown type ${o}`),()=>-1}return t?h(r):r},A=(e,t,o)=>{const r=g(t[e],o);return(n,s)=>r(n[e],s[e])},E=(e,t)=>e.length!==t.length?e.length-t.length:e.every((o,r)=>o===t[r])?0:-1,b=(e,t)=>{if(e.length!==t.length)return e.length-t.length;if(e.length===0)return 0;const o=g(e[0]),r=[...e].sort(o),n=[...t].sort(o);return r.every((s,i)=>s===n[i])?0:-1},q=(e,t)=>{const o=m.unique$1(e),r=m.unique$1(t);return b(o,r)},_=(e,t)=>e===t?0:e==="first"&&t==="last"?1:-1,h=e=>(t,o)=>e(o,t),c=0,N=-1,f=1,p=e=>e<c,d=e=>e>c,y=e=>e>=c,S=e=>e===c,w=(e,t)=>{const o=/([a-zA-Z]+)|(\d+)/g,r=e.replace(/[\s_.-]+/g,"").match(o),n=t.replace(/[\s_.-]+/g,"").match(o);if(!r||!n)return 0;for(let s=0;s<Math.min(r.length,n.length);s++){const i=r[s],a=n[s];if(isNaN(Number(i))&&isNaN(Number(a))){const u=i.localeCompare(a);if(u!==0)return u}else if(!isNaN(Number(i))&&!isNaN(Number(a))){const u=Number(i)-Number(a);if(u!==0)return u}else return isNaN(Number(i))?-1:1}return r.length-n.length},F=Object.freeze(Object.defineProperty({__proto__:null,EQUAL:c,GREATER_THAN:f,LESS_THAN:N,isEqualTo:S,isGreaterThan:d,isGreaterThanEqual:y,isLessThan:p,newF:g,newFieldF:A,order:_,primitiveArrays:E,reverseF:h,stringsWithNumbers:w,uniqueUnorderedPrimitiveArrays:q,unorderedPrimitiveArrays:b},Symbol.toStringTag,{value:"Module"}));exports.EQUAL=c;exports.GREATER_THAN=f;exports.LESS_THAN=N;exports.compare=F;exports.isEqualTo=S;exports.isGreaterThan=d;exports.isLessThan=p;exports.isStringer=l;exports.newF=g;exports.primitiveIsZero=T;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";var H=Object.defineProperty;var N=(n,e,t)=>e in n?H(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var u=(n,e,t)=>N(n,typeof e!="symbol"?e+"":e,t);const S=require("./index-Dd8DLyMx.cjs"),A=require("./identity.cjs");function K(n){const e=n.length;let t=0,s=0;for(;s<e;){let i=n.charCodeAt(s++);if((i&4294967168)===0){t++;continue}else if((i&4294965248)===0)t+=2;else{if(i>=55296&&i<=56319&&s<e){const r=n.charCodeAt(s);(r&64512)===56320&&(++s,i=((i&1023)<<10)+(r&1023)+65536)}(i&4294901760)===0?t+=3:t+=4}}return t}function O(n,e,t){const s=n.length;let i=t,r=0;for(;r<s;){let o=n.charCodeAt(r++);if((o&4294967168)===0){e[i++]=o;continue}else if((o&4294965248)===0)e[i++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&r<s){const h=n.charCodeAt(r);(h&64512)===56320&&(++r,o=((o&1023)<<10)+(h&1023)+65536)}(o&4294901760)===0?(e[i++]=o>>12&15|224,e[i++]=o>>6&63|128):(e[i++]=o>>18&7|240,e[i++]=o>>12&63|128,e[i++]=o>>6&63|128)}e[i++]=o&63|128}}const V=new TextEncoder,W=50;function X(n,e,t){V.encodeInto(n,e.subarray(t))}function J(n,e,t){n.length>W?X(n,e,t):O(n,e,t)}const Y=4096;function z(n,e,t){let s=e;const i=s+t,r=[];let o="";for(;s<i;){const h=n[s++];if((h&128)===0)r.push(h);else if((h&224)===192){const a=n[s++]&63;r.push((h&31)<<6|a)}else if((h&240)===224){const a=n[s++]&63,l=n[s++]&63;r.push((h&31)<<12|a<<6|l)}else if((h&248)===240){const a=n[s++]&63,l=n[s++]&63,m=n[s++]&63;let d=(h&7)<<18|a<<12|l<<6|m;d>65535&&(d-=65536,r.push(d>>>10&1023|55296),d=56320|d&1023),r.push(d)}else r.push(h);r.length>=Y&&(o+=String.fromCharCode(...r),r.length=0)}return r.length>0&&(o+=String.fromCharCode(...r)),o}const q=new TextDecoder,G=200;function Z(n,e,t){const s=n.subarray(e,e+t);return q.decode(s)}function Q(n,e,t){return t>G?Z(n,e,t):z(n,e,t)}class p{constructor(e,t){this.type=e,this.data=t}}class c extends Error{constructor(e){super(e);const t=Object.create(c.prototype);Object.setPrototypeOf(this,t),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:c.name})}}const x=4294967295;function j(n,e,t){const s=t/4294967296,i=t;n.setUint32(e,s),n.setUint32(e+4,i)}function v(n,e,t){const s=Math.floor(t/4294967296),i=t;n.setUint32(e,s),n.setUint32(e+4,i)}function M(n,e){const t=n.getInt32(e),s=n.getUint32(e+4);return t*4294967296+s}function ee(n,e){const t=n.getUint32(e),s=n.getUint32(e+4);return t*4294967296+s}const te=-1,ie=4294967296-1,se=17179869184-1;function ne({sec:n,nsec:e}){if(n>=0&&e>=0&&n<=se)if(e===0&&n<=ie){const t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,n),t}else{const t=n/4294967296,s=n&4294967295,i=new Uint8Array(8),r=new DataView(i.buffer);return r.setUint32(0,e<<2|t&3),r.setUint32(4,s),i}else{const t=new Uint8Array(12),s=new DataView(t.buffer);return s.setUint32(0,e),v(s,4,n),t}}function re(n){const e=n.getTime(),t=Math.floor(e/1e3),s=(e-t*1e3)*1e6,i=Math.floor(s/1e9);return{sec:t+i,nsec:s-i*1e9}}function oe(n){if(n instanceof Date){const e=re(n);return ne(e)}else return null}function he(n){const e=new DataView(n.buffer,n.byteOffset,n.byteLength);switch(n.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{const t=e.getUint32(0),s=e.getUint32(4),i=(t&3)*4294967296+s,r=t>>>2;return{sec:i,nsec:r}}case 12:{const t=M(e,4),s=e.getUint32(0);return{sec:t,nsec:s}}default:throw new c(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${n.length}`)}}function ce(n){const e=he(n);return new Date(e.sec*1e3+e.nsec/1e6)}const ae={type:te,encode:oe,decode:ce};class U{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(ae)}register({type:e,encode:t,decode:s}){if(e>=0)this.encoders[e]=t,this.decoders[e]=s;else{const i=-1-e;this.builtInEncoders[i]=t,this.builtInDecoders[i]=s}}tryToEncode(e,t){for(let s=0;s<this.builtInEncoders.length;s++){const i=this.builtInEncoders[s];if(i!=null){const r=i(e,t);if(r!=null){const o=-1-s;return new p(o,r)}}}for(let s=0;s<this.encoders.length;s++){const i=this.encoders[s];if(i!=null){const r=i(e,t);if(r!=null){const o=s;return new p(o,r)}}}return e instanceof p?e:null}decode(e,t,s){const i=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return i?i(e,t,s):new p(t,e)}}U.defaultCodec=new U;function de(n){return n instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&n instanceof SharedArrayBuffer}function B(n){return n instanceof Uint8Array?n:ArrayBuffer.isView(n)?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):de(n)?new Uint8Array(n):Uint8Array.from(n)}const fe=100,le=2048;class I{constructor(e){this.entered=!1,this.extensionCodec=(e==null?void 0:e.extensionCodec)??U.defaultCodec,this.context=e==null?void 0:e.context,this.useBigInt64=(e==null?void 0:e.useBigInt64)??!1,this.maxDepth=(e==null?void 0:e.maxDepth)??fe,this.initialBufferSize=(e==null?void 0:e.initialBufferSize)??le,this.sortKeys=(e==null?void 0:e.sortKeys)??!1,this.forceFloat32=(e==null?void 0:e.forceFloat32)??!1,this.ignoreUndefined=(e==null?void 0:e.ignoreUndefined)??!1,this.forceIntegerToFloat=(e==null?void 0:e.forceIntegerToFloat)??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new I({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,t){if(t>this.maxDepth)throw new Error(`Too deep objects in depth ${t}`);e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,t)}ensureBufferSizeToWrite(e){const t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(t*2)}resizeBuffer(e){const t=new ArrayBuffer(e),s=new Uint8Array(t),i=new DataView(t);s.set(this.bytes),this.view=i,this.bytes=s}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){const s=K(e);this.ensureBufferSizeToWrite(5+s),this.writeStringHeader(s),J(e,this.bytes,this.pos),this.pos+=s}encodeObject(e,t){const s=this.extensionCodec.tryToEncode(e,this.context);if(s!=null)this.encodeExtension(s);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,t);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){const t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else if(t<4294967296)this.writeU8(198),this.writeU32(t);else throw new Error(`Too large binary: ${t}`);const s=B(e);this.writeU8a(s)}encodeArray(e,t){const s=e.length;if(s<16)this.writeU8(144+s);else if(s<65536)this.writeU8(220),this.writeU16(s);else if(s<4294967296)this.writeU8(221),this.writeU32(s);else throw new Error(`Too large array: ${s}`);for(const i of e)this.doEncode(i,t+1)}countWithoutUndefined(e,t){let s=0;for(const i of t)e[i]!==void 0&&s++;return s}encodeMap(e,t){const s=Object.keys(e);this.sortKeys&&s.sort();const i=this.ignoreUndefined?this.countWithoutUndefined(e,s):s.length;if(i<16)this.writeU8(128+i);else if(i<65536)this.writeU8(222),this.writeU16(i);else if(i<4294967296)this.writeU8(223),this.writeU32(i);else throw new Error(`Too large map object: ${i}`);for(const r of s){const o=e[r];this.ignoreUndefined&&o===void 0||(this.encodeString(r),this.doEncode(o,t+1))}}encodeExtension(e){if(typeof e.data=="function"){const s=e.data(this.pos+6),i=s.length;if(i>=4294967296)throw new Error(`Too large extension object: ${i}`);this.writeU8(201),this.writeU32(i),this.writeI8(e.type),this.writeU8a(s);return}const t=e.data.length;if(t===1)this.writeU8(212);else if(t===2)this.writeU8(213);else if(t===4)this.writeU8(214);else if(t===8)this.writeU8(215);else if(t===16)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else if(t<4294967296)this.writeU8(201),this.writeU32(t);else throw new Error(`Too large extension object: ${t}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){const t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),j(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),v(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}}function g(n,e){return new I(e).encodeSharedRef(n)}function E(n){return`${n<0?"-":""}0x${Math.abs(n).toString(16).padStart(2,"0")}`}const ue=16,xe=16;class we{constructor(e=ue,t=xe){this.hit=0,this.miss=0,this.maxKeyLength=e,this.maxLengthPerKey=t,this.caches=[];for(let s=0;s<this.maxKeyLength;s++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,t,s){const i=this.caches[s-1];e:for(const r of i){const o=r.bytes;for(let h=0;h<s;h++)if(o[h]!==e[t+h])continue e;return r.str}return null}store(e,t){const s=this.caches[e.length-1],i={bytes:e,str:t};s.length>=this.maxLengthPerKey?s[Math.random()*s.length|0]=i:s.push(i)}decode(e,t,s){const i=this.find(e,t,s);if(i!=null)return this.hit++,i;this.miss++;const r=z(e,t,s),o=Uint8Array.prototype.slice.call(e,t,t+s);return this.store(o,r),r}}const T="array",y="map_key",_="map_value",ge=n=>{if(typeof n=="string"||typeof n=="number")return n;throw new c("The type of key must be string or number but "+typeof n)};class ye{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){const t=this.getUninitializedStateFromPool();t.type=T,t.position=0,t.size=e,t.array=new Array(e)}pushMapState(e){const t=this.getUninitializedStateFromPool();t.type=y,t.readCount=0,t.size=e,t.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){const e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===T){const s=e;s.size=0,s.array=void 0,s.position=0,s.type=void 0}if(e.type===y||e.type===_){const s=e;s.size=0,s.map=void 0,s.readCount=0,s.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}const w=-1,k=new DataView(new ArrayBuffer(0)),Ue=new Uint8Array(k.buffer);try{k.getInt8(0)}catch(n){if(!(n instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}const D=new RangeError("Insufficient data"),pe=new we;class C{constructor(e){this.totalPos=0,this.pos=0,this.view=k,this.bytes=Ue,this.headByte=w,this.stack=new ye,this.entered=!1,this.extensionCodec=(e==null?void 0:e.extensionCodec)??U.defaultCodec,this.context=e==null?void 0:e.context,this.useBigInt64=(e==null?void 0:e.useBigInt64)??!1,this.rawStrings=(e==null?void 0:e.rawStrings)??!1,this.maxStrLength=(e==null?void 0:e.maxStrLength)??x,this.maxBinLength=(e==null?void 0:e.maxBinLength)??x,this.maxArrayLength=(e==null?void 0:e.maxArrayLength)??x,this.maxMapLength=(e==null?void 0:e.maxMapLength)??x,this.maxExtLength=(e==null?void 0:e.maxExtLength)??x,this.keyDecoder=(e==null?void 0:e.keyDecoder)!==void 0?e.keyDecoder:pe,this.mapKeyConverter=(e==null?void 0:e.mapKeyConverter)??ge}clone(){return new C({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=w,this.stack.reset()}setBuffer(e){const t=B(e);this.bytes=t,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===w&&!this.hasRemaining(1))this.setBuffer(e);else{const t=this.bytes.subarray(this.pos),s=B(e),i=new Uint8Array(t.length+s.length);i.set(t),i.set(s,t.length),this.setBuffer(i)}}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){const{view:t,pos:s}=this;return new RangeError(`Extra ${t.byteLength-s} of ${t.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);const t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){yield*this.clone().decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let t=!1,s;for await(const h of e){if(t)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(h);try{s=this.doDecodeSync(),t=!0}catch(a){if(!(a instanceof RangeError))throw a}this.totalPos+=this.pos}if(t){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return s}const{headByte:i,pos:r,totalPos:o}=this;throw new RangeError(`Insufficient data in parsing ${E(i)} at ${o} (${r} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,t){if(this.entered){yield*this.clone().decodeMultiAsync(e,t);return}try{this.entered=!0;let s=t,i=-1;for await(const r of e){if(t&&i===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(r),s&&(i=this.readArraySize(),s=!1,this.complete());try{for(;yield this.doDecodeSync(),--i!==0;);}catch(o){if(!(o instanceof RangeError))throw o}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){const e=this.readHeadByte();let t;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){const i=e-128;if(i!==0){this.pushMapState(i),this.complete();continue e}else t={}}else if(e<160){const i=e-144;if(i!==0){this.pushArrayState(i),this.complete();continue e}else t=[]}else{const i=e-160;t=this.decodeString(i,0)}else if(e===192)t=null;else if(e===194)t=!1;else if(e===195)t=!0;else if(e===202)t=this.readF32();else if(e===203)t=this.readF64();else if(e===204)t=this.readU8();else if(e===205)t=this.readU16();else if(e===206)t=this.readU32();else if(e===207)this.useBigInt64?t=this.readU64AsBigInt():t=this.readU64();else if(e===208)t=this.readI8();else if(e===209)t=this.readI16();else if(e===210)t=this.readI32();else if(e===211)this.useBigInt64?t=this.readI64AsBigInt():t=this.readI64();else if(e===217){const i=this.lookU8();t=this.decodeString(i,1)}else if(e===218){const i=this.lookU16();t=this.decodeString(i,2)}else if(e===219){const i=this.lookU32();t=this.decodeString(i,4)}else if(e===220){const i=this.readU16();if(i!==0){this.pushArrayState(i),this.complete();continue e}else t=[]}else if(e===221){const i=this.readU32();if(i!==0){this.pushArrayState(i),this.complete();continue e}else t=[]}else if(e===222){const i=this.readU16();if(i!==0){this.pushMapState(i),this.complete();continue e}else t={}}else if(e===223){const i=this.readU32();if(i!==0){this.pushMapState(i),this.complete();continue e}else t={}}else if(e===196){const i=this.lookU8();t=this.decodeBinary(i,1)}else if(e===197){const i=this.lookU16();t=this.decodeBinary(i,2)}else if(e===198){const i=this.lookU32();t=this.decodeBinary(i,4)}else if(e===212)t=this.decodeExtension(1,0);else if(e===213)t=this.decodeExtension(2,0);else if(e===214)t=this.decodeExtension(4,0);else if(e===215)t=this.decodeExtension(8,0);else if(e===216)t=this.decodeExtension(16,0);else if(e===199){const i=this.lookU8();t=this.decodeExtension(i,1)}else if(e===200){const i=this.lookU16();t=this.decodeExtension(i,2)}else if(e===201){const i=this.lookU32();t=this.decodeExtension(i,4)}else throw new c(`Unrecognized type byte: ${E(e)}`);this.complete();const s=this.stack;for(;s.length>0;){const i=s.top();if(i.type===T)if(i.array[i.position]=t,i.position++,i.position===i.size)t=i.array,s.release(i);else continue e;else if(i.type===y){if(t==="__proto__")throw new c("The key __proto__ is not allowed");i.key=this.mapKeyConverter(t),i.type=_;continue e}else if(i.map[i.key]=t,i.readCount++,i.readCount===i.size)t=i.map,s.release(i);else{i.key=null,i.type=y;continue e}}return t}}readHeadByte(){return this.headByte===w&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=w}readArraySize(){const e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new c(`Unrecognized array type byte: ${E(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new c(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new c(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,t){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,t):this.decodeBinary(e,t)}decodeUtf8String(e,t){var r;if(e>this.maxStrLength)throw new c(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+t+e)throw D;const s=this.pos+t;let i;return this.stateIsMapKey()&&((r=this.keyDecoder)!=null&&r.canBeCached(e))?i=this.keyDecoder.decode(this.bytes,s,e):i=Q(this.bytes,s,e),this.pos+=t+e,i}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===y:!1}decodeBinary(e,t){if(e>this.maxBinLength)throw new c(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+t))throw D;const s=this.pos+t,i=this.bytes.subarray(s,s+e);return this.pos+=t+e,i}decodeExtension(e,t){if(e>this.maxExtLength)throw new c(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);const s=this.view.getInt8(this.pos+t),i=this.decodeBinary(e,t+1);return this.extensionCodec.decode(i,s,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){const e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){const e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){const e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){const e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){const e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){const e=ee(this.view,this.pos);return this.pos+=8,e}readI64(){const e=M(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){const e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){const e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){const e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){const e=this.view.getFloat64(this.pos);return this.pos+=8,e}}function L(n,e){return new C(e).decode(n)}class F{constructor(){u(this,"contentType","application/json");u(this,"decoder");u(this,"encoder");this.decoder=new TextDecoder,this.encoder=new TextEncoder}encode(e){return this.encoder.encode(this.encodeString(e))}decode(e,t){return this.decodeString(this.decoder.decode(e),t)}decodeString(e,t){const s=JSON.parse(e),i=S.snakeToCamel(s);return t!=null?t.parse(i):i}encodeString(e){const t=S.camelToSnake(e);return JSON.stringify(t,(s,i)=>ArrayBuffer.isView(i)?Array.from(i):A.isObject(i)&&"encode_value"in i?typeof i.value=="bigint"?i.value.toString():i.value:typeof i=="bigint"?i.toString():i)}static registerCustomType(){}}class P{constructor(){u(this,"contentType","text/csv")}encode(e){const t=this.encodeString(e);return new TextEncoder().encode(t)}decode(e,t){const s=new TextDecoder().decode(e);return this.decodeString(s,t)}encodeString(e){if(!Array.isArray(e)||e.length===0||!A.isObject(e[0]))throw new Error("Payload must be an array of objects");const t=Object.keys(e[0]),s=[t.join(",")];return e.forEach(i=>{const r=t.map(o=>JSON.stringify(i[o]??""));s.push(r.join(","))}),s.join(`
|
|
2
|
+
`)}decodeString(e,t){const[s,...i]=e.trim().split(`
|
|
3
|
+
`).map(h=>h.trim());if(s.length===0)return t!=null?t.parse({}):{};const r=s.split(",").map(h=>h.trim()),o={};return r.forEach(h=>{o[h]=[]}),i.forEach(h=>{const a=h.split(",").map(l=>l.trim());r.forEach((l,m)=>{const d=this.parseValue(a[m]);d!=null&&o[l].push(d)})}),t!=null?t.parse(o):o}parseValue(e){if(e==null||e.length===0)return null;const t=Number(e);return isNaN(t)?e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e:t}static registerCustomType(){}}class b{constructor(){u(this,"contentType","text/plain")}encode(e){return new TextEncoder().encode(e)}decode(e,t){const s=new TextDecoder().decode(e);return t!=null?t.parse(s):s}}const f=new U;f.register({type:0,encode:n=>{if(ArrayBuffer.isView(n)){const e=Array.from(n);return g(e,{extensionCodec:f})}return A.isObject(n)&&"encode_value"in n?typeof n.value=="bigint"?g(n.value.toString(),{extensionCodec:f}):g(n.value,{extensionCodec:f}):typeof n=="bigint"?g(n.toString(),{extensionCodec:f}):null},decode:n=>L(n,{extensionCodec:f})});class R{constructor(){u(this,"contentType","application/msgpack")}encode(e){const t=S.camelToSnake(e);return g(t,{extensionCodec:f}).slice()}decode(e,t){const s=L(e,{extensionCodec:f}),i=S.snakeToCamel(s);return t!=null?t.parse(i):i}static registerCustomType(){}}const $=new F,Se=new P,me=new b,Ee=new R,Be=Object.freeze(Object.defineProperty({__proto__:null,CSVCodec:P,CSV_CODEC:Se,JSONCodec:F,JSON_CODEC:$,MSGPACK_CODEC:Ee,MsgPackCodec:R,TEXT_CODEC:me,TextCodec:b},Symbol.toStringTag,{value:"Module"}));exports.JSON_CODEC=$;exports.codec=Be;
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var R=Object.defineProperty;var O=(e,t,r)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var S=(e,t,r)=>O(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./index-CnclyYpG.cjs"),d=require("zod"),c=require("./series-BgoCtU71.cjs"),L=require("./index-Dd8DLyMx.cjs"),N=require("./change-C-YELKx6.cjs"),$=require("./scale-DpJM6__6.cjs"),u=require("./index-BG3Scw3G.cjs"),A=require("./debounce.cjs"),C=require("./deep.cjs"),P=require("./identity.cjs"),D=require("./external-C-dNgNQw.cjs"),U=require("./link.cjs"),j=require("./bounds-Dwq6ZFHm.cjs"),I=require("./observe.cjs"),E=require("./record.cjs"),B=require("./external-uXk0Avrg.cjs"),Z=require("./search.cjs"),G=require("./box-Bzya27QS.cjs"),V=require("./dimensions-PWy5QZoM.cjs"),W=require("./direction-C-b6XTeU.cjs"),H=require("./location-BgpQ3rN2.cjs"),J=require("./position-DTrNGtrm.cjs"),Q=require("./spatial-DGpZ2sO3.cjs"),F=require("./xy-DyQSETQZ.cjs"),k=require("./toArray.cjs"),K=require("./index-udOjA9d-.cjs"),x=require("./url.cjs"),q=require("./worker.cjs"),X=require("./external-CvWr1nhS.cjs"),Y=async e=>await new Promise(t=>setTimeout(t,c.TimeSpan.fromMilliseconds(e).milliseconds)),ee=d.z.object({interval:c.TimeSpan.z.optional(),maxRetries:d.z.number().optional(),scale:d.z.number().optional()}),re=(e={})=>{const t=e.sleepFn||Y,r=e.maxRetries??5,n=e.scale??1;let s=0,a=new c.TimeSpan(e.interval??c.TimeSpan.milliseconds(1));return async()=>s>=r?!1:(await t(a),a=a.mult(n),s++,!0)},te=Object.freeze(Object.defineProperty({__proto__:null,breakerConfig:ee,create:re},Symbol.toStringTag,{value:"Module"})),f=class f extends Number{};S(f,"ABSOLUTE",255),S(f,"MINIMUM",0),S(f,"BOUNDS",{lower:f.MINIMUM,upper:f.ABSOLUTE+1}),S(f,"z",d.z.union([d.z.instanceof(f),d.z.number().int().min(0).max(255).transform(t=>new f(t)),d.z.instanceof(Number).transform(t=>new f(t))]));let y=f;const _=d.z.object({name:d.z.string(),key:d.z.string()}),ne=e=>d.z.object({subject:_,resource:e,authority:y.z}),oe=(...e)=>t=>t.filter(r=>{let n=!1;return r.to!=null&&(n=e.includes(r.to.resource)),r.from!=null&&!n&&(n=e.includes(r.from.resource)),n}),ie=Object.freeze(Object.defineProperty({__proto__:null,Authority:y,filterTransfersByChannelKey:oe,stateZ:ne,subjectZ:_},Symbol.toStringTag,{value:"Module"})),p=class p extends Error{constructor(){super(p.MESSAGE)}matches(t){return typeof t=="string"?t.includes(p.MESSAGE):t instanceof p||t.message.includes(p.MESSAGE)}};S(p,"MESSAGE","canceled");let v=p;const se=new v,ce=Object.freeze(Object.defineProperty({__proto__:null,CANCELED:se},Symbol.toStringTag,{value:"Module"})),ae=e=>e?-1:1,le=e=>{const t=new TextDecoder;let r=new Uint8Array(0),n=null;return s=>{let a;typeof s=="string"?a=new TextEncoder().encode(s):s instanceof ArrayBuffer?a=new Uint8Array(s):a=s;const g=new Uint8Array(r.length+a.length);for(g.set(r),g.set(a,r.length),r=g;r.length>0;){if(n===null){const i=t.decode(r).match(/^Content-Length: (\d+)\r?\n\r?\n/);if(!i)break;n=parseInt(i[1]);const o=new TextEncoder().encode(i[0]).length;r=r.slice(o)}if(n!==null&&r.length>=n){const m=r.slice(0,n);r=r.slice(n),n=null;const i=t.decode(m),o=M.JSON_CODEC.decodeString(i);e(o)}else break}}},ue=e=>{const t=JSON.stringify(e);return`Content-Length: ${new TextEncoder().encode(t).length}\r
|
|
1
|
+
"use strict";var ge=Object.defineProperty;var ye=(e,t,r)=>t in e?ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var y=(e,t,r)=>ye(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("./index-C_6NXBlg.cjs"),i=require("zod"),h=require("./series-DqJ6f97G.cjs"),be=require("./index-Dd8DLyMx.cjs"),_e=require("./change-C-YELKx6.cjs"),F=require("./scale-BtZINJ-A.cjs"),m=require("./index-CYYjI7Uf.cjs"),B=require("./debounce.cjs"),we=require("./deep.cjs"),Se=require("./identity.cjs"),ve=require("./external-C-dNgNQw.cjs"),Te=require("./link.cjs"),g=require("./bounds-BQo7rvs9.cjs"),Ee=require("./observe.cjs"),I=require("./record.cjs"),$e=require("./external-uXk0Avrg.cjs"),Me=require("./search.cjs"),ze=require("./box-0YrQibkB.cjs"),xe=require("./dimensions-D2QGoNXO.cjs"),ke=require("./direction-C-b6XTeU.cjs"),qe=require("./location-BGl5Ddds.cjs"),Ae=require("./position-Cai5-wi1.cjs"),je=require("./spatial-DGpZ2sO3.cjs"),Oe=require("./xy-B7065J2S.cjs"),G=require("./toArray.cjs"),Ne=require("./index-udOjA9d-.cjs"),J=require("./url.cjs"),P=require("./worker.cjs"),Re=require("./external-DWQITF5_.cjs"),Ce=2,Le=3,Ie=2,Pe=(e,t)=>{if(Number.isNaN(e)||!Number.isFinite(e))return e;const r=g.span(t);if(r==0)return e;let n;r>=1e3?n=Ce:r>=1?n=Le:n=Math.ceil(-Math.log10(r))+Ie;const o=10**n;return Math.round(e*o)/o},Ze=Object.freeze(Object.defineProperty({__proto__:null,abs:g.abs,add:g.add,closeTo:g.closeTo,div:g.div,equal:g.equal,max:g.max$1,min:g.min,mult:g.mult,roundBySpan:Pe,roundToNearestMagnitude:g.roundToNearestMagnitude,sub:g.sub},Symbol.toStringTag,{value:"Module"})),Q=async e=>await new Promise(t=>setTimeout(t,h.TimeSpan.fromMilliseconds(e).milliseconds)),We=Object.freeze(Object.defineProperty({__proto__:null,sleep:Q},Symbol.toStringTag,{value:"Module"}));class Ue{constructor(t){y(this,"config");y(this,"retries");y(this,"interval");this.config={baseInterval:new h.TimeSpan((t==null?void 0:t.baseInterval)??h.TimeSpan.seconds(1)),maxRetries:(t==null?void 0:t.maxRetries)??5,scale:(t==null?void 0:t.scale)??1,sleepFn:(t==null?void 0:t.sleepFn)??Q},this.retries=0,this.interval=new h.TimeSpan(this.config.baseInterval)}async wait(){const{maxRetries:t,scale:r,sleepFn:n}=this.config;return this.retries>=t?!1:(await n(this.interval),this.interval=this.interval.mult(r),this.retries++,!0)}reset(){this.retries=0,this.interval=this.config.baseInterval}}const De=i.z.object({baseInterval:h.TimeSpan.z.optional(),maxRetries:i.z.number().optional(),scale:i.z.number().optional()}),He=Object.freeze(Object.defineProperty({__proto__:null,Breaker:Ue,breakerConfig:De},Symbol.toStringTag,{value:"Module"})),Ve=/^#?([0-9a-f]{6}|[0-9a-f]{8})$/i,Z=i.z.string().regex(Ve),_=i.z.number().min(0).max(255),Fe=i.z.number().min(0).max(1),W=i.z.tuple([_,_,_,Fe]),Y=i.z.tuple([_,_,_]),Be=e=>$.safeParse(e).success,Ge=e=>W.safeParse(e).success,Je=e=>{if(e==null)return;const t=$.safeParse(e);if(t.success)return ee(t.data);if(typeof e=="string")return e;throw t.error},f=(e,t=1)=>{if(typeof e=="string")return ot(e,t);if(Array.isArray(e)){if(e.length<3||e.length>4)throw new Error(`Invalid color: [${e.join(", ")}]`);return e.length===3?[...e,t]:e}throw new Error(`Invalid color: ${JSON.stringify(e)}`)},K=(e,t)=>{if(e==null||t==null)return!1;const r=f(e),n=f(t);return r.every((o,s)=>o===n[s])},X=e=>{if(e==null)return;const[t,r,n,o]=f(e);return`#${z(t)}${z(r)}${z(n)}${o===1?"":z(o*255)}`},ee=e=>{const[t,r,n,o]=f(e);return`rgba(${t}, ${r}, ${n}, ${o})`},Qe=e=>`rgb(${te(e)})`,te=e=>{const[t,r,n]=f(e);return`${t}, ${r}, ${n}`},Ye=e=>[...U(e),T(e)],U=e=>[w(e)/255,S(e)/255,v(e)/255],w=e=>f(e)[0],S=e=>f(e)[1],v=e=>f(e)[2],T=e=>f(e)[3],Ke=e=>K(D,e),Xe=e=>ct(f(e)),et=(e,t)=>{const[r,n,o]=f(e);if(t>100)throw new Error(`Color opacity must be between 0 and 100, got ${t}`);return t>1&&(t/=100),[r,n,o,t]},k=e=>{const[t,r,n]=U(e).map(o=>o<=.03928?o/12.92:((o+.055)/1.055)**2.4);return Number((.2126*t+.7152*r+.0722*n).toFixed(3))},tt=e=>{const[t,r,n]=U(e);return 1-(Math.max(t,r,n)-Math.min(t,r,n))},N=(e,t)=>{const r=f(e),n=f(t),o=k(r),s=k(n);return(Math.max(o,s)+.5)/(Math.min(o,s)+.5)},rt=(e,...t)=>{if(t.length===0)throw new Error("[Color.pickByContrast] - must provide at least one color");const r=f(e),[n]=t.map(o=>f(o)).sort((o,s)=>N(r,s)-N(r,o));return n},re=e=>k(e)<.5,nt=e=>!re(e),$=i.z.union([Z,W,Y]).transform(e=>f(e)),ot=(e,t=1)=>{if(!Z.safeParse(e).success)throw new Error(`Invalid hex color: ${e}`);return e=st(e),[x(e,0),x(e,2),x(e,4),e.length===8?x(e,6)/255:t]},D=[0,0,0,0],z=e=>Math.floor(e).toString(16).padStart(2,"0"),x=(e,t)=>parseInt(e.slice(t,t+2),16),st=e=>e.startsWith("#")?e.slice(1):e,it=e=>{let[t,r,n]=e;const o=e[3];t/=360,r/=100,n/=100;let s,a,d;if(r===0)s=a=d=n;else{const l=n<.5?n*(1+r):n+r-n*r,c=2*n-l;s=O(c,l,t+1/3),a=O(c,l,t),d=O(c,l,t-1/3)}return[Math.round(s*255),Math.round(a*255),Math.round(d*255),o]},O=(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),ct=e=>{let[t,r,n]=e;const o=e[3];t/=255,r/=255,n/=255;const s=Math.max(t,r,n),a=Math.min(t,r,n);let d,l,c=(s+a)/2;if(s===a)d=l=0;else{const u=s-a;l=c>.5?u/(2-s-a):u/(s+a),s===t?d=(r-n)/u+(r<n?6:0):s===r?d=(n-t)/u+2:d=(t-r)/u+4,d/=6}return d*=360,l*=100,c*=100,[Math.round(d),Math.round(l),Math.round(c),o]},ne=i.z.union([Z,W,i.z.string(),Y]),at=f("#000000"),lt=f("#ffffff"),oe=i.z.object({key:i.z.string(),color:ne,position:i.z.number(),switched:i.z.boolean().optional()}),ut=i.z.array(oe),dt=(e,t)=>{if(e.length===0)return D;if(e=e.slice().sort((r,n)=>r.position-n.position),t<=e[0].position)return f(e[0].color);if(t>=e[e.length-1].position)return f(e[e.length-1].color);for(let r=0;r<e.length-1;r++){const n=e[r],o=e[r+1];if(t>=n.position&&t<=o.position){if(t===n.position)return f(n.color);if(t===o.position)return f(o.color);const s=(t-n.position)/(o.position-n.position),a=f(n.color),d=f(o.color),l=Math.round(w(a)+s*(w(d)-w(a))),c=Math.round(S(a)+s*(S(d)-S(a))),u=Math.round(v(a)+s*(v(d)-v(a))),p=T(a)+s*(T(d)-T(a));return f([l,c,u,p])}}return f(e[e.length-1].color)},ft=i.z.object({key:i.z.string(),name:i.z.string(),color:$}),ht=i.z.object({key:i.z.string(),name:i.z.string(),swatches:i.z.array(ft)}),se=e=>{const t=$.safeParse(e);if(t.success)return X(t.data);if(typeof e=="object"&&e!=null){const r=Array.isArray(e)?[]:{};for(const n of Object.keys(e))r[n]=se(e[n]);return r}return e},pt=Object.freeze(Object.defineProperty({__proto__:null,BLACK:at,WHITE:lt,ZERO:D,aValue:T,bValue:v,colorZ:$,construct:f,contrast:N,crudeZ:ne,cssString:Je,equals:K,fromGradient:dt,fromHSLA:it,gValue:S,gradientZ:ut,grayness:tt,hex:X,hsla:Xe,isColor:Ge,isCrude:Be,isDark:re,isLight:nt,isZero:Ke,luminance:k,paletteZ:ht,pickByContrast:rt,rValue:w,rgbCSS:Qe,rgbString:te,rgba1:Ye,rgbaCSS:ee,setAlpha:et,stopZ:oe,transformColorsToHex:se},Symbol.toStringTag,{value:"Module"})),ie=i.z.number().int().min(0).max(255),ce=255,ae=0,mt={lower:ae,upper:ce+1},le=i.z.object({name:i.z.string(),key:i.z.string()}),E=e=>i.z.object({subject:le,resource:e,authority:ie}),gt=(...e)=>t=>t.filter(r=>{let n=!1;return r.to!=null&&(n=e.includes(r.to.resource)),r.from!=null&&!n&&(n=e.includes(r.from.resource)),n}),ue=i.z.object({from:E(i.z.any()),to:i.z.null()}),de=i.z.object({from:i.z.null(),to:E(i.z.any())}),yt=i.z.union([ue,de,i.z.object({from:E(i.z.any()),to:E(i.z.any())})]),bt=Object.freeze(Object.defineProperty({__proto__:null,ABSOLUTE_AUTHORITY:ce,AUTHORITY_BOUNDS:mt,ZERO_AUTHORITY:ae,acquireZ:de,authorityZ:ie,filterTransfersByChannelKey:gt,releaseZ:ue,stateZ:E,subjectZ:le,transferZ:yt},Symbol.toStringTag,{value:"Module"})),_t=e=>Object.getOwnPropertySymbols(globalThis).includes(e),wt=(e,t)=>{const r=Symbol.for(e);if(!_t(r)){const n=t();Object.defineProperty(globalThis,r,{value:n})}return()=>globalThis[r]},St=e=>t=>t!=null&&typeof t=="object"&&"type"in t&&typeof t.type=="string"?t.type.startsWith(e):t instanceof Error?t.message.startsWith(e):typeof t!="string"?!1:t.startsWith(e),q=e=>{var t;return t=class extends Error{constructor(o,s){super(o,s);y(this,"discriminator",t.discriminator);y(this,"type",t.TYPE);y(this,"matches",t.matches);this.name=t.TYPE}static sub(o){return q(`${e}.${o}`)}},y(t,"discriminator","FreighterError"),y(t,"TYPE",e),y(t,"matches",St(e)),t},fe=e=>{if(e==null||typeof e!="object")return!1;const t=e;if(t.discriminator!=="FreighterError")return!1;if(!("type"in t))throw new Error(`Freighter error is missing its type property: ${JSON.stringify(t)}`);return!0},b="unknown",R="nil";class vt{constructor(){y(this,"providers",[])}register(t){this.providers.push(t)}encode(t){if(t==null)return{type:R,data:""};if(fe(t))for(const r of this.providers){const n=r.encode(t);if(n!=null)return n}if(t instanceof Error)return{type:b,data:t.message};if(typeof t=="string")return{type:b,data:t};try{return{type:b,data:JSON.stringify(t)}}catch{return{type:b,data:"unable to encode error information"}}}decode(t){if(t==null||t.type===R)return null;if(t.type===b)return new C(t.data);for(const r of this.providers){const n=r.decode(t);if(n!=null)return n}return new C(t.data)}}const H=wt("synnax-error-registry",()=>new vt),Tt=({encode:e,decode:t})=>H().register({encode:e,decode:t}),Et=e=>H().encode(e),$t=e=>e==null?null:H().decode(e);class C extends q("unknown"){}const Mt=i.z.object({type:i.z.string(),data:i.z.string()});class zt extends q("canceled"){}const xt=Object.freeze(Object.defineProperty({__proto__:null,Canceled:zt,NONE:R,UNKNOWN:b,Unknown:C,createTyped:q,decode:$t,encode:Et,isTyped:fe,payloadZ:Mt,register:Tt},Symbol.toStringTag,{value:"Module"})),kt=e=>e?-1:1,qt=i.object({jsonrpc:i.string(),id:i.number().optional(),method:i.string().optional(),params:i.unknown().optional(),result:i.unknown().optional()}),At=e=>{const t=new TextDecoder;let r=new Uint8Array(0),n=null;return o=>{let s;typeof o=="string"?s=new TextEncoder().encode(o):o instanceof ArrayBuffer?s=new Uint8Array(o):s=o;const a=new Uint8Array(r.length+s.length);for(a.set(r),a.set(s,r.length),r=a;r.length>0;){if(n===null){const l=t.decode(r).match(/^Content-Length: (\d+)\r?\n\r?\n/);if(!l)break;n=parseInt(l[1]);const c=new TextEncoder().encode(l[0]).length;r=r.slice(c)}if(n!==null&&r.length>=n){const d=r.slice(0,n);r=r.slice(n),n=null;const l=t.decode(d),c=V.JSON_CODEC.decodeString(l,qt);e(c)}else break}}},jt=e=>{const t=JSON.stringify(e);return`Content-Length: ${new TextEncoder().encode(t).length}\r
|
|
2
2
|
\r
|
|
3
|
-
`+t},
|
|
3
|
+
`+t},Ot=Object.freeze(Object.defineProperty({__proto__:null,encodeMessage:jt,streamDecodeChunks:At},Symbol.toStringTag,{value:"Module"})),L=i.z.string().regex(/^\d+\.\d+\.\d+$/),M=(e,t,r={})=>{r.checkMajor??(r.checkMajor=!0),r.checkMinor??(r.checkMinor=!0),r.checkPatch??(r.checkPatch=!0);const n=L.parse(e),o=L.parse(t),[s,a,d]=n.split(".").map(Number),[l,c,u]=o.split(".").map(Number);if(r.checkMajor){if(s<l)return m.LESS_THAN;if(s>l)return m.GREATER_THAN}if(r.checkMinor){if(a<c)return m.LESS_THAN;if(a>c)return m.GREATER_THAN}if(r.checkPatch){if(d<u)return m.LESS_THAN;if(d>u)return m.GREATER_THAN}return m.EQUAL},Nt=(e,t,r={})=>m.isEqualTo(M(e,t,r)),he=(e,t,r={})=>m.isGreaterThan(M(e,t,r)),Rt=(e,t,r={})=>m.isLessThan(M(e,t,r)),Ct=({name:e,migrate:t})=>r=>{try{const n=t(r);return console.log(`${e} migrated: ${r.version} -> ${n.version}`),n}catch(n){throw console.log(`${e} failed to migrate from ${r.version}`),console.error(n),n}},Lt=({name:e,migrations:t,targetSchema:r,defaultVersion:n,def:o})=>{const s=Object.keys(t).sort(M).pop();if(s==null)return c=>{if(c.version??(c.version=n),c.version!==o.version)return console.log(`${e} version ${c.version} is newer than latest version of ${o.version}.
|
|
4
4
|
Returning default instead.
|
|
5
|
-
`),
|
|
5
|
+
`),o;try{return r!=null?r.parse(c):c}catch(u){return console.log(`${e} failed to parse default. Exiting with default`),console.error(u),o}};const a=Object.keys(t).length;let d=!1;const l=c=>{try{if(a===0||he(c.version,s))return console.log(d?`${e} ${c.version} now up to date`:`${e} version ${c.version} is up to date with target version ${o.version}`),c;const u=c.version,p=t[u],j=p(c);return d=!0,l(j)}catch(u){return console.log(`${e} failed to migrate from ${c.version} to ${s}`),console.error(u),o}};return c=>{try{if(c.version==null)if(n!=null)console.log(`${e} version is null. Setting version to default of ${n}`),c.version=n;else return console.log(`${e} version is null and no default version set. Exiting with default`),o;return l(c)}catch(u){return console.log(`${e} failed to parse final result. Exiting with default`),console.error(u),o}}},It=Object.freeze(Object.defineProperty({__proto__:null,compareSemVer:M,createMigration:Ct,migrator:Lt,semVerNewer:he,semVerOlder:Rt,semVerZ:L,versionsEqual:Nt},Symbol.toStringTag,{value:"Module"})),pe=["standard","scientific","engineering"],Pt=i.z.enum(pe),Zt=(e,t,r)=>{if(Number.isNaN(e))return"NaN";if(e===1/0)return"∞";if(e===-1/0)return"-∞";if(r==="standard")return e.toFixed(t);if(e===0)return t===0?"0ᴇ0":`0.${"0".repeat(t)}ᴇ0`;let n;return r==="scientific"?n=Math.floor(Math.log10(Math.abs(e))):n=Math.floor(Math.log10(Math.abs(e))/3)*3,`${(e/10**n).toFixed(t)}ᴇ${n}`},Wt=Object.freeze(Object.defineProperty({__proto__:null,NOTATIONS:pe,notationZ:Pt,stringifyNumber:Zt},Symbol.toStringTag,{value:"Module"})),Ut=e=>{if(e===void 0||typeof e=="string"||typeof e=="number")return e;if(e.toString===void 0)throw new Error("invalid renderer");return e.toString()},Dt=e=>Array.isArray(e)?[...e]:typeof e=="object"&&e!==null?{...e}:e,Ht=(e,t="")=>{const r=e.length;return r===0?t:r===1?e[0]:r===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[r-1]}`},Vt=e=>{const t=e.split(" "),r=new Set,n=t.map(l=>l.charAt(0).toLowerCase()).join("");r.add(n.replace(/-/g,"_")),r.add(n.replace(/(.)(.)/g,"$1_$2").replace(/-/g,"_"));const o=/\d+/g;e.match(o)&&t.forEach((l,c)=>{if(o.test(l)){const u=t.map((p,j)=>j!==c?p.charAt(0).toLowerCase():p).join("");r.add(u.replace(/-/g,"_")),r.add(u.replace(/(.)(.)/g,"$1_$2").replace(/-/g,"_"))}});const a=t.map(l=>(l.length>3?l.substring(0,3):l).toLowerCase());return r.add(a.join("").replace(/-/g,"_")),r.add(a.join("_").replace(/-/g,"_")),Array.from(r).filter(l=>l.length>=2&&l.length<=12&&!/^\d/.test(l))},Ft=Object.freeze(Object.defineProperty({__proto__:null,createShortIdentifiers:Vt,naturalLanguageJoin:Ht},Symbol.toStringTag,{value:"Module"})),Bt=new Error("request for lock canceled");var Gt=function(e,t,r,n){function o(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function d(u){try{c(n.next(u))}catch(p){a(p)}}function l(u){try{c(n.throw(u))}catch(p){a(p)}}function c(u){u.done?s(u.value):o(u.value).then(d,l)}c((n=n.apply(e,t||[])).next())})};class Jt{constructor(t,r=Bt){this._value=t,this._cancelError=r,this._queue=[],this._weightedWaiters=[]}acquire(t=1,r=0){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return new Promise((n,o)=>{const s={resolve:n,reject:o,weight:t,priority:r},a=me(this._queue,d=>r<=d.priority);a===-1&&t<=this._value?this._dispatchItem(s):this._queue.splice(a+1,0,s)})}runExclusive(t){return Gt(this,arguments,void 0,function*(r,n=1,o=0){const[s,a]=yield this.acquire(n,o);try{return yield r(s)}finally{a()}})}waitForUnlock(t=1,r=0){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return this._couldLockImmediately(t,r)?Promise.resolve():new Promise(n=>{this._weightedWaiters[t-1]||(this._weightedWaiters[t-1]=[]),Qt(this._weightedWaiters[t-1],{resolve:n,priority:r})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(t){this._value=t,this._dispatchQueue()}release(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);this._value+=t,this._dispatchQueue()}cancel(){this._queue.forEach(t=>t.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(t){const r=this._value;this._value-=t.weight,t.resolve([r,this._newReleaser(t.weight)])}_newReleaser(t){let r=!1;return()=>{r||(r=!0,this.release(t))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let t=this._value;t>0;t--){const r=this._weightedWaiters[t-1];r&&(r.forEach(n=>n.resolve()),this._weightedWaiters[t-1]=[])}else{const t=this._queue[0].priority;for(let r=this._value;r>0;r--){const n=this._weightedWaiters[r-1];if(!n)continue;const o=n.findIndex(s=>s.priority<=t);(o===-1?n:n.splice(0,o)).forEach(s=>s.resolve())}}}_couldLockImmediately(t,r){return(this._queue.length===0||this._queue[0].priority<r)&&t<=this._value}}function Qt(e,t){const r=me(e,n=>t.priority<=n.priority);e.splice(r+1,0,t)}function me(e,t){for(let r=e.length-1;r>=0;r--)if(t(e[r]))return r;return-1}var Yt=function(e,t,r,n){function o(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function d(u){try{c(n.next(u))}catch(p){a(p)}}function l(u){try{c(n.throw(u))}catch(p){a(p)}}function c(u){u.done?s(u.value):o(u.value).then(d,l)}c((n=n.apply(e,t||[])).next())})};class Kt{constructor(t){this._semaphore=new Jt(1,t)}acquire(){return Yt(this,arguments,void 0,function*(t=0){const[,r]=yield this._semaphore.acquire(1,t);return r})}runExclusive(t,r=0){return this._semaphore.runExclusive(()=>t(),1,r)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(t=0){return this._semaphore.waitForUnlock(1,t)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}class A extends Kt{static new(t){return new A(t)}constructor(t){super(),Object.assign(this,t)}}const Xt=e=>new A(e),er=Object.freeze(Object.defineProperty({__proto__:null,mutex:A,newMutex:Xt},Symbol.toStringTag,{value:"Module"}));exports.binary=V.codec;exports.DataType=h.DataType;exports.Density=h.Density;exports.MultiSeries=h.MultiSeries;exports.Rate=h.Rate;exports.Series=h.Series;exports.Size=h.Size;exports.TimeRange=h.TimeRange;exports.TimeSpan=h.TimeSpan;exports.TimeStamp=h.TimeStamp;exports.addSamples=h.addSamples;exports.convertDataType=h.convertDataType;exports.id=h.id;exports.isCrudeSeries=h.isCrudeSeries;exports.isTelemValue=h.isTelemValue;exports.sortTimeRange=h.sortTimeRange;exports.typedArrayZ=h.typedArrayZ;exports.caseconv=be.caseconv;exports.change=_e.change;exports.clamp=F.clamp;exports.scale=F.scale;exports.compare=m.compare;exports.isStringer=m.isStringer;exports.primitiveIsZero=m.primitiveIsZero;exports.debounce=B.debounce;exports.throttle=B.throttle;exports.deep=we.deep;exports.isObject=Se.isObject;exports.kv=ve.external;exports.link=Te.link;exports.bounds=g.bounds;exports.observe=Ee.observe;exports.getEntries=I.getEntries;exports.mapValues=I.mapValues;exports.unknownRecordZ=I.unknownRecordZ;exports.runtime=$e.external;exports.Search=Me.Search;exports.box=ze.box;exports.dimensions=xe.dimensions;exports.direction=ke.direction;exports.location=qe.location;exports.position=Ae.position;exports.spatial=je.spatial;exports.xy=Oe.xy;exports.nullToArr=G.nullToArr;exports.toArray=G.toArray;exports.unique=Ne.unique;exports.URL=J.URL;exports.buildQueryString=J.buildQueryString;exports.RoutedWorker=P.RoutedWorker;exports.TypedWorker=P.TypedWorker;exports.createMockWorkers=P.createMockWorkers;exports.zod=Re.external;exports.breaker=He;exports.color=pt;exports.control=bt;exports.convertRenderV=Ut;exports.errors=xt;exports.invert=kt;exports.jsonRPC=Ot;exports.math=Ze;exports.migrate=It;exports.notation=Wt;exports.shallowCopy=Dt;exports.sleep=We;exports.strings=Ft;exports.sync=er;
|