@synnaxlabs/pluto 0.44.0 → 0.44.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Animated-Owbkpo6B.js → Animated-D5cL3URg.js} +2 -2
- package/dist/{Animated-CCN9ByY6.cjs → Animated-DnsZ5vvU.cjs} +1 -1
- package/dist/{Menu-DZ-gh1ky.js → Menu-C-MABQ1r.js} +3 -3
- package/dist/{Menu-BSLsdSQe.cjs → Menu-vR5-lqo4.cjs} +1 -1
- package/dist/{Toggle-BWcSF1BX.cjs → Toggle-Ckdi4fKV.cjs} +1 -1
- package/dist/{Toggle-BUJcWkDS.js → Toggle-Dol9oHzM.js} +1 -1
- package/dist/{Video-BcSAFYkH.cjs → Video-BidrtYj_.cjs} +1 -1
- package/dist/{Video-DqCXiObt.js → Video-Cm8ZBqid.js} +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/color.cjs +1 -1
- package/dist/color.js +1 -1
- package/dist/css-9yccD6t_.cjs +8 -0
- package/dist/{css-Cg4qHNg7.js → css-Dl9aM7Jz.js} +694 -686
- package/dist/css.cjs +1 -1
- package/dist/css.js +2 -2
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +1 -1
- package/dist/{eraser-DeKDbhe4.cjs → eraser-CLWNvWDn.cjs} +20 -20
- package/dist/{eraser-BPrMJQSi.js → eraser-CZknVTjw.js} +11 -11
- package/dist/ether.cjs +1 -1
- package/dist/ether.js +6 -6
- package/dist/{external-ZbSTG-v-.js → external-B5RyMtMy.js} +3 -3
- package/dist/{external-BZs08bQT.js → external-B8qSW3N8.js} +3 -3
- package/dist/{external-D9Mbu0wy.cjs → external-BGCkpetp.cjs} +1 -1
- package/dist/{external-D2eCxMkQ.cjs → external-BJ91nMtQ.cjs} +6 -6
- package/dist/{external-CO49SSMt.js → external-BYJw6DJV.js} +3 -3
- package/dist/{external-JZqEUnPB.js → external-B_NFroo8.js} +4 -4
- package/dist/{external-DCftrpz2.js → external-CJZTgfAH.js} +4 -4
- package/dist/{external-Be6wSMuJ.cjs → external-CS6l_QN4.cjs} +1 -1
- package/dist/{external-bO6dVXFd.js → external-CU_XHLqP.js} +151 -143
- package/dist/{external-SZ8meWoz.js → external-CVNscTLA.js} +3 -3
- package/dist/{external-CcIlyM7a.cjs → external-CY2bvy20.cjs} +1 -1
- package/dist/{external-Cdszmp1I.cjs → external-CkvXTCCL.cjs} +1 -1
- package/dist/{external-DVV0t11f.cjs → external-ClD4VLgc.cjs} +1 -1
- package/dist/external-CtooTI5M.cjs +1 -0
- package/dist/{external-C4JmDQou.cjs → external-DFsKdN71.cjs} +1 -1
- package/dist/{external-E3bYM0JI.cjs → external-DNHOS3w0.cjs} +1 -1
- package/dist/{external-BhHJuw2t.js → external-DOd9BcLC.js} +2 -2
- package/dist/{external-CmXsU6yu.cjs → external-DPqPAgoV.cjs} +1 -1
- package/dist/{external-BHiMn0_8.cjs → external-DXY1bIut.cjs} +1 -1
- package/dist/{external-D7fvHJwL.cjs → external-DZqxSCvz.cjs} +1 -1
- package/dist/{external-Dd9YnYGw.js → external-DnnHYQqD.js} +3 -3
- package/dist/{external-fKroctog.js → external-Ylv9Wts9.js} +15 -15
- package/dist/{external-O7GBl914.cjs → external-_eEnQPcq.cjs} +1 -1
- package/dist/{external-CwWs_qf4.js → external-b2X_jilF.js} +2 -2
- package/dist/{external-BXXtl81l.js → external-pm79tCDD.js} +3 -3
- package/dist/{external-Dr1KTRgM.js → external-xfHaehZH.js} +27 -27
- package/dist/flex.cjs +1 -1
- package/dist/flex.js +1 -1
- package/dist/{fontString-BCV37JOn.js → fontString-Bm52S4Lo.js} +2 -2
- package/dist/{fontString-DUff-KJe.cjs → fontString-BptzSQcY.cjs} +1 -1
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.js +4636 -4601
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/{provider-Y8rmJd2z.js → provider-Bp-CLkh2.js} +1734 -1624
- package/dist/provider-DBSsDoFS.cjs +53 -0
- package/dist/src/channel/LinePlot.d.ts +2 -0
- package/dist/src/channel/LinePlot.d.ts.map +1 -1
- package/dist/src/dialog/Dialog.d.ts.map +1 -1
- package/dist/src/dialog/Frame.d.ts.map +1 -1
- package/dist/src/icon/registry.d.ts +1 -0
- package/dist/src/icon/registry.d.ts.map +1 -1
- package/dist/src/input/Text.d.ts +3 -2
- package/dist/src/input/Text.d.ts.map +1 -1
- package/dist/src/list/useStaticData.d.ts.map +1 -1
- package/dist/src/select/MultipleTrigger.d.ts.map +1 -1
- package/dist/src/select/Static.d.ts +1 -1
- package/dist/src/select/Static.d.ts.map +1 -1
- package/dist/src/telem/aether/transformers.d.ts +28 -2
- package/dist/src/telem/aether/transformers.d.ts.map +1 -1
- package/dist/src/vis/diagram/Diagram.d.ts +6 -0
- package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
- package/dist/src/vis/line/aether/line.d.ts +9 -2
- package/dist/src/vis/line/aether/line.d.ts.map +1 -1
- package/dist/symbols-B15FeAg9.cjs +92 -0
- package/dist/{symbols-DT8-7-NW.js → symbols-Lz5vQQDw.js} +7416 -7399
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text.cjs +1 -1
- package/dist/text.js +2 -2
- package/dist/theming.cjs +1 -1
- package/dist/theming.js +2 -2
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/triggers.cjs +1 -1
- package/dist/triggers.js +1 -1
- package/dist/{units-DR4EJndw.cjs → units-BGkvnLO-.cjs} +1 -1
- package/dist/{units-ts2tUMPH.js → units-HcS_zslH.js} +1 -1
- package/dist/video.cjs +1 -1
- package/dist/video.js +1 -1
- package/package.json +4 -4
- package/dist/css-BR-Ih764.cjs +0 -8
- package/dist/external-BKWucUPD.cjs +0 -1
- package/dist/provider-Dx_qX7Wi.cjs +0 -53
- package/dist/symbols-BtW1eE35.cjs +0 -92
package/dist/tabs.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./external-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./external-CS6l_QN4.cjs");exports.Tabs=e.external;
|
package/dist/tabs.js
CHANGED
package/dist/text.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./symbols-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./symbols-B15FeAg9.cjs");const e=require("./external-DPqPAgoV.cjs");exports.Text=e.external;
|
package/dist/text.js
CHANGED
package/dist/theming.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./symbols-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./symbols-B15FeAg9.cjs");const e=require("./external-DZqxSCvz.cjs");exports.Theming=e.external;
|
package/dist/theming.js
CHANGED
package/dist/tree.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./external-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./external-CkvXTCCL.cjs");exports.Tree=e.external;
|
package/dist/tree.js
CHANGED
package/dist/triggers.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./external-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./external-ClD4VLgc.cjs");exports.Triggers=e.external;
|
package/dist/triggers.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const c=require("./css-
|
|
1
|
+
"use strict";const c=require("./css-9yccD6t_.cjs"),i=(r,e,s)=>Object.fromEntries(s.map(t=>[`${r}-${t}`,c.ir.hex(c.ir.setAlpha(c.ir.construct(e),t))])),n=(r,e,s=!1)=>{const t=`${r}${e}`;return s?`round(${t}, 1px)`:t};exports.createHexOpacityVariants=i;exports.unitProperty=n;
|
package/dist/video.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Video-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Video-BidrtYj_.cjs");exports.Video=e.Video;
|
package/dist/video.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synnaxlabs/pluto",
|
|
3
|
-
"version": "0.44.
|
|
3
|
+
"version": "0.44.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@fontsource-variable/inter": "^5.2.6",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"react-icons": "^5.5.0",
|
|
22
22
|
"zod": "^4.0.2",
|
|
23
23
|
"@synnaxlabs/alamos": "^0.44.0",
|
|
24
|
-
"@synnaxlabs/client": "^0.44.1",
|
|
25
24
|
"@synnaxlabs/freighter": "0.44.0",
|
|
26
|
-
"@synnaxlabs/
|
|
25
|
+
"@synnaxlabs/client": "^0.44.1",
|
|
26
|
+
"@synnaxlabs/x": "^0.44.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@juggle/resize-observer": "^3.4.0",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"typescript": "^5.8.3",
|
|
45
45
|
"vite": "^7.0.4",
|
|
46
46
|
"vitest": "^3.2.4",
|
|
47
|
-
"@synnaxlabs/tsconfig": "^0.43.0",
|
|
48
47
|
"@synnaxlabs/vite-plugin": "^0.43.0",
|
|
48
|
+
"@synnaxlabs/tsconfig": "^0.43.0",
|
|
49
49
|
"eslint-config-synnaxlabs": "^0.43.0",
|
|
50
50
|
"stylelint-config-synnaxlabs": "^0.43.0"
|
|
51
51
|
},
|
package/dist/css-BR-Ih764.cjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";const a=require("zod"),fn=t=>{const e=t.replace(/_[a-z]/g,r=>r[1].toUpperCase());return e.length>1&&e[0]===e[0].toUpperCase()&&e[1]===e[1].toUpperCase()||e.length===0?e:e[0].toLowerCase()+e.slice(1)},ht=t=>{const e=(r,n=Je)=>{if(typeof r=="string")return t(r);if(Array.isArray(r))return r.map(o=>e(o,n));if(!Ze(r))return r;n=pn(n);const s={},i=r;return"toJSON"in i&&typeof i.toJSON=="function"?e(i.toJSON(),n):(Object.keys(i).forEach(o=>{let h=i[o];const l=t(o);n.recursive&&(Ze(h)?Rt(h)||(h=e(h,n)):n.recursiveInArray&&jt(h)&&(h=[...h].map(f=>{let p=f;return Ze(f)?Rt(p)||(p=e(f,n)):jt(f)&&(p=e({key:f},n).key),p}))),s[l]=h}),s)};return e},ft=ht(fn),dn=t=>t.replace(/([a-z0-9])([A-Z])/g,(e,r,n)=>`${r}_${n.toLowerCase()}`),Ft=ht(dn),Yt=t=>t.length===0?t:t[0].toUpperCase()+t.slice(1),gn=[Number,String,Uint8Array],Je={recursive:!0,recursiveInArray:!0},pn=(t=Je)=>(t.recursive==null?t=Je:t.recursiveInArray??=!1,t),jt=t=>t!=null&&Array.isArray(t),Ze=t=>t!=null&&typeof t=="object"&&!Array.isArray(t),Rt=t=>gn.some(e=>t instanceof e),yn=t=>t.replace(/\s+/g,"-").replace(/([a-z0-9])([A-Z])/g,(e,r,n)=>`${r}-${n.toLowerCase()}`).toLowerCase(),mn=ht(yn),bn=Object.freeze(Object.defineProperty({__proto__:null,camelToSnake:Ft,capitalize:Yt,snakeToCamel:ft,toKebab:mn},Symbol.toStringTag,{value:"Module"}));let wn=class{contentType="application/json";decoder;encoder;constructor(){this.decoder=new TextDecoder,this.encoder=new TextEncoder}encode(e){return this.encoder.encode(this.encodeString(e))}decode(e,r){return this.decodeString(this.decoder.decode(e),r)}decodeString(e,r){const n=JSON.parse(e),s=ft(n);return r!=null?r.parse(s):s}encodeString(e){const r=Ft(e);return JSON.stringify(r,(n,s)=>ArrayBuffer.isView(s)?Array.from(s):typeof s=="bigint"?s.toString():s)}};const Xe=new wn,Ke=t=>[...new Set(t)],On=(t,e,r=!0)=>{const n=new Map;return t.forEach(s=>{const i=e(s);if(n.has(i)){if(r)return;n.delete(i)}n.set(i,s)}),Array.from(n.values())},$n=Object.freeze(Object.defineProperty({__proto__:null,by:On,unique:Ke},Symbol.toStringTag,{value:"Module"}));let H=class{value;constructor(e){this.value=e}valueOf(){return this.value}toJSON(){return this.value}toString(){return this.value.toString()}};const dt=t=>t!=null&&typeof t=="object"&&"toString"in t,Tn=t=>{if(dt(t))return t?.toString().length===0;switch(typeof t){case"string":return t.length===0;case"number":return t===0;case"bigint":return t===0n;case"boolean":return!t;case"undefined":return!0;case"object":return t==null;default:return!1}},vn=Object.freeze(Object.defineProperty({__proto__:null,ValueExtension:H,isStringer:dt,isZero:Tn},Symbol.toStringTag,{value:"Module"})),Ee=(t,e=!1)=>{const r=dt(t)?"stringer":typeof t;let n;switch(r){case"string":n=(s,i)=>s.localeCompare(i);break;case"stringer":n=(s,i)=>s.toString().localeCompare(i.toString());break;case"number":n=(s,i)=>Number(s)-Number(i);break;case"bigint":n=(s,i)=>BigInt(s)-BigInt(i)>0n?1:-1;break;case"boolean":n=(s,i)=>Number(s)-Number(i);break;case"undefined":n=()=>0;break;default:return console.warn(`sortFunc: unknown type ${r}`),()=>-1}return e?Vt(n):n},xn=(t,e,r)=>{const n=Ee(e[t],r);return(s,i)=>n(s[t],i[t])},Sn=(t,e)=>t.length!==e.length?t.length-e.length:t.every((r,n)=>r===e[n])?0:-1,Zt=(t,e)=>{if(t.length!==e.length)return t.length-e.length;if(t.length===0)return 0;const r=Ee(t[0]),n=[...t].sort(r),s=[...e].sort(r);return n.every((i,o)=>i===s[o])?0:-1},Nn=(t,e)=>{const r=Ke(t),n=Ke(e);return Zt(r,n)},In=(t,e)=>t===e?0:t==="first"&&e==="last"?1:-1,Vt=t=>(e,r)=>t(r,e),_=0,Te=-1,ve=1,Wt=t=>t<_,Gt=t=>t>_,zn=t=>t>=_,Ht=t=>t===_,Mn=(t,e)=>{const r=/([a-zA-Z]+)|(\d+)/g,n=t.replace(/[\s_.-]+/g,"").match(r),s=e.replace(/[\s_.-]+/g,"").match(r);if(!n||!s)return 0;for(let i=0;i<Math.min(n.length,s.length);i++){const o=n[i],h=s[i];if(isNaN(Number(o))&&isNaN(Number(h))){const l=o.localeCompare(h);if(l!==0)return l}else if(!isNaN(Number(o))&&!isNaN(Number(h))){const l=Number(o)-Number(h);if(l!==0)return l}else return isNaN(Number(o))?-1:1}return n.length-s.length},En=Object.freeze(Object.defineProperty({__proto__:null,EQUAL:_,GREATER_THAN:ve,LESS_THAN:Te,isEqualTo:Ht,isGreaterThan:Gt,isGreaterThanEqual:zn,isLessThan:Wt,newF:Ee,newFieldF:xn,order:In,primitiveArrays:Sn,reverseF:Vt,stringsWithNumbers:Mn,uniqueUnorderedPrimitiveArrays:Nn,unorderedPrimitiveArrays:Zt},Symbol.toStringTag,{value:"Module"})),Ae=a.z.tuple([a.z.number(),a.z.number()]);a.z.tuple([a.z.bigint(),a.z.bigint()]);const gt=a.z.object({width:a.z.number(),height:a.z.number()}),An=a.z.object({signedWidth:a.z.number(),signedHeight:a.z.number()}),Bn=["width","height"];a.z.enum(Bn);const Un=["start","center","end"],Cn=["signedWidth","signedHeight"];a.z.enum(Cn);const he=a.z.object({x:a.z.number(),y:a.z.number()}),Jt=a.z.object({clientX:a.z.number(),clientY:a.z.number()}),Be=["x","y"],pt=a.z.enum(Be),Xt=["top","right","bottom","left"],jn=a.z.enum(Xt),Ue=["left","right"],yt=a.z.enum(Ue),Ce=["top","bottom"],mt=a.z.enum(Ce),bt=["center"],Qe=a.z.enum(bt),Rn=[...Xt,...bt],je=a.z.enum(Rn);a.z.enum(Un);const Ln=["first","last"];a.z.enum(Ln);const Kt=a.z.object({lower:a.z.number(),upper:a.z.number()}),Dn=a.z.object({lower:a.z.bigint(),upper:a.z.bigint()});a.z.union([Kt,Ae]);a.z.union([Dn,Ae]);const Pn=a.z.enum([...pt.options,...je.options]),qn=a.z.union([pt,je,a.z.instanceof(String)]),ae=(t,e)=>typeof t=="bigint"?t-BigInt(e):t-Number(e),Qt=(t,e)=>typeof t=="bigint"?t+BigInt(e):t+Number(e),kn=(t,e,r=1e-4)=>Math.abs(t-e)<r,_e=(t,e)=>typeof t=="bigint"?t===BigInt(e):t===Number(e),Fn=t=>{const e=10**Math.floor(Math.log10(t));return Math.round(t/e)*e},_t=(t,e)=>t<=e?t:typeof t=="bigint"?t<=e?t:BigInt(e):t<=e?t:Number(e),Yn=(t,e)=>typeof t=="bigint"?t>=e?t:BigInt(e):t>=e?t:Number(e),er=t=>t<0?-t:t,Z=(t,e)=>typeof t=="bigint"?t*BigInt(e):t*Number(e),Zn=(t,e)=>typeof t=="bigint"?t/BigInt(e):t/Number(e),m=(t,e,r)=>{const n={};if(typeof e=="object"&&(r=e,e=void 0),r={makeValid:!0,...r},typeof t=="number"||typeof t=="bigint")e!=null?(n.lower=t,n.upper=e):(n.lower=typeof t=="bigint"?0n:0,n.upper=t);else if(Array.isArray(t)){if(t.length!==2)throw new Error("bounds: expected array of length 2");[n.lower,n.upper]=t}else n.lower=t.lower,n.upper=t.upper;return r?.makeValid?tr(n):n},Vn=Object.freeze({lower:0,upper:0}),Wn=Object.freeze({lower:-1/0,upper:1/0}),Gn=Object.freeze({lower:0,upper:1}),Hn=Object.freeze({lower:-1,upper:1}),Jn=(t,e)=>{if(t==null&&e==null)return!0;if(t==null||e==null)return!1;const r=m(t),n=m(e);return r?.lower===n?.lower&&r?.upper===n?.upper},tr=t=>t.lower>t.upper?{lower:t.upper,upper:t.lower}:t,et=(t,e)=>{const r=m(t);return e<r.lower?r.lower:e>=r.upper?r.upper-(typeof r.upper=="number"?1:1n):e},N=(t,e)=>{const r=m(t);if(typeof e=="number"||typeof e=="bigint")return e>=r.lower&&e<r.upper;const n=m(e);return n.lower>=r.lower&&n.upper<=r.upper},Xn=(t,e)=>{const r=m(t),n=m(e);return r.lower===n.lower?!0:n.upper===r.lower||n.lower===r.upper?!1:N(r,n.upper)||N(r,n.lower)||N(n,r.upper)||N(n,r.lower)},ye=t=>{const e=m(t);return e.upper-e.lower},Kn=t=>{const e=m(t);return typeof e.lower=="bigint"?e.lower===0n&&e.upper===0n:e.lower===0&&e.upper===0},Qn=t=>{const e=ye(t);return typeof e=="number"?e===0:e===0n},_n=t=>{const e=m(t);return typeof e.lower=="bigint"?!0:Number.isFinite(e.lower)&&Number.isFinite(e.upper)},es=t=>{const e=m(t);return(e.upper+e.lower)/2},rr=t=>({lower:Math.min(...t.map(e=>m(e).lower)),upper:Math.max(...t.map(e=>m(e).upper))}),ts=t=>({lower:Math.max(...t.map(e=>m(e).lower)),upper:Math.min(...t.map(e=>m(e).upper))}),rs=t=>{const e=m(t),r=typeof e.lower=="bigint";return Array.from({length:Number(ye(t))},(n,s)=>r?e.lower+BigInt(s):e.lower+s)},tt=(t,e)=>{const r=t.map(i=>m(i)),n=r.findIndex(i=>N(i,e)||e<i.lower);if(n===-1)return{index:t.length,position:0};const s=r[n];return N(s,e)?{index:n,position:Number(e-s.lower)}:{index:n,position:0}},Ve={removeBefore:0,removeAfter:0,insertInto:0,deleteInBetween:0},ns=(t,e)=>{const r=t.map(f=>m(f)),n=m(e);if(r.length===0)return Ve;const s=tt(r,n.lower),i=tt(r,n.upper);if(s.index===t.length)return{...Ve,insertInto:t.length};if(i.index===0)return{...Ve,removeAfter:i.position};if(s.index===i.index)return s.position!==0&&i.position!==0?null:{removeAfter:i.position,removeBefore:s.position,insertInto:s.index,deleteInBetween:0};let o=i.index-s.index,h=s.index,l=ae(Number(ye(r[s.index])),s.position);return s.position!==0?(o-=1,h+=1):l=0,{removeBefore:l,removeAfter:i.position,insertInto:h,deleteInBetween:o}},nr=(t,e,r)=>{const n=t.map(h=>m(h)),s=r>0?1:r<0?-1:0;if(s===0)return e;let i=r,o=e;for(;_e(i,0)===!1;){const h=n.findIndex(l=>s>0?o>=l.lower&&o<l.upper:o>l.lower&&o<=l.upper);if(h!==-1){const l=n[h];let f;if(s>0?f=ae(l.upper,o):f=ae(o,l.lower),f>0){const p=_t(er(i),f);if(o=Qt(o,s>0?p:-p),i=ae(i,s>0?p:-p),_e(i,0))return o;continue}}if(s>0){const l=n.filter(f=>f.lower>o);if(l.length>0)o=l[0].lower;else return o}else{const l=n.filter(f=>f.upper<o);if(l.length>0)o=l[l.length-1].upper;else return o}}return o},sr=(t,e,r)=>{const n=t.map(o=>m(o));if(e===r)return typeof e=="bigint"?0n:0;const s=e<r?m([e,r]):m([r,e]);let i=typeof e=="bigint"?0n:0;for(const o of n){const h=o.lower>s.lower?o.lower:s.lower,l=o.upper<s.upper?o.upper:s.upper;if(h<l){const f=l-h;i=i+f}}return i},ss=Object.freeze(Object.defineProperty({__proto__:null,CLIP:Hn,DECIMAL:Gn,INFINITE:Wn,ZERO:Vn,bounds:Kt,buildInsertionPlan:ns,clamp:et,construct:m,contains:N,distance:sr,equals:Jn,findInsertPosition:tt,isFinite:_n,isZero:Kn,linspace:rs,makeValid:tr,max:rr,mean:es,min:ts,overlapsWith:Xn,span:ye,spanIsZero:Qn,traverse:nr},Symbol.toStringTag,{value:"Module"})),ir=Pn,R=t=>Be.includes(t)?t:Ce.includes(t)?"y":"x",is=t=>R(t)==="x"?"y":"x",as=t=>R(t)==="x"?"width":"height",os=t=>R(t)==="x"?"left":"top",us=t=>ir.safeParse(t).success,ls=t=>R(t)==="x"?"signedWidth":"signedHeight",ar=Object.freeze(Object.defineProperty({__proto__:null,DIRECTIONS:Be,construct:R,crude:ir,dimension:as,direction:pt,isDirection:us,location:os,signedDimension:ls,swap:is},Symbol.toStringTag,{value:"Module"})),cs=yt,hs=mt,fs=Qe,ds={top:"bottom",right:"left",bottom:"top",left:"right",center:"center"},gs={top:"left",right:"top",bottom:"right",left:"bottom",center:"center"},ps=qn,Y=t=>t instanceof String||!Be.includes(t)?t:t==="x"?"left":"top",or=t=>ds[Y(t)],ys=t=>gs[Y(t)],fe=t=>{const e=Y(t);return e==="top"||e==="bottom"?"y":"x"},ur=a.z.object({x:yt.or(Qe),y:mt.or(Qe)}),lr=a.z.object({x:yt,y:mt}),ee=Object.freeze({x:"left",y:"top"}),wt=Object.freeze({x:"right",y:"top"}),Re=Object.freeze({x:"left",y:"bottom"}),Ot=Object.freeze({x:"right",y:"bottom"}),Le=Object.freeze({x:"center",y:"center"}),$t=Object.freeze({x:"center",y:"top"}),Tt=Object.freeze({x:"center",y:"bottom"}),vt=Object.freeze({x:"right",y:"center"}),xt=Object.freeze({x:"left",y:"center"}),cr=Object.freeze([xt,vt,$t,Tt,ee,wt,Re,Ot,Le]),De=(t,e)=>t.x===e.x&&t.y===e.y,hr=(t,e)=>{if(typeof e=="object"){let r=!0;return"x"in e&&(t.x===e.x||(r=!1)),"y"in e&&(t.y===e.y||(r=!1)),r}return t.x===e||t.y===e},fr=t=>[t.x,t.y],xe=t=>fe(Y(t))==="x",ms=t=>fe(Y(t))==="y",bs=t=>`${t.x}${Yt(t.y)}`,ws=(t,e)=>{let r,n;if(typeof t=="object"&&"x"in t?(r=t.x,n=t.y):(r=Y(t),n=Y(e??t)),fe(r)===fe(n)&&r!=="center"&&n!=="center")throw new Error(`[XYLocation] - encountered two locations with the same direction: ${r.toString()} - ${n.toString()}`);const s={...Le};return r==="center"?xe(n)?[s.x,s.y]=[n,r]:[s.x,s.y]=[r,n]:n==="center"?xe(r)?[s.x,s.y]=[r,n]:[s.x,s.y]=[n,r]:xe(r)?[s.x,s.y]=[r,n]:[s.x,s.y]=[n,r],s},dr=Object.freeze(Object.defineProperty({__proto__:null,BOTTOM_CENTER:Tt,BOTTOM_LEFT:Re,BOTTOM_RIGHT:Ot,CENTER:Le,CENTER_LEFT:xt,CENTER_LOCATIONS:bt,CENTER_RIGHT:vt,TOP_CENTER:$t,TOP_LEFT:ee,TOP_RIGHT:wt,XY_LOCATIONS:cr,X_LOCATIONS:Ue,Y_LOCATIONS:Ce,center:fs,construct:Y,constructXY:ws,corner:lr,crude:ps,direction:fe,isX:xe,isY:ms,location:je,outer:jn,rotate90:ys,swap:or,x:cs,xy:ur,xyCouple:fr,xyEquals:De,xyMatches:hr,xyToString:bs,y:hs},Symbol.toStringTag,{value:"Module"})),rt=a.z.union([a.z.number(),he,Ae,gt,An,Jt]),T=(t,e)=>{if(typeof t=="string"){if(e===void 0)throw new Error("The y coordinate must be given.");return t==="x"?{x:e,y:0}:{x:0,y:e}}return typeof t=="number"?{x:t,y:e??t}:Array.isArray(t)?{x:t[0],y:t[1]}:"signedWidth"in t?{x:t.signedWidth,y:t.signedHeight}:"clientX"in t?{x:t.clientX,y:t.clientY}:"width"in t?{x:t.width,y:t.height}:{x:t.x,y:t.y}},A=Object.freeze({x:0,y:0}),gr=Object.freeze({x:1,y:1}),Os=Object.freeze({x:1/0,y:1/0}),$s=Object.freeze({x:NaN,y:NaN}),Me=(t,e,r=0)=>{const n=T(t),s=T(e);return r===0?n.x===s.x&&n.y===s.y:Math.abs(n.x-s.x)<=r&&Math.abs(n.y-s.y)<=r},Ts=t=>Me(t,A),St=(t,e,r)=>{const n=T(t),s=T(e,r);return{x:n.x*s.x,y:n.y*s.y}},pr=(t,e)=>{const r=T(t);return{x:r.x+e,y:r.y}},yr=(t,e)=>{const r=T(t);return{x:r.x,y:r.y+e}},de=(t,e,r,...n)=>typeof e=="string"&&typeof r=="number"?e==="x"?pr(t,r):yr(t,r):[t,e,r??A,...n].reduce((s,i)=>{const o=T(i);return{x:s.x+o.x,y:s.y+o.y}},A),vs=(t,e,r)=>{const n=T(t);return e==="x"?{x:r,y:n.y}:{x:n.x,y:r}},xs=(t,e)=>{const r=T(t),n=T(e);return Math.sqrt((r.x-n.x)**2+(r.y-n.y)**2)},Ss=(t,e)=>{const r=T(t),n=T(e);return{x:n.x-r.x,y:n.y-r.y}},Ns=t=>{const e=T(t);return Number.isNaN(e.x)||Number.isNaN(e.y)},Is=t=>{const e=T(t);return Number.isFinite(e.x)&&Number.isFinite(e.y)},zs=t=>{const e=T(t);return[e.x,e.y]},Ms=t=>{const e=T(t);return{left:e.x,top:e.y}},nt=(t,e=0)=>{const r=T(t);return{x:Number(r.x.toFixed(e)),y:Number(r.y.toFixed(e))}},ne=(t,e)=>{const r=T(t),n=T(e);return{x:r.x-n.x,y:r.y-n.y}},se=t=>{const e=T(t),r=Math.hypot(e.x,e.y);return r===0?{x:0,y:0}:{x:-e.y/r,y:e.x/r}},mr=t=>{const e=T(t),r=Math.hypot(e.x,e.y);return r===0?{x:0,y:0}:{x:e.x/r,y:e.y/r}},br=(...t)=>{const e=t.reduce((r,n)=>de(r,n),A);return St(e,1/t.length)},Es=(t,e)=>{const r=[];for(let n=0;n<t.length;n++){const s=t[n];let i,o,h,l;if(n===0){const f=t[n+1],p=ne(f,s);o=se(p),h=o,l=e}else if(n===t.length-1){const f=t[n-1],p=ne(s,f);i=se(p),h=i,l=e}else{const f=t[n-1],p=t[n+1],g=ne(s,f),x=ne(p,s);i=se(g),o=se(x);const z=Math.acos((g.x*x.x+g.y*x.y)/(Math.hypot(g.x,g.y)*Math.hypot(x.x,x.y))),te=Math.sin(z/2);te===0?l=e:l=e/te,h=mr(br(i,o))}r.push(St(h,l))}return r},As=t=>{const e=T(t);return{x:e.y,y:e.x}},Bs=Object.freeze(Object.defineProperty({__proto__:null,INFINITY:Os,NAN:$s,ONE:gr,ZERO:A,average:br,calculateMiters:Es,clientXY:Jt,construct:T,couple:zs,crudeZ:rt,css:Ms,distance:xs,equals:Me,isFinite:Is,isNan:Ns,isZero:Ts,normal:se,normalize:mr,scale:St,set:vs,sub:ne,swap:As,translate:de,translateX:pr,translateY:yr,translation:Ss,truncate:nt,xy:he},Symbol.toStringTag,{value:"Module"})),be=a.z.union([a.z.number(),a.z.string()]),Us=a.z.object({top:be,left:be,width:be,height:be}),Cs=a.z.object({left:a.z.number(),top:a.z.number(),right:a.z.number(),bottom:a.z.number()}),js=a.z.object({one:he,two:he,root:lr}),wr={one:A,two:A,root:ee},Rs={one:A,two:gr,root:Re},Or=(t,e)=>({one:t.one,two:t.two,root:e??t.root}),$=(t,e,r=0,n=0,s)=>{const i={one:{...A},two:{...A},root:s??ee};if(typeof t=="number"){if(typeof e!="number")throw new Error("Box constructor called with invalid arguments");return i.one={x:t,y:e},i.two={x:i.one.x+r,y:i.one.y+n},i}return"one"in t&&"two"in t&&"root"in t?{...t,root:s??t.root}:("getBoundingClientRect"in t&&(t=t.getBoundingClientRect()),"left"in t?(i.one={x:t.left,y:t.top},i.two={x:t.right,y:t.bottom},i):(i.one=t,e==null?i.two={x:i.one.x+r,y:i.one.y+n}:typeof e=="number"?i.two={x:i.one.x+e,y:i.one.y+r}:"width"in e?i.two={x:i.one.x+e.width,y:i.one.y+e.height}:"signedWidth"in e?i.two={x:i.one.x+e.signedWidth,y:i.one.y+e.signedHeight}:i.two=e,i))},Ls=(t,e,r)=>{const n=$(t);if(typeof e=="string"){if(r==null)throw new Error("Invalid arguments for resize");const s=R(e);return $(n.one,void 0,s==="x"?r:C(n),s==="y"?r:j(n),n.root)}return $(n.one,e,void 0,void 0,n.root)},Ds=(t,e,r=!0)=>{const n=$(t);let s=(i,o)=>i<o;return r&&(s=(i,o)=>i<=o),"one"in e?s(k(n),k(e))&&s(V(e),V(n))&&s(F(n),F(e))&&s(W(e),W(n)):s(k(n),e.x)&&s(e.x,V(n))&&s(F(n),e.y)&&s(e.y,W(n))},Ps=(t,e)=>Me(t.one,e.one)&&Me(t.two,e.two)&&De(t.root,e.root),$r=t=>({width:C(t),height:j(t)}),qs=t=>({signedWidth:Pe(t),signedHeight:qe(t)}),ks=t=>({top:F(t),left:k(t),width:C(t),height:j(t)}),Nt=(t,e,r=!1)=>{const n=R(e)==="y"?qe(t):Pe(t);return r?n:Math.abs(n)},B=(t,e)=>{const r=$(t);return{x:e.x==="center"?st(r).x:G(r,e.x),y:e.y==="center"?st(r).y:G(r,e.y)}},G=(t,e)=>{const r=$(t),n=fr(r.root).includes(e)?Math.min:Math.max;return Ue.includes(e)?n(r.one.x,r.two.x):n(r.one.y,r.two.y)},Fs=t=>t.one.x===t.two.x&&t.one.y===t.two.y,C=t=>Nt(t,"x"),j=t=>Nt(t,"y"),Pe=t=>{const e=$(t);return e.two.x-e.one.x},qe=t=>{const e=$(t);return e.two.y-e.one.y},Tr=t=>B(t,ee),Ys=t=>B(t,$t),Zs=t=>B(t,wt),Vs=t=>B(t,Re),Ws=t=>B(t,Tt),Gs=t=>B(t,Ot),Hs=t=>B(t,xt),Js=t=>B(t,vt),V=t=>G(t,"right"),W=t=>G(t,"bottom"),k=t=>G(t,"left"),F=t=>G(t,"top"),st=t=>de(Tr(t),{x:Pe(t)/2,y:qe(t)/2}),It=t=>{const e=$(t);return e.root.x==="left"?k(e):V(e)},zt=t=>{const e=$(t);return e.root.y==="top"?F(e):W(e)},Xs=t=>({x:It(t),y:zt(t)}),Se=t=>{const e=$(t);return{lower:e.one.x,upper:e.two.x}},Ne=t=>{const e=$(t);return{lower:e.one.y,upper:e.two.y}},Ks=(t,e)=>Or(t,e),Qs=(t,e)=>{const r=$(t),n=Ue.includes(e)?"x":Ce.includes(e)?"y":null;if(n===null)throw new Error(`Invalid location: ${e}`);const s=e==="top"||e==="left"?Math.min:Math.max,i={...r.one},o={...r.two};return i[n]=s(r.one[n],r.two[n]),o[n]=s(r.one[n],r.two[n]),[i,o]},_s=(t,e)=>{const r=$(t),n=$(e),s=It(n)+(C(n)-C(r))/2,i=zt(n)+(j(n)-j(r))/2;return $({x:s,y:i},$r(r))},vr=t=>typeof t!="object"||t==null?!1:"one"in t&&"two"in t&&"root"in t,ei=t=>C(t)/j(t),ti=(t,e,r)=>{if(typeof e=="string"){if(r==null)throw new Error("Undefined amount passed into box.translate");const s=R(e);e=T(s,r)}const n=$(t);return $(de(n.one,e),de(n.two,e),void 0,void 0,n.root)},xr=(t,e)=>{const r=Math.max(k(t),k(e)),n=Math.max(F(t),F(e)),s=Math.min(V(t),V(e)),i=Math.min(W(t),W(e));return r>s||n>i?wr:$({x:r,y:n},{x:s,y:i},void 0,void 0,t.root)},Sr=t=>C(t)*j(t),ri=(t,e)=>{const r=$(t);return $(nt(r.one,e),nt(r.two,e),void 0,void 0,r.root)},Nr=(t,e,r,n,s,i)=>{const o={x:t,y:e},h={x:t+r,y:e+n};return s.x!==i.x&&(s.x==="center"?(o.x-=r/2,h.x-=r/2):(o.x-=r,h.x-=r)),s.y!==i.y&&(s.y==="center"?(o.y-=n/2,h.y-=n/2):(o.y-=n,h.y-=n)),$(o,h,void 0,void 0,i)},ni=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:Rs,ZERO:wr,area:Sr,areaIsZero:Fs,aspect:ei,bottom:W,bottomCenter:Ws,bottomLeft:Vs,bottomRight:Gs,box:js,center:st,centerLeft:Hs,centerRight:Js,construct:$,constructWithAlternateRoot:Nr,contains:Ds,copy:Or,css:ks,cssBox:Us,dim:Nt,dims:$r,domRect:Cs,edgePoints:Qs,equals:Ps,height:j,intersection:xr,isBox:vr,left:k,loc:G,positionInCenter:_s,reRoot:Ks,resize:Ls,right:V,root:Xs,signedDims:qs,signedHeight:qe,signedWidth:Pe,top:F,topCenter:Ys,topLeft:Tr,topRight:Zs,translate:ti,truncate:ri,width:C,x:It,xBounds:Se,xyLoc:B,y:zt,yBounds:Ne},Symbol.toStringTag,{value:"Module"})),Ir=a.z.object({signedWidth:a.z.number(),signedHeight:a.z.number()}),si=a.z.union([gt,Ir,he,Ae]),ii={width:0,height:0},ai={width:1,height:1},I=(t,e)=>typeof t=="number"?{width:t,height:e??t}:Array.isArray(t)?{width:t[0],height:t[1]}:"x"in t?{width:t.x,height:t.y}:"signedWidth"in t?{width:t.signedWidth,height:t.signedHeight}:{...t},oi=(t,e)=>{if(e==null)return!1;const r=I(t),n=I(e);return r.width===n.width&&r.height===n.height},ui=t=>{const e=I(t);return{width:e.height,height:e.width}},li=t=>{const e=I(t);return`0 0 ${e.width} ${e.height}`},ci=t=>{const e=I(t);return[e.width,e.height]},hi=t=>({width:Math.max(...t.map(e=>I(e).width)),height:Math.max(...t.map(e=>I(e).height))}),fi=t=>({width:Math.min(...t.map(e=>I(e).width)),height:Math.min(...t.map(e=>I(e).height))}),di=(t,e)=>{const r=I(t);return{width:r.width*e,height:r.height*e}},gi=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:ai,ZERO:ii,construct:I,couple:ci,crude:si,dimensions:gt,equals:oi,max:hi,min:fi,scale:di,signed:Ir,svgViewBox:li,swap:ui},Symbol.toStringTag,{value:"Module"})),zr=(t,e,r)=>e!==void 0&&t<e?e:r!==void 0&&t>r?r:t,pi=a.z.object({offset:rt,scale:rt}),yi=a.z.object({offset:a.z.number(),scale:a.z.number()}),mi=t=>(e,r,n,s)=>r==="dimension"?[e,n]:[e,s?n-t:n+t],bi=t=>(e,r,n,s)=>[e,s?n/t:n*t],wi=t=>(e,r,n)=>{if(e===null)return[t,n];const{lower:s,upper:i}=e,{lower:o,upper:h}=t,l=i-s,f=h-o;if(r==="dimension")return[t,n*(f/l)];const p=(n-s)*(f/l)+o;return[t,p]},Oi=t=>(e,r,n)=>[t,n],$i=()=>(t,e,r)=>{if(t===null)throw new Error("cannot invert without bounds");if(e==="dimension")return[t,r];const{lower:n,upper:s}=t;return[t,s-(r-n)]},Ti=t=>(e,r,n)=>{const{lower:s,upper:i}=t;return n=zr(n,s,i),[e,n]};let it=class X{ops=[];currBounds=null;currType=null;reversed=!1;constructor(){this.ops=[]}static translate(e){return new X().translate(e)}static magnify(e){return new X().magnify(e)}static scale(e,r){return new X().scale(e,r)}translate(e){const r=this.new(),n=mi(e);return n.type="translate",r.ops.push(n),r}magnify(e){const r=this.new(),n=bi(e);return n.type="magnify",r.ops.push(n),r}scale(e,r){const n=m(e,r),s=this.new(),i=wi(n);return i.type="scale",s.ops.push(i),s}clamp(e,r){const n=m(e,r),s=this.new(),i=Ti(n);return i.type="clamp",s.ops.push(i),s}reBound(e,r){const n=m(e,r),s=this.new(),i=Oi(n);return i.type="re-bound",s.ops.push(i),s}invert(){const e=$i();e.type="invert";const r=this.new();return r.ops.push(e),r}pos(e){return this.exec("position",e)}dim(e){return this.exec("dimension",e)}new(){const e=new X;return e.ops=this.ops.slice(),e.reversed=this.reversed,e}exec(e,r){return this.currBounds=null,this.ops.reduce(([n,s],i)=>i(n,e,s,this.reversed),[null,r])[1]}reverse(){const e=this.new();e.ops.reverse();const r=[];return e.ops.forEach((n,s)=>{if(n.type==="scale"||r.some(([o,h])=>s>=o&&s<=h))return;const i=e.ops.findIndex((o,h)=>o.type==="scale"&&h>s);i!==-1&&r.push([s,i])}),r.forEach(([n,s])=>{const i=e.ops.slice(n,s);i.unshift(e.ops[s]),e.ops.splice(n,s-n+1,...i)}),e.reversed=!e.reversed,e}get transform(){return{scale:this.dim(1),offset:this.pos(0)}}static IDENTITY=new X},vi=class M{x;y;currRoot;constructor(e=new it,r=new it,n=null){this.x=e,this.y=r,this.currRoot=n}static translate(e,r){return new M().translate(e,r)}static translateX(e){return new M().translateX(e)}static translateY(e){return new M().translateY(e)}static clamp(e){return new M().clamp(e)}static magnify(e){return new M().magnify(e)}static scale(e){return new M().scale(e)}static reBound(e){return new M().reBound(e)}translate(e,r){const n=T(e,r),s=this.copy();return s.x=this.x.translate(n.x),s.y=this.y.translate(n.y),s}translateX(e){const r=this.copy();return r.x=this.x.translate(e),r}translateY(e){const r=this.copy();return r.y=this.y.translate(e),r}magnify(e){const r=this.copy();return r.x=this.x.magnify(e.x),r.y=this.y.magnify(e.y),r}scale(e){const r=this.copy();if(vr(e)){const n=this.currRoot;return r.currRoot=e.root,n!=null&&!De(n,e.root)&&(n.x!==e.root.x&&(r.x=r.x.invert()),n.y!==e.root.y&&(r.y=r.y.invert())),r.x=r.x.scale(Se(e)),r.y=r.y.scale(Ne(e)),r}return r.x=r.x.scale(e.width),r.y=r.y.scale(e.height),r}reBound(e){const r=this.copy();return r.x=this.x.reBound(Se(e)),r.y=this.y.reBound(Ne(e)),r}clamp(e){const r=this.copy();return r.x=this.x.clamp(Se(e)),r.y=this.y.clamp(Ne(e)),r}copy(){const e=new M;return e.currRoot=this.currRoot,e.x=this.x,e.y=this.y,e}reverse(){const e=this.copy();return e.x=this.x.reverse(),e.y=this.y.reverse(),e}pos(e){return{x:this.x.pos(e.x),y:this.y.pos(e.y)}}dim(e){return{x:this.x.dim(e.x),y:this.y.dim(e.y)}}box(e){return $(this.pos(e.one),this.pos(e.two),0,0,this.currRoot??e.root)}get transform(){return{scale:this.dim({x:1,y:1}),offset:this.pos({x:0,y:0})}}static IDENTITY=new M};const xi=Object.freeze(Object.defineProperty({__proto__:null,Scale:it,XY:vi,crudeXYTransform:pi,transform:yi},Symbol.toStringTag,{value:"Module"}));let Si=(t,e=21)=>(r=e)=>{let n="",s=r|0;for(;s--;)n+=t[Math.random()*t.length|0];return n};const Ni="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Mr=11,Ii=Si(Ni,Mr),Mt=()=>Ii(),zi=Object.freeze(Object.defineProperty({__proto__:null,LENGTH:Mr,create:Mt},Symbol.toStringTag,{value:"Module"})),Mi=(t,e)=>r=>r instanceof e||typeof r=="object"&&r!==null&&"discriminator"in r&&r.discriminator===t,Ei=a.z.enum(["static","dynamic"]),Ai=a.z.union([a.z.tuple([a.z.int()]),a.z.tuple([a.z.int(),a.z.int().min(1).max(12)]),a.z.tuple([a.z.int(),a.z.int().min(1).max(12),a.z.int().min(1).max(31)])]),Er=(t,e)=>{const r=new b(e);if(![c.DAY,c.HOUR,c.MINUTE,c.SECOND,c.MILLISECOND,c.MICROSECOND,c.NANOSECOND].some(s=>s.equals(r)))throw new Error("Invalid argument for remainder. Must be an even TimeSpan or Timestamp");const n=t.valueOf()%r.valueOf();return t instanceof b?new b(n):new c(n)};let b=class d extends H{constructor(e,r="UTC"){if(e==null)super(d.now().valueOf());else if(e instanceof Date)super(BigInt(e.getTime())*d.MILLISECOND.valueOf());else if(typeof e=="string")super(d.parseDateTimeString(e,r).valueOf());else if(Array.isArray(e))super(d.parseDate(e));else{let n=0n;e instanceof Number&&(e=e.valueOf()),r==="local"&&(n=d.utcOffset.valueOf()),typeof e=="number"&&(isFinite(e)?e=Math.trunc(e):(isNaN(e)&&(e=0),e===1/0?e=d.MAX:e=d.MIN)),super(BigInt(e.valueOf())+n)}}static parseDate([e=1970,r=1,n=1]){const s=new Date(e,r-1,n,0,0,0,0);return new d(BigInt(s.getTime())*d.MILLISECOND.valueOf()).truncate(d.DAY).valueOf()}valueOf(){return this.value}static parseTimeString(e,r="UTC"){const[n,s,i]=e.split(":");let o="00",h="00";i!=null&&([o,h]=i.split("."));let l=d.hours(parseInt(n??"00")).add(d.minutes(parseInt(s??"00"))).add(d.seconds(parseInt(o??"00"))).add(d.milliseconds(parseInt(h??"00")));return r==="local"&&(l=l.add(d.utcOffset)),l.valueOf()}static parseDateTimeString(e,r="UTC"){if(!e.includes("/")&&!e.includes("-"))return d.parseTimeString(e,r);const n=new Date(e);return e.includes(":")||n.setUTCHours(0,0,0,0),new d(BigInt(n.getTime())*d.MILLISECOND.valueOf(),r).valueOf()}fString(e="ISO",r="UTC"){switch(e){case"ISODate":return this.toISOString(r).slice(0,10);case"ISOTime":return this.toISOString(r).slice(11,23);case"time":return this.timeString(!1,r);case"preciseTime":return this.timeString(!0,r);case"date":return this.dateString();case"preciseDate":return`${this.dateString()} ${this.timeString(!0,r)}`;case"dateTime":return`${this.dateString()} ${this.timeString(!1,r)}`;default:return this.toISOString(r)}}toISOString(e="UTC"){return e==="UTC"?this.date().toISOString():this.sub(d.utcOffset).date().toISOString()}timeString(e=!1,r="UTC"){const n=this.toISOString(r);return e?n.slice(11,23):n.slice(11,19)}dateString(){const e=this.date(),r=e.toLocaleString("default",{month:"short"}),n=e.toLocaleString("default",{day:"numeric"});return`${r} ${n}`}static get utcOffset(){return new c(BigInt(new Date().getTimezoneOffset())*d.MINUTE.valueOf())}static since(e){return new d().span(e)}date(){return new Date(this.milliseconds)}equals(e){return this.valueOf()===new d(e).valueOf()}span(e){return this.range(e).span}range(e){return new q(this,e).makeValid()}spanRange(e){return this.range(this.add(e)).makeValid()}get isZero(){return this.valueOf()===0n}after(e){return this.valueOf()>new d(e).valueOf()}afterEq(e){return this.valueOf()>=new d(e).valueOf()}before(e){return this.valueOf()<new d(e).valueOf()}beforeEq(e){return this.valueOf()<=new d(e).valueOf()}add(e){return new d(this.valueOf()+BigInt(e.valueOf()))}sub(e){return new d(this.valueOf()-BigInt(e.valueOf()))}get hours(){return Number(this.valueOf())/Number(c.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(c.MINUTE.valueOf())}get days(){return Number(this.valueOf())/Number(c.DAY.valueOf())}get seconds(){return Number(this.valueOf())/Number(c.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(d.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(d.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get year(){return this.date().getUTCFullYear()}setYear(e){const r=this.date();return r.setUTCFullYear(e),new d(r)}get month(){return this.date().getUTCMonth()}setMonth(e){const r=this.date();return r.setUTCMonth(e),new d(r)}get day(){return this.date().getUTCDate()}setDay(e){const r=this.date();return r.setUTCDate(e),new d(r)}get hour(){return this.date().getUTCHours()}setHour(e){const r=this.date();return r.setUTCHours(e),new d(r,"UTC")}get minute(){return this.date().getUTCMinutes()}setMinute(e){const r=this.date();return r.setUTCMinutes(e),new d(r)}get second(){return this.date().getUTCSeconds()}setSecond(e){const r=this.date();return r.setUTCSeconds(e),new d(r)}get millisecond(){return this.date().getUTCMilliseconds()}setMillisecond(e){const r=this.date();return r.setUTCMilliseconds(e),new d(r)}toString(){return this.date().toISOString()}remainder(e){return Er(this,e)}get isToday(){return this.truncate(c.DAY).equals(d.now().truncate(c.DAY))}truncate(e){return this.sub(this.remainder(e))}static now(){return new d(new Date)}static max(...e){let r=d.MIN;for(const n of e){const s=new d(n);s.after(r)&&(r=s)}return r}static min(...e){let r=d.MAX;for(const n of e){const s=new d(n);s.before(r)&&(r=s)}return r}static nanoseconds(e,r="UTC"){return new d(e,r)}static NANOSECOND=d.nanoseconds(1);static microseconds(e,r="UTC"){return d.nanoseconds(e*1e3,r)}static MICROSECOND=d.microseconds(1);static milliseconds(e,r="UTC"){return d.microseconds(e*1e3,r)}static MILLISECOND=d.milliseconds(1);static seconds(e,r="UTC"){return d.milliseconds(e*1e3,r)}static SECOND=d.seconds(1);static minutes(e,r="UTC"){return d.seconds(e*60,r)}static MINUTE=d.minutes(1);static hours(e,r="UTC"){return d.minutes(e*60,r)}static HOUR=d.hours(1);static days(e,r="UTC"){return d.hours(e*24,r)}static DAY=d.days(1);static MAX=new d((1n<<63n)-1n);static MIN=new d(0);static ZERO=new d(0);static z=a.z.union([a.z.instanceof(d),a.z.object({value:a.z.bigint()}).transform(e=>new d(e.value)),a.z.string().transform(e=>new d(BigInt(e))),a.z.number().transform(e=>new d(e)),a.z.bigint().transform(e=>new d(e)),a.z.date().transform(e=>new d(e)),a.z.custom(e=>e instanceof c).transform(e=>new d(e)),Ai.transform(e=>new d(e))]);static sort(e,r){return Number(e.valueOf()-r.valueOf())}};class c extends H{constructor(e){typeof e=="number"&&(e=Math.trunc(e.valueOf())),super(BigInt(e.valueOf()))}static fromSeconds(e){return e instanceof c?e:e instanceof at?e.period:e instanceof b?new c(e):["number","bigint"].includes(typeof e)?c.seconds(e):new c(e)}static fromMilliseconds(e){return e instanceof c?e:e instanceof at?e.period:e instanceof b?new c(e):["number","bigint"].includes(typeof e)?c.milliseconds(e):new c(e)}valueOf(){return this.value}lessThan(e){return this.valueOf()<new c(e).valueOf()}greaterThan(e){return this.valueOf()>new c(e).valueOf()}lessThanOrEqual(e){return this.valueOf()<=new c(e).valueOf()}greaterThanOrEqual(e){return this.valueOf()>=new c(e).valueOf()}remainder(e){return Er(this,e)}truncate(e){return new c(BigInt(Math.trunc(Number(this.valueOf()/e.valueOf())))*e.valueOf())}toString(){const e=this.truncate(c.DAY),r=this.truncate(c.HOUR),n=this.truncate(c.MINUTE),s=this.truncate(c.SECOND),i=this.truncate(c.MILLISECOND),o=this.truncate(c.MICROSECOND),h=this.truncate(c.NANOSECOND),l=e,f=r.sub(e),p=n.sub(r),g=s.sub(n),x=i.sub(s),z=o.sub(i),te=h.sub(o);let L="";return l.isZero||(L+=`${l.days}d `),f.isZero||(L+=`${f.hours}h `),p.isZero||(L+=`${p.minutes}m `),g.isZero||(L+=`${g.seconds}s `),x.isZero||(L+=`${x.milliseconds}ms `),z.isZero||(L+=`${z.microseconds}µs `),te.isZero||(L+=`${te.nanoseconds}ns`),L.trim()}mult(e){return new c(this.valueOf()*BigInt(e))}get days(){return Number(this.valueOf())/Number(c.DAY.valueOf())}get hours(){return Number(this.valueOf())/Number(c.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(c.MINUTE.valueOf())}get seconds(){return Number(this.valueOf())/Number(c.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(c.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(c.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get isZero(){return this.valueOf()===0n}equals(e){return this.valueOf()===new c(e).valueOf()}add(e){return new c(this.valueOf()+new c(e).valueOf())}sub(e){return new c(this.valueOf()-new c(e).valueOf())}static nanoseconds(e=1){return new c(e)}static NANOSECOND=c.nanoseconds(1);static microseconds(e=1){return c.nanoseconds(Z(e,1e3))}static MICROSECOND=c.microseconds(1);static milliseconds(e=1){return c.microseconds(Z(e,1e3))}static MILLISECOND=c.milliseconds(1);static seconds(e=1){return c.milliseconds(Z(e,1e3))}static SECOND=c.seconds(1);static minutes(e=1){return c.seconds(Z(e,60))}static MINUTE=c.minutes(1);static hours(e){return c.minutes(Z(e,60))}static HOUR=c.hours(1);static days(e){return c.hours(Z(e,24))}static DAY=c.days(1);static MAX=new c((1n<<63n)-1n);static MIN=new c(0);static ZERO=new c(0);static z=a.z.union([a.z.object({value:a.z.bigint()}).transform(e=>new c(e.value)),a.z.string().transform(e=>new c(BigInt(e))),a.z.number().transform(e=>new c(e)),a.z.instanceof(c)])}let at=class K extends H{constructor(e){super(e.valueOf())}toString(){return`${this.valueOf()} Hz`}equals(e){return this.valueOf()===new K(e).valueOf()}get period(){return c.seconds(1/this.valueOf())}sampleCount(e){return new c(e).seconds*this.valueOf()}byteCount(e,r){return this.sampleCount(e)*new S(r).valueOf()}span(e){return c.seconds(e/this.valueOf())}byteSpan(e,r){return this.span(e.valueOf()/r.valueOf())}static hz(e){return new K(e)}static khz(e){return K.hz(e*1e3)}static z=a.z.union([a.z.number().transform(e=>new K(e)),a.z.instanceof(K)])},S=class U extends H{constructor(e){super(e.valueOf())}length(e){return e.valueOf()/this.valueOf()}size(e){return new y(e*this.valueOf())}static UNKNOWN=new U(0);static BIT128=new U(16);static BIT64=new U(8);static BIT32=new U(4);static BIT16=new U(2);static BIT8=new U(1);static z=a.z.union([a.z.number().transform(e=>new U(e)),a.z.instanceof(U)])},q=class E{start;end;constructor(e,r){typeof e=="object"&&"start"in e?(this.start=new b(e.start),this.end=new b(e.end)):(this.start=new b(e),this.end=new b(r))}get span(){return new c(this.end.valueOf()-this.start.valueOf())}get isValid(){return this.start.valueOf()<=this.end.valueOf()}makeValid(){return this.isValid?this:this.swap()}get isZero(){return this.span.isZero}get numeric(){return{start:Number(this.start.valueOf()),end:Number(this.end.valueOf())}}swap(){return new E(this.end,this.start)}get numericBounds(){return{lower:Number(this.start.valueOf()),upper:Number(this.end.valueOf())}}equals(e,r=c.ZERO){if(r.isZero)return this.start.equals(e.start)&&this.end.equals(e.end);let n=this.start.sub(e.start).valueOf(),s=this.end.sub(e.end).valueOf();return n<0&&(n=-n),s<0&&(s=-s),n<=r.valueOf()&&s<=r.valueOf()}toString(){return`${this.start.toString()} - ${this.end.toString()}`}toPrettyString(){return`${this.start.fString("preciseDate")} - ${this.span.toString()}`}overlapsWith(e,r=c.ZERO){e=e.makeValid();const n=this.makeValid();if(this.equals(e))return!0;if(e.end.equals(n.start)||n.end.equals(e.start))return!1;const s=b.max(n.start,e.start),i=b.min(n.end,e.end);return i.before(s)?!1:new c(i.sub(s)).greaterThanOrEqual(r)}contains(e){return e instanceof E?this.contains(e.start)&&this.contains(e.end):this.start.beforeEq(e)&&this.end.after(e)}boundBy(e){const r=new E(this.start,this.end);return e.start.after(this.start)&&(r.start=e.start),e.start.after(this.end)&&(r.end=e.start),e.end.before(this.end)&&(r.end=e.end),e.end.before(this.start)&&(r.start=e.end),r}static max(...e){return new E(b.min(...e.map(r=>r.start)),b.max(...e.map(r=>r.end)))}static MAX=new E(b.MIN,b.MAX);static MIN=new E(b.MAX,b.MIN);static ZERO=new E(b.ZERO,b.ZERO);static z=a.z.union([a.z.object({start:b.z,end:b.z}).transform(e=>new E(e.start,e.end)),a.z.instanceof(E)]);static sort(e,r){return b.sort(e.start,r.start)||b.sort(e.end,r.end)}},O=class u extends H{constructor(e){if(e instanceof u||typeof e=="string"||typeof e.valueOf()=="string")super(e.valueOf());else{const r=u.ARRAY_CONSTRUCTOR_DATA_TYPES.get(e.constructor.name);if(r==null)throw new Error(`unable to find data type for ${e.toString()}`);super(r.valueOf())}}get Array(){const e=u.ARRAY_CONSTRUCTORS.get(this.toString());if(e==null)throw new Error(`unable to find array constructor for ${this.valueOf()}`);return e}equals(e){return this.valueOf()===e.valueOf()}matches(...e){return e.some(r=>this.equals(r))}toString(){return this.valueOf()}get isVariable(){return this.equals(u.JSON)||this.equals(u.STRING)}get isNumeric(){return!this.isVariable&&!this.equals(u.UUID)}get isInteger(){const e=this.toString();return e.startsWith("int")||e.startsWith("uint")}get isFloat(){return this.toString().startsWith("float")}get density(){const e=u.DENSITIES.get(this.toString());if(e==null)throw new Error(`unable to find density for ${this.valueOf()}`);return e}get isUnsignedInteger(){return this.equals(u.UINT8)||this.equals(u.UINT16)||this.equals(u.UINT32)||this.equals(u.UINT64)}get isSignedInteger(){return this.equals(u.INT8)||this.equals(u.INT16)||this.equals(u.INT32)||this.equals(u.INT64)}canSafelyCastTo(e){return this.equals(e)?!0:!this.isNumeric||!e.isNumeric||this.isVariable||e.isVariable||this.isUnsignedInteger&&e.isSignedInteger?!1:this.isFloat?e.isFloat&&this.density.valueOf()<=e.density.valueOf():this.equals(u.INT32)&&e.equals(u.FLOAT64)||this.equals(u.INT8)&&e.equals(u.FLOAT32)?!0:this.isInteger&&e.isInteger?this.density.valueOf()<=e.density.valueOf()&&this.isUnsignedInteger===e.isUnsignedInteger:!1}canCastTo(e){return this.isNumeric&&e.isNumeric?!0:this.equals(e)}checkArray(e){return e.constructor===this.Array}get usesBigInt(){return u.BIG_INT_TYPES.some(e=>e.equals(this))}static UNKNOWN=new u("unknown");static FLOAT64=new u("float64");static FLOAT32=new u("float32");static INT64=new u("int64");static INT32=new u("int32");static INT16=new u("int16");static INT8=new u("int8");static UINT64=new u("uint64");static UINT32=new u("uint32");static UINT16=new u("uint16");static UINT8=new u("uint8");static BOOLEAN=this.UINT8;static TIMESTAMP=new u("timestamp");static UUID=new u("uuid");static STRING=new u("string");static JSON=new u("json");static ARRAY_CONSTRUCTORS=new Map([[u.UINT8.toString(),Uint8Array],[u.UINT16.toString(),Uint16Array],[u.UINT32.toString(),Uint32Array],[u.UINT64.toString(),BigUint64Array],[u.FLOAT32.toString(),Float32Array],[u.FLOAT64.toString(),Float64Array],[u.INT8.toString(),Int8Array],[u.INT16.toString(),Int16Array],[u.INT32.toString(),Int32Array],[u.INT64.toString(),BigInt64Array],[u.TIMESTAMP.toString(),BigInt64Array],[u.STRING.toString(),Uint8Array],[u.JSON.toString(),Uint8Array],[u.UUID.toString(),Uint8Array]]);static ARRAY_CONSTRUCTOR_DATA_TYPES=new Map([[Uint8Array.name,u.UINT8],[Uint16Array.name,u.UINT16],[Uint32Array.name,u.UINT32],[BigUint64Array.name,u.UINT64],[Float32Array.name,u.FLOAT32],[Float64Array.name,u.FLOAT64],[Int8Array.name,u.INT8],[Int16Array.name,u.INT16],[Int32Array.name,u.INT32],[BigInt64Array.name,u.INT64]]);static DENSITIES=new Map([[u.UINT8.toString(),S.BIT8],[u.UINT16.toString(),S.BIT16],[u.UINT32.toString(),S.BIT32],[u.UINT64.toString(),S.BIT64],[u.FLOAT32.toString(),S.BIT32],[u.FLOAT64.toString(),S.BIT64],[u.INT8.toString(),S.BIT8],[u.INT16.toString(),S.BIT16],[u.INT32.toString(),S.BIT32],[u.INT64.toString(),S.BIT64],[u.TIMESTAMP.toString(),S.BIT64],[u.STRING.toString(),S.UNKNOWN],[u.JSON.toString(),S.UNKNOWN],[u.UUID.toString(),S.BIT128]]);static ALL=[u.UNKNOWN,u.FLOAT64,u.FLOAT32,u.INT64,u.INT32,u.INT16,u.INT8,u.UINT64,u.UINT32,u.UINT16,u.UINT8,u.TIMESTAMP,u.UUID,u.STRING,u.JSON];static BIG_INT_TYPES=[u.INT64,u.UINT64,u.TIMESTAMP];static z=a.z.union([a.z.string().transform(e=>new u(e)),a.z.instanceof(u)])};class y extends H{constructor(e){super(e.valueOf())}largerThan(e){return this.valueOf()>e.valueOf()}smallerThan(e){return this.valueOf()<e.valueOf()}add(e){return y.bytes(this.valueOf()+e.valueOf())}sub(e){return y.bytes(this.valueOf()-e.valueOf())}truncate(e){return new y(Math.trunc(this.valueOf()/e.valueOf())*e.valueOf())}remainder(e){return y.bytes(this.valueOf()%e.valueOf())}get gigabytes(){return this.valueOf()/y.GIGABYTE.valueOf()}get megabytes(){return this.valueOf()/y.MEGABYTE.valueOf()}get kilobytes(){return this.valueOf()/y.KILOBYTE.valueOf()}get terabytes(){return this.valueOf()/y.TERABYTE.valueOf()}toString(){const e=this.truncate(y.TERABYTE),r=this.truncate(y.GIGABYTE),n=this.truncate(y.MEGABYTE),s=this.truncate(y.KILOBYTE),i=this.truncate(y.BYTE),o=e,h=r.sub(e),l=n.sub(r),f=s.sub(n),p=i.sub(s);let g="";return o.isZero||(g+=`${o.terabytes}TB `),h.isZero||(g+=`${h.gigabytes}GB `),l.isZero||(g+=`${l.megabytes}MB `),f.isZero||(g+=`${f.kilobytes}KB `),(!p.isZero||g==="")&&(g+=`${p.valueOf()}B`),g.trim()}static bytes(e=1){return new y(e)}static BYTE=new y(1);static kilobytes(e=1){return y.bytes(e.valueOf()*1e3)}static KILOBYTE=y.kilobytes(1);static megabytes(e=1){return y.kilobytes(e.valueOf()*1e3)}static MEGABYTE=y.megabytes(1);static gigabytes(e=1){return y.megabytes(e.valueOf()*1e3)}static GIGABYTE=y.gigabytes(1);static terabytes(e){return y.gigabytes(e.valueOf()*1e3)}static TERABYTE=y.terabytes(1);static ZERO=new y(0);static z=a.z.union([a.z.number().transform(e=>new y(e)),a.z.instanceof(y)]);get isZero(){return this.valueOf()===0}}const Bi=a.z.union([a.z.instanceof(Uint8Array),a.z.instanceof(Uint16Array),a.z.instanceof(Uint32Array),a.z.instanceof(BigUint64Array),a.z.instanceof(Float32Array),a.z.instanceof(Float64Array),a.z.instanceof(Int8Array),a.z.instanceof(Int16Array),a.z.instanceof(Int32Array),a.z.instanceof(BigInt64Array)]),Ar=t=>{const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e==="bigint"||t instanceof b||t instanceof c||t instanceof Date},Ui=(t,e,r,n=0)=>t.usesBigInt&&!e.usesBigInt?Number(r)-Number(n):!t.usesBigInt&&e.usesBigInt?BigInt(r.valueOf())-BigInt(n.valueOf()):Ie(r,-n),Ie=(t,e)=>e==0?t:t==0?e:typeof t=="bigint"&&typeof e=="bigint"||typeof t=="number"&&typeof e=="number"?t+e:Number(t)+Number(e),Ci=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function ji(t){return typeof t=="string"&&Ci.test(t)}const v=[];for(let t=0;t<256;++t)v.push((t+256).toString(16).slice(1));function Ri(t,e=0){return(v[t[e+0]]+v[t[e+1]]+v[t[e+2]]+v[t[e+3]]+"-"+v[t[e+4]]+v[t[e+5]]+"-"+v[t[e+6]]+v[t[e+7]]+"-"+v[t[e+8]]+v[t[e+9]]+"-"+v[t[e+10]]+v[t[e+11]]+v[t[e+12]]+v[t[e+13]]+v[t[e+14]]+v[t[e+15]]).toLowerCase()}function Li(t,e=0){const r=Ri(t,e);if(!ji(r))throw TypeError("Stringified UUID is invalid");return r}typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Br=(t,e)=>Li(t,e),D=-1,ot={[Symbol.iterator]:()=>ot,next:()=>({done:!0,value:void 0})},Di=a.z.string().transform(t=>new Uint8Array(atob(t).split("").map(e=>e.charCodeAt(0))).buffer),Pi=a.z.union([a.z.null(),a.z.undefined()]).transform(()=>new Uint8Array().buffer),ut=10,Ur=(t,e)=>{if(t==="number"&&!e.isNumeric)throw new Error(`cannot convert series of type ${e.toString()} to number`);if(t==="bigint"&&!e.usesBigInt)throw new Error(`cannot convert series of type ${e.toString()} to bigint`)},Cr="sy_x_telem_series";let Et=class P{key;discriminator=Cr;dataType;sampleOffset;gl;_data;timeRange=q.ZERO;alignment=0n;cachedMin;cachedMax;writePos=D;_refCount=0;cachedLength;_cachedIndexes;static crudeZ=a.z.object({timeRange:q.z.optional(),dataType:O.z,alignment:a.z.coerce.bigint().optional(),data:a.z.union([Di,Pi,a.z.instanceof(ArrayBuffer),a.z.instanceof(Uint8Array)]),glBufferUsage:Ei.optional().default("static").optional()});static z=P.crudeZ.transform(e=>new P(e));constructor(e){qi(e)&&(e={data:e}),e.data??=[];const{dataType:r,timeRange:n,sampleOffset:s=0,glBufferUsage:i="static",alignment:o=0n,key:h=Mt(),data:l}=e;if(jr(l)){const g=l;this.key=g.key,this.dataType=g.dataType,this.sampleOffset=g.sampleOffset,this.gl=g.gl,this._data=g._data,this.timeRange=g.timeRange,this.alignment=g.alignment,this.cachedMin=g.cachedMin,this.cachedMax=g.cachedMax,this.writePos=g.writePos,this._refCount=g._refCount,this.cachedLength=g.cachedLength;return}const f=Ar(l),p=Array.isArray(l);if(r!=null)this.dataType=new O(r);else{if(l instanceof ArrayBuffer)throw new Error("cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type.");if(p||f){let g=l;if(!f){if(l.length===0)throw new Error("cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type.");g=l[0]}if(typeof g=="string")this.dataType=O.STRING;else if(typeof g=="number")this.dataType=O.FLOAT64;else if(typeof g=="bigint")this.dataType=O.INT64;else if(typeof g=="boolean")this.dataType=O.BOOLEAN;else if(g instanceof b||g instanceof Date||g instanceof b)this.dataType=O.TIMESTAMP;else if(typeof g=="object")this.dataType=O.JSON;else throw new Error(`cannot infer data type of ${typeof g} when constructing a Series from a JS array`)}else this.dataType=new O(l)}if(!p&&!f)this._data=l;else if(p&&l.length===0)this._data=new this.dataType.Array([]).buffer;else{let g=f?[l]:l;const x=g[0];(x instanceof b||x instanceof Date||x instanceof c)&&(g=g.map(z=>new b(z).valueOf())),this.dataType.equals(O.STRING)?(this.cachedLength=g.length,this._data=new TextEncoder().encode(`${g.join(`
|
|
2
|
-
`)}
|
|
3
|
-
`).buffer):this.dataType.equals(O.JSON)?(this.cachedLength=g.length,this._data=new TextEncoder().encode(`${g.map(z=>Xe.encodeString(z)).join(`
|
|
4
|
-
`)}
|
|
5
|
-
`).buffer):this.dataType.usesBigInt&&typeof x=="number"?this._data=new this.dataType.Array(g.map(z=>BigInt(Math.round(z)))).buffer:!this.dataType.usesBigInt&&typeof x=="bigint"?this._data=new this.dataType.Array(g.map(Number)).buffer:this._data=new this.dataType.Array(g).buffer}this.key=h,this.alignment=o,this.sampleOffset=s??0,this.timeRange=n??q.ZERO,this.gl={control:null,buffer:null,prevBuffer:0,bufferUsage:i}}static alloc({capacity:e,dataType:r,...n}){if(e===0)throw new Error("[Series] - cannot allocate an array of length 0");const s=new new O(r).Array(e),i=new P({data:s.buffer,dataType:r,...n});return i.writePos=0,i}get refCount(){return this._refCount}acquire(e){this._refCount++,e!=null&&this.updateGLBuffer(e)}release(){this._refCount--,this.refCount===0&&this.gl.control!=null?this.maybeGarbageCollectGLBuffer(this.gl.control):this.refCount<0&&console.warn("cannot release a series with a negative reference count")}write(e){if(!e.dataType.equals(this.dataType))throw new Error("buffer must be of the same type as this array");return this.dataType.isVariable?this.writeVariable(e):this.writeFixed(e)}writeVariable(e){if(this.writePos===D)return 0;const r=this.byteCapacity.valueOf()-this.writePos,n=e.subBytes(0,r);return this.writeToUnderlyingData(n),this.writePos+=n.byteLength.valueOf(),this.cachedLength!=null&&(this.cachedLength+=n.length,this.calculateCachedLength()),n.length}writeFixed(e){if(this.writePos===D)return 0;const r=this.capacity-this.writePos,n=e.sub(0,r);return this.writeToUnderlyingData(n),this.cachedLength=void 0,this.maybeRecomputeMinMax(n),this.writePos+=n.length,n.length}writeToUnderlyingData(e){this.underlyingData.set(e.data,this.writePos)}get buffer(){return typeof this._data=="object"&&"buffer"in this._data?this._data.buffer:this._data}get underlyingData(){return new this.dataType.Array(this._data)}get data(){return this.writePos===D?this.underlyingData:new this.dataType.Array(this._data,0,this.writePos)}toStrings(){return this.dataType.isVariable?new TextDecoder().decode(this.underlyingData).split(`
|
|
6
|
-
`).slice(0,-1):Array.from(this).map(e=>e.toString())}parseJSON(e){if(!this.dataType.equals(O.JSON))throw new Error("cannot parse non-JSON series as JSON");return this.toStrings().map(r=>e.parse(Xe.decodeString(r)))}get byteCapacity(){return new y(this.underlyingData.byteLength)}get capacity(){return this.dataType.isVariable?this.byteCapacity.valueOf():this.dataType.density.length(this.byteCapacity)}get byteLength(){return this.writePos===D?this.byteCapacity:this.dataType.isVariable?new y(this.writePos):this.dataType.density.size(this.writePos)}get length(){return this.cachedLength!=null?this.cachedLength:this.dataType.isVariable?this.calculateCachedLength():this.writePos===D?this.byteCapacity.valueOf()/this.dataType.density.valueOf():this.writePos}calculateCachedLength(){if(!this.dataType.isVariable)throw new Error("cannot calculate length of a non-variable length data type");let e=0;const r=[0];return this.data.forEach((n,s)=>{n===ut&&(e++,r.push(s+1))}),this._cachedIndexes=r,this.cachedLength=e,e}convert(e,r=0){if(this.dataType.equals(e))return this;const n=new e.Array(this.length);for(let s=0;s<this.length;s++)n[s]=Ui(this.dataType,e,this.data[s],r);return new P({data:n.buffer,dataType:e,timeRange:this.timeRange,sampleOffset:r,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment})}calcRawMax(){if(this.length===0)return-1/0;if(this.dataType.equals(O.TIMESTAMP))this.cachedMax=this.data[this.data.length-1];else if(this.dataType.usesBigInt){const e=this.data;this.cachedMax=e.reduce((r,n)=>r>n?r:n)}else{const e=this.data;this.cachedMax=e.reduce((r,n)=>r>n?r:n)}return this.cachedMax}get max(){return this.calcMax()}calcMax(){if(this.dataType.isVariable)throw new Error("cannot calculate maximum on a variable length data type");return this.writePos===0?-1/0:(this.cachedMax??=this.calcRawMax(),Ie(this.cachedMax,this.sampleOffset))}calcRawMin(){if(this.length===0)return 1/0;if(this.dataType.equals(O.TIMESTAMP))this.cachedMin=this.data[0];else if(this.dataType.usesBigInt){const e=this.data;this.cachedMin=e.reduce((r,n)=>r<n?r:n)}else{const e=this.data;this.cachedMin=e.reduce((r,n)=>r<n?r:n)}return this.cachedMin}get min(){return this.calcMin()}calcMin(){if(this.dataType.isVariable)throw new Error("cannot calculate minimum on a variable length data type");return this.writePos===0?1/0:(this.cachedMin??=this.calcRawMin(),Ie(this.cachedMin,this.sampleOffset))}get bounds(){return m(Number(this.min),Number(this.max),{makeValid:!1})}maybeRecomputeMinMax(e){if(this.cachedMin!=null){const r=e.cachedMin??e.calcRawMin();r<this.cachedMin&&(this.cachedMin=r)}if(this.cachedMax!=null){const r=e.cachedMax??e.calcRawMax();r>this.cachedMax&&(this.cachedMax=r)}}atAlignment(e,r){const n=Number(e-this.alignment);if(n<0||n>=this.length){if(r===!0)throw new Error(`[series] - no value at index ${n}`);return}return this.at(n,r)}at(e,r=!1){if(this.dataType.isVariable)return this.atVariable(e,r??!1);if(this.dataType.equals(O.UUID))return this.atUUID(e,r);e<0&&(e=this.length+e);const n=this.data[e];if(n==null){if(r===!0)throw new Error(`[series] - no value at index ${e}`);return}return Ie(n,this.sampleOffset)}atUUID(e,r){e<0&&(e=this.length+e);const n=Br(new Uint8Array(this.buffer,e*this.dataType.density.valueOf()));if(n==null){if(r)throw new Error(`[series] - no value at index ${e}`);return}return n}atVariable(e,r){let n=0,s=0;if(this._cachedIndexes!=null)n=this._cachedIndexes[e],s=this._cachedIndexes[e+1]-1;else{e<0&&(e=this.length+e);for(let o=0;o<this.data.length;o++)if(this.data[o]===ut){if(e===0){s=o;break}n=o+1,e--}if(s===0&&(s=this.data.length),n>=s||e>0){if(r)throw new Error(`[series] - no value at index ${e}`);return}}const i=this.data.slice(n,s);return this.dataType.equals(O.STRING)?new TextDecoder().decode(i):ft(JSON.parse(new TextDecoder().decode(i)))}binarySearch(e){let r=0,n=this.length-1;const s=Ee(e);for(;r<=n;){const i=Math.floor((r+n)/2),o=s(this.at(i,!0),e);if(o===0)return i;o<0?r=i+1:n=i-1}return r}updateGLBuffer(e){if(this.gl.control=e,!this.dataType.equals(O.FLOAT32)&&!this.dataType.equals(O.UINT8))throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");const{buffer:r,bufferUsage:n,prevBuffer:s}=this.gl;if(r==null&&(this.gl.buffer=e.createBuffer()),this.writePos!==s)if(e.bindBuffer(e.ARRAY_BUFFER,this.gl.buffer),this.writePos!==D){s===0&&e.bufferData(e.ARRAY_BUFFER,this.byteCapacity.valueOf(),e.STATIC_DRAW);const i=this.dataType.density.size(s).valueOf(),o=this.underlyingData.slice(this.gl.prevBuffer,this.writePos);e.bufferSubData(e.ARRAY_BUFFER,i,o.buffer),this.gl.prevBuffer=this.writePos}else e.bufferData(e.ARRAY_BUFFER,this.buffer,n==="static"?e.STATIC_DRAW:e.DYNAMIC_DRAW),this.gl.prevBuffer=D}as(e){return Ur(e,this.dataType),this}get digest(){return{key:this.key,dataType:this.dataType.toString(),sampleOffset:this.sampleOffset,alignment:{lower:Dt(this.alignmentBounds.lower),upper:Dt(this.alignmentBounds.upper)},timeRange:this.timeRange.toString(),length:this.length,capacity:this.capacity}}get alignmentBounds(){return m(this.alignment,this.alignment+BigInt(this.length))}maybeGarbageCollectGLBuffer(e){this.gl.buffer!=null&&(e.deleteBuffer(this.gl.buffer),this.gl.buffer=null,this.gl.prevBuffer=0,this.gl.control=null)}get glBuffer(){if(this.gl.buffer==null)throw new Error("gl buffer not initialized");return this.gl.prevBuffer!==this.writePos&&console.warn("buffer not updated"),this.gl.buffer}[Symbol.iterator](){if(this.dataType.isVariable){const e=new ki(this);return this.dataType.equals(O.JSON)?new Fi(e):e}return this.dataType.equals(O.UUID)?new Yi(this):new Zi(this)}slice(e,r){return this.sliceSub(!1,e,r)}sub(e,r){return this.sliceSub(!0,e,r)}subIterator(e,r){return new Lt(this,e,r??this.length)}subAlignmentIterator(e,r){return new Lt(this,Number(e-this.alignment),Number(r-this.alignment))}subBytes(e,r){if(e>=0&&(r==null||r>=this.byteLength.valueOf()))return this;const n=this.data.subarray(e,r);return new P({data:n,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(e)})}sliceSub(e,r,n){if(r<=0&&(n==null||n>=this.length))return this;let s;return e?s=this.data.subarray(r,n):s=this.data.slice(r,n),new P({data:s,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(r)})}reAlign(e){return new P({data:this.buffer,dataType:this.dataType,timeRange:q.ZERO,sampleOffset:this.sampleOffset,glBufferUsage:"static",alignment:e})}toString(){let e=`Series(${this.dataType.toString()} ${this.length} [`;if(this.length<=10)e+=Array.from(this).map(r=>r.toString());else{for(let r=0;r<5;r++)e+=`${this.at(r)?.toString()}`,e+=",";e+="...,";for(let r=-5;r<0;r++)e+=this.at(r)?.toString(),r<-1&&(e+=",")}return e+="])",e}};const qi=t=>t==null?!1:Array.isArray(t)||t instanceof ArrayBuffer||ArrayBuffer.isView(t)&&!(t instanceof DataView)||t instanceof Et?!0:Ar(t),jr=Mi(Cr,Et);let Lt=class{series;end;index;constructor(e,r,n){this.series=e;const s=m(0,e.length);this.end=et(s,n),this.index=et(s,r)}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}};class ki{series;index;decoder;constructor(e){if(!e.dataType.isVariable)throw new Error("cannot create a variable series iterator for a non-variable series");this.series=e,this.index=0,this.decoder=new TextDecoder}next(){const e=this.index,r=this.series.data;for(;this.index<r.length&&r[this.index]!==ut;)this.index++;const n=this.index;return e===n?{done:!0,value:void 0}:(this.index++,{done:!1,value:this.decoder.decode(this.series.buffer.slice(e,n))})}}let Fi=class Rr{wrapped;static schema=a.z.record(a.z.string(),a.z.unknown());constructor(e){this.wrapped=e}next(){const e=this.wrapped.next();return e.done===!0?{done:!0,value:void 0}:{done:!1,value:Xe.decodeString(e.value,Rr.schema)}}},Yi=class{series;index;data;density;constructor(e){if(!e.dataType.equals(O.UUID))throw new Error("cannot create a UUID series iterator for a non-UUID series");this.series=e,this.index=0,this.data=new Uint8Array(e.buffer),this.density=O.UUID.density.valueOf()}next(){if(this.index>=this.series.length)return{done:!0,value:void 0};const e=Br(this.data,this.index*this.density);return this.index++,{done:!1,value:e}}},Zi=class{series;index;constructor(e){this.series=e,this.index=0}next(){return this.index>=this.series.length?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}},Vi=class{series;constructor(e=[]){if(e.length!==0){const r=e[0].dataType;for(let n=1;n<e.length;n++)if(!e[n].dataType.equals(r))throw new Error("[multi-series] - series must have the same data type")}this.series=e}as(e){return Ur(e,this.dataType),this}get dataType(){return this.series.length===0?O.UNKNOWN:this.series[0].dataType}get timeRange(){return this.series.length===0?q.ZERO:new q(this.series[0].timeRange.start,this.series[this.series.length-1].timeRange.end)}get alignment(){return this.series.length===0?0n:this.series[0].alignment}get alignmentBounds(){return this.series.length===0?m(0n,0n):m(this.series[0].alignmentBounds.lower,this.series[this.series.length-1].alignmentBounds.upper)}push(e){const r=()=>new Error(`cannot push a ${e.dataType.toString()} series to a ${this.dataType.toString()} multi-series`),n=e.dataType.equals(this.dataType);if(jr(e)){if(this.series.length!==0&&!n)throw r();this.series.push(e)}else{if(this.series.length!==0&&e.series.length!==0&&!n)throw r();this.series.push(...e.series)}}get length(){return this.series.reduce((e,r)=>e+r.length,0)}atAlignment(e,r){for(const n of this.series)if(N(n.alignmentBounds,e))return n.atAlignment(e,r);if(r)throw new Error(`[series] - no value at alignment ${e}`)}at(e,r=!1){e<0&&(e=this.length+e);for(const n of this.series){if(e<n.length)return n.at(e,r);e-=n.length}if(r)throw new Error(`[series] - no value at index ${e}`)}subIterator(e,r){return new We(this,e,r??this.length)}subAlignmentIterator(e,r){if(e>=this.alignmentBounds.upper||r<=this.alignmentBounds.lower)return ot;let n=0;for(let i=0;i<this.series.length;i++){const o=this.series[i];if(e<o.alignment)break;if(e>=o.alignmentBounds.upper)n+=o.length;else if(N(o.alignmentBounds,e)){n+=Number(e-o.alignment);break}}let s=0;for(let i=0;i<this.series.length;i++){const o=this.series[i];if(r<o.alignment)break;if(r>=o.alignmentBounds.upper)s+=o.length;else if(N(o.alignmentBounds,r)){s+=Number(r-o.alignment);break}}return new We(this,n,s)}subAlignmentSpanIterator(e,r){if(e>=this.alignmentBounds.upper)return ot;r=Math.min(r,Number(this.distance(e,this.alignmentBounds.upper)));let n=0;for(let s=0;s<this.series.length;s++){const i=this.series[s];if(e<i.alignment)break;if(e>=i.alignmentBounds.upper)n+=i.length;else if(N(i.alignmentBounds,e)){n+=Number(e-i.alignment);break}}return new We(this,n,n+r)}updateGLBuffer(e){this.series.forEach(r=>r.updateGLBuffer(e))}get bounds(){return rr(this.series.map(e=>e.bounds))}get byteLength(){return new y(this.series.reduce((e,r)=>e+r.byteLength.valueOf(),0))}get data(){const e=new this.dataType.Array(this.length);let r=0;for(const n of this.series)e.set(n.data,r),r+=n.length;return new this.dataType.Array(e.buffer)}traverseAlignment(e,r){const n=this.series.map(s=>s.alignmentBounds);return nr(n,e,r)}acquire(e){this.series.forEach(r=>r.acquire(e))}release(){this.series.forEach(e=>e.release())}distance(e,r){const n=this.series.map(s=>s.alignmentBounds);return sr(n,e,r)}parseJSON(e){if(!this.dataType.equals(O.JSON))throw new Error("cannot parse non-JSON series as JSON");return this.series.flatMap(r=>r.parseJSON(e))}[Symbol.iterator](){return this.series.length===0?{next(){return{done:!0,value:void 0}}}:new Wi(this.series)}toStrings(){return this.series.flatMap(e=>e.toStrings())}},Wi=class{series;seriesIndex;internal;constructor(e){this.series=e,this.seriesIndex=0,this.internal=e[0][Symbol.iterator]()}next(){const e=this.internal.next();return e.done===!1?e:this.seriesIndex===this.series.length-1?{done:!0,value:void 0}:(this.internal=this.series[++this.seriesIndex][Symbol.iterator](),this.next())}[Symbol.iterator](){return this}},We=class{series;index;end;constructor(e,r,n){this.series=e,this.end=n,this.index=r}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}[Symbol.iterator](){return this}};const Dt=t=>{const e=t>>32n,r=t&0xffffffffn;return{domain:e,sample:r}};a.z.object({key:a.z.string(),value:a.z.string()});const Gi=a.z.record(a.z.union([a.z.number(),a.z.string(),a.z.symbol()]),a.z.unknown()),At=t=>Object.entries(t),Hi=(t,e)=>Object.fromEntries(At(t).map(([r,n])=>[r,e(n,r)])),Ji=t=>Object.fromEntries(At(t).filter(([e,r])=>r!==void 0)),Xi=Object.freeze(Object.defineProperty({__proto__:null,entries:At,map:Hi,purgeUndefined:Ji,unknownZ:Gi},Symbol.toStringTag,{value:"Module"})),Lr=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null?"node":typeof window>"u"||window.document===void 0?"webworker":"browser",Ki=Lr(),Dr=["macOS","Windows","Linux"],Qi=["macos","windows","linux"],_i={macos:"macOS",windows:"Windows",linux:"Linux"},ea=a.z.enum(Dr).or(a.z.enum(Qi).transform(t=>_i[t])),ta=()=>{if(typeof window>"u")return;const t=window.navigator.userAgent.toLowerCase();if(t.includes("mac"))return"macOS";if(t.includes("win"))return"Windows";if(t.includes("linux"))return"Linux"};let Ge;const ra=(t={})=>{const{force:e,default:r}=t;return e??Ge??(Ge=ta(),Ge??r)},na=Object.freeze(Object.defineProperty({__proto__:null,OPERATING_SYSTEMS:Dr,RUNTIME:Ki,detect:Lr,getOS:ra,osZ:ea},Symbol.toStringTag,{value:"Module"})),sa=(...t)=>t.map(Pr).join(""),Pr=t=>(t.endsWith("/")||(t+="/"),t.startsWith("/")&&(t=t.slice(1)),t),ia=t=>t.endsWith("/")?t.slice(0,-1):t;class ze{protocol;host;port;path;constructor({host:e,port:r,protocol:n="",pathPrefix:s=""}){this.protocol=n,this.host=e,this.port=r,this.path=Pr(s)}replace(e){return new ze({host:e.host??this.host,port:e.port??this.port,protocol:e.protocol??this.protocol,pathPrefix:e.pathPrefix??this.path})}child(e){return new ze({...this,pathPrefix:sa(this.path,e)})}toString(){return ia(`${this.protocol}://${this.host}:${this.port}/${this.path}`)}static UNKNOWN=new ze({host:"unknown",port:0})}const aa=2,oa=3,ua=2,la=(t,e)=>{if(Number.isNaN(t)||!Number.isFinite(t))return t;const r=ye(e);if(r==0)return t;let n;r>=1e3?n=aa:r>=1?n=oa:n=Math.ceil(-Math.log10(r))+ua;const s=10**n;return Math.round(t*s)/s},ca=Object.freeze(Object.defineProperty({__proto__:null,abs:er,add:Qt,closeTo:kn,div:Zn,equal:_e,max:Yn,min:_t,mult:Z,roundBySpan:la,roundToNearestMagnitude:Fn,sub:ae},Symbol.toStringTag,{value:"Module"}));a.z.object({baseInterval:c.z.optional(),maxRetries:a.z.number().optional(),scale:a.z.number().optional()});const ha=/^#?([0-9a-f]{6}|[0-9a-f]{8})$/i,qr=a.z.string().regex(ha),Q=a.z.number().min(0).max(255),kr=a.z.number().min(0).max(1),ke=a.z.tuple([Q,Q,Q,kr]),fa=a.z.tuple([Q,Q,Q]),da=a.z.object({rgba255:ke}),ga=a.z.number().min(0).max(360),pa=a.z.number().min(0).max(100),ya=a.z.number().min(0).max(100),Fr=a.z.tuple([ga,pa,ya,kr]),Fe=a.z.union([qr,fa,ke,Fr,da]),Ye=Fe.transform(t=>w(t)),ma=t=>Ye.safeParse(t).success,ba=t=>ke.safeParse(t).success,wa=t=>{if(t==null)return;const e=Ye.safeParse(t);if(e.success)return Zr(e.data);if(typeof t=="string")return t;throw e.error},w=(t,e=1)=>{if(t=Fe.parse(t),typeof t=="string")return Ea(t,e);if(Array.isArray(t)){if(t.length<3||t.length>4)throw new Error(`Invalid color: [${t.join(", ")}]`);return t.length===3?[...t,e]:t}return t.rgba255},Yr=(t,e)=>{if(t==null||e==null)return t==e;const r=w(t),n=w(e);return r.every((s,i)=>s===n[i])},Oa=t=>{if(t==null)return;const[e,r,n,s]=w(t);return`#${we(e)}${we(r)}${we(n)}${s===1?"":we(s*255)}`},Zr=t=>{const[e,r,n,s]=w(t);return`rgba(${e}, ${r}, ${n}, ${s})`},$a=t=>`rgb(${Vr(t)})`,Vr=t=>{const[e,r,n]=w(t);return`${e}, ${r}, ${n}`},Ta=t=>[...Bt(t),ce(t)],Bt=t=>[oe(t)/255,ue(t)/255,le(t)/255],oe=t=>w(t)[0],ue=t=>w(t)[1],le=t=>w(t)[2],ce=t=>w(t)[3],va=t=>Yr(Ut,t),xa=t=>Ua(w(t)),Sa=(t,e)=>{const[r,n,s]=w(t);if(e>100)throw new Error(`Color opacity must be between 0 and 100, got ${e}`);return e>1&&(e/=100),[r,n,s,e]},ge=t=>{const[e,r,n]=Bt(t).map(s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4);return Number((.2126*e+.7152*r+.0722*n).toFixed(3))},Na=t=>{const[e,r,n]=Bt(t);return 1-(Math.max(e,r,n)-Math.min(e,r,n))},lt=(t,e)=>{const r=w(t),n=w(e),s=ge(r),i=ge(n);return(Math.max(s,i)+.5)/(Math.min(s,i)+.5)},Ia=(t,...e)=>{if(e.length===0)throw new Error("[Color.pickByContrast] - must provide at least one color");const r=w(t),[n]=e.sort((s,i)=>lt(r,i)-lt(r,s));return w(n)},za=t=>ge(t)<.5,Ma=t=>ge(t)>.5,Ea=(t,e=1)=>(t=qr.parse(t),t=Aa(t),[Oe(t,0),Oe(t,2),Oe(t,4),t.length===8?Oe(t,6)/255:e]),Ut=[0,0,0,0],we=t=>Math.floor(t).toString(16).padStart(2,"0"),Oe=(t,e)=>parseInt(t.slice(e,e+2),16),Aa=t=>t.startsWith("#")?t.slice(1):t,Ba=t=>{t=Fr.parse(t);let[e,r,n]=t;const s=t[3];e/=360,r/=100,n/=100;let i,o,h;if(r===0)i=o=h=n;else{const l=n<.5?n*(1+r):n+r-n*r,f=2*n-l;i=He(f,l,e+1/3),o=He(f,l,e),h=He(f,l,e-1/3)}return[Math.round(i*255),Math.round(o*255),Math.round(h*255),s]},He=(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t),Ua=t=>{t=ke.parse(t);let[e,r,n]=t;const s=t[3];e/=255,r/=255,n/=255;const i=Math.max(e,r,n),o=Math.min(e,r,n);let h,l,f=(i+o)/2;if(i===o)h=l=0;else{const p=i-o;l=f>.5?p/(2-i-o):p/(i+o),i===e?h=(r-n)/p+(r<n?6:0):i===r?h=(n-e)/p+2:h=(e-r)/p+4,h/=6}return h*=360,l*=100,f*=100,[Math.round(h),Math.round(l),Math.round(f),s]},Ca=w("#000000"),ja=w("#ffffff"),Wr=a.z.object({key:a.z.string(),color:Fe,position:a.z.number(),switched:a.z.boolean().optional()}),Ra=a.z.array(Wr),La=(t,e)=>{if(t.length===0)return Ut;if(t=t.slice().sort((r,n)=>r.position-n.position),e<=t[0].position)return w(t[0].color);if(e>=t[t.length-1].position)return w(t[t.length-1].color);for(let r=0;r<t.length-1;r++){const n=t[r],s=t[r+1];if(e<n.position||e>s.position)continue;if(e===n.position)return w(n.color);if(e===s.position)return w(s.color);const i=(e-n.position)/(s.position-n.position),o=w(n.color),h=w(s.color),l=Math.round(oe(o)+i*(oe(h)-oe(o))),f=Math.round(ue(o)+i*(ue(h)-ue(o))),p=Math.round(le(o)+i*(le(h)-le(o))),g=ce(o)+i*(ce(h)-ce(o));return w([l,f,p,g])}return w(t[t.length-1].color)},Da=a.z.object({key:a.z.string(),name:a.z.string(),color:Ye}),Pa=a.z.object({key:a.z.string(),name:a.z.string(),swatches:a.z.array(Da)}),Gr=Object.freeze(Object.defineProperty({__proto__:null,BLACK:Ca,WHITE:ja,ZERO:Ut,aValue:ce,bValue:le,colorZ:Ye,construct:w,contrast:lt,crudeZ:Fe,cssString:wa,equals:Yr,fromGradient:La,fromHSLA:Ba,gValue:ue,gradientZ:Ra,grayness:Na,hex:Oa,hsla:xa,isColor:ba,isCrude:ma,isDark:za,isLight:Ma,isZero:va,luminance:ge,paletteZ:Pa,pickByContrast:Ia,rValue:oe,rgbCSS:$a,rgbString:Vr,rgba1:Ta,rgbaCSS:Zr,setAlpha:Sa,stopZ:Wr},Symbol.toStringTag,{value:"Module"})),Hr=a.z.int().min(0).max(255),Jr=255,Xr=0,qa={lower:Xr,upper:Jr+1},Kr=a.z.object({name:a.z.string(),key:a.z.string()}),pe=t=>a.z.object({subject:Kr,resource:t,authority:Hr}),ka=(...t)=>e=>e.filter(r=>{let n=!1;return r.to!=null&&(n=t.includes(r.to.resource)),r.from!=null&&!n&&(n=t.includes(r.from.resource)),n}),Qr=t=>a.z.object({from:pe(t),to:a.z.null()}),_r=t=>a.z.object({from:a.z.null(),to:pe(t)}),Fa=t=>a.z.union([Qr(t),_r(t),a.z.object({from:pe(t),to:pe(t)})]),Ya=Object.freeze(Object.defineProperty({__proto__:null,ABSOLUTE_AUTHORITY:Jr,AUTHORITY_BOUNDS:qa,ZERO_AUTHORITY:Xr,acquireZ:_r,authorityZ:Hr,filterTransfersByChannelKey:ka,releaseZ:Qr,stateZ:pe,subjectZ:Kr,transferZ:Fa},Symbol.toStringTag,{value:"Module"})),Za=t=>Object.getOwnPropertySymbols(globalThis).includes(t),Va=(t,e)=>{const r=Symbol.for(t);if(!Za(r)){const n=e();Object.defineProperty(globalThis,r,{value:n})}return()=>globalThis[r]},en="sy_x_error",Wa=t=>e=>e!=null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"?e.type.startsWith(t):e instanceof Error?e.message.startsWith(t):typeof e!="string"?!1:e.startsWith(t),tn=t=>class ie extends Error{static discriminator=en;discriminator=ie.discriminator;static TYPE=t;type=ie.TYPE;static matches=Wa(t);matches=ie.matches;constructor(r,n){super(r,n),this.name=ie.TYPE}static sub(r){return tn(`${t}.${r}`)}},Ga=t=>{if(t==null||typeof t!="object")return!1;const e=t;if(e.discriminator!==en)return!1;if(!("type"in e))throw new Error(`X Error is missing its type property: ${JSON.stringify(e)}`);return!0},re="unknown",Pt="nil";class Ha{providers=[];register(e){this.providers.push(e)}encode(e){if(e==null)return{type:Pt,data:""};if(Ga(e))for(const r of this.providers){const n=r.encode(e);if(n!=null)return n}if(e instanceof Error)return{type:re,data:e.message};if(typeof e=="string")return{type:re,data:e};try{return{type:re,data:JSON.stringify(e)}}catch{return{type:re,data:"unable to encode error information"}}}decode(e){if(e==null||e.type===Pt)return null;if(e.type===re)return new qt(e.data);for(const r of this.providers){const n=r.decode(e);if(n!=null)return n}return new qt(e.data)}}Va("synnax-error-registry",()=>new Ha);class qt extends tn("unknown"){}a.z.object({type:a.z.string(),data:a.z.string()});const Ja=()=>new Promise(t=>setTimeout(t,0)),Xa=t=>t?-1:1,Ka=a.object({jsonrpc:a.literal("2.0"),method:a.string(),params:a.any().optional(),id:a.union([a.string(),a.number(),a.null()]).optional()}),rn=a.object({jsonrpc:a.literal("2.0"),id:a.union([a.string(),a.number(),a.null()])}),Qa=rn.extend({result:a.json()}),_a=rn.extend({error:a.object({code:a.number().int(),message:a.string().optional(),data:a.json().optional()})}),eo=a.union([Qa,_a]);a.union([Ka,eo]);const to=(t,e,r)=>{const n=t.get(e);return n===void 0?(t.set(e,r),r):n},ro=Object.freeze(Object.defineProperty({__proto__:null,getOrSetDefault:to},Symbol.toStringTag,{value:"Module"})),ct=a.z.string().regex(/^\d+\.\d+\.\d+$/),me=(t,e,r={})=>{r.checkMajor??=!0,r.checkMinor??=!0,r.checkPatch??=!0;const n=ct.parse(t),s=ct.parse(e),[i,o,h]=n.split(".").map(Number),[l,f,p]=s.split(".").map(Number);if(r.checkMajor){if(i<l)return Te;if(i>l)return ve}if(r.checkMinor){if(o<f)return Te;if(o>f)return ve}if(r.checkPatch){if(h<p)return Te;if(h>p)return ve}return _},no=(t,e,r={})=>Ht(me(t,e,r)),nn=(t,e,r={})=>Gt(me(t,e,r)),so=(t,e,r={})=>Wt(me(t,e,r)),io=({name:t,migrate:e})=>r=>{try{const n=e(r);return console.log(`${t} migrated: ${r.version} -> ${n.version}`),n}catch(n){throw console.log(`${t} failed to migrate from ${r.version}`),console.error(n),n}},ao=({name:t,migrations:e,targetSchema:r,defaultVersion:n,def:s})=>{const i=Object.keys(e).sort(me).pop();if(i==null)return f=>{if(f.version??=n,f.version!==s.version)return console.log(`${t} version ${f.version} is newer than latest version of ${s.version}.
|
|
7
|
-
Returning default instead.
|
|
8
|
-
`),s;try{return r!=null?r.parse(f):f}catch(p){return console.log(`${t} failed to parse default. Exiting with default`),console.error(p),s}};const o=Object.keys(e).length;let h=!1;const l=f=>{try{if(o===0||nn(f.version,i))return console.log(h?`${t} ${f.version} now up to date`:`${t} version ${f.version} is up to date with target version ${s.version}`),f;const p=f.version,g=e[p],x=g(f);return h=!0,l(x)}catch(p){return console.log(`${t} failed to migrate from ${f.version} to ${i}`),console.error(p),s}};return f=>{try{if(f.version==null)if(n!=null)console.log(`${t} version is null. Setting version to default of ${n}`),f.version=n;else return console.log(`${t} version is null and no default version set. Exiting with default`),s;return l(f)}catch(p){return console.log(`${t} failed to parse final result. Exiting with default`),console.error(p),s}}},oo=Object.freeze(Object.defineProperty({__proto__:null,compareSemVer:me,createMigration:io,migrator:ao,semVerNewer:nn,semVerOlder:so,semVerZ:ct,versionsEqual:no},Symbol.toStringTag,{value:"Module"})),sn=["standard","scientific","engineering"],uo=a.z.enum(sn),lo=(t,e,r)=>{if(Number.isNaN(t))return"NaN";if(t===1/0)return"∞";if(t===-1/0)return"-∞";if(r==="standard")return t.toFixed(e);if(t===0)return e===0?"0ᴇ0":`0.${"0".repeat(e)}ᴇ0`;let n;return r==="scientific"?n=Math.floor(Math.log10(Math.abs(t))):n=Math.floor(Math.log10(Math.abs(t))/3)*3,`${(t/10**n).toFixed(e)}ᴇ${n}`},co=Object.freeze(Object.defineProperty({__proto__:null,NOTATIONS:sn,notationZ:uo,stringifyNumber:lo},Symbol.toStringTag,{value:"Module"})),ho=t=>Array.isArray(t)?[...t]:typeof t=="object"&&t!==null?{...t}:t,an=a.z.enum(["success","info","warning","error","loading","disabled"]),fo=t=>a.z.object({key:a.z.string(),variant:an,message:a.z.string(),description:a.z.string().optional(),time:b.z,details:t??a.z.unknown().optional()}),go=(t,e)=>{if(!(t instanceof Error))throw t;return on({variant:"error",message:e??t.message,description:e!=null?t.message:void 0,details:{stack:t.stack??""}})},on=t=>({key:Mt(),time:b.now(),...t}),po=Object.freeze(Object.defineProperty({__proto__:null,create:on,fromException:go,statusZ:fo,variantZ:an},Symbol.toStringTag,{value:"Module"})),yo=new Error("request for lock canceled");var mo=function(t,e,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function h(p){try{f(n.next(p))}catch(g){o(g)}}function l(p){try{f(n.throw(p))}catch(g){o(g)}}function f(p){p.done?i(p.value):s(p.value).then(h,l)}f((n=n.apply(t,e||[])).next())})};class bo{constructor(e,r=yo){this._value=e,this._cancelError=r,this._queue=[],this._weightedWaiters=[]}acquire(e=1,r=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((n,s)=>{const i={resolve:n,reject:s,weight:e,priority:r},o=un(this._queue,h=>r<=h.priority);o===-1&&e<=this._value?this._dispatchItem(i):this._queue.splice(o+1,0,i)})}runExclusive(e){return mo(this,arguments,void 0,function*(r,n=1,s=0){const[i,o]=yield this.acquire(n,s);try{return yield r(i)}finally{o()}})}waitForUnlock(e=1,r=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return this._couldLockImmediately(e,r)?Promise.resolve():new Promise(n=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),wo(this._weightedWaiters[e-1],{resolve:n,priority:r})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatchQueue()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatchQueue()}cancel(){this._queue.forEach(e=>e.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(e){const r=this._value;this._value-=e.weight,e.resolve([r,this._newReleaser(e.weight)])}_newReleaser(e){let r=!1;return()=>{r||(r=!0,this.release(e))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let e=this._value;e>0;e--){const r=this._weightedWaiters[e-1];r&&(r.forEach(n=>n.resolve()),this._weightedWaiters[e-1]=[])}else{const e=this._queue[0].priority;for(let r=this._value;r>0;r--){const n=this._weightedWaiters[r-1];if(!n)continue;const s=n.findIndex(i=>i.priority<=e);(s===-1?n:n.splice(0,s)).forEach(i=>i.resolve())}}}_couldLockImmediately(e,r){return(this._queue.length===0||this._queue[0].priority<r)&&e<=this._value}}function wo(t,e){const r=un(t,n=>e.priority<=n.priority);t.splice(r+1,0,e)}function un(t,e){for(let r=t.length-1;r>=0;r--)if(e(t[r]))return r;return-1}var Oo=function(t,e,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function h(p){try{f(n.next(p))}catch(g){o(g)}}function l(p){try{f(n.throw(p))}catch(g){o(g)}}function f(p){p.done?i(p.value):s(p.value).then(h,l)}f((n=n.apply(t,e||[])).next())})};class $o{constructor(e){this._semaphore=new bo(1,e)}acquire(){return Oo(this,arguments,void 0,function*(e=0){const[,r]=yield this._semaphore.acquire(1,e);return r})}runExclusive(e,r=0){return this._semaphore.runExclusive(()=>e(),1,r)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(e=0){return this._semaphore.waitForUnlock(1,e)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}class ln extends $o{constructor(e){super(),Object.assign(this,e)}}const To=t=>new ln(t),vo=Object.freeze(Object.defineProperty({__proto__:null,mutex:ln,newMutex:To},Symbol.toStringTag,{value:"Module"}));function cn(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(r=cn(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function hn(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=cn(t))&&(n&&(n+=" "),n+=e);return n}const xo=hn,J="-",kt="__",$e="--",Ct=t=>{const e=(...r)=>xo(...r);return e.B=(...r)=>t+J+r.join(J),e.E=r=>t+kt+r,e.M=(...r)=>t+$e+r.join("-"),e.BM=(r,...n)=>e.B(r)+$e+n.join("-"),e.BE=(r,...n)=>e.B(r)+kt+n.join(J),e.BEM=(r,n,...s)=>e.BE(r,n)+$e+s.join(J),e.extend=r=>Ct(e.B(r)),e.var=(...r)=>$e+t+J+r.join(J),e};class So{rows=[];columns=[];prefix;constructor(e=""){this.prefix=e}row(e,r,n){const{prefix:s}=this;return this.rows.push({startLabel:s+e,endLabel:s+r,size:n}),this}col(e,r,n){const{prefix:s}=this;return this.columns.push({startLabel:s+e,endLabel:s+r,size:n}),this}build(){return{display:"grid",gridTemplateRows:this.rows.map((e,r)=>{let n=r===0?"[":"";return n+=`${e.startLabel}] ${e.size}${typeof e.size=="number"?"px":""} [${e.endLabel}`,n+=r===this.rows.length-1?"]":"",n}).join(" "),gridTemplateColumns:this.columns.map((e,r)=>{let n=r===0?"[":"";return n+=`${e.startLabel}] ${e.size}${typeof e.size=="number"?"px":""} [${e.endLabel}`,n+=r===this.columns.length-1?"]":"",n}).join(" ")}}}const No=(t,e)=>Object.entries(e).forEach(([r,n])=>n!=null&&t.style.setProperty(r,`${n}`)),Io=(t,e)=>Array.from(t.style).forEach(r=>{r.startsWith(e)&&t.style.removeProperty(r)}),zo=t=>{const e=Ct(t);return e.visible=r=>e.M(r?"visible":"hidden"),e.expanded=r=>e.M(r?"expanded":"collapsed"),e.loc=r=>e.M("location",dr.construct(r)),e.disabled=r=>r===!0&&e.M("disabled"),e.align=r=>e.M(r),e.dir=r=>r!=null&&e.M("direction",ar.construct(r)),e.sharp=r=>r!==!1&&e.M("sharp"),e.rounded=r=>r!==!1&&e.M("rounded"),e.bordered=r=>typeof r=="boolean"?r&&e.M("bordered"):r!=null?e.M(`bordered-${r.toString()}`):e.M("bordered"),e.selected=r=>r&&e.M("selected"),e.altColor=r=>r&&e.M("alt-color"),e.editable=r=>r&&e.M("editable"),e.noSelect=e.M("no-select"),e.applyVars=No,e.removeVars=Io,e.newGridBuilder=r=>new So(r),e.dropRegion=r=>r&&e.B("haul-drop-region"),e.px=r=>`${r}px`,e.inheritDims=(r=!0)=>r&&e.M("inherit-dims"),e.shade=r=>r!=null&&e.M(`shade-${r}`),e.colorVar=r=>{if(!(r==null||r===!1))return typeof r=="number"?`var(--${t}-gray-l${r})`:Gr.cssString(r)},e.levelSizeVar=r=>`var(--${t}-${r}-size)`,e.level=r=>e.M(`level-${r}`),e},Mo=zo("pluto");exports.$=cr;exports.$t=ni;exports.$t$1=zi;exports.B=De;exports.C=xi;exports.CSS=Mo;exports.D=hr;exports.E=at;exports.Et=Sr;exports.F=vn;exports.I=Et;exports.J=Bs;exports.K=dr;exports.Mt=Nr;exports.O=En;exports.P=or;exports.R=zr;exports.S=na;exports.T=ee;exports.Vt=Vi;exports.W=ss;exports.Yt=Bi;exports._=gi;exports._r=po;exports.a=c;exports.ar=Ya;exports.br=ho;exports.bt=xr;exports.c=$n;exports.c$1=$;exports.clsx=hn;exports.d=S;exports.f=C;exports.fr=Xa;exports.g=ar;exports.h=y;exports.hr=ro;exports.i=je;exports.ir=Gr;exports.mr=co;exports.n=b;exports.newBEM=Ct;exports.nr=ca;exports.pr=oo;exports.r=O;exports.t=R;exports.u=Xi;exports.ur=Ja;exports.w=q;exports.w$1=ur;exports.w$2=j;exports.wr=vo;exports.x=Le;exports.y=B;exports.z=bn;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./symbols-BtW1eE35.cjs"),t=require("./Toggle-BWcSF1BX.cjs"),o=Object.freeze(Object.defineProperty({__proto__:null,Button:e.Button,Toggle:t.Toggle},Symbol.toStringTag,{value:"Module"}));exports.external=o;
|