@synnaxlabs/x 0.35.0 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/.turbo/turbo-build.log +27 -27
  2. package/dist/binary.cjs +1 -1
  3. package/dist/binary.js +1 -1
  4. package/dist/bounds-8aFLdbEj.cjs +1 -0
  5. package/dist/{bounds-CFI9wDXn.js → bounds-BtccGJW0.js} +22 -18
  6. package/dist/bounds.cjs +1 -1
  7. package/dist/bounds.js +1 -1
  8. package/dist/{box-BpSX4si6.cjs → box-BHIyGhI_.cjs} +1 -1
  9. package/dist/{box-CYXc9-qp.js → box-CfhGfJJH.js} +1 -1
  10. package/dist/box.cjs +1 -1
  11. package/dist/box.js +1 -1
  12. package/dist/caseconv.cjs +1 -1
  13. package/dist/caseconv.js +1 -1
  14. package/dist/external-CghVMqCA.cjs +1 -0
  15. package/dist/external-DKQKvgIi.js +30 -0
  16. package/dist/index-BfDeGfej.js +41 -0
  17. package/dist/{index-CYxQwEdX.cjs → index-CnclyYpG.cjs} +1 -1
  18. package/dist/index-Dd8DLyMx.cjs +1 -0
  19. package/dist/{index-BBa2mWG1.js → index-OHIRoCei.js} +1 -1
  20. package/dist/index.cjs +2 -2
  21. package/dist/index.js +172 -155
  22. package/dist/{location-DLP2ZS0o.cjs → location-BIet4Mig.cjs} +1 -1
  23. package/dist/{location-Cn1ByVTZ.js → location-C5Ot4MVG.js} +1 -1
  24. package/dist/location.cjs +1 -1
  25. package/dist/location.js +1 -1
  26. package/dist/{position-DJXB-pDS.js → position-BXFz7I9G.js} +2 -2
  27. package/dist/{position-JCN6-sJC.cjs → position-CFiSGTz9.cjs} +1 -1
  28. package/dist/position.cjs +1 -1
  29. package/dist/position.js +1 -1
  30. package/dist/runtime.cjs +1 -1
  31. package/dist/runtime.js +1 -1
  32. package/dist/{scale-Dj7-5FQQ.cjs → scale-BESJN9LG.cjs} +1 -1
  33. package/dist/{scale-Coub2bPH.js → scale-CV3O6tkY.js} +3 -3
  34. package/dist/scale.cjs +1 -1
  35. package/dist/scale.js +1 -1
  36. package/dist/series-BbxR21uO.cjs +11 -0
  37. package/dist/{series-DOxur2pj.js → series-C_B2hAp9.js} +474 -371
  38. package/dist/spatial.cjs +1 -1
  39. package/dist/spatial.js +5 -5
  40. package/dist/src/breaker/breaker.d.ts +33 -0
  41. package/dist/src/breaker/breaker.d.ts.map +1 -0
  42. package/dist/src/breaker/breaker.spec.d.ts +2 -0
  43. package/dist/src/breaker/breaker.spec.d.ts.map +1 -0
  44. package/dist/src/breaker/index.d.ts +2 -0
  45. package/dist/src/breaker/index.d.ts.map +1 -0
  46. package/dist/src/caseconv/caseconv.d.ts +12 -6
  47. package/dist/src/caseconv/caseconv.d.ts.map +1 -1
  48. package/dist/src/change/change.d.ts +5 -5
  49. package/dist/src/change/change.d.ts.map +1 -1
  50. package/dist/src/control/control.d.ts +5 -5
  51. package/dist/src/control/control.d.ts.map +1 -1
  52. package/dist/src/index.d.ts +1 -0
  53. package/dist/src/index.d.ts.map +1 -1
  54. package/dist/src/mock/MockGLBufferController.d.ts +2 -2
  55. package/dist/src/mock/MockGLBufferController.d.ts.map +1 -1
  56. package/dist/src/runtime/os.d.ts +1 -1
  57. package/dist/src/runtime/os.d.ts.map +1 -1
  58. package/dist/src/sleep/index.d.ts +2 -0
  59. package/dist/src/sleep/index.d.ts.map +1 -0
  60. package/dist/src/sleep/sleep.d.ts +3 -0
  61. package/dist/src/sleep/sleep.d.ts.map +1 -0
  62. package/dist/src/spatial/bounds/bounds.d.ts +12 -0
  63. package/dist/src/spatial/bounds/bounds.d.ts.map +1 -1
  64. package/dist/src/telem/gl.d.ts +2 -2
  65. package/dist/src/telem/gl.d.ts.map +1 -1
  66. package/dist/src/telem/series.d.ts +16 -9
  67. package/dist/src/telem/series.d.ts.map +1 -1
  68. package/dist/src/telem/telem.d.ts +43 -2
  69. package/dist/src/telem/telem.d.ts.map +1 -1
  70. package/dist/telem.cjs +1 -1
  71. package/dist/telem.js +11 -10
  72. package/package.json +69 -70
  73. package/src/binary/encoder.ts +3 -3
  74. package/src/breaker/breaker.spec.ts +73 -0
  75. package/src/breaker/breaker.ts +33 -0
  76. package/src/breaker/index.ts +1 -0
  77. package/src/caseconv/caseconv.spec.ts +16 -0
  78. package/src/caseconv/caseconv.ts +34 -5
  79. package/src/index.ts +1 -0
  80. package/src/mock/MockGLBufferController.ts +6 -6
  81. package/src/runtime/os.ts +17 -1
  82. package/src/sleep/index.ts +1 -0
  83. package/src/sleep/sleep.ts +6 -0
  84. package/src/spatial/bounds/bounds.spec.ts +6 -0
  85. package/src/spatial/bounds/bounds.ts +16 -0
  86. package/src/telem/gl.ts +6 -2
  87. package/src/telem/series.spec.ts +3 -2
  88. package/src/telem/series.ts +44 -16
  89. package/src/telem/telem.ts +121 -2
  90. package/tsconfig.json +1 -1
  91. package/tsconfig.tsbuildinfo +1 -1
  92. package/dist/bounds-DzCDHgdE.cjs +0 -1
  93. package/dist/external-B3XSLDq5.cjs +0 -1
  94. package/dist/external-sVtvYJS6.js +0 -23
  95. package/dist/index-YsO0EMN8.cjs +0 -1
  96. package/dist/index-eue4dSQX.js +0 -45
  97. package/dist/series-CAP8K7YO.cjs +0 -11
