@synnaxlabs/x 0.31.0 → 0.33.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 (93) hide show
  1. package/.turbo/turbo-build.log +24 -24
  2. package/dist/binary.cjs +1 -1
  3. package/dist/binary.js +1 -1
  4. package/dist/bounds-CCueigU3.js +171 -0
  5. package/dist/bounds-Cudf5M4H.cjs +1 -0
  6. package/dist/bounds.cjs +1 -1
  7. package/dist/bounds.js +1 -1
  8. package/dist/box-CZVdKCOc.cjs +1 -0
  9. package/dist/box-hAkmDC3K.js +201 -0
  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/index-By0n2R_b.cjs +1 -0
  15. package/dist/{index-DgaYJC35.cjs → index-DQZfhLnw.cjs} +1 -1
  16. package/dist/{index-Duv1uH08.js → index-q_1Jz5rY.js} +5 -5
  17. package/dist/{index-B5THJ1eb.js → index-zsix_qnl.js} +1 -1
  18. package/dist/index.cjs +2 -2
  19. package/dist/index.js +212 -178
  20. package/dist/{location-DjcaXEps.js → location-B5rSnQP3.js} +1 -1
  21. package/dist/{location-gPB1RtfA.cjs → location-YGxhLPDy.cjs} +1 -1
  22. package/dist/location.cjs +1 -1
  23. package/dist/location.js +1 -1
  24. package/dist/{position-DkON65EZ.js → position-BZOTg74V.js} +2 -2
  25. package/dist/{position-C71OiHiw.cjs → position-CjNCcq8X.cjs} +1 -1
  26. package/dist/position.cjs +1 -1
  27. package/dist/position.js +1 -1
  28. package/dist/{scale-COPgp55a.cjs → scale-BvbW9p2C.cjs} +1 -1
  29. package/dist/{scale-qw6vRO4s.js → scale-C7_4I3pa.js} +3 -3
  30. package/dist/scale.cjs +1 -1
  31. package/dist/scale.js +1 -1
  32. package/dist/series-BId9slhU.cjs +11 -0
  33. package/dist/{series-B5eA90Ci.js → series-CZw97Bq2.js} +619 -456
  34. package/dist/spatial.cjs +1 -1
  35. package/dist/spatial.js +5 -5
  36. package/dist/src/caseconv/caseconv.d.ts.map +1 -1
  37. package/dist/src/deep/path.d.ts +1 -1
  38. package/dist/src/deep/path.d.ts.map +1 -1
  39. package/dist/src/id/id.d.ts +1 -2
  40. package/dist/src/id/id.d.ts.map +1 -1
  41. package/dist/src/index.d.ts +1 -0
  42. package/dist/src/index.d.ts.map +1 -1
  43. package/dist/src/math/math.d.ts +26 -6
  44. package/dist/src/math/math.d.ts.map +1 -1
  45. package/dist/src/math/math.spec.d.ts +2 -0
  46. package/dist/src/math/math.spec.d.ts.map +1 -0
  47. package/dist/src/migrate/migrate.d.ts +4 -1
  48. package/dist/src/migrate/migrate.d.ts.map +1 -1
  49. package/dist/src/record.d.ts +4 -0
  50. package/dist/src/record.d.ts.map +1 -1
  51. package/dist/src/spatial/bounds/bounds.d.ts +204 -2
  52. package/dist/src/spatial/bounds/bounds.d.ts.map +1 -1
  53. package/dist/src/spatial/box/box.d.ts +4 -4
  54. package/dist/src/spatial/box/box.d.ts.map +1 -1
  55. package/dist/src/strings/index.d.ts +2 -0
  56. package/dist/src/strings/index.d.ts.map +1 -0
  57. package/dist/src/strings/strings.d.ts +32 -0
  58. package/dist/src/strings/strings.d.ts.map +1 -0
  59. package/dist/src/strings/strings.spec.d.ts +2 -0
  60. package/dist/src/strings/strings.spec.d.ts.map +1 -0
  61. package/dist/src/telem/series.d.ts +35 -10
  62. package/dist/src/telem/series.d.ts.map +1 -1
  63. package/dist/src/telem/telem.d.ts +12 -10
  64. package/dist/src/telem/telem.d.ts.map +1 -1
  65. package/dist/telem.cjs +1 -1
  66. package/dist/telem.js +1 -1
  67. package/package.json +9 -9
  68. package/src/caseconv/caseconv.ts +1 -0
  69. package/src/deep/path.ts +1 -1
  70. package/src/id/id.ts +2 -2
  71. package/src/index.ts +1 -0
  72. package/src/math/math.spec.ts +149 -0
  73. package/src/math/math.ts +60 -9
  74. package/src/migrate/migrate.ts +23 -4
  75. package/src/record.ts +5 -0
  76. package/src/spatial/bounds/bounds.spec.ts +135 -270
  77. package/src/spatial/bounds/bounds.ts +290 -25
  78. package/src/spatial/box/box.ts +9 -5
  79. package/src/strings/index.ts +10 -0
  80. package/src/strings/strings.spec.ts +68 -0
  81. package/src/strings/strings.ts +87 -0
  82. package/src/telem/series.spec.ts +235 -0
  83. package/src/telem/series.ts +271 -52
  84. package/src/telem/telem.spec.ts +22 -0
  85. package/src/telem/telem.ts +44 -20
  86. package/src/zodutil/zodutil.spec.ts +5 -7
  87. package/tsconfig.tsbuildinfo +1 -1
  88. package/dist/bounds-CpboA0q6.js +0 -127
  89. package/dist/bounds-ZZc1c-_Z.cjs +0 -1
  90. package/dist/box-BQID-0jO.cjs +0 -1
  91. package/dist/box-xRqO6NvI.js +0 -202
  92. package/dist/index-xk130iQA.cjs +0 -1
  93. package/dist/series-CJ65b1Uz.cjs +0 -11
