@synnaxlabs/x 0.44.0 → 0.44.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/.turbo/turbo-build.log +24 -24
  2. package/dist/box-CO_2_DGG.js +209 -0
  3. package/dist/box-Cxki783Y.cjs +1 -0
  4. package/dist/box.cjs +1 -1
  5. package/dist/box.js +1 -1
  6. package/dist/compare.cjs +1 -1
  7. package/dist/compare.js +1 -1
  8. package/dist/deep.cjs +1 -1
  9. package/dist/deep.js +56 -46
  10. package/dist/{external-BFgJjMcS.js → external-Birv9jaY.js} +1 -1
  11. package/dist/{external-mffsMzJx.cjs → external-DsmsSN1Y.cjs} +1 -1
  12. package/dist/{index-PNh31WTW.js → index-CBMHFqs4.js} +34 -33
  13. package/dist/index-DOJlZHqJ.cjs +1 -0
  14. package/dist/index.cjs +1 -1
  15. package/dist/index.js +9 -9
  16. package/dist/path-BeMr8xWN.cjs +1 -0
  17. package/dist/path-DVFrKaNI.js +107 -0
  18. package/dist/{position-DAL0Qqdf.cjs → position-DSy2hONH.cjs} +1 -1
  19. package/dist/{position-bA6pUwLn.js → position-PQ6op54I.js} +1 -1
  20. package/dist/position.cjs +1 -1
  21. package/dist/position.js +1 -1
  22. package/dist/{scale-Bzn1Cl0r.cjs → scale-C6qKDbRb.cjs} +1 -1
  23. package/dist/{scale-CdTNWu-d.js → scale-EWNUk-bn.js} +2 -2
  24. package/dist/scale.cjs +1 -1
  25. package/dist/scale.js +1 -1
  26. package/dist/{series-anlpaR_I.cjs → series-CcA_WjbJ.cjs} +1 -1
  27. package/dist/{series-BeJyqCoP.js → series-EA1uaEDj.js} +4 -4
  28. package/dist/spatial.cjs +1 -1
  29. package/dist/spatial.js +4 -4
  30. package/dist/src/deep/copy.d.ts.map +1 -1
  31. package/dist/src/deep/path.d.ts +1 -0
  32. package/dist/src/deep/path.d.ts.map +1 -1
  33. package/dist/src/observe/observe.d.ts +1 -0
  34. package/dist/src/observe/observe.d.ts.map +1 -1
  35. package/dist/src/primitive/primitive.d.ts +13 -1
  36. package/dist/src/primitive/primitive.d.ts.map +1 -1
  37. package/dist/src/spatial/box/box.d.ts +1 -0
  38. package/dist/src/spatial/box/box.d.ts.map +1 -1
  39. package/dist/src/spatial/xy/xy.d.ts +1 -0
  40. package/dist/src/spatial/xy/xy.d.ts.map +1 -1
  41. package/dist/telem.cjs +1 -1
  42. package/dist/telem.js +1 -1
  43. package/dist/xy-CUE3QDNn.cjs +1 -0
  44. package/dist/{xy-D_LqxaGt.js → xy-C_-hb3Q2.js} +27 -22
  45. package/dist/xy.cjs +1 -1
  46. package/dist/xy.js +1 -1
  47. package/dist/zod.cjs +1 -1
  48. package/dist/zod.js +1 -1
  49. package/package.json +3 -3
  50. package/src/deep/copy.ts +12 -1
  51. package/src/deep/path.spec.ts +27 -0
  52. package/src/deep/path.ts +10 -0
  53. package/src/observe/observe.ts +2 -0
  54. package/src/primitive/primitive.spec.ts +7 -4
  55. package/src/primitive/primitive.ts +17 -1
  56. package/src/spatial/box/box.ts +5 -0
  57. package/src/spatial/xy/xy.ts +5 -0
  58. package/src/testutil/testutil.spec.ts +6 -3
  59. package/tsconfig.tsbuildinfo +1 -1
  60. package/dist/box-BcGdqkt4.cjs +0 -1
  61. package/dist/box-D_qdUyEe.js +0 -205
  62. package/dist/index-B1m2qvBT.cjs +0 -1
  63. package/dist/path-BXdMenka.js +0 -101
  64. package/dist/path-st_E5-LJ.cjs +0 -1
  65. package/dist/xy-B7065J2S.cjs +0 -1
