@synnaxlabs/x 0.44.3 → 0.44.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +31 -35
- package/dist/base-BLNViP3D.cjs +1 -0
- package/dist/{base-DFq0vvGn.js → base-BORMP3mH.js} +14 -11
- package/dist/{bounds-8OC_obRs.js → bounds-BQqppNFf.js} +1 -1
- package/dist/{bounds-CRK04jp7.cjs → bounds-BXbqBINt.cjs} +1 -1
- package/dist/bounds.cjs +1 -1
- package/dist/bounds.js +1 -1
- package/dist/{box-CO_2_DGG.js → box-DRH5SOaY.js} +67 -73
- package/dist/box-qgxWXNhm.cjs +1 -0
- package/dist/box.cjs +1 -1
- package/dist/box.js +1 -1
- package/dist/{dimensions-CRgergMS.js → dimensions-RaRkesPq.js} +1 -1
- package/dist/{dimensions-D2QGoNXO.cjs → dimensions-qY12pyfC.cjs} +1 -1
- package/dist/dimensions.cjs +1 -1
- package/dist/dimensions.js +1 -1
- package/dist/direction-DKdfJwj7.js +19 -0
- package/dist/direction-XCdrc4is.cjs +1 -0
- package/dist/direction.cjs +1 -1
- package/dist/direction.js +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +59 -61
- package/dist/{location-Ar5y2DX2.js → location-CGLioInQ.js} +16 -21
- package/dist/location-DJ_K4SlP.cjs +1 -0
- package/dist/location.cjs +1 -1
- package/dist/location.js +1 -1
- package/dist/record-BwjIgrpU.cjs +1 -0
- package/dist/record-tSFQKmdG.js +19 -0
- package/dist/record.cjs +1 -1
- package/dist/record.js +1 -1
- package/dist/{scale-C3fEtXxW.cjs → scale-76Azh2EE.cjs} +1 -1
- package/dist/{scale-Db1Gunj0.js → scale-BhIvACdB.js} +4 -4
- package/dist/scale.cjs +1 -1
- package/dist/scale.js +1 -1
- package/dist/{series-Cl3Vh_u-.js → series-kgnLXSDr.js} +55 -39
- package/dist/{series-BcF7A8Je.cjs → series-tAhThbnz.cjs} +3 -3
- package/dist/{spatial-DGpZ2sO3.cjs → spatial-BsGadoUr.cjs} +1 -1
- package/dist/{spatial-BSWPzMkK.js → spatial-QY891r0E.js} +1 -1
- package/dist/spatial.cjs +1 -1
- package/dist/spatial.js +14 -16
- package/dist/src/record/record.d.ts +18 -0
- package/dist/src/record/record.d.ts.map +1 -1
- package/dist/src/spatial/base.d.ts +12 -0
- package/dist/src/spatial/base.d.ts.map +1 -1
- package/dist/src/spatial/direction/direction.d.ts +5 -1
- package/dist/src/spatial/direction/direction.d.ts.map +1 -1
- package/dist/src/spatial/external.d.ts +0 -1
- package/dist/src/spatial/external.d.ts.map +1 -1
- package/dist/src/spatial/xy/xy.d.ts +3 -0
- package/dist/src/spatial/xy/xy.d.ts.map +1 -1
- package/dist/src/telem/telem.d.ts +8 -0
- package/dist/src/telem/telem.d.ts.map +1 -1
- package/dist/telem.cjs +1 -1
- package/dist/telem.js +1 -1
- package/dist/xy-BKIJiLu_.cjs +1 -0
- package/dist/{xy-C_-hb3Q2.js → xy-CBuhMaIo.js} +41 -31
- package/dist/xy.cjs +1 -1
- package/dist/xy.js +1 -1
- package/package.json +3 -8
- package/src/record/record.spec.ts +31 -0
- package/src/record/record.ts +23 -0
- package/src/spatial/base.ts +4 -0
- package/src/spatial/direction/direction.spec.ts +35 -1
- package/src/spatial/direction/direction.ts +12 -0
- package/src/spatial/external.ts +0 -1
- package/src/spatial/xy/xy.spec.ts +124 -7
- package/src/spatial/xy/xy.ts +15 -2
- package/src/telem/telem.spec.ts +50 -0
- package/src/telem/telem.ts +25 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/vite.config.ts +0 -1
- package/dist/base-BAM2mqCy.cjs +0 -1
- package/dist/box-Cxki783Y.cjs +0 -1
- package/dist/direction-386XDm2w.cjs +0 -1
- package/dist/direction-8etxfKaR.js +0 -17
- package/dist/location-DZi8ftXp.cjs +0 -1
- package/dist/position-DSy2hONH.cjs +0 -1
- package/dist/position-PQ6op54I.js +0 -85
- package/dist/position.cjs +0 -1
- package/dist/position.js +0 -4
- package/dist/record-CAcQ5PNX.js +0 -14
- package/dist/record-YvCh7bzB.cjs +0 -1
- package/dist/src/spatial/position/index.d.ts +0 -2
- package/dist/src/spatial/position/index.d.ts.map +0 -1
- package/dist/src/spatial/position/position.d.ts +0 -20
- package/dist/src/spatial/position/position.d.ts.map +0 -1
- package/dist/src/spatial/position/position.spec.d.ts +0 -2
- package/dist/src/spatial/position/position.spec.d.ts.map +0 -1
- package/dist/xy-CUE3QDNn.cjs +0 -1
- package/src/spatial/position/index.ts +0 -10
- package/src/spatial/position/position.spec.ts +0 -211
- package/src/spatial/position/position.ts +0 -157
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _e=require("./array.cjs"),U=require("./index-BQe8OIgm.cjs"),s=require("zod"),h=require("./series-BcF7A8Je.cjs"),Se=require("./index-DdhM_E4k.cjs"),ve=require("./change-C-YELKx6.cjs"),H=require("./scale-C3fEtXxW.cjs"),m=require("./index-DOJlZHqJ.cjs"),B=require("./debounce.cjs"),we=require("./deep.cjs"),Te=require("./identity.cjs"),Me=require("./external-B9AAGv50.cjs"),je=require("./link.cjs"),g=require("./bounds-CRK04jp7.cjs"),ze=require("./observe.cjs"),$e=require("./record-YvCh7bzB.cjs"),Ee=require("./external-uXk0Avrg.cjs"),xe=require("./box-Cxki783Y.cjs"),ke=require("./dimensions-D2QGoNXO.cjs"),Oe=require("./direction-386XDm2w.cjs"),qe=require("./location-DZi8ftXp.cjs"),Ae=require("./position-DSy2hONH.cjs"),Re=require("./spatial-DGpZ2sO3.cjs"),Ne=require("./xy-CUE3QDNn.cjs"),Pe=require("./index-udOjA9d-.cjs"),V=require("./url.cjs"),C=require("./worker.cjs"),Ze=require("./external-E3ErJeeM.cjs"),Ie=2,Ce=3,Le=2,We=(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=Ie:r>=1?n=Ce:n=Math.ceil(-Math.log10(r))+Le;const o=10**n;return Math.round(e*o)/o},De=Object.freeze(Object.defineProperty({__proto__:null,abs:g.abs,add:g.add,closeTo:g.closeTo,div:g.div,equal:g.equal,isInteger:g.isInteger,max:g.max$1,min:g.min,mult:g.mult,roundBySpan:We,roundToNearestMagnitude:g.roundToNearestMagnitude,sub:g.sub},Symbol.toStringTag,{value:"Module"})),F=async e=>await new Promise(t=>setTimeout(t,h.TimeSpan.fromMilliseconds(e).milliseconds)),Ue=Object.freeze(Object.defineProperty({__proto__:null,sleep:F},Symbol.toStringTag,{value:"Module"}));class He{config;retries;interval;constructor(t){this.config={baseInterval:new h.TimeSpan(t?.baseInterval??h.TimeSpan.seconds(1)),maxRetries:t?.maxRetries??5,scale:t?.scale??1,sleepFn:t?.sleepFn??F},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)}get retryMessage(){return`breaker triggered ${this.retries+1}/${this.config.maxRetries} times, retrying in ${this.interval.toString()}`}reset(){this.retries=0,this.interval=this.config.baseInterval}}const Be=s.z.object({baseInterval:h.TimeSpan.z.optional(),maxRetries:s.z.number().optional(),scale:s.z.number().optional()}),Ve=Object.freeze(Object.defineProperty({__proto__:null,Breaker:He,breakerConfigZ:Be},Symbol.toStringTag,{value:"Module"})),Fe=/^#?([0-9a-f]{6}|[0-9a-f]{8})$/i,Q=s.z.string().regex(Fe),y=s.z.number().min(0).max(255),G=s.z.number().min(0).max(1),k=s.z.tuple([y,y,y,G]),Qe=s.z.tuple([y,y,y]),Ge=s.z.object({rgba255:k}),Je=s.z.number().min(0).max(360),Ye=s.z.number().min(0).max(100),Ke=s.z.number().min(0).max(100),J=s.z.tuple([Je,Ye,Ke,G]),O=s.z.union([Q,Qe,k,J,Ge]),q=O.transform(e=>f(e)),Xe=e=>q.safeParse(e).success,et=e=>k.safeParse(e).success,tt=e=>{if(e==null)return;const t=q.safeParse(e);if(t.success)return K(t.data);if(typeof e=="string")return e;throw t.error},f=(e,t=1)=>{if(e=O.parse(e),typeof e=="string")return ft(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}return e.rgba255},Y=(e,t)=>{if(e==null||t==null)return e==t;const r=f(e),n=f(t);return r.every((o,i)=>o===n[i])},rt=e=>{if(e==null)return;const[t,r,n,o]=f(e);return`#${E(t)}${E(r)}${E(n)}${o===1?"":E(o*255)}`},K=e=>{const[t,r,n,o]=f(e);return`rgba(${t}, ${r}, ${n}, ${o})`},nt=e=>`rgb(${X(e)})`,X=e=>{const[t,r,n]=f(e);return`${t}, ${r}, ${n}`},st=e=>[...L(e),T(e)],L=e=>[S(e)/255,v(e)/255,w(e)/255],S=e=>f(e)[0],v=e=>f(e)[1],w=e=>f(e)[2],T=e=>f(e)[3],ot=e=>Y(W,e),it=e=>gt(f(e)),ct=(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]},M=e=>{const[t,r,n]=L(e).map(o=>o<=.03928?o/12.92:((o+.055)/1.055)**2.4);return Number((.2126*t+.7152*r+.0722*n).toFixed(3))},at=e=>{const[t,r,n]=L(e);return 1-(Math.max(t,r,n)-Math.min(t,r,n))},N=(e,t)=>{const r=f(e),n=f(t),o=M(r),i=M(n);return(Math.max(o,i)+.5)/(Math.min(o,i)+.5)},lt=(e,...t)=>{if(t.length===0)throw new Error("[Color.pickByContrast] - must provide at least one color");const r=f(e),[n]=t.sort((o,i)=>N(r,i)-N(r,o));return f(n)},ut=e=>M(e)<.5,dt=e=>M(e)>.5,ft=(e,t=1)=>(e=Q.parse(e),e=ht(e),[x(e,0),x(e,2),x(e,4),e.length===8?x(e,6)/255:t]),W=[0,0,0,0],E=e=>Math.floor(e).toString(16).padStart(2,"0"),x=(e,t)=>parseInt(e.slice(t,t+2),16),ht=e=>e.startsWith("#")?e.slice(1):e,pt=e=>{e=J.parse(e);let[t,r,n]=e;const o=e[3];t/=360,r/=100,n/=100;let i,c,d;if(r===0)i=c=d=n;else{const l=n<.5?n*(1+r):n+r-n*r,a=2*n-l;i=R(a,l,t+1/3),c=R(a,l,t),d=R(a,l,t-1/3)}return[Math.round(i*255),Math.round(c*255),Math.round(d*255),o]},R=(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),gt=e=>{e=k.parse(e);let[t,r,n]=e;const o=e[3];t/=255,r/=255,n/=255;const i=Math.max(t,r,n),c=Math.min(t,r,n);let d,l,a=(i+c)/2;if(i===c)d=l=0;else{const u=i-c;l=a>.5?u/(2-i-c):u/(i+c),i===t?d=(r-n)/u+(r<n?6:0):i===r?d=(n-t)/u+2:d=(t-r)/u+4,d/=6}return d*=360,l*=100,a*=100,[Math.round(d),Math.round(l),Math.round(a),o]},mt=f("#000000"),bt=f("#ffffff"),ee=s.z.object({key:s.z.string(),color:O,position:s.z.number(),switched:s.z.boolean().optional()}),yt=s.z.array(ee),_t=(e,t)=>{if(e.length===0)return W;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)continue;if(t===n.position)return f(n.color);if(t===o.position)return f(o.color);const i=(t-n.position)/(o.position-n.position),c=f(n.color),d=f(o.color),l=Math.round(S(c)+i*(S(d)-S(c))),a=Math.round(v(c)+i*(v(d)-v(c))),u=Math.round(w(c)+i*(w(d)-w(c))),p=T(c)+i*(T(d)-T(c));return f([l,a,u,p])}return f(e[e.length-1].color)},St=s.z.object({key:s.z.string(),name:s.z.string(),color:q}),vt=s.z.object({key:s.z.string(),name:s.z.string(),swatches:s.z.array(St)}),wt=Object.freeze(Object.defineProperty({__proto__:null,BLACK:mt,WHITE:bt,ZERO:W,aValue:T,bValue:w,colorZ:q,construct:f,contrast:N,crudeZ:O,cssString:tt,equals:Y,fromGradient:_t,fromHSLA:pt,gValue:v,gradientZ:yt,grayness:at,hex:rt,hsla:it,isColor:et,isCrude:Xe,isDark:ut,isLight:dt,isZero:ot,luminance:M,paletteZ:vt,pickByContrast:lt,rValue:S,rgbCSS:nt,rgbString:X,rgba1:st,rgbaCSS:K,setAlpha:ct,stopZ:ee},Symbol.toStringTag,{value:"Module"})),te=s.z.int().min(0).max(255),re=255,ne=0,Tt={lower:ne,upper:re+1},se=s.z.object({name:s.z.string(),key:s.z.string()}),j=e=>s.z.object({subject:se,resource:e,authority:te}),Mt=(...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}),oe=e=>s.z.object({from:j(e),to:s.z.null()}),ie=e=>s.z.object({from:s.z.null(),to:j(e)}),jt=e=>s.z.union([oe(e),ie(e),s.z.object({from:j(e),to:j(e)})]),zt=Object.freeze(Object.defineProperty({__proto__:null,ABSOLUTE_AUTHORITY:re,AUTHORITY_BOUNDS:Tt,ZERO_AUTHORITY:ne,acquireZ:ie,authorityZ:te,filterTransfersByChannelKey:Mt,releaseZ:oe,stateZ:j,subjectZ:se,transferZ:jt},Symbol.toStringTag,{value:"Module"})),$t=e=>Object.getOwnPropertySymbols(globalThis).includes(e),Et=(e,t)=>{const r=Symbol.for(e);if(!$t(r)){const n=t();Object.defineProperty(globalThis,r,{value:n})}return()=>globalThis[r]},ce="sy_x_error",xt=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),z=e=>class _ extends Error{static discriminator=ce;discriminator=_.discriminator;static TYPE=e;type=_.TYPE;static matches=xt(e);matches=_.matches;constructor(r,n){super(r,n),this.name=_.TYPE}static sub(r){return z(`${e}.${r}`)}},ae=e=>{if(e==null||typeof e!="object")return!1;const t=e;if(t.discriminator!==ce)return!1;if(!("type"in t))throw new Error(`X Error is missing its type property: ${JSON.stringify(t)}`);return!0},b="unknown",P="nil";class kt{providers=[];register(t){this.providers.push(t)}encode(t){if(t==null)return{type:P,data:""};if(ae(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===P)return null;if(t.type===b)return new Z(t.data);for(const r of this.providers){const n=r.decode(t);if(n!=null)return n}return new Z(t.data)}}const D=Et("synnax-error-registry",()=>new kt),Ot=({encode:e,decode:t})=>D().register({encode:e,decode:t}),qt=e=>D().encode(e),At=e=>e==null?null:D().decode(e);class Z extends z("unknown"){}const Rt=s.z.object({type:s.z.string(),data:s.z.string()});class Nt extends z("canceled"){}class Pt extends z("not_implemented"){}const Zt=Object.freeze(Object.defineProperty({__proto__:null,Canceled:Nt,NONE:P,NotImplemented:Pt,UNKNOWN:b,Unknown:Z,createTyped:z,decode:At,encode:qt,isTyped:ae,payloadZ:Rt,register:Ot},Symbol.toStringTag,{value:"Module"})),It=()=>Promise.resolve(),Ct=()=>new Promise(e=>setTimeout(e,0)),Lt=e=>e?-1:1,le=s.object({jsonrpc:s.literal("2.0"),method:s.string(),params:s.any().optional(),id:s.union([s.string(),s.number(),s.null()]).optional()}),ue=s.object({jsonrpc:s.literal("2.0"),id:s.union([s.string(),s.number(),s.null()])}),Wt=ue.extend({result:s.json()}),Dt=ue.extend({error:s.object({code:s.number().int(),message:s.string().optional(),data:s.json().optional()})}),de=s.union([Wt,Dt]),fe=s.union([le,de]),Ut=e=>{const t=new TextDecoder;let r=new Uint8Array(0),n=null;return o=>{let i;typeof o=="string"?i=new TextEncoder().encode(o):o instanceof ArrayBuffer?i=new Uint8Array(o):i=o;const c=new Uint8Array(r.length+i.length);for(c.set(r),c.set(i,r.length),r=c;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 a=new TextEncoder().encode(l[0]).length;r=r.slice(a)}if(n!==null&&r.length>=n){const d=r.slice(0,n);r=r.slice(n),n=null;const l=t.decode(d),a=U.JSON_CODEC.decodeString(l,fe);e(a)}else break}}},Ht=e=>{const t=JSON.stringify(e);return`Content-Length: ${new TextEncoder().encode(t).length}\r
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _e=require("./array.cjs"),U=require("./index-BQe8OIgm.cjs"),s=require("zod"),h=require("./series-tAhThbnz.cjs"),Se=require("./index-DdhM_E4k.cjs"),ve=require("./change-C-YELKx6.cjs"),H=require("./scale-76Azh2EE.cjs"),m=require("./index-DOJlZHqJ.cjs"),B=require("./debounce.cjs"),we=require("./deep.cjs"),Te=require("./identity.cjs"),Me=require("./external-B9AAGv50.cjs"),je=require("./link.cjs"),g=require("./bounds-BXbqBINt.cjs"),ze=require("./observe.cjs"),$e=require("./record-BwjIgrpU.cjs"),Ee=require("./external-uXk0Avrg.cjs"),xe=require("./box-qgxWXNhm.cjs"),ke=require("./dimensions-qY12pyfC.cjs"),Oe=require("./direction-XCdrc4is.cjs"),qe=require("./location-DJ_K4SlP.cjs"),Ae=require("./spatial-BsGadoUr.cjs"),Re=require("./xy-BKIJiLu_.cjs"),Ne=require("./index-udOjA9d-.cjs"),V=require("./url.cjs"),C=require("./worker.cjs"),Pe=require("./external-E3ErJeeM.cjs"),Ze=2,Ie=3,Ce=2,Le=(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=Ze:r>=1?n=Ie:n=Math.ceil(-Math.log10(r))+Ce;const o=10**n;return Math.round(e*o)/o},We=Object.freeze(Object.defineProperty({__proto__:null,abs:g.abs,add:g.add,closeTo:g.closeTo,div:g.div,equal:g.equal,isInteger:g.isInteger,max:g.max$1,min:g.min,mult:g.mult,roundBySpan:Le,roundToNearestMagnitude:g.roundToNearestMagnitude,sub:g.sub},Symbol.toStringTag,{value:"Module"})),F=async e=>await new Promise(t=>setTimeout(t,h.TimeSpan.fromMilliseconds(e).milliseconds)),De=Object.freeze(Object.defineProperty({__proto__:null,sleep:F},Symbol.toStringTag,{value:"Module"}));class Ue{config;retries;interval;constructor(t){this.config={baseInterval:new h.TimeSpan(t?.baseInterval??h.TimeSpan.seconds(1)),maxRetries:t?.maxRetries??5,scale:t?.scale??1,sleepFn:t?.sleepFn??F},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)}get retryMessage(){return`breaker triggered ${this.retries+1}/${this.config.maxRetries} times, retrying in ${this.interval.toString()}`}reset(){this.retries=0,this.interval=this.config.baseInterval}}const He=s.z.object({baseInterval:h.TimeSpan.z.optional(),maxRetries:s.z.number().optional(),scale:s.z.number().optional()}),Be=Object.freeze(Object.defineProperty({__proto__:null,Breaker:Ue,breakerConfigZ:He},Symbol.toStringTag,{value:"Module"})),Ve=/^#?([0-9a-f]{6}|[0-9a-f]{8})$/i,Q=s.z.string().regex(Ve),y=s.z.number().min(0).max(255),G=s.z.number().min(0).max(1),k=s.z.tuple([y,y,y,G]),Fe=s.z.tuple([y,y,y]),Qe=s.z.object({rgba255:k}),Ge=s.z.number().min(0).max(360),Je=s.z.number().min(0).max(100),Ye=s.z.number().min(0).max(100),J=s.z.tuple([Ge,Je,Ye,G]),O=s.z.union([Q,Fe,k,J,Qe]),q=O.transform(e=>f(e)),Ke=e=>q.safeParse(e).success,Xe=e=>k.safeParse(e).success,et=e=>{if(e==null)return;const t=q.safeParse(e);if(t.success)return K(t.data);if(typeof e=="string")return e;throw t.error},f=(e,t=1)=>{if(e=O.parse(e),typeof e=="string")return dt(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}return e.rgba255},Y=(e,t)=>{if(e==null||t==null)return e==t;const r=f(e),n=f(t);return r.every((o,i)=>o===n[i])},tt=e=>{if(e==null)return;const[t,r,n,o]=f(e);return`#${E(t)}${E(r)}${E(n)}${o===1?"":E(o*255)}`},K=e=>{const[t,r,n,o]=f(e);return`rgba(${t}, ${r}, ${n}, ${o})`},rt=e=>`rgb(${X(e)})`,X=e=>{const[t,r,n]=f(e);return`${t}, ${r}, ${n}`},nt=e=>[...L(e),T(e)],L=e=>[S(e)/255,v(e)/255,w(e)/255],S=e=>f(e)[0],v=e=>f(e)[1],w=e=>f(e)[2],T=e=>f(e)[3],st=e=>Y(W,e),ot=e=>pt(f(e)),it=(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]},M=e=>{const[t,r,n]=L(e).map(o=>o<=.03928?o/12.92:((o+.055)/1.055)**2.4);return Number((.2126*t+.7152*r+.0722*n).toFixed(3))},ct=e=>{const[t,r,n]=L(e);return 1-(Math.max(t,r,n)-Math.min(t,r,n))},N=(e,t)=>{const r=f(e),n=f(t),o=M(r),i=M(n);return(Math.max(o,i)+.5)/(Math.min(o,i)+.5)},at=(e,...t)=>{if(t.length===0)throw new Error("[Color.pickByContrast] - must provide at least one color");const r=f(e),[n]=t.sort((o,i)=>N(r,i)-N(r,o));return f(n)},lt=e=>M(e)<.5,ut=e=>M(e)>.5,dt=(e,t=1)=>(e=Q.parse(e),e=ft(e),[x(e,0),x(e,2),x(e,4),e.length===8?x(e,6)/255:t]),W=[0,0,0,0],E=e=>Math.floor(e).toString(16).padStart(2,"0"),x=(e,t)=>parseInt(e.slice(t,t+2),16),ft=e=>e.startsWith("#")?e.slice(1):e,ht=e=>{e=J.parse(e);let[t,r,n]=e;const o=e[3];t/=360,r/=100,n/=100;let i,c,d;if(r===0)i=c=d=n;else{const l=n<.5?n*(1+r):n+r-n*r,a=2*n-l;i=R(a,l,t+1/3),c=R(a,l,t),d=R(a,l,t-1/3)}return[Math.round(i*255),Math.round(c*255),Math.round(d*255),o]},R=(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),pt=e=>{e=k.parse(e);let[t,r,n]=e;const o=e[3];t/=255,r/=255,n/=255;const i=Math.max(t,r,n),c=Math.min(t,r,n);let d,l,a=(i+c)/2;if(i===c)d=l=0;else{const u=i-c;l=a>.5?u/(2-i-c):u/(i+c),i===t?d=(r-n)/u+(r<n?6:0):i===r?d=(n-t)/u+2:d=(t-r)/u+4,d/=6}return d*=360,l*=100,a*=100,[Math.round(d),Math.round(l),Math.round(a),o]},gt=f("#000000"),mt=f("#ffffff"),ee=s.z.object({key:s.z.string(),color:O,position:s.z.number(),switched:s.z.boolean().optional()}),bt=s.z.array(ee),yt=(e,t)=>{if(e.length===0)return W;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)continue;if(t===n.position)return f(n.color);if(t===o.position)return f(o.color);const i=(t-n.position)/(o.position-n.position),c=f(n.color),d=f(o.color),l=Math.round(S(c)+i*(S(d)-S(c))),a=Math.round(v(c)+i*(v(d)-v(c))),u=Math.round(w(c)+i*(w(d)-w(c))),p=T(c)+i*(T(d)-T(c));return f([l,a,u,p])}return f(e[e.length-1].color)},_t=s.z.object({key:s.z.string(),name:s.z.string(),color:q}),St=s.z.object({key:s.z.string(),name:s.z.string(),swatches:s.z.array(_t)}),vt=Object.freeze(Object.defineProperty({__proto__:null,BLACK:gt,WHITE:mt,ZERO:W,aValue:T,bValue:w,colorZ:q,construct:f,contrast:N,crudeZ:O,cssString:et,equals:Y,fromGradient:yt,fromHSLA:ht,gValue:v,gradientZ:bt,grayness:ct,hex:tt,hsla:ot,isColor:Xe,isCrude:Ke,isDark:lt,isLight:ut,isZero:st,luminance:M,paletteZ:St,pickByContrast:at,rValue:S,rgbCSS:rt,rgbString:X,rgba1:nt,rgbaCSS:K,setAlpha:it,stopZ:ee},Symbol.toStringTag,{value:"Module"})),te=s.z.int().min(0).max(255),re=255,ne=0,wt={lower:ne,upper:re+1},se=s.z.object({name:s.z.string(),key:s.z.string()}),j=e=>s.z.object({subject:se,resource:e,authority:te}),Tt=(...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}),oe=e=>s.z.object({from:j(e),to:s.z.null()}),ie=e=>s.z.object({from:s.z.null(),to:j(e)}),Mt=e=>s.z.union([oe(e),ie(e),s.z.object({from:j(e),to:j(e)})]),jt=Object.freeze(Object.defineProperty({__proto__:null,ABSOLUTE_AUTHORITY:re,AUTHORITY_BOUNDS:wt,ZERO_AUTHORITY:ne,acquireZ:ie,authorityZ:te,filterTransfersByChannelKey:Tt,releaseZ:oe,stateZ:j,subjectZ:se,transferZ:Mt},Symbol.toStringTag,{value:"Module"})),zt=e=>Object.getOwnPropertySymbols(globalThis).includes(e),$t=(e,t)=>{const r=Symbol.for(e);if(!zt(r)){const n=t();Object.defineProperty(globalThis,r,{value:n})}return()=>globalThis[r]},ce="sy_x_error",Et=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),z=e=>class _ extends Error{static discriminator=ce;discriminator=_.discriminator;static TYPE=e;type=_.TYPE;static matches=Et(e);matches=_.matches;constructor(r,n){super(r,n),this.name=_.TYPE}static sub(r){return z(`${e}.${r}`)}},ae=e=>{if(e==null||typeof e!="object")return!1;const t=e;if(t.discriminator!==ce)return!1;if(!("type"in t))throw new Error(`X Error is missing its type property: ${JSON.stringify(t)}`);return!0},b="unknown",P="nil";class xt{providers=[];register(t){this.providers.push(t)}encode(t){if(t==null)return{type:P,data:""};if(ae(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===P)return null;if(t.type===b)return new Z(t.data);for(const r of this.providers){const n=r.decode(t);if(n!=null)return n}return new Z(t.data)}}const D=$t("synnax-error-registry",()=>new xt),kt=({encode:e,decode:t})=>D().register({encode:e,decode:t}),Ot=e=>D().encode(e),qt=e=>e==null?null:D().decode(e);class Z extends z("unknown"){}const At=s.z.object({type:s.z.string(),data:s.z.string()});class Rt extends z("canceled"){}class Nt extends z("not_implemented"){}const Pt=Object.freeze(Object.defineProperty({__proto__:null,Canceled:Rt,NONE:P,NotImplemented:Nt,UNKNOWN:b,Unknown:Z,createTyped:z,decode:qt,encode:Ot,isTyped:ae,payloadZ:At,register:kt},Symbol.toStringTag,{value:"Module"})),Zt=()=>Promise.resolve(),It=()=>new Promise(e=>setTimeout(e,0)),Ct=e=>e?-1:1,le=s.object({jsonrpc:s.literal("2.0"),method:s.string(),params:s.any().optional(),id:s.union([s.string(),s.number(),s.null()]).optional()}),ue=s.object({jsonrpc:s.literal("2.0"),id:s.union([s.string(),s.number(),s.null()])}),Lt=ue.extend({result:s.json()}),Wt=ue.extend({error:s.object({code:s.number().int(),message:s.string().optional(),data:s.json().optional()})}),de=s.union([Lt,Wt]),fe=s.union([le,de]),Dt=e=>{const t=new TextDecoder;let r=new Uint8Array(0),n=null;return o=>{let i;typeof o=="string"?i=new TextEncoder().encode(o):o instanceof ArrayBuffer?i=new Uint8Array(o):i=o;const c=new Uint8Array(r.length+i.length);for(c.set(r),c.set(i,r.length),r=c;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 a=new TextEncoder().encode(l[0]).length;r=r.slice(a)}if(n!==null&&r.length>=n){const d=r.slice(0,n);r=r.slice(n),n=null;const l=t.decode(d),a=U.JSON_CODEC.decodeString(l,fe);e(a)}else break}}},Ut=e=>{const t=JSON.stringify(e);return`Content-Length: ${new TextEncoder().encode(t).length}\r
|
|
2
2
|
\r
|
|
3
|
-
`+t},
|
|
3
|
+
`+t},Ht=Object.freeze(Object.defineProperty({__proto__:null,encodeMessage:Ut,messageZ:fe,requestZ:le,responseZ:de,streamDecodeChunks:Dt},Symbol.toStringTag,{value:"Module"})),Bt=(e,t,r)=>{const n=e.get(t);return n===void 0?(e.set(t,r),r):n},Vt=Object.freeze(Object.defineProperty({__proto__:null,getOrSetDefault:Bt},Symbol.toStringTag,{value:"Module"})),I=s.z.string().regex(/^\d+\.\d+\.\d+$/),$=(e,t,r={})=>{r.checkMajor??=!0,r.checkMinor??=!0,r.checkPatch??=!0;const n=I.parse(e),o=I.parse(t),[i,c,d]=n.split(".").map(Number),[l,a,u]=o.split(".").map(Number);if(r.checkMajor){if(i<l)return m.LESS_THAN;if(i>l)return m.GREATER_THAN}if(r.checkMinor){if(c<a)return m.LESS_THAN;if(c>a)return m.GREATER_THAN}if(r.checkPatch){if(d<u)return m.LESS_THAN;if(d>u)return m.GREATER_THAN}return m.EQUAL},Ft=(e,t,r={})=>m.isEqualTo($(e,t,r)),he=(e,t,r={})=>m.isGreaterThan($(e,t,r)),Qt=(e,t,r={})=>m.isLessThan($(e,t,r)),Gt=({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}},Jt=({name:e,migrations:t,targetSchema:r,defaultVersion:n,def:o})=>{const i=Object.keys(t).sort($).pop();if(i==null)return a=>{if(a.version??=n,a.version!==o.version)return console.log(`${e} version ${a.version} is newer than latest version of ${o.version}.
|
|
4
4
|
Returning default instead.
|
|
5
|
-
`),o;try{return r!=null?r.parse(a):a}catch(u){return console.log(`${e} failed to parse default. Exiting with default`),console.error(u),o}};const c=Object.keys(t).length;let d=!1;const l=a=>{try{if(c===0||he(a.version,i))return console.log(d?`${e} ${a.version} now up to date`:`${e} version ${a.version} is up to date with target version ${o.version}`),a;const u=a.version,p=t[u],A=p(a);return d=!0,l(A)}catch(u){return console.log(`${e} failed to migrate from ${a.version} to ${i}`),console.error(u),o}};return a=>{try{if(a.version==null)if(n!=null)console.log(`${e} version is null. Setting version to default of ${n}`),a.version=n;else return console.log(`${e} version is null and no default version set. Exiting with default`),o;return l(a)}catch(u){return console.log(`${e} failed to parse final result. Exiting with default`),console.error(u),o}}},
|
|
5
|
+
`),o;try{return r!=null?r.parse(a):a}catch(u){return console.log(`${e} failed to parse default. Exiting with default`),console.error(u),o}};const c=Object.keys(t).length;let d=!1;const l=a=>{try{if(c===0||he(a.version,i))return console.log(d?`${e} ${a.version} now up to date`:`${e} version ${a.version} is up to date with target version ${o.version}`),a;const u=a.version,p=t[u],A=p(a);return d=!0,l(A)}catch(u){return console.log(`${e} failed to migrate from ${a.version} to ${i}`),console.error(u),o}};return a=>{try{if(a.version==null)if(n!=null)console.log(`${e} version is null. Setting version to default of ${n}`),a.version=n;else return console.log(`${e} version is null and no default version set. Exiting with default`),o;return l(a)}catch(u){return console.log(`${e} failed to parse final result. Exiting with default`),console.error(u),o}}},Yt=Object.freeze(Object.defineProperty({__proto__:null,compareSemVer:$,createMigration:Gt,migrator:Jt,semVerNewer:he,semVerOlder:Qt,semVerZ:I,versionsEqual:Ft},Symbol.toStringTag,{value:"Module"})),pe=["standard","scientific","engineering"],Kt=s.z.enum(pe),Xt=(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}`},er=Object.freeze(Object.defineProperty({__proto__:null,NOTATIONS:pe,notationZ:Kt,stringifyNumber:Xt},Symbol.toStringTag,{value:"Module"})),tr=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()},rr=e=>Array.isArray(e)?[...e]:typeof e=="object"&&e!==null?{...e}:e,ge=s.z.enum(["success","info","warning","error","loading","disabled"]),nr=e=>s.z.object({key:s.z.string(),variant:ge,message:s.z.string(),description:s.z.string().optional(),time:h.TimeStamp.z,details:e??s.z.unknown().optional()}),sr=(e,t)=>{if(!(e instanceof Error))throw e;return me({variant:"error",message:t??e.message,description:t!=null?e.message:void 0,details:{stack:e.stack??""}})},me=e=>({key:h.create(),time:h.TimeStamp.now(),...e}),or=(e,t=[])=>Array.isArray(t)?t.includes(e)?e:void 0:t===e?e:void 0,ir=Object.freeze(Object.defineProperty({__proto__:null,create:me,filterVariant:or,fromException:sr,statusZ:nr,variantZ:ge},Symbol.toStringTag,{value:"Module"})),cr=(e,t="")=>{if(typeof e=="string")return e;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]}`},ar=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,a)=>{if(o.test(l)){const u=t.map((p,A)=>A!==a?p.charAt(0).toLowerCase():p).join("");r.add(u.replace(/-/g,"_")),r.add(u.replace(/(.)(.)/g,"$1_$2").replace(/-/g,"_"))}});const c=t.map(l=>(l.length>3?l.substring(0,3):l).toLowerCase());return r.add(c.join("").replace(/-/g,"_")),r.add(c.join("_").replace(/-/g,"_")),Array.from(r).filter(l=>l.length>=2&&l.length<=12&&!/^\d/.test(l))},lr=(e,t)=>e.startsWith(t)?e.slice(t.length):e,ur=Object.freeze(Object.defineProperty({__proto__:null,createShortIdentifiers:ar,naturalLanguageJoin:cr,trimPrefix:lr},Symbol.toStringTag,{value:"Module"})),dr=new Error("request for lock canceled");var fr=function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(c){c(i)})}return new(r||(r=Promise))(function(i,c){function d(u){try{a(n.next(u))}catch(p){c(p)}}function l(u){try{a(n.throw(u))}catch(p){c(p)}}function a(u){u.done?i(u.value):o(u.value).then(d,l)}a((n=n.apply(e,t||[])).next())})};class hr{constructor(t,r=dr){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 i={resolve:n,reject:o,weight:t,priority:r},c=be(this._queue,d=>r<=d.priority);c===-1&&t<=this._value?this._dispatchItem(i):this._queue.splice(c+1,0,i)})}runExclusive(t){return fr(this,arguments,void 0,function*(r,n=1,o=0){const[i,c]=yield this.acquire(n,o);try{return yield r(i)}finally{c()}})}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]=[]),pr(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(i=>i.priority<=t);(o===-1?n:n.splice(0,o)).forEach(i=>i.resolve())}}}_couldLockImmediately(t,r){return(this._queue.length===0||this._queue[0].priority<r)&&t<=this._value}}function pr(e,t){const r=be(e,n=>t.priority<=n.priority);e.splice(r+1,0,t)}function be(e,t){for(let r=e.length-1;r>=0;r--)if(t(e[r]))return r;return-1}var gr=function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(c){c(i)})}return new(r||(r=Promise))(function(i,c){function d(u){try{a(n.next(u))}catch(p){c(p)}}function l(u){try{a(n.throw(u))}catch(p){c(p)}}function a(u){u.done?i(u.value):o(u.value).then(d,l)}a((n=n.apply(e,t||[])).next())})};class mr{constructor(t){this._semaphore=new hr(1,t)}acquire(){return gr(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 ye extends mr{constructor(t){super(),Object.assign(this,t)}}const br=e=>new ye(e),yr=Object.freeze(Object.defineProperty({__proto__:null,mutex:ye,newMutex:br},Symbol.toStringTag,{value:"Module"})),_r=e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString():r),Sr=async(e,t=200,r=20)=>{const n=Date.now();for(;Date.now()-n<t;)await e(),await new Promise(o=>setTimeout(o,r))},vr=Object.freeze(Object.defineProperty({__proto__:null,expectAlways:Sr,toString:_r},Symbol.toStringTag,{value:"Module"}));exports.array=_e.array;exports.binary=U.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.instance=h.matcher;exports.isCrudeSeries=h.isCrudeSeries;exports.isTelemValue=h.isTelemValue;exports.typedArrayZ=h.typedArrayZ;exports.uuid=h.uuid;exports.caseconv=Se.caseconv;exports.change=ve.change;exports.clamp=H.clamp;exports.scale=H.scale;exports.compare=m.compare;exports.primitive=m.primitive;exports.debounce=B.debounce;exports.throttle=B.throttle;exports.deep=we.deep;exports.isObject=Te.isObject;exports.kv=Me.external;exports.link=je.link;exports.bounds=g.bounds;exports.observe=ze.observe;exports.record=$e.record;exports.runtime=Ee.external;exports.box=xe.box;exports.dimensions=ke.dimensions;exports.direction=Oe.direction;exports.location=qe.location;exports.spatial=Ae.spatial;exports.xy=Re.xy;exports.unique=Ne.unique;exports.URL=V.URL;exports.buildQueryString=V.buildQueryString;exports.RoutedWorker=C.RoutedWorker;exports.TypedWorker=C.TypedWorker;exports.createMockWorkers=C.createMockWorkers;exports.zod=Pe.external;exports.breaker=Be;exports.color=vt;exports.control=jt;exports.convertRenderV=tr;exports.errors=Pt;exports.flushMicrotasks=Zt;exports.flushTaskQueue=It;exports.invert=Ct;exports.jsonRPC=Ht;exports.map=Vt;exports.math=We;exports.migrate=Yt;exports.notation=er;exports.shallowCopy=rr;exports.sleep=De;exports.status=ir;exports.strings=ur;exports.sync=yr;exports.testutil=vr;
|
package/dist/index.js
CHANGED
|
@@ -2,11 +2,11 @@ import { array as $r } from "./array.js";
|
|
|
2
2
|
import { J as ge } from "./index-B5l_quQn.js";
|
|
3
3
|
import { c as Er } from "./index-B5l_quQn.js";
|
|
4
4
|
import h, { z as i } from "zod";
|
|
5
|
-
import { a as _, T as U, h as be } from "./series-
|
|
6
|
-
import { c as kr, D as Ar, M as Pr, R as Zr, S as Ir, d as Nr, b as Rr, g as Cr, f as Lr, j as qr, m as Wr, i as zr, e as Dr, t as Ur, u as Br } from "./series-
|
|
5
|
+
import { a as _, T as U, h as be } from "./series-kgnLXSDr.js";
|
|
6
|
+
import { c as kr, D as Ar, M as Pr, R as Zr, S as Ir, d as Nr, b as Rr, g as Cr, f as Lr, j as qr, m as Wr, i as zr, e as Dr, t as Ur, u as Br } from "./series-kgnLXSDr.js";
|
|
7
7
|
import { a as Fr } from "./index-D2xcvEO5.js";
|
|
8
8
|
import { c as Jr } from "./change-DLl6DccR.js";
|
|
9
|
-
import { c as Qr, s as Yr } from "./scale-
|
|
9
|
+
import { c as Qr, s as Yr } from "./scale-BhIvACdB.js";
|
|
10
10
|
import { i as _e, a as ye, b as we, L as Z, G as I, E as ve } from "./index-CBMHFqs4.js";
|
|
11
11
|
import { c as Xr, p as en } from "./index-CBMHFqs4.js";
|
|
12
12
|
import { debounce as rn, throttle as nn } from "./debounce.js";
|
|
@@ -14,22 +14,21 @@ import { deep as on } from "./deep.js";
|
|
|
14
14
|
import { isObject as cn } from "./identity.js";
|
|
15
15
|
import { e as un } from "./external-BYuXBYJh.js";
|
|
16
16
|
import { link as dn } from "./link.js";
|
|
17
|
-
import { i as Se, j as xe, a as je, k as Me, d as $e, l as Te, n as Ee, o as Oe, p as ke, m as Ae, r as Pe, s as Ze } from "./bounds-
|
|
18
|
-
import { b as
|
|
17
|
+
import { i as Se, j as xe, a as je, k as Me, d as $e, l as Te, n as Ee, o as Oe, p as ke, m as Ae, r as Pe, s as Ze } from "./bounds-BQqppNFf.js";
|
|
18
|
+
import { b as mn } from "./bounds-BQqppNFf.js";
|
|
19
19
|
import { observe as gn } from "./observe.js";
|
|
20
|
-
import { r as _n } from "./record-
|
|
20
|
+
import { r as _n } from "./record-tSFQKmdG.js";
|
|
21
21
|
import { e as wn } from "./external-BPgtxa8d.js";
|
|
22
|
-
import { b as Sn } from "./box-
|
|
23
|
-
import { d as jn } from "./dimensions-
|
|
24
|
-
import { d as $n } from "./direction-
|
|
25
|
-
import { l as En } from "./location-
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import { e as Vn } from "./external-BM_NS5yM.js";
|
|
22
|
+
import { b as Sn } from "./box-DRH5SOaY.js";
|
|
23
|
+
import { d as jn } from "./dimensions-RaRkesPq.js";
|
|
24
|
+
import { d as $n } from "./direction-DKdfJwj7.js";
|
|
25
|
+
import { l as En } from "./location-CGLioInQ.js";
|
|
26
|
+
import { s as kn } from "./spatial-QY891r0E.js";
|
|
27
|
+
import { x as Pn } from "./xy-CBuhMaIo.js";
|
|
28
|
+
import { u as In } from "./index-D4NCYiQB.js";
|
|
29
|
+
import { URL as Rn, buildQueryString as Cn } from "./url.js";
|
|
30
|
+
import { RoutedWorker as qn, TypedWorker as Wn, createMockWorkers as zn } from "./worker.js";
|
|
31
|
+
import { e as Un } from "./external-BM_NS5yM.js";
|
|
33
32
|
const Ie = 2, Ne = 3, Re = 2, Ce = (e, t) => {
|
|
34
33
|
if (Number.isNaN(e) || !Number.isFinite(e)) return e;
|
|
35
34
|
const r = Se(t);
|
|
@@ -195,15 +194,15 @@ const qe = i.object({
|
|
|
195
194
|
w(a) + o * (w(f) - w(a))
|
|
196
195
|
), u = Math.round(
|
|
197
196
|
v(a) + o * (v(f) - v(a))
|
|
198
|
-
),
|
|
199
|
-
return d([l, c, u,
|
|
197
|
+
), m = S(a) + o * (S(f) - S(a));
|
|
198
|
+
return d([l, c, u, m]);
|
|
200
199
|
}
|
|
201
200
|
return d(e[e.length - 1].color);
|
|
202
201
|
}, ht = i.object({
|
|
203
202
|
key: i.string(),
|
|
204
203
|
name: i.string(),
|
|
205
204
|
color: A
|
|
206
|
-
}),
|
|
205
|
+
}), mt = i.object({
|
|
207
206
|
key: i.string(),
|
|
208
207
|
name: i.string(),
|
|
209
208
|
swatches: i.array(ht)
|
|
@@ -233,7 +232,7 @@ const qe = i.object({
|
|
|
233
232
|
isLight: st,
|
|
234
233
|
isZero: Ke,
|
|
235
234
|
luminance: x,
|
|
236
|
-
paletteZ:
|
|
235
|
+
paletteZ: mt,
|
|
237
236
|
pickByContrast: rt,
|
|
238
237
|
rValue: y,
|
|
239
238
|
rgbCSS: Qe,
|
|
@@ -242,7 +241,7 @@ const qe = i.object({
|
|
|
242
241
|
rgbaCSS: G,
|
|
243
242
|
setAlpha: et,
|
|
244
243
|
stopZ: Y
|
|
245
|
-
}, Symbol.toStringTag, { value: "Module" })), K = i.int().min(0).max(255), X = 255, ee = 0,
|
|
244
|
+
}, Symbol.toStringTag, { value: "Module" })), K = i.int().min(0).max(255), X = 255, ee = 0, pt = {
|
|
246
245
|
lower: ee,
|
|
247
246
|
upper: X + 1
|
|
248
247
|
}, te = i.object({
|
|
@@ -271,7 +270,7 @@ const qe = i.object({
|
|
|
271
270
|
]), lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
272
271
|
__proto__: null,
|
|
273
272
|
ABSOLUTE_AUTHORITY: X,
|
|
274
|
-
AUTHORITY_BOUNDS:
|
|
273
|
+
AUTHORITY_BOUNDS: pt,
|
|
275
274
|
ZERO_AUTHORITY: ee,
|
|
276
275
|
acquireZ: ne,
|
|
277
276
|
authorityZ: K,
|
|
@@ -309,7 +308,7 @@ const qe = i.object({
|
|
|
309
308
|
`X Error is missing its type property: ${JSON.stringify(t)}`
|
|
310
309
|
);
|
|
311
310
|
return !0;
|
|
312
|
-
},
|
|
311
|
+
}, p = "unknown", C = "nil";
|
|
313
312
|
class vt {
|
|
314
313
|
providers = [];
|
|
315
314
|
register(t) {
|
|
@@ -322,17 +321,17 @@ class vt {
|
|
|
322
321
|
const n = r.encode(t);
|
|
323
322
|
if (n != null) return n;
|
|
324
323
|
}
|
|
325
|
-
if (t instanceof Error) return { type:
|
|
326
|
-
if (typeof t == "string") return { type:
|
|
324
|
+
if (t instanceof Error) return { type: p, data: t.message };
|
|
325
|
+
if (typeof t == "string") return { type: p, data: t };
|
|
327
326
|
try {
|
|
328
|
-
return { type:
|
|
327
|
+
return { type: p, data: JSON.stringify(t) };
|
|
329
328
|
} catch {
|
|
330
|
-
return { type:
|
|
329
|
+
return { type: p, data: "unable to encode error information" };
|
|
331
330
|
}
|
|
332
331
|
}
|
|
333
332
|
decode(t) {
|
|
334
333
|
if (t == null || t.type === C) return null;
|
|
335
|
-
if (t.type ===
|
|
334
|
+
if (t.type === p) return new L(t.data);
|
|
336
335
|
for (const r of this.providers) {
|
|
337
336
|
const n = r.decode(t);
|
|
338
337
|
if (n != null) return n;
|
|
@@ -353,7 +352,7 @@ const ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
353
352
|
Canceled: $t,
|
|
354
353
|
NONE: C,
|
|
355
354
|
NotImplemented: Tt,
|
|
356
|
-
UNKNOWN:
|
|
355
|
+
UNKNOWN: p,
|
|
357
356
|
Unknown: L,
|
|
358
357
|
createTyped: M,
|
|
359
358
|
decode: jt,
|
|
@@ -410,7 +409,7 @@ const ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
410
409
|
return `Content-Length: ${new TextEncoder().encode(t).length}\r
|
|
411
410
|
\r
|
|
412
411
|
` + t;
|
|
413
|
-
},
|
|
412
|
+
}, mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
414
413
|
__proto__: null,
|
|
415
414
|
encodeMessage: At,
|
|
416
415
|
messageZ: le,
|
|
@@ -420,7 +419,7 @@ const ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
420
419
|
}, Symbol.toStringTag, { value: "Module" })), Pt = (e, t, r) => {
|
|
421
420
|
const n = e.get(t);
|
|
422
421
|
return n === void 0 ? (e.set(t, r), r) : n;
|
|
423
|
-
},
|
|
422
|
+
}, pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
424
423
|
__proto__: null,
|
|
425
424
|
getOrSetDefault: Pt
|
|
426
425
|
}, Symbol.toStringTag, { value: "Module" })), q = i.string().regex(/^\d+\.\d+\.\d+$/), $ = (e, t, r = {}) => {
|
|
@@ -477,7 +476,7 @@ const ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
477
476
|
try {
|
|
478
477
|
if (a === 0 || ue(c.version, o))
|
|
479
478
|
return console.log(f ? `${e} ${c.version} now up to date` : `${e} version ${c.version} is up to date with target version ${s.version}`), c;
|
|
480
|
-
const u = c.version,
|
|
479
|
+
const u = c.version, m = t[u], P = m(c);
|
|
481
480
|
return f = !0, l(P);
|
|
482
481
|
} catch (u) {
|
|
483
482
|
return console.log(
|
|
@@ -574,7 +573,7 @@ const ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
574
573
|
const s = /\d+/g;
|
|
575
574
|
e.match(s) && t.forEach((l, c) => {
|
|
576
575
|
if (s.test(l)) {
|
|
577
|
-
const u = t.map((
|
|
576
|
+
const u = t.map((m, P) => P !== c ? m.charAt(0).toLowerCase() : m).join("");
|
|
578
577
|
r.add(u.replace(/-/g, "_")), r.add(
|
|
579
578
|
u.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_")
|
|
580
579
|
);
|
|
@@ -602,15 +601,15 @@ var Ft = function(e, t, r, n) {
|
|
|
602
601
|
function f(u) {
|
|
603
602
|
try {
|
|
604
603
|
c(n.next(u));
|
|
605
|
-
} catch (
|
|
606
|
-
a(
|
|
604
|
+
} catch (m) {
|
|
605
|
+
a(m);
|
|
607
606
|
}
|
|
608
607
|
}
|
|
609
608
|
function l(u) {
|
|
610
609
|
try {
|
|
611
610
|
c(n.throw(u));
|
|
612
|
-
} catch (
|
|
613
|
-
a(
|
|
611
|
+
} catch (m) {
|
|
612
|
+
a(m);
|
|
614
613
|
}
|
|
615
614
|
}
|
|
616
615
|
function c(u) {
|
|
@@ -627,7 +626,7 @@ class Ht {
|
|
|
627
626
|
if (t <= 0)
|
|
628
627
|
throw new Error(`invalid weight ${t}: must be positive`);
|
|
629
628
|
return new Promise((n, s) => {
|
|
630
|
-
const o = { resolve: n, reject: s, weight: t, priority: r }, a =
|
|
629
|
+
const o = { resolve: n, reject: s, weight: t, priority: r }, a = me(this._queue, (f) => r <= f.priority);
|
|
631
630
|
a === -1 && t <= this._value ? this._dispatchItem(o) : this._queue.splice(a + 1, 0, o);
|
|
632
631
|
});
|
|
633
632
|
}
|
|
@@ -701,10 +700,10 @@ class Ht {
|
|
|
701
700
|
}
|
|
702
701
|
}
|
|
703
702
|
function Jt(e, t) {
|
|
704
|
-
const r =
|
|
703
|
+
const r = me(e, (n) => t.priority <= n.priority);
|
|
705
704
|
e.splice(r + 1, 0, t);
|
|
706
705
|
}
|
|
707
|
-
function
|
|
706
|
+
function me(e, t) {
|
|
708
707
|
for (let r = e.length - 1; r >= 0; r--)
|
|
709
708
|
if (t(e[r]))
|
|
710
709
|
return r;
|
|
@@ -720,15 +719,15 @@ var Gt = function(e, t, r, n) {
|
|
|
720
719
|
function f(u) {
|
|
721
720
|
try {
|
|
722
721
|
c(n.next(u));
|
|
723
|
-
} catch (
|
|
724
|
-
a(
|
|
722
|
+
} catch (m) {
|
|
723
|
+
a(m);
|
|
725
724
|
}
|
|
726
725
|
}
|
|
727
726
|
function l(u) {
|
|
728
727
|
try {
|
|
729
728
|
c(n.throw(u));
|
|
730
|
-
} catch (
|
|
731
|
-
a(
|
|
729
|
+
} catch (m) {
|
|
730
|
+
a(m);
|
|
732
731
|
}
|
|
733
732
|
}
|
|
734
733
|
function c(u) {
|
|
@@ -763,14 +762,14 @@ class Qt {
|
|
|
763
762
|
return this._semaphore.cancel();
|
|
764
763
|
}
|
|
765
764
|
}
|
|
766
|
-
class
|
|
765
|
+
class pe extends Qt {
|
|
767
766
|
constructor(t) {
|
|
768
767
|
super(), Object.assign(this, t);
|
|
769
768
|
}
|
|
770
769
|
}
|
|
771
|
-
const Yt = (e) => new
|
|
770
|
+
const Yt = (e) => new pe(e), Sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
772
771
|
__proto__: null,
|
|
773
|
-
mutex:
|
|
772
|
+
mutex: pe,
|
|
774
773
|
newMutex: Yt
|
|
775
774
|
}, Symbol.toStringTag, { value: "Module" })), Kt = (e) => JSON.stringify(e, (t, r) => typeof r == "bigint" ? r.toString() : r), Xt = async (e, t = 200, r = 20) => {
|
|
776
775
|
const n = Date.now();
|
|
@@ -786,21 +785,21 @@ export {
|
|
|
786
785
|
Ar as Density,
|
|
787
786
|
Pr as MultiSeries,
|
|
788
787
|
Zr as Rate,
|
|
789
|
-
|
|
788
|
+
qn as RoutedWorker,
|
|
790
789
|
Ir as Series,
|
|
791
790
|
Nr as Size,
|
|
792
791
|
Rr as TimeRange,
|
|
793
792
|
_ as TimeSpan,
|
|
794
793
|
U as TimeStamp,
|
|
795
|
-
|
|
796
|
-
|
|
794
|
+
Wn as TypedWorker,
|
|
795
|
+
Rn as URL,
|
|
797
796
|
Cr as addSamples,
|
|
798
797
|
$r as array,
|
|
799
798
|
Er as binary,
|
|
800
|
-
|
|
799
|
+
mn as bounds,
|
|
801
800
|
Sn as box,
|
|
802
801
|
ar as breaker,
|
|
803
|
-
|
|
802
|
+
Cn as buildQueryString,
|
|
804
803
|
Fr as caseconv,
|
|
805
804
|
Jr as change,
|
|
806
805
|
Qr as clamp,
|
|
@@ -809,7 +808,7 @@ export {
|
|
|
809
808
|
lr as control,
|
|
810
809
|
Lr as convertDataType,
|
|
811
810
|
_r as convertRenderV,
|
|
812
|
-
|
|
811
|
+
zn as createMockWorkers,
|
|
813
812
|
rn as debounce,
|
|
814
813
|
on as deep,
|
|
815
814
|
jn as dimensions,
|
|
@@ -823,31 +822,30 @@ export {
|
|
|
823
822
|
zr as isCrudeSeries,
|
|
824
823
|
cn as isObject,
|
|
825
824
|
Dr as isTelemValue,
|
|
826
|
-
|
|
825
|
+
mr as jsonRPC,
|
|
827
826
|
un as kv,
|
|
828
827
|
dn as link,
|
|
829
828
|
En as location,
|
|
830
|
-
|
|
829
|
+
pr as map,
|
|
831
830
|
or as math,
|
|
832
831
|
gr as migrate,
|
|
833
832
|
br as notation,
|
|
834
833
|
gn as observe,
|
|
835
|
-
kn as position,
|
|
836
834
|
en as primitive,
|
|
837
835
|
_n as record,
|
|
838
836
|
wn as runtime,
|
|
839
837
|
Yr as scale,
|
|
840
838
|
yr as shallowCopy,
|
|
841
839
|
ir as sleep,
|
|
842
|
-
|
|
840
|
+
kn as spatial,
|
|
843
841
|
wr as status,
|
|
844
842
|
vr as strings,
|
|
845
843
|
Sr as sync,
|
|
846
844
|
xr as testutil,
|
|
847
845
|
nn as throttle,
|
|
848
846
|
Ur as typedArrayZ,
|
|
849
|
-
|
|
847
|
+
In as unique,
|
|
850
848
|
Br as uuid,
|
|
851
|
-
|
|
852
|
-
|
|
849
|
+
Pn as xy,
|
|
850
|
+
Un as zod
|
|
853
851
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z as O } from "zod";
|
|
2
2
|
import { c as m } from "./index-D2xcvEO5.js";
|
|
3
|
-
import { y as
|
|
4
|
-
const N = y, R =
|
|
3
|
+
import { y as a, e as y, f, g, D as C, C as z, X as L, Y as h, l as S, h as d } from "./base-BORMP3mH.js";
|
|
4
|
+
const N = y, R = a, I = f, X = {
|
|
5
5
|
top: "bottom",
|
|
6
6
|
right: "left",
|
|
7
7
|
bottom: "top",
|
|
@@ -17,9 +17,9 @@ const N = y, R = f, I = a, X = {
|
|
|
17
17
|
const o = r(t);
|
|
18
18
|
return o === "top" || o === "bottom" ? "y" : "x";
|
|
19
19
|
}, w = O.object({
|
|
20
|
-
x: y.or(
|
|
21
|
-
y:
|
|
22
|
-
}), M = O.object({ x: y, y:
|
|
20
|
+
x: y.or(f),
|
|
21
|
+
y: a.or(f)
|
|
22
|
+
}), M = O.object({ x: y, y: a }), T = Object.freeze({ x: "left", y: "top" }), b = Object.freeze({ x: "right", y: "top" }), l = Object.freeze({ x: "left", y: "bottom" }), u = Object.freeze({ x: "right", y: "bottom" }), x = Object.freeze({ x: "center", y: "center" }), p = Object.freeze({ x: "center", y: "top" }), _ = Object.freeze({ x: "center", y: "bottom" }), E = Object.freeze({ x: "right", y: "center" }), j = Object.freeze({ x: "left", y: "center" }), $ = Object.freeze([
|
|
23
23
|
j,
|
|
24
24
|
E,
|
|
25
25
|
p,
|
|
@@ -50,14 +50,14 @@ const N = y, R = f, I = a, X = {
|
|
|
50
50
|
BOTTOM_RIGHT: u,
|
|
51
51
|
CENTER: x,
|
|
52
52
|
CENTER_LEFT: j,
|
|
53
|
-
CENTER_LOCATIONS:
|
|
53
|
+
CENTER_LOCATIONS: z,
|
|
54
54
|
CENTER_RIGHT: E,
|
|
55
55
|
TOP_CENTER: p,
|
|
56
56
|
TOP_LEFT: T,
|
|
57
57
|
TOP_RIGHT: b,
|
|
58
58
|
XY_LOCATIONS: $,
|
|
59
|
-
X_LOCATIONS:
|
|
60
|
-
Y_LOCATIONS:
|
|
59
|
+
X_LOCATIONS: L,
|
|
60
|
+
Y_LOCATIONS: h,
|
|
61
61
|
center: I,
|
|
62
62
|
construct: r,
|
|
63
63
|
constructXY: q,
|
|
@@ -80,20 +80,15 @@ const N = y, R = f, I = a, X = {
|
|
|
80
80
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
81
81
|
export {
|
|
82
82
|
l as B,
|
|
83
|
-
|
|
83
|
+
j as C,
|
|
84
84
|
T,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
B as b,
|
|
85
|
+
F as a,
|
|
86
|
+
p as b,
|
|
88
87
|
M as c,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
u as h,
|
|
94
|
-
j as i,
|
|
95
|
-
E as j,
|
|
88
|
+
b as d,
|
|
89
|
+
_ as e,
|
|
90
|
+
u as f,
|
|
91
|
+
E as g,
|
|
96
92
|
K as l,
|
|
97
|
-
|
|
98
|
-
w as x
|
|
93
|
+
B as x
|
|
99
94
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const b=require("zod"),N=require("./index-DdhM_E4k.cjs"),o=require("./base-BLNViP3D.cjs"),R=o.xLocation,j=o.yLocation,z=o.centerLocation,I={top:"bottom",right:"left",bottom:"top",left:"right",center:"center"},S={top:"left",right:"top",bottom:"right",left:"bottom",center:"center"},g=o.crudeLocation,i=t=>t instanceof String||!o.DIRECTIONS.includes(t)?t:t==="x"?"left":"top",h=t=>I[i(t)],d=t=>S[i(t)],s=t=>{const n=i(t);return n==="top"||n==="bottom"?"y":"x"},m=b.z.object({x:o.xLocation.or(o.centerLocation),y:o.yLocation.or(o.centerLocation)}),L=b.z.object({x:o.xLocation,y:o.yLocation}),O=Object.freeze({x:"left",y:"top"}),y=Object.freeze({x:"right",y:"top"}),f=Object.freeze({x:"left",y:"bottom"}),x=Object.freeze({x:"right",y:"bottom"}),E=Object.freeze({x:"center",y:"center"}),_=Object.freeze({x:"center",y:"top"}),u=Object.freeze({x:"center",y:"bottom"}),a=Object.freeze({x:"right",y:"center"}),l=Object.freeze({x:"left",y:"center"}),A=Object.freeze([l,a,_,u,O,y,f,x,E]),C=(t,n)=>t.x===n.x&&t.y===n.y,P=(t,n)=>{if(typeof n=="object"){let e=!0;return"x"in n&&(t.x===n.x||(e=!1)),"y"in n&&(t.y===n.y||(e=!1)),e}return t.x===n||t.y===n},p=t=>[t.x,t.y],T=t=>s(i(t))==="x",M=t=>s(i(t))==="y",X=t=>`${t.x}${N.capitalize(t.y)}`,Y=(t,n)=>{let e,c;if(typeof t=="object"&&"x"in t?(e=t.x,c=t.y):(e=i(t),c=i(n??t)),s(e)===s(c)&&e!=="center"&&c!=="center")throw new Error(`[XYLocation] - encountered two locations with the same direction: ${e.toString()} - ${c.toString()}`);const r={...E};return e==="center"?T(c)?[r.x,r.y]=[c,e]:[r.x,r.y]=[e,c]:c==="center"?T(e)?[r.x,r.y]=[e,c]:[r.x,r.y]=[c,e]:T(e)?[r.x,r.y]=[e,c]:[r.x,r.y]=[c,e],r},B=Object.freeze(Object.defineProperty({__proto__:null,BOTTOM_CENTER:u,BOTTOM_LEFT:f,BOTTOM_RIGHT:x,CENTER:E,CENTER_LEFT:l,CENTER_LOCATIONS:o.CENTER_LOCATIONS,CENTER_RIGHT:a,TOP_CENTER:_,TOP_LEFT:O,TOP_RIGHT:y,XY_LOCATIONS:A,X_LOCATIONS:o.X_LOCATIONS,Y_LOCATIONS:o.Y_LOCATIONS,center:z,construct:i,constructXY:Y,corner:L,crude:g,direction:s,isX:T,isY:M,location:o.location,outer:o.outerLocation,rotate90:d,swap:h,x:R,xy:m,xyCouple:p,xyEquals:C,xyMatches:P,xyToString:X,y:j},Symbol.toStringTag,{value:"Module"}));exports.BOTTOM_CENTER=u;exports.BOTTOM_LEFT=f;exports.BOTTOM_RIGHT=x;exports.CENTER_LEFT=l;exports.CENTER_RIGHT=a;exports.TOP_CENTER=_;exports.TOP_LEFT=O;exports.TOP_RIGHT=y;exports.corner=L;exports.location=B;exports.xyCouple=p;exports.xyEquals=C;
|
package/dist/location.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./location-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./location-DJ_K4SlP.cjs");exports.location=o.location;
|
package/dist/location.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("zod"),s=n.z.record(n.z.union([n.z.number(),n.z.string(),n.z.symbol()]),n.z.unknown()),c=e=>Object.entries(e),i=(e,o)=>Object.fromEntries(c(e).map(([t,r])=>[t,o(r,t)])),u=e=>Object.fromEntries(c(e).filter(([o,t])=>t!==void 0)),d=(e,...o)=>{const t={...e};for(const r of o)delete t[r];return t},l=Object.freeze(Object.defineProperty({__proto__:null,entries:c,map:i,omit:d,purgeUndefined:u,unknownZ:s},Symbol.toStringTag,{value:"Module"}));exports.record=l;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z as t } from "zod";
|
|
2
|
+
const c = t.record(
|
|
3
|
+
t.union([t.number(), t.string(), t.symbol()]),
|
|
4
|
+
t.unknown()
|
|
5
|
+
), s = (e) => Object.entries(e), i = (e, n) => Object.fromEntries(s(e).map(([o, r]) => [o, n(r, o)])), m = (e) => Object.fromEntries(s(e).filter(([n, o]) => o !== void 0)), u = (e, ...n) => {
|
|
6
|
+
const o = { ...e };
|
|
7
|
+
for (const r of n) delete o[r];
|
|
8
|
+
return o;
|
|
9
|
+
}, l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10
|
+
__proto__: null,
|
|
11
|
+
entries: s,
|
|
12
|
+
map: i,
|
|
13
|
+
omit: u,
|
|
14
|
+
purgeUndefined: m,
|
|
15
|
+
unknownZ: c
|
|
16
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
17
|
+
export {
|
|
18
|
+
l as r
|
|
19
|
+
};
|
package/dist/record.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./record-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./record-BwjIgrpU.cjs");exports.record=e.record;
|
package/dist/record.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const l=require("zod"),y=require("./bounds-
|
|
1
|
+
"use strict";const l=require("zod"),y=require("./bounds-BXbqBINt.cjs"),u=require("./box-qgxWXNhm.cjs"),m=require("./location-DJ_K4SlP.cjs"),h=require("./xy-BKIJiLu_.cjs"),f=(n,t,e)=>t!==void 0&&n<t?t:e!==void 0&&n>e?e:n,B=l.z.object({offset:h.crudeZ,scale:h.crudeZ}),g=l.z.object({offset:l.z.number(),scale:l.z.number()}),v=n=>(t,e,s,r)=>e==="dimension"?[t,s]:[t,r?s-n:s+n],R=n=>(t,e,s,r)=>[t,r?s/n:s*n],T=n=>(t,e,s)=>{if(t===null)return[n,s];const{lower:r,upper:o}=t,{lower:a,upper:p}=n,x=o-r,d=p-a;if(e==="dimension")return[n,s*(d/x)];const w=(s-r)*(d/x)+a;return[n,w]},q=n=>(t,e,s)=>[n,s],z=()=>(n,t,e)=>{if(n===null)throw new Error("cannot invert without bounds");if(t==="dimension")return[n,e];const{lower:s,upper:r}=n;return[n,r-(e-s)]},E=n=>(t,e,s)=>{const{lower:r,upper:o}=n;return s=f(s,r,o),[t,s]};class i{ops=[];currBounds=null;currType=null;reversed=!1;constructor(){this.ops=[]}static translate(t){return new i().translate(t)}static magnify(t){return new i().magnify(t)}static scale(t,e){return new i().scale(t,e)}translate(t){const e=this.new(),s=v(t);return s.type="translate",e.ops.push(s),e}magnify(t){const e=this.new(),s=R(t);return s.type="magnify",e.ops.push(s),e}scale(t,e){const s=y.construct(t,e),r=this.new(),o=T(s);return o.type="scale",r.ops.push(o),r}clamp(t,e){const s=y.construct(t,e),r=this.new(),o=E(s);return o.type="clamp",r.ops.push(o),r}reBound(t,e){const s=y.construct(t,e),r=this.new(),o=q(s);return o.type="re-bound",r.ops.push(o),r}invert(){const t=z();t.type="invert";const e=this.new();return e.ops.push(t),e}pos(t){return this.exec("position",t)}dim(t){return this.exec("dimension",t)}new(){const t=new i;return t.ops=this.ops.slice(),t.reversed=this.reversed,t}exec(t,e){return this.currBounds=null,this.ops.reduce(([s,r],o)=>o(s,t,r,this.reversed),[null,e])[1]}reverse(){const t=this.new();t.ops.reverse();const e=[];return t.ops.forEach((s,r)=>{if(s.type==="scale"||e.some(([a,p])=>r>=a&&r<=p))return;const o=t.ops.findIndex((a,p)=>a.type==="scale"&&p>r);o!==-1&&e.push([r,o])}),e.forEach(([s,r])=>{const o=t.ops.slice(s,r);o.unshift(t.ops[r]),t.ops.splice(s,r-s+1,...o)}),t.reversed=!t.reversed,t}get transform(){return{scale:this.dim(1),offset:this.pos(0)}}static IDENTITY=new i}class c{x;y;currRoot;constructor(t=new i,e=new i,s=null){this.x=t,this.y=e,this.currRoot=s}static translate(t,e){return new c().translate(t,e)}static translateX(t){return new c().translateX(t)}static translateY(t){return new c().translateY(t)}static clamp(t){return new c().clamp(t)}static magnify(t){return new c().magnify(t)}static scale(t){return new c().scale(t)}static reBound(t){return new c().reBound(t)}translate(t,e){const s=h.construct(t,e),r=this.copy();return r.x=this.x.translate(s.x),r.y=this.y.translate(s.y),r}translateX(t){const e=this.copy();return e.x=this.x.translate(t),e}translateY(t){const e=this.copy();return e.y=this.y.translate(t),e}magnify(t){const e=this.copy();return e.x=this.x.magnify(t.x),e.y=this.y.magnify(t.y),e}scale(t){const e=this.copy();if(u.isBox(t)){const s=this.currRoot;return e.currRoot=t.root,s!=null&&!m.xyEquals(s,t.root)&&(s.x!==t.root.x&&(e.x=e.x.invert()),s.y!==t.root.y&&(e.y=e.y.invert())),e.x=e.x.scale(u.xBounds(t)),e.y=e.y.scale(u.yBounds(t)),e}return e.x=e.x.scale(t.width),e.y=e.y.scale(t.height),e}reBound(t){const e=this.copy();return e.x=this.x.reBound(u.xBounds(t)),e.y=this.y.reBound(u.yBounds(t)),e}clamp(t){const e=this.copy();return e.x=this.x.clamp(u.xBounds(t)),e.y=this.y.clamp(u.yBounds(t)),e}copy(){const t=new c;return t.currRoot=this.currRoot,t.x=this.x,t.y=this.y,t}reverse(){const t=this.copy();return t.x=this.x.reverse(),t.y=this.y.reverse(),t}pos(t){return{x:this.x.pos(t.x),y:this.y.pos(t.y)}}dim(t){return{x:this.x.dim(t.x),y:this.y.dim(t.y)}}box(t){return u.construct(this.pos(t.one),this.pos(t.two),0,0,this.currRoot??t.root)}get transform(){return{scale:this.dim({x:1,y:1}),offset:this.pos({x:0,y:0})}}static IDENTITY=new c}const I=Object.freeze(Object.defineProperty({__proto__:null,Scale:i,XY:c,crudeXYTransform:B,transform:g},Symbol.toStringTag,{value:"Module"}));exports.clamp=f;exports.scale=I;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z as p } from "zod";
|
|
2
|
-
import { c as l } from "./bounds-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { b as d, c as B } from "./xy-
|
|
2
|
+
import { c as l } from "./bounds-BQqppNFf.js";
|
|
3
|
+
import { i as w, x as y, y as h, c as g } from "./box-DRH5SOaY.js";
|
|
4
|
+
import { x as v } from "./location-CGLioInQ.js";
|
|
5
|
+
import { b as d, c as B } from "./xy-CBuhMaIo.js";
|
|
6
6
|
const R = (n, t, e) => t !== void 0 && n < t ? t : e !== void 0 && n > e ? e : n, T = p.object({ offset: d, scale: d }), E = p.object({ offset: p.number(), scale: p.number() }), I = (n) => (t, e, s, r) => e === "dimension" ? [t, s] : [
|
|
7
7
|
t,
|
|
8
8
|
r ? s - n : s + n
|
package/dist/scale.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./scale-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./scale-76Azh2EE.cjs");exports.scale=e.scale;
|
package/dist/scale.js
CHANGED