package/dist/index.js CHANGED
@@ -1,59 +1,74 @@
1
- var j = Object.defineProperty;
2
- var T = (e, t, r) => t in e ? j(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
1
+ var M = Object.defineProperty;
2
+ var T = (e, t, r) => t in e ? M(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var p = (e, t, r) => T(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { e as X } from "./index-BBa2mWG1.js";
5
- import { a as ee } from "./index-eue4dSQX.js";
6
- import { c as te } from "./change-DLl6DccR.js";
7
- import { c as ne, s as se } from "./scale-Coub2bPH.js";
8
- import { L as S, G as y, E as w, i as A, a as k, b as O } from "./index-HQonyH7n.js";
9
- import { c as ae, d as ce, p as le } from "./index-HQonyH7n.js";
4
+ import { e as ne } from "./index-OHIRoCei.js";
10
5
  import { z as c } from "zod";
11
- import { debounce as ue, throttle as me } from "./debounce.js";
12
- import { deep as pe } from "./deep.js";
13
- import { d as be, D as he, M as xe, R as Se, S as ye, e as $e, c as ve, b as Ee, T as Me, a as je, g as Te, h as we, i as Ae, f as ke, t as Oe } from "./series-DOxur2pj.js";
14
- import { isObject as _e } from "./identity.js";
15
- import { t as Ne } from "./types-BpAJW2TM.js";
16
- import { b as Pe, f as Ge } from "./bounds-CFI9wDXn.js";
17
- import { observe as De } from "./observe.js";
18
- import { getEntries as Ve, mapValues as Ie, unknownRecordZ as We } from "./record.js";
19
- import { e as Be } from "./external-sVtvYJS6.js";
20
- import { Search as Qe } from "./search.js";
21
- import { b as Je } from "./box-CYXc9-qp.js";
22
- import { d as Fe } from "./dimensions-D-1PnJVI.js";
23
- import { d as Ye } from "./direction-CScbfCdT.js";
24
- import { l as rr } from "./location-Cn1ByVTZ.js";
25
- import { p as or } from "./position-DJXB-pDS.js";
26
- import { s as sr } from "./spatial-DozyssiN.js";
27
- import { x as ar } from "./xy-DQdccWlc.js";
28
- import { nullToArr as lr, toArray as fr } from "./toArray.js";
29
- import { unique as mr } from "./unique.js";
30
- import { URL as pr, buildQueryString as gr } from "./url.js";
31
- import { RoutedWorker as hr, TypedWorker as xr, createMockWorkers as Sr } from "./worker.js";
32
- import { z as $r } from "./zodutil-DI4gVZkT.js";
33
- const l = class l extends Number {
6
+ import { b as x } from "./series-C_B2hAp9.js";
7
+ import { d as ie, D as ae, M as ce, R as le, S as ue, e as fe, c as me, T as de, a as pe, g as ge, h as be, i as xe, f as he, s as ye, t as Se } from "./series-C_B2hAp9.js";
8
+ import { a as $e } from "./index-BfDeGfej.js";
9
+ import { c as je } from "./change-DLl6DccR.js";
10
+ import { c as Me, s as Te } from "./scale-CV3O6tkY.js";
11
+ import { L as S, G as v, E as k, i as A, a as _, b as O } from "./index-HQonyH7n.js";
12
+ import { c as Ae, d as _e, p as Oe } from "./index-HQonyH7n.js";
13
+ import { debounce as ze, throttle as Le } from "./debounce.js";
14
+ import { deep as Pe } from "./deep.js";
15
+ import { isObject as Ge } from "./identity.js";
16
+ import { t as Ze } from "./types-BpAJW2TM.js";
17
+ import { b as Ie, f as We } from "./bounds-BtccGJW0.js";
18
+ import { observe as Be } from "./observe.js";
19
+ import { getEntries as He, mapValues as Qe, unknownRecordZ as Ue } from "./record.js";
20
+ import { e as Ke } from "./external-DKQKvgIi.js";
21
+ import { Search as Ye } from "./search.js";
22
+ import { b as rr } from "./box-CfhGfJJH.js";
23
+ import { d as or } from "./dimensions-D-1PnJVI.js";
24
+ import { d as sr } from "./direction-CScbfCdT.js";
25
+ import { l as ar } from "./location-C5Ot4MVG.js";
26
+ import { p as lr } from "./position-BXFz7I9G.js";
27
+ import { s as fr } from "./spatial-DozyssiN.js";
28
+ import { x as dr } from "./xy-DQdccWlc.js";
29
+ import { nullToArr as gr, toArray as br } from "./toArray.js";
30
+ import { unique as hr } from "./unique.js";
31
+ import { URL as Sr, buildQueryString as vr } from "./url.js";
32
+ import { RoutedWorker as Er, TypedWorker as jr, createMockWorkers as wr } from "./worker.js";
33
+ import { z as Tr } from "./zodutil-DI4gVZkT.js";
34
+ const R = async (e) => await new Promise(
35
+ (t) => setTimeout(t, x.fromMilliseconds(e).milliseconds)
36
+ ), z = c.object({
37
+ interval: x.z.optional(),
38
+ maxRetries: c.number().optional(),
39
+ scale: c.number().optional()
40
+ }), L = (e = {}) => {
41
+ const t = e.sleepFn || R, r = e.maxRetries ?? 5, n = e.scale ?? 1;
42
+ let s = 0, l = new x(e.interval ?? x.milliseconds(1));
43
+ return async () => s >= r ? !1 : (await t(l), l = l.mult(n), s++, !0);
44
+ }, Q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45
+ __proto__: null,
46
+ breakerConfig: z,
47
+ create: L
48
+ }, Symbol.toStringTag, { value: "Module" })), u = class u extends Number {
34
49
  };
35
- p(l, "Absolute", 255), p(l, "Default", 1), p(l, "z", c.union([
36
- c.instanceof(l),
37
- c.number().int().min(0).max(255).transform((t) => new l(t)),
38
- c.instanceof(Number).transform((t) => new l(t))
50
+ p(u, "Absolute", 255), p(u, "Default", 1), p(u, "z", c.union([
51
+ c.instanceof(u),
52
+ c.number().int().min(0).max(255).transform((t) => new u(t)),
53
+ c.instanceof(Number).transform((t) => new u(t))
39
54
  ]));
40
- let h = l;
41
- const E = c.object({
55
+ let h = u;
56
+ const j = c.object({
42
57
  name: c.string(),
43
58
  key: c.string()
44
- }), L = (e) => c.object({
45
- subject: E,
59
+ }), N = (e) => c.object({
60
+ subject: j,
46
61
  resource: e,
47
62
  authority: h.z
48
- }), _ = (...e) => (t) => t.filter((r) => {
63
+ }), P = (...e) => (t) => t.filter((r) => {
49
64
  let n = !1;
50
65
  return r.to != null && (n = e.includes(r.to.resource)), r.from != null && !n && (n = e.includes(r.from.resource)), n;
51
- }), W = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
66
+ }), U = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
52
67
  __proto__: null,
53
68
  Authority: h,
54
- filterTransfersByChannelKey: _,
55
- stateZ: L,
56
- subjectZ: E
69
+ filterTransfersByChannelKey: P,
70
+ stateZ: N,
71
+ subjectZ: j
57
72
  }, Symbol.toStringTag, { value: "Module" })), m = class m extends Error {
58
73
  constructor() {
59
74
  super(m.MESSAGE);
@@ -65,26 +80,26 @@ const E = c.object({
65
80
  };
66
81
  p(m, "MESSAGE", "canceled");
67
82
  let $ = m;
68
- const z = new $(), q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
83
+ const C = new $(), J = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
69
84
  __proto__: null,
70
- CANCELED: z
71
- }, Symbol.toStringTag, { value: "Module" })), B = (e) => e ? -1 : 1, v = c.string().regex(/^\d+\.\d+\.\d+$/), g = (e, t, r = {}) => {
85
+ CANCELED: C
86
+ }, Symbol.toStringTag, { value: "Module" })), K = (e) => e ? -1 : 1, E = c.string().regex(/^\d+\.\d+\.\d+$/), g = (e, t, r = {}) => {
72
87
  r.checkMajor ?? (r.checkMajor = !0), r.checkMinor ?? (r.checkMinor = !0), r.checkPatch ?? (r.checkPatch = !0);
73
- const n = v.parse(e), i = v.parse(t), [f, u, d] = n.split(".").map(Number), [s, o, a] = i.split(".").map(Number);
88
+ const n = E.parse(e), s = E.parse(t), [l, f, d] = n.split(".").map(Number), [i, o, a] = s.split(".").map(Number);
74
89
  if (r.checkMajor) {
75
- if (f < s) return S;
76
- if (f > s) return y;
90
+ if (l < i) return S;
91
+ if (l > i) return v;
77
92
  }
78
93
  if (r.checkMinor) {
79
- if (u < o) return S;
80
- if (u > o) return y;
94
+ if (f < o) return S;
95
+ if (f > o) return v;
81
96
  }
82
97
  if (r.checkPatch) {
83
98
  if (d < a) return S;
84
- if (d > a) return y;
99
+ if (d > a) return v;
85
100
  }
86
- return w;
87
- }, N = (e, t, r = {}) => A(g(e, t, r)), M = (e, t, r = {}) => k(g(e, t, r)), R = (e, t, r = {}) => O(g(e, t, r)), P = ({
101
+ return k;
102
+ }, G = (e, t, r = {}) => A(g(e, t, r)), w = (e, t, r = {}) => _(g(e, t, r)), D = (e, t, r = {}) => O(g(e, t, r)), Z = ({
88
103
  name: e,
89
104
  migrate: t
90
105
  }) => (r) => {
@@ -94,40 +109,40 @@ const z = new $(), q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defi
94
109
  } catch (n) {
95
110
  throw console.log(`${e} failed to migrate from ${r.version}`), console.error(n), n;
96
111
  }
97
- }, G = ({
112
+ }, V = ({
98
113
  name: e,
99
114
  migrations: t,
100
115
  targetSchema: r,
101
116
  defaultVersion: n,
102
- def: i
117
+ def: s
103
118
  }) => {
104
- const f = Object.keys(t).sort(g).pop();
105
- if (f == null)
119
+ const l = Object.keys(t).sort(g).pop();
120
+ if (l == null)
106
121
  return (o) => {
107
- if (o.version ?? (o.version = n), o.version !== i.version)
122
+ if (o.version ?? (o.version = n), o.version !== s.version)
108
123
  return console.log(
109
- `${e} version ${o.version} is newer than latest version of ${i.version}.
124
+ `${e} version ${o.version} is newer than latest version of ${s.version}.
110
125
  Returning default instead.
111
126
  `
112
- ), i;
127
+ ), s;
113
128
  try {
114
129
  return r != null ? r.parse(o) : o;
115
130
  } catch (a) {
116
- return console.log(`${e} failed to parse default. Exiting with default`), console.error(a), i;
131
+ return console.log(`${e} failed to parse default. Exiting with default`), console.error(a), s;
117
132
  }
118
133
  };
119
- const u = Object.keys(t).length;
134
+ const f = Object.keys(t).length;
120
135
  let d = !1;
121
- const s = (o) => {
136
+ const i = (o) => {
122
137
  try {
123
- if (u === 0 || M(o.version, f))
124
- return console.log(d ? `${e} ${o.version} now up to date` : `${e} version ${o.version} is up to date with target version ${i.version}`), o;
125
- const a = o.version, b = t[a], x = b(o);
126
- return d = !0, s(x);
138
+ if (f === 0 || w(o.version, l))
139
+ return console.log(d ? `${e} ${o.version} now up to date` : `${e} version ${o.version} is up to date with target version ${s.version}`), o;
140
+ const a = o.version, b = t[a], y = b(o);
141
+ return d = !0, i(y);
127
142
  } catch (a) {
128
143
  return console.log(
129
- `${e} failed to migrate from ${o.version} to ${f}`
130
- ), console.error(a), i;
144
+ `${e} failed to migrate from ${o.version} to ${l}`
145
+ ), console.error(a), s;
131
146
  }
132
147
  };
133
148
  return (o) => {
@@ -140,108 +155,110 @@ const z = new $(), q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defi
140
155
  else
141
156
  return console.log(
142
157
  `${e} version is null and no default version set. Exiting with default`
143
- ), i;
144
- return s(o);
158
+ ), s;
159
+ return i(o);
145
160
  } catch (a) {
146
- return console.log(`${e} failed to parse final result. Exiting with default`), console.error(a), i;
161
+ return console.log(`${e} failed to parse final result. Exiting with default`), console.error(a), s;
147
162
  }
148
163
  };
149
- }, H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
164
+ }, X = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
150
165
  __proto__: null,
151
166
  compareSemVer: g,
152
- createMigration: P,
153
- migrator: G,
154
- semVerNewer: M,
155
- semVerOlder: R,
156
- semVerZ: v,
157
- versionsEqual: N
158
- }, Symbol.toStringTag, { value: "Module" })), Q = (e) => {
167
+ createMigration: Z,
168
+ migrator: V,
169
+ semVerNewer: w,
170
+ semVerOlder: D,
171
+ semVerZ: E,
172
+ versionsEqual: G
173
+ }, Symbol.toStringTag, { value: "Module" })), Y = (e) => {
159
174
  if (e === void 0 || typeof e == "string" || typeof e == "number")
160
175
  return e;
161
176
  if (e.toString === void 0) throw new Error("invalid renderer");
162
177
  return e.toString();
163
- }, U = (e) => Array.isArray(e) ? [...e] : typeof e == "object" && e !== null ? { ...e } : e, C = (e, t = "") => {
178
+ }, ee = (e) => Array.isArray(e) ? [...e] : typeof e == "object" && e !== null ? { ...e } : e, I = (e, t = "") => {
164
179
  const r = e.length;
165
180
  return r === 0 ? t : r === 1 ? e[0] : r === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")}, and ${e[r - 1]}`;
166
- }, D = (e) => {
167
- const t = e.split(" "), r = /* @__PURE__ */ new Set(), n = t.map((s) => s.charAt(0).toLowerCase()).join("");
181
+ }, W = (e) => {
182
+ const t = e.split(" "), r = /* @__PURE__ */ new Set(), n = t.map((i) => i.charAt(0).toLowerCase()).join("");
168
183
  r.add(n), r.add(n.replace(/(.)(.)/g, "$1_$2"));
169
- const i = /\d+/g;
170
- e.match(i) && t.forEach((s, o) => {
171
- if (i.test(s)) {
172
- const a = t.map((b, x) => x !== o ? b.charAt(0).toLowerCase() : b).join("");
184
+ const s = /\d+/g;
185
+ e.match(s) && t.forEach((i, o) => {
186
+ if (s.test(i)) {
187
+ const a = t.map((b, y) => y !== o ? b.charAt(0).toLowerCase() : b).join("");
173
188
  r.add(a), r.add(a.replace(/(.)(.)/g, "$1_$2"));
174
189
  }
175
190
  });
176
- const u = t.map(
177
- (s) => (s.length > 3 ? s.substring(0, 3) : s).toLowerCase()
191
+ const f = t.map(
192
+ (i) => (i.length > 3 ? i.substring(0, 3) : i).toLowerCase()
178
193
  );
179
- return r.add(u.join("")), r.add(u.join("_")), Array.from(r).filter(
180
- (s) => s.length >= 2 && s.length <= 12
194
+ return r.add(f.join("")), r.add(f.join("_")), Array.from(r).filter(
195
+ (i) => i.length >= 2 && i.length <= 12
181
196
  );
182
- }, J = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
197
+ }, re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
183
198
  __proto__: null,
184
- generateShortIdentifiers: D,
185
- naturalLanguageJoin: C
199
+ generateShortIdentifiers: W,
200
+ naturalLanguageJoin: I
186
201
  }, Symbol.toStringTag, { value: "Module" }));
187
202
  export {
188
- be as DataType,
189
- he as Density,
190
- xe as MultiSeries,
191
- Se as Rate,
192
- hr as RoutedWorker,
193
- Qe as Search,
194
- ye as Series,
195
- $e as Size,
196
- ve as TimeRange,
197
- Ee as TimeSpan,
198
- Me as TimeStamp,
199
- xr as TypedWorker,
200
- pr as URL,
201
- je as addSamples,
202
- X as binary,
203
- Pe as bounds,
204
- Je as box,
205
- gr as buildQueryString,
206
- ee as caseconv,
207
- te as change,
208
- ne as clamp,
209
- ae as compare,
210
- W as control,
211
- Te as convertDataType,
212
- Q as convertRenderV,
213
- Sr as createMockWorkers,
214
- ue as debounce,
215
- pe as deep,
216
- Fe as dimensions,
217
- Ye as direction,
218
- q as errors,
219
- Ve as getEntries,
220
- we as id,
221
- B as invert,
222
- Ae as isCrudeSeries,
223
- _e as isObject,
224
- ce as isStringer,
225
- ke as isTelemValue,
226
- Ne as kv,
227
- rr as location,
228
- Ie as mapValues,
229
- Ge as math,
230
- H as migrate,
231
- lr as nullToArr,
232
- De as observe,
233
- or as position,
234
- le as primitiveIsZero,
235
- Be as runtime,
236
- se as scale,
237
- U as shallowCopy,
238
- sr as spatial,
239
- J as strings,
240
- me as throttle,
241
- fr as toArray,
242
- Oe as typedArrayZ,
243
- mr as unique,
244
- We as unknownRecordZ,
245
- ar as xy,
246
- $r as zodutil
203
+ ie as DataType,
204
+ ae as Density,
205
+ ce as MultiSeries,
206
+ le as Rate,
207
+ Er as RoutedWorker,
208
+ Ye as Search,
209
+ ue as Series,
210
+ fe as Size,
211
+ me as TimeRange,
212
+ x as TimeSpan,
213
+ de as TimeStamp,
214
+ jr as TypedWorker,
215
+ Sr as URL,
216
+ pe as addSamples,
217
+ ne as binary,
218
+ Ie as bounds,
219
+ rr as box,
220
+ Q as breaker,
221
+ vr as buildQueryString,
222
+ $e as caseconv,
223
+ je as change,
224
+ Me as clamp,
225
+ Ae as compare,
226
+ U as control,
227
+ ge as convertDataType,
228
+ Y as convertRenderV,
229
+ wr as createMockWorkers,
230
+ ze as debounce,
231
+ Pe as deep,
232
+ or as dimensions,
233
+ sr as direction,
234
+ J as errors,
235
+ He as getEntries,
236
+ be as id,
237
+ K as invert,
238
+ xe as isCrudeSeries,
239
+ Ge as isObject,
240
+ _e as isStringer,
241
+ he as isTelemValue,
242
+ Ze as kv,
243
+ ar as location,
244
+ Qe as mapValues,
245
+ We as math,
246
+ X as migrate,
247
+ gr as nullToArr,
248
+ Be as observe,
249
+ lr as position,
250
+ Oe as primitiveIsZero,
251
+ Ke as runtime,
252
+ Te as scale,
253
+ ee as shallowCopy,
254
+ ye as sortTimeRange,
255
+ fr as spatial,
256
+ re as strings,
257
+ Le as throttle,
258
+ br as toArray,
259
+ Se as typedArrayZ,
260
+ hr as unique,
261
+ Ue as unknownRecordZ,
262
+ dr as xy,
263
+ Tr as zodutil
247
264
  };
@@ -1 +1 @@
1
- "use strict";const u=require("zod"),I=require("./index-YsO0EMN8.cjs"),o=require("./base-B48bPNx5.cjs"),R=o.xLocation,g=o.yLocation,h=o.centerLocation,d={top:"bottom",right:"left",bottom:"top",left:"right",center:"center"},m={top:"left",right:"top",bottom:"right",left:"bottom",center:"center"},A=o.crudeLocation,s=t=>t instanceof String||!o.DIRECTIONS.includes(t)?t:t==="x"?"left":"top",_=t=>d[s(t)],M=t=>m[s(t)],i=t=>{const n=s(t);return n==="top"||n==="bottom"?"y":"x"},E=u.z.object({x:o.xLocation.or(o.centerLocation),y:o.yLocation.or(o.centerLocation)}),l=u.z.object({x:o.xLocation,y:o.yLocation}),O=Object.freeze({x:"left",y:"top"}),f=Object.freeze({x:"right",y:"top"}),x=Object.freeze({x:"left",y:"bottom"}),a=Object.freeze({x:"right",y:"bottom"}),T=Object.freeze({x:"center",y:"center"}),b=Object.freeze({x:"center",y:"top"}),L=Object.freeze({x:"center",y:"bottom"}),p=Object.freeze({x:"right",y:"center"}),C=Object.freeze({x:"left",y:"center"}),N=Object.freeze([C,p,b,L,O,f,x,a,T]),j=(t,n)=>t.x===n.x&&t.y===n.y,S=(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},z=t=>[t.x,t.y],y=t=>i(s(t))==="x",P=t=>i(s(t))==="y",X=t=>`${t.x}${I.capitalize(t.y)}`,Y=(t,n)=>{let e,c;if(typeof t=="object"&&"x"in t?(e=t.x,c=t.y):(e=s(t),c=s(n??t)),i(e)===i(c)&&e!=="center"&&c!=="center")throw new Error(`[XYLocation] - encountered two locations with the same direction: ${e.toString()} - ${c.toString()}`);const r={...T};return e==="center"?y(c)?[r.x,r.y]=[c,e]:[r.x,r.y]=[e,c]:c==="center"?y(e)?[r.x,r.y]=[e,c]:[r.x,r.y]=[c,e]:y(e)?[r.x,r.y]=[e,c]:[r.x,r.y]=[c,e],r},w=Object.freeze(Object.defineProperty({__proto__:null,BOTTOM_CENTER:L,BOTTOM_LEFT:x,BOTTOM_RIGHT:a,CENTER:T,CENTER_LOCATIONS:o.CENTER_LOCATIONS,LEFT_CENTER:C,RIGHT_CENTER:p,TOP_CENTER:b,TOP_LEFT:O,TOP_RIGHT:f,XY_LOCATIONS:N,X_LOCATIONS:o.X_LOCATIONS,Y_LOCATIONS:o.Y_LOCATIONS,center:h,construct:s,constructXY:Y,corner:l,crude:A,direction:i,isX:y,isY:P,location:o.location,outer:o.outerLocation,rotate90:M,swap:_,x:R,xy:E,xyCouple:z,xyEquals:j,xyMatches:S,xyToString:X,y:g},Symbol.toStringTag,{value:"Module"}));exports.BOTTOM_LEFT=x;exports.BOTTOM_RIGHT=a;exports.CENTER=T;exports.TOP_LEFT=O;exports.TOP_RIGHT=f;exports.XY_LOCATIONS=N;exports.corner=l;exports.location=w;exports.swap=_;exports.xy=E;exports.xyCouple=z;exports.xyEquals=j;exports.xyMatches=S;
1
+ "use strict";const u=require("zod"),I=require("./index-Dd8DLyMx.cjs"),o=require("./base-B48bPNx5.cjs"),R=o.xLocation,g=o.yLocation,h=o.centerLocation,d={top:"bottom",right:"left",bottom:"top",left:"right",center:"center"},m={top:"left",right:"top",bottom:"right",left:"bottom",center:"center"},A=o.crudeLocation,s=t=>t instanceof String||!o.DIRECTIONS.includes(t)?t:t==="x"?"left":"top",_=t=>d[s(t)],M=t=>m[s(t)],i=t=>{const n=s(t);return n==="top"||n==="bottom"?"y":"x"},E=u.z.object({x:o.xLocation.or(o.centerLocation),y:o.yLocation.or(o.centerLocation)}),l=u.z.object({x:o.xLocation,y:o.yLocation}),O=Object.freeze({x:"left",y:"top"}),f=Object.freeze({x:"right",y:"top"}),x=Object.freeze({x:"left",y:"bottom"}),a=Object.freeze({x:"right",y:"bottom"}),T=Object.freeze({x:"center",y:"center"}),b=Object.freeze({x:"center",y:"top"}),L=Object.freeze({x:"center",y:"bottom"}),p=Object.freeze({x:"right",y:"center"}),C=Object.freeze({x:"left",y:"center"}),N=Object.freeze([C,p,b,L,O,f,x,a,T]),j=(t,n)=>t.x===n.x&&t.y===n.y,S=(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},z=t=>[t.x,t.y],y=t=>i(s(t))==="x",P=t=>i(s(t))==="y",X=t=>`${t.x}${I.capitalize(t.y)}`,Y=(t,n)=>{let e,c;if(typeof t=="object"&&"x"in t?(e=t.x,c=t.y):(e=s(t),c=s(n??t)),i(e)===i(c)&&e!=="center"&&c!=="center")throw new Error(`[XYLocation] - encountered two locations with the same direction: ${e.toString()} - ${c.toString()}`);const r={...T};return e==="center"?y(c)?[r.x,r.y]=[c,e]:[r.x,r.y]=[e,c]:c==="center"?y(e)?[r.x,r.y]=[e,c]:[r.x,r.y]=[c,e]:y(e)?[r.x,r.y]=[e,c]:[r.x,r.y]=[c,e],r},w=Object.freeze(Object.defineProperty({__proto__:null,BOTTOM_CENTER:L,BOTTOM_LEFT:x,BOTTOM_RIGHT:a,CENTER:T,CENTER_LOCATIONS:o.CENTER_LOCATIONS,LEFT_CENTER:C,RIGHT_CENTER:p,TOP_CENTER:b,TOP_LEFT:O,TOP_RIGHT:f,XY_LOCATIONS:N,X_LOCATIONS:o.X_LOCATIONS,Y_LOCATIONS:o.Y_LOCATIONS,center:h,construct:s,constructXY:Y,corner:l,crude:A,direction:i,isX:y,isY:P,location:o.location,outer:o.outerLocation,rotate90:M,swap:_,x:R,xy:E,xyCouple:z,xyEquals:j,xyMatches:S,xyToString:X,y:g},Symbol.toStringTag,{value:"Module"}));exports.BOTTOM_LEFT=x;exports.BOTTOM_RIGHT=a;exports.CENTER=T;exports.TOP_LEFT=O;exports.TOP_RIGHT=f;exports.XY_LOCATIONS=N;exports.corner=l;exports.location=w;exports.swap=_;exports.xy=E;exports.xyCouple=z;exports.xyEquals=j;exports.xyMatches=S;
@@ -1,5 +1,5 @@
1
1
  import { z as O } from "zod";
2
- import { c as m } from "./index-eue4dSQX.js";
2
+ import { c as m } from "./index-BfDeGfej.js";
3
3
  import { e as a, f, y, g, D as C, C as z, X as L, Y as h, l as S, h as d } from "./base-DnZzEvvz.js";
4
4
  const N = a, R = y, I = f, X = {
5
5
  top: "bottom",
package/dist/location.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./location-DLP2ZS0o.cjs");exports.location=o.location;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./location-BIet4Mig.cjs");exports.location=o.location;
package/dist/location.js CHANGED
@@ -1,4 +1,4 @@
1
- import { l } from "./location-Cn1ByVTZ.js";
1
+ import { l } from "./location-C5Ot4MVG.js";
2
2
  export {
3
3
  l as location
4
4
  };
@@ -1,6 +1,6 @@
1
- import { c as g, x as v, a as I, h as M, w as N, d as X, i as j } from "./box-CYXc9-qp.js";
1
+ import { c as g, x as v, a as I, h as M, w as N, d as X, i as j } from "./box-CfhGfJJH.js";
2
2
  import { c as w } from "./direction-CScbfCdT.js";
3
- import { x as B, a as h, b as C, C as O, T as R, s as m, X as S } from "./location-Cn1ByVTZ.js";
3
+ import { x as B, a as h, b as C, C as O, T as R, s as m, X as S } from "./location-C5Ot4MVG.js";
4
4
  import { l as Y } from "./base-DnZzEvvz.js";
5
5
  const P = (t) => {
6
6
  if (t == null) return { x: void 0, y: void 0 };
@@ -1 +1 @@
1
- "use strict";const n=require("./box-BpSX4si6.cjs"),T=require("./direction-D7qoo_GJ.cjs"),r=require("./location-DLP2ZS0o.cjs"),b=require("./base-B48bPNx5.cjs"),P=t=>{if(t==null)return{x:void 0,y:void 0};const s=r.xy.safeParse(t);if(s.success)return s.data;const e=b.location.safeParse(t);return e.success?T.construct(e.data)==="x"?{x:e.data,y:void 0}:{x:void 0,y:e.data}:t},N=({container:t,target:s,dialog:e,initial:u,prefer:a,alignments:l=["start"],disable:f=[]})=>{const i=P(u);let x=r.XY_LOCATIONS;if(a!=null){const o=a.map(c=>P(c));x=x.slice().sort((c,p)=>{const d=o.findIndex(g=>r.xyMatches(c,g)),h=o.findIndex(g=>r.xyMatches(p,g));return d>-1&&h>-1?d-h:d>-1?-1:h>-1?1:0})}const O=x.filter(o=>!r.xyEquals(o,r.CENTER)&&(i.x==null||o.x===i.x)&&(i.y==null||o.y===i.y)&&!f.some(c=>r.xyMatches(o,c))).map(o=>l==null?void 0:l.map(c=>[o,c])).flat(),A=n.construct(t),M=n.construct(s),_=n.construct(e);let E=-1/0;const y={location:r.CENTER,adjustedDialog:_};return O.forEach(([o,c])=>{const[p,d]=v({option:o,alignment:c,container:A,target:M,dialog:_});d>E&&(E=d,y.location=o,y.adjustedDialog=p)}),y},v=({option:t,alignment:s,container:e,target:u,dialog:a})=>{const l=L(t,s),f=n.xyLoc(u,t),i=n.constructWithAlternateRoot(f.x,f.y,n.width(a),n.height(a),l,r.TOP_LEFT),x=n.area(n.intersection(i,e));return[i,x]},I={start:"left",center:"center",end:"right"},j={start:"bottom",center:"center",end:"top"},L=(t,s)=>{const e={x:"center",y:"center"};if(t.y!=="center"){e.y=r.swap(t.y);const u=t.x==="left"?r.swap:a=>a;e.x=u(I[s])}else e.x=r.swap(t.x),e.y=j[s];return e},q=Object.freeze(Object.defineProperty({__proto__:null,dialog:N,getRoot:L,parseLocationOptions:P},Symbol.toStringTag,{value:"Module"}));exports.position=q;
1
+ "use strict";const n=require("./box-BHIyGhI_.cjs"),T=require("./direction-D7qoo_GJ.cjs"),r=require("./location-BIet4Mig.cjs"),b=require("./base-B48bPNx5.cjs"),P=t=>{if(t==null)return{x:void 0,y:void 0};const s=r.xy.safeParse(t);if(s.success)return s.data;const e=b.location.safeParse(t);return e.success?T.construct(e.data)==="x"?{x:e.data,y:void 0}:{x:void 0,y:e.data}:t},N=({container:t,target:s,dialog:e,initial:u,prefer:a,alignments:l=["start"],disable:f=[]})=>{const i=P(u);let x=r.XY_LOCATIONS;if(a!=null){const o=a.map(c=>P(c));x=x.slice().sort((c,p)=>{const d=o.findIndex(g=>r.xyMatches(c,g)),h=o.findIndex(g=>r.xyMatches(p,g));return d>-1&&h>-1?d-h:d>-1?-1:h>-1?1:0})}const O=x.filter(o=>!r.xyEquals(o,r.CENTER)&&(i.x==null||o.x===i.x)&&(i.y==null||o.y===i.y)&&!f.some(c=>r.xyMatches(o,c))).map(o=>l==null?void 0:l.map(c=>[o,c])).flat(),A=n.construct(t),M=n.construct(s),_=n.construct(e);let E=-1/0;const y={location:r.CENTER,adjustedDialog:_};return O.forEach(([o,c])=>{const[p,d]=v({option:o,alignment:c,container:A,target:M,dialog:_});d>E&&(E=d,y.location=o,y.adjustedDialog=p)}),y},v=({option:t,alignment:s,container:e,target:u,dialog:a})=>{const l=L(t,s),f=n.xyLoc(u,t),i=n.constructWithAlternateRoot(f.x,f.y,n.width(a),n.height(a),l,r.TOP_LEFT),x=n.area(n.intersection(i,e));return[i,x]},I={start:"left",center:"center",end:"right"},j={start:"bottom",center:"center",end:"top"},L=(t,s)=>{const e={x:"center",y:"center"};if(t.y!=="center"){e.y=r.swap(t.y);const u=t.x==="left"?r.swap:a=>a;e.x=u(I[s])}else e.x=r.swap(t.x),e.y=j[s];return e},q=Object.freeze(Object.defineProperty({__proto__:null,dialog:N,getRoot:L,parseLocationOptions:P},Symbol.toStringTag,{value:"Module"}));exports.position=q;
package/dist/position.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./position-JCN6-sJC.cjs");exports.position=o.position;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./position-CFiSGTz9.cjs");exports.position=o.position;
package/dist/position.js CHANGED
@@ -1,4 +1,4 @@
1
- import { p as i } from "./position-DJXB-pDS.js";
1
+ import { p as i } from "./position-BXFz7I9G.js";
2
2
  export {
3
3
  i as position
4
4
  };
package/dist/runtime.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./external-B3XSLDq5.cjs");exports.runtime=e.external;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./external-CghVMqCA.cjs");exports.runtime=e.external;
package/dist/runtime.js CHANGED
@@ -1,4 +1,4 @@
1
- import { e as m } from "./external-sVtvYJS6.js";
1
+ import { e as m } from "./external-DKQKvgIi.js";
2
2
  export {
3
3
  m as runtime
4
4
  };
@@ -1 +1 @@
1
- "use strict";var v=Object.defineProperty;var R=(n,t,e)=>t in n?v(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var i=(n,t,e)=>R(n,typeof t!="symbol"?t+"":t,e);const h=require("zod"),x=require("./bounds-DzCDHgdE.cjs"),u=require("./box-BpSX4si6.cjs"),T=require("./location-DLP2ZS0o.cjs"),d=require("./xy-LADI2wVU.cjs"),B=(n,t,e)=>t!==void 0&&n<t?t:e!==void 0&&n>e?e:n,q=h.z.object({offset:d.crudeZ,scale:d.crudeZ}),z=h.z.object({offset:h.z.number(),scale:h.z.number()}),E=n=>(t,e,s,r)=>e==="dimension"?[t,s]:[t,r?s-n:s+n],I=n=>(t,e,s,r)=>[t,r?s/n:s*n],j=n=>(t,e,s)=>{if(t===null)return[n,s];const{lower:r,upper:o}=t,{lower:p,upper:l}=n,w=o-r,m=l-p;if(e==="dimension")return[n,s*(m/w)];const g=(s-r)*(m/w)+p;return[n,g]},Y=n=>(t,e,s)=>[n,s],D=()=>(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)]},L=n=>(t,e,s)=>{const{lower:r,upper:o}=n;return s=B(s,r,o),[t,s]},a=class a{constructor(){i(this,"ops",[]);i(this,"currBounds",null);i(this,"currType",null);i(this,"reversed",!1);this.ops=[]}static translate(t){return new a().translate(t)}static magnify(t){return new a().magnify(t)}static scale(t,e){return new a().scale(t,e)}translate(t){const e=this.new(),s=E(t);return s.type="translate",e.ops.push(s),e}magnify(t){const e=this.new(),s=I(t);return s.type="magnify",e.ops.push(s),e}scale(t,e){const s=x.construct(t,e),r=this.new(),o=j(s);return o.type="scale",r.ops.push(o),r}clamp(t,e){const s=x.construct(t,e),r=this.new(),o=L(s);return o.type="clamp",r.ops.push(o),r}reBound(t,e){const s=x.construct(t,e),r=this.new(),o=Y(s);return o.type="re-bound",r.ops.push(o),r}invert(){const t=D();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 a;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(([p,l])=>r>=p&&r<=l))return;const o=t.ops.findIndex((p,l)=>p.type==="scale"&&l>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)}}};i(a,"IDENTITY",new a);let y=a;const c=class c{constructor(t=new y,e=new y,s=null){i(this,"x");i(this,"y");i(this,"currRoot");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=d.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&&!T.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})}}};i(c,"IDENTITY",new c);let f=c;const M=Object.freeze(Object.defineProperty({__proto__:null,Scale:y,XY:f,crudeXYTransform:q,transform:z},Symbol.toStringTag,{value:"Module"}));exports.clamp=B;exports.scale=M;
1
+ "use strict";var v=Object.defineProperty;var R=(n,t,e)=>t in n?v(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var i=(n,t,e)=>R(n,typeof t!="symbol"?t+"":t,e);const h=require("zod"),x=require("./bounds-8aFLdbEj.cjs"),u=require("./box-BHIyGhI_.cjs"),T=require("./location-BIet4Mig.cjs"),d=require("./xy-LADI2wVU.cjs"),B=(n,t,e)=>t!==void 0&&n<t?t:e!==void 0&&n>e?e:n,q=h.z.object({offset:d.crudeZ,scale:d.crudeZ}),z=h.z.object({offset:h.z.number(),scale:h.z.number()}),E=n=>(t,e,s,r)=>e==="dimension"?[t,s]:[t,r?s-n:s+n],I=n=>(t,e,s,r)=>[t,r?s/n:s*n],j=n=>(t,e,s)=>{if(t===null)return[n,s];const{lower:r,upper:o}=t,{lower:p,upper:l}=n,w=o-r,m=l-p;if(e==="dimension")return[n,s*(m/w)];const g=(s-r)*(m/w)+p;return[n,g]},Y=n=>(t,e,s)=>[n,s],D=()=>(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)]},L=n=>(t,e,s)=>{const{lower:r,upper:o}=n;return s=B(s,r,o),[t,s]},a=class a{constructor(){i(this,"ops",[]);i(this,"currBounds",null);i(this,"currType",null);i(this,"reversed",!1);this.ops=[]}static translate(t){return new a().translate(t)}static magnify(t){return new a().magnify(t)}static scale(t,e){return new a().scale(t,e)}translate(t){const e=this.new(),s=E(t);return s.type="translate",e.ops.push(s),e}magnify(t){const e=this.new(),s=I(t);return s.type="magnify",e.ops.push(s),e}scale(t,e){const s=x.construct(t,e),r=this.new(),o=j(s);return o.type="scale",r.ops.push(o),r}clamp(t,e){const s=x.construct(t,e),r=this.new(),o=L(s);return o.type="clamp",r.ops.push(o),r}reBound(t,e){const s=x.construct(t,e),r=this.new(),o=Y(s);return o.type="re-bound",r.ops.push(o),r}invert(){const t=D();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 a;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(([p,l])=>r>=p&&r<=l))return;const o=t.ops.findIndex((p,l)=>p.type==="scale"&&l>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)}}};i(a,"IDENTITY",new a);let y=a;const c=class c{constructor(t=new y,e=new y,s=null){i(this,"x");i(this,"y");i(this,"currRoot");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=d.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&&!T.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})}}};i(c,"IDENTITY",new c);let f=c;const M=Object.freeze(Object.defineProperty({__proto__:null,Scale:y,XY:f,crudeXYTransform:q,transform:z},Symbol.toStringTag,{value:"Module"}));exports.clamp=B;exports.scale=M;
@@ -2,9 +2,9 @@ var B = Object.defineProperty;
2
2
  var R = (n, t, e) => t in n ? B(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
3
  var i = (n, t, e) => R(n, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { z as y } from "zod";
5
- import { c as h } from "./bounds-CFI9wDXn.js";
6
- import { e as T, f as x, y as f, c as E } from "./box-CYXc9-qp.js";
7
- import { b as I } from "./location-Cn1ByVTZ.js";
5
+ import { c as h } from "./bounds-BtccGJW0.js";
6
+ import { e as T, f as x, y as f, c as E } from "./box-CfhGfJJH.js";
7
+ import { b as I } from "./location-C5Ot4MVG.js";
8
8
  import { b as g, c as j } from "./xy-DQdccWlc.js";
9
9
  const Y = (n, t, e) => t !== void 0 && n < t ? t : e !== void 0 && n > e ? e : n, z = y.object({ offset: g, scale: g }), D = y.object({ offset: y.number(), scale: y.number() }), L = (n) => (t, e, s, r) => e === "dimension" ? [t, s] : [
10
10
  t,
package/dist/scale.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./scale-Dj7-5FQQ.cjs");exports.scale=e.scale;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./scale-BESJN9LG.cjs");exports.scale=e.scale;
package/dist/scale.js CHANGED
@@ -1,4 +1,4 @@
1
- import { s as e } from "./scale-Coub2bPH.js";
1
+ import { s as e } from "./scale-CV3O6tkY.js";
2
2
  export {
3
3
  e as scale
4
4
  };