@@ -1 +0,0 @@
1
- "use strict";const u=require("zod"),R=require("./direction-386XDm2w.cjs"),x=require("./location-DZi8ftXp.cjs"),i=require("./xy-B7065J2S.cjs"),m=require("./base-BAM2mqCy.cjs"),p=u.z.union([u.z.number(),u.z.string()]),H=u.z.object({top:p,left:p,width:p,height:p}),W=u.z.object({left:u.z.number(),top:u.z.number(),right:u.z.number(),bottom:u.z.number()}),S=u.z.object({one:m.xy,two:m.xy,root:x.corner}),B={one:i.ZERO,two:i.ZERO,root:x.TOP_LEFT},v={one:i.ZERO,two:i.ONE,root:x.BOTTOM_LEFT},C=(t,o)=>({one:t.one,two:t.two,root:o??t.root}),c=(t,o,e=0,n=0,s)=>{const r={one:{...i.ZERO},two:{...i.ZERO},root:s??x.TOP_LEFT};if(typeof t=="number"){if(typeof o!="number")throw new Error("Box constructor called with invalid arguments");return r.one={x:t,y:o},r.two={x:r.one.x+e,y:r.one.y+n},r}return"one"in t&&"two"in t&&"root"in t?{...t,root:s??t.root}:("getBoundingClientRect"in t&&(t=t.getBoundingClientRect()),"left"in t?(r.one={x:t.left,y:t.top},r.two={x:t.right,y:t.bottom},r):(r.one=t,o==null?r.two={x:r.one.x+e,y:r.one.y+n}:typeof o=="number"?r.two={x:r.one.x+o,y:r.one.y+e}:"width"in o?r.two={x:r.one.x+o.width,y:r.one.y+o.height}:"signedWidth"in o?r.two={x:r.one.x+o.signedWidth,y:r.one.y+o.signedHeight}:r.two=o,r))},G=(t,o,e)=>{const n=c(t);if(typeof o=="string"){if(e==null)throw new Error("Invalid arguments for resize");const s=R.construct(o);return c(n.one,void 0,s==="x"?e:w(n),s==="y"?e:d(n),n.root)}return c(n.one,o,void 0,void 0,n.root)},D=(t,o,e=!0)=>{const n=c(t);let s=(r,y)=>r<y;return e&&(s=(r,y)=>r<=y),"one"in o?s(a(n),a(o))&&s(h(o),h(n))&&s(f(n),f(o))&&s(_(o),_(n)):s(a(n),o.x)&&s(o.x,h(n))&&s(f(n),o.y)&&s(o.y,_(n))},X=(t,o)=>i.equals(t.one,o.one)&&i.equals(t.two,o.two)&&x.xyEquals(t.root,o.root),I=t=>({width:w(t),height:d(t)}),$=t=>({signedWidth:O(t),signedHeight:E(t)}),U=t=>({top:f(t),left:a(t),width:w(t),height:d(t)}),L=(t,o,e=!1)=>{const n=R.construct(o)==="y"?E(t):O(t);return e?n:Math.abs(n)},l=(t,o)=>{const e=c(t);return{x:o.x==="center"?b(e).x:g(e,o.x),y:o.y==="center"?b(e).y:g(e,o.y)}},g=(t,o)=>{const e=c(t),n=x.xyCouple(e.root).includes(o)?Math.min:Math.max;return m.X_LOCATIONS.includes(o)?n(e.one.x,e.two.x):n(e.one.y,e.two.y)},Y=t=>t.one.x===t.two.x&&t.one.y===t.two.y,w=t=>L(t,"x"),d=t=>L(t,"y"),O=t=>{const o=c(t);return o.two.x-o.one.x},E=t=>{const o=c(t);return o.two.y-o.one.y},q=t=>l(t,x.TOP_LEFT),k=t=>l(t,x.TOP_CENTER),J=t=>l(t,x.TOP_RIGHT),K=t=>l(t,x.BOTTOM_LEFT),Q=t=>l(t,x.BOTTOM_CENTER),V=t=>l(t,x.BOTTOM_RIGHT),tt=t=>l(t,x.CENTER_LEFT),ot=t=>l(t,x.CENTER_RIGHT),h=t=>g(t,"right"),_=t=>g(t,"bottom"),a=t=>g(t,"left"),f=t=>g(t,"top"),b=t=>i.translate(q(t),{x:O(t)/2,y:E(t)/2}),M=t=>{const o=c(t);return o.root.x==="left"?a(o):h(o)},z=t=>{const o=c(t);return o.root.y==="top"?f(o):_(o)},nt=t=>({x:M(t),y:z(t)}),N=t=>{const o=c(t);return{lower:o.one.x,upper:o.two.x}},P=t=>{const o=c(t);return{lower:o.one.y,upper:o.two.y}},et=(t,o)=>C(t,o),rt=(t,o)=>{const e=c(t),n=m.X_LOCATIONS.includes(o)?"x":m.Y_LOCATIONS.includes(o)?"y":null;if(n===null)throw new Error(`Invalid location: ${o}`);const s=o==="top"||o==="left"?Math.min:Math.max,r={...e.one},y={...e.two};return r[n]=s(e.one[n],e.two[n]),y[n]=s(e.one[n],e.two[n]),[r,y]},st=(t,o)=>{const e=c(t),n=c(o),s=M(n)+(w(n)-w(e))/2,r=z(n)+(d(n)-d(e))/2;return c({x:s,y:r},I(e))},Z=t=>typeof t!="object"||t==null?!1:"one"in t&&"two"in t&&"root"in t,ct=t=>w(t)/d(t),it=(t,o,e)=>{if(typeof o=="string"){if(e==null)throw new Error("Undefined amount passed into box.translate");const s=R.construct(o);o=i.construct(s,e)}const n=c(t);return c(i.translate(n.one,o),i.translate(n.two,o),void 0,void 0,n.root)},j=(t,o)=>{const e=Math.max(a(t),a(o)),n=Math.max(f(t),f(o)),s=Math.min(h(t),h(o)),r=Math.min(_(t),_(o));return e>s||n>r?B:c({x:e,y:n},{x:s,y:r},void 0,void 0,t.root)},A=t=>w(t)*d(t),xt=(t,o)=>{const e=c(t);return c(i.truncate(e.one,o),i.truncate(e.two,o),void 0,void 0,e.root)},F=(t,o,e,n,s,r)=>{const y={x:t,y:o},T={x:t+e,y:o+n};return s.x!==r.x&&(s.x==="center"?(y.x-=e/2,T.x-=e/2):(y.x-=e,T.x-=e)),s.y!==r.y&&(s.y==="center"?(y.y-=n/2,T.y-=n/2):(y.y-=n,T.y-=n)),c(y,T,void 0,void 0,r)},yt=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:v,ZERO:B,area:A,areaIsZero:Y,aspect:ct,bottom:_,bottomCenter:Q,bottomLeft:K,bottomRight:V,box:S,center:b,centerLeft:tt,centerRight:ot,construct:c,constructWithAlternateRoot:F,contains:D,copy:C,css:U,cssBox:H,dim:L,dims:I,domRect:W,edgePoints:rt,equals:X,height:d,intersection:j,isBox:Z,left:a,loc:g,positionInCenter:st,reRoot:et,resize:G,right:h,root:nt,signedDims:$,signedHeight:E,signedWidth:O,top:f,topCenter:k,topLeft:q,topRight:J,translate:it,truncate:xt,width:w,x:M,xBounds:N,xyLoc:l,y:z,yBounds:P},Symbol.toStringTag,{value:"Module"}));exports.area=A;exports.box=yt;exports.construct=c;exports.constructWithAlternateRoot=F;exports.height=d;exports.intersection=j;exports.isBox=Z;exports.width=w;exports.xBounds=N;exports.xyLoc=l;exports.yBounds=P;
@@ -1,205 +0,0 @@
1
- import { z as x } from "zod";
2
- import { c as O } from "./direction-8etxfKaR.js";
3
- import { c as A, T as M, B as j, b as S, d as Z, e as q, f as v, g as F, h as G, i as D, j as X } from "./location-Ar5y2DX2.js";
4
- import { Z as g, O as Y, e as I, t as b, c as U, a as L } from "./xy-D_LqxaGt.js";
5
- import { x as $, X as N, Y as k } from "./base-DFq0vvGn.js";
6
- const h = x.union([x.number(), x.string()]), J = x.object({
7
- top: h,
8
- left: h,
9
- width: h,
10
- height: h
11
- }), K = x.object({
12
- left: x.number(),
13
- top: x.number(),
14
- right: x.number(),
15
- bottom: x.number()
16
- }), Q = x.object({
17
- one: $,
18
- two: $,
19
- root: A
20
- }), H = { one: g, two: g, root: M }, V = { one: g, two: Y, root: j }, P = (t, o) => ({
21
- one: t.one,
22
- two: t.two,
23
- root: o ?? t.root
24
- }), c = (t, o, e = 0, n = 0, r) => {
25
- const s = {
26
- one: { ...g },
27
- two: { ...g },
28
- root: r ?? M
29
- };
30
- if (typeof t == "number") {
31
- if (typeof o != "number")
32
- throw new Error("Box constructor called with invalid arguments");
33
- return s.one = { x: t, y: o }, s.two = { x: s.one.x + e, y: s.one.y + n }, s;
34
- }
35
- return "one" in t && "two" in t && "root" in t ? { ...t, root: r ?? t.root } : ("getBoundingClientRect" in t && (t = t.getBoundingClientRect()), "left" in t ? (s.one = { x: t.left, y: t.top }, s.two = { x: t.right, y: t.bottom }, s) : (s.one = t, o == null ? s.two = { x: s.one.x + e, y: s.one.y + n } : typeof o == "number" ? s.two = { x: s.one.x + o, y: s.one.y + e } : "width" in o ? s.two = {
36
- x: s.one.x + o.width,
37
- y: s.one.y + o.height
38
- } : "signedWidth" in o ? s.two = {
39
- x: s.one.x + o.signedWidth,
40
- y: s.one.y + o.signedHeight
41
- } : s.two = o, s));
42
- }, tt = (t, o, e) => {
43
- const n = c(t);
44
- if (typeof o == "string") {
45
- if (e == null) throw new Error("Invalid arguments for resize");
46
- const r = O(o);
47
- return c(
48
- n.one,
49
- void 0,
50
- r === "x" ? e : f(n),
51
- r === "y" ? e : w(n),
52
- n.root
53
- );
54
- }
55
- return c(n.one, o, void 0, void 0, n.root);
56
- }, ot = (t, o, e = !0) => {
57
- const n = c(t);
58
- let r = (s, i) => s < i;
59
- return e && (r = (s, i) => s <= i), "one" in o ? r(a(n), a(o)) && r(l(o), l(n)) && r(u(n), u(o)) && r(m(o), m(n)) : r(a(n), o.x) && r(o.x, l(n)) && r(u(n), o.y) && r(o.y, m(n));
60
- }, nt = (t, o) => I(t.one, o.one) && I(t.two, o.two) && S(t.root, o.root), W = (t) => ({
61
- width: f(t),
62
- height: w(t)
63
- }), et = (t) => ({
64
- signedWidth: _(t),
65
- signedHeight: T(t)
66
- }), st = (t) => ({
67
- top: u(t),
68
- left: a(t),
69
- width: f(t),
70
- height: w(t)
71
- }), C = (t, o, e = !1) => {
72
- const n = O(o) === "y" ? T(t) : _(t);
73
- return e ? n : Math.abs(n);
74
- }, y = (t, o) => {
75
- const e = c(t);
76
- return {
77
- x: o.x === "center" ? E(e).x : d(e, o.x),
78
- y: o.y === "center" ? E(e).y : d(e, o.y)
79
- };
80
- }, d = (t, o) => {
81
- const e = c(t), n = Z(e.root).includes(o) ? Math.min : Math.max;
82
- return N.includes(o) ? n(e.one.x, e.two.x) : n(e.one.y, e.two.y);
83
- }, rt = (t) => t.one.x === t.two.x && t.one.y === t.two.y, f = (t) => C(t, "x"), w = (t) => C(t, "y"), _ = (t) => {
84
- const o = c(t);
85
- return o.two.x - o.one.x;
86
- }, T = (t) => {
87
- const o = c(t);
88
- return o.two.y - o.one.y;
89
- }, z = (t) => y(t, M), ct = (t) => y(t, q), it = (t) => y(t, v), xt = (t) => y(t, j), yt = (t) => y(t, F), at = (t) => y(t, G), ut = (t) => y(t, D), ft = (t) => y(t, X), l = (t) => d(t, "right"), m = (t) => d(t, "bottom"), a = (t) => d(t, "left"), u = (t) => d(t, "top"), E = (t) => b(z(t), {
90
- x: _(t) / 2,
91
- y: T(t) / 2
92
- }), B = (t) => {
93
- const o = c(t);
94
- return o.root.x === "left" ? a(o) : l(o);
95
- }, R = (t) => {
96
- const o = c(t);
97
- return o.root.y === "top" ? u(o) : m(o);
98
- }, wt = (t) => ({ x: B(t), y: R(t) }), lt = (t) => {
99
- const o = c(t);
100
- return { lower: o.one.x, upper: o.two.x };
101
- }, mt = (t) => {
102
- const o = c(t);
103
- return { lower: o.one.y, upper: o.two.y };
104
- }, dt = (t, o) => P(t, o), pt = (t, o) => {
105
- const e = c(t), n = N.includes(o) ? "x" : k.includes(o) ? "y" : null;
106
- if (n === null) throw new Error(`Invalid location: ${o}`);
107
- const r = o === "top" || o === "left" ? Math.min : Math.max, s = { ...e.one }, i = { ...e.two };
108
- return s[n] = r(e.one[n], e.two[n]), i[n] = r(e.one[n], e.two[n]), [s, i];
109
- }, gt = (t, o) => {
110
- const e = c(t), n = c(o), r = B(n) + (f(n) - f(e)) / 2, s = R(n) + (w(n) - w(e)) / 2;
111
- return c({ x: r, y: s }, W(e));
112
- }, ht = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, _t = (t) => f(t) / w(t), Tt = (t, o, e) => {
113
- if (typeof o == "string") {
114
- if (e == null) throw new Error("Undefined amount passed into box.translate");
115
- const r = O(o);
116
- o = U(r, e);
117
- }
118
- const n = c(t);
119
- return c(
120
- b(n.one, o),
121
- b(n.two, o),
122
- void 0,
123
- void 0,
124
- n.root
125
- );
126
- }, bt = (t, o) => {
127
- const e = Math.max(a(t), a(o)), n = Math.max(u(t), u(o)), r = Math.min(l(t), l(o)), s = Math.min(m(t), m(o));
128
- return e > r || n > s ? H : c({ x: e, y: n }, { x: r, y: s }, void 0, void 0, t.root);
129
- }, Et = (t) => f(t) * w(t), Ot = (t, o) => {
130
- const e = c(t);
131
- return c(
132
- L(e.one, o),
133
- L(e.two, o),
134
- void 0,
135
- void 0,
136
- e.root
137
- );
138
- }, Mt = (t, o, e, n, r, s) => {
139
- const i = { x: t, y: o }, p = { x: t + e, y: o + n };
140
- return r.x !== s.x && (r.x === "center" ? (i.x -= e / 2, p.x -= e / 2) : (i.x -= e, p.x -= e)), r.y !== s.y && (r.y === "center" ? (i.y -= n / 2, p.y -= n / 2) : (i.y -= n, p.y -= n)), c(i, p, void 0, void 0, s);
141
- }, $t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
142
- __proto__: null,
143
- DECIMAL: V,
144
- ZERO: H,
145
- area: Et,
146
- areaIsZero: rt,
147
- aspect: _t,
148
- bottom: m,
149
- bottomCenter: yt,
150
- bottomLeft: xt,
151
- bottomRight: at,
152
- box: Q,
153
- center: E,
154
- centerLeft: ut,
155
- centerRight: ft,
156
- construct: c,
157
- constructWithAlternateRoot: Mt,
158
- contains: ot,
159
- copy: P,
160
- css: st,
161
- cssBox: J,
162
- dim: C,
163
- dims: W,
164
- domRect: K,
165
- edgePoints: pt,
166
- equals: nt,
167
- height: w,
168
- intersection: bt,
169
- isBox: ht,
170
- left: a,
171
- loc: d,
172
- positionInCenter: gt,
173
- reRoot: dt,
174
- resize: tt,
175
- right: l,
176
- root: wt,
177
- signedDims: et,
178
- signedHeight: T,
179
- signedWidth: _,
180
- top: u,
181
- topCenter: ct,
182
- topLeft: z,
183
- topRight: it,
184
- translate: Tt,
185
- truncate: Ot,
186
- width: f,
187
- x: B,
188
- xBounds: lt,
189
- xyLoc: y,
190
- y: R,
191
- yBounds: mt
192
- }, Symbol.toStringTag, { value: "Module" }));
193
- export {
194
- Mt as a,
195
- $t as b,
196
- c,
197
- Et as d,
198
- ht as e,
199
- lt as f,
200
- w as h,
201
- bt as i,
202
- f as w,
203
- y as x,
204
- mt as y
205
- };
@@ -1 +0,0 @@
1
- "use strict";const m=require("./index-udOjA9d-.cjs");class h{value;constructor(t){this.value=t}valueOf(){return this.value}toJSON(){return this.value}toString(){return this.value.toString()}}const g=e=>e!=null&&typeof e=="object"&&"toString"in e,_=e=>{if(g(e))return e?.toString().length===0;switch(typeof e){case"string":return e.length===0;case"number":return e===0;case"bigint":return e===0n;case"boolean":return!e;case"undefined":return!0;case"object":return e==null;default:return!1}},A=Object.freeze(Object.defineProperty({__proto__:null,ValueExtension:h,isStringer:g,isZero:_},Symbol.toStringTag,{value:"Module"})),l=(e,t=!1)=>{const o=g(e)?"stringer":typeof e;let r;switch(o){case"string":r=(n,s)=>n.localeCompare(s);break;case"stringer":r=(n,s)=>n.toString().localeCompare(s.toString());break;case"number":r=(n,s)=>Number(n)-Number(s);break;case"bigint":r=(n,s)=>BigInt(n)-BigInt(s)>0n?1:-1;break;case"boolean":r=(n,s)=>Number(n)-Number(s);break;case"undefined":r=()=>0;break;default:return console.warn(`sortFunc: unknown type ${o}`),()=>-1}return t?f(r):r},E=(e,t,o)=>{const r=l(t[e],o);return(n,s)=>r(n[e],s[e])},y=(e,t)=>e.length!==t.length?e.length-t.length:e.every((o,r)=>o===t[r])?0:-1,b=(e,t)=>{if(e.length!==t.length)return e.length-t.length;if(e.length===0)return 0;const o=l(e[0]),r=[...e].sort(o),n=[...t].sort(o);return r.every((s,i)=>s===n[i])?0:-1},q=(e,t)=>{const o=m.unique$1(e),r=m.unique$1(t);return b(o,r)},P=(e,t)=>e===t?0:e==="first"&&t==="last"?1:-1,f=e=>(t,o)=>e(o,t),u=0,N=-1,p=1,d=e=>e<u,S=e=>e>u,w=e=>e>=u,T=e=>e===u,F=(e,t)=>{const o=/([a-zA-Z]+)|(\d+)/g,r=e.replace(/[\s_.-]+/g,"").match(o),n=t.replace(/[\s_.-]+/g,"").match(o);if(!r||!n)return 0;for(let s=0;s<Math.min(r.length,n.length);s++){const i=r[s],a=n[s];if(isNaN(Number(i))&&isNaN(Number(a))){const c=i.localeCompare(a);if(c!==0)return c}else if(!isNaN(Number(i))&&!isNaN(Number(a))){const c=Number(i)-Number(a);if(c!==0)return c}else return isNaN(Number(i))?-1:1}return r.length-n.length},j=Object.freeze(Object.defineProperty({__proto__:null,EQUAL:u,GREATER_THAN:p,LESS_THAN:N,isEqualTo:T,isGreaterThan:S,isGreaterThanEqual:w,isLessThan:d,newF:l,newFieldF:E,order:P,primitiveArrays:y,reverseF:f,stringsWithNumbers:F,uniqueUnorderedPrimitiveArrays:q,unorderedPrimitiveArrays:b},Symbol.toStringTag,{value:"Module"}));exports.EQUAL=u;exports.GREATER_THAN=p;exports.LESS_THAN=N;exports.ValueExtension=h;exports.compare=j;exports.isEqualTo=T;exports.isGreaterThan=S;exports.isLessThan=d;exports.newF=l;exports.primitive=A;
@@ -1,101 +0,0 @@
1
- const f = (s, e, t = ".") => {
2
- const r = s.split(t);
3
- return r.map((l, o) => {
4
- const i = e(l, o, r);
5
- return i == null ? null : typeof i == "string" ? i : i.join(t);
6
- }).filter((l) => l != null).join(t);
7
- }, u = (s, e) => {
8
- if (!Array.isArray(s)) return s[e];
9
- const t = s[e];
10
- if (t != null || s.length == 0) return t;
11
- const r = s[0];
12
- if (typeof r == "object" && "key" in r)
13
- return s.find((n) => n.key === e);
14
- }, c = (s, e, t = { optional: !1, separator: "." }) => {
15
- t.separator ??= ".";
16
- const { optional: r, getter: n = u } = t, l = e.split(t.separator);
17
- if (l.length === 1 && l[0] === "") return s;
18
- let o = s;
19
- for (const i of l) {
20
- const a = n(o, i);
21
- if (a == null) {
22
- if (r) return null;
23
- throw new Error(`Path ${e} does not exist. ${i} is null`);
24
- }
25
- o = a;
26
- }
27
- return o;
28
- }, p = (s, e, t) => {
29
- const r = e.split(".");
30
- let n = s;
31
- for (let l = 0; l < r.length - 1; l++) {
32
- const o = r[l], i = u(n, o);
33
- if (i == null) throw new Error(`Path ${e} does not exist. ${o} is null`);
34
- n = i;
35
- }
36
- try {
37
- if (!Array.isArray(n)) {
38
- n[r[r.length - 1]] = t;
39
- return;
40
- }
41
- if (n.length === 0) return;
42
- const l = parseInt(r[r.length - 1]);
43
- if (isNaN(l)) {
44
- const o = n[0];
45
- if (typeof o == "object" && "key" in o) {
46
- const i = n.findIndex((a) => a.key === r[r.length - 1]);
47
- if (i !== -1) {
48
- n[i] = t;
49
- return;
50
- }
51
- }
52
- return;
53
- }
54
- n[l] = t;
55
- } catch (l) {
56
- throw console.error("failed to set value", t, "at path", e, "on object", s), l;
57
- }
58
- }, h = (s, e) => {
59
- const t = e.split(".");
60
- let r = s;
61
- for (let n = 0; n < t.length - 1; n++) {
62
- const l = t[n];
63
- if (r[l] == null) return;
64
- r = r[l];
65
- }
66
- if (Array.isArray(r)) {
67
- const n = parseInt(t[t.length - 1]);
68
- if (isNaN(n)) return;
69
- r.splice(n, 1);
70
- return;
71
- }
72
- delete r[t[t.length - 1]];
73
- }, g = (s, e) => {
74
- const t = s.split(".");
75
- return e < 0 ? t[t.length + e] : t[e];
76
- }, y = (s, e) => {
77
- try {
78
- return c(s, e), !0;
79
- } catch {
80
- return !1;
81
- }
82
- }, d = (s, e) => {
83
- if (e.length === 0) return !0;
84
- const t = s.split("."), r = e.split(".");
85
- if (r.length > t.length) return !1;
86
- for (let n = 0; n < r.length; n++) {
87
- const l = t[n], o = r[n];
88
- if (o !== "*" && l !== o)
89
- return !1;
90
- }
91
- return !0;
92
- };
93
- export {
94
- g as e,
95
- c as g,
96
- y as h,
97
- d as p,
98
- h as r,
99
- p as s,
100
- f as t
101
- };
@@ -1 +0,0 @@
1
- "use strict";const f=(s,n,t=".")=>{const r=s.split(t);return r.map((l,o)=>{const i=n(l,o,r);return i==null?null:typeof i=="string"?i:i.join(t)}).filter(l=>l!=null).join(t)},c=(s,n)=>{if(!Array.isArray(s))return s[n];const t=s[n];if(t!=null||s.length==0)return t;const r=s[0];if(typeof r=="object"&&"key"in r)return s.find(e=>e.key===n)},a=(s,n,t={optional:!1,separator:"."})=>{t.separator??=".";const{optional:r,getter:e=c}=t,l=n.split(t.separator);if(l.length===1&&l[0]==="")return s;let o=s;for(const i of l){const u=e(o,i);if(u==null){if(r)return null;throw new Error(`Path ${n} does not exist. ${i} is null`)}o=u}return o},h=(s,n,t)=>{const r=n.split(".");let e=s;for(let l=0;l<r.length-1;l++){const o=r[l],i=c(e,o);if(i==null)throw new Error(`Path ${n} does not exist. ${o} is null`);e=i}try{if(!Array.isArray(e)){e[r[r.length-1]]=t;return}if(e.length===0)return;const l=parseInt(r[r.length-1]);if(isNaN(l)){const o=e[0];if(typeof o=="object"&&"key"in o){const i=e.findIndex(u=>u.key===r[r.length-1]);if(i!==-1){e[i]=t;return}}return}e[l]=t}catch(l){throw console.error("failed to set value",t,"at path",n,"on object",s),l}},p=(s,n)=>{const t=n.split(".");let r=s;for(let e=0;e<t.length-1;e++){const l=t[e];if(r[l]==null)return;r=r[l]}if(Array.isArray(r)){const e=parseInt(t[t.length-1]);if(isNaN(e))return;r.splice(e,1);return}delete r[t[t.length-1]]},g=(s,n)=>{const t=s.split(".");return n<0?t[t.length+n]:t[n]},y=(s,n)=>{try{return a(s,n),!0}catch{return!1}},d=(s,n)=>{if(n.length===0)return!0;const t=s.split("."),r=n.split(".");if(r.length>t.length)return!1;for(let e=0;e<r.length;e++){const l=t[e],o=r[e];if(o!=="*"&&l!==o)return!1}return!0};exports.element=g;exports.get=a;exports.has=y;exports.pathsMatch=d;exports.remove=p;exports.set=h;exports.transformPath=f;
@@ -1 +0,0 @@
1
- "use strict";const O=require("zod"),i=require("./base-BAM2mqCy.cjs"),z=O.z.union([O.z.number(),i.xy,i.numberCouple,i.dimensions,i.signedDimensions,i.clientXY]),s=(t,n)=>{if(typeof t=="string"){if(n===void 0)throw new Error("The y coordinate must be given.");return t==="x"?{x:n,y:0}:{x:0,y:n}}return typeof t=="number"?{x:t,y:n??t}:Array.isArray(t)?{x:t[0],y:t[1]}:"signedWidth"in t?{x:t.signedWidth,y:t.signedHeight}:"clientX"in t?{x:t.clientX,y:t.clientY}:"width"in t?{x:t.width,y:t.height}:{x:t.x,y:t.y}},u=Object.freeze({x:0,y:0}),P=Object.freeze({x:1,y:1}),v=Object.freeze({x:1/0,y:1/0}),w=Object.freeze({x:NaN,y:NaN}),g=(t,n,e=0)=>{const r=s(t),o=s(n);return e===0?r.x===o.x&&r.y===o.y:Math.abs(r.x-o.x)<=e&&Math.abs(r.y-o.y)<=e},E=t=>g(t,u),h=(t,n,e)=>{const r=s(t),o=s(n,e);return{x:r.x*o.x,y:r.y*o.y}},_=(t,n)=>{const e=s(t);return{x:e.x+n,y:e.y}},j=(t,n)=>{const e=s(t);return{x:e.x,y:e.y+n}},p=(t,n,e,...r)=>typeof n=="string"&&typeof e=="number"?n==="x"?_(t,e):j(t,e):[t,n,e??u,...r].reduce((o,y)=>{const c=s(y);return{x:o.x+c.x,y:o.y+c.y}},u),I=(t,n,e)=>{const r=s(t);return n==="x"?{x:e,y:r.y}:{x:r.x,y:e}},Z=(t,n)=>{const e=s(t),r=s(n);return Math.sqrt((e.x-r.x)**2+(e.y-r.y)**2)},A=(t,n)=>{const e=s(t),r=s(n);return{x:r.x-e.x,y:r.y-e.y}},T=t=>{const n=s(t);return Number.isNaN(n.x)||Number.isNaN(n.y)},H=t=>{const n=s(t);return Number.isFinite(n.x)&&Number.isFinite(n.y)},R=t=>{const n=s(t);return[n.x,n.y]},S=t=>{const n=s(t);return{left:n.x,top:n.y}},F=(t,n=0)=>{const e=s(t);return{x:Number(e.x.toFixed(n)),y:Number(e.y.toFixed(n))}},m=(t,n)=>{const e=s(t),r=s(n);return{x:e.x-r.x,y:e.y-r.y}},b=t=>{const n=s(t),e=Math.hypot(n.x,n.y);return e===0?{x:0,y:0}:{x:-n.y/e,y:n.x/e}},X=t=>{const n=s(t),e=Math.hypot(n.x,n.y);return e===0?{x:0,y:0}:{x:n.x/e,y:n.y/e}},Y=(...t)=>{const n=t.reduce((e,r)=>p(e,r),u);return h(n,1/t.length)},W=(t,n)=>{const e=[];for(let r=0;r<t.length;r++){const o=t[r];let y,c,d,x;if(r===0){const a=t[r+1],l=m(a,o);c=b(l),d=c,x=n}else if(r===t.length-1){const a=t[r-1],l=m(o,a);y=b(l),d=y,x=n}else{const a=t[r-1],l=t[r+1],f=m(o,a),N=m(l,o);y=b(f),c=b(N);const q=Math.acos((f.x*N.x+f.y*N.y)/(Math.hypot(f.x,f.y)*Math.hypot(N.x,N.y))),M=Math.sin(q/2);M===0?x=n:x=n/M,d=X(Y(y,c))}e.push(h(d,x))}return e},C=t=>{const n=s(t);return{x:n.y,y:n.x}},D=Object.freeze(Object.defineProperty({__proto__:null,INFINITY:v,NAN:w,ONE:P,ZERO:u,average:Y,calculateMiters:W,clientXY:i.clientXY,construct:s,couple:R,crudeZ:z,css:S,distance:Z,equals:g,isFinite:H,isNan:T,isZero:E,normal:b,normalize:X,scale:h,set:I,sub:m,swap:C,translate:p,translateX:_,translateY:j,translation:A,truncate:F,xy:i.xy},Symbol.toStringTag,{value:"Module"}));exports.ONE=P;exports.ZERO=u;exports.construct=s;exports.crudeZ=z;exports.equals=g;exports.translate=p;exports.truncate=F;exports.xy=D;