package/dist/index.js CHANGED
@@ -1,212 +1,246 @@
1
- var T = Object.defineProperty;
2
- var $ = (r, o, e) => o in r ? T(r, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[o] = e;
3
- var m = (r, o, e) => $(r, typeof o != "symbol" ? o + "" : o, e);
4
- import { e as I } from "./index-B5THJ1eb.js";
5
- import { a as F } from "./index-Duv1uH08.js";
6
- import { c as X } from "./change-DLl6DccR.js";
7
- import { c as rr, s as er } from "./scale-qw6vRO4s.js";
8
- import { L as b, G as y, E as k, i as w, a as j, b as A } from "./index-B3BUDIdi.js";
9
- import { c as tr, d as nr, p as sr } from "./index-B3BUDIdi.js";
10
- import { z as i } from "zod";
11
- import { debounce as ar, throttle as cr } from "./debounce.js";
12
- import { deep as fr } from "./deep.js";
13
- import { d as mr, D as pr, M as gr, R as dr, S as xr, e as br, c as yr, b as Sr, T as hr, a as vr, g as Er, h as Mr, i as Tr, f as $r, t as kr } from "./series-B5eA90Ci.js";
14
- import { isObject as jr } from "./identity.js";
15
- import { t as Or } from "./types-BpAJW2TM.js";
16
- import { b as zr, m as Nr } from "./bounds-CpboA0q6.js";
17
- import { observe as Lr } from "./observe.js";
18
- import { getEntries as Vr, unknownRecordZ as Dr } from "./record.js";
19
- import { e as _r } from "./external-CO221aaF.js";
20
- import { Search as Cr } from "./search.js";
21
- import { b as Br } from "./box-xRqO6NvI.js";
22
- import { d as Qr } from "./dimensions-D-1PnJVI.js";
23
- import { d as Ir } from "./direction-CScbfCdT.js";
24
- import { l as Fr } from "./location-DjcaXEps.js";
25
- import { p as Xr } from "./position-DkON65EZ.js";
26
- import { s as re } from "./spatial-DozyssiN.js";
27
- import { x as oe } from "./xy-CrgPnICw.js";
28
- import { nullToArr as ne, toArray as se } from "./toArray.js";
29
- import { unique as ae } from "./unique.js";
30
- import { URL as le, buildQueryString as fe } from "./url.js";
31
- import { RoutedWorker as me, TypedWorker as pe, createMockWorkers as ge } from "./worker.js";
32
- import { z as xe } from "./zodutil-qNM8aVYC.js";
33
- const a = class a extends Number {
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;
3
+ var p = (e, t, r) => T(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { e as X } from "./index-zsix_qnl.js";
5
+ import { a as ee } from "./index-q_1Jz5rY.js";
6
+ import { c as te } from "./change-DLl6DccR.js";
7
+ import { c as ne, s as se } from "./scale-C7_4I3pa.js";
8
+ import { L as S, G as y, E as w, i as A, a as k, b as O } from "./index-B3BUDIdi.js";
9
+ import { c as ae, d as ce, p as le } from "./index-B3BUDIdi.js";
10
+ 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 ve, c as $e, 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-CZw97Bq2.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-CCueigU3.js";
17
+ import { observe as De } from "./observe.js";
18
+ import { getEntries as Ie, unknownRecordZ as Ve } from "./record.js";
19
+ import { e as qe } from "./external-CO221aaF.js";
20
+ import { Search as He } from "./search.js";
21
+ import { b as Ue } from "./box-hAkmDC3K.js";
22
+ import { d as Ke } from "./dimensions-D-1PnJVI.js";
23
+ import { d as Xe } from "./direction-CScbfCdT.js";
24
+ import { l as er } from "./location-B5rSnQP3.js";
25
+ import { p as tr } from "./position-BZOTg74V.js";
26
+ import { s as nr } from "./spatial-DozyssiN.js";
27
+ import { x as ir } from "./xy-CrgPnICw.js";
28
+ import { nullToArr as cr, toArray as lr } from "./toArray.js";
29
+ import { unique as ur } from "./unique.js";
30
+ import { URL as dr, buildQueryString as pr } from "./url.js";
31
+ import { RoutedWorker as br, TypedWorker as hr, createMockWorkers as xr } from "./worker.js";
32
+ import { z as yr } from "./zodutil-qNM8aVYC.js";
33
+ const l = class l extends Number {
34
34
  };
35
- m(a, "Absolute", 255), m(a, "Default", 1), m(a, "z", i.union([
36
- i.instanceof(a),
37
- i.number().int().min(0).max(255).transform((o) => new a(o)),
38
- i.instanceof(Number).transform((o) => new a(o))
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))
39
39
  ]));
40
- let x = a;
41
- const v = i.object({
42
- name: i.string(),
43
- key: i.string()
44
- }), O = (r) => i.object({
45
- subject: v,
46
- resource: r,
47
- authority: x.z
48
- }), R = (...r) => (o) => o.filter((e) => {
49
- let t = !1;
50
- return e.to != null && (t = r.includes(e.to.resource)), e.from != null && !t && (t = r.includes(e.from.resource)), t;
51
- }), _ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
40
+ let h = l;
41
+ const E = c.object({
42
+ name: c.string(),
43
+ key: c.string()
44
+ }), L = (e) => c.object({
45
+ subject: E,
46
+ resource: e,
47
+ authority: h.z
48
+ }), _ = (...e) => (t) => t.filter((r) => {
49
+ let n = !1;
50
+ 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({
52
52
  __proto__: null,
53
- Authority: x,
54
- filterTransfersByChannelKey: R,
55
- stateZ: O,
56
- subjectZ: v
57
- }, Symbol.toStringTag, { value: "Module" })), c = class c extends Error {
53
+ Authority: h,
54
+ filterTransfersByChannelKey: _,
55
+ stateZ: L,
56
+ subjectZ: E
57
+ }, Symbol.toStringTag, { value: "Module" })), m = class m extends Error {
58
58
  constructor() {
59
- super(c.MESSAGE);
59
+ super(m.MESSAGE);
60
60
  }
61
61
  /** Returns true if the error or message is a cancellation error" */
62
- matches(o) {
63
- return typeof o == "string" ? o.includes(c.MESSAGE) : o instanceof c || o.message.includes(c.MESSAGE);
62
+ matches(t) {
63
+ return typeof t == "string" ? t.includes(m.MESSAGE) : t instanceof m || t.message.includes(m.MESSAGE);
64
64
  }
65
65
  };
66
- m(c, "MESSAGE", "canceled");
67
- let S = c;
68
- const z = new S(), q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
66
+ p(m, "MESSAGE", "canceled");
67
+ let v = m;
68
+ const z = new v(), q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
69
69
  __proto__: null,
70
70
  CANCELED: z
71
- }, Symbol.toStringTag, { value: "Module" })), C = (r) => r ? -1 : 1, h = i.string().regex(/^\d+\.\d+\.\d+$/), p = (r, o, e = {}) => {
72
- e.checkMajor ?? (e.checkMajor = !0), e.checkMinor ?? (e.checkMinor = !0), e.checkPatch ?? (e.checkPatch = !0);
73
- const t = h.parse(r), l = h.parse(o), [g, f, u] = t.split(".").map(Number), [n, s, d] = l.split(".").map(Number);
74
- if (e.checkMajor) {
75
- if (g < n) return b;
76
- if (g > n) return y;
77
- }
78
- if (e.checkMinor) {
79
- if (f < s) return b;
71
+ }, Symbol.toStringTag, { value: "Module" })), B = (e) => e ? -1 : 1, $ = c.string().regex(/^\d+\.\d+\.\d+$/), g = (e, t, r = {}) => {
72
+ r.checkMajor ?? (r.checkMajor = !0), r.checkMinor ?? (r.checkMinor = !0), r.checkPatch ?? (r.checkPatch = !0);
73
+ const n = $.parse(e), i = $.parse(t), [f, u, d] = n.split(".").map(Number), [s, o, a] = i.split(".").map(Number);
74
+ if (r.checkMajor) {
75
+ if (f < s) return S;
80
76
  if (f > s) return y;
81
77
  }
82
- if (e.checkPatch) {
83
- if (u < d) return b;
84
- if (u > d) return y;
78
+ if (r.checkMinor) {
79
+ if (u < o) return S;
80
+ if (u > o) return y;
81
+ }
82
+ if (r.checkPatch) {
83
+ if (d < a) return S;
84
+ if (d > a) return y;
85
85
  }
86
- return k;
87
- }, N = (r, o, e = {}) => w(p(r, o, e)), E = (r, o, e = {}) => j(p(r, o, e)), G = (r, o, e = {}) => A(p(r, o, e)), L = ({
88
- name: r,
89
- migrate: o
90
- }) => (e) => {
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 = ({
88
+ name: e,
89
+ migrate: t
90
+ }) => (r) => {
91
91
  try {
92
- const t = o(e);
93
- return console.log(`${r} migrated: ${e.version} -> ${t.version}`), t;
94
- } catch (t) {
95
- throw console.log(`${r} failed to migrate from ${e.version}`), console.error(t), t;
92
+ const n = t(r);
93
+ return console.log(`${e} migrated: ${r.version} -> ${n.version}`), n;
94
+ } catch (n) {
95
+ throw console.log(`${e} failed to migrate from ${r.version}`), console.error(n), n;
96
96
  }
97
- }, P = ({
98
- name: r,
99
- migrations: o,
100
- targetSchema: e,
101
- def: t
97
+ }, G = ({
98
+ name: e,
99
+ migrations: t,
100
+ targetSchema: r,
101
+ defaultVersion: n,
102
+ def: i
102
103
  }) => {
103
- const l = Object.keys(o).sort(p).pop();
104
- if (l == null)
105
- return (n) => {
106
- if (n.version !== t.version)
104
+ const f = Object.keys(t).sort(g).pop();
105
+ if (f == null)
106
+ return (o) => {
107
+ if (o.version == null && (o.version = n), o.version !== i.version)
107
108
  return console.log(
108
- `${r} version ${n.version} is newer than latest version of ${t.version}.
109
+ `${e} version ${o.version} is newer than latest version of ${i.version}.
109
110
  Returning default instead.
110
111
  `
111
- ), t;
112
+ ), i;
112
113
  try {
113
- return e != null ? e.parse(n) : n;
114
- } catch (s) {
115
- return console.log(`${r} failed to parse default. Exiting with default`), console.error(s), t;
114
+ return r != null ? r.parse(o) : o;
115
+ } catch (a) {
116
+ return console.log(`${e} failed to parse default. Exiting with default`), console.error(a), i;
116
117
  }
117
118
  };
118
- const g = Object.keys(o).length;
119
- let f = !1;
120
- const u = (n) => {
119
+ const u = Object.keys(t).length;
120
+ let d = !1;
121
+ const s = (o) => {
121
122
  try {
122
- if (g === 0 || E(n.version, l))
123
- return console.log(f ? `${r} ${n.version} now up to date` : `${r} version ${n.version} is up to date with target version ${t.version}`), n;
124
- const s = n.version, d = o[s], M = d(n);
125
- return f = !0, u(M);
126
- } catch (s) {
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);
127
+ } catch (a) {
127
128
  return console.log(
128
- `${r} failed to migrate from ${n.version} to ${l}`
129
- ), console.error(s), t;
129
+ `${e} failed to migrate from ${o.version} to ${f}`
130
+ ), console.error(a), i;
130
131
  }
131
132
  };
132
- return (n) => {
133
+ return (o) => {
133
134
  try {
134
- return u(n);
135
- } catch (s) {
136
- return console.log(`${r} failed to parse final result. Exiting with default`), console.error(s), t;
135
+ if (o.version == null)
136
+ if (n != null)
137
+ console.log(
138
+ `${e} version is null. Setting version to default of ${n}`
139
+ ), o.version = n;
140
+ else
141
+ return console.log(
142
+ `${e} version is null and no default version set. Exiting with default`
143
+ ), i;
144
+ return s(o);
145
+ } catch (a) {
146
+ return console.log(`${e} failed to parse final result. Exiting with default`), console.error(a), i;
137
147
  }
138
148
  };
139
- }, W = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
149
+ }, H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
140
150
  __proto__: null,
141
- compareSemVer: p,
142
- createMigration: L,
143
- migrator: P,
144
- semVerNewer: E,
145
- semVerOlder: G,
146
- semVerZ: h,
151
+ compareSemVer: g,
152
+ createMigration: P,
153
+ migrator: G,
154
+ semVerNewer: M,
155
+ semVerOlder: R,
156
+ semVerZ: $,
147
157
  versionsEqual: N
148
- }, Symbol.toStringTag, { value: "Module" })), B = (r) => {
149
- if (r === void 0 || typeof r == "string" || typeof r == "number")
150
- return r;
151
- if (r.toString === void 0) throw new Error("invalid renderer");
152
- return r.toString();
153
- }, H = (r) => Array.isArray(r) ? [...r] : typeof r == "object" && r !== null ? { ...r } : r;
158
+ }, Symbol.toStringTag, { value: "Module" })), Q = (e) => {
159
+ if (e === void 0 || typeof e == "string" || typeof e == "number")
160
+ return e;
161
+ if (e.toString === void 0) throw new Error("invalid renderer");
162
+ return e.toString();
163
+ }, U = (e) => Array.isArray(e) ? [...e] : typeof e == "object" && e !== null ? { ...e } : e, C = (e, t = "") => {
164
+ const r = e.length;
165
+ 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("");
168
+ 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("");
173
+ r.add(a), r.add(a.replace(/(.)(.)/g, "$1_$2"));
174
+ }
175
+ });
176
+ const u = t.map(
177
+ (s) => (s.length > 3 ? s.substring(0, 3) : s).toLowerCase()
178
+ );
179
+ return r.add(u.join("")), r.add(u.join("_")), Array.from(r).filter(
180
+ (s) => s.length >= 2 && s.length <= 12
181
+ );
182
+ }, J = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
183
+ __proto__: null,
184
+ generateShortIdentifiers: D,
185
+ naturalLanguageJoin: C
186
+ }, Symbol.toStringTag, { value: "Module" }));
154
187
  export {
155
- mr as DataType,
156
- pr as Density,
157
- gr as MultiSeries,
158
- dr as Rate,
159
- me as RoutedWorker,
160
- Cr as Search,
161
- xr as Series,
162
- br as Size,
163
- yr as TimeRange,
164
- Sr as TimeSpan,
165
- hr as TimeStamp,
166
- pe as TypedWorker,
167
- le as URL,
168
- vr as addSamples,
169
- I as binary,
170
- zr as bounds,
171
- Br as box,
172
- fe as buildQueryString,
173
- F as caseconv,
174
- X as change,
175
- rr as clamp,
176
- tr as compare,
177
- _ as control,
178
- Er as convertDataType,
179
- B as convertRenderV,
180
- ge as createMockWorkers,
181
- ar as debounce,
182
- fr as deep,
183
- Qr as dimensions,
184
- Ir as direction,
188
+ be as DataType,
189
+ he as Density,
190
+ xe as MultiSeries,
191
+ Se as Rate,
192
+ br as RoutedWorker,
193
+ He as Search,
194
+ ye as Series,
195
+ ve as Size,
196
+ $e as TimeRange,
197
+ Ee as TimeSpan,
198
+ Me as TimeStamp,
199
+ hr as TypedWorker,
200
+ dr as URL,
201
+ je as addSamples,
202
+ X as binary,
203
+ Pe as bounds,
204
+ Ue as box,
205
+ pr 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
+ xr as createMockWorkers,
214
+ ue as debounce,
215
+ pe as deep,
216
+ Ke as dimensions,
217
+ Xe as direction,
185
218
  q as errors,
186
- Vr as getEntries,
187
- Mr as id,
188
- C as invert,
189
- Tr as isCrudeSeries,
190
- jr as isObject,
191
- nr as isStringer,
192
- $r as isTelemValue,
193
- Or as kv,
194
- Fr as location,
195
- Nr as math,
196
- W as migrate,
197
- ne as nullToArr,
198
- Lr as observe,
199
- Xr as position,
200
- sr as primitiveIsZero,
201
- _r as runtime,
202
- er as scale,
203
- H as shallowCopy,
204
- re as spatial,
205
- cr as throttle,
206
- se as toArray,
207
- kr as typedArrayZ,
208
- ae as unique,
209
- Dr as unknownRecordZ,
210
- oe as xy,
211
- xe as zodutil
219
+ Ie 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
+ er as location,
228
+ Ge as math,
229
+ H as migrate,
230
+ cr as nullToArr,
231
+ De as observe,
232
+ tr as position,
233
+ le as primitiveIsZero,
234
+ qe as runtime,
235
+ se as scale,
236
+ U as shallowCopy,
237
+ nr as spatial,
238
+ J as strings,
239
+ me as throttle,
240
+ lr as toArray,
241
+ Oe as typedArrayZ,
242
+ ur as unique,
243
+ Ve as unknownRecordZ,
244
+ ir as xy,
245
+ yr as zodutil
212
246
  };
@@ -1,5 +1,5 @@
1
1
  import { z as O } from "zod";
2
- import { c as m } from "./index-Duv1uH08.js";
2
+ import { c as m } from "./index-q_1Jz5rY.js";
3
3
  import { e as f, f as x, y as a, 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 = f, R = a, I = {
5
5
  top: "bottom",
@@ -1 +1 @@
1
- "use strict";const u=require("zod"),I=require("./index-xk130iQA.cjs"),c=require("./base-B48bPNx5.cjs"),R=c.xLocation,g=c.yLocation,h={top:"bottom",right:"left",bottom:"top",left:"right",center:"center"},d={top:"left",right:"top",bottom:"right",left:"bottom",center:"center"},m=c.crudeLocation,s=t=>t instanceof String?t:c.DIRECTIONS.includes(t)?t==="x"?"left":"top":t,_=t=>h[s(t)],A=t=>d[s(t)],i=t=>{const o=s(t);return o==="top"||o==="bottom"?"y":"x"},l=u.z.object({x:c.xLocation.or(c.centerLocation),y:c.yLocation.or(c.centerLocation)}),E=u.z.object({x:c.xLocation,y:c.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,o)=>t.x===o.x&&t.y===o.y,S=(t,o)=>{if(typeof o=="object"){let e=!0;return"x"in o&&(t.x===o.x||(e=!1)),"y"in o&&(t.y===o.y||(e=!1)),e}return t.x===o||t.y===o},z=t=>[t.x,t.y],y=t=>i(s(t))==="x",M=t=>i(s(t))==="y",P=t=>`${t.x}${I.capitalize(t.y)}`,X=(t,o)=>{let e,n;if(typeof t=="object"&&"x"in t?(e=t.x,n=t.y):(e=s(t),n=s(o??t)),i(e)===i(n)&&e!=="center"&&n!=="center")throw new Error(`[XYLocation] - encountered two locations with the same direction: ${e.toString()} - ${n.toString()}`);const r={...T};return e==="center"?y(n)?[r.x,r.y]=[n,e]:[r.x,r.y]=[e,n]:n==="center"?y(e)?[r.x,r.y]=[e,n]:[r.x,r.y]=[n,e]:y(e)?[r.x,r.y]=[e,n]:[r.x,r.y]=[n,e],r},Y=Object.freeze(Object.defineProperty({__proto__:null,BOTTOM_CENTER:L,BOTTOM_LEFT:x,BOTTOM_RIGHT:a,CENTER:T,CENTER_LOCATIONS:c.CENTER_LOCATIONS,LEFT_CENTER:C,RIGHT_CENTER:p,TOP_CENTER:b,TOP_LEFT:O,TOP_RIGHT:f,XY_LOCATIONS:N,X_LOCATIONS:c.X_LOCATIONS,Y_LOCATIONS:c.Y_LOCATIONS,construct:s,constructXY:X,corner:E,crude:m,direction:i,isX:y,isY:M,location:c.location,outer:c.outerLocation,rotate90:A,swap:_,x:R,xy:l,xyCouple:z,xyEquals:j,xyMatches:S,xyToString:P,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=E;exports.location=Y;exports.swap=_;exports.xy=l;exports.xyCouple=z;exports.xyEquals=j;exports.xyMatches=S;
1
+ "use strict";const u=require("zod"),I=require("./index-By0n2R_b.cjs"),c=require("./base-B48bPNx5.cjs"),R=c.xLocation,g=c.yLocation,h={top:"bottom",right:"left",bottom:"top",left:"right",center:"center"},d={top:"left",right:"top",bottom:"right",left:"bottom",center:"center"},m=c.crudeLocation,s=t=>t instanceof String?t:c.DIRECTIONS.includes(t)?t==="x"?"left":"top":t,_=t=>h[s(t)],A=t=>d[s(t)],i=t=>{const o=s(t);return o==="top"||o==="bottom"?"y":"x"},l=u.z.object({x:c.xLocation.or(c.centerLocation),y:c.yLocation.or(c.centerLocation)}),E=u.z.object({x:c.xLocation,y:c.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,o)=>t.x===o.x&&t.y===o.y,S=(t,o)=>{if(typeof o=="object"){let e=!0;return"x"in o&&(t.x===o.x||(e=!1)),"y"in o&&(t.y===o.y||(e=!1)),e}return t.x===o||t.y===o},z=t=>[t.x,t.y],y=t=>i(s(t))==="x",M=t=>i(s(t))==="y",P=t=>`${t.x}${I.capitalize(t.y)}`,X=(t,o)=>{let e,n;if(typeof t=="object"&&"x"in t?(e=t.x,n=t.y):(e=s(t),n=s(o??t)),i(e)===i(n)&&e!=="center"&&n!=="center")throw new Error(`[XYLocation] - encountered two locations with the same direction: ${e.toString()} - ${n.toString()}`);const r={...T};return e==="center"?y(n)?[r.x,r.y]=[n,e]:[r.x,r.y]=[e,n]:n==="center"?y(e)?[r.x,r.y]=[e,n]:[r.x,r.y]=[n,e]:y(e)?[r.x,r.y]=[e,n]:[r.x,r.y]=[n,e],r},Y=Object.freeze(Object.defineProperty({__proto__:null,BOTTOM_CENTER:L,BOTTOM_LEFT:x,BOTTOM_RIGHT:a,CENTER:T,CENTER_LOCATIONS:c.CENTER_LOCATIONS,LEFT_CENTER:C,RIGHT_CENTER:p,TOP_CENTER:b,TOP_LEFT:O,TOP_RIGHT:f,XY_LOCATIONS:N,X_LOCATIONS:c.X_LOCATIONS,Y_LOCATIONS:c.Y_LOCATIONS,construct:s,constructXY:X,corner:E,crude:m,direction:i,isX:y,isY:M,location:c.location,outer:c.outerLocation,rotate90:A,swap:_,x:R,xy:l,xyCouple:z,xyEquals:j,xyMatches:S,xyToString:P,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=E;exports.location=Y;exports.swap=_;exports.xy=l;exports.xyCouple=z;exports.xyEquals=j;exports.xyMatches=S;
package/dist/location.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./location-gPB1RtfA.cjs");exports.location=o.location;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./location-YGxhLPDy.cjs");exports.location=o.location;
package/dist/location.js CHANGED
@@ -1,4 +1,4 @@
1
- import { l } from "./location-DjcaXEps.js";
1
+ import { l } from "./location-B5rSnQP3.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-xRqO6NvI.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-hAkmDC3K.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-DjcaXEps.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-B5rSnQP3.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-BQID-0jO.cjs"),T=require("./direction-DZbN47uL.cjs"),r=require("./location-gPB1RtfA.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-CZVdKCOc.cjs"),T=require("./direction-DZbN47uL.cjs"),r=require("./location-YGxhLPDy.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-C71OiHiw.cjs");exports.position=o.position;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./position-CjNCcq8X.cjs");exports.position=o.position;
package/dist/position.js CHANGED
@@ -1,4 +1,4 @@
1
- import { p as i } from "./position-DkON65EZ.js";
1
+ import { p as i } from "./position-BZOTg74V.js";
2
2
  export {
3
3
  i as position
4
4
  };
@@ -1 +1 @@
1
- "use strict";var v=Object.defineProperty;var g=(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)=>g(n,typeof t!="symbol"?t+"":t,e);const R=require("zod"),x=require("./bounds-ZZc1c-_Z.cjs"),u=require("./box-BQID-0jO.cjs"),T=require("./location-gPB1RtfA.cjs"),h=require("./xy-cP-FXJtR.cjs"),m=(n,t,e)=>t!==void 0&&n<t?t:e!==void 0&&n>e?e:n,q=R.z.object({offset:h.crudeZ,scale:h.crudeZ}),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],Y=n=>(t,e,s)=>{if(t===null)return[n,s];const{lower:r,upper:o}=t,{lower:p,upper:l}=n,f=o-r,w=l-p;if(e==="dimension")return[n,s*(w/f)];const B=(s-r)*(w/f)+p;return[n,B]},j=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)]},D=n=>(t,e,s)=>{const{lower:r,upper:o}=n;return s=m(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=Y(s);return o.type="scale",r.ops.push(o),r}clamp(t,e){const s=x.construct(t,e),r=this.new(),o=D(s);return o.type="clamp",r.ops.push(o),r}reBound(t,e){const s=x.construct(t,e),r=this.new(),o=j(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 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}};i(a,"IDENTITY",new a);let y=a;const L=n=>({scale:{x:n.x.dim(1),y:n.y.dim(1)},offset:{x:n.x.pos(0),y:n.y.pos(0)}}),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=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&&!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)}}box(t){return u.construct(this.pos(t.one),this.pos(t.two),0,0,this.currRoot??t.root)}};i(c,"IDENTITY",new c);let d=c;const M=Object.freeze(Object.defineProperty({__proto__:null,Scale:y,XY:d,crudeXYTransform:q,xyScaleToTransform:L},Symbol.toStringTag,{value:"Module"}));exports.clamp=m;exports.scale=M;
1
+ "use strict";var v=Object.defineProperty;var g=(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)=>g(n,typeof t!="symbol"?t+"":t,e);const R=require("zod"),x=require("./bounds-Cudf5M4H.cjs"),u=require("./box-CZVdKCOc.cjs"),T=require("./location-YGxhLPDy.cjs"),h=require("./xy-cP-FXJtR.cjs"),m=(n,t,e)=>t!==void 0&&n<t?t:e!==void 0&&n>e?e:n,q=R.z.object({offset:h.crudeZ,scale:h.crudeZ}),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],Y=n=>(t,e,s)=>{if(t===null)return[n,s];const{lower:r,upper:o}=t,{lower:p,upper:l}=n,f=o-r,w=l-p;if(e==="dimension")return[n,s*(w/f)];const B=(s-r)*(w/f)+p;return[n,B]},j=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)]},D=n=>(t,e,s)=>{const{lower:r,upper:o}=n;return s=m(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=Y(s);return o.type="scale",r.ops.push(o),r}clamp(t,e){const s=x.construct(t,e),r=this.new(),o=D(s);return o.type="clamp",r.ops.push(o),r}reBound(t,e){const s=x.construct(t,e),r=this.new(),o=j(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 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}};i(a,"IDENTITY",new a);let y=a;const L=n=>({scale:{x:n.x.dim(1),y:n.y.dim(1)},offset:{x:n.x.pos(0),y:n.y.pos(0)}}),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=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&&!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)}}box(t){return u.construct(this.pos(t.one),this.pos(t.two),0,0,this.currRoot??t.root)}};i(c,"IDENTITY",new c);let d=c;const M=Object.freeze(Object.defineProperty({__proto__:null,Scale:y,XY:d,crudeXYTransform:q,xyScaleToTransform:L},Symbol.toStringTag,{value:"Module"}));exports.clamp=m;exports.scale=M;
@@ -2,9 +2,9 @@ var g = Object.defineProperty;
2
2
  var B = (r, t, e) => t in r ? g(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
3
  var i = (r, t, e) => B(r, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { z as R } from "zod";
5
- import { c as l } from "./bounds-CpboA0q6.js";
6
- import { e as T, f as x, y as h, c as E } from "./box-xRqO6NvI.js";
7
- import { b as I } from "./location-DjcaXEps.js";
5
+ import { c as l } from "./bounds-CCueigU3.js";
6
+ import { e as T, f as x, y as h, c as E } from "./box-hAkmDC3K.js";
7
+ import { b as I } from "./location-B5rSnQP3.js";
8
8
  import { b as w, c as Y } from "./xy-CrgPnICw.js";
9
9
  const j = (r, t, e) => t !== void 0 && r < t ? t : e !== void 0 && r > e ? e : r, z = R.object({ offset: w, scale: w }), D = (r) => (t, e, s, n) => 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-COPgp55a.cjs");exports.scale=e.scale;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./scale-BvbW9p2C.cjs");exports.scale=e.scale;
package/dist/scale.js CHANGED
@@ -1,4 +1,4 @@
1
- import { s as e } from "./scale-qw6vRO4s.js";
1
+ import { s as e } from "./scale-C7_4I3pa.js";
2
2
  export {
3
3
  e as scale
4
4